@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 @@
|
|
|
1
|
+
{"version":3,"file":"DocumentTree.js","names":["buildOutlineItems","isDraggable","isDraggableItem"],"sources":["../../../src/tree/react/DocumentTree.tsx"],"sourcesContent":["import type { Editor } from '@tiptap/core'\nimport { type DragEvent, type KeyboardEvent, type ReactNode, useCallback, useEffect, useMemo, useRef, useState } from 'react'\nimport { toast } from 'sonner'\nimport { compositeJSON, type CompositeKind, compositeKindsOf, moveBlockInto } from '../../features/composites'\nimport { pickFiles } from '../../features/media'\nimport { useFileImport } from '../../features/media/react'\nimport { revealBlockInEditor } from '../../outline'\nimport { Icon } from '../../react/Icon'\nimport { useEditorSettings } from '../../react/settings'\nimport { useEditorI18n } from '../../react/use-editor-i18n'\nimport { useNotifier } from '../../react/use-notifier'\nimport { useStore } from '../../react/use-store'\nimport { Button } from '../../react/ui/button'\nimport { Collapsible, CollapsibleContent } from '../../react/ui/collapsible'\nimport { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger } from '../../react/ui/dropdown-menu'\nimport { Input } from '../../react/ui/input'\nimport { cn } from '../../react/ui/utils'\nimport type { DocumentStore } from '../store'\nimport {\n ancestorKeys,\n applyNodeFilters,\n canDrop,\n collectFolderPaths,\n collectKeys,\n compositeInsertPos,\n DRAG_MIME,\n type DragPayload,\n dragPayloadOf,\n EMPTY_OUTLINE,\n filterKinds,\n folderItem,\n folderNamesIn,\n holdsComposites,\n isDraggable as isDraggableItem,\n joinPath,\n type Outline,\n outlineItems as buildOutlineItems,\n parentPath,\n readOutline,\n type TreeItem,\n VIRTUAL_ROOT,\n virtualRootItem,\n} from '../tree-items'\nimport { remapFolderPath } from '../folder-paths'\nimport { useTreeView } from './use-tree-view'\n\n// File browser of a document store: a „Dokumente“ root with folders and documents. Every `store` method reports its own\n// failure before it rejects, so the `.catch(() => undefined)`s below only stop the flow.\n\n/** Props of `DocumentTree`. */\nexport interface DocumentTreeProps {\n /** Where documents and folders live; the host implements it (see `DocumentStore`). */\n store: DocumentStore\n /** Editor of the open document (its outline is listed under the document); `undefined` while none is mounted. */\n editor: Editor | undefined\n /** The folder new documents, folders and host imports go to (controlled). Omit it to let the tree keep it. Reset to `''` when it is deleted or moved away. */\n selectedFolder?: string\n onSelectedFolderChange?: (folder: string) => void\n /** Host actions on a document row, rendered next to its delete button (e.g. a download link). */\n documentActions?: (document: { id: string, title: string }) => ReactNode\n className?: string\n}\n\ninterface Renaming {\n item: TreeItem\n draft: string\n}\n\ninterface CreatingFolder {\n /** Folder path the folder being named is created in. */\n parent: string\n draft: string\n}\n\nconst OUTLINE_DEBOUNCE_MS = 150\nconst EMPTY_DOCUMENTS: readonly never[] = []\nconst EMPTY_KINDS: readonly CompositeKind[] = []\nconst REVEAL_ON_HOVER = 'opacity-0 transition-opacity group-hover:opacity-100 group-focus-within:opacity-100 data-[state=open]:opacity-100'\nconst isOutlineItem = (item: TreeItem) => item.type === 'composite' || item.type === 'heading'\n\n/** The file browser of a document store: folders and documents with their drag and drop, the open document's outline below it. */\nexport function DocumentTree({ store, editor, selectedFolder: controlledFolder, onSelectedFolderChange, documentActions, className }: DocumentTreeProps) {\n const { t } = useEditorI18n()\n const { nodeFilters, expanded, model } = useTreeView()\n const { settings } = useEditorSettings()\n const { importFiles } = useFileImport(editor)\n const notify = useNotifier(editor)\n const tree = useStore(store.tree)\n const documents = useStore(store.documents) ?? EMPTY_DOCUMENTS\n const activeId = useStore(store.activeId)\n const structure = settings.blocks.structure\n const virtual = settings.blocks.treeRoot === 'file' && structure === 'composite' && !!editor\n\n const treeElement = useRef<HTMLUListElement>(null)\n\n // --- selected folder (controlled or kept here) -----------------------------------------------------------------\n\n const [ownFolder, setOwnFolder] = useState('')\n const selectedFolder = controlledFolder ?? ownFolder\n const selectedFolderRef = useRef(selectedFolder)\n selectedFolderRef.current = selectedFolder\n const onSelectedFolderChangeRef = useRef(onSelectedFolderChange)\n onSelectedFolderChangeRef.current = onSelectedFolderChange\n const setSelectedFolder = useCallback((folder: string) => {\n selectedFolderRef.current = folder\n setOwnFolder(folder)\n onSelectedFolderChangeRef.current?.(folder)\n }, [])\n\n // --- view state ------------------------------------------------------------------------------------------------\n\n /** Virtual mode: block ID of the selected `folder`/`document` composite; `null` = the document itself. */\n const [virtualTarget, setVirtualTarget] = useState<string | null>(null)\n // Outline entries start open: only the ones the user closed are remembered (session only), the rest of the open state\n // is the shared `expanded` list.\n const [collapsedOutline, setCollapsedOutline] = useState<string[]>([])\n const [dropKey, setDropKey] = useState<string | null>(null)\n const dragging = useRef<DragPayload | null>(null)\n const [removing, setRemoving] = useState<string | null>(null)\n\n const [renaming, setRenamingState] = useState<Renaming | null>(null)\n const renamingRef = useRef<Renaming | null>(null)\n const setRenaming = (next: Renaming | null) => {\n renamingRef.current = next\n setRenamingState(next)\n }\n const [creatingFolder, setCreatingFolderState] = useState<CreatingFolder | null>(null)\n const creatingFolderRef = useRef<CreatingFolder | null>(null)\n const setCreatingFolder = (next: CreatingFolder | null) => {\n creatingFolderRef.current = next\n setCreatingFolderState(next)\n }\n\n // --- outline of the open document ------------------------------------------------------------------------------\n\n const kinds = useMemo(() => (editor ? compositeKindsOf(editor) : EMPTY_KINDS), [editor])\n\n // Read from the editor on demand and refreshed, debounced, when the document changes.\n const [outline, setOutline] = useState<Outline>(EMPTY_OUTLINE)\n useEffect(() => {\n setOutline(readOutline(editor, structure, t))\n if (!editor) return\n let timer: ReturnType<typeof setTimeout> | undefined\n const onUpdate = () => {\n clearTimeout(timer)\n timer = setTimeout(() => setOutline(readOutline(editor, structure, t)), OUTLINE_DEBOUNCE_MS)\n }\n editor.on('update', onUpdate)\n return () => {\n clearTimeout(timer)\n editor.off('update', onUpdate)\n }\n }, [editor, structure, t])\n\n // --- expansion -------------------------------------------------------------------------------------------------\n\n const activeFolder = documents.find(d => d.id === activeId)?.folder\n\n useEffect(() => {\n if (virtual) model.expand([VIRTUAL_ROOT])\n }, [virtual, model])\n\n // Opening a document (also by URL, or after a move) shows it: its folders open and its folder becomes the selected one.\n useEffect(() => {\n model.expand(ancestorKeys(activeFolder ?? ''))\n if (activeFolder !== undefined) setSelectedFolder(activeFolder)\n }, [activeFolder, model, setSelectedFolder])\n\n // The open document shows its outline.\n useEffect(() => {\n if (activeId) model.expand([`doc:${activeId}`])\n }, [activeId, model])\n\n // A selected folder that was deleted or moved away falls back to the root.\n useEffect(() => {\n if (!tree) return\n const paths = new Set<string>()\n collectFolderPaths(tree, paths)\n if (!paths.has(selectedFolderRef.current)) setSelectedFolder('')\n }, [tree, setSelectedFolder])\n\n /** A folder moved from `from` to `to`: its open/selected state follows it. */\n function followFolderMove(from: string, to: string) {\n model.followFolderMove(from, to)\n setSelectedFolder(remapFolderPath(selectedFolderRef.current, from, to))\n model.expand(ancestorKeys(parentPath(to)))\n }\n\n /** Makes a composite's children visible in the outline again. */\n function openOutline(blockId: string) {\n setCollapsedOutline(current => current.filter(key => key !== `outline:${blockId}`))\n }\n\n // --- items -----------------------------------------------------------------------------------------------------\n\n function selectItem(item: TreeItem) {\n if (renamingRef.current?.item.key === item.key) return\n if (item.key === VIRTUAL_ROOT) {\n setVirtualTarget(null)\n return\n }\n if (item.type === 'document') {\n setSelectedFolder(item.folder ?? '')\n void store.open(item.id!).catch(() => undefined)\n } else {\n setSelectedFolder(item.path ?? '')\n }\n }\n\n function selectOutline(item: TreeItem) {\n if (editor && !editor.isDestroyed) revealBlockInEditor(editor, { id: item.blockId ?? null, pos: item.pos! })\n if (virtual && item.blockId && (item.kind === 'folder' || item.kind === 'document')) setVirtualTarget(item.blockId)\n }\n\n const outlineList = buildOutlineItems(outline.nodes as Parameters<typeof buildOutlineItems>[0], kinds, selectOutline)\n const unfilteredItems: TreeItem[] = virtual\n ? [virtualRootItem(documents.find(d => d.id === activeId)?.title ?? t('tree.rootFallback'), outlineList, selectItem)]\n : tree ? [folderItem(tree, activeId, outlineList, selectItem)] : []\n const items = applyNodeFilters(unfilteredItems, nodeFilters)\n const isEmpty = !virtual && !!tree && !tree.folders.length && !tree.documents.length\n\n const isOpen = (item: TreeItem) => (isOutlineItem(item) ? !collapsedOutline.includes(item.key) : expanded.includes(item.key))\n\n function setOpen(item: TreeItem, open: boolean) {\n if (isOutlineItem(item)) {\n setCollapsedOutline(current => (open ? current.filter(key => key !== item.key) : current.includes(item.key) ? current : [...current, item.key]))\n } else if (open) {\n model.expand([item.key])\n } else {\n model.expanded.set(model.expanded.get().filter(key => key !== item.key))\n }\n }\n\n // Folders and the root toggle through the row click; documents and outline entries (whose row click opens or reveals)\n // toggle through their chevron.\n function onChevronClick(event: { stopPropagation: () => void }, item: TreeItem) {\n if (item.type === 'root' || item.type === 'folder') return\n event.stopPropagation()\n setOpen(item, !isOpen(item))\n }\n\n function activate(item: TreeItem) {\n item.onSelect?.()\n if (item.type === 'root' || item.type === 'folder') setOpen(item, !isOpen(item))\n }\n\n function onRowKeyDown(event: KeyboardEvent<HTMLDivElement>, item: TreeItem) {\n if (event.target !== event.currentTarget) return\n const expandable = item.type === 'root' || item.type === 'folder' || !!item.children?.length\n if (event.key === 'Enter' || event.key === ' ') activate(item)\n else if (event.key === 'ArrowRight' && expandable && !isOpen(item)) setOpen(item, true)\n else if (event.key === 'ArrowLeft' && expandable && isOpen(item)) setOpen(item, false)\n else if (event.key === 'ArrowDown' || event.key === 'ArrowUp') {\n const rows = [...(treeElement.current?.querySelectorAll<HTMLElement>('[role=\"treeitem\"]') ?? [])]\n rows[rows.indexOf(event.currentTarget) + (event.key === 'ArrowDown' ? 1 : -1)]?.focus()\n } else return\n event.preventDefault()\n }\n\n // --- filters ---------------------------------------------------------------------------------------------------\n\n const kindsOf = (item: TreeItem) => filterKinds(item, { structure, activeId, kinds, t })\n const hiddenBelow = (item: TreeItem) => nodeFilters[item.key] ?? []\n const isFiltered = (item: TreeItem) => hiddenBelow(item).length > 0\n const showFilter = (item: TreeItem) =>\n kindsOf(item).length > 0 && (item.type === 'root' || item.type === 'folder' || !!item.children?.length || isFiltered(item))\n\n // Filters of items that no longer exist (deleted documents, Bausteine) are ignored, so „Filter zurücksetzen“ only shows\n // while something visible is filtered.\n const visibleKeys = collectKeys(unfilteredItems, new Set())\n const hasFilters = Object.entries(nodeFilters).some(([key, hidden]) => hidden.length > 0 && visibleKeys.has(key))\n\n // --- creating ----------------------------------------------------------------------------------------------------\n\n async function importIntoComposite(blockId: string | null) {\n const files = await pickFiles('*/*')\n if (!files.length || !editor || editor.isDestroyed) return\n await importFiles(editor, files, compositeInsertPos(editor, blockId))\n if (blockId) openOutline(blockId)\n }\n\n function createCompositeFolder(blockId: string | null) {\n if (!editor || editor.isDestroyed) return\n const pos = compositeInsertPos(editor, blockId)\n // The caret goes into the new composite's title: one level in, then the text inside it.\n editor.chain().insertContentAt(pos, compositeJSON('folder')).setTextSelection(pos + 2).focus().scrollIntoView().run()\n if (blockId) openOutline(blockId)\n }\n\n async function createDocumentIn(folder: string) {\n setSelectedFolder(folder)\n const doc = await store.create(undefined, folder).catch(() => undefined)\n if (!doc) return\n model.expand(ancestorKeys(folder))\n await store.open(doc.id).catch(() => undefined)\n }\n\n const folderError = creatingFolder?.draft.trim() ? store.validateName(creatingFolder.draft, folderNamesIn(tree, creatingFolder.parent)) : null\n\n function startCreateFolder(parent: string) {\n setSelectedFolder(parent)\n setCreatingFolder({ parent, draft: '' })\n }\n\n async function commitCreateFolder() {\n const current = creatingFolderRef.current\n if (!current) return\n if (!current.draft.trim()) {\n setCreatingFolder(null)\n return\n }\n // An invalid name keeps the field open with its inline error.\n if (folderError) return\n setCreatingFolder(null)\n const created = await store.createFolder(joinPath(current.parent, current.draft.trim())).then(() => true, () => false)\n if (created) model.expand(ancestorKeys(current.parent))\n }\n\n // --- rename (folders; a document is renamed in the editor's title field) ---------------------------------------------\n\n const renameErrorOf = (current: Renaming | null) =>\n !current || current.draft.trim() === current.item.label\n ? null\n : store.validateName(current.draft, folderNamesIn(tree, parentPath(current.item.path!), current.item.path))\n const renameError = renameErrorOf(renaming)\n\n async function commitRename() {\n const current = renamingRef.current\n if (!current) return\n // An invalid name keeps the field open with its inline error.\n if (renameErrorOf(current)) return\n const name = current.draft.trim()\n setRenaming(null)\n if (name === current.item.label) return\n const to = joinPath(parentPath(current.item.path!), name)\n const moved = await store.moveFolder(current.item.path!, to).then(() => true, () => false)\n if (moved) followFolderMove(current.item.path!, to)\n }\n\n function onRenameBlur() {\n const current = renamingRef.current\n if (!current) return\n const error = renameErrorOf(current)\n if (error) {\n notify({ kind: 'warning', title: t('tree.folder.renameFailed'), description: error })\n setRenaming(null)\n return\n }\n return commitRename()\n }\n\n // --- delete ----------------------------------------------------------------------------------------------------\n\n async function restore(removed: { restore: () => Promise<{ id: string }> }) {\n const restored = await removed.restore().catch(() => undefined)\n if (restored) await store.open(restored.id).catch(() => undefined)\n }\n\n async function removeWithUndo(id: string, folder: string) {\n // The store leaves an open document and waits for its page teardown (which destroys its collaboration provider)\n // before it deletes.\n const removed = await store.remove(id, folder).catch(() => undefined)\n if (!removed) return\n toast(t('tree.removed'), {\n description: removed.title,\n icon: <Icon name=\"i-lucide-trash-2\" />,\n action: { label: t('tree.undo'), onClick: () => { void restore(removed) } },\n })\n }\n\n async function removeItem(item: TreeItem) {\n setRemoving(item.key)\n try {\n if (item.type === 'document') await removeWithUndo(item.id!, item.folder ?? '')\n // The server refuses non-empty folders; the toast then reads „Ordner ist nicht leer“.\n else await store.removeFolder(item.path!).catch(() => undefined)\n } finally {\n setRemoving(null)\n }\n }\n\n // --- + menu ----------------------------------------------------------------------------------------------------\n\n /**\n * What can be created below `item`: folders of the store take documents and sub-folders, the open file (as the root or\n * as a document row) and its Ordner/Dokument composites take Ordner and imported Dokument Bausteine. Other rows take\n * nothing. Folders also list „Umbenennen“ here: renaming a document happens in the editor's title field.\n */\n function addMenu(item: TreeItem): { label: string, icon: string, onSelect: () => void }[][] {\n const groups: { label: string, icon: string, onSelect: () => void }[][] = []\n if (item.key !== VIRTUAL_ROOT && (item.type === 'root' || item.type === 'folder')) {\n const path = item.path!\n groups.push([\n { label: t('tree.menu.newDocument'), icon: 'i-lucide-file-plus', onSelect: () => void createDocumentIn(path) },\n { label: item.type === 'root' ? t('tree.menu.newFolder') : t('tree.menu.newSubfolder'), icon: 'i-lucide-folder-plus', onSelect: () => startCreateFolder(path) },\n ])\n } else if (holdsComposites(item, { structure, editor, activeId })) {\n const blockId = item.blockId ?? null\n groups.push([\n { label: t('tree.menu.newCompositeFolder'), icon: 'i-lucide-folder-plus', onSelect: () => { createCompositeFolder(blockId); if (!blockId) model.expand([item.key]) } },\n { label: t('tree.menu.importFile'), icon: 'i-lucide-file-up', onSelect: () => { void importIntoComposite(blockId); if (!blockId) model.expand([item.key]) } },\n ])\n }\n if (item.type === 'folder') groups.push([{ label: t('tree.menu.rename'), icon: 'i-lucide-pencil', onSelect: () => setRenaming({ item, draft: item.label }) }])\n return groups\n }\n\n // --- drag & drop -----------------------------------------------------------------------------------------------\n\n const isDraggable = (item: TreeItem) => renaming?.item.key !== item.key && isDraggableItem(item, virtual)\n\n function onDragStart(event: DragEvent<HTMLDivElement>, item: TreeItem) {\n if (!isDraggable(item)) return event.preventDefault()\n const payload = dragPayloadOf(item)\n dragging.current = payload\n event.dataTransfer.setData(DRAG_MIME, JSON.stringify(payload))\n event.dataTransfer.effectAllowed = 'move'\n }\n\n function onDragOver(event: DragEvent<HTMLDivElement>, item: TreeItem) {\n if (!canDrop(dragging.current, item, { virtual, editor })) return\n event.preventDefault()\n event.dataTransfer.dropEffect = 'move'\n setDropKey(item.key)\n }\n\n function onDragLeave(event: DragEvent<HTMLDivElement>, item: TreeItem) {\n if (dropKey === item.key && !event.currentTarget.contains(event.relatedTarget as Node | null)) setDropKey(null)\n }\n\n function endDrag() {\n dragging.current = null\n setDropKey(null)\n }\n\n async function onDrop(event: DragEvent<HTMLDivElement>, target: TreeItem) {\n const raw = event.dataTransfer.getData(DRAG_MIME)\n endDrag()\n if (!raw) return\n event.preventDefault()\n const source = JSON.parse(raw) as DragPayload\n if (!canDrop(source, target, { virtual, editor })) return\n if (source.type === 'composite') {\n const targetId = target.key === VIRTUAL_ROOT ? null : target.blockId!\n if (editor && moveBlockInto(editor, source.blockId, targetId) && targetId) openOutline(targetId)\n return\n }\n const targetPath = target.path!\n if (source.type === 'document') {\n const moved = await store.move(source.id!, targetPath).then(() => true, () => false)\n if (moved) model.expand(ancestorKeys(targetPath))\n return\n }\n const to = joinPath(targetPath, source.path.slice(source.path.lastIndexOf('/') + 1))\n const moved = await store.moveFolder(source.path, to).then(() => true, () => false)\n if (moved) followFolderMove(source.path, to)\n }\n\n // --- rendering -------------------------------------------------------------------------------------------------\n\n const filterMenu = (item: TreeItem) => {\n const hidden = hiddenBelow(item)\n return (\n <DropdownMenuContent align=\"start\" className=\"w-auto\">\n <DropdownMenuLabel>{t('tree.filter.show')}</DropdownMenuLabel>\n {kindsOf(item).map(kind => (\n <DropdownMenuCheckboxItem\n key={kind.id}\n checked={!hidden.includes(kind.id)}\n onCheckedChange={visible => model.setKindHidden(item.key, kind.id, !visible)}\n // Stay open: several kinds are usually toggled in one go.\n onSelect={event => event.preventDefault()}\n >\n <Icon name={kind.icon} />\n {kind.label}\n </DropdownMenuCheckboxItem>\n ))}\n {hidden.length > 0 && (\n <>\n <DropdownMenuSeparator />\n <DropdownMenuItem onSelect={() => model.clearFilter(item.key)}>\n <Icon name=\"i-lucide-filter-x\" />\n {t('tree.filter.reset')}\n </DropdownMenuItem>\n </>\n )}\n </DropdownMenuContent>\n )\n }\n\n const renderRow = (item: TreeItem, open: boolean, level: number) => {\n const chevron = item.type === 'root' || item.type === 'folder' || !!item.children?.length\n const selectedInVirtual = virtual && (item.key === VIRTUAL_ROOT ? virtualTarget === null : !!item.blockId && item.blockId === virtualTarget)\n const add = addMenu(item)\n const filtered = isFiltered(item)\n return (\n <div\n role=\"treeitem\"\n tabIndex={0}\n aria-level={level + 1}\n aria-expanded={chevron ? open : undefined}\n aria-selected={item.id !== undefined && item.id === activeId ? true : undefined}\n className={cn(\n 'group flex w-full cursor-pointer items-center gap-1.5 rounded-md px-2 py-1 text-sm select-none outline-none hover:bg-muted/60 focus-visible:ring-1 focus-visible:ring-ring',\n item.id !== undefined && item.id === activeId && 'bg-primary/10 font-medium text-primary',\n item.type !== 'document' && item.path === selectedFolder && 'bg-muted',\n selectedInVirtual && 'bg-muted',\n dropKey === item.key && 'ring-1 ring-primary',\n )}\n draggable={isDraggable(item)}\n onClick={() => activate(item)}\n onKeyDown={event => onRowKeyDown(event, item)}\n onDragStart={event => onDragStart(event, item)}\n onDragOver={event => onDragOver(event, item)}\n onDragLeave={event => onDragLeave(event, item)}\n onDrop={event => void onDrop(event, item)}\n onDragEnd={endDrag}\n >\n {chevron\n ? (\n <span className=\"flex shrink-0\" onClick={event => onChevronClick(event, item)}>\n <Icon name=\"i-lucide-chevron-right\" className={cn('size-3.5 text-muted-foreground transition-transform', open && 'rotate-90')} />\n </span>\n )\n : isOutlineItem(item) && <span className=\"size-3.5 shrink-0\" />}\n <Icon name={item.icon} />\n\n {renaming?.item.key === item.key\n ? (\n <div className=\"flex min-w-0 flex-1 flex-col gap-0.5\">\n <Input\n value={renaming.draft}\n className=\"h-6 min-w-0 px-2 text-xs md:text-xs\"\n autoFocus\n aria-label={t('tree.folder.name')}\n aria-invalid={!!renameError}\n onChange={event => setRenaming({ item: renaming.item, draft: event.target.value })}\n onFocus={event => event.currentTarget.select()}\n onClick={event => event.stopPropagation()}\n onKeyDown={(event) => {\n event.stopPropagation()\n if (event.key === 'Enter') void commitRename()\n else if (event.key === 'Escape') setRenaming(null)\n }}\n onBlur={() => void onRenameBlur()}\n />\n {renameError && <p className=\"text-xs text-destructive\" role=\"alert\" onClick={event => event.stopPropagation()}>{renameError}</p>}\n </div>\n )\n : (\n <>\n <span className=\"min-w-0 flex-1 truncate\" title={item.label}>{item.label}</span>\n {item.hasSummary && <Icon name=\"i-lucide-text-quote\" className=\"size-3.5 text-muted-foreground\" />}\n <div className=\"flex shrink-0\" onClick={event => event.stopPropagation()}>\n {showFilter(item) && (\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <Button\n size=\"icon-xs\"\n variant={filtered ? 'secondary' : 'ghost'}\n className={cn(!filtered && REVEAL_ON_HOVER)}\n title={t('tree.filter.title')}\n aria-label={t('tree.filter.title')}\n >\n <Icon name=\"i-lucide-filter\" />\n </Button>\n </DropdownMenuTrigger>\n {filterMenu(item)}\n </DropdownMenu>\n )}\n <div className=\"flex opacity-0 transition-opacity group-hover:opacity-100 group-focus-within:opacity-100 has-data-[state=open]:opacity-100\">\n {add.length > 0 && (\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <Button size=\"icon-xs\" variant=\"ghost\" title={t('tree.add')} aria-label={t('tree.add')}>\n <Icon name=\"i-lucide-plus\" />\n </Button>\n </DropdownMenuTrigger>\n <DropdownMenuContent align=\"start\" className=\"w-auto\" onCloseAutoFocus={event => event.preventDefault()}>\n {add.map((group, index) => (\n <div key={index}>\n {index > 0 && <DropdownMenuSeparator />}\n {group.map(entry => (\n <DropdownMenuItem key={entry.label} onSelect={entry.onSelect}>\n <Icon name={entry.icon} />\n {entry.label}\n </DropdownMenuItem>\n ))}\n </div>\n ))}\n </DropdownMenuContent>\n </DropdownMenu>\n )}\n {item.type === 'document' && documentActions?.({ id: item.id!, title: item.label })}\n {(item.type === 'document' || item.type === 'folder') && (\n <Button\n size=\"icon-xs\"\n variant=\"ghost\"\n className=\"text-destructive hover:text-destructive\"\n aria-label={t('tree.delete')}\n disabled={removing === item.key}\n onClick={() => void removeItem(item)}\n >\n <Icon name={removing === item.key ? 'i-lucide-loader-circle' : 'i-lucide-trash-2'} className={cn(removing === item.key && 'animate-spin')} />\n </Button>\n )}\n </div>\n </div>\n </>\n )}\n </div>\n )\n }\n\n const renderItems = (list: readonly TreeItem[], level: number): ReactNode => (\n <ul role={level === 0 ? 'tree' : 'group'} aria-label={level === 0 ? t('tree.aria') : undefined} ref={level === 0 ? treeElement : undefined} className={cn('m-0 list-none p-0', level > 0 && 'ml-3 border-l border-border pl-1')}>\n {list.map((item) => {\n const open = isOpen(item)\n return (\n <li key={item.key} role=\"none\">\n <Collapsible open={open}>\n {renderRow(item, open, level)}\n {item.children?.length ? <CollapsibleContent>{renderItems(item.children, level + 1)}</CollapsibleContent> : null}\n </Collapsible>\n </li>\n )\n })}\n </ul>\n )\n\n return (\n <div className={cn('flex flex-col gap-2', className)}>\n {hasFilters && (\n <div className=\"flex items-center\">\n <Button size=\"xs\" variant=\"secondary\" onClick={() => model.clearAllFilters()}>\n <Icon name=\"i-lucide-filter-x\" />\n {t('tree.filter.reset')}\n </Button>\n </div>\n )}\n\n {creatingFolder && (\n <div className=\"flex flex-col gap-1\">\n <Input\n value={creatingFolder.draft}\n className=\"h-7 text-sm md:text-sm\"\n autoFocus\n placeholder={creatingFolder.parent ? t('tree.folder.placeholderIn', { parent: creatingFolder.parent }) : t('tree.folder.placeholder')}\n aria-label={t('tree.folder.name')}\n aria-invalid={!!folderError}\n onChange={event => setCreatingFolder({ parent: creatingFolder.parent, draft: event.target.value })}\n onKeyDown={(event) => {\n if (event.key === 'Enter') void commitCreateFolder()\n else if (event.key === 'Escape') setCreatingFolder(null)\n }}\n onBlur={() => setCreatingFolder(null)}\n />\n {folderError && <p className=\"px-0.5 text-xs text-destructive\" role=\"alert\">{folderError}</p>}\n </div>\n )}\n\n {!tree && !virtual\n ? <p className=\"px-2.5 py-1.5 text-sm text-muted-foreground\">{tree === null ? t('tree.loadFailed') : t('tree.loading')}</p>\n : renderItems(items, 0)}\n\n {isEmpty && <p className=\"px-2.5 py-1.5 text-sm text-muted-foreground\">{t('tree.empty')}</p>}\n </div>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AA0EA,MAAM,sBAAsB;AAC5B,MAAM,kBAAoC,CAAC;AAC3C,MAAM,cAAwC,CAAC;AAC/C,MAAM,kBAAkB;AACxB,MAAM,iBAAiB,SAAmB,KAAK,SAAS,eAAe,KAAK,SAAS;;AAGrF,SAAgB,aAAa,EAAE,OAAO,QAAQ,gBAAgB,kBAAkB,wBAAwB,iBAAiB,aAAgC;CACvJ,MAAM,EAAE,MAAM,cAAc;CAC5B,MAAM,EAAE,aAAa,UAAU,UAAU,YAAY;CACrD,MAA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KACpI,cAAY,EAAE,kBAAkB;KAChC,gBAAc,CAAC,CAAC;KAChB,WAAU,UAAS,kBAAkB;MAAE,QAAQ,eAAe;MAAQ,OAAO,MAAM,OAAO;KAAM,CAAC;KACjG,YAAY,UAAU;MACpB,IAAI,MAAM,QAAQ,SAAS,mBAAwB;WAC9C,IAAI,MAAM,QAAQ,UAAU,kBAAkB,IAAI;KACzD;KACA,cAAc,kBAAkB,IAAI;IACrC,CAAA,GACA,eAAe,oBAAC,KAAD;KAAG,WAAU;KAAkC,MAAK;KAAS,UAAA;IAAe,CAAA,CACzF;;GAGN,CAAC,QAAQ,CAAC,UACP,oBAAC,KAAD;IAAG,WAAU;IAA+C,UAAA,SAAS,OAAO,EAAE,iBAAiB,IAAI,EAAE,cAAc;GAAK,CAAA,IACxH,YAAY,OAAO,CAAC;GAEvB,WAAW,oBAAC,KAAD;IAAG,WAAU;IAA+C,UAAA,EAAE,YAAY;GAAK,CAAA;EACxF;;AAET"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { NodeFilters, TreeViewModel } from "../tree-view-model.js";
|
|
2
|
+
//#region src/tree/react/use-tree-view.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* The React view of the file browser's `TreeViewModel` (shared by every tree below one `EditorContextProvider`):
|
|
5
|
+
* `nodeFilters` (the kinds hidden below each tree item, by item key) persists in localStorage, `expanded` (tree item
|
|
6
|
+
* keys) lasts for the session. Change them through `model` (`expand`, `setKindHidden`, `clearAllFilters`, or `model.expanded.set`).
|
|
7
|
+
*/
|
|
8
|
+
export declare function useTreeView(): {
|
|
9
|
+
nodeFilters: NodeFilters;
|
|
10
|
+
expanded: string[];
|
|
11
|
+
model: TreeViewModel;
|
|
12
|
+
};
|
|
13
|
+
//#endregion
|
|
14
|
+
//# sourceMappingURL=use-tree-view.d.ts.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { useEditorContext } from "../../react/context.js";
|
|
2
|
+
import { useStore } from "../../react/use-store.js";
|
|
3
|
+
import { treeView } from "../tree-view-model.js";
|
|
4
|
+
//#region src/tree/react/use-tree-view.ts
|
|
5
|
+
/**
|
|
6
|
+
* The React view of the file browser's `TreeViewModel` (shared by every tree below one `EditorContextProvider`):
|
|
7
|
+
* `nodeFilters` (the kinds hidden below each tree item, by item key) persists in localStorage, `expanded` (tree item
|
|
8
|
+
* keys) lasts for the session. Change them through `model` (`expand`, `setKindHidden`, `clearAllFilters`, or `model.expanded.set`).
|
|
9
|
+
*/
|
|
10
|
+
function useTreeView() {
|
|
11
|
+
const model = treeView(useEditorContext());
|
|
12
|
+
return {
|
|
13
|
+
nodeFilters: useStore(model.nodeFilters),
|
|
14
|
+
expanded: useStore(model.expanded),
|
|
15
|
+
model
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
//#endregion
|
|
19
|
+
export { useTreeView };
|
|
20
|
+
|
|
21
|
+
//# sourceMappingURL=use-tree-view.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-tree-view.js","names":[],"sources":["../../../src/tree/react/use-tree-view.ts"],"sourcesContent":["import { useEditorContext } from '../../react/context'\nimport { useStore } from '../../react/use-store'\nimport { type NodeFilters, treeView, type TreeViewModel } from '../tree-view-model'\n\n/**\n * The React view of the file browser's `TreeViewModel` (shared by every tree below one `EditorContextProvider`):\n * `nodeFilters` (the kinds hidden below each tree item, by item key) persists in localStorage, `expanded` (tree item\n * keys) lasts for the session. Change them through `model` (`expand`, `setKindHidden`, `clearAllFilters`, or `model.expanded.set`).\n */\nexport function useTreeView(): { nodeFilters: NodeFilters, expanded: string[], model: TreeViewModel } {\n const model = treeView(useEditorContext())\n return { nodeFilters: useStore(model.nodeFilters), expanded: useStore(model.expanded), model }\n}\n"],"mappings":";;;;;;;;;AASA,SAAgB,cAAsF;CACpG,MAAM,QAAQ,SAAS,iBAAiB,CAAC;CACzC,OAAO;EAAE,aAAa,SAAS,MAAM,WAAW;EAAG,UAAU,SAAS,MAAM,QAAQ;EAAG;CAAM;AAC/F"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { ReadonlyStore } from "../core/store.js";
|
|
2
|
+
import { DocumentSummary, TreeFolder } from "./types.js";
|
|
3
|
+
//#region src/tree/store.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* What `DocumentTree` (`./tree/vue`, `./tree/react`) needs from the host's document storage, framework-free: the
|
|
6
|
+
* observable values are `ReadonlyStore`s (`createStore` from `./core`; `storeFromRef` of `@ecsplico/editor/vue` adapts Vue refs). The
|
|
7
|
+
* host owns storage, routing and failure reporting:
|
|
8
|
+
* every method that fails shows its own error notification and rejects, the tree then only stops the flow it was
|
|
9
|
+
* running (it never reports a second time). A mutation resolves after both `tree` and `documents` show its result.
|
|
10
|
+
*/
|
|
11
|
+
export interface DocumentStore {
|
|
12
|
+
/** Folder tree; `undefined` = not loaded yet, `null` = loading failed. No rows are shown for either. */
|
|
13
|
+
tree: ReadonlyStore<TreeFolder | null | undefined>;
|
|
14
|
+
/** Every document; `undefined` = not loaded yet. */
|
|
15
|
+
documents: ReadonlyStore<readonly DocumentSummary[] | undefined>;
|
|
16
|
+
/** The open document, if any. */
|
|
17
|
+
activeId: ReadonlyStore<string | undefined>;
|
|
18
|
+
/** Makes the document the open one (host navigation). */
|
|
19
|
+
open: (id: string) => Promise<void>;
|
|
20
|
+
/** Creates a document (default title and root folder when omitted) and returns its ID. */
|
|
21
|
+
create: (title?: string, folder?: string) => Promise<{
|
|
22
|
+
id: string;
|
|
23
|
+
}>;
|
|
24
|
+
move: (id: string, folder: string) => Promise<void>;
|
|
25
|
+
/**
|
|
26
|
+
* Deletes a document. An open document is left first and its page torn down before the deletion. Resolves with the
|
|
27
|
+
* German-visible `title` and an undo: `restore` creates a *new* document (new ID) with that title in `folder` and
|
|
28
|
+
* the former JSON content. Assets, IDs and collaboration history are not restored.
|
|
29
|
+
*/
|
|
30
|
+
remove: (id: string, folder: string) => Promise<{
|
|
31
|
+
title: string;
|
|
32
|
+
restore: () => Promise<{
|
|
33
|
+
id: string;
|
|
34
|
+
}>;
|
|
35
|
+
}>;
|
|
36
|
+
createFolder: (path: string) => Promise<void>;
|
|
37
|
+
/** `to` is the complete new path, so this moves and renames. */
|
|
38
|
+
moveFolder: (path: string, to: string) => Promise<void>;
|
|
39
|
+
/** Rejects for a non-empty folder. */
|
|
40
|
+
removeFolder: (path: string) => Promise<void>;
|
|
41
|
+
/** Error message for an invalid new name among `siblings` (the names already taken in the folder), else `null`. */
|
|
42
|
+
validateName: (name: string, siblings: readonly string[]) => string | null;
|
|
43
|
+
}
|
|
44
|
+
//#endregion
|
|
45
|
+
//# sourceMappingURL=store.d.ts.map
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
import { findBlockById } from "../core/schema/block-ids.js";
|
|
2
|
+
import { headingOutline } from "../outline/heading-outline.js";
|
|
3
|
+
import { compositeKind, defaultCompositeKinds } from "../features/composites/kinds.js";
|
|
4
|
+
import { canMoveBlockInto, compositeOutline } from "../features/composites/outline.js";
|
|
5
|
+
import { folderKey } from "./folder-paths.js";
|
|
6
|
+
//#region src/tree/tree-items.ts
|
|
7
|
+
/** Key of the virtual-mode root item (the open document). */
|
|
8
|
+
const VIRTUAL_ROOT = "vroot";
|
|
9
|
+
const DRAG_MIME = "application/x-tip-tree";
|
|
10
|
+
const parentPath = (folder) => folder.slice(0, Math.max(folder.lastIndexOf("/"), 0));
|
|
11
|
+
const joinPath = (folder, name) => folder ? `${folder}/${name}` : name;
|
|
12
|
+
/** Item keys from the root down to `folder`. */
|
|
13
|
+
function ancestorKeys(folder) {
|
|
14
|
+
const keys = ["root"];
|
|
15
|
+
let path = "";
|
|
16
|
+
for (const segment of folder.split("/").filter(Boolean)) {
|
|
17
|
+
path = joinPath(path, segment);
|
|
18
|
+
keys.push(folderKey(path));
|
|
19
|
+
}
|
|
20
|
+
return keys;
|
|
21
|
+
}
|
|
22
|
+
/** The folder at `path` below (or at) `from`; undefined when there is none. */
|
|
23
|
+
function findFolder(path, from) {
|
|
24
|
+
if (!from) return void 0;
|
|
25
|
+
if (from.path === path) return from;
|
|
26
|
+
for (const sub of from.folders) {
|
|
27
|
+
const found = path === sub.path || path.startsWith(`${sub.path}/`) ? findFolder(path, sub) : void 0;
|
|
28
|
+
if (found) return found;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
/** Names of the folders directly in `parent`, without the folder at path `except`. */
|
|
32
|
+
const folderNamesIn = (tree, parent, except) => (findFolder(parent, tree)?.folders ?? []).filter((sub) => sub.path !== except).map((sub) => sub.name);
|
|
33
|
+
function collectFolderPaths(folder, into) {
|
|
34
|
+
into.add(folder.path);
|
|
35
|
+
folder.folders.forEach((sub) => collectFolderPaths(sub, into));
|
|
36
|
+
}
|
|
37
|
+
const EMPTY_OUTLINE = {
|
|
38
|
+
structure: "composite",
|
|
39
|
+
nodes: []
|
|
40
|
+
};
|
|
41
|
+
/** The outline of the editor's document: the composites in composite structure, else the headings. */
|
|
42
|
+
function readOutline(editor, structure, t) {
|
|
43
|
+
if (!editor || editor.isDestroyed) return EMPTY_OUTLINE;
|
|
44
|
+
const { doc } = editor.state;
|
|
45
|
+
return structure === "composite" ? {
|
|
46
|
+
structure: "composite",
|
|
47
|
+
nodes: compositeOutline(doc, /* @__PURE__ */ new Set(), t("tree.untitled"))
|
|
48
|
+
} : {
|
|
49
|
+
structure: "flat",
|
|
50
|
+
nodes: headingOutline(doc, t("tree.untitled"))
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
/** The outline entries as items; `select` runs when one is chosen. */
|
|
54
|
+
function outlineItems(nodes, kinds, select) {
|
|
55
|
+
return nodes.map((node) => {
|
|
56
|
+
const composite = "kind" in node;
|
|
57
|
+
const item = {
|
|
58
|
+
key: `outline:${node.key}`,
|
|
59
|
+
label: composite ? node.title : node.text,
|
|
60
|
+
icon: composite ? compositeKind(kinds, node.kind).icon : `i-lucide-heading-${node.level}`,
|
|
61
|
+
type: composite ? "composite" : "heading",
|
|
62
|
+
blockId: node.id,
|
|
63
|
+
pos: node.pos,
|
|
64
|
+
kind: composite ? node.kind : void 0,
|
|
65
|
+
hasSummary: composite ? node.hasSummary : void 0,
|
|
66
|
+
children: node.children.length ? outlineItems(node.children, kinds, select) : void 0,
|
|
67
|
+
onSelect: () => select(item),
|
|
68
|
+
onToggle: (e) => e?.preventDefault()
|
|
69
|
+
};
|
|
70
|
+
return item;
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
/** The store's folders and documents as items; the open document (`activeId`) lists `outline` below it. */
|
|
74
|
+
function folderItem(folder, activeId, outline, select) {
|
|
75
|
+
const root = folder.path === "";
|
|
76
|
+
const item = {
|
|
77
|
+
key: root ? "root" : folderKey(folder.path),
|
|
78
|
+
label: folder.name,
|
|
79
|
+
icon: root ? "i-lucide-hard-drive" : "i-lucide-folder",
|
|
80
|
+
type: root ? "root" : "folder",
|
|
81
|
+
path: folder.path,
|
|
82
|
+
children: [...folder.folders.map((sub) => folderItem(sub, activeId, outline, select)), ...folder.documents.map((doc) => {
|
|
83
|
+
const document = {
|
|
84
|
+
key: `doc:${doc.id}`,
|
|
85
|
+
label: doc.title,
|
|
86
|
+
icon: "i-lucide-file",
|
|
87
|
+
type: "document",
|
|
88
|
+
id: doc.id,
|
|
89
|
+
folder: doc.folder,
|
|
90
|
+
children: doc.id === activeId && outline.length ? outline : void 0,
|
|
91
|
+
onSelect: () => select(document),
|
|
92
|
+
onToggle: (e) => e?.preventDefault()
|
|
93
|
+
};
|
|
94
|
+
return document;
|
|
95
|
+
})],
|
|
96
|
+
onSelect: () => select(item)
|
|
97
|
+
};
|
|
98
|
+
return item;
|
|
99
|
+
}
|
|
100
|
+
/** Virtual mode: the open document is the root, its `folder`/`document` composites (and all others) the tree below it. */
|
|
101
|
+
function virtualRootItem(label, outline, select) {
|
|
102
|
+
const item = {
|
|
103
|
+
key: VIRTUAL_ROOT,
|
|
104
|
+
label,
|
|
105
|
+
icon: "i-lucide-package",
|
|
106
|
+
type: "root",
|
|
107
|
+
children: outline.length ? outline : void 0,
|
|
108
|
+
onSelect: () => select(item)
|
|
109
|
+
};
|
|
110
|
+
return item;
|
|
111
|
+
}
|
|
112
|
+
function collectParentKeys(list, into) {
|
|
113
|
+
for (const item of list) {
|
|
114
|
+
if (!item.children?.length) continue;
|
|
115
|
+
into.push(item.key);
|
|
116
|
+
collectParentKeys(item.children, into);
|
|
117
|
+
}
|
|
118
|
+
return into;
|
|
119
|
+
}
|
|
120
|
+
/** Adds the keys of `list` and all items below it to `into`; returns `into`. */
|
|
121
|
+
function collectKeys(list, into) {
|
|
122
|
+
for (const item of list) {
|
|
123
|
+
into.add(item.key);
|
|
124
|
+
if (item.children) collectKeys(item.children, into);
|
|
125
|
+
}
|
|
126
|
+
return into;
|
|
127
|
+
}
|
|
128
|
+
const fileKindsOf = /* @__PURE__ */ new WeakMap();
|
|
129
|
+
/** The kinds a folder lists: Ordner and Dokumente (in the language of `t`; one list per translator). */
|
|
130
|
+
function fileKinds(t) {
|
|
131
|
+
let kinds = fileKindsOf.get(t);
|
|
132
|
+
if (!kinds) {
|
|
133
|
+
const builtIn = defaultCompositeKinds(t);
|
|
134
|
+
kinds = ["folder", "document"].map((id) => compositeKind(builtIn, id));
|
|
135
|
+
fileKindsOf.set(t, kinds);
|
|
136
|
+
}
|
|
137
|
+
return kinds;
|
|
138
|
+
}
|
|
139
|
+
/** What an item is filtered by: the composite's kind, or Ordner/Dokument for the store's folders and documents. */
|
|
140
|
+
function itemKind(item) {
|
|
141
|
+
return item.kind ?? (item.type === "folder" || item.type === "document" ? item.type : void 0);
|
|
142
|
+
}
|
|
143
|
+
/** The kinds `item`'s filter can hide below it (`kinds` = those of the open editor). */
|
|
144
|
+
function filterKinds(item, env) {
|
|
145
|
+
const composite = env.structure === "composite";
|
|
146
|
+
if (item.key === "vroot" || item.type === "composite") return env.kinds;
|
|
147
|
+
if (item.type === "document") return composite && item.id === env.activeId ? env.kinds : [];
|
|
148
|
+
if (item.type === "root" || item.type === "folder") return fileKinds(env.t);
|
|
149
|
+
return [];
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Drops the items of kinds an ancestor's filter hides. Like the outline's own kind filter, their visible descendants
|
|
153
|
+
* move up into the parent's list. A node's own filter applies to everything below it.
|
|
154
|
+
*/
|
|
155
|
+
function applyNodeFilters(list, filters, inherited = /* @__PURE__ */ new Set()) {
|
|
156
|
+
return list.flatMap((item) => {
|
|
157
|
+
const own = filters[item.key];
|
|
158
|
+
const children = item.children ? applyNodeFilters(item.children, filters, own?.length ? /* @__PURE__ */ new Set([...inherited, ...own]) : inherited) : void 0;
|
|
159
|
+
const kind = itemKind(item);
|
|
160
|
+
if (kind && inherited.has(kind)) return children ?? [];
|
|
161
|
+
return [{
|
|
162
|
+
...item,
|
|
163
|
+
children: children?.length ? children : void 0
|
|
164
|
+
}];
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
/** The open composite file: end of composite `blockId`'s body, else (`null`) the end of the document. */
|
|
168
|
+
function compositeInsertPos(instance, blockId) {
|
|
169
|
+
const { doc } = instance.state;
|
|
170
|
+
const target = blockId ? findBlockById(doc, blockId) : null;
|
|
171
|
+
return target?.node.type.name === "composite" ? target.pos + target.node.nodeSize - 1 : doc.content.size;
|
|
172
|
+
}
|
|
173
|
+
/** Whether `item` can hold Bausteine of the open file: the file itself or one of its Ordner/Dokument composites. */
|
|
174
|
+
function holdsComposites(item, env) {
|
|
175
|
+
if (env.structure !== "composite" || !env.editor || env.editor.isDestroyed) return false;
|
|
176
|
+
if (item.key === "vroot") return true;
|
|
177
|
+
if (item.type === "document") return item.id === env.activeId;
|
|
178
|
+
return item.type === "composite" && !!item.blockId && (item.kind === "folder" || item.kind === "document");
|
|
179
|
+
}
|
|
180
|
+
/** What a dragged item carries: its document or folder, or in virtual mode its composite's block ID. */
|
|
181
|
+
function dragPayloadOf(item) {
|
|
182
|
+
return item.type === "composite" ? {
|
|
183
|
+
type: "composite",
|
|
184
|
+
blockId: item.blockId
|
|
185
|
+
} : item.type === "document" ? {
|
|
186
|
+
type: "document",
|
|
187
|
+
id: item.id,
|
|
188
|
+
path: item.folder ?? ""
|
|
189
|
+
} : {
|
|
190
|
+
type: "folder",
|
|
191
|
+
path: item.path
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
/** Whether `item` may be dragged. Virtual mode moves composites of the open document; blocks without an ID cannot be addressed. */
|
|
195
|
+
function isDraggable(item, virtual) {
|
|
196
|
+
if (virtual) return item.type === "composite" && !!item.blockId;
|
|
197
|
+
return item.type === "document" || item.type === "folder";
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* Virtual mode: a composite may be dropped on the document root or a `folder`/`document` composite, but not on itself or
|
|
201
|
+
* inside itself. Otherwise documents and folders may be dropped on the root or a folder, unless that changes nothing or
|
|
202
|
+
* nests a folder in itself.
|
|
203
|
+
*/
|
|
204
|
+
function canDrop(source, target, env) {
|
|
205
|
+
if (!source) return false;
|
|
206
|
+
if (source.type === "composite") {
|
|
207
|
+
const instance = env.editor;
|
|
208
|
+
if (!env.virtual || !instance || instance.isDestroyed) return false;
|
|
209
|
+
if (target.key === "vroot") return canMoveBlockInto(instance, source.blockId, null);
|
|
210
|
+
if (target.type !== "composite" || !target.blockId || target.kind !== "folder" && target.kind !== "document") return false;
|
|
211
|
+
return canMoveBlockInto(instance, source.blockId, target.blockId);
|
|
212
|
+
}
|
|
213
|
+
if (env.virtual || target.type !== "root" && target.type !== "folder") return false;
|
|
214
|
+
const targetPath = target.path;
|
|
215
|
+
if (source.type === "document") return source.path !== targetPath;
|
|
216
|
+
return targetPath !== source.path && !targetPath.startsWith(`${source.path}/`) && parentPath(source.path) !== targetPath;
|
|
217
|
+
}
|
|
218
|
+
//#endregion
|
|
219
|
+
export { DRAG_MIME, EMPTY_OUTLINE, VIRTUAL_ROOT, ancestorKeys, applyNodeFilters, canDrop, collectFolderPaths, collectKeys, collectParentKeys, compositeInsertPos, dragPayloadOf, fileKinds, filterKinds, findFolder, folderItem, folderNamesIn, holdsComposites, isDraggable, joinPath, outlineItems, parentPath, readOutline, virtualRootItem };
|
|
220
|
+
|
|
221
|
+
//# sourceMappingURL=tree-items.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tree-items.js","names":[],"sources":["../../src/tree/tree-items.ts"],"sourcesContent":["import type { Editor } from '@tiptap/core'\nimport { findBlockById } from '../core/schema'\nimport { canMoveBlockInto, compositeKind, type CompositeKind, compositeOutline, defaultCompositeKinds, type OutlineNode } from '../features/composites'\nimport type { Translate } from '../i18n'\nimport { type HeadingOutlineNode, headingOutline } from '../outline'\nimport { folderKey } from './folder-paths'\nimport type { TreeFolder } from './types'\nimport type { NodeFilters } from './tree-view-model'\n\n// What the Vue and the React `DocumentTree` share: the items of the file browser (folders and documents of the store,\n// the open document's outline), their filters, the drop rules and the path arithmetic. No framework, no state.\n\n/** One row of the file browser: a store folder or document, or an entry of the open document's outline. Which fields are set depends on `type`. */\nexport interface TreeItem {\n /** Unique within the tree: `root`, `folder:<path>`, `doc:<id>`, `outline:<block key>` */\n key: string\n label: string\n icon: string\n type: 'root' | 'folder' | 'document' | 'composite' | 'heading'\n /** Folder path of a root/folder item (`''` = root) */\n path?: string\n /** Document id */\n id?: string\n /** Folder path a document item lives in */\n folder?: string\n /** Outline items: block ID of the composite/heading (`null` while it has none) and its position when the outline was read */\n blockId?: string | null\n pos?: number\n /** Composite items: the composite's kind, and whether it has a summary (description) */\n kind?: string\n hasSummary?: boolean\n children?: TreeItem[]\n onSelect?: (e?: Event) => void\n onToggle?: (e?: Event) => void\n}\n\n/** What a drag carries (serialized under `DRAG_MIME`): a document or folder of the store, or a composite of the open document. */\nexport type DragPayload\n = | {\n type: 'document' | 'folder'\n /** Document id */\n id?: string\n /** Folder path of a folder item, or the folder a document currently lives in */\n path: string\n }\n /** Virtual mode: a composite of the open document, by block ID */\n | { type: 'composite', blockId: string }\n\n/** Key of the virtual-mode root item (the open document). */\nexport const VIRTUAL_ROOT = 'vroot'\n\nexport const DRAG_MIME = 'application/x-tip-tree'\n\nexport const parentPath = (folder: string) => folder.slice(0, Math.max(folder.lastIndexOf('/'), 0))\nexport const joinPath = (folder: string, name: string) => (folder ? `${folder}/${name}` : name)\n\n/** Item keys from the root down to `folder`. */\nexport function ancestorKeys(folder: string): string[] {\n const keys = ['root']\n let path = ''\n for (const segment of folder.split('/').filter(Boolean)) {\n path = joinPath(path, segment)\n keys.push(folderKey(path))\n }\n return keys\n}\n\n/** The folder at `path` below (or at) `from`; undefined when there is none. */\nexport function findFolder(path: string, from: TreeFolder | null | undefined): TreeFolder | undefined {\n if (!from) return undefined\n if (from.path === path) return from\n for (const sub of from.folders) {\n const found = path === sub.path || path.startsWith(`${sub.path}/`) ? findFolder(path, sub) : undefined\n if (found) return found\n }\n return undefined\n}\n\n/** Names of the folders directly in `parent`, without the folder at path `except`. */\nexport const folderNamesIn = (tree: TreeFolder | null | undefined, parent: string, except?: string) =>\n (findFolder(parent, tree)?.folders ?? []).filter(sub => sub.path !== except).map(sub => sub.name)\n\nexport function collectFolderPaths(folder: TreeFolder, into: Set<string>) {\n into.add(folder.path)\n folder.folders.forEach(sub => collectFolderPaths(sub, into))\n}\n\n// --- outline of the open document ------------------------------------------------------------------------------\n\nexport type Outline = { structure: 'composite', nodes: OutlineNode[] } | { structure: 'flat', nodes: HeadingOutlineNode[] }\n\nexport const EMPTY_OUTLINE: Outline = { structure: 'composite', nodes: [] }\n\n/** The outline of the editor's document: the composites in composite structure, else the headings. */\nexport function readOutline(editor: Editor | undefined, structure: string, t: Translate): Outline {\n if (!editor || editor.isDestroyed) return EMPTY_OUTLINE\n const { doc } = editor.state\n return structure === 'composite'\n ? { structure: 'composite', nodes: compositeOutline(doc, new Set(), t('tree.untitled')) }\n : { structure: 'flat', nodes: headingOutline(doc, t('tree.untitled')) }\n}\n\n/** The outline entries as items; `select` runs when one is chosen. */\nexport function outlineItems(nodes: readonly (OutlineNode | HeadingOutlineNode)[], kinds: readonly CompositeKind[], select: (item: TreeItem) => void): TreeItem[] {\n return nodes.map((node) => {\n const composite = 'kind' in node\n const item: TreeItem = {\n key: `outline:${node.key}`,\n label: composite ? node.title : node.text,\n icon: composite ? compositeKind(kinds, node.kind).icon : `i-lucide-heading-${node.level}`,\n type: composite ? 'composite' : 'heading',\n blockId: node.id,\n pos: node.pos,\n kind: composite ? node.kind : undefined,\n hasSummary: composite ? node.hasSummary : undefined,\n children: node.children.length ? outlineItems(node.children as (OutlineNode | HeadingOutlineNode)[], kinds, select) : undefined,\n onSelect: () => select(item),\n onToggle: e => e?.preventDefault(), // the chevron toggles, a click reveals\n }\n return item\n })\n}\n\n// --- items -----------------------------------------------------------------------------------------------------\n\n/** The store's folders and documents as items; the open document (`activeId`) lists `outline` below it. */\nexport function folderItem(folder: TreeFolder, activeId: string | undefined, outline: TreeItem[], select: (item: TreeItem) => void): TreeItem {\n const root = folder.path === ''\n const item: TreeItem = {\n key: root ? 'root' : folderKey(folder.path),\n label: folder.name,\n icon: root ? 'i-lucide-hard-drive' : 'i-lucide-folder',\n type: root ? 'root' : 'folder',\n path: folder.path,\n children: [\n ...folder.folders.map(sub => folderItem(sub, activeId, outline, select)),\n ...folder.documents.map((doc) => {\n const document: TreeItem = {\n key: `doc:${doc.id}`,\n label: doc.title,\n icon: 'i-lucide-file',\n type: 'document',\n id: doc.id,\n folder: doc.folder,\n // The open document lists its outline; its chevron (not a row click) opens and closes it.\n children: doc.id === activeId && outline.length ? outline : undefined,\n onSelect: () => select(document),\n onToggle: e => e?.preventDefault(),\n }\n return document\n }),\n ],\n onSelect: () => select(item),\n }\n return item\n}\n\n/** Virtual mode: the open document is the root, its `folder`/`document` composites (and all others) the tree below it. */\nexport function virtualRootItem(label: string, outline: TreeItem[], select: (item: TreeItem) => void): TreeItem {\n const item: TreeItem = {\n key: VIRTUAL_ROOT,\n label,\n icon: 'i-lucide-package',\n type: 'root',\n children: outline.length ? outline : undefined,\n onSelect: () => select(item),\n }\n return item\n}\n\nexport function collectParentKeys(list: readonly TreeItem[], into: string[]) {\n for (const item of list) {\n if (!item.children?.length) continue\n into.push(item.key)\n collectParentKeys(item.children, into)\n }\n return into\n}\n\n/** Adds the keys of `list` and all items below it to `into`; returns `into`. */\nexport function collectKeys(list: readonly TreeItem[], into: Set<string>) {\n for (const item of list) {\n into.add(item.key)\n if (item.children) collectKeys(item.children, into)\n }\n return into\n}\n\n// --- filters ---------------------------------------------------------------------------------------------------\n\nconst fileKindsOf = new WeakMap<Translate, CompositeKind[]>()\n\n/** The kinds a folder lists: Ordner and Dokumente (in the language of `t`; one list per translator). */\nexport function fileKinds(t: Translate): CompositeKind[] {\n let kinds = fileKindsOf.get(t)\n if (!kinds) {\n const builtIn = defaultCompositeKinds(t)\n kinds = ['folder', 'document'].map(id => compositeKind(builtIn, id))\n fileKindsOf.set(t, kinds)\n }\n return kinds\n}\n\n/** What an item is filtered by: the composite's kind, or Ordner/Dokument for the store's folders and documents. */\nfunction itemKind(item: TreeItem): string | undefined {\n return item.kind ?? (item.type === 'folder' || item.type === 'document' ? item.type : undefined)\n}\n\n/** The kinds `item`'s filter can hide below it (`kinds` = those of the open editor). */\nexport function filterKinds(item: TreeItem, env: { structure: string, activeId: string | undefined, kinds: readonly CompositeKind[], t: Translate }): readonly CompositeKind[] {\n const composite = env.structure === 'composite'\n if (item.key === VIRTUAL_ROOT || item.type === 'composite') return env.kinds\n if (item.type === 'document') return composite && item.id === env.activeId ? env.kinds : []\n if (item.type === 'root' || item.type === 'folder') return fileKinds(env.t)\n return []\n}\n\n/**\n * Drops the items of kinds an ancestor's filter hides. Like the outline's own kind filter, their visible descendants\n * move up into the parent's list. A node's own filter applies to everything below it.\n */\nexport function applyNodeFilters(list: readonly TreeItem[], filters: NodeFilters, inherited: ReadonlySet<string> = new Set()): TreeItem[] {\n return list.flatMap((item) => {\n const own = filters[item.key]\n const children = item.children ? applyNodeFilters(item.children, filters, own?.length ? new Set([...inherited, ...own]) : inherited) : undefined\n const kind = itemKind(item)\n if (kind && inherited.has(kind)) return children ?? []\n return [{ ...item, children: children?.length ? children : undefined }]\n })\n}\n\n// --- creating ----------------------------------------------------------------------------------------------------\n\n/** The open composite file: end of composite `blockId`'s body, else (`null`) the end of the document. */\nexport function compositeInsertPos(instance: Editor, blockId: string | null): number {\n const { doc } = instance.state\n const target = blockId ? findBlockById(doc, blockId) : null\n return target?.node.type.name === 'composite' ? target.pos + target.node.nodeSize - 1 : doc.content.size\n}\n\n/** Whether `item` can hold Bausteine of the open file: the file itself or one of its Ordner/Dokument composites. */\nexport function holdsComposites(item: TreeItem, env: { structure: string, editor: Editor | undefined, activeId: string | undefined }): boolean {\n if (env.structure !== 'composite' || !env.editor || env.editor.isDestroyed) return false\n if (item.key === VIRTUAL_ROOT) return true\n if (item.type === 'document') return item.id === env.activeId\n return item.type === 'composite' && !!item.blockId && (item.kind === 'folder' || item.kind === 'document')\n}\n\n// --- drag & drop -----------------------------------------------------------------------------------------------\n\n/** What a dragged item carries: its document or folder, or in virtual mode its composite's block ID. */\nexport function dragPayloadOf(item: TreeItem): DragPayload {\n return item.type === 'composite'\n ? { type: 'composite', blockId: item.blockId! }\n : item.type === 'document'\n ? { type: 'document', id: item.id, path: item.folder ?? '' }\n : { type: 'folder', path: item.path! }\n}\n\n/** Whether `item` may be dragged. Virtual mode moves composites of the open document; blocks without an ID cannot be addressed. */\nexport function isDraggable(item: TreeItem, virtual: boolean): boolean {\n if (virtual) return item.type === 'composite' && !!item.blockId\n return item.type === 'document' || item.type === 'folder'\n}\n\n/**\n * Virtual mode: a composite may be dropped on the document root or a `folder`/`document` composite, but not on itself or\n * inside itself. Otherwise documents and folders may be dropped on the root or a folder, unless that changes nothing or\n * nests a folder in itself.\n */\nexport function canDrop(source: DragPayload | null, target: TreeItem, env: { virtual: boolean, editor: Editor | undefined }): boolean {\n if (!source) return false\n if (source.type === 'composite') {\n const instance = env.editor\n if (!env.virtual || !instance || instance.isDestroyed) return false\n if (target.key === VIRTUAL_ROOT) return canMoveBlockInto(instance, source.blockId, null)\n if (target.type !== 'composite' || !target.blockId || (target.kind !== 'folder' && target.kind !== 'document')) return false\n return canMoveBlockInto(instance, source.blockId, target.blockId)\n }\n if (env.virtual || (target.type !== 'root' && target.type !== 'folder')) return false\n const targetPath = target.path!\n if (source.type === 'document') return source.path !== targetPath\n return targetPath !== source.path && !targetPath.startsWith(`${source.path}/`) && parentPath(source.path) !== targetPath\n}\n"],"mappings":";;;;;;;AAiDA,MAAa,eAAe;AAE5B,MAAa,YAAY;AAEzB,MAAa,cAAc,WAAmB,OAAO,MAAM,GAAG,KAAK,IAAI,OAAO,YAAY,GAAG,GAAG,CAAC,CAAC;AAClG,MAAa,YAAY,QAAgB,SAAkB,SAAS,GAAG,OAAO,GAAG,SAAS;;AAG1F,SAAgB,aAAa,QAA0B;CACrD,MAAM,OAAO,CAAC,MAAM;CACpB,IAAI,OAAO;CACX,KAAK,MAAM,WAAW,OAAO,MAAM,GAAG,CAAC,CAAC,OAAO,OAAO,GAAG;EACvD,OAAO,SAAS,MAAM,OAAO;EAC7B,KAAK,KAAK,UAAU,IAAI,CAAC;CAC3B;CACA,OAAO;AACT;;AAGA,SAAgB,WAAW,MAAc,MAA6D;CACpG,IAAI,CAAC,MAAM,OAAO,KAAA;CAClB,IAAI,KAAK,SAAS,MAAM,OAAO;CAC/B,KAAK,MAAM,OAAO,KAAK,SAAS;EAC9B,MAAM,QAAQ,SAAS,IAAI,QAAQ,KAAK,WAAW,GAAG,IAAI,KAAK,EAAE,IAAI,WAAW,MAAM,GAAG,IAAI,KAAA;EAC7F,IAAI,OAAO,OAAO;CACpB;AAEF;;AAGA,MAAa,iBAAiB,MAAqC,QAAgB,YAChF,WAAW,QAAQ,IAAI,CAAC,EAAE,WAAW,CAAC,EAAA,CAAG,QAAO,QAAO,IAAI,SAAS,MAAM,CAAC,CAAC,KAAI,QAAO,IAAI,IAAI;AAElG,SAAgB,mBAAmB,QAAoB,MAAmB;CACxE,KAAK,IAAI,OAAO,IAAI;CACpB,O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} from "../core/store.js";
|
|
2
|
+
import { EditorContext } from "../core/context.js";
|
|
3
|
+
//#region src/tree/tree-view-model.d.ts
|
|
4
|
+
/** Hidden kind ids per tree item key. */
|
|
5
|
+
export type NodeFilters = Record<string, string[]>;
|
|
6
|
+
/** The view state of the file browser; see `createTreeView`. */
|
|
7
|
+
export interface TreeViewModel {
|
|
8
|
+
/** The kinds hidden below each tree item, by item key. Persists in localStorage. Replace, never mutate. */
|
|
9
|
+
nodeFilters: Store<NodeFilters>;
|
|
10
|
+
/** Keys of the open tree items; lasts for the session. Replace, never mutate. */
|
|
11
|
+
expanded: Store<string[]>;
|
|
12
|
+
/** Opens the items (already open ones are left alone). */
|
|
13
|
+
expand(keys: readonly string[]): void;
|
|
14
|
+
/** Hides (`hidden`) or shows `kind` below the item. */
|
|
15
|
+
setKindHidden(key: string, kind: string, hidden: boolean): void;
|
|
16
|
+
clearFilter(key: string): void;
|
|
17
|
+
clearAllFilters(): void;
|
|
18
|
+
/** Follows a folder moved from `from` to `to`: open folder items of it and below it get the new path. */
|
|
19
|
+
followFolderMove(from: string, to: string): void;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* A view model of its own: `nodeFilters` is read from localStorage once and written back on every change (a model that
|
|
23
|
+
* is dropped takes its subscription with it, there is nothing to dispose).
|
|
24
|
+
*/
|
|
25
|
+
export declare function createTreeView(): TreeViewModel;
|
|
26
|
+
/** The view model shared by every tree of one editor context (one app): created on first use, then cached. */
|
|
27
|
+
export declare function treeView(ctx: EditorContext): TreeViewModel;
|
|
28
|
+
//#endregion
|
|
29
|
+
//# sourceMappingURL=tree-view-model.d.ts.map
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { createStore } from "../core/store.js";
|
|
2
|
+
import { FOLDER_KEY_PREFIX, folderKey, remapFolderPath } from "./folder-paths.js";
|
|
3
|
+
//#region src/tree/tree-view-model.ts
|
|
4
|
+
const NODE_FILTERS_KEY = "tip-tree:node-filters";
|
|
5
|
+
function readStored(key, fallback, isValid) {
|
|
6
|
+
try {
|
|
7
|
+
const raw = localStorage.getItem(key);
|
|
8
|
+
if (raw !== null) {
|
|
9
|
+
const value = JSON.parse(raw);
|
|
10
|
+
if (isValid(value)) return value;
|
|
11
|
+
}
|
|
12
|
+
} catch {}
|
|
13
|
+
return fallback;
|
|
14
|
+
}
|
|
15
|
+
function writeStored(key, value) {
|
|
16
|
+
try {
|
|
17
|
+
localStorage.setItem(key, JSON.stringify(value));
|
|
18
|
+
} catch {}
|
|
19
|
+
}
|
|
20
|
+
const isNodeFilters = (value) => typeof value === "object" && value !== null && !Array.isArray(value) && Object.values(value).every((kinds) => Array.isArray(kinds) && kinds.every((kind) => typeof kind === "string"));
|
|
21
|
+
/**
|
|
22
|
+
* A view model of its own: `nodeFilters` is read from localStorage once and written back on every change (a model that
|
|
23
|
+
* is dropped takes its subscription with it, there is nothing to dispose).
|
|
24
|
+
*/
|
|
25
|
+
function createTreeView() {
|
|
26
|
+
const nodeFilters = createStore("window" in globalThis ? readStored(NODE_FILTERS_KEY, {}, isNodeFilters) : {});
|
|
27
|
+
nodeFilters.subscribe((value) => writeStored(NODE_FILTERS_KEY, value));
|
|
28
|
+
const expanded = createStore([]);
|
|
29
|
+
return {
|
|
30
|
+
nodeFilters,
|
|
31
|
+
expanded,
|
|
32
|
+
expand(keys) {
|
|
33
|
+
const current = expanded.get();
|
|
34
|
+
const missing = keys.filter((key) => !current.includes(key));
|
|
35
|
+
if (missing.length) expanded.set([...current, ...missing]);
|
|
36
|
+
},
|
|
37
|
+
setKindHidden(key, kind, hidden) {
|
|
38
|
+
const filters = nodeFilters.get();
|
|
39
|
+
const rest = (filters[key] ?? []).filter((id) => id !== kind);
|
|
40
|
+
const { [key]: _previous, ...others } = filters;
|
|
41
|
+
nodeFilters.set(rest.length || hidden ? {
|
|
42
|
+
...others,
|
|
43
|
+
[key]: hidden ? [...rest, kind] : rest
|
|
44
|
+
} : others);
|
|
45
|
+
},
|
|
46
|
+
clearFilter(key) {
|
|
47
|
+
const { [key]: _previous, ...others } = nodeFilters.get();
|
|
48
|
+
nodeFilters.set(others);
|
|
49
|
+
},
|
|
50
|
+
clearAllFilters() {
|
|
51
|
+
nodeFilters.set({});
|
|
52
|
+
},
|
|
53
|
+
followFolderMove(from, to) {
|
|
54
|
+
expanded.set(expanded.get().map((key) => key.startsWith("folder:") ? folderKey(remapFolderPath(key.slice(FOLDER_KEY_PREFIX.length), from, to)) : key));
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
const views = /* @__PURE__ */ new WeakMap();
|
|
59
|
+
/** The view model shared by every tree of one editor context (one app): created on first use, then cached. */
|
|
60
|
+
function treeView(ctx) {
|
|
61
|
+
let view = views.get(ctx);
|
|
62
|
+
if (!view) {
|
|
63
|
+
view = createTreeView();
|
|
64
|
+
views.set(ctx, view);
|
|
65
|
+
}
|
|
66
|
+
return view;
|
|
67
|
+
}
|
|
68
|
+
//#endregion
|
|
69
|
+
export { createTreeView, treeView };
|
|
70
|
+
|
|
71
|
+
//# sourceMappingURL=tree-view-model.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tree-view-model.js","names":[],"sources":["../../src/tree/tree-view-model.ts"],"sourcesContent":["import type { EditorContext } from '../core/context'\nimport { createStore, type Store } from '../core/store'\nimport { FOLDER_KEY_PREFIX, folderKey, remapFolderPath } from './folder-paths'\n\nconst NODE_FILTERS_KEY = 'tip-tree:node-filters'\n\n/** Hidden kind ids per tree item key. */\nexport type NodeFilters = Record<string, string[]>\n\nfunction readStored<T>(key: string, fallback: T, isValid: (value: unknown) => value is T): T {\n try {\n const raw = localStorage.getItem(key)\n if (raw !== null) {\n const value: unknown = JSON.parse(raw)\n if (isValid(value)) return value\n }\n } catch { /* unavailable or corrupt storage: use the default */ }\n return fallback\n}\n\nfunction writeStored(key: string, value: unknown) {\n try {\n localStorage.setItem(key, JSON.stringify(value))\n } catch { /* storage full or blocked: the setting then lasts for this session only */ }\n}\n\nconst isNodeFilters = (value: unknown): value is NodeFilters =>\n typeof value === 'object' && value !== null && !Array.isArray(value)\n && Object.values(value).every(kinds => Array.isArray(kinds) && kinds.every(kind => typeof kind === 'string'))\n\n/** The view state of the file browser; see `createTreeView`. */\nexport interface TreeViewModel {\n /** The kinds hidden below each tree item, by item key. Persists in localStorage. Replace, never mutate. */\n nodeFilters: Store<NodeFilters>\n /** Keys of the open tree items; lasts for the session. Replace, never mutate. */\n expanded: Store<string[]>\n /** Opens the items (already open ones are left alone). */\n expand(keys: readonly string[]): void\n /** Hides (`hidden`) or shows `kind` below the item. */\n setKindHidden(key: string, kind: string, hidden: boolean): void\n clearFilter(key: string): void\n clearAllFilters(): void\n /** Follows a folder moved from `from` to `to`: open folder items of it and below it get the new path. */\n followFolderMove(from: string, to: string): void\n}\n\n/**\n * A view model of its own: `nodeFilters` is read from localStorage once and written back on every change (a model that\n * is dropped takes its subscription with it, there is nothing to dispose).\n */\nexport function createTreeView(): TreeViewModel {\n const nodeFilters = createStore<NodeFilters>('window' in globalThis ? readStored<NodeFilters>(NODE_FILTERS_KEY, {}, isNodeFilters) : {})\n nodeFilters.subscribe(value => writeStored(NODE_FILTERS_KEY, value))\n const expanded = createStore<string[]>([])\n return {\n nodeFilters,\n expanded,\n expand(keys) {\n const current = expanded.get()\n const missing = keys.filter(key => !current.includes(key))\n if (missing.length) expanded.set([...current, ...missing])\n },\n setKindHidden(key, kind, hidden) {\n const filters = nodeFilters.get()\n const rest = (filters[key] ?? []).filter(id => id !== kind)\n const { [key]: _previous, ...others } = filters\n nodeFilters.set(rest.length || hidden ? { ...others, [key]: hidden ? [...rest, kind] : rest } : others)\n },\n clearFilter(key) {\n const { [key]: _previous, ...others } = nodeFilters.get()\n nodeFilters.set(others)\n },\n clearAllFilters() {\n nodeFilters.set({})\n },\n followFolderMove(from, to) {\n expanded.set(expanded.get().map(key => (key.startsWith(FOLDER_KEY_PREFIX) ? folderKey(remapFolderPath(key.slice(FOLDER_KEY_PREFIX.length), from, to)) : key)))\n },\n }\n}\n\nconst views = new WeakMap<EditorContext, TreeViewModel>()\n\n/** The view model shared by every tree of one editor context (one app): created on first use, then cached. */\nexport function treeView(ctx: EditorContext): TreeViewModel {\n let view = views.get(ctx)\n if (!view) {\n view = createTreeView()\n views.set(ctx, view)\n }\n return view\n}\n"],"mappings":";;;AAIA,MAAM,mBAAmB;AAKzB,SAAS,WAAc,KAAa,UAAa,SAA4C;CAC3F,IAAI;EACF,MAAM,MAAM,aAAa,QAAQ,GAAG;EACpC,IAAI,QAAQ,MAAM;GAChB,MAAM,QAAiB,KAAK,MAAM,GAAG;GACrC,IAAI,QAAQ,KAAK,GAAG,OAAO;EAC7B;CACF,QAAQ,CAAwD;CAChE,OAAO;AACT;AAEA,SAAS,YAAY,KAAa,OAAgB;CAChD,IAAI;EACF,aAAa,QAAQ,KAAK,KAAK,UAAU,KAAK,CAAC;CACjD,QAAQ,CAA8E;AACxF;AAEA,MAAM,iBAAiB,UACrB,OAAO,UAAU,YAAY,UAAU,QAAQ,CAAC,MAAM,QAAQ,KAAK,KAChE,OAAO,OAAO,KAAK,CAAC,CAAC,OAAM,UAAS,MAAM,QAAQ,KAAK,KAAK,MAAM,OAAM,SAAQ,OAAO,SAAS,QAAQ,CAAC;;;;;AAsB9G,SAAgB,iBAAgC;CAC9C,MAAM,cAAc,YAAyB,YAAY,aAAa,WAAwB,kBAAkB,CAAC,GAAG,aAAa,IAAI,CAAC,CAAC;CACvI,YAAY,WAAU,UAAS,YAAY,kBAAkB,KAAK,CAAC;CACnE,MAAM,WAAW,YAAsB,CAAC,CAAC;CACzC,OAAO;EACL;EACA;EACA,OAAO,MAAM;GACX,MAAM,UAAU,SAAS,IAAI;GAC7B,MAAM,UAAU,KAAK,QAAO,QAAO,CAAC,QAAQ,SAAS,GAAG,CAAC;GACzD,IAAI,QAAQ,QAAQ,SAAS,IAAI,CAAC,GAAG,SAAS,GAAG,OAAO,CAAC;EAC3D;EACA,cAAc,KAAK,MAAM,QAAQ;GAC/B,MAAM,UAAU,YAAY,IAAI;GAChC,MAAM,QAAQ,QAAQ,QAAQ,CAAC,EAAA,CAAG,QAAO,OAAM,OAAO,IAAI;GAC1D,MAAM,GAAG,MAAM,WAAW,GAAG,WAAW;GACxC,YAAY,IAAI,KAAK,UAAU,SAAS;IAAE,GAAG;KAAS,MAAM,SAAS,CAAC,GAAG,MAAM,IAAI,IAAI;GAAK,IAAI,MAAM;EACxG;EACA,YAAY,KAAK;GACf,MAAM,GAAG,MAAM,WAAW,GAAG,WAAW,YAAY,IAAI;GACxD,YAAY,IAAI,MAAM;EACxB;EACA,kBAAkB;GAChB,YAAY,IAAI,CAAC,CAAC;EACpB;EACA,iBAAiB,MAAM,IAAI;GACzB,SAAS,IAAI,SAAS,IAAI,CAAC,CAAC,KAAI,QAAQ,IAAI,WAAA,SAA4B,IAAI,UAAU,gBAAgB,IAAI,MAAM,kBAAkB,MAAM,GAAG,MAAM,EAAE,CAAC,IAAI,GAAI,CAAC;EAC/J;CACF;AACF;AAEA,MAAM,wBAAQ,IAAI,QAAsC;;AAGxD,SAAgB,SAAS,KAAmC;CAC1D,IAAI,OAAO,MAAM,IAAI,GAAG;CACxB,IAAI,CAAC,MAAM;EACT,OAAO,eAAe;EACtB,MAAM,IAAI,KAAK,IAAI;CACrB;CACA,OAAO;AACT"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { NodeFilters, TreeViewModel } from "./tree-view-model.js";
|
|
2
|
+
import { Ref } from "vue";
|
|
3
|
+
//#region src/tree/tree-view.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* The Vue view of the file browser's `TreeViewModel` (shared by every tree of one Vue app): `nodeFilters` (the kinds
|
|
6
|
+
* hidden below each tree item, by item key) persists in localStorage, `expanded` (tree item keys) lasts for the
|
|
7
|
+
* session; both refs are replaced, not mutated. Call this from `setup()`.
|
|
8
|
+
*/
|
|
9
|
+
export declare function useTreeView(): {
|
|
10
|
+
nodeFilters: Ref<NodeFilters>;
|
|
11
|
+
expanded: Ref<string[]>;
|
|
12
|
+
model: TreeViewModel;
|
|
13
|
+
};
|
|
14
|
+
//#endregion
|
|
15
|
+
//# sourceMappingURL=tree-view.d.ts.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { useEditorContext } from "../vue/context.js";
|
|
2
|
+
import { treeView } from "./tree-view-model.js";
|
|
3
|
+
import { useWritableStoreRef } from "../vue/store-ref.js";
|
|
4
|
+
//#region src/tree/tree-view.ts
|
|
5
|
+
/**
|
|
6
|
+
* The Vue view of the file browser's `TreeViewModel` (shared by every tree of one Vue app): `nodeFilters` (the kinds
|
|
7
|
+
* hidden below each tree item, by item key) persists in localStorage, `expanded` (tree item keys) lasts for the
|
|
8
|
+
* session; both refs are replaced, not mutated. Call this from `setup()`.
|
|
9
|
+
*/
|
|
10
|
+
function useTreeView() {
|
|
11
|
+
const model = treeView(useEditorContext());
|
|
12
|
+
return {
|
|
13
|
+
nodeFilters: useWritableStoreRef(model.nodeFilters),
|
|
14
|
+
expanded: useWritableStoreRef(model.expanded),
|
|
15
|
+
model
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
//#endregion
|
|
19
|
+
export { useTreeView };
|
|
20
|
+
|
|
21
|
+
//# sourceMappingURL=tree-view.js.map
|