@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
|
@@ -9,6 +9,7 @@ var _mediaUtils = require("../../utils/media-utils");
|
|
|
9
9
|
var _hooks = require("../../hooks");
|
|
10
10
|
var _mediaControl = require("../media-control");
|
|
11
11
|
var _imageThumbnail = require("./image-thumbnail");
|
|
12
|
+
var _thumbnailReplaceOverlay = require("./thumbnail-replace-overlay");
|
|
12
13
|
var _jsxFileName = "/home/builduser/work/843658b9f44192f0/packages/fields/dist/cjs/components/image/cell-image-edit.tsx";
|
|
13
14
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
14
15
|
const CellImageEdit = ({
|
|
@@ -24,12 +25,7 @@ const CellImageEdit = ({
|
|
|
24
25
|
t
|
|
25
26
|
} = (0, _hooks.useTranslations)();
|
|
26
27
|
const containerRef = (0, _react.useRef)(null);
|
|
27
|
-
// Tracks whether onMediaChange fired during the current callMedia() invocation.
|
|
28
|
-
// Reset to false before each call; checked after the promise resolves to detect
|
|
29
|
-
// "dismissed without selection" so the in-progress edit can be cancelled.
|
|
30
|
-
const mediaCommittedRef = (0, _react.useRef)(false);
|
|
31
28
|
const onMediaChange = (0, _react.useCallback)(uri => {
|
|
32
|
-
mediaCommittedRef.current = true;
|
|
33
29
|
onChange(uri);
|
|
34
30
|
onCommit();
|
|
35
31
|
}, [onChange, onCommit]);
|
|
@@ -43,12 +39,8 @@ const CellImageEdit = ({
|
|
|
43
39
|
});
|
|
44
40
|
const handleCallMedia = (0, _react.useCallback)(async () => {
|
|
45
41
|
onStartEdit == null || onStartEdit();
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
// If the picker was dismissed without a selection, neither onCommit nor
|
|
49
|
-
// onCancel ran — call onCancel now so isEditing resets to false and
|
|
50
|
-
// useClearFocusOnBlur is unblocked.
|
|
51
|
-
if (!mediaCommittedRef.current) {
|
|
42
|
+
const committed = await callMedia();
|
|
43
|
+
if (!committed) {
|
|
52
44
|
onCancel == null || onCancel();
|
|
53
45
|
}
|
|
54
46
|
}, [onStartEdit, callMedia, onCancel]);
|
|
@@ -77,91 +69,14 @@ const CellImageEdit = ({
|
|
|
77
69
|
onChange(null);
|
|
78
70
|
onCommit();
|
|
79
71
|
}, [onChange, onCommit]);
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
(0,
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
const first = (_containerRef$current = containerRef.current) == null ? void 0 : _containerRef$current.querySelectorAll('button')[0];
|
|
89
|
-
first == null || first.focus();
|
|
90
|
-
}
|
|
91
|
-
};
|
|
92
|
-
return () => {
|
|
93
|
-
inputRef.current = null;
|
|
94
|
-
};
|
|
95
|
-
}, [inputRef]);
|
|
96
|
-
const handleContainerFocus = (0, _react.useCallback)(() => {
|
|
97
|
-
var _containerRef$current2;
|
|
98
|
-
(_containerRef$current2 = containerRef.current) == null || _containerRef$current2.setAttribute('data-inner-focused', '');
|
|
99
|
-
}, []);
|
|
100
|
-
const handleContainerBlur = (0, _react.useCallback)(e => {
|
|
101
|
-
if (!e.currentTarget.contains(e.relatedTarget)) {
|
|
102
|
-
var _containerRef$current3;
|
|
103
|
-
(_containerRef$current3 = containerRef.current) == null || _containerRef$current3.removeAttribute('data-inner-focused');
|
|
104
|
-
}
|
|
105
|
-
}, []);
|
|
106
|
-
const focusCell = (0, _react.useCallback)(() => {
|
|
107
|
-
var _containerRef$current4;
|
|
108
|
-
const cellDiv = (_containerRef$current4 = containerRef.current) == null ? void 0 : _containerRef$current4.closest('[role="gridcell"]');
|
|
109
|
-
cellDiv == null || cellDiv.focus({
|
|
110
|
-
preventScroll: true
|
|
111
|
-
});
|
|
112
|
-
}, []);
|
|
113
|
-
|
|
114
|
-
// Native keydown listener — must be native (not React onKeyDown) so that
|
|
115
|
-
// e.stopPropagation() fires during the native bubble phase, before the event
|
|
116
|
-
// reaches the React root where useKeyboardNavigation's onKeyDown would
|
|
117
|
-
// otherwise intercept Tab and move to the next cell.
|
|
118
|
-
(0, _react.useEffect)(() => {
|
|
119
|
-
const el = containerRef.current;
|
|
120
|
-
if (!el) return;
|
|
121
|
-
const handleKeyDown = e => {
|
|
122
|
-
if (e.key === 'Escape') {
|
|
123
|
-
e.preventDefault();
|
|
124
|
-
e.stopPropagation();
|
|
125
|
-
// Cancel any in-progress edit (e.g. if isEditing was set before opening
|
|
126
|
-
// a modal that then got dismissed via keyboard), then return focus to the
|
|
127
|
-
// cell div. The useCellFocusAndEditing useEffect will also refocus the
|
|
128
|
-
// cell div if isEditing transitions false→false is a no-op, so we also
|
|
129
|
-
// call focusCell() directly as a reliable fallback.
|
|
130
|
-
onCancel == null || onCancel();
|
|
131
|
-
focusCell();
|
|
132
|
-
return;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
// Tab while a button in this component is focused: cycle through the
|
|
136
|
-
// interactive elements. Tab off the last (or Shift+Tab off the first)
|
|
137
|
-
// returns focus to the cell div for normal cell-level navigation.
|
|
138
|
-
if (e.key === 'Tab') {
|
|
139
|
-
const buttons = Array.from(el.querySelectorAll('button'));
|
|
140
|
-
const currentIdx = buttons.indexOf(document.activeElement);
|
|
141
|
-
if (currentIdx === -1) return; // focus is not on one of our buttons — pass through
|
|
142
|
-
|
|
143
|
-
e.preventDefault();
|
|
144
|
-
e.stopPropagation();
|
|
145
|
-
if (!e.shiftKey) {
|
|
146
|
-
if (currentIdx >= buttons.length - 1) {
|
|
147
|
-
focusCell();
|
|
148
|
-
} else {
|
|
149
|
-
var _buttons;
|
|
150
|
-
(_buttons = buttons[currentIdx + 1]) == null || _buttons.focus();
|
|
151
|
-
}
|
|
152
|
-
} else {
|
|
153
|
-
if (currentIdx <= 0) {
|
|
154
|
-
focusCell();
|
|
155
|
-
} else {
|
|
156
|
-
var _buttons2;
|
|
157
|
-
(_buttons2 = buttons[currentIdx - 1]) == null || _buttons2.focus();
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
};
|
|
162
|
-
el.addEventListener('keydown', handleKeyDown);
|
|
163
|
-
return () => el.removeEventListener('keydown', handleKeyDown);
|
|
164
|
-
}, [focusCell, onCancel]);
|
|
72
|
+
const {
|
|
73
|
+
handleContainerFocus,
|
|
74
|
+
handleContainerBlur
|
|
75
|
+
} = (0, _hooks.useCellEditKeyboard)({
|
|
76
|
+
containerRef,
|
|
77
|
+
onCancel,
|
|
78
|
+
inputRef
|
|
79
|
+
});
|
|
165
80
|
if (loading) {
|
|
166
81
|
return /*#__PURE__*/_react.default.createElement(_designSystem.Box, {
|
|
167
82
|
dataHook: dataHook,
|
|
@@ -172,7 +87,7 @@ const CellImageEdit = ({
|
|
|
172
87
|
__self: void 0,
|
|
173
88
|
__source: {
|
|
174
89
|
fileName: _jsxFileName,
|
|
175
|
-
lineNumber:
|
|
90
|
+
lineNumber: 109,
|
|
176
91
|
columnNumber: 7
|
|
177
92
|
}
|
|
178
93
|
}, /*#__PURE__*/_react.default.createElement(_designSystem.Loader, {
|
|
@@ -180,7 +95,7 @@ const CellImageEdit = ({
|
|
|
180
95
|
__self: void 0,
|
|
181
96
|
__source: {
|
|
182
97
|
fileName: _jsxFileName,
|
|
183
|
-
lineNumber:
|
|
98
|
+
lineNumber: 116,
|
|
184
99
|
columnNumber: 9
|
|
185
100
|
}
|
|
186
101
|
}));
|
|
@@ -197,7 +112,7 @@ const CellImageEdit = ({
|
|
|
197
112
|
__self: void 0,
|
|
198
113
|
__source: {
|
|
199
114
|
fileName: _jsxFileName,
|
|
200
|
-
lineNumber:
|
|
115
|
+
lineNumber: 122,
|
|
201
116
|
columnNumber: 5
|
|
202
117
|
}
|
|
203
118
|
}, /*#__PURE__*/_react.default.createElement(_designSystem.Box, {
|
|
@@ -211,7 +126,7 @@ const CellImageEdit = ({
|
|
|
211
126
|
__self: void 0,
|
|
212
127
|
__source: {
|
|
213
128
|
fileName: _jsxFileName,
|
|
214
|
-
lineNumber:
|
|
129
|
+
lineNumber: 129,
|
|
215
130
|
columnNumber: 7
|
|
216
131
|
}
|
|
217
132
|
}, value ?
|
|
@@ -223,14 +138,14 @@ const CellImageEdit = ({
|
|
|
223
138
|
__self: void 0,
|
|
224
139
|
__source: {
|
|
225
140
|
fileName: _jsxFileName,
|
|
226
|
-
lineNumber:
|
|
141
|
+
lineNumber: 138,
|
|
227
142
|
columnNumber: 11
|
|
228
143
|
}
|
|
229
144
|
}, /*#__PURE__*/_react.default.createElement(_designSystem.Box, {
|
|
230
145
|
__self: void 0,
|
|
231
146
|
__source: {
|
|
232
147
|
fileName: _jsxFileName,
|
|
233
|
-
lineNumber:
|
|
148
|
+
lineNumber: 139,
|
|
234
149
|
columnNumber: 13
|
|
235
150
|
}
|
|
236
151
|
}, /*#__PURE__*/_react.default.createElement("button", {
|
|
@@ -248,7 +163,7 @@ const CellImageEdit = ({
|
|
|
248
163
|
__self: void 0,
|
|
249
164
|
__source: {
|
|
250
165
|
fileName: _jsxFileName,
|
|
251
|
-
lineNumber:
|
|
166
|
+
lineNumber: 140,
|
|
252
167
|
columnNumber: 15
|
|
253
168
|
}
|
|
254
169
|
}, /*#__PURE__*/_react.default.createElement(_imageThumbnail.ImageThumbnail, {
|
|
@@ -256,38 +171,17 @@ const CellImageEdit = ({
|
|
|
256
171
|
__self: void 0,
|
|
257
172
|
__source: {
|
|
258
173
|
fileName: _jsxFileName,
|
|
259
|
-
lineNumber:
|
|
174
|
+
lineNumber: 153,
|
|
260
175
|
columnNumber: 17
|
|
261
176
|
}
|
|
262
|
-
}), /*#__PURE__*/_react.default.createElement(
|
|
263
|
-
style: {
|
|
264
|
-
position: 'absolute',
|
|
265
|
-
inset: 0,
|
|
266
|
-
display: 'flex',
|
|
267
|
-
alignItems: 'center',
|
|
268
|
-
justifyContent: 'center',
|
|
269
|
-
background: 'rgba(0, 0, 0, 0.4)',
|
|
270
|
-
borderRadius: '3px'
|
|
271
|
-
},
|
|
177
|
+
}), /*#__PURE__*/_react.default.createElement(_thumbnailReplaceOverlay.ThumbnailReplaceOverlay, {
|
|
272
178
|
__self: void 0,
|
|
273
179
|
__source: {
|
|
274
180
|
fileName: _jsxFileName,
|
|
275
|
-
lineNumber:
|
|
181
|
+
lineNumber: 154,
|
|
276
182
|
columnNumber: 17
|
|
277
183
|
}
|
|
278
|
-
}
|
|
279
|
-
style: {
|
|
280
|
-
color: 'white',
|
|
281
|
-
width: '18px',
|
|
282
|
-
height: '18px'
|
|
283
|
-
},
|
|
284
|
-
__self: void 0,
|
|
285
|
-
__source: {
|
|
286
|
-
fileName: _jsxFileName,
|
|
287
|
-
lineNumber: 255,
|
|
288
|
-
columnNumber: 19
|
|
289
|
-
}
|
|
290
|
-
}))))) :
|
|
184
|
+
})))) :
|
|
291
185
|
/*#__PURE__*/
|
|
292
186
|
/* Empty: icon button opens media manager */
|
|
293
187
|
_react.default.createElement(_designSystem.Tooltip, {
|
|
@@ -296,7 +190,7 @@ const CellImageEdit = ({
|
|
|
296
190
|
__self: void 0,
|
|
297
191
|
__source: {
|
|
298
192
|
fileName: _jsxFileName,
|
|
299
|
-
lineNumber:
|
|
193
|
+
lineNumber: 160,
|
|
300
194
|
columnNumber: 11
|
|
301
195
|
}
|
|
302
196
|
}, /*#__PURE__*/_react.default.createElement(_designSystem.IconButton, {
|
|
@@ -307,14 +201,14 @@ const CellImageEdit = ({
|
|
|
307
201
|
__self: void 0,
|
|
308
202
|
__source: {
|
|
309
203
|
fileName: _jsxFileName,
|
|
310
|
-
lineNumber:
|
|
204
|
+
lineNumber: 161,
|
|
311
205
|
columnNumber: 13
|
|
312
206
|
}
|
|
313
207
|
}, /*#__PURE__*/_react.default.createElement(_wixUiIconsCommon.Add, {
|
|
314
208
|
__self: void 0,
|
|
315
209
|
__source: {
|
|
316
210
|
fileName: _jsxFileName,
|
|
317
|
-
lineNumber:
|
|
211
|
+
lineNumber: 167,
|
|
318
212
|
columnNumber: 15
|
|
319
213
|
}
|
|
320
214
|
}))), value ?
|
|
@@ -329,7 +223,7 @@ const CellImageEdit = ({
|
|
|
329
223
|
__self: void 0,
|
|
330
224
|
__source: {
|
|
331
225
|
fileName: _jsxFileName,
|
|
332
|
-
lineNumber:
|
|
226
|
+
lineNumber: 178,
|
|
333
227
|
columnNumber: 15
|
|
334
228
|
}
|
|
335
229
|
}, /*#__PURE__*/_react.default.createElement(_designSystem.IconButton, {
|
|
@@ -339,21 +233,21 @@ const CellImageEdit = ({
|
|
|
339
233
|
__self: void 0,
|
|
340
234
|
__source: {
|
|
341
235
|
fileName: _jsxFileName,
|
|
342
|
-
lineNumber:
|
|
236
|
+
lineNumber: 182,
|
|
343
237
|
columnNumber: 17
|
|
344
238
|
}
|
|
345
239
|
}, /*#__PURE__*/_react.default.createElement(_wixUiIconsCommon.MoreSmall, {
|
|
346
240
|
__self: void 0,
|
|
347
241
|
__source: {
|
|
348
242
|
fileName: _jsxFileName,
|
|
349
|
-
lineNumber:
|
|
243
|
+
lineNumber: 187,
|
|
350
244
|
columnNumber: 19
|
|
351
245
|
}
|
|
352
246
|
}))),
|
|
353
247
|
__self: void 0,
|
|
354
248
|
__source: {
|
|
355
249
|
fileName: _jsxFileName,
|
|
356
|
-
lineNumber:
|
|
250
|
+
lineNumber: 174,
|
|
357
251
|
columnNumber: 11
|
|
358
252
|
}
|
|
359
253
|
}, /*#__PURE__*/_react.default.createElement(_designSystem.PopoverMenu.MenuItem, {
|
|
@@ -363,7 +257,7 @@ const CellImageEdit = ({
|
|
|
363
257
|
__self: void 0,
|
|
364
258
|
__source: {
|
|
365
259
|
fileName: _jsxFileName,
|
|
366
|
-
lineNumber:
|
|
260
|
+
lineNumber: 195,
|
|
367
261
|
columnNumber: 27
|
|
368
262
|
}
|
|
369
263
|
}),
|
|
@@ -371,7 +265,7 @@ const CellImageEdit = ({
|
|
|
371
265
|
__self: void 0,
|
|
372
266
|
__source: {
|
|
373
267
|
fileName: _jsxFileName,
|
|
374
|
-
lineNumber:
|
|
268
|
+
lineNumber: 192,
|
|
375
269
|
columnNumber: 13
|
|
376
270
|
}
|
|
377
271
|
}), /*#__PURE__*/_react.default.createElement(_designSystem.PopoverMenu.MenuItem, {
|
|
@@ -381,7 +275,7 @@ const CellImageEdit = ({
|
|
|
381
275
|
__self: void 0,
|
|
382
276
|
__source: {
|
|
383
277
|
fileName: _jsxFileName,
|
|
384
|
-
lineNumber:
|
|
278
|
+
lineNumber: 201,
|
|
385
279
|
columnNumber: 27
|
|
386
280
|
}
|
|
387
281
|
}),
|
|
@@ -392,14 +286,14 @@ const CellImageEdit = ({
|
|
|
392
286
|
__self: void 0,
|
|
393
287
|
__source: {
|
|
394
288
|
fileName: _jsxFileName,
|
|
395
|
-
lineNumber:
|
|
289
|
+
lineNumber: 198,
|
|
396
290
|
columnNumber: 13
|
|
397
291
|
}
|
|
398
292
|
}), /*#__PURE__*/_react.default.createElement(_designSystem.PopoverMenu.Divider, {
|
|
399
293
|
__self: void 0,
|
|
400
294
|
__source: {
|
|
401
295
|
fileName: _jsxFileName,
|
|
402
|
-
lineNumber:
|
|
296
|
+
lineNumber: 207,
|
|
403
297
|
columnNumber: 13
|
|
404
298
|
}
|
|
405
299
|
}), /*#__PURE__*/_react.default.createElement(_designSystem.PopoverMenu.MenuItem, {
|
|
@@ -410,7 +304,7 @@ const CellImageEdit = ({
|
|
|
410
304
|
__self: void 0,
|
|
411
305
|
__source: {
|
|
412
306
|
fileName: _jsxFileName,
|
|
413
|
-
lineNumber:
|
|
307
|
+
lineNumber: 212,
|
|
414
308
|
columnNumber: 27
|
|
415
309
|
}
|
|
416
310
|
}),
|
|
@@ -418,7 +312,7 @@ const CellImageEdit = ({
|
|
|
418
312
|
__self: void 0,
|
|
419
313
|
__source: {
|
|
420
314
|
fileName: _jsxFileName,
|
|
421
|
-
lineNumber:
|
|
315
|
+
lineNumber: 208,
|
|
422
316
|
columnNumber: 13
|
|
423
317
|
}
|
|
424
318
|
})) :
|
|
@@ -430,7 +324,7 @@ const CellImageEdit = ({
|
|
|
430
324
|
__self: void 0,
|
|
431
325
|
__source: {
|
|
432
326
|
fileName: _jsxFileName,
|
|
433
|
-
lineNumber:
|
|
327
|
+
lineNumber: 218,
|
|
434
328
|
columnNumber: 11
|
|
435
329
|
}
|
|
436
330
|
}, /*#__PURE__*/_react.default.createElement(_designSystem.IconButton, {
|
|
@@ -444,14 +338,14 @@ const CellImageEdit = ({
|
|
|
444
338
|
__self: void 0,
|
|
445
339
|
__source: {
|
|
446
340
|
fileName: _jsxFileName,
|
|
447
|
-
lineNumber:
|
|
341
|
+
lineNumber: 222,
|
|
448
342
|
columnNumber: 13
|
|
449
343
|
}
|
|
450
344
|
}, /*#__PURE__*/_react.default.createElement(_wixUiIconsCommon.LinkSmall, {
|
|
451
345
|
__self: void 0,
|
|
452
346
|
__source: {
|
|
453
347
|
fileName: _jsxFileName,
|
|
454
|
-
lineNumber:
|
|
348
|
+
lineNumber: 231,
|
|
455
349
|
columnNumber: 15
|
|
456
350
|
}
|
|
457
351
|
})))), /*#__PURE__*/_react.default.createElement(_mediaControl.PasteURLForm, {
|
|
@@ -464,7 +358,7 @@ const CellImageEdit = ({
|
|
|
464
358
|
__self: void 0,
|
|
465
359
|
__source: {
|
|
466
360
|
fileName: _jsxFileName,
|
|
467
|
-
lineNumber:
|
|
361
|
+
lineNumber: 237,
|
|
468
362
|
columnNumber: 7
|
|
469
363
|
}
|
|
470
364
|
}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","_designSystem","_wixUiIconsCommon","_mediaUtils","_hooks","_mediaControl","_imageThumbnail","_jsxFileName","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","CellImageEdit","value","onChange","onCommit","onCancel","onStartEdit","inputRef","dataHook","useTranslations","containerRef","useRef","mediaCommittedRef","onMediaChange","useCallback","uri","current","callMedia","loading","useMediaControl","mediaType","MEDIA_TYPES","IMAGE","undefined","handleCallMedia","pasteUrlTitle","isOpen","title","onOpen","onClose","onSave","usePasteURLForm","handleFormClose","handleOpenPasteUrl","params","handleDelete","useEffect","focus","_containerRef$current","first","querySelectorAll","handleContainerFocus","_containerRef$current2","setAttribute","handleContainerBlur","currentTarget","contains","relatedTarget","_containerRef$current3","removeAttribute","focusCell","_containerRef$current4","cellDiv","closest","preventScroll","el","handleKeyDown","key","preventDefault","stopPropagation","buttons","Array","from","currentIdx","indexOf","document","activeElement","shiftKey","length","_buttons","_buttons2","addEventListener","removeEventListener","createElement","Box","verticalAlign","width","height","padding","__self","__source","fileName","lineNumber","columnNumber","Loader","size","ref","style","onFocus","onBlur","align","boxSizing","Tooltip","content","appendTo","type","onClick","cursor","lineHeight","position","background","border","ImageThumbnail","inset","display","alignItems","justifyContent","borderRadius","Replace","color","IconButton","priority","Add","PopoverMenu","textSize","triggerElement","MoreSmall","MenuItem","text","prefixIcon","Link","Divider","skin","Delete","LinkSmall","PasteURLForm","show","closeModal","fieldType","MediaFieldType","image","exports","displayName"],"sources":["../../../../src/components/image/cell-image-edit.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useRef } from 'react';\nimport {\n Box,\n IconButton,\n Loader,\n PopoverMenu,\n Tooltip,\n} from '@wix/design-system';\nimport {\n Add,\n LinkSmall,\n MoreSmall,\n Replace,\n Link,\n Delete,\n} from '@wix/wix-ui-icons-common';\nimport { MEDIA_TYPES } from '../../utils/media-utils';\nimport { useTranslations } from '../../hooks';\nimport {\n useMediaControl,\n usePasteURLForm,\n PasteURLForm,\n MediaFieldType,\n} from '../media-control';\nimport { ImageThumbnail } from './image-thumbnail';\n\nexport interface CellImageEditProps {\n value: string | null | undefined;\n onChange: (value: string | null) => void;\n onCommit: () => void;\n onCancel?: () => void;\n /**\n * Called before opening external UI (media manager / paste-URL form) so the\n * table can set isEditing=true and protect cell focus while the modal is open.\n */\n onStartEdit?: () => void;\n inputRef?: React.MutableRefObject<{ focus: () => void } | null | undefined>;\n dataHook?: string;\n}\n\nexport const CellImageEdit: React.FC<CellImageEditProps> = ({\n value,\n onChange,\n onCommit,\n onCancel,\n onStartEdit,\n inputRef,\n dataHook,\n}) => {\n const { t } = useTranslations();\n const containerRef = useRef<HTMLDivElement | null>(null);\n // Tracks whether onMediaChange fired during the current callMedia() invocation.\n // Reset to false before each call; checked after the promise resolves to detect\n // \"dismissed without selection\" so the in-progress edit can be cancelled.\n const mediaCommittedRef = useRef(false);\n\n const onMediaChange = useCallback(\n (uri: string) => {\n mediaCommittedRef.current = true;\n onChange(uri);\n onCommit();\n },\n [onChange, onCommit],\n );\n\n const { callMedia, loading } = useMediaControl({\n mediaType: MEDIA_TYPES.IMAGE,\n value: value ?? undefined,\n onChange: onMediaChange,\n });\n\n const handleCallMedia = useCallback(async () => {\n onStartEdit?.();\n mediaCommittedRef.current = false;\n await callMedia();\n // If the picker was dismissed without a selection, neither onCommit nor\n // onCancel ran — call onCancel now so isEditing resets to false and\n // useClearFocusOnBlur is unblocked.\n if (!mediaCommittedRef.current) {\n onCancel?.();\n }\n }, [onStartEdit, callMedia, onCancel]);\n\n const pasteUrlTitle = t('CMS.image.replaceWithUrl.title');\n const { isOpen, title, onOpen, onClose, onSave } = usePasteURLForm({\n onChange: onMediaChange,\n });\n\n // When the paste-URL form is dismissed without saving, cancel the in-progress\n // edit so isEditing returns to false and useClearFocusOnBlur works normally.\n const handleFormClose = useCallback(() => {\n onClose();\n onCancel?.();\n }, [onClose, onCancel]);\n\n const handleOpenPasteUrl = useCallback(\n (params: { title: string; value?: string }) => () => {\n onStartEdit?.();\n onOpen(params)();\n },\n [onStartEdit, onOpen],\n );\n\n const handleDelete = useCallback(() => {\n onChange(null);\n onCommit();\n }, [onChange, onCommit]);\n\n // Wire inputRef so the cell-level useEffect can focus the first button when\n // the user presses Enter on a focused image cell (inner focus activation).\n useEffect(() => {\n if (!inputRef) return;\n inputRef.current = {\n focus: () => {\n const first =\n containerRef.current?.querySelectorAll<HTMLElement>('button')[0];\n first?.focus();\n },\n };\n return () => {\n inputRef.current = null;\n };\n }, [inputRef]);\n\n const handleContainerFocus = useCallback(() => {\n containerRef.current?.setAttribute('data-inner-focused', '');\n }, []);\n\n const handleContainerBlur = useCallback((e: React.FocusEvent) => {\n if (!e.currentTarget.contains(e.relatedTarget as Node | null)) {\n containerRef.current?.removeAttribute('data-inner-focused');\n }\n }, []);\n\n const focusCell = useCallback(() => {\n const cellDiv = containerRef.current?.closest(\n '[role=\"gridcell\"]',\n ) as HTMLElement | null;\n cellDiv?.focus({ preventScroll: true });\n }, []);\n\n // Native keydown listener — must be native (not React onKeyDown) so that\n // e.stopPropagation() fires during the native bubble phase, before the event\n // reaches the React root where useKeyboardNavigation's onKeyDown would\n // otherwise intercept Tab and move to the next cell.\n useEffect(() => {\n const el = containerRef.current;\n if (!el) return;\n\n const handleKeyDown = (e: KeyboardEvent) => {\n if (e.key === 'Escape') {\n e.preventDefault();\n e.stopPropagation();\n // Cancel any in-progress edit (e.g. if isEditing was set before opening\n // a modal that then got dismissed via keyboard), then return focus to the\n // cell div. The useCellFocusAndEditing useEffect will also refocus the\n // cell div if isEditing transitions false→false is a no-op, so we also\n // call focusCell() directly as a reliable fallback.\n onCancel?.();\n focusCell();\n return;\n }\n\n // Tab while a button in this component is focused: cycle through the\n // interactive elements. Tab off the last (or Shift+Tab off the first)\n // returns focus to the cell div for normal cell-level navigation.\n if (e.key === 'Tab') {\n const buttons = Array.from(el.querySelectorAll<HTMLElement>('button'));\n const currentIdx = buttons.indexOf(\n document.activeElement as HTMLElement,\n );\n if (currentIdx === -1) return; // focus is not on one of our buttons — pass through\n\n e.preventDefault();\n e.stopPropagation();\n\n if (!e.shiftKey) {\n if (currentIdx >= buttons.length - 1) {\n focusCell();\n } else {\n buttons[currentIdx + 1]?.focus();\n }\n } else {\n if (currentIdx <= 0) {\n focusCell();\n } else {\n buttons[currentIdx - 1]?.focus();\n }\n }\n }\n };\n\n el.addEventListener('keydown', handleKeyDown);\n return () => el.removeEventListener('keydown', handleKeyDown);\n }, [focusCell, onCancel]);\n\n if (loading) {\n return (\n <Box\n dataHook={dataHook}\n verticalAlign=\"middle\"\n width=\"100%\"\n height=\"100%\"\n padding=\"0 8px\"\n >\n <Loader size=\"tiny\" />\n </Box>\n );\n }\n\n return (\n <div\n ref={containerRef}\n data-hook={dataHook}\n style={{ width: '100%', height: '100%' }}\n onFocus={handleContainerFocus}\n onBlur={handleContainerBlur}\n >\n <Box\n align=\"space-between\"\n verticalAlign=\"middle\"\n height=\"100%\"\n padding=\"0 8px\"\n style={{ boxSizing: 'border-box' }}\n >\n {value ? (\n /* Has value: clickable thumbnail button with replace overlay */\n <Tooltip content={t('CMS.image.replace')} appendTo=\"window\">\n <Box>\n <button\n type=\"button\"\n data-hook=\"image-edit-thumbnail\"\n onClick={handleCallMedia}\n style={{\n cursor: 'pointer',\n lineHeight: 0,\n position: 'relative',\n background: 'none',\n border: 'none',\n padding: 0,\n }}\n >\n <ImageThumbnail value={value} />\n <div\n style={{\n position: 'absolute',\n inset: 0,\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n background: 'rgba(0, 0, 0, 0.4)',\n borderRadius: '3px',\n }}\n >\n <Replace\n style={{ color: 'white', width: '18px', height: '18px' }}\n />\n </div>\n </button>\n </Box>\n </Tooltip>\n ) : (\n /* Empty: icon button opens media manager */\n <Tooltip content={t('CMS.image.add')} appendTo=\"window\">\n <IconButton\n size=\"tiny\"\n priority=\"secondary\"\n dataHook=\"image-edit-add-button\"\n onClick={handleCallMedia}\n >\n <Add />\n </IconButton>\n </Tooltip>\n )}\n\n {value ? (\n /* Has value: \"...\" menu with Replace / Replace with URL / Delete */\n <PopoverMenu\n textSize=\"small\"\n appendTo=\"window\"\n triggerElement={\n <Tooltip\n content={t('auto-patterns.fields.more_actions_tooltip')}\n appendTo=\"window\"\n >\n <IconButton\n size=\"tiny\"\n priority=\"tertiary\"\n dataHook=\"image-edit-more-button\"\n >\n <MoreSmall />\n </IconButton>\n </Tooltip>\n }\n >\n <PopoverMenu.MenuItem\n dataHook=\"image-edit-action-replace\"\n text={t('CMS.image.replace')}\n prefixIcon={<Replace />}\n onClick={handleCallMedia}\n />\n <PopoverMenu.MenuItem\n dataHook=\"image-edit-action-replace-url\"\n text={t('CMS.image.replaceWithUrl.button')}\n prefixIcon={<Link />}\n onClick={handleOpenPasteUrl({\n title: pasteUrlTitle,\n value: value ?? undefined,\n })}\n />\n <PopoverMenu.Divider />\n <PopoverMenu.MenuItem\n dataHook=\"image-edit-action-delete\"\n text={t('CMS.image.clear')}\n skin=\"destructive\"\n prefixIcon={<Delete />}\n onClick={handleDelete}\n />\n </PopoverMenu>\n ) : (\n /* Empty: icon button opens paste-URL form */\n <Tooltip\n content={t('CMS.image.replaceWithUrl.button')}\n appendTo=\"window\"\n >\n <IconButton\n size=\"tiny\"\n priority=\"tertiary\"\n dataHook=\"image-edit-paste-url-button\"\n onClick={handleOpenPasteUrl({\n title: pasteUrlTitle,\n value: value ?? undefined,\n })}\n >\n <LinkSmall />\n </IconButton>\n </Tooltip>\n )}\n </Box>\n\n <PasteURLForm\n title={title}\n value={value ?? undefined}\n show={isOpen}\n closeModal={handleFormClose}\n onSave={onSave}\n fieldType={MediaFieldType.image}\n />\n </div>\n );\n};\n\nCellImageEdit.displayName = 'CellImageEdit';\n"],"mappings":";;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;AAOA,IAAAE,iBAAA,GAAAF,OAAA;AAQA,IAAAG,WAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,aAAA,GAAAL,OAAA;AAMA,IAAAM,eAAA,GAAAN,OAAA;AAAmD,IAAAO,YAAA;AAAA,SAAAR,wBAAAS,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAX,uBAAA,YAAAA,C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QAAA;MAAAC,QAAA,EAAApG,YAAA;MAAAqG,UAAA;MAAAC,YAAA;IAAA;EAAA,gBAEH/G,MAAA,CAAAoB,OAAA,CAAAiF,aAAA,CAACjG,iBAAA,CAAAoJ,SAAS;IAAA7C,MAAA;IAAAC,QAAA;MAAAC,QAAA,EAAApG,YAAA;MAAAqG,UAAA;MAAAC,YAAA;IAAA;EAAA,CAAE,CACF,CACL,CAER,CAAC,eAEN/G,MAAA,CAAAoB,OAAA,CAAAiF,aAAA,CAAC9F,aAAA,CAAAkJ,YAAY;IACXlG,KAAK,EAAEA,KAAM;IACbzB,KAAK,EAAEA,KAAK,IAAIqB,SAAU;IAC1BuG,IAAI,EAAEpG,MAAO;IACbqG,UAAU,EAAE/F,eAAgB;IAC5BF,MAAM,EAAEA,MAAO;IACfkG,SAAS,EAAEC,4BAAc,CAACC,KAAM;IAAAnD,MAAA;IAAAC,QAAA;MAAAC,QAAA,EAAApG,YAAA;MAAAqG,UAAA;MAAAC,YAAA;IAAA;EAAA,CACjC,CACE,CAAC;AAEV,CAAC;AAACgD,OAAA,CAAAlI,aAAA,GAAAA,aAAA;AAEFA,aAAa,CAACmI,WAAW,GAAG,eAAe","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_designSystem","_wixUiIconsCommon","_mediaUtils","_hooks","_mediaControl","_imageThumbnail","_thumbnailReplaceOverlay","_jsxFileName","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","CellImageEdit","value","onChange","onCommit","onCancel","onStartEdit","inputRef","dataHook","useTranslations","containerRef","useRef","onMediaChange","useCallback","uri","callMedia","loading","useMediaControl","mediaType","MEDIA_TYPES","IMAGE","undefined","handleCallMedia","committed","pasteUrlTitle","isOpen","title","onOpen","onClose","onSave","usePasteURLForm","handleFormClose","handleOpenPasteUrl","params","handleDelete","handleContainerFocus","handleContainerBlur","useCellEditKeyboard","createElement","Box","verticalAlign","width","height","padding","__self","__source","fileName","lineNumber","columnNumber","Loader","size","ref","style","onFocus","onBlur","align","boxSizing","Tooltip","content","appendTo","type","onClick","cursor","lineHeight","position","background","border","ImageThumbnail","ThumbnailReplaceOverlay","IconButton","priority","Add","PopoverMenu","textSize","triggerElement","MoreSmall","MenuItem","text","prefixIcon","Replace","Link","Divider","skin","Delete","LinkSmall","PasteURLForm","show","closeModal","fieldType","MediaFieldType","image","exports","displayName"],"sources":["../../../../src/components/image/cell-image-edit.tsx"],"sourcesContent":["import React, { useCallback, useRef } from 'react';\nimport {\n Box,\n IconButton,\n Loader,\n PopoverMenu,\n Tooltip,\n} from '@wix/design-system';\nimport {\n Add,\n LinkSmall,\n MoreSmall,\n Replace,\n Link,\n Delete,\n} from '@wix/wix-ui-icons-common';\nimport { MEDIA_TYPES } from '../../utils/media-utils';\nimport { useTranslations, useCellEditKeyboard } from '../../hooks';\nimport {\n useMediaControl,\n usePasteURLForm,\n PasteURLForm,\n MediaFieldType,\n} from '../media-control';\nimport { ImageThumbnail } from './image-thumbnail';\nimport { ThumbnailReplaceOverlay } from './thumbnail-replace-overlay';\n\nexport interface CellImageEditProps {\n value: string | null | undefined;\n onChange: (value: string | null) => void;\n onCommit: () => void;\n onCancel?: () => void;\n /**\n * Called before opening external UI (media manager / paste-URL form) so the\n * table can set isEditing=true and protect cell focus while the modal is open.\n */\n onStartEdit?: () => void;\n inputRef?: React.MutableRefObject<{ focus: () => void } | null | undefined>;\n dataHook?: string;\n}\n\nexport const CellImageEdit: React.FC<CellImageEditProps> = ({\n value,\n onChange,\n onCommit,\n onCancel,\n onStartEdit,\n inputRef,\n dataHook,\n}) => {\n const { t } = useTranslations();\n const containerRef = useRef<HTMLDivElement | null>(null);\n\n const onMediaChange = useCallback(\n (uri: string) => {\n onChange(uri);\n onCommit();\n },\n [onChange, onCommit],\n );\n\n const { callMedia, loading } = useMediaControl({\n mediaType: MEDIA_TYPES.IMAGE,\n value: value ?? undefined,\n onChange: onMediaChange,\n });\n\n const handleCallMedia = useCallback(async () => {\n onStartEdit?.();\n const committed = await callMedia();\n if (!committed) {\n onCancel?.();\n }\n }, [onStartEdit, callMedia, onCancel]);\n\n const pasteUrlTitle = t('CMS.image.replaceWithUrl.title');\n const { isOpen, title, onOpen, onClose, onSave } = usePasteURLForm({\n onChange: onMediaChange,\n });\n\n // When the paste-URL form is dismissed without saving, cancel the in-progress\n // edit so isEditing returns to false and useClearFocusOnBlur works normally.\n const handleFormClose = useCallback(() => {\n onClose();\n onCancel?.();\n }, [onClose, onCancel]);\n\n const handleOpenPasteUrl = useCallback(\n (params: { title: string; value?: string }) => () => {\n onStartEdit?.();\n onOpen(params)();\n },\n [onStartEdit, onOpen],\n );\n\n const handleDelete = useCallback(() => {\n onChange(null);\n onCommit();\n }, [onChange, onCommit]);\n\n const { handleContainerFocus, handleContainerBlur } = useCellEditKeyboard({\n containerRef,\n onCancel,\n inputRef,\n });\n\n if (loading) {\n return (\n <Box\n dataHook={dataHook}\n verticalAlign=\"middle\"\n width=\"100%\"\n height=\"100%\"\n padding=\"0 8px\"\n >\n <Loader size=\"tiny\" />\n </Box>\n );\n }\n\n return (\n <div\n ref={containerRef}\n data-hook={dataHook}\n style={{ width: '100%', height: '100%' }}\n onFocus={handleContainerFocus}\n onBlur={handleContainerBlur}\n >\n <Box\n align=\"space-between\"\n verticalAlign=\"middle\"\n height=\"100%\"\n padding=\"0 8px\"\n style={{ boxSizing: 'border-box' }}\n >\n {value ? (\n /* Has value: clickable thumbnail button with replace overlay */\n <Tooltip content={t('CMS.image.replace')} appendTo=\"window\">\n <Box>\n <button\n type=\"button\"\n data-hook=\"image-edit-thumbnail\"\n onClick={handleCallMedia}\n style={{\n cursor: 'pointer',\n lineHeight: 0,\n position: 'relative',\n background: 'none',\n border: 'none',\n padding: 0,\n }}\n >\n <ImageThumbnail value={value} />\n <ThumbnailReplaceOverlay />\n </button>\n </Box>\n </Tooltip>\n ) : (\n /* Empty: icon button opens media manager */\n <Tooltip content={t('CMS.image.add')} appendTo=\"window\">\n <IconButton\n size=\"tiny\"\n priority=\"secondary\"\n dataHook=\"image-edit-add-button\"\n onClick={handleCallMedia}\n >\n <Add />\n </IconButton>\n </Tooltip>\n )}\n\n {value ? (\n /* Has value: \"...\" menu with Replace / Replace with URL / Delete */\n <PopoverMenu\n textSize=\"small\"\n appendTo=\"window\"\n triggerElement={\n <Tooltip\n content={t('auto-patterns.fields.more_actions_tooltip')}\n appendTo=\"window\"\n >\n <IconButton\n size=\"tiny\"\n priority=\"tertiary\"\n dataHook=\"image-edit-more-button\"\n >\n <MoreSmall />\n </IconButton>\n </Tooltip>\n }\n >\n <PopoverMenu.MenuItem\n dataHook=\"image-edit-action-replace\"\n text={t('CMS.image.replace')}\n prefixIcon={<Replace />}\n onClick={handleCallMedia}\n />\n <PopoverMenu.MenuItem\n dataHook=\"image-edit-action-replace-url\"\n text={t('CMS.image.replaceWithUrl.button')}\n prefixIcon={<Link />}\n onClick={handleOpenPasteUrl({\n title: pasteUrlTitle,\n value: value ?? undefined,\n })}\n />\n <PopoverMenu.Divider />\n <PopoverMenu.MenuItem\n dataHook=\"image-edit-action-delete\"\n text={t('CMS.image.clear')}\n skin=\"destructive\"\n prefixIcon={<Delete />}\n onClick={handleDelete}\n />\n </PopoverMenu>\n ) : (\n /* Empty: icon button opens paste-URL form */\n <Tooltip\n content={t('CMS.image.replaceWithUrl.button')}\n appendTo=\"window\"\n >\n <IconButton\n size=\"tiny\"\n priority=\"tertiary\"\n dataHook=\"image-edit-paste-url-button\"\n onClick={handleOpenPasteUrl({\n title: pasteUrlTitle,\n value: value ?? undefined,\n })}\n >\n <LinkSmall />\n </IconButton>\n </Tooltip>\n )}\n </Box>\n\n <PasteURLForm\n title={title}\n value={value ?? undefined}\n show={isOpen}\n closeModal={handleFormClose}\n onSave={onSave}\n fieldType={MediaFieldType.image}\n />\n </div>\n );\n};\n\nCellImageEdit.displayName = 'CellImageEdit';\n"],"mappings":";;;;AAAA,IAAAA,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B,SAAU;IAC1BiE,IAAI,EAAE7D,MAAO;IACb8D,UAAU,EAAExD,eAAgB;IAC5BF,MAAM,EAAEA,MAAO;IACf2D,SAAS,EAAEC,4BAAc,CAACC,KAAM;IAAA9C,MAAA;IAAAC,QAAA;MAAAC,QAAA,EAAAjE,YAAA;MAAAkE,UAAA;MAAAC,YAAA;IAAA;EAAA,CACjC,CACE,CAAC;AAEV,CAAC;AAAC2C,OAAA,CAAA1F,aAAA,GAAAA,aAAA;AAEFA,aAAa,CAAC2F,WAAW,GAAG,eAAe","ignoreList":[]}
|
|
@@ -14,7 +14,8 @@ const ImageThumbnail = ({
|
|
|
14
14
|
onError,
|
|
15
15
|
onMouseEnter,
|
|
16
16
|
onMouseLeave,
|
|
17
|
-
dataHook
|
|
17
|
+
dataHook,
|
|
18
|
+
showVideoIndicator = true
|
|
18
19
|
}) => {
|
|
19
20
|
const src = value ? (0, _autoFieldTypes.mediaURItoImageURL)(value, _autoFieldTypes.ThumbnailSize.S) : undefined;
|
|
20
21
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -30,7 +31,7 @@ const ImageThumbnail = ({
|
|
|
30
31
|
__self: void 0,
|
|
31
32
|
__source: {
|
|
32
33
|
fileName: _jsxFileName,
|
|
33
|
-
lineNumber:
|
|
34
|
+
lineNumber: 35,
|
|
34
35
|
columnNumber: 5
|
|
35
36
|
}
|
|
36
37
|
}, /*#__PURE__*/_react.default.createElement(_mediaImage.MediaImage, {
|
|
@@ -46,13 +47,13 @@ const ImageThumbnail = ({
|
|
|
46
47
|
onError: onError,
|
|
47
48
|
onMouseEnter: onMouseEnter,
|
|
48
49
|
onMouseLeave: onMouseLeave,
|
|
49
|
-
overlay: value && (0, _autoFieldTypes.isMediaVideoURI)(value) ? /*#__PURE__*/_react.default.createElement(_overlays.VideoIndicatorOverlay, {
|
|
50
|
+
overlay: value && showVideoIndicator && (0, _autoFieldTypes.isMediaVideoURI)(value) ? /*#__PURE__*/_react.default.createElement(_overlays.VideoIndicatorOverlay, {
|
|
50
51
|
src: value,
|
|
51
52
|
size: "small",
|
|
52
53
|
__self: void 0,
|
|
53
54
|
__source: {
|
|
54
55
|
fileName: _jsxFileName,
|
|
55
|
-
lineNumber:
|
|
56
|
+
lineNumber: 61,
|
|
56
57
|
columnNumber: 13
|
|
57
58
|
}
|
|
58
59
|
}) : /*#__PURE__*/_react.default.createElement(_overlays.CustomUrlOverlay, {
|
|
@@ -61,14 +62,14 @@ const ImageThumbnail = ({
|
|
|
61
62
|
__self: void 0,
|
|
62
63
|
__source: {
|
|
63
64
|
fileName: _jsxFileName,
|
|
64
|
-
lineNumber:
|
|
65
|
+
lineNumber: 63,
|
|
65
66
|
columnNumber: 13
|
|
66
67
|
}
|
|
67
68
|
}),
|
|
68
69
|
__self: void 0,
|
|
69
70
|
__source: {
|
|
70
71
|
fileName: _jsxFileName,
|
|
71
|
-
lineNumber:
|
|
72
|
+
lineNumber: 46,
|
|
72
73
|
columnNumber: 7
|
|
73
74
|
}
|
|
74
75
|
}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireDefault","require","_autoFieldTypes","_mediaImage","_overlays","_jsxFileName","ImageThumbnail","value","onLoad","onError","onMouseEnter","onMouseLeave","dataHook","src","mediaURItoImageURL","ThumbnailSize","S","undefined","default","createElement","style","width","height","borderRadius","flexShrink","position","__self","__source","fileName","lineNumber","columnNumber","MediaImage","alt","suspended","transparent","size","overlay","isMediaVideoURI","VideoIndicatorOverlay","CustomUrlOverlay","exports","displayName"],"sources":["../../../../src/components/image/image-thumbnail.tsx"],"sourcesContent":["import React from 'react';\nimport {\n isMediaVideoURI,\n mediaURItoImageURL,\n ThumbnailSize,\n} from '../../auto-field-types';\nimport { MediaImage } from '../media-image';\nimport {\n CustomUrlOverlay,\n VideoIndicatorOverlay,\n} from '../media-image/overlays';\n\nexport interface ImageThumbnailProps {\n value?: string | null;\n onLoad?: () => void;\n onError?: () => void;\n onMouseEnter?: () => void;\n onMouseLeave?: () => void;\n dataHook?: string;\n}\n\nexport const ImageThumbnail: React.FC<ImageThumbnailProps> = ({\n value,\n onLoad,\n onError,\n onMouseEnter,\n onMouseLeave,\n dataHook,\n}) => {\n const src = value ? mediaURItoImageURL(value, ThumbnailSize.S) : undefined;\n\n return (\n <div\n data-hook={dataHook}\n data-empty={!value || undefined}\n style={{
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_autoFieldTypes","_mediaImage","_overlays","_jsxFileName","ImageThumbnail","value","onLoad","onError","onMouseEnter","onMouseLeave","dataHook","showVideoIndicator","src","mediaURItoImageURL","ThumbnailSize","S","undefined","default","createElement","style","width","height","borderRadius","flexShrink","position","__self","__source","fileName","lineNumber","columnNumber","MediaImage","alt","suspended","transparent","size","overlay","isMediaVideoURI","VideoIndicatorOverlay","CustomUrlOverlay","exports","displayName"],"sources":["../../../../src/components/image/image-thumbnail.tsx"],"sourcesContent":["import React from 'react';\nimport {\n isMediaVideoURI,\n mediaURItoImageURL,\n ThumbnailSize,\n} from '../../auto-field-types';\nimport { MediaImage } from '../media-image';\nimport {\n CustomUrlOverlay,\n VideoIndicatorOverlay,\n} from '../media-image/overlays';\n\nexport interface ImageThumbnailProps {\n value?: string | null;\n onLoad?: () => void;\n onError?: () => void;\n onMouseEnter?: () => void;\n onMouseLeave?: () => void;\n dataHook?: string;\n showVideoIndicator?: boolean;\n}\n\nexport const ImageThumbnail: React.FC<ImageThumbnailProps> = ({\n value,\n onLoad,\n onError,\n onMouseEnter,\n onMouseLeave,\n dataHook,\n showVideoIndicator = true,\n}) => {\n const src = value ? mediaURItoImageURL(value, ThumbnailSize.S) : undefined;\n\n return (\n <div\n data-hook={dataHook}\n data-empty={!value || undefined}\n style={{\n width: '36px',\n height: '36px',\n borderRadius: '3px',\n flexShrink: 0,\n position: 'relative',\n }}\n >\n <MediaImage\n src={src}\n alt=\"\"\n suspended\n borderRadius=\"3px\"\n transparent\n size={ThumbnailSize.S}\n width=\"36px\"\n height=\"36px\"\n onLoad={onLoad}\n onError={onError}\n onMouseEnter={onMouseEnter}\n onMouseLeave={onMouseLeave}\n overlay={\n value && showVideoIndicator && isMediaVideoURI(value) ? (\n <VideoIndicatorOverlay src={value} size=\"small\" />\n ) : (\n <CustomUrlOverlay src={value} size=\"small\" />\n )\n }\n />\n </div>\n );\n};\n\nImageThumbnail.displayName = 'ImageThumbnail';\n"],"mappings":";;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,eAAA,GAAAD,OAAA;AAKA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AAGiC,IAAAI,YAAA;AAY1B,MAAMC,cAA6C,GAAGA,CAAC;EAC5DC,KAAK;EACLC,MAAM;EACNC,OAAO;EACPC,YAAY;EACZC,YAAY;EACZC,QAAQ;EACRC,kBAAkB,GAAG;AACvB,CAAC,KAAK;EACJ,MAAMC,GAAG,GAAGP,KAAK,GAAG,IAAAQ,kCAAkB,EAACR,KAAK,EAAES,6BAAa,CAACC,CAAC,CAAC,GAAGC,SAAS;EAE1E,oBACEnB,MAAA,CAAAoB,OAAA,CAAAC,aAAA;IACE,aAAWR,QAAS;IACpB,cAAY,CAACL,KAAK,IAAIW,SAAU;IAChCG,KAAK,EAAE;MACLC,KAAK,EAAE,MAAM;MACbC,MAAM,EAAE,MAAM;MACdC,YAAY,EAAE,KAAK;MACnBC,UAAU,EAAE,CAAC;MACbC,QAAQ,EAAE;IACZ,CAAE;IAAAC,MAAA;IAAAC,QAAA;MAAAC,QAAA,EAAAxB,YAAA;MAAAyB,UAAA;MAAAC,YAAA;IAAA;EAAA,gBAEFhC,MAAA,CAAAoB,OAAA,CAAAC,aAAA,CAACjB,WAAA,CAAA6B,UAAU;IACTlB,GAAG,EAAEA,GAAI;IACTmB,GAAG,EAAC,EAAE;IACNC,SAAS;IACTV,YAAY,EAAC,KAAK;IAClBW,WAAW;IACXC,IAAI,EAAEpB,6BAAa,CAACC,CAAE;IACtBK,KAAK,EAAC,MAAM;IACZC,MAAM,EAAC,MAAM;IACbf,MAAM,EAAEA,MAAO;IACfC,OAAO,EAAEA,OAAQ;IACjBC,YAAY,EAAEA,YAAa;IAC3BC,YAAY,EAAEA,YAAa;IAC3B0B,OAAO,EACL9B,KAAK,IAAIM,kBAAkB,IAAI,IAAAyB,+BAAe,EAAC/B,KAAK,CAAC,gBACnDR,MAAA,CAAAoB,OAAA,CAAAC,aAAA,CAAChB,SAAA,CAAAmC,qBAAqB;MAACzB,GAAG,EAAEP,KAAM;MAAC6B,IAAI,EAAC,OAAO;MAAAT,MAAA;MAAAC,QAAA;QAAAC,QAAA,EAAAxB,YAAA;QAAAyB,UAAA;QAAAC,YAAA;MAAA;IAAA,CAAE,CAAC,gBAElDhC,MAAA,CAAAoB,OAAA,CAAAC,aAAA,CAAChB,SAAA,CAAAoC,gBAAgB;MAAC1B,GAAG,EAAEP,KAAM;MAAC6B,IAAI,EAAC,OAAO;MAAAT,MAAA;MAAAC,QAAA;QAAAC,QAAA,EAAAxB,YAAA;QAAAyB,UAAA;QAAAC,YAAA;MAAA;IAAA,CAAE,CAE/C;IAAAJ,MAAA;IAAAC,QAAA;MAAAC,QAAA,EAAAxB,YAAA;MAAAyB,UAAA;MAAAC,YAAA;IAAA;EAAA,CACF,CACE,CAAC;AAEV,CAAC;AAACU,OAAA,CAAAnC,cAAA,GAAAA,cAAA;AAEFA,cAAc,CAACoC,WAAW,GAAG,gBAAgB","ignoreList":[]}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
exports.__esModule = true;
|
|
5
|
+
exports.ThumbnailReplaceOverlay = void 0;
|
|
6
|
+
var _react = _interopRequireDefault(require("react"));
|
|
7
|
+
var _wixUiIconsCommon = require("@wix/wix-ui-icons-common");
|
|
8
|
+
var _thumbnailReplaceOverlayStCss = require("./thumbnail-replace-overlay.st.css.js");
|
|
9
|
+
var _jsxFileName = "/home/builduser/work/843658b9f44192f0/packages/fields/dist/cjs/components/image/thumbnail-replace-overlay.tsx";
|
|
10
|
+
const ThumbnailReplaceOverlay = () => /*#__PURE__*/_react.default.createElement("div", {
|
|
11
|
+
className: _thumbnailReplaceOverlayStCss.classes.root,
|
|
12
|
+
__self: void 0,
|
|
13
|
+
__source: {
|
|
14
|
+
fileName: _jsxFileName,
|
|
15
|
+
lineNumber: 6,
|
|
16
|
+
columnNumber: 3
|
|
17
|
+
}
|
|
18
|
+
}, /*#__PURE__*/_react.default.createElement(_wixUiIconsCommon.Replace, {
|
|
19
|
+
className: _thumbnailReplaceOverlayStCss.classes.icon,
|
|
20
|
+
__self: void 0,
|
|
21
|
+
__source: {
|
|
22
|
+
fileName: _jsxFileName,
|
|
23
|
+
lineNumber: 7,
|
|
24
|
+
columnNumber: 5
|
|
25
|
+
}
|
|
26
|
+
}));
|
|
27
|
+
exports.ThumbnailReplaceOverlay = ThumbnailReplaceOverlay;
|
|
28
|
+
ThumbnailReplaceOverlay.displayName = 'ThumbnailReplaceOverlay';
|
|
29
|
+
//# sourceMappingURL=thumbnail-replace-overlay.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_wixUiIconsCommon","_thumbnailReplaceOverlayStCss","_jsxFileName","ThumbnailReplaceOverlay","default","createElement","className","classes","root","__self","__source","fileName","lineNumber","columnNumber","Replace","icon","exports","displayName"],"sources":["../../../../src/components/image/thumbnail-replace-overlay.tsx"],"sourcesContent":["import React from 'react';\nimport { Replace } from '@wix/wix-ui-icons-common';\nimport { classes } from './thumbnail-replace-overlay.st.css.js';\n\nexport const ThumbnailReplaceOverlay: React.FC = () => (\n <div className={classes.root}>\n <Replace className={classes.icon} />\n </div>\n);\n\nThumbnailReplaceOverlay.displayName = 'ThumbnailReplaceOverlay';\n"],"mappings":";;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAD,OAAA;AACA,IAAAE,6BAAA,GAAAF,OAAA;AAAgE,IAAAG,YAAA;AAEzD,MAAMC,uBAAiC,GAAGA,CAAA,kBAC/CN,MAAA,CAAAO,OAAA,CAAAC,aAAA;EAAKC,SAAS,EAAEC,qCAAO,CAACC,IAAK;EAAAC,MAAA;EAAAC,QAAA;IAAAC,QAAA,EAAAT,YAAA;IAAAU,UAAA;IAAAC,YAAA;EAAA;AAAA,gBAC3BhB,MAAA,CAAAO,OAAA,CAAAC,aAAA,CAACL,iBAAA,CAAAc,OAAO;EAACR,SAAS,EAAEC,qCAAO,CAACQ,IAAK;EAAAN,MAAA;EAAAC,QAAA;IAAAC,QAAA,EAAAT,YAAA;IAAAU,UAAA;IAAAC,YAAA;EAAA;AAAA,CAAE,CAChC,CACN;AAACG,OAAA,CAAAb,uBAAA,GAAAA,uBAAA;AAEFA,uBAAuB,CAACc,WAAW,GAAG,yBAAyB","ignoreList":[]}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.vars = exports.style = exports.stVars = exports.st = exports.namespace = exports.layers = exports.keyframes = exports.cssStates = exports.containers = exports.classes = void 0;
|
|
5
|
+
var _stylableEsmRuntime = require("../../stylable-esm-runtime.js");
|
|
6
|
+
// @ts-nocheck
|
|
7
|
+
|
|
8
|
+
var _namespace_ = "thumbnailreplaceoverlay3138302508";
|
|
9
|
+
var _style_ = _stylableEsmRuntime.classesRuntime.bind(null, _namespace_);
|
|
10
|
+
var cssStates = exports.cssStates = _stylableEsmRuntime.statesRuntime.bind(null, _namespace_);
|
|
11
|
+
var style = exports.style = _style_;
|
|
12
|
+
var st = exports.st = _style_;
|
|
13
|
+
var namespace = exports.namespace = _namespace_;
|
|
14
|
+
var classes = exports.classes = {
|
|
15
|
+
"root": "thumbnailreplaceoverlay3138302508__root",
|
|
16
|
+
"icon": "thumbnailreplaceoverlay3138302508__icon"
|
|
17
|
+
};
|
|
18
|
+
var keyframes = exports.keyframes = {};
|
|
19
|
+
var layers = exports.layers = {};
|
|
20
|
+
var containers = exports.containers = {};
|
|
21
|
+
var stVars = exports.stVars = {};
|
|
22
|
+
var vars = exports.vars = {};
|
|
23
|
+
//# sourceMappingURL=thumbnail-replace-overlay.st.css.js.map
|