@wix/patterns-fields 1.87.0 → 1.89.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/field-validation-settings/field-validation-settings-input.js +44 -42
- package/dist/cjs/components/field-validation-settings/field-validation-settings-input.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/cell-media-gallery-edit.js +33 -28
- package/dist/cjs/components/media-gallery/cell-media-gallery-edit.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.js +1 -1
- package/dist/cjs/components/multi-document/cell-multi-document-edit.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/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/document/form-document-field.st.css.js +2 -2
- package/dist/esm/components/exclamation/exclamation.st.css.js +2 -2
- package/dist/esm/components/field-validation-settings/field-validation-settings-input.js +14 -11
- package/dist/esm/components/field-validation-settings/field-validation-settings-input.js.map +1 -1
- package/dist/esm/components/highlighted-text/highlighted-text.st.css.js +3 -3
- 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/media-control/cell-media-edit-shell.st.css.js +2 -2
- package/dist/esm/components/media-control/cell-media-edit-shell.st.css.js.map +1 -1
- package/dist/esm/components/media-control/paste-url-button.st.css.js +2 -2
- package/dist/esm/components/media-control/paste-url-button.st.css.js.map +1 -1
- 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/cell-media-gallery-edit.js +12 -9
- package/dist/esm/components/media-gallery/cell-media-gallery-edit.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-loader/media-loader.st.css.js +2 -2
- package/dist/esm/components/media-tag/web-media-tag/media-tag.st.css.js +2 -2
- package/dist/esm/components/multi-document/cell-multi-document-edit.js +1 -1
- package/dist/esm/components/multi-document/cell-multi-document-edit.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/reference/cell-multi-reference-input.st.css.js +2 -2
- package/dist/esm/components/reference/cell-multi-reference-input.st.css.js.map +1 -1
- package/dist/esm/components/reference/cell-reference-input.st.css.js +2 -2
- package/dist/esm/components/rich-content/rich-content-input/default-value-input/rich-content-default-value-input.st.css.js +2 -2
- package/dist/esm/components/rich-content/rich-content-input/form-input/rich-content-form-input.st.css.js +2 -2
- package/dist/esm/components/rich-content/rich-content-input/form-input/rich-content-form-input.st.css.js.map +1 -1
- package/dist/esm/components/rich-content/rich-content-input/form-read-only-input/rich-content-form-read-only-input.st.css.js +2 -2
- package/dist/esm/components/rich-content/rich-content-input/form-read-only-input/rich-content-form-read-only-input.st.css.js.map +1 -1
- package/dist/esm/components/rich-content/rich-content-input/rich-content-common/fullscreen-modal/fullscreen-modal.st.css.js +2 -2
- package/dist/esm/components/rich-content/rich-content-input/rich-content-common/fullscreen-modal/fullscreen-modal.st.css.js.map +1 -1
- package/dist/esm/components/rich-content/rich-content-input/rich-content-common/publish-loader/publish-loader.st.css.js +2 -2
- package/dist/esm/components/rich-content/rich-content-input/rich-content-common/publish-loader/publish-loader.st.css.js.map +1 -1
- package/dist/esm/components/rich-content/rich-content-input/rich-content-common/toggle-fullscreen-button/toggle-fullscreen-button.st.css.js +2 -2
- package/dist/esm/components/rich-content/rich-content-input/rich-content-common/toggle-fullscreen-button/toggle-fullscreen-button.st.css.js.map +1 -1
- package/dist/esm/components/rich-content/rich-content-input/rich-content-editor/rich-content-editor.st.css.js +2 -2
- 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/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-editor.st.css.js.map +1 -1
- package/dist/esm/components/rich-text/rich-text-input/rich-text-editor/rich-text-editor.st.css.js +2 -2
- package/dist/esm/components/rich-text/rich-text-input/rich-text-editor/toolbar/toolbar.st.css.js +2 -2
- 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/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/field-validation-settings/field-validation-settings-input.d.ts +4 -2
- package/dist/types/components/field-validation-settings/field-validation-settings-input.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/media-control/cell-media-edit-shell.st.css.d.ts.map +1 -1
- package/dist/types/components/media-control/paste-url-button.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-gallery/cell-media-gallery-edit.d.ts.map +1 -1
- package/dist/types/components/media-image/media-image.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/reference/cell-multi-reference-input.st.css.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-common/fullscreen-modal/fullscreen-modal.st.css.d.ts.map +1 -1
- package/dist/types/components/rich-content/rich-content-input/rich-content-common/publish-loader/publish-loader.st.css.d.ts.map +1 -1
- package/dist/types/components/rich-content/rich-content-input/rich-content-common/toggle-fullscreen-button/toggle-fullscreen-button.st.css.d.ts.map +1 -1
- package/dist/types/components/rich-content/rich-content-input/rich-content-viewer/rich-content-viewer.st.css.d.ts.map +1 -1
- 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/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__/components/field-validation-settings/field-validation-settings-input.spec.tsx +20 -1
- 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/field-validation-settings/field-validation-settings-input.tsx +22 -10
- 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/cell-media-gallery-edit.tsx +14 -9
- package/src/components/media-gallery/form-media-gallery-field.st.css.ts +2 -2
- package/src/components/media-image/media-image.st.css.ts +3 -3
- package/src/components/media-image/overlays/overlay.st.css.ts +2 -2
- package/src/components/media-loader/media-loader.st.css.ts +2 -2
- package/src/components/media-tag/web-media-tag/media-tag.st.css.ts +2 -2
- package/src/components/multi-document/cell-multi-document-edit.st.css.ts +2 -2
- package/src/components/multi-document/cell-multi-document-edit.tsx +1 -1
- package/src/components/multi-document/multi-document-input/form-multi-document.st.css.ts +2 -2
- package/src/components/reference/cell-multi-reference-input.st.css.ts +2 -2
- package/src/components/reference/cell-reference-input.st.css.ts +2 -2
- package/src/components/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_ = "addressinput3855729996";
|
|
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":"addressinput3855729996__root","tableAddressInput":"addressinput3855729996__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_ = "actionsmenu1397751256";
|
|
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":"actionsmenu1397751256__root","action":"actionsmenu1397751256__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_ = "formaudiofield3743157660";
|
|
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":"formaudiofield3743157660__root","addItem":"formaudiofield3743157660__addItem","mediaTitle":"formaudiofield3743157660__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_ = "audioplayer2787828225";
|
|
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":"audioplayer2787828225__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_ = "cellcolorview4225418284";
|
|
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":"cellcolorview4225418284__root","hashPrefix":"cellcolorview4225418284__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_ = "colorview3472694465";
|
|
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":"colorview3472694465__root","view":"colorview3472694465__view","fillPreview":"colorview3472694465__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_ = "deletedialog3903000196";
|
|
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":"deletedialog3903000196__root","layout":"deletedialog3903000196__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_ = "formdocumentfield3549365286";
|
|
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":"formdocumentfield3549365286__root","viewWrapper":"formdocumentfield3549365286__viewWrapper","textWidth":"formdocumentfield3549365286__textWidth","documentLoader":"formdocumentfield3549365286__documentLoader","addDocument":"formdocumentfield3549365286__addDocument","addItemWrapper":"formdocumentfield3549365286__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_ = "exclamation627976924";
|
|
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":"exclamation627976924__root","exclamation":"exclamation627976924__exclamation","actions":"exclamation627976924__actions","action":"exclamation627976924__action"};
|
|
17
17
|
export var keyframes = {};
|
|
18
18
|
export var layers = {};
|
|
19
19
|
export var containers = {};
|
|
@@ -15,6 +15,7 @@ import { v4 as uuid } from 'uuid';
|
|
|
15
15
|
import type { ControlledInputProps } from '../../types/controlled-input';
|
|
16
16
|
import type {
|
|
17
17
|
CharactersLimitFieldValidationRuleConfig,
|
|
18
|
+
FieldValidationRule,
|
|
18
19
|
FieldValidationRuleConfig,
|
|
19
20
|
FieldValidationSettingsValue,
|
|
20
21
|
PatternFieldValidationRuleConfig,
|
|
@@ -29,6 +30,8 @@ export interface FieldValidationSettingsInputProps
|
|
|
29
30
|
'autoFocus' | 'onBlur'
|
|
30
31
|
> {
|
|
31
32
|
rules: readonly FieldValidationRuleConfig[];
|
|
33
|
+
/** Rules the caller has fixed and the user can't toggle, independent of `readOnly`. */
|
|
34
|
+
disabledRules?: readonly FieldValidationRule[];
|
|
32
35
|
}
|
|
33
36
|
|
|
34
37
|
interface RuleToggleProps {
|
|
@@ -73,7 +76,10 @@ export const FieldValidationSettingsInput = ({
|
|
|
73
76
|
invalid,
|
|
74
77
|
dataHook = 'field-validation-settings',
|
|
75
78
|
rules,
|
|
79
|
+
disabledRules,
|
|
76
80
|
}: FieldValidationSettingsInputProps) => {
|
|
81
|
+
const isRuleDisabled = (rule: FieldValidationRule) =>
|
|
82
|
+
Boolean(readOnly) || Boolean(disabledRules?.includes(rule));
|
|
77
83
|
const supportedRules = rules.map(({ type }) => type);
|
|
78
84
|
const violations = getFieldValidationSettingsViolations(data, supportedRules);
|
|
79
85
|
const supportsSpecificValues = rules.some(
|
|
@@ -102,7 +108,7 @@ export const FieldValidationSettingsInput = ({
|
|
|
102
108
|
key="required"
|
|
103
109
|
dataHook="field-validation-required"
|
|
104
110
|
checked={Boolean(data.required)}
|
|
105
|
-
disabled={
|
|
111
|
+
disabled={isRuleDisabled('required')}
|
|
106
112
|
label={rule.label}
|
|
107
113
|
infoContent={rule.tooltip}
|
|
108
114
|
onChange={() => update({ required: !data.required })}
|
|
@@ -135,7 +141,10 @@ export const FieldValidationSettingsInput = ({
|
|
|
135
141
|
<RuleToggle
|
|
136
142
|
dataHook="field-validation-characters-limit"
|
|
137
143
|
checked={hasCharactersLimit}
|
|
138
|
-
disabled={
|
|
144
|
+
disabled={
|
|
145
|
+
isRuleDisabled('charactersLimit') ||
|
|
146
|
+
(hasSpecificValues && !hasCharactersLimit)
|
|
147
|
+
}
|
|
139
148
|
label={rule.label}
|
|
140
149
|
infoContent={rule.tooltip}
|
|
141
150
|
onChange={() =>
|
|
@@ -150,7 +159,7 @@ export const FieldValidationSettingsInput = ({
|
|
|
150
159
|
dataHook="field-validation-min-characters"
|
|
151
160
|
size="small"
|
|
152
161
|
value={data.charactersLimit?.min}
|
|
153
|
-
disabled={
|
|
162
|
+
disabled={isRuleDisabled('charactersLimit')}
|
|
154
163
|
status={
|
|
155
164
|
hasUnattributedInvalidState || minViolation
|
|
156
165
|
? 'error'
|
|
@@ -184,7 +193,7 @@ export const FieldValidationSettingsInput = ({
|
|
|
184
193
|
dataHook="field-validation-max-characters"
|
|
185
194
|
size="small"
|
|
186
195
|
value={data.charactersLimit?.max}
|
|
187
|
-
disabled={
|
|
196
|
+
disabled={isRuleDisabled('charactersLimit')}
|
|
188
197
|
status={
|
|
189
198
|
hasUnattributedInvalidState ||
|
|
190
199
|
maxOutOfBoundsViolation ||
|
|
@@ -227,7 +236,8 @@ export const FieldValidationSettingsInput = ({
|
|
|
227
236
|
dataHook="field-validation-specific-values"
|
|
228
237
|
checked={hasSpecificValues}
|
|
229
238
|
disabled={
|
|
230
|
-
|
|
239
|
+
isRuleDisabled('specificValues') ||
|
|
240
|
+
((hasCharactersLimit || hasPattern) && !hasSpecificValues)
|
|
231
241
|
}
|
|
232
242
|
label={rule.label}
|
|
233
243
|
infoContent={rule.tooltip}
|
|
@@ -251,7 +261,7 @@ export const FieldValidationSettingsInput = ({
|
|
|
251
261
|
dataHook={`field-validation-specific-value-${index}`}
|
|
252
262
|
size="small"
|
|
253
263
|
value={option.value}
|
|
254
|
-
disabled={
|
|
264
|
+
disabled={isRuleDisabled('specificValues')}
|
|
255
265
|
status={
|
|
256
266
|
optionViolation || hasUnattributedInvalidState
|
|
257
267
|
? 'error'
|
|
@@ -280,7 +290,7 @@ export const FieldValidationSettingsInput = ({
|
|
|
280
290
|
dataHook={`field-validation-specific-value-remove-${index}`}
|
|
281
291
|
size="tiny"
|
|
282
292
|
priority="secondary"
|
|
283
|
-
disabled={
|
|
293
|
+
disabled={isRuleDisabled('specificValues')}
|
|
284
294
|
ariaLabel={rule.removeButton}
|
|
285
295
|
onClick={() =>
|
|
286
296
|
update({
|
|
@@ -301,7 +311,7 @@ export const FieldValidationSettingsInput = ({
|
|
|
301
311
|
dataHook="field-validation-specific-value-add"
|
|
302
312
|
size="small"
|
|
303
313
|
prefixIcon={<AddSmall />}
|
|
304
|
-
disabled={
|
|
314
|
+
disabled={isRuleDisabled('specificValues')}
|
|
305
315
|
onClick={() =>
|
|
306
316
|
update({
|
|
307
317
|
specificValues: [
|
|
@@ -335,7 +345,9 @@ export const FieldValidationSettingsInput = ({
|
|
|
335
345
|
<RuleToggle
|
|
336
346
|
dataHook="field-validation-pattern"
|
|
337
347
|
checked={hasPattern}
|
|
338
|
-
disabled={
|
|
348
|
+
disabled={
|
|
349
|
+
isRuleDisabled('pattern') || (hasSpecificValues && !hasPattern)
|
|
350
|
+
}
|
|
339
351
|
label={rule.label}
|
|
340
352
|
infoContent={rule.tooltip}
|
|
341
353
|
onChange={() => update({ pattern: hasPattern ? undefined : '' })}
|
|
@@ -346,7 +358,7 @@ export const FieldValidationSettingsInput = ({
|
|
|
346
358
|
dataHook="field-validation-pattern-input"
|
|
347
359
|
size="small"
|
|
348
360
|
value={data.pattern}
|
|
349
|
-
disabled={
|
|
361
|
+
disabled={isRuleDisabled('pattern')}
|
|
350
362
|
status={
|
|
351
363
|
hasUnattributedInvalidState || invalidPatternViolation
|
|
352
364
|
? 'error'
|
|
@@ -5,7 +5,7 @@ import { classesRuntime, statesRuntime } from "../../stylable-esm-runtime.js";
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var _namespace_ = "
|
|
8
|
+
var _namespace_ = "highlightedtext3674572764";
|
|
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":"highlightedtext3674572764__root","substring":"highlightedtext3674572764__substring"};
|
|
17
|
+
export var keyframes = {"highlighted":"highlightedtext3674572764__highlighted","highlighted-match":"highlightedtext3674572764__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';
|