@wix/patterns-fields 1.124.0 → 1.126.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/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/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.st.css.js +3 -3
- package/dist/cjs/components/field-validation-settings/field-validation-settings-input.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/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-gallery/form-media-gallery-field.st.css.js +10 -10
- package/dist/cjs/components/media-gallery/form-media-gallery-field.st.css.js.map +1 -1
- package/dist/cjs/components/media-gallery/media-preview-modal.js +12 -10
- package/dist/cjs/components/media-gallery/media-preview-modal.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-image-field/cell-media-image-edit.js +46 -213
- package/dist/cjs/components/media-image-field/cell-media-image-edit.js.map +1 -1
- package/dist/cjs/components/media-image-field/cell-media-image-edit.st.css.js +8 -8
- package/dist/cjs/components/media-image-field/cell-media-image-edit.st.css.js.map +1 -1
- package/dist/cjs/components/media-image-field/form-media-image-field.js +116 -24
- package/dist/cjs/components/media-image-field/form-media-image-field.js.map +1 -1
- package/dist/cjs/components/media-image-field/form-media-image-field.uni.driver.js +24 -8
- package/dist/cjs/components/media-image-field/form-media-image-field.uni.driver.js.map +1 -1
- package/dist/cjs/components/media-image-field/media-image-actions.js +256 -0
- package/dist/cjs/components/media-image-field/media-image-actions.js.map +1 -0
- package/dist/cjs/components/media-image-field/media-image-view.st.css.js +3 -3
- package/dist/cjs/components/media-image-field/media-image-view.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 +31 -38
- 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-multi-reference-view.st.css.js +3 -3
- package/dist/cjs/components/reference/cell-multi-reference-view.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/styles.global.css +1 -1
- package/dist/cjs/utils/detect-field-type.js +9 -17
- package/dist/cjs/utils/detect-field-type.js.map +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/actions/actions-menu/actions-menu.st.css.js.map +1 -1
- package/dist/esm/components/audio/audio-field/form-audio-field.st.css.js +2 -2
- package/dist/esm/components/audio/audio-player/audio-player.st.css.js +2 -2
- package/dist/esm/components/color-view/cell-color-view.st.css.js +2 -2
- package/dist/esm/components/color-view/cell-color-view.st.css.js.map +1 -1
- package/dist/esm/components/color-view/color-view.st.css.js +2 -2
- package/dist/esm/components/color-view/color-view.st.css.js.map +1 -1
- package/dist/esm/components/delete-dialog/delete-dialog.st.css.js +2 -2
- package/dist/esm/components/document/form-document-field.st.css.js +2 -2
- package/dist/esm/components/exclamation/exclamation.st.css.js +2 -2
- package/dist/esm/components/field-validation-settings/field-validation-settings-input.st.css.js +2 -2
- package/dist/esm/components/field-validation-settings/field-validation-settings-input.st.css.js.map +1 -1
- 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/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/paste-url-button.st.css.js.map +1 -1
- package/dist/esm/components/media-gallery/form-media-gallery-field.st.css.js +2 -2
- package/dist/esm/components/media-gallery/form-media-gallery-field.st.css.js.map +1 -1
- package/dist/esm/components/media-gallery/media-preview-modal.js +2 -2
- package/dist/esm/components/media-gallery/media-preview-modal.js.map +1 -1
- package/dist/esm/components/media-image/media-image.st.css.js +3 -3
- package/dist/esm/components/media-image/overlays/overlay.st.css.js +2 -2
- package/dist/esm/components/media-image-field/cell-media-image-edit.js +11 -37
- package/dist/esm/components/media-image-field/cell-media-image-edit.js.map +1 -1
- package/dist/esm/components/media-image-field/cell-media-image-edit.st.css.js +2 -2
- package/dist/esm/components/media-image-field/form-media-image-field.js +37 -9
- package/dist/esm/components/media-image-field/form-media-image-field.js.map +1 -1
- package/dist/esm/components/media-image-field/form-media-image-field.uni.driver.js +24 -8
- package/dist/esm/components/media-image-field/form-media-image-field.uni.driver.js.map +1 -1
- package/dist/esm/components/media-image-field/media-image-actions.js +52 -0
- package/dist/esm/components/media-image-field/media-image-actions.js.map +1 -0
- package/dist/esm/components/media-image-field/media-image-view.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 +2 -8
- 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/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-multi-reference-input.st.css.js.map +1 -1
- package/dist/esm/components/reference/cell-multi-reference-view.st.css.js +2 -2
- 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-read-only-input/rich-content-form-read-only-input.st.css.js +2 -2
- 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/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-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-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/styles.global.css +1 -1
- package/dist/esm/utils/detect-field-type.js +12 -16
- package/dist/esm/utils/detect-field-type.js.map +1 -1
- package/dist/types/components/audio/actions/actions-menu/actions-menu.st.css.d.ts.map +1 -1
- package/dist/types/components/color-view/cell-color-view.st.css.d.ts.map +1 -1
- package/dist/types/components/color-view/color-view.st.css.d.ts.map +1 -1
- package/dist/types/components/field-validation-settings/field-validation-settings-input.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/thumbnail-replace-overlay.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-gallery/form-media-gallery-field.st.css.d.ts.map +1 -1
- package/dist/types/components/media-image-field/cell-media-image-edit.d.ts.map +1 -1
- package/dist/types/components/media-image-field/form-media-image-field.d.ts.map +1 -1
- package/dist/types/components/media-image-field/form-media-image-field.uni.driver.d.ts +8 -4
- package/dist/types/components/media-image-field/form-media-image-field.uni.driver.d.ts.map +1 -1
- package/dist/types/components/media-image-field/media-image-actions.d.ts +33 -0
- package/dist/types/components/media-image-field/media-image-actions.d.ts.map +1 -0
- package/dist/types/components/multi-document/cell-multi-document-edit.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-multi-reference-input.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-editor/rich-content-toolbar.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/utils/detect-field-type.d.ts +1 -1
- package/dist/types/utils/detect-field-type.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/__tests__/components/media-image-field/form-media-image-input.spec.tsx +69 -2
- package/src/__tests__/utils/detect-field-type.spec.ts +5 -5
- package/src/components/address/input/address-input.st.css.ts +2 -2
- package/src/components/audio/actions/actions-menu/actions-menu.st.css.ts +2 -2
- package/src/components/audio/audio-field/form-audio-field.st.css.ts +2 -2
- package/src/components/audio/audio-player/audio-player.st.css.ts +2 -2
- package/src/components/color-view/cell-color-view.st.css.ts +2 -2
- package/src/components/color-view/color-view.st.css.ts +2 -2
- package/src/components/delete-dialog/delete-dialog.st.css.ts +2 -2
- package/src/components/document/form-document-field.st.css.ts +2 -2
- package/src/components/exclamation/exclamation.st.css.ts +2 -2
- package/src/components/field-validation-settings/field-validation-settings-input.st.css.ts +2 -2
- package/src/components/highlighted-text/highlighted-text.st.css.ts +3 -3
- 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-gallery/form-media-gallery-field.st.css.ts +2 -2
- package/src/components/media-gallery/media-preview-modal.tsx +2 -1
- 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-image-field/cell-media-image-edit.st.css.ts +2 -2
- package/src/components/media-image-field/cell-media-image-edit.tsx +26 -129
- package/src/components/media-image-field/form-media-image-field.tsx +105 -23
- package/src/components/media-image-field/form-media-image-field.uni.driver.ts +45 -10
- package/src/components/media-image-field/media-image-actions.tsx +205 -0
- package/src/components/media-image-field/media-image-view.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 +3 -6
- 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-multi-reference-view.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/styles.global.css +1 -1
- package/src/utils/detect-field-type.ts +14 -16
|
@@ -5,7 +5,7 @@ import { classesRuntime, statesRuntime } from "../../stylable-esm-runtime.js";
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var _namespace_ = "
|
|
8
|
+
var _namespace_ = "fieldvalidationsettingsinput3114297852";
|
|
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":"fieldvalidationsettingsinput3114297852__root","specificValuesInput":"fieldvalidationsettingsinput3114297852__specificValuesInput"};
|
|
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_ = "highlightedtext270952920";
|
|
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":"highlightedtext270952920__root","substring":"highlightedtext270952920__substring"};
|
|
17
|
+
export var keyframes = {"highlighted":"highlightedtext270952920__highlighted","highlighted-match":"highlightedtext270952920__highlighted-match"};
|
|
18
18
|
export var layers = {};
|
|
19
19
|
export var containers = {};
|
|
20
20
|
export var stVars = {};
|
|
@@ -5,7 +5,7 @@ import { classesRuntime, statesRuntime } from "../../stylable-esm-runtime.js";
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var _namespace_ = "
|
|
8
|
+
var _namespace_ = "thumbnailreplaceoverlay357761885";
|
|
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":"thumbnailreplaceoverlay357761885__root","icon":"thumbnailreplaceoverlay357761885__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_ = "cellmediaeditshell2678266369";
|
|
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":"cellmediaeditshell2678266369__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_ = "pasteurlbutton3562431376";
|
|
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":"pasteurlbutton3562431376__root","iconButtonTooltip":"pasteurlbutton3562431376__iconButtonTooltip","iconButton":"pasteurlbutton3562431376__iconButton"};
|
|
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_ = "formmediagalleryfield445299435";
|
|
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":"formmediagalleryfield445299435__root","container":"formmediagalleryfield445299435__container","viewBox":"formmediagalleryfield445299435__viewBox","addItemWrapper":"formmediagalleryfield445299435__addItemWrapper","addItem":"formmediagalleryfield445299435__addItem","overlay":"formmediagalleryfield445299435__overlay","image":"formmediagalleryfield445299435__image","previewImage":"formmediagalleryfield445299435__previewImage","previewVideo":"formmediagalleryfield445299435__previewVideo"};
|
|
17
17
|
export var keyframes = {};
|
|
18
18
|
export var layers = {};
|
|
19
19
|
export var containers = {};
|
|
@@ -59,7 +59,7 @@ export const MediaPreviewModal: React.FC<MediaPreviewProps> = ({
|
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
return (
|
|
62
|
-
<Modal isOpen screen="full">
|
|
62
|
+
<Modal isOpen screen="full" onRequestClose={onClose}>
|
|
63
63
|
<MediaPreviewLayout
|
|
64
64
|
src={value}
|
|
65
65
|
onClose={onClose}
|
|
@@ -143,6 +143,7 @@ const MediaPreviewLayout: React.FC<MediaPreviewLayoutProps> = ({
|
|
|
143
143
|
size="small"
|
|
144
144
|
skin="light"
|
|
145
145
|
prefixIcon={<Replace />}
|
|
146
|
+
dataHook="preview-modal-replace-button"
|
|
146
147
|
onClick={onReplace}
|
|
147
148
|
disabled={readOnly}
|
|
148
149
|
>
|
|
@@ -5,7 +5,7 @@ import { classesRuntime, statesRuntime } from "../../stylable-esm-runtime.js";
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var _namespace_ = "
|
|
8
|
+
var _namespace_ = "mediaimage2523230102";
|
|
9
9
|
var _style_ = classesRuntime.bind(null, _namespace_);
|
|
10
10
|
|
|
11
11
|
export var cssStates = statesRuntime.bind(null, _namespace_);
|
|
@@ -13,12 +13,12 @@ export var style: import("@stylable/runtime").STFunction = _style_;
|
|
|
13
13
|
export var st: import("@stylable/runtime").STFunction = _style_;
|
|
14
14
|
|
|
15
15
|
export var namespace = _namespace_;
|
|
16
|
-
export var classes = {"root":"
|
|
16
|
+
export var classes = {"root":"mediaimage2523230102__root"};
|
|
17
17
|
export var keyframes = {};
|
|
18
18
|
export var layers = {};
|
|
19
19
|
export var containers = {};
|
|
20
20
|
export var stVars = {};
|
|
21
|
-
export var vars = {"wds-color-red-200":"--wds-color-red-200","wsr-color-R20":"--wsr-color-R20","wds-color-black-550":"--wds-color-black-550","wsr-color-D55":"--wsr-color-D55","from":"--
|
|
21
|
+
export var vars = {"wds-color-red-200":"--wds-color-red-200","wsr-color-R20":"--wsr-color-R20","wds-color-black-550":"--wds-color-black-550","wsr-color-D55":"--wsr-color-D55","from":"--mediaimage2523230102-from","to":"--mediaimage2523230102-to"};
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
|
|
@@ -5,7 +5,7 @@ import { classesRuntime, statesRuntime } from "../../../stylable-esm-runtime.js"
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var _namespace_ = "
|
|
8
|
+
var _namespace_ = "overlay404814470";
|
|
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":"overlay404814470__root","iconOverlay":"overlay404814470__iconOverlay"};
|
|
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_ = "cellmediaimageedit2941294818";
|
|
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":"cellmediaimageedit2941294818__root","view":"cellmediaimageedit2941294818__view","anchor":"cellmediaimageedit2941294818__anchor","anchorBox":"cellmediaimageedit2941294818__anchorBox","popoverContent":"cellmediaimageedit2941294818__popoverContent","image":"cellmediaimageedit2941294818__image","imageActions":"cellmediaimageedit2941294818__imageActions"};
|
|
17
17
|
export var keyframes = {};
|
|
18
18
|
export var layers = {};
|
|
19
19
|
export var containers = {};
|
|
@@ -5,19 +5,9 @@ import {
|
|
|
5
5
|
IconButton,
|
|
6
6
|
Input,
|
|
7
7
|
Popover,
|
|
8
|
-
PopoverMenu,
|
|
9
8
|
Tooltip,
|
|
10
9
|
} from '@wix/design-system';
|
|
11
|
-
import {
|
|
12
|
-
Add,
|
|
13
|
-
Delete,
|
|
14
|
-
Download,
|
|
15
|
-
Link,
|
|
16
|
-
LinkSmall,
|
|
17
|
-
Maximize,
|
|
18
|
-
MoreSmall,
|
|
19
|
-
Replace,
|
|
20
|
-
} from '@wix/wix-ui-icons-common/lazy';
|
|
10
|
+
import { Add, LinkSmall } from '@wix/wix-ui-icons-common/lazy';
|
|
21
11
|
import { ThumbnailSize } from '../../auto-field-types';
|
|
22
12
|
import { useTranslations } from '../../hooks';
|
|
23
13
|
import type { MediaImageValue } from '../../types/media-image';
|
|
@@ -30,14 +20,18 @@ import {
|
|
|
30
20
|
toMediaImageValue,
|
|
31
21
|
withAltText,
|
|
32
22
|
} from '../../utils/media-image-value';
|
|
33
|
-
import {
|
|
23
|
+
import { MEDIA_TYPES } from '../../utils/media-utils';
|
|
34
24
|
import {
|
|
35
25
|
CellMediaEditShell,
|
|
36
26
|
MediaFieldType,
|
|
37
27
|
useCellMediaEdit,
|
|
38
28
|
} from '../media-control';
|
|
39
|
-
import { MediaPreviewModal } from '../media-gallery/media-preview-modal';
|
|
40
29
|
import { MediaImage } from '../media-image';
|
|
30
|
+
import {
|
|
31
|
+
MediaImageActions,
|
|
32
|
+
MediaImagePreviewModal,
|
|
33
|
+
useMediaImageDownload,
|
|
34
|
+
} from './media-image-actions';
|
|
41
35
|
import { MediaImageView } from './media-image-view';
|
|
42
36
|
import { st, classes } from './cell-media-image-edit.st.css.js';
|
|
43
37
|
|
|
@@ -64,45 +58,6 @@ type Layer = PopoverLayer | 'pasteUrl' | 'loading';
|
|
|
64
58
|
const imageFromUrl = (url: string, current: MediaImageValue | null) =>
|
|
65
59
|
replaceImage(current, fromImageUrl(url));
|
|
66
60
|
|
|
67
|
-
interface MenuTriggerProps {
|
|
68
|
-
isOpen: boolean;
|
|
69
|
-
toggle: () => void;
|
|
70
|
-
/** Lets WDS put focus back here when the menu closes. */
|
|
71
|
-
buttonRef?: React.RefObject<HTMLElement>;
|
|
72
|
-
onOpenChange: (isOpen: boolean) => void;
|
|
73
|
-
ariaLabel: string;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
/** WDS shows the menu's open state only to its trigger, so the trigger
|
|
77
|
-
* reports it. */
|
|
78
|
-
const MenuTrigger: React.FC<MenuTriggerProps> = ({
|
|
79
|
-
isOpen,
|
|
80
|
-
toggle,
|
|
81
|
-
buttonRef,
|
|
82
|
-
onOpenChange,
|
|
83
|
-
ariaLabel,
|
|
84
|
-
}) => {
|
|
85
|
-
useEffect(() => {
|
|
86
|
-
onOpenChange(isOpen);
|
|
87
|
-
}, [isOpen, onOpenChange]);
|
|
88
|
-
|
|
89
|
-
return (
|
|
90
|
-
<IconButton
|
|
91
|
-
ref={buttonRef}
|
|
92
|
-
size="small"
|
|
93
|
-
skin="light"
|
|
94
|
-
priority="secondary"
|
|
95
|
-
dataHook="media-image-edit-more-button"
|
|
96
|
-
ariaLabel={ariaLabel}
|
|
97
|
-
aria-haspopup="menu"
|
|
98
|
-
aria-expanded={isOpen}
|
|
99
|
-
onClick={toggle}
|
|
100
|
-
>
|
|
101
|
-
<MoreSmall />
|
|
102
|
-
</IconButton>
|
|
103
|
-
);
|
|
104
|
-
};
|
|
105
|
-
|
|
106
61
|
/**
|
|
107
62
|
* Edits a `MEDIA_IMAGE` cell. An empty cell shows the add and paste-URL
|
|
108
63
|
* buttons. A cell with an image opens a popover with the image and its alt
|
|
@@ -158,14 +113,7 @@ export const CellMediaImageEdit: React.FC<CellMediaImageEditProps> = ({
|
|
|
158
113
|
value: isExternalMediaImage(image) ? image.url : undefined,
|
|
159
114
|
});
|
|
160
115
|
|
|
161
|
-
const handleDownload =
|
|
162
|
-
// The Media Manager can't make a download link for an external URL.
|
|
163
|
-
if (isExternalMediaImage(image)) {
|
|
164
|
-
executeDownloading(image.url);
|
|
165
|
-
} else if (src) {
|
|
166
|
-
downloadMedia(src);
|
|
167
|
-
}
|
|
168
|
-
}, [src, image, downloadMedia]);
|
|
116
|
+
const handleDownload = useMediaImageDownload(image, downloadMedia);
|
|
169
117
|
|
|
170
118
|
const commit = useCallback(() => {
|
|
171
119
|
setPopoverLayer('none');
|
|
@@ -265,7 +213,9 @@ export const CellMediaImageEdit: React.FC<CellMediaImageEditProps> = ({
|
|
|
265
213
|
shown={openLayer === 'popover' || openLayer === 'menu'}
|
|
266
214
|
appendTo="window"
|
|
267
215
|
placement="bottom-start"
|
|
268
|
-
|
|
216
|
+
// The anchor sits inside the cell's 1px border. Figma puts the
|
|
217
|
+
// popover 4px under the border, aligned with its left edge.
|
|
218
|
+
moveBy={{ x: -1, y: 5 }}
|
|
269
219
|
zIndex={5001}
|
|
270
220
|
animate
|
|
271
221
|
flip
|
|
@@ -301,64 +251,16 @@ export const CellMediaImageEdit: React.FC<CellMediaImageEditProps> = ({
|
|
|
301
251
|
menuOpen: popoverLayer === 'menu',
|
|
302
252
|
})}
|
|
303
253
|
>
|
|
304
|
-
<
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
onClick={handleCallMedia}
|
|
315
|
-
>
|
|
316
|
-
<Replace />
|
|
317
|
-
</IconButton>
|
|
318
|
-
</Tooltip>
|
|
319
|
-
<PopoverMenu
|
|
320
|
-
textSize="small"
|
|
321
|
-
appendTo="window"
|
|
322
|
-
zIndex={5002}
|
|
323
|
-
triggerElement={({ isOpen, toggle, ref }) => (
|
|
324
|
-
<MenuTrigger
|
|
325
|
-
isOpen={isOpen}
|
|
326
|
-
toggle={toggle}
|
|
327
|
-
buttonRef={ref}
|
|
328
|
-
onOpenChange={handleMenuOpenChange}
|
|
329
|
-
ariaLabel={t(
|
|
330
|
-
'auto-patterns.fields.more_actions_tooltip',
|
|
331
|
-
)}
|
|
332
|
-
/>
|
|
333
|
-
)}
|
|
334
|
-
>
|
|
335
|
-
<PopoverMenu.MenuItem
|
|
336
|
-
dataHook="media-image-edit-action-replace-url"
|
|
337
|
-
text={t('CMS.image.replaceWithUrl.button')}
|
|
338
|
-
prefixIcon={<Link />}
|
|
339
|
-
onClick={openPasteUrl}
|
|
340
|
-
/>
|
|
341
|
-
<PopoverMenu.MenuItem
|
|
342
|
-
dataHook="media-image-edit-action-preview"
|
|
343
|
-
text={t('CMS.mediaGallery.preview')}
|
|
344
|
-
prefixIcon={<Maximize />}
|
|
345
|
-
onClick={() => setPopoverLayer('preview')}
|
|
346
|
-
/>
|
|
347
|
-
<PopoverMenu.MenuItem
|
|
348
|
-
dataHook="media-image-edit-action-download"
|
|
349
|
-
text={t('CMS.image.download')}
|
|
350
|
-
prefixIcon={<Download />}
|
|
351
|
-
onClick={handleDownload}
|
|
352
|
-
/>
|
|
353
|
-
<PopoverMenu.Divider />
|
|
354
|
-
<PopoverMenu.MenuItem
|
|
355
|
-
dataHook="media-image-edit-action-delete"
|
|
356
|
-
text={t('CMS.image.clear')}
|
|
357
|
-
skin="destructive"
|
|
358
|
-
prefixIcon={<Delete />}
|
|
359
|
-
onClick={handleDelete}
|
|
360
|
-
/>
|
|
361
|
-
</PopoverMenu>
|
|
254
|
+
<MediaImageActions
|
|
255
|
+
dataHook="media-image-edit"
|
|
256
|
+
onReplace={handleCallMedia}
|
|
257
|
+
onReplaceWithUrl={openPasteUrl}
|
|
258
|
+
onPreview={() => setPopoverLayer('preview')}
|
|
259
|
+
onDownload={handleDownload}
|
|
260
|
+
onDelete={handleDelete}
|
|
261
|
+
onMenuOpenChange={handleMenuOpenChange}
|
|
262
|
+
menuZIndex={5002}
|
|
263
|
+
/>
|
|
362
264
|
</div>
|
|
363
265
|
</div>
|
|
364
266
|
</FormField>
|
|
@@ -382,18 +284,13 @@ export const CellMediaImageEdit: React.FC<CellMediaImageEditProps> = ({
|
|
|
382
284
|
)}
|
|
383
285
|
</CellMediaEditShell>
|
|
384
286
|
{image && (
|
|
385
|
-
<
|
|
287
|
+
<MediaImagePreviewModal
|
|
386
288
|
isOpen={popoverLayer === 'preview'}
|
|
387
|
-
|
|
289
|
+
image={image}
|
|
388
290
|
onClose={() => setPopoverLayer('popover')}
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
textKeys={{
|
|
393
|
-
replace: 'CMS.image.replace',
|
|
394
|
-
download: 'CMS.image.download',
|
|
395
|
-
delete: 'CMS.image.clear',
|
|
396
|
-
}}
|
|
291
|
+
onReplace={handleCallMedia}
|
|
292
|
+
onDelete={handleDelete}
|
|
293
|
+
onDownload={handleDownload}
|
|
397
294
|
/>
|
|
398
295
|
)}
|
|
399
296
|
</>
|
|
@@ -1,9 +1,17 @@
|
|
|
1
1
|
import type { FC } from 'react';
|
|
2
|
-
import React, { useCallback, useRef } from 'react';
|
|
2
|
+
import React, { useCallback, useRef, useState } from 'react';
|
|
3
3
|
import type { FormFieldProps } from '@wix/design-system';
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
Box,
|
|
6
|
+
FormField,
|
|
7
|
+
Image,
|
|
8
|
+
ImageViewer,
|
|
9
|
+
Input,
|
|
10
|
+
MediaOverlay,
|
|
11
|
+
} from '@wix/design-system';
|
|
5
12
|
import { useIsMobile, useWixPatternsContainer } from '@wix/bex-core/react';
|
|
6
13
|
|
|
14
|
+
import { Z_INDEX_MODAL_POPOVER } from '../common';
|
|
7
15
|
import type { ControlledInputProps } from '../../types/controlled-input';
|
|
8
16
|
import type { MediaImageValue } from '../../types/media-image';
|
|
9
17
|
import { useMergedRef, useTranslations } from '../../hooks';
|
|
@@ -11,12 +19,25 @@ import { getImageSource } from '../../utils/get-image-source';
|
|
|
11
19
|
import { getImageUrl } from '../../utils/get-image-url';
|
|
12
20
|
import { MEDIA_HEIGHT, MEDIA_MAX_WIDTH } from '../../utils/media-constants';
|
|
13
21
|
import {
|
|
22
|
+
fromImageUrl,
|
|
14
23
|
fromMediaManagerPick,
|
|
24
|
+
isExternalMediaImage,
|
|
25
|
+
replaceImage,
|
|
15
26
|
toMediaImageValue,
|
|
16
27
|
withAltText,
|
|
17
28
|
} from '../../utils/media-image-value';
|
|
18
29
|
import { MEDIA_TYPES } from '../../utils/media-utils';
|
|
19
|
-
import {
|
|
30
|
+
import {
|
|
31
|
+
MediaFieldType,
|
|
32
|
+
PasteURLForm,
|
|
33
|
+
useMediaControl,
|
|
34
|
+
usePasteURLForm,
|
|
35
|
+
} from '../media-control';
|
|
36
|
+
import {
|
|
37
|
+
MediaImageActions,
|
|
38
|
+
MediaImagePreviewModal,
|
|
39
|
+
useMediaImageDownload,
|
|
40
|
+
} from './media-image-actions';
|
|
20
41
|
|
|
21
42
|
interface ImageViewerActions {
|
|
22
43
|
focus: () => void;
|
|
@@ -77,7 +98,7 @@ export const FormMediaImageField: FC<FormMediaImageFieldProps> = ({
|
|
|
77
98
|
[onChange],
|
|
78
99
|
);
|
|
79
100
|
|
|
80
|
-
const { callMedia,
|
|
101
|
+
const { callMedia, downloadMedia } = useMediaControl({
|
|
81
102
|
mediaType: MEDIA_TYPES.IMAGE,
|
|
82
103
|
value: getImageSource(image),
|
|
83
104
|
onChange: handlePick,
|
|
@@ -85,9 +106,28 @@ export const FormMediaImageField: FC<FormMediaImageFieldProps> = ({
|
|
|
85
106
|
readOnly,
|
|
86
107
|
onBlur,
|
|
87
108
|
inputRef,
|
|
88
|
-
initialLoading: true,
|
|
89
109
|
});
|
|
90
110
|
|
|
111
|
+
const pasteUrlForm = usePasteURLForm({
|
|
112
|
+
onChange: (url) =>
|
|
113
|
+
onChange(replaceImage(imageRef.current, fromImageUrl(url))),
|
|
114
|
+
});
|
|
115
|
+
const openPasteUrl = pasteUrlForm.onOpen({
|
|
116
|
+
title: t('CMS.image.replaceWithUrl.title'),
|
|
117
|
+
value: isExternalMediaImage(image) ? image.url : undefined,
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
const [isPreviewOpen, setIsPreviewOpen] = useState(false);
|
|
121
|
+
const handleDownload = useMediaImageDownload(image, downloadMedia);
|
|
122
|
+
const handleDelete = useCallback(() => {
|
|
123
|
+
setIsPreviewOpen(false);
|
|
124
|
+
onChange(null);
|
|
125
|
+
}, [onChange]);
|
|
126
|
+
const handlePreviewReplace = useCallback(() => {
|
|
127
|
+
setIsPreviewOpen(false);
|
|
128
|
+
callMedia();
|
|
129
|
+
}, [callMedia]);
|
|
130
|
+
|
|
91
131
|
const canEdit = !isMobile && !readOnly;
|
|
92
132
|
|
|
93
133
|
const handleAltTextChange = (e: React.ChangeEvent<HTMLInputElement>) => {
|
|
@@ -100,24 +140,47 @@ export const FormMediaImageField: FC<FormMediaImageFieldProps> = ({
|
|
|
100
140
|
<Box dataHook={dataHook} gap="SP4" width="100%">
|
|
101
141
|
<Box width="100%" maxWidth={MEDIA_MAX_WIDTH} flexShrink={0}>
|
|
102
142
|
<FormField {...imageFormFieldProps} dataHook="media-image-field-image">
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
143
|
+
{image ? (
|
|
144
|
+
<MediaOverlay
|
|
145
|
+
dataHook="media-image-field-overlay"
|
|
146
|
+
hoverSkin="dark"
|
|
147
|
+
media={
|
|
148
|
+
<Image
|
|
149
|
+
dataHook="media-image-field-current-image"
|
|
150
|
+
src={getImageUrl(image)}
|
|
151
|
+
width="100%"
|
|
152
|
+
height={MEDIA_HEIGHT}
|
|
153
|
+
fit="cover"
|
|
154
|
+
/>
|
|
155
|
+
}
|
|
156
|
+
>
|
|
157
|
+
<MediaOverlay.Content placement="middle" visible="hover">
|
|
158
|
+
<Box gap="SP2">
|
|
159
|
+
<MediaImageActions
|
|
160
|
+
dataHook="media-image-field"
|
|
161
|
+
onReplace={canEdit ? callMedia : undefined}
|
|
162
|
+
onReplaceWithUrl={readOnly ? undefined : openPasteUrl}
|
|
163
|
+
onPreview={() => setIsPreviewOpen(true)}
|
|
164
|
+
onDownload={handleDownload}
|
|
165
|
+
onDelete={readOnly ? undefined : handleDelete}
|
|
166
|
+
menuZIndex={Z_INDEX_MODAL_POPOVER}
|
|
167
|
+
/>
|
|
168
|
+
</Box>
|
|
169
|
+
</MediaOverlay.Content>
|
|
170
|
+
</MediaOverlay>
|
|
171
|
+
) : (
|
|
172
|
+
<ImageViewer
|
|
173
|
+
// Only the empty state has a focusable control, so this is the
|
|
174
|
+
// only place inputRef can land.
|
|
175
|
+
ref={setInputRef}
|
|
176
|
+
dataHook="media-image-field-viewer"
|
|
177
|
+
onAddImage={canEdit ? callMedia : undefined}
|
|
178
|
+
disabled={!canEdit}
|
|
179
|
+
addImageInfo={translate('cairo.add-image.tooltip')}
|
|
180
|
+
height={MEDIA_HEIGHT}
|
|
181
|
+
width="100%"
|
|
182
|
+
/>
|
|
183
|
+
)}
|
|
121
184
|
</FormField>
|
|
122
185
|
</Box>
|
|
123
186
|
{image && (
|
|
@@ -133,6 +196,25 @@ export const FormMediaImageField: FC<FormMediaImageFieldProps> = ({
|
|
|
133
196
|
</FormField>
|
|
134
197
|
</Box>
|
|
135
198
|
)}
|
|
199
|
+
<PasteURLForm
|
|
200
|
+
title={pasteUrlForm.title}
|
|
201
|
+
value={pasteUrlForm.value}
|
|
202
|
+
show={pasteUrlForm.isOpen}
|
|
203
|
+
closeModal={pasteUrlForm.onClose}
|
|
204
|
+
onSave={pasteUrlForm.onSave}
|
|
205
|
+
fieldType={MediaFieldType.image}
|
|
206
|
+
/>
|
|
207
|
+
{image && (
|
|
208
|
+
<MediaImagePreviewModal
|
|
209
|
+
isOpen={isPreviewOpen}
|
|
210
|
+
image={image}
|
|
211
|
+
onClose={() => setIsPreviewOpen(false)}
|
|
212
|
+
onReplace={handlePreviewReplace}
|
|
213
|
+
onDelete={handleDelete}
|
|
214
|
+
onDownload={handleDownload}
|
|
215
|
+
readOnly={!canEdit}
|
|
216
|
+
/>
|
|
217
|
+
)}
|
|
136
218
|
</Box>
|
|
137
219
|
);
|
|
138
220
|
};
|