@wix/patterns-fields 1.40.0 → 1.41.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/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.js +12 -10
- package/dist/cjs/components/audio/audio-field/form-audio-field.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/cell-color-input.js +195 -0
- package/dist/cjs/components/color-view/cell-color-input.js.map +1 -0
- package/dist/cjs/components/color-view/cell-color-view.js +89 -0
- package/dist/cjs/components/color-view/cell-color-view.js.map +1 -0
- package/dist/cjs/components/color-view/cell-color-view.st.css +8 -0
- package/dist/cjs/components/color-view/cell-color-view.st.css.js +25 -0
- package/dist/cjs/components/color-view/cell-color-view.st.css.js.map +1 -0
- package/dist/cjs/components/color-view/color-input.js +33 -27
- package/dist/cjs/components/color-view/color-input.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/color-view/hex.js +16 -0
- package/dist/cjs/components/color-view/hex.js.map +1 -0
- package/dist/cjs/components/color-view/index.js +18 -0
- package/dist/cjs/components/color-view/index.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/thumbnail-replace-overlay.st.css.js +3 -3
- package/dist/cjs/components/image/thumbnail-replace-overlay.st.css.js.map +1 -1
- package/dist/cjs/components/media-control/cell-media-edit-shell.st.css.js +2 -2
- package/dist/cjs/components/media-control/cell-media-edit-shell.st.css.js.map +1 -1
- 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-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 +3 -3
- 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.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/reference/cell-reference-input.st.css.js +3 -3
- package/dist/cjs/components/reference/cell-reference-input.st.css.js.map +1 -1
- package/dist/cjs/components/rich-content/cell-rich-content-input.js +4 -3
- 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 +3 -2
- package/dist/cjs/components/rich-content/cell-rich-content-view.js.map +1 -1
- package/dist/cjs/components/rich-content/hooks/use-plain-text-rich-content.js +1 -1
- package/dist/cjs/components/rich-content/hooks/use-plain-text-rich-content.js.map +1 -1
- package/dist/cjs/components/rich-content/rich-content-input/default-value-input/rich-content-default-value-input.st.css.js +4 -4
- 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/rich-content-form-input.st.css.js +3 -3
- 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/hooks.js +1 -1
- package/dist/cjs/components/rich-content/rich-content-input/rich-content-common/hooks.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/plugins.js +0 -5
- package/dist/cjs/components/rich-content/rich-content-input/rich-content-editor/plugins.js.map +1 -1
- package/dist/cjs/components/rich-content/rich-content-input/rich-content-editor/rich-content-editor.js +169 -192
- package/dist/cjs/components/rich-content/rich-content-input/rich-content-editor/rich-content-editor.js.map +1 -1
- package/dist/cjs/components/rich-content/rich-content-input/rich-content-editor/rich-content-editor.st.css.js +7 -7
- 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.js +52 -36
- package/dist/cjs/components/rich-content/rich-content-input/rich-content-editor/rich-content-toolbar.js.map +1 -1
- package/dist/cjs/components/rich-content/rich-content-input/rich-content-editor/rich-content-toolbar.st.css +7 -0
- package/dist/cjs/components/rich-content/rich-content-input/rich-content-editor/rich-content-toolbar.st.css.js +5 -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.js +10 -10
- package/dist/cjs/components/rich-content/rich-content-input/rich-content-viewer/rich-content-viewer.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/rich-text-input/rich-text-editor/rich-editor.st.css.js +18 -18
- 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/toolbar.st.css.js +18 -18
- 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/time-input/form-time-input.js +21 -2
- package/dist/cjs/components/time-input/form-time-input.js.map +1 -1
- package/dist/cjs/styles.global.css +1 -1
- package/dist/cjs/validations/rich-content.js +2 -3
- package/dist/cjs/validations/rich-content.js.map +1 -1
- package/dist/esm/components/address/input/address-input.st.css.js +2 -2
- 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.js +2 -0
- package/dist/esm/components/audio/audio-field/form-audio-field.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-field/form-audio-field.st.css.js.map +1 -1
- package/dist/esm/components/audio/audio-player/audio-player.st.css.js +2 -2
- package/dist/esm/components/color-view/cell-color-input.js +104 -0
- package/dist/esm/components/color-view/cell-color-input.js.map +1 -0
- package/dist/esm/components/color-view/cell-color-view.js +25 -0
- package/dist/esm/components/color-view/cell-color-view.js.map +1 -0
- package/dist/esm/components/color-view/cell-color-view.st.css +8 -0
- package/dist/esm/components/color-view/cell-color-view.st.css.js +15 -0
- package/dist/esm/components/color-view/cell-color-view.st.css.js.map +1 -0
- package/dist/esm/components/color-view/color-input.js +12 -12
- package/dist/esm/components/color-view/color-input.js.map +1 -1
- package/dist/esm/components/color-view/color-view.st.css.js +2 -2
- package/dist/esm/components/color-view/hex.js +9 -0
- package/dist/esm/components/color-view/hex.js.map +1 -0
- package/dist/esm/components/color-view/index.js +3 -0
- package/dist/esm/components/color-view/index.js.map +1 -1
- package/dist/esm/components/delete-dialog/delete-dialog.st.css.js +2 -2
- package/dist/esm/components/delete-dialog/delete-dialog.st.css.js.map +1 -1
- 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/exclamation/exclamation.st.css.js.map +1 -1
- package/dist/esm/components/highlighted-text/highlighted-text.st.css.js +3 -3
- package/dist/esm/components/image/thumbnail-replace-overlay.st.css.js +2 -2
- package/dist/esm/components/media-control/cell-media-edit-shell.st.css.js +2 -2
- package/dist/esm/components/media-control/paste-url-button.st.css.js +2 -2
- package/dist/esm/components/media-gallery/form-media-gallery-field.st.css.js +2 -2
- package/dist/esm/components/media-gallery/form-media-gallery-field.st.css.js.map +1 -1
- 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 +2 -2
- 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.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/reference/cell-reference-input.st.css.js +2 -2
- package/dist/esm/components/rich-content/cell-rich-content-input.js +4 -3
- 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 +3 -4
- package/dist/esm/components/rich-content/cell-rich-content-view.js.map +1 -1
- package/dist/esm/components/rich-content/hooks/use-plain-text-rich-content.js +2 -2
- package/dist/esm/components/rich-content/hooks/use-plain-text-rich-content.js.map +1 -1
- package/dist/esm/components/rich-content/rich-content-input/default-value-input/rich-content-default-value-input.st.css.js +2 -2
- package/dist/esm/components/rich-content/rich-content-input/default-value-input/rich-content-default-value-input.st.css.js.map +1 -1
- package/dist/esm/components/rich-content/rich-content-input/form-input/rich-content-form-input.st.css.js +2 -2
- 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/fullscreen-modal/fullscreen-modal.st.css.js.map +1 -1
- package/dist/esm/components/rich-content/rich-content-input/rich-content-common/hooks.js +2 -2
- package/dist/esm/components/rich-content/rich-content-input/rich-content-common/hooks.js.map +1 -1
- 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/plugins.js +0 -5
- package/dist/esm/components/rich-content/rich-content-input/rich-content-editor/plugins.js.map +1 -1
- package/dist/esm/components/rich-content/rich-content-input/rich-content-editor/rich-content-editor.js +112 -135
- package/dist/esm/components/rich-content/rich-content-input/rich-content-editor/rich-content-editor.js.map +1 -1
- package/dist/esm/components/rich-content/rich-content-input/rich-content-editor/rich-content-editor.st.css.js +2 -2
- 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.js +27 -35
- package/dist/esm/components/rich-content/rich-content-input/rich-content-editor/rich-content-toolbar.js.map +1 -1
- package/dist/esm/components/rich-content/rich-content-input/rich-content-editor/rich-content-toolbar.st.css +7 -0
- 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.js +2 -2
- package/dist/esm/components/rich-content/rich-content-input/rich-content-viewer/rich-content-viewer.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-content/rich-content-input/rich-content-viewer/rich-content-viewer.st.css.js.map +1 -1
- package/dist/esm/components/rich-text/rich-text-input/rich-text-editor/rich-editor.st.css.js +2 -2
- 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/toolbar.st.css.js +2 -2
- package/dist/esm/components/text/text-view.st.css.js +2 -2
- package/dist/esm/components/time-input/form-time-input.js +8 -3
- package/dist/esm/components/time-input/form-time-input.js.map +1 -1
- package/dist/esm/styles.global.css +1 -1
- package/dist/esm/validations/rich-content.js +3 -4
- package/dist/esm/validations/rich-content.js.map +1 -1
- package/dist/types/components/audio/actions/actions-menu/actions-menu.st.css.d.ts.map +1 -1
- package/dist/types/components/audio/audio-field/form-audio-field.d.ts.map +1 -1
- package/dist/types/components/audio/audio-field/form-audio-field.st.css.d.ts.map +1 -1
- package/dist/types/components/color-view/cell-color-input.d.ts +23 -0
- package/dist/types/components/color-view/cell-color-input.d.ts.map +1 -0
- package/dist/types/components/color-view/cell-color-view.d.ts +15 -0
- package/dist/types/components/color-view/cell-color-view.d.ts.map +1 -0
- package/dist/types/components/color-view/cell-color-view.st.css.d.ts +16 -0
- package/dist/types/components/color-view/cell-color-view.st.css.d.ts.map +1 -0
- package/dist/types/components/color-view/color-input.d.ts.map +1 -1
- package/dist/types/components/color-view/hex.d.ts +5 -0
- package/dist/types/components/color-view/hex.d.ts.map +1 -0
- package/dist/types/components/color-view/index.d.ts +3 -0
- package/dist/types/components/color-view/index.d.ts.map +1 -1
- package/dist/types/components/delete-dialog/delete-dialog.st.css.d.ts.map +1 -1
- package/dist/types/components/exclamation/exclamation.st.css.d.ts.map +1 -1
- package/dist/types/components/media-gallery/form-media-gallery-field.st.css.d.ts.map +1 -1
- package/dist/types/components/media-image/media-image.st.css.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 +2 -2
- 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/hooks/use-plain-text-rich-content.d.ts +2 -2
- package/dist/types/components/rich-content/hooks/use-plain-text-rich-content.d.ts.map +1 -1
- package/dist/types/components/rich-content/rich-content-input/default-value-input/rich-content-default-value-input.st.css.d.ts.map +1 -1
- package/dist/types/components/rich-content/rich-content-input/form-input/use-rich-content-form-input.d.ts +2 -2
- package/dist/types/components/rich-content/rich-content-input/hooks.d.ts +1 -1
- package/dist/types/components/rich-content/rich-content-input/rich-content-common/fullscreen-modal/fullscreen-modal.st.css.d.ts.map +1 -1
- package/dist/types/components/rich-content/rich-content-input/rich-content-common/hooks.d.ts +3 -3
- package/dist/types/components/rich-content/rich-content-input/rich-content-common/hooks.d.ts.map +1 -1
- package/dist/types/components/rich-content/rich-content-input/rich-content-editor/plugins.d.ts +2 -2
- package/dist/types/components/rich-content/rich-content-input/rich-content-editor/plugins.d.ts.map +1 -1
- package/dist/types/components/rich-content/rich-content-input/rich-content-editor/rich-content-editor.d.ts +12 -11
- package/dist/types/components/rich-content/rich-content-input/rich-content-editor/rich-content-editor.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.d.ts +2 -15
- package/dist/types/components/rich-content/rich-content-input/rich-content-editor/rich-content-toolbar.d.ts.map +1 -1
- package/dist/types/components/rich-content/rich-content-input/rich-content-editor/rich-content-toolbar.st.css.d.ts +1 -0
- 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-content/rich-content-input/rich-content-viewer/plugins.d.ts +1 -1
- package/dist/types/components/rich-content/rich-content-input/rich-content-viewer/plugins.d.ts.map +1 -1
- package/dist/types/components/rich-content/rich-content-input/rich-content-viewer/rich-content-viewer.d.ts +5 -3
- package/dist/types/components/rich-content/rich-content-input/rich-content-viewer/rich-content-viewer.d.ts.map +1 -1
- package/dist/types/components/rich-content/rich-content-input/rich-content-viewer/rich-content-viewer.st.css.d.ts.map +1 -1
- 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/time-input/form-time-input.d.ts.map +1 -1
- package/dist/types/validations/rich-content.d.ts +3 -3
- package/dist/types/validations/rich-content.d.ts.map +1 -1
- package/package.json +5 -5
- package/src/__tests__/components/rich-content-editor.spec.tsx +63 -72
- package/src/__tests__/validations/rich-content.spec.ts +4 -8
- 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-field/form-audio-field.tsx +2 -0
- package/src/components/audio/audio-player/audio-player.st.css.ts +2 -2
- package/src/components/color-view/cell-color-input.tsx +200 -0
- package/src/components/color-view/cell-color-view.st.css +8 -0
- package/src/components/color-view/cell-color-view.st.css.ts +25 -0
- package/src/components/color-view/cell-color-view.tsx +52 -0
- package/src/components/color-view/color-input.tsx +23 -17
- package/src/components/color-view/color-view.st.css.ts +2 -2
- package/src/components/color-view/hex.ts +13 -0
- package/src/components/color-view/index.ts +3 -0
- 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/thumbnail-replace-overlay.st.css.ts +2 -2
- package/src/components/media-control/cell-media-edit-shell.st.css.ts +2 -2
- package/src/components/media-control/paste-url-button.st.css.ts +2 -2
- 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 +2 -2
- 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.st.css.ts +2 -2
- package/src/components/reference/cell-reference-input.st.css.ts +2 -2
- package/src/components/rich-content/cell-rich-content-input.tsx +11 -14
- package/src/components/rich-content/cell-rich-content-view.tsx +3 -4
- package/src/components/rich-content/hooks/use-plain-text-rich-content.ts +4 -4
- package/src/components/rich-content/rich-content-input/default-value-input/rich-content-default-value-input.st.css.ts +2 -2
- package/src/components/rich-content/rich-content-input/form-input/rich-content-form-input.st.css.ts +2 -2
- 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/hooks.ts +5 -5
- 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/plugins.ts +0 -6
- package/src/components/rich-content/rich-content-input/rich-content-editor/rich-content-editor.st.css.ts +2 -2
- package/src/components/rich-content/rich-content-input/rich-content-editor/rich-content-editor.tsx +346 -355
- package/src/components/rich-content/rich-content-input/rich-content-editor/rich-content-toolbar.st.css +7 -0
- 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-editor/rich-content-toolbar.tsx +35 -62
- package/src/components/rich-content/rich-content-input/rich-content-viewer/rich-content-viewer.st.css.ts +2 -2
- package/src/components/rich-content/rich-content-input/rich-content-viewer/rich-content-viewer.tsx +8 -9
- package/src/components/rich-text/rich-text-input/rich-text-editor/rich-editor.st.css.ts +2 -2
- 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/toolbar.st.css.ts +2 -2
- package/src/components/text/text-view.st.css.ts +2 -2
- package/src/components/time-input/form-time-input.tsx +21 -4
- package/src/styles.global.css +1 -1
- package/src/validations/rich-content.ts +6 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_isEqual","_interopRequireDefault","require","_cloneDeep","_defaultsDeep","_react","_interopRequireWildcard","_designSystem","_ricos","_hooks","_utils","_userSiteFonts","_common","_richContentCommon","_plugins","_richContentToolbar","_richContentEditorStCss","_jsxFileName","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","linkPanelSettings","externalPopups","showSponsoredCheckbox","RCE","forwardRef","content","injectedContent","onChange","autoFocus","onFocus","onBlur","className","getToolbarSettings","dataHook","colorScheme","isFullScreen","onToggleFullScreen","hidden","children","ricosProps","ref","containerRef","useRef","containerHeightRef","onFullScreenChange","useCallback","current","clientHeight","editorRef","isToolbarReady","setIsToolbarReady","useState","toolbarButtons","setToolbarButtons","updateButtons","editorLoaded","effect","getToolbarProps","TOOLBARS","INSERT_PLUGIN","buttons","values","length","useEffect","onLoadEditor","frameId","loadToolbar","requestAnimationFrame","cancelAnimationFrame","_editorRef$current","focus","useImperativeHandle","isContentChanged","_editorRef$current2","Boolean","getContentTraits","toolbarContainerRef","toolbarSettings","useToolbarSettings","isModalOpenRef","modalSettings","useMemo","onModalOpen","onModalClose","isFocusedRef","isBlurringRef","triggerFocus","triggerBlur","requestBlurCallback","useRequestFrameCallback","requestEditorBlur","handleFocus","getActiveElement","_editorRef$current3","handleBlur","relatedTarget","_containerRef$current","contains","getAppRootElement","handleOnChange","hasLostFocusElement","document","activeElement","body","isInitialInjectedContent","isEqual","INITIAL_INJECTED_RICH_CONTENT","wixRicosProps","useWixRicosProps","plugins","usePlugins","renderInContainer","createElement","st","classes","root","tabIndex","undefined","style","height","__self","__source","fileName","lineNumber","columnNumber","toolbarAndFullScreenButtonWrapper","toolbarContainer","ToggleFullscreenButton","RCELoader","footerToolbarContainer","ExternalToolbar","editor","WixRicosEditor","_extends2","textWrap","onLoad","container","displayName","Box","align","verticalAlign","position","top","bottom","width","Loader","size","LOADER_DELAY","RichContentEditor","exports","withEditorContext","onEnterFullScreen","onExitFullScreen","fullScreenOnly","editorEvents","onPublish","theme","props","modalEditorRef","isRichContentChanged","_editorRef$current4","_modalEditorRef$curre","handleChange","richContent","loader","setLoader","timer","resetLoader","window","clearTimeout","queueLoader","setTimeout","setIsFullScreen","onOpen","finalContent","isChanged","publish","error","onClose","catch","handleKeyDown","key","stopPropagation","addEventListener","removeEventListener","useGetToolbarSettings","rceProps","fullScreenTheme","defaultsDeep","cloneDeep","customStyles","maxHeight","settingsStyles","modals","dialogZIndex","Z_INDEX_MODAL_POPOVER","Fragment","UserSiteFonts","FullscreenModal","isOpen","isLoading","modalEditor","filterStaticToolbarButtons","button","FORMATTING_BUTTONS","CODE_BLOCK","textButtons","name","shouldCreate","desktop","FOOTER","STATIC","getButtons","_textButtons$desktop","filter","QUICK_ACTIONS","activateOnFloatingPlusButton","useStaticTextToolbar","textToolbarContainer"],"sources":["../../../../../../src/components/rich-content/rich-content-input/rich-content-editor/rich-content-editor.tsx"],"sourcesContent":["import isEqual from 'lodash/isEqual';\nimport cloneDeep from 'lodash/cloneDeep';\nimport defaultsDeep from 'lodash/defaultsDeep';\n\nimport type { FC, FocusEventHandler } from 'react';\nimport React, {\n forwardRef,\n useRef,\n useMemo,\n useState,\n useEffect,\n useCallback,\n useImperativeHandle,\n} from 'react';\n\nimport { Box, Loader } from '@wix/design-system';\nimport type {\n WixRicosEditorProps,\n GetToolbarSettings,\n TextGroupButtons,\n RichContent,\n RicosEditorType,\n ToolbarSettings,\n EditorEventsProps,\n ToolbarSettingsFunctions,\n} from '@wix/ricos';\nimport {\n WixRicosEditor,\n ToolbarType as TOOLBARS,\n FORMATTING_BUTTONS,\n withEditorContext,\n} from '@wix/ricos';\n\nimport { useRequestFrameCallback } from '../../../../hooks';\nimport { getActiveElement, getAppRootElement } from '../../../../utils';\nimport { UserSiteFonts } from '../../../user-site-fonts';\nimport { Z_INDEX_MODAL_POPOVER } from '../../../common';\n\nimport type { ColorScheme } from '../../types';\n\nimport type { ToggleFullscreenButtonProps } from '../rich-content-common';\nimport {\n useWixRicosProps,\n FullscreenModal,\n ToggleFullscreenButton,\n INITIAL_INJECTED_RICH_CONTENT,\n} from '../rich-content-common';\n\nimport { usePlugins } from './plugins';\nimport { ExternalToolbar } from './rich-content-toolbar';\nimport { st, classes } from './rich-content-editor.st.css.js';\n\ntype RicosProps = Pick<\n WixRicosEditorProps,\n 'wixExperiments' | 'biSettings' | 'modalSettings' | 'theme'\n>;\n\ninterface RCEHandle {\n isContentChanged: () => boolean;\n}\n\ninterface RCEProps extends RicosProps {\n content?: RichContent;\n injectedContent?: RichContent;\n onChange?: (content: RichContent) => void;\n getToolbarSettings: GetToolbarSettings;\n autoFocus?: boolean;\n onFocus?: () => void;\n onBlur?: () => void;\n className?: string;\n colorScheme?: ColorScheme;\n hidden?: boolean;\n dataHook?: string;\n}\n\nconst linkPanelSettings = {\n externalPopups: true,\n showSponsoredCheckbox: true,\n};\n\nconst RCE = forwardRef<RCEHandle, RCEProps & ToggleFullscreenButtonProps>(\n (\n {\n content,\n injectedContent,\n onChange,\n autoFocus,\n onFocus,\n onBlur,\n className,\n getToolbarSettings,\n dataHook,\n colorScheme,\n isFullScreen,\n onToggleFullScreen,\n hidden,\n children,\n ...ricosProps\n },\n ref,\n ) => {\n const containerRef = useRef<HTMLDivElement>(null);\n const containerHeightRef = useRef<number | undefined>();\n\n const onFullScreenChange = useCallback(() => {\n onToggleFullScreen?.();\n\n if (containerRef.current) {\n containerHeightRef.current = containerRef.current.clientHeight;\n }\n }, [onToggleFullScreen]);\n\n const editorRef = useRef<RicosEditorType>(null);\n const [isToolbarReady, setIsToolbarReady] = useState(false);\n const [toolbarButtons, setToolbarButtons] = useState({});\n\n const updateButtons = useCallback(\n (editorLoaded?: boolean, effect = false) => {\n if (!editorRef.current) {\n return;\n }\n\n const toolbarButtons = editorRef.current.getToolbarProps(\n TOOLBARS.INSERT_PLUGIN,\n ).buttons;\n\n if (Object.values(toolbarButtons).length > 0) {\n !effect && setToolbarButtons(toolbarButtons);\n editorLoaded && setIsToolbarReady(true);\n }\n },\n [],\n );\n useEffect(() => updateButtons(false, true));\n\n // Poll via rAF until Ricos has populated its toolbar buttons before marking\n // the toolbar as ready. A single call to updateButtons(true) at onLoad time\n // fails silently when Ricos hasn't finished initialising — buttons is empty,\n // setIsToolbarReady is never called, and the loader persists forever.\n const onLoadEditor = useCallback(() => {\n let frameId = 0;\n (function loadToolbar() {\n frameId = requestAnimationFrame(() => {\n if (!editorRef.current) {\n return;\n }\n const { buttons } = editorRef.current.getToolbarProps(\n TOOLBARS.INSERT_PLUGIN,\n );\n if (Object.values(buttons).length > 0) {\n setToolbarButtons(buttons);\n setIsToolbarReady(true);\n } else {\n loadToolbar();\n }\n });\n })();\n return () => cancelAnimationFrame(frameId);\n }, []);\n\n useEffect(() => {\n if (!autoFocus) {\n return;\n }\n\n const frameId = requestAnimationFrame(() => {\n editorRef.current?.focus();\n updateButtons();\n });\n\n return () => cancelAnimationFrame(frameId);\n }, [autoFocus, updateButtons]);\n\n useImperativeHandle(ref, () => ({\n isContentChanged: () =>\n Boolean(editorRef.current?.getContentTraits().isContentChanged),\n }));\n\n const toolbarContainerRef = useRef<HTMLDivElement>(null);\n const toolbarSettings = useToolbarSettings(\n toolbarContainerRef.current!,\n getToolbarSettings,\n );\n\n const isModalOpenRef = useRef(false);\n const modalSettings = useMemo<WixRicosEditorProps['modalSettings']>(\n () => ({\n onModalOpen() {\n isModalOpenRef.current = true;\n },\n onModalClose() {\n isModalOpenRef.current = false;\n },\n }),\n [],\n );\n\n const isFocusedRef = useRef(false);\n const isBlurringRef = useRef(false);\n\n const triggerFocus = useCallback(() => {\n isBlurringRef.current = false;\n\n if (isFocusedRef.current) {\n return;\n }\n\n isFocusedRef.current = true;\n onFocus?.();\n }, [onFocus]);\n const triggerBlur = useCallback(() => {\n isBlurringRef.current = false;\n\n if (!isFocusedRef.current) {\n return;\n }\n\n isFocusedRef.current = false;\n onBlur?.();\n }, [onBlur]);\n\n const requestBlurCallback = useRequestFrameCallback();\n const requestEditorBlur = useCallback(() => {\n isBlurringRef.current = true;\n requestBlurCallback(() => isBlurringRef.current && triggerBlur());\n }, [triggerBlur, requestBlurCallback]);\n\n const handleFocus = useCallback<FocusEventHandler>(() => {\n if (containerRef.current === getActiveElement()) {\n editorRef.current?.focus();\n updateButtons();\n }\n\n triggerFocus();\n }, [triggerFocus, updateButtons]);\n const handleBlur = useCallback<FocusEventHandler>(\n ({ relatedTarget }) => {\n if (!relatedTarget) {\n requestEditorBlur();\n return;\n }\n\n if (\n isModalOpenRef.current ||\n containerRef.current?.contains(relatedTarget)\n ) {\n /**\n * @NOTE\n * Ignore events which come from modal or\n * from any target inside editor container\n */\n return;\n }\n\n /**\n * @NOTE\n * If editor container is blurred due to focus of element\n * that is out of app root (e.g. tooltip rendered in portal),\n * then editor blur should be requested to ensure\n * that editor should not be focused after user action,\n * otherwise editor should be blurred immediately\n */\n if (!getAppRootElement().contains(relatedTarget)) {\n requestEditorBlur();\n } else {\n triggerBlur();\n }\n },\n [triggerBlur, requestEditorBlur],\n );\n\n /**\n * NOTE:\n * `handleOnChange` handles only change events when editor is not focused or focus was lost.\n * In a normal flow `onChange` is not called on every input and all the changes submitted on blur.\n */\n const handleOnChange = useCallback(() => {\n const hasLostFocusElement = document.activeElement === document.body;\n\n if (!isFocusedRef.current || hasLostFocusElement) {\n const isInitialInjectedContent = isEqual(\n INITIAL_INJECTED_RICH_CONTENT,\n injectedContent,\n );\n\n if (!isInitialInjectedContent) {\n onBlur?.();\n }\n }\n }, [onBlur, injectedContent]);\n\n const wixRicosProps = useWixRicosProps();\n const plugins = usePlugins(colorScheme);\n\n const renderInContainer = (children: React.ReactNode) => (\n <div\n ref={containerRef}\n data-hook=\"rich-content.editor\"\n className={st(classes.root, className)}\n tabIndex={onFocus || onBlur ? 0 : undefined}\n onFocus={handleFocus}\n onBlur={handleBlur}\n style={{\n height: hidden ? containerHeightRef.current : undefined,\n }}\n >\n <div className={classes.toolbarAndFullScreenButtonWrapper}>\n <div className={classes.toolbarContainer} ref={toolbarContainerRef} />\n {!hidden && isToolbarReady && (\n <ToggleFullscreenButton\n isFullScreen={isFullScreen}\n onToggleFullScreen={onFullScreenChange}\n />\n )}\n </div>\n {!hidden ? children : null}\n {!isToolbarReady && <RCELoader />}\n {!hidden && isToolbarReady && (\n <div\n data-hook=\"rich-content.footerToolbar\"\n className={classes.footerToolbarContainer}\n >\n <ExternalToolbar buttons={toolbarButtons} />\n </div>\n )}\n </div>\n );\n\n return renderInContainer(\n <div data-hook={dataHook} className={classes.editor}>\n <WixRicosEditor\n ref={editorRef}\n plugins={plugins}\n content={content}\n injectedContent={injectedContent}\n toolbarSettings={toolbarSettings}\n linkPanelSettings={linkPanelSettings}\n modalSettings={modalSettings}\n textWrap={false}\n onLoad={onLoadEditor}\n onChange={handleOnChange}\n container={containerRef.current!}\n {...ricosProps}\n {...wixRicosProps}\n />\n </div>,\n );\n },\n);\nRCE.displayName = 'RCE';\n\nconst RCELoader: React.FC = () => (\n <Box\n align=\"center\"\n verticalAlign=\"middle\"\n position=\"absolute\"\n top=\"0\"\n bottom=\"0\"\n width=\"100%\"\n >\n <Loader size=\"small\" />\n </Box>\n);\nRCELoader.displayName = 'RCELoader';\n\nconst LOADER_DELAY = 100;\n\nexport type RichContentEditorProps = Omit<\n RCEProps,\n 'getToolbarSettings' | 'modalSettings' | 'onChange'\n> & {\n onEnterFullScreen?: (\n content?: RichContent,\n isContentChanged?: boolean,\n ) => void;\n onExitFullScreen?: (\n content?: RichContent,\n isContentChanged?: boolean,\n ) => void;\n onChange?: (content: RichContent, isContentChanged?: boolean) => void;\n onPublish?: (promise: Promise<any>) => void;\n fullScreenOnly?: boolean;\n};\n\nexport const RichContentEditor: FC<RichContentEditorProps> = withEditorContext(\n ({\n onFocus,\n onBlur,\n onEnterFullScreen,\n onExitFullScreen,\n fullScreenOnly,\n editorEvents,\n onPublish,\n onChange,\n theme,\n ...props\n }: RichContentEditorProps & EditorEventsProps) => {\n const editorRef = useRef<RCEHandle>(null);\n const modalEditorRef = useRef<RCEHandle>(null);\n\n const isRichContentChanged = useCallback(\n () =>\n Boolean(\n editorRef.current?.isContentChanged() ||\n modalEditorRef.current?.isContentChanged(),\n ),\n [],\n );\n const handleChange = useCallback(\n (richContent: RichContent) => {\n onChange?.(richContent, isRichContentChanged());\n },\n [onChange, isRichContentChanged],\n );\n\n const [loader, setLoader] = useState(false);\n const timer = useRef<number>(0);\n const resetLoader = useCallback(() => {\n window.clearTimeout(timer.current);\n setLoader(false);\n }, []);\n const queueLoader = useCallback(() => {\n timer.current = window.setTimeout(() => {\n setLoader(true);\n }, LOADER_DELAY);\n }, []);\n\n const { content } = props;\n const [isFullScreen, setIsFullScreen] = useState(!!fullScreenOnly);\n const onOpen = useCallback(async () => {\n let finalContent: RichContent | undefined;\n const isChanged = isRichContentChanged();\n try {\n finalContent = (await editorEvents.publish()) as unknown as RichContent;\n onEnterFullScreen?.(finalContent, isChanged);\n } catch (error) {\n finalContent = content;\n onEnterFullScreen?.(content, isChanged);\n } finally {\n setIsFullScreen(true);\n\n if (isChanged && finalContent) {\n handleChange(finalContent);\n }\n }\n }, [\n content,\n editorEvents,\n isRichContentChanged,\n onEnterFullScreen,\n handleChange,\n ]);\n const onClose = useCallback(async () => {\n queueLoader();\n let finalContent: RichContent | undefined;\n const isChanged = isRichContentChanged();\n try {\n finalContent = (await editorEvents.publish()) as unknown as RichContent;\n onExitFullScreen?.(finalContent, isChanged);\n } catch (error) {\n finalContent = content;\n onExitFullScreen?.(content, isChanged);\n } finally {\n resetLoader();\n setIsFullScreen(false);\n\n if (isChanged && finalContent) {\n handleChange(finalContent);\n }\n }\n }, [\n content,\n editorEvents,\n isRichContentChanged,\n onExitFullScreen,\n handleChange,\n queueLoader,\n resetLoader,\n ]);\n\n const handleBlur = useCallback(() => {\n if (isRichContentChanged()) {\n onPublish?.(editorEvents.publish().catch(() => content));\n }\n onBlur?.();\n }, [content, editorEvents, onBlur, onPublish, isRichContentChanged]);\n\n // Escape while fullscreen — capture phase so it fires before Ricos' own handlers.\n // Delegates to onClose which calls editorEvents.publish() for the real current content.\n useEffect(() => {\n if (!isFullScreen) {\n return;\n }\n const handleKeyDown = (e: KeyboardEvent) => {\n if (e.key === 'Escape') {\n e.stopPropagation();\n onClose();\n }\n };\n document.addEventListener('keydown', handleKeyDown, true);\n return () => document.removeEventListener('keydown', handleKeyDown, true);\n }, [isFullScreen, onClose]);\n\n const getToolbarSettings = useGetToolbarSettings();\n\n const rceProps = {\n getToolbarSettings,\n onChange: handleChange,\n };\n\n // @NOTE: Ricos now need custom maxHeight to show scroll\n // since it's requirements fully related to 'visual part' of\n // editor we just default it here\n const fullScreenTheme = defaultsDeep(cloneDeep(theme), {\n customStyles: { editor: { maxHeight: '100%' } },\n settingsStyles: {\n modals: {\n dialogZIndex: Z_INDEX_MODAL_POPOVER,\n },\n },\n });\n\n return (\n <>\n <UserSiteFonts />\n {!fullScreenOnly && (\n <RCE\n {...props}\n {...rceProps}\n theme={theme}\n onFocus={onFocus}\n onBlur={handleBlur}\n hidden={isFullScreen}\n ref={editorRef}\n isFullScreen={false}\n onToggleFullScreen={onOpen}\n />\n )}\n <FullscreenModal isOpen={isFullScreen} isLoading={loader}>\n <RCE\n {...props}\n {...rceProps}\n theme={fullScreenTheme}\n autoFocus\n className={classes.modalEditor}\n ref={modalEditorRef}\n isFullScreen\n onToggleFullScreen={onClose}\n />\n </FullscreenModal>\n </>\n );\n },\n);\nRichContentEditor.displayName = 'RichContentEditor';\n\nconst filterStaticToolbarButtons = (button: string | TextGroupButtons) =>\n button !== FORMATTING_BUTTONS.CODE_BLOCK;\n\nconst useGetToolbarSettings = () =>\n useCallback<GetToolbarSettings>(\n ({ textButtons }) =>\n [\n {\n name: TOOLBARS.INSERT_PLUGIN,\n shouldCreate: () => ({ desktop: true }),\n },\n {\n name: TOOLBARS.FOOTER,\n shouldCreate: () => ({ desktop: false }),\n },\n {\n name: TOOLBARS.STATIC,\n getButtons: () => ({\n desktop: [\n ...(textButtons?.desktop?.filter?.(filterStaticToolbarButtons) ??\n []),\n ],\n }),\n },\n {\n name: TOOLBARS.QUICK_ACTIONS,\n activateOnFloatingPlusButton: true,\n shouldCreate: () => ({ desktop: true }),\n },\n ].filter(Boolean) as ToolbarSettingsFunctions[],\n [],\n );\n\nconst useToolbarSettings = (\n container: HTMLElement,\n getToolbarSettings: GetToolbarSettings,\n) =>\n useMemo<ToolbarSettings>(\n () => ({\n getToolbarSettings,\n useStaticTextToolbar: true,\n textToolbarContainer: container,\n }),\n [container, getToolbarSettings],\n );\n"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,aAAA,GAAAH,sBAAA,CAAAC,OAAA;AAGA,IAAAG,MAAA,GAAAC,uBAAA,CAAAJ,OAAA;AAUA,IAAAK,aAAA,GAAAL,OAAA;AAWA,IAAAM,MAAA,GAAAN,OAAA;AAOA,IAAAO,MAAA,GAAAP,OAAA;AACA,IAAAQ,MAAA,GAAAR,OAAA;AACA,IAAAS,cAAA,GAAAT,OAAA;AACA,IAAAU,OAAA,GAAAV,OAAA;AAKA,IAAAW,kBAAA,GAAAX,OAAA;AAOA,IAAAY,QAAA,GAAAZ,OAAA;AACA,IAAAa,mBAAA,GAAAb,OAAA;AACA,IAAAc,uBAAA,GAAAd,OAAA;AAA8D,IAAAe,YAAA;AAAA,SAAAX,wBAAAY,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAd,uBAAA,YAAAA,CAAAY,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,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AA;AACH,CAAC,EACD;EACEK,IAAI,EAAErJ,kBAAQ,CAAC6J,aAAa;EAC5BC,4BAA4B,EAAE,IAAI;EAClCR,YAAY,EAAEA,CAAA,MAAO;IAAEC,OAAO,EAAE;EAAK,CAAC;AACxC,CAAC,CACF,CAACK,MAAM,CAAC5I,OAAO,CAA+B,EACjD,EACF,CAAC;AAEH,MAAMI,kBAAkB,GAAGA,CACzB0D,SAAsB,EACtBxG,kBAAsC,KAEtC,IAAAiD,cAAO,EACL,OAAO;EACLjD,kBAAkB;EAClByL,oBAAoB,EAAE,IAAI;EAC1BC,oBAAoB,EAAElF;AACxB,CAAC,CAAC,EACF,CAACA,SAAS,EAAExG,kBAAkB,CAChC,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_isEqual","_interopRequireDefault","require","_cloneDeep","_defaultsDeep","_react","_interopRequireWildcard","_designSystem","_ricos","_hooks","_utils","_userSiteFonts","_common","_richContentCommon","_plugins","_richContentToolbar","_richContentEditorStCss","_jsxFileName","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","InsertToolbarSync","editor","onButtonsChange","onReadyChange","buttons","useToolbarProps","signature","map","b","id","join","buttonsRef","useRef","current","useEffect","length","displayName","filterStaticToolbarButtons","button","FORMATTING_BUTTONS","CODE_BLOCK","RCE","forwardRef","content","injectedContent","onChange","autoFocus","onFocus","onBlur","className","dataHook","colorScheme","isFullScreen","onToggleFullScreen","hidden","ricosProps","ref","containerRef","containerHeightRef","getContainer","useCallback","onFullScreenChange","clientHeight","editorRef","setEditor","useState","isToolbarReady","setIsToolbarReady","toolbarButtons","setToolbarButtons","toolbarContainer","setToolbarContainer","setEditorInstance","nextEditor","setContent","nextContent","_editorRef$current","getEditorCommands","useImperativeHandle","isContentChanged","_editorRef$current2","Boolean","getContentTraits","prePublish","_editorRef$current3","INITIAL_INJECTED_RICH_CONTENT","appliedInjectedContentRef","isEqual","timerId","window","setTimeout","clearTimeout","frameId","requestAnimationFrame","_editorRef$current4","focus","cancelAnimationFrame","toolbars","useMemo","undefined","text","mode","container","alignment","defaultButtons","filter","insert","footer","disabled","isModalOpenRef","modalSettings","onModalOpen","onModalClose","isFocusedRef","isBlurringRef","triggerFocus","triggerBlur","requestBlurCallback","useRequestFrameCallback","requestEditorBlur","handleFocus","getActiveElement","_editorRef$current5","handleBlur","relatedTarget","_containerRef$current","contains","getAppRootElement","wixRicosProps","useWixRicosProps","plugins","usePlugins","createElement","st","classes","root","tabIndex","style","height","__self","__source","fileName","lineNumber","columnNumber","toolbarAndFullScreenButtonWrapper","ToggleFullscreenButton","RicosEditor","_extends2","initialContent","textWrap","RCELoader","footerToolbarContainer","ExternalToolbar","Box","align","verticalAlign","position","top","bottom","width","Loader","size","LOADER_DELAY","RichContentEditor","onEnterFullScreen","onExitFullScreen","fullScreenOnly","onPublish","theme","props","modalEditorRef","isRichContentChanged","_editorRef$current6","_modalEditorRef$curre","handleChange","richContent","loader","setLoader","timer","resetLoader","queueLoader","setIsFullScreen","fullScreenContent","setFullScreenContent","publishEditorContent","editorHandle","fallbackContent","onOpen","finalContent","isChanged","error","onClose","catch","handleKeyDown","key","stopPropagation","document","addEventListener","removeEventListener","rceProps","fullScreenTheme","defaultsDeep","cloneDeep","customStyles","maxHeight","settingsStyles","modals","dialogZIndex","Z_INDEX_MODAL_POPOVER","Fragment","UserSiteFonts","FullscreenModal","isOpen","isLoading","modalEditor","exports"],"sources":["../../../../../../src/components/rich-content/rich-content-input/rich-content-editor/rich-content-editor.tsx"],"sourcesContent":["import isEqual from 'lodash/isEqual';\nimport cloneDeep from 'lodash/cloneDeep';\nimport defaultsDeep from 'lodash/defaultsDeep';\n\nimport type { FC, FocusEventHandler } from 'react';\nimport React, {\n forwardRef,\n useRef,\n useMemo,\n useState,\n useEffect,\n useCallback,\n useImperativeHandle,\n} from 'react';\n\nimport { Box, Loader } from '@wix/design-system';\nimport type {\n ExternalToolbarButton as RicosExternalToolbarButton,\n RicosDocument,\n RicosEditorAPI,\n RicosEditorProps,\n ToolbarsConfig,\n} from '@wix/ricos';\nimport { RicosEditor, FORMATTING_BUTTONS } from '@wix/ricos';\n\nimport { useRequestFrameCallback } from '../../../../hooks';\nimport { getActiveElement, getAppRootElement } from '../../../../utils';\nimport { UserSiteFonts } from '../../../user-site-fonts';\nimport { Z_INDEX_MODAL_POPOVER } from '../../../common';\n\nimport type { ColorScheme } from '../../types';\n\nimport type { ToggleFullscreenButtonProps } from '../rich-content-common';\nimport {\n useWixRicosProps,\n FullscreenModal,\n ToggleFullscreenButton,\n INITIAL_INJECTED_RICH_CONTENT,\n} from '../rich-content-common';\n\nimport { usePlugins } from './plugins';\nimport { ExternalToolbar } from './rich-content-toolbar';\nimport { st, classes } from './rich-content-editor.st.css.js';\n\ntype RicosProps = Pick<RicosEditorProps, 'biSettings' | 'theme'> & {\n wixExperiments?: unknown;\n};\n\ninterface RCEHandle {\n isContentChanged: () => boolean;\n prePublish: () => Promise<RicosDocument>;\n setContent: (content: RicosDocument) => void;\n}\n\ninterface RCEProps extends RicosProps {\n content?: RicosDocument;\n injectedContent?: RicosDocument;\n onChange?: (content: RicosDocument) => void;\n autoFocus?: boolean;\n onFocus?: () => void;\n onBlur?: () => void;\n className?: string;\n colorScheme?: ColorScheme;\n hidden?: boolean;\n dataHook?: string;\n}\n\ntype ToolbarSyncProps = {\n editor: RicosEditorAPI;\n onButtonsChange: (buttons: readonly RicosExternalToolbarButton[]) => void;\n onReadyChange: (ready: boolean) => void;\n};\n\nconst InsertToolbarSync: FC<ToolbarSyncProps> = ({\n editor,\n onButtonsChange,\n onReadyChange,\n}) => {\n const { buttons } = editor.useToolbarProps('insert');\n\n // `useToolbarProps` rebuilds `buttons` (new array + closures) on every render,\n // so guard against pushing an unchanged-by-content array into parent state.\n const signature = buttons.map((b) => b.id).join('|');\n const buttonsRef = useRef(buttons);\n buttonsRef.current = buttons;\n\n useEffect(() => {\n onButtonsChange(buttonsRef.current);\n onReadyChange(buttonsRef.current.length > 0);\n }, [signature, onButtonsChange, onReadyChange]);\n\n return null;\n};\n\nInsertToolbarSync.displayName = 'InsertToolbarSync';\n\nconst filterStaticToolbarButtons = (button: string) =>\n button !== FORMATTING_BUTTONS.CODE_BLOCK;\n\nconst RCE = forwardRef<RCEHandle, RCEProps & ToggleFullscreenButtonProps>(\n (\n {\n content,\n injectedContent,\n onChange,\n autoFocus,\n onFocus,\n onBlur,\n className,\n dataHook,\n colorScheme,\n isFullScreen,\n onToggleFullScreen,\n hidden,\n ...ricosProps\n },\n ref,\n ) => {\n const containerRef = useRef<HTMLDivElement>(null);\n const containerHeightRef = useRef<number | undefined>();\n\n // Stable identity so RicosEditor doesn't see a new `container` prop each render.\n const getContainer = useCallback(() => containerRef.current, []);\n\n const onFullScreenChange = useCallback(() => {\n onToggleFullScreen?.();\n\n if (containerRef.current) {\n containerHeightRef.current = containerRef.current.clientHeight;\n }\n }, [onToggleFullScreen]);\n\n const editorRef = useRef<RicosEditorAPI | null>(null);\n const [editor, setEditor] = useState<RicosEditorAPI | null>(null);\n const [isToolbarReady, setIsToolbarReady] = useState(false);\n const [toolbarButtons, setToolbarButtons] = useState<\n readonly RicosExternalToolbarButton[]\n >([]);\n const [toolbarContainer, setToolbarContainer] =\n useState<HTMLDivElement | null>(null);\n\n const setEditorInstance = useCallback((nextEditor: RicosEditorAPI | null) => {\n editorRef.current = nextEditor;\n setEditor(nextEditor);\n }, []);\n\n const setContent = useCallback((nextContent: RicosDocument) => {\n editorRef.current?.getEditorCommands().setContent(nextContent);\n }, []);\n\n useImperativeHandle(\n ref,\n () => ({\n isContentChanged: () =>\n Boolean(editorRef.current?.getContentTraits().isContentChanged),\n prePublish: async () =>\n (await editorRef.current?.prePublish()) ??\n INITIAL_INJECTED_RICH_CONTENT,\n setContent,\n }),\n [setContent],\n );\n\n const appliedInjectedContentRef = useRef<RicosDocument | undefined>();\n useEffect(() => {\n if (\n !injectedContent ||\n isEqual(INITIAL_INJECTED_RICH_CONTENT, injectedContent) ||\n isEqual(appliedInjectedContentRef.current, injectedContent)\n ) {\n return;\n }\n\n appliedInjectedContentRef.current = injectedContent;\n const timerId = window.setTimeout(() => {\n setContent(injectedContent);\n }, 0);\n\n return () => window.clearTimeout(timerId);\n }, [injectedContent, setContent]);\n\n useEffect(() => {\n if (!autoFocus || !editorRef.current) {\n return;\n }\n\n const frameId = requestAnimationFrame(() => {\n editorRef.current?.focus();\n });\n\n return () => cancelAnimationFrame(frameId);\n }, [autoFocus, editor]);\n\n const toolbars = useMemo<ToolbarsConfig | undefined>(() => {\n if (!toolbarContainer) {\n return undefined;\n }\n\n return {\n text: {\n mode: 'static',\n container: toolbarContainer,\n alignment: 'left',\n buttons: ({ defaultButtons }) =>\n defaultButtons.filter(filterStaticToolbarButtons),\n },\n insert: {\n footer: {\n disabled: true,\n },\n },\n };\n }, [toolbarContainer]);\n\n const isModalOpenRef = useRef(false);\n const modalSettings = useMemo<RicosEditorProps['modalSettings']>(\n () => ({\n onModalOpen() {\n isModalOpenRef.current = true;\n },\n onModalClose() {\n isModalOpenRef.current = false;\n },\n }),\n [],\n );\n\n const isFocusedRef = useRef(false);\n const isBlurringRef = useRef(false);\n\n const triggerFocus = useCallback(() => {\n isBlurringRef.current = false;\n\n if (isFocusedRef.current) {\n return;\n }\n\n isFocusedRef.current = true;\n onFocus?.();\n }, [onFocus]);\n const triggerBlur = useCallback(() => {\n isBlurringRef.current = false;\n\n if (!isFocusedRef.current) {\n return;\n }\n\n isFocusedRef.current = false;\n onBlur?.();\n }, [onBlur]);\n\n const requestBlurCallback = useRequestFrameCallback();\n const requestEditorBlur = useCallback(() => {\n isBlurringRef.current = true;\n requestBlurCallback(() => isBlurringRef.current && triggerBlur());\n }, [triggerBlur, requestBlurCallback]);\n\n const handleFocus = useCallback<FocusEventHandler>(() => {\n if (containerRef.current === getActiveElement()) {\n editorRef.current?.focus();\n }\n\n triggerFocus();\n }, [triggerFocus]);\n const handleBlur = useCallback<FocusEventHandler>(\n ({ relatedTarget }) => {\n if (!relatedTarget) {\n requestEditorBlur();\n return;\n }\n\n if (\n isModalOpenRef.current ||\n containerRef.current?.contains(relatedTarget)\n ) {\n return;\n }\n\n if (!getAppRootElement().contains(relatedTarget)) {\n requestEditorBlur();\n } else {\n triggerBlur();\n }\n },\n [triggerBlur, requestEditorBlur],\n );\n\n const wixRicosProps = useWixRicosProps();\n const plugins = usePlugins(colorScheme);\n\n return (\n <div\n ref={containerRef}\n data-hook=\"rich-content.editor\"\n className={st(classes.root, className)}\n tabIndex={onFocus || onBlur ? 0 : undefined}\n onFocus={handleFocus}\n onBlur={handleBlur}\n style={{\n height: hidden ? containerHeightRef.current : undefined,\n }}\n >\n <div className={classes.toolbarAndFullScreenButtonWrapper}>\n <div className={classes.toolbarContainer} ref={setToolbarContainer} />\n {!hidden && isToolbarReady && (\n <ToggleFullscreenButton\n isFullScreen={isFullScreen}\n onToggleFullScreen={onFullScreenChange}\n />\n )}\n </div>\n\n {editor && (\n <InsertToolbarSync\n editor={editor}\n onButtonsChange={setToolbarButtons}\n onReadyChange={setIsToolbarReady}\n />\n )}\n\n {!hidden ? (\n <div data-hook={dataHook} className={classes.editor}>\n <RicosEditor\n ref={setEditorInstance}\n plugins={plugins}\n initialContent={content}\n toolbars={toolbars}\n modalSettings={modalSettings}\n textWrap={false}\n onChange={onChange}\n container={getContainer}\n {...ricosProps}\n {...wixRicosProps}\n />\n </div>\n ) : null}\n\n {!isToolbarReady && <RCELoader />}\n {!hidden && isToolbarReady && (\n <div\n data-hook=\"rich-content.footerToolbar\"\n className={classes.footerToolbarContainer}\n >\n <ExternalToolbar buttons={toolbarButtons} />\n </div>\n )}\n </div>\n );\n },\n);\nRCE.displayName = 'RCE';\n\nconst RCELoader: React.FC = () => (\n <Box\n align=\"center\"\n verticalAlign=\"middle\"\n position=\"absolute\"\n top=\"0\"\n bottom=\"0\"\n width=\"100%\"\n >\n <Loader size=\"small\" />\n </Box>\n);\nRCELoader.displayName = 'RCELoader';\n\nconst LOADER_DELAY = 100;\n\nexport type RichContentEditorProps = Omit<RCEProps, 'onChange'> & {\n onEnterFullScreen?: (\n content?: RicosDocument,\n isContentChanged?: boolean,\n ) => void;\n onExitFullScreen?: (\n content?: RicosDocument,\n isContentChanged?: boolean,\n ) => void;\n onChange?: (content: RicosDocument, isContentChanged?: boolean) => void;\n onPublish?: (promise: Promise<RicosDocument>) => void;\n fullScreenOnly?: boolean;\n};\n\nexport const RichContentEditor: FC<RichContentEditorProps> = ({\n onFocus,\n onBlur,\n onEnterFullScreen,\n onExitFullScreen,\n fullScreenOnly,\n onPublish,\n onChange,\n theme,\n content,\n ...props\n}) => {\n const editorRef = useRef<RCEHandle>(null);\n const modalEditorRef = useRef<RCEHandle>(null);\n\n const isRichContentChanged = useCallback(\n () =>\n Boolean(\n editorRef.current?.isContentChanged() ||\n modalEditorRef.current?.isContentChanged(),\n ),\n [],\n );\n const handleChange = useCallback(\n (richContent: RicosDocument) => {\n onChange?.(richContent, isRichContentChanged());\n },\n [onChange, isRichContentChanged],\n );\n\n const [loader, setLoader] = useState(false);\n const timer = useRef<number>(0);\n const resetLoader = useCallback(() => {\n window.clearTimeout(timer.current);\n setLoader(false);\n }, []);\n const queueLoader = useCallback(() => {\n timer.current = window.setTimeout(() => {\n setLoader(true);\n }, LOADER_DELAY);\n }, []);\n\n const [isFullScreen, setIsFullScreen] = useState(!!fullScreenOnly);\n const [fullScreenContent, setFullScreenContent] = useState(content);\n\n useEffect(() => {\n if (!isFullScreen) {\n setFullScreenContent(content);\n }\n }, [content, isFullScreen]);\n\n const publishEditorContent = useCallback(\n async (\n editorHandle: RCEHandle | null,\n fallbackContent?: RicosDocument,\n ): Promise<RicosDocument> => {\n if (!editorHandle) {\n return fallbackContent ?? INITIAL_INJECTED_RICH_CONTENT;\n }\n\n return (\n (await editorHandle.prePublish()) ??\n fallbackContent ??\n INITIAL_INJECTED_RICH_CONTENT\n );\n },\n [],\n );\n\n const onOpen = useCallback(async () => {\n let finalContent = content;\n const isChanged = isRichContentChanged();\n\n try {\n finalContent = await publishEditorContent(editorRef.current, content);\n onEnterFullScreen?.(finalContent, isChanged);\n } catch (error) {\n finalContent = content;\n onEnterFullScreen?.(content, isChanged);\n } finally {\n setFullScreenContent(finalContent);\n setIsFullScreen(true);\n\n if (isChanged && finalContent) {\n handleChange(finalContent);\n }\n }\n }, [\n content,\n handleChange,\n isRichContentChanged,\n onEnterFullScreen,\n publishEditorContent,\n ]);\n const onClose = useCallback(async () => {\n queueLoader();\n let finalContent = content;\n const isChanged = isRichContentChanged();\n\n try {\n finalContent = await publishEditorContent(modalEditorRef.current, content);\n onExitFullScreen?.(finalContent, isChanged);\n } catch (error) {\n finalContent = content;\n onExitFullScreen?.(content, isChanged);\n } finally {\n resetLoader();\n setIsFullScreen(false);\n\n if (isChanged && finalContent) {\n handleChange(finalContent);\n }\n }\n }, [\n content,\n handleChange,\n isRichContentChanged,\n onExitFullScreen,\n publishEditorContent,\n queueLoader,\n resetLoader,\n ]);\n\n const handleBlur = useCallback(() => {\n if (isRichContentChanged()) {\n onPublish?.(\n publishEditorContent(editorRef.current, content).catch(\n () => content ?? INITIAL_INJECTED_RICH_CONTENT,\n ),\n );\n }\n onBlur?.();\n }, [\n content,\n isRichContentChanged,\n onBlur,\n onPublish,\n publishEditorContent,\n ]);\n\n useEffect(() => {\n if (!isFullScreen) {\n return;\n }\n\n const handleKeyDown = (e: KeyboardEvent) => {\n if (e.key === 'Escape') {\n e.stopPropagation();\n void onClose();\n }\n };\n\n document.addEventListener('keydown', handleKeyDown, true);\n return () => document.removeEventListener('keydown', handleKeyDown, true);\n }, [isFullScreen, onClose]);\n\n const rceProps = {\n onChange: handleChange,\n };\n\n // Must be memoized: Ricos re-processes `theme` whenever its identity changes,\n // so passing a freshly cloned object every render drives an infinite\n // re-render loop (freezes the tab) once the fullscreen editor mounts.\n const fullScreenTheme = useMemo(\n () =>\n defaultsDeep(cloneDeep(theme), {\n customStyles: { editor: { maxHeight: '100%' } },\n settingsStyles: {\n modals: {\n dialogZIndex: Z_INDEX_MODAL_POPOVER,\n },\n },\n }),\n [theme],\n );\n\n return (\n <>\n <UserSiteFonts />\n {!fullScreenOnly && (\n <RCE\n {...props}\n {...rceProps}\n content={content}\n theme={theme}\n onFocus={onFocus}\n onBlur={handleBlur}\n hidden={isFullScreen}\n ref={editorRef}\n isFullScreen={false}\n onToggleFullScreen={onOpen}\n />\n )}\n <FullscreenModal isOpen={isFullScreen} isLoading={loader}>\n <RCE\n {...props}\n {...rceProps}\n content={fullScreenContent}\n theme={fullScreenTheme}\n autoFocus\n className={classes.modalEditor}\n ref={modalEditorRef}\n isFullScreen\n onToggleFullScreen={onClose}\n />\n </FullscreenModal>\n </>\n );\n};\nRichContentEditor.displayName = 'RichContentEditor';\n"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,aAAA,GAAAH,sBAAA,CAAAC,OAAA;AAGA,IAAAG,MAAA,GAAAC,uBAAA,CAAAJ,OAAA;AAUA,IAAAK,aAAA,GAAAL,OAAA;AAQA,IAAAM,MAAA,GAAAN,OAAA;AAEA,IAAAO,MAAA,GAAAP,OAAA;AACA,IAAAQ,MAAA,GAAAR,OAAA;AACA,IAAAS,cAAA,GAAAT,OAAA;AACA,IAAAU,OAAA,GAAAV,OAAA;AAKA,IAAAW,kBAAA,GAAAX,OAAA;AAOA,IAAAY,QAAA,GAAAZ,OAAA;AACA,IAAAa,mBAAA,GAAAb,OAAA;AACA,IAAAc,uBAAA,GAAAd,OAAA;AAA8D,IAAAe,YAAA;AAAA,SAAAX,wBAAAY,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAd,uBAAA,YAAAA,CAAAY,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,C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A,EAC5B,CACF,eACD3J,MAAA,CAAAuB,OAAA,CAAAyH,aAAA,CAACxI,kBAAA,CAAAuN,eAAe;IAACC,MAAM,EAAEhK,YAAa;IAACiK,SAAS,EAAErC,MAAO;IAAArC,MAAA;IAAAC,QAAA;MAAAC,QAAA,EAAA7I,YAAA;MAAA8I,UAAA;MAAAC,YAAA;IAAA;EAAA,gBACvD3J,MAAA,CAAAuB,OAAA,CAAAyH,aAAA,CAAC3F,GAAG,MAAA0G,SAAA,CAAAxI,OAAA,MACE8J,KAAK,EACL8B,QAAQ;IACZ5J,OAAO,EAAE2I,iBAAkB;IAC3Bd,KAAK,EAAEgC,eAAgB;IACvB1J,SAAS;IACTG,SAAS,EAAEqF,+BAAO,CAACgF,WAAY;IAC/B9J,GAAG,EAAEkH,cAAe;IACpBtH,YAAY;IACZC,kBAAkB,EAAE0I,OAAQ;IAAApD,MAAA;IAAAC,QAAA;MAAAC,QAAA,EAAA7I,YAAA;MAAA8I,UAAA;MAAAC,YAAA;IAAA;EAAA,EAC7B,CACc,CACjB,CAAC;AAEP,CAAC;AAACwE,OAAA,CAAApD,iBAAA,GAAAA,iBAAA;AACFA,iBAAiB,CAAC/H,WAAW,GAAG,mBAAmB","ignoreList":[]}
|
|
@@ -5,19 +5,19 @@ exports.vars = exports.style = exports.stVars = exports.st = exports.namespace =
|
|
|
5
5
|
var _stylableEsmRuntime = require("../../../../stylable-esm-runtime.js");
|
|
6
6
|
// @ts-nocheck
|
|
7
7
|
|
|
8
|
-
var _namespace_ = "
|
|
8
|
+
var _namespace_ = "richcontenteditor524536335";
|
|
9
9
|
var _style_ = _stylableEsmRuntime.classesRuntime.bind(null, _namespace_);
|
|
10
10
|
var cssStates = exports.cssStates = _stylableEsmRuntime.statesRuntime.bind(null, _namespace_);
|
|
11
11
|
var style = exports.style = _style_;
|
|
12
12
|
var st = exports.st = _style_;
|
|
13
13
|
var namespace = exports.namespace = _namespace_;
|
|
14
14
|
var classes = exports.classes = {
|
|
15
|
-
"root": "
|
|
16
|
-
"toolbarContainer": "
|
|
17
|
-
"footerToolbarContainer": "
|
|
18
|
-
"toolbarAndFullScreenButtonWrapper": "
|
|
19
|
-
"editor": "
|
|
20
|
-
"modalEditor": "
|
|
15
|
+
"root": "richcontenteditor524536335__root",
|
|
16
|
+
"toolbarContainer": "richcontenteditor524536335__toolbarContainer",
|
|
17
|
+
"footerToolbarContainer": "richcontenteditor524536335__footerToolbarContainer",
|
|
18
|
+
"toolbarAndFullScreenButtonWrapper": "richcontenteditor524536335__toolbarAndFullScreenButtonWrapper",
|
|
19
|
+
"editor": "richcontenteditor524536335__editor",
|
|
20
|
+
"modalEditor": "richcontenteditor524536335__modalEditor"
|
|
21
21
|
};
|
|
22
22
|
var keyframes = exports.keyframes = {};
|
|
23
23
|
var layers = exports.layers = {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_stylableEsmRuntime","require","_namespace_","_style_","classesRuntime","bind","cssStates","exports","statesRuntime","style","st","namespace","classes","keyframes","layers","containers","stVars","vars"],"sources":["../../../../../../src/components/rich-content/rich-content-input/rich-content-editor/rich-content-editor.st.css.ts"],"sourcesContent":["// @ts-nocheck\n\n\nimport { classesRuntime, statesRuntime } from \"../../../../stylable-esm-runtime.js\";\n\n\n\nvar _namespace_ = \"
|
|
1
|
+
{"version":3,"names":["_stylableEsmRuntime","require","_namespace_","_style_","classesRuntime","bind","cssStates","exports","statesRuntime","style","st","namespace","classes","keyframes","layers","containers","stVars","vars"],"sources":["../../../../../../src/components/rich-content/rich-content-input/rich-content-editor/rich-content-editor.st.css.ts"],"sourcesContent":["// @ts-nocheck\n\n\nimport { classesRuntime, statesRuntime } from \"../../../../stylable-esm-runtime.js\";\n\n\n\nvar _namespace_ = \"richcontenteditor524536335\";\nvar _style_ = classesRuntime.bind(null, _namespace_);\n\nexport var cssStates = statesRuntime.bind(null, _namespace_);\nexport var style: import(\"@stylable/runtime\").STFunction = _style_;\nexport var st: import(\"@stylable/runtime\").STFunction = _style_;\n\nexport var namespace = _namespace_;\nexport var classes = {\"root\":\"richcontenteditor524536335__root\",\"toolbarContainer\":\"richcontenteditor524536335__toolbarContainer\",\"footerToolbarContainer\":\"richcontenteditor524536335__footerToolbarContainer\",\"toolbarAndFullScreenButtonWrapper\":\"richcontenteditor524536335__toolbarAndFullScreenButtonWrapper\",\"editor\":\"richcontenteditor524536335__editor\",\"modalEditor\":\"richcontenteditor524536335__modalEditor\"};\nexport var keyframes = {}; \nexport var layers = {};\nexport var containers = {};\nexport var stVars = {}; \nexport var vars = {\"wds-font-family-default\":\"--wds-font-family-default\"}; \n\n\n\n\n"],"mappings":";;;;AAGA,IAAAA,mBAAA,GAAAC,OAAA;AAHA;;AAOA,IAAIC,WAAW,GAAG,4BAA4B;AAC9C,IAAIC,OAAO,GAAGC,kCAAc,CAACC,IAAI,CAAC,IAAI,EAAEH,WAAW,CAAC;AAE7C,IAAII,SAAS,GAAAC,OAAA,CAAAD,SAAA,GAAGE,iCAAa,CAACH,IAAI,CAAC,IAAI,EAAEH,WAAW,CAAC;AACrD,IAAIO,KAA6C,GAAAF,OAAA,CAAAE,KAAA,GAAGN,OAAO;AAC3D,IAAIO,EAA0C,GAAAH,OAAA,CAAAG,EAAA,GAAGP,OAAO;AAExD,IAAIQ,SAAS,GAAAJ,OAAA,CAAAI,SAAA,GAAGT,WAAW;AAC3B,IAAIU,OAAO,GAAAL,OAAA,CAAAK,OAAA,GAAG;EAAC,MAAM,EAAC,kCAAkC;EAAC,kBAAkB,EAAC,8CAA8C;EAAC,wBAAwB,EAAC,oDAAoD;EAAC,mCAAmC,EAAC,+DAA+D;EAAC,QAAQ,EAAC,oCAAoC;EAAC,aAAa,EAAC;AAAyC,CAAC;AACnZ,IAAIC,SAAS,GAAAN,OAAA,CAAAM,SAAA,GAAG,CAAC,CAAC;AAClB,IAAIC,MAAM,GAAAP,OAAA,CAAAO,MAAA,GAAG,CAAC,CAAC;AACf,IAAIC,UAAU,GAAAR,OAAA,CAAAQ,UAAA,GAAG,CAAC,CAAC;AACnB,IAAIC,MAAM,GAAAT,OAAA,CAAAS,MAAA,GAAG,CAAC,CAAC;AACf,IAAIC,IAAI,GAAAV,OAAA,CAAAU,IAAA,GAAG;EAAC,yBAAyB,EAAC;AAA2B,CAAC","ignoreList":[]}
|
|
@@ -3,83 +3,99 @@
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
4
|
exports.__esModule = true;
|
|
5
5
|
exports.ExternalToolbar = void 0;
|
|
6
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
7
6
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
8
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
8
|
var _ricos = require("@wix/ricos");
|
|
10
|
-
var _utils = require("../../../../utils");
|
|
11
9
|
var _richContentToolbarStCss = require("./rich-content-toolbar.st.css.js");
|
|
12
10
|
var _jsxFileName = "/home/builduser/work/843658b9f44192f0/packages/fields/dist/cjs/components/rich-content/rich-content-input/rich-content-editor/rich-content-toolbar.tsx";
|
|
13
11
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
14
|
-
const BUTTONS_ORDER = [_ricos.INSERT_PLUGIN_BUTTONS.IMAGE, _ricos.INSERT_PLUGIN_BUTTONS.VIDEO, _ricos.INSERT_PLUGIN_BUTTONS.GALLERY, _ricos.INSERT_PLUGIN_BUTTONS.LAYOUT, _ricos.INSERT_PLUGIN_BUTTONS.DIVIDER, _ricos.INSERT_PLUGIN_BUTTONS.TABLE, _ricos.INSERT_PLUGIN_BUTTONS.FILE, _ricos.INSERT_PLUGIN_BUTTONS.HTML, _ricos.INSERT_PLUGIN_BUTTONS.INSTAGRAM, _ricos.INSERT_PLUGIN_BUTTONS.TWITTER, _ricos.INSERT_PLUGIN_BUTTONS.TIKTOK, _ricos.INSERT_PLUGIN_BUTTONS.STORES, _ricos.INSERT_PLUGIN_BUTTONS.BOOKINGS, _ricos.INSERT_PLUGIN_BUTTONS.EVENTS, _ricos.INSERT_PLUGIN_BUTTONS.EMOJI, _ricos.INSERT_PLUGIN_BUTTONS.GIF, _ricos.INSERT_PLUGIN_BUTTONS.CODE_BLOCK, _ricos.INSERT_PLUGIN_BUTTONS.COLLAPSIBLE_LIST, _ricos.INSERT_PLUGIN_BUTTONS.BUTTON, _ricos.INSERT_PLUGIN_BUTTONS.UNDO, _ricos.INSERT_PLUGIN_BUTTONS.REDO];
|
|
15
12
|
class ExternalToolbar extends _react.Component {
|
|
16
13
|
constructor(...args) {
|
|
17
14
|
super(...args);
|
|
18
15
|
(0, _defineProperty2.default)(this, "onMouseDown", event => event.preventDefault());
|
|
19
|
-
(0, _defineProperty2.default)(this, "renderButton",
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
16
|
+
(0, _defineProperty2.default)(this, "renderButton", button => {
|
|
17
|
+
if (button.kind === 'separator') {
|
|
18
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
19
|
+
className: _richContentToolbarStCss.classes.separator,
|
|
20
|
+
key: button.id,
|
|
21
|
+
__self: this,
|
|
22
|
+
__source: {
|
|
23
|
+
fileName: _jsxFileName,
|
|
24
|
+
lineNumber: 17,
|
|
25
|
+
columnNumber: 14
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
if (button.kind === 'custom') {
|
|
30
|
+
const CustomButton = button.component;
|
|
31
|
+
return /*#__PURE__*/_react.default.createElement(CustomButton, {
|
|
32
|
+
key: button.id,
|
|
33
|
+
__self: this,
|
|
34
|
+
__source: {
|
|
35
|
+
fileName: _jsxFileName,
|
|
36
|
+
lineNumber: 22,
|
|
37
|
+
columnNumber: 14
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
const Icon = button.icon;
|
|
42
|
+
const handleClick = event => {
|
|
43
|
+
if (button.kind === 'dropdown') {
|
|
44
|
+
var _button$options$;
|
|
45
|
+
const optionId = button.selectedId ?? ((_button$options$ = button.options[0]) == null ? void 0 : _button$options$.id);
|
|
46
|
+
if (optionId) {
|
|
47
|
+
button.onSelect(optionId, {
|
|
48
|
+
referenceElement: event.currentTarget
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
button.onClick({
|
|
54
|
+
referenceElement: event.currentTarget
|
|
55
|
+
});
|
|
56
|
+
};
|
|
28
57
|
return /*#__PURE__*/_react.default.createElement(_ricos.Tooltip, {
|
|
29
|
-
content: tooltip,
|
|
30
|
-
key:
|
|
58
|
+
content: button.tooltip,
|
|
59
|
+
key: button.id,
|
|
31
60
|
__self: this,
|
|
32
61
|
__source: {
|
|
33
62
|
fileName: _jsxFileName,
|
|
34
|
-
lineNumber:
|
|
63
|
+
lineNumber: 43,
|
|
35
64
|
columnNumber: 7
|
|
36
65
|
}
|
|
37
66
|
}, /*#__PURE__*/_react.default.createElement("button", {
|
|
38
67
|
className: _richContentToolbarStCss.classes.toolbarButton,
|
|
39
|
-
disabled: isDisabled
|
|
40
|
-
"data-hook":
|
|
41
|
-
onClick:
|
|
68
|
+
disabled: button.isDisabled,
|
|
69
|
+
"data-hook": button.id,
|
|
70
|
+
onClick: handleClick,
|
|
42
71
|
onMouseDown: this.onMouseDown,
|
|
43
72
|
__self: this,
|
|
44
73
|
__source: {
|
|
45
74
|
fileName: _jsxFileName,
|
|
46
|
-
lineNumber:
|
|
75
|
+
lineNumber: 44,
|
|
47
76
|
columnNumber: 9
|
|
48
77
|
}
|
|
49
78
|
}, /*#__PURE__*/_react.default.createElement(Icon, {
|
|
50
79
|
__self: this,
|
|
51
80
|
__source: {
|
|
52
81
|
fileName: _jsxFileName,
|
|
53
|
-
lineNumber:
|
|
82
|
+
lineNumber: 51,
|
|
54
83
|
columnNumber: 11
|
|
55
84
|
}
|
|
56
85
|
})));
|
|
57
86
|
});
|
|
58
87
|
}
|
|
59
88
|
render() {
|
|
89
|
+
var _this$props$buttons;
|
|
60
90
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
61
91
|
className: _richContentToolbarStCss.classes.toolbar,
|
|
62
92
|
__self: this,
|
|
63
93
|
__source: {
|
|
64
94
|
fileName: _jsxFileName,
|
|
65
|
-
lineNumber:
|
|
95
|
+
lineNumber: 59,
|
|
66
96
|
columnNumber: 7
|
|
67
97
|
}
|
|
68
|
-
},
|
|
69
|
-
var _this$props$buttons;
|
|
70
|
-
return (_this$props$buttons = this.props.buttons) == null ? void 0 : _this$props$buttons[name];
|
|
71
|
-
}).filter(_utils.isTruthy).map((buttonProps, i) => {
|
|
72
|
-
const Button = this.renderButton;
|
|
73
|
-
return /*#__PURE__*/_react.default.createElement(Button, (0, _extends2.default)({}, buttonProps, {
|
|
74
|
-
key: i,
|
|
75
|
-
__self: this,
|
|
76
|
-
__source: {
|
|
77
|
-
fileName: _jsxFileName,
|
|
78
|
-
lineNumber: 86,
|
|
79
|
-
columnNumber: 20
|
|
80
|
-
}
|
|
81
|
-
}));
|
|
82
|
-
}));
|
|
98
|
+
}, (_this$props$buttons = this.props.buttons) == null ? void 0 : _this$props$buttons.map(button => this.renderButton(button)));
|
|
83
99
|
}
|
|
84
100
|
}
|
|
85
101
|
exports.ExternalToolbar = ExternalToolbar;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","_ricos","
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_ricos","_richContentToolbarStCss","_jsxFileName","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","ExternalToolbar","Component","constructor","args","_defineProperty2","event","preventDefault","button","kind","createElement","className","classes","separator","key","id","__self","__source","fileName","lineNumber","columnNumber","CustomButton","component","Icon","icon","handleClick","_button$options$","optionId","selectedId","options","onSelect","referenceElement","currentTarget","onClick","Tooltip","content","tooltip","toolbarButton","disabled","isDisabled","onMouseDown","render","_this$props$buttons","toolbar","props","buttons","map","renderButton","exports"],"sources":["../../../../../../src/components/rich-content/rich-content-input/rich-content-editor/rich-content-toolbar.tsx"],"sourcesContent":["import React, { Component } from 'react';\n\nimport type { ExternalToolbarButton as RicosExternalToolbarButton } from '@wix/ricos';\nimport { Tooltip } from '@wix/ricos';\n\nimport { classes } from './rich-content-toolbar.st.css.js';\n\nexport interface ExternalToolbarProps {\n buttons?: readonly RicosExternalToolbarButton[];\n}\n\nexport class ExternalToolbar extends Component<ExternalToolbarProps> {\n private onMouseDown = (event: React.MouseEvent) => event.preventDefault();\n\n private renderButton = (button: RicosExternalToolbarButton) => {\n if (button.kind === 'separator') {\n return <div className={classes.separator} key={button.id} />;\n }\n\n if (button.kind === 'custom') {\n const CustomButton = button.component;\n return <CustomButton key={button.id} />;\n }\n\n const Icon = button.icon;\n const handleClick = (event: React.MouseEvent<HTMLButtonElement>) => {\n if (button.kind === 'dropdown') {\n const optionId = button.selectedId ?? button.options[0]?.id;\n if (optionId) {\n button.onSelect(optionId, {\n referenceElement: event.currentTarget,\n });\n }\n return;\n }\n\n button.onClick({\n referenceElement: event.currentTarget,\n });\n };\n\n return (\n <Tooltip content={button.tooltip} key={button.id}>\n <button\n className={classes.toolbarButton}\n disabled={button.isDisabled}\n data-hook={button.id}\n onClick={handleClick}\n onMouseDown={this.onMouseDown}\n >\n <Icon />\n </button>\n </Toolt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,MAAM,CAAC,CAC3D,CAAC;EAEV;AACF;AAACwC,OAAA,CAAA/C,eAAA,GAAAA,eAAA","ignoreList":[]}
|
|
@@ -5,16 +5,17 @@ exports.vars = exports.style = exports.stVars = exports.st = exports.namespace =
|
|
|
5
5
|
var _stylableEsmRuntime = require("../../../../stylable-esm-runtime.js");
|
|
6
6
|
// @ts-nocheck
|
|
7
7
|
|
|
8
|
-
var _namespace_ = "
|
|
8
|
+
var _namespace_ = "richcontenttoolbar2983172482";
|
|
9
9
|
var _style_ = _stylableEsmRuntime.classesRuntime.bind(null, _namespace_);
|
|
10
10
|
var cssStates = exports.cssStates = _stylableEsmRuntime.statesRuntime.bind(null, _namespace_);
|
|
11
11
|
var style = exports.style = _style_;
|
|
12
12
|
var st = exports.st = _style_;
|
|
13
13
|
var namespace = exports.namespace = _namespace_;
|
|
14
14
|
var classes = exports.classes = {
|
|
15
|
-
"root": "
|
|
16
|
-
"toolbar": "
|
|
17
|
-
"toolbarButton": "
|
|
15
|
+
"root": "richcontenttoolbar2983172482__root",
|
|
16
|
+
"toolbar": "richcontenttoolbar2983172482__toolbar",
|
|
17
|
+
"toolbarButton": "richcontenttoolbar2983172482__toolbarButton",
|
|
18
|
+
"separator": "richcontenttoolbar2983172482__separator"
|
|
18
19
|
};
|
|
19
20
|
var keyframes = exports.keyframes = {};
|
|
20
21
|
var layers = exports.layers = {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_stylableEsmRuntime","require","_namespace_","_style_","classesRuntime","bind","cssStates","exports","statesRuntime","style","st","namespace","classes","keyframes","layers","containers","stVars","vars"],"sources":["../../../../../../src/components/rich-content/rich-content-input/rich-content-editor/rich-content-toolbar.st.css.ts"],"sourcesContent":["// @ts-nocheck\n\n\nimport { classesRuntime, statesRuntime } from \"../../../../stylable-esm-runtime.js\";\n\n\n\nvar _namespace_ = \"
|
|
1
|
+
{"version":3,"names":["_stylableEsmRuntime","require","_namespace_","_style_","classesRuntime","bind","cssStates","exports","statesRuntime","style","st","namespace","classes","keyframes","layers","containers","stVars","vars"],"sources":["../../../../../../src/components/rich-content/rich-content-input/rich-content-editor/rich-content-toolbar.st.css.ts"],"sourcesContent":["// @ts-nocheck\n\n\nimport { classesRuntime, statesRuntime } from \"../../../../stylable-esm-runtime.js\";\n\n\n\nvar _namespace_ = \"richcontenttoolbar2983172482\";\nvar _style_ = classesRuntime.bind(null, _namespace_);\n\nexport var cssStates = statesRuntime.bind(null, _namespace_);\nexport var style: import(\"@stylable/runtime\").STFunction = _style_;\nexport var st: import(\"@stylable/runtime\").STFunction = _style_;\n\nexport var namespace = _namespace_;\nexport var classes = {\"root\":\"richcontenttoolbar2983172482__root\",\"toolbar\":\"richcontenttoolbar2983172482__toolbar\",\"toolbarButton\":\"richcontenttoolbar2983172482__toolbarButton\",\"separator\":\"richcontenttoolbar2983172482__separator\"};\nexport var keyframes = {}; \nexport var layers = {};\nexport var containers = {};\nexport var stVars = {}; \nexport var vars = {}; \n\n\n\n\n"],"mappings":";;;;AAGA,IAAAA,mBAAA,GAAAC,OAAA;AAHA;;AAOA,IAAIC,WAAW,GAAG,8BAA8B;AAChD,IAAIC,OAAO,GAAGC,kCAAc,CAACC,IAAI,CAAC,IAAI,EAAEH,WAAW,CAAC;AAE7C,IAAII,SAAS,GAAAC,OAAA,CAAAD,SAAA,GAAGE,iCAAa,CAACH,IAAI,CAAC,IAAI,EAAEH,WAAW,CAAC;AACrD,IAAIO,KAA6C,GAAAF,OAAA,CAAAE,KAAA,GAAGN,OAAO;AAC3D,IAAIO,EAA0C,GAAAH,OAAA,CAAAG,EAAA,GAAGP,OAAO;AAExD,IAAIQ,SAAS,GAAAJ,OAAA,CAAAI,SAAA,GAAGT,WAAW;AAC3B,IAAIU,OAAO,GAAAL,OAAA,CAAAK,OAAA,GAAG;EAAC,MAAM,EAAC,oCAAoC;EAAC,SAAS,EAAC,uCAAuC;EAAC,eAAe,EAAC,6CAA6C;EAAC,WAAW,EAAC;AAAyC,CAAC;AACjO,IAAIC,SAAS,GAAAN,OAAA,CAAAM,SAAA,GAAG,CAAC,CAAC;AAClB,IAAIC,MAAM,GAAAP,OAAA,CAAAO,MAAA,GAAG,CAAC,CAAC;AACf,IAAIC,UAAU,GAAAR,OAAA,CAAAQ,UAAA,GAAG,CAAC,CAAC;AACnB,IAAIC,MAAM,GAAAT,OAAA,CAAAS,MAAA,GAAG,CAAC,CAAC;AACf,IAAIC,IAAI,GAAAV,OAAA,CAAAU,IAAA,GAAG,CAAC,CAAC","ignoreList":[]}
|
|
@@ -35,7 +35,7 @@ const RCV = ({
|
|
|
35
35
|
__self: void 0,
|
|
36
36
|
__source: {
|
|
37
37
|
fileName: _jsxFileName,
|
|
38
|
-
lineNumber:
|
|
38
|
+
lineNumber: 45,
|
|
39
39
|
columnNumber: 5
|
|
40
40
|
}
|
|
41
41
|
}, /*#__PURE__*/_react.default.createElement(_richContentCommon.ToggleFullscreenButton, {
|
|
@@ -44,7 +44,7 @@ const RCV = ({
|
|
|
44
44
|
__self: void 0,
|
|
45
45
|
__source: {
|
|
46
46
|
fileName: _jsxFileName,
|
|
47
|
-
lineNumber:
|
|
47
|
+
lineNumber: 51,
|
|
48
48
|
columnNumber: 7
|
|
49
49
|
}
|
|
50
50
|
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -53,16 +53,16 @@ const RCV = ({
|
|
|
53
53
|
__self: void 0,
|
|
54
54
|
__source: {
|
|
55
55
|
fileName: _jsxFileName,
|
|
56
|
-
lineNumber:
|
|
56
|
+
lineNumber: 55,
|
|
57
57
|
columnNumber: 7
|
|
58
58
|
}
|
|
59
|
-
}, /*#__PURE__*/_react.default.createElement(_ricos.
|
|
59
|
+
}, /*#__PURE__*/_react.default.createElement(_ricos.RicosViewer, (0, _extends2.default)({}, ricosProps, wixRicosProps, {
|
|
60
60
|
plugins: plugins,
|
|
61
|
-
content:
|
|
61
|
+
content: content ?? (0, _ricos.fromPlainText)(''),
|
|
62
62
|
__self: void 0,
|
|
63
63
|
__source: {
|
|
64
64
|
fileName: _jsxFileName,
|
|
65
|
-
lineNumber:
|
|
65
|
+
lineNumber: 56,
|
|
66
66
|
columnNumber: 9
|
|
67
67
|
}
|
|
68
68
|
}))));
|
|
@@ -88,7 +88,7 @@ const RichContentViewer = ({
|
|
|
88
88
|
__self: void 0,
|
|
89
89
|
__source: {
|
|
90
90
|
fileName: _jsxFileName,
|
|
91
|
-
lineNumber:
|
|
91
|
+
lineNumber: 95,
|
|
92
92
|
columnNumber: 7
|
|
93
93
|
}
|
|
94
94
|
}), !fullScreenOnly && /*#__PURE__*/_react.default.createElement(RCV, (0, _extends2.default)({}, props, {
|
|
@@ -99,7 +99,7 @@ const RichContentViewer = ({
|
|
|
99
99
|
__self: void 0,
|
|
100
100
|
__source: {
|
|
101
101
|
fileName: _jsxFileName,
|
|
102
|
-
lineNumber:
|
|
102
|
+
lineNumber: 97,
|
|
103
103
|
columnNumber: 9
|
|
104
104
|
}
|
|
105
105
|
})), /*#__PURE__*/_react.default.createElement(_richContentCommon.FullscreenModal, {
|
|
@@ -107,7 +107,7 @@ const RichContentViewer = ({
|
|
|
107
107
|
__self: void 0,
|
|
108
108
|
__source: {
|
|
109
109
|
fileName: _jsxFileName,
|
|
110
|
-
lineNumber:
|
|
110
|
+
lineNumber: 105,
|
|
111
111
|
columnNumber: 7
|
|
112
112
|
}
|
|
113
113
|
}, /*#__PURE__*/_react.default.createElement(RCV, (0, _extends2.default)({}, props, {
|
|
@@ -117,7 +117,7 @@ const RichContentViewer = ({
|
|
|
117
117
|
__self: void 0,
|
|
118
118
|
__source: {
|
|
119
119
|
fileName: _jsxFileName,
|
|
120
|
-
lineNumber:
|
|
120
|
+
lineNumber: 106,
|
|
121
121
|
columnNumber: 9
|
|
122
122
|
}
|
|
123
123
|
}))));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireDefault","require","_ricos","_hooks","_utils","_userSiteFonts","_richContentCommon","_plugins","_richContentViewerStCss","_jsxFileName","RCV","isFullScreen","onToggleFullscreen","content","className","dataHook","tabIndex","ricosProps","wixRicosProps","useWixRicosProps","plugins","usePlugins","default","createElement","st","classes","root","onMouseDown","preventEvent","__self","__source","fileName","lineNumber","columnNumber","ToggleFullscreenButton","onToggleFullScreen","viewer","
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_ricos","_hooks","_utils","_userSiteFonts","_richContentCommon","_plugins","_richContentViewerStCss","_jsxFileName","RCV","isFullScreen","onToggleFullscreen","content","className","dataHook","tabIndex","ricosProps","wixRicosProps","useWixRicosProps","plugins","usePlugins","default","createElement","st","classes","root","onMouseDown","preventEvent","__self","__source","fileName","lineNumber","columnNumber","ToggleFullscreenButton","onToggleFullScreen","viewer","RicosViewer","_extends2","fromPlainText","displayName","RichContentViewer","fullScreenOnly","onEnterFullScreen","onExitFullScreen","props","isOpen","onOpen","onClose","useOpenState","Fragment","UserSiteFonts","FullscreenModal","modalViewer","exports"],"sources":["../../../../../../src/components/rich-content/rich-content-input/rich-content-viewer/rich-content-viewer.tsx"],"sourcesContent":["import React from 'react';\n\nimport type { RicosDocument, RicosViewerProps } from '@wix/ricos';\nimport { RicosViewer, fromPlainText } from '@wix/ricos';\nimport '@wix/ricos/css/ricos-viewer.global.css';\n\nimport { useOpenState } from '../../../../hooks';\nimport { preventEvent } from '../../../../utils';\nimport { UserSiteFonts } from '../../../user-site-fonts';\n\nimport {\n FullscreenModal,\n ToggleFullscreenButton,\n useWixRicosProps,\n} from '../rich-content-common';\nimport { usePlugins } from './plugins';\nimport { st, classes } from './rich-content-viewer.st.css.js';\n\ntype RicosProps = Pick<RicosViewerProps, 'biSettings' | 'children' | 'theme'> & {\n wixExperiments?: unknown;\n};\n\ninterface RCVProps extends RicosProps {\n isFullScreen: boolean;\n onToggleFullscreen: () => void;\n content?: RicosDocument;\n className?: string;\n tabIndex?: number;\n dataHook?: string;\n}\n\nconst RCV: React.FC<RCVProps> = ({\n isFullScreen,\n onToggleFullscreen,\n content,\n className,\n dataHook,\n tabIndex,\n ...ricosProps\n}) => {\n const wixRicosProps = useWixRicosProps();\n const plugins = usePlugins();\n\n return (\n <div\n data-hook=\"rich-content.viewer\"\n className={st(classes.root, { isFullScreen }, className)}\n onMouseDown={preventEvent}\n tabIndex={tabIndex}\n >\n <ToggleFullscreenButton\n isFullScreen={isFullScreen}\n onToggleFullScreen={onToggleFullscreen}\n />\n <div data-hook={dataHook} className={classes.viewer}>\n <RicosViewer\n {...ricosProps}\n {...wixRicosProps}\n plugins={plugins}\n content={content ?? fromPlainText('')}\n />\n </div>\n </div>\n );\n};\n\nRCV.displayName = 'RCV';\n\nexport interface RichContentViewerProps\n extends Omit<RCVProps, 'isFullScreen' | 'onToggleFullscreen'> {\n fullScreenOnly?: boolean;\n onEnterFullScreen?: () => void;\n onExitFullScreen?: () => void;\n}\n\nexport const RichContentViewer: React.FC<RichContentViewerProps> = ({\n fullScreenOnly,\n onEnterFullScreen,\n onExitFullScreen,\n className,\n tabIndex,\n ...props\n}) => {\n const {\n isOpen: isFullScreen,\n onOpen,\n onClose,\n } = useOpenState(!!fullScreenOnly, {\n onOpen: onEnterFullScreen,\n onClose: onExitFullScreen,\n });\n\n return (\n <>\n <UserSiteFonts />\n {!fullScreenOnly && (\n <RCV\n {...props}\n isFullScreen={false}\n onToggleFullscreen={onOpen}\n className={className}\n tabIndex={tabIndex}\n />\n )}\n <FullscreenModal isOpen={isFullScreen}>\n <RCV\n {...props}\n isFullScreen\n onToggleFullscreen={onClose}\n className={classes.modalViewer}\n />\n </FullscreenModal>\n </>\n );\n};\n\nRichContentViewer.displayName = 'RichContentViewer';\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAGA,IAAAC,MAAA,GAAAD,OAAA;AACAA,OAAA;AAEA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,cAAA,GAAAJ,OAAA;AAEA,IAAAK,kBAAA,G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jB,kBAAA,CAAA8C,eAAe;IAACN,MAAM,EAAEnC,YAAa;IAAAkB,MAAA;IAAAC,QAAA;MAAAC,QAAA,EAAAtB,YAAA;MAAAuB,UAAA;MAAAC,YAAA;IAAA;EAAA,gBACpClC,MAAA,CAAAuB,OAAA,CAAAC,aAAA,CAACb,GAAG,MAAA4B,SAAA,CAAAhB,OAAA,MACEuB,KAAK;IACTlC,YAAY;IACZC,kBAAkB,EAAEoC,OAAQ;IAC5BlC,SAAS,EAAEW,+BAAO,CAAC4B,WAAY;IAAAxB,MAAA;IAAAC,QAAA;MAAAC,QAAA,EAAAtB,YAAA;MAAAuB,UAAA;MAAAC,YAAA;IAAA;EAAA,EAChC,CACc,CACjB,CAAC;AAEP,CAAC;AAACqB,OAAA,CAAAb,iBAAA,GAAAA,iBAAA;AAEFA,iBAAiB,CAACD,WAAW,GAAG,mBAAmB","ignoreList":[]}
|
|
@@ -5,16 +5,16 @@ exports.vars = exports.style = exports.stVars = exports.st = exports.namespace =
|
|
|
5
5
|
var _stylableEsmRuntime = require("../../../../stylable-esm-runtime.js");
|
|
6
6
|
// @ts-nocheck
|
|
7
7
|
|
|
8
|
-
var _namespace_ = "
|
|
8
|
+
var _namespace_ = "richcontentviewer511243834";
|
|
9
9
|
var _style_ = _stylableEsmRuntime.classesRuntime.bind(null, _namespace_);
|
|
10
10
|
var cssStates = exports.cssStates = _stylableEsmRuntime.statesRuntime.bind(null, _namespace_);
|
|
11
11
|
var style = exports.style = _style_;
|
|
12
12
|
var st = exports.st = _style_;
|
|
13
13
|
var namespace = exports.namespace = _namespace_;
|
|
14
14
|
var classes = exports.classes = {
|
|
15
|
-
"root": "
|
|
16
|
-
"viewer": "
|
|
17
|
-
"modalViewer": "
|
|
15
|
+
"root": "richcontentviewer511243834__root",
|
|
16
|
+
"viewer": "richcontentviewer511243834__viewer",
|
|
17
|
+
"modalViewer": "richcontentviewer511243834__modalViewer"
|
|
18
18
|
};
|
|
19
19
|
var keyframes = exports.keyframes = {};
|
|
20
20
|
var layers = exports.layers = {};
|