@wix/patterns-fields 1.16.0 → 1.18.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/cell-rich-content-input/package.json +5 -0
- package/dist/cjs/assets/locale/messages_en.json +6 -2
- package/dist/cjs/components/address/input/address-input.st.css.js +3 -3
- package/dist/cjs/components/address/input/address-input.st.css.js.map +1 -1
- package/dist/cjs/components/audio/actions/actions-menu/actions-menu.st.css.js +3 -3
- package/dist/cjs/components/audio/actions/actions-menu/actions-menu.st.css.js.map +1 -1
- package/dist/cjs/components/audio/audio-field/form-audio-field.st.css.js +4 -4
- package/dist/cjs/components/audio/audio-field/form-audio-field.st.css.js.map +1 -1
- package/dist/cjs/components/audio/audio-player/audio-player.st.css.js +2 -2
- package/dist/cjs/components/audio/audio-player/audio-player.st.css.js.map +1 -1
- package/dist/cjs/components/color-view/color-view.st.css.js +4 -4
- package/dist/cjs/components/color-view/color-view.st.css.js.map +1 -1
- package/dist/cjs/components/delete-dialog/delete-dialog.st.css.js +3 -3
- package/dist/cjs/components/delete-dialog/delete-dialog.st.css.js.map +1 -1
- package/dist/cjs/components/document/form-document-field.st.css.js +7 -7
- package/dist/cjs/components/document/form-document-field.st.css.js.map +1 -1
- package/dist/cjs/components/exclamation/exclamation.st.css.js +5 -5
- package/dist/cjs/components/exclamation/exclamation.st.css.js.map +1 -1
- package/dist/cjs/components/highlighted-text/highlighted-text.st.css.js +5 -5
- package/dist/cjs/components/highlighted-text/highlighted-text.st.css.js.map +1 -1
- package/dist/cjs/components/image/cell-image-edit.js +32 -61
- package/dist/cjs/components/image/cell-image-edit.js.map +1 -1
- package/dist/cjs/components/image/image-thumbnail.js +7 -6
- package/dist/cjs/components/image/image-thumbnail.js.map +1 -1
- package/dist/cjs/components/image/thumbnail-replace-overlay.js +29 -0
- package/dist/cjs/components/image/thumbnail-replace-overlay.js.map +1 -0
- package/dist/cjs/components/image/thumbnail-replace-overlay.st.css +15 -0
- package/dist/cjs/components/image/thumbnail-replace-overlay.st.css.js +23 -0
- package/dist/cjs/components/image/thumbnail-replace-overlay.st.css.js.map +1 -0
- package/dist/cjs/components/media-control/paste-url-button.st.css.js +4 -4
- package/dist/cjs/components/media-control/paste-url-button.st.css.js.map +1 -1
- package/dist/cjs/components/media-control/use-media-control.js +8 -9
- package/dist/cjs/components/media-control/use-media-control.js.map +1 -1
- package/dist/cjs/components/media-gallery/form-media-gallery-field.st.css.js +10 -10
- package/dist/cjs/components/media-gallery/form-media-gallery-field.st.css.js.map +1 -1
- package/dist/cjs/components/media-image/media-image.st.css.js +4 -4
- package/dist/cjs/components/media-image/media-image.st.css.js.map +1 -1
- package/dist/cjs/components/media-image/overlays/overlay.st.css.js +4 -4
- package/dist/cjs/components/media-image/overlays/overlay.st.css.js.map +1 -1
- package/dist/cjs/components/media-loader/media-loader.st.css.js +3 -3
- package/dist/cjs/components/media-loader/media-loader.st.css.js.map +1 -1
- package/dist/cjs/components/media-tag/web-media-tag/media-tag.st.css.js +2 -2
- package/dist/cjs/components/media-tag/web-media-tag/media-tag.st.css.js.map +1 -1
- package/dist/cjs/components/multi-document/multi-document-input/form-multi-document-field.js.map +1 -1
- package/dist/cjs/components/multi-document/multi-document-input/form-multi-document-view.js.map +1 -1
- package/dist/cjs/components/multi-document/multi-document-input/form-multi-document.st.css.js +5 -5
- package/dist/cjs/components/multi-document/multi-document-input/form-multi-document.st.css.js.map +1 -1
- package/dist/cjs/components/rich-content/cell-rich-content-input.js +1 -1
- package/dist/cjs/components/rich-content/cell-rich-content-input.js.map +1 -1
- package/dist/cjs/components/rich-content/cell-rich-content-view.js +1 -1
- package/dist/cjs/components/rich-content/cell-rich-content-view.js.map +1 -1
- package/dist/cjs/components/rich-content/editor.js +2 -10
- package/dist/cjs/components/rich-content/editor.js.map +1 -1
- package/dist/cjs/components/rich-content/rich-content-input/default-value-input/rich-content-default-value-input.st.css.js +6 -6
- package/dist/cjs/components/rich-content/rich-content-input/default-value-input/rich-content-default-value-input.st.css.js.map +1 -1
- package/dist/cjs/components/rich-content/rich-content-input/form-input/form-input.js +2 -1
- package/dist/cjs/components/rich-content/rich-content-input/form-input/form-input.js.map +1 -1
- package/dist/cjs/components/rich-content/rich-content-input/form-input/index.js +3 -4
- package/dist/cjs/components/rich-content/rich-content-input/form-input/index.js.map +1 -1
- package/dist/cjs/components/rich-content/rich-content-input/form-input/rich-content-form-input.st.css.js +5 -5
- package/dist/cjs/components/rich-content/rich-content-input/form-input/rich-content-form-input.st.css.js.map +1 -1
- package/dist/cjs/components/rich-content/rich-content-input/form-read-only-input/rich-content-form-read-only-input.st.css.js +2 -2
- package/dist/cjs/components/rich-content/rich-content-input/form-read-only-input/rich-content-form-read-only-input.st.css.js.map +1 -1
- package/dist/cjs/components/rich-content/rich-content-input/rich-content-common/fullscreen-modal/fullscreen-modal.st.css.js +3 -3
- package/dist/cjs/components/rich-content/rich-content-input/rich-content-common/fullscreen-modal/fullscreen-modal.st.css.js.map +1 -1
- package/dist/cjs/components/rich-content/rich-content-input/rich-content-common/publish-loader/publish-loader.st.css.js +3 -3
- package/dist/cjs/components/rich-content/rich-content-input/rich-content-common/publish-loader/publish-loader.st.css.js.map +1 -1
- package/dist/cjs/components/rich-content/rich-content-input/rich-content-common/toggle-fullscreen-button/toggle-fullscreen-button.st.css.js +2 -2
- package/dist/cjs/components/rich-content/rich-content-input/rich-content-common/toggle-fullscreen-button/toggle-fullscreen-button.st.css.js.map +1 -1
- package/dist/cjs/components/rich-content/rich-content-input/rich-content-editor/rich-content-editor.st.css.js +8 -8
- package/dist/cjs/components/rich-content/rich-content-input/rich-content-editor/rich-content-editor.st.css.js.map +1 -1
- package/dist/cjs/components/rich-content/rich-content-input/rich-content-editor/rich-content-toolbar.st.css.js +4 -4
- package/dist/cjs/components/rich-content/rich-content-input/rich-content-editor/rich-content-toolbar.st.css.js.map +1 -1
- package/dist/cjs/components/rich-content/rich-content-input/rich-content-viewer/rich-content-viewer.st.css.js +4 -4
- package/dist/cjs/components/rich-content/rich-content-input/rich-content-viewer/rich-content-viewer.st.css.js.map +1 -1
- package/dist/cjs/components/rich-text/cell-rich-text-editor.js +155 -0
- package/dist/cjs/components/rich-text/cell-rich-text-editor.js.map +1 -0
- package/dist/cjs/components/rich-text/cell-rich-text-input.js +153 -0
- package/dist/cjs/components/rich-text/cell-rich-text-input.js.map +1 -0
- package/dist/cjs/components/rich-text/cell-rich-text-view.js +30 -0
- package/dist/cjs/components/rich-text/cell-rich-text-view.js.map +1 -0
- package/dist/cjs/components/rich-text/index.js +18 -0
- package/dist/cjs/components/rich-text/index.js.map +1 -1
- package/dist/cjs/components/rich-text/rich-text-input/rich-text-editor/rich-editor.js +13 -1
- package/dist/cjs/components/rich-text/rich-text-input/rich-text-editor/rich-editor.js.map +1 -1
- package/dist/cjs/components/rich-text/rich-text-input/rich-text-editor/rich-editor.st.css +26 -22
- package/dist/cjs/components/rich-text/rich-text-input/rich-text-editor/rich-editor.st.css.js +50 -46
- package/dist/cjs/components/rich-text/rich-text-input/rich-text-editor/rich-editor.st.css.js.map +1 -1
- package/dist/cjs/components/rich-text/rich-text-input/rich-text-editor/rich-text-editor.st.css.js +4 -4
- package/dist/cjs/components/rich-text/rich-text-input/rich-text-editor/rich-text-editor.st.css.js.map +1 -1
- package/dist/cjs/components/rich-text/rich-text-input/rich-text-editor/toolbar/header-dropdown.js +168 -157
- package/dist/cjs/components/rich-text/rich-text-input/rich-text-editor/toolbar/header-dropdown.js.map +1 -1
- package/dist/cjs/components/rich-text/rich-text-input/rich-text-editor/toolbar/toolbar.st.css +13 -12
- package/dist/cjs/components/rich-text/rich-text-input/rich-text-editor/toolbar/toolbar.st.css.js +22 -19
- package/dist/cjs/components/rich-text/rich-text-input/rich-text-editor/toolbar/toolbar.st.css.js.map +1 -1
- package/dist/cjs/components/text/text-view.st.css.js +3 -3
- package/dist/cjs/components/text/text-view.st.css.js.map +1 -1
- package/dist/cjs/components/video/cell-video-edit.js +424 -0
- package/dist/cjs/components/video/cell-video-edit.js.map +1 -0
- package/dist/cjs/components/video/index.js +3 -1
- package/dist/cjs/components/video/index.js.map +1 -1
- package/dist/cjs/exports/cell-rich-content-input.js +8 -0
- package/dist/cjs/exports/cell-rich-content-input.js.map +1 -0
- package/dist/cjs/exports/form-rich-content-input.js +3 -4
- package/dist/cjs/exports/form-rich-content-input.js.map +1 -1
- package/dist/cjs/index.js +11 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/services/translations.js.map +1 -1
- package/dist/cjs/styles.global.css +1 -1
- package/dist/esm/assets/locale/messages_en.json +6 -2
- package/dist/esm/components/address/input/address-input.st.css.js +2 -2
- package/dist/esm/components/address/input/address-input.st.css.js.map +1 -1
- package/dist/esm/components/audio/actions/actions-menu/actions-menu.st.css.js +2 -2
- package/dist/esm/components/audio/actions/actions-menu/actions-menu.st.css.js.map +1 -1
- package/dist/esm/components/audio/audio-field/form-audio-field.st.css.js +2 -2
- package/dist/esm/components/audio/audio-player/audio-player.st.css.js +2 -2
- package/dist/esm/components/color-view/color-view.st.css.js +2 -2
- package/dist/esm/components/delete-dialog/delete-dialog.st.css.js +2 -2
- package/dist/esm/components/document/form-document-field.st.css.js +2 -2
- package/dist/esm/components/exclamation/exclamation.st.css.js +2 -2
- package/dist/esm/components/highlighted-text/highlighted-text.st.css.js +3 -3
- package/dist/esm/components/image/cell-image-edit.js +4 -21
- package/dist/esm/components/image/cell-image-edit.js.map +1 -1
- package/dist/esm/components/image/image-thumbnail.js +9 -3
- package/dist/esm/components/image/image-thumbnail.js.map +1 -1
- package/dist/esm/components/image/thumbnail-replace-overlay.js +7 -0
- package/dist/esm/components/image/thumbnail-replace-overlay.js.map +1 -0
- package/dist/esm/components/image/thumbnail-replace-overlay.st.css +15 -0
- package/dist/esm/components/image/thumbnail-replace-overlay.st.css.js +15 -0
- package/dist/esm/components/image/thumbnail-replace-overlay.st.css.js.map +1 -0
- package/dist/esm/components/media-control/paste-url-button.st.css.js +2 -2
- package/dist/esm/components/media-control/use-media-control.js +9 -8
- package/dist/esm/components/media-control/use-media-control.js.map +1 -1
- package/dist/esm/components/media-gallery/form-media-gallery-field.st.css.js +2 -2
- package/dist/esm/components/media-image/media-image.st.css.js +3 -3
- package/dist/esm/components/media-image/media-image.st.css.js.map +1 -1
- package/dist/esm/components/media-image/overlays/overlay.st.css.js +3 -3
- package/dist/esm/components/media-image/overlays/overlay.st.css.js.map +1 -1
- package/dist/esm/components/media-loader/media-loader.st.css.js +2 -2
- package/dist/esm/components/media-tag/web-media-tag/media-tag.st.css.js +2 -2
- package/dist/esm/components/multi-document/multi-document-input/form-multi-document-field.js.map +1 -1
- package/dist/esm/components/multi-document/multi-document-input/form-multi-document-view.js.map +1 -1
- package/dist/esm/components/multi-document/multi-document-input/form-multi-document.st.css.js +2 -2
- package/dist/esm/components/multi-document/multi-document-input/form-multi-document.st.css.js.map +1 -1
- package/dist/esm/components/rich-content/cell-rich-content-input.js.map +1 -1
- package/dist/esm/components/rich-content/cell-rich-content-view.js +1 -1
- package/dist/esm/components/rich-content/cell-rich-content-view.js.map +1 -1
- package/dist/esm/components/rich-content/editor.js +1 -2
- package/dist/esm/components/rich-content/editor.js.map +1 -1
- package/dist/esm/components/rich-content/rich-content-input/default-value-input/rich-content-default-value-input.st.css.js +3 -3
- package/dist/esm/components/rich-content/rich-content-input/form-input/form-input.js +1 -1
- package/dist/esm/components/rich-content/rich-content-input/form-input/form-input.js.map +1 -1
- package/dist/esm/components/rich-content/rich-content-input/form-input/index.js +1 -1
- package/dist/esm/components/rich-content/rich-content-input/form-input/index.js.map +1 -1
- package/dist/esm/components/rich-content/rich-content-input/form-input/rich-content-form-input.st.css.js +3 -3
- package/dist/esm/components/rich-content/rich-content-input/form-read-only-input/rich-content-form-read-only-input.st.css.js +2 -2
- package/dist/esm/components/rich-content/rich-content-input/rich-content-common/fullscreen-modal/fullscreen-modal.st.css.js +2 -2
- package/dist/esm/components/rich-content/rich-content-input/rich-content-common/publish-loader/publish-loader.st.css.js +2 -2
- package/dist/esm/components/rich-content/rich-content-input/rich-content-common/toggle-fullscreen-button/toggle-fullscreen-button.st.css.js +2 -2
- package/dist/esm/components/rich-content/rich-content-input/rich-content-editor/rich-content-editor.st.css.js +3 -3
- package/dist/esm/components/rich-content/rich-content-input/rich-content-editor/rich-content-editor.st.css.js.map +1 -1
- package/dist/esm/components/rich-content/rich-content-input/rich-content-editor/rich-content-toolbar.st.css.js +2 -2
- package/dist/esm/components/rich-content/rich-content-input/rich-content-editor/rich-content-toolbar.st.css.js.map +1 -1
- package/dist/esm/components/rich-content/rich-content-input/rich-content-viewer/rich-content-viewer.st.css.js +2 -2
- package/dist/esm/components/rich-text/cell-rich-text-editor.js +85 -0
- package/dist/esm/components/rich-text/cell-rich-text-editor.js.map +1 -0
- package/dist/esm/components/rich-text/cell-rich-text-input.js +77 -0
- package/dist/esm/components/rich-text/cell-rich-text-input.js.map +1 -0
- package/dist/esm/components/rich-text/cell-rich-text-view.js +11 -0
- package/dist/esm/components/rich-text/cell-rich-text-view.js.map +1 -0
- package/dist/esm/components/rich-text/index.js +3 -0
- package/dist/esm/components/rich-text/index.js.map +1 -1
- package/dist/esm/components/rich-text/rich-text-input/rich-text-editor/rich-editor.js +14 -2
- package/dist/esm/components/rich-text/rich-text-input/rich-text-editor/rich-editor.js.map +1 -1
- package/dist/esm/components/rich-text/rich-text-input/rich-text-editor/rich-editor.st.css +26 -22
- package/dist/esm/components/rich-text/rich-text-input/rich-text-editor/rich-editor.st.css.js +4 -4
- package/dist/esm/components/rich-text/rich-text-input/rich-text-editor/rich-editor.st.css.js.map +1 -1
- package/dist/esm/components/rich-text/rich-text-input/rich-text-editor/rich-text-editor.st.css.js +2 -2
- package/dist/esm/components/rich-text/rich-text-input/rich-text-editor/toolbar/header-dropdown.js +64 -50
- package/dist/esm/components/rich-text/rich-text-input/rich-text-editor/toolbar/header-dropdown.js.map +1 -1
- package/dist/esm/components/rich-text/rich-text-input/rich-text-editor/toolbar/toolbar.st.css +13 -12
- package/dist/esm/components/rich-text/rich-text-input/rich-text-editor/toolbar/toolbar.st.css.js +3 -3
- package/dist/esm/components/rich-text/rich-text-input/rich-text-editor/toolbar/toolbar.st.css.js.map +1 -1
- package/dist/esm/components/text/text-view.st.css.js +2 -2
- package/dist/esm/components/video/cell-video-edit.js +159 -0
- package/dist/esm/components/video/cell-video-edit.js.map +1 -0
- package/dist/esm/components/video/index.js +1 -0
- package/dist/esm/components/video/index.js.map +1 -1
- package/dist/esm/exports/cell-rich-content-input.js +2 -0
- package/dist/esm/exports/cell-rich-content-input.js.map +1 -0
- package/dist/esm/exports/form-rich-content-input.js +1 -1
- package/dist/esm/exports/form-rich-content-input.js.map +1 -1
- package/dist/esm/index.js +1 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/styles.global.css +1 -1
- package/dist/types/components/address/input/address-input.st.css.d.ts.map +1 -1
- package/dist/types/components/audio/actions/actions-menu/actions-menu.st.css.d.ts.map +1 -1
- package/dist/types/components/image/cell-image-edit.d.ts.map +1 -1
- package/dist/types/components/image/image-thumbnail.d.ts +1 -0
- package/dist/types/components/image/image-thumbnail.d.ts.map +1 -1
- package/dist/types/components/image/thumbnail-replace-overlay.d.ts +3 -0
- package/dist/types/components/image/thumbnail-replace-overlay.d.ts.map +1 -0
- package/dist/types/components/image/thumbnail-replace-overlay.st.css.d.ts +14 -0
- package/dist/types/components/image/thumbnail-replace-overlay.st.css.d.ts.map +1 -0
- package/dist/types/components/media-control/use-media-control.d.ts +3 -3
- package/dist/types/components/media-control/use-media-control.d.ts.map +1 -1
- package/dist/types/components/media-gallery/media-gallery-dialog/hooks.d.ts +2 -2
- package/dist/types/components/media-image/media-image.st.css.d.ts.map +1 -1
- package/dist/types/components/media-image/overlays/overlay.st.css.d.ts.map +1 -1
- package/dist/types/components/multi-document/multi-document-input/form-multi-document-view.d.ts +1 -1
- package/dist/types/components/multi-document/multi-document-input/form-multi-document-view.d.ts.map +1 -1
- package/dist/types/components/multi-document/multi-document-input/form-multi-document.st.css.d.ts.map +1 -1
- package/dist/types/components/rich-content/cell-rich-content-input.d.ts.map +1 -1
- package/dist/types/components/rich-content/cell-rich-content-view.d.ts.map +1 -1
- package/dist/types/components/rich-content/editor.d.ts +1 -2
- package/dist/types/components/rich-content/editor.d.ts.map +1 -1
- package/dist/types/components/rich-content/rich-content-input/form-input/form-input.d.ts +1 -1
- package/dist/types/components/rich-content/rich-content-input/form-input/form-input.d.ts.map +1 -1
- package/dist/types/components/rich-content/rich-content-input/form-input/index.d.ts +1 -1
- package/dist/types/components/rich-content/rich-content-input/form-input/index.d.ts.map +1 -1
- package/dist/types/components/rich-content/rich-content-input/rich-content-editor/rich-content-editor.st.css.d.ts.map +1 -1
- package/dist/types/components/rich-content/rich-content-input/rich-content-editor/rich-content-toolbar.st.css.d.ts.map +1 -1
- package/dist/types/components/rich-text/cell-rich-text-editor.d.ts +21 -0
- package/dist/types/components/rich-text/cell-rich-text-editor.d.ts.map +1 -0
- package/dist/types/components/rich-text/cell-rich-text-input.d.ts +23 -0
- package/dist/types/components/rich-text/cell-rich-text-input.d.ts.map +1 -0
- package/dist/types/components/rich-text/cell-rich-text-view.d.ts +8 -0
- package/dist/types/components/rich-text/cell-rich-text-view.d.ts.map +1 -0
- package/dist/types/components/rich-text/index.d.ts +4 -0
- package/dist/types/components/rich-text/index.d.ts.map +1 -1
- package/dist/types/components/rich-text/rich-text-input/rich-text-editor/rich-editor.d.ts.map +1 -1
- package/dist/types/components/rich-text/rich-text-input/rich-text-editor/rich-editor.st.css.d.ts +4 -0
- package/dist/types/components/rich-text/rich-text-input/rich-text-editor/rich-editor.st.css.d.ts.map +1 -1
- package/dist/types/components/rich-text/rich-text-input/rich-text-editor/toolbar/header-dropdown.d.ts +1 -0
- package/dist/types/components/rich-text/rich-text-input/rich-text-editor/toolbar/header-dropdown.d.ts.map +1 -1
- package/dist/types/components/rich-text/rich-text-input/rich-text-editor/toolbar/toolbar.st.css.d.ts +3 -0
- package/dist/types/components/rich-text/rich-text-input/rich-text-editor/toolbar/toolbar.st.css.d.ts.map +1 -1
- package/dist/types/components/video/cell-video-edit.d.ts +20 -0
- package/dist/types/components/video/cell-video-edit.d.ts.map +1 -0
- package/dist/types/components/video/index.d.ts +2 -0
- package/dist/types/components/video/index.d.ts.map +1 -1
- package/dist/types/exports/cell-rich-content-input.d.ts +2 -0
- package/dist/types/exports/cell-rich-content-input.d.ts.map +1 -0
- package/dist/types/exports/form-rich-content-input.d.ts +1 -2
- package/dist/types/exports/form-rich-content-input.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/services/translations.d.ts +1 -1
- package/dist/types/services/translations.d.ts.map +1 -1
- package/package.json +11 -5
- package/src/assets/locale/messages_en.json +6 -2
- package/src/components/address/input/address-input.st.css.ts +2 -2
- package/src/components/audio/actions/actions-menu/actions-menu.st.css.ts +2 -2
- package/src/components/audio/audio-field/form-audio-field.st.css.ts +2 -2
- package/src/components/audio/audio-player/audio-player.st.css.ts +2 -2
- package/src/components/color-view/color-view.st.css.ts +2 -2
- package/src/components/delete-dialog/delete-dialog.st.css.ts +2 -2
- package/src/components/document/form-document-field.st.css.ts +2 -2
- package/src/components/exclamation/exclamation.st.css.ts +2 -2
- package/src/components/highlighted-text/highlighted-text.st.css.ts +3 -3
- package/src/components/image/cell-image-edit.tsx +4 -26
- package/src/components/image/image-thumbnail.tsx +10 -2
- package/src/components/image/thumbnail-replace-overlay.st.css +15 -0
- package/src/components/image/thumbnail-replace-overlay.st.css.ts +25 -0
- package/src/components/image/thumbnail-replace-overlay.tsx +11 -0
- package/src/components/media-control/paste-url-button.st.css.ts +2 -2
- package/src/components/media-control/use-media-control.ts +13 -13
- package/src/components/media-gallery/form-media-gallery-field.st.css.ts +2 -2
- package/src/components/media-image/media-image.st.css.ts +3 -3
- package/src/components/media-image/overlays/overlay.st.css.ts +3 -3
- package/src/components/media-loader/media-loader.st.css.ts +2 -2
- package/src/components/media-tag/web-media-tag/media-tag.st.css.ts +2 -2
- package/src/components/multi-document/multi-document-input/form-multi-document-field.tsx +1 -1
- package/src/components/multi-document/multi-document-input/form-multi-document-view.tsx +2 -2
- package/src/components/multi-document/multi-document-input/form-multi-document.st.css.ts +2 -2
- package/src/components/rich-content/cell-rich-content-input.tsx +2 -3
- package/src/components/rich-content/cell-rich-content-view.tsx +1 -4
- package/src/components/rich-content/editor.ts +1 -2
- package/src/components/rich-content/rich-content-input/default-value-input/rich-content-default-value-input.st.css.ts +3 -3
- package/src/components/rich-content/rich-content-input/form-input/form-input.tsx +1 -1
- package/src/components/rich-content/rich-content-input/form-input/index.ts +1 -1
- package/src/components/rich-content/rich-content-input/form-input/rich-content-form-input.st.css.ts +3 -3
- package/src/components/rich-content/rich-content-input/form-read-only-input/rich-content-form-read-only-input.st.css.ts +2 -2
- package/src/components/rich-content/rich-content-input/rich-content-common/fullscreen-modal/fullscreen-modal.st.css.ts +2 -2
- package/src/components/rich-content/rich-content-input/rich-content-common/publish-loader/publish-loader.st.css.ts +2 -2
- package/src/components/rich-content/rich-content-input/rich-content-common/toggle-fullscreen-button/toggle-fullscreen-button.st.css.ts +2 -2
- package/src/components/rich-content/rich-content-input/rich-content-editor/rich-content-editor.st.css.ts +3 -3
- package/src/components/rich-content/rich-content-input/rich-content-editor/rich-content-toolbar.st.css.ts +2 -2
- package/src/components/rich-content/rich-content-input/rich-content-viewer/rich-content-viewer.st.css.ts +2 -2
- package/src/components/rich-text/cell-rich-text-editor.tsx +173 -0
- package/src/components/rich-text/cell-rich-text-input.tsx +126 -0
- package/src/components/rich-text/cell-rich-text-view.tsx +19 -0
- package/src/components/rich-text/index.ts +4 -0
- package/src/components/rich-text/rich-text-input/rich-text-editor/rich-editor.st.css +26 -22
- package/src/components/rich-text/rich-text-input/rich-text-editor/rich-editor.st.css.ts +4 -4
- package/src/components/rich-text/rich-text-input/rich-text-editor/rich-editor.tsx +22 -5
- package/src/components/rich-text/rich-text-input/rich-text-editor/rich-text-editor.st.css.ts +2 -2
- package/src/components/rich-text/rich-text-input/rich-text-editor/toolbar/header-dropdown.tsx +153 -126
- package/src/components/rich-text/rich-text-input/rich-text-editor/toolbar/toolbar.st.css +13 -12
- package/src/components/rich-text/rich-text-input/rich-text-editor/toolbar/toolbar.st.css.ts +3 -3
- package/src/components/text/text-view.st.css.ts +2 -2
- package/src/components/video/cell-video-edit.tsx +308 -0
- package/src/components/video/index.ts +2 -0
- package/src/exports/cell-rich-content-input.ts +4 -0
- package/src/exports/form-rich-content-input.ts +1 -5
- package/src/index.ts +1 -0
- package/src/services/translations.ts +5 -1
- package/src/styles.global.css +1 -1
|
@@ -5,7 +5,7 @@ import { classesRuntime, statesRuntime } from "../../../stylable-esm-runtime.js"
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var _namespace_ = "
|
|
8
|
+
var _namespace_ = "overlay564791231";
|
|
9
9
|
var _style_ = classesRuntime.bind(null, _namespace_);
|
|
10
10
|
|
|
11
11
|
export var cssStates = statesRuntime.bind(null, _namespace_);
|
|
@@ -13,12 +13,12 @@ export var style: import("@stylable/runtime").STFunction = _style_;
|
|
|
13
13
|
export var st: import("@stylable/runtime").STFunction = _style_;
|
|
14
14
|
|
|
15
15
|
export var namespace = _namespace_;
|
|
16
|
-
export var classes = {"root":"
|
|
16
|
+
export var classes = {"root":"overlay564791231__root","iconOverlay":"overlay564791231__iconOverlay"};
|
|
17
17
|
export var keyframes = {};
|
|
18
18
|
export var layers = {};
|
|
19
19
|
export var containers = {};
|
|
20
20
|
export var stVars = {"iconShadow":"drop-shadow(0 1px 1px rgba(22, 45, 61, 0.6))"};
|
|
21
|
-
export var vars = {"wds-color-white":"--wds-color-white","wsr-color-D80":"--
|
|
21
|
+
export var vars = {"wds-color-white":"--wds-color-white","wsr-color-D80":"--overlay564791231-wsr-color-D80"};
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
|
|
@@ -5,7 +5,7 @@ import { classesRuntime, statesRuntime } from "../../stylable-esm-runtime.js";
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var _namespace_ = "
|
|
8
|
+
var _namespace_ = "medialoader4170719626";
|
|
9
9
|
var _style_ = classesRuntime.bind(null, _namespace_);
|
|
10
10
|
|
|
11
11
|
export var cssStates = statesRuntime.bind(null, _namespace_);
|
|
@@ -13,7 +13,7 @@ export var style: import("@stylable/runtime").STFunction = _style_;
|
|
|
13
13
|
export var st: import("@stylable/runtime").STFunction = _style_;
|
|
14
14
|
|
|
15
15
|
export var namespace = _namespace_;
|
|
16
|
-
export var classes = {"root":"
|
|
16
|
+
export var classes = {"root":"medialoader4170719626__root","loader":"medialoader4170719626__loader"};
|
|
17
17
|
export var keyframes = {};
|
|
18
18
|
export var layers = {};
|
|
19
19
|
export var containers = {};
|
|
@@ -5,7 +5,7 @@ import { classesRuntime, statesRuntime } from "../../../stylable-esm-runtime.js"
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var _namespace_ = "
|
|
8
|
+
var _namespace_ = "mediatag3281460592";
|
|
9
9
|
var _style_ = classesRuntime.bind(null, _namespace_);
|
|
10
10
|
|
|
11
11
|
export var cssStates = statesRuntime.bind(null, _namespace_);
|
|
@@ -13,7 +13,7 @@ export var style: import("@stylable/runtime").STFunction = _style_;
|
|
|
13
13
|
export var st: import("@stylable/runtime").STFunction = _style_;
|
|
14
14
|
|
|
15
15
|
export var namespace = _namespace_;
|
|
16
|
-
export var classes = {"root":"
|
|
16
|
+
export var classes = {"root":"mediatag3281460592__root"};
|
|
17
17
|
export var keyframes = {};
|
|
18
18
|
export var layers = {};
|
|
19
19
|
export var containers = {};
|
|
@@ -83,7 +83,7 @@ export const FormMultiDocumentField: React.FC<
|
|
|
83
83
|
loading={loading}
|
|
84
84
|
error={invalid}
|
|
85
85
|
loaderBorderStyle="dashed"
|
|
86
|
-
onAddButtonClick={callMedia as () => Promise<
|
|
86
|
+
onAddButtonClick={callMedia as () => Promise<boolean>}
|
|
87
87
|
onPasteURLButtonClick={onOpen({
|
|
88
88
|
title: t('CMS.document.pasteUrl.title'),
|
|
89
89
|
})}
|
|
@@ -14,7 +14,7 @@ interface FormMultiDocumentViewProps {
|
|
|
14
14
|
data: string[];
|
|
15
15
|
readOnly?: boolean;
|
|
16
16
|
onChange: (value: string[]) => void;
|
|
17
|
-
callMedia: (index?: number) => Promise<
|
|
17
|
+
callMedia: (index?: number) => Promise<boolean>;
|
|
18
18
|
onDownload: (mediaURI?: string) => void;
|
|
19
19
|
loading: boolean;
|
|
20
20
|
dataHook?: string;
|
|
@@ -83,7 +83,7 @@ export const FormMultiDocumentView = React.forwardRef<
|
|
|
83
83
|
dataHook="multi-document-field-add-document-button"
|
|
84
84
|
theme="plain"
|
|
85
85
|
disabled={readOnly}
|
|
86
|
-
onClick={callMedia as () => Promise<
|
|
86
|
+
onClick={callMedia as () => Promise<boolean>}
|
|
87
87
|
className={classes.addDocumentButton}
|
|
88
88
|
loading={replacedDocumentIndex === null ? loading : false}
|
|
89
89
|
/>
|
|
@@ -5,7 +5,7 @@ import { classesRuntime, statesRuntime } from "../../../stylable-esm-runtime.js"
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var _namespace_ = "
|
|
8
|
+
var _namespace_ = "formmultidocument970791185";
|
|
9
9
|
var _style_ = classesRuntime.bind(null, _namespace_);
|
|
10
10
|
|
|
11
11
|
export var cssStates = statesRuntime.bind(null, _namespace_);
|
|
@@ -13,7 +13,7 @@ export var style: import("@stylable/runtime").STFunction = _style_;
|
|
|
13
13
|
export var st: import("@stylable/runtime").STFunction = _style_;
|
|
14
14
|
|
|
15
15
|
export var namespace = _namespace_;
|
|
16
|
-
export var classes = {"root":"
|
|
16
|
+
export var classes = {"root":"formmultidocument970791185__root","viewRoot":"formmultidocument970791185__viewRoot","singleViewWrapper":"formmultidocument970791185__singleViewWrapper","addDocumentButton":"formmultidocument970791185__addDocumentButton"};
|
|
17
17
|
export var keyframes = {};
|
|
18
18
|
export var layers = {};
|
|
19
19
|
export var containers = {};
|
|
@@ -41,9 +41,8 @@ export const CellRichContentInput: React.FC<CellRichContentInputProps> = ({
|
|
|
41
41
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
42
42
|
}, []); // Deliberately run only on mount — typed key is a one-shot initializer
|
|
43
43
|
|
|
44
|
-
const [localValue, setLocalValue, injectedValue] =
|
|
45
|
-
initialContent
|
|
46
|
-
);
|
|
44
|
+
const [localValue, setLocalValue, injectedValue] =
|
|
45
|
+
useRichContentState(initialContent);
|
|
47
46
|
|
|
48
47
|
const handleChange = useCallback(
|
|
49
48
|
(content: RichContent) => setLocalValue(content),
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
// Heavy exports - these pull in @wix/ricos editor/viewer (~300kb+ gzipped)
|
|
2
2
|
// Only import this file when you actually need the rich content editor
|
|
3
|
-
export {
|
|
4
|
-
export * from './cell-rich-content-input';
|
|
3
|
+
export { FormRichContentInput } from './rich-content-input/form-input';
|
|
5
4
|
export * from './hooks';
|
|
6
5
|
export * from './rich-content-input/rich-content-editor';
|
|
@@ -5,7 +5,7 @@ import { classesRuntime, statesRuntime } from "../../../../stylable-esm-runtime.
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var _namespace_ = "
|
|
8
|
+
var _namespace_ = "richcontentdefaultvalueinput2964969043";
|
|
9
9
|
var _style_ = classesRuntime.bind(null, _namespace_);
|
|
10
10
|
|
|
11
11
|
export var cssStates = statesRuntime.bind(null, _namespace_);
|
|
@@ -13,12 +13,12 @@ export var style: import("@stylable/runtime").STFunction = _style_;
|
|
|
13
13
|
export var st: import("@stylable/runtime").STFunction = _style_;
|
|
14
14
|
|
|
15
15
|
export var namespace = _namespace_;
|
|
16
|
-
export var classes = {"root":"
|
|
16
|
+
export var classes = {"root":"richcontentdefaultvalueinput2964969043__root","richContentEditorContainer":"richcontentdefaultvalueinput2964969043__richContentEditorContainer","editor":"richcontentdefaultvalueinput2964969043__editor"};
|
|
17
17
|
export var keyframes = {};
|
|
18
18
|
export var layers = {};
|
|
19
19
|
export var containers = {};
|
|
20
20
|
export var stVars = {};
|
|
21
|
-
export var vars = {"topToolbarHeight":"--
|
|
21
|
+
export var vars = {"topToolbarHeight":"--richcontentdefaultvalueinput2964969043-topToolbarHeight","bottomToolbarHeight":"--richcontentdefaultvalueinput2964969043-bottomToolbarHeight"};
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
|
|
@@ -11,7 +11,7 @@ export type FormRichContentInputProps = RichContentFormInputProps & {
|
|
|
11
11
|
isSiteMetadataLoading: boolean;
|
|
12
12
|
};
|
|
13
13
|
|
|
14
|
-
const FormRichContentInput: FC<FormRichContentInputProps> = ({
|
|
14
|
+
export const FormRichContentInput: FC<FormRichContentInputProps> = ({
|
|
15
15
|
isSiteMetadataLoading,
|
|
16
16
|
...props
|
|
17
17
|
}) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { FormRichContentInput } from './form-input';
|
package/src/components/rich-content/rich-content-input/form-input/rich-content-form-input.st.css.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { classesRuntime, statesRuntime } from "../../../../stylable-esm-runtime.
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var _namespace_ = "
|
|
8
|
+
var _namespace_ = "richcontentforminput1732387906";
|
|
9
9
|
var _style_ = classesRuntime.bind(null, _namespace_);
|
|
10
10
|
|
|
11
11
|
export var cssStates = statesRuntime.bind(null, _namespace_);
|
|
@@ -13,12 +13,12 @@ export var style: import("@stylable/runtime").STFunction = _style_;
|
|
|
13
13
|
export var st: import("@stylable/runtime").STFunction = _style_;
|
|
14
14
|
|
|
15
15
|
export var namespace = _namespace_;
|
|
16
|
-
export var classes = {"root":"
|
|
16
|
+
export var classes = {"root":"richcontentforminput1732387906__root","editor":"richcontentforminput1732387906__editor"};
|
|
17
17
|
export var keyframes = {};
|
|
18
18
|
export var layers = {};
|
|
19
19
|
export var containers = {};
|
|
20
20
|
export var stVars = {};
|
|
21
|
-
export var vars = {"wds-color-blue-300":"--wds-color-blue-300","wds-border-radius-300":"--wds-border-radius-300","wds-color-blue-100":"--wds-color-blue-100","wds-input-shadow-focus-standard":"--wds-input-shadow-focus-standard","topToolbarHeight":"--
|
|
21
|
+
export var vars = {"wds-color-blue-300":"--wds-color-blue-300","wds-border-radius-300":"--wds-border-radius-300","wds-color-blue-100":"--wds-color-blue-100","wds-input-shadow-focus-standard":"--wds-input-shadow-focus-standard","topToolbarHeight":"--richcontentforminput1732387906-topToolbarHeight","bottomToolbarHeight":"--richcontentforminput1732387906-bottomToolbarHeight"};
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
|
|
@@ -5,7 +5,7 @@ import { classesRuntime, statesRuntime } from "../../../../stylable-esm-runtime.
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var _namespace_ = "
|
|
8
|
+
var _namespace_ = "richcontentformreadonlyinput2090554515";
|
|
9
9
|
var _style_ = classesRuntime.bind(null, _namespace_);
|
|
10
10
|
|
|
11
11
|
export var cssStates = statesRuntime.bind(null, _namespace_);
|
|
@@ -13,7 +13,7 @@ export var style: import("@stylable/runtime").STFunction = _style_;
|
|
|
13
13
|
export var st: import("@stylable/runtime").STFunction = _style_;
|
|
14
14
|
|
|
15
15
|
export var namespace = _namespace_;
|
|
16
|
-
export var classes = {"root":"
|
|
16
|
+
export var classes = {"root":"richcontentformreadonlyinput2090554515__root"};
|
|
17
17
|
export var keyframes = {};
|
|
18
18
|
export var layers = {};
|
|
19
19
|
export var containers = {};
|
|
@@ -5,7 +5,7 @@ import { classesRuntime, statesRuntime } from "../../../../../stylable-esm-runti
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var _namespace_ = "
|
|
8
|
+
var _namespace_ = "fullscreenmodal4100765582";
|
|
9
9
|
var _style_ = classesRuntime.bind(null, _namespace_);
|
|
10
10
|
|
|
11
11
|
export var cssStates = statesRuntime.bind(null, _namespace_);
|
|
@@ -13,7 +13,7 @@ export var style: import("@stylable/runtime").STFunction = _style_;
|
|
|
13
13
|
export var st: import("@stylable/runtime").STFunction = _style_;
|
|
14
14
|
|
|
15
15
|
export var namespace = _namespace_;
|
|
16
|
-
export var classes = {"root":"
|
|
16
|
+
export var classes = {"root":"fullscreenmodal4100765582__root","modalContent":"fullscreenmodal4100765582__modalContent"};
|
|
17
17
|
export var keyframes = {};
|
|
18
18
|
export var layers = {};
|
|
19
19
|
export var containers = {};
|
|
@@ -5,7 +5,7 @@ import { classesRuntime, statesRuntime } from "../../../../../stylable-esm-runti
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var _namespace_ = "
|
|
8
|
+
var _namespace_ = "publishloader2391227011";
|
|
9
9
|
var _style_ = classesRuntime.bind(null, _namespace_);
|
|
10
10
|
|
|
11
11
|
export var cssStates = statesRuntime.bind(null, _namespace_);
|
|
@@ -13,7 +13,7 @@ export var style: import("@stylable/runtime").STFunction = _style_;
|
|
|
13
13
|
export var st: import("@stylable/runtime").STFunction = _style_;
|
|
14
14
|
|
|
15
15
|
export var namespace = _namespace_;
|
|
16
|
-
export var classes = {"root":"
|
|
16
|
+
export var classes = {"root":"publishloader2391227011__root","publishLoader":"publishloader2391227011__publishLoader"};
|
|
17
17
|
export var keyframes = {};
|
|
18
18
|
export var layers = {};
|
|
19
19
|
export var containers = {};
|
|
@@ -5,7 +5,7 @@ import { classesRuntime, statesRuntime } from "../../../../../stylable-esm-runti
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var _namespace_ = "
|
|
8
|
+
var _namespace_ = "togglefullscreenbutton2566773121";
|
|
9
9
|
var _style_ = classesRuntime.bind(null, _namespace_);
|
|
10
10
|
|
|
11
11
|
export var cssStates = statesRuntime.bind(null, _namespace_);
|
|
@@ -13,7 +13,7 @@ export var style: import("@stylable/runtime").STFunction = _style_;
|
|
|
13
13
|
export var st: import("@stylable/runtime").STFunction = _style_;
|
|
14
14
|
|
|
15
15
|
export var namespace = _namespace_;
|
|
16
|
-
export var classes = {"root":"
|
|
16
|
+
export var classes = {"root":"togglefullscreenbutton2566773121__root"};
|
|
17
17
|
export var keyframes = {};
|
|
18
18
|
export var layers = {};
|
|
19
19
|
export var containers = {};
|
|
@@ -5,7 +5,7 @@ import { classesRuntime, statesRuntime } from "../../../../stylable-esm-runtime.
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var _namespace_ = "
|
|
8
|
+
var _namespace_ = "richcontenteditor837972361";
|
|
9
9
|
var _style_ = classesRuntime.bind(null, _namespace_);
|
|
10
10
|
|
|
11
11
|
export var cssStates = statesRuntime.bind(null, _namespace_);
|
|
@@ -13,12 +13,12 @@ export var style: import("@stylable/runtime").STFunction = _style_;
|
|
|
13
13
|
export var st: import("@stylable/runtime").STFunction = _style_;
|
|
14
14
|
|
|
15
15
|
export var namespace = _namespace_;
|
|
16
|
-
export var classes = {"root":"
|
|
16
|
+
export var classes = {"root":"richcontenteditor837972361__root","toolbarContainer":"richcontenteditor837972361__toolbarContainer","footerToolbarContainer":"richcontenteditor837972361__footerToolbarContainer","toolbarAndFullScreenButtonWrapper":"richcontenteditor837972361__toolbarAndFullScreenButtonWrapper","editor":"richcontenteditor837972361__editor","modalEditor":"richcontenteditor837972361__modalEditor"};
|
|
17
17
|
export var keyframes = {};
|
|
18
18
|
export var layers = {};
|
|
19
19
|
export var containers = {};
|
|
20
20
|
export var stVars = {};
|
|
21
|
-
export var vars = {"wds-font-family-default":"--
|
|
21
|
+
export var vars = {"wds-font-family-default":"--richcontenteditor837972361-wds-font-family-default"};
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
|
|
@@ -5,7 +5,7 @@ import { classesRuntime, statesRuntime } from "../../../../stylable-esm-runtime.
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var _namespace_ = "
|
|
8
|
+
var _namespace_ = "richcontenttoolbar664632995";
|
|
9
9
|
var _style_ = classesRuntime.bind(null, _namespace_);
|
|
10
10
|
|
|
11
11
|
export var cssStates = statesRuntime.bind(null, _namespace_);
|
|
@@ -13,7 +13,7 @@ export var style: import("@stylable/runtime").STFunction = _style_;
|
|
|
13
13
|
export var st: import("@stylable/runtime").STFunction = _style_;
|
|
14
14
|
|
|
15
15
|
export var namespace = _namespace_;
|
|
16
|
-
export var classes = {"root":"
|
|
16
|
+
export var classes = {"root":"richcontenttoolbar664632995__root","toolbar":"richcontenttoolbar664632995__toolbar","toolbarButton":"richcontenttoolbar664632995__toolbarButton"};
|
|
17
17
|
export var keyframes = {};
|
|
18
18
|
export var layers = {};
|
|
19
19
|
export var containers = {};
|
|
@@ -5,7 +5,7 @@ import { classesRuntime, statesRuntime } from "../../../../stylable-esm-runtime.
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var _namespace_ = "
|
|
8
|
+
var _namespace_ = "richcontentviewer1273185044";
|
|
9
9
|
var _style_ = classesRuntime.bind(null, _namespace_);
|
|
10
10
|
|
|
11
11
|
export var cssStates = statesRuntime.bind(null, _namespace_);
|
|
@@ -13,7 +13,7 @@ export var style: import("@stylable/runtime").STFunction = _style_;
|
|
|
13
13
|
export var st: import("@stylable/runtime").STFunction = _style_;
|
|
14
14
|
|
|
15
15
|
export var namespace = _namespace_;
|
|
16
|
-
export var classes = {"root":"
|
|
16
|
+
export var classes = {"root":"richcontentviewer1273185044__root","viewer":"richcontentviewer1273185044__viewer","modalViewer":"richcontentviewer1273185044__modalViewer"};
|
|
17
17
|
export var keyframes = {};
|
|
18
18
|
export var layers = {};
|
|
19
19
|
export var containers = {};
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import React, { useCallback, useMemo, useRef, useState } from 'react';
|
|
2
|
+
import { EditorState } from 'draft-js';
|
|
3
|
+
import { Modal } from '@wix/design-system';
|
|
4
|
+
|
|
5
|
+
import { HTMLToText } from '../../auto-field-types';
|
|
6
|
+
import { compositeDecorator } from './rich-text-input/rich-text-editor/composite-decorator';
|
|
7
|
+
import {
|
|
8
|
+
htmlToEditorState,
|
|
9
|
+
editorStateToHTML,
|
|
10
|
+
} from './rich-text-input/rich-text-editor/utils';
|
|
11
|
+
import type {
|
|
12
|
+
CustomStyleMap,
|
|
13
|
+
InlineStyles,
|
|
14
|
+
} from './rich-text-input/rich-text-editor/utils';
|
|
15
|
+
import { RichEditor } from './rich-text-input/rich-text-editor/rich-editor';
|
|
16
|
+
import { combineClasses } from './rich-text-input/rich-text-editor/utils/stylable-helper';
|
|
17
|
+
import {
|
|
18
|
+
style,
|
|
19
|
+
classes,
|
|
20
|
+
} from './rich-text-input/rich-text-editor/rich-text-editor.st.css.js';
|
|
21
|
+
import type { RichTextStyleVariables } from './rich-text-input/rich-text-editor/text-style';
|
|
22
|
+
|
|
23
|
+
const EDITING_OPTIONS = { headingsEnabled: true };
|
|
24
|
+
|
|
25
|
+
/** Default text style — matches the CSS fallback values in rich-editor.st.css.
|
|
26
|
+
* Consumers (e.g. cms-web) can override with site-specific font values. */
|
|
27
|
+
export const DEFAULT_CELL_TEXT_STYLE: RichTextStyleVariables = {
|
|
28
|
+
'--rt-h1-fontSize': '72px',
|
|
29
|
+
'--rt-h1-fontStyle': 'normal',
|
|
30
|
+
'--rt-h1-fontWeight': '700',
|
|
31
|
+
'--rt-h1-lineHeight': '1.33',
|
|
32
|
+
'--rt-h2-fontSize': '42px',
|
|
33
|
+
'--rt-h2-fontStyle': 'normal',
|
|
34
|
+
'--rt-h2-fontWeight': '700',
|
|
35
|
+
'--rt-h2-lineHeight': '1.2',
|
|
36
|
+
'--rt-h3-fontSize': '38px',
|
|
37
|
+
'--rt-h3-fontStyle': 'normal',
|
|
38
|
+
'--rt-h3-fontWeight': '500',
|
|
39
|
+
'--rt-h3-lineHeight': '1.2',
|
|
40
|
+
'--rt-h4-fontSize': '34px',
|
|
41
|
+
'--rt-h4-fontStyle': 'normal',
|
|
42
|
+
'--rt-h4-fontWeight': '700',
|
|
43
|
+
'--rt-h4-lineHeight': '1.2',
|
|
44
|
+
'--rt-h5-fontSize': '28px',
|
|
45
|
+
'--rt-h5-fontStyle': 'normal',
|
|
46
|
+
'--rt-h5-fontWeight': '700',
|
|
47
|
+
'--rt-h5-lineHeight': '1.2',
|
|
48
|
+
'--rt-h6-fontSize': '22px',
|
|
49
|
+
'--rt-h6-fontStyle': 'normal',
|
|
50
|
+
'--rt-h6-fontWeight': '500',
|
|
51
|
+
'--rt-h6-lineHeight': '1.2',
|
|
52
|
+
'--rt-p1-fontSize': '18px',
|
|
53
|
+
'--rt-p1-fontStyle': 'normal',
|
|
54
|
+
'--rt-p1-fontWeight': '500',
|
|
55
|
+
'--rt-p1-lineHeight': '24px',
|
|
56
|
+
'--rt-unstyled-fontSize': '16px',
|
|
57
|
+
'--rt-unstyled-fontStyle': 'normal',
|
|
58
|
+
'--rt-unstyled-fontWeight': '500',
|
|
59
|
+
'--rt-unstyled-lineHeight': '24px',
|
|
60
|
+
'--rt-p3-fontSize': '14px',
|
|
61
|
+
'--rt-p3-fontStyle': 'normal',
|
|
62
|
+
'--rt-p3-fontWeight': '500',
|
|
63
|
+
'--rt-p3-lineHeight': '18px',
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
function buildInitialHtml(
|
|
67
|
+
value?: string,
|
|
68
|
+
typedKey?: string,
|
|
69
|
+
): string | undefined {
|
|
70
|
+
if (!typedKey) return value;
|
|
71
|
+
const existing = value ? HTMLToText(value) : '';
|
|
72
|
+
return `<p>${existing}${typedKey}</p>`;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export interface CellRichTextEditorProps {
|
|
76
|
+
value?: string;
|
|
77
|
+
onChange: (value: string) => void;
|
|
78
|
+
autoFocus?: boolean;
|
|
79
|
+
initialTypedKey?: string;
|
|
80
|
+
/** Controlled fullscreen state — managed by the parent (CellRichTextInput). */
|
|
81
|
+
isFullScreen?: boolean;
|
|
82
|
+
onToggleFullScreen?: () => void;
|
|
83
|
+
/** CSS custom properties for the --rt-* theming API. Defaults to standard sizes. */
|
|
84
|
+
textStyle?: RichTextStyleVariables;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/** Cell-layer Draft.js editor — fires onChange on every keystroke (not on blur).
|
|
88
|
+
* Fullscreen state is controlled by the parent so ESC handling can be
|
|
89
|
+
* centralised in a capture-phase listener without React portal limitations. */
|
|
90
|
+
export const CellRichTextEditor: React.FC<CellRichTextEditorProps> = ({
|
|
91
|
+
value,
|
|
92
|
+
onChange,
|
|
93
|
+
autoFocus,
|
|
94
|
+
initialTypedKey,
|
|
95
|
+
isFullScreen = false,
|
|
96
|
+
onToggleFullScreen,
|
|
97
|
+
textStyle = DEFAULT_CELL_TEXT_STYLE,
|
|
98
|
+
}) => {
|
|
99
|
+
const initialHtml = useMemo(
|
|
100
|
+
() => buildInitialHtml(value, initialTypedKey),
|
|
101
|
+
// Deliberately computed only on mount — typed key is a one-shot initializer.
|
|
102
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
103
|
+
[],
|
|
104
|
+
);
|
|
105
|
+
|
|
106
|
+
const {
|
|
107
|
+
editorState: initialEditorState,
|
|
108
|
+
customStyleMap,
|
|
109
|
+
inlineStyles,
|
|
110
|
+
} = useMemo(
|
|
111
|
+
() => htmlToEditorState(initialHtml, compositeDecorator, EDITING_OPTIONS),
|
|
112
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
113
|
+
[],
|
|
114
|
+
);
|
|
115
|
+
|
|
116
|
+
const [editorState, setEditorState] =
|
|
117
|
+
useState<EditorState>(initialEditorState);
|
|
118
|
+
const inlineStylesRef = useRef<InlineStyles>(inlineStyles);
|
|
119
|
+
const customStyleMapRef = useRef<CustomStyleMap>(customStyleMap);
|
|
120
|
+
|
|
121
|
+
const handleChange = useCallback(
|
|
122
|
+
(newState: EditorState) => {
|
|
123
|
+
setEditorState(newState);
|
|
124
|
+
const html = editorStateToHTML(
|
|
125
|
+
newState,
|
|
126
|
+
inlineStylesRef.current,
|
|
127
|
+
EDITING_OPTIONS,
|
|
128
|
+
);
|
|
129
|
+
onChange(html);
|
|
130
|
+
},
|
|
131
|
+
[onChange],
|
|
132
|
+
);
|
|
133
|
+
|
|
134
|
+
return (
|
|
135
|
+
<>
|
|
136
|
+
{!isFullScreen && (
|
|
137
|
+
<div style={textStyle as React.CSSProperties}>
|
|
138
|
+
<RichEditor
|
|
139
|
+
editorState={editorState}
|
|
140
|
+
customStyleMap={customStyleMapRef.current}
|
|
141
|
+
onChange={handleChange}
|
|
142
|
+
onToggleFullScreen={onToggleFullScreen}
|
|
143
|
+
isFullScreen={false}
|
|
144
|
+
autoFocus={autoFocus}
|
|
145
|
+
headingsEnabled
|
|
146
|
+
/>
|
|
147
|
+
</div>
|
|
148
|
+
)}
|
|
149
|
+
{isFullScreen && (
|
|
150
|
+
<Modal screen="desktop" isOpen>
|
|
151
|
+
<div
|
|
152
|
+
className={combineClasses(style, classes.editor, {
|
|
153
|
+
isFullScreen: true,
|
|
154
|
+
})}
|
|
155
|
+
style={textStyle as React.CSSProperties}
|
|
156
|
+
>
|
|
157
|
+
<RichEditor
|
|
158
|
+
editorState={editorState}
|
|
159
|
+
customStyleMap={customStyleMapRef.current}
|
|
160
|
+
onChange={handleChange}
|
|
161
|
+
onToggleFullScreen={onToggleFullScreen}
|
|
162
|
+
isFullScreen
|
|
163
|
+
autoFocus
|
|
164
|
+
headingsEnabled
|
|
165
|
+
/>
|
|
166
|
+
</div>
|
|
167
|
+
</Modal>
|
|
168
|
+
)}
|
|
169
|
+
</>
|
|
170
|
+
);
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
CellRichTextEditor.displayName = 'CellRichTextEditor';
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
|
2
|
+
import { Popover } from '@wix/design-system';
|
|
3
|
+
|
|
4
|
+
import {
|
|
5
|
+
CellRichTextEditor,
|
|
6
|
+
DEFAULT_CELL_TEXT_STYLE,
|
|
7
|
+
} from './cell-rich-text-editor';
|
|
8
|
+
import type { RichTextStyleVariables } from './rich-text-input/rich-text-editor/text-style';
|
|
9
|
+
|
|
10
|
+
/** Fixed popover width matching the CMS rich text editor (popover-rich-text-editor.tsx). */
|
|
11
|
+
const POPOVER_WIDTH = 582;
|
|
12
|
+
|
|
13
|
+
export interface CellRichTextInputProps {
|
|
14
|
+
value?: string;
|
|
15
|
+
onChange: (value: string) => void;
|
|
16
|
+
/** Typed key from type-to-edit — appended to existing plain-text content on mount. */
|
|
17
|
+
initialTypedKey?: string;
|
|
18
|
+
/** Called when the editor loses focus (click outside) or ESC is pressed. */
|
|
19
|
+
onCommit?: () => void;
|
|
20
|
+
/** CSS custom properties for the --rt-* theming API. Defaults to standard sizes. */
|
|
21
|
+
textStyle?: RichTextStyleVariables;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/** Popover-based rich text editor for the richText cell type.
|
|
25
|
+
* Opens immediately as a popover anchored at the cell's top-left corner.
|
|
26
|
+
* Fixed 582px width (matching CMS), covers adjacent cells, flips upward when
|
|
27
|
+
* there is not enough room below. Changes are propagated live via onChange.
|
|
28
|
+
*
|
|
29
|
+
* Close behaviour mirrors cms-web PopoverRichTextEditor: the editor listens for
|
|
30
|
+
* focus/blur events on a wrapper div. onBlur schedules onCommit via
|
|
31
|
+
* requestAnimationFrame so toolbar actions (including dropdown selections in
|
|
32
|
+
* window portals) can cancel the deferred close by refocusing the editor. */
|
|
33
|
+
export const CellRichTextInput: React.FC<CellRichTextInputProps> = ({
|
|
34
|
+
value,
|
|
35
|
+
onChange,
|
|
36
|
+
initialTypedKey,
|
|
37
|
+
onCommit,
|
|
38
|
+
textStyle = DEFAULT_CELL_TEXT_STYLE,
|
|
39
|
+
}) => {
|
|
40
|
+
const [isFullScreen, setIsFullScreen] = useState(false);
|
|
41
|
+
const isFullScreenRef = useRef(false);
|
|
42
|
+
const blurFrameIdRef = useRef(0);
|
|
43
|
+
|
|
44
|
+
const handleToggleFullScreen = useCallback(() => {
|
|
45
|
+
setIsFullScreen((prev) => {
|
|
46
|
+
const next = !prev;
|
|
47
|
+
isFullScreenRef.current = next;
|
|
48
|
+
return next;
|
|
49
|
+
});
|
|
50
|
+
}, []);
|
|
51
|
+
|
|
52
|
+
const handleFocus = useCallback(() => {
|
|
53
|
+
cancelAnimationFrame(blurFrameIdRef.current);
|
|
54
|
+
}, []);
|
|
55
|
+
|
|
56
|
+
const handleBlur = useCallback(() => {
|
|
57
|
+
cancelAnimationFrame(blurFrameIdRef.current);
|
|
58
|
+
blurFrameIdRef.current = requestAnimationFrame(() => {
|
|
59
|
+
if (!isFullScreenRef.current) {
|
|
60
|
+
onCommit?.();
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
}, [onCommit]);
|
|
64
|
+
|
|
65
|
+
// Capture-phase native listener fires before ALL React bubble-phase handlers
|
|
66
|
+
// (including useKeyboardNavigation which would call cancelEdit() on ESC).
|
|
67
|
+
// stopPropagation() prevents the event from reaching any bubble-phase handler.
|
|
68
|
+
useEffect(() => {
|
|
69
|
+
const handleKeyDown = (e: KeyboardEvent) => {
|
|
70
|
+
if (e.key !== 'Escape') return;
|
|
71
|
+
e.stopPropagation();
|
|
72
|
+
if (isFullScreenRef.current) {
|
|
73
|
+
setIsFullScreen(false);
|
|
74
|
+
isFullScreenRef.current = false;
|
|
75
|
+
} else {
|
|
76
|
+
cancelAnimationFrame(blurFrameIdRef.current);
|
|
77
|
+
onCommit?.();
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
document.addEventListener('keydown', handleKeyDown, true);
|
|
81
|
+
return () => document.removeEventListener('keydown', handleKeyDown, true);
|
|
82
|
+
}, [onCommit]);
|
|
83
|
+
|
|
84
|
+
return (
|
|
85
|
+
// Zero-height anchor at the cell's top-left so the popover opens from there.
|
|
86
|
+
<div
|
|
87
|
+
style={{
|
|
88
|
+
position: 'absolute',
|
|
89
|
+
top: 0,
|
|
90
|
+
left: 0,
|
|
91
|
+
width: '100%',
|
|
92
|
+
height: 0,
|
|
93
|
+
overflow: 'visible',
|
|
94
|
+
fontSize: 0,
|
|
95
|
+
lineHeight: 0,
|
|
96
|
+
}}
|
|
97
|
+
>
|
|
98
|
+
<Popover
|
|
99
|
+
shown
|
|
100
|
+
placement="bottom-start"
|
|
101
|
+
appendTo="window"
|
|
102
|
+
width={POPOVER_WIDTH}
|
|
103
|
+
zIndex={5001}
|
|
104
|
+
>
|
|
105
|
+
<Popover.Element>
|
|
106
|
+
<div style={{ width: '100%', height: 0 }} />
|
|
107
|
+
</Popover.Element>
|
|
108
|
+
<Popover.Content>
|
|
109
|
+
<div onFocus={handleFocus} onBlur={handleBlur}>
|
|
110
|
+
<CellRichTextEditor
|
|
111
|
+
value={value}
|
|
112
|
+
onChange={onChange}
|
|
113
|
+
autoFocus
|
|
114
|
+
initialTypedKey={initialTypedKey}
|
|
115
|
+
isFullScreen={isFullScreen}
|
|
116
|
+
onToggleFullScreen={handleToggleFullScreen}
|
|
117
|
+
textStyle={textStyle}
|
|
118
|
+
/>
|
|
119
|
+
</div>
|
|
120
|
+
</Popover.Content>
|
|
121
|
+
</Popover>
|
|
122
|
+
</div>
|
|
123
|
+
);
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
CellRichTextInput.displayName = 'CellRichTextInput';
|