@wix/patterns-fields 1.17.0 → 1.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cell-rich-content-input/package.json +5 -0
- package/dist/cjs/assets/locale/messages_en.json +6 -2
- package/dist/cjs/components/address/input/address-input.st.css.js +3 -3
- package/dist/cjs/components/address/input/address-input.st.css.js.map +1 -1
- package/dist/cjs/components/audio/actions/actions-menu/actions-menu.st.css.js +3 -3
- package/dist/cjs/components/audio/actions/actions-menu/actions-menu.st.css.js.map +1 -1
- package/dist/cjs/components/audio/audio-field/form-audio-field.st.css.js +4 -4
- package/dist/cjs/components/audio/audio-field/form-audio-field.st.css.js.map +1 -1
- package/dist/cjs/components/audio/audio-player/audio-player.st.css.js +2 -2
- package/dist/cjs/components/audio/audio-player/audio-player.st.css.js.map +1 -1
- package/dist/cjs/components/color-view/color-view.st.css.js +4 -4
- package/dist/cjs/components/color-view/color-view.st.css.js.map +1 -1
- package/dist/cjs/components/delete-dialog/delete-dialog.st.css.js +3 -3
- package/dist/cjs/components/delete-dialog/delete-dialog.st.css.js.map +1 -1
- package/dist/cjs/components/document/form-document-field.st.css.js +7 -7
- package/dist/cjs/components/document/form-document-field.st.css.js.map +1 -1
- package/dist/cjs/components/exclamation/exclamation.st.css.js +5 -5
- package/dist/cjs/components/exclamation/exclamation.st.css.js.map +1 -1
- package/dist/cjs/components/highlighted-text/highlighted-text.st.css.js +5 -5
- package/dist/cjs/components/highlighted-text/highlighted-text.st.css.js.map +1 -1
- package/dist/cjs/components/image/cell-image-edit.js +32 -61
- package/dist/cjs/components/image/cell-image-edit.js.map +1 -1
- package/dist/cjs/components/image/image-thumbnail.js +7 -6
- package/dist/cjs/components/image/image-thumbnail.js.map +1 -1
- package/dist/cjs/components/image/thumbnail-replace-overlay.js +29 -0
- package/dist/cjs/components/image/thumbnail-replace-overlay.js.map +1 -0
- package/dist/cjs/components/image/thumbnail-replace-overlay.st.css +15 -0
- package/dist/cjs/components/image/thumbnail-replace-overlay.st.css.js +23 -0
- package/dist/cjs/components/image/thumbnail-replace-overlay.st.css.js.map +1 -0
- package/dist/cjs/components/media-control/paste-url-button.st.css.js +4 -4
- package/dist/cjs/components/media-control/paste-url-button.st.css.js.map +1 -1
- package/dist/cjs/components/media-control/use-media-control.js +8 -9
- package/dist/cjs/components/media-control/use-media-control.js.map +1 -1
- package/dist/cjs/components/media-gallery/form-media-gallery-field.st.css.js +10 -10
- package/dist/cjs/components/media-gallery/form-media-gallery-field.st.css.js.map +1 -1
- package/dist/cjs/components/media-image/media-image.st.css.js +4 -4
- package/dist/cjs/components/media-image/media-image.st.css.js.map +1 -1
- package/dist/cjs/components/media-image/overlays/overlay.st.css.js +4 -4
- package/dist/cjs/components/media-image/overlays/overlay.st.css.js.map +1 -1
- package/dist/cjs/components/media-loader/media-loader.st.css.js +3 -3
- package/dist/cjs/components/media-loader/media-loader.st.css.js.map +1 -1
- package/dist/cjs/components/media-tag/web-media-tag/media-tag.st.css.js +2 -2
- package/dist/cjs/components/media-tag/web-media-tag/media-tag.st.css.js.map +1 -1
- package/dist/cjs/components/multi-document/multi-document-input/form-multi-document-field.js.map +1 -1
- package/dist/cjs/components/multi-document/multi-document-input/form-multi-document-view.js.map +1 -1
- package/dist/cjs/components/multi-document/multi-document-input/form-multi-document.st.css.js +5 -5
- package/dist/cjs/components/multi-document/multi-document-input/form-multi-document.st.css.js.map +1 -1
- package/dist/cjs/components/rich-content/cell-rich-content-input.js +1 -1
- package/dist/cjs/components/rich-content/cell-rich-content-input.js.map +1 -1
- package/dist/cjs/components/rich-content/cell-rich-content-view.js +1 -1
- package/dist/cjs/components/rich-content/cell-rich-content-view.js.map +1 -1
- package/dist/cjs/components/rich-content/editor.js +2 -10
- package/dist/cjs/components/rich-content/editor.js.map +1 -1
- package/dist/cjs/components/rich-content/rich-content-input/default-value-input/rich-content-default-value-input.st.css.js +6 -6
- package/dist/cjs/components/rich-content/rich-content-input/default-value-input/rich-content-default-value-input.st.css.js.map +1 -1
- package/dist/cjs/components/rich-content/rich-content-input/form-input/form-input.js +2 -1
- package/dist/cjs/components/rich-content/rich-content-input/form-input/form-input.js.map +1 -1
- package/dist/cjs/components/rich-content/rich-content-input/form-input/index.js +3 -4
- package/dist/cjs/components/rich-content/rich-content-input/form-input/index.js.map +1 -1
- package/dist/cjs/components/rich-content/rich-content-input/form-input/rich-content-form-input.st.css.js +5 -5
- package/dist/cjs/components/rich-content/rich-content-input/form-input/rich-content-form-input.st.css.js.map +1 -1
- package/dist/cjs/components/rich-content/rich-content-input/form-read-only-input/rich-content-form-read-only-input.st.css.js +2 -2
- package/dist/cjs/components/rich-content/rich-content-input/form-read-only-input/rich-content-form-read-only-input.st.css.js.map +1 -1
- package/dist/cjs/components/rich-content/rich-content-input/rich-content-common/fullscreen-modal/fullscreen-modal.st.css.js +3 -3
- package/dist/cjs/components/rich-content/rich-content-input/rich-content-common/fullscreen-modal/fullscreen-modal.st.css.js.map +1 -1
- package/dist/cjs/components/rich-content/rich-content-input/rich-content-common/publish-loader/publish-loader.st.css.js +3 -3
- package/dist/cjs/components/rich-content/rich-content-input/rich-content-common/publish-loader/publish-loader.st.css.js.map +1 -1
- package/dist/cjs/components/rich-content/rich-content-input/rich-content-common/toggle-fullscreen-button/toggle-fullscreen-button.st.css.js +2 -2
- package/dist/cjs/components/rich-content/rich-content-input/rich-content-common/toggle-fullscreen-button/toggle-fullscreen-button.st.css.js.map +1 -1
- package/dist/cjs/components/rich-content/rich-content-input/rich-content-editor/rich-content-editor.st.css.js +8 -8
- package/dist/cjs/components/rich-content/rich-content-input/rich-content-editor/rich-content-editor.st.css.js.map +1 -1
- package/dist/cjs/components/rich-content/rich-content-input/rich-content-editor/rich-content-toolbar.st.css.js +4 -4
- package/dist/cjs/components/rich-content/rich-content-input/rich-content-editor/rich-content-toolbar.st.css.js.map +1 -1
- package/dist/cjs/components/rich-content/rich-content-input/rich-content-viewer/rich-content-viewer.st.css.js +4 -4
- package/dist/cjs/components/rich-content/rich-content-input/rich-content-viewer/rich-content-viewer.st.css.js.map +1 -1
- package/dist/cjs/components/rich-text/cell-rich-text-editor.js +155 -0
- package/dist/cjs/components/rich-text/cell-rich-text-editor.js.map +1 -0
- package/dist/cjs/components/rich-text/cell-rich-text-input.js +153 -0
- package/dist/cjs/components/rich-text/cell-rich-text-input.js.map +1 -0
- package/dist/cjs/components/rich-text/cell-rich-text-view.js +30 -0
- package/dist/cjs/components/rich-text/cell-rich-text-view.js.map +1 -0
- package/dist/cjs/components/rich-text/index.js +18 -0
- package/dist/cjs/components/rich-text/index.js.map +1 -1
- package/dist/cjs/components/rich-text/rich-text-input/rich-text-editor/rich-editor.js +13 -1
- package/dist/cjs/components/rich-text/rich-text-input/rich-text-editor/rich-editor.js.map +1 -1
- package/dist/cjs/components/rich-text/rich-text-input/rich-text-editor/rich-editor.st.css +26 -22
- package/dist/cjs/components/rich-text/rich-text-input/rich-text-editor/rich-editor.st.css.js +50 -46
- package/dist/cjs/components/rich-text/rich-text-input/rich-text-editor/rich-editor.st.css.js.map +1 -1
- package/dist/cjs/components/rich-text/rich-text-input/rich-text-editor/rich-text-editor.st.css.js +4 -4
- package/dist/cjs/components/rich-text/rich-text-input/rich-text-editor/rich-text-editor.st.css.js.map +1 -1
- package/dist/cjs/components/rich-text/rich-text-input/rich-text-editor/toolbar/header-dropdown.js +168 -157
- package/dist/cjs/components/rich-text/rich-text-input/rich-text-editor/toolbar/header-dropdown.js.map +1 -1
- package/dist/cjs/components/rich-text/rich-text-input/rich-text-editor/toolbar/toolbar.st.css +13 -12
- package/dist/cjs/components/rich-text/rich-text-input/rich-text-editor/toolbar/toolbar.st.css.js +22 -19
- package/dist/cjs/components/rich-text/rich-text-input/rich-text-editor/toolbar/toolbar.st.css.js.map +1 -1
- package/dist/cjs/components/text/text-view.st.css.js +3 -3
- package/dist/cjs/components/text/text-view.st.css.js.map +1 -1
- package/dist/cjs/components/video/cell-video-edit.js +424 -0
- package/dist/cjs/components/video/cell-video-edit.js.map +1 -0
- package/dist/cjs/components/video/index.js +3 -1
- package/dist/cjs/components/video/index.js.map +1 -1
- package/dist/cjs/exports/cell-rich-content-input.js +8 -0
- package/dist/cjs/exports/cell-rich-content-input.js.map +1 -0
- package/dist/cjs/exports/form-rich-content-input.js +3 -4
- package/dist/cjs/exports/form-rich-content-input.js.map +1 -1
- package/dist/cjs/index.js +11 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/services/translations.js.map +1 -1
- package/dist/cjs/styles.global.css +1 -1
- package/dist/esm/assets/locale/messages_en.json +6 -2
- package/dist/esm/components/address/input/address-input.st.css.js +2 -2
- package/dist/esm/components/address/input/address-input.st.css.js.map +1 -1
- package/dist/esm/components/audio/actions/actions-menu/actions-menu.st.css.js +2 -2
- package/dist/esm/components/audio/actions/actions-menu/actions-menu.st.css.js.map +1 -1
- package/dist/esm/components/audio/audio-field/form-audio-field.st.css.js +2 -2
- package/dist/esm/components/audio/audio-player/audio-player.st.css.js +2 -2
- package/dist/esm/components/color-view/color-view.st.css.js +2 -2
- package/dist/esm/components/color-view/color-view.st.css.js.map +1 -1
- package/dist/esm/components/delete-dialog/delete-dialog.st.css.js +2 -2
- package/dist/esm/components/document/form-document-field.st.css.js +2 -2
- package/dist/esm/components/exclamation/exclamation.st.css.js +2 -2
- package/dist/esm/components/exclamation/exclamation.st.css.js.map +1 -1
- package/dist/esm/components/highlighted-text/highlighted-text.st.css.js +3 -3
- package/dist/esm/components/image/cell-image-edit.js +4 -21
- package/dist/esm/components/image/cell-image-edit.js.map +1 -1
- package/dist/esm/components/image/image-thumbnail.js +9 -3
- package/dist/esm/components/image/image-thumbnail.js.map +1 -1
- package/dist/esm/components/image/thumbnail-replace-overlay.js +7 -0
- package/dist/esm/components/image/thumbnail-replace-overlay.js.map +1 -0
- package/dist/esm/components/image/thumbnail-replace-overlay.st.css +15 -0
- package/dist/esm/components/image/thumbnail-replace-overlay.st.css.js +15 -0
- package/dist/esm/components/image/thumbnail-replace-overlay.st.css.js.map +1 -0
- package/dist/esm/components/media-control/paste-url-button.st.css.js +2 -2
- package/dist/esm/components/media-control/use-media-control.js +9 -8
- package/dist/esm/components/media-control/use-media-control.js.map +1 -1
- package/dist/esm/components/media-gallery/form-media-gallery-field.st.css.js +2 -2
- package/dist/esm/components/media-image/media-image.st.css.js +3 -3
- package/dist/esm/components/media-image/overlays/overlay.st.css.js +3 -3
- package/dist/esm/components/media-image/overlays/overlay.st.css.js.map +1 -1
- package/dist/esm/components/media-loader/media-loader.st.css.js +2 -2
- package/dist/esm/components/media-tag/web-media-tag/media-tag.st.css.js +2 -2
- package/dist/esm/components/multi-document/multi-document-input/form-multi-document-field.js.map +1 -1
- package/dist/esm/components/multi-document/multi-document-input/form-multi-document-view.js.map +1 -1
- package/dist/esm/components/multi-document/multi-document-input/form-multi-document.st.css.js +2 -2
- package/dist/esm/components/rich-content/cell-rich-content-input.js.map +1 -1
- package/dist/esm/components/rich-content/cell-rich-content-view.js +1 -1
- package/dist/esm/components/rich-content/cell-rich-content-view.js.map +1 -1
- package/dist/esm/components/rich-content/editor.js +1 -2
- package/dist/esm/components/rich-content/editor.js.map +1 -1
- package/dist/esm/components/rich-content/rich-content-input/default-value-input/rich-content-default-value-input.st.css.js +3 -3
- package/dist/esm/components/rich-content/rich-content-input/default-value-input/rich-content-default-value-input.st.css.js.map +1 -1
- package/dist/esm/components/rich-content/rich-content-input/form-input/form-input.js +1 -1
- package/dist/esm/components/rich-content/rich-content-input/form-input/form-input.js.map +1 -1
- package/dist/esm/components/rich-content/rich-content-input/form-input/index.js +1 -1
- package/dist/esm/components/rich-content/rich-content-input/form-input/index.js.map +1 -1
- package/dist/esm/components/rich-content/rich-content-input/form-input/rich-content-form-input.st.css.js +3 -3
- package/dist/esm/components/rich-content/rich-content-input/form-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/rich-content-common/fullscreen-modal/fullscreen-modal.st.css.js +2 -2
- package/dist/esm/components/rich-content/rich-content-input/rich-content-common/publish-loader/publish-loader.st.css.js +2 -2
- package/dist/esm/components/rich-content/rich-content-input/rich-content-common/toggle-fullscreen-button/toggle-fullscreen-button.st.css.js +2 -2
- package/dist/esm/components/rich-content/rich-content-input/rich-content-editor/rich-content-editor.st.css.js +3 -3
- package/dist/esm/components/rich-content/rich-content-input/rich-content-editor/rich-content-editor.st.css.js.map +1 -1
- package/dist/esm/components/rich-content/rich-content-input/rich-content-editor/rich-content-toolbar.st.css.js +2 -2
- package/dist/esm/components/rich-content/rich-content-input/rich-content-editor/rich-content-toolbar.st.css.js.map +1 -1
- package/dist/esm/components/rich-content/rich-content-input/rich-content-viewer/rich-content-viewer.st.css.js +2 -2
- package/dist/esm/components/rich-text/cell-rich-text-editor.js +85 -0
- package/dist/esm/components/rich-text/cell-rich-text-editor.js.map +1 -0
- package/dist/esm/components/rich-text/cell-rich-text-input.js +77 -0
- package/dist/esm/components/rich-text/cell-rich-text-input.js.map +1 -0
- package/dist/esm/components/rich-text/cell-rich-text-view.js +11 -0
- package/dist/esm/components/rich-text/cell-rich-text-view.js.map +1 -0
- package/dist/esm/components/rich-text/index.js +3 -0
- package/dist/esm/components/rich-text/index.js.map +1 -1
- package/dist/esm/components/rich-text/rich-text-input/rich-text-editor/rich-editor.js +14 -2
- package/dist/esm/components/rich-text/rich-text-input/rich-text-editor/rich-editor.js.map +1 -1
- package/dist/esm/components/rich-text/rich-text-input/rich-text-editor/rich-editor.st.css +26 -22
- package/dist/esm/components/rich-text/rich-text-input/rich-text-editor/rich-editor.st.css.js +4 -4
- package/dist/esm/components/rich-text/rich-text-input/rich-text-editor/rich-editor.st.css.js.map +1 -1
- package/dist/esm/components/rich-text/rich-text-input/rich-text-editor/rich-text-editor.st.css.js +2 -2
- package/dist/esm/components/rich-text/rich-text-input/rich-text-editor/toolbar/header-dropdown.js +64 -50
- package/dist/esm/components/rich-text/rich-text-input/rich-text-editor/toolbar/header-dropdown.js.map +1 -1
- package/dist/esm/components/rich-text/rich-text-input/rich-text-editor/toolbar/toolbar.st.css +13 -12
- package/dist/esm/components/rich-text/rich-text-input/rich-text-editor/toolbar/toolbar.st.css.js +3 -3
- package/dist/esm/components/rich-text/rich-text-input/rich-text-editor/toolbar/toolbar.st.css.js.map +1 -1
- package/dist/esm/components/text/text-view.st.css.js +2 -2
- package/dist/esm/components/video/cell-video-edit.js +159 -0
- package/dist/esm/components/video/cell-video-edit.js.map +1 -0
- package/dist/esm/components/video/index.js +1 -0
- package/dist/esm/components/video/index.js.map +1 -1
- package/dist/esm/exports/cell-rich-content-input.js +2 -0
- package/dist/esm/exports/cell-rich-content-input.js.map +1 -0
- package/dist/esm/exports/form-rich-content-input.js +1 -1
- package/dist/esm/exports/form-rich-content-input.js.map +1 -1
- package/dist/esm/index.js +1 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/styles.global.css +1 -1
- package/dist/types/components/address/input/address-input.st.css.d.ts.map +1 -1
- package/dist/types/components/audio/actions/actions-menu/actions-menu.st.css.d.ts.map +1 -1
- package/dist/types/components/color-view/color-view.st.css.d.ts.map +1 -1
- package/dist/types/components/exclamation/exclamation.st.css.d.ts.map +1 -1
- package/dist/types/components/image/cell-image-edit.d.ts.map +1 -1
- package/dist/types/components/image/image-thumbnail.d.ts +1 -0
- package/dist/types/components/image/image-thumbnail.d.ts.map +1 -1
- package/dist/types/components/image/thumbnail-replace-overlay.d.ts +3 -0
- package/dist/types/components/image/thumbnail-replace-overlay.d.ts.map +1 -0
- package/dist/types/components/image/thumbnail-replace-overlay.st.css.d.ts +14 -0
- package/dist/types/components/image/thumbnail-replace-overlay.st.css.d.ts.map +1 -0
- package/dist/types/components/media-control/use-media-control.d.ts +3 -3
- package/dist/types/components/media-control/use-media-control.d.ts.map +1 -1
- package/dist/types/components/media-gallery/media-gallery-dialog/hooks.d.ts +2 -2
- package/dist/types/components/media-image/overlays/overlay.st.css.d.ts.map +1 -1
- package/dist/types/components/multi-document/multi-document-input/form-multi-document-view.d.ts +1 -1
- package/dist/types/components/multi-document/multi-document-input/form-multi-document-view.d.ts.map +1 -1
- package/dist/types/components/rich-content/cell-rich-content-input.d.ts.map +1 -1
- package/dist/types/components/rich-content/cell-rich-content-view.d.ts.map +1 -1
- package/dist/types/components/rich-content/editor.d.ts +1 -2
- package/dist/types/components/rich-content/editor.d.ts.map +1 -1
- package/dist/types/components/rich-content/rich-content-input/default-value-input/rich-content-default-value-input.st.css.d.ts.map +1 -1
- package/dist/types/components/rich-content/rich-content-input/form-input/form-input.d.ts +1 -1
- package/dist/types/components/rich-content/rich-content-input/form-input/form-input.d.ts.map +1 -1
- package/dist/types/components/rich-content/rich-content-input/form-input/index.d.ts +1 -1
- package/dist/types/components/rich-content/rich-content-input/form-input/index.d.ts.map +1 -1
- package/dist/types/components/rich-content/rich-content-input/form-input/rich-content-form-input.st.css.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/rich-content-editor/rich-content-editor.st.css.d.ts.map +1 -1
- package/dist/types/components/rich-content/rich-content-input/rich-content-editor/rich-content-toolbar.st.css.d.ts.map +1 -1
- package/dist/types/components/rich-text/cell-rich-text-editor.d.ts +21 -0
- package/dist/types/components/rich-text/cell-rich-text-editor.d.ts.map +1 -0
- package/dist/types/components/rich-text/cell-rich-text-input.d.ts +23 -0
- package/dist/types/components/rich-text/cell-rich-text-input.d.ts.map +1 -0
- package/dist/types/components/rich-text/cell-rich-text-view.d.ts +8 -0
- package/dist/types/components/rich-text/cell-rich-text-view.d.ts.map +1 -0
- package/dist/types/components/rich-text/index.d.ts +4 -0
- package/dist/types/components/rich-text/index.d.ts.map +1 -1
- package/dist/types/components/rich-text/rich-text-input/rich-text-editor/rich-editor.d.ts.map +1 -1
- package/dist/types/components/rich-text/rich-text-input/rich-text-editor/rich-editor.st.css.d.ts +4 -0
- package/dist/types/components/rich-text/rich-text-input/rich-text-editor/rich-editor.st.css.d.ts.map +1 -1
- package/dist/types/components/rich-text/rich-text-input/rich-text-editor/toolbar/header-dropdown.d.ts +1 -0
- package/dist/types/components/rich-text/rich-text-input/rich-text-editor/toolbar/header-dropdown.d.ts.map +1 -1
- package/dist/types/components/rich-text/rich-text-input/rich-text-editor/toolbar/toolbar.st.css.d.ts +3 -0
- package/dist/types/components/rich-text/rich-text-input/rich-text-editor/toolbar/toolbar.st.css.d.ts.map +1 -1
- package/dist/types/components/video/cell-video-edit.d.ts +20 -0
- package/dist/types/components/video/cell-video-edit.d.ts.map +1 -0
- package/dist/types/components/video/index.d.ts +2 -0
- package/dist/types/components/video/index.d.ts.map +1 -1
- package/dist/types/exports/cell-rich-content-input.d.ts +2 -0
- package/dist/types/exports/cell-rich-content-input.d.ts.map +1 -0
- package/dist/types/exports/form-rich-content-input.d.ts +1 -2
- package/dist/types/exports/form-rich-content-input.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/services/translations.d.ts +1 -1
- package/dist/types/services/translations.d.ts.map +1 -1
- package/package.json +11 -5
- package/src/assets/locale/messages_en.json +6 -2
- package/src/components/address/input/address-input.st.css.ts +2 -2
- package/src/components/audio/actions/actions-menu/actions-menu.st.css.ts +2 -2
- package/src/components/audio/audio-field/form-audio-field.st.css.ts +2 -2
- package/src/components/audio/audio-player/audio-player.st.css.ts +2 -2
- package/src/components/color-view/color-view.st.css.ts +2 -2
- package/src/components/delete-dialog/delete-dialog.st.css.ts +2 -2
- package/src/components/document/form-document-field.st.css.ts +2 -2
- package/src/components/exclamation/exclamation.st.css.ts +2 -2
- package/src/components/highlighted-text/highlighted-text.st.css.ts +3 -3
- package/src/components/image/cell-image-edit.tsx +4 -26
- package/src/components/image/image-thumbnail.tsx +10 -2
- package/src/components/image/thumbnail-replace-overlay.st.css +15 -0
- package/src/components/image/thumbnail-replace-overlay.st.css.ts +25 -0
- package/src/components/image/thumbnail-replace-overlay.tsx +11 -0
- package/src/components/media-control/paste-url-button.st.css.ts +2 -2
- package/src/components/media-control/use-media-control.ts +13 -13
- package/src/components/media-gallery/form-media-gallery-field.st.css.ts +2 -2
- package/src/components/media-image/media-image.st.css.ts +3 -3
- package/src/components/media-image/overlays/overlay.st.css.ts +3 -3
- package/src/components/media-loader/media-loader.st.css.ts +2 -2
- package/src/components/media-tag/web-media-tag/media-tag.st.css.ts +2 -2
- package/src/components/multi-document/multi-document-input/form-multi-document-field.tsx +1 -1
- package/src/components/multi-document/multi-document-input/form-multi-document-view.tsx +2 -2
- package/src/components/multi-document/multi-document-input/form-multi-document.st.css.ts +2 -2
- package/src/components/rich-content/cell-rich-content-input.tsx +2 -3
- package/src/components/rich-content/cell-rich-content-view.tsx +1 -4
- package/src/components/rich-content/editor.ts +1 -2
- package/src/components/rich-content/rich-content-input/default-value-input/rich-content-default-value-input.st.css.ts +3 -3
- package/src/components/rich-content/rich-content-input/form-input/form-input.tsx +1 -1
- package/src/components/rich-content/rich-content-input/form-input/index.ts +1 -1
- package/src/components/rich-content/rich-content-input/form-input/rich-content-form-input.st.css.ts +3 -3
- package/src/components/rich-content/rich-content-input/form-read-only-input/rich-content-form-read-only-input.st.css.ts +2 -2
- package/src/components/rich-content/rich-content-input/rich-content-common/fullscreen-modal/fullscreen-modal.st.css.ts +2 -2
- package/src/components/rich-content/rich-content-input/rich-content-common/publish-loader/publish-loader.st.css.ts +2 -2
- package/src/components/rich-content/rich-content-input/rich-content-common/toggle-fullscreen-button/toggle-fullscreen-button.st.css.ts +2 -2
- package/src/components/rich-content/rich-content-input/rich-content-editor/rich-content-editor.st.css.ts +3 -3
- package/src/components/rich-content/rich-content-input/rich-content-editor/rich-content-toolbar.st.css.ts +2 -2
- package/src/components/rich-content/rich-content-input/rich-content-viewer/rich-content-viewer.st.css.ts +2 -2
- package/src/components/rich-text/cell-rich-text-editor.tsx +173 -0
- package/src/components/rich-text/cell-rich-text-input.tsx +126 -0
- package/src/components/rich-text/cell-rich-text-view.tsx +19 -0
- package/src/components/rich-text/index.ts +4 -0
- package/src/components/rich-text/rich-text-input/rich-text-editor/rich-editor.st.css +26 -22
- package/src/components/rich-text/rich-text-input/rich-text-editor/rich-editor.st.css.ts +4 -4
- package/src/components/rich-text/rich-text-input/rich-text-editor/rich-editor.tsx +22 -5
- package/src/components/rich-text/rich-text-input/rich-text-editor/rich-text-editor.st.css.ts +2 -2
- package/src/components/rich-text/rich-text-input/rich-text-editor/toolbar/header-dropdown.tsx +153 -126
- package/src/components/rich-text/rich-text-input/rich-text-editor/toolbar/toolbar.st.css +13 -12
- package/src/components/rich-text/rich-text-input/rich-text-editor/toolbar/toolbar.st.css.ts +3 -3
- package/src/components/text/text-view.st.css.ts +2 -2
- package/src/components/video/cell-video-edit.tsx +308 -0
- package/src/components/video/index.ts +2 -0
- package/src/exports/cell-rich-content-input.ts +4 -0
- package/src/exports/form-rich-content-input.ts +1 -5
- package/src/index.ts +1 -0
- package/src/services/translations.ts +5 -1
- package/src/styles.global.css +1 -1
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
|
2
|
+
import { Popover } from '@wix/design-system';
|
|
3
|
+
|
|
4
|
+
import {
|
|
5
|
+
CellRichTextEditor,
|
|
6
|
+
DEFAULT_CELL_TEXT_STYLE,
|
|
7
|
+
} from './cell-rich-text-editor';
|
|
8
|
+
import type { RichTextStyleVariables } from './rich-text-input/rich-text-editor/text-style';
|
|
9
|
+
|
|
10
|
+
/** Fixed popover width matching the CMS rich text editor (popover-rich-text-editor.tsx). */
|
|
11
|
+
const POPOVER_WIDTH = 582;
|
|
12
|
+
|
|
13
|
+
export interface CellRichTextInputProps {
|
|
14
|
+
value?: string;
|
|
15
|
+
onChange: (value: string) => void;
|
|
16
|
+
/** Typed key from type-to-edit — appended to existing plain-text content on mount. */
|
|
17
|
+
initialTypedKey?: string;
|
|
18
|
+
/** Called when the editor loses focus (click outside) or ESC is pressed. */
|
|
19
|
+
onCommit?: () => void;
|
|
20
|
+
/** CSS custom properties for the --rt-* theming API. Defaults to standard sizes. */
|
|
21
|
+
textStyle?: RichTextStyleVariables;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/** Popover-based rich text editor for the richText cell type.
|
|
25
|
+
* Opens immediately as a popover anchored at the cell's top-left corner.
|
|
26
|
+
* Fixed 582px width (matching CMS), covers adjacent cells, flips upward when
|
|
27
|
+
* there is not enough room below. Changes are propagated live via onChange.
|
|
28
|
+
*
|
|
29
|
+
* Close behaviour mirrors cms-web PopoverRichTextEditor: the editor listens for
|
|
30
|
+
* focus/blur events on a wrapper div. onBlur schedules onCommit via
|
|
31
|
+
* requestAnimationFrame so toolbar actions (including dropdown selections in
|
|
32
|
+
* window portals) can cancel the deferred close by refocusing the editor. */
|
|
33
|
+
export const CellRichTextInput: React.FC<CellRichTextInputProps> = ({
|
|
34
|
+
value,
|
|
35
|
+
onChange,
|
|
36
|
+
initialTypedKey,
|
|
37
|
+
onCommit,
|
|
38
|
+
textStyle = DEFAULT_CELL_TEXT_STYLE,
|
|
39
|
+
}) => {
|
|
40
|
+
const [isFullScreen, setIsFullScreen] = useState(false);
|
|
41
|
+
const isFullScreenRef = useRef(false);
|
|
42
|
+
const blurFrameIdRef = useRef(0);
|
|
43
|
+
|
|
44
|
+
const handleToggleFullScreen = useCallback(() => {
|
|
45
|
+
setIsFullScreen((prev) => {
|
|
46
|
+
const next = !prev;
|
|
47
|
+
isFullScreenRef.current = next;
|
|
48
|
+
return next;
|
|
49
|
+
});
|
|
50
|
+
}, []);
|
|
51
|
+
|
|
52
|
+
const handleFocus = useCallback(() => {
|
|
53
|
+
cancelAnimationFrame(blurFrameIdRef.current);
|
|
54
|
+
}, []);
|
|
55
|
+
|
|
56
|
+
const handleBlur = useCallback(() => {
|
|
57
|
+
cancelAnimationFrame(blurFrameIdRef.current);
|
|
58
|
+
blurFrameIdRef.current = requestAnimationFrame(() => {
|
|
59
|
+
if (!isFullScreenRef.current) {
|
|
60
|
+
onCommit?.();
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
}, [onCommit]);
|
|
64
|
+
|
|
65
|
+
// Capture-phase native listener fires before ALL React bubble-phase handlers
|
|
66
|
+
// (including useKeyboardNavigation which would call cancelEdit() on ESC).
|
|
67
|
+
// stopPropagation() prevents the event from reaching any bubble-phase handler.
|
|
68
|
+
useEffect(() => {
|
|
69
|
+
const handleKeyDown = (e: KeyboardEvent) => {
|
|
70
|
+
if (e.key !== 'Escape') return;
|
|
71
|
+
e.stopPropagation();
|
|
72
|
+
if (isFullScreenRef.current) {
|
|
73
|
+
setIsFullScreen(false);
|
|
74
|
+
isFullScreenRef.current = false;
|
|
75
|
+
} else {
|
|
76
|
+
cancelAnimationFrame(blurFrameIdRef.current);
|
|
77
|
+
onCommit?.();
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
document.addEventListener('keydown', handleKeyDown, true);
|
|
81
|
+
return () => document.removeEventListener('keydown', handleKeyDown, true);
|
|
82
|
+
}, [onCommit]);
|
|
83
|
+
|
|
84
|
+
return (
|
|
85
|
+
// Zero-height anchor at the cell's top-left so the popover opens from there.
|
|
86
|
+
<div
|
|
87
|
+
style={{
|
|
88
|
+
position: 'absolute',
|
|
89
|
+
top: 0,
|
|
90
|
+
left: 0,
|
|
91
|
+
width: '100%',
|
|
92
|
+
height: 0,
|
|
93
|
+
overflow: 'visible',
|
|
94
|
+
fontSize: 0,
|
|
95
|
+
lineHeight: 0,
|
|
96
|
+
}}
|
|
97
|
+
>
|
|
98
|
+
<Popover
|
|
99
|
+
shown
|
|
100
|
+
placement="bottom-start"
|
|
101
|
+
appendTo="window"
|
|
102
|
+
width={POPOVER_WIDTH}
|
|
103
|
+
zIndex={5001}
|
|
104
|
+
>
|
|
105
|
+
<Popover.Element>
|
|
106
|
+
<div style={{ width: '100%', height: 0 }} />
|
|
107
|
+
</Popover.Element>
|
|
108
|
+
<Popover.Content>
|
|
109
|
+
<div onFocus={handleFocus} onBlur={handleBlur}>
|
|
110
|
+
<CellRichTextEditor
|
|
111
|
+
value={value}
|
|
112
|
+
onChange={onChange}
|
|
113
|
+
autoFocus
|
|
114
|
+
initialTypedKey={initialTypedKey}
|
|
115
|
+
isFullScreen={isFullScreen}
|
|
116
|
+
onToggleFullScreen={handleToggleFullScreen}
|
|
117
|
+
textStyle={textStyle}
|
|
118
|
+
/>
|
|
119
|
+
</div>
|
|
120
|
+
</Popover.Content>
|
|
121
|
+
</Popover>
|
|
122
|
+
</div>
|
|
123
|
+
);
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
CellRichTextInput.displayName = 'CellRichTextInput';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import { HTMLToText } from '../../auto-field-types';
|
|
4
|
+
import { TextView } from '../text';
|
|
5
|
+
|
|
6
|
+
export interface CellRichTextViewProps {
|
|
7
|
+
value?: string | null;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
/** Synchronous plain-text view for an HTML rich-text string.
|
|
11
|
+
* Strips all HTML tags via DOMParser — no loading spinner. */
|
|
12
|
+
export const CellRichTextView: React.FC<CellRichTextViewProps> = ({
|
|
13
|
+
value,
|
|
14
|
+
}) => {
|
|
15
|
+
const plainText = value ? HTMLToText(value, { singleLine: true }) : '';
|
|
16
|
+
return <TextView data={plainText} />;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
CellRichTextView.displayName = 'CellRichTextView';
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
export * from './rich-text-view';
|
|
2
2
|
export * from './rich-text-input';
|
|
3
|
+
export * from './cell-rich-text-view';
|
|
4
|
+
export * from './cell-rich-text-editor';
|
|
5
|
+
export * from './cell-rich-text-input';
|
|
6
|
+
export type { RichTextStyleVariables } from './rich-text-input/rich-text-editor/text-style';
|
|
3
7
|
|
|
4
8
|
export type { NoOptions, TextKeys } from './types';
|
|
5
9
|
export * from './components/link';
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
@property st-global(--wds-color-black-100);
|
|
7
7
|
@property st-global(--wds-color-black-700);
|
|
8
8
|
@property st-global(--wds-font-family-default);
|
|
9
|
+
@property st-global(--wsr-font-family);
|
|
9
10
|
@property st-global(--wds-font-weight-medium);
|
|
10
11
|
@property st-global(--wds-font-weight-bold);
|
|
11
12
|
@property st-global(--wds-font-size-500);
|
|
@@ -65,66 +66,69 @@
|
|
|
65
66
|
@property st-global(--rt-p3-lineHeight);
|
|
66
67
|
|
|
67
68
|
:vars {
|
|
69
|
+
/* Madefor fallback ensures the correct font renders even without a WDS theme. */
|
|
70
|
+
fontFamilyDefault: var(--wds-font-family-default, var(--wsr-font-family, Madefor));
|
|
71
|
+
|
|
68
72
|
h1FontSize: var(--rt-h1-fontSize, 72px);
|
|
69
73
|
h1FontStyle: var(--rt-h1-fontStyle, normal);
|
|
70
|
-
h1FontWeight: var(--rt-h1-fontWeight, var(--wds-font-weight-bold));
|
|
71
|
-
h1FontFamily: var(--rt-h1-fontFamily,
|
|
74
|
+
h1FontWeight: var(--rt-h1-fontWeight, var(--wds-font-weight-bold, 700));
|
|
75
|
+
h1FontFamily: var(--rt-h1-fontFamily, value(fontFamilyDefault));
|
|
72
76
|
h1LineHeight: var(--rt-h1-lineHeight, 1.33);
|
|
73
77
|
h1Font: value(h1FontStyle) value(h1FontWeight) value(h1FontSize)/value(h1LineHeight) value(h1FontFamily);
|
|
74
78
|
|
|
75
79
|
h2FontSize: var(--rt-h2-fontSize, 42px);
|
|
76
80
|
h2FontStyle: var(--rt-h2-fontStyle, normal);
|
|
77
|
-
h2FontWeight: var(--rt-h2-fontWeight, var(--wds-font-weight-bold));
|
|
78
|
-
h2FontFamily: var(--rt-h2-fontFamily,
|
|
81
|
+
h2FontWeight: var(--rt-h2-fontWeight, var(--wds-font-weight-bold, 700));
|
|
82
|
+
h2FontFamily: var(--rt-h2-fontFamily, value(fontFamilyDefault));
|
|
79
83
|
h2LineHeight: var(--rt-h2-lineHeight, 1.2);
|
|
80
84
|
h2Font: value(h2FontStyle) value(h2FontWeight) value(h2FontSize)/value(h2LineHeight) value(h2FontFamily);
|
|
81
85
|
|
|
82
86
|
h3FontSize: var(--rt-h3-fontSize, 38px);
|
|
83
87
|
h3FontStyle: var(--rt-h3-fontStyle, normal);
|
|
84
|
-
h3FontWeight: var(--rt-h3-fontWeight, var(--wds-font-weight-medium));
|
|
85
|
-
h3FontFamily: var(--rt-h3-fontFamily,
|
|
88
|
+
h3FontWeight: var(--rt-h3-fontWeight, var(--wds-font-weight-medium, 500));
|
|
89
|
+
h3FontFamily: var(--rt-h3-fontFamily, value(fontFamilyDefault));
|
|
86
90
|
h3LineHeight: var(--rt-h3-lineHeight, 1.2);
|
|
87
91
|
h3Font: value(h3FontStyle) value(h3FontWeight) value(h3FontSize)/value(h3LineHeight) value(h3FontFamily);
|
|
88
92
|
|
|
89
93
|
h4FontSize: var(--rt-h4-fontSize, 34px);
|
|
90
94
|
h4FontStyle: var(--rt-h4-fontStyle, normal);
|
|
91
|
-
h4FontWeight: var(--rt-h4-fontWeight, var(--wds-font-weight-bold));
|
|
92
|
-
h4FontFamily: var(--rt-h4-fontFamily,
|
|
95
|
+
h4FontWeight: var(--rt-h4-fontWeight, var(--wds-font-weight-bold, 700));
|
|
96
|
+
h4FontFamily: var(--rt-h4-fontFamily, value(fontFamilyDefault));
|
|
93
97
|
h4LineHeight: var(--rt-h4-lineHeight, 1.2);
|
|
94
98
|
h4Font: value(h4FontStyle) value(h4FontWeight) value(h4FontSize)/value(h4LineHeight) value(h4FontFamily);
|
|
95
99
|
|
|
96
100
|
h5FontSize: var(--rt-h5-fontSize, 28px);
|
|
97
101
|
h5FontStyle: var(--rt-h5-fontStyle, normal);
|
|
98
|
-
h5FontWeight: var(--rt-h5-fontWeight, var(--wds-font-weight-bold));
|
|
99
|
-
h5FontFamily: var(--rt-h5-fontFamily,
|
|
102
|
+
h5FontWeight: var(--rt-h5-fontWeight, var(--wds-font-weight-bold, 700));
|
|
103
|
+
h5FontFamily: var(--rt-h5-fontFamily, value(fontFamilyDefault));
|
|
100
104
|
h5LineHeight: var(--rt-h5-lineHeight, 1.2);
|
|
101
105
|
h5Font: value(h5FontStyle) value(h5FontWeight) value(h5FontSize)/value(h5LineHeight) value(h5FontFamily);
|
|
102
106
|
|
|
103
107
|
h6FontSize: var(--rt-h6-fontSize, 22px);
|
|
104
108
|
h6FontStyle: var(--rt-h6-fontStyle, normal);
|
|
105
|
-
h6FontWeight: var(--rt-h6-fontWeight, var(--wds-font-weight-medium));
|
|
106
|
-
h6FontFamily: var(--rt-h6-fontFamily,
|
|
109
|
+
h6FontWeight: var(--rt-h6-fontWeight, var(--wds-font-weight-medium, 500));
|
|
110
|
+
h6FontFamily: var(--rt-h6-fontFamily, value(fontFamilyDefault));
|
|
107
111
|
h6LineHeight: var(--rt-h6-lineHeight, 1.2);
|
|
108
112
|
h6Font: value(h6FontStyle) value(h6FontWeight) value(h6FontSize)/value(h6LineHeight) value(h6FontFamily);
|
|
109
113
|
|
|
110
114
|
p1FontSize: var(--rt-p1-fontSize, 18px);
|
|
111
115
|
p1FontStyle: var(--rt-p1-fontStyle, normal);
|
|
112
|
-
p1FontWeight: var(--rt-p1-fontWeight, var(--wds-font-weight-medium));
|
|
113
|
-
p1FontFamily: var(--rt-p1-fontFamily,
|
|
116
|
+
p1FontWeight: var(--rt-p1-fontWeight, var(--wds-font-weight-medium, 500));
|
|
117
|
+
p1FontFamily: var(--rt-p1-fontFamily, value(fontFamilyDefault));
|
|
114
118
|
p1LineHeight: var(--rt-p1-lineHeight, 24px);
|
|
115
119
|
p1Font: value(p1FontStyle) value(p1FontWeight) value(p1FontSize)/value(p1LineHeight) value(p1FontFamily);
|
|
116
120
|
|
|
117
121
|
unstyledFontSize: var(--rt-unstyled-fontSize, 16px);
|
|
118
122
|
unstyledFontStyle: var(--rt-unstyled-fontStyle, normal);
|
|
119
|
-
unstyledFontWeight: var(--rt-unstyled-fontWeight, var(--wds-font-weight-medium));
|
|
120
|
-
unstyledFontFamily: var(--rt-unstyled-fontFamily,
|
|
123
|
+
unstyledFontWeight: var(--rt-unstyled-fontWeight, var(--wds-font-weight-medium, 500));
|
|
124
|
+
unstyledFontFamily: var(--rt-unstyled-fontFamily, value(fontFamilyDefault));
|
|
121
125
|
unstyledLineHeight: var(--rt-unstyled-lineHeight, 24px);
|
|
122
126
|
unstyledFont: value(unstyledFontStyle) value(unstyledFontWeight) value(unstyledFontSize)/value(unstyledLineHeight) value(unstyledFontFamily);
|
|
123
127
|
|
|
124
128
|
p3FontSize: var(--rt-p3-fontSize, 14px);
|
|
125
129
|
p3FontStyle: var(--rt-p3-fontStyle, normal);
|
|
126
|
-
p3FontWeight: var(--rt-p3-fontWeight, var(--wds-font-weight-medium));
|
|
127
|
-
p3FontFamily: var(--rt-p3-fontFamily,
|
|
130
|
+
p3FontWeight: var(--rt-p3-fontWeight, var(--wds-font-weight-medium, 500));
|
|
131
|
+
p3FontFamily: var(--rt-p3-fontFamily, value(fontFamilyDefault));
|
|
128
132
|
p3LineHeight: var(--rt-p3-lineHeight, 18px);
|
|
129
133
|
p3Font: value(p3FontStyle) value(p3FontWeight) value(p3FontSize)/value(p3LineHeight) value(p3FontFamily);
|
|
130
134
|
}
|
|
@@ -132,10 +136,10 @@
|
|
|
132
136
|
.root {
|
|
133
137
|
display: flex;
|
|
134
138
|
flex-direction: column;
|
|
135
|
-
font-weight: var(--wds-font-weight-medium);
|
|
139
|
+
font-weight: var(--wds-font-weight-medium, 500);
|
|
136
140
|
font-size: var(--wds-font-size-500);
|
|
137
141
|
line-height: var(--wds-font-line-height-300);
|
|
138
|
-
font-family:
|
|
142
|
+
font-family: value(fontFamilyDefault);
|
|
139
143
|
}
|
|
140
144
|
|
|
141
145
|
.editor {
|
|
@@ -145,8 +149,8 @@
|
|
|
145
149
|
flex-direction: column;
|
|
146
150
|
flex: 1;
|
|
147
151
|
cursor: text;
|
|
148
|
-
color: var(--wds-color-black-100);
|
|
149
|
-
background: var(--wds-color-black-700);
|
|
152
|
+
color: var(--wds-color-black-100, var(--wsr-color-D10, #131720));
|
|
153
|
+
background: var(--wds-color-black-700, var(--wsr-color-D70, #edeef2));
|
|
150
154
|
}
|
|
151
155
|
|
|
152
156
|
.editor :global(.DraftEditor-root) {
|
|
@@ -5,7 +5,7 @@ import { classesRuntime, statesRuntime } from "../../../../stylable-esm-runtime.
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var _namespace_ = "
|
|
8
|
+
var _namespace_ = "richeditor3609789040";
|
|
9
9
|
var _style_ = classesRuntime.bind(null, _namespace_);
|
|
10
10
|
|
|
11
11
|
export var cssStates = statesRuntime.bind(null, _namespace_);
|
|
@@ -13,12 +13,12 @@ export var style: import("@stylable/runtime").STFunction = _style_;
|
|
|
13
13
|
export var st: import("@stylable/runtime").STFunction = _style_;
|
|
14
14
|
|
|
15
15
|
export var namespace = _namespace_;
|
|
16
|
-
export var classes = {"root":"
|
|
16
|
+
export var classes = {"root":"richeditor3609789040__root","editor":"richeditor3609789040__editor","header-one":"richeditor3609789040__header-one","header-two":"richeditor3609789040__header-two","header-three":"richeditor3609789040__header-three","header-four":"richeditor3609789040__header-four","header-five":"richeditor3609789040__header-five","header-six":"richeditor3609789040__header-six","paragraph-one":"richeditor3609789040__paragraph-one","unstyled":"richeditor3609789040__unstyled","paragraph-three":"richeditor3609789040__paragraph-three","align-left":"richeditor3609789040__align-left","align-right":"richeditor3609789040__align-right","align-center":"richeditor3609789040__align-center","align-justify":"richeditor3609789040__align-justify","withMargin":"richeditor3609789040__withMargin","dir-rtl":"richeditor3609789040__dir-rtl"};
|
|
17
17
|
export var keyframes = {};
|
|
18
18
|
export var layers = {};
|
|
19
19
|
export var containers = {};
|
|
20
|
-
export var stVars = {"h1FontSize":"var(--rt-h1-fontSize, 72px)","h1FontStyle":"var(--rt-h1-fontStyle, normal)","h1FontWeight":"var(--rt-h1-fontWeight, var(--wds-font-weight-bold))","h1FontFamily":"var(--rt-h1-fontFamily, var(--wds-font-family-default))","h1LineHeight":"var(--rt-h1-lineHeight, 1.33)","h1Font":"var(--rt-h1-fontStyle, normal) var(--rt-h1-fontWeight, var(--wds-font-weight-bold)) var(--rt-h1-fontSize, 72px)/var(--rt-h1-lineHeight, 1.33) var(--rt-h1-fontFamily, var(--wds-font-family-default))","h2FontSize":"var(--rt-h2-fontSize, 42px)","h2FontStyle":"var(--rt-h2-fontStyle, normal)","h2FontWeight":"var(--rt-h2-fontWeight, var(--wds-font-weight-bold))","h2FontFamily":"var(--rt-h2-fontFamily, var(--wds-font-family-default))","h2LineHeight":"var(--rt-h2-lineHeight, 1.2)","h2Font":"var(--rt-h2-fontStyle, normal) var(--rt-h2-fontWeight, var(--wds-font-weight-bold)) var(--rt-h2-fontSize, 42px)/var(--rt-h2-lineHeight, 1.2) var(--rt-h2-fontFamily, var(--wds-font-family-default))","h3FontSize":"var(--rt-h3-fontSize, 38px)","h3FontStyle":"var(--rt-h3-fontStyle, normal)","h3FontWeight":"var(--rt-h3-fontWeight, var(--wds-font-weight-medium))","h3FontFamily":"var(--rt-h3-fontFamily, var(--wds-font-family-default))","h3LineHeight":"var(--rt-h3-lineHeight, 1.2)","h3Font":"var(--rt-h3-fontStyle, normal) var(--rt-h3-fontWeight, var(--wds-font-weight-medium)) var(--rt-h3-fontSize, 38px)/var(--rt-h3-lineHeight, 1.2) var(--rt-h3-fontFamily, var(--wds-font-family-default))","h4FontSize":"var(--rt-h4-fontSize, 34px)","h4FontStyle":"var(--rt-h4-fontStyle, normal)","h4FontWeight":"var(--rt-h4-fontWeight, var(--wds-font-weight-bold))","h4FontFamily":"var(--rt-h4-fontFamily, var(--wds-font-family-default))","h4LineHeight":"var(--rt-h4-lineHeight, 1.2)","h4Font":"var(--rt-h4-fontStyle, normal) var(--rt-h4-fontWeight, var(--wds-font-weight-bold)) var(--rt-h4-fontSize, 34px)/var(--rt-h4-lineHeight, 1.2) var(--rt-h4-fontFamily, var(--wds-font-family-default))","h5FontSize":"var(--rt-h5-fontSize, 28px)","h5FontStyle":"var(--rt-h5-fontStyle, normal)","h5FontWeight":"var(--rt-h5-fontWeight, var(--wds-font-weight-bold))","h5FontFamily":"var(--rt-h5-fontFamily, var(--wds-font-family-default))","h5LineHeight":"var(--rt-h5-lineHeight, 1.2)","h5Font":"var(--rt-h5-fontStyle, normal) var(--rt-h5-fontWeight, var(--wds-font-weight-bold)) var(--rt-h5-fontSize, 28px)/var(--rt-h5-lineHeight, 1.2) var(--rt-h5-fontFamily, var(--wds-font-family-default))","h6FontSize":"var(--rt-h6-fontSize, 22px)","h6FontStyle":"var(--rt-h6-fontStyle, normal)","h6FontWeight":"var(--rt-h6-fontWeight, var(--wds-font-weight-medium))","h6FontFamily":"var(--rt-h6-fontFamily, var(--wds-font-family-default))","h6LineHeight":"var(--rt-h6-lineHeight, 1.2)","h6Font":"var(--rt-h6-fontStyle, normal) var(--rt-h6-fontWeight, var(--wds-font-weight-medium)) var(--rt-h6-fontSize, 22px)/var(--rt-h6-lineHeight, 1.2) var(--rt-h6-fontFamily, var(--wds-font-family-default))","p1FontSize":"var(--rt-p1-fontSize, 18px)","p1FontStyle":"var(--rt-p1-fontStyle, normal)","p1FontWeight":"var(--rt-p1-fontWeight, var(--wds-font-weight-medium))","p1FontFamily":"var(--rt-p1-fontFamily, var(--wds-font-family-default))","p1LineHeight":"var(--rt-p1-lineHeight, 24px)","p1Font":"var(--rt-p1-fontStyle, normal) var(--rt-p1-fontWeight, var(--wds-font-weight-medium)) var(--rt-p1-fontSize, 18px)/var(--rt-p1-lineHeight, 24px) var(--rt-p1-fontFamily, var(--wds-font-family-default))","unstyledFontSize":"var(--rt-unstyled-fontSize, 16px)","unstyledFontStyle":"var(--rt-unstyled-fontStyle, normal)","unstyledFontWeight":"var(--rt-unstyled-fontWeight, var(--wds-font-weight-medium))","unstyledFontFamily":"var(--rt-unstyled-fontFamily, var(--wds-font-family-default))","unstyledLineHeight":"var(--rt-unstyled-lineHeight, 24px)","unstyledFont":"var(--rt-unstyled-fontStyle, normal) var(--rt-unstyled-fontWeight, var(--wds-font-weight-medium)) var(--rt-unstyled-fontSize, 16px)/var(--rt-unstyled-lineHeight, 24px) var(--rt-unstyled-fontFamily, var(--wds-font-family-default))","p3FontSize":"var(--rt-p3-fontSize, 14px)","p3FontStyle":"var(--rt-p3-fontStyle, normal)","p3FontWeight":"var(--rt-p3-fontWeight, var(--wds-font-weight-medium))","p3FontFamily":"var(--rt-p3-fontFamily, var(--wds-font-family-default))","p3LineHeight":"var(--rt-p3-lineHeight, 18px)","p3Font":"var(--rt-p3-fontStyle, normal) var(--rt-p3-fontWeight, var(--wds-font-weight-medium)) var(--rt-p3-fontSize, 14px)/var(--rt-p3-lineHeight, 18px) var(--rt-p3-fontFamily, var(--wds-font-family-default))"};
|
|
21
|
-
export var vars = {"wds-color-black-100":"--wds-color-black-100","wds-color-black-700":"--wds-color-black-700","wds-font-family-default":"--wds-font-family-default","wds-font-weight-medium":"--wds-font-weight-medium","wds-font-weight-bold":"--wds-font-weight-bold","wds-font-size-500":"--wds-font-size-500","wds-font-line-height-300":"--wds-font-line-height-300","rt-h1-fontSize":"--rt-h1-fontSize","rt-h1-fontStyle":"--rt-h1-fontStyle","rt-h1-fontWeight":"--rt-h1-fontWeight","rt-h1-fontFamily":"--rt-h1-fontFamily","rt-h1-lineHeight":"--rt-h1-lineHeight","rt-h2-fontSize":"--rt-h2-fontSize","rt-h2-fontStyle":"--rt-h2-fontStyle","rt-h2-fontWeight":"--rt-h2-fontWeight","rt-h2-fontFamily":"--rt-h2-fontFamily","rt-h2-lineHeight":"--rt-h2-lineHeight","rt-h3-fontSize":"--rt-h3-fontSize","rt-h3-fontStyle":"--rt-h3-fontStyle","rt-h3-fontWeight":"--rt-h3-fontWeight","rt-h3-fontFamily":"--rt-h3-fontFamily","rt-h3-lineHeight":"--rt-h3-lineHeight","rt-h4-fontSize":"--rt-h4-fontSize","rt-h4-fontStyle":"--rt-h4-fontStyle","rt-h4-fontWeight":"--rt-h4-fontWeight","rt-h4-fontFamily":"--rt-h4-fontFamily","rt-h4-lineHeight":"--rt-h4-lineHeight","rt-h5-fontSize":"--rt-h5-fontSize","rt-h5-fontStyle":"--rt-h5-fontStyle","rt-h5-fontWeight":"--rt-h5-fontWeight","rt-h5-fontFamily":"--rt-h5-fontFamily","rt-h5-lineHeight":"--rt-h5-lineHeight","rt-h6-fontSize":"--rt-h6-fontSize","rt-h6-fontStyle":"--rt-h6-fontStyle","rt-h6-fontWeight":"--rt-h6-fontWeight","rt-h6-fontFamily":"--rt-h6-fontFamily","rt-h6-lineHeight":"--rt-h6-lineHeight","rt-p1-fontSize":"--rt-p1-fontSize","rt-p1-fontStyle":"--rt-p1-fontStyle","rt-p1-fontWeight":"--rt-p1-fontWeight","rt-p1-fontFamily":"--rt-p1-fontFamily","rt-p1-lineHeight":"--rt-p1-lineHeight","rt-unstyled-fontSize":"--rt-unstyled-fontSize","rt-unstyled-fontStyle":"--rt-unstyled-fontStyle","rt-unstyled-fontWeight":"--rt-unstyled-fontWeight","rt-unstyled-fontFamily":"--rt-unstyled-fontFamily","rt-unstyled-lineHeight":"--rt-unstyled-lineHeight","rt-p3-fontSize":"--rt-p3-fontSize","rt-p3-fontStyle":"--rt-p3-fontStyle","rt-p3-fontWeight":"--rt-p3-fontWeight","rt-p3-fontFamily":"--rt-p3-fontFamily","rt-p3-lineHeight":"--rt-p3-lineHeight"};
|
|
20
|
+
export var stVars = {"fontFamilyDefault":"var(--wds-font-family-default, var(--wsr-font-family, Madefor))","h1FontSize":"var(--rt-h1-fontSize, 72px)","h1FontStyle":"var(--rt-h1-fontStyle, normal)","h1FontWeight":"var(--rt-h1-fontWeight, var(--wds-font-weight-bold, 700))","h1FontFamily":"var(--rt-h1-fontFamily, var(--wds-font-family-default, var(--wsr-font-family, Madefor)))","h1LineHeight":"var(--rt-h1-lineHeight, 1.33)","h1Font":"var(--rt-h1-fontStyle, normal) var(--rt-h1-fontWeight, var(--wds-font-weight-bold, 700)) var(--rt-h1-fontSize, 72px)/var(--rt-h1-lineHeight, 1.33) var(--rt-h1-fontFamily, var(--wds-font-family-default, var(--wsr-font-family, Madefor)))","h2FontSize":"var(--rt-h2-fontSize, 42px)","h2FontStyle":"var(--rt-h2-fontStyle, normal)","h2FontWeight":"var(--rt-h2-fontWeight, var(--wds-font-weight-bold, 700))","h2FontFamily":"var(--rt-h2-fontFamily, var(--wds-font-family-default, var(--wsr-font-family, Madefor)))","h2LineHeight":"var(--rt-h2-lineHeight, 1.2)","h2Font":"var(--rt-h2-fontStyle, normal) var(--rt-h2-fontWeight, var(--wds-font-weight-bold, 700)) var(--rt-h2-fontSize, 42px)/var(--rt-h2-lineHeight, 1.2) var(--rt-h2-fontFamily, var(--wds-font-family-default, var(--wsr-font-family, Madefor)))","h3FontSize":"var(--rt-h3-fontSize, 38px)","h3FontStyle":"var(--rt-h3-fontStyle, normal)","h3FontWeight":"var(--rt-h3-fontWeight, var(--wds-font-weight-medium, 500))","h3FontFamily":"var(--rt-h3-fontFamily, var(--wds-font-family-default, var(--wsr-font-family, Madefor)))","h3LineHeight":"var(--rt-h3-lineHeight, 1.2)","h3Font":"var(--rt-h3-fontStyle, normal) var(--rt-h3-fontWeight, var(--wds-font-weight-medium, 500)) var(--rt-h3-fontSize, 38px)/var(--rt-h3-lineHeight, 1.2) var(--rt-h3-fontFamily, var(--wds-font-family-default, var(--wsr-font-family, Madefor)))","h4FontSize":"var(--rt-h4-fontSize, 34px)","h4FontStyle":"var(--rt-h4-fontStyle, normal)","h4FontWeight":"var(--rt-h4-fontWeight, var(--wds-font-weight-bold, 700))","h4FontFamily":"var(--rt-h4-fontFamily, var(--wds-font-family-default, var(--wsr-font-family, Madefor)))","h4LineHeight":"var(--rt-h4-lineHeight, 1.2)","h4Font":"var(--rt-h4-fontStyle, normal) var(--rt-h4-fontWeight, var(--wds-font-weight-bold, 700)) var(--rt-h4-fontSize, 34px)/var(--rt-h4-lineHeight, 1.2) var(--rt-h4-fontFamily, var(--wds-font-family-default, var(--wsr-font-family, Madefor)))","h5FontSize":"var(--rt-h5-fontSize, 28px)","h5FontStyle":"var(--rt-h5-fontStyle, normal)","h5FontWeight":"var(--rt-h5-fontWeight, var(--wds-font-weight-bold, 700))","h5FontFamily":"var(--rt-h5-fontFamily, var(--wds-font-family-default, var(--wsr-font-family, Madefor)))","h5LineHeight":"var(--rt-h5-lineHeight, 1.2)","h5Font":"var(--rt-h5-fontStyle, normal) var(--rt-h5-fontWeight, var(--wds-font-weight-bold, 700)) var(--rt-h5-fontSize, 28px)/var(--rt-h5-lineHeight, 1.2) var(--rt-h5-fontFamily, var(--wds-font-family-default, var(--wsr-font-family, Madefor)))","h6FontSize":"var(--rt-h6-fontSize, 22px)","h6FontStyle":"var(--rt-h6-fontStyle, normal)","h6FontWeight":"var(--rt-h6-fontWeight, var(--wds-font-weight-medium, 500))","h6FontFamily":"var(--rt-h6-fontFamily, var(--wds-font-family-default, var(--wsr-font-family, Madefor)))","h6LineHeight":"var(--rt-h6-lineHeight, 1.2)","h6Font":"var(--rt-h6-fontStyle, normal) var(--rt-h6-fontWeight, var(--wds-font-weight-medium, 500)) var(--rt-h6-fontSize, 22px)/var(--rt-h6-lineHeight, 1.2) var(--rt-h6-fontFamily, var(--wds-font-family-default, var(--wsr-font-family, Madefor)))","p1FontSize":"var(--rt-p1-fontSize, 18px)","p1FontStyle":"var(--rt-p1-fontStyle, normal)","p1FontWeight":"var(--rt-p1-fontWeight, var(--wds-font-weight-medium, 500))","p1FontFamily":"var(--rt-p1-fontFamily, var(--wds-font-family-default, var(--wsr-font-family, Madefor)))","p1LineHeight":"var(--rt-p1-lineHeight, 24px)","p1Font":"var(--rt-p1-fontStyle, normal) var(--rt-p1-fontWeight, var(--wds-font-weight-medium, 500)) var(--rt-p1-fontSize, 18px)/var(--rt-p1-lineHeight, 24px) var(--rt-p1-fontFamily, var(--wds-font-family-default, var(--wsr-font-family, Madefor)))","unstyledFontSize":"var(--rt-unstyled-fontSize, 16px)","unstyledFontStyle":"var(--rt-unstyled-fontStyle, normal)","unstyledFontWeight":"var(--rt-unstyled-fontWeight, var(--wds-font-weight-medium, 500))","unstyledFontFamily":"var(--rt-unstyled-fontFamily, var(--wds-font-family-default, var(--wsr-font-family, Madefor)))","unstyledLineHeight":"var(--rt-unstyled-lineHeight, 24px)","unstyledFont":"var(--rt-unstyled-fontStyle, normal) var(--rt-unstyled-fontWeight, var(--wds-font-weight-medium, 500)) var(--rt-unstyled-fontSize, 16px)/var(--rt-unstyled-lineHeight, 24px) var(--rt-unstyled-fontFamily, var(--wds-font-family-default, var(--wsr-font-family, Madefor)))","p3FontSize":"var(--rt-p3-fontSize, 14px)","p3FontStyle":"var(--rt-p3-fontStyle, normal)","p3FontWeight":"var(--rt-p3-fontWeight, var(--wds-font-weight-medium, 500))","p3FontFamily":"var(--rt-p3-fontFamily, var(--wds-font-family-default, var(--wsr-font-family, Madefor)))","p3LineHeight":"var(--rt-p3-lineHeight, 18px)","p3Font":"var(--rt-p3-fontStyle, normal) var(--rt-p3-fontWeight, var(--wds-font-weight-medium, 500)) var(--rt-p3-fontSize, 14px)/var(--rt-p3-lineHeight, 18px) var(--rt-p3-fontFamily, var(--wds-font-family-default, var(--wsr-font-family, Madefor)))"};
|
|
21
|
+
export var vars = {"wds-color-black-100":"--wds-color-black-100","wds-color-black-700":"--wds-color-black-700","wds-font-family-default":"--wds-font-family-default","wsr-font-family":"--wsr-font-family","wds-font-weight-medium":"--wds-font-weight-medium","wds-font-weight-bold":"--wds-font-weight-bold","wds-font-size-500":"--wds-font-size-500","wds-font-line-height-300":"--wds-font-line-height-300","rt-h1-fontSize":"--rt-h1-fontSize","rt-h1-fontStyle":"--rt-h1-fontStyle","rt-h1-fontWeight":"--rt-h1-fontWeight","rt-h1-fontFamily":"--rt-h1-fontFamily","rt-h1-lineHeight":"--rt-h1-lineHeight","rt-h2-fontSize":"--rt-h2-fontSize","rt-h2-fontStyle":"--rt-h2-fontStyle","rt-h2-fontWeight":"--rt-h2-fontWeight","rt-h2-fontFamily":"--rt-h2-fontFamily","rt-h2-lineHeight":"--rt-h2-lineHeight","rt-h3-fontSize":"--rt-h3-fontSize","rt-h3-fontStyle":"--rt-h3-fontStyle","rt-h3-fontWeight":"--rt-h3-fontWeight","rt-h3-fontFamily":"--rt-h3-fontFamily","rt-h3-lineHeight":"--rt-h3-lineHeight","rt-h4-fontSize":"--rt-h4-fontSize","rt-h4-fontStyle":"--rt-h4-fontStyle","rt-h4-fontWeight":"--rt-h4-fontWeight","rt-h4-fontFamily":"--rt-h4-fontFamily","rt-h4-lineHeight":"--rt-h4-lineHeight","rt-h5-fontSize":"--rt-h5-fontSize","rt-h5-fontStyle":"--rt-h5-fontStyle","rt-h5-fontWeight":"--rt-h5-fontWeight","rt-h5-fontFamily":"--rt-h5-fontFamily","rt-h5-lineHeight":"--rt-h5-lineHeight","rt-h6-fontSize":"--rt-h6-fontSize","rt-h6-fontStyle":"--rt-h6-fontStyle","rt-h6-fontWeight":"--rt-h6-fontWeight","rt-h6-fontFamily":"--rt-h6-fontFamily","rt-h6-lineHeight":"--rt-h6-lineHeight","rt-p1-fontSize":"--rt-p1-fontSize","rt-p1-fontStyle":"--rt-p1-fontStyle","rt-p1-fontWeight":"--rt-p1-fontWeight","rt-p1-fontFamily":"--rt-p1-fontFamily","rt-p1-lineHeight":"--rt-p1-lineHeight","rt-unstyled-fontSize":"--rt-unstyled-fontSize","rt-unstyled-fontStyle":"--rt-unstyled-fontStyle","rt-unstyled-fontWeight":"--rt-unstyled-fontWeight","rt-unstyled-fontFamily":"--rt-unstyled-fontFamily","rt-unstyled-lineHeight":"--rt-unstyled-lineHeight","rt-p3-fontSize":"--rt-p3-fontSize","rt-p3-fontStyle":"--rt-p3-fontStyle","rt-p3-fontWeight":"--rt-p3-fontWeight","rt-p3-fontFamily":"--rt-p3-fontFamily","rt-p3-lineHeight":"--rt-p3-lineHeight","wsr-color-D10":"--richeditor3609789040-wsr-color-D10","wsr-color-D70":"--richeditor3609789040-wsr-color-D70"};
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
|
|
@@ -127,6 +127,7 @@ export class RichEditor extends React.Component<RichEditorProps> {
|
|
|
127
127
|
handleKeyCommand={this.handleKeyCommand}
|
|
128
128
|
blockStyleFn={blockStyleFn}
|
|
129
129
|
handlePastedText={this.handlePastedText}
|
|
130
|
+
preserveSelectionOnBlur
|
|
130
131
|
/>
|
|
131
132
|
</div>
|
|
132
133
|
</div>
|
|
@@ -389,9 +390,17 @@ export class RichEditor extends React.Component<RichEditorProps> {
|
|
|
389
390
|
|
|
390
391
|
private onChangeBlock = (value: string) => {
|
|
391
392
|
let { editorState } = this.props;
|
|
393
|
+
// Restore the last focused selection before computing selected blocks — the
|
|
394
|
+
// editor may have blurred (portal click) before onSelect fires, leaving the
|
|
395
|
+
// current selection stale or collapsed.
|
|
396
|
+
if (this.lastSelectionWithFocus) {
|
|
397
|
+
editorState = EditorState.acceptSelection(
|
|
398
|
+
editorState,
|
|
399
|
+
this.lastSelectionWithFocus,
|
|
400
|
+
);
|
|
401
|
+
}
|
|
392
402
|
let contentState = editorState.getCurrentContent();
|
|
393
403
|
const selectedBlocks = this.getSelectedBlocks(editorState);
|
|
394
|
-
|
|
395
404
|
if (selectedBlocks.length) {
|
|
396
405
|
// if every block have value style then remove it from all
|
|
397
406
|
// else set every block to value
|
|
@@ -459,10 +468,18 @@ export class RichEditor extends React.Component<RichEditorProps> {
|
|
|
459
468
|
);
|
|
460
469
|
|
|
461
470
|
if (this.lastSelectionWithFocus) {
|
|
462
|
-
|
|
463
|
-
editorState
|
|
464
|
-
|
|
465
|
-
|
|
471
|
+
if (containsActiveElement(this.root)) {
|
|
472
|
+
editorState = EditorState.acceptSelection(
|
|
473
|
+
editorState,
|
|
474
|
+
this.lastSelectionWithFocus,
|
|
475
|
+
);
|
|
476
|
+
} else {
|
|
477
|
+
editorState = EditorState.forceSelection(
|
|
478
|
+
editorState,
|
|
479
|
+
this.lastSelectionWithFocus,
|
|
480
|
+
);
|
|
481
|
+
this.focus();
|
|
482
|
+
}
|
|
466
483
|
}
|
|
467
484
|
this.onChange(editorState);
|
|
468
485
|
};
|
package/src/components/rich-text/rich-text-input/rich-text-editor/rich-text-editor.st.css.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { classesRuntime, statesRuntime } from "../../../../stylable-esm-runtime.
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var _namespace_ = "
|
|
8
|
+
var _namespace_ = "richtexteditor4023643757";
|
|
9
9
|
var _style_ = classesRuntime.bind(null, _namespace_);
|
|
10
10
|
|
|
11
11
|
export var cssStates = statesRuntime.bind(null, _namespace_);
|
|
@@ -13,7 +13,7 @@ export var style: import("@stylable/runtime").STFunction = _style_;
|
|
|
13
13
|
export var st: import("@stylable/runtime").STFunction = _style_;
|
|
14
14
|
|
|
15
15
|
export var namespace = _namespace_;
|
|
16
|
-
export var classes = {"root":"
|
|
16
|
+
export var classes = {"root":"richtexteditor4023643757__root","nativeInput":"richtexteditor4023643757__nativeInput","editor":"richtexteditor4023643757__editor"};
|
|
17
17
|
export var keyframes = {};
|
|
18
18
|
export var layers = {};
|
|
19
19
|
export var containers = {};
|