@ecsplico/editor 2.1.2 → 3.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 +78 -1
- package/README.md +39 -156
- package/dist/adapters/comments/drizzle.d.ts +1 -1
- package/dist/adapters/comments/record.d.ts +15 -0
- package/dist/adapters/comments/{client.js → rest-model.js} +3 -3
- package/dist/adapters/comments/rest-model.js.map +1 -0
- package/dist/adapters/comments/server.d.ts +2 -1
- package/dist/adapters/comments/server.js +2 -1
- package/dist/adapters/comments/server.js.map +1 -1
- package/dist/adapters/comments/types.d.ts +2 -2
- package/dist/adapters/document-state.d.ts +23 -0
- package/dist/adapters/document-state.js +66 -0
- package/dist/adapters/document-state.js.map +1 -0
- package/dist/adapters/documents.js +14 -11
- package/dist/adapters/documents.js.map +1 -1
- package/dist/adapters/drizzle.d.ts +2 -2
- package/dist/adapters/drizzle.js +97 -88
- package/dist/adapters/drizzle.js.map +1 -1
- package/dist/adapters/forge.d.ts +12 -7
- package/dist/adapters/forge.js +38 -45
- package/dist/adapters/forge.js.map +1 -1
- package/dist/adapters/http.d.ts +20 -0
- package/dist/adapters/http.js +68 -0
- package/dist/adapters/http.js.map +1 -0
- package/dist/adapters/index.d.ts +5 -5
- package/dist/adapters/json.d.ts +3 -3
- package/dist/adapters/json.js +58 -49
- package/dist/adapters/json.js.map +1 -1
- package/dist/adapters/memory.d.ts +21 -0
- package/dist/adapters/memory.js +53 -0
- package/dist/adapters/memory.js.map +1 -0
- package/dist/adapters/nitro.d.ts +27 -20
- package/dist/adapters/nitro.js +59 -163
- package/dist/adapters/nitro.js.map +1 -1
- package/dist/adapters/react.d.ts +55 -0
- package/dist/adapters/react.js +209 -0
- package/dist/adapters/react.js.map +1 -0
- package/dist/adapters/shared.d.ts +15 -21
- package/dist/adapters/shared.js +10 -8
- package/dist/adapters/shared.js.map +1 -1
- package/dist/adapters/vue.d.ts +15 -30
- package/dist/adapters/vue.js +36 -87
- package/dist/adapters/vue.js.map +1 -1
- package/dist/code/CodeSurface.vue.d.ts +2 -2
- package/dist/config/index.d.ts +105 -0
- package/dist/config/index.js +95 -0
- package/dist/config/index.js.map +1 -0
- package/dist/core/abilities.js +1 -0
- package/dist/core/abilities.js.map +1 -1
- package/dist/{adapters/routes.js → core/api-routes.js} +5 -3
- package/dist/core/api-routes.js.map +1 -0
- package/dist/core/backend-capability.d.ts +7 -0
- package/dist/core/backend-capability.js +17 -0
- package/dist/core/backend-capability.js.map +1 -0
- package/dist/core/backend-types.d.ts +245 -0
- package/dist/core/backend-types.js +17 -0
- package/dist/core/backend-types.js.map +1 -0
- package/dist/core/backend.d.ts +108 -0
- package/dist/core/backend.js +14 -0
- package/dist/core/backend.js.map +1 -0
- package/dist/core/block-convert.d.ts +7 -5
- package/dist/core/block-convert.js +28 -5
- package/dist/core/block-convert.js.map +1 -1
- package/dist/core/command-types.d.ts +96 -0
- package/dist/core/commands.d.ts +40 -0
- package/dist/core/commands.js +151 -0
- package/dist/core/commands.js.map +1 -0
- package/dist/core/context.d.ts +17 -20
- package/dist/core/context.js +24 -21
- package/dist/core/context.js.map +1 -1
- package/dist/core/core-feature.d.ts +22 -7
- package/dist/core/core-feature.js +51 -18
- package/dist/core/core-feature.js.map +1 -1
- package/dist/core/define-editor.d.ts +4 -3
- package/dist/core/define-editor.js +14 -7
- package/dist/core/define-editor.js.map +1 -1
- package/dist/core/document-markdown.js +12 -3
- package/dist/core/document-markdown.js.map +1 -1
- package/dist/core/editor-ui.d.ts +8 -1
- package/dist/core/editor-ui.js +9 -8
- package/dist/core/editor-ui.js.map +1 -1
- package/dist/core/extension-points.d.ts +3 -15
- package/dist/core/feature-context.d.ts +8 -7
- package/dist/core/feature-context.js +12 -11
- 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.d.ts +2 -1
- package/dist/core/fences.js +3 -2
- package/dist/core/fences.js.map +1 -1
- package/dist/core/fetch-error.d.ts +1 -1
- package/dist/core/fetch-error.js +3 -1
- package/dist/core/fetch-error.js.map +1 -1
- package/dist/core/hash.d.ts +5 -0
- package/dist/core/hash.js +11 -0
- package/dist/core/hash.js.map +1 -0
- package/dist/core/http-backend.d.ts +11 -0
- package/dist/core/http-backend.js +195 -0
- package/dist/core/http-backend.js.map +1 -0
- package/dist/core/index.d.ts +15 -9
- package/dist/core/index.js +13 -9
- package/dist/core/palette.d.ts +48 -0
- package/dist/core/palette.js +95 -0
- package/dist/core/palette.js.map +1 -0
- package/dist/core/schema/abilities.d.ts +2 -1
- package/dist/core/schema/abilities.js +5 -1
- package/dist/core/schema/abilities.js.map +1 -1
- package/dist/core/schema/index.d.ts +11 -5
- package/dist/core/schema/index.js +13 -8
- package/dist/core/schema/index.js.map +1 -1
- package/dist/core/schema/mark-flags.d.ts +8 -1
- package/dist/core/schema/of-features.d.ts +13 -0
- package/dist/core/schema/of-features.js +14 -0
- package/dist/core/schema/of-features.js.map +1 -0
- package/dist/core/slash.d.ts +8 -6
- package/dist/core/slash.js +24 -16
- package/dist/core/slash.js.map +1 -1
- package/dist/core/surface-session.js +15 -5
- package/dist/core/surface-session.js.map +1 -1
- package/dist/core/toolbar-items.d.ts +10 -4
- package/dist/core/toolbar-items.js +269 -195
- package/dist/core/toolbar-items.js.map +1 -1
- package/dist/core/transaction-guards.d.ts +21 -0
- package/dist/core/transaction-guards.js +49 -0
- package/dist/core/transaction-guards.js.map +1 -0
- package/dist/core/util.js +11 -0
- package/dist/core/util.js.map +1 -0
- package/dist/document/DocumentSurface.d.ts +1 -1
- package/dist/document/DocumentSurface.vue.d.ts +2 -2
- package/dist/features/ai/agent-op-review.d.ts +1 -1
- package/dist/features/ai/agent-op-review.js +1 -1
- package/dist/features/ai/agent-ops.js +1 -1
- package/dist/features/ai/ai-apply.d.ts +2 -2
- package/dist/features/ai/ai-apply.js +1 -1
- package/dist/features/ai/ai-review.js +1 -1
- package/dist/features/ai/ai-sse.d.ts +6 -6
- package/dist/features/ai/ai-sse.js +20 -63
- package/dist/features/ai/ai-sse.js.map +1 -1
- package/dist/features/ai/assistant.d.ts +8 -7
- package/dist/features/ai/assistant.js +3 -3
- package/dist/features/ai/assistant.js.map +1 -1
- package/dist/features/ai/block-actions.d.ts +3 -2
- package/dist/features/ai/block-actions.js +3 -2
- package/dist/features/ai/block-actions.js.map +1 -1
- package/dist/features/ai/components/AiSelectionMenu.js +1 -1
- package/dist/features/ai/components/DocumentChatAnswer.js +1 -1
- package/dist/features/ai/components/DocumentChatOps.vue.d.ts +1 -1
- package/dist/features/ai/components/SettingsModelProfiles.js +8 -8
- package/dist/features/ai/components/SettingsModelProfiles.js.map +1 -1
- package/dist/features/ai/document-chat-model.d.ts +8 -7
- 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 +1 -1
- package/dist/features/ai/feature.js +27 -14
- package/dist/features/ai/feature.js.map +1 -1
- package/dist/features/ai/ghost-autocomplete.d.ts +7 -6
- package/dist/features/ai/ghost-autocomplete.js +6 -9
- package/dist/features/ai/ghost-autocomplete.js.map +1 -1
- package/dist/features/ai/index.d.ts +4 -3
- package/dist/features/ai/index.js +10 -10
- package/dist/features/ai/model-profiles.d.ts +5 -4
- package/dist/features/ai/model-profiles.js +2 -2
- package/dist/features/ai/model-profiles.js.map +1 -1
- package/dist/features/ai/protocol/block-lines.js +1 -1
- package/dist/features/ai/protocol/block-lines.js.map +1 -1
- package/dist/features/ai/protocol/chat.js +6 -2
- package/dist/features/ai/protocol/chat.js.map +1 -1
- package/dist/features/ai/protocol/index.d.ts +3 -2
- package/dist/features/ai/protocol/models.d.ts +2 -16
- package/dist/features/ai/protocol/models.js.map +1 -1
- package/dist/features/ai/rate-limit.d.ts +1 -1
- package/dist/features/ai/rate-limit.js +3 -1
- package/dist/features/ai/rate-limit.js.map +1 -1
- package/dist/features/ai/react/AiSelectionMenu.js +2 -2
- package/dist/features/ai/react/AiSidebar.js +4 -4
- package/dist/features/ai/react/DocumentChatAnswer.js +1 -1
- package/dist/features/ai/react/DocumentChatOps.d.ts +1 -1
- package/dist/features/ai/react/DocumentChatOps.js +1 -1
- package/dist/features/ai/react/SettingsModelProfiles.js +8 -10
- 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 +3 -3
- package/dist/features/ai/react/use-ai-assistant.js.map +1 -1
- package/dist/features/ai/react/use-document-chat.js +2 -2
- package/dist/features/ai/react/use-document-chat.js.map +1 -1
- package/dist/features/ai/react/use-model-profiles.d.ts +2 -1
- package/dist/features/ai/selection-flow.d.ts +1 -1
- package/dist/features/ai/selection-flow.js +1 -1
- package/dist/features/ai/sidebar-flow.d.ts +1 -1
- package/dist/features/ai/sidebar-flow.js +1 -1
- package/dist/features/ai/use-ai-assistant.d.ts +1 -1
- package/dist/features/ai/use-ai-assistant.js +3 -3
- package/dist/features/ai/use-ai-assistant.js.map +1 -1
- package/dist/features/ai/use-document-chat.js +2 -2
- package/dist/features/ai/use-document-chat.js.map +1 -1
- package/dist/features/ai/use-model-profiles.d.ts +2 -1
- package/dist/features/authors/attribution.d.ts +1 -1
- package/dist/features/authors/feature.js +12 -11
- package/dist/features/authors/feature.js.map +1 -1
- package/dist/features/block-ui/block-actions.d.ts +1 -1
- package/dist/features/block-ui/block-actions.js +1 -1
- package/dist/features/block-ui/block-actions.js.map +1 -1
- package/dist/features/block-ui/components/BlockUi.js +1 -1
- package/dist/features/block-ui/feature.js +1 -0
- package/dist/features/block-ui/feature.js.map +1 -1
- package/dist/features/block-ui/react/BlockUi.js +1 -1
- package/dist/features/collab/anchor-resolver.js +1 -1
- package/dist/features/collab/feature.js +2 -0
- package/dist/features/collab/feature.js.map +1 -1
- package/dist/features/comments/components/CommentThreadView.vue.d.ts +2 -1
- package/dist/features/comments/feature.js +12 -11
- package/dist/features/comments/feature.js.map +1 -1
- package/dist/features/comments/index.d.ts +3 -2
- package/dist/features/comments/index.js +1 -1
- package/dist/features/comments/margin-layout.d.ts +3 -2
- package/dist/features/comments/model.d.ts +3 -67
- package/dist/features/comments/model.js +2 -2
- package/dist/features/comments/model.js.map +1 -1
- package/dist/features/comments/react/CommentThreadView.d.ts +3 -2
- package/dist/features/comments/react/use-comments.d.ts +2 -1
- package/dist/features/comments/react.d.ts +1 -1
- package/dist/features/comments/schema.d.ts +2 -52
- package/dist/features/comments/schema.js.map +1 -1
- package/dist/features/comments/snapshot-equality.js.map +1 -1
- package/dist/features/comments/use-comments.d.ts +3 -2
- package/dist/features/comments/vue.d.ts +1 -1
- package/dist/features/composites/accepted-children.d.ts +1 -0
- package/dist/features/composites/accepted-children.js +16 -1
- package/dist/features/composites/accepted-children.js.map +1 -1
- package/dist/features/composites/ai-brief.js +39 -0
- package/dist/features/composites/ai-brief.js.map +1 -1
- package/dist/features/composites/bibliography-command.d.ts +11 -0
- package/dist/features/composites/bibliography-form.js +90 -0
- package/dist/features/composites/bibliography-form.js.map +1 -0
- package/dist/features/composites/bibliography.d.ts +33 -0
- package/dist/features/composites/bibliography.js +120 -0
- package/dist/features/composites/bibliography.js.map +1 -0
- package/dist/features/composites/components/BibliographyEditor.js +261 -0
- package/dist/features/composites/components/BibliographyEditor.js.map +1 -0
- package/dist/features/composites/components/CompositeChrome.js +78 -29
- 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 +46 -11
- package/dist/features/composites/components/CompositeDetails.js.map +1 -1
- package/dist/features/composites/components/CompositeDetails.vue.d.ts +2 -1
- package/dist/features/composites/components/CompositeFieldEditor.js +64 -5
- package/dist/features/composites/components/CompositeFieldEditor.js.map +1 -1
- package/dist/features/composites/components/CompositeInspector.js +20 -7
- package/dist/features/composites/components/CompositeInspector.js.map +1 -1
- package/dist/features/composites/components/CompositeTable.js +13 -4
- package/dist/features/composites/components/CompositeTable.js.map +1 -1
- package/dist/features/composites/components/CompositeTagsEditor.js +1 -1
- package/dist/features/composites/components/CompositeView.js +11 -1
- package/dist/features/composites/components/CompositeView.js.map +1 -1
- package/dist/features/composites/components/DerivationBadge.js +103 -0
- package/dist/features/composites/components/DerivationBadge.js.map +1 -0
- package/dist/features/composites/components/ReferenceFieldSelect.js +60 -0
- package/dist/features/composites/components/ReferenceFieldSelect.js.map +1 -0
- package/dist/features/composites/components/ReferenceView.js +122 -0
- package/dist/features/composites/components/ReferenceView.js.map +1 -0
- package/dist/features/composites/components/ReferenceView.vue.d.ts +96 -0
- package/dist/features/composites/components/SettingsEditingTab.js +1 -1
- package/dist/features/composites/convert.js +2 -2
- package/dist/features/composites/convert.js.map +1 -1
- package/dist/features/composites/derivation.d.ts +61 -0
- package/dist/features/composites/derivation.js +98 -0
- package/dist/features/composites/derivation.js.map +1 -0
- package/dist/features/composites/derived-chrome.js +69 -0
- package/dist/features/composites/derived-chrome.js.map +1 -0
- package/dist/features/composites/feature.js +159 -109
- package/dist/features/composites/feature.js.map +1 -1
- package/dist/features/composites/fences.d.ts +4 -3
- package/dist/features/composites/fences.js +51 -7
- package/dist/features/composites/fences.js.map +1 -1
- package/dist/features/composites/index.d.ts +12 -3
- package/dist/features/composites/index.js +15 -6
- package/dist/features/composites/inspector-model.d.ts +4 -1
- package/dist/features/composites/inspector-model.js +8 -4
- package/dist/features/composites/inspector-model.js.map +1 -1
- package/dist/features/composites/kinds.d.ts +16 -2
- package/dist/features/composites/kinds.js +145 -6
- package/dist/features/composites/kinds.js.map +1 -1
- package/dist/features/composites/legacy.d.ts +4 -1
- package/dist/features/composites/legacy.js +56 -1
- package/dist/features/composites/legacy.js.map +1 -1
- package/dist/features/composites/meta-display.js +45 -2
- package/dist/features/composites/meta-display.js.map +1 -1
- package/dist/features/composites/meta-keys.d.ts +7 -0
- package/dist/features/composites/meta-keys.js +21 -0
- package/dist/features/composites/meta-keys.js.map +1 -0
- package/dist/features/composites/node-views.d.ts +6 -3
- package/dist/features/composites/node-views.js +7 -3
- package/dist/features/composites/node-views.js.map +1 -1
- package/dist/features/composites/nodes.d.ts +6 -1
- package/dist/features/composites/nodes.js +33 -7
- package/dist/features/composites/nodes.js.map +1 -1
- package/dist/features/composites/react/BibliographyEditor.js +229 -0
- package/dist/features/composites/react/BibliographyEditor.js.map +1 -0
- package/dist/features/composites/react/CompositeChrome.js +67 -19
- package/dist/features/composites/react/CompositeChrome.js.map +1 -1
- package/dist/features/composites/react/CompositeDetails.d.ts +2 -1
- package/dist/features/composites/react/CompositeDetails.js +45 -6
- package/dist/features/composites/react/CompositeDetails.js.map +1 -1
- package/dist/features/composites/react/CompositeFieldEditor.d.ts +1 -1
- package/dist/features/composites/react/CompositeFieldEditor.js +43 -1
- package/dist/features/composites/react/CompositeFieldEditor.js.map +1 -1
- package/dist/features/composites/react/CompositeInspector.js +12 -6
- package/dist/features/composites/react/CompositeInspector.js.map +1 -1
- package/dist/features/composites/react/CompositeStatusMenu.js +1 -1
- package/dist/features/composites/react/CompositeSummaryEditor.js +1 -1
- package/dist/features/composites/react/CompositeTable.js +16 -2
- package/dist/features/composites/react/CompositeTable.js.map +1 -1
- package/dist/features/composites/react/CompositeTagsEditor.js +2 -2
- package/dist/features/composites/react/CompositeView.js +6 -1
- package/dist/features/composites/react/CompositeView.js.map +1 -1
- package/dist/features/composites/react/DerivationBadge.js +116 -0
- package/dist/features/composites/react/DerivationBadge.js.map +1 -0
- package/dist/features/composites/react/ReferenceFieldSelect.js +52 -0
- package/dist/features/composites/react/ReferenceFieldSelect.js.map +1 -0
- package/dist/features/composites/react/ReferenceView.d.ts +11 -0
- package/dist/features/composites/react/ReferenceView.js +115 -0
- package/dist/features/composites/react/ReferenceView.js.map +1 -0
- package/dist/features/composites/react/SettingsEditingTab.js +2 -2
- package/dist/features/composites/react.d.ts +2 -1
- package/dist/features/composites/react.js +7 -3
- package/dist/features/composites/react.js.map +1 -1
- package/dist/features/composites/reference-ai.js +16 -0
- package/dist/features/composites/reference-ai.js.map +1 -0
- package/dist/features/composites/reference-label.d.ts +19 -0
- package/dist/features/composites/reference-label.js +58 -0
- package/dist/features/composites/reference-label.js.map +1 -0
- package/dist/features/composites/reference-suggestion.d.ts +10 -0
- package/dist/features/composites/reference-suggestion.js +41 -0
- package/dist/features/composites/reference-suggestion.js.map +1 -0
- package/dist/features/composites/reference-text.d.ts +18 -0
- package/dist/features/composites/reference-text.js +89 -0
- package/dist/features/composites/reference-text.js.map +1 -0
- package/dist/features/composites/reference.d.ts +44 -0
- package/dist/features/composites/reference.js +148 -0
- package/dist/features/composites/reference.js.map +1 -0
- package/dist/features/composites/reveal-source.d.ts +32 -0
- package/dist/features/composites/reveal-source.js +89 -0
- package/dist/features/composites/reveal-source.js.map +1 -0
- package/dist/features/composites/rows.d.ts +25 -3
- package/dist/features/composites/rows.js +72 -10
- package/dist/features/composites/rows.js.map +1 -1
- package/dist/features/composites/schema.d.ts +9 -3
- package/dist/features/composites/schema.js +11 -4
- package/dist/features/composites/schema.js.map +1 -1
- package/dist/features/composites/table-model.js +12 -21
- package/dist/features/composites/table-model.js.map +1 -1
- package/dist/features/composites/vue.d.ts +3 -2
- package/dist/features/composites/vue.js +8 -4
- package/dist/features/composites/vue.js.map +1 -1
- package/dist/features/media/assets.d.ts +2 -0
- package/dist/features/media/assets.js +3 -2
- package/dist/features/media/assets.js.map +1 -1
- package/dist/features/media/components/FileView.js +13 -4
- package/dist/features/media/components/FileView.js.map +1 -1
- package/dist/features/media/feature.d.ts +3 -3
- package/dist/features/media/feature.js +21 -28
- package/dist/features/media/feature.js.map +1 -1
- package/dist/features/media/file-import.js +2 -2
- package/dist/features/media/file-import.js.map +1 -1
- package/dist/features/media/index.d.ts +2 -2
- package/dist/features/media/index.js +3 -3
- package/dist/features/media/react/AudioRecorderModal.js +1 -1
- package/dist/features/media/react/FileView.js +19 -2
- package/dist/features/media/react/FileView.js.map +1 -1
- package/dist/features/media/react.js +1 -1
- package/dist/features/media/schema.d.ts +8 -0
- package/dist/features/media/schema.js +126 -11
- package/dist/features/media/schema.js.map +1 -1
- package/dist/features/media/upload.d.ts +16 -14
- package/dist/features/media/upload.js +13 -19
- package/dist/features/media/upload.js.map +1 -1
- package/dist/features/mentions/index.d.ts +4 -3
- package/dist/features/mentions/index.js +4 -1
- package/dist/features/mentions/index.js.map +1 -1
- package/dist/features/mentions/mention-text.d.ts +1 -1
- package/dist/features/mentions/mention-text.js.map +1 -1
- package/dist/features/mentions/mention.d.ts +0 -6
- package/dist/features/mentions/mention.js.map +1 -1
- package/dist/features/mentions/metadata-defaults.d.ts +2 -2
- package/dist/features/mentions/metadata-defaults.js +3 -9
- package/dist/features/mentions/metadata-defaults.js.map +1 -1
- package/dist/features/mentions/schema.d.ts +2 -1
- package/dist/features/mentions/schema.js.map +1 -1
- package/dist/features/tables/feature.d.ts +2 -1
- package/dist/features/tables/feature.js +90 -70
- package/dist/features/tables/feature.js.map +1 -1
- package/dist/features/themes/components/SettingsAppearanceTab.js +6 -9
- package/dist/features/themes/components/SettingsAppearanceTab.js.map +1 -1
- package/dist/features/themes/feature.js +2 -0
- package/dist/features/themes/feature.js.map +1 -1
- package/dist/features/themes/index.d.ts +2 -1
- package/dist/features/themes/react/SettingsAppearanceTab.js +7 -10
- package/dist/features/themes/react/SettingsAppearanceTab.js.map +1 -1
- package/dist/features/themes/schema.d.ts +2 -6
- package/dist/features/themes/schema.js.map +1 -1
- package/dist/features/themes/theme-runtime.d.ts +1 -1
- package/dist/features/themes/theme-runtime.js +4 -2
- package/dist/features/themes/theme-runtime.js.map +1 -1
- package/dist/features/transcript/TranscriptSegmentView.js +48 -28
- package/dist/features/transcript/TranscriptSegmentView.js.map +1 -1
- package/dist/features/transcript/feature.js +21 -19
- package/dist/features/transcript/feature.js.map +1 -1
- package/dist/features/transcript/react/TranscriptSegmentView.js +55 -36
- package/dist/features/transcript/react/TranscriptSegmentView.js.map +1 -1
- package/dist/features/transcript/segment-node.d.ts +2 -0
- package/dist/features/transcript/segment-node.js +35 -7
- package/dist/features/transcript/segment-node.js.map +1 -1
- package/dist/i18n/de/composites.js +91 -1
- package/dist/i18n/de/composites.js.map +1 -1
- package/dist/i18n/de/integrations.js +49 -8
- package/dist/i18n/de/integrations.js.map +1 -1
- package/dist/i18n/de/media.js +0 -1
- package/dist/i18n/de/media.js.map +1 -1
- package/dist/i18n/de/palette.js +22 -0
- package/dist/i18n/de/palette.js.map +1 -0
- package/dist/i18n/de/tables.js +0 -1
- package/dist/i18n/de/tables.js.map +1 -1
- package/dist/i18n/de/transcript.js +2 -1
- package/dist/i18n/de/transcript.js.map +1 -1
- package/dist/i18n/de/tree.js +3 -0
- package/dist/i18n/de/tree.js.map +1 -1
- package/dist/i18n/de.d.ts +157 -11
- package/dist/i18n/de.js +3 -1
- package/dist/i18n/de.js.map +1 -1
- package/dist/i18n/en/composites.js +89 -1
- package/dist/i18n/en/composites.js.map +1 -1
- package/dist/i18n/en/integrations.js +49 -8
- package/dist/i18n/en/integrations.js.map +1 -1
- package/dist/i18n/en/media.js +0 -1
- package/dist/i18n/en/media.js.map +1 -1
- package/dist/i18n/en/palette.js +22 -0
- package/dist/i18n/en/palette.js.map +1 -0
- package/dist/i18n/en/tables.js +0 -1
- package/dist/i18n/en/tables.js.map +1 -1
- package/dist/i18n/en/transcript.js +2 -1
- package/dist/i18n/en/transcript.js.map +1 -1
- package/dist/i18n/en/tree.js +3 -0
- package/dist/i18n/en/tree.js.map +1 -1
- package/dist/i18n/en.js +3 -1
- package/dist/i18n/en.js.map +1 -1
- package/dist/index.d.ts +4 -3
- package/dist/integrations/composite-ai/bibliography-fetch.d.ts +31 -0
- package/dist/integrations/composite-ai/bibliography-fetch.js +159 -0
- package/dist/integrations/composite-ai/bibliography-fetch.js.map +1 -0
- package/dist/integrations/composite-ai/composite-fill.d.ts +30 -8
- package/dist/integrations/composite-ai/composite-fill.js +97 -56
- package/dist/integrations/composite-ai/composite-fill.js.map +1 -1
- package/dist/integrations/composite-ai/composite-summary.d.ts +4 -12
- package/dist/integrations/composite-ai/composite-summary.js +7 -26
- package/dist/integrations/composite-ai/composite-summary.js.map +1 -1
- package/dist/integrations/composite-ai/derive.d.ts +29 -0
- package/dist/integrations/composite-ai/derive.js +173 -0
- package/dist/integrations/composite-ai/derive.js.map +1 -0
- package/dist/integrations/composite-ai/index.d.ts +11 -7
- package/dist/integrations/composite-ai/index.js +72 -14
- package/dist/integrations/composite-ai/index.js.map +1 -1
- package/dist/integrations/composite-ai/rendition.d.ts +45 -0
- package/dist/integrations/composite-ai/rendition.js +314 -0
- package/dist/integrations/composite-ai/rendition.js.map +1 -0
- package/dist/integrations/composite-media/index.d.ts +7 -5
- package/dist/integrations/composite-media/index.js +86 -13
- package/dist/integrations/composite-media/index.js.map +1 -1
- package/dist/integrations/transcript-ai/index.d.ts +1 -1
- package/dist/integrations/transcript-ai/index.js +5 -2
- package/dist/integrations/transcript-ai/index.js.map +1 -1
- package/dist/integrations/transcript-ai/protocol.d.ts +2 -12
- package/dist/integrations/transcript-ai/protocol.js +0 -2
- package/dist/integrations/transcript-ai/protocol.js.map +1 -1
- package/dist/integrations/transcript-ai/transcript-cleanup.d.ts +5 -5
- package/dist/integrations/transcript-ai/transcript-cleanup.js +7 -10
- package/dist/integrations/transcript-ai/transcript-cleanup.js.map +1 -1
- package/dist/markdown/MarkdownSurface.vue.d.ts +12 -11
- package/dist/markdown/MarkdownSurface2.js +3 -6
- package/dist/markdown/MarkdownSurface2.js.map +1 -1
- package/dist/markdown/document.js +1 -1
- package/dist/markdown/source-mode.d.ts +1 -1
- package/dist/nuxt/module.d.ts +1402 -54
- package/dist/nuxt/module.js +6 -49
- package/dist/nuxt/module.js.map +1 -1
- package/dist/nuxt/runtime/install-context.d.ts +7 -3
- package/dist/nuxt/runtime/install-context.js +14 -8
- package/dist/nuxt/runtime/install-context.js.map +1 -1
- package/dist/nuxt/runtime/plugins/editor-context-nuxt-ui.client.ts +2 -2
- package/dist/nuxt/runtime/server/plugins/editor-server.js +20 -12
- package/dist/nuxt/runtime/server/plugins/editor-server.js.map +1 -1
- package/dist/presets/compose.d.ts +94 -0
- package/dist/presets/compose.js +164 -0
- package/dist/presets/compose.js.map +1 -0
- package/dist/react/AdvancedEditor.d.ts +15 -15
- package/dist/react/AdvancedEditor.js +15 -13
- package/dist/react/AdvancedEditor.js.map +1 -1
- package/dist/react/EditorCommandPalette.d.ts +13 -0
- package/dist/react/EditorCommandPalette.js +118 -0
- package/dist/react/EditorCommandPalette.js.map +1 -0
- package/dist/react/EditorSettingsModal.d.ts +5 -5
- package/dist/react/EditorSettingsModal.js +7 -4
- package/dist/react/EditorSettingsModal.js.map +1 -1
- package/dist/react/EditorSettingsPanel.d.ts +7 -7
- package/dist/react/EditorSettingsPanel.js +8 -5
- package/dist/react/EditorSettingsPanel.js.map +1 -1
- package/dist/react/EditorSurface.d.ts +7 -7
- package/dist/react/EditorSurface.js +10 -6
- package/dist/react/EditorSurface.js.map +1 -1
- package/dist/react/EditorToolbar.d.ts +4 -6
- package/dist/react/EditorToolbar.js +29 -37
- package/dist/react/EditorToolbar.js.map +1 -1
- package/dist/react/SimpleEditor.d.ts +22 -23
- package/dist/react/SimpleEditor.js +21 -7
- package/dist/react/SimpleEditor.js.map +1 -1
- package/dist/react/advanced.d.ts +4 -3
- package/dist/react/advanced.js +2 -2
- package/dist/react/compose.d.ts +20 -0
- package/dist/react/compose.js +49 -0
- package/dist/react/compose.js.map +1 -0
- package/dist/react/composed-surface.d.ts +39 -0
- package/dist/react/composed-surface.js +71 -0
- package/dist/react/composed-surface.js.map +1 -0
- package/dist/react/context.js +6 -2
- package/dist/react/context.js.map +1 -1
- package/dist/react/index.d.ts +2 -1
- package/dist/react/index.js +2 -1
- package/dist/react/key-labels.js +15 -0
- package/dist/react/key-labels.js.map +1 -0
- package/dist/react/settings.d.ts +1 -1
- package/dist/react/simple.d.ts +2 -2
- package/dist/react/ui/command.js +36 -1
- package/dist/react/ui/command.js.map +1 -1
- package/dist/schema/advanced.d.ts +6 -6
- package/dist/schema/advanced.js +26 -29
- package/dist/schema/advanced.js.map +1 -1
- package/dist/server/ai.d.ts +5 -16
- package/dist/server/ai.js.map +1 -1
- package/dist/server/auth.d.ts +9 -0
- package/dist/server/collab-state.d.ts +1 -1
- package/dist/server/collab-state.js.map +1 -1
- package/dist/server/collab.d.ts +13 -13
- package/dist/server/collab.js +34 -18
- package/dist/server/collab.js.map +1 -1
- package/dist/server/crossref.js +78 -0
- package/dist/server/crossref.js.map +1 -0
- package/dist/server/errors.d.ts +1 -1
- package/dist/server/errors.js +1 -1
- package/dist/server/errors.js.map +1 -1
- package/dist/server/extract.js +308 -0
- package/dist/server/extract.js.map +1 -0
- package/dist/server/h3.d.ts +8 -0
- package/dist/{nuxt/runtime/server/utils/editor-route.js → server/h3.js} +8 -16
- package/dist/server/h3.js.map +1 -0
- package/dist/server/handlers/ai.d.ts +32 -10
- package/dist/server/handlers/ai.js +172 -37
- package/dist/server/handlers/ai.js.map +1 -1
- package/dist/server/handlers/context.d.ts +12 -5
- package/dist/server/handlers/context.js +10 -4
- package/dist/server/handlers/context.js.map +1 -1
- package/dist/server/handlers/editor.d.ts +19 -13
- package/dist/server/handlers/editor.js +49 -38
- package/dist/server/handlers/editor.js.map +1 -1
- package/dist/server/handlers/index.d.ts +4 -4
- package/dist/server/handlers/index.js +4 -4
- package/dist/server/host.d.ts +16 -25
- package/dist/server/host.js +58 -41
- package/dist/server/host.js.map +1 -1
- package/dist/server/index.d.ts +6 -4
- package/dist/server/index.js +3 -2
- package/dist/server/pdf.js +97 -0
- package/dist/server/pdf.js.map +1 -0
- package/dist/server/{adapter.d.ts → ports.d.ts} +81 -30
- package/dist/server/ports.js +29 -0
- package/dist/server/ports.js.map +1 -0
- package/dist/server/routes.d.ts +22 -0
- package/dist/server/routes.js +144 -0
- package/dist/server/routes.js.map +1 -0
- package/dist/settings/index.d.ts +1 -1
- package/dist/settings/index.js.map +1 -1
- package/dist/styles/composites.css +25 -0
- package/dist/tree/DocumentTree.js +56 -29
- package/dist/tree/DocumentTree.js.map +1 -1
- package/dist/tree/react/DocumentTree.js +23 -0
- package/dist/tree/react/DocumentTree.js.map +1 -1
- package/dist/tree/tree-host.js +2 -2
- package/dist/tree/tree-items.js +1 -1
- package/dist/vue/AdvancedEditor.js +30 -9
- package/dist/vue/AdvancedEditor.js.map +1 -1
- package/dist/vue/AdvancedEditor.vue.d.ts +32 -12
- package/dist/vue/SimpleEditor.js +62 -16
- package/dist/vue/SimpleEditor.js.map +1 -1
- package/dist/vue/SimpleEditor.vue.d.ts +39 -9
- package/dist/vue/advanced.d.ts +3 -2
- package/dist/vue/advanced.js +2 -2
- package/dist/vue/components/EditorCommandPalette.js +91 -0
- package/dist/vue/components/EditorCommandPalette.js.map +1 -0
- package/dist/vue/components/EditorCommandPalette.vue.d.ts +15 -0
- package/dist/vue/components/EditorSettingsModal.js +10 -6
- package/dist/vue/components/EditorSettingsModal.js.map +1 -1
- package/dist/vue/components/EditorSettingsModal.vue.d.ts +4 -4
- package/dist/vue/components/EditorSettingsPanel.js +10 -6
- package/dist/vue/components/EditorSettingsPanel.js.map +1 -1
- package/dist/vue/components/EditorSettingsPanel.vue.d.ts +6 -6
- package/dist/vue/components/EditorSurface.js +11 -6
- package/dist/vue/components/EditorSurface.js.map +1 -1
- package/dist/vue/components/EditorSurface.vue.d.ts +11 -11
- package/dist/vue/components/EditorToolbar.js +41 -49
- package/dist/vue/components/EditorToolbar.js.map +1 -1
- package/dist/vue/components/EditorToolbar.vue.d.ts +2 -4
- package/dist/vue/compose.d.ts +17 -0
- package/dist/vue/compose.js +51 -0
- package/dist/vue/compose.js.map +1 -0
- package/dist/vue/context-key.d.ts +6 -0
- package/dist/vue/context-key.js +6 -0
- package/dist/vue/context-key.js.map +1 -0
- package/dist/vue/context.d.ts +8 -6
- package/dist/vue/context.js +6 -5
- package/dist/vue/context.js.map +1 -1
- package/dist/vue/index.d.ts +10 -8
- package/dist/vue/index.js +10 -8
- package/dist/vue/kit/index.d.ts +2 -2
- package/dist/vue/kit/nuxt-ui.js +23 -0
- package/dist/vue/kit/nuxt-ui.js.map +1 -1
- package/dist/vue/kit/types.d.ts +40 -1
- package/package.json +30 -16
- package/dist/adapters/comments/client.d.ts +0 -64
- package/dist/adapters/comments/client.js.map +0 -1
- package/dist/adapters/routes.js.map +0 -1
- package/dist/core/toolbar.d.ts +0 -74
- package/dist/core/toolbar.js +0 -45
- package/dist/core/toolbar.js.map +0 -1
- package/dist/integrations/composite-ai/document-transcribe.d.ts +0 -14
- package/dist/integrations/composite-ai/document-transcribe.js +0 -89
- package/dist/integrations/composite-ai/document-transcribe.js.map +0 -1
- package/dist/nuxt/runtime/server/api/ai/chat.post.d.ts +0 -5
- package/dist/nuxt/runtime/server/api/ai/chat.post.js +0 -8
- package/dist/nuxt/runtime/server/api/ai/chat.post.js.map +0 -1
- package/dist/nuxt/runtime/server/api/ai/complete.post.d.ts +0 -5
- package/dist/nuxt/runtime/server/api/ai/complete.post.js +0 -8
- package/dist/nuxt/runtime/server/api/ai/complete.post.js.map +0 -1
- package/dist/nuxt/runtime/server/api/ai/generate.post.d.ts +0 -5
- package/dist/nuxt/runtime/server/api/ai/generate.post.js +0 -8
- package/dist/nuxt/runtime/server/api/ai/generate.post.js.map +0 -1
- package/dist/nuxt/runtime/server/api/ai/models.get.d.ts +0 -5
- package/dist/nuxt/runtime/server/api/ai/models.get.js +0 -8
- package/dist/nuxt/runtime/server/api/ai/models.get.js.map +0 -1
- package/dist/nuxt/runtime/server/api/ai/transcribe.post.d.ts +0 -5
- package/dist/nuxt/runtime/server/api/ai/transcribe.post.js +0 -8
- package/dist/nuxt/runtime/server/api/ai/transcribe.post.js.map +0 -1
- package/dist/nuxt/runtime/server/api/ai/transcript-cleanup.post.d.ts +0 -5
- package/dist/nuxt/runtime/server/api/ai/transcript-cleanup.post.js +0 -8
- package/dist/nuxt/runtime/server/api/ai/transcript-cleanup.post.js.map +0 -1
- package/dist/nuxt/runtime/server/api/editor/assets/[id]/[name].get.d.ts +0 -5
- package/dist/nuxt/runtime/server/api/editor/assets/[id]/[name].get.js +0 -8
- package/dist/nuxt/runtime/server/api/editor/assets/[id]/[name].get.js.map +0 -1
- package/dist/nuxt/runtime/server/api/editor/assets/[id].post.d.ts +0 -5
- package/dist/nuxt/runtime/server/api/editor/assets/[id].post.js +0 -8
- package/dist/nuxt/runtime/server/api/editor/assets/[id].post.js.map +0 -1
- package/dist/nuxt/runtime/server/api/editor/settings.get.d.ts +0 -5
- package/dist/nuxt/runtime/server/api/editor/settings.get.js +0 -8
- package/dist/nuxt/runtime/server/api/editor/settings.get.js.map +0 -1
- package/dist/nuxt/runtime/server/api/editor/settings.put.d.ts +0 -5
- package/dist/nuxt/runtime/server/api/editor/settings.put.js +0 -8
- package/dist/nuxt/runtime/server/api/editor/settings.put.js.map +0 -1
- package/dist/nuxt/runtime/server/api/editor/tags.get.d.ts +0 -5
- package/dist/nuxt/runtime/server/api/editor/tags.get.js +0 -8
- package/dist/nuxt/runtime/server/api/editor/tags.get.js.map +0 -1
- package/dist/nuxt/runtime/server/api/editor/themes/[id].delete.d.ts +0 -5
- package/dist/nuxt/runtime/server/api/editor/themes/[id].delete.js +0 -8
- package/dist/nuxt/runtime/server/api/editor/themes/[id].delete.js.map +0 -1
- package/dist/nuxt/runtime/server/api/editor/themes/[id].get.d.ts +0 -5
- package/dist/nuxt/runtime/server/api/editor/themes/[id].get.js +0 -8
- package/dist/nuxt/runtime/server/api/editor/themes/[id].get.js.map +0 -1
- package/dist/nuxt/runtime/server/api/editor/themes/index.get.d.ts +0 -5
- package/dist/nuxt/runtime/server/api/editor/themes/index.get.js +0 -8
- package/dist/nuxt/runtime/server/api/editor/themes/index.get.js.map +0 -1
- package/dist/nuxt/runtime/server/api/editor/themes/index.post.d.ts +0 -5
- package/dist/nuxt/runtime/server/api/editor/themes/index.post.js +0 -8
- package/dist/nuxt/runtime/server/api/editor/themes/index.post.js.map +0 -1
- package/dist/nuxt/runtime/server/api/editor/users.get.d.ts +0 -5
- package/dist/nuxt/runtime/server/api/editor/users.get.js +0 -8
- package/dist/nuxt/runtime/server/api/editor/users.get.js.map +0 -1
- package/dist/nuxt/runtime/server/plugins/collab.d.ts +0 -5
- package/dist/nuxt/runtime/server/plugins/collab.js +0 -10
- package/dist/nuxt/runtime/server/plugins/collab.js.map +0 -1
- package/dist/nuxt/runtime/server/routes/collab/[id].d.ts +0 -5
- package/dist/nuxt/runtime/server/routes/collab/[id].js +0 -35
- package/dist/nuxt/runtime/server/routes/collab/[id].js.map +0 -1
- package/dist/nuxt/runtime/server/utils/editor-route.d.ts +0 -11
- package/dist/nuxt/runtime/server/utils/editor-route.js.map +0 -1
- package/dist/presets/advanced.d.ts +0 -33
- package/dist/presets/advanced.js +0 -50
- package/dist/presets/advanced.js.map +0 -1
- package/dist/presets/simple.d.ts +0 -9
- package/dist/presets/simple.js +0 -12
- package/dist/presets/simple.js.map +0 -1
- package/dist/react/advanced-preset.d.ts +0 -11
- package/dist/react/advanced-preset.js +0 -31
- package/dist/react/advanced-preset.js.map +0 -1
- package/dist/vue/advanced-preset.d.ts +0 -13
- package/dist/vue/advanced-preset.js +0 -33
- package/dist/vue/advanced-preset.js.map +0 -1
- package/docs/extending.md +0 -538
- package/docs/integration.md +0 -632
- package/docs/llms.md +0 -383
- package/docs/usage.md +0 -1076
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import { abilitiesAtSelection } from "../../core/abilities.js";
|
|
2
|
-
import { mergeToolbarGroups } from "../../core/toolbar.js";
|
|
3
|
-
import { contributions } from "../../core/define-editor.js";
|
|
4
1
|
import { borrowedFeatureContext, editorEntryOf } from "../../core/editor-ui.js";
|
|
2
|
+
import { commandState, toolbarOf } from "../../core/commands.js";
|
|
5
3
|
import { useUiKit } from "../kit/use-ui-kit.js";
|
|
6
4
|
import { useEditorContext } from "../context.js";
|
|
7
5
|
import { useEditorI18n } from "../use-editor-i18n.js";
|
|
@@ -17,15 +15,12 @@ const _hoisted_2 = {
|
|
|
17
15
|
};
|
|
18
16
|
/**
|
|
19
17
|
* The toolbar of an editor, placed anywhere on the page. `editor` is the instance it works on (from the surface's
|
|
20
|
-
* `ready` event); the preset registered for that instance supplies the groups
|
|
21
|
-
*
|
|
18
|
+
* `ready` event); the preset registered for that instance (`editorEntryOf`) supplies the groups. Without an editor
|
|
19
|
+
* (not mounted yet, or read-only by the host's choice) it renders no groups. Never reads a global active editor.
|
|
22
20
|
*/
|
|
23
21
|
const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
24
22
|
__name: "EditorToolbar",
|
|
25
|
-
props: {
|
|
26
|
-
editor: {},
|
|
27
|
-
preset: {}
|
|
28
|
-
},
|
|
23
|
+
props: { editor: {} },
|
|
29
24
|
setup(__props) {
|
|
30
25
|
const props = __props;
|
|
31
26
|
const { Button: UButton, DropdownMenu: UDropdownMenu, FieldGroup: UFieldGroup, Tooltip: UTooltip } = useUiKit();
|
|
@@ -43,38 +38,35 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
43
38
|
if (!preset) return [];
|
|
44
39
|
const cached = built.get(preset);
|
|
45
40
|
if (cached) return cached;
|
|
46
|
-
const build = () =>
|
|
41
|
+
const build = () => toolbarOf(preset, ctx);
|
|
47
42
|
const groups = instance ? instance.appContext.app.runWithContext(build) : build();
|
|
48
43
|
built.set(preset, groups);
|
|
49
44
|
return groups;
|
|
50
45
|
}
|
|
51
|
-
|
|
46
|
+
const NO_EDITOR = {
|
|
47
|
+
visible: true,
|
|
48
|
+
enabled: false,
|
|
49
|
+
active: false
|
|
50
|
+
};
|
|
52
51
|
const visibleGroups = computed(() => {
|
|
53
|
-
const editor = props.editor;
|
|
54
|
-
return groupsOf(editorEntryOf(editor
|
|
52
|
+
const editor = props.editor && toRaw(props.editor);
|
|
53
|
+
return groupsOf(editorEntryOf(editor)?.preset).filter((group) => !editor || !group.visible || group.visible(editor)).map((group) => ({
|
|
55
54
|
group,
|
|
56
|
-
items: group.items.
|
|
55
|
+
items: group.items.map((cmd) => ({
|
|
56
|
+
cmd,
|
|
57
|
+
state: editor ? commandState(editor, cmd, "selection") : NO_EDITOR
|
|
58
|
+
})).filter(({ state }) => state.visible)
|
|
57
59
|
})).filter(({ items }) => items.length > 0);
|
|
58
60
|
});
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
return !!props.editor && !!item.active?.(props.editor);
|
|
62
|
-
}
|
|
63
|
-
function disabled(item) {
|
|
64
|
-
const editor = props.editor;
|
|
65
|
-
if (!editor) return true;
|
|
66
|
-
if (item.disabled?.(editor)) return true;
|
|
67
|
-
return !active(item) && !!item.ability && !abilities.value.has(item.ability);
|
|
68
|
-
}
|
|
69
|
-
function run(item) {
|
|
70
|
-
if (props.editor) item.run?.(props.editor);
|
|
61
|
+
function run(cmd) {
|
|
62
|
+
if (props.editor && "run" in cmd) cmd.run(props.editor);
|
|
71
63
|
}
|
|
72
|
-
function menuOf(
|
|
73
|
-
return props.editor &&
|
|
64
|
+
function menuOf(cmd) {
|
|
65
|
+
return props.editor && "menu" in cmd ? cmd.menu(props.editor) : [];
|
|
74
66
|
}
|
|
75
67
|
/** Descriptors are framework-agnostic (`component: unknown`); in this Vue toolbar they are Vue components. */
|
|
76
|
-
function componentOf(
|
|
77
|
-
return
|
|
68
|
+
function componentOf(cmd) {
|
|
69
|
+
return "component" in cmd ? cmd.component : void 0;
|
|
78
70
|
}
|
|
79
71
|
return (_ctx, _cache) => {
|
|
80
72
|
return openBlock(), createElementBlock("div", {
|
|
@@ -83,25 +75,25 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
83
75
|
"aria-label": unref(t)("toolbar.label")
|
|
84
76
|
}, [(openBlock(true), createElementBlock(Fragment, null, renderList(visibleGroups.value, ({ group, items }, gi) => {
|
|
85
77
|
return openBlock(), createElementBlock(Fragment, { key: group.id }, [gi > 0 ? (openBlock(), createElementBlock("span", _hoisted_2)) : createCommentVNode("v-if", true), createVNode(unref(UFieldGroup), { size: "sm" }, {
|
|
86
|
-
default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(items, (
|
|
87
|
-
return openBlock(), createElementBlock(Fragment, { key:
|
|
78
|
+
default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(items, ({ cmd, state }) => {
|
|
79
|
+
return openBlock(), createElementBlock(Fragment, { key: cmd.id }, [componentOf(cmd) ? (openBlock(), createBlock(resolveDynamicComponent(componentOf(cmd)), {
|
|
88
80
|
key: 0,
|
|
89
81
|
editor: props.editor
|
|
90
|
-
}, null, 8, ["editor"])) :
|
|
82
|
+
}, null, 8, ["editor"])) : "menu" in cmd ? (openBlock(), createBlock(unref(UDropdownMenu), {
|
|
91
83
|
key: 1,
|
|
92
|
-
items: menuOf(
|
|
84
|
+
items: menuOf(cmd)
|
|
93
85
|
}, {
|
|
94
86
|
default: withCtx(() => [createVNode(unref(UTooltip), {
|
|
95
|
-
text:
|
|
96
|
-
kbds:
|
|
87
|
+
text: cmd.label,
|
|
88
|
+
kbds: cmd.kbds
|
|
97
89
|
}, {
|
|
98
90
|
default: withCtx(() => [(openBlock(), createBlock(unref(UButton), {
|
|
99
|
-
key:
|
|
91
|
+
key: cmd.icon,
|
|
100
92
|
color: "neutral",
|
|
101
93
|
variant: "ghost",
|
|
102
|
-
icon:
|
|
103
|
-
"aria-label":
|
|
104
|
-
disabled:
|
|
94
|
+
icon: cmd.icon,
|
|
95
|
+
"aria-label": cmd.label,
|
|
96
|
+
disabled: !state.enabled,
|
|
105
97
|
onMousedown: _cache[0] || (_cache[0] = withModifiers(() => {}, ["prevent"]))
|
|
106
98
|
}, null, 8, [
|
|
107
99
|
"icon",
|
|
@@ -113,22 +105,22 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
113
105
|
_: 2
|
|
114
106
|
}, 1032, ["items"])) : (openBlock(), createBlock(unref(UTooltip), {
|
|
115
107
|
key: 2,
|
|
116
|
-
text:
|
|
117
|
-
kbds:
|
|
108
|
+
text: cmd.label,
|
|
109
|
+
kbds: cmd.kbds
|
|
118
110
|
}, {
|
|
119
111
|
default: withCtx(() => [(openBlock(), createBlock(unref(UButton), {
|
|
120
|
-
key:
|
|
112
|
+
key: cmd.icon,
|
|
121
113
|
color: "neutral",
|
|
122
114
|
variant: "ghost",
|
|
123
115
|
"active-color": "primary",
|
|
124
116
|
"active-variant": "soft",
|
|
125
|
-
icon:
|
|
126
|
-
"aria-label":
|
|
127
|
-
active: active
|
|
128
|
-
"aria-pressed":
|
|
129
|
-
disabled:
|
|
117
|
+
icon: cmd.icon,
|
|
118
|
+
"aria-label": cmd.label,
|
|
119
|
+
active: state.active,
|
|
120
|
+
"aria-pressed": cmd.active ? state.active : void 0,
|
|
121
|
+
disabled: !state.enabled,
|
|
130
122
|
onMousedown: _cache[1] || (_cache[1] = withModifiers(() => {}, ["prevent"])),
|
|
131
|
-
onClick: ($event) => run(
|
|
123
|
+
onClick: ($event) => run(cmd)
|
|
132
124
|
}, null, 8, [
|
|
133
125
|
"icon",
|
|
134
126
|
"aria-label",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EditorToolbar.js","names":["_openBlock","_createElementBlock","_unref","_Fragment","_renderList","_createCommentVNode","_createVNode","_withCtx","_createBlock","_resolveDynamicComponent","_withModifiers"],"sources":["../../../src/vue/components/EditorToolbar.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { useUiKit } from '../kit/use-ui-kit'\nimport type { Editor } from '@tiptap/core'\nimport { type Component, computed, getCurrentInstance, toRaw } from 'vue'\nimport {
|
|
1
|
+
{"version":3,"file":"EditorToolbar.js","names":["_openBlock","_createElementBlock","_unref","_Fragment","_renderList","_createCommentVNode","_createVNode","_withCtx","_createBlock","_resolveDynamicComponent","_withModifiers"],"sources":["../../../src/vue/components/EditorToolbar.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { useUiKit } from '../kit/use-ui-kit'\nimport type { Editor } from '@tiptap/core'\nimport { type Component, computed, getCurrentInstance, toRaw } from 'vue'\nimport { type CommandDef, type CommandState, commandState, type MenuItem, type PlacedToolbarGroup, toolbarOf } from '../../core/commands'\nimport { borrowedFeatureContext, editorEntryOf } from '../../core/editor-ui'\nimport { useEditorContext } from '../context'\nimport { useEditorI18n } from '../use-editor-i18n'\nimport { trackedStore } from '../store-ref'\nimport type { EditorPreset } from '../../core/feature'\n\n/**\n * The toolbar of an editor, placed anywhere on the page. `editor` is the instance it works on (from the surface's\n * `ready` event); the preset registered for that instance (`editorEntryOf`) supplies the groups. Without an editor\n * (not mounted yet, or read-only by the host's choice) it renders no groups. Never reads a global active editor.\n */\nconst props = defineProps<{ editor?: Editor }>()\n\nconst { Button: UButton, DropdownMenu: UDropdownMenu, FieldGroup: UFieldGroup, Tooltip: UTooltip } = useUiKit()\n\nconst appContext = useEditorContext()\nconst { t } = useEditorI18n()\nconst instance = getCurrentInstance()\n\n// The context toolbar factories see: settings and fetch of the app, everything per-surface delegates to the editor's\n// registered context while there is one.\nconst ctx = borrowedFeatureContext({\n app: appContext,\n getEditor: () => props.editor,\n unwrap: toRaw,\n // Tracked: `active`/`visible`/`menu` read the settings during render, which must re-run when they change.\n settings: trackedStore(appContext.settings),\n})\n\n// Factories run during setup (they may use composables that inject); a later preset is built within the app context.\nconst built = new WeakMap<EditorPreset, PlacedToolbarGroup[]>()\nfunction groupsOf(preset: EditorPreset | undefined): PlacedToolbarGroup[] {\n if (!preset) return []\n const cached = built.get(preset)\n if (cached) return cached\n const build = () => toolbarOf(preset, ctx)\n const groups = instance ? instance.appContext.app.runWithContext(build) : build()\n built.set(preset, groups)\n return groups\n}\n\n// Every enabled/visible/active state comes from `commandState`. It reads the vue-3 Editor's reactive `state`\n// (through `can()` and the abilities), so this re-evaluates on every transaction. The raw instance is what the\n// registered entry (and with it the insert guards) is keyed by.\nconst NO_EDITOR: CommandState = { visible: true, enabled: false, active: false }\nconst visibleGroups = computed(() => {\n const editor = props.editor && toRaw(props.editor)\n const groups = groupsOf(editorEntryOf(editor)?.preset)\n return groups\n .filter(group => !editor || !group.visible || group.visible(editor))\n .map(group => ({\n group,\n items: group.items\n .map(cmd => ({ cmd, state: editor ? commandState(editor, cmd, 'selection') : NO_EDITOR }))\n .filter(({ state }) => state.visible),\n }))\n .filter(({ items }) => items.length > 0)\n})\n\nfunction run(cmd: CommandDef) {\n if (props.editor && 'run' in cmd) cmd.run(props.editor)\n}\nfunction menuOf(cmd: CommandDef): MenuItem[] {\n return props.editor && 'menu' in cmd ? cmd.menu(props.editor) : []\n}\n/** Descriptors are framework-agnostic (`component: unknown`); in this Vue toolbar they are Vue components. */\nfunction componentOf(cmd: CommandDef): Component | undefined {\n return 'component' in cmd ? cmd.component as Component : undefined\n}\n</script>\n\n<template>\n <div class=\"flex flex-wrap items-center gap-1.5\" role=\"toolbar\" :aria-label=\"t('toolbar.label')\">\n <template v-for=\"({ group, items }, gi) in visibleGroups\" :key=\"group.id\">\n <span v-if=\"gi > 0\" role=\"separator\" aria-orientation=\"vertical\" class=\"mx-2 h-6 w-[2px] shrink-0 bg-[var(--sk-border-accented)]\" />\n <UFieldGroup size=\"sm\">\n <template v-for=\"{ cmd, state } in items\" :key=\"cmd.id\">\n <component :is=\"componentOf(cmd)\" v-if=\"componentOf(cmd)\" :editor=\"props.editor\" />\n <UDropdownMenu v-else-if=\"'menu' in cmd\" :items=\"menuOf(cmd)\">\n <UTooltip :text=\"cmd.label\" :kbds=\"cmd.kbds\">\n <UButton\n :key=\"cmd.icon\"\n color=\"neutral\"\n variant=\"ghost\"\n :icon=\"cmd.icon\"\n :aria-label=\"cmd.label\"\n :disabled=\"!state.enabled\"\n @mousedown.prevent\n />\n </UTooltip>\n </UDropdownMenu>\n <UTooltip v-else :text=\"cmd.label\" :kbds=\"cmd.kbds\">\n <UButton\n :key=\"cmd.icon\"\n color=\"neutral\"\n variant=\"ghost\"\n active-color=\"primary\"\n active-variant=\"soft\"\n :icon=\"cmd.icon\"\n :aria-label=\"cmd.label\"\n :active=\"state.active\"\n :aria-pressed=\"cmd.active ? state.active : undefined\"\n :disabled=\"!state.enabled\"\n @mousedown.prevent\n @click=\"run(cmd)\"\n />\n </UTooltip>\n </template>\n </UFieldGroup>\n </template>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;EAgBA,MAAM,QAAQ;EAEd,MAAM,EAAE,QAAQ,SAAS,cAAc,eAAe,YAAY,aAAa,SAAS,aAAa,SAAS;EAE9G,MAAM,aAAa,iBAAiB;EACpC,MAAM,EAAE,MAAM,cAAc;EAC5B,MAAM,WAAW,mBAAmB;EAIpC,MAAM,MAAM,uBAAuB;GACjC,KAAK;GACL,iBAAiB,MAAM;GACvB,QAAQ;GAER,UAAU,aAAa,WAAW,QAAQ;EAC5C,CAAC;EAGD,MAAM,wBAAQ,IAAI,QAA4C;EAC9D,SAAS,SAAS,QAAwD;GACxE,IAAI,CAAC,QAAQ,OAAO,CAAC;GACrB,MAAM,SAAS,MAAM,IAAI,MAAM;GAC/B,IAAI,QAAQ,OAAO;GACnB,MAAM,cAAc,UAAU,QAAQ,GAAG;GACzC,MAAM,SAAS,WAAW,SAAS,WAAW,IAAI,eAAe,KAAK,IAAI,MAAM;GAChF,MAAM,IAAI,QAAQ,MAAM;GACxB,OAAO;EACT;EAKA,MAAM,YAA0B;GAAE,SAAS;GAAM,SAAS;GAAO,QAAQ;EAAM;EAC/E,MAAM,gBAAgB,eAAe;GACnC,MAAM,SAAS,MAAM,UAAU,MAAM,MAAM,MAAM;GAEjD,OADe,SAAS,cAAc,MAAM,CAAC,EAAE,MACxC,CAAA,CACJ,QAAO,UAAS,CAAC,UAAU,CAAC,MAAM,WAAW,MAAM,QAAQ,MAAM,CAAC,CAAA,CAClE,KAAI,WAAU;IACb;IACA,OAAO,MAAM,MACV,KAAI,SAAQ;KAAE;KAAK,OAAO,SAAS,aAAa,QAAQ,KAAK,WAAW,IAAI;IAAU,EAAE,CAAA,CACxF,QAAQ,EAAE,YAAY,MAAM,OAAO;GACxC,EAAE,CAAA,CACD,QAAQ,EAAE,YAAY,MAAM,SAAS,CAAC;EAC3C,CAAC;EAED,SAAS,IAAI,KAAiB;GAC5B,IAAI,MAAM,UAAU,SAAS,KAAK,IAAI,IAAI,MAAM,MAAM;EACxD;EACA,SAAS,OAAO,KAA6B;GAC3C,OAAO,MAAM,UAAU,UAAU,MAAM,IAAI,KAAK,MAAM,MAAM,IAAI,CAAC;EACnE;;EAEA,SAAS,YAAY,KAAwC;GAC3D,OAAO,eAAe,MAAM,IAAI,YAAyB,KAAA;EAC3D;;GAIE,OAAAA,UAAA,GAAAC,mBAsCM,OAAA;IAtCD,OAAM;IAAsC,MAAK;IAAW,cAAYC,MAAA,CAAA,CAAC,CAAA,eAAA;GAC5E,GAAA,EAAAF,UAAA,IAAA,GAAAC,mBAoCWE,UAAA,MAAAC,WApCgC,cAAA,QAAa,EAApC,OAAO,SAAS,OAAE;IAA0B,OAAA,UAAA,GAAA,mBAAA,UAAA,EAAA,KAAA,MAAM,GAAA,GACxD,CAAA,KAAE,KAAdJ,UAAA,GAAAC,mBAAoI,QAApI,UAAoI,KAAAI,mBAAA,QAAA,IAAA,GACpIC,YAiCcJ,MAAA,WAAA,GAAA,EAjCD,MAAK,KAAI,GAAA;KACV,SAAAK,cAA+B,EAAzCP,UAAA,IAAA,GAAAC,mBA+BWE,UAAA,MAAAC,WA/BwB,QAAK,EAArB,KAAK,YAAK;MAAmB,OAAA,UAAA,GAAA,mBAAA,UAAA,EAAA,KAAA,IAAI,GAAA,GACV,CAAA,YAAY,GAAG,KAAvDJ,UAAA,GAAAQ,YAAmFC,wBAAnE,YAAY,GAAG,CAAA,GAAA;;OAA4B,QAAQ,MAAM;MACrC,GAAA,MAAA,GAAA,CAAA,QAAA,CAAA,KAAA,UAAA,OAApCT,UAAA,GAAAQ,YAYgBN,MAAA,aAAA,GAAA;;OAZ0B,OAAO,OAAO,GAAG;;OACzD,SAAAK,cAUW,CAVXD,YAUWJ,MAAA,QAAA,GAAA;QAVA,MAAM,IAAI;QAAQ,MAAM,IAAI;;QACrC,SAAAK,cAQE,EARFP,UAAA,GAAAQ,YAQEN,MAAA,OAAA,GAAA;SAPC,KAAK,IAAI;SACV,OAAM;SACN,SAAQ;SACP,MAAM,IAAI;SACV,cAAY,IAAI;SAChB,UAAQ,CAAG,MAAM;SACjB,aAAS,OAAA,OAAA,OAAA,KAAAQ,oBAAV,CAAA,GAAkB,CAAA,SAAA,CAAA;;;;;;;;;MAIxB,GAAA,MAAA,CAAA,OAAA,CAAA,MAAAV,UAAA,GAAAQ,YAeWN,MAAA,QAAA,GAAA;;OAfO,MAAM,IAAI;OAAQ,MAAM,IAAI;;OAC5C,SAAAK,cAaE,EAbFP,UAAA,GAAAQ,YAaEN,MAAA,OAAA,GAAA;QAZC,KAAK,IAAI;QACV,OAAM;QACN,SAAQ;QACR,gBAAa;QACb,kBAAe;QACd,MAAM,IAAI;QACV,cAAY,IAAI;QAChB,QAAQ,MAAM;QACd,gBAAc,IAAI,SAAS,MAAM,SAAS,KAAA;QAC1C,UAAQ,CAAG,MAAM;QACjB,aAAS,OAAA,OAAA,OAAA,KAAAQ,oBAAV,CAAA,GAAkB,CAAA,SAAA,CAAA;QACjB,UAAK,WAAE,IAAI,GAAG"}
|
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
import { EditorPreset } from "../../core/feature.js";
|
|
2
1
|
import { Editor } from "@tiptap/core";
|
|
3
2
|
//#region src/vue/components/EditorToolbar.vue.d.ts
|
|
4
3
|
/**
|
|
5
4
|
* The toolbar of an editor, placed anywhere on the page. `editor` is the instance it works on (from the surface's
|
|
6
|
-
* `ready` event); the preset registered for that instance supplies the groups
|
|
7
|
-
*
|
|
5
|
+
* `ready` event); the preset registered for that instance (`editorEntryOf`) supplies the groups. Without an editor
|
|
6
|
+
* (not mounted yet, or read-only by the host's choice) it renders no groups. Never reads a global active editor.
|
|
8
7
|
*/
|
|
9
8
|
type __VLS_Props = {
|
|
10
9
|
editor?: Editor;
|
|
11
|
-
preset?: EditorPreset;
|
|
12
10
|
};
|
|
13
11
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
14
12
|
declare const _default: typeof __VLS_export;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ComposeOptions, ComposedEditor } from "../presets/compose.js";
|
|
2
|
+
import { Component } from "vue";
|
|
3
|
+
//#region src/vue/compose.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* `composeEditor` of `presets/compose` over the Vue bindings: the editor of the three dimensions (`content`,
|
|
6
|
+
* `interaction`, `ai`), pruned by the capabilities of `options.backend`. Call during component setup (`themesFeature()`
|
|
7
|
+
* reads the current Vue app to stop the theme runtime when it unmounts).
|
|
8
|
+
*/
|
|
9
|
+
export declare const composeEditor: (options: ComposeOptions<Component>) => ComposedEditor<Component>;
|
|
10
|
+
/**
|
|
11
|
+
* The advanced editor on the Vue surface: `{ content: 'rich', interaction: 'full', ai: true }`, every dimension option
|
|
12
|
+
* overridable (`compositeKinds`, `backend`, `add`, `remove`, ...). Collaboration is active only when a session is passed
|
|
13
|
+
* to the surface.
|
|
14
|
+
*/
|
|
15
|
+
export declare const advancedEditor: (options?: Partial<ComposeOptions<Component>>) => ComposedEditor<Component>;
|
|
16
|
+
//#endregion
|
|
17
|
+
//# sourceMappingURL=compose.d.ts.map
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { coreUiFeature } from "../core/core-feature.js";
|
|
2
|
+
import { compositeAiFeature } from "../integrations/composite-ai/index.js";
|
|
3
|
+
import { transcriptAiFeature } from "../integrations/transcript-ai/index.js";
|
|
4
|
+
import { composeEditor as composeEditor$1 } from "../presets/compose.js";
|
|
5
|
+
import { mediaFeature } from "../features/media/vue.js";
|
|
6
|
+
import _sfc_main from "./components/EditorCommandPalette.js";
|
|
7
|
+
import { aiFeature } from "../features/ai/vue.js";
|
|
8
|
+
import { authorsFeature } from "../features/authors/vue.js";
|
|
9
|
+
import { blockUiFeature } from "../features/block-ui/vue.js";
|
|
10
|
+
import { collabFeature } from "../features/collab/vue.js";
|
|
11
|
+
import { commentsFeature } from "../features/comments/vue.js";
|
|
12
|
+
import { compositeFeature } from "../features/composites/vue.js";
|
|
13
|
+
import { themesFeature } from "../features/themes/vue.js";
|
|
14
|
+
import { transcriptFeature } from "../features/transcript/vue.js";
|
|
15
|
+
//#region src/vue/compose.ts
|
|
16
|
+
/** The Vue bindings of every UI-bound catalog feature. */
|
|
17
|
+
const VUE_BINDINGS = {
|
|
18
|
+
"core-ui": () => coreUiFeature({ palette: _sfc_main }),
|
|
19
|
+
"media": mediaFeature,
|
|
20
|
+
"transcript": transcriptFeature,
|
|
21
|
+
"composites": compositeFeature,
|
|
22
|
+
"authors": authorsFeature,
|
|
23
|
+
"comments": commentsFeature,
|
|
24
|
+
"ai": aiFeature,
|
|
25
|
+
"composite-ai": compositeAiFeature,
|
|
26
|
+
"transcript-ai": transcriptAiFeature,
|
|
27
|
+
"collab": collabFeature,
|
|
28
|
+
"block-ui": blockUiFeature,
|
|
29
|
+
"themes": themesFeature
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* `composeEditor` of `presets/compose` over the Vue bindings: the editor of the three dimensions (`content`,
|
|
33
|
+
* `interaction`, `ai`), pruned by the capabilities of `options.backend`. Call during component setup (`themesFeature()`
|
|
34
|
+
* reads the current Vue app to stop the theme runtime when it unmounts).
|
|
35
|
+
*/
|
|
36
|
+
const composeEditor = (options) => composeEditor$1(VUE_BINDINGS, options);
|
|
37
|
+
/**
|
|
38
|
+
* The advanced editor on the Vue surface: `{ content: 'rich', interaction: 'full', ai: true }`, every dimension option
|
|
39
|
+
* overridable (`compositeKinds`, `backend`, `add`, `remove`, ...). Collaboration is active only when a session is passed
|
|
40
|
+
* to the surface.
|
|
41
|
+
*/
|
|
42
|
+
const advancedEditor = (options = {}) => composeEditor({
|
|
43
|
+
content: "rich",
|
|
44
|
+
interaction: "full",
|
|
45
|
+
ai: true,
|
|
46
|
+
...options
|
|
47
|
+
});
|
|
48
|
+
//#endregion
|
|
49
|
+
export { advancedEditor, composeEditor };
|
|
50
|
+
|
|
51
|
+
//# sourceMappingURL=compose.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compose.js","names":["EditorCommandPalette","compose"],"sources":["../../src/vue/compose.ts"],"sourcesContent":["import type { Component } from 'vue'\nimport { coreUiFeature } from '../core/core-feature'\nimport EditorCommandPalette from './components/EditorCommandPalette.vue'\nimport { aiFeature } from '../features/ai/vue'\nimport { authorsFeature } from '../features/authors/vue'\nimport { blockUiFeature } from '../features/block-ui/vue'\nimport { collabFeature } from '../features/collab/vue'\nimport { commentsFeature } from '../features/comments/vue'\nimport { compositeFeature } from '../features/composites/vue'\nimport { mediaFeature } from '../features/media/vue'\nimport { themesFeature } from '../features/themes/vue'\nimport { transcriptFeature } from '../features/transcript/vue'\nimport { compositeAiFeature } from '../integrations/composite-ai'\nimport { transcriptAiFeature } from '../integrations/transcript-ai'\nimport { type ComposedEditor, type ComposeOptions, composeEditor as compose, type UiBindings } from '../presets/compose'\n\n/** The Vue bindings of every UI-bound catalog feature. */\nconst VUE_BINDINGS = {\n 'core-ui': () => coreUiFeature<Component>({ palette: EditorCommandPalette }),\n 'media': mediaFeature,\n 'transcript': transcriptFeature,\n 'composites': compositeFeature,\n 'authors': authorsFeature,\n 'comments': commentsFeature,\n 'ai': aiFeature,\n 'composite-ai': compositeAiFeature,\n 'transcript-ai': transcriptAiFeature,\n 'collab': collabFeature,\n 'block-ui': blockUiFeature,\n 'themes': themesFeature,\n} satisfies UiBindings<Component>\n\n/**\n * `composeEditor` of `presets/compose` over the Vue bindings: the editor of the three dimensions (`content`,\n * `interaction`, `ai`), pruned by the capabilities of `options.backend`. Call during component setup (`themesFeature()`\n * reads the current Vue app to stop the theme runtime when it unmounts).\n */\nexport const composeEditor = (options: ComposeOptions<Component>): ComposedEditor<Component> => compose(VUE_BINDINGS, options)\n\n/**\n * The advanced editor on the Vue surface: `{ content: 'rich', interaction: 'full', ai: true }`, every dimension option\n * overridable (`compositeKinds`, `backend`, `add`, `remove`, ...). Collaboration is active only when a session is passed\n * to the surface.\n */\nexport const advancedEditor = (options: Partial<ComposeOptions<Component>> = {}): ComposedEditor<Component> => composeEditor({ content: 'rich', interaction: 'full', ai: true, ...options })\n"],"mappings":";;;;;;;;;;;;;;;;AAiBA,MAAM,eAAe;CACnB,iBAAiB,cAAyB,EAAE,SAASA,UAAqB,CAAC;CAC3E,SAAS;CACT,cAAc;CACd,cAAc;CACd,WAAW;CACX,YAAY;CACZ,MAAM;CACN,gBAAgB;CAChB,iBAAiB;CACjB,UAAU;CACV,YAAY;CACZ,UAAU;AACZ;;;;;;AAOA,MAAa,iBAAiB,YAAkEC,gBAAQ,cAAc,OAAO;;;;;;AAO7H,MAAa,kBAAkB,UAA8C,CAAC,MAAiC,cAAc;CAAE,SAAS;CAAQ,aAAa;CAAQ,IAAI;CAAM,GAAG;AAAQ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context-key.js","names":[],"sources":["../../src/vue/context-key.ts"],"sourcesContent":["import type { InjectionKey } from 'vue'\nimport type { EditorContext } from '../core/context'\n\n// The injection key alone, so modules that only read the context (`adapters/vue`) do not reach the Nuxt UI kit that `./context` installs.\nexport const EDITOR_CONTEXT: InjectionKey<EditorContext> = Symbol('tiptap-editor:context')\n"],"mappings":";AAIA,MAAa,iBAA8C,OAAO,uBAAuB"}
|
package/dist/vue/context.d.ts
CHANGED
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
import { EditorContext, EditorContextOptions } from "../core/context.js";
|
|
2
|
+
import { EDITOR_CONTEXT } from "./context-key.js";
|
|
2
3
|
import { VueUiKit } from "./kit/types.js";
|
|
3
|
-
import {
|
|
4
|
+
import { Plugin } from "vue";
|
|
4
5
|
//#region src/vue/context.d.ts
|
|
5
|
-
export declare const EDITOR_CONTEXT: InjectionKey<EditorContext>;
|
|
6
6
|
/** What `createEditor` takes: the framework-free context options plus the UI kit that renders the chrome. */
|
|
7
7
|
export interface VueEditorOptions extends EditorContextOptions {
|
|
8
8
|
/** The widgets the chrome components render. Default: `nuxtUiKit()` (`/vue/kit/nuxt-ui`), which needs `@nuxt/ui` set up in the host; pass your own `VueUiKit` to render the chrome with another library. */
|
|
9
9
|
kit?: VueUiKit;
|
|
10
10
|
}
|
|
11
11
|
/**
|
|
12
|
-
* The editor context of a Vue app: the settings shared by all editors of the app, the
|
|
12
|
+
* The editor context of a Vue app: the settings shared by all editors of the app, the backend and the UI kit
|
|
13
13
|
* (`useUiKit()`). Install with `app.use(createEditor())`. The settings are read from localStorage right away (client only) and every change is
|
|
14
|
-
* written back. With
|
|
15
|
-
*
|
|
16
|
-
* network error keep the local ones; once synced every change is also sent to the
|
|
14
|
+
* written back. With a backend that offers `settings` (the default HTTP backend does), `backend.settings.load()` (on the first
|
|
15
|
+
* `useEditorSettings()`) answers: the user's account settings replace them (`synced`), `null` (the host keeps none), a
|
|
16
|
+
* refusal (`401`, `501`) or a network error keep the local ones; once synced every change is also sent to the backend
|
|
17
|
+
* (`save`, debounced). Watcher
|
|
17
18
|
* and timer stop with the app. App-level notices (`options.notify`, default: queued until the first `EditorSurface`
|
|
18
19
|
* mounts and hands over the kit's `notifier()`) show as the kit's toasts.
|
|
19
20
|
*/
|
|
@@ -21,4 +22,5 @@ export declare function createEditor({ kit, ...options }?: VueEditorOptions): Pl
|
|
|
21
22
|
/** The app's editor context; throws a descriptive error when `createEditor()` was not installed. */
|
|
22
23
|
export declare function useEditorContext(): EditorContext;
|
|
23
24
|
//#endregion
|
|
25
|
+
export { EDITOR_CONTEXT };
|
|
24
26
|
//# sourceMappingURL=context.d.ts.map
|
package/dist/vue/context.js
CHANGED
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import { createEditorContext } from "../core/context.js";
|
|
2
|
+
import { EDITOR_CONTEXT } from "./context-key.js";
|
|
2
3
|
import { VUE_UI_KIT } from "./kit/use-ui-kit.js";
|
|
3
4
|
import { createQueuedNotifier } from "./notify.js";
|
|
4
5
|
import { createSettingsBridge } from "./settings.js";
|
|
5
6
|
import { nuxtUiKit } from "./kit/nuxt-ui.js";
|
|
6
7
|
import { inject } from "vue";
|
|
7
8
|
//#region src/vue/context.ts
|
|
8
|
-
const EDITOR_CONTEXT = Symbol("tiptap-editor:context");
|
|
9
9
|
/**
|
|
10
|
-
* The editor context of a Vue app: the settings shared by all editors of the app, the
|
|
10
|
+
* The editor context of a Vue app: the settings shared by all editors of the app, the backend and the UI kit
|
|
11
11
|
* (`useUiKit()`). Install with `app.use(createEditor())`. The settings are read from localStorage right away (client only) and every change is
|
|
12
|
-
* written back. With
|
|
13
|
-
*
|
|
14
|
-
* network error keep the local ones; once synced every change is also sent to the
|
|
12
|
+
* written back. With a backend that offers `settings` (the default HTTP backend does), `backend.settings.load()` (on the first
|
|
13
|
+
* `useEditorSettings()`) answers: the user's account settings replace them (`synced`), `null` (the host keeps none), a
|
|
14
|
+
* refusal (`401`, `501`) or a network error keep the local ones; once synced every change is also sent to the backend
|
|
15
|
+
* (`save`, debounced). Watcher
|
|
15
16
|
* and timer stop with the app. App-level notices (`options.notify`, default: queued until the first `EditorSurface`
|
|
16
17
|
* mounts and hands over the kit's `notifier()`) show as the kit's toasts.
|
|
17
18
|
*/
|
package/dist/vue/context.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","names":[],"sources":["../../src/vue/context.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"context.js","names":[],"sources":["../../src/vue/context.ts"],"sourcesContent":["import { inject, type Plugin } from 'vue'\nimport { createEditorContext, type EditorContext, type EditorContextOptions } from '../core/context'\nimport { EDITOR_CONTEXT } from './context-key'\nimport { createQueuedNotifier } from './notify'\nimport { createSettingsBridge } from './settings'\nimport { nuxtUiKit } from './kit/nuxt-ui'\nimport { VUE_UI_KIT } from './kit/use-ui-kit'\nimport type { VueUiKit } from './kit/types'\n\nexport { EDITOR_CONTEXT }\n\n/** What `createEditor` takes: the framework-free context options plus the UI kit that renders the chrome. */\nexport interface VueEditorOptions extends EditorContextOptions {\n /** The widgets the chrome components render. Default: `nuxtUiKit()` (`/vue/kit/nuxt-ui`), which needs `@nuxt/ui` set up in the host; pass your own `VueUiKit` to render the chrome with another library. */\n kit?: VueUiKit\n}\n\n/**\n * The editor context of a Vue app: the settings shared by all editors of the app, the backend and the UI kit\n * (`useUiKit()`). Install with `app.use(createEditor())`. The settings are read from localStorage right away (client only) and every change is\n * written back. With a backend that offers `settings` (the default HTTP backend does), `backend.settings.load()` (on the first\n * `useEditorSettings()`) answers: the user's account settings replace them (`synced`), `null` (the host keeps none), a\n * refusal (`401`, `501`) or a network error keep the local ones; once synced every change is also sent to the backend\n * (`save`, debounced). Watcher\n * and timer stop with the app. App-level notices (`options.notify`, default: queued until the first `EditorSurface`\n * mounts and hands over the kit's `notifier()`) show as the kit's toasts.\n */\nexport function createEditor({ kit = nuxtUiKit(), ...options }: VueEditorOptions = {}): Plugin {\n return {\n install(app) {\n const ctx = createEditorContext({ notify: createQueuedNotifier(), ...options })\n app.provide(VUE_UI_KIT, kit)\n app.provide(EDITOR_CONTEXT, ctx)\n const bridge = createSettingsBridge(ctx)\n app.onUnmount(() => {\n bridge.dispose()\n ctx.dispose()\n })\n },\n }\n}\n\n/** The app's editor context; throws a descriptive error when `createEditor()` was not installed. */\nexport function useEditorContext(): EditorContext {\n const context = inject(EDITOR_CONTEXT, null)\n if (!context) throw new Error('@ecsplico/editor: no editor context; install it with app.use(createEditor())')\n return context\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AA2BA,SAAgB,aAAa,EAAE,MAAM,UAAU,GAAG,GAAG,YAA8B,CAAC,GAAW;CAC7F,OAAO,EACL,QAAQ,KAAK;EACX,MAAM,MAAM,oBAAoB;GAAE,QAAQ,qBAAqB;GAAG,GAAG;EAAQ,CAAC;EAC9E,IAAI,QAAQ,YAAY,GAAG;EAC3B,IAAI,QAAQ,gBAAgB,GAAG;EAC/B,MAAM,SAAS,qBAAqB,GAAG;EACvC,IAAI,gBAAgB;GAClB,OAAO,QAAQ;GACf,IAAI,QAAQ;EACd,CAAC;CACH,EACF;AACF;;AAGA,SAAgB,mBAAkC;CAChD,MAAM,UAAU,OAAO,gBAAgB,IAAI;CAC3C,IAAI,CAAC,SAAS,MAAM,IAAI,MAAM,8EAA8E;CAC5G,OAAO;AACT"}
|
package/dist/vue/index.d.ts
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { EditorFeature, EditorPreset } from "../core/feature.js";
|
|
2
|
-
import _default from "./components/
|
|
3
|
-
import _default$1 from "./components/
|
|
4
|
-
import _default$2 from "./components/
|
|
5
|
-
import _default$3 from "./components/
|
|
6
|
-
import _default$4 from "./components/
|
|
7
|
-
import _default$5 from "./components/
|
|
2
|
+
import _default from "./components/EditorCommandPalette.vue.js";
|
|
3
|
+
import _default$1 from "./components/EditorSettingsModal.vue.js";
|
|
4
|
+
import _default$2 from "./components/EditorSettingsPanel.vue.js";
|
|
5
|
+
import _default$3 from "./components/EditorSurface.vue.js";
|
|
6
|
+
import _default$4 from "./components/EditorToolbar.vue.js";
|
|
7
|
+
import _default$5 from "./components/SettingsSection.vue.js";
|
|
8
|
+
import _default$6 from "./components/SuggestionList.vue.js";
|
|
9
|
+
import { EDITOR_CONTEXT } from "./context-key.js";
|
|
8
10
|
import { VueUiKit } from "./kit/types.js";
|
|
9
|
-
import {
|
|
11
|
+
import { VueEditorOptions, createEditor, useEditorContext } from "./context.js";
|
|
10
12
|
import { VUE_UI_KIT, useUiKit } from "./kit/use-ui-kit.js";
|
|
11
13
|
import { QueuedNotifier, attachNotifier, createQueuedNotifier } from "./notify.js";
|
|
12
14
|
import { useEditorI18n } from "./use-editor-i18n.js";
|
|
@@ -22,5 +24,5 @@ export type VueFeature = EditorFeature<Component>;
|
|
|
22
24
|
/** A preset of Vue features: what `EditorSurface` mounts. */
|
|
23
25
|
export type VuePreset = EditorPreset<Component>;
|
|
24
26
|
//#endregion
|
|
25
|
-
export { EDITOR_CONTEXT, EDITOR_UI, _default as
|
|
27
|
+
export { EDITOR_CONTEXT, EDITOR_UI, _default as EditorCommandPalette, _default$1 as EditorSettingsModal, _default$2 as EditorSettingsPanel, _default$3 as EditorSurface, _default$4 as EditorToolbar, type QueuedNotifier, _default$5 as SettingsSection, _default$6 as SuggestionList, VUE_UI_KIT, type VueEditorOptions, type VueUiKit, attachNotifier, createEditor, createQueuedNotifier, storeFromRef, trackedStore, useEditorContext, useEditorI18n, useEditorSettings, useEditorUi, useNotifier, useStoreRef, useUiKit, useWritableStoreRef, vueSuggestionRenderer };
|
|
26
28
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/vue/index.js
CHANGED
|
@@ -1,16 +1,18 @@
|
|
|
1
|
+
import { EDITOR_CONTEXT } from "./context-key.js";
|
|
1
2
|
import { VUE_UI_KIT, useUiKit } from "./kit/use-ui-kit.js";
|
|
2
3
|
import { attachNotifier, createQueuedNotifier } from "./notify.js";
|
|
3
4
|
import { useEditorSettings } from "./settings.js";
|
|
4
|
-
import {
|
|
5
|
+
import { createEditor, useEditorContext } from "./context.js";
|
|
5
6
|
import { useEditorI18n } from "./use-editor-i18n.js";
|
|
6
7
|
import { EDITOR_UI, useEditorUi } from "./use-editor-ui.js";
|
|
7
|
-
import _sfc_main$
|
|
8
|
+
import _sfc_main$6 from "./components/SuggestionList.js";
|
|
8
9
|
import { vueSuggestionRenderer } from "./suggestion-renderer.js";
|
|
9
|
-
import _sfc_main$
|
|
10
|
-
import _sfc_main from "./components/EditorSettingsModal.js";
|
|
11
|
-
import _sfc_main$
|
|
10
|
+
import _sfc_main$2 from "./components/EditorSettingsPanel.js";
|
|
11
|
+
import _sfc_main$1 from "./components/EditorSettingsModal.js";
|
|
12
|
+
import _sfc_main$3 from "./components/EditorSurface.js";
|
|
12
13
|
import { useNotifier } from "./use-notifier.js";
|
|
13
14
|
import { storeFromRef, trackedStore, useStoreRef, useWritableStoreRef } from "./store-ref.js";
|
|
14
|
-
import _sfc_main
|
|
15
|
-
import _sfc_main$
|
|
16
|
-
|
|
15
|
+
import _sfc_main from "./components/EditorCommandPalette.js";
|
|
16
|
+
import _sfc_main$5 from "./components/SettingsSection.js";
|
|
17
|
+
import _sfc_main$4 from "./components/EditorToolbar.js";
|
|
18
|
+
export { EDITOR_CONTEXT, EDITOR_UI, _sfc_main as EditorCommandPalette, _sfc_main$1 as EditorSettingsModal, _sfc_main$2 as EditorSettingsPanel, _sfc_main$3 as EditorSurface, _sfc_main$4 as EditorToolbar, _sfc_main$5 as SettingsSection, _sfc_main$6 as SuggestionList, VUE_UI_KIT, attachNotifier, createEditor, createQueuedNotifier, storeFromRef, trackedStore, useEditorContext, useEditorI18n, useEditorSettings, useEditorUi, useNotifier, useStoreRef, useUiKit, useWritableStoreRef, vueSuggestionRenderer };
|
package/dist/vue/kit/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { AlertProps, AvatarProps, BadgeProps, ButtonProps, ChipProps, DropdownItem, DropdownItems, DropdownMenuProps, FieldGroupProps, FormFieldProps, IconProps, InputExposed, InputMenuItem, InputMenuProps, InputProps, KitAnchor, KitColor, KitOverlayContent, KitOverlayUi, KitSize, KitVariant, ModalProps, PopoverProps, RadioGroupProps, SelectItem, SelectMenuProps, SelectProps, SeparatorProps, SwitchProps, TabItem, TableColumn, TableProps, TableSort, TabsProps, TextareaProps, TooltipProps, TreeNode, TreeProps, VueUiKit } from "./types.js";
|
|
1
|
+
import { AlertProps, AvatarProps, BadgeProps, ButtonProps, ChipProps, CommandPaletteGroup, CommandPaletteItem, CommandPaletteProps, DropdownItem, DropdownItems, DropdownMenuProps, FieldGroupProps, FormFieldProps, IconProps, InputExposed, InputMenuItem, InputMenuProps, InputProps, KitAnchor, KitColor, KitOverlayContent, KitOverlayUi, KitSize, KitVariant, ModalProps, PopoverProps, RadioGroupProps, SelectItem, SelectMenuProps, SelectProps, SeparatorProps, SwitchProps, TabItem, TableColumn, TableProps, TableSort, TabsProps, TextareaProps, TooltipProps, TreeNode, TreeProps, VueUiKit } from "./types.js";
|
|
2
2
|
import { VUE_UI_KIT, useUiKit } from "./use-ui-kit.js";
|
|
3
|
-
export { type AlertProps, type AvatarProps, type BadgeProps, type ButtonProps, type ChipProps, type DropdownItem, type DropdownItems, type DropdownMenuProps, type FieldGroupProps, type FormFieldProps, type IconProps, type InputExposed, type InputMenuItem, type InputMenuProps, type InputProps, type KitAnchor, type KitColor, type KitOverlayContent, type KitOverlayUi, type KitSize, type KitVariant, type ModalProps, type PopoverProps, type RadioGroupProps, type SelectItem, type SelectMenuProps, type SelectProps, type SeparatorProps, type SwitchProps, type TabItem, type TableColumn, type TableProps, type TableSort, type TabsProps, type TextareaProps, type TooltipProps, type TreeNode, type TreeProps, VUE_UI_KIT, type VueUiKit, useUiKit };
|
|
3
|
+
export { type AlertProps, type AvatarProps, type BadgeProps, type ButtonProps, type ChipProps, type CommandPaletteGroup, type CommandPaletteItem, type CommandPaletteProps, type DropdownItem, type DropdownItems, type DropdownMenuProps, type FieldGroupProps, type FormFieldProps, type IconProps, type InputExposed, type InputMenuItem, type InputMenuProps, type InputProps, type KitAnchor, type KitColor, type KitOverlayContent, type KitOverlayUi, type KitSize, type KitVariant, type ModalProps, type PopoverProps, type RadioGroupProps, type SelectItem, type SelectMenuProps, type SelectProps, type SeparatorProps, type SwitchProps, type TabItem, type TableColumn, type TableProps, type TableSort, type TabsProps, type TextareaProps, type TooltipProps, type TreeNode, type TreeProps, VUE_UI_KIT, type VueUiKit, useUiKit };
|
package/dist/vue/kit/nuxt-ui.js
CHANGED
|
@@ -4,6 +4,7 @@ import Avatar from "@nuxt/ui/components/Avatar.vue";
|
|
|
4
4
|
import Badge from "@nuxt/ui/components/Badge.vue";
|
|
5
5
|
import Button from "@nuxt/ui/components/Button.vue";
|
|
6
6
|
import Chip from "@nuxt/ui/components/Chip.vue";
|
|
7
|
+
import NuxtCommandPalette from "@nuxt/ui/components/CommandPalette.vue";
|
|
7
8
|
import DropdownMenu from "@nuxt/ui/components/DropdownMenu.vue";
|
|
8
9
|
import FieldGroup from "@nuxt/ui/components/FieldGroup.vue";
|
|
9
10
|
import FormField from "@nuxt/ui/components/FormField.vue";
|
|
@@ -63,6 +64,27 @@ const Table = defineComponent({
|
|
|
63
64
|
}, slots)
|
|
64
65
|
});
|
|
65
66
|
/**
|
|
67
|
+
* Nuxt UI's `UCommandPalette` matching by the kit contract (typed text = case-insensitive substring of a row's `label`,
|
|
68
|
+
* `description` or `id`) instead of its fuzzy default (threshold 0.1, 12 results). The default fuse keys (label,
|
|
69
|
+
* description, suffix) stay searched next to `id`; the same filter applies to a second level. Groups with `ignoreFilter`
|
|
70
|
+
* (the host matched them) are passed through to the widget, which lists them as given.
|
|
71
|
+
*/
|
|
72
|
+
const CommandPalette = defineComponent({
|
|
73
|
+
name: "KitCommandPalette",
|
|
74
|
+
inheritAttrs: false,
|
|
75
|
+
setup: (_, { attrs, slots }) => () => h(NuxtCommandPalette, {
|
|
76
|
+
...attrs,
|
|
77
|
+
fuse: {
|
|
78
|
+
fuseOptions: {
|
|
79
|
+
keys: ["id"],
|
|
80
|
+
threshold: 0,
|
|
81
|
+
ignoreLocation: true
|
|
82
|
+
},
|
|
83
|
+
resultLimit: Number.MAX_SAFE_INTEGER
|
|
84
|
+
}
|
|
85
|
+
}, slots)
|
|
86
|
+
});
|
|
87
|
+
/**
|
|
66
88
|
* The Nuxt UI kit: the widgets are Nuxt UI's own components, the notifier its `useToast()`. The host needs `@nuxt/ui`
|
|
67
89
|
* set up (`<UApp>` around the editor, the Vite/Nuxt plugin) and its stylesheet next to the editor's
|
|
68
90
|
* (`@ecsplico/editor/vue/kit/nuxt-ui.css` maps the `--sk-*` tokens onto `--ui-*`).
|
|
@@ -74,6 +96,7 @@ function nuxtUiKit() {
|
|
|
74
96
|
Badge,
|
|
75
97
|
Button,
|
|
76
98
|
Chip,
|
|
99
|
+
CommandPalette,
|
|
77
100
|
DropdownMenu,
|
|
78
101
|
FieldGroup,
|
|
79
102
|
FormField,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nuxt-ui.js","names":[],"sources":["../../../src/vue/kit/nuxt-ui.ts"],"sourcesContent":["import Alert from '@nuxt/ui/components/Alert.vue'\nimport Avatar from '@nuxt/ui/components/Avatar.vue'\nimport Badge from '@nuxt/ui/components/Badge.vue'\nimport Button from '@nuxt/ui/components/Button.vue'\nimport Chip from '@nuxt/ui/components/Chip.vue'\nimport DropdownMenu from '@nuxt/ui/components/DropdownMenu.vue'\nimport FieldGroup from '@nuxt/ui/components/FieldGroup.vue'\nimport FormField from '@nuxt/ui/components/FormField.vue'\nimport Icon from '@nuxt/ui/components/Icon.vue'\nimport Input from '@nuxt/ui/components/Input.vue'\nimport InputMenu from '@nuxt/ui/components/InputMenu.vue'\nimport Modal from '@nuxt/ui/components/Modal.vue'\nimport Popover from '@nuxt/ui/components/Popover.vue'\nimport RadioGroup from '@nuxt/ui/components/RadioGroup.vue'\nimport Select from '@nuxt/ui/components/Select.vue'\nimport SelectMenu from '@nuxt/ui/components/SelectMenu.vue'\nimport Separator from '@nuxt/ui/components/Separator.vue'\nimport Switch from '@nuxt/ui/components/Switch.vue'\nimport NuxtTable from '@nuxt/ui/components/Table.vue'\nimport Tabs from '@nuxt/ui/components/Tabs.vue'\nimport Textarea from '@nuxt/ui/components/Textarea.vue'\nimport Tooltip from '@nuxt/ui/components/Tooltip.vue'\nimport Tree from '@nuxt/ui/components/Tree.vue'\nimport { useToast } from '@nuxt/ui/composables'\nimport { type Component, defineComponent, h } from 'vue'\nimport type { Notice, Notifier } from '../../core/notify'\nimport type { VueUiKit } from './types'\n\n/** The part of Nuxt UI's `useToast()` that notices need. */\nexport interface NoticeToaster {\n add(toast: {\n id?: string\n title: string\n description?: string\n icon?: string\n duration?: number\n color: 'neutral' | 'success' | 'warning' | 'error'\n actions?: { label: string, color: 'neutral', variant: 'outline', onClick: () => void }[]\n }): unknown\n remove?(id: string): unknown\n}\n\n// i18n-ignore: toast colour names, not text\nconst COLORS = { info: 'neutral', success: 'success', warning: 'warning', error: 'error' } as const\n\n/** Shows notices as Nuxt UI toasts (`kind` is the toast `color`; `id` replaces a visible toast of the same id). */\nexport function nuxtUiNotifier(toast: NoticeToaster): Notifier {\n const notify: Notifier = ({ id, title, description, kind, icon, duration, action }: Notice) => {\n toast.add({\n ...(id !== undefined && { id }),\n title,\n ...(description !== undefined && { description }),\n ...(icon !== undefined && { icon }),\n ...(duration !== undefined && { duration }),\n ...(action && { actions: [{ label: action.label, color: 'neutral' as const, variant: 'outline' as const, onClick: action.onClick }] }),\n color: COLORS[kind ?? 'info'],\n })\n }\n notify.dismiss = (id) => { toast.remove?.(id) }\n return notify\n}\n\n/** Nuxt UI's `UTable` with TanStack's own sorting switched off: the contract is that the host orders `data` itself. */\nconst Table = defineComponent({\n name: 'KitTable',\n inheritAttrs: false,\n setup: (_, { attrs, slots }) => () => h(NuxtTable as unknown as Component, { ...attrs, sortingOptions: { manualSorting: true } }, slots),\n})\n\n/**\n * The Nuxt UI kit: the widgets are Nuxt UI's own components, the notifier its `useToast()`. The host needs `@nuxt/ui`\n * set up (`<UApp>` around the editor, the Vite/Nuxt plugin) and its stylesheet next to the editor's\n * (`@ecsplico/editor/vue/kit/nuxt-ui.css` maps the `--sk-*` tokens onto `--ui-*`).\n */\nexport function nuxtUiKit(): VueUiKit {\n return {\n Alert,\n Avatar,\n Badge,\n Button,\n Chip,\n DropdownMenu,\n FieldGroup,\n FormField,\n Icon,\n Input,\n InputMenu,\n Modal,\n Popover,\n RadioGroup,\n Select,\n SelectMenu,\n Separator,\n Switch,\n Table,\n Tabs,\n Textarea,\n Tooltip,\n Tree,\n notifier: () => nuxtUiNotifier(useToast()),\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"nuxt-ui.js","names":[],"sources":["../../../src/vue/kit/nuxt-ui.ts"],"sourcesContent":["import Alert from '@nuxt/ui/components/Alert.vue'\nimport Avatar from '@nuxt/ui/components/Avatar.vue'\nimport Badge from '@nuxt/ui/components/Badge.vue'\nimport Button from '@nuxt/ui/components/Button.vue'\nimport Chip from '@nuxt/ui/components/Chip.vue'\nimport NuxtCommandPalette from '@nuxt/ui/components/CommandPalette.vue'\nimport DropdownMenu from '@nuxt/ui/components/DropdownMenu.vue'\nimport FieldGroup from '@nuxt/ui/components/FieldGroup.vue'\nimport FormField from '@nuxt/ui/components/FormField.vue'\nimport Icon from '@nuxt/ui/components/Icon.vue'\nimport Input from '@nuxt/ui/components/Input.vue'\nimport InputMenu from '@nuxt/ui/components/InputMenu.vue'\nimport Modal from '@nuxt/ui/components/Modal.vue'\nimport Popover from '@nuxt/ui/components/Popover.vue'\nimport RadioGroup from '@nuxt/ui/components/RadioGroup.vue'\nimport Select from '@nuxt/ui/components/Select.vue'\nimport SelectMenu from '@nuxt/ui/components/SelectMenu.vue'\nimport Separator from '@nuxt/ui/components/Separator.vue'\nimport Switch from '@nuxt/ui/components/Switch.vue'\nimport NuxtTable from '@nuxt/ui/components/Table.vue'\nimport Tabs from '@nuxt/ui/components/Tabs.vue'\nimport Textarea from '@nuxt/ui/components/Textarea.vue'\nimport Tooltip from '@nuxt/ui/components/Tooltip.vue'\nimport Tree from '@nuxt/ui/components/Tree.vue'\nimport { useToast } from '@nuxt/ui/composables'\nimport { type Component, defineComponent, h } from 'vue'\nimport type { Notice, Notifier } from '../../core/notify'\nimport type { VueUiKit } from './types'\n\n/** The part of Nuxt UI's `useToast()` that notices need. */\nexport interface NoticeToaster {\n add(toast: {\n id?: string\n title: string\n description?: string\n icon?: string\n duration?: number\n color: 'neutral' | 'success' | 'warning' | 'error'\n actions?: { label: string, color: 'neutral', variant: 'outline', onClick: () => void }[]\n }): unknown\n remove?(id: string): unknown\n}\n\n// i18n-ignore: toast colour names, not text\nconst COLORS = { info: 'neutral', success: 'success', warning: 'warning', error: 'error' } as const\n\n/** Shows notices as Nuxt UI toasts (`kind` is the toast `color`; `id` replaces a visible toast of the same id). */\nexport function nuxtUiNotifier(toast: NoticeToaster): Notifier {\n const notify: Notifier = ({ id, title, description, kind, icon, duration, action }: Notice) => {\n toast.add({\n ...(id !== undefined && { id }),\n title,\n ...(description !== undefined && { description }),\n ...(icon !== undefined && { icon }),\n ...(duration !== undefined && { duration }),\n ...(action && { actions: [{ label: action.label, color: 'neutral' as const, variant: 'outline' as const, onClick: action.onClick }] }),\n color: COLORS[kind ?? 'info'],\n })\n }\n notify.dismiss = (id) => { toast.remove?.(id) }\n return notify\n}\n\n/** Nuxt UI's `UTable` with TanStack's own sorting switched off: the contract is that the host orders `data` itself. */\nconst Table = defineComponent({\n name: 'KitTable',\n inheritAttrs: false,\n setup: (_, { attrs, slots }) => () => h(NuxtTable as unknown as Component, { ...attrs, sortingOptions: { manualSorting: true } }, slots),\n})\n\n/**\n * Nuxt UI's `UCommandPalette` matching by the kit contract (typed text = case-insensitive substring of a row's `label`,\n * `description` or `id`) instead of its fuzzy default (threshold 0.1, 12 results). The default fuse keys (label,\n * description, suffix) stay searched next to `id`; the same filter applies to a second level. Groups with `ignoreFilter`\n * (the host matched them) are passed through to the widget, which lists them as given.\n */\nconst CommandPalette = defineComponent({\n name: 'KitCommandPalette',\n inheritAttrs: false,\n setup: (_, { attrs, slots }) => () => h(NuxtCommandPalette as unknown as Component, {\n ...attrs,\n fuse: { fuseOptions: { keys: ['id'], threshold: 0, ignoreLocation: true }, resultLimit: Number.MAX_SAFE_INTEGER },\n }, slots),\n})\n\n/**\n * The Nuxt UI kit: the widgets are Nuxt UI's own components, the notifier its `useToast()`. The host needs `@nuxt/ui`\n * set up (`<UApp>` around the editor, the Vite/Nuxt plugin) and its stylesheet next to the editor's\n * (`@ecsplico/editor/vue/kit/nuxt-ui.css` maps the `--sk-*` tokens onto `--ui-*`).\n */\nexport function nuxtUiKit(): VueUiKit {\n return {\n Alert,\n Avatar,\n Badge,\n Button,\n Chip,\n CommandPalette,\n DropdownMenu,\n FieldGroup,\n FormField,\n Icon,\n Input,\n InputMenu,\n Modal,\n Popover,\n RadioGroup,\n Select,\n SelectMenu,\n Separator,\n Switch,\n Table,\n Tabs,\n Textarea,\n Tooltip,\n Tree,\n notifier: () => nuxtUiNotifier(useToast()),\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AA4CA,MAAM,SAAS;CAAE,MAAM;CAAW,SAAS;CAAW,SAAS;CAAW,OAAO;AAAQ;;AAGzF,SAAgB,eAAe,OAAgC;CAC7D,MAAM,UAAoB,EAAE,IAAI,OAAO,aAAa,MAAM,MAAM,UAAU,aAAqB;EAC7F,MAAM,IAAI;GACR,GAAI,OAAO,KAAA,KAAa,EAAE,GAAG;GAC7B;GACA,GAAI,gBAAgB,KAAA,KAAa,EAAE,YAAY;GAC/C,GAAI,SAAS,KAAA,KAAa,EAAE,KAAK;GACjC,GAAI,aAAa,KAAA,KAAa,EAAE,SAAS;GACzC,GAAI,UAAU,EAAE,SAAS,CAAC;IAAE,OAAO,OAAO;IAAO,OAAO;IAAoB,SAAS;IAAoB,SAAS,OAAO;GAAQ,CAAC,EAAE;GACpI,OAAO,OAAO,QAAQ;EACxB,CAAC;CACH;CACA,OAAO,WAAW,OAAO;EAAE,MAAM,SAAS,EAAE;CAAE;CAC9C,OAAO;AACT;;AAGA,MAAM,QAAQ,gBAAgB;CAC5B,MAAM;CACN,cAAc;CACd,QAAQ,GAAG,EAAE,OAAO,kBAAkB,EAAE,WAAmC;EAAE,GAAG;EAAO,gBAAgB,EAAE,eAAe,KAAK;CAAE,GAAG,KAAK;AACzI,CAAC;;;;;;;AAQD,MAAM,iBAAiB,gBAAgB;CACrC,MAAM;CACN,cAAc;CACd,QAAQ,GAAG,EAAE,OAAO,kBAAkB,EAAE,oBAA4C;EAClF,GAAG;EACH,MAAM;GAAE,aAAa;IAAE,MAAM,CAAC,IAAI;IAAG,WAAW;IAAG,gBAAgB;GAAK;GAAG,aAAa,OAAO;EAAiB;CAClH,GAAG,KAAK;AACV,CAAC;;;;;;AAOD,SAAgB,YAAsB;CACpC,OAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,gBAAgB,eAAe,SAAS,CAAC;CAC3C;AACF"}
|
package/dist/vue/kit/types.d.ts
CHANGED
|
@@ -223,8 +223,46 @@ export interface InputMenuProps {
|
|
|
223
223
|
disabled?: boolean;
|
|
224
224
|
open?: boolean;
|
|
225
225
|
}
|
|
226
|
+
/** One row of `CommandPalette`; `children` make it open a second level (the rows replace the list, the back button returns). */
|
|
227
|
+
export interface CommandPaletteItem {
|
|
228
|
+
/** Searched together with `label`. */
|
|
229
|
+
id?: string;
|
|
230
|
+
label: string;
|
|
231
|
+
/** Iconify name. */
|
|
232
|
+
icon?: string;
|
|
233
|
+
/** Shortcut keys shown at the row's end (`['meta', 'b']`). */
|
|
234
|
+
kbds?: string[];
|
|
235
|
+
description?: string;
|
|
236
|
+
disabled?: boolean;
|
|
237
|
+
/** Runs when the row is picked (never on a row with `children`). */
|
|
238
|
+
onSelect?: () => void;
|
|
239
|
+
children?: CommandPaletteItem[];
|
|
240
|
+
}
|
|
241
|
+
/** A headed set of `CommandPalette` rows. */
|
|
242
|
+
export interface CommandPaletteGroup {
|
|
243
|
+
id: string;
|
|
244
|
+
label: string;
|
|
245
|
+
/** The host already matched the rows against `searchTerm`: they are listed as given, in this order, without the widget's own matching. */
|
|
246
|
+
ignoreFilter?: boolean;
|
|
247
|
+
items: CommandPaletteItem[];
|
|
248
|
+
}
|
|
249
|
+
/**
|
|
250
|
+
* CommandPalette: a search box over grouped rows, filtered while typing (the typed text is a case-insensitive substring
|
|
251
|
+
* of a row's `label`, `description` or `id`; groups with `ignoreFilter` are listed as given), Enter/click picks the highlighted
|
|
252
|
+
* enabled row. `searchTerm` (`v-model:search-term`) is the typed text; it resets when a second level opens or closes. Slot: `empty` (no row matches).
|
|
253
|
+
* Renders inside a `Modal` content (no frame of its own).
|
|
254
|
+
*/
|
|
255
|
+
export interface CommandPaletteProps {
|
|
256
|
+
groups?: CommandPaletteGroup[];
|
|
257
|
+
/** The typed text. */
|
|
258
|
+
searchTerm?: string;
|
|
259
|
+
placeholder?: string;
|
|
260
|
+
/** Shows the dialog's close button (emits `update:open(false)`). */
|
|
261
|
+
close?: boolean;
|
|
262
|
+
}
|
|
226
263
|
/**
|
|
227
|
-
* Modal slots: default (an optional trigger), `body`, `footer` (the title and description come from the props)
|
|
264
|
+
* Modal slots: default (an optional trigger), `body`, `footer` (the title and description come from the props), and
|
|
265
|
+
* `content` (the whole panel, replacing header, body and footer; `CommandPalette` fills it). Emits
|
|
228
266
|
* `update:open`; `close` and `after:leave` after the dialog closed.
|
|
229
267
|
*/
|
|
230
268
|
export interface ModalProps {
|
|
@@ -346,6 +384,7 @@ export interface VueUiKit {
|
|
|
346
384
|
Badge: Component;
|
|
347
385
|
Button: Component;
|
|
348
386
|
Chip: Component;
|
|
387
|
+
CommandPalette: Component;
|
|
349
388
|
DropdownMenu: Component;
|
|
350
389
|
FieldGroup: Component;
|
|
351
390
|
FormField: Component;
|