@ecsplico/editor 0.0.0-stage → 1.0.0
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/LICENSE +21 -0
- package/README.md +233 -2
- package/dist/code/CodeSurface.d.ts +24 -0
- package/dist/code/CodeSurface.js +57 -0
- package/dist/code/CodeSurface.js.map +1 -0
- package/dist/code/CodeSurface.vue.d.ts +29 -0
- package/dist/code/CodeSurface2.js +75 -0
- package/dist/code/CodeSurface2.js.map +1 -0
- package/dist/code/chrome-theme.js +76 -0
- package/dist/code/chrome-theme.js.map +1 -0
- package/dist/code/compartments.js +19 -0
- package/dist/code/compartments.js.map +1 -0
- package/dist/code/editor-factory.d.ts +41 -0
- package/dist/code/editor-factory.js +126 -0
- package/dist/code/editor-factory.js.map +1 -0
- package/dist/code/format-json.d.ts +27 -0
- package/dist/code/format-json.js +94 -0
- package/dist/code/format-json.js.map +1 -0
- package/dist/code/highlight-style.js +118 -0
- package/dist/code/highlight-style.js.map +1 -0
- package/dist/code/index.d.ts +6 -0
- package/dist/code/index.js +6 -0
- package/dist/code/jsonl-language.d.ts +6 -0
- package/dist/code/jsonl-language.js +33 -0
- package/dist/code/jsonl-language.js.map +1 -0
- package/dist/code/kind.d.ts +15 -0
- package/dist/code/kind.js +142 -0
- package/dist/code/kind.js.map +1 -0
- package/dist/code/lang-registry.d.ts +31 -0
- package/dist/code/lang-registry.js +54 -0
- package/dist/code/lang-registry.js.map +1 -0
- package/dist/code/react.d.ts +2 -0
- package/dist/code/react.js +1 -0
- package/dist/code/vue.d.ts +2 -0
- package/dist/code/vue.js +1 -0
- package/dist/core/abilities.d.ts +32 -0
- package/dist/core/abilities.js +160 -0
- package/dist/core/abilities.js.map +1 -0
- package/dist/core/block-convert.d.ts +59 -0
- package/dist/core/block-convert.js +164 -0
- package/dist/core/block-convert.js.map +1 -0
- package/dist/core/block-drag.d.ts +12 -0
- package/dist/core/block-drag.js +62 -0
- package/dist/core/block-drag.js.map +1 -0
- package/dist/core/block-flash.d.ts +19 -0
- package/dist/core/block-flash.js +66 -0
- package/dist/core/block-flash.js.map +1 -0
- package/dist/core/context.d.ts +63 -0
- package/dist/core/context.js +108 -0
- package/dist/core/context.js.map +1 -0
- package/dist/core/convert.d.ts +96 -0
- package/dist/core/convert.js +241 -0
- package/dist/core/convert.js.map +1 -0
- package/dist/core/core-feature.d.ts +17 -0
- package/dist/core/core-feature.js +100 -0
- package/dist/core/core-feature.js.map +1 -0
- package/dist/core/define-editor.d.ts +23 -0
- package/dist/core/define-editor.js +110 -0
- package/dist/core/define-editor.js.map +1 -0
- package/dist/core/doc-anchors.d.ts +67 -0
- package/dist/core/doc-anchors.js +112 -0
- package/dist/core/doc-anchors.js.map +1 -0
- package/dist/core/document-markdown.d.ts +13 -0
- package/dist/core/document-markdown.js +31 -0
- package/dist/core/document-markdown.js.map +1 -0
- package/dist/core/download.d.ts +5 -0
- package/dist/core/download.js +16 -0
- package/dist/core/download.js.map +1 -0
- package/dist/core/editor-ui.d.ts +45 -0
- package/dist/core/editor-ui.js +38 -0
- package/dist/core/editor-ui.js.map +1 -0
- package/dist/core/extension-points.d.ts +64 -0
- package/dist/core/feature-context.d.ts +32 -0
- package/dist/core/feature-context.js +46 -0
- package/dist/core/feature-context.js.map +1 -0
- package/dist/core/feature.d.ts +234 -0
- package/dist/core/feature.js +13 -0
- package/dist/core/feature.js.map +1 -0
- package/dist/core/fences.d.ts +16 -0
- package/dist/core/fences.js +105 -0
- package/dist/core/fences.js.map +1 -0
- package/dist/core/fetch-error.d.ts +5 -0
- package/dist/core/fetch-error.js +11 -0
- package/dist/core/fetch-error.js.map +1 -0
- package/dist/core/index.d.ts +28 -0
- package/dist/core/index.js +27 -0
- package/dist/core/metadata-types.d.ts +27 -0
- package/dist/core/metadata-types.js +10 -0
- package/dist/core/metadata-types.js.map +1 -0
- package/dist/core/metadata.d.ts +39 -0
- package/dist/core/metadata.js +76 -0
- package/dist/core/metadata.js.map +1 -0
- package/dist/core/notify.d.ts +31 -0
- package/dist/core/notify.js +7 -0
- package/dist/core/notify.js.map +1 -0
- package/dist/core/pipeline.d.ts +52 -0
- package/dist/core/pipeline.js +78 -0
- package/dist/core/pipeline.js.map +1 -0
- package/dist/core/schema/abilities.d.ts +55 -0
- package/dist/core/schema/abilities.js +113 -0
- package/dist/core/schema/abilities.js.map +1 -0
- package/dist/core/schema/block-ids.d.ts +29 -0
- package/dist/core/schema/block-ids.js +134 -0
- package/dist/core/schema/block-ids.js.map +1 -0
- package/dist/core/schema/hex-color.d.ts +5 -0
- package/dist/core/schema/hex-color.js +7 -0
- package/dist/core/schema/hex-color.js.map +1 -0
- package/dist/core/schema/index.d.ts +21 -0
- package/dist/core/schema/index.js +33 -0
- package/dist/core/schema/index.js.map +1 -0
- package/dist/core/schema/mark-flags.d.ts +12 -0
- package/dist/core/schema/node-flags.d.ts +23 -0
- package/dist/core/schema/node-flags.js +34 -0
- package/dist/core/schema/node-flags.js.map +1 -0
- package/dist/core/schema/opaque-fence.d.ts +11 -0
- package/dist/core/schema/opaque-fence.js +57 -0
- package/dist/core/schema/opaque-fence.js.map +1 -0
- package/dist/core/schema/strike.d.ts +4 -0
- package/dist/core/schema/strike.js +9 -0
- package/dist/core/schema/strike.js.map +1 -0
- package/dist/core/selection-range.d.ts +13 -0
- package/dist/core/selection-range.js +28 -0
- package/dist/core/selection-range.js.map +1 -0
- package/dist/core/slash.d.ts +24 -0
- package/dist/core/slash.js +60 -0
- package/dist/core/slash.js.map +1 -0
- package/dist/core/store.d.ts +22 -0
- package/dist/core/store.js +61 -0
- package/dist/core/store.js.map +1 -0
- package/dist/core/suggestion-popup.d.ts +63 -0
- package/dist/core/suggestion-popup.js +57 -0
- package/dist/core/suggestion-popup.js.map +1 -0
- package/dist/core/tag-name.js +11 -0
- package/dist/core/tag-name.js.map +1 -0
- package/dist/core/toolbar-items.d.ts +10 -0
- package/dist/core/toolbar-items.js +206 -0
- package/dist/core/toolbar-items.js.map +1 -0
- package/dist/core/toolbar.d.ts +74 -0
- package/dist/core/toolbar.js +45 -0
- package/dist/core/toolbar.js.map +1 -0
- package/dist/document/DocumentSurface.d.ts +38 -0
- package/dist/document/DocumentSurface.js +44 -0
- package/dist/document/DocumentSurface.js.map +1 -0
- package/dist/document/DocumentSurface.vue.d.ts +56 -0
- package/dist/document/DocumentSurface2.js +71 -0
- package/dist/document/DocumentSurface2.js.map +1 -0
- package/dist/document/react.d.ts +2 -0
- package/dist/document/react.js +1 -0
- package/dist/document/vue.d.ts +2 -0
- package/dist/document/vue.js +1 -0
- package/dist/features/ai/agent-op-review.d.ts +69 -0
- package/dist/features/ai/agent-op-review.js +182 -0
- package/dist/features/ai/agent-op-review.js.map +1 -0
- package/dist/features/ai/agent-ops.d.ts +15 -0
- package/dist/features/ai/agent-ops.js +228 -0
- package/dist/features/ai/agent-ops.js.map +1 -0
- package/dist/features/ai/ai-apply.d.ts +76 -0
- package/dist/features/ai/ai-apply.js +193 -0
- package/dist/features/ai/ai-apply.js.map +1 -0
- package/dist/features/ai/ai-menu.d.ts +38 -0
- package/dist/features/ai/ai-menu.js +20 -0
- package/dist/features/ai/ai-menu.js.map +1 -0
- package/dist/features/ai/ai-review.d.ts +136 -0
- package/dist/features/ai/ai-review.js +543 -0
- package/dist/features/ai/ai-review.js.map +1 -0
- package/dist/features/ai/ai-selection-highlight.d.ts +21 -0
- package/dist/features/ai/ai-selection-highlight.js +44 -0
- package/dist/features/ai/ai-selection-highlight.js.map +1 -0
- package/dist/features/ai/ai-sse.d.ts +28 -0
- package/dist/features/ai/ai-sse.js +82 -0
- package/dist/features/ai/ai-sse.js.map +1 -0
- package/dist/features/ai/assistant.d.ts +53 -0
- package/dist/features/ai/assistant.js +82 -0
- package/dist/features/ai/assistant.js.map +1 -0
- package/dist/features/ai/block-actions.d.ts +20 -0
- package/dist/features/ai/block-actions.js +55 -0
- package/dist/features/ai/block-actions.js.map +1 -0
- package/dist/features/ai/components/AiReviewBar.js +145 -0
- package/dist/features/ai/components/AiReviewBar.js.map +1 -0
- package/dist/features/ai/components/AiReviewBar.vue.d.ts +15 -0
- package/dist/features/ai/components/AiSelectionMenu.js +519 -0
- package/dist/features/ai/components/AiSelectionMenu.js.map +1 -0
- package/dist/features/ai/components/AiSelectionMenu.vue.d.ts +17 -0
- package/dist/features/ai/components/AiSidebar.js +378 -0
- package/dist/features/ai/components/AiSidebar.js.map +1 -0
- package/dist/features/ai/components/AiSidebar.vue.d.ts +26 -0
- package/dist/features/ai/components/DocumentChatAnswer.js +67 -0
- package/dist/features/ai/components/DocumentChatAnswer.js.map +1 -0
- package/dist/features/ai/components/DocumentChatAnswer.vue.d.ts +13 -0
- package/dist/features/ai/components/DocumentChatOps.js +113 -0
- package/dist/features/ai/components/DocumentChatOps.js.map +1 -0
- package/dist/features/ai/components/DocumentChatOps.vue.d.ts +27 -0
- package/dist/features/ai/components/ModelQuickSwitch.js +84 -0
- package/dist/features/ai/components/ModelQuickSwitch.js.map +1 -0
- package/dist/features/ai/components/ModelQuickSwitch.vue.d.ts +23 -0
- package/dist/features/ai/components/SettingsAiTab.js +88 -0
- package/dist/features/ai/components/SettingsAiTab.js.map +1 -0
- package/dist/features/ai/components/SettingsAiTab.vue.d.ts +6 -0
- package/dist/features/ai/components/SettingsModelProfiles.js +260 -0
- package/dist/features/ai/components/SettingsModelProfiles.js.map +1 -0
- package/dist/features/ai/components/SettingsModelProfiles.vue.d.ts +6 -0
- package/dist/features/ai/document-chat-model.d.ts +88 -0
- package/dist/features/ai/document-chat-model.js +190 -0
- package/dist/features/ai/document-chat-model.js.map +1 -0
- package/dist/features/ai/document-chat.d.ts +17 -0
- package/dist/features/ai/document-chat.js +112 -0
- package/dist/features/ai/document-chat.js.map +1 -0
- package/dist/features/ai/feature.d.ts +25 -0
- package/dist/features/ai/feature.js +89 -0
- package/dist/features/ai/feature.js.map +1 -0
- package/dist/features/ai/ghost-autocomplete.d.ts +47 -0
- package/dist/features/ai/ghost-autocomplete.js +204 -0
- package/dist/features/ai/ghost-autocomplete.js.map +1 -0
- package/dist/features/ai/index.d.ts +24 -0
- package/dist/features/ai/index.js +23 -0
- package/dist/features/ai/model-profiles.d.ts +36 -0
- package/dist/features/ai/model-profiles.js +111 -0
- package/dist/features/ai/model-profiles.js.map +1 -0
- package/dist/features/ai/preview-extensions.js +14 -0
- package/dist/features/ai/preview-extensions.js.map +1 -0
- package/dist/features/ai/protocol/agent-ops.d.ts +120 -0
- package/dist/features/ai/protocol/agent-ops.js +298 -0
- package/dist/features/ai/protocol/agent-ops.js.map +1 -0
- package/dist/features/ai/protocol/chat.d.ts +57 -0
- package/dist/features/ai/protocol/chat.js +146 -0
- package/dist/features/ai/protocol/chat.js.map +1 -0
- package/dist/features/ai/protocol/complete.d.ts +21 -0
- package/dist/features/ai/protocol/complete.js +81 -0
- package/dist/features/ai/protocol/complete.js.map +1 -0
- package/dist/features/ai/protocol/index.d.ts +7 -0
- package/dist/features/ai/protocol/index.js +7 -0
- package/dist/features/ai/protocol/models.d.ts +48 -0
- package/dist/features/ai/protocol/models.js +41 -0
- package/dist/features/ai/protocol/models.js.map +1 -0
- package/dist/features/ai/protocol/schemas.d.ts +36 -0
- package/dist/features/ai/protocol/schemas.js +40 -0
- package/dist/features/ai/protocol/schemas.js.map +1 -0
- package/dist/features/ai/protocol/tasks.d.ts +107 -0
- package/dist/features/ai/protocol/tasks.js +227 -0
- package/dist/features/ai/protocol/tasks.js.map +1 -0
- package/dist/features/ai/rate-limit.d.ts +9 -0
- package/dist/features/ai/rate-limit.js +20 -0
- package/dist/features/ai/rate-limit.js.map +1 -0
- package/dist/features/ai/react/AiReviewBar.d.ts +12 -0
- package/dist/features/ai/react/AiReviewBar.js +156 -0
- package/dist/features/ai/react/AiReviewBar.js.map +1 -0
- package/dist/features/ai/react/AiSelectionMenu.d.ts +14 -0
- package/dist/features/ai/react/AiSelectionMenu.js +513 -0
- package/dist/features/ai/react/AiSelectionMenu.js.map +1 -0
- package/dist/features/ai/react/AiSidebar.d.ts +19 -0
- package/dist/features/ai/react/AiSidebar.js +339 -0
- package/dist/features/ai/react/AiSidebar.js.map +1 -0
- package/dist/features/ai/react/DocumentChatAnswer.d.ts +10 -0
- package/dist/features/ai/react/DocumentChatAnswer.js +70 -0
- package/dist/features/ai/react/DocumentChatAnswer.js.map +1 -0
- package/dist/features/ai/react/DocumentChatOps.d.ts +19 -0
- package/dist/features/ai/react/DocumentChatOps.js +111 -0
- package/dist/features/ai/react/DocumentChatOps.js.map +1 -0
- package/dist/features/ai/react/ModelQuickSwitch.d.ts +19 -0
- package/dist/features/ai/react/ModelQuickSwitch.js +89 -0
- package/dist/features/ai/react/ModelQuickSwitch.js.map +1 -0
- package/dist/features/ai/react/SettingsAiTab.d.ts +5 -0
- package/dist/features/ai/react/SettingsAiTab.js +103 -0
- package/dist/features/ai/react/SettingsAiTab.js.map +1 -0
- package/dist/features/ai/react/SettingsModelProfiles.d.ts +8 -0
- package/dist/features/ai/react/SettingsModelProfiles.js +318 -0
- package/dist/features/ai/react/SettingsModelProfiles.js.map +1 -0
- package/dist/features/ai/react/use-ai-assistant.d.ts +22 -0
- package/dist/features/ai/react/use-ai-assistant.js +36 -0
- package/dist/features/ai/react/use-ai-assistant.js.map +1 -0
- package/dist/features/ai/react/use-document-chat.d.ts +32 -0
- package/dist/features/ai/react/use-document-chat.js +43 -0
- package/dist/features/ai/react/use-document-chat.js.map +1 -0
- package/dist/features/ai/react/use-model-profiles.d.ts +20 -0
- package/dist/features/ai/react/use-model-profiles.js +33 -0
- package/dist/features/ai/react/use-model-profiles.js.map +1 -0
- package/dist/features/ai/react.d.ts +23 -0
- package/dist/features/ai/react.js +28 -0
- package/dist/features/ai/react.js.map +1 -0
- package/dist/features/ai/sidebar-flow.d.ts +61 -0
- package/dist/features/ai/sidebar-flow.js +125 -0
- package/dist/features/ai/sidebar-flow.js.map +1 -0
- package/dist/features/ai/use-ai-assistant.d.ts +22 -0
- package/dist/features/ai/use-ai-assistant.js +39 -0
- package/dist/features/ai/use-ai-assistant.js.map +1 -0
- package/dist/features/ai/use-document-chat.d.ts +33 -0
- package/dist/features/ai/use-document-chat.js +45 -0
- package/dist/features/ai/use-document-chat.js.map +1 -0
- package/dist/features/ai/use-model-profiles.d.ts +23 -0
- package/dist/features/ai/use-model-profiles.js +50 -0
- package/dist/features/ai/use-model-profiles.js.map +1 -0
- package/dist/features/ai/vue.d.ts +21 -0
- package/dist/features/ai/vue.js +28 -0
- package/dist/features/ai/vue.js.map +1 -0
- package/dist/features/authors/attribution.d.ts +36 -0
- package/dist/features/authors/attribution.js +94 -0
- package/dist/features/authors/attribution.js.map +1 -0
- package/dist/features/authors/author-color-styles.d.ts +12 -0
- package/dist/features/authors/author-color-styles.js +24 -0
- package/dist/features/authors/author-color-styles.js.map +1 -0
- package/dist/features/authors/components/AuthorColorsButton.js +50 -0
- package/dist/features/authors/components/AuthorColorsButton.js.map +1 -0
- package/dist/features/authors/components/AuthorColorsButton.vue.d.ts +11 -0
- package/dist/features/authors/components/AuthorColorsPanel.js +72 -0
- package/dist/features/authors/components/AuthorColorsPanel.js.map +1 -0
- package/dist/features/authors/components/AuthorColorsPanel.vue.d.ts +11 -0
- package/dist/features/authors/components/SettingsAuthorsTab.js +49 -0
- package/dist/features/authors/components/SettingsAuthorsTab.js.map +1 -0
- package/dist/features/authors/components/SettingsAuthorsTab.vue.d.ts +6 -0
- package/dist/features/authors/feature.d.ts +22 -0
- package/dist/features/authors/feature.js +47 -0
- package/dist/features/authors/feature.js.map +1 -0
- package/dist/features/authors/index.d.ts +7 -0
- package/dist/features/authors/index.js +6 -0
- package/dist/features/authors/react/AuthorColorsButton.d.ts +8 -0
- package/dist/features/authors/react/AuthorColorsButton.js +41 -0
- package/dist/features/authors/react/AuthorColorsButton.js.map +1 -0
- package/dist/features/authors/react/AuthorColorsPanel.d.ts +8 -0
- package/dist/features/authors/react/AuthorColorsPanel.js +125 -0
- package/dist/features/authors/react/AuthorColorsPanel.js.map +1 -0
- package/dist/features/authors/react/SettingsAuthorsTab.d.ts +5 -0
- package/dist/features/authors/react/SettingsAuthorsTab.js +92 -0
- package/dist/features/authors/react/SettingsAuthorsTab.js.map +1 -0
- package/dist/features/authors/react.d.ts +11 -0
- package/dist/features/authors/react.js +16 -0
- package/dist/features/authors/react.js.map +1 -0
- package/dist/features/authors/schema.d.ts +22 -0
- package/dist/features/authors/schema.js +70 -0
- package/dist/features/authors/schema.js.map +1 -0
- package/dist/features/authors/vue.d.ts +10 -0
- package/dist/features/authors/vue.js +16 -0
- package/dist/features/authors/vue.js.map +1 -0
- package/dist/features/block-ui/block-actions.d.ts +17 -0
- package/dist/features/block-ui/block-actions.js +37 -0
- package/dist/features/block-ui/block-actions.js.map +1 -0
- package/dist/features/block-ui/components/BlockActionsOverlay.js +142 -0
- package/dist/features/block-ui/components/BlockActionsOverlay.js.map +1 -0
- package/dist/features/block-ui/components/BlockActionsOverlay.vue.d.ts +25 -0
- package/dist/features/block-ui/components/BlockHandles.js +113 -0
- package/dist/features/block-ui/components/BlockHandles.js.map +1 -0
- package/dist/features/block-ui/components/BlockUi.js +181 -0
- package/dist/features/block-ui/components/BlockUi.js.map +1 -0
- package/dist/features/block-ui/components/BlockUi.vue.d.ts +17 -0
- package/dist/features/block-ui/feature.d.ts +21 -0
- package/dist/features/block-ui/feature.js +23 -0
- package/dist/features/block-ui/feature.js.map +1 -0
- package/dist/features/block-ui/handle-geometry.js +52 -0
- package/dist/features/block-ui/handle-geometry.js.map +1 -0
- package/dist/features/block-ui/index.d.ts +3 -0
- package/dist/features/block-ui/index.js +3 -0
- package/dist/features/block-ui/react/BlockActionsOverlay.d.ts +19 -0
- package/dist/features/block-ui/react/BlockActionsOverlay.js +142 -0
- package/dist/features/block-ui/react/BlockActionsOverlay.js.map +1 -0
- package/dist/features/block-ui/react/BlockHandles.d.ts +15 -0
- package/dist/features/block-ui/react/BlockHandles.js +104 -0
- package/dist/features/block-ui/react/BlockHandles.js.map +1 -0
- package/dist/features/block-ui/react/BlockUi.d.ts +14 -0
- package/dist/features/block-ui/react/BlockUi.js +174 -0
- package/dist/features/block-ui/react/BlockUi.js.map +1 -0
- package/dist/features/block-ui/react.d.ts +11 -0
- package/dist/features/block-ui/react.js +13 -0
- package/dist/features/block-ui/react.js.map +1 -0
- package/dist/features/block-ui/vue.d.ts +9 -0
- package/dist/features/block-ui/vue.js +12 -0
- package/dist/features/block-ui/vue.js.map +1 -0
- package/dist/features/collab/anchor-resolver.d.ts +7 -0
- package/dist/features/collab/anchor-resolver.js +92 -0
- package/dist/features/collab/anchor-resolver.js.map +1 -0
- package/dist/features/collab/feature.d.ts +22 -0
- package/dist/features/collab/feature.js +36 -0
- package/dist/features/collab/feature.js.map +1 -0
- package/dist/features/collab/index.d.ts +3 -0
- package/dist/features/collab/index.js +3 -0
- package/dist/features/collab/react.d.ts +7 -0
- package/dist/features/collab/react.js +10 -0
- package/dist/features/collab/react.js.map +1 -0
- package/dist/features/collab/vue.d.ts +6 -0
- package/dist/features/collab/vue.js +37 -0
- package/dist/features/collab/vue.js.map +1 -0
- package/dist/features/comments/comments-plugin.d.ts +71 -0
- package/dist/features/comments/comments-plugin.js +185 -0
- package/dist/features/comments/comments-plugin.js.map +1 -0
- package/dist/features/comments/components/CommentBubble.js +54 -0
- package/dist/features/comments/components/CommentBubble.js.map +1 -0
- package/dist/features/comments/components/CommentBubble.vue.d.ts +14 -0
- package/dist/features/comments/components/CommentComposer.js +87 -0
- package/dist/features/comments/components/CommentComposer.js.map +1 -0
- package/dist/features/comments/components/CommentComposer.vue.d.ts +21 -0
- package/dist/features/comments/components/CommentThreadView.js +255 -0
- package/dist/features/comments/components/CommentThreadView.js.map +1 -0
- package/dist/features/comments/components/CommentThreadView.vue.d.ts +29 -0
- package/dist/features/comments/components/CommentsListMenu.js +134 -0
- package/dist/features/comments/components/CommentsListMenu.js.map +1 -0
- package/dist/features/comments/components/CommentsListMenu.vue.d.ts +10 -0
- package/dist/features/comments/components/CommentsMargin.js +291 -0
- package/dist/features/comments/components/CommentsMargin.js.map +1 -0
- package/dist/features/comments/components/CommentsMargin.vue.d.ts +16 -0
- package/dist/features/comments/components/CommentsOverlay.js +39 -0
- package/dist/features/comments/components/CommentsOverlay.js.map +1 -0
- package/dist/features/comments/components/CommentsPopover.js +124 -0
- package/dist/features/comments/components/CommentsPopover.js.map +1 -0
- package/dist/features/comments/components/CommentsPopover.vue.d.ts +10 -0
- package/dist/features/comments/components/CommentsToolbarButton.js +61 -0
- package/dist/features/comments/components/CommentsToolbarButton.js.map +1 -0
- package/dist/features/comments/components/SettingsCommentsTab.js +46 -0
- package/dist/features/comments/components/SettingsCommentsTab.js.map +1 -0
- package/dist/features/comments/components/SettingsCommentsTab.vue.d.ts +6 -0
- package/dist/features/comments/feature.d.ts +39 -0
- package/dist/features/comments/feature.js +128 -0
- package/dist/features/comments/feature.js.map +1 -0
- package/dist/features/comments/index.d.ts +6 -0
- package/dist/features/comments/index.js +6 -0
- package/dist/features/comments/model.d.ts +87 -0
- package/dist/features/comments/model.js +390 -0
- package/dist/features/comments/model.js.map +1 -0
- package/dist/features/comments/react/CommentAvatar.js +24 -0
- package/dist/features/comments/react/CommentAvatar.js.map +1 -0
- package/dist/features/comments/react/CommentBubble.d.ts +11 -0
- package/dist/features/comments/react/CommentBubble.js +43 -0
- package/dist/features/comments/react/CommentBubble.js.map +1 -0
- package/dist/features/comments/react/CommentComposer.d.ts +15 -0
- package/dist/features/comments/react/CommentComposer.js +69 -0
- package/dist/features/comments/react/CommentComposer.js.map +1 -0
- package/dist/features/comments/react/CommentThreadView.d.ts +24 -0
- package/dist/features/comments/react/CommentThreadView.js +249 -0
- package/dist/features/comments/react/CommentThreadView.js.map +1 -0
- package/dist/features/comments/react/CommentsListMenu.d.ts +8 -0
- package/dist/features/comments/react/CommentsListMenu.js +115 -0
- package/dist/features/comments/react/CommentsListMenu.js.map +1 -0
- package/dist/features/comments/react/CommentsMargin.d.ts +16 -0
- package/dist/features/comments/react/CommentsMargin.js +294 -0
- package/dist/features/comments/react/CommentsMargin.js.map +1 -0
- package/dist/features/comments/react/CommentsOverlay.d.ts +11 -0
- package/dist/features/comments/react/CommentsOverlay.js +52 -0
- package/dist/features/comments/react/CommentsOverlay.js.map +1 -0
- package/dist/features/comments/react/CommentsPopover.d.ts +15 -0
- package/dist/features/comments/react/CommentsPopover.js +107 -0
- package/dist/features/comments/react/CommentsPopover.js.map +1 -0
- package/dist/features/comments/react/CommentsToolbarButton.d.ts +12 -0
- package/dist/features/comments/react/CommentsToolbarButton.js +52 -0
- package/dist/features/comments/react/CommentsToolbarButton.js.map +1 -0
- package/dist/features/comments/react/SettingsCommentsTab.d.ts +5 -0
- package/dist/features/comments/react/SettingsCommentsTab.js +77 -0
- package/dist/features/comments/react/SettingsCommentsTab.js.map +1 -0
- package/dist/features/comments/react/use-comments.d.ts +17 -0
- package/dist/features/comments/react/use-comments.js +37 -0
- package/dist/features/comments/react/use-comments.js.map +1 -0
- package/dist/features/comments/react.d.ts +23 -0
- package/dist/features/comments/react.js +28 -0
- package/dist/features/comments/react.js.map +1 -0
- package/dist/features/comments/schema.d.ts +51 -0
- package/dist/features/comments/schema.js +41 -0
- package/dist/features/comments/schema.js.map +1 -0
- package/dist/features/comments/shortcuts.js +34 -0
- package/dist/features/comments/shortcuts.js.map +1 -0
- package/dist/features/comments/use-comments.d.ts +37 -0
- package/dist/features/comments/use-comments.js +45 -0
- package/dist/features/comments/use-comments.js.map +1 -0
- package/dist/features/comments/vue.d.ts +20 -0
- package/dist/features/comments/vue.js +28 -0
- package/dist/features/comments/vue.js.map +1 -0
- package/dist/features/composites/ai-brief.d.ts +31 -0
- package/dist/features/composites/ai-brief.js +56 -0
- package/dist/features/composites/ai-brief.js.map +1 -0
- package/dist/features/composites/anchors.d.ts +47 -0
- package/dist/features/composites/anchors.js +137 -0
- package/dist/features/composites/anchors.js.map +1 -0
- package/dist/features/composites/components/CompositeChrome.js +243 -0
- package/dist/features/composites/components/CompositeChrome.js.map +1 -0
- package/dist/features/composites/components/CompositeChrome.vue.d.ts +19 -0
- package/dist/features/composites/components/CompositeDetails.js +158 -0
- package/dist/features/composites/components/CompositeDetails.js.map +1 -0
- package/dist/features/composites/components/CompositeDetails.vue.d.ts +19 -0
- package/dist/features/composites/components/CompositeFieldEditor.js +114 -0
- package/dist/features/composites/components/CompositeFieldEditor.js.map +1 -0
- package/dist/features/composites/components/CompositeFieldEditor.vue.d.ts +23 -0
- package/dist/features/composites/components/CompositeInspector.js +439 -0
- package/dist/features/composites/components/CompositeInspector.js.map +1 -0
- package/dist/features/composites/components/CompositeInspector.vue.d.ts +32 -0
- package/dist/features/composites/components/CompositeStatusMenu.js +51 -0
- package/dist/features/composites/components/CompositeStatusMenu.js.map +1 -0
- package/dist/features/composites/components/CompositeStatusMenu.vue.d.ts +28 -0
- package/dist/features/composites/components/CompositeSummaryEditor.js +79 -0
- package/dist/features/composites/components/CompositeSummaryEditor.js.map +1 -0
- package/dist/features/composites/components/CompositeSummaryEditor.vue.d.ts +18 -0
- package/dist/features/composites/components/CompositeTable.js +348 -0
- package/dist/features/composites/components/CompositeTable.js.map +1 -0
- package/dist/features/composites/components/CompositeTable.vue.d.ts +15 -0
- package/dist/features/composites/components/CompositeTagsEditor.js +95 -0
- package/dist/features/composites/components/CompositeTagsEditor.js.map +1 -0
- package/dist/features/composites/components/CompositeTagsEditor.vue.d.ts +13 -0
- package/dist/features/composites/components/CompositeView.js +46 -0
- package/dist/features/composites/components/CompositeView.js.map +1 -0
- package/dist/features/composites/components/CompositeView.vue.d.ts +96 -0
- package/dist/features/composites/components/SettingsEditingTab.js +119 -0
- package/dist/features/composites/components/SettingsEditingTab.js.map +1 -0
- package/dist/features/composites/components/SettingsEditingTab.vue.d.ts +11 -0
- package/dist/features/composites/convert.d.ts +24 -0
- package/dist/features/composites/convert.js +145 -0
- package/dist/features/composites/convert.js.map +1 -0
- package/dist/features/composites/editing-settings-keys.js +47 -0
- package/dist/features/composites/editing-settings-keys.js.map +1 -0
- package/dist/features/composites/feature.d.ts +30 -0
- package/dist/features/composites/feature.js +305 -0
- package/dist/features/composites/feature.js.map +1 -0
- package/dist/features/composites/fences.d.ts +20 -0
- package/dist/features/composites/fences.js +86 -0
- package/dist/features/composites/fences.js.map +1 -0
- package/dist/features/composites/heading-composites.d.ts +36 -0
- package/dist/features/composites/heading-composites.js +140 -0
- package/dist/features/composites/heading-composites.js.map +1 -0
- package/dist/features/composites/index.d.ts +20 -0
- package/dist/features/composites/index.js +20 -0
- package/dist/features/composites/kinds.d.ts +49 -0
- package/dist/features/composites/kinds.js +131 -0
- package/dist/features/composites/kinds.js.map +1 -0
- package/dist/features/composites/legacy.d.ts +8 -0
- package/dist/features/composites/legacy.js +25 -0
- package/dist/features/composites/legacy.js.map +1 -0
- package/dist/features/composites/markdown-export.d.ts +17 -0
- package/dist/features/composites/markdown-export.js +49 -0
- package/dist/features/composites/markdown-export.js.map +1 -0
- package/dist/features/composites/meta-display.js +46 -0
- package/dist/features/composites/meta-display.js.map +1 -0
- package/dist/features/composites/node-views.d.ts +17 -0
- package/dist/features/composites/node-views.js +18 -0
- package/dist/features/composites/node-views.js.map +1 -0
- package/dist/features/composites/nodes.d.ts +56 -0
- package/dist/features/composites/nodes.js +480 -0
- package/dist/features/composites/nodes.js.map +1 -0
- package/dist/features/composites/outline.d.ts +35 -0
- package/dist/features/composites/outline.js +69 -0
- package/dist/features/composites/outline.js.map +1 -0
- package/dist/features/composites/react/CompositeChrome.d.ts +16 -0
- package/dist/features/composites/react/CompositeChrome.js +234 -0
- package/dist/features/composites/react/CompositeChrome.js.map +1 -0
- package/dist/features/composites/react/CompositeDetails.d.ts +16 -0
- package/dist/features/composites/react/CompositeDetails.js +149 -0
- package/dist/features/composites/react/CompositeDetails.js.map +1 -0
- package/dist/features/composites/react/CompositeFieldEditor.d.ts +18 -0
- package/dist/features/composites/react/CompositeFieldEditor.js +131 -0
- package/dist/features/composites/react/CompositeFieldEditor.js.map +1 -0
- package/dist/features/composites/react/CompositeInspector.d.ts +23 -0
- package/dist/features/composites/react/CompositeInspector.js +506 -0
- package/dist/features/composites/react/CompositeInspector.js.map +1 -0
- package/dist/features/composites/react/CompositeStatusMenu.d.ts +15 -0
- package/dist/features/composites/react/CompositeStatusMenu.js +36 -0
- package/dist/features/composites/react/CompositeStatusMenu.js.map +1 -0
- package/dist/features/composites/react/CompositeSummaryEditor.d.ts +15 -0
- package/dist/features/composites/react/CompositeSummaryEditor.js +85 -0
- package/dist/features/composites/react/CompositeSummaryEditor.js.map +1 -0
- package/dist/features/composites/react/CompositeTable.d.ts +11 -0
- package/dist/features/composites/react/CompositeTable.js +342 -0
- package/dist/features/composites/react/CompositeTable.js.map +1 -0
- package/dist/features/composites/react/CompositeTagsEditor.d.ts +10 -0
- package/dist/features/composites/react/CompositeTagsEditor.js +122 -0
- package/dist/features/composites/react/CompositeTagsEditor.js.map +1 -0
- package/dist/features/composites/react/CompositeView.d.ts +6 -0
- package/dist/features/composites/react/CompositeView.js +30 -0
- package/dist/features/composites/react/CompositeView.js.map +1 -0
- package/dist/features/composites/react/SettingsEditingTab.d.ts +8 -0
- package/dist/features/composites/react/SettingsEditingTab.js +153 -0
- package/dist/features/composites/react/SettingsEditingTab.js.map +1 -0
- package/dist/features/composites/react/use-composite-anchors.d.ts +17 -0
- package/dist/features/composites/react/use-composite-anchors.js +46 -0
- package/dist/features/composites/react/use-composite-anchors.js.map +1 -0
- package/dist/features/composites/react/use-composite-rows.d.ts +11 -0
- package/dist/features/composites/react/use-composite-rows.js +26 -0
- package/dist/features/composites/react/use-composite-rows.js.map +1 -0
- package/dist/features/composites/react.d.ts +24 -0
- package/dist/features/composites/react.js +30 -0
- package/dist/features/composites/react.js.map +1 -0
- package/dist/features/composites/rows-model.d.ts +38 -0
- package/dist/features/composites/rows-model.js +92 -0
- package/dist/features/composites/rows-model.js.map +1 -0
- package/dist/features/composites/rows.d.ts +76 -0
- package/dist/features/composites/rows.js +159 -0
- package/dist/features/composites/rows.js.map +1 -0
- package/dist/features/composites/schema.d.ts +21 -0
- package/dist/features/composites/schema.js +26 -0
- package/dist/features/composites/schema.js.map +1 -0
- package/dist/features/composites/structure-mode.d.ts +11 -0
- package/dist/features/composites/structure-mode.js +16 -0
- package/dist/features/composites/structure-mode.js.map +1 -0
- package/dist/features/composites/structure.d.ts +19 -0
- package/dist/features/composites/structure.js +19 -0
- package/dist/features/composites/structure.js.map +1 -0
- package/dist/features/composites/table-model.js +117 -0
- package/dist/features/composites/table-model.js.map +1 -0
- package/dist/features/composites/tree-root.d.ts +11 -0
- package/dist/features/composites/tree-root.js +16 -0
- package/dist/features/composites/tree-root.js.map +1 -0
- package/dist/features/composites/use-composite-anchors.d.ts +18 -0
- package/dist/features/composites/use-composite-anchors.js +42 -0
- package/dist/features/composites/use-composite-anchors.js.map +1 -0
- package/dist/features/composites/use-composite-rows.d.ts +25 -0
- package/dist/features/composites/use-composite-rows.js +28 -0
- package/dist/features/composites/use-composite-rows.js.map +1 -0
- package/dist/features/composites/vue.d.ts +23 -0
- package/dist/features/composites/vue.js +30 -0
- package/dist/features/composites/vue.js.map +1 -0
- package/dist/features/media/assets.d.ts +30 -0
- package/dist/features/media/assets.js +26 -0
- package/dist/features/media/assets.js.map +1 -0
- package/dist/features/media/audio-recorder.d.ts +25 -0
- package/dist/features/media/audio-recorder.js +123 -0
- package/dist/features/media/audio-recorder.js.map +1 -0
- package/dist/features/media/components/AudioRecorderModal.js +152 -0
- package/dist/features/media/components/AudioRecorderModal.js.map +1 -0
- package/dist/features/media/components/AudioRecorderModal.vue.d.ts +15 -0
- package/dist/features/media/components/AudioView.js +46 -0
- package/dist/features/media/components/AudioView.js.map +1 -0
- package/dist/features/media/components/FileView.js +73 -0
- package/dist/features/media/components/FileView.js.map +1 -0
- package/dist/features/media/components/VideoView.js +47 -0
- package/dist/features/media/components/VideoView.js.map +1 -0
- package/dist/features/media/feature.d.ts +22 -0
- package/dist/features/media/feature.js +101 -0
- package/dist/features/media/feature.js.map +1 -0
- package/dist/features/media/file-import.d.ts +21 -0
- package/dist/features/media/file-import.js +76 -0
- package/dist/features/media/file-import.js.map +1 -0
- package/dist/features/media/index.d.ts +7 -0
- package/dist/features/media/index.js +7 -0
- package/dist/features/media/node-views.d.ts +28 -0
- package/dist/features/media/node-views.js +28 -0
- package/dist/features/media/node-views.js.map +1 -0
- package/dist/features/media/react/AudioRecorderModal.d.ts +12 -0
- package/dist/features/media/react/AudioRecorderModal.js +147 -0
- package/dist/features/media/react/AudioRecorderModal.js.map +1 -0
- package/dist/features/media/react/AudioView.js +32 -0
- package/dist/features/media/react/AudioView.js.map +1 -0
- package/dist/features/media/react/FileView.js +61 -0
- package/dist/features/media/react/FileView.js.map +1 -0
- package/dist/features/media/react/TitleField.js +30 -0
- package/dist/features/media/react/TitleField.js.map +1 -0
- package/dist/features/media/react/VideoView.js +33 -0
- package/dist/features/media/react/VideoView.js.map +1 -0
- package/dist/features/media/react/use-audio-recorder.d.ts +11 -0
- package/dist/features/media/react/use-audio-recorder.js +21 -0
- package/dist/features/media/react/use-audio-recorder.js.map +1 -0
- package/dist/features/media/react.d.ts +19 -0
- package/dist/features/media/react.js +37 -0
- package/dist/features/media/react.js.map +1 -0
- package/dist/features/media/schema.d.ts +59 -0
- package/dist/features/media/schema.js +194 -0
- package/dist/features/media/schema.js.map +1 -0
- package/dist/features/media/upload.d.ts +41 -0
- package/dist/features/media/upload.js +106 -0
- package/dist/features/media/upload.js.map +1 -0
- package/dist/features/media/use-audio-recorder.d.ts +12 -0
- package/dist/features/media/use-audio-recorder.js +21 -0
- package/dist/features/media/use-audio-recorder.js.map +1 -0
- package/dist/features/media/vue.d.ts +19 -0
- package/dist/features/media/vue.js +35 -0
- package/dist/features/media/vue.js.map +1 -0
- package/dist/features/mentions/index.d.ts +22 -0
- package/dist/features/mentions/index.js +34 -0
- package/dist/features/mentions/index.js.map +1 -0
- package/dist/features/mentions/mention-suggestion.d.ts +11 -0
- package/dist/features/mentions/mention-suggestion.js +34 -0
- package/dist/features/mentions/mention-suggestion.js.map +1 -0
- package/dist/features/mentions/mention-text.d.ts +18 -0
- package/dist/features/mentions/mention-text.js +75 -0
- package/dist/features/mentions/mention-text.js.map +1 -0
- package/dist/features/mentions/mention.d.ts +20 -0
- package/dist/features/mentions/mention.js +33 -0
- package/dist/features/mentions/mention.js.map +1 -0
- package/dist/features/mentions/metadata-defaults.d.ts +8 -0
- package/dist/features/mentions/metadata-defaults.js +30 -0
- package/dist/features/mentions/metadata-defaults.js.map +1 -0
- package/dist/features/mentions/normalize.d.ts +10 -0
- package/dist/features/mentions/normalize.js +31 -0
- package/dist/features/mentions/normalize.js.map +1 -0
- package/dist/features/mentions/schema.d.ts +10 -0
- package/dist/features/mentions/schema.js +10 -0
- package/dist/features/mentions/schema.js.map +1 -0
- package/dist/features/mentions/tag-suggestion.d.ts +11 -0
- package/dist/features/mentions/tag-suggestion.js +45 -0
- package/dist/features/mentions/tag-suggestion.js.map +1 -0
- package/dist/features/mentions/tag.d.ts +43 -0
- package/dist/features/mentions/tag.js +155 -0
- package/dist/features/mentions/tag.js.map +1 -0
- package/dist/features/tables/feature.d.ts +14 -0
- package/dist/features/tables/feature.js +100 -0
- package/dist/features/tables/feature.js.map +1 -0
- package/dist/features/tables/index.d.ts +3 -0
- package/dist/features/tables/index.js +3 -0
- package/dist/features/tables/schema.d.ts +6 -0
- package/dist/features/tables/schema.js +27 -0
- package/dist/features/tables/schema.js.map +1 -0
- package/dist/features/themes/components/SettingsAppearanceTab.js +227 -0
- package/dist/features/themes/components/SettingsAppearanceTab.js.map +1 -0
- package/dist/features/themes/components/SettingsAppearanceTab.vue.d.ts +6 -0
- package/dist/features/themes/feature.d.ts +24 -0
- package/dist/features/themes/feature.js +25 -0
- package/dist/features/themes/feature.js.map +1 -0
- package/dist/features/themes/index.d.ts +6 -0
- package/dist/features/themes/index.js +6 -0
- package/dist/features/themes/react/SettingsAppearanceTab.d.ts +5 -0
- package/dist/features/themes/react/SettingsAppearanceTab.js +221 -0
- package/dist/features/themes/react/SettingsAppearanceTab.js.map +1 -0
- package/dist/features/themes/react.d.ts +13 -0
- package/dist/features/themes/react.js +15 -0
- package/dist/features/themes/react.js.map +1 -0
- package/dist/features/themes/schema.d.ts +21 -0
- package/dist/features/themes/schema.js +16 -0
- package/dist/features/themes/schema.js.map +1 -0
- package/dist/features/themes/scope-css.d.ts +5 -0
- package/dist/features/themes/scope-css.js +142 -0
- package/dist/features/themes/scope-css.js.map +1 -0
- package/dist/features/themes/theme-runtime.d.ts +14 -0
- package/dist/features/themes/theme-runtime.js +147 -0
- package/dist/features/themes/theme-runtime.js.map +1 -0
- package/dist/features/themes/vue.d.ts +13 -0
- package/dist/features/themes/vue.js +29 -0
- package/dist/features/themes/vue.js.map +1 -0
- package/dist/features/transcript/TranscriptSegmentView.js +169 -0
- package/dist/features/transcript/TranscriptSegmentView.js.map +1 -0
- package/dist/features/transcript/TranscriptSegmentView.vue.d.ts +96 -0
- package/dist/features/transcript/convert.d.ts +11 -0
- package/dist/features/transcript/convert.js +40 -0
- package/dist/features/transcript/convert.js.map +1 -0
- package/dist/features/transcript/feature.d.ts +25 -0
- package/dist/features/transcript/feature.js +59 -0
- package/dist/features/transcript/feature.js.map +1 -0
- package/dist/features/transcript/index.d.ts +7 -0
- package/dist/features/transcript/index.js +7 -0
- package/dist/features/transcript/react/TranscriptSegmentView.d.ts +6 -0
- package/dist/features/transcript/react/TranscriptSegmentView.js +155 -0
- package/dist/features/transcript/react/TranscriptSegmentView.js.map +1 -0
- package/dist/features/transcript/react.d.ts +9 -0
- package/dist/features/transcript/react.js +12 -0
- package/dist/features/transcript/react.js.map +1 -0
- package/dist/features/transcript/schema.d.ts +9 -0
- package/dist/features/transcript/schema.js +9 -0
- package/dist/features/transcript/schema.js.map +1 -0
- package/dist/features/transcript/segment-node.d.ts +21 -0
- package/dist/features/transcript/segment-node.js +113 -0
- package/dist/features/transcript/segment-node.js.map +1 -0
- package/dist/features/transcript/segment.d.ts +10 -0
- package/dist/features/transcript/segment.js +26 -0
- package/dist/features/transcript/segment.js.map +1 -0
- package/dist/features/transcript/speakers.d.ts +8 -0
- package/dist/features/transcript/speakers.js +22 -0
- package/dist/features/transcript/speakers.js.map +1 -0
- package/dist/features/transcript/vue.d.ts +8 -0
- package/dist/features/transcript/vue.js +12 -0
- package/dist/features/transcript/vue.js.map +1 -0
- package/dist/i18n/de/ai.js +168 -0
- package/dist/i18n/de/ai.js.map +1 -0
- package/dist/i18n/de/authors.js +21 -0
- package/dist/i18n/de/authors.js.map +1 -0
- package/dist/i18n/de/block.js +16 -0
- package/dist/i18n/de/block.js.map +1 -0
- package/dist/i18n/de/comments.js +35 -0
- package/dist/i18n/de/comments.js.map +1 -0
- package/dist/i18n/de/common.js +11 -0
- package/dist/i18n/de/common.js.map +1 -0
- package/dist/i18n/de/composites.js +147 -0
- package/dist/i18n/de/composites.js.map +1 -0
- package/dist/i18n/de/integrations.js +42 -0
- package/dist/i18n/de/integrations.js.map +1 -0
- package/dist/i18n/de/markdown.js +16 -0
- package/dist/i18n/de/markdown.js.map +1 -0
- package/dist/i18n/de/media.js +27 -0
- package/dist/i18n/de/media.js.map +1 -0
- package/dist/i18n/de/mentions.js +10 -0
- package/dist/i18n/de/mentions.js.map +1 -0
- package/dist/i18n/de/outline.js +9 -0
- package/dist/i18n/de/outline.js.map +1 -0
- package/dist/i18n/de/settings.js +12 -0
- package/dist/i18n/de/settings.js.map +1 -0
- package/dist/i18n/de/tables.js +15 -0
- package/dist/i18n/de/tables.js.map +1 -0
- package/dist/i18n/de/themes.js +26 -0
- package/dist/i18n/de/themes.js.map +1 -0
- package/dist/i18n/de/toolbar.js +22 -0
- package/dist/i18n/de/toolbar.js.map +1 -0
- package/dist/i18n/de/transcript.js +10 -0
- package/dist/i18n/de/transcript.js.map +1 -0
- package/dist/i18n/de/tree.js +31 -0
- package/dist/i18n/de/tree.js.map +1 -0
- package/dist/i18n/de.d.ts +503 -0
- package/dist/i18n/de.js +42 -0
- package/dist/i18n/de.js.map +1 -0
- package/dist/i18n/en/ai.js +168 -0
- package/dist/i18n/en/ai.js.map +1 -0
- package/dist/i18n/en/authors.js +21 -0
- package/dist/i18n/en/authors.js.map +1 -0
- package/dist/i18n/en/block.js +16 -0
- package/dist/i18n/en/block.js.map +1 -0
- package/dist/i18n/en/comments.js +35 -0
- package/dist/i18n/en/comments.js.map +1 -0
- package/dist/i18n/en/common.js +11 -0
- package/dist/i18n/en/common.js.map +1 -0
- package/dist/i18n/en/composites.js +145 -0
- package/dist/i18n/en/composites.js.map +1 -0
- package/dist/i18n/en/integrations.js +42 -0
- package/dist/i18n/en/integrations.js.map +1 -0
- package/dist/i18n/en/markdown.js +16 -0
- package/dist/i18n/en/markdown.js.map +1 -0
- package/dist/i18n/en/media.js +27 -0
- package/dist/i18n/en/media.js.map +1 -0
- package/dist/i18n/en/mentions.js +10 -0
- package/dist/i18n/en/mentions.js.map +1 -0
- package/dist/i18n/en/outline.js +9 -0
- package/dist/i18n/en/outline.js.map +1 -0
- package/dist/i18n/en/settings.js +12 -0
- package/dist/i18n/en/settings.js.map +1 -0
- package/dist/i18n/en/tables.js +15 -0
- package/dist/i18n/en/tables.js.map +1 -0
- package/dist/i18n/en/themes.js +26 -0
- package/dist/i18n/en/themes.js.map +1 -0
- package/dist/i18n/en/toolbar.js +22 -0
- package/dist/i18n/en/toolbar.js.map +1 -0
- package/dist/i18n/en/transcript.js +10 -0
- package/dist/i18n/en/transcript.js.map +1 -0
- package/dist/i18n/en/tree.js +31 -0
- package/dist/i18n/en/tree.js.map +1 -0
- package/dist/i18n/en.js +42 -0
- package/dist/i18n/en.js.map +1 -0
- package/dist/i18n/index.d.ts +24 -0
- package/dist/i18n/index.js +31 -0
- package/dist/i18n/index.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +0 -0
- package/dist/integrations/composite-ai/composite-fill.d.ts +17 -0
- package/dist/integrations/composite-ai/composite-fill.js +129 -0
- package/dist/integrations/composite-ai/composite-fill.js.map +1 -0
- package/dist/integrations/composite-ai/composite-summary.d.ts +28 -0
- package/dist/integrations/composite-ai/composite-summary.js +143 -0
- package/dist/integrations/composite-ai/composite-summary.js.map +1 -0
- package/dist/integrations/composite-ai/document-transcribe.d.ts +14 -0
- package/dist/integrations/composite-ai/document-transcribe.js +89 -0
- package/dist/integrations/composite-ai/document-transcribe.js.map +1 -0
- package/dist/integrations/composite-ai/index.d.ts +22 -0
- package/dist/integrations/composite-ai/index.js +80 -0
- package/dist/integrations/composite-ai/index.js.map +1 -0
- package/dist/integrations/composite-media/index.d.ts +19 -0
- package/dist/integrations/composite-media/index.js +72 -0
- package/dist/integrations/composite-media/index.js.map +1 -0
- package/dist/integrations/transcript-ai/index.d.ts +16 -0
- package/dist/integrations/transcript-ai/index.js +63 -0
- package/dist/integrations/transcript-ai/index.js.map +1 -0
- package/dist/integrations/transcript-ai/protocol.d.ts +68 -0
- package/dist/integrations/transcript-ai/protocol.js +132 -0
- package/dist/integrations/transcript-ai/protocol.js.map +1 -0
- package/dist/integrations/transcript-ai/transcript-cleanup.d.ts +35 -0
- package/dist/integrations/transcript-ai/transcript-cleanup.js +169 -0
- package/dist/integrations/transcript-ai/transcript-cleanup.js.map +1 -0
- package/dist/markdown/MarkdownSurface.d.ts +25 -0
- package/dist/markdown/MarkdownSurface.js +93 -0
- package/dist/markdown/MarkdownSurface.js.map +1 -0
- package/dist/markdown/MarkdownSurface.vue.d.ts +76 -0
- package/dist/markdown/MarkdownSurface2.js +237 -0
- package/dist/markdown/MarkdownSurface2.js.map +1 -0
- package/dist/markdown/clipboard.d.ts +17 -0
- package/dist/markdown/clipboard.js +125 -0
- package/dist/markdown/clipboard.js.map +1 -0
- package/dist/markdown/document.d.ts +36 -0
- package/dist/markdown/document.js +100 -0
- package/dist/markdown/document.js.map +1 -0
- package/dist/markdown/frontmatter.d.ts +18 -0
- package/dist/markdown/frontmatter.js +32 -0
- package/dist/markdown/frontmatter.js.map +1 -0
- package/dist/markdown/index.d.ts +6 -0
- package/dist/markdown/index.js +6 -0
- package/dist/markdown/policy.d.ts +34 -0
- package/dist/markdown/policy.js +78 -0
- package/dist/markdown/policy.js.map +1 -0
- package/dist/markdown/react.d.ts +2 -0
- package/dist/markdown/react.js +1 -0
- package/dist/markdown/source-mode.d.ts +49 -0
- package/dist/markdown/source-mode.js +86 -0
- package/dist/markdown/source-mode.js.map +1 -0
- package/dist/markdown/vue.d.ts +2 -0
- package/dist/markdown/vue.js +1 -0
- package/dist/nuxt/module.d.ts +68 -0
- package/dist/nuxt/module.js +103 -0
- package/dist/nuxt/module.js.map +1 -0
- package/dist/nuxt/runtime/install-context.d.ts +17 -0
- package/dist/nuxt/runtime/install-context.js +26 -0
- package/dist/nuxt/runtime/install-context.js.map +1 -0
- package/dist/nuxt/runtime/plugins/editor-context-nuxt-ui.client.ts +8 -0
- package/dist/nuxt/runtime/plugins/editor-context-primevue.client.ts +8 -0
- package/dist/nuxt/runtime/server/api/ai/chat.post.d.ts +5 -0
- package/dist/nuxt/runtime/server/api/ai/chat.post.js +8 -0
- package/dist/nuxt/runtime/server/api/ai/chat.post.js.map +1 -0
- package/dist/nuxt/runtime/server/api/ai/complete.post.d.ts +5 -0
- package/dist/nuxt/runtime/server/api/ai/complete.post.js +8 -0
- package/dist/nuxt/runtime/server/api/ai/complete.post.js.map +1 -0
- package/dist/nuxt/runtime/server/api/ai/generate.post.d.ts +5 -0
- package/dist/nuxt/runtime/server/api/ai/generate.post.js +8 -0
- package/dist/nuxt/runtime/server/api/ai/generate.post.js.map +1 -0
- package/dist/nuxt/runtime/server/api/ai/models.get.d.ts +5 -0
- package/dist/nuxt/runtime/server/api/ai/models.get.js +8 -0
- package/dist/nuxt/runtime/server/api/ai/models.get.js.map +1 -0
- package/dist/nuxt/runtime/server/api/ai/transcribe.post.d.ts +5 -0
- package/dist/nuxt/runtime/server/api/ai/transcribe.post.js +8 -0
- package/dist/nuxt/runtime/server/api/ai/transcribe.post.js.map +1 -0
- package/dist/nuxt/runtime/server/api/ai/transcript-cleanup.post.d.ts +5 -0
- package/dist/nuxt/runtime/server/api/ai/transcript-cleanup.post.js +8 -0
- package/dist/nuxt/runtime/server/api/ai/transcript-cleanup.post.js.map +1 -0
- package/dist/nuxt/runtime/server/api/editor/assets/[id]/[name].get.d.ts +5 -0
- package/dist/nuxt/runtime/server/api/editor/assets/[id]/[name].get.js +8 -0
- package/dist/nuxt/runtime/server/api/editor/assets/[id]/[name].get.js.map +1 -0
- package/dist/nuxt/runtime/server/api/editor/assets/[id].post.d.ts +5 -0
- package/dist/nuxt/runtime/server/api/editor/assets/[id].post.js +8 -0
- package/dist/nuxt/runtime/server/api/editor/assets/[id].post.js.map +1 -0
- package/dist/nuxt/runtime/server/api/editor/settings.get.d.ts +5 -0
- package/dist/nuxt/runtime/server/api/editor/settings.get.js +8 -0
- package/dist/nuxt/runtime/server/api/editor/settings.get.js.map +1 -0
- package/dist/nuxt/runtime/server/api/editor/settings.put.d.ts +5 -0
- package/dist/nuxt/runtime/server/api/editor/settings.put.js +8 -0
- package/dist/nuxt/runtime/server/api/editor/settings.put.js.map +1 -0
- package/dist/nuxt/runtime/server/api/editor/tags.get.d.ts +5 -0
- package/dist/nuxt/runtime/server/api/editor/tags.get.js +8 -0
- package/dist/nuxt/runtime/server/api/editor/tags.get.js.map +1 -0
- package/dist/nuxt/runtime/server/api/editor/themes/[id].delete.d.ts +5 -0
- package/dist/nuxt/runtime/server/api/editor/themes/[id].delete.js +8 -0
- package/dist/nuxt/runtime/server/api/editor/themes/[id].delete.js.map +1 -0
- package/dist/nuxt/runtime/server/api/editor/themes/[id].get.d.ts +5 -0
- package/dist/nuxt/runtime/server/api/editor/themes/[id].get.js +8 -0
- package/dist/nuxt/runtime/server/api/editor/themes/[id].get.js.map +1 -0
- package/dist/nuxt/runtime/server/api/editor/themes/index.get.d.ts +5 -0
- package/dist/nuxt/runtime/server/api/editor/themes/index.get.js +8 -0
- package/dist/nuxt/runtime/server/api/editor/themes/index.get.js.map +1 -0
- package/dist/nuxt/runtime/server/api/editor/themes/index.post.d.ts +5 -0
- package/dist/nuxt/runtime/server/api/editor/themes/index.post.js +8 -0
- package/dist/nuxt/runtime/server/api/editor/themes/index.post.js.map +1 -0
- package/dist/nuxt/runtime/server/api/editor/users.get.d.ts +5 -0
- package/dist/nuxt/runtime/server/api/editor/users.get.js +8 -0
- package/dist/nuxt/runtime/server/api/editor/users.get.js.map +1 -0
- package/dist/nuxt/runtime/server/plugins/collab.d.ts +5 -0
- package/dist/nuxt/runtime/server/plugins/collab.js +10 -0
- package/dist/nuxt/runtime/server/plugins/collab.js.map +1 -0
- package/dist/nuxt/runtime/server/plugins/editor-server.d.ts +5 -0
- package/dist/nuxt/runtime/server/plugins/editor-server.js +20 -0
- package/dist/nuxt/runtime/server/plugins/editor-server.js.map +1 -0
- package/dist/nuxt/runtime/server/routes/collab/[id].d.ts +5 -0
- package/dist/nuxt/runtime/server/routes/collab/[id].js +35 -0
- package/dist/nuxt/runtime/server/routes/collab/[id].js.map +1 -0
- package/dist/nuxt/runtime/server/utils/editor-route.d.ts +11 -0
- package/dist/nuxt/runtime/server/utils/editor-route.js +49 -0
- package/dist/nuxt/runtime/server/utils/editor-route.js.map +1 -0
- package/dist/outline/EditorOutline.js +124 -0
- package/dist/outline/EditorOutline.js.map +1 -0
- package/dist/outline/EditorOutline.vue.d.ts +15 -0
- package/dist/outline/heading-outline.d.ts +26 -0
- package/dist/outline/heading-outline.js +46 -0
- package/dist/outline/heading-outline.js.map +1 -0
- package/dist/outline/index.d.ts +2 -0
- package/dist/outline/index.js +1 -0
- package/dist/outline/react/EditorOutline.d.ts +12 -0
- package/dist/outline/react/EditorOutline.js +112 -0
- package/dist/outline/react/EditorOutline.js.map +1 -0
- package/dist/outline/react.d.ts +2 -0
- package/dist/outline/react.js +1 -0
- package/dist/outline/vue.d.ts +2 -0
- package/dist/outline/vue.js +1 -0
- package/dist/presets/advanced.d.ts +33 -0
- package/dist/presets/advanced.js +50 -0
- package/dist/presets/advanced.js.map +1 -0
- package/dist/presets/simple.d.ts +9 -0
- package/dist/presets/simple.js +12 -0
- package/dist/presets/simple.js.map +1 -0
- package/dist/react/AdvancedEditor.d.ts +23 -0
- package/dist/react/AdvancedEditor.js +24 -0
- package/dist/react/AdvancedEditor.js.map +1 -0
- package/dist/react/EditorSettingsModal.d.ts +14 -0
- package/dist/react/EditorSettingsModal.js +40 -0
- package/dist/react/EditorSettingsModal.js.map +1 -0
- package/dist/react/EditorSettingsPanel.d.ts +18 -0
- package/dist/react/EditorSettingsPanel.js +40 -0
- package/dist/react/EditorSettingsPanel.js.map +1 -0
- package/dist/react/EditorSurface.d.ts +61 -0
- package/dist/react/EditorSurface.js +277 -0
- package/dist/react/EditorSurface.js.map +1 -0
- package/dist/react/EditorToolbar.d.ts +15 -0
- package/dist/react/EditorToolbar.js +182 -0
- package/dist/react/EditorToolbar.js.map +1 -0
- package/dist/react/Icon.d.ts +13 -0
- package/dist/react/Icon.js +19 -0
- package/dist/react/Icon.js.map +1 -0
- package/dist/react/SettingsSection.d.ts +10 -0
- package/dist/react/SettingsSection.js +22 -0
- package/dist/react/SettingsSection.js.map +1 -0
- package/dist/react/SimpleEditor.d.ts +27 -0
- package/dist/react/SimpleEditor.js +22 -0
- package/dist/react/SimpleEditor.js.map +1 -0
- package/dist/react/advanced-preset.d.ts +11 -0
- package/dist/react/advanced-preset.js +31 -0
- package/dist/react/advanced-preset.js.map +1 -0
- package/dist/react/advanced.d.ts +4 -0
- package/dist/react/advanced.js +3 -0
- package/dist/react/context.d.ts +12 -0
- package/dist/react/context.js +21 -0
- package/dist/react/context.js.map +1 -0
- package/dist/react/editor-ui.d.ts +14 -0
- package/dist/react/editor-ui.js +20 -0
- package/dist/react/editor-ui.js.map +1 -0
- package/dist/react/index.d.ts +17 -0
- package/dist/react/index.js +17 -0
- package/dist/react/notify.d.ts +6 -0
- package/dist/react/notify.js +25 -0
- package/dist/react/notify.js.map +1 -0
- package/dist/react/settings.d.ts +17 -0
- package/dist/react/settings.js +27 -0
- package/dist/react/settings.js.map +1 -0
- package/dist/react/simple.d.ts +2 -0
- package/dist/react/simple.js +1 -0
- package/dist/react/styles/advanced.css +18 -0
- package/dist/react/styles/themes-bridge.css +26 -0
- package/dist/react/styles/ui-vars.css +20 -0
- package/dist/react/suggestion-renderer.d.ts +12 -0
- package/dist/react/suggestion-renderer.js +90 -0
- package/dist/react/suggestion-renderer.js.map +1 -0
- package/dist/react/ui/alert.js +38 -0
- package/dist/react/ui/alert.js.map +1 -0
- package/dist/react/ui/avatar.js +24 -0
- package/dist/react/ui/avatar.js.map +1 -0
- package/dist/react/ui/badge.js +30 -0
- package/dist/react/ui/badge.js.map +1 -0
- package/dist/react/ui/button.js +50 -0
- package/dist/react/ui/button.js.map +1 -0
- package/dist/react/ui/collapsible.js +19 -0
- package/dist/react/ui/collapsible.js.map +1 -0
- package/dist/react/ui/command.js +47 -0
- package/dist/react/ui/command.js.map +1 -0
- package/dist/react/ui/dialog.js +88 -0
- package/dist/react/ui/dialog.js.map +1 -0
- package/dist/react/ui/dropdown-menu.js +70 -0
- package/dist/react/ui/dropdown-menu.js.map +1 -0
- package/dist/react/ui/input-group.js +57 -0
- package/dist/react/ui/input-group.js.map +1 -0
- package/dist/react/ui/input.js +16 -0
- package/dist/react/ui/input.js.map +1 -0
- package/dist/react/ui/label.js +17 -0
- package/dist/react/ui/label.js.map +1 -0
- package/dist/react/ui/popover.js +36 -0
- package/dist/react/ui/popover.js.map +1 -0
- package/dist/react/ui/radio-group.js +29 -0
- package/dist/react/ui/radio-group.js.map +1 -0
- package/dist/react/ui/select.js +88 -0
- package/dist/react/ui/select.js.map +1 -0
- package/dist/react/ui/separator.js +18 -0
- package/dist/react/ui/separator.js.map +1 -0
- package/dist/react/ui/switch.js +21 -0
- package/dist/react/ui/switch.js.map +1 -0
- package/dist/react/ui/table.js +44 -0
- package/dist/react/ui/table.js.map +1 -0
- package/dist/react/ui/tabs.js +41 -0
- package/dist/react/ui/tabs.js.map +1 -0
- package/dist/react/ui/textarea.js +15 -0
- package/dist/react/ui/textarea.js.map +1 -0
- package/dist/react/ui/tooltip.js +37 -0
- package/dist/react/ui/tooltip.js.map +1 -0
- package/dist/react/ui/utils.d.ts +5 -0
- package/dist/react/ui/utils.js +10 -0
- package/dist/react/ui/utils.js.map +1 -0
- package/dist/react/use-editor-i18n.d.ts +12 -0
- package/dist/react/use-editor-i18n.js +17 -0
- package/dist/react/use-editor-i18n.js.map +1 -0
- package/dist/react/use-notifier.d.ts +11 -0
- package/dist/react/use-notifier.js +25 -0
- package/dist/react/use-notifier.js.map +1 -0
- package/dist/react/use-store.d.ts +6 -0
- package/dist/react/use-store.js +10 -0
- package/dist/react/use-store.js.map +1 -0
- package/dist/schema/advanced.d.ts +14 -0
- package/dist/schema/advanced.js +43 -0
- package/dist/schema/advanced.js.map +1 -0
- package/dist/schema/simple.d.ts +10 -0
- package/dist/schema/simple.js +13 -0
- package/dist/schema/simple.js.map +1 -0
- package/dist/server/adapter.d.ts +101 -0
- package/dist/server/ai.d.ts +101 -0
- package/dist/server/ai.js +105 -0
- package/dist/server/ai.js.map +1 -0
- package/dist/server/collab-state.d.ts +16 -0
- package/dist/server/collab-state.js +43 -0
- package/dist/server/collab-state.js.map +1 -0
- package/dist/server/collab.d.ts +68 -0
- package/dist/server/collab.js +187 -0
- package/dist/server/collab.js.map +1 -0
- package/dist/server/errors.d.ts +17 -0
- package/dist/server/errors.js +26 -0
- package/dist/server/errors.js.map +1 -0
- package/dist/server/handlers/ai.d.ts +223 -0
- package/dist/server/handlers/ai.js +422 -0
- package/dist/server/handlers/ai.js.map +1 -0
- package/dist/server/handlers/context.d.ts +64 -0
- package/dist/server/handlers/context.js +85 -0
- package/dist/server/handlers/context.js.map +1 -0
- package/dist/server/handlers/editor.d.ts +107 -0
- package/dist/server/handlers/editor.js +241 -0
- package/dist/server/handlers/editor.js.map +1 -0
- package/dist/server/handlers/index.d.ts +4 -0
- package/dist/server/handlers/index.js +4 -0
- package/dist/server/host.d.ts +61 -0
- package/dist/server/host.js +105 -0
- package/dist/server/host.js.map +1 -0
- package/dist/server/index.d.ts +8 -0
- package/dist/server/index.js +7 -0
- package/dist/server/node.d.ts +24 -0
- package/dist/server/node.js +54 -0
- package/dist/server/node.js.map +1 -0
- package/dist/server/rate-limit.d.ts +22 -0
- package/dist/server/rate-limit.js +34 -0
- package/dist/server/rate-limit.js.map +1 -0
- package/dist/settings/index.d.ts +110 -0
- package/dist/settings/index.js +114 -0
- package/dist/settings/index.js.map +1 -0
- package/dist/settings/values.d.ts +35 -0
- package/dist/settings/values.js +41 -0
- package/dist/settings/values.js.map +1 -0
- package/dist/styles/ai.css +77 -0
- package/dist/styles/authors.css +18 -0
- package/dist/styles/block-ui.css +16 -0
- package/dist/styles/collab.css +26 -0
- package/dist/styles/comments.css +11 -0
- package/dist/styles/composites.css +56 -0
- package/dist/styles/core.css +99 -0
- package/dist/styles/media.css +8 -0
- package/dist/styles/mentions.css +24 -0
- package/dist/styles/tables.css +25 -0
- package/dist/styles/themes.css +622 -0
- package/dist/styles/tokens.css +29 -0
- package/dist/styles/transcript.css +13 -0
- package/dist/tree/DocumentTree.js +595 -0
- package/dist/tree/DocumentTree.js.map +1 -0
- package/dist/tree/DocumentTree.vue.d.ts +36 -0
- package/dist/tree/folder-paths.js +11 -0
- package/dist/tree/folder-paths.js.map +1 -0
- package/dist/tree/index.d.ts +4 -0
- package/dist/tree/index.js +1 -0
- package/dist/tree/react/DocumentTree.d.ts +24 -0
- package/dist/tree/react/DocumentTree.js +579 -0
- package/dist/tree/react/DocumentTree.js.map +1 -0
- package/dist/tree/react/use-tree-view.d.ts +14 -0
- package/dist/tree/react/use-tree-view.js +21 -0
- package/dist/tree/react/use-tree-view.js.map +1 -0
- package/dist/tree/react.d.ts +3 -0
- package/dist/tree/react.js +3 -0
- package/dist/tree/store.d.ts +45 -0
- package/dist/tree/tree-items.js +221 -0
- package/dist/tree/tree-items.js.map +1 -0
- package/dist/tree/tree-view-model.d.ts +29 -0
- package/dist/tree/tree-view-model.js +71 -0
- package/dist/tree/tree-view-model.js.map +1 -0
- package/dist/tree/tree-view.d.ts +15 -0
- package/dist/tree/tree-view.js +21 -0
- package/dist/tree/tree-view.js.map +1 -0
- package/dist/tree/types.d.ts +23 -0
- package/dist/tree/types.js +0 -0
- package/dist/tree/vue.d.ts +3 -0
- package/dist/tree/vue.js +3 -0
- package/dist/vue/AdvancedEditor.js +100 -0
- package/dist/vue/AdvancedEditor.js.map +1 -0
- package/dist/vue/AdvancedEditor.vue.d.ts +71 -0
- package/dist/vue/SimpleEditor.js +61 -0
- package/dist/vue/SimpleEditor.js.map +1 -0
- package/dist/vue/SimpleEditor.vue.d.ts +36 -0
- package/dist/vue/advanced-preset.d.ts +13 -0
- package/dist/vue/advanced-preset.js +33 -0
- package/dist/vue/advanced-preset.js.map +1 -0
- package/dist/vue/advanced.d.ts +3 -0
- package/dist/vue/advanced.js +3 -0
- package/dist/vue/components/EditorSettingsModal.js +69 -0
- package/dist/vue/components/EditorSettingsModal.js.map +1 -0
- package/dist/vue/components/EditorSettingsModal.vue.d.ts +24 -0
- package/dist/vue/components/EditorSettingsPanel.js +58 -0
- package/dist/vue/components/EditorSettingsPanel.js.map +1 -0
- package/dist/vue/components/EditorSettingsPanel.vue.d.ts +29 -0
- package/dist/vue/components/EditorSurface.js +229 -0
- package/dist/vue/components/EditorSurface.js.map +1 -0
- package/dist/vue/components/EditorSurface.vue.d.ts +68 -0
- package/dist/vue/components/EditorToolbar.js +189 -0
- package/dist/vue/components/EditorToolbar.js.map +1 -0
- package/dist/vue/components/EditorToolbar.vue.d.ts +17 -0
- package/dist/vue/components/SettingsSection.js +26 -0
- package/dist/vue/components/SettingsSection.js.map +1 -0
- package/dist/vue/components/SettingsSection.vue.d.ts +21 -0
- package/dist/vue/components/SuggestionList.js +91 -0
- package/dist/vue/components/SuggestionList.js.map +1 -0
- package/dist/vue/components/SuggestionList.vue.d.ts +19 -0
- package/dist/vue/context.d.ts +24 -0
- package/dist/vue/context.js +41 -0
- package/dist/vue/context.js.map +1 -0
- package/dist/vue/index.d.ts +26 -0
- package/dist/vue/index.js +16 -0
- package/dist/vue/kit/index.d.ts +3 -0
- package/dist/vue/kit/index.js +1 -0
- package/dist/vue/kit/nuxt-ui.css +24 -0
- package/dist/vue/kit/nuxt-ui.d.ts +31 -0
- package/dist/vue/kit/nuxt-ui.js +101 -0
- package/dist/vue/kit/nuxt-ui.js.map +1 -0
- package/dist/vue/kit/primevue/Alert.js +49 -0
- package/dist/vue/kit/primevue/Alert.js.map +1 -0
- package/dist/vue/kit/primevue/Avatar.js +54 -0
- package/dist/vue/kit/primevue/Avatar.js.map +1 -0
- package/dist/vue/kit/primevue/Badge.js +41 -0
- package/dist/vue/kit/primevue/Badge.js.map +1 -0
- package/dist/vue/kit/primevue/Button.js +112 -0
- package/dist/vue/kit/primevue/Button.js.map +1 -0
- package/dist/vue/kit/primevue/Chip.js +38 -0
- package/dist/vue/kit/primevue/Chip.js.map +1 -0
- package/dist/vue/kit/primevue/DropdownMenu.js +98 -0
- package/dist/vue/kit/primevue/DropdownMenu.js.map +1 -0
- package/dist/vue/kit/primevue/FieldGroup.js +22 -0
- package/dist/vue/kit/primevue/FieldGroup.js.map +1 -0
- package/dist/vue/kit/primevue/FormField.js +56 -0
- package/dist/vue/kit/primevue/FormField.js.map +1 -0
- package/dist/vue/kit/primevue/Icon.js +23 -0
- package/dist/vue/kit/primevue/Icon.js.map +1 -0
- package/dist/vue/kit/primevue/Input.js +96 -0
- package/dist/vue/kit/primevue/Input.js.map +1 -0
- package/dist/vue/kit/primevue/InputMenu.js +122 -0
- package/dist/vue/kit/primevue/InputMenu.js.map +1 -0
- package/dist/vue/kit/primevue/Modal.js +59 -0
- package/dist/vue/kit/primevue/Modal.js.map +1 -0
- package/dist/vue/kit/primevue/Popover.js +135 -0
- package/dist/vue/kit/primevue/Popover.js.map +1 -0
- package/dist/vue/kit/primevue/RadioGroup.js +58 -0
- package/dist/vue/kit/primevue/RadioGroup.js.map +1 -0
- package/dist/vue/kit/primevue/Select.js +68 -0
- package/dist/vue/kit/primevue/Select.js.map +1 -0
- package/dist/vue/kit/primevue/SelectMenu.js +94 -0
- package/dist/vue/kit/primevue/SelectMenu.js.map +1 -0
- package/dist/vue/kit/primevue/Separator.js +16 -0
- package/dist/vue/kit/primevue/Separator.js.map +1 -0
- package/dist/vue/kit/primevue/Switch.js +46 -0
- package/dist/vue/kit/primevue/Switch.js.map +1 -0
- package/dist/vue/kit/primevue/Table.js +54 -0
- package/dist/vue/kit/primevue/Table.js.map +1 -0
- package/dist/vue/kit/primevue/Tabs.js +49 -0
- package/dist/vue/kit/primevue/Tabs.js.map +1 -0
- package/dist/vue/kit/primevue/Textarea.js +55 -0
- package/dist/vue/kit/primevue/Textarea.js.map +1 -0
- package/dist/vue/kit/primevue/Tooltip.js +43 -0
- package/dist/vue/kit/primevue/Tooltip.js.map +1 -0
- package/dist/vue/kit/primevue/Tree.js +75 -0
- package/dist/vue/kit/primevue/Tree.js.map +1 -0
- package/dist/vue/kit/primevue/select-options.js +55 -0
- package/dist/vue/kit/primevue/select-options.js.map +1 -0
- package/dist/vue/kit/primevue/shared.js +49 -0
- package/dist/vue/kit/primevue/shared.js.map +1 -0
- package/dist/vue/kit/primevue/trigger.js +25 -0
- package/dist/vue/kit/primevue/trigger.js.map +1 -0
- package/dist/vue/kit/primevue.css +86 -0
- package/dist/vue/kit/primevue.d.ts +33 -0
- package/dist/vue/kit/primevue.js +96 -0
- package/dist/vue/kit/primevue.js.map +1 -0
- package/dist/vue/kit/types.d.ts +370 -0
- package/dist/vue/kit/use-ui-kit.d.ts +12 -0
- package/dist/vue/kit/use-ui-kit.js +17 -0
- package/dist/vue/kit/use-ui-kit.js.map +1 -0
- package/dist/vue/notify.d.ts +12 -0
- package/dist/vue/notify.js +27 -0
- package/dist/vue/notify.js.map +1 -0
- package/dist/vue/settings.d.ts +16 -0
- package/dist/vue/settings.js +64 -0
- package/dist/vue/settings.js.map +1 -0
- package/dist/vue/simple.d.ts +2 -0
- package/dist/vue/simple.js +1 -0
- package/dist/vue/store-ref.d.ts +20 -0
- package/dist/vue/store-ref.js +59 -0
- package/dist/vue/store-ref.js.map +1 -0
- package/dist/vue/suggestion-renderer.d.ts +6 -0
- package/dist/vue/suggestion-renderer.js +20 -0
- package/dist/vue/suggestion-renderer.js.map +1 -0
- package/dist/vue/use-editor-i18n.d.ts +12 -0
- package/dist/vue/use-editor-i18n.js +17 -0
- package/dist/vue/use-editor-i18n.js.map +1 -0
- package/dist/vue/use-editor-ui.d.ts +15 -0
- package/dist/vue/use-editor-ui.js +23 -0
- package/dist/vue/use-editor-ui.js.map +1 -0
- package/dist/vue/use-notifier.d.ts +11 -0
- package/dist/vue/use-notifier.js +19 -0
- package/dist/vue/use-notifier.js.map +1 -0
- package/docs/extending.md +538 -0
- package/docs/integration.md +537 -0
- package/docs/llms.md +375 -0
- package/docs/usage.md +1071 -0
- package/package.json +634 -4
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { AbilitiesOptions, BlockAction, SlashCommandItem } from "../core/extension-points.js";
|
|
2
|
+
import { EditorMetadata, MetadataItem } from "../core/metadata-types.js";
|
|
3
|
+
import { CollaborationSession, EditorPreset, UploadFn } from "../core/feature.js";
|
|
4
|
+
import { MarkdownDiagnostic, MarkdownPolicy } from "./policy.js";
|
|
5
|
+
import { SourceMode } from "./source-mode.js";
|
|
6
|
+
import { AnyExtension, Editor } from "@tiptap/vue-3";
|
|
7
|
+
//#region src/markdown/MarkdownSurface.vue.d.ts
|
|
8
|
+
type __VLS_Props = {
|
|
9
|
+
/** The document as Markdown text, YAML frontmatter included (kept verbatim and never shown in the editor). */
|
|
10
|
+
modelValue?: string;
|
|
11
|
+
preset: EditorPreset;
|
|
12
|
+
collaboration?: CollaborationSession;
|
|
13
|
+
metadata?: EditorMetadata;
|
|
14
|
+
abilities?: Partial<AbilitiesOptions>;
|
|
15
|
+
extensions?: AnyExtension[];
|
|
16
|
+
blockActions?: BlockAction[];
|
|
17
|
+
slashCommands?: (defaults: SlashCommandItem[]) => SlashCommandItem[];
|
|
18
|
+
documentId?: string;
|
|
19
|
+
upload?: UploadFn;
|
|
20
|
+
editable?: boolean;
|
|
21
|
+
settingsUi?: 'internal' | 'external';
|
|
22
|
+
/** What Markdown text may carry in, for loaded text and pasted text alike (see `MarkdownPolicy`). Default: no raw HTML, no data-URL images, safe link schemes only. */
|
|
23
|
+
policy?: MarkdownPolicy;
|
|
24
|
+
/**
|
|
25
|
+
* Source mode (`createSourceMode`): while its state is `source`, the surface shows the draft in a plain text area
|
|
26
|
+
* instead of the editor, with the diagnostics of a rejected commit and Apply / Cancel buttons; the editor is kept
|
|
27
|
+
* alive underneath. The mode is entered by the host (`sourceMode.enter()`).
|
|
28
|
+
*/
|
|
29
|
+
sourceMode?: SourceMode;
|
|
30
|
+
};
|
|
31
|
+
type __VLS_ModelProps = {
|
|
32
|
+
'sidebarOpen'?: boolean;
|
|
33
|
+
'commentsOpen'?: boolean;
|
|
34
|
+
};
|
|
35
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
36
|
+
declare var __VLS_15: string, __VLS_16: any;
|
|
37
|
+
type __VLS_Slots = {} & { [K in NonNullable<typeof __VLS_15>]?: (props: typeof __VLS_16) => any; };
|
|
38
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
39
|
+
editor: import("vue").ShallowRef<Editor | undefined, Editor | undefined>;
|
|
40
|
+
settingsOpen: import("vue").WritableComputedRef<boolean, boolean>;
|
|
41
|
+
settingsTab: import("vue").WritableComputedRef<string | undefined, string | undefined>;
|
|
42
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
43
|
+
"update:sidebarOpen": (value: boolean) => any;
|
|
44
|
+
"update:commentsOpen": (value: boolean) => any;
|
|
45
|
+
ready: (editor: Editor) => any;
|
|
46
|
+
"update:modelValue": (markdown: string) => any;
|
|
47
|
+
metadataCreate: (list: string, item: MetadataItem) => any;
|
|
48
|
+
contentError: (error: Error) => any;
|
|
49
|
+
settingsOpen: (tab?: string | undefined) => any;
|
|
50
|
+
frontmatter: (frontmatter: string | null) => any;
|
|
51
|
+
diagnostics: (diagnostics: MarkdownDiagnostic[]) => any;
|
|
52
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
53
|
+
"onUpdate:sidebarOpen"?: ((value: boolean) => any) | undefined;
|
|
54
|
+
"onUpdate:commentsOpen"?: ((value: boolean) => any) | undefined;
|
|
55
|
+
onReady?: ((editor: Editor) => any) | undefined;
|
|
56
|
+
"onUpdate:modelValue"?: ((markdown: string) => any) | undefined;
|
|
57
|
+
onMetadataCreate?: ((list: string, item: MetadataItem) => any) | undefined;
|
|
58
|
+
onContentError?: ((error: Error) => any) | undefined;
|
|
59
|
+
onSettingsOpen?: ((tab?: string | undefined) => any) | undefined;
|
|
60
|
+
onFrontmatter?: ((frontmatter: string | null) => any) | undefined;
|
|
61
|
+
onDiagnostics?: ((diagnostics: MarkdownDiagnostic[]) => any) | undefined;
|
|
62
|
+
}>, {
|
|
63
|
+
modelValue: string;
|
|
64
|
+
editable: boolean;
|
|
65
|
+
settingsUi: "internal" | "external";
|
|
66
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
67
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
68
|
+
declare const _default: typeof __VLS_export;
|
|
69
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
70
|
+
new (): {
|
|
71
|
+
$slots: S;
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
//#endregion
|
|
75
|
+
export { _default as default };
|
|
76
|
+
//# sourceMappingURL=MarkdownSurface.vue.d.ts.map
|
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
import { contentToMarkdown, markdownToContent } from "./document.js";
|
|
2
|
+
import { MarkdownClipboard } from "./clipboard.js";
|
|
3
|
+
import { joinFrontmatter, splitFrontmatter } from "./frontmatter.js";
|
|
4
|
+
import { useUiKit } from "../vue/kit/use-ui-kit.js";
|
|
5
|
+
import { useEditorI18n } from "../vue/use-editor-i18n.js";
|
|
6
|
+
import _sfc_main$1 from "../vue/components/EditorSurface.js";
|
|
7
|
+
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, createVNode, defineComponent, guardReactiveProps, mergeModels, normalizeProps, onBeforeUnmount, openBlock, ref, renderList, renderSlot, shallowRef, unref, useModel, vShow, watch, withCtx, withDirectives } from "vue";
|
|
8
|
+
//#region src/markdown/MarkdownSurface.vue
|
|
9
|
+
const _hoisted_1 = { class: "contents" };
|
|
10
|
+
const _hoisted_2 = {
|
|
11
|
+
key: 0,
|
|
12
|
+
class: "flex flex-col gap-3",
|
|
13
|
+
"data-testid": "markdown-source"
|
|
14
|
+
};
|
|
15
|
+
const _hoisted_3 = { class: "flex justify-end gap-2" };
|
|
16
|
+
const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
17
|
+
inheritAttrs: false,
|
|
18
|
+
__name: "MarkdownSurface",
|
|
19
|
+
props: /*@__PURE__*/ mergeModels({
|
|
20
|
+
modelValue: { default: "" },
|
|
21
|
+
preset: {},
|
|
22
|
+
collaboration: {},
|
|
23
|
+
metadata: {},
|
|
24
|
+
abilities: {},
|
|
25
|
+
extensions: {},
|
|
26
|
+
blockActions: {},
|
|
27
|
+
slashCommands: {},
|
|
28
|
+
documentId: {},
|
|
29
|
+
upload: {},
|
|
30
|
+
editable: {
|
|
31
|
+
type: Boolean,
|
|
32
|
+
default: true
|
|
33
|
+
},
|
|
34
|
+
settingsUi: { default: "internal" },
|
|
35
|
+
policy: {},
|
|
36
|
+
sourceMode: {}
|
|
37
|
+
}, {
|
|
38
|
+
"sidebarOpen": {
|
|
39
|
+
type: Boolean,
|
|
40
|
+
default: false
|
|
41
|
+
},
|
|
42
|
+
"sidebarOpenModifiers": {},
|
|
43
|
+
"commentsOpen": {
|
|
44
|
+
type: Boolean,
|
|
45
|
+
default: false
|
|
46
|
+
},
|
|
47
|
+
"commentsOpenModifiers": {}
|
|
48
|
+
}),
|
|
49
|
+
emits: /*@__PURE__*/ mergeModels([
|
|
50
|
+
"update:modelValue",
|
|
51
|
+
"frontmatter",
|
|
52
|
+
"ready",
|
|
53
|
+
"metadataCreate",
|
|
54
|
+
"contentError",
|
|
55
|
+
"diagnostics",
|
|
56
|
+
"settingsOpen"
|
|
57
|
+
], ["update:sidebarOpen", "update:commentsOpen"]),
|
|
58
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
59
|
+
const props = __props;
|
|
60
|
+
const { Button: UButton, Textarea: UTextarea, Alert: UAlert } = useUiKit();
|
|
61
|
+
const { t } = useEditorI18n();
|
|
62
|
+
const emit = __emit;
|
|
63
|
+
const sidebarOpen = useModel(__props, "sidebarOpen");
|
|
64
|
+
const commentsOpen = useModel(__props, "commentsOpen");
|
|
65
|
+
const surface = ref(null);
|
|
66
|
+
const editor = shallowRef();
|
|
67
|
+
const sourceState = shallowRef();
|
|
68
|
+
watch(() => props.sourceMode, (mode, _previous, onCleanup) => {
|
|
69
|
+
sourceState.value = mode?.state.get();
|
|
70
|
+
if (mode) onCleanup(mode.state.subscribe((state) => {
|
|
71
|
+
sourceState.value = state;
|
|
72
|
+
}));
|
|
73
|
+
}, { immediate: true });
|
|
74
|
+
const inSource = computed(() => sourceState.value?.mode === "source");
|
|
75
|
+
const extensionsWithClipboard = computed(() => props.extensions?.some((extension) => extension.name === "markdownClipboard") ? props.extensions : [...props.extensions ?? [], MarkdownClipboard.configure({ policy: props.policy ?? {} })]);
|
|
76
|
+
/** The frontmatter block of the text last handed in (or emitted): it is written back unchanged. */
|
|
77
|
+
let frontmatter = null;
|
|
78
|
+
/** Whether the text ended with a line break: the emitted text then does too, so saving a file does not flip it. */
|
|
79
|
+
let finalBreak = false;
|
|
80
|
+
/** The body (text after the frontmatter) the editor's document stands for; an incoming text with this body only changes the frontmatter. */
|
|
81
|
+
let loadedBody = null;
|
|
82
|
+
/** The text last sent through `update:modelValue`; the host handing it back is not an external change. */
|
|
83
|
+
let lastEmitted;
|
|
84
|
+
/** `body` as document JSON, migrated by the preset and checked against the editor's schema; an error is reported through `contentError`, not thrown. */
|
|
85
|
+
function parsed(instance, body) {
|
|
86
|
+
try {
|
|
87
|
+
const { content, diagnostics } = markdownToContent(instance, body, {
|
|
88
|
+
policy: props.policy,
|
|
89
|
+
t
|
|
90
|
+
});
|
|
91
|
+
instance.schema.nodeFromJSON(content).check();
|
|
92
|
+
emit("diagnostics", diagnostics);
|
|
93
|
+
return content;
|
|
94
|
+
} catch (error) {
|
|
95
|
+
emit("contentError", error instanceof Error ? error : new Error(String(error)));
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
/** Replaces the document without an update event and outside the undo history: loading a text is not an edit. */
|
|
100
|
+
function load(instance, body) {
|
|
101
|
+
const json = parsed(instance, body);
|
|
102
|
+
if (!json) return false;
|
|
103
|
+
const { state } = instance;
|
|
104
|
+
const doc = instance.schema.nodeFromJSON(json);
|
|
105
|
+
instance.view.dispatch(state.tr.replaceWith(0, state.doc.content.size, doc.content).setMeta("addToHistory", false).setMeta("preventUpdate", true));
|
|
106
|
+
return true;
|
|
107
|
+
}
|
|
108
|
+
/** Takes in a text from the host: the frontmatter always, the body into the document unless this is a collaborative editor (its document is the shared one). */
|
|
109
|
+
function adopt(instance, text) {
|
|
110
|
+
const split = splitFrontmatter(text);
|
|
111
|
+
if (split.frontmatter !== frontmatter) {
|
|
112
|
+
frontmatter = split.frontmatter;
|
|
113
|
+
emit("frontmatter", frontmatter);
|
|
114
|
+
}
|
|
115
|
+
finalBreak = split.body.endsWith("\n");
|
|
116
|
+
if (props.collaboration || split.body === loadedBody) return;
|
|
117
|
+
if (load(instance, split.body)) loadedBody = split.body;
|
|
118
|
+
}
|
|
119
|
+
function emitCurrent(instance) {
|
|
120
|
+
const markdown = contentToMarkdown(instance);
|
|
121
|
+
const body = markdown && finalBreak ? `${markdown}\n` : markdown;
|
|
122
|
+
loadedBody = body;
|
|
123
|
+
lastEmitted = joinFrontmatter(frontmatter, body);
|
|
124
|
+
emit("update:modelValue", lastEmitted);
|
|
125
|
+
}
|
|
126
|
+
function onUpdate({ editor: instance }) {
|
|
127
|
+
emitCurrent(instance);
|
|
128
|
+
}
|
|
129
|
+
function onReady(instance) {
|
|
130
|
+
editor.value = instance;
|
|
131
|
+
frontmatter = splitFrontmatter(props.modelValue).frontmatter;
|
|
132
|
+
adopt(instance, props.modelValue);
|
|
133
|
+
instance.on("update", onUpdate);
|
|
134
|
+
emit("ready", instance);
|
|
135
|
+
}
|
|
136
|
+
watch(() => props.modelValue, (text) => {
|
|
137
|
+
const instance = editor.value;
|
|
138
|
+
if (!instance || instance.isDestroyed || text === lastEmitted) return;
|
|
139
|
+
lastEmitted = void 0;
|
|
140
|
+
adopt(instance, text);
|
|
141
|
+
});
|
|
142
|
+
onBeforeUnmount(() => editor.value?.off("update", onUpdate));
|
|
143
|
+
__expose({
|
|
144
|
+
editor,
|
|
145
|
+
settingsOpen: computed({
|
|
146
|
+
get: () => surface.value?.settingsOpen ?? false,
|
|
147
|
+
set: (open) => {
|
|
148
|
+
if (surface.value) surface.value.settingsOpen = open;
|
|
149
|
+
}
|
|
150
|
+
}),
|
|
151
|
+
settingsTab: computed({
|
|
152
|
+
get: () => surface.value?.settingsTab,
|
|
153
|
+
set: (tab) => {
|
|
154
|
+
if (surface.value) surface.value.settingsTab = tab;
|
|
155
|
+
}
|
|
156
|
+
})
|
|
157
|
+
});
|
|
158
|
+
return (_ctx, _cache) => {
|
|
159
|
+
return openBlock(), createElementBlock(Fragment, null, [withDirectives(createElementVNode("div", _hoisted_1, [createVNode(_sfc_main$1, {
|
|
160
|
+
ref_key: "surface",
|
|
161
|
+
ref: surface,
|
|
162
|
+
"sidebar-open": sidebarOpen.value,
|
|
163
|
+
"onUpdate:sidebarOpen": _cache[0] || (_cache[0] = ($event) => sidebarOpen.value = $event),
|
|
164
|
+
"comments-open": commentsOpen.value,
|
|
165
|
+
"onUpdate:commentsOpen": _cache[1] || (_cache[1] = ($event) => commentsOpen.value = $event),
|
|
166
|
+
preset: __props.preset,
|
|
167
|
+
collaboration: __props.collaboration,
|
|
168
|
+
metadata: __props.metadata,
|
|
169
|
+
abilities: __props.abilities,
|
|
170
|
+
extensions: extensionsWithClipboard.value,
|
|
171
|
+
"block-actions": __props.blockActions,
|
|
172
|
+
"slash-commands": __props.slashCommands,
|
|
173
|
+
"document-id": __props.documentId,
|
|
174
|
+
upload: __props.upload,
|
|
175
|
+
editable: __props.editable,
|
|
176
|
+
"settings-ui": __props.settingsUi,
|
|
177
|
+
onReady,
|
|
178
|
+
onMetadataCreate: _cache[2] || (_cache[2] = (list, item) => emit("metadataCreate", list, item)),
|
|
179
|
+
onSettingsOpen: _cache[3] || (_cache[3] = (tab) => emit("settingsOpen", tab))
|
|
180
|
+
}, createSlots({ _: 2 }, [renderList(_ctx.$slots, (_, name) => {
|
|
181
|
+
return {
|
|
182
|
+
name,
|
|
183
|
+
fn: withCtx((slotProps) => [renderSlot(_ctx.$slots, name, normalizeProps(guardReactiveProps(slotProps ?? {})))])
|
|
184
|
+
};
|
|
185
|
+
})]), 1032, [
|
|
186
|
+
"sidebar-open",
|
|
187
|
+
"comments-open",
|
|
188
|
+
"preset",
|
|
189
|
+
"collaboration",
|
|
190
|
+
"metadata",
|
|
191
|
+
"abilities",
|
|
192
|
+
"extensions",
|
|
193
|
+
"block-actions",
|
|
194
|
+
"slash-commands",
|
|
195
|
+
"document-id",
|
|
196
|
+
"upload",
|
|
197
|
+
"editable",
|
|
198
|
+
"settings-ui"
|
|
199
|
+
])], 512), [[vShow, !inSource.value]]), __props.sourceMode && sourceState.value && inSource.value ? (openBlock(), createElementBlock("section", _hoisted_2, [
|
|
200
|
+
createVNode(unref(UTextarea), {
|
|
201
|
+
"model-value": sourceState.value.source,
|
|
202
|
+
"aria-label": unref(t)("markdown.source.label"),
|
|
203
|
+
class: "w-full font-mono",
|
|
204
|
+
rows: 16,
|
|
205
|
+
autoresize: "",
|
|
206
|
+
autofocus: "",
|
|
207
|
+
"data-testid": "markdown-source-input",
|
|
208
|
+
"onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => __props.sourceMode.edit($event ?? ""))
|
|
209
|
+
}, null, 8, ["model-value", "aria-label"]),
|
|
210
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(sourceState.value.diagnostics, (diagnostic, index) => {
|
|
211
|
+
return openBlock(), createBlock(unref(UAlert), {
|
|
212
|
+
key: index,
|
|
213
|
+
color: diagnostic.severity === "error" ? "error" : diagnostic.severity === "warning" ? "warning" : "info",
|
|
214
|
+
variant: "subtle",
|
|
215
|
+
title: diagnostic.line ? `${diagnostic.line}: ${diagnostic.message}` : diagnostic.message,
|
|
216
|
+
"data-testid": "markdown-source-diagnostic"
|
|
217
|
+
}, null, 8, ["color", "title"]);
|
|
218
|
+
}), 128)),
|
|
219
|
+
createElementVNode("div", _hoisted_3, [createVNode(unref(UButton), {
|
|
220
|
+
label: unref(t)("markdown.source.cancel"),
|
|
221
|
+
color: "neutral",
|
|
222
|
+
variant: "ghost",
|
|
223
|
+
"data-testid": "markdown-source-cancel",
|
|
224
|
+
onClick: _cache[5] || (_cache[5] = ($event) => __props.sourceMode.cancel())
|
|
225
|
+
}, null, 8, ["label"]), createVNode(unref(UButton), {
|
|
226
|
+
label: unref(t)("markdown.source.apply"),
|
|
227
|
+
"data-testid": "markdown-source-apply",
|
|
228
|
+
onClick: _cache[6] || (_cache[6] = ($event) => __props.sourceMode.commit())
|
|
229
|
+
}, null, 8, ["label"])])
|
|
230
|
+
])) : createCommentVNode("v-if", true)], 64);
|
|
231
|
+
};
|
|
232
|
+
}
|
|
233
|
+
});
|
|
234
|
+
//#endregion
|
|
235
|
+
export { _sfc_main as default };
|
|
236
|
+
|
|
237
|
+
//# sourceMappingURL=MarkdownSurface2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MarkdownSurface2.js","names":["$slots","_useModel","_openBlock","_createElementBlock","_Fragment","_withDirectives","_createElementVNode","_createVNode","EditorSurface","_createSlots","_renderList","_withCtx","_renderSlot","_normalizeProps","_guardReactiveProps","_vShow","_unref","_createBlock","_createCommentVNode"],"sources":["../../src/markdown/MarkdownSurface.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { Editor as CoreEditor } from '@tiptap/core'\nimport type { AnyExtension, Editor, JSONContent } from '@tiptap/vue-3'\nimport { computed, onBeforeUnmount, ref, shallowRef, watch } from 'vue'\nimport { useUiKit } from '../vue/kit/use-ui-kit'\nimport { useEditorI18n } from '../vue/use-editor-i18n'\nimport type { AbilitiesOptions, BlockAction, SlashCommandItem } from '../core/extension-points'\nimport type { CollaborationSession, EditorPreset, UploadFn } from '../core/feature'\nimport type { EditorMetadata, MetadataItem } from '../core/metadata-types'\nimport EditorSurface from '../vue/components/EditorSurface.vue'\nimport { MarkdownClipboard } from './clipboard'\nimport { contentToMarkdown, markdownToContent } from './document'\nimport { joinFrontmatter, splitFrontmatter } from './frontmatter'\nimport type { MarkdownDiagnostic, MarkdownPolicy } from './policy'\nimport type { SourceMode, SourceModeState } from './source-mode'\n\ndefineOptions({ inheritAttrs: false })\n\n// The props, emits and slots of `EditorSurface` are forwarded as they are (see there for their meaning); the\n// document is not its JSON `modelValue` but a Markdown string.\nconst props = withDefaults(defineProps<{\n /** The document as Markdown text, YAML frontmatter included (kept verbatim and never shown in the editor). */\n modelValue?: string\n preset: EditorPreset\n collaboration?: CollaborationSession\n metadata?: EditorMetadata\n abilities?: Partial<AbilitiesOptions>\n extensions?: AnyExtension[]\n blockActions?: BlockAction[]\n slashCommands?: (defaults: SlashCommandItem[]) => SlashCommandItem[]\n documentId?: string\n upload?: UploadFn\n editable?: boolean\n settingsUi?: 'internal' | 'external'\n /** What Markdown text may carry in, for loaded text and pasted text alike (see `MarkdownPolicy`). Default: no raw HTML, no data-URL images, safe link schemes only. */\n policy?: MarkdownPolicy\n /**\n * Source mode (`createSourceMode`): while its state is `source`, the surface shows the draft in a plain text area\n * instead of the editor, with the diagnostics of a rejected commit and Apply / Cancel buttons; the editor is kept\n * alive underneath. The mode is entered by the host (`sourceMode.enter()`).\n */\n sourceMode?: SourceMode\n}>(), { modelValue: '', editable: true, settingsUi: 'internal' })\n\nconst { Button: UButton, Textarea: UTextarea, Alert: UAlert } = useUiKit()\nconst { t } = useEditorI18n()\n\nconst emit = defineEmits<{\n /** The whole text (frontmatter and Markdown body) after every edit, in collaborative mode after every update of the shared document, remote ones included. */\n 'update:modelValue': [markdown: string]\n /** The frontmatter block the incoming `modelValue` carries changed (null: it has none); the verbatim block, fences included. */\n 'frontmatter': [frontmatter: string | null]\n 'ready': [editor: Editor]\n 'metadataCreate': [list: string, item: MetadataItem]\n /** The Markdown handed in does not fit this editor's schema; the last valid document stays. */\n 'contentError': [error: Error]\n /** What parsing the text handed in dropped or could not understand (raw HTML, unsafe URLs, unknown fences, broken fences); emitted after each load. */\n 'diagnostics': [diagnostics: MarkdownDiagnostic[]]\n 'settingsOpen': [tab?: string]\n}>()\n\nconst sidebarOpen = defineModel<boolean>('sidebarOpen', { default: false })\nconst commentsOpen = defineModel<boolean>('commentsOpen', { default: false })\n\nconst surface = ref<{ settingsOpen: boolean, settingsTab: string | undefined } | null>(null)\nconst editor = shallowRef<Editor>()\n\nconst sourceState = shallowRef<SourceModeState>()\nwatch(() => props.sourceMode, (mode, _previous, onCleanup) => {\n sourceState.value = mode?.state.get()\n if (mode) onCleanup(mode.state.subscribe((state) => { sourceState.value = state }))\n}, { immediate: true })\nconst inSource = computed(() => sourceState.value?.mode === 'source')\n// A policy change takes effect with the next editor: the clipboard extension is built with the editor.\nconst extensionsWithClipboard = computed(() => props.extensions?.some(extension => extension.name === 'markdownClipboard')\n ? props.extensions\n : [...(props.extensions ?? []), MarkdownClipboard.configure({ policy: props.policy ?? {} })])\n\n/** The frontmatter block of the text last handed in (or emitted): it is written back unchanged. */\nlet frontmatter: string | null = null\n/** Whether the text ended with a line break: the emitted text then does too, so saving a file does not flip it. */\nlet finalBreak = false\n/** The body (text after the frontmatter) the editor's document stands for; an incoming text with this body only changes the frontmatter. */\nlet loadedBody: string | null = null\n/** The text last sent through `update:modelValue`; the host handing it back is not an external change. */\nlet lastEmitted: string | undefined\n\n/** `body` as document JSON, migrated by the preset and checked against the editor's schema; an error is reported through `contentError`, not thrown. */\nfunction parsed(instance: Editor, body: string): JSONContent | undefined {\n try {\n const { content, diagnostics } = markdownToContent(instance, body, { policy: props.policy, t })\n instance.schema.nodeFromJSON(content).check()\n emit('diagnostics', diagnostics)\n return content\n }\n catch (error) {\n emit('contentError', error instanceof Error ? error : new Error(String(error)))\n return undefined\n }\n}\n\n/** Replaces the document without an update event and outside the undo history: loading a text is not an edit. */\nfunction load(instance: Editor, body: string): boolean {\n const json = parsed(instance, body)\n if (!json) return false\n const { state } = instance\n const doc = instance.schema.nodeFromJSON(json)\n instance.view.dispatch(state.tr.replaceWith(0, state.doc.content.size, doc.content).setMeta('addToHistory', false).setMeta('preventUpdate', true))\n return true\n}\n\n/** Takes in a text from the host: the frontmatter always, the body into the document unless this is a collaborative editor (its document is the shared one). */\nfunction adopt(instance: Editor, text: string) {\n const split = splitFrontmatter(text)\n if (split.frontmatter !== frontmatter) {\n frontmatter = split.frontmatter\n emit('frontmatter', frontmatter)\n }\n finalBreak = split.body.endsWith('\\n')\n if (props.collaboration || split.body === loadedBody) return\n if (load(instance, split.body)) loadedBody = split.body\n}\n\nfunction emitCurrent(instance: CoreEditor) {\n const markdown = contentToMarkdown(instance)\n const body = markdown && finalBreak ? `${markdown}\\n` : markdown\n loadedBody = body\n lastEmitted = joinFrontmatter(frontmatter, body)\n emit('update:modelValue', lastEmitted)\n}\n\nfunction onUpdate({ editor: instance }: { editor: CoreEditor }) {\n emitCurrent(instance)\n}\n\nfunction onReady(instance: Editor) {\n editor.value = instance\n // The editor and its pipeline exist only now, so the text is parsed now (first load: no `frontmatter` event for a block that was always there).\n frontmatter = splitFrontmatter(props.modelValue).frontmatter\n adopt(instance, props.modelValue)\n instance.on('update', onUpdate)\n emit('ready', instance)\n}\n\nwatch(() => props.modelValue, (text) => {\n const instance = editor.value\n if (!instance || instance.isDestroyed || text === lastEmitted) return\n lastEmitted = undefined\n adopt(instance, text)\n})\n\nonBeforeUnmount(() => editor.value?.off('update', onUpdate))\n\ndefineExpose({\n editor,\n settingsOpen: computed({ get: () => surface.value?.settingsOpen ?? false, set: (open: boolean) => { if (surface.value) surface.value.settingsOpen = open } }),\n settingsTab: computed({ get: () => surface.value?.settingsTab, set: (tab: string | undefined) => { if (surface.value) surface.value.settingsTab = tab } }),\n})\n</script>\n\n<template>\n <div v-show=\"!inSource\" class=\"contents\">\n <EditorSurface\n ref=\"surface\"\n v-model:sidebar-open=\"sidebarOpen\"\n v-model:comments-open=\"commentsOpen\"\n :preset=\"preset\"\n :collaboration=\"collaboration\"\n :metadata=\"metadata\"\n :abilities=\"abilities\"\n :extensions=\"extensionsWithClipboard\"\n :block-actions=\"blockActions\"\n :slash-commands=\"slashCommands\"\n :document-id=\"documentId\"\n :upload=\"upload\"\n :editable=\"editable\"\n :settings-ui=\"settingsUi\"\n @ready=\"onReady\"\n @metadata-create=\"(list, item) => emit('metadataCreate', list, item)\"\n @settings-open=\"tab => emit('settingsOpen', tab)\"\n >\n <template v-for=\"(_, name) in $slots\" :key=\"name\" #[name]=\"slotProps\">\n <slot :name=\"name\" v-bind=\"slotProps ?? {}\" />\n </template>\n </EditorSurface>\n </div>\n <section v-if=\"sourceMode && sourceState && inSource\" class=\"flex flex-col gap-3\" data-testid=\"markdown-source\">\n <UTextarea\n :model-value=\"sourceState.source\"\n :aria-label=\"t('markdown.source.label')\"\n class=\"w-full font-mono\"\n :rows=\"16\"\n autoresize\n autofocus\n data-testid=\"markdown-source-input\"\n @update:model-value=\"sourceMode.edit($event ?? '')\"\n />\n <UAlert\n v-for=\"(diagnostic, index) in sourceState.diagnostics\"\n :key=\"index\"\n :color=\"diagnostic.severity === 'error' ? 'error' : diagnostic.severity === 'warning' ? 'warning' : 'info'\"\n variant=\"subtle\"\n :title=\"diagnostic.line ? `${diagnostic.line}: ${diagnostic.message}` : diagnostic.message\"\n data-testid=\"markdown-source-diagnostic\"\n />\n <div class=\"flex justify-end gap-2\">\n <UButton :label=\"t('markdown.source.cancel')\" color=\"neutral\" variant=\"ghost\" data-testid=\"markdown-source-cancel\" @click=\"sourceMode.cancel()\" />\n <UButton :label=\"t('markdown.source.apply')\" data-testid=\"markdown-source-apply\" @click=\"sourceMode.commit()\" />\n </div>\n </section>\n</template>\n"],"mappings":"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"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { MarkdownPolicy } from "./policy.js";
|
|
2
|
+
import { Extension } from "@tiptap/core";
|
|
3
|
+
//#region src/markdown/clipboard.d.ts
|
|
4
|
+
export interface MarkdownClipboardOptions {
|
|
5
|
+
/** What pasted Markdown and HTML may carry in (see `MarkdownPolicy`); data-URL images only with `allowDataUrls`. */
|
|
6
|
+
policy?: MarkdownPolicy;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Markdown on the clipboard, both ways. Pasting: `text/markdown` is parsed as Markdown; plain text that contains block
|
|
10
|
+
* syntax (headings, lists, quotes, code fences, tables, `:::` fences, …) becomes blocks, while plain text without it
|
|
11
|
+
* (including inline syntax like `**x**`) stays literal; HTML is sanitized before ProseMirror parses it with the schema's
|
|
12
|
+
* rules. Copying and cutting set `text/markdown` (what `editor.markdown` makes of the selection) next to ProseMirror's
|
|
13
|
+
* `text/html` and `text/plain`. Pasting is the editor's own: not editable, no paste.
|
|
14
|
+
*/
|
|
15
|
+
export declare const MarkdownClipboard: Extension<MarkdownClipboardOptions, any>;
|
|
16
|
+
//#endregion
|
|
17
|
+
//# sourceMappingURL=clipboard.d.ts.map
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { isSafeMediaUrl, isSafeUrl } from "./policy.js";
|
|
2
|
+
import { markdownToContent } from "./document.js";
|
|
3
|
+
import { Extension } from "@tiptap/core";
|
|
4
|
+
import { Plugin, PluginKey } from "@tiptap/pm/state";
|
|
5
|
+
import { DOMParser as DOMParser$1, Slice } from "@tiptap/pm/model";
|
|
6
|
+
//#region src/markdown/clipboard.ts
|
|
7
|
+
/** Elements dropped, with everything inside them, from pasted HTML. */
|
|
8
|
+
const DISCARDED = "script, style, iframe, object, embed, svg, math, template, noscript, input, button, link, meta, base";
|
|
9
|
+
/**
|
|
10
|
+
* `html` as ProseMirror will parse it: without scripts, styles, embeds and form controls, event-handler attributes,
|
|
11
|
+
* links with unsafe URLs (the text stays) and media with unsafe URLs (images are dropped; data URLs only with
|
|
12
|
+
* `policy.allowDataUrls`).
|
|
13
|
+
*/
|
|
14
|
+
function sanitizeHtml(html, policy) {
|
|
15
|
+
const { body } = new DOMParser().parseFromString(html, "text/html");
|
|
16
|
+
for (const element of body.querySelectorAll(DISCARDED)) element.remove();
|
|
17
|
+
for (const element of body.querySelectorAll("*")) {
|
|
18
|
+
for (const { name } of [...element.attributes]) if (/^on/i.test(name)) element.removeAttribute(name);
|
|
19
|
+
const href = element.getAttribute("href");
|
|
20
|
+
if (href !== null && !isSafeUrl(href)) element.removeAttribute("href");
|
|
21
|
+
const src = element.getAttribute("src");
|
|
22
|
+
if (src === null || isSafeMediaUrl(src, policy)) continue;
|
|
23
|
+
if (element.tagName === "IMG") element.remove();
|
|
24
|
+
else element.removeAttribute("src");
|
|
25
|
+
}
|
|
26
|
+
return body.innerHTML;
|
|
27
|
+
}
|
|
28
|
+
/** ProseMirror's `someProp` falls through to the default behaviour on a falsy result; its types do not say so. */
|
|
29
|
+
const DEFAULT_PARSING = null;
|
|
30
|
+
/**
|
|
31
|
+
* Markdown as a ProseMirror slice of the editor's schema, or null when it does not fit. A single paragraph is open on
|
|
32
|
+
* both sides, so it merges into the paragraph around the caret like text pasted natively; anything else is inserted as
|
|
33
|
+
* blocks.
|
|
34
|
+
*/
|
|
35
|
+
function markdownSlice(editor, markdown, policy) {
|
|
36
|
+
try {
|
|
37
|
+
const doc = editor.schema.nodeFromJSON(markdownToContent(editor, markdown, { policy }).content);
|
|
38
|
+
doc.check();
|
|
39
|
+
const blocks = doc.content;
|
|
40
|
+
return blocks.childCount === 1 && blocks.firstChild.type.name === "paragraph" ? new Slice(blocks, 1, 1) : new Slice(blocks, 0, 0);
|
|
41
|
+
} catch {
|
|
42
|
+
return null;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* The parser of pasted HTML. The image node's own rule skips `data:` sources (Tiptap's `allowBase64` is off unless the
|
|
47
|
+
* host turns it on), so a policy that allows data URLs adds a rule for the raster ones `sanitizeHtml` let through.
|
|
48
|
+
*/
|
|
49
|
+
function htmlParser(editor, policy) {
|
|
50
|
+
const { schema } = editor;
|
|
51
|
+
if (!policy.allowDataUrls || !schema.nodes.image) return void 0;
|
|
52
|
+
return new DOMParser$1(schema, [{
|
|
53
|
+
tag: "img[src^=\"data:\"]",
|
|
54
|
+
node: "image",
|
|
55
|
+
getAttrs: (element) => ({
|
|
56
|
+
src: element.getAttribute("src"),
|
|
57
|
+
alt: element.getAttribute("alt"),
|
|
58
|
+
title: element.getAttribute("title")
|
|
59
|
+
})
|
|
60
|
+
}, ...DOMParser$1.fromSchema(schema).rules]);
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Markdown on the clipboard, both ways. Pasting: `text/markdown` is parsed as Markdown; plain text that contains block
|
|
64
|
+
* syntax (headings, lists, quotes, code fences, tables, `:::` fences, …) becomes blocks, while plain text without it
|
|
65
|
+
* (including inline syntax like `**x**`) stays literal; HTML is sanitized before ProseMirror parses it with the schema's
|
|
66
|
+
* rules. Copying and cutting set `text/markdown` (what `editor.markdown` makes of the selection) next to ProseMirror's
|
|
67
|
+
* `text/html` and `text/plain`. Pasting is the editor's own: not editable, no paste.
|
|
68
|
+
*/
|
|
69
|
+
const MarkdownClipboard = Extension.create({
|
|
70
|
+
name: "markdownClipboard",
|
|
71
|
+
addOptions: () => ({ policy: {} }),
|
|
72
|
+
addProseMirrorPlugins() {
|
|
73
|
+
const { editor } = this;
|
|
74
|
+
const policy = this.options.policy ?? {};
|
|
75
|
+
const clipboardParser = htmlParser(editor, policy);
|
|
76
|
+
const markdownOf = (view) => {
|
|
77
|
+
const json = view.state.selection.content().content.toJSON();
|
|
78
|
+
return editor.markdown.serialize({
|
|
79
|
+
type: "doc",
|
|
80
|
+
content: json
|
|
81
|
+
}).replace(/\n+$/, "");
|
|
82
|
+
};
|
|
83
|
+
const copy = (view, event) => {
|
|
84
|
+
const data = event.clipboardData;
|
|
85
|
+
const cut = event.type === "cut";
|
|
86
|
+
if (!data || view.state.selection.empty || cut && !view.editable) return false;
|
|
87
|
+
const { dom, text } = view.serializeForClipboard(view.state.selection.content());
|
|
88
|
+
const markdown = markdownOf(view);
|
|
89
|
+
event.preventDefault();
|
|
90
|
+
data.clearData();
|
|
91
|
+
data.setData("text/html", dom.innerHTML);
|
|
92
|
+
data.setData("text/plain", text);
|
|
93
|
+
data.setData("text/markdown", markdown);
|
|
94
|
+
if (cut) view.dispatch(view.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent", "cut"));
|
|
95
|
+
return true;
|
|
96
|
+
};
|
|
97
|
+
return [new Plugin({
|
|
98
|
+
key: new PluginKey("markdownClipboard"),
|
|
99
|
+
props: {
|
|
100
|
+
handleDOMEvents: {
|
|
101
|
+
copy,
|
|
102
|
+
cut: copy
|
|
103
|
+
},
|
|
104
|
+
transformPastedHTML: (html) => sanitizeHtml(html, policy),
|
|
105
|
+
...clipboardParser && { clipboardParser },
|
|
106
|
+
handlePaste(view, event) {
|
|
107
|
+
const markdown = event.clipboardData?.getData("text/markdown");
|
|
108
|
+
const slice = markdown?.trim() ? markdownSlice(editor, markdown, policy) : null;
|
|
109
|
+
if (!slice) return false;
|
|
110
|
+
view.dispatch(view.state.tr.replaceSelection(slice).scrollIntoView().setMeta("paste", true).setMeta("uiEvent", "paste"));
|
|
111
|
+
return true;
|
|
112
|
+
},
|
|
113
|
+
clipboardTextParser(text, $context, plain) {
|
|
114
|
+
if (plain || $context.parent.type.spec.code) return DEFAULT_PARSING;
|
|
115
|
+
const slice = markdownSlice(editor, text, policy);
|
|
116
|
+
return slice?.content.content.some((block) => block.type.name !== "paragraph") ? slice : DEFAULT_PARSING;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
})];
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
//#endregion
|
|
123
|
+
export { MarkdownClipboard };
|
|
124
|
+
|
|
125
|
+
//# sourceMappingURL=clipboard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clipboard.js","names":["ProseMirrorParser"],"sources":["../../src/markdown/clipboard.ts"],"sourcesContent":["import { type Editor, Extension } from '@tiptap/core'\nimport { DOMParser as ProseMirrorParser, Slice } from '@tiptap/pm/model'\nimport { Plugin, PluginKey } from '@tiptap/pm/state'\nimport type { EditorView } from '@tiptap/pm/view'\nimport { markdownToContent } from './document'\nimport { isSafeMediaUrl, isSafeUrl, type MarkdownPolicy } from './policy'\n\nexport interface MarkdownClipboardOptions {\n /** What pasted Markdown and HTML may carry in (see `MarkdownPolicy`); data-URL images only with `allowDataUrls`. */\n policy?: MarkdownPolicy\n}\n\n/** Elements dropped, with everything inside them, from pasted HTML. */\nconst DISCARDED = 'script, style, iframe, object, embed, svg, math, template, noscript, input, button, link, meta, base'\n\n/**\n * `html` as ProseMirror will parse it: without scripts, styles, embeds and form controls, event-handler attributes,\n * links with unsafe URLs (the text stays) and media with unsafe URLs (images are dropped; data URLs only with\n * `policy.allowDataUrls`).\n */\nfunction sanitizeHtml(html: string, policy: MarkdownPolicy): string {\n const { body } = new DOMParser().parseFromString(html, 'text/html')\n for (const element of body.querySelectorAll(DISCARDED)) element.remove()\n for (const element of body.querySelectorAll('*')) {\n for (const { name } of [...element.attributes]) if (/^on/i.test(name)) element.removeAttribute(name)\n const href = element.getAttribute('href')\n if (href !== null && !isSafeUrl(href)) element.removeAttribute('href')\n const src = element.getAttribute('src')\n if (src === null || isSafeMediaUrl(src, policy)) continue\n if (element.tagName === 'IMG') element.remove()\n else element.removeAttribute('src')\n }\n return body.innerHTML\n}\n\n/** ProseMirror's `someProp` falls through to the default behaviour on a falsy result; its types do not say so. */\nconst DEFAULT_PARSING = null as unknown as Slice\n\n/**\n * Markdown as a ProseMirror slice of the editor's schema, or null when it does not fit. A single paragraph is open on\n * both sides, so it merges into the paragraph around the caret like text pasted natively; anything else is inserted as\n * blocks.\n */\nfunction markdownSlice(editor: Editor, markdown: string, policy: MarkdownPolicy): Slice | null {\n try {\n const doc = editor.schema.nodeFromJSON(markdownToContent(editor, markdown, { policy }).content)\n doc.check()\n const blocks = doc.content\n return blocks.childCount === 1 && blocks.firstChild!.type.name === 'paragraph' ? new Slice(blocks, 1, 1) : new Slice(blocks, 0, 0)\n }\n catch {\n return null\n }\n}\n\n/**\n * The parser of pasted HTML. The image node's own rule skips `data:` sources (Tiptap's `allowBase64` is off unless the\n * host turns it on), so a policy that allows data URLs adds a rule for the raster ones `sanitizeHtml` let through.\n */\nfunction htmlParser(editor: Editor, policy: MarkdownPolicy): ProseMirrorParser | undefined {\n const { schema } = editor\n if (!policy.allowDataUrls || !schema.nodes.image) return undefined\n const rule = {\n tag: 'img[src^=\"data:\"]',\n node: 'image',\n getAttrs: (element: HTMLElement) => ({ src: element.getAttribute('src'), alt: element.getAttribute('alt'), title: element.getAttribute('title') }),\n }\n return new ProseMirrorParser(schema, [rule, ...ProseMirrorParser.fromSchema(schema).rules])\n}\n\n/**\n * Markdown on the clipboard, both ways. Pasting: `text/markdown` is parsed as Markdown; plain text that contains block\n * syntax (headings, lists, quotes, code fences, tables, `:::` fences, …) becomes blocks, while plain text without it\n * (including inline syntax like `**x**`) stays literal; HTML is sanitized before ProseMirror parses it with the schema's\n * rules. Copying and cutting set `text/markdown` (what `editor.markdown` makes of the selection) next to ProseMirror's\n * `text/html` and `text/plain`. Pasting is the editor's own: not editable, no paste.\n */\nexport const MarkdownClipboard = Extension.create<MarkdownClipboardOptions>({\n name: 'markdownClipboard',\n\n addOptions: () => ({ policy: {} }),\n\n addProseMirrorPlugins() {\n const { editor } = this\n const policy = this.options.policy ?? {}\n const clipboardParser = htmlParser(editor, policy)\n const markdownOf = (view: EditorView): string => {\n const json = view.state.selection.content().content.toJSON() as unknown[]\n return editor.markdown!.serialize({ type: 'doc', content: json as never }).replace(/\\n+$/, '')\n }\n const copy = (view: EditorView, event: Event): boolean => {\n const data = (event as ClipboardEvent).clipboardData\n const cut = event.type === 'cut'\n if (!data || view.state.selection.empty || (cut && !view.editable)) return false\n const { dom, text } = view.serializeForClipboard(view.state.selection.content())\n const markdown = markdownOf(view)\n event.preventDefault()\n data.clearData()\n data.setData('text/html', dom.innerHTML)\n data.setData('text/plain', text)\n data.setData('text/markdown', markdown)\n if (cut) view.dispatch(view.state.tr.deleteSelection().scrollIntoView().setMeta('uiEvent', 'cut'))\n return true\n }\n\n return [new Plugin({\n key: new PluginKey('markdownClipboard'),\n props: {\n handleDOMEvents: { copy, cut: copy },\n transformPastedHTML: html => sanitizeHtml(html, policy),\n ...(clipboardParser && { clipboardParser }),\n handlePaste(view, event) {\n const markdown = event.clipboardData?.getData('text/markdown')\n const slice = markdown?.trim() ? markdownSlice(editor, markdown, policy) : null\n if (!slice) return false\n view.dispatch(view.state.tr.replaceSelection(slice).scrollIntoView().setMeta('paste', true).setMeta('uiEvent', 'paste'))\n return true\n },\n clipboardTextParser(text, $context, plain) {\n if (plain || $context.parent.type.spec.code) return DEFAULT_PARSING\n const slice = markdownSlice(editor, text, policy)\n // Only text the Markdown parser reads as something other than paragraphs has block syntax; the rest pastes as the text it is.\n return slice?.content.content.some(block => block.type.name !== 'paragraph') ? slice : DEFAULT_PARSING\n },\n },\n })]\n },\n})\n"],"mappings":"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"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { Translate } from "../i18n/index.js";
|
|
2
|
+
import { MarkdownDiagnostic, MarkdownPolicy } from "./policy.js";
|
|
3
|
+
import { Editor, JSONContent } from "@tiptap/core";
|
|
4
|
+
//#region src/markdown/document.d.ts
|
|
5
|
+
/** A Markdown body as document JSON, with what the parse dropped or could not understand. */
|
|
6
|
+
export interface MarkdownContent {
|
|
7
|
+
content: JSONContent;
|
|
8
|
+
diagnostics: MarkdownDiagnostic[];
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* `body` (Markdown without frontmatter) as the document JSON of `editor`, plus `diagnostics`: the preset's block
|
|
12
|
+
* pipeline parses it (`parseBlocks`: Markdown tokens, then the features' normalize and segment stages), the blocks
|
|
13
|
+
* become the children of a `doc`, `policy` is enforced and the preset's `migrateContent` stage runs. An empty body is
|
|
14
|
+
* the empty document (one empty paragraph). Nothing is applied to the editor.
|
|
15
|
+
*
|
|
16
|
+
* The diagnostics' `message` is in the language of `options.t`, by default that of the editor's registered surface, else
|
|
17
|
+
* the default locale.
|
|
18
|
+
*
|
|
19
|
+
* Diagnostics: `raw-html` (dropped unless `policy.allowHtml`), `unsafe-url` (links and media with a scheme other than
|
|
20
|
+
* http(s), mailto and tel are dropped; base64 `data:image` URLs are kept only with `policy.allowDataUrls`),
|
|
21
|
+
* `unknown-fence` (a `:::` fence of a kind no feature registered, kept verbatim as an `opaqueFence`), and the fatal
|
|
22
|
+
* `unclosed-fence` and `invalid-fence-meta` (a fence opener that stayed plain text).
|
|
23
|
+
*/
|
|
24
|
+
export declare function markdownToContent(editor: Editor, body: string, options?: {
|
|
25
|
+
policy?: MarkdownPolicy;
|
|
26
|
+
t?: Translate;
|
|
27
|
+
}): MarkdownContent;
|
|
28
|
+
/**
|
|
29
|
+
* The document of `editor` as Markdown (`editor.getMarkdown()`: the registered Markdown handlers render every node,
|
|
30
|
+
* tables as pipe tables and task items as `- [ ]`/`- [x]`), without trailing line breaks: Tiptap keeps an empty
|
|
31
|
+
* paragraph after a last block that is not a paragraph, and it is not content. Callers that write files add their own
|
|
32
|
+
* final line break.
|
|
33
|
+
*/
|
|
34
|
+
export declare function contentToMarkdown(editor: Editor): string;
|
|
35
|
+
//#endregion
|
|
36
|
+
//# sourceMappingURL=document.d.ts.map
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { splitFences } from "../core/fences.js";
|
|
2
|
+
import { parseBlocks, pipelineOf } from "../core/pipeline.js";
|
|
3
|
+
import { createTranslator } from "../i18n/index.js";
|
|
4
|
+
import { editorEntryOf } from "../core/editor-ui.js";
|
|
5
|
+
import { EMPTY_EDITOR_CONTENT } from "../core/schema/index.js";
|
|
6
|
+
import { enforceUrlPolicy, locate } from "./policy.js";
|
|
7
|
+
//#region src/markdown/document.ts
|
|
8
|
+
/**
|
|
9
|
+
* Runs `parse` with raw HTML tokens (block and inline, tags and comments) dropped instead of handed to the schema's
|
|
10
|
+
* `parseHTML` rules, and reports each in `diagnostics`.
|
|
11
|
+
*/
|
|
12
|
+
function withoutRawHtml(editor, source, diagnostics, t, parse) {
|
|
13
|
+
const manager = editor.markdown;
|
|
14
|
+
if (!manager) return parse();
|
|
15
|
+
const own = Object.hasOwn(manager, "parseHTMLToken");
|
|
16
|
+
const original = manager.parseHTMLToken;
|
|
17
|
+
let from = 0;
|
|
18
|
+
manager.parseHTMLToken = (token) => {
|
|
19
|
+
const html = (token.raw ?? token.text ?? "").trim();
|
|
20
|
+
if (html) {
|
|
21
|
+
const { line, next } = locate(source, html, from);
|
|
22
|
+
from = next;
|
|
23
|
+
diagnostics.push({
|
|
24
|
+
code: "raw-html",
|
|
25
|
+
severity: "warning",
|
|
26
|
+
message: t("markdown.diagnostic.rawHtml", { html: JSON.stringify(html.length > 60 ? `${html.slice(0, 57)}…` : html) }),
|
|
27
|
+
...line && { line }
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
return null;
|
|
31
|
+
};
|
|
32
|
+
try {
|
|
33
|
+
return parse();
|
|
34
|
+
} finally {
|
|
35
|
+
if (own) manager.parseHTMLToken = original;
|
|
36
|
+
else delete manager.parseHTMLToken;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
const opaqueFences = (node) => [...node.type === "opaqueFence" ? [node] : [], ...(node.content ?? []).flatMap(opaqueFences)];
|
|
40
|
+
/**
|
|
41
|
+
* `body` (Markdown without frontmatter) as the document JSON of `editor`, plus `diagnostics`: the preset's block
|
|
42
|
+
* pipeline parses it (`parseBlocks`: Markdown tokens, then the features' normalize and segment stages), the blocks
|
|
43
|
+
* become the children of a `doc`, `policy` is enforced and the preset's `migrateContent` stage runs. An empty body is
|
|
44
|
+
* the empty document (one empty paragraph). Nothing is applied to the editor.
|
|
45
|
+
*
|
|
46
|
+
* The diagnostics' `message` is in the language of `options.t`, by default that of the editor's registered surface, else
|
|
47
|
+
* the default locale.
|
|
48
|
+
*
|
|
49
|
+
* Diagnostics: `raw-html` (dropped unless `policy.allowHtml`), `unsafe-url` (links and media with a scheme other than
|
|
50
|
+
* http(s), mailto and tel are dropped; base64 `data:image` URLs are kept only with `policy.allowDataUrls`),
|
|
51
|
+
* `unknown-fence` (a `:::` fence of a kind no feature registered, kept verbatim as an `opaqueFence`), and the fatal
|
|
52
|
+
* `unclosed-fence` and `invalid-fence-meta` (a fence opener that stayed plain text).
|
|
53
|
+
*/
|
|
54
|
+
function markdownToContent(editor, body, options = {}) {
|
|
55
|
+
const policy = options.policy ?? {};
|
|
56
|
+
const t = options.t ?? editorEntryOf(editor)?.ctx.t ?? createTranslator();
|
|
57
|
+
const diagnostics = [];
|
|
58
|
+
const { blocks } = policy.allowHtml ? parseBlocks(editor, body) : withoutRawHtml(editor, body, diagnostics, t, () => parseBlocks(editor, body));
|
|
59
|
+
let content = blocks.length ? {
|
|
60
|
+
type: "doc",
|
|
61
|
+
content: blocks
|
|
62
|
+
} : EMPTY_EDITOR_CONTENT;
|
|
63
|
+
content = enforceUrlPolicy(content, policy, body, diagnostics, t);
|
|
64
|
+
if (!content.content?.length) content = EMPTY_EDITOR_CONTENT;
|
|
65
|
+
for (const problem of splitFences(body).problems) diagnostics.push({
|
|
66
|
+
code: problem.code,
|
|
67
|
+
severity: "error",
|
|
68
|
+
line: problem.line,
|
|
69
|
+
message: t(problem.code === "unclosed-fence" ? "markdown.diagnostic.unclosedFence" : "markdown.diagnostic.invalidFenceMeta", { kind: problem.kind })
|
|
70
|
+
});
|
|
71
|
+
let from = 0;
|
|
72
|
+
for (const fence of opaqueFences(content)) {
|
|
73
|
+
const raw = String(fence.attrs?.raw ?? "");
|
|
74
|
+
const { line, next } = locate(body, raw, from);
|
|
75
|
+
from = next;
|
|
76
|
+
diagnostics.push({
|
|
77
|
+
code: "unknown-fence",
|
|
78
|
+
severity: "info",
|
|
79
|
+
message: t("markdown.diagnostic.unknownFence", { kind: String(fence.attrs?.kind) }),
|
|
80
|
+
...line && { line }
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
return {
|
|
84
|
+
content: pipelineOf(editor).migrateContent(content),
|
|
85
|
+
diagnostics
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* The document of `editor` as Markdown (`editor.getMarkdown()`: the registered Markdown handlers render every node,
|
|
90
|
+
* tables as pipe tables and task items as `- [ ]`/`- [x]`), without trailing line breaks: Tiptap keeps an empty
|
|
91
|
+
* paragraph after a last block that is not a paragraph, and it is not content. Callers that write files add their own
|
|
92
|
+
* final line break.
|
|
93
|
+
*/
|
|
94
|
+
function contentToMarkdown(editor) {
|
|
95
|
+
return editor.getMarkdown().replace(/\n+$/, "");
|
|
96
|
+
}
|
|
97
|
+
//#endregion
|
|
98
|
+
export { contentToMarkdown, markdownToContent };
|
|
99
|
+
|
|
100
|
+
//# sourceMappingURL=document.js.map
|