@wix/patterns-fields 1.66.0 → 1.68.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/auto-field-types/validations.js +9 -13
- package/dist/cjs/auto-field-types/validations.js.map +1 -1
- 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/cell-color-view.js +10 -9
- package/dist/cjs/components/color-view/cell-color-view.js.map +1 -1
- package/dist/cjs/components/color-view/cell-color-view.st.css.js +3 -3
- package/dist/cjs/components/color-view/cell-color-view.st.css.js.map +1 -1
- package/dist/cjs/components/color-view/color-view.js +5 -3
- package/dist/cjs/components/color-view/color-view.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/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/cell-media-gallery-view.js +3 -3
- package/dist/cjs/components/media-gallery/cell-media-gallery-view.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/cell-multi-document-edit.st.css.js +3 -3
- package/dist/cjs/components/multi-document/cell-multi-document-edit.st.css.js.map +1 -1
- package/dist/cjs/components/multi-document/cell-multi-document-view.js +1 -1
- package/dist/cjs/components/multi-document/cell-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/reference/cell-multi-reference-input.st.css.js +2 -2
- package/dist/cjs/components/reference/cell-multi-reference-input.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/reference/reference-avatar.js +4 -2
- package/dist/cjs/components/reference/reference-avatar.js.map +1 -1
- package/dist/cjs/components/rich-content/cdn/load-ricos.js +135 -0
- package/dist/cjs/components/rich-content/cdn/load-ricos.js.map +1 -0
- package/dist/cjs/components/rich-content/cdn/types.js +4 -0
- package/dist/cjs/components/rich-content/cdn/types.js.map +1 -0
- package/dist/cjs/components/rich-content/cell-rich-content-input.js +3 -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 +2 -2
- package/dist/cjs/components/rich-content/cell-rich-content-view.js.map +1 -1
- package/dist/cjs/components/rich-content/editor.js.map +1 -1
- package/dist/cjs/components/rich-content/form-rich-content.js +2 -2
- package/dist/cjs/components/rich-content/form-rich-content.js.map +1 -1
- package/dist/cjs/components/rich-content/hooks/use-plain-text-rich-content.js +5 -3
- 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.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/default-value-read-only-input/rich-content-form-read-only-input.js.map +1 -1
- package/dist/cjs/components/rich-content/rich-content-input/form-input/rich-content-form-input.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-input/use-rich-content-form-input.js.map +1 -1
- package/dist/cjs/components/rich-content/rich-content-input/form-read-only-input/rich-content-form-read-only-input.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/hooks.js +7 -8
- package/dist/cjs/components/rich-content/rich-content-input/hooks.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 +15 -3
- 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-common/types.js.map +1 -1
- package/dist/cjs/components/rich-content/rich-content-input/rich-content-editor/plugins.js +38 -31
- 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 +27 -22
- 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 +10 -9
- 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.js +5 -5
- 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/plugins.js +11 -17
- package/dist/cjs/components/rich-content/rich-content-input/rich-content-viewer/plugins.js.map +1 -1
- package/dist/cjs/components/rich-content/rich-content-input/rich-content-viewer/rich-content-viewer.js +47 -15
- 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-content/rich-content-input/services/rich-content-document-http-service.js.map +1 -1
- package/dist/cjs/components/rich-content/rich-content-input/services/types.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/url/url-view.js +10 -9
- package/dist/cjs/components/url/url-view.js.map +1 -1
- package/dist/cjs/exports/ricos-statics-legacy.js +10 -0
- package/dist/cjs/exports/ricos-statics-legacy.js.map +1 -0
- package/dist/cjs/exports/ricos-statics.js +10 -0
- package/dist/cjs/exports/ricos-statics.js.map +1 -0
- package/dist/cjs/styles.global.css +1 -1
- package/dist/cjs/utils/request-idle-callback.js +4 -1
- package/dist/cjs/utils/request-idle-callback.js.map +1 -1
- package/dist/cjs/validations/rich-content.js +26 -6
- package/dist/cjs/validations/rich-content.js.map +1 -1
- package/dist/esm/auto-field-types/validations.js +10 -13
- package/dist/esm/auto-field-types/validations.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/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-view.js +4 -3
- package/dist/esm/components/color-view/cell-color-view.js.map +1 -1
- package/dist/esm/components/color-view/cell-color-view.st.css.js +2 -2
- package/dist/esm/components/color-view/color-view.js +3 -2
- package/dist/esm/components/color-view/color-view.js.map +1 -1
- 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/document/form-document-field.st.css.js.map +1 -1
- 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/thumbnail-replace-overlay.st.css.js +2 -2
- package/dist/esm/components/image/thumbnail-replace-overlay.st.css.js.map +1 -1
- 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/cell-media-gallery-view.js +3 -1
- package/dist/esm/components/media-gallery/cell-media-gallery-view.js.map +1 -1
- 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-loader/media-loader.st.css.js.map +1 -1
- package/dist/esm/components/media-tag/web-media-tag/media-tag.st.css.js +2 -2
- package/dist/esm/components/media-tag/web-media-tag/media-tag.st.css.js.map +1 -1
- package/dist/esm/components/multi-document/cell-multi-document-edit.st.css.js +2 -2
- package/dist/esm/components/multi-document/cell-multi-document-view.js +1 -1
- package/dist/esm/components/multi-document/cell-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/reference/cell-multi-reference-input.st.css.js +2 -2
- package/dist/esm/components/reference/cell-reference-input.st.css.js +2 -2
- package/dist/esm/components/reference/reference-avatar.js +2 -1
- package/dist/esm/components/reference/reference-avatar.js.map +1 -1
- package/dist/esm/components/rich-content/cdn/load-ricos.js +126 -0
- package/dist/esm/components/rich-content/cdn/load-ricos.js.map +1 -0
- package/dist/esm/components/rich-content/cdn/types.js +2 -0
- package/dist/esm/components/rich-content/cdn/types.js.map +1 -0
- package/dist/esm/components/rich-content/cell-rich-content-input.js +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 -1
- package/dist/esm/components/rich-content/editor.js.map +1 -1
- package/dist/esm/components/rich-content/form-rich-content.js +1 -1
- package/dist/esm/components/rich-content/form-rich-content.js.map +1 -1
- package/dist/esm/components/rich-content/hooks/use-plain-text-rich-content.js +3 -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/form-input/rich-content-form-input.st.css.js +2 -2
- package/dist/esm/components/rich-content/rich-content-input/form-input/rich-content-form-input.st.css.js.map +1 -1
- 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/form-read-only-input/rich-content-form-read-only-input.st.css.js.map +1 -1
- package/dist/esm/components/rich-content/rich-content-input/hooks.js +4 -7
- package/dist/esm/components/rich-content/rich-content-input/hooks.js.map +1 -1
- 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/hooks.js +14 -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-common/toggle-fullscreen-button/toggle-fullscreen-button.st.css.js.map +1 -1
- package/dist/esm/components/rich-content/rich-content-input/rich-content-editor/plugins.js +49 -41
- 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 +10 -5
- 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 +3 -1
- 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.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/plugins.js +31 -37
- package/dist/esm/components/rich-content/rich-content-input/rich-content-viewer/plugins.js.map +1 -1
- package/dist/esm/components/rich-content/rich-content-input/rich-content-viewer/rich-content-viewer.js +11 -5
- 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-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-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/text/text-view.st.css.js.map +1 -1
- package/dist/esm/components/url/url-view.js +3 -2
- package/dist/esm/components/url/url-view.js.map +1 -1
- package/dist/esm/exports/ricos-statics-legacy.js +6 -0
- package/dist/esm/exports/ricos-statics-legacy.js.map +1 -0
- package/dist/esm/exports/ricos-statics.js +10 -0
- package/dist/esm/exports/ricos-statics.js.map +1 -0
- package/dist/esm/styles.global.css +1 -1
- package/dist/esm/utils/request-idle-callback.js +6 -1
- package/dist/esm/utils/request-idle-callback.js.map +1 -1
- package/dist/esm/validations/rich-content.js +18 -1
- package/dist/esm/validations/rich-content.js.map +1 -1
- package/dist/types/auto-field-types/validations.d.ts +8 -0
- package/dist/types/auto-field-types/validations.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-view.d.ts.map +1 -1
- package/dist/types/components/color-view/color-view.d.ts.map +1 -1
- package/dist/types/components/document/form-document-field.st.css.d.ts.map +1 -1
- package/dist/types/components/image/thumbnail-replace-overlay.st.css.d.ts.map +1 -1
- package/dist/types/components/media-gallery/cell-media-gallery-view.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/media-loader/media-loader.st.css.d.ts.map +1 -1
- package/dist/types/components/media-tag/web-media-tag/media-tag.st.css.d.ts.map +1 -1
- package/dist/types/components/reference/reference-avatar.d.ts.map +1 -1
- package/dist/types/components/rich-content/cdn/load-ricos.d.ts +11 -0
- package/dist/types/components/rich-content/cdn/load-ricos.d.ts.map +1 -0
- package/dist/types/components/rich-content/cdn/types.d.ts +20 -0
- package/dist/types/components/rich-content/cdn/types.d.ts.map +1 -0
- package/dist/types/components/rich-content/cell-rich-content-input.d.ts +1 -1
- package/dist/types/components/rich-content/cell-rich-content-input.d.ts.map +1 -1
- package/dist/types/components/rich-content/form-rich-content.d.ts +1 -1
- package/dist/types/components/rich-content/form-rich-content.d.ts.map +1 -1
- package/dist/types/components/rich-content/hooks/use-plain-text-rich-content.d.ts +1 -1
- 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.d.ts +1 -1
- package/dist/types/components/rich-content/rich-content-input/default-value-input/rich-content-default-value-input.d.ts.map +1 -1
- package/dist/types/components/rich-content/rich-content-input/default-value-read-only-input/rich-content-form-read-only-input.d.ts +1 -1
- package/dist/types/components/rich-content/rich-content-input/default-value-read-only-input/rich-content-form-read-only-input.d.ts.map +1 -1
- package/dist/types/components/rich-content/rich-content-input/form-input/rich-content-form-input.d.ts +1 -1
- package/dist/types/components/rich-content/rich-content-input/form-input/rich-content-form-input.d.ts.map +1 -1
- package/dist/types/components/rich-content/rich-content-input/form-input/rich-content-form-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 +3 -3
- package/dist/types/components/rich-content/rich-content-input/form-input/use-rich-content-form-input.d.ts.map +1 -1
- package/dist/types/components/rich-content/rich-content-input/form-read-only-input/rich-content-form-read-only-input.d.ts +1 -1
- package/dist/types/components/rich-content/rich-content-input/form-read-only-input/rich-content-form-read-only-input.d.ts.map +1 -1
- package/dist/types/components/rich-content/rich-content-input/form-read-only-input/rich-content-form-read-only-input.st.css.d.ts.map +1 -1
- package/dist/types/components/rich-content/rich-content-input/hooks.d.ts +2 -2
- package/dist/types/components/rich-content/rich-content-input/hooks.d.ts.map +1 -1
- package/dist/types/components/rich-content/rich-content-input/rich-content-common/hooks.d.ts +11 -1
- 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-common/toggle-fullscreen-button/toggle-fullscreen-button.st.css.d.ts.map +1 -1
- package/dist/types/components/rich-content/rich-content-input/rich-content-common/types.d.ts +1 -1
- package/dist/types/components/rich-content/rich-content-input/rich-content-common/types.d.ts.map +1 -1
- package/dist/types/components/rich-content/rich-content-input/rich-content-editor/plugins.d.ts +7 -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 +2 -1
- 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 +1 -1
- 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.map +1 -1
- package/dist/types/components/rich-content/rich-content-input/rich-content-viewer/plugins.d.ts +6 -15
- 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 +2 -2
- 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/services/types.d.ts +1 -1
- package/dist/types/components/rich-content/rich-content-input/services/types.d.ts.map +1 -1
- package/dist/types/components/text/text-view.st.css.d.ts.map +1 -1
- package/dist/types/components/url/url-view.d.ts.map +1 -1
- package/dist/types/exports/ricos-statics-legacy.d.ts +6 -0
- package/dist/types/exports/ricos-statics-legacy.d.ts.map +1 -0
- package/dist/types/exports/ricos-statics.d.ts +10 -0
- package/dist/types/exports/ricos-statics.d.ts.map +1 -0
- package/dist/types/utils/request-idle-callback.d.ts.map +1 -1
- package/dist/types/validations/rich-content.d.ts +9 -1
- package/dist/types/validations/rich-content.d.ts.map +1 -1
- package/package.json +24 -7
- package/src/__tests__/components/rich-content/form-rich-content.spec.tsx +1 -1
- package/src/__tests__/components/rich-content/load-ricos.spec.ts +17 -0
- package/src/__tests__/components/rich-content-editor.spec.tsx +40 -32
- package/src/__tests__/utils/request-idle-callback.spec.ts +20 -0
- package/src/__tests__/validations/rich-content.spec.ts +1 -1
- package/src/auto-field-types/validations.ts +25 -13
- 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/cell-color-view.st.css.ts +2 -2
- package/src/components/color-view/cell-color-view.tsx +4 -3
- package/src/components/color-view/color-view.st.css.ts +2 -2
- package/src/components/color-view/color-view.tsx +4 -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/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/cell-media-gallery-view.tsx +5 -3
- 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/cell-multi-document-edit.st.css.ts +2 -2
- package/src/components/multi-document/cell-multi-document-view.tsx +1 -1
- package/src/components/multi-document/multi-document-input/form-multi-document.st.css.ts +2 -2
- package/src/components/reference/cell-multi-reference-input.st.css.ts +2 -2
- package/src/components/reference/cell-reference-input.st.css.ts +2 -2
- package/src/components/reference/reference-avatar.tsx +3 -1
- package/src/components/rich-content/cdn/load-ricos.ts +184 -0
- package/src/components/rich-content/cdn/types.ts +21 -0
- package/src/components/rich-content/cell-rich-content-input.tsx +2 -2
- package/src/components/rich-content/cell-rich-content-view.tsx +1 -1
- package/src/components/rich-content/editor.ts +1 -1
- package/src/components/rich-content/form-rich-content.tsx +2 -2
- package/src/components/rich-content/hooks/use-plain-text-rich-content.ts +4 -3
- 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/default-value-input/rich-content-default-value-input.tsx +1 -1
- package/src/components/rich-content/rich-content-input/default-value-read-only-input/rich-content-form-read-only-input.tsx +1 -1
- 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-input/rich-content-form-input.tsx +1 -1
- package/src/components/rich-content/rich-content-input/form-input/use-rich-content-form-input.ts +1 -1
- 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/form-read-only-input/rich-content-form-read-only-input.tsx +1 -1
- package/src/components/rich-content/rich-content-input/hooks.ts +5 -8
- 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 +15 -3
- 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-common/types.ts +1 -1
- package/src/components/rich-content/rich-content-input/rich-content-editor/plugins.ts +59 -72
- 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 +11 -7
- 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 +4 -2
- package/src/components/rich-content/rich-content-input/rich-content-viewer/plugins.ts +33 -63
- 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 +26 -10
- package/src/components/rich-content/rich-content-input/services/rich-content-document-http-service.ts +1 -1
- package/src/components/rich-content/rich-content-input/services/types.ts +1 -1
- 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/url/url-view.tsx +3 -2
- package/src/exports/ricos-statics-legacy.ts +5 -0
- package/src/exports/ricos-statics.ts +9 -0
- package/src/styles.global.css +1 -1
- package/src/utils/request-idle-callback.ts +7 -1
- package/src/validations/rich-content.ts +20 -2
- package/utils/@wix/patterns-fields-ricos-statics/legacy/package.json +5 -0
- package/utils/@wix/patterns-fields-ricos-statics/package.json +5 -0
|
@@ -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","InsertToolbarSync","editor","onButtonsChange","onReadyChange","buttons","useToolbarProps","isRecordShape","Array","isArray","safeButtons","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 // Ricos 11's next-runtime proxy is supposed to convert the legacy\n // `Record<string, ToolbarButtonProps>` into a v2 `ExternalToolbarButton[]`,\n // but some consumer bundles end up calling through to the inner adapter\n // (duplicate `@wix/ricos` copies / unwrapped ref) and we receive the\n // record shape. Normalize to an array so `.map` is safe, and treat the\n // non-array (record) shape as ready — otherwise the absolute-positioned\n // RCELoader overlay stays mounted and the editor row becomes unclickable.\n const isRecordShape = !Array.isArray(buttons);\n const safeButtons: readonly RicosExternalToolbarButton[] = isRecordShape\n ? []\n : buttons;\n const signature = safeButtons.map((b) => b.id).join('|');\n const buttonsRef = useRef(safeButtons);\n buttonsRef.current = safeButtons;\n\n useEffect(() => {\n onButtonsChange(buttonsRef.current);\n onReadyChange(buttonsRef.current.length > 0 || isRecordShape);\n }, [signature, isRecordShape, 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(\n (nextEditor: RicosEditorAPI | null) => {\n editorRef.current = nextEditor;\n setEditor(nextEditor);\n },\n [],\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(\n modalEditorRef.current,\n content,\n );\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 }, [content, isRichContentChanged, onBlur, onPublish, publishEditorContent]);\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,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAA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hD,MAAA;IAAAC,QAAA;MAAAC,QAAA,EAAAjJ,YAAA;MAAAkJ,UAAA;MAAAC,YAAA;IAAA;EAAA,EAC5B,CACF,eACD/J,MAAA,CAAAuB,OAAA,CAAA6H,aAAA,CAAC5I,kBAAA,CAAA2N,eAAe;IAACC,MAAM,EAAEhK,YAAa;IAACiK,SAAS,EAAErC,MAAO;IAAArC,MAAA;IAAAC,QAAA;MAAAC,QAAA,EAAAjJ,YAAA;MAAAkJ,UAAA;MAAAC,YAAA;IAAA;EAAA,gBACvD/J,MAAA,CAAAuB,OAAA,CAAA6H,aAAA,CAAC3F,GAAG,MAAA0G,SAAA,CAAA5I,OAAA,MACEkK,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,EAAAjJ,YAAA;MAAAkJ,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":[]}
|
|
1
|
+
{"version":3,"names":["_isEqual","_interopRequireDefault","require","_cloneDeep","_defaultsDeep","_react","_interopRequireWildcard","_designSystem","_loadRicos","_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","isRecordShape","Array","isArray","safeButtons","signature","map","b","id","join","buttonsRef","useRef","current","useEffect","length","displayName","filterStaticToolbarButtons","button","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","ricos","useRicosFromCdn","plugins","usePlugins","RicosEditor","createElement","st","classes","root","tabIndex","style","height","__self","__source","fileName","lineNumber","columnNumber","toolbarAndFullScreenButtonWrapper","ToggleFullscreenButton","_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 { RicosDocument } from '@wix/patterns-fields-utils/@wix/patterns-fields-bundled-ricos';\nimport type {\n ExternalToolbarButton as RicosExternalToolbarButton,\n RicosEditorAPI,\n RicosEditorProps,\n ToolbarsConfig,\n} from '@wix/patterns-fields-utils/@wix/patterns-fields-ricos-statics';\n\nimport { useRicosFromCdn } from '../../cdn/load-ricos';\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 // Ricos 11's next-runtime proxy is supposed to convert the legacy\n // `Record<string, ToolbarButtonProps>` into a v2 `ExternalToolbarButton[]`,\n // but some consumer bundles end up calling through to the inner adapter\n // (duplicate ricos copies / unwrapped ref) and we receive the\n // record shape. Normalize to an array so `.map` is safe, and treat the\n // non-array (record) shape as ready — otherwise the absolute-positioned\n // RCELoader overlay stays mounted and the editor row becomes unclickable.\n const isRecordShape = !Array.isArray(buttons);\n const safeButtons: readonly RicosExternalToolbarButton[] = isRecordShape\n ? []\n : buttons;\n const signature = safeButtons.map((b) => b.id).join('|');\n const buttonsRef = useRef(safeButtons);\n buttonsRef.current = safeButtons;\n\n useEffect(() => {\n onButtonsChange(buttonsRef.current);\n onReadyChange(buttonsRef.current.length > 0 || isRecordShape);\n }, [signature, isRecordShape, onButtonsChange, onReadyChange]);\n\n return null;\n};\n\nInsertToolbarSync.displayName = 'InsertToolbarSync';\n\nconst filterStaticToolbarButtons = (button: string) =>\n // Inlined rather than read off the CDN module's `FORMATTING_BUTTONS`: this is\n // a plain string constant and the filter runs before the module has loaded.\n button !== '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(\n (nextEditor: RicosEditorAPI | null) => {\n editorRef.current = nextEditor;\n setEditor(nextEditor);\n },\n [],\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 ricos = useRicosFromCdn();\n const plugins = usePlugins(ricos, colorScheme);\n const RicosEditor = ricos?.RicosEditor;\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 && RicosEditor ? (\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(\n modalEditorRef.current,\n content,\n );\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 }, [content, isRichContentChanged, onBlur, onPublish, publishEditorContent]);\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;AASA,IAAAM,UAAA,GAAAN,OAAA;AACA,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,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,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AC5B,CACF,eACDhK,MAAA,CAAAuB,OAAA,CAAA8H,aAAA,CAAC7I,kBAAA,CAAA2N,eAAe;IAACC,MAAM,EAAElK,YAAa;IAACmK,SAAS,EAAErC,MAAO;IAAApC,MAAA;IAAAC,QAAA;MAAAC,QAAA,EAAAlJ,YAAA;MAAAmJ,UAAA;MAAAC,YAAA;IAAA;EAAA,gBACvDhK,MAAA,CAAAuB,OAAA,CAAA8H,aAAA,CAAC9F,GAAG,MAAA4G,SAAA,CAAA5I,OAAA,MACEkK,KAAK,EACL8B,QAAQ;IACZ9J,OAAO,EAAE6I,iBAAkB;IAC3Bd,KAAK,EAAEgC,eAAgB;IACvB5J,SAAS;IACTG,SAAS,EAAEwF,+BAAO,CAAC+E,WAAY;IAC/BhK,GAAG,EAAEoH,cAAe;IACpBxH,YAAY;IACZC,kBAAkB,EAAE4I,OAAQ;IAAAnD,MAAA;IAAAC,QAAA;MAAAC,QAAA,EAAAlJ,YAAA;MAAAmJ,UAAA;MAAAC,YAAA;IAAA;EAAA,EAC7B,CACc,CACjB,CAAC;AAEP,CAAC;AAACuE,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_ = "richcontenteditor153524713";
|
|
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": "richcontenteditor153524713__root",
|
|
16
|
+
"toolbarContainer": "richcontenteditor153524713__toolbarContainer",
|
|
17
|
+
"footerToolbarContainer": "richcontenteditor153524713__footerToolbarContainer",
|
|
18
|
+
"toolbarAndFullScreenButtonWrapper": "richcontenteditor153524713__toolbarAndFullScreenButtonWrapper",
|
|
19
|
+
"editor": "richcontenteditor153524713__editor",
|
|
20
|
+
"modalEditor": "richcontenteditor153524713__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_ = \"richcontenteditor153524713\";\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\":\"richcontenteditor153524713__root\",\"toolbarContainer\":\"richcontenteditor153524713__toolbarContainer\",\"footerToolbarContainer\":\"richcontenteditor153524713__footerToolbarContainer\",\"toolbarAndFullScreenButtonWrapper\":\"richcontenteditor153524713__toolbarAndFullScreenButtonWrapper\",\"editor\":\"richcontenteditor153524713__editor\",\"modalEditor\":\"richcontenteditor153524713__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":[]}
|
|
@@ -5,9 +5,10 @@ exports.__esModule = true;
|
|
|
5
5
|
exports.ExternalToolbar = void 0;
|
|
6
6
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
7
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
-
var
|
|
8
|
+
var _designSystem = require("@wix/design-system");
|
|
9
9
|
var _richContentToolbarStCss = require("./rich-content-toolbar.st.css.js");
|
|
10
|
-
var _jsxFileName = "/home/builduser/work/843658b9f44192f0/packages/fields/dist/cjs/components/rich-content/rich-content-input/rich-content-editor/rich-content-toolbar.tsx";
|
|
10
|
+
var _jsxFileName = "/home/builduser/work/843658b9f44192f0/packages/fields/dist/cjs/components/rich-content/rich-content-input/rich-content-editor/rich-content-toolbar.tsx"; // WDS rather than ricos's Tooltip: this toolbar renders from state the editor
|
|
11
|
+
// pushes out, so it must not depend on the CDN module being loaded.
|
|
11
12
|
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); }
|
|
12
13
|
class ExternalToolbar extends _react.Component {
|
|
13
14
|
constructor(...args) {
|
|
@@ -21,7 +22,7 @@ class ExternalToolbar extends _react.Component {
|
|
|
21
22
|
__self: this,
|
|
22
23
|
__source: {
|
|
23
24
|
fileName: _jsxFileName,
|
|
24
|
-
lineNumber:
|
|
25
|
+
lineNumber: 19,
|
|
25
26
|
columnNumber: 14
|
|
26
27
|
}
|
|
27
28
|
});
|
|
@@ -33,7 +34,7 @@ class ExternalToolbar extends _react.Component {
|
|
|
33
34
|
__self: this,
|
|
34
35
|
__source: {
|
|
35
36
|
fileName: _jsxFileName,
|
|
36
|
-
lineNumber:
|
|
37
|
+
lineNumber: 24,
|
|
37
38
|
columnNumber: 14
|
|
38
39
|
}
|
|
39
40
|
});
|
|
@@ -54,13 +55,13 @@ class ExternalToolbar extends _react.Component {
|
|
|
54
55
|
referenceElement: event.currentTarget
|
|
55
56
|
});
|
|
56
57
|
};
|
|
57
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
58
|
+
return /*#__PURE__*/_react.default.createElement(_designSystem.Tooltip, {
|
|
58
59
|
content: button.tooltip,
|
|
59
60
|
key: button.id,
|
|
60
61
|
__self: this,
|
|
61
62
|
__source: {
|
|
62
63
|
fileName: _jsxFileName,
|
|
63
|
-
lineNumber:
|
|
64
|
+
lineNumber: 45,
|
|
64
65
|
columnNumber: 7
|
|
65
66
|
}
|
|
66
67
|
}, /*#__PURE__*/_react.default.createElement("button", {
|
|
@@ -72,14 +73,14 @@ class ExternalToolbar extends _react.Component {
|
|
|
72
73
|
__self: this,
|
|
73
74
|
__source: {
|
|
74
75
|
fileName: _jsxFileName,
|
|
75
|
-
lineNumber:
|
|
76
|
+
lineNumber: 46,
|
|
76
77
|
columnNumber: 9
|
|
77
78
|
}
|
|
78
79
|
}, /*#__PURE__*/_react.default.createElement(Icon, {
|
|
79
80
|
__self: this,
|
|
80
81
|
__source: {
|
|
81
82
|
fileName: _jsxFileName,
|
|
82
|
-
lineNumber:
|
|
83
|
+
lineNumber: 53,
|
|
83
84
|
columnNumber: 11
|
|
84
85
|
}
|
|
85
86
|
})));
|
|
@@ -92,7 +93,7 @@ class ExternalToolbar extends _react.Component {
|
|
|
92
93
|
__self: this,
|
|
93
94
|
__source: {
|
|
94
95
|
fileName: _jsxFileName,
|
|
95
|
-
lineNumber:
|
|
96
|
+
lineNumber: 61,
|
|
96
97
|
columnNumber: 7
|
|
97
98
|
}
|
|
98
99
|
}, (_this$props$buttons = this.props.buttons) == null ? void 0 : _this$props$buttons.map(button => this.renderButton(button)));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_designSystem","_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/patterns-fields-utils/@wix/patterns-fields-ricos-statics';\n// WDS rather than ricos's Tooltip: this toolbar renders from state the editor\n// pushes out, so it must not depend on the CDN module being loaded.\nimport { Tooltip } from '@wix/design-system';\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 </Tooltip>\n );\n };\n\n public render() {\n return (\n <div className={classes.toolbar}>\n {this.props.buttons?.map((button) => this.renderButton(button))}\n </div>\n );\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAKA,IAAAC,aAAA,GAAAD,OAAA;AAEA,IAAAE,wBAAA,GAAAF,OAAA;AAA2D,IAAAG,YAAA,6JAJ3D;AACA;AAAA,SAAAJ,wBAAAK,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAP,uBAAA,YAAAA,CAAAK,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,gBAAAP,CAAA,IAAAD,CAAA,gBAAAC,CAAA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,CACD,CACD,CAAC;IAEd,CAAC;EAAA;EAEMqB,MAAMA,CAAA,EAAG;IAAA,IAAAC,mBAAA;IACd,oBACElE,MAAA,CAAAgB,OAAA,CAAAkB,aAAA;MAAKC,SAAS,EAAEC,gCAAO,CAAC+B,OAAQ;MAAA3B,MAAA;MAAAC,QAAA;QAAAC,QAAA,EAAArC,YAAA;QAAAsC,UAAA;QAAAC,YAAA;MAAA;IAAA,IAAAsB,mBAAA,GAC7B,IAAI,CAACE,KAAK,CAACC,OAAO,qBAAlBH,mBAAA,CAAoBI,GAAG,CAAEtC,MAAM,IAAK,IAAI,CAACuC,YAAY,CAACvC,MAAM,CAAC,CAC3D,CAAC;EAEV;AACF;AAACwC,OAAA,CAAA/C,eAAA,GAAAA,eAAA","ignoreList":[]}
|
|
@@ -5,17 +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_ = "richcontenttoolbar430576850";
|
|
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": "
|
|
18
|
-
"separator": "
|
|
15
|
+
"root": "richcontenttoolbar430576850__root",
|
|
16
|
+
"toolbar": "richcontenttoolbar430576850__toolbar",
|
|
17
|
+
"toolbarButton": "richcontenttoolbar430576850__toolbarButton",
|
|
18
|
+
"separator": "richcontenttoolbar430576850__separator"
|
|
19
19
|
};
|
|
20
20
|
var keyframes = exports.keyframes = {};
|
|
21
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_ = \"richcontenttoolbar430576850\";\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\":\"richcontenttoolbar430576850__root\",\"toolbar\":\"richcontenttoolbar430576850__toolbar\",\"toolbarButton\":\"richcontenttoolbar430576850__toolbarButton\",\"separator\":\"richcontenttoolbar430576850__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,6BAA6B;AAC/C,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,mCAAmC;EAAC,SAAS,EAAC,sCAAsC;EAAC,eAAe,EAAC,4CAA4C;EAAC,WAAW,EAAC;AAAwC,CAAC;AAC7N,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":[]}
|
|
@@ -3,24 +3,18 @@
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
4
|
exports.usePlugins = void 0;
|
|
5
5
|
var _react = require("react");
|
|
6
|
-
var _ricos = require("@wix/ricos");
|
|
7
|
-
require("@wix/ricos/css/plugin-link-viewer.global.css");
|
|
8
|
-
require("@wix/ricos/css/plugin-image-viewer.global.css");
|
|
9
|
-
require("@wix/ricos/css/plugin-video-viewer.global.css");
|
|
10
|
-
require("@wix/ricos/css/plugin-divider-viewer.global.css");
|
|
11
|
-
require("@wix/ricos/css/plugin-file-upload-viewer.global.css");
|
|
12
|
-
require("@wix/ricos/css/plugin-html-viewer.global.css");
|
|
13
|
-
require("@wix/ricos/css/plugin-link-preview-viewer.global.css");
|
|
14
|
-
require("@wix/ricos/css/plugin-vertical-embed-viewer.global.css");
|
|
15
|
-
require("@wix/ricos/css/plugin-spoiler-viewer.global.css");
|
|
16
|
-
require("@wix/ricos/css/plugin-giphy-viewer.global.css");
|
|
17
|
-
require("@wix/ricos/css/plugin-gallery-viewer.global.css");
|
|
18
|
-
require("@wix/ricos/css/plugin-collapsible-list-viewer.global.css");
|
|
19
|
-
require("@wix/ricos/css/plugin-table-viewer.global.css");
|
|
20
|
-
require("@wix/ricos/css/plugin-button-viewer.global.css");
|
|
21
6
|
var _utils = require("../../../../utils");
|
|
22
|
-
|
|
23
|
-
|
|
7
|
+
/**
|
|
8
|
+
* Viewer plugin creators come from the CDN module, so this returns an empty list
|
|
9
|
+
* until it has loaded. The viewer is not rendered before then.
|
|
10
|
+
*/
|
|
11
|
+
const usePlugins = ricos => {
|
|
12
|
+
return (0, _react.useMemo)(() => {
|
|
13
|
+
if (!ricos) {
|
|
14
|
+
return [];
|
|
15
|
+
}
|
|
16
|
+
return [ricos.pluginTextColorViewer(), ricos.pluginTextHighlightViewer(), ricos.pluginLineSpacingViewer(), ricos.pluginLinkViewer(), ricos.pluginImageViewer(), ricos.pluginVideoViewer(), ricos.pluginGalleryViewer(), ricos.pluginDividerViewer(), ricos.pluginTableViewer(), ricos.pluginFileUploadViewer(), ricos.pluginHtmlViewer(), ricos.pluginLinkPreviewViewer(), ricos.pluginVerticalEmbedViewer(), ricos.pluginEmojiViewer(), ricos.pluginSpoilerViewer(), ricos.pluginGiphyViewer(), ricos.pluginCodeBlockViewer(), ricos.pluginCollapsibleListViewer(), ricos.pluginLinkButtonViewer()].filter(_utils.isTruthy);
|
|
17
|
+
}, [ricos]);
|
|
24
18
|
};
|
|
25
19
|
exports.usePlugins = usePlugins;
|
|
26
20
|
//# sourceMappingURL=plugins.js.map
|
package/dist/cjs/components/rich-content/rich-content-input/rich-content-viewer/plugins.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","require","
|
|
1
|
+
{"version":3,"names":["_react","require","_utils","usePlugins","ricos","useMemo","pluginTextColorViewer","pluginTextHighlightViewer","pluginLineSpacingViewer","pluginLinkViewer","pluginImageViewer","pluginVideoViewer","pluginGalleryViewer","pluginDividerViewer","pluginTableViewer","pluginFileUploadViewer","pluginHtmlViewer","pluginLinkPreviewViewer","pluginVerticalEmbedViewer","pluginEmojiViewer","pluginSpoilerViewer","pluginGiphyViewer","pluginCodeBlockViewer","pluginCollapsibleListViewer","pluginLinkButtonViewer","filter","isTruthy","exports"],"sources":["../../../../../../src/components/rich-content/rich-content-input/rich-content-viewer/plugins.ts"],"sourcesContent":["import { useMemo } from 'react';\n\nimport type { RicosCdnModule, ViewerPlugin } from '../../cdn/types';\nimport { isTruthy } from '../../../../utils';\n\n/**\n * Viewer plugin creators come from the CDN module, so this returns an empty list\n * until it has loaded. The viewer is not rendered before then.\n */\nexport const usePlugins = (ricos: RicosCdnModule | undefined): ViewerPlugin[] => {\n return useMemo<ViewerPlugin[]>(() => {\n if (!ricos) {\n return [];\n }\n\n return [\n ricos.pluginTextColorViewer(),\n ricos.pluginTextHighlightViewer(),\n ricos.pluginLineSpacingViewer(),\n ricos.pluginLinkViewer(),\n ricos.pluginImageViewer(),\n ricos.pluginVideoViewer(),\n ricos.pluginGalleryViewer(),\n ricos.pluginDividerViewer(),\n ricos.pluginTableViewer(),\n ricos.pluginFileUploadViewer(),\n ricos.pluginHtmlViewer(),\n ricos.pluginLinkPreviewViewer(),\n ricos.pluginVerticalEmbedViewer(),\n ricos.pluginEmojiViewer(),\n ricos.pluginSpoilerViewer(),\n ricos.pluginGiphyViewer(),\n ricos.pluginCodeBlockViewer(),\n ricos.pluginCollapsibleListViewer(),\n ricos.pluginLinkButtonViewer(),\n ].filter(isTruthy);\n }, [ricos]);\n};\n"],"mappings":";;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAGA,IAAAC,MAAA,GAAAD,OAAA;AAEA;AACA;AACA;AACA;AACO,MAAME,UAAU,GAAIC,KAAiC,IAAqB;EAC/E,OAAO,IAAAC,cAAO,EAAiB,MAAM;IACnC,IAAI,CAACD,KAAK,EAAE;MACV,OAAO,EAAE;IACX;IAEA,OAAO,CACLA,KAAK,CAACE,qBAAqB,CAAC,CAAC,EAC7BF,KAAK,CAACG,yBAAyB,CAAC,CAAC,EACjCH,KAAK,CAACI,uBAAuB,CAAC,CAAC,EAC/BJ,KAAK,CAACK,gBAAgB,CAAC,CAAC,EACxBL,KAAK,CAACM,iBAAiB,CAAC,CAAC,EACzBN,KAAK,CAACO,iBAAiB,CAAC,CAAC,EACzBP,KAAK,CAACQ,mBAAmB,CAAC,CAAC,EAC3BR,KAAK,CAACS,mBAAmB,CAAC,CAAC,EAC3BT,KAAK,CAACU,iBAAiB,CAAC,CAAC,EACzBV,KAAK,CAACW,sBAAsB,CAAC,CAAC,EAC9BX,KAAK,CAACY,gBAAgB,CAAC,CAAC,EACxBZ,KAAK,CAACa,uBAAuB,CAAC,CAAC,EAC/Bb,KAAK,CAACc,yBAAyB,CAAC,CAAC,EACjCd,KAAK,CAACe,iBAAiB,CAAC,CAAC,EACzBf,KAAK,CAACgB,mBAAmB,CAAC,CAAC,EAC3BhB,KAAK,CAACiB,iBAAiB,CAAC,CAAC,EACzBjB,KAAK,CAACkB,qBAAqB,CAAC,CAAC,EAC7BlB,KAAK,CAACmB,2BAA2B,CAAC,CAAC,EACnCnB,KAAK,CAACoB,sBAAsB,CAAC,CAAC,CAC/B,CAACC,MAAM,CAACC,eAAQ,CAAC;EACpB,CAAC,EAAE,CAACtB,KAAK,CAAC,CAAC;AACb,CAAC;AAACuB,OAAA,CAAAxB,UAAA,GAAAA,UAAA","ignoreList":[]}
|
|
@@ -5,8 +5,9 @@ exports.__esModule = true;
|
|
|
5
5
|
exports.RichContentViewer = void 0;
|
|
6
6
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
|
-
var
|
|
9
|
-
require("@wix/
|
|
8
|
+
var _designSystem = require("@wix/design-system");
|
|
9
|
+
var _patternsFieldsBundledRicos = require("@wix/patterns-fields-utils/@wix/patterns-fields-bundled-ricos");
|
|
10
|
+
var _loadRicos = require("../../cdn/load-ricos");
|
|
10
11
|
var _hooks = require("../../../../hooks");
|
|
11
12
|
var _utils = require("../../../../utils");
|
|
12
13
|
var _userSiteFonts = require("../../../user-site-fonts");
|
|
@@ -24,7 +25,9 @@ const RCV = ({
|
|
|
24
25
|
...ricosProps
|
|
25
26
|
}) => {
|
|
26
27
|
const wixRicosProps = (0, _richContentCommon.useWixRicosProps)();
|
|
27
|
-
const
|
|
28
|
+
const ricos = (0, _loadRicos.useRicosFromCdn)();
|
|
29
|
+
const plugins = (0, _plugins.usePlugins)(ricos);
|
|
30
|
+
const RicosViewer = ricos == null ? void 0 : ricos.RicosViewer;
|
|
28
31
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
29
32
|
"data-hook": "rich-content.viewer",
|
|
30
33
|
className: (0, _richContentViewerStCss.st)(_richContentViewerStCss.classes.root, {
|
|
@@ -35,7 +38,7 @@ const RCV = ({
|
|
|
35
38
|
__self: void 0,
|
|
36
39
|
__source: {
|
|
37
40
|
fileName: _jsxFileName,
|
|
38
|
-
lineNumber:
|
|
41
|
+
lineNumber: 49,
|
|
39
42
|
columnNumber: 5
|
|
40
43
|
}
|
|
41
44
|
}, /*#__PURE__*/_react.default.createElement(_richContentCommon.ToggleFullscreenButton, {
|
|
@@ -44,7 +47,7 @@ const RCV = ({
|
|
|
44
47
|
__self: void 0,
|
|
45
48
|
__source: {
|
|
46
49
|
fileName: _jsxFileName,
|
|
47
|
-
lineNumber:
|
|
50
|
+
lineNumber: 55,
|
|
48
51
|
columnNumber: 7
|
|
49
52
|
}
|
|
50
53
|
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -53,21 +56,50 @@ const RCV = ({
|
|
|
53
56
|
__self: void 0,
|
|
54
57
|
__source: {
|
|
55
58
|
fileName: _jsxFileName,
|
|
56
|
-
lineNumber:
|
|
59
|
+
lineNumber: 59,
|
|
57
60
|
columnNumber: 7
|
|
58
61
|
}
|
|
59
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
62
|
+
}, RicosViewer ? /*#__PURE__*/_react.default.createElement(RicosViewer, (0, _extends2.default)({}, ricosProps, wixRicosProps, {
|
|
60
63
|
plugins: plugins,
|
|
61
|
-
content: content ?? (0,
|
|
64
|
+
content: content ?? (0, _patternsFieldsBundledRicos.fromPlainText)(''),
|
|
62
65
|
__self: void 0,
|
|
63
66
|
__source: {
|
|
64
67
|
fileName: _jsxFileName,
|
|
65
|
-
lineNumber:
|
|
66
|
-
columnNumber:
|
|
68
|
+
lineNumber: 61,
|
|
69
|
+
columnNumber: 11
|
|
67
70
|
}
|
|
68
|
-
}))
|
|
71
|
+
})) : /*#__PURE__*/_react.default.createElement(RCVLoader, {
|
|
72
|
+
__self: void 0,
|
|
73
|
+
__source: {
|
|
74
|
+
fileName: _jsxFileName,
|
|
75
|
+
lineNumber: 68,
|
|
76
|
+
columnNumber: 11
|
|
77
|
+
}
|
|
78
|
+
})));
|
|
69
79
|
};
|
|
70
80
|
RCV.displayName = 'RCV';
|
|
81
|
+
|
|
82
|
+
/** Shown while the CDN bundle is in flight, matching the editor's RCELoader. */
|
|
83
|
+
const RCVLoader = () => /*#__PURE__*/_react.default.createElement(_designSystem.Box, {
|
|
84
|
+
align: "center",
|
|
85
|
+
verticalAlign: "middle",
|
|
86
|
+
width: "100%",
|
|
87
|
+
__self: void 0,
|
|
88
|
+
__source: {
|
|
89
|
+
fileName: _jsxFileName,
|
|
90
|
+
lineNumber: 79,
|
|
91
|
+
columnNumber: 3
|
|
92
|
+
}
|
|
93
|
+
}, /*#__PURE__*/_react.default.createElement(_designSystem.Loader, {
|
|
94
|
+
size: "small",
|
|
95
|
+
__self: void 0,
|
|
96
|
+
__source: {
|
|
97
|
+
fileName: _jsxFileName,
|
|
98
|
+
lineNumber: 80,
|
|
99
|
+
columnNumber: 5
|
|
100
|
+
}
|
|
101
|
+
}));
|
|
102
|
+
RCVLoader.displayName = 'RCVLoader';
|
|
71
103
|
const RichContentViewer = ({
|
|
72
104
|
fullScreenOnly,
|
|
73
105
|
onEnterFullScreen,
|
|
@@ -88,7 +120,7 @@ const RichContentViewer = ({
|
|
|
88
120
|
__self: void 0,
|
|
89
121
|
__source: {
|
|
90
122
|
fileName: _jsxFileName,
|
|
91
|
-
lineNumber:
|
|
123
|
+
lineNumber: 111,
|
|
92
124
|
columnNumber: 7
|
|
93
125
|
}
|
|
94
126
|
}), !fullScreenOnly && /*#__PURE__*/_react.default.createElement(RCV, (0, _extends2.default)({}, props, {
|
|
@@ -99,7 +131,7 @@ const RichContentViewer = ({
|
|
|
99
131
|
__self: void 0,
|
|
100
132
|
__source: {
|
|
101
133
|
fileName: _jsxFileName,
|
|
102
|
-
lineNumber:
|
|
134
|
+
lineNumber: 113,
|
|
103
135
|
columnNumber: 9
|
|
104
136
|
}
|
|
105
137
|
})), /*#__PURE__*/_react.default.createElement(_richContentCommon.FullscreenModal, {
|
|
@@ -107,7 +139,7 @@ const RichContentViewer = ({
|
|
|
107
139
|
__self: void 0,
|
|
108
140
|
__source: {
|
|
109
141
|
fileName: _jsxFileName,
|
|
110
|
-
lineNumber:
|
|
142
|
+
lineNumber: 121,
|
|
111
143
|
columnNumber: 7
|
|
112
144
|
}
|
|
113
145
|
}, /*#__PURE__*/_react.default.createElement(RCV, (0, _extends2.default)({}, props, {
|
|
@@ -117,7 +149,7 @@ const RichContentViewer = ({
|
|
|
117
149
|
__self: void 0,
|
|
118
150
|
__source: {
|
|
119
151
|
fileName: _jsxFileName,
|
|
120
|
-
lineNumber:
|
|
152
|
+
lineNumber: 122,
|
|
121
153
|
columnNumber: 9
|
|
122
154
|
}
|
|
123
155
|
}))));
|