@ecsplico/editor 2.1.2 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +68 -1
- package/README.md +39 -156
- package/dist/adapters/comments/drizzle.d.ts +1 -1
- 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/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 +23 -20
- package/dist/adapters/nitro.js +58 -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/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 +89 -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 +35 -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 +14 -9
- package/dist/core/index.js +12 -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 +13 -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/util.js +11 -0
- package/dist/core/util.js.map +1 -0
- package/dist/document/DocumentSurface.d.ts +1 -1
- 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 +4 -1
- 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 +31 -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 +75 -26
- package/dist/features/composites/components/CompositeChrome.js.map +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 +37 -4
- package/dist/features/composites/components/CompositeFieldEditor.js.map +1 -1
- package/dist/features/composites/components/CompositeInspector.js +17 -5
- 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 +8 -1
- 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 +40 -1
- 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 +65 -17
- 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 +24 -1
- package/dist/features/composites/react/CompositeFieldEditor.js.map +1 -1
- package/dist/features/composites/react/CompositeInspector.js +11 -5
- 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 +21 -2
- package/dist/features/composites/rows.js +63 -9
- 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 +2 -2
- package/dist/features/media/react/FileView.js +19 -2
- package/dist/features/media/react/FileView.js.map +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 +6 -5
- 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/{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 +30 -9
- package/dist/server/handlers/ai.js +170 -36
- 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.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 +28 -8
- package/dist/vue/SimpleEditor.js +62 -16
- package/dist/vue/SimpleEditor.js.map +1 -1
- package/dist/vue/SimpleEditor.vue.d.ts +37 -7
- 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 +7 -7
- 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,6 +1,6 @@
|
|
|
1
1
|
import { useEditorContext } from "../../vue/context.js";
|
|
2
|
-
import { createDocumentChat } from "./document-chat-model.js";
|
|
3
2
|
import { modelProfiles } from "./model-profiles.js";
|
|
3
|
+
import { createDocumentChat } from "./document-chat-model.js";
|
|
4
4
|
import { useNotifier } from "../../vue/use-notifier.js";
|
|
5
5
|
import { useStoreRef } from "../../vue/store-ref.js";
|
|
6
6
|
import { computed, getCurrentScope, onScopeDispose } from "vue";
|
|
@@ -13,7 +13,7 @@ import { computed, getCurrentScope, onScopeDispose } from "vue";
|
|
|
13
13
|
function useDocumentChat(editor) {
|
|
14
14
|
const context = useEditorContext();
|
|
15
15
|
const chat = createDocumentChat({
|
|
16
|
-
|
|
16
|
+
ai: context.backend.ai,
|
|
17
17
|
modelRef: modelProfiles(context).modelRef,
|
|
18
18
|
notify: useNotifier(editor),
|
|
19
19
|
t: context.t
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-document-chat.js","names":[],"sources":["../../../src/features/ai/use-document-chat.ts"],"sourcesContent":["import type { Editor } from '@tiptap/core'\nimport { computed, getCurrentScope, type MaybeRefOrGetter, onScopeDispose } from 'vue'\nimport { useEditorContext } from '../../vue/context'\nimport { useStoreRef } from '../../vue/store-ref'\nimport { useNotifier } from '../../vue/use-notifier'\nimport { createDocumentChat } from './document-chat-model'\nimport { modelProfiles } from './model-profiles'\n\nexport type { AgentOpState } from './agent-op-review'\nexport type { DocumentChatGeneration, DocumentChatTurn } from './document-chat-model'\n\n/**\n * The document chat (see `createDocumentChat`) as Vue refs: a thin hook. Call it during component setup (it injects\n * the editor context); the request stops with the component's scope. The 429 notice goes to `editor`'s surface (else\n * the app's notifier).\n */\nexport function useDocumentChat(editor?: MaybeRefOrGetter<Editor | undefined>) {\n const context = useEditorContext()\n const chat = createDocumentChat({
|
|
1
|
+
{"version":3,"file":"use-document-chat.js","names":[],"sources":["../../../src/features/ai/use-document-chat.ts"],"sourcesContent":["import type { Editor } from '@tiptap/core'\nimport { computed, getCurrentScope, type MaybeRefOrGetter, onScopeDispose } from 'vue'\nimport { useEditorContext } from '../../vue/context'\nimport { useStoreRef } from '../../vue/store-ref'\nimport { useNotifier } from '../../vue/use-notifier'\nimport { createDocumentChat } from './document-chat-model'\nimport { modelProfiles } from './model-profiles'\n\nexport type { AgentOpState } from './agent-op-review'\nexport type { DocumentChatGeneration, DocumentChatTurn } from './document-chat-model'\n\n/**\n * The document chat (see `createDocumentChat`) as Vue refs: a thin hook. Call it during component setup (it injects\n * the editor context); the request stops with the component's scope. The 429 notice goes to `editor`'s surface (else\n * the app's notifier).\n */\nexport function useDocumentChat(editor?: MaybeRefOrGetter<Editor | undefined>) {\n const context = useEditorContext()\n const chat = createDocumentChat({ ai: context.backend.ai, modelRef: modelProfiles(context).modelRef, notify: useNotifier(editor), t: context.t })\n const snapshot = useStoreRef(chat.state)\n if (getCurrentScope()) onScopeDispose(chat.abort)\n const { ask, abort, reset, decide, reveal, addGeneration, updateGeneration, removeGeneration, clearError } = chat\n return {\n /** The underlying model, for flows that act on it (`createAiSidebarFlow`). */\n model: chat,\n messages: computed(() => snapshot.value.messages),\n ops: computed(() => snapshot.value.ops),\n streaming: computed(() => snapshot.value.streaming),\n error: computed(() => snapshot.value.error),\n ask,\n abort,\n reset,\n decide,\n reveal,\n addGeneration,\n updateGeneration,\n removeGeneration,\n clearError,\n }\n}\n"],"mappings":";;;;;;;;;;;;AAgBA,SAAgB,gBAAgB,QAA+C;CAC7E,MAAM,UAAU,iBAAiB;CACjC,MAAM,OAAO,mBAAmB;EAAE,IAAI,QAAQ,QAAQ;EAAI,UAAU,cAAc,OAAO,CAAC,CAAC;EAAU,QAAQ,YAAY,MAAM;EAAG,GAAG,QAAQ;CAAE,CAAC;CAChJ,MAAM,WAAW,YAAY,KAAK,KAAK;CACvC,IAAI,gBAAgB,GAAG,eAAe,KAAK,KAAK;CAChD,MAAM,EAAE,KAAK,OAAO,OAAO,QAAQ,QAAQ,eAAe,kBAAkB,kBAAkB,eAAe;CAC7G,OAAO;;EAEL,OAAO;EACP,UAAU,eAAe,SAAS,MAAM,QAAQ;EAChD,KAAK,eAAe,SAAS,MAAM,GAAG;EACtC,WAAW,eAAe,SAAS,MAAM,SAAS;EAClD,OAAO,eAAe,SAAS,MAAM,KAAK;EAC1C;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;AACF"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ModelSlot } from "../../settings/values.js";
|
|
2
2
|
import "../../settings/index.js";
|
|
3
|
-
import { ModelProfile, ModelRef
|
|
3
|
+
import { ModelProfile, ModelRef } from "../../core/backend-types.js";
|
|
4
|
+
import { UserModelProfile } from "./protocol/models.js";
|
|
4
5
|
import "./protocol/index.js";
|
|
5
6
|
import { ComputedRef, Ref } from "vue";
|
|
6
7
|
//#region src/features/ai/use-model-profiles.d.ts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { ReadonlyStore } from "../../core/store.js";
|
|
1
2
|
import { AuthorColorStyle } from "../../settings/values.js";
|
|
2
3
|
import "../../settings/index.js";
|
|
3
|
-
import { ReadonlyStore } from "../../core/store.js";
|
|
4
4
|
import { AuthorIdentity } from "../../core/feature.js";
|
|
5
5
|
import "../../core/index.js";
|
|
6
6
|
import { Editor, Extension } from "@tiptap/core";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { derived } from "../../core/store.js";
|
|
2
|
-
import { AuthorMark } from "./schema.js";
|
|
2
|
+
import { AuthorMark, authorsSchemaExtensions } from "./schema.js";
|
|
3
3
|
import { AuthorAttribution } from "./attribution.js";
|
|
4
4
|
//#region src/features/authors/feature.ts
|
|
5
5
|
/**
|
|
@@ -14,6 +14,8 @@ import { AuthorAttribution } from "./attribution.js";
|
|
|
14
14
|
function authorsFeatureCore(ui) {
|
|
15
15
|
return {
|
|
16
16
|
id: "authors",
|
|
17
|
+
dimension: "content",
|
|
18
|
+
schemaExtensions: authorsSchemaExtensions,
|
|
17
19
|
extensions: (ctx) => [AuthorMark, AuthorAttribution.configure({
|
|
18
20
|
user: () => ctx.collaboration?.user ?? null,
|
|
19
21
|
isYSync: (tr) => ctx.anchorResolver?.isYSync(tr) ?? false,
|
|
@@ -22,16 +24,15 @@ function authorsFeatureCore(ui) {
|
|
|
22
24
|
style: editing.authorColorStyle
|
|
23
25
|
}), (a, b) => a.enabled === b.enabled && a.style === b.style)
|
|
24
26
|
})],
|
|
25
|
-
|
|
26
|
-
id: "
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}]
|
|
27
|
+
commands: (ctx) => [{
|
|
28
|
+
id: "authorColors",
|
|
29
|
+
toolbar: {
|
|
30
|
+
group: "collaboration",
|
|
31
|
+
order: 20
|
|
32
|
+
},
|
|
33
|
+
icon: "i-lucide-palette",
|
|
34
|
+
label: ctx.t("authors.title"),
|
|
35
|
+
component: ui.toolbarButton
|
|
35
36
|
}],
|
|
36
37
|
settingsTabs: (ctx) => [{
|
|
37
38
|
id: "authors",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"feature.js","names":[],"sources":["../../../src/features/authors/feature.ts"],"sourcesContent":["import type { EditorFeature } from '../../core'\nimport { derived } from '../../core/store'\nimport { AuthorAttribution } from './attribution'\nimport { AuthorMark } from './schema'\n\n/** What a framework binding supplies to the authors feature. */\nexport interface AuthorsUi<C> {\n /** The „Autorenfarben“ toolbar button (its popover is the `AuthorColorsPanel`). */\n toolbarButton: C\n /** The „Autorenfarben“ settings tab component of the framework. */\n settingsTab: C\n}\n\n/**\n * Who wrote what: every text run the session's user inserts carries an `author` mark (id, name, colour; one author per\n * run, remote changes and Yjs undo/redo keep the original author's mark), the colouring mode (settings\n * `editing.authorColors` and `editing.authorColorStyle`) tints or colours the runs by author, the „Autorenfarben“\n * toolbar button shows the switch, the style and a legend of the document's authors, and the `authors` settings tab\n * holds the same switches. Attribution is inert without a user (`collaboration.user` of the surface), so standalone\n * editors write unmarked text. Remote changes are told apart through the preset's anchor resolver (collab feature),\n * which this feature does not import. The mark has no Markdown form (Markdown export and AI context stay clean).\n */\nexport function authorsFeatureCore<C>(ui: AuthorsUi<C>): EditorFeature<C> {\n return {\n id: 'authors',\n extensions: ctx => [\n AuthorMark,\n AuthorAttribution.configure({\n user: () => ctx.collaboration?.user ?? null,\n isYSync: tr => ctx.anchorResolver?.isYSync(tr) ?? false,\n coloring: derived(\n ctx.settings,\n ({ editing }) => ({ enabled: editing.authorColors, style: editing.authorColorStyle }),\n (a, b) => a.enabled === b.enabled && a.style === b.style,\n ),\n }),\n ],\n
|
|
1
|
+
{"version":3,"file":"feature.js","names":[],"sources":["../../../src/features/authors/feature.ts"],"sourcesContent":["import type { EditorFeature } from '../../core'\nimport { derived } from '../../core/store'\nimport { AuthorAttribution } from './attribution'\nimport { AuthorMark, authorsSchemaExtensions } from './schema'\n\n/** What a framework binding supplies to the authors feature. */\nexport interface AuthorsUi<C> {\n /** The „Autorenfarben“ toolbar button (its popover is the `AuthorColorsPanel`). */\n toolbarButton: C\n /** The „Autorenfarben“ settings tab component of the framework. */\n settingsTab: C\n}\n\n/**\n * Who wrote what: every text run the session's user inserts carries an `author` mark (id, name, colour; one author per\n * run, remote changes and Yjs undo/redo keep the original author's mark), the colouring mode (settings\n * `editing.authorColors` and `editing.authorColorStyle`) tints or colours the runs by author, the „Autorenfarben“\n * toolbar button shows the switch, the style and a legend of the document's authors, and the `authors` settings tab\n * holds the same switches. Attribution is inert without a user (`collaboration.user` of the surface), so standalone\n * editors write unmarked text. Remote changes are told apart through the preset's anchor resolver (collab feature),\n * which this feature does not import. The mark has no Markdown form (Markdown export and AI context stay clean).\n */\nexport function authorsFeatureCore<C>(ui: AuthorsUi<C>): EditorFeature<C> {\n return {\n id: 'authors',\n dimension: 'content',\n schemaExtensions: authorsSchemaExtensions,\n extensions: ctx => [\n AuthorMark,\n AuthorAttribution.configure({\n user: () => ctx.collaboration?.user ?? null,\n isYSync: tr => ctx.anchorResolver?.isYSync(tr) ?? false,\n coloring: derived(\n ctx.settings,\n ({ editing }) => ({ enabled: editing.authorColors, style: editing.authorColorStyle }),\n (a, b) => a.enabled === b.enabled && a.style === b.style,\n ),\n }),\n ],\n commands: ctx => [\n { id: 'authorColors', toolbar: { group: 'collaboration', order: 20 }, icon: 'i-lucide-palette', label: ctx.t('authors.title'), component: ui.toolbarButton },\n ],\n settingsTabs: ctx => [{ id: 'authors', label: ctx.t('authors.tab'), icon: 'i-lucide-palette', component: ui.settingsTab }],\n }\n}\n"],"mappings":";;;;;;;;;;;;;AAsBA,SAAgB,mBAAsB,IAAoC;CACxE,OAAO;EACL,IAAI;EACJ,WAAW;EACX,kBAAkB;EAClB,aAAY,QAAO,CACjB,YACA,kBAAkB,UAAU;GAC1B,YAAY,IAAI,eAAe,QAAQ;GACvC,UAAS,OAAM,IAAI,gBAAgB,QAAQ,EAAE,KAAK;GAClD,UAAU,QACR,IAAI,WACH,EAAE,eAAe;IAAE,SAAS,QAAQ;IAAc,OAAO,QAAQ;GAAiB,KAClF,GAAG,MAAM,EAAE,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,KACrD;EACF,CAAC,CACH;EACA,WAAU,QAAO,CACf;GAAE,IAAI;GAAgB,SAAS;IAAE,OAAO;IAAiB,OAAO;GAAG;GAAG,MAAM;GAAoB,OAAO,IAAI,EAAE,eAAe;GAAG,WAAW,GAAG;EAAc,CAC7J;EACA,eAAc,QAAO,CAAC;GAAE,IAAI;GAAW,OAAO,IAAI,EAAE,aAAa;GAAG,MAAM;GAAoB,WAAW,GAAG;EAAY,CAAC;CAC3H;AACF"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MenuItem } from "../../core/
|
|
1
|
+
import { MenuItem } from "../../core/command-types.js";
|
|
2
2
|
import { BlockAction, BlockActionContext, BlockTarget } from "../../core/extension-points.js";
|
|
3
3
|
import "../../core/index.js";
|
|
4
4
|
import { Editor } from "@tiptap/core";
|
|
@@ -18,7 +18,7 @@ function blockActionsFor(editor, target, actions) {
|
|
|
18
18
|
abilities: abilitiesAt(editor, target.pos, target.node)
|
|
19
19
|
};
|
|
20
20
|
return actions.flatMap((action) => {
|
|
21
|
-
if (!ctx.abilities.has(action.ability) || action.isVisible?.(ctx) === false) return [];
|
|
21
|
+
if (action.ability && !ctx.abilities.has(action.ability) || action.isVisible?.(ctx) === false) return [];
|
|
22
22
|
if (!action.menu) return [{
|
|
23
23
|
action,
|
|
24
24
|
ctx
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"block-actions.js","names":[],"sources":["../../../src/features/block-ui/block-actions.ts"],"sourcesContent":["import type { Editor } from '@tiptap/core'\nimport { abilitiesAt, type BlockAction, type BlockActionContext, type BlockTarget, type MenuItem } from '../../core'\nimport { isChromeNode } from '../../core/schema'\n\n/** An action `target` offers, with the context it runs with and, for a `menu` action, its items. */\nexport interface BlockActionEntry {\n action: BlockAction\n ctx: BlockActionContext\n menu?: MenuItem[]\n}\n\n/** Hovering a composite's title/description/tags row addresses the composite itself. */\nexport function effectiveTarget(editor: Editor, target: BlockTarget): BlockTarget {\n if (!isChromeNode(target.node)) return target\n const $pos = editor.state.doc.resolve(target.pos)\n return { node: $pos.parent, pos: $pos.before() }\n}\n\n/** The actions `target` offers; a `menu` action only when its menu has items. */\nexport function blockActionsFor(editor: Editor, target: BlockTarget, actions: readonly BlockAction[]): BlockActionEntry[] {\n const ctx: BlockActionContext = { ...target, editor, abilities: abilitiesAt(editor, target.pos, target.node) }\n return actions.flatMap((action): BlockActionEntry[] => {\n if (!ctx.abilities.has(action.ability) || action.isVisible?.(ctx) === false) return []\n if (!action.menu) return [{ action, ctx }]\n const menu = action.menu(ctx)\n return menu.length ? [{ action, ctx, menu }] : []\n })\n}\n\n/**\n * Attribute a block's own chrome sets on the elements it shows in its top-right corner (status badges, kind or menu\n * buttons, ...). The hover bar docks immediately left of them, vertically centred on them, so both read as one row\n * instead of the bar covering the block's icons. A block without such elements gets the bar at the editor's right edge.\n */\nexport const BLOCK_CORNER_ATTR = 'data-block-corner'\n\n/** Where a block's corner elements sit, in viewport coordinates. */\nexport interface BlockCorner {\n /** Left edge of the leftmost corner element. */\n left: number\n /** Vertical centre of the first corner element. */\n centerY: number\n /** The marked elements, for a host that wants to watch them for size changes. */\n elements: HTMLElement[]\n}\n\n/**\n * The corner elements `dom` (a block's node view root) marks with `BLOCK_CORNER_ATTR`, or null when none is shown.\n * Elements inside a nested block's own node view belong to that block and do not count; neither do hidden ones (no\n * layout box).\n */\nexport function blockCornerOf(dom: HTMLElement): BlockCorner | null {\n const elements = [...dom.querySelectorAll<HTMLElement>(`[${BLOCK_CORNER_ATTR}]`)].filter((element) => {\n const owner = element.closest('[data-node-view-wrapper]')\n return !(owner && owner !== dom && dom.contains(owner))\n })\n const rects = elements.map(element => element.getBoundingClientRect()).filter(rect => rect.width > 0 && rect.height > 0)\n if (!rects.length) return null\n return {\n left: Math.min(...rects.map(rect => rect.left)),\n centerY: rects[0]!.top + rects[0]!.height / 2,\n elements,\n }\n}\n"],"mappings":";;;;AAYA,SAAgB,gBAAgB,QAAgB,QAAkC;CAChF,IAAI,CAAC,aAAa,OAAO,IAAI,GAAG,OAAO;CACvC,MAAM,OAAO,OAAO,MAAM,IAAI,QAAQ,OAAO,GAAG;CAChD,OAAO;EAAE,MAAM,KAAK;EAAQ,KAAK,KAAK,OAAO;CAAE;AACjD;;AAGA,SAAgB,gBAAgB,QAAgB,QAAqB,SAAqD;CACxH,MAAM,MAA0B;EAAE,GAAG;EAAQ;EAAQ,WAAW,YAAY,QAAQ,OAAO,KAAK,OAAO,IAAI;CAAE;CAC7G,OAAO,QAAQ,SAAS,WAA+B;EACrD,
|
|
1
|
+
{"version":3,"file":"block-actions.js","names":[],"sources":["../../../src/features/block-ui/block-actions.ts"],"sourcesContent":["import type { Editor } from '@tiptap/core'\nimport { abilitiesAt, type BlockAction, type BlockActionContext, type BlockTarget, type MenuItem } from '../../core'\nimport { isChromeNode } from '../../core/schema'\n\n/** An action `target` offers, with the context it runs with and, for a `menu` action, its items. */\nexport interface BlockActionEntry {\n action: BlockAction\n ctx: BlockActionContext\n menu?: MenuItem[]\n}\n\n/** Hovering a composite's title/description/tags row addresses the composite itself. */\nexport function effectiveTarget(editor: Editor, target: BlockTarget): BlockTarget {\n if (!isChromeNode(target.node)) return target\n const $pos = editor.state.doc.resolve(target.pos)\n return { node: $pos.parent, pos: $pos.before() }\n}\n\n/** The actions `target` offers; a `menu` action only when its menu has items. */\nexport function blockActionsFor(editor: Editor, target: BlockTarget, actions: readonly BlockAction[]): BlockActionEntry[] {\n const ctx: BlockActionContext = { ...target, editor, abilities: abilitiesAt(editor, target.pos, target.node) }\n return actions.flatMap((action): BlockActionEntry[] => {\n if ((action.ability && !ctx.abilities.has(action.ability)) || action.isVisible?.(ctx) === false) return []\n if (!action.menu) return [{ action, ctx }]\n const menu = action.menu(ctx)\n return menu.length ? [{ action, ctx, menu }] : []\n })\n}\n\n/**\n * Attribute a block's own chrome sets on the elements it shows in its top-right corner (status badges, kind or menu\n * buttons, ...). The hover bar docks immediately left of them, vertically centred on them, so both read as one row\n * instead of the bar covering the block's icons. A block without such elements gets the bar at the editor's right edge.\n */\nexport const BLOCK_CORNER_ATTR = 'data-block-corner'\n\n/** Where a block's corner elements sit, in viewport coordinates. */\nexport interface BlockCorner {\n /** Left edge of the leftmost corner element. */\n left: number\n /** Vertical centre of the first corner element. */\n centerY: number\n /** The marked elements, for a host that wants to watch them for size changes. */\n elements: HTMLElement[]\n}\n\n/**\n * The corner elements `dom` (a block's node view root) marks with `BLOCK_CORNER_ATTR`, or null when none is shown.\n * Elements inside a nested block's own node view belong to that block and do not count; neither do hidden ones (no\n * layout box).\n */\nexport function blockCornerOf(dom: HTMLElement): BlockCorner | null {\n const elements = [...dom.querySelectorAll<HTMLElement>(`[${BLOCK_CORNER_ATTR}]`)].filter((element) => {\n const owner = element.closest('[data-node-view-wrapper]')\n return !(owner && owner !== dom && dom.contains(owner))\n })\n const rects = elements.map(element => element.getBoundingClientRect()).filter(rect => rect.width > 0 && rect.height > 0)\n if (!rects.length) return null\n return {\n left: Math.min(...rects.map(rect => rect.left)),\n centerY: rects[0]!.top + rects[0]!.height / 2,\n elements,\n }\n}\n"],"mappings":";;;;AAYA,SAAgB,gBAAgB,QAAgB,QAAkC;CAChF,IAAI,CAAC,aAAa,OAAO,IAAI,GAAG,OAAO;CACvC,MAAM,OAAO,OAAO,MAAM,IAAI,QAAQ,OAAO,GAAG;CAChD,OAAO;EAAE,MAAM,KAAK;EAAQ,KAAK,KAAK,OAAO;CAAE;AACjD;;AAGA,SAAgB,gBAAgB,QAAgB,QAAqB,SAAqD;CACxH,MAAM,MAA0B;EAAE,GAAG;EAAQ;EAAQ,WAAW,YAAY,QAAQ,OAAO,KAAK,OAAO,IAAI;CAAE;CAC7G,OAAO,QAAQ,SAAS,WAA+B;EACrD,IAAK,OAAO,WAAW,CAAC,IAAI,UAAU,IAAI,OAAO,OAAO,KAAM,OAAO,YAAY,GAAG,MAAM,OAAO,OAAO,CAAC;EACzG,IAAI,CAAC,OAAO,MAAM,OAAO,CAAC;GAAE;GAAQ;EAAI,CAAC;EACzC,MAAM,OAAO,OAAO,KAAK,GAAG;EAC5B,OAAO,KAAK,SAAS,CAAC;GAAE;GAAQ;GAAK;EAAK,CAAC,IAAI,CAAC;CAClD,CAAC;AACH;;;;;;AAOA,MAAa,oBAAoB;;;;;;AAiBjC,SAAgB,cAAc,KAAsC;CAClE,MAAM,WAAW,CAAC,GAAG,IAAI,iBAA8B,IAAI,kBAAkB,EAAE,CAAC,CAAC,CAAC,QAAQ,YAAY;EACpG,MAAM,QAAQ,QAAQ,QAAQ,0BAA0B;EACxD,OAAO,EAAE,SAAS,UAAU,OAAO,IAAI,SAAS,KAAK;CACvD,CAAC;CACD,MAAM,QAAQ,SAAS,KAAI,YAAW,QAAQ,sBAAsB,CAAC,CAAC,CAAC,QAAO,SAAQ,KAAK,QAAQ,KAAK,KAAK,SAAS,CAAC;CACvH,IAAI,CAAC,MAAM,QAAQ,OAAO;CAC1B,OAAO;EACL,MAAM,KAAK,IAAI,GAAG,MAAM,KAAI,SAAQ,KAAK,IAAI,CAAC;EAC9C,SAAS,MAAM,EAAE,CAAE,MAAM,MAAM,EAAE,CAAE,SAAS;EAC5C;CACF;AACF"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { isChromeNode } from "../../../core/schema/node-flags.js";
|
|
2
1
|
import { editorEntryOf } from "../../../core/editor-ui.js";
|
|
2
|
+
import { isChromeNode } from "../../../core/schema/node-flags.js";
|
|
3
3
|
import { useUiKit } from "../../../vue/kit/use-ui-kit.js";
|
|
4
4
|
import { useEditorSettings } from "../../../vue/settings.js";
|
|
5
5
|
import { firstLineCenterShift, gutterShiftOf, handleLeftOf, hasKindIcon } from "../handle-geometry.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"feature.js","names":[],"sources":["../../../src/features/block-ui/feature.ts"],"sourcesContent":["import { NodeRange } from '@tiptap/extension-node-range'\nimport type { EditorFeature } from '../../core'\n\n/** What a framework binding supplies to the block-ui feature. */\nexport interface BlockUiUi<C> {\n /** The block UI of an editor (drag handle, permanent handles, hover actions); mounted beside the editor content. */\n overlay: C\n}\n\n/**\n * Block-level UI beside the editor content: the drag handle (upstream `@tiptap/extension-drag-handle`) with hover\n * targeting, and the hover actions of the targeted block (features' and host block actions, `BlockActionsOverlay`).\n * Also adds block-range selection (`NodeRange`: Mod+drag, Shift+↑/↓). Composite chrome (`editorChrome` nodes) targets its\n * parent block.\n *\n * Opt-in: the simple editor has none of it. Installing a binding also bundles the drag handle's transitive collaboration\n * support code (its upstream package imports `@tiptap/extension-collaboration` and `y-tiptap`), even without a live\n * collaboration session.\n */\nexport function blockUiFeatureCore<C>(ui: BlockUiUi<C>): EditorFeature<C> {\n return {\n id: 'block-ui',\n extensions: () => [NodeRange],\n overlays: [ui.overlay],\n }\n}\n"],"mappings":";;;;;;;;;;;;AAmBA,SAAgB,mBAAsB,IAAoC;CACxE,OAAO;EACL,IAAI;EACJ,kBAAkB,CAAC,SAAS;EAC5B,UAAU,CAAC,GAAG,OAAO;CACvB;AACF"}
|
|
1
|
+
{"version":3,"file":"feature.js","names":[],"sources":["../../../src/features/block-ui/feature.ts"],"sourcesContent":["import { NodeRange } from '@tiptap/extension-node-range'\nimport type { EditorFeature } from '../../core'\n\n/** What a framework binding supplies to the block-ui feature. */\nexport interface BlockUiUi<C> {\n /** The block UI of an editor (drag handle, permanent handles, hover actions); mounted beside the editor content. */\n overlay: C\n}\n\n/**\n * Block-level UI beside the editor content: the drag handle (upstream `@tiptap/extension-drag-handle`) with hover\n * targeting, and the hover actions of the targeted block (features' and host block actions, `BlockActionsOverlay`).\n * Also adds block-range selection (`NodeRange`: Mod+drag, Shift+↑/↓). Composite chrome (`editorChrome` nodes) targets its\n * parent block.\n *\n * Opt-in: the simple editor has none of it. Installing a binding also bundles the drag handle's transitive collaboration\n * support code (its upstream package imports `@tiptap/extension-collaboration` and `y-tiptap`), even without a live\n * collaboration session.\n */\nexport function blockUiFeatureCore<C>(ui: BlockUiUi<C>): EditorFeature<C> {\n return {\n id: 'block-ui',\n dimension: 'interaction',\n extensions: () => [NodeRange],\n overlays: [ui.overlay],\n }\n}\n"],"mappings":";;;;;;;;;;;;AAmBA,SAAgB,mBAAsB,IAAoC;CACxE,OAAO;EACL,IAAI;EACJ,WAAW;EACX,kBAAkB,CAAC,SAAS;EAC5B,UAAU,CAAC,GAAG,OAAO;CACvB;AACF"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { isChromeNode } from "../../../core/schema/node-flags.js";
|
|
2
1
|
import { editorEntryOf } from "../../../core/editor-ui.js";
|
|
2
|
+
import { isChromeNode } from "../../../core/schema/node-flags.js";
|
|
3
3
|
import { cn } from "../../../react/ui/utils.js";
|
|
4
4
|
import { Icon } from "../../../react/Icon.js";
|
|
5
5
|
import { useEditorSettings } from "../../../react/settings.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { absolutePositionToRelativePosition, relativePositionToAbsolutePosition, ySyncPluginKey, yUndoPluginKey } from "@tiptap/y-tiptap";
|
|
2
1
|
import * as Y from "yjs";
|
|
2
|
+
import { absolutePositionToRelativePosition, relativePositionToAbsolutePosition, ySyncPluginKey, yUndoPluginKey } from "@tiptap/y-tiptap";
|
|
3
3
|
//#region src/features/collab/anchor-resolver.ts
|
|
4
4
|
const positionMappings = /* @__PURE__ */ new WeakMap();
|
|
5
5
|
/**
|
|
@@ -15,6 +15,8 @@ import { CollaborationCaret } from "@tiptap/extension-collaboration-caret";
|
|
|
15
15
|
function collabFeatureCore(ui = {}) {
|
|
16
16
|
return {
|
|
17
17
|
id: "collab",
|
|
18
|
+
dimension: "interaction",
|
|
19
|
+
backend: ["collaboration"],
|
|
18
20
|
anchorResolver: () => yjsAnchorResolver,
|
|
19
21
|
extensions: ({ collaboration }) => {
|
|
20
22
|
if (!collaboration) return [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"feature.js","names":[],"sources":["../../../src/features/collab/feature.ts"],"sourcesContent":["import type { AnyExtension } from '@tiptap/core'\nimport { Collaboration } from '@tiptap/extension-collaboration'\nimport { CollaborationCaret } from '@tiptap/extension-collaboration-caret'\nimport type { EditorFeature } from '../../core'\nimport { yjsAnchorResolver } from './anchor-resolver'\n\n/** What a framework binding supplies to the collab feature. */\nexport interface CollabUi {\n /** Extensions added before `Collaboration` while a session exists (framework state-sync plugins). */\n extensions?: AnyExtension[]\n}\n\n/**\n * Real-time collaboration through Yjs. Active only with a session on the surface (`collaboration` prop): the Y.Doc\n * is then the document (`Collaboration`, which brings the per-user undo/redo; core turns its own history off), and a\n * provider adds remote carets (`CollaborationCaret`, labelled with the session's `user`). Without a session the\n * feature contributes no extensions, so the editor behaves like a standalone one. It also supplies `DocAnchors` with\n * the Yjs-backed `AnchorResolver`, so anchored ranges (AI reviews, ghost text, chat ops) survive concurrent edits.\n *\n * Pairs with the server of `@ecsplico/editor/nuxt` (or any Hocuspocus server on the matching advanced schema).\n * A surface given a `collaboration` session requires this feature and throws otherwise.\n */\nexport function collabFeatureCore(ui: CollabUi = {}): EditorFeature<never> {\n return {\n id: 'collab',\n anchorResolver: () => yjsAnchorResolver,\n extensions: ({ collaboration }) => {\n if (!collaboration) return []\n if (collaboration.token !== undefined && collaboration.provider) collaboration.provider.configuration.token = collaboration.token\n return [\n ...(ui.extensions ?? []),\n Collaboration.configure({ document: collaboration.ydoc }),\n ...(collaboration.provider\n ? [CollaborationCaret.configure({ provider: collaboration.provider, ...(collaboration.user && { user: collaboration.user }) })]\n : []),\n ]\n },\n }\n}\n"],"mappings":";;;;;;;;;;;;;;AAsBA,SAAgB,kBAAkB,KAAe,CAAC,GAAyB;CACzE,OAAO;EACL,IAAI;EACJ,sBAAsB;EACtB,aAAa,EAAE,oBAAoB;GACjC,IAAI,CAAC,eAAe,OAAO,CAAC;GAC5B,IAAI,cAAc,UAAU,KAAA,KAAa,cAAc,UAAU,cAAc,SAAS,cAAc,QAAQ,cAAc;GAC5H,OAAO;IACL,GAAI,GAAG,cAAc,CAAC;IACtB,cAAc,UAAU,EAAE,UAAU,cAAc,KAAK,CAAC;IACxD,GAAI,cAAc,WACd,CAAC,mBAAmB,UAAU;KAAE,UAAU,cAAc;KAAU,GAAI,cAAc,QAAQ,EAAE,MAAM,cAAc,KAAK;IAAG,CAAC,CAAC,IAC5H,CAAC;GACP;EACF;CACF;AACF"}
|
|
1
|
+
{"version":3,"file":"feature.js","names":[],"sources":["../../../src/features/collab/feature.ts"],"sourcesContent":["import type { AnyExtension } from '@tiptap/core'\nimport { Collaboration } from '@tiptap/extension-collaboration'\nimport { CollaborationCaret } from '@tiptap/extension-collaboration-caret'\nimport type { EditorFeature } from '../../core'\nimport { yjsAnchorResolver } from './anchor-resolver'\n\n/** What a framework binding supplies to the collab feature. */\nexport interface CollabUi {\n /** Extensions added before `Collaboration` while a session exists (framework state-sync plugins). */\n extensions?: AnyExtension[]\n}\n\n/**\n * Real-time collaboration through Yjs. Active only with a session on the surface (`collaboration` prop): the Y.Doc\n * is then the document (`Collaboration`, which brings the per-user undo/redo; core turns its own history off), and a\n * provider adds remote carets (`CollaborationCaret`, labelled with the session's `user`). Without a session the\n * feature contributes no extensions, so the editor behaves like a standalone one. It also supplies `DocAnchors` with\n * the Yjs-backed `AnchorResolver`, so anchored ranges (AI reviews, ghost text, chat ops) survive concurrent edits.\n *\n * Pairs with the server of `@ecsplico/editor/nuxt` (or any Hocuspocus server on the matching advanced schema).\n * A surface given a `collaboration` session requires this feature and throws otherwise.\n */\nexport function collabFeatureCore(ui: CollabUi = {}): EditorFeature<never> {\n return {\n id: 'collab',\n dimension: 'interaction',\n backend: ['collaboration'],\n anchorResolver: () => yjsAnchorResolver,\n extensions: ({ collaboration }) => {\n if (!collaboration) return []\n if (collaboration.token !== undefined && collaboration.provider) collaboration.provider.configuration.token = collaboration.token\n return [\n ...(ui.extensions ?? []),\n Collaboration.configure({ document: collaboration.ydoc }),\n ...(collaboration.provider\n ? [CollaborationCaret.configure({ provider: collaboration.provider, ...(collaboration.user && { user: collaboration.user }) })]\n : []),\n ]\n },\n }\n}\n"],"mappings":";;;;;;;;;;;;;;AAsBA,SAAgB,kBAAkB,KAAe,CAAC,GAAyB;CACzE,OAAO;EACL,IAAI;EACJ,WAAW;EACX,SAAS,CAAC,eAAe;EACzB,sBAAsB;EACtB,aAAa,EAAE,oBAAoB;GACjC,IAAI,CAAC,eAAe,OAAO,CAAC;GAC5B,IAAI,cAAc,UAAU,KAAA,KAAa,cAAc,UAAU,cAAc,SAAS,cAAc,QAAQ,cAAc;GAC5H,OAAO;IACL,GAAI,GAAG,cAAc,CAAC;IACtB,cAAc,UAAU,EAAE,UAAU,cAAc,KAAK,CAAC;IACxD,GAAI,cAAc,WACd,CAAC,mBAAmB,UAAU;KAAE,UAAU,cAAc;KAAU,GAAI,cAAc,QAAQ,EAAE,MAAM,cAAc,KAAK;IAAG,CAAC,CAAC,IAC5H,CAAC;GACP;EACF;CACF;AACF"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { AuthorIdentity } from "../../../core/feature.js";
|
|
2
|
+
import { CommentThread } from "../../../core/backend-types.js";
|
|
2
3
|
import "../../../core/index.js";
|
|
3
|
-
import
|
|
4
|
+
import "../schema.js";
|
|
4
5
|
import { CommentsStore } from "../use-comments.js";
|
|
5
6
|
//#region src/features/comments/components/CommentThreadView.vue.d.ts
|
|
6
7
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { CommentMark } from "./schema.js";
|
|
2
1
|
import { Comments, commentsKey } from "./comments-plugin.js";
|
|
2
|
+
import { CommentMark, commentsSchemaExtensions } from "./schema.js";
|
|
3
3
|
import { provideCommentsModel } from "./model.js";
|
|
4
4
|
import { commentsShortcuts } from "./shortcuts.js";
|
|
5
5
|
import { Extension } from "@tiptap/core";
|
|
@@ -19,6 +19,8 @@ function commentsFeatureCore(ui, options = {}) {
|
|
|
19
19
|
const { model: factory } = options;
|
|
20
20
|
return {
|
|
21
21
|
id: "comments",
|
|
22
|
+
dimension: "interaction",
|
|
23
|
+
schemaExtensions: commentsSchemaExtensions,
|
|
22
24
|
requires: factory ? [] : ["collab"],
|
|
23
25
|
extensions: (ctx) => {
|
|
24
26
|
if (!factory) return [
|
|
@@ -38,16 +40,15 @@ function commentsFeatureCore(ui, options = {}) {
|
|
|
38
40
|
commentsShortcuts(ctx)
|
|
39
41
|
];
|
|
40
42
|
},
|
|
41
|
-
|
|
42
|
-
id: "
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
}]
|
|
43
|
+
commands: (ctx) => [{
|
|
44
|
+
id: "comments",
|
|
45
|
+
toolbar: {
|
|
46
|
+
group: "collaboration",
|
|
47
|
+
order: 10
|
|
48
|
+
},
|
|
49
|
+
icon: "i-lucide-message-square-text",
|
|
50
|
+
label: ctx.t("comments.title"),
|
|
51
|
+
component: ui.toolbarButton
|
|
51
52
|
}],
|
|
52
53
|
overlays: [ui.overlay],
|
|
53
54
|
settingsTabs: (ctx) => [{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"feature.js","names":[],"sources":["../../../src/features/comments/feature.ts"],"sourcesContent":["import { type AnyExtension, type Editor, Extension } from '@tiptap/core'\nimport type { EditorFeature } from '../../core'\nimport { Comments, type CommentsMeta, commentsKey } from './comments-plugin'\nimport { type CommentsModelFactory, type CommentsSnapshot, provideCommentsModel } from './model'\nimport { CommentMark } from './schema'\nimport { commentsShortcuts } from './shortcuts'\n\n/** What a framework binding supplies to the comments feature. */\nexport interface CommentsUi<C> {\n /** The toolbar entry: the margin toggle or the list menu, by the user's comments layout. */\n toolbarButton: C\n /** Mounted beside the editor content: the selection bubble, the inline popover and the layout glue. */\n overlay: C\n /** The „Kommentare“ settings tab component of the framework. */\n settingsTab: C\n}\n\n/** Options of `commentsFeatureCore`. */\nexport interface CommentsFeatureOptions {\n /**\n * Backs the comments with the host's own model (REST threads, a database) instead of the document's Y.Doc: the feature\n * then requires no `collab` feature, the `Comments` plugin reads the user from the model, gets the thread ids\n * (`known`/`hidden`) and the text ranges from its snapshot, and the framework `useComments` hooks use the model of\n * the surface (`commentsModelOf(ctx)`) instead of `createCommentsModel`. The factory runs once for the plugin and once\n * per `useComments` consumer, so a model that shares state between them keeps it outside the factory. The model\n * itself drives the active thread and the draft through the `comments-plugin` helpers.\n */\n model?: CommentsModelFactory\n}\n\n/**\n * Google-Docs-style comments on a collaborative document: select text, „Kommentar“ in the selection bubble, others\n * reply, anyone resolves or reopens a thread. Threads live in the Y.Doc (a `Y.Map` named `comments`, `createCommentsModel`), so\n * they sync live and persist with the document; the text range is the `comment` mark, highlighted by the `Comments`\n * plugin from the thread state. The user chooses per setting (`editing.commentsLayout`) between the margin column\n * (`CommentsMargin`, which the host places in the editor's scroll container and shows while the surface's\n * `commentsOpen` model is true; Mod-Shift-m or the toolbar button toggle it, and it excludes the AI sidebar) and the\n * inline popover plus the toolbar's list. Needs a collaborative surface with a `collaboration.user`: without one the\n * UI says so and nothing can be written (the schema mark stays registered, so stored comment marks round-trip). With\n * `options.model` the threads live wherever the host's model keeps them and no collaboration is needed.\n */\nexport function commentsFeatureCore<C>(ui: CommentsUi<C>, options: CommentsFeatureOptions = {}): EditorFeature<C> {\n const { model: factory } = options\n return {\n id: 'comments',\n requires: factory ? [] : ['collab'],\n extensions: (ctx) => {\n if (!factory) {\n return [\n CommentMark,\n Comments.configure({\n user: () => ctx.collaboration?.user ?? null,\n doc: () => ctx.collaboration?.ydoc ?? null,\n }),\n commentsShortcuts(ctx),\n ]\n }\n provideCommentsModel(ctx, factory)\n const { configured, bridge } = modelExtensions(factory, ctx.getEditor)\n return [CommentMark, configured, bridge, commentsShortcuts(ctx)]\n },\n
|
|
1
|
+
{"version":3,"file":"feature.js","names":[],"sources":["../../../src/features/comments/feature.ts"],"sourcesContent":["import { type AnyExtension, type Editor, Extension } from '@tiptap/core'\nimport type { EditorFeature } from '../../core'\nimport { Comments, type CommentsMeta, commentsKey } from './comments-plugin'\nimport { type CommentsModelFactory, type CommentsSnapshot, provideCommentsModel } from './model'\nimport { CommentMark, commentsSchemaExtensions } from './schema'\nimport { commentsShortcuts } from './shortcuts'\n\n/** What a framework binding supplies to the comments feature. */\nexport interface CommentsUi<C> {\n /** The toolbar entry: the margin toggle or the list menu, by the user's comments layout. */\n toolbarButton: C\n /** Mounted beside the editor content: the selection bubble, the inline popover and the layout glue. */\n overlay: C\n /** The „Kommentare“ settings tab component of the framework. */\n settingsTab: C\n}\n\n/** Options of `commentsFeatureCore`. */\nexport interface CommentsFeatureOptions {\n /**\n * Backs the comments with the host's own model (REST threads, a database) instead of the document's Y.Doc: the feature\n * then requires no `collab` feature, the `Comments` plugin reads the user from the model, gets the thread ids\n * (`known`/`hidden`) and the text ranges from its snapshot, and the framework `useComments` hooks use the model of\n * the surface (`commentsModelOf(ctx)`) instead of `createCommentsModel`. The factory runs once for the plugin and once\n * per `useComments` consumer, so a model that shares state between them keeps it outside the factory. The model\n * itself drives the active thread and the draft through the `comments-plugin` helpers.\n */\n model?: CommentsModelFactory\n}\n\n/**\n * Google-Docs-style comments on a collaborative document: select text, „Kommentar“ in the selection bubble, others\n * reply, anyone resolves or reopens a thread. Threads live in the Y.Doc (a `Y.Map` named `comments`, `createCommentsModel`), so\n * they sync live and persist with the document; the text range is the `comment` mark, highlighted by the `Comments`\n * plugin from the thread state. The user chooses per setting (`editing.commentsLayout`) between the margin column\n * (`CommentsMargin`, which the host places in the editor's scroll container and shows while the surface's\n * `commentsOpen` model is true; Mod-Shift-m or the toolbar button toggle it, and it excludes the AI sidebar) and the\n * inline popover plus the toolbar's list. Needs a collaborative surface with a `collaboration.user`: without one the\n * UI says so and nothing can be written (the schema mark stays registered, so stored comment marks round-trip). With\n * `options.model` the threads live wherever the host's model keeps them and no collaboration is needed.\n */\nexport function commentsFeatureCore<C>(ui: CommentsUi<C>, options: CommentsFeatureOptions = {}): EditorFeature<C> {\n const { model: factory } = options\n return {\n id: 'comments',\n dimension: 'interaction',\n schemaExtensions: commentsSchemaExtensions,\n requires: factory ? [] : ['collab'],\n extensions: (ctx) => {\n if (!factory) {\n return [\n CommentMark,\n Comments.configure({\n user: () => ctx.collaboration?.user ?? null,\n doc: () => ctx.collaboration?.ydoc ?? null,\n }),\n commentsShortcuts(ctx),\n ]\n }\n provideCommentsModel(ctx, factory)\n const { configured, bridge } = modelExtensions(factory, ctx.getEditor)\n return [CommentMark, configured, bridge, commentsShortcuts(ctx)]\n },\n commands: ctx => [\n { id: 'comments', toolbar: { group: 'collaboration', order: 10 }, icon: 'i-lucide-message-square-text', label: ctx.t('comments.title'), component: ui.toolbarButton },\n ],\n overlays: [ui.overlay],\n settingsTabs: ctx => [{ id: 'comments', label: ctx.t('comments.tab'), icon: 'i-lucide-message-square-text', component: ui.settingsTab }],\n }\n}\n\n/**\n * The `Comments` plugin and its feed for a host model: the plugin reads user, availability and `canComment` from the\n * model's snapshot; the bridge extension refreshes the model once the editor exists, mirrors the snapshot's thread ids\n * and ranges into the plugin state (queued, never from inside a transaction) and disposes the model with the editor.\n */\nfunction modelExtensions(factory: CommentsModelFactory, getEditor: Parameters<CommentsModelFactory>[0]): { configured: AnyExtension, bridge: AnyExtension } {\n let created: Editor | undefined\n const model = factory(() => created ?? getEditor())\n const snapshot = () => model.state.get()\n\n let stop: (() => void) | undefined\n let queued = false\n // What the plugin was last told, to skip no-op dispatches and to apply the deactivation rule.\n let told: CommentsSnapshot['threads'] | undefined\n let toldRanges: CommentsSnapshot['ranges'] | undefined\n\n function push() {\n queued = false\n const editor = created\n const value = editor && !editor.isDestroyed ? commentsKey.getState(editor.state) : undefined\n if (!editor || !value) return\n const { threads, ranges } = snapshot()\n if (threads === told && ranges === toldRanges) return\n const known = new Set(threads.map(t => t.id))\n const hidden = new Set(threads.filter(t => t.resolved).map(t => t.id))\n const meta: CommentsMeta = { known, hidden, modelRanges: ranges }\n const before = value.active ? told?.find(t => t.id === value.active) : undefined\n if (value.active && before && !before.resolved && (!known.has(value.active) || hidden.has(value.active))) meta.active = null\n told = threads\n toldRanges = ranges\n editor.view.dispatch(editor.state.tr.setMeta(commentsKey, meta).setMeta('addToHistory', false))\n }\n\n function queue() {\n if (queued) return\n queued = true\n queueMicrotask(push)\n }\n\n return {\n configured: Comments.configure({\n user: () => snapshot().user,\n doc: () => null,\n available: () => snapshot().available,\n canComment: () => snapshot().canComment,\n }),\n bridge: Extension.create({\n name: 'commentsModelBridge',\n onCreate() {\n created = this.editor\n model.refresh()\n stop = model.state.subscribe(queue)\n queue()\n },\n onDestroy() {\n stop?.()\n stop = undefined\n model.dispose()\n created = undefined\n told = undefined\n toldRanges = undefined\n },\n }),\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAyCA,SAAgB,oBAAuB,IAAmB,UAAkC,CAAC,GAAqB;CAChH,MAAM,EAAE,OAAO,YAAY;CAC3B,OAAO;EACL,IAAI;EACJ,WAAW;EACX,kBAAkB;EAClB,UAAU,UAAU,CAAC,IAAI,CAAC,QAAQ;EAClC,aAAa,QAAQ;GACnB,IAAI,CAAC,SACH,OAAO;IACL;IACA,SAAS,UAAU;KACjB,YAAY,IAAI,eAAe,QAAQ;KACvC,WAAW,IAAI,eAAe,QAAQ;IACxC,CAAC;IACD,kBAAkB,GAAG;GACvB;GAEF,qBAAqB,KAAK,OAAO;GACjC,MAAM,EAAE,YAAY,WAAW,gBAAgB,SAAS,IAAI,SAAS;GACrE,OAAO;IAAC;IAAa;IAAY;IAAQ,kBAAkB,GAAG;GAAC;EACjE;EACA,WAAU,QAAO,CACf;GAAE,IAAI;GAAY,SAAS;IAAE,OAAO;IAAiB,OAAO;GAAG;GAAG,MAAM;GAAgC,OAAO,IAAI,EAAE,gBAAgB;GAAG,WAAW,GAAG;EAAc,CACtK;EACA,UAAU,CAAC,GAAG,OAAO;EACrB,eAAc,QAAO,CAAC;GAAE,IAAI;GAAY,OAAO,IAAI,EAAE,cAAc;GAAG,MAAM;GAAgC,WAAW,GAAG;EAAY,CAAC;CACzI;AACF;;;;;;AAOA,SAAS,gBAAgB,SAA+B,WAAoG;CAC1J,IAAI;CACJ,MAAM,QAAQ,cAAc,WAAW,UAAU,CAAC;CAClD,MAAM,iBAAiB,MAAM,MAAM,IAAI;CAEvC,IAAI;CACJ,IAAI,SAAS;CAEb,IAAI;CACJ,IAAI;CAEJ,SAAS,OAAO;EACd,SAAS;EACT,MAAM,SAAS;EACf,MAAM,QAAQ,UAAU,CAAC,OAAO,cAAc,YAAY,SAAS,OAAO,KAAK,IAAI,KAAA;EACnF,IAAI,CAAC,UAAU,CAAC,OAAO;EACvB,MAAM,EAAE,SAAS,WAAW,SAAS;EACrC,IAAI,YAAY,QAAQ,WAAW,YAAY;EAC/C,MAAM,QAAQ,IAAI,IAAI,QAAQ,KAAI,MAAK,EAAE,EAAE,CAAC;EAC5C,MAAM,SAAS,IAAI,IAAI,QAAQ,QAAO,MAAK,EAAE,QAAQ,CAAC,CAAC,KAAI,MAAK,EAAE,EAAE,CAAC;EACrE,MAAM,OAAqB;GAAE;GAAO;GAAQ,aAAa;EAAO;EAChE,MAAM,SAAS,MAAM,SAAS,MAAM,MAAK,MAAK,EAAE,OAAO,MAAM,MAAM,IAAI,KAAA;EACvE,IAAI,MAAM,UAAU,UAAU,CAAC,OAAO,aAAa,CAAC,MAAM,IAAI,MAAM,MAAM,KAAK,OAAO,IAAI,MAAM,MAAM,IAAI,KAAK,SAAS;EACxH,OAAO;EACP,aAAa;EACb,OAAO,KAAK,SAAS,OAAO,MAAM,GAAG,QAAQ,aAAa,IAAI,CAAC,CAAC,QAAQ,gBAAgB,KAAK,CAAC;CAChG;CAEA,SAAS,QAAQ;EACf,IAAI,QAAQ;EACZ,SAAS;EACT,eAAe,IAAI;CACrB;CAEA,OAAO;EACL,YAAY,SAAS,UAAU;GAC7B,YAAY,SAAS,CAAC,CAAC;GACvB,WAAW;GACX,iBAAiB,SAAS,CAAC,CAAC;GAC5B,kBAAkB,SAAS,CAAC,CAAC;EAC/B,CAAC;EACD,QAAQ,UAAU,OAAO;GACvB,MAAM;GACN,WAAW;IACT,UAAU,KAAK;IACf,MAAM,QAAQ;IACd,OAAO,MAAM,MAAM,UAAU,KAAK;IAClC,MAAM;GACR;GACA,YAAY;IACV,OAAO;IACP,OAAO,KAAA;IACP,MAAM,QAAQ;IACd,UAAU,KAAA;IACV,OAAO,KAAA;IACP,aAAa,KAAA;GACf;EACF,CAAC;CACH;AACF"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { COMMENTS_LAYOUTS, CommentsLayout } from "../../settings/values.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { CommentAnchor, CommentAuthor, CommentReply, CommentThread, CommentsActions, CommentsModel, CommentsSnapshot, DocRange } from "../../core/backend-types.js";
|
|
3
|
+
import { CommentsModelFactory, commentsModelOf, createCommentsModel, createEditorCommentsModel } from "./model.js";
|
|
4
4
|
import { CommentsFeatureOptions, CommentsUi, commentsFeatureCore } from "./feature.js";
|
|
5
5
|
import { Comments, CommentsMeta, CommentsOptions, CommentsState, cancelCommentDraft, commentsAvailable, commentsCanComment, commentsDoc, commentsKey, commentsState, commentsUser, setActiveComment, startCommentDraft } from "./comments-plugin.js";
|
|
6
|
+
import { COMMENTS_FIELD, COMMENT_LIMITS, CommentMark, commentsSchemaExtensions } from "./schema.js";
|
|
6
7
|
import { DRAFT_CARD, MARGIN_GAP, MarginCard, MarginEntry, MarginLayout, layoutMargin, marginCards } from "./margin-layout.js";
|
|
7
8
|
import { MarginController, MarginSource, MarginState, createMarginController } from "./margin-controller.js";
|
|
8
9
|
export { COMMENTS_FIELD, COMMENTS_LAYOUTS, COMMENT_LIMITS, type CommentAnchor, type CommentAuthor, CommentMark, type CommentReply, type CommentThread, Comments, type CommentsActions, type CommentsFeatureOptions, type CommentsLayout, type CommentsMeta, type CommentsModel, type CommentsModelFactory, type CommentsOptions, type CommentsSnapshot, type CommentsState, type CommentsUi, DRAFT_CARD, type DocRange, MARGIN_GAP, type MarginCard, type MarginController, type MarginEntry, type MarginLayout, type MarginSource, type MarginState, cancelCommentDraft, commentsAvailable, commentsCanComment, commentsDoc, commentsFeatureCore, commentsKey, commentsModelOf, commentsSchemaExtensions, commentsState, commentsUser, createCommentsModel, createEditorCommentsModel, createMarginController, layoutMargin, marginCards, setActiveComment, startCommentDraft };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { COMMENTS_LAYOUTS } from "../../settings/values.js";
|
|
2
|
-
import { COMMENTS_FIELD, COMMENT_LIMITS, CommentMark, commentsSchemaExtensions } from "./schema.js";
|
|
3
2
|
import { Comments, cancelCommentDraft, commentsAvailable, commentsCanComment, commentsDoc, commentsKey, commentsState, commentsUser, setActiveComment, startCommentDraft } from "./comments-plugin.js";
|
|
3
|
+
import { COMMENTS_FIELD, COMMENT_LIMITS, CommentMark, commentsSchemaExtensions } from "./schema.js";
|
|
4
4
|
import { commentsModelOf, createCommentsModel, createEditorCommentsModel } from "./model.js";
|
|
5
5
|
import { commentsFeatureCore } from "./feature.js";
|
|
6
6
|
import { DRAFT_CARD, MARGIN_GAP, layoutMargin, marginCards } from "./margin-layout.js";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { CommentThread } from "
|
|
2
|
-
import
|
|
1
|
+
import { CommentThread, DocRange } from "../../core/backend-types.js";
|
|
2
|
+
import "./model.js";
|
|
3
|
+
import "./schema.js";
|
|
3
4
|
//#region src/features/comments/margin-layout.d.ts
|
|
4
5
|
/** Vertical gap between two cards of the comments margin, in px. */
|
|
5
6
|
export declare const MARGIN_GAP = 8;
|
|
@@ -1,73 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { FeatureContext } from "../../core/feature.js";
|
|
2
|
+
import { CommentsActions, CommentsModel, CommentsSnapshot, DocRange } from "../../core/backend-types.js";
|
|
3
3
|
import "../../core/index.js";
|
|
4
|
-
import { CommentThread } from "./schema.js";
|
|
5
4
|
import { Editor } from "@tiptap/core";
|
|
6
5
|
//#region src/features/comments/model.d.ts
|
|
7
|
-
export type DocRange = {
|
|
8
|
-
from: number;
|
|
9
|
-
to: number;
|
|
10
|
-
};
|
|
11
|
-
/** What a comments UI renders: replaced (a new object) whenever any part of it changes, so a store subscriber re-renders only then. */
|
|
12
|
-
export interface CommentsSnapshot {
|
|
13
|
-
/** Comments need a collaborative editor whose `Comments` extension has a user (a host model decides for itself). */
|
|
14
|
-
available: boolean;
|
|
15
|
-
/**
|
|
16
|
-
* Whether the user may compose a comment now: the default model says `available` and the editor is editable, a host
|
|
17
|
-
* model may allow readers of a read-only document to comment.
|
|
18
|
-
*/
|
|
19
|
-
canComment: boolean;
|
|
20
|
-
user: AuthorIdentity | null;
|
|
21
|
-
/** Plain snapshots of all threads in the Y.Doc, replaced on every change. */
|
|
22
|
-
threads: readonly CommentThread[];
|
|
23
|
-
/** Current text range per thread id (threads without one are orphans). */
|
|
24
|
-
ranges: ReadonlyMap<string, DocRange>;
|
|
25
|
-
/**
|
|
26
|
-
* Where the text of an orphaned open thread was: the document position of the deletion point, resolved from the
|
|
27
|
-
* thread's stored anchor (so it is the same place for every collaborator and follows edits). Absent for orphans
|
|
28
|
-
* without a usable anchor (threads from before anchors, or whose block is gone for good).
|
|
29
|
-
*/
|
|
30
|
-
orphanAt: ReadonlyMap<string, number>;
|
|
31
|
-
active: string | null;
|
|
32
|
-
/** Current range of the draft a new comment is being written for. */
|
|
33
|
-
draft: DocRange | null;
|
|
34
|
-
/** The draft's text as the new thread will keep it (`quote`). */
|
|
35
|
-
draftQuote: string;
|
|
36
|
-
/** Unresolved threads in document order, orphans last; resolved ones newest first. */
|
|
37
|
-
open: readonly CommentThread[];
|
|
38
|
-
resolved: readonly CommentThread[];
|
|
39
|
-
}
|
|
40
|
-
/** The mutations of the comments of one editor; no-ops without collaboration or a user. */
|
|
41
|
-
export interface CommentsActions {
|
|
42
|
-
/** Creates a thread on the draft range; its id, or null without a (non-empty) draft or text. */
|
|
43
|
-
add: (text: string) => string | null;
|
|
44
|
-
reply: (threadId: string, text: string) => void;
|
|
45
|
-
/** Changes the text of the user's own thread (`replyId` null) or reply. */
|
|
46
|
-
edit: (threadId: string, replyId: string | null, text: string) => void;
|
|
47
|
-
/** Resolves or reopens a thread (anyone may). */
|
|
48
|
-
setResolved: (threadId: string, resolved: boolean) => void;
|
|
49
|
-
/** Deletes the user's own thread with its marks / the user's own reply. */
|
|
50
|
-
remove: (threadId: string) => void;
|
|
51
|
-
removeReply: (threadId: string, replyId: string) => void;
|
|
52
|
-
/** Activates a thread (`null`: none); `reveal` selects and scrolls to its text. */
|
|
53
|
-
activate: (id: string | null, options?: {
|
|
54
|
-
reveal?: boolean;
|
|
55
|
-
}) => void;
|
|
56
|
-
/** Starts a comment on the current selection (the layout shows the composer while `draft` is set). */
|
|
57
|
-
startDraft: () => void;
|
|
58
|
-
cancelDraft: () => void;
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* The comments of one editor, framework-free: `state` is the observable snapshot, `refresh()` brings it up to date
|
|
62
|
-
* (the framework hook calls it when the editor it watches changes; the model itself listens to that editor's
|
|
63
|
-
* transactions from then on), `dispose()` detaches the editor and Y.Doc listeners and may be followed by `refresh()` again
|
|
64
|
-
* (StrictMode mounts twice).
|
|
65
|
-
*/
|
|
66
|
-
export interface CommentsModel extends CommentsActions {
|
|
67
|
-
readonly state: ReadonlyStore<CommentsSnapshot>;
|
|
68
|
-
refresh: () => void;
|
|
69
|
-
dispose: () => void;
|
|
70
|
-
}
|
|
71
6
|
/**
|
|
72
7
|
* The comment threads of a collaborative editor, stored in its Y.Doc (`COMMENTS_FIELD`, one nested `Y.Map` per thread,
|
|
73
8
|
* replies in a nested `Y.Array`), so they sync live with the document and persist with its Yjs state. Keeps the
|
|
@@ -92,4 +27,5 @@ export declare function commentsModelOf(ctx: FeatureContext): CommentsModelFacto
|
|
|
92
27
|
*/
|
|
93
28
|
export declare function createEditorCommentsModel(getEditor: () => Editor | undefined): CommentsModel;
|
|
94
29
|
//#endregion
|
|
30
|
+
export type { CommentsActions, CommentsModel, CommentsSnapshot, DocRange };
|
|
95
31
|
//# sourceMappingURL=model.d.ts.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import { editorEntryOf } from "../../core/editor-ui.js";
|
|
1
2
|
import { newBlockId } from "../../core/schema/block-ids.js";
|
|
2
3
|
import { createStore } from "../../core/store.js";
|
|
3
4
|
import { anchorResolverOf, releaseRanges, resolveRange } from "../../core/doc-anchors.js";
|
|
4
|
-
import { editorEntryOf } from "../../core/editor-ui.js";
|
|
5
|
-
import { COMMENTS_FIELD, COMMENT_LIMITS } from "./schema.js";
|
|
6
5
|
import { cancelCommentDraft, commentsDoc, commentsKey, commentsUser, setActiveComment, startCommentDraft } from "./comments-plugin.js";
|
|
6
|
+
import { COMMENTS_FIELD, COMMENT_LIMITS } from "./schema.js";
|
|
7
7
|
import { EMPTY_SNAPSHOT, NO_POSITIONS, NO_RANGES, NO_THREADS, sameOrphanAt, sameRange, sameRanges, sameUser } from "./snapshot-equality.js";
|
|
8
8
|
import { captureThreadAnchor, resolveThreadAnchor } from "./thread-anchor.js";
|
|
9
9
|
import * as Y from "yjs";
|