@wix/patterns-fields 1.17.0 → 1.20.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 +7 -3
- 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 +40 -146
- 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/cell-media-gallery-edit.js +301 -0
- package/dist/cjs/components/media-gallery/cell-media-gallery-edit.js.map +1 -0
- package/dist/cjs/components/media-gallery/cell-media-gallery-view.js +45 -0
- package/dist/cjs/components/media-gallery/cell-media-gallery-view.js.map +1 -0
- 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-gallery/index.js +12 -0
- package/dist/cjs/components/media-gallery/index.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/hooks/index.js +6 -0
- package/dist/cjs/hooks/index.js.map +1 -1
- package/dist/cjs/hooks/use-cell-edit-keyboard.js +94 -0
- package/dist/cjs/hooks/use-cell-edit-keyboard.js.map +1 -0
- 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 +7 -3
- 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/audio-field/form-audio-field.st.css.js +2 -2
- package/dist/esm/components/audio/audio-player/audio-player.st.css.js +2 -2
- package/dist/esm/components/color-view/color-view.st.css.js +2 -2
- package/dist/esm/components/delete-dialog/delete-dialog.st.css.js +2 -2
- package/dist/esm/components/document/form-document-field.st.css.js +2 -2
- package/dist/esm/components/exclamation/exclamation.st.css.js +2 -2
- package/dist/esm/components/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 +11 -102
- 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/cell-media-gallery-edit.js +103 -0
- package/dist/esm/components/media-gallery/cell-media-gallery-edit.js.map +1 -0
- package/dist/esm/components/media-gallery/cell-media-gallery-view.js +11 -0
- package/dist/esm/components/media-gallery/cell-media-gallery-view.js.map +1 -0
- 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-gallery/index.js +2 -0
- package/dist/esm/components/media-gallery/index.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 +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/media-tag/web-media-tag/media-tag.st.css.js.map +1 -1
- package/dist/esm/components/multi-document/multi-document-input/form-multi-document-field.js.map +1 -1
- package/dist/esm/components/multi-document/multi-document-input/form-multi-document-view.js.map +1 -1
- package/dist/esm/components/multi-document/multi-document-input/form-multi-document.st.css.js +2 -2
- package/dist/esm/components/multi-document/multi-document-input/form-multi-document.st.css.js.map +1 -1
- package/dist/esm/components/rich-content/cell-rich-content-input.js.map +1 -1
- package/dist/esm/components/rich-content/cell-rich-content-view.js +1 -1
- package/dist/esm/components/rich-content/cell-rich-content-view.js.map +1 -1
- package/dist/esm/components/rich-content/editor.js +1 -2
- package/dist/esm/components/rich-content/editor.js.map +1 -1
- package/dist/esm/components/rich-content/rich-content-input/default-value-input/rich-content-default-value-input.st.css.js +3 -3
- package/dist/esm/components/rich-content/rich-content-input/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-toolbar.st.css.js +2 -2
- package/dist/esm/components/rich-content/rich-content-input/rich-content-viewer/rich-content-viewer.st.css.js +2 -2
- package/dist/esm/components/rich-content/rich-content-input/rich-content-viewer/rich-content-viewer.st.css.js.map +1 -1
- package/dist/esm/components/rich-text/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/rich-text-editor.st.css.js.map +1 -1
- 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/hooks/index.js +1 -0
- package/dist/esm/hooks/index.js.map +1 -1
- package/dist/esm/hooks/use-cell-edit-keyboard.js +81 -0
- package/dist/esm/hooks/use-cell-edit-keyboard.js.map +1 -0
- 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/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/cell-media-gallery-edit.d.ts +15 -0
- package/dist/types/components/media-gallery/cell-media-gallery-edit.d.ts.map +1 -0
- package/dist/types/components/media-gallery/cell-media-gallery-view.d.ts +11 -0
- package/dist/types/components/media-gallery/cell-media-gallery-view.d.ts.map +1 -0
- package/dist/types/components/media-gallery/form-media-gallery-field.st.css.d.ts.map +1 -1
- package/dist/types/components/media-gallery/index.d.ts +2 -0
- package/dist/types/components/media-gallery/index.d.ts.map +1 -1
- package/dist/types/components/media-gallery/media-gallery-dialog/hooks.d.ts +2 -2
- package/dist/types/components/media-image/media-image.st.css.d.ts.map +1 -1
- package/dist/types/components/media-image/overlays/overlay.st.css.d.ts.map +1 -1
- package/dist/types/components/media-tag/web-media-tag/media-tag.st.css.d.ts.map +1 -1
- package/dist/types/components/multi-document/multi-document-input/form-multi-document-view.d.ts +1 -1
- package/dist/types/components/multi-document/multi-document-input/form-multi-document-view.d.ts.map +1 -1
- package/dist/types/components/multi-document/multi-document-input/form-multi-document.st.css.d.ts.map +1 -1
- package/dist/types/components/rich-content/cell-rich-content-input.d.ts.map +1 -1
- package/dist/types/components/rich-content/cell-rich-content-view.d.ts.map +1 -1
- package/dist/types/components/rich-content/editor.d.ts +1 -2
- package/dist/types/components/rich-content/editor.d.ts.map +1 -1
- package/dist/types/components/rich-content/rich-content-input/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-viewer/rich-content-viewer.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/rich-text-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/hooks/index.d.ts +1 -0
- package/dist/types/hooks/index.d.ts.map +1 -1
- package/dist/types/hooks/use-cell-edit-keyboard.d.ts +26 -0
- package/dist/types/hooks/use-cell-edit-keyboard.d.ts.map +1 -0
- 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 +7 -3
- 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 +11 -115
- 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/cell-media-gallery-edit.tsx +219 -0
- package/src/components/media-gallery/cell-media-gallery-view.tsx +32 -0
- package/src/components/media-gallery/form-media-gallery-field.st.css.ts +2 -2
- package/src/components/media-gallery/index.ts +2 -0
- 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/hooks/index.ts +1 -0
- package/src/hooks/use-cell-edit-keyboard.ts +109 -0
- package/src/index.ts +1 -0
- package/src/services/translations.ts +5 -1
- package/src/styles.global.css +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useCallback,
|
|
1
|
+
import React, { useCallback, useRef } from 'react';
|
|
2
2
|
import {
|
|
3
3
|
Box,
|
|
4
4
|
IconButton,
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
Delete,
|
|
16
16
|
} from '@wix/wix-ui-icons-common';
|
|
17
17
|
import { MEDIA_TYPES } from '../../utils/media-utils';
|
|
18
|
-
import { useTranslations } from '../../hooks';
|
|
18
|
+
import { useTranslations, useCellEditKeyboard } from '../../hooks';
|
|
19
19
|
import {
|
|
20
20
|
useMediaControl,
|
|
21
21
|
usePasteURLForm,
|
|
@@ -23,6 +23,7 @@ import {
|
|
|
23
23
|
MediaFieldType,
|
|
24
24
|
} from '../media-control';
|
|
25
25
|
import { ImageThumbnail } from './image-thumbnail';
|
|
26
|
+
import { ThumbnailReplaceOverlay } from './thumbnail-replace-overlay';
|
|
26
27
|
|
|
27
28
|
export interface CellImageEditProps {
|
|
28
29
|
value: string | null | undefined;
|
|
@@ -49,14 +50,9 @@ export const CellImageEdit: React.FC<CellImageEditProps> = ({
|
|
|
49
50
|
}) => {
|
|
50
51
|
const { t } = useTranslations();
|
|
51
52
|
const containerRef = useRef<HTMLDivElement | null>(null);
|
|
52
|
-
// Tracks whether onMediaChange fired during the current callMedia() invocation.
|
|
53
|
-
// Reset to false before each call; checked after the promise resolves to detect
|
|
54
|
-
// "dismissed without selection" so the in-progress edit can be cancelled.
|
|
55
|
-
const mediaCommittedRef = useRef(false);
|
|
56
53
|
|
|
57
54
|
const onMediaChange = useCallback(
|
|
58
55
|
(uri: string) => {
|
|
59
|
-
mediaCommittedRef.current = true;
|
|
60
56
|
onChange(uri);
|
|
61
57
|
onCommit();
|
|
62
58
|
},
|
|
@@ -71,12 +67,8 @@ export const CellImageEdit: React.FC<CellImageEditProps> = ({
|
|
|
71
67
|
|
|
72
68
|
const handleCallMedia = useCallback(async () => {
|
|
73
69
|
onStartEdit?.();
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
// If the picker was dismissed without a selection, neither onCommit nor
|
|
77
|
-
// onCancel ran — call onCancel now so isEditing resets to false and
|
|
78
|
-
// useClearFocusOnBlur is unblocked.
|
|
79
|
-
if (!mediaCommittedRef.current) {
|
|
70
|
+
const committed = await callMedia();
|
|
71
|
+
if (!committed) {
|
|
80
72
|
onCancel?.();
|
|
81
73
|
}
|
|
82
74
|
}, [onStartEdit, callMedia, onCancel]);
|
|
@@ -106,93 +98,11 @@ export const CellImageEdit: React.FC<CellImageEditProps> = ({
|
|
|
106
98
|
onCommit();
|
|
107
99
|
}, [onChange, onCommit]);
|
|
108
100
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
focus: () => {
|
|
115
|
-
const first =
|
|
116
|
-
containerRef.current?.querySelectorAll<HTMLElement>('button')[0];
|
|
117
|
-
first?.focus();
|
|
118
|
-
},
|
|
119
|
-
};
|
|
120
|
-
return () => {
|
|
121
|
-
inputRef.current = null;
|
|
122
|
-
};
|
|
123
|
-
}, [inputRef]);
|
|
124
|
-
|
|
125
|
-
const handleContainerFocus = useCallback(() => {
|
|
126
|
-
containerRef.current?.setAttribute('data-inner-focused', '');
|
|
127
|
-
}, []);
|
|
128
|
-
|
|
129
|
-
const handleContainerBlur = useCallback((e: React.FocusEvent) => {
|
|
130
|
-
if (!e.currentTarget.contains(e.relatedTarget as Node | null)) {
|
|
131
|
-
containerRef.current?.removeAttribute('data-inner-focused');
|
|
132
|
-
}
|
|
133
|
-
}, []);
|
|
134
|
-
|
|
135
|
-
const focusCell = useCallback(() => {
|
|
136
|
-
const cellDiv = containerRef.current?.closest(
|
|
137
|
-
'[role="gridcell"]',
|
|
138
|
-
) as HTMLElement | null;
|
|
139
|
-
cellDiv?.focus({ preventScroll: true });
|
|
140
|
-
}, []);
|
|
141
|
-
|
|
142
|
-
// Native keydown listener — must be native (not React onKeyDown) so that
|
|
143
|
-
// e.stopPropagation() fires during the native bubble phase, before the event
|
|
144
|
-
// reaches the React root where useKeyboardNavigation's onKeyDown would
|
|
145
|
-
// otherwise intercept Tab and move to the next cell.
|
|
146
|
-
useEffect(() => {
|
|
147
|
-
const el = containerRef.current;
|
|
148
|
-
if (!el) return;
|
|
149
|
-
|
|
150
|
-
const handleKeyDown = (e: KeyboardEvent) => {
|
|
151
|
-
if (e.key === 'Escape') {
|
|
152
|
-
e.preventDefault();
|
|
153
|
-
e.stopPropagation();
|
|
154
|
-
// Cancel any in-progress edit (e.g. if isEditing was set before opening
|
|
155
|
-
// a modal that then got dismissed via keyboard), then return focus to the
|
|
156
|
-
// cell div. The useCellFocusAndEditing useEffect will also refocus the
|
|
157
|
-
// cell div if isEditing transitions false→false is a no-op, so we also
|
|
158
|
-
// call focusCell() directly as a reliable fallback.
|
|
159
|
-
onCancel?.();
|
|
160
|
-
focusCell();
|
|
161
|
-
return;
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
// Tab while a button in this component is focused: cycle through the
|
|
165
|
-
// interactive elements. Tab off the last (or Shift+Tab off the first)
|
|
166
|
-
// returns focus to the cell div for normal cell-level navigation.
|
|
167
|
-
if (e.key === 'Tab') {
|
|
168
|
-
const buttons = Array.from(el.querySelectorAll<HTMLElement>('button'));
|
|
169
|
-
const currentIdx = buttons.indexOf(
|
|
170
|
-
document.activeElement as HTMLElement,
|
|
171
|
-
);
|
|
172
|
-
if (currentIdx === -1) return; // focus is not on one of our buttons — pass through
|
|
173
|
-
|
|
174
|
-
e.preventDefault();
|
|
175
|
-
e.stopPropagation();
|
|
176
|
-
|
|
177
|
-
if (!e.shiftKey) {
|
|
178
|
-
if (currentIdx >= buttons.length - 1) {
|
|
179
|
-
focusCell();
|
|
180
|
-
} else {
|
|
181
|
-
buttons[currentIdx + 1]?.focus();
|
|
182
|
-
}
|
|
183
|
-
} else {
|
|
184
|
-
if (currentIdx <= 0) {
|
|
185
|
-
focusCell();
|
|
186
|
-
} else {
|
|
187
|
-
buttons[currentIdx - 1]?.focus();
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
};
|
|
192
|
-
|
|
193
|
-
el.addEventListener('keydown', handleKeyDown);
|
|
194
|
-
return () => el.removeEventListener('keydown', handleKeyDown);
|
|
195
|
-
}, [focusCell, onCancel]);
|
|
101
|
+
const { handleContainerFocus, handleContainerBlur } = useCellEditKeyboard({
|
|
102
|
+
containerRef,
|
|
103
|
+
onCancel,
|
|
104
|
+
inputRef,
|
|
105
|
+
});
|
|
196
106
|
|
|
197
107
|
if (loading) {
|
|
198
108
|
return (
|
|
@@ -241,21 +151,7 @@ export const CellImageEdit: React.FC<CellImageEditProps> = ({
|
|
|
241
151
|
}}
|
|
242
152
|
>
|
|
243
153
|
<ImageThumbnail value={value} />
|
|
244
|
-
<
|
|
245
|
-
style={{
|
|
246
|
-
position: 'absolute',
|
|
247
|
-
inset: 0,
|
|
248
|
-
display: 'flex',
|
|
249
|
-
alignItems: 'center',
|
|
250
|
-
justifyContent: 'center',
|
|
251
|
-
background: 'rgba(0, 0, 0, 0.4)',
|
|
252
|
-
borderRadius: '3px',
|
|
253
|
-
}}
|
|
254
|
-
>
|
|
255
|
-
<Replace
|
|
256
|
-
style={{ color: 'white', width: '18px', height: '18px' }}
|
|
257
|
-
/>
|
|
258
|
-
</div>
|
|
154
|
+
<ThumbnailReplaceOverlay />
|
|
259
155
|
</button>
|
|
260
156
|
</Box>
|
|
261
157
|
</Tooltip>
|
|
@@ -17,6 +17,7 @@ export interface ImageThumbnailProps {
|
|
|
17
17
|
onMouseEnter?: () => void;
|
|
18
18
|
onMouseLeave?: () => void;
|
|
19
19
|
dataHook?: string;
|
|
20
|
+
showVideoIndicator?: boolean;
|
|
20
21
|
}
|
|
21
22
|
|
|
22
23
|
export const ImageThumbnail: React.FC<ImageThumbnailProps> = ({
|
|
@@ -26,6 +27,7 @@ export const ImageThumbnail: React.FC<ImageThumbnailProps> = ({
|
|
|
26
27
|
onMouseEnter,
|
|
27
28
|
onMouseLeave,
|
|
28
29
|
dataHook,
|
|
30
|
+
showVideoIndicator = true,
|
|
29
31
|
}) => {
|
|
30
32
|
const src = value ? mediaURItoImageURL(value, ThumbnailSize.S) : undefined;
|
|
31
33
|
|
|
@@ -33,7 +35,13 @@ export const ImageThumbnail: React.FC<ImageThumbnailProps> = ({
|
|
|
33
35
|
<div
|
|
34
36
|
data-hook={dataHook}
|
|
35
37
|
data-empty={!value || undefined}
|
|
36
|
-
style={{
|
|
38
|
+
style={{
|
|
39
|
+
width: '36px',
|
|
40
|
+
height: '36px',
|
|
41
|
+
borderRadius: '3px',
|
|
42
|
+
flexShrink: 0,
|
|
43
|
+
position: 'relative',
|
|
44
|
+
}}
|
|
37
45
|
>
|
|
38
46
|
<MediaImage
|
|
39
47
|
src={src}
|
|
@@ -49,7 +57,7 @@ export const ImageThumbnail: React.FC<ImageThumbnailProps> = ({
|
|
|
49
57
|
onMouseEnter={onMouseEnter}
|
|
50
58
|
onMouseLeave={onMouseLeave}
|
|
51
59
|
overlay={
|
|
52
|
-
value && isMediaVideoURI(value) ? (
|
|
60
|
+
value && showVideoIndicator && isMediaVideoURI(value) ? (
|
|
53
61
|
<VideoIndicatorOverlay src={value} size="small" />
|
|
54
62
|
) : (
|
|
55
63
|
<CustomUrlOverlay src={value} size="small" />
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
import { classesRuntime, statesRuntime } from "../../stylable-esm-runtime.js";
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
var _namespace_ = "thumbnailreplaceoverlay3138302508";
|
|
9
|
+
var _style_ = classesRuntime.bind(null, _namespace_);
|
|
10
|
+
|
|
11
|
+
export var cssStates = statesRuntime.bind(null, _namespace_);
|
|
12
|
+
export var style: import("@stylable/runtime").STFunction = _style_;
|
|
13
|
+
export var st: import("@stylable/runtime").STFunction = _style_;
|
|
14
|
+
|
|
15
|
+
export var namespace = _namespace_;
|
|
16
|
+
export var classes = {"root":"thumbnailreplaceoverlay3138302508__root","icon":"thumbnailreplaceoverlay3138302508__icon"};
|
|
17
|
+
export var keyframes = {};
|
|
18
|
+
export var layers = {};
|
|
19
|
+
export var containers = {};
|
|
20
|
+
export var stVars = {};
|
|
21
|
+
export var vars = {};
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Replace } from '@wix/wix-ui-icons-common';
|
|
3
|
+
import { classes } from './thumbnail-replace-overlay.st.css.js';
|
|
4
|
+
|
|
5
|
+
export const ThumbnailReplaceOverlay: React.FC = () => (
|
|
6
|
+
<div className={classes.root}>
|
|
7
|
+
<Replace className={classes.icon} />
|
|
8
|
+
</div>
|
|
9
|
+
);
|
|
10
|
+
|
|
11
|
+
ThumbnailReplaceOverlay.displayName = 'ThumbnailReplaceOverlay';
|
|
@@ -5,7 +5,7 @@ import { classesRuntime, statesRuntime } from "../../stylable-esm-runtime.js";
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var _namespace_ = "
|
|
8
|
+
var _namespace_ = "pasteurlbutton1583106728";
|
|
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":"pasteurlbutton1583106728__root","iconButtonTooltip":"pasteurlbutton1583106728__iconButtonTooltip","iconButton":"pasteurlbutton1583106728__iconButton"};
|
|
17
17
|
export var keyframes = {};
|
|
18
18
|
export var layers = {};
|
|
19
19
|
export var containers = {};
|
|
@@ -2,7 +2,7 @@ import { useRef, useState, useEffect, useCallback } from 'react';
|
|
|
2
2
|
import { dashboard } from '@wix/dashboard';
|
|
3
3
|
import { files } from '@wix/media';
|
|
4
4
|
|
|
5
|
-
import
|
|
5
|
+
import { MEDIA_TYPES } from '../../utils/media-utils';
|
|
6
6
|
import { executeDownloading } from '../../utils/media-utils';
|
|
7
7
|
import { getMediaURL } from '../../auto-field-types';
|
|
8
8
|
|
|
@@ -45,12 +45,12 @@ interface UseMediaControlBaseReturnType {
|
|
|
45
45
|
|
|
46
46
|
interface UseSingleMediaControlReturnType
|
|
47
47
|
extends UseMediaControlBaseReturnType {
|
|
48
|
-
callMedia(): Promise<
|
|
48
|
+
callMedia(): Promise<boolean>;
|
|
49
49
|
downloadMedia(mediaUri?: string): Promise<void>;
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
interface UseMultiMediaControlReturnType extends UseMediaControlBaseReturnType {
|
|
53
|
-
callMedia(index?: number): Promise<
|
|
53
|
+
callMedia(index?: number): Promise<boolean>;
|
|
54
54
|
downloadMedia(mediaUri?: string): Promise<void>;
|
|
55
55
|
}
|
|
56
56
|
|
|
@@ -58,12 +58,10 @@ export type UseMediaControlReturnType =
|
|
|
58
58
|
| UseSingleMediaControlReturnType
|
|
59
59
|
| UseMultiMediaControlReturnType;
|
|
60
60
|
|
|
61
|
-
const MEDIA_TYPE_TO_CATEGORY: Record<
|
|
62
|
-
IMAGE: 'IMAGE',
|
|
63
|
-
VIDEO: 'VIDEO',
|
|
64
|
-
|
|
65
|
-
DOCUMENT: 'DOCUMENT',
|
|
66
|
-
ALL_MEDIA: undefined,
|
|
61
|
+
const MEDIA_TYPE_TO_CATEGORY: Partial<Record<MEDIA_TYPES, string>> = {
|
|
62
|
+
[MEDIA_TYPES.IMAGE]: 'IMAGE',
|
|
63
|
+
[MEDIA_TYPES.VIDEO]: 'VIDEO',
|
|
64
|
+
[MEDIA_TYPES.AUDIO]: 'MUSIC',
|
|
67
65
|
};
|
|
68
66
|
|
|
69
67
|
/**
|
|
@@ -157,13 +155,13 @@ export function useMediaControl({
|
|
|
157
155
|
const onMediaLoad = useCallback(() => setLoading(false), []);
|
|
158
156
|
|
|
159
157
|
const callMedia = useCallback(
|
|
160
|
-
async (index?: number) => {
|
|
158
|
+
async (index?: number): Promise<boolean> => {
|
|
161
159
|
if (mediaRequested.current || readOnly) {
|
|
162
|
-
return;
|
|
160
|
+
return false;
|
|
163
161
|
}
|
|
164
162
|
|
|
165
163
|
if (!params.onChange) {
|
|
166
|
-
return;
|
|
164
|
+
return false;
|
|
167
165
|
}
|
|
168
166
|
|
|
169
167
|
mediaRequested.current = true;
|
|
@@ -190,7 +188,7 @@ export function useMediaControl({
|
|
|
190
188
|
mediaManagerData?.items || (mediaManagerData as any)?.files;
|
|
191
189
|
|
|
192
190
|
if (!items?.length) {
|
|
193
|
-
return;
|
|
191
|
+
return false;
|
|
194
192
|
}
|
|
195
193
|
|
|
196
194
|
if (params.multiSelect) {
|
|
@@ -212,10 +210,12 @@ export function useMediaControl({
|
|
|
212
210
|
} else {
|
|
213
211
|
params.onChange(extractMediaUri(items[0]));
|
|
214
212
|
}
|
|
213
|
+
return true;
|
|
215
214
|
} catch (e) {
|
|
216
215
|
setLoading(false);
|
|
217
216
|
mediaRequested.current = false;
|
|
218
217
|
console.error(`Media Control Error:`, e);
|
|
218
|
+
return false;
|
|
219
219
|
}
|
|
220
220
|
},
|
|
221
221
|
[
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
import React, { useCallback, useRef, useState } from 'react';
|
|
2
|
+
import {
|
|
3
|
+
AvatarGroup,
|
|
4
|
+
Box,
|
|
5
|
+
IconButton,
|
|
6
|
+
PopoverMenu,
|
|
7
|
+
Tooltip,
|
|
8
|
+
} from '@wix/design-system';
|
|
9
|
+
import {
|
|
10
|
+
Add,
|
|
11
|
+
MoreSmall,
|
|
12
|
+
Refresh,
|
|
13
|
+
Delete,
|
|
14
|
+
Maximize,
|
|
15
|
+
} from '@wix/wix-ui-icons-common';
|
|
16
|
+
import { files } from '@wix/media';
|
|
17
|
+
import { mediaURItoImageURL, ThumbnailSize, getMediaURL } from '../../auto-field-types';
|
|
18
|
+
import type { WixCodeGalleryItem } from '../../auto-field-types';
|
|
19
|
+
import { useTranslations, useCellEditKeyboard } from '../../hooks';
|
|
20
|
+
import { executeDownloading } from '../../utils/media-utils';
|
|
21
|
+
import { useMediaGalleryDialog } from './media-gallery-dialog/hooks';
|
|
22
|
+
import { MediaGalleryDialog } from './media-gallery-dialog/media-gallery-dialog';
|
|
23
|
+
import { MediaPreviewModal } from './media-preview-modal';
|
|
24
|
+
|
|
25
|
+
const mediaGalleryPreviewTextKeys = {
|
|
26
|
+
replace: 'CMS.mediaGallery.preview.replace',
|
|
27
|
+
download: 'CMS.mediaGallery.preview.download',
|
|
28
|
+
delete: 'CMS.mediaGallery.preview.delete',
|
|
29
|
+
} as const;
|
|
30
|
+
|
|
31
|
+
export interface CellMediaGalleryEditProps {
|
|
32
|
+
value: WixCodeGalleryItem[] | null;
|
|
33
|
+
onChange: (value: WixCodeGalleryItem[] | null) => void;
|
|
34
|
+
onCommit: () => void;
|
|
35
|
+
onCancel?: () => void;
|
|
36
|
+
onStartEdit?: () => void;
|
|
37
|
+
inputRef?: React.MutableRefObject<{ focus: () => void } | null | undefined>;
|
|
38
|
+
dataHook?: string;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export const CellMediaGalleryEdit: React.FC<CellMediaGalleryEditProps> = ({
|
|
42
|
+
value,
|
|
43
|
+
onChange,
|
|
44
|
+
onCommit,
|
|
45
|
+
onCancel,
|
|
46
|
+
onStartEdit,
|
|
47
|
+
inputRef,
|
|
48
|
+
dataHook,
|
|
49
|
+
}) => {
|
|
50
|
+
const { t } = useTranslations();
|
|
51
|
+
const containerRef = useRef<HTMLDivElement | null>(null);
|
|
52
|
+
const hasValue = Boolean(value?.length);
|
|
53
|
+
const [isPreviewOpen, setIsPreviewOpen] = useState(false);
|
|
54
|
+
// Tracks whether a commit happened during the current external-UI session.
|
|
55
|
+
// Prevents calling onCancel() after the user already committed (e.g., clear
|
|
56
|
+
// in the preview modal fires onClear then onClose, but we should not cancel).
|
|
57
|
+
const didCommitRef = useRef(false);
|
|
58
|
+
|
|
59
|
+
const avatarItems = (value ?? []).map((item) => ({
|
|
60
|
+
imgProps: { src: mediaURItoImageURL(item.src, ThumbnailSize.S) },
|
|
61
|
+
}));
|
|
62
|
+
|
|
63
|
+
const { openMediaGalleryDialog, ...dialogProps } = useMediaGalleryDialog({
|
|
64
|
+
initialOpen: false,
|
|
65
|
+
items: value ?? [],
|
|
66
|
+
onChange: (items: WixCodeGalleryItem[]) => {
|
|
67
|
+
didCommitRef.current = true;
|
|
68
|
+
onChange(items.length > 0 ? items : null);
|
|
69
|
+
onCommit();
|
|
70
|
+
},
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
const handleOpenGallery = useCallback(() => {
|
|
74
|
+
didCommitRef.current = false;
|
|
75
|
+
onStartEdit?.();
|
|
76
|
+
openMediaGalleryDialog();
|
|
77
|
+
}, [onStartEdit, openMediaGalleryDialog]);
|
|
78
|
+
|
|
79
|
+
const handleOpenPreview = useCallback(() => {
|
|
80
|
+
didCommitRef.current = false;
|
|
81
|
+
onStartEdit?.();
|
|
82
|
+
setIsPreviewOpen(true);
|
|
83
|
+
}, [onStartEdit]);
|
|
84
|
+
|
|
85
|
+
const handlePreviewClose = useCallback(() => {
|
|
86
|
+
setIsPreviewOpen(false);
|
|
87
|
+
if (!didCommitRef.current) {
|
|
88
|
+
onCancel?.();
|
|
89
|
+
}
|
|
90
|
+
didCommitRef.current = false;
|
|
91
|
+
}, [onCancel]);
|
|
92
|
+
|
|
93
|
+
const handlePreviewRequestMedia = useCallback(() => {
|
|
94
|
+
setIsPreviewOpen(false);
|
|
95
|
+
openMediaGalleryDialog();
|
|
96
|
+
}, [openMediaGalleryDialog]);
|
|
97
|
+
|
|
98
|
+
const handlePreviewClear = useCallback(() => {
|
|
99
|
+
didCommitRef.current = true;
|
|
100
|
+
onChange(null);
|
|
101
|
+
onCommit();
|
|
102
|
+
}, [onChange, onCommit]);
|
|
103
|
+
|
|
104
|
+
const handleClearAll = useCallback(() => {
|
|
105
|
+
onChange(null);
|
|
106
|
+
onCommit();
|
|
107
|
+
}, [onChange, onCommit]);
|
|
108
|
+
|
|
109
|
+
const onDownloadMedia = useCallback(
|
|
110
|
+
async (mediaUri?: string) => {
|
|
111
|
+
const uri = mediaUri ?? value?.[0]?.src;
|
|
112
|
+
if (!uri) return;
|
|
113
|
+
try {
|
|
114
|
+
const result = await files.generateFileDownloadUrl(uri);
|
|
115
|
+
const downloadUrl = result.downloadUrls?.[0]?.url;
|
|
116
|
+
if (!downloadUrl) throw new Error('No download URL returned');
|
|
117
|
+
executeDownloading(downloadUrl);
|
|
118
|
+
} catch {
|
|
119
|
+
executeDownloading(getMediaURL(uri));
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
[value],
|
|
123
|
+
);
|
|
124
|
+
|
|
125
|
+
const { handleContainerFocus, handleContainerBlur } = useCellEditKeyboard({
|
|
126
|
+
containerRef,
|
|
127
|
+
onCancel,
|
|
128
|
+
inputRef,
|
|
129
|
+
});
|
|
130
|
+
|
|
131
|
+
return (
|
|
132
|
+
<div
|
|
133
|
+
ref={containerRef}
|
|
134
|
+
data-hook={dataHook}
|
|
135
|
+
style={{ width: '100%', height: '100%' }}
|
|
136
|
+
onFocus={handleContainerFocus}
|
|
137
|
+
onBlur={handleContainerBlur}
|
|
138
|
+
>
|
|
139
|
+
<Box
|
|
140
|
+
align="space-between"
|
|
141
|
+
verticalAlign="middle"
|
|
142
|
+
height="100%"
|
|
143
|
+
padding="0 8px"
|
|
144
|
+
style={{ boxSizing: 'border-box' }}
|
|
145
|
+
>
|
|
146
|
+
{hasValue ? (
|
|
147
|
+
<AvatarGroup items={avatarItems} size="tiny" type="condensed" />
|
|
148
|
+
) : (
|
|
149
|
+
<Tooltip content={t('CMS.mediaGallery.addGallery')} appendTo="window">
|
|
150
|
+
<IconButton
|
|
151
|
+
size="tiny"
|
|
152
|
+
priority="secondary"
|
|
153
|
+
dataHook="gallery-edit-add-button"
|
|
154
|
+
onClick={handleOpenGallery}
|
|
155
|
+
>
|
|
156
|
+
<Add />
|
|
157
|
+
</IconButton>
|
|
158
|
+
</Tooltip>
|
|
159
|
+
)}
|
|
160
|
+
|
|
161
|
+
{hasValue ? (
|
|
162
|
+
<PopoverMenu
|
|
163
|
+
textSize="small"
|
|
164
|
+
appendTo="window"
|
|
165
|
+
triggerElement={
|
|
166
|
+
<Tooltip
|
|
167
|
+
content={t('auto-patterns.fields.more_actions_tooltip')}
|
|
168
|
+
appendTo="window"
|
|
169
|
+
>
|
|
170
|
+
<IconButton
|
|
171
|
+
size="tiny"
|
|
172
|
+
priority="tertiary"
|
|
173
|
+
dataHook="gallery-edit-more-button"
|
|
174
|
+
>
|
|
175
|
+
<MoreSmall />
|
|
176
|
+
</IconButton>
|
|
177
|
+
</Tooltip>
|
|
178
|
+
}
|
|
179
|
+
>
|
|
180
|
+
<PopoverMenu.MenuItem
|
|
181
|
+
dataHook="gallery-edit-action-manage"
|
|
182
|
+
text={t('CMS.mediaGallery.manageGallery')}
|
|
183
|
+
prefixIcon={<Refresh />}
|
|
184
|
+
onClick={handleOpenGallery}
|
|
185
|
+
/>
|
|
186
|
+
<PopoverMenu.MenuItem
|
|
187
|
+
dataHook="gallery-edit-action-preview"
|
|
188
|
+
text={t('CMS.mediaGallery.preview')}
|
|
189
|
+
prefixIcon={<Maximize />}
|
|
190
|
+
onClick={handleOpenPreview}
|
|
191
|
+
/>
|
|
192
|
+
<PopoverMenu.Divider />
|
|
193
|
+
<PopoverMenu.MenuItem
|
|
194
|
+
dataHook="gallery-edit-action-clear"
|
|
195
|
+
text={t('CMS.mediaGallery.clear')}
|
|
196
|
+
skin="destructive"
|
|
197
|
+
prefixIcon={<Delete />}
|
|
198
|
+
onClick={handleClearAll}
|
|
199
|
+
/>
|
|
200
|
+
</PopoverMenu>
|
|
201
|
+
) : null}
|
|
202
|
+
</Box>
|
|
203
|
+
|
|
204
|
+
{dialogProps.isOpen && <MediaGalleryDialog {...dialogProps} />}
|
|
205
|
+
|
|
206
|
+
<MediaPreviewModal
|
|
207
|
+
isOpen={isPreviewOpen}
|
|
208
|
+
onClose={handlePreviewClose}
|
|
209
|
+
value={(value ?? []).map((item) => item.src)}
|
|
210
|
+
onRequestMedia={handlePreviewRequestMedia}
|
|
211
|
+
onClearMedia={handlePreviewClear}
|
|
212
|
+
onDownloadMedia={onDownloadMedia}
|
|
213
|
+
textKeys={mediaGalleryPreviewTextKeys}
|
|
214
|
+
/>
|
|
215
|
+
</div>
|
|
216
|
+
);
|
|
217
|
+
};
|
|
218
|
+
|
|
219
|
+
CellMediaGalleryEdit.displayName = 'CellMediaGalleryEdit';
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { AvatarGroup, Box } from '@wix/design-system';
|
|
3
|
+
import { mediaURItoImageURL, ThumbnailSize } from '../../auto-field-types';
|
|
4
|
+
import type { WixCodeGalleryItem } from '../../auto-field-types';
|
|
5
|
+
|
|
6
|
+
export interface CellMediaGalleryViewProps {
|
|
7
|
+
data: WixCodeGalleryItem[] | null;
|
|
8
|
+
dataHook?: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export function CellMediaGalleryView({ data, dataHook }: CellMediaGalleryViewProps) {
|
|
12
|
+
const items = (data ?? []).map((item) => ({
|
|
13
|
+
imgProps: { src: mediaURItoImageURL(item.src, ThumbnailSize.S) },
|
|
14
|
+
}));
|
|
15
|
+
|
|
16
|
+
return (
|
|
17
|
+
<Box
|
|
18
|
+
dataHook={dataHook}
|
|
19
|
+
verticalAlign="middle"
|
|
20
|
+
height="100%"
|
|
21
|
+
width="100%"
|
|
22
|
+
padding="0 8px"
|
|
23
|
+
overflow="hidden"
|
|
24
|
+
>
|
|
25
|
+
{items.length > 0 ? (
|
|
26
|
+
<AvatarGroup items={items} size="tiny" type="condensed" />
|
|
27
|
+
) : null}
|
|
28
|
+
</Box>
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
CellMediaGalleryView.displayName = 'CellMediaGalleryView';
|
|
@@ -5,7 +5,7 @@ import { classesRuntime, statesRuntime } from "../../stylable-esm-runtime.js";
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var _namespace_ = "
|
|
8
|
+
var _namespace_ = "formmediagalleryfield896548020";
|
|
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":"formmediagalleryfield896548020__root","container":"formmediagalleryfield896548020__container","viewBox":"formmediagalleryfield896548020__viewBox","addItemWrapper":"formmediagalleryfield896548020__addItemWrapper","addItem":"formmediagalleryfield896548020__addItem","overlay":"formmediagalleryfield896548020__overlay","image":"formmediagalleryfield896548020__image","previewImage":"formmediagalleryfield896548020__previewImage","previewVideo":"formmediagalleryfield896548020__previewVideo"};
|
|
17
17
|
export var keyframes = {};
|
|
18
18
|
export var layers = {};
|
|
19
19
|
export var containers = {};
|
|
@@ -5,7 +5,7 @@ import { classesRuntime, statesRuntime } from "../../stylable-esm-runtime.js";
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var _namespace_ = "
|
|
8
|
+
var _namespace_ = "mediaimage3815000853";
|
|
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":"mediaimage3815000853__root"};
|
|
17
17
|
export var keyframes = {};
|
|
18
18
|
export var layers = {};
|
|
19
19
|
export var containers = {};
|
|
20
20
|
export var stVars = {};
|
|
21
|
-
export var vars = {"wds-color-red-200":"--wds-color-red-200","wsr-color-R20":"--wsr-color-R20","wds-color-black-550":"--wds-color-black-550","wsr-color-D55":"--wsr-color-D55","from":"--
|
|
21
|
+
export var vars = {"wds-color-red-200":"--wds-color-red-200","wsr-color-R20":"--wsr-color-R20","wds-color-black-550":"--wds-color-black-550","wsr-color-D55":"--wsr-color-D55","from":"--mediaimage3815000853-from","to":"--mediaimage3815000853-to"};
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
|