@infonomic/payload-alternative-lexical-editor 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/dist/adapter.d.ts +11 -0
- package/dist/adapter.d.ts.map +1 -0
- package/dist/adapter.js +124 -0
- package/dist/adapter.js.map +1 -0
- package/dist/cell/rsc-entry.d.ts +20 -0
- package/dist/cell/rsc-entry.d.ts.map +1 -0
- package/dist/cell/rsc-entry.js +68 -0
- package/dist/cell/rsc-entry.js.map +1 -0
- package/dist/field/apply-value-plugin.d.ts +9 -0
- package/dist/field/apply-value-plugin.d.ts.map +1 -0
- package/dist/field/apply-value-plugin.js +66 -0
- package/dist/field/apply-value-plugin.js.map +1 -0
- package/dist/field/build-initial-state.d.ts +29 -0
- package/dist/field/build-initial-state.d.ts.map +1 -0
- package/dist/field/build-initial-state.js +14 -0
- package/dist/field/build-initial-state.js.map +1 -0
- package/dist/field/config/default.d.ts +6 -0
- package/dist/field/config/default.d.ts.map +1 -0
- package/dist/field/config/default.js +52 -0
- package/dist/field/config/default.js.map +1 -0
- package/dist/field/config/editor-config-context.d.ts +14 -0
- package/dist/field/config/editor-config-context.d.ts.map +1 -0
- package/dist/field/config/editor-config-context.js +38 -0
- package/dist/field/config/editor-config-context.js.map +1 -0
- package/dist/field/config/types.d.ts +22 -0
- package/dist/field/config/types.d.ts.map +1 -0
- package/dist/field/config/types.js +2 -0
- package/dist/field/config/types.js.map +1 -0
- package/dist/field/constants.d.ts +2 -0
- package/dist/field/constants.d.ts.map +1 -0
- package/dist/field/constants.js +2 -0
- package/dist/field/constants.js.map +1 -0
- package/dist/field/context/shared-autocomplete-context.d.ts +18 -0
- package/dist/field/context/shared-autocomplete-context.d.ts.map +1 -0
- package/dist/field/context/shared-autocomplete-context.js +40 -0
- package/dist/field/context/shared-autocomplete-context.js.map +1 -0
- package/dist/field/context/shared-history-context.d.ts +19 -0
- package/dist/field/context/shared-history-context.d.ts.map +1 -0
- package/dist/field/context/shared-history-context.js +13 -0
- package/dist/field/context/shared-history-context.js.map +1 -0
- package/dist/field/context/shared-on-change-context.d.ts +13 -0
- package/dist/field/context/shared-on-change-context.d.ts.map +1 -0
- package/dist/field/context/shared-on-change-context.js +18 -0
- package/dist/field/context/shared-on-change-context.js.map +1 -0
- package/dist/field/debug.d.ts +3 -0
- package/dist/field/debug.d.ts.map +1 -0
- package/dist/field/debug.js +17 -0
- package/dist/field/debug.js.map +1 -0
- package/dist/field/editor-context.d.ts +15 -0
- package/dist/field/editor-context.d.ts.map +1 -0
- package/dist/field/editor-context.js +37 -0
- package/dist/field/editor-context.js.map +1 -0
- package/dist/field/editor.css +1477 -0
- package/dist/field/editor.d.ts +4 -0
- package/dist/field/editor.d.ts.map +1 -0
- package/dist/field/editor.js +86 -0
- package/dist/field/editor.js.map +1 -0
- package/dist/field/field-component.css +44 -0
- package/dist/field/field-component.d.ts +16 -0
- package/dist/field/field-component.d.ts.map +1 -0
- package/dist/field/field-component.js +136 -0
- package/dist/field/field-component.js.map +1 -0
- package/dist/field/hooks/useMediaQuery.d.ts +3 -0
- package/dist/field/hooks/useMediaQuery.d.ts.map +1 -0
- package/dist/field/hooks/useMediaQuery.js +20 -0
- package/dist/field/hooks/useMediaQuery.js.map +1 -0
- package/dist/field/hooks/useModal.d.ts +13 -0
- package/dist/field/hooks/useModal.d.ts.map +1 -0
- package/dist/field/hooks/useModal.js +28 -0
- package/dist/field/hooks/useModal.js.map +1 -0
- package/dist/field/hooks/useReport.d.ts +9 -0
- package/dist/field/hooks/useReport.d.ts.map +1 -0
- package/dist/field/hooks/useReport.js +51 -0
- package/dist/field/hooks/useReport.js.map +1 -0
- package/dist/field/images/cat-typing.gif +0 -0
- package/dist/field/images/emoji/1F600.png +0 -0
- package/dist/field/images/emoji/1F641.png +0 -0
- package/dist/field/images/emoji/1F642.png +0 -0
- package/dist/field/images/emoji/2764.png +0 -0
- package/dist/field/images/icons/3-columns.svg +3 -0
- package/dist/field/images/icons/admonition.svg +1 -0
- package/dist/field/images/icons/arrow-clockwise.svg +1 -0
- package/dist/field/images/icons/arrow-counterclockwise.svg +1 -0
- package/dist/field/images/icons/bg-color.svg +1 -0
- package/dist/field/images/icons/camera.svg +1 -0
- package/dist/field/images/icons/card-checklist.svg +1 -0
- package/dist/field/images/icons/caret-right-fill.svg +1 -0
- package/dist/field/images/icons/chat-left-text.svg +1 -0
- package/dist/field/images/icons/chat-right-dots.svg +1 -0
- package/dist/field/images/icons/chat-right-text.svg +1 -0
- package/dist/field/images/icons/chat-right.svg +1 -0
- package/dist/field/images/icons/chat-square-quote.svg +1 -0
- package/dist/field/images/icons/chevron-down.svg +1 -0
- package/dist/field/images/icons/clipboard.svg +1 -0
- package/dist/field/images/icons/close.svg +1 -0
- package/dist/field/images/icons/code.svg +1 -0
- package/dist/field/images/icons/comments.svg +1 -0
- package/dist/field/images/icons/copy.svg +1 -0
- package/dist/field/images/icons/diagram-2.svg +1 -0
- package/dist/field/images/icons/download.svg +1 -0
- package/dist/field/images/icons/draggable-block-menu.svg +1 -0
- package/dist/field/images/icons/dropdown-more.svg +1 -0
- package/dist/field/images/icons/figma.svg +1 -0
- package/dist/field/images/icons/file-earmark-text.svg +4 -0
- package/dist/field/images/icons/file-image.svg +1 -0
- package/dist/field/images/icons/filetype-gif.svg +1 -0
- package/dist/field/images/icons/font-color.svg +1 -0
- package/dist/field/images/icons/font-family.svg +1 -0
- package/dist/field/images/icons/gear.svg +1 -0
- package/dist/field/images/icons/horizontal-rule.svg +1 -0
- package/dist/field/images/icons/indent.svg +1 -0
- package/dist/field/images/icons/journal-code.svg +1 -0
- package/dist/field/images/icons/journal-text.svg +1 -0
- package/dist/field/images/icons/justify.svg +1 -0
- package/dist/field/images/icons/link.svg +1 -0
- package/dist/field/images/icons/list-ol.svg +1 -0
- package/dist/field/images/icons/list-ul.svg +1 -0
- package/dist/field/images/icons/lock-fill.svg +1 -0
- package/dist/field/images/icons/lock.svg +1 -0
- package/dist/field/images/icons/markdown.svg +1 -0
- package/dist/field/images/icons/mic.svg +1 -0
- package/dist/field/images/icons/outdent.svg +1 -0
- package/dist/field/images/icons/paint-bucket.svg +1 -0
- package/dist/field/images/icons/palette.svg +1 -0
- package/dist/field/images/icons/pencil-fill.svg +1 -0
- package/dist/field/images/icons/plug-fill.svg +1 -0
- package/dist/field/images/icons/plug.svg +1 -0
- package/dist/field/images/icons/plus-slash-minus.svg +1 -0
- package/dist/field/images/icons/plus.svg +1 -0
- package/dist/field/images/icons/prettier-error.svg +1 -0
- package/dist/field/images/icons/prettier.svg +1 -0
- package/dist/field/images/icons/send.svg +1 -0
- package/dist/field/images/icons/square-check.svg +1 -0
- package/dist/field/images/icons/sticky.svg +1 -0
- package/dist/field/images/icons/success-alt.svg +1 -0
- package/dist/field/images/icons/success.svg +1 -0
- package/dist/field/images/icons/table.svg +1 -0
- package/dist/field/images/icons/text-center.svg +1 -0
- package/dist/field/images/icons/text-left.svg +1 -0
- package/dist/field/images/icons/text-paragraph.svg +1 -0
- package/dist/field/images/icons/text-right.svg +1 -0
- package/dist/field/images/icons/trash.svg +1 -0
- package/dist/field/images/icons/trash3.svg +1 -0
- package/dist/field/images/icons/tweet.svg +1 -0
- package/dist/field/images/icons/type-bold.svg +1 -0
- package/dist/field/images/icons/type-h1.svg +1 -0
- package/dist/field/images/icons/type-h2.svg +1 -0
- package/dist/field/images/icons/type-h3.svg +1 -0
- package/dist/field/images/icons/type-h4.svg +1 -0
- package/dist/field/images/icons/type-h5.svg +1 -0
- package/dist/field/images/icons/type-h6.svg +1 -0
- package/dist/field/images/icons/type-italic.svg +1 -0
- package/dist/field/images/icons/type-strikethrough.svg +1 -0
- package/dist/field/images/icons/type-subscript.svg +1 -0
- package/dist/field/images/icons/type-superscript.svg +1 -0
- package/dist/field/images/icons/type-underline.svg +1 -0
- package/dist/field/images/icons/upload.svg +1 -0
- package/dist/field/images/icons/user.svg +1 -0
- package/dist/field/images/icons/vimeo.svg +1 -0
- package/dist/field/images/icons/youtube.svg +1 -0
- package/dist/field/images/landscape.jpg +0 -0
- package/dist/field/images/logo.svg +1 -0
- package/dist/field/images/yellow-flower-small.jpg +0 -0
- package/dist/field/images/yellow-flower.jpg +0 -0
- package/dist/field/index.d.ts +12 -0
- package/dist/field/index.d.ts.map +1 -0
- package/dist/field/index.js +9 -0
- package/dist/field/index.js.map +1 -0
- package/dist/field/lexical-after-read-populate-links.d.ts +47 -0
- package/dist/field/lexical-after-read-populate-links.d.ts.map +1 -0
- package/dist/field/lexical-after-read-populate-links.js +118 -0
- package/dist/field/lexical-after-read-populate-links.js.map +1 -0
- package/dist/field/lexical-after-read-populate-media.d.ts +34 -0
- package/dist/field/lexical-after-read-populate-media.d.ts.map +1 -0
- package/dist/field/lexical-after-read-populate-media.js +40 -0
- package/dist/field/lexical-after-read-populate-media.js.map +1 -0
- package/dist/field/lexical-before-change-populate-links.d.ts +52 -0
- package/dist/field/lexical-before-change-populate-links.d.ts.map +1 -0
- package/dist/field/lexical-before-change-populate-links.js +116 -0
- package/dist/field/lexical-before-change-populate-links.js.map +1 -0
- package/dist/field/nodes/admonition-node/admonition-node-component.css +115 -0
- package/dist/field/nodes/admonition-node/admonition-node-component.d.ts +11 -0
- package/dist/field/nodes/admonition-node/admonition-node-component.d.ts.map +1 -0
- package/dist/field/nodes/admonition-node/admonition-node-component.js +157 -0
- package/dist/field/nodes/admonition-node/admonition-node-component.js.map +1 -0
- package/dist/field/nodes/admonition-node/admonition-node.d.ts +28 -0
- package/dist/field/nodes/admonition-node/admonition-node.d.ts.map +1 -0
- package/dist/field/nodes/admonition-node/admonition-node.js +134 -0
- package/dist/field/nodes/admonition-node/admonition-node.js.map +1 -0
- package/dist/field/nodes/admonition-node/icons/danger-icon.css +11 -0
- package/dist/field/nodes/admonition-node/icons/danger-icon.d.ts +8 -0
- package/dist/field/nodes/admonition-node/icons/danger-icon.d.ts.map +1 -0
- package/dist/field/nodes/admonition-node/icons/danger-icon.js +7 -0
- package/dist/field/nodes/admonition-node/icons/danger-icon.js.map +1 -0
- package/dist/field/nodes/admonition-node/icons/index.d.ts +5 -0
- package/dist/field/nodes/admonition-node/icons/index.d.ts.map +1 -0
- package/dist/field/nodes/admonition-node/icons/index.js +5 -0
- package/dist/field/nodes/admonition-node/icons/index.js.map +1 -0
- package/dist/field/nodes/admonition-node/icons/note-icon.css +11 -0
- package/dist/field/nodes/admonition-node/icons/note-icon.d.ts +8 -0
- package/dist/field/nodes/admonition-node/icons/note-icon.d.ts.map +1 -0
- package/dist/field/nodes/admonition-node/icons/note-icon.js +7 -0
- package/dist/field/nodes/admonition-node/icons/note-icon.js.map +1 -0
- package/dist/field/nodes/admonition-node/icons/tip-icon.css +11 -0
- package/dist/field/nodes/admonition-node/icons/tip-icon.d.ts +8 -0
- package/dist/field/nodes/admonition-node/icons/tip-icon.d.ts.map +1 -0
- package/dist/field/nodes/admonition-node/icons/tip-icon.js +7 -0
- package/dist/field/nodes/admonition-node/icons/tip-icon.js.map +1 -0
- package/dist/field/nodes/admonition-node/icons/warning-icon.css +11 -0
- package/dist/field/nodes/admonition-node/icons/warning-icon.d.ts +8 -0
- package/dist/field/nodes/admonition-node/icons/warning-icon.d.ts.map +1 -0
- package/dist/field/nodes/admonition-node/icons/warning-icon.js +7 -0
- package/dist/field/nodes/admonition-node/icons/warning-icon.js.map +1 -0
- package/dist/field/nodes/admonition-node/index.d.ts +4 -0
- package/dist/field/nodes/admonition-node/index.d.ts.map +1 -0
- package/dist/field/nodes/admonition-node/index.js +4 -0
- package/dist/field/nodes/admonition-node/index.js.map +1 -0
- package/dist/field/nodes/admonition-node/types.d.ts +14 -0
- package/dist/field/nodes/admonition-node/types.d.ts.map +1 -0
- package/dist/field/nodes/admonition-node/types.js +2 -0
- package/dist/field/nodes/admonition-node/types.js.map +1 -0
- package/dist/field/nodes/index.d.ts +10 -0
- package/dist/field/nodes/index.d.ts.map +1 -0
- package/dist/field/nodes/index.js +44 -0
- package/dist/field/nodes/index.js.map +1 -0
- package/dist/field/nodes/inline-image-node/index.d.ts +4 -0
- package/dist/field/nodes/inline-image-node/index.d.ts.map +1 -0
- package/dist/field/nodes/inline-image-node/index.js +4 -0
- package/dist/field/nodes/inline-image-node/index.js.map +1 -0
- package/dist/field/nodes/inline-image-node/inline-image-node-component.css +205 -0
- package/dist/field/nodes/inline-image-node/inline-image-node-component.d.ts +18 -0
- package/dist/field/nodes/inline-image-node/inline-image-node-component.d.ts.map +1 -0
- package/dist/field/nodes/inline-image-node/inline-image-node-component.js +239 -0
- package/dist/field/nodes/inline-image-node/inline-image-node-component.js.map +1 -0
- package/dist/field/nodes/inline-image-node/inline-image-node.d.ts +39 -0
- package/dist/field/nodes/inline-image-node/inline-image-node.d.ts.map +1 -0
- package/dist/field/nodes/inline-image-node/inline-image-node.js +204 -0
- package/dist/field/nodes/inline-image-node/inline-image-node.js.map +1 -0
- package/dist/field/nodes/inline-image-node/types.d.ts +33 -0
- package/dist/field/nodes/inline-image-node/types.d.ts.map +1 -0
- package/dist/field/nodes/inline-image-node/types.js +2 -0
- package/dist/field/nodes/inline-image-node/types.js.map +1 -0
- package/dist/field/nodes/layout-container-node/layout-container-node.d.ts +29 -0
- package/dist/field/nodes/layout-container-node/layout-container-node.d.ts.map +1 -0
- package/dist/field/nodes/layout-container-node/layout-container-node.js +66 -0
- package/dist/field/nodes/layout-container-node/layout-container-node.js.map +1 -0
- package/dist/field/nodes/layout-container-node/layout-item-node.d.ts +23 -0
- package/dist/field/nodes/layout-container-node/layout-item-node.d.ts.map +1 -0
- package/dist/field/nodes/layout-container-node/layout-item-node.js +50 -0
- package/dist/field/nodes/layout-container-node/layout-item-node.js.map +1 -0
- package/dist/field/nodes/link-nodes/auto-link-node.d.ts +17 -0
- package/dist/field/nodes/link-nodes/auto-link-node.d.ts.map +1 -0
- package/dist/field/nodes/link-nodes/auto-link-node.js +46 -0
- package/dist/field/nodes/link-nodes/auto-link-node.js.map +1 -0
- package/dist/field/nodes/link-nodes/index.d.ts +4 -0
- package/dist/field/nodes/link-nodes/index.d.ts.map +1 -0
- package/dist/field/nodes/link-nodes/index.js +4 -0
- package/dist/field/nodes/link-nodes/index.js.map +1 -0
- package/dist/field/nodes/link-nodes/link-node.d.ts +42 -0
- package/dist/field/nodes/link-nodes/link-node.d.ts.map +1 -0
- package/dist/field/nodes/link-nodes/link-node.js +340 -0
- package/dist/field/nodes/link-nodes/link-node.js.map +1 -0
- package/dist/field/nodes/link-nodes/types.d.ts +16 -0
- package/dist/field/nodes/link-nodes/types.d.ts.map +1 -0
- package/dist/field/nodes/link-nodes/types.js +2 -0
- package/dist/field/nodes/link-nodes/types.js.map +1 -0
- package/dist/field/nodes/vimeo-node/index.d.ts +30 -0
- package/dist/field/nodes/vimeo-node/index.d.ts.map +1 -0
- package/dist/field/nodes/vimeo-node/index.js +92 -0
- package/dist/field/nodes/vimeo-node/index.js.map +1 -0
- package/dist/field/nodes/youtube-node/index.d.ts +30 -0
- package/dist/field/nodes/youtube-node/index.d.ts.map +1 -0
- package/dist/field/nodes/youtube-node/index.js +92 -0
- package/dist/field/nodes/youtube-node/index.js.map +1 -0
- package/dist/field/plugins/admonition-plugin/admonition-drawer.css +8 -0
- package/dist/field/plugins/admonition-plugin/admonition-drawer.d.ts +5 -0
- package/dist/field/plugins/admonition-plugin/admonition-drawer.d.ts.map +1 -0
- package/dist/field/plugins/admonition-plugin/admonition-drawer.js +44 -0
- package/dist/field/plugins/admonition-plugin/admonition-drawer.js.map +1 -0
- package/dist/field/plugins/admonition-plugin/fields.d.ts +14 -0
- package/dist/field/plugins/admonition-plugin/fields.d.ts.map +1 -0
- package/dist/field/plugins/admonition-plugin/fields.js +72 -0
- package/dist/field/plugins/admonition-plugin/fields.js.map +1 -0
- package/dist/field/plugins/admonition-plugin/index.d.ts +8 -0
- package/dist/field/plugins/admonition-plugin/index.d.ts.map +1 -0
- package/dist/field/plugins/admonition-plugin/index.js +65 -0
- package/dist/field/plugins/admonition-plugin/index.js.map +1 -0
- package/dist/field/plugins/admonition-plugin/types.d.ts +15 -0
- package/dist/field/plugins/admonition-plugin/types.d.ts.map +1 -0
- package/dist/field/plugins/admonition-plugin/types.js +2 -0
- package/dist/field/plugins/admonition-plugin/types.js.map +1 -0
- package/dist/field/plugins/auto-embed-plugin/index.d.ts +26 -0
- package/dist/field/plugins/auto-embed-plugin/index.d.ts.map +1 -0
- package/dist/field/plugins/auto-embed-plugin/index.js +191 -0
- package/dist/field/plugins/auto-embed-plugin/index.js.map +1 -0
- package/dist/field/plugins/code-highlight-plugin/index.d.ts +10 -0
- package/dist/field/plugins/code-highlight-plugin/index.d.ts.map +1 -0
- package/dist/field/plugins/code-highlight-plugin/index.js +11 -0
- package/dist/field/plugins/code-highlight-plugin/index.js.map +1 -0
- package/dist/field/plugins/drag-drop-paste-plugin/index.d.ts +9 -0
- package/dist/field/plugins/drag-drop-paste-plugin/index.d.ts.map +1 -0
- package/dist/field/plugins/drag-drop-paste-plugin/index.js +37 -0
- package/dist/field/plugins/drag-drop-paste-plugin/index.js.map +1 -0
- package/dist/field/plugins/floating-text-format-toolbar-plugin/index.css +150 -0
- package/dist/field/plugins/floating-text-format-toolbar-plugin/index.d.ts +13 -0
- package/dist/field/plugins/floating-text-format-toolbar-plugin/index.d.ts.map +1 -0
- package/dist/field/plugins/floating-text-format-toolbar-plugin/index.js +236 -0
- package/dist/field/plugins/floating-text-format-toolbar-plugin/index.js.map +1 -0
- package/dist/field/plugins/inline-image-plugin/fields.d.ts +12 -0
- package/dist/field/plugins/inline-image-plugin/fields.d.ts.map +1 -0
- package/dist/field/plugins/inline-image-plugin/fields.js +160 -0
- package/dist/field/plugins/inline-image-plugin/fields.js.map +1 -0
- package/dist/field/plugins/inline-image-plugin/index.d.ts +26 -0
- package/dist/field/plugins/inline-image-plugin/index.d.ts.map +1 -0
- package/dist/field/plugins/inline-image-plugin/index.js +222 -0
- package/dist/field/plugins/inline-image-plugin/index.js.map +1 -0
- package/dist/field/plugins/inline-image-plugin/inline-image-drawer.css +29 -0
- package/dist/field/plugins/inline-image-plugin/inline-image-drawer.d.ts +5 -0
- package/dist/field/plugins/inline-image-plugin/inline-image-drawer.d.ts.map +1 -0
- package/dist/field/plugins/inline-image-plugin/inline-image-drawer.js +51 -0
- package/dist/field/plugins/inline-image-plugin/inline-image-drawer.js.map +1 -0
- package/dist/field/plugins/inline-image-plugin/types.d.ts +16 -0
- package/dist/field/plugins/inline-image-plugin/types.d.ts.map +1 -0
- package/dist/field/plugins/inline-image-plugin/types.js +2 -0
- package/dist/field/plugins/inline-image-plugin/types.js.map +1 -0
- package/dist/field/plugins/inline-image-plugin/utils.d.ts +9 -0
- package/dist/field/plugins/inline-image-plugin/utils.d.ts.map +1 -0
- package/dist/field/plugins/inline-image-plugin/utils.js +27 -0
- package/dist/field/plugins/inline-image-plugin/utils.js.map +1 -0
- package/dist/field/plugins/layout-plugin/insert-layout-dialog.d.ts +14 -0
- package/dist/field/plugins/layout-plugin/insert-layout-dialog.d.ts.map +1 -0
- package/dist/field/plugins/layout-plugin/insert-layout-dialog.js +26 -0
- package/dist/field/plugins/layout-plugin/insert-layout-dialog.js.map +1 -0
- package/dist/field/plugins/layout-plugin/layout-plugin.d.ts +8 -0
- package/dist/field/plugins/layout-plugin/layout-plugin.d.ts.map +1 -0
- package/dist/field/plugins/layout-plugin/layout-plugin.js +87 -0
- package/dist/field/plugins/layout-plugin/layout-plugin.js.map +1 -0
- package/dist/field/plugins/link-plugin/auto-link/auto-link-plugin.d.ts +22 -0
- package/dist/field/plugins/link-plugin/auto-link/auto-link-plugin.d.ts.map +1 -0
- package/dist/field/plugins/link-plugin/auto-link/auto-link-plugin.js +218 -0
- package/dist/field/plugins/link-plugin/auto-link/auto-link-plugin.js.map +1 -0
- package/dist/field/plugins/link-plugin/auto-link/index.d.ts +10 -0
- package/dist/field/plugins/link-plugin/auto-link/index.d.ts.map +1 -0
- package/dist/field/plugins/link-plugin/auto-link/index.js +17 -0
- package/dist/field/plugins/link-plugin/auto-link/index.js.map +1 -0
- package/dist/field/plugins/link-plugin/link/fields.d.ts +11 -0
- package/dist/field/plugins/link-plugin/link/fields.d.ts.map +1 -0
- package/dist/field/plugins/link-plugin/link/fields.js +120 -0
- package/dist/field/plugins/link-plugin/link/fields.js.map +1 -0
- package/dist/field/plugins/link-plugin/link/floating-link-editor.css +128 -0
- package/dist/field/plugins/link-plugin/link/floating-link-editor.d.ts +13 -0
- package/dist/field/plugins/link-plugin/link/floating-link-editor.d.ts.map +1 -0
- package/dist/field/plugins/link-plugin/link/floating-link-editor.js +239 -0
- package/dist/field/plugins/link-plugin/link/floating-link-editor.js.map +1 -0
- package/dist/field/plugins/link-plugin/link/index.d.ts +2 -0
- package/dist/field/plugins/link-plugin/link/index.d.ts.map +1 -0
- package/dist/field/plugins/link-plugin/link/index.js +65 -0
- package/dist/field/plugins/link-plugin/link/index.js.map +1 -0
- package/dist/field/plugins/link-plugin/link/link-drawer.css +21 -0
- package/dist/field/plugins/link-plugin/link/link-drawer.d.ts +5 -0
- package/dist/field/plugins/link-plugin/link/link-drawer.d.ts.map +1 -0
- package/dist/field/plugins/link-plugin/link/link-drawer.js +72 -0
- package/dist/field/plugins/link-plugin/link/link-drawer.js.map +1 -0
- package/dist/field/plugins/link-plugin/link/types.d.ts +20 -0
- package/dist/field/plugins/link-plugin/link/types.d.ts.map +1 -0
- package/dist/field/plugins/link-plugin/link/types.js +2 -0
- package/dist/field/plugins/link-plugin/link/types.js.map +1 -0
- package/dist/field/plugins/table-action-menu-plugin/index.d.ts +6 -0
- package/dist/field/plugins/table-action-menu-plugin/index.d.ts.map +1 -0
- package/dist/field/plugins/table-action-menu-plugin/index.js +476 -0
- package/dist/field/plugins/table-action-menu-plugin/index.js.map +1 -0
- package/dist/field/plugins/table-plugin/index.d.ts +4 -0
- package/dist/field/plugins/table-plugin/index.d.ts.map +1 -0
- package/dist/field/plugins/table-plugin/index.js +30 -0
- package/dist/field/plugins/table-plugin/index.js.map +1 -0
- package/dist/field/plugins/table-plugin/table-drawer.d.ts +12 -0
- package/dist/field/plugins/table-plugin/table-drawer.d.ts.map +1 -0
- package/dist/field/plugins/table-plugin/table-drawer.js +42 -0
- package/dist/field/plugins/table-plugin/table-drawer.js.map +1 -0
- package/dist/field/plugins/toolbar-plugin/index.d.ts +10 -0
- package/dist/field/plugins/toolbar-plugin/index.d.ts.map +1 -0
- package/dist/field/plugins/toolbar-plugin/index.js +394 -0
- package/dist/field/plugins/toolbar-plugin/index.js.map +1 -0
- package/dist/field/plugins/treeview-plugin/index.d.ts +10 -0
- package/dist/field/plugins/treeview-plugin/index.d.ts.map +1 -0
- package/dist/field/plugins/treeview-plugin/index.js +9 -0
- package/dist/field/plugins/treeview-plugin/index.js.map +1 -0
- package/dist/field/plugins/vimeo-plugin/index.d.ts +4 -0
- package/dist/field/plugins/vimeo-plugin/index.d.ts.map +1 -0
- package/dist/field/plugins/vimeo-plugin/index.js +29 -0
- package/dist/field/plugins/vimeo-plugin/index.js.map +1 -0
- package/dist/field/plugins/youtube-plugin/index.d.ts +4 -0
- package/dist/field/plugins/youtube-plugin/index.d.ts.map +1 -0
- package/dist/field/plugins/youtube-plugin/index.js +29 -0
- package/dist/field/plugins/youtube-plugin/index.js.map +1 -0
- package/dist/field/rsc-entry.d.ts +9 -0
- package/dist/field/rsc-entry.d.ts.map +1 -0
- package/dist/field/rsc-entry.js +57 -0
- package/dist/field/rsc-entry.js.map +1 -0
- package/dist/field/shared/canUseDOM.d.ts +9 -0
- package/dist/field/shared/canUseDOM.d.ts.map +1 -0
- package/dist/field/shared/canUseDOM.js +9 -0
- package/dist/field/shared/canUseDOM.js.map +1 -0
- package/dist/field/shared/environment.d.ts +23 -0
- package/dist/field/shared/environment.d.ts.map +1 -0
- package/dist/field/shared/environment.js +22 -0
- package/dist/field/shared/environment.js.map +1 -0
- package/dist/field/shared/invariant.d.ts +9 -0
- package/dist/field/shared/invariant.d.ts.map +1 -0
- package/dist/field/shared/invariant.js +18 -0
- package/dist/field/shared/invariant.js.map +1 -0
- package/dist/field/shared/simpleDiffWithCursor.d.ts +13 -0
- package/dist/field/shared/simpleDiffWithCursor.d.ts.map +1 -0
- package/dist/field/shared/simpleDiffWithCursor.js +34 -0
- package/dist/field/shared/simpleDiffWithCursor.js.map +1 -0
- package/dist/field/shared/useLayoutEffect.d.ts +11 -0
- package/dist/field/shared/useLayoutEffect.d.ts.map +1 -0
- package/dist/field/shared/useLayoutEffect.js +12 -0
- package/dist/field/shared/useLayoutEffect.js.map +1 -0
- package/dist/field/shared/warnOnlyOnce.d.ts +9 -0
- package/dist/field/shared/warnOnlyOnce.d.ts.map +1 -0
- package/dist/field/shared/warnOnlyOnce.js +21 -0
- package/dist/field/shared/warnOnlyOnce.js.map +1 -0
- package/dist/field/themes/lexical-editor-theme.css +558 -0
- package/dist/field/themes/lexical-editor-theme.d.ts +10 -0
- package/dist/field/themes/lexical-editor-theme.d.ts.map +1 -0
- package/dist/field/themes/lexical-editor-theme.js +105 -0
- package/dist/field/themes/lexical-editor-theme.js.map +1 -0
- package/dist/field/types.d.ts +10 -0
- package/dist/field/types.d.ts.map +1 -0
- package/dist/field/types.js +2 -0
- package/dist/field/types.js.map +1 -0
- package/dist/field/ui/button.css +45 -0
- package/dist/field/ui/button.d.ts +19 -0
- package/dist/field/ui/button.d.ts.map +1 -0
- package/dist/field/ui/button.js +8 -0
- package/dist/field/ui/button.js.map +1 -0
- package/dist/field/ui/checkbox.css +52 -0
- package/dist/field/ui/color-picker.css +88 -0
- package/dist/field/ui/color-picker.d.ts +21 -0
- package/dist/field/ui/color-picker.d.ts.map +1 -0
- package/dist/field/ui/color-picker.js +250 -0
- package/dist/field/ui/color-picker.js.map +1 -0
- package/dist/field/ui/content-editable-inline.d.ts +13 -0
- package/dist/field/ui/content-editable-inline.d.ts.map +1 -0
- package/dist/field/ui/content-editable-inline.js +14 -0
- package/dist/field/ui/content-editable-inline.js.map +1 -0
- package/dist/field/ui/content-editable.css +28 -0
- package/dist/field/ui/content-editable.d.ts +13 -0
- package/dist/field/ui/content-editable.d.ts.map +1 -0
- package/dist/field/ui/content-editable.js +15 -0
- package/dist/field/ui/content-editable.js.map +1 -0
- package/dist/field/ui/dialog.css +17 -0
- package/dist/field/ui/dialog.d.ts +17 -0
- package/dist/field/ui/dialog.d.ts.map +1 -0
- package/dist/field/ui/dialog.js +10 -0
- package/dist/field/ui/dialog.js.map +1 -0
- package/dist/field/ui/dropdown.d.ts +25 -0
- package/dist/field/ui/dropdown.d.ts.map +1 -0
- package/dist/field/ui/dropdown.js +118 -0
- package/dist/field/ui/dropdown.js.map +1 -0
- package/dist/field/ui/file-input.d.ts +18 -0
- package/dist/field/ui/file-input.d.ts.map +1 -0
- package/dist/field/ui/file-input.js +17 -0
- package/dist/field/ui/file-input.js.map +1 -0
- package/dist/field/ui/input.css +32 -0
- package/dist/field/ui/modal.css +84 -0
- package/dist/field/ui/modal.d.ts +17 -0
- package/dist/field/ui/modal.d.ts.map +1 -0
- package/dist/field/ui/modal.js +48 -0
- package/dist/field/ui/modal.js.map +1 -0
- package/dist/field/ui/placeholder-inline.d.ts +14 -0
- package/dist/field/ui/placeholder-inline.d.ts.map +1 -0
- package/dist/field/ui/placeholder-inline.js +12 -0
- package/dist/field/ui/placeholder-inline.js.map +1 -0
- package/dist/field/ui/placeholder.css +33 -0
- package/dist/field/ui/placeholder.d.ts +14 -0
- package/dist/field/ui/placeholder.d.ts.map +1 -0
- package/dist/field/ui/placeholder.js +14 -0
- package/dist/field/ui/placeholder.js.map +1 -0
- package/dist/field/ui/select.css +34 -0
- package/dist/field/ui/select.d.ts +16 -0
- package/dist/field/ui/select.d.ts.map +1 -0
- package/dist/field/ui/select.js +17 -0
- package/dist/field/ui/select.js.map +1 -0
- package/dist/field/ui/switch.d.ts +15 -0
- package/dist/field/ui/switch.d.ts.map +1 -0
- package/dist/field/ui/switch.js +8 -0
- package/dist/field/ui/switch.js.map +1 -0
- package/dist/field/ui/text-input.d.ts +20 -0
- package/dist/field/ui/text-input.d.ts.map +1 -0
- package/dist/field/ui/text-input.js +18 -0
- package/dist/field/ui/text-input.js.map +1 -0
- package/dist/field/utils/cloneDeep.d.ts +2 -0
- package/dist/field/utils/cloneDeep.d.ts.map +1 -0
- package/dist/field/utils/cloneDeep.js +50 -0
- package/dist/field/utils/cloneDeep.js.map +1 -0
- package/dist/field/utils/deepEqual.d.ts +2 -0
- package/dist/field/utils/deepEqual.d.ts.map +1 -0
- package/dist/field/utils/deepEqual.js +48 -0
- package/dist/field/utils/deepEqual.js.map +1 -0
- package/dist/field/utils/emoji-list.d.ts +28 -0
- package/dist/field/utils/emoji-list.d.ts.map +1 -0
- package/dist/field/utils/emoji-list.js +16613 -0
- package/dist/field/utils/emoji-list.js.map +1 -0
- package/dist/field/utils/getDOMRangeRect.d.ts +9 -0
- package/dist/field/utils/getDOMRangeRect.d.ts.map +1 -0
- package/dist/field/utils/getDOMRangeRect.js +23 -0
- package/dist/field/utils/getDOMRangeRect.js.map +1 -0
- package/dist/field/utils/getSelectedNode.d.ts +3 -0
- package/dist/field/utils/getSelectedNode.d.ts.map +1 -0
- package/dist/field/utils/getSelectedNode.js +25 -0
- package/dist/field/utils/getSelectedNode.js.map +1 -0
- package/dist/field/utils/guard.d.ts +9 -0
- package/dist/field/utils/guard.d.ts.map +1 -0
- package/dist/field/utils/guard.js +11 -0
- package/dist/field/utils/guard.js.map +1 -0
- package/dist/field/utils/hashSerializedState.d.ts +3 -0
- package/dist/field/utils/hashSerializedState.d.ts.map +1 -0
- package/dist/field/utils/hashSerializedState.js +32 -0
- package/dist/field/utils/hashSerializedState.js.map +1 -0
- package/dist/field/utils/isMobileWidth.d.ts +9 -0
- package/dist/field/utils/isMobileWidth.d.ts.map +1 -0
- package/dist/field/utils/isMobileWidth.js +9 -0
- package/dist/field/utils/isMobileWidth.js.map +1 -0
- package/dist/field/utils/joinClasses.d.ts +9 -0
- package/dist/field/utils/joinClasses.d.ts.map +1 -0
- package/dist/field/utils/joinClasses.js +11 -0
- package/dist/field/utils/joinClasses.js.map +1 -0
- package/dist/field/utils/load-related.d.ts +4 -0
- package/dist/field/utils/load-related.d.ts.map +1 -0
- package/dist/field/utils/load-related.js +45 -0
- package/dist/field/utils/load-related.js.map +1 -0
- package/dist/field/utils/point.d.ts +22 -0
- package/dist/field/utils/point.d.ts.map +1 -0
- package/dist/field/utils/point.js +43 -0
- package/dist/field/utils/point.js.map +1 -0
- package/dist/field/utils/rect.d.ts +46 -0
- package/dist/field/utils/rect.d.ts.map +1 -0
- package/dist/field/utils/rect.js +101 -0
- package/dist/field/utils/rect.js.map +1 -0
- package/dist/field/utils/setFloatingElemPosition.d.ts +2 -0
- package/dist/field/utils/setFloatingElemPosition.d.ts.map +1 -0
- package/dist/field/utils/setFloatingElemPosition.js +34 -0
- package/dist/field/utils/setFloatingElemPosition.js.map +1 -0
- package/dist/field/utils/setFloatingElemPositionForLinkEditor.d.ts +2 -0
- package/dist/field/utils/setFloatingElemPositionForLinkEditor.d.ts.map +1 -0
- package/dist/field/utils/setFloatingElemPositionForLinkEditor.js +33 -0
- package/dist/field/utils/setFloatingElemPositionForLinkEditor.js.map +1 -0
- package/dist/field/utils/swipe.d.ts +12 -0
- package/dist/field/utils/swipe.d.ts.map +1 -0
- package/dist/field/utils/swipe.js +100 -0
- package/dist/field/utils/swipe.js.map +1 -0
- package/dist/field/utils/url.d.ts +11 -0
- package/dist/field/utils/url.d.ts.map +1 -0
- package/dist/field/utils/url.js +45 -0
- package/dist/field/utils/url.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -0
- package/dist/types.d.ts +33 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/dist/validate/hasText.d.ts +3 -0
- package/dist/validate/hasText.d.ts.map +1 -0
- package/dist/validate/hasText.js +29 -0
- package/dist/validate/hasText.js.map +1 -0
- package/dist/validate/validate-client.d.ts +4 -0
- package/dist/validate/validate-client.d.ts.map +1 -0
- package/dist/validate/validate-client.js +17 -0
- package/dist/validate/validate-client.js.map +1 -0
- package/dist/validate/validate-server.d.ts +4 -0
- package/dist/validate/validate-server.d.ts.map +1 -0
- package/dist/validate/validate-server.js +10 -0
- package/dist/validate/validate-server.js.map +1 -0
- package/package.json +108 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import './dialog.css';
|
|
4
|
+
export function DialogButtonsList({ children }) {
|
|
5
|
+
return _jsx("div", { className: "DialogButtonsList", children: children });
|
|
6
|
+
}
|
|
7
|
+
export function DialogActions({ 'data-test-id': dataTestId, children }) {
|
|
8
|
+
return (_jsx("div", { className: "DialogActions", "data-test-id": dataTestId, children: children }));
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=dialog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dialog.js","sourceRoot":"","sources":["../../../src/field/ui/dialog.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAWZ,OAAO,cAAc,CAAA;AAOrB,MAAM,UAAU,iBAAiB,CAAC,EAAE,QAAQ,EAAS;IACnD,OAAO,cAAK,SAAS,EAAC,mBAAmB,YAAE,QAAQ,GAAO,CAAA;AAC5D,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,EAAE,cAAc,EAAE,UAAU,EAAE,QAAQ,EAAS;IAC3E,OAAO,CACL,cAAK,SAAS,EAAC,eAAe,kBAAe,UAAU,YACpD,QAAQ,GACL,CACP,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
4
|
+
*
|
|
5
|
+
* This source code is licensed under the MIT license found in the
|
|
6
|
+
* LICENSE file in the root directory of this source tree.
|
|
7
|
+
*
|
|
8
|
+
*/
|
|
9
|
+
import { type ReactNode } from 'react';
|
|
10
|
+
export declare function DropDownItem({ children, className, onClick, title, }: {
|
|
11
|
+
children: React.ReactNode;
|
|
12
|
+
className: string;
|
|
13
|
+
onClick: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
14
|
+
title?: string;
|
|
15
|
+
}): React.JSX.Element;
|
|
16
|
+
export default function DropDown({ disabled, buttonLabel, buttonAriaLabel, buttonClassName, buttonIconClassName, children, stopCloseOnClickSelf, }: {
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
buttonAriaLabel?: string;
|
|
19
|
+
buttonClassName: string;
|
|
20
|
+
buttonIconClassName?: string;
|
|
21
|
+
buttonLabel?: string;
|
|
22
|
+
children: ReactNode;
|
|
23
|
+
stopCloseOnClickSelf?: boolean;
|
|
24
|
+
}): React.JSX.Element;
|
|
25
|
+
//# sourceMappingURL=dropdown.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dropdown.d.ts","sourceRoot":"","sources":["../../../src/field/ui/dropdown.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B;;;;;;GAMG;AACH,OAAO,EAAE,KAAK,SAAS,EAAqD,MAAM,OAAO,CAAA;AAUzF,wBAAgB,YAAY,CAAC,EAC3B,QAAQ,EACR,SAAS,EACT,OAAO,EACP,KAAK,GACN,EAAE;IACD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,SAAS,EAAE,MAAM,CAAA;IACjB,OAAO,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAA;IAC7D,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CAuBpB;AA2ED,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,EAC/B,QAAgB,EAChB,WAAW,EACX,eAAe,EACf,eAAe,EACf,mBAAmB,EACnB,QAAQ,EACR,oBAAoB,GACrB,EAAE;IACD,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,eAAe,EAAE,MAAM,CAAA;IACvB,mBAAmB,CAAC,EAAE,MAAM,CAAA;IAC5B,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,QAAQ,EAAE,SAAS,CAAA;IACnB,oBAAoB,CAAC,EAAE,OAAO,CAAA;CAC/B,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CAwEpB"}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
/**
|
|
5
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*
|
|
10
|
+
*/
|
|
11
|
+
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
12
|
+
import { createPortal } from 'react-dom';
|
|
13
|
+
const DropDownContext = React.createContext(null);
|
|
14
|
+
export function DropDownItem({ children, className, onClick, title, }) {
|
|
15
|
+
const ref = useRef(null);
|
|
16
|
+
const dropDownContext = React.useContext(DropDownContext);
|
|
17
|
+
if (dropDownContext === null) {
|
|
18
|
+
throw new Error('DropDownItem must be used within a DropDown');
|
|
19
|
+
}
|
|
20
|
+
const { registerItem } = dropDownContext;
|
|
21
|
+
useEffect(() => {
|
|
22
|
+
if (ref?.current != null) {
|
|
23
|
+
// @ts-expect-error: TODO
|
|
24
|
+
registerItem(ref);
|
|
25
|
+
}
|
|
26
|
+
}, [registerItem]);
|
|
27
|
+
return (_jsx("button", { className: className, onClick: onClick, ref: ref, title: title, type: "button", children: children }));
|
|
28
|
+
}
|
|
29
|
+
function DropDownItems({ children, dropDownRef, onClose, }) {
|
|
30
|
+
const [items, setItems] = useState();
|
|
31
|
+
const [highlightedItem, setHighlightedItem] = useState();
|
|
32
|
+
const registerItem = useCallback((itemRef) => {
|
|
33
|
+
setItems((prev) => (prev != null ? [...prev, itemRef] : [itemRef]));
|
|
34
|
+
}, []);
|
|
35
|
+
const handleKeyDown = (event) => {
|
|
36
|
+
if (items == null)
|
|
37
|
+
return;
|
|
38
|
+
const key = event.key;
|
|
39
|
+
if (['Escape', 'ArrowUp', 'ArrowDown', 'Tab'].includes(key)) {
|
|
40
|
+
event.preventDefault();
|
|
41
|
+
}
|
|
42
|
+
if (key === 'Escape' || key === 'Tab') {
|
|
43
|
+
onClose();
|
|
44
|
+
}
|
|
45
|
+
else if (key === 'ArrowUp') {
|
|
46
|
+
setHighlightedItem((prev) => {
|
|
47
|
+
if (prev == null)
|
|
48
|
+
return items[0];
|
|
49
|
+
const index = items.indexOf(prev) - 1;
|
|
50
|
+
return items[index === -1 ? items.length - 1 : index];
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
else if (key === 'ArrowDown') {
|
|
54
|
+
setHighlightedItem((prev) => {
|
|
55
|
+
if (prev == null)
|
|
56
|
+
return items[0];
|
|
57
|
+
return items[items.indexOf(prev) + 1];
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
const contextValue = useMemo(() => ({
|
|
62
|
+
registerItem,
|
|
63
|
+
}), [registerItem]);
|
|
64
|
+
useEffect(() => {
|
|
65
|
+
if (items != null && highlightedItem == null) {
|
|
66
|
+
setHighlightedItem(items[0]);
|
|
67
|
+
}
|
|
68
|
+
if (highlightedItem?.current != null) {
|
|
69
|
+
highlightedItem.current.focus();
|
|
70
|
+
}
|
|
71
|
+
}, [items, highlightedItem]);
|
|
72
|
+
return (_jsx(DropDownContext.Provider, { value: contextValue, children: _jsx("div", { className: "dropdown", ref: dropDownRef, onKeyDown: handleKeyDown, role: "menu", tabIndex: -1, children: children }) }));
|
|
73
|
+
}
|
|
74
|
+
export default function DropDown({ disabled = false, buttonLabel, buttonAriaLabel, buttonClassName, buttonIconClassName, children, stopCloseOnClickSelf, }) {
|
|
75
|
+
const dropDownRef = useRef(null);
|
|
76
|
+
const buttonRef = useRef(null);
|
|
77
|
+
const [showDropDown, setShowDropDown] = useState(false);
|
|
78
|
+
const handleClose = () => {
|
|
79
|
+
setShowDropDown(false);
|
|
80
|
+
if (buttonRef?.current != null) {
|
|
81
|
+
buttonRef.current.focus();
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
useEffect(() => {
|
|
85
|
+
const button = buttonRef.current;
|
|
86
|
+
const dropDown = dropDownRef.current;
|
|
87
|
+
if (showDropDown && button !== null && dropDown !== null) {
|
|
88
|
+
const { top, left } = button.getBoundingClientRect();
|
|
89
|
+
dropDown.style.top = `${top + 40}px`;
|
|
90
|
+
dropDown.style.left = `${Math.min(left, window.innerWidth - dropDown.offsetWidth - 20)}px`;
|
|
91
|
+
}
|
|
92
|
+
}, [showDropDown]);
|
|
93
|
+
useEffect(() => {
|
|
94
|
+
const button = buttonRef.current;
|
|
95
|
+
if (button !== null && showDropDown) {
|
|
96
|
+
const handle = (event) => {
|
|
97
|
+
const target = event.target;
|
|
98
|
+
if (stopCloseOnClickSelf != null) {
|
|
99
|
+
if (dropDownRef?.current?.contains(target)) {
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
if (!button.contains(target)) {
|
|
104
|
+
setShowDropDown(false);
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
document.addEventListener('click', handle);
|
|
108
|
+
return () => {
|
|
109
|
+
document.removeEventListener('click', handle);
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
}, [showDropDown, stopCloseOnClickSelf]);
|
|
113
|
+
return (_jsxs(_Fragment, { children: [_jsxs("button", { type: "button", disabled: disabled, "aria-label": buttonAriaLabel ?? buttonLabel, className: buttonClassName, onClick: () => {
|
|
114
|
+
setShowDropDown(!showDropDown);
|
|
115
|
+
}, ref: buttonRef, children: [buttonIconClassName != null && _jsx("span", { className: buttonIconClassName }), buttonLabel != null && _jsx("span", { className: "text dropdown-button-text", children: buttonLabel }), _jsx("i", { className: "chevron-down" })] }), showDropDown &&
|
|
116
|
+
createPortal(_jsx(DropDownItems, { dropDownRef: dropDownRef, onClose: handleClose, children: children }), document.body)] }));
|
|
117
|
+
}
|
|
118
|
+
//# sourceMappingURL=dropdown.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dropdown.js","sourceRoot":"","sources":["../../../src/field/ui/dropdown.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B;;;;;;GAMG;AACH,OAAO,EAAkB,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAEzF,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAMxC,MAAM,eAAe,GAAG,KAAK,CAAC,aAAa,CAA6B,IAAI,CAAC,CAAA;AAE7E,MAAM,UAAU,YAAY,CAAC,EAC3B,QAAQ,EACR,SAAS,EACT,OAAO,EACP,KAAK,GAMN;IACC,MAAM,GAAG,GAAG,MAAM,CAAoB,IAAI,CAAC,CAAA;IAE3C,MAAM,eAAe,GAAG,KAAK,CAAC,UAAU,CAAC,eAAe,CAAC,CAAA;IAEzD,IAAI,eAAe,KAAK,IAAI,EAAE,CAAC;QAC7B,MAAM,IAAI,KAAK,CAAC,6CAA6C,CAAC,CAAA;IAChE,CAAC;IAED,MAAM,EAAE,YAAY,EAAE,GAAG,eAAe,CAAA;IAExC,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,GAAG,EAAE,OAAO,IAAI,IAAI,EAAE,CAAC;YACzB,yBAAyB;YACzB,YAAY,CAAC,GAAG,CAAC,CAAA;QACnB,CAAC;IACH,CAAC,EAAE,CAAC,YAAY,CAAC,CAAC,CAAA;IAElB,OAAO,CACL,iB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CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
import * as React from 'react';
|
|
9
|
+
import './input.scss';
|
|
10
|
+
type Props = Readonly<{
|
|
11
|
+
'data-test-id'?: string;
|
|
12
|
+
accept?: string;
|
|
13
|
+
label: string;
|
|
14
|
+
onChange: (files: FileList | null) => void;
|
|
15
|
+
}>;
|
|
16
|
+
export default function FileInput({ accept, label, onChange, 'data-test-id': dataTestId, }: Props): React.JSX.Element;
|
|
17
|
+
export {};
|
|
18
|
+
//# sourceMappingURL=file-input.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-input.d.ts","sourceRoot":"","sources":["../../../src/field/ui/file-input.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,cAAc,CAAA;AAErB,KAAK,KAAK,GAAG,QAAQ,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,CAAC,KAAK,EAAE,QAAQ,GAAG,IAAI,KAAK,IAAI,CAAA;CAC3C,CAAC,CAAA;AAEF,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,EAChC,MAAM,EACN,KAAK,EACL,QAAQ,EACR,cAAc,EAAE,UAAU,GAC3B,EAAE,KAAK,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CAoB3B"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
4
|
+
*
|
|
5
|
+
* This source code is licensed under the MIT license found in the
|
|
6
|
+
* LICENSE file in the root directory of this source tree.
|
|
7
|
+
*
|
|
8
|
+
*/
|
|
9
|
+
import * as React from 'react';
|
|
10
|
+
import './input.scss';
|
|
11
|
+
export default function FileInput({ accept, label, onChange, 'data-test-id': dataTestId, }) {
|
|
12
|
+
const inputId = React.useId();
|
|
13
|
+
return (_jsxs("div", { className: "Input__wrapper", children: [_jsx("label", { className: "Input__label", htmlFor: inputId, children: label }), _jsx("input", { id: inputId, type: "file", accept: accept, className: "Input__input", onChange: (e) => {
|
|
14
|
+
onChange(e.target.files);
|
|
15
|
+
}, "data-test-id": dataTestId })] }));
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=file-input.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-input.js","sourceRoot":"","sources":["../../../src/field/ui/file-input.tsx"],"names":[],"mappings":";AAAA;;;;;;GAMG;AACH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,cAAc,CAAA;AASrB,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,EAChC,MAAM,EACN,KAAK,EACL,QAAQ,EACR,cAAc,EAAE,UAAU,GACpB;IACN,MAAM,OAAO,GAAG,KAAK,CAAC,KAAK,EAAE,CAAA;IAE7B,OAAO,CACL,eAAK,SAAS,EAAC,gBAAgB,aAC7B,gBAAO,SAAS,EAAC,cAAc,EAAC,OAAO,EAAE,OAAO,YAC7C,KAAK,GACA,EACR,gBACE,EAAE,EAAE,OAAO,EACX,IAAI,EAAC,MAAM,EACX,MAAM,EAAE,MAAM,EACd,SAAS,EAAC,cAAc,EACxB,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE;oBACd,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;gBAC1B,CAAC,kBACa,UAAU,GACxB,IACE,CACP,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
.Input__wrapper {
|
|
11
|
+
display: flex;
|
|
12
|
+
flex-direction: row;
|
|
13
|
+
align-items: center;
|
|
14
|
+
margin-bottom: 10px;
|
|
15
|
+
}
|
|
16
|
+
.Input__label {
|
|
17
|
+
display: flex;
|
|
18
|
+
flex: 1;
|
|
19
|
+
color: #666;
|
|
20
|
+
}
|
|
21
|
+
.Input__input {
|
|
22
|
+
display: flex;
|
|
23
|
+
flex: 2;
|
|
24
|
+
border: 1px solid #999;
|
|
25
|
+
padding-top: 7px;
|
|
26
|
+
padding-bottom: 7px;
|
|
27
|
+
padding-left: 10px;
|
|
28
|
+
padding-right: 10px;
|
|
29
|
+
font-size: 16px;
|
|
30
|
+
border-radius: 5px;
|
|
31
|
+
min-width: 0;
|
|
32
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
.Modal__overlay {
|
|
11
|
+
display: flex;
|
|
12
|
+
justify-content: center;
|
|
13
|
+
align-items: center;
|
|
14
|
+
position: fixed;
|
|
15
|
+
flex-direction: column;
|
|
16
|
+
top: 0px;
|
|
17
|
+
bottom: 0px;
|
|
18
|
+
left: 0px;
|
|
19
|
+
right: 0px;
|
|
20
|
+
background-color: rgba(40, 40, 40, 0.6);
|
|
21
|
+
flex-grow: 0px;
|
|
22
|
+
flex-shrink: 1px;
|
|
23
|
+
z-index: 100;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.Modal__modal {
|
|
27
|
+
padding: 20px;
|
|
28
|
+
min-height: 100px;
|
|
29
|
+
min-width: 300px;
|
|
30
|
+
display: flex;
|
|
31
|
+
flex-grow: 0px;
|
|
32
|
+
background-color: #fff;
|
|
33
|
+
flex-direction: column;
|
|
34
|
+
position: relative;
|
|
35
|
+
box-shadow: 0 0 20px 0 #444;
|
|
36
|
+
border-radius: 10px;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.Modal__title {
|
|
40
|
+
color: #444;
|
|
41
|
+
margin: 0px;
|
|
42
|
+
padding-bottom: 10px;
|
|
43
|
+
font-size: 1.4rem;
|
|
44
|
+
border-bottom: 1px solid #ccc;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.Modal__closeButton {
|
|
48
|
+
border: 0px;
|
|
49
|
+
position: absolute;
|
|
50
|
+
right: 20px;
|
|
51
|
+
border-radius: 20px;
|
|
52
|
+
justify-content: center;
|
|
53
|
+
align-items: center;
|
|
54
|
+
display: flex;
|
|
55
|
+
width: 30px;
|
|
56
|
+
height: 30px;
|
|
57
|
+
text-align: center;
|
|
58
|
+
cursor: pointer;
|
|
59
|
+
background-color: #eee;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.Modal__closeButton:hover {
|
|
63
|
+
background-color: #ddd;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.Modal__content {
|
|
67
|
+
padding-top: 20px;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
[data-theme="dark"] .Modal__modal {
|
|
71
|
+
background-color: #111111;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
[data-theme="dark"] .Modal__closeButton {
|
|
75
|
+
background-color: #222222;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
[data-theme="dark"] .Modal__closeButton:hover {
|
|
79
|
+
background-color: #282828;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
[data-theme="dark"] .Modal__title {
|
|
83
|
+
color: #ccc;
|
|
84
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
import type * as React from 'react';
|
|
9
|
+
import { type ReactNode } from 'react';
|
|
10
|
+
import './modal.css';
|
|
11
|
+
export default function Modal({ onClose, children, title, closeOnClickOutside, }: {
|
|
12
|
+
children: ReactNode;
|
|
13
|
+
closeOnClickOutside?: boolean;
|
|
14
|
+
onClose: () => void;
|
|
15
|
+
title: string;
|
|
16
|
+
}): React.JSX.Element;
|
|
17
|
+
//# sourceMappingURL=modal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"modal.d.ts","sourceRoot":"","sources":["../../../src/field/ui/modal.tsx"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAA;AACnC,OAAO,EAAE,KAAK,SAAS,EAAqB,MAAM,OAAO,CAAA;AAIzD,OAAO,aAAa,CAAA;AA0EpB,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,EAC5B,OAAO,EACP,QAAQ,EACR,KAAK,EACL,mBAA2B,GAC5B,EAAE;IACD,QAAQ,EAAE,SAAS,CAAA;IACnB,mBAAmB,CAAC,EAAE,OAAO,CAAA;IAC7B,OAAO,EAAE,MAAM,IAAI,CAAA;IACnB,KAAK,EAAE,MAAM,CAAA;CACd,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CAOpB"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useEffect, useRef } from 'react';
|
|
4
|
+
import { createPortal } from 'react-dom';
|
|
5
|
+
import './modal.css';
|
|
6
|
+
function PortalImpl({ onClose, children, title, closeOnClickOutside, }) {
|
|
7
|
+
const modalRef = useRef(null);
|
|
8
|
+
useEffect(() => {
|
|
9
|
+
if (modalRef.current !== null) {
|
|
10
|
+
modalRef.current.focus();
|
|
11
|
+
}
|
|
12
|
+
}, []);
|
|
13
|
+
useEffect(() => {
|
|
14
|
+
let modalOverlayElement = null;
|
|
15
|
+
const handler = (event) => {
|
|
16
|
+
if (event.keyCode === 27) {
|
|
17
|
+
onClose();
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
const clickOutsideHandler = (event) => {
|
|
21
|
+
const target = event.target;
|
|
22
|
+
if (modalRef.current !== null &&
|
|
23
|
+
!modalRef.current.contains(target) &&
|
|
24
|
+
closeOnClickOutside) {
|
|
25
|
+
onClose();
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
const modelElement = modalRef.current;
|
|
29
|
+
if (modelElement !== null) {
|
|
30
|
+
modalOverlayElement = modelElement.parentElement;
|
|
31
|
+
if (modalOverlayElement !== null) {
|
|
32
|
+
modalOverlayElement.addEventListener('click', clickOutsideHandler);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
window.addEventListener('keydown', handler);
|
|
36
|
+
return () => {
|
|
37
|
+
window.removeEventListener('keydown', handler);
|
|
38
|
+
if (modalOverlayElement !== null) {
|
|
39
|
+
modalOverlayElement?.removeEventListener('click', clickOutsideHandler);
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
}, [closeOnClickOutside, onClose]);
|
|
43
|
+
return (_jsx("div", { className: "Modal__overlay", role: "dialog", children: _jsxs("div", { className: "Modal__modal", tabIndex: -1, ref: modalRef, children: [_jsx("h2", { className: "Modal__title", children: title }), _jsx("button", { className: "Modal__closeButton", "aria-label": "Close modal", type: "button", onClick: onClose, children: "X" }), _jsx("div", { className: "Modal__content", children: children })] }) }));
|
|
44
|
+
}
|
|
45
|
+
export default function Modal({ onClose, children, title, closeOnClickOutside = false, }) {
|
|
46
|
+
return createPortal(_jsx(PortalImpl, { onClose: onClose, title: title, closeOnClickOutside: closeOnClickOutside, children: children }), document.body);
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=modal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"modal.js","sourceRoot":"","sources":["../../../src/field/ui/modal.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAUZ,OAAO,EAAkB,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAA;AAEzD,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAExC,OAAO,aAAa,CAAA;AAEpB,SAAS,UAAU,CAAC,EAClB,OAAO,EACP,QAAQ,EACR,KAAK,EACL,mBAAmB,GAMpB;IACC,MAAM,QAAQ,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAA;IAE7C,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,QAAQ,CAAC,OAAO,KAAK,IAAI,EAAE,CAAC;YAC9B,QAAQ,CAAC,OAAO,CAAC,KAAK,EAAE,CAAA;QAC1B,CAAC;IACH,CAAC,EAAE,EAAE,CAAC,CAAA;IAEN,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,mBAAmB,GAAuB,IAAI,CAAA;QAClD,MAAM,OAAO,GAAG,CAAC,KAAoB,EAAQ,EAAE;YAC7C,IAAI,KAAK,CAAC,OAAO,KAAK,EAAE,EAAE,CAAC;gBACzB,OAAO,EAAE,CAAA;YACX,CAAC;QACH,CAAC,CAAA;QACD,MAAM,mBAAmB,GAAG,CAAC,KAAiB,EAAQ,EAAE;YACtD,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,CAAA;YAC3B,IACE,QAAQ,CAAC,OAAO,KAAK,IAAI;gBACzB,CAAC,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,MAAc,CAAC;gBAC1C,mBAAmB,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O,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,mBAAmB,EAAE,mBAAmB,YACjF,QAAQ,GACE,EACb,QAAQ,CAAC,IAAI,CACd,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
import type * as React from 'react';
|
|
9
|
+
import './placeholder.css';
|
|
10
|
+
export default function PlaceholderInline({ children, className, }: {
|
|
11
|
+
children: React.ReactNode;
|
|
12
|
+
className?: string;
|
|
13
|
+
}): React.JSX.Element;
|
|
14
|
+
//# sourceMappingURL=placeholder-inline.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"placeholder-inline.d.ts","sourceRoot":"","sources":["../../../src/field/ui/placeholder-inline.tsx"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAA;AAInC,OAAO,mBAAmB,CAAA;AAK1B,MAAM,CAAC,OAAO,UAAU,iBAAiB,CAAC,EACxC,QAAQ,EACR,SAAS,GACV,EAAE;IACD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CAGpB"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import cx from 'classnames';
|
|
4
|
+
import './placeholder.css';
|
|
5
|
+
// NOTE: we disable all config checks and draggable blocks
|
|
6
|
+
// as in placeholder.tsx - because this version will
|
|
7
|
+
// appear inside caption areas for images.
|
|
8
|
+
export default function PlaceholderInline({ children, className, }) {
|
|
9
|
+
const classes = cx('Placeholder__root', className);
|
|
10
|
+
return _jsx("span", { className: classes, children: children });
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=placeholder-inline.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"placeholder-inline.js","sourceRoot":"","sources":["../../../src/field/ui/placeholder-inline.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAWZ,OAAO,EAAE,MAAM,YAAY,CAAA;AAE3B,OAAO,mBAAmB,CAAA;AAE1B,0DAA0D;AAC1D,oDAAoD;AACpD,0CAA0C;AAC1C,MAAM,CAAC,OAAO,UAAU,iBAAiB,CAAC,EACxC,QAAQ,EACR,SAAS,GAIV;IACC,MAAM,OAAO,GAAG,EAAE,CAAC,mBAAmB,EAAE,SAAS,CAAC,CAAA;IAClD,OAAO,eAAM,SAAS,EAAE,OAAO,YAAG,QAAQ,GAAQ,CAAA;AACpD,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
.Placeholder__root {
|
|
11
|
+
font-size: 15px;
|
|
12
|
+
color: #999;
|
|
13
|
+
overflow: hidden;
|
|
14
|
+
position: absolute;
|
|
15
|
+
text-overflow: ellipsis;
|
|
16
|
+
top: 8px;
|
|
17
|
+
left: 2px;
|
|
18
|
+
right: 0;
|
|
19
|
+
user-select: none;
|
|
20
|
+
white-space: nowrap;
|
|
21
|
+
display: inline-block;
|
|
22
|
+
pointer-events: none;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.Placeholder__with_draggable_blocks {
|
|
26
|
+
left: 22px;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
@media (max-width: 1025px) {
|
|
30
|
+
.ContentEditable__root {
|
|
31
|
+
left: 2px;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
import type * as React from 'react';
|
|
9
|
+
import './placeholder.css';
|
|
10
|
+
export declare function Placeholder({ children, className, }: {
|
|
11
|
+
children: React.ReactNode;
|
|
12
|
+
className?: string;
|
|
13
|
+
}): React.JSX.Element;
|
|
14
|
+
//# sourceMappingURL=placeholder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"placeholder.d.ts","sourceRoot":"","sources":["../../../src/field/ui/placeholder.tsx"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAA;AAInC,OAAO,mBAAmB,CAAA;AAI1B,wBAAgB,WAAW,CAAC,EAC1B,QAAQ,EACR,SAAS,GACV,EAAE;IACD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CAQpB"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import cx from 'classnames';
|
|
4
|
+
import './placeholder.css';
|
|
5
|
+
import { useEditorConfig } from '../config/editor-config-context';
|
|
6
|
+
export function Placeholder({ children, className, }) {
|
|
7
|
+
const { config } = useEditorConfig();
|
|
8
|
+
// const classes = cx('Placeholder__root', className, {
|
|
9
|
+
// Placeholder__with_draggable_blocks: config.options.draggableBlocks,
|
|
10
|
+
// })
|
|
11
|
+
const classes = cx('Placeholder__root', className);
|
|
12
|
+
return _jsx("div", { className: classes, children: children });
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=placeholder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"placeholder.js","sourceRoot":"","sources":["../../../src/field/ui/placeholder.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAWZ,OAAO,EAAE,MAAM,YAAY,CAAA;AAE3B,OAAO,mBAAmB,CAAA;AAE1B,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAA;AAEjE,MAAM,UAAU,WAAW,CAAC,EAC1B,QAAQ,EACR,SAAS,GAIV;IACC,MAAM,EAAE,MAAM,EAAE,GAAG,eAAe,EAAE,CAAA;IACpC,uDAAuD;IACvD,wEAAwE;IACxE,KAAK;IACL,MAAM,OAAO,GAAG,EAAE,CAAC,mBAAmB,EAAE,SAAS,CAAC,CAAA;IAElD,OAAO,cAAK,SAAS,EAAE,OAAO,YAAG,QAAQ,GAAO,CAAA;AAClD,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
select {
|
|
2
|
+
appearance: none;
|
|
3
|
+
-webkit-appearance: none;
|
|
4
|
+
-moz-appearance: none;
|
|
5
|
+
background-color: transparent;
|
|
6
|
+
border: none;
|
|
7
|
+
padding: 0 1em 0 0;
|
|
8
|
+
margin: 0;
|
|
9
|
+
font-family: inherit;
|
|
10
|
+
font-size: inherit;
|
|
11
|
+
cursor: inherit;
|
|
12
|
+
line-height: inherit;
|
|
13
|
+
|
|
14
|
+
z-index: 1;
|
|
15
|
+
outline: none;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
:root {
|
|
19
|
+
--select-border: #393939;
|
|
20
|
+
--select-focus: #101484;
|
|
21
|
+
--select-arrow: var(--select-border);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.select {
|
|
25
|
+
min-width: 160px;
|
|
26
|
+
max-width: 290px;
|
|
27
|
+
border: 1px solid var(--select-border);
|
|
28
|
+
border-radius: 0.25em;
|
|
29
|
+
padding: 0.25em 0.5em;
|
|
30
|
+
font-size: 1rem;
|
|
31
|
+
cursor: pointer;
|
|
32
|
+
line-height: 1.4;
|
|
33
|
+
background: linear-gradient(to bottom, #ffffff 0%, #e5e5e5 100%);
|
|
34
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
import * as React from 'react';
|
|
9
|
+
import './select.css';
|
|
10
|
+
type SelectIntrinsicProps = React.SelectHTMLAttributes<HTMLSelectElement>;
|
|
11
|
+
interface SelectProps extends SelectIntrinsicProps {
|
|
12
|
+
label: string;
|
|
13
|
+
}
|
|
14
|
+
export default function Select({ children, label, className, ...other }: SelectProps): React.JSX.Element;
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=select.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../../../src/field/ui/select.tsx"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,cAAc,CAAA;AAErB,KAAK,oBAAoB,GAAG,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,CAAA;AACzE,UAAU,WAAY,SAAQ,oBAAoB;IAChD,KAAK,EAAE,MAAM,CAAA;CACd;AAED,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,EAC7B,QAAQ,EACR,KAAK,EACL,SAAS,EACT,GAAG,KAAK,EACT,EAAE,WAAW,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CAcjC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
/**
|
|
4
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
5
|
+
*
|
|
6
|
+
* This source code is licensed under the MIT license found in the
|
|
7
|
+
* LICENSE file in the root directory of this source tree.
|
|
8
|
+
*
|
|
9
|
+
*/
|
|
10
|
+
import * as React from 'react';
|
|
11
|
+
import './select.css';
|
|
12
|
+
export default function Select({ children, label, className, ...other }) {
|
|
13
|
+
const generatedId = React.useId();
|
|
14
|
+
const id = other.id ?? generatedId;
|
|
15
|
+
return (_jsxs("div", { className: "Input__wrapper", children: [_jsx("label", { htmlFor: id, style: { marginTop: '-1em' }, className: "Input__label", children: label }), _jsx("select", { ...other, id: id, className: className ?? 'select', children: children })] }));
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=select.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"select.js","sourceRoot":"","sources":["../../../src/field/ui/select.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ;;;;;;GAMG;AACH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,cAAc,CAAA;AAOrB,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,EAC7B,QAAQ,EACR,KAAK,EACL,SAAS,EACT,GAAG,KAAK,EACI;IACZ,MAAM,WAAW,GAAG,KAAK,CAAC,KAAK,EAAE,CAAA;IACjC,MAAM,EAAE,GAAG,KAAK,CAAC,EAAE,IAAI,WAAW,CAAA;IAElC,OAAO,CACL,eAAK,SAAS,EAAC,gBAAgB,aAC7B,gBAAO,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,SAAS,EAAC,cAAc,YACvE,KAAK,GACA,EACR,oBAAY,KAAK,EAAE,EAAE,EAAE,EAAE,EAAE,SAAS,EAAE,SAAS,IAAI,QAAQ,YACxD,QAAQ,GACF,IACL,CACP,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
import type * as React from 'react';
|
|
9
|
+
export default function Switch({ checked, onClick, text, id, }: Readonly<{
|
|
10
|
+
checked: boolean;
|
|
11
|
+
id?: string;
|
|
12
|
+
onClick: (e: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
|
|
13
|
+
text: string;
|
|
14
|
+
}>): React.JSX.Element;
|
|
15
|
+
//# sourceMappingURL=switch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"switch.d.ts","sourceRoot":"","sources":["../../../src/field/ui/switch.tsx"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAA;AAGnC,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,EAC7B,OAAO,EACP,OAAO,EACP,IAAI,EACJ,EAAE,GACH,EAAE,QAAQ,CAAC;IACV,OAAO,EAAE,OAAO,CAAA;IAChB,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,OAAO,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,iBAAiB,EAAE,UAAU,CAAC,KAAK,IAAI,CAAA;IACrE,IAAI,EAAE,MAAM,CAAA;CACb,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CAUrB"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useMemo } from 'react';
|
|
4
|
+
export default function Switch({ checked, onClick, text, id, }) {
|
|
5
|
+
const buttonId = useMemo(() => `id_ ${Math.floor(Math.random() * 10000)}`, []);
|
|
6
|
+
return (_jsxs("div", { className: "switch", id: id, children: [_jsx("label", { htmlFor: buttonId, children: text }), _jsx("button", { type: "button", role: "switch", "aria-checked": checked, id: buttonId, onClick: onClick, children: _jsx("span", {}) })] }));
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=switch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"switch.js","sourceRoot":"","sources":["../../../src/field/ui/switch.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAUZ,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AAE/B,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,EAC7B,OAAO,EACP,OAAO,EACP,IAAI,EACJ,EAAE,GAMF;IACA,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,KAAK,CAAC,EAAE,EAAE,EAAE,CAAC,CAAA;IAC9E,OAAO,CACL,eAAK,SAAS,EAAC,QAAQ,EAAC,EAAE,EAAE,EAAE,aAC5B,gBAAO,OAAO,EAAE,QAAQ,YAAG,IAAI,GAAS,EACxC,iBAAQ,IAAI,EAAC,QAAQ,EAAC,IAAI,EAAC,QAAQ,kBAAe,OAAO,EAAE,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,YACvF,gBAAQ,GACD,IACL,CACP,CAAA;AACH,CAAC"}
|