@delali/web-editor 0.0.0-stage → 0.4.3
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 +46 -0
- package/LICENSE +201 -0
- package/README.md +167 -2
- package/dist/components/editor/chat-comment-effects.d.ts +2 -0
- package/dist/components/editor/chat-types.d.ts +20 -0
- package/dist/components/editor/collaboration/base-collaboration-plugin.d.ts +14 -0
- package/dist/components/editor/collaboration/collaboration-plugin.d.ts +6 -0
- package/dist/components/editor/collaboration/collaboration-session.d.ts +30 -0
- package/dist/components/editor/collaboration/collaboration-starter.d.ts +9 -0
- package/dist/components/editor/collaboration/editor-collaboration.d.ts +16 -0
- package/dist/components/editor/collaboration/editor-collaboration.js +293 -0
- package/dist/components/editor/collaboration/remote-cursor-overlay.d.ts +1 -0
- package/dist/components/editor/collaboration/shared-document.d.ts +18 -0
- package/dist/components/editor/create-editor-plugins.d.ts +3 -0
- package/dist/components/editor/create-editor-plugins.js +25243 -0
- package/dist/components/editor/create-viewer-plugins.d.ts +3 -0
- package/dist/components/editor/editor-base-kit.d.ts +329 -0
- package/dist/components/editor/editor-base-kit.js +3136 -0
- package/dist/components/editor/editor-config.d.ts +14 -0
- package/dist/components/editor/editor-config.js +145 -0
- package/dist/components/editor/editor-kit.d.ts +3978 -0
- package/dist/components/editor/editor-kit.js +18820 -0
- package/dist/components/editor/plate-types.d.ts +99 -0
- package/dist/components/editor/plugins/accordion-group-base-kit.d.ts +2 -0
- package/dist/components/editor/plugins/accordion-group-kit.d.ts +3 -0
- package/dist/components/editor/plugins/accordion-types.d.ts +14 -0
- package/dist/components/editor/plugins/ai-kit.d.ts +248 -0
- package/dist/components/editor/plugins/align-base-kit.d.ts +3 -0
- package/dist/components/editor/plugins/api-doc/expandable-base-kit.d.ts +24 -0
- package/dist/components/editor/plugins/api-doc/expandable-kit.d.ts +29 -0
- package/dist/components/editor/plugins/api-doc/expandable-types.d.ts +7 -0
- package/dist/components/editor/plugins/api-doc/panel-base-kit.d.ts +2 -0
- package/dist/components/editor/plugins/api-doc/panel-kit.d.ts +3 -0
- package/dist/components/editor/plugins/api-doc/panel-types.d.ts +7 -0
- package/dist/components/editor/plugins/api-doc/response-field-base-kit.d.ts +3 -0
- package/dist/components/editor/plugins/api-doc/response-field-kit.d.ts +4 -0
- package/dist/components/editor/plugins/api-doc/response-field-types.d.ts +17 -0
- package/dist/components/editor/plugins/autoformat-kit.d.ts +1 -0
- package/dist/components/editor/plugins/badge-base-kit.d.ts +2 -0
- package/dist/components/editor/plugins/badge-kit.d.ts +3 -0
- package/dist/components/editor/plugins/badge-types.d.ts +24 -0
- package/dist/components/editor/plugins/banner-base-kit.d.ts +2 -0
- package/dist/components/editor/plugins/banner-kit.d.ts +3 -0
- package/dist/components/editor/plugins/banner-types.d.ts +15 -0
- package/dist/components/editor/plugins/basic-blocks-base-kit.d.ts +5 -0
- package/dist/components/editor/plugins/basic-blocks-kit.d.ts +5 -0
- package/dist/components/editor/plugins/basic-marks-base-kit.d.ts +19 -0
- package/dist/components/editor/plugins/basic-marks-kit.d.ts +35 -0
- package/dist/components/editor/plugins/basic-nodes-kit.d.ts +21 -0
- package/dist/components/editor/plugins/block-menu-kit.d.ts +165 -0
- package/dist/components/editor/plugins/block-placeholder-kit.d.ts +14 -0
- package/dist/components/editor/plugins/block-selection-kit.d.ts +137 -0
- package/dist/components/editor/plugins/callout-base-kit.d.ts +20 -0
- package/dist/components/editor/plugins/callout-kit.d.ts +20 -0
- package/dist/components/editor/plugins/callout-types.d.ts +18 -0
- package/dist/components/editor/plugins/card-base-kit.d.ts +2 -0
- package/dist/components/editor/plugins/card-kit.d.ts +3 -0
- package/dist/components/editor/plugins/card-types.d.ts +14 -0
- package/dist/components/editor/plugins/caret-placement-kit.d.ts +8 -0
- package/dist/components/editor/plugins/code-block-base-kit.d.ts +7 -0
- package/dist/components/editor/plugins/code-block-input-rule-gate.d.ts +4 -0
- package/dist/components/editor/plugins/code-block-kit.d.ts +7 -0
- package/dist/components/editor/plugins/color-base-kit.d.ts +2 -0
- package/dist/components/editor/plugins/color-kit.d.ts +3 -0
- package/dist/components/editor/plugins/color-types.d.ts +18 -0
- package/dist/components/editor/plugins/column-base-kit.d.ts +1 -0
- package/dist/components/editor/plugins/column-kit.d.ts +1 -0
- package/dist/components/editor/plugins/comment-base-kit.d.ts +47 -0
- package/dist/components/editor/plugins/comment-kit.d.ts +71 -0
- package/dist/components/editor/plugins/copilot-kit.d.ts +72 -0
- package/dist/components/editor/plugins/cursor-overlay-kit.d.ts +11 -0
- package/dist/components/editor/plugins/date-base-kit.d.ts +19 -0
- package/dist/components/editor/plugins/date-kit.d.ts +19 -0
- package/dist/components/editor/plugins/discussion-kit.d.ts +31 -0
- package/dist/components/editor/plugins/dnd-kit.d.ts +20 -0
- package/dist/components/editor/plugins/docx-kit.d.ts +1 -0
- package/dist/components/editor/plugins/emoji-kit.d.ts +9 -0
- package/dist/components/editor/plugins/exit-break-kit.d.ts +4 -0
- package/dist/components/editor/plugins/floating-toolbar-kit.d.ts +1 -0
- package/dist/components/editor/plugins/font-base-kit.d.ts +9 -0
- package/dist/components/editor/plugins/font-kit.d.ts +9 -0
- package/dist/components/editor/plugins/fraction-input-rule.d.ts +12 -0
- package/dist/components/editor/plugins/frame-base-kit.d.ts +2 -0
- package/dist/components/editor/plugins/frame-kit.d.ts +3 -0
- package/dist/components/editor/plugins/frame-types.d.ts +10 -0
- package/dist/components/editor/plugins/icon-base-kit.d.ts +2 -0
- package/dist/components/editor/plugins/icon-kit.d.ts +3 -0
- package/dist/components/editor/plugins/icon-types.d.ts +15 -0
- package/dist/components/editor/plugins/indent-base-kit.d.ts +1 -0
- package/dist/components/editor/plugins/indent-kit.d.ts +5 -0
- package/dist/components/editor/plugins/input-rule-gate.d.ts +8 -0
- package/dist/components/editor/plugins/line-height-base-kit.d.ts +3 -0
- package/dist/components/editor/plugins/link-base-kit.d.ts +2 -0
- package/dist/components/editor/plugins/link-kit.d.ts +89 -0
- package/dist/components/editor/plugins/list-base-kit.d.ts +1 -0
- package/dist/components/editor/plugins/list-kit.d.ts +16 -0
- package/dist/components/editor/plugins/mark-input-rule-gate.d.ts +2 -0
- package/dist/components/editor/plugins/markdown-kit.d.ts +19 -0
- package/dist/components/editor/plugins/math-base-kit.d.ts +9 -0
- package/dist/components/editor/plugins/math-kit.d.ts +9 -0
- package/dist/components/editor/plugins/media-base-kit.d.ts +25 -0
- package/dist/components/editor/plugins/media-kit.d.ts +38 -0
- package/dist/components/editor/plugins/mention-base-kit.d.ts +11 -0
- package/dist/components/editor/plugins/mention-kit.d.ts +11 -0
- package/dist/components/editor/plugins/mermaid-base-kit.d.ts +2 -0
- package/dist/components/editor/plugins/mermaid-kit.d.ts +3 -0
- package/dist/components/editor/plugins/mermaid-types.d.ts +14 -0
- package/dist/components/editor/plugins/shared/color-selector.d.ts +9 -0
- package/dist/components/editor/plugins/shared/component-popover.d.ts +12 -0
- package/dist/components/editor/plugins/slash-kit.d.ts +1 -0
- package/dist/components/editor/plugins/steps-base-kit.d.ts +3 -0
- package/dist/components/editor/plugins/steps-kit.d.ts +4 -0
- package/dist/components/editor/plugins/steps-types.d.ts +18 -0
- package/dist/components/editor/plugins/suggestion-base-kit.d.ts +32 -0
- package/dist/components/editor/plugins/suggestion-kit.d.ts +53 -0
- package/dist/components/editor/plugins/tabbed-code-block-base-kit.d.ts +32 -0
- package/dist/components/editor/plugins/tabbed-code-block-kit.d.ts +33 -0
- package/dist/components/editor/plugins/tabbed-code-block-types.d.ts +29 -0
- package/dist/components/editor/plugins/table-base-kit.d.ts +94 -0
- package/dist/components/editor/plugins/table-kit.d.ts +162 -0
- package/dist/components/editor/plugins/tabs-base-kit.d.ts +2 -0
- package/dist/components/editor/plugins/tabs-kit.d.ts +3 -0
- package/dist/components/editor/plugins/tabs-types.d.ts +14 -0
- package/dist/components/editor/plugins/text-substitution-input-rule-gate.d.ts +4 -0
- package/dist/components/editor/plugins/tiles-base-kit.d.ts +3 -0
- package/dist/components/editor/plugins/tiles-kit.d.ts +4 -0
- package/dist/components/editor/plugins/tiles-types.d.ts +16 -0
- package/dist/components/editor/plugins/toc-base-kit.d.ts +1 -0
- package/dist/components/editor/plugins/toc-kit.d.ts +5 -0
- package/dist/components/editor/plugins/todo-to-bullet-kit.d.ts +7 -0
- package/dist/components/editor/plugins/toggle-base-kit.d.ts +12 -0
- package/dist/components/editor/plugins/toggle-kit.d.ts +16 -0
- package/dist/components/editor/plugins/tooltip-base-kit.d.ts +2 -0
- package/dist/components/editor/plugins/tooltip-html.d.ts +27 -0
- package/dist/components/editor/plugins/tooltip-kit.d.ts +3 -0
- package/dist/components/editor/plugins/tooltip-types.d.ts +10 -0
- package/dist/components/editor/plugins/tree-base-kit.d.ts +2 -0
- package/dist/components/editor/plugins/tree-kit.d.ts +3 -0
- package/dist/components/editor/plugins/tree-types.d.ts +26 -0
- package/dist/components/editor/plugins/typed-conversion-options.d.ts +13 -0
- package/dist/components/editor/plugins/update-base-kit.d.ts +1 -0
- package/dist/components/editor/plugins/update-kit.d.ts +4 -0
- package/dist/components/editor/plugins/update-types.d.ts +19 -0
- package/dist/components/editor/plugins/web-address-text.d.ts +1 -0
- package/dist/components/editor/transforms.d.ts +8 -0
- package/dist/components/editor/use-chat.d.ts +3 -0
- package/dist/components/editor/use-chat.js +3315 -0
- package/dist/components/editor/use-typed-conversion-options.d.ts +3 -0
- package/dist/components/editor/version-history/chunk-node.d.ts +7 -0
- package/dist/components/editor/version-history/chunk-plugin.d.ts +6 -0
- package/dist/components/editor/version-history/collapse-blocks-without-diff.d.ts +4 -0
- package/dist/components/editor/version-history/diff-node.d.ts +9 -0
- package/dist/components/editor/version-history/diff-plate.d.ts +7 -0
- package/dist/components/editor/version-history/diff-plugin.d.ts +8 -0
- package/dist/components/editor/version-history/index.d.ts +9 -0
- package/dist/components/editor/version-history/index.js +19218 -0
- package/dist/components/editor/version-history/use-object-version.d.ts +1 -0
- package/dist/components/editor/version-history/use-reset-editor-on-change.d.ts +7 -0
- package/dist/components/editor/version-history/version-plate.d.ts +7 -0
- package/dist/components/editor/web-editor.d.ts +6 -0
- package/dist/components/editor/web-editor.js +27334 -0
- package/dist/context/editor-adapter-context.d.ts +13 -0
- package/dist/context/editor-adapter-context.js +124 -0
- package/dist/context/editor-adapter.d.ts +262 -0
- package/dist/context/editor-toc-context.d.ts +16 -0
- package/dist/context/heading-slug-context.d.ts +11 -0
- package/dist/context/link-resolution-context.d.ts +24 -0
- package/dist/context/link-resolution-store.d.ts +20 -0
- package/dist/context/portal-container.d.ts +7 -0
- package/dist/hooks/use-copy-to-clipboard.d.ts +10 -0
- package/dist/hooks/use-dark-mode.d.ts +1 -0
- package/dist/hooks/use-debounce-callback.d.ts +108 -0
- package/dist/hooks/use-debounce.d.ts +1 -0
- package/dist/hooks/use-is-touch-device.d.ts +1 -0
- package/dist/hooks/use-lock-scroll.d.ts +1 -0
- package/dist/hooks/use-media-query.d.ts +2 -0
- package/dist/hooks/use-mounted.d.ts +6 -0
- package/dist/hooks/use-on-click-outside.d.ts +26 -0
- package/dist/hooks/use-return-focus-to-editor-on-input-removal.d.ts +3 -0
- package/dist/hooks/use-shield-input-selection-from-editor.d.ts +3 -0
- package/dist/hooks/use-upload-file.d.ts +25 -0
- package/dist/hooks/use-upload-file.js +129 -0
- package/dist/lib/accepted-file-types.d.ts +1 -0
- package/dist/lib/block-features.d.ts +11 -0
- package/dist/lib/comment-mark-strip.d.ts +24 -0
- package/dist/lib/comment-mark-strip.js +56 -0
- package/dist/lib/download-file.d.ts +1 -0
- package/dist/lib/editor-element-path.d.ts +8 -0
- package/dist/lib/extract-headings.d.ts +13 -0
- package/dist/lib/extract-headings.js +79 -0
- package/dist/lib/file-size-limit.d.ts +7 -0
- package/dist/lib/html-serialize-hast.d.ts +18 -0
- package/dist/lib/html-serialize-rules.d.ts +15 -0
- package/dist/lib/html-serialize-utils.d.ts +24 -0
- package/dist/lib/html-serialize-utils.js +392 -0
- package/dist/lib/line-marking-context.d.ts +13 -0
- package/dist/lib/line-marking.d.ts +47 -0
- package/dist/lib/list-html.d.ts +30 -0
- package/dist/lib/markdown-joiner-transform.d.ts +31 -0
- package/dist/lib/markdown-utils.d.ts +4 -0
- package/dist/lib/markdown-utils.js +25314 -0
- package/dist/lib/mdx/mdx-archetype-rules.d.ts +2 -0
- package/dist/lib/mdx/mdx-attribute-codec.d.ts +23 -0
- package/dist/lib/mdx/mdx-color-rules.d.ts +2 -0
- package/dist/lib/mdx/mdx-component-rules.d.ts +2 -0
- package/dist/lib/mdx/mdx-mermaid-rules.d.ts +10 -0
- package/dist/lib/mdx/mdx-reference-rules.d.ts +11 -0
- package/dist/lib/mdx/mdx-round-trip.d.ts +3 -0
- package/dist/lib/mdx/mdx-round-trip.js +1397 -0
- package/dist/lib/mdx/mdx-rule-builder.d.ts +45 -0
- package/dist/lib/mdx/mdx-server-plugins.d.ts +8 -0
- package/dist/lib/mdx/mdx-tabbed-code-rules.d.ts +2 -0
- package/dist/lib/mdx/mdx-tabs-rules.d.ts +2 -0
- package/dist/lib/mdx/mdx-toggle-rules.d.ts +9 -0
- package/dist/lib/mdx/mdx-tree-rules.d.ts +2 -0
- package/dist/lib/media-html.d.ts +121 -0
- package/dist/lib/paragraph-html.d.ts +26 -0
- package/dist/lib/server-plugins.d.ts +199 -0
- package/dist/lib/utils.d.ts +3 -0
- package/dist/lib/utils.js +25 -0
- package/dist/lib/video-embeds.d.ts +9 -0
- package/dist/styles.css +6726 -0
- package/dist/types/editor.d.ts +161 -0
- package/dist/types/editor.js +77 -0
- package/dist/ui/accordion-group-node-static.d.ts +11 -0
- package/dist/ui/accordion-group-node.d.ts +10 -0
- package/dist/ui/ai-chat-editor.d.ts +4 -0
- package/dist/ui/ai-menu.d.ts +2 -0
- package/dist/ui/ai-node.d.ts +3 -0
- package/dist/ui/ai-toolbar-button.d.ts +3 -0
- package/dist/ui/alert-dialog.d.ts +20 -0
- package/dist/ui/api-doc/expandable-node-static.d.ts +4 -0
- package/dist/ui/api-doc/expandable-node.d.ts +3 -0
- package/dist/ui/api-doc/expandable-settings.d.ts +17 -0
- package/dist/ui/api-doc/panel-node-static.d.ts +3 -0
- package/dist/ui/api-doc/panel-node.d.ts +3 -0
- package/dist/ui/api-doc/response-field-item-node-static.d.ts +3 -0
- package/dist/ui/api-doc/response-field-item-node.d.ts +3 -0
- package/dist/ui/api-doc/response-field-node-static.d.ts +9 -0
- package/dist/ui/api-doc/response-field-node.d.ts +9 -0
- package/dist/ui/avatar.d.ts +16 -0
- package/dist/ui/badge-node-static.d.ts +3 -0
- package/dist/ui/badge-node.d.ts +3 -0
- package/dist/ui/badge-settings-options.d.ts +24 -0
- package/dist/ui/badge-settings.d.ts +19 -0
- package/dist/ui/badge.d.ts +9 -0
- package/dist/ui/banner-node-static.d.ts +4 -0
- package/dist/ui/banner-node.d.ts +3 -0
- package/dist/ui/block-context-menu.d.ts +8 -0
- package/dist/ui/block-discussion.d.ts +3 -0
- package/dist/ui/block-draggable.d.ts +2 -0
- package/dist/ui/block-list-static.d.ts +2 -0
- package/dist/ui/block-list.d.ts +2 -0
- package/dist/ui/block-menu.d.ts +167 -0
- package/dist/ui/block-selection.d.ts +5 -0
- package/dist/ui/block-suggestion.d.ts +17 -0
- package/dist/ui/blockquote-node-static.d.ts +2 -0
- package/dist/ui/blockquote-node.d.ts +2 -0
- package/dist/ui/button.d.ts +81 -0
- package/dist/ui/calendar.d.ts +5 -0
- package/dist/ui/callout-detail-settings.d.ts +15 -0
- package/dist/ui/callout-icon.d.ts +9 -0
- package/dist/ui/callout-node-static.d.ts +2 -0
- package/dist/ui/callout-node.d.ts +3 -0
- package/dist/ui/callout-settings.d.ts +19 -0
- package/dist/ui/callout-type-button.d.ts +9 -0
- package/dist/ui/caption.d.ts +72 -0
- package/dist/ui/card-element-actions.d.ts +7 -0
- package/dist/ui/card-icon-settings.d.ts +11 -0
- package/dist/ui/card-node-static.d.ts +3 -0
- package/dist/ui/card-node.d.ts +3 -0
- package/dist/ui/card-settings.d.ts +24 -0
- package/dist/ui/card-title-row.d.ts +14 -0
- package/dist/ui/checkbox.d.ts +4 -0
- package/dist/ui/code-block-line-marking-form.d.ts +9 -0
- package/dist/ui/code-block-line-marking-input.d.ts +8 -0
- package/dist/ui/code-block-line-marking-popover.d.ts +12 -0
- package/dist/ui/code-block-line-marking-state.d.ts +11 -0
- package/dist/ui/code-block-node-static.d.ts +10 -0
- package/dist/ui/code-block-node.d.ts +5 -0
- package/dist/ui/code-line-selection-toolbar.d.ts +10 -0
- package/dist/ui/code-line-wrapper.d.ts +22 -0
- package/dist/ui/code-node-static.d.ts +2 -0
- package/dist/ui/code-node.d.ts +2 -0
- package/dist/ui/collapsible.d.ts +6 -0
- package/dist/ui/color-copy-icon.d.ts +9 -0
- package/dist/ui/color-element-actions.d.ts +7 -0
- package/dist/ui/color-item-settings.d.ts +11 -0
- package/dist/ui/color-node-static.d.ts +3 -0
- package/dist/ui/color-node.d.ts +3 -0
- package/dist/ui/color-settings.d.ts +18 -0
- package/dist/ui/color-swatch-editable.d.ts +12 -0
- package/dist/ui/color-table-row-editable.d.ts +10 -0
- package/dist/ui/column-node-static.d.ts +4 -0
- package/dist/ui/column-node.d.ts +3 -0
- package/dist/ui/command.d.ts +25 -0
- package/dist/ui/comment-node-static.d.ts +3 -0
- package/dist/ui/comment-node.d.ts +3 -0
- package/dist/ui/comment-toolbar-button.d.ts +1 -0
- package/dist/ui/comment.d.ts +45 -0
- package/dist/ui/cursor-overlay.d.ts +4 -0
- package/dist/ui/date-node-static.d.ts +2 -0
- package/dist/ui/date-node.d.ts +2 -0
- package/dist/ui/dialog.d.ts +90 -0
- package/dist/ui/dropdown-menu.d.ts +35 -0
- package/dist/ui/editor-inspector-panel.d.ts +6 -0
- package/dist/ui/editor-static.d.ts +8 -0
- package/dist/ui/editor.d.ts +15 -0
- package/dist/ui/emoji-node.d.ts +3 -0
- package/dist/ui/emoji-toolbar-button.d.ts +16 -0
- package/dist/ui/equation-node-static.d.ts +4 -0
- package/dist/ui/equation-node.d.ts +5 -0
- package/dist/ui/equation-toolbar-button.d.ts +2 -0
- package/dist/ui/floating-discussion.d.ts +8 -0
- package/dist/ui/floating-toolbar-buttons.d.ts +1 -0
- package/dist/ui/floating-toolbar.d.ts +6 -0
- package/dist/ui/font-color-toolbar-button.d.ts +15 -0
- package/dist/ui/frame-node-static.d.ts +3 -0
- package/dist/ui/frame-node.d.ts +3 -0
- package/dist/ui/frame-settings.d.ts +19 -0
- package/dist/ui/ghost-text.d.ts +1 -0
- package/dist/ui/heading-node-static.d.ts +10 -0
- package/dist/ui/heading-node.d.ts +14 -0
- package/dist/ui/highlight-node-static.d.ts +2 -0
- package/dist/ui/highlight-node.d.ts +2 -0
- package/dist/ui/hover-card.d.ts +6 -0
- package/dist/ui/hr-node-static.d.ts +2 -0
- package/dist/ui/hr-node.d.ts +2 -0
- package/dist/ui/icon-node-static.d.ts +3 -0
- package/dist/ui/icon-node.d.ts +3 -0
- package/dist/ui/icon-picker.d.ts +16 -0
- package/dist/ui/icon-settings.d.ts +17 -0
- package/dist/ui/inline-combobox.d.ts +38 -0
- package/dist/ui/input.d.ts +7 -0
- package/dist/ui/kbd-node-static.d.ts +2 -0
- package/dist/ui/kbd-node.d.ts +2 -0
- package/dist/ui/label.d.ts +8 -0
- package/dist/ui/link-node-static.d.ts +11 -0
- package/dist/ui/link-node.d.ts +11 -0
- package/dist/ui/link-reference.d.ts +39 -0
- package/dist/ui/link-reference.js +84 -0
- package/dist/ui/link-search-panel.d.ts +5 -0
- package/dist/ui/link-toolbar-button.d.ts +3 -0
- package/dist/ui/link-toolbar-edit-command.d.ts +7 -0
- package/dist/ui/link-toolbar-shared.d.ts +18 -0
- package/dist/ui/link-toolbar.d.ts +1 -0
- package/dist/ui/mark-toolbar-button.d.ts +6 -0
- package/dist/ui/media-align-button.d.ts +5 -0
- package/dist/ui/media-audio-node-static.d.ts +3 -0
- package/dist/ui/media-audio-node.d.ts +2 -0
- package/dist/ui/media-card.d.ts +11 -0
- package/dist/ui/media-embed-node-static.d.ts +6 -0
- package/dist/ui/media-embed-node.d.ts +2 -0
- package/dist/ui/media-file-display.d.ts +11 -0
- package/dist/ui/media-file-mode-dropdown.d.ts +10 -0
- package/dist/ui/media-file-node-static.d.ts +3 -0
- package/dist/ui/media-file-node.d.ts +2 -0
- package/dist/ui/media-hint-icon-picker.d.ts +5 -0
- package/dist/ui/media-hint-settings.d.ts +2 -0
- package/dist/ui/media-image-lightbox.d.ts +17 -0
- package/dist/ui/media-image-node-static.d.ts +6 -0
- package/dist/ui/media-image-node.d.ts +7 -0
- package/dist/ui/media-placeholder-node.d.ts +3 -0
- package/dist/ui/media-preview-dialog.d.ts +12 -0
- package/dist/ui/media-toolbar.d.ts +3 -0
- package/dist/ui/media-upload-toast.d.ts +1 -0
- package/dist/ui/media-video-node-static.d.ts +6 -0
- package/dist/ui/media-video-node.d.ts +2 -0
- package/dist/ui/member-profile-card.d.ts +17 -0
- package/dist/ui/mention-document-element.d.ts +5 -0
- package/dist/ui/mention-document-hover-card.d.ts +17 -0
- package/dist/ui/mention-document-link.d.ts +13 -0
- package/dist/ui/mention-element.d.ts +5 -0
- package/dist/ui/mention-input-element.d.ts +2 -0
- package/dist/ui/mention-node-static.d.ts +7 -0
- package/dist/ui/mention-page-combobox-group.d.ts +8 -0
- package/dist/ui/mention-people-combobox-group.d.ts +8 -0
- package/dist/ui/menu.d.ts +103 -0
- package/dist/ui/mermaid-node-static.d.ts +4 -0
- package/dist/ui/mermaid-node.d.ts +3 -0
- package/dist/ui/more-toolbar-button.d.ts +3 -0
- package/dist/ui/paragraph-node-static.d.ts +2 -0
- package/dist/ui/paragraph-node.d.ts +2 -0
- package/dist/ui/popover.d.ts +11 -0
- package/dist/ui/progress.d.ts +3 -0
- package/dist/ui/resize-handle.d.ts +15 -0
- package/dist/ui/select.d.ts +13 -0
- package/dist/ui/separator.d.ts +8 -0
- package/dist/ui/slash-node.d.ts +20 -0
- package/dist/ui/smart-link-clipboard.d.ts +1 -0
- package/dist/ui/smart-link-copy-button.d.ts +6 -0
- package/dist/ui/smart-link-mode-dropdown.d.ts +9 -0
- package/dist/ui/smart-link-toolbar.d.ts +17 -0
- package/dist/ui/smart-link-view.d.ts +23 -0
- package/dist/ui/smart-link.d.ts +43 -0
- package/dist/ui/spinner.d.ts +7 -0
- package/dist/ui/step-node-static.d.ts +3 -0
- package/dist/ui/step-node.d.ts +3 -0
- package/dist/ui/step-settings.d.ts +19 -0
- package/dist/ui/steps-node-static.d.ts +10 -0
- package/dist/ui/steps-node.d.ts +10 -0
- package/dist/ui/suggestion-node-static.d.ts +3 -0
- package/dist/ui/suggestion-node.d.ts +6 -0
- package/dist/ui/suggestion-toolbar-button.d.ts +1 -0
- package/dist/ui/switch.d.ts +4 -0
- package/dist/ui/tabbed-code-block-actions.d.ts +24 -0
- package/dist/ui/tabbed-code-block-header.d.ts +23 -0
- package/dist/ui/tabbed-code-block-language-selector.d.ts +7 -0
- package/dist/ui/tabbed-code-block-languages.d.ts +6 -0
- package/dist/ui/tabbed-code-block-node-static.d.ts +4 -0
- package/dist/ui/tabbed-code-block-node.d.ts +4 -0
- package/dist/ui/tabbed-code-block-settings.d.ts +18 -0
- package/dist/ui/tabbed-code-block-sync.d.ts +10 -0
- package/dist/ui/tabbed-code-block-tab-dropdown.d.ts +10 -0
- package/dist/ui/tabbed-code-block-tab-strip.d.ts +27 -0
- package/dist/ui/tabbed-code-block-tab-trigger.d.ts +14 -0
- package/dist/ui/tabbed-code-block-utils.d.ts +9 -0
- package/dist/ui/table-icons.d.ts +7 -0
- package/dist/ui/table-node-static.d.ts +9 -0
- package/dist/ui/table-node.d.ts +9 -0
- package/dist/ui/tabs-node-static.d.ts +4 -0
- package/dist/ui/tabs-node.d.ts +3 -0
- package/dist/ui/tabs.d.ts +10 -0
- package/dist/ui/textarea.d.ts +10 -0
- package/dist/ui/tile-node-static.d.ts +3 -0
- package/dist/ui/tile-node.d.ts +3 -0
- package/dist/ui/tile-settings.d.ts +18 -0
- package/dist/ui/tiles-node-static.d.ts +3 -0
- package/dist/ui/tiles-node.d.ts +3 -0
- package/dist/ui/toc-node-static.d.ts +2 -0
- package/dist/ui/toc-node.d.ts +2 -0
- package/dist/ui/toc-sidebar.d.ts +6 -0
- package/dist/ui/toc-state-sync.d.ts +5 -0
- package/dist/ui/toggle-node-static.d.ts +3 -0
- package/dist/ui/toggle-node-views.d.ts +35 -0
- package/dist/ui/toggle-node.d.ts +3 -0
- package/dist/ui/toggle-settings.d.ts +23 -0
- package/dist/ui/toggle.d.ts +8 -0
- package/dist/ui/toolbar.d.ts +37 -0
- package/dist/ui/tooltip-node-static.d.ts +3 -0
- package/dist/ui/tooltip-node.d.ts +3 -0
- package/dist/ui/tooltip-preview-content.d.ts +6 -0
- package/dist/ui/tooltip-settings.d.ts +21 -0
- package/dist/ui/tooltip-toolbar-button.d.ts +3 -0
- package/dist/ui/tooltip.d.ts +19 -0
- package/dist/ui/tree-context-value.d.ts +22 -0
- package/dist/ui/tree-context.d.ts +32 -0
- package/dist/ui/tree-file-node-static.d.ts +8 -0
- package/dist/ui/tree-file-node.d.ts +11 -0
- package/dist/ui/tree-folder-node-static.d.ts +9 -0
- package/dist/ui/tree-folder-node.d.ts +12 -0
- package/dist/ui/tree-item-utils.d.ts +11 -0
- package/dist/ui/tree-items-list.d.ts +11 -0
- package/dist/ui/tree-node-events.d.ts +19 -0
- package/dist/ui/tree-node-state.d.ts +14 -0
- package/dist/ui/tree-node-static.d.ts +12 -0
- package/dist/ui/tree-node.d.ts +5 -0
- package/dist/ui/tree-root-actions.d.ts +11 -0
- package/dist/ui/tree-settings.d.ts +18 -0
- package/dist/ui/turn-into-toolbar-button.d.ts +129 -0
- package/dist/ui/update-display-tags.d.ts +5 -0
- package/dist/ui/update-node-static.d.ts +2 -0
- package/dist/ui/update-node.d.ts +3 -0
- package/dist/ui/update-rss-settings.d.ts +9 -0
- package/dist/ui/update-settings.d.ts +21 -0
- package/dist/ui/update-tags-settings.d.ts +8 -0
- package/dist/ui/updates-node-static.d.ts +2 -0
- package/dist/ui/updates-node.d.ts +2 -0
- package/dist/ui/use-member-profile.d.ts +22 -0
- package/dist/ui/use-placeholder-max-file-size.d.ts +3 -0
- package/dist/vendor/slate-yjs-core.d.ts +1 -0
- package/dist/vendor/slate-yjs-core.js +2 -0
- package/dist/vendor/y-protocols-awareness.d.ts +1 -0
- package/dist/vendor/y-protocols-awareness.js +2 -0
- package/dist/vendor/yjs.d.ts +1 -0
- package/dist/vendor/yjs.js +2 -0
- package/package.json +255 -4
|
@@ -0,0 +1,293 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __defProps = Object.defineProperties;
|
|
4
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
5
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
8
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
9
|
+
var __spreadValues = (a, b) => {
|
|
10
|
+
for (var prop in b || (b = {}))
|
|
11
|
+
if (__hasOwnProp.call(b, prop))
|
|
12
|
+
__defNormalProp(a, prop, b[prop]);
|
|
13
|
+
if (__getOwnPropSymbols)
|
|
14
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
15
|
+
if (__propIsEnum.call(b, prop))
|
|
16
|
+
__defNormalProp(a, prop, b[prop]);
|
|
17
|
+
}
|
|
18
|
+
return a;
|
|
19
|
+
};
|
|
20
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
21
|
+
|
|
22
|
+
// src/components/editor/collaboration/collaboration-plugin.tsx
|
|
23
|
+
import { toPlatePlugin } from "platejs/react";
|
|
24
|
+
|
|
25
|
+
// src/components/editor/collaboration/base-collaboration-plugin.ts
|
|
26
|
+
import { withCursors, withYHistory, withYjs } from "@slate-yjs/core";
|
|
27
|
+
import { createTSlatePlugin } from "platejs";
|
|
28
|
+
|
|
29
|
+
// src/components/editor/collaboration/shared-document.ts
|
|
30
|
+
import { slateNodesToInsertDelta } from "@slate-yjs/core";
|
|
31
|
+
import * as Y from "yjs";
|
|
32
|
+
var SHARED_ROOT_KEY = "content";
|
|
33
|
+
var EMPTY_DOCUMENT_VALUE = [
|
|
34
|
+
{
|
|
35
|
+
type: "p",
|
|
36
|
+
children: [{ text: "" }]
|
|
37
|
+
}
|
|
38
|
+
];
|
|
39
|
+
var MAX_YJS_CLIENT_ID = 2147483647;
|
|
40
|
+
var deriveSeedClientId = async (documentId, value) => {
|
|
41
|
+
const fingerprint = new TextEncoder().encode(`${documentId}-${JSON.stringify(value)}`);
|
|
42
|
+
const digest = await globalThis.crypto.subtle.digest("SHA-256", fingerprint);
|
|
43
|
+
return Math.abs(new DataView(digest).getInt32(0, false)) % MAX_YJS_CLIENT_ID + 1;
|
|
44
|
+
};
|
|
45
|
+
var getSharedRoot = (document) => document.get(SHARED_ROOT_KEY, Y.XmlText);
|
|
46
|
+
var hasSharedContent = (document) => getSharedRoot(document).length > 0;
|
|
47
|
+
var createDeterministicSeedUpdate = async (documentId, value) => {
|
|
48
|
+
const seedDocument = new Y.Doc({ guid: documentId });
|
|
49
|
+
seedDocument.clientID = await deriveSeedClientId(documentId, value);
|
|
50
|
+
getSharedRoot(seedDocument).applyDelta(slateNodesToInsertDelta(value));
|
|
51
|
+
const update = Y.encodeStateAsUpdate(seedDocument);
|
|
52
|
+
seedDocument.destroy();
|
|
53
|
+
return update;
|
|
54
|
+
};
|
|
55
|
+
var findBlockOffset = (sharedRoot, block) => {
|
|
56
|
+
let offset = 0;
|
|
57
|
+
for (const entry of sharedRoot.toDelta()) {
|
|
58
|
+
if (entry.insert === block) {
|
|
59
|
+
return offset;
|
|
60
|
+
}
|
|
61
|
+
offset += typeof entry.insert === "string" ? entry.insert.length : 1;
|
|
62
|
+
}
|
|
63
|
+
return -1;
|
|
64
|
+
};
|
|
65
|
+
var hasStructuralChange = (event) => event.delta.some((change) => change.insert !== void 0 || change.delete !== void 0);
|
|
66
|
+
var removePlaceholderWhenContentArrives = (document) => {
|
|
67
|
+
const sharedRoot = getSharedRoot(document);
|
|
68
|
+
const [firstEntry] = sharedRoot.toDelta();
|
|
69
|
+
const placeholder = firstEntry == null ? void 0 : firstEntry.insert;
|
|
70
|
+
if (!(placeholder instanceof Y.XmlText)) {
|
|
71
|
+
return () => {
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
const handleSharedRootChange = (event, transaction) => {
|
|
75
|
+
if (!hasStructuralChange(event)) {
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
const placeholderOffset = findBlockOffset(sharedRoot, placeholder);
|
|
79
|
+
const isPlaceholderUntouched = placeholderOffset !== -1 && placeholder.length === 0;
|
|
80
|
+
if (transaction.local || !isPlaceholderUntouched) {
|
|
81
|
+
sharedRoot.unobserve(handleSharedRootChange);
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
if (sharedRoot.length <= 1) {
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
sharedRoot.unobserve(handleSharedRootChange);
|
|
88
|
+
document.transact(() => {
|
|
89
|
+
sharedRoot.delete(placeholderOffset, 1);
|
|
90
|
+
});
|
|
91
|
+
};
|
|
92
|
+
sharedRoot.observe(handleSharedRootChange);
|
|
93
|
+
return () => {
|
|
94
|
+
sharedRoot.unobserve(handleSharedRootChange);
|
|
95
|
+
};
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
// src/components/editor/collaboration/base-collaboration-plugin.ts
|
|
99
|
+
var isSlateCoreEditor = (editor) => "apply" in editor && typeof editor.apply === "function" && "onChange" in editor && typeof editor.onChange === "function";
|
|
100
|
+
var BaseCollaborationPlugin = createTSlatePlugin({
|
|
101
|
+
key: "collaboration",
|
|
102
|
+
options: {
|
|
103
|
+
document: null,
|
|
104
|
+
awareness: null,
|
|
105
|
+
identity: null,
|
|
106
|
+
isSynced: false
|
|
107
|
+
},
|
|
108
|
+
extendEditor: ({ editor, getOptions }) => {
|
|
109
|
+
const { document, awareness, identity } = getOptions();
|
|
110
|
+
if (!document || !awareness || !identity) {
|
|
111
|
+
return editor;
|
|
112
|
+
}
|
|
113
|
+
if (!isSlateCoreEditor(editor)) {
|
|
114
|
+
throw new Error("Collaboration needs an editor that applies Slate operations");
|
|
115
|
+
}
|
|
116
|
+
const yjsEditor = withYjs(editor, getSharedRoot(document), { autoConnect: false });
|
|
117
|
+
const cursorEditor = withCursors(yjsEditor, awareness, { data: identity, autoSend: true });
|
|
118
|
+
return withYHistory(cursorEditor);
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
// src/components/editor/collaboration/remote-cursor-overlay.tsx
|
|
123
|
+
import { useRemoteCursorOverlayPositions } from "@slate-yjs/react";
|
|
124
|
+
import { useEditorContainerRef, usePluginOption } from "platejs/react";
|
|
125
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
126
|
+
var SELECTION_OPACITY = 0.5;
|
|
127
|
+
var addAlpha = (color, opacity) => {
|
|
128
|
+
if (color.startsWith("hsl(")) {
|
|
129
|
+
return color.replace("hsl(", "hsla(").replace(")", `, ${opacity})`);
|
|
130
|
+
}
|
|
131
|
+
if (color.startsWith("rgb(")) {
|
|
132
|
+
return color.replace("rgb(", "rgba(").replace(")", `, ${opacity})`);
|
|
133
|
+
}
|
|
134
|
+
const normalized = Math.round(Math.min(Math.max(opacity, 0), 1) * 255);
|
|
135
|
+
return color + normalized.toString(16).padStart(2, "0").toUpperCase();
|
|
136
|
+
};
|
|
137
|
+
var Caret = ({ caretPosition, data }) => {
|
|
138
|
+
const caretStyle = __spreadProps(__spreadValues({}, caretPosition), {
|
|
139
|
+
background: data == null ? void 0 : data.color
|
|
140
|
+
});
|
|
141
|
+
const labelStyle = {
|
|
142
|
+
background: data == null ? void 0 : data.color
|
|
143
|
+
};
|
|
144
|
+
return /* @__PURE__ */ jsx(
|
|
145
|
+
"div",
|
|
146
|
+
{
|
|
147
|
+
className: "group absolute w-0.5 opacity-70 transition-opacity duration-200 hover:opacity-100",
|
|
148
|
+
style: caretStyle,
|
|
149
|
+
children: /* @__PURE__ */ jsx(
|
|
150
|
+
"div",
|
|
151
|
+
{
|
|
152
|
+
className: "absolute top-0 -translate-y-full whitespace-nowrap rounded rounded-bl-none px-1.5 py-0.5 text-white text-xs opacity-70 transition-opacity duration-200 group-hover:opacity-100",
|
|
153
|
+
style: labelStyle,
|
|
154
|
+
children: data == null ? void 0 : data.name
|
|
155
|
+
}
|
|
156
|
+
)
|
|
157
|
+
}
|
|
158
|
+
);
|
|
159
|
+
};
|
|
160
|
+
var RemoteSelection = ({ caretPosition, data, selectionRects }) => {
|
|
161
|
+
if (!data) {
|
|
162
|
+
return null;
|
|
163
|
+
}
|
|
164
|
+
const selectionStyle = {
|
|
165
|
+
backgroundColor: addAlpha(data.color, SELECTION_OPACITY)
|
|
166
|
+
};
|
|
167
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
168
|
+
selectionRects.map((position) => /* @__PURE__ */ jsx(
|
|
169
|
+
"div",
|
|
170
|
+
{
|
|
171
|
+
className: "pointer-events-none absolute",
|
|
172
|
+
style: __spreadValues(__spreadValues({}, selectionStyle), position)
|
|
173
|
+
},
|
|
174
|
+
`${position.left}-${position.top}-${position.width}-${position.height}`
|
|
175
|
+
)),
|
|
176
|
+
caretPosition && /* @__PURE__ */ jsx(Caret, { caretPosition, data })
|
|
177
|
+
] });
|
|
178
|
+
};
|
|
179
|
+
var RemoteCursorOverlayContent = () => {
|
|
180
|
+
const containerRef = useEditorContainerRef();
|
|
181
|
+
const [cursors] = useRemoteCursorOverlayPositions({
|
|
182
|
+
containerRef
|
|
183
|
+
});
|
|
184
|
+
return /* @__PURE__ */ jsx(Fragment, { children: cursors.map((cursor) => /* @__PURE__ */ jsx(RemoteSelection, __spreadValues({}, cursor), cursor.clientId)) });
|
|
185
|
+
};
|
|
186
|
+
var RemoteCursorOverlay = () => {
|
|
187
|
+
const isSynced = usePluginOption(BaseCollaborationPlugin, "isSynced");
|
|
188
|
+
if (!isSynced) {
|
|
189
|
+
return null;
|
|
190
|
+
}
|
|
191
|
+
return /* @__PURE__ */ jsx(RemoteCursorOverlayContent, {});
|
|
192
|
+
};
|
|
193
|
+
|
|
194
|
+
// src/components/editor/collaboration/collaboration-plugin.tsx
|
|
195
|
+
var CollaborationPlugin = toPlatePlugin(BaseCollaborationPlugin, {
|
|
196
|
+
render: {
|
|
197
|
+
afterEditable: RemoteCursorOverlay
|
|
198
|
+
}
|
|
199
|
+
});
|
|
200
|
+
|
|
201
|
+
// src/components/editor/collaboration/collaboration-session.ts
|
|
202
|
+
import { YjsEditor } from "@slate-yjs/core";
|
|
203
|
+
import * as Y2 from "yjs";
|
|
204
|
+
var PROVIDER_SYNC_TIMEOUT_MS = 15e3;
|
|
205
|
+
var startCollaborationSession = (editor, { documentId, provider, initialValue, onInitialized }) => {
|
|
206
|
+
if (!YjsEditor.isYjsEditor(editor)) {
|
|
207
|
+
throw new Error("Collaboration needs an editor built with the plugins from createEditorCollaboration");
|
|
208
|
+
}
|
|
209
|
+
let isStopped = false;
|
|
210
|
+
let hasStartedInitialization = false;
|
|
211
|
+
let isEditorConnected = false;
|
|
212
|
+
let stopPlaceholderWatch = null;
|
|
213
|
+
const initialize = async (canSeedInitialValue) => {
|
|
214
|
+
if (isStopped || hasStartedInitialization) {
|
|
215
|
+
return;
|
|
216
|
+
}
|
|
217
|
+
hasStartedInitialization = true;
|
|
218
|
+
const isSeedingPlaceholder = !canSeedInitialValue || initialValue.length === 0;
|
|
219
|
+
const seedUpdate = await createDeterministicSeedUpdate(
|
|
220
|
+
documentId,
|
|
221
|
+
isSeedingPlaceholder ? EMPTY_DOCUMENT_VALUE : initialValue
|
|
222
|
+
);
|
|
223
|
+
if (isStopped) {
|
|
224
|
+
return;
|
|
225
|
+
}
|
|
226
|
+
if (!hasSharedContent(provider.document)) {
|
|
227
|
+
Y2.applyUpdate(provider.document, seedUpdate);
|
|
228
|
+
if (!canSeedInitialValue) {
|
|
229
|
+
stopPlaceholderWatch = removePlaceholderWhenContentArrives(provider.document);
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
YjsEditor.connect(editor);
|
|
233
|
+
isEditorConnected = true;
|
|
234
|
+
editor.tf.init({ shouldNormalizeEditor: false, value: null });
|
|
235
|
+
editor.api.onChange();
|
|
236
|
+
onInitialized(true);
|
|
237
|
+
};
|
|
238
|
+
const runInitialization = (canSeedInitialValue) => {
|
|
239
|
+
initialize(canSeedInitialValue).catch((error) => {
|
|
240
|
+
console.error("Collaborative editor failed to bind to the shared document", error);
|
|
241
|
+
});
|
|
242
|
+
};
|
|
243
|
+
const unsubscribe = provider.addSyncListener((state) => {
|
|
244
|
+
editor.setOption(BaseCollaborationPlugin, "isSynced", state.isSynced);
|
|
245
|
+
if (state.isSynced) {
|
|
246
|
+
runInitialization(true);
|
|
247
|
+
}
|
|
248
|
+
});
|
|
249
|
+
const syncTimeout = setTimeout(() => {
|
|
250
|
+
runInitialization(false);
|
|
251
|
+
}, PROVIDER_SYNC_TIMEOUT_MS);
|
|
252
|
+
const isProviderConnectedBySession = !provider.isConnected;
|
|
253
|
+
if (isProviderConnectedBySession) {
|
|
254
|
+
provider.connect();
|
|
255
|
+
}
|
|
256
|
+
return () => {
|
|
257
|
+
isStopped = true;
|
|
258
|
+
clearTimeout(syncTimeout);
|
|
259
|
+
unsubscribe();
|
|
260
|
+
stopPlaceholderWatch == null ? void 0 : stopPlaceholderWatch();
|
|
261
|
+
onInitialized(false);
|
|
262
|
+
if (isEditorConnected) {
|
|
263
|
+
YjsEditor.disconnect(editor);
|
|
264
|
+
}
|
|
265
|
+
if (isProviderConnectedBySession) {
|
|
266
|
+
provider.disconnect();
|
|
267
|
+
}
|
|
268
|
+
};
|
|
269
|
+
};
|
|
270
|
+
|
|
271
|
+
// src/components/editor/collaboration/editor-collaboration.ts
|
|
272
|
+
var createEditorCollaboration = ({
|
|
273
|
+
documentId,
|
|
274
|
+
provider,
|
|
275
|
+
identity
|
|
276
|
+
}) => ({
|
|
277
|
+
plugins: [
|
|
278
|
+
CollaborationPlugin.configure({
|
|
279
|
+
options: {
|
|
280
|
+
document: provider.document,
|
|
281
|
+
awareness: provider.awareness,
|
|
282
|
+
identity: {
|
|
283
|
+
name: identity.name,
|
|
284
|
+
color: identity.color
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
})
|
|
288
|
+
],
|
|
289
|
+
start: (editor, { initialValue, onInitialized }) => startCollaborationSession(editor, { documentId, provider, initialValue, onInitialized })
|
|
290
|
+
});
|
|
291
|
+
export {
|
|
292
|
+
createEditorCollaboration
|
|
293
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const RemoteCursorOverlay: () => import("react").JSX.Element | null;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { Value } from 'platejs';
|
|
2
|
+
import * as Y from 'yjs';
|
|
3
|
+
export declare const SHARED_ROOT_KEY = "content";
|
|
4
|
+
export declare const EMPTY_DOCUMENT_VALUE: Value;
|
|
5
|
+
export declare const getSharedRoot: (document: Y.Doc) => Y.XmlText;
|
|
6
|
+
export declare const hasSharedContent: (document: Y.Doc) => boolean;
|
|
7
|
+
/**
|
|
8
|
+
* Encodes the value as a Yjs update written under a client id derived from the document id and the value, so every
|
|
9
|
+
* peer that seeds the same document with the same value produces byte-identical updates and applying both leaves one
|
|
10
|
+
* copy of the content.
|
|
11
|
+
*/
|
|
12
|
+
export declare const createDeterministicSeedUpdate: (documentId: string, value: Value) => Promise<Uint8Array>;
|
|
13
|
+
/**
|
|
14
|
+
* Watches the empty paragraph that keeps an unsynced editor editable and deletes it when the stored content arrives
|
|
15
|
+
* from another peer, as long as nobody typed into it or added blocks next to it. Returns a function that stops the
|
|
16
|
+
* watch.
|
|
17
|
+
*/
|
|
18
|
+
export declare const removePlaceholderWhenContentArrives: (document: Y.Doc) => (() => void);
|