@wix/patterns-fields 1.86.0 → 1.88.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/components/address/input/address-input.st.css.js +3 -3
- package/dist/cjs/components/address/input/address-input.st.css.js.map +1 -1
- package/dist/cjs/components/audio/actions/actions-menu/actions-menu.st.css.js +3 -3
- package/dist/cjs/components/audio/actions/actions-menu/actions-menu.st.css.js.map +1 -1
- package/dist/cjs/components/audio/audio-field/controlled-audio.uni.driver.js +29 -0
- package/dist/cjs/components/audio/audio-field/controlled-audio.uni.driver.js.map +1 -0
- package/dist/cjs/components/audio/audio-field/form-audio-field.js +42 -12
- package/dist/cjs/components/audio/audio-field/form-audio-field.js.map +1 -1
- package/dist/cjs/components/audio/audio-field/form-audio-field.st.css.js +4 -4
- package/dist/cjs/components/audio/audio-field/form-audio-field.st.css.js.map +1 -1
- package/dist/cjs/components/audio/audio-player/audio-player.st.css.js +2 -2
- package/dist/cjs/components/audio/audio-player/audio-player.st.css.js.map +1 -1
- package/dist/cjs/components/color-view/cell-color-view.st.css.js +3 -3
- package/dist/cjs/components/color-view/cell-color-view.st.css.js.map +1 -1
- package/dist/cjs/components/color-view/color-view.st.css.js +4 -4
- package/dist/cjs/components/color-view/color-view.st.css.js.map +1 -1
- package/dist/cjs/components/controlled-input.uni.driver.js +7 -1
- package/dist/cjs/components/controlled-input.uni.driver.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/controlled-image.uni.driver.js +23 -0
- package/dist/cjs/components/image/controlled-image.uni.driver.js.map +1 -0
- package/dist/cjs/components/image/form-image-field.js +124 -0
- package/dist/cjs/components/image/form-image-field.js.map +1 -0
- package/dist/cjs/components/image/form-image-input.js +13 -50
- package/dist/cjs/components/image/form-image-input.js.map +1 -1
- package/dist/cjs/components/image/index.js +6 -0
- package/dist/cjs/components/image/index.js.map +1 -1
- package/dist/cjs/components/image/thumbnail-replace-overlay.st.css.js +3 -3
- package/dist/cjs/components/image/thumbnail-replace-overlay.st.css.js.map +1 -1
- package/dist/cjs/components/media-control/cell-media-edit-shell.st.css.js +2 -2
- package/dist/cjs/components/media-control/cell-media-edit-shell.st.css.js.map +1 -1
- package/dist/cjs/components/media-control/paste-url-button.st.css.js +4 -4
- package/dist/cjs/components/media-control/paste-url-button.st.css.js.map +1 -1
- package/dist/cjs/components/media-control/use-media-control.js +4 -1
- package/dist/cjs/components/media-control/use-media-control.js.map +1 -1
- package/dist/cjs/components/media-gallery/form-media-gallery-field.st.css.js +10 -10
- package/dist/cjs/components/media-gallery/form-media-gallery-field.st.css.js.map +1 -1
- package/dist/cjs/components/media-image/media-image.st.css.js +4 -4
- package/dist/cjs/components/media-image/media-image.st.css.js.map +1 -1
- package/dist/cjs/components/media-image/overlays/overlay.st.css.js +3 -3
- package/dist/cjs/components/media-image/overlays/overlay.st.css.js.map +1 -1
- package/dist/cjs/components/media-loader/media-loader.st.css.js +3 -3
- package/dist/cjs/components/media-loader/media-loader.st.css.js.map +1 -1
- package/dist/cjs/components/media-tag/web-media-tag/media-tag.st.css.js +2 -2
- package/dist/cjs/components/media-tag/web-media-tag/media-tag.st.css.js.map +1 -1
- package/dist/cjs/components/multi-document/cell-multi-document-edit.st.css.js +3 -3
- package/dist/cjs/components/multi-document/cell-multi-document-edit.st.css.js.map +1 -1
- package/dist/cjs/components/multi-document/multi-document-input/form-multi-document.st.css.js +5 -5
- package/dist/cjs/components/multi-document/multi-document-input/form-multi-document.st.css.js.map +1 -1
- package/dist/cjs/components/reference/cell-multi-reference-input.st.css.js +2 -2
- package/dist/cjs/components/reference/cell-multi-reference-input.st.css.js.map +1 -1
- package/dist/cjs/components/reference/cell-reference-input.st.css.js +3 -3
- package/dist/cjs/components/reference/cell-reference-input.st.css.js.map +1 -1
- package/dist/cjs/components/rich-content/rich-content-input/default-value-input/rich-content-default-value-input.st.css.js +4 -4
- package/dist/cjs/components/rich-content/rich-content-input/default-value-input/rich-content-default-value-input.st.css.js.map +1 -1
- package/dist/cjs/components/rich-content/rich-content-input/form-input/rich-content-form-input.st.css.js +3 -3
- package/dist/cjs/components/rich-content/rich-content-input/form-input/rich-content-form-input.st.css.js.map +1 -1
- package/dist/cjs/components/rich-content/rich-content-input/form-read-only-input/rich-content-form-read-only-input.st.css.js +2 -2
- package/dist/cjs/components/rich-content/rich-content-input/form-read-only-input/rich-content-form-read-only-input.st.css.js.map +1 -1
- package/dist/cjs/components/rich-content/rich-content-input/rich-content-common/fullscreen-modal/fullscreen-modal.st.css.js +3 -3
- package/dist/cjs/components/rich-content/rich-content-input/rich-content-common/fullscreen-modal/fullscreen-modal.st.css.js.map +1 -1
- package/dist/cjs/components/rich-content/rich-content-input/rich-content-common/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 +7 -7
- package/dist/cjs/components/rich-content/rich-content-input/rich-content-editor/rich-content-editor.st.css.js.map +1 -1
- package/dist/cjs/components/rich-content/rich-content-input/rich-content-editor/rich-content-toolbar.st.css.js +5 -5
- package/dist/cjs/components/rich-content/rich-content-input/rich-content-editor/rich-content-toolbar.st.css.js.map +1 -1
- package/dist/cjs/components/rich-content/rich-content-input/rich-content-viewer/rich-content-viewer.st.css.js +4 -4
- package/dist/cjs/components/rich-content/rich-content-input/rich-content-viewer/rich-content-viewer.st.css.js.map +1 -1
- package/dist/cjs/components/rich-text/rich-text-input/rich-text-editor/rich-editor.st.css.js +18 -18
- package/dist/cjs/components/rich-text/rich-text-input/rich-text-editor/rich-editor.st.css.js.map +1 -1
- package/dist/cjs/components/rich-text/rich-text-input/rich-text-editor/rich-text-editor.st.css.js +4 -4
- package/dist/cjs/components/rich-text/rich-text-input/rich-text-editor/rich-text-editor.st.css.js.map +1 -1
- package/dist/cjs/components/rich-text/rich-text-input/rich-text-editor/toolbar/toolbar.st.css.js +18 -18
- package/dist/cjs/components/rich-text/rich-text-input/rich-text-editor/toolbar/toolbar.st.css.js.map +1 -1
- package/dist/cjs/components/text/text-view.st.css.js +3 -3
- package/dist/cjs/components/text/text-view.st.css.js.map +1 -1
- package/dist/cjs/components/video/controlled-video.uni.driver.js +40 -0
- package/dist/cjs/components/video/controlled-video.uni.driver.js.map +1 -0
- package/dist/cjs/components/video/form-video-field.js +358 -0
- package/dist/cjs/components/video/form-video-field.js.map +1 -0
- package/dist/cjs/components/video/form-video.js +22 -284
- package/dist/cjs/components/video/form-video.js.map +1 -1
- package/dist/cjs/components/video/index.js +4 -1
- package/dist/cjs/components/video/index.js.map +1 -1
- package/dist/cjs/styles.global.css +1 -1
- package/dist/esm/components/address/input/address-input.st.css.js +2 -2
- package/dist/esm/components/audio/actions/actions-menu/actions-menu.st.css.js +2 -2
- package/dist/esm/components/audio/audio-field/controlled-audio.uni.driver.js +26 -0
- package/dist/esm/components/audio/audio-field/controlled-audio.uni.driver.js.map +1 -0
- package/dist/esm/components/audio/audio-field/form-audio-field.js +6 -1
- package/dist/esm/components/audio/audio-field/form-audio-field.js.map +1 -1
- package/dist/esm/components/audio/audio-field/form-audio-field.st.css.js +2 -2
- package/dist/esm/components/audio/audio-player/audio-player.st.css.js +2 -2
- package/dist/esm/components/color-view/cell-color-view.st.css.js +2 -2
- package/dist/esm/components/color-view/color-view.st.css.js +2 -2
- package/dist/esm/components/color-view/color-view.st.css.js.map +1 -1
- package/dist/esm/components/controlled-input.uni.driver.js +6 -0
- package/dist/esm/components/controlled-input.uni.driver.js.map +1 -1
- package/dist/esm/components/delete-dialog/delete-dialog.st.css.js +2 -2
- package/dist/esm/components/delete-dialog/delete-dialog.st.css.js.map +1 -1
- package/dist/esm/components/document/form-document-field.st.css.js +2 -2
- package/dist/esm/components/exclamation/exclamation.st.css.js +2 -2
- package/dist/esm/components/highlighted-text/highlighted-text.st.css.js +3 -3
- package/dist/esm/components/highlighted-text/highlighted-text.st.css.js.map +1 -1
- package/dist/esm/components/image/controlled-image.uni.driver.js +19 -0
- package/dist/esm/components/image/controlled-image.uni.driver.js.map +1 -0
- package/dist/esm/components/image/form-image-field.js +48 -0
- package/dist/esm/components/image/form-image-field.js.map +1 -0
- package/dist/esm/components/image/form-image-input.js +11 -33
- package/dist/esm/components/image/form-image-input.js.map +1 -1
- package/dist/esm/components/image/index.js +1 -0
- package/dist/esm/components/image/index.js.map +1 -1
- package/dist/esm/components/image/thumbnail-replace-overlay.st.css.js +2 -2
- package/dist/esm/components/image/thumbnail-replace-overlay.st.css.js.map +1 -1
- package/dist/esm/components/media-control/cell-media-edit-shell.st.css.js +2 -2
- package/dist/esm/components/media-control/paste-url-button.st.css.js +2 -2
- package/dist/esm/components/media-control/use-media-control.js +4 -3
- package/dist/esm/components/media-control/use-media-control.js.map +1 -1
- package/dist/esm/components/media-gallery/form-media-gallery-field.st.css.js +2 -2
- package/dist/esm/components/media-image/media-image.st.css.js +3 -3
- package/dist/esm/components/media-image/media-image.st.css.js.map +1 -1
- package/dist/esm/components/media-image/overlays/overlay.st.css.js +2 -2
- package/dist/esm/components/media-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/cell-multi-document-edit.st.css.js +2 -2
- package/dist/esm/components/multi-document/cell-multi-document-edit.st.css.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/reference/cell-multi-reference-input.st.css.js +2 -2
- package/dist/esm/components/reference/cell-reference-input.st.css.js +2 -2
- package/dist/esm/components/reference/cell-reference-input.st.css.js.map +1 -1
- package/dist/esm/components/rich-content/rich-content-input/default-value-input/rich-content-default-value-input.st.css.js +2 -2
- package/dist/esm/components/rich-content/rich-content-input/form-input/rich-content-form-input.st.css.js +2 -2
- package/dist/esm/components/rich-content/rich-content-input/form-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 +2 -2
- package/dist/esm/components/rich-content/rich-content-input/rich-content-editor/rich-content-editor.st.css.js.map +1 -1
- package/dist/esm/components/rich-content/rich-content-input/rich-content-editor/rich-content-toolbar.st.css.js +2 -2
- package/dist/esm/components/rich-content/rich-content-input/rich-content-editor/rich-content-toolbar.st.css.js.map +1 -1
- package/dist/esm/components/rich-content/rich-content-input/rich-content-viewer/rich-content-viewer.st.css.js +2 -2
- package/dist/esm/components/rich-text/rich-text-input/rich-text-editor/rich-editor.st.css.js +2 -2
- package/dist/esm/components/rich-text/rich-text-input/rich-text-editor/rich-text-editor.st.css.js +2 -2
- package/dist/esm/components/rich-text/rich-text-input/rich-text-editor/toolbar/toolbar.st.css.js +2 -2
- package/dist/esm/components/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/controlled-video.uni.driver.js +37 -0
- package/dist/esm/components/video/controlled-video.uni.driver.js.map +1 -0
- package/dist/esm/components/video/form-video-field.js +71 -0
- package/dist/esm/components/video/form-video-field.js.map +1 -0
- package/dist/esm/components/video/form-video.js +17 -56
- package/dist/esm/components/video/form-video.js.map +1 -1
- package/dist/esm/components/video/index.js +1 -0
- package/dist/esm/components/video/index.js.map +1 -1
- package/dist/esm/styles.global.css +1 -1
- package/dist/types/components/audio/audio-field/controlled-audio.uni.driver.d.ts +18 -0
- package/dist/types/components/audio/audio-field/controlled-audio.uni.driver.d.ts.map +1 -0
- package/dist/types/components/audio/audio-field/form-audio-field.d.ts +12 -1
- package/dist/types/components/audio/audio-field/form-audio-field.d.ts.map +1 -1
- package/dist/types/components/color-view/color-view.st.css.d.ts.map +1 -1
- package/dist/types/components/controlled-input.uni.driver.d.ts +74 -0
- package/dist/types/components/controlled-input.uni.driver.d.ts.map +1 -1
- package/dist/types/components/delete-dialog/delete-dialog.st.css.d.ts.map +1 -1
- package/dist/types/components/highlighted-text/highlighted-text.st.css.d.ts.map +1 -1
- package/dist/types/components/image/controlled-image.uni.driver.d.ts +40 -0
- package/dist/types/components/image/controlled-image.uni.driver.d.ts.map +1 -0
- package/dist/types/components/image/form-image-field.d.ts +15 -0
- package/dist/types/components/image/form-image-field.d.ts.map +1 -0
- package/dist/types/components/image/form-image-input.d.ts.map +1 -1
- package/dist/types/components/image/index.d.ts +1 -0
- package/dist/types/components/image/index.d.ts.map +1 -1
- package/dist/types/components/image/thumbnail-replace-overlay.st.css.d.ts.map +1 -1
- package/dist/types/components/media-control/use-media-control.d.ts.map +1 -1
- package/dist/types/components/media-image/media-image.st.css.d.ts.map +1 -1
- package/dist/types/components/media-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/cell-multi-document-edit.st.css.d.ts.map +1 -1
- package/dist/types/components/multi-document/multi-document-input/form-multi-document.st.css.d.ts.map +1 -1
- package/dist/types/components/reference/cell-reference-input.st.css.d.ts.map +1 -1
- package/dist/types/components/rich-content/rich-content-input/form-read-only-input/rich-content-form-read-only-input.st.css.d.ts.map +1 -1
- package/dist/types/components/rich-content/rich-content-input/rich-content-editor/rich-content-editor.st.css.d.ts.map +1 -1
- package/dist/types/components/rich-content/rich-content-input/rich-content-editor/rich-content-toolbar.st.css.d.ts.map +1 -1
- package/dist/types/components/rich-text/rich-text-input/rich-text-editor/toolbar/toolbar.st.css.d.ts.map +1 -1
- package/dist/types/components/video/controlled-video.uni.driver.d.ts +22 -0
- package/dist/types/components/video/controlled-video.uni.driver.d.ts.map +1 -0
- package/dist/types/components/video/form-video-field.d.ts +29 -0
- package/dist/types/components/video/form-video-field.d.ts.map +1 -0
- package/dist/types/components/video/form-video.d.ts.map +1 -1
- package/dist/types/components/video/index.d.ts +2 -0
- package/dist/types/components/video/index.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/__tests__/exports/controlled-inputs.spec.tsx +677 -1
- 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/controlled-audio.uni.driver.ts +35 -0
- package/src/components/audio/audio-field/form-audio-field.st.css.ts +2 -2
- package/src/components/audio/audio-field/form-audio-field.tsx +41 -1
- package/src/components/audio/audio-player/audio-player.st.css.ts +2 -2
- package/src/components/color-view/cell-color-view.st.css.ts +2 -2
- package/src/components/color-view/color-view.st.css.ts +2 -2
- package/src/components/controlled-input.uni.driver.ts +6 -0
- package/src/components/delete-dialog/delete-dialog.st.css.ts +2 -2
- package/src/components/document/form-document-field.st.css.ts +2 -2
- package/src/components/exclamation/exclamation.st.css.ts +2 -2
- package/src/components/highlighted-text/highlighted-text.st.css.ts +3 -3
- package/src/components/image/controlled-image.uni.driver.ts +30 -0
- package/src/components/image/form-image-field.tsx +124 -0
- package/src/components/image/form-image-input.tsx +13 -46
- package/src/components/image/index.ts +1 -0
- package/src/components/image/thumbnail-replace-overlay.st.css.ts +2 -2
- package/src/components/media-control/cell-media-edit-shell.st.css.ts +2 -2
- package/src/components/media-control/paste-url-button.st.css.ts +2 -2
- package/src/components/media-control/use-media-control.ts +4 -3
- package/src/components/media-gallery/form-media-gallery-field.st.css.ts +2 -2
- package/src/components/media-image/media-image.st.css.ts +3 -3
- package/src/components/media-image/overlays/overlay.st.css.ts +2 -2
- package/src/components/media-loader/media-loader.st.css.ts +2 -2
- package/src/components/media-tag/web-media-tag/media-tag.st.css.ts +2 -2
- package/src/components/multi-document/cell-multi-document-edit.st.css.ts +2 -2
- package/src/components/multi-document/multi-document-input/form-multi-document.st.css.ts +2 -2
- package/src/components/reference/cell-multi-reference-input.st.css.ts +2 -2
- package/src/components/reference/cell-reference-input.st.css.ts +2 -2
- package/src/components/rich-content/rich-content-input/default-value-input/rich-content-default-value-input.st.css.ts +2 -2
- package/src/components/rich-content/rich-content-input/form-input/rich-content-form-input.st.css.ts +2 -2
- package/src/components/rich-content/rich-content-input/form-read-only-input/rich-content-form-read-only-input.st.css.ts +2 -2
- package/src/components/rich-content/rich-content-input/rich-content-common/fullscreen-modal/fullscreen-modal.st.css.ts +2 -2
- package/src/components/rich-content/rich-content-input/rich-content-common/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 +2 -2
- 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/rich-text-input/rich-text-editor/rich-editor.st.css.ts +2 -2
- package/src/components/rich-text/rich-text-input/rich-text-editor/rich-text-editor.st.css.ts +2 -2
- package/src/components/rich-text/rich-text-input/rich-text-editor/toolbar/toolbar.st.css.ts +2 -2
- package/src/components/text/text-view.st.css.ts +2 -2
- package/src/components/video/controlled-video.uni.driver.ts +48 -0
- package/src/components/video/form-video-field.tsx +268 -0
- package/src/components/video/form-video.tsx +21 -179
- package/src/components/video/index.ts +6 -0
- package/src/styles.global.css +1 -1
|
@@ -5,7 +5,7 @@ import { classesRuntime, statesRuntime } from "../../../stylable-esm-runtime.js"
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var _namespace_ = "
|
|
8
|
+
var _namespace_ = "addressinput2914469914";
|
|
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":"addressinput2914469914__root","tableAddressInput":"addressinput2914469914__tableAddressInput"};
|
|
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.
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var _namespace_ = "
|
|
8
|
+
var _namespace_ = "actionsmenu3671995341";
|
|
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":"actionsmenu3671995341__root","action":"actionsmenu3671995341__action"};
|
|
17
17
|
export var keyframes = {};
|
|
18
18
|
export var layers = {};
|
|
19
19
|
export var containers = {};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { UniDriver } from '@wix/wix-ui-test-utils/unidriver';
|
|
2
|
+
import { AddItemUniDriver } from '@wix/design-system/dist/testkit/unidriver';
|
|
3
|
+
|
|
4
|
+
import { baseUniDriverFactory } from '../../../testkit/base-driver';
|
|
5
|
+
|
|
6
|
+
export function ControlledAudioInputUniDriver(
|
|
7
|
+
base: UniDriver,
|
|
8
|
+
body: UniDriver,
|
|
9
|
+
) {
|
|
10
|
+
// The dataHook sits on the AddItem in the empty state and on the wrapper Box
|
|
11
|
+
// in the filled one, so `base` is either.
|
|
12
|
+
const addItem = AddItemUniDriver(base, body);
|
|
13
|
+
const moreButton = base.$('[data-hook="fromAudioInput.button.more"]');
|
|
14
|
+
const deleteAction = body.$('[data-hook="fromAudioInput.button.delete"]');
|
|
15
|
+
const replaceAction = body.$('[data-hook="fromAudioInput.button.replace"]');
|
|
16
|
+
|
|
17
|
+
const isDisabled = async (element: UniDriver) =>
|
|
18
|
+
(await element.attr('disabled')) !== null ||
|
|
19
|
+
(await element.attr('aria-disabled')) === 'true';
|
|
20
|
+
|
|
21
|
+
return {
|
|
22
|
+
...baseUniDriverFactory(base),
|
|
23
|
+
getAddButtonText: () => base.text(),
|
|
24
|
+
clickAddButton: () => addItem.click(),
|
|
25
|
+
isAddButtonFocused: () => addItem.isFocused(),
|
|
26
|
+
getAudioName: () => base.$('[data-hook="fromAudioInput.audioName"]').text(),
|
|
27
|
+
audioPlayerExists: () =>
|
|
28
|
+
base.$('[data-hook="fromAudioInput.player"]').exists(),
|
|
29
|
+
clickMore: () => moreButton.click(),
|
|
30
|
+
clickDelete: () => deleteAction.click(),
|
|
31
|
+
clickReplace: () => replaceAction.click(),
|
|
32
|
+
isDeleteDisabled: () => isDisabled(deleteAction),
|
|
33
|
+
isReplaceDisabled: () => isDisabled(replaceAction),
|
|
34
|
+
};
|
|
35
|
+
}
|
|
@@ -5,7 +5,7 @@ import { classesRuntime, statesRuntime } from "../../../stylable-esm-runtime.js"
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var _namespace_ = "
|
|
8
|
+
var _namespace_ = "formaudiofield1943540213";
|
|
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":"formaudiofield1943540213__root","addItem":"formaudiofield1943540213__addItem","mediaTitle":"formaudiofield1943540213__mediaTitle"};
|
|
17
17
|
export var keyframes = {};
|
|
18
18
|
export var layers = {};
|
|
19
19
|
export var containers = {};
|
|
@@ -9,6 +9,7 @@ import { useMergedRef, useTranslations, useWithCallback } from '../../../hooks';
|
|
|
9
9
|
import { getMediaTitle, MEDIA_TYPES } from '../../../utils';
|
|
10
10
|
|
|
11
11
|
import { Z_INDEX_MODAL_POPOVER } from '../../common';
|
|
12
|
+
import type { ControlledInputProps } from '../../../types/controlled-input';
|
|
12
13
|
import type { FormMediaControlProps } from '../../media-control';
|
|
13
14
|
import { useMediaControl, useMediaHandlers } from '../../media-control';
|
|
14
15
|
import { MediaLoader } from '../../media-loader';
|
|
@@ -17,11 +18,21 @@ import { buildAudioActions } from '../actions/audio-actions';
|
|
|
17
18
|
|
|
18
19
|
import { style, classes } from './form-audio-field.st.css.js';
|
|
19
20
|
|
|
20
|
-
export
|
|
21
|
+
export interface FormAudioFieldProps extends FormMediaControlProps {
|
|
22
|
+
/**
|
|
23
|
+
* Fires when the media manager closes, whether or not a file was picked.
|
|
24
|
+
* A media field has no text control to blur, so the picker closing is its
|
|
25
|
+
* blur signal.
|
|
26
|
+
*/
|
|
27
|
+
onBlur?: () => void;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export const FormAudioField: FC<FormAudioFieldProps> = ({
|
|
21
31
|
data,
|
|
22
32
|
onChange: onChangeAudio,
|
|
23
33
|
onClear: onClearAudio,
|
|
24
34
|
onInput,
|
|
35
|
+
onBlur,
|
|
25
36
|
autoFocus,
|
|
26
37
|
readOnly,
|
|
27
38
|
invalid,
|
|
@@ -44,6 +55,7 @@ export const FormAudioField: FC<FormMediaControlProps> = ({
|
|
|
44
55
|
readOnly,
|
|
45
56
|
inputRef,
|
|
46
57
|
viewRef,
|
|
58
|
+
onBlur,
|
|
47
59
|
});
|
|
48
60
|
|
|
49
61
|
const { handleReplace, handleDownload, handleDelete } = useMediaHandlers({
|
|
@@ -143,3 +155,31 @@ export const FormAudioField: FC<FormMediaControlProps> = ({
|
|
|
143
155
|
</Box>
|
|
144
156
|
);
|
|
145
157
|
};
|
|
158
|
+
|
|
159
|
+
export type ControlledAudioInputProps = ControlledInputProps<
|
|
160
|
+
string | undefined
|
|
161
|
+
>;
|
|
162
|
+
|
|
163
|
+
export const ControlledAudioInput: FC<ControlledAudioInputProps> = ({
|
|
164
|
+
data,
|
|
165
|
+
onChange,
|
|
166
|
+
onBlur,
|
|
167
|
+
readOnly,
|
|
168
|
+
autoFocus,
|
|
169
|
+
invalid,
|
|
170
|
+
dataHook,
|
|
171
|
+
}) => (
|
|
172
|
+
<FormAudioField
|
|
173
|
+
data={data}
|
|
174
|
+
onChange={onChange}
|
|
175
|
+
// FormAudioField reports deletion through onClear, not onChange.
|
|
176
|
+
onClear={() => onChange(undefined)}
|
|
177
|
+
onBlur={onBlur}
|
|
178
|
+
readOnly={readOnly}
|
|
179
|
+
autoFocus={autoFocus}
|
|
180
|
+
invalid={invalid}
|
|
181
|
+
dataHook={dataHook}
|
|
182
|
+
/>
|
|
183
|
+
);
|
|
184
|
+
|
|
185
|
+
ControlledAudioInput.displayName = 'ControlledAudioInput';
|
|
@@ -5,7 +5,7 @@ import { classesRuntime, statesRuntime } from "../../../stylable-esm-runtime.js"
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var _namespace_ = "
|
|
8
|
+
var _namespace_ = "audioplayer2417328348";
|
|
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":"audioplayer2417328348__root"};
|
|
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_ = "cellcolorview3557913876";
|
|
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":"cellcolorview3557913876__root","hashPrefix":"cellcolorview3557913876__hashPrefix"};
|
|
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_ = "colorview3341471977";
|
|
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":"colorview3341471977__root","view":"colorview3341471977__view","fillPreview":"colorview3341471977__fillPreview"};
|
|
17
17
|
export var keyframes = {};
|
|
18
18
|
export var layers = {};
|
|
19
19
|
export var containers = {};
|
|
@@ -13,7 +13,10 @@ import {
|
|
|
13
13
|
CalendarPopoverUniDriver,
|
|
14
14
|
InlineCalendarPopoverUniDriver,
|
|
15
15
|
} from '../testkit/popover-driver';
|
|
16
|
+
import { ControlledAudioInputUniDriver } from './audio/audio-field/controlled-audio.uni.driver';
|
|
16
17
|
import { DateTimeInputUniDriver } from './datetime-input/controlled-date-time-input.uni.driver';
|
|
18
|
+
import { ControlledImageInputUniDriver } from './image/controlled-image.uni.driver';
|
|
19
|
+
import { ControlledVideoInputUniDriver } from './video/controlled-video.uni.driver';
|
|
17
20
|
|
|
18
21
|
export function ControlledInputUniDriver(base: UniDriver, body: UniDriver) {
|
|
19
22
|
const datePicker = DatePickerUniDriver(base, body);
|
|
@@ -30,5 +33,8 @@ export function ControlledInputUniDriver(base: UniDriver, body: UniDriver) {
|
|
|
30
33
|
radioGroup: RadioGroupUniDriver(base, body),
|
|
31
34
|
calendarPopover: CalendarPopoverUniDriver(datePicker, body),
|
|
32
35
|
inlineCalendarPopover: InlineCalendarPopoverUniDriver(base),
|
|
36
|
+
audio: ControlledAudioInputUniDriver(base, body),
|
|
37
|
+
image: ControlledImageInputUniDriver(base, body),
|
|
38
|
+
video: ControlledVideoInputUniDriver(base, body),
|
|
33
39
|
};
|
|
34
40
|
}
|
|
@@ -5,7 +5,7 @@ import { classesRuntime, statesRuntime } from "../../stylable-esm-runtime.js";
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var _namespace_ = "
|
|
8
|
+
var _namespace_ = "deletedialog516047347";
|
|
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":"deletedialog516047347__root","layout":"deletedialog516047347__layout"};
|
|
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_ = "formdocumentfield1759869050";
|
|
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":"formdocumentfield1759869050__root","viewWrapper":"formdocumentfield1759869050__viewWrapper","textWidth":"formdocumentfield1759869050__textWidth","documentLoader":"formdocumentfield1759869050__documentLoader","addDocument":"formdocumentfield1759869050__addDocument","addItemWrapper":"formdocumentfield1759869050__addItemWrapper"};
|
|
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_ = "exclamation2405445415";
|
|
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":"exclamation2405445415__root","exclamation":"exclamation2405445415__exclamation","actions":"exclamation2405445415__actions","action":"exclamation2405445415__action"};
|
|
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_ = "highlightedtext106472051";
|
|
9
9
|
var _style_ = classesRuntime.bind(null, _namespace_);
|
|
10
10
|
|
|
11
11
|
export var cssStates = statesRuntime.bind(null, _namespace_);
|
|
@@ -13,8 +13,8 @@ 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":"
|
|
17
|
-
export var keyframes = {"highlighted":"
|
|
16
|
+
export var classes = {"root":"highlightedtext106472051__root","substring":"highlightedtext106472051__substring"};
|
|
17
|
+
export var keyframes = {"highlighted":"highlightedtext106472051__highlighted","highlighted-match":"highlightedtext106472051__highlighted-match"};
|
|
18
18
|
export var layers = {};
|
|
19
19
|
export var containers = {};
|
|
20
20
|
export var stVars = {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { UniDriver } from '@wix/wix-ui-test-utils/unidriver';
|
|
2
|
+
import {
|
|
3
|
+
AddItemUniDriver,
|
|
4
|
+
ImageViewerUniDriver,
|
|
5
|
+
} from '@wix/design-system/dist/testkit/unidriver';
|
|
6
|
+
|
|
7
|
+
export function ControlledImageInputUniDriver(
|
|
8
|
+
base: UniDriver,
|
|
9
|
+
body: UniDriver,
|
|
10
|
+
) {
|
|
11
|
+
const imageViewer = ImageViewerUniDriver(base, body);
|
|
12
|
+
// `add-image` is ImageViewer's own hook for its empty-state AddItem.
|
|
13
|
+
const addItem = AddItemUniDriver(base.$('[data-hook="add-image"]'), body);
|
|
14
|
+
const addButton = base.$('[data-hook="add-image"] [data-hook="additem"]');
|
|
15
|
+
const currentImage = base.$('[data-hook="image-viewer-current-image"]');
|
|
16
|
+
|
|
17
|
+
return {
|
|
18
|
+
...imageViewer,
|
|
19
|
+
clickAddButton: () => imageViewer.clickAdd(),
|
|
20
|
+
isAddButtonFocused: () => addItem.isFocused(),
|
|
21
|
+
isAddButtonDisabled: async () =>
|
|
22
|
+
(await addButton.attr('disabled')) !== null,
|
|
23
|
+
containsFocus: async () =>
|
|
24
|
+
(await base.getNative()).contains(document.activeElement),
|
|
25
|
+
// ImageViewer hides its edit affordances behind a loader until the image
|
|
26
|
+
// loads, and jsdom never fires that event on its own.
|
|
27
|
+
simulateImageLoad: async () =>
|
|
28
|
+
(await currentImage.getNative()).dispatchEvent(new Event('load')),
|
|
29
|
+
};
|
|
30
|
+
}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import type { FC } from 'react';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
|
|
4
|
+
import { Box, ImageViewer } from '@wix/design-system';
|
|
5
|
+
import { useIsMobile, useWixPatternsContainer } from '@wix/bex-core/react';
|
|
6
|
+
|
|
7
|
+
import type { ControlledInputProps } from '../../types/controlled-input';
|
|
8
|
+
import { useMergedRef, useWithCallback } from '../../hooks';
|
|
9
|
+
import { getImageUrl } from '../../utils/get-image-url';
|
|
10
|
+
import { MEDIA_HEIGHT, MEDIA_MAX_WIDTH } from '../../utils/media-constants';
|
|
11
|
+
import { MEDIA_TYPES } from '../../utils';
|
|
12
|
+
import type { FormMediaControlProps } from '../media-control';
|
|
13
|
+
import { useMediaControl } from '../media-control';
|
|
14
|
+
|
|
15
|
+
interface ImageViewerActions {
|
|
16
|
+
focus: () => void;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
// `invalid` is not part of this contract. ImageViewer has no error prop; it
|
|
20
|
+
// takes its error styling from the enclosing WDS FormField's status context.
|
|
21
|
+
// To show an error, render the field inside a FormField with status="error".
|
|
22
|
+
export interface FormImageFieldProps
|
|
23
|
+
extends Omit<FormMediaControlProps, 'invalid'> {
|
|
24
|
+
/**
|
|
25
|
+
* Fires when the media manager closes, whether or not a file was picked.
|
|
26
|
+
* A media field has no text control to blur, so the picker closing is its
|
|
27
|
+
* blur signal.
|
|
28
|
+
*/
|
|
29
|
+
onBlur?: () => void;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export const FormImageField: FC<FormImageFieldProps> = ({
|
|
33
|
+
data,
|
|
34
|
+
onChange: onChangeImage,
|
|
35
|
+
onClear: onClearImage,
|
|
36
|
+
onInput,
|
|
37
|
+
onBlur,
|
|
38
|
+
readOnly,
|
|
39
|
+
autoFocus,
|
|
40
|
+
dataHook,
|
|
41
|
+
inputRef: forwardedRef,
|
|
42
|
+
}) => {
|
|
43
|
+
const { translate: t } = useWixPatternsContainer();
|
|
44
|
+
const isMobile = useIsMobile();
|
|
45
|
+
|
|
46
|
+
const onChange = useWithCallback(onChangeImage, onInput);
|
|
47
|
+
const onClear = useWithCallback(onClearImage, onInput);
|
|
48
|
+
|
|
49
|
+
const [inputRef, setInputRef] =
|
|
50
|
+
useMergedRef<ImageViewerActions>(forwardedRef);
|
|
51
|
+
|
|
52
|
+
const { callMedia, onMediaLoad } = useMediaControl({
|
|
53
|
+
mediaType: MEDIA_TYPES.IMAGE,
|
|
54
|
+
value: data,
|
|
55
|
+
onChange,
|
|
56
|
+
autoFocus,
|
|
57
|
+
readOnly,
|
|
58
|
+
onBlur,
|
|
59
|
+
inputRef,
|
|
60
|
+
// The focus target is hidden behind ImageViewer's loader until the image
|
|
61
|
+
// arrives, so focusing has to wait for onImageLoad.
|
|
62
|
+
initialLoading: true,
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
const canEdit = !isMobile && !readOnly;
|
|
66
|
+
|
|
67
|
+
return (
|
|
68
|
+
<Box width="100%" maxWidth={MEDIA_MAX_WIDTH}>
|
|
69
|
+
<ImageViewer
|
|
70
|
+
// ImageViewer keeps its focus node on whichever button is live, so
|
|
71
|
+
// one ref serves both the empty and filled states.
|
|
72
|
+
ref={setInputRef}
|
|
73
|
+
imageUrl={data && getImageUrl(data)}
|
|
74
|
+
dataHook={dataHook}
|
|
75
|
+
onImageLoad={onMediaLoad}
|
|
76
|
+
onAddImage={canEdit ? callMedia : undefined}
|
|
77
|
+
onUpdateImage={canEdit ? callMedia : undefined}
|
|
78
|
+
// Empty, the only control is the add button, so anything that blocks
|
|
79
|
+
// picking disables the viewer. Filled, removal still works on mobile.
|
|
80
|
+
disabled={data ? Boolean(readOnly) : !canEdit}
|
|
81
|
+
// The buttons render whether or not a handler is given, so the states
|
|
82
|
+
// that cannot use them have to take them away explicitly.
|
|
83
|
+
showUpdateButton={canEdit}
|
|
84
|
+
showRemoveButton={!readOnly && Boolean(onClearImage)}
|
|
85
|
+
updateImageInfo={t('cairo.replace-image.tooltip')}
|
|
86
|
+
removeImageInfo={t('cairo.remove-image.tooltip')}
|
|
87
|
+
addImageInfo={t('cairo.add-image.tooltip')}
|
|
88
|
+
height={MEDIA_HEIGHT}
|
|
89
|
+
width="100%"
|
|
90
|
+
fit="cover"
|
|
91
|
+
onRemoveImage={onClear}
|
|
92
|
+
/>
|
|
93
|
+
</Box>
|
|
94
|
+
);
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
FormImageField.displayName = 'FormImageField';
|
|
98
|
+
|
|
99
|
+
export type ControlledImageInputProps = Omit<
|
|
100
|
+
ControlledInputProps<string | undefined>,
|
|
101
|
+
'invalid'
|
|
102
|
+
>;
|
|
103
|
+
|
|
104
|
+
export const ControlledImageInput: FC<ControlledImageInputProps> = ({
|
|
105
|
+
data,
|
|
106
|
+
onChange,
|
|
107
|
+
onBlur,
|
|
108
|
+
readOnly,
|
|
109
|
+
autoFocus,
|
|
110
|
+
dataHook,
|
|
111
|
+
}) => (
|
|
112
|
+
<FormImageField
|
|
113
|
+
data={data}
|
|
114
|
+
onChange={onChange}
|
|
115
|
+
// FormImageField reports removal through onClear, not onChange.
|
|
116
|
+
onClear={() => onChange(undefined)}
|
|
117
|
+
onBlur={onBlur}
|
|
118
|
+
readOnly={readOnly}
|
|
119
|
+
autoFocus={autoFocus}
|
|
120
|
+
dataHook={dataHook}
|
|
121
|
+
/>
|
|
122
|
+
);
|
|
123
|
+
|
|
124
|
+
ControlledImageInput.displayName = 'ControlledImageInput';
|
|
@@ -1,40 +1,20 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { FormField } from '@wix/design-system';
|
|
3
3
|
import { observer } from 'mobx-react-lite';
|
|
4
|
-
import {
|
|
4
|
+
import { useWixPatternsContainer } from '@wix/bex-core/react';
|
|
5
5
|
import { useController } from '@wix/bex-core/form';
|
|
6
6
|
|
|
7
7
|
import { BaseInputProps } from '../../types/base-input';
|
|
8
8
|
import { isEmpty } from '../../validations/string';
|
|
9
|
-
import { getImageUrl } from '../../utils/get-image-url';
|
|
10
|
-
import { MEDIA_HEIGHT, MEDIA_MAX_WIDTH } from '../../utils/media-constants';
|
|
11
9
|
import { useFieldRef } from '../../hooks';
|
|
10
|
+
import { FormImageField } from './form-image-field';
|
|
12
11
|
|
|
13
12
|
export interface FormImageInputProps extends BaseInputProps<string> {}
|
|
14
13
|
|
|
15
14
|
const _FormImageInput = (props: FormImageInputProps) => {
|
|
16
15
|
const { field, dataHook, formControl, data } = props;
|
|
17
16
|
|
|
18
|
-
const { translate: t
|
|
19
|
-
const isMobile = useIsMobile();
|
|
20
|
-
|
|
21
|
-
async function openMedia() {
|
|
22
|
-
if (!openMediaManager) {
|
|
23
|
-
return;
|
|
24
|
-
}
|
|
25
|
-
try {
|
|
26
|
-
const chosenMediaItems = await openMediaManager({
|
|
27
|
-
multiSelect: false,
|
|
28
|
-
category: 'IMAGE',
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
const newImage = chosenMediaItems?.items[0]?.media?.image?.image;
|
|
32
|
-
|
|
33
|
-
controller.field.onChange(newImage);
|
|
34
|
-
} catch (error) {
|
|
35
|
-
console.error('Error opening Media Manager or no files selected:', error);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
17
|
+
const { translate: t } = useWixPatternsContainer();
|
|
38
18
|
|
|
39
19
|
const controller = useController({
|
|
40
20
|
name: field?.id ?? '',
|
|
@@ -53,9 +33,6 @@ const _FormImageInput = (props: FormImageInputProps) => {
|
|
|
53
33
|
|
|
54
34
|
const setFieldRef = useFieldRef(controller.field.ref);
|
|
55
35
|
|
|
56
|
-
const imageUrl =
|
|
57
|
-
controller.field.value && getImageUrl(controller.field.value);
|
|
58
|
-
|
|
59
36
|
return (
|
|
60
37
|
<FormField
|
|
61
38
|
label={field.displayName}
|
|
@@ -64,25 +41,15 @@ const _FormImageInput = (props: FormImageInputProps) => {
|
|
|
64
41
|
statusMessage={controller.fieldState.error?.message}
|
|
65
42
|
dataHook={dataHook}
|
|
66
43
|
>
|
|
67
|
-
<
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
onUpdateImage={isMobile ? undefined : () => openMedia()}
|
|
77
|
-
updateImageInfo={t('cairo.replace-image.tooltip')}
|
|
78
|
-
removeImageInfo={t('cairo.remove-image.tooltip')}
|
|
79
|
-
addImageInfo={t('cairo.add-image.tooltip')}
|
|
80
|
-
height={MEDIA_HEIGHT}
|
|
81
|
-
width="100%"
|
|
82
|
-
fit="cover"
|
|
83
|
-
onRemoveImage={() => controller.field.onChange(null)}
|
|
84
|
-
/>
|
|
85
|
-
</Box>
|
|
44
|
+
<FormImageField
|
|
45
|
+
// Hands the live button to react-hook-form so shouldFocusError can
|
|
46
|
+
// reach this field when it blocks save.
|
|
47
|
+
inputRef={setFieldRef}
|
|
48
|
+
data={controller.field.value}
|
|
49
|
+
onChange={(value) => controller.field.onChange(value)}
|
|
50
|
+
onClear={() => controller.field.onChange(null)}
|
|
51
|
+
dataHook={`image-${field.id}`}
|
|
52
|
+
/>
|
|
86
53
|
</FormField>
|
|
87
54
|
);
|
|
88
55
|
};
|
|
@@ -5,7 +5,7 @@ import { classesRuntime, statesRuntime } from "../../stylable-esm-runtime.js";
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var _namespace_ = "
|
|
8
|
+
var _namespace_ = "thumbnailreplaceoverlay1401102869";
|
|
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":"thumbnailreplaceoverlay1401102869__root","icon":"thumbnailreplaceoverlay1401102869__icon"};
|
|
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_ = "cellmediaeditshell2282788607";
|
|
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":"cellmediaeditshell2282788607__root"};
|
|
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_ = "pasteurlbutton2169628829";
|
|
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":"pasteurlbutton2169628829__root","iconButtonTooltip":"pasteurlbutton2169628829__iconButtonTooltip","iconButton":"pasteurlbutton2169628829__iconButton"};
|
|
17
17
|
export var keyframes = {};
|
|
18
18
|
export var layers = {};
|
|
19
19
|
export var containers = {};
|
|
@@ -2,8 +2,7 @@ import { useRef, useState, useEffect, useCallback, useContext } from 'react';
|
|
|
2
2
|
import { WixPatternsContainerContext } from '@wix/bex-core/react';
|
|
3
3
|
import { files } from '@wix/media';
|
|
4
4
|
|
|
5
|
-
import { MEDIA_TYPES } from '../../utils/media-utils';
|
|
6
|
-
import { executeDownloading } from '../../utils/media-utils';
|
|
5
|
+
import { executeDownloading, MEDIA_TYPES } from '../../utils/media-utils';
|
|
7
6
|
import { getMediaURL } from '../../auto-field-types';
|
|
8
7
|
|
|
9
8
|
type Focusable = { focus: () => void };
|
|
@@ -152,7 +151,9 @@ export function useMediaControl({
|
|
|
152
151
|
}
|
|
153
152
|
}, [autoFocus, value, inputRef, viewRef]);
|
|
154
153
|
|
|
155
|
-
|
|
154
|
+
// `loading` is a dependency because the focus target does not exist while the
|
|
155
|
+
// loader placeholder is up — the effect has to run again once it is gone.
|
|
156
|
+
useEffect(() => setActive(), [setActive, loading]);
|
|
156
157
|
|
|
157
158
|
const onMediaLoad = useCallback(() => setLoading(false), []);
|
|
158
159
|
|