@ecsplico/editor 0.0.0-stage → 2.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/CHANGELOG.md +19 -0
- package/LICENSE +21 -0
- package/README.md +232 -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 +10 -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 +502 -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 +10 -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 +62 -0
- package/dist/nuxt/module.js +101 -0
- package/dist/nuxt/module.js.map +1 -0
- package/dist/nuxt/runtime/install-context.d.ts +16 -0
- package/dist/nuxt/runtime/install-context.js +25 -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/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 +42 -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/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 +619 -4
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { isChromeNode } from "../../core/schema/node-flags.js";
|
|
2
|
+
//#region src/features/block-ui/handle-geometry.ts
|
|
3
|
+
const LIST_ITEMS = ["listItem", "taskItem"];
|
|
4
|
+
const TABLE_STRUCTURE = [
|
|
5
|
+
"tableRow",
|
|
6
|
+
"tableCell",
|
|
7
|
+
"tableHeader"
|
|
8
|
+
];
|
|
9
|
+
/** Whether a block shows its own kind icon (a composite's `.composite__toggle`): the icon is its drag handle, so it gets no standard one. */
|
|
10
|
+
function hasKindIcon(dom) {
|
|
11
|
+
return dom.querySelector(":scope > .composite__toggle") !== null;
|
|
12
|
+
}
|
|
13
|
+
function gutterShiftOf(node, dom) {
|
|
14
|
+
const list = node.type.name === "listItem" ? dom.parentElement : null;
|
|
15
|
+
return list ? dom.getBoundingClientRect().left - list.getBoundingClientRect().left : 0;
|
|
16
|
+
}
|
|
17
|
+
/** Left edge of the handle column of the block `node` rendered as `dom` (the block's own left edge when it has no handle). */
|
|
18
|
+
function handleLeftOf(node, dom, handleWidth) {
|
|
19
|
+
const left = dom.getBoundingClientRect().left;
|
|
20
|
+
return hasKindIcon(dom) ? left : left - handleWidth - gutterShiftOf(node, dom);
|
|
21
|
+
}
|
|
22
|
+
function firstLineCenterShift(dom, referenceTop, handleHeight) {
|
|
23
|
+
const textblock = dom.matches("p, h1, h2, h3, h4, h5, h6, pre") ? dom : dom.querySelector("p, h1, h2, h3, h4, h5, h6, pre");
|
|
24
|
+
if (!textblock) return 0;
|
|
25
|
+
const style = getComputedStyle(textblock);
|
|
26
|
+
const lineHeight = Number.parseFloat(style.lineHeight) || Number.parseFloat(style.fontSize) * 1.2;
|
|
27
|
+
return textblock.getBoundingClientRect().top + Number.parseFloat(style.paddingTop) - referenceTop + (lineHeight - handleHeight) / 2;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* The blocks that get a permanent handle (`blocks.dragHandle: 'always'`): every block the hover handle can target, at any
|
|
31
|
+
* depth, in document order. Not eligible, like for the hover handle: inline content, composite chrome (it stands for
|
|
32
|
+
* its composite), table rows and cells, content of table headers, list wrappers (their items are), and the first block
|
|
33
|
+
* of a list item (the item is). Blocks with a kind icon have the icon as their handle.
|
|
34
|
+
*/
|
|
35
|
+
function handleBlocksOf(view) {
|
|
36
|
+
const blocks = [];
|
|
37
|
+
view.state.doc.descendants((node, pos, parent, index) => {
|
|
38
|
+
if (node.isInline || isChromeNode(node)) return false;
|
|
39
|
+
const dom = view.nodeDOM(pos);
|
|
40
|
+
if (!(dom instanceof HTMLElement)) return;
|
|
41
|
+
if (!(TABLE_STRUCTURE.includes(node.type.name) || parent !== null && parent.type.name === "tableHeader" || node.firstChild !== null && LIST_ITEMS.includes(node.firstChild.type.name) || index === 0 && parent !== null && LIST_ITEMS.includes(parent.type.name)) && !hasKindIcon(dom)) blocks.push({
|
|
42
|
+
node,
|
|
43
|
+
pos,
|
|
44
|
+
dom
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
return blocks;
|
|
48
|
+
}
|
|
49
|
+
//#endregion
|
|
50
|
+
export { firstLineCenterShift, gutterShiftOf, handleBlocksOf, handleLeftOf, hasKindIcon };
|
|
51
|
+
|
|
52
|
+
//# sourceMappingURL=handle-geometry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handle-geometry.js","names":[],"sources":["../../../src/features/block-ui/handle-geometry.ts"],"sourcesContent":["import type { Node } from '@tiptap/pm/model'\nimport type { EditorView } from '@tiptap/pm/view'\nimport { isChromeNode } from '../../core/schema'\n\n// Where the drag handle sits and which blocks have one. Shared by the hover handle (`BlockUi`, upstream plugin) and the\n// permanent handles (`BlockHandles`), so both put the handle at the same place.\n\n/** Width and height of a handle: the hover handle's `size-6`. */\nexport const HANDLE_SIZE = 24\n\nconst LIST_ITEMS = ['listItem', 'taskItem']\nconst TABLE_STRUCTURE = ['tableRow', 'tableCell', 'tableHeader']\n\n/** Whether a block shows its own kind icon (a composite's `.composite__toggle`): the icon is its drag handle, so it gets no standard one. */\nexport function hasKindIcon(dom: HTMLElement): boolean {\n return dom.querySelector(':scope > .composite__toggle') !== null\n}\n\n// The handle's right edge sits on the block's left edge. A list item's marker sits in the list's left padding, exactly\n// where that puts the handle, so for list items the handle moves further left by the list's indent and lands left of\n// the bullet.\nexport function gutterShiftOf(node: Node, dom: HTMLElement): number {\n const list = node.type.name === 'listItem' ? dom.parentElement : null\n return list ? dom.getBoundingClientRect().left - list.getBoundingClientRect().left : 0\n}\n\n/** Left edge of the handle column of the block `node` rendered as `dom` (the block's own left edge when it has no handle). */\nexport function handleLeftOf(node: Node, dom: HTMLElement, handleWidth: number): number {\n const left = dom.getBoundingClientRect().left\n return hasKindIcon(dom) ? left : left - handleWidth - gutterShiftOf(node, dom)\n}\n\n// The plugin aligns the handle's top with the block's top, which sits above the middle of the block's first text line.\n// This shift puts the handle's centre on the centre of that line, counted from `referenceTop`.\nexport function firstLineCenterShift(dom: HTMLElement, referenceTop: number, handleHeight: number): number {\n const textblock = dom.matches('p, h1, h2, h3, h4, h5, h6, pre')\n ? dom\n : dom.querySelector<HTMLElement>('p, h1, h2, h3, h4, h5, h6, pre')\n if (!textblock) return 0\n const style = getComputedStyle(textblock)\n const lineHeight = Number.parseFloat(style.lineHeight) || Number.parseFloat(style.fontSize) * 1.2\n const lineTop = textblock.getBoundingClientRect().top + Number.parseFloat(style.paddingTop)\n return lineTop - referenceTop + (lineHeight - handleHeight) / 2\n}\n\n/**\n * The blocks that get a permanent handle (`blocks.dragHandle: 'always'`): every block the hover handle can target, at any\n * depth, in document order. Not eligible, like for the hover handle: inline content, composite chrome (it stands for\n * its composite), table rows and cells, content of table headers, list wrappers (their items are), and the first block\n * of a list item (the item is). Blocks with a kind icon have the icon as their handle.\n */\nexport function handleBlocksOf(view: EditorView): { node: Node, pos: number, dom: HTMLElement }[] {\n const blocks: { node: Node, pos: number, dom: HTMLElement }[] = []\n view.state.doc.descendants((node, pos, parent, index) => {\n if (node.isInline || isChromeNode(node)) return false\n const dom = view.nodeDOM(pos)\n if (!(dom instanceof HTMLElement)) return\n const structural = TABLE_STRUCTURE.includes(node.type.name)\n || (parent !== null && parent.type.name === 'tableHeader')\n || (node.firstChild !== null && LIST_ITEMS.includes(node.firstChild.type.name))\n || (index === 0 && parent !== null && LIST_ITEMS.includes(parent.type.name))\n if (!structural && !hasKindIcon(dom)) blocks.push({ node, pos, dom })\n })\n return blocks\n}\n"],"mappings":";;AAUA,MAAM,aAAa,CAAC,YAAY,UAAU;AAC1C,MAAM,kBAAkB;CAAC;CAAY;CAAa;AAAa;;AAG/D,SAAgB,YAAY,KAA2B;CACrD,OAAO,IAAI,cAAc,6BAA6B,MAAM;AAC9D;AAKA,SAAgB,cAAc,MAAY,KAA0B;CAClE,MAAM,OAAO,KAAK,KAAK,SAAS,aAAa,IAAI,gBAAgB;CACjE,OAAO,OAAO,IAAI,sBAAsB,CAAC,CAAC,OAAO,KAAK,sBAAsB,CAAC,CAAC,OAAO;AACvF;;AAGA,SAAgB,aAAa,MAAY,KAAkB,aAA6B;CACtF,MAAM,OAAO,IAAI,sBAAsB,CAAC,CAAC;CACzC,OAAO,YAAY,GAAG,IAAI,OAAO,OAAO,cAAc,cAAc,MAAM,GAAG;AAC/E;AAIA,SAAgB,qBAAqB,KAAkB,cAAsB,cAA8B;CACzG,MAAM,YAAY,IAAI,QAAQ,gCAAgC,IAC1D,MACA,IAAI,cAA2B,gCAAgC;CACnE,IAAI,CAAC,WAAW,OAAO;CACvB,MAAM,QAAQ,iBAAiB,SAAS;CACxC,MAAM,aAAa,OAAO,WAAW,MAAM,UAAU,KAAK,OAAO,WAAW,MAAM,QAAQ,IAAI;CAE9F,OADgB,UAAU,sBAAsB,CAAC,CAAC,MAAM,OAAO,WAAW,MAAM,UAAU,IACzE,gBAAgB,aAAa,gBAAgB;AAChE;;;;;;;AAQA,SAAgB,eAAe,MAAmE;CAChG,MAAM,SAA0D,CAAC;CACjE,KAAK,MAAM,IAAI,aAAa,MAAM,KAAK,QAAQ,UAAU;EACvD,IAAI,KAAK,YAAY,aAAa,IAAI,GAAG,OAAO;EAChD,MAAM,MAAM,KAAK,QAAQ,GAAG;EAC5B,IAAI,EAAE,eAAe,cAAc;EAKnC,IAAI,EAJe,gBAAgB,SAAS,KAAK,KAAK,IAAI,KACpD,WAAW,QAAQ,OAAO,KAAK,SAAS,iBACxC,KAAK,eAAe,QAAQ,WAAW,SAAS,KAAK,WAAW,KAAK,IAAI,KACzE,UAAU,KAAK,WAAW,QAAQ,WAAW,SAAS,OAAO,KAAK,IAAI,MACzD,CAAC,YAAY,GAAG,GAAG,OAAO,KAAK;GAAE;GAAM;GAAK;EAAI,CAAC;CACtE,CAAC;CACD,OAAO;AACT"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { BlockAction, BlockTarget } from "../../../core/extension-points.js";
|
|
2
|
+
import "../../../core/index.js";
|
|
3
|
+
import { Editor } from "@tiptap/core";
|
|
4
|
+
//#region src/features/block-ui/react/BlockActionsOverlay.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* The hover actions of a block, right-aligned at the editor's text column (the drag handle sits on the block's left and
|
|
7
|
+
* targets the same block). Positioned absolutely inside `host`, a `relative` element around the editor; the composite
|
|
8
|
+
* chrome (title, description, tags) addresses the composite (`effectiveTarget`). The bar is hidden while the editor is
|
|
9
|
+
* read-only. `menu` actions open a dropdown of their items instead of running on click.
|
|
10
|
+
*/
|
|
11
|
+
export declare function BlockActionsOverlay({ editor, target, actions, host, onHover }: {
|
|
12
|
+
editor: Editor;
|
|
13
|
+
target: BlockTarget | null;
|
|
14
|
+
actions: readonly BlockAction[];
|
|
15
|
+
host: HTMLElement | null;
|
|
16
|
+
onHover: (hovered: boolean) => void;
|
|
17
|
+
}): import("react").JSX.Element | null;
|
|
18
|
+
//#endregion
|
|
19
|
+
//# sourceMappingURL=BlockActionsOverlay.d.ts.map
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { Icon } from "../../../react/Icon.js";
|
|
2
|
+
import { Button } from "../../../react/ui/button.js";
|
|
3
|
+
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "../../../react/ui/tooltip.js";
|
|
4
|
+
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger } from "../../../react/ui/dropdown-menu.js";
|
|
5
|
+
import { blockActionsFor, effectiveTarget } from "../block-actions.js";
|
|
6
|
+
import { useEffect, useLayoutEffect, useReducer, useRef, useState } from "react";
|
|
7
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
//#region src/features/block-ui/react/BlockActionsOverlay.tsx
|
|
9
|
+
/** Gap between the bar and the editor's right edge. */
|
|
10
|
+
const EDGE_GUTTER = 8;
|
|
11
|
+
/**
|
|
12
|
+
* The hover actions of a block, right-aligned at the editor's text column (the drag handle sits on the block's left and
|
|
13
|
+
* targets the same block). Positioned absolutely inside `host`, a `relative` element around the editor; the composite
|
|
14
|
+
* chrome (title, description, tags) addresses the composite (`effectiveTarget`). The bar is hidden while the editor is
|
|
15
|
+
* read-only. `menu` actions open a dropdown of their items instead of running on click.
|
|
16
|
+
*/
|
|
17
|
+
function BlockActionsOverlay({ editor, target, actions, host, onHover }) {
|
|
18
|
+
const [, rerender] = useReducer((count) => count + 1, 0);
|
|
19
|
+
useEffect(() => {
|
|
20
|
+
editor.on("transaction", rerender);
|
|
21
|
+
return () => {
|
|
22
|
+
editor.off("transaction", rerender);
|
|
23
|
+
};
|
|
24
|
+
}, [editor]);
|
|
25
|
+
const block = (() => {
|
|
26
|
+
if (!target || editor.isDestroyed) return null;
|
|
27
|
+
const { doc } = editor.state;
|
|
28
|
+
if (target.pos < 0 || target.pos >= doc.content.size) return null;
|
|
29
|
+
const node = doc.nodeAt(target.pos);
|
|
30
|
+
if (!node || node.type !== target.node.type) return null;
|
|
31
|
+
return effectiveTarget(editor, {
|
|
32
|
+
node,
|
|
33
|
+
pos: target.pos
|
|
34
|
+
});
|
|
35
|
+
})();
|
|
36
|
+
const items = block && editor.isEditable ? blockActionsFor(editor, block, actions) : [];
|
|
37
|
+
const [place, setPlace] = useState(null);
|
|
38
|
+
const measure = () => {
|
|
39
|
+
const dom = block && host && !editor.isDestroyed ? editor.view.nodeDOM(block.pos) : null;
|
|
40
|
+
if (!(dom instanceof HTMLElement) || !host) {
|
|
41
|
+
setPlace(null);
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
const hostRect = host.getBoundingClientRect();
|
|
45
|
+
const top = dom.getBoundingClientRect().top - hostRect.top + 2;
|
|
46
|
+
const right = hostRect.right - editor.view.dom.getBoundingClientRect().right + EDGE_GUTTER;
|
|
47
|
+
setPlace((previous) => previous && previous.top === top && previous.right === right ? previous : {
|
|
48
|
+
top,
|
|
49
|
+
right
|
|
50
|
+
});
|
|
51
|
+
};
|
|
52
|
+
useLayoutEffect(measure);
|
|
53
|
+
const visible = editor.isEditable && items.length > 0 && place !== null;
|
|
54
|
+
const latestMeasure = useRef(measure);
|
|
55
|
+
latestMeasure.current = measure;
|
|
56
|
+
useEffect(() => {
|
|
57
|
+
const run = () => latestMeasure.current();
|
|
58
|
+
window.addEventListener("resize", run);
|
|
59
|
+
window.addEventListener("scroll", run, true);
|
|
60
|
+
const resizeObserver = new ResizeObserver(run);
|
|
61
|
+
resizeObserver.observe(editor.view.dom);
|
|
62
|
+
return () => {
|
|
63
|
+
window.removeEventListener("resize", run);
|
|
64
|
+
window.removeEventListener("scroll", run, true);
|
|
65
|
+
resizeObserver.disconnect();
|
|
66
|
+
};
|
|
67
|
+
}, [editor]);
|
|
68
|
+
const root = useRef(null);
|
|
69
|
+
const menuOpen = useRef(false);
|
|
70
|
+
const onMenuOpenChange = (open) => {
|
|
71
|
+
menuOpen.current = open;
|
|
72
|
+
onHover(open || !!root.current?.matches(":hover"));
|
|
73
|
+
};
|
|
74
|
+
const wasVisible = useRef(false);
|
|
75
|
+
useEffect(() => {
|
|
76
|
+
if (wasVisible.current && !visible) {
|
|
77
|
+
menuOpen.current = false;
|
|
78
|
+
onHover(false);
|
|
79
|
+
}
|
|
80
|
+
wasVisible.current = visible;
|
|
81
|
+
}, [visible, onHover]);
|
|
82
|
+
if (!visible || !place) return null;
|
|
83
|
+
return /* @__PURE__ */ jsx(TooltipProvider, { children: /* @__PURE__ */ jsx("div", {
|
|
84
|
+
ref: root,
|
|
85
|
+
className: "block-actions absolute z-10 flex gap-0.5 rounded-md border border-border bg-background p-0.5 shadow-sm",
|
|
86
|
+
style: {
|
|
87
|
+
top: `${place.top}px`,
|
|
88
|
+
right: `${place.right}px`
|
|
89
|
+
},
|
|
90
|
+
onMouseEnter: () => onHover(true),
|
|
91
|
+
onMouseLeave: () => {
|
|
92
|
+
if (!menuOpen.current) onHover(false);
|
|
93
|
+
},
|
|
94
|
+
children: items.map((entry) => {
|
|
95
|
+
const button = /* @__PURE__ */ jsx(Button, {
|
|
96
|
+
variant: "ghost",
|
|
97
|
+
size: "icon-xs",
|
|
98
|
+
"aria-label": entry.action.label,
|
|
99
|
+
onMouseDown: (event) => event.preventDefault(),
|
|
100
|
+
onClick: entry.menu ? void 0 : () => entry.action.run?.(entry.ctx),
|
|
101
|
+
children: /* @__PURE__ */ jsx(Icon, { name: entry.action.icon })
|
|
102
|
+
});
|
|
103
|
+
if (!entry.menu) return /* @__PURE__ */ jsxs(Tooltip, { children: [/* @__PURE__ */ jsx(TooltipTrigger, {
|
|
104
|
+
asChild: true,
|
|
105
|
+
children: button
|
|
106
|
+
}), /* @__PURE__ */ jsx(TooltipContent, { children: entry.action.label })] }, entry.action.id);
|
|
107
|
+
return /* @__PURE__ */ jsxs(DropdownMenu, {
|
|
108
|
+
onOpenChange: onMenuOpenChange,
|
|
109
|
+
children: [/* @__PURE__ */ jsxs(Tooltip, { children: [/* @__PURE__ */ jsx(TooltipTrigger, {
|
|
110
|
+
asChild: true,
|
|
111
|
+
children: /* @__PURE__ */ jsx(DropdownMenuTrigger, {
|
|
112
|
+
asChild: true,
|
|
113
|
+
children: button
|
|
114
|
+
})
|
|
115
|
+
}), /* @__PURE__ */ jsx(TooltipContent, { children: entry.action.label })] }), /* @__PURE__ */ jsx(DropdownMenuContent, {
|
|
116
|
+
align: "end",
|
|
117
|
+
children: entry.menu.map((item, index) => /* @__PURE__ */ jsx(MenuRow, { item }, index))
|
|
118
|
+
})]
|
|
119
|
+
}, entry.action.id);
|
|
120
|
+
})
|
|
121
|
+
}) });
|
|
122
|
+
}
|
|
123
|
+
function MenuRow({ item }) {
|
|
124
|
+
if (item.type === "label") return /* @__PURE__ */ jsx(DropdownMenuLabel, { children: item.label });
|
|
125
|
+
if (item.type === "separator") return /* @__PURE__ */ jsx(DropdownMenuSeparator, {});
|
|
126
|
+
return /* @__PURE__ */ jsxs(DropdownMenuItem, {
|
|
127
|
+
disabled: item.disabled,
|
|
128
|
+
onSelect: () => item.onSelect?.(),
|
|
129
|
+
children: [
|
|
130
|
+
item.icon && /* @__PURE__ */ jsx(Icon, { name: item.icon }),
|
|
131
|
+
/* @__PURE__ */ jsx("span", { children: item.label }),
|
|
132
|
+
item.description && /* @__PURE__ */ jsx("span", {
|
|
133
|
+
className: "ml-auto text-xs text-muted-foreground",
|
|
134
|
+
children: item.description
|
|
135
|
+
})
|
|
136
|
+
]
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
//#endregion
|
|
140
|
+
export { BlockActionsOverlay };
|
|
141
|
+
|
|
142
|
+
//# sourceMappingURL=BlockActionsOverlay.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BlockActionsOverlay.js","names":[],"sources":["../../../../src/features/block-ui/react/BlockActionsOverlay.tsx"],"sourcesContent":["import type { Editor } from '@tiptap/core'\nimport { useEffect, useLayoutEffect, useReducer, useRef, useState } from 'react'\nimport type { BlockAction, BlockTarget, MenuItem } from '../../../core'\nimport { Icon } from '../../../react/Icon'\nimport { Button } from '../../../react/ui/button'\nimport { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger } from '../../../react/ui/dropdown-menu'\nimport { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '../../../react/ui/tooltip'\nimport { blockActionsFor, effectiveTarget } from '../block-actions'\n\n/** Gap between the bar and the editor's right edge. */\nconst EDGE_GUTTER = 8\n\n/**\n * The hover actions of a block, right-aligned at the editor's text column (the drag handle sits on the block's left and\n * targets the same block). Positioned absolutely inside `host`, a `relative` element around the editor; the composite\n * chrome (title, description, tags) addresses the composite (`effectiveTarget`). The bar is hidden while the editor is\n * read-only. `menu` actions open a dropdown of their items instead of running on click.\n */\nexport function BlockActionsOverlay({ editor, target, actions, host, onHover }: {\n editor: Editor\n target: BlockTarget | null\n actions: readonly BlockAction[]\n host: HTMLElement | null\n onHover: (hovered: boolean) => void\n}) {\n // The document and `isEditable` change with transactions (`setEditable` dispatches one too): render on each.\n const [, rerender] = useReducer((count: number) => count + 1, 0)\n useEffect(() => {\n editor.on('transaction', rerender)\n return () => { editor.off('transaction', rerender) }\n }, [editor])\n\n // The target in the current document; null once its position holds something else (deleted, replaced).\n const block = ((): BlockTarget | null => {\n if (!target || editor.isDestroyed) return null\n const { doc } = editor.state\n if (target.pos < 0 || target.pos >= doc.content.size) return null\n const node = doc.nodeAt(target.pos)\n if (!node || node.type !== target.node.type) return null\n return effectiveTarget(editor, { node, pos: target.pos })\n })()\n const items = block && editor.isEditable ? blockActionsFor(editor, block, actions) : []\n\n const [place, setPlace] = useState<{ top: number, right: number } | null>(null)\n const measure = () => {\n const dom = block && host && !editor.isDestroyed ? editor.view.nodeDOM(block.pos) : null\n if (!(dom instanceof HTMLElement) || !host) {\n setPlace(null)\n return\n }\n const hostRect = host.getBoundingClientRect()\n const rect = dom.getBoundingClientRect()\n const top = rect.top - hostRect.top + 2\n const right = hostRect.right - editor.view.dom.getBoundingClientRect().right + EDGE_GUTTER\n setPlace(previous => (previous && previous.top === top && previous.right === right ? previous : { top, right }))\n }\n // After every render: the block, the document or the layout may have moved it. Equal positions bail out of the state update.\n useLayoutEffect(measure)\n\n const visible = editor.isEditable && items.length > 0 && place !== null\n\n // The bar follows the editor's right edge when the column resizes without the window doing so.\n const latestMeasure = useRef(measure)\n latestMeasure.current = measure\n useEffect(() => {\n const run = () => latestMeasure.current()\n window.addEventListener('resize', run)\n window.addEventListener('scroll', run, true)\n const resizeObserver = new ResizeObserver(run)\n resizeObserver.observe(editor.view.dom)\n return () => {\n window.removeEventListener('resize', run)\n window.removeEventListener('scroll', run, true)\n resizeObserver.disconnect()\n }\n }, [editor])\n\n // An open action menu is rendered outside the overlay (portal): the overlay counts as hovered until the menu closes.\n const root = useRef<HTMLDivElement>(null)\n const menuOpen = useRef(false)\n const onMenuOpenChange = (open: boolean) => {\n menuOpen.current = open\n onHover(open || !!root.current?.matches(':hover'))\n }\n\n // A vanishing overlay sends no mouseleave: report it, so the host does not keep waiting for one.\n const wasVisible = useRef(false)\n useEffect(() => {\n if (wasVisible.current && !visible) {\n menuOpen.current = false\n onHover(false)\n }\n wasVisible.current = visible\n }, [visible, onHover])\n\n if (!visible || !place) return null\n return (\n <TooltipProvider>\n <div\n ref={root}\n className=\"block-actions absolute z-10 flex gap-0.5 rounded-md border border-border bg-background p-0.5 shadow-sm\"\n style={{ top: `${place.top}px`, right: `${place.right}px` }}\n onMouseEnter={() => onHover(true)}\n onMouseLeave={() => { if (!menuOpen.current) onHover(false) }}\n >\n {items.map((entry) => {\n const button = (\n <Button\n variant=\"ghost\"\n size=\"icon-xs\"\n aria-label={entry.action.label}\n onMouseDown={event => event.preventDefault()}\n onClick={entry.menu ? undefined : () => entry.action.run?.(entry.ctx)}\n >\n <Icon name={entry.action.icon} />\n </Button>\n )\n if (!entry.menu) {\n return (\n <Tooltip key={entry.action.id}>\n <TooltipTrigger asChild>{button}</TooltipTrigger>\n <TooltipContent>{entry.action.label}</TooltipContent>\n </Tooltip>\n )\n }\n return (\n <DropdownMenu key={entry.action.id} onOpenChange={onMenuOpenChange}>\n <Tooltip>\n <TooltipTrigger asChild>\n <DropdownMenuTrigger asChild>{button}</DropdownMenuTrigger>\n </TooltipTrigger>\n <TooltipContent>{entry.action.label}</TooltipContent>\n </Tooltip>\n <DropdownMenuContent align=\"end\">\n {entry.menu.map((item, index) => <MenuRow key={index} item={item} />)}\n </DropdownMenuContent>\n </DropdownMenu>\n )\n })}\n </div>\n </TooltipProvider>\n )\n}\n\nfunction MenuRow({ item }: { item: MenuItem }) {\n if (item.type === 'label') return <DropdownMenuLabel>{item.label}</DropdownMenuLabel>\n if (item.type === 'separator') return <DropdownMenuSeparator />\n return (\n <DropdownMenuItem disabled={item.disabled} onSelect={() => item.onSelect?.()}>\n {item.icon && <Icon name={item.icon} />}\n <span>{item.label}</span>\n {item.description && <span className=\"ml-auto text-xs text-muted-foreground\">{item.description}</span>}\n </DropdownMenuItem>\n )\n}\n"],"mappings":"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"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Editor } from "@tiptap/core";
|
|
2
|
+
//#region src/features/block-ui/react/BlockHandles.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* The permanent drag handles (`blocks.dragHandle: 'always'`): one handle per block that the hover handle can target
|
|
5
|
+
* (`handleBlocksOf`), each where the hover handle would sit for that block, dragging the block like the hover handle
|
|
6
|
+
* does (`startBlockDrag`). Only blocks within a screen of the viewport get one. A nested block whose handle would cover
|
|
7
|
+
* another handle on the same line (the first block of a quote, say) has none: its container's handle moves it. Hidden
|
|
8
|
+
* while the editor is read-only. Positioned absolutely inside `host`, the `relative` element around the editor.
|
|
9
|
+
*/
|
|
10
|
+
export declare function BlockHandles({ editor, host }: {
|
|
11
|
+
editor: Editor;
|
|
12
|
+
host: HTMLElement;
|
|
13
|
+
}): import("react").JSX.Element;
|
|
14
|
+
//#endregion
|
|
15
|
+
//# sourceMappingURL=BlockHandles.d.ts.map
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { startBlockDrag } from "../../../core/block-drag.js";
|
|
2
|
+
import { cn } from "../../../react/ui/utils.js";
|
|
3
|
+
import { Icon } from "../../../react/Icon.js";
|
|
4
|
+
import { firstLineCenterShift, gutterShiftOf, handleBlocksOf } from "../handle-geometry.js";
|
|
5
|
+
import { useEffect, useState } from "react";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
//#region src/features/block-ui/react/BlockHandles.tsx
|
|
8
|
+
/**
|
|
9
|
+
* The permanent drag handles (`blocks.dragHandle: 'always'`): one handle per block that the hover handle can target
|
|
10
|
+
* (`handleBlocksOf`), each where the hover handle would sit for that block, dragging the block like the hover handle
|
|
11
|
+
* does (`startBlockDrag`). Only blocks within a screen of the viewport get one. A nested block whose handle would cover
|
|
12
|
+
* another handle on the same line (the first block of a quote, say) has none: its container's handle moves it. Hidden
|
|
13
|
+
* while the editor is read-only. Positioned absolutely inside `host`, the `relative` element around the editor.
|
|
14
|
+
*/
|
|
15
|
+
function BlockHandles({ editor, host }) {
|
|
16
|
+
const [handles, setHandles] = useState([]);
|
|
17
|
+
const [dragging, setDragging] = useState(false);
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
let raf = 0;
|
|
20
|
+
let wasEditable = false;
|
|
21
|
+
const schedule = () => {
|
|
22
|
+
if (!raf) raf = requestAnimationFrame(measure);
|
|
23
|
+
};
|
|
24
|
+
function measure() {
|
|
25
|
+
raf = 0;
|
|
26
|
+
wasEditable = !editor.isDestroyed && editor.isEditable;
|
|
27
|
+
if (!wasEditable || !editor.view.dom.getClientRects().length) {
|
|
28
|
+
setHandles((previous) => previous.length ? [] : previous);
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
const hostRect = host.getBoundingClientRect();
|
|
32
|
+
const originX = hostRect.left + host.clientLeft;
|
|
33
|
+
const originY = hostRect.top + host.clientTop;
|
|
34
|
+
const next = [];
|
|
35
|
+
for (const { node, pos, dom } of handleBlocksOf(editor.view)) {
|
|
36
|
+
const rect = dom.getBoundingClientRect();
|
|
37
|
+
if (!rect.height || rect.bottom < -window.innerHeight || rect.top > 2 * window.innerHeight) continue;
|
|
38
|
+
const left = rect.left - 24 - gutterShiftOf(node, dom) - originX;
|
|
39
|
+
const top = rect.top + firstLineCenterShift(dom, rect.top, 24) - originY;
|
|
40
|
+
if (!next.some((other) => Math.abs(top - other.top) < 12 && left < other.left + 24 && other.left < left + 24)) next.push({
|
|
41
|
+
pos,
|
|
42
|
+
left,
|
|
43
|
+
top
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
setHandles((previous) => {
|
|
47
|
+
return previous.length !== next.length || next.some((handle, index) => {
|
|
48
|
+
const before = previous[index];
|
|
49
|
+
return !before || handle.pos !== before.pos || handle.left !== before.left || handle.top !== before.top;
|
|
50
|
+
}) ? next : previous;
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
const onTransaction = ({ transaction }) => {
|
|
54
|
+
if (transaction.docChanged || editor.isEditable !== wasEditable) schedule();
|
|
55
|
+
};
|
|
56
|
+
editor.on("transaction", onTransaction);
|
|
57
|
+
window.addEventListener("resize", schedule);
|
|
58
|
+
window.addEventListener("scroll", schedule, true);
|
|
59
|
+
const resizeObserver = new ResizeObserver(schedule);
|
|
60
|
+
resizeObserver.observe(editor.view.dom);
|
|
61
|
+
schedule();
|
|
62
|
+
return () => {
|
|
63
|
+
editor.off("transaction", onTransaction);
|
|
64
|
+
window.removeEventListener("resize", schedule);
|
|
65
|
+
window.removeEventListener("scroll", schedule, true);
|
|
66
|
+
resizeObserver.disconnect();
|
|
67
|
+
if (raf) cancelAnimationFrame(raf);
|
|
68
|
+
};
|
|
69
|
+
}, [editor, host]);
|
|
70
|
+
function onDragStart(event, pos) {
|
|
71
|
+
if (!startBlockDrag(editor, event.nativeEvent, pos)) {
|
|
72
|
+
event.preventDefault();
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
setTimeout(() => setDragging(true));
|
|
76
|
+
const abort = new AbortController();
|
|
77
|
+
const end = () => {
|
|
78
|
+
setDragging(false);
|
|
79
|
+
abort.abort();
|
|
80
|
+
};
|
|
81
|
+
document.addEventListener("drop", end, { signal: abort.signal });
|
|
82
|
+
document.addEventListener("dragend", end, { signal: abort.signal });
|
|
83
|
+
}
|
|
84
|
+
return /* @__PURE__ */ jsx("div", {
|
|
85
|
+
className: "absolute left-0 top-0 z-10 h-0 w-0",
|
|
86
|
+
children: handles.map((handle) => /* @__PURE__ */ jsx("div", {
|
|
87
|
+
draggable: true,
|
|
88
|
+
"aria-hidden": "true",
|
|
89
|
+
className: cn("absolute flex cursor-grab items-center justify-center rounded text-muted-foreground hover:bg-muted hover:text-foreground", dragging ? "pointer-events-none" : "pointer-events-auto"),
|
|
90
|
+
style: {
|
|
91
|
+
left: `${handle.left}px`,
|
|
92
|
+
top: `${handle.top}px`,
|
|
93
|
+
width: `24px`,
|
|
94
|
+
height: `24px`
|
|
95
|
+
},
|
|
96
|
+
onDragStart: (event) => onDragStart(event, handle.pos),
|
|
97
|
+
children: /* @__PURE__ */ jsx(Icon, { name: "i-lucide-grip-vertical" })
|
|
98
|
+
}, handle.pos))
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
//#endregion
|
|
102
|
+
export { BlockHandles };
|
|
103
|
+
|
|
104
|
+
//# sourceMappingURL=BlockHandles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BlockHandles.js","names":[],"sources":["../../../../src/features/block-ui/react/BlockHandles.tsx"],"sourcesContent":["import type { Editor } from '@tiptap/core'\nimport { type DragEvent, useEffect, useState } from 'react'\nimport { startBlockDrag } from '../../../core'\nimport { Icon } from '../../../react/Icon'\nimport { cn } from '../../../react/ui/utils'\nimport { firstLineCenterShift, gutterShiftOf, HANDLE_SIZE, handleBlocksOf } from '../handle-geometry'\n\ninterface Handle { pos: number, left: number, top: number }\n\n/**\n * The permanent drag handles (`blocks.dragHandle: 'always'`): one handle per block that the hover handle can target\n * (`handleBlocksOf`), each where the hover handle would sit for that block, dragging the block like the hover handle\n * does (`startBlockDrag`). Only blocks within a screen of the viewport get one. A nested block whose handle would cover\n * another handle on the same line (the first block of a quote, say) has none: its container's handle moves it. Hidden\n * while the editor is read-only. Positioned absolutely inside `host`, the `relative` element around the editor.\n */\nexport function BlockHandles({ editor, host }: { editor: Editor, host: HTMLElement }) {\n const [handles, setHandles] = useState<readonly Handle[]>([])\n // While a drag runs the handles let events through, so a drop over a handle's gutter still reaches the editor.\n const [dragging, setDragging] = useState(false)\n\n useEffect(() => {\n let raf = 0\n let wasEditable = false\n const schedule = () => {\n if (!raf) raf = requestAnimationFrame(measure)\n }\n\n function measure() {\n raf = 0\n wasEditable = !editor.isDestroyed && editor.isEditable\n if (!wasEditable || !editor.view.dom.getClientRects().length) {\n setHandles(previous => (previous.length ? [] : previous))\n return\n }\n const hostRect = host.getBoundingClientRect()\n const originX = hostRect.left + host.clientLeft\n const originY = hostRect.top + host.clientTop\n const next: Handle[] = []\n for (const { node, pos, dom } of handleBlocksOf(editor.view)) {\n const rect = dom.getBoundingClientRect()\n if (!rect.height || rect.bottom < -window.innerHeight || rect.top > 2 * window.innerHeight) continue\n const left = rect.left - HANDLE_SIZE - gutterShiftOf(node, dom) - originX\n const top = rect.top + firstLineCenterShift(dom, rect.top, HANDLE_SIZE) - originY\n const covered = next.some(other => Math.abs(top - other.top) < HANDLE_SIZE / 2 && left < other.left + HANDLE_SIZE && other.left < left + HANDLE_SIZE)\n if (!covered) next.push({ pos, left, top })\n }\n setHandles((previous) => {\n const changed = previous.length !== next.length || next.some((handle, index) => {\n const before = previous[index]\n return !before || handle.pos !== before.pos || handle.left !== before.left || handle.top !== before.top\n })\n return changed ? next : previous\n })\n }\n\n // Documents change layout through edits, the column through resizes; `EditorSurface` dispatches a transaction after\n // `setEditable`.\n const onTransaction = ({ transaction }: { transaction: { docChanged: boolean } }) => {\n if (transaction.docChanged || editor.isEditable !== wasEditable) schedule()\n }\n editor.on('transaction', onTransaction)\n window.addEventListener('resize', schedule)\n window.addEventListener('scroll', schedule, true)\n const resizeObserver = new ResizeObserver(schedule)\n resizeObserver.observe(editor.view.dom)\n schedule()\n return () => {\n editor.off('transaction', onTransaction)\n window.removeEventListener('resize', schedule)\n window.removeEventListener('scroll', schedule, true)\n resizeObserver.disconnect()\n if (raf) cancelAnimationFrame(raf)\n }\n }, [editor, host])\n\n function onDragStart(event: DragEvent<HTMLDivElement>, pos: number) {\n if (!startBlockDrag(editor, event.nativeEvent, pos)) {\n event.preventDefault()\n return\n }\n // Not inside `dragstart`: changing the source's styles there cancels the drag. The dropped block's handle may be\n // gone afterwards and send no `dragend`, so the document ends the drag.\n setTimeout(() => setDragging(true))\n const abort = new AbortController()\n const end = () => {\n setDragging(false)\n abort.abort()\n }\n document.addEventListener('drop', end, { signal: abort.signal })\n document.addEventListener('dragend', end, { signal: abort.signal })\n }\n\n return (\n <div className=\"absolute left-0 top-0 z-10 h-0 w-0\">\n {handles.map(handle => (\n <div\n key={handle.pos}\n draggable\n aria-hidden=\"true\"\n className={cn('absolute flex cursor-grab items-center justify-center rounded text-muted-foreground hover:bg-muted hover:text-foreground', dragging ? 'pointer-events-none' : 'pointer-events-auto')}\n style={{ left: `${handle.left}px`, top: `${handle.top}px`, width: `${HANDLE_SIZE}px`, height: `${HANDLE_SIZE}px` }}\n onDragStart={event => onDragStart(event, handle.pos)}\n >\n <Icon name=\"i-lucide-grip-vertical\" />\n </div>\n ))}\n </div>\n )\n}\n"],"mappings":"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"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Editor } from "@tiptap/core";
|
|
2
|
+
//#region src/features/block-ui/react/BlockUi.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* Block UI of an editor: the drag handle on the left of the hovered block (hidden while the editor is read-only) and the
|
|
5
|
+
* hover actions (`BlockActionsOverlay`) at the editor's right edge, both targeting the same block. The actions are those
|
|
6
|
+
* the surface registered for `editor` (features' block actions, then the host's). A block with a kind icon (a composite)
|
|
7
|
+
* gets no handle: its icon drags it. With `blocks.dragHandle: 'always'` the hover handle is replaced by permanent
|
|
8
|
+
* handles on every eligible block (`BlockHandles`). Mounted by the block-ui feature beside the editor.
|
|
9
|
+
*/
|
|
10
|
+
export declare function BlockUi({ editor }: {
|
|
11
|
+
editor: Editor;
|
|
12
|
+
}): import("react").JSX.Element;
|
|
13
|
+
//#endregion
|
|
14
|
+
//# sourceMappingURL=BlockUi.d.ts.map
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import { isChromeNode } from "../../../core/schema/node-flags.js";
|
|
2
|
+
import { editorEntryOf } from "../../../core/editor-ui.js";
|
|
3
|
+
import { cn } from "../../../react/ui/utils.js";
|
|
4
|
+
import { Icon } from "../../../react/Icon.js";
|
|
5
|
+
import { useEditorSettings } from "../../../react/settings.js";
|
|
6
|
+
import { firstLineCenterShift, gutterShiftOf, handleLeftOf, hasKindIcon } from "../handle-geometry.js";
|
|
7
|
+
import { BlockActionsOverlay } from "./BlockActionsOverlay.js";
|
|
8
|
+
import { BlockHandles } from "./BlockHandles.js";
|
|
9
|
+
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
10
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
11
|
+
import { DragHandle } from "@tiptap/extension-drag-handle-react";
|
|
12
|
+
import { createPortal } from "react-dom";
|
|
13
|
+
//#region src/features/block-ui/react/BlockUi.tsx
|
|
14
|
+
/**
|
|
15
|
+
* Block UI of an editor: the drag handle on the left of the hovered block (hidden while the editor is read-only) and the
|
|
16
|
+
* hover actions (`BlockActionsOverlay`) at the editor's right edge, both targeting the same block. The actions are those
|
|
17
|
+
* the surface registered for `editor` (features' block actions, then the host's). A block with a kind icon (a composite)
|
|
18
|
+
* gets no handle: its icon drags it. With `blocks.dragHandle: 'always'` the hover handle is replaced by permanent
|
|
19
|
+
* handles on every eligible block (`BlockHandles`). Mounted by the block-ui feature beside the editor.
|
|
20
|
+
*/
|
|
21
|
+
function BlockUi({ editor }) {
|
|
22
|
+
const [host, setHost] = useState(null);
|
|
23
|
+
const [hoverTarget, setHoverTarget] = useState(null);
|
|
24
|
+
const [targetHasKindIcon, setTargetHasKindIcon] = useState(false);
|
|
25
|
+
const { settings } = useEditorSettings();
|
|
26
|
+
const actions = editorEntryOf(editor)?.blockActions ?? [];
|
|
27
|
+
const track = useRef({
|
|
28
|
+
overlayHovered: false,
|
|
29
|
+
clearTimer: void 0,
|
|
30
|
+
pointer: null,
|
|
31
|
+
dom: null,
|
|
32
|
+
node: null,
|
|
33
|
+
gutterShift: 0
|
|
34
|
+
}).current;
|
|
35
|
+
const handleContent = useRef(null);
|
|
36
|
+
const handleWidth = () => handleContent.current?.parentElement?.offsetWidth ?? 0;
|
|
37
|
+
const scheduleHoverClear = useCallback(() => {
|
|
38
|
+
clearTimeout(track.clearTimer);
|
|
39
|
+
track.clearTimer = window.setTimeout(() => {
|
|
40
|
+
if (!track.overlayHovered) setHoverTarget(null);
|
|
41
|
+
}, 200);
|
|
42
|
+
}, [track]);
|
|
43
|
+
useEffect(() => {
|
|
44
|
+
if (editor.isDestroyed) return;
|
|
45
|
+
const dom = editor.view.dom;
|
|
46
|
+
setHost(dom.isConnected ? dom.parentElement : null);
|
|
47
|
+
const onKeydown = () => {
|
|
48
|
+
clearTimeout(track.clearTimer);
|
|
49
|
+
setHoverTarget(null);
|
|
50
|
+
};
|
|
51
|
+
const onMousemove = (event) => {
|
|
52
|
+
track.pointer = {
|
|
53
|
+
x: event.clientX,
|
|
54
|
+
y: event.clientY
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
dom.addEventListener("keydown", onKeydown);
|
|
58
|
+
dom.addEventListener("mousemove", onMousemove);
|
|
59
|
+
return () => {
|
|
60
|
+
clearTimeout(track.clearTimer);
|
|
61
|
+
dom.removeEventListener("keydown", onKeydown);
|
|
62
|
+
dom.removeEventListener("mousemove", onMousemove);
|
|
63
|
+
setHost(null);
|
|
64
|
+
};
|
|
65
|
+
}, [editor, track]);
|
|
66
|
+
const onOverlayHover = useCallback((hovered) => {
|
|
67
|
+
track.overlayHovered = hovered;
|
|
68
|
+
if (!hovered) scheduleHoverClear();
|
|
69
|
+
}, [track, scheduleHoverClear]);
|
|
70
|
+
const resetDragHandle = useCallback(() => {
|
|
71
|
+
if (editor.isDestroyed) return;
|
|
72
|
+
editor.view.dispatch(editor.state.tr.setMeta("hideDragHandle", true).setMeta("addToHistory", false));
|
|
73
|
+
}, [editor]);
|
|
74
|
+
const alwaysHandles = settings.blocks.dragHandle === "always";
|
|
75
|
+
const hoverHandleHidden = alwaysHandles || targetHasKindIcon;
|
|
76
|
+
const trackDragTarget = useCallback(({ node, pos }) => {
|
|
77
|
+
if (node) {
|
|
78
|
+
clearTimeout(track.clearTimer);
|
|
79
|
+
setHoverTarget({
|
|
80
|
+
node,
|
|
81
|
+
pos
|
|
82
|
+
});
|
|
83
|
+
} else scheduleHoverClear();
|
|
84
|
+
const dom = node ? editor.view.nodeDOM(pos) : null;
|
|
85
|
+
track.dom = dom instanceof HTMLElement ? dom : null;
|
|
86
|
+
track.node = track.dom ? node : null;
|
|
87
|
+
track.gutterShift = track.dom && track.node ? gutterShiftOf(track.node, track.dom) : 0;
|
|
88
|
+
setTargetHasKindIcon(track.dom ? hasKindIcon(track.dom) : false);
|
|
89
|
+
}, [
|
|
90
|
+
editor,
|
|
91
|
+
track,
|
|
92
|
+
scheduleHoverClear
|
|
93
|
+
]);
|
|
94
|
+
const dragHandlePosition = useMemo(() => ({ middleware: [{
|
|
95
|
+
name: "gutterShift",
|
|
96
|
+
fn: ({ x, y }) => ({
|
|
97
|
+
x: x - track.gutterShift,
|
|
98
|
+
y
|
|
99
|
+
})
|
|
100
|
+
}, {
|
|
101
|
+
name: "firstLineCenter",
|
|
102
|
+
fn: ({ x, y, elements, rects }) => ({
|
|
103
|
+
x,
|
|
104
|
+
y: track.dom ? y + firstLineCenterShift(track.dom, elements.reference.getBoundingClientRect().top, rects.floating.height) : y
|
|
105
|
+
})
|
|
106
|
+
}] }), [track]);
|
|
107
|
+
const dragHandleNested = useMemo(() => {
|
|
108
|
+
const pointerReachesTarget = () => {
|
|
109
|
+
const { pointer, node, dom } = track;
|
|
110
|
+
if (!pointer || !node || !dom?.isConnected) return false;
|
|
111
|
+
const rect = dom.getBoundingClientRect();
|
|
112
|
+
const { x, y } = pointer;
|
|
113
|
+
if (x < handleLeftOf(node, dom, handleWidth()) || x >= rect.right) return false;
|
|
114
|
+
if (y < (laidOutSibling(dom, "previous")?.bottom ?? rect.top)) return false;
|
|
115
|
+
if (y >= (laidOutSibling(dom, "next")?.top ?? rect.bottom)) return false;
|
|
116
|
+
return x < rect.left || y < rect.top || y >= rect.bottom;
|
|
117
|
+
};
|
|
118
|
+
return {
|
|
119
|
+
edgeDetection: "none",
|
|
120
|
+
rules: [
|
|
121
|
+
{
|
|
122
|
+
id: "compositeChrome",
|
|
123
|
+
evaluate: ({ node }) => isChromeNode(node) ? 1e3 : 0
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
id: "reachTarget",
|
|
127
|
+
evaluate: () => pointerReachesTarget() ? 1e3 : 0
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
id: "ownGutter",
|
|
131
|
+
evaluate: ({ node, pos, depth, view }) => {
|
|
132
|
+
const { pointer } = track;
|
|
133
|
+
if (depth < 2 || !pointer) return 0;
|
|
134
|
+
const dom = view.nodeDOM(pos);
|
|
135
|
+
return dom instanceof HTMLElement && pointer.x < handleLeftOf(node, dom, handleWidth()) ? 1e3 : 0;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
]
|
|
139
|
+
};
|
|
140
|
+
}, [track]);
|
|
141
|
+
return /* @__PURE__ */ jsxs(Fragment$1, { children: [host && createPortal(/* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(BlockActionsOverlay, {
|
|
142
|
+
editor,
|
|
143
|
+
target: hoverTarget,
|
|
144
|
+
host,
|
|
145
|
+
actions,
|
|
146
|
+
onHover: onOverlayHover
|
|
147
|
+
}), alwaysHandles && /* @__PURE__ */ jsx(BlockHandles, {
|
|
148
|
+
editor,
|
|
149
|
+
host
|
|
150
|
+
})] }), host), /* @__PURE__ */ jsx(DragHandle, {
|
|
151
|
+
editor,
|
|
152
|
+
onElementDragEnd: resetDragHandle,
|
|
153
|
+
onNodeChange: trackDragTarget,
|
|
154
|
+
computePositionConfig: dragHandlePosition,
|
|
155
|
+
nested: dragHandleNested,
|
|
156
|
+
className: cn("flex size-6 cursor-grab items-center justify-center rounded text-muted-foreground hover:bg-muted hover:text-foreground data-[dragging=true]:cursor-grabbing", hoverHandleHidden && "invisible! pointer-events-none!"),
|
|
157
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
158
|
+
ref: handleContent,
|
|
159
|
+
className: "contents",
|
|
160
|
+
children: /* @__PURE__ */ jsx(Icon, { name: "i-lucide-grip-vertical" })
|
|
161
|
+
})
|
|
162
|
+
})] });
|
|
163
|
+
}
|
|
164
|
+
function laidOutSibling(dom, side) {
|
|
165
|
+
for (let element = dom[`${side}ElementSibling`]; element; element = element[`${side}ElementSibling`]) {
|
|
166
|
+
const rect = element.getBoundingClientRect();
|
|
167
|
+
if (rect.height > 0) return rect;
|
|
168
|
+
}
|
|
169
|
+
return null;
|
|
170
|
+
}
|
|
171
|
+
//#endregion
|
|
172
|
+
export { BlockUi };
|
|
173
|
+
|
|
174
|
+
//# sourceMappingURL=BlockUi.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BlockUi.js","names":[],"sources":["../../../../src/features/block-ui/react/BlockUi.tsx"],"sourcesContent":["import type { Editor } from '@tiptap/core'\nimport { DragHandle, type DragHandleProps } from '@tiptap/extension-drag-handle-react'\nimport type { Node } from '@tiptap/pm/model'\nimport { useCallback, useEffect, useMemo, useRef, useState } from 'react'\nimport { createPortal } from 'react-dom'\nimport { type BlockTarget, editorEntryOf } from '../../../core'\nimport { isChromeNode } from '../../../core/schema'\nimport { Icon } from '../../../react/Icon'\nimport { useEditorSettings } from '../../../react/settings'\nimport { cn } from '../../../react/ui/utils'\nimport { firstLineCenterShift, gutterShiftOf, handleLeftOf, hasKindIcon } from '../handle-geometry'\nimport { BlockActionsOverlay } from './BlockActionsOverlay'\nimport { BlockHandles } from './BlockHandles'\n\n/**\n * Block UI of an editor: the drag handle on the left of the hovered block (hidden while the editor is read-only) and the\n * hover actions (`BlockActionsOverlay`) at the editor's right edge, both targeting the same block. The actions are those\n * the surface registered for `editor` (features' block actions, then the host's). A block with a kind icon (a composite)\n * gets no handle: its icon drags it. With `blocks.dragHandle: 'always'` the hover handle is replaced by permanent\n * handles on every eligible block (`BlockHandles`). Mounted by the block-ui feature beside the editor.\n */\nexport function BlockUi({ editor }: { editor: Editor }) {\n // Hover actions target the drag handle's block. The plugin drops its target when the pointer leaves the editor (also\n // onto the overlay, which sits outside it) and on keydown; a short grace keeps the overlay while the pointer moves\n // onto it, and typing hides it at once.\n const [host, setHost] = useState<HTMLElement | null>(null)\n const [hoverTarget, setHoverTarget] = useState<BlockTarget | null>(null)\n const [targetHasKindIcon, setTargetHasKindIcon] = useState(false)\n const { settings } = useEditorSettings()\n // Read while rendering: the surface registers its entry after its overlays have mounted, and the overlay renders\n // again once a block is hovered.\n const actions = editorEntryOf(editor)?.blockActions ?? []\n\n // Everything the plugin callbacks and the targeting rules below read while the pointer moves: not render state.\n const track = useRef({\n overlayHovered: false,\n clearTimer: undefined as number | undefined,\n pointer: null as { x: number, y: number } | null,\n dom: null as HTMLElement | null,\n node: null as Node | null,\n gutterShift: 0,\n }).current\n // The handle's content; its parent is the handle element the plugin positions (`handleWidth`).\n const handleContent = useRef<HTMLSpanElement>(null)\n const handleWidth = () => handleContent.current?.parentElement?.offsetWidth ?? 0\n\n const scheduleHoverClear = useCallback(() => {\n clearTimeout(track.clearTimer)\n track.clearTimer = window.setTimeout(() => {\n if (!track.overlayHovered) setHoverTarget(null)\n }, 200)\n }, [track])\n\n // The overlay is positioned inside the element that holds the editor content (`relative`); Tiptap's content component\n // has moved the editor DOM into it by the time this effect runs.\n useEffect(() => {\n if (editor.isDestroyed) return\n const dom = editor.view.dom\n setHost(dom.isConnected ? dom.parentElement : null)\n // Like the drag-handle plugin: a key pressed in the focused editor hides the actions.\n const onKeydown = () => {\n clearTimeout(track.clearTimer)\n setHoverTarget(null)\n }\n // Pointer position for the targeting rules below. The plugin evaluates them in a frame callback after the\n // mousemove, so this is the position they see.\n const onMousemove = (event: MouseEvent) => {\n track.pointer = { x: event.clientX, y: event.clientY }\n }\n dom.addEventListener('keydown', onKeydown)\n dom.addEventListener('mousemove', onMousemove)\n return () => {\n clearTimeout(track.clearTimer)\n dom.removeEventListener('keydown', onKeydown)\n dom.removeEventListener('mousemove', onMousemove)\n setHost(null)\n }\n }, [editor, track])\n\n const onOverlayHover = useCallback((hovered: boolean) => {\n track.overlayHovered = hovered\n if (!hovered) scheduleHoverClear()\n }, [track, scheduleHoverClear])\n\n // The drag-handle plugin hides the handle on dragend but keeps its current target. A dropped\n // nested node is the same node object, so hovering it again would not re-show the handle.\n // The plugin's `hideDragHandle` meta clears the target.\n const resetDragHandle = useCallback(() => {\n if (editor.isDestroyed) return\n editor.view.dispatch(editor.state.tr.setMeta('hideDragHandle', true).setMeta('addToHistory', false))\n }, [editor])\n\n // The plugin puts the handle's right edge on the target block's left edge (`gutterShiftOf`: list items move further\n // left). The hover handle is hidden where the block has a handle of its own: the kind icon of a composite, or, with\n // `blocks.dragHandle: 'always'`, the permanent handles. Hiding keeps its layout, which the targeting rules below measure.\n const alwaysHandles = settings.blocks.dragHandle === 'always'\n const hoverHandleHidden = alwaysHandles || targetHasKindIcon\n const trackDragTarget = useCallback(({ node, pos }: { node: Node | null, pos: number }) => {\n if (node) {\n clearTimeout(track.clearTimer)\n setHoverTarget({ node, pos })\n }\n else {\n scheduleHoverClear()\n }\n const dom = node ? editor.view.nodeDOM(pos) : null\n track.dom = dom instanceof HTMLElement ? dom : null\n track.node = track.dom ? node : null\n track.gutterShift = track.dom && track.node ? gutterShiftOf(track.node, track.dom) : 0\n setTargetHasKindIcon(track.dom ? hasKindIcon(track.dom) : false)\n }, [editor, track, scheduleHoverClear])\n\n // The plugin re-registers when its configuration changes: both objects below are made once and read `track`.\n const dragHandlePosition = useMemo<DragHandleProps['computePositionConfig']>(() => ({\n // The plugin aligns the handle's top with the block's top, which sits above the middle of the block's first text\n // line: `firstLineCenterShift` moves the handle's centre to that line's centre.\n middleware: [\n { name: 'gutterShift', fn: ({ x, y }) => ({ x: x - track.gutterShift, y }) },\n {\n name: 'firstLineCenter',\n fn: ({ x, y, elements, rects }) => ({\n x,\n y: track.dom ? y + firstLineCenterShift(track.dom, elements.reference.getBoundingClientRect().top, rects.floating.height) : y,\n }),\n },\n ],\n }), [track])\n\n // Targeting among nested blocks. `compositeChrome`: hovering a composite's title, description or tags row targets the\n // composite itself (a deduction of 1000, the base score, excludes a node). `reachTarget`: see `pointerReachesTarget`.\n // `ownGutter`: a nested block is targeted only from its handle column rightwards; further left its ancestors are, so\n // on any row the gutter is partitioned by the handle columns of the blocks nested there. The plugin's edge detection\n // is off: its left strip is this partition, its top strip would hand the handle to the parent on the block's first\n // line, where the handle sits.\n const dragHandleNested = useMemo<DragHandleProps['nested']>(() => {\n // Left of a block, ProseMirror resolves the pointer to the position before the block, so the plugin only considers\n // the block's ancestors there: the target's own handle column would hand the handle to its parent before the pointer\n // reaches it. This keeps the target while the pointer is between its handle and its box, over its whole height\n // including the gaps to its neighbours, and in those gaps themselves (which resolve to the parent as well). The rule\n // then excludes every candidate, and the plugin keeps its target when the detection yields none. Inside the target's\n // own box the rule is off, so its descendants are still targeted.\n const pointerReachesTarget = (): boolean => {\n const { pointer, node, dom } = track\n if (!pointer || !node || !dom?.isConnected) return false\n const rect = dom.getBoundingClientRect()\n const { x, y } = pointer\n if (x < handleLeftOf(node, dom, handleWidth()) || x >= rect.right) return false\n if (y < (laidOutSibling(dom, 'previous')?.bottom ?? rect.top)) return false\n if (y >= (laidOutSibling(dom, 'next')?.top ?? rect.bottom)) return false\n return x < rect.left || y < rect.top || y >= rect.bottom\n }\n return {\n edgeDetection: 'none',\n rules: [\n { id: 'compositeChrome', evaluate: ({ node }) => isChromeNode(node) ? 1000 : 0 },\n { id: 'reachTarget', evaluate: () => pointerReachesTarget() ? 1000 : 0 },\n {\n id: 'ownGutter',\n evaluate: ({ node, pos, depth, view }) => {\n const { pointer } = track\n if (depth < 2 || !pointer) return 0\n const dom = view.nodeDOM(pos)\n return dom instanceof HTMLElement && pointer.x < handleLeftOf(node, dom, handleWidth()) ? 1000 : 0\n },\n },\n ],\n }\n }, [track])\n\n return (\n <>\n {host && createPortal(\n <>\n <BlockActionsOverlay editor={editor} target={hoverTarget} host={host} actions={actions} onHover={onOverlayHover} />\n {alwaysHandles && <BlockHandles editor={editor} host={host} />}\n </>,\n host,\n )}\n <DragHandle\n editor={editor}\n onElementDragEnd={resetDragHandle}\n onNodeChange={trackDragTarget}\n computePositionConfig={dragHandlePosition}\n nested={dragHandleNested}\n className={cn(\n 'flex size-6 cursor-grab items-center justify-center rounded text-muted-foreground hover:bg-muted hover:text-foreground data-[dragging=true]:cursor-grabbing',\n hoverHandleHidden && 'invisible! pointer-events-none!',\n )}\n >\n <span ref={handleContent} className=\"contents\">\n <Icon name=\"i-lucide-grip-vertical\" />\n </span>\n </DragHandle>\n </>\n )\n}\n\n// Nearest sibling with a layout box (a composite's hidden description/tags rows have none).\nfunction laidOutSibling(dom: Element, side: 'previous' | 'next'): DOMRect | null {\n for (let element = dom[`${side}ElementSibling`]; element; element = element[`${side}ElementSibling`]) {\n const rect = element.getBoundingClientRect()\n if (rect.height > 0) return rect\n }\n return null\n}\n"],"mappings":"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"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ReactFeature } from "../../react/EditorSurface.js";
|
|
2
|
+
import "../../react/index.js";
|
|
3
|
+
import { BlockActionsOverlay } from "./react/BlockActionsOverlay.js";
|
|
4
|
+
import { BlockHandles } from "./react/BlockHandles.js";
|
|
5
|
+
import { BlockUi } from "./react/BlockUi.js";
|
|
6
|
+
//#region src/features/block-ui/react.d.ts
|
|
7
|
+
/** The React block-ui feature: the drag handle (`@tiptap/extension-drag-handle-react`), permanent handles and hover actions with shadcn menus. */
|
|
8
|
+
export declare function blockUiFeature(): ReactFeature;
|
|
9
|
+
//#endregion
|
|
10
|
+
export { BlockActionsOverlay, BlockHandles, BlockUi };
|
|
11
|
+
//# sourceMappingURL=react.d.ts.map
|