@ecsplico/editor 3.6.0 → 4.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +73 -0
- package/dist/adapters/direct-ai.d.ts +4 -4
- package/dist/adapters/direct-ai.js +2 -2
- package/dist/adapters/direct-ai.js.map +1 -1
- package/dist/adapters/document-state.d.ts +1 -1
- package/dist/adapters/document-state.js.map +1 -1
- package/dist/adapters/forge.d.ts +2 -2
- package/dist/adapters/forge.js.map +1 -1
- package/dist/adapters/nitro.d.ts +11 -3
- package/dist/adapters/nitro.js +3 -1
- package/dist/adapters/nitro.js.map +1 -1
- package/dist/adapters/shared.d.ts +6 -6
- package/dist/adapters/shared.js.map +1 -1
- package/dist/code/CodeSurface.vue.d.ts +3 -3
- package/dist/config/index.d.ts +14 -14
- package/dist/config/index.js +8 -8
- package/dist/config/index.js.map +1 -1
- package/dist/core/backend-types.d.ts +3 -3
- package/dist/core/backend-types.js.map +1 -1
- package/dist/core/backend.d.ts +4 -4
- package/dist/core/backend.js.map +1 -1
- package/dist/core/block-convert.d.ts +1 -1
- package/dist/core/block-convert.js +5 -5
- package/dist/core/block-convert.js.map +1 -1
- package/dist/core/block-transfer.d.ts +8 -4
- package/dist/core/block-transfer.js +23 -14
- package/dist/core/block-transfer.js.map +1 -1
- package/dist/core/capabilities.d.ts +113 -0
- package/dist/core/capabilities.js +155 -0
- package/dist/core/capabilities.js.map +1 -0
- package/dist/core/command-types.d.ts +1 -1
- package/dist/core/context.js.map +1 -1
- package/dist/core/convert.d.ts +5 -5
- package/dist/core/convert.js +5 -5
- package/dist/core/convert.js.map +1 -1
- package/dist/core/core-feature.js +1 -1
- package/dist/core/define-editor.d.ts +2 -2
- package/dist/core/define-editor.js +34 -6
- package/dist/core/define-editor.js.map +1 -1
- package/dist/core/derivation.d.ts +119 -0
- package/dist/core/derivation.js +187 -0
- package/dist/core/derivation.js.map +1 -0
- package/dist/core/derive.d.ts +61 -0
- package/dist/core/derive.js +69 -0
- package/dist/core/derive.js.map +1 -0
- package/dist/core/extension-points.d.ts +16 -0
- package/dist/core/feature-context.d.ts +5 -1
- package/dist/core/feature-context.js +10 -3
- package/dist/core/feature-context.js.map +1 -1
- package/dist/core/feature.d.ts +41 -19
- package/dist/core/feature.js.map +1 -1
- package/dist/core/fences.js +1 -1
- package/dist/core/fences.js.map +1 -1
- package/dist/core/index.d.ts +6 -2
- package/dist/core/index.js +5 -1
- package/dist/core/pipeline.d.ts +14 -5
- package/dist/core/pipeline.js +19 -7
- package/dist/core/pipeline.js.map +1 -1
- package/dist/core/properties.d.ts +22 -0
- package/dist/core/properties.js +17 -0
- package/dist/core/properties.js.map +1 -0
- package/dist/core/schema/block-ids.js +5 -5
- package/dist/core/schema/block-ids.js.map +1 -1
- package/dist/core/schema/index.d.ts +2 -1
- package/dist/core/schema/index.js +2 -1
- package/dist/core/schema/index.js.map +1 -1
- package/dist/core/schema/opaque-fence.d.ts +4 -4
- package/dist/core/schema/opaque-fence.js +7 -7
- package/dist/core/schema/opaque-fence.js.map +1 -1
- package/dist/core/schema/persisted-names.d.ts +58 -0
- package/dist/core/schema/persisted-names.js +96 -0
- package/dist/core/schema/persisted-names.js.map +1 -0
- package/dist/core/toolbar-items.js +1 -1
- package/dist/core/toolbar-items.js.map +1 -1
- package/dist/core/util.js +5 -1
- package/dist/core/util.js.map +1 -1
- package/dist/document/DocumentSurface.vue.d.ts +3 -3
- package/dist/features/ai/agent-ops.js +1 -1
- package/dist/features/ai/ai-review.js +1 -1
- package/dist/features/ai/assistant.d.ts +4 -4
- package/dist/features/ai/assistant.js +1 -1
- package/dist/features/ai/assistant.js.map +1 -1
- package/dist/features/ai/components/AiSelectionMenu.js +1 -1
- package/dist/features/ai/components/AiSelectionMenu.js.map +1 -1
- package/dist/features/ai/components/ModelQuickSwitch.js +7 -7
- package/dist/features/ai/components/ModelQuickSwitch.js.map +1 -1
- package/dist/features/ai/components/ModelQuickSwitch.vue.d.ts +4 -4
- package/dist/features/ai/components/SettingsAiTab.js +8 -8
- package/dist/features/ai/components/SettingsAiTab.js.map +1 -1
- package/dist/features/ai/components/SettingsModelProfiles.js +1 -1
- package/dist/features/ai/components/SettingsModelProfiles.js.map +1 -1
- package/dist/features/ai/document-chat-model.d.ts +2 -2
- package/dist/features/ai/document-chat-model.js +5 -5
- package/dist/features/ai/document-chat-model.js.map +1 -1
- package/dist/features/ai/document-chat.js +2 -2
- package/dist/features/ai/document-chat.js.map +1 -1
- package/dist/features/ai/feature.d.ts +2 -2
- package/dist/features/ai/feature.js +2 -2
- package/dist/features/ai/feature.js.map +1 -1
- package/dist/features/ai/ghost-autocomplete.d.ts +4 -4
- package/dist/features/ai/ghost-autocomplete.js +1 -1
- package/dist/features/ai/ghost-autocomplete.js.map +1 -1
- package/dist/features/ai/index.d.ts +3 -3
- package/dist/features/ai/index.js +2 -2
- package/dist/features/ai/model-profiles.d.ts +9 -9
- package/dist/features/ai/model-profiles.js +13 -13
- package/dist/features/ai/model-profiles.js.map +1 -1
- package/dist/features/ai/protocol/agent-ops.d.ts +2 -2
- package/dist/features/ai/protocol/agent-ops.js +1 -1
- package/dist/features/ai/protocol/agent-ops.js.map +1 -1
- package/dist/features/ai/protocol/block-lines.d.ts +7 -7
- package/dist/features/ai/protocol/block-lines.js +10 -10
- package/dist/features/ai/protocol/block-lines.js.map +1 -1
- package/dist/features/ai/protocol/chat.d.ts +5 -5
- package/dist/features/ai/protocol/chat.js +12 -12
- package/dist/features/ai/protocol/chat.js.map +1 -1
- package/dist/features/ai/protocol/generate.d.ts +1 -1
- package/dist/features/ai/protocol/generate.js +1 -1
- package/dist/features/ai/protocol/generate.js.map +1 -1
- package/dist/features/ai/protocol/index.d.ts +3 -3
- package/dist/features/ai/protocol/index.js +2 -2
- package/dist/features/ai/protocol/models.d.ts +3 -3
- package/dist/features/ai/protocol/models.js +3 -3
- package/dist/features/ai/protocol/models.js.map +1 -1
- package/dist/features/ai/protocol/schemas.d.ts +1 -1
- package/dist/features/ai/protocol/schemas.js +1 -1
- package/dist/features/ai/protocol/schemas.js.map +1 -1
- package/dist/features/ai/protocol/tasks.d.ts +5 -5
- package/dist/features/ai/protocol/tasks.js +12 -12
- package/dist/features/ai/protocol/tasks.js.map +1 -1
- package/dist/features/ai/react/AiSelectionMenu.js.map +1 -1
- package/dist/features/ai/react/ModelQuickSwitch.d.ts +4 -4
- package/dist/features/ai/react/ModelQuickSwitch.js +6 -6
- package/dist/features/ai/react/ModelQuickSwitch.js.map +1 -1
- package/dist/features/ai/react/SettingsAiTab.d.ts +1 -1
- package/dist/features/ai/react/SettingsAiTab.js +8 -8
- package/dist/features/ai/react/SettingsAiTab.js.map +1 -1
- package/dist/features/ai/react/SettingsModelProfiles.d.ts +1 -1
- package/dist/features/ai/react/SettingsModelProfiles.js +1 -1
- package/dist/features/ai/react/SettingsModelProfiles.js.map +1 -1
- package/dist/features/ai/react/use-ai-assistant.d.ts +1 -1
- package/dist/features/ai/react/use-ai-assistant.js +1 -1
- package/dist/features/ai/react/use-ai-assistant.js.map +1 -1
- package/dist/features/ai/react/use-model-profiles.d.ts +5 -5
- package/dist/features/ai/react/use-model-profiles.js +2 -2
- package/dist/features/ai/react/use-model-profiles.js.map +1 -1
- package/dist/features/ai/use-ai-assistant.d.ts +1 -1
- package/dist/features/ai/use-ai-assistant.js +1 -1
- package/dist/features/ai/use-ai-assistant.js.map +1 -1
- package/dist/features/ai/use-model-profiles.d.ts +4 -4
- package/dist/features/ai/use-model-profiles.js +2 -2
- package/dist/features/ai/use-model-profiles.js.map +1 -1
- package/dist/features/block-ui/block-actions.d.ts +8 -4
- package/dist/features/block-ui/block-actions.js +38 -22
- package/dist/features/block-ui/block-actions.js.map +1 -1
- package/dist/features/block-ui/block-target.d.ts +29 -0
- package/dist/features/block-ui/block-target.js +63 -0
- package/dist/features/block-ui/block-target.js.map +1 -0
- package/dist/features/block-ui/components/BlockHandles.js +3 -3
- package/dist/features/block-ui/components/BlockHandles.js.map +1 -1
- package/dist/features/block-ui/components/BlockUi.js +11 -23
- package/dist/features/block-ui/components/BlockUi.js.map +1 -1
- package/dist/features/block-ui/feature.d.ts +3 -2
- package/dist/features/block-ui/feature.js +3 -2
- package/dist/features/block-ui/feature.js.map +1 -1
- package/dist/features/block-ui/handle-geometry.js +12 -23
- package/dist/features/block-ui/handle-geometry.js.map +1 -1
- package/dist/features/block-ui/index.d.ts +2 -1
- package/dist/features/block-ui/index.js +2 -1
- package/dist/features/block-ui/react/BlockHandles.d.ts +1 -1
- package/dist/features/block-ui/react/BlockHandles.js +4 -4
- package/dist/features/block-ui/react/BlockHandles.js.map +1 -1
- package/dist/features/block-ui/react/BlockUi.js +13 -25
- package/dist/features/block-ui/react/BlockUi.js.map +1 -1
- package/dist/features/comments/model.js +1 -1
- package/dist/features/composites/accepted-children.d.ts +5 -4
- package/dist/features/composites/accepted-children.js +26 -26
- package/dist/features/composites/accepted-children.js.map +1 -1
- package/dist/features/composites/ai-brief.d.ts +4 -4
- package/dist/features/composites/ai-brief.js +14 -12
- package/dist/features/composites/ai-brief.js.map +1 -1
- package/dist/features/composites/anchors.d.ts +1 -1
- package/dist/features/composites/anchors.js.map +1 -1
- package/dist/features/composites/baskets.d.ts +1 -1
- package/dist/features/composites/baskets.js.map +1 -1
- package/dist/features/composites/bibliography-command.d.ts +1 -1
- package/dist/features/composites/bibliography-form.js +1 -1
- package/dist/features/composites/bibliography-form.js.map +1 -1
- package/dist/features/composites/bibliography.js.map +1 -1
- package/dist/features/composites/block-types-json.d.ts +38 -0
- package/dist/features/composites/block-types-json.js +122 -0
- package/dist/features/composites/block-types-json.js.map +1 -0
- package/dist/features/composites/block-types.d.ts +119 -0
- package/dist/features/composites/block-types.js +343 -0
- package/dist/features/composites/block-types.js.map +1 -0
- package/dist/features/composites/capabilities.js +109 -0
- package/dist/features/composites/capabilities.js.map +1 -0
- package/dist/features/composites/components/BibliographyEditor.js +5 -5
- package/dist/features/composites/components/BibliographyEditor.js.map +1 -1
- package/dist/features/composites/components/CompositeBasketMenu.js +2 -2
- package/dist/features/composites/components/CompositeBasketMenu.js.map +1 -1
- package/dist/features/composites/components/CompositeChrome.js +18 -8
- package/dist/features/composites/components/CompositeChrome.js.map +1 -1
- package/dist/features/composites/components/CompositeChrome.vue.d.ts +1 -1
- package/dist/features/composites/components/CompositeDetails.js +11 -10
- package/dist/features/composites/components/CompositeDetails.js.map +1 -1
- package/dist/features/composites/components/CompositeDetails.vue.d.ts +1 -1
- package/dist/features/composites/components/CompositeFieldEditor.js +7 -7
- package/dist/features/composites/components/CompositeFieldEditor.js.map +1 -1
- package/dist/features/composites/components/CompositeFieldEditor.vue.d.ts +5 -5
- package/dist/features/composites/components/CompositeInspector.js +136 -113
- package/dist/features/composites/components/CompositeInspector.js.map +1 -1
- package/dist/features/composites/components/CompositeInspector.vue.d.ts +3 -3
- package/dist/features/composites/components/CompositeStatusMenu.js +2 -2
- package/dist/features/composites/components/CompositeStatusMenu.js.map +1 -1
- package/dist/features/composites/components/CompositeSummaryEditor.js +1 -1
- package/dist/features/composites/components/CompositeSummaryEditor.js.map +1 -1
- package/dist/features/composites/components/CompositeSummaryEditor.vue.d.ts +1 -1
- package/dist/features/composites/components/CompositeTable.js +2 -2
- package/dist/features/composites/components/CompositeTable.js.map +1 -1
- package/dist/features/composites/components/CompositeTagsEditor.js +1 -1
- package/dist/features/composites/components/CompositeTagsEditor.js.map +1 -1
- package/dist/features/composites/components/CompositeTagsEditor.vue.d.ts +1 -1
- package/dist/features/composites/components/CompositeView.js +19 -17
- package/dist/features/composites/components/CompositeView.js.map +1 -1
- package/dist/features/composites/components/DerivationBadge.js +15 -6
- package/dist/features/composites/components/DerivationBadge.js.map +1 -1
- package/dist/features/composites/components/FocusChip.js +1 -1
- package/dist/features/composites/components/FocusChip.js.map +1 -1
- package/dist/features/composites/components/FocusChip.vue.d.ts +1 -1
- package/dist/features/composites/components/ReferenceFieldSelect.js +3 -3
- package/dist/features/composites/components/ReferenceFieldSelect.js.map +1 -1
- package/dist/features/composites/components/ReferenceView.js +1 -1
- package/dist/features/composites/components/ReferenceView.js.map +1 -1
- package/dist/features/composites/components/SettingsEditingTab.js +18 -18
- package/dist/features/composites/components/SettingsEditingTab.js.map +1 -1
- package/dist/features/composites/components/SettingsEditingTab.vue.d.ts +3 -3
- package/dist/features/composites/convert.d.ts +4 -4
- package/dist/features/composites/convert.js +27 -28
- package/dist/features/composites/convert.js.map +1 -1
- package/dist/features/composites/derived-chrome.js +34 -28
- package/dist/features/composites/derived-chrome.js.map +1 -1
- package/dist/features/composites/editing-settings-keys.js +6 -6
- package/dist/features/composites/editing-settings-keys.js.map +1 -1
- package/dist/features/composites/feature.d.ts +10 -10
- package/dist/features/composites/feature.js +58 -46
- package/dist/features/composites/feature.js.map +1 -1
- package/dist/features/composites/fences.d.ts +3 -3
- package/dist/features/composites/fences.js +18 -13
- package/dist/features/composites/fences.js.map +1 -1
- package/dist/features/composites/focus.d.ts +10 -10
- package/dist/features/composites/focus.js +11 -11
- package/dist/features/composites/focus.js.map +1 -1
- package/dist/features/composites/heading-composites.d.ts +5 -5
- package/dist/features/composites/heading-composites.js +13 -16
- package/dist/features/composites/heading-composites.js.map +1 -1
- package/dist/features/composites/index.d.ts +20 -18
- package/dist/features/composites/index.js +9 -7
- package/dist/features/composites/inspector-model.d.ts +45 -22
- package/dist/features/composites/inspector-model.js +53 -14
- package/dist/features/composites/inspector-model.js.map +1 -1
- package/dist/features/composites/legacy.d.ts +5 -4
- package/dist/features/composites/legacy.js +16 -23
- package/dist/features/composites/legacy.js.map +1 -1
- package/dist/features/composites/markdown-export.js +3 -3
- package/dist/features/composites/markdown-export.js.map +1 -1
- package/dist/features/composites/merge.d.ts +8 -8
- package/dist/features/composites/merge.js +23 -22
- package/dist/features/composites/merge.js.map +1 -1
- package/dist/features/composites/meta-display.js +5 -5
- package/dist/features/composites/meta-display.js.map +1 -1
- package/dist/features/composites/meta-keys.d.ts +5 -5
- package/dist/features/composites/meta-keys.js +8 -8
- package/dist/features/composites/meta-keys.js.map +1 -1
- package/dist/features/composites/node-views.d.ts +3 -3
- package/dist/features/composites/node-views.js +2 -2
- package/dist/features/composites/node-views.js.map +1 -1
- package/dist/features/composites/nodes.d.ts +13 -13
- package/dist/features/composites/nodes.js +100 -77
- package/dist/features/composites/nodes.js.map +1 -1
- package/dist/features/composites/outline.d.ts +15 -12
- package/dist/features/composites/outline.js +24 -21
- package/dist/features/composites/outline.js.map +1 -1
- package/dist/features/composites/properties.d.ts +51 -0
- package/dist/features/composites/properties.js +89 -0
- package/dist/features/composites/properties.js.map +1 -0
- package/dist/features/composites/react/BibliographyEditor.js +5 -5
- package/dist/features/composites/react/BibliographyEditor.js.map +1 -1
- package/dist/features/composites/react/CompositeBasketMenu.js +2 -2
- package/dist/features/composites/react/CompositeBasketMenu.js.map +1 -1
- package/dist/features/composites/react/CompositeChrome.d.ts +1 -1
- package/dist/features/composites/react/CompositeChrome.js +15 -6
- package/dist/features/composites/react/CompositeChrome.js.map +1 -1
- package/dist/features/composites/react/CompositeDetails.d.ts +1 -1
- package/dist/features/composites/react/CompositeDetails.js +11 -10
- package/dist/features/composites/react/CompositeDetails.js.map +1 -1
- package/dist/features/composites/react/CompositeFieldEditor.d.ts +5 -5
- package/dist/features/composites/react/CompositeFieldEditor.js +6 -6
- package/dist/features/composites/react/CompositeFieldEditor.js.map +1 -1
- package/dist/features/composites/react/CompositeInspector.d.ts +3 -3
- package/dist/features/composites/react/CompositeInspector.js +142 -128
- package/dist/features/composites/react/CompositeInspector.js.map +1 -1
- package/dist/features/composites/react/CompositeStatusMenu.js +2 -2
- package/dist/features/composites/react/CompositeStatusMenu.js.map +1 -1
- package/dist/features/composites/react/CompositeSummaryEditor.d.ts +1 -1
- package/dist/features/composites/react/CompositeSummaryEditor.js +1 -1
- package/dist/features/composites/react/CompositeSummaryEditor.js.map +1 -1
- package/dist/features/composites/react/CompositeTable.d.ts +1 -1
- package/dist/features/composites/react/CompositeTable.js +3 -3
- package/dist/features/composites/react/CompositeTable.js.map +1 -1
- package/dist/features/composites/react/CompositeTagsEditor.d.ts +1 -1
- package/dist/features/composites/react/CompositeTagsEditor.js +1 -1
- package/dist/features/composites/react/CompositeTagsEditor.js.map +1 -1
- package/dist/features/composites/react/CompositeView.js +17 -15
- package/dist/features/composites/react/CompositeView.js.map +1 -1
- package/dist/features/composites/react/DerivationBadge.js +13 -4
- package/dist/features/composites/react/DerivationBadge.js.map +1 -1
- package/dist/features/composites/react/FocusChip.d.ts +1 -1
- package/dist/features/composites/react/FocusChip.js +1 -1
- package/dist/features/composites/react/FocusChip.js.map +1 -1
- package/dist/features/composites/react/ReferenceFieldSelect.js +3 -3
- package/dist/features/composites/react/ReferenceFieldSelect.js.map +1 -1
- package/dist/features/composites/react/ReferenceView.d.ts +1 -1
- package/dist/features/composites/react/ReferenceView.js +1 -1
- package/dist/features/composites/react/ReferenceView.js.map +1 -1
- package/dist/features/composites/react/SettingsEditingTab.d.ts +4 -4
- package/dist/features/composites/react/SettingsEditingTab.js +20 -20
- package/dist/features/composites/react/SettingsEditingTab.js.map +1 -1
- package/dist/features/composites/react.js +1 -1
- package/dist/features/composites/react.js.map +1 -1
- package/dist/features/composites/reference-ai.js +1 -1
- package/dist/features/composites/reference-ai.js.map +1 -1
- package/dist/features/composites/reference-label.d.ts +3 -3
- package/dist/features/composites/reference-label.js +6 -6
- package/dist/features/composites/reference-label.js.map +1 -1
- package/dist/features/composites/reference-suggestion.d.ts +1 -1
- package/dist/features/composites/reference-suggestion.js +3 -3
- package/dist/features/composites/reference-suggestion.js.map +1 -1
- package/dist/features/composites/reference-text.d.ts +2 -2
- package/dist/features/composites/reference-text.js +4 -4
- package/dist/features/composites/reference-text.js.map +1 -1
- package/dist/features/composites/reference.d.ts +3 -3
- package/dist/features/composites/reference.js +1 -1
- package/dist/features/composites/reference.js.map +1 -1
- package/dist/features/composites/reveal-source.d.ts +3 -3
- package/dist/features/composites/reveal-source.js +6 -6
- package/dist/features/composites/reveal-source.js.map +1 -1
- package/dist/features/composites/rows-model.d.ts +2 -2
- package/dist/features/composites/rows-model.js +4 -3
- package/dist/features/composites/rows-model.js.map +1 -1
- package/dist/features/composites/rows.d.ts +16 -28
- package/dist/features/composites/rows.js +20 -54
- package/dist/features/composites/rows.js.map +1 -1
- package/dist/features/composites/schema.d.ts +12 -11
- package/dist/features/composites/schema.js +10 -9
- package/dist/features/composites/schema.js.map +1 -1
- package/dist/features/composites/source.d.ts +20 -0
- package/dist/features/composites/source.js +40 -0
- package/dist/features/composites/source.js.map +1 -0
- package/dist/features/composites/split.d.ts +11 -11
- package/dist/features/composites/split.js +20 -20
- package/dist/features/composites/split.js.map +1 -1
- package/dist/features/composites/structure-mode.js +3 -3
- package/dist/features/composites/structure-mode.js.map +1 -1
- package/dist/features/composites/table-model.js +2 -2
- package/dist/features/composites/table-model.js.map +1 -1
- package/dist/features/composites/use-composite-inspector.js +3 -1
- package/dist/features/composites/use-composite-inspector.js.map +1 -1
- package/dist/features/composites/use-composite-rows.d.ts +2 -2
- package/dist/features/composites/use-composite-rows.js.map +1 -1
- package/dist/features/composites/vue.js +1 -1
- package/dist/features/composites/vue.js.map +1 -1
- package/dist/features/image-studio/components/ImageStudioDialog.js +150 -87
- package/dist/features/image-studio/components/ImageStudioDialog.js.map +1 -1
- package/dist/features/image-studio/components/ImageStudioDialog.vue.d.ts +5 -1
- package/dist/features/image-studio/components/ImageStudioLibraryPanel.js +186 -0
- package/dist/features/image-studio/components/ImageStudioLibraryPanel.js.map +1 -0
- package/dist/features/image-studio/components/ImageStudioLibraryTile.js +134 -0
- package/dist/features/image-studio/components/ImageStudioLibraryTile.js.map +1 -0
- package/dist/features/image-studio/components/ImageStudioView.js.map +1 -1
- package/dist/features/image-studio/feature.d.ts +1 -1
- package/dist/features/image-studio/feature.js +1 -1
- package/dist/features/image-studio/feature.js.map +1 -1
- package/dist/features/image-studio/index.d.ts +3 -2
- package/dist/features/image-studio/index.js +2 -2
- package/dist/features/image-studio/library.d.ts +35 -0
- package/dist/features/image-studio/node-core.d.ts +3 -3
- package/dist/features/image-studio/node-core.js +1 -1
- package/dist/features/image-studio/node-core.js.map +1 -1
- package/dist/features/image-studio/node-store.d.ts +1 -1
- package/dist/features/image-studio/node-store.js +1 -1
- package/dist/features/image-studio/node-store.js.map +1 -1
- package/dist/features/image-studio/react/ImageStudioDialog.d.ts +1 -1
- package/dist/features/image-studio/react/ImageStudioDialog.js +46 -5
- package/dist/features/image-studio/react/ImageStudioDialog.js.map +1 -1
- package/dist/features/image-studio/react/ImageStudioLibraryPanel.js +141 -0
- package/dist/features/image-studio/react/ImageStudioLibraryPanel.js.map +1 -0
- package/dist/features/image-studio/react/ImageStudioLibraryTile.js +105 -0
- package/dist/features/image-studio/react/ImageStudioLibraryTile.js.map +1 -0
- package/dist/features/image-studio/react/ImageStudioView.js +1 -1
- package/dist/features/image-studio/react/ImageStudioView.js.map +1 -1
- package/dist/features/image-studio/react/store.d.ts +8 -3
- package/dist/features/image-studio/react/store.js.map +1 -1
- package/dist/features/image-studio/react.d.ts +4 -3
- package/dist/features/image-studio/react.js +3 -3
- package/dist/features/image-studio/react.js.map +1 -1
- package/dist/features/image-studio/schema.d.ts +1 -1
- package/dist/features/image-studio/schema.js +1 -1
- package/dist/features/image-studio/schema.js.map +1 -1
- package/dist/features/image-studio/state.d.ts +8 -3
- package/dist/features/image-studio/state.js +11 -3
- package/dist/features/image-studio/state.js.map +1 -1
- package/dist/features/image-studio/store.d.ts +8 -3
- package/dist/features/image-studio/vue.d.ts +4 -3
- package/dist/features/image-studio/vue.js +3 -3
- package/dist/features/image-studio/vue.js.map +1 -1
- package/dist/features/mentions/tag.js +2 -1
- package/dist/features/mentions/tag.js.map +1 -1
- package/dist/features/themes/components/SettingsAppearanceTab.js +1 -1
- package/dist/features/themes/components/SettingsAppearanceTab.js.map +1 -1
- package/dist/features/themes/feature.d.ts +1 -1
- package/dist/features/themes/feature.js.map +1 -1
- package/dist/features/themes/react/SettingsAppearanceTab.d.ts +1 -1
- package/dist/features/themes/react/SettingsAppearanceTab.js +1 -1
- package/dist/features/themes/react/SettingsAppearanceTab.js.map +1 -1
- package/dist/features/themes/theme-runtime.js +1 -1
- package/dist/features/themes/theme-runtime.js.map +1 -1
- package/dist/features/transcript/TranscriptSegmentView.js +1 -1
- package/dist/features/transcript/TranscriptSegmentView.js.map +1 -1
- package/dist/features/transcript/react/TranscriptSegmentView.js +1 -1
- package/dist/features/transcript/react/TranscriptSegmentView.js.map +1 -1
- package/dist/features/transcript/segment-node.js.map +1 -1
- package/dist/features/transfer/feature.js +1 -1
- package/dist/features/transfer/feature.js.map +1 -1
- package/dist/features/transfer/transforms.d.ts +4 -4
- package/dist/features/transfer/transforms.js +12 -12
- package/dist/features/transfer/transforms.js.map +1 -1
- package/dist/i18n/de/ai.js +4 -4
- package/dist/i18n/de/ai.js.map +1 -1
- package/dist/i18n/de/authors.js +1 -1
- package/dist/i18n/de/authors.js.map +1 -1
- package/dist/i18n/de/comments.js +1 -1
- package/dist/i18n/de/comments.js.map +1 -1
- package/dist/i18n/de/composites.js +62 -59
- package/dist/i18n/de/composites.js.map +1 -1
- package/dist/i18n/de/image-studio.js +11 -2
- package/dist/i18n/de/image-studio.js.map +1 -1
- package/dist/i18n/de/integrations.js +20 -20
- package/dist/i18n/de/integrations.js.map +1 -1
- package/dist/i18n/de/markdown.js +1 -1
- package/dist/i18n/de/markdown.js.map +1 -1
- package/dist/i18n/de/palette.js +1 -1
- package/dist/i18n/de/palette.js.map +1 -1
- package/dist/i18n/de/themes.js +3 -3
- package/dist/i18n/de/themes.js.map +1 -1
- package/dist/i18n/de/transfer.js +2 -2
- package/dist/i18n/de/transfer.js.map +1 -1
- package/dist/i18n/de/tree.js +6 -6
- package/dist/i18n/de/tree.js.map +1 -1
- package/dist/i18n/de.d.ts +110 -98
- package/dist/i18n/en/ai.js +2 -2
- package/dist/i18n/en/ai.js.map +1 -1
- package/dist/i18n/en/composites.js +64 -61
- package/dist/i18n/en/composites.js.map +1 -1
- package/dist/i18n/en/image-studio.js +9 -0
- package/dist/i18n/en/image-studio.js.map +1 -1
- package/dist/i18n/en/integrations.js +9 -9
- package/dist/i18n/en/integrations.js.map +1 -1
- package/dist/i18n/en/markdown.js +1 -1
- package/dist/i18n/en/markdown.js.map +1 -1
- package/dist/i18n/en/palette.js +1 -1
- package/dist/i18n/en/palette.js.map +1 -1
- package/dist/i18n/en/themes.js +4 -4
- package/dist/i18n/en/themes.js.map +1 -1
- package/dist/i18n/en/tree.js +5 -5
- package/dist/i18n/en/tree.js.map +1 -1
- package/dist/index.d.ts +4 -1
- package/dist/integrations/composite-ai/bibliography-fetch.d.ts +6 -6
- package/dist/integrations/composite-ai/bibliography-fetch.js +19 -19
- package/dist/integrations/composite-ai/bibliography-fetch.js.map +1 -1
- package/dist/integrations/composite-ai/composite-fill.d.ts +4 -4
- package/dist/integrations/composite-ai/composite-fill.js +5 -5
- package/dist/integrations/composite-ai/composite-fill.js.map +1 -1
- package/dist/integrations/composite-ai/composite-summary.d.ts +2 -2
- package/dist/integrations/composite-ai/composite-summary.js +5 -5
- package/dist/integrations/composite-ai/composite-summary.js.map +1 -1
- package/dist/integrations/composite-ai/derive.d.ts +17 -17
- package/dist/integrations/composite-ai/derive.js +27 -26
- package/dist/integrations/composite-ai/derive.js.map +1 -1
- package/dist/integrations/composite-ai/index.d.ts +14 -15
- package/dist/integrations/composite-ai/index.js +98 -77
- package/dist/integrations/composite-ai/index.js.map +1 -1
- package/dist/integrations/composite-ai/outline-sanitize.d.ts +1 -1
- package/dist/integrations/composite-ai/outline-sanitize.js +1 -1
- package/dist/integrations/composite-ai/outline-sanitize.js.map +1 -1
- package/dist/integrations/composite-ai/rendition.d.ts +9 -9
- package/dist/integrations/composite-ai/rendition.js +27 -27
- package/dist/integrations/composite-ai/rendition.js.map +1 -1
- package/dist/integrations/composite-ai/split.d.ts +8 -8
- package/dist/integrations/composite-ai/split.js +12 -12
- package/dist/integrations/composite-ai/split.js.map +1 -1
- package/dist/integrations/composite-ai/transfer-transforms.d.ts +2 -2
- package/dist/integrations/composite-ai/transfer-transforms.js +11 -11
- package/dist/integrations/composite-ai/transfer-transforms.js.map +1 -1
- package/dist/integrations/composite-media/index.d.ts +4 -3
- package/dist/integrations/composite-media/index.js +20 -14
- package/dist/integrations/composite-media/index.js.map +1 -1
- package/dist/markdown/MarkdownSurface.vue.d.ts +7 -7
- package/dist/markdown/document.js +1 -1
- package/dist/markdown/document.js.map +1 -1
- package/dist/nuxt/module.d.ts +48 -24
- package/dist/nuxt/module.js.map +1 -1
- package/dist/nuxt/runtime/server/plugins/editor-server.js +3 -2
- package/dist/nuxt/runtime/server/plugins/editor-server.js.map +1 -1
- package/dist/presets/compose.d.ts +6 -6
- package/dist/presets/compose.js +7 -4
- package/dist/presets/compose.js.map +1 -1
- package/dist/react/AdvancedEditor.d.ts +2 -2
- package/dist/react/AdvancedEditor.js +1 -1
- package/dist/react/AdvancedEditor.js.map +1 -1
- package/dist/react/compose.d.ts +1 -1
- package/dist/react/compose.js +1 -1
- package/dist/react/compose.js.map +1 -1
- package/dist/react/composed-surface.d.ts +5 -5
- package/dist/react/composed-surface.js +2 -2
- package/dist/react/composed-surface.js.map +1 -1
- package/dist/server/ai.d.ts +7 -7
- package/dist/server/ai.js +1 -1
- package/dist/server/ai.js.map +1 -1
- package/dist/server/auth.d.ts +1 -1
- package/dist/server/collab-state.d.ts +1 -1
- package/dist/server/collab-state.js.map +1 -1
- package/dist/server/collab.d.ts +4 -4
- package/dist/server/collab.js +22 -17
- package/dist/server/collab.js.map +1 -1
- package/dist/server/handlers/ai.d.ts +9 -6
- package/dist/server/handlers/ai.js +13 -17
- package/dist/server/handlers/ai.js.map +1 -1
- package/dist/server/handlers/context.d.ts +4 -0
- package/dist/server/handlers/context.js.map +1 -1
- package/dist/server/handlers/editor.d.ts +33 -32
- package/dist/server/handlers/editor.js +13 -8
- package/dist/server/handlers/editor.js.map +1 -1
- package/dist/server/handlers/images.d.ts +1 -1
- package/dist/server/handlers/images.js +1 -1
- package/dist/server/handlers/images.js.map +1 -1
- package/dist/server/host.d.ts +4 -0
- package/dist/server/host.js +10 -2
- package/dist/server/host.js.map +1 -1
- package/dist/server/index.d.ts +3 -3
- package/dist/server/ports.d.ts +8 -8
- package/dist/server/ports.js.map +1 -1
- package/dist/settings/index.d.ts +20 -19
- package/dist/settings/index.js +25 -24
- package/dist/settings/index.js.map +1 -1
- package/dist/settings/migrate.d.ts +18 -0
- package/dist/settings/migrate.js +46 -0
- package/dist/settings/migrate.js.map +1 -0
- package/dist/settings/values.d.ts +12 -12
- package/dist/settings/values.js +11 -11
- package/dist/settings/values.js.map +1 -1
- package/dist/styles/composites.css +10 -10
- package/dist/tree/DocumentTree.js +12 -5
- package/dist/tree/DocumentTree.js.map +1 -1
- package/dist/tree/drop-rules.js +5 -5
- package/dist/tree/drop-rules.js.map +1 -1
- package/dist/tree/react/DocumentTree.js +14 -5
- package/dist/tree/react/DocumentTree.js.map +1 -1
- package/dist/tree/tree-host.js +5 -5
- package/dist/tree/tree-host.js.map +1 -1
- package/dist/tree/tree-items.js +34 -28
- package/dist/tree/tree-items.js.map +1 -1
- package/dist/tree/tree-model.js +16 -16
- package/dist/tree/tree-model.js.map +1 -1
- package/dist/tree/tree-rows.js +2 -2
- package/dist/tree/tree-rows.js.map +1 -1
- package/dist/tree/tree-view-model.d.ts +2 -2
- package/dist/tree/tree-view-model.js.map +1 -1
- package/dist/vue/AdvancedEditor.js +2 -2
- package/dist/vue/AdvancedEditor.js.map +1 -1
- package/dist/vue/AdvancedEditor.vue.d.ts +10 -10
- package/dist/vue/SimpleEditor.vue.d.ts +4 -4
- package/dist/vue/components/EditorSurface.vue.d.ts +4 -4
- package/dist/vue/compose.d.ts +1 -1
- package/dist/vue/compose.js +1 -1
- package/dist/vue/compose.js.map +1 -1
- package/package.json +1 -1
- package/dist/features/composites/derivation.d.ts +0 -62
- package/dist/features/composites/derivation.js +0 -102
- package/dist/features/composites/derivation.js.map +0 -1
- package/dist/features/composites/kinds.d.ts +0 -89
- package/dist/features/composites/kinds.js +0 -285
- package/dist/features/composites/kinds.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ImageStudioLibraryPanel.js","names":["_openBlock","_createElementBlock","_createElementVNode","_createVNode","_unref","_Fragment","_renderList","_createBlock","_createCommentVNode","_toDisplayString","ImageStudioLibraryTile"],"sources":["../../../../src/features/image-studio/components/ImageStudioLibraryPanel.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { onBeforeUnmount, onMounted, reactive, ref, watch } from 'vue'\nimport { fetchErrorMessage } from '../../../core'\nimport { useUiKit } from '../../../vue/kit/use-ui-kit'\nimport { useEditorI18n } from '../../../vue/use-editor-i18n'\nimport type { ImageStudioLibrary, ImageStudioLibraryItem } from '../library'\nimport type { ImageStudioState } from '../state'\nimport ImageStudioLibraryTile from './ImageStudioLibraryTile.vue'\n\n/**\n * The gallery tab of the Bild-Studio: search, one select per facet of the host and the host's images as tiles. The\n * list is read on mount (the facets with their first option chosen), after a facet change and 300 ms after the last\n * keystroke of the search; a newer read aborts the running one. Picking, referencing, renaming and deleting go to the\n * host (`library`) or up to the dialog (`use`, `reference`, `removed`), which applies the reducers.\n */\nconst props = defineProps<{ library: ImageStudioLibrary, state: ImageStudioState }>()\nconst emit = defineEmits<{ use: [item: ImageStudioLibraryItem], reference: [item: ImageStudioLibraryItem], removed: [id: string] }>()\n\nconst { Alert: UAlert, Input: UInput, Select: USelect } = useUiKit()\nconst { t } = useEditorI18n()\n\nconst SEARCH_DELAY_MS = 300\n\nconst facets = props.library.facets()\nconst values = reactive<Record<string, string>>(Object.fromEntries(facets.map(facet => [facet.id, facet.options[0]?.value ?? ''])))\nconst search = ref('')\nconst items = ref<readonly ImageStudioLibraryItem[]>([])\nconst busy = ref(false)\nconst problem = ref<string>()\n\nlet controller: AbortController | undefined\nlet searchTimer: ReturnType<typeof setTimeout> | undefined\n\nasync function load() {\n clearTimeout(searchTimer)\n searchTimer = undefined\n controller?.abort()\n const own = new AbortController()\n controller = own\n busy.value = true\n problem.value = undefined\n try {\n const found = await props.library.list({ search: search.value, facets: { ...values } }, own.signal)\n if (own.signal.aborted) return\n items.value = found\n } catch (error) {\n if (own.signal.aborted) return\n problem.value = t('imageStudio.dialog.library.failed', { message: fetchErrorMessage(error) })\n } finally {\n if (controller === own) {\n controller = undefined\n busy.value = false\n }\n }\n}\n\nonMounted(() => void load())\nwatch(values, () => void load())\nwatch(search, () => {\n clearTimeout(searchTimer)\n searchTimer = setTimeout(() => void load(), SEARCH_DELAY_MS)\n})\nonBeforeUnmount(() => {\n clearTimeout(searchTimer)\n controller?.abort()\n})\n\nconst held = (id: string) => props.state.references.some(image => image.id === id) || props.state.generations.some(image => image.id === id)\n\nasync function rename(item: ImageStudioLibraryItem, title: string) {\n if (!props.library.rename) return\n problem.value = undefined\n try {\n const renamed = await props.library.rename(item.id, title)\n items.value = items.value.map(other => other.id === item.id ? renamed : other)\n } catch (error) {\n problem.value = fetchErrorMessage(error)\n }\n}\n\nasync function remove(item: ImageStudioLibraryItem) {\n if (!props.library.remove) return\n problem.value = undefined\n try {\n await props.library.remove(item.id)\n items.value = items.value.filter(other => other.id !== item.id)\n emit('removed', item.id)\n } catch (error) {\n problem.value = fetchErrorMessage(error)\n }\n}\n</script>\n\n<template>\n <section class=\"flex flex-col gap-3 p-1\" data-image-studio-library>\n <div class=\"flex flex-wrap items-center gap-2\">\n <UInput\n v-model=\"search\"\n class=\"min-w-40 flex-1\"\n icon=\"i-lucide-search\"\n size=\"xs\"\n :placeholder=\"t('imageStudio.dialog.library.search')\"\n :aria-label=\"t('imageStudio.dialog.library.search')\"\n data-image-studio-library-search\n />\n <USelect\n v-for=\"facet in facets\"\n :key=\"facet.id\"\n v-model=\"values[facet.id]\"\n :items=\"facet.options.map(option => ({ label: option.label, value: option.value }))\"\n size=\"xs\"\n :aria-label=\"facet.label\"\n :data-image-studio-facet=\"facet.id\"\n />\n </div>\n <UAlert v-if=\"problem\" color=\"error\" variant=\"subtle\" :title=\"problem\" />\n <p v-if=\"busy\" class=\"text-sm text-[var(--sk-muted)]\" role=\"status\">\n {{ t('imageStudio.dialog.library.loading') }}\n </p>\n <p v-else-if=\"!items.length && !problem\" class=\"text-sm text-[var(--sk-muted)]\">\n {{ t('imageStudio.dialog.library.empty') }}\n </p>\n <ul v-if=\"items.length\" class=\"grid grid-cols-2 gap-2 sm:grid-cols-3\">\n <ImageStudioLibraryTile\n v-for=\"item in items\"\n :key=\"item.id\"\n :item=\"item\"\n :selected=\"state.selected === item.id\"\n :held=\"held(item.id)\"\n :renamable=\"Boolean(library.rename)\"\n :removable=\"Boolean(library.remove)\"\n @use=\"emit('use', item)\"\n @reference=\"emit('reference', item)\"\n @rename=\"title => rename(item, title)\"\n @remove=\"remove(item)\"\n />\n </ul>\n </section>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqBA,MAAM,kBAAkB;;;;;;;;;;;;;EANxB,MAAM,QAAQ;EACd,MAAM,OAAO;EAEb,MAAM,EAAE,OAAO,QAAQ,OAAO,QAAQ,QAAQ,YAAY,SAAS;EACnE,MAAM,EAAE,MAAM,cAAc;EAI5B,MAAM,SAAS,MAAM,QAAQ,OAAO;EACpC,MAAM,SAAS,SAAiC,OAAO,YAAY,OAAO,KAAI,UAAS,CAAC,MAAM,IAAI,MAAM,QAAQ,EAAE,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC;EAClI,MAAM,SAAS,IAAI,EAAE;EACrB,MAAM,QAAQ,IAAuC,CAAC,CAAC;EACvD,MAAM,OAAO,IAAI,KAAK;EACtB,MAAM,UAAU,IAAY;EAE5B,IAAI;EACJ,IAAI;EAEJ,eAAe,OAAO;GACpB,aAAa,WAAW;GACxB,cAAc,KAAA;GACd,YAAY,MAAM;GAClB,MAAM,MAAM,IAAI,gBAAgB;GAChC,aAAa;GACb,KAAK,QAAQ;GACb,QAAQ,QAAQ,KAAA;GAChB,IAAI;IACF,MAAM,Q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AcK,MAdL,YAcK,EAbHD,UAAA,IAAA,GAAAC,mBAYEI,UAAA,MAAAC,WAXe,MAAA,QAAR,SAAI;KADb,OAAAN,UAAA,GAAAO,YAYEG,aAAA;MAVC,KAAK,KAAK;MACJ;MACN,UAAU,QAAA,MAAM,aAAa,KAAK;MAClC,MAAM,KAAK,KAAK,EAAE;MAClB,WAAW,QAAQ,QAAA,QAAQ,MAAM;MACjC,WAAW,QAAQ,QAAA,QAAQ,MAAM;MACjC,QAAG,WAAE,KAAI,OAAQ,IAAI;MACrB,cAAS,WAAE,KAAI,aAAc,IAAI;MACjC,WAAQ,UAAS,OAAO,MAAM,KAAK;MACnC,WAAM,WAAE,OAAO,IAAI"}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { useUiKit } from "../../../vue/kit/use-ui-kit.js";
|
|
2
|
+
import { useEditorI18n } from "../../../vue/use-editor-i18n.js";
|
|
3
|
+
import { computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, openBlock, ref, toDisplayString, unref, withKeys, withModifiers } from "vue";
|
|
4
|
+
//#region src/features/image-studio/components/ImageStudioLibraryTile.vue
|
|
5
|
+
const _hoisted_1 = ["data-selected"];
|
|
6
|
+
const _hoisted_2 = { class: "block overflow-hidden rounded bg-[var(--sk-bg-elevated)]" };
|
|
7
|
+
const _hoisted_3 = ["src", "alt"];
|
|
8
|
+
const _hoisted_4 = { class: "flex min-w-0 flex-col" };
|
|
9
|
+
const _hoisted_5 = ["title"];
|
|
10
|
+
const _hoisted_6 = ["title"];
|
|
11
|
+
const _hoisted_7 = { class: "flex flex-wrap items-center justify-between gap-1" };
|
|
12
|
+
const _hoisted_8 = { class: "flex items-center" };
|
|
13
|
+
/**
|
|
14
|
+
* One image of the host's gallery. „Als Bild verwenden“ makes it the block's image, „Als Referenz“ adds it to the
|
|
15
|
+
* references (disabled once the block holds it), the pencil renames it in place (Enter commits, Escape or blur cancels)
|
|
16
|
+
* and the trash asks the host to delete it. The host's `subtitle` shows under the title.
|
|
17
|
+
*/
|
|
18
|
+
const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
19
|
+
__name: "ImageStudioLibraryTile",
|
|
20
|
+
props: {
|
|
21
|
+
item: {},
|
|
22
|
+
selected: { type: Boolean },
|
|
23
|
+
held: { type: Boolean },
|
|
24
|
+
renamable: { type: Boolean },
|
|
25
|
+
removable: { type: Boolean }
|
|
26
|
+
},
|
|
27
|
+
emits: [
|
|
28
|
+
"use",
|
|
29
|
+
"reference",
|
|
30
|
+
"rename",
|
|
31
|
+
"remove"
|
|
32
|
+
],
|
|
33
|
+
setup(__props, { emit: __emit }) {
|
|
34
|
+
const props = __props;
|
|
35
|
+
const emit = __emit;
|
|
36
|
+
const { Button: UButton, Input: UInput } = useUiKit();
|
|
37
|
+
const { t } = useEditorI18n();
|
|
38
|
+
const title = computed(() => props.item.title || t("imageStudio.dialog.tile.untitled"));
|
|
39
|
+
const editing = ref(false);
|
|
40
|
+
const draft = ref("");
|
|
41
|
+
function startRename() {
|
|
42
|
+
draft.value = props.item.title;
|
|
43
|
+
editing.value = true;
|
|
44
|
+
}
|
|
45
|
+
function commitRename() {
|
|
46
|
+
if (!editing.value) return;
|
|
47
|
+
editing.value = false;
|
|
48
|
+
const next = draft.value.trim();
|
|
49
|
+
if (next !== "" && next !== props.item.title) emit("rename", next);
|
|
50
|
+
}
|
|
51
|
+
return (_ctx, _cache) => {
|
|
52
|
+
return openBlock(), createElementBlock("li", {
|
|
53
|
+
class: "flex flex-col gap-1.5 rounded-md border border-[var(--sk-border)] p-1.5 data-[selected=true]:border-[var(--sk-primary)]",
|
|
54
|
+
"data-selected": __props.selected,
|
|
55
|
+
"data-image-studio-library-tile": ""
|
|
56
|
+
}, [
|
|
57
|
+
createElementVNode("div", _hoisted_2, [createElementVNode("img", {
|
|
58
|
+
src: __props.item.url,
|
|
59
|
+
alt: title.value,
|
|
60
|
+
class: "aspect-square w-full object-cover",
|
|
61
|
+
draggable: "false"
|
|
62
|
+
}, null, 8, _hoisted_3)]),
|
|
63
|
+
createElementVNode("div", _hoisted_4, [editing.value ? (openBlock(), createBlock(unref(UInput), {
|
|
64
|
+
key: 0,
|
|
65
|
+
modelValue: draft.value,
|
|
66
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => draft.value = $event),
|
|
67
|
+
size: "xs",
|
|
68
|
+
autofocus: "",
|
|
69
|
+
"aria-label": unref(t)("imageStudio.dialog.library.rename"),
|
|
70
|
+
"data-image-studio-library-rename": "",
|
|
71
|
+
onKeydown: [withKeys(withModifiers(commitRename, ["prevent"]), ["enter"]), _cache[1] || (_cache[1] = withKeys(withModifiers(($event) => editing.value = false, ["prevent", "stop"]), ["esc"]))],
|
|
72
|
+
onBlur: _cache[2] || (_cache[2] = ($event) => editing.value = false)
|
|
73
|
+
}, null, 8, [
|
|
74
|
+
"modelValue",
|
|
75
|
+
"aria-label",
|
|
76
|
+
"onKeydown"
|
|
77
|
+
])) : (openBlock(), createElementBlock("span", {
|
|
78
|
+
key: 1,
|
|
79
|
+
class: "truncate text-xs font-medium text-[var(--sk-fg-highlighted)]",
|
|
80
|
+
title: title.value
|
|
81
|
+
}, toDisplayString(title.value), 9, _hoisted_5)), __props.item.subtitle ? (openBlock(), createElementBlock("span", {
|
|
82
|
+
key: 2,
|
|
83
|
+
class: "truncate text-xs text-[var(--sk-muted)]",
|
|
84
|
+
title: __props.item.subtitle
|
|
85
|
+
}, toDisplayString(__props.item.subtitle), 9, _hoisted_6)) : createCommentVNode("v-if", true)]),
|
|
86
|
+
createElementVNode("div", _hoisted_7, [
|
|
87
|
+
createVNode(unref(UButton), {
|
|
88
|
+
label: unref(t)("imageStudio.dialog.tile.use"),
|
|
89
|
+
icon: __props.selected ? "i-lucide-check" : void 0,
|
|
90
|
+
size: "xs",
|
|
91
|
+
color: "primary",
|
|
92
|
+
variant: __props.selected ? "solid" : "outline",
|
|
93
|
+
"aria-pressed": __props.selected,
|
|
94
|
+
onClick: _cache[3] || (_cache[3] = ($event) => emit("use"))
|
|
95
|
+
}, null, 8, [
|
|
96
|
+
"label",
|
|
97
|
+
"icon",
|
|
98
|
+
"variant",
|
|
99
|
+
"aria-pressed"
|
|
100
|
+
]),
|
|
101
|
+
createVNode(unref(UButton), {
|
|
102
|
+
label: unref(t)("imageStudio.dialog.library.reference"),
|
|
103
|
+
size: "xs",
|
|
104
|
+
color: "neutral",
|
|
105
|
+
variant: "outline",
|
|
106
|
+
disabled: __props.held,
|
|
107
|
+
onClick: _cache[4] || (_cache[4] = ($event) => emit("reference"))
|
|
108
|
+
}, null, 8, ["label", "disabled"]),
|
|
109
|
+
createElementVNode("span", _hoisted_8, [__props.renamable ? (openBlock(), createBlock(unref(UButton), {
|
|
110
|
+
key: 0,
|
|
111
|
+
icon: "i-lucide-pencil",
|
|
112
|
+
size: "xs",
|
|
113
|
+
color: "neutral",
|
|
114
|
+
variant: "ghost",
|
|
115
|
+
"aria-label": unref(t)("imageStudio.dialog.library.rename"),
|
|
116
|
+
onClick: startRename
|
|
117
|
+
}, null, 8, ["aria-label"])) : createCommentVNode("v-if", true), __props.removable ? (openBlock(), createBlock(unref(UButton), {
|
|
118
|
+
key: 1,
|
|
119
|
+
icon: "i-lucide-trash-2",
|
|
120
|
+
size: "xs",
|
|
121
|
+
color: "neutral",
|
|
122
|
+
variant: "ghost",
|
|
123
|
+
"aria-label": unref(t)("imageStudio.dialog.library.remove"),
|
|
124
|
+
onClick: _cache[5] || (_cache[5] = ($event) => emit("remove"))
|
|
125
|
+
}, null, 8, ["aria-label"])) : createCommentVNode("v-if", true)])
|
|
126
|
+
])
|
|
127
|
+
], 8, _hoisted_1);
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
//#endregion
|
|
132
|
+
export { _sfc_main as default };
|
|
133
|
+
|
|
134
|
+
//# sourceMappingURL=ImageStudioLibraryTile.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ImageStudioLibraryTile.js","names":["_openBlock","_createElementBlock","_createElementVNode","_createBlock","_unref","_withKeys","_withModifiers","_toDisplayString","_createCommentVNode","_createVNode"],"sources":["../../../../src/features/image-studio/components/ImageStudioLibraryTile.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, ref } from 'vue'\nimport { useUiKit } from '../../../vue/kit/use-ui-kit'\nimport { useEditorI18n } from '../../../vue/use-editor-i18n'\nimport type { ImageStudioLibraryItem } from '../library'\n\n/**\n * One image of the host's gallery. „Als Bild verwenden“ makes it the block's image, „Als Referenz“ adds it to the\n * references (disabled once the block holds it), the pencil renames it in place (Enter commits, Escape or blur cancels)\n * and the trash asks the host to delete it. The host's `subtitle` shows under the title.\n */\nconst props = defineProps<{ item: ImageStudioLibraryItem, selected: boolean, held: boolean, renamable: boolean, removable: boolean }>()\nconst emit = defineEmits<{ use: [], reference: [], rename: [title: string], remove: [] }>()\n\nconst { Button: UButton, Input: UInput } = useUiKit()\nconst { t } = useEditorI18n()\n\nconst title = computed(() => props.item.title || t('imageStudio.dialog.tile.untitled'))\n\nconst editing = ref(false)\nconst draft = ref('')\n\nfunction startRename() {\n draft.value = props.item.title\n editing.value = true\n}\n\nfunction commitRename() {\n if (!editing.value) return\n editing.value = false\n const next = draft.value.trim()\n if (next !== '' && next !== props.item.title) emit('rename', next)\n}\n</script>\n\n<template>\n <li\n class=\"flex flex-col gap-1.5 rounded-md border border-[var(--sk-border)] p-1.5 data-[selected=true]:border-[var(--sk-primary)]\"\n :data-selected=\"selected\"\n data-image-studio-library-tile\n >\n <div class=\"block overflow-hidden rounded bg-[var(--sk-bg-elevated)]\">\n <img :src=\"item.url\" :alt=\"title\" class=\"aspect-square w-full object-cover\" draggable=\"false\">\n </div>\n <div class=\"flex min-w-0 flex-col\">\n <UInput\n v-if=\"editing\"\n v-model=\"draft\"\n size=\"xs\"\n autofocus\n :aria-label=\"t('imageStudio.dialog.library.rename')\"\n data-image-studio-library-rename\n @keydown.enter.prevent=\"commitRename\"\n @keydown.esc.prevent.stop=\"editing = false\"\n @blur=\"editing = false\"\n />\n <span v-else class=\"truncate text-xs font-medium text-[var(--sk-fg-highlighted)]\" :title=\"title\">{{ title }}</span>\n <span v-if=\"item.subtitle\" class=\"truncate text-xs text-[var(--sk-muted)]\" :title=\"item.subtitle\">{{ item.subtitle }}</span>\n </div>\n <div class=\"flex flex-wrap items-center justify-between gap-1\">\n <UButton\n :label=\"t('imageStudio.dialog.tile.use')\"\n :icon=\"selected ? 'i-lucide-check' : undefined\"\n size=\"xs\"\n color=\"primary\"\n :variant=\"selected ? 'solid' : 'outline'\"\n :aria-pressed=\"selected\"\n @click=\"emit('use')\"\n />\n <UButton\n :label=\"t('imageStudio.dialog.library.reference')\"\n size=\"xs\"\n color=\"neutral\"\n variant=\"outline\"\n :disabled=\"held\"\n @click=\"emit('reference')\"\n />\n <span class=\"flex items-center\">\n <UButton\n v-if=\"renamable\"\n icon=\"i-lucide-pencil\"\n size=\"xs\"\n color=\"neutral\"\n variant=\"ghost\"\n :aria-label=\"t('imageStudio.dialog.library.rename')\"\n @click=\"startRename\"\n />\n <UButton\n v-if=\"removable\"\n icon=\"i-lucide-trash-2\"\n size=\"xs\"\n color=\"neutral\"\n variant=\"ghost\"\n :aria-label=\"t('imageStudio.dialog.library.remove')\"\n @click=\"emit('remove')\"\n />\n </span>\n </div>\n </li>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAWA,MAAM,QAAQ;EACd,MAAM,OAAO;EAEb,MAAM,EAAE,QAAQ,SAAS,OAAO,WAAW,SAAS;EACpD,MAAM,EAAE,MAAM,cAAc;EAE5B,MAAM,QAAQ,eAAe,MAAM,KAAK,SAAS,EAAE,kCAAkC,CAAC;EAEtF,MAAM,UAAU,IAAI,KAAK;EACzB,MAAM,QAAQ,IAAI,EAAE;EAEpB,SAAS,cAAc;GACrB,MAAM,QAAQ,MAAM,KAAK;GACzB,QAAQ,QAAQ;EAClB;EAEA,SAAS,eAAe;GACtB,IA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,GAAA;MAPC,OAAOA,MAAA,CAAA,CAAC,CAAA,6BAAA;MACR,MAAM,QAAA,WAAQ,mBAAsB,KAAA;MACrC,MAAK;MACL,OAAM;MACL,SAAS,QAAA,WAAQ,UAAA;MACjB,gBAAc,QAAA;MACd,SAAK,OAAA,OAAA,OAAA,MAAA,WAAE,KAAI,KAAA;;;;;;;KAEdK,YAOEL,MAAA,OAAA,GAAA;MANC,OAAOA,MAAA,CAAA,CAAC,CAAA,sCAAA;MACT,MAAK;MACL,OAAM;MACN,SAAQ;MACP,UAAU,QAAA;MACV,SAAK,OAAA,OAAA,OAAA,MAAA,WAAE,KAAI,WAAA;;KAEdF,mBAmBO,QAnBP,YAmBO,CAjBG,QAAA,aADRF,UAAA,GAAAG,YAQEC,MAAA,OAAA,GAAA;;MANA,MAAK;MACL,MAAK;MACL,OAAM;MACN,SAAQ;MACP,cAAYA,MAAA,CAAA,CAAC,CAAA,mCAAA;MACb,SAAO;KAGF,GAAA,MAAA,GAAA,CAAA,YAAA,CAAA,KAAAI,mBAAA,QAAA,IAAA,GAAA,QAAA,aADRR,UAAA,GAAAG,YAQEC,MAAA,OAAA,GAAA;;MANA,MAAK;MACL,MAAK;MACL,OAAM;MACN,SAAQ;MACP,cAAYA,MAAA,CAAA,CAAC,CAAA,mCAAA;MACb,SAAK,OAAA,OAAA,OAAA,MAAA,WAAE,KAAI,QAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ImageStudioView.js","names":["selected","node","editor","_openBlock","_createBlock","_unref","_normalizeClass","_withCtx","_createElementVNode","_createElementBlock","_createVNode","_toDisplayString","_createCommentVNode","ImageStudioDialog"],"sources":["../../../../src/features/image-studio/components/ImageStudioView.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { NodeViewWrapper, nodeViewProps } from '@tiptap/vue-3'\nimport { computed, onBeforeUnmount, ref, shallowRef, toRaw } from 'vue'\nimport { editorEntryOf } from '../../../core'\nimport { useUiKit } from '../../../vue/kit/use-ui-kit'\nimport { useEditorI18n } from '../../../vue/use-editor-i18n'\nimport { useNotifier } from '../../../vue/use-notifier'\nimport { SCRATCH_DOCUMENT_ID } from '../../media/assets'\nimport { createImageStudioNodeStore, type ImageStudioNodeStore } from '../node-store'\nimport { normalizeImageStudioState } from '../state'\nimport ImageStudioDialog from './ImageStudioDialog.vue'\n\nconst props = defineProps(nodeViewProps)\n\nconst { Button: UButton, Icon: UIcon } = useUiKit()\nconst { t } = useEditorI18n()\nconst notify = useNotifier(() => props.editor)\n\nconst studio = computed(() => normalizeImageStudioState(props.node.attrs.studio))\nconst description = computed(() => studio.value.description.trim())\n\n// The store (and with it the
|
|
1
|
+
{"version":3,"file":"ImageStudioView.js","names":["selected","node","editor","_openBlock","_createBlock","_unref","_normalizeClass","_withCtx","_createElementVNode","_createElementBlock","_createVNode","_toDisplayString","_createCommentVNode","ImageStudioDialog"],"sources":["../../../../src/features/image-studio/components/ImageStudioView.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { NodeViewWrapper, nodeViewProps } from '@tiptap/vue-3'\nimport { computed, onBeforeUnmount, ref, shallowRef, toRaw } from 'vue'\nimport { editorEntryOf } from '../../../core'\nimport { useUiKit } from '../../../vue/kit/use-ui-kit'\nimport { useEditorI18n } from '../../../vue/use-editor-i18n'\nimport { useNotifier } from '../../../vue/use-notifier'\nimport { SCRATCH_DOCUMENT_ID } from '../../media/assets'\nimport { createImageStudioNodeStore, type ImageStudioNodeStore } from '../node-store'\nimport { normalizeImageStudioState } from '../state'\nimport ImageStudioDialog from './ImageStudioDialog.vue'\n\nconst props = defineProps(nodeViewProps)\n\nconst { Button: UButton, Icon: UIcon } = useUiKit()\nconst { t } = useEditorI18n()\nconst notify = useNotifier(() => props.editor)\n\nconst studio = computed(() => normalizeImageStudioState(props.node.attrs.studio))\nconst description = computed(() => studio.value.description.trim())\n\n// The store (and with it the prompt blocks list) is built when the studio opens first and lives as long as the view.\nconst open = ref(false)\nconst store = shallowRef<ImageStudioNodeStore>()\n\n/** Opens the studio dialog; a read-only editor opens none, a backend without image generation explains itself. */\nfunction openStudio() {\n if (!props.editor.isEditable) return\n const ctx = editorEntryOf(toRaw(props.editor))?.ctx\n const backend = ctx?.backend.images\n if (!ctx || !backend) {\n notify({ id: 'image-studio.unavailable', title: t('imageStudio.action.notConfigured'), kind: 'warning' })\n return\n }\n store.value ??= createImageStudioNodeStore({\n editor: toRaw(props.editor),\n getPos: props.getPos,\n backend,\n documentId: ctx.documentId ?? SCRATCH_DOCUMENT_ID,\n })\n open.value = true\n}\n\nonBeforeUnmount(() => store.value?.dispose())\n</script>\n\n<template>\n <NodeViewWrapper\n as=\"figure\"\n data-image-studio-block\n :class=\"['my-3 flex flex-col gap-2 rounded-md', { 'outline-2 outline-offset-2 outline-[var(--sk-primary)]': selected }]\"\n @dblclick=\"openStudio\"\n @sk-image-studio-open=\"openStudio\"\n >\n <div class=\"flex flex-col gap-2\" contenteditable=\"false\">\n <img\n v-if=\"node.attrs.src\"\n :src=\"node.attrs.src\"\n :alt=\"node.attrs.alt || description\"\n class=\"m-0 max-w-full rounded-md\"\n >\n <div\n v-else\n class=\"flex min-h-32 flex-col items-center justify-center gap-2 rounded-md border border-dashed border-[var(--sk-border)] p-4 text-center text-sm\"\n >\n <UIcon name=\"i-lucide-image-plus\" class=\"size-6 shrink-0 text-[var(--sk-fg-dimmed)]\" />\n <span v-if=\"description\" class=\"whitespace-pre-wrap text-[var(--sk-muted)]\">{{ description }}</span>\n <span v-else class=\"text-[var(--sk-fg-dimmed)]\">{{ t('imageStudio.node.noDescription') }}</span>\n </div>\n <figcaption v-if=\"node.attrs.src && description\" class=\"whitespace-pre-wrap px-1 text-sm text-[var(--sk-muted)]\">\n {{ description }}\n </figcaption>\n <div v-if=\"editor.isEditable\" class=\"flex\">\n <UButton\n :label=\"t('imageStudio.node.open')\"\n icon=\"i-lucide-wand-sparkles\"\n size=\"xs\"\n color=\"neutral\"\n variant=\"soft\"\n @click=\"openStudio\"\n />\n </div>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,OAAA;;MAHE,KAAKR,KAAAA,KAAK,MAAM;MAChB,KAAKA,KAAAA,KAAK,MAAM,OAAO,YAAA;MACxB,OAAM;KAER,GAAA,MAAA,GAAA,UAAA,MAAAE,UAAA,GAAAM,mBAOM,OAPN,YAOM,CAHJC,YAAuFL,MAAA,KAAA,GAAA;MAAhF,MAAK;MAAsB,OAAM;KAC5B,CAAA,GAAA,YAAA,SAAZF,UAAA,GAAAM,mBAAoG,QAApG,YAAoGE,gBAArB,YAAA,KAAW,GAAA,CAAA,MAC1FR,UAAA,GAAAM,mBAAgG,QAAhG,YAAgGE,gBAA7CN,MAAA,CAAA,CAAC,CAAA,gCAAA,CAAA,GAAA,CAAA,EAAA,CAAA;KAEpCJ,KAAAA,KAAK,MAAM,OAAO,YAAA,SAApCE,UAAA,GAAAM,mBAEa,cAFb,YAEaE,gBADR,YAAA,KAAW,GAAA,CAAA,KAAAC,mBAAA,QAAA,IAAA;KAELV,KAAAA,OAAO,cAAlBC,UAAA,GAAAM,mBASM,OATN,YASM,CARJC,YAOEL,MAAA,OAAA,GAAA;MANC,OAAOA,MAAA,CAAA,CAAC,CAAA,uBAAA;MACT,MAAK;MACL,MAAK;MACL,OAAM;MACN,SAAQ;MACP,SAAO;;IAKN,CAAA,GAAA,MAAA,SADRF,UAAA,GAAAC,YAKES,aAAA;;KAHQ,MAAM,KAAA;KAAA,iBAAA,OAAA,OAAA,OAAA,MAAA,WAAA,KAAI,QAAA;KACjB,OAAO,MAAA;KACP,OAAOR,MAAA,CAAA,CAAC,CAAA,8BAAA"}
|
|
@@ -13,7 +13,7 @@ export interface ImageStudioUi {
|
|
|
13
13
|
*/
|
|
14
14
|
export declare const IMAGE_STUDIO_OPEN = "sk-image-studio-open";
|
|
15
15
|
/**
|
|
16
|
-
* The Bild-Studio block (`imageStudio` node: a picture with its description,
|
|
16
|
+
* The Bild-Studio block (`imageStudio` node: a picture with its description, prompt blocks, references, previous
|
|
17
17
|
* generations and chat log in one `studio` attribute), the `/` entry `bild-studio` that inserts an empty one, offered
|
|
18
18
|
* where the caret has `insert.imageStudio`, and the block action `image-studio.open` («Im Bild-Studio öffnen») that asks
|
|
19
19
|
* the block's view to open the studio dialog. The node view and the dialog come from the framework binding (`ui`).
|
|
@@ -28,7 +28,7 @@ const blockActions = (ctx) => [{
|
|
|
28
28
|
}
|
|
29
29
|
}];
|
|
30
30
|
/**
|
|
31
|
-
* The Bild-Studio block (`imageStudio` node: a picture with its description,
|
|
31
|
+
* The Bild-Studio block (`imageStudio` node: a picture with its description, prompt blocks, references, previous
|
|
32
32
|
* generations and chat log in one `studio` attribute), the `/` entry `bild-studio` that inserts an empty one, offered
|
|
33
33
|
* where the caret has `insert.imageStudio`, and the block action `image-studio.open` («Im Bild-Studio öffnen») that asks
|
|
34
34
|
* the block's view to open the studio dialog. The node view and the dialog come from the framework binding (`ui`).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"feature.js","names":[],"sources":["../../../src/features/image-studio/feature.ts"],"sourcesContent":["import type { NodeViewRenderer } from '@tiptap/core'\nimport { type BlockAction, command, type CommandDef, type EditorFeature, type FeatureContext } from '../../core'\nimport { ABILITY } from '../../core/schema'\nimport { ImageStudioNode, imageStudioSchemaExtensions } from './schema'\n\n/** What a framework binding supplies to the Bild-Studio feature. */\nexport interface ImageStudioUi {\n /** The block's view of the framework; without one the node renders as the plain `<img>` of its HTML form. */\n nodeView?: NodeViewRenderer\n}\n\n/**\n * The event the `image-studio.open` block action fires on the block's node view element; the view answers it by opening\n * the studio dialog. A node view that does not listen (a headless editor) ignores it.\n */\nexport const IMAGE_STUDIO_OPEN = 'sk-image-studio-open'\n\nconst commands = (ctx: FeatureContext): CommandDef<never>[] => [\n command({\n id: 'imageStudio',\n slash: { id: 'bild-studio' },\n creates: { type: 'imageStudio' },\n icon: 'i-lucide-image-plus',\n label: ctx.t('imageStudio.slash.insert'),\n ability: ABILITY.imageStudio,\n command: c => c.insertImageStudio(),\n }),\n]\n\nconst blockActions = (ctx: FeatureContext): BlockAction[] => [{\n id: 'image-studio.open',\n label: ctx.t('imageStudio.action.open'),\n icon: 'i-lucide-wand-sparkles',\n isVisible: block => block.node.type.name === 'imageStudio',\n placement: 'both',\n run: (block) => {\n const dom = block.editor.view.nodeDOM(block.pos)\n if (dom instanceof HTMLElement) dom.dispatchEvent(new CustomEvent(IMAGE_STUDIO_OPEN))\n },\n}]\n\n/**\n * The Bild-Studio block (`imageStudio` node: a picture with its description,
|
|
1
|
+
{"version":3,"file":"feature.js","names":[],"sources":["../../../src/features/image-studio/feature.ts"],"sourcesContent":["import type { NodeViewRenderer } from '@tiptap/core'\nimport { type BlockAction, command, type CommandDef, type EditorFeature, type FeatureContext } from '../../core'\nimport { ABILITY } from '../../core/schema'\nimport { ImageStudioNode, imageStudioSchemaExtensions } from './schema'\n\n/** What a framework binding supplies to the Bild-Studio feature. */\nexport interface ImageStudioUi {\n /** The block's view of the framework; without one the node renders as the plain `<img>` of its HTML form. */\n nodeView?: NodeViewRenderer\n}\n\n/**\n * The event the `image-studio.open` block action fires on the block's node view element; the view answers it by opening\n * the studio dialog. A node view that does not listen (a headless editor) ignores it.\n */\nexport const IMAGE_STUDIO_OPEN = 'sk-image-studio-open'\n\nconst commands = (ctx: FeatureContext): CommandDef<never>[] => [\n command({\n id: 'imageStudio',\n slash: { id: 'bild-studio' },\n creates: { type: 'imageStudio' },\n icon: 'i-lucide-image-plus',\n label: ctx.t('imageStudio.slash.insert'),\n ability: ABILITY.imageStudio,\n command: c => c.insertImageStudio(),\n }),\n]\n\nconst blockActions = (ctx: FeatureContext): BlockAction[] => [{\n id: 'image-studio.open',\n label: ctx.t('imageStudio.action.open'),\n icon: 'i-lucide-wand-sparkles',\n isVisible: block => block.node.type.name === 'imageStudio',\n placement: 'both',\n run: (block) => {\n const dom = block.editor.view.nodeDOM(block.pos)\n if (dom instanceof HTMLElement) dom.dispatchEvent(new CustomEvent(IMAGE_STUDIO_OPEN))\n },\n}]\n\n/**\n * The Bild-Studio block (`imageStudio` node: a picture with its description, prompt blocks, references, previous\n * generations and chat log in one `studio` attribute), the `/` entry `bild-studio` that inserts an empty one, offered\n * where the caret has `insert.imageStudio`, and the block action `image-studio.open` («Im Bild-Studio öffnen») that asks\n * the block's view to open the studio dialog. The node view and the dialog come from the framework binding (`ui`).\n * Works without the `images` backend capability: the view then explains that generation is not set up instead of opening.\n */\nexport function imageStudioFeatureCore(ui: ImageStudioUi = {}): EditorFeature<never> {\n const { nodeView } = ui\n return {\n id: 'image-studio',\n dimension: 'content',\n schemaExtensions: imageStudioSchemaExtensions,\n extensions: () => [nodeView\n ? ImageStudioNode.extend({\n addNodeView(): NodeViewRenderer {\n return nodeView\n },\n })\n : ImageStudioNode],\n commands,\n blockActions,\n }\n}\n"],"mappings":";;;;;;;;AAeA,MAAa,oBAAoB;AAEjC,MAAM,YAAY,QAA6C,CAC7D,QAAQ;CACN,IAAI;CACJ,OAAO,EAAE,IAAI,cAAc;CAC3B,SAAS,EAAE,MAAM,cAAc;CAC/B,MAAM;CACN,OAAO,IAAI,EAAE,0BAA0B;CACvC,SAAS,QAAQ;CACjB,UAAS,MAAK,EAAE,kBAAkB;AACpC,CAAC,CACH;AAEA,MAAM,gBAAgB,QAAuC,CAAC;CAC5D,IAAI;CACJ,OAAO,IAAI,EAAE,yBAAyB;CACtC,MAAM;CACN,YAAW,UAAS,MAAM,KAAK,KAAK,SAAS;CAC7C,WAAW;CACX,MAAM,UAAU;EACd,MAAM,MAAM,MAAM,OAAO,KAAK,QAAQ,MAAM,GAAG;EAC/C,IAAI,eAAe,aAAa,IAAI,cAAc,IAAI,YAAY,iBAAiB,CAAC;CACtF;AACF,CAAC;;;;;;;;AASD,SAAgB,uBAAuB,KAAoB,CAAC,GAAyB;CACnF,MAAM,EAAE,aAAa;CACrB,OAAO;EACL,IAAI;EACJ,WAAW;EACX,kBAAkB;EAClB,kBAAkB,CAAC,WACf,gBAAgB,OAAO,EACrB,cAAgC;GAC9B,OAAO;EACT,EACF,CAAC,IACD,eAAe;EACnB;EACA;CACF;AACF"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ImageStudioImage, ImageStudioPromptBlock } from "../../core/backend-types.js";
|
|
2
2
|
import { IMAGE_STUDIO_OPEN, ImageStudioUi, imageStudioFeatureCore } from "./feature.js";
|
|
3
|
-
import { EMPTY_IMAGE_STUDIO_STATE, ImageStudioState, ImageStudioTurn, addGeneration, addReference, isEmptyImageStudioState, normalizeImageStudioState, removeImage, select, selectedImage, setDescription, toggleImage, togglePromptBlock } from "./state.js";
|
|
3
|
+
import { EMPTY_IMAGE_STUDIO_STATE, ImageStudioState, ImageStudioTurn, addGeneration, addReference, adoptImage, isEmptyImageStudioState, normalizeImageStudioState, removeImage, select, selectedImage, setDescription, toggleImage, togglePromptBlock } from "./state.js";
|
|
4
4
|
import { ImageStudioAttrs, ImageStudioNode, imageStudioSchemaExtensions } from "./schema.js";
|
|
5
|
-
|
|
5
|
+
import { ImageStudioLibrary, ImageStudioLibraryFacet, ImageStudioLibraryItem, ImageStudioLibraryQuery } from "./library.js";
|
|
6
|
+
export { EMPTY_IMAGE_STUDIO_STATE, IMAGE_STUDIO_OPEN, type ImageStudioAttrs, type ImageStudioImage, type ImageStudioLibrary, type ImageStudioLibraryFacet, type ImageStudioLibraryItem, type ImageStudioLibraryQuery, ImageStudioNode, type ImageStudioPromptBlock, type ImageStudioState, type ImageStudioTurn, type ImageStudioUi, addGeneration, addReference, adoptImage, imageStudioFeatureCore, imageStudioSchemaExtensions, isEmptyImageStudioState, normalizeImageStudioState, removeImage, select, selectedImage, setDescription, toggleImage, togglePromptBlock };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EMPTY_IMAGE_STUDIO_STATE, addGeneration, addReference, isEmptyImageStudioState, normalizeImageStudioState, removeImage, select, selectedImage, setDescription, toggleImage, togglePromptBlock } from "./state.js";
|
|
1
|
+
import { EMPTY_IMAGE_STUDIO_STATE, addGeneration, addReference, adoptImage, isEmptyImageStudioState, normalizeImageStudioState, removeImage, select, selectedImage, setDescription, toggleImage, togglePromptBlock } from "./state.js";
|
|
2
2
|
import { ImageStudioNode, imageStudioSchemaExtensions } from "./schema.js";
|
|
3
3
|
import { IMAGE_STUDIO_OPEN, imageStudioFeatureCore } from "./feature.js";
|
|
4
|
-
export { EMPTY_IMAGE_STUDIO_STATE, IMAGE_STUDIO_OPEN, ImageStudioNode, addGeneration, addReference, imageStudioFeatureCore, imageStudioSchemaExtensions, isEmptyImageStudioState, normalizeImageStudioState, removeImage, select, selectedImage, setDescription, toggleImage, togglePromptBlock };
|
|
4
|
+
export { EMPTY_IMAGE_STUDIO_STATE, IMAGE_STUDIO_OPEN, ImageStudioNode, addGeneration, addReference, adoptImage, imageStudioFeatureCore, imageStudioSchemaExtensions, isEmptyImageStudioState, normalizeImageStudioState, removeImage, select, selectedImage, setDescription, toggleImage, togglePromptBlock };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { ImageStudioImage } from "../../core/backend-types.js";
|
|
2
|
+
import "./state.js";
|
|
3
|
+
//#region src/features/image-studio/library.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* One filter of the gallery (a Kapitel select, say); the dialog renders it as a select. Option values must be
|
|
6
|
+
* non-empty: select primitives reserve the empty string, so an «all» option needs a value of its own (`'alle'`).
|
|
7
|
+
*/
|
|
8
|
+
export interface ImageStudioLibraryFacet {
|
|
9
|
+
readonly id: string;
|
|
10
|
+
readonly label: string;
|
|
11
|
+
readonly options: readonly {
|
|
12
|
+
readonly value: string;
|
|
13
|
+
readonly label: string;
|
|
14
|
+
}[];
|
|
15
|
+
}
|
|
16
|
+
/** What the gallery shows: the search text and the chosen option (`value`) of each facet, by facet id. */
|
|
17
|
+
export interface ImageStudioLibraryQuery {
|
|
18
|
+
readonly search: string;
|
|
19
|
+
readonly facets: Readonly<Record<string, string>>;
|
|
20
|
+
}
|
|
21
|
+
/** An image of the gallery; `subtitle` is a host line under the title (origin, usage, Kapitel). */
|
|
22
|
+
export interface ImageStudioLibraryItem extends ImageStudioImage {
|
|
23
|
+
readonly subtitle?: string;
|
|
24
|
+
}
|
|
25
|
+
export interface ImageStudioLibrary {
|
|
26
|
+
/** The host's filter facets; the first option of each is the default. Read each time the gallery tab opens. */
|
|
27
|
+
facets: () => readonly ImageStudioLibraryFacet[];
|
|
28
|
+
list: (query: ImageStudioLibraryQuery, signal: AbortSignal) => Promise<readonly ImageStudioLibraryItem[]>;
|
|
29
|
+
/** Resolves with the renamed item; absent = no renaming. */
|
|
30
|
+
rename?: (id: string, title: string) => Promise<ImageStudioLibraryItem>;
|
|
31
|
+
/** Rejects with an Error whose message the dialog shows (asset in use, say); absent = no deleting. */
|
|
32
|
+
remove?: (id: string) => Promise<void>;
|
|
33
|
+
}
|
|
34
|
+
//#endregion
|
|
35
|
+
//# sourceMappingURL=library.d.ts.map
|
|
@@ -16,9 +16,9 @@ export interface ImageStudioNodeCoreOptions {
|
|
|
16
16
|
/** What a view renders from a node's studio: the observable part of an `ImageStudioNodeCore`. */
|
|
17
17
|
export interface ImageStudioNodeSnapshot {
|
|
18
18
|
readonly state: ImageStudioState;
|
|
19
|
-
/** The managed list of
|
|
19
|
+
/** The managed list of prompt blocks, as the backend answered; empty until then. */
|
|
20
20
|
readonly promptBlocks: readonly ImageStudioPromptBlock[];
|
|
21
|
-
/** The
|
|
21
|
+
/** The prompt blocks could not be loaded: the message. */
|
|
22
22
|
readonly problem: string | undefined;
|
|
23
23
|
}
|
|
24
24
|
/**
|
|
@@ -38,7 +38,7 @@ export interface ImageStudioNodeCore extends ReadonlyStore<ImageStudioNodeSnapsh
|
|
|
38
38
|
* The core of the store of one `imageStudio` node: `state` follows the node's `studio` attribute (re-read on every
|
|
39
39
|
* editor transaction, so undo, collaboration and other writers show), `update` writes it back through
|
|
40
40
|
* `setImageStudioState` as one transaction (one undo step; the node's `src` follows the selected image), and
|
|
41
|
-
* `generate`, `upload` and the
|
|
41
|
+
* `generate`, `upload` and the prompt blocks go to `backend.images`. Listeners run synchronously. Call `dispose`
|
|
42
42
|
* when the view goes.
|
|
43
43
|
*/
|
|
44
44
|
export declare function createImageStudioNodeCore(options: ImageStudioNodeCoreOptions): ImageStudioNodeCore;
|
|
@@ -5,7 +5,7 @@ const NO_IMAGES = "@ecsplico/editor: the backend has no images capability";
|
|
|
5
5
|
* The core of the store of one `imageStudio` node: `state` follows the node's `studio` attribute (re-read on every
|
|
6
6
|
* editor transaction, so undo, collaboration and other writers show), `update` writes it back through
|
|
7
7
|
* `setImageStudioState` as one transaction (one undo step; the node's `src` follows the selected image), and
|
|
8
|
-
* `generate`, `upload` and the
|
|
8
|
+
* `generate`, `upload` and the prompt blocks go to `backend.images`. Listeners run synchronously. Call `dispose`
|
|
9
9
|
* when the view goes.
|
|
10
10
|
*/
|
|
11
11
|
function createImageStudioNodeCore(options) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node-core.js","names":[],"sources":["../../../src/features/image-studio/node-core.ts"],"sourcesContent":["import type { Editor } from '@tiptap/core'\nimport type { EditorBackend } from '../../core/backend'\nimport type { ReadonlyStore } from '../../core/store'\nimport { EMPTY_IMAGE_STUDIO_STATE, type ImageStudioImage, type ImageStudioPromptBlock, type ImageStudioState, normalizeImageStudioState } from './state'\n\nexport interface ImageStudioNodeCoreOptions {\n editor: Editor\n /** Position of the `imageStudio` node (a node view's `getPos`); `undefined` once the node is gone. */\n getPos: () => number | undefined\n /** The backend's image port; `undefined` (backend without the `images` capability) makes `generate` and `upload` reject. */\n backend: EditorBackend['images']\n /** Document whose package stores the uploaded references. */\n documentId: string\n}\n\n/** What a view renders from a node's studio: the observable part of an `ImageStudioNodeCore`. */\nexport interface ImageStudioNodeSnapshot {\n readonly state: ImageStudioState\n /** The managed list of
|
|
1
|
+
{"version":3,"file":"node-core.js","names":[],"sources":["../../../src/features/image-studio/node-core.ts"],"sourcesContent":["import type { Editor } from '@tiptap/core'\nimport type { EditorBackend } from '../../core/backend'\nimport type { ReadonlyStore } from '../../core/store'\nimport { EMPTY_IMAGE_STUDIO_STATE, type ImageStudioImage, type ImageStudioPromptBlock, type ImageStudioState, normalizeImageStudioState } from './state'\n\nexport interface ImageStudioNodeCoreOptions {\n editor: Editor\n /** Position of the `imageStudio` node (a node view's `getPos`); `undefined` once the node is gone. */\n getPos: () => number | undefined\n /** The backend's image port; `undefined` (backend without the `images` capability) makes `generate` and `upload` reject. */\n backend: EditorBackend['images']\n /** Document whose package stores the uploaded references. */\n documentId: string\n}\n\n/** What a view renders from a node's studio: the observable part of an `ImageStudioNodeCore`. */\nexport interface ImageStudioNodeSnapshot {\n readonly state: ImageStudioState\n /** The managed list of prompt blocks, as the backend answered; empty until then. */\n readonly promptBlocks: readonly ImageStudioPromptBlock[]\n /** The prompt blocks could not be loaded: the message. */\n readonly problem: string | undefined\n}\n\n/**\n * The framework-free store of one `imageStudio` node (`createImageStudioNodeCore`): an observable `ImageStudioNodeSnapshot`\n * (`get`/`subscribe`, see `ReadonlyStore`; every change replaces the snapshot) and the actions the dialog needs.\n * The Vue and React bindings wrap it into the store shape of their dialog.\n */\nexport interface ImageStudioNodeCore extends ReadonlyStore<ImageStudioNodeSnapshot> {\n /** Writes `next` into the node's `studio` attribute as one transaction (`src` follows the selected image). */\n update: (next: ImageStudioState) => void\n generate: (instruction: string, signal: AbortSignal) => Promise<ImageStudioImage>\n upload: (file: File) => Promise<ImageStudioImage>\n /** Stops following the editor and ignores the answers still outstanding; call when the node view unmounts. */\n dispose: () => void\n}\n\n// What a store without the backend's `images` port rejects with (the node view does not open one without the port).\nconst NO_IMAGES = '@ecsplico/editor: the backend has no images capability'\n\n/**\n * The core of the store of one `imageStudio` node: `state` follows the node's `studio` attribute (re-read on every\n * editor transaction, so undo, collaboration and other writers show), `update` writes it back through\n * `setImageStudioState` as one transaction (one undo step; the node's `src` follows the selected image), and\n * `generate`, `upload` and the prompt blocks go to `backend.images`. Listeners run synchronously. Call `dispose`\n * when the view goes.\n */\nexport function createImageStudioNodeCore(options: ImageStudioNodeCoreOptions): ImageStudioNodeCore {\n const { editor, getPos, backend, documentId } = options\n let snapshot: ImageStudioNodeSnapshot = { state: EMPTY_IMAGE_STUDIO_STATE, promptBlocks: [], problem: undefined }\n const listeners = new Set<(value: ImageStudioNodeSnapshot) => void>()\n let disposed = false\n // The attribute value `state` was normalized from: a transaction that left it alone keeps `state` as it is.\n let source: unknown\n\n function publish(patch: Partial<ImageStudioNodeSnapshot>): void {\n snapshot = { ...snapshot, ...patch }\n // A copy: listeners may (un)subscribe while being notified.\n for (const listener of [...listeners]) listener(snapshot)\n }\n\n function sync(): void {\n const pos = getPos()\n const node = pos === undefined || editor.isDestroyed ? null : editor.state.doc.nodeAt(pos)\n if (node?.type.name !== 'imageStudio' || node.attrs.studio === source) return\n source = node.attrs.studio\n publish({ state: normalizeImageStudioState(source) })\n }\n\n editor.on('transaction', sync)\n sync()\n\n if (backend) {\n backend.promptBlocks().then(\n (blocks) => { if (!disposed) publish({ promptBlocks: blocks }) },\n (error: unknown) => { if (!disposed) publish({ problem: error instanceof Error ? error.message : String(error) }) },\n )\n }\n\n return {\n get: () => snapshot,\n subscribe(listener) {\n listeners.add(listener)\n return () => { listeners.delete(listener) }\n },\n update(next) {\n const pos = getPos()\n if (pos === undefined || editor.isDestroyed) return\n editor.commands.setImageStudioState(pos, next)\n },\n generate(instruction, signal) {\n if (!backend) return Promise.reject(new Error(NO_IMAGES))\n const { description, promptBlockIds, references, generations } = snapshot.state\n const referenceUrls = [...references, ...generations].filter(image => image.active).map(image => image.url)\n return backend.generate({ description, instruction, promptBlockIds: [...promptBlockIds], referenceUrls }, signal)\n },\n upload(file): Promise<ImageStudioImage> {\n return backend ? backend.upload(documentId, file) : Promise.reject(new Error(NO_IMAGES))\n },\n dispose() {\n disposed = true\n listeners.clear()\n editor.off('transaction', sync)\n },\n }\n}\n"],"mappings":";;AAuCA,MAAM,YAAY;;;;;;;;AASlB,SAAgB,0BAA0B,SAA0D;CAClG,MAAM,EAAE,QAAQ,Q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gB,SAAS;GAC1E,MAAM,gBAAgB,CAAC,GAAG,YAAY,GAAG,WAAW,CAAC,CAAC,QAAO,UAAS,MAAM,MAAM,CAAC,CAAC,KAAI,UAAS,MAAM,GAAG;GAC1G,OAAO,QAAQ,SAAS;IAAE;IAAa;IAAa,gBAAgB,CAAC,GAAG,cAAc;IAAG;GAAc,GAAG,MAAM;EAClH;EACA,OAAO,MAAiC;GACtC,OAAO,UAAU,QAAQ,OAAO,YAAY,IAAI,IAAI,QAAQ,uBAAO,IAAI,MAAM,SAAS,CAAC;EACzF;EACA,UAAU;GACR,WAAW;GACX,UAAU,MAAM;GAChB,OAAO,IAAI,eAAe,IAAI;EAChC;CACF;AACF"}
|
|
@@ -11,7 +11,7 @@ export interface ImageStudioNodeStore extends ImageStudioStore {
|
|
|
11
11
|
* The `ImageStudioStore` of one `imageStudio` node: `state` follows the node's `studio` attribute (re-read on every
|
|
12
12
|
* editor transaction, so undo, collaboration and other writers show), `update` writes it back through
|
|
13
13
|
* `setImageStudioState` as one transaction (one undo step; the node's `src` follows the selected image), and
|
|
14
|
-
* `generate`, `upload` and the
|
|
14
|
+
* `generate`, `upload` and the prompt blocks go to `backend.images`. Call `dispose` when the view goes.
|
|
15
15
|
* The Vue wrapper of `createImageStudioNodeCore`.
|
|
16
16
|
*/
|
|
17
17
|
export declare function createImageStudioNodeStore(options: ImageStudioNodeStoreOptions): ImageStudioNodeStore;
|
|
@@ -5,7 +5,7 @@ import { shallowRef } from "vue";
|
|
|
5
5
|
* The `ImageStudioStore` of one `imageStudio` node: `state` follows the node's `studio` attribute (re-read on every
|
|
6
6
|
* editor transaction, so undo, collaboration and other writers show), `update` writes it back through
|
|
7
7
|
* `setImageStudioState` as one transaction (one undo step; the node's `src` follows the selected image), and
|
|
8
|
-
* `generate`, `upload` and the
|
|
8
|
+
* `generate`, `upload` and the prompt blocks go to `backend.images`. Call `dispose` when the view goes.
|
|
9
9
|
* The Vue wrapper of `createImageStudioNodeCore`.
|
|
10
10
|
*/
|
|
11
11
|
function createImageStudioNodeStore(options) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node-store.js","names":[],"sources":["../../../src/features/image-studio/node-store.ts"],"sourcesContent":["import { shallowRef } from 'vue'\nimport { createImageStudioNodeCore, type ImageStudioNodeCoreOptions } from './node-core'\nimport type { ImageStudioPromptBlock, ImageStudioState } from './state'\nimport type { ImageStudioStore } from './store'\n\nexport type ImageStudioNodeStoreOptions = ImageStudioNodeCoreOptions\n\n/** A store over one node, with the function that detaches it from the editor. */\nexport interface ImageStudioNodeStore extends ImageStudioStore {\n /** Stops following the editor and ignores the answers still outstanding; call when the node view unmounts. */\n dispose: () => void\n}\n\n/**\n * The `ImageStudioStore` of one `imageStudio` node: `state` follows the node's `studio` attribute (re-read on every\n * editor transaction, so undo, collaboration and other writers show), `update` writes it back through\n * `setImageStudioState` as one transaction (one undo step; the node's `src` follows the selected image), and\n * `generate`, `upload` and the
|
|
1
|
+
{"version":3,"file":"node-store.js","names":[],"sources":["../../../src/features/image-studio/node-store.ts"],"sourcesContent":["import { shallowRef } from 'vue'\nimport { createImageStudioNodeCore, type ImageStudioNodeCoreOptions } from './node-core'\nimport type { ImageStudioPromptBlock, ImageStudioState } from './state'\nimport type { ImageStudioStore } from './store'\n\nexport type ImageStudioNodeStoreOptions = ImageStudioNodeCoreOptions\n\n/** A store over one node, with the function that detaches it from the editor. */\nexport interface ImageStudioNodeStore extends ImageStudioStore {\n /** Stops following the editor and ignores the answers still outstanding; call when the node view unmounts. */\n dispose: () => void\n}\n\n/**\n * The `ImageStudioStore` of one `imageStudio` node: `state` follows the node's `studio` attribute (re-read on every\n * editor transaction, so undo, collaboration and other writers show), `update` writes it back through\n * `setImageStudioState` as one transaction (one undo step; the node's `src` follows the selected image), and\n * `generate`, `upload` and the prompt blocks go to `backend.images`. Call `dispose` when the view goes.\n * The Vue wrapper of `createImageStudioNodeCore`.\n */\nexport function createImageStudioNodeStore(options: ImageStudioNodeStoreOptions): ImageStudioNodeStore {\n const core = createImageStudioNodeCore(options)\n const initial = core.get()\n const state = shallowRef<ImageStudioState>(initial.state)\n const promptBlocks = shallowRef<readonly ImageStudioPromptBlock[]>(initial.promptBlocks)\n const problem = shallowRef<string | undefined>(initial.problem)\n core.subscribe((snapshot) => {\n state.value = snapshot.state\n promptBlocks.value = snapshot.promptBlocks\n problem.value = snapshot.problem\n })\n return {\n state,\n promptBlocks,\n problem,\n update: core.update,\n generate: core.generate,\n upload: core.upload,\n dispose: core.dispose,\n }\n}\n"],"mappings":";;;;;;;;;;AAoBA,SAAgB,2BAA2B,SAA4D;CACrG,MAAM,OAAO,0BAA0B,OAAO;CAC9C,MAAM,UAAU,KAAK,IAAI;CACzB,MAAM,QAAQ,WAA6B,QAAQ,KAAK;CACxD,MAAM,eAAe,WAA8C,QAAQ,YAAY;CACvF,MAAM,UAAU,WAA+B,QAAQ,OAAO;CAC9D,KAAK,WAAW,aAAa;EAC3B,MAAM,QAAQ,SAAS;EACvB,aAAa,QAAQ,SAAS;EAC9B,QAAQ,QAAQ,SAAS;CAC3B,CAAC;CACD,OAAO;EACL;EACA;EACA;EACA,QAAQ,KAAK;EACb,UAAU,KAAK;EACf,QAAQ,KAAK;EACb,SAAS,KAAK;CAChB;AACF"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ImageStudioReactStore } from "./store.js";
|
|
2
2
|
//#region src/features/image-studio/react/ImageStudioDialog.d.ts
|
|
3
3
|
/**
|
|
4
|
-
* The Bild-Studio: description and
|
|
4
|
+
* The Bild-Studio: description and prompt blocks on the left, references and previous generations in the middle,
|
|
5
5
|
* the block's image and the chat on the right. The dialog applies the reducers of `../state` to `store.state` and
|
|
6
6
|
* hands every result to `store.update`; the store only generates, uploads and persists (see `ImageStudioReactStore`).
|
|
7
7
|
*
|
|
@@ -7,15 +7,16 @@ import { Dialog, DialogContent, DialogHeader, DialogTitle } from "../../../react
|
|
|
7
7
|
import { Textarea } from "../../../react/ui/textarea.js";
|
|
8
8
|
import { Alert, AlertTitle } from "../../../react/ui/alert.js";
|
|
9
9
|
import { Switch } from "../../../react/ui/switch.js";
|
|
10
|
-
import { addGeneration, addReference, removeImage, select, selectedImage, setDescription, toggleImage, togglePromptBlock } from "../state.js";
|
|
10
|
+
import { addGeneration, addReference, adoptImage, removeImage, select, selectedImage, setDescription, toggleImage, togglePromptBlock } from "../state.js";
|
|
11
11
|
import { ImageStudioChat } from "./ImageStudioChat.js";
|
|
12
|
+
import { ImageStudioLibraryPanel } from "./ImageStudioLibraryPanel.js";
|
|
12
13
|
import { ImageStudioTile } from "./ImageStudioTile.js";
|
|
13
14
|
import { useEffect, useId, useRef, useState } from "react";
|
|
14
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
15
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
15
16
|
//#region src/features/image-studio/react/ImageStudioDialog.tsx
|
|
16
17
|
const COMMIT_DELAY_MS = 500;
|
|
17
18
|
/**
|
|
18
|
-
* The Bild-Studio: description and
|
|
19
|
+
* The Bild-Studio: description and prompt blocks on the left, references and previous generations in the middle,
|
|
19
20
|
* the block's image and the chat on the right. The dialog applies the reducers of `../state` to `store.state` and
|
|
20
21
|
* hands every result to `store.update`; the store only generates, uploads and persists (see `ImageStudioReactStore`).
|
|
21
22
|
*
|
|
@@ -139,6 +140,8 @@ function ImageStudioDialog({ open, onOpenChange, store, title }) {
|
|
|
139
140
|
}
|
|
140
141
|
}
|
|
141
142
|
}
|
|
143
|
+
const { library } = store;
|
|
144
|
+
const [tab, setTab] = useState("block");
|
|
142
145
|
function close() {
|
|
143
146
|
commitDescription();
|
|
144
147
|
abortGeneration();
|
|
@@ -146,6 +149,7 @@ function ImageStudioDialog({ open, onOpenChange, store, title }) {
|
|
|
146
149
|
}
|
|
147
150
|
useEffect(() => {
|
|
148
151
|
if (open) return;
|
|
152
|
+
setTab("block");
|
|
149
153
|
commitDescription();
|
|
150
154
|
abortGeneration();
|
|
151
155
|
}, [open]);
|
|
@@ -154,6 +158,13 @@ function ImageStudioDialog({ open, onOpenChange, store, title }) {
|
|
|
154
158
|
abortGeneration();
|
|
155
159
|
}, []);
|
|
156
160
|
const heading = "text-sm font-medium text-foreground";
|
|
161
|
+
/** A gallery item as the state holds it: without the host's `subtitle`, not active. */
|
|
162
|
+
const pick = ({ id, url, title }) => ({
|
|
163
|
+
id,
|
|
164
|
+
url,
|
|
165
|
+
title,
|
|
166
|
+
active: false
|
|
167
|
+
});
|
|
157
168
|
return /* @__PURE__ */ jsx(Dialog, {
|
|
158
169
|
open,
|
|
159
170
|
onOpenChange: (value) => {
|
|
@@ -162,6 +173,9 @@ function ImageStudioDialog({ open, onOpenChange, store, title }) {
|
|
|
162
173
|
children: /* @__PURE__ */ jsxs(DialogContent, {
|
|
163
174
|
className: "max-h-[calc(100vh-2rem)] overflow-y-auto sm:max-w-[min(72rem,calc(100vw-2rem))]",
|
|
164
175
|
"aria-describedby": void 0,
|
|
176
|
+
onEscapeKeyDown: (event) => {
|
|
177
|
+
if (event.target instanceof Element && event.target.closest("[data-image-studio-library-rename]")) event.preventDefault();
|
|
178
|
+
},
|
|
165
179
|
children: [/* @__PURE__ */ jsx(DialogHeader, { children: /* @__PURE__ */ jsx(DialogTitle, { children: title ?? t("imageStudio.dialog.title") }) }), /* @__PURE__ */ jsxs("div", {
|
|
166
180
|
className: "flex flex-col gap-3",
|
|
167
181
|
"data-image-studio-dialog": true,
|
|
@@ -226,7 +240,29 @@ function ImageStudioDialog({ open, onOpenChange, store, title }) {
|
|
|
226
240
|
}),
|
|
227
241
|
/* @__PURE__ */ jsxs("div", {
|
|
228
242
|
className: "flex min-h-0 flex-col gap-4 lg:overflow-y-auto",
|
|
229
|
-
children: [/* @__PURE__ */
|
|
243
|
+
children: [library && /* @__PURE__ */ jsx("div", {
|
|
244
|
+
className: "flex gap-1",
|
|
245
|
+
role: "tablist",
|
|
246
|
+
"data-image-studio-tabs": true,
|
|
247
|
+
children: ["block", "library"].map((name) => /* @__PURE__ */ jsx(Button, {
|
|
248
|
+
size: "sm",
|
|
249
|
+
variant: tab === name ? "default" : "ghost",
|
|
250
|
+
role: "tab",
|
|
251
|
+
"aria-selected": tab === name,
|
|
252
|
+
"data-image-studio-tab": name,
|
|
253
|
+
onClick: () => setTab(name),
|
|
254
|
+
children: t(name === "block" ? "imageStudio.dialog.tabs.block" : "imageStudio.dialog.tabs.library")
|
|
255
|
+
}, name))
|
|
256
|
+
}), library && tab === "library" ? /* @__PURE__ */ jsx(ImageStudioLibraryPanel, {
|
|
257
|
+
library,
|
|
258
|
+
state,
|
|
259
|
+
onUse: (item) => apply(adoptImage(latest.current, pick(item))),
|
|
260
|
+
onReference: (item) => apply(addReference(latest.current, pick(item))),
|
|
261
|
+
onRemoved: (id) => {
|
|
262
|
+
const current = latest.current;
|
|
263
|
+
if (current.references.some((image) => image.id === id) || current.generations.some((image) => image.id === id)) apply(removeImage(current, id));
|
|
264
|
+
}
|
|
265
|
+
}) : /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsxs("section", {
|
|
230
266
|
className: "flex flex-col gap-2 rounded-md border border-dashed border-transparent p-1 data-[dragging=true]:border-primary",
|
|
231
267
|
"data-dragging": dragging,
|
|
232
268
|
"aria-labelledby": `${uid}-references`,
|
|
@@ -314,7 +350,7 @@ function ImageStudioDialog({ open, onOpenChange, store, title }) {
|
|
|
314
350
|
className: "text-sm text-muted-foreground",
|
|
315
351
|
children: t("imageStudio.dialog.generations.empty")
|
|
316
352
|
})]
|
|
317
|
-
})]
|
|
353
|
+
})] })]
|
|
318
354
|
}),
|
|
319
355
|
/* @__PURE__ */ jsxs("div", {
|
|
320
356
|
className: "flex min-h-0 flex-col gap-3",
|
|
@@ -332,6 +368,11 @@ function ImageStudioDialog({ open, onOpenChange, store, title }) {
|
|
|
332
368
|
alt: picture.title || t("imageStudio.dialog.tile.untitled"),
|
|
333
369
|
className: "size-full object-contain",
|
|
334
370
|
"data-image-studio-preview": true
|
|
371
|
+
}) : store.placeholderUrl ? /* @__PURE__ */ jsx("img", {
|
|
372
|
+
src: store.placeholderUrl,
|
|
373
|
+
alt: "",
|
|
374
|
+
className: "size-full object-contain opacity-60",
|
|
375
|
+
"data-image-studio-placeholder": true
|
|
335
376
|
}) : /* @__PURE__ */ jsx("p", {
|
|
336
377
|
className: "text-sm text-muted-foreground",
|
|
337
378
|
children: t("imageStudio.dialog.preview.empty")
|