@ecsplico/editor 3.6.0 → 4.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 +65 -0
- package/dist/adapters/direct-ai.d.ts +4 -4
- package/dist/adapters/direct-ai.js +2 -2
- package/dist/adapters/direct-ai.js.map +1 -1
- package/dist/adapters/document-state.d.ts +1 -1
- package/dist/adapters/document-state.js.map +1 -1
- package/dist/adapters/forge.d.ts +2 -2
- package/dist/adapters/forge.js.map +1 -1
- package/dist/adapters/nitro.d.ts +11 -3
- package/dist/adapters/nitro.js +3 -1
- package/dist/adapters/nitro.js.map +1 -1
- package/dist/adapters/shared.d.ts +6 -6
- package/dist/adapters/shared.js.map +1 -1
- package/dist/config/index.d.ts +14 -14
- package/dist/config/index.js +8 -8
- package/dist/config/index.js.map +1 -1
- package/dist/core/backend-types.d.ts +3 -3
- package/dist/core/backend-types.js.map +1 -1
- package/dist/core/backend.d.ts +4 -4
- package/dist/core/backend.js.map +1 -1
- package/dist/core/block-convert.d.ts +1 -1
- package/dist/core/block-convert.js +5 -5
- package/dist/core/block-convert.js.map +1 -1
- package/dist/core/block-transfer.d.ts +8 -4
- package/dist/core/block-transfer.js +23 -14
- package/dist/core/block-transfer.js.map +1 -1
- package/dist/core/capabilities.d.ts +113 -0
- package/dist/core/capabilities.js +155 -0
- package/dist/core/capabilities.js.map +1 -0
- package/dist/core/command-types.d.ts +1 -1
- package/dist/core/context.js.map +1 -1
- package/dist/core/convert.d.ts +5 -5
- package/dist/core/convert.js +5 -5
- package/dist/core/convert.js.map +1 -1
- package/dist/core/core-feature.js +1 -1
- package/dist/core/define-editor.d.ts +2 -2
- package/dist/core/define-editor.js +34 -6
- package/dist/core/define-editor.js.map +1 -1
- package/dist/core/derivation.d.ts +119 -0
- package/dist/core/derivation.js +187 -0
- package/dist/core/derivation.js.map +1 -0
- package/dist/core/derive.d.ts +61 -0
- package/dist/core/derive.js +69 -0
- package/dist/core/derive.js.map +1 -0
- package/dist/core/extension-points.d.ts +16 -0
- package/dist/core/feature-context.d.ts +5 -1
- package/dist/core/feature-context.js +10 -3
- package/dist/core/feature-context.js.map +1 -1
- package/dist/core/feature.d.ts +41 -19
- package/dist/core/feature.js.map +1 -1
- package/dist/core/fences.js +1 -1
- package/dist/core/fences.js.map +1 -1
- package/dist/core/index.d.ts +6 -2
- package/dist/core/index.js +5 -1
- package/dist/core/pipeline.d.ts +14 -5
- package/dist/core/pipeline.js +19 -7
- package/dist/core/pipeline.js.map +1 -1
- package/dist/core/properties.d.ts +22 -0
- package/dist/core/properties.js +17 -0
- package/dist/core/properties.js.map +1 -0
- package/dist/core/schema/block-ids.js +5 -5
- package/dist/core/schema/block-ids.js.map +1 -1
- package/dist/core/schema/index.d.ts +2 -1
- package/dist/core/schema/index.js +2 -1
- package/dist/core/schema/index.js.map +1 -1
- package/dist/core/schema/opaque-fence.d.ts +4 -4
- package/dist/core/schema/opaque-fence.js +7 -7
- package/dist/core/schema/opaque-fence.js.map +1 -1
- package/dist/core/schema/persisted-names.d.ts +58 -0
- package/dist/core/schema/persisted-names.js +96 -0
- package/dist/core/schema/persisted-names.js.map +1 -0
- package/dist/core/toolbar-items.js +1 -1
- package/dist/core/toolbar-items.js.map +1 -1
- package/dist/core/util.js +5 -1
- package/dist/core/util.js.map +1 -1
- package/dist/features/ai/agent-ops.js +1 -1
- package/dist/features/ai/ai-review.js +1 -1
- package/dist/features/ai/assistant.d.ts +4 -4
- package/dist/features/ai/assistant.js +1 -1
- package/dist/features/ai/assistant.js.map +1 -1
- package/dist/features/ai/components/AiSelectionMenu.js +1 -1
- package/dist/features/ai/components/AiSelectionMenu.js.map +1 -1
- package/dist/features/ai/components/ModelQuickSwitch.js +7 -7
- package/dist/features/ai/components/ModelQuickSwitch.js.map +1 -1
- package/dist/features/ai/components/ModelQuickSwitch.vue.d.ts +4 -4
- package/dist/features/ai/components/SettingsAiTab.js +8 -8
- package/dist/features/ai/components/SettingsAiTab.js.map +1 -1
- package/dist/features/ai/components/SettingsModelProfiles.js +1 -1
- package/dist/features/ai/components/SettingsModelProfiles.js.map +1 -1
- package/dist/features/ai/document-chat-model.d.ts +2 -2
- package/dist/features/ai/document-chat-model.js +5 -5
- package/dist/features/ai/document-chat-model.js.map +1 -1
- package/dist/features/ai/document-chat.js +2 -2
- package/dist/features/ai/document-chat.js.map +1 -1
- package/dist/features/ai/feature.d.ts +2 -2
- package/dist/features/ai/feature.js +2 -2
- package/dist/features/ai/feature.js.map +1 -1
- package/dist/features/ai/ghost-autocomplete.d.ts +4 -4
- package/dist/features/ai/ghost-autocomplete.js +1 -1
- package/dist/features/ai/ghost-autocomplete.js.map +1 -1
- package/dist/features/ai/index.d.ts +3 -3
- package/dist/features/ai/index.js +2 -2
- package/dist/features/ai/model-profiles.d.ts +9 -9
- package/dist/features/ai/model-profiles.js +13 -13
- package/dist/features/ai/model-profiles.js.map +1 -1
- package/dist/features/ai/protocol/agent-ops.d.ts +2 -2
- package/dist/features/ai/protocol/agent-ops.js +1 -1
- package/dist/features/ai/protocol/agent-ops.js.map +1 -1
- package/dist/features/ai/protocol/block-lines.d.ts +7 -7
- package/dist/features/ai/protocol/block-lines.js +10 -10
- package/dist/features/ai/protocol/block-lines.js.map +1 -1
- package/dist/features/ai/protocol/chat.d.ts +5 -5
- package/dist/features/ai/protocol/chat.js +12 -12
- package/dist/features/ai/protocol/chat.js.map +1 -1
- package/dist/features/ai/protocol/generate.d.ts +1 -1
- package/dist/features/ai/protocol/generate.js +1 -1
- package/dist/features/ai/protocol/generate.js.map +1 -1
- package/dist/features/ai/protocol/index.d.ts +3 -3
- package/dist/features/ai/protocol/index.js +2 -2
- package/dist/features/ai/protocol/models.d.ts +3 -3
- package/dist/features/ai/protocol/models.js +3 -3
- package/dist/features/ai/protocol/models.js.map +1 -1
- package/dist/features/ai/protocol/schemas.d.ts +1 -1
- package/dist/features/ai/protocol/schemas.js +1 -1
- package/dist/features/ai/protocol/schemas.js.map +1 -1
- package/dist/features/ai/protocol/tasks.d.ts +5 -5
- package/dist/features/ai/protocol/tasks.js +12 -12
- package/dist/features/ai/protocol/tasks.js.map +1 -1
- package/dist/features/ai/react/AiSelectionMenu.js.map +1 -1
- package/dist/features/ai/react/ModelQuickSwitch.d.ts +4 -4
- package/dist/features/ai/react/ModelQuickSwitch.js +6 -6
- package/dist/features/ai/react/ModelQuickSwitch.js.map +1 -1
- package/dist/features/ai/react/SettingsAiTab.d.ts +1 -1
- package/dist/features/ai/react/SettingsAiTab.js +8 -8
- package/dist/features/ai/react/SettingsAiTab.js.map +1 -1
- package/dist/features/ai/react/SettingsModelProfiles.d.ts +1 -1
- package/dist/features/ai/react/SettingsModelProfiles.js +1 -1
- package/dist/features/ai/react/SettingsModelProfiles.js.map +1 -1
- package/dist/features/ai/react/use-ai-assistant.d.ts +1 -1
- package/dist/features/ai/react/use-ai-assistant.js +1 -1
- package/dist/features/ai/react/use-ai-assistant.js.map +1 -1
- package/dist/features/ai/react/use-model-profiles.d.ts +5 -5
- package/dist/features/ai/react/use-model-profiles.js +2 -2
- package/dist/features/ai/react/use-model-profiles.js.map +1 -1
- package/dist/features/ai/use-ai-assistant.d.ts +1 -1
- package/dist/features/ai/use-ai-assistant.js +1 -1
- package/dist/features/ai/use-ai-assistant.js.map +1 -1
- package/dist/features/ai/use-model-profiles.d.ts +4 -4
- package/dist/features/ai/use-model-profiles.js +2 -2
- package/dist/features/ai/use-model-profiles.js.map +1 -1
- package/dist/features/block-ui/block-actions.d.ts +8 -4
- package/dist/features/block-ui/block-actions.js +38 -22
- package/dist/features/block-ui/block-actions.js.map +1 -1
- package/dist/features/block-ui/block-target.d.ts +29 -0
- package/dist/features/block-ui/block-target.js +63 -0
- package/dist/features/block-ui/block-target.js.map +1 -0
- package/dist/features/block-ui/components/BlockHandles.js +3 -3
- package/dist/features/block-ui/components/BlockHandles.js.map +1 -1
- package/dist/features/block-ui/components/BlockUi.js +11 -23
- package/dist/features/block-ui/components/BlockUi.js.map +1 -1
- package/dist/features/block-ui/feature.d.ts +3 -2
- package/dist/features/block-ui/feature.js +3 -2
- package/dist/features/block-ui/feature.js.map +1 -1
- package/dist/features/block-ui/handle-geometry.js +12 -23
- package/dist/features/block-ui/handle-geometry.js.map +1 -1
- package/dist/features/block-ui/index.d.ts +2 -1
- package/dist/features/block-ui/index.js +2 -1
- package/dist/features/block-ui/react/BlockHandles.d.ts +1 -1
- package/dist/features/block-ui/react/BlockHandles.js +4 -4
- package/dist/features/block-ui/react/BlockHandles.js.map +1 -1
- package/dist/features/block-ui/react/BlockUi.js +13 -25
- package/dist/features/block-ui/react/BlockUi.js.map +1 -1
- package/dist/features/comments/model.js +1 -1
- package/dist/features/composites/accepted-children.d.ts +5 -4
- package/dist/features/composites/accepted-children.js +26 -26
- package/dist/features/composites/accepted-children.js.map +1 -1
- package/dist/features/composites/ai-brief.d.ts +4 -4
- package/dist/features/composites/ai-brief.js +14 -12
- package/dist/features/composites/ai-brief.js.map +1 -1
- package/dist/features/composites/anchors.d.ts +1 -1
- package/dist/features/composites/anchors.js.map +1 -1
- package/dist/features/composites/baskets.d.ts +1 -1
- package/dist/features/composites/baskets.js.map +1 -1
- package/dist/features/composites/bibliography-command.d.ts +1 -1
- package/dist/features/composites/bibliography-form.js +1 -1
- package/dist/features/composites/bibliography-form.js.map +1 -1
- package/dist/features/composites/bibliography.js.map +1 -1
- package/dist/features/composites/block-types-json.d.ts +38 -0
- package/dist/features/composites/block-types-json.js +122 -0
- package/dist/features/composites/block-types-json.js.map +1 -0
- package/dist/features/composites/block-types.d.ts +119 -0
- package/dist/features/composites/block-types.js +343 -0
- package/dist/features/composites/block-types.js.map +1 -0
- package/dist/features/composites/capabilities.js +109 -0
- package/dist/features/composites/capabilities.js.map +1 -0
- package/dist/features/composites/components/BibliographyEditor.js +5 -5
- package/dist/features/composites/components/BibliographyEditor.js.map +1 -1
- package/dist/features/composites/components/CompositeBasketMenu.js +2 -2
- package/dist/features/composites/components/CompositeBasketMenu.js.map +1 -1
- package/dist/features/composites/components/CompositeChrome.js +18 -8
- package/dist/features/composites/components/CompositeChrome.js.map +1 -1
- package/dist/features/composites/components/CompositeChrome.vue.d.ts +1 -1
- package/dist/features/composites/components/CompositeDetails.js +11 -10
- package/dist/features/composites/components/CompositeDetails.js.map +1 -1
- package/dist/features/composites/components/CompositeDetails.vue.d.ts +1 -1
- package/dist/features/composites/components/CompositeFieldEditor.js +7 -7
- package/dist/features/composites/components/CompositeFieldEditor.js.map +1 -1
- package/dist/features/composites/components/CompositeFieldEditor.vue.d.ts +5 -5
- package/dist/features/composites/components/CompositeInspector.js +136 -113
- package/dist/features/composites/components/CompositeInspector.js.map +1 -1
- package/dist/features/composites/components/CompositeInspector.vue.d.ts +3 -3
- package/dist/features/composites/components/CompositeStatusMenu.js +2 -2
- package/dist/features/composites/components/CompositeStatusMenu.js.map +1 -1
- package/dist/features/composites/components/CompositeSummaryEditor.js +1 -1
- package/dist/features/composites/components/CompositeSummaryEditor.js.map +1 -1
- package/dist/features/composites/components/CompositeSummaryEditor.vue.d.ts +1 -1
- package/dist/features/composites/components/CompositeTable.js +2 -2
- package/dist/features/composites/components/CompositeTable.js.map +1 -1
- package/dist/features/composites/components/CompositeTagsEditor.js +1 -1
- package/dist/features/composites/components/CompositeTagsEditor.js.map +1 -1
- package/dist/features/composites/components/CompositeTagsEditor.vue.d.ts +1 -1
- package/dist/features/composites/components/CompositeView.js +19 -17
- package/dist/features/composites/components/CompositeView.js.map +1 -1
- package/dist/features/composites/components/DerivationBadge.js +15 -6
- package/dist/features/composites/components/DerivationBadge.js.map +1 -1
- package/dist/features/composites/components/FocusChip.js +1 -1
- package/dist/features/composites/components/FocusChip.js.map +1 -1
- package/dist/features/composites/components/FocusChip.vue.d.ts +1 -1
- package/dist/features/composites/components/ReferenceFieldSelect.js +3 -3
- package/dist/features/composites/components/ReferenceFieldSelect.js.map +1 -1
- package/dist/features/composites/components/ReferenceView.js +1 -1
- package/dist/features/composites/components/ReferenceView.js.map +1 -1
- package/dist/features/composites/components/SettingsEditingTab.js +18 -18
- package/dist/features/composites/components/SettingsEditingTab.js.map +1 -1
- package/dist/features/composites/components/SettingsEditingTab.vue.d.ts +3 -3
- package/dist/features/composites/convert.d.ts +4 -4
- package/dist/features/composites/convert.js +27 -28
- package/dist/features/composites/convert.js.map +1 -1
- package/dist/features/composites/derived-chrome.js +34 -28
- package/dist/features/composites/derived-chrome.js.map +1 -1
- package/dist/features/composites/editing-settings-keys.js +6 -6
- package/dist/features/composites/editing-settings-keys.js.map +1 -1
- package/dist/features/composites/feature.d.ts +10 -10
- package/dist/features/composites/feature.js +58 -46
- package/dist/features/composites/feature.js.map +1 -1
- package/dist/features/composites/fences.d.ts +3 -3
- package/dist/features/composites/fences.js +18 -13
- package/dist/features/composites/fences.js.map +1 -1
- package/dist/features/composites/focus.d.ts +10 -10
- package/dist/features/composites/focus.js +11 -11
- package/dist/features/composites/focus.js.map +1 -1
- package/dist/features/composites/heading-composites.d.ts +5 -5
- package/dist/features/composites/heading-composites.js +13 -16
- package/dist/features/composites/heading-composites.js.map +1 -1
- package/dist/features/composites/index.d.ts +20 -18
- package/dist/features/composites/index.js +9 -7
- package/dist/features/composites/inspector-model.d.ts +45 -22
- package/dist/features/composites/inspector-model.js +53 -14
- package/dist/features/composites/inspector-model.js.map +1 -1
- package/dist/features/composites/legacy.d.ts +5 -4
- package/dist/features/composites/legacy.js +16 -23
- package/dist/features/composites/legacy.js.map +1 -1
- package/dist/features/composites/markdown-export.js +3 -3
- package/dist/features/composites/markdown-export.js.map +1 -1
- package/dist/features/composites/merge.d.ts +8 -8
- package/dist/features/composites/merge.js +23 -22
- package/dist/features/composites/merge.js.map +1 -1
- package/dist/features/composites/meta-display.js +5 -5
- package/dist/features/composites/meta-display.js.map +1 -1
- package/dist/features/composites/meta-keys.d.ts +5 -5
- package/dist/features/composites/meta-keys.js +8 -8
- package/dist/features/composites/meta-keys.js.map +1 -1
- package/dist/features/composites/node-views.d.ts +3 -3
- package/dist/features/composites/node-views.js +2 -2
- package/dist/features/composites/node-views.js.map +1 -1
- package/dist/features/composites/nodes.d.ts +13 -13
- package/dist/features/composites/nodes.js +100 -77
- package/dist/features/composites/nodes.js.map +1 -1
- package/dist/features/composites/outline.d.ts +15 -12
- package/dist/features/composites/outline.js +24 -21
- package/dist/features/composites/outline.js.map +1 -1
- package/dist/features/composites/properties.d.ts +51 -0
- package/dist/features/composites/properties.js +89 -0
- package/dist/features/composites/properties.js.map +1 -0
- package/dist/features/composites/react/BibliographyEditor.js +5 -5
- package/dist/features/composites/react/BibliographyEditor.js.map +1 -1
- package/dist/features/composites/react/CompositeBasketMenu.js +2 -2
- package/dist/features/composites/react/CompositeBasketMenu.js.map +1 -1
- package/dist/features/composites/react/CompositeChrome.d.ts +1 -1
- package/dist/features/composites/react/CompositeChrome.js +15 -6
- package/dist/features/composites/react/CompositeChrome.js.map +1 -1
- package/dist/features/composites/react/CompositeDetails.d.ts +1 -1
- package/dist/features/composites/react/CompositeDetails.js +11 -10
- package/dist/features/composites/react/CompositeDetails.js.map +1 -1
- package/dist/features/composites/react/CompositeFieldEditor.d.ts +5 -5
- package/dist/features/composites/react/CompositeFieldEditor.js +6 -6
- package/dist/features/composites/react/CompositeFieldEditor.js.map +1 -1
- package/dist/features/composites/react/CompositeInspector.d.ts +3 -3
- package/dist/features/composites/react/CompositeInspector.js +142 -128
- package/dist/features/composites/react/CompositeInspector.js.map +1 -1
- package/dist/features/composites/react/CompositeStatusMenu.js +2 -2
- package/dist/features/composites/react/CompositeStatusMenu.js.map +1 -1
- package/dist/features/composites/react/CompositeSummaryEditor.d.ts +1 -1
- package/dist/features/composites/react/CompositeSummaryEditor.js +1 -1
- package/dist/features/composites/react/CompositeSummaryEditor.js.map +1 -1
- package/dist/features/composites/react/CompositeTable.d.ts +1 -1
- package/dist/features/composites/react/CompositeTable.js +3 -3
- package/dist/features/composites/react/CompositeTable.js.map +1 -1
- package/dist/features/composites/react/CompositeTagsEditor.d.ts +1 -1
- package/dist/features/composites/react/CompositeTagsEditor.js +1 -1
- package/dist/features/composites/react/CompositeTagsEditor.js.map +1 -1
- package/dist/features/composites/react/CompositeView.js +17 -15
- package/dist/features/composites/react/CompositeView.js.map +1 -1
- package/dist/features/composites/react/DerivationBadge.js +13 -4
- package/dist/features/composites/react/DerivationBadge.js.map +1 -1
- package/dist/features/composites/react/FocusChip.d.ts +1 -1
- package/dist/features/composites/react/FocusChip.js +1 -1
- package/dist/features/composites/react/FocusChip.js.map +1 -1
- package/dist/features/composites/react/ReferenceFieldSelect.js +3 -3
- package/dist/features/composites/react/ReferenceFieldSelect.js.map +1 -1
- package/dist/features/composites/react/ReferenceView.d.ts +1 -1
- package/dist/features/composites/react/ReferenceView.js +1 -1
- package/dist/features/composites/react/ReferenceView.js.map +1 -1
- package/dist/features/composites/react/SettingsEditingTab.d.ts +4 -4
- package/dist/features/composites/react/SettingsEditingTab.js +20 -20
- package/dist/features/composites/react/SettingsEditingTab.js.map +1 -1
- package/dist/features/composites/react.js +1 -1
- package/dist/features/composites/react.js.map +1 -1
- package/dist/features/composites/reference-ai.js +1 -1
- package/dist/features/composites/reference-ai.js.map +1 -1
- package/dist/features/composites/reference-label.d.ts +3 -3
- package/dist/features/composites/reference-label.js +6 -6
- package/dist/features/composites/reference-label.js.map +1 -1
- package/dist/features/composites/reference-suggestion.d.ts +1 -1
- package/dist/features/composites/reference-suggestion.js +3 -3
- package/dist/features/composites/reference-suggestion.js.map +1 -1
- package/dist/features/composites/reference-text.d.ts +2 -2
- package/dist/features/composites/reference-text.js +4 -4
- package/dist/features/composites/reference-text.js.map +1 -1
- package/dist/features/composites/reference.d.ts +3 -3
- package/dist/features/composites/reference.js +1 -1
- package/dist/features/composites/reference.js.map +1 -1
- package/dist/features/composites/reveal-source.d.ts +3 -3
- package/dist/features/composites/reveal-source.js +6 -6
- package/dist/features/composites/reveal-source.js.map +1 -1
- package/dist/features/composites/rows-model.d.ts +2 -2
- package/dist/features/composites/rows-model.js +4 -3
- package/dist/features/composites/rows-model.js.map +1 -1
- package/dist/features/composites/rows.d.ts +16 -28
- package/dist/features/composites/rows.js +20 -54
- package/dist/features/composites/rows.js.map +1 -1
- package/dist/features/composites/schema.d.ts +12 -11
- package/dist/features/composites/schema.js +10 -9
- package/dist/features/composites/schema.js.map +1 -1
- package/dist/features/composites/source.d.ts +20 -0
- package/dist/features/composites/source.js +40 -0
- package/dist/features/composites/source.js.map +1 -0
- package/dist/features/composites/split.d.ts +11 -11
- package/dist/features/composites/split.js +20 -20
- package/dist/features/composites/split.js.map +1 -1
- package/dist/features/composites/structure-mode.js +3 -3
- package/dist/features/composites/structure-mode.js.map +1 -1
- package/dist/features/composites/table-model.js +2 -2
- package/dist/features/composites/table-model.js.map +1 -1
- package/dist/features/composites/use-composite-inspector.js +3 -1
- package/dist/features/composites/use-composite-inspector.js.map +1 -1
- package/dist/features/composites/use-composite-rows.d.ts +2 -2
- package/dist/features/composites/use-composite-rows.js.map +1 -1
- package/dist/features/composites/vue.js +1 -1
- package/dist/features/composites/vue.js.map +1 -1
- package/dist/features/image-studio/components/ImageStudioDialog.js +1 -1
- package/dist/features/image-studio/components/ImageStudioDialog.js.map +1 -1
- package/dist/features/image-studio/components/ImageStudioDialog.vue.d.ts +1 -1
- package/dist/features/image-studio/components/ImageStudioView.js.map +1 -1
- package/dist/features/image-studio/feature.d.ts +1 -1
- package/dist/features/image-studio/feature.js +1 -1
- package/dist/features/image-studio/feature.js.map +1 -1
- package/dist/features/image-studio/node-core.d.ts +3 -3
- package/dist/features/image-studio/node-core.js +1 -1
- package/dist/features/image-studio/node-core.js.map +1 -1
- package/dist/features/image-studio/node-store.d.ts +1 -1
- package/dist/features/image-studio/node-store.js +1 -1
- package/dist/features/image-studio/node-store.js.map +1 -1
- package/dist/features/image-studio/react/ImageStudioDialog.d.ts +1 -1
- package/dist/features/image-studio/react/ImageStudioDialog.js +1 -1
- package/dist/features/image-studio/react/ImageStudioDialog.js.map +1 -1
- package/dist/features/image-studio/react/ImageStudioView.js +1 -1
- package/dist/features/image-studio/react/ImageStudioView.js.map +1 -1
- package/dist/features/image-studio/react/store.d.ts +3 -3
- package/dist/features/image-studio/react/store.js.map +1 -1
- package/dist/features/image-studio/react.d.ts +1 -1
- package/dist/features/image-studio/react.js +1 -1
- package/dist/features/image-studio/react.js.map +1 -1
- package/dist/features/image-studio/schema.d.ts +1 -1
- package/dist/features/image-studio/schema.js +1 -1
- package/dist/features/image-studio/schema.js.map +1 -1
- package/dist/features/image-studio/state.d.ts +3 -3
- package/dist/features/image-studio/state.js +2 -2
- package/dist/features/image-studio/state.js.map +1 -1
- package/dist/features/image-studio/store.d.ts +3 -3
- package/dist/features/image-studio/vue.d.ts +1 -1
- package/dist/features/image-studio/vue.js +1 -1
- package/dist/features/image-studio/vue.js.map +1 -1
- package/dist/features/media/index.js +1 -1
- package/dist/features/media/react/AudioRecorderModal.js +1 -1
- package/dist/features/media/react.js +1 -1
- package/dist/features/mentions/tag.js +2 -1
- package/dist/features/mentions/tag.js.map +1 -1
- package/dist/features/themes/components/SettingsAppearanceTab.js +1 -1
- package/dist/features/themes/components/SettingsAppearanceTab.js.map +1 -1
- package/dist/features/themes/feature.d.ts +1 -1
- package/dist/features/themes/feature.js.map +1 -1
- package/dist/features/themes/react/SettingsAppearanceTab.d.ts +1 -1
- package/dist/features/themes/react/SettingsAppearanceTab.js +1 -1
- package/dist/features/themes/react/SettingsAppearanceTab.js.map +1 -1
- package/dist/features/themes/theme-runtime.js +1 -1
- package/dist/features/themes/theme-runtime.js.map +1 -1
- package/dist/features/transcript/TranscriptSegmentView.js +1 -1
- package/dist/features/transcript/TranscriptSegmentView.js.map +1 -1
- package/dist/features/transcript/react/TranscriptSegmentView.js +1 -1
- package/dist/features/transcript/react/TranscriptSegmentView.js.map +1 -1
- package/dist/features/transcript/segment-node.js.map +1 -1
- package/dist/features/transfer/feature.js +1 -1
- package/dist/features/transfer/feature.js.map +1 -1
- package/dist/features/transfer/transforms.d.ts +4 -4
- package/dist/features/transfer/transforms.js +12 -12
- package/dist/features/transfer/transforms.js.map +1 -1
- package/dist/i18n/de/ai.js +4 -4
- package/dist/i18n/de/ai.js.map +1 -1
- package/dist/i18n/de/authors.js +1 -1
- package/dist/i18n/de/authors.js.map +1 -1
- package/dist/i18n/de/comments.js +1 -1
- package/dist/i18n/de/comments.js.map +1 -1
- package/dist/i18n/de/composites.js +62 -59
- package/dist/i18n/de/composites.js.map +1 -1
- package/dist/i18n/de/image-studio.js +2 -2
- package/dist/i18n/de/image-studio.js.map +1 -1
- package/dist/i18n/de/integrations.js +20 -20
- package/dist/i18n/de/integrations.js.map +1 -1
- package/dist/i18n/de/markdown.js +1 -1
- package/dist/i18n/de/markdown.js.map +1 -1
- package/dist/i18n/de/palette.js +1 -1
- package/dist/i18n/de/palette.js.map +1 -1
- package/dist/i18n/de/themes.js +3 -3
- package/dist/i18n/de/themes.js.map +1 -1
- package/dist/i18n/de/transfer.js +2 -2
- package/dist/i18n/de/transfer.js.map +1 -1
- package/dist/i18n/de/tree.js +6 -6
- package/dist/i18n/de/tree.js.map +1 -1
- package/dist/i18n/de.d.ts +101 -98
- package/dist/i18n/en/ai.js +2 -2
- package/dist/i18n/en/ai.js.map +1 -1
- package/dist/i18n/en/composites.js +64 -61
- package/dist/i18n/en/composites.js.map +1 -1
- package/dist/i18n/en/integrations.js +9 -9
- package/dist/i18n/en/integrations.js.map +1 -1
- package/dist/i18n/en/markdown.js +1 -1
- package/dist/i18n/en/markdown.js.map +1 -1
- package/dist/i18n/en/palette.js +1 -1
- package/dist/i18n/en/palette.js.map +1 -1
- package/dist/i18n/en/themes.js +4 -4
- package/dist/i18n/en/themes.js.map +1 -1
- package/dist/i18n/en/tree.js +5 -5
- package/dist/i18n/en/tree.js.map +1 -1
- package/dist/index.d.ts +4 -1
- package/dist/integrations/composite-ai/bibliography-fetch.d.ts +6 -6
- package/dist/integrations/composite-ai/bibliography-fetch.js +19 -19
- package/dist/integrations/composite-ai/bibliography-fetch.js.map +1 -1
- package/dist/integrations/composite-ai/composite-fill.d.ts +4 -4
- package/dist/integrations/composite-ai/composite-fill.js +5 -5
- package/dist/integrations/composite-ai/composite-fill.js.map +1 -1
- package/dist/integrations/composite-ai/composite-summary.d.ts +2 -2
- package/dist/integrations/composite-ai/composite-summary.js +5 -5
- package/dist/integrations/composite-ai/composite-summary.js.map +1 -1
- package/dist/integrations/composite-ai/derive.d.ts +17 -17
- package/dist/integrations/composite-ai/derive.js +27 -26
- package/dist/integrations/composite-ai/derive.js.map +1 -1
- package/dist/integrations/composite-ai/index.d.ts +14 -15
- package/dist/integrations/composite-ai/index.js +98 -77
- package/dist/integrations/composite-ai/index.js.map +1 -1
- package/dist/integrations/composite-ai/outline-sanitize.d.ts +1 -1
- package/dist/integrations/composite-ai/outline-sanitize.js +1 -1
- package/dist/integrations/composite-ai/outline-sanitize.js.map +1 -1
- package/dist/integrations/composite-ai/rendition.d.ts +9 -9
- package/dist/integrations/composite-ai/rendition.js +27 -27
- package/dist/integrations/composite-ai/rendition.js.map +1 -1
- package/dist/integrations/composite-ai/split.d.ts +8 -8
- package/dist/integrations/composite-ai/split.js +12 -12
- package/dist/integrations/composite-ai/split.js.map +1 -1
- package/dist/integrations/composite-ai/transfer-transforms.d.ts +2 -2
- package/dist/integrations/composite-ai/transfer-transforms.js +12 -12
- package/dist/integrations/composite-ai/transfer-transforms.js.map +1 -1
- package/dist/integrations/composite-media/index.d.ts +4 -3
- package/dist/integrations/composite-media/index.js +20 -14
- package/dist/integrations/composite-media/index.js.map +1 -1
- package/dist/markdown/document.js +1 -1
- package/dist/markdown/document.js.map +1 -1
- package/dist/nuxt/module.d.ts +30 -24
- package/dist/nuxt/module.js.map +1 -1
- package/dist/nuxt/runtime/server/plugins/editor-server.js +3 -2
- package/dist/nuxt/runtime/server/plugins/editor-server.js.map +1 -1
- package/dist/presets/compose.d.ts +6 -6
- package/dist/presets/compose.js +8 -5
- package/dist/presets/compose.js.map +1 -1
- package/dist/react/AdvancedEditor.d.ts +2 -2
- package/dist/react/AdvancedEditor.js +1 -1
- package/dist/react/AdvancedEditor.js.map +1 -1
- package/dist/react/compose.d.ts +1 -1
- package/dist/react/compose.js +2 -2
- package/dist/react/compose.js.map +1 -1
- package/dist/react/composed-surface.d.ts +5 -5
- package/dist/react/composed-surface.js +2 -2
- package/dist/react/composed-surface.js.map +1 -1
- package/dist/server/ai.d.ts +7 -7
- package/dist/server/ai.js +1 -1
- package/dist/server/ai.js.map +1 -1
- package/dist/server/auth.d.ts +1 -1
- package/dist/server/collab-state.d.ts +1 -1
- package/dist/server/collab-state.js.map +1 -1
- package/dist/server/collab.d.ts +4 -4
- package/dist/server/collab.js +22 -17
- package/dist/server/collab.js.map +1 -1
- package/dist/server/handlers/ai.d.ts +7 -4
- package/dist/server/handlers/ai.js +13 -17
- package/dist/server/handlers/ai.js.map +1 -1
- package/dist/server/handlers/context.d.ts +4 -0
- package/dist/server/handlers/context.js.map +1 -1
- package/dist/server/handlers/editor.d.ts +33 -32
- package/dist/server/handlers/editor.js +13 -8
- package/dist/server/handlers/editor.js.map +1 -1
- package/dist/server/handlers/images.d.ts +1 -1
- package/dist/server/handlers/images.js +1 -1
- package/dist/server/handlers/images.js.map +1 -1
- package/dist/server/host.d.ts +4 -0
- package/dist/server/host.js +10 -2
- package/dist/server/host.js.map +1 -1
- package/dist/server/index.d.ts +3 -3
- package/dist/server/ports.d.ts +8 -8
- package/dist/server/ports.js.map +1 -1
- package/dist/settings/index.d.ts +20 -19
- package/dist/settings/index.js +25 -24
- package/dist/settings/index.js.map +1 -1
- package/dist/settings/migrate.d.ts +18 -0
- package/dist/settings/migrate.js +46 -0
- package/dist/settings/migrate.js.map +1 -0
- package/dist/settings/values.d.ts +12 -12
- package/dist/settings/values.js +11 -11
- package/dist/settings/values.js.map +1 -1
- package/dist/styles/composites.css +10 -10
- package/dist/tree/DocumentTree.js +12 -5
- package/dist/tree/DocumentTree.js.map +1 -1
- package/dist/tree/drop-rules.js +5 -5
- package/dist/tree/drop-rules.js.map +1 -1
- package/dist/tree/react/DocumentTree.js +14 -5
- package/dist/tree/react/DocumentTree.js.map +1 -1
- package/dist/tree/tree-host.js +6 -6
- package/dist/tree/tree-host.js.map +1 -1
- package/dist/tree/tree-items.js +34 -28
- package/dist/tree/tree-items.js.map +1 -1
- package/dist/tree/tree-model.js +16 -16
- package/dist/tree/tree-model.js.map +1 -1
- package/dist/tree/tree-rows.js +2 -2
- package/dist/tree/tree-rows.js.map +1 -1
- package/dist/tree/tree-view-model.d.ts +2 -2
- package/dist/tree/tree-view-model.js.map +1 -1
- package/dist/vue/AdvancedEditor.js +2 -2
- package/dist/vue/AdvancedEditor.js.map +1 -1
- package/dist/vue/AdvancedEditor.vue.d.ts +6 -6
- package/dist/vue/compose.d.ts +1 -1
- package/dist/vue/compose.js +2 -2
- package/dist/vue/compose.js.map +1 -1
- package/package.json +1 -1
- package/dist/features/composites/derivation.d.ts +0 -62
- package/dist/features/composites/derivation.js +0 -102
- package/dist/features/composites/derivation.js.map +0 -1
- package/dist/features/composites/kinds.d.ts +0 -89
- package/dist/features/composites/kinds.js +0 -285
- package/dist/features/composites/kinds.js.map +0 -1
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
//#region src/settings/migrate.ts
|
|
2
|
+
/**
|
|
3
|
+
* Version 2 renamed `ai.slots` to `ai.roles`, `blocks.defaultKind` to `blocks.defaultBlockType`, `blocks.kindIcon` to
|
|
4
|
+
* `blocks.blockTypeIcon` and the `blocks.structure` value `'composite'` to `'structured'` (`migrateEditorSettings`).
|
|
5
|
+
*/
|
|
6
|
+
const EDITOR_SETTINGS_VERSION = 2;
|
|
7
|
+
function record(value) {
|
|
8
|
+
return value && typeof value === "object" && !Array.isArray(value) ? value : {};
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Maps stored settings of version 1 (and the unversioned flat per-browser shape before it) to version 2: `ai.slots` →
|
|
12
|
+
* `ai.roles`, `blocks.defaultKind` → `blocks.defaultBlockType`, `blocks.kindIcon` → `blocks.blockTypeIcon`, the
|
|
13
|
+
* `blocks.structure` value `'composite'` → `'structured'`. A key that is already new wins over the old one; unknown keys
|
|
14
|
+
* and values pass through (`parseEditorSettings` validates). Input of version 2 or later, and anything that is not an
|
|
15
|
+
* object, is returned as it is, so the migration is idempotent. Never mutates `input`.
|
|
16
|
+
*/
|
|
17
|
+
function migrateEditorSettings(input) {
|
|
18
|
+
const root = record(input);
|
|
19
|
+
if (root !== input || typeof root.version === "number" && root.version >= 2) return input;
|
|
20
|
+
const { slots, ...ai } = record(root.ai);
|
|
21
|
+
const { defaultKind, kindIcon, ...blocks } = record(root.blocks);
|
|
22
|
+
const migrated = {
|
|
23
|
+
...root,
|
|
24
|
+
version: 2
|
|
25
|
+
};
|
|
26
|
+
if ("ai" in root) migrated.ai = {
|
|
27
|
+
...slots !== void 0 && { roles: slots },
|
|
28
|
+
...ai
|
|
29
|
+
};
|
|
30
|
+
if ("blocks" in root) migrated.blocks = {
|
|
31
|
+
...defaultKind !== void 0 && { defaultBlockType: defaultKind },
|
|
32
|
+
...kindIcon !== void 0 && { blockTypeIcon: kindIcon },
|
|
33
|
+
...blocks,
|
|
34
|
+
...blocks.structure === "composite" && { structure: "structured" }
|
|
35
|
+
};
|
|
36
|
+
return migrated;
|
|
37
|
+
}
|
|
38
|
+
/** True when `stored` is a settings record older than `EDITOR_SETTINGS_VERSION`: it is written back once, migrated (`migrateEditorSettings`). */
|
|
39
|
+
function isOutdatedEditorSettings(stored) {
|
|
40
|
+
const { version } = record(stored);
|
|
41
|
+
return typeof version !== "number" || version < 2;
|
|
42
|
+
}
|
|
43
|
+
//#endregion
|
|
44
|
+
export { EDITOR_SETTINGS_VERSION, isOutdatedEditorSettings, migrateEditorSettings };
|
|
45
|
+
|
|
46
|
+
//# sourceMappingURL=migrate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"migrate.js","names":[],"sources":["../../src/settings/migrate.ts"],"sourcesContent":["// Read-time migration of stored editor settings: the only place outside tests and `core/schema/persisted-names.ts` that\n// still names the settings keys of version 1 (the legacy-names check exempts this file).\n\n/**\n * Version 2 renamed `ai.slots` to `ai.roles`, `blocks.defaultKind` to `blocks.defaultBlockType`, `blocks.kindIcon` to\n * `blocks.blockTypeIcon` and the `blocks.structure` value `'composite'` to `'structured'` (`migrateEditorSettings`).\n */\nexport const EDITOR_SETTINGS_VERSION = 2\n\nfunction record(value: unknown): Record<string, unknown> {\n return value && typeof value === 'object' && !Array.isArray(value) ? value as Record<string, unknown> : {}\n}\n\n/**\n * Maps stored settings of version 1 (and the unversioned flat per-browser shape before it) to version 2: `ai.slots` →\n * `ai.roles`, `blocks.defaultKind` → `blocks.defaultBlockType`, `blocks.kindIcon` → `blocks.blockTypeIcon`, the\n * `blocks.structure` value `'composite'` → `'structured'`. A key that is already new wins over the old one; unknown keys\n * and values pass through (`parseEditorSettings` validates). Input of version 2 or later, and anything that is not an\n * object, is returned as it is, so the migration is idempotent. Never mutates `input`.\n */\nexport function migrateEditorSettings(input: unknown): unknown {\n const root = record(input)\n if (root !== input || (typeof root.version === 'number' && root.version >= EDITOR_SETTINGS_VERSION)) return input\n const { slots, ...ai } = record(root.ai)\n const { defaultKind, kindIcon, ...blocks } = record(root.blocks)\n const migrated: Record<string, unknown> = { ...root, version: EDITOR_SETTINGS_VERSION }\n if ('ai' in root) migrated.ai = { ...(slots !== undefined && { roles: slots }), ...ai }\n if ('blocks' in root) {\n migrated.blocks = {\n ...(defaultKind !== undefined && { defaultBlockType: defaultKind }),\n ...(kindIcon !== undefined && { blockTypeIcon: kindIcon }),\n ...blocks,\n ...(blocks.structure === 'composite' && { structure: 'structured' }),\n }\n }\n return migrated\n}\n\n/** True when `stored` is a settings record older than `EDITOR_SETTINGS_VERSION`: it is written back once, migrated (`migrateEditorSettings`). */\nexport function isOutdatedEditorSettings(stored: unknown): boolean {\n const { version } = record(stored)\n return typeof version !== 'number' || version < EDITOR_SETTINGS_VERSION\n}\n"],"mappings":";;;;;AAOA,MAAa,0BAA0B;AAEvC,SAAS,OAAO,OAAyC;CACvD,OAAO,SAAS,OAAO,UAAU,YAAY,CAAC,MAAM,QAAQ,KAAK,IAAI,QAAmC,CAAC;AAC3G;;;;;;;;AASA,SAAgB,sBAAsB,OAAyB;CAC7D,MAAM,OAAO,OAAO,KAAK;CACzB,IAAI,SAAS,SAAU,OAAO,KAAK,YAAY,YAAY,KAAK,WAAA,GAAqC,OAAO;CAC5G,MAAM,EAAE,OAAO,GAAG,OAAO,OAAO,KAAK,EAAE;CACvC,MAAM,EAAE,aAAa,UAAU,GAAG,WAAW,OAAO,KAAK,MAAM;CAC/D,MAAM,WAAoC;EAAE,GAAG;EAAM,SAAA;CAAiC;CACtF,IAAI,QAAQ,MAAM,SAAS,KAAK;EAAE,GAAI,UAAU,KAAA,KAAa,EAAE,OAAO,MAAM;EAAI,GAAG;CAAG;CACtF,IAAI,YAAY,MACd,SAAS,SAAS;EAChB,GAAI,gBAAgB,KAAA,KAAa,EAAE,kBAAkB,YAAY;EACjE,GAAI,aAAa,KAAA,KAAa,EAAE,eAAe,SAAS;EACxD,GAAG;EACH,GAAI,OAAO,cAAc,eAAe,EAAE,WAAW,aAAa;CACpE;CAEF,OAAO;AACT;;AAGA,SAAgB,yBAAyB,QAA0B;CACjE,MAAM,EAAE,YAAY,OAAO,MAAM;CACjC,OAAO,OAAO,YAAY,YAAY,UAAA;AACxC"}
|
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
//#region src/settings/values.d.ts
|
|
2
|
-
/**
|
|
3
|
-
export declare const
|
|
4
|
-
export type
|
|
2
|
+
/** Model roles (stored under `ai.roles`): what a model profile can be assigned to; each role is one AI function. */
|
|
3
|
+
export declare const MODEL_ROLES: readonly ["complete", "rewrite", "generate"];
|
|
4
|
+
export type ModelRole = typeof MODEL_ROLES[number];
|
|
5
5
|
/** Target languages of the `translate` task: the stored ids, also the language name the model is asked for; displayed through the catalogs. */
|
|
6
6
|
export declare const AI_LANGUAGES: readonly ["Deutsch", "Englisch", "Französisch", "Spanisch", "Italienisch"];
|
|
7
7
|
export type AiLanguage = (typeof AI_LANGUAGES)[number];
|
|
8
8
|
export declare const HEADING_CONVERSION_SCOPES: readonly ["container", "document", "heading"];
|
|
9
9
|
/** Blocks converted when nothing is selected: the caret's composite body / document, the whole document, or the caret's heading with its content. */
|
|
10
10
|
export type HeadingConversionScope = (typeof HEADING_CONVERSION_SCOPES)[number];
|
|
11
|
-
/** How a user prefers documents structured: Markdown headings, or nested
|
|
12
|
-
export declare const STRUCTURE_MODES: readonly ["flat", "
|
|
11
|
+
/** How a user prefers documents structured: Markdown headings (Flat mode), or nested Typed blocks (Structure mode). */
|
|
12
|
+
export declare const STRUCTURE_MODES: readonly ["flat", "structured"];
|
|
13
13
|
export type StructureMode = (typeof STRUCTURE_MODES)[number];
|
|
14
14
|
/**
|
|
15
|
-
* What the document drawer's tree is rooted in while a
|
|
15
|
+
* What the document drawer's tree is rooted in while a Document with Typed blocks is loaded:
|
|
16
16
|
* `folders` nests files in the store's folders (the file is one entry of the folder tree), `file` makes the loaded
|
|
17
|
-
* file itself the single root, with its Ordner/Dokument
|
|
18
|
-
*
|
|
17
|
+
* file itself the single root, with its Ordner/Dokument Typed blocks as the hierarchy below. Without a loaded Document with Typed blocks
|
|
18
|
+
* the drawer always shows the folders.
|
|
19
19
|
*/
|
|
20
20
|
export declare const TREE_ROOTS: readonly ["folders", "file"];
|
|
21
21
|
export type TreeRoot = (typeof TREE_ROOTS)[number];
|
|
22
|
-
/** When a
|
|
23
|
-
export declare const
|
|
24
|
-
export type
|
|
25
|
-
/** When the standard drag handle of blocks without
|
|
22
|
+
/** When a Typed block shows its Block type icon (the icon is also its drag handle): permanently, or only while hovered, focused or its details are open. */
|
|
23
|
+
export declare const BLOCK_TYPE_ICON_VISIBILITIES: readonly ["always", "hover"];
|
|
24
|
+
export type BlockTypeIconVisibility = (typeof BLOCK_TYPE_ICON_VISIBILITIES)[number];
|
|
25
|
+
/** When the standard drag handle of blocks without Block type icon shows: on the hovered block, or permanently beside every block. */
|
|
26
26
|
export declare const DRAG_HANDLE_VISIBILITIES: readonly ["hover", "always"];
|
|
27
27
|
export type DragHandleVisibility = (typeof DRAG_HANDLE_VISIBILITIES)[number];
|
|
28
28
|
/** How the author colouring mode shows a run's author (authors feature): tinted background or coloured text. */
|
package/dist/settings/values.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
//#region src/settings/values.ts
|
|
2
|
-
/**
|
|
3
|
-
const
|
|
2
|
+
/** Model roles (stored under `ai.roles`): what a model profile can be assigned to; each role is one AI function. */
|
|
3
|
+
const MODEL_ROLES = [
|
|
4
4
|
"complete",
|
|
5
5
|
"rewrite",
|
|
6
6
|
"generate"
|
|
@@ -18,24 +18,24 @@ const HEADING_CONVERSION_SCOPES = [
|
|
|
18
18
|
"document",
|
|
19
19
|
"heading"
|
|
20
20
|
];
|
|
21
|
-
/** How a user prefers documents structured: Markdown headings, or nested
|
|
22
|
-
const STRUCTURE_MODES = ["flat", "
|
|
21
|
+
/** How a user prefers documents structured: Markdown headings (Flat mode), or nested Typed blocks (Structure mode). */
|
|
22
|
+
const STRUCTURE_MODES = ["flat", "structured"];
|
|
23
23
|
/**
|
|
24
|
-
* What the document drawer's tree is rooted in while a
|
|
24
|
+
* What the document drawer's tree is rooted in while a Document with Typed blocks is loaded:
|
|
25
25
|
* `folders` nests files in the store's folders (the file is one entry of the folder tree), `file` makes the loaded
|
|
26
|
-
* file itself the single root, with its Ordner/Dokument
|
|
27
|
-
*
|
|
26
|
+
* file itself the single root, with its Ordner/Dokument Typed blocks as the hierarchy below. Without a loaded Document with Typed blocks
|
|
27
|
+
* the drawer always shows the folders.
|
|
28
28
|
*/
|
|
29
29
|
const TREE_ROOTS = ["folders", "file"];
|
|
30
|
-
/** When a
|
|
31
|
-
const
|
|
32
|
-
/** When the standard drag handle of blocks without
|
|
30
|
+
/** When a Typed block shows its Block type icon (the icon is also its drag handle): permanently, or only while hovered, focused or its details are open. */
|
|
31
|
+
const BLOCK_TYPE_ICON_VISIBILITIES = ["always", "hover"];
|
|
32
|
+
/** When the standard drag handle of blocks without Block type icon shows: on the hovered block, or permanently beside every block. */
|
|
33
33
|
const DRAG_HANDLE_VISIBILITIES = ["hover", "always"];
|
|
34
34
|
/** How the author colouring mode shows a run's author (authors feature): tinted background or coloured text. */
|
|
35
35
|
const AUTHOR_COLOR_STYLES = ["background", "text"];
|
|
36
36
|
/** How a user wants comments shown (comments feature): cards in a margin column beside the text, or a popover at the text with a list in the toolbar. */
|
|
37
37
|
const COMMENTS_LAYOUTS = ["margin", "inline"];
|
|
38
38
|
//#endregion
|
|
39
|
-
export { AI_LANGUAGES, AUTHOR_COLOR_STYLES, COMMENTS_LAYOUTS, DRAG_HANDLE_VISIBILITIES, HEADING_CONVERSION_SCOPES,
|
|
39
|
+
export { AI_LANGUAGES, AUTHOR_COLOR_STYLES, BLOCK_TYPE_ICON_VISIBILITIES, COMMENTS_LAYOUTS, DRAG_HANDLE_VISIBILITIES, HEADING_CONVERSION_SCOPES, MODEL_ROLES, STRUCTURE_MODES, TREE_ROOTS };
|
|
40
40
|
|
|
41
41
|
//# sourceMappingURL=values.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"values.js","names":[],"sources":["../../src/settings/values.ts"],"sourcesContent":["// Inert enum values of the stored settings model. Vue-free and free of feature code: the settings schema imports only\n// this file, features import their values from here. Their presence does not install any feature.\n\n/**
|
|
1
|
+
{"version":3,"file":"values.js","names":[],"sources":["../../src/settings/values.ts"],"sourcesContent":["// Inert enum values of the stored settings model. Vue-free and free of feature code: the settings schema imports only\n// this file, features import their values from here. Their presence does not install any feature.\n\n/** Model roles (stored under `ai.roles`): what a model profile can be assigned to; each role is one AI function. */\nexport const MODEL_ROLES = ['complete', 'rewrite', 'generate'] as const\nexport type ModelRole = typeof MODEL_ROLES[number]\n\n/** Target languages of the `translate` task: the stored ids, also the language name the model is asked for; displayed through the catalogs. */\n// i18n-ignore: stored setting ids, not display text\nexport const AI_LANGUAGES = ['Deutsch', 'Englisch', 'Französisch', 'Spanisch', 'Italienisch'] as const\nexport type AiLanguage = (typeof AI_LANGUAGES)[number]\n\nexport const HEADING_CONVERSION_SCOPES = ['container', 'document', 'heading'] as const\n/** Blocks converted when nothing is selected: the caret's composite body / document, the whole document, or the caret's heading with its content. */\nexport type HeadingConversionScope = (typeof HEADING_CONVERSION_SCOPES)[number]\n\n/** How a user prefers documents structured: Markdown headings (Flat mode), or nested Typed blocks (Structure mode). */\nexport const STRUCTURE_MODES = ['flat', 'structured'] as const\nexport type StructureMode = (typeof STRUCTURE_MODES)[number]\n\n/**\n * What the document drawer's tree is rooted in while a Document with Typed blocks is loaded:\n * `folders` nests files in the store's folders (the file is one entry of the folder tree), `file` makes the loaded\n * file itself the single root, with its Ordner/Dokument Typed blocks as the hierarchy below. Without a loaded Document with Typed blocks\n * the drawer always shows the folders.\n */\nexport const TREE_ROOTS = ['folders', 'file'] as const\nexport type TreeRoot = (typeof TREE_ROOTS)[number]\n\n/** When a Typed block shows its Block type icon (the icon is also its drag handle): permanently, or only while hovered, focused or its details are open. */\nexport const BLOCK_TYPE_ICON_VISIBILITIES = ['always', 'hover'] as const\nexport type BlockTypeIconVisibility = (typeof BLOCK_TYPE_ICON_VISIBILITIES)[number]\n\n/** When the standard drag handle of blocks without Block type icon shows: on the hovered block, or permanently beside every block. */\nexport const DRAG_HANDLE_VISIBILITIES = ['hover', 'always'] as const\nexport type DragHandleVisibility = (typeof DRAG_HANDLE_VISIBILITIES)[number]\n\n/** How the author colouring mode shows a run's author (authors feature): tinted background or coloured text. */\nexport const AUTHOR_COLOR_STYLES = ['background', 'text'] as const\nexport type AuthorColorStyle = (typeof AUTHOR_COLOR_STYLES)[number]\n\n/** How a user wants comments shown (comments feature): cards in a margin column beside the text, or a popover at the text with a list in the toolbar. */\nexport const COMMENTS_LAYOUTS = ['margin', 'inline'] as const\nexport type CommentsLayout = (typeof COMMENTS_LAYOUTS)[number]\n"],"mappings":";;AAIA,MAAa,cAAc;CAAC;CAAY;CAAW;AAAU;;AAK7D,MAAa,eAAe;CAAC;CAAW;CAAY;CAAe;CAAY;AAAa;AAG5F,MAAa,4BAA4B;CAAC;CAAa;CAAY;AAAS;;AAK5E,MAAa,kBAAkB,CAAC,QAAQ,YAAY;;;;;;;AASpD,MAAa,aAAa,CAAC,WAAW,MAAM;;AAI5C,MAAa,+BAA+B,CAAC,UAAU,OAAO;;AAI9D,MAAa,2BAA2B,CAAC,SAAS,QAAQ;;AAI1D,MAAa,sBAAsB,CAAC,cAAc,MAAM;;AAIxD,MAAa,mBAAmB,CAAC,UAAU,QAAQ"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/* Styles of the composite feature (`@ecsplico/editor/composites`); import after `core.css`. */
|
|
2
2
|
/* Colour baskets (`compositeFeature({ baskets })`): the default set's colours, light and dark like `tokens.css` (the host sets
|
|
3
3
|
`.dark`). Declared under `:where()` (specificity 0), a host's rule always wins; a custom basket brings its own `color`.
|
|
4
|
-
`--sk-
|
|
4
|
+
`--sk-block-type-tone-mix` is how strongly a Block type's tone (`BlockType.chrome.tone`) tints the Typed block surface. */
|
|
5
5
|
:where(:root) {
|
|
6
|
-
--sk-
|
|
6
|
+
--sk-block-type-tone-mix: 8%;
|
|
7
7
|
--sk-basket-red: #ef4444;
|
|
8
8
|
--sk-basket-orange: #f97316;
|
|
9
9
|
--sk-basket-yellow: #eab308;
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
:where(.dark) {
|
|
15
|
-
--sk-
|
|
15
|
+
--sk-block-type-tone-mix: 14%;
|
|
16
16
|
--sk-basket-red: #f87171;
|
|
17
17
|
--sk-basket-orange: #fb923c;
|
|
18
18
|
--sk-basket-yellow: #facc15;
|
|
@@ -29,11 +29,11 @@
|
|
|
29
29
|
padding-left: 1.25rem;
|
|
30
30
|
border-left: 2px solid var(--sk-border);
|
|
31
31
|
}
|
|
32
|
-
/*
|
|
32
|
+
/* Block type tone: the node view sets `data-block-type-tone` and `--sk-block-type-tone` on a Typed block whose Block type has `chrome.tone`; Block types without one are untouched.
|
|
33
33
|
Declared before the basket stripe, which wins on the border when both apply. */
|
|
34
|
-
.tiptap .composite[data-
|
|
35
|
-
background: color-mix(in oklab, var(--sk-
|
|
36
|
-
border-left-color: var(--sk-
|
|
34
|
+
.tiptap .composite[data-block-type-tone] {
|
|
35
|
+
background: color-mix(in oklab, var(--sk-block-type-tone) var(--sk-block-type-tone-mix), transparent);
|
|
36
|
+
border-left-color: var(--sk-block-type-tone);
|
|
37
37
|
}
|
|
38
38
|
/* The node view sets `--sk-basket-color` of a composite in a colour basket (`compositeFeature({ baskets })`); the colours of the default set are the tokens above. */
|
|
39
39
|
/* Basket stripe: the border takes the basket's colour; the inset shadow thickens it at every nesting depth without moving content. */
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
.tiptap .composite[data-title-hidden] > .composite__content > .composite-title { display: none; }
|
|
48
48
|
.tiptap .composite .composite { margin: 1em 0; }
|
|
49
49
|
.tiptap .composite .composite .composite { margin: 0.75em 0; padding-left: 1rem; border-left-width: 1px; }
|
|
50
|
-
/* Derived
|
|
50
|
+
/* Derived Typed block (has a `meta.derivation`) that is not opened: a short faded preview. The content stays laid out and
|
|
51
51
|
only clipped, so ProseMirror positions and measurements stay valid; a caret inside opens it (`CompositeNode`). */
|
|
52
52
|
.tiptap .composite.is-collapsed > .composite__content {
|
|
53
53
|
max-height: 7rem;
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
/* Description and tags rows are data only: the chips and the details popover of `CompositeChrome` show and edit them. */
|
|
83
83
|
.tiptap .composite-description,
|
|
84
84
|
.tiptap .composite-tags { display: none; }
|
|
85
|
-
/* Focus mode (`focusComposite`): the decorations of `CompositeFocus` hide every sibling of the focused
|
|
85
|
+
/* Focus mode (`focusComposite`): the decorations of `CompositeFocus` hide every sibling of the focused Typed block
|
|
86
86
|
(`sk-focus-target`) and of each ancestor (`sk-focus-ancestor`). An ancestor keeps its title (its description and tags
|
|
87
87
|
rows are hidden above anyway; its title, description and tags are not siblings in the sense of the decorations). */
|
|
88
88
|
.tiptap .sk-focus-hidden { display: none !important; }
|
|
@@ -94,7 +94,7 @@
|
|
|
94
94
|
pointer-events: none;
|
|
95
95
|
content: var(--composite-title-placeholder, '');
|
|
96
96
|
}
|
|
97
|
-
/* Inline reference to a
|
|
97
|
+
/* Inline reference to a Typed block (`[@`): a link-like pill in the primary colour; greyed and struck when the target is gone. */
|
|
98
98
|
.tiptap .reference {
|
|
99
99
|
color: var(--sk-primary);
|
|
100
100
|
background: color-mix(in oklab, var(--sk-primary) 12%, transparent);
|
|
@@ -77,7 +77,7 @@ const _hoisted_25 = {
|
|
|
77
77
|
class: "px-2.5 py-1.5 text-sm text-[var(--sk-muted)]"
|
|
78
78
|
};
|
|
79
79
|
const basketOption = "flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-left text-sm text-[var(--sk-fg)] transition-colors duration-150 hover:bg-[var(--sk-bg-elevated)] focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-[var(--sk-primary)]";
|
|
80
|
-
/** The breadcrumb of the focus: the document (first crumb, leaves focus) and the
|
|
80
|
+
/** The breadcrumb of the focus: the document (first crumb, leaves focus) and the Typed blocks down to the focused one. */
|
|
81
81
|
const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
82
82
|
__name: "DocumentTree",
|
|
83
83
|
props: /*@__PURE__*/ mergeModels({
|
|
@@ -100,7 +100,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
100
100
|
selectedFolder
|
|
101
101
|
});
|
|
102
102
|
const { settings } = useEditorSettings();
|
|
103
|
-
const canUseFileRoot = computed(() => state.value.hasEditor && state.value.structure === "
|
|
103
|
+
const canUseFileRoot = computed(() => state.value.hasEditor && state.value.structure === "structured");
|
|
104
104
|
function toggleTreeRoot() {
|
|
105
105
|
settings.value.blocks.treeRoot = settings.value.blocks.treeRoot === "file" ? "folders" : "file";
|
|
106
106
|
}
|
|
@@ -173,7 +173,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
173
173
|
if (!event.dataTransfer) return model.value.dragEnd();
|
|
174
174
|
event.dataTransfer.setData(DRAG_MIME, JSON.stringify(payload));
|
|
175
175
|
const editor = props.editor;
|
|
176
|
-
const found = payload.type === "
|
|
176
|
+
const found = payload.type === "typedBlock" && editor && !editor.isDestroyed ? findBlockById(editor.state.doc, payload.blockId) : null;
|
|
177
177
|
const transfer = found && editor ? blockTransferOf(editor, found.pos) : null;
|
|
178
178
|
if (transfer) writeBlockTransfer(event.dataTransfer, transfer);
|
|
179
179
|
event.dataTransfer.effectAllowed = transfer ? "copyMove" : "move";
|
|
@@ -392,7 +392,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
392
392
|
name: "i-lucide-chevron-right",
|
|
393
393
|
class: normalizeClass(["size-3.5 shrink-0 text-[var(--sk-muted)] transition-transform", row(item).open && "rotate-90"]),
|
|
394
394
|
onClick: ($event) => onChevronClick($event, item)
|
|
395
|
-
}, null, 8, ["class", "onClick"])) : item.type === "
|
|
395
|
+
}, null, 8, ["class", "onClick"])) : item.type === "typedBlock" || item.type === "heading" ? (openBlock(), createElementBlock("span", _hoisted_17)) : createCommentVNode("v-if", true),
|
|
396
396
|
createVNode(unref(UIcon), {
|
|
397
397
|
name: item.icon,
|
|
398
398
|
class: "size-4 shrink-0",
|
|
@@ -454,6 +454,13 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
454
454
|
class: "size-3.5 shrink-0 text-[var(--sk-muted)]",
|
|
455
455
|
title: unref(t)("tree.summary")
|
|
456
456
|
}, null, 8, ["title"])) : createCommentVNode("v-if", true),
|
|
457
|
+
item.sourceMissing ? (openBlock(), createBlock(unref(UIcon), {
|
|
458
|
+
key: 2,
|
|
459
|
+
name: "i-lucide-unlink",
|
|
460
|
+
class: "size-3.5 shrink-0 text-[var(--sk-warning)]",
|
|
461
|
+
title: unref(t)("composites.derivation.sourceMissing"),
|
|
462
|
+
"data-source-missing": ""
|
|
463
|
+
}, null, 8, ["title"])) : createCommentVNode("v-if", true),
|
|
457
464
|
createElementVNode("div", {
|
|
458
465
|
class: "flex shrink-0",
|
|
459
466
|
onClick: _cache[11] || (_cache[11] = withModifiers(() => {}, ["stop"]))
|
|
@@ -479,7 +486,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
479
486
|
])]),
|
|
480
487
|
_: 2
|
|
481
488
|
}, 1032, ["items"])) : createCommentVNode("v-if", true), createElementVNode("div", _hoisted_22, [
|
|
482
|
-
item.type === "
|
|
489
|
+
item.type === "typedBlock" && item.blockId ? (openBlock(), createBlock(unref(UButton), {
|
|
483
490
|
key: 0,
|
|
484
491
|
icon: "i-lucide-focus",
|
|
485
492
|
size: "xs",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DocumentTree.js","names":["_useModel","_openBlock","_createElementBlock","_createElementVNode","_createVNode","_unref","_withKeys","_createSlots","_withCtx","_createCommentVNode","_createBlock","_Fragment","_renderList","_normalizeClass","_normalizeStyle","_toDisplayString","_withModifiers","_createTextVNode","_renderSlot"],"sources":["../../src/tree/DocumentTree.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { Editor } from '@tiptap/core'\nimport { computed } from 'vue'\nimport { BLOCK_MIME, blockTransferOf, readBlockTransfer, writeBlockTransfer } from '../core/block-transfer'\nimport { findBlockById } from '../core/schema/block-ids'\nimport type { DropdownItem } from '../vue/kit/types'\nimport { useUiKit } from '../vue/kit/use-ui-kit'\nimport { useEditorSettings } from '../vue/settings'\nimport { useEditorI18n } from '../vue/use-editor-i18n'\nimport type { DocumentStore } from './store'\nimport { basketById } from '../features/composites'\nimport { DRAG_MIME, focusCrumbs, itemBasket, type TreeItem } from './tree-items'\nimport { rowOf } from './tree-model'\nimport { useTreeModel } from './use-tree-model'\n\n// File browser of a document store: a „Dokumente“ root with folders and documents. It only renders the `TreeModel` (see\n// `tree-model.ts`), which owns what is open, filtered, selected, dragged and renamed; the React twin renders the same model.\n\nconst props = defineProps<{\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}>()\n\ndefineSlots<{\n /** Host actions on a document row, rendered next to its delete button (e.g. a download link). */\n 'document-actions'?: (props: { id: string, title: string }) => unknown\n}>()\n\n/** The folder new documents, folders and host imports go to. Reset to `''` when it is deleted or moved away. */\nconst selectedFolder = defineModel<string>('selectedFolder', { default: '' })\n\nconst { t } = useEditorI18n()\nconst { Button: UButton, DropdownMenu: UDropdownMenu, Icon: UIcon, Input: UInput, Popover: UPopover, Tooltip: UTooltip, Tree: UTree } = useUiKit()\nconst { model, state } = useTreeModel({ store: () => props.store, editor: () => props.editor, selectedFolder })\nconst { settings } = useEditorSettings()\n\n// Mirrors the model's `isVirtual` rule: the file root only takes effect for a composite document that is open. Without\n// it the button is disabled (and says why) instead of letting the setting silently fall back to the folders.\nconst canUseFileRoot = computed(() => state.value.hasEditor && state.value.structure === 'composite')\n\nfunction toggleTreeRoot() {\n settings.value.blocks.treeRoot = settings.value.blocks.treeRoot === 'file' ? 'folders' : 'file'\n}\n\nconst row = (item: TreeItem) => rowOf(state.value, item, t)\n\n/** The basket `item` is in, when the open editor offers it (the row shows its colour as a dot). */\nconst basketOf = (item: TreeItem) => itemBasket(item, state.value.baskets)\n\n/** The basket filter button needs a live editor that offers baskets. */\nconst showBasketFilter = computed(() => state.value.hasEditor && state.value.baskets.length > 0)\n/** The chosen baskets the open editor offers (an unknown id never filters, see `TreeModel`). */\nconst shownBaskets = computed(() => state.value.basketFilter.filter(id => basketById(state.value.baskets, id)))\nconst basketOption = 'flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-left text-sm text-[var(--sk-fg)] transition-colors duration-150 hover:bg-[var(--sk-bg-elevated)] focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-[var(--sk-primary)]'\n\n/** The breadcrumb of the focus: the document (first crumb, leaves focus) and the Bausteine down to the focused one. */\nconst breadcrumb = computed(() => focusCrumbs(state.value.focusPath))\n\n/** Why dropping the drag on `item` is refused, while the pointer is over it. */\nfunction refusal(item: TreeItem): string | null {\n const drop = row(item).drop\n return drop && !drop.ok ? drop.reason : null\n}\n\n/** UTree reports the keys of the rows it wants open; the model decides what that changes. */\nfunction onExpanded(next: string[]) {\n const wanted = new Set(next)\n const open = new Set(state.value.view.open)\n for (const key of wanted) if (!open.has(key)) model.value.setOpen(key, true)\n for (const key of open) if (!wanted.has(key)) model.value.setOpen(key, false)\n}\n\n/** The label split around the part the title filter matched, `null` when it did not match here. */\nfunction labelParts(item: TreeItem): [string, string, string] | null {\n const match = row(item).match\n if (!match) return null\n const [at, length] = match\n return [item.label.slice(0, at), item.label.slice(at, at + length), item.label.slice(at + length)]\n}\n\n// Folders and the root toggle through the tree's own row click; documents and outline entries (whose row click opens or\n// reveals) toggle through their chevron.\nfunction onChevronClick(event: Event, item: TreeItem) {\n if (item.type === 'root' || item.type === 'folder') return\n event.stopPropagation()\n model.value.toggle(item.key)\n}\n\nfunction filterMenu(item: TreeItem): DropdownItem[][] {\n const { filterKinds, hiddenKinds } = row(item)\n const groups: DropdownItem[][] = [[\n { type: 'label', label: t('tree.filter.show') },\n ...filterKinds.map<DropdownItem>(kind => ({\n label: kind.label,\n icon: kind.icon,\n type: 'checkbox',\n checked: !hiddenKinds.includes(kind.id),\n onUpdateChecked: visible => model.value.setKindHidden(item.key, kind.id, !visible),\n // Stay open: several kinds are usually toggled in one go.\n onSelect: event => event.preventDefault(),\n })),\n ]]\n if (hiddenKinds.length) groups.push([{ label: t('tree.filter.reset'), icon: 'i-lucide-filter-x', onSelect: () => model.value.clearFilter(item.key) }])\n return groups\n}\n\nfunction addMenu(item: TreeItem): DropdownItem[][] {\n return model.value.addMenu(item).map(group => group.map(entry => ({ label: entry.label, icon: entry.icon, onSelect: entry.run })))\n}\n\n// --- drag & drop -----------------------------------------------------------------------------------------------\n\nfunction onDragStart(event: DragEvent, item: TreeItem) {\n const payload = model.value.dragStart(item)\n if (!payload) return event.preventDefault()\n if (!event.dataTransfer) return model.value.dragEnd()\n event.dataTransfer.setData(DRAG_MIME, JSON.stringify(payload))\n // A Baustein row also carries the block itself, so another surface or tree can take a copy.\n const editor = props.editor\n const found = payload.type === 'composite' && editor && !editor.isDestroyed ? findBlockById(editor.state.doc, payload.blockId) : null\n const transfer = found && editor ? blockTransferOf(editor, found.pos) : null\n if (transfer) writeBlockTransfer(event.dataTransfer, transfer)\n event.dataTransfer.effectAllowed = transfer ? 'copyMove' : 'move'\n}\n\n/** A drag of this tree's own rows is running (a foreign drag is not). */\nconst ownDrag = () => !!state.value.drag && state.value.drag.source.type !== 'foreign-block'\n\nfunction onDragOver(event: DragEvent, item: TreeItem) {\n const foreign = !ownDrag() && !!event.dataTransfer?.types.includes(BLOCK_MIME)\n const verdict = foreign ? model.value.foreignDragOver(item) : model.value.dragOver(item)\n if (!verdict) return\n // Only an allowed target takes the drop; over a refused one the browser shows „not allowed“ and the row shows why.\n if (verdict.ok) event.preventDefault()\n if (event.dataTransfer) event.dataTransfer.dropEffect = verdict.ok ? (foreign ? 'copy' : 'move') : 'none'\n}\n\nfunction onDragLeave(event: DragEvent, item: TreeItem) {\n if (!(event.currentTarget as Node).contains(event.relatedTarget as Node | null)) model.value.dragLeave(item)\n}\n\nfunction onDrop(event: DragEvent, item: TreeItem) {\n if (ownDrag()) {\n event.preventDefault()\n return model.value.drop(item)\n }\n const payload = event.dataTransfer ? readBlockTransfer(event.dataTransfer) : null\n if (!payload) return\n event.preventDefault()\n return model.value.dropForeign(item, payload, event.shiftKey, event.clientX, event.clientY)\n}\n</script>\n\n<template>\n <div class=\"flex flex-col gap-2\">\n <div class=\"flex items-center gap-1\">\n <UInput\n :model-value=\"state.filterText\"\n class=\"min-w-0 flex-1\"\n icon=\"i-lucide-search\"\n size=\"sm\"\n :placeholder=\"t('tree.filterText.placeholder')\"\n :aria-label=\"t('tree.filterText.placeholder')\"\n @update:model-value=\"model.setFilterText($event)\"\n @keydown.esc=\"model.setFilterText('')\"\n >\n <template v-if=\"state.filterText\" #trailing>\n <UButton\n icon=\"i-lucide-x\"\n size=\"xs\"\n color=\"neutral\"\n variant=\"link\"\n :aria-label=\"t('tree.filterText.clear')\"\n @click=\"model.setFilterText('')\"\n />\n </template>\n </UInput>\n <!-- A popover, not a dropdown menu: a menu item cannot show a dot in an arbitrary CSS colour. -->\n <UPopover\n v-if=\"showBasketFilter\"\n :content=\"{ side: 'bottom', align: 'end', sideOffset: 4, onCloseAutoFocus: (event: Event) => event.preventDefault() }\"\n :ui=\"{ content: 'w-44 p-1' }\"\n >\n <UButton\n icon=\"i-lucide-paint-bucket\"\n size=\"xs\"\n :color=\"shownBaskets.length ? 'primary' : 'neutral'\"\n :variant=\"shownBaskets.length ? 'soft' : 'ghost'\"\n :title=\"t('tree.basketFilter.label')\"\n :aria-label=\"t('tree.basketFilter.label')\"\n />\n <template #content>\n <div role=\"menu\" :aria-label=\"t('tree.basketFilter.label')\">\n <button\n v-for=\"basket in state.baskets\"\n :key=\"basket.id\"\n type=\"button\"\n role=\"menuitemcheckbox\"\n :aria-checked=\"shownBaskets.includes(basket.id)\"\n :class=\"basketOption\"\n @click=\"model.setBasketShown(basket.id, !shownBaskets.includes(basket.id))\"\n >\n <span class=\"size-2.5 shrink-0 rounded-full\" :style=\"{ backgroundColor: basket.color }\" />\n <span class=\"truncate\">{{ basket.label }}</span>\n <UIcon v-if=\"shownBaskets.includes(basket.id)\" name=\"i-lucide-check\" class=\"ml-auto size-3.5 shrink-0\" />\n </button>\n <button v-if=\"shownBaskets.length\" type=\"button\" role=\"menuitem\" :class=\"basketOption\" @click=\"model.clearBasketFilter()\">\n <UIcon name=\"i-lucide-filter-x\" class=\"size-3.5 shrink-0 text-[var(--sk-muted)]\" />\n <span class=\"truncate\">{{ t('tree.basketFilter.reset') }}</span>\n </button>\n </div>\n </template>\n </UPopover>\n </div>\n\n <div class=\"flex items-center justify-end\">\n <UTooltip :text=\"canUseFileRoot ? '' : t('tree.root.unavailable')\">\n <!-- A disabled button swallows pointer events, so the tooltip hangs on the wrapper. -->\n <span class=\"inline-flex\">\n <UButton\n :icon=\"state.virtual ? 'i-lucide-file-stack' : 'i-lucide-folder-tree'\"\n :label=\"t(state.virtual ? 'tree.root.file' : 'tree.root.folders')\"\n size=\"xs\"\n color=\"neutral\"\n :variant=\"state.virtual ? 'soft' : 'ghost'\"\n :disabled=\"!canUseFileRoot\"\n :aria-pressed=\"state.virtual\"\n @click=\"toggleTreeRoot\"\n />\n </span>\n </UTooltip>\n </div>\n\n <div v-if=\"state.view.hasKindFilters\" class=\"flex items-center\">\n <UButton\n icon=\"i-lucide-filter-x\"\n :label=\"t('tree.filter.reset')\"\n size=\"xs\"\n color=\"neutral\"\n variant=\"subtle\"\n @click=\"model.clearAllFilters\"\n />\n </div>\n\n <div v-if=\"state.creatingFolder\" class=\"flex flex-col gap-1\">\n <UInput\n :model-value=\"state.creatingFolder.draft\"\n size=\"sm\"\n autofocus\n :color=\"state.creatingFolder.error ? 'error' : undefined\"\n :highlight=\"!!state.creatingFolder.error\"\n :placeholder=\"state.creatingFolder.parent ? t('tree.folder.placeholderIn', { parent: state.creatingFolder.parent }) : t('tree.folder.placeholder')\"\n :aria-label=\"t('tree.folder.name')\"\n :aria-invalid=\"!!state.creatingFolder.error\"\n @update:model-value=\"model.setFolderDraft($event)\"\n @keydown.enter=\"model.commitCreateFolder\"\n @keydown.esc=\"model.cancelCreateFolder\"\n @blur=\"model.cancelCreateFolder\"\n />\n <p v-if=\"state.creatingFolder.error\" class=\"px-0.5 text-xs text-[var(--sk-danger)]\" role=\"alert\">\n {{ state.creatingFolder.error }}\n </p>\n </div>\n\n <div v-if=\"breadcrumb.crumbs.length\" class=\"flex flex-wrap items-center gap-0.5 text-xs\">\n <UButton\n icon=\"i-lucide-corner-up-left\"\n :label=\"breadcrumb.document?.label ?? t('tree.focus.root')\"\n size=\"xs\"\n color=\"neutral\"\n variant=\"ghost\"\n :title=\"t('tree.focus.leave')\"\n :aria-label=\"t('tree.focus.leave')\"\n @click=\"model.defocus()\"\n />\n <template v-for=\"(crumb, index) in breadcrumb.crumbs\" :key=\"crumb.key\">\n <UIcon name=\"i-lucide-chevron-right\" class=\"size-3 shrink-0 text-[var(--sk-muted)]\" />\n <span v-if=\"index === breadcrumb.crumbs.length - 1\" class=\"min-w-0 truncate px-1.5 font-medium\" aria-current=\"location\">{{ crumb.label }}</span>\n <UButton v-else :label=\"crumb.label\" size=\"xs\" color=\"neutral\" variant=\"ghost\" @click=\"model.focus(crumb.key)\" />\n </template>\n </div>\n\n <p v-if=\"!state.tree && !state.virtual\" class=\"px-2.5 py-1.5 text-sm text-[var(--sk-muted)]\">\n {{ state.tree === null ? t('tree.loadFailed') : t('tree.loading') }}\n </p>\n\n <UTree\n v-else\n :expanded=\"state.view.open\"\n :items=\"state.view.items\"\n :get-key=\"(item: TreeItem) => item.key\"\n size=\"sm\"\n :aria-label=\"t('tree.aria')\"\n @update:expanded=\"onExpanded\"\n >\n <template #item-wrapper=\"{ item }: { item: TreeItem }\">\n <div class=\"w-full\">\n <div\n class=\"group flex w-full cursor-pointer items-center gap-1.5 rounded-md px-2 py-1 text-sm select-none hover:bg-[color-mix(in_oklab,var(--sk-bg-elevated)_60%,transparent)]\"\n :class=\"[\n row(item).active && 'bg-[color-mix(in_oklab,var(--sk-primary)_10%,transparent)] font-medium text-[var(--sk-primary)]',\n row(item).selected && 'bg-[var(--sk-bg-elevated)]',\n row(item).drop?.ok && 'ring-1 ring-[var(--sk-primary)]',\n refusal(item) && 'bg-[color-mix(in_oklab,var(--sk-danger)_10%,transparent)] ring-1 ring-[var(--sk-danger)]',\n row(item).dimmed && 'opacity-60',\n ]\"\n :draggable=\"model.isDraggable(item)\"\n @dragstart=\"onDragStart($event, item)\"\n @dragover=\"onDragOver($event, item)\"\n @dragleave=\"onDragLeave($event, item)\"\n @drop=\"onDrop($event, item)\"\n @dragend=\"model.dragEnd\"\n >\n <UIcon\n v-if=\"row(item).expandable\"\n name=\"i-lucide-chevron-right\"\n class=\"size-3.5 shrink-0 text-[var(--sk-muted)] transition-transform\"\n :class=\"row(item).open && 'rotate-90'\"\n @click=\"onChevronClick($event, item)\"\n />\n <span v-else-if=\"item.type === 'composite' || item.type === 'heading'\" class=\"size-3.5 shrink-0\" />\n <UIcon :name=\"item.icon\" class=\"size-4 shrink-0\" :style=\"item.tone ? { color: item.tone } : undefined\" />\n\n <div v-if=\"row(item).renaming\" class=\"flex min-w-0 flex-1 flex-col gap-0.5\">\n <UInput\n :model-value=\"row(item).renaming!.draft\"\n size=\"xs\"\n class=\"min-w-0\"\n autofocus\n :color=\"row(item).renaming!.error ? 'error' : undefined\"\n :highlight=\"!!row(item).renaming!.error\"\n :aria-label=\"t('tree.folder.name')\"\n :aria-invalid=\"!!row(item).renaming!.error\"\n @update:model-value=\"model.setRenameDraft($event)\"\n @focus=\"($event.target as HTMLInputElement).select()\"\n @click.stop\n @keydown.stop\n @keydown.enter=\"model.commitRename\"\n @keydown.esc=\"model.cancelRename\"\n @blur=\"model.blurRename\"\n />\n <p v-if=\"row(item).renaming!.error\" class=\"text-xs text-[var(--sk-danger)]\" role=\"alert\" @click.stop>\n {{ row(item).renaming!.error }}\n </p>\n </div>\n <template v-else>\n <span\n v-if=\"basketOf(item)\"\n class=\"size-2 shrink-0 rounded-full\"\n :style=\"{ backgroundColor: basketOf(item)!.color }\"\n :title=\"basketOf(item)!.label\"\n :aria-label=\"basketOf(item)!.label\"\n role=\"img\"\n data-basket-dot\n />\n <span class=\"min-w-0 flex-1 truncate\" :class=\"item.labelFromBody && 'italic text-[var(--sk-muted)]'\" :title=\"item.label\" :data-label-from-body=\"item.labelFromBody || undefined\">\n <template v-if=\"labelParts(item)\">{{ labelParts(item)![0] }}<mark class=\"rounded-sm bg-[color-mix(in_oklab,var(--sk-primary)_20%,transparent)] text-inherit\">{{ labelParts(item)![1] }}</mark>{{ labelParts(item)![2] }}</template>\n <template v-else>{{ item.label }}</template>\n </span>\n <UIcon\n v-if=\"item.hasSummary\"\n name=\"i-lucide-text-quote\"\n class=\"size-3.5 shrink-0 text-[var(--sk-muted)]\"\n :title=\"t('tree.summary')\"\n />\n <div class=\"flex shrink-0\" @click.stop>\n <UDropdownMenu v-if=\"row(item).showFilter\" :items=\"filterMenu(item)\" :content=\"{ align: 'start' }\">\n <UButton\n icon=\"i-lucide-filter\"\n size=\"xs\"\n :color=\"row(item).hiddenKinds.length ? 'primary' : 'neutral'\"\n :variant=\"row(item).hiddenKinds.length ? 'soft' : 'ghost'\"\n :class=\"!row(item).hiddenKinds.length && 'opacity-0 transition-opacity group-hover:opacity-100 group-focus-within:opacity-100 data-[state=open]:opacity-100'\"\n :title=\"t('tree.filter.title')\"\n :aria-label=\"t('tree.filter.title')\"\n />\n </UDropdownMenu>\n <div class=\"flex opacity-0 transition-opacity group-hover:opacity-100 group-focus-within:opacity-100 has-data-[state=open]:opacity-100\">\n <UButton\n v-if=\"item.type === 'composite' && item.blockId\"\n icon=\"i-lucide-focus\"\n size=\"xs\"\n color=\"neutral\"\n variant=\"ghost\"\n :title=\"t('tree.focus.enter')\"\n :aria-label=\"t('tree.focus.enter')\"\n @click=\"model.focus(item.key)\"\n />\n <UButton\n v-if=\"model.canMerge(item)\"\n icon=\"i-lucide-merge\"\n size=\"xs\"\n color=\"neutral\"\n variant=\"ghost\"\n :title=\"t('tree.merge')\"\n :aria-label=\"t('tree.merge')\"\n @click=\"model.merge(item)\"\n />\n <UDropdownMenu v-if=\"addMenu(item).length\" :items=\"addMenu(item)\" :content=\"{ align: 'start', onCloseAutoFocus: (event: Event) => event.preventDefault() }\">\n <UButton\n icon=\"i-lucide-plus\"\n size=\"xs\"\n color=\"neutral\"\n variant=\"ghost\"\n :title=\"t('tree.add')\"\n :aria-label=\"t('tree.add')\"\n />\n </UDropdownMenu>\n <slot v-if=\"item.type === 'document'\" name=\"document-actions\" :id=\"item.id!\" :title=\"item.label\" />\n <UButton\n v-if=\"item.type === 'document' || item.type === 'folder'\"\n icon=\"i-lucide-trash-2\"\n size=\"xs\"\n color=\"error\"\n variant=\"ghost\"\n :aria-label=\"t('tree.delete')\"\n loading-auto\n @click=\"model.remove(item)\"\n />\n </div>\n </div>\n </template>\n </div>\n <p v-if=\"refusal(item)\" class=\"px-2 pt-0.5 text-xs text-[var(--sk-danger)]\" role=\"status\">\n {{ refusal(item) }}\n </p>\n </div>\n </template>\n </UTree>\n\n <p v-if=\"state.view.noMatches\" class=\"px-2.5 py-1.5 text-sm text-[var(--sk-muted)]\">\n {{ t('tree.noMatches') }}\n </p>\n <p v-if=\"state.view.isEmpty\" class=\"px-2.5 py-1.5 text-sm text-[var(--sk-muted)]\">\n {{ t('tree.empty') }}\n </p>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuDA,MAAM,eAAe;;;;;;;;;;;;;EArCrB,MAAM,QAAQ;;EAad,MAAM,iBAAiBA,SAAmB,SAAC,gBAAiC;EAE5E,MAAM,EAAE,MAAM,cAAc;EAC5B,MAAM,EAAE,QAAQ,SAAS,cAAc,eAAe,MAAM,OAAO,OAAO,QAAQ,SAAS,UAAU,SAAS,UAAU,MAAM,UAAU,SAAS;EACjJ,MAAM,EAAE,OAAO,UAAU,aAAa;GAAE,aAAa,MAAM;GAAO,cAAc,MAAM;GAAQ;EAAe,CAAC;EAC9G,MAAM,EAAE,aAAa,kBAAkB;EAIvC,MAAM,iBAAiB,eAAe,MAAM,MAAM,aAAa,MAAM,MAAM,cAAc,WAAW;EAEpG,SAAS,iBAAiB;GACxB,SAAS,MAAM,OAAO,WAAW,SAAS,MAAM,OAAO,aAAa,SAAS,YAAY;EAC3F;EAEA,MAAM,OAAO,SAAmB,MAAM,MAAM,OA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ode","_createVNode","_unref","_withKeys","_createSlots","_withCtx","_createCommentVNode","_createBlock","_Fragment","_renderList","_normalizeClass","_normalizeStyle","_toDisplayString","_withModifiers","_createTextVNode","_renderSlot"],"sources":["../../src/tree/DocumentTree.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { Editor } from '@tiptap/core'\nimport { computed } from 'vue'\nimport { BLOCK_MIME, blockTransferOf, readBlockTransfer, writeBlockTransfer } from '../core/block-transfer'\nimport { findBlockById } from '../core/schema/block-ids'\nimport type { DropdownItem } from '../vue/kit/types'\nimport { useUiKit } from '../vue/kit/use-ui-kit'\nimport { useEditorSettings } from '../vue/settings'\nimport { useEditorI18n } from '../vue/use-editor-i18n'\nimport type { DocumentStore } from './store'\nimport { basketById } from '../features/composites'\nimport { DRAG_MIME, focusCrumbs, itemBasket, type TreeItem } from './tree-items'\nimport { rowOf } from './tree-model'\nimport { useTreeModel } from './use-tree-model'\n\n// File browser of a document store: a „Dokumente“ root with folders and documents. It only renders the `TreeModel` (see\n// `tree-model.ts`), which owns what is open, filtered, selected, dragged and renamed; the React twin renders the same model.\n\nconst props = defineProps<{\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}>()\n\ndefineSlots<{\n /** Host actions on a document row, rendered next to its delete button (e.g. a download link). */\n 'document-actions'?: (props: { id: string, title: string }) => unknown\n}>()\n\n/** The folder new documents, folders and host imports go to. Reset to `''` when it is deleted or moved away. */\nconst selectedFolder = defineModel<string>('selectedFolder', { default: '' })\n\nconst { t } = useEditorI18n()\nconst { Button: UButton, DropdownMenu: UDropdownMenu, Icon: UIcon, Input: UInput, Popover: UPopover, Tooltip: UTooltip, Tree: UTree } = useUiKit()\nconst { model, state } = useTreeModel({ store: () => props.store, editor: () => props.editor, selectedFolder })\nconst { settings } = useEditorSettings()\n\n// Mirrors the model's `isVirtual` rule: the file root only takes effect for a composite document that is open. Without\n// it the button is disabled (and says why) instead of letting the setting silently fall back to the folders.\nconst canUseFileRoot = computed(() => state.value.hasEditor && state.value.structure === 'structured')\n\nfunction toggleTreeRoot() {\n settings.value.blocks.treeRoot = settings.value.blocks.treeRoot === 'file' ? 'folders' : 'file'\n}\n\nconst row = (item: TreeItem) => rowOf(state.value, item, t)\n\n/** The basket `item` is in, when the open editor offers it (the row shows its colour as a dot). */\nconst basketOf = (item: TreeItem) => itemBasket(item, state.value.baskets)\n\n/** The basket filter button needs a live editor that offers baskets. */\nconst showBasketFilter = computed(() => state.value.hasEditor && state.value.baskets.length > 0)\n/** The chosen baskets the open editor offers (an unknown id never filters, see `TreeModel`). */\nconst shownBaskets = computed(() => state.value.basketFilter.filter(id => basketById(state.value.baskets, id)))\nconst basketOption = 'flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-left text-sm text-[var(--sk-fg)] transition-colors duration-150 hover:bg-[var(--sk-bg-elevated)] focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-[var(--sk-primary)]'\n\n/** The breadcrumb of the focus: the document (first crumb, leaves focus) and the Typed blocks down to the focused one. */\nconst breadcrumb = computed(() => focusCrumbs(state.value.focusPath))\n\n/** Why dropping the drag on `item` is refused, while the pointer is over it. */\nfunction refusal(item: TreeItem): string | null {\n const drop = row(item).drop\n return drop && !drop.ok ? drop.reason : null\n}\n\n/** UTree reports the keys of the rows it wants open; the model decides what that changes. */\nfunction onExpanded(next: string[]) {\n const wanted = new Set(next)\n const open = new Set(state.value.view.open)\n for (const key of wanted) if (!open.has(key)) model.value.setOpen(key, true)\n for (const key of open) if (!wanted.has(key)) model.value.setOpen(key, false)\n}\n\n/** The label split around the part the title filter matched, `null` when it did not match here. */\nfunction labelParts(item: TreeItem): [string, string, string] | null {\n const match = row(item).match\n if (!match) return null\n const [at, length] = match\n return [item.label.slice(0, at), item.label.slice(at, at + length), item.label.slice(at + length)]\n}\n\n// Folders and the root toggle through the tree's own row click; documents and outline entries (whose row click opens or\n// reveals) toggle through their chevron.\nfunction onChevronClick(event: Event, item: TreeItem) {\n if (item.type === 'root' || item.type === 'folder') return\n event.stopPropagation()\n model.value.toggle(item.key)\n}\n\nfunction filterMenu(item: TreeItem): DropdownItem[][] {\n const { filterKinds, hiddenKinds } = row(item)\n const groups: DropdownItem[][] = [[\n { type: 'label', label: t('tree.filter.show') },\n ...filterKinds.map<DropdownItem>(kind => ({\n label: kind.label,\n icon: kind.icon,\n type: 'checkbox',\n checked: !hiddenKinds.includes(kind.id),\n onUpdateChecked: visible => model.value.setKindHidden(item.key, kind.id, !visible),\n // Stay open: several kinds are usually toggled in one go.\n onSelect: event => event.preventDefault(),\n })),\n ]]\n if (hiddenKinds.length) groups.push([{ label: t('tree.filter.reset'), icon: 'i-lucide-filter-x', onSelect: () => model.value.clearFilter(item.key) }])\n return groups\n}\n\nfunction addMenu(item: TreeItem): DropdownItem[][] {\n return model.value.addMenu(item).map(group => group.map(entry => ({ label: entry.label, icon: entry.icon, onSelect: entry.run })))\n}\n\n// --- drag & drop -----------------------------------------------------------------------------------------------\n\nfunction onDragStart(event: DragEvent, item: TreeItem) {\n const payload = model.value.dragStart(item)\n if (!payload) return event.preventDefault()\n if (!event.dataTransfer) return model.value.dragEnd()\n event.dataTransfer.setData(DRAG_MIME, JSON.stringify(payload))\n // A Typed block row also carries the block itself, so another surface or tree can take a copy.\n const editor = props.editor\n const found = payload.type === 'typedBlock' && editor && !editor.isDestroyed ? findBlockById(editor.state.doc, payload.blockId) : null\n const transfer = found && editor ? blockTransferOf(editor, found.pos) : null\n if (transfer) writeBlockTransfer(event.dataTransfer, transfer)\n event.dataTransfer.effectAllowed = transfer ? 'copyMove' : 'move'\n}\n\n/** A drag of this tree's own rows is running (a foreign drag is not). */\nconst ownDrag = () => !!state.value.drag && state.value.drag.source.type !== 'foreign-block'\n\nfunction onDragOver(event: DragEvent, item: TreeItem) {\n const foreign = !ownDrag() && !!event.dataTransfer?.types.includes(BLOCK_MIME)\n const verdict = foreign ? model.value.foreignDragOver(item) : model.value.dragOver(item)\n if (!verdict) return\n // Only an allowed target takes the drop; over a refused one the browser shows „not allowed“ and the row shows why.\n if (verdict.ok) event.preventDefault()\n if (event.dataTransfer) event.dataTransfer.dropEffect = verdict.ok ? (foreign ? 'copy' : 'move') : 'none'\n}\n\nfunction onDragLeave(event: DragEvent, item: TreeItem) {\n if (!(event.currentTarget as Node).contains(event.relatedTarget as Node | null)) model.value.dragLeave(item)\n}\n\nfunction onDrop(event: DragEvent, item: TreeItem) {\n if (ownDrag()) {\n event.preventDefault()\n return model.value.drop(item)\n }\n const payload = event.dataTransfer ? readBlockTransfer(event.dataTransfer) : null\n if (!payload) return\n event.preventDefault()\n return model.value.dropForeign(item, payload, event.shiftKey, event.clientX, event.clientY)\n}\n</script>\n\n<template>\n <div class=\"flex flex-col gap-2\">\n <div class=\"flex items-center gap-1\">\n <UInput\n :model-value=\"state.filterText\"\n class=\"min-w-0 flex-1\"\n icon=\"i-lucide-search\"\n size=\"sm\"\n :placeholder=\"t('tree.filterText.placeholder')\"\n :aria-label=\"t('tree.filterText.placeholder')\"\n @update:model-value=\"model.setFilterText($event)\"\n @keydown.esc=\"model.setFilterText('')\"\n >\n <template v-if=\"state.filterText\" #trailing>\n <UButton\n icon=\"i-lucide-x\"\n size=\"xs\"\n color=\"neutral\"\n variant=\"link\"\n :aria-label=\"t('tree.filterText.clear')\"\n @click=\"model.setFilterText('')\"\n />\n </template>\n </UInput>\n <!-- A popover, not a dropdown menu: a menu item cannot show a dot in an arbitrary CSS colour. -->\n <UPopover\n v-if=\"showBasketFilter\"\n :content=\"{ side: 'bottom', align: 'end', sideOffset: 4, onCloseAutoFocus: (event: Event) => event.preventDefault() }\"\n :ui=\"{ content: 'w-44 p-1' }\"\n >\n <UButton\n icon=\"i-lucide-paint-bucket\"\n size=\"xs\"\n :color=\"shownBaskets.length ? 'primary' : 'neutral'\"\n :variant=\"shownBaskets.length ? 'soft' : 'ghost'\"\n :title=\"t('tree.basketFilter.label')\"\n :aria-label=\"t('tree.basketFilter.label')\"\n />\n <template #content>\n <div role=\"menu\" :aria-label=\"t('tree.basketFilter.label')\">\n <button\n v-for=\"basket in state.baskets\"\n :key=\"basket.id\"\n type=\"button\"\n role=\"menuitemcheckbox\"\n :aria-checked=\"shownBaskets.includes(basket.id)\"\n :class=\"basketOption\"\n @click=\"model.setBasketShown(basket.id, !shownBaskets.includes(basket.id))\"\n >\n <span class=\"size-2.5 shrink-0 rounded-full\" :style=\"{ backgroundColor: basket.color }\" />\n <span class=\"truncate\">{{ basket.label }}</span>\n <UIcon v-if=\"shownBaskets.includes(basket.id)\" name=\"i-lucide-check\" class=\"ml-auto size-3.5 shrink-0\" />\n </button>\n <button v-if=\"shownBaskets.length\" type=\"button\" role=\"menuitem\" :class=\"basketOption\" @click=\"model.clearBasketFilter()\">\n <UIcon name=\"i-lucide-filter-x\" class=\"size-3.5 shrink-0 text-[var(--sk-muted)]\" />\n <span class=\"truncate\">{{ t('tree.basketFilter.reset') }}</span>\n </button>\n </div>\n </template>\n </UPopover>\n </div>\n\n <div class=\"flex items-center justify-end\">\n <UTooltip :text=\"canUseFileRoot ? '' : t('tree.root.unavailable')\">\n <!-- A disabled button swallows pointer events, so the tooltip hangs on the wrapper. -->\n <span class=\"inline-flex\">\n <UButton\n :icon=\"state.virtual ? 'i-lucide-file-stack' : 'i-lucide-folder-tree'\"\n :label=\"t(state.virtual ? 'tree.root.file' : 'tree.root.folders')\"\n size=\"xs\"\n color=\"neutral\"\n :variant=\"state.virtual ? 'soft' : 'ghost'\"\n :disabled=\"!canUseFileRoot\"\n :aria-pressed=\"state.virtual\"\n @click=\"toggleTreeRoot\"\n />\n </span>\n </UTooltip>\n </div>\n\n <div v-if=\"state.view.hasKindFilters\" class=\"flex items-center\">\n <UButton\n icon=\"i-lucide-filter-x\"\n :label=\"t('tree.filter.reset')\"\n size=\"xs\"\n color=\"neutral\"\n variant=\"subtle\"\n @click=\"model.clearAllFilters\"\n />\n </div>\n\n <div v-if=\"state.creatingFolder\" class=\"flex flex-col gap-1\">\n <UInput\n :model-value=\"state.creatingFolder.draft\"\n size=\"sm\"\n autofocus\n :color=\"state.creatingFolder.error ? 'error' : undefined\"\n :highlight=\"!!state.creatingFolder.error\"\n :placeholder=\"state.creatingFolder.parent ? t('tree.folder.placeholderIn', { parent: state.creatingFolder.parent }) : t('tree.folder.placeholder')\"\n :aria-label=\"t('tree.folder.name')\"\n :aria-invalid=\"!!state.creatingFolder.error\"\n @update:model-value=\"model.setFolderDraft($event)\"\n @keydown.enter=\"model.commitCreateFolder\"\n @keydown.esc=\"model.cancelCreateFolder\"\n @blur=\"model.cancelCreateFolder\"\n />\n <p v-if=\"state.creatingFolder.error\" class=\"px-0.5 text-xs text-[var(--sk-danger)]\" role=\"alert\">\n {{ state.creatingFolder.error }}\n </p>\n </div>\n\n <div v-if=\"breadcrumb.crumbs.length\" class=\"flex flex-wrap items-center gap-0.5 text-xs\">\n <UButton\n icon=\"i-lucide-corner-up-left\"\n :label=\"breadcrumb.document?.label ?? t('tree.focus.root')\"\n size=\"xs\"\n color=\"neutral\"\n variant=\"ghost\"\n :title=\"t('tree.focus.leave')\"\n :aria-label=\"t('tree.focus.leave')\"\n @click=\"model.defocus()\"\n />\n <template v-for=\"(crumb, index) in breadcrumb.crumbs\" :key=\"crumb.key\">\n <UIcon name=\"i-lucide-chevron-right\" class=\"size-3 shrink-0 text-[var(--sk-muted)]\" />\n <span v-if=\"index === breadcrumb.crumbs.length - 1\" class=\"min-w-0 truncate px-1.5 font-medium\" aria-current=\"location\">{{ crumb.label }}</span>\n <UButton v-else :label=\"crumb.label\" size=\"xs\" color=\"neutral\" variant=\"ghost\" @click=\"model.focus(crumb.key)\" />\n </template>\n </div>\n\n <p v-if=\"!state.tree && !state.virtual\" class=\"px-2.5 py-1.5 text-sm text-[var(--sk-muted)]\">\n {{ state.tree === null ? t('tree.loadFailed') : t('tree.loading') }}\n </p>\n\n <UTree\n v-else\n :expanded=\"state.view.open\"\n :items=\"state.view.items\"\n :get-key=\"(item: TreeItem) => item.key\"\n size=\"sm\"\n :aria-label=\"t('tree.aria')\"\n @update:expanded=\"onExpanded\"\n >\n <template #item-wrapper=\"{ item }: { item: TreeItem }\">\n <div class=\"w-full\">\n <div\n class=\"group flex w-full cursor-pointer items-center gap-1.5 rounded-md px-2 py-1 text-sm select-none hover:bg-[color-mix(in_oklab,var(--sk-bg-elevated)_60%,transparent)]\"\n :class=\"[\n row(item).active && 'bg-[color-mix(in_oklab,var(--sk-primary)_10%,transparent)] font-medium text-[var(--sk-primary)]',\n row(item).selected && 'bg-[var(--sk-bg-elevated)]',\n row(item).drop?.ok && 'ring-1 ring-[var(--sk-primary)]',\n refusal(item) && 'bg-[color-mix(in_oklab,var(--sk-danger)_10%,transparent)] ring-1 ring-[var(--sk-danger)]',\n row(item).dimmed && 'opacity-60',\n ]\"\n :draggable=\"model.isDraggable(item)\"\n @dragstart=\"onDragStart($event, item)\"\n @dragover=\"onDragOver($event, item)\"\n @dragleave=\"onDragLeave($event, item)\"\n @drop=\"onDrop($event, item)\"\n @dragend=\"model.dragEnd\"\n >\n <UIcon\n v-if=\"row(item).expandable\"\n name=\"i-lucide-chevron-right\"\n class=\"size-3.5 shrink-0 text-[var(--sk-muted)] transition-transform\"\n :class=\"row(item).open && 'rotate-90'\"\n @click=\"onChevronClick($event, item)\"\n />\n <span v-else-if=\"item.type === 'typedBlock' || item.type === 'heading'\" class=\"size-3.5 shrink-0\" />\n <UIcon :name=\"item.icon\" class=\"size-4 shrink-0\" :style=\"item.tone ? { color: item.tone } : undefined\" />\n\n <div v-if=\"row(item).renaming\" class=\"flex min-w-0 flex-1 flex-col gap-0.5\">\n <UInput\n :model-value=\"row(item).renaming!.draft\"\n size=\"xs\"\n class=\"min-w-0\"\n autofocus\n :color=\"row(item).renaming!.error ? 'error' : undefined\"\n :highlight=\"!!row(item).renaming!.error\"\n :aria-label=\"t('tree.folder.name')\"\n :aria-invalid=\"!!row(item).renaming!.error\"\n @update:model-value=\"model.setRenameDraft($event)\"\n @focus=\"($event.target as HTMLInputElement).select()\"\n @click.stop\n @keydown.stop\n @keydown.enter=\"model.commitRename\"\n @keydown.esc=\"model.cancelRename\"\n @blur=\"model.blurRename\"\n />\n <p v-if=\"row(item).renaming!.error\" class=\"text-xs text-[var(--sk-danger)]\" role=\"alert\" @click.stop>\n {{ row(item).renaming!.error }}\n </p>\n </div>\n <template v-else>\n <span\n v-if=\"basketOf(item)\"\n class=\"size-2 shrink-0 rounded-full\"\n :style=\"{ backgroundColor: basketOf(item)!.color }\"\n :title=\"basketOf(item)!.label\"\n :aria-label=\"basketOf(item)!.label\"\n role=\"img\"\n data-basket-dot\n />\n <span class=\"min-w-0 flex-1 truncate\" :class=\"item.labelFromBody && 'italic text-[var(--sk-muted)]'\" :title=\"item.label\" :data-label-from-body=\"item.labelFromBody || undefined\">\n <template v-if=\"labelParts(item)\">{{ labelParts(item)![0] }}<mark class=\"rounded-sm bg-[color-mix(in_oklab,var(--sk-primary)_20%,transparent)] text-inherit\">{{ labelParts(item)![1] }}</mark>{{ labelParts(item)![2] }}</template>\n <template v-else>{{ item.label }}</template>\n </span>\n <UIcon\n v-if=\"item.hasSummary\"\n name=\"i-lucide-text-quote\"\n class=\"size-3.5 shrink-0 text-[var(--sk-muted)]\"\n :title=\"t('tree.summary')\"\n />\n <UIcon\n v-if=\"item.sourceMissing\"\n name=\"i-lucide-unlink\"\n class=\"size-3.5 shrink-0 text-[var(--sk-warning)]\"\n :title=\"t('composites.derivation.sourceMissing')\"\n data-source-missing\n />\n <div class=\"flex shrink-0\" @click.stop>\n <UDropdownMenu v-if=\"row(item).showFilter\" :items=\"filterMenu(item)\" :content=\"{ align: 'start' }\">\n <UButton\n icon=\"i-lucide-filter\"\n size=\"xs\"\n :color=\"row(item).hiddenKinds.length ? 'primary' : 'neutral'\"\n :variant=\"row(item).hiddenKinds.length ? 'soft' : 'ghost'\"\n :class=\"!row(item).hiddenKinds.length && 'opacity-0 transition-opacity group-hover:opacity-100 group-focus-within:opacity-100 data-[state=open]:opacity-100'\"\n :title=\"t('tree.filter.title')\"\n :aria-label=\"t('tree.filter.title')\"\n />\n </UDropdownMenu>\n <div class=\"flex opacity-0 transition-opacity group-hover:opacity-100 group-focus-within:opacity-100 has-data-[state=open]:opacity-100\">\n <UButton\n v-if=\"item.type === 'typedBlock' && item.blockId\"\n icon=\"i-lucide-focus\"\n size=\"xs\"\n color=\"neutral\"\n variant=\"ghost\"\n :title=\"t('tree.focus.enter')\"\n :aria-label=\"t('tree.focus.enter')\"\n @click=\"model.focus(item.key)\"\n />\n <UButton\n v-if=\"model.canMerge(item)\"\n icon=\"i-lucide-merge\"\n size=\"xs\"\n color=\"neutral\"\n variant=\"ghost\"\n :title=\"t('tree.merge')\"\n :aria-label=\"t('tree.merge')\"\n @click=\"model.merge(item)\"\n />\n <UDropdownMenu v-if=\"addMenu(item).length\" :items=\"addMenu(item)\" :content=\"{ align: 'start', onCloseAutoFocus: (event: Event) => event.preventDefault() }\">\n <UButton\n icon=\"i-lucide-plus\"\n size=\"xs\"\n color=\"neutral\"\n variant=\"ghost\"\n :title=\"t('tree.add')\"\n :aria-label=\"t('tree.add')\"\n />\n </UDropdownMenu>\n <slot v-if=\"item.type === 'document'\" name=\"document-actions\" :id=\"item.id!\" :title=\"item.label\" />\n <UButton\n v-if=\"item.type === 'document' || item.type === 'folder'\"\n icon=\"i-lucide-trash-2\"\n size=\"xs\"\n color=\"error\"\n variant=\"ghost\"\n :aria-label=\"t('tree.delete')\"\n loading-auto\n @click=\"model.remove(item)\"\n />\n </div>\n </div>\n </template>\n </div>\n <p v-if=\"refusal(item)\" class=\"px-2 pt-0.5 text-xs text-[var(--sk-danger)]\" role=\"status\">\n {{ refusal(item) }}\n </p>\n </div>\n </template>\n </UTree>\n\n <p v-if=\"state.view.noMatches\" class=\"px-2.5 py-1.5 text-sm text-[var(--sk-muted)]\">\n {{ t('tree.noMatches') }}\n </p>\n <p v-if=\"state.view.isEmpty\" class=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Ba,WAAmG,KAAA,QAAA,oBAAA;SAApC,IAAI,KAAK;SAAM,OAAO,KAAK;;QAElF,KAAK,SAAI,cAAmB,KAAK,SAAI,YAD7CjB,UAAA,GAAAS,YASEL,MAAA,OAAA,GAAA;;SAPA,MAAK;SACL,MAAK;SACL,OAAM;SACN,SAAQ;SACP,cAAYA,MAAA,CAAA,CAAC,CAAA,aAAA;SACd,gBAAA;SACC,UAAK,WAAEA,MAAA,KAAA,CAAK,CAAC,OAAO,IAAI;;;;KAM1B,GAAA,IAAA,WAAA,GAAA,QAAQ,IAAI,KAArBJ,UAAA,GAAAC,mBAEI,KAFJ,aAEIa,gBADC,QAAQ,IAAI,CAAA,GAAA,CAAA,KAAAN,mBAAA,QAAA,IAAA,CAAA,CAAA,CAAA,CAAA;;;;;;;;IAMdJ,MAAA,KAAA,CAAK,CAAC,KAAK,aAApBJ,UAAA,GAAAC,mBAEI,KAFJ,aAEIa,gBADCV,MAAA,CAAA,CAAC,CAAA,gBAAA,CAAA,GAAA,CAAA,KAAAI,mBAAA,QAAA,IAAA;IAEGJ,MAAA,KAAA,CAAK,CAAC,KAAK,WAApBJ,UAAA,GAAAC,mBAEI,KAFJ,aAEIa,gBADCV,MAAA,CAAA,CAAC,CAAA,YAAA,CAAA,GAAA,CAAA,KAAAI,mBAAA,QAAA,IAAA"}
|
package/dist/tree/drop-rules.js
CHANGED
|
@@ -7,8 +7,8 @@ const refuse = (reason) => ({
|
|
|
7
7
|
});
|
|
8
8
|
/**
|
|
9
9
|
* Whether `source` may be dropped on `target`.
|
|
10
|
-
* - A
|
|
11
|
-
* - A
|
|
10
|
+
* - A Typed block (virtual mode) goes on the document root or on a Typed block: the Block types' accepted children decide.
|
|
11
|
+
* - A Typed block from outside (`foreign-block`, virtual mode) goes on the document root or on a Typed block with an ID, if the
|
|
12
12
|
* open editor takes blocks from outside (`canTransfer`); the insert guards are judged when it is dropped.
|
|
13
13
|
* - A document goes on the root or a folder of the store, unless it lives there already.
|
|
14
14
|
* - A folder goes on the root or a folder, unless that is itself, one of its sub-folders or its current parent.
|
|
@@ -16,7 +16,7 @@ const refuse = (reason) => ({
|
|
|
16
16
|
function dropVerdict(source, target, env) {
|
|
17
17
|
const { t } = env;
|
|
18
18
|
if (!source) return refuse(t("tree.drop.nothing"));
|
|
19
|
-
if (source.type === "
|
|
19
|
+
if (source.type === "typedBlock") return blockVerdict(source.blockId, target, env);
|
|
20
20
|
if (source.type === "foreign-block") return foreignBlockVerdict(target, env);
|
|
21
21
|
if (env.virtual) return refuse(t("tree.drop.noDocumentMove"));
|
|
22
22
|
if (target.type !== "root" && target.type !== "folder") return refuse(t("tree.drop.foldersOnly"));
|
|
@@ -30,13 +30,13 @@ function blockVerdict(blockId, target, env) {
|
|
|
30
30
|
const { t } = env;
|
|
31
31
|
if (!env.virtual || !env.moveVerdict) return refuse(t("tree.drop.blocksOnlyInDocument"));
|
|
32
32
|
if (target.key === "vroot") return env.moveVerdict(blockId, null);
|
|
33
|
-
if (target.type !== "
|
|
33
|
+
if (target.type !== "typedBlock") return refuse(t("tree.drop.noBlocksHere"));
|
|
34
34
|
if (!target.blockId) return refuse(t("tree.drop.blockWithoutId"));
|
|
35
35
|
return env.moveVerdict(blockId, target.blockId);
|
|
36
36
|
}
|
|
37
37
|
function foreignBlockVerdict(target, env) {
|
|
38
38
|
if (env.virtual && !env.canTransfer) return refuse(env.t("tree.drop.noTransfer"));
|
|
39
|
-
if (env.virtual && (target.key === "vroot" || target.type === "
|
|
39
|
+
if (env.virtual && (target.key === "vroot" || target.type === "typedBlock" && target.blockId)) return ok;
|
|
40
40
|
return refuse(env.t("tree.drop.noBlocksHere"));
|
|
41
41
|
}
|
|
42
42
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"drop-rules.js","names":[],"sources":["../../src/tree/drop-rules.ts"],"sourcesContent":["import type { MoveVerdict } from '../features/composites'\nimport type { Translate } from '../i18n'\nimport { type DragPayload, parentPath, type TreeItem, VIRTUAL_ROOT } from './tree-items'\n\n// The drop rules of the document tree as one pure function: no state, no editor, no store. Where the open document\n// decides (the
|
|
1
|
+
{"version":3,"file":"drop-rules.js","names":[],"sources":["../../src/tree/drop-rules.ts"],"sourcesContent":["import type { MoveVerdict } from '../features/composites'\nimport type { Translate } from '../i18n'\nimport { type DragPayload, parentPath, type TreeItem, VIRTUAL_ROOT } from './tree-items'\n\n// The drop rules of the document tree as one pure function: no state, no editor, no store. Where the open document\n// decides (the Block types' accepted children), the caller passes that rule in.\n\n/** Whether a drop may happen; a refusal carries a short sentence (in the language of the `t` that judged it) the tree shows under the target. */\nexport type DropVerdict = { ok: true } | { ok: false, reason: string }\n\n/** What `dropVerdict` needs from the outside. */\nexport interface DropEnv {\n /** The tree shows the open document as its root (Typed blocks can be moved); otherwise it shows the store's folders. */\n virtual: boolean\n /**\n * Whether block `id` may move into the Typed block `targetId` (`null` = the end of the document), judged on the live\n * editor (`moveIntoVerdict`). `undefined` while no editor is mounted.\n */\n moveVerdict: ((id: string, targetId: string | null) => MoveVerdict) | undefined\n /** Whether the open editor takes blocks from outside (it has the transfer feature); `false` while no editor is mounted. */\n canTransfer: boolean\n /** Words the refusals of this file's rules; the reasons of `moveVerdict` come already worded. */\n t: Translate\n}\n\nconst ok: DropVerdict = { ok: true }\nconst refuse = (reason: string): DropVerdict => ({ ok: false, reason })\n\n/**\n * Whether `source` may be dropped on `target`.\n * - A Typed block (virtual mode) goes on the document root or on a Typed block: the Block types' accepted children decide.\n * - A Typed block from outside (`foreign-block`, virtual mode) goes on the document root or on a Typed block with an ID, if the\n * open editor takes blocks from outside (`canTransfer`); the insert guards are judged when it is dropped.\n * - A document goes on the root or a folder of the store, unless it lives there already.\n * - A folder goes on the root or a folder, unless that is itself, one of its sub-folders or its current parent.\n */\nexport function dropVerdict(source: DragPayload | null, target: TreeItem, env: DropEnv): DropVerdict {\n const { t } = env\n if (!source) return refuse(t('tree.drop.nothing'))\n if (source.type === 'typedBlock') return blockVerdict(source.blockId, target, env)\n if (source.type === 'foreign-block') return foreignBlockVerdict(target, env)\n if (env.virtual) return refuse(t('tree.drop.noDocumentMove'))\n if (target.type !== 'root' && target.type !== 'folder') return refuse(t('tree.drop.foldersOnly'))\n const targetPath = target.path!\n if (source.type === 'document') return source.path === targetPath ? refuse(t('tree.drop.documentInFolder')) : ok\n if (targetPath === source.path || targetPath.startsWith(`${source.path}/`)) return refuse(t('tree.drop.folderIntoSelf'))\n if (parentPath(source.path) === targetPath) return refuse(t('tree.drop.folderInFolder'))\n return ok\n}\n\nfunction blockVerdict(blockId: string, target: TreeItem, env: DropEnv): DropVerdict {\n const { t } = env\n if (!env.virtual || !env.moveVerdict) return refuse(t('tree.drop.blocksOnlyInDocument'))\n if (target.key === VIRTUAL_ROOT) return env.moveVerdict(blockId, null)\n if (target.type !== 'typedBlock') return refuse(t('tree.drop.noBlocksHere'))\n if (!target.blockId) return refuse(t('tree.drop.blockWithoutId'))\n return env.moveVerdict(blockId, target.blockId)\n}\n\nfunction foreignBlockVerdict(target: TreeItem, env: DropEnv): DropVerdict {\n if (env.virtual && !env.canTransfer) return refuse(env.t('tree.drop.noTransfer'))\n if (env.virtual && (target.key === VIRTUAL_ROOT || (target.type === 'typedBlock' && target.blockId))) return ok\n return refuse(env.t('tree.drop.noBlocksHere'))\n}\n"],"mappings":";;AAyBA,MAAM,KAAkB,EAAE,IAAI,KAAK;AACnC,MAAM,UAAU,YAAiC;CAAE,IAAI;CAAO;AAAO;;;;;;;;;AAUrE,SAAgB,YAAY,QAA4B,QAAkB,KAA2B;CACnG,MAAM,EAAE,MAAM;CACd,IAAI,CAAC,QAAQ,OAAO,OAAO,EAAE,mBAAmB,CAAC;CACjD,IAAI,OAAO,SAAS,cAAc,OAAO,aAAa,OAAO,SAAS,QAAQ,GAAG;CACjF,IAAI,OAAO,SAAS,iBAAiB,OAAO,oBAAoB,QAAQ,GAAG;CAC3E,IAAI,IAAI,SAAS,OAAO,OAAO,EAAE,0BAA0B,CAAC;CAC5D,IAAI,OAAO,SAAS,UAAU,OAAO,SAAS,UAAU,OAAO,OAAO,EAAE,uBAAuB,CAAC;CAChG,MAAM,aAAa,OAAO;CAC1B,IAAI,OAAO,SAAS,YAAY,OAAO,OAAO,SAAS,aAAa,OAAO,EAAE,4BAA4B,CAAC,IAAI;CAC9G,IAAI,eAAe,OAAO,QAAQ,WAAW,WAAW,GAAG,OAAO,KAAK,EAAE,GAAG,OAAO,OAAO,EAAE,0BAA0B,CAAC;CACvH,IAAI,WAAW,OAAO,IAAI,MAAM,YAAY,OAAO,OAAO,EAAE,0BAA0B,CAAC;CACvF,OAAO;AACT;AAEA,SAAS,aAAa,SAAiB,QAAkB,KAA2B;CAClF,MAAM,EAAE,MAAM;CACd,IAAI,CAAC,IAAI,WAAW,CAAC,IAAI,aAAa,OAAO,OAAO,EAAE,gCAAgC,CAAC;CACvF,IAAI,OAAO,QAAA,SAAsB,OAAO,IAAI,YAAY,SAAS,IAAI;CACrE,IAAI,OAAO,SAAS,cAAc,OAAO,OAAO,EAAE,wBAAwB,CAAC;CAC3E,IAAI,CAAC,OAAO,SAAS,OAAO,OAAO,EAAE,0BAA0B,CAAC;CAChE,OAAO,IAAI,YAAY,SAAS,OAAO,OAAO;AAChD;AAEA,SAAS,oBAAoB,QAAkB,KAA2B;CACxE,IAAI,IAAI,WAAW,CAAC,IAAI,aAAa,OAAO,OAAO,IAAI,EAAE,sBAAsB,CAAC;CAChF,IAAI,IAAI,YAAY,OAAO,QAAA,WAAyB,OAAO,SAAS,gBAAgB,OAAO,UAAW,OAAO;CAC7G,OAAO,OAAO,IAAI,EAAE,wBAAwB,CAAC;AAC/C"}
|
|
@@ -19,7 +19,7 @@ import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
|
19
19
|
//#region src/tree/react/DocumentTree.tsx
|
|
20
20
|
const BASKET_OPTION = "flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-left text-sm text-foreground transition-colors duration-150 hover:bg-muted focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-primary";
|
|
21
21
|
const REVEAL_ON_HOVER = "opacity-0 transition-opacity group-hover:opacity-100 group-focus-within:opacity-100 data-[state=open]:opacity-100";
|
|
22
|
-
const isOutlineItem = (item) => item.type === "
|
|
22
|
+
const isOutlineItem = (item) => item.type === "typedBlock" || item.type === "heading";
|
|
23
23
|
/** The label with the part the title filter matched highlighted. */
|
|
24
24
|
function Label({ label, match }) {
|
|
25
25
|
if (!match) return /* @__PURE__ */ jsx(Fragment$1, { children: label });
|
|
@@ -46,13 +46,13 @@ function DocumentTree({ store, editor, selectedFolder, onSelectedFolderChange, d
|
|
|
46
46
|
const treeElement = useRef(null);
|
|
47
47
|
if (!binding) return null;
|
|
48
48
|
const { model, state } = binding;
|
|
49
|
-
const canUseFileRoot = state.hasEditor && state.structure === "
|
|
49
|
+
const canUseFileRoot = state.hasEditor && state.structure === "structured";
|
|
50
50
|
const { view, creatingFolder } = state;
|
|
51
51
|
/** The basket filter button needs a live editor that offers baskets. */
|
|
52
52
|
const showBasketFilter = state.hasEditor && state.baskets.length > 0;
|
|
53
53
|
/** The chosen baskets the open editor offers (an unknown id never filters, see `TreeModel`). */
|
|
54
54
|
const shownBaskets = state.basketFilter.filter((id) => basketById(state.baskets, id));
|
|
55
|
-
/** The breadcrumb of the focus: the document (first crumb, leaves focus) and the
|
|
55
|
+
/** The breadcrumb of the focus: the document (first crumb, leaves focus) and the Typed blocks down to the focused one. */
|
|
56
56
|
const { document: focusDocument, crumbs } = focusCrumbs(state.focusPath);
|
|
57
57
|
function onChevronClick(event, item) {
|
|
58
58
|
if (item.type === "root" || item.type === "folder") return;
|
|
@@ -75,7 +75,7 @@ function DocumentTree({ store, editor, selectedFolder, onSelectedFolderChange, d
|
|
|
75
75
|
const payload = model.dragStart(item);
|
|
76
76
|
if (!payload) return event.preventDefault();
|
|
77
77
|
event.dataTransfer.setData(DRAG_MIME, JSON.stringify(payload));
|
|
78
|
-
const found = payload.type === "
|
|
78
|
+
const found = payload.type === "typedBlock" && editor && !editor.isDestroyed ? findBlockById(editor.state.doc, payload.blockId) : null;
|
|
79
79
|
const transfer = found && editor ? blockTransferOf(editor, found.pos) : null;
|
|
80
80
|
if (transfer) writeBlockTransfer(event.dataTransfer, transfer);
|
|
81
81
|
event.dataTransfer.effectAllowed = transfer ? "copyMove" : "move";
|
|
@@ -202,6 +202,15 @@ function DocumentTree({ store, editor, selectedFolder, onSelectedFolderChange, d
|
|
|
202
202
|
name: "i-lucide-text-quote",
|
|
203
203
|
className: "size-3.5 text-muted-foreground"
|
|
204
204
|
}),
|
|
205
|
+
item.sourceMissing && /* @__PURE__ */ jsx("span", {
|
|
206
|
+
className: "shrink-0",
|
|
207
|
+
title: t("composites.derivation.sourceMissing"),
|
|
208
|
+
"data-source-missing": true,
|
|
209
|
+
children: /* @__PURE__ */ jsx(Icon, {
|
|
210
|
+
name: "i-lucide-unlink",
|
|
211
|
+
className: "size-3.5 text-(--sk-warning)"
|
|
212
|
+
})
|
|
213
|
+
}),
|
|
205
214
|
/* @__PURE__ */ jsxs("div", {
|
|
206
215
|
className: "flex shrink-0",
|
|
207
216
|
onClick: (event) => event.stopPropagation(),
|
|
@@ -218,7 +227,7 @@ function DocumentTree({ store, editor, selectedFolder, onSelectedFolderChange, d
|
|
|
218
227
|
}), filterMenu(item)] }), /* @__PURE__ */ jsxs("div", {
|
|
219
228
|
className: "flex opacity-0 transition-opacity group-hover:opacity-100 group-focus-within:opacity-100 has-data-[state=open]:opacity-100",
|
|
220
229
|
children: [
|
|
221
|
-
item.type === "
|
|
230
|
+
item.type === "typedBlock" && item.blockId && /* @__PURE__ */ jsx(Button, {
|
|
222
231
|
size: "icon-xs",
|
|
223
232
|
variant: "ghost",
|
|
224
233
|
title: t("tree.focus.enter"),
|