@wix/patterns-fields 1.72.0 → 1.73.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/address/input/form-address-input.js +5 -16
- package/dist/cjs/components/address/input/form-address-input.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 +14 -13
- 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-field/form-audio.js +6 -1
- package/dist/cjs/components/audio/audio-field/form-audio.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.js +7 -6
- package/dist/cjs/components/document/form-document-field.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/document/form-document.js +6 -1
- package/dist/cjs/components/document/form-document.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/form-image-input.js +6 -1
- package/dist/cjs/components/image/form-image-input.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.js +24 -21
- package/dist/cjs/components/media-gallery/form-media-gallery-field.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/form-media-gallery.js +6 -1
- package/dist/cjs/components/media-gallery/form-media-gallery.js.map +1 -1
- package/dist/cjs/components/media-image/media-image.st.css.js +4 -4
- package/dist/cjs/components/media-image/media-image.st.css.js.map +1 -1
- package/dist/cjs/components/media-image/overlays/overlay.st.css.js +3 -3
- package/dist/cjs/components/media-image/overlays/overlay.st.css.js.map +1 -1
- package/dist/cjs/components/media-loader/media-loader.st.css.js +3 -3
- package/dist/cjs/components/media-loader/media-loader.st.css.js.map +1 -1
- package/dist/cjs/components/media-tag/web-media-tag/media-tag.st.css.js +2 -2
- package/dist/cjs/components/media-tag/web-media-tag/media-tag.st.css.js.map +1 -1
- package/dist/cjs/components/multi-document/cell-multi-document-edit.st.css.js +3 -3
- package/dist/cjs/components/multi-document/cell-multi-document-edit.st.css.js.map +1 -1
- package/dist/cjs/components/multi-document/multi-document-input/form-multi-document-field.js +7 -6
- package/dist/cjs/components/multi-document/multi-document-input/form-multi-document-field.js.map +1 -1
- package/dist/cjs/components/multi-document/multi-document-input/form-multi-document.js +6 -1
- package/dist/cjs/components/multi-document/multi-document-input/form-multi-document.js.map +1 -1
- package/dist/cjs/components/multi-document/multi-document-input/form-multi-document.st.css.js +5 -5
- package/dist/cjs/components/multi-document/multi-document-input/form-multi-document.st.css.js.map +1 -1
- package/dist/cjs/components/reference/cell-multi-reference-input.st.css.js +2 -2
- package/dist/cjs/components/reference/cell-multi-reference-input.st.css.js.map +1 -1
- package/dist/cjs/components/reference/cell-reference-input.st.css.js +3 -3
- package/dist/cjs/components/reference/cell-reference-input.st.css.js.map +1 -1
- package/dist/cjs/components/rich-content/form-rich-content.js +20 -5
- package/dist/cjs/components/rich-content/form-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/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/form-rich-text.js +18 -5
- package/dist/cjs/components/rich-text/form-rich-text.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/hooks/index.js +12 -0
- package/dist/cjs/hooks/index.js.map +1 -1
- package/dist/cjs/hooks/use-merged-ref.js +27 -0
- package/dist/cjs/hooks/use-merged-ref.js.map +1 -0
- package/dist/cjs/hooks/use-scroll-to-error-ref.js +34 -0
- package/dist/cjs/hooks/use-scroll-to-error-ref.js.map +1 -0
- package/dist/cjs/styles.global.css +1 -1
- package/dist/esm/components/address/input/address-input.st.css.js +2 -2
- package/dist/esm/components/address/input/address-input.st.css.js.map +1 -1
- package/dist/esm/components/address/input/form-address-input.js +4 -15
- package/dist/esm/components/address/input/form-address-input.js.map +1 -1
- 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 +4 -4
- 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-field/form-audio.js +9 -1
- package/dist/esm/components/audio/audio-field/form-audio.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-view.st.css.js +2 -2
- package/dist/esm/components/color-view/color-view.st.css.js +2 -2
- package/dist/esm/components/delete-dialog/delete-dialog.st.css.js +2 -2
- package/dist/esm/components/delete-dialog/delete-dialog.st.css.js.map +1 -1
- package/dist/esm/components/document/form-document-field.js +4 -4
- package/dist/esm/components/document/form-document-field.js.map +1 -1
- package/dist/esm/components/document/form-document-field.st.css.js +2 -2
- package/dist/esm/components/document/form-document-field.st.css.js.map +1 -1
- package/dist/esm/components/document/form-document.js +9 -1
- package/dist/esm/components/document/form-document.js.map +1 -1
- package/dist/esm/components/exclamation/exclamation.st.css.js +2 -2
- package/dist/esm/components/highlighted-text/highlighted-text.st.css.js +3 -3
- package/dist/esm/components/highlighted-text/highlighted-text.st.css.js.map +1 -1
- package/dist/esm/components/image/form-image-input.js +9 -1
- package/dist/esm/components/image/form-image-input.js.map +1 -1
- package/dist/esm/components/image/thumbnail-replace-overlay.st.css.js +2 -2
- package/dist/esm/components/media-control/cell-media-edit-shell.st.css.js +2 -2
- package/dist/esm/components/media-control/cell-media-edit-shell.st.css.js.map +1 -1
- package/dist/esm/components/media-control/paste-url-button.st.css.js +2 -2
- package/dist/esm/components/media-control/paste-url-button.st.css.js.map +1 -1
- package/dist/esm/components/media-gallery/form-media-gallery-field.js +7 -5
- package/dist/esm/components/media-gallery/form-media-gallery-field.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.js +9 -1
- package/dist/esm/components/media-gallery/form-media-gallery.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/overlays/overlay.st.css.js.map +1 -1
- package/dist/esm/components/media-loader/media-loader.st.css.js +2 -2
- package/dist/esm/components/media-loader/media-loader.st.css.js.map +1 -1
- 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.st.css.js +2 -2
- package/dist/esm/components/multi-document/cell-multi-document-edit.st.css.js.map +1 -1
- package/dist/esm/components/multi-document/multi-document-input/form-multi-document-field.js +4 -4
- package/dist/esm/components/multi-document/multi-document-input/form-multi-document-field.js.map +1 -1
- package/dist/esm/components/multi-document/multi-document-input/form-multi-document.js +9 -1
- package/dist/esm/components/multi-document/multi-document-input/form-multi-document.js.map +1 -1
- package/dist/esm/components/multi-document/multi-document-input/form-multi-document.st.css.js +2 -2
- package/dist/esm/components/multi-document/multi-document-input/form-multi-document.st.css.js.map +1 -1
- package/dist/esm/components/reference/cell-multi-reference-input.st.css.js +2 -2
- package/dist/esm/components/reference/cell-reference-input.st.css.js +2 -2
- package/dist/esm/components/rich-content/form-rich-content.js +8 -3
- package/dist/esm/components/rich-content/form-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/form-input/rich-content-form-input.st.css.js +2 -2
- package/dist/esm/components/rich-content/rich-content-input/form-input/rich-content-form-input.st.css.js.map +1 -1
- package/dist/esm/components/rich-content/rich-content-input/form-read-only-input/rich-content-form-read-only-input.st.css.js +2 -2
- package/dist/esm/components/rich-content/rich-content-input/rich-content-common/fullscreen-modal/fullscreen-modal.st.css.js +2 -2
- package/dist/esm/components/rich-content/rich-content-input/rich-content-common/publish-loader/publish-loader.st.css.js +2 -2
- package/dist/esm/components/rich-content/rich-content-input/rich-content-common/toggle-fullscreen-button/toggle-fullscreen-button.st.css.js +2 -2
- package/dist/esm/components/rich-content/rich-content-input/rich-content-editor/rich-content-editor.st.css.js +2 -2
- package/dist/esm/components/rich-content/rich-content-input/rich-content-editor/rich-content-editor.st.css.js.map +1 -1
- package/dist/esm/components/rich-content/rich-content-input/rich-content-editor/rich-content-toolbar.st.css.js +2 -2
- package/dist/esm/components/rich-content/rich-content-input/rich-content-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/form-rich-text.js +7 -3
- package/dist/esm/components/rich-text/form-rich-text.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-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/text/text-view.st.css.js.map +1 -1
- package/dist/esm/hooks/index.js +2 -0
- package/dist/esm/hooks/index.js.map +1 -1
- package/dist/esm/hooks/use-merged-ref.js +23 -0
- package/dist/esm/hooks/use-merged-ref.js.map +1 -0
- package/dist/esm/hooks/use-scroll-to-error-ref.js +26 -0
- package/dist/esm/hooks/use-scroll-to-error-ref.js.map +1 -0
- package/dist/esm/styles.global.css +1 -1
- package/dist/types/components/address/input/address-input.st.css.d.ts.map +1 -1
- package/dist/types/components/address/input/form-address-input.d.ts.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/audio/audio-field/form-audio.d.ts.map +1 -1
- package/dist/types/components/delete-dialog/delete-dialog.st.css.d.ts.map +1 -1
- package/dist/types/components/document/form-document-field.d.ts.map +1 -1
- package/dist/types/components/document/form-document-field.st.css.d.ts.map +1 -1
- package/dist/types/components/document/form-document.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/form-image-input.d.ts.map +1 -1
- package/dist/types/components/media-control/cell-media-edit-shell.st.css.d.ts.map +1 -1
- package/dist/types/components/media-control/paste-url-button.st.css.d.ts.map +1 -1
- package/dist/types/components/media-gallery/form-media-gallery-field.d.ts +3 -0
- package/dist/types/components/media-gallery/form-media-gallery-field.d.ts.map +1 -1
- package/dist/types/components/media-gallery/form-media-gallery.d.ts.map +1 -1
- package/dist/types/components/media-image/overlays/overlay.st.css.d.ts.map +1 -1
- package/dist/types/components/media-loader/media-loader.st.css.d.ts.map +1 -1
- package/dist/types/components/multi-document/cell-multi-document-edit.st.css.d.ts.map +1 -1
- package/dist/types/components/multi-document/multi-document-input/form-multi-document-field.d.ts.map +1 -1
- package/dist/types/components/multi-document/multi-document-input/form-multi-document.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/form-rich-content.d.ts.map +1 -1
- package/dist/types/components/rich-content/rich-content-input/form-input/rich-content-form-input.st.css.d.ts.map +1 -1
- package/dist/types/components/rich-content/rich-content-input/rich-content-editor/rich-content-editor.st.css.d.ts.map +1 -1
- package/dist/types/components/rich-content/rich-content-input/rich-content-viewer/rich-content-viewer.st.css.d.ts.map +1 -1
- package/dist/types/components/rich-text/form-rich-text.d.ts.map +1 -1
- package/dist/types/components/text/text-view.st.css.d.ts.map +1 -1
- package/dist/types/hooks/index.d.ts +2 -0
- package/dist/types/hooks/index.d.ts.map +1 -1
- package/dist/types/hooks/use-merged-ref.d.ts +11 -0
- package/dist/types/hooks/use-merged-ref.d.ts.map +1 -0
- package/dist/types/hooks/use-scroll-to-error-ref.d.ts +14 -0
- package/dist/types/hooks/use-scroll-to-error-ref.d.ts.map +1 -0
- package/package.json +5 -5
- package/src/__tests__/components/audio/form-audio.spec.tsx +22 -0
- package/src/__tests__/components/document/form-document.spec.tsx +22 -0
- package/src/__tests__/components/image/form-image-input.spec.tsx +22 -0
- package/src/__tests__/components/media-gallery/form-media-gallery.spec.tsx +21 -0
- package/src/__tests__/components/multi-document/form-multi-document.spec.tsx +21 -0
- package/src/__tests__/components/rich-content/form-rich-content.spec.tsx +22 -0
- package/src/__tests__/components/rich-text/form-rich-text.spec.tsx +18 -0
- package/src/components/address/input/address-input.st.css.ts +2 -2
- package/src/components/address/input/form-address-input.tsx +5 -20
- 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 +4 -3
- package/src/components/audio/audio-field/form-audio.tsx +4 -0
- 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/document/form-document-field.tsx +4 -3
- package/src/components/document/form-document.tsx +4 -0
- 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/form-image-input.tsx +4 -0
- package/src/components/image/thumbnail-replace-overlay.st.css.ts +2 -2
- package/src/components/media-control/cell-media-edit-shell.st.css.ts +2 -2
- package/src/components/media-control/paste-url-button.st.css.ts +2 -2
- package/src/components/media-gallery/form-media-gallery-field.st.css.ts +2 -2
- package/src/components/media-gallery/form-media-gallery-field.tsx +9 -4
- package/src/components/media-gallery/form-media-gallery.tsx +4 -0
- package/src/components/media-image/media-image.st.css.ts +3 -3
- package/src/components/media-image/overlays/overlay.st.css.ts +2 -2
- package/src/components/media-loader/media-loader.st.css.ts +2 -2
- package/src/components/media-tag/web-media-tag/media-tag.st.css.ts +2 -2
- package/src/components/multi-document/cell-multi-document-edit.st.css.ts +2 -2
- package/src/components/multi-document/multi-document-input/form-multi-document-field.tsx +4 -3
- package/src/components/multi-document/multi-document-input/form-multi-document.st.css.ts +2 -2
- package/src/components/multi-document/multi-document-input/form-multi-document.tsx +4 -0
- package/src/components/reference/cell-multi-reference-input.st.css.ts +2 -2
- package/src/components/reference/cell-reference-input.st.css.ts +2 -2
- package/src/components/rich-content/form-rich-content.tsx +24 -14
- 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/form-rich-text.tsx +18 -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/hooks/index.ts +2 -0
- package/src/hooks/use-merged-ref.ts +30 -0
- package/src/hooks/use-scroll-to-error-ref.ts +34 -0
- package/src/styles.global.css +1 -1
|
@@ -5,7 +5,7 @@ import { classesRuntime, statesRuntime } from "../../stylable-esm-runtime.js";
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var _namespace_ = "
|
|
8
|
+
var _namespace_ = "medialoader142891810";
|
|
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":"medialoader142891810__root","loader":"medialoader142891810__loader"};
|
|
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_ = "mediatag1597208276";
|
|
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":"mediatag1597208276__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_ = "cellmultidocumentedit2776735104";
|
|
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":"cellmultidocumentedit2776735104__root","chipTrigger":"cellmultidocumentedit2776735104__chipTrigger"};
|
|
17
17
|
export var keyframes = {};
|
|
18
18
|
export var layers = {};
|
|
19
19
|
export var containers = {};
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
usePasteURLForm,
|
|
11
11
|
} from '../../media-control';
|
|
12
12
|
import { FormDocumentInput } from '../../document/form';
|
|
13
|
-
import { useTranslations, useWithCallback } from '../../../hooks';
|
|
13
|
+
import { useMergedRef, useTranslations, useWithCallback } from '../../../hooks';
|
|
14
14
|
|
|
15
15
|
import { FormMultiDocumentView } from './form-multi-document-view';
|
|
16
16
|
|
|
@@ -24,12 +24,13 @@ export const FormMultiDocumentField: React.FC<
|
|
|
24
24
|
readOnly,
|
|
25
25
|
invalid,
|
|
26
26
|
dataHook,
|
|
27
|
+
inputRef: forwardedRef,
|
|
27
28
|
}) => {
|
|
28
29
|
const { t } = useTranslations();
|
|
29
30
|
|
|
30
31
|
const onChange = useWithCallback(onChangeMultiDocument, onInput);
|
|
31
32
|
|
|
32
|
-
const inputRef =
|
|
33
|
+
const [inputRef, setInputRef] = useMergedRef<AddItemActions>(forwardedRef);
|
|
33
34
|
const firstDocumentViewRef = useRef<HTMLDivElement>(null);
|
|
34
35
|
|
|
35
36
|
const { callMedia, loading, downloadMedia } = useMediaControl({
|
|
@@ -77,7 +78,7 @@ export const FormMultiDocumentField: React.FC<
|
|
|
77
78
|
) : (
|
|
78
79
|
<FormDocumentInput
|
|
79
80
|
dataHook={dataHook}
|
|
80
|
-
ref={
|
|
81
|
+
ref={setInputRef}
|
|
81
82
|
theme="dashes"
|
|
82
83
|
disabled={readOnly}
|
|
83
84
|
loading={loading}
|
|
@@ -5,7 +5,7 @@ import { classesRuntime, statesRuntime } from "../../../stylable-esm-runtime.js"
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var _namespace_ = "
|
|
8
|
+
var _namespace_ = "formmultidocument857357206";
|
|
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":"formmultidocument857357206__root","viewRoot":"formmultidocument857357206__viewRoot","singleViewWrapper":"formmultidocument857357206__singleViewWrapper","addDocumentButton":"formmultidocument857357206__addDocumentButton"};
|
|
17
17
|
export var keyframes = {};
|
|
18
18
|
export var layers = {};
|
|
19
19
|
export var containers = {};
|
|
@@ -39,6 +39,10 @@ const _FormMultiDocument = (props: FormMultiDocumentProps) => {
|
|
|
39
39
|
dataHook={dataHook}
|
|
40
40
|
>
|
|
41
41
|
<FormMultiDocumentField
|
|
42
|
+
// Hand the add button to react-hook-form so
|
|
43
|
+
// shouldFocusError scrolls to + focuses this field when it
|
|
44
|
+
// blocks save.
|
|
45
|
+
inputRef={controller.field.ref}
|
|
42
46
|
data={controller.field.value}
|
|
43
47
|
onChange={(value) => controller.field.onChange(value)}
|
|
44
48
|
dataHook={`multi-document-${field.id}`}
|
|
@@ -5,7 +5,7 @@ import { classesRuntime, statesRuntime } from "../../stylable-esm-runtime.js";
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var _namespace_ = "
|
|
8
|
+
var _namespace_ = "cellmultireferenceinput2676689456";
|
|
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":"cellmultireferenceinput2676689456__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_ = "cellreferenceinput1109486214";
|
|
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":"cellreferenceinput1109486214__root","autocomplete":"cellreferenceinput1109486214__autocomplete"};
|
|
17
17
|
export var keyframes = {};
|
|
18
18
|
export var layers = {};
|
|
19
19
|
export var containers = {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { FormField } from '@wix/design-system';
|
|
2
|
+
import { Box, FormField } from '@wix/design-system';
|
|
3
3
|
import { observer } from 'mobx-react-lite';
|
|
4
4
|
import type {
|
|
5
5
|
RichContent as RichContentType,
|
|
@@ -11,7 +11,7 @@ import { useWixPatternsContainer } from '@wix/bex-core/react';
|
|
|
11
11
|
import { useController } from '@wix/bex-core/form';
|
|
12
12
|
|
|
13
13
|
import { BaseInputProps } from '../../types/base-input';
|
|
14
|
-
import { useTranslations } from '../../hooks';
|
|
14
|
+
import { useScrollToErrorRef, useTranslations } from '../../hooks';
|
|
15
15
|
import { isEmpty } from '../../validations/string';
|
|
16
16
|
import {
|
|
17
17
|
isDataValidOrNotSet,
|
|
@@ -49,6 +49,14 @@ const _FormRichContent = (props: FormRichContentProps) => {
|
|
|
49
49
|
richContentValidation,
|
|
50
50
|
);
|
|
51
51
|
|
|
52
|
+
// The editor is lazy and exposes no focus handle, so hand react-hook-form
|
|
53
|
+
// a wrapper it can bring into view instead. The wrapper stays mounted even
|
|
54
|
+
// when the value is the wrong type and the editor is not rendered.
|
|
55
|
+
const setScrollToErrorRef = useScrollToErrorRef<HTMLDivElement>(
|
|
56
|
+
controller.field.ref,
|
|
57
|
+
'[contenteditable]',
|
|
58
|
+
);
|
|
59
|
+
|
|
52
60
|
return (
|
|
53
61
|
<FormField
|
|
54
62
|
label={field.displayName}
|
|
@@ -78,18 +86,20 @@ const _FormRichContent = (props: FormRichContentProps) => {
|
|
|
78
86
|
)
|
|
79
87
|
}
|
|
80
88
|
>
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
89
|
+
<Box direction="vertical" width="100%" ref={setScrollToErrorRef}>
|
|
90
|
+
{isValueValid ? (
|
|
91
|
+
<FormRichContentInput
|
|
92
|
+
autoFocus={false}
|
|
93
|
+
data={controller.field.value}
|
|
94
|
+
onChange={(value) => controller.field.onChange?.(value)}
|
|
95
|
+
dataHook={`rich-content-${field.id}`}
|
|
96
|
+
field={field.id}
|
|
97
|
+
theme={theme}
|
|
98
|
+
experiments={ricosExperiments}
|
|
99
|
+
isSiteMetadataLoading={false}
|
|
100
|
+
/>
|
|
101
|
+
) : null}
|
|
102
|
+
</Box>
|
|
93
103
|
</FormField>
|
|
94
104
|
);
|
|
95
105
|
};
|
|
@@ -5,7 +5,7 @@ import { classesRuntime, statesRuntime } from "../../../../stylable-esm-runtime.
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var _namespace_ = "
|
|
8
|
+
var _namespace_ = "richcontentdefaultvalueinput4174470607";
|
|
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":"richcontentdefaultvalueinput4174470607__root","richContentEditorContainer":"richcontentdefaultvalueinput4174470607__richContentEditorContainer","editor":"richcontentdefaultvalueinput4174470607__editor"};
|
|
17
17
|
export var keyframes = {};
|
|
18
18
|
export var layers = {};
|
|
19
19
|
export var containers = {};
|
package/src/components/rich-content/rich-content-input/form-input/rich-content-form-input.st.css.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { classesRuntime, statesRuntime } from "../../../../stylable-esm-runtime.
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var _namespace_ = "
|
|
8
|
+
var _namespace_ = "richcontentforminput1903671592";
|
|
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":"richcontentforminput1903671592__root","editor":"richcontentforminput1903671592__editor"};
|
|
17
17
|
export var keyframes = {};
|
|
18
18
|
export var layers = {};
|
|
19
19
|
export var containers = {};
|
|
@@ -5,7 +5,7 @@ import { classesRuntime, statesRuntime } from "../../../../stylable-esm-runtime.
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var _namespace_ = "
|
|
8
|
+
var _namespace_ = "richcontentformreadonlyinput172558332";
|
|
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":"richcontentformreadonlyinput172558332__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-runti
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var _namespace_ = "
|
|
8
|
+
var _namespace_ = "fullscreenmodal208254918";
|
|
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":"fullscreenmodal208254918__root","modalContent":"fullscreenmodal208254918__modalContent"};
|
|
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-runti
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var _namespace_ = "
|
|
8
|
+
var _namespace_ = "publishloader1461570400";
|
|
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":"publishloader1461570400__root","publishLoader":"publishloader1461570400__publishLoader"};
|
|
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-runti
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var _namespace_ = "
|
|
8
|
+
var _namespace_ = "togglefullscreenbutton2385173147";
|
|
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":"togglefullscreenbutton2385173147__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.
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var _namespace_ = "
|
|
8
|
+
var _namespace_ = "richcontenteditor3535846372";
|
|
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":"richcontenteditor3535846372__root","toolbarContainer":"richcontenteditor3535846372__toolbarContainer","footerToolbarContainer":"richcontenteditor3535846372__footerToolbarContainer","toolbarAndFullScreenButtonWrapper":"richcontenteditor3535846372__toolbarAndFullScreenButtonWrapper","editor":"richcontenteditor3535846372__editor","modalEditor":"richcontenteditor3535846372__modalEditor"};
|
|
17
17
|
export var keyframes = {};
|
|
18
18
|
export var layers = {};
|
|
19
19
|
export var containers = {};
|
|
@@ -5,7 +5,7 @@ import { classesRuntime, statesRuntime } from "../../../../stylable-esm-runtime.
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var _namespace_ = "
|
|
8
|
+
var _namespace_ = "richcontenttoolbar2126134109";
|
|
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":"richcontenttoolbar2126134109__root","toolbar":"richcontenttoolbar2126134109__toolbar","toolbarButton":"richcontenttoolbar2126134109__toolbarButton","separator":"richcontenttoolbar2126134109__separator"};
|
|
17
17
|
export var keyframes = {};
|
|
18
18
|
export var layers = {};
|
|
19
19
|
export var containers = {};
|
|
@@ -5,7 +5,7 @@ import { classesRuntime, statesRuntime } from "../../../../stylable-esm-runtime.
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var _namespace_ = "
|
|
8
|
+
var _namespace_ = "richcontentviewer3587365751";
|
|
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":"richcontentviewer3587365751__root","viewer":"richcontentviewer3587365751__viewer","modalViewer":"richcontentviewer3587365751__modalViewer"};
|
|
17
17
|
export var keyframes = {};
|
|
18
18
|
export var layers = {};
|
|
19
19
|
export var containers = {};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { FormField } from '@wix/design-system';
|
|
2
|
+
import { Box, FormField } from '@wix/design-system';
|
|
3
3
|
import { observer } from 'mobx-react-lite';
|
|
4
4
|
import { useWixPatternsContainer } from '@wix/bex-core/react';
|
|
5
5
|
import { useController } from '@wix/bex-core/form';
|
|
6
6
|
|
|
7
7
|
import { BaseInputProps } from '../../types/base-input';
|
|
8
|
-
import { useTranslations } from '../../hooks';
|
|
8
|
+
import { useScrollToErrorRef, useTranslations } from '../../hooks';
|
|
9
9
|
import { isEmpty } from '../../validations/string';
|
|
10
10
|
import {
|
|
11
11
|
isDataValidOrNotSet,
|
|
@@ -36,6 +36,13 @@ const _FormRichText = (props: FormRichTextProps) => {
|
|
|
36
36
|
},
|
|
37
37
|
});
|
|
38
38
|
|
|
39
|
+
// The editor is lazy and exposes no focus handle, so hand react-hook-form
|
|
40
|
+
// a wrapper it can bring into view instead.
|
|
41
|
+
const setScrollToErrorRef = useScrollToErrorRef<HTMLDivElement>(
|
|
42
|
+
controller.field.ref,
|
|
43
|
+
'[contenteditable]',
|
|
44
|
+
);
|
|
45
|
+
|
|
39
46
|
return (
|
|
40
47
|
<FormField
|
|
41
48
|
label={field.displayName}
|
|
@@ -68,13 +75,15 @@ const _FormRichText = (props: FormRichTextProps) => {
|
|
|
68
75
|
)
|
|
69
76
|
}
|
|
70
77
|
>
|
|
71
|
-
<
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
+
<Box width="100%" ref={setScrollToErrorRef}>
|
|
79
|
+
<FormRichTextInput
|
|
80
|
+
autoFocus={false}
|
|
81
|
+
data={controller.field.value}
|
|
82
|
+
onChange={(value) => controller.field.onChange?.(value)}
|
|
83
|
+
dataHook={`rich-text-${field.id}`}
|
|
84
|
+
field={field.id}
|
|
85
|
+
/>
|
|
86
|
+
</Box>
|
|
78
87
|
</FormField>
|
|
79
88
|
);
|
|
80
89
|
};
|
|
@@ -5,7 +5,7 @@ import { classesRuntime, statesRuntime } from "../../../../stylable-esm-runtime.
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var _namespace_ = "
|
|
8
|
+
var _namespace_ = "richeditor3576807230";
|
|
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":"richeditor3576807230__root","editor":"richeditor3576807230__editor","header-one":"richeditor3576807230__header-one","header-two":"richeditor3576807230__header-two","header-three":"richeditor3576807230__header-three","header-four":"richeditor3576807230__header-four","header-five":"richeditor3576807230__header-five","header-six":"richeditor3576807230__header-six","paragraph-one":"richeditor3576807230__paragraph-one","unstyled":"richeditor3576807230__unstyled","paragraph-three":"richeditor3576807230__paragraph-three","align-left":"richeditor3576807230__align-left","align-right":"richeditor3576807230__align-right","align-center":"richeditor3576807230__align-center","align-justify":"richeditor3576807230__align-justify","withMargin":"richeditor3576807230__withMargin","dir-rtl":"richeditor3576807230__dir-rtl"};
|
|
17
17
|
export var keyframes = {};
|
|
18
18
|
export var layers = {};
|
|
19
19
|
export var containers = {};
|
package/src/components/rich-text/rich-text-input/rich-text-editor/rich-text-editor.st.css.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { classesRuntime, statesRuntime } from "../../../../stylable-esm-runtime.
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var _namespace_ = "
|
|
8
|
+
var _namespace_ = "richtexteditor770686478";
|
|
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":"richtexteditor770686478__root","nativeInput":"richtexteditor770686478__nativeInput","editor":"richtexteditor770686478__editor"};
|
|
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-runti
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var _namespace_ = "
|
|
8
|
+
var _namespace_ = "toolbar4106329138";
|
|
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":"toolbar4106329138__root","item":"toolbar4106329138__item","separator":"toolbar4106329138__separator","clearFormatting":"toolbar4106329138__clearFormatting","fullScreen":"toolbar4106329138__fullScreen","dropdownItemContent":"toolbar4106329138__dropdownItemContent","dropdownItemTitle":"toolbar4106329138__dropdownItemTitle","dropdownItemSubtitle":"toolbar4106329138__dropdownItemSubtitle","dropdownHeaderOne":"toolbar4106329138__dropdownHeaderOne","dropdownHeaderTwo":"toolbar4106329138__dropdownHeaderTwo","dropdownHeaderThree":"toolbar4106329138__dropdownHeaderThree","dropdownHeaderFour":"toolbar4106329138__dropdownHeaderFour","dropdownHeaderFive":"toolbar4106329138__dropdownHeaderFive","dropdownHeaderSix":"toolbar4106329138__dropdownHeaderSix","dropdownParagraphOne":"toolbar4106329138__dropdownParagraphOne","dropdownNormalText":"toolbar4106329138__dropdownNormalText","dropdownParagraphThree":"toolbar4106329138__dropdownParagraphThree"};
|
|
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_ = "textview955586509";
|
|
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":"textview955586509__root","textView":"textview955586509__textView"};
|
|
17
17
|
export var keyframes = {};
|
|
18
18
|
export var layers = {};
|
|
19
19
|
export var containers = {};
|
package/src/hooks/index.ts
CHANGED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { MutableRefObject, Ref } from 'react';
|
|
2
|
+
import { useCallback, useRef } from 'react';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Keeps a component's own ref filled while also handing the value to a
|
|
6
|
+
* caller's ref.
|
|
7
|
+
*
|
|
8
|
+
* Media inputs need both: the local ref drives `autoFocus` and media
|
|
9
|
+
* callbacks, while a caller such as react-hook-form supplies its own ref to
|
|
10
|
+
* focus the field when it blocks save.
|
|
11
|
+
*/
|
|
12
|
+
export const useMergedRef = <T>(
|
|
13
|
+
forwarded?: Ref<T>,
|
|
14
|
+
): [MutableRefObject<T | null>, (value: T | null) => void] => {
|
|
15
|
+
const localRef = useRef<T | null>(null);
|
|
16
|
+
|
|
17
|
+
const setRef = useCallback(
|
|
18
|
+
(value: T | null) => {
|
|
19
|
+
localRef.current = value;
|
|
20
|
+
if (typeof forwarded === 'function') {
|
|
21
|
+
forwarded(value);
|
|
22
|
+
} else if (forwarded) {
|
|
23
|
+
(forwarded as MutableRefObject<T | null>).current = value;
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
[forwarded],
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
return [localRef, setRef];
|
|
30
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { useCallback } from 'react';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Ref for a field whose control cannot be handed to react-hook-form directly.
|
|
5
|
+
*
|
|
6
|
+
* react-hook-form focuses an invalid field by calling `focus()` on whatever
|
|
7
|
+
* was registered, so registering a plain wrapper element does nothing — a
|
|
8
|
+
* `div` is not focusable and the call is silently dropped. Registering an
|
|
9
|
+
* object with a `focus()` of our own works instead: it brings the wrapper
|
|
10
|
+
* into view, then focuses the control inside it when there is one.
|
|
11
|
+
*
|
|
12
|
+
* @param registerRef `controller.field.ref` from useController.
|
|
13
|
+
* @param focusSelector Control to focus inside the wrapper, when present.
|
|
14
|
+
*/
|
|
15
|
+
export const useScrollToErrorRef = <T extends HTMLElement>(
|
|
16
|
+
registerRef: (instance: unknown) => void,
|
|
17
|
+
focusSelector: string,
|
|
18
|
+
) =>
|
|
19
|
+
useCallback(
|
|
20
|
+
(element: T | null) => {
|
|
21
|
+
if (!element) {
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
registerRef({
|
|
26
|
+
focus: () => {
|
|
27
|
+
// Not implemented in jsdom.
|
|
28
|
+
element.scrollIntoView?.({ block: 'center' });
|
|
29
|
+
element.querySelector<HTMLElement>(focusSelector)?.focus();
|
|
30
|
+
},
|
|
31
|
+
});
|
|
32
|
+
},
|
|
33
|
+
[registerRef, focusSelector],
|
|
34
|
+
);
|