@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
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 0.4.3 (2026-11-26)
|
|
4
|
+
|
|
5
|
+
### Fixes
|
|
6
|
+
|
|
7
|
+
- Import `lucide-react/dynamic.mjs` by its full file name, so Next.js with Turbopack, webpack, and Node resolve the icon picker's dynamic icons.
|
|
8
|
+
- Return focus to the editor when a writer picks a block from the slash menu, so the next words go into that block every time.
|
|
9
|
+
|
|
10
|
+
## 0.4.1 (2026-11-26)
|
|
11
|
+
|
|
12
|
+
### Breaking changes
|
|
13
|
+
|
|
14
|
+
- The package is `@delali/web-editor` on npm, and it installs with no registry setting or token.
|
|
15
|
+
|
|
16
|
+
### Fixes
|
|
17
|
+
|
|
18
|
+
- Keep the cursor in the editor after a writer picks a block from the slash menu, so the next words go into that block.
|
|
19
|
+
|
|
20
|
+
## 0.4.0 (2026-11-26)
|
|
21
|
+
|
|
22
|
+
### Breaking changes
|
|
23
|
+
|
|
24
|
+
- The package is `@assetcorp/web-editor`, published from this repository to GitHub Packages under the `@assetcorp` scope.
|
|
25
|
+
- The main component is `WebEditor`, and its props type is `WebEditorProps`.
|
|
26
|
+
- The editor's root and portal elements carry the classes `web-editor-root` and `web-editor-portals`.
|
|
27
|
+
- The toolbar's Comment button dispatches `web-editor:start-comment-thread` on `window`.
|
|
28
|
+
- The default palette uses the neutral grays of the shadcn/ui neutral theme, and the font stack starts with `ui-sans-serif`. Set `theme="inherit"` to apply your app's colors.
|
|
29
|
+
- `react` and `react-dom` are peer dependencies at `^19.2.1`, and `@types/react` and `@types/react-dom` are optional peer dependencies.
|
|
30
|
+
|
|
31
|
+
### Fixes
|
|
32
|
+
|
|
33
|
+
- Open the settings popovers of blocks such as callouts, cards, frames, steps, tabbed code blocks, tiles, and toggles.
|
|
34
|
+
- Embed YouTube videos and Loom share links in an embedded player.
|
|
35
|
+
- Offer and size uploads only for the file types in `upload.acceptedFileTypes`.
|
|
36
|
+
- Keep typing in the slash menu's search field, with the slash menu offering only the blocks that the editor loads. The fix ships inside the package, so a host app applies no slate-react patch.
|
|
37
|
+
|
|
38
|
+
## 0.3.3 (2026-11-24)
|
|
39
|
+
|
|
40
|
+
### Features
|
|
41
|
+
|
|
42
|
+
- Add the `textSubstitutions` and `markShortcuts` feature options, so a host can keep typed text exactly as the writer types it or apply only some markdown mark shortcuts.
|
|
43
|
+
|
|
44
|
+
### Fixes
|
|
45
|
+
|
|
46
|
+
- Apply changes to `textSubstitutions` and `markShortcuts` to an editor that is already mounted.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright 2026 Delali (https://sondelali.com)
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/README.md
CHANGED
|
@@ -1,3 +1,168 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @delali/web-editor
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A rich text editor for React, built on [Plate](https://platejs.org). The host app supplies identity, permissions, uploads, AI, comments, and multi-user editing through one adapter object, and the editor renders and edits the document. The package also converts a document to and from Markdown, MDX, and HTML, so a server can render what writers save.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
The package is public on npm, so it installs with no registry setting or token:
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
pnpm add -E @delali/web-editor
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
The package ships ESM with TypeScript declarations, and it needs React 19.2.1 or a later 19.x release. Import the compiled stylesheet once, in the root layout:
|
|
14
|
+
|
|
15
|
+
```tsx
|
|
16
|
+
import '@delali/web-editor/styles.css'
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Usage
|
|
20
|
+
|
|
21
|
+
```tsx
|
|
22
|
+
'use client'
|
|
23
|
+
|
|
24
|
+
import { WebEditor, type Value } from '@delali/web-editor'
|
|
25
|
+
import { useState } from 'react'
|
|
26
|
+
|
|
27
|
+
const PRODUCT_DESCRIPTION: Value = [{ type: 'p', children: [{ text: 'A two-person tent with a waterproof floor.' }] }]
|
|
28
|
+
|
|
29
|
+
export const ProductDescriptionEditor = () => {
|
|
30
|
+
const [value, setValue] = useState<Value>(PRODUCT_DESCRIPTION)
|
|
31
|
+
|
|
32
|
+
return <WebEditor initialValue={value} onChange={setValue} placeholder="Describe the product" />
|
|
33
|
+
}
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
`WebEditor` also takes `readOnly`, `features` to switch individual blocks and menus on or off, `toolbar`, `showToc`, `variant`, and the class name props `className`, `containerClassName`, and `editorClassName`. `WebEditorProps` in `@delali/web-editor/types` lists every prop.
|
|
37
|
+
|
|
38
|
+
Set `plainLinks: true` in `features` when you want every link in the text to look the way it does on a published page. The editor then shows the link's own text, underlined in the editor's primary color, on the same line as the words around it. When `plainLinks` is left out, the editor shows each link as a smart link chip, and an author can switch it to its URL or to a card. In both views, a click on a link in the editor opens a toolbar where the author can open, copy, edit, or remove it.
|
|
39
|
+
|
|
40
|
+
Set `todoLists: false` in `features` when writers should get bulleted and numbered lists but no to-do lists, the checklists with a checkbox on each item. The slash menu, the turn-into menus, and the `[] ` and `[x] ` shortcuts then offer no to-do list. A to-do item that arrives through a paste, loaded HTML, loaded markdown, or a saved value becomes a bulleted item with the same text, and its checked state drops. `todoLists` defaults to `true`, and it has no effect when `lists` is off.
|
|
41
|
+
|
|
42
|
+
The editor turns typed shortcuts into symbols and marks, so `->` becomes `→`, `(c)` becomes `©`, and `**bold**` becomes bold text. It applies none of them while the word before the cursor reads as a web address or an email domain, such as `https://example.com/v1/2`, `//cdn.example.com`, `www.example.com`, `example.com?q=a==b`, `127.0.0.1:8080/docs`, `mailto:sales@example.com`, or the part of `sales@example.com` after the `@`. A shortcut that the writer types before the word reads as an address can apply, so the editor turns the `--` in `first--last.example` into `—` because it can't recognize `first--` as an address yet. The editor also applies no symbol shortcut inside inline code. A fraction such as `1/2` becomes `½` only when it forms a separate word and the writer follows it with a space, a punctuation mark, or Enter, so the editor leaves a date such as `11/24` and a number such as `1/20` as typed. A writer who presses Backspace with the cursor right after a symbol gets the typed shortcut back.
|
|
43
|
+
|
|
44
|
+
Set `textSubstitutions: false` in `features` when the text has to stay exactly as the writer types it, as in an email. The editor then leaves fractions, symbols such as `(c)`, arrows, comparisons, smart quotes, dashes, and ellipses as typed. Set `markShortcuts` to the marks whose typed markdown shortcuts the editor applies, as in `markShortcuts: ['bold', 'code']`, which keeps `**bold**` and `` `code` `` and leaves `_italic_` and `~~strikethrough~~` as typed. `MarkShortcuts` in `@delali/web-editor/types` lists every mark that the setting accepts. Both settings change only what the editor does with typed text, so the keyboard shortcuts, the toolbar, and block shortcuts such as `# ` and `- ` work as before. When you leave them out, `textSubstitutions` is `true` and `markShortcuts` holds every mark.
|
|
45
|
+
|
|
46
|
+
## Theme
|
|
47
|
+
|
|
48
|
+
By default, the editor and its menus apply the editor's palette, which uses the neutral grays of the shadcn/ui neutral theme and replaces any shadcn color tokens that the page defines. Set `theme="inherit"` when you want the editor to use your app's colors. With `theme="inherit"`, the editor and every menu, toolbar, and popover that it opens use your page's values for `--background`, `--foreground`, `--card`, `--card-foreground`, `--popover`, `--popover-foreground`, `--primary`, `--primary-foreground`, `--secondary`, `--secondary-foreground`, `--muted`, `--muted-foreground`, `--accent`, `--accent-foreground`, `--destructive`, `--border`, `--input`, and `--ring`.
|
|
49
|
+
|
|
50
|
+
Your dark mode values apply too, as long as your app marks dark mode with a `dark` class on an ancestor of the editor, as `next-themes` does with `attribute="class"`. The editor's accent color and the color of its secondary text then follow your `--primary` and `--muted-foreground`. A hovered, focused, or highlighted menu item or toolbar button also gains a 1px outline in your `--ring` color, so pick a `--ring` with at least 3:1 contrast against your `--popover` in both light and dark mode. The editor keeps its radius, spacing, shadows, chart colors, and sidebar colors.
|
|
51
|
+
|
|
52
|
+
The editor sets its system font stack on `.web-editor-root` and `.web-editor-portals`. Target those classes in your stylesheet to give the editor your app's font.
|
|
53
|
+
|
|
54
|
+
```tsx
|
|
55
|
+
<WebEditor features={{ links: true, plainLinks: true, lists: true, todoLists: false }} theme="inherit" />
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## Adapter
|
|
59
|
+
|
|
60
|
+
Pass an `EditorAdapter` through the `adapter` prop to connect the editor to the host app. Without one, the editor uses `NullEditorAdapter`, which denies every permission and returns empty results from every lookup.
|
|
61
|
+
|
|
62
|
+
| Member | Description |
|
|
63
|
+
| ------------- | ----------------------------------------------------------------------------------------------------------------------- |
|
|
64
|
+
| `identity` | `{ id, name, avatarUrl?, color? }` for the person editing. |
|
|
65
|
+
| `permissions` | `{ canMention, canLinkPage, canUseAI, canMutate }`. |
|
|
66
|
+
| `mentions` | `searchMembers(query, signal?)`, plus an optional `resolveMember(id, signal?)` for profile cards. |
|
|
67
|
+
| `pageLinks` | `searchPages` and `resolvePage` for links to the host's pages, stored as typed references. |
|
|
68
|
+
| `ai` | `{ endpoint, headers?, contextBody? }`, or `null`. The editor sends the request and streams the answer. |
|
|
69
|
+
| `upload` | `uploadFile(file, onProgress?)`, or `null`. It resolves to the stored file's `key`, `name`, `size`, `type`, and `url`. |
|
|
70
|
+
| `collab` | Multi-user editing from `createEditorCollaboration`, or `null`. |
|
|
71
|
+
| `comments` | Persistent comment threads, or `null`. |
|
|
72
|
+
| `inspector` | A side panel host, or `null`. |
|
|
73
|
+
|
|
74
|
+
Start from `NullEditorAdapter` and replace the members that the host supports:
|
|
75
|
+
|
|
76
|
+
```tsx
|
|
77
|
+
import { WebEditor } from '@delali/web-editor'
|
|
78
|
+
import { type EditorAdapter, NullEditorAdapter } from '@delali/web-editor/adapter'
|
|
79
|
+
|
|
80
|
+
const productAdapter: EditorAdapter = {
|
|
81
|
+
...NullEditorAdapter,
|
|
82
|
+
identity: { id: 'member_0190a5b2', name: 'Writer' },
|
|
83
|
+
upload: { uploadFile: uploadProductPhoto },
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export const ProductEditor = () => <WebEditor adapter={productAdapter} />
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
When `adapter.comments` is set, the toolbar's Comment button dispatches a `web-editor:start-comment-thread` event on `window`. Listen for that event to open the host's comment composer.
|
|
90
|
+
|
|
91
|
+
The editor also accepts an `upload` prop, and when `upload.uploadFn` and `adapter.upload` are both set, the editor uses `upload.uploadFn`. Set `upload.acceptedFileTypes` to the MIME types that your storage accepts, as in `['image/png', 'image/jpeg']` or `['image/*']`, and the editor then offers and sizes uploads only for those types. Set `upload.maxFileSize` to the largest file, in bytes, that your storage accepts, as in `upload={{ maxFileSize: 1024 * 1024 }}` for 1 MB. The upload popover then shows that limit, and the editor refuses a larger file that a writer picks, drops, or pastes before the file reaches your upload function, with a message that names the limit. A value that is not a non-negative number of bytes, such as `NaN` or `Infinity`, sets a 5 MB limit on every path. Without `maxFileSize`, the popover shows 5 MB, and the editor refuses a file above 5 MB that would go to an inline upload or to `adapter.upload`, while `upload.uploadFn` gets no size check from the editor. A dropped or pasted file then gets the default limit for its type, which is 4 MB for an image or a PDF, 8 MB for audio or another file, 16 MB for a video, and 64 KB for a text file.
|
|
92
|
+
|
|
93
|
+
These limits run in the browser, so your storage has to apply its own size and type limits too. [SECURITY.md](SECURITY.md) lists what the host has to enforce on its server.
|
|
94
|
+
|
|
95
|
+
## Multi-user editing
|
|
96
|
+
|
|
97
|
+
Multi-user editing stays off until `adapter.collab` is set, and the main entry loads no Yjs code. To turn it on, build the adapter from the host's Yjs transport:
|
|
98
|
+
|
|
99
|
+
```tsx
|
|
100
|
+
import { createEditorCollaboration } from '@delali/web-editor/collaboration'
|
|
101
|
+
|
|
102
|
+
const collab = createEditorCollaboration({
|
|
103
|
+
documentId: `product:${productId}`,
|
|
104
|
+
provider,
|
|
105
|
+
identity: { name: 'Writer', color: '#2563eb' },
|
|
106
|
+
})
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
`provider` exposes `document` (a `Y.Doc`), `awareness`, `isConnected`, `isSynced`, `connect()`, `disconnect()`, and `addSyncListener(listener)`. Create the provider with `Y.Doc` and `Awareness` from `@delali/web-editor/yjs` and `@delali/web-editor/y-protocols-awareness`, so that the provider and the editor share one copy of Yjs. Memoize the adapter once per provider, because the editor rebuilds itself, and drops the selection and the undo history, whenever `adapter.collab` changes. The host creates and destroys the provider, and the editor disconnects it on unmount only when the editor connected it.
|
|
110
|
+
|
|
111
|
+
## Entry points
|
|
112
|
+
|
|
113
|
+
| Import path | Contents |
|
|
114
|
+
| --------------------------------------------- | ----------------------------------------------------------------------- |
|
|
115
|
+
| `@delali/web-editor` | `WebEditor`, the table of contents helpers, and `Value` |
|
|
116
|
+
| `@delali/web-editor/adapter` | `EditorAdapter` types, `NullEditorAdapter`, and `EditorAdapterProvider` |
|
|
117
|
+
| `@delali/web-editor/collaboration` | `createEditorCollaboration` and the provider types |
|
|
118
|
+
| `@delali/web-editor/config` | `EditorConfigProvider` and the config hooks |
|
|
119
|
+
| `@delali/web-editor/types` | Prop and config types, and the feature defaults |
|
|
120
|
+
| `@delali/web-editor/create-plugins` | `createEditorPlugins` for a custom Plate editor |
|
|
121
|
+
| `@delali/web-editor/editor-kit` | The full Plate plugin kit |
|
|
122
|
+
| `@delali/web-editor/editor-base-kit` | The plugin kit without React components, for static rendering |
|
|
123
|
+
| `@delali/web-editor/use-chat` | The AI chat hook |
|
|
124
|
+
| `@delali/web-editor/use-upload` | The upload hook and the `UploadFunction` type |
|
|
125
|
+
| `@delali/web-editor/version-history` | Version comparison components |
|
|
126
|
+
| `@delali/web-editor/link-reference` | Typed link references, importable on the server |
|
|
127
|
+
| `@delali/web-editor/extract-headings` | Heading extraction from a value |
|
|
128
|
+
| `@delali/web-editor/comment-mark-strip` | Removes comment marks from a value |
|
|
129
|
+
| `@delali/web-editor/markdown-utils` | Markdown conversion |
|
|
130
|
+
| `@delali/web-editor/html-serialize-utils` | HTML rendering of a value, for server code |
|
|
131
|
+
| `@delali/web-editor/mdx-round-trip` | Byte-stable conversion between a value and MDX |
|
|
132
|
+
| `@delali/web-editor/utils` | `cn` and other helpers |
|
|
133
|
+
| `@delali/web-editor/yjs` | The editor's copy of Yjs |
|
|
134
|
+
| `@delali/web-editor/y-protocols-awareness` | The editor's copy of the Awareness protocol |
|
|
135
|
+
| `@delali/web-editor/slate-yjs-core` | The editor's copy of `@slate-yjs/core` |
|
|
136
|
+
| `@delali/web-editor/styles.css` | The compiled stylesheet |
|
|
137
|
+
|
|
138
|
+
`markdown-utils`, `html-serialize-utils`, and `mdx-round-trip` import `@platejs/math`, which imports KaTeX's stylesheet, so they need a bundler such as Next.js and fail to load under plain Node.
|
|
139
|
+
|
|
140
|
+
## Development
|
|
141
|
+
|
|
142
|
+
The repository uses pnpm 11.28.2, which Corepack installs from the `packageManager` field, and Node.js 24, as `.node-version` sets.
|
|
143
|
+
|
|
144
|
+
```sh
|
|
145
|
+
corepack enable
|
|
146
|
+
pnpm install
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
| Command | What it does |
|
|
150
|
+
| ----------------------- | -------------------------------------------------------------------------------- |
|
|
151
|
+
| `pnpm dev` | Rebuilds the JavaScript and the stylesheet into `dist` whenever a source changes |
|
|
152
|
+
| `pnpm lint` | Checks formatting and lint rules with Biome |
|
|
153
|
+
| `pnpm lint:fix` | Applies Biome's safe fixes and formatting |
|
|
154
|
+
| `pnpm typecheck` | Type-checks the source with TypeScript |
|
|
155
|
+
| `pnpm build` | Writes the ESM bundles, the declarations, and `styles.css` to `dist` |
|
|
156
|
+
| `pnpm check:exports` | Confirms that every export in `package.json` points at a built file |
|
|
157
|
+
| `pnpm test` | Runs the Vitest suites in `__tests__` |
|
|
158
|
+
| `pnpm test:coverage` | Runs the suites with coverage for the MDX conversion |
|
|
159
|
+
|
|
160
|
+
To try the editor in an app while you change it, run `pnpm dev` here and link the package from the app with `pnpm link /path/to/web-editor`.
|
|
161
|
+
|
|
162
|
+
## Releases
|
|
163
|
+
|
|
164
|
+
The version in `package.json` is the version that the next release publishes, and [CHANGELOG.md](CHANGELOG.md) records each release. To release, update both in a commit on `main`, then push a tag that matches the version, such as `v0.4.0`. The publish workflow checks that the tag matches `package.json`, then lints, type-checks, builds, and tests it. Finally, it stages the version on npm through trusted publishing, so the repository holds no npm token. A maintainer then approves the staged version in the Staged Packages tab on npmjs.com, or with `npm stage approve <stage-id>`, and the version goes live.
|
|
165
|
+
|
|
166
|
+
## License
|
|
167
|
+
|
|
168
|
+
[Apache-2.0](LICENSE)
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { UseChatHelpers } from '@ai-sdk/react';
|
|
2
|
+
import type { UIDataTypes, UIMessage } from 'ai';
|
|
3
|
+
export type ToolName = 'comment' | 'edit' | 'generate';
|
|
4
|
+
export interface AIComment {
|
|
5
|
+
blockId: string;
|
|
6
|
+
comment: string;
|
|
7
|
+
content: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Wire shape emitted by the backend `data-comment` stream parts. The LLM
|
|
11
|
+
* returns the verbatim span (`quote`) and a free-text comment; the editor
|
|
12
|
+
* resolves the quote to a Plate block to derive `blockId` and `content`.
|
|
13
|
+
*/
|
|
14
|
+
export interface StructuredComment {
|
|
15
|
+
quote: string;
|
|
16
|
+
comment: string;
|
|
17
|
+
severity: 'note' | 'suggestion' | 'issue';
|
|
18
|
+
}
|
|
19
|
+
export type ChatMessage = UIMessage<{}, UIDataTypes>;
|
|
20
|
+
export type Chat = UseChatHelpers<ChatMessage>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type PluginConfig } from 'platejs';
|
|
2
|
+
import type { Awareness } from 'y-protocols/awareness';
|
|
3
|
+
import type * as Y from 'yjs';
|
|
4
|
+
export type EditorCollabIdentity = {
|
|
5
|
+
name: string;
|
|
6
|
+
color: string;
|
|
7
|
+
};
|
|
8
|
+
export type CollaborationPluginConfig = PluginConfig<'collaboration', {
|
|
9
|
+
document: Y.Doc | null;
|
|
10
|
+
awareness: Awareness | null;
|
|
11
|
+
identity: EditorCollabIdentity | null;
|
|
12
|
+
isSynced: boolean;
|
|
13
|
+
}>;
|
|
14
|
+
export declare const BaseCollaborationPlugin: import("platejs").SlatePlugin<CollaborationPluginConfig>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const CollaborationPlugin: import("platejs/react").PlatePlugin<import("platejs").PluginConfig<"collaboration", {
|
|
2
|
+
document: import("yjs").Doc | null;
|
|
3
|
+
awareness: import("y-protocols/awareness.js").Awareness | null;
|
|
4
|
+
identity: import("./base-collaboration-plugin").EditorCollabIdentity | null;
|
|
5
|
+
isSynced: boolean;
|
|
6
|
+
}, {}, {}, {}>>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { PlateEditor } from 'platejs/react';
|
|
2
|
+
import type { Awareness } from 'y-protocols/awareness';
|
|
3
|
+
import * as Y from 'yjs';
|
|
4
|
+
import type { EditorCollabStartOptions } from '../../../context/editor-adapter';
|
|
5
|
+
export interface EditorCollabSyncState {
|
|
6
|
+
isConnected: boolean;
|
|
7
|
+
isSynced: boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface EditorCollabProvider {
|
|
10
|
+
readonly document: Y.Doc;
|
|
11
|
+
readonly awareness: Awareness;
|
|
12
|
+
readonly isConnected: boolean;
|
|
13
|
+
readonly isSynced: boolean;
|
|
14
|
+
connect(): void;
|
|
15
|
+
disconnect(): void;
|
|
16
|
+
addSyncListener(listener: (state: EditorCollabSyncState) => void): () => void;
|
|
17
|
+
}
|
|
18
|
+
interface CollaborationSessionInput extends EditorCollabStartOptions {
|
|
19
|
+
documentId: string;
|
|
20
|
+
provider: EditorCollabProvider;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Binds the editor to the provider's document once the provider reports a sync, and seeds an empty document with the
|
|
24
|
+
* initial value first. When the provider has not synced after `PROVIDER_SYNC_TIMEOUT_MS`, the session binds the
|
|
25
|
+
* editor anyway and seeds only an empty paragraph, because a seed of the initial value written before the stored
|
|
26
|
+
* content arrives would duplicate that content. That paragraph disappears when the stored content arrives, unless
|
|
27
|
+
* the person typed into it first.
|
|
28
|
+
*/
|
|
29
|
+
export declare const startCollaborationSession: (editor: PlateEditor, { documentId, provider, initialValue, onInitialized }: CollaborationSessionInput) => (() => void);
|
|
30
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { EditorCollabAdapter } from '../../../context/editor-adapter';
|
|
2
|
+
import type { Value } from '../../../types/editor';
|
|
3
|
+
interface CollaborationStarterProps {
|
|
4
|
+
collab: EditorCollabAdapter;
|
|
5
|
+
initialValue: Value;
|
|
6
|
+
onInitialized: (isInitialized: boolean) => void;
|
|
7
|
+
}
|
|
8
|
+
export declare const CollaborationStarter: ({ collab, initialValue, onInitialized }: CollaborationStarterProps) => null;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { EditorCollabAdapter } from '../../../context/editor-adapter';
|
|
2
|
+
import type { EditorCollabIdentity } from './base-collaboration-plugin';
|
|
3
|
+
import { type EditorCollabProvider } from './collaboration-session';
|
|
4
|
+
export type { EditorCollabIdentity } from './base-collaboration-plugin';
|
|
5
|
+
export type { EditorCollabProvider, EditorCollabSyncState } from './collaboration-session';
|
|
6
|
+
export interface CreateEditorCollaborationOptions {
|
|
7
|
+
documentId: string;
|
|
8
|
+
provider: EditorCollabProvider;
|
|
9
|
+
identity: EditorCollabIdentity;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Connects the editor to a Yjs document that the host app's provider keeps in sync. The host app creates the provider
|
|
13
|
+
* and destroys it, while the returned adapter binds the editor to the provider's document and seeds an empty document
|
|
14
|
+
* with the initial value.
|
|
15
|
+
*/
|
|
16
|
+
export declare const createEditorCollaboration: ({ documentId, provider, identity, }: CreateEditorCollaborationOptions) => EditorCollabAdapter;
|