@ecsplico/editor 3.6.0 → 4.1.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 +73 -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/code/CodeSurface.vue.d.ts +3 -3
- 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/document/DocumentSurface.vue.d.ts +3 -3
- 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 +150 -87
- package/dist/features/image-studio/components/ImageStudioDialog.js.map +1 -1
- package/dist/features/image-studio/components/ImageStudioDialog.vue.d.ts +5 -1
- package/dist/features/image-studio/components/ImageStudioLibraryPanel.js +186 -0
- package/dist/features/image-studio/components/ImageStudioLibraryPanel.js.map +1 -0
- package/dist/features/image-studio/components/ImageStudioLibraryTile.js +134 -0
- package/dist/features/image-studio/components/ImageStudioLibraryTile.js.map +1 -0
- 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/index.d.ts +3 -2
- package/dist/features/image-studio/index.js +2 -2
- package/dist/features/image-studio/library.d.ts +35 -0
- 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 +46 -5
- package/dist/features/image-studio/react/ImageStudioDialog.js.map +1 -1
- package/dist/features/image-studio/react/ImageStudioLibraryPanel.js +141 -0
- package/dist/features/image-studio/react/ImageStudioLibraryPanel.js.map +1 -0
- package/dist/features/image-studio/react/ImageStudioLibraryTile.js +105 -0
- package/dist/features/image-studio/react/ImageStudioLibraryTile.js.map +1 -0
- 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 +8 -3
- package/dist/features/image-studio/react/store.js.map +1 -1
- package/dist/features/image-studio/react.d.ts +4 -3
- package/dist/features/image-studio/react.js +3 -3
- 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 +8 -3
- package/dist/features/image-studio/state.js +11 -3
- package/dist/features/image-studio/state.js.map +1 -1
- package/dist/features/image-studio/store.d.ts +8 -3
- package/dist/features/image-studio/vue.d.ts +4 -3
- package/dist/features/image-studio/vue.js +3 -3
- package/dist/features/image-studio/vue.js.map +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 +11 -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 +110 -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/image-studio.js +9 -0
- package/dist/i18n/en/image-studio.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 +11 -11
- 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/MarkdownSurface.vue.d.ts +7 -7
- package/dist/markdown/document.js +1 -1
- package/dist/markdown/document.js.map +1 -1
- package/dist/nuxt/module.d.ts +48 -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 +7 -4
- 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 +1 -1
- 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 +9 -6
- 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 +5 -5
- 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 +10 -10
- package/dist/vue/SimpleEditor.vue.d.ts +4 -4
- package/dist/vue/components/EditorSurface.vue.d.ts +4 -4
- package/dist/vue/compose.d.ts +1 -1
- package/dist/vue/compose.js +1 -1
- 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
package/dist/settings/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { AI_LANGUAGES, AUTHOR_COLOR_STYLES, COMMENTS_LAYOUTS, DRAG_HANDLE_VISIBILITIES, HEADING_CONVERSION_SCOPES,
|
|
1
|
+
import { AI_LANGUAGES, AUTHOR_COLOR_STYLES, BLOCK_TYPE_ICON_VISIBILITIES, COMMENTS_LAYOUTS, DRAG_HANDLE_VISIBILITIES, HEADING_CONVERSION_SCOPES, MODEL_ROLES, STRUCTURE_MODES, TREE_ROOTS } from "./values.js";
|
|
2
|
+
import { EDITOR_SETTINGS_VERSION, isOutdatedEditorSettings, migrateEditorSettings } from "./migrate.js";
|
|
2
3
|
import { z } from "zod";
|
|
3
4
|
//#region src/settings/index.ts
|
|
4
|
-
const EDITOR_SETTINGS_VERSION = 1;
|
|
5
5
|
/** Valid theme id: lowercase slug, used as directory name and in `/api/editor/themes/:id`. Defined here so core never imports a feature. */
|
|
6
6
|
const THEME_ID = /^[a-z0-9][a-z0-9-]{0,63}$/;
|
|
7
7
|
/** Bounds of `blocks.splitTargetChars`. */
|
|
@@ -13,7 +13,7 @@ function clampSplitTargetChars(typed, current) {
|
|
|
13
13
|
return typed.trim() !== "" && Number.isFinite(value) ? Math.min(SPLIT_TARGET_CHARS_MAX, Math.max(200, value)) : current;
|
|
14
14
|
}
|
|
15
15
|
const EDITOR_SETTINGS_DEFAULTS = {
|
|
16
|
-
version:
|
|
16
|
+
version: 2,
|
|
17
17
|
editing: {
|
|
18
18
|
headingConversionScope: "container",
|
|
19
19
|
authorColors: false,
|
|
@@ -22,14 +22,14 @@ const EDITOR_SETTINGS_DEFAULTS = {
|
|
|
22
22
|
},
|
|
23
23
|
ai: {
|
|
24
24
|
autocomplete: false,
|
|
25
|
-
|
|
25
|
+
roles: {},
|
|
26
26
|
translateLanguage: "Englisch"
|
|
27
27
|
},
|
|
28
28
|
blocks: {
|
|
29
|
-
|
|
30
|
-
structure: "
|
|
29
|
+
defaultBlockType: "section",
|
|
30
|
+
structure: "structured",
|
|
31
31
|
treeRoot: "folders",
|
|
32
|
-
|
|
32
|
+
blockTypeIcon: "always",
|
|
33
33
|
dragHandle: "hover",
|
|
34
34
|
splitTargetChars: 1500
|
|
35
35
|
},
|
|
@@ -42,16 +42,16 @@ const commentsLayoutSchema = z.enum(COMMENTS_LAYOUTS);
|
|
|
42
42
|
const autocompleteSchema = z.boolean();
|
|
43
43
|
const profileIdSchema = z.string().min(1).max(100);
|
|
44
44
|
const translateLanguageSchema = z.enum(AI_LANGUAGES);
|
|
45
|
-
const
|
|
45
|
+
const defaultBlockTypeSchema = z.string().min(1).max(100);
|
|
46
46
|
const structureSchema = z.enum(STRUCTURE_MODES);
|
|
47
47
|
const treeRootSchema = z.enum(TREE_ROOTS);
|
|
48
|
-
const
|
|
48
|
+
const blockTypeIconSchema = z.enum(BLOCK_TYPE_ICON_VISIBILITIES);
|
|
49
49
|
const dragHandleSchema = z.enum(DRAG_HANDLE_VISIBILITIES);
|
|
50
50
|
const splitTargetCharsSchema = z.number().int().min(200).max(SPLIT_TARGET_CHARS_MAX);
|
|
51
51
|
const themeSchema = z.string().regex(THEME_ID).nullable();
|
|
52
52
|
/** Complete, valid settings (the body of `PUT /api/editor/settings`). */
|
|
53
53
|
const editorSettingsSchema = z.object({
|
|
54
|
-
version: z.literal(
|
|
54
|
+
version: z.literal(2),
|
|
55
55
|
editing: z.object({
|
|
56
56
|
headingConversionScope: headingConversionScopeSchema,
|
|
57
57
|
authorColors: authorColorsSchema,
|
|
@@ -60,14 +60,14 @@ const editorSettingsSchema = z.object({
|
|
|
60
60
|
}),
|
|
61
61
|
ai: z.object({
|
|
62
62
|
autocomplete: autocompleteSchema,
|
|
63
|
-
|
|
63
|
+
roles: z.partialRecord(z.enum(MODEL_ROLES), profileIdSchema),
|
|
64
64
|
translateLanguage: translateLanguageSchema
|
|
65
65
|
}),
|
|
66
66
|
blocks: z.object({
|
|
67
|
-
|
|
67
|
+
defaultBlockType: defaultBlockTypeSchema,
|
|
68
68
|
structure: structureSchema,
|
|
69
69
|
treeRoot: treeRootSchema,
|
|
70
|
-
|
|
70
|
+
blockTypeIcon: blockTypeIconSchema,
|
|
71
71
|
dragHandle: dragHandleSchema,
|
|
72
72
|
splitTargetChars: splitTargetCharsSchema
|
|
73
73
|
}),
|
|
@@ -81,20 +81,21 @@ function valid(schema, value, fallback) {
|
|
|
81
81
|
return parsed.success ? parsed.data : fallback;
|
|
82
82
|
}
|
|
83
83
|
/**
|
|
84
|
-
* Deep-merges unknown input over the defaults; unknown keys dropped, invalid values replaced.
|
|
85
|
-
* `
|
|
84
|
+
* Deep-merges unknown input over the defaults; unknown keys dropped, invalid values replaced. Reads older stored settings
|
|
85
|
+
* through `migrateEditorSettings` (`./migrate`), including the legacy flat `{ headingConversionScope }` per-browser shape.
|
|
86
|
+
* Always returns fresh objects of the current version.
|
|
86
87
|
*/
|
|
87
88
|
function parseEditorSettings(input) {
|
|
88
|
-
const root = record(input);
|
|
89
|
+
const root = record(migrateEditorSettings(input));
|
|
89
90
|
const editing = record(root.editing);
|
|
90
91
|
const ai = record(root.ai);
|
|
91
|
-
const
|
|
92
|
+
const roles = record(ai.roles);
|
|
92
93
|
const blocks = record(root.blocks);
|
|
93
94
|
const appearance = record(root.appearance);
|
|
94
95
|
const defaults = EDITOR_SETTINGS_DEFAULTS;
|
|
95
96
|
const legacyScope = valid(headingConversionScopeSchema, root.headingConversionScope, defaults.editing.headingConversionScope);
|
|
96
97
|
return {
|
|
97
|
-
version:
|
|
98
|
+
version: 2,
|
|
98
99
|
editing: {
|
|
99
100
|
headingConversionScope: valid(headingConversionScopeSchema, editing.headingConversionScope, legacyScope),
|
|
100
101
|
authorColors: valid(authorColorsSchema, editing.authorColors, defaults.editing.authorColors),
|
|
@@ -103,17 +104,17 @@ function parseEditorSettings(input) {
|
|
|
103
104
|
},
|
|
104
105
|
ai: {
|
|
105
106
|
autocomplete: valid(autocompleteSchema, ai.autocomplete, defaults.ai.autocomplete),
|
|
106
|
-
|
|
107
|
-
const parsed = profileIdSchema.safeParse(
|
|
108
|
-
return parsed.success ? [[
|
|
107
|
+
roles: Object.fromEntries(MODEL_ROLES.flatMap((role) => {
|
|
108
|
+
const parsed = profileIdSchema.safeParse(roles[role]);
|
|
109
|
+
return parsed.success ? [[role, parsed.data]] : [];
|
|
109
110
|
})),
|
|
110
111
|
translateLanguage: valid(translateLanguageSchema, ai.translateLanguage, defaults.ai.translateLanguage)
|
|
111
112
|
},
|
|
112
113
|
blocks: {
|
|
113
|
-
|
|
114
|
+
defaultBlockType: valid(defaultBlockTypeSchema, blocks.defaultBlockType, defaults.blocks.defaultBlockType),
|
|
114
115
|
structure: valid(structureSchema, blocks.structure, defaults.blocks.structure),
|
|
115
116
|
treeRoot: valid(treeRootSchema, blocks.treeRoot, defaults.blocks.treeRoot),
|
|
116
|
-
|
|
117
|
+
blockTypeIcon: valid(blockTypeIconSchema, blocks.blockTypeIcon, defaults.blocks.blockTypeIcon),
|
|
117
118
|
dragHandle: valid(dragHandleSchema, blocks.dragHandle, defaults.blocks.dragHandle),
|
|
118
119
|
splitTargetChars: valid(splitTargetCharsSchema, blocks.splitTargetChars, defaults.blocks.splitTargetChars)
|
|
119
120
|
},
|
|
@@ -121,6 +122,6 @@ function parseEditorSettings(input) {
|
|
|
121
122
|
};
|
|
122
123
|
}
|
|
123
124
|
//#endregion
|
|
124
|
-
export { AI_LANGUAGES, AUTHOR_COLOR_STYLES, COMMENTS_LAYOUTS, DRAG_HANDLE_VISIBILITIES, EDITOR_SETTINGS_DEFAULTS, EDITOR_SETTINGS_VERSION, HEADING_CONVERSION_SCOPES,
|
|
125
|
+
export { AI_LANGUAGES, AUTHOR_COLOR_STYLES, BLOCK_TYPE_ICON_VISIBILITIES, COMMENTS_LAYOUTS, DRAG_HANDLE_VISIBILITIES, EDITOR_SETTINGS_DEFAULTS, EDITOR_SETTINGS_VERSION, HEADING_CONVERSION_SCOPES, MODEL_ROLES, SPLIT_TARGET_CHARS_MAX, SPLIT_TARGET_CHARS_MIN, STRUCTURE_MODES, THEME_ID, TREE_ROOTS, clampSplitTargetChars, editorSettingsSchema, isOutdatedEditorSettings, migrateEditorSettings, parseEditorSettings };
|
|
125
126
|
|
|
126
127
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../src/settings/index.ts"],"sourcesContent":["import { z } from 'zod'\nimport {\n AI_LANGUAGES,\n type AiLanguage,\n AUTHOR_COLOR_STYLES,\n type AuthorColorStyle,\n COMMENTS_LAYOUTS,\n type CommentsLayout,\n DRAG_HANDLE_VISIBILITIES,\n type DragHandleVisibility,\n HEADING_CONVERSION_SCOPES,\n type HeadingConversionScope,\n KIND_ICON_VISIBILITIES,\n type KindIconVisibility,\n MODEL_SLOTS,\n type ModelSlot,\n STRUCTURE_MODES,\n type StructureMode,\n TREE_ROOTS,\n type TreeRoot,\n} from './values'\n\nexport * from './values'\n\nexport const EDITOR_SETTINGS_VERSION = 1\n\n/** Valid theme id: lowercase slug, used as directory name and in `/api/editor/themes/:id`. Defined here so core never imports a feature. */\nexport const THEME_ID = /^[a-z0-9][a-z0-9-]{0,63}$/\n\n/** A user's editor preferences, shared by all editors on the page; persisted per user through the `settings` port. */\nexport interface EditorSettings {\n version: typeof EDITOR_SETTINGS_VERSION\n editing: {\n /** Blocks „Gliederung umwandeln“ (both directions) converts when nothing is selected. */\n headingConversionScope: HeadingConversionScope\n /** Text is tinted per author (authors feature): each run in the colour of the user who wrote it. */\n authorColors: boolean\n /** `background`: tinted background; `text`: text in the author's colour. */\n authorColorStyle: AuthorColorStyle\n /** `margin`: comment cards in a column beside the text; `inline`: popover at the text plus the toolbar's list (comments feature). */\n commentsLayout: CommentsLayout\n }\n ai: {\n /** Ghost-text suggestions while typing (`GhostAutocomplete`). */\n autocomplete: boolean\n /** Model profile id per slot; a missing or unknown id falls back to the server's default preset for the slot. */\n slots: Partial<Record<ModelSlot, string>>\n /** Preselected target language of „Übersetzen“. */\n translateLanguage: AiLanguage\n }\n blocks: {\n /** Composite kind id the „Baustein“ shortcuts create (toolbar button, heading conversion). */\n defaultKind: string\n /** Preferred document structure: toolbar block types and the structure of AI-generated blocks. */\n structure: StructureMode\n /** Root of the document drawer while a composite file is loaded: nested in the folders, or the file itself. */\n treeRoot: TreeRoot\n /** Kind icon of composites (their drag handle): always visible, or only on hover, focus or while the details are open. */\n kindIcon: KindIconVisibility\n /** Standard drag handle of blocks without kind icon: on the hovered block, or permanently beside every block. */\n dragHandle: DragHandleVisibility\n /** Target size in characters of the parts a length split cuts a Baustein into (200–20000). */\n splitTargetChars: number\n }\n appearance: {\n /** Id of the Obsidian theme applied to the whole app (themes feature); `null` = the standard Nuxt UI look. */\n theme: string | null\n }\n}\n\n/** Bounds of `blocks.splitTargetChars`. */\nexport const SPLIT_TARGET_CHARS_MIN = 200\nexport const SPLIT_TARGET_CHARS_MAX = 20000\n\n/** The split target typed into the field as a valid setting: rounded and clamped to its bounds; `current` when `typed` is empty or not a number. */\nexport function clampSplitTargetChars(typed: string, current: number): number {\n const value = Math.round(Number(typed))\n return typed.trim() !== '' && Number.isFinite(value) ? Math.min(SPLIT_TARGET_CHARS_MAX, Math.max(SPLIT_TARGET_CHARS_MIN, value)) : current\n}\n\nexport const EDITOR_SETTINGS_DEFAULTS: EditorSettings = {\n version: EDITOR_SETTINGS_VERSION,\n editing: { headingConversionScope: 'container', authorColors: false, authorColorStyle: 'background', commentsLayout: 'margin' },\n ai: { autocomplete: false, slots: {}, translateLanguage: 'Englisch' },\n blocks: { defaultKind: 'section', structure: 'composite', treeRoot: 'folders', kindIcon: 'always', dragHandle: 'hover', splitTargetChars: 1500 },\n appearance: { theme: null },\n}\n\nconst headingConversionScopeSchema = z.enum(HEADING_CONVERSION_SCOPES)\nconst authorColorsSchema = z.boolean()\nconst authorColorStyleSchema = z.enum(AUTHOR_COLOR_STYLES)\nconst commentsLayoutSchema = z.enum(COMMENTS_LAYOUTS)\nconst autocompleteSchema = z.boolean()\nconst profileIdSchema = z.string().min(1).max(100)\nconst translateLanguageSchema = z.enum(AI_LANGUAGES)\nconst defaultKindSchema = z.string().min(1).max(100)\nconst structureSchema = z.enum(STRUCTURE_MODES)\nconst treeRootSchema = z.enum(TREE_ROOTS)\nconst kindIconSchema = z.enum(KIND_ICON_VISIBILITIES)\nconst dragHandleSchema = z.enum(DRAG_HANDLE_VISIBILITIES)\nconst splitTargetCharsSchema = z.number().int().min(SPLIT_TARGET_CHARS_MIN).max(SPLIT_TARGET_CHARS_MAX)\nconst themeSchema = z.string().regex(THEME_ID).nullable()\n\n/** Complete, valid settings (the body of `PUT /api/editor/settings`). */\nexport const editorSettingsSchema = z.object({\n version: z.literal(EDITOR_SETTINGS_VERSION),\n editing: z.object({\n headingConversionScope: headingConversionScopeSchema,\n authorColors: authorColorsSchema,\n authorColorStyle: authorColorStyleSchema,\n commentsLayout: commentsLayoutSchema,\n }),\n ai: z.object({\n autocomplete: autocompleteSchema,\n slots: z.partialRecord(z.enum(MODEL_SLOTS), profileIdSchema),\n translateLanguage: translateLanguageSchema,\n }),\n blocks: z.object({\n defaultKind: defaultKindSchema,\n structure: structureSchema,\n treeRoot: treeRootSchema,\n kindIcon: kindIconSchema,\n dragHandle: dragHandleSchema,\n splitTargetChars: splitTargetCharsSchema,\n }),\n appearance: z.object({ theme: themeSchema }),\n}) satisfies z.ZodType<EditorSettings>\n\nfunction record(value: unknown): Record<string, unknown> {\n return value && typeof value === 'object' && !Array.isArray(value) ? value as Record<string, unknown> : {}\n}\n\nfunction valid<T>(schema: z.ZodType<T>, value: unknown, fallback: T): T {\n const parsed = schema.safeParse(value)\n return parsed.success ? parsed.data : fallback\n}\n\n/**\n * Deep-merges unknown input over the defaults; unknown keys dropped, invalid values replaced. Accepts the legacy flat\n * `{ headingConversionScope }` shape of the per-browser settings before version 1. Always returns fresh objects.\n */\nexport function parseEditorSettings(input: unknown): EditorSettings {\n const root = record(input)\n const editing = record(root.editing)\n const ai = record(root.ai)\n const slots = record(ai.slots)\n const blocks = record(root.blocks)\n const appearance = record(root.appearance)\n const defaults = EDITOR_SETTINGS_DEFAULTS\n const legacyScope = valid(headingConversionScopeSchema, root.headingConversionScope, defaults.editing.headingConversionScope)\n return {\n version: EDITOR_SETTINGS_VERSION,\n editing: {\n headingConversionScope: valid(headingConversionScopeSchema, editing.headingConversionScope, legacyScope),\n authorColors: valid(authorColorsSchema, editing.authorColors, defaults.editing.authorColors),\n authorColorStyle: valid(authorColorStyleSchema, editing.authorColorStyle, defaults.editing.authorColorStyle),\n commentsLayout: valid(commentsLayoutSchema, editing.commentsLayout, defaults.editing.commentsLayout),\n },\n ai: {\n autocomplete: valid(autocompleteSchema, ai.autocomplete, defaults.ai.autocomplete),\n slots: Object.fromEntries(MODEL_SLOTS.flatMap((slot) => {\n const parsed = profileIdSchema.safeParse(slots[slot])\n return parsed.success ? [[slot, parsed.data]] : []\n })),\n translateLanguage: valid(translateLanguageSchema, ai.translateLanguage, defaults.ai.translateLanguage),\n },\n blocks: {\n defaultKind: valid(defaultKindSchema, blocks.defaultKind, defaults.blocks.defaultKind),\n structure: valid(structureSchema, blocks.structure, defaults.blocks.structure),\n treeRoot: valid(treeRootSchema, blocks.treeRoot, defaults.blocks.treeRoot),\n kindIcon: valid(kindIconSchema, blocks.kindIcon, defaults.blocks.kindIcon),\n dragHandle: valid(dragHandleSchema, blocks.dragHandle, defaults.blocks.dragHandle),\n splitTargetChars: valid(splitTargetCharsSchema, blocks.splitTargetChars, defaults.blocks.splitTargetChars),\n },\n appearance: {\n theme: valid(themeSchema, appearance.theme, defaults.appearance.theme),\n },\n }\n}\n"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../src/settings/index.ts"],"sourcesContent":["import { z } from 'zod'\nimport {\n AI_LANGUAGES,\n type AiLanguage,\n AUTHOR_COLOR_STYLES,\n type AuthorColorStyle,\n BLOCK_TYPE_ICON_VISIBILITIES,\n type BlockTypeIconVisibility,\n COMMENTS_LAYOUTS,\n type CommentsLayout,\n DRAG_HANDLE_VISIBILITIES,\n type DragHandleVisibility,\n HEADING_CONVERSION_SCOPES,\n type HeadingConversionScope,\n MODEL_ROLES,\n type ModelRole,\n STRUCTURE_MODES,\n type StructureMode,\n TREE_ROOTS,\n type TreeRoot,\n} from './values'\nimport { EDITOR_SETTINGS_VERSION, migrateEditorSettings } from './migrate'\n\nexport * from './values'\nexport { EDITOR_SETTINGS_VERSION, isOutdatedEditorSettings, migrateEditorSettings } from './migrate'\n\n/** Valid theme id: lowercase slug, used as directory name and in `/api/editor/themes/:id`. Defined here so core never imports a feature. */\nexport const THEME_ID = /^[a-z0-9][a-z0-9-]{0,63}$/\n\n/** A user's editor preferences, shared by all editors on the page; persisted per user through the `settings` port. */\nexport interface EditorSettings {\n version: typeof EDITOR_SETTINGS_VERSION\n editing: {\n /** Blocks „Gliederung umwandeln“ (both directions) converts when nothing is selected. */\n headingConversionScope: HeadingConversionScope\n /** Text is tinted per author (authors feature): each run in the colour of the user who wrote it. */\n authorColors: boolean\n /** `background`: tinted background; `text`: text in the author's colour. */\n authorColorStyle: AuthorColorStyle\n /** `margin`: comment cards in a column beside the text; `inline`: popover at the text plus the toolbar's list (comments feature). */\n commentsLayout: CommentsLayout\n }\n ai: {\n /** Ghost-text suggestions while typing (`GhostAutocomplete`). */\n autocomplete: boolean\n /** Model profile id per model role; a missing or unknown id falls back to the server's default preset for the role. */\n roles: Partial<Record<ModelRole, string>>\n /** Preselected target language of „Übersetzen“. */\n translateLanguage: AiLanguage\n }\n blocks: {\n /** Block type id the Typed block shortcuts create (toolbar button, heading conversion). */\n defaultBlockType: string\n /** Preferred document structure: toolbar block types and the structure of AI-generated blocks. */\n structure: StructureMode\n /** Root of the document drawer while a Document with Typed blocks is loaded: nested in the folders, or the file itself. */\n treeRoot: TreeRoot\n /** Block type icon of Typed blocks (their drag handle): always visible, or only on hover, focus or while the details are open. */\n blockTypeIcon: BlockTypeIconVisibility\n /** Standard drag handle of blocks without Block type icon: on the hovered block, or permanently beside every block. */\n dragHandle: DragHandleVisibility\n /** Target size in characters of the parts a length split cuts a Typed block into (200–20000). */\n splitTargetChars: number\n }\n appearance: {\n /** Id of the Obsidian theme applied to the whole app (themes feature); `null` = the standard Nuxt UI look. */\n theme: string | null\n }\n}\n\n/** Bounds of `blocks.splitTargetChars`. */\nexport const SPLIT_TARGET_CHARS_MIN = 200\nexport const SPLIT_TARGET_CHARS_MAX = 20000\n\n/** The split target typed into the field as a valid setting: rounded and clamped to its bounds; `current` when `typed` is empty or not a number. */\nexport function clampSplitTargetChars(typed: string, current: number): number {\n const value = Math.round(Number(typed))\n return typed.trim() !== '' && Number.isFinite(value) ? Math.min(SPLIT_TARGET_CHARS_MAX, Math.max(SPLIT_TARGET_CHARS_MIN, value)) : current\n}\n\nexport const EDITOR_SETTINGS_DEFAULTS: EditorSettings = {\n version: EDITOR_SETTINGS_VERSION,\n editing: { headingConversionScope: 'container', authorColors: false, authorColorStyle: 'background', commentsLayout: 'margin' },\n ai: { autocomplete: false, roles: {}, translateLanguage: 'Englisch' },\n blocks: { defaultBlockType: 'section', structure: 'structured', treeRoot: 'folders', blockTypeIcon: 'always', dragHandle: 'hover', splitTargetChars: 1500 },\n appearance: { theme: null },\n}\n\nconst headingConversionScopeSchema = z.enum(HEADING_CONVERSION_SCOPES)\nconst authorColorsSchema = z.boolean()\nconst authorColorStyleSchema = z.enum(AUTHOR_COLOR_STYLES)\nconst commentsLayoutSchema = z.enum(COMMENTS_LAYOUTS)\nconst autocompleteSchema = z.boolean()\nconst profileIdSchema = z.string().min(1).max(100)\nconst translateLanguageSchema = z.enum(AI_LANGUAGES)\nconst defaultBlockTypeSchema = z.string().min(1).max(100)\nconst structureSchema = z.enum(STRUCTURE_MODES)\nconst treeRootSchema = z.enum(TREE_ROOTS)\nconst blockTypeIconSchema = z.enum(BLOCK_TYPE_ICON_VISIBILITIES)\nconst dragHandleSchema = z.enum(DRAG_HANDLE_VISIBILITIES)\nconst splitTargetCharsSchema = z.number().int().min(SPLIT_TARGET_CHARS_MIN).max(SPLIT_TARGET_CHARS_MAX)\nconst themeSchema = z.string().regex(THEME_ID).nullable()\n\n/** Complete, valid settings (the body of `PUT /api/editor/settings`). */\nexport const editorSettingsSchema = z.object({\n version: z.literal(EDITOR_SETTINGS_VERSION),\n editing: z.object({\n headingConversionScope: headingConversionScopeSchema,\n authorColors: authorColorsSchema,\n authorColorStyle: authorColorStyleSchema,\n commentsLayout: commentsLayoutSchema,\n }),\n ai: z.object({\n autocomplete: autocompleteSchema,\n roles: z.partialRecord(z.enum(MODEL_ROLES), profileIdSchema),\n translateLanguage: translateLanguageSchema,\n }),\n blocks: z.object({\n defaultBlockType: defaultBlockTypeSchema,\n structure: structureSchema,\n treeRoot: treeRootSchema,\n blockTypeIcon: blockTypeIconSchema,\n dragHandle: dragHandleSchema,\n splitTargetChars: splitTargetCharsSchema,\n }),\n appearance: z.object({ theme: themeSchema }),\n}) satisfies z.ZodType<EditorSettings>\n\nfunction record(value: unknown): Record<string, unknown> {\n return value && typeof value === 'object' && !Array.isArray(value) ? value as Record<string, unknown> : {}\n}\n\nfunction valid<T>(schema: z.ZodType<T>, value: unknown, fallback: T): T {\n const parsed = schema.safeParse(value)\n return parsed.success ? parsed.data : fallback\n}\n\n/**\n * Deep-merges unknown input over the defaults; unknown keys dropped, invalid values replaced. Reads older stored settings\n * through `migrateEditorSettings` (`./migrate`), including the legacy flat `{ headingConversionScope }` per-browser shape.\n * Always returns fresh objects of the current version.\n */\nexport function parseEditorSettings(input: unknown): EditorSettings {\n const root = record(migrateEditorSettings(input))\n const editing = record(root.editing)\n const ai = record(root.ai)\n const roles = record(ai.roles)\n const blocks = record(root.blocks)\n const appearance = record(root.appearance)\n const defaults = EDITOR_SETTINGS_DEFAULTS\n const legacyScope = valid(headingConversionScopeSchema, root.headingConversionScope, defaults.editing.headingConversionScope)\n return {\n version: EDITOR_SETTINGS_VERSION,\n editing: {\n headingConversionScope: valid(headingConversionScopeSchema, editing.headingConversionScope, legacyScope),\n authorColors: valid(authorColorsSchema, editing.authorColors, defaults.editing.authorColors),\n authorColorStyle: valid(authorColorStyleSchema, editing.authorColorStyle, defaults.editing.authorColorStyle),\n commentsLayout: valid(commentsLayoutSchema, editing.commentsLayout, defaults.editing.commentsLayout),\n },\n ai: {\n autocomplete: valid(autocompleteSchema, ai.autocomplete, defaults.ai.autocomplete),\n roles: Object.fromEntries(MODEL_ROLES.flatMap((role) => {\n const parsed = profileIdSchema.safeParse(roles[role])\n return parsed.success ? [[role, parsed.data]] : []\n })),\n translateLanguage: valid(translateLanguageSchema, ai.translateLanguage, defaults.ai.translateLanguage),\n },\n blocks: {\n defaultBlockType: valid(defaultBlockTypeSchema, blocks.defaultBlockType, defaults.blocks.defaultBlockType),\n structure: valid(structureSchema, blocks.structure, defaults.blocks.structure),\n treeRoot: valid(treeRootSchema, blocks.treeRoot, defaults.blocks.treeRoot),\n blockTypeIcon: valid(blockTypeIconSchema, blocks.blockTypeIcon, defaults.blocks.blockTypeIcon),\n dragHandle: valid(dragHandleSchema, blocks.dragHandle, defaults.blocks.dragHandle),\n splitTargetChars: valid(splitTargetCharsSchema, blocks.splitTargetChars, defaults.blocks.splitTargetChars),\n },\n appearance: {\n theme: valid(themeSchema, appearance.theme, defaults.appearance.theme),\n },\n }\n}\n"],"mappings":"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"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
//#region src/settings/migrate.d.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
|
+
export declare const EDITOR_SETTINGS_VERSION = 2;
|
|
7
|
+
/**
|
|
8
|
+
* Maps stored settings of version 1 (and the unversioned flat per-browser shape before it) to version 2: `ai.slots` →
|
|
9
|
+
* `ai.roles`, `blocks.defaultKind` → `blocks.defaultBlockType`, `blocks.kindIcon` → `blocks.blockTypeIcon`, the
|
|
10
|
+
* `blocks.structure` value `'composite'` → `'structured'`. A key that is already new wins over the old one; unknown keys
|
|
11
|
+
* and values pass through (`parseEditorSettings` validates). Input of version 2 or later, and anything that is not an
|
|
12
|
+
* object, is returned as it is, so the migration is idempotent. Never mutates `input`.
|
|
13
|
+
*/
|
|
14
|
+
export declare function migrateEditorSettings(input: unknown): unknown;
|
|
15
|
+
/** True when `stored` is a settings record older than `EDITOR_SETTINGS_VERSION`: it is written back once, migrated (`migrateEditorSettings`). */
|
|
16
|
+
export declare function isOutdatedEditorSettings(stored: unknown): boolean;
|
|
17
|
+
//#endregion
|
|
18
|
+
//# sourceMappingURL=migrate.d.ts.map
|
|
@@ -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",
|