@delali/web-editor 0.0.0-stage → 0.4.1
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 +39 -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 +25204 -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 +18781 -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 +19179 -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 +27295 -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-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 +25275 -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,45 @@
|
|
|
1
|
+
import { type DeserializeMdOptions, type SerializeMdOptions } from '@platejs/markdown';
|
|
2
|
+
import type { TElement } from 'platejs';
|
|
3
|
+
import { type MdxJsxAttribute } from './mdx-attribute-codec';
|
|
4
|
+
type MdxElementType = 'mdxJsxFlowElement' | 'mdxJsxTextElement';
|
|
5
|
+
interface MdxElement {
|
|
6
|
+
type: MdxElementType;
|
|
7
|
+
name: string;
|
|
8
|
+
attributes: MdxJsxAttribute[];
|
|
9
|
+
children: unknown[];
|
|
10
|
+
}
|
|
11
|
+
type MdxDeserializeOptions = DeserializeMdOptions;
|
|
12
|
+
export interface MdxAttributeAlias {
|
|
13
|
+
field: string;
|
|
14
|
+
attribute: string;
|
|
15
|
+
}
|
|
16
|
+
export interface MdxElementRuleConfig {
|
|
17
|
+
pluginKey: string;
|
|
18
|
+
tagName: string;
|
|
19
|
+
isInline?: boolean;
|
|
20
|
+
isVoid?: boolean;
|
|
21
|
+
aliases?: MdxAttributeAlias[];
|
|
22
|
+
/** UI-state fields that must never reach the wire form. */
|
|
23
|
+
strippedFields?: string[];
|
|
24
|
+
/** Fields whose value is free text and must decode back as a string. */
|
|
25
|
+
stringFields?: string[];
|
|
26
|
+
/**
|
|
27
|
+
* Fields that are recomputed from other data on deserialize and so must not be
|
|
28
|
+
* written to MDX. Removed on serialize; restored by `deriveFields`.
|
|
29
|
+
*/
|
|
30
|
+
derivedFields?: string[];
|
|
31
|
+
/**
|
|
32
|
+
* Recomputes `derivedFields` from a deserialized element. Runs after props are
|
|
33
|
+
* restored, so it can read the element's own fields and children.
|
|
34
|
+
*/
|
|
35
|
+
deriveFields?: (element: TElement) => Record<string, unknown>;
|
|
36
|
+
}
|
|
37
|
+
interface SerializeRule {
|
|
38
|
+
serialize: (node: TElement, options: SerializeMdOptions) => MdxElement;
|
|
39
|
+
}
|
|
40
|
+
interface DeserializeRule {
|
|
41
|
+
deserialize: (node: MdxElement, deco: unknown, options: MdxDeserializeOptions) => TElement;
|
|
42
|
+
}
|
|
43
|
+
export type MdxElementRuleEntries = Record<string, SerializeRule | DeserializeRule>;
|
|
44
|
+
export declare const defineMdxElementRule: (config: MdxElementRuleConfig) => MdxElementRuleEntries;
|
|
45
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type AnyPluginConfig } from 'platejs';
|
|
2
|
+
/**
|
|
3
|
+
* Server serialization plugin set. Registers every custom node as a plain node
|
|
4
|
+
* definition (no React components) so the round-trip module never pulls client
|
|
5
|
+
* component code into the server bundle. Callout, link, and mention ship in
|
|
6
|
+
* ServerPlugins.
|
|
7
|
+
*/
|
|
8
|
+
export declare const MdxServerPlugins: AnyPluginConfig[];
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type MdRules } from '@platejs/markdown';
|
|
2
|
+
/**
|
|
3
|
+
* A `toggle` node carries no default markdown rule, so an unhandled toggle is
|
|
4
|
+
* dropped on serialize. Both standalone toggles and accordion items use the
|
|
5
|
+
* `toggle` type; the parent disambiguates. The `accordion_group` rule owns its
|
|
6
|
+
* children and emits each as `<Accordion>`, so a `toggle` only reaches the
|
|
7
|
+
* standalone rule when it is not inside a group, where it emits `<Toggle>`.
|
|
8
|
+
*/
|
|
9
|
+
export declare const mdxToggleRules: MdRules;
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
type MediaProps = Record<string, unknown>;
|
|
2
|
+
interface MediaHtmlParserOptions {
|
|
3
|
+
/** The CSS selector that finds the media element, as in `img` or `a[download]`. */
|
|
4
|
+
selector: string;
|
|
5
|
+
/** The tag of a media element that loads outside a figure too, as `IMG` does. */
|
|
6
|
+
bareTagName?: string;
|
|
7
|
+
/** Reads the node's own props, such as `url`, from the media element. A result of `undefined` skips the element. */
|
|
8
|
+
read: (media: HTMLElement) => MediaProps | undefined;
|
|
9
|
+
}
|
|
10
|
+
interface ParseOptions {
|
|
11
|
+
element: HTMLElement;
|
|
12
|
+
type: string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Builds the HTML parser for a media plugin, so that loading the HTML from `serializePlateToHtml` gives back the same
|
|
16
|
+
* media node. It reads a `<figure>` that holds the media element and an optional `<figcaption>`, and, for a tag that
|
|
17
|
+
* stands alone in HTML such as `<img>`, the bare element too. The figure's children never load as text of their own.
|
|
18
|
+
*/
|
|
19
|
+
export declare const createMediaHtmlParsers: ({ selector, bareTagName, read }: MediaHtmlParserOptions) => {
|
|
20
|
+
html: {
|
|
21
|
+
deserializer: {
|
|
22
|
+
rules: {
|
|
23
|
+
validNodeName: string | string[];
|
|
24
|
+
}[];
|
|
25
|
+
query: ({ element }: {
|
|
26
|
+
element: HTMLElement;
|
|
27
|
+
}) => boolean;
|
|
28
|
+
parse: ({ element, type }: ParseOptions) => {
|
|
29
|
+
type: string;
|
|
30
|
+
} | undefined;
|
|
31
|
+
withoutChildren: boolean;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
export declare const IMAGE_HTML_PARSERS: {
|
|
36
|
+
html: {
|
|
37
|
+
deserializer: {
|
|
38
|
+
rules: {
|
|
39
|
+
validNodeName: string | string[];
|
|
40
|
+
}[];
|
|
41
|
+
query: ({ element }: {
|
|
42
|
+
element: HTMLElement;
|
|
43
|
+
}) => boolean;
|
|
44
|
+
parse: ({ element, type }: ParseOptions) => {
|
|
45
|
+
type: string;
|
|
46
|
+
} | undefined;
|
|
47
|
+
withoutChildren: boolean;
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
export declare const VIDEO_HTML_PARSERS: {
|
|
52
|
+
html: {
|
|
53
|
+
deserializer: {
|
|
54
|
+
rules: {
|
|
55
|
+
validNodeName: string | string[];
|
|
56
|
+
}[];
|
|
57
|
+
query: ({ element }: {
|
|
58
|
+
element: HTMLElement;
|
|
59
|
+
}) => boolean;
|
|
60
|
+
parse: ({ element, type }: ParseOptions) => {
|
|
61
|
+
type: string;
|
|
62
|
+
} | undefined;
|
|
63
|
+
withoutChildren: boolean;
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
export declare const AUDIO_HTML_PARSERS: {
|
|
68
|
+
html: {
|
|
69
|
+
deserializer: {
|
|
70
|
+
rules: {
|
|
71
|
+
validNodeName: string | string[];
|
|
72
|
+
}[];
|
|
73
|
+
query: ({ element }: {
|
|
74
|
+
element: HTMLElement;
|
|
75
|
+
}) => boolean;
|
|
76
|
+
parse: ({ element, type }: ParseOptions) => {
|
|
77
|
+
type: string;
|
|
78
|
+
} | undefined;
|
|
79
|
+
withoutChildren: boolean;
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
};
|
|
83
|
+
/**
|
|
84
|
+
* A video embed keeps the address the user pasted in `data-url`, next to the player address in `src`.
|
|
85
|
+
*/
|
|
86
|
+
export declare const MEDIA_EMBED_HTML_PARSERS: {
|
|
87
|
+
html: {
|
|
88
|
+
deserializer: {
|
|
89
|
+
rules: {
|
|
90
|
+
validNodeName: string | string[];
|
|
91
|
+
}[];
|
|
92
|
+
query: ({ element }: {
|
|
93
|
+
element: HTMLElement;
|
|
94
|
+
}) => boolean;
|
|
95
|
+
parse: ({ element, type }: ParseOptions) => {
|
|
96
|
+
type: string;
|
|
97
|
+
} | undefined;
|
|
98
|
+
withoutChildren: boolean;
|
|
99
|
+
};
|
|
100
|
+
};
|
|
101
|
+
};
|
|
102
|
+
/**
|
|
103
|
+
* A file loads only from a figure, because a bare download link elsewhere in the HTML stays a link.
|
|
104
|
+
*/
|
|
105
|
+
export declare const FILE_HTML_PARSERS: {
|
|
106
|
+
html: {
|
|
107
|
+
deserializer: {
|
|
108
|
+
rules: {
|
|
109
|
+
validNodeName: string | string[];
|
|
110
|
+
}[];
|
|
111
|
+
query: ({ element }: {
|
|
112
|
+
element: HTMLElement;
|
|
113
|
+
}) => boolean;
|
|
114
|
+
parse: ({ element, type }: ParseOptions) => {
|
|
115
|
+
type: string;
|
|
116
|
+
} | undefined;
|
|
117
|
+
withoutChildren: boolean;
|
|
118
|
+
};
|
|
119
|
+
};
|
|
120
|
+
};
|
|
121
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type SlateEditor } from 'platejs';
|
|
2
|
+
/**
|
|
3
|
+
* Turns each blank line from `serializePlateToHtml` back into an empty `<p>`, so that it loads as an empty
|
|
4
|
+
* paragraph rather than as a zero-width space that sits invisibly at the start of whatever the user types there.
|
|
5
|
+
*/
|
|
6
|
+
export declare const prepareParagraphHtml: (html: string) => string;
|
|
7
|
+
/**
|
|
8
|
+
* Runs `prepareParagraphHtml` before the editor parses an HTML string. Element input passes through untouched.
|
|
9
|
+
*/
|
|
10
|
+
export declare const overrideParagraphHtmlDeserialize: ({ editor }: {
|
|
11
|
+
editor: SlateEditor;
|
|
12
|
+
}) => {
|
|
13
|
+
api: {
|
|
14
|
+
html: {
|
|
15
|
+
deserialize: (options: Parameters<((args_0: {
|
|
16
|
+
element: HTMLElement | string;
|
|
17
|
+
collapseWhiteSpace?: boolean;
|
|
18
|
+
defaultElementPlugin?: import("platejs").WithRequiredKey;
|
|
19
|
+
}) => import("platejs").Descendant[]) & ((args_0: {
|
|
20
|
+
element: HTMLElement | string;
|
|
21
|
+
collapseWhiteSpace?: boolean;
|
|
22
|
+
defaultElementPlugin?: import("platejs").WithRequiredKey;
|
|
23
|
+
}) => import("platejs").Descendant[])>[0]) => import("platejs").Descendant[];
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
};
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Minimal plugin set for server-side HTML serialization.
|
|
3
|
+
* Does not include React components or client-side dependencies.
|
|
4
|
+
*/
|
|
5
|
+
export declare const ServerPlugins: (import("platejs").SlatePlugin<import("platejs").PluginConfig<any, {}, {}, {}, {}>> | import("platejs").SlatePlugin<import("platejs").PluginConfig<"p", {}, {}, {}, {}>> | import("platejs").SlatePlugin<import("platejs").PluginConfig<any, {}, {}, Record<any, {
|
|
6
|
+
toggle: () => void;
|
|
7
|
+
}>, {}>> | import("platejs").SlatePlugin<import("platejs").PluginConfig<"blockquote", {}, {}, Record<"blockquote", {
|
|
8
|
+
toggle: () => void;
|
|
9
|
+
}>, {}>> | import("platejs").SlatePlugin<import("platejs").PluginConfig<"hr", {}, {}, {}, {}>> | import("platejs").SlatePlugin<import("platejs").PluginConfig<"bold", {}, {}, Record<"bold", {
|
|
10
|
+
toggle: () => void;
|
|
11
|
+
}>, {}>> | import("platejs").SlatePlugin<import("platejs").PluginConfig<"italic", {}, {}, Record<"italic", {
|
|
12
|
+
toggle: () => void;
|
|
13
|
+
}>, {}>> | import("platejs").SlatePlugin<import("platejs").PluginConfig<"underline", {}, {}, Record<"underline", {
|
|
14
|
+
toggle: () => void;
|
|
15
|
+
}>, {}>> | import("platejs").SlatePlugin<import("platejs").PluginConfig<"code", {}, {}, Record<"code", {
|
|
16
|
+
toggle: () => void;
|
|
17
|
+
}>, {}>> | import("platejs").SlatePlugin<import("platejs").PluginConfig<"strikethrough", {}, {}, Record<"strikethrough", {
|
|
18
|
+
toggle: () => void;
|
|
19
|
+
}>, {}>> | import("platejs").SlatePlugin<import("platejs").PluginConfig<"subscript", {}, {}, Record<"subscript", {
|
|
20
|
+
toggle: () => void;
|
|
21
|
+
}>, {}>> | import("platejs").SlatePlugin<import("platejs").PluginConfig<"superscript", {}, {}, Record<"superscript", {
|
|
22
|
+
toggle: () => void;
|
|
23
|
+
}>, {}>> | import("platejs").SlatePlugin<import("platejs").PluginConfig<"highlight", {}, {}, Record<"highlight", {
|
|
24
|
+
toggle: () => void;
|
|
25
|
+
}>, {}>> | import("platejs").SlatePlugin<import("platejs").PluginConfig<"kbd", {}, {}, Record<"kbd", {
|
|
26
|
+
toggle: () => void;
|
|
27
|
+
}>, {}>> | import("platejs").SlatePlugin<import("platejs").PluginConfig<"callout", {}, {}, {
|
|
28
|
+
insert: {
|
|
29
|
+
callout: (args_0?: ({
|
|
30
|
+
batchDirty?: boolean;
|
|
31
|
+
hanging?: boolean;
|
|
32
|
+
nextBlock?: boolean;
|
|
33
|
+
removeEmpty?: import("platejs").QueryNodeOptions | boolean;
|
|
34
|
+
select?: boolean;
|
|
35
|
+
} & {
|
|
36
|
+
id?: boolean | string;
|
|
37
|
+
block?: boolean;
|
|
38
|
+
empty?: boolean;
|
|
39
|
+
match?: import("platejs").Predicate<import("platejs").NodeIn<import("platejs").Value>> | undefined;
|
|
40
|
+
text?: boolean;
|
|
41
|
+
} & import("platejs").QueryAt & import("platejs").QueryMode & import("platejs").QueryVoids & {
|
|
42
|
+
icon?: string;
|
|
43
|
+
variant?: (string & {}) | import("platejs").TCalloutElement["variant"];
|
|
44
|
+
}) | undefined) => void;
|
|
45
|
+
};
|
|
46
|
+
}, {}>> | import("platejs").SlatePlugin<import("platejs").PluginConfig<"code_block", {
|
|
47
|
+
defaultLanguage?: string | null;
|
|
48
|
+
lowlight?: ReturnType<typeof import("lowlight").createLowlight> | null;
|
|
49
|
+
}, {}, Record<"code_block", {
|
|
50
|
+
toggle: () => void;
|
|
51
|
+
}>, {}>> | import("platejs").SlatePlugin<import("platejs").PluginConfig<"column_group", {}, {}, {}, {}>> | import("platejs").SlatePlugin<import("platejs").PluginConfig<"column", {}, {}, {}, {}>> | import("platejs").SlatePlugin<import("platejs").PluginConfig<"date", {}, {}, {
|
|
52
|
+
insert: {
|
|
53
|
+
date: (args_0?: ({
|
|
54
|
+
date?: string;
|
|
55
|
+
} & {
|
|
56
|
+
batchDirty?: boolean;
|
|
57
|
+
hanging?: boolean;
|
|
58
|
+
nextBlock?: boolean;
|
|
59
|
+
removeEmpty?: import("platejs").QueryNodeOptions | boolean;
|
|
60
|
+
select?: boolean;
|
|
61
|
+
} & {
|
|
62
|
+
id?: boolean | string;
|
|
63
|
+
block?: boolean;
|
|
64
|
+
empty?: boolean;
|
|
65
|
+
match?: import("platejs").Predicate<import("platejs").NodeIn<import("platejs").Value>> | undefined;
|
|
66
|
+
text?: boolean;
|
|
67
|
+
} & import("platejs").QueryAt & import("platejs").QueryMode & import("platejs").QueryVoids) | undefined) => void;
|
|
68
|
+
};
|
|
69
|
+
}, {}>> | import("platejs").SlatePlugin<import("@platejs/link").BaseLinkConfig> | import("platejs").SlatePlugin<import("@platejs/indent").IndentConfig> | import("platejs").SlatePlugin<import("@platejs/list").BaseListConfig> | import("platejs").SlatePlugin<import("platejs").PluginConfig<"inline_equation", {}, {}, {
|
|
70
|
+
insert: {
|
|
71
|
+
inlineEquation: (texExpression?: string | undefined, options?: import("platejs").InsertNodesOptions | undefined) => void;
|
|
72
|
+
};
|
|
73
|
+
}, {}>> | import("platejs").SlatePlugin<import("platejs").PluginConfig<"equation", {}, {}, {
|
|
74
|
+
insert: {
|
|
75
|
+
equation: (options?: import("platejs").InsertNodesOptions | undefined) => void;
|
|
76
|
+
};
|
|
77
|
+
}, {}>> | import("platejs").SlatePlugin<import("platejs").PluginConfig<"img", {
|
|
78
|
+
disableEmbedInsert?: boolean;
|
|
79
|
+
disableUploadInsert?: boolean;
|
|
80
|
+
uploadImage?: (dataUrl: ArrayBuffer | string) => ArrayBuffer | Promise<ArrayBuffer | string> | string;
|
|
81
|
+
} & import("@platejs/media").MediaPluginOptions, {}, {
|
|
82
|
+
insert: {
|
|
83
|
+
imageFromFiles: (files: FileList, options?: import("platejs").InsertNodesOptions | undefined) => void;
|
|
84
|
+
};
|
|
85
|
+
}, {}>> | import("platejs").SlatePlugin<import("platejs").PluginConfig<"video", {}, {}, {}, {}>> | import("platejs").SlatePlugin<import("platejs").PluginConfig<"audio", {}, {}, {}, {}>> | import("platejs").SlatePlugin<import("platejs").PluginConfig<"file", {}, {}, {}, {}>> | import("platejs").SlatePlugin<import("@platejs/media").MediaEmbedConfig> | import("platejs").SlatePlugin<import("platejs").PluginConfig<"mention", {
|
|
86
|
+
insertSpaceAfterMention?: boolean;
|
|
87
|
+
} & import("@platejs/combobox").TriggerComboboxPluginOptions, {}, {
|
|
88
|
+
insert: {
|
|
89
|
+
mention: (options: {
|
|
90
|
+
search: string;
|
|
91
|
+
value: any;
|
|
92
|
+
key?: any;
|
|
93
|
+
}) => void;
|
|
94
|
+
};
|
|
95
|
+
}, {}>> | import("platejs").SlatePlugin<import("platejs").PluginConfig<"table", {
|
|
96
|
+
_cellIndices: Record<string, {
|
|
97
|
+
col: number;
|
|
98
|
+
row: number;
|
|
99
|
+
}>;
|
|
100
|
+
_selectedCellIds: string[] | null | undefined;
|
|
101
|
+
_selectedTableIds: string[] | null | undefined;
|
|
102
|
+
_selectionVersion: number;
|
|
103
|
+
selectedCells: import("platejs").TElement[] | null;
|
|
104
|
+
selectedTables: import("platejs").TElement[] | null;
|
|
105
|
+
disableExpandOnInsert?: boolean;
|
|
106
|
+
disableMarginLeft?: boolean;
|
|
107
|
+
disableMerge?: boolean;
|
|
108
|
+
enableUnsetSingleColSize?: boolean;
|
|
109
|
+
initialTableWidth?: number;
|
|
110
|
+
minColumnWidth?: number;
|
|
111
|
+
}, {
|
|
112
|
+
create: {
|
|
113
|
+
table: import("platejs").OmitFirst<(editor: import("platejs").SlateEditor, { colCount, header, rowCount, ...cellOptions }?: import("@platejs/table").GetEmptyTableNodeOptions) => import("platejs").TTableElement>;
|
|
114
|
+
tableCell: import("platejs").OmitFirst<(editor: import("platejs").SlateEditor, { children, header, row }?: import("@platejs/table").CreateCellOptions) => {
|
|
115
|
+
children: import("platejs").Descendant[];
|
|
116
|
+
type: string;
|
|
117
|
+
}>;
|
|
118
|
+
tableRow: import("platejs").OmitFirst<(editor: import("platejs").SlateEditor, { colCount, ...cellOptions }?: import("@platejs/table").GetEmptyRowNodeOptions) => {
|
|
119
|
+
children: {
|
|
120
|
+
children: import("platejs").Descendant[];
|
|
121
|
+
type: string;
|
|
122
|
+
}[];
|
|
123
|
+
type: string;
|
|
124
|
+
}>;
|
|
125
|
+
};
|
|
126
|
+
table: {
|
|
127
|
+
getCellBorders: import("platejs").OmitFirst<(editor: import("platejs").SlateEditor, { cellIndices, defaultBorder, element }: {
|
|
128
|
+
element: import("platejs").TTableCellElement;
|
|
129
|
+
cellIndices?: import("@platejs/table").CellIndices;
|
|
130
|
+
defaultBorder?: import("platejs").TTableCellBorder;
|
|
131
|
+
}) => import("@platejs/table").BorderStylesDefault>;
|
|
132
|
+
getCellSize: import("platejs").OmitFirst<(editor: import("platejs").SlateEditor, { cellIndices, colSizes, element, rowSize }: {
|
|
133
|
+
element: import("platejs").TTableCellElement;
|
|
134
|
+
cellIndices?: import("@platejs/table").CellIndices;
|
|
135
|
+
colSizes?: number[];
|
|
136
|
+
rowSize?: number;
|
|
137
|
+
}) => {
|
|
138
|
+
minHeight: number;
|
|
139
|
+
width: number;
|
|
140
|
+
}>;
|
|
141
|
+
getSelectedCell: import("platejs").OmitFirst<(editor: import("platejs").SlateEditor, id?: string | null) => import("platejs").TElement | null>;
|
|
142
|
+
getSelectedCellIds: import("platejs").OmitFirst<(editor: import("platejs").SlateEditor) => string[] | null>;
|
|
143
|
+
getSelectedCells: import("platejs").OmitFirst<(editor: import("platejs").SlateEditor) => import("platejs").TElement[] | null>;
|
|
144
|
+
getSelectedTableIds: import("platejs").OmitFirst<(editor: import("platejs").SlateEditor) => string[] | null>;
|
|
145
|
+
getSelectedTables: import("platejs").OmitFirst<(editor: import("platejs").SlateEditor) => import("platejs").TElement[] | null>;
|
|
146
|
+
getColSpan: (cellElem: import("platejs").TTableCellElement) => number;
|
|
147
|
+
getRowSpan: (cellElem: import("platejs").TTableCellElement) => number;
|
|
148
|
+
getCellChildren: (cell: import("platejs").TTableCellElement) => import("platejs").Descendant[];
|
|
149
|
+
isCellSelected: import("platejs").OmitFirst<(editor: import("platejs").SlateEditor, id?: string | null) => boolean>;
|
|
150
|
+
isSelectingCell: import("platejs").OmitFirst<(editor: import("platejs").SlateEditor) => boolean>;
|
|
151
|
+
};
|
|
152
|
+
}, {
|
|
153
|
+
insert: {
|
|
154
|
+
table: import("platejs").OmitFirst<(editor: import("platejs").SlateEditor, { colCount, header, rowCount }?: import("@platejs/table").GetEmptyTableNodeOptions, { select: shouldSelect, ...options }?: import("platejs").InsertNodesOptions) => void>;
|
|
155
|
+
tableColumn: import("platejs").OmitFirst<(editor: import("platejs").SlateEditor, options?: {
|
|
156
|
+
at?: import("platejs").Path;
|
|
157
|
+
before?: boolean;
|
|
158
|
+
fromCell?: import("platejs").Path;
|
|
159
|
+
header?: boolean;
|
|
160
|
+
select?: boolean;
|
|
161
|
+
}) => void>;
|
|
162
|
+
tableRow: import("platejs").OmitFirst<(editor: import("platejs").SlateEditor, options?: {
|
|
163
|
+
at?: import("platejs").Path;
|
|
164
|
+
before?: boolean;
|
|
165
|
+
fromRow?: import("platejs").Path;
|
|
166
|
+
header?: boolean;
|
|
167
|
+
select?: boolean;
|
|
168
|
+
}) => void>;
|
|
169
|
+
};
|
|
170
|
+
remove: {
|
|
171
|
+
table: import("platejs").OmitFirst<(editor: import("platejs").SlateEditor) => void>;
|
|
172
|
+
tableColumn: import("platejs").OmitFirst<(editor: import("platejs").SlateEditor) => void>;
|
|
173
|
+
tableRow: import("platejs").OmitFirst<(editor: import("platejs").SlateEditor) => void>;
|
|
174
|
+
};
|
|
175
|
+
table: {
|
|
176
|
+
merge: import("platejs").OmitFirst<(editor: import("platejs").SlateEditor) => void>;
|
|
177
|
+
split: import("platejs").OmitFirst<(editor: import("platejs").SlateEditor) => void>;
|
|
178
|
+
};
|
|
179
|
+
}, {
|
|
180
|
+
cellIndices?: (id: string) => import("@platejs/table").CellIndices;
|
|
181
|
+
isCellSelected?: (id?: string | null) => boolean;
|
|
182
|
+
isSelectingCell?: () => boolean;
|
|
183
|
+
selectedCell?: (id?: string | null) => import("platejs").TElement | null;
|
|
184
|
+
selectedCellIds?: () => string[] | null;
|
|
185
|
+
selectedCells?: () => import("platejs").TElement[] | null;
|
|
186
|
+
selectedTableIds?: () => string[] | null;
|
|
187
|
+
selectedTables?: () => import("platejs").TElement[] | null;
|
|
188
|
+
}>> | import("platejs").SlatePlugin<import("platejs").PluginConfig<"tr", {}, {}, {}, {}>> | import("platejs").SlatePlugin<import("platejs").PluginConfig<"td", {}, {}, {}, {}>> | import("platejs").SlatePlugin<import("@platejs/toc").TocConfig> | import("platejs").SlatePlugin<import("platejs").PluginConfig<"toggle", {
|
|
189
|
+
openIds?: Set<string>;
|
|
190
|
+
}, {
|
|
191
|
+
toggle: {
|
|
192
|
+
toggleIds: (ids: string[], force?: boolean | null) => void;
|
|
193
|
+
};
|
|
194
|
+
} & Record<"toggle", {
|
|
195
|
+
toggleIds: (ids: string[], force?: boolean | null) => void;
|
|
196
|
+
}>, {}, {
|
|
197
|
+
isOpen?: (toggleId: string) => boolean;
|
|
198
|
+
someClosed?: (toggleIds: string[]) => boolean;
|
|
199
|
+
}>>)[];
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// src/lib/utils.ts
|
|
4
|
+
import { clsx } from "clsx";
|
|
5
|
+
import { twMerge } from "tailwind-merge";
|
|
6
|
+
var cn = (...inputs) => {
|
|
7
|
+
return twMerge(clsx(inputs));
|
|
8
|
+
};
|
|
9
|
+
var MAX_SLUG_LENGTH = 80;
|
|
10
|
+
var generateSlugFromText = (text) => {
|
|
11
|
+
let slug = text.toLowerCase().trim().replace(/[^\w\s-]/g, "").replace(/\s+/g, "-").replace(/-+/g, "-").replace(/^-+|-+$/g, "");
|
|
12
|
+
if (slug.length > MAX_SLUG_LENGTH) {
|
|
13
|
+
slug = slug.substring(0, MAX_SLUG_LENGTH);
|
|
14
|
+
const lastHyphen = slug.lastIndexOf("-");
|
|
15
|
+
if (lastHyphen > MAX_SLUG_LENGTH / 2) {
|
|
16
|
+
slug = slug.substring(0, lastHyphen);
|
|
17
|
+
}
|
|
18
|
+
slug = slug.replace(/-+$/, "");
|
|
19
|
+
}
|
|
20
|
+
return encodeURIComponent(slug);
|
|
21
|
+
};
|
|
22
|
+
export {
|
|
23
|
+
cn,
|
|
24
|
+
generateSlugFromText
|
|
25
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type EmbedUrlData } from '@platejs/media';
|
|
2
|
+
export interface EmbeddedVideo {
|
|
3
|
+
provider: string;
|
|
4
|
+
src: string;
|
|
5
|
+
title: string;
|
|
6
|
+
}
|
|
7
|
+
export declare const parseLoomUrl: (url: string) => EmbedUrlData | undefined;
|
|
8
|
+
export declare const parseVideoEmbedUrl: (url: string) => EmbedUrlData | undefined;
|
|
9
|
+
export declare const embeddedVideoOf: (embed: EmbedUrlData | undefined) => EmbeddedVideo | undefined;
|