@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
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { bibtexOf, cslOf, cslTypeOptions } from "../bibliography.js";
|
|
2
|
+
import { propertyHostOf, setBlockProperty } from "../properties.js";
|
|
2
3
|
import { useUiKit } from "../../../vue/kit/use-ui-kit.js";
|
|
3
4
|
import { useEditorI18n } from "../../../vue/use-editor-i18n.js";
|
|
4
|
-
import { compositeOfRow, setCompositeMetaField } from "../rows.js";
|
|
5
5
|
import { bibFormOf, bibItemOf } from "../bibliography-form.js";
|
|
6
6
|
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, onBeforeUnmount, openBlock, reactive, ref, renderList, unref, watch, withKeys } from "vue";
|
|
7
7
|
//#region src/features/composites/components/BibliographyEditor.vue
|
|
@@ -11,7 +11,7 @@ const _hoisted_3 = { class: "flex justify-end gap-1.5" };
|
|
|
11
11
|
/**
|
|
12
12
|
* The structured editor of a `bibliography` field (CSL-JSON item, `meta.bib`): type, authors, year, container, volume,
|
|
13
13
|
* issue, pages, publisher, DOI, ISBN, URL and abstract. Inputs keep a local draft; every commit (blur, Enter, choosing
|
|
14
|
-
* a type, unmount) writes the whole item through `
|
|
14
|
+
* a type, unmount) writes the whole item through `setBlockProperty`. The title is the Typed block's and never stored.
|
|
15
15
|
*/
|
|
16
16
|
const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
17
17
|
__name: "BibliographyEditor",
|
|
@@ -46,7 +46,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
46
46
|
const { row, field, stored: base } = target;
|
|
47
47
|
target = null;
|
|
48
48
|
const same = row.key === props.row.key;
|
|
49
|
-
if (!props.editor.isDestroyed)
|
|
49
|
+
if (!props.editor.isDestroyed) setBlockProperty(props.editor, same ? props.row : row, field.key, bibItemOf(form, same ? stored.value : base));
|
|
50
50
|
}
|
|
51
51
|
function markDirty() {
|
|
52
52
|
if (!dirty) target = {
|
|
@@ -72,7 +72,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
72
72
|
onBeforeUnmount(() => clearTimeout(copiedTimer));
|
|
73
73
|
async function copyBibtex() {
|
|
74
74
|
commit();
|
|
75
|
-
const node =
|
|
75
|
+
const node = propertyHostOf(props.editor.state.doc, props.row)?.node;
|
|
76
76
|
const csl = node && cslOf(node);
|
|
77
77
|
if (!csl) return;
|
|
78
78
|
await navigator.clipboard.writeText(bibtexOf(csl));
|
|
@@ -86,7 +86,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
86
86
|
const hasDoi = computed(() => form.doi.trim() !== "" || typeof props.row.meta.doi === "string" && props.row.meta.doi.trim() !== "");
|
|
87
87
|
function fetchByDoi() {
|
|
88
88
|
commit();
|
|
89
|
-
const found =
|
|
89
|
+
const found = propertyHostOf(props.editor.state.doc, props.row);
|
|
90
90
|
if (found) props.editor.commands.fetchCompositeBibliography(found.pos);
|
|
91
91
|
}
|
|
92
92
|
const inputs = [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BibliographyEditor.js","names":["_openBlock","_createElementBlock","_createVNode","_unref","_createElementVNode","_withKeys","_Fragment","_renderList","_createBlock","_createCommentVNode"],"sources":["../../../../src/features/composites/components/BibliographyEditor.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { Editor } from '@tiptap/core'\nimport { computed, onBeforeUnmount, reactive, ref, watch } from 'vue'\nimport { useUiKit } from '../../../vue/kit/use-ui-kit'\nimport { useEditorI18n } from '../../../vue/use-editor-i18n'\nimport { type CslItem, bibtexOf, cslOf, cslTypeOptions, type CslType } from '../bibliography'\nimport { type BibForm, bibFormOf, bibItemOf } from '../bibliography-form'\nimport type { CompositeMetaField } from '../kinds'\nimport { compositeOfRow, type CompositeRow, setCompositeMetaField } from '../rows'\nimport '../bibliography-command'\n\n/**\n * The structured editor of a `bibliography` field (CSL-JSON item, `meta.bib`): type, authors, year, container, volume,\n * issue, pages, publisher, DOI, ISBN, URL and abstract. Inputs keep a local draft; every commit (blur, Enter, choosing\n * a type, unmount) writes the whole item through `setCompositeMetaField`. The title is the Baustein's and never stored.\n */\nconst props = defineProps<{\n editor: Editor\n row: CompositeRow\n field: CompositeMetaField\n disabled?: boolean\n}>()\n\nconst { Button: UButton, Input: UInput, Select: USelect, Textarea: UTextarea } = useUiKit()\nconst { t } = useEditorI18n()\n\nconst stored = computed<CslItem | null>(() => {\n const value = props.row.meta[props.field.key] as Partial<CslItem> | null | undefined\n return value && typeof value === 'object' && typeof value.type === 'string' ? value as CslItem : null\n})\nconst typeItems = computed(() => cslTypeOptions(t))\n\nconst form = reactive<BibForm>(bibFormOf(stored.value))\nlet dirty = false\n// The row/field the draft belongs to, taken at the first edit: when the component is re-bound to another row the pending\n// draft must still be written to the row it was typed for.\nlet target: { row: CompositeRow, field: CompositeMetaField, stored: CslItem | null } | null = null\n\nwatch(() => props.row.key, () => {\n commit()\n Object.assign(form, bibFormOf(stored.value))\n})\nwatch(stored, (value) => {\n if (!dirty) Object.assign(form, bibFormOf(value))\n})\n\nfunction commit() {\n if (!dirty || !target) return\n dirty = false\n const { row, field, stored: base } = target\n target = null\n // The same Baustein: the current props carry its up-to-date position and stored item.\n const same = row.key === props.row.key\n if (!props.editor.isDestroyed) setCompositeMetaField(props.editor, same ? props.row : row, field.key, bibItemOf(form, same ? stored.value : base))\n}\n\nfunction markDirty() {\n if (!dirty) target = { row: props.row, field: props.field, stored: stored.value }\n dirty = true\n}\n\nfunction onInput<K extends keyof BibForm>(key: K, value: unknown) {\n form[key] = (typeof value === 'string' ? value : '') as BibForm[K]\n markDirty()\n}\n\nfunction onType(value: unknown) {\n if (typeof value !== 'string') return\n form.type = value as CslType\n markDirty()\n commit()\n}\n\nonBeforeUnmount(commit)\n\nconst copied = ref(false)\nlet copiedTimer: ReturnType<typeof setTimeout> | undefined\nonBeforeUnmount(() => clearTimeout(copiedTimer))\n\nasync function copyBibtex() {\n commit()\n const node = compositeOfRow(props.editor.state.doc, props.row)?.node\n const csl = node && cslOf(node)\n if (!csl) return\n await navigator.clipboard.writeText(bibtexOf(csl))\n copied.value = true\n clearTimeout(copiedTimer)\n copiedTimer = setTimeout(() => {\n copied.value = false\n }, 1500)\n}\n\n// Registered by the AI integration (`composite-ai`); without it there is nothing to fetch with.\nconst canFetch = typeof props.editor.commands.fetchCompositeBibliography === 'function'\nconst hasDoi = computed(() => form.doi.trim() !== '' || (typeof props.row.meta.doi === 'string' && props.row.meta.doi.trim() !== ''))\n\nfunction fetchByDoi() {\n commit()\n const found = compositeOfRow(props.editor.state.doc, props.row)\n if (found) props.editor.commands.fetchCompositeBibliography(found.pos)\n}\n\nconst inputs = [\n { key: 'containerTitle', labelKey: 'composites.bib.field.containerTitle' },\n { key: 'publisher', labelKey: 'composites.bib.field.publisher' },\n { key: 'doi', labelKey: 'composites.bib.field.doi' },\n { key: 'isbn', labelKey: 'composites.bib.field.isbn' },\n { key: 'url', labelKey: 'composites.bib.field.url' },\n] as const\nconst numbers = [\n { key: 'volume', labelKey: 'composites.bib.field.volume' },\n { key: 'issue', labelKey: 'composites.bib.field.issue' },\n { key: 'page', labelKey: 'composites.bib.field.page' },\n] as const\n</script>\n\n<template>\n <div class=\"flex flex-col gap-1.5\">\n <USelect\n :model-value=\"form.type\"\n :items=\"typeItems\"\n :aria-label=\"t('composites.bib.field.type')\"\n :disabled=\"disabled\"\n size=\"xs\"\n class=\"w-full\"\n @update:model-value=\"onType\"\n />\n <UTextarea\n :model-value=\"form.authors\"\n :placeholder=\"t('composites.bib.field.authorsHelp')\"\n :aria-label=\"t('composites.bib.field.authors')\"\n :disabled=\"disabled\"\n size=\"xs\"\n autoresize\n :rows=\"2\"\n :maxrows=\"6\"\n class=\"w-full\"\n @blur=\"commit\"\n @update:model-value=\"(value: unknown) => onInput('authors', value)\"\n />\n <div class=\"grid grid-cols-4 gap-1.5\">\n <UInput\n :model-value=\"form.year\"\n type=\"number\"\n :placeholder=\"t('composites.bib.field.year')\"\n :aria-label=\"t('composites.bib.field.year')\"\n :disabled=\"disabled\"\n size=\"xs\"\n class=\"col-span-1 w-full\"\n @blur=\"commit\"\n @keydown.enter=\"commit\"\n @update:model-value=\"(value: unknown) => onInput('year', value)\"\n />\n <UInput\n v-for=\"input in numbers\"\n :key=\"input.key\"\n :model-value=\"form[input.key]\"\n :placeholder=\"t(input.labelKey)\"\n :aria-label=\"t(input.labelKey)\"\n :disabled=\"disabled\"\n size=\"xs\"\n class=\"col-span-1 w-full\"\n @blur=\"commit\"\n @keydown.enter=\"commit\"\n @update:model-value=\"(value: unknown) => onInput(input.key, value)\"\n />\n </div>\n <UInput\n v-for=\"input in inputs\"\n :key=\"input.key\"\n :model-value=\"form[input.key]\"\n :placeholder=\"t(input.labelKey)\"\n :aria-label=\"t(input.labelKey)\"\n :disabled=\"disabled\"\n size=\"xs\"\n class=\"w-full\"\n @blur=\"commit\"\n @keydown.enter=\"commit\"\n @update:model-value=\"(value: unknown) => onInput(input.key, value)\"\n />\n <UTextarea\n :model-value=\"form.abstract\"\n :placeholder=\"t('composites.bib.field.abstract')\"\n :aria-label=\"t('composites.bib.field.abstract')\"\n :disabled=\"disabled\"\n size=\"xs\"\n autoresize\n :rows=\"2\"\n :maxrows=\"6\"\n class=\"w-full\"\n @blur=\"commit\"\n @update:model-value=\"(value: unknown) => onInput('abstract', value)\"\n />\n <div class=\"flex justify-end gap-1.5\">\n <UButton\n v-if=\"canFetch\"\n size=\"xs\"\n color=\"neutral\"\n variant=\"ghost\"\n icon=\"i-lucide-book-marked\"\n :label=\"t('composites.bib.fetchDoi')\"\n :disabled=\"disabled || !hasDoi\"\n @click=\"fetchByDoi\"\n />\n <UButton\n size=\"xs\"\n color=\"neutral\"\n variant=\"ghost\"\n icon=\"i-lucide-copy\"\n :label=\"copied ? t('composites.bib.copied') : t('composites.bib.copyBibtex')\"\n :disabled=\"!stored\"\n @click=\"copyBibtex\"\n />\n </div>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;EAgBA,MAAM,QAAQ;EAOd,MAAM,EAAE,QAAQ,SAAS,OAAO,QAAQ,QAAQ,SAAS,UAAU,cAAc,SAAS;EAC1F,MAAM,EAAE,MAAM,cAAc;EAE5B,MAAM,SAAS,eAA+B;GAC5C,MAAM,QAAQ,MAAM,IAAI,KAAK,MAAM,MAAM;GACzC,OAAO,SAAS,OAAO,UAAU,YAAY,OAAO,MAAM,SAAS,WAAW,QAAmB;EACnG,CAAC;EACD,MAAM,YAAY,eAAe,eAAe,CAAC,CAAC;EAElD,MAAM,OAAO,SAAkB,UAAU,OAAO,KAAK,CAAC;EACtD,IAAI,QAAQ;EAGZ,IAAI,SAA0F;EAE9F,YAAY,MAAM,IAAI,WAAW;GAC/B,OAAO;GACP,OAAO,OAAO,MAAM,UAAU,OAAO,KAAK,CAAC;EAC7C,CAAC;EACD,MAAM,SAAS,UAAU;GACvB,IAAI,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AA,OAAA,MAAG,UAAmB,QAAO,YAAa,KAAK;;;;;;;IAEpEC,mBAoBM,OApBN,YAoBM,CAlBI,YADRJ,UAAA,GAAAQ,YASEL,MAAA,OAAA,GAAA;;KAPA,MAAK;KACL,OAAM;KACN,SAAQ;KACR,MAAK;KACJ,OAAOA,MAAA,CAAA,CAAC,CAAA,yBAAA;KACR,UAAU,QAAA,YAAQ,CAAK,OAAA;KACvB,SAAO;IAEV,GAAA,MAAA,GAAA,CAAA,SAAA,UAAA,CAAA,KAAAM,mBAAA,QAAA,IAAA,GAAAP,YAQEC,MAAA,OAAA,GAAA;KAPA,MAAK;KACL,OAAM;KACN,SAAQ;KACR,MAAK;KACJ,OAAO,OAAA,QAASA,MAAA,CAAA,CAAC,CAAA,uBAAA,IAA4BA,MAAA,CAAA,CAAC,CAAA,2BAAA;KAC9C,UAAQ,CAAG,OAAA;KACX,SAAO"}
|
|
1
|
+
{"version":3,"file":"BibliographyEditor.js","names":["_openBlock","_createElementBlock","_createVNode","_unref","_createElementVNode","_withKeys","_Fragment","_renderList","_createBlock","_createCommentVNode"],"sources":["../../../../src/features/composites/components/BibliographyEditor.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { Editor } from '@tiptap/core'\nimport { computed, onBeforeUnmount, reactive, ref, watch } from 'vue'\nimport { useUiKit } from '../../../vue/kit/use-ui-kit'\nimport { useEditorI18n } from '../../../vue/use-editor-i18n'\nimport { type CslItem, bibtexOf, cslOf, cslTypeOptions, type CslType } from '../bibliography'\nimport { type BibForm, bibFormOf, bibItemOf } from '../bibliography-form'\nimport type { PropertyDefinition } from '../../../core/properties'\nimport { type BlockProperties, propertyHostOf, setBlockProperty } from '../properties'\nimport '../bibliography-command'\n\n/**\n * The structured editor of a `bibliography` field (CSL-JSON item, `meta.bib`): type, authors, year, container, volume,\n * issue, pages, publisher, DOI, ISBN, URL and abstract. Inputs keep a local draft; every commit (blur, Enter, choosing\n * a type, unmount) writes the whole item through `setBlockProperty`. The title is the Typed block's and never stored.\n */\nconst props = defineProps<{\n editor: Editor\n row: BlockProperties\n field: PropertyDefinition\n disabled?: boolean\n}>()\n\nconst { Button: UButton, Input: UInput, Select: USelect, Textarea: UTextarea } = useUiKit()\nconst { t } = useEditorI18n()\n\nconst stored = computed<CslItem | null>(() => {\n const value = props.row.meta[props.field.key] as Partial<CslItem> | null | undefined\n return value && typeof value === 'object' && typeof value.type === 'string' ? value as CslItem : null\n})\nconst typeItems = computed(() => cslTypeOptions(t))\n\nconst form = reactive<BibForm>(bibFormOf(stored.value))\nlet dirty = false\n// The row/field the draft belongs to, taken at the first edit: when the component is re-bound to another row the pending\n// draft must still be written to the row it was typed for.\nlet target: { row: BlockProperties, field: PropertyDefinition, stored: CslItem | null } | null = null\n\nwatch(() => props.row.key, () => {\n commit()\n Object.assign(form, bibFormOf(stored.value))\n})\nwatch(stored, (value) => {\n if (!dirty) Object.assign(form, bibFormOf(value))\n})\n\nfunction commit() {\n if (!dirty || !target) return\n dirty = false\n const { row, field, stored: base } = target\n target = null\n // The same Typed block: the current props carry its up-to-date position and stored item.\n const same = row.key === props.row.key\n if (!props.editor.isDestroyed) setBlockProperty(props.editor, same ? props.row : row, field.key, bibItemOf(form, same ? stored.value : base))\n}\n\nfunction markDirty() {\n if (!dirty) target = { row: props.row, field: props.field, stored: stored.value }\n dirty = true\n}\n\nfunction onInput<K extends keyof BibForm>(key: K, value: unknown) {\n form[key] = (typeof value === 'string' ? value : '') as BibForm[K]\n markDirty()\n}\n\nfunction onType(value: unknown) {\n if (typeof value !== 'string') return\n form.type = value as CslType\n markDirty()\n commit()\n}\n\nonBeforeUnmount(commit)\n\nconst copied = ref(false)\nlet copiedTimer: ReturnType<typeof setTimeout> | undefined\nonBeforeUnmount(() => clearTimeout(copiedTimer))\n\nasync function copyBibtex() {\n commit()\n const node = propertyHostOf(props.editor.state.doc, props.row)?.node\n const csl = node && cslOf(node)\n if (!csl) return\n await navigator.clipboard.writeText(bibtexOf(csl))\n copied.value = true\n clearTimeout(copiedTimer)\n copiedTimer = setTimeout(() => {\n copied.value = false\n }, 1500)\n}\n\n// Registered by the AI integration (`composite-ai`); without it there is nothing to fetch with.\nconst canFetch = typeof props.editor.commands.fetchCompositeBibliography === 'function'\nconst hasDoi = computed(() => form.doi.trim() !== '' || (typeof props.row.meta.doi === 'string' && props.row.meta.doi.trim() !== ''))\n\nfunction fetchByDoi() {\n commit()\n const found = propertyHostOf(props.editor.state.doc, props.row)\n if (found) props.editor.commands.fetchCompositeBibliography(found.pos)\n}\n\nconst inputs = [\n { key: 'containerTitle', labelKey: 'composites.bib.field.containerTitle' },\n { key: 'publisher', labelKey: 'composites.bib.field.publisher' },\n { key: 'doi', labelKey: 'composites.bib.field.doi' },\n { key: 'isbn', labelKey: 'composites.bib.field.isbn' },\n { key: 'url', labelKey: 'composites.bib.field.url' },\n] as const\nconst numbers = [\n { key: 'volume', labelKey: 'composites.bib.field.volume' },\n { key: 'issue', labelKey: 'composites.bib.field.issue' },\n { key: 'page', labelKey: 'composites.bib.field.page' },\n] as const\n</script>\n\n<template>\n <div class=\"flex flex-col gap-1.5\">\n <USelect\n :model-value=\"form.type\"\n :items=\"typeItems\"\n :aria-label=\"t('composites.bib.field.type')\"\n :disabled=\"disabled\"\n size=\"xs\"\n class=\"w-full\"\n @update:model-value=\"onType\"\n />\n <UTextarea\n :model-value=\"form.authors\"\n :placeholder=\"t('composites.bib.field.authorsHelp')\"\n :aria-label=\"t('composites.bib.field.authors')\"\n :disabled=\"disabled\"\n size=\"xs\"\n autoresize\n :rows=\"2\"\n :maxrows=\"6\"\n class=\"w-full\"\n @blur=\"commit\"\n @update:model-value=\"(value: unknown) => onInput('authors', value)\"\n />\n <div class=\"grid grid-cols-4 gap-1.5\">\n <UInput\n :model-value=\"form.year\"\n type=\"number\"\n :placeholder=\"t('composites.bib.field.year')\"\n :aria-label=\"t('composites.bib.field.year')\"\n :disabled=\"disabled\"\n size=\"xs\"\n class=\"col-span-1 w-full\"\n @blur=\"commit\"\n @keydown.enter=\"commit\"\n @update:model-value=\"(value: unknown) => onInput('year', value)\"\n />\n <UInput\n v-for=\"input in numbers\"\n :key=\"input.key\"\n :model-value=\"form[input.key]\"\n :placeholder=\"t(input.labelKey)\"\n :aria-label=\"t(input.labelKey)\"\n :disabled=\"disabled\"\n size=\"xs\"\n class=\"col-span-1 w-full\"\n @blur=\"commit\"\n @keydown.enter=\"commit\"\n @update:model-value=\"(value: unknown) => onInput(input.key, value)\"\n />\n </div>\n <UInput\n v-for=\"input in inputs\"\n :key=\"input.key\"\n :model-value=\"form[input.key]\"\n :placeholder=\"t(input.labelKey)\"\n :aria-label=\"t(input.labelKey)\"\n :disabled=\"disabled\"\n size=\"xs\"\n class=\"w-full\"\n @blur=\"commit\"\n @keydown.enter=\"commit\"\n @update:model-value=\"(value: unknown) => onInput(input.key, value)\"\n />\n <UTextarea\n :model-value=\"form.abstract\"\n :placeholder=\"t('composites.bib.field.abstract')\"\n :aria-label=\"t('composites.bib.field.abstract')\"\n :disabled=\"disabled\"\n size=\"xs\"\n autoresize\n :rows=\"2\"\n :maxrows=\"6\"\n class=\"w-full\"\n @blur=\"commit\"\n @update:model-value=\"(value: unknown) => onInput('abstract', value)\"\n />\n <div class=\"flex justify-end gap-1.5\">\n <UButton\n v-if=\"canFetch\"\n size=\"xs\"\n color=\"neutral\"\n variant=\"ghost\"\n icon=\"i-lucide-book-marked\"\n :label=\"t('composites.bib.fetchDoi')\"\n :disabled=\"disabled || !hasDoi\"\n @click=\"fetchByDoi\"\n />\n <UButton\n size=\"xs\"\n color=\"neutral\"\n variant=\"ghost\"\n icon=\"i-lucide-copy\"\n :label=\"copied ? t('composites.bib.copied') : t('composites.bib.copyBibtex')\"\n :disabled=\"!stored\"\n @click=\"copyBibtex\"\n />\n </div>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;EAgBA,MAAM,QAAQ;EAOd,MAAM,EAAE,QAAQ,SAAS,OAAO,QAAQ,QAAQ,SAAS,UAA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CAAC,CAAC,MAAM,QAAQ;MAC7B,cAAYA,MAAA,CAAA,CAAC,CAAC,MAAM,QAAQ;MAC5B,UAAU,QAAA;MACX,MAAK;MACL,OAAM;MACL,QAAM;MACN,WAAOE,SAAQ,QAAM,CAAA,OAAA,CAAA;MACrB,wBAAqB,UAAmB,QAAQ,MAAM,KAAK,KAAK;;;;;;;;;IAEnEH,YAYEC,MAAA,SAAA,GAAA;KAXC,eAAa,KAAK;KAClB,aAAaA,MAAA,CAAA,CAAC,CAAA,+BAAA;KACd,cAAYA,MAAA,CAAA,CAAC,CAAA,+BAAA;KACb,UAAU,QAAA;KACX,MAAK;KACL,YAAA;KACC,MAAM;KACN,SAAS;KACV,OAAM;KACL,QAAM;KACN,uBAAkB,OAAA,OAAA,OAAA,MAAG,UAAmB,QAAO,YAAa,KAAK;;;;;;;IAEpEC,mBAoBM,OApBN,YAoBM,CAlBI,YADRJ,UAAA,GAAAQ,YASEL,MAAA,OAAA,GAAA;;KAPA,MAAK;KACL,OAAM;KACN,SAAQ;KACR,MAAK;KACJ,OAAOA,MAAA,CAAA,CAAC,CAAA,yBAAA;KACR,UAAU,QAAA,YAAQ,CAAK,OAAA;KACvB,SAAO;IAEV,GAAA,MAAA,GAAA,CAAA,SAAA,UAAA,CAAA,KAAAM,mBAAA,QAAA,IAAA,GAAAP,YAQEC,MAAA,OAAA,GAAA;KAPA,MAAK;KACL,OAAM;KACN,SAAQ;KACR,MAAK;KACJ,OAAO,OAAA,QAASA,MAAA,CAAA,CAAC,CAAA,uBAAA,IAA4BA,MAAA,CAAA,CAAC,CAAA,2BAAA;KAC9C,UAAQ,CAAG,OAAA;KACX,SAAO"}
|
|
@@ -11,8 +11,8 @@ const _hoisted_3 = { class: "truncate" };
|
|
|
11
11
|
const _hoisted_4 = ["aria-checked"];
|
|
12
12
|
const _hoisted_5 = { class: "truncate" };
|
|
13
13
|
/**
|
|
14
|
-
* Basket choice of a
|
|
15
|
-
* colour and its label) and „
|
|
14
|
+
* Basket choice of a Typed block: the default slot (a button) opens a list of the editor's baskets (a dot in the basket's
|
|
15
|
+
* colour and its label) and a „none“ entry. The menu is a popover, not a dropdown menu: a dropdown item cannot show a dot in
|
|
16
16
|
* an arbitrary CSS colour.
|
|
17
17
|
*/
|
|
18
18
|
const option = "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)]";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CompositeBasketMenu.js","names":["_openBlock","_createBlock","_unref","_withCtx","_createElementVNode","_createElementBlock","_Fragment","_renderList","_normalizeClass","_normalizeStyle","_toDisplayString","_createCommentVNode","_createVNode","_renderSlot"],"sources":["../../../../src/features/composites/components/CompositeBasketMenu.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { Editor } from '@tiptap/core'\nimport { shallowRef } from 'vue'\nimport { useUiKit } from '../../../vue/kit/use-ui-kit'\nimport { useEditorI18n } from '../../../vue/use-editor-i18n'\nimport { basketOf } from '../baskets'\nimport { compositeBasketsOf } from '../nodes'\nimport { compositeOfRow, type CompositeRow } from '../rows'\n\n/**\n * Basket choice of a
|
|
1
|
+
{"version":3,"file":"CompositeBasketMenu.js","names":["_openBlock","_createBlock","_unref","_withCtx","_createElementVNode","_createElementBlock","_Fragment","_renderList","_normalizeClass","_normalizeStyle","_toDisplayString","_createCommentVNode","_createVNode","_renderSlot"],"sources":["../../../../src/features/composites/components/CompositeBasketMenu.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { Editor } from '@tiptap/core'\nimport { shallowRef } from 'vue'\nimport { useUiKit } from '../../../vue/kit/use-ui-kit'\nimport { useEditorI18n } from '../../../vue/use-editor-i18n'\nimport { basketOf } from '../baskets'\nimport { compositeBasketsOf } from '../nodes'\nimport { compositeOfRow, type CompositeRow } from '../rows'\n\n/**\n * Basket choice of a Typed block: the default slot (a button) opens a list of the editor's baskets (a dot in the basket's\n * colour and its label) and a „none“ entry. The menu is a popover, not a dropdown menu: a dropdown item cannot show a dot in\n * an arbitrary CSS colour.\n */\nconst props = defineProps<{ editor: Editor, row: CompositeRow }>()\n\nconst { Icon: UIcon, Popover: UPopover } = useUiKit()\nconst { t } = useEditorI18n()\n\nconst open = shallowRef(false)\n\n\nfunction choose(basket: string | null) {\n open.value = false\n const found = compositeOfRow(props.editor.state.doc, props.row)\n if (found) props.editor.commands.setCompositeBasket(basket, found.pos)\n}\n\nconst option = '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</script>\n\n<template>\n <UPopover\n v-model:open=\"open\"\n :content=\"{ side: 'bottom', align: 'start', sideOffset: 4, onCloseAutoFocus: (event: Event) => event.preventDefault() }\"\n :ui=\"{ content: 'w-40 p-1' }\"\n >\n <slot />\n <template #content>\n <div role=\"menu\" :aria-label=\"t('composites.basket.label')\">\n <button\n v-for=\"basket in compositeBasketsOf(editor)\"\n :key=\"basket.id\"\n type=\"button\"\n role=\"menuitemradio\"\n :aria-checked=\"basketOf(props.row) === basket.id\"\n :class=\"option\"\n @click=\"choose(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=\"basketOf(props.row) === basket.id\" name=\"i-lucide-check\" class=\"ml-auto size-3.5 shrink-0\" />\n </button>\n <button type=\"button\" role=\"menuitemradio\" :aria-checked=\"basketOf(props.row) === null\" :class=\"option\" @click=\"choose(null)\">\n <UIcon name=\"i-lucide-circle-dashed\" class=\"size-3 shrink-0 text-[var(--sk-muted)]\" />\n <span class=\"truncate\">{{ t('composites.basket.none') }}</span>\n <UIcon v-if=\"bas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D,QAAhD,YAAgDM,gBAAtB,OAAO,KAAK,GAAA,CAAA;MACzBR,MAAA,QAAA,CAAQ,CAAC,MAAM,GAAG,MAAM,OAAO,MAA5CF,UAAA,GAAAC,YAA0GC,MAAA,KAAA,GAAA;;OAA1D,MAAK;OAAiB,OAAM;;;IAE9E,CAAA,GAAA,GAAA,IAAAE,mBAIS,UAAA;KAJD,MAAK;KAAS,MAAK;KAAiB,gBAAcF,MAAA,QAAA,CAAQ,CAAC,MAAM,GAAG,MAAA;KAAa,OAAKM,eAAE,MAAM;KAAG,SAAK,OAAA,OAAA,OAAA,MAAA,WAAE,OAAM,IAAA;;KACpHI,YAAsFV,MAAA,KAAA,GAAA;MAA/E,MAAK;MAAyB,OAAM;;KAC3CE,mBAA+D,QAA/D,YAA+DM,gBAArCR,MAAA,CAAA,CAAC,CAAA,wBAAA,CAAA,GAAA,CAAA;KACdA,MAAA,QAAA,CAAQ,CAAC,MAAM,GAAG,MAAA,QAA/BF,UAAA,GAAAC,YAAqGC,MAAA,KAAA,GAAA;;MAA1D,MAAK;MAAiB,OAAM;;;IAnB7E,SAAAC,cAAQ,CAARU,WAAQ,KAAA,QAAA,SAAA,CAAA,CAAA"}
|
|
@@ -48,7 +48,7 @@ const _hoisted_12 = { class: "w-64 p-3" };
|
|
|
48
48
|
* chip and one chip per tag (with a `+` chip to add tags), and on the front the kind icon. The icon is a button that
|
|
49
49
|
* opens the details popover (kind with a confirmation before it changes, the kind's fields and the summary;
|
|
50
50
|
* `CompositeDetails`) and, in an editable editor, the composite's drag handle: dragging it moves the composite
|
|
51
|
-
* (`startBlockDrag`). A kind with `chrome.tags: false` shows no tag chips and no `+` chip. With `blocks.
|
|
51
|
+
* (`startBlockDrag`). A kind with `chrome.tags: false` shows no tag chips and no `+` chip. With `blocks.blockTypeIcon: 'hover'` it shows only while the composite is hovered, its popover is
|
|
52
52
|
* open or the icon has keyboard focus. Chips and popover also render in read-only editors, without edit affordances.
|
|
53
53
|
* The node view's own description and tags rows are hidden by CSS; this overlay shows and edits them.
|
|
54
54
|
*/
|
|
@@ -73,7 +73,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
73
73
|
onCleanup(() => instance.off("transaction", sync));
|
|
74
74
|
}, { immediate: true });
|
|
75
75
|
const { settings } = useEditorSettings();
|
|
76
|
-
const iconOnHover = computed(() => settings.value.blocks.
|
|
76
|
+
const iconOnHover = computed(() => settings.value.blocks.blockTypeIcon === "hover");
|
|
77
77
|
const hoveredKeys = shallowRef(/* @__PURE__ */ new Set());
|
|
78
78
|
const chipsHoveredKey = shallowRef(null);
|
|
79
79
|
let hoveredSection = null;
|
|
@@ -111,8 +111,8 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
111
111
|
if (!found || !startBlockDrag(props.editor, event, found.pos)) event.preventDefault();
|
|
112
112
|
}
|
|
113
113
|
/** Chips start right after the title's last character and run on to the editor's right edge. */
|
|
114
|
-
const expanded = useStoreRef(() => props.editor.storage.
|
|
115
|
-
const revealedTitles = useStoreRef(() => props.editor.storage.
|
|
114
|
+
const expanded = useStoreRef(() => props.editor.storage.typedBlock.expanded);
|
|
115
|
+
const revealedTitles = useStoreRef(() => props.editor.storage.typedBlock.revealedTitles);
|
|
116
116
|
const placed = computed(() => {
|
|
117
117
|
const baskets = compositeBasketsOf(props.editor);
|
|
118
118
|
let hiddenUntil = -1;
|
|
@@ -136,10 +136,12 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
136
136
|
status: rowStatus(row, t),
|
|
137
137
|
derived: derived && {
|
|
138
138
|
stale: derived.stale,
|
|
139
|
+
sourceMissing: derived.sourceMissing,
|
|
139
140
|
open,
|
|
140
141
|
toggleable: !!row.id
|
|
141
142
|
},
|
|
142
|
-
|
|
143
|
+
hasBasket: row.capabilities.has("basket"),
|
|
144
|
+
basket: row.capabilities.has("basket") ? basketById(baskets, basketOf(row)) ?? null : null,
|
|
143
145
|
titleHidden
|
|
144
146
|
}];
|
|
145
147
|
});
|
|
@@ -217,7 +219,8 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
217
219
|
onMouseenter: ($event) => chipsHoveredKey.value = item.row.key,
|
|
218
220
|
onMouseleave: _cache[1] || (_cache[1] = ($event) => chipsHoveredKey.value = null)
|
|
219
221
|
}, [
|
|
220
|
-
item.editable ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
222
|
+
item.editable ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [item.hasBasket ? (openBlock(), createBlock(_sfc_main$1, {
|
|
223
|
+
key: 0,
|
|
221
224
|
editor: __props.editor,
|
|
222
225
|
row: item.row
|
|
223
226
|
}, {
|
|
@@ -236,7 +239,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
236
239
|
class: "size-3.5"
|
|
237
240
|
}))], 8, _hoisted_4)]),
|
|
238
241
|
_: 2
|
|
239
|
-
}, 1032, ["editor", "row"]), createElementVNode("button", {
|
|
242
|
+
}, 1032, ["editor", "row"])) : createCommentVNode("v-if", true), createElementVNode("button", {
|
|
240
243
|
type: "button",
|
|
241
244
|
class: normalizeClass(chipButton),
|
|
242
245
|
"aria-label": unref(t)(item.titleHidden ? "composites.titleHidden.show" : "composites.titleHidden.hide"),
|
|
@@ -276,7 +279,14 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
276
279
|
}, [createVNode(unref(UIcon), {
|
|
277
280
|
name: "i-lucide-triangle-alert",
|
|
278
281
|
class: "size-3.5"
|
|
279
|
-
}), createTextVNode(toDisplayString(unref(t)("composites.derivation.stale")), 1)], 2)) : createCommentVNode("v-if", true)
|
|
282
|
+
}), createTextVNode(toDisplayString(unref(t)("composites.derivation.stale")), 1)], 2)) : createCommentVNode("v-if", true),
|
|
283
|
+
item.derived.sourceMissing ? (openBlock(), createElementBlock("span", {
|
|
284
|
+
key: 2,
|
|
285
|
+
class: normalizeClass([chip, "text-[var(--sk-warning)]"])
|
|
286
|
+
}, [createVNode(unref(UIcon), {
|
|
287
|
+
name: "i-lucide-unlink",
|
|
288
|
+
class: "size-3.5"
|
|
289
|
+
}), createTextVNode(toDisplayString(unref(t)("composites.derivation.sourceMissing")), 1)], 2)) : createCommentVNode("v-if", true)
|
|
280
290
|
], 64)) : createCommentVNode("v-if", true),
|
|
281
291
|
item.status ? (openBlock(), createElementBlock(Fragment, { key: 3 }, [item.editable ? (openBlock(), createBlock(_sfc_main$3, {
|
|
282
292
|
key: 0,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CompositeChrome.js","names":["_unref","_openBlock","_createBlock","_Teleport","_createElementVNode","_createElementBlock","_Fragment","_renderList","_withCtx","_createVNode","CompositeDetails","_normalizeClass","_normalizeStyle","_withKeys","_withModifiers","_createCommentVNode","CompositeBasketMenu","_createTextVNode","_toDisplayString","CompositeStatusMenu","CompositeTagsEditor"],"sources":["../../../../src/features/composites/components/CompositeChrome.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { Editor } from '@tiptap/vue-3'\nimport { computed, shallowRef, watch } from 'vue'\nimport { startBlockDrag } from '../../../core'\nimport { useUiKit } from '../../../vue/kit/use-ui-kit'\nimport { useEditorI18n } from '../../../vue/use-editor-i18n'\nimport { useStoreRef } from '../../../vue/store-ref'\nimport { useEditorSettings } from '../../../vue/settings'\nimport { compositeSectionOf } from '../anchors'\nimport { derivedChromeOf } from '../derived-chrome'\nimport { rowStatus } from '../meta-display'\nimport { basketById, basketOf, titleHiddenOf } from '../baskets'\nimport { compositeBasketsOf } from '../nodes'\nimport { compositeOfRow, type CompositeRow, setCompositeTags } from '../rows'\nimport { useCompositeAnchors } from '../use-composite-anchors'\nimport { useCompositeRows } from '../use-composite-rows'\nimport CompositeBasketMenu from './CompositeBasketMenu.vue'\nimport CompositeDetails from './CompositeDetails.vue'\nimport CompositeStatusMenu from './CompositeStatusMenu.vue'\nimport CompositeTagsEditor from './CompositeTagsEditor.vue'\n\n/**\n * Chrome of every composite, laid over the editor (mounted by the composites feature): on the title line the status\n * chip and one chip per tag (with a `+` chip to add tags), and on the front the kind icon. The icon is a button that\n * opens the details popover (kind with a confirmation before it changes, the kind's fields and the summary;\n * `CompositeDetails`) and, in an editable editor, the composite's drag handle: dragging it moves the composite\n * (`startBlockDrag`). A kind with `chrome.tags: false` shows no tag chips and no `+` chip. With `blocks.kindIcon: 'hover'` it shows only while the composite is hovered, its popover is\n * open or the icon has keyboard focus. Chips and popover also render in read-only editors, without edit affordances.\n * The node view's own description and tags rows are hidden by CSS; this overlay shows and edits them.\n */\nconst props = defineProps<{ editor: Editor }>()\n\nconst { Icon: UIcon, Popover: UPopover } = useUiKit()\nconst { t } = useEditorI18n()\n\nconst { rows } = useCompositeRows(() => props.editor)\nconst { host, anchors, frame } = useCompositeAnchors(() => props.editor, rows)\n\n// `isEditable` is not reactive: follow it on every transaction (`EditorSurface` dispatches one after `setEditable`).\nconst editable = shallowRef(false)\nwatch(() => props.editor, (instance, _previous, onCleanup) => {\n editable.value = !instance.isDestroyed && instance.isEditable\n const sync = () => {\n editable.value = !instance.isDestroyed && instance.isEditable\n }\n instance.on('transaction', sync)\n onCleanup(() => instance.off('transaction', sync))\n}, { immediate: true })\n\nconst { settings } = useEditorSettings()\nconst iconOnHover = computed(() => settings.value.blocks.kindIcon === 'hover')\n\n// Hover state of `kindIcon: 'hover'`: the keys of the rows whose composite is under the pointer (that one and every\n// composite around it), plus the row whose chips the pointer is on (they sit outside the editor's DOM).\nconst hoveredKeys = shallowRef<ReadonlySet<string>>(new Set())\nconst chipsHoveredKey = shallowRef<string | null>(null)\nlet hoveredSection: Element | null = null\n\nfunction onEditorMouseover(event: MouseEvent) {\n const section = event.target instanceof Element ? event.target.closest('.composite') : null\n if (section === hoveredSection) return\n hoveredSection = section\n const chain = new Set<Element>()\n for (let el = section; el; el = el.parentElement?.closest('.composite') ?? null) chain.add(el)\n const { view, state } = props.editor\n hoveredKeys.value = new Set(rows.value.filter((row) => {\n const found = compositeOfRow(state.doc, row)\n const dom = found ? view.nodeDOM(found.pos) : null\n const section = dom instanceof Element ? compositeSectionOf(dom) : null\n return section !== null && chain.has(section)\n }).map(row => row.key))\n}\n\nfunction onEditorMouseleave() {\n hoveredSection = null\n hoveredKeys.value = new Set()\n}\n\nwatch([() => props.editor, iconOnHover], ([instance, hover], _previous, onCleanup) => {\n onEditorMouseleave()\n if (!hover || instance.isDestroyed) return\n const { dom } = instance.view\n dom.addEventListener('mouseover', onEditorMouseover)\n dom.addEventListener('mouseleave', onEditorMouseleave)\n onCleanup(() => {\n dom.removeEventListener('mouseover', onEditorMouseover)\n dom.removeEventListener('mouseleave', onEditorMouseleave)\n })\n}, { immediate: true })\n\nfunction onIconDragStart(event: DragEvent, row: CompositeRow) {\n const found = compositeOfRow(props.editor.state.doc, row)\n if (!found || !startBlockDrag(props.editor, event, found.pos)) event.preventDefault()\n}\n\n/** Chips start right after the title's last character and run on to the editor's right edge. */\nconst ROW_HEIGHT = 24\n\nconst expanded = useStoreRef(() => props.editor.storage.composite.expanded)\nconst revealedTitles = useStoreRef(() => props.editor.storage.composite.revealedTitles)\n\nconst placed = computed(() => {\n const baskets = compositeBasketsOf(props.editor)\n // End of the collapsed derived Baustein the rows being walked sit in: its clipped content shows no chrome.\n let hiddenUntil = -1\n return rows.value.flatMap((row) => {\n if (row.pos < hiddenUntil) return []\n const derived = derivedChromeOf(props.editor, row)\n const open = !derived || !row.id || expanded.value.has(row.id)\n if (!open) hiddenUntil = row.end\n const anchor = anchors.value.get(row.key)\n if (!anchor) return []\n const titleHidden = titleHiddenOf(row)\n // A hidden title leaves nothing to measure: the chips sit in the strip beside the kind icon (`composites.css`).\n const inStrip = titleHidden && !(row.id && revealedTitles.value.has(row.id)) && anchor.toggleSize > 0\n // An empty title shows a placeholder the anchor cannot measure: keep clear of it.\n const left = inStrip ? anchor.toggleLeft + anchor.toggleSize + 6 : anchor.lineEnd + (anchor.titleEmpty ? 116 : 12)\n return [{\n row,\n anchor,\n // A kind without `chrome.controls` renders as in a read-only editor.\n editable: editable.value && row.controls,\n left,\n top: (inStrip ? anchor.toggleTop + anchor.toggleSize / 2 : anchor.lastCenter) - ROW_HEIGHT / 2,\n width: Math.max((frame.value?.right ?? anchor.right) - left, 120),\n status: rowStatus(row, t),\n derived: derived && { stale: derived.stale, open, toggleable: !!row.id },\n basket: basketById(baskets, basketOf(row)) ?? null,\n titleHidden,\n }]\n })\n})\n\nfunction toggleExpanded(row: CompositeRow) {\n if (row.id) props.editor.commands.toggleCompositeExpanded(row.id)\n}\n\nfunction removeTag(row: CompositeRow, tag: string) {\n setCompositeTags(props.editor, row, row.tags.filter(candidate => candidate !== tag))\n}\n\nfunction toggleTitleHidden(row: CompositeRow) {\n const found = compositeOfRow(props.editor.state.doc, row)\n if (found) props.editor.commands.setCompositeTitleHidden(!titleHiddenOf(row), found.pos)\n}\n\nconst chip = 'inline-flex h-5 shrink-0 items-center gap-1 rounded-sm px-1.5 text-xs leading-none whitespace-nowrap text-[var(--sk-muted)]'\nconst chipButton = `${chip} transition-colors duration-150 hover:bg-[var(--sk-bg-elevated)] hover:text-[var(--sk-fg-highlighted)] focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-[var(--sk-primary)]`\n\n/** Scale and fade in from the icon (`transform-origin` is Reka's), a bit longer than Nuxt UI's default; `composites.css` defines the keyframes and the reduced-motion override. */\nconst detailsPopoverUi = {\n content: 'composite-popover data-[state=open]:animate-[composite-pop-in_160ms_var(--ease-out)] data-[state=closed]:animate-[composite-pop-out_120ms_var(--ease-out)]',\n}\n</script>\n\n<template>\n <Teleport v-if=\"host\" :to=\"host\">\n <div class=\"absolute left-0 top-0 h-0 w-0\">\n <template v-for=\"item in placed\" :key=\"item.row.key\">\n <UPopover\n v-if=\"item.anchor.toggleSize\"\n :content=\"{ side: 'bottom', align: 'start', sideOffset: 4 }\"\n :ui=\"detailsPopoverUi\"\n >\n <!-- A span, not a `button`: Firefox does not start drags from buttons. -->\n <span\n role=\"button\"\n tabindex=\"0\"\n :draggable=\"item.editable\"\n :class=\"[\n 'absolute z-10 flex items-center justify-center rounded-sm bg-[var(--sk-bg)] text-[var(--sk-muted)] transition-[color,background-color,opacity] duration-120 motion-reduce:transition-none hover:bg-[var(--sk-bg-elevated)] hover:text-[var(--sk-fg-highlighted)] focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-[var(--sk-primary)]',\n item.editable ? 'cursor-grab active:cursor-grabbing' : 'cursor-pointer',\n iconOnHover && !hoveredKeys.has(item.row.key) && chipsHoveredKey !== item.row.key && 'opacity-0 hover:opacity-100 focus-visible:opacity-100 data-[state=open]:opacity-100',\n ]\"\n :style=\"{ top: `${item.anchor.toggleTop}px`, left: `${item.anchor.toggleLeft}px`, width: `${item.anchor.toggleSize}px`, height: `${item.anchor.toggleSize}px` }\"\n :aria-label=\"t('composites.chrome.details', { kind: item.row.kindLabel })\"\n :title=\"item.editable ? t('composites.chrome.detailsDrag', { kind: item.row.kindLabel }) : t('composites.chrome.details', { kind: item.row.kindLabel })\"\n @keydown.enter.space.prevent=\"($event.currentTarget as HTMLElement).click()\"\n @dragstart=\"onIconDragStart($event, item.row)\"\n >\n <UIcon :key=\"item.row.icon\" :name=\"item.row.icon\" class=\"size-3.5\" />\n </span>\n <template #content>\n <CompositeDetails :editor=\"editor\" :row=\"item.row\" :editable=\"item.editable\" />\n </template>\n </UPopover>\n\n <div\n v-if=\"item.editable || item.basket || item.status || item.derived || (item.row.tagsVisible && item.row.tags.length)\"\n class=\"absolute z-10 flex items-center gap-px overflow-hidden rounded-md bg-[var(--sk-bg)]\"\n :style=\"{ top: `${item.top}px`, left: `${item.left}px`, maxWidth: `${item.width}px`, height: `${ROW_HEIGHT}px` }\"\n @mouseenter=\"chipsHoveredKey = item.row.key\"\n @mouseleave=\"chipsHoveredKey = null\"\n >\n <template v-if=\"item.editable\">\n <CompositeBasketMenu :editor=\"editor\" :row=\"item.row\">\n <button type=\"button\" :class=\"chipButton\" :aria-label=\"t('composites.basket.label')\" :title=\"item.basket ? `${t('composites.basket.label')}: ${item.basket.label}` : t('composites.basket.label')\">\n <span v-if=\"item.basket\" class=\"size-2.5 rounded-full\" :style=\"{ backgroundColor: item.basket.color }\" />\n <UIcon v-else name=\"i-lucide-circle-dashed\" class=\"size-3.5\" />\n </button>\n </CompositeBasketMenu>\n <button\n type=\"button\"\n :class=\"chipButton\"\n :aria-label=\"t(item.titleHidden ? 'composites.titleHidden.show' : 'composites.titleHidden.hide')\"\n :title=\"t(item.titleHidden ? 'composites.titleHidden.show' : 'composites.titleHidden.hide')\"\n @click=\"toggleTitleHidden(item.row)\"\n >\n <UIcon :name=\"item.titleHidden ? 'i-lucide-eye' : 'i-lucide-eye-off'\" class=\"size-3.5\" />\n </button>\n </template>\n <span v-else-if=\"item.basket\" :class=\"chip\" :title=\"item.basket.label\">\n <span class=\"size-2.5 rounded-full\" :style=\"{ backgroundColor: item.basket.color }\" />\n </span>\n\n <template v-if=\"item.derived\">\n <button\n v-if=\"item.derived.toggleable\"\n type=\"button\"\n :class=\"chipButton\"\n :aria-expanded=\"item.derived.open\"\n :aria-label=\"t(item.derived.open ? 'composites.derivation.collapse' : 'composites.derivation.expand')\"\n :title=\"t(item.derived.open ? 'composites.derivation.collapse' : 'composites.derivation.expand')\"\n @click=\"toggleExpanded(item.row)\"\n >\n <UIcon :name=\"item.derived.open ? 'i-lucide-chevron-down' : 'i-lucide-chevron-right'\" class=\"size-3.5\" />\n </button>\n <span :class=\"chip\">\n <UIcon name=\"i-lucide-git-branch\" class=\"size-3.5\" />{{ t('composites.derivation.badge') }}\n </span>\n <span v-if=\"item.derived.stale\" :class=\"[chip, 'text-[var(--sk-warning)]']\">\n <UIcon name=\"i-lucide-triangle-alert\" class=\"size-3.5\" />{{ t('composites.derivation.stale') }}\n </span>\n </template>\n\n <template v-if=\"item.status\">\n <CompositeStatusMenu v-if=\"item.editable\" :editor=\"editor\" :row=\"item.row\">\n <button type=\"button\" :class=\"chipButton\" :aria-label=\"t('composites.status.label', { status: item.status.label })\">\n <UIcon :name=\"item.status.icon\" :class=\"['size-3.5', item.status.color]\" />{{ item.status.label }}\n </button>\n </CompositeStatusMenu>\n <span v-else :class=\"chip\">\n <UIcon :name=\"item.status.icon\" :class=\"['size-3.5', item.status.color]\" />{{ item.status.label }}\n </span>\n </template>\n\n <span v-for=\"tag in item.row.tagsVisible ? item.row.tags : []\" :key=\"tag\" :class=\"[chip, 'group max-w-40 gap-0']\">\n <span class=\"truncate\">#{{ tag }}</span>\n <button\n v-if=\"item.editable\"\n type=\"button\"\n class=\"flex h-4 w-0 shrink-0 items-center justify-center overflow-hidden rounded-sm opacity-0 transition-all duration-150 group-hover:ml-1 group-hover:w-4 group-hover:opacity-100 hover:bg-[var(--sk-bg-elevated)] hover:text-[var(--sk-fg-highlighted)] focus-visible:ml-1 focus-visible:w-4 focus-visible:opacity-100 focus-visible:outline-2 focus-visible:outline-[var(--sk-primary)]\"\n :aria-label=\"t('composites.tag.remove', { tag })\"\n @click=\"removeTag(item.row, tag)\"\n >\n <UIcon name=\"i-lucide-x\" class=\"size-3\" />\n </button>\n </span>\n\n <UPopover\n v-if=\"item.editable && item.row.tagsVisible\"\n :content=\"{ side: 'bottom', align: 'start', sideOffset: 6, onCloseAutoFocus: (event: Event) => event.preventDefault() }\"\n >\n <button type=\"button\" :class=\"chipButton\" :aria-label=\"t('composites.tag.add')\" :title=\"t('composites.tag.add')\">\n <UIcon name=\"i-lucide-plus\" class=\"size-3.5\" />\n </button>\n <template #content>\n <div class=\"w-64 p-3\">\n <CompositeTagsEditor :editor=\"editor\" :row=\"item.row\" />\n </div>\n </template>\n </UPopover>\n </div>\n </template>\n </div>\n </Teleport>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgGA,MAAM,aAAa;AAkDnB,MAAM,OAAO;;;;;EApHb,MAAM,QAAQ;EAEd,MAAM,EAAE,MAAM,OAAO,SAAS,aAAa,SAAS;EACpD,MAAM,EAAE,MAAM,cA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AAA,GAAAI,mBAWOC,UAAA,MAAAC,WAXa,KAAK,IAAI,cAAc,KAAK,IAAI,OAAI,CAAA,IAA3C,QAAG;MAAhB,OAAAN,UAAA,GAAAI,mBAWO,QAAA;OAXyD,KAAK;OAAM,OAAKM,eAAA,CAAG,MAAI,sBAAA,CAAA;MACrF,GAAA,CAAAP,mBAAwC,QAAxC,YAAuB,MAACc,gBAAG,GAAG,GAAA,CAAA,GAEtB,KAAK,YADbjB,UAAA,GAAAI,mBAQS,UAAA;;OANP,MAAK;OACL,OAAM;OACL,cAAYL,MAAA,CAAA,CAAC,CAAA,yBAAA,EAA4B,IAAG,CAAA;OAC5C,UAAK,WAAE,UAAU,KAAK,KAAK,GAAG;MAE/B,GAAA,CAAAS,YAA0CT,MAAA,KAAA,GAAA;OAAnC,MAAK;OAAa,OAAM;;;KAK3B,KAAK,YAAY,KAAK,IAAI,eADlCC,UAAA,GAAAC,YAYWF,MAAA,QAAA,GAAA;;MAVR,SAAO;OAAA,MAAA;OAAA,OAAA;OAAA,YAAA;OAAA,mBAAsE,UAAiB,MAAM,eAAc;MAAA;;MAKxG,SAAOQ,cAGV,CAFNJ,mBAEM,OAFN,aAEM,CADJK,YAAwDW,aAAA;OAAlC,QAAQ,QAAA;OAAS,KAAK,KAAK;;MALrD,SAAAZ,cAES,CAFTJ,mBAES,UAAA;OAFD,MAAK;OAAU,OAAKO,eAAE,UAAU;OAAG,cAAYX,MAAA,CAAA,CAAC,CAAA,oBAAA;OAAyB,OAAOA,MAAA,CAAA,CAAC,CAAA,oBAAA;MACvF,GAAA,CAAAS,YAA+CT,MAAA,KAAA,GAAA;OAAxC,MAAK;OAAgB,OAAM"}
|
|
1
|
+
{"version":3,"file":"CompositeChrome.js","names":["_unref","_openBlock","_createBlock","_Teleport","_createElementVNode","_createElementBlock","_Fragment","_renderList","_withCtx","_createVNode","CompositeDetails","_normalizeClass","_normalizeStyle","_withKeys","_withModifiers","_createCommentVNode","CompositeBasketMenu","_createTextVNode","_toDisplayString","CompositeStatusMenu","CompositeTagsEditor"],"sources":["../../../../src/features/composites/components/CompositeChrome.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { Editor } from '@tiptap/vue-3'\nimport { computed, shallowRef, watch } from 'vue'\nimport { startBlockDrag } from '../../../core'\nimport { useUiKit } from '../../../vue/kit/use-ui-kit'\nimport { useEditorI18n } from '../../../vue/use-editor-i18n'\nimport { useStoreRef } from '../../../vue/store-ref'\nimport { useEditorSettings } from '../../../vue/settings'\nimport { compositeSectionOf } from '../anchors'\nimport { derivedChromeOf } from '../derived-chrome'\nimport { rowStatus } from '../meta-display'\nimport { basketById, basketOf, titleHiddenOf } from '../baskets'\nimport { compositeBasketsOf } from '../nodes'\nimport { compositeOfRow, type CompositeRow, setCompositeTags } from '../rows'\nimport { useCompositeAnchors } from '../use-composite-anchors'\nimport { useCompositeRows } from '../use-composite-rows'\nimport CompositeBasketMenu from './CompositeBasketMenu.vue'\nimport CompositeDetails from './CompositeDetails.vue'\nimport CompositeStatusMenu from './CompositeStatusMenu.vue'\nimport CompositeTagsEditor from './CompositeTagsEditor.vue'\n\n/**\n * Chrome of every composite, laid over the editor (mounted by the composites feature): on the title line the status\n * chip and one chip per tag (with a `+` chip to add tags), and on the front the kind icon. The icon is a button that\n * opens the details popover (kind with a confirmation before it changes, the kind's fields and the summary;\n * `CompositeDetails`) and, in an editable editor, the composite's drag handle: dragging it moves the composite\n * (`startBlockDrag`). A kind with `chrome.tags: false` shows no tag chips and no `+` chip. With `blocks.blockTypeIcon: 'hover'` it shows only while the composite is hovered, its popover is\n * open or the icon has keyboard focus. Chips and popover also render in read-only editors, without edit affordances.\n * The node view's own description and tags rows are hidden by CSS; this overlay shows and edits them.\n */\nconst props = defineProps<{ editor: Editor }>()\n\nconst { Icon: UIcon, Popover: UPopover } = useUiKit()\nconst { t } = useEditorI18n()\n\nconst { rows } = useCompositeRows(() => props.editor)\nconst { host, anchors, frame } = useCompositeAnchors(() => props.editor, rows)\n\n// `isEditable` is not reactive: follow it on every transaction (`EditorSurface` dispatches one after `setEditable`).\nconst editable = shallowRef(false)\nwatch(() => props.editor, (instance, _previous, onCleanup) => {\n editable.value = !instance.isDestroyed && instance.isEditable\n const sync = () => {\n editable.value = !instance.isDestroyed && instance.isEditable\n }\n instance.on('transaction', sync)\n onCleanup(() => instance.off('transaction', sync))\n}, { immediate: true })\n\nconst { settings } = useEditorSettings()\nconst iconOnHover = computed(() => settings.value.blocks.blockTypeIcon === 'hover')\n\n// Hover state of `blockTypeIcon: 'hover'`: the keys of the rows whose composite is under the pointer (that one and every\n// composite around it), plus the row whose chips the pointer is on (they sit outside the editor's DOM).\nconst hoveredKeys = shallowRef<ReadonlySet<string>>(new Set())\nconst chipsHoveredKey = shallowRef<string | null>(null)\nlet hoveredSection: Element | null = null\n\nfunction onEditorMouseover(event: MouseEvent) {\n const section = event.target instanceof Element ? event.target.closest('.composite') : null\n if (section === hoveredSection) return\n hoveredSection = section\n const chain = new Set<Element>()\n for (let el = section; el; el = el.parentElement?.closest('.composite') ?? null) chain.add(el)\n const { view, state } = props.editor\n hoveredKeys.value = new Set(rows.value.filter((row) => {\n const found = compositeOfRow(state.doc, row)\n const dom = found ? view.nodeDOM(found.pos) : null\n const section = dom instanceof Element ? compositeSectionOf(dom) : null\n return section !== null && chain.has(section)\n }).map(row => row.key))\n}\n\nfunction onEditorMouseleave() {\n hoveredSection = null\n hoveredKeys.value = new Set()\n}\n\nwatch([() => props.editor, iconOnHover], ([instance, hover], _previous, onCleanup) => {\n onEditorMouseleave()\n if (!hover || instance.isDestroyed) return\n const { dom } = instance.view\n dom.addEventListener('mouseover', onEditorMouseover)\n dom.addEventListener('mouseleave', onEditorMouseleave)\n onCleanup(() => {\n dom.removeEventListener('mouseover', onEditorMouseover)\n dom.removeEventListener('mouseleave', onEditorMouseleave)\n })\n}, { immediate: true })\n\nfunction onIconDragStart(event: DragEvent, row: CompositeRow) {\n const found = compositeOfRow(props.editor.state.doc, row)\n if (!found || !startBlockDrag(props.editor, event, found.pos)) event.preventDefault()\n}\n\n/** Chips start right after the title's last character and run on to the editor's right edge. */\nconst ROW_HEIGHT = 24\n\nconst expanded = useStoreRef(() => props.editor.storage.typedBlock.expanded)\nconst revealedTitles = useStoreRef(() => props.editor.storage.typedBlock.revealedTitles)\n\nconst placed = computed(() => {\n const baskets = compositeBasketsOf(props.editor)\n // End of the collapsed derived Typed block the rows being walked sit in: its clipped content shows no chrome.\n let hiddenUntil = -1\n return rows.value.flatMap((row) => {\n if (row.pos < hiddenUntil) return []\n const derived = derivedChromeOf(props.editor, row)\n const open = !derived || !row.id || expanded.value.has(row.id)\n if (!open) hiddenUntil = row.end\n const anchor = anchors.value.get(row.key)\n if (!anchor) return []\n const titleHidden = titleHiddenOf(row)\n // A hidden title leaves nothing to measure: the chips sit in the strip beside the kind icon (`composites.css`).\n const inStrip = titleHidden && !(row.id && revealedTitles.value.has(row.id)) && anchor.toggleSize > 0\n // An empty title shows a placeholder the anchor cannot measure: keep clear of it.\n const left = inStrip ? anchor.toggleLeft + anchor.toggleSize + 6 : anchor.lineEnd + (anchor.titleEmpty ? 116 : 12)\n return [{\n row,\n anchor,\n // A kind without `chrome.controls` renders as in a read-only editor.\n editable: editable.value && row.controls,\n left,\n top: (inStrip ? anchor.toggleTop + anchor.toggleSize / 2 : anchor.lastCenter) - ROW_HEIGHT / 2,\n width: Math.max((frame.value?.right ?? anchor.right) - left, 120),\n status: rowStatus(row, t),\n derived: derived && { stale: derived.stale, sourceMissing: derived.sourceMissing, open, toggleable: !!row.id },\n // The basket menu and chip belong to the `basket` capability: a Block type without it has neither.\n hasBasket: row.capabilities.has('basket'),\n basket: row.capabilities.has('basket') ? basketById(baskets, basketOf(row)) ?? null : null,\n titleHidden,\n }]\n })\n})\n\nfunction toggleExpanded(row: CompositeRow) {\n if (row.id) props.editor.commands.toggleCompositeExpanded(row.id)\n}\n\nfunction removeTag(row: CompositeRow, tag: string) {\n setCompositeTags(props.editor, row, row.tags.filter(candidate => candidate !== tag))\n}\n\nfunction toggleTitleHidden(row: CompositeRow) {\n const found = compositeOfRow(props.editor.state.doc, row)\n if (found) props.editor.commands.setCompositeTitleHidden(!titleHiddenOf(row), found.pos)\n}\n\nconst chip = 'inline-flex h-5 shrink-0 items-center gap-1 rounded-sm px-1.5 text-xs leading-none whitespace-nowrap text-[var(--sk-muted)]'\nconst chipButton = `${chip} transition-colors duration-150 hover:bg-[var(--sk-bg-elevated)] hover:text-[var(--sk-fg-highlighted)] focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-[var(--sk-primary)]`\n\n/** Scale and fade in from the icon (`transform-origin` is Reka's), a bit longer than Nuxt UI's default; `composites.css` defines the keyframes and the reduced-motion override. */\nconst detailsPopoverUi = {\n content: 'composite-popover data-[state=open]:animate-[composite-pop-in_160ms_var(--ease-out)] data-[state=closed]:animate-[composite-pop-out_120ms_var(--ease-out)]',\n}\n</script>\n\n<template>\n <Teleport v-if=\"host\" :to=\"host\">\n <div class=\"absolute left-0 top-0 h-0 w-0\">\n <template v-for=\"item in placed\" :key=\"item.row.key\">\n <UPopover\n v-if=\"item.anchor.toggleSize\"\n :content=\"{ side: 'bottom', align: 'start', sideOffset: 4 }\"\n :ui=\"detailsPopoverUi\"\n >\n <!-- A span, not a `button`: Firefox does not start drags from buttons. -->\n <span\n role=\"button\"\n tabindex=\"0\"\n :draggable=\"item.editable\"\n :class=\"[\n 'absolute z-10 flex items-center justify-center rounded-sm bg-[var(--sk-bg)] text-[var(--sk-muted)] transition-[color,background-color,opacity] duration-120 motion-reduce:transition-none hover:bg-[var(--sk-bg-elevated)] hover:text-[var(--sk-fg-highlighted)] focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-[var(--sk-primary)]',\n item.editable ? 'cursor-grab active:cursor-grabbing' : 'cursor-pointer',\n iconOnHover && !hoveredKeys.has(item.row.key) && chipsHoveredKey !== item.row.key && 'opacity-0 hover:opacity-100 focus-visible:opacity-100 data-[state=open]:opacity-100',\n ]\"\n :style=\"{ top: `${item.anchor.toggleTop}px`, left: `${item.anchor.toggleLeft}px`, width: `${item.anchor.toggleSize}px`, height: `${item.anchor.toggleSize}px` }\"\n :aria-label=\"t('composites.chrome.details', { kind: item.row.kindLabel })\"\n :title=\"item.editable ? t('composites.chrome.detailsDrag', { kind: item.row.kindLabel }) : t('composites.chrome.details', { kind: item.row.kindLabel })\"\n @keydown.enter.space.prevent=\"($event.currentTarget as HTMLElement).click()\"\n @dragstart=\"onIconDragStart($event, item.row)\"\n >\n <UIcon :key=\"item.row.icon\" :name=\"item.row.icon\" class=\"size-3.5\" />\n </span>\n <template #content>\n <CompositeDetails :editor=\"editor\" :row=\"item.row\" :editable=\"item.editable\" />\n </template>\n </UPopover>\n\n <div\n v-if=\"item.editable || item.basket || item.status || item.derived || (item.row.tagsVisible && item.row.tags.length)\"\n class=\"absolute z-10 flex items-center gap-px overflow-hidden rounded-md bg-[var(--sk-bg)]\"\n :style=\"{ top: `${item.top}px`, left: `${item.left}px`, maxWidth: `${item.width}px`, height: `${ROW_HEIGHT}px` }\"\n @mouseenter=\"chipsHoveredKey = item.row.key\"\n @mouseleave=\"chipsHoveredKey = null\"\n >\n <template v-if=\"item.editable\">\n <CompositeBasketMenu v-if=\"item.hasBasket\" :editor=\"editor\" :row=\"item.row\">\n <button type=\"button\" :class=\"chipButton\" :aria-label=\"t('composites.basket.label')\" :title=\"item.basket ? `${t('composites.basket.label')}: ${item.basket.label}` : t('composites.basket.label')\">\n <span v-if=\"item.basket\" class=\"size-2.5 rounded-full\" :style=\"{ backgroundColor: item.basket.color }\" />\n <UIcon v-else name=\"i-lucide-circle-dashed\" class=\"size-3.5\" />\n </button>\n </CompositeBasketMenu>\n <button\n type=\"button\"\n :class=\"chipButton\"\n :aria-label=\"t(item.titleHidden ? 'composites.titleHidden.show' : 'composites.titleHidden.hide')\"\n :title=\"t(item.titleHidden ? 'composites.titleHidden.show' : 'composites.titleHidden.hide')\"\n @click=\"toggleTitleHidden(item.row)\"\n >\n <UIcon :name=\"item.titleHidden ? 'i-lucide-eye' : 'i-lucide-eye-off'\" class=\"size-3.5\" />\n </button>\n </template>\n <span v-else-if=\"item.basket\" :class=\"chip\" :title=\"item.basket.label\">\n <span class=\"size-2.5 rounded-full\" :style=\"{ backgroundColor: item.basket.color }\" />\n </span>\n\n <template v-if=\"item.derived\">\n <button\n v-if=\"item.derived.toggleable\"\n type=\"button\"\n :class=\"chipButton\"\n :aria-expanded=\"item.derived.open\"\n :aria-label=\"t(item.derived.open ? 'composites.derivation.collapse' : 'composites.derivation.expand')\"\n :title=\"t(item.derived.open ? 'composites.derivation.collapse' : 'composites.derivation.expand')\"\n @click=\"toggleExpanded(item.row)\"\n >\n <UIcon :name=\"item.derived.open ? 'i-lucide-chevron-down' : 'i-lucide-chevron-right'\" class=\"size-3.5\" />\n </button>\n <span :class=\"chip\">\n <UIcon name=\"i-lucide-git-branch\" class=\"size-3.5\" />{{ t('composites.derivation.badge') }}\n </span>\n <span v-if=\"item.derived.stale\" :class=\"[chip, 'text-[var(--sk-warning)]']\">\n <UIcon name=\"i-lucide-triangle-alert\" class=\"size-3.5\" />{{ t('composites.derivation.stale') }}\n </span>\n <span v-if=\"item.derived.sourceMissing\" :class=\"[chip, 'text-[var(--sk-warning)]']\">\n <UIcon name=\"i-lucide-unlink\" class=\"size-3.5\" />{{ t('composites.derivation.sourceMissing') }}\n </span>\n </template>\n\n <template v-if=\"item.status\">\n <CompositeStatusMenu v-if=\"item.editable\" :editor=\"editor\" :row=\"item.row\">\n <button type=\"button\" :class=\"chipButton\" :aria-label=\"t('composites.status.label', { status: item.status.label })\">\n <UIcon :name=\"item.status.icon\" :class=\"['size-3.5', item.status.color]\" />{{ item.status.label }}\n </button>\n </CompositeStatusMenu>\n <span v-else :class=\"chip\">\n <UIcon :name=\"item.status.icon\" :class=\"['size-3.5', item.status.color]\" />{{ item.status.label }}\n </span>\n </template>\n\n <span v-for=\"tag in item.row.tagsVisible ? item.row.tags : []\" :key=\"tag\" :class=\"[chip, 'group max-w-40 gap-0']\">\n <span class=\"truncate\">#{{ tag }}</span>\n <button\n v-if=\"item.editable\"\n type=\"button\"\n class=\"flex h-4 w-0 shrink-0 items-center justify-center overflow-hidden rounded-sm opacity-0 transition-all duration-150 group-hover:ml-1 group-hover:w-4 group-hover:opacity-100 hover:bg-[var(--sk-bg-elevated)] hover:text-[var(--sk-fg-highlighted)] focus-visible:ml-1 focus-visible:w-4 focus-visible:opacity-100 focus-visible:outline-2 focus-visible:outline-[var(--sk-primary)]\"\n :aria-label=\"t('composites.tag.remove', { tag })\"\n @click=\"removeTag(item.row, tag)\"\n >\n <UIcon name=\"i-lucide-x\" class=\"size-3\" />\n </button>\n </span>\n\n <UPopover\n v-if=\"item.editable && item.row.tagsVisible\"\n :content=\"{ side: 'bottom', align: 'start', sideOffset: 6, onCloseAutoFocus: (event: Event) => event.preventDefault() }\"\n >\n <button type=\"button\" :class=\"chipButton\" :aria-label=\"t('composites.tag.add')\" :title=\"t('composites.tag.add')\">\n <UIcon name=\"i-lucide-plus\" class=\"size-3.5\" />\n </button>\n <template #content>\n <div class=\"w-64 p-3\">\n <CompositeTagsEditor :editor=\"editor\" :row=\"item.row\" />\n </div>\n </template>\n </UPopover>\n </div>\n </template>\n </div>\n </Teleport>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgGA,MAAM,aAAa;AAoDnB,MAAM,OAAO;;;;;EAtHb,MAAM,QAAQ;EAEd,MAAM,EAAE,MAAM,OAAO,SAAS,aAAa,SAAS;EACpD,MAAM,EAAE,MAAM,cAAc;EAE5B,MAAM,EAAE,SAAS,uBAAuB,MAAM,MAAM;EACpD,MAAM,EAAE,MAAM,SAAS,UAAU,0BAA0B,MAAM,QAAQ,IAAI;EAG7E,MAAM,WAAW,WAAW,KAAK;EACjC,YAAY,MAAM,SAAS,UAAU,WAAW,cAAc;GAC5D,SAAS,QAAQ,CAAC,SAAS,eA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AA,KAAA,GAAA;OAAxC,MAAK;OAAgB,OAAM"}
|
|
@@ -5,7 +5,7 @@ import { Editor } from "@tiptap/vue-3";
|
|
|
5
5
|
* chip and one chip per tag (with a `+` chip to add tags), and on the front the kind icon. The icon is a button that
|
|
6
6
|
* opens the details popover (kind with a confirmation before it changes, the kind's fields and the summary;
|
|
7
7
|
* `CompositeDetails`) and, in an editable editor, the composite's drag handle: dragging it moves the composite
|
|
8
|
-
* (`startBlockDrag`). A kind with `chrome.tags: false` shows no tag chips and no `+` chip. With `blocks.
|
|
8
|
+
* (`startBlockDrag`). A kind with `chrome.tags: false` shows no tag chips and no `+` chip. With `blocks.blockTypeIcon: 'hover'` it shows only while the composite is hovered, its popover is
|
|
9
9
|
* open or the icon has keyboard focus. Chips and popover also render in read-only editors, without edit affordances.
|
|
10
10
|
* The node view's own description and tags rows are hidden by CSS; this overlay shows and edits them.
|
|
11
11
|
*/
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { derivationOf } from "../../../core/derivation.js";
|
|
1
2
|
import { keepsMetaKey } from "../meta-keys.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
3
|
+
import { blockTypesOf } from "../nodes.js";
|
|
4
|
+
import { propertyHostOf } from "../properties.js";
|
|
4
5
|
import { useUiKit } from "../../../vue/kit/use-ui-kit.js";
|
|
5
6
|
import { useEditorI18n } from "../../../vue/use-editor-i18n.js";
|
|
6
7
|
import { compositeBacklinks, compositeOfRow } from "../rows.js";
|
|
@@ -47,7 +48,7 @@ const _hoisted_19 = {
|
|
|
47
48
|
/**
|
|
48
49
|
* Content of the popover on a composite's front icon: the kind (a select, plain text while read-only), every field of
|
|
49
50
|
* the kind except the status (its chip edits it) and the summary. Choosing another kind first shows an inline warning
|
|
50
|
-
* that names the field values the switch drops (`
|
|
51
|
+
* that names the field values the switch drops (`changeBlockType` keeps the meta keys the new kind declares, plus
|
|
51
52
|
* `derivation` and `bib`, see `keepsMetaKey`) and
|
|
52
53
|
* applies the change on „Ändern“.
|
|
53
54
|
*/
|
|
@@ -62,19 +63,19 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
62
63
|
const props = __props;
|
|
63
64
|
const { Button: UButton, Icon: UIcon, Select: USelect } = useUiKit();
|
|
64
65
|
const { t } = useEditorI18n();
|
|
65
|
-
const kinds = computed(() =>
|
|
66
|
+
const kinds = computed(() => blockTypesOf(props.editor));
|
|
66
67
|
const kindItems = computed(() => kinds.value.map((kind) => ({
|
|
67
68
|
value: kind.id,
|
|
68
69
|
label: kind.label,
|
|
69
70
|
icon: kind.icon
|
|
70
71
|
})));
|
|
71
|
-
const fields = computed(() => props.row.
|
|
72
|
-
/** The row's
|
|
72
|
+
const fields = computed(() => props.row.definitions.filter((field) => field.key !== "status" && field.type !== "derivation"));
|
|
73
|
+
/** The row's Typed block when it is derived (has a `meta.derivation`). */
|
|
73
74
|
const derivedNode = computed(() => {
|
|
74
|
-
const found =
|
|
75
|
+
const found = propertyHostOf(props.editor.state.doc, props.row);
|
|
75
76
|
return found && derivationOf(found.node) ? found.node : null;
|
|
76
77
|
});
|
|
77
|
-
/** The places that refer to the row's
|
|
78
|
+
/** The places that refer to the row's Typed block (chips in other blocks, `reference` fields), for the „Verweise“ list. */
|
|
78
79
|
const backlinks = computed(() => props.row.id ? compositeBacklinks(props.editor.state.doc, kinds.value, props.row.id) : []);
|
|
79
80
|
/** The kind chosen in the select, waiting for the confirmation. */
|
|
80
81
|
const pending = ref(null);
|
|
@@ -87,7 +88,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
87
88
|
const target = kinds.value.find((kind) => kind.id === pending.value);
|
|
88
89
|
if (!target) return [];
|
|
89
90
|
return Object.entries(props.row.meta).filter(([key, value]) => !keepsMetaKey(target, key) && value != null && value !== "").map(([key, value]) => {
|
|
90
|
-
const field = props.row.
|
|
91
|
+
const field = props.row.definitions.find((candidate) => candidate.key === key);
|
|
91
92
|
const text = typeof value === "object" ? JSON.stringify(value) : String(value);
|
|
92
93
|
return {
|
|
93
94
|
key,
|
|
@@ -103,7 +104,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
103
104
|
const kind = pending.value;
|
|
104
105
|
pending.value = null;
|
|
105
106
|
const found = compositeOfRow(props.editor.state.doc, props.row);
|
|
106
|
-
if (kind && found) props.editor.commands.
|
|
107
|
+
if (kind && found) props.editor.commands.changeBlockType(kind, found.pos);
|
|
107
108
|
}
|
|
108
109
|
return (_ctx, _cache) => {
|
|
109
110
|
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CompositeDetails.js","names":["_openBlock","_createElementBlock","_createBlock","_unref","_createElementVNode","_toDisplayString","_Fragment","_renderList","_createVNode","_createCommentVNode","DerivationBadge","CompositeFieldEditor","CompositeSummaryEditor"],"sources":["../../../../src/features/composites/components/CompositeDetails.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { Editor } from '@tiptap/vue-3'\nimport { computed, ref, watch } from 'vue'\nimport { useUiKit } from '../../../vue/kit/use-ui-kit'\nimport { useEditorI18n } from '../../../vue/use-editor-i18n'\nimport { derivationOf } from '../derivation'\nimport { keepsMetaKey } from '../meta-keys'\nimport { compositeKindsOf } from '../nodes'\nimport { compositeBacklinks, compositeOfRow, type CompositeRow } from '../rows'\nimport CompositeFieldEditor from './CompositeFieldEditor.vue'\nimport DerivationBadge from './DerivationBadge.vue'\nimport CompositeSummaryEditor from './CompositeSummaryEditor.vue'\n\n/**\n * Content of the popover on a composite's front icon: the kind (a select, plain text while read-only), every field of\n * the kind except the status (its chip edits it) and the summary. Choosing another kind first shows an inline warning\n * that names the field values the switch drops (`setCompositeKind` keeps the meta keys the new kind declares, plus\n * `derivation` and `bib`, see `keepsMetaKey`) and\n * applies the change on „Ändern“.\n */\nconst props = defineProps<{ editor: Editor, row: CompositeRow, editable: boolean }>()\n\nconst { Button: UButton, Icon: UIcon, Select: USelect } = useUiKit()\nconst { t } = useEditorI18n()\n\nconst kinds = computed(() => compositeKindsOf(props.editor))\nconst kindItems = computed(() => kinds.value.map(kind => ({ value: kind.id, label: kind.label, icon: kind.icon })))\n// The `derivation` field is shown by the details badge below, with the checks a field display cannot do.\nconst fields = computed(() => props.row.fields.filter(field => field.key !== 'status' && field.type !== 'derivation'))\n\n/** The row's Baustein when it is derived (has a `meta.derivation`). */\nconst derivedNode = computed(() => {\n const found = compositeOfRow(props.editor.state.doc, props.row)\n return found && derivationOf(found.node) ? found.node : null\n})\n\n/** The places that refer to the row's Baustein (chips in other blocks, `reference` fields), for the „Verweise“ list. */\nconst backlinks = computed(() => props.row.id ? compositeBacklinks(props.editor.state.doc, kinds.value, props.row.id) : [])\n\n/** The kind chosen in the select, waiting for the confirmation. */\nconst pending = ref<string | null>(null)\n// The kind changed some other way (undo, inspector, another select): a stale confirmation would be misleading.\nwatch(() => props.row.kind, () => {\n pending.value = null\n})\n\nconst pendingLabel = computed(() => kinds.value.find(kind => kind.id === pending.value)?.label ?? '')\n\n/** Field values of the row that the pending kind does not keep (`keepsMetaKey`), as „Label: value“. */\nconst lost = computed(() => {\n const target = kinds.value.find(kind => kind.id === pending.value)\n if (!target) return []\n return Object.entries(props.row.meta)\n .filter(([key, value]) => !keepsMetaKey(target, key) && value != null && value !== '')\n .map(([key, value]) => {\n const field = props.row.fields.find(candidate => candidate.key === key)\n const text = typeof value === 'object' ? JSON.stringify(value) : String(value)\n return { key, label: field?.label ?? key, text: field?.options?.find(option => option.value === text)?.label ?? text }\n })\n})\n\nfunction onKind(kind: unknown) {\n pending.value = typeof kind === 'string' && kind !== props.row.kind ? kind : null\n}\n\nfunction apply() {\n const kind = pending.value\n pending.value = null\n const found = compositeOfRow(props.editor.state.doc, props.row)\n if (kind && found) props.editor.commands.setCompositeKind(kind, found.pos)\n}\n</script>\n\n<template>\n <div class=\"flex w-72 flex-col gap-2.5 p-3 text-sm\">\n <USelect\n v-if=\"editable\"\n :model-value=\"row.kind\"\n :items=\"kindItems\"\n size=\"xs\"\n class=\"w-full\"\n :aria-label=\"t('composites.kind.select')\"\n @update:model-value=\"onKind\"\n />\n <p v-else class=\"flex min-w-0 items-center gap-1.5 text-[var(--sk-fg-highlighted)]\">\n <UIcon :key=\"row.icon\" :name=\"row.icon\" class=\"size-4 shrink-0 text-[var(--sk-muted)]\" />\n <span class=\"truncate\">{{ row.kindLabel }}</span>\n </p>\n\n <div v-if=\"pending\" role=\"alert\" class=\"flex flex-col gap-2 rounded-md bg-[color-mix(in_oklab,var(--sk-warning)_10%,transparent)] p-2 text-xs text-[var(--sk-fg)] ring ring-[color-mix(in_oklab,var(--sk-warning)_40%,transparent)]\">\n <template v-if=\"lost.length\">\n <p class=\"font-medium\">\n {{ t('composites.details.confirmLost', { kind: pendingLabel }) }}\n </p>\n <ul class=\"flex flex-col gap-0.5\">\n <li v-for=\"item in lost\" :key=\"item.key\" class=\"flex min-w-0 gap-1\">\n <span class=\"shrink-0 text-[var(--sk-muted)]\">{{ item.label }}:</span>\n <span class=\"truncate\" :title=\"item.text\">{{ item.text }}</span>\n </li>\n </ul>\n </template>\n <p v-else class=\"font-medium\">\n {{ t('composites.details.confirm') }}\n </p>\n <div class=\"flex justify-end gap-1.5\">\n <UButton size=\"xs\" color=\"neutral\" variant=\"ghost\" :label=\"t('composites.details.cancel')\" @click=\"pending = null\" />\n <UButton size=\"xs\" color=\"warning\" :label=\"t('composites.details.change')\" @click=\"apply\" />\n </div>\n </div>\n\n <DerivationBadge v-if=\"derivedNode\" :editor=\"editor\" :node=\"derivedNode\" detailed />\n\n <div v-for=\"field in fields\" :key=\"field.key\" class=\"flex flex-col gap-1\">\n <span class=\"text-xs text-[var(--sk-muted)]\">{{ field.label }}</span>\n <CompositeFieldEditor :editor=\"editor\" :row=\"row\" :field=\"field\" :disabled=\"!editable\" size=\"xs\" />\n </div>\n\n <div class=\"flex flex-col gap-1\">\n <span class=\"text-xs text-[var(--sk-muted)]\">{{ t('composites.details.summary') }}</span>\n <CompositeSummaryEditor :editor=\"editor\" :row=\"row\" :readonly=\"!editable\" />\n </div>\n\n <div v-if=\"backlinks.length\" class=\"flex flex-col gap-1\">\n <span class=\"text-xs text-[var(--sk-muted)]\">{{ t('composites.reference.backlinks') }}</span>\n <ul class=\"flex flex-col gap-0.5\">\n <li v-for=\"(link, index) in backlinks\" :key=\"`${link.from}:${index}`\">\n <button\n type=\"button\"\n class=\"flex w-full min-w-0 items-baseline gap-1 rounded-sm text-left text-xs text-[var(--sk-fg)] hover:text-[var(--sk-primary)] focus-visible:outline-2 focus-visible:outline-[var(--sk-primary)]\"\n @click=\"editor.commands.revealBlock(link.from)\"\n >\n <span class=\"truncate\">{{ link.excerpt || '…' }}</span>\n <span v-if=\"link.locator\" class=\"shrink-0 text-[var(--sk-muted)]\">{{ link.locator }}</span>\n </button>\n </li>\n </ul>\n </div>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAoBA,MAAM,QAAQ;EAEd,MAAM,EAAE,QAAQ,SAAS,MAAM,OAAO,QAAQ,YAAY,SAAS;EACnE,MAAM,EAAE,MAAM,cAAc;EAE5B,MAAM,QAAQ,eAAe,iBAAiB,MAAM,MAAM,CAAC;EAC3D,MAAM,YAAY,eAAe,MAAM,MAAM,KAAI,UAAS;GAAE,OAAO,KAAK;GAAI,OAAO,KAAK;GAAO,MAAM,KAAK;EAAK,EAAE,CAAC;EAElH,MAAM,SAAS,eAAe,MAAM,IAAI,OAAO,QAAO,UAAS,MAAM,QAAQ,YAAY,MAAM,SAAS,YAAY,CAAC;;EAGrH,MAAM,cAAc,eAAe;GACjC,MAAM,QAAQ,eAAe,MAAM,OAAO,MAAM,KAAK,MAAM,GAAG;GAC9D,OAAO,SAAS,aAAa,MAAM,IAAI,IAAI,MAAM,OAAO;EAC1D,CAAC;;EAGD,MAAM,YAAY,eAAe,MAAM,IAAI,KAAK,mBAAmB,MAAM,OAAO,MAAM,KAAK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AvB,OAAAP,UAAA,GAAAC,mBASK,MAAA,EATmC,KAAG,GAAK,KAAK,KAAI,GAAI,QAAA,GAAA,CAC3DG,mBAOS,UAAA;MANP,MAAK;MACL,OAAM;MACL,UAAK,WAAE,QAAA,OAAO,SAAS,YAAY,KAAK,IAAI;KAE7C,GAAA,CAAAA,mBAAuD,QAAvD,aAAuDC,gBAA7B,KAAK,WAAO,GAAA,GAAA,CAAA,GAC1B,KAAK,WAAjBL,UAAA,GAAAC,mBAA2F,QAA3F,aAA2FI,gBAAtB,KAAK,OAAO,GAAA,CAAA,KAAAI,mBAAA,QAAA,IAAA,CAAA,GAAA,GAAA,WAAA,CAAA,CAAA"}
|
|
1
|
+
{"version":3,"file":"CompositeDetails.js","names":["_openBlock","_createElementBlock","_createBlock","_unref","_createElementVNode","_toDisplayString","_Fragment","_renderList","_createVNode","_createCommentVNode","DerivationBadge","CompositeFieldEditor","CompositeSummaryEditor"],"sources":["../../../../src/features/composites/components/CompositeDetails.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { Editor } from '@tiptap/vue-3'\nimport { computed, ref, watch } from 'vue'\nimport { useUiKit } from '../../../vue/kit/use-ui-kit'\nimport { useEditorI18n } from '../../../vue/use-editor-i18n'\nimport { derivationOf } from '../../../core/derivation'\nimport { keepsMetaKey } from '../meta-keys'\nimport { blockTypesOf } from '../nodes'\nimport { propertyHostOf } from '../properties'\nimport { compositeBacklinks, compositeOfRow, type CompositeRow } from '../rows'\nimport CompositeFieldEditor from './CompositeFieldEditor.vue'\nimport DerivationBadge from './DerivationBadge.vue'\nimport CompositeSummaryEditor from './CompositeSummaryEditor.vue'\n\n/**\n * Content of the popover on a composite's front icon: the kind (a select, plain text while read-only), every field of\n * the kind except the status (its chip edits it) and the summary. Choosing another kind first shows an inline warning\n * that names the field values the switch drops (`changeBlockType` keeps the meta keys the new kind declares, plus\n * `derivation` and `bib`, see `keepsMetaKey`) and\n * applies the change on „Ändern“.\n */\nconst props = defineProps<{ editor: Editor, row: CompositeRow, editable: boolean }>()\n\nconst { Button: UButton, Icon: UIcon, Select: USelect } = useUiKit()\nconst { t } = useEditorI18n()\n\nconst kinds = computed(() => blockTypesOf(props.editor))\nconst kindItems = computed(() => kinds.value.map(kind => ({ value: kind.id, label: kind.label, icon: kind.icon })))\n// The `derivation` field is shown by the details badge below, with the checks a field display cannot do.\nconst fields = computed(() => props.row.definitions.filter(field => field.key !== 'status' && field.type !== 'derivation'))\n\n/** The row's Typed block when it is derived (has a `meta.derivation`). */\nconst derivedNode = computed(() => {\n const found = propertyHostOf(props.editor.state.doc, props.row)\n return found && derivationOf(found.node) ? found.node : null\n})\n\n/** The places that refer to the row's Typed block (chips in other blocks, `reference` fields), for the „Verweise“ list. */\nconst backlinks = computed(() => props.row.id ? compositeBacklinks(props.editor.state.doc, kinds.value, props.row.id) : [])\n\n/** The kind chosen in the select, waiting for the confirmation. */\nconst pending = ref<string | null>(null)\n// The kind changed some other way (undo, inspector, another select): a stale confirmation would be misleading.\nwatch(() => props.row.kind, () => {\n pending.value = null\n})\n\nconst pendingLabel = computed(() => kinds.value.find(kind => kind.id === pending.value)?.label ?? '')\n\n/** Field values of the row that the pending kind does not keep (`keepsMetaKey`), as „Label: value“. */\nconst lost = computed(() => {\n const target = kinds.value.find(kind => kind.id === pending.value)\n if (!target) return []\n return Object.entries(props.row.meta)\n .filter(([key, value]) => !keepsMetaKey(target, key) && value != null && value !== '')\n .map(([key, value]) => {\n const field = props.row.definitions.find(candidate => candidate.key === key)\n const text = typeof value === 'object' ? JSON.stringify(value) : String(value)\n return { key, label: field?.label ?? key, text: field?.options?.find(option => option.value === text)?.label ?? text }\n })\n})\n\nfunction onKind(kind: unknown) {\n pending.value = typeof kind === 'string' && kind !== props.row.kind ? kind : null\n}\n\nfunction apply() {\n const kind = pending.value\n pending.value = null\n const found = compositeOfRow(props.editor.state.doc, props.row)\n if (kind && found) props.editor.commands.changeBlockType(kind, found.pos)\n}\n</script>\n\n<template>\n <div class=\"flex w-72 flex-col gap-2.5 p-3 text-sm\">\n <USelect\n v-if=\"editable\"\n :model-value=\"row.kind\"\n :items=\"kindItems\"\n size=\"xs\"\n class=\"w-full\"\n :aria-label=\"t('composites.kind.select')\"\n @update:model-value=\"onKind\"\n />\n <p v-else class=\"flex min-w-0 items-center gap-1.5 text-[var(--sk-fg-highlighted)]\">\n <UIcon :key=\"row.icon\" :name=\"row.icon\" class=\"size-4 shrink-0 text-[var(--sk-muted)]\" />\n <span class=\"truncate\">{{ row.kindLabel }}</span>\n </p>\n\n <div v-if=\"pending\" role=\"alert\" class=\"flex flex-col gap-2 rounded-md bg-[color-mix(in_oklab,var(--sk-warning)_10%,transparent)] p-2 text-xs text-[var(--sk-fg)] ring ring-[color-mix(in_oklab,var(--sk-warning)_40%,transparent)]\">\n <template v-if=\"lost.length\">\n <p class=\"font-medium\">\n {{ t('composites.details.confirmLost', { kind: pendingLabel }) }}\n </p>\n <ul class=\"flex flex-col gap-0.5\">\n <li v-for=\"item in lost\" :key=\"item.key\" class=\"flex min-w-0 gap-1\">\n <span class=\"shrink-0 text-[var(--sk-muted)]\">{{ item.label }}:</span>\n <span class=\"truncate\" :title=\"item.text\">{{ item.text }}</span>\n </li>\n </ul>\n </template>\n <p v-else class=\"font-medium\">\n {{ t('composites.details.confirm') }}\n </p>\n <div class=\"flex justify-end gap-1.5\">\n <UButton size=\"xs\" color=\"neutral\" variant=\"ghost\" :label=\"t('composites.details.cancel')\" @click=\"pending = null\" />\n <UButton size=\"xs\" color=\"warning\" :label=\"t('composites.details.change')\" @click=\"apply\" />\n </div>\n </div>\n\n <DerivationBadge v-if=\"derivedNode\" :editor=\"editor\" :node=\"derivedNode\" detailed />\n\n <div v-for=\"field in fields\" :key=\"field.key\" class=\"flex flex-col gap-1\">\n <span class=\"text-xs text-[var(--sk-muted)]\">{{ field.label }}</span>\n <CompositeFieldEditor :editor=\"editor\" :row=\"row\" :field=\"field\" :disabled=\"!editable\" size=\"xs\" />\n </div>\n\n <div class=\"flex flex-col gap-1\">\n <span class=\"text-xs text-[var(--sk-muted)]\">{{ t('composites.details.summary') }}</span>\n <CompositeSummaryEditor :editor=\"editor\" :row=\"row\" :readonly=\"!editable\" />\n </div>\n\n <div v-if=\"backlinks.length\" class=\"flex flex-col gap-1\">\n <span class=\"text-xs text-[var(--sk-muted)]\">{{ t('composites.reference.backlinks') }}</span>\n <ul class=\"flex flex-col gap-0.5\">\n <li v-for=\"(link, index) in backlinks\" :key=\"`${link.from}:${index}`\">\n <button\n type=\"button\"\n class=\"flex w-full min-w-0 items-baseline gap-1 rounded-sm text-left text-xs text-[var(--sk-fg)] hover:text-[var(--sk-primary)] focus-visible:outline-2 focus-visible:outline-[var(--sk-primary)]\"\n @click=\"editor.commands.revealBlock(link.from)\"\n >\n <span class=\"truncate\">{{ link.excerpt || '…' }}</span>\n <span v-if=\"link.locator\" class=\"shrink-0 text-[var(--sk-muted)]\">{{ link.locator }}</span>\n </button>\n </li>\n </ul>\n </div>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqBA,MAAM,QAAQ;EAEd,MAAM,EAAE,QAAQ,SAAS,MAAM,OAAO,QAAQ,YAAY,SAAS;EACnE,MAAM,EAAE,MAAM,cAAc;EAE5B,MAAM,QAAQ,eAAe,aAAa,MAAM,MAAM,CAAC;EACvD,MAAM,YAAY,eAAe,MAAM,MAAM,KAAI,UAAS;GAAE,OAAO,KAAK;GAAI,OAAO,KAAK;GAAO,MAAM,KAAK;EAAK,EAAE,CAAC;EAElH,MAAM,SAAS,eAAe,MAAM,IAAI,YAAY,QAAO,UAAS,MAAM,QAAQ,YAAY,MAAM,SAAS,YAAY,CAAC;;EAG1H,MAAM,cAAc,eAAe;GACjC,MAAM,QAAQ,eAAe,MAAM,OAAO,MAAM,KAAK,MAAM,GAAG;GAC9D,OAAO,SAAS,aAAa,MAAM,IAAI,IAAI,MAAM,OAAO;EAC1D,CA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VHJ,UAAA,IAAA,GAAAC,mBASKK,UAAA,MAAAC,WATuB,UAAA,QAAhB,MAAM,UAAK;KAAvB,OAAAP,UAAA,GAAAC,mBASK,MAAA,EATmC,KAAG,GAAK,KAAK,KAAI,GAAI,QAAA,GAAA,CAC3DG,mBAOS,UAAA;MANP,MAAK;MACL,OAAM;MACL,UAAK,WAAE,QAAA,OAAO,SAAS,YAAY,KAAK,IAAI;KAE7C,GAAA,CAAAA,mBAAuD,QAAvD,aAAuDC,gBAA7B,KAAK,WAAO,GAAA,GAAA,CAAA,GAC1B,KAAK,WAAjBL,UAAA,GAAAC,mBAA2F,QAA3F,aAA2FI,gBAAtB,KAAK,OAAO,GAAA,CAAA,KAAAI,mBAAA,QAAA,IAAA,CAAA,GAAA,GAAA,WAAA,CAAA,CAAA"}
|
|
@@ -4,7 +4,7 @@ import { Editor } from "@tiptap/vue-3";
|
|
|
4
4
|
/**
|
|
5
5
|
* Content of the popover on a composite's front icon: the kind (a select, plain text while read-only), every field of
|
|
6
6
|
* the kind except the status (its chip edits it) and the summary. Choosing another kind first shows an inline warning
|
|
7
|
-
* that names the field values the switch drops (`
|
|
7
|
+
* that names the field values the switch drops (`changeBlockType` keeps the meta keys the new kind declares, plus
|
|
8
8
|
* `derivation` and `bib`, see `keepsMetaKey`) and
|
|
9
9
|
* applies the change on „Ändern“.
|
|
10
10
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { propertyHostOf, setBlockProperty } from "../properties.js";
|
|
1
2
|
import { useUiKit } from "../../../vue/kit/use-ui-kit.js";
|
|
2
3
|
import { useEditorI18n } from "../../../vue/use-editor-i18n.js";
|
|
3
|
-
import { compositeOfRow, setCompositeMetaField } from "../rows.js";
|
|
4
4
|
import { metaText } from "../meta-display.js";
|
|
5
5
|
import _sfc_main$1 from "./BibliographyEditor.js";
|
|
6
6
|
import _sfc_main$2 from "./DerivationBadge.js";
|
|
@@ -8,7 +8,7 @@ import _sfc_main$3 from "./ReferenceFieldSelect.js";
|
|
|
8
8
|
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, defineComponent, onBeforeUnmount, openBlock, ref, unref, watch, withKeys } from "vue";
|
|
9
9
|
//#region src/features/composites/components/CompositeFieldEditor.vue
|
|
10
10
|
/**
|
|
11
|
-
* One
|
|
11
|
+
* One Block property of a block as an input that writes through `setBlockProperty`. Text-like inputs keep a local
|
|
12
12
|
* draft and commit after typing pauses, on blur and on unmount, so the one-frame-late re-read of the rows never
|
|
13
13
|
* overwrites what is being typed.
|
|
14
14
|
*/
|
|
@@ -25,8 +25,8 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
25
25
|
const props = __props;
|
|
26
26
|
const { Input: UInput, InputMenu: UInputMenu, Select: USelect, Textarea: UTextarea } = useUiKit();
|
|
27
27
|
const { t } = useEditorI18n();
|
|
28
|
-
/** The
|
|
29
|
-
const derived = computed(() => props.field.type === "derivation" ?
|
|
28
|
+
/** The block a `derivation` property belongs to; the read-only provenance display needs the node, not the property text. */
|
|
29
|
+
const derived = computed(() => props.field.type === "derivation" ? propertyHostOf(props.editor.state.doc, props.row)?.node ?? null : null);
|
|
30
30
|
const stored = computed(() => metaText(props.row, props.field));
|
|
31
31
|
/** The chosen values of a `multiselect` field (`meta[key]` is a `string[]`). */
|
|
32
32
|
const chosen = computed(() => {
|
|
@@ -44,7 +44,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
44
44
|
clearTimeout(timer);
|
|
45
45
|
if (!dirty) return;
|
|
46
46
|
dirty = false;
|
|
47
|
-
if (!props.editor.isDestroyed)
|
|
47
|
+
if (!props.editor.isDestroyed) setBlockProperty(props.editor, props.row, props.field.key, draft.value);
|
|
48
48
|
}
|
|
49
49
|
function onInput(value) {
|
|
50
50
|
draft.value = typeof value === "string" ? value : "";
|
|
@@ -58,10 +58,10 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
58
58
|
}
|
|
59
59
|
onBeforeUnmount(commit);
|
|
60
60
|
function onChoice(value) {
|
|
61
|
-
|
|
61
|
+
setBlockProperty(props.editor, props.row, props.field.key, typeof value === "string" ? value : "");
|
|
62
62
|
}
|
|
63
63
|
function onChoices(value) {
|
|
64
|
-
|
|
64
|
+
setBlockProperty(props.editor, props.row, props.field.key, Array.isArray(value) ? value : []);
|
|
65
65
|
}
|
|
66
66
|
return (_ctx, _cache) => {
|
|
67
67
|
return __props.field.type === "select" ? (openBlock(), createBlock(unref(USelect), {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CompositeFieldEditor.js","names":["_openBlock","_createBlock","_unref","ReferenceFieldSelect","BibliographyEditor","_createElementBlock","_Fragment","DerivationBadge","_createCommentVNode","_withKeys"],"sources":["../../../../src/features/composites/components/CompositeFieldEditor.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { Editor } from '@tiptap/core'\nimport { computed, onBeforeUnmount, ref, watch } from 'vue'\nimport { useUiKit } from '../../../vue/kit/use-ui-kit'\nimport { useEditorI18n } from '../../../vue/use-editor-i18n'\nimport type {
|
|
1
|
+
{"version":3,"file":"CompositeFieldEditor.js","names":["_openBlock","_createBlock","_unref","ReferenceFieldSelect","BibliographyEditor","_createElementBlock","_Fragment","DerivationBadge","_createCommentVNode","_withKeys"],"sources":["../../../../src/features/composites/components/CompositeFieldEditor.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { Editor } from '@tiptap/core'\nimport { computed, onBeforeUnmount, ref, watch } from 'vue'\nimport { useUiKit } from '../../../vue/kit/use-ui-kit'\nimport { useEditorI18n } from '../../../vue/use-editor-i18n'\nimport type { PropertyDefinition } from '../../../core/properties'\nimport { metaText } from '../meta-display'\nimport { type BlockProperties, propertyHostOf, setBlockProperty } from '../properties'\nimport BibliographyEditor from './BibliographyEditor.vue'\nimport DerivationBadge from './DerivationBadge.vue'\nimport ReferenceFieldSelect from './ReferenceFieldSelect.vue'\n\n/**\n * One Block property of a block as an input that writes through `setBlockProperty`. Text-like inputs keep a local\n * draft and commit after typing pauses, on blur and on unmount, so the one-frame-late re-read of the rows never\n * overwrites what is being typed.\n */\nconst props = withDefaults(defineProps<{\n editor: Editor\n row: BlockProperties\n field: PropertyDefinition\n disabled?: boolean\n size?: 'xs' | 'sm' | 'md'\n}>(), { size: 'sm' })\n\nconst { Input: UInput, InputMenu: UInputMenu, Select: USelect, Textarea: UTextarea } = useUiKit()\nconst { t } = useEditorI18n()\n\n/** The block a `derivation` property belongs to; the read-only provenance display needs the node, not the property text. */\nconst derived = computed(() => props.field.type === 'derivation' ? propertyHostOf(props.editor.state.doc, props.row)?.node ?? null : null)\n\nconst stored = computed(() => metaText(props.row, props.field))\n/** The chosen values of a `multiselect` field (`meta[key]` is a `string[]`). */\nconst chosen = computed(() => {\n const value = props.row.meta[props.field.key]\n return Array.isArray(value) ? value.filter((item): item is string => typeof item === 'string') : []\n})\nconst draft = ref(stored.value)\nconst typing = ref(false)\nlet dirty = false\nlet timer: ReturnType<typeof setTimeout> | undefined\n\nwatch(stored, (value) => {\n if (!typing.value && !dirty) draft.value = value\n})\n\nfunction commit() {\n clearTimeout(timer)\n if (!dirty) return\n dirty = false\n if (!props.editor.isDestroyed) setBlockProperty(props.editor, props.row, props.field.key, draft.value)\n}\n\nfunction onInput(value: unknown) {\n draft.value = typeof value === 'string' ? value : ''\n dirty = true\n clearTimeout(timer)\n timer = setTimeout(commit, 400)\n}\n\nfunction onBlur() {\n typing.value = false\n commit()\n}\n\nonBeforeUnmount(commit)\n\nfunction onChoice(value: unknown) {\n setBlockProperty(props.editor, props.row, props.field.key, typeof value === 'string' ? value : '')\n}\n\nfunction onChoices(value: unknown) {\n setBlockProperty(props.editor, props.row, props.field.key, Array.isArray(value) ? value : [])\n}\n</script>\n\n<template>\n <USelect\n v-if=\"field.type === 'select'\"\n :model-value=\"stored || undefined\"\n :items=\"field.options ?? []\"\n :placeholder=\"t('composites.field.choose', { field: field.label })\"\n :aria-label=\"field.label\"\n :disabled=\"disabled\"\n :size=\"size\"\n class=\"w-full\"\n @update:model-value=\"onChoice\"\n />\n <UInputMenu\n v-else-if=\"field.type === 'multiselect'\"\n multiple\n value-key=\"value\"\n :model-value=\"chosen\"\n :items=\"field.options ?? []\"\n :placeholder=\"t('composites.field.choose', { field: field.label })\"\n :aria-label=\"field.label\"\n :disabled=\"disabled\"\n :size=\"size\"\n class=\"w-full\"\n @update:model-value=\"onChoices\"\n />\n <ReferenceFieldSelect\n v-else-if=\"field.type === 'reference'\"\n :editor=\"editor\"\n :row=\"row\"\n :field=\"field\"\n :disabled=\"disabled\"\n :size=\"size\"\n />\n <BibliographyEditor\n v-else-if=\"field.type === 'bibliography'\"\n :editor=\"editor\"\n :row=\"row\"\n :field=\"field\"\n :disabled=\"disabled\"\n />\n <template v-else-if=\"field.type === 'derivation'\">\n <DerivationBadge v-if=\"derived\" :editor=\"editor\" :node=\"derived\" />\n </template>\n <UTextarea\n v-else-if=\"field.type === 'textarea'\"\n :model-value=\"draft\"\n :aria-label=\"field.label\"\n :disabled=\"disabled\"\n :size=\"size\"\n autoresize\n :rows=\"2\"\n :maxrows=\"6\"\n class=\"w-full\"\n @focus=\"typing = true\"\n @blur=\"onBlur\"\n @update:model-value=\"onInput\"\n />\n <UInput\n v-else\n :model-value=\"draft\"\n :type=\"field.type\"\n :aria-label=\"field.label\"\n :disabled=\"disabled\"\n :size=\"size\"\n class=\"w-full\"\n @focus=\"typing = true\"\n @blur=\"onBlur\"\n @keydown.enter=\"commit\"\n @update:model-value=\"onInput\"\n />\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;EAiBA,MAAM,QAAQ;EAQd,MAAM,EAAE,OAAO,QAAQ,WAAW,YAAY,QAAQ,SAAS,UAAU,cAAc,SAAS;EAChG,MAAM,EAAE,MAAM,cAAc;;EAG5B,MAAM,UAAU,eAAe,MAAM,MAAM,SAAS,eAAe,eAAe,MAAM,OAAO,MAAM,KAAK,MAAM,GAAG,CAAC,EAAE,QAAQ,OAAO,IAAI;EAEzI,MAAM,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