mirror of
https://github.com/docmost/docmost.git
synced 2026-09-12 08:21:32 +08:00
Compare commits
4
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2cd5b861b9 | ||
|
|
1a4ed15c38 | ||
|
|
90e3437be7 | ||
|
|
ca8e492d30 |
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
FROM node:26-slim AS base
|
FROM node:26-slim AS base
|
||||||
LABEL org.opencontainers.image.source="https://github.com/docmost/docmost"
|
LABEL org.opencontainers.image.source="https://github.com/docmost/docmost"
|
||||||
|
|
||||||
RUN npm install -g pnpm@11.25.0
|
RUN npm install -g pnpm@11.23.0
|
||||||
|
|
||||||
FROM base AS builder
|
FROM base AS builder
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,6 @@
|
|||||||
"@docmost/base-formula": "workspace:*",
|
"@docmost/base-formula": "workspace:*",
|
||||||
"@docmost/editor-ext": "workspace:*",
|
"@docmost/editor-ext": "workspace:*",
|
||||||
"@excalidraw/excalidraw": "0.18.0-3a5ef40",
|
"@excalidraw/excalidraw": "0.18.0-3a5ef40",
|
||||||
"@fontsource-variable/inter": "5.3.0",
|
|
||||||
"@mantine/core": "9.3.2",
|
"@mantine/core": "9.3.2",
|
||||||
"@mantine/dates": "9.3.2",
|
"@mantine/dates": "9.3.2",
|
||||||
"@mantine/form": "9.3.2",
|
"@mantine/form": "9.3.2",
|
||||||
|
|||||||
@@ -294,7 +294,6 @@
|
|||||||
"Export space": "Bereich exportieren",
|
"Export space": "Bereich exportieren",
|
||||||
"Export {{type}}": "Exportiere {{type}}",
|
"Export {{type}}": "Exportiere {{type}}",
|
||||||
"File exceeds the {{limit}} attachment limit": "Datei überschreitet das Anhängelimit von {{limit}}",
|
"File exceeds the {{limit}} attachment limit": "Datei überschreitet das Anhängelimit von {{limit}}",
|
||||||
"Media": "Medien",
|
|
||||||
"Align left": "Links ausrichten",
|
"Align left": "Links ausrichten",
|
||||||
"Align right": "Rechts ausrichten",
|
"Align right": "Rechts ausrichten",
|
||||||
"Align center": "Zentrieren",
|
"Align center": "Zentrieren",
|
||||||
@@ -388,8 +387,6 @@
|
|||||||
"Insert horizontal rule divider": "Horizontale Trennlinie einfügen",
|
"Insert horizontal rule divider": "Horizontale Trennlinie einfügen",
|
||||||
"Page break": "Seitenumbruch",
|
"Page break": "Seitenumbruch",
|
||||||
"Insert a page break for printing.": "Einen Seitenumbruch zum Drucken einfügen.",
|
"Insert a page break for printing.": "Einen Seitenumbruch zum Drucken einfügen.",
|
||||||
"Footnote": "Fußnote",
|
|
||||||
"Insert a footnote reference.": "Einen Fußnotenverweis einfügen.",
|
|
||||||
"Upload any image from your device.": "Laden Sie ein beliebiges Bild von Ihrem Gerät hoch.",
|
"Upload any image from your device.": "Laden Sie ein beliebiges Bild von Ihrem Gerät hoch.",
|
||||||
"Upload any video from your device.": "Laden Sie ein beliebiges Video von Ihrem Gerät hoch.",
|
"Upload any video from your device.": "Laden Sie ein beliebiges Video von Ihrem Gerät hoch.",
|
||||||
"Upload any audio from your device.": "Laden Sie beliebige Audiodateien von Ihrem Gerät hoch.",
|
"Upload any audio from your device.": "Laden Sie beliebige Audiodateien von Ihrem Gerät hoch.",
|
||||||
@@ -707,11 +704,9 @@
|
|||||||
"Enable the MCP server to allow AI assistants and tools to interact with your workspace content.": "Aktivieren Sie den MCP-Server, damit KI-Assistenten und -Tools mit den Inhalten Ihres Arbeitsbereichs interagieren können.",
|
"Enable the MCP server to allow AI assistants and tools to interact with your workspace content.": "Aktivieren Sie den MCP-Server, damit KI-Assistenten und -Tools mit den Inhalten Ihres Arbeitsbereichs interagieren können.",
|
||||||
"MCP is only available in the Docmost enterprise edition. Contact sales@docmost.com.": "MCP ist nur in der Docmost Enterprise-Edition verfügbar. Kontaktieren Sie sales@docmost.com.",
|
"MCP is only available in the Docmost enterprise edition. Contact sales@docmost.com.": "MCP ist nur in der Docmost Enterprise-Edition verfügbar. Kontaktieren Sie sales@docmost.com.",
|
||||||
"MCP Server URL": "MCP-Server-URL",
|
"MCP Server URL": "MCP-Server-URL",
|
||||||
"Connect AI assistants with your Docmost account via OAuth.": "Verbinde AI-Assistenten über OAuth mit deinem Docmost-Konto.",
|
"Use your API key for authentication. You can manage API keys in your account settings.": "Verwenden Sie Ihren API-Schlüssel zur Authentifizierung. API-Schlüssel können in Ihren Kontoeinstellungen verwaltet werden.",
|
||||||
"Enforce OAuth": "OAuth erzwingen",
|
|
||||||
"AI assistants must connect with a Docmost account via OAuth. API keys cannot be used with the MCP server.": "AI-Assistenten müssen sich über OAuth mit einem Docmost-Konto verbinden. API-Schlüssel können nicht mit dem MCP-Server verwendet werden.",
|
|
||||||
"Toggle enforce OAuth for MCP": "OAuth-Erzwingung für MCP umschalten",
|
|
||||||
"Supported tools": "Unterstützte Tools",
|
"Supported tools": "Unterstützte Tools",
|
||||||
|
"Your workspace has MCP enabled. Use your API key to connect AI assistants.": "In Ihrem Arbeitsbereich ist MCP aktiviert. Verwenden Sie Ihren API-Schlüssel, um KI-Assistenten anzubinden.",
|
||||||
"MCP server URL:": "MCP-Server-URL:",
|
"MCP server URL:": "MCP-Server-URL:",
|
||||||
"Learn more": "Mehr erfahren",
|
"Learn more": "Mehr erfahren",
|
||||||
"Manage API keys for all users in the workspace. View the <anchor>API documentation</anchor> for usage details.": "Verwalten Sie API-Schlüssel für alle Nutzer im Arbeitsbereich. Siehe die <anchor>API-Dokumentation</anchor> für Details zur Verwendung.",
|
"Manage API keys for all users in the workspace. View the <anchor>API documentation</anchor> for usage details.": "Verwalten Sie API-Schlüssel für alle Nutzer im Arbeitsbereich. Siehe die <anchor>API-Dokumentation</anchor> für Details zur Verwendung.",
|
||||||
@@ -1294,48 +1289,5 @@
|
|||||||
"{{count}} rows deleted_one": "1 row deleted",
|
"{{count}} rows deleted_one": "1 row deleted",
|
||||||
"{{count}} rows deleted_other": "{{count}} rows deleted",
|
"{{count}} rows deleted_other": "{{count}} rows deleted",
|
||||||
"{{count}} selected_one": "1 selected",
|
"{{count}} selected_one": "1 selected",
|
||||||
"{{count}} selected_other": "{{count}} selected",
|
"{{count}} selected_other": "{{count}} selected"
|
||||||
"Compare": "Vergleichen",
|
|
||||||
"Compare versions": "Versionen vergleichen",
|
|
||||||
"Select version from {{date}}": "Version vom {{date}} auswählen",
|
|
||||||
"Version actions for {{date}}": "Versionsaktionen für {{date}}",
|
|
||||||
"Comparing {{newer}} and {{older}}": "{{newer}} und {{older}} werden verglichen",
|
|
||||||
"Exit compare": "Vergleich beenden",
|
|
||||||
"Search attachments...": "Anhänge suchen...",
|
|
||||||
"Error loading attachments.": "Fehler beim Laden der Anhänge.",
|
|
||||||
"No attachments on this page yet.": "Auf dieser Seite gibt es noch keine Anhänge.",
|
|
||||||
"Uploaded by {{name}}": "Hochgeladen von {{name}}",
|
|
||||||
"Download {{name}}": "{{name}} herunterladen",
|
|
||||||
"Access revoked": "Zugriff widerrufen",
|
|
||||||
"Authorize application": "Anwendung autorisieren",
|
|
||||||
"{{name}} wants to access {{workspace}}": "{{name}} möchte auf {{workspace}} zugreifen",
|
|
||||||
"Not you? Switch account": "Nicht du? Konto wechseln",
|
|
||||||
"This application will be able to:": "Diese Anwendung kann Folgendes:",
|
|
||||||
"Write": "Schreiben",
|
|
||||||
"Invalid authorization request": "Ungültige Autorisierungsanfrage",
|
|
||||||
"Authorize": "Autorisieren",
|
|
||||||
"Application": "Anwendung",
|
|
||||||
"Permissions": "Berechtigungen",
|
|
||||||
"Authorized": "Autorisiert",
|
|
||||||
"Revoke access": "Zugriff widerrufen",
|
|
||||||
"Revoke access for {{name}}": "Zugriff für {{name}} widerrufen",
|
|
||||||
"Are you sure you want to revoke access for {{name}}? The application will no longer be able to access your account.": "Möchtest du den Zugriff für {{name}} wirklich widerrufen? Die Anwendung kann dann nicht mehr auf dein Konto zugreifen.",
|
|
||||||
"Something went wrong. Please try again.": "Etwas ist schiefgelaufen. Bitte versuche es erneut.",
|
|
||||||
"Remove {{name}}": "{{name}} entfernen",
|
|
||||||
"Make sure you trust this application before authorizing it.": "Stelle sicher, dass du dieser Anwendung vertraust, bevor du sie autorisierst.",
|
|
||||||
"You will be redirected to": "Du wirst weitergeleitet zu",
|
|
||||||
"View content without making changes.": "Inhalte ansehen, ohne Änderungen vorzunehmen.",
|
|
||||||
"Create and modify content.": "Inhalte erstellen und bearbeiten.",
|
|
||||||
"Applications and AI assistants you have authorized to access your account.": "Anwendungen und AI-Assistenten, denen du den Zugriff auf dein Konto autorisiert hast.",
|
|
||||||
"Your workspace has MCP enabled. Connect AI assistants with your Docmost account via OAuth.": "MCP ist für deinen Workspace aktiviert. Verbinde AI-Assistenten über OAuth mit deinem Docmost-Konto.",
|
|
||||||
"Authorized apps": "Autorisierte Apps",
|
|
||||||
"No authorized apps yet.": "Noch keine autorisierten Apps.",
|
|
||||||
"Workspace knowledge only": "Nur Workspace-Wissen",
|
|
||||||
"Restrict AI Chat to answering from your workspace pages and uploaded files only. It will not use outside knowledge.": "Beschränke den AI-Chat darauf, nur anhand deiner Workspace-Seiten und hochgeladenen Dateien zu antworten. Es wird kein externes Wissen verwendet.",
|
|
||||||
"Toggle workspace knowledge only": "Nur Workspace-Wissen umschalten",
|
|
||||||
"Read-only mode": "Schreibgeschützter Modus",
|
|
||||||
"AI Chat can search and read workspace content, but cannot create or edit pages.": "AI-Chat kann Workspace-Inhalte durchsuchen und lesen, aber keine Seiten erstellen oder bearbeiten.",
|
|
||||||
"Toggle AI Chat read-only mode": "Schreibgeschützten Modus für AI-Chat umschalten",
|
|
||||||
"Title only": "Nur Titel",
|
|
||||||
"you": "du"
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,24 +47,24 @@
|
|||||||
"Are you sure you want to delete this page? This will delete its children and page history. This action is irreversible.": "Are you sure you want to delete this page? This will delete its children and page history. This action is irreversible.",
|
"Are you sure you want to delete this page? This will delete its children and page history. This action is irreversible.": "Are you sure you want to delete this page? This will delete its children and page history. This action is irreversible.",
|
||||||
"Description": "Description",
|
"Description": "Description",
|
||||||
"Details": "Details",
|
"Details": "Details",
|
||||||
"e.g ACME": "e.g. ACME",
|
"e.g ACME": "e.g ACME",
|
||||||
"e.g ACME Inc": "e.g. ACME Inc",
|
"e.g ACME Inc": "e.g ACME Inc",
|
||||||
"e.g Developers": "e.g. Developers",
|
"e.g Developers": "e.g Developers",
|
||||||
"e.g Group for developers": "e.g. Group for developers",
|
"e.g Group for developers": "e.g Group for developers",
|
||||||
"e.g product": "e.g. product",
|
"e.g product": "e.g product",
|
||||||
"e.g Product Team": "e.g. Product Team",
|
"e.g Product Team": "e.g Product Team",
|
||||||
"e.g Sales": "e.g. Sales",
|
"e.g Sales": "e.g Sales",
|
||||||
"e.g Space for product team": "e.g. Space for product team",
|
"e.g Space for product team": "e.g Space for product team",
|
||||||
"e.g Space for sales team to collaborate": "e.g. Space for sales team to collaborate",
|
"e.g Space for sales team to collaborate": "e.g Space for sales team to collaborate",
|
||||||
"Edit": "Edit",
|
"Edit": "Edit",
|
||||||
"Read": "Read",
|
"Read": "Read",
|
||||||
"Edit group": "Edit group",
|
"Edit group": "Edit group",
|
||||||
"Email": "Email",
|
"Email": "Email",
|
||||||
"Enter a strong password": "Enter a strong password",
|
"Enter a strong password": "Enter a strong password",
|
||||||
"Enter valid email addresses separated by comma or space max_50": "Enter valid email addresses separated by comma or space [max: 50]",
|
"Enter valid email addresses separated by comma or space max_50": "Enter valid email addresses separated by comma or space [max: 50]",
|
||||||
"enter valid emails addresses": "Enter valid email addresses",
|
"enter valid emails addresses": "enter valid emails addresses",
|
||||||
"Enter your current password": "Enter your current password",
|
"Enter your current password": "Enter your current password",
|
||||||
"enter your full name": "Enter your full name",
|
"enter your full name": "enter your full name",
|
||||||
"Enter your new password": "Enter your new password",
|
"Enter your new password": "Enter your new password",
|
||||||
"Enter your new preferred email": "Enter your new preferred email",
|
"Enter your new preferred email": "Enter your new preferred email",
|
||||||
"Enter your password": "Enter your password",
|
"Enter your password": "Enter your password",
|
||||||
@@ -112,7 +112,7 @@
|
|||||||
"Import pages": "Import pages",
|
"Import pages": "Import pages",
|
||||||
"Import pages & space settings": "Import pages & space settings",
|
"Import pages & space settings": "Import pages & space settings",
|
||||||
"Importing pages": "Importing pages",
|
"Importing pages": "Importing pages",
|
||||||
"invalid invitation link": "Invalid invitation link",
|
"invalid invitation link": "invalid invitation link",
|
||||||
"Invitation signup": "Invitation signup",
|
"Invitation signup": "Invitation signup",
|
||||||
"Invite by email": "Invite by email",
|
"Invite by email": "Invite by email",
|
||||||
"Invite members": "Invite members",
|
"Invite members": "Invite members",
|
||||||
@@ -223,7 +223,7 @@
|
|||||||
"Your password must be a minimum of 8 characters.": "Your password must be a minimum of 8 characters.",
|
"Your password must be a minimum of 8 characters.": "Your password must be a minimum of 8 characters.",
|
||||||
"Sidebar toggle": "Sidebar toggle",
|
"Sidebar toggle": "Sidebar toggle",
|
||||||
"Comments": "Comments",
|
"Comments": "Comments",
|
||||||
"404 page not found": "404! Page not found",
|
"404 page not found": "404 page not found",
|
||||||
"Sorry, we can't find the page you are looking for.": "Sorry, we can't find the page you are looking for.",
|
"Sorry, we can't find the page you are looking for.": "Sorry, we can't find the page you are looking for.",
|
||||||
"Take me back to homepage": "Take me back to homepage",
|
"Take me back to homepage": "Take me back to homepage",
|
||||||
"Forgot password": "Forgot password",
|
"Forgot password": "Forgot password",
|
||||||
@@ -423,7 +423,7 @@
|
|||||||
"Insert current date": "Insert current date",
|
"Insert current date": "Insert current date",
|
||||||
"Time": "Time",
|
"Time": "Time",
|
||||||
"Insert current time": "Insert current time",
|
"Insert current time": "Insert current time",
|
||||||
"Draw and sketch excalidraw diagrams": "Draw and sketch Excalidraw diagrams",
|
"Draw and sketch excalidraw diagrams": "Draw and sketch excalidraw diagrams",
|
||||||
"Multiple": "Multiple",
|
"Multiple": "Multiple",
|
||||||
"Turn into": "Turn into",
|
"Turn into": "Turn into",
|
||||||
"Text align": "Text align",
|
"Text align": "Text align",
|
||||||
@@ -708,9 +708,9 @@
|
|||||||
"MCP is only available in the Docmost enterprise edition. Contact sales@docmost.com.": "MCP is only available in the Docmost enterprise edition. Contact sales@docmost.com.",
|
"MCP is only available in the Docmost enterprise edition. Contact sales@docmost.com.": "MCP is only available in the Docmost enterprise edition. Contact sales@docmost.com.",
|
||||||
"MCP Server URL": "MCP Server URL",
|
"MCP Server URL": "MCP Server URL",
|
||||||
"Connect AI assistants with your Docmost account via OAuth.": "Connect AI assistants with your Docmost account via OAuth.",
|
"Connect AI assistants with your Docmost account via OAuth.": "Connect AI assistants with your Docmost account via OAuth.",
|
||||||
"Enforce OAuth": "Enforce OAuth",
|
"Require OAuth": "Require OAuth",
|
||||||
"AI assistants must connect with a Docmost account via OAuth. API keys cannot be used with the MCP server.": "AI assistants must connect with a Docmost account via OAuth. API keys cannot be used with the MCP server.",
|
"AI assistants must connect with a Docmost account via OAuth. API keys cannot be used with the MCP server.": "AI assistants must connect with a Docmost account via OAuth. API keys cannot be used with the MCP server.",
|
||||||
"Toggle enforce OAuth for MCP": "Toggle enforce OAuth for MCP",
|
"Toggle require OAuth for MCP": "Toggle require OAuth for MCP",
|
||||||
"Supported tools": "Supported tools",
|
"Supported tools": "Supported tools",
|
||||||
"MCP server URL:": "MCP server URL:",
|
"MCP server URL:": "MCP server URL:",
|
||||||
"Learn more": "Learn more",
|
"Learn more": "Learn more",
|
||||||
@@ -793,10 +793,6 @@
|
|||||||
"Removed page restriction": "Removed page restriction",
|
"Removed page restriction": "Removed page restriction",
|
||||||
"Added page permission": "Added page permission",
|
"Added page permission": "Added page permission",
|
||||||
"Removed page permission": "Removed page permission",
|
"Removed page permission": "Removed page permission",
|
||||||
"Changed page permission": "Changed page permission",
|
|
||||||
"Requested password reset": "Requested password reset",
|
|
||||||
"Created template": "Created template",
|
|
||||||
"Deleted template": "Deleted template",
|
|
||||||
"day": "day",
|
"day": "day",
|
||||||
"days": "days",
|
"days": "days",
|
||||||
"week": "week",
|
"week": "week",
|
||||||
@@ -833,7 +829,7 @@
|
|||||||
"Choose how this page should stay accurate.": "Choose how this page should stay accurate.",
|
"Choose how this page should stay accurate.": "Choose how this page should stay accurate.",
|
||||||
"Recurring verification": "Recurring verification",
|
"Recurring verification": "Recurring verification",
|
||||||
"Verifiers re-confirm this page on a schedule.": "Verifiers re-confirm this page on a schedule.",
|
"Verifiers re-confirm this page on a schedule.": "Verifiers re-confirm this page on a schedule.",
|
||||||
"Re-verify on a schedule (e.g every 30 days )": "Re-verify on a schedule (e.g. every 30 days)",
|
"Re-verify on a schedule (e.g every 30 days )": "Re-verify on a schedule (e.g every 30 days )",
|
||||||
"Page stays editable at all times": "Page stays editable at all times",
|
"Page stays editable at all times": "Page stays editable at all times",
|
||||||
"Best for runbooks, FAQs, living documentation": "Best for runbooks, FAQs, living documentation",
|
"Best for runbooks, FAQs, living documentation": "Best for runbooks, FAQs, living documentation",
|
||||||
"Approval workflow": "Approval workflow",
|
"Approval workflow": "Approval workflow",
|
||||||
@@ -884,9 +880,6 @@
|
|||||||
"<bold>{{name}}</bold> returned a page for revision": "<bold>{{name}}</bold> returned a page for revision",
|
"<bold>{{name}}</bold> returned a page for revision": "<bold>{{name}}</bold> returned a page for revision",
|
||||||
"Page verification expires soon": "Page verification expires soon",
|
"Page verification expires soon": "Page verification expires soon",
|
||||||
"Page verification has expired": "Page verification has expired",
|
"Page verification has expired": "Page verification has expired",
|
||||||
"SIEM destination <bold>{{name}}</bold> is failing": "SIEM destination <bold>{{name}}</bold> is failing",
|
|
||||||
"SIEM destination <bold>{{name}}</bold> was disabled after 24 hours of failures": "SIEM destination <bold>{{name}}</bold> was disabled after 24 hours of failures",
|
|
||||||
"SIEM destination <bold>{{name}}</bold> recovered": "SIEM destination <bold>{{name}}</bold> recovered",
|
|
||||||
"Verifying your email": "Verifying your email",
|
"Verifying your email": "Verifying your email",
|
||||||
"Please wait...": "Please wait...",
|
"Please wait...": "Please wait...",
|
||||||
"Verification failed. The link may have expired.": "Verification failed. The link may have expired.",
|
"Verification failed. The link may have expired.": "Verification failed. The link may have expired.",
|
||||||
@@ -1258,7 +1251,7 @@
|
|||||||
"Not started": "Not started",
|
"Not started": "Not started",
|
||||||
"Number": "Number",
|
"Number": "Number",
|
||||||
"One month ago": "One month ago",
|
"One month ago": "One month ago",
|
||||||
"One month from now": "In one month",
|
"One month from now": "One month from now",
|
||||||
"One week ago": "One week ago",
|
"One week ago": "One week ago",
|
||||||
"One week from now": "One week from now",
|
"One week from now": "One week from now",
|
||||||
"Open as page": "Open as page",
|
"Open as page": "Open as page",
|
||||||
@@ -1344,137 +1337,5 @@
|
|||||||
"AI Chat can search and read workspace content, but cannot create or edit pages.": "AI Chat can search and read workspace content, but cannot create or edit pages.",
|
"AI Chat can search and read workspace content, but cannot create or edit pages.": "AI Chat can search and read workspace content, but cannot create or edit pages.",
|
||||||
"Toggle AI Chat read-only mode": "Toggle AI Chat read-only mode",
|
"Toggle AI Chat read-only mode": "Toggle AI Chat read-only mode",
|
||||||
"Title only": "Title only",
|
"Title only": "Title only",
|
||||||
"you": "you",
|
"you": "you"
|
||||||
"Allow public spaces": "Allow public spaces",
|
|
||||||
"Space admins can publish their spaces to the web.": "Space admins can publish their spaces to the web.",
|
|
||||||
"Toggle allow public spaces": "Toggle allow public spaces",
|
|
||||||
"Publish space to the web": "Publish space to the web",
|
|
||||||
"Anyone on the internet will be able to read every page in this space, except restricted pages. Are you sure?": "Anyone on the internet will be able to read every page in this space, except restricted pages. Are you sure?",
|
|
||||||
"Make this space publicly readable by anyone on the internet.": "Make this space publicly readable by anyone on the internet.",
|
|
||||||
"Toggle publish space to the web": "Toggle publish space to the web",
|
|
||||||
"Allow search engines to index": "Allow search engines to index",
|
|
||||||
"Let public pages in this space appear in search engine results.": "Let public pages in this space appear in search engine results.",
|
|
||||||
"Toggle search engine indexing": "Toggle search engine indexing",
|
|
||||||
"Public space link": "Public space link",
|
|
||||||
"Copy public space link": "Copy public space link",
|
|
||||||
"Renaming the space slug will break public links.": "Renaming the space slug will break public links.",
|
|
||||||
"Failed to update space": "Failed to update space",
|
|
||||||
"This space is public": "This space is public",
|
|
||||||
"Anyone on the internet can read the pages in this space, except restricted pages.": "Anyone on the internet can read the pages in this space, except restricted pages.",
|
|
||||||
"Open public site": "Open public site",
|
|
||||||
"Public": "Public",
|
|
||||||
"This space has no public pages yet.": "This space has no public pages yet.",
|
|
||||||
"On this page": "On this page",
|
|
||||||
"Previous": "Previous",
|
|
||||||
"Next": "Next",
|
|
||||||
"Show hidden pages": "Show hidden pages",
|
|
||||||
"Page navigation": "Page navigation",
|
|
||||||
"Toggle sidebar": "Toggle sidebar",
|
|
||||||
"Toggle table of contents": "Toggle table of contents",
|
|
||||||
"Appearance": "Appearance",
|
|
||||||
"Forest": "Forest",
|
|
||||||
"Violet": "Violet",
|
|
||||||
"Light mode color": "Light mode color",
|
|
||||||
"Dark mode color": "Dark mode color",
|
|
||||||
"Choose the primary color of the public docs site.": "Choose the primary color of the public docs site.",
|
|
||||||
"Show page author": "Show page author",
|
|
||||||
"Display the page creator's name on public pages.": "Display the page creator's name on public pages.",
|
|
||||||
"Toggle show page author": "Toggle show page author",
|
|
||||||
"Show last updated": "Show last updated",
|
|
||||||
"Display when each page was last updated.": "Display when each page was last updated.",
|
|
||||||
"Toggle show last updated": "Toggle show last updated",
|
|
||||||
"Open public page": "Open public page",
|
|
||||||
"Toggle color scheme": "Toggle color scheme",
|
|
||||||
"Ember": "Ember",
|
|
||||||
"Rose": "Rose",
|
|
||||||
"Documentation": "Documentation",
|
|
||||||
"All published spaces.": "All published spaces.",
|
|
||||||
"No public spaces yet.": "No public spaces yet.",
|
|
||||||
"Show public directory": "Show public directory",
|
|
||||||
"List published spaces at /docs for anyone to browse.": "List published spaces at /docs for anyone to browse.",
|
|
||||||
"Toggle show public directory": "Toggle show public directory",
|
|
||||||
"Show in public directory": "Show in public directory",
|
|
||||||
"List this space in the public directory at /docs.": "List this space in the public directory at /docs.",
|
|
||||||
"Toggle show in public directory": "Toggle show in public directory",
|
|
||||||
"Open public space link": "Open public space link",
|
|
||||||
"Disable public spaces": "Disable public spaces",
|
|
||||||
"Space admins will be able to make their spaces publicly readable by anyone on the internet. Are you sure?": "Space admins will be able to make their spaces publicly readable by anyone on the internet. Are you sure?",
|
|
||||||
"This will immediately unpublish every published space. Re-enabling later will not republish them. Are you sure?": "This will immediately unpublish every published space. Re-enabling later will not republish them. Are you sure?",
|
|
||||||
"Allow": "Allow",
|
|
||||||
"Shared pages": "Shared pages",
|
|
||||||
"Published spaces": "Published spaces",
|
|
||||||
"Spaces published to the web will appear here": "Spaces published to the web will appear here",
|
|
||||||
"No published spaces": "No published spaces",
|
|
||||||
"Published by": "Published by",
|
|
||||||
"Published at": "Published at",
|
|
||||||
"Open space": "Open space",
|
|
||||||
"Unpublish": "Unpublish",
|
|
||||||
"Unpublish space": "Unpublish space",
|
|
||||||
"This space will no longer be publicly accessible. Are you sure?": "This space will no longer be publicly accessible. Are you sure?",
|
|
||||||
"More options for {{name}}": "More options for {{name}}",
|
|
||||||
"Edit page": "Edit page",
|
|
||||||
"Sign in": "Sign in",
|
|
||||||
"Open app": "Open app",
|
|
||||||
"No spaces match your search.": "No spaces match your search.",
|
|
||||||
"Welcome to our documentation": "Welcome to our documentation",
|
|
||||||
"Guides, references and answers across all our published spaces.": "Guides, references and answers across all our published spaces.",
|
|
||||||
"Guides, references and answers across all our spaces.": "Guides, references and answers across all our spaces.",
|
|
||||||
"Search documentation...": "Search documentation...",
|
|
||||||
"1 published space": "1 published space",
|
|
||||||
"{{count}} published spaces": "{{count}} published spaces",
|
|
||||||
"Actions": "Actions",
|
|
||||||
"Add destination": "Add destination",
|
|
||||||
"Are you sure you want to delete the destination": "Are you sure you want to delete the destination",
|
|
||||||
"Audit logs": "Audit logs",
|
|
||||||
"Audit logs & SIEM": "Audit logs & SIEM",
|
|
||||||
"Auth header name": "Auth header name",
|
|
||||||
"Auth header prefix": "Auth header prefix",
|
|
||||||
"Body format": "Body format",
|
|
||||||
"Created SIEM destination": "Created SIEM destination",
|
|
||||||
"Datadog site": "Datadog site",
|
|
||||||
"Defaults to this instance's hostname": "Defaults to this instance's hostname",
|
|
||||||
"Delete destination": "Delete destination",
|
|
||||||
"Deleted SIEM destination": "Deleted SIEM destination",
|
|
||||||
"Destination created": "Destination created",
|
|
||||||
"Destination deleted": "Destination deleted",
|
|
||||||
"Destination updated": "Destination updated",
|
|
||||||
"Disabled": "Disabled",
|
|
||||||
"Edit destination": "Edit destination",
|
|
||||||
"Endpoint URL": "Endpoint URL",
|
|
||||||
"Failing": "Failing",
|
|
||||||
"Failing since {{time}}": "Failing since {{time}}",
|
|
||||||
"HEC token": "HEC token",
|
|
||||||
"HEC URL": "HEC URL",
|
|
||||||
"Healthy": "Healthy",
|
|
||||||
"Hide advanced options": "Hide advanced options",
|
|
||||||
"Host": "Host",
|
|
||||||
"Index": "Index",
|
|
||||||
"Insecure: connections can be intercepted.": "Insecure: connections can be intercepted.",
|
|
||||||
"JSON array": "JSON array",
|
|
||||||
"Last delivered": "Last delivered",
|
|
||||||
"Last error": "Last error",
|
|
||||||
"Leave empty to use the token's default index": "Leave empty to use the token's default index",
|
|
||||||
"Maximum of {{limit}} destinations reached": "Maximum of {{limit}} destinations reached",
|
|
||||||
"Could not load SIEM destinations: {{message}}": "Could not load SIEM destinations: {{message}}",
|
|
||||||
"No destinations yet": "No destinations yet",
|
|
||||||
"Preset": "Preset",
|
|
||||||
"Retry now": "Retry now",
|
|
||||||
"Retry scheduled": "Retry scheduled",
|
|
||||||
"Send test event": "Send test event",
|
|
||||||
"Sent in the auth header below. Leave empty if your receiver does not need one.": "Sent in the auth header below. Leave empty if your receiver does not need one.",
|
|
||||||
"Service": "Service",
|
|
||||||
"Show advanced options": "Show advanced options",
|
|
||||||
"SIEM": "SIEM",
|
|
||||||
"SIEM streaming": "SIEM streaming",
|
|
||||||
"SIEM streaming requires an Enterprise license.": "SIEM streaming requires an Enterprise license.",
|
|
||||||
"Source": "Source",
|
|
||||||
"Sourcetype": "Sourcetype",
|
|
||||||
"Tags": "Tags",
|
|
||||||
"Test connection": "Test connection",
|
|
||||||
"Test event delivered successfully.": "Test event delivered successfully.",
|
|
||||||
"Test the connection before saving.": "Test the connection before saving.",
|
|
||||||
"Test event delivered to {{name}}": "Test event delivered to {{name}}",
|
|
||||||
"Updated SIEM destination": "Updated SIEM destination",
|
|
||||||
"Verify TLS certificate": "Verify TLS certificate",
|
|
||||||
"e.g. Splunk prod": "e.g. Splunk prod"
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -294,7 +294,6 @@
|
|||||||
"Export space": "Exportar espacio",
|
"Export space": "Exportar espacio",
|
||||||
"Export {{type}}": "Exportar {{type}}",
|
"Export {{type}}": "Exportar {{type}}",
|
||||||
"File exceeds the {{limit}} attachment limit": "El archivo supera el límite de {{limit}} adjuntos",
|
"File exceeds the {{limit}} attachment limit": "El archivo supera el límite de {{limit}} adjuntos",
|
||||||
"Media": "Multimedia",
|
|
||||||
"Align left": "Alinear a la izquierda",
|
"Align left": "Alinear a la izquierda",
|
||||||
"Align right": "Alinear a la derecha",
|
"Align right": "Alinear a la derecha",
|
||||||
"Align center": "Alinear al centro",
|
"Align center": "Alinear al centro",
|
||||||
@@ -388,8 +387,6 @@
|
|||||||
"Insert horizontal rule divider": "Insertar regla horizontal",
|
"Insert horizontal rule divider": "Insertar regla horizontal",
|
||||||
"Page break": "Salto de página",
|
"Page break": "Salto de página",
|
||||||
"Insert a page break for printing.": "Inserta un salto de página para imprimir.",
|
"Insert a page break for printing.": "Inserta un salto de página para imprimir.",
|
||||||
"Footnote": "Nota al pie",
|
|
||||||
"Insert a footnote reference.": "Insertar una referencia de nota al pie.",
|
|
||||||
"Upload any image from your device.": "Sube cualquier imagen desde tu dispositivo.",
|
"Upload any image from your device.": "Sube cualquier imagen desde tu dispositivo.",
|
||||||
"Upload any video from your device.": "Sube cualquier video desde tu dispositivo.",
|
"Upload any video from your device.": "Sube cualquier video desde tu dispositivo.",
|
||||||
"Upload any audio from your device.": "Sube cualquier audio desde tu dispositivo.",
|
"Upload any audio from your device.": "Sube cualquier audio desde tu dispositivo.",
|
||||||
@@ -707,11 +704,9 @@
|
|||||||
"Enable the MCP server to allow AI assistants and tools to interact with your workspace content.": "Habilite el servidor MCP para permitir que asistentes de IA y herramientas interactúen con el contenido de su espacio de trabajo.",
|
"Enable the MCP server to allow AI assistants and tools to interact with your workspace content.": "Habilite el servidor MCP para permitir que asistentes de IA y herramientas interactúen con el contenido de su espacio de trabajo.",
|
||||||
"MCP is only available in the Docmost enterprise edition. Contact sales@docmost.com.": "MCP solo está disponible en la edición empresarial de Docmost. Contacte con sales@docmost.com.",
|
"MCP is only available in the Docmost enterprise edition. Contact sales@docmost.com.": "MCP solo está disponible en la edición empresarial de Docmost. Contacte con sales@docmost.com.",
|
||||||
"MCP Server URL": "URL del servidor MCP",
|
"MCP Server URL": "URL del servidor MCP",
|
||||||
"Connect AI assistants with your Docmost account via OAuth.": "Conecta asistentes de IA con tu cuenta de Docmost mediante OAuth.",
|
"Use your API key for authentication. You can manage API keys in your account settings.": "Use su clave API para la autenticación. Puede gestionar las claves API en la configuración de su cuenta.",
|
||||||
"Enforce OAuth": "Exigir OAuth",
|
|
||||||
"AI assistants must connect with a Docmost account via OAuth. API keys cannot be used with the MCP server.": "Los asistentes de IA deben conectarse con una cuenta de Docmost mediante OAuth. No se pueden usar claves API con el servidor MCP.",
|
|
||||||
"Toggle enforce OAuth for MCP": "Activar o desactivar la exigencia de OAuth para MCP",
|
|
||||||
"Supported tools": "Herramientas compatibles",
|
"Supported tools": "Herramientas compatibles",
|
||||||
|
"Your workspace has MCP enabled. Use your API key to connect AI assistants.": "Su espacio de trabajo tiene MCP habilitado. Use su clave API para conectar asistentes de IA.",
|
||||||
"MCP server URL:": "URL del servidor MCP:",
|
"MCP server URL:": "URL del servidor MCP:",
|
||||||
"Learn more": "Más información",
|
"Learn more": "Más información",
|
||||||
"Manage API keys for all users in the workspace. View the <anchor>API documentation</anchor> for usage details.": "Gestiona las claves de API para todos los usuarios en el espacio de trabajo. Consulta la <anchor>documentación de la API</anchor> para detalles de uso.",
|
"Manage API keys for all users in the workspace. View the <anchor>API documentation</anchor> for usage details.": "Gestiona las claves de API para todos los usuarios en el espacio de trabajo. Consulta la <anchor>documentación de la API</anchor> para detalles de uso.",
|
||||||
@@ -1191,8 +1186,8 @@
|
|||||||
"Default value": "Valor predeterminado",
|
"Default value": "Valor predeterminado",
|
||||||
"Delete property": "Eliminar propiedad",
|
"Delete property": "Eliminar propiedad",
|
||||||
"Delete view": "Eliminar vista",
|
"Delete view": "Eliminar vista",
|
||||||
"Delete {{count}} rows?_one": "¿Eliminar 1 fila?",
|
"Delete {{count}} rows?_one": "Delete 1 row?",
|
||||||
"Delete {{count}} rows?_other": "¿Eliminar {{count}} filas?",
|
"Delete {{count}} rows?_other": "Delete {{count}} rows?",
|
||||||
"Descending": "Descendente",
|
"Descending": "Descendente",
|
||||||
"Discard": "Descartar",
|
"Discard": "Descartar",
|
||||||
"Doesn't contain": "No contiene",
|
"Doesn't contain": "No contiene",
|
||||||
@@ -1291,51 +1286,8 @@
|
|||||||
"Value": "Valor",
|
"Value": "Valor",
|
||||||
"View updated for everyone": "Vista actualizada para todos",
|
"View updated for everyone": "Vista actualizada para todos",
|
||||||
"You have unsaved changes. Do you want to discard them?": "Tiene cambios no guardados. ¿Quiere descartarlos?",
|
"You have unsaved changes. Do you want to discard them?": "Tiene cambios no guardados. ¿Quiere descartarlos?",
|
||||||
"{{count}} rows deleted_one": "1 fila eliminada",
|
"{{count}} rows deleted_one": "1 row deleted",
|
||||||
"{{count}} rows deleted_other": "{{count}} filas eliminadas",
|
"{{count}} rows deleted_other": "{{count}} rows deleted",
|
||||||
"{{count}} selected_one": "1 seleccionado",
|
"{{count}} selected_one": "1 selected",
|
||||||
"{{count}} selected_other": "{{count}} seleccionadas",
|
"{{count}} selected_other": "{{count}} selected"
|
||||||
"Compare": "Comparar",
|
|
||||||
"Compare versions": "Comparar versiones",
|
|
||||||
"Select version from {{date}}": "Seleccionar la versión del {{date}}",
|
|
||||||
"Version actions for {{date}}": "Acciones de la versión del {{date}}",
|
|
||||||
"Comparing {{newer}} and {{older}}": "Comparando {{newer}} y {{older}}",
|
|
||||||
"Exit compare": "Salir de la comparación",
|
|
||||||
"Search attachments...": "Buscar archivos adjuntos...",
|
|
||||||
"Error loading attachments.": "Error al cargar los archivos adjuntos.",
|
|
||||||
"No attachments on this page yet.": "Todavía no hay archivos adjuntos en esta página.",
|
|
||||||
"Uploaded by {{name}}": "Subido por {{name}}",
|
|
||||||
"Download {{name}}": "Descargar {{name}}",
|
|
||||||
"Access revoked": "Acceso revocado",
|
|
||||||
"Authorize application": "Autorizar aplicación",
|
|
||||||
"{{name}} wants to access {{workspace}}": "{{name}} quiere acceder a {{workspace}}",
|
|
||||||
"Not you? Switch account": "¿No eres tú? Cambiar de cuenta",
|
|
||||||
"This application will be able to:": "Esta aplicación podrá:",
|
|
||||||
"Write": "Escribir",
|
|
||||||
"Invalid authorization request": "Solicitud de autorización no válida",
|
|
||||||
"Authorize": "Autorizar",
|
|
||||||
"Application": "Aplicación",
|
|
||||||
"Permissions": "Permisos",
|
|
||||||
"Authorized": "Autorizado",
|
|
||||||
"Revoke access": "Revocar acceso",
|
|
||||||
"Revoke access for {{name}}": "Revocar acceso para {{name}}",
|
|
||||||
"Are you sure you want to revoke access for {{name}}? The application will no longer be able to access your account.": "¿Seguro que quieres revocar el acceso de {{name}}? La aplicación ya no podrá acceder a tu cuenta.",
|
|
||||||
"Something went wrong. Please try again.": "Algo salió mal. Inténtalo de nuevo.",
|
|
||||||
"Remove {{name}}": "Eliminar {{name}}",
|
|
||||||
"Make sure you trust this application before authorizing it.": "Asegúrate de confiar en esta aplicación antes de autorizarla.",
|
|
||||||
"You will be redirected to": "Serás redirigido a",
|
|
||||||
"View content without making changes.": "Ver contenido sin realizar cambios.",
|
|
||||||
"Create and modify content.": "Crear y modificar contenido.",
|
|
||||||
"Applications and AI assistants you have authorized to access your account.": "Aplicaciones y asistentes de IA que has autorizado para acceder a tu cuenta.",
|
|
||||||
"Your workspace has MCP enabled. Connect AI assistants with your Docmost account via OAuth.": "Tu espacio de trabajo tiene MCP habilitado. Conecta asistentes de IA con tu cuenta de Docmost mediante OAuth.",
|
|
||||||
"Authorized apps": "Aplicaciones autorizadas",
|
|
||||||
"No authorized apps yet.": "Todavía no hay aplicaciones autorizadas.",
|
|
||||||
"Workspace knowledge only": "Solo conocimiento del espacio de trabajo",
|
|
||||||
"Restrict AI Chat to answering from your workspace pages and uploaded files only. It will not use outside knowledge.": "Restringe AI Chat para que responda solo con información de las páginas y archivos subidos de tu espacio de trabajo. No usará conocimiento externo.",
|
|
||||||
"Toggle workspace knowledge only": "Alternar solo conocimiento del espacio de trabajo",
|
|
||||||
"Read-only mode": "Modo de solo lectura",
|
|
||||||
"AI Chat can search and read workspace content, but cannot create or edit pages.": "AI Chat puede buscar y leer el contenido del espacio de trabajo, pero no puede crear ni editar páginas.",
|
|
||||||
"Toggle AI Chat read-only mode": "Alternar modo de solo lectura de AI Chat",
|
|
||||||
"Title only": "Solo título",
|
|
||||||
"you": "tú"
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -294,7 +294,6 @@
|
|||||||
"Export space": "Exporter l'espace",
|
"Export space": "Exporter l'espace",
|
||||||
"Export {{type}}": "Exporter {{type}}",
|
"Export {{type}}": "Exporter {{type}}",
|
||||||
"File exceeds the {{limit}} attachment limit": "Le fichier dépasse la limite de {{limit}} pièces jointes",
|
"File exceeds the {{limit}} attachment limit": "Le fichier dépasse la limite de {{limit}} pièces jointes",
|
||||||
"Media": "Médias",
|
|
||||||
"Align left": "Aligner à gauche",
|
"Align left": "Aligner à gauche",
|
||||||
"Align right": "Aligner à droite",
|
"Align right": "Aligner à droite",
|
||||||
"Align center": "Aligner au centre",
|
"Align center": "Aligner au centre",
|
||||||
@@ -388,8 +387,6 @@
|
|||||||
"Insert horizontal rule divider": "Insérer un séparateur de règle horizontale",
|
"Insert horizontal rule divider": "Insérer un séparateur de règle horizontale",
|
||||||
"Page break": "Saut de page",
|
"Page break": "Saut de page",
|
||||||
"Insert a page break for printing.": "Insérer un saut de page pour l’impression.",
|
"Insert a page break for printing.": "Insérer un saut de page pour l’impression.",
|
||||||
"Footnote": "Note de bas de page",
|
|
||||||
"Insert a footnote reference.": "Insérer une référence de note de bas de page.",
|
|
||||||
"Upload any image from your device.": "Téléchargez n'importe quelle image depuis votre appareil.",
|
"Upload any image from your device.": "Téléchargez n'importe quelle image depuis votre appareil.",
|
||||||
"Upload any video from your device.": "Téléchargez n'importe quelle vidéo depuis votre appareil.",
|
"Upload any video from your device.": "Téléchargez n'importe quelle vidéo depuis votre appareil.",
|
||||||
"Upload any audio from your device.": "Téléchargez n'importe quel fichier audio depuis votre appareil.",
|
"Upload any audio from your device.": "Téléchargez n'importe quel fichier audio depuis votre appareil.",
|
||||||
@@ -707,11 +704,9 @@
|
|||||||
"Enable the MCP server to allow AI assistants and tools to interact with your workspace content.": "Activez le serveur MCP pour permettre aux assistants et outils IA d'interagir avec le contenu de votre espace de travail.",
|
"Enable the MCP server to allow AI assistants and tools to interact with your workspace content.": "Activez le serveur MCP pour permettre aux assistants et outils IA d'interagir avec le contenu de votre espace de travail.",
|
||||||
"MCP is only available in the Docmost enterprise edition. Contact sales@docmost.com.": "MCP n'est disponible que dans l'édition Entreprise de Docmost. Contactez sales@docmost.com.",
|
"MCP is only available in the Docmost enterprise edition. Contact sales@docmost.com.": "MCP n'est disponible que dans l'édition Entreprise de Docmost. Contactez sales@docmost.com.",
|
||||||
"MCP Server URL": "URL du serveur MCP",
|
"MCP Server URL": "URL du serveur MCP",
|
||||||
"Connect AI assistants with your Docmost account via OAuth.": "Connectez des assistants IA à votre compte Docmost via OAuth.",
|
"Use your API key for authentication. You can manage API keys in your account settings.": "Utilisez votre clé API pour l'authentification. Vous pouvez gérer les clés API dans les paramètres de votre compte.",
|
||||||
"Enforce OAuth": "Imposer OAuth",
|
|
||||||
"AI assistants must connect with a Docmost account via OAuth. API keys cannot be used with the MCP server.": "Les assistants IA doivent se connecter avec un compte Docmost via OAuth. Les clés API ne peuvent pas être utilisées avec le serveur MCP.",
|
|
||||||
"Toggle enforce OAuth for MCP": "Activer ou désactiver l’imposition d’OAuth pour MCP",
|
|
||||||
"Supported tools": "Outils pris en charge",
|
"Supported tools": "Outils pris en charge",
|
||||||
|
"Your workspace has MCP enabled. Use your API key to connect AI assistants.": "Votre espace de travail a MCP activé. Utilisez votre clé API pour connecter des assistants IA.",
|
||||||
"MCP server URL:": "URL du serveur MCP :",
|
"MCP server URL:": "URL du serveur MCP :",
|
||||||
"Learn more": "En savoir plus",
|
"Learn more": "En savoir plus",
|
||||||
"Manage API keys for all users in the workspace. View the <anchor>API documentation</anchor> for usage details.": "Gérez les clés API pour tous les utilisateurs de l'espace de travail. Consultez la <anchor>documentation API</anchor> pour plus de détails sur l'utilisation.",
|
"Manage API keys for all users in the workspace. View the <anchor>API documentation</anchor> for usage details.": "Gérez les clés API pour tous les utilisateurs de l'espace de travail. Consultez la <anchor>documentation API</anchor> pour plus de détails sur l'utilisation.",
|
||||||
@@ -1191,8 +1186,8 @@
|
|||||||
"Default value": "Valeur par défaut",
|
"Default value": "Valeur par défaut",
|
||||||
"Delete property": "Supprimer la propriété",
|
"Delete property": "Supprimer la propriété",
|
||||||
"Delete view": "Supprimer la vue",
|
"Delete view": "Supprimer la vue",
|
||||||
"Delete {{count}} rows?_one": "Supprimer 1 ligne ?",
|
"Delete {{count}} rows?_one": "Delete 1 row?",
|
||||||
"Delete {{count}} rows?_other": "Supprimer {{count}} lignes ?",
|
"Delete {{count}} rows?_other": "Delete {{count}} rows?",
|
||||||
"Descending": "Décroissant",
|
"Descending": "Décroissant",
|
||||||
"Discard": "Ignorer",
|
"Discard": "Ignorer",
|
||||||
"Doesn't contain": "Ne contient pas",
|
"Doesn't contain": "Ne contient pas",
|
||||||
@@ -1291,51 +1286,8 @@
|
|||||||
"Value": "Valeur",
|
"Value": "Valeur",
|
||||||
"View updated for everyone": "Vue mise à jour pour tout le monde",
|
"View updated for everyone": "Vue mise à jour pour tout le monde",
|
||||||
"You have unsaved changes. Do you want to discard them?": "Vous avez des modifications non enregistrées. Voulez-vous les ignorer ?",
|
"You have unsaved changes. Do you want to discard them?": "Vous avez des modifications non enregistrées. Voulez-vous les ignorer ?",
|
||||||
"{{count}} rows deleted_one": "1 ligne supprimée",
|
"{{count}} rows deleted_one": "1 row deleted",
|
||||||
"{{count}} rows deleted_other": "{{count}} lignes supprimées",
|
"{{count}} rows deleted_other": "{{count}} rows deleted",
|
||||||
"{{count}} selected_one": "1 sélectionné(e)",
|
"{{count}} selected_one": "1 selected",
|
||||||
"{{count}} selected_other": "{{count}} sélectionné(e)s",
|
"{{count}} selected_other": "{{count}} selected"
|
||||||
"Compare": "Comparer",
|
|
||||||
"Compare versions": "Comparer les versions",
|
|
||||||
"Select version from {{date}}": "Sélectionner la version du {{date}}",
|
|
||||||
"Version actions for {{date}}": "Actions de version pour le {{date}}",
|
|
||||||
"Comparing {{newer}} and {{older}}": "Comparaison de {{newer}} et {{older}}",
|
|
||||||
"Exit compare": "Quitter la comparaison",
|
|
||||||
"Search attachments...": "Rechercher des pièces jointes...",
|
|
||||||
"Error loading attachments.": "Erreur lors du chargement des pièces jointes.",
|
|
||||||
"No attachments on this page yet.": "Aucune pièce jointe sur cette page pour le moment.",
|
|
||||||
"Uploaded by {{name}}": "Téléversé par {{name}}",
|
|
||||||
"Download {{name}}": "Télécharger {{name}}",
|
|
||||||
"Access revoked": "Accès révoqué",
|
|
||||||
"Authorize application": "Autoriser l’application",
|
|
||||||
"{{name}} wants to access {{workspace}}": "{{name}} souhaite accéder à {{workspace}}",
|
|
||||||
"Not you? Switch account": "Ce n’est pas vous ? Changer de compte",
|
|
||||||
"This application will be able to:": "Cette application pourra :",
|
|
||||||
"Write": "Écriture",
|
|
||||||
"Invalid authorization request": "Demande d’autorisation invalide",
|
|
||||||
"Authorize": "Autoriser",
|
|
||||||
"Application": "Application",
|
|
||||||
"Permissions": "Autorisations",
|
|
||||||
"Authorized": "Autorisé",
|
|
||||||
"Revoke access": "Révoquer l’accès",
|
|
||||||
"Revoke access for {{name}}": "Révoquer l’accès pour {{name}}",
|
|
||||||
"Are you sure you want to revoke access for {{name}}? The application will no longer be able to access your account.": "Êtes-vous sûr de vouloir révoquer l’accès pour {{name}} ? L’application ne pourra plus accéder à votre compte.",
|
|
||||||
"Something went wrong. Please try again.": "Une erreur s’est produite. Veuillez réessayer.",
|
|
||||||
"Remove {{name}}": "Supprimer {{name}}",
|
|
||||||
"Make sure you trust this application before authorizing it.": "Assurez-vous de faire confiance à cette application avant de l’autoriser.",
|
|
||||||
"You will be redirected to": "Vous serez redirigé vers",
|
|
||||||
"View content without making changes.": "Afficher le contenu sans apporter de modifications.",
|
|
||||||
"Create and modify content.": "Créer et modifier du contenu.",
|
|
||||||
"Applications and AI assistants you have authorized to access your account.": "Applications et assistants IA que vous avez autorisés à accéder à votre compte.",
|
|
||||||
"Your workspace has MCP enabled. Connect AI assistants with your Docmost account via OAuth.": "MCP est activé dans votre espace de travail. Connectez des assistants IA à votre compte Docmost via OAuth.",
|
|
||||||
"Authorized apps": "Applications autorisées",
|
|
||||||
"No authorized apps yet.": "Aucune application autorisée pour le moment.",
|
|
||||||
"Workspace knowledge only": "Connaissances de l’espace de travail uniquement",
|
|
||||||
"Restrict AI Chat to answering from your workspace pages and uploaded files only. It will not use outside knowledge.": "Limiter AI Chat aux réponses provenant uniquement des pages de votre espace de travail et des fichiers téléversés. Il n’utilisera pas de connaissances externes.",
|
|
||||||
"Toggle workspace knowledge only": "Activer/désactiver les connaissances de l’espace de travail uniquement",
|
|
||||||
"Read-only mode": "Mode lecture seule",
|
|
||||||
"AI Chat can search and read workspace content, but cannot create or edit pages.": "AI Chat peut rechercher et lire le contenu de l’espace de travail, mais ne peut pas créer ni modifier des pages.",
|
|
||||||
"Toggle AI Chat read-only mode": "Activer/désactiver le mode lecture seule d’AI Chat",
|
|
||||||
"Title only": "Titre uniquement",
|
|
||||||
"you": "vous"
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -205,7 +205,7 @@
|
|||||||
"Templates": "Modelli",
|
"Templates": "Modelli",
|
||||||
"Theme": "Tema",
|
"Theme": "Tema",
|
||||||
"To change your email, you have to enter your password and new email.": "Per cambiare la tua email, devi inserire la tua password e la nuova email.",
|
"To change your email, you have to enter your password and new email.": "Per cambiare la tua email, devi inserire la tua password e la nuova email.",
|
||||||
"Toggle full page width": "Attiva/disattiva larghezza intera della pagina",
|
"Toggle full page width": "Attiva/disattiva larghezza completa della pagina",
|
||||||
"Unable to import pages. Please try again.": "Impossibile importare le pagine. Riprova.",
|
"Unable to import pages. Please try again.": "Impossibile importare le pagine. Riprova.",
|
||||||
"untitled": "senza titolo",
|
"untitled": "senza titolo",
|
||||||
"Untitled": "Senza titolo",
|
"Untitled": "Senza titolo",
|
||||||
@@ -294,7 +294,6 @@
|
|||||||
"Export space": "Esporta spazio",
|
"Export space": "Esporta spazio",
|
||||||
"Export {{type}}": "Esporta {{type}}",
|
"Export {{type}}": "Esporta {{type}}",
|
||||||
"File exceeds the {{limit}} attachment limit": "Il file supera il limite per gli allegati di {{limit}}",
|
"File exceeds the {{limit}} attachment limit": "Il file supera il limite per gli allegati di {{limit}}",
|
||||||
"Media": "Contenuti multimediali",
|
|
||||||
"Align left": "Allinea a sinistra",
|
"Align left": "Allinea a sinistra",
|
||||||
"Align right": "Allinea a destra",
|
"Align right": "Allinea a destra",
|
||||||
"Align center": "Allinea al centro",
|
"Align center": "Allinea al centro",
|
||||||
@@ -388,8 +387,6 @@
|
|||||||
"Insert horizontal rule divider": "Inserisci divisore di regola orizzontale",
|
"Insert horizontal rule divider": "Inserisci divisore di regola orizzontale",
|
||||||
"Page break": "Interruzione di pagina",
|
"Page break": "Interruzione di pagina",
|
||||||
"Insert a page break for printing.": "Inserisci un'interruzione di pagina per la stampa.",
|
"Insert a page break for printing.": "Inserisci un'interruzione di pagina per la stampa.",
|
||||||
"Footnote": "Nota a piè di pagina",
|
|
||||||
"Insert a footnote reference.": "Inserisci un riferimento a una nota a piè di pagina.",
|
|
||||||
"Upload any image from your device.": "Carica un'immagine dal tuo dispositivo.",
|
"Upload any image from your device.": "Carica un'immagine dal tuo dispositivo.",
|
||||||
"Upload any video from your device.": "Carica qualsiasi video dal tuo dispositivo.",
|
"Upload any video from your device.": "Carica qualsiasi video dal tuo dispositivo.",
|
||||||
"Upload any audio from your device.": "Carica qualsiasi audio dal tuo dispositivo.",
|
"Upload any audio from your device.": "Carica qualsiasi audio dal tuo dispositivo.",
|
||||||
@@ -707,11 +704,9 @@
|
|||||||
"Enable the MCP server to allow AI assistants and tools to interact with your workspace content.": "Abilita il server MCP per consentire ad assistenti e strumenti IA di interagire con i contenuti del tuo spazio di lavoro.",
|
"Enable the MCP server to allow AI assistants and tools to interact with your workspace content.": "Abilita il server MCP per consentire ad assistenti e strumenti IA di interagire con i contenuti del tuo spazio di lavoro.",
|
||||||
"MCP is only available in the Docmost enterprise edition. Contact sales@docmost.com.": "MCP è disponibile solo nell'edizione Enterprise di Docmost. Contatta sales@docmost.com.",
|
"MCP is only available in the Docmost enterprise edition. Contact sales@docmost.com.": "MCP è disponibile solo nell'edizione Enterprise di Docmost. Contatta sales@docmost.com.",
|
||||||
"MCP Server URL": "URL del server MCP",
|
"MCP Server URL": "URL del server MCP",
|
||||||
"Connect AI assistants with your Docmost account via OAuth.": "Connetti gli assistenti AI al tuo account Docmost tramite OAuth.",
|
"Use your API key for authentication. You can manage API keys in your account settings.": "Usa la tua chiave API per l'autenticazione. Puoi gestire le chiavi API nelle impostazioni del tuo account.",
|
||||||
"Enforce OAuth": "Rendi obbligatorio OAuth",
|
|
||||||
"AI assistants must connect with a Docmost account via OAuth. API keys cannot be used with the MCP server.": "Gli assistenti AI devono connettersi con un account Docmost tramite OAuth. Le chiavi API non possono essere utilizzate con il server MCP.",
|
|
||||||
"Toggle enforce OAuth for MCP": "Attiva/disattiva l'obbligo di OAuth per MCP",
|
|
||||||
"Supported tools": "Strumenti supportati",
|
"Supported tools": "Strumenti supportati",
|
||||||
|
"Your workspace has MCP enabled. Use your API key to connect AI assistants.": "Il tuo spazio di lavoro ha MCP abilitato. Usa la tua chiave API per collegare gli assistenti IA.",
|
||||||
"MCP server URL:": "URL del server MCP:",
|
"MCP server URL:": "URL del server MCP:",
|
||||||
"Learn more": "Scopri di più",
|
"Learn more": "Scopri di più",
|
||||||
"Manage API keys for all users in the workspace. View the <anchor>API documentation</anchor> for usage details.": "Gestisci le API key per tutti gli utenti nello spazio di lavoro. Consulta la <anchor>documentazione API</anchor> per i dettagli sull'utilizzo.",
|
"Manage API keys for all users in the workspace. View the <anchor>API documentation</anchor> for usage details.": "Gestisci le API key per tutti gli utenti nello spazio di lavoro. Consulta la <anchor>documentazione API</anchor> per i dettagli sull'utilizzo.",
|
||||||
@@ -1191,8 +1186,8 @@
|
|||||||
"Default value": "Valore predefinito",
|
"Default value": "Valore predefinito",
|
||||||
"Delete property": "Elimina proprietà",
|
"Delete property": "Elimina proprietà",
|
||||||
"Delete view": "Elimina vista",
|
"Delete view": "Elimina vista",
|
||||||
"Delete {{count}} rows?_one": "Eliminare 1 riga?",
|
"Delete {{count}} rows?_one": "Delete 1 row?",
|
||||||
"Delete {{count}} rows?_other": "Eliminare {{count}} righe?",
|
"Delete {{count}} rows?_other": "Delete {{count}} rows?",
|
||||||
"Descending": "Decrescente",
|
"Descending": "Decrescente",
|
||||||
"Discard": "Ignora",
|
"Discard": "Ignora",
|
||||||
"Doesn't contain": "Non contiene",
|
"Doesn't contain": "Non contiene",
|
||||||
@@ -1291,51 +1286,8 @@
|
|||||||
"Value": "Valore",
|
"Value": "Valore",
|
||||||
"View updated for everyone": "Vista aggiornata per tutti",
|
"View updated for everyone": "Vista aggiornata per tutti",
|
||||||
"You have unsaved changes. Do you want to discard them?": "Hai modifiche non salvate. Vuoi ignorarle?",
|
"You have unsaved changes. Do you want to discard them?": "Hai modifiche non salvate. Vuoi ignorarle?",
|
||||||
"{{count}} rows deleted_one": "1 riga eliminata",
|
"{{count}} rows deleted_one": "1 row deleted",
|
||||||
"{{count}} rows deleted_other": "{{count}} righe eliminate",
|
"{{count}} rows deleted_other": "{{count}} rows deleted",
|
||||||
"{{count}} selected_one": "1 selezionato",
|
"{{count}} selected_one": "1 selected",
|
||||||
"{{count}} selected_other": "{{count}} selezionati",
|
"{{count}} selected_other": "{{count}} selected"
|
||||||
"Compare": "Confronta",
|
|
||||||
"Compare versions": "Confronta versioni",
|
|
||||||
"Select version from {{date}}": "Seleziona la versione del {{date}}",
|
|
||||||
"Version actions for {{date}}": "Azioni della versione del {{date}}",
|
|
||||||
"Comparing {{newer}} and {{older}}": "Confronto tra {{newer}} e {{older}}",
|
|
||||||
"Exit compare": "Esci dal confronto",
|
|
||||||
"Search attachments...": "Cerca allegati...",
|
|
||||||
"Error loading attachments.": "Errore durante il caricamento degli allegati.",
|
|
||||||
"No attachments on this page yet.": "Ancora nessun allegato in questa pagina.",
|
|
||||||
"Uploaded by {{name}}": "Caricato da {{name}}",
|
|
||||||
"Download {{name}}": "Scarica {{name}}",
|
|
||||||
"Access revoked": "Accesso revocato",
|
|
||||||
"Authorize application": "Autorizza applicazione",
|
|
||||||
"{{name}} wants to access {{workspace}}": "{{name}} vuole accedere a {{workspace}}",
|
|
||||||
"Not you? Switch account": "Non sei tu? Cambia account",
|
|
||||||
"This application will be able to:": "Questa applicazione potrà:",
|
|
||||||
"Write": "Scrivere",
|
|
||||||
"Invalid authorization request": "Richiesta di autorizzazione non valida",
|
|
||||||
"Authorize": "Autorizza",
|
|
||||||
"Application": "Applicazione",
|
|
||||||
"Permissions": "Autorizzazioni",
|
|
||||||
"Authorized": "Autorizzato",
|
|
||||||
"Revoke access": "Revoca accesso",
|
|
||||||
"Revoke access for {{name}}": "Revoca l'accesso per {{name}}",
|
|
||||||
"Are you sure you want to revoke access for {{name}}? The application will no longer be able to access your account.": "Sei sicuro di voler revocare l'accesso per {{name}}? L'applicazione non potrà più accedere al tuo account.",
|
|
||||||
"Something went wrong. Please try again.": "Qualcosa è andato storto. Riprova.",
|
|
||||||
"Remove {{name}}": "Rimuovi {{name}}",
|
|
||||||
"Make sure you trust this application before authorizing it.": "Assicurati di fidarti di questa applicazione prima di autorizzarla.",
|
|
||||||
"You will be redirected to": "Verrai reindirizzato a",
|
|
||||||
"View content without making changes.": "Visualizza il contenuto senza apportare modifiche.",
|
|
||||||
"Create and modify content.": "Crea e modifica contenuti.",
|
|
||||||
"Applications and AI assistants you have authorized to access your account.": "Applicazioni e assistenti AI che hai autorizzato ad accedere al tuo account.",
|
|
||||||
"Your workspace has MCP enabled. Connect AI assistants with your Docmost account via OAuth.": "Il tuo workspace ha MCP abilitato. Connetti gli assistenti AI al tuo account Docmost tramite OAuth.",
|
|
||||||
"Authorized apps": "App autorizzate",
|
|
||||||
"No authorized apps yet.": "Ancora nessuna app autorizzata.",
|
|
||||||
"Workspace knowledge only": "Solo conoscenze del workspace",
|
|
||||||
"Restrict AI Chat to answering from your workspace pages and uploaded files only. It will not use outside knowledge.": "Limita AI Chat a rispondere solo in base alle pagine del tuo workspace e ai file caricati. Non userà conoscenze esterne.",
|
|
||||||
"Toggle workspace knowledge only": "Attiva/disattiva solo conoscenze del workspace",
|
|
||||||
"Read-only mode": "Modalità di sola lettura",
|
|
||||||
"AI Chat can search and read workspace content, but cannot create or edit pages.": "AI Chat può cercare e leggere i contenuti del workspace, ma non può creare o modificare pagine.",
|
|
||||||
"Toggle AI Chat read-only mode": "Attiva/disattiva la modalità di sola lettura di AI Chat",
|
|
||||||
"Title only": "Solo titolo",
|
|
||||||
"you": "tu"
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -294,7 +294,6 @@
|
|||||||
"Export space": "エクスポートスペース",
|
"Export space": "エクスポートスペース",
|
||||||
"Export {{type}}": "{{type}}をエクスポート",
|
"Export {{type}}": "{{type}}をエクスポート",
|
||||||
"File exceeds the {{limit}} attachment limit": "ファイルが{{limit}}の添付制限を超えています",
|
"File exceeds the {{limit}} attachment limit": "ファイルが{{limit}}の添付制限を超えています",
|
||||||
"Media": "メディア",
|
|
||||||
"Align left": "左揃え",
|
"Align left": "左揃え",
|
||||||
"Align right": "右揃え",
|
"Align right": "右揃え",
|
||||||
"Align center": "中央揃え",
|
"Align center": "中央揃え",
|
||||||
@@ -388,8 +387,6 @@
|
|||||||
"Insert horizontal rule divider": "区切り線を挿入します",
|
"Insert horizontal rule divider": "区切り線を挿入します",
|
||||||
"Page break": "改ページ",
|
"Page break": "改ページ",
|
||||||
"Insert a page break for printing.": "印刷用に改ページを挿入します。",
|
"Insert a page break for printing.": "印刷用に改ページを挿入します。",
|
||||||
"Footnote": "脚注",
|
|
||||||
"Insert a footnote reference.": "脚注参照を挿入します。",
|
|
||||||
"Upload any image from your device.": "デバイスから画像をアップロードします",
|
"Upload any image from your device.": "デバイスから画像をアップロードします",
|
||||||
"Upload any video from your device.": "デバイスから動画をアップロードします",
|
"Upload any video from your device.": "デバイスから動画をアップロードします",
|
||||||
"Upload any audio from your device.": "デバイスから音声ファイルをアップロードします。",
|
"Upload any audio from your device.": "デバイスから音声ファイルをアップロードします。",
|
||||||
@@ -707,11 +704,9 @@
|
|||||||
"Enable the MCP server to allow AI assistants and tools to interact with your workspace content.": "MCP サーバーを有効にして、AI アシスタントやツールがワークスペースのコンテンツとやり取りできるようにします。",
|
"Enable the MCP server to allow AI assistants and tools to interact with your workspace content.": "MCP サーバーを有効にして、AI アシスタントやツールがワークスペースのコンテンツとやり取りできるようにします。",
|
||||||
"MCP is only available in the Docmost enterprise edition. Contact sales@docmost.com.": "MCP は Docmost のエンタープライズ版でのみ利用可能です。sales@docmost.com までお問い合わせください。",
|
"MCP is only available in the Docmost enterprise edition. Contact sales@docmost.com.": "MCP は Docmost のエンタープライズ版でのみ利用可能です。sales@docmost.com までお問い合わせください。",
|
||||||
"MCP Server URL": "MCP サーバーの URL",
|
"MCP Server URL": "MCP サーバーの URL",
|
||||||
"Connect AI assistants with your Docmost account via OAuth.": "OAuth を使用して AI アシスタントを Docmost アカウントに接続します。",
|
"Use your API key for authentication. You can manage API keys in your account settings.": "認証には API キーを使用してください。API キーはアカウント設定で管理できます。",
|
||||||
"Enforce OAuth": "OAuth を必須化",
|
|
||||||
"AI assistants must connect with a Docmost account via OAuth. API keys cannot be used with the MCP server.": "AI アシスタントは OAuth を使用して Docmost アカウントに接続する必要があります。MCP サーバーでは API キーは使用できません。",
|
|
||||||
"Toggle enforce OAuth for MCP": "MCP の OAuth 必須化を切り替え",
|
|
||||||
"Supported tools": "サポートされているツール",
|
"Supported tools": "サポートされているツール",
|
||||||
|
"Your workspace has MCP enabled. Use your API key to connect AI assistants.": "このワークスペースでは MCP が有効になっています。AI アシスタントを接続するには API キーを使用してください。",
|
||||||
"MCP server URL:": "MCP サーバーの URL:",
|
"MCP server URL:": "MCP サーバーの URL:",
|
||||||
"Learn more": "詳細を見る",
|
"Learn more": "詳細を見る",
|
||||||
"Manage API keys for all users in the workspace. View the <anchor>API documentation</anchor> for usage details.": "ワークスペース内のすべてのユーザーのAPIキーを管理します。利用方法の詳細は<anchor>APIドキュメント</anchor>をご覧ください。",
|
"Manage API keys for all users in the workspace. View the <anchor>API documentation</anchor> for usage details.": "ワークスペース内のすべてのユーザーのAPIキーを管理します。利用方法の詳細は<anchor>APIドキュメント</anchor>をご覧ください。",
|
||||||
@@ -1191,7 +1186,7 @@
|
|||||||
"Default value": "デフォルト値",
|
"Default value": "デフォルト値",
|
||||||
"Delete property": "プロパティを削除",
|
"Delete property": "プロパティを削除",
|
||||||
"Delete view": "ビューを削除",
|
"Delete view": "ビューを削除",
|
||||||
"Delete {{count}} rows?_one": "1行を削除しますか?",
|
"Delete {{count}} rows?_one": "Delete 1 row?",
|
||||||
"Delete {{count}} rows?_other": "Delete {{count}} rows?",
|
"Delete {{count}} rows?_other": "Delete {{count}} rows?",
|
||||||
"Descending": "降順",
|
"Descending": "降順",
|
||||||
"Discard": "破棄",
|
"Discard": "破棄",
|
||||||
@@ -1291,51 +1286,8 @@
|
|||||||
"Value": "値",
|
"Value": "値",
|
||||||
"View updated for everyone": "ビューが全員向けに更新されました",
|
"View updated for everyone": "ビューが全員向けに更新されました",
|
||||||
"You have unsaved changes. Do you want to discard them?": "未保存の変更があります。破棄しますか?",
|
"You have unsaved changes. Do you want to discard them?": "未保存の変更があります。破棄しますか?",
|
||||||
"{{count}} rows deleted_one": "1行を削除しました",
|
"{{count}} rows deleted_one": "1 row deleted",
|
||||||
"{{count}} rows deleted_other": "{{count}} rows deleted",
|
"{{count}} rows deleted_other": "{{count}} rows deleted",
|
||||||
"{{count}} selected_one": "1件を選択中",
|
"{{count}} selected_one": "1 selected",
|
||||||
"{{count}} selected_other": "{{count}} selected",
|
"{{count}} selected_other": "{{count}} selected"
|
||||||
"Compare": "比較",
|
|
||||||
"Compare versions": "バージョンを比較",
|
|
||||||
"Select version from {{date}}": "{{date}} のバージョンを選択",
|
|
||||||
"Version actions for {{date}}": "{{date}} のバージョンの操作",
|
|
||||||
"Comparing {{newer}} and {{older}}": "{{newer}} と {{older}} を比較中",
|
|
||||||
"Exit compare": "比較を終了",
|
|
||||||
"Search attachments...": "添付ファイルを検索…",
|
|
||||||
"Error loading attachments.": "添付ファイルの読み込み中にエラーが発生しました。",
|
|
||||||
"No attachments on this page yet.": "このページにはまだ添付ファイルがありません。",
|
|
||||||
"Uploaded by {{name}}": "アップロード者: {{name}}",
|
|
||||||
"Download {{name}}": "{{name}} をダウンロード",
|
|
||||||
"Access revoked": "アクセスが取り消されました",
|
|
||||||
"Authorize application": "アプリケーションを認可",
|
|
||||||
"{{name}} wants to access {{workspace}}": "{{name}} が {{workspace}} へのアクセスを求めています",
|
|
||||||
"Not you? Switch account": "あなたではありませんか? アカウントを切り替え",
|
|
||||||
"This application will be able to:": "このアプリケーションで可能なこと:",
|
|
||||||
"Write": "書き込み",
|
|
||||||
"Invalid authorization request": "無効な認可リクエストです",
|
|
||||||
"Authorize": "認可",
|
|
||||||
"Application": "アプリケーション",
|
|
||||||
"Permissions": "権限",
|
|
||||||
"Authorized": "認可済み",
|
|
||||||
"Revoke access": "アクセスを取り消す",
|
|
||||||
"Revoke access for {{name}}": "{{name}} のアクセスを取り消す",
|
|
||||||
"Are you sure you want to revoke access for {{name}}? The application will no longer be able to access your account.": "{{name}} のアクセスを取り消してもよろしいですか? このアプリケーションは今後あなたのアカウントにアクセスできなくなります。",
|
|
||||||
"Something went wrong. Please try again.": "問題が発生しました。もう一度お試しください。",
|
|
||||||
"Remove {{name}}": "{{name}} を削除",
|
|
||||||
"Make sure you trust this application before authorizing it.": "認可する前に、このアプリケーションを信頼できることを確認してください。",
|
|
||||||
"You will be redirected to": "次へリダイレクトされます",
|
|
||||||
"View content without making changes.": "変更を加えずにコンテンツを表示します。",
|
|
||||||
"Create and modify content.": "コンテンツを作成および変更します。",
|
|
||||||
"Applications and AI assistants you have authorized to access your account.": "あなたのアカウントへのアクセスを認可したアプリケーションと AI アシスタント。",
|
|
||||||
"Your workspace has MCP enabled. Connect AI assistants with your Docmost account via OAuth.": "このワークスペースでは MCP が有効になっています。OAuth を使用して AI アシスタントを Docmost アカウントに接続します。",
|
|
||||||
"Authorized apps": "認可済みアプリ",
|
|
||||||
"No authorized apps yet.": "認可済みアプリはまだありません。",
|
|
||||||
"Workspace knowledge only": "ワークスペースの知識のみ",
|
|
||||||
"Restrict AI Chat to answering from your workspace pages and uploaded files only. It will not use outside knowledge.": "AIチャットの回答を、ワークスペース内のページとアップロードされたファイルのみに制限します。外部の知識は使用されません。",
|
|
||||||
"Toggle workspace knowledge only": "「ワークスペースの知識のみ」を切り替え",
|
|
||||||
"Read-only mode": "読み取り専用モード",
|
|
||||||
"AI Chat can search and read workspace content, but cannot create or edit pages.": "AIチャットはワークスペースのコンテンツを検索および閲覧できますが、ページの作成や編集はできません。",
|
|
||||||
"Toggle AI Chat read-only mode": "AIチャットの読み取り専用モードを切り替え",
|
|
||||||
"Title only": "タイトルのみ",
|
|
||||||
"you": "あなた"
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,23 +2,23 @@
|
|||||||
"Account": "계정",
|
"Account": "계정",
|
||||||
"Active": "활성",
|
"Active": "활성",
|
||||||
"Add": "추가",
|
"Add": "추가",
|
||||||
"Add group members": "그룹에 멤버 추가",
|
"Add group members": "팀에 사용자 추가",
|
||||||
"Add groups": "그룹 추가",
|
"Add groups": "팀 생성",
|
||||||
"Add members": "사용자 추가",
|
"Add members": "사용자 추가",
|
||||||
"Add to groups": "그룹에 추가",
|
"Add to groups": "팀에 추가",
|
||||||
"Add space members": "Space에 사용자 추가",
|
"Add space members": "Space에 사용자 추가",
|
||||||
"Add to favorites": "즐겨찾기에 추가",
|
"Add to favorites": "즐겨찾기에 추가",
|
||||||
"Admin": "관리자",
|
"Admin": "관리자",
|
||||||
"Are you sure you want to delete this group? Members will lose access to resources this group has access to.": "이 그룹을 삭제하시겠습니까? 그룹 멤버는 이 그룹이 가진 모든 권한을 잃게 됩니다.",
|
"Are you sure you want to delete this group? Members will lose access to resources this group has access to.": "이 팀을 삭제하시겠습니까? 해당 팀에 속한 사용자들은 이 팀이 가진 모든 권한을 잃게 됩니다.",
|
||||||
"Are you sure you want to delete this page?": "이 페이지를 삭제하시겠습니까?",
|
"Are you sure you want to delete this page?": "이 페이지를 삭제하시겠습니까?",
|
||||||
"Are you sure you want to remove this user from the group? The user will lose access to resources this group has access to.": "이 사용자를 그룹에서 제거하시겠습니까? 사용자는 이 그룹이 가진 모든 권한을 잃게 됩니다.",
|
"Are you sure you want to remove this user from the group? The user will lose access to resources this group has access to.": "이 사용자를 팀에서 제거하시겠습니까? 사용자는 이 팀이 가진 모든 권한을 잃게 됩니다.",
|
||||||
"Are you sure you want to remove this user from the space? The user will lose all access to this space.": "이 사용자를 Space에서 제거하시겠습니까? 사용자는 이 Space에 대한 모든 접근 권한을 잃게 됩니다.",
|
"Are you sure you want to remove this user from the space? The user will lose all access to this space.": "이 사용자를 Space에서 제거하시겠습니까? 사용자는 이 Space에 대한 모든 접근 권한을 잃게 됩니다.",
|
||||||
"Are you sure you want to restore this version? Any changes not versioned will be lost.": "이 버전으로 복원하시겠습니까? 저장되지 않은 모든 변경사항이 손실됩니다.",
|
"Are you sure you want to restore this version? Any changes not versioned will be lost.": "이 버전으로 복원하시겠습니까? 저장되지 않은 모든 변경사항이 손실됩니다.",
|
||||||
"Can become members of groups and spaces in workspace": "워크스페이스의 그룹 및 스페이스의 멤버가 될 수 있음",
|
"Can become members of groups and spaces in workspace": "Workspace 내 팀 및 Space의 사용자가 될 수 있습니다.",
|
||||||
"Can create and edit pages in space.": "Space에 페이지를 생성하고 편집할 수 있습니다.",
|
"Can create and edit pages in space.": "Space에 페이지를 생성하고 편집할 수 있습니다.",
|
||||||
"Can edit": "편집할 수 있음",
|
"Can edit": "편집할 수 있음",
|
||||||
"Can manage workspace": "워크스페이스를 관리할 수 있음",
|
"Can manage workspace": "Workspace를 관리할 수 있음",
|
||||||
"Can manage workspace but cannot delete it": "워크스페이스를 관리할 수 있지만, 삭제할 수 없음",
|
"Can manage workspace but cannot delete it": "Workspace를 관리할 수 있지만, 삭제는 불가능.",
|
||||||
"Can view": "볼 수 있음",
|
"Can view": "볼 수 있음",
|
||||||
"Can view pages in space but not edit.": "Space의 페이지를 볼 수 있지만, 편집은 불가능.",
|
"Can view pages in space but not edit.": "Space의 페이지를 볼 수 있지만, 편집은 불가능.",
|
||||||
"Cancel": "취소",
|
"Cancel": "취소",
|
||||||
@@ -33,17 +33,17 @@
|
|||||||
"Copy as Markdown": "Markdown으로 복사",
|
"Copy as Markdown": "Markdown으로 복사",
|
||||||
"Copy link": "링크 복사",
|
"Copy link": "링크 복사",
|
||||||
"Create": "생성",
|
"Create": "생성",
|
||||||
"Create group": "그룹 생성",
|
"Create group": "팀 생성",
|
||||||
"Create page": "페이지 생성",
|
"Create page": "페이지 생성",
|
||||||
"Create space": "Space 생성",
|
"Create space": "Space 생성",
|
||||||
"Create workspace": "워크스페이스 생성",
|
"Create workspace": "Workspace 생성",
|
||||||
"Current password": "현재 비밀번호",
|
"Current password": "현재 비밀번호",
|
||||||
"Dark": "어두운",
|
"Dark": "어두운",
|
||||||
"Date": "날짜",
|
"Date": "날짜",
|
||||||
"Delete": "삭제",
|
"Delete": "삭제",
|
||||||
"Remove from page": "페이지에서 제거",
|
"Remove from page": "페이지에서 제거",
|
||||||
"Base options": "베이스 옵션",
|
"Base options": "베이스 옵션",
|
||||||
"Delete group": "그룹 삭제",
|
"Delete group": "팀 삭제",
|
||||||
"Are you sure you want to delete this page? This will delete its children and page history. This action is irreversible.": "이 페이지를 삭제하시겠습니까? 하위 페이지와 페이지 기록이 모두 삭제됩니다. 이 작업은 되돌릴 수 없습니다.",
|
"Are you sure you want to delete this page? This will delete its children and page history. This action is irreversible.": "이 페이지를 삭제하시겠습니까? 하위 페이지와 페이지 기록이 모두 삭제됩니다. 이 작업은 되돌릴 수 없습니다.",
|
||||||
"Description": "설명",
|
"Description": "설명",
|
||||||
"Details": "세부사항",
|
"Details": "세부사항",
|
||||||
@@ -58,7 +58,7 @@
|
|||||||
"e.g Space for sales team to collaborate": "예: 영업 팀이 협업하는 스페이스",
|
"e.g Space for sales team to collaborate": "예: 영업 팀이 협업하는 스페이스",
|
||||||
"Edit": "편집",
|
"Edit": "편집",
|
||||||
"Read": "읽기",
|
"Read": "읽기",
|
||||||
"Edit group": "그룹 편집",
|
"Edit group": "팀 편집",
|
||||||
"Email": "이메일",
|
"Email": "이메일",
|
||||||
"Enter a strong password": "강력한 비밀번호를 입력하세요",
|
"Enter a strong password": "강력한 비밀번호를 입력하세요",
|
||||||
"Enter valid email addresses separated by comma or space max_50": "유효한 이메일 주소를 쉼표나 공백으로 구분하여 입력하세요 [최대: 50]",
|
"Enter valid email addresses separated by comma or space max_50": "유효한 이메일 주소를 쉼표나 공백으로 구분하여 입력하세요 [최대: 50]",
|
||||||
@@ -103,10 +103,10 @@
|
|||||||
"Full page width": "전체 페이지 너비",
|
"Full page width": "전체 페이지 너비",
|
||||||
"Full width": "전체 너비",
|
"Full width": "전체 너비",
|
||||||
"General": "일반",
|
"General": "일반",
|
||||||
"Group": "그룹",
|
"Group": "팀",
|
||||||
"Group description": "그룹 설명",
|
"Group description": "팀 설명",
|
||||||
"Group name": "그룹 이름",
|
"Group name": "팀 이름",
|
||||||
"Groups": "그룹",
|
"Groups": "팀",
|
||||||
"Has full access to space settings and pages.": "Space 설정과 페이지에 대한 전체 접근 권한이 있습니다.",
|
"Has full access to space settings and pages.": "Space 설정과 페이지에 대한 전체 접근 권한이 있습니다.",
|
||||||
"Home": "홈",
|
"Home": "홈",
|
||||||
"Import pages": "페이지 가져오기",
|
"Import pages": "페이지 가져오기",
|
||||||
@@ -119,14 +119,14 @@
|
|||||||
"Invite new members": "새 사용자 초대",
|
"Invite new members": "새 사용자 초대",
|
||||||
"Invite People": "사용자 초대",
|
"Invite People": "사용자 초대",
|
||||||
"Invited members who are yet to accept their invitation will appear here.": "초대를 아직 수락하지 않은 초대된 사용자가 여기에 표시됩니다.",
|
"Invited members who are yet to accept their invitation will appear here.": "초대를 아직 수락하지 않은 초대된 사용자가 여기에 표시됩니다.",
|
||||||
"Invited members will be granted access to spaces the groups can access": "초대된 멤버에게는 그룹이 접근할 수 있는 스페이스에 대한 액세스 권한이 부여됩니다",
|
"Invited members will be granted access to spaces the groups can access": "초대된 사용자는 팀이 접근할 수 있는 Space에 대한 접근 권한을 받게 됩니다",
|
||||||
"Join the workspace": "워크스페이스 참여",
|
"Join the workspace": "Workspace 참여",
|
||||||
"Language": "언어",
|
"Language": "언어",
|
||||||
"Light": "밝은",
|
"Light": "밝은",
|
||||||
"Link copied": "링크 복사됨",
|
"Link copied": "링크 복사됨",
|
||||||
"Login": "로그인",
|
"Login": "로그인",
|
||||||
"Logout": "로그아웃",
|
"Logout": "로그아웃",
|
||||||
"Manage Group": "그룹 관리",
|
"Manage Group": "팀 관리",
|
||||||
"Manage members": "사용자 관리",
|
"Manage members": "사용자 관리",
|
||||||
"member": "사용자",
|
"member": "사용자",
|
||||||
"Member": "사용자",
|
"Member": "사용자",
|
||||||
@@ -139,7 +139,7 @@
|
|||||||
"New email": "새 이메일",
|
"New email": "새 이메일",
|
||||||
"New page": "새 페이지",
|
"New page": "새 페이지",
|
||||||
"New password": "새 비밀번호",
|
"New password": "새 비밀번호",
|
||||||
"No group found": "그룹을 찾을 수 없음",
|
"No group found": "그룹을 찾을 수 없습니다",
|
||||||
"No page history saved yet.": "아직 저장된 페이지 기록이 없습니다.",
|
"No page history saved yet.": "아직 저장된 페이지 기록이 없습니다.",
|
||||||
"No pages yet": "아직 페이지가 없습니다",
|
"No pages yet": "아직 페이지가 없습니다",
|
||||||
"No shared pages": "공유된 페이지가 없습니다.",
|
"No shared pages": "공유된 페이지가 없습니다.",
|
||||||
@@ -148,7 +148,7 @@
|
|||||||
"Overview": "개요",
|
"Overview": "개요",
|
||||||
"Owner": "소유자",
|
"Owner": "소유자",
|
||||||
"page": "페이지",
|
"page": "페이지",
|
||||||
"Page deleted successfully": "페이지 삭제됨",
|
"Page deleted successfully": "페이지 삭제 완료",
|
||||||
"Page history": "페이지 기록",
|
"Page history": "페이지 기록",
|
||||||
"Select version": "버전 선택",
|
"Select version": "버전 선택",
|
||||||
"Highlight changes": "변경 사항 강조",
|
"Highlight changes": "변경 사항 강조",
|
||||||
@@ -156,7 +156,7 @@
|
|||||||
"Pages": "페이지",
|
"Pages": "페이지",
|
||||||
"pages": "페이지",
|
"pages": "페이지",
|
||||||
"Password": "비밀번호",
|
"Password": "비밀번호",
|
||||||
"Password changed successfully": "비밀번호 변경됨",
|
"Password changed successfully": "비밀번호 변경 완료",
|
||||||
"People": "사용자",
|
"People": "사용자",
|
||||||
"Pending": "대기 중",
|
"Pending": "대기 중",
|
||||||
"Please confirm your action": "작업을 확인해 주세요",
|
"Please confirm your action": "작업을 확인해 주세요",
|
||||||
@@ -166,15 +166,15 @@
|
|||||||
"Recently updated": "최근 업데이트",
|
"Recently updated": "최근 업데이트",
|
||||||
"Remove": "제거",
|
"Remove": "제거",
|
||||||
"Remove from favorites": "즐겨찾기에서 제거",
|
"Remove from favorites": "즐겨찾기에서 제거",
|
||||||
"Remove group member": "그룹 멤버 제거",
|
"Remove group member": "팀에서 사용자 제거",
|
||||||
"Remove space member": "Space에서 사용자 제거",
|
"Remove space member": "Space에서 사용자 제거",
|
||||||
"Restore": "복원",
|
"Restore": "복원",
|
||||||
"Role": "역할",
|
"Role": "역할",
|
||||||
"Save": "저장",
|
"Save": "저장",
|
||||||
"Search": "검색",
|
"Search": "검색",
|
||||||
"Search for groups": "그룹 검색",
|
"Search for groups": "팀 검색",
|
||||||
"Search for users": "사용자 검색",
|
"Search for users": "사용자 검색",
|
||||||
"Search for users and groups": "사용자 및 그룹 검색",
|
"Search for users and groups": "사용자 및 팀 검색",
|
||||||
"Search...": "검색...",
|
"Search...": "검색...",
|
||||||
"Select language": "언어 선택",
|
"Select language": "언어 선택",
|
||||||
"Select role": "역할 선택",
|
"Select role": "역할 선택",
|
||||||
@@ -199,8 +199,8 @@
|
|||||||
"Search for spaces": "스페이스 검색",
|
"Search for spaces": "스페이스 검색",
|
||||||
"Start typing to search...": "검색하려면 입력을 시작하세요...",
|
"Start typing to search...": "검색하려면 입력을 시작하세요...",
|
||||||
"Status": "상태",
|
"Status": "상태",
|
||||||
"Successfully imported": "가져오기 완료",
|
"Successfully imported": "가져오기에 성공했습니다",
|
||||||
"Successfully restored": "복원 완료",
|
"Successfully restored": "복원에 성공했습니다",
|
||||||
"System settings": "시스템 설정",
|
"System settings": "시스템 설정",
|
||||||
"Templates": "템플릿",
|
"Templates": "템플릿",
|
||||||
"Theme": "테마",
|
"Theme": "테마",
|
||||||
@@ -209,7 +209,7 @@
|
|||||||
"Unable to import pages. Please try again.": "페이지를 가져올 수 없습니다. 다시 시도해주세요.",
|
"Unable to import pages. Please try again.": "페이지를 가져올 수 없습니다. 다시 시도해주세요.",
|
||||||
"untitled": "제목 없음",
|
"untitled": "제목 없음",
|
||||||
"Untitled": "제목 없음",
|
"Untitled": "제목 없음",
|
||||||
"Updated successfully": "업데이트 완료",
|
"Updated successfully": "성공적으로 업데이트되었습니다",
|
||||||
"User": "사용자",
|
"User": "사용자",
|
||||||
"Workspace": "워크스페이스",
|
"Workspace": "워크스페이스",
|
||||||
"Workspace Name": "워크스페이스 이름",
|
"Workspace Name": "워크스페이스 이름",
|
||||||
@@ -245,15 +245,15 @@
|
|||||||
"Are you sure you want to delete this comment?": "이 댓글을 삭제하시겠습니까?",
|
"Are you sure you want to delete this comment?": "이 댓글을 삭제하시겠습니까?",
|
||||||
"Delete chat": "채팅 삭제",
|
"Delete chat": "채팅 삭제",
|
||||||
"Are you sure you want to delete '{{title}}'? This action cannot be undone.": "'{{title}}'을(를) 삭제하시겠습니까? 이 작업은 되돌릴 수 없습니다.",
|
"Are you sure you want to delete '{{title}}'? This action cannot be undone.": "'{{title}}'을(를) 삭제하시겠습니까? 이 작업은 되돌릴 수 없습니다.",
|
||||||
"Comment created successfully": "댓글 생성됨",
|
"Comment created successfully": "댓글 생성 완료",
|
||||||
"Error creating comment": "댓글 생성 오류",
|
"Error creating comment": "댓글 생성 오류",
|
||||||
"Comment updated successfully": "댓글 업데이트됨",
|
"Comment updated successfully": "댓글 업데이트 완료",
|
||||||
"Failed to update comment": "댓글 업데이트 실패",
|
"Failed to update comment": "댓글 업데이트 실패",
|
||||||
"Comment deleted successfully": "댓글 삭제됨",
|
"Comment deleted successfully": "댓글 삭제 완료",
|
||||||
"Failed to delete comment": "댓글 삭제 실패",
|
"Failed to delete comment": "댓글 삭제 실패",
|
||||||
"Comment resolved successfully": "댓글이 해결로 표시됨",
|
"Comment resolved successfully": "댓글 처리 완료",
|
||||||
"Comment re-opened successfully": "댓글이 열린 상태로 표시됨",
|
"Comment re-opened successfully": "댓글이 성공적으로 다시 열렸습니다",
|
||||||
"Comment unresolved successfully": "댓글이 미해결로 표시됨",
|
"Comment unresolved successfully": "댓글 해결이 성공적으로 취소되었습니다",
|
||||||
"Failed to resolve comment": "댓글 처리 실패",
|
"Failed to resolve comment": "댓글 처리 실패",
|
||||||
"Resolve comment": "댓글 해결",
|
"Resolve comment": "댓글 해결",
|
||||||
"Unresolve comment": "댓글 해결 취소",
|
"Unresolve comment": "댓글 해결 취소",
|
||||||
@@ -263,19 +263,19 @@
|
|||||||
"Are you sure you want to unresolve this comment thread?": "이 댓글 스레드를 미해결로 변경하시겠습니까?",
|
"Are you sure you want to unresolve this comment thread?": "이 댓글 스레드를 미해결로 변경하시겠습니까?",
|
||||||
"Resolved": "해결됨",
|
"Resolved": "해결됨",
|
||||||
"No active comments.": "활성 댓글이 없습니다.",
|
"No active comments.": "활성 댓글이 없습니다.",
|
||||||
"Revoke invitation": "초대 폐기",
|
"Revoke invitation": "초대 취소",
|
||||||
"Revoke": "폐기",
|
"Revoke": "취소",
|
||||||
"Don't": "하지 않음",
|
"Don't": "하지 않음",
|
||||||
"Are you sure you want to revoke this invitation? The user will not be able to join the workspace.": "이 초대를 폐기하시겠습니까? 사용자가 워크스페이스에 참여할 수 없게 됩니다.",
|
"Are you sure you want to revoke this invitation? The user will not be able to join the workspace.": "이 초대를 취소하시겠습니까? 사용자가 Workspace에 참여할 수 없게 됩니다.",
|
||||||
"Resend invitation": "초대 재전송",
|
"Resend invitation": "초대 재전송",
|
||||||
"Anyone with this link can join this workspace.": "이 링크를 가진 모든 사용자가 이 워크스페이스에 참여할 수 있습니다.",
|
"Anyone with this link can join this workspace.": "이 링크를 가진 모든 사용자가 이 Workspace에 참여할 수 있습니다.",
|
||||||
"Invite link": "초대 링크",
|
"Invite link": "초대 링크",
|
||||||
"Copy": "복사",
|
"Copy": "복사",
|
||||||
"Copy to space": "스페이스로 복사",
|
"Copy to space": "스페이스로 복사",
|
||||||
"Copied": "복사됨",
|
"Copied": "복사됨",
|
||||||
"Duplicate": "복제",
|
"Duplicate": "복제",
|
||||||
"Select a user": "사용자 선택",
|
"Select a user": "사용자 선택",
|
||||||
"Select a group": "그룹 선택",
|
"Select a group": "팀 선택",
|
||||||
"Export all pages and attachments in this space.": "이 Space의 모든 페이지와 첨부파일을 내보냅니다.",
|
"Export all pages and attachments in this space.": "이 Space의 모든 페이지와 첨부파일을 내보냅니다.",
|
||||||
"Delete space": "Space 삭제",
|
"Delete space": "Space 삭제",
|
||||||
"Are you sure you want to delete this space?": "이 Space을 삭제하시겠습니까?",
|
"Are you sure you want to delete this space?": "이 Space을 삭제하시겠습니까?",
|
||||||
@@ -290,11 +290,10 @@
|
|||||||
"Export failed:": "내보내기 실패:",
|
"Export failed:": "내보내기 실패:",
|
||||||
"export error": "내보내기 오류",
|
"export error": "내보내기 오류",
|
||||||
"Export page": "페이지 내보내기",
|
"Export page": "페이지 내보내기",
|
||||||
"Export successful": "내보내기 완료",
|
"Export successful": "내보내기 성공",
|
||||||
"Export space": "Space 내보내기",
|
"Export space": "Space 내보내기",
|
||||||
"Export {{type}}": "{{type}} 내보내기",
|
"Export {{type}}": "{{type}} 내보내기",
|
||||||
"File exceeds the {{limit}} attachment limit": "첨부 파일 크기 제한 {{limit}}을 초과했습니다",
|
"File exceeds the {{limit}} attachment limit": "첨부 파일 크기 제한 {{limit}}을 초과했습니다",
|
||||||
"Media": "미디어",
|
|
||||||
"Align left": "왼쪽 정렬",
|
"Align left": "왼쪽 정렬",
|
||||||
"Align right": "오른쪽 정렬",
|
"Align right": "오른쪽 정렬",
|
||||||
"Align center": "가운데 정렬",
|
"Align center": "가운데 정렬",
|
||||||
@@ -388,8 +387,6 @@
|
|||||||
"Insert horizontal rule divider": "가로 구분선 삽입",
|
"Insert horizontal rule divider": "가로 구분선 삽입",
|
||||||
"Page break": "페이지 나누기",
|
"Page break": "페이지 나누기",
|
||||||
"Insert a page break for printing.": "인쇄용 페이지 나누기를 삽입합니다.",
|
"Insert a page break for printing.": "인쇄용 페이지 나누기를 삽입합니다.",
|
||||||
"Footnote": "각주",
|
|
||||||
"Insert a footnote reference.": "각주 참조를 삽입합니다.",
|
|
||||||
"Upload any image from your device.": "기기에서 이미지를 업로드하세요.",
|
"Upload any image from your device.": "기기에서 이미지를 업로드하세요.",
|
||||||
"Upload any video from your device.": "기기에서 비디오를 업로드하세요.",
|
"Upload any video from your device.": "기기에서 비디오를 업로드하세요.",
|
||||||
"Upload any audio from your device.": "기기에서 오디오를 업로드하세요.",
|
"Upload any audio from your device.": "기기에서 오디오를 업로드하세요.",
|
||||||
@@ -450,12 +447,12 @@
|
|||||||
"Today, {{time}}": "오늘, {{time}}",
|
"Today, {{time}}": "오늘, {{time}}",
|
||||||
"Yesterday, {{time}}": "어제, {{time}}",
|
"Yesterday, {{time}}": "어제, {{time}}",
|
||||||
"now": "지금",
|
"now": "지금",
|
||||||
"Space created successfully": "스페이스 생성됨",
|
"Space created successfully": "스페이스가 성공적으로 생성되었습니다",
|
||||||
"Space updated successfully": "스페이스 업데이트됨",
|
"Space updated successfully": "스페이스가 성공적으로 업데이트되었습니다",
|
||||||
"Space deleted successfully": "스페이스 삭제됨",
|
"Space deleted successfully": "스페이스가 성공적으로 삭제되었습니다",
|
||||||
"Members added successfully": "멤버 추가됨",
|
"Members added successfully": "멤버가 성공적으로 추가되었습니다",
|
||||||
"Member removed successfully": "멤버 삭제됨",
|
"Member removed successfully": "멤버가 성공적으로 제거되었습니다",
|
||||||
"Member role updated successfully": "멤버 역할 업데이트됨",
|
"Member role updated successfully": "멤버 역할이 성공적으로 업데이트되었습니다",
|
||||||
"Created by: <b>{{creatorName}}</b>": "작성자: <b>{{creatorName}}</b>",
|
"Created by: <b>{{creatorName}}</b>": "작성자: <b>{{creatorName}}</b>",
|
||||||
"Created at: {{time}}": "작성 시간: {{time}}",
|
"Created at: {{time}}": "작성 시간: {{time}}",
|
||||||
"Edited by {{name}} {{time}}": "{{name}}님이 {{time}}에 편집함",
|
"Edited by {{name}} {{time}}": "{{name}}님이 {{time}}에 편집함",
|
||||||
@@ -468,7 +465,7 @@
|
|||||||
"Choose {{format}} file": "{{format}} 파일 선택",
|
"Choose {{format}} file": "{{format}} 파일 선택",
|
||||||
"Reading": "읽기",
|
"Reading": "읽기",
|
||||||
"Delete member": "멤버 삭제",
|
"Delete member": "멤버 삭제",
|
||||||
"Member deleted successfully": "멤버 삭제됨",
|
"Member deleted successfully": "멤버가 성공적으로 삭제되었습니다",
|
||||||
"Are you sure you want to delete this workspace member? This action is irreversible.": "이 워크스페이스 멤버를 삭제하시겠습니까? 이 작업은 되돌릴 수 없습니다.",
|
"Are you sure you want to delete this workspace member? This action is irreversible.": "이 워크스페이스 멤버를 삭제하시겠습니까? 이 작업은 되돌릴 수 없습니다.",
|
||||||
"Deactivate member": "멤버 비활성화",
|
"Deactivate member": "멤버 비활성화",
|
||||||
"Activate member": "멤버 활성화",
|
"Activate member": "멤버 활성화",
|
||||||
@@ -501,32 +498,32 @@
|
|||||||
"Delete share": "공유 삭제",
|
"Delete share": "공유 삭제",
|
||||||
"Are you sure you want to delete this shared link?": "이 공유 링크를 삭제하시겠습니까?",
|
"Are you sure you want to delete this shared link?": "이 공유 링크를 삭제하시겠습니까?",
|
||||||
"Publicly shared pages from spaces you are a member of will appear here": "회원으로 속한 스페이스의 공개 공유 페이지가 여기에 표시됩니다",
|
"Publicly shared pages from spaces you are a member of will appear here": "회원으로 속한 스페이스의 공개 공유 페이지가 여기에 표시됩니다",
|
||||||
"Share deleted successfully": "공유 삭제됨",
|
"Share deleted successfully": "공유가 성공적으로 삭제되었습니다",
|
||||||
"Share not found": "공유를 찾을 수 없습니다",
|
"Share not found": "공유를 찾을 수 없습니다",
|
||||||
"Failed to share page": "페이지 공유에 실패했습니다",
|
"Failed to share page": "페이지 공유에 실패했습니다",
|
||||||
"Disable public sharing": "공개 공유 비활성화",
|
"Disable public sharing": "공유 비활성화",
|
||||||
"Prevent members from sharing pages publicly.": "멤버가 페이지를 공개적으로 공유하지 못하게 합니다.",
|
"Prevent members from sharing pages publicly.": "멤버들이 페이지를 공개적으로 공유하지 못하도록 방지하십시오.",
|
||||||
"Toggle public sharing": "공개 공유 전환",
|
"Toggle public sharing": "공유 전환",
|
||||||
"Toggle space public sharing": "스페이스 공개 공유 전환",
|
"Toggle space public sharing": "공간 공유 전환",
|
||||||
"Allow viewers to comment": "뷰어가 댓글을 달 수 있도록 허용",
|
"Allow viewers to comment": "뷰어가 댓글을 달 수 있도록 허용",
|
||||||
"Allow viewers to add comments on pages in this space.": "이 공간 내 페이지에 뷰어가 댓글을 추가할 수 있도록 허용합니다.",
|
"Allow viewers to add comments on pages in this space.": "이 공간 내 페이지에 뷰어가 댓글을 추가할 수 있도록 허용합니다.",
|
||||||
"Toggle viewer comments": "뷰어 댓글 전환",
|
"Toggle viewer comments": "뷰어 댓글 전환",
|
||||||
"Public sharing is disabled at the workspace level": "공개 공유가 워크스페이스 수준에서 비활성화됨",
|
"Public sharing is disabled at the workspace level": "워크스페이스 수준에서 공유가 비활성화되었습니다.",
|
||||||
"Prevent pages in this space from being shared publicly.": "이 스페이스의 페이지가 공개 공유되지 않도록 합니다.",
|
"Prevent pages in this space from being shared publicly.": "이 공간의 페이지가 공개적으로 공유되지 않도록 방지하십시오.",
|
||||||
"Page permissions": "페이지 권한},{",
|
"Page permissions": "페이지 권한},{",
|
||||||
"Control who can view and edit individual pages. Available with an enterprise license.": "개별 페이지의 조회 및 편집 권한을 제어합니다. 엔터프라이즈 라이선스에서 이용 가능합니다.",
|
"Control who can view and edit individual pages. Available with an enterprise license.": "개별 페이지의 조회 및 편집 권한을 제어합니다. 엔터프라이즈 라이선스에서 이용 가능합니다.",
|
||||||
"Enable public sharing": "공개 공유 활성화",
|
"Enable public sharing": "공유 활성화",
|
||||||
"Are you sure you want to enable public sharing? Members will be able to share pages publicly.": "공개 공유를 활성화하시겠습니까? 멤버가 페이지를 공개적으로 공유할 수 있게 됩니다.",
|
"Are you sure you want to enable public sharing? Members will be able to share pages publicly.": "공유를 활성화하시겠습니까? 멤버들이 페이지를 공개적으로 공유할 수 있게 됩니다.",
|
||||||
"Are you sure you want to disable public sharing? All existing shared links in this workspace will be deleted.": "공개 공유를 비활성화하시겠습니까? 이 워크스페이스의 기존 공유 링크가 모두 삭제됩니다.",
|
"Are you sure you want to disable public sharing? All existing shared links in this workspace will be deleted.": "정말로 공유를 비활성화하시겠습니까? 이 워크스페이스의 모든 기존 공유 링크가 삭제됩니다.",
|
||||||
"Are you sure you want to enable public sharing for this space?": "이 스페이스에 대해 공개 공유를 활성화하시겠습니까?",
|
"Are you sure you want to enable public sharing for this space?": "이 공간의 공유를 활성화하시겠습니까?",
|
||||||
"Are you sure you want to disable public sharing? All existing shared links in this space will be deleted.": "공개 공유를 비활성화하시겠습니까? 이 스페이스의 기존 공유 링크가 모두 삭제됩니다.",
|
"Are you sure you want to disable public sharing? All existing shared links in this space will be deleted.": "정말로 공유를 비활성화하시겠습니까? 이 공간의 모든 기존 공유 링크가 삭제됩니다.",
|
||||||
"Public sharing is disabled": "공개 공유가 비활성화됨",
|
"Public sharing is disabled": "공유가 비활성화되었습니다.",
|
||||||
"Public sharing has been disabled at the workspace level.": "공개 공유가 워크스페이스 수준에서 비활성화되었습니다.",
|
"Public sharing has been disabled at the workspace level.": "워크스페이스 수준에서 공유가 비활성화되었습니다.",
|
||||||
"Public sharing has been disabled for this space.": "이 스페이스의 공개 공유가 비활성화되었습니다.",
|
"Public sharing has been disabled for this space.": "이 공간의 공유가 비활성화되었습니다.",
|
||||||
"Copy page": "페이지 복사",
|
"Copy page": "페이지 복사",
|
||||||
"Copy page to a different space.": "다른 공간으로 페이지 복사하기.",
|
"Copy page to a different space.": "다른 공간으로 페이지 복사하기.",
|
||||||
"Page copied successfully": "페이지 복사됨",
|
"Page copied successfully": "페이지가 성공적으로 복사되었습니다",
|
||||||
"Page duplicated successfully": "페이지 복제됨",
|
"Page duplicated successfully": "페이지가 성공적으로 복제되었습니다",
|
||||||
"Find": "찾기",
|
"Find": "찾기",
|
||||||
"Not found": "찾을 수 없음",
|
"Not found": "찾을 수 없음",
|
||||||
"Previous Match (Shift+Enter)": "이전 일치 항목 (Shift+Enter)",
|
"Previous Match (Shift+Enter)": "이전 일치 항목 (Shift+Enter)",
|
||||||
@@ -542,13 +539,13 @@
|
|||||||
"Error": "오류",
|
"Error": "오류",
|
||||||
"Failed to disable MFA": "MFA 비활성화에 실패했습니다",
|
"Failed to disable MFA": "MFA 비활성화에 실패했습니다",
|
||||||
"Disable two-factor authentication": "2단계 인증 비활성화",
|
"Disable two-factor authentication": "2단계 인증 비활성화",
|
||||||
"Disabling two-factor authentication will make your account less secure. You'll only need your password to sign in.": "2단계 인증을 비활성화하면 계정의 보안이 낮아집니다. 로그인 시 비밀번호만 필요하게 됩니다.",
|
"Disabling two-factor authentication will make your account less secure. You'll only need your password to sign in.": "이중 인증을 비활성화하면 계정의 보안이 낮아집니다. 로그인 시 비밀번호만 필요하게 됩니다.",
|
||||||
"Please enter your password to disable two-factor authentication:": "2단계 인증 비활성화를 위해 비밀번호를 입력하세요:",
|
"Please enter your password to disable two-factor authentication:": "이중 인증 비활성화를 위해 비밀번호를 입력하세요:",
|
||||||
"Two-factor authentication has been enabled": "2단계 인증이 활성화됨",
|
"Two-factor authentication has been enabled": "2단계 인증이 활성화되었습니다",
|
||||||
"Two-factor authentication has been disabled": "2단계 인증이 비활성화됨",
|
"Two-factor authentication has been disabled": "2단계 인증이 비활성화되었습니다",
|
||||||
"2-step verification": "2단계 인증",
|
"2-step verification": "2단계 인증",
|
||||||
"Protect your account with an additional verification layer when signing in.": "로그인 시 추가 인증 단계를 통해 계정을 보호하세요.",
|
"Protect your account with an additional verification layer when signing in.": "로그인 시 추가 인증 단계를 통해 계정을 보호하세요.",
|
||||||
"Two-factor authentication is active on your account.": "2단계 인증이 계정에 활성화되어 있습니다.",
|
"Two-factor authentication is active on your account.": "이중 인증이 계정에 활성화되어 있습니다.",
|
||||||
"Add 2FA method": "2FA 방법 추가",
|
"Add 2FA method": "2FA 방법 추가",
|
||||||
"Backup codes": "백업 코드",
|
"Backup codes": "백업 코드",
|
||||||
"Disable": "비활성화",
|
"Disable": "비활성화",
|
||||||
@@ -578,13 +575,13 @@
|
|||||||
"Save your backup codes": "백업 코드를 저장하세요",
|
"Save your backup codes": "백업 코드를 저장하세요",
|
||||||
"These codes can be used to access your account if you lose access to your authenticator app. Each code can only be used once.": "인증 앱에 대한 접근 권한을 잃은 경우, 이 코드를 사용하여 귀하의 계정에 접근할 수 있습니다. 각 코드는 한 번만 사용할 수 있습니다.",
|
"These codes can be used to access your account if you lose access to your authenticator app. Each code can only be used once.": "인증 앱에 대한 접근 권한을 잃은 경우, 이 코드를 사용하여 귀하의 계정에 접근할 수 있습니다. 각 코드는 한 번만 사용할 수 있습니다.",
|
||||||
"Print": "인쇄",
|
"Print": "인쇄",
|
||||||
"Two-factor authentication has been set up. Please log in again.": "2단계 인증이 설정되었습니다. 다시 로그인해 주세요.",
|
"Two-factor authentication has been set up. Please log in again.": "이중 인증이 설정되었습니다. 다시 로그인해 주세요.",
|
||||||
"Two-Factor authentication required": "2단계 인증 필요",
|
"Two-Factor authentication required": "2단계 인증이 필요합니다",
|
||||||
"Your workspace requires two-factor authentication for all users": "이 워크스페이스는 모든 사용자에게 2단계 인증을 요구합니다",
|
"Your workspace requires two-factor authentication for all users": "이 워크스페이스는 모든 사용자에게 2단계 인증을 요구합니다",
|
||||||
"To continue accessing your workspace, you must set up two-factor authentication. This adds an extra layer of security to your account.": "워크스페이스에 계속 액세스하려면 2단계 인증을 설정해야 합니다. 이는 계정의 보안을 한층 강화합니다.",
|
"To continue accessing your workspace, you must set up two-factor authentication. This adds an extra layer of security to your account.": "워크스페이스 접근을 계속하려면 이중 인증을 설정해야 합니다. 이는 계정에 추가 보안 계층을 추가합니다.",
|
||||||
"Set up two-factor authentication": "2단계 인증 설정",
|
"Set up two-factor authentication": "2단계 인증 설정",
|
||||||
"Cancel and logout": "취소하고 로그아웃",
|
"Cancel and logout": "취소하고 로그아웃",
|
||||||
"Your workspace requires two-factor authentication. Please set it up to continue.": "워크스페이스에서는 2단계 인증이 필요합니다. 계속하려면 설정해 주세요.",
|
"Your workspace requires two-factor authentication. Please set it up to continue.": "워크스페이스에서는 이중 인증이 필요합니다. 계속하려면 설정해 주세요.",
|
||||||
"This adds an extra layer of security to your account by requiring a verification code from your authenticator app.": "인증앱에서 얻은 인증 코드를 요구하여 계정의 보안에 추가적인 계층을 추가합니다.",
|
"This adds an extra layer of security to your account by requiring a verification code from your authenticator app.": "인증앱에서 얻은 인증 코드를 요구하여 계정의 보안에 추가적인 계층을 추가합니다.",
|
||||||
"Password is required": "비밀번호는 필수입니다",
|
"Password is required": "비밀번호는 필수입니다",
|
||||||
"Password must be at least 8 characters": "비밀번호는 8자 이상이어야 합니다",
|
"Password must be at least 8 characters": "비밀번호는 8자 이상이어야 합니다",
|
||||||
@@ -593,10 +590,10 @@
|
|||||||
"Enter the 6-digit code found in your authenticator app": "인증 앱에 표시된 6자리 코드를 입력하세요",
|
"Enter the 6-digit code found in your authenticator app": "인증 앱에 표시된 6자리 코드를 입력하세요",
|
||||||
"Need help authenticating?": "인증에 도움이 필요하십니까?",
|
"Need help authenticating?": "인증에 도움이 필요하십니까?",
|
||||||
"MFA QR Code": "MFA QR 코드",
|
"MFA QR Code": "MFA QR 코드",
|
||||||
"Account created successfully. Please log in to set up two-factor authentication.": "계정 생성됨. 2단계 인증을 설정하려면 로그인해 주세요.",
|
"Account created successfully. Please log in to set up two-factor authentication.": "계정이 성공적으로 생성되었습니다. 이중 인증을 설정하려면 로그인해 주세요.",
|
||||||
"Password reset successful. Please log in with your new password and complete two-factor authentication.": "비밀번호 재설정됨. 새 비밀번호로 로그인하여 2단계 인증을 완료하세요.",
|
"Password reset successful. Please log in with your new password and complete two-factor authentication.": "비밀번호 재설정 성공. 새 비밀번호로 로그인하여 이중 인증을 완료하세요.",
|
||||||
"Password reset successful. Please log in with your new password to set up two-factor authentication.": "비밀번호 재설정됨. 새 비밀번호로 로그인하여 2단계 인증을 설정하세요.",
|
"Password reset successful. Please log in with your new password to set up two-factor authentication.": "비밀번호 재설정 성공. 새 비밀번호로 로그인하여 이중 인증을 설정하세요.",
|
||||||
"Password reset was successful. Please log in with your new password.": "비밀번호 재설정됨. 새 비밀번호로 로그인하세요.",
|
"Password reset was successful. Please log in with your new password.": "비밀번호 재설정이 성공적으로 완료되었습니다. 새 비밀번호로 로그인하세요.",
|
||||||
"Two-factor authentication": "2단계 인증",
|
"Two-factor authentication": "2단계 인증",
|
||||||
"Use authenticator app instead": "대신 인증 앱 사용",
|
"Use authenticator app instead": "대신 인증 앱 사용",
|
||||||
"Verify backup code": "백업 코드 확인",
|
"Verify backup code": "백업 코드 확인",
|
||||||
@@ -618,7 +615,7 @@
|
|||||||
"Permanently delete": "영구 삭제",
|
"Permanently delete": "영구 삭제",
|
||||||
"<b>{{name}}</b> moved this page to Trash {{time}}.": "<b>{{name}}</b>님이 {{time}}에 이 페이지를 휴지통으로 이동했습니다.",
|
"<b>{{name}}</b> moved this page to Trash {{time}}.": "<b>{{name}}</b>님이 {{time}}에 이 페이지를 휴지통으로 이동했습니다.",
|
||||||
"Page moved to trash": "페이지가 휴지통으로 이동되었습니다",
|
"Page moved to trash": "페이지가 휴지통으로 이동되었습니다",
|
||||||
"Page restored successfully": "페이지 복원됨",
|
"Page restored successfully": "페이지가 성공적으로 복원되었습니다",
|
||||||
"Deleted by": "삭제한 사람",
|
"Deleted by": "삭제한 사람",
|
||||||
"Deleted at": "삭제 시간",
|
"Deleted at": "삭제 시간",
|
||||||
"Preview": "미리보기",
|
"Preview": "미리보기",
|
||||||
@@ -641,7 +638,7 @@
|
|||||||
"Only users with email addresses from these domains can signup via SSO.": "이 도메인의 이메일 주소를 가진 사용자만 SSO를 통해 가입할 수 있습니다.",
|
"Only users with email addresses from these domains can signup via SSO.": "이 도메인의 이메일 주소를 가진 사용자만 SSO를 통해 가입할 수 있습니다.",
|
||||||
"Enter valid domain names separated by comma or space": "쉼표 또는 공백으로 구분된 유효한 도메인 이름을 입력하세요",
|
"Enter valid domain names separated by comma or space": "쉼표 또는 공백으로 구분된 유효한 도메인 이름을 입력하세요",
|
||||||
"Enforce two-factor authentication": "2단계 인증 강제",
|
"Enforce two-factor authentication": "2단계 인증 강제",
|
||||||
"Once enforced, all members must enable two-factor authentication to access the workspace.": "시행되면 모든 멤버가 워크스페이스에 액세스하기 위해 2단계 인증을 활성화해야 합니다.",
|
"Once enforced, all members must enable two-factor authentication to access the workspace.": "시행되면 모든 멤버가 작업 공간에 액세스하기 위해 이중 인증을 활성화해야 합니다.",
|
||||||
"Toggle MFA enforcement": "MFA 강제 설정 전환",
|
"Toggle MFA enforcement": "MFA 강제 설정 전환",
|
||||||
"Display name": "표시 이름",
|
"Display name": "표시 이름",
|
||||||
"Allow signup": "가입 허용",
|
"Allow signup": "가입 허용",
|
||||||
@@ -660,7 +657,7 @@
|
|||||||
"Remove image": "이미지 제거",
|
"Remove image": "이미지 제거",
|
||||||
"Failed to remove image": "이미지 제거 실패",
|
"Failed to remove image": "이미지 제거 실패",
|
||||||
"Image exceeds 10MB limit.": "이미지가 10MB 용량 제한을 초과합니다.",
|
"Image exceeds 10MB limit.": "이미지가 10MB 용량 제한을 초과합니다.",
|
||||||
"Image removed successfully": "이미지 삭제됨",
|
"Image removed successfully": "이미지가 성공적으로 제거되었습니다",
|
||||||
"API key": "API 키",
|
"API key": "API 키",
|
||||||
"API keys": "API 키",
|
"API keys": "API 키",
|
||||||
"API management": "API 관리",
|
"API management": "API 관리",
|
||||||
@@ -672,7 +669,7 @@
|
|||||||
"Last use": "최근 사용",
|
"Last use": "최근 사용",
|
||||||
"No API keys found": "API 키를 찾을 수 없습니다",
|
"No API keys found": "API 키를 찾을 수 없습니다",
|
||||||
"No expiration": "유효기간 없음",
|
"No expiration": "유효기간 없음",
|
||||||
"Revoked successfully": "폐기 완료",
|
"Revoked successfully": "성공적으로 취소되었습니다",
|
||||||
"Select expiration date": "만료일 선택",
|
"Select expiration date": "만료일 선택",
|
||||||
"This action cannot be undone. Any applications using this API key will stop working.": "이 작업은 되돌릴 수 없습니다. 이 API 키를 사용하는 모든 응용 프로그램이 작동을 멈출 것입니다.",
|
"This action cannot be undone. Any applications using this API key will stop working.": "이 작업은 되돌릴 수 없습니다. 이 API 키를 사용하는 모든 응용 프로그램이 작동을 멈출 것입니다.",
|
||||||
"Update": "업데이트",
|
"Update": "업데이트",
|
||||||
@@ -707,11 +704,9 @@
|
|||||||
"Enable the MCP server to allow AI assistants and tools to interact with your workspace content.": "AI 어시스턴트와 도구가 워크스페이스 콘텐츠와 상호작용할 수 있도록 MCP 서버를 활성화하세요.",
|
"Enable the MCP server to allow AI assistants and tools to interact with your workspace content.": "AI 어시스턴트와 도구가 워크스페이스 콘텐츠와 상호작용할 수 있도록 MCP 서버를 활성화하세요.",
|
||||||
"MCP is only available in the Docmost enterprise edition. Contact sales@docmost.com.": "MCP는 Docmost 엔터프라이즈 에디션에서만 제공됩니다. sales@docmost.com으로 문의하세요.",
|
"MCP is only available in the Docmost enterprise edition. Contact sales@docmost.com.": "MCP는 Docmost 엔터프라이즈 에디션에서만 제공됩니다. sales@docmost.com으로 문의하세요.",
|
||||||
"MCP Server URL": "MCP 서버 URL",
|
"MCP Server URL": "MCP 서버 URL",
|
||||||
"Connect AI assistants with your Docmost account via OAuth.": "OAuth를 통해 AI 도우미를 Docmost 계정에 연결합니다.",
|
"Use your API key for authentication. You can manage API keys in your account settings.": "인증을 위해 API 키를 사용하세요. API 키는 계정 설정에서 관리할 수 있습니다.",
|
||||||
"Enforce OAuth": "OAuth 강제",
|
|
||||||
"AI assistants must connect with a Docmost account via OAuth. API keys cannot be used with the MCP server.": "AI 도우미는 OAuth를 통해 Docmost 계정에 연결해야 합니다. MCP 서버에서는 API 키를 사용할 수 없습니다.",
|
|
||||||
"Toggle enforce OAuth for MCP": "MCP에 대해 OAuth 강제 전환",
|
|
||||||
"Supported tools": "지원되는 도구",
|
"Supported tools": "지원되는 도구",
|
||||||
|
"Your workspace has MCP enabled. Use your API key to connect AI assistants.": "워크스페이스에 MCP가 활성화되어 있습니다. AI 어시스턴트를 연결하려면 API 키를 사용하세요.",
|
||||||
"MCP server URL:": "MCP 서버 URL:",
|
"MCP server URL:": "MCP 서버 URL:",
|
||||||
"Learn more": "자세히 알아보기",
|
"Learn more": "자세히 알아보기",
|
||||||
"Manage API keys for all users in the workspace. View the <anchor>API documentation</anchor> for usage details.": "워크스페이스의 모든 사용자를 위한 API 키를 관리하세요. 사용 방법은 <anchor>API 문서</anchor>를 참고하세요.",
|
"Manage API keys for all users in the workspace. View the <anchor>API documentation</anchor> for usage details.": "워크스페이스의 모든 사용자를 위한 API 키를 관리하세요. 사용 방법은 <anchor>API 문서</anchor>를 참고하세요.",
|
||||||
@@ -944,8 +939,8 @@
|
|||||||
"Try again": "다시 시도",
|
"Try again": "다시 시도",
|
||||||
"Untitled chat": "제목 없는 채팅",
|
"Untitled chat": "제목 없는 채팅",
|
||||||
"What can I help you with?": "무엇을 도와드릴까요?",
|
"What can I help you with?": "무엇을 도와드릴까요?",
|
||||||
"Are you sure you want to revoke this {{credential}}": "이 {{credential}}을(를) 폐기하시겠습니까?",
|
"Are you sure you want to revoke this {{credential}}": "이 {{credential}}을 취소하시겠습니까?",
|
||||||
"Automatically provision users and groups from your identity provider via SCIM.": "SCIM을 통해 ID 공급자로부터 사용자와 그룹을 자동으로 프로비저닝합니다.",
|
"Automatically provision users and groups from your identity provider via SCIM.": "SCIM을 통해 ID 공급자에서 사용자와 그룹을 자동으로 프로비저닝합니다.",
|
||||||
"Configure your identity provider with this URL to provision users and groups.": "사용자와 그룹을 프로비저닝할 수 있도록 이 URL로 ID 공급자를 구성하세요.",
|
"Configure your identity provider with this URL to provision users and groups.": "사용자와 그룹을 프로비저닝할 수 있도록 이 URL로 ID 공급자를 구성하세요.",
|
||||||
"Create {{credential}}": "{{credential}} 만들기",
|
"Create {{credential}}": "{{credential}} 만들기",
|
||||||
"{{credential}} created": "{{credential}} 생성됨",
|
"{{credential}} created": "{{credential}} 생성됨",
|
||||||
@@ -958,7 +953,7 @@
|
|||||||
"Important": "중요",
|
"Important": "중요",
|
||||||
"Make sure to copy your {{credential}} now. You won't be able to see it again!": "지금 {{credential}}를 복사해 두세요. 다시는 볼 수 없습니다!",
|
"Make sure to copy your {{credential}} now. You won't be able to see it again!": "지금 {{credential}}를 복사해 두세요. 다시는 볼 수 없습니다!",
|
||||||
"Never": "안 함",
|
"Never": "안 함",
|
||||||
"Revoke {{credential}}": "{{credential}} 폐기",
|
"Revoke {{credential}}": "{{credential}} 취소",
|
||||||
"SCIM endpoint URL": "SCIM 엔드포인트 URL",
|
"SCIM endpoint URL": "SCIM 엔드포인트 URL",
|
||||||
"SCIM provisioning": "SCIM 프로비저닝",
|
"SCIM provisioning": "SCIM 프로비저닝",
|
||||||
"SCIM takes precedence over SSO group sync while enabled.": "SCIM이 활성화되어 있는 동안에는 SSO 그룹 동기화보다 SCIM이 우선 적용됩니다.",
|
"SCIM takes precedence over SSO group sync while enabled.": "SCIM이 활성화되어 있는 동안에는 SSO 그룹 동기화보다 SCIM이 우선 적용됩니다.",
|
||||||
@@ -1191,8 +1186,8 @@
|
|||||||
"Default value": "기본값",
|
"Default value": "기본값",
|
||||||
"Delete property": "속성 삭제",
|
"Delete property": "속성 삭제",
|
||||||
"Delete view": "보기 삭제",
|
"Delete view": "보기 삭제",
|
||||||
"Delete {{count}} rows?_one": "1개 행을 삭제하시겠습니까?",
|
"Delete {{count}} rows?_one": "Delete 1 row?",
|
||||||
"Delete {{count}} rows?_other": "{{count}}개 행을 삭제하시겠습니까?",
|
"Delete {{count}} rows?_other": "Delete {{count}} rows?",
|
||||||
"Descending": "내림차순",
|
"Descending": "내림차순",
|
||||||
"Discard": "삭제",
|
"Discard": "삭제",
|
||||||
"Doesn't contain": "포함하지 않음",
|
"Doesn't contain": "포함하지 않음",
|
||||||
@@ -1291,51 +1286,8 @@
|
|||||||
"Value": "값",
|
"Value": "값",
|
||||||
"View updated for everyone": "보기가 모두에게 업데이트되었습니다",
|
"View updated for everyone": "보기가 모두에게 업데이트되었습니다",
|
||||||
"You have unsaved changes. Do you want to discard them?": "저장되지 않은 변경 사항이 있습니다. 버리시겠습니까?",
|
"You have unsaved changes. Do you want to discard them?": "저장되지 않은 변경 사항이 있습니다. 버리시겠습니까?",
|
||||||
"{{count}} rows deleted_one": "1개 행 삭제 완료",
|
"{{count}} rows deleted_one": "1 row deleted",
|
||||||
"{{count}} rows deleted_other": "{{count}}개 행 삭제 완료",
|
"{{count}} rows deleted_other": "{{count}} rows deleted",
|
||||||
"{{count}} selected_one": "1개 선택됨",
|
"{{count}} selected_one": "1 selected",
|
||||||
"{{count}} selected_other": "{{count}}개 선택됨",
|
"{{count}} selected_other": "{{count}} selected"
|
||||||
"Compare": "비교",
|
|
||||||
"Compare versions": "버전 비교",
|
|
||||||
"Select version from {{date}}": "{{date}}의 버전 선택",
|
|
||||||
"Version actions for {{date}}": "{{date}} 버전 작업",
|
|
||||||
"Comparing {{newer}} and {{older}}": "{{newer}} 및 {{older}} 비교 중",
|
|
||||||
"Exit compare": "비교 종료",
|
|
||||||
"Search attachments...": "첨부파일 검색...",
|
|
||||||
"Error loading attachments.": "첨부파일을 불러오는 중 오류가 발생했습니다.",
|
|
||||||
"No attachments on this page yet.": "이 페이지에는 아직 첨부파일이 없습니다.",
|
|
||||||
"Uploaded by {{name}}": "업로드한 사람: {{name}}",
|
|
||||||
"Download {{name}}": "{{name}} 다운로드",
|
|
||||||
"Access revoked": "액세스가 취소되었습니다",
|
|
||||||
"Authorize application": "애플리케이션 승인",
|
|
||||||
"{{name}} wants to access {{workspace}}": "{{name}}에서 {{workspace}}에 액세스하려고 합니다",
|
|
||||||
"Not you? Switch account": "본인이 아니신가요? 계정을 전환하세요",
|
|
||||||
"This application will be able to:": "이 애플리케이션이 수행할 수 있는 작업:",
|
|
||||||
"Write": "쓰기",
|
|
||||||
"Invalid authorization request": "잘못된 승인 요청",
|
|
||||||
"Authorize": "승인",
|
|
||||||
"Application": "애플리케이션",
|
|
||||||
"Permissions": "권한",
|
|
||||||
"Authorized": "승인됨",
|
|
||||||
"Revoke access": "액세스 취소",
|
|
||||||
"Revoke access for {{name}}": "{{name}}의 액세스 취소",
|
|
||||||
"Are you sure you want to revoke access for {{name}}? The application will no longer be able to access your account.": "정말로 {{name}}의 액세스를 취소하시겠습니까? 이 애플리케이션은 더 이상 회원님의 계정에 액세스할 수 없습니다.",
|
|
||||||
"Something went wrong. Please try again.": "문제가 발생했습니다. 다시 시도해 주세요.",
|
|
||||||
"Remove {{name}}": "{{name}} 제거",
|
|
||||||
"Make sure you trust this application before authorizing it.": "이 애플리케이션을 승인하기 전에 신뢰할 수 있는지 확인하세요.",
|
|
||||||
"You will be redirected to": "다음으로 리디렉션됩니다",
|
|
||||||
"View content without making changes.": "변경하지 않고 콘텐츠를 봅니다.",
|
|
||||||
"Create and modify content.": "콘텐츠를 생성하고 수정합니다.",
|
|
||||||
"Applications and AI assistants you have authorized to access your account.": "회원님의 계정에 액세스하도록 승인한 애플리케이션 및 AI 도우미입니다.",
|
|
||||||
"Your workspace has MCP enabled. Connect AI assistants with your Docmost account via OAuth.": "워크스페이스에서 MCP가 활성화되어 있습니다. OAuth를 통해 AI 도우미를 Docmost 계정에 연결하세요.",
|
|
||||||
"Authorized apps": "승인된 앱",
|
|
||||||
"No authorized apps yet.": "아직 승인된 앱이 없습니다.",
|
|
||||||
"Workspace knowledge only": "워크스페이스 지식만 사용",
|
|
||||||
"Restrict AI Chat to answering from your workspace pages and uploaded files only. It will not use outside knowledge.": "AI 채팅이 워크스페이스 페이지와 업로드된 파일의 내용만 바탕으로 답변하도록 제한합니다. 외부 지식은 사용하지 않습니다.",
|
|
||||||
"Toggle workspace knowledge only": "워크스페이스 지식만 사용 전환",
|
|
||||||
"Read-only mode": "읽기 전용 모드",
|
|
||||||
"AI Chat can search and read workspace content, but cannot create or edit pages.": "AI 채팅은 워크스페이스 콘텐츠를 검색하고 읽을 수 있지만, 페이지를 생성하거나 편집할 수는 없습니다.",
|
|
||||||
"Toggle AI Chat read-only mode": "AI 채팅 읽기 전용 모드 전환",
|
|
||||||
"Title only": "제목만",
|
|
||||||
"you": "회원님"
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -294,7 +294,6 @@
|
|||||||
"Export space": "Exporteer ruimte",
|
"Export space": "Exporteer ruimte",
|
||||||
"Export {{type}}": "Exporteer {{type}}",
|
"Export {{type}}": "Exporteer {{type}}",
|
||||||
"File exceeds the {{limit}} attachment limit": "Bestand overschrijdt de bijlagelimiet van {{limit}}",
|
"File exceeds the {{limit}} attachment limit": "Bestand overschrijdt de bijlagelimiet van {{limit}}",
|
||||||
"Media": "Media",
|
|
||||||
"Align left": "Links uitlijnen",
|
"Align left": "Links uitlijnen",
|
||||||
"Align right": "Rechts uitlijnen",
|
"Align right": "Rechts uitlijnen",
|
||||||
"Align center": "Centreren",
|
"Align center": "Centreren",
|
||||||
@@ -388,8 +387,6 @@
|
|||||||
"Insert horizontal rule divider": "Horizontale lijn invoegen",
|
"Insert horizontal rule divider": "Horizontale lijn invoegen",
|
||||||
"Page break": "Pagina-einde",
|
"Page break": "Pagina-einde",
|
||||||
"Insert a page break for printing.": "Voeg een pagina-einde in voor het afdrukken.",
|
"Insert a page break for printing.": "Voeg een pagina-einde in voor het afdrukken.",
|
||||||
"Footnote": "Voetnoot",
|
|
||||||
"Insert a footnote reference.": "Voeg een voetnootverwijzing in.",
|
|
||||||
"Upload any image from your device.": "Upload een afbeelding vanaf uw apparaat.",
|
"Upload any image from your device.": "Upload een afbeelding vanaf uw apparaat.",
|
||||||
"Upload any video from your device.": "Upload een video vanaf uw apparaat.",
|
"Upload any video from your device.": "Upload een video vanaf uw apparaat.",
|
||||||
"Upload any audio from your device.": "Upload een audio vanaf uw apparaat.",
|
"Upload any audio from your device.": "Upload een audio vanaf uw apparaat.",
|
||||||
@@ -707,11 +704,9 @@
|
|||||||
"Enable the MCP server to allow AI assistants and tools to interact with your workspace content.": "Schakel de MCP-server in zodat AI-assistenten en tools kunnen interageren met de inhoud van uw werkruimte.",
|
"Enable the MCP server to allow AI assistants and tools to interact with your workspace content.": "Schakel de MCP-server in zodat AI-assistenten en tools kunnen interageren met de inhoud van uw werkruimte.",
|
||||||
"MCP is only available in the Docmost enterprise edition. Contact sales@docmost.com.": "MCP is alleen beschikbaar in de Docmost Enterprise-editie. Neem contact op met sales@docmost.com.",
|
"MCP is only available in the Docmost enterprise edition. Contact sales@docmost.com.": "MCP is alleen beschikbaar in de Docmost Enterprise-editie. Neem contact op met sales@docmost.com.",
|
||||||
"MCP Server URL": "MCP-server-URL",
|
"MCP Server URL": "MCP-server-URL",
|
||||||
"Connect AI assistants with your Docmost account via OAuth.": "Verbind AI-assistenten met je Docmost-account via OAuth.",
|
"Use your API key for authentication. You can manage API keys in your account settings.": "Gebruik uw API-sleutel voor authenticatie. U kunt API-sleutels beheren in uw accountinstellingen.",
|
||||||
"Enforce OAuth": "OAuth afdwingen",
|
|
||||||
"AI assistants must connect with a Docmost account via OAuth. API keys cannot be used with the MCP server.": "AI-assistenten moeten verbinding maken met een Docmost-account via OAuth. API-sleutels kunnen niet worden gebruikt met de MCP-server.",
|
|
||||||
"Toggle enforce OAuth for MCP": "OAuth afdwingen voor MCP in- of uitschakelen",
|
|
||||||
"Supported tools": "Ondersteunde tools",
|
"Supported tools": "Ondersteunde tools",
|
||||||
|
"Your workspace has MCP enabled. Use your API key to connect AI assistants.": "In uw werkruimte is MCP ingeschakeld. Gebruik uw API-sleutel om AI-assistenten te koppelen.",
|
||||||
"MCP server URL:": "MCP-server-URL:",
|
"MCP server URL:": "MCP-server-URL:",
|
||||||
"Learn more": "Meer informatie",
|
"Learn more": "Meer informatie",
|
||||||
"Manage API keys for all users in the workspace. View the <anchor>API documentation</anchor> for usage details.": "Beheer API-sleutels voor alle gebruikers in de werkruimte. Bekijk de <anchor>API-documentatie</anchor> voor gebruiksdetails.",
|
"Manage API keys for all users in the workspace. View the <anchor>API documentation</anchor> for usage details.": "Beheer API-sleutels voor alle gebruikers in de werkruimte. Bekijk de <anchor>API-documentatie</anchor> voor gebruiksdetails.",
|
||||||
@@ -1294,48 +1289,5 @@
|
|||||||
"{{count}} rows deleted_one": "1 rij verwijderd",
|
"{{count}} rows deleted_one": "1 rij verwijderd",
|
||||||
"{{count}} rows deleted_other": "{{count}} rijen verwijderd",
|
"{{count}} rows deleted_other": "{{count}} rijen verwijderd",
|
||||||
"{{count}} selected_one": "1 geselecteerd",
|
"{{count}} selected_one": "1 geselecteerd",
|
||||||
"{{count}} selected_other": "{{count}} geselecteerd",
|
"{{count}} selected_other": "{{count}} geselecteerd"
|
||||||
"Compare": "Vergelijken",
|
|
||||||
"Compare versions": "Versies vergelijken",
|
|
||||||
"Select version from {{date}}": "Selecteer versie van {{date}}",
|
|
||||||
"Version actions for {{date}}": "Versieacties voor {{date}}",
|
|
||||||
"Comparing {{newer}} and {{older}}": "{{newer}} en {{older}} vergelijken",
|
|
||||||
"Exit compare": "Vergelijken afsluiten",
|
|
||||||
"Search attachments...": "Bijlagen zoeken...",
|
|
||||||
"Error loading attachments.": "Fout bij het laden van bijlagen.",
|
|
||||||
"No attachments on this page yet.": "Er zijn nog geen bijlagen op deze pagina.",
|
|
||||||
"Uploaded by {{name}}": "Geüpload door {{name}}",
|
|
||||||
"Download {{name}}": "{{name}} downloaden",
|
|
||||||
"Access revoked": "Toegang ingetrokken",
|
|
||||||
"Authorize application": "Applicatie autoriseren",
|
|
||||||
"{{name}} wants to access {{workspace}}": "{{name}} wil toegang tot {{workspace}}",
|
|
||||||
"Not you? Switch account": "Ben jij dit niet? Wissel van account",
|
|
||||||
"This application will be able to:": "Deze applicatie kan het volgende doen:",
|
|
||||||
"Write": "Schrijven",
|
|
||||||
"Invalid authorization request": "Ongeldig autorisatieverzoek",
|
|
||||||
"Authorize": "Autoriseren",
|
|
||||||
"Application": "Applicatie",
|
|
||||||
"Permissions": "Machtigingen",
|
|
||||||
"Authorized": "Geautoriseerd",
|
|
||||||
"Revoke access": "Toegang intrekken",
|
|
||||||
"Revoke access for {{name}}": "Toegang voor {{name}} intrekken",
|
|
||||||
"Are you sure you want to revoke access for {{name}}? The application will no longer be able to access your account.": "Weet je zeker dat je de toegang voor {{name}} wilt intrekken? De applicatie heeft dan geen toegang meer tot je account.",
|
|
||||||
"Something went wrong. Please try again.": "Er is iets misgegaan. Probeer het opnieuw.",
|
|
||||||
"Remove {{name}}": "{{name}} verwijderen",
|
|
||||||
"Make sure you trust this application before authorizing it.": "Zorg ervoor dat je deze applicatie vertrouwt voordat je haar autoriseert.",
|
|
||||||
"You will be redirected to": "Je wordt doorgestuurd naar",
|
|
||||||
"View content without making changes.": "Inhoud bekijken zonder wijzigingen aan te brengen.",
|
|
||||||
"Create and modify content.": "Inhoud maken en wijzigen.",
|
|
||||||
"Applications and AI assistants you have authorized to access your account.": "Applicaties en AI-assistenten die je hebt geautoriseerd om toegang te krijgen tot je account.",
|
|
||||||
"Your workspace has MCP enabled. Connect AI assistants with your Docmost account via OAuth.": "MCP is ingeschakeld voor je werkruimte. Verbind AI-assistenten met je Docmost-account via OAuth.",
|
|
||||||
"Authorized apps": "Geautoriseerde apps",
|
|
||||||
"No authorized apps yet.": "Nog geen geautoriseerde apps.",
|
|
||||||
"Workspace knowledge only": "Alleen werkruimtek kennis",
|
|
||||||
"Restrict AI Chat to answering from your workspace pages and uploaded files only. It will not use outside knowledge.": "Beperk AI Chat tot het beantwoorden op basis van alleen je werkruimtepagina's en geüploade bestanden. Er wordt geen externe kennis gebruikt.",
|
|
||||||
"Toggle workspace knowledge only": "Alleen werkruimtekennis in-/uitschakelen",
|
|
||||||
"Read-only mode": "Alleen-lezenmodus",
|
|
||||||
"AI Chat can search and read workspace content, but cannot create or edit pages.": "AI Chat kan werkruimte-inhoud doorzoeken en lezen, maar kan geen pagina's maken of bewerken.",
|
|
||||||
"Toggle AI Chat read-only mode": "Alleen-lezenmodus voor AI Chat in-/uitschakelen",
|
|
||||||
"Title only": "Alleen titel",
|
|
||||||
"you": "jij"
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -294,7 +294,6 @@
|
|||||||
"Export space": "Exportar espaço",
|
"Export space": "Exportar espaço",
|
||||||
"Export {{type}}": "Exportar para {{type}}",
|
"Export {{type}}": "Exportar para {{type}}",
|
||||||
"File exceeds the {{limit}} attachment limit": "O arquivo excede o limite de anexos {{limit}}",
|
"File exceeds the {{limit}} attachment limit": "O arquivo excede o limite de anexos {{limit}}",
|
||||||
"Media": "Mídia",
|
|
||||||
"Align left": "Alinhar à esquerda",
|
"Align left": "Alinhar à esquerda",
|
||||||
"Align right": "Alinhar à direita",
|
"Align right": "Alinhar à direita",
|
||||||
"Align center": "Alinhar ao centro",
|
"Align center": "Alinhar ao centro",
|
||||||
@@ -388,8 +387,6 @@
|
|||||||
"Insert horizontal rule divider": "Insira um divisor horizontal",
|
"Insert horizontal rule divider": "Insira um divisor horizontal",
|
||||||
"Page break": "Quebra de página",
|
"Page break": "Quebra de página",
|
||||||
"Insert a page break for printing.": "Insira uma quebra de página para impressão.",
|
"Insert a page break for printing.": "Insira uma quebra de página para impressão.",
|
||||||
"Footnote": "Nota de rodapé",
|
|
||||||
"Insert a footnote reference.": "Inserir uma referência de nota de rodapé.",
|
|
||||||
"Upload any image from your device.": "Envie qualquer imagem do seu dispositivo.",
|
"Upload any image from your device.": "Envie qualquer imagem do seu dispositivo.",
|
||||||
"Upload any video from your device.": "Envie qualquer vídeo do seu dispositivo.",
|
"Upload any video from your device.": "Envie qualquer vídeo do seu dispositivo.",
|
||||||
"Upload any audio from your device.": "Envie qualquer áudio do seu dispositivo.",
|
"Upload any audio from your device.": "Envie qualquer áudio do seu dispositivo.",
|
||||||
@@ -707,11 +704,9 @@
|
|||||||
"Enable the MCP server to allow AI assistants and tools to interact with your workspace content.": "Ative o servidor MCP para permitir que assistentes de IA e ferramentas interajam com o conteúdo do seu espaço de trabalho.",
|
"Enable the MCP server to allow AI assistants and tools to interact with your workspace content.": "Ative o servidor MCP para permitir que assistentes de IA e ferramentas interajam com o conteúdo do seu espaço de trabalho.",
|
||||||
"MCP is only available in the Docmost enterprise edition. Contact sales@docmost.com.": "O MCP está disponível apenas na edição empresarial do Docmost. Contate sales@docmost.com.",
|
"MCP is only available in the Docmost enterprise edition. Contact sales@docmost.com.": "O MCP está disponível apenas na edição empresarial do Docmost. Contate sales@docmost.com.",
|
||||||
"MCP Server URL": "URL do servidor MCP",
|
"MCP Server URL": "URL do servidor MCP",
|
||||||
"Connect AI assistants with your Docmost account via OAuth.": "Conecte assistentes de IA à sua conta do Docmost via OAuth.",
|
"Use your API key for authentication. You can manage API keys in your account settings.": "Use sua chave de API para autenticação. Você pode gerenciar chaves de API nas configurações da sua conta.",
|
||||||
"Enforce OAuth": "Exigir OAuth",
|
|
||||||
"AI assistants must connect with a Docmost account via OAuth. API keys cannot be used with the MCP server.": "Os assistentes de IA devem se conectar com uma conta do Docmost via OAuth. Chaves de API não podem ser usadas com o servidor MCP.",
|
|
||||||
"Toggle enforce OAuth for MCP": "Ativar/desativar exigência de OAuth para MCP",
|
|
||||||
"Supported tools": "Ferramentas compatíveis",
|
"Supported tools": "Ferramentas compatíveis",
|
||||||
|
"Your workspace has MCP enabled. Use your API key to connect AI assistants.": "Seu espaço de trabalho tem MCP habilitado. Use sua chave de API para conectar assistentes de IA.",
|
||||||
"MCP server URL:": "URL do servidor MCP:",
|
"MCP server URL:": "URL do servidor MCP:",
|
||||||
"Learn more": "Saiba mais",
|
"Learn more": "Saiba mais",
|
||||||
"Manage API keys for all users in the workspace. View the <anchor>API documentation</anchor> for usage details.": "Gerencie as chaves de API de todos os usuários do workspace. Veja a <anchor>documentação da API</anchor> para detalhes de uso.",
|
"Manage API keys for all users in the workspace. View the <anchor>API documentation</anchor> for usage details.": "Gerencie as chaves de API de todos os usuários do workspace. Veja a <anchor>documentação da API</anchor> para detalhes de uso.",
|
||||||
@@ -1294,48 +1289,5 @@
|
|||||||
"{{count}} rows deleted_one": "1 row deleted",
|
"{{count}} rows deleted_one": "1 row deleted",
|
||||||
"{{count}} rows deleted_other": "{{count}} rows deleted",
|
"{{count}} rows deleted_other": "{{count}} rows deleted",
|
||||||
"{{count}} selected_one": "1 selected",
|
"{{count}} selected_one": "1 selected",
|
||||||
"{{count}} selected_other": "{{count}} selected",
|
"{{count}} selected_other": "{{count}} selected"
|
||||||
"Compare": "Comparar",
|
|
||||||
"Compare versions": "Comparar versões",
|
|
||||||
"Select version from {{date}}": "Selecionar versão de {{date}}",
|
|
||||||
"Version actions for {{date}}": "Ações da versão de {{date}}",
|
|
||||||
"Comparing {{newer}} and {{older}}": "Comparando {{newer}} e {{older}}",
|
|
||||||
"Exit compare": "Sair da comparação",
|
|
||||||
"Search attachments...": "Pesquisar anexos...",
|
|
||||||
"Error loading attachments.": "Erro ao carregar anexos.",
|
|
||||||
"No attachments on this page yet.": "Ainda não há anexos nesta página.",
|
|
||||||
"Uploaded by {{name}}": "Enviado por {{name}}",
|
|
||||||
"Download {{name}}": "Baixar {{name}}",
|
|
||||||
"Access revoked": "Acesso revogado",
|
|
||||||
"Authorize application": "Autorizar aplicativo",
|
|
||||||
"{{name}} wants to access {{workspace}}": "{{name}} quer acessar {{workspace}}",
|
|
||||||
"Not you? Switch account": "Não é você? Trocar conta",
|
|
||||||
"This application will be able to:": "Este aplicativo poderá:",
|
|
||||||
"Write": "Escrever",
|
|
||||||
"Invalid authorization request": "Solicitação de autorização inválida",
|
|
||||||
"Authorize": "Autorizar",
|
|
||||||
"Application": "Aplicativo",
|
|
||||||
"Permissions": "Permissões",
|
|
||||||
"Authorized": "Autorizado",
|
|
||||||
"Revoke access": "Revogar acesso",
|
|
||||||
"Revoke access for {{name}}": "Revogar acesso de {{name}}",
|
|
||||||
"Are you sure you want to revoke access for {{name}}? The application will no longer be able to access your account.": "Tem certeza de que deseja revogar o acesso de {{name}}? O aplicativo não poderá mais acessar sua conta.",
|
|
||||||
"Something went wrong. Please try again.": "Algo deu errado. Tente novamente.",
|
|
||||||
"Remove {{name}}": "Remover {{name}}",
|
|
||||||
"Make sure you trust this application before authorizing it.": "Certifique-se de confiar neste aplicativo antes de autorizá-lo.",
|
|
||||||
"You will be redirected to": "Você será redirecionado para",
|
|
||||||
"View content without making changes.": "Visualizar conteúdo sem fazer alterações.",
|
|
||||||
"Create and modify content.": "Criar e modificar conteúdo.",
|
|
||||||
"Applications and AI assistants you have authorized to access your account.": "Aplicativos e assistentes de IA que você autorizou a acessar sua conta.",
|
|
||||||
"Your workspace has MCP enabled. Connect AI assistants with your Docmost account via OAuth.": "Seu workspace tem o MCP ativado. Conecte assistentes de IA à sua conta do Docmost via OAuth.",
|
|
||||||
"Authorized apps": "Aplicativos autorizados",
|
|
||||||
"No authorized apps yet.": "Ainda não há aplicativos autorizados.",
|
|
||||||
"Workspace knowledge only": "Somente conhecimento do workspace",
|
|
||||||
"Restrict AI Chat to answering from your workspace pages and uploaded files only. It will not use outside knowledge.": "Restrinja o AI Chat para responder apenas com base nas páginas do seu workspace e nos arquivos enviados. Ele não usará conhecimento externo.",
|
|
||||||
"Toggle workspace knowledge only": "Alternar somente conhecimento do workspace",
|
|
||||||
"Read-only mode": "Modo somente leitura",
|
|
||||||
"AI Chat can search and read workspace content, but cannot create or edit pages.": "O AI Chat pode pesquisar e ler o conteúdo do workspace, mas não pode criar nem editar páginas.",
|
|
||||||
"Toggle AI Chat read-only mode": "Alternar modo somente leitura do AI Chat",
|
|
||||||
"Title only": "Somente título",
|
|
||||||
"you": "você"
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -294,7 +294,6 @@
|
|||||||
"Export space": "Экспорт пространства",
|
"Export space": "Экспорт пространства",
|
||||||
"Export {{type}}": "Экспорт {{type}}",
|
"Export {{type}}": "Экспорт {{type}}",
|
||||||
"File exceeds the {{limit}} attachment limit": "Файл превышает лимит вложений {{limit}}",
|
"File exceeds the {{limit}} attachment limit": "Файл превышает лимит вложений {{limit}}",
|
||||||
"Media": "Медиа",
|
|
||||||
"Align left": "По левому краю",
|
"Align left": "По левому краю",
|
||||||
"Align right": "По правому краю",
|
"Align right": "По правому краю",
|
||||||
"Align center": "По центру",
|
"Align center": "По центру",
|
||||||
@@ -388,8 +387,6 @@
|
|||||||
"Insert horizontal rule divider": "Вставить горизонтальный разделитель",
|
"Insert horizontal rule divider": "Вставить горизонтальный разделитель",
|
||||||
"Page break": "Разрыв страницы",
|
"Page break": "Разрыв страницы",
|
||||||
"Insert a page break for printing.": "Вставить разрыв страницы для печати.",
|
"Insert a page break for printing.": "Вставить разрыв страницы для печати.",
|
||||||
"Footnote": "Сноска",
|
|
||||||
"Insert a footnote reference.": "Вставить ссылку на сноску.",
|
|
||||||
"Upload any image from your device.": "Загрузить любое изображение с вашего устройства.",
|
"Upload any image from your device.": "Загрузить любое изображение с вашего устройства.",
|
||||||
"Upload any video from your device.": "Загрузить любое видео с вашего устройства.",
|
"Upload any video from your device.": "Загрузить любое видео с вашего устройства.",
|
||||||
"Upload any audio from your device.": "Загрузите любой аудиофайл с вашего устройства.",
|
"Upload any audio from your device.": "Загрузите любой аудиофайл с вашего устройства.",
|
||||||
@@ -707,11 +704,9 @@
|
|||||||
"Enable the MCP server to allow AI assistants and tools to interact with your workspace content.": "Включите сервер MCP, чтобы ИИ-ассистенты и инструменты могли взаимодействовать с содержимым вашего рабочего пространства.",
|
"Enable the MCP server to allow AI assistants and tools to interact with your workspace content.": "Включите сервер MCP, чтобы ИИ-ассистенты и инструменты могли взаимодействовать с содержимым вашего рабочего пространства.",
|
||||||
"MCP is only available in the Docmost enterprise edition. Contact sales@docmost.com.": "MCP доступен только в корпоративной версии Docmost. Свяжитесь по адресу sales@docmost.com.",
|
"MCP is only available in the Docmost enterprise edition. Contact sales@docmost.com.": "MCP доступен только в корпоративной версии Docmost. Свяжитесь по адресу sales@docmost.com.",
|
||||||
"MCP Server URL": "URL сервера MCP",
|
"MCP Server URL": "URL сервера MCP",
|
||||||
"Connect AI assistants with your Docmost account via OAuth.": "Подключайте AI-помощников к вашей учетной записи Docmost через OAuth.",
|
"Use your API key for authentication. You can manage API keys in your account settings.": "Используйте ваш API-ключ для аутентификации. Управлять API-ключами можно в настройках аккаунта.",
|
||||||
"Enforce OAuth": "Сделать OAuth обязательным",
|
|
||||||
"AI assistants must connect with a Docmost account via OAuth. API keys cannot be used with the MCP server.": "AI-помощники должны подключаться к учетной записи Docmost через OAuth. Ключи API нельзя использовать с MCP-сервером.",
|
|
||||||
"Toggle enforce OAuth for MCP": "Переключить обязательное использование OAuth для MCP",
|
|
||||||
"Supported tools": "Поддерживаемые инструменты",
|
"Supported tools": "Поддерживаемые инструменты",
|
||||||
|
"Your workspace has MCP enabled. Use your API key to connect AI assistants.": "В вашем рабочем пространстве включён MCP. Используйте свой API-ключ для подключения ИИ-ассистентов.",
|
||||||
"MCP server URL:": "URL сервера MCP:",
|
"MCP server URL:": "URL сервера MCP:",
|
||||||
"Learn more": "Подробнее",
|
"Learn more": "Подробнее",
|
||||||
"Manage API keys for all users in the workspace. View the <anchor>API documentation</anchor> for usage details.": "Управляйте API-ключами для всех пользователей в рабочем пространстве. Смотрите <anchor>документацию по API</anchor> для получения информации об использовании.",
|
"Manage API keys for all users in the workspace. View the <anchor>API documentation</anchor> for usage details.": "Управляйте API-ключами для всех пользователей в рабочем пространстве. Смотрите <anchor>документацию по API</anchor> для получения информации об использовании.",
|
||||||
@@ -1191,8 +1186,8 @@
|
|||||||
"Default value": "Значение по умолчанию",
|
"Default value": "Значение по умолчанию",
|
||||||
"Delete property": "Удалить свойство",
|
"Delete property": "Удалить свойство",
|
||||||
"Delete view": "Удалить представление",
|
"Delete view": "Удалить представление",
|
||||||
"Delete {{count}} rows?_one": "Удалить 1 строку?",
|
"Delete {{count}} rows?_one": "Delete 1 row?",
|
||||||
"Delete {{count}} rows?_other": "Удалить {{count}} строк?",
|
"Delete {{count}} rows?_other": "Delete {{count}} rows?",
|
||||||
"Descending": "По убыванию",
|
"Descending": "По убыванию",
|
||||||
"Discard": "Отменить",
|
"Discard": "Отменить",
|
||||||
"Doesn't contain": "Не содержит",
|
"Doesn't contain": "Не содержит",
|
||||||
@@ -1291,51 +1286,8 @@
|
|||||||
"Value": "Значение",
|
"Value": "Значение",
|
||||||
"View updated for everyone": "Представление обновлено для всех",
|
"View updated for everyone": "Представление обновлено для всех",
|
||||||
"You have unsaved changes. Do you want to discard them?": "У вас есть несохранённые изменения. Хотите их отменить?",
|
"You have unsaved changes. Do you want to discard them?": "У вас есть несохранённые изменения. Хотите их отменить?",
|
||||||
"{{count}} rows deleted_one": "1 строка удалена",
|
"{{count}} rows deleted_one": "1 row deleted",
|
||||||
"{{count}} rows deleted_other": "{{count}} строк удалено",
|
"{{count}} rows deleted_other": "{{count}} rows deleted",
|
||||||
"{{count}} selected_one": "1 выбрано",
|
"{{count}} selected_one": "1 selected",
|
||||||
"{{count}} selected_other": "{{count}} выбрано",
|
"{{count}} selected_other": "{{count}} selected"
|
||||||
"Compare": "Сравнить",
|
|
||||||
"Compare versions": "Сравнить версии",
|
|
||||||
"Select version from {{date}}": "Выбрать версию от {{date}}",
|
|
||||||
"Version actions for {{date}}": "Действия с версией от {{date}}",
|
|
||||||
"Comparing {{newer}} and {{older}}": "Сравнение {{newer}} и {{older}}",
|
|
||||||
"Exit compare": "Выйти из режима сравнения",
|
|
||||||
"Search attachments...": "Поиск вложений...",
|
|
||||||
"Error loading attachments.": "Ошибка при загрузке вложений.",
|
|
||||||
"No attachments on this page yet.": "На этой странице пока нет вложений.",
|
|
||||||
"Uploaded by {{name}}": "Загружено пользователем {{name}}",
|
|
||||||
"Download {{name}}": "Скачать {{name}}",
|
|
||||||
"Access revoked": "Доступ отозван",
|
|
||||||
"Authorize application": "Авторизовать приложение",
|
|
||||||
"{{name}} wants to access {{workspace}}": "{{name}} запрашивает доступ к {{workspace}}",
|
|
||||||
"Not you? Switch account": "Не вы? Сменить аккаунт",
|
|
||||||
"This application will be able to:": "Это приложение сможет:",
|
|
||||||
"Write": "Запись",
|
|
||||||
"Invalid authorization request": "Недопустимый запрос на авторизацию",
|
|
||||||
"Authorize": "Авторизовать",
|
|
||||||
"Application": "Приложение",
|
|
||||||
"Permissions": "Разрешения",
|
|
||||||
"Authorized": "Авторизовано",
|
|
||||||
"Revoke access": "Отозвать доступ",
|
|
||||||
"Revoke access for {{name}}": "Отозвать доступ для {{name}}",
|
|
||||||
"Are you sure you want to revoke access for {{name}}? The application will no longer be able to access your account.": "Вы уверены, что хотите отозвать доступ для {{name}}? Приложение больше не сможет получить доступ к вашей учетной записи.",
|
|
||||||
"Something went wrong. Please try again.": "Что-то пошло не так. Пожалуйста, попробуйте еще раз.",
|
|
||||||
"Remove {{name}}": "Удалить {{name}}",
|
|
||||||
"Make sure you trust this application before authorizing it.": "Прежде чем авторизовать это приложение, убедитесь, что вы ему доверяете.",
|
|
||||||
"You will be redirected to": "Вы будете перенаправлены на",
|
|
||||||
"View content without making changes.": "Просматривать содержимое без внесения изменений.",
|
|
||||||
"Create and modify content.": "Создавать и изменять содержимое.",
|
|
||||||
"Applications and AI assistants you have authorized to access your account.": "Приложения и AI-помощники, которым вы разрешили доступ к своей учетной записи.",
|
|
||||||
"Your workspace has MCP enabled. Connect AI assistants with your Docmost account via OAuth.": "В вашем рабочем пространстве включен MCP. Подключайте AI-помощников к вашей учетной записи Docmost через OAuth.",
|
|
||||||
"Authorized apps": "Авторизованные приложения",
|
|
||||||
"No authorized apps yet.": "Пока нет авторизованных приложений.",
|
|
||||||
"Workspace knowledge only": "Только знания рабочего пространства",
|
|
||||||
"Restrict AI Chat to answering from your workspace pages and uploaded files only. It will not use outside knowledge.": "Ограничить AI Chat ответами только на основе страниц вашего рабочего пространства и загруженных файлов. Внешние знания использоваться не будут.",
|
|
||||||
"Toggle workspace knowledge only": "Переключить режим \"Только знания рабочего пространства\"",
|
|
||||||
"Read-only mode": "Режим только для чтения",
|
|
||||||
"AI Chat can search and read workspace content, but cannot create or edit pages.": "AI Chat может искать и читать содержимое рабочего пространства, но не может создавать или редактировать страницы.",
|
|
||||||
"Toggle AI Chat read-only mode": "Переключить режим только для чтения для AI Chat",
|
|
||||||
"Title only": "Только заголовок",
|
|
||||||
"you": "вы"
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -294,7 +294,6 @@
|
|||||||
"Export space": "Експорт простору",
|
"Export space": "Експорт простору",
|
||||||
"Export {{type}}": "Експорт {{type}}",
|
"Export {{type}}": "Експорт {{type}}",
|
||||||
"File exceeds the {{limit}} attachment limit": "Файл перевищує ліміт вкладень {{limit}}",
|
"File exceeds the {{limit}} attachment limit": "Файл перевищує ліміт вкладень {{limit}}",
|
||||||
"Media": "Медіа",
|
|
||||||
"Align left": "По лівому краю",
|
"Align left": "По лівому краю",
|
||||||
"Align right": "По правому краю",
|
"Align right": "По правому краю",
|
||||||
"Align center": "По центру",
|
"Align center": "По центру",
|
||||||
@@ -388,8 +387,6 @@
|
|||||||
"Insert horizontal rule divider": "Вставити горизонтальний роздільник",
|
"Insert horizontal rule divider": "Вставити горизонтальний роздільник",
|
||||||
"Page break": "Розрив сторінки",
|
"Page break": "Розрив сторінки",
|
||||||
"Insert a page break for printing.": "Вставте розрив сторінки для друку.",
|
"Insert a page break for printing.": "Вставте розрив сторінки для друку.",
|
||||||
"Footnote": "Виноска",
|
|
||||||
"Insert a footnote reference.": "Вставити посилання на виноску.",
|
|
||||||
"Upload any image from your device.": "Завантажити будь-яке зображення з вашого пристрою.",
|
"Upload any image from your device.": "Завантажити будь-яке зображення з вашого пристрою.",
|
||||||
"Upload any video from your device.": "Завантажити будь-яке відео з вашого пристрою.",
|
"Upload any video from your device.": "Завантажити будь-яке відео з вашого пристрою.",
|
||||||
"Upload any audio from your device.": "Завантажте будь-який аудіофайл зі свого пристрою.",
|
"Upload any audio from your device.": "Завантажте будь-який аудіофайл зі свого пристрою.",
|
||||||
@@ -707,11 +704,9 @@
|
|||||||
"Enable the MCP server to allow AI assistants and tools to interact with your workspace content.": "Увімкніть MCP‑сервер, щоб дозволити ШІ‑помічникам та інструментам взаємодіяти з вмістом вашого робочого простору.",
|
"Enable the MCP server to allow AI assistants and tools to interact with your workspace content.": "Увімкніть MCP‑сервер, щоб дозволити ШІ‑помічникам та інструментам взаємодіяти з вмістом вашого робочого простору.",
|
||||||
"MCP is only available in the Docmost enterprise edition. Contact sales@docmost.com.": "MCP доступний лише в корпоративній редакції Docmost. Зверніться до sales@docmost.com.",
|
"MCP is only available in the Docmost enterprise edition. Contact sales@docmost.com.": "MCP доступний лише в корпоративній редакції Docmost. Зверніться до sales@docmost.com.",
|
||||||
"MCP Server URL": "URL сервера MCP",
|
"MCP Server URL": "URL сервера MCP",
|
||||||
"Connect AI assistants with your Docmost account via OAuth.": "Підключайте AI-асистентів до свого облікового запису Docmost через OAuth.",
|
"Use your API key for authentication. You can manage API keys in your account settings.": "Використовуйте свій API‑ключ для аутентифікації. Ви можете керувати API‑ключами в налаштуваннях облікового запису.",
|
||||||
"Enforce OAuth": "Зробити OAuth обов’язковим",
|
|
||||||
"AI assistants must connect with a Docmost account via OAuth. API keys cannot be used with the MCP server.": "AI-асистенти повинні підключатися до облікового запису Docmost через OAuth. Ключі API не можна використовувати з MCP-сервером.",
|
|
||||||
"Toggle enforce OAuth for MCP": "Увімкнути обов’язковий OAuth для MCP",
|
|
||||||
"Supported tools": "Підтримувані інструменти",
|
"Supported tools": "Підтримувані інструменти",
|
||||||
|
"Your workspace has MCP enabled. Use your API key to connect AI assistants.": "У вашому робочому просторі MCP увімкнено. Використайте свій API‑ключ, щоб підключити ШІ‑помічників.",
|
||||||
"MCP server URL:": "URL сервера MCP:",
|
"MCP server URL:": "URL сервера MCP:",
|
||||||
"Learn more": "Дізнатися більше",
|
"Learn more": "Дізнатися більше",
|
||||||
"Manage API keys for all users in the workspace. View the <anchor>API documentation</anchor> for usage details.": "Керуйте ключами API для всіх користувачів у робочому просторі. Перегляньте <anchor>документацію API</anchor> для деталей використання.",
|
"Manage API keys for all users in the workspace. View the <anchor>API documentation</anchor> for usage details.": "Керуйте ключами API для всіх користувачів у робочому просторі. Перегляньте <anchor>документацію API</anchor> для деталей використання.",
|
||||||
@@ -1294,48 +1289,5 @@
|
|||||||
"{{count}} rows deleted_one": "1 row deleted",
|
"{{count}} rows deleted_one": "1 row deleted",
|
||||||
"{{count}} rows deleted_other": "{{count}} rows deleted",
|
"{{count}} rows deleted_other": "{{count}} rows deleted",
|
||||||
"{{count}} selected_one": "1 selected",
|
"{{count}} selected_one": "1 selected",
|
||||||
"{{count}} selected_other": "{{count}} selected",
|
"{{count}} selected_other": "{{count}} selected"
|
||||||
"Compare": "Порівняти",
|
|
||||||
"Compare versions": "Порівняти версії",
|
|
||||||
"Select version from {{date}}": "Виберіть версію від {{date}}",
|
|
||||||
"Version actions for {{date}}": "Дії з версією від {{date}}",
|
|
||||||
"Comparing {{newer}} and {{older}}": "Порівняння {{newer}} і {{older}}",
|
|
||||||
"Exit compare": "Вийти з режиму порівняння",
|
|
||||||
"Search attachments...": "Пошук вкладень...",
|
|
||||||
"Error loading attachments.": "Помилка завантаження вкладень.",
|
|
||||||
"No attachments on this page yet.": "На цій сторінці ще немає вкладень.",
|
|
||||||
"Uploaded by {{name}}": "Завантажено користувачем {{name}}",
|
|
||||||
"Download {{name}}": "Завантажити {{name}}",
|
|
||||||
"Access revoked": "Доступ відкликано",
|
|
||||||
"Authorize application": "Авторизувати застосунок",
|
|
||||||
"{{name}} wants to access {{workspace}}": "{{name}} хоче отримати доступ до {{workspace}}",
|
|
||||||
"Not you? Switch account": "Не ви? Змінити обліковий запис",
|
|
||||||
"This application will be able to:": "Цей застосунок зможе:",
|
|
||||||
"Write": "Запис",
|
|
||||||
"Invalid authorization request": "Недійсний запит на авторизацію",
|
|
||||||
"Authorize": "Авторизувати",
|
|
||||||
"Application": "Застосунок",
|
|
||||||
"Permissions": "Дозволи",
|
|
||||||
"Authorized": "Авторизовано",
|
|
||||||
"Revoke access": "Відкликати доступ",
|
|
||||||
"Revoke access for {{name}}": "Відкликати доступ для {{name}}",
|
|
||||||
"Are you sure you want to revoke access for {{name}}? The application will no longer be able to access your account.": "Ви впевнені, що хочете відкликати доступ для {{name}}? Застосунок більше не зможе отримувати доступ до вашого облікового запису.",
|
|
||||||
"Something went wrong. Please try again.": "Щось пішло не так. Спробуйте ще раз.",
|
|
||||||
"Remove {{name}}": "Видалити {{name}}",
|
|
||||||
"Make sure you trust this application before authorizing it.": "Перш ніж авторизувати цей застосунок, переконайтеся, що ви йому довіряєте.",
|
|
||||||
"You will be redirected to": "Вас буде перенаправлено на",
|
|
||||||
"View content without making changes.": "Переглядати вміст без внесення змін.",
|
|
||||||
"Create and modify content.": "Створювати та змінювати вміст.",
|
|
||||||
"Applications and AI assistants you have authorized to access your account.": "Застосунки та AI-асистенти, яким ви надали дозвіл на доступ до свого облікового запису.",
|
|
||||||
"Your workspace has MCP enabled. Connect AI assistants with your Docmost account via OAuth.": "У вашому робочому просторі ввімкнено MCP. Підключайте AI-асистентів до свого облікового запису Docmost через OAuth.",
|
|
||||||
"Authorized apps": "Авторизовані застосунки",
|
|
||||||
"No authorized apps yet.": "Авторизованих застосунків ще немає.",
|
|
||||||
"Workspace knowledge only": "Лише знання робочого простору",
|
|
||||||
"Restrict AI Chat to answering from your workspace pages and uploaded files only. It will not use outside knowledge.": "Обмежити AI Chat відповідями лише на основі сторінок вашого робочого простору та завантажених файлів. Зовнішні знання не використовуватимуться.",
|
|
||||||
"Toggle workspace knowledge only": "Перемкнути режим лише знань робочого простору",
|
|
||||||
"Read-only mode": "Режим лише читання",
|
|
||||||
"AI Chat can search and read workspace content, but cannot create or edit pages.": "AI Chat може шукати та читати вміст робочого простору, але не може створювати або редагувати сторінки.",
|
|
||||||
"Toggle AI Chat read-only mode": "Перемкнути режим лише читання для AI Chat",
|
|
||||||
"Title only": "Лише заголовок",
|
|
||||||
"you": "ви"
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -294,7 +294,6 @@
|
|||||||
"Export space": "导出空间",
|
"Export space": "导出空间",
|
||||||
"Export {{type}}": "导出为 {{type}}",
|
"Export {{type}}": "导出为 {{type}}",
|
||||||
"File exceeds the {{limit}} attachment limit": "文件超出了 {{limit}} 类型附件限制",
|
"File exceeds the {{limit}} attachment limit": "文件超出了 {{limit}} 类型附件限制",
|
||||||
"Media": "媒体",
|
|
||||||
"Align left": "靠左对齐",
|
"Align left": "靠左对齐",
|
||||||
"Align right": "靠右对齐",
|
"Align right": "靠右对齐",
|
||||||
"Align center": "居中对齐",
|
"Align center": "居中对齐",
|
||||||
@@ -388,8 +387,6 @@
|
|||||||
"Insert horizontal rule divider": "插入水平分割线",
|
"Insert horizontal rule divider": "插入水平分割线",
|
||||||
"Page break": "分页符",
|
"Page break": "分页符",
|
||||||
"Insert a page break for printing.": "插入一个用于打印的分页符。",
|
"Insert a page break for printing.": "插入一个用于打印的分页符。",
|
||||||
"Footnote": "脚注",
|
|
||||||
"Insert a footnote reference.": "插入脚注引用。",
|
|
||||||
"Upload any image from your device.": "从设备上传任何图像",
|
"Upload any image from your device.": "从设备上传任何图像",
|
||||||
"Upload any video from your device.": "从设备上传任何视频",
|
"Upload any video from your device.": "从设备上传任何视频",
|
||||||
"Upload any audio from your device.": "从您的设备上传任意音频文件。",
|
"Upload any audio from your device.": "从您的设备上传任意音频文件。",
|
||||||
@@ -707,11 +704,9 @@
|
|||||||
"Enable the MCP server to allow AI assistants and tools to interact with your workspace content.": "启用 MCP 服务器以允许 AI 助手和工具与您的工作区内容交互。",
|
"Enable the MCP server to allow AI assistants and tools to interact with your workspace content.": "启用 MCP 服务器以允许 AI 助手和工具与您的工作区内容交互。",
|
||||||
"MCP is only available in the Docmost enterprise edition. Contact sales@docmost.com.": "MCP 仅在 Docmost 企业版中提供。请联系 sales@docmost.com。",
|
"MCP is only available in the Docmost enterprise edition. Contact sales@docmost.com.": "MCP 仅在 Docmost 企业版中提供。请联系 sales@docmost.com。",
|
||||||
"MCP Server URL": "MCP 服务器 URL",
|
"MCP Server URL": "MCP 服务器 URL",
|
||||||
"Connect AI assistants with your Docmost account via OAuth.": "通过 OAuth 将 AI 助手连接到你的 Docmost 账户。",
|
"Use your API key for authentication. You can manage API keys in your account settings.": "使用您的 API 密钥进行身份验证。您可以在账户设置中管理 API 密钥。",
|
||||||
"Enforce OAuth": "强制使用 OAuth",
|
|
||||||
"AI assistants must connect with a Docmost account via OAuth. API keys cannot be used with the MCP server.": "AI 助手必须通过 OAuth 使用 Docmost 账户连接。MCP 服务器不能使用 API 密钥。",
|
|
||||||
"Toggle enforce OAuth for MCP": "切换 MCP 的强制使用 OAuth 设置",
|
|
||||||
"Supported tools": "支持的工具",
|
"Supported tools": "支持的工具",
|
||||||
|
"Your workspace has MCP enabled. Use your API key to connect AI assistants.": "您的工作区已启用 MCP。使用您的 API 密钥连接 AI 助手。",
|
||||||
"MCP server URL:": "MCP 服务器 URL:",
|
"MCP server URL:": "MCP 服务器 URL:",
|
||||||
"Learn more": "了解更多",
|
"Learn more": "了解更多",
|
||||||
"Manage API keys for all users in the workspace. View the <anchor>API documentation</anchor> for usage details.": "为工作区内所有用户管理 API 密钥。有关使用详情,请查阅<anchor>API 文档</anchor>。",
|
"Manage API keys for all users in the workspace. View the <anchor>API documentation</anchor> for usage details.": "为工作区内所有用户管理 API 密钥。有关使用详情,请查阅<anchor>API 文档</anchor>。",
|
||||||
@@ -1294,48 +1289,5 @@
|
|||||||
"{{count}} rows deleted_one": "已删除 1 行",
|
"{{count}} rows deleted_one": "已删除 1 行",
|
||||||
"{{count}} rows deleted_other": "已删除 {{count}} 行",
|
"{{count}} rows deleted_other": "已删除 {{count}} 行",
|
||||||
"{{count}} selected_one": "已选择 1 项",
|
"{{count}} selected_one": "已选择 1 项",
|
||||||
"{{count}} selected_other": "已选择 {{count}} 项",
|
"{{count}} selected_other": "已选择 {{count}} 项"
|
||||||
"Compare": "比较",
|
|
||||||
"Compare versions": "比较版本",
|
|
||||||
"Select version from {{date}}": "选择 {{date}} 的版本",
|
|
||||||
"Version actions for {{date}}": "{{date}} 的版本操作",
|
|
||||||
"Comparing {{newer}} and {{older}}": "正在比较 {{newer}} 和 {{older}}",
|
|
||||||
"Exit compare": "退出比较",
|
|
||||||
"Search attachments...": "搜索附件……",
|
|
||||||
"Error loading attachments.": "加载附件时出错。",
|
|
||||||
"No attachments on this page yet.": "此页面上还没有附件。",
|
|
||||||
"Uploaded by {{name}}": "由 {{name}} 上传",
|
|
||||||
"Download {{name}}": "下载 {{name}}",
|
|
||||||
"Access revoked": "访问权限已撤销",
|
|
||||||
"Authorize application": "授权应用程序",
|
|
||||||
"{{name}} wants to access {{workspace}}": "{{name}} 想要访问 {{workspace}}",
|
|
||||||
"Not you? Switch account": "不是你?切换账户",
|
|
||||||
"This application will be able to:": "此应用程序将能够:",
|
|
||||||
"Write": "写入",
|
|
||||||
"Invalid authorization request": "无效的授权请求",
|
|
||||||
"Authorize": "授权",
|
|
||||||
"Application": "应用程序",
|
|
||||||
"Permissions": "权限",
|
|
||||||
"Authorized": "已授权",
|
|
||||||
"Revoke access": "撤销访问权限",
|
|
||||||
"Revoke access for {{name}}": "撤销 {{name}} 的访问权限",
|
|
||||||
"Are you sure you want to revoke access for {{name}}? The application will no longer be able to access your account.": "你确定要撤销 {{name}} 的访问权限吗?该应用程序将无法再访问你的账户。",
|
|
||||||
"Something went wrong. Please try again.": "出了点问题。请重试。",
|
|
||||||
"Remove {{name}}": "移除 {{name}}",
|
|
||||||
"Make sure you trust this application before authorizing it.": "在授权之前,请确保你信任此应用程序。",
|
|
||||||
"You will be redirected to": "你将被重定向到",
|
|
||||||
"View content without making changes.": "查看内容而不进行更改。",
|
|
||||||
"Create and modify content.": "创建和修改内容。",
|
|
||||||
"Applications and AI assistants you have authorized to access your account.": "你已授权访问你账户的应用程序和 AI 助手。",
|
|
||||||
"Your workspace has MCP enabled. Connect AI assistants with your Docmost account via OAuth.": "你的工作区已启用 MCP。通过 OAuth 将 AI 助手连接到你的 Docmost 账户。",
|
|
||||||
"Authorized apps": "已授权的应用",
|
|
||||||
"No authorized apps yet.": "尚无已授权的应用。",
|
|
||||||
"Workspace knowledge only": "仅限工作区知识",
|
|
||||||
"Restrict AI Chat to answering from your workspace pages and uploaded files only. It will not use outside knowledge.": "将 AI 聊天限制为仅根据你的工作区页面和已上传文件进行回答。它不会使用外部知识。",
|
|
||||||
"Toggle workspace knowledge only": "切换“仅限工作区知识”",
|
|
||||||
"Read-only mode": "只读模式",
|
|
||||||
"AI Chat can search and read workspace content, but cannot create or edit pages.": "AI 聊天可以搜索和读取工作区内容,但不能创建或编辑页面。",
|
|
||||||
"Toggle AI Chat read-only mode": "切换 AI 聊天只读模式",
|
|
||||||
"Title only": "仅标题",
|
|
||||||
"you": "你"
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,15 +44,6 @@ const ShareLayout = lazy(
|
|||||||
() => import("@/features/share/components/share-layout.tsx"),
|
() => import("@/features/share/components/share-layout.tsx"),
|
||||||
);
|
);
|
||||||
const ShareRedirect = lazy(() => import("@/pages/share/share-redirect.tsx"));
|
const ShareRedirect = lazy(() => import("@/pages/share/share-redirect.tsx"));
|
||||||
const PublicSpacePage = lazy(
|
|
||||||
() => import("@/pages/public-space/public-space-page.tsx"),
|
|
||||||
);
|
|
||||||
const PublicSpaceLayout = lazy(
|
|
||||||
() => import("@/features/public-space/components/public-space-layout.tsx"),
|
|
||||||
);
|
|
||||||
const PublicSpaceDirectoryPage = lazy(
|
|
||||||
() => import("@/pages/public-space/public-space-directory-page.tsx"),
|
|
||||||
);
|
|
||||||
const SpacesPage = lazy(() => import("@/pages/spaces/spaces.tsx"));
|
const SpacesPage = lazy(() => import("@/pages/spaces/spaces.tsx"));
|
||||||
const MfaChallengePage = lazy(() =>
|
const MfaChallengePage = lazy(() =>
|
||||||
import("@/ee/mfa/pages/mfa-challenge-page").then((m) => ({
|
import("@/ee/mfa/pages/mfa-challenge-page").then((m) => ({
|
||||||
@@ -128,15 +119,6 @@ export default function App() {
|
|||||||
<Route path={"/share/p/:pageSlug"} element={<SharedPage />} />
|
<Route path={"/share/p/:pageSlug"} element={<SharedPage />} />
|
||||||
</Route>
|
</Route>
|
||||||
|
|
||||||
<Route path={"/docs"} element={<PublicSpaceDirectoryPage />} />
|
|
||||||
<Route element={<PublicSpaceLayout />}>
|
|
||||||
<Route path={"/docs/:spaceSlug"} element={<PublicSpacePage />} />
|
|
||||||
<Route
|
|
||||||
path={"/docs/:spaceSlug/:pageSlug"}
|
|
||||||
element={<PublicSpacePage />}
|
|
||||||
/>
|
|
||||||
</Route>
|
|
||||||
|
|
||||||
<Route path={"/pdf-render/:pageId"} element={<PdfRenderPage />} />
|
<Route path={"/pdf-render/:pageId"} element={<PdfRenderPage />} />
|
||||||
<Route path={"/share/:shareId"} element={<ShareRedirect />} />
|
<Route path={"/share/:shareId"} element={<ShareRedirect />} />
|
||||||
<Route path={"/p/:pageSlug"} element={<PageRedirect />} />
|
<Route path={"/p/:pageSlug"} element={<PageRedirect />} />
|
||||||
@@ -184,11 +166,6 @@ export default function App() {
|
|||||||
<Route path={"ai"} element={<AiSettings />} />
|
<Route path={"ai"} element={<AiSettings />} />
|
||||||
<Route path={"ai/mcp"} element={<AiSettings />} />
|
<Route path={"ai/mcp"} element={<AiSettings />} />
|
||||||
<Route path={"audit"} element={<AuditLogs />} />
|
<Route path={"audit"} element={<AuditLogs />} />
|
||||||
<Route path={"audit/siem"} element={<AuditLogs />} />
|
|
||||||
<Route
|
|
||||||
path={"siem"}
|
|
||||||
element={<Navigate to="/settings/audit/siem" replace />}
|
|
||||||
/>
|
|
||||||
<Route path={"verifications"} element={<VerifiedPages />} />
|
<Route path={"verifications"} element={<VerifiedPages />} />
|
||||||
{!isCloud() && <Route path={"license"} element={<License />} />}
|
{!isCloud() && <Route path={"license"} element={<License />} />}
|
||||||
{isCloud() && <Route path={"billing"} element={<Billing />} />}
|
{isCloud() && <Route path={"billing"} element={<Billing />} />}
|
||||||
|
|||||||
@@ -118,7 +118,7 @@ const groupedData: DataGroup[] = [
|
|||||||
role: "admin",
|
role: "admin",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "Audit logs & SIEM",
|
label: "Audit log",
|
||||||
icon: IconHistory,
|
icon: IconHistory,
|
||||||
path: "/settings/audit",
|
path: "/settings/audit",
|
||||||
feature: Feature.AUDIT_LOGS,
|
feature: Feature.AUDIT_LOGS,
|
||||||
@@ -219,7 +219,7 @@ export default function SettingsSidebar() {
|
|||||||
case "API management":
|
case "API management":
|
||||||
prefetchHandler = prefetchApiKeyManagement;
|
prefetchHandler = prefetchApiKeyManagement;
|
||||||
break;
|
break;
|
||||||
case "Audit logs & SIEM":
|
case "Audit log":
|
||||||
prefetchHandler = prefetchAuditLogs;
|
prefetchHandler = prefetchAuditLogs;
|
||||||
break;
|
break;
|
||||||
case "Verified pages":
|
case "Verified pages":
|
||||||
|
|||||||
@@ -111,7 +111,7 @@ export default function McpSettings() {
|
|||||||
{t("Connect AI assistants with your Docmost account via OAuth.")}
|
{t("Connect AI assistants with your Docmost account via OAuth.")}
|
||||||
</Text>
|
</Text>
|
||||||
|
|
||||||
<McpEnforceOauthSetting />
|
<McpOauthOnlySetting />
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<Text size="sm" fw={500} mt="md" mb={4}>
|
<Text size="sm" fw={500} mt="md" mb={4}>
|
||||||
@@ -156,17 +156,17 @@ export default function McpSettings() {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function McpEnforceOauthSetting() {
|
function McpOauthOnlySetting() {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const [workspace, setWorkspace] = useAtom(workspaceAtom);
|
const [workspace, setWorkspace] = useAtom(workspaceAtom);
|
||||||
const [checked, setChecked] = useState(workspace?.settings?.ai?.enforceMcpOauth);
|
const [checked, setChecked] = useState(workspace?.settings?.ai?.mcpOauthOnly);
|
||||||
const hasAccess = useHasFeature(Feature.MCP_CONTROLS);
|
const hasAccess = useHasFeature(Feature.MCP_CONTROLS);
|
||||||
const upgradeLabel = useUpgradeLabel();
|
const upgradeLabel = useUpgradeLabel();
|
||||||
|
|
||||||
const handleChange = async (event: React.ChangeEvent<HTMLInputElement>) => {
|
const handleChange = async (event: React.ChangeEvent<HTMLInputElement>) => {
|
||||||
const value = event.currentTarget.checked;
|
const value = event.currentTarget.checked;
|
||||||
try {
|
try {
|
||||||
const updatedWorkspace = await updateWorkspace({ enforceMcpOauth: value });
|
const updatedWorkspace = await updateWorkspace({ mcpOauthOnly: value });
|
||||||
setChecked(value);
|
setChecked(value);
|
||||||
setWorkspace(updatedWorkspace);
|
setWorkspace(updatedWorkspace);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
@@ -182,7 +182,7 @@ function McpEnforceOauthSetting() {
|
|||||||
<div>
|
<div>
|
||||||
<Group gap="xs" align="center">
|
<Group gap="xs" align="center">
|
||||||
<Text size="sm" fw={500}>
|
<Text size="sm" fw={500}>
|
||||||
{t("Enforce OAuth")}
|
{t("Require OAuth")}
|
||||||
</Text>
|
</Text>
|
||||||
{!hasAccess && (
|
{!hasAccess && (
|
||||||
<Badge variant="light" size="sm" radius="sm">
|
<Badge variant="light" size="sm" radius="sm">
|
||||||
@@ -202,7 +202,7 @@ function McpEnforceOauthSetting() {
|
|||||||
defaultChecked={checked}
|
defaultChecked={checked}
|
||||||
onChange={handleChange}
|
onChange={handleChange}
|
||||||
disabled={!hasAccess}
|
disabled={!hasAccess}
|
||||||
aria-label={t("Toggle enforce OAuth for MCP")}
|
aria-label={t("Toggle require OAuth for MCP")}
|
||||||
/>
|
/>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
</Group>
|
</Group>
|
||||||
|
|||||||
@@ -22,7 +22,6 @@ export const auditEventLabels: Record<string, string> = {
|
|||||||
"user.role_changed": "Changed user role",
|
"user.role_changed": "Changed user role",
|
||||||
"user.password_changed": "Changed password",
|
"user.password_changed": "Changed password",
|
||||||
"user.password_reset": "Reset password",
|
"user.password_reset": "Reset password",
|
||||||
"user.password_reset_requested": "Requested password reset",
|
|
||||||
"user.updated": "Updated user",
|
"user.updated": "Updated user",
|
||||||
"user.deactivated": "Deactivated user",
|
"user.deactivated": "Deactivated user",
|
||||||
"user.activated": "Activated user",
|
"user.activated": "Activated user",
|
||||||
@@ -63,7 +62,6 @@ export const auditEventLabels: Record<string, string> = {
|
|||||||
"page.restriction_removed": "Removed page restriction",
|
"page.restriction_removed": "Removed page restriction",
|
||||||
"page.permission_added": "Added page permission",
|
"page.permission_added": "Added page permission",
|
||||||
"page.permission_removed": "Removed page permission",
|
"page.permission_removed": "Removed page permission",
|
||||||
"page.permission_role_changed": "Changed page permission",
|
|
||||||
"page.verification_created": "Created page verification",
|
"page.verification_created": "Created page verification",
|
||||||
"page.verification_updated": "Updated page verification",
|
"page.verification_updated": "Updated page verification",
|
||||||
"page.verification_removed": "Removed page verification",
|
"page.verification_removed": "Removed page verification",
|
||||||
@@ -81,13 +79,6 @@ export const auditEventLabels: Record<string, string> = {
|
|||||||
|
|
||||||
"license.activated": "Activated license",
|
"license.activated": "Activated license",
|
||||||
"license.removed": "Removed license",
|
"license.removed": "Removed license",
|
||||||
|
|
||||||
"siem_destination.created": "Created SIEM destination",
|
|
||||||
"siem_destination.updated": "Updated SIEM destination",
|
|
||||||
"siem_destination.deleted": "Deleted SIEM destination",
|
|
||||||
|
|
||||||
"template.created": "Created template",
|
|
||||||
"template.deleted": "Deleted template",
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export function getEventLabel(event: string): string {
|
export function getEventLabel(event: string): string {
|
||||||
@@ -114,10 +105,6 @@ export const eventFilterOptions: EventGroup[] = [
|
|||||||
{ value: "user.activated", label: "Activated user" },
|
{ value: "user.activated", label: "Activated user" },
|
||||||
{ value: "user.role_changed", label: "Changed user role" },
|
{ value: "user.role_changed", label: "Changed user role" },
|
||||||
{ value: "user.password_changed", label: "Changed password" },
|
{ value: "user.password_changed", label: "Changed password" },
|
||||||
{
|
|
||||||
value: "user.password_reset_requested",
|
|
||||||
label: "Requested password reset",
|
|
||||||
},
|
|
||||||
{ value: "user.mfa_enabled", label: "Enabled MFA" },
|
{ value: "user.mfa_enabled", label: "Enabled MFA" },
|
||||||
{ value: "user.mfa_disabled", label: "Disabled MFA" },
|
{ value: "user.mfa_disabled", label: "Disabled MFA" },
|
||||||
],
|
],
|
||||||
@@ -160,10 +147,6 @@ export const eventFilterOptions: EventGroup[] = [
|
|||||||
{ value: "page.restriction_removed", label: "Removed page restriction" },
|
{ value: "page.restriction_removed", label: "Removed page restriction" },
|
||||||
{ value: "page.permission_added", label: "Added page permission" },
|
{ value: "page.permission_added", label: "Added page permission" },
|
||||||
{ value: "page.permission_removed", label: "Removed page permission" },
|
{ value: "page.permission_removed", label: "Removed page permission" },
|
||||||
{
|
|
||||||
value: "page.permission_role_changed",
|
|
||||||
label: "Changed page permission",
|
|
||||||
},
|
|
||||||
{ value: "page.verification_created", label: "Created page verification" },
|
{ value: "page.verification_created", label: "Created page verification" },
|
||||||
{ value: "page.verification_updated", label: "Updated page verification" },
|
{ value: "page.verification_updated", label: "Updated page verification" },
|
||||||
{ value: "page.verification_removed", label: "Removed page verification" },
|
{ value: "page.verification_removed", label: "Removed page verification" },
|
||||||
@@ -210,19 +193,4 @@ export const eventFilterOptions: EventGroup[] = [
|
|||||||
{ value: "license.removed", label: "Removed license" },
|
{ value: "license.removed", label: "Removed license" },
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
|
||||||
group: "SIEM",
|
|
||||||
items: [
|
|
||||||
{ value: "siem_destination.created", label: "Created SIEM destination" },
|
|
||||||
{ value: "siem_destination.updated", label: "Updated SIEM destination" },
|
|
||||||
{ value: "siem_destination.deleted", label: "Deleted SIEM destination" },
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
group: "Template",
|
|
||||||
items: [
|
|
||||||
{ value: "template.created", label: "Created template" },
|
|
||||||
{ value: "template.deleted", label: "Deleted template" },
|
|
||||||
],
|
|
||||||
},
|
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -7,12 +7,10 @@ import {
|
|||||||
Popover,
|
Popover,
|
||||||
Select,
|
Select,
|
||||||
Space,
|
Space,
|
||||||
Tabs,
|
|
||||||
Text,
|
Text,
|
||||||
Tooltip,
|
Tooltip,
|
||||||
} from "@mantine/core";
|
} from "@mantine/core";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { useLocation, useNavigate } from "react-router-dom";
|
|
||||||
import { IconSettings } from "@tabler/icons-react";
|
import { IconSettings } from "@tabler/icons-react";
|
||||||
import SettingsTitle from "@/components/settings/settings-title";
|
import SettingsTitle from "@/components/settings/settings-title";
|
||||||
import Paginate from "@/components/common/paginate";
|
import Paginate from "@/components/common/paginate";
|
||||||
@@ -25,7 +23,6 @@ import {
|
|||||||
import { IAuditLogParams } from "@/ee/audit/types/audit.types";
|
import { IAuditLogParams } from "@/ee/audit/types/audit.types";
|
||||||
import { eventFilterOptions } from "@/ee/audit/lib/audit-event-labels";
|
import { eventFilterOptions } from "@/ee/audit/lib/audit-event-labels";
|
||||||
import AuditLogsTable from "@/ee/audit/components/audit-logs-table";
|
import AuditLogsTable from "@/ee/audit/components/audit-logs-table";
|
||||||
import SiemStreamingPanel from "@/ee/siem/components/siem-streaming-panel";
|
|
||||||
import useUserRole from "@/hooks/use-user-role";
|
import useUserRole from "@/hooks/use-user-role";
|
||||||
import { DocumentTitle } from "@/components/ui/document-title.tsx";
|
import { DocumentTitle } from "@/components/ui/document-title.tsx";
|
||||||
|
|
||||||
@@ -51,8 +48,6 @@ export default function AuditLogs() {
|
|||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const { isOwner } = useUserRole();
|
const { isOwner } = useUserRole();
|
||||||
const { cursor, goNext, goPrev, resetCursor } = useCursorPaginate();
|
const { cursor, goNext, goPrev, resetCursor } = useCursorPaginate();
|
||||||
const location = useLocation();
|
|
||||||
const navigate = useNavigate();
|
|
||||||
|
|
||||||
const [eventFilter, setEventFilter] = useState<string | null>(null);
|
const [eventFilter, setEventFilter] = useState<string | null>(null);
|
||||||
const [settingsOpen, setSettingsOpen] = useState(false);
|
const [settingsOpen, setSettingsOpen] = useState(false);
|
||||||
@@ -90,8 +85,6 @@ export default function AuditLogs() {
|
|||||||
|
|
||||||
const { data, isLoading } = useAuditLogsQuery(params);
|
const { data, isLoading } = useAuditLogsQuery(params);
|
||||||
|
|
||||||
const activeTab = location.pathname.endsWith("/siem") ? "siem" : "audit";
|
|
||||||
|
|
||||||
if (!isOwner) {
|
if (!isOwner) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -101,31 +94,12 @@ export default function AuditLogs() {
|
|||||||
resetCursor();
|
resetCursor();
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleTabChange = (value: string | null) => {
|
|
||||||
if (value === "siem") {
|
|
||||||
navigate("/settings/audit/siem");
|
|
||||||
} else {
|
|
||||||
navigate("/settings/audit");
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<DocumentTitle title={t("Audit logs & SIEM")} />
|
<DocumentTitle title={t("Audit log")} />
|
||||||
|
|
||||||
<SettingsTitle title={t("Audit logs & SIEM")} />
|
<SettingsTitle title={t("Audit log")} />
|
||||||
|
|
||||||
<Tabs color="dark" value={activeTab} onChange={handleTabChange}>
|
|
||||||
<Tabs.List>
|
|
||||||
<Tabs.Tab fw={500} value="audit">
|
|
||||||
{t("Audit logs")}
|
|
||||||
</Tabs.Tab>
|
|
||||||
<Tabs.Tab fw={500} value="siem">
|
|
||||||
{t("SIEM")}
|
|
||||||
</Tabs.Tab>
|
|
||||||
</Tabs.List>
|
|
||||||
|
|
||||||
<Tabs.Panel value="audit" pt="md">
|
|
||||||
<Group mb="md" gap="sm">
|
<Group mb="md" gap="sm">
|
||||||
<Select
|
<Select
|
||||||
placeholder={t("Filter by event")}
|
placeholder={t("Filter by event")}
|
||||||
@@ -239,12 +213,6 @@ export default function AuditLogs() {
|
|||||||
onPrev={goPrev}
|
onPrev={goPrev}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</Tabs.Panel>
|
|
||||||
|
|
||||||
<Tabs.Panel value="siem" pt="md">
|
|
||||||
<SiemStreamingPanel />
|
|
||||||
</Tabs.Panel>
|
|
||||||
</Tabs>
|
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,7 +18,6 @@ export type FieldProps = {
|
|||||||
rowId: string;
|
rowId: string;
|
||||||
readOnly: boolean;
|
readOnly: boolean;
|
||||||
onChange: (value: unknown) => void;
|
onChange: (value: unknown) => void;
|
||||||
onEditingChange?: (editing: boolean) => void;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
type FieldShellProps = {
|
type FieldShellProps = {
|
||||||
@@ -100,10 +99,9 @@ type DetailFieldProps = {
|
|||||||
row: IBaseRow;
|
row: IBaseRow;
|
||||||
readOnly: boolean;
|
readOnly: boolean;
|
||||||
onUpdate: (propertyId: string, value: unknown) => void;
|
onUpdate: (propertyId: string, value: unknown) => void;
|
||||||
onEditingChange: (editing: boolean) => void;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export function DetailField({ property, row, readOnly, onUpdate, onEditingChange }: DetailFieldProps) {
|
export function DetailField({ property, row, readOnly, onUpdate }: DetailFieldProps) {
|
||||||
const descriptor = getDescriptor(property.type);
|
const descriptor = getDescriptor(property.type);
|
||||||
const value = descriptor?.systemAccessor
|
const value = descriptor?.systemAccessor
|
||||||
? descriptor.systemAccessor(row)
|
? descriptor.systemAccessor(row)
|
||||||
@@ -114,7 +112,6 @@ export function DetailField({ property, row, readOnly, onUpdate, onEditingChange
|
|||||||
rowId: row.id,
|
rowId: row.id,
|
||||||
readOnly,
|
readOnly,
|
||||||
onChange: (next: unknown) => onUpdate(property.id, next),
|
onChange: (next: unknown) => onUpdate(property.id, next),
|
||||||
onEditingChange
|
|
||||||
};
|
};
|
||||||
|
|
||||||
switch (property.type) {
|
switch (property.type) {
|
||||||
|
|||||||
@@ -9,13 +9,7 @@ const normalize = (s: string) => {
|
|||||||
return trimmed.length ? trimmed : null;
|
return trimmed.length ? trimmed : null;
|
||||||
};
|
};
|
||||||
|
|
||||||
export function FieldLongText({
|
export function FieldLongText({ property, value, readOnly, onChange }: FieldProps) {
|
||||||
property,
|
|
||||||
value,
|
|
||||||
readOnly,
|
|
||||||
onChange,
|
|
||||||
onEditingChange,
|
|
||||||
}: FieldProps) {
|
|
||||||
const text = toText(value);
|
const text = toText(value);
|
||||||
const [draft, setDraft] = useState(text);
|
const [draft, setDraft] = useState(text);
|
||||||
const [focused, setFocused] = useState(false);
|
const [focused, setFocused] = useState(false);
|
||||||
@@ -29,7 +23,6 @@ export function FieldLongText({
|
|||||||
|
|
||||||
const commit = () => {
|
const commit = () => {
|
||||||
setFocused(false);
|
setFocused(false);
|
||||||
onEditingChange?.(false);
|
|
||||||
if (cancelRef.current) {
|
if (cancelRef.current) {
|
||||||
cancelRef.current = false;
|
cancelRef.current = false;
|
||||||
setDraft(text);
|
setDraft(text);
|
||||||
@@ -57,10 +50,7 @@ export function FieldLongText({
|
|||||||
className={classes.fieldTextarea}
|
className={classes.fieldTextarea}
|
||||||
classNames={{ input: classes.fieldTextareaInput }}
|
classNames={{ input: classes.fieldTextareaInput }}
|
||||||
value={draft}
|
value={draft}
|
||||||
onFocus={() => {
|
onFocus={() => setFocused(true)}
|
||||||
setFocused(true);
|
|
||||||
onEditingChange?.(true);
|
|
||||||
}}
|
|
||||||
onChange={(e) => setDraft(e.currentTarget.value)}
|
onChange={(e) => setDraft(e.currentTarget.value)}
|
||||||
onBlur={commit}
|
onBlur={commit}
|
||||||
onKeyDown={(e) => {
|
onKeyDown={(e) => {
|
||||||
|
|||||||
@@ -11,13 +11,7 @@ import classes from "@/ee/base/styles/row-detail-modal.module.css";
|
|||||||
const toDraft = (value: unknown) =>
|
const toDraft = (value: unknown) =>
|
||||||
typeof value === "number" ? String(value) : "";
|
typeof value === "number" ? String(value) : "";
|
||||||
|
|
||||||
export function FieldNumber({
|
export function FieldNumber({ property, value, readOnly, onChange }: FieldProps) {
|
||||||
property,
|
|
||||||
value,
|
|
||||||
readOnly,
|
|
||||||
onChange,
|
|
||||||
onEditingChange,
|
|
||||||
}: FieldProps) {
|
|
||||||
const typeOptions = property.typeOptions as NumberTypeOptions | undefined;
|
const typeOptions = property.typeOptions as NumberTypeOptions | undefined;
|
||||||
const numValue = typeof value === "number" ? value : null;
|
const numValue = typeof value === "number" ? value : null;
|
||||||
const [draft, setDraft] = useState(toDraft(value));
|
const [draft, setDraft] = useState(toDraft(value));
|
||||||
@@ -42,7 +36,6 @@ export function FieldNumber({
|
|||||||
|
|
||||||
const commit = () => {
|
const commit = () => {
|
||||||
setFocused(false);
|
setFocused(false);
|
||||||
onEditingChange?.(false);
|
|
||||||
if (cancelRef.current) {
|
if (cancelRef.current) {
|
||||||
cancelRef.current = false;
|
cancelRef.current = false;
|
||||||
setDraft(toDraft(value));
|
setDraft(toDraft(value));
|
||||||
@@ -61,7 +54,6 @@ export function FieldNumber({
|
|||||||
onFocus={() => {
|
onFocus={() => {
|
||||||
setDraft(toDraft(value));
|
setDraft(toDraft(value));
|
||||||
setFocused(true);
|
setFocused(true);
|
||||||
onEditingChange?.(true);
|
|
||||||
}}
|
}}
|
||||||
onChange={(e) => {
|
onChange={(e) => {
|
||||||
const v = e.target.value;
|
const v = e.target.value;
|
||||||
|
|||||||
@@ -5,13 +5,7 @@ import classes from "@/ee/base/styles/row-detail-modal.module.css";
|
|||||||
|
|
||||||
const toText = (value: unknown) => (typeof value === "string" ? value : "");
|
const toText = (value: unknown) => (typeof value === "string" ? value : "");
|
||||||
|
|
||||||
export function FieldText({
|
export function FieldText({ property, value, readOnly, onChange }: FieldProps) {
|
||||||
property,
|
|
||||||
value,
|
|
||||||
readOnly,
|
|
||||||
onChange,
|
|
||||||
onEditingChange,
|
|
||||||
}: FieldProps) {
|
|
||||||
const text = toText(value);
|
const text = toText(value);
|
||||||
const [draft, setDraft] = useState(text);
|
const [draft, setDraft] = useState(text);
|
||||||
const [focused, setFocused] = useState(false);
|
const [focused, setFocused] = useState(false);
|
||||||
@@ -26,7 +20,6 @@ export function FieldText({
|
|||||||
|
|
||||||
const commit = () => {
|
const commit = () => {
|
||||||
setFocused(false);
|
setFocused(false);
|
||||||
onEditingChange?.(false);
|
|
||||||
if (cancelRef.current) {
|
if (cancelRef.current) {
|
||||||
cancelRef.current = false;
|
cancelRef.current = false;
|
||||||
setDraft(text);
|
setDraft(text);
|
||||||
@@ -61,10 +54,7 @@ export function FieldText({
|
|||||||
className={classes.fieldInput}
|
className={classes.fieldInput}
|
||||||
value={draft}
|
value={draft}
|
||||||
maxLength={1000}
|
maxLength={1000}
|
||||||
onFocus={() => {
|
onFocus={() => setFocused(true)}
|
||||||
setFocused(true);
|
|
||||||
onEditingChange?.(true);
|
|
||||||
}}
|
|
||||||
onChange={(e) => setDraft(e.currentTarget.value)}
|
onChange={(e) => setDraft(e.currentTarget.value)}
|
||||||
onBlur={commit}
|
onBlur={commit}
|
||||||
onKeyDown={(e) => {
|
onKeyDown={(e) => {
|
||||||
|
|||||||
@@ -17,7 +17,6 @@ type PropertyRowProps = {
|
|||||||
onMenuOpenChange: (opened: boolean) => void;
|
onMenuOpenChange: (opened: boolean) => void;
|
||||||
onMenuDirtyChange: (dirty: boolean) => void;
|
onMenuDirtyChange: (dirty: boolean) => void;
|
||||||
onUpdate: (propertyId: string, value: unknown) => void;
|
onUpdate: (propertyId: string, value: unknown) => void;
|
||||||
onEditingChange?: (editing: boolean) => void;
|
|
||||||
autoFocusValue?: boolean;
|
autoFocusValue?: boolean;
|
||||||
onAutoFocused?: () => void;
|
onAutoFocused?: () => void;
|
||||||
};
|
};
|
||||||
@@ -30,7 +29,6 @@ export function PropertyRow({
|
|||||||
onMenuOpenChange,
|
onMenuOpenChange,
|
||||||
onMenuDirtyChange,
|
onMenuDirtyChange,
|
||||||
onUpdate,
|
onUpdate,
|
||||||
onEditingChange,
|
|
||||||
autoFocusValue,
|
autoFocusValue,
|
||||||
onAutoFocused,
|
onAutoFocused,
|
||||||
}: PropertyRowProps) {
|
}: PropertyRowProps) {
|
||||||
@@ -114,7 +112,6 @@ export function PropertyRow({
|
|||||||
row={row}
|
row={row}
|
||||||
readOnly={!canEdit}
|
readOnly={!canEdit}
|
||||||
onUpdate={onUpdate}
|
onUpdate={onUpdate}
|
||||||
onEditingChange={onEditingChange}
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -75,7 +75,6 @@ export function RowDetailModal({
|
|||||||
|
|
||||||
const isSaving = updateRowMutation.isPending;
|
const isSaving = updateRowMutation.isPending;
|
||||||
const opened = !!openRowId;
|
const opened = !!openRowId;
|
||||||
const [editingField, setEditingField] = useState(false);
|
|
||||||
|
|
||||||
// One field menu open at a time, mirroring the grid header's semantics.
|
// One field menu open at a time, mirroring the grid header's semantics.
|
||||||
// The shared closeRequest atom asks an open dirty PropertyMenuContent to
|
// The shared closeRequest atom asks an open dirty PropertyMenuContent to
|
||||||
@@ -91,7 +90,6 @@ export function RowDetailModal({
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setOpenMenuId(null);
|
setOpenMenuId(null);
|
||||||
menuDirtyRef.current = false;
|
menuDirtyRef.current = false;
|
||||||
setEditingField(false);
|
|
||||||
}, [openRowId]);
|
}, [openRowId]);
|
||||||
|
|
||||||
const handleMenuDirtyChange = useCallback((dirty: boolean) => {
|
const handleMenuDirtyChange = useCallback((dirty: boolean) => {
|
||||||
@@ -295,7 +293,7 @@ export function RowDetailModal({
|
|||||||
row={row}
|
row={row}
|
||||||
primaryProperty={primaryProperty}
|
primaryProperty={primaryProperty}
|
||||||
canEdit={canEdit}
|
canEdit={canEdit}
|
||||||
onEditingChange={setEditingField}
|
onClose={onClose}
|
||||||
onCommit={(value) => {
|
onCommit={(value) => {
|
||||||
if (!primaryProperty) return;
|
if (!primaryProperty) return;
|
||||||
updateRowMutation.mutate({
|
updateRowMutation.mutate({
|
||||||
@@ -319,7 +317,6 @@ export function RowDetailModal({
|
|||||||
autoFocusValue={property.id === newPropertyId}
|
autoFocusValue={property.id === newPropertyId}
|
||||||
onAutoFocused={clearNewProperty}
|
onAutoFocused={clearNewProperty}
|
||||||
menuOpened={openMenuId === property.id}
|
menuOpened={openMenuId === property.id}
|
||||||
onEditingChange={setEditingField}
|
|
||||||
onMenuOpenChange={(nextOpened) =>
|
onMenuOpenChange={(nextOpened) =>
|
||||||
handleMenuOpenChange(property.id, nextOpened)
|
handleMenuOpenChange(property.id, nextOpened)
|
||||||
}
|
}
|
||||||
@@ -370,24 +367,6 @@ export function RowDetailModal({
|
|||||||
) : null}
|
) : null}
|
||||||
</div>
|
</div>
|
||||||
<div className={classes.kbdHint}>
|
<div className={classes.kbdHint}>
|
||||||
{editingField ? (
|
|
||||||
<>
|
|
||||||
<span className={classes.kbdGroup}>
|
|
||||||
<kbd className={classes.kbd}>Ctrl/Cmd</kbd>
|
|
||||||
<span className={classes.kbdPlus} >+</span>
|
|
||||||
<kbd className={classes.kbd}>Enter</kbd>
|
|
||||||
<span>{t("to save")}</span>
|
|
||||||
</span>
|
|
||||||
|
|
||||||
<span className={classes.kbdSeparator} />
|
|
||||||
|
|
||||||
<span className={classes.kbdGroup}>
|
|
||||||
<kbd className={classes.kbd}>Esc</kbd>
|
|
||||||
<span>{t("to reset")}</span>
|
|
||||||
</span>
|
|
||||||
</>
|
|
||||||
) : (
|
|
||||||
<>
|
|
||||||
{rowIndex >= 0 && rows.length > 1 && (
|
{rowIndex >= 0 && rows.length > 1 && (
|
||||||
<>
|
<>
|
||||||
<kbd className={classes.kbd}>↑</kbd>
|
<kbd className={classes.kbd}>↑</kbd>
|
||||||
@@ -396,12 +375,8 @@ export function RowDetailModal({
|
|||||||
<span className={classes.kbdSeparator} />
|
<span className={classes.kbdSeparator} />
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
<>
|
|
||||||
<kbd className={classes.kbd}>Esc</kbd>
|
<kbd className={classes.kbd}>Esc</kbd>
|
||||||
<span>{t("to close")}</span>
|
<span>{t("to close")}</span>
|
||||||
</>
|
|
||||||
</>
|
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
</>
|
</>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { useEffect, useRef, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { IBaseProperty, IBaseRow } from "@/ee/base/types/base.types";
|
import { IBaseProperty, IBaseRow } from "@/ee/base/types/base.types";
|
||||||
import { timeAgo } from "@/lib/time.ts";
|
import { timeAgo } from "@/lib/time.ts";
|
||||||
@@ -9,7 +9,7 @@ type RowDetailTitleProps = {
|
|||||||
primaryProperty: IBaseProperty | undefined;
|
primaryProperty: IBaseProperty | undefined;
|
||||||
canEdit: boolean;
|
canEdit: boolean;
|
||||||
onCommit: (value: string) => void;
|
onCommit: (value: string) => void;
|
||||||
onEditingChange?: (editing: boolean) => void;
|
onClose: () => void;
|
||||||
};
|
};
|
||||||
|
|
||||||
export function RowDetailTitle({
|
export function RowDetailTitle({
|
||||||
@@ -17,24 +17,13 @@ export function RowDetailTitle({
|
|||||||
primaryProperty,
|
primaryProperty,
|
||||||
canEdit,
|
canEdit,
|
||||||
onCommit,
|
onCommit,
|
||||||
onEditingChange,
|
onClose,
|
||||||
}: RowDetailTitleProps) {
|
}: RowDetailTitleProps) {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const initial = primaryProperty
|
const initial = primaryProperty
|
||||||
? (((row.cells ?? {})[primaryProperty.id] as string) ?? "")
|
? (((row.cells ?? {})[primaryProperty.id] as string) ?? "")
|
||||||
: "";
|
: "";
|
||||||
const [value, setValue] = useState(initial);
|
const [value, setValue] = useState(initial);
|
||||||
const cancelRef = useRef(false);
|
|
||||||
|
|
||||||
const commit = () => {
|
|
||||||
onEditingChange?.(false);
|
|
||||||
if (cancelRef.current) {
|
|
||||||
cancelRef.current = false;
|
|
||||||
setValue(initial);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (value !== initial) onCommit(value);
|
|
||||||
};
|
|
||||||
|
|
||||||
// Re-sync when the row changes underneath us (navigation or remote edit).
|
// Re-sync when the row changes underneath us (navigation or remote edit).
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@@ -54,18 +43,18 @@ export function RowDetailTitle({
|
|||||||
aria-label={primaryProperty?.name ?? t("Untitled")}
|
aria-label={primaryProperty?.name ?? t("Untitled")}
|
||||||
value={value}
|
value={value}
|
||||||
maxLength={1000}
|
maxLength={1000}
|
||||||
onFocus={() => {
|
|
||||||
onEditingChange?.(true);
|
|
||||||
}}
|
|
||||||
onChange={(e) => setValue(e.currentTarget.value)}
|
onChange={(e) => setValue(e.currentTarget.value)}
|
||||||
onBlur={commit}
|
onBlur={() => {
|
||||||
|
if (value !== initial) onCommit(value);
|
||||||
|
}}
|
||||||
onKeyDown={(e) => {
|
onKeyDown={(e) => {
|
||||||
if (e.key === "Escape") {
|
if (e.key === "Enter") {
|
||||||
cancelRef.current = true;
|
|
||||||
e.currentTarget.blur();
|
|
||||||
} else if (e.key === "Enter") {
|
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
e.currentTarget.blur();
|
(e.currentTarget as HTMLInputElement).blur();
|
||||||
|
} else if (e.key === "Escape") {
|
||||||
|
e.preventDefault();
|
||||||
|
(e.currentTarget as HTMLInputElement).blur();
|
||||||
|
onClose();
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -416,25 +416,9 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.kbdHint {
|
.kbdHint {
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: flex-end;
|
|
||||||
gap: 10px;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.kbdGroup {
|
|
||||||
display: inline-flex;
|
display: inline-flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 6px;
|
gap: 6px;
|
||||||
white-space: nowrap;
|
|
||||||
height: fit-content;
|
|
||||||
}
|
|
||||||
|
|
||||||
.kbdPlus {
|
|
||||||
color: light-dark(var(--mantine-color-gray-5), var(--mantine-color-dark-3));
|
|
||||||
font-size: 11px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.kbdSeparator {
|
.kbdSeparator {
|
||||||
|
|||||||
@@ -25,6 +25,4 @@ export const Feature = {
|
|||||||
OAUTH: 'oauth',
|
OAUTH: 'oauth',
|
||||||
AI_CONTROLS: 'ai:controls',
|
AI_CONTROLS: 'ai:controls',
|
||||||
MCP_CONTROLS: 'mcp:controls',
|
MCP_CONTROLS: 'mcp:controls',
|
||||||
PUBLIC_SPACE_APPEARANCE: 'public-space:appearance',
|
|
||||||
SIEM: 'siem',
|
|
||||||
} as const;
|
} as const;
|
||||||
|
|||||||
@@ -82,7 +82,6 @@ export default function SpacePublicSharingToggle({
|
|||||||
checked={checked}
|
checked={checked}
|
||||||
onChange={handleChange}
|
onChange={handleChange}
|
||||||
disabled={isDisabled}
|
disabled={isDisabled}
|
||||||
size={"xs"}
|
|
||||||
aria-label={t("Toggle space public sharing")}
|
aria-label={t("Toggle space public sharing")}
|
||||||
/>
|
/>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
|
|||||||
@@ -53,7 +53,6 @@ export default function SpaceViewerCommentsToggle({
|
|||||||
checked={checked}
|
checked={checked}
|
||||||
onChange={handleChange}
|
onChange={handleChange}
|
||||||
disabled={isDisabled}
|
disabled={isDisabled}
|
||||||
size={"xs"}
|
|
||||||
aria-label={t("Toggle viewer comments")}
|
aria-label={t("Toggle viewer comments")}
|
||||||
/>
|
/>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
|
|||||||
@@ -1,44 +0,0 @@
|
|||||||
import { Button, Group, Modal, Stack, Text } from "@mantine/core";
|
|
||||||
import { useTranslation } from "react-i18next";
|
|
||||||
import { ISiemDestination } from "@/ee/siem/types/siem.types";
|
|
||||||
import { useDeleteSiemDestinationMutation } from "@/ee/siem/queries/siem-query";
|
|
||||||
|
|
||||||
interface DeleteDestinationModalProps {
|
|
||||||
opened: boolean;
|
|
||||||
onClose: () => void;
|
|
||||||
destination: ISiemDestination | null;
|
|
||||||
}
|
|
||||||
|
|
||||||
export function DeleteDestinationModal({ opened, onClose, destination }: DeleteDestinationModalProps) {
|
|
||||||
const { t } = useTranslation();
|
|
||||||
const deleteMutation = useDeleteSiemDestinationMutation();
|
|
||||||
|
|
||||||
const handleDelete = async () => {
|
|
||||||
if (!destination) return;
|
|
||||||
await deleteMutation.mutateAsync({ destinationId: destination.id });
|
|
||||||
onClose();
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Modal
|
|
||||||
opened={opened}
|
|
||||||
onClose={onClose}
|
|
||||||
title={t("Delete destination")}
|
|
||||||
size="md"
|
|
||||||
closeButtonProps={{ "aria-label": t("Close") }}
|
|
||||||
>
|
|
||||||
<Stack gap="md">
|
|
||||||
<Text>
|
|
||||||
{t("Are you sure you want to delete the destination")}{" "}
|
|
||||||
<strong>{destination?.name}</strong>?
|
|
||||||
</Text>
|
|
||||||
<Group justify="flex-end" mt="md">
|
|
||||||
<Button variant="default" onClick={onClose}>{t("Cancel")}</Button>
|
|
||||||
<Button color="red" onClick={handleDelete} loading={deleteMutation.isPending}>
|
|
||||||
{t("Delete")}
|
|
||||||
</Button>
|
|
||||||
</Group>
|
|
||||||
</Stack>
|
|
||||||
</Modal>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,300 +0,0 @@
|
|||||||
import { useEffect, useState } from "react";
|
|
||||||
import {
|
|
||||||
Alert,
|
|
||||||
Button,
|
|
||||||
Collapse,
|
|
||||||
Group,
|
|
||||||
Modal,
|
|
||||||
PasswordInput,
|
|
||||||
Select,
|
|
||||||
Stack,
|
|
||||||
Switch,
|
|
||||||
Text,
|
|
||||||
TextInput,
|
|
||||||
} from "@mantine/core";
|
|
||||||
import { useForm } from "@mantine/form";
|
|
||||||
import { IconAlertCircle, IconCheck } from "@tabler/icons-react";
|
|
||||||
import { useTranslation } from "react-i18next";
|
|
||||||
import { isCloud } from "@/lib/config.ts";
|
|
||||||
import { DATADOG_SITES, ISiemDestination, ISiemTestResult } from "@/ee/siem/types/siem.types";
|
|
||||||
import {
|
|
||||||
useCreateSiemDestinationMutation,
|
|
||||||
useTestSiemDestinationMutation,
|
|
||||||
useUpdateSiemDestinationMutation,
|
|
||||||
} from "@/ee/siem/queries/siem-query";
|
|
||||||
import {
|
|
||||||
DestinationFormValues,
|
|
||||||
initialValues,
|
|
||||||
toPayload,
|
|
||||||
validateForm,
|
|
||||||
} from "@/ee/siem/lib/destination-form";
|
|
||||||
import { DESTINATION_TYPE_LABELS } from "./destination-table";
|
|
||||||
|
|
||||||
interface DestinationFormModalProps {
|
|
||||||
opened: boolean;
|
|
||||||
onClose: () => void;
|
|
||||||
destination?: ISiemDestination | null;
|
|
||||||
}
|
|
||||||
|
|
||||||
function connectionKey(values: DestinationFormValues): string {
|
|
||||||
const { type, config, secrets } = toPayload(values);
|
|
||||||
return JSON.stringify({ type, config, secrets });
|
|
||||||
}
|
|
||||||
|
|
||||||
export function DestinationFormModal({ opened, onClose, destination }: DestinationFormModalProps) {
|
|
||||||
const { t } = useTranslation();
|
|
||||||
const isEdit = Boolean(destination);
|
|
||||||
const hasSecrets = destination?.hasSecrets ?? {};
|
|
||||||
const [advancedOpen, setAdvancedOpen] = useState(false);
|
|
||||||
const [testState, setTestState] = useState<{ result: ISiemTestResult | null; testedPayloadKey: string | null }>({
|
|
||||||
result: null,
|
|
||||||
testedPayloadKey: null,
|
|
||||||
});
|
|
||||||
const createMutation = useCreateSiemDestinationMutation();
|
|
||||||
const updateMutation = useUpdateSiemDestinationMutation();
|
|
||||||
const testMutation = useTestSiemDestinationMutation();
|
|
||||||
|
|
||||||
const form = useForm<DestinationFormValues>({
|
|
||||||
initialValues: initialValues(destination),
|
|
||||||
validate: (values) => validateForm(values, hasSecrets),
|
|
||||||
});
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
if (opened) {
|
|
||||||
form.setValues(initialValues(destination));
|
|
||||||
form.resetDirty();
|
|
||||||
// eslint-disable-next-line react-hooks/set-state-in-effect
|
|
||||||
setTestState({ result: null, testedPayloadKey: null });
|
|
||||||
setAdvancedOpen(false);
|
|
||||||
}
|
|
||||||
}, [opened, destination?.id]);
|
|
||||||
|
|
||||||
const handleSubmit = async (values: DestinationFormValues) => {
|
|
||||||
const payload = toPayload(values);
|
|
||||||
try {
|
|
||||||
if (destination) {
|
|
||||||
await updateMutation.mutateAsync({
|
|
||||||
destinationId: destination.id,
|
|
||||||
name: payload.name,
|
|
||||||
config: payload.config,
|
|
||||||
secrets: payload.secrets,
|
|
||||||
enabled: payload.enabled,
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
await createMutation.mutateAsync(payload);
|
|
||||||
}
|
|
||||||
onClose();
|
|
||||||
} catch {}
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleTest = async () => {
|
|
||||||
if (form.validate().hasErrors) return;
|
|
||||||
const payload = toPayload(form.values);
|
|
||||||
const testedPayloadKey = connectionKey(form.values);
|
|
||||||
setTestState((prev) => ({ ...prev, testedPayloadKey }));
|
|
||||||
try {
|
|
||||||
const result = await testMutation.mutateAsync({
|
|
||||||
type: payload.type,
|
|
||||||
config: payload.config,
|
|
||||||
secrets: payload.secrets,
|
|
||||||
destinationId: destination?.id,
|
|
||||||
});
|
|
||||||
setTestState({ result, testedPayloadKey });
|
|
||||||
} catch {
|
|
||||||
setTestState({ result: null, testedPayloadKey });
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const type = form.values.type;
|
|
||||||
const showTls = type !== "datadog";
|
|
||||||
const currentPayloadKey = connectionKey(form.values);
|
|
||||||
const showTestResult = testState.result !== null && testState.testedPayloadKey === currentPayloadKey;
|
|
||||||
const connectionChanged = currentPayloadKey !== connectionKey(initialValues(destination));
|
|
||||||
const testPassed = showTestResult && testState.result.delivered;
|
|
||||||
const requiresTest = (!isEdit || connectionChanged) && !testPassed;
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Modal
|
|
||||||
opened={opened}
|
|
||||||
onClose={onClose}
|
|
||||||
title={isEdit ? t("Edit destination") : t("Add destination")}
|
|
||||||
size="lg"
|
|
||||||
closeButtonProps={{ "aria-label": t("Close") }}
|
|
||||||
>
|
|
||||||
<form onSubmit={form.onSubmit(handleSubmit)}>
|
|
||||||
<Stack gap="md">
|
|
||||||
<Select
|
|
||||||
label={t("Preset")}
|
|
||||||
data={[
|
|
||||||
{ value: "splunk_hec", label: DESTINATION_TYPE_LABELS.splunk_hec },
|
|
||||||
{ value: "datadog", label: DESTINATION_TYPE_LABELS.datadog },
|
|
||||||
{ value: "http", label: DESTINATION_TYPE_LABELS.http },
|
|
||||||
]}
|
|
||||||
allowDeselect={false}
|
|
||||||
disabled={isEdit}
|
|
||||||
{...form.getInputProps("type")}
|
|
||||||
/>
|
|
||||||
|
|
||||||
<TextInput
|
|
||||||
label={t("Name")}
|
|
||||||
placeholder={t("e.g. Splunk prod")}
|
|
||||||
required
|
|
||||||
data-autofocus
|
|
||||||
{...form.getInputProps("name")}
|
|
||||||
/>
|
|
||||||
|
|
||||||
{type === "splunk_hec" && (
|
|
||||||
<>
|
|
||||||
<TextInput
|
|
||||||
label={t("HEC URL")}
|
|
||||||
placeholder="https://splunk.example.com:8088"
|
|
||||||
required
|
|
||||||
{...form.getInputProps("url")}
|
|
||||||
/>
|
|
||||||
<PasswordInput
|
|
||||||
label={t("HEC token")}
|
|
||||||
required={!hasSecrets.token}
|
|
||||||
{...form.getInputProps("token")}
|
|
||||||
/>
|
|
||||||
</>
|
|
||||||
)}
|
|
||||||
|
|
||||||
{type === "datadog" && (
|
|
||||||
<>
|
|
||||||
<Select
|
|
||||||
label={t("Datadog site")}
|
|
||||||
data={DATADOG_SITES.map((site) => ({ value: site, label: site }))}
|
|
||||||
allowDeselect={false}
|
|
||||||
{...form.getInputProps("site")}
|
|
||||||
/>
|
|
||||||
<PasswordInput
|
|
||||||
label={t("API key")}
|
|
||||||
required={!hasSecrets.apiKey}
|
|
||||||
{...form.getInputProps("apiKey")}
|
|
||||||
/>
|
|
||||||
</>
|
|
||||||
)}
|
|
||||||
|
|
||||||
{type === "http" && (
|
|
||||||
<>
|
|
||||||
<TextInput
|
|
||||||
label={t("Endpoint URL")}
|
|
||||||
placeholder="https://collector.example.com/docmost"
|
|
||||||
required
|
|
||||||
{...form.getInputProps("url")}
|
|
||||||
/>
|
|
||||||
<PasswordInput
|
|
||||||
label={t("Token")}
|
|
||||||
description={t("Sent in the auth header below. Leave empty if your receiver does not need one.")}
|
|
||||||
{...form.getInputProps("token")}
|
|
||||||
/>
|
|
||||||
</>
|
|
||||||
)}
|
|
||||||
|
|
||||||
<Button
|
|
||||||
variant="subtle"
|
|
||||||
size="compact-sm"
|
|
||||||
onClick={() => setAdvancedOpen((open) => !open)}
|
|
||||||
style={{ alignSelf: "flex-start" }}
|
|
||||||
>
|
|
||||||
{advancedOpen ? t("Hide advanced options") : t("Show advanced options")}
|
|
||||||
</Button>
|
|
||||||
|
|
||||||
<Collapse expanded={advancedOpen}>
|
|
||||||
<Stack gap="md">
|
|
||||||
{type === "splunk_hec" && (
|
|
||||||
<>
|
|
||||||
<TextInput
|
|
||||||
label={t("Index")}
|
|
||||||
description={t("Leave empty to use the token's default index")}
|
|
||||||
{...form.getInputProps("index")}
|
|
||||||
/>
|
|
||||||
<Group grow>
|
|
||||||
<TextInput label={t("Source")} {...form.getInputProps("source")} />
|
|
||||||
<TextInput label={t("Sourcetype")} {...form.getInputProps("sourcetype")} />
|
|
||||||
</Group>
|
|
||||||
<TextInput
|
|
||||||
label={t("Host")}
|
|
||||||
description={t("Defaults to this instance's hostname")}
|
|
||||||
{...form.getInputProps("host")}
|
|
||||||
/>
|
|
||||||
</>
|
|
||||||
)}
|
|
||||||
|
|
||||||
{type === "datadog" && (
|
|
||||||
<>
|
|
||||||
<TextInput label={t("Service")} {...form.getInputProps("service")} />
|
|
||||||
<TextInput label={t("Tags")} placeholder="env:prod,team:security" {...form.getInputProps("tags")} />
|
|
||||||
</>
|
|
||||||
)}
|
|
||||||
|
|
||||||
{type === "http" && (
|
|
||||||
<>
|
|
||||||
<Group grow>
|
|
||||||
<TextInput label={t("Auth header name")} {...form.getInputProps("authHeaderName")} />
|
|
||||||
<TextInput label={t("Auth header prefix")} {...form.getInputProps("authHeaderPrefix")} />
|
|
||||||
</Group>
|
|
||||||
<Select
|
|
||||||
label={t("Body format")}
|
|
||||||
data={[
|
|
||||||
{ value: "json", label: t("JSON array") },
|
|
||||||
{ value: "ndjson", label: "NDJSON" },
|
|
||||||
]}
|
|
||||||
allowDeselect={false}
|
|
||||||
{...form.getInputProps("format")}
|
|
||||||
/>
|
|
||||||
</>
|
|
||||||
)}
|
|
||||||
|
|
||||||
{showTls && (
|
|
||||||
<>
|
|
||||||
{!isCloud() && (
|
|
||||||
<Switch
|
|
||||||
label={t("Verify TLS certificate")}
|
|
||||||
description={
|
|
||||||
form.values.rejectUnauthorized
|
|
||||||
? undefined
|
|
||||||
: t("Insecure: connections can be intercepted.")
|
|
||||||
}
|
|
||||||
{...form.getInputProps("rejectUnauthorized", { type: "checkbox" })}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
</>
|
|
||||||
)}
|
|
||||||
|
|
||||||
<Switch label={t("Enabled")} {...form.getInputProps("enabled", { type: "checkbox" })} />
|
|
||||||
</Stack>
|
|
||||||
</Collapse>
|
|
||||||
|
|
||||||
{showTestResult && (
|
|
||||||
<Alert
|
|
||||||
color={testState.result.delivered ? "green" : "red"}
|
|
||||||
icon={testState.result.delivered ? <IconCheck size={16} /> : <IconAlertCircle size={16} />}
|
|
||||||
>
|
|
||||||
{testState.result.delivered ? t("Test event delivered successfully.") : testState.result.error}
|
|
||||||
</Alert>
|
|
||||||
)}
|
|
||||||
|
|
||||||
<Group justify="space-between" mt="md">
|
|
||||||
<Group gap="sm">
|
|
||||||
<Button variant="default" onClick={handleTest} loading={testMutation.isPending}>
|
|
||||||
{t("Test connection")}
|
|
||||||
</Button>
|
|
||||||
{requiresTest && (
|
|
||||||
<Text size="xs" c="dimmed">
|
|
||||||
{t("Test the connection before saving.")}
|
|
||||||
</Text>
|
|
||||||
)}
|
|
||||||
</Group>
|
|
||||||
<Group>
|
|
||||||
<Button variant="default" onClick={onClose}>{t("Cancel")}</Button>
|
|
||||||
<Button type="submit" disabled={requiresTest} loading={createMutation.isPending || updateMutation.isPending}>
|
|
||||||
{isEdit ? t("Save") : t("Create")}
|
|
||||||
</Button>
|
|
||||||
</Group>
|
|
||||||
</Group>
|
|
||||||
</Stack>
|
|
||||||
</form>
|
|
||||||
</Modal>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
import { Badge } from "@mantine/core";
|
|
||||||
import { useTranslation } from "react-i18next";
|
|
||||||
import { ISiemDestination } from "@/ee/siem/types/siem.types";
|
|
||||||
|
|
||||||
export function DestinationStatusBadge({ destination }: { destination: ISiemDestination }) {
|
|
||||||
const { t } = useTranslation();
|
|
||||||
|
|
||||||
if (!destination.enabled) {
|
|
||||||
return <Badge color="gray" variant="light">{t("Disabled")}</Badge>;
|
|
||||||
}
|
|
||||||
if (destination.status === "failing") {
|
|
||||||
return <Badge color="red" variant="light">{t("Failing")}</Badge>;
|
|
||||||
}
|
|
||||||
return <Badge color="green" variant="light">{t("Healthy")}</Badge>;
|
|
||||||
}
|
|
||||||
@@ -1,155 +0,0 @@
|
|||||||
import { ActionIcon, Menu, Switch, Table, Text, Tooltip } from "@mantine/core";
|
|
||||||
import {
|
|
||||||
IconDots,
|
|
||||||
IconEdit,
|
|
||||||
IconPlugConnected,
|
|
||||||
IconRefresh,
|
|
||||||
IconTrash,
|
|
||||||
} from "@tabler/icons-react";
|
|
||||||
import { useTranslation } from "react-i18next";
|
|
||||||
import { formattedDate, timeAgo } from "@/lib/time.ts";
|
|
||||||
import { ISiemDestination, SiemDestinationType } from "@/ee/siem/types/siem.types";
|
|
||||||
import { DestinationStatusBadge } from "./destination-status-badge";
|
|
||||||
|
|
||||||
export const DESTINATION_TYPE_LABELS: Record<SiemDestinationType, string> = {
|
|
||||||
splunk_hec: "Splunk HEC",
|
|
||||||
datadog: "Datadog",
|
|
||||||
http: "Generic HTTP",
|
|
||||||
};
|
|
||||||
|
|
||||||
interface DestinationTableProps {
|
|
||||||
destinations?: ISiemDestination[];
|
|
||||||
isLoading?: boolean;
|
|
||||||
onEdit: (destination: ISiemDestination) => void;
|
|
||||||
onTest: (destination: ISiemDestination) => void;
|
|
||||||
onRetry: (destination: ISiemDestination) => void;
|
|
||||||
onDelete: (destination: ISiemDestination) => void;
|
|
||||||
onToggle: (destination: ISiemDestination, enabled: boolean) => void;
|
|
||||||
}
|
|
||||||
|
|
||||||
export function DestinationTable({
|
|
||||||
destinations,
|
|
||||||
isLoading,
|
|
||||||
onEdit,
|
|
||||||
onTest,
|
|
||||||
onRetry,
|
|
||||||
onDelete,
|
|
||||||
onToggle,
|
|
||||||
}: DestinationTableProps) {
|
|
||||||
const { t } = useTranslation();
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Table.ScrollContainer minWidth={760}>
|
|
||||||
<Table highlightOnHover verticalSpacing="sm">
|
|
||||||
<Table.Thead>
|
|
||||||
<Table.Tr>
|
|
||||||
<Table.Th>{t("Name")}</Table.Th>
|
|
||||||
<Table.Th>{t("Type")}</Table.Th>
|
|
||||||
<Table.Th>{t("Enabled")}</Table.Th>
|
|
||||||
<Table.Th>{t("Status")}</Table.Th>
|
|
||||||
<Table.Th>{t("Last delivered")}</Table.Th>
|
|
||||||
<Table.Th>{t("Last error")}</Table.Th>
|
|
||||||
<Table.Th aria-label={t("Actions")} />
|
|
||||||
</Table.Tr>
|
|
||||||
</Table.Thead>
|
|
||||||
<Table.Tbody>
|
|
||||||
{destinations && destinations.length > 0 ? (
|
|
||||||
destinations.map((destination) => (
|
|
||||||
<Table.Tr key={destination.id}>
|
|
||||||
<Table.Td>
|
|
||||||
<Text fz="sm" fw={500}>{destination.name}</Text>
|
|
||||||
</Table.Td>
|
|
||||||
<Table.Td>
|
|
||||||
<Text fz="sm">{DESTINATION_TYPE_LABELS[destination.type]}</Text>
|
|
||||||
</Table.Td>
|
|
||||||
<Table.Td>
|
|
||||||
<Switch
|
|
||||||
size="sm"
|
|
||||||
checked={destination.enabled}
|
|
||||||
onChange={(event) => onToggle(destination, event.currentTarget.checked)}
|
|
||||||
aria-label={t("Enabled")}
|
|
||||||
/>
|
|
||||||
</Table.Td>
|
|
||||||
<Table.Td>
|
|
||||||
<DestinationStatusBadge destination={destination} />
|
|
||||||
{destination.failingSince &&
|
|
||||||
(destination.status === "failing" ||
|
|
||||||
!destination.enabled) && (
|
|
||||||
<Text
|
|
||||||
fz="xs"
|
|
||||||
c="dimmed"
|
|
||||||
mt={4}
|
|
||||||
style={{ whiteSpace: "nowrap" }}
|
|
||||||
>
|
|
||||||
{t("Failing since {{time}}", {
|
|
||||||
time: formattedDate(
|
|
||||||
new Date(destination.failingSince),
|
|
||||||
),
|
|
||||||
})}
|
|
||||||
</Text>
|
|
||||||
)}
|
|
||||||
</Table.Td>
|
|
||||||
<Table.Td>
|
|
||||||
<Text fz="sm" style={{ whiteSpace: "nowrap" }}>
|
|
||||||
{destination.lastDeliveredAt
|
|
||||||
? timeAgo(new Date(destination.lastDeliveredAt))
|
|
||||||
: t("Never")}
|
|
||||||
</Text>
|
|
||||||
</Table.Td>
|
|
||||||
<Table.Td>
|
|
||||||
{destination.lastError ? (
|
|
||||||
<Tooltip label={destination.lastError} multiline w={320}>
|
|
||||||
<Text fz="xs" c="red" lineClamp={2} style={{ maxWidth: 260 }}>
|
|
||||||
{destination.lastError}
|
|
||||||
</Text>
|
|
||||||
</Tooltip>
|
|
||||||
) : (
|
|
||||||
<Text fz="xs" c="dimmed">—</Text>
|
|
||||||
)}
|
|
||||||
</Table.Td>
|
|
||||||
<Table.Td>
|
|
||||||
<Menu shadow="md" width={200}>
|
|
||||||
<Menu.Target>
|
|
||||||
<ActionIcon variant="subtle" color="gray" aria-label={t("Actions")}>
|
|
||||||
<IconDots size={18} />
|
|
||||||
</ActionIcon>
|
|
||||||
</Menu.Target>
|
|
||||||
<Menu.Dropdown>
|
|
||||||
<Menu.Item leftSection={<IconEdit size={16} />} onClick={() => onEdit(destination)}>
|
|
||||||
{t("Edit")}
|
|
||||||
</Menu.Item>
|
|
||||||
<Menu.Item leftSection={<IconPlugConnected size={16} />} onClick={() => onTest(destination)}>
|
|
||||||
{t("Send test event")}
|
|
||||||
</Menu.Item>
|
|
||||||
<Menu.Item
|
|
||||||
leftSection={<IconRefresh size={16} />}
|
|
||||||
onClick={() => onRetry(destination)}
|
|
||||||
disabled={!destination.nextAttemptAt}
|
|
||||||
>
|
|
||||||
{t("Retry now")}
|
|
||||||
</Menu.Item>
|
|
||||||
<Menu.Divider />
|
|
||||||
<Menu.Item color="red" leftSection={<IconTrash size={16} />} onClick={() => onDelete(destination)}>
|
|
||||||
{t("Delete")}
|
|
||||||
</Menu.Item>
|
|
||||||
</Menu.Dropdown>
|
|
||||||
</Menu>
|
|
||||||
</Table.Td>
|
|
||||||
</Table.Tr>
|
|
||||||
))
|
|
||||||
) : (
|
|
||||||
!isLoading && (
|
|
||||||
<Table.Tr>
|
|
||||||
<Table.Td colSpan={7}>
|
|
||||||
<Text fz="sm" c="dimmed" ta="center" py="md">
|
|
||||||
{t("No destinations yet")}
|
|
||||||
</Text>
|
|
||||||
</Table.Td>
|
|
||||||
</Table.Tr>
|
|
||||||
)
|
|
||||||
)}
|
|
||||||
</Table.Tbody>
|
|
||||||
</Table>
|
|
||||||
</Table.ScrollContainer>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,129 +0,0 @@
|
|||||||
import { useState } from "react";
|
|
||||||
import { Alert, Button, Group, Tooltip } from "@mantine/core";
|
|
||||||
import { notifications } from "@mantine/notifications";
|
|
||||||
import { IconAlertCircle, IconInfoCircle } from "@tabler/icons-react";
|
|
||||||
import { useTranslation } from "react-i18next";
|
|
||||||
import useUserRole from "@/hooks/use-user-role";
|
|
||||||
import { useHasFeature } from "@/ee/hooks/use-feature";
|
|
||||||
import { Feature } from "@/ee/features";
|
|
||||||
import {
|
|
||||||
ISiemDestination,
|
|
||||||
SIEM_MAX_DESTINATIONS_PER_WORKSPACE,
|
|
||||||
} from "@/ee/siem/types/siem.types";
|
|
||||||
import {
|
|
||||||
useRetrySiemDestinationMutation,
|
|
||||||
useSiemDestinationsQuery,
|
|
||||||
extractErrorMessage,
|
|
||||||
useTestSiemDestinationMutation,
|
|
||||||
useUpdateSiemDestinationMutation,
|
|
||||||
} from "@/ee/siem/queries/siem-query";
|
|
||||||
import { DestinationTable } from "@/ee/siem/components/destination-table";
|
|
||||||
import { DestinationFormModal } from "@/ee/siem/components/destination-form-modal";
|
|
||||||
import { DeleteDestinationModal } from "@/ee/siem/components/delete-destination-modal";
|
|
||||||
|
|
||||||
export default function SiemStreamingPanel() {
|
|
||||||
const { t } = useTranslation();
|
|
||||||
const { isOwner } = useUserRole();
|
|
||||||
const hasFeature = useHasFeature(Feature.SIEM);
|
|
||||||
const { data, isLoading, isError, error } = useSiemDestinationsQuery(hasFeature);
|
|
||||||
const updateMutation = useUpdateSiemDestinationMutation();
|
|
||||||
const retryMutation = useRetrySiemDestinationMutation();
|
|
||||||
const testMutation = useTestSiemDestinationMutation();
|
|
||||||
const [formOpened, setFormOpened] = useState(false);
|
|
||||||
const [deleteOpened, setDeleteOpened] = useState(false);
|
|
||||||
const [selected, setSelected] = useState<ISiemDestination | null>(null);
|
|
||||||
|
|
||||||
if (!isOwner) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
const atDestinationLimit =
|
|
||||||
(data?.length ?? 0) >= SIEM_MAX_DESTINATIONS_PER_WORKSPACE;
|
|
||||||
|
|
||||||
const handleTest = async (destination: ISiemDestination) => {
|
|
||||||
const result = await testMutation
|
|
||||||
.mutateAsync({
|
|
||||||
type: destination.type,
|
|
||||||
config: destination.config as unknown as Record<string, unknown>,
|
|
||||||
destinationId: destination.id,
|
|
||||||
})
|
|
||||||
.catch(() => null);
|
|
||||||
if (!result) return;
|
|
||||||
notifications.show({
|
|
||||||
message: result.delivered
|
|
||||||
? t("Test event delivered to {{name}}", { name: destination.name })
|
|
||||||
: result.error,
|
|
||||||
color: result.delivered ? "green" : "red",
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
{!hasFeature && (
|
|
||||||
<Alert icon={<IconInfoCircle size={16} />} color="yellow" mb="md">
|
|
||||||
{t("SIEM streaming requires an Enterprise license.")}
|
|
||||||
</Alert>
|
|
||||||
)}
|
|
||||||
|
|
||||||
<Group justify="flex-end" mb="md">
|
|
||||||
<Tooltip
|
|
||||||
label={t("Maximum of {{limit}} destinations reached", {
|
|
||||||
limit: SIEM_MAX_DESTINATIONS_PER_WORKSPACE,
|
|
||||||
})}
|
|
||||||
disabled={!atDestinationLimit}
|
|
||||||
>
|
|
||||||
<span>
|
|
||||||
<Button
|
|
||||||
onClick={() => {
|
|
||||||
setSelected(null);
|
|
||||||
setFormOpened(true);
|
|
||||||
}}
|
|
||||||
disabled={!hasFeature || atDestinationLimit}
|
|
||||||
>
|
|
||||||
{t("Add destination")}
|
|
||||||
</Button>
|
|
||||||
</span>
|
|
||||||
</Tooltip>
|
|
||||||
</Group>
|
|
||||||
|
|
||||||
{isError && (
|
|
||||||
<Alert icon={<IconAlertCircle size={16} />} color="red" mb="md">
|
|
||||||
{t("Could not load SIEM destinations: {{message}}", {
|
|
||||||
message: extractErrorMessage(error),
|
|
||||||
})}
|
|
||||||
</Alert>
|
|
||||||
)}
|
|
||||||
|
|
||||||
{hasFeature && !isError && (
|
|
||||||
<DestinationTable
|
|
||||||
destinations={data}
|
|
||||||
isLoading={isLoading}
|
|
||||||
onEdit={(destination) => {
|
|
||||||
setSelected(destination);
|
|
||||||
setFormOpened(true);
|
|
||||||
}}
|
|
||||||
onTest={handleTest}
|
|
||||||
onRetry={(destination) => retryMutation.mutate({ destinationId: destination.id })}
|
|
||||||
onDelete={(destination) => {
|
|
||||||
setSelected(destination);
|
|
||||||
setDeleteOpened(true);
|
|
||||||
}}
|
|
||||||
onToggle={(destination, enabled) =>
|
|
||||||
updateMutation.mutate({ destinationId: destination.id, enabled })
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
|
|
||||||
<DestinationFormModal
|
|
||||||
opened={formOpened}
|
|
||||||
onClose={() => setFormOpened(false)}
|
|
||||||
destination={selected}
|
|
||||||
/>
|
|
||||||
<DeleteDestinationModal
|
|
||||||
opened={deleteOpened}
|
|
||||||
onClose={() => setDeleteOpened(false)}
|
|
||||||
destination={selected}
|
|
||||||
/>
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,179 +0,0 @@
|
|||||||
import {
|
|
||||||
DATADOG_SITES,
|
|
||||||
ISiemDestination,
|
|
||||||
ISiemDestinationInput,
|
|
||||||
SiemDestinationType,
|
|
||||||
} from "@/ee/siem/types/siem.types";
|
|
||||||
|
|
||||||
export type DestinationFormValues = {
|
|
||||||
name: string;
|
|
||||||
type: SiemDestinationType;
|
|
||||||
url: string;
|
|
||||||
token: string;
|
|
||||||
apiKey: string;
|
|
||||||
authHeaderName: string;
|
|
||||||
authHeaderPrefix: string;
|
|
||||||
format: "json" | "ndjson";
|
|
||||||
index: string;
|
|
||||||
source: string;
|
|
||||||
sourcetype: string;
|
|
||||||
host: string;
|
|
||||||
site: string;
|
|
||||||
service: string;
|
|
||||||
tags: string;
|
|
||||||
rejectUnauthorized: boolean;
|
|
||||||
enabled: boolean;
|
|
||||||
};
|
|
||||||
|
|
||||||
export const DEFAULT_FORM_VALUES: DestinationFormValues = {
|
|
||||||
name: "",
|
|
||||||
type: "splunk_hec",
|
|
||||||
url: "",
|
|
||||||
token: "",
|
|
||||||
apiKey: "",
|
|
||||||
authHeaderName: "Authorization",
|
|
||||||
authHeaderPrefix: "Bearer ",
|
|
||||||
format: "json",
|
|
||||||
index: "",
|
|
||||||
source: "docmost",
|
|
||||||
sourcetype: "docmost:audit",
|
|
||||||
host: "",
|
|
||||||
site: DATADOG_SITES[0],
|
|
||||||
service: "docmost",
|
|
||||||
tags: "",
|
|
||||||
rejectUnauthorized: true,
|
|
||||||
enabled: true,
|
|
||||||
};
|
|
||||||
|
|
||||||
const HEADER_NAME_RE = /^[A-Za-z0-9-]+$/;
|
|
||||||
export const SECRET_MASK = "********";
|
|
||||||
|
|
||||||
export function initialValues(
|
|
||||||
destination?: ISiemDestination | null,
|
|
||||||
): DestinationFormValues {
|
|
||||||
if (!destination) return { ...DEFAULT_FORM_VALUES };
|
|
||||||
const config = destination.config as Record<string, any>;
|
|
||||||
const tls = config.tls ?? {};
|
|
||||||
return {
|
|
||||||
...DEFAULT_FORM_VALUES,
|
|
||||||
name: destination.name,
|
|
||||||
type: destination.type,
|
|
||||||
enabled: destination.enabled,
|
|
||||||
token: destination.hasSecrets?.token ? SECRET_MASK : "",
|
|
||||||
apiKey: destination.hasSecrets?.apiKey ? SECRET_MASK : "",
|
|
||||||
url: config.url ?? "",
|
|
||||||
authHeaderName: config.authHeaderName ?? DEFAULT_FORM_VALUES.authHeaderName,
|
|
||||||
authHeaderPrefix: config.authHeaderPrefix ?? DEFAULT_FORM_VALUES.authHeaderPrefix,
|
|
||||||
format: config.format ?? "json",
|
|
||||||
index: config.index ?? "",
|
|
||||||
source: config.source ?? DEFAULT_FORM_VALUES.source,
|
|
||||||
sourcetype: config.sourcetype ?? DEFAULT_FORM_VALUES.sourcetype,
|
|
||||||
host: config.host ?? "",
|
|
||||||
site: config.site ?? DEFAULT_FORM_VALUES.site,
|
|
||||||
service: config.service ?? DEFAULT_FORM_VALUES.service,
|
|
||||||
tags: config.tags ?? "",
|
|
||||||
rejectUnauthorized: tls.rejectUnauthorized ?? true,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function isValidUrl(value: string): boolean {
|
|
||||||
try {
|
|
||||||
const url = new URL(value);
|
|
||||||
return url.protocol === "http:" || url.protocol === "https:";
|
|
||||||
} catch {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export function validateForm(
|
|
||||||
values: DestinationFormValues,
|
|
||||||
hasSecrets: Record<string, boolean> = {},
|
|
||||||
): Partial<Record<keyof DestinationFormValues, string>> {
|
|
||||||
const errors: Partial<Record<keyof DestinationFormValues, string>> = {};
|
|
||||||
|
|
||||||
if (!values.name.trim()) errors.name = "Name is required";
|
|
||||||
|
|
||||||
if (values.type !== "datadog" && !isValidUrl(values.url.trim())) {
|
|
||||||
errors.url = "Enter a valid http(s) URL";
|
|
||||||
}
|
|
||||||
|
|
||||||
if (values.type === "splunk_hec") {
|
|
||||||
if (!values.token && !hasSecrets.token) {
|
|
||||||
errors.token = "HEC token is required";
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
const url = new URL(values.url.trim());
|
|
||||||
const path = url.pathname.replace(/\/+$/, "");
|
|
||||||
if (path !== "" && path !== "/services/collector" && path !== "/services/collector/event") {
|
|
||||||
errors.url = "Enter the HEC base URL or the /services/collector/event endpoint";
|
|
||||||
}
|
|
||||||
} catch {}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (values.type === "datadog") {
|
|
||||||
if (!(DATADOG_SITES as readonly string[]).includes(values.site)) {
|
|
||||||
errors.site = "Select a Datadog site";
|
|
||||||
}
|
|
||||||
if (!values.apiKey && !hasSecrets.apiKey) errors.apiKey = "API key is required";
|
|
||||||
}
|
|
||||||
|
|
||||||
if (values.type === "http") {
|
|
||||||
if (!HEADER_NAME_RE.test(values.authHeaderName.trim())) {
|
|
||||||
errors.authHeaderName = "Use letters, digits and hyphens only";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
return errors;
|
|
||||||
}
|
|
||||||
|
|
||||||
function enteredSecret(key: string, value: string): Record<string, string> {
|
|
||||||
const trimmed = value.trim();
|
|
||||||
return trimmed && trimmed !== SECRET_MASK ? { [key]: trimmed } : {};
|
|
||||||
}
|
|
||||||
|
|
||||||
export function toPayload(values: DestinationFormValues): ISiemDestinationInput {
|
|
||||||
const tls = { rejectUnauthorized: values.rejectUnauthorized };
|
|
||||||
|
|
||||||
let config: Record<string, unknown>;
|
|
||||||
let secrets: Record<string, string>;
|
|
||||||
|
|
||||||
switch (values.type) {
|
|
||||||
case "splunk_hec":
|
|
||||||
config = {
|
|
||||||
url: values.url.trim(),
|
|
||||||
index: values.index.trim(),
|
|
||||||
source: values.source.trim() || "docmost",
|
|
||||||
sourcetype: values.sourcetype.trim() || "docmost:audit",
|
|
||||||
host: values.host.trim(),
|
|
||||||
tls,
|
|
||||||
};
|
|
||||||
secrets = enteredSecret("token", values.token);
|
|
||||||
break;
|
|
||||||
case "datadog":
|
|
||||||
config = {
|
|
||||||
site: values.site,
|
|
||||||
service: values.service.trim() || "docmost",
|
|
||||||
tags: values.tags.trim(),
|
|
||||||
};
|
|
||||||
secrets = enteredSecret("apiKey", values.apiKey);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
config = {
|
|
||||||
url: values.url.trim(),
|
|
||||||
authHeaderName: values.authHeaderName.trim(),
|
|
||||||
authHeaderPrefix: values.authHeaderPrefix,
|
|
||||||
format: values.format,
|
|
||||||
tls,
|
|
||||||
};
|
|
||||||
secrets = enteredSecret("token", values.token);
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
|
||||||
name: values.name.trim(),
|
|
||||||
type: values.type,
|
|
||||||
config,
|
|
||||||
secrets: Object.fromEntries(Object.entries(secrets).filter(([, v]) => v !== "")),
|
|
||||||
enabled: values.enabled,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,115 +0,0 @@
|
|||||||
import {
|
|
||||||
useMutation,
|
|
||||||
useQuery,
|
|
||||||
useQueryClient,
|
|
||||||
UseQueryResult,
|
|
||||||
} from "@tanstack/react-query";
|
|
||||||
import { notifications } from "@mantine/notifications";
|
|
||||||
import { useTranslation } from "react-i18next";
|
|
||||||
import {
|
|
||||||
createSiemDestination,
|
|
||||||
deleteSiemDestination,
|
|
||||||
getSiemDestinations,
|
|
||||||
retrySiemDestination,
|
|
||||||
testSiemDestination,
|
|
||||||
updateSiemDestination,
|
|
||||||
} from "@/ee/siem/services/siem-service";
|
|
||||||
import {
|
|
||||||
ISiemDestination,
|
|
||||||
ISiemDestinationInput,
|
|
||||||
ISiemTestResult,
|
|
||||||
ITestSiemDestinationInput,
|
|
||||||
IUpdateSiemDestinationInput,
|
|
||||||
} from "@/ee/siem/types/siem.types";
|
|
||||||
|
|
||||||
export const SIEM_DESTINATIONS_KEY = ["siem-destinations"];
|
|
||||||
|
|
||||||
export function extractErrorMessage(error: Error): string {
|
|
||||||
const data = (error as any)?.response?.data;
|
|
||||||
const message = data?.message ?? error.message;
|
|
||||||
return Array.isArray(message) ? message.join(", ") : String(message);
|
|
||||||
}
|
|
||||||
|
|
||||||
function showError(error: Error) {
|
|
||||||
notifications.show({ message: extractErrorMessage(error), color: "red" });
|
|
||||||
}
|
|
||||||
|
|
||||||
function isForbidden(error: unknown): boolean {
|
|
||||||
return (error as { response?: { status?: number } })?.response?.status === 403;
|
|
||||||
}
|
|
||||||
|
|
||||||
export function useSiemDestinationsQuery(
|
|
||||||
enabled = true,
|
|
||||||
): UseQueryResult<ISiemDestination[], Error> {
|
|
||||||
return useQuery({
|
|
||||||
queryKey: SIEM_DESTINATIONS_KEY,
|
|
||||||
queryFn: getSiemDestinations,
|
|
||||||
enabled,
|
|
||||||
retry: (failureCount, error) => !isForbidden(error) && failureCount < 2,
|
|
||||||
refetchInterval: (query) => (query.state.status === "error" ? false : 15_000),
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function useInvalidateDestinations() {
|
|
||||||
const queryClient = useQueryClient();
|
|
||||||
return () => queryClient.invalidateQueries({ queryKey: SIEM_DESTINATIONS_KEY });
|
|
||||||
}
|
|
||||||
|
|
||||||
export function useCreateSiemDestinationMutation() {
|
|
||||||
const { t } = useTranslation();
|
|
||||||
const invalidate = useInvalidateDestinations();
|
|
||||||
return useMutation<ISiemDestination, Error, ISiemDestinationInput>({
|
|
||||||
mutationFn: createSiemDestination,
|
|
||||||
onSuccess: () => {
|
|
||||||
notifications.show({ message: t("Destination created") });
|
|
||||||
invalidate();
|
|
||||||
},
|
|
||||||
onError: showError,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
export function useUpdateSiemDestinationMutation() {
|
|
||||||
const { t } = useTranslation();
|
|
||||||
const invalidate = useInvalidateDestinations();
|
|
||||||
return useMutation<ISiemDestination, Error, IUpdateSiemDestinationInput>({
|
|
||||||
mutationFn: updateSiemDestination,
|
|
||||||
onSuccess: () => {
|
|
||||||
notifications.show({ message: t("Destination updated") });
|
|
||||||
invalidate();
|
|
||||||
},
|
|
||||||
onError: showError,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
export function useDeleteSiemDestinationMutation() {
|
|
||||||
const { t } = useTranslation();
|
|
||||||
const invalidate = useInvalidateDestinations();
|
|
||||||
return useMutation<void, Error, { destinationId: string }>({
|
|
||||||
mutationFn: deleteSiemDestination,
|
|
||||||
onSuccess: () => {
|
|
||||||
notifications.show({ message: t("Destination deleted") });
|
|
||||||
invalidate();
|
|
||||||
},
|
|
||||||
onError: showError,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
export function useRetrySiemDestinationMutation() {
|
|
||||||
const { t } = useTranslation();
|
|
||||||
const invalidate = useInvalidateDestinations();
|
|
||||||
return useMutation<void, Error, { destinationId: string }>({
|
|
||||||
mutationFn: retrySiemDestination,
|
|
||||||
onSuccess: () => {
|
|
||||||
notifications.show({ message: t("Retry scheduled") });
|
|
||||||
invalidate();
|
|
||||||
},
|
|
||||||
onError: showError,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
export function useTestSiemDestinationMutation() {
|
|
||||||
return useMutation<ISiemTestResult, Error, ITestSiemDestinationInput>({
|
|
||||||
mutationFn: testSiemDestination,
|
|
||||||
onError: showError,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
@@ -1,46 +0,0 @@
|
|||||||
import api from "@/lib/api-client";
|
|
||||||
import {
|
|
||||||
ISiemDestination,
|
|
||||||
ISiemDestinationInput,
|
|
||||||
ISiemTestResult,
|
|
||||||
ITestSiemDestinationInput,
|
|
||||||
IUpdateSiemDestinationInput,
|
|
||||||
} from "@/ee/siem/types/siem.types";
|
|
||||||
|
|
||||||
export async function getSiemDestinations(): Promise<ISiemDestination[]> {
|
|
||||||
const req = await api.post<ISiemDestination[]>("/siem/destinations");
|
|
||||||
return req.data;
|
|
||||||
}
|
|
||||||
|
|
||||||
export async function createSiemDestination(
|
|
||||||
data: ISiemDestinationInput,
|
|
||||||
): Promise<ISiemDestination> {
|
|
||||||
const req = await api.post<ISiemDestination>("/siem/destinations/create", data);
|
|
||||||
return req.data;
|
|
||||||
}
|
|
||||||
|
|
||||||
export async function updateSiemDestination(
|
|
||||||
data: IUpdateSiemDestinationInput,
|
|
||||||
): Promise<ISiemDestination> {
|
|
||||||
const req = await api.post<ISiemDestination>("/siem/destinations/update", data);
|
|
||||||
return req.data;
|
|
||||||
}
|
|
||||||
|
|
||||||
export async function deleteSiemDestination(data: {
|
|
||||||
destinationId: string;
|
|
||||||
}): Promise<void> {
|
|
||||||
await api.post("/siem/destinations/delete", data);
|
|
||||||
}
|
|
||||||
|
|
||||||
export async function testSiemDestination(
|
|
||||||
data: ITestSiemDestinationInput,
|
|
||||||
): Promise<ISiemTestResult> {
|
|
||||||
const req = await api.post<ISiemTestResult>("/siem/destinations/test", data);
|
|
||||||
return req.data;
|
|
||||||
}
|
|
||||||
|
|
||||||
export async function retrySiemDestination(data: {
|
|
||||||
destinationId: string;
|
|
||||||
}): Promise<void> {
|
|
||||||
await api.post("/siem/destinations/retry", data);
|
|
||||||
}
|
|
||||||
@@ -1,91 +0,0 @@
|
|||||||
export const SIEM_MAX_DESTINATIONS_PER_WORKSPACE = 2;
|
|
||||||
|
|
||||||
export type SiemDestinationType = "http" | "splunk_hec" | "datadog";
|
|
||||||
export type SiemDestinationStatus = "healthy" | "failing";
|
|
||||||
|
|
||||||
export const DATADOG_SITES = [
|
|
||||||
"datadoghq.com",
|
|
||||||
"datadoghq.eu",
|
|
||||||
"us3.datadoghq.com",
|
|
||||||
"us5.datadoghq.com",
|
|
||||||
"ap1.datadoghq.com",
|
|
||||||
"ddog-gov.com",
|
|
||||||
] as const;
|
|
||||||
|
|
||||||
export interface ITlsOptions {
|
|
||||||
rejectUnauthorized: boolean;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface IHttpConfig {
|
|
||||||
url: string;
|
|
||||||
authHeaderName: string;
|
|
||||||
authHeaderPrefix: string;
|
|
||||||
format: "json" | "ndjson";
|
|
||||||
tls?: ITlsOptions;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface ISplunkHecConfig {
|
|
||||||
url: string;
|
|
||||||
index?: string;
|
|
||||||
source: string;
|
|
||||||
sourcetype: string;
|
|
||||||
host?: string;
|
|
||||||
channelId: string;
|
|
||||||
tls?: ITlsOptions;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface IDatadogConfig {
|
|
||||||
site: string;
|
|
||||||
service: string;
|
|
||||||
tags?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export type ISiemConfig = IHttpConfig | ISplunkHecConfig | IDatadogConfig;
|
|
||||||
|
|
||||||
export interface ISiemDestination {
|
|
||||||
id: string;
|
|
||||||
name: string;
|
|
||||||
type: SiemDestinationType;
|
|
||||||
enabled: boolean;
|
|
||||||
status: SiemDestinationStatus;
|
|
||||||
config: ISiemConfig;
|
|
||||||
hasSecrets: Record<string, boolean>;
|
|
||||||
cursorCreatedAt: string;
|
|
||||||
lastDeliveredAt: string | null;
|
|
||||||
lastError: string | null;
|
|
||||||
lastErrorAt: string | null;
|
|
||||||
consecutiveFailures: number;
|
|
||||||
nextAttemptAt: string | null;
|
|
||||||
failingSince: string | null;
|
|
||||||
createdAt: string;
|
|
||||||
updatedAt: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface ISiemDestinationInput {
|
|
||||||
name: string;
|
|
||||||
type: SiemDestinationType;
|
|
||||||
config: Record<string, unknown>;
|
|
||||||
secrets?: Record<string, string>;
|
|
||||||
enabled?: boolean;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface IUpdateSiemDestinationInput {
|
|
||||||
destinationId: string;
|
|
||||||
name?: string;
|
|
||||||
config?: Record<string, unknown>;
|
|
||||||
secrets?: Record<string, string>;
|
|
||||||
enabled?: boolean;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface ITestSiemDestinationInput {
|
|
||||||
type: SiemDestinationType;
|
|
||||||
config: Record<string, unknown>;
|
|
||||||
secrets?: Record<string, string>;
|
|
||||||
destinationId?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface ISiemTestResult {
|
|
||||||
delivered: boolean;
|
|
||||||
error?: string;
|
|
||||||
statusCode?: number;
|
|
||||||
}
|
|
||||||
@@ -85,9 +85,6 @@ export function AudioMenu({ editor }: EditorMenuProps) {
|
|||||||
<BaseBubbleMenu
|
<BaseBubbleMenu
|
||||||
editor={editor}
|
editor={editor}
|
||||||
pluginKey={`audio-menu`}
|
pluginKey={`audio-menu`}
|
||||||
ref={(element) => {
|
|
||||||
if (element) element.style.zIndex = "99";
|
|
||||||
}}
|
|
||||||
updateDelay={0}
|
updateDelay={0}
|
||||||
getReferencedVirtualElement={getReferencedVirtualElement}
|
getReferencedVirtualElement={getReferencedVirtualElement}
|
||||||
options={{
|
options={{
|
||||||
|
|||||||
@@ -121,14 +121,12 @@ export function CalloutMenu({ editor }: EditorMenuProps) {
|
|||||||
<BaseBubbleMenu
|
<BaseBubbleMenu
|
||||||
editor={editor}
|
editor={editor}
|
||||||
pluginKey={`callout-menu`}
|
pluginKey={`callout-menu`}
|
||||||
ref={(element) => {
|
|
||||||
if (element) element.style.zIndex = "99";
|
|
||||||
}}
|
|
||||||
updateDelay={0}
|
updateDelay={0}
|
||||||
getReferencedVirtualElement={getReferencedVirtualElement}
|
getReferencedVirtualElement={getReferencedVirtualElement}
|
||||||
options={{
|
options={{
|
||||||
placement: "bottom",
|
placement: "bottom",
|
||||||
// offset: 233, // // offset: [0, 10],
|
// offset: 233, // // offset: [0, 10],
|
||||||
|
// zIndex: 99,
|
||||||
flip: false,
|
flip: false,
|
||||||
}}
|
}}
|
||||||
shouldShow={shouldShow}
|
shouldShow={shouldShow}
|
||||||
|
|||||||
@@ -257,9 +257,6 @@ export function ColumnsMenu({ editor }: EditorMenuProps) {
|
|||||||
<BaseBubbleMenu
|
<BaseBubbleMenu
|
||||||
editor={editor}
|
editor={editor}
|
||||||
pluginKey="columns-menu"
|
pluginKey="columns-menu"
|
||||||
ref={(element) => {
|
|
||||||
if (element) element.style.zIndex = "99";
|
|
||||||
}}
|
|
||||||
updateDelay={0}
|
updateDelay={0}
|
||||||
getReferencedVirtualElement={getReferencedVirtualElement}
|
getReferencedVirtualElement={getReferencedVirtualElement}
|
||||||
options={{
|
options={{
|
||||||
|
|||||||
@@ -273,9 +273,6 @@ export function DrawioMenu({ editor }: EditorMenuProps) {
|
|||||||
<BaseBubbleMenu
|
<BaseBubbleMenu
|
||||||
editor={editor}
|
editor={editor}
|
||||||
pluginKey={`drawio-menu`}
|
pluginKey={`drawio-menu`}
|
||||||
ref={(element) => {
|
|
||||||
if (element) element.style.zIndex = "99";
|
|
||||||
}}
|
|
||||||
updateDelay={0}
|
updateDelay={0}
|
||||||
getReferencedVirtualElement={getReferencedVirtualElement}
|
getReferencedVirtualElement={getReferencedVirtualElement}
|
||||||
options={{
|
options={{
|
||||||
|
|||||||
@@ -156,9 +156,6 @@ export function ImageMenu({ editor }: EditorMenuProps) {
|
|||||||
<BaseBubbleMenu
|
<BaseBubbleMenu
|
||||||
editor={editor}
|
editor={editor}
|
||||||
pluginKey={`image-menu`}
|
pluginKey={`image-menu`}
|
||||||
ref={(element) => {
|
|
||||||
if (element) element.style.zIndex = "99";
|
|
||||||
}}
|
|
||||||
updateDelay={0}
|
updateDelay={0}
|
||||||
getReferencedVirtualElement={getReferencedVirtualElement}
|
getReferencedVirtualElement={getReferencedVirtualElement}
|
||||||
options={{
|
options={{
|
||||||
|
|||||||
@@ -26,12 +26,7 @@ import { INTERNAL_LINK_REGEX } from "@/lib/constants";
|
|||||||
import { LinkEditorPanel } from "@/features/editor/components/link/link-editor-panel.tsx";
|
import { LinkEditorPanel } from "@/features/editor/components/link/link-editor-panel.tsx";
|
||||||
import { usePageQuery } from "@/features/page/queries/page-query.ts";
|
import { usePageQuery } from "@/features/page/queries/page-query.ts";
|
||||||
import { useSharePageQuery } from "@/features/share/queries/share-query.ts";
|
import { useSharePageQuery } from "@/features/share/queries/share-query.ts";
|
||||||
import { usePublicSpacePageQuery } from "@/features/public-space/queries/public-space-query.ts";
|
import { buildSharedPageUrl } from "@/features/page/page.utils.ts";
|
||||||
import {
|
|
||||||
buildPageUrl,
|
|
||||||
buildPublicSpaceUrl,
|
|
||||||
buildSharedPageUrl,
|
|
||||||
} from "@/features/page/page.utils.ts";
|
|
||||||
import { extractPageSlugId } from "@/lib";
|
import { extractPageSlugId } from "@/lib";
|
||||||
import { sanitizeUrl, copyToClipboard, isEditorReady } from "@docmost/editor-ext";
|
import { sanitizeUrl, copyToClipboard, isEditorReady } from "@docmost/editor-ext";
|
||||||
import { normalizeUrl } from "@/lib/utils";
|
import { normalizeUrl } from "@/lib/utils";
|
||||||
@@ -65,10 +60,9 @@ export default function LinkView(props: MarkViewProps) {
|
|||||||
const href = mark.attrs.href as string;
|
const href = mark.attrs.href as string;
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
const location = useLocation();
|
const location = useLocation();
|
||||||
const { shareId, spaceSlug, pageSlug } = useParams();
|
const { shareId, pageSlug } = useParams();
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const isShareRoute = location.pathname.startsWith("/share");
|
const isShareRoute = location.pathname.startsWith("/share");
|
||||||
const isPublicSpaceRoute = location.pathname.startsWith("/docs/");
|
|
||||||
|
|
||||||
const [popoverState, setPopoverState] = useState<
|
const [popoverState, setPopoverState] = useState<
|
||||||
"closed" | "preview" | "edit"
|
"closed" | "preview" | "edit"
|
||||||
@@ -90,33 +84,16 @@ export default function LinkView(props: MarkViewProps) {
|
|||||||
const activeView = isPopoverVisible ? popoverState : lastOpenState.current;
|
const activeView = isPopoverVisible ? popoverState : lastOpenState.current;
|
||||||
|
|
||||||
const { data: linkedPage } = usePageQuery({
|
const { data: linkedPage } = usePageQuery({
|
||||||
pageId:
|
pageId: isPopoverVisible && slugId && !isShareRoute ? slugId : null,
|
||||||
isPopoverVisible && slugId && !isShareRoute && !isPublicSpaceRoute
|
|
||||||
? slugId
|
|
||||||
: null,
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const { data: sharedPageData } = useSharePageQuery({
|
const { data: sharedPageData } = useSharePageQuery({
|
||||||
pageId: isPopoverVisible && slugId && isShareRoute ? slugId : null,
|
pageId: isPopoverVisible && slugId && isShareRoute ? slugId : null,
|
||||||
});
|
});
|
||||||
|
|
||||||
// Resolved eagerly (not gated on the popover): an unresolvable target must
|
const pageTitle = isShareRoute
|
||||||
// render as inert text rather than a link that dead-ends at /login.
|
? sharedPageData?.page?.title
|
||||||
const { data: publicSpacePageData } = usePublicSpacePageQuery({
|
: linkedPage?.title;
|
||||||
spaceSlug: isPublicSpaceRoute && slugId ? spaceSlug : undefined,
|
|
||||||
pageSlugId: slugId,
|
|
||||||
contentless: true,
|
|
||||||
});
|
|
||||||
|
|
||||||
const isUnresolvedPublicLink =
|
|
||||||
isPublicSpaceRoute && isInternal && !publicSpacePageData?.page && !slugId;
|
|
||||||
|
|
||||||
let pageTitle = linkedPage?.title;
|
|
||||||
if (isShareRoute) {
|
|
||||||
pageTitle = sharedPageData?.page?.title;
|
|
||||||
} else if (isPublicSpaceRoute) {
|
|
||||||
pageTitle = publicSpacePageData?.page?.title;
|
|
||||||
}
|
|
||||||
|
|
||||||
const pendingTitleRef = useRef<string | null>(null);
|
const pendingTitleRef = useRef<string | null>(null);
|
||||||
const titleInputRef = useRef<HTMLInputElement>(null);
|
const titleInputRef = useRef<HTMLInputElement>(null);
|
||||||
@@ -283,27 +260,6 @@ export default function LinkView(props: MarkViewProps) {
|
|||||||
anchorId: anchor || undefined,
|
anchorId: anchor || undefined,
|
||||||
});
|
});
|
||||||
navigate(sharedUrl);
|
navigate(sharedUrl);
|
||||||
} else if (isPublicSpaceRoute) {
|
|
||||||
if (slugId && publicSpacePageData?.page) {
|
|
||||||
navigate(
|
|
||||||
buildPublicSpaceUrl({
|
|
||||||
// cross-space targets resolve to their own space's public URL
|
|
||||||
spaceSlug: publicSpacePageData.space?.slug ?? spaceSlug,
|
|
||||||
pageSlugId: slugId,
|
|
||||||
pageTitle: pageTitle,
|
|
||||||
anchorId: anchor || undefined,
|
|
||||||
}),
|
|
||||||
);
|
|
||||||
} else if (slugId) {
|
|
||||||
// no public URL: the /p/ resolver redirects members straight to the
|
|
||||||
// page and funnels anonymous visitors through login first; a new tab
|
|
||||||
// keeps the docs tab's history intact through that redirect chain
|
|
||||||
window.open(
|
|
||||||
buildPageUrl(undefined, slugId, pageTitle, anchor || undefined),
|
|
||||||
"_blank",
|
|
||||||
"noopener,noreferrer",
|
|
||||||
);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
navigate(anchor ? `${targetPath}#${anchor}` : targetPath);
|
navigate(anchor ? `${targetPath}#${anchor}` : targetPath);
|
||||||
}
|
}
|
||||||
@@ -320,11 +276,8 @@ export default function LinkView(props: MarkViewProps) {
|
|||||||
location.pathname,
|
location.pathname,
|
||||||
isInternal,
|
isInternal,
|
||||||
isShareRoute,
|
isShareRoute,
|
||||||
isPublicSpaceRoute,
|
|
||||||
slugId,
|
slugId,
|
||||||
shareId,
|
shareId,
|
||||||
spaceSlug,
|
|
||||||
publicSpacePageData,
|
|
||||||
pageTitle,
|
pageTitle,
|
||||||
pageSlug,
|
pageSlug,
|
||||||
]);
|
]);
|
||||||
@@ -366,18 +319,12 @@ export default function LinkView(props: MarkViewProps) {
|
|||||||
setPopoverState("closed");
|
setPopoverState("closed");
|
||||||
}, [editor]);
|
}, [editor]);
|
||||||
|
|
||||||
const internalHref = () => {
|
|
||||||
if (isShareRoute && slugId) {
|
|
||||||
return buildSharedPageUrl({ shareId, pageSlugId: slugId, pageTitle });
|
|
||||||
}
|
|
||||||
if (isPublicSpaceRoute && slugId && publicSpacePageData?.page) {
|
|
||||||
return buildPublicSpaceUrl({ spaceSlug, pageSlugId: slugId, pageTitle });
|
|
||||||
}
|
|
||||||
return href;
|
|
||||||
};
|
|
||||||
|
|
||||||
const displayHref = sanitizeUrl(
|
const displayHref = sanitizeUrl(
|
||||||
isInternal ? internalHref() : normalizeUrl(href),
|
isInternal
|
||||||
|
? isShareRoute && slugId
|
||||||
|
? buildSharedPageUrl({ shareId, pageSlugId: slugId, pageTitle })
|
||||||
|
: href
|
||||||
|
: normalizeUrl(href),
|
||||||
);
|
);
|
||||||
|
|
||||||
const linkTitleInput = (
|
const linkTitleInput = (
|
||||||
@@ -427,16 +374,6 @@ export default function LinkView(props: MarkViewProps) {
|
|||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|
||||||
// Targets outside the published space have no public URL, so the label is
|
|
||||||
// rendered as inert text instead of a link that dead-ends at /login.
|
|
||||||
if (isUnresolvedPublicLink) {
|
|
||||||
return (
|
|
||||||
<span ref={wrapperRef} className={classes.linkWrapper}>
|
|
||||||
<MarkViewContent />
|
|
||||||
</span>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Popover
|
<Popover
|
||||||
opened={isPopoverVisible}
|
opened={isPopoverVisible}
|
||||||
|
|||||||
@@ -4,10 +4,8 @@ import { IconFileDescription } from "@tabler/icons-react";
|
|||||||
import { Link, useLocation, useNavigate, useParams } from "react-router-dom";
|
import { Link, useLocation, useNavigate, useParams } from "react-router-dom";
|
||||||
import { usePageQuery } from "@/features/page/queries/page-query.ts";
|
import { usePageQuery } from "@/features/page/queries/page-query.ts";
|
||||||
import { useSharePageQuery } from "@/features/share/queries/share-query.ts";
|
import { useSharePageQuery } from "@/features/share/queries/share-query.ts";
|
||||||
import { usePublicSpacePageQuery } from "@/features/public-space/queries/public-space-query.ts";
|
|
||||||
import {
|
import {
|
||||||
buildPageUrl,
|
buildPageUrl,
|
||||||
buildPublicSpaceUrl,
|
|
||||||
buildSharedPageUrl,
|
buildSharedPageUrl,
|
||||||
} from "@/features/page/page.utils.ts";
|
} from "@/features/page/page.utils.ts";
|
||||||
import { extractPageSlugId } from "@/lib";
|
import { extractPageSlugId } from "@/lib";
|
||||||
@@ -23,30 +21,17 @@ export default function MentionView(props: NodeViewProps) {
|
|||||||
|
|
||||||
const location = useLocation();
|
const location = useLocation();
|
||||||
const isShareRoute = location.pathname.startsWith("/share");
|
const isShareRoute = location.pathname.startsWith("/share");
|
||||||
const isPublicSpaceRoute = location.pathname.startsWith("/docs/");
|
|
||||||
|
|
||||||
const {
|
const {
|
||||||
data: page,
|
data: page,
|
||||||
isLoading,
|
isLoading,
|
||||||
isError,
|
isError,
|
||||||
} = usePageQuery({
|
} = usePageQuery({ pageId: isPageMention && !isShareRoute ? slugId : null });
|
||||||
pageId:
|
|
||||||
isPageMention && !isShareRoute && !isPublicSpaceRoute ? slugId : null,
|
|
||||||
});
|
|
||||||
|
|
||||||
const { data: sharedPage } = useSharePageQuery({
|
const { data: sharedPage } = useSharePageQuery({
|
||||||
pageId: isPageMention && isShareRoute ? slugId : undefined,
|
pageId: isPageMention && isShareRoute ? slugId : undefined,
|
||||||
});
|
});
|
||||||
|
|
||||||
// Without the slugId guard the request resolves to the space home, which
|
|
||||||
// would render a mention pointing at the wrong page.
|
|
||||||
const { data: publicPageData } = usePublicSpacePageQuery({
|
|
||||||
spaceSlug:
|
|
||||||
isPageMention && isPublicSpaceRoute && slugId ? spaceSlug : undefined,
|
|
||||||
pageSlugId: slugId,
|
|
||||||
contentless: true,
|
|
||||||
});
|
|
||||||
|
|
||||||
const currentPageSlugId = extractPageSlugId(pageSlug);
|
const currentPageSlugId = extractPageSlugId(pageSlug);
|
||||||
const isSamePage = currentPageSlugId === slugId;
|
const isSamePage = currentPageSlugId === slugId;
|
||||||
|
|
||||||
@@ -102,61 +87,7 @@ export default function MentionView(props: NodeViewProps) {
|
|||||||
</Anchor>
|
</Anchor>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{isPageMention && isPublicSpaceRoute && publicPageData?.page && (
|
{isPageMention && !isShareRoute && isError && (
|
||||||
<Anchor
|
|
||||||
component={Link}
|
|
||||||
fw={500}
|
|
||||||
to={buildPublicSpaceUrl({
|
|
||||||
spaceSlug: publicPageData.space?.slug ?? spaceSlug,
|
|
||||||
pageSlugId: slugId,
|
|
||||||
pageTitle: publicPageData.page.title || label,
|
|
||||||
anchorId,
|
|
||||||
})}
|
|
||||||
onClick={handleClick}
|
|
||||||
underline="never"
|
|
||||||
className={classes.pageMentionLink}
|
|
||||||
>
|
|
||||||
<ActionIcon
|
|
||||||
variant="transparent"
|
|
||||||
color="gray"
|
|
||||||
component="span"
|
|
||||||
size={18}
|
|
||||||
style={{ verticalAlign: "text-bottom" }}
|
|
||||||
>
|
|
||||||
<IconFileDescription size={18} />
|
|
||||||
</ActionIcon>
|
|
||||||
<span className={classes.pageMentionText}>
|
|
||||||
{publicPageData.page.title || label}
|
|
||||||
</span>
|
|
||||||
</Anchor>
|
|
||||||
)}
|
|
||||||
|
|
||||||
{/* No public URL: the /p/ resolver redirects members to the page and
|
|
||||||
funnels anonymous visitors through login first. New tab, so the
|
|
||||||
redirect chain never rewrites the docs tab's history. */}
|
|
||||||
{isPageMention && isPublicSpaceRoute && !publicPageData?.page && (
|
|
||||||
<Anchor
|
|
||||||
fw={500}
|
|
||||||
href={buildPageUrl(undefined, slugId, label, anchorId)}
|
|
||||||
target="_blank"
|
|
||||||
rel="noopener noreferrer"
|
|
||||||
underline="never"
|
|
||||||
className={classes.pageMentionLink}
|
|
||||||
>
|
|
||||||
<ActionIcon
|
|
||||||
variant="transparent"
|
|
||||||
color="gray"
|
|
||||||
component="span"
|
|
||||||
size={18}
|
|
||||||
style={{ verticalAlign: "text-bottom" }}
|
|
||||||
>
|
|
||||||
<IconFileDescription size={18} />
|
|
||||||
</ActionIcon>
|
|
||||||
<span className={classes.pageMentionText}>{label}</span>
|
|
||||||
</Anchor>
|
|
||||||
)}
|
|
||||||
|
|
||||||
{isPageMention && !isShareRoute && !isPublicSpaceRoute && isError && (
|
|
||||||
<Anchor
|
<Anchor
|
||||||
component={Link}
|
component={Link}
|
||||||
fw={500}
|
fw={500}
|
||||||
@@ -180,7 +111,7 @@ export default function MentionView(props: NodeViewProps) {
|
|||||||
</Anchor>
|
</Anchor>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{isPageMention && !isShareRoute && !isPublicSpaceRoute && !isError && (
|
{isPageMention && !isShareRoute && !isError && (
|
||||||
<Anchor
|
<Anchor
|
||||||
component={Link}
|
component={Link}
|
||||||
fw={500}
|
fw={500}
|
||||||
|
|||||||
@@ -106,9 +106,6 @@ export function PdfMenu({ editor }: EditorMenuProps) {
|
|||||||
<BaseBubbleMenu
|
<BaseBubbleMenu
|
||||||
editor={editor}
|
editor={editor}
|
||||||
pluginKey={`pdf-menu`}
|
pluginKey={`pdf-menu`}
|
||||||
ref={(element) => {
|
|
||||||
if (element) element.style.zIndex = "99";
|
|
||||||
}}
|
|
||||||
updateDelay={0}
|
updateDelay={0}
|
||||||
getReferencedVirtualElement={getReferencedVirtualElement}
|
getReferencedVirtualElement={getReferencedVirtualElement}
|
||||||
options={{
|
options={{
|
||||||
|
|||||||
+3
-5
@@ -66,7 +66,7 @@ function SearchAndReplaceDialog({ editor, editable = true }: PageFindDialogDialo
|
|||||||
}
|
}
|
||||||
// Clear search term in editor
|
// Clear search term in editor
|
||||||
if (isEditorReady(editor)) {
|
if (isEditorReady(editor)) {
|
||||||
editor.commands.setSearchTerms([""]);
|
editor.commands.setSearchTerm("");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -117,7 +117,7 @@ function SearchAndReplaceDialog({ editor, editable = true }: PageFindDialogDialo
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!isEditorReady(editor)) return;
|
if (!isEditorReady(editor)) return;
|
||||||
editor.commands.setSearchTerms([searchText]);
|
editor.commands.setSearchTerm(searchText);
|
||||||
editor.commands.resetIndex();
|
editor.commands.resetIndex();
|
||||||
editor.commands.selectCurrentItem();
|
editor.commands.selectCurrentItem();
|
||||||
}, [searchText]);
|
}, [searchText]);
|
||||||
@@ -181,10 +181,8 @@ function SearchAndReplaceDialog({ editor, editable = true }: PageFindDialogDialo
|
|||||||
|
|
||||||
const location = useLocation();
|
const location = useLocation();
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (pageFindState.isOpen) {
|
|
||||||
closeDialog();
|
closeDialog();
|
||||||
}
|
}, [location]);
|
||||||
}, [location.pathname]);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Dialog
|
<Dialog
|
||||||
|
|||||||
-205
@@ -1,205 +0,0 @@
|
|||||||
import { ActionIcon, Dialog, Flex, Text, Tooltip } from "@mantine/core";
|
|
||||||
import {
|
|
||||||
IconArrowNarrowDown,
|
|
||||||
IconArrowNarrowUp,
|
|
||||||
IconX,
|
|
||||||
} from "@tabler/icons-react";
|
|
||||||
import { useEditor } from "@tiptap/react";
|
|
||||||
import { isEditorReady } from "@docmost/editor-ext";
|
|
||||||
import React, { useCallback, useEffect, useRef, useState } from "react";
|
|
||||||
import classes from "./search-replace.module.css";
|
|
||||||
import { useTranslation } from "react-i18next";
|
|
||||||
import { useLocation, useNavigate } from "react-router-dom";
|
|
||||||
|
|
||||||
interface SearchNavigationDialogProps {
|
|
||||||
editor: ReturnType<typeof useEditor>;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface SearchNavigationEvent extends CustomEvent {
|
|
||||||
detail: {
|
|
||||||
searchTerms: string[];
|
|
||||||
wholeWord?: boolean;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function SearchNavigationDialog({ editor }: SearchNavigationDialogProps) {
|
|
||||||
const { t } = useTranslation();
|
|
||||||
const location = useLocation();
|
|
||||||
const navigate = useNavigate();
|
|
||||||
const [open, setOpen] = useState(false);
|
|
||||||
const openRef = useRef(false);
|
|
||||||
const [resultState, setResultState] = useState({
|
|
||||||
resultIndex: 0,
|
|
||||||
resultsLength: 0,
|
|
||||||
});
|
|
||||||
|
|
||||||
const goToSelection = () => {
|
|
||||||
if (!isEditorReady(editor)) return;
|
|
||||||
|
|
||||||
const { results, resultIndex } = editor.storage.searchAndReplace;
|
|
||||||
const position = results[resultIndex];
|
|
||||||
|
|
||||||
setResultState({
|
|
||||||
resultsLength: results.length,
|
|
||||||
resultIndex,
|
|
||||||
});
|
|
||||||
|
|
||||||
if (!position) return;
|
|
||||||
requestAnimationFrame(() => {
|
|
||||||
document
|
|
||||||
.querySelector(".search-result-current")
|
|
||||||
?.scrollIntoView({ behavior: "smooth", block: "center" });
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
const next = () => {
|
|
||||||
if (!isEditorReady(editor)) return;
|
|
||||||
editor.commands.nextSearchResult();
|
|
||||||
goToSelection();
|
|
||||||
};
|
|
||||||
|
|
||||||
const previous = () => {
|
|
||||||
if (!isEditorReady(editor)) return;
|
|
||||||
editor.commands.previousSearchResult();
|
|
||||||
goToSelection();
|
|
||||||
};
|
|
||||||
|
|
||||||
const close = useCallback(() => {
|
|
||||||
if (!openRef.current) return;
|
|
||||||
|
|
||||||
openRef.current = false;
|
|
||||||
setOpen(false);
|
|
||||||
if (isEditorReady(editor)) {
|
|
||||||
editor.commands.setSearchTerms([""]);
|
|
||||||
}
|
|
||||||
const nextParams = new URLSearchParams(location.search);
|
|
||||||
nextParams.delete("q");
|
|
||||||
nextParams.delete("m");
|
|
||||||
const nextSearch = nextParams.toString();
|
|
||||||
navigate(
|
|
||||||
{
|
|
||||||
pathname: location.pathname,
|
|
||||||
search: nextSearch ? `?${nextSearch}` : "",
|
|
||||||
hash: location.hash,
|
|
||||||
},
|
|
||||||
{ replace: true },
|
|
||||||
);
|
|
||||||
}, [editor, location.hash, location.pathname, location.search, navigate]);
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
const handleOpen = (event: Event) => {
|
|
||||||
const { searchTerms: terms, wholeWord = true } = (
|
|
||||||
event as SearchNavigationEvent
|
|
||||||
).detail;
|
|
||||||
|
|
||||||
if (!terms?.length || !isEditorReady(editor)) return;
|
|
||||||
|
|
||||||
openRef.current = false;
|
|
||||||
editor.commands.setSearchTerms(terms);
|
|
||||||
editor.commands.setWholeWord(wholeWord);
|
|
||||||
editor.commands.resetIndex();
|
|
||||||
|
|
||||||
const { results, resultIndex } = editor.storage.searchAndReplace;
|
|
||||||
openRef.current = true;
|
|
||||||
if (results.length === 0) {
|
|
||||||
close();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
setOpen(true);
|
|
||||||
setResultState({
|
|
||||||
resultIndex,
|
|
||||||
resultsLength: results.length,
|
|
||||||
});
|
|
||||||
|
|
||||||
goToSelection();
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleClose = () => {
|
|
||||||
if (openRef.current) {
|
|
||||||
close();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
document.addEventListener("openSearchNavigationDialog", handleOpen);
|
|
||||||
document.addEventListener("openFindDialogFromEditor", handleClose);
|
|
||||||
document.addEventListener("closeFindDialogFromEditor", handleClose);
|
|
||||||
|
|
||||||
return () => {
|
|
||||||
document.removeEventListener("openSearchNavigationDialog", handleOpen);
|
|
||||||
document.removeEventListener("openFindDialogFromEditor", handleClose);
|
|
||||||
document.removeEventListener("closeFindDialogFromEditor", handleClose);
|
|
||||||
};
|
|
||||||
}, [close, editor]);
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
const handleTransaction = () => {
|
|
||||||
if (!openRef.current || editor.isDestroyed) return;
|
|
||||||
|
|
||||||
const { results } = editor.storage.searchAndReplace;
|
|
||||||
if (results.length === 0) {
|
|
||||||
close();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
editor.on("transaction", handleTransaction);
|
|
||||||
return () => {
|
|
||||||
editor.off("transaction", handleTransaction);
|
|
||||||
};
|
|
||||||
}, [close, editor]);
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Dialog
|
|
||||||
className={classes.findDialog}
|
|
||||||
opened={open}
|
|
||||||
size="xs"
|
|
||||||
radius="md"
|
|
||||||
w="auto"
|
|
||||||
position={{ top: 90, right: 50 }}
|
|
||||||
withBorder
|
|
||||||
aria-label="Search navigation"
|
|
||||||
>
|
|
||||||
<Flex align="center" gap="xs">
|
|
||||||
<Text size="xs" style={{ flex: 1 }}>
|
|
||||||
{resultState.resultsLength > 0
|
|
||||||
? `${resultState.resultIndex + 1}/${resultState.resultsLength}`
|
|
||||||
: t("Not found")}
|
|
||||||
</Text>
|
|
||||||
<Tooltip label="Previous match">
|
|
||||||
<ActionIcon
|
|
||||||
variant="subtle"
|
|
||||||
color="gray"
|
|
||||||
onClick={previous}
|
|
||||||
aria-label="Previous match"
|
|
||||||
disabled={resultState.resultsLength === 0}
|
|
||||||
>
|
|
||||||
<IconArrowNarrowUp size={16} />
|
|
||||||
</ActionIcon>
|
|
||||||
</Tooltip>
|
|
||||||
<Tooltip label="Next match">
|
|
||||||
<ActionIcon
|
|
||||||
variant="subtle"
|
|
||||||
color="gray"
|
|
||||||
onClick={next}
|
|
||||||
aria-label="Next match"
|
|
||||||
disabled={resultState.resultsLength === 0}
|
|
||||||
>
|
|
||||||
<IconArrowNarrowDown size={16} />
|
|
||||||
</ActionIcon>
|
|
||||||
</Tooltip>
|
|
||||||
<Tooltip label="Close">
|
|
||||||
<ActionIcon
|
|
||||||
variant="subtle"
|
|
||||||
color="gray"
|
|
||||||
onClick={close}
|
|
||||||
aria-label="Close"
|
|
||||||
>
|
|
||||||
<IconX size={16} />
|
|
||||||
</ActionIcon>
|
|
||||||
</Tooltip>
|
|
||||||
</Flex>
|
|
||||||
</Dialog>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
export default SearchNavigationDialog;
|
|
||||||
-47
@@ -1,47 +0,0 @@
|
|||||||
import { useEffect, useRef } from "react";
|
|
||||||
import type { useEditor } from "@tiptap/react";
|
|
||||||
|
|
||||||
interface UseSearchNavigationParamsProps {
|
|
||||||
editor: ReturnType<typeof useEditor>;
|
|
||||||
isSynced: boolean;
|
|
||||||
pageId: string;
|
|
||||||
searchParams: URLSearchParams;
|
|
||||||
showStatic: boolean;
|
|
||||||
}
|
|
||||||
|
|
||||||
export function useSearchNavigationParams({
|
|
||||||
editor,
|
|
||||||
isSynced,
|
|
||||||
pageId,
|
|
||||||
searchParams,
|
|
||||||
showStatic,
|
|
||||||
}: UseSearchNavigationParamsProps) {
|
|
||||||
const appliedSearchKeyRef = useRef<string | null>(null);
|
|
||||||
const searchKey = `${pageId}:${searchParams.toString()}`;
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
const searchQueries = searchParams.getAll("q");
|
|
||||||
if (!searchQueries.length) {
|
|
||||||
appliedSearchKeyRef.current = null;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (
|
|
||||||
!editor ||
|
|
||||||
editor.isDestroyed ||
|
|
||||||
!editor.view.dom.isConnected ||
|
|
||||||
appliedSearchKeyRef.current === searchKey
|
|
||||||
) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const match = searchParams.get("m");
|
|
||||||
appliedSearchKeyRef.current = searchKey;
|
|
||||||
|
|
||||||
document.dispatchEvent(
|
|
||||||
new CustomEvent("openSearchNavigationDialog", {
|
|
||||||
detail: { searchTerms: searchQueries, wholeWord: match === "whole" },
|
|
||||||
}),
|
|
||||||
);
|
|
||||||
}, [editor, isSynced, searchKey, searchParams, showStatic]);
|
|
||||||
}
|
|
||||||
@@ -61,9 +61,6 @@ export const SubpagesMenu = React.memo(
|
|||||||
<BaseBubbleMenu
|
<BaseBubbleMenu
|
||||||
editor={editor}
|
editor={editor}
|
||||||
pluginKey={`subpages-menu`}
|
pluginKey={`subpages-menu`}
|
||||||
ref={(element) => {
|
|
||||||
if (element) element.style.zIndex = "99";
|
|
||||||
}}
|
|
||||||
updateDelay={0}
|
updateDelay={0}
|
||||||
shouldShow={shouldShow}
|
shouldShow={shouldShow}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -3,30 +3,22 @@ import { Stack, Text, Anchor, ActionIcon } from "@mantine/core";
|
|||||||
import { IconFileDescription } from "@tabler/icons-react";
|
import { IconFileDescription } from "@tabler/icons-react";
|
||||||
import { useGetSidebarPagesQuery } from "@/features/page/queries/page-query";
|
import { useGetSidebarPagesQuery } from "@/features/page/queries/page-query";
|
||||||
import { useMemo } from "react";
|
import { useMemo } from "react";
|
||||||
import { Link, useLocation, useParams } from "react-router-dom";
|
import { Link, useParams } from "react-router-dom";
|
||||||
import classes from "./subpages.module.css";
|
import classes from "./subpages.module.css";
|
||||||
import styles from "../mention/mention.module.css";
|
import styles from "../mention/mention.module.css";
|
||||||
import {
|
import {
|
||||||
buildPageUrl,
|
buildPageUrl,
|
||||||
buildPublicSpaceUrl,
|
|
||||||
buildSharedPageUrl,
|
buildSharedPageUrl,
|
||||||
} from "@/features/page/page.utils.ts";
|
} from "@/features/page/page.utils.ts";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { sortPositionKeys } from "@/features/page/tree/utils/utils";
|
import { sortPositionKeys } from "@/features/page/tree/utils/utils";
|
||||||
import { useSharedPageSubpages } from "@/features/share/hooks/use-shared-page-subpages";
|
import { useSharedPageSubpages } from "@/features/share/hooks/use-shared-page-subpages";
|
||||||
import { useAtomValue } from "jotai";
|
|
||||||
import { publicSpaceTreeDataAtom } from "@/features/public-space/atoms/public-space-atoms.ts";
|
|
||||||
import { findSubpagesInTree } from "@/features/share/utils";
|
|
||||||
import { extractPageSlugId } from "@/lib";
|
import { extractPageSlugId } from "@/lib";
|
||||||
|
|
||||||
export default function SubpagesView(props: NodeViewProps) {
|
export default function SubpagesView(props: NodeViewProps) {
|
||||||
const { editor } = props;
|
const { editor } = props;
|
||||||
const { spaceSlug, shareId, pageSlug } = useParams();
|
const { spaceSlug, shareId, pageSlug } = useParams();
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const location = useLocation();
|
|
||||||
const isPublicSpaceRoute = location.pathname.startsWith("/docs/");
|
|
||||||
|
|
||||||
const publicSpaceTreeData = useAtomValue(publicSpaceTreeDataAtom);
|
|
||||||
|
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
const storagePageId = editor.storage.pageId;
|
const storagePageId = editor.storage.pageId;
|
||||||
@@ -37,25 +29,11 @@ export default function SubpagesView(props: NodeViewProps) {
|
|||||||
currentPageId = routePageId;
|
currentPageId = routePageId;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Public docs must resolve the page from the route, not editor storage:
|
|
||||||
// storage.pageId is set after this view's first render and is not reactive,
|
|
||||||
// which froze the list at "No subpages" until something re-rendered it. The
|
|
||||||
// space home renders at the bare URL, so it falls back to the first root.
|
|
||||||
if (isPublicSpaceRoute) {
|
|
||||||
currentPageId = routePageId ?? publicSpaceTreeData?.[0]?.slugId;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Get subpages from shared tree if we're in a shared context
|
// Get subpages from shared tree if we're in a shared context
|
||||||
const sharedSubpages = useSharedPageSubpages(currentPageId);
|
const sharedSubpages = useSharedPageSubpages(currentPageId);
|
||||||
const publicSpaceSubpages = useMemo(
|
|
||||||
() => findSubpagesInTree(publicSpaceTreeData, currentPageId),
|
|
||||||
[publicSpaceTreeData, currentPageId],
|
|
||||||
);
|
|
||||||
|
|
||||||
const isPublicView = Boolean(shareId) || isPublicSpaceRoute;
|
|
||||||
|
|
||||||
const { data, isLoading, error } = useGetSidebarPagesQuery(
|
const { data, isLoading, error } = useGetSidebarPagesQuery(
|
||||||
isPublicView ? null : { pageId: currentPageId },
|
shareId ? null : { pageId: currentPageId },
|
||||||
);
|
);
|
||||||
|
|
||||||
const subpages = useMemo(() => {
|
const subpages = useMemo(() => {
|
||||||
@@ -70,33 +48,17 @@ export default function SubpagesView(props: NodeViewProps) {
|
|||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isPublicSpaceRoute) {
|
|
||||||
return publicSpaceSubpages.map((node) => ({
|
|
||||||
id: node.value,
|
|
||||||
slugId: node.slugId,
|
|
||||||
title: node.name,
|
|
||||||
icon: node.icon,
|
|
||||||
position: node.position,
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
|
|
||||||
// Otherwise use the API data
|
// Otherwise use the API data
|
||||||
if (!data?.pages) return [];
|
if (!data?.pages) return [];
|
||||||
const allPages = data.pages.flatMap((page) => page.items);
|
const allPages = data.pages.flatMap((page) => page.items);
|
||||||
return sortPositionKeys(allPages);
|
return sortPositionKeys(allPages);
|
||||||
}, [
|
}, [data, shareId, sharedSubpages]);
|
||||||
data,
|
|
||||||
shareId,
|
|
||||||
sharedSubpages,
|
|
||||||
isPublicSpaceRoute,
|
|
||||||
publicSpaceSubpages,
|
|
||||||
]);
|
|
||||||
|
|
||||||
if (isLoading && !isPublicView) {
|
if (isLoading && !shareId) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (error && !isPublicView) {
|
if (error && !shareId) {
|
||||||
return (
|
return (
|
||||||
<NodeViewWrapper data-drag-handle>
|
<NodeViewWrapper data-drag-handle>
|
||||||
<Text c="dimmed" size="md" py="md">
|
<Text c="dimmed" size="md" py="md">
|
||||||
@@ -134,12 +96,6 @@ export default function SubpagesView(props: NodeViewProps) {
|
|||||||
pageSlugId: page.slugId,
|
pageSlugId: page.slugId,
|
||||||
pageTitle: page.title,
|
pageTitle: page.title,
|
||||||
})
|
})
|
||||||
: isPublicSpaceRoute
|
|
||||||
? buildPublicSpaceUrl({
|
|
||||||
spaceSlug,
|
|
||||||
pageSlugId: page.slugId,
|
|
||||||
pageTitle: page.title,
|
|
||||||
})
|
|
||||||
: buildPageUrl(spaceSlug, page.slugId, page.title)
|
: buildPageUrl(spaceSlug, page.slugId, page.title)
|
||||||
}
|
}
|
||||||
underline="never"
|
underline="never"
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ export type HeadingLink = {
|
|||||||
position: number;
|
position: number;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const recalculateLinks = (nodePos: NodePos[]) => {
|
const recalculateLinks = (nodePos: NodePos[]) => {
|
||||||
const nodes: HTMLElement[] = [];
|
const nodes: HTMLElement[] = [];
|
||||||
|
|
||||||
const links: HeadingLink[] = Array.from(nodePos).reduce<HeadingLink[]>(
|
const links: HeadingLink[] = Array.from(nodePos).reduce<HeadingLink[]>(
|
||||||
|
|||||||
-15
@@ -9,7 +9,6 @@ import React, {
|
|||||||
} from "react";
|
} from "react";
|
||||||
import {
|
import {
|
||||||
lookupTransclusion,
|
lookupTransclusion,
|
||||||
lookupTransclusionForPublicSpace,
|
|
||||||
lookupTransclusionForShare,
|
lookupTransclusionForShare,
|
||||||
} from "@/features/transclusion/services/transclusion-api";
|
} from "@/features/transclusion/services/transclusion-api";
|
||||||
import type { TransclusionLookup } from "@/features/transclusion/types/transclusion.types";
|
import type { TransclusionLookup } from "@/features/transclusion/types/transclusion.types";
|
||||||
@@ -39,7 +38,6 @@ const TransclusionLookupContext = createContext<ContextValue | null>(null);
|
|||||||
export function TransclusionLookupProvider({
|
export function TransclusionLookupProvider({
|
||||||
children,
|
children,
|
||||||
shareId,
|
shareId,
|
||||||
spaceSlug,
|
|
||||||
}: {
|
}: {
|
||||||
children: React.ReactNode;
|
children: React.ReactNode;
|
||||||
/**
|
/**
|
||||||
@@ -49,11 +47,6 @@ export function TransclusionLookupProvider({
|
|||||||
* app, where personal permissions gate access.
|
* app, where personal permissions gate access.
|
||||||
*/
|
*/
|
||||||
shareId?: string;
|
shareId?: string;
|
||||||
/**
|
|
||||||
* When set, lookups go through the public-space endpoint and are gated by
|
|
||||||
* the published space. Used by the public docs viewer.
|
|
||||||
*/
|
|
||||||
spaceSlug?: string;
|
|
||||||
}) {
|
}) {
|
||||||
const subscribersRef = useRef(new Map<LookupKey, Subscriber[]>());
|
const subscribersRef = useRef(new Map<LookupKey, Subscriber[]>());
|
||||||
const queueRef = useRef(new Set<LookupKey>());
|
const queueRef = useRef(new Set<LookupKey>());
|
||||||
@@ -62,8 +55,6 @@ export function TransclusionLookupProvider({
|
|||||||
// memoized callbacks (and thus doesn't re-render every consumer).
|
// memoized callbacks (and thus doesn't re-render every consumer).
|
||||||
const shareIdRef = useRef<string | undefined>(shareId);
|
const shareIdRef = useRef<string | undefined>(shareId);
|
||||||
shareIdRef.current = shareId;
|
shareIdRef.current = shareId;
|
||||||
const spaceSlugRef = useRef<string | undefined>(spaceSlug);
|
|
||||||
spaceSlugRef.current = spaceSlug;
|
|
||||||
// Last looked-up value for each key. Re-subscribers (e.g. when the editor
|
// Last looked-up value for each key. Re-subscribers (e.g. when the editor
|
||||||
// remounts after switching from static to live) get this immediately
|
// remounts after switching from static to live) get this immediately
|
||||||
// instead of triggering a duplicate fetch.
|
// instead of triggering a duplicate fetch.
|
||||||
@@ -100,17 +91,11 @@ export function TransclusionLookupProvider({
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
const activeShareId = shareIdRef.current;
|
const activeShareId = shareIdRef.current;
|
||||||
const activeSpaceSlug = spaceSlugRef.current;
|
|
||||||
const { items } = activeShareId
|
const { items } = activeShareId
|
||||||
? await lookupTransclusionForShare({
|
? await lookupTransclusionForShare({
|
||||||
shareId: activeShareId,
|
shareId: activeShareId,
|
||||||
references,
|
references,
|
||||||
})
|
})
|
||||||
: activeSpaceSlug
|
|
||||||
? await lookupTransclusionForPublicSpace({
|
|
||||||
spaceSlug: activeSpaceSlug,
|
|
||||||
references,
|
|
||||||
})
|
|
||||||
: await lookupTransclusion({ references });
|
: await lookupTransclusion({ references });
|
||||||
for (const r of items) {
|
for (const r of items) {
|
||||||
const key = `${r.sourcePageId}::${r.transclusionId}`;
|
const key = `${r.sourcePageId}::${r.transclusionId}`;
|
||||||
|
|||||||
@@ -132,9 +132,6 @@ export function VideoMenu({ editor }: EditorMenuProps) {
|
|||||||
<BaseBubbleMenu
|
<BaseBubbleMenu
|
||||||
editor={editor}
|
editor={editor}
|
||||||
pluginKey={`video-menu`}
|
pluginKey={`video-menu`}
|
||||||
ref={(element) => {
|
|
||||||
if (element) element.style.zIndex = "99";
|
|
||||||
}}
|
|
||||||
updateDelay={0}
|
updateDelay={0}
|
||||||
getReferencedVirtualElement={getReferencedVirtualElement}
|
getReferencedVirtualElement={getReferencedVirtualElement}
|
||||||
options={{
|
options={{
|
||||||
|
|||||||
@@ -1,112 +0,0 @@
|
|||||||
import { Editor, Node } from "@tiptap/core";
|
|
||||||
import { GapCursor } from "@tiptap/pm/gapcursor";
|
|
||||||
import { NodeSelection, TextSelection } from "@tiptap/pm/state";
|
|
||||||
import { StarterKit } from "@tiptap/starter-kit";
|
|
||||||
import { describe, expect, it } from "vitest";
|
|
||||||
import { TiptapDocument } from "./document";
|
|
||||||
|
|
||||||
const Footnotes = Node.create({
|
|
||||||
name: "footnotes",
|
|
||||||
group: "",
|
|
||||||
content: "paragraph*",
|
|
||||||
isolating: true,
|
|
||||||
renderHTML() {
|
|
||||||
return ["ol", { class: "footnotes" }, 0];
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
const AtomBlock = Node.create({
|
|
||||||
name: "atomBlock",
|
|
||||||
group: "block",
|
|
||||||
atom: true,
|
|
||||||
renderHTML() {
|
|
||||||
return ["div", { "data-atom-block": "" }];
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
const IsolatingBlock = Node.create({
|
|
||||||
name: "isolatingBlock",
|
|
||||||
group: "block",
|
|
||||||
content: "paragraph+",
|
|
||||||
isolating: true,
|
|
||||||
renderHTML() {
|
|
||||||
return ["div", { "data-isolating-block": "" }, 0];
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
function createEditor(content: object[]) {
|
|
||||||
const element = document.createElement("div");
|
|
||||||
document.body.appendChild(element);
|
|
||||||
|
|
||||||
return new Editor({
|
|
||||||
element,
|
|
||||||
extensions: [
|
|
||||||
TiptapDocument,
|
|
||||||
StarterKit.configure({ document: false }),
|
|
||||||
Footnotes,
|
|
||||||
AtomBlock,
|
|
||||||
IsolatingBlock,
|
|
||||||
],
|
|
||||||
content: { type: "doc", content },
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function pressKey(editor: Editor, key: string, keyCode: number) {
|
|
||||||
editor.view.dom.dispatchEvent(
|
|
||||||
new KeyboardEvent("keydown", {
|
|
||||||
key,
|
|
||||||
keyCode,
|
|
||||||
bubbles: true,
|
|
||||||
cancelable: true,
|
|
||||||
}),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
describe("TiptapDocument", () => {
|
|
||||||
it("stops on the gap when arrowing down from a selected block node", () => {
|
|
||||||
const editor = createEditor([
|
|
||||||
{ type: "atomBlock" },
|
|
||||||
{ type: "atomBlock" },
|
|
||||||
{ type: "paragraph" },
|
|
||||||
]);
|
|
||||||
const gapPos = editor.state.doc.child(0).nodeSize;
|
|
||||||
editor.view.dispatch(
|
|
||||||
editor.state.tr.setSelection(
|
|
||||||
NodeSelection.create(editor.state.doc, 0),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
|
|
||||||
pressKey(editor, "ArrowDown", 40);
|
|
||||||
|
|
||||||
expect(editor.state.selection).toBeInstanceOf(GapCursor);
|
|
||||||
expect(editor.state.selection.head).toBe(gapPos);
|
|
||||||
|
|
||||||
editor.destroy();
|
|
||||||
});
|
|
||||||
|
|
||||||
it("stops on the gap when arrowing right out of an isolating block", () => {
|
|
||||||
const paragraph = (text: string) => ({
|
|
||||||
type: "paragraph",
|
|
||||||
content: [{ type: "text", text }],
|
|
||||||
});
|
|
||||||
const editor = createEditor([
|
|
||||||
{ type: "isolatingBlock", content: [paragraph("a")] },
|
|
||||||
{ type: "isolatingBlock", content: [paragraph("b")] },
|
|
||||||
{ type: "paragraph" },
|
|
||||||
]);
|
|
||||||
const gapPos = editor.state.doc.child(0).nodeSize;
|
|
||||||
const endOfFirstText = gapPos - 2;
|
|
||||||
editor.view.dispatch(
|
|
||||||
editor.state.tr.setSelection(
|
|
||||||
TextSelection.create(editor.state.doc, endOfFirstText),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
|
|
||||||
pressKey(editor, "ArrowRight", 39);
|
|
||||||
|
|
||||||
expect(editor.state.selection).toBeInstanceOf(GapCursor);
|
|
||||||
expect(editor.state.selection.head).toBe(gapPos);
|
|
||||||
|
|
||||||
editor.destroy();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
import { Document } from "@tiptap/extension-document";
|
|
||||||
|
|
||||||
// With `block+ footnotes?`, ProseMirror's defaultType after the first block is
|
|
||||||
// `footnotes` (not a textblock), so GapCursor.valid() rejects every top-level gap.
|
|
||||||
export const TiptapDocument = Document.extend({
|
|
||||||
content: "block+ footnotes?",
|
|
||||||
allowGapCursor: true,
|
|
||||||
});
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
import { markInputRule } from "@tiptap/core";
|
import { markInputRule } from "@tiptap/core";
|
||||||
import { StarterKit } from "@tiptap/starter-kit";
|
import { StarterKit } from "@tiptap/starter-kit";
|
||||||
import { TiptapDocument } from "@/features/editor/extensions/document";
|
import { Document } from "@tiptap/extension-document";
|
||||||
import { Code } from "@tiptap/extension-code";
|
import { Code } from "@tiptap/extension-code";
|
||||||
import { TextAlign } from "@tiptap/extension-text-align";
|
import { TextAlign } from "@tiptap/extension-text-align";
|
||||||
import { TaskList, TaskItem } from "@tiptap/extension-list";
|
import { TaskList, TaskItem } from "@tiptap/extension-list";
|
||||||
@@ -148,7 +148,9 @@ export const mainExtensions = [
|
|||||||
codeBlock: false,
|
codeBlock: false,
|
||||||
code: false,
|
code: false,
|
||||||
}),
|
}),
|
||||||
TiptapDocument,
|
Document.extend({
|
||||||
|
content: "block+ footnotes?",
|
||||||
|
}),
|
||||||
// Override TipTap's Code extension to fix the inline code input rule.
|
// Override TipTap's Code extension to fix the inline code input rule.
|
||||||
// The upstream regex /(^|[^`])`([^`]+)`(?!`)$/ captures the character
|
// The upstream regex /(^|[^`])`([^`]+)`(?!`)$/ captures the character
|
||||||
// before the opening backtick as part of the match, causing markInputRule
|
// before the opening backtick as part of the match, causing markInputRule
|
||||||
|
|||||||
@@ -65,13 +65,11 @@ import ExcalidrawMenu from "./components/excalidraw/excalidraw-menu-lazy";
|
|||||||
import DrawioMenu from "./components/drawio/drawio-menu";
|
import DrawioMenu from "./components/drawio/drawio-menu";
|
||||||
import { useCollabToken } from "@/features/auth/queries/auth-query.tsx";
|
import { useCollabToken } from "@/features/auth/queries/auth-query.tsx";
|
||||||
import SearchAndReplaceDialog from "@/features/editor/components/search-and-replace/search-and-replace-dialog.tsx";
|
import SearchAndReplaceDialog from "@/features/editor/components/search-and-replace/search-and-replace-dialog.tsx";
|
||||||
import SearchNavigationDialog from "@/features/editor/components/search-and-replace/search-navigation-dialog.tsx";
|
|
||||||
import { useSearchNavigationParams } from "@/features/editor/components/search-and-replace/use-search-navigation-params.ts";
|
|
||||||
import { useDebouncedCallback, useDocumentVisibility } from "@mantine/hooks";
|
import { useDebouncedCallback, useDocumentVisibility } from "@mantine/hooks";
|
||||||
import { useIdle } from "@/hooks/use-idle.ts";
|
import { useIdle } from "@/hooks/use-idle.ts";
|
||||||
import { queryClient } from "@/main.tsx";
|
import { queryClient } from "@/main.tsx";
|
||||||
import { IPage } from "@/features/page/types/page.types.ts";
|
import { IPage } from "@/features/page/types/page.types.ts";
|
||||||
import { useParams, useSearchParams } from "react-router-dom";
|
import { useParams } from "react-router-dom";
|
||||||
import { extractPageSlugId, platformModifierKey } from "@/lib";
|
import { extractPageSlugId, platformModifierKey } from "@/lib";
|
||||||
import { FIVE_MINUTES } from "@/lib/constants.ts";
|
import { FIVE_MINUTES } from "@/lib/constants.ts";
|
||||||
import { PageEditMode } from "@/features/user/types/user.types.ts";
|
import { PageEditMode } from "@/features/user/types/user.types.ts";
|
||||||
@@ -201,7 +199,6 @@ function CollabPageEditor({
|
|||||||
const { isIdle, resetIdle } = useIdle(FIVE_MINUTES, { initialState: false });
|
const { isIdle, resetIdle } = useIdle(FIVE_MINUTES, { initialState: false });
|
||||||
const documentState = useDocumentVisibility();
|
const documentState = useDocumentVisibility();
|
||||||
const { pageSlug } = useParams();
|
const { pageSlug } = useParams();
|
||||||
const [searchParams] = useSearchParams();
|
|
||||||
const slugId = extractPageSlugId(pageSlug);
|
const slugId = extractPageSlugId(pageSlug);
|
||||||
const currentPageEditMode = useAtomValue(currentPageEditModeAtom);
|
const currentPageEditMode = useAtomValue(currentPageEditModeAtom);
|
||||||
const canScroll = useCallback(
|
const canScroll = useCallback(
|
||||||
@@ -440,14 +437,6 @@ function CollabPageEditor({
|
|||||||
const hasConnectedOnceRef = useRef(false);
|
const hasConnectedOnceRef = useRef(false);
|
||||||
const [showStatic, setShowStatic] = useState(true);
|
const [showStatic, setShowStatic] = useState(true);
|
||||||
|
|
||||||
useSearchNavigationParams({
|
|
||||||
editor,
|
|
||||||
isSynced,
|
|
||||||
pageId,
|
|
||||||
searchParams,
|
|
||||||
showStatic,
|
|
||||||
});
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (
|
if (
|
||||||
!hasConnectedOnceRef.current &&
|
!hasConnectedOnceRef.current &&
|
||||||
@@ -471,7 +460,6 @@ function CollabPageEditor({
|
|||||||
{editor && (
|
{editor && (
|
||||||
<SearchAndReplaceDialog editor={editor} editable={editable} />
|
<SearchAndReplaceDialog editor={editor} editable={editable} />
|
||||||
)}
|
)}
|
||||||
{editor && <SearchNavigationDialog editor={editor} />}
|
|
||||||
|
|
||||||
{editor && editorIsEditable && (
|
{editor && editorIsEditable && (
|
||||||
<div>
|
<div>
|
||||||
|
|||||||
@@ -35,16 +35,6 @@ interface PageEditorProps {
|
|||||||
* that isn't itself shared.
|
* that isn't itself shared.
|
||||||
*/
|
*/
|
||||||
shareId?: string;
|
shareId?: string;
|
||||||
/**
|
|
||||||
* When rendering inside a public space, pass the space slug. Transclusion
|
|
||||||
* lookups then resolve against the published space instead of the viewer's
|
|
||||||
* personal permissions.
|
|
||||||
*/
|
|
||||||
spaceSlug?: string;
|
|
||||||
/** Rendered between the title and the content. */
|
|
||||||
byline?: React.ReactNode;
|
|
||||||
/** Set false when the consumer renders its own end matter (e.g. prev/next). */
|
|
||||||
trailingSpace?: boolean;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function ReadonlyPageEditor({
|
export default function ReadonlyPageEditor({
|
||||||
@@ -53,16 +43,12 @@ export default function ReadonlyPageEditor({
|
|||||||
pageId,
|
pageId,
|
||||||
printMode = false,
|
printMode = false,
|
||||||
shareId,
|
shareId,
|
||||||
spaceSlug,
|
|
||||||
byline,
|
|
||||||
trailingSpace = true,
|
|
||||||
}: PageEditorProps) {
|
}: PageEditorProps) {
|
||||||
const [, setReadOnlyEditor] = useAtom(readOnlyEditorAtom);
|
const [, setReadOnlyEditor] = useAtom(readOnlyEditorAtom);
|
||||||
const [lightboxRequest, setLightboxRequest] = useAtom(lightboxRequestAtom);
|
const [lightboxRequest, setLightboxRequest] = useAtom(lightboxRequestAtom);
|
||||||
const [contentEditor, setContentEditor] = useState<Editor | null>(null);
|
const [contentEditor, setContentEditor] = useState<Editor | null>(null);
|
||||||
const isComponentMounted = useRef(false);
|
const isComponentMounted = useRef(false);
|
||||||
const editorCreated = useRef(false);
|
const editorCreated = useRef(false);
|
||||||
const isPublicView = Boolean(shareId || spaceSlug);
|
|
||||||
|
|
||||||
const canScroll = useCallback(
|
const canScroll = useCallback(
|
||||||
() => isComponentMounted.current && editorCreated.current,
|
() => isComponentMounted.current && editorCreated.current,
|
||||||
@@ -78,9 +64,9 @@ export default function ReadonlyPageEditor({
|
|||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!isPublicView) return;
|
if (!shareId) return;
|
||||||
setLightboxRequest(null);
|
setLightboxRequest(null);
|
||||||
}, [pageId, isPublicView]);
|
}, [pageId, shareId]);
|
||||||
|
|
||||||
const extensions = useMemo(() => {
|
const extensions = useMemo(() => {
|
||||||
const excludedExtensions = new Set([
|
const excludedExtensions = new Set([
|
||||||
@@ -113,7 +99,7 @@ export default function ReadonlyPageEditor({
|
|||||||
];
|
];
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<TransclusionLookupProvider shareId={shareId} spaceSlug={spaceSlug}>
|
<TransclusionLookupProvider shareId={shareId}>
|
||||||
<div className="page-title">
|
<div className="page-title">
|
||||||
<EditorProvider
|
<EditorProvider
|
||||||
editable={false}
|
editable={false}
|
||||||
@@ -124,8 +110,6 @@ export default function ReadonlyPageEditor({
|
|||||||
></EditorProvider>
|
></EditorProvider>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{byline}
|
|
||||||
|
|
||||||
<EditorProvider
|
<EditorProvider
|
||||||
editable={false}
|
editable={false}
|
||||||
immediatelyRender={true}
|
immediatelyRender={true}
|
||||||
@@ -133,7 +117,7 @@ export default function ReadonlyPageEditor({
|
|||||||
extensions={extensions}
|
extensions={extensions}
|
||||||
content={content}
|
content={content}
|
||||||
editorProps={
|
editorProps={
|
||||||
isPublicView
|
shareId
|
||||||
? {
|
? {
|
||||||
handleClickOn: (_view, _pos, node) => {
|
handleClickOn: (_view, _pos, node) => {
|
||||||
const request = getLightboxClickRequest(node);
|
const request = getLightboxClickRequest(node);
|
||||||
@@ -160,7 +144,7 @@ export default function ReadonlyPageEditor({
|
|||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
></EditorProvider>
|
></EditorProvider>
|
||||||
{isPublicView && contentEditor && (
|
{shareId && contentEditor && (
|
||||||
<LightboxView
|
<LightboxView
|
||||||
editor={contentEditor}
|
editor={contentEditor}
|
||||||
open={!!lightboxRequest}
|
open={!!lightboxRequest}
|
||||||
@@ -169,7 +153,7 @@ export default function ReadonlyPageEditor({
|
|||||||
onClose={() => setLightboxRequest(null)}
|
onClose={() => setLightboxRequest(null)}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
{trailingSpace && <div style={{ paddingBottom: "20vh" }}></div>}
|
<div style={{ paddingBottom: "20vh" }}></div>
|
||||||
</TransclusionLookupProvider>
|
</TransclusionLookupProvider>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,19 +12,13 @@ import useUserRole from "@/hooks/use-user-role.tsx";
|
|||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { IUser } from "@/features/user/types/user.types.ts";
|
import { IUser } from "@/features/user/types/user.types.ts";
|
||||||
import Paginate from "@/components/common/paginate.tsx";
|
import Paginate from "@/components/common/paginate.tsx";
|
||||||
import { SearchInput } from "@/components/common/search-input.tsx";
|
import { useCursorPaginate } from "@/hooks/use-cursor-paginate";
|
||||||
import NoTableResults from "@/components/common/no-table-results.tsx";
|
|
||||||
import { usePaginateAndSearch } from "@/hooks/use-paginate-and-search.tsx";
|
|
||||||
|
|
||||||
export default function GroupMembersList() {
|
export default function GroupMembersList() {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const { groupId } = useParams();
|
const { groupId } = useParams();
|
||||||
const { search, cursor, goNext, goPrev, handleSearch } =
|
const { cursor, goNext, goPrev } = useCursorPaginate();
|
||||||
usePaginateAndSearch();
|
const { data, isLoading } = useGroupMembersQuery(groupId, { cursor });
|
||||||
const { data, isLoading } = useGroupMembersQuery(groupId, {
|
|
||||||
cursor,
|
|
||||||
query: search,
|
|
||||||
});
|
|
||||||
const removeGroupMember = useRemoveGroupMemberMutation();
|
const removeGroupMember = useRemoveGroupMemberMutation();
|
||||||
const { isAdmin } = useUserRole();
|
const { isAdmin } = useUserRole();
|
||||||
|
|
||||||
@@ -54,7 +48,6 @@ export default function GroupMembersList() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<SearchInput onSearch={handleSearch} />
|
|
||||||
<Table.ScrollContainer minWidth={500}>
|
<Table.ScrollContainer minWidth={500}>
|
||||||
<Table highlightOnHover verticalSpacing="sm">
|
<Table highlightOnHover verticalSpacing="sm">
|
||||||
<Table.Thead>
|
<Table.Thead>
|
||||||
@@ -66,15 +59,11 @@ export default function GroupMembersList() {
|
|||||||
</Table.Thead>
|
</Table.Thead>
|
||||||
|
|
||||||
<Table.Tbody>
|
<Table.Tbody>
|
||||||
{data?.items.length > 0 ? (
|
{data?.items.map((user: IUser, index: number) => (
|
||||||
data?.items.map((user: IUser, index: number) => (
|
|
||||||
<Table.Tr key={index}>
|
<Table.Tr key={index}>
|
||||||
<Table.Td>
|
<Table.Td>
|
||||||
<Group gap="sm" wrap="nowrap">
|
<Group gap="sm" wrap="nowrap">
|
||||||
<CustomAvatar
|
<CustomAvatar avatarUrl={user.avatarUrl} name={user.name} />
|
||||||
avatarUrl={user.avatarUrl}
|
|
||||||
name={user.name}
|
|
||||||
/>
|
|
||||||
<div>
|
<div>
|
||||||
<Text fz="sm" fw={500} lineClamp={1}>
|
<Text fz="sm" fw={500} lineClamp={1}>
|
||||||
{user.name}
|
{user.name}
|
||||||
@@ -118,10 +107,7 @@ export default function GroupMembersList() {
|
|||||||
)}
|
)}
|
||||||
</Table.Td>
|
</Table.Td>
|
||||||
</Table.Tr>
|
</Table.Tr>
|
||||||
))
|
))}
|
||||||
) : (
|
|
||||||
<NoTableResults colSpan={3} />
|
|
||||||
)}
|
|
||||||
</Table.Tbody>
|
</Table.Tbody>
|
||||||
</Table>
|
</Table>
|
||||||
</Table.ScrollContainer>
|
</Table.ScrollContainer>
|
||||||
|
|||||||
@@ -63,12 +63,6 @@ export function NotificationItem({
|
|||||||
return "Page verification expires soon";
|
return "Page verification expires soon";
|
||||||
case "page.verification_expired":
|
case "page.verification_expired":
|
||||||
return "Page verification has expired";
|
return "Page verification has expired";
|
||||||
case "siem_destination.failing":
|
|
||||||
return "SIEM destination <bold>{{name}}</bold> is failing";
|
|
||||||
case "siem_destination.disabled":
|
|
||||||
return "SIEM destination <bold>{{name}}</bold> was disabled after 24 hours of failures";
|
|
||||||
case "siem_destination.recovered":
|
|
||||||
return "SIEM destination <bold>{{name}}</bold> recovered";
|
|
||||||
default:
|
default:
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
@@ -83,19 +77,6 @@ export function NotificationItem({
|
|||||||
)
|
)
|
||||||
: undefined;
|
: undefined;
|
||||||
|
|
||||||
const isSiemDestination = notification.type.startsWith("siem_destination.");
|
|
||||||
const destinationName =
|
|
||||||
typeof notification.data?.destinationName === "string"
|
|
||||||
? notification.data.destinationName
|
|
||||||
: "";
|
|
||||||
const lastError =
|
|
||||||
(notification.type === "siem_destination.failing" ||
|
|
||||||
notification.type === "siem_destination.disabled") &&
|
|
||||||
typeof notification.data?.lastError === "string"
|
|
||||||
? notification.data.lastError
|
|
||||||
: null;
|
|
||||||
const linkUrl = isSiemDestination ? "/settings/audit/siem" : pageUrl;
|
|
||||||
|
|
||||||
const markReadIfNeeded = () => {
|
const markReadIfNeeded = () => {
|
||||||
if (isUnread) {
|
if (isUnread) {
|
||||||
markRead.mutate([notification.id]);
|
markRead.mutate([notification.id]);
|
||||||
@@ -116,7 +97,7 @@ export function NotificationItem({
|
|||||||
return (
|
return (
|
||||||
<UnstyledButton
|
<UnstyledButton
|
||||||
component={Link}
|
component={Link}
|
||||||
to={linkUrl ?? ""}
|
to={pageUrl ?? ""}
|
||||||
onClick={handleClick}
|
onClick={handleClick}
|
||||||
// auxclick fires for all non-primary buttons; guard to middle-click only (button 1)
|
// auxclick fires for all non-primary buttons; guard to middle-click only (button 1)
|
||||||
// so that right-click (button 2, context menu) does not mark as read
|
// so that right-click (button 2, context menu) does not mark as read
|
||||||
@@ -143,21 +124,11 @@ export function NotificationItem({
|
|||||||
<Text size="sm" lineClamp={2}>
|
<Text size="sm" lineClamp={2}>
|
||||||
<Trans
|
<Trans
|
||||||
i18nKey={getNotificationMessageKey()}
|
i18nKey={getNotificationMessageKey()}
|
||||||
values={{
|
values={{ name: notification.actor?.name }}
|
||||||
name: isSiemDestination
|
|
||||||
? destinationName
|
|
||||||
: notification.actor?.name,
|
|
||||||
}}
|
|
||||||
components={{ bold: <Text span fw={600} /> }}
|
components={{ bold: <Text span fw={600} /> }}
|
||||||
/>
|
/>
|
||||||
</Text>
|
</Text>
|
||||||
|
|
||||||
{lastError && (
|
|
||||||
<Text size="xs" c="dimmed" lineClamp={1} mt={2}>
|
|
||||||
{lastError}
|
|
||||||
</Text>
|
|
||||||
)}
|
|
||||||
|
|
||||||
{notification.page && (
|
{notification.page && (
|
||||||
<Group gap={4} mt={2} wrap="nowrap">
|
<Group gap={4} mt={2} wrap="nowrap">
|
||||||
{notification.page.icon ? (
|
{notification.page.icon ? (
|
||||||
|
|||||||
@@ -9,10 +9,7 @@ export type NotificationType =
|
|||||||
| "page.verification_expired"
|
| "page.verification_expired"
|
||||||
| "page.verified"
|
| "page.verified"
|
||||||
| "page.approval_requested"
|
| "page.approval_requested"
|
||||||
| "page.approval_rejected"
|
| "page.approval_rejected";
|
||||||
| "siem_destination.failing"
|
|
||||||
| "siem_destination.disabled"
|
|
||||||
| "siem_destination.recovered";
|
|
||||||
|
|
||||||
export type INotification = {
|
export type INotification = {
|
||||||
id: string;
|
id: string;
|
||||||
|
|||||||
@@ -1,64 +1,17 @@
|
|||||||
import classes from "./page-header.module.css";
|
import classes from "./page-header.module.css";
|
||||||
import PageHeaderMenu from "@/features/page/components/header/page-header-menu.tsx";
|
import PageHeaderMenu from "@/features/page/components/header/page-header-menu.tsx";
|
||||||
import { Badge, Group, Tooltip } from "@mantine/core";
|
import { Group } from "@mantine/core";
|
||||||
import { IconExternalLink, IconWorld } from "@tabler/icons-react";
|
|
||||||
import Breadcrumb from "@/features/page/components/breadcrumbs/breadcrumb.tsx";
|
import Breadcrumb from "@/features/page/components/breadcrumbs/breadcrumb.tsx";
|
||||||
import { useParams } from "react-router-dom";
|
|
||||||
import { useTranslation } from "react-i18next";
|
|
||||||
import { useGetSpaceBySlugQuery } from "@/features/space/queries/space-query.ts";
|
|
||||||
import { usePageQuery } from "@/features/page/queries/page-query.ts";
|
|
||||||
import { extractPageSlugId } from "@/lib";
|
|
||||||
import { buildPublicSpaceUrl } from "@/features/page/page.utils.ts";
|
|
||||||
import { isBetaPublicSpaces } from "@/lib/config.ts";
|
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
readOnly?: boolean;
|
readOnly?: boolean;
|
||||||
}
|
}
|
||||||
export default function PageHeader({ readOnly }: Props) {
|
export default function PageHeader({ readOnly }: Props) {
|
||||||
const { t } = useTranslation();
|
|
||||||
const { spaceSlug, pageSlug } = useParams();
|
|
||||||
const { data: space } = useGetSpaceBySlugQuery(spaceSlug);
|
|
||||||
const { data: page } = usePageQuery({
|
|
||||||
pageId: extractPageSlugId(pageSlug),
|
|
||||||
});
|
|
||||||
|
|
||||||
// Restricted pages are never publicly reachable, so the chip only shows on
|
|
||||||
// pages the public site actually serves.
|
|
||||||
const showPublicBadge =
|
|
||||||
isBetaPublicSpaces() &&
|
|
||||||
space?.isPublished &&
|
|
||||||
page &&
|
|
||||||
page.permissions?.hasRestriction !== true;
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={classes.header} data-page-header="true">
|
<div className={classes.header} data-page-header="true">
|
||||||
<Group justify="space-between" h="100%" px="md" wrap="nowrap" className={classes.group}>
|
<Group justify="space-between" h="100%" px="md" wrap="nowrap" className={classes.group}>
|
||||||
<Group gap="xs" wrap="nowrap" style={{ minWidth: 0 }}>
|
|
||||||
<Breadcrumb />
|
<Breadcrumb />
|
||||||
|
|
||||||
{showPublicBadge && (
|
|
||||||
<Tooltip label={t("Open public page")} openDelay={250} withArrow>
|
|
||||||
<Badge
|
|
||||||
component="a"
|
|
||||||
href={buildPublicSpaceUrl({
|
|
||||||
spaceSlug: space.slug,
|
|
||||||
pageSlugId: page.slugId,
|
|
||||||
pageTitle: page.title,
|
|
||||||
})}
|
|
||||||
target="_blank"
|
|
||||||
rel="noopener"
|
|
||||||
size="sm"
|
|
||||||
variant="light"
|
|
||||||
leftSection={<IconWorld size={12} />}
|
|
||||||
rightSection={<IconExternalLink size={11} />}
|
|
||||||
style={{ flexShrink: 0, cursor: "pointer" }}
|
|
||||||
>
|
|
||||||
{t("Public")}
|
|
||||||
</Badge>
|
|
||||||
</Tooltip>
|
|
||||||
)}
|
|
||||||
</Group>
|
|
||||||
|
|
||||||
<Group justify="flex-end" h="100%" px="md" wrap="nowrap" gap="var(--mantine-spacing-xs)">
|
<Group justify="flex-end" h="100%" px="md" wrap="nowrap" gap="var(--mantine-spacing-xs)">
|
||||||
<PageHeaderMenu readOnly={readOnly} />
|
<PageHeaderMenu readOnly={readOnly} />
|
||||||
</Group>
|
</Group>
|
||||||
|
|||||||
@@ -25,37 +25,11 @@ const buildPageSlug = (pageSlugId: string, pageTitle?: string): string => {
|
|||||||
return `${titleSlug}-${pageSlugId}`;
|
return `${titleSlug}-${pageSlugId}`;
|
||||||
};
|
};
|
||||||
|
|
||||||
function appendSearchParams(
|
|
||||||
url: string,
|
|
||||||
search?: string[],
|
|
||||||
wholeWord?: boolean,
|
|
||||||
): string {
|
|
||||||
if(search?.length === 0){
|
|
||||||
return url;
|
|
||||||
}
|
|
||||||
|
|
||||||
const params = new URLSearchParams();
|
|
||||||
search
|
|
||||||
?.map((term) => term.trim())
|
|
||||||
.filter(Boolean)
|
|
||||||
.forEach((term) => params.append("q", term));
|
|
||||||
|
|
||||||
if (wholeWord) {
|
|
||||||
params.set("m", "whole");
|
|
||||||
}
|
|
||||||
|
|
||||||
const queryString = params.toString();
|
|
||||||
|
|
||||||
return queryString ? `${url}?${queryString}` : url;
|
|
||||||
}
|
|
||||||
|
|
||||||
export const buildPageUrl = (
|
export const buildPageUrl = (
|
||||||
spaceName: string,
|
spaceName: string,
|
||||||
pageSlugId: string,
|
pageSlugId: string,
|
||||||
pageTitle?: string,
|
pageTitle?: string,
|
||||||
anchorId?: string,
|
anchorId?: string,
|
||||||
search?: string[],
|
|
||||||
wholeWord?: boolean,
|
|
||||||
): string => {
|
): string => {
|
||||||
let url: string;
|
let url: string;
|
||||||
if (spaceName === undefined) {
|
if (spaceName === undefined) {
|
||||||
@@ -63,9 +37,6 @@ export const buildPageUrl = (
|
|||||||
} else {
|
} else {
|
||||||
url = `/s/${spaceName}/p/${buildPageSlug(pageSlugId, pageTitle)}`;
|
url = `/s/${spaceName}/p/${buildPageSlug(pageSlugId, pageTitle)}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
url = appendSearchParams(url, search, wholeWord);
|
|
||||||
|
|
||||||
return anchorId ? `${url}#${anchorId}` : url;
|
return anchorId ? `${url}#${anchorId}` : url;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -74,31 +45,13 @@ export const buildSharedPageUrl = (opts: {
|
|||||||
pageSlugId: string;
|
pageSlugId: string;
|
||||||
pageTitle?: string;
|
pageTitle?: string;
|
||||||
anchorId?: string;
|
anchorId?: string;
|
||||||
search?: string[];
|
|
||||||
wholeWord?: boolean;
|
|
||||||
}): string => {
|
}): string => {
|
||||||
const { shareId, pageSlugId, pageTitle, anchorId, search, wholeWord } = opts;
|
const { shareId, pageSlugId, pageTitle, anchorId } = opts;
|
||||||
let url: string;
|
let url: string;
|
||||||
if (!shareId) {
|
if (!shareId) {
|
||||||
url = `/share/p/${buildPageSlug(pageSlugId, pageTitle)}`;
|
url = `/share/p/${buildPageSlug(pageSlugId, pageTitle)}`;
|
||||||
} else {
|
} else {
|
||||||
url = `/share/${shareId}/p/${buildPageSlug(pageSlugId, pageTitle)}`;
|
url = `/share/${shareId}/p/${buildPageSlug(pageSlugId, pageTitle)}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
url = appendSearchParams(url, search, wholeWord);
|
|
||||||
|
|
||||||
return anchorId ? `${url}#${anchorId}` : url;
|
|
||||||
};
|
|
||||||
|
|
||||||
export const buildPublicSpaceUrl = (opts: {
|
|
||||||
spaceSlug: string;
|
|
||||||
pageSlugId?: string;
|
|
||||||
pageTitle?: string;
|
|
||||||
anchorId?: string;
|
|
||||||
}): string => {
|
|
||||||
const { spaceSlug, pageSlugId, pageTitle, anchorId } = opts;
|
|
||||||
const url = pageSlugId
|
|
||||||
? `/docs/${spaceSlug}/${buildPageSlug(pageSlugId, pageTitle)}`
|
|
||||||
: `/docs/${spaceSlug}`;
|
|
||||||
return anchorId ? `${url}#${anchorId}` : url;
|
return anchorId ? `${url}#${anchorId}` : url;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -41,7 +41,6 @@ type Props<T extends object> = {
|
|||||||
activeId?: string;
|
activeId?: string;
|
||||||
renderRow: (props: RenderRowProps<T>) => ReactNode;
|
renderRow: (props: RenderRowProps<T>) => ReactNode;
|
||||||
indentPerLevel: number;
|
indentPerLevel: number;
|
||||||
rowClassName?: string;
|
|
||||||
onMove: (sourceId: string, op: DropOp) => void | Promise<void>;
|
onMove: (sourceId: string, op: DropOp) => void | Promise<void>;
|
||||||
onToggle: (id: string, isOpen: boolean) => void;
|
onToggle: (id: string, isOpen: boolean) => void;
|
||||||
readOnly: boolean;
|
readOnly: boolean;
|
||||||
@@ -69,7 +68,6 @@ function DocTreeRowInner<T extends object>(props: Props<T>) {
|
|||||||
activeId,
|
activeId,
|
||||||
renderRow,
|
renderRow,
|
||||||
indentPerLevel,
|
indentPerLevel,
|
||||||
rowClassName,
|
|
||||||
onMove,
|
onMove,
|
||||||
onToggle,
|
onToggle,
|
||||||
readOnly,
|
readOnly,
|
||||||
@@ -325,7 +323,7 @@ function DocTreeRowInner<T extends object>(props: Props<T>) {
|
|||||||
style={{ paddingLeft: level * indentPerLevel }}
|
style={{ paddingLeft: level * indentPerLevel }}
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
className={rowClassName ? `${styles.node} ${rowClassName}` : styles.node}
|
className={styles.node}
|
||||||
data-dragging={isDragging || undefined}
|
data-dragging={isDragging || undefined}
|
||||||
data-selected={isSelected || undefined}
|
data-selected={isSelected || undefined}
|
||||||
data-receiving-drop={
|
data-receiving-drop={
|
||||||
@@ -378,7 +376,6 @@ function arePropsEqual<T extends object>(
|
|||||||
if (prev.readOnly !== next.readOnly) return false;
|
if (prev.readOnly !== next.readOnly) return false;
|
||||||
if (prev.contextId !== next.contextId) return false;
|
if (prev.contextId !== next.contextId) return false;
|
||||||
if (prev.indentPerLevel !== next.indentPerLevel) return false;
|
if (prev.indentPerLevel !== next.indentPerLevel) return false;
|
||||||
if (prev.rowClassName !== next.rowClassName) return false;
|
|
||||||
if (prev.renderRow !== next.renderRow) return false;
|
if (prev.renderRow !== next.renderRow) return false;
|
||||||
if (prev.onMove !== next.onMove) return false;
|
if (prev.onMove !== next.onMove) return false;
|
||||||
if (prev.onToggle !== next.onToggle) return false;
|
if (prev.onToggle !== next.onToggle) return false;
|
||||||
|
|||||||
@@ -56,18 +56,6 @@ export type DocTreeProps<T extends object> = {
|
|||||||
indentPerLevel?: number;
|
indentPerLevel?: number;
|
||||||
rowHeight?: number;
|
rowHeight?: number;
|
||||||
emptyState?: ReactNode;
|
emptyState?: ReactNode;
|
||||||
// Extra class for the engine's row wrapper (the div carrying data-selected /
|
|
||||||
// data-dragging), letting consumers restyle hover/selected states.
|
|
||||||
rowClassName?: string;
|
|
||||||
// Extra vertical space above a row (e.g. to separate top-level groups).
|
|
||||||
// Added to the row's virtualized slot and applied as padding above it.
|
|
||||||
rowGap?: (node: TreeNode<T>, level: number, index: number) => number;
|
|
||||||
// Measure real row heights so rows may wrap to multiple lines; rowHeight
|
|
||||||
// then only seeds the estimate. Off by default (fixed-slot fast path).
|
|
||||||
dynamicRowHeight?: boolean;
|
|
||||||
// Rendered inside the scroll container after the last row, so it flows
|
|
||||||
// with the tree content instead of pinning to the container edge.
|
|
||||||
footer?: ReactNode;
|
|
||||||
|
|
||||||
onMove: (sourceId: string, op: DropOp) => void | Promise<void>;
|
onMove: (sourceId: string, op: DropOp) => void | Promise<void>;
|
||||||
onToggle: (id: string, isOpen: boolean) => void;
|
onToggle: (id: string, isOpen: boolean) => void;
|
||||||
@@ -135,9 +123,6 @@ function DocTreeInner<T extends object>(
|
|||||||
renderRow,
|
renderRow,
|
||||||
indentPerLevel = 16,
|
indentPerLevel = 16,
|
||||||
rowHeight = 32,
|
rowHeight = 32,
|
||||||
rowClassName,
|
|
||||||
rowGap,
|
|
||||||
dynamicRowHeight = false,
|
|
||||||
onMove,
|
onMove,
|
||||||
onToggle,
|
onToggle,
|
||||||
onSelect,
|
onSelect,
|
||||||
@@ -147,7 +132,6 @@ function DocTreeInner<T extends object>(
|
|||||||
getDragLabel,
|
getDragLabel,
|
||||||
uniqueContextId,
|
uniqueContextId,
|
||||||
emptyState,
|
emptyState,
|
||||||
footer,
|
|
||||||
'aria-label': ariaLabel,
|
'aria-label': ariaLabel,
|
||||||
} = props;
|
} = props;
|
||||||
|
|
||||||
@@ -213,20 +197,10 @@ function DocTreeInner<T extends object>(
|
|||||||
return flat[0]?.node.id;
|
return flat[0]?.node.id;
|
||||||
}, [activeId, selectedId, flatIds, flat]);
|
}, [activeId, selectedId, flatIds, flat]);
|
||||||
|
|
||||||
// Keyed by node id so measured sizes follow their rows across
|
|
||||||
// expand/collapse instead of sticking to positions. Never reset the
|
|
||||||
// measurement cache wholesale: ResizeObserver only re-reports elements
|
|
||||||
// whose size changed, so unchanged mounted rows would be left positioned
|
|
||||||
// by the estimate and overlap their neighbors.
|
|
||||||
const virtualizer = useVirtualizer({
|
const virtualizer = useVirtualizer({
|
||||||
count: flat.length,
|
count: flat.length,
|
||||||
getScrollElement: () => scrollRef.current,
|
getScrollElement: () => scrollRef.current,
|
||||||
getItemKey: (index) => flat[index].node.id,
|
estimateSize: () => rowHeight,
|
||||||
estimateSize: (index) => {
|
|
||||||
const row = flat[index];
|
|
||||||
const gap = row && rowGap ? rowGap(row.node, row.level, index) : 0;
|
|
||||||
return rowHeight + gap;
|
|
||||||
},
|
|
||||||
overscan: 10,
|
overscan: 10,
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -497,12 +471,7 @@ function DocTreeInner<T extends object>(
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (data.length === 0 && emptyState) {
|
if (data.length === 0 && emptyState) {
|
||||||
return (
|
return <div className={styles.treeContainer}>{emptyState}</div>;
|
||||||
<div className={styles.treeContainer}>
|
|
||||||
{emptyState}
|
|
||||||
{footer}
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const virtualItems = virtualizer.getVirtualItems();
|
const virtualItems = virtualizer.getVirtualItems();
|
||||||
@@ -525,9 +494,6 @@ function DocTreeInner<T extends object>(
|
|||||||
>
|
>
|
||||||
{virtualItems.map((virtualItem) => {
|
{virtualItems.map((virtualItem) => {
|
||||||
const row = flat[virtualItem.index];
|
const row = flat[virtualItem.index];
|
||||||
const gap = rowGap
|
|
||||||
? rowGap(row.node, row.level, virtualItem.index)
|
|
||||||
: 0;
|
|
||||||
return (
|
return (
|
||||||
<li
|
<li
|
||||||
key={row.node.id}
|
key={row.node.id}
|
||||||
@@ -535,15 +501,12 @@ function DocTreeInner<T extends object>(
|
|||||||
// (the row's <a>), so screen readers announce "treeitem" on
|
// (the row's <a>), so screen readers announce "treeitem" on
|
||||||
// navigation. The <li> is just layout glue.
|
// navigation. The <li> is just layout glue.
|
||||||
role="none"
|
role="none"
|
||||||
ref={dynamicRowHeight ? virtualizer.measureElement : undefined}
|
|
||||||
data-index={dynamicRowHeight ? virtualItem.index : undefined}
|
|
||||||
style={{
|
style={{
|
||||||
position: 'absolute',
|
position: 'absolute',
|
||||||
top: 0,
|
top: 0,
|
||||||
left: 0,
|
left: 0,
|
||||||
width: '100%',
|
width: '100%',
|
||||||
transform: `translateY(${virtualItem.start}px)`,
|
transform: `translateY(${virtualItem.start}px)`,
|
||||||
...(gap > 0 ? { paddingTop: gap } : {}),
|
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<DocTreeRow
|
<DocTreeRow
|
||||||
@@ -555,7 +518,6 @@ function DocTreeInner<T extends object>(
|
|||||||
activeId={effectiveActiveId}
|
activeId={effectiveActiveId}
|
||||||
renderRow={renderRow}
|
renderRow={renderRow}
|
||||||
indentPerLevel={indentPerLevel}
|
indentPerLevel={indentPerLevel}
|
||||||
rowClassName={rowClassName}
|
|
||||||
onMove={onMove}
|
onMove={onMove}
|
||||||
onToggle={onToggle}
|
onToggle={onToggle}
|
||||||
readOnly={readOnly}
|
readOnly={readOnly}
|
||||||
@@ -570,7 +532,6 @@ function DocTreeInner<T extends object>(
|
|||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
</ul>
|
</ul>
|
||||||
{footer}
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,17 +0,0 @@
|
|||||||
import { atom } from "jotai";
|
|
||||||
import { IPublicSpaceTree } from "@/features/public-space/types/public-space.types.ts";
|
|
||||||
import { SharedPageTreeNode } from "@/features/share/utils.ts";
|
|
||||||
|
|
||||||
export const publicSpaceTreeAtom = atom<IPublicSpaceTree | null>(
|
|
||||||
null as IPublicSpaceTree | null,
|
|
||||||
);
|
|
||||||
|
|
||||||
export const publicSpaceTreeDataAtom = atom<SharedPageTreeNode[] | null>(
|
|
||||||
null as SharedPageTreeNode[] | null,
|
|
||||||
);
|
|
||||||
|
|
||||||
export const openPublicSpaceTreeNodesAtom = atom<Record<string, boolean>>({});
|
|
||||||
|
|
||||||
export const docsMobileSidebarAtom = atom<boolean>(false);
|
|
||||||
|
|
||||||
export const docsMobileTocAtom = atom<boolean>(false);
|
|
||||||
@@ -1,51 +0,0 @@
|
|||||||
.presetRow {
|
|
||||||
display: flex;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
gap: rem(8px);
|
|
||||||
}
|
|
||||||
|
|
||||||
.presetCard {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
align-items: center;
|
|
||||||
gap: rem(6px);
|
|
||||||
min-width: rem(72px);
|
|
||||||
padding: rem(10px) rem(12px);
|
|
||||||
border: 1px solid var(--mantine-color-default-border);
|
|
||||||
border-radius: rem(8px);
|
|
||||||
|
|
||||||
@media (hover: hover) {
|
|
||||||
&:hover {
|
|
||||||
background-color: var(--mantine-color-default-hover);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&:focus-visible {
|
|
||||||
outline: 2px solid var(--mantine-primary-color-filled);
|
|
||||||
outline-offset: 1px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.presetCard[data-selected="true"] {
|
|
||||||
border-color: var(--mantine-primary-color-filled);
|
|
||||||
background-color: var(--mantine-primary-color-light);
|
|
||||||
}
|
|
||||||
|
|
||||||
.presetSwatch {
|
|
||||||
width: rem(22px);
|
|
||||||
height: rem(22px);
|
|
||||||
border-radius: 50%;
|
|
||||||
border: 1px solid var(--mantine-color-default-border);
|
|
||||||
flex-shrink: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.customSwatch {
|
|
||||||
display: inline-flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
width: rem(22px);
|
|
||||||
height: rem(22px);
|
|
||||||
border-radius: 50%;
|
|
||||||
border: 1px dashed var(--mantine-color-default-border);
|
|
||||||
color: var(--mantine-color-dimmed);
|
|
||||||
}
|
|
||||||
@@ -1,165 +0,0 @@
|
|||||||
import {
|
|
||||||
ColorInput,
|
|
||||||
Group,
|
|
||||||
Text,
|
|
||||||
Tooltip,
|
|
||||||
UnstyledButton,
|
|
||||||
} from "@mantine/core";
|
|
||||||
import { IconColorPicker } from "@tabler/icons-react";
|
|
||||||
import { useEffect, useState } from "react";
|
|
||||||
import { useTranslation } from "react-i18next";
|
|
||||||
import {
|
|
||||||
DEFAULT_DOCS_PRESET,
|
|
||||||
DOCS_THEME_PRESETS,
|
|
||||||
isValidDocsColor,
|
|
||||||
matchDocsPreset,
|
|
||||||
} from "@/features/public-space/theme/docs-theme.ts";
|
|
||||||
import { IPublicSpaceAppearance } from "@/features/public-space/types/public-space.types.ts";
|
|
||||||
import { usePublishSpaceMutation } from "@/features/public-space/queries/public-space-query.ts";
|
|
||||||
import { useHasFeature } from "@/ee/hooks/use-feature.ts";
|
|
||||||
import { useUpgradeLabel } from "@/ee/hooks/use-upgrade-label.ts";
|
|
||||||
import { Feature } from "@/ee/features.ts";
|
|
||||||
import classes from "./appearance-settings.module.css";
|
|
||||||
|
|
||||||
type AppearanceSettingsProps = {
|
|
||||||
spaceId: string;
|
|
||||||
appearance?: IPublicSpaceAppearance;
|
|
||||||
};
|
|
||||||
|
|
||||||
export default function AppearanceSettings({
|
|
||||||
spaceId,
|
|
||||||
appearance,
|
|
||||||
}: AppearanceSettingsProps) {
|
|
||||||
const { t } = useTranslation();
|
|
||||||
const publishMutation = usePublishSpaceMutation();
|
|
||||||
const hasAppearance = useHasFeature(Feature.PUBLIC_SPACE_APPEARANCE);
|
|
||||||
const upgradeLabel = useUpgradeLabel();
|
|
||||||
|
|
||||||
const matchedPreset = matchDocsPreset(appearance);
|
|
||||||
const [customOpen, setCustomOpen] = useState(matchedPreset === null);
|
|
||||||
const [customLight, setCustomLight] = useState(
|
|
||||||
appearance?.primaryColorLight ?? DEFAULT_DOCS_PRESET.light,
|
|
||||||
);
|
|
||||||
const [customDark, setCustomDark] = useState(
|
|
||||||
appearance?.primaryColorDark ?? DEFAULT_DOCS_PRESET.dark,
|
|
||||||
);
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
setCustomOpen(matchDocsPreset(appearance) === null);
|
|
||||||
setCustomLight(appearance?.primaryColorLight ?? DEFAULT_DOCS_PRESET.light);
|
|
||||||
setCustomDark(appearance?.primaryColorDark ?? DEFAULT_DOCS_PRESET.dark);
|
|
||||||
}, [appearance?.primaryColorLight, appearance?.primaryColorDark]);
|
|
||||||
|
|
||||||
const saveAppearance = (payload: {
|
|
||||||
primaryColorLight: string | null;
|
|
||||||
primaryColorDark: string | null;
|
|
||||||
}) => {
|
|
||||||
if (!hasAppearance) return;
|
|
||||||
publishMutation.mutate({ spaceId, enabled: true, appearance: payload });
|
|
||||||
};
|
|
||||||
|
|
||||||
const selectPreset = (presetId: string) => {
|
|
||||||
setCustomOpen(false);
|
|
||||||
const preset = DOCS_THEME_PRESETS.find((item) => item.id === presetId);
|
|
||||||
if (!preset) return;
|
|
||||||
if (preset.id === DEFAULT_DOCS_PRESET.id) {
|
|
||||||
saveAppearance({ primaryColorLight: null, primaryColorDark: null });
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
saveAppearance({
|
|
||||||
primaryColorLight: preset.light,
|
|
||||||
primaryColorDark: preset.dark,
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
const commitCustom = (light: string, dark: string) => {
|
|
||||||
if (!isValidDocsColor(light) || !isValidDocsColor(dark)) return;
|
|
||||||
saveAppearance({ primaryColorLight: light, primaryColorDark: dark });
|
|
||||||
};
|
|
||||||
|
|
||||||
const swatches = DOCS_THEME_PRESETS.flatMap((preset) => [
|
|
||||||
preset.light,
|
|
||||||
preset.dark,
|
|
||||||
]);
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div>
|
|
||||||
<Text size="md" mt="md">
|
|
||||||
{t("Appearance")}
|
|
||||||
</Text>
|
|
||||||
<Text size="sm" c="dimmed">
|
|
||||||
{t("Choose the primary color of the public docs site.")}
|
|
||||||
</Text>
|
|
||||||
|
|
||||||
<Tooltip
|
|
||||||
label={upgradeLabel}
|
|
||||||
disabled={hasAppearance}
|
|
||||||
position="top-start"
|
|
||||||
>
|
|
||||||
<div className={classes.presetRow} style={{ marginTop: 10 }}>
|
|
||||||
{DOCS_THEME_PRESETS.map((preset) => {
|
|
||||||
const selected = !customOpen && matchedPreset?.id === preset.id;
|
|
||||||
return (
|
|
||||||
<UnstyledButton
|
|
||||||
key={preset.id}
|
|
||||||
className={classes.presetCard}
|
|
||||||
data-selected={selected || undefined}
|
|
||||||
aria-pressed={selected}
|
|
||||||
disabled={!hasAppearance}
|
|
||||||
onClick={() => selectPreset(preset.id)}
|
|
||||||
>
|
|
||||||
<span
|
|
||||||
className={classes.presetSwatch}
|
|
||||||
style={{
|
|
||||||
background: `linear-gradient(135deg, ${preset.light} 50%, ${preset.dark} 50%)`,
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
<Text size="xs">{t(preset.nameKey)}</Text>
|
|
||||||
</UnstyledButton>
|
|
||||||
);
|
|
||||||
})}
|
|
||||||
|
|
||||||
<UnstyledButton
|
|
||||||
className={classes.presetCard}
|
|
||||||
data-selected={customOpen || undefined}
|
|
||||||
aria-pressed={customOpen}
|
|
||||||
disabled={!hasAppearance}
|
|
||||||
onClick={() => setCustomOpen(true)}
|
|
||||||
>
|
|
||||||
<span className={classes.customSwatch}>
|
|
||||||
<IconColorPicker size={13} stroke={2} aria-hidden />
|
|
||||||
</span>
|
|
||||||
<Text size="xs">{t("Custom")}</Text>
|
|
||||||
</UnstyledButton>
|
|
||||||
</div>
|
|
||||||
</Tooltip>
|
|
||||||
|
|
||||||
{customOpen && hasAppearance && (
|
|
||||||
<Group grow mt="sm" align="flex-start">
|
|
||||||
<ColorInput
|
|
||||||
label={t("Light mode color")}
|
|
||||||
format="hex"
|
|
||||||
value={customLight}
|
|
||||||
swatches={swatches}
|
|
||||||
onChange={setCustomLight}
|
|
||||||
onChangeEnd={(value) => {
|
|
||||||
setCustomLight(value);
|
|
||||||
commitCustom(value, customDark);
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
<ColorInput
|
|
||||||
label={t("Dark mode color")}
|
|
||||||
format="hex"
|
|
||||||
value={customDark}
|
|
||||||
swatches={swatches}
|
|
||||||
onChange={setCustomDark}
|
|
||||||
onChangeEnd={(value) => {
|
|
||||||
setCustomDark(value);
|
|
||||||
commitCustom(customLight, value);
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</Group>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,114 +0,0 @@
|
|||||||
import { Menu } from "@mantine/core";
|
|
||||||
import { useMediaQuery } from "@mantine/hooks";
|
|
||||||
import { Link, useParams } from "react-router-dom";
|
|
||||||
import { useTranslation } from "react-i18next";
|
|
||||||
import { Fragment, useMemo, type ReactNode } from "react";
|
|
||||||
import { useDocsSurface } from "@/features/public-space/components/docs/docs-surface-context.tsx";
|
|
||||||
import { findAncestorTrail } from "@/features/public-space/utils/docs-tree.ts";
|
|
||||||
import { extractPageSlugId } from "@/lib";
|
|
||||||
import styles from "./docs.module.css";
|
|
||||||
|
|
||||||
type Crumb = {
|
|
||||||
key: string;
|
|
||||||
name: string;
|
|
||||||
url: string;
|
|
||||||
};
|
|
||||||
|
|
||||||
export default function DocsBreadcrumbs() {
|
|
||||||
const { t } = useTranslation();
|
|
||||||
const { pageSlug } = useParams();
|
|
||||||
const { treeData, siteName, homeUrl, getNodeUrl } = useDocsSurface();
|
|
||||||
const isMobile = useMediaQuery("(max-width: 48em)");
|
|
||||||
|
|
||||||
const crumbs = useMemo<Crumb[] | null>(() => {
|
|
||||||
if (!treeData?.length) return null;
|
|
||||||
|
|
||||||
const currentSlugId = pageSlug
|
|
||||||
? extractPageSlugId(pageSlug)
|
|
||||||
: treeData[0]?.slugId;
|
|
||||||
if (!currentSlugId) return null;
|
|
||||||
|
|
||||||
const trail = findAncestorTrail(treeData, currentSlugId);
|
|
||||||
if (trail === null) return null;
|
|
||||||
|
|
||||||
const siteCrumbs: Crumb[] =
|
|
||||||
siteName && homeUrl
|
|
||||||
? [{ key: "site", name: siteName, url: homeUrl }]
|
|
||||||
: [];
|
|
||||||
|
|
||||||
const list = [
|
|
||||||
...siteCrumbs,
|
|
||||||
...trail.map((node) => ({
|
|
||||||
key: node.slugId,
|
|
||||||
name: node.name || t("untitled"),
|
|
||||||
url: getNodeUrl(node),
|
|
||||||
})),
|
|
||||||
];
|
|
||||||
return list.length ? list : null;
|
|
||||||
}, [treeData, siteName, homeUrl, getNodeUrl, pageSlug, t]);
|
|
||||||
|
|
||||||
if (!crumbs) return null;
|
|
||||||
|
|
||||||
// Mobile keeps a single line (menu + last crumb, like the app header's
|
|
||||||
// breadcrumb); desktop collapses the middle beyond 4 crumbs.
|
|
||||||
const collapsed = crumbs.length > (isMobile ? 1 : 4);
|
|
||||||
const hidden = !collapsed
|
|
||||||
? []
|
|
||||||
: isMobile
|
|
||||||
? crumbs.slice(0, crumbs.length - 1)
|
|
||||||
: crumbs.slice(1, crumbs.length - 1);
|
|
||||||
|
|
||||||
const items: ReactNode[] = [];
|
|
||||||
if (collapsed && !isMobile) {
|
|
||||||
items.push(
|
|
||||||
<Link key={crumbs[0].key} to={crumbs[0].url} className={styles.crumbLink}>
|
|
||||||
{crumbs[0].name}
|
|
||||||
</Link>,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
if (collapsed) {
|
|
||||||
items.push(
|
|
||||||
<Menu shadow="md" position="bottom-start" key="hidden">
|
|
||||||
<Menu.Target>
|
|
||||||
<button
|
|
||||||
type="button"
|
|
||||||
className={styles.crumbEllipsis}
|
|
||||||
aria-label={t("Show hidden pages")}
|
|
||||||
>
|
|
||||||
…
|
|
||||||
</button>
|
|
||||||
</Menu.Target>
|
|
||||||
<Menu.Dropdown>
|
|
||||||
{hidden.map((item) => (
|
|
||||||
<Menu.Item key={item.key} component={Link} to={item.url}>
|
|
||||||
{item.name}
|
|
||||||
</Menu.Item>
|
|
||||||
))}
|
|
||||||
</Menu.Dropdown>
|
|
||||||
</Menu>,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
const trailing = collapsed ? [crumbs[crumbs.length - 1]] : crumbs;
|
|
||||||
for (const crumb of trailing) {
|
|
||||||
items.push(
|
|
||||||
<Link key={crumb.key} to={crumb.url} className={styles.crumbLink}>
|
|
||||||
{crumb.name}
|
|
||||||
</Link>,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
|
||||||
<nav className={styles.breadcrumbs} aria-label={t("Breadcrumb")}>
|
|
||||||
{items.map((item, index) => (
|
|
||||||
<Fragment key={index}>
|
|
||||||
{index > 0 && (
|
|
||||||
<span className={styles.crumbSeparator} aria-hidden>
|
|
||||||
/
|
|
||||||
</span>
|
|
||||||
)}
|
|
||||||
{item}
|
|
||||||
</Fragment>
|
|
||||||
))}
|
|
||||||
</nav>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,45 +0,0 @@
|
|||||||
import { Button } from "@mantine/core";
|
|
||||||
import { useAtomValue } from "jotai";
|
|
||||||
import { useTranslation } from "react-i18next";
|
|
||||||
import { IconCheck, IconCopy } from "@tabler/icons-react";
|
|
||||||
import { htmlToMarkdown } from "@docmost/editor-ext";
|
|
||||||
import { readOnlyEditorAtom } from "@/features/editor/atoms/editor-atoms.ts";
|
|
||||||
import { useDocsCurrentPage } from "@/features/public-space/hooks/use-docs-current-page.ts";
|
|
||||||
import { useClipboard } from "@/hooks/use-clipboard";
|
|
||||||
import styles from "./docs.module.css";
|
|
||||||
|
|
||||||
export default function DocsCopyPage() {
|
|
||||||
const { t } = useTranslation();
|
|
||||||
const editor = useAtomValue(readOnlyEditorAtom);
|
|
||||||
const page = useDocsCurrentPage();
|
|
||||||
const clipboard = useClipboard();
|
|
||||||
|
|
||||||
if (!editor) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
const handleCopy = () => {
|
|
||||||
if (editor.isDestroyed) return;
|
|
||||||
const markdown = htmlToMarkdown(editor.getHTML());
|
|
||||||
const title = page?.name ? `# ${page.name}\n\n` : "";
|
|
||||||
clipboard.copy(`${title}${markdown}`);
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Button
|
|
||||||
variant="default"
|
|
||||||
size="compact-sm"
|
|
||||||
className={styles.copyPageButton}
|
|
||||||
onClick={handleCopy}
|
|
||||||
leftSection={
|
|
||||||
clipboard.copied ? (
|
|
||||||
<IconCheck size={14} stroke={1.8} />
|
|
||||||
) : (
|
|
||||||
<IconCopy size={14} stroke={1.8} />
|
|
||||||
)
|
|
||||||
}
|
|
||||||
>
|
|
||||||
{clipboard.copied ? t("Copied") : t("Copy page")}
|
|
||||||
</Button>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,31 +0,0 @@
|
|||||||
import { Link, useParams } from "react-router-dom";
|
|
||||||
import { useTranslation } from "react-i18next";
|
|
||||||
import { IconPencil } from "@tabler/icons-react";
|
|
||||||
import { useAuthenticatedUser } from "@/features/public-space/hooks/use-authenticated-user.ts";
|
|
||||||
import { useDocsCurrentPage } from "@/features/public-space/hooks/use-docs-current-page.ts";
|
|
||||||
import { buildPageUrl } from "@/features/page/page.utils.ts";
|
|
||||||
import styles from "./docs.module.css";
|
|
||||||
|
|
||||||
export default function DocsEditPage() {
|
|
||||||
const { t } = useTranslation();
|
|
||||||
const { spaceSlug } = useParams();
|
|
||||||
const page = useDocsCurrentPage();
|
|
||||||
|
|
||||||
const { data: currentUser } = useAuthenticatedUser();
|
|
||||||
|
|
||||||
if (!currentUser?.user || !page) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Link
|
|
||||||
className={styles.editPageLink}
|
|
||||||
to={buildPageUrl(spaceSlug, page.slugId, page.name)}
|
|
||||||
target="_blank"
|
|
||||||
rel="noopener"
|
|
||||||
>
|
|
||||||
<IconPencil size={14} stroke={1.8} aria-hidden />
|
|
||||||
{t("Edit page")}
|
|
||||||
</Link>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
import clsx from "clsx";
|
|
||||||
import styles from "./docs.module.css";
|
|
||||||
|
|
||||||
export default function DocsFooterBranding({
|
|
||||||
className,
|
|
||||||
refSource = "public-space",
|
|
||||||
}: {
|
|
||||||
className?: string;
|
|
||||||
refSource?: string;
|
|
||||||
}) {
|
|
||||||
return (
|
|
||||||
<footer className={clsx(styles.footer, className)}>
|
|
||||||
<a
|
|
||||||
className={styles.footerBranding}
|
|
||||||
href={`https://docmost.com?ref=${refSource}`}
|
|
||||||
target="_blank"
|
|
||||||
rel="noreferrer"
|
|
||||||
>
|
|
||||||
Powered by Docmost
|
|
||||||
</a>
|
|
||||||
</footer>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,485 +0,0 @@
|
|||||||
/* Design tokens for the public docs hub, transcribed from the "1a solid brand
|
|
||||||
* band" direction of the Directory design spec (a fixed light look). Declared
|
|
||||||
* on :root like --docs-* so cover/brand customization can override them at
|
|
||||||
* runtime. */
|
|
||||||
:root {
|
|
||||||
--docs-hub-max: 80rem;
|
|
||||||
--docs-hub-bg: #ffffff;
|
|
||||||
--docs-hub-fg: #111827;
|
|
||||||
--docs-hub-muted: #5b6270;
|
|
||||||
--docs-hub-nav-fg: #4b5563;
|
|
||||||
--docs-hub-footer-fg: #6b7280;
|
|
||||||
--docs-hub-border: #eceef2;
|
|
||||||
--docs-hub-brand: #12275c;
|
|
||||||
--docs-hub-brand-fg: #ffffff;
|
|
||||||
--docs-hub-hero-bg: var(--docs-hub-brand);
|
|
||||||
--docs-hub-hero-fg: #ffffff;
|
|
||||||
--docs-hub-hero-muted: rgba(255, 255, 255, 0.78);
|
|
||||||
--docs-hub-search-bg: #ffffff;
|
|
||||||
--docs-hub-search-fg: #111827;
|
|
||||||
--docs-hub-search-placeholder: #8a919e;
|
|
||||||
--docs-hub-search-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
|
|
||||||
--docs-hub-card-bg: #ffffff;
|
|
||||||
--docs-hub-card-border: #e6e7ea;
|
|
||||||
--docs-hub-card-radius: 14px;
|
|
||||||
--docs-hub-card-shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
|
|
||||||
--docs-hub-card-border-hover: #c4c8d0;
|
|
||||||
--docs-hub-card-shadow-hover: 0 12px 32px rgba(15, 23, 42, 0.14);
|
|
||||||
--docs-hub-tile-fg: #ffffff;
|
|
||||||
}
|
|
||||||
|
|
||||||
.root {
|
|
||||||
min-height: 100dvh;
|
|
||||||
background-color: var(--docs-hub-bg);
|
|
||||||
color: var(--docs-hub-fg);
|
|
||||||
}
|
|
||||||
|
|
||||||
.container {
|
|
||||||
max-width: var(--docs-hub-max);
|
|
||||||
margin-inline: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ---------- Top bar ---------- */
|
|
||||||
|
|
||||||
.topBar {
|
|
||||||
border-bottom: 1px solid var(--docs-hub-border);
|
|
||||||
padding: 0 rem(48px);
|
|
||||||
|
|
||||||
@media (max-width: $mantine-breakpoint-sm) {
|
|
||||||
padding: 0 rem(20px);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.topBarInner {
|
|
||||||
height: rem(64px);
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: space-between;
|
|
||||||
|
|
||||||
@media (max-width: $mantine-breakpoint-sm) {
|
|
||||||
height: rem(56px);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.brand {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: rem(10px);
|
|
||||||
min-width: 0;
|
|
||||||
color: var(--docs-hub-fg);
|
|
||||||
text-decoration: none;
|
|
||||||
font-size: rem(16px);
|
|
||||||
font-weight: 600;
|
|
||||||
border-radius: rem(8px);
|
|
||||||
|
|
||||||
&:focus-visible {
|
|
||||||
outline: 2px solid var(--docs-hub-brand);
|
|
||||||
outline-offset: 4px;
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (max-width: $mantine-breakpoint-sm) {
|
|
||||||
gap: rem(8px);
|
|
||||||
font-size: rem(15px);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.brandTile {
|
|
||||||
width: rem(28px);
|
|
||||||
height: rem(28px);
|
|
||||||
border-radius: rem(8px);
|
|
||||||
background-color: var(--docs-hub-brand);
|
|
||||||
color: var(--docs-hub-brand-fg);
|
|
||||||
display: grid;
|
|
||||||
place-items: center;
|
|
||||||
flex-shrink: 0;
|
|
||||||
font-weight: 700;
|
|
||||||
font-size: rem(13px);
|
|
||||||
|
|
||||||
@media (max-width: $mantine-breakpoint-sm) {
|
|
||||||
width: rem(26px);
|
|
||||||
height: rem(26px);
|
|
||||||
border-radius: rem(7px);
|
|
||||||
font-size: rem(12px);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.topActions {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: rem(24px);
|
|
||||||
font-size: rem(14px);
|
|
||||||
color: var(--docs-hub-nav-fg);
|
|
||||||
}
|
|
||||||
|
|
||||||
.signIn {
|
|
||||||
display: inline-block;
|
|
||||||
padding: rem(8px) rem(14px);
|
|
||||||
border-radius: rem(8px);
|
|
||||||
background-color: var(--docs-hub-brand);
|
|
||||||
color: var(--docs-hub-brand-fg);
|
|
||||||
text-decoration: none;
|
|
||||||
font-weight: 500;
|
|
||||||
white-space: nowrap;
|
|
||||||
|
|
||||||
@media (hover: hover) {
|
|
||||||
&:hover {
|
|
||||||
filter: brightness(1.15);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&:focus-visible {
|
|
||||||
outline: 2px solid var(--docs-hub-brand);
|
|
||||||
outline-offset: 2px;
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (max-width: $mantine-breakpoint-sm) {
|
|
||||||
padding: rem(8px) rem(12px);
|
|
||||||
font-size: rem(13px);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ---------- Hero band ---------- */
|
|
||||||
|
|
||||||
.hero {
|
|
||||||
background-color: var(--docs-hub-hero-bg);
|
|
||||||
color: var(--docs-hub-hero-fg);
|
|
||||||
padding: rem(72px) rem(48px) rem(80px);
|
|
||||||
|
|
||||||
@media (max-width: $mantine-breakpoint-sm) {
|
|
||||||
padding: rem(40px) rem(20px) rem(44px);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.heroInner {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
align-items: center;
|
|
||||||
text-align: center;
|
|
||||||
gap: rem(16px);
|
|
||||||
|
|
||||||
@media (max-width: $mantine-breakpoint-sm) {
|
|
||||||
gap: rem(10px);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.heading {
|
|
||||||
margin: 0;
|
|
||||||
color: var(--docs-hub-hero-fg);
|
|
||||||
font-size: rem(48px);
|
|
||||||
font-weight: 700;
|
|
||||||
letter-spacing: -0.02em;
|
|
||||||
line-height: 1.15;
|
|
||||||
|
|
||||||
@media (max-width: $mantine-breakpoint-sm) {
|
|
||||||
font-size: rem(30px);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.subtitle {
|
|
||||||
margin: 0;
|
|
||||||
color: var(--docs-hub-hero-muted);
|
|
||||||
font-size: rem(18px);
|
|
||||||
|
|
||||||
@media (max-width: $mantine-breakpoint-sm) {
|
|
||||||
font-size: rem(15px);
|
|
||||||
line-height: 1.45;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.search {
|
|
||||||
margin-top: rem(16px);
|
|
||||||
width: rem(640px);
|
|
||||||
max-width: 100%;
|
|
||||||
height: rem(56px);
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
padding: 0 rem(6px) 0 rem(22px);
|
|
||||||
border-radius: 999px;
|
|
||||||
background-color: var(--docs-hub-search-bg);
|
|
||||||
box-shadow: var(--docs-hub-search-shadow);
|
|
||||||
|
|
||||||
&:focus-within {
|
|
||||||
outline: 2px solid var(--docs-hub-hero-fg);
|
|
||||||
outline-offset: 3px;
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (max-width: $mantine-breakpoint-sm) {
|
|
||||||
margin-top: rem(10px);
|
|
||||||
width: 100%;
|
|
||||||
height: rem(48px);
|
|
||||||
padding: 0 rem(5px) 0 rem(18px);
|
|
||||||
box-shadow: none;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.searchInput {
|
|
||||||
flex: 1;
|
|
||||||
min-width: 0;
|
|
||||||
height: 100%;
|
|
||||||
border: 0;
|
|
||||||
background: transparent;
|
|
||||||
font: inherit;
|
|
||||||
font-size: rem(16px);
|
|
||||||
color: var(--docs-hub-search-fg);
|
|
||||||
text-align: left;
|
|
||||||
outline: none;
|
|
||||||
|
|
||||||
&::placeholder {
|
|
||||||
color: var(--docs-hub-search-placeholder);
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (max-width: $mantine-breakpoint-sm) {
|
|
||||||
font-size: rem(15px);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.searchButton {
|
|
||||||
width: rem(44px);
|
|
||||||
height: rem(44px);
|
|
||||||
flex-shrink: 0;
|
|
||||||
border: 0;
|
|
||||||
border-radius: 999px;
|
|
||||||
background-color: var(--docs-hub-brand);
|
|
||||||
color: var(--docs-hub-brand-fg);
|
|
||||||
display: grid;
|
|
||||||
place-items: center;
|
|
||||||
cursor: pointer;
|
|
||||||
|
|
||||||
&:focus-visible {
|
|
||||||
outline: 2px solid var(--docs-hub-search-fg);
|
|
||||||
outline-offset: 2px;
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (max-width: $mantine-breakpoint-sm) {
|
|
||||||
width: rem(38px);
|
|
||||||
height: rem(38px);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ---------- Spaces ---------- */
|
|
||||||
|
|
||||||
.main {
|
|
||||||
padding: rem(48px) rem(48px) rem(56px);
|
|
||||||
|
|
||||||
@media (max-width: $mantine-breakpoint-sm) {
|
|
||||||
padding: rem(24px) rem(20px) rem(28px);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.mainInner {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
gap: rem(24px);
|
|
||||||
|
|
||||||
@media (max-width: $mantine-breakpoint-sm) {
|
|
||||||
gap: rem(16px);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.sectionHeader {
|
|
||||||
display: flex;
|
|
||||||
align-items: baseline;
|
|
||||||
justify-content: space-between;
|
|
||||||
gap: rem(16px);
|
|
||||||
border-bottom: 1px solid var(--docs-hub-border);
|
|
||||||
padding-bottom: rem(14px);
|
|
||||||
|
|
||||||
@media (max-width: $mantine-breakpoint-sm) {
|
|
||||||
padding-bottom: rem(10px);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.sectionTitle {
|
|
||||||
margin: 0;
|
|
||||||
font-size: rem(13px);
|
|
||||||
font-weight: 700;
|
|
||||||
letter-spacing: 0.08em;
|
|
||||||
text-transform: uppercase;
|
|
||||||
color: var(--docs-hub-fg);
|
|
||||||
|
|
||||||
@media (max-width: $mantine-breakpoint-sm) {
|
|
||||||
font-size: rem(12px);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.sectionCount {
|
|
||||||
font-size: rem(14px);
|
|
||||||
color: var(--docs-hub-footer-fg);
|
|
||||||
|
|
||||||
@media (max-width: $mantine-breakpoint-sm) {
|
|
||||||
font-size: rem(13px);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Phones flow one card per row; wider viewports fit two, then 3/4 columns. */
|
|
||||||
.grid {
|
|
||||||
display: grid;
|
|
||||||
grid-template-columns: repeat(auto-fill, minmax(rem(220px), 1fr));
|
|
||||||
gap: rem(12px);
|
|
||||||
|
|
||||||
@media (min-width: $mantine-breakpoint-sm) {
|
|
||||||
grid-template-columns: repeat(3, minmax(0, 1fr));
|
|
||||||
gap: rem(20px);
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (min-width: 64em) {
|
|
||||||
grid-template-columns: repeat(4, minmax(0, 1fr));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.card {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
gap: rem(14px);
|
|
||||||
padding: rem(24px) rem(24px) rem(26px);
|
|
||||||
background-color: var(--docs-hub-card-bg);
|
|
||||||
border: 1px solid var(--docs-hub-card-border);
|
|
||||||
border-radius: var(--docs-hub-card-radius);
|
|
||||||
box-shadow: var(--docs-hub-card-shadow);
|
|
||||||
color: inherit;
|
|
||||||
text-decoration: none;
|
|
||||||
transition:
|
|
||||||
border-color 120ms ease,
|
|
||||||
box-shadow 160ms ease;
|
|
||||||
|
|
||||||
@media (hover: hover) {
|
|
||||||
&:hover {
|
|
||||||
border-color: var(--docs-hub-card-border-hover);
|
|
||||||
box-shadow: var(--docs-hub-card-shadow-hover);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&:focus-visible {
|
|
||||||
outline: 2px solid var(--docs-hub-brand);
|
|
||||||
outline-offset: 2px;
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (max-width: $mantine-breakpoint-sm) {
|
|
||||||
gap: rem(12px);
|
|
||||||
padding: rem(18px) rem(18px) rem(20px);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Tile and title share a row so titles get the card's full width. */
|
|
||||||
.cardHeader {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: rem(14px);
|
|
||||||
min-width: 0;
|
|
||||||
|
|
||||||
@media (max-width: $mantine-breakpoint-sm) {
|
|
||||||
gap: rem(12px);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.cardTile {
|
|
||||||
width: rem(40px);
|
|
||||||
height: rem(40px);
|
|
||||||
flex-shrink: 0;
|
|
||||||
border-radius: rem(10px);
|
|
||||||
display: grid;
|
|
||||||
place-items: center;
|
|
||||||
overflow: hidden;
|
|
||||||
color: var(--docs-hub-tile-fg);
|
|
||||||
font-weight: 700;
|
|
||||||
font-size: rem(15px);
|
|
||||||
|
|
||||||
img {
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
object-fit: cover;
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (max-width: $mantine-breakpoint-sm) {
|
|
||||||
width: rem(36px);
|
|
||||||
height: rem(36px);
|
|
||||||
border-radius: rem(9px);
|
|
||||||
font-size: rem(14px);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.cardName {
|
|
||||||
min-width: 0;
|
|
||||||
font-size: rem(18px);
|
|
||||||
font-weight: 600;
|
|
||||||
line-height: 1.3;
|
|
||||||
color: var(--docs-hub-fg);
|
|
||||||
text-wrap: balance;
|
|
||||||
|
|
||||||
@media (max-width: $mantine-breakpoint-sm) {
|
|
||||||
font-size: rem(16px);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.cardDescription {
|
|
||||||
font-size: rem(15px);
|
|
||||||
line-height: 1.5;
|
|
||||||
color: var(--docs-hub-muted);
|
|
||||||
text-wrap: pretty;
|
|
||||||
display: -webkit-box;
|
|
||||||
-webkit-line-clamp: 3;
|
|
||||||
-webkit-box-orient: vertical;
|
|
||||||
overflow: hidden;
|
|
||||||
|
|
||||||
@media (max-width: $mantine-breakpoint-sm) {
|
|
||||||
font-size: rem(14px);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.empty {
|
|
||||||
margin: 0;
|
|
||||||
padding: rem(48px) 0;
|
|
||||||
text-align: center;
|
|
||||||
color: var(--docs-hub-muted);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ---------- Footer ---------- */
|
|
||||||
|
|
||||||
.footer {
|
|
||||||
border-top: 1px solid var(--docs-hub-border);
|
|
||||||
padding: rem(24px) rem(48px);
|
|
||||||
font-size: rem(14px);
|
|
||||||
color: var(--docs-hub-footer-fg);
|
|
||||||
|
|
||||||
@media (max-width: $mantine-breakpoint-sm) {
|
|
||||||
padding: rem(20px);
|
|
||||||
font-size: rem(13px);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.footerInner {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: flex-end;
|
|
||||||
|
|
||||||
@media (max-width: $mantine-breakpoint-sm) {
|
|
||||||
flex-direction: column;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
gap: rem(12px);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.footerBranding {
|
|
||||||
color: var(--docs-hub-fg);
|
|
||||||
font-weight: 600;
|
|
||||||
text-decoration: none;
|
|
||||||
|
|
||||||
@media (hover: hover) {
|
|
||||||
&:hover {
|
|
||||||
color: var(--docs-hub-brand);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&:focus-visible {
|
|
||||||
outline: 2px solid var(--docs-hub-brand);
|
|
||||||
outline-offset: 2px;
|
|
||||||
border-radius: rem(2px);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (prefers-reduced-motion: reduce) {
|
|
||||||
.card {
|
|
||||||
transition: none;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,70 +0,0 @@
|
|||||||
import { useMemo } from "react";
|
|
||||||
import { Link, useParams } from "react-router-dom";
|
|
||||||
import { useTranslation } from "react-i18next";
|
|
||||||
import { IconArrowLeft, IconArrowRight } from "@tabler/icons-react";
|
|
||||||
import { useDocsSurface } from "@/features/public-space/components/docs/docs-surface-context.tsx";
|
|
||||||
import { flattenTreePreorder } from "@/features/public-space/utils/docs-tree.ts";
|
|
||||||
import { extractPageSlugId } from "@/lib";
|
|
||||||
import { SharedPageTreeNode } from "@/features/share/utils.ts";
|
|
||||||
import styles from "./docs.module.css";
|
|
||||||
|
|
||||||
export default function DocsPageNav() {
|
|
||||||
const { t } = useTranslation();
|
|
||||||
const { pageSlug } = useParams();
|
|
||||||
const { treeData, getNodeUrl } = useDocsSurface();
|
|
||||||
|
|
||||||
const { prev, next } = useMemo(() => {
|
|
||||||
if (!treeData?.length) {
|
|
||||||
return {
|
|
||||||
prev: null as SharedPageTreeNode | null,
|
|
||||||
next: null as SharedPageTreeNode | null,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
const flat = flattenTreePreorder(treeData);
|
|
||||||
const currentSlugId = pageSlug
|
|
||||||
? extractPageSlugId(pageSlug)
|
|
||||||
: treeData[0]?.slugId;
|
|
||||||
const index = flat.findIndex((node) => node.slugId === currentSlugId);
|
|
||||||
return {
|
|
||||||
prev: index > 0 ? flat[index - 1] : null,
|
|
||||||
next: index >= 0 && index < flat.length - 1 ? flat[index + 1] : null,
|
|
||||||
};
|
|
||||||
}, [treeData, pageSlug]);
|
|
||||||
|
|
||||||
if (!prev && !next) return null;
|
|
||||||
|
|
||||||
return (
|
|
||||||
<nav className={styles.pageNav} aria-label={t("Page navigation")}>
|
|
||||||
{prev && (
|
|
||||||
<Link
|
|
||||||
to={getNodeUrl(prev)}
|
|
||||||
className={styles.pageNavCard}
|
|
||||||
data-direction="prev"
|
|
||||||
>
|
|
||||||
<span className={styles.pageNavLabel}>
|
|
||||||
<IconArrowLeft size={13} stroke={2} aria-hidden />
|
|
||||||
{t("Previous")}
|
|
||||||
</span>
|
|
||||||
<span className={styles.pageNavTitle}>
|
|
||||||
{prev.name || t("untitled")}
|
|
||||||
</span>
|
|
||||||
</Link>
|
|
||||||
)}
|
|
||||||
{next && (
|
|
||||||
<Link
|
|
||||||
to={getNodeUrl(next)}
|
|
||||||
className={styles.pageNavCard}
|
|
||||||
data-direction="next"
|
|
||||||
>
|
|
||||||
<span className={styles.pageNavLabel}>
|
|
||||||
{t("Next")}
|
|
||||||
<IconArrowRight size={13} stroke={2} aria-hidden />
|
|
||||||
</span>
|
|
||||||
<span className={styles.pageNavTitle}>
|
|
||||||
{next.name || t("untitled")}
|
|
||||||
</span>
|
|
||||||
</Link>
|
|
||||||
)}
|
|
||||||
</nav>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
import { IconSearch } from "@tabler/icons-react";
|
|
||||||
import { useTranslation } from "react-i18next";
|
|
||||||
import { platformModifierLabel } from "@/lib";
|
|
||||||
import styles from "./docs.module.css";
|
|
||||||
|
|
||||||
type DocsSearchButtonProps = {
|
|
||||||
onClick: () => void;
|
|
||||||
};
|
|
||||||
|
|
||||||
export default function DocsSearchButton({ onClick }: DocsSearchButtonProps) {
|
|
||||||
const { t } = useTranslation();
|
|
||||||
|
|
||||||
return (
|
|
||||||
<button type="button" className={styles.searchButton} onClick={onClick}>
|
|
||||||
<IconSearch size={15} stroke={2} aria-hidden />
|
|
||||||
<span className={styles.searchLabel}>{t("Search")}</span>
|
|
||||||
<span className={styles.searchKbd} aria-hidden>
|
|
||||||
{platformModifierLabel} K
|
|
||||||
</span>
|
|
||||||
</button>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,223 +0,0 @@
|
|||||||
import React from "react";
|
|
||||||
import { ActionIcon, Drawer, Tooltip } from "@mantine/core";
|
|
||||||
import { Link } from "react-router-dom";
|
|
||||||
import { useAtom } from "jotai";
|
|
||||||
import { useTranslation } from "react-i18next";
|
|
||||||
import { IconList, IconMenu2 } from "@tabler/icons-react";
|
|
||||||
import clsx from "clsx";
|
|
||||||
import {
|
|
||||||
docsMobileSidebarAtom,
|
|
||||||
docsMobileTocAtom,
|
|
||||||
} from "@/features/public-space/atoms/public-space-atoms.ts";
|
|
||||||
import {
|
|
||||||
DocsSurface,
|
|
||||||
DocsSurfaceProvider,
|
|
||||||
} from "@/features/public-space/components/docs/docs-surface-context.tsx";
|
|
||||||
import DocsSidebarTree from "@/features/public-space/components/docs/docs-sidebar-tree.tsx";
|
|
||||||
import DocsToc from "@/features/public-space/components/docs/docs-toc.tsx";
|
|
||||||
import DocsEditPage from "@/features/public-space/components/docs/docs-edit-page.tsx";
|
|
||||||
import DocsCopyPage from "@/features/public-space/components/docs/docs-copy-page.tsx";
|
|
||||||
import DocsSearchButton from "@/features/public-space/components/docs/docs-search-button.tsx";
|
|
||||||
import DocsThemeToggle from "@/features/public-space/components/docs/docs-theme-toggle.tsx";
|
|
||||||
import DocsFooterBranding from "@/features/public-space/components/docs/docs-footer-branding.tsx";
|
|
||||||
import { MAIN_CONTENT_ID, SkipToMain } from "@/components/ui/skip-to-main.tsx";
|
|
||||||
import { SearchMobileControl } from "@/features/search/components/search-control.tsx";
|
|
||||||
import styles from "./docs.module.css";
|
|
||||||
|
|
||||||
const MemoizedDocsSidebarTree = React.memo(DocsSidebarTree);
|
|
||||||
const MANTINE_COLOR_SCHEME_ATTRIBUTE = "data-mantine-color-scheme";
|
|
||||||
const DOCS_PRINT_COLOR_SCHEME_ATTRIBUTE = "data-docs-print-color-scheme";
|
|
||||||
|
|
||||||
type DocsShellProps = {
|
|
||||||
surface: DocsSurface;
|
|
||||||
onSearchOpen?: () => void;
|
|
||||||
searchSpotlight?: React.ReactNode;
|
|
||||||
children: React.ReactNode;
|
|
||||||
};
|
|
||||||
|
|
||||||
export default function DocsShell({
|
|
||||||
surface,
|
|
||||||
onSearchOpen,
|
|
||||||
searchSpotlight,
|
|
||||||
children,
|
|
||||||
}: DocsShellProps) {
|
|
||||||
const { t } = useTranslation();
|
|
||||||
const { hasSidebar, siteName, homeUrl, showBranding, showEditPage } = surface;
|
|
||||||
|
|
||||||
const [mobileSidebarOpen, setMobileSidebarOpen] = useAtom(
|
|
||||||
docsMobileSidebarAtom,
|
|
||||||
);
|
|
||||||
const [mobileTocOpen, setMobileTocOpen] = useAtom(docsMobileTocAtom);
|
|
||||||
|
|
||||||
React.useEffect(() => {
|
|
||||||
const root = document.documentElement;
|
|
||||||
let previousColorScheme: string | null = null;
|
|
||||||
let isPrinting = false;
|
|
||||||
|
|
||||||
const restoreColorScheme = () => {
|
|
||||||
if (!isPrinting) return;
|
|
||||||
|
|
||||||
if (previousColorScheme === null) {
|
|
||||||
root.removeAttribute(MANTINE_COLOR_SCHEME_ATTRIBUTE);
|
|
||||||
} else {
|
|
||||||
root.setAttribute(MANTINE_COLOR_SCHEME_ATTRIBUTE, previousColorScheme);
|
|
||||||
}
|
|
||||||
root.removeAttribute(DOCS_PRINT_COLOR_SCHEME_ATTRIBUTE);
|
|
||||||
isPrinting = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
const useLightPrintTheme = () => {
|
|
||||||
if (isPrinting) return;
|
|
||||||
|
|
||||||
previousColorScheme = root.getAttribute(MANTINE_COLOR_SCHEME_ATTRIBUTE);
|
|
||||||
root.setAttribute(
|
|
||||||
DOCS_PRINT_COLOR_SCHEME_ATTRIBUTE,
|
|
||||||
previousColorScheme ?? "light",
|
|
||||||
);
|
|
||||||
root.setAttribute(MANTINE_COLOR_SCHEME_ATTRIBUTE, "light");
|
|
||||||
isPrinting = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
window.addEventListener("beforeprint", useLightPrintTheme);
|
|
||||||
window.addEventListener("afterprint", restoreColorScheme);
|
|
||||||
|
|
||||||
return () => {
|
|
||||||
window.removeEventListener("beforeprint", useLightPrintTheme);
|
|
||||||
window.removeEventListener("afterprint", restoreColorScheme);
|
|
||||||
restoreColorScheme();
|
|
||||||
};
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
return (
|
|
||||||
<DocsSurfaceProvider value={surface}>
|
|
||||||
<div className={clsx(styles.root, "public-typography")}>
|
|
||||||
<SkipToMain />
|
|
||||||
|
|
||||||
<header className={styles.header}>
|
|
||||||
<div className={styles.headerInner}>
|
|
||||||
<div className={styles.headerLeft}>
|
|
||||||
{hasSidebar && (
|
|
||||||
<Tooltip label={t("Toggle sidebar")}>
|
|
||||||
<ActionIcon
|
|
||||||
variant="subtle"
|
|
||||||
className={clsx(styles.headerAction, styles.sidebarToggle)}
|
|
||||||
size="md"
|
|
||||||
onClick={() => setMobileSidebarOpen((value) => !value)}
|
|
||||||
aria-label={t("Toggle sidebar")}
|
|
||||||
aria-expanded={mobileSidebarOpen}
|
|
||||||
>
|
|
||||||
<IconMenu2 size={18} stroke={2} />
|
|
||||||
</ActionIcon>
|
|
||||||
</Tooltip>
|
|
||||||
)}
|
|
||||||
|
|
||||||
{!hasSidebar && siteName && homeUrl && (
|
|
||||||
<Link to={homeUrl} className={styles.headerSpaceName}>
|
|
||||||
{siteName}
|
|
||||||
</Link>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className={styles.headerCenter}>
|
|
||||||
{onSearchOpen && (
|
|
||||||
<div className={styles.searchSlot}>
|
|
||||||
<DocsSearchButton onClick={onSearchOpen} />
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className={styles.headerRight}>
|
|
||||||
{onSearchOpen && (
|
|
||||||
<span className={styles.mobileOnly}>
|
|
||||||
<SearchMobileControl onSearch={onSearchOpen} />
|
|
||||||
</span>
|
|
||||||
)}
|
|
||||||
|
|
||||||
<DocsThemeToggle />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</header>
|
|
||||||
|
|
||||||
<div className={styles.body}>
|
|
||||||
<nav
|
|
||||||
className={styles.sidebar}
|
|
||||||
data-hidden={!hasSidebar || undefined}
|
|
||||||
aria-label={t("Pages")}
|
|
||||||
aria-hidden={!hasSidebar || undefined}
|
|
||||||
>
|
|
||||||
{hasSidebar && (
|
|
||||||
<>
|
|
||||||
{siteName && homeUrl && (
|
|
||||||
<>
|
|
||||||
<Link to={homeUrl} className={styles.sidebarTitle}>
|
|
||||||
{siteName}
|
|
||||||
</Link>
|
|
||||||
<div className={styles.sidebarDivider} aria-hidden />
|
|
||||||
</>
|
|
||||||
)}
|
|
||||||
<div className={styles.sidebarScroll}>
|
|
||||||
<MemoizedDocsSidebarTree />
|
|
||||||
</div>
|
|
||||||
</>
|
|
||||||
)}
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
<main className={styles.main} id={MAIN_CONTENT_ID} tabIndex={-1}>
|
|
||||||
<div className={styles.article}>
|
|
||||||
<div className={styles.articleActions}>
|
|
||||||
<DocsCopyPage />
|
|
||||||
<span className={styles.tocOverlayControl}>
|
|
||||||
<Tooltip label={t("Table of contents")} withArrow>
|
|
||||||
<ActionIcon
|
|
||||||
variant="subtle"
|
|
||||||
className={styles.headerAction}
|
|
||||||
onClick={() => setMobileTocOpen(true)}
|
|
||||||
size="md"
|
|
||||||
aria-label={t("Table of contents")}
|
|
||||||
>
|
|
||||||
<IconList size={18} stroke={2} />
|
|
||||||
</ActionIcon>
|
|
||||||
</Tooltip>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
{children}
|
|
||||||
{showBranding && (
|
|
||||||
<DocsFooterBranding refSource={surface.brandingRef} />
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
</main>
|
|
||||||
|
|
||||||
<aside className={styles.toc} aria-label={t("On this page")}>
|
|
||||||
<DocsToc />
|
|
||||||
{showEditPage && <DocsEditPage />}
|
|
||||||
</aside>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<Drawer
|
|
||||||
opened={mobileSidebarOpen}
|
|
||||||
onClose={() => setMobileSidebarOpen(false)}
|
|
||||||
title={siteName}
|
|
||||||
size={300}
|
|
||||||
padding="sm"
|
|
||||||
>
|
|
||||||
<div className={styles.drawerTree}>
|
|
||||||
{hasSidebar && <MemoizedDocsSidebarTree />}
|
|
||||||
</div>
|
|
||||||
</Drawer>
|
|
||||||
|
|
||||||
<Drawer
|
|
||||||
opened={mobileTocOpen}
|
|
||||||
onClose={() => setMobileTocOpen(false)}
|
|
||||||
position="right"
|
|
||||||
size={300}
|
|
||||||
padding="md"
|
|
||||||
>
|
|
||||||
<DocsToc />
|
|
||||||
{showEditPage && <DocsEditPage />}
|
|
||||||
</Drawer>
|
|
||||||
|
|
||||||
{searchSpotlight}
|
|
||||||
</div>
|
|
||||||
</DocsSurfaceProvider>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,198 +0,0 @@
|
|||||||
import { SharedPageTreeNode } from "@/features/share/utils.ts";
|
|
||||||
import React, { useCallback, useEffect, useMemo, useRef } from "react";
|
|
||||||
import { Link, useParams } from "react-router-dom";
|
|
||||||
import { useAtom, useSetAtom } from "jotai";
|
|
||||||
import { useTranslation } from "react-i18next";
|
|
||||||
import { IconChevronRight } from "@tabler/icons-react";
|
|
||||||
import { ActionIcon } from "@mantine/core";
|
|
||||||
import { extractPageSlugId } from "@/lib";
|
|
||||||
import {
|
|
||||||
DocTree,
|
|
||||||
type DocTreeApi,
|
|
||||||
type RenderRowProps,
|
|
||||||
} from "@/features/page/tree/components/doc-tree";
|
|
||||||
import {
|
|
||||||
docsMobileSidebarAtom,
|
|
||||||
openPublicSpaceTreeNodesAtom,
|
|
||||||
} from "@/features/public-space/atoms/public-space-atoms.ts";
|
|
||||||
import { useDocsSurface } from "@/features/public-space/components/docs/docs-surface-context.tsx";
|
|
||||||
import { findAncestorTrail } from "@/features/public-space/utils/docs-tree.ts";
|
|
||||||
import styles from "./docs.module.css";
|
|
||||||
|
|
||||||
export default function DocsSidebarTree() {
|
|
||||||
const { t } = useTranslation();
|
|
||||||
const treeRef = useRef<DocTreeApi | null>(null);
|
|
||||||
const { pageSlug } = useParams();
|
|
||||||
const { treeData, getNodeUrl } = useDocsSurface();
|
|
||||||
const [openTreeNodes, setOpenTreeNodes] = useAtom(
|
|
||||||
openPublicSpaceTreeNodesAtom,
|
|
||||||
);
|
|
||||||
|
|
||||||
// The first root page is the surface home, served at the bare URL.
|
|
||||||
const firstRootSlugId = treeData?.[0]?.slugId;
|
|
||||||
|
|
||||||
const currentNodeId = pageSlug ? extractPageSlugId(pageSlug) : firstRootSlugId;
|
|
||||||
|
|
||||||
const openIds = useMemo(
|
|
||||||
() => new Set(Object.keys(openTreeNodes).filter((k) => openTreeNodes[k])),
|
|
||||||
[openTreeNodes],
|
|
||||||
);
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
// Auto-open the first level of the tree on initial load.
|
|
||||||
const root = treeData?.[0];
|
|
||||||
if (!root) return;
|
|
||||||
setOpenTreeNodes((prev) => {
|
|
||||||
if (prev[root.slugId]) return prev;
|
|
||||||
const next = { ...prev, [root.slugId]: true };
|
|
||||||
for (const child of root.children ?? []) {
|
|
||||||
next[child.slugId] = true;
|
|
||||||
}
|
|
||||||
return next;
|
|
||||||
});
|
|
||||||
}, [treeData, setOpenTreeNodes]);
|
|
||||||
|
|
||||||
// Reveal the current page: expand its ancestor trail (deep links land with
|
|
||||||
// everything collapsed otherwise) and the page itself when it has children.
|
|
||||||
useEffect(() => {
|
|
||||||
if (!currentNodeId || !treeData?.length) return;
|
|
||||||
const trail = findAncestorTrail(treeData, currentNodeId);
|
|
||||||
if (trail === null) return;
|
|
||||||
setOpenTreeNodes((prev) => {
|
|
||||||
const next = { ...prev };
|
|
||||||
let changed = false;
|
|
||||||
for (const node of [...trail.map((n) => n.slugId), currentNodeId]) {
|
|
||||||
if (!next[node]) {
|
|
||||||
next[node] = true;
|
|
||||||
changed = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return changed ? next : prev;
|
|
||||||
});
|
|
||||||
}, [currentNodeId, treeData, setOpenTreeNodes]);
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
if (currentNodeId) {
|
|
||||||
treeRef.current?.select(currentNodeId, { scrollIntoView: true });
|
|
||||||
}
|
|
||||||
}, [currentNodeId, treeData]);
|
|
||||||
|
|
||||||
const handleToggle = useCallback(
|
|
||||||
(id: string, isOpen: boolean) =>
|
|
||||||
setOpenTreeNodes((prev) => ({ ...prev, [id]: isOpen })),
|
|
||||||
[setOpenTreeNodes],
|
|
||||||
);
|
|
||||||
const getDragLabel = useCallback(
|
|
||||||
(n: SharedPageTreeNode) => n.name || "untitled",
|
|
||||||
[],
|
|
||||||
);
|
|
||||||
|
|
||||||
const renderRow = useCallback(
|
|
||||||
(props: RenderRowProps<SharedPageTreeNode>) => (
|
|
||||||
<DocsTreeRow {...props} getNodeUrl={getNodeUrl} />
|
|
||||||
),
|
|
||||||
[getNodeUrl],
|
|
||||||
);
|
|
||||||
|
|
||||||
if (!treeData?.length) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
|
||||||
<DocTree<SharedPageTreeNode>
|
|
||||||
readOnly
|
|
||||||
ref={treeRef}
|
|
||||||
data={treeData}
|
|
||||||
openIds={openIds}
|
|
||||||
selectedId={currentNodeId}
|
|
||||||
renderRow={renderRow}
|
|
||||||
indentPerLevel={INDENT_PER_LEVEL}
|
|
||||||
rowHeight={36}
|
|
||||||
dynamicRowHeight
|
|
||||||
rowClassName={styles.treeNodeChrome}
|
|
||||||
onMove={noopMove}
|
|
||||||
onToggle={handleToggle}
|
|
||||||
getDragLabel={getDragLabel}
|
|
||||||
aria-label={t("Pages")}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Module-scope noop so it's a stable reference across renders.
|
|
||||||
const noopMove = () => {};
|
|
||||||
|
|
||||||
const INDENT_PER_LEVEL = 16;
|
|
||||||
|
|
||||||
|
|
||||||
type DocsTreeRowProps = RenderRowProps<SharedPageTreeNode> & {
|
|
||||||
getNodeUrl: (node: Pick<SharedPageTreeNode, "slugId" | "name">) => string;
|
|
||||||
};
|
|
||||||
|
|
||||||
function DocsTreeRow({
|
|
||||||
node,
|
|
||||||
level,
|
|
||||||
isOpen,
|
|
||||||
hasChildren,
|
|
||||||
isSelected,
|
|
||||||
rowRef,
|
|
||||||
tabIndex,
|
|
||||||
treeItemProps,
|
|
||||||
toggleOpen,
|
|
||||||
getNodeUrl,
|
|
||||||
}: DocsTreeRowProps) {
|
|
||||||
const { t } = useTranslation();
|
|
||||||
const setMobileSidebarOpen = useSetAtom(docsMobileSidebarAtom);
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Link
|
|
||||||
ref={rowRef as React.Ref<HTMLAnchorElement>}
|
|
||||||
tabIndex={tabIndex}
|
|
||||||
{...treeItemProps}
|
|
||||||
data-selected={isSelected || undefined}
|
|
||||||
data-open-parent={(level === 0 && isOpen && hasChildren) || undefined}
|
|
||||||
className={styles.treeRow}
|
|
||||||
to={getNodeUrl(node)}
|
|
||||||
onClick={() => {
|
|
||||||
setMobileSidebarOpen(false);
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{/* One segment per ancestor level; contiguous rows join into a rail. */}
|
|
||||||
{Array.from({ length: level }, (_, ancestor) => (
|
|
||||||
<span
|
|
||||||
key={ancestor}
|
|
||||||
className={styles.treeGuide}
|
|
||||||
style={{ left: -((level - ancestor) * INDENT_PER_LEVEL - 6) }}
|
|
||||||
aria-hidden
|
|
||||||
/>
|
|
||||||
))}
|
|
||||||
{node.icon && (
|
|
||||||
<span className={styles.treeIcon} aria-hidden>
|
|
||||||
{node.icon}
|
|
||||||
</span>
|
|
||||||
)}
|
|
||||||
<span className={styles.treeText}>{node.name || t("untitled")}</span>
|
|
||||||
{hasChildren && (
|
|
||||||
<ActionIcon
|
|
||||||
component="span"
|
|
||||||
variant="subtle"
|
|
||||||
color="gray"
|
|
||||||
size={20}
|
|
||||||
tabIndex={-1}
|
|
||||||
aria-hidden
|
|
||||||
onClick={(e) => {
|
|
||||||
e.preventDefault();
|
|
||||||
e.stopPropagation();
|
|
||||||
toggleOpen();
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<IconChevronRight
|
|
||||||
className={styles.treeChevron}
|
|
||||||
data-open={isOpen || undefined}
|
|
||||||
stroke={2}
|
|
||||||
size={14}
|
|
||||||
/>
|
|
||||||
</ActionIcon>
|
|
||||||
)}
|
|
||||||
</Link>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,27 +0,0 @@
|
|||||||
import { createContext, useContext } from "react";
|
|
||||||
import { SharedPageTreeNode } from "@/features/share/utils.ts";
|
|
||||||
|
|
||||||
// What varies between the public surfaces (/docs and /share) rendered by the
|
|
||||||
// docs shell; every shell component reads this contract instead of a feature.
|
|
||||||
export type DocsSurface = {
|
|
||||||
treeData: SharedPageTreeNode[] | null;
|
|
||||||
hasSidebar: boolean;
|
|
||||||
siteName?: string;
|
|
||||||
homeUrl?: string;
|
|
||||||
getNodeUrl: (node: Pick<SharedPageTreeNode, "slugId" | "name">) => string;
|
|
||||||
showBranding: boolean;
|
|
||||||
showEditPage: boolean;
|
|
||||||
brandingRef?: string;
|
|
||||||
};
|
|
||||||
|
|
||||||
const DocsSurfaceContext = createContext<DocsSurface | null>(null);
|
|
||||||
|
|
||||||
export const DocsSurfaceProvider = DocsSurfaceContext.Provider;
|
|
||||||
|
|
||||||
export function useDocsSurface(): DocsSurface {
|
|
||||||
const surface = useContext(DocsSurfaceContext);
|
|
||||||
if (!surface) {
|
|
||||||
throw new Error("useDocsSurface must be used within DocsShell");
|
|
||||||
}
|
|
||||||
return surface;
|
|
||||||
}
|
|
||||||
@@ -1,35 +0,0 @@
|
|||||||
import {
|
|
||||||
ActionIcon,
|
|
||||||
Tooltip,
|
|
||||||
useComputedColorScheme,
|
|
||||||
useMantineColorScheme,
|
|
||||||
} from "@mantine/core";
|
|
||||||
import { IconMoon, IconSun } from "@tabler/icons-react";
|
|
||||||
import { useTranslation } from "react-i18next";
|
|
||||||
import styles from "./docs.module.css";
|
|
||||||
|
|
||||||
export default function DocsThemeToggle() {
|
|
||||||
const { t } = useTranslation();
|
|
||||||
const { setColorScheme } = useMantineColorScheme();
|
|
||||||
const computedColorScheme = useComputedColorScheme("light");
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Tooltip label={t("Toggle color scheme")} withArrow>
|
|
||||||
<ActionIcon
|
|
||||||
variant="subtle"
|
|
||||||
className={styles.headerAction}
|
|
||||||
size="md"
|
|
||||||
onClick={() =>
|
|
||||||
setColorScheme(computedColorScheme === "light" ? "dark" : "light")
|
|
||||||
}
|
|
||||||
aria-label={t("Toggle color scheme")}
|
|
||||||
>
|
|
||||||
{computedColorScheme === "light" ? (
|
|
||||||
<IconMoon size={18} stroke={1.75} />
|
|
||||||
) : (
|
|
||||||
<IconSun size={18} stroke={1.75} />
|
|
||||||
)}
|
|
||||||
</ActionIcon>
|
|
||||||
</Tooltip>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,116 +0,0 @@
|
|||||||
import { useCallback, useEffect, useState } from "react";
|
|
||||||
import { TextSelection } from "@tiptap/pm/state";
|
|
||||||
import { useAtomValue } from "jotai";
|
|
||||||
import { useTranslation } from "react-i18next";
|
|
||||||
import { readOnlyEditorAtom } from "@/features/editor/atoms/editor-atoms.ts";
|
|
||||||
import {
|
|
||||||
HeadingLink,
|
|
||||||
recalculateLinks,
|
|
||||||
} from "@/features/editor/components/table-of-contents/table-of-contents.tsx";
|
|
||||||
import styles from "./docs.module.css";
|
|
||||||
|
|
||||||
function getHeaderOffset(): number {
|
|
||||||
const raw = getComputedStyle(document.documentElement).getPropertyValue(
|
|
||||||
"--docs-header-h",
|
|
||||||
);
|
|
||||||
const parsed = parseInt(raw, 10);
|
|
||||||
return Number.isNaN(parsed) ? 56 : parsed;
|
|
||||||
}
|
|
||||||
|
|
||||||
export default function DocsToc() {
|
|
||||||
const { t } = useTranslation();
|
|
||||||
const editor = useAtomValue(readOnlyEditorAtom);
|
|
||||||
const [links, setLinks] = useState<HeadingLink[]>([]);
|
|
||||||
const [headingDOMNodes, setHeadingDOMNodes] = useState<HTMLElement[]>([]);
|
|
||||||
const [activeElement, setActiveElement] = useState<HTMLElement | null>(null);
|
|
||||||
|
|
||||||
const handleUpdate = useCallback(() => {
|
|
||||||
if (!editor || editor.isDestroyed) return;
|
|
||||||
const result = recalculateLinks(editor.$nodes("heading"));
|
|
||||||
setLinks(result.links);
|
|
||||||
setHeadingDOMNodes(result.nodes);
|
|
||||||
}, [editor]);
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
// "create" repopulates once the editor view mounts after this component.
|
|
||||||
editor?.on("create", handleUpdate);
|
|
||||||
editor?.on("update", handleUpdate);
|
|
||||||
handleUpdate();
|
|
||||||
|
|
||||||
return () => {
|
|
||||||
editor?.off("create", handleUpdate);
|
|
||||||
editor?.off("update", handleUpdate);
|
|
||||||
};
|
|
||||||
}, [editor, handleUpdate]);
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
const observer = new IntersectionObserver(
|
|
||||||
(entries) => {
|
|
||||||
entries.forEach((entry) => {
|
|
||||||
if (entry.isIntersecting) {
|
|
||||||
setActiveElement(entry.target as HTMLElement);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
{
|
|
||||||
rootMargin: `-${getHeaderOffset()}px 0px -85% 0px`,
|
|
||||||
threshold: 0,
|
|
||||||
root: null,
|
|
||||||
},
|
|
||||||
);
|
|
||||||
|
|
||||||
headingDOMNodes.forEach((heading) => observer.observe(heading));
|
|
||||||
return () => {
|
|
||||||
headingDOMNodes.forEach((heading) => observer.unobserve(heading));
|
|
||||||
};
|
|
||||||
}, [headingDOMNodes]);
|
|
||||||
|
|
||||||
const handleScrollToHeading = (position: number) => {
|
|
||||||
if (!editor || editor.isDestroyed) return;
|
|
||||||
const { view } = editor;
|
|
||||||
|
|
||||||
const { node } = view.domAtPos(position);
|
|
||||||
const element = node as HTMLElement;
|
|
||||||
const scrollPosition =
|
|
||||||
element.getBoundingClientRect().top +
|
|
||||||
window.scrollY -
|
|
||||||
getHeaderOffset() -
|
|
||||||
16;
|
|
||||||
|
|
||||||
window.scrollTo({ top: scrollPosition, behavior: "smooth" });
|
|
||||||
|
|
||||||
const tr = view.state.tr;
|
|
||||||
tr.setSelection(new TextSelection(tr.doc.resolve(position)));
|
|
||||||
view.dispatch(tr);
|
|
||||||
view.focus();
|
|
||||||
};
|
|
||||||
|
|
||||||
if (!links.length) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
const minLevel = Math.min(...links.map((link) => link.level));
|
|
||||||
const effectiveActive = activeElement ?? links[0]?.element;
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div>
|
|
||||||
<span className={styles.tocLabel}>{t("On this page")}</span>
|
|
||||||
<div className={styles.tocList}>
|
|
||||||
{links.map((item, idx) => (
|
|
||||||
<button
|
|
||||||
type="button"
|
|
||||||
key={idx}
|
|
||||||
className={styles.tocLink}
|
|
||||||
data-active={item.element === effectiveActive || undefined}
|
|
||||||
style={{
|
|
||||||
paddingLeft: `${(item.level - minLevel) * 12 + 11}px`,
|
|
||||||
}}
|
|
||||||
onClick={() => handleScrollToHeading(item.position)}
|
|
||||||
>
|
|
||||||
{item.label}
|
|
||||||
</button>
|
|
||||||
))}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,952 +0,0 @@
|
|||||||
/* Design tokens for the public docs surface. Declared on :root (not .root)
|
|
||||||
* because mobile drawers and the spotlight render in portals outside the shell
|
|
||||||
* subtree. The accent pair is overridden at runtime by docs-theme.ts. */
|
|
||||||
/* light-dark() cannot live in a bare :root block (the transform emits a
|
|
||||||
* descendant selector that never matches :root), so dark values get their own
|
|
||||||
* attribute-qualified block; flipping semantics ride Mantine's own vars. */
|
|
||||||
:root {
|
|
||||||
--docs-header-h: 56px;
|
|
||||||
--docs-sidebar-w: 280px;
|
|
||||||
--docs-toc-w: 240px;
|
|
||||||
--docs-site-max: 96rem;
|
|
||||||
--docs-content-max: 54rem;
|
|
||||||
--docs-radius: 6px;
|
|
||||||
|
|
||||||
--docs-accent: #2b7af1;
|
|
||||||
--docs-accent-soft: color-mix(in srgb, var(--docs-accent) 10%, transparent);
|
|
||||||
|
|
||||||
--docs-bg: oklch(99% 0 0);
|
|
||||||
--docs-fg: oklch(21% 0 0);
|
|
||||||
--docs-content-fg: var(--docs-fg);
|
|
||||||
--docs-nav-fg: oklch(47% 0 0);
|
|
||||||
--docs-muted: var(--mantine-color-dimmed);
|
|
||||||
--docs-hover: var(--mantine-color-default-hover);
|
|
||||||
--docs-faint: var(--mantine-color-gray-6);
|
|
||||||
--docs-border: var(--mantine-color-gray-2);
|
|
||||||
--docs-header-bg: color-mix(in srgb, var(--docs-bg) 78%, transparent);
|
|
||||||
}
|
|
||||||
|
|
||||||
:root[data-mantine-color-scheme="dark"] {
|
|
||||||
--docs-bg: var(--mantine-color-body);
|
|
||||||
--docs-fg: oklch(90% 0 0);
|
|
||||||
--docs-nav-fg: oklch(72% 0 0);
|
|
||||||
--docs-faint: var(--mantine-color-dark-2);
|
|
||||||
--docs-border: var(--mantine-color-dark-5);
|
|
||||||
}
|
|
||||||
|
|
||||||
.root {
|
|
||||||
min-height: 100dvh;
|
|
||||||
background-color: var(--docs-bg);
|
|
||||||
color: var(--docs-fg);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ---------- Header ---------- */
|
|
||||||
|
|
||||||
.header {
|
|
||||||
position: sticky;
|
|
||||||
top: 0;
|
|
||||||
z-index: 90;
|
|
||||||
height: var(--docs-header-h);
|
|
||||||
padding-inline: rem(20px);
|
|
||||||
background-color: var(--docs-header-bg);
|
|
||||||
backdrop-filter: saturate(180%) blur(10px);
|
|
||||||
-webkit-backdrop-filter: saturate(180%) blur(10px);
|
|
||||||
border-bottom: 1px solid var(--docs-border);
|
|
||||||
}
|
|
||||||
|
|
||||||
.headerInner {
|
|
||||||
max-width: var(--docs-site-max);
|
|
||||||
margin-inline: auto;
|
|
||||||
height: 100%;
|
|
||||||
display: grid;
|
|
||||||
grid-template-columns: 1fr auto 1fr;
|
|
||||||
align-items: center;
|
|
||||||
gap: rem(16px);
|
|
||||||
}
|
|
||||||
|
|
||||||
.headerLeft {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: rem(10px);
|
|
||||||
min-width: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.headerCenter {
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
min-width: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.headerRight {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: flex-end;
|
|
||||||
gap: rem(4px);
|
|
||||||
}
|
|
||||||
|
|
||||||
.searchSlot {
|
|
||||||
@media (max-width: $mantine-breakpoint-sm) {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.mobileOnly {
|
|
||||||
display: inline-flex;
|
|
||||||
|
|
||||||
@media (min-width: $mantine-breakpoint-sm) {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Plain space name in the header, used only when there is no sidebar to
|
|
||||||
* carry it. The brand slot is reserved for future org logo/name support. */
|
|
||||||
.headerSpaceName {
|
|
||||||
font-size: rem(14.5px);
|
|
||||||
font-weight: 600;
|
|
||||||
letter-spacing: -0.011em;
|
|
||||||
color: var(--docs-fg);
|
|
||||||
text-decoration: none;
|
|
||||||
white-space: nowrap;
|
|
||||||
overflow: hidden;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
border-radius: var(--docs-radius);
|
|
||||||
padding: rem(4px) rem(6px);
|
|
||||||
|
|
||||||
&:focus-visible {
|
|
||||||
outline: 2px solid var(--docs-accent);
|
|
||||||
outline-offset: 1px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Burger appears only once the sidebar column is collapsed. */
|
|
||||||
@media (min-width: 64em) {
|
|
||||||
.sidebarToggle {
|
|
||||||
display: none !important;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.headerAction {
|
|
||||||
color: var(--docs-faint);
|
|
||||||
border-radius: var(--docs-radius);
|
|
||||||
|
|
||||||
@media (hover: hover) {
|
|
||||||
&:hover {
|
|
||||||
color: var(--docs-fg);
|
|
||||||
background-color: var(--docs-hover);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ---------- Search ---------- */
|
|
||||||
|
|
||||||
.searchButton {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: rem(8px);
|
|
||||||
width: rem(320px);
|
|
||||||
height: rem(34px);
|
|
||||||
padding-inline: rem(10px);
|
|
||||||
border: 1px solid var(--docs-border);
|
|
||||||
border-radius: rem(8px);
|
|
||||||
background-color: var(--docs-bg);
|
|
||||||
color: var(--docs-muted);
|
|
||||||
font-size: rem(13px);
|
|
||||||
cursor: pointer;
|
|
||||||
transition: border-color 120ms ease;
|
|
||||||
|
|
||||||
@media (hover: hover) {
|
|
||||||
&:hover {
|
|
||||||
border-color: light-dark(
|
|
||||||
var(--mantine-color-gray-4),
|
|
||||||
var(--mantine-color-dark-3)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&:focus-visible {
|
|
||||||
outline: 2px solid var(--docs-accent);
|
|
||||||
outline-offset: 1px;
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (max-width: 62em) {
|
|
||||||
width: rem(220px);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.searchLabel {
|
|
||||||
flex: 1;
|
|
||||||
text-align: left;
|
|
||||||
}
|
|
||||||
|
|
||||||
.searchKbd {
|
|
||||||
font-size: rem(11px);
|
|
||||||
font-weight: 500;
|
|
||||||
color: var(--docs-faint);
|
|
||||||
border: 1px solid var(--docs-border);
|
|
||||||
border-radius: rem(4px);
|
|
||||||
padding: rem(1px) rem(5px);
|
|
||||||
line-height: 1.4;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Quiet bordered chip in the docs palette instead of Mantine's full-ink default. */
|
|
||||||
.copyPageButton {
|
|
||||||
color: var(--docs-muted);
|
|
||||||
border-color: var(--docs-border);
|
|
||||||
background-color: transparent;
|
|
||||||
font-size: rem(13px);
|
|
||||||
font-weight: 500;
|
|
||||||
border-radius: var(--docs-radius);
|
|
||||||
|
|
||||||
@media (hover: hover) {
|
|
||||||
&:hover {
|
|
||||||
color: var(--docs-fg);
|
|
||||||
background-color: var(--docs-hover);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Page actions pinned to the article's top-right corner; on small viewports
|
|
||||||
* they drop into flow above the content so breadcrumbs never run under them. */
|
|
||||||
.articleActions {
|
|
||||||
position: absolute;
|
|
||||||
top: rem(30px);
|
|
||||||
right: rem(24px);
|
|
||||||
display: inline-flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: rem(6px);
|
|
||||||
|
|
||||||
@media (max-width: $mantine-breakpoint-sm) {
|
|
||||||
position: static;
|
|
||||||
display: flex;
|
|
||||||
justify-content: flex-end;
|
|
||||||
margin-bottom: rem(4px);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Below the rail breakpoint the toc opens as a drawer overlay instead. */
|
|
||||||
.tocOverlayControl {
|
|
||||||
display: inline-flex;
|
|
||||||
|
|
||||||
@media (min-width: 75em) {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ---------- Body grid ---------- */
|
|
||||||
|
|
||||||
/* Contained site layout: rails anchor the edges of a centered max-width
|
|
||||||
* container, the article centers itself in the fixed middle track. Hiding a
|
|
||||||
* rail keeps its track, so toggling never moves the content column. */
|
|
||||||
.body {
|
|
||||||
max-width: var(--docs-site-max);
|
|
||||||
margin-inline: auto;
|
|
||||||
display: grid;
|
|
||||||
grid-template-columns:
|
|
||||||
var(--docs-sidebar-w)
|
|
||||||
minmax(0, 1fr)
|
|
||||||
var(--docs-toc-w);
|
|
||||||
align-items: start;
|
|
||||||
}
|
|
||||||
|
|
||||||
.sidebar {
|
|
||||||
grid-column: 1;
|
|
||||||
width: var(--docs-sidebar-w);
|
|
||||||
position: sticky;
|
|
||||||
top: var(--docs-header-h);
|
|
||||||
height: calc(100dvh - var(--docs-header-h));
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
padding: rem(20px) rem(10px) rem(16px) rem(20px);
|
|
||||||
opacity: 1;
|
|
||||||
transform: translateX(0);
|
|
||||||
transition:
|
|
||||||
opacity 160ms ease,
|
|
||||||
transform 160ms ease;
|
|
||||||
}
|
|
||||||
|
|
||||||
.sidebar[data-hidden="true"] {
|
|
||||||
visibility: hidden;
|
|
||||||
opacity: 0;
|
|
||||||
transform: translateX(rem(-8px));
|
|
||||||
}
|
|
||||||
|
|
||||||
.sidebarTitle {
|
|
||||||
display: block;
|
|
||||||
font-size: rem(14px);
|
|
||||||
font-weight: 600;
|
|
||||||
letter-spacing: -0.011em;
|
|
||||||
color: var(--docs-fg);
|
|
||||||
text-decoration: none;
|
|
||||||
white-space: nowrap;
|
|
||||||
overflow: hidden;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
border-radius: var(--docs-radius);
|
|
||||||
padding: rem(5px) rem(8px);
|
|
||||||
|
|
||||||
@media (hover: hover) {
|
|
||||||
&:hover {
|
|
||||||
color: var(--docs-accent);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&:focus-visible {
|
|
||||||
outline: 2px solid var(--docs-accent);
|
|
||||||
outline-offset: -2px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.sidebarDivider {
|
|
||||||
height: 1px;
|
|
||||||
background-color: var(--docs-border);
|
|
||||||
margin: rem(10px) 0 rem(14px);
|
|
||||||
flex-shrink: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.sidebarScroll {
|
|
||||||
flex: 1;
|
|
||||||
min-height: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.main {
|
|
||||||
grid-column: 2;
|
|
||||||
min-width: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.article {
|
|
||||||
max-width: var(--docs-content-max);
|
|
||||||
margin-inline: auto;
|
|
||||||
padding: rem(36px) rem(32px) rem(72px);
|
|
||||||
position: relative;
|
|
||||||
}
|
|
||||||
|
|
||||||
.toc {
|
|
||||||
grid-column: 3;
|
|
||||||
width: var(--docs-toc-w);
|
|
||||||
position: sticky;
|
|
||||||
top: var(--docs-header-h);
|
|
||||||
max-height: calc(100dvh - var(--docs-header-h));
|
|
||||||
overflow-y: auto;
|
|
||||||
scrollbar-width: thin;
|
|
||||||
padding: rem(36px) rem(16px) rem(24px) rem(4px);
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (max-width: 75em) {
|
|
||||||
.body {
|
|
||||||
grid-template-columns: var(--docs-sidebar-w) minmax(0, 1fr);
|
|
||||||
}
|
|
||||||
|
|
||||||
.toc {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Below 64em the sidebar collapses into the burger drawer. */
|
|
||||||
@media (max-width: 64em) {
|
|
||||||
.body {
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
|
|
||||||
.sidebar {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (max-width: $mantine-breakpoint-sm) {
|
|
||||||
.article {
|
|
||||||
padding: rem(24px) rem(20px) rem(56px);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (prefers-reduced-motion: reduce) {
|
|
||||||
.body,
|
|
||||||
.sidebar,
|
|
||||||
.toc,
|
|
||||||
.searchButton {
|
|
||||||
transition: none;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ---------- Sidebar tree ---------- */
|
|
||||||
|
|
||||||
/* Applied through DocTree's rowClassName onto the engine wrapper that carries
|
|
||||||
* data-selected. Class doubled to outrank the engine's own module styles. */
|
|
||||||
.treeNodeChrome.treeNodeChrome {
|
|
||||||
border-radius: var(--docs-radius);
|
|
||||||
color: var(--docs-nav-fg);
|
|
||||||
|
|
||||||
@media (hover: hover) {
|
|
||||||
&:hover {
|
|
||||||
background-color: var(--docs-hover);
|
|
||||||
color: var(--docs-fg);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.treeNodeChrome.treeNodeChrome[data-selected="true"] {
|
|
||||||
background-color: var(--docs-accent-soft);
|
|
||||||
}
|
|
||||||
|
|
||||||
.treeRow {
|
|
||||||
position: relative;
|
|
||||||
display: flex;
|
|
||||||
align-items: flex-start;
|
|
||||||
gap: rem(8px);
|
|
||||||
width: 100%;
|
|
||||||
min-width: 0;
|
|
||||||
min-height: rem(32px);
|
|
||||||
padding: rem(6px) rem(4px) rem(6px) rem(8px);
|
|
||||||
text-decoration: none;
|
|
||||||
color: inherit;
|
|
||||||
font-size: rem(14px);
|
|
||||||
font-weight: 400;
|
|
||||||
line-height: 1.45;
|
|
||||||
border-radius: var(--docs-radius);
|
|
||||||
|
|
||||||
&:focus-visible {
|
|
||||||
outline: 2px solid var(--docs-accent);
|
|
||||||
outline-offset: -2px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Expanded parents read as section headers. */
|
|
||||||
.treeRow[data-open-parent="true"] {
|
|
||||||
color: var(--docs-fg);
|
|
||||||
font-weight: 500;
|
|
||||||
}
|
|
||||||
|
|
||||||
.treeRow[data-selected="true"] {
|
|
||||||
color: var(--docs-accent);
|
|
||||||
font-weight: 500;
|
|
||||||
}
|
|
||||||
|
|
||||||
.treeIcon {
|
|
||||||
display: inline-flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
width: rem(18px);
|
|
||||||
font-size: rem(14px);
|
|
||||||
line-height: 1;
|
|
||||||
flex-shrink: 0;
|
|
||||||
margin-top: rem(2px);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Names wrap instead of truncating: the sidebar has a fixed width, so an
|
|
||||||
* ellipsis would permanently hide the tail of long titles. */
|
|
||||||
.treeText {
|
|
||||||
flex: 1;
|
|
||||||
min-width: 0;
|
|
||||||
overflow-wrap: anywhere;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Nesting rail: each row draws its ancestors' segments in the indent gutter;
|
|
||||||
* the -2px bleed covers the engine's row padding so segments connect. */
|
|
||||||
.treeGuide {
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
bottom: rem(-2px);
|
|
||||||
width: 1px;
|
|
||||||
background-color: var(--docs-border);
|
|
||||||
pointer-events: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.treeChevron {
|
|
||||||
flex-shrink: 0;
|
|
||||||
color: var(--docs-faint);
|
|
||||||
transition: transform 140ms ease;
|
|
||||||
}
|
|
||||||
|
|
||||||
.treeChevron[data-open="true"] {
|
|
||||||
transform: rotate(90deg);
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (prefers-reduced-motion: reduce) {
|
|
||||||
.treeChevron {
|
|
||||||
transition: none;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ---------- Table of contents ---------- */
|
|
||||||
|
|
||||||
.tocLabel {
|
|
||||||
display: block;
|
|
||||||
font-size: rem(11px);
|
|
||||||
font-weight: 600;
|
|
||||||
letter-spacing: 0.05em;
|
|
||||||
text-transform: uppercase;
|
|
||||||
color: var(--docs-muted);
|
|
||||||
margin-bottom: rem(10px);
|
|
||||||
}
|
|
||||||
|
|
||||||
.tocList {
|
|
||||||
border-left: 1px solid var(--docs-border);
|
|
||||||
}
|
|
||||||
|
|
||||||
.tocLink {
|
|
||||||
display: block;
|
|
||||||
width: 100%;
|
|
||||||
text-align: left;
|
|
||||||
background: none;
|
|
||||||
border: 0;
|
|
||||||
border-left: 2px solid transparent;
|
|
||||||
margin-left: -1px;
|
|
||||||
padding: rem(4px) rem(8px) rem(4px) rem(11px);
|
|
||||||
font-size: rem(13px);
|
|
||||||
line-height: 1.45;
|
|
||||||
color: var(--docs-muted);
|
|
||||||
cursor: pointer;
|
|
||||||
overflow-wrap: break-word;
|
|
||||||
|
|
||||||
@media (hover: hover) {
|
|
||||||
&:hover {
|
|
||||||
color: var(--docs-fg);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&:focus-visible {
|
|
||||||
outline: 2px solid var(--docs-accent);
|
|
||||||
outline-offset: -2px;
|
|
||||||
border-radius: rem(2px);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.tocLink[data-active="true"] {
|
|
||||||
color: var(--docs-accent);
|
|
||||||
border-left-color: var(--docs-accent);
|
|
||||||
font-weight: 500;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ---------- Edit page (signed-in visitors) ---------- */
|
|
||||||
|
|
||||||
.editPageLink {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: rem(6px);
|
|
||||||
margin-top: rem(16px);
|
|
||||||
padding-top: rem(14px);
|
|
||||||
border-top: 1px solid var(--docs-border);
|
|
||||||
font-size: rem(13px);
|
|
||||||
color: var(--docs-muted);
|
|
||||||
text-decoration: none;
|
|
||||||
|
|
||||||
@media (hover: hover) {
|
|
||||||
&:hover {
|
|
||||||
color: var(--docs-fg);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&:focus-visible {
|
|
||||||
outline: 2px solid var(--docs-accent);
|
|
||||||
outline-offset: 2px;
|
|
||||||
border-radius: rem(2px);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ---------- Footer branding ---------- */
|
|
||||||
|
|
||||||
.footer {
|
|
||||||
margin-top: rem(40px);
|
|
||||||
padding-top: rem(16px);
|
|
||||||
border-top: 1px solid var(--docs-border);
|
|
||||||
}
|
|
||||||
|
|
||||||
.footerBranding {
|
|
||||||
font-size: rem(14px);
|
|
||||||
color: var(--docs-muted);
|
|
||||||
text-decoration: none;
|
|
||||||
|
|
||||||
@media (hover: hover) {
|
|
||||||
&:hover {
|
|
||||||
color: var(--docs-fg);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&:focus-visible {
|
|
||||||
outline: 2px solid var(--docs-accent);
|
|
||||||
outline-offset: 2px;
|
|
||||||
border-radius: rem(2px);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ---------- Breadcrumbs ---------- */
|
|
||||||
|
|
||||||
.breadcrumbs {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
gap: rem(4px);
|
|
||||||
font-size: rem(13px);
|
|
||||||
color: var(--docs-muted);
|
|
||||||
margin-bottom: rem(6px);
|
|
||||||
/* keep long trails clear of the pinned page actions */
|
|
||||||
padding-right: rem(160px);
|
|
||||||
|
|
||||||
@media (max-width: $mantine-breakpoint-sm) {
|
|
||||||
padding-right: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.crumbLink {
|
|
||||||
color: var(--docs-muted);
|
|
||||||
text-decoration: none;
|
|
||||||
border-radius: rem(4px);
|
|
||||||
padding: rem(1px) rem(3px);
|
|
||||||
max-width: rem(220px);
|
|
||||||
white-space: nowrap;
|
|
||||||
overflow: hidden;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
|
|
||||||
@media (hover: hover) {
|
|
||||||
&:hover {
|
|
||||||
color: var(--docs-accent);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&:focus-visible {
|
|
||||||
outline: 2px solid var(--docs-accent);
|
|
||||||
outline-offset: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.crumbSeparator {
|
|
||||||
color: light-dark(
|
|
||||||
var(--mantine-color-gray-4),
|
|
||||||
var(--mantine-color-dark-3)
|
|
||||||
);
|
|
||||||
user-select: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.crumbEllipsis {
|
|
||||||
color: var(--docs-muted);
|
|
||||||
border: 0;
|
|
||||||
background: none;
|
|
||||||
cursor: pointer;
|
|
||||||
border-radius: rem(4px);
|
|
||||||
padding: rem(1px) rem(4px);
|
|
||||||
|
|
||||||
@media (hover: hover) {
|
|
||||||
&:hover {
|
|
||||||
color: var(--docs-accent);
|
|
||||||
background-color: var(--docs-hover);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&:focus-visible {
|
|
||||||
outline: 2px solid var(--docs-accent);
|
|
||||||
outline-offset: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ---------- Byline ---------- */
|
|
||||||
|
|
||||||
/* Pulled up into the title's own bottom margin so it reads as one block. */
|
|
||||||
.byline {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
gap: rem(8px);
|
|
||||||
margin-top: rem(-16px);
|
|
||||||
margin-bottom: rem(28px);
|
|
||||||
font-size: rem(13px);
|
|
||||||
color: var(--docs-muted);
|
|
||||||
}
|
|
||||||
|
|
||||||
.bylineAuthor {
|
|
||||||
display: inline-flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: rem(6px);
|
|
||||||
}
|
|
||||||
|
|
||||||
.bylineDot {
|
|
||||||
color: var(--docs-faint);
|
|
||||||
user-select: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ---------- Prev / next ---------- */
|
|
||||||
|
|
||||||
.pageNav {
|
|
||||||
display: grid;
|
|
||||||
grid-template-columns: 1fr 1fr;
|
|
||||||
gap: rem(12px);
|
|
||||||
margin-top: rem(48px);
|
|
||||||
}
|
|
||||||
|
|
||||||
.pageNavCard {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
gap: rem(4px);
|
|
||||||
padding: rem(12px) rem(16px);
|
|
||||||
border: 1px solid var(--docs-border);
|
|
||||||
border-radius: rem(10px);
|
|
||||||
text-decoration: none;
|
|
||||||
min-width: 0;
|
|
||||||
transition: border-color 120ms ease;
|
|
||||||
|
|
||||||
@media (hover: hover) {
|
|
||||||
&:hover {
|
|
||||||
border-color: var(--docs-accent);
|
|
||||||
}
|
|
||||||
|
|
||||||
&:hover .pageNavTitle {
|
|
||||||
color: var(--docs-accent);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&:focus-visible {
|
|
||||||
outline: 2px solid var(--docs-accent);
|
|
||||||
outline-offset: 1px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.pageNavCard[data-direction="next"] {
|
|
||||||
grid-column: 2;
|
|
||||||
align-items: flex-end;
|
|
||||||
text-align: right;
|
|
||||||
}
|
|
||||||
|
|
||||||
.pageNavLabel {
|
|
||||||
display: inline-flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: rem(4px);
|
|
||||||
font-size: rem(12px);
|
|
||||||
color: var(--docs-muted);
|
|
||||||
}
|
|
||||||
|
|
||||||
.pageNavTitle {
|
|
||||||
font-size: rem(14px);
|
|
||||||
font-weight: 500;
|
|
||||||
color: var(--docs-fg);
|
|
||||||
max-width: 100%;
|
|
||||||
white-space: nowrap;
|
|
||||||
overflow: hidden;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
transition: color 120ms ease;
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (max-width: $mantine-breakpoint-sm) {
|
|
||||||
.pageNav {
|
|
||||||
grid-template-columns: 1fr;
|
|
||||||
}
|
|
||||||
|
|
||||||
.pageNavCard[data-direction="next"] {
|
|
||||||
grid-column: auto;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ---------- Content ---------- */
|
|
||||||
|
|
||||||
/* Reading typography: body copy softens to a blue-gray with relaxed leading
|
|
||||||
* while headings and bold keep full contrast. Class doubled to outrank the
|
|
||||||
* shared .public-typography metrics regardless of stylesheet order. */
|
|
||||||
.root.root :global(.ProseMirror) {
|
|
||||||
color: var(--docs-content-fg);
|
|
||||||
line-height: 1.75;
|
|
||||||
letter-spacing: normal;
|
|
||||||
/* The article owns horizontal spacing here; the editor's 3rem gutter would
|
|
||||||
* misalign content with the breadcrumb, and its own background bands
|
|
||||||
* against the off-white page. */
|
|
||||||
padding-left: 0;
|
|
||||||
padding-right: 0;
|
|
||||||
background-color: transparent;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Wide columns bleed into the editor gutter that no longer exists here. */
|
|
||||||
.root.root :global(div[data-type="columns"][data-width-mode="wide"]) {
|
|
||||||
margin-left: 0;
|
|
||||||
margin-right: 0;
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* One ink by inheritance: Mantine's baseline gives headings an explicit
|
|
||||||
* color, which forks them from the body. Neutralize instead of re-declaring,
|
|
||||||
* so changing the single content foreground repaints all text. */
|
|
||||||
.root.root :global(.ProseMirror) h1,
|
|
||||||
.root.root :global(.ProseMirror) h2,
|
|
||||||
.root.root :global(.ProseMirror) h3,
|
|
||||||
.root.root :global(.ProseMirror) h4,
|
|
||||||
.root.root :global(.ProseMirror) h5,
|
|
||||||
.root.root :global(.ProseMirror) h6,
|
|
||||||
.root.root :global(.ProseMirror) strong {
|
|
||||||
color: inherit;
|
|
||||||
}
|
|
||||||
|
|
||||||
.root.root :global(.ProseMirror) h1 {
|
|
||||||
font-size: 1.75rem;
|
|
||||||
font-weight: 600;
|
|
||||||
letter-spacing: -0.02em;
|
|
||||||
line-height: 1.3;
|
|
||||||
}
|
|
||||||
|
|
||||||
.root.root :global(.ProseMirror) h2 {
|
|
||||||
font-size: 1.3rem;
|
|
||||||
font-weight: 600;
|
|
||||||
letter-spacing: -0.015em;
|
|
||||||
line-height: 1.4;
|
|
||||||
}
|
|
||||||
|
|
||||||
.root.root :global(.ProseMirror) h3 {
|
|
||||||
font-size: 1.1rem;
|
|
||||||
font-weight: 600;
|
|
||||||
letter-spacing: -0.01em;
|
|
||||||
line-height: 1.45;
|
|
||||||
}
|
|
||||||
|
|
||||||
.root.root :global(.ProseMirror) h4,
|
|
||||||
.root.root :global(.ProseMirror) h5,
|
|
||||||
.root.root :global(.ProseMirror) h6 {
|
|
||||||
font-size: 1rem;
|
|
||||||
font-weight: 600;
|
|
||||||
line-height: 1.5;
|
|
||||||
}
|
|
||||||
|
|
||||||
.root.root :global(.ProseMirror) strong {
|
|
||||||
font-weight: 600;
|
|
||||||
}
|
|
||||||
|
|
||||||
.root.root :global(.page-title .ProseMirror) h1 {
|
|
||||||
font-size: 2.1875rem;
|
|
||||||
font-weight: 600;
|
|
||||||
letter-spacing: -0.025em;
|
|
||||||
line-height: 1.25;
|
|
||||||
}
|
|
||||||
|
|
||||||
.root :global(.ProseMirror) a {
|
|
||||||
color: var(--docs-accent);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Internal page links (mentions, subpages lists) follow the accent like any
|
|
||||||
* other link; the app skin pins them to ink with !important, hence the
|
|
||||||
* counter-!important, and the underline tint softens to match. */
|
|
||||||
.root :global(.ProseMirror) a[class*="pageMentionLink"] {
|
|
||||||
color: var(--docs-accent) !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.root :global(.ProseMirror) [class*="pageMentionText"] {
|
|
||||||
border-bottom-color: color-mix(in srgb, var(--docs-accent) 40%, transparent);
|
|
||||||
}
|
|
||||||
|
|
||||||
.root :global(.ProseMirror) h1,
|
|
||||||
.root :global(.ProseMirror) h2,
|
|
||||||
.root :global(.ProseMirror) h3,
|
|
||||||
.root :global(.ProseMirror) h4 {
|
|
||||||
scroll-margin-top: calc(var(--docs-header-h) + rem(16px));
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ---------- Content tables ---------- */
|
|
||||||
|
|
||||||
/* The wrapper carries the rounded outer border so border-collapse never
|
|
||||||
* fights border-radius; its overflow-x clips the corners. */
|
|
||||||
.root.root :global(.ProseMirror .tableWrapper) {
|
|
||||||
border: 1px solid var(--docs-border);
|
|
||||||
border-radius: rem(10px);
|
|
||||||
}
|
|
||||||
|
|
||||||
.root.root :global(.ProseMirror table td),
|
|
||||||
.root.root :global(.ProseMirror table th) {
|
|
||||||
border: 0;
|
|
||||||
border-bottom: 1px solid var(--docs-border);
|
|
||||||
border-right: 1px solid var(--docs-border);
|
|
||||||
padding: rem(10px) rem(14px);
|
|
||||||
}
|
|
||||||
|
|
||||||
.root.root :global(.ProseMirror table :is(td, th):last-child) {
|
|
||||||
border-right: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.root.root :global(.ProseMirror table tr:last-child td),
|
|
||||||
.root.root :global(.ProseMirror table tr:last-child th) {
|
|
||||||
border-bottom: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.root.root :global(.ProseMirror table th) {
|
|
||||||
background-color: var(--docs-hover);
|
|
||||||
color: var(--docs-fg);
|
|
||||||
font-weight: 600;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Round the corner cells too for the no-overflow (pinned header) variant,
|
|
||||||
* where the wrapper does not clip. */
|
|
||||||
.root.root :global(.ProseMirror table tr:first-child :is(th, td):first-child) {
|
|
||||||
border-top-left-radius: rem(9px);
|
|
||||||
}
|
|
||||||
|
|
||||||
.root.root :global(.ProseMirror table tr:first-child :is(th, td):last-child) {
|
|
||||||
border-top-right-radius: rem(9px);
|
|
||||||
}
|
|
||||||
|
|
||||||
.root.root :global(.ProseMirror table tr:last-child :is(th, td):first-child) {
|
|
||||||
border-bottom-left-radius: rem(9px);
|
|
||||||
}
|
|
||||||
|
|
||||||
.root.root :global(.ProseMirror table tr:last-child :is(th, td):last-child) {
|
|
||||||
border-bottom-right-radius: rem(9px);
|
|
||||||
}
|
|
||||||
|
|
||||||
.emptyState {
|
|
||||||
padding-top: rem(96px);
|
|
||||||
text-align: center;
|
|
||||||
color: var(--docs-muted);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ---------- Mobile drawers ---------- */
|
|
||||||
|
|
||||||
.drawerTree {
|
|
||||||
height: calc(100dvh - rem(60px));
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ---------- Print ---------- */
|
|
||||||
|
|
||||||
@page public-doc {
|
|
||||||
background-color: #fff;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Only the article prints; the body grid collapses so it takes the page width. */
|
|
||||||
@media print {
|
|
||||||
:global(html):has(.root),
|
|
||||||
:global(body):has(.root) {
|
|
||||||
page: public-doc;
|
|
||||||
background-color: #fff !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
:global(html[data-docs-print-color-scheme="dark"])
|
|
||||||
.root.root
|
|
||||||
:global(.codeBlock svg) {
|
|
||||||
filter: invert(1) hue-rotate(180deg);
|
|
||||||
}
|
|
||||||
|
|
||||||
.header,
|
|
||||||
.sidebar,
|
|
||||||
.toc,
|
|
||||||
.articleActions,
|
|
||||||
.breadcrumbs,
|
|
||||||
.pageNav,
|
|
||||||
.footer {
|
|
||||||
display: none !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.root {
|
|
||||||
--docs-bg: #fff;
|
|
||||||
--docs-fg: #1f1f1f;
|
|
||||||
--docs-content-fg: var(--docs-fg);
|
|
||||||
--docs-nav-fg: #495057;
|
|
||||||
--docs-muted: #5f6368;
|
|
||||||
--docs-hover: #f1f3f5;
|
|
||||||
--docs-faint: #868e96;
|
|
||||||
--docs-border: #dee2e6;
|
|
||||||
--docs-header-bg: #fff;
|
|
||||||
|
|
||||||
min-height: 0;
|
|
||||||
background-color: #fff;
|
|
||||||
color: var(--docs-fg);
|
|
||||||
}
|
|
||||||
|
|
||||||
.body {
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
|
|
||||||
.article {
|
|
||||||
max-width: none;
|
|
||||||
padding: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,69 +0,0 @@
|
|||||||
import "@fontsource-variable/inter";
|
|
||||||
import "@/styles/public-typography.css";
|
|
||||||
import { useEffect, useMemo } from "react";
|
|
||||||
import { Outlet, useParams } from "react-router-dom";
|
|
||||||
import { useSetAtom } from "jotai";
|
|
||||||
import { usePublicSpaceTreeQuery } from "@/features/public-space/queries/public-space-query.ts";
|
|
||||||
import { buildSharedPageTree } from "@/features/share/utils.ts";
|
|
||||||
import {
|
|
||||||
publicSpaceTreeAtom,
|
|
||||||
publicSpaceTreeDataAtom,
|
|
||||||
} from "@/features/public-space/atoms/public-space-atoms.ts";
|
|
||||||
import { useDocsAccent } from "@/features/public-space/theme/docs-theme.ts";
|
|
||||||
import DocsShell from "@/features/public-space/components/docs/docs-shell.tsx";
|
|
||||||
import { DocsSurface } from "@/features/public-space/components/docs/docs-surface-context.tsx";
|
|
||||||
import { buildPublicSpaceUrl } from "@/features/page/page.utils.ts";
|
|
||||||
import { PublicSpaceSearchSpotlight } from "@/features/search/components/public-space-search-spotlight.tsx";
|
|
||||||
import { publicSpaceSearchSpotlight } from "@/features/search/constants";
|
|
||||||
|
|
||||||
export default function PublicSpaceLayout() {
|
|
||||||
const { spaceSlug } = useParams();
|
|
||||||
const { data } = usePublicSpaceTreeQuery(spaceSlug);
|
|
||||||
|
|
||||||
useDocsAccent(data?.appearance);
|
|
||||||
|
|
||||||
const setPublicSpaceTree = useSetAtom(publicSpaceTreeAtom);
|
|
||||||
const setPublicSpaceTreeData = useSetAtom(publicSpaceTreeDataAtom);
|
|
||||||
|
|
||||||
const treeData = useMemo(() => {
|
|
||||||
if (!data?.pageTree) return null;
|
|
||||||
return buildSharedPageTree(data.pageTree);
|
|
||||||
}, [data?.pageTree]);
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
setPublicSpaceTree(data || null);
|
|
||||||
setPublicSpaceTreeData(treeData);
|
|
||||||
}, [data, treeData, setPublicSpaceTree, setPublicSpaceTreeData]);
|
|
||||||
|
|
||||||
const surface = useMemo<DocsSurface>(() => {
|
|
||||||
const homeUrl = buildPublicSpaceUrl({ spaceSlug });
|
|
||||||
// The first root page is the space home, served at the bare space URL.
|
|
||||||
const firstRootSlugId = treeData?.[0]?.slugId;
|
|
||||||
return {
|
|
||||||
treeData,
|
|
||||||
hasSidebar: (data?.pageTree?.length ?? 0) > 1,
|
|
||||||
siteName: data?.space?.name,
|
|
||||||
homeUrl,
|
|
||||||
getNodeUrl: (node) =>
|
|
||||||
node.slugId === firstRootSlugId
|
|
||||||
? homeUrl
|
|
||||||
: buildPublicSpaceUrl({
|
|
||||||
spaceSlug,
|
|
||||||
pageSlugId: node.slugId,
|
|
||||||
pageTitle: node.name,
|
|
||||||
}),
|
|
||||||
showBranding: Boolean(data),
|
|
||||||
showEditPage: true,
|
|
||||||
};
|
|
||||||
}, [data, treeData, spaceSlug]);
|
|
||||||
|
|
||||||
return (
|
|
||||||
<DocsShell
|
|
||||||
surface={surface}
|
|
||||||
onSearchOpen={publicSpaceSearchSpotlight.open}
|
|
||||||
searchSpotlight={<PublicSpaceSearchSpotlight spaceSlug={spaceSlug} />}
|
|
||||||
>
|
|
||||||
<Outlet />
|
|
||||||
</DocsShell>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,283 +0,0 @@
|
|||||||
import { ActionIcon, Group, Text, Switch, TextInput } from "@mantine/core";
|
|
||||||
import { modals } from "@mantine/modals";
|
|
||||||
import { useAtom } from "jotai";
|
|
||||||
import React, { useEffect, useState } from "react";
|
|
||||||
import { useTranslation } from "react-i18next";
|
|
||||||
import { IconExternalLink, IconWorld } from "@tabler/icons-react";
|
|
||||||
import { workspaceAtom } from "@/features/user/atoms/current-user-atom.ts";
|
|
||||||
import { ISpace } from "@/features/space/types/space.types.ts";
|
|
||||||
import { IPublicSpace } from "@/features/public-space/types/public-space.types.ts";
|
|
||||||
import {
|
|
||||||
usePublicSpaceForSpaceQuery,
|
|
||||||
usePublishSpaceMutation,
|
|
||||||
} from "@/features/public-space/queries/public-space-query.ts";
|
|
||||||
import { getAppUrl } from "@/lib/config.ts";
|
|
||||||
import CopyTextButton from "@/components/common/copy.tsx";
|
|
||||||
import AppearanceSettings from "@/features/public-space/components/appearance-settings.tsx";
|
|
||||||
import { isPublicSpacesAllowed } from "@/features/public-space/utils/public-space-access.ts";
|
|
||||||
|
|
||||||
type PublishSpaceSettingsProps = {
|
|
||||||
space: ISpace;
|
|
||||||
};
|
|
||||||
|
|
||||||
export default function PublishSpaceSettings({
|
|
||||||
space,
|
|
||||||
}: PublishSpaceSettingsProps) {
|
|
||||||
const { t } = useTranslation();
|
|
||||||
const [workspace] = useAtom(workspaceAtom);
|
|
||||||
|
|
||||||
const allowPublicSpaces = isPublicSpacesAllowed(workspace);
|
|
||||||
|
|
||||||
const { data: publicSpace } = usePublicSpaceForSpaceQuery(
|
|
||||||
allowPublicSpaces ? space?.id : undefined,
|
|
||||||
);
|
|
||||||
const publishMutation = usePublishSpaceMutation();
|
|
||||||
|
|
||||||
const [published, setPublished] = useState(false);
|
|
||||||
const [searchIndexing, setSearchIndexing] = useState(false);
|
|
||||||
const [bylineAuthor, setBylineAuthor] = useState(false);
|
|
||||||
const [bylineUpdatedAt, setBylineUpdatedAt] = useState(true);
|
|
||||||
const [directoryListed, setDirectoryListed] = useState(false);
|
|
||||||
|
|
||||||
const workspaceDirectoryEnabled =
|
|
||||||
workspace?.settings?.publicSpaces?.directory === true;
|
|
||||||
|
|
||||||
const syncFromPublicSpace = (state?: IPublicSpace | null) => {
|
|
||||||
const byline = state?.settings?.byline;
|
|
||||||
setPublished(state?.enabled === true);
|
|
||||||
setSearchIndexing(state?.searchIndexing === true);
|
|
||||||
setBylineAuthor(byline?.author === true);
|
|
||||||
setBylineUpdatedAt(byline?.updatedAt !== false);
|
|
||||||
setDirectoryListed(state?.settings?.directory === true);
|
|
||||||
};
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
syncFromPublicSpace(publicSpace);
|
|
||||||
}, [publicSpace]);
|
|
||||||
|
|
||||||
if (!allowPublicSpaces || !space) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
const publicUrl = `${getAppUrl()}/docs/${space.slug}`;
|
|
||||||
|
|
||||||
const applyPublish = async (enabled: boolean) => {
|
|
||||||
try {
|
|
||||||
const result = await publishMutation.mutateAsync({
|
|
||||||
spaceId: space.id,
|
|
||||||
enabled,
|
|
||||||
});
|
|
||||||
syncFromPublicSpace(result);
|
|
||||||
} catch {
|
|
||||||
// error handled by mutation
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const handlePublishChange = (event: React.ChangeEvent<HTMLInputElement>) => {
|
|
||||||
const value = event.currentTarget.checked;
|
|
||||||
if (!value) {
|
|
||||||
applyPublish(false);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
modals.openConfirmModal({
|
|
||||||
title: t("Publish space to the web"),
|
|
||||||
children: (
|
|
||||||
<Text size="sm">
|
|
||||||
{t(
|
|
||||||
"Anyone on the internet will be able to read every page in this space, except restricted pages. Are you sure?",
|
|
||||||
)}
|
|
||||||
</Text>
|
|
||||||
),
|
|
||||||
centered: true,
|
|
||||||
labels: { confirm: t("Publish"), cancel: t("Cancel") },
|
|
||||||
onConfirm: () => applyPublish(true),
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleIndexingChange = async (
|
|
||||||
event: React.ChangeEvent<HTMLInputElement>,
|
|
||||||
) => {
|
|
||||||
const value = event.currentTarget.checked;
|
|
||||||
try {
|
|
||||||
await publishMutation.mutateAsync({
|
|
||||||
spaceId: space.id,
|
|
||||||
enabled: true,
|
|
||||||
searchIndexing: value,
|
|
||||||
});
|
|
||||||
setSearchIndexing(value);
|
|
||||||
} catch {
|
|
||||||
// error handled by mutation
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleBylineAuthorChange = async (
|
|
||||||
event: React.ChangeEvent<HTMLInputElement>,
|
|
||||||
) => {
|
|
||||||
const value = event.currentTarget.checked;
|
|
||||||
try {
|
|
||||||
await publishMutation.mutateAsync({
|
|
||||||
spaceId: space.id,
|
|
||||||
enabled: true,
|
|
||||||
bylineAuthor: value,
|
|
||||||
});
|
|
||||||
setBylineAuthor(value);
|
|
||||||
} catch {
|
|
||||||
// error handled by mutation
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleBylineUpdatedAtChange = async (
|
|
||||||
event: React.ChangeEvent<HTMLInputElement>,
|
|
||||||
) => {
|
|
||||||
const value = event.currentTarget.checked;
|
|
||||||
try {
|
|
||||||
await publishMutation.mutateAsync({
|
|
||||||
spaceId: space.id,
|
|
||||||
enabled: true,
|
|
||||||
bylineUpdatedAt: value,
|
|
||||||
});
|
|
||||||
setBylineUpdatedAt(value);
|
|
||||||
} catch {
|
|
||||||
// error handled by mutation
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleDirectoryChange = async (
|
|
||||||
event: React.ChangeEvent<HTMLInputElement>,
|
|
||||||
) => {
|
|
||||||
const value = event.currentTarget.checked;
|
|
||||||
try {
|
|
||||||
await publishMutation.mutateAsync({
|
|
||||||
spaceId: space.id,
|
|
||||||
enabled: true,
|
|
||||||
directory: value,
|
|
||||||
});
|
|
||||||
setDirectoryListed(value);
|
|
||||||
} catch {
|
|
||||||
// error handled by mutation
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div>
|
|
||||||
<Group justify="space-between" wrap="nowrap" gap="xl" mt="md">
|
|
||||||
<div>
|
|
||||||
<Text size="md">{t("Publish space to the web")}</Text>
|
|
||||||
<Text size="sm" c="dimmed">
|
|
||||||
{t("Make this space publicly readable by anyone on the internet.")}
|
|
||||||
</Text>
|
|
||||||
</div>
|
|
||||||
<Switch
|
|
||||||
checked={published}
|
|
||||||
onChange={handlePublishChange}
|
|
||||||
size={"xs"}
|
|
||||||
aria-label={t("Toggle publish space to the web")}
|
|
||||||
/>
|
|
||||||
</Group>
|
|
||||||
|
|
||||||
{published && (
|
|
||||||
<>
|
|
||||||
<Group justify="space-between" wrap="nowrap" gap="xl" mt="md">
|
|
||||||
<div>
|
|
||||||
<Text size="md">{t("Allow search engines to index")}</Text>
|
|
||||||
<Text size="sm" c="dimmed">
|
|
||||||
{t(
|
|
||||||
"Let public pages in this space appear in search engine results.",
|
|
||||||
)}
|
|
||||||
</Text>
|
|
||||||
</div>
|
|
||||||
<Switch
|
|
||||||
checked={searchIndexing}
|
|
||||||
onChange={handleIndexingChange}
|
|
||||||
size={"xs"}
|
|
||||||
aria-label={t("Toggle search engine indexing")}
|
|
||||||
/>
|
|
||||||
</Group>
|
|
||||||
|
|
||||||
<Group justify="space-between" wrap="nowrap" gap="xl" mt="md">
|
|
||||||
<div>
|
|
||||||
<Text size="md">{t("Show page author")}</Text>
|
|
||||||
<Text size="sm" c="dimmed">
|
|
||||||
{t("Display the page creator's name on public pages.")}
|
|
||||||
</Text>
|
|
||||||
</div>
|
|
||||||
<Switch
|
|
||||||
checked={bylineAuthor}
|
|
||||||
onChange={handleBylineAuthorChange}
|
|
||||||
size={"xs"}
|
|
||||||
aria-label={t("Toggle show page author")}
|
|
||||||
/>
|
|
||||||
</Group>
|
|
||||||
|
|
||||||
<Group justify="space-between" wrap="nowrap" gap="xl" mt="md">
|
|
||||||
<div>
|
|
||||||
<Text size="md">{t("Show last updated")}</Text>
|
|
||||||
<Text size="sm" c="dimmed">
|
|
||||||
{t("Display when each page was last updated.")}
|
|
||||||
</Text>
|
|
||||||
</div>
|
|
||||||
<Switch
|
|
||||||
checked={bylineUpdatedAt}
|
|
||||||
onChange={handleBylineUpdatedAtChange}
|
|
||||||
size={"xs"}
|
|
||||||
aria-label={t("Toggle show last updated")}
|
|
||||||
/>
|
|
||||||
</Group>
|
|
||||||
|
|
||||||
{workspaceDirectoryEnabled && (
|
|
||||||
<Group justify="space-between" wrap="nowrap" gap="xl" mt="md">
|
|
||||||
<div>
|
|
||||||
<Text size="md">{t("Show in public directory")}</Text>
|
|
||||||
<Text size="sm" c="dimmed">
|
|
||||||
{t("List this space in the public directory at /docs.")}
|
|
||||||
</Text>
|
|
||||||
</div>
|
|
||||||
<Switch
|
|
||||||
checked={directoryListed}
|
|
||||||
onChange={handleDirectoryChange}
|
|
||||||
size={"xs"}
|
|
||||||
aria-label={t("Toggle show in public directory")}
|
|
||||||
/>
|
|
||||||
</Group>
|
|
||||||
)}
|
|
||||||
|
|
||||||
<Group mt="md" gap={4} wrap="nowrap">
|
|
||||||
<TextInput
|
|
||||||
value={publicUrl}
|
|
||||||
readOnly
|
|
||||||
style={{ width: "100%" }}
|
|
||||||
leftSection={<IconWorld size={16} />}
|
|
||||||
aria-label={t("Public space link")}
|
|
||||||
rightSection={
|
|
||||||
<CopyTextButton
|
|
||||||
text={publicUrl}
|
|
||||||
label={t("Copy public space link")}
|
|
||||||
/>
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
<ActionIcon
|
|
||||||
component="a"
|
|
||||||
variant="default"
|
|
||||||
size="input-sm"
|
|
||||||
target="_blank"
|
|
||||||
href={publicUrl}
|
|
||||||
aria-label={t("Open public space link")}
|
|
||||||
>
|
|
||||||
<IconExternalLink size={16} />
|
|
||||||
</ActionIcon>
|
|
||||||
</Group>
|
|
||||||
|
|
||||||
<Text size="sm" c="dimmed" mt="xs">
|
|
||||||
{t("Renaming the space slug will break public links.")}
|
|
||||||
</Text>
|
|
||||||
|
|
||||||
<AppearanceSettings
|
|
||||||
spaceId={space.id}
|
|
||||||
appearance={publicSpace?.settings?.appearance}
|
|
||||||
/>
|
|
||||||
</>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,210 +0,0 @@
|
|||||||
import { Table, Group, Text, Anchor, Menu, ActionIcon } from "@mantine/core";
|
|
||||||
import React from "react";
|
|
||||||
import { useTranslation } from "react-i18next";
|
|
||||||
import { useNavigate } from "react-router-dom";
|
|
||||||
import { modals } from "@mantine/modals";
|
|
||||||
import { notifications } from "@mantine/notifications";
|
|
||||||
import {
|
|
||||||
IconCopy,
|
|
||||||
IconDots,
|
|
||||||
IconExternalLink,
|
|
||||||
IconWorld,
|
|
||||||
IconWorldOff,
|
|
||||||
} from "@tabler/icons-react";
|
|
||||||
import Paginate from "@/components/common/paginate.tsx";
|
|
||||||
import { useCursorPaginate } from "@/hooks/use-cursor-paginate";
|
|
||||||
import {
|
|
||||||
usePublishedSpacesQuery,
|
|
||||||
usePublishSpaceMutation,
|
|
||||||
} from "@/features/public-space/queries/public-space-query.ts";
|
|
||||||
import { IPublishedSpaceItem } from "@/features/public-space/types/public-space.types.ts";
|
|
||||||
import { buildPublicSpaceUrl } from "@/features/page/page.utils.ts";
|
|
||||||
import { getAppUrl, getSpaceUrl } from "@/lib/config.ts";
|
|
||||||
import { useClipboard } from "@/hooks/use-clipboard";
|
|
||||||
import { formatLocalized, useDateFnsLocale } from "@/lib/date-locale.ts";
|
|
||||||
import { CustomAvatar } from "@/components/ui/custom-avatar.tsx";
|
|
||||||
import { AvatarIconType } from "@/features/attachments/types/attachment.types.ts";
|
|
||||||
import { EmptyState } from "@/components/ui/empty-state.tsx";
|
|
||||||
import rowClasses from "@/components/ui/clickable-table-row.module.css";
|
|
||||||
|
|
||||||
export default function PublishedSpacesList() {
|
|
||||||
const { t } = useTranslation();
|
|
||||||
const { cursor, goNext, goPrev } = useCursorPaginate();
|
|
||||||
const { data, isLoading } = usePublishedSpacesQuery({ cursor });
|
|
||||||
const locale = useDateFnsLocale();
|
|
||||||
|
|
||||||
if (!isLoading && data?.items.length === 0) {
|
|
||||||
return <EmptyState icon={IconWorld} title={t("No published spaces")} />;
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<Table.ScrollContainer minWidth={500}>
|
|
||||||
<Table verticalSpacing="xs">
|
|
||||||
<Table.Thead>
|
|
||||||
<Table.Tr>
|
|
||||||
<Table.Th>{t("Space")}</Table.Th>
|
|
||||||
<Table.Th>{t("Published by")}</Table.Th>
|
|
||||||
<Table.Th>{t("Published at")}</Table.Th>
|
|
||||||
</Table.Tr>
|
|
||||||
</Table.Thead>
|
|
||||||
|
|
||||||
<Table.Tbody>
|
|
||||||
{data?.items.map((item: IPublishedSpaceItem) => (
|
|
||||||
<Table.Tr key={item.id} className={rowClasses.row}>
|
|
||||||
<Table.Td>
|
|
||||||
<Anchor
|
|
||||||
size="sm"
|
|
||||||
underline="never"
|
|
||||||
style={{
|
|
||||||
cursor: "pointer",
|
|
||||||
color: "var(--mantine-color-text)",
|
|
||||||
}}
|
|
||||||
className={rowClasses.link}
|
|
||||||
href={buildPublicSpaceUrl({ spaceSlug: item.space.slug })}
|
|
||||||
target="_blank"
|
|
||||||
>
|
|
||||||
<Group gap="8" wrap="nowrap">
|
|
||||||
<CustomAvatar
|
|
||||||
name={item.space.name}
|
|
||||||
avatarUrl={item.space.logo}
|
|
||||||
type={AvatarIconType.SPACE_ICON}
|
|
||||||
color="initials"
|
|
||||||
variant="filled"
|
|
||||||
size={20}
|
|
||||||
radius="sm"
|
|
||||||
/>
|
|
||||||
<Text fz="sm" fw={500} lineClamp={1}>
|
|
||||||
{item.space.name}
|
|
||||||
</Text>
|
|
||||||
</Group>
|
|
||||||
</Anchor>
|
|
||||||
</Table.Td>
|
|
||||||
<Table.Td>
|
|
||||||
<Group gap="4" wrap="nowrap">
|
|
||||||
<CustomAvatar
|
|
||||||
avatarUrl={item.creator?.avatarUrl}
|
|
||||||
name={item.creator?.name}
|
|
||||||
size="sm"
|
|
||||||
/>
|
|
||||||
<Text fz="sm" lineClamp={1}>
|
|
||||||
{item.creator?.name}
|
|
||||||
</Text>
|
|
||||||
</Group>
|
|
||||||
</Table.Td>
|
|
||||||
<Table.Td>
|
|
||||||
<Text fz="sm" style={{ whiteSpace: "nowrap" }}>
|
|
||||||
{formatLocalized(
|
|
||||||
item.createdAt,
|
|
||||||
"MMM dd, yyyy",
|
|
||||||
"PP",
|
|
||||||
locale,
|
|
||||||
)}
|
|
||||||
</Text>
|
|
||||||
</Table.Td>
|
|
||||||
<Table.Td>
|
|
||||||
<PublishedSpaceActionMenu item={item} />
|
|
||||||
</Table.Td>
|
|
||||||
</Table.Tr>
|
|
||||||
))}
|
|
||||||
</Table.Tbody>
|
|
||||||
</Table>
|
|
||||||
</Table.ScrollContainer>
|
|
||||||
|
|
||||||
{data?.items.length > 0 && (
|
|
||||||
<Paginate
|
|
||||||
hasPrevPage={data?.meta?.hasPrevPage}
|
|
||||||
hasNextPage={data?.meta?.hasNextPage}
|
|
||||||
onNext={() => goNext(data?.meta?.nextCursor)}
|
|
||||||
onPrev={goPrev}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
function PublishedSpaceActionMenu({ item }: { item: IPublishedSpaceItem }) {
|
|
||||||
const { t } = useTranslation();
|
|
||||||
const navigate = useNavigate();
|
|
||||||
const clipboard = useClipboard();
|
|
||||||
const publishMutation = usePublishSpaceMutation();
|
|
||||||
|
|
||||||
const publicPath = buildPublicSpaceUrl({ spaceSlug: item.space.slug });
|
|
||||||
|
|
||||||
const copyLink = () => {
|
|
||||||
clipboard.copy(`${getAppUrl()}${publicPath}`);
|
|
||||||
notifications.show({ message: t("Link copied") });
|
|
||||||
};
|
|
||||||
|
|
||||||
const onUnpublish = async () => {
|
|
||||||
try {
|
|
||||||
await publishMutation.mutateAsync({
|
|
||||||
spaceId: item.spaceId,
|
|
||||||
enabled: false,
|
|
||||||
});
|
|
||||||
} catch {
|
|
||||||
// error handled by mutation
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const openUnpublishModal = () =>
|
|
||||||
modals.openConfirmModal({
|
|
||||||
title: t("Unpublish space"),
|
|
||||||
children: (
|
|
||||||
<Text size="sm">
|
|
||||||
{t(
|
|
||||||
"This space will no longer be publicly accessible. Are you sure?",
|
|
||||||
)}
|
|
||||||
</Text>
|
|
||||||
),
|
|
||||||
centered: true,
|
|
||||||
labels: { confirm: t("Unpublish"), cancel: t("Cancel") },
|
|
||||||
confirmProps: { color: "red" },
|
|
||||||
onConfirm: onUnpublish,
|
|
||||||
});
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Menu
|
|
||||||
shadow="xl"
|
|
||||||
position="bottom-end"
|
|
||||||
offset={20}
|
|
||||||
width={200}
|
|
||||||
withArrow
|
|
||||||
arrowPosition="center"
|
|
||||||
>
|
|
||||||
<Menu.Target>
|
|
||||||
<ActionIcon
|
|
||||||
variant="subtle"
|
|
||||||
c="gray"
|
|
||||||
aria-label={t("More options for {{name}}", {
|
|
||||||
name: item.space.name,
|
|
||||||
})}
|
|
||||||
>
|
|
||||||
<IconDots size={20} stroke={2} />
|
|
||||||
</ActionIcon>
|
|
||||||
</Menu.Target>
|
|
||||||
|
|
||||||
<Menu.Dropdown>
|
|
||||||
<Menu.Item onClick={copyLink} leftSection={<IconCopy size={16} />}>
|
|
||||||
{t("Copy link")}
|
|
||||||
</Menu.Item>
|
|
||||||
|
|
||||||
<Menu.Item
|
|
||||||
onClick={() => navigate(getSpaceUrl(item.space.slug))}
|
|
||||||
leftSection={<IconExternalLink size={16} />}
|
|
||||||
>
|
|
||||||
{t("Open space")}
|
|
||||||
</Menu.Item>
|
|
||||||
|
|
||||||
<Menu.Item
|
|
||||||
c="red"
|
|
||||||
onClick={openUnpublishModal}
|
|
||||||
leftSection={<IconWorldOff size={16} />}
|
|
||||||
disabled={item.space?.userRole !== "admin"}
|
|
||||||
>
|
|
||||||
{t("Unpublish")}
|
|
||||||
</Menu.Item>
|
|
||||||
</Menu.Dropdown>
|
|
||||||
</Menu>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,47 +0,0 @@
|
|||||||
import { Alert, Anchor, Group, Text } from "@mantine/core";
|
|
||||||
import { IconExternalLink, IconWorld } from "@tabler/icons-react";
|
|
||||||
import { useTranslation } from "react-i18next";
|
|
||||||
import { ISpace } from "@/features/space/types/space.types.ts";
|
|
||||||
import { buildPublicSpaceUrl } from "@/features/page/page.utils.ts";
|
|
||||||
import { isBetaPublicSpaces } from "@/lib/config.ts";
|
|
||||||
|
|
||||||
type SpacePublicNoticeProps = {
|
|
||||||
space: ISpace;
|
|
||||||
};
|
|
||||||
|
|
||||||
export default function SpacePublicNotice({ space }: SpacePublicNoticeProps) {
|
|
||||||
const { t } = useTranslation();
|
|
||||||
|
|
||||||
if (!isBetaPublicSpaces() || !space?.isPublished) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Alert
|
|
||||||
variant="light"
|
|
||||||
color="blue"
|
|
||||||
icon={<IconWorld size={18} />}
|
|
||||||
title={t("This space is public")}
|
|
||||||
mb="lg"
|
|
||||||
>
|
|
||||||
<Group justify="space-between" gap="xs">
|
|
||||||
<Text size="sm">
|
|
||||||
{t(
|
|
||||||
"Anyone on the internet can read the pages in this space, except restricted pages.",
|
|
||||||
)}
|
|
||||||
</Text>
|
|
||||||
<Anchor
|
|
||||||
size="sm"
|
|
||||||
fw={500}
|
|
||||||
href={buildPublicSpaceUrl({ spaceSlug: space.slug })}
|
|
||||||
target="_blank"
|
|
||||||
rel="noopener"
|
|
||||||
style={{ display: "inline-flex", alignItems: "center", gap: 4 }}
|
|
||||||
>
|
|
||||||
{t("Open public site")}
|
|
||||||
<IconExternalLink size={14} />
|
|
||||||
</Anchor>
|
|
||||||
</Group>
|
|
||||||
</Alert>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
import { useQuery } from "@tanstack/react-query";
|
|
||||||
import { getMyInfo } from "@/features/user/services/user-service";
|
|
||||||
import { ICurrentUser } from "@/features/user/types/user.types";
|
|
||||||
|
|
||||||
/** Probes login state from public surfaces; the /docs 401 exemption keeps anonymous visitors off the login redirect. */
|
|
||||||
export function useAuthenticatedUser(enabled = true) {
|
|
||||||
return useQuery<ICurrentUser>({
|
|
||||||
queryKey: ["currentUser"],
|
|
||||||
queryFn: getMyInfo,
|
|
||||||
retry: false,
|
|
||||||
staleTime: 5 * 60 * 1000,
|
|
||||||
enabled,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
import { useMemo } from "react";
|
|
||||||
import { useParams } from "react-router-dom";
|
|
||||||
import { useDocsSurface } from "@/features/public-space/components/docs/docs-surface-context.tsx";
|
|
||||||
import { flattenTreePreorder } from "@/features/public-space/utils/docs-tree.ts";
|
|
||||||
import { extractPageSlugId } from "@/lib";
|
|
||||||
import { SharedPageTreeNode } from "@/features/share/utils.ts";
|
|
||||||
|
|
||||||
export function useDocsCurrentPage(): SharedPageTreeNode | null {
|
|
||||||
const { pageSlug } = useParams();
|
|
||||||
const { treeData } = useDocsSurface();
|
|
||||||
|
|
||||||
return useMemo(() => {
|
|
||||||
if (!treeData?.length) return null;
|
|
||||||
const currentSlugId = pageSlug
|
|
||||||
? extractPageSlugId(pageSlug)
|
|
||||||
: treeData[0]?.slugId;
|
|
||||||
return (
|
|
||||||
flattenTreePreorder(treeData).find(
|
|
||||||
(node) => node.slugId === currentSlugId,
|
|
||||||
) ?? null
|
|
||||||
);
|
|
||||||
}, [treeData, pageSlug]);
|
|
||||||
}
|
|
||||||
@@ -1,109 +0,0 @@
|
|||||||
import {
|
|
||||||
keepPreviousData,
|
|
||||||
useMutation,
|
|
||||||
useQuery,
|
|
||||||
useQueryClient,
|
|
||||||
UseQueryResult,
|
|
||||||
} from "@tanstack/react-query";
|
|
||||||
import { notifications } from "@mantine/notifications";
|
|
||||||
import { useTranslation } from "react-i18next";
|
|
||||||
import {
|
|
||||||
getPublicSpaceDirectory,
|
|
||||||
getPublicSpaceForSpace,
|
|
||||||
getPublicSpacePage,
|
|
||||||
getPublicSpaceTree,
|
|
||||||
getPublishedSpaces,
|
|
||||||
publishSpace,
|
|
||||||
} from "@/features/public-space/services/public-space-service.ts";
|
|
||||||
import {
|
|
||||||
IPublicSpace,
|
|
||||||
IPublicSpaceDirectory,
|
|
||||||
IPublicSpacePage,
|
|
||||||
IPublicSpaceTree,
|
|
||||||
IPublishedSpaceItem,
|
|
||||||
IPublishSpace,
|
|
||||||
} from "@/features/public-space/types/public-space.types.ts";
|
|
||||||
import { IPagination, QueryParams } from "@/lib/types.ts";
|
|
||||||
|
|
||||||
export function usePublicSpaceTreeQuery(
|
|
||||||
spaceSlug: string,
|
|
||||||
): UseQueryResult<IPublicSpaceTree, Error> {
|
|
||||||
return useQuery({
|
|
||||||
queryKey: ["public-space-tree", spaceSlug],
|
|
||||||
queryFn: () => getPublicSpaceTree(spaceSlug),
|
|
||||||
enabled: !!spaceSlug,
|
|
||||||
placeholderData: keepPreviousData,
|
|
||||||
staleTime: 60 * 60 * 1000,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
export function usePublicSpacePageQuery(params: {
|
|
||||||
spaceSlug: string;
|
|
||||||
pageSlugId?: string;
|
|
||||||
contentless?: boolean;
|
|
||||||
}): UseQueryResult<IPublicSpacePage, Error> {
|
|
||||||
return useQuery({
|
|
||||||
queryKey: ["public-space-page", params],
|
|
||||||
queryFn: () => getPublicSpacePage(params),
|
|
||||||
enabled: !!params.spaceSlug,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
export function usePublicSpaceDirectoryQuery(): UseQueryResult<
|
|
||||||
IPublicSpaceDirectory,
|
|
||||||
Error
|
|
||||||
> {
|
|
||||||
return useQuery({
|
|
||||||
queryKey: ["public-space-directory"],
|
|
||||||
queryFn: () => getPublicSpaceDirectory(),
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
export function usePublicSpaceForSpaceQuery(
|
|
||||||
spaceId: string,
|
|
||||||
): UseQueryResult<IPublicSpace | null, Error> {
|
|
||||||
return useQuery({
|
|
||||||
queryKey: ["public-space-for-space", spaceId],
|
|
||||||
queryFn: () => getPublicSpaceForSpace(spaceId),
|
|
||||||
enabled: !!spaceId,
|
|
||||||
staleTime: 60 * 1000,
|
|
||||||
retry: false,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
export function usePublishedSpacesQuery(
|
|
||||||
params?: QueryParams,
|
|
||||||
): UseQueryResult<IPagination<IPublishedSpaceItem>, Error> {
|
|
||||||
return useQuery({
|
|
||||||
queryKey: ["published-spaces", params],
|
|
||||||
queryFn: () => getPublishedSpaces(params),
|
|
||||||
placeholderData: keepPreviousData,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
export function usePublishSpaceMutation() {
|
|
||||||
const { t } = useTranslation();
|
|
||||||
const queryClient = useQueryClient();
|
|
||||||
|
|
||||||
return useMutation<IPublicSpace, Error, IPublishSpace>({
|
|
||||||
mutationFn: (data) => publishSpace(data),
|
|
||||||
onSuccess: () => {
|
|
||||||
queryClient.invalidateQueries({
|
|
||||||
predicate: (item) =>
|
|
||||||
[
|
|
||||||
"public-space-for-space",
|
|
||||||
"published-spaces",
|
|
||||||
"space",
|
|
||||||
"spaces",
|
|
||||||
].includes(item.queryKey[0] as string),
|
|
||||||
});
|
|
||||||
},
|
|
||||||
onError: (error) => {
|
|
||||||
notifications.show({
|
|
||||||
message:
|
|
||||||
error?.["response"]?.data?.message || t("Failed to update space"),
|
|
||||||
color: "red",
|
|
||||||
});
|
|
||||||
},
|
|
||||||
});
|
|
||||||
}
|
|
||||||
@@ -1,73 +0,0 @@
|
|||||||
import api from "@/lib/api-client";
|
|
||||||
import { IPagination, QueryParams } from "@/lib/types.ts";
|
|
||||||
import {
|
|
||||||
IPublicSpace,
|
|
||||||
IPublicSpaceDirectory,
|
|
||||||
IPublicSpaceInfo,
|
|
||||||
IPublicSpacePage,
|
|
||||||
IPublicSpaceTree,
|
|
||||||
IPublishedSpaceItem,
|
|
||||||
IPublishSpace,
|
|
||||||
} from "@/features/public-space/types/public-space.types.ts";
|
|
||||||
|
|
||||||
export async function getPublishedSpaces(
|
|
||||||
params?: QueryParams,
|
|
||||||
): Promise<IPagination<IPublishedSpaceItem>> {
|
|
||||||
const req = await api.post<IPagination<IPublishedSpaceItem>>(
|
|
||||||
"/public-spaces",
|
|
||||||
params,
|
|
||||||
);
|
|
||||||
return req.data;
|
|
||||||
}
|
|
||||||
|
|
||||||
export async function getPublicSpaceInfo(
|
|
||||||
spaceSlug: string,
|
|
||||||
): Promise<IPublicSpaceInfo> {
|
|
||||||
const req = await api.post<IPublicSpaceInfo>("/public-spaces/info", {
|
|
||||||
spaceSlug,
|
|
||||||
});
|
|
||||||
return req.data;
|
|
||||||
}
|
|
||||||
|
|
||||||
export async function getPublicSpaceTree(
|
|
||||||
spaceSlug: string,
|
|
||||||
): Promise<IPublicSpaceTree> {
|
|
||||||
const req = await api.post<IPublicSpaceTree>("/public-spaces/tree", {
|
|
||||||
spaceSlug,
|
|
||||||
});
|
|
||||||
return req.data;
|
|
||||||
}
|
|
||||||
|
|
||||||
export async function getPublicSpacePage(params: {
|
|
||||||
spaceSlug: string;
|
|
||||||
pageSlugId?: string;
|
|
||||||
contentless?: boolean;
|
|
||||||
}): Promise<IPublicSpacePage> {
|
|
||||||
const req = await api.post<IPublicSpacePage>(
|
|
||||||
"/public-spaces/page-info",
|
|
||||||
params,
|
|
||||||
);
|
|
||||||
return req.data;
|
|
||||||
}
|
|
||||||
|
|
||||||
export async function getPublicSpaceDirectory(): Promise<IPublicSpaceDirectory> {
|
|
||||||
const req = await api.post<IPublicSpaceDirectory>(
|
|
||||||
"/public-spaces/directory",
|
|
||||||
{},
|
|
||||||
);
|
|
||||||
return req.data;
|
|
||||||
}
|
|
||||||
|
|
||||||
export async function getPublicSpaceForSpace(
|
|
||||||
spaceId: string,
|
|
||||||
): Promise<IPublicSpace | null> {
|
|
||||||
const req = await api.post<IPublicSpace | null>("/public-spaces/for-space", {
|
|
||||||
spaceId,
|
|
||||||
});
|
|
||||||
return req.data;
|
|
||||||
}
|
|
||||||
|
|
||||||
export async function publishSpace(data: IPublishSpace): Promise<IPublicSpace> {
|
|
||||||
const req = await api.post<IPublicSpace>("/public-spaces/publish", data);
|
|
||||||
return req.data;
|
|
||||||
}
|
|
||||||
@@ -1,91 +0,0 @@
|
|||||||
import { useEffect } from "react";
|
|
||||||
import { useComputedColorScheme } from "@mantine/core";
|
|
||||||
import { IPublicSpaceAppearance } from "@/features/public-space/types/public-space.types.ts";
|
|
||||||
|
|
||||||
export type DocsThemePreset = {
|
|
||||||
id: string;
|
|
||||||
nameKey: string;
|
|
||||||
light: string;
|
|
||||||
dark: string;
|
|
||||||
};
|
|
||||||
|
|
||||||
export const DOCS_THEME_PRESETS: DocsThemePreset[] = [
|
|
||||||
{ id: "default", nameKey: "Default", light: "#2b7af1", dark: "#6ea6f6" },
|
|
||||||
{ id: "forest", nameKey: "Forest", light: "#0f766e", dark: "#2dd4bf" },
|
|
||||||
{ id: "violet", nameKey: "Violet", light: "#6d28d9", dark: "#a78bfa" },
|
|
||||||
{ id: "ember", nameKey: "Ember", light: "#c2410c", dark: "#fb923c" },
|
|
||||||
{ id: "rose", nameKey: "Rose", light: "#be123c", dark: "#fb7185" },
|
|
||||||
];
|
|
||||||
|
|
||||||
export const DEFAULT_DOCS_PRESET = DOCS_THEME_PRESETS[0];
|
|
||||||
|
|
||||||
const HEX_COLOR_REGEX = /^#[0-9a-fA-F]{6}$/;
|
|
||||||
|
|
||||||
export function isValidDocsColor(value: unknown): value is string {
|
|
||||||
return typeof value === "string" && HEX_COLOR_REGEX.test(value);
|
|
||||||
}
|
|
||||||
|
|
||||||
export function resolveDocsAccent(
|
|
||||||
appearance: IPublicSpaceAppearance | undefined,
|
|
||||||
scheme: "light" | "dark",
|
|
||||||
): string {
|
|
||||||
const custom =
|
|
||||||
scheme === "dark"
|
|
||||||
? appearance?.primaryColorDark
|
|
||||||
: appearance?.primaryColorLight;
|
|
||||||
if (isValidDocsColor(custom)) return custom;
|
|
||||||
return scheme === "dark"
|
|
||||||
? DEFAULT_DOCS_PRESET.dark
|
|
||||||
: DEFAULT_DOCS_PRESET.light;
|
|
||||||
}
|
|
||||||
|
|
||||||
export function matchDocsPreset(
|
|
||||||
appearance: IPublicSpaceAppearance | undefined,
|
|
||||||
): DocsThemePreset | null {
|
|
||||||
const light = appearance?.primaryColorLight;
|
|
||||||
const dark = appearance?.primaryColorDark;
|
|
||||||
if (!light && !dark) return DEFAULT_DOCS_PRESET;
|
|
||||||
return (
|
|
||||||
DOCS_THEME_PRESETS.find(
|
|
||||||
(preset) =>
|
|
||||||
preset.light.toLowerCase() === light?.toLowerCase() &&
|
|
||||||
preset.dark.toLowerCase() === dark?.toLowerCase(),
|
|
||||||
) ?? null
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Set on documentElement (not the shell root) so portaled Mantine surfaces on
|
|
||||||
// /docs routes (spotlight, drawers) follow the space accent too.
|
|
||||||
const ACCENT_VARIABLES = (accent: string): Record<string, string> => ({
|
|
||||||
"--docs-accent": accent,
|
|
||||||
"--docs-accent-soft": `color-mix(in srgb, ${accent} 10%, transparent)`,
|
|
||||||
"--mantine-primary-color-filled": accent,
|
|
||||||
"--mantine-primary-color-filled-hover": `color-mix(in srgb, ${accent} 85%, black)`,
|
|
||||||
"--mantine-primary-color-light": `color-mix(in srgb, ${accent} 10%, transparent)`,
|
|
||||||
"--mantine-primary-color-light-hover": `color-mix(in srgb, ${accent} 15%, transparent)`,
|
|
||||||
"--mantine-primary-color-light-color": accent,
|
|
||||||
"--mantine-color-anchor": accent,
|
|
||||||
});
|
|
||||||
|
|
||||||
export function useDocsAccent(appearance: IPublicSpaceAppearance | undefined) {
|
|
||||||
const scheme = useComputedColorScheme("light");
|
|
||||||
const light = appearance?.primaryColorLight;
|
|
||||||
const dark = appearance?.primaryColorDark;
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
const accent = resolveDocsAccent(
|
|
||||||
{ primaryColorLight: light, primaryColorDark: dark },
|
|
||||||
scheme,
|
|
||||||
);
|
|
||||||
const root = document.documentElement;
|
|
||||||
const variables = ACCENT_VARIABLES(accent);
|
|
||||||
for (const [name, value] of Object.entries(variables)) {
|
|
||||||
root.style.setProperty(name, value);
|
|
||||||
}
|
|
||||||
return () => {
|
|
||||||
for (const name of Object.keys(variables)) {
|
|
||||||
root.style.removeProperty(name);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}, [light, dark, scheme]);
|
|
||||||
}
|
|
||||||
@@ -1,105 +0,0 @@
|
|||||||
import { IPage } from "@/features/page/types/page.types.ts";
|
|
||||||
|
|
||||||
export interface IPublicSpaceSummary {
|
|
||||||
id: string;
|
|
||||||
name: string;
|
|
||||||
slug: string;
|
|
||||||
description?: string;
|
|
||||||
logo?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface IPublicSpaceAppearance {
|
|
||||||
primaryColorLight?: string;
|
|
||||||
primaryColorDark?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface IPublicSpaceByline {
|
|
||||||
author: boolean;
|
|
||||||
updatedAt: boolean;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface IPublicSpaceInfo {
|
|
||||||
space: IPublicSpaceSummary;
|
|
||||||
searchIndexing: boolean;
|
|
||||||
appearance?: IPublicSpaceAppearance;
|
|
||||||
features?: string[];
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface IPublicSpaceTree {
|
|
||||||
space: IPublicSpaceSummary;
|
|
||||||
pageTree: Partial<IPage[]>;
|
|
||||||
appearance?: IPublicSpaceAppearance;
|
|
||||||
features?: string[];
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface IPublicSpacePage {
|
|
||||||
page: IPage | null;
|
|
||||||
space: IPublicSpaceSummary;
|
|
||||||
searchIndexing: boolean;
|
|
||||||
appearance?: IPublicSpaceAppearance;
|
|
||||||
byline?: IPublicSpaceByline;
|
|
||||||
features?: string[];
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface IPublicSpace {
|
|
||||||
id: string;
|
|
||||||
spaceId: string;
|
|
||||||
workspaceId: string;
|
|
||||||
enabled: boolean;
|
|
||||||
searchIndexing: boolean;
|
|
||||||
settings?: {
|
|
||||||
appearance?: IPublicSpaceAppearance;
|
|
||||||
byline?: Partial<IPublicSpaceByline>;
|
|
||||||
directory?: boolean;
|
|
||||||
} | null;
|
|
||||||
creatorId?: string;
|
|
||||||
createdAt: string;
|
|
||||||
updatedAt: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface IPublishedSpaceItem {
|
|
||||||
id: string;
|
|
||||||
spaceId: string;
|
|
||||||
workspaceId: string;
|
|
||||||
searchIndexing: boolean;
|
|
||||||
settings?: IPublicSpace["settings"];
|
|
||||||
createdAt: string;
|
|
||||||
updatedAt: string;
|
|
||||||
space: {
|
|
||||||
id: string;
|
|
||||||
name: string;
|
|
||||||
slug: string;
|
|
||||||
logo?: string;
|
|
||||||
userRole: string;
|
|
||||||
};
|
|
||||||
creator: {
|
|
||||||
id: string;
|
|
||||||
name: string;
|
|
||||||
avatarUrl: string | null;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface IPublishSpace {
|
|
||||||
spaceId: string;
|
|
||||||
enabled: boolean;
|
|
||||||
searchIndexing?: boolean;
|
|
||||||
appearance?: {
|
|
||||||
primaryColorLight?: string | null;
|
|
||||||
primaryColorDark?: string | null;
|
|
||||||
};
|
|
||||||
bylineAuthor?: boolean;
|
|
||||||
bylineUpdatedAt?: boolean;
|
|
||||||
directory?: boolean;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface IPublicSpaceDirectoryEntry {
|
|
||||||
name: string;
|
|
||||||
slug: string;
|
|
||||||
description?: string;
|
|
||||||
logo?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface IPublicSpaceDirectory {
|
|
||||||
spaces: IPublicSpaceDirectoryEntry[];
|
|
||||||
features?: string[];
|
|
||||||
}
|
|
||||||
@@ -1,39 +0,0 @@
|
|||||||
import { SharedPageTreeNode } from "@/features/share/utils.ts";
|
|
||||||
|
|
||||||
// Preorder walk of the whole tree, matching the sidebar's visual order. Drives
|
|
||||||
// prev/next navigation independently of which nodes are expanded.
|
|
||||||
export function flattenTreePreorder(
|
|
||||||
nodes: SharedPageTreeNode[],
|
|
||||||
): SharedPageTreeNode[] {
|
|
||||||
const out: SharedPageTreeNode[] = [];
|
|
||||||
const walk = (list: SharedPageTreeNode[]) => {
|
|
||||||
for (const node of list) {
|
|
||||||
out.push(node);
|
|
||||||
if (node.children?.length) walk(node.children);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
walk(nodes);
|
|
||||||
return out;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Ancestors of the node with the given slugId, root-first, excluding the node
|
|
||||||
// itself. Null when the slugId is not in the tree.
|
|
||||||
export function findAncestorTrail(
|
|
||||||
nodes: SharedPageTreeNode[],
|
|
||||||
slugId: string,
|
|
||||||
): SharedPageTreeNode[] | null {
|
|
||||||
const walk = (
|
|
||||||
list: SharedPageTreeNode[],
|
|
||||||
trail: SharedPageTreeNode[],
|
|
||||||
): SharedPageTreeNode[] | null => {
|
|
||||||
for (const node of list) {
|
|
||||||
if (node.slugId === slugId) return trail;
|
|
||||||
if (node.children?.length) {
|
|
||||||
const found = walk(node.children, [...trail, node]);
|
|
||||||
if (found) return found;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
};
|
|
||||||
return walk(nodes, []);
|
|
||||||
}
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
import { isBetaPublicSpaces } from "@/lib/config.ts";
|
|
||||||
import { IWorkspace } from "@/features/workspace/types/workspace.types.ts";
|
|
||||||
|
|
||||||
export function isPublicSpacesAllowed(workspace?: IWorkspace): boolean {
|
|
||||||
return (
|
|
||||||
isBetaPublicSpaces() && workspace?.settings?.publicSpaces?.enabled === true
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,112 +0,0 @@
|
|||||||
import { Group, Center, Text, Button } from "@mantine/core";
|
|
||||||
import { Spotlight } from "@mantine/spotlight";
|
|
||||||
import { IconLetterCase, IconSearch } from "@tabler/icons-react";
|
|
||||||
import React, { useState } from "react";
|
|
||||||
import { Link } from "react-router-dom";
|
|
||||||
import { useDebouncedValue } from "@mantine/hooks";
|
|
||||||
import { usePublicSpaceSearchQuery } from "@/features/search/queries/search-query";
|
|
||||||
import { buildPublicSpaceUrl } from "@/features/page/page.utils.ts";
|
|
||||||
import { getPageIcon } from "@/lib";
|
|
||||||
import { useTranslation } from "react-i18next";
|
|
||||||
import { publicSpaceSearchSpotlightStore } from "@/features/search/constants.ts";
|
|
||||||
import DOMPurify from "dompurify";
|
|
||||||
|
|
||||||
interface PublicSpaceSearchSpotlightProps {
|
|
||||||
spaceSlug: string;
|
|
||||||
}
|
|
||||||
export function PublicSpaceSearchSpotlight({
|
|
||||||
spaceSlug,
|
|
||||||
}: PublicSpaceSearchSpotlightProps) {
|
|
||||||
const { t } = useTranslation();
|
|
||||||
const [query, setQuery] = useState("");
|
|
||||||
const [titleOnly, setTitleOnly] = useState(false);
|
|
||||||
const [debouncedSearchQuery] = useDebouncedValue(query, 300);
|
|
||||||
|
|
||||||
const { data: searchResults } = usePublicSpaceSearchQuery({
|
|
||||||
query: debouncedSearchQuery,
|
|
||||||
spaceSlug,
|
|
||||||
...(titleOnly && { titleOnly: true }),
|
|
||||||
});
|
|
||||||
|
|
||||||
const pages = (
|
|
||||||
searchResults && searchResults.length > 0 ? searchResults : []
|
|
||||||
).map((page) => (
|
|
||||||
<Spotlight.Action
|
|
||||||
key={page.id}
|
|
||||||
component={Link}
|
|
||||||
//@ts-ignore
|
|
||||||
to={buildPublicSpaceUrl({
|
|
||||||
spaceSlug: spaceSlug,
|
|
||||||
pageTitle: page.title,
|
|
||||||
pageSlugId: page.slugId,
|
|
||||||
})}
|
|
||||||
style={{ userSelect: "none" }}
|
|
||||||
>
|
|
||||||
<Group wrap="nowrap" w="100%">
|
|
||||||
<Center>{getPageIcon(page?.icon)}</Center>
|
|
||||||
|
|
||||||
<div style={{ flex: 1 }}>
|
|
||||||
<Text>{page.title}</Text>
|
|
||||||
|
|
||||||
{page?.highlight && (
|
|
||||||
<Text
|
|
||||||
opacity={0.6}
|
|
||||||
size="xs"
|
|
||||||
dangerouslySetInnerHTML={{
|
|
||||||
__html: DOMPurify.sanitize(page.highlight, {
|
|
||||||
ALLOWED_TAGS: ["mark", "em", "strong", "b"],
|
|
||||||
ALLOWED_ATTR: [],
|
|
||||||
}),
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
</Group>
|
|
||||||
</Spotlight.Action>
|
|
||||||
));
|
|
||||||
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<Spotlight.Root
|
|
||||||
store={publicSpaceSearchSpotlightStore}
|
|
||||||
query={query}
|
|
||||||
onQueryChange={setQuery}
|
|
||||||
scrollable
|
|
||||||
overlayProps={{
|
|
||||||
backgroundOpacity: 0.55,
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<Spotlight.Search
|
|
||||||
placeholder={t("Search...")}
|
|
||||||
aria-label={t("Search")}
|
|
||||||
leftSection={<IconSearch size={20} stroke={1.5} />}
|
|
||||||
/>
|
|
||||||
<Group px="sm" py={6}>
|
|
||||||
<Button
|
|
||||||
variant={titleOnly ? "light" : "subtle"}
|
|
||||||
color={titleOnly ? undefined : "gray"}
|
|
||||||
size="compact-sm"
|
|
||||||
radius="xl"
|
|
||||||
fw={500}
|
|
||||||
leftSection={<IconLetterCase size={15} />}
|
|
||||||
aria-pressed={titleOnly}
|
|
||||||
onClick={() => setTitleOnly((value) => !value)}
|
|
||||||
>
|
|
||||||
{t("Title only")}
|
|
||||||
</Button>
|
|
||||||
</Group>
|
|
||||||
<Spotlight.ActionsList>
|
|
||||||
{query.length === 0 && pages.length === 0 && (
|
|
||||||
<Spotlight.Empty>{t("Start typing to search...")}</Spotlight.Empty>
|
|
||||||
)}
|
|
||||||
|
|
||||||
{query.length > 0 && pages.length === 0 && (
|
|
||||||
<Spotlight.Empty>{t("No results found...")}</Spotlight.Empty>
|
|
||||||
)}
|
|
||||||
|
|
||||||
{pages.length > 0 && pages}
|
|
||||||
</Spotlight.ActionsList>
|
|
||||||
</Spotlight.Root>
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -117,9 +117,6 @@ export function SearchResultItem({
|
|||||||
pageResult.space.slug,
|
pageResult.space.slug,
|
||||||
pageResult.slugId,
|
pageResult.slugId,
|
||||||
pageResult.title,
|
pageResult.title,
|
||||||
undefined,
|
|
||||||
pageResult.matchedText,
|
|
||||||
pageResult.wholeWord
|
|
||||||
)}
|
)}
|
||||||
style={{ userSelect: "none" }}
|
style={{ userSelect: "none" }}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -5,6 +5,3 @@ export const [searchSpotlightStore, searchSpotlight] = createSpotlight();
|
|||||||
export const [shareSearchSpotlightStore, shareSearchSpotlight] =
|
export const [shareSearchSpotlightStore, shareSearchSpotlight] =
|
||||||
createSpotlight();
|
createSpotlight();
|
||||||
|
|
||||||
export const [publicSpaceSearchSpotlightStore, publicSpaceSearchSpotlight] =
|
|
||||||
createSpotlight();
|
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ import { keepPreviousData, useQuery, UseQueryResult } from "@tanstack/react-quer
|
|||||||
import {
|
import {
|
||||||
searchAttachments,
|
searchAttachments,
|
||||||
searchPage,
|
searchPage,
|
||||||
searchPublicSpace,
|
|
||||||
searchShare,
|
searchShare,
|
||||||
searchSuggestions,
|
searchSuggestions,
|
||||||
} from '@/features/search/services/search-service';
|
} from '@/features/search/services/search-service';
|
||||||
@@ -56,13 +55,3 @@ export function useAttachmentSearchQuery(
|
|||||||
enabled: !!params.query,
|
enabled: !!params.query,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
export function usePublicSpaceSearchQuery(
|
|
||||||
params: IPageSearchParams & { spaceSlug: string },
|
|
||||||
): UseQueryResult<IPageSearch[], Error> {
|
|
||||||
return useQuery({
|
|
||||||
queryKey: ["public-space-search", params],
|
|
||||||
queryFn: () => searchPublicSpace(params),
|
|
||||||
enabled: !!params.query && !!params.spaceSlug,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -28,16 +28,6 @@ export async function searchShare(
|
|||||||
return req.data.items;
|
return req.data.items;
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function searchPublicSpace(
|
|
||||||
params: IPageSearchParams & { spaceSlug: string },
|
|
||||||
): Promise<IPageSearch[]> {
|
|
||||||
const req = await api.post<{ items: IPageSearch[] }>(
|
|
||||||
"/search/public-space-search",
|
|
||||||
params,
|
|
||||||
);
|
|
||||||
return req.data.items;
|
|
||||||
}
|
|
||||||
|
|
||||||
export async function searchAttachments(
|
export async function searchAttachments(
|
||||||
params: IPageSearchParams,
|
params: IPageSearchParams,
|
||||||
): Promise<IAttachmentSearch[]> {
|
): Promise<IAttachmentSearch[]> {
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user