@kortix/ui 0.14.19 → 0.15.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/_vendor/kortix-shared.js +1188 -202
- package/dist/_vendor/shared/artifact-annotations.d.ts +85 -607
- package/dist/_vendor/shared/artifact-comments.d.ts +53 -489
- package/dist/_vendor/shared/code-language.d.ts +2 -2
- package/dist/_vendor/shared/html.d.ts +7 -0
- package/dist/_vendor/shared/index.d.ts +1 -1
- package/dist/_vendor/shared/peer-message-prompt.d.ts +7 -1
- package/dist/_vendor/shared/pixel-mark.d.ts +28 -0
- package/dist/_vendor/shared/project-glyphs.d.ts +103 -20
- package/dist/_vendor/shared/runtime-versions.d.ts +2 -6
- package/dist/_vendor/shared/tool-output/media-path.d.ts +1 -6
- package/dist/_vendor/shared/tool-output/scan.d.ts +2 -0
- package/dist/_vendor/shared/utils/string.d.ts +6 -0
- package/dist/_vendor/shared/webhook-signing.d.ts +3 -1
- package/dist/access/access/access-dialog-share.d.ts +3 -28
- package/dist/access/access/access-dialog-share.js +3 -75
- package/dist/artifacts/artifact-frame.js +26 -2
- package/dist/artifacts/artifact-session.js +8 -3
- package/dist/artifacts/frame-policy.d.ts +2 -9
- package/dist/artifacts/frame-policy.js +2 -25
- package/dist/customize/agents/agent-page.js +5 -5
- package/dist/customize/agents/agent-status.js +1 -1
- package/dist/customize/agents/agents-page.js +4 -4
- package/dist/customize/agents/create-agent-modal.js +1 -1
- package/dist/customize/connectors/connector-filter.d.ts +2 -1
- package/dist/customize/connectors/connector-filter.js +2 -3
- package/dist/customize/connectors/connectors-page.js +15 -24
- package/dist/customize/connectors/detail/connector-status.d.ts +3 -24
- package/dist/customize/connectors/detail/connector-status.js +2 -42
- package/dist/customize/connectors/detail/use-connector-detail.d.ts +2 -6
- package/dist/customize/connectors/detail/use-connector-detail.js +3 -13
- package/dist/customize/connectors/install/install.d.ts +2 -6
- package/dist/customize/connectors/install/install.js +2 -16
- package/dist/customize/connectors/provider-label.d.ts +4 -17
- package/dist/customize/connectors/provider-label.js +4 -37
- package/dist/customize/connectors/use-agent-access.d.ts +3 -3
- package/dist/customize/providers/provider-connect.d.ts +6 -15
- package/dist/customize/providers/provider-connect.js +5 -36
- package/dist/customize/sections/connector-connection-form.d.ts +3 -7
- package/dist/customize/sections/connector-connection-form.js +2 -33
- package/dist/customize/sections/connector-oauth2-auto.d.ts +3 -33
- package/dist/customize/sections/connector-oauth2-auto.js +2 -64
- package/dist/customize/sections/connectors-view.js +50 -37
- package/dist/customize/sections/gateway-view.d.ts +6 -5
- package/dist/customize/sections/gateway-view.js +31 -13
- package/dist/customize/sections/llm-provider/chatgpt-subscription-connect.js +21 -18
- package/dist/customize/sections/llm-provider/constants.d.ts +1 -2
- package/dist/customize/sections/llm-provider/constants.js +1 -2
- package/dist/customize/sections/llm-provider/device-grant.d.ts +15 -0
- package/dist/customize/sections/llm-provider/device-grant.js +27 -0
- package/dist/customize/sections/llm-provider/utils.d.ts +1 -41
- package/dist/customize/sections/llm-provider/utils.js +1 -52
- package/dist/customize/sections/view/account-secret-resources-panel.js +4 -1
- package/dist/customize/sections/view/agent-editor-catalog.js +0 -5
- package/dist/customize/sections/view/agent-editor.d.ts +2 -2
- package/dist/customize/sections/view/agent-editor.js +2 -2
- package/dist/customize/sections/view/channel-settings-patch.js +1 -1
- package/dist/customize/sections/view/channels-view.js +8 -8
- package/dist/customize/sections/view/connector-connections.d.ts +5 -85
- package/dist/customize/sections/view/connector-connections.js +5 -99
- package/dist/customize/sections/view/gateway/gateway-logs.d.ts +42 -3
- package/dist/customize/sections/view/gateway/gateway-logs.js +212 -15
- package/dist/customize/sections/view/gateway/gateway-overview.js +1 -1
- package/dist/customize/sections/view/gateway/gateway-routing.d.ts +3 -3
- package/dist/customize/sections/view/gateway/gateway-routing.js +81 -200
- package/dist/customize/sections/view/gateway/routing-parts.d.ts +101 -0
- package/dist/customize/sections/view/gateway/routing-parts.js +154 -0
- package/dist/customize/sections/view/gateway/routing-sentence-layout.d.ts +2 -0
- package/dist/customize/sections/view/gateway/routing-sentence-layout.js +82 -0
- package/dist/customize/sections/view/review-center-connected.js +54 -21
- package/dist/customize/sections/view/review-view.d.ts +7 -0
- package/dist/customize/sections/view/review-view.js +11 -0
- package/dist/customize/sections/view/secret-delivery.d.ts +4 -5
- package/dist/customize/sections/view/secret-delivery.js +6 -5
- package/dist/customize/sections/view/secrets-view.js +1 -1
- package/dist/customize/sections/view/subscription-usage-tab.d.ts +14 -0
- package/dist/customize/sections/view/subscription-usage-tab.js +122 -0
- package/dist/customize/sections/view/subscription-usage.d.ts +34 -0
- package/dist/customize/sections/view/subscription-usage.js +98 -0
- package/dist/customize/settings/tabs/experimental-tab.js +3 -3
- package/dist/customize/settings/tabs/general-tab.js +65 -10
- package/dist/customize/shared/catalog/catalog-card.d.ts +9 -4
- package/dist/customize/shared/catalog/catalog-card.js +3 -3
- package/dist/customize/shared/channels-switch-dialog.d.ts +1 -1
- package/dist/customize/shared/channels-switch-dialog.js +1 -1
- package/dist/customize/shared/feature-gate-screen.js +1 -1
- package/dist/customize/triggers/schedule/post-to-field.d.ts +1 -1
- package/dist/customize/triggers/schedule/post-to-field.js +2 -2
- package/dist/customize/triggers/schedule/trigger-composer-logic.d.ts +1 -1
- package/dist/customize/triggers/schedule/trigger-runs-logic.d.ts +6 -0
- package/dist/customize/triggers/schedule/trigger-runs-logic.js +13 -0
- package/dist/customize/triggers/schedule/trigger-runs-panel.js +9 -2
- package/dist/files/drives/conflict-marks.d.ts +28 -0
- package/dist/files/drives/conflict-marks.js +39 -0
- package/dist/files/drives/session-drives-chip.js +15 -10
- package/dist/files/project/api/runtime-files.d.ts +2 -2
- package/dist/files/project/api/runtime-files.js +2 -2
- package/dist/files/project/components/drive-explorer.js +1 -1
- package/dist/files/project/components/drive-grid-view.js +0 -1
- package/dist/files/project/components/drive-list-view.js +0 -1
- package/dist/files/project/components/file-explorer-page.js +1 -1
- package/dist/files/project/hooks/index.d.ts +1 -1
- package/dist/files/project/hooks/index.js +1 -1
- package/dist/files/project/hooks/use-server-health.d.ts +1 -1
- package/dist/files/project/hooks/use-server-health.js +1 -1
- package/dist/files/project/search/workspace-search-service.d.ts +1 -1
- package/dist/files/project/search/workspace-search-service.js +1 -1
- package/dist/files/runtime/hooks/index.d.ts +1 -1
- package/dist/files/runtime/hooks/index.js +1 -1
- package/dist/files/runtime/hooks/server-health-state.d.ts +2 -2
- package/dist/files/runtime/hooks/server-health-state.js +2 -2
- package/dist/files/runtime/hooks/system-dir.js +2 -2
- package/dist/files/runtime/hooks/use-file-content.d.ts +1 -1
- package/dist/files/runtime/hooks/use-file-content.js +1 -1
- package/dist/files/runtime/hooks/use-file-list.d.ts +1 -1
- package/dist/files/runtime/hooks/use-file-list.js +3 -3
- package/dist/files/runtime/hooks/use-server-health.d.ts +2 -2
- package/dist/files/runtime/hooks/use-server-health.js +3 -3
- package/dist/files/runtime/hooks/use-workspace-search.d.ts +1 -2
- package/dist/files/runtime/hooks/use-workspace-search.js +0 -1
- package/dist/files/runtime/index.d.ts +2 -2
- package/dist/files/runtime/index.js +2 -2
- package/dist/files/runtime/path-utils.d.ts +1 -1
- package/dist/files/runtime/path-utils.js +1 -1
- package/dist/files/runtime/sandbox-explorer-source.d.ts +1 -1
- package/dist/files/runtime/sandbox-explorer-source.js +1 -1
- package/dist/files/runtime/sandbox-file-explorer.d.ts +1 -1
- package/dist/files/runtime/sandbox-file-explorer.js +2 -2
- package/dist/files/tree/components/file-tree-item.js +0 -1
- package/dist/files/tree/hooks/use-file-events.d.ts +1 -1
- package/dist/files/tree/hooks/use-file-events.js +1 -1
- package/dist/files/viewer/index.d.ts +1 -1
- package/dist/files/viewer/index.js +1 -1
- package/dist/i18n/en.d.ts +513 -203
- package/dist/i18n/en.js +610 -300
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/internal/account-hub/sections.d.ts +1 -1
- package/dist/internal/capture/use-capture-area.d.ts +5 -1
- package/dist/internal/capture/use-capture-area.js +16 -9
- package/dist/internal/files/file-read-retry.js +1 -1
- package/dist/internal/files/types.d.ts +2 -2
- package/dist/internal/files/types.js +2 -2
- package/dist/internal/goals/goal-meta.d.ts +76 -10
- package/dist/internal/goals/goal-meta.js +191 -14
- package/dist/internal/hooks/connectors/use-add-account.d.ts +3 -9
- package/dist/internal/hooks/connectors/use-add-account.js +3 -18
- package/dist/internal/hooks/connectors/use-connect-link.d.ts +3 -2
- package/dist/internal/hooks/connectors/use-connect-link.js +15 -24
- package/dist/internal/hooks/connectors/use-pipedream-connect-project.d.ts +3 -56
- package/dist/internal/hooks/connectors/use-pipedream-connect-project.js +3 -87
- package/dist/internal/hooks/projects/use-new-project-session.d.ts +3 -2
- package/dist/internal/hooks/projects/use-new-project-session.js +4 -3
- package/dist/internal/hooks/projects/use-project-can-run.d.ts +7 -0
- package/dist/internal/hooks/projects/use-project-can-run.js +12 -5
- package/dist/internal/hooks/projects/use-restart-project-session.d.ts +0 -1
- package/dist/internal/hooks/projects/use-restart-project-session.js +0 -1
- package/dist/internal/layout/nav-hover-card.d.ts +1 -1
- package/dist/internal/layout/nav-hover-card.js +1 -1
- package/dist/internal/layout/project-capability-nav.d.ts +1 -1
- package/dist/internal/layout/project-capability-nav.js +7 -3
- package/dist/internal/layout/project-page-header.d.ts +3 -1
- package/dist/internal/layout/project-page-header.js +2 -2
- package/dist/internal/lib/account-secret-access.d.ts +1 -41
- package/dist/internal/lib/account-secret-access.js +3 -46
- package/dist/internal/lib/browser-error-noise.d.ts +2 -2
- package/dist/internal/lib/browser-error-noise.js +2 -2
- package/dist/internal/lib/browser-noise/rules/expected-states.d.ts +2 -15
- package/dist/internal/lib/browser-noise/rules/expected-states.js +6 -56
- package/dist/internal/lib/browser-noise/rules/injected-scripts.js +18 -0
- package/dist/internal/lib/browser-noise/rules/old-browsers.d.ts +1 -0
- package/dist/internal/lib/browser-noise/rules/old-browsers.js +1 -1
- package/dist/internal/lib/browser-noise/rules/rejections.d.ts +0 -9
- package/dist/internal/lib/browser-noise/rules/rejections.js +0 -14
- package/dist/internal/lib/capability-tab-routes.d.ts +3 -3
- package/dist/internal/lib/capability-tab-routes.js +11 -3
- package/dist/internal/lib/delivered-but-disconnected.js +3 -5
- package/dist/internal/lib/error-handler.js +8 -3
- package/dist/internal/lib/llm-providers.d.ts +4 -110
- package/dist/internal/lib/llm-providers.js +5 -102
- package/dist/internal/lib/navigation/message-link.d.ts +32 -0
- package/dist/internal/lib/navigation/message-link.js +51 -0
- package/dist/internal/lib/navigation/session-href.d.ts +11 -0
- package/dist/internal/lib/navigation/session-href.js +20 -0
- package/dist/internal/lib/navigation/session-spawn-urls.d.ts +17 -0
- package/dist/internal/lib/navigation/session-spawn-urls.js +26 -0
- package/dist/internal/lib/pixel-mark.d.ts +4 -17
- package/dist/internal/lib/pixel-mark.js +5 -148
- package/dist/internal/lib/sounds.d.ts +4 -4
- package/dist/internal/lib/sounds.js +4 -4
- package/dist/internal/lib/space-scope.d.ts +3 -3
- package/dist/internal/lib/space-scope.js +3 -3
- package/dist/internal/lib/use-project-feature-flags.js +9 -7
- package/dist/internal/lib/web-notifications.d.ts +1 -1
- package/dist/internal/lib/web-notifications.js +0 -3
- package/dist/internal/notifications/notification-bell.js +1 -3
- package/dist/internal/notifications/notification-rows.d.ts +2 -2
- package/dist/internal/notifications/notification-rows.js +2 -3
- package/dist/internal/session-types/index.d.ts +5 -7
- package/dist/internal/session-types/index.js +5 -7
- package/dist/internal/stores/active-space-store.d.ts +1 -1
- package/dist/internal/stores/active-space-store.js +1 -1
- package/dist/internal/stores/composer-prefill-store.js +4 -1
- package/dist/internal/stores/kortix-computer-store.d.ts +15 -0
- package/dist/internal/stores/kortix-computer-store.js +12 -0
- package/dist/internal/stores/sound-store.d.ts +4 -4
- package/dist/internal/stores/sound-store.js +10 -0
- package/dist/lib/routes.d.ts +17 -7
- package/dist/lib/routes.js +18 -2
- package/dist/markdown/app-link-icons.d.ts +7 -0
- package/dist/markdown/app-link-icons.js +20 -0
- package/dist/markdown/app-links.d.ts +9 -0
- package/dist/markdown/app-links.js +112 -0
- package/dist/markdown/code/shiki-highlighter.js +14 -5
- package/dist/markdown/doc-editor/doc-attrs.d.ts +28 -0
- package/dist/markdown/doc-editor/doc-attrs.js +156 -0
- package/dist/markdown/doc-editor/doc-embed.d.ts +6 -0
- package/dist/markdown/doc-editor/doc-embed.js +26 -8
- package/dist/markdown/doc-editor/doc-extensions.d.ts +10 -0
- package/dist/markdown/doc-editor/doc-extensions.js +55 -8
- package/dist/markdown/doc-editor/doc-fidelity.d.ts +72 -0
- package/dist/markdown/doc-editor/doc-fidelity.js +135 -0
- package/dist/markdown/doc-editor/doc-node-view.d.ts +9 -0
- package/dist/markdown/doc-editor/doc-node-view.js +29 -0
- package/dist/markdown/doc-editor/markdown.d.ts +20 -0
- package/dist/markdown/doc-editor/markdown.js +455 -18
- package/dist/markdown/file-links.js +12 -3
- package/dist/markdown/markdown-frontmatter.d.ts +6 -6
- package/dist/markdown/markdown-frontmatter.js +3 -3
- package/dist/markdown/unified-markdown.d.ts +1 -1
- package/dist/markdown/unified-markdown.js +129 -10
- package/dist/primitives/button.js +2 -1
- package/dist/primitives/emoji-picker.js +16 -100
- package/dist/primitives/emoji-tint.js +12 -12
- package/dist/primitives/entity-avatar.js +14 -9
- package/dist/primitives/glyph-face.d.ts +19 -12
- package/dist/primitives/glyph-face.js +59 -20
- package/dist/primitives/glyph-paths-source.d.ts +7 -0
- package/dist/primitives/glyph-paths-source.js +14 -6
- package/dist/primitives/glyph-paths.generated.d.ts +1 -1
- package/dist/primitives/glyph-paths.generated.js +947 -204
- package/dist/primitives/glyph-picker.d.ts +6 -10
- package/dist/primitives/glyph-picker.js +147 -98
- package/dist/primitives/glyph-registry.js +1604 -1
- package/dist/primitives/glyph-tint.d.ts +28 -3
- package/dist/primitives/glyph-tint.js +41 -83
- package/dist/primitives/kortix-glyphs.d.ts +32 -0
- package/dist/primitives/kortix-glyphs.js +157 -0
- package/dist/primitives/project-icon-picker.d.ts +8 -1
- package/dist/primitives/project-icon-picker.js +13 -5
- package/dist/primitives/user-avatar.d.ts +8 -1
- package/dist/primitives/user-avatar.js +2 -2
- package/dist/providers/ui-provider.d.ts +1 -8
- package/dist/session/actions/project-session-list-helpers.js +1 -1
- package/dist/session/agents/agent-model.js +4 -0
- package/dist/session/agents/agent-state-mark.d.ts +12 -7
- package/dist/session/agents/agent-state-mark.js +37 -15
- package/dist/session/agents/agent-strip.js +8 -2
- package/dist/session/agents/agent-surface.d.ts +81 -0
- package/dist/session/agents/agent-surface.js +97 -0
- package/dist/session/agents/held-messages.d.ts +1 -5
- package/dist/session/agents/held-messages.js +8 -25
- package/dist/session/agents/legacy-subagent-chat.js +1 -1
- package/dist/session/agents/session-peek.js +24 -12
- package/dist/session/agents/steer-session.d.ts +2 -0
- package/dist/session/agents/steer-session.js +3 -2
- package/dist/session/agents/subagent-dialog-content.d.ts +30 -1
- package/dist/session/agents/subagent-dialog-content.js +147 -33
- package/dist/session/agents/subagent-view.d.ts +15 -5
- package/dist/session/agents/subagent-view.js +28 -6
- package/dist/session/agents/tasks-panel.js +2 -12
- package/dist/session/agents/workflow-run-controls.d.ts +3 -1
- package/dist/session/agents/workflow-run-controls.js +12 -7
- package/dist/session/composer/ComposerAboveCard.d.ts +4 -1
- package/dist/session/composer/ComposerAboveCard.js +2 -2
- package/dist/session/composer/ComposerCard.d.ts +7 -1
- package/dist/session/composer/ComposerCard.js +74 -9
- package/dist/session/composer/agent-selector.d.ts +16 -0
- package/dist/session/composer/agent-selector.js +19 -11
- package/dist/session/composer/chat-input/chat-input-control.d.ts +64 -0
- package/dist/session/composer/chat-input/chat-input-control.js +578 -0
- package/dist/session/composer/chat-input/chat-input-overrides.d.ts +76 -0
- package/dist/session/composer/chat-input/chat-input-overrides.js +40 -0
- package/dist/session/composer/chat-input/chat-input-panes.d.ts +56 -0
- package/dist/session/composer/chat-input/chat-input-panes.js +148 -0
- package/dist/session/composer/chat-input/chat-input-summary.d.ts +67 -0
- package/dist/session/composer/chat-input/chat-input-summary.js +67 -0
- package/dist/session/composer/chat-queue-lines.d.ts +20 -0
- package/dist/session/composer/chat-queue-lines.js +20 -0
- package/dist/session/composer/composer-chat-input.d.ts +9 -2
- package/dist/session/composer/composer-chat-input.js +14 -6
- package/dist/session/composer/composer-focus-context.d.ts +7 -0
- package/dist/session/composer/composer-focus-context.js +9 -0
- package/dist/session/composer/composer-toolbar.d.ts +3 -1
- package/dist/session/composer/composer-toolbar.js +3 -3
- package/dist/session/composer/composer-underbar.d.ts +10 -1
- package/dist/session/composer/composer-underbar.js +10 -2
- package/dist/session/composer/composer.d.ts +12 -0
- package/dist/session/composer/composer.js +71 -2
- package/dist/session/composer/editor/composer-editor.d.ts +10 -2
- package/dist/session/composer/editor/composer-editor.js +22 -6
- package/dist/session/composer/editor/first-visual-line.d.ts +2 -0
- package/dist/session/composer/editor/first-visual-line.js +9 -0
- package/dist/session/composer/editor/mention-node.js +2 -0
- package/dist/session/composer/editor/serialize.js +9 -1
- package/dist/session/composer/hooks/use-file-search.d.ts +16 -16
- package/dist/session/composer/hooks/use-file-search.js +17 -17
- package/dist/session/composer/menus/mention-controller.d.ts +3 -11
- package/dist/session/composer/menus/mention-controller.js +54 -16
- package/dist/session/composer/menus/mention-menu.d.ts +7 -2
- package/dist/session/composer/menus/mention-menu.js +17 -9
- package/dist/session/composer/menus/menu-items.d.ts +9 -0
- package/dist/session/composer/menus/space-mentions.d.ts +58 -0
- package/dist/session/composer/menus/space-mentions.js +99 -0
- package/dist/session/composer/prompt-history.d.ts +9 -0
- package/dist/session/composer/prompt-history.js +45 -0
- package/dist/session/composer/queue-projection.d.ts +2 -0
- package/dist/session/composer/queue-projection.js +1 -0
- package/dist/session/composer/queued-prompt-list.js +53 -4
- package/dist/session/composer/reasoning-effort-selector.d.ts +20 -0
- package/dist/session/composer/reasoning-effort-selector.js +3 -3
- package/dist/session/composer/types.d.ts +2 -1
- package/dist/session/composer/use-instant-session-send.js +2 -2
- package/dist/session/header/session-goal-indicator.js +4 -4
- package/dist/session/header/session-site-header.js +7 -3
- package/dist/session/header/subagent-hover-card.d.ts +7 -4
- package/dist/session/header/subagent-hover-card.js +62 -11
- package/dist/session/list/session-status-mark.d.ts +42 -0
- package/dist/{workspace/sidebar → session/list}/session-status-mark.js +37 -2
- package/dist/session/models/model-selector.d.ts +7 -2
- package/dist/session/models/model-selector.js +39 -31
- package/dist/session/overrides/provider-secret-pool-editor.d.ts +11 -0
- package/dist/session/overrides/provider-secret-pool-editor.js +17 -0
- package/dist/session/overrides/session-overrides-control.d.ts +5 -0
- package/dist/session/overrides/session-overrides-toolbar.js +147 -7
- package/dist/session/panel/easy/plan-card.d.ts +2 -2
- package/dist/session/panel/easy/plan-card.js +2 -2
- package/dist/session/panel/model-switch-event.d.ts +8 -0
- package/dist/session/panel/model-switch-event.js +19 -0
- package/dist/session/panel/session-audit-panel.js +3 -2
- package/dist/session/panel/session-desktop.js +11 -1
- package/dist/session/panel/session-panel-provider.js +1 -1
- package/dist/session/panel/shared/use-panel-handoffs.d.ts +2 -2
- package/dist/session/panel/shared/use-panel-handoffs.js +21 -2
- package/dist/session/panel/use-session-panel-state.js +2 -2
- package/dist/session/prompts/ask-deck.d.ts +21 -0
- package/dist/session/prompts/ask-deck.js +253 -0
- package/dist/session/prompts/session-permission-prompt.d.ts +7 -1
- package/dist/session/prompts/session-permission-prompt.js +3 -3
- package/dist/session/status/sandbox-loading-boundary.js +2 -2
- package/dist/session/status/session-load-state.d.ts +0 -1
- package/dist/session/status/session-load-state.js +2 -4
- package/dist/session/status/session-terminal-state.d.ts +47 -0
- package/dist/session/status/session-terminal-state.js +56 -0
- package/dist/session/thread/message-parsing.d.ts +0 -1
- package/dist/session/thread/message-parsing.js +0 -1
- package/dist/session/thread/plan-surface.d.ts +1 -1
- package/dist/session/thread/plan-surface.js +1 -1
- package/dist/session/thread/session-chat.d.ts +4 -2
- package/dist/session/thread/session-chat.js +547 -409
- package/dist/session/thread/session-context-metrics.d.ts +0 -1
- package/dist/session/thread/session-context-metrics.js +1 -1
- package/dist/session/thread/session-context-sub-sessions.js +3 -1
- package/dist/session/thread/show-work.d.ts +38 -0
- package/dist/session/thread/show-work.js +115 -0
- package/dist/session/thread/stop-sequence.d.ts +51 -0
- package/dist/session/thread/stop-sequence.js +55 -0
- package/dist/session/thread/thread-boot-rows.d.ts +2 -1
- package/dist/session/thread/thread-boot-rows.js +7 -3
- package/dist/session/thread/transcript-rows.d.ts +36 -0
- package/dist/session/thread/transcript.d.ts +48 -4
- package/dist/session/thread/transcript.js +228 -36
- package/dist/session/thread/typing-indicator.d.ts +21 -0
- package/dist/session/thread/typing-indicator.js +46 -0
- package/dist/session/tool/shared/infrastructure-contexts.d.ts +12 -0
- package/dist/session/tool/shared/infrastructure-contexts.js +6 -0
- package/dist/session/tool/tool-part-renderer.d.ts +2 -0
- package/dist/session/tool/tool-part-renderer.js +16 -2
- package/dist/session/tool/tools/apply-patch-tool.d.ts +1 -1
- package/dist/session/tool/tools/apply-patch-tool.js +1 -1
- package/dist/session/tool/tools/kortix-action-tool.js +8 -1
- package/dist/session/tool/tools/multi-agent-tool-bodies.d.ts +19 -0
- package/dist/session/tool/tools/multi-agent-tool-bodies.js +35 -14
- package/dist/session/tool/tools/multi-agent-tools.js +1 -1
- package/dist/session/tool/tools/pty-kill-tool.d.ts +1 -1
- package/dist/session/tool/tools/pty-kill-tool.js +1 -1
- package/dist/session/tool/tools/pty-read-tool.d.ts +2 -2
- package/dist/session/tool/tools/pty-read-tool.js +2 -2
- package/dist/session/tool/tools/pty-spawn-tool.d.ts +1 -1
- package/dist/session/tool/tools/pty-spawn-tool.js +1 -1
- package/dist/session/tool/tools/pty-write-tool.d.ts +1 -1
- package/dist/session/tool/tools/pty-write-tool.js +1 -1
- package/dist/session/tool/tools/session-spawn-urls.d.ts +1 -16
- package/dist/session/tool/tools/session-spawn-urls.js +4 -26
- package/dist/session/tool/tools/task-tool.d.ts +5 -18
- package/dist/session/tool/tools/task-tool.js +47 -86
- package/dist/session/tool/tools/todo-write-tool.d.ts +1 -1
- package/dist/session/tool/tools/todo-write-tool.js +1 -1
- package/dist/session/tool/tools/workflow-progress.d.ts +14 -18
- package/dist/session/tool/tools/workflow-progress.js +24 -179
- package/dist/session/tool/tools/workflow-result-text.d.ts +15 -0
- package/dist/session/tool/tools/workflow-result-text.js +34 -0
- package/dist/session/tool/tools/workflow-run-card.d.ts +35 -0
- package/dist/session/tool/tools/workflow-run-card.js +157 -0
- package/dist/session/tool/tools/workflow-tool.js +45 -58
- package/dist/session/turn/activity-burst.d.ts +2 -2
- package/dist/session/turn/activity-burst.js +11 -5
- package/dist/session/turn/answered-question-step.d.ts +29 -0
- package/dist/session/turn/answered-question-step.js +48 -3
- package/dist/session/turn/notice-batch-group.d.ts +4 -4
- package/dist/session/turn/notice-batch-group.js +5 -8
- package/dist/session/turn/peer-message-row.d.ts +14 -8
- package/dist/session/turn/peer-message-row.js +38 -64
- package/dist/session/turn/plan-anchor.d.ts +3 -3
- package/dist/session/turn/plan-anchor.js +3 -3
- package/dist/session/turn/plan-card.d.ts +7 -7
- package/dist/session/turn/plan-card.js +7 -7
- package/dist/session/turn/subagent-notice-row.d.ts +16 -1
- package/dist/session/turn/subagent-notice-row.js +47 -35
- package/dist/session/turn/throttled-markdown.js +4 -1
- package/dist/session/turn/turn-work-accordion.d.ts +10 -3
- package/dist/session/turn/turn-work-accordion.js +18 -11
- package/dist/session/turn/user-message.js +16 -42
- package/dist/session/turn/voice-turn.d.ts +22 -0
- package/dist/session/turn/voice-turn.js +32 -0
- package/dist/session/voice/call-ring.d.ts +10 -0
- package/dist/session/voice/call-ring.js +52 -0
- package/dist/session/voice/use-voice-call.d.ts +4 -4
- package/dist/session/voice/use-voice-call.js +6 -9
- package/dist/session/voice/voice-call-card.d.ts +6 -0
- package/dist/session/voice/voice-call-card.js +113 -0
- package/dist/session/voice/voice-call-state.d.ts +3 -0
- package/dist/session/voice/voice-call-state.js +2 -1
- package/dist/session/voice/voice-call-store.d.ts +16 -6
- package/dist/session/voice/voice-call-store.js +5 -5
- package/dist/session/voice/voice-call.d.ts +4 -8
- package/dist/session/voice/voice-call.js +33 -36
- package/dist/styles/components.css +33 -0
- package/dist/styles/theme.css +26 -0
- package/dist/styles.css +1 -1
- package/dist/terminal/terminal-card-gate.d.ts +6 -3
- package/dist/terminal/terminal-card-gate.js +21 -4
- package/dist/workspace/admin/project-admin-dashboard.d.ts +1 -1
- package/dist/workspace/admin/project-admin-dashboard.js +12 -9
- package/dist/workspace/index.d.ts +3 -2
- package/dist/workspace/index.js +2 -1
- package/dist/workspace/layout/use-project-home-send.d.ts +2 -0
- package/dist/workspace/layout/use-project-home-send.js +5 -3
- package/dist/workspace/memory/company-memory-page.d.ts +1 -1
- package/dist/workspace/memory/company-memory-page.js +1 -1
- package/dist/workspace/new/use-creatable-accounts.js +13 -4
- package/dist/workspace/projects/modal/project-icon-field.js +49 -34
- package/dist/workspace/review/review-center.d.ts +12 -3
- package/dist/workspace/review/review-center.js +50 -16
- package/dist/workspace/review/review-reducer.d.ts +7 -0
- package/dist/workspace/review/review-reducer.js +11 -0
- package/dist/workspace/sessions/project-sessions-helpers.js +1 -1
- package/dist/workspace/sessions/project-sessions-view.js +1 -1
- package/dist/workspace/sessions/session-row.js +6 -4
- package/dist/workspace/sessions/sessions-toolbar.d.ts +1 -1
- package/dist/workspace/sessions/sessions-toolbar.js +4 -4
- package/dist/workspace/sidebar/footer/project-artifacts-nav.d.ts +6 -1
- package/dist/workspace/sidebar/footer/project-artifacts-nav.js +47 -4
- package/dist/workspace/sidebar/footer/project-memory-nav.d.ts +1 -1
- package/dist/workspace/sidebar/footer/project-memory-nav.js +1 -1
- package/dist/workspace/sidebar/project-nav-items.js +13 -17
- package/dist/workspace/sidebar/project-session-list.d.ts +7 -1
- package/dist/workspace/sidebar/project-session-list.js +63 -24
- package/dist/workspace/sidebar/project-sidebar.js +10 -7
- package/dist/workspace/sidebar/project-spaces-nav.d.ts +7 -3
- package/dist/workspace/sidebar/project-spaces-nav.js +77 -46
- package/dist/workspace/sidebar/session-brief-hover-card.d.ts +4 -2
- package/dist/workspace/sidebar/session-brief-hover-card.js +47 -28
- package/dist/workspace/sidebar/session-group-sections.js +12 -4
- package/dist/workspace/sidebar/sidebar-more-group.d.ts +13 -0
- package/dist/workspace/sidebar/sidebar-more-group.js +27 -0
- package/dist/workspace/space/space-blocks.d.ts +3 -1
- package/dist/workspace/space/space-blocks.js +4 -7
- package/dist/workspace/space/space-page.d.ts +4 -6
- package/dist/workspace/space/space-page.js +10 -24
- package/dist/workspace/space/space-tab-panels.d.ts +14 -1
- package/dist/workspace/space/space-tab-panels.js +12 -21
- package/dist/workspace/space/space-templates.d.ts +4 -5
- package/dist/workspace/space/space-templates.js +2 -7
- package/dist/workspace/space/use-space-filter.d.ts +1 -1
- package/dist/workspace/space/use-space-filter.js +1 -1
- package/dist/workspace/spaces/channels-onboarding.d.ts +2 -2
- package/dist/workspace/spaces/channels-onboarding.js +4 -3
- package/dist/workspace/spaces/create-channel-dialog.js +4 -2
- package/dist/workspace/spaces/principal-card.d.ts +73 -0
- package/dist/workspace/spaces/principal-card.js +246 -0
- package/dist/workspace/spaces/space-agent-ask.d.ts +14 -0
- package/dist/workspace/spaces/space-agent-ask.js +36 -0
- package/dist/workspace/spaces/space-auto-open.d.ts +8 -0
- package/dist/workspace/spaces/space-auto-open.js +18 -0
- package/dist/workspace/spaces/space-avatar.d.ts +44 -0
- package/dist/workspace/spaces/space-avatar.js +41 -0
- package/dist/workspace/spaces/space-details-dialog.js +1 -1
- package/dist/workspace/spaces/space-details-panel.d.ts +27 -0
- package/dist/workspace/spaces/space-details-panel.js +173 -0
- package/dist/workspace/spaces/space-identity.d.ts +49 -0
- package/dist/workspace/spaces/space-identity.js +104 -0
- package/dist/workspace/spaces/space-members.js +1 -1
- package/dist/workspace/spaces/space-mention-source.d.ts +13 -0
- package/dist/workspace/spaces/space-mention-source.js +71 -0
- package/dist/workspace/spaces/space-people.d.ts +29 -0
- package/dist/workspace/spaces/space-people.js +87 -0
- package/dist/workspace/spaces/space-roster.d.ts +3 -2
- package/dist/workspace/spaces/space-roster.js +7 -4
- package/dist/workspace/spaces/space-tab-list.d.ts +37 -0
- package/dist/workspace/spaces/space-tab-list.js +82 -0
- package/dist/workspace/spaces/space-tabs.d.ts +74 -0
- package/dist/workspace/spaces/space-tabs.js +199 -0
- package/dist/workspace/spaces/space-threads-tab.js +1 -1
- package/dist/workspace/spaces/space-timeline-view.js +126 -17
- package/dist/workspace/spaces/space-timeline.d.ts +44 -9
- package/dist/workspace/spaces/space-timeline.js +120 -12
- package/dist/workspace/spaces/space-view.d.ts +19 -12
- package/dist/workspace/spaces/space-view.js +203 -68
- package/dist/workspace/spaces/use-personal-space-name.d.ts +2 -0
- package/dist/workspace/spaces/use-personal-space-name.js +10 -0
- package/package.json +11 -7
- package/skills/kortix-ui/SKILL.md +1 -1
- package/skills/kortix-ui/references/custom-dashboard.md +2 -3
- package/skills/kortix-ui/references/modules.md +4 -4
- package/dist/_vendor/shared/room-prompt.d.ts +0 -66
- package/dist/session/tool/tools/multi-agent-tool-data.d.ts +0 -63
- package/dist/session/tool/tools/multi-agent-tool-data.js +0 -118
- package/dist/session/voice/voice-call-bar.d.ts +0 -4
- package/dist/session/voice/voice-call-bar.js +0 -39
- package/dist/workspace/sidebar/footer/project-rooms-nav.d.ts +0 -9
- package/dist/workspace/sidebar/footer/project-rooms-nav.js +0 -32
- package/dist/workspace/sidebar/session-status-mark.d.ts +0 -19
- package/dist/workspace/space/space-room.d.ts +0 -20
- package/dist/workspace/space/space-room.js +0 -27
- /package/dist/{workspace/sidebar → session/list}/session-list-chrome.d.ts +0 -0
- /package/dist/{workspace/sidebar → session/list}/session-list-chrome.js +0 -0
|
@@ -7,10 +7,12 @@ import { Hint } from '../../primitives/hint.js';
|
|
|
7
7
|
import { faviconUrlForUrl } from '../../lib/favicon.js';
|
|
8
8
|
import { successToast } from '../../primitives/toast.js';
|
|
9
9
|
import { ArrowSquareOutIcon, LinkSimpleIcon, TextTIcon, TrashIcon } from '@phosphor-icons/react';
|
|
10
|
-
import { Node } from '@tiptap/core';
|
|
10
|
+
import { Node, mergeAttributes } from '@tiptap/core';
|
|
11
11
|
import { NodeViewWrapper, ReactNodeViewRenderer } from '@tiptap/react';
|
|
12
12
|
import { useState } from 'react';
|
|
13
13
|
import { useTranslations } from '../../i18n/index.js';
|
|
14
|
+
import { attrString } from './doc-attrs.js';
|
|
15
|
+
import { safeNodeView } from './doc-node-view.js';
|
|
14
16
|
const SUMMARY_MAX = 220;
|
|
15
17
|
/** A link that can be a card: any http(s) address. */
|
|
16
18
|
export function canEmbed(href) {
|
|
@@ -92,11 +94,26 @@ export async function fetchEmbed(href, read) {
|
|
|
92
94
|
}
|
|
93
95
|
}
|
|
94
96
|
const text = (el, cls) => el.querySelector(`.${cls}`)?.textContent?.trim() ?? '';
|
|
97
|
+
/**
|
|
98
|
+
* A card's attributes as the view and the HTML read them: strings only (a
|
|
99
|
+
* co-editing writer can set any JSON value), and a link only to an http(s)
|
|
100
|
+
* address, as `canEmbed` makes a card. Anything else shows no link.
|
|
101
|
+
*/
|
|
102
|
+
export function embedMeta(attrs) {
|
|
103
|
+
const href = attrString(attrs.href);
|
|
104
|
+
const image = attrString(attrs.image);
|
|
105
|
+
return {
|
|
106
|
+
href: canEmbed(href) ? href : '',
|
|
107
|
+
title: attrString(attrs.title),
|
|
108
|
+
summary: attrString(attrs.summary),
|
|
109
|
+
image: canEmbed(image) ? image : '',
|
|
110
|
+
};
|
|
111
|
+
}
|
|
95
112
|
/** The card's markup: the same in the editor and in the stored HTML. */
|
|
96
113
|
function CardBody({ href, title, summary, image, onClick }) {
|
|
97
114
|
// An image that does not load (gone, blocked) leaves the card text only.
|
|
98
115
|
const [broken, setBroken] = useState(false);
|
|
99
|
-
return (_jsxs("a", { href: href, target: "_blank", rel: "noopener noreferrer", onClick: onClick, children: [_jsxs("span", { className: "kx-embed-text", children: [_jsx("span", { className: "kx-embed-title", children: title }), summary ? _jsx("span", { className: "kx-embed-summary", children: summary }) : null, _jsxs("span", { className: "kx-embed-url", children: [!image || broken ? _jsx(FaviconAvatar, { value: href, size: "2xs" }) : null, _jsx("span", { className: "kx-embed-href", children: href })] })] }), image && !broken ? _jsx("img", { className: "kx-embed-image", src: image, alt: "", referrerPolicy: "no-referrer", onError: () => setBroken(true) }) : null] }));
|
|
116
|
+
return (_jsxs("a", { href: href || undefined, target: "_blank", rel: "noopener noreferrer", onClick: onClick, children: [_jsxs("span", { className: "kx-embed-text", children: [_jsx("span", { className: "kx-embed-title", children: title }), summary ? _jsx("span", { className: "kx-embed-summary", children: summary }) : null, _jsxs("span", { className: "kx-embed-url", children: [!image || broken ? _jsx(FaviconAvatar, { value: href, size: "2xs" }) : null, _jsx("span", { className: "kx-embed-href", children: href })] })] }), image && !broken ? _jsx("img", { className: "kx-embed-image", src: image, alt: "", referrerPolicy: "no-referrer", onError: () => setBroken(true) }) : null] }));
|
|
100
117
|
}
|
|
101
118
|
/**
|
|
102
119
|
* The card in the editor, with its actions on hover, in one button group:
|
|
@@ -105,7 +122,7 @@ function CardBody({ href, title, summary, image, onClick }) {
|
|
|
105
122
|
*/
|
|
106
123
|
function LinkEmbedView({ node, editor, getPos, deleteNode }) {
|
|
107
124
|
const t = useTranslations('artifacts');
|
|
108
|
-
const meta = node.attrs;
|
|
125
|
+
const meta = embedMeta(node.attrs);
|
|
109
126
|
const editable = editor.isEditable;
|
|
110
127
|
const convert = () => {
|
|
111
128
|
const at = getPos();
|
|
@@ -122,7 +139,7 @@ function LinkEmbedView({ node, editor, getPos, deleteNode }) {
|
|
|
122
139
|
successToast(t('linkCopied'));
|
|
123
140
|
};
|
|
124
141
|
const action = (label, Icon, run) => (_jsx(Hint, { label: label, side: "top", children: _jsx(Button, { variant: "secondary", size: "icon-sm", "aria-label": label, onClick: run, children: _jsx(Icon, { className: "size-3.5" }) }) }));
|
|
125
|
-
return (_jsxs(NodeViewWrapper, { className: "kx-embed group/embed relative", children: [_jsx(CardBody, { ...meta, onClick: editable ? (e) => e.preventDefault() : undefined }), _jsx("div", { contentEditable: false, "data-embed-actions": "", className: "absolute top-2 right-2 opacity-0 transition-opacity group-focus-within/embed:opacity-100 group-hover/embed:opacity-100", children: _jsxs(ButtonGroup, { children: [action(t('embedOpen'), ArrowSquareOutIcon, () => window.open(meta.href, '_blank', 'noopener,noreferrer')), editable ? action(t('embedConvert'), TextTIcon, convert) : null, action(t('embedCopy'), LinkSimpleIcon, () => void copy()), editable ? action(t('embedDelete'), TrashIcon, deleteNode) : null] }) })] }));
|
|
142
|
+
return (_jsxs(NodeViewWrapper, { className: "kx-embed group/embed relative", children: [_jsx(CardBody, { ...meta, onClick: editable ? (e) => e.preventDefault() : undefined }), _jsx("div", { contentEditable: false, "data-embed-actions": "", className: "absolute top-2 right-2 opacity-0 transition-opacity group-focus-within/embed:opacity-100 group-hover/embed:opacity-100", children: _jsxs(ButtonGroup, { children: [meta.href ? action(t('embedOpen'), ArrowSquareOutIcon, () => window.open(meta.href, '_blank', 'noopener,noreferrer')) : null, editable && meta.href ? action(t('embedConvert'), TextTIcon, convert) : null, meta.href ? action(t('embedCopy'), LinkSimpleIcon, () => void copy()) : null, editable ? action(t('embedDelete'), TrashIcon, deleteNode) : null] }) })] }));
|
|
126
143
|
}
|
|
127
144
|
/** The card in a doc: an atom block, `div.kx-embed` in the HTML and in the Markdown file. */
|
|
128
145
|
export const LinkEmbed = Node.create({
|
|
@@ -142,8 +159,8 @@ export const LinkEmbed = Node.create({
|
|
|
142
159
|
parseHTML() {
|
|
143
160
|
return [{ tag: 'div.kx-embed', priority: 60 }];
|
|
144
161
|
},
|
|
145
|
-
renderHTML({ node }) {
|
|
146
|
-
const { href, title, summary, image } = node.attrs;
|
|
162
|
+
renderHTML({ node, HTMLAttributes }) {
|
|
163
|
+
const { href, title, summary, image } = embedMeta(node.attrs);
|
|
147
164
|
const textParts = [['span', { class: 'kx-embed-title' }, title]];
|
|
148
165
|
if (summary)
|
|
149
166
|
textParts.push(['span', { class: 'kx-embed-summary' }, summary]);
|
|
@@ -157,11 +174,12 @@ export const LinkEmbed = Node.create({
|
|
|
157
174
|
const body = [['span', { class: 'kx-embed-text' }, ...textParts]];
|
|
158
175
|
if (image)
|
|
159
176
|
body.push(['img', { class: 'kx-embed-image', src: image, alt: '', referrerpolicy: 'no-referrer' }]);
|
|
160
|
-
|
|
177
|
+
// HTMLAttributes holds only the block's `md` (doc-fidelity.ts): the card's own attributes are not rendered.
|
|
178
|
+
return ['div', mergeAttributes(HTMLAttributes, { class: 'kx-embed' }), ['a', { href, target: '_blank', rel: 'noopener noreferrer' }, ...body]];
|
|
161
179
|
},
|
|
162
180
|
addNodeView() {
|
|
163
181
|
// The editor leaves the action buttons to themselves (see DocCodeBlock).
|
|
164
|
-
return ReactNodeViewRenderer(LinkEmbedView, {
|
|
182
|
+
return ReactNodeViewRenderer(safeNodeView(LinkEmbedView), {
|
|
165
183
|
stopEvent: ({ event }) => !!event.target?.closest?.('[data-embed-actions]'),
|
|
166
184
|
});
|
|
167
185
|
},
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { Node, type Extensions } from '@tiptap/core';
|
|
2
|
+
import { attrBoolean, attrString, attrStringOrNull } from './doc-attrs.js';
|
|
3
|
+
import { safeNodeView } from './doc-node-view.js';
|
|
4
|
+
export { attrBoolean, attrString, attrStringOrNull, safeNodeView };
|
|
2
5
|
/** An image in a doc (`` in the file). */
|
|
3
6
|
export declare const DocImage: Node<import("@tiptap/extension-image").ImageOptions, any>;
|
|
4
7
|
/** A video in a doc: `<video src controls>`, kept as HTML in the Markdown file. */
|
|
@@ -9,6 +12,13 @@ export declare const Video: Node<any, any>;
|
|
|
9
12
|
* language field, Copy and Edit. A doc's diagram has no fullscreen view.
|
|
10
13
|
*/
|
|
11
14
|
export declare const DocCodeBlock: Node<import("@tiptap/extension-code-block").CodeBlockOptions, any>;
|
|
15
|
+
/**
|
|
16
|
+
* A block the editor cannot show without rewriting it (front matter, a link
|
|
17
|
+
* reference definition, an HTML block; `markdown.ts` decides): its Markdown
|
|
18
|
+
* source as plain text. A person edits it as text, and it saves exactly as it
|
|
19
|
+
* reads. Input rules and marks do not apply inside it (`code`).
|
|
20
|
+
*/
|
|
21
|
+
export declare const RawMarkdown: Node<any, any>;
|
|
12
22
|
/**
|
|
13
23
|
* A line break in the Markdown source inside a paragraph. It reads as a space
|
|
14
24
|
* and saves as the newline it was (`markdown.ts`), so a hard-wrapped file
|
|
@@ -5,7 +5,9 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
5
5
|
* a person edits it in place. Doc artifacts and an agent's instructions use
|
|
6
6
|
* the same set, so a doc reads and edits the same everywhere. The look is
|
|
7
7
|
* `ARTIFACT_DOC_CSS` (`.kx-doc`); Markdown goes in and out through
|
|
8
|
-
* `markdown.ts
|
|
8
|
+
* `markdown.ts`, which keeps a file's own spelling on each block
|
|
9
|
+
* (`MarkdownSource`) and holds what the editor cannot show as a raw block
|
|
10
|
+
* (`RawMarkdown`), so an unedited file saves byte for byte.
|
|
9
11
|
*/
|
|
10
12
|
import { Code } from '@tiptap/extension-code';
|
|
11
13
|
import CodeBlock from '@tiptap/extension-code-block';
|
|
@@ -25,7 +27,12 @@ import { SessionDotMatrix } from '../../primitives/dot-matrix/session-dot-matrix
|
|
|
25
27
|
import { MermaidRenderer } from '../../primitives/mermaid-renderer.js';
|
|
26
28
|
import { TextShimmer } from '../../primitives/text-shimmer.js';
|
|
27
29
|
import { CopyButton } from '../copy-button.js';
|
|
30
|
+
import { SafeAttributes, attrBoolean, attrString, attrStringOrNull } from './doc-attrs.js';
|
|
28
31
|
import { LinkEmbed } from './doc-embed.js';
|
|
32
|
+
import { MarkdownSource, PastedMarkdownSource, RAW_ATTRIBUTE } from './doc-fidelity.js';
|
|
33
|
+
import { safeNodeView } from './doc-node-view.js';
|
|
34
|
+
// Hosts that render their own node views (the co-editing editor) use the same guards.
|
|
35
|
+
export { attrBoolean, attrString, attrStringOrNull, safeNodeView };
|
|
29
36
|
/**
|
|
30
37
|
* `uploading`: a pasted or dropped file shown from a local URL while it
|
|
31
38
|
* uploads (`data-uploading`). Never saved: `htmlToMarkdown` drops it.
|
|
@@ -40,10 +47,13 @@ const uploadingAttribute = {
|
|
|
40
47
|
/** An image or video in the editor, with an "Uploading…" chip while its file uploads. */
|
|
41
48
|
function MediaView({ node }) {
|
|
42
49
|
const t = useTranslations('artifacts');
|
|
43
|
-
const
|
|
44
|
-
|
|
50
|
+
const src = attrString(node.attrs.src);
|
|
51
|
+
const alt = attrString(node.attrs.alt);
|
|
52
|
+
const title = attrStringOrNull(node.attrs.title) ?? undefined;
|
|
53
|
+
const uploading = attrBoolean(node.attrs.uploading);
|
|
54
|
+
return (_jsxs(NodeViewWrapper, { className: "kx-media", "data-uploading": uploading || undefined, "data-drag-handle": "", children: [node.type.name === 'video' ? (_jsx("video", { src: src || undefined, controls: true, preload: "metadata" })) : (
|
|
45
55
|
// eslint-disable-next-line @next/next/no-img-element -- a doc's own media, any origin
|
|
46
|
-
_jsx("img", { src: src, alt: alt
|
|
56
|
+
_jsx("img", { src: src || undefined, alt: alt, title: title })), uploading ? (_jsxs("span", { contentEditable: false, className: "bg-popover text-foreground absolute bottom-3 left-3 flex items-center gap-1.5 rounded-full border px-2.5 py-1 text-xs font-medium shadow-sm", children: [_jsx(SessionDotMatrix, { sessionId: src, size: 14, className: "shrink-0" }), _jsx(TextShimmer, { duration: 1, spread: 2, className: "text-xs", children: t('uploading') })] })) : null] }));
|
|
47
57
|
}
|
|
48
58
|
/** An image in a doc (`` in the file). */
|
|
49
59
|
export const DocImage = Image.extend({
|
|
@@ -52,7 +62,7 @@ export const DocImage = Image.extend({
|
|
|
52
62
|
return { ...this.parent?.(), ...uploadingAttribute };
|
|
53
63
|
},
|
|
54
64
|
addNodeView() {
|
|
55
|
-
return ReactNodeViewRenderer(MediaView);
|
|
65
|
+
return ReactNodeViewRenderer(safeNodeView(MediaView));
|
|
56
66
|
},
|
|
57
67
|
});
|
|
58
68
|
/** A video in a doc: `<video src controls>`, kept as HTML in the Markdown file. */
|
|
@@ -65,7 +75,7 @@ export const Video = Node.create({
|
|
|
65
75
|
return { src: { default: null }, ...uploadingAttribute };
|
|
66
76
|
},
|
|
67
77
|
addNodeView() {
|
|
68
|
-
return ReactNodeViewRenderer(MediaView);
|
|
78
|
+
return ReactNodeViewRenderer(safeNodeView(MediaView));
|
|
69
79
|
},
|
|
70
80
|
parseHTML() {
|
|
71
81
|
return [{ tag: 'video[src]' }];
|
|
@@ -80,7 +90,7 @@ function CodeBlockView({ node, editor, updateAttributes }) {
|
|
|
80
90
|
const t = useTranslations('artifacts');
|
|
81
91
|
const [editing, setEditing] = useState(false);
|
|
82
92
|
const source = node.textContent.trim();
|
|
83
|
-
const language = node.attrs.language
|
|
93
|
+
const language = attrString(node.attrs.language);
|
|
84
94
|
const diagram = language === 'mermaid' && source;
|
|
85
95
|
// A diagram shows as a picture; its source opens only for someone editing it.
|
|
86
96
|
const showSource = !diagram || editing;
|
|
@@ -96,11 +106,44 @@ export const DocCodeBlock = CodeBlock.extend({
|
|
|
96
106
|
// The element a DOM node or event target is, or sits in (a text node's parent).
|
|
97
107
|
const elementOf = (target) => target instanceof Element ? target : (target?.parentElement ?? null);
|
|
98
108
|
const controls = (target) => !!elementOf(target)?.closest('.kx-diagram, .kx-code > figcaption');
|
|
99
|
-
return ReactNodeViewRenderer(CodeBlockView, {
|
|
109
|
+
return ReactNodeViewRenderer(safeNodeView(CodeBlockView), {
|
|
100
110
|
stopEvent: ({ event }) => controls(event.target),
|
|
101
111
|
});
|
|
102
112
|
},
|
|
103
113
|
});
|
|
114
|
+
/** A raw block's caption: the name of the format it holds, a Markdown token like a code block's language, not UI copy. */
|
|
115
|
+
const RAW_LABEL = 'markdown';
|
|
116
|
+
/** A raw block: the file's own Markdown as monospace text, in the code figure's look. */
|
|
117
|
+
function RawMarkdownView({ node }) {
|
|
118
|
+
return (_jsx(NodeViewWrapper, { as: "div", children: _jsxs("figure", { className: "kx-code", children: [_jsxs("figcaption", { contentEditable: false, children: [_jsx("span", { children: RAW_LABEL }), node.textContent ? _jsx(CopyButton, { code: node.textContent }) : null] }), _jsx("pre", { children: _jsx(NodeViewContent, { as: "code" }) })] }) }));
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* A block the editor cannot show without rewriting it (front matter, a link
|
|
122
|
+
* reference definition, an HTML block; `markdown.ts` decides): its Markdown
|
|
123
|
+
* source as plain text. A person edits it as text, and it saves exactly as it
|
|
124
|
+
* reads. Input rules and marks do not apply inside it (`code`).
|
|
125
|
+
*/
|
|
126
|
+
export const RawMarkdown = Node.create({
|
|
127
|
+
name: 'rawMarkdown',
|
|
128
|
+
group: 'block',
|
|
129
|
+
content: 'text*',
|
|
130
|
+
marks: '',
|
|
131
|
+
code: true,
|
|
132
|
+
defining: true,
|
|
133
|
+
whitespace: 'pre',
|
|
134
|
+
parseHTML() {
|
|
135
|
+
// Before the code block's `pre` rule.
|
|
136
|
+
return [{ tag: `pre[${RAW_ATTRIBUTE}]`, preserveWhitespace: 'full', priority: 60 }];
|
|
137
|
+
},
|
|
138
|
+
renderHTML({ HTMLAttributes }) {
|
|
139
|
+
return ['pre', mergeAttributes(HTMLAttributes, { [RAW_ATTRIBUTE]: '' }), 0];
|
|
140
|
+
},
|
|
141
|
+
addNodeView() {
|
|
142
|
+
return ReactNodeViewRenderer(safeNodeView(RawMarkdownView), {
|
|
143
|
+
stopEvent: ({ event }) => !!event.target?.closest?.('.kx-code > figcaption'),
|
|
144
|
+
});
|
|
145
|
+
},
|
|
146
|
+
});
|
|
104
147
|
/**
|
|
105
148
|
* A line break in the Markdown source inside a paragraph. It reads as a space
|
|
106
149
|
* and saves as the newline it was (`markdown.ts`), so a hard-wrapped file
|
|
@@ -144,6 +187,10 @@ export function docExtensions({ editable, placeholder, }) {
|
|
|
144
187
|
TaskList,
|
|
145
188
|
TaskItem.configure({ nested: true }),
|
|
146
189
|
LinkEmbed,
|
|
190
|
+
RawMarkdown,
|
|
191
|
+
MarkdownSource,
|
|
192
|
+
PastedMarkdownSource,
|
|
193
|
+
SafeAttributes,
|
|
147
194
|
Placeholder.configure({ placeholder: ({ node }) => placeholder(node) }),
|
|
148
195
|
];
|
|
149
196
|
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { Extension } from '@tiptap/core';
|
|
2
|
+
/**
|
|
3
|
+
* What the doc editor keeps of a Markdown file's own spelling, so a block
|
|
4
|
+
* nobody edited saves byte for byte (`markdown.ts`). It rides on each
|
|
5
|
+
* top-level block as one attribute, `md`, written as `data-md` JSON. Every
|
|
6
|
+
* field is absent when the editor already writes the file that way.
|
|
7
|
+
*/
|
|
8
|
+
export type MdBlock = {
|
|
9
|
+
/** The text between the previous block and this one, when it is not one blank line (nothing, before the first block). */
|
|
10
|
+
gap?: string;
|
|
11
|
+
/**
|
|
12
|
+
* The kinds of the two blocks `gap` was read between (`heading>paragraph`,
|
|
13
|
+
* `^>heading` at the start of the file). `gap` applies only between the
|
|
14
|
+
* same two kinds: a split, a deleted neighbour or a new block type gets the
|
|
15
|
+
* standard blank line, so blocks never merge on the next open.
|
|
16
|
+
*/
|
|
17
|
+
pair?: string;
|
|
18
|
+
/** The end of the file after this block, when it is not one newline (`''`: no final newline). */
|
|
19
|
+
end?: string;
|
|
20
|
+
/**
|
|
21
|
+
* The block as the file spells it (`* item`, `Title\n===`, `|a|b|`), and
|
|
22
|
+
* the hash of what the editor writes for it. While the editor still writes
|
|
23
|
+
* that (nobody edited the block), the file keeps `src`.
|
|
24
|
+
*/
|
|
25
|
+
src?: string;
|
|
26
|
+
norm?: string;
|
|
27
|
+
/**
|
|
28
|
+
* How many editor blocks `src` covers, when more than one: the editor splits
|
|
29
|
+
* `Before  after.` into a paragraph, an image and a
|
|
30
|
+
* paragraph. `norm` is then the hash of all of them, one blank line apart.
|
|
31
|
+
*/
|
|
32
|
+
span?: number;
|
|
33
|
+
/** The file's lines end in CRLF. */
|
|
34
|
+
crlf?: true;
|
|
35
|
+
};
|
|
36
|
+
/** The block attribute's HTML name. */
|
|
37
|
+
export declare const MD_ATTRIBUTE = "data-md";
|
|
38
|
+
/** A raw block's HTML marker: `<pre data-raw-markdown>` holds Markdown the editor keeps as text. */
|
|
39
|
+
export declare const RAW_ATTRIBUTE = "data-raw-markdown";
|
|
40
|
+
/** Co-editing and the source-keeping analysis stop at 1 MiB of UTF-8. */
|
|
41
|
+
export declare const MAX_DOC_BYTES = 1048576;
|
|
42
|
+
/**
|
|
43
|
+
* A `gap` or an `end` the file may take: blank lines only (spaces, tabs,
|
|
44
|
+
* newlines), as the converter reads them. Anything else in one is text the
|
|
45
|
+
* editor does not show, so it is ignored.
|
|
46
|
+
*/
|
|
47
|
+
export declare const LAYOUT_WHITESPACE: RegExp;
|
|
48
|
+
export declare function readMd(el: Element): MdBlock | null;
|
|
49
|
+
/**
|
|
50
|
+
* `md` with only its known fields of their own type (a writer can set any
|
|
51
|
+
* JSON value): the same object when it is valid, null when nothing is left.
|
|
52
|
+
*/
|
|
53
|
+
export declare function sanitizeMd(value: unknown): MdBlock | null;
|
|
54
|
+
export declare function writeMd(md: MdBlock | null | undefined): string | null;
|
|
55
|
+
/** cyrb53: a 53-bit string hash, base 36. Collisions are ~1 in 9·10^15. */
|
|
56
|
+
export declare function hashText(text: string): string;
|
|
57
|
+
/** The block kind `pair` names: one word per top-level element of the editor's HTML. */
|
|
58
|
+
export declare function blockKind(el: Element): string;
|
|
59
|
+
/** Pasted HTML without the file's bookkeeping: `md` and the raw-block marker come only from the file. */
|
|
60
|
+
export declare function stripMarkdownSource(html: string): string;
|
|
61
|
+
/**
|
|
62
|
+
* Paste never brings a kept source, a gap or a raw block: a page can hide
|
|
63
|
+
* text in `data-md` that the editor would not show but the file would hold.
|
|
64
|
+
* A pasted raw block opens as a code block.
|
|
65
|
+
*/
|
|
66
|
+
export declare const PastedMarkdownSource: Extension<any, any>;
|
|
67
|
+
/**
|
|
68
|
+
* The `md` attribute on every block node. A block split at its end starts
|
|
69
|
+
* without it (`keepOnSplit: false`); a split in the middle copies it, which
|
|
70
|
+
* is safe: the copy no longer writes `norm`, and its `pair` no longer holds.
|
|
71
|
+
*/
|
|
72
|
+
export declare const MarkdownSource: Extension<any, any>;
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { Extension } from '@tiptap/core';
|
|
2
|
+
import { Plugin, PluginKey } from '@tiptap/pm/state';
|
|
3
|
+
/** The block attribute's HTML name. */
|
|
4
|
+
export const MD_ATTRIBUTE = 'data-md';
|
|
5
|
+
/** A raw block's HTML marker: `<pre data-raw-markdown>` holds Markdown the editor keeps as text. */
|
|
6
|
+
export const RAW_ATTRIBUTE = 'data-raw-markdown';
|
|
7
|
+
/** Co-editing and the source-keeping analysis stop at 1 MiB of UTF-8. */
|
|
8
|
+
export const MAX_DOC_BYTES = 1_048_576;
|
|
9
|
+
/**
|
|
10
|
+
* A `gap` or an `end` the file may take: blank lines only (spaces, tabs,
|
|
11
|
+
* newlines), as the converter reads them. Anything else in one is text the
|
|
12
|
+
* editor does not show, so it is ignored.
|
|
13
|
+
*/
|
|
14
|
+
export const LAYOUT_WHITESPACE = /^[ \t\n]*$/;
|
|
15
|
+
export function readMd(el) {
|
|
16
|
+
const raw = el.getAttribute(MD_ATTRIBUTE);
|
|
17
|
+
if (!raw)
|
|
18
|
+
return null;
|
|
19
|
+
try {
|
|
20
|
+
return sanitizeMd(JSON.parse(raw));
|
|
21
|
+
}
|
|
22
|
+
catch {
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
const MD_STRINGS = new Set(['gap', 'pair', 'end', 'src', 'norm']);
|
|
27
|
+
const mdField = (key, value) => MD_STRINGS.has(key)
|
|
28
|
+
? typeof value === 'string'
|
|
29
|
+
: key === 'span'
|
|
30
|
+
? typeof value === 'number' && Number.isInteger(value) && value > 1 && value <= 10_000
|
|
31
|
+
: key === 'crlf' && value === true;
|
|
32
|
+
/**
|
|
33
|
+
* `md` with only its known fields of their own type (a writer can set any
|
|
34
|
+
* JSON value): the same object when it is valid, null when nothing is left.
|
|
35
|
+
*/
|
|
36
|
+
export function sanitizeMd(value) {
|
|
37
|
+
if (!value || typeof value !== 'object' || Array.isArray(value))
|
|
38
|
+
return null;
|
|
39
|
+
const entries = Object.entries(value);
|
|
40
|
+
if (entries.every(([key, field]) => mdField(key, field)))
|
|
41
|
+
return entries.length ? value : null;
|
|
42
|
+
const kept = entries.filter(([key, field]) => mdField(key, field));
|
|
43
|
+
return kept.length ? Object.fromEntries(kept) : null;
|
|
44
|
+
}
|
|
45
|
+
export function writeMd(md) {
|
|
46
|
+
return md && Object.keys(md).length ? JSON.stringify(md) : null;
|
|
47
|
+
}
|
|
48
|
+
/** cyrb53: a 53-bit string hash, base 36. Collisions are ~1 in 9·10^15. */
|
|
49
|
+
export function hashText(text) {
|
|
50
|
+
let h1 = 0xdeadbeef;
|
|
51
|
+
let h2 = 0x41c6ce57;
|
|
52
|
+
for (let i = 0; i < text.length; i++) {
|
|
53
|
+
const ch = text.charCodeAt(i);
|
|
54
|
+
h1 = Math.imul(h1 ^ ch, 2654435761);
|
|
55
|
+
h2 = Math.imul(h2 ^ ch, 1597334677);
|
|
56
|
+
}
|
|
57
|
+
h1 = Math.imul(h1 ^ (h1 >>> 16), 2246822507) ^ Math.imul(h2 ^ (h2 >>> 13), 3266489909);
|
|
58
|
+
h2 = Math.imul(h2 ^ (h2 >>> 16), 2246822507) ^ Math.imul(h1 ^ (h1 >>> 13), 3266489909);
|
|
59
|
+
return (4294967296 * (2097151 & h2) + (h1 >>> 0)).toString(36);
|
|
60
|
+
}
|
|
61
|
+
/** The block kind `pair` names: one word per top-level element of the editor's HTML. */
|
|
62
|
+
export function blockKind(el) {
|
|
63
|
+
if (el.hasAttribute(RAW_ATTRIBUTE))
|
|
64
|
+
return 'raw';
|
|
65
|
+
const tag = el.nodeName.toLowerCase();
|
|
66
|
+
if (/^h[1-6]$/.test(tag))
|
|
67
|
+
return 'heading';
|
|
68
|
+
if (tag === 'ul' && el.getAttribute('data-type') === 'taskList')
|
|
69
|
+
return 'tasks';
|
|
70
|
+
return tag;
|
|
71
|
+
}
|
|
72
|
+
/** Every node that can be a top-level block of a doc. */
|
|
73
|
+
const BLOCK_TYPES = [
|
|
74
|
+
'paragraph',
|
|
75
|
+
'heading',
|
|
76
|
+
'blockquote',
|
|
77
|
+
'bulletList',
|
|
78
|
+
'orderedList',
|
|
79
|
+
'taskList',
|
|
80
|
+
'codeBlock',
|
|
81
|
+
'horizontalRule',
|
|
82
|
+
'table',
|
|
83
|
+
'image',
|
|
84
|
+
'video',
|
|
85
|
+
'linkEmbed',
|
|
86
|
+
'rawMarkdown',
|
|
87
|
+
];
|
|
88
|
+
/** Pasted HTML without the file's bookkeeping: `md` and the raw-block marker come only from the file. */
|
|
89
|
+
export function stripMarkdownSource(html) {
|
|
90
|
+
if (!html.includes(MD_ATTRIBUTE) && !html.includes(RAW_ATTRIBUTE))
|
|
91
|
+
return html;
|
|
92
|
+
const doc = new DOMParser().parseFromString(html, 'text/html');
|
|
93
|
+
doc.querySelectorAll(`[${MD_ATTRIBUTE}], [${RAW_ATTRIBUTE}]`).forEach((el) => {
|
|
94
|
+
el.removeAttribute(MD_ATTRIBUTE);
|
|
95
|
+
el.removeAttribute(RAW_ATTRIBUTE);
|
|
96
|
+
});
|
|
97
|
+
return doc.body.innerHTML;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Paste never brings a kept source, a gap or a raw block: a page can hide
|
|
101
|
+
* text in `data-md` that the editor would not show but the file would hold.
|
|
102
|
+
* A pasted raw block opens as a code block.
|
|
103
|
+
*/
|
|
104
|
+
export const PastedMarkdownSource = Extension.create({
|
|
105
|
+
name: 'pastedMarkdownSource',
|
|
106
|
+
addProseMirrorPlugins() {
|
|
107
|
+
return [new Plugin({ key: new PluginKey('pastedMarkdownSource'), props: { transformPastedHTML: stripMarkdownSource } })];
|
|
108
|
+
},
|
|
109
|
+
});
|
|
110
|
+
/**
|
|
111
|
+
* The `md` attribute on every block node. A block split at its end starts
|
|
112
|
+
* without it (`keepOnSplit: false`); a split in the middle copies it, which
|
|
113
|
+
* is safe: the copy no longer writes `norm`, and its `pair` no longer holds.
|
|
114
|
+
*/
|
|
115
|
+
export const MarkdownSource = Extension.create({
|
|
116
|
+
name: 'markdownSource',
|
|
117
|
+
addGlobalAttributes() {
|
|
118
|
+
return [
|
|
119
|
+
{
|
|
120
|
+
types: BLOCK_TYPES,
|
|
121
|
+
attributes: {
|
|
122
|
+
md: {
|
|
123
|
+
default: null,
|
|
124
|
+
keepOnSplit: false,
|
|
125
|
+
parseHTML: (el) => readMd(el),
|
|
126
|
+
renderHTML: (attrs) => {
|
|
127
|
+
const value = writeMd(attrs.md);
|
|
128
|
+
return value ? { [MD_ATTRIBUTE]: value } : {};
|
|
129
|
+
},
|
|
130
|
+
},
|
|
131
|
+
},
|
|
132
|
+
},
|
|
133
|
+
];
|
|
134
|
+
},
|
|
135
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type ReactNodeViewProps } from '@tiptap/react';
|
|
2
|
+
import { type ComponentType } from 'react';
|
|
3
|
+
/**
|
|
4
|
+
* A node view that cannot take down the pane: a render error in one node
|
|
5
|
+
* (an attribute a writer set to something the view cannot show) leaves an
|
|
6
|
+
* inert placeholder for that node and is reported. Every React node view of
|
|
7
|
+
* the doc editor goes through this.
|
|
8
|
+
*/
|
|
9
|
+
export declare function safeNodeView<P extends ReactNodeViewProps>(View: ComponentType<P>): ComponentType<P>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { WarningCircleIcon } from '@phosphor-icons/react';
|
|
4
|
+
import { NodeViewWrapper } from '@tiptap/react';
|
|
5
|
+
import { useEffect, useRef } from 'react';
|
|
6
|
+
import { ErrorBoundary } from '../../primitives/error-boundary.js';
|
|
7
|
+
/** What a node view shows when it cannot render: an inert block, the rest of the doc unaffected. */
|
|
8
|
+
function NodeViewFailed({ node, reset }) {
|
|
9
|
+
// The node changed (a fix arrived): try the view again.
|
|
10
|
+
const first = useRef(node);
|
|
11
|
+
useEffect(() => {
|
|
12
|
+
if (node !== first.current)
|
|
13
|
+
reset();
|
|
14
|
+
}, [node, reset]);
|
|
15
|
+
return (_jsx(NodeViewWrapper, { as: "div", contentEditable: false, "data-node-error": "", className: "border-border text-muted-foreground my-3 flex items-center rounded-md border border-dashed px-3 py-2", children: _jsx(WarningCircleIcon, { className: "size-4", "aria-hidden": true }) }));
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* A node view that cannot take down the pane: a render error in one node
|
|
19
|
+
* (an attribute a writer set to something the view cannot show) leaves an
|
|
20
|
+
* inert placeholder for that node and is reported. Every React node view of
|
|
21
|
+
* the doc editor goes through this.
|
|
22
|
+
*/
|
|
23
|
+
export function safeNodeView(View) {
|
|
24
|
+
function SafeNodeView(props) {
|
|
25
|
+
return (_jsx(ErrorBoundary, { fallback: ({ reset }) => _jsx(NodeViewFailed, { node: props.node, reset: reset }), children: _jsx(View, { ...props }) }));
|
|
26
|
+
}
|
|
27
|
+
SafeNodeView.displayName = `Safe(${View.displayName ?? View.name})`;
|
|
28
|
+
return SafeNodeView;
|
|
29
|
+
}
|
|
@@ -7,6 +7,26 @@
|
|
|
7
7
|
* `<span data-soft-break>`, which reads as a space and saves as a newline.
|
|
8
8
|
* A file wrapped at 72 columns stays wrapped, so a one-word edit is a
|
|
9
9
|
* one-line diff.
|
|
10
|
+
*
|
|
11
|
+
* A file the editor would write differently (`* item`, a setext heading, an
|
|
12
|
+
* aligned table, three blank lines, no final newline) keeps its own spelling
|
|
13
|
+
* (`sourcePlan`): an unedited block saves byte for byte, and a block the
|
|
14
|
+
* editor cannot show at all (front matter, a link definition, an HTML block)
|
|
15
|
+
* opens as a raw block of Markdown text.
|
|
10
16
|
*/
|
|
11
17
|
export declare function markdownToHtml(markdown: string): string;
|
|
18
|
+
export type DocRoundTrip = {
|
|
19
|
+
/** Saving the file unedited from the editor gives the same bytes. */
|
|
20
|
+
ok: boolean;
|
|
21
|
+
/** Why not: over 1 MiB, mixed line endings, or a shape the editor cannot keep. */
|
|
22
|
+
reason?: 'too-large' | 'line-endings' | 'unstable';
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Whether a person can open `markdown` in the editor and save it without a
|
|
26
|
+
* byte changing: the condition for co-editing a doc, where every client
|
|
27
|
+
* flushes the file from the editor. One whole-document pass when the editor
|
|
28
|
+
* already writes the file as it is; the plan is cached for the
|
|
29
|
+
* `markdownToHtml` call that opens it.
|
|
30
|
+
*/
|
|
31
|
+
export declare function docRoundTrips(markdown: string): DocRoundTrip;
|
|
12
32
|
export declare function htmlToMarkdown(html: string): string;
|