@wix/patterns-fields 1.40.0 → 1.41.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.js +12 -10
- 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-input.js +195 -0
- package/dist/cjs/components/color-view/cell-color-input.js.map +1 -0
- package/dist/cjs/components/color-view/cell-color-view.js +89 -0
- package/dist/cjs/components/color-view/cell-color-view.js.map +1 -0
- package/dist/cjs/components/color-view/cell-color-view.st.css +8 -0
- package/dist/cjs/components/color-view/cell-color-view.st.css.js +25 -0
- package/dist/cjs/components/color-view/cell-color-view.st.css.js.map +1 -0
- package/dist/cjs/components/color-view/color-input.js +33 -27
- package/dist/cjs/components/color-view/color-input.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/color-view/hex.js +16 -0
- package/dist/cjs/components/color-view/hex.js.map +1 -0
- package/dist/cjs/components/color-view/index.js +18 -0
- package/dist/cjs/components/color-view/index.js.map +1 -1
- package/dist/cjs/components/delete-dialog/delete-dialog.st.css.js +3 -3
- package/dist/cjs/components/delete-dialog/delete-dialog.st.css.js.map +1 -1
- package/dist/cjs/components/document/form-document-field.st.css.js +7 -7
- package/dist/cjs/components/document/form-document-field.st.css.js.map +1 -1
- package/dist/cjs/components/exclamation/exclamation.st.css.js +5 -5
- package/dist/cjs/components/exclamation/exclamation.st.css.js.map +1 -1
- package/dist/cjs/components/highlighted-text/highlighted-text.st.css.js +5 -5
- package/dist/cjs/components/highlighted-text/highlighted-text.st.css.js.map +1 -1
- package/dist/cjs/components/image/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-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/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-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/cell-rich-content-input.js +4 -3
- package/dist/cjs/components/rich-content/cell-rich-content-input.js.map +1 -1
- package/dist/cjs/components/rich-content/cell-rich-content-view.js +3 -2
- package/dist/cjs/components/rich-content/cell-rich-content-view.js.map +1 -1
- package/dist/cjs/components/rich-content/hooks/use-plain-text-rich-content.js +1 -1
- package/dist/cjs/components/rich-content/hooks/use-plain-text-rich-content.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/hooks.js +1 -1
- package/dist/cjs/components/rich-content/rich-content-input/rich-content-common/hooks.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/plugins.js +0 -5
- package/dist/cjs/components/rich-content/rich-content-input/rich-content-editor/plugins.js.map +1 -1
- package/dist/cjs/components/rich-content/rich-content-input/rich-content-editor/rich-content-editor.js +169 -192
- package/dist/cjs/components/rich-content/rich-content-input/rich-content-editor/rich-content-editor.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.js +52 -36
- package/dist/cjs/components/rich-content/rich-content-input/rich-content-editor/rich-content-toolbar.js.map +1 -1
- package/dist/cjs/components/rich-content/rich-content-input/rich-content-editor/rich-content-toolbar.st.css +7 -0
- package/dist/cjs/components/rich-content/rich-content-input/rich-content-editor/rich-content-toolbar.st.css.js +5 -4
- package/dist/cjs/components/rich-content/rich-content-input/rich-content-editor/rich-content-toolbar.st.css.js.map +1 -1
- package/dist/cjs/components/rich-content/rich-content-input/rich-content-viewer/rich-content-viewer.js +10 -10
- package/dist/cjs/components/rich-content/rich-content-input/rich-content-viewer/rich-content-viewer.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/time-input/form-time-input.js +21 -2
- package/dist/cjs/components/time-input/form-time-input.js.map +1 -1
- package/dist/cjs/styles.global.css +1 -1
- package/dist/cjs/validations/rich-content.js +2 -3
- package/dist/cjs/validations/rich-content.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.js +2 -0
- 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-field/form-audio-field.st.css.js.map +1 -1
- package/dist/esm/components/audio/audio-player/audio-player.st.css.js +2 -2
- package/dist/esm/components/color-view/cell-color-input.js +104 -0
- package/dist/esm/components/color-view/cell-color-input.js.map +1 -0
- package/dist/esm/components/color-view/cell-color-view.js +25 -0
- package/dist/esm/components/color-view/cell-color-view.js.map +1 -0
- package/dist/esm/components/color-view/cell-color-view.st.css +8 -0
- package/dist/esm/components/color-view/cell-color-view.st.css.js +15 -0
- package/dist/esm/components/color-view/cell-color-view.st.css.js.map +1 -0
- package/dist/esm/components/color-view/color-input.js +12 -12
- package/dist/esm/components/color-view/color-input.js.map +1 -1
- package/dist/esm/components/color-view/color-view.st.css.js +2 -2
- package/dist/esm/components/color-view/hex.js +9 -0
- package/dist/esm/components/color-view/hex.js.map +1 -0
- package/dist/esm/components/color-view/index.js +3 -0
- package/dist/esm/components/color-view/index.js.map +1 -1
- package/dist/esm/components/delete-dialog/delete-dialog.st.css.js +2 -2
- package/dist/esm/components/delete-dialog/delete-dialog.st.css.js.map +1 -1
- package/dist/esm/components/document/form-document-field.st.css.js +2 -2
- package/dist/esm/components/exclamation/exclamation.st.css.js +2 -2
- package/dist/esm/components/exclamation/exclamation.st.css.js.map +1 -1
- package/dist/esm/components/highlighted-text/highlighted-text.st.css.js +3 -3
- package/dist/esm/components/image/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/paste-url-button.st.css.js +2 -2
- 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-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/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-reference-input.st.css.js +2 -2
- package/dist/esm/components/rich-content/cell-rich-content-input.js +4 -3
- package/dist/esm/components/rich-content/cell-rich-content-input.js.map +1 -1
- package/dist/esm/components/rich-content/cell-rich-content-view.js +3 -4
- package/dist/esm/components/rich-content/cell-rich-content-view.js.map +1 -1
- package/dist/esm/components/rich-content/hooks/use-plain-text-rich-content.js +2 -2
- package/dist/esm/components/rich-content/hooks/use-plain-text-rich-content.js.map +1 -1
- package/dist/esm/components/rich-content/rich-content-input/default-value-input/rich-content-default-value-input.st.css.js +2 -2
- package/dist/esm/components/rich-content/rich-content-input/default-value-input/rich-content-default-value-input.st.css.js.map +1 -1
- package/dist/esm/components/rich-content/rich-content-input/form-input/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/fullscreen-modal/fullscreen-modal.st.css.js.map +1 -1
- package/dist/esm/components/rich-content/rich-content-input/rich-content-common/hooks.js +2 -2
- package/dist/esm/components/rich-content/rich-content-input/rich-content-common/hooks.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/toggle-fullscreen-button/toggle-fullscreen-button.st.css.js +2 -2
- package/dist/esm/components/rich-content/rich-content-input/rich-content-editor/plugins.js +0 -5
- package/dist/esm/components/rich-content/rich-content-input/rich-content-editor/plugins.js.map +1 -1
- package/dist/esm/components/rich-content/rich-content-input/rich-content-editor/rich-content-editor.js +112 -135
- package/dist/esm/components/rich-content/rich-content-input/rich-content-editor/rich-content-editor.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-editor.st.css.js.map +1 -1
- package/dist/esm/components/rich-content/rich-content-input/rich-content-editor/rich-content-toolbar.js +27 -35
- package/dist/esm/components/rich-content/rich-content-input/rich-content-editor/rich-content-toolbar.js.map +1 -1
- package/dist/esm/components/rich-content/rich-content-input/rich-content-editor/rich-content-toolbar.st.css +7 -0
- 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.js +2 -2
- package/dist/esm/components/rich-content/rich-content-input/rich-content-viewer/rich-content-viewer.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-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/time-input/form-time-input.js +8 -3
- package/dist/esm/components/time-input/form-time-input.js.map +1 -1
- package/dist/esm/styles.global.css +1 -1
- package/dist/esm/validations/rich-content.js +3 -4
- package/dist/esm/validations/rich-content.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/audio/audio-field/form-audio-field.d.ts.map +1 -1
- package/dist/types/components/audio/audio-field/form-audio-field.st.css.d.ts.map +1 -1
- package/dist/types/components/color-view/cell-color-input.d.ts +23 -0
- package/dist/types/components/color-view/cell-color-input.d.ts.map +1 -0
- package/dist/types/components/color-view/cell-color-view.d.ts +15 -0
- package/dist/types/components/color-view/cell-color-view.d.ts.map +1 -0
- package/dist/types/components/color-view/cell-color-view.st.css.d.ts +16 -0
- package/dist/types/components/color-view/cell-color-view.st.css.d.ts.map +1 -0
- package/dist/types/components/color-view/color-input.d.ts.map +1 -1
- package/dist/types/components/color-view/hex.d.ts +5 -0
- package/dist/types/components/color-view/hex.d.ts.map +1 -0
- package/dist/types/components/color-view/index.d.ts +3 -0
- package/dist/types/components/color-view/index.d.ts.map +1 -1
- package/dist/types/components/delete-dialog/delete-dialog.st.css.d.ts.map +1 -1
- package/dist/types/components/exclamation/exclamation.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/media-image.st.css.d.ts.map +1 -1
- package/dist/types/components/multi-document/multi-document-input/form-multi-document.st.css.d.ts.map +1 -1
- package/dist/types/components/rich-content/cell-rich-content-input.d.ts +2 -2
- package/dist/types/components/rich-content/cell-rich-content-input.d.ts.map +1 -1
- package/dist/types/components/rich-content/cell-rich-content-view.d.ts.map +1 -1
- package/dist/types/components/rich-content/hooks/use-plain-text-rich-content.d.ts +2 -2
- package/dist/types/components/rich-content/hooks/use-plain-text-rich-content.d.ts.map +1 -1
- package/dist/types/components/rich-content/rich-content-input/default-value-input/rich-content-default-value-input.st.css.d.ts.map +1 -1
- package/dist/types/components/rich-content/rich-content-input/form-input/use-rich-content-form-input.d.ts +2 -2
- package/dist/types/components/rich-content/rich-content-input/hooks.d.ts +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/hooks.d.ts +3 -3
- package/dist/types/components/rich-content/rich-content-input/rich-content-common/hooks.d.ts.map +1 -1
- package/dist/types/components/rich-content/rich-content-input/rich-content-editor/plugins.d.ts +2 -2
- package/dist/types/components/rich-content/rich-content-input/rich-content-editor/plugins.d.ts.map +1 -1
- package/dist/types/components/rich-content/rich-content-input/rich-content-editor/rich-content-editor.d.ts +12 -11
- package/dist/types/components/rich-content/rich-content-input/rich-content-editor/rich-content-editor.d.ts.map +1 -1
- package/dist/types/components/rich-content/rich-content-input/rich-content-editor/rich-content-editor.st.css.d.ts.map +1 -1
- package/dist/types/components/rich-content/rich-content-input/rich-content-editor/rich-content-toolbar.d.ts +2 -15
- package/dist/types/components/rich-content/rich-content-input/rich-content-editor/rich-content-toolbar.d.ts.map +1 -1
- package/dist/types/components/rich-content/rich-content-input/rich-content-editor/rich-content-toolbar.st.css.d.ts +1 -0
- 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-content/rich-content-input/rich-content-viewer/plugins.d.ts +1 -1
- package/dist/types/components/rich-content/rich-content-input/rich-content-viewer/plugins.d.ts.map +1 -1
- package/dist/types/components/rich-content/rich-content-input/rich-content-viewer/rich-content-viewer.d.ts +5 -3
- package/dist/types/components/rich-content/rich-content-input/rich-content-viewer/rich-content-viewer.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/time-input/form-time-input.d.ts.map +1 -1
- package/dist/types/validations/rich-content.d.ts +3 -3
- package/dist/types/validations/rich-content.d.ts.map +1 -1
- package/package.json +5 -5
- package/src/__tests__/components/rich-content-editor.spec.tsx +63 -72
- package/src/__tests__/validations/rich-content.spec.ts +4 -8
- 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-field/form-audio-field.tsx +2 -0
- package/src/components/audio/audio-player/audio-player.st.css.ts +2 -2
- package/src/components/color-view/cell-color-input.tsx +200 -0
- package/src/components/color-view/cell-color-view.st.css +8 -0
- package/src/components/color-view/cell-color-view.st.css.ts +25 -0
- package/src/components/color-view/cell-color-view.tsx +52 -0
- package/src/components/color-view/color-input.tsx +23 -17
- package/src/components/color-view/color-view.st.css.ts +2 -2
- package/src/components/color-view/hex.ts +13 -0
- package/src/components/color-view/index.ts +3 -0
- package/src/components/delete-dialog/delete-dialog.st.css.ts +2 -2
- package/src/components/document/form-document-field.st.css.ts +2 -2
- package/src/components/exclamation/exclamation.st.css.ts +2 -2
- package/src/components/highlighted-text/highlighted-text.st.css.ts +3 -3
- package/src/components/image/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-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/multi-document-input/form-multi-document.st.css.ts +2 -2
- package/src/components/reference/cell-reference-input.st.css.ts +2 -2
- package/src/components/rich-content/cell-rich-content-input.tsx +11 -14
- package/src/components/rich-content/cell-rich-content-view.tsx +3 -4
- package/src/components/rich-content/hooks/use-plain-text-rich-content.ts +4 -4
- 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/hooks.ts +5 -5
- 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/plugins.ts +0 -6
- 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-editor.tsx +346 -355
- package/src/components/rich-content/rich-content-input/rich-content-editor/rich-content-toolbar.st.css +7 -0
- 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-editor/rich-content-toolbar.tsx +35 -62
- package/src/components/rich-content/rich-content-input/rich-content-viewer/rich-content-viewer.st.css.ts +2 -2
- package/src/components/rich-content/rich-content-input/rich-content-viewer/rich-content-viewer.tsx +8 -9
- 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/time-input/form-time-input.tsx +21 -4
- package/src/styles.global.css +1 -1
- package/src/validations/rich-content.ts +6 -7
|
@@ -5,15 +5,15 @@ exports.vars = exports.style = exports.stVars = exports.st = exports.namespace =
|
|
|
5
5
|
var _stylableEsmRuntime = require("../../../stylable-esm-runtime.js");
|
|
6
6
|
// @ts-nocheck
|
|
7
7
|
|
|
8
|
-
var _namespace_ = "
|
|
8
|
+
var _namespace_ = "addressinput3227018630";
|
|
9
9
|
var _style_ = _stylableEsmRuntime.classesRuntime.bind(null, _namespace_);
|
|
10
10
|
var cssStates = exports.cssStates = _stylableEsmRuntime.statesRuntime.bind(null, _namespace_);
|
|
11
11
|
var style = exports.style = _style_;
|
|
12
12
|
var st = exports.st = _style_;
|
|
13
13
|
var namespace = exports.namespace = _namespace_;
|
|
14
14
|
var classes = exports.classes = {
|
|
15
|
-
"root": "
|
|
16
|
-
"tableAddressInput": "
|
|
15
|
+
"root": "addressinput3227018630__root",
|
|
16
|
+
"tableAddressInput": "addressinput3227018630__tableAddressInput"
|
|
17
17
|
};
|
|
18
18
|
var keyframes = exports.keyframes = {};
|
|
19
19
|
var layers = exports.layers = {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_stylableEsmRuntime","require","_namespace_","_style_","classesRuntime","bind","cssStates","exports","statesRuntime","style","st","namespace","classes","keyframes","layers","containers","stVars","vars"],"sources":["../../../../../src/components/address/input/address-input.st.css.ts"],"sourcesContent":["// @ts-nocheck\n\n\nimport { classesRuntime, statesRuntime } from \"../../../stylable-esm-runtime.js\";\n\n\n\nvar _namespace_ = \"
|
|
1
|
+
{"version":3,"names":["_stylableEsmRuntime","require","_namespace_","_style_","classesRuntime","bind","cssStates","exports","statesRuntime","style","st","namespace","classes","keyframes","layers","containers","stVars","vars"],"sources":["../../../../../src/components/address/input/address-input.st.css.ts"],"sourcesContent":["// @ts-nocheck\n\n\nimport { classesRuntime, statesRuntime } from \"../../../stylable-esm-runtime.js\";\n\n\n\nvar _namespace_ = \"addressinput3227018630\";\nvar _style_ = classesRuntime.bind(null, _namespace_);\n\nexport var cssStates = statesRuntime.bind(null, _namespace_);\nexport var style: import(\"@stylable/runtime\").STFunction = _style_;\nexport var st: import(\"@stylable/runtime\").STFunction = _style_;\n\nexport var namespace = _namespace_;\nexport var classes = {\"root\":\"addressinput3227018630__root\",\"tableAddressInput\":\"addressinput3227018630__tableAddressInput\"};\nexport var keyframes = {}; \nexport var layers = {};\nexport var containers = {};\nexport var stVars = {}; \nexport var vars = {}; \n\n\n\n\n"],"mappings":";;;;AAGA,IAAAA,mBAAA,GAAAC,OAAA;AAHA;;AAOA,IAAIC,WAAW,GAAG,wBAAwB;AAC1C,IAAIC,OAAO,GAAGC,kCAAc,CAACC,IAAI,CAAC,IAAI,EAAEH,WAAW,CAAC;AAE7C,IAAII,SAAS,GAAAC,OAAA,CAAAD,SAAA,GAAGE,iCAAa,CAACH,IAAI,CAAC,IAAI,EAAEH,WAAW,CAAC;AACrD,IAAIO,KAA6C,GAAAF,OAAA,CAAAE,KAAA,GAAGN,OAAO;AAC3D,IAAIO,EAA0C,GAAAH,OAAA,CAAAG,EAAA,GAAGP,OAAO;AAExD,IAAIQ,SAAS,GAAAJ,OAAA,CAAAI,SAAA,GAAGT,WAAW;AAC3B,IAAIU,OAAO,GAAAL,OAAA,CAAAK,OAAA,GAAG;EAAC,MAAM,EAAC,8BAA8B;EAAC,mBAAmB,EAAC;AAA2C,CAAC;AACrH,IAAIC,SAAS,GAAAN,OAAA,CAAAM,SAAA,GAAG,CAAC,CAAC;AAClB,IAAIC,MAAM,GAAAP,OAAA,CAAAO,MAAA,GAAG,CAAC,CAAC;AACf,IAAIC,UAAU,GAAAR,OAAA,CAAAQ,UAAA,GAAG,CAAC,CAAC;AACnB,IAAIC,MAAM,GAAAT,OAAA,CAAAS,MAAA,GAAG,CAAC,CAAC;AACf,IAAIC,IAAI,GAAAV,OAAA,CAAAU,IAAA,GAAG,CAAC,CAAC","ignoreList":[]}
|
|
@@ -5,15 +5,15 @@ exports.vars = exports.style = exports.stVars = exports.st = exports.namespace =
|
|
|
5
5
|
var _stylableEsmRuntime = require("../../../../stylable-esm-runtime.js");
|
|
6
6
|
// @ts-nocheck
|
|
7
7
|
|
|
8
|
-
var _namespace_ = "
|
|
8
|
+
var _namespace_ = "actionsmenu1379452986";
|
|
9
9
|
var _style_ = _stylableEsmRuntime.classesRuntime.bind(null, _namespace_);
|
|
10
10
|
var cssStates = exports.cssStates = _stylableEsmRuntime.statesRuntime.bind(null, _namespace_);
|
|
11
11
|
var style = exports.style = _style_;
|
|
12
12
|
var st = exports.st = _style_;
|
|
13
13
|
var namespace = exports.namespace = _namespace_;
|
|
14
14
|
var classes = exports.classes = {
|
|
15
|
-
"root": "
|
|
16
|
-
"action": "
|
|
15
|
+
"root": "actionsmenu1379452986__root",
|
|
16
|
+
"action": "actionsmenu1379452986__action"
|
|
17
17
|
};
|
|
18
18
|
var keyframes = exports.keyframes = {};
|
|
19
19
|
var layers = exports.layers = {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_stylableEsmRuntime","require","_namespace_","_style_","classesRuntime","bind","cssStates","exports","statesRuntime","style","st","namespace","classes","keyframes","layers","containers","stVars","vars"],"sources":["../../../../../../src/components/audio/actions/actions-menu/actions-menu.st.css.ts"],"sourcesContent":["// @ts-nocheck\n\n\nimport { classesRuntime, statesRuntime } from \"../../../../stylable-esm-runtime.js\";\n\n\n\nvar _namespace_ = \"
|
|
1
|
+
{"version":3,"names":["_stylableEsmRuntime","require","_namespace_","_style_","classesRuntime","bind","cssStates","exports","statesRuntime","style","st","namespace","classes","keyframes","layers","containers","stVars","vars"],"sources":["../../../../../../src/components/audio/actions/actions-menu/actions-menu.st.css.ts"],"sourcesContent":["// @ts-nocheck\n\n\nimport { classesRuntime, statesRuntime } from \"../../../../stylable-esm-runtime.js\";\n\n\n\nvar _namespace_ = \"actionsmenu1379452986\";\nvar _style_ = classesRuntime.bind(null, _namespace_);\n\nexport var cssStates = statesRuntime.bind(null, _namespace_);\nexport var style: import(\"@stylable/runtime\").STFunction = _style_;\nexport var st: import(\"@stylable/runtime\").STFunction = _style_;\n\nexport var namespace = _namespace_;\nexport var classes = {\"root\":\"actionsmenu1379452986__root\",\"action\":\"actionsmenu1379452986__action\"};\nexport var keyframes = {}; \nexport var layers = {};\nexport var containers = {};\nexport var stVars = {}; \nexport var vars = {\"wds-space-100\":\"--wds-space-100\"}; \n\n\n\n\n"],"mappings":";;;;AAGA,IAAAA,mBAAA,GAAAC,OAAA;AAHA;;AAOA,IAAIC,WAAW,GAAG,uBAAuB;AACzC,IAAIC,OAAO,GAAGC,kCAAc,CAACC,IAAI,CAAC,IAAI,EAAEH,WAAW,CAAC;AAE7C,IAAII,SAAS,GAAAC,OAAA,CAAAD,SAAA,GAAGE,iCAAa,CAACH,IAAI,CAAC,IAAI,EAAEH,WAAW,CAAC;AACrD,IAAIO,KAA6C,GAAAF,OAAA,CAAAE,KAAA,GAAGN,OAAO;AAC3D,IAAIO,EAA0C,GAAAH,OAAA,CAAAG,EAAA,GAAGP,OAAO;AAExD,IAAIQ,SAAS,GAAAJ,OAAA,CAAAI,SAAA,GAAGT,WAAW;AAC3B,IAAIU,OAAO,GAAAL,OAAA,CAAAK,OAAA,GAAG;EAAC,MAAM,EAAC,6BAA6B;EAAC,QAAQ,EAAC;AAA+B,CAAC;AAC7F,IAAIC,SAAS,GAAAN,OAAA,CAAAM,SAAA,GAAG,CAAC,CAAC;AAClB,IAAIC,MAAM,GAAAP,OAAA,CAAAO,MAAA,GAAG,CAAC,CAAC;AACf,IAAIC,UAAU,GAAAR,OAAA,CAAAQ,UAAA,GAAG,CAAC,CAAC;AACnB,IAAIC,MAAM,GAAAT,OAAA,CAAAS,MAAA,GAAG,CAAC,CAAC;AACf,IAAIC,IAAI,GAAAV,OAAA,CAAAU,IAAA,GAAG;EAAC,eAAe,EAAC;AAAiB,CAAC","ignoreList":[]}
|
|
@@ -80,6 +80,8 @@ const FormAudioField = ({
|
|
|
80
80
|
onDelete: handleDelete,
|
|
81
81
|
readOnly
|
|
82
82
|
}),
|
|
83
|
+
appendTo: 'window',
|
|
84
|
+
flip: true,
|
|
83
85
|
zIndex: _common.Z_INDEX_MODAL_POPOVER
|
|
84
86
|
}), [t, readOnly, handleReplace, handleDownload, handleDelete]);
|
|
85
87
|
if (loading) {
|
|
@@ -89,7 +91,7 @@ const FormAudioField = ({
|
|
|
89
91
|
__self: void 0,
|
|
90
92
|
__source: {
|
|
91
93
|
fileName: _jsxFileName,
|
|
92
|
-
lineNumber:
|
|
94
|
+
lineNumber: 88,
|
|
93
95
|
columnNumber: 12
|
|
94
96
|
}
|
|
95
97
|
});
|
|
@@ -109,7 +111,7 @@ const FormAudioField = ({
|
|
|
109
111
|
__self: void 0,
|
|
110
112
|
__source: {
|
|
111
113
|
fileName: _jsxFileName,
|
|
112
|
-
lineNumber:
|
|
114
|
+
lineNumber: 93,
|
|
113
115
|
columnNumber: 7
|
|
114
116
|
}
|
|
115
117
|
});
|
|
@@ -121,7 +123,7 @@ const FormAudioField = ({
|
|
|
121
123
|
__self: void 0,
|
|
122
124
|
__source: {
|
|
123
125
|
fileName: _jsxFileName,
|
|
124
|
-
lineNumber:
|
|
126
|
+
lineNumber: 109,
|
|
125
127
|
columnNumber: 5
|
|
126
128
|
}
|
|
127
129
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -130,7 +132,7 @@ const FormAudioField = ({
|
|
|
130
132
|
__self: void 0,
|
|
131
133
|
__source: {
|
|
132
134
|
fileName: _jsxFileName,
|
|
133
|
-
lineNumber:
|
|
135
|
+
lineNumber: 110,
|
|
134
136
|
columnNumber: 7
|
|
135
137
|
}
|
|
136
138
|
}, /*#__PURE__*/_react.default.createElement(_designSystem.Box, {
|
|
@@ -142,7 +144,7 @@ const FormAudioField = ({
|
|
|
142
144
|
__self: void 0,
|
|
143
145
|
__source: {
|
|
144
146
|
fileName: _jsxFileName,
|
|
145
|
-
lineNumber:
|
|
147
|
+
lineNumber: 111,
|
|
146
148
|
columnNumber: 9
|
|
147
149
|
}
|
|
148
150
|
}, /*#__PURE__*/_react.default.createElement(_designSystem.Text, {
|
|
@@ -151,7 +153,7 @@ const FormAudioField = ({
|
|
|
151
153
|
__self: void 0,
|
|
152
154
|
__source: {
|
|
153
155
|
fileName: _jsxFileName,
|
|
154
|
-
lineNumber:
|
|
156
|
+
lineNumber: 118,
|
|
155
157
|
columnNumber: 11
|
|
156
158
|
}
|
|
157
159
|
}, (0, _utils.getMediaTitle)(data)), /*#__PURE__*/_react.default.createElement(_designSystem.Box, {
|
|
@@ -161,7 +163,7 @@ const FormAudioField = ({
|
|
|
161
163
|
__self: void 0,
|
|
162
164
|
__source: {
|
|
163
165
|
fileName: _jsxFileName,
|
|
164
|
-
lineNumber:
|
|
166
|
+
lineNumber: 124,
|
|
165
167
|
columnNumber: 11
|
|
166
168
|
}
|
|
167
169
|
}, /*#__PURE__*/_react.default.createElement(_designSystem.AudioPlayer, {
|
|
@@ -172,7 +174,7 @@ const FormAudioField = ({
|
|
|
172
174
|
__self: void 0,
|
|
173
175
|
__source: {
|
|
174
176
|
fileName: _jsxFileName,
|
|
175
|
-
lineNumber:
|
|
177
|
+
lineNumber: 125,
|
|
176
178
|
columnNumber: 13
|
|
177
179
|
}
|
|
178
180
|
}), /*#__PURE__*/_react.default.createElement(_designSystem.Box, {
|
|
@@ -181,7 +183,7 @@ const FormAudioField = ({
|
|
|
181
183
|
__self: void 0,
|
|
182
184
|
__source: {
|
|
183
185
|
fileName: _jsxFileName,
|
|
184
|
-
lineNumber:
|
|
186
|
+
lineNumber: 131,
|
|
185
187
|
columnNumber: 13
|
|
186
188
|
}
|
|
187
189
|
}, /*#__PURE__*/_react.default.createElement(_actionsButton.ActionsButton, {
|
|
@@ -192,7 +194,7 @@ const FormAudioField = ({
|
|
|
192
194
|
__self: void 0,
|
|
193
195
|
__source: {
|
|
194
196
|
fileName: _jsxFileName,
|
|
195
|
-
lineNumber:
|
|
197
|
+
lineNumber: 132,
|
|
196
198
|
columnNumber: 15
|
|
197
199
|
}
|
|
198
200
|
}))))));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","_autoFieldTypes","_designSystem","_hooks","_utils","_common","_mediaControl","_mediaLoader","_actionsButton","_audioActions","_formAudioFieldStCss","_jsxFileName","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","FormAudioField","data","onChange","onChangeAudio","onClear","onClearAudio","onInput","autoFocus","readOnly","invalid","dataHook","useTranslations","useWithCallback","inputRef","useRef","viewRef","callMedia","onMediaLoad","downloadMedia","loading","useMediaControl","mediaType","MEDIA_TYPES","AUDIO","value","handleReplace","handleDownload","handleDelete","useMediaHandlers","next","actionsMenuProps","useMemo","actions","buildAudioActions","labels","replace","download","delete","dataHooks","onReplace","onDownload","onDelete","zIndex","Z_INDEX_MODAL_POPOVER","createElement","MediaLoader","borderStyle","className","classes","addItem","__self","__source","fileName","lineNumber","columnNumber","AddItem","ref","style","disabled","error","theme","onClick","children","Box","direction","gap","tabIndex","verticalAlign","backgroundColor","padding","borderRadius","Text","mediaTitle","getMediaTitle","marginTop","marginBottom","AudioPlayer","src","getMediaURL","onLoad","onLoadError","marginLeft","ActionsButton","priority","skin","exports"],"sources":["../../../../../src/components/audio/audio-field/form-audio-field.tsx"],"sourcesContent":["import type { FC } from 'react';\nimport React, { useRef, useMemo } from 'react';\n\nimport { getMediaURL } from '../../../auto-field-types';\nimport type { AddItemActions } from '@wix/design-system';\nimport { AddItem, AudioPlayer, Box, Text } from '@wix/design-system';\n\nimport { useTranslations, useWithCallback } from '../../../hooks';\nimport { getMediaTitle, MEDIA_TYPES } from '../../../utils';\n\nimport { Z_INDEX_MODAL_POPOVER } from '../../common';\nimport type { FormMediaControlProps } from '../../media-control';\nimport { useMediaControl, useMediaHandlers } from '../../media-control';\nimport { MediaLoader } from '../../media-loader';\nimport { ActionsButton } from '../actions/actions-button';\nimport { buildAudioActions } from '../actions/audio-actions';\n\nimport { style, classes } from './form-audio-field.st.css.js';\n\nexport const FormAudioField: FC<FormMediaControlProps> = ({\n data,\n onChange: onChangeAudio,\n onClear: onClearAudio,\n onInput,\n autoFocus,\n readOnly,\n invalid,\n dataHook,\n}) => {\n const { t } = useTranslations();\n\n const onChange = useWithCallback(onChangeAudio, onInput);\n const onClear = useWithCallback(onClearAudio, onInput);\n\n const inputRef = useRef<AddItemActions>(null);\n const viewRef = useRef<HTMLDivElement>(null);\n\n const { callMedia, onMediaLoad, downloadMedia, loading } = useMediaControl({\n mediaType: MEDIA_TYPES.AUDIO,\n value: data,\n onChange,\n autoFocus,\n readOnly,\n inputRef,\n viewRef,\n });\n\n const { handleReplace, handleDownload, handleDelete } = useMediaHandlers({\n value: data ?? null,\n callMedia,\n downloadMedia,\n onChange: (next) => {\n if (next === null) {\n onClear();\n } else {\n onChange(next);\n }\n },\n });\n\n const actionsMenuProps = useMemo(\n () => ({\n dataHook: 'fromAudioInput.moreActionsMenu',\n actions: buildAudioActions({\n labels: {\n replace: t('CMS.audio.button.replace'),\n download: t('CMS.audio.button.download'),\n delete: t('CMS.audio.button.delete'),\n },\n dataHooks: {\n replace: 'fromAudioInput.button.replace',\n download: 'fromAudioInput.button.download',\n delete: 'fromAudioInput.button.delete',\n },\n onReplace: handleReplace,\n onDownload: handleDownload,\n onDelete: handleDelete,\n readOnly,\n }),\n zIndex: Z_INDEX_MODAL_POPOVER,\n }),\n [t, readOnly, handleReplace, handleDownload, handleDelete],\n );\n\n if (loading) {\n return <MediaLoader borderStyle=\"dashed\" className={classes.addItem} />;\n }\n\n if (!data) {\n return (\n <AddItem\n ref={inputRef}\n dataHook={dataHook}\n className={style(classes.addItem, {\n disabled: !!readOnly,\n error: invalid,\n })}\n theme=\"dashes\"\n onClick={callMedia}\n disabled={readOnly}\n children={t('CMS.audio.button.add')}\n />\n );\n }\n\n return (\n <Box dataHook={dataHook} direction=\"vertical\" gap=\"S1\">\n <div ref={viewRef} tabIndex={0}>\n <Box\n direction=\"vertical\"\n verticalAlign=\"middle\"\n backgroundColor=\"D70\"\n padding=\"SP5\"\n borderRadius={12}\n >\n <Text\n dataHook=\"fromAudioInput.audioName\"\n className={classes.mediaTitle}\n >\n {getMediaTitle(data)}\n </Text>\n <Box direction=\"horizontal\" marginTop=\"9px\" marginBottom=\"-3px\">\n <AudioPlayer\n dataHook=\"fromAudioInput.player\"\n src={getMediaURL(data)}\n onLoad={onMediaLoad}\n onLoadError={onMediaLoad}\n />\n <Box marginLeft=\"SP3\" gap=\"SP1\">\n <ActionsButton\n dataHook=\"fromAudioInput.button.more\"\n actionsMenuProps={actionsMenuProps}\n priority=\"secondary\"\n skin=\"inverted\"\n />\n </Box>\n </Box>\n </Box>\n </div>\n </Box>\n );\n};\n"],"mappings":";;;;AACA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAEA,IAAAC,eAAA,GAAAD,OAAA;AAEA,IAAAE,aAAA,GAAAF,OAAA;AAEA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AAEA,IAAAK,OAAA,GAAAL,OAAA;AAEA,IAAAM,aAAA,GAAAN,OAAA;AACA,IAAAO,YAAA,GAAAP,OAAA;AACA,IAAAQ,cAAA,GAAAR,OAAA;AACA,IAAAS,aAAA,GAAAT,OAAA;AAEA,IAAAU,oBAAA,GAAAV,OAAA;AAA8D,IAAAW,YAAA;AAAA,SAAAZ,wBAAAa,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAf,uBAAA,YAAAA,CAAAa,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,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A;MAAAC,QAAA,EAAAxE,YAAA;MAAAyE,UAAA;MAAAC,YAAA;IAAA;EAAA,gBAC7BvF,MAAA,CAAAwB,OAAA,CAAAqD,aAAA,CAACnE,cAAA,CAAAyG,aAAa;IACZxE,QAAQ,EAAC,4BAA4B;IACrCoB,gBAAgB,EAAEA,gBAAiB;IACnCqD,QAAQ,EAAC,WAAW;IACpBC,IAAI,EAAC,UAAU;IAAAlC,MAAA;IAAAC,QAAA;MAAAC,QAAA,EAAAxE,YAAA;MAAAyE,UAAA;MAAAC,YAAA;IAAA;EAAA,CAChB,CACE,CACF,CACF,CACF,CACF,CAAC;AAEV,CAAC;AAAC+B,OAAA,CAAArF,cAAA,GAAAA,cAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_autoFieldTypes","_designSystem","_hooks","_utils","_common","_mediaControl","_mediaLoader","_actionsButton","_audioActions","_formAudioFieldStCss","_jsxFileName","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","FormAudioField","data","onChange","onChangeAudio","onClear","onClearAudio","onInput","autoFocus","readOnly","invalid","dataHook","useTranslations","useWithCallback","inputRef","useRef","viewRef","callMedia","onMediaLoad","downloadMedia","loading","useMediaControl","mediaType","MEDIA_TYPES","AUDIO","value","handleReplace","handleDownload","handleDelete","useMediaHandlers","next","actionsMenuProps","useMemo","actions","buildAudioActions","labels","replace","download","delete","dataHooks","onReplace","onDownload","onDelete","appendTo","flip","zIndex","Z_INDEX_MODAL_POPOVER","createElement","MediaLoader","borderStyle","className","classes","addItem","__self","__source","fileName","lineNumber","columnNumber","AddItem","ref","style","disabled","error","theme","onClick","children","Box","direction","gap","tabIndex","verticalAlign","backgroundColor","padding","borderRadius","Text","mediaTitle","getMediaTitle","marginTop","marginBottom","AudioPlayer","src","getMediaURL","onLoad","onLoadError","marginLeft","ActionsButton","priority","skin","exports"],"sources":["../../../../../src/components/audio/audio-field/form-audio-field.tsx"],"sourcesContent":["import type { FC } from 'react';\nimport React, { useRef, useMemo } from 'react';\n\nimport { getMediaURL } from '../../../auto-field-types';\nimport type { AddItemActions } from '@wix/design-system';\nimport { AddItem, AudioPlayer, Box, Text } from '@wix/design-system';\n\nimport { useTranslations, useWithCallback } from '../../../hooks';\nimport { getMediaTitle, MEDIA_TYPES } from '../../../utils';\n\nimport { Z_INDEX_MODAL_POPOVER } from '../../common';\nimport type { FormMediaControlProps } from '../../media-control';\nimport { useMediaControl, useMediaHandlers } from '../../media-control';\nimport { MediaLoader } from '../../media-loader';\nimport { ActionsButton } from '../actions/actions-button';\nimport { buildAudioActions } from '../actions/audio-actions';\n\nimport { style, classes } from './form-audio-field.st.css.js';\n\nexport const FormAudioField: FC<FormMediaControlProps> = ({\n data,\n onChange: onChangeAudio,\n onClear: onClearAudio,\n onInput,\n autoFocus,\n readOnly,\n invalid,\n dataHook,\n}) => {\n const { t } = useTranslations();\n\n const onChange = useWithCallback(onChangeAudio, onInput);\n const onClear = useWithCallback(onClearAudio, onInput);\n\n const inputRef = useRef<AddItemActions>(null);\n const viewRef = useRef<HTMLDivElement>(null);\n\n const { callMedia, onMediaLoad, downloadMedia, loading } = useMediaControl({\n mediaType: MEDIA_TYPES.AUDIO,\n value: data,\n onChange,\n autoFocus,\n readOnly,\n inputRef,\n viewRef,\n });\n\n const { handleReplace, handleDownload, handleDelete } = useMediaHandlers({\n value: data ?? null,\n callMedia,\n downloadMedia,\n onChange: (next) => {\n if (next === null) {\n onClear();\n } else {\n onChange(next);\n }\n },\n });\n\n const actionsMenuProps = useMemo(\n () => ({\n dataHook: 'fromAudioInput.moreActionsMenu',\n actions: buildAudioActions({\n labels: {\n replace: t('CMS.audio.button.replace'),\n download: t('CMS.audio.button.download'),\n delete: t('CMS.audio.button.delete'),\n },\n dataHooks: {\n replace: 'fromAudioInput.button.replace',\n download: 'fromAudioInput.button.download',\n delete: 'fromAudioInput.button.delete',\n },\n onReplace: handleReplace,\n onDownload: handleDownload,\n onDelete: handleDelete,\n readOnly,\n }),\n appendTo: 'window' as const,\n flip: true,\n zIndex: Z_INDEX_MODAL_POPOVER,\n }),\n [t, readOnly, handleReplace, handleDownload, handleDelete],\n );\n\n if (loading) {\n return <MediaLoader borderStyle=\"dashed\" className={classes.addItem} />;\n }\n\n if (!data) {\n return (\n <AddItem\n ref={inputRef}\n dataHook={dataHook}\n className={style(classes.addItem, {\n disabled: !!readOnly,\n error: invalid,\n })}\n theme=\"dashes\"\n onClick={callMedia}\n disabled={readOnly}\n children={t('CMS.audio.button.add')}\n />\n );\n }\n\n return (\n <Box dataHook={dataHook} direction=\"vertical\" gap=\"S1\">\n <div ref={viewRef} tabIndex={0}>\n <Box\n direction=\"vertical\"\n verticalAlign=\"middle\"\n backgroundColor=\"D70\"\n padding=\"SP5\"\n borderRadius={12}\n >\n <Text\n dataHook=\"fromAudioInput.audioName\"\n className={classes.mediaTitle}\n >\n {getMediaTitle(data)}\n </Text>\n <Box direction=\"horizontal\" marginTop=\"9px\" marginBottom=\"-3px\">\n <AudioPlayer\n dataHook=\"fromAudioInput.player\"\n src={getMediaURL(data)}\n onLoad={onMediaLoad}\n onLoadError={onMediaLoad}\n />\n <Box marginLeft=\"SP3\" gap=\"SP1\">\n <ActionsButton\n dataHook=\"fromAudioInput.button.more\"\n actionsMenuProps={actionsMenuProps}\n priority=\"secondary\"\n skin=\"inverted\"\n />\n </Box>\n </Box>\n </Box>\n </div>\n </Box>\n );\n};\n"],"mappings":";;;;AACA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAEA,IAAAC,eAAA,GAAAD,OAAA;AAEA,IAAAE,aAAA,GAAAF,OAAA;AAEA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AAEA,IAAAK,OAAA,GAAAL,OAAA;AAEA,IAAAM,aAAA,GAAAN,OAAA;AACA,IAAAO,YAAA,GAAAP,OAAA;AACA,IAAAQ,cAAA,GAA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wB,OAAA,CAAAuD,aAAA,CAAC3E,aAAA,CAAA2G,WAAW;IACVpE,QAAQ,EAAC,uBAAuB;IAChCqE,GAAG,EAAE,IAAAC,2BAAW,EAAC/E,IAAI,CAAE;IACvBgF,MAAM,EAAEhE,WAAY;IACpBiE,WAAW,EAAEjE,WAAY;IAAAmC,MAAA;IAAAC,QAAA;MAAAC,QAAA,EAAA1E,YAAA;MAAA2E,UAAA;MAAAC,YAAA;IAAA;EAAA,CAC1B,CAAC,eACFzF,MAAA,CAAAwB,OAAA,CAAAuD,aAAA,CAAC3E,aAAA,CAAA8F,GAAG;IAACkB,UAAU,EAAC,KAAK;IAAChB,GAAG,EAAC,KAAK;IAAAf,MAAA;IAAAC,QAAA;MAAAC,QAAA,EAAA1E,YAAA;MAAA2E,UAAA;MAAAC,YAAA;IAAA;EAAA,gBAC7BzF,MAAA,CAAAwB,OAAA,CAAAuD,aAAA,CAACrE,cAAA,CAAA2G,aAAa;IACZ1E,QAAQ,EAAC,4BAA4B;IACrCoB,gBAAgB,EAAEA,gBAAiB;IACnCuD,QAAQ,EAAC,WAAW;IACpBC,IAAI,EAAC,UAAU;IAAAlC,MAAA;IAAAC,QAAA;MAAAC,QAAA,EAAA1E,YAAA;MAAA2E,UAAA;MAAAC,YAAA;IAAA;EAAA,CAChB,CACE,CACF,CACF,CACF,CACF,CAAC;AAEV,CAAC;AAAC+B,OAAA,CAAAvF,cAAA,GAAAA,cAAA","ignoreList":[]}
|
|
@@ -5,16 +5,16 @@ exports.vars = exports.style = exports.stVars = exports.st = exports.namespace =
|
|
|
5
5
|
var _stylableEsmRuntime = require("../../../stylable-esm-runtime.js");
|
|
6
6
|
// @ts-nocheck
|
|
7
7
|
|
|
8
|
-
var _namespace_ = "
|
|
8
|
+
var _namespace_ = "formaudiofield1883836278";
|
|
9
9
|
var _style_ = _stylableEsmRuntime.classesRuntime.bind(null, _namespace_);
|
|
10
10
|
var cssStates = exports.cssStates = _stylableEsmRuntime.statesRuntime.bind(null, _namespace_);
|
|
11
11
|
var style = exports.style = _style_;
|
|
12
12
|
var st = exports.st = _style_;
|
|
13
13
|
var namespace = exports.namespace = _namespace_;
|
|
14
14
|
var classes = exports.classes = {
|
|
15
|
-
"root": "
|
|
16
|
-
"addItem": "
|
|
17
|
-
"mediaTitle": "
|
|
15
|
+
"root": "formaudiofield1883836278__root",
|
|
16
|
+
"addItem": "formaudiofield1883836278__addItem",
|
|
17
|
+
"mediaTitle": "formaudiofield1883836278__mediaTitle"
|
|
18
18
|
};
|
|
19
19
|
var keyframes = exports.keyframes = {};
|
|
20
20
|
var layers = exports.layers = {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_stylableEsmRuntime","require","_namespace_","_style_","classesRuntime","bind","cssStates","exports","statesRuntime","style","st","namespace","classes","keyframes","layers","containers","stVars","vars"],"sources":["../../../../../src/components/audio/audio-field/form-audio-field.st.css.ts"],"sourcesContent":["// @ts-nocheck\n\n\nimport { classesRuntime, statesRuntime } from \"../../../stylable-esm-runtime.js\";\n\n\n\nvar _namespace_ = \"
|
|
1
|
+
{"version":3,"names":["_stylableEsmRuntime","require","_namespace_","_style_","classesRuntime","bind","cssStates","exports","statesRuntime","style","st","namespace","classes","keyframes","layers","containers","stVars","vars"],"sources":["../../../../../src/components/audio/audio-field/form-audio-field.st.css.ts"],"sourcesContent":["// @ts-nocheck\n\n\nimport { classesRuntime, statesRuntime } from \"../../../stylable-esm-runtime.js\";\n\n\n\nvar _namespace_ = \"formaudiofield1883836278\";\nvar _style_ = classesRuntime.bind(null, _namespace_);\n\nexport var cssStates = statesRuntime.bind(null, _namespace_);\nexport var style: import(\"@stylable/runtime\").STFunction = _style_;\nexport var st: import(\"@stylable/runtime\").STFunction = _style_;\n\nexport var namespace = _namespace_;\nexport var classes = {\"root\":\"formaudiofield1883836278__root\",\"addItem\":\"formaudiofield1883836278__addItem\",\"mediaTitle\":\"formaudiofield1883836278__mediaTitle\"};\nexport var keyframes = {}; \nexport var layers = {};\nexport var containers = {};\nexport var stVars = {}; \nexport var vars = {\"wds-color-red-100\":\"--wds-color-red-100\",\"wds-color-blue-300\":\"--wds-color-blue-300\",\"wds-border-radius-400\":\"--wds-border-radius-400\",\"wds-input-shadow-focus-standard\":\"--wds-input-shadow-focus-standard\",\"wsr-color-R10\":\"--wsr-color-R10\",\"wsr-color-B30\":\"--wsr-color-B30\"}; \n\n\n\n\n"],"mappings":";;;;AAGA,IAAAA,mBAAA,GAAAC,OAAA;AAHA;;AAOA,IAAIC,WAAW,GAAG,0BAA0B;AAC5C,IAAIC,OAAO,GAAGC,kCAAc,CAACC,IAAI,CAAC,IAAI,EAAEH,WAAW,CAAC;AAE7C,IAAII,SAAS,GAAAC,OAAA,CAAAD,SAAA,GAAGE,iCAAa,CAACH,IAAI,CAAC,IAAI,EAAEH,WAAW,CAAC;AACrD,IAAIO,KAA6C,GAAAF,OAAA,CAAAE,KAAA,GAAGN,OAAO;AAC3D,IAAIO,EAA0C,GAAAH,OAAA,CAAAG,EAAA,GAAGP,OAAO;AAExD,IAAIQ,SAAS,GAAAJ,OAAA,CAAAI,SAAA,GAAGT,WAAW;AAC3B,IAAIU,OAAO,GAAAL,OAAA,CAAAK,OAAA,GAAG;EAAC,MAAM,EAAC,gCAAgC;EAAC,SAAS,EAAC,mCAAmC;EAAC,YAAY,EAAC;AAAsC,CAAC;AACzJ,IAAIC,SAAS,GAAAN,OAAA,CAAAM,SAAA,GAAG,CAAC,CAAC;AAClB,IAAIC,MAAM,GAAAP,OAAA,CAAAO,MAAA,GAAG,CAAC,CAAC;AACf,IAAIC,UAAU,GAAAR,OAAA,CAAAQ,UAAA,GAAG,CAAC,CAAC;AACnB,IAAIC,MAAM,GAAAT,OAAA,CAAAS,MAAA,GAAG,CAAC,CAAC;AACf,IAAIC,IAAI,GAAAV,OAAA,CAAAU,IAAA,GAAG;EAAC,mBAAmB,EAAC,qBAAqB;EAAC,oBAAoB,EAAC,sBAAsB;EAAC,uBAAuB,EAAC,yBAAyB;EAAC,iCAAiC,EAAC,mCAAmC;EAAC,eAAe,EAAC,iBAAiB;EAAC,eAAe,EAAC;AAAiB,CAAC","ignoreList":[]}
|
|
@@ -5,14 +5,14 @@ exports.vars = exports.style = exports.stVars = exports.st = exports.namespace =
|
|
|
5
5
|
var _stylableEsmRuntime = require("../../../stylable-esm-runtime.js");
|
|
6
6
|
// @ts-nocheck
|
|
7
7
|
|
|
8
|
-
var _namespace_ = "
|
|
8
|
+
var _namespace_ = "audioplayer2028983810";
|
|
9
9
|
var _style_ = _stylableEsmRuntime.classesRuntime.bind(null, _namespace_);
|
|
10
10
|
var cssStates = exports.cssStates = _stylableEsmRuntime.statesRuntime.bind(null, _namespace_);
|
|
11
11
|
var style = exports.style = _style_;
|
|
12
12
|
var st = exports.st = _style_;
|
|
13
13
|
var namespace = exports.namespace = _namespace_;
|
|
14
14
|
var classes = exports.classes = {
|
|
15
|
-
"root": "
|
|
15
|
+
"root": "audioplayer2028983810__root"
|
|
16
16
|
};
|
|
17
17
|
var keyframes = exports.keyframes = {};
|
|
18
18
|
var layers = exports.layers = {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_stylableEsmRuntime","require","_namespace_","_style_","classesRuntime","bind","cssStates","exports","statesRuntime","style","st","namespace","classes","keyframes","layers","containers","stVars","vars"],"sources":["../../../../../src/components/audio/audio-player/audio-player.st.css.ts"],"sourcesContent":["// @ts-nocheck\n\n\nimport { classesRuntime, statesRuntime } from \"../../../stylable-esm-runtime.js\";\n\n\n\nvar _namespace_ = \"
|
|
1
|
+
{"version":3,"names":["_stylableEsmRuntime","require","_namespace_","_style_","classesRuntime","bind","cssStates","exports","statesRuntime","style","st","namespace","classes","keyframes","layers","containers","stVars","vars"],"sources":["../../../../../src/components/audio/audio-player/audio-player.st.css.ts"],"sourcesContent":["// @ts-nocheck\n\n\nimport { classesRuntime, statesRuntime } from \"../../../stylable-esm-runtime.js\";\n\n\n\nvar _namespace_ = \"audioplayer2028983810\";\nvar _style_ = classesRuntime.bind(null, _namespace_);\n\nexport var cssStates = statesRuntime.bind(null, _namespace_);\nexport var style: import(\"@stylable/runtime\").STFunction = _style_;\nexport var st: import(\"@stylable/runtime\").STFunction = _style_;\n\nexport var namespace = _namespace_;\nexport var classes = {\"root\":\"audioplayer2028983810__root\"};\nexport var keyframes = {}; \nexport var layers = {};\nexport var containers = {};\nexport var stVars = {}; \nexport var vars = {}; \n\n\n\n\n"],"mappings":";;;;AAGA,IAAAA,mBAAA,GAAAC,OAAA;AAHA;;AAOA,IAAIC,WAAW,GAAG,uBAAuB;AACzC,IAAIC,OAAO,GAAGC,kCAAc,CAACC,IAAI,CAAC,IAAI,EAAEH,WAAW,CAAC;AAE7C,IAAII,SAAS,GAAAC,OAAA,CAAAD,SAAA,GAAGE,iCAAa,CAACH,IAAI,CAAC,IAAI,EAAEH,WAAW,CAAC;AACrD,IAAIO,KAA6C,GAAAF,OAAA,CAAAE,KAAA,GAAGN,OAAO;AAC3D,IAAIO,EAA0C,GAAAH,OAAA,CAAAG,EAAA,GAAGP,OAAO;AAExD,IAAIQ,SAAS,GAAAJ,OAAA,CAAAI,SAAA,GAAGT,WAAW;AAC3B,IAAIU,OAAO,GAAAL,OAAA,CAAAK,OAAA,GAAG;EAAC,MAAM,EAAC;AAA6B,CAAC;AACpD,IAAIC,SAAS,GAAAN,OAAA,CAAAM,SAAA,GAAG,CAAC,CAAC;AAClB,IAAIC,MAAM,GAAAP,OAAA,CAAAO,MAAA,GAAG,CAAC,CAAC;AACf,IAAIC,UAAU,GAAAR,OAAA,CAAAQ,UAAA,GAAG,CAAC,CAAC;AACnB,IAAIC,MAAM,GAAAT,OAAA,CAAAS,MAAA,GAAG,CAAC,CAAC;AACf,IAAIC,IAAI,GAAAV,OAAA,CAAAU,IAAA,GAAG,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
exports.__esModule = true;
|
|
5
|
+
exports.CellColorInput = void 0;
|
|
6
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _designSystem = require("@wix/design-system");
|
|
9
|
+
var _useTranslations = require("../../hooks/use-translations");
|
|
10
|
+
var _hex2 = require("./hex");
|
|
11
|
+
var _jsxFileName = "/home/builduser/work/843658b9f44192f0/packages/fields/dist/cjs/components/color-view/cell-color-input.tsx";
|
|
12
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
13
|
+
/**
|
|
14
|
+
* Cell-layer ColorInput for EditableTable. Differs from the form ColorInput in
|
|
15
|
+
* four ways required by the cell context:
|
|
16
|
+
* 1. `popoverProps` passthrough so the picker can `appendTo: 'window'` and
|
|
17
|
+
* escape the table's scroll container.
|
|
18
|
+
* 2. The empty-state add-color button appears for invalid values too (not
|
|
19
|
+
* only missing) — mid-typing or post-commit bad hex should still expose
|
|
20
|
+
* the picker as an escape hatch.
|
|
21
|
+
* 3. Invalid input on blur is forwarded upward (prefixed with `#`) so the
|
|
22
|
+
* cell-level `validate()` can surface the error; we don't silently revert.
|
|
23
|
+
* 4. Picker closes on any ancestor scroll while open — the portaled popover
|
|
24
|
+
* does not follow the trigger.
|
|
25
|
+
*/
|
|
26
|
+
const CellColorInput = exports.CellColorInput = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
27
|
+
value: colorValue,
|
|
28
|
+
onChange,
|
|
29
|
+
onBlur,
|
|
30
|
+
popoverProps,
|
|
31
|
+
inputRef,
|
|
32
|
+
...props
|
|
33
|
+
}, ref) => {
|
|
34
|
+
const {
|
|
35
|
+
t
|
|
36
|
+
} = (0, _useTranslations.useTranslations)();
|
|
37
|
+
const [inputValue, setInputValue] = (0, _react.useState)(colorValue ? (0, _hex2.omitHash)(colorValue) : '');
|
|
38
|
+
const [showPicker, setShowPicker] = (0, _react.useState)(false);
|
|
39
|
+
const [pickerHex, setPickerHex] = (0, _react.useState)(colorValue && (0, _hex2.isValidHex)(colorValue) ? colorValue : undefined);
|
|
40
|
+
const onInputChange = (0, _react.useCallback)(e => {
|
|
41
|
+
const raw = e.target.value.replace(/^#/, '');
|
|
42
|
+
setInputValue(raw);
|
|
43
|
+
const hex = (0, _hex2.normalizeHex)(raw);
|
|
44
|
+
if (hex) {
|
|
45
|
+
setPickerHex(hex);
|
|
46
|
+
onChange == null || onChange(hex);
|
|
47
|
+
} else {
|
|
48
|
+
onChange == null || onChange(raw === '' ? '' : `#${raw}`);
|
|
49
|
+
}
|
|
50
|
+
}, [onChange]);
|
|
51
|
+
const onInputBlur = (0, _react.useCallback)(e => {
|
|
52
|
+
const hex = (0, _hex2.normalizeHex)(inputValue);
|
|
53
|
+
if (hex) {
|
|
54
|
+
onChange == null || onChange(hex);
|
|
55
|
+
setInputValue((0, _hex2.omitHash)(hex));
|
|
56
|
+
}
|
|
57
|
+
onBlur == null || onBlur(e);
|
|
58
|
+
}, [onChange, onBlur, inputValue]);
|
|
59
|
+
const onPickerConfirm = (0, _react.useCallback)(confirmedColor => {
|
|
60
|
+
var _hex;
|
|
61
|
+
const hex = typeof confirmedColor === 'string' ? confirmedColor.toUpperCase() : confirmedColor == null || confirmedColor.hex == null || (_hex = confirmedColor.hex()) == null ? void 0 : _hex.toUpperCase();
|
|
62
|
+
if (hex) {
|
|
63
|
+
onChange == null || onChange(hex);
|
|
64
|
+
setInputValue((0, _hex2.omitHash)(hex));
|
|
65
|
+
setPickerHex(hex);
|
|
66
|
+
} else {
|
|
67
|
+
onChange == null || onChange('');
|
|
68
|
+
setInputValue('');
|
|
69
|
+
setPickerHex(undefined);
|
|
70
|
+
}
|
|
71
|
+
setShowPicker(false);
|
|
72
|
+
}, [onChange]);
|
|
73
|
+
const onPickerCancel = (0, _react.useCallback)(() => {
|
|
74
|
+
setPickerHex(colorValue && (0, _hex2.isValidHex)(colorValue) ? colorValue : undefined);
|
|
75
|
+
setShowPicker(false);
|
|
76
|
+
}, [colorValue]);
|
|
77
|
+
const togglePicker = (0, _react.useCallback)(() => {
|
|
78
|
+
setShowPicker(prev => !prev);
|
|
79
|
+
}, []);
|
|
80
|
+
(0, _react.useEffect)(() => {
|
|
81
|
+
if (!showPicker) {
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
const close = () => setShowPicker(false);
|
|
85
|
+
const opts = {
|
|
86
|
+
capture: true
|
|
87
|
+
};
|
|
88
|
+
window.addEventListener('scroll', close, {
|
|
89
|
+
...opts,
|
|
90
|
+
passive: true
|
|
91
|
+
});
|
|
92
|
+
return () => window.removeEventListener('scroll', close, opts);
|
|
93
|
+
}, [showPicker]);
|
|
94
|
+
const showAddColorButton = !colorValue || !(0, _hex2.isValidHex)(colorValue);
|
|
95
|
+
const addColorTooltip = t('auto-patterns.fields.add_color_tooltip');
|
|
96
|
+
const popoverDefaults = {
|
|
97
|
+
animate: true,
|
|
98
|
+
flip: true,
|
|
99
|
+
fixed: false,
|
|
100
|
+
placement: 'bottom-start',
|
|
101
|
+
appendTo: 'window',
|
|
102
|
+
moveBy: {
|
|
103
|
+
x: 0,
|
|
104
|
+
y: 4
|
|
105
|
+
},
|
|
106
|
+
zIndex: 9999
|
|
107
|
+
};
|
|
108
|
+
return /*#__PURE__*/_react.default.createElement(_designSystem.Input, (0, _extends2.default)({}, props, {
|
|
109
|
+
ref: instance => {
|
|
110
|
+
if (inputRef) inputRef.current = instance;
|
|
111
|
+
if (typeof ref === 'function') ref(instance);else if (ref) ref.current = instance;
|
|
112
|
+
},
|
|
113
|
+
value: inputValue,
|
|
114
|
+
onChange: onInputChange,
|
|
115
|
+
onBlur: onInputBlur,
|
|
116
|
+
prefix: /*#__PURE__*/_react.default.createElement(_designSystem.Input.Affix, {
|
|
117
|
+
__self: void 0,
|
|
118
|
+
__source: {
|
|
119
|
+
fileName: _jsxFileName,
|
|
120
|
+
lineNumber: 154,
|
|
121
|
+
columnNumber: 17
|
|
122
|
+
}
|
|
123
|
+
}, "#"),
|
|
124
|
+
suffix: /*#__PURE__*/_react.default.createElement(_designSystem.Input.Affix, {
|
|
125
|
+
__self: void 0,
|
|
126
|
+
__source: {
|
|
127
|
+
fileName: _jsxFileName,
|
|
128
|
+
lineNumber: 156,
|
|
129
|
+
columnNumber: 11
|
|
130
|
+
}
|
|
131
|
+
}, /*#__PURE__*/_react.default.createElement(_designSystem.Popover, (0, _extends2.default)({}, popoverDefaults, popoverProps, {
|
|
132
|
+
shown: showPicker,
|
|
133
|
+
onClickOutside: () => setShowPicker(false),
|
|
134
|
+
__self: void 0,
|
|
135
|
+
__source: {
|
|
136
|
+
fileName: _jsxFileName,
|
|
137
|
+
lineNumber: 157,
|
|
138
|
+
columnNumber: 13
|
|
139
|
+
}
|
|
140
|
+
}), /*#__PURE__*/_react.default.createElement(_designSystem.Popover.Element, {
|
|
141
|
+
__self: void 0,
|
|
142
|
+
__source: {
|
|
143
|
+
fileName: _jsxFileName,
|
|
144
|
+
lineNumber: 163,
|
|
145
|
+
columnNumber: 15
|
|
146
|
+
}
|
|
147
|
+
}, showAddColorButton ? /*#__PURE__*/_react.default.createElement(_designSystem.FillButton, {
|
|
148
|
+
onClick: togglePicker,
|
|
149
|
+
tooltipContent: addColorTooltip,
|
|
150
|
+
__self: void 0,
|
|
151
|
+
__source: {
|
|
152
|
+
fileName: _jsxFileName,
|
|
153
|
+
lineNumber: 165,
|
|
154
|
+
columnNumber: 19
|
|
155
|
+
}
|
|
156
|
+
}) : /*#__PURE__*/_react.default.createElement(_designSystem.FillPreview, {
|
|
157
|
+
fill: colorValue,
|
|
158
|
+
onClick: togglePicker,
|
|
159
|
+
__self: void 0,
|
|
160
|
+
__source: {
|
|
161
|
+
fileName: _jsxFileName,
|
|
162
|
+
lineNumber: 170,
|
|
163
|
+
columnNumber: 19
|
|
164
|
+
}
|
|
165
|
+
})), /*#__PURE__*/_react.default.createElement(_designSystem.Popover.Content, {
|
|
166
|
+
__self: void 0,
|
|
167
|
+
__source: {
|
|
168
|
+
fileName: _jsxFileName,
|
|
169
|
+
lineNumber: 173,
|
|
170
|
+
columnNumber: 15
|
|
171
|
+
}
|
|
172
|
+
}, /*#__PURE__*/_react.default.createElement(_designSystem.ColorPicker, {
|
|
173
|
+
value: pickerHex,
|
|
174
|
+
onChange: c => setPickerHex(typeof c === 'string' ? c : c == null || c.hex == null ? void 0 : c.hex()),
|
|
175
|
+
onConfirm: onPickerConfirm,
|
|
176
|
+
onCancel: onPickerCancel,
|
|
177
|
+
showConverter: true,
|
|
178
|
+
allowEmpty: true,
|
|
179
|
+
__self: void 0,
|
|
180
|
+
__source: {
|
|
181
|
+
fileName: _jsxFileName,
|
|
182
|
+
lineNumber: 174,
|
|
183
|
+
columnNumber: 17
|
|
184
|
+
}
|
|
185
|
+
})))),
|
|
186
|
+
__self: void 0,
|
|
187
|
+
__source: {
|
|
188
|
+
fileName: _jsxFileName,
|
|
189
|
+
lineNumber: 144,
|
|
190
|
+
columnNumber: 7
|
|
191
|
+
}
|
|
192
|
+
}));
|
|
193
|
+
});
|
|
194
|
+
CellColorInput.displayName = 'CellColorInput';
|
|
195
|
+
//# sourceMappingURL=cell-color-input.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_designSystem","_useTranslations","_hex2","_jsxFileName","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","CellColorInput","exports","forwardRef","value","colorValue","onChange","onBlur","popoverProps","inputRef","props","ref","useTranslations","inputValue","setInputValue","useState","omitHash","showPicker","setShowPicker","pickerHex","setPickerHex","isValidHex","undefined","onInputChange","useCallback","raw","target","replace","hex","normalizeHex","onInputBlur","onPickerConfirm","confirmedColor","_hex","toUpperCase","onPickerCancel","togglePicker","prev","useEffect","close","opts","capture","window","addEventListener","passive","removeEventListener","showAddColorButton","addColorTooltip","popoverDefaults","animate","flip","fixed","placement","appendTo","moveBy","x","y","zIndex","createElement","Input","_extends2","instance","current","prefix","Affix","__self","__source","fileName","lineNumber","columnNumber","suffix","Popover","shown","onClickOutside","Element","FillButton","onClick","tooltipContent","FillPreview","fill","Content","ColorPicker","c","onConfirm","onCancel","showConverter","allowEmpty","displayName"],"sources":["../../../../src/components/color-view/cell-color-input.tsx"],"sourcesContent":["import React, { forwardRef, useCallback, useEffect, useState } from 'react';\nimport type {\n ColorPickerProps,\n InputImperativeActions,\n InputProps,\n PopoverProps,\n} from '@wix/design-system';\nimport {\n ColorPicker,\n FillButton,\n FillPreview,\n Input,\n Popover,\n} from '@wix/design-system';\nimport { useTranslations } from '../../hooks/use-translations';\nimport { isValidHex, normalizeHex, omitHash } from './hex';\n\nexport interface CellColorInputProps\n extends Omit<\n InputProps,\n 'value' | 'onChange' | 'prefix' | 'suffix' | 'inputRef'\n > {\n value?: string;\n onChange?: (text: string) => void;\n popoverProps?: Partial<PopoverProps>;\n inputRef?: React.MutableRefObject<InputImperativeActions | null | undefined>;\n}\n\n/**\n * Cell-layer ColorInput for EditableTable. Differs from the form ColorInput in\n * four ways required by the cell context:\n * 1. `popoverProps` passthrough so the picker can `appendTo: 'window'` and\n * escape the table's scroll container.\n * 2. The empty-state add-color button appears for invalid values too (not\n * only missing) — mid-typing or post-commit bad hex should still expose\n * the picker as an escape hatch.\n * 3. Invalid input on blur is forwarded upward (prefixed with `#`) so the\n * cell-level `validate()` can surface the error; we don't silently revert.\n * 4. Picker closes on any ancestor scroll while open — the portaled popover\n * does not follow the trigger.\n */\nexport const CellColorInput = forwardRef<\n InputImperativeActions,\n CellColorInputProps\n>(\n (\n { value: colorValue, onChange, onBlur, popoverProps, inputRef, ...props },\n ref,\n ) => {\n const { t } = useTranslations();\n const [inputValue, setInputValue] = useState(\n colorValue ? omitHash(colorValue) : '',\n );\n const [showPicker, setShowPicker] = useState(false);\n const [pickerHex, setPickerHex] = useState<string | undefined>(\n colorValue && isValidHex(colorValue) ? colorValue : undefined,\n );\n\n const onInputChange = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n const raw = e.target.value.replace(/^#/, '');\n setInputValue(raw);\n\n const hex = normalizeHex(raw);\n if (hex) {\n setPickerHex(hex);\n onChange?.(hex);\n } else {\n onChange?.(raw === '' ? '' : `#${raw}`);\n }\n },\n [onChange],\n );\n\n const onInputBlur = useCallback(\n (e: React.FocusEvent<HTMLInputElement>) => {\n const hex = normalizeHex(inputValue);\n if (hex) {\n onChange?.(hex);\n setInputValue(omitHash(hex));\n }\n onBlur?.(e);\n },\n [onChange, onBlur, inputValue],\n );\n\n const onPickerConfirm = useCallback(\n (confirmedColor: ColorPickerProps['value']) => {\n const hex =\n typeof confirmedColor === 'string'\n ? confirmedColor.toUpperCase()\n : (confirmedColor as { hex?: () => string } | null | undefined)\n ?.hex?.()\n ?.toUpperCase();\n if (hex) {\n onChange?.(hex);\n setInputValue(omitHash(hex));\n setPickerHex(hex);\n } else {\n onChange?.('');\n setInputValue('');\n setPickerHex(undefined);\n }\n setShowPicker(false);\n },\n [onChange],\n );\n\n const onPickerCancel = useCallback(() => {\n setPickerHex(\n colorValue && isValidHex(colorValue) ? colorValue : undefined,\n );\n setShowPicker(false);\n }, [colorValue]);\n\n const togglePicker = useCallback(() => {\n setShowPicker((prev) => !prev);\n }, []);\n\n useEffect(() => {\n if (!showPicker) {\n return;\n }\n const close = () => setShowPicker(false);\n const opts = { capture: true } as const;\n window.addEventListener('scroll', close, { ...opts, passive: true });\n return () => window.removeEventListener('scroll', close, opts);\n }, [showPicker]);\n\n const showAddColorButton = !colorValue || !isValidHex(colorValue);\n const addColorTooltip = t('auto-patterns.fields.add_color_tooltip');\n\n const popoverDefaults: Partial<PopoverProps> = {\n animate: true,\n flip: true,\n fixed: false,\n placement: 'bottom-start',\n appendTo: 'window',\n moveBy: { x: 0, y: 4 },\n zIndex: 9999,\n };\n\n return (\n <Input\n {...props}\n ref={(instance) => {\n if (inputRef) inputRef.current = instance;\n if (typeof ref === 'function') ref(instance);\n else if (ref) ref.current = instance;\n }}\n value={inputValue}\n onChange={onInputChange}\n onBlur={onInputBlur}\n prefix={<Input.Affix>#</Input.Affix>}\n suffix={\n <Input.Affix>\n <Popover\n {...popoverDefaults}\n {...popoverProps}\n shown={showPicker}\n onClickOutside={() => setShowPicker(false)}\n >\n <Popover.Element>\n {showAddColorButton ? (\n <FillButton\n onClick={togglePicker}\n tooltipContent={addColorTooltip}\n />\n ) : (\n <FillPreview fill={colorValue} onClick={togglePicker} />\n )}\n </Popover.Element>\n <Popover.Content>\n <ColorPicker\n value={pickerHex as ColorPickerProps['value']}\n onChange={\n ((c: ColorPickerProps['value']) =>\n setPickerHex(\n typeof c === 'string'\n ? c\n : (\n c as { hex?: () => string } | null | undefined\n )?.hex?.(),\n )) as ColorPickerProps['onChange']\n }\n onConfirm={onPickerConfirm}\n onCancel={onPickerCancel}\n showConverter\n allowEmpty\n />\n </Popover.Content>\n </Popover>\n </Input.Affix>\n }\n />\n );\n },\n);\n\nCellColorInput.displayName = 'CellColorInput';\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAOA,IAAAC,aAAA,GAAAD,OAAA;AAOA,IAAAE,gBAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AAA2D,IAAAI,YAAA;AAAA,SAAAL,wBAAAM,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA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,CAE1C,CAAC,eAClB9F,MAAA,CAAAiB,OAAA,CAAAkE,aAAA,CAAChF,aAAA,CAAA6F,OAAO,CAACS,OAAO;MAAAf,MAAA;MAAAC,QAAA;QAAAC,QAAA,EAAAtF,YAAA;QAAAuF,UAAA;QAAAC,YAAA;MAAA;IAAA,gBACd9F,MAAA,CAAAiB,OAAA,CAAAkE,aAAA,CAAChF,aAAA,CAAAuG,WAAW;MACV7E,KAAK,EAAEe,SAAuC;MAC9Cb,QAAQ,EACJ4E,CAA4B,IAC5B9D,YAAY,CACV,OAAO8D,CAAC,KAAK,QAAQ,GACjBA,CAAC,GAECA,CAAC,YAADA,CAAC,CACAtD,GAAG,oBADJsD,CAAC,CACAtD,GAAG,CAAG,CACf,CACH;MACDuD,SAAS,EAAEpD,eAAgB;MAC3BqD,QAAQ,EAAEjD,cAAe;MACzBkD,aAAa;MACbC,UAAU;MAAArB,MAAA;MAAAC,QAAA;QAAAC,QAAA,EAAAtF,YAAA;QAAAuF,UAAA;QAAAC,YAAA;MAAA;IAAA,CACX,CACc,CACV,CACE,CACd;IAAAJ,MAAA;IAAAC,QAAA;MAAAC,QAAA,EAAAtF,YAAA;MAAAuF,UAAA;MAAAC,YAAA;IAAA;EAAA,EACF,CAAC;AAEN,CACF,CAAC;AAEDpE,cAAc,CAACsF,WAAW,GAAG,gBAAgB","ignoreList":[]}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
exports.__esModule = true;
|
|
5
|
+
exports.CellColorView = void 0;
|
|
6
|
+
var _react = _interopRequireDefault(require("react"));
|
|
7
|
+
var _designSystem = require("@wix/design-system");
|
|
8
|
+
var _cellColorViewStCss = require("./cell-color-view.st.css.js");
|
|
9
|
+
var _hex = require("./hex");
|
|
10
|
+
var _jsxFileName = "/home/builduser/work/843658b9f44192f0/packages/fields/dist/cjs/components/color-view/cell-color-view.tsx";
|
|
11
|
+
/**
|
|
12
|
+
* Cell-layer color view. Matches the visual layout of CellColorInput so the
|
|
13
|
+
* View↔Edit transition is seamless.
|
|
14
|
+
*
|
|
15
|
+
* "#" (placeholder color) hex digits (thin, uppercase) [swatch right]
|
|
16
|
+
*
|
|
17
|
+
* Empty or invalid values show only the `#` on the left and the empty-state
|
|
18
|
+
* FillPreview (diagonal-slash placeholder) on the right.
|
|
19
|
+
*/
|
|
20
|
+
const CellColorView = ({
|
|
21
|
+
value
|
|
22
|
+
}) => {
|
|
23
|
+
const isValid = !!value && _hex.HEX_RE.test(value);
|
|
24
|
+
const hex = value ? value.replace(/^#/, '').toUpperCase() : '';
|
|
25
|
+
return /*#__PURE__*/_react.default.createElement(_designSystem.Box, {
|
|
26
|
+
width: "100%",
|
|
27
|
+
verticalAlign: "middle",
|
|
28
|
+
align: "space-between",
|
|
29
|
+
gap: "SP1",
|
|
30
|
+
dataHook: "cell-color-view",
|
|
31
|
+
__self: void 0,
|
|
32
|
+
__source: {
|
|
33
|
+
fileName: _jsxFileName,
|
|
34
|
+
lineNumber: 24,
|
|
35
|
+
columnNumber: 5
|
|
36
|
+
}
|
|
37
|
+
}, /*#__PURE__*/_react.default.createElement(_designSystem.Box, {
|
|
38
|
+
gap: "SP1",
|
|
39
|
+
verticalAlign: "middle",
|
|
40
|
+
__self: void 0,
|
|
41
|
+
__source: {
|
|
42
|
+
fileName: _jsxFileName,
|
|
43
|
+
lineNumber: 31,
|
|
44
|
+
columnNumber: 7
|
|
45
|
+
}
|
|
46
|
+
}, /*#__PURE__*/_react.default.createElement(_designSystem.Box, {
|
|
47
|
+
className: _cellColorViewStCss.classes.hashPrefix,
|
|
48
|
+
dataHook: "cell-color-view-hash",
|
|
49
|
+
__self: void 0,
|
|
50
|
+
__source: {
|
|
51
|
+
fileName: _jsxFileName,
|
|
52
|
+
lineNumber: 32,
|
|
53
|
+
columnNumber: 9
|
|
54
|
+
}
|
|
55
|
+
}, "#"), hex ? /*#__PURE__*/_react.default.createElement(_designSystem.Text, {
|
|
56
|
+
size: "small",
|
|
57
|
+
weight: "thin",
|
|
58
|
+
dataHook: "cell-color-view-text",
|
|
59
|
+
__self: void 0,
|
|
60
|
+
__source: {
|
|
61
|
+
fileName: _jsxFileName,
|
|
62
|
+
lineNumber: 36,
|
|
63
|
+
columnNumber: 11
|
|
64
|
+
}
|
|
65
|
+
}, hex) : null), /*#__PURE__*/_react.default.createElement(_designSystem.Box, {
|
|
66
|
+
width: "24px",
|
|
67
|
+
height: "24px",
|
|
68
|
+
flexShrink: 0,
|
|
69
|
+
__self: void 0,
|
|
70
|
+
__source: {
|
|
71
|
+
fileName: _jsxFileName,
|
|
72
|
+
lineNumber: 41,
|
|
73
|
+
columnNumber: 7
|
|
74
|
+
}
|
|
75
|
+
}, /*#__PURE__*/_react.default.createElement(_designSystem.FillPreview, {
|
|
76
|
+
fill: isValid ? value : undefined,
|
|
77
|
+
aspectRatio: 1,
|
|
78
|
+
dataHook: "cell-color-view-fill-preview",
|
|
79
|
+
__self: void 0,
|
|
80
|
+
__source: {
|
|
81
|
+
fileName: _jsxFileName,
|
|
82
|
+
lineNumber: 42,
|
|
83
|
+
columnNumber: 9
|
|
84
|
+
}
|
|
85
|
+
})));
|
|
86
|
+
};
|
|
87
|
+
exports.CellColorView = CellColorView;
|
|
88
|
+
CellColorView.displayName = 'CellColorView';
|
|
89
|
+
//# sourceMappingURL=cell-color-view.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_designSystem","_cellColorViewStCss","_hex","_jsxFileName","CellColorView","value","isValid","HEX_RE","test","hex","replace","toUpperCase","default","createElement","Box","width","verticalAlign","align","gap","dataHook","__self","__source","fileName","lineNumber","columnNumber","className","classes","hashPrefix","Text","size","weight","height","flexShrink","FillPreview","fill","undefined","aspectRatio","exports","displayName"],"sources":["../../../../src/components/color-view/cell-color-view.tsx"],"sourcesContent":["import React from 'react';\nimport { Box, FillPreview, Text } from '@wix/design-system';\nimport { classes } from './cell-color-view.st.css.js';\nimport { HEX_RE } from './hex';\n\nexport interface CellColorViewProps {\n value?: string;\n}\n\n/**\n * Cell-layer color view. Matches the visual layout of CellColorInput so the\n * View↔Edit transition is seamless.\n *\n * \"#\" (placeholder color) hex digits (thin, uppercase) [swatch right]\n *\n * Empty or invalid values show only the `#` on the left and the empty-state\n * FillPreview (diagonal-slash placeholder) on the right.\n */\nexport const CellColorView: React.FC<CellColorViewProps> = ({ value }) => {\n const isValid = !!value && HEX_RE.test(value);\n const hex = value ? value.replace(/^#/, '').toUpperCase() : '';\n\n return (\n <Box\n width=\"100%\"\n verticalAlign=\"middle\"\n align=\"space-between\"\n gap=\"SP1\"\n dataHook=\"cell-color-view\"\n >\n <Box gap=\"SP1\" verticalAlign=\"middle\">\n <Box className={classes.hashPrefix} dataHook=\"cell-color-view-hash\">\n #\n </Box>\n {hex ? (\n <Text size=\"small\" weight=\"thin\" dataHook=\"cell-color-view-text\">\n {hex}\n </Text>\n ) : null}\n </Box>\n <Box width=\"24px\" height=\"24px\" flexShrink={0}>\n <FillPreview\n fill={isValid ? value : undefined}\n aspectRatio={1}\n dataHook=\"cell-color-view-fill-preview\"\n />\n </Box>\n </Box>\n );\n};\n\nCellColorView.displayName = 'CellColorView';\n"],"mappings":";;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;AACA,IAAAE,mBAAA,GAAAF,OAAA;AACA,IAAAG,IAAA,GAAAH,OAAA;AAA+B,IAAAI,YAAA;AAM/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,aAA2C,GAAGA,CAAC;EAAEC;AAAM,CAAC,KAAK;EACxE,MAAMC,OAAO,GAAG,CAAC,CAACD,KAAK,IAAIE,WAAM,CAACC,IAAI,CAACH,KAAK,CAAC;EAC7C,MAAMI,GAAG,GAAGJ,KAAK,GAAGA,KAAK,CAACK,OAAO,CA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