@wix/patterns-fields 1.73.0 → 1.74.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/form-address.js +5 -3
- package/dist/cjs/components/address/form-address.js.map +1 -1
- package/dist/cjs/components/address/input/address-input.st.css.js +3 -3
- package/dist/cjs/components/address/input/address-input.st.css.js.map +1 -1
- package/dist/cjs/components/audio/actions/actions-menu/actions-menu.st.css.js +3 -3
- package/dist/cjs/components/audio/actions/actions-menu/actions-menu.st.css.js.map +1 -1
- package/dist/cjs/components/audio/audio-field/form-audio-field.st.css.js +4 -4
- package/dist/cjs/components/audio/audio-field/form-audio-field.st.css.js.map +1 -1
- package/dist/cjs/components/audio/audio-field/form-audio.js +5 -3
- 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-input.js +6 -5
- 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/form-color.driver.js +8 -2
- package/dist/cjs/components/color-view/form-color.driver.js.map +1 -1
- package/dist/cjs/components/datetime-input/form-date-time.driver.js +4 -1
- package/dist/cjs/components/datetime-input/form-date-time.driver.js.map +1 -1
- package/dist/cjs/components/datetime-input/form-date-time.js +1 -0
- package/dist/cjs/components/datetime-input/form-date-time.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/document/form-document.js +5 -3
- 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 -4
- 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.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 +5 -3
- 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.js +5 -3
- 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/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 +15 -7
- package/dist/cjs/components/rich-content/rich-content-input/form-input/rich-content-form-input.st.css.js +11 -7
- package/dist/cjs/components/rich-content/rich-content-input/form-input/rich-content-form-input.st.css.js.map +1 -1
- package/dist/cjs/components/rich-content/rich-content-input/form-read-only-input/rich-content-form-read-only-input.st.css.js +2 -2
- package/dist/cjs/components/rich-content/rich-content-input/form-read-only-input/rich-content-form-read-only-input.st.css.js.map +1 -1
- package/dist/cjs/components/rich-content/rich-content-input/rich-content-common/fullscreen-modal/fullscreen-modal.st.css.js +3 -3
- package/dist/cjs/components/rich-content/rich-content-input/rich-content-common/fullscreen-modal/fullscreen-modal.st.css.js.map +1 -1
- package/dist/cjs/components/rich-content/rich-content-input/rich-content-common/publish-loader/publish-loader.st.css.js +3 -3
- package/dist/cjs/components/rich-content/rich-content-input/rich-content-common/publish-loader/publish-loader.st.css.js.map +1 -1
- package/dist/cjs/components/rich-content/rich-content-input/rich-content-common/toggle-fullscreen-button/toggle-fullscreen-button.st.css.js +2 -2
- package/dist/cjs/components/rich-content/rich-content-input/rich-content-common/toggle-fullscreen-button/toggle-fullscreen-button.st.css.js.map +1 -1
- package/dist/cjs/components/rich-content/rich-content-input/rich-content-editor/rich-content-editor.st.css.js +7 -7
- package/dist/cjs/components/rich-content/rich-content-input/rich-content-editor/rich-content-editor.st.css.js.map +1 -1
- package/dist/cjs/components/rich-content/rich-content-input/rich-content-editor/rich-content-toolbar.st.css.js +5 -5
- package/dist/cjs/components/rich-content/rich-content-input/rich-content-editor/rich-content-toolbar.st.css.js.map +1 -1
- package/dist/cjs/components/rich-content/rich-content-input/rich-content-viewer/rich-content-viewer.st.css.js +4 -4
- package/dist/cjs/components/rich-content/rich-content-input/rich-content-viewer/rich-content-viewer.st.css.js.map +1 -1
- package/dist/cjs/components/rich-text/rich-text-input/rich-text-editor/rich-editor.st.css.js +18 -18
- package/dist/cjs/components/rich-text/rich-text-input/rich-text-editor/rich-editor.st.css.js.map +1 -1
- package/dist/cjs/components/rich-text/rich-text-input/rich-text-editor/rich-text-editor.st.css +32 -19
- package/dist/cjs/components/rich-text/rich-text-input/rich-text-editor/rich-text-editor.st.css.js +20 -12
- 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.js +9 -10
- package/dist/cjs/components/time-input/form-time.js.map +1 -1
- package/dist/cjs/components/video/form-video.js +30 -29
- package/dist/cjs/components/video/form-video.js.map +1 -1
- package/dist/cjs/hooks/index.js +6 -0
- package/dist/cjs/hooks/index.js.map +1 -1
- package/dist/cjs/hooks/pr-5746-kobiburnley-comments.md +54 -0
- package/dist/cjs/hooks/use-field-ref.js +60 -0
- package/dist/cjs/hooks/use-field-ref.js.map +1 -0
- package/dist/cjs/hooks/use-scroll-to-error-ref.js +15 -15
- package/dist/cjs/hooks/use-scroll-to-error-ref.js.map +1 -1
- package/dist/cjs/styles.global.css +1 -1
- package/dist/esm/components/address/form-address.js +3 -1
- package/dist/esm/components/address/form-address.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/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 +3 -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-input.js +1 -1
- 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/form-color.driver.js +8 -2
- package/dist/esm/components/color-view/form-color.driver.js.map +1 -1
- package/dist/esm/components/datetime-input/form-date-time.driver.js +3 -0
- package/dist/esm/components/datetime-input/form-date-time.driver.js.map +1 -1
- package/dist/esm/components/datetime-input/form-date-time.js +1 -1
- package/dist/esm/components/datetime-input/form-date-time.js.map +1 -1
- package/dist/esm/components/delete-dialog/delete-dialog.st.css.js +2 -2
- package/dist/esm/components/document/form-document-field.st.css.js +2 -2
- package/dist/esm/components/document/form-document.js +3 -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/image/form-image-input.js +3 -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.st.css.js +2 -2
- package/dist/esm/components/media-gallery/form-media-gallery.js +3 -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/multi-document-input/form-multi-document.js +3 -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/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 +15 -7
- package/dist/esm/components/rich-content/rich-content-input/form-input/rich-content-form-input.st.css.js +3 -3
- package/dist/esm/components/rich-content/rich-content-input/form-input/rich-content-form-input.st.css.js.map +1 -1
- package/dist/esm/components/rich-content/rich-content-input/form-read-only-input/rich-content-form-read-only-input.st.css.js +2 -2
- package/dist/esm/components/rich-content/rich-content-input/form-read-only-input/rich-content-form-read-only-input.st.css.js.map +1 -1
- package/dist/esm/components/rich-content/rich-content-input/rich-content-common/fullscreen-modal/fullscreen-modal.st.css.js +2 -2
- package/dist/esm/components/rich-content/rich-content-input/rich-content-common/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-toolbar.st.css.js +2 -2
- package/dist/esm/components/rich-content/rich-content-input/rich-content-viewer/rich-content-viewer.st.css.js +2 -2
- package/dist/esm/components/rich-content/rich-content-input/rich-content-viewer/rich-content-viewer.st.css.js.map +1 -1
- package/dist/esm/components/rich-text/rich-text-input/rich-text-editor/rich-editor.st.css.js +2 -2
- package/dist/esm/components/rich-text/rich-text-input/rich-text-editor/rich-editor.st.css.js.map +1 -1
- package/dist/esm/components/rich-text/rich-text-input/rich-text-editor/rich-text-editor.st.css +32 -19
- package/dist/esm/components/rich-text/rich-text-input/rich-text-editor/rich-text-editor.st.css.js +3 -3
- package/dist/esm/components/rich-text/rich-text-input/rich-text-editor/rich-text-editor.st.css.js.map +1 -1
- package/dist/esm/components/rich-text/rich-text-input/rich-text-editor/toolbar/toolbar.st.css.js +2 -2
- package/dist/esm/components/rich-text/rich-text-input/rich-text-editor/toolbar/toolbar.st.css.js.map +1 -1
- package/dist/esm/components/text/text-view.st.css.js +2 -2
- package/dist/esm/components/text/text-view.st.css.js.map +1 -1
- package/dist/esm/components/time-input/form-time.js +4 -3
- package/dist/esm/components/time-input/form-time.js.map +1 -1
- package/dist/esm/components/video/form-video.js +3 -2
- package/dist/esm/components/video/form-video.js.map +1 -1
- package/dist/esm/hooks/index.js +1 -0
- package/dist/esm/hooks/index.js.map +1 -1
- package/dist/esm/hooks/pr-5746-kobiburnley-comments.md +54 -0
- package/dist/esm/hooks/use-field-ref.js +36 -0
- package/dist/esm/hooks/use-field-ref.js.map +1 -0
- package/dist/esm/hooks/use-scroll-to-error-ref.js +12 -12
- package/dist/esm/hooks/use-scroll-to-error-ref.js.map +1 -1
- package/dist/esm/styles.global.css +1 -1
- package/dist/types/components/address/form-address.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/color-view/color-input.d.ts.map +1 -1
- package/dist/types/components/color-view/form-color.driver.d.ts +5 -15
- package/dist/types/components/color-view/form-color.driver.d.ts.map +1 -1
- package/dist/types/components/datetime-input/form-date-time.driver.d.ts +1 -0
- package/dist/types/components/datetime-input/form-date-time.driver.d.ts.map +1 -1
- package/dist/types/components/document/form-document.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.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/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/rich-content-input/form-input/rich-content-form-input.st.css.d.ts +7 -3
- package/dist/types/components/rich-content/rich-content-input/form-input/rich-content-form-input.st.css.d.ts.map +1 -1
- package/dist/types/components/rich-content/rich-content-input/form-read-only-input/rich-content-form-read-only-input.st.css.d.ts.map +1 -1
- package/dist/types/components/rich-content/rich-content-input/rich-content-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/rich-text/rich-text-input/rich-text-editor/rich-text-editor.st.css.d.ts +16 -8
- package/dist/types/components/rich-text/rich-text-input/rich-text-editor/rich-text-editor.st.css.d.ts.map +1 -1
- package/dist/types/components/rich-text/rich-text-input/rich-text-editor/toolbar/toolbar.st.css.d.ts.map +1 -1
- package/dist/types/components/text/text-view.st.css.d.ts.map +1 -1
- package/dist/types/components/time-input/form-time.d.ts.map +1 -1
- package/dist/types/components/video/form-video.d.ts.map +1 -1
- package/dist/types/hooks/index.d.ts +1 -0
- package/dist/types/hooks/index.d.ts.map +1 -1
- package/dist/types/hooks/use-field-ref.d.ts +36 -0
- package/dist/types/hooks/use-field-ref.d.ts.map +1 -0
- package/dist/types/hooks/use-scroll-to-error-ref.d.ts +5 -5
- package/dist/types/hooks/use-scroll-to-error-ref.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/__tests__/components/color-view/form-color.spec.tsx +46 -3
- package/src/__tests__/components/rich-editors-border.spec.ts +45 -0
- package/src/__tests__/hooks/use-field-ref.spec.tsx +132 -0
- package/src/components/address/form-address.tsx +4 -1
- package/src/components/address/input/address-input.st.css.ts +2 -2
- package/src/components/audio/actions/actions-menu/actions-menu.st.css.ts +2 -2
- package/src/components/audio/audio-field/form-audio-field.st.css.ts +2 -2
- package/src/components/audio/audio-field/form-audio.tsx +4 -1
- package/src/components/audio/audio-player/audio-player.st.css.ts +2 -2
- package/src/components/color-view/cell-color-view.st.css.ts +2 -2
- package/src/components/color-view/color-input.tsx +13 -2
- package/src/components/color-view/color-view.st.css.ts +2 -2
- package/src/components/color-view/form-color.driver.ts +8 -2
- package/src/components/datetime-input/form-date-time.driver.ts +3 -0
- package/src/components/datetime-input/form-date-time.tsx +1 -1
- 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.tsx +4 -1
- 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 -1
- 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.tsx +4 -1
- package/src/components/media-image/media-image.st.css.ts +3 -3
- package/src/components/media-image/overlays/overlay.st.css.ts +2 -2
- package/src/components/media-loader/media-loader.st.css.ts +2 -2
- package/src/components/media-tag/web-media-tag/media-tag.st.css.ts +2 -2
- package/src/components/multi-document/cell-multi-document-edit.st.css.ts +2 -2
- package/src/components/multi-document/multi-document-input/form-multi-document.st.css.ts +2 -2
- package/src/components/multi-document/multi-document-input/form-multi-document.tsx +4 -1
- package/src/components/reference/cell-multi-reference-input.st.css.ts +2 -2
- package/src/components/reference/cell-reference-input.st.css.ts +2 -2
- package/src/components/rich-content/rich-content-input/default-value-input/rich-content-default-value-input.st.css.ts +2 -2
- package/src/components/rich-content/rich-content-input/form-input/rich-content-form-input.st.css +15 -7
- package/src/components/rich-content/rich-content-input/form-input/rich-content-form-input.st.css.ts +3 -3
- package/src/components/rich-content/rich-content-input/form-read-only-input/rich-content-form-read-only-input.st.css.ts +2 -2
- package/src/components/rich-content/rich-content-input/rich-content-common/fullscreen-modal/fullscreen-modal.st.css.ts +2 -2
- package/src/components/rich-content/rich-content-input/rich-content-common/publish-loader/publish-loader.st.css.ts +2 -2
- package/src/components/rich-content/rich-content-input/rich-content-common/toggle-fullscreen-button/toggle-fullscreen-button.st.css.ts +2 -2
- package/src/components/rich-content/rich-content-input/rich-content-editor/rich-content-editor.st.css.ts +2 -2
- package/src/components/rich-content/rich-content-input/rich-content-editor/rich-content-toolbar.st.css.ts +2 -2
- package/src/components/rich-content/rich-content-input/rich-content-viewer/rich-content-viewer.st.css.ts +2 -2
- package/src/components/rich-text/rich-text-input/rich-text-editor/rich-editor.st.css.ts +2 -2
- package/src/components/rich-text/rich-text-input/rich-text-editor/rich-text-editor.st.css +32 -19
- package/src/components/rich-text/rich-text-input/rich-text-editor/rich-text-editor.st.css.ts +3 -3
- 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.tsx +9 -3
- package/src/components/video/form-video.tsx +4 -2
- package/src/hooks/index.ts +1 -0
- package/src/hooks/pr-5746-kobiburnley-comments.md +54 -0
- package/src/hooks/use-field-ref.ts +65 -0
- package/src/hooks/use-scroll-to-error-ref.ts +15 -10
- package/src/styles.global.css +1 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
// @ts-nocheck
|
|
2
2
|
import { classesRuntime, statesRuntime } from "../../../../../stylable-esm-runtime.js";
|
|
3
|
-
var _namespace_ = "
|
|
3
|
+
var _namespace_ = "publishloader3536264979";
|
|
4
4
|
var _style_ = classesRuntime.bind(null, _namespace_);
|
|
5
5
|
export var cssStates = statesRuntime.bind(null, _namespace_);
|
|
6
6
|
export var style = _style_;
|
|
7
7
|
export var st = _style_;
|
|
8
8
|
export var namespace = _namespace_;
|
|
9
|
-
export var classes = { "root": "
|
|
9
|
+
export var classes = { "root": "publishloader3536264979__root", "publishLoader": "publishloader3536264979__publishLoader" };
|
|
10
10
|
export var keyframes = {};
|
|
11
11
|
export var layers = {};
|
|
12
12
|
export var containers = {};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
// @ts-nocheck
|
|
2
2
|
import { classesRuntime, statesRuntime } from "../../../../../stylable-esm-runtime.js";
|
|
3
|
-
var _namespace_ = "
|
|
3
|
+
var _namespace_ = "togglefullscreenbutton2020405308";
|
|
4
4
|
var _style_ = classesRuntime.bind(null, _namespace_);
|
|
5
5
|
export var cssStates = statesRuntime.bind(null, _namespace_);
|
|
6
6
|
export var style = _style_;
|
|
7
7
|
export var st = _style_;
|
|
8
8
|
export var namespace = _namespace_;
|
|
9
|
-
export var classes = { "root": "
|
|
9
|
+
export var classes = { "root": "togglefullscreenbutton2020405308__root" };
|
|
10
10
|
export var keyframes = {};
|
|
11
11
|
export var layers = {};
|
|
12
12
|
export var containers = {};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
// @ts-nocheck
|
|
2
2
|
import { classesRuntime, statesRuntime } from "../../../../stylable-esm-runtime.js";
|
|
3
|
-
var _namespace_ = "
|
|
3
|
+
var _namespace_ = "richcontenteditor3175937956";
|
|
4
4
|
var _style_ = classesRuntime.bind(null, _namespace_);
|
|
5
5
|
export var cssStates = statesRuntime.bind(null, _namespace_);
|
|
6
6
|
export var style = _style_;
|
|
7
7
|
export var st = _style_;
|
|
8
8
|
export var namespace = _namespace_;
|
|
9
|
-
export var classes = { "root": "
|
|
9
|
+
export var classes = { "root": "richcontenteditor3175937956__root", "toolbarContainer": "richcontenteditor3175937956__toolbarContainer", "footerToolbarContainer": "richcontenteditor3175937956__footerToolbarContainer", "toolbarAndFullScreenButtonWrapper": "richcontenteditor3175937956__toolbarAndFullScreenButtonWrapper", "editor": "richcontenteditor3175937956__editor", "modalEditor": "richcontenteditor3175937956__modalEditor" };
|
|
10
10
|
export var keyframes = {};
|
|
11
11
|
export var layers = {};
|
|
12
12
|
export var containers = {};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
// @ts-nocheck
|
|
2
2
|
import { classesRuntime, statesRuntime } from "../../../../stylable-esm-runtime.js";
|
|
3
|
-
var _namespace_ = "
|
|
3
|
+
var _namespace_ = "richcontenttoolbar2225509028";
|
|
4
4
|
var _style_ = classesRuntime.bind(null, _namespace_);
|
|
5
5
|
export var cssStates = statesRuntime.bind(null, _namespace_);
|
|
6
6
|
export var style = _style_;
|
|
7
7
|
export var st = _style_;
|
|
8
8
|
export var namespace = _namespace_;
|
|
9
|
-
export var classes = { "root": "
|
|
9
|
+
export var classes = { "root": "richcontenttoolbar2225509028__root", "toolbar": "richcontenttoolbar2225509028__toolbar", "toolbarButton": "richcontenttoolbar2225509028__toolbarButton", "separator": "richcontenttoolbar2225509028__separator" };
|
|
10
10
|
export var keyframes = {};
|
|
11
11
|
export var layers = {};
|
|
12
12
|
export var containers = {};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
// @ts-nocheck
|
|
2
2
|
import { classesRuntime, statesRuntime } from "../../../../stylable-esm-runtime.js";
|
|
3
|
-
var _namespace_ = "
|
|
3
|
+
var _namespace_ = "richcontentviewer818683085";
|
|
4
4
|
var _style_ = classesRuntime.bind(null, _namespace_);
|
|
5
5
|
export var cssStates = statesRuntime.bind(null, _namespace_);
|
|
6
6
|
export var style = _style_;
|
|
7
7
|
export var st = _style_;
|
|
8
8
|
export var namespace = _namespace_;
|
|
9
|
-
export var classes = { "root": "
|
|
9
|
+
export var classes = { "root": "richcontentviewer818683085__root", "viewer": "richcontentviewer818683085__viewer", "modalViewer": "richcontentviewer818683085__modalViewer" };
|
|
10
10
|
export var keyframes = {};
|
|
11
11
|
export var layers = {};
|
|
12
12
|
export var containers = {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rich-content-viewer.st.css.js","sourceRoot":"","sources":["../../../../../../src/components/rich-content/rich-content-input/rich-content-viewer/rich-content-viewer.st.css.ts"],"names":[],"mappings":"AAAA,cAAc;AAGd,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AAIpF,IAAI,WAAW,GAAG,
|
|
1
|
+
{"version":3,"file":"rich-content-viewer.st.css.js","sourceRoot":"","sources":["../../../../../../src/components/rich-content/rich-content-input/rich-content-viewer/rich-content-viewer.st.css.ts"],"names":[],"mappings":"AAAA,cAAc;AAGd,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AAIpF,IAAI,WAAW,GAAG,4BAA4B,CAAC;AAC/C,IAAI,OAAO,GAAG,cAAc,CAAC,IAAI,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;AAErD,MAAM,CAAC,IAAI,SAAS,GAAG,aAAa,CAAC,IAAI,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;AAC7D,MAAM,CAAC,IAAI,KAAK,GAA2C,OAAO,CAAC;AACnE,MAAM,CAAC,IAAI,EAAE,GAA2C,OAAO,CAAC;AAEhE,MAAM,CAAC,IAAI,SAAS,GAAG,WAAW,CAAC;AACnC,MAAM,CAAC,IAAI,OAAO,GAAG,EAAC,MAAM,EAAC,kCAAkC,EAAC,QAAQ,EAAC,oCAAoC,EAAC,aAAa,EAAC,yCAAyC,EAAC,CAAC;AACvK,MAAM,CAAC,IAAI,SAAS,GAAG,EAAE,CAAC;AAC1B,MAAM,CAAC,IAAI,MAAM,GAAG,EAAE,CAAC;AACvB,MAAM,CAAC,IAAI,UAAU,GAAG,EAAE,CAAC;AAC3B,MAAM,CAAC,IAAI,MAAM,GAAG,EAAE,CAAC;AACvB,MAAM,CAAC,IAAI,IAAI,GAAG,EAAE,CAAC"}
|
package/dist/esm/components/rich-text/rich-text-input/rich-text-editor/rich-editor.st.css.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
// @ts-nocheck
|
|
2
2
|
import { classesRuntime, statesRuntime } from "../../../../stylable-esm-runtime.js";
|
|
3
|
-
var _namespace_ = "
|
|
3
|
+
var _namespace_ = "richeditor207855410";
|
|
4
4
|
var _style_ = classesRuntime.bind(null, _namespace_);
|
|
5
5
|
export var cssStates = statesRuntime.bind(null, _namespace_);
|
|
6
6
|
export var style = _style_;
|
|
7
7
|
export var st = _style_;
|
|
8
8
|
export var namespace = _namespace_;
|
|
9
|
-
export var classes = { "root": "
|
|
9
|
+
export var classes = { "root": "richeditor207855410__root", "editor": "richeditor207855410__editor", "header-one": "richeditor207855410__header-one", "header-two": "richeditor207855410__header-two", "header-three": "richeditor207855410__header-three", "header-four": "richeditor207855410__header-four", "header-five": "richeditor207855410__header-five", "header-six": "richeditor207855410__header-six", "paragraph-one": "richeditor207855410__paragraph-one", "unstyled": "richeditor207855410__unstyled", "paragraph-three": "richeditor207855410__paragraph-three", "align-left": "richeditor207855410__align-left", "align-right": "richeditor207855410__align-right", "align-center": "richeditor207855410__align-center", "align-justify": "richeditor207855410__align-justify", "withMargin": "richeditor207855410__withMargin", "dir-rtl": "richeditor207855410__dir-rtl" };
|
|
10
10
|
export var keyframes = {};
|
|
11
11
|
export var layers = {};
|
|
12
12
|
export var containers = {};
|
package/dist/esm/components/rich-text/rich-text-input/rich-text-editor/rich-editor.st.css.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rich-editor.st.css.js","sourceRoot":"","sources":["../../../../../../src/components/rich-text/rich-text-input/rich-text-editor/rich-editor.st.css.ts"],"names":[],"mappings":"AAAA,cAAc;AAGd,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AAIpF,IAAI,WAAW,GAAG,
|
|
1
|
+
{"version":3,"file":"rich-editor.st.css.js","sourceRoot":"","sources":["../../../../../../src/components/rich-text/rich-text-input/rich-text-editor/rich-editor.st.css.ts"],"names":[],"mappings":"AAAA,cAAc;AAGd,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AAIpF,IAAI,WAAW,GAAG,qBAAqB,CAAC;AACxC,IAAI,OAAO,GAAG,cAAc,CAAC,IAAI,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;AAErD,MAAM,CAAC,IAAI,SAAS,GAAG,aAAa,CAAC,IAAI,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;AAC7D,MAAM,CAAC,IAAI,KAAK,GAA2C,OAAO,CAAC;AACnE,MAAM,CAAC,IAAI,EAAE,GAA2C,OAAO,CAAC;AAEhE,MAAM,CAAC,IAAI,SAAS,GAAG,WAAW,CAAC;AACnC,MAAM,CAAC,IAAI,OAAO,GAAG,EAAC,MAAM,EAAC,2BAA2B,EAAC,QAAQ,EAAC,6BAA6B,EAAC,YAAY,EAAC,iCAAiC,EAAC,YAAY,EAAC,iCAAiC,EAAC,cAAc,EAAC,mCAAmC,EAAC,aAAa,EAAC,kCAAkC,EAAC,aAAa,EAAC,kCAAkC,EAAC,YAAY,EAAC,iCAAiC,EAAC,eAAe,EAAC,oCAAoC,EAAC,UAAU,EAAC,+BAA+B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@property st-global(--wds-color-
|
|
1
|
+
/* Every border declaration below needs the same fallback chain WDS Input
|
|
2
|
+
itself uses. A `var()` with no fallback that resolves to nothing makes the
|
|
3
|
+
whole declaration invalid, and the element renders with no border at all —
|
|
4
|
+
which is what these editors did outside the theme that defines the
|
|
5
|
+
--wds-color-* palette. See CAIRO-4561. */
|
|
6
|
+
@property st-global(--wds-input-border-color);
|
|
7
|
+
@property st-global(--wds-input-border-color-focus);
|
|
8
8
|
@property st-global(--wds-input-shadow-focus-standard);
|
|
9
|
-
@property st-global(--wds-
|
|
9
|
+
@property st-global(--wds-input-shadow-focus-destructive);
|
|
10
|
+
@property st-global(--wds-input-shadow-focus-warning);
|
|
11
|
+
@property st-global(--wds-input-border-radius-default-medium);
|
|
12
|
+
@property st-global(--wds-color-border-destructive-secondary-active);
|
|
13
|
+
@property st-global(--wds-color-border-warning-secondary-active);
|
|
14
|
+
@property st-global(--wsr-color-B10);
|
|
15
|
+
@property st-global(--wsr-color-B40);
|
|
16
|
+
@property st-global(--wsr-color-R10);
|
|
17
|
+
@property st-global(--wsr-color-R40);
|
|
18
|
+
@property st-global(--wsr-color-Y10);
|
|
19
|
+
@property st-global(--wsr-color-Y40);
|
|
20
|
+
@property st-global(--wsr-color-F00);
|
|
21
|
+
@property st-global(--wsr-border-radius-06);
|
|
22
|
+
@property st-global(--wds-color-black-700);
|
|
10
23
|
|
|
11
24
|
/* Cannot import Editor from rich-editor.st.css - causes Stylable build error
|
|
12
25
|
:import {
|
|
@@ -24,37 +37,37 @@
|
|
|
24
37
|
box-sizing: border-box;
|
|
25
38
|
outline: 0;
|
|
26
39
|
overflow: hidden;
|
|
27
|
-
border-radius: var(--wds-border-radius-
|
|
40
|
+
border-radius: var(--wds-input-border-radius-default-medium, var(--wsr-border-radius-06, 6px));
|
|
28
41
|
}
|
|
29
42
|
|
|
30
43
|
.root:border(none) {
|
|
31
44
|
border: none;
|
|
32
45
|
}
|
|
33
46
|
.root:border(standard) {
|
|
34
|
-
border: 1px solid var(--wds-color-
|
|
47
|
+
border: 1px solid var(--wds-input-border-color, var(--wsr-color-B40, #D6E6FE));
|
|
35
48
|
}
|
|
36
49
|
.root:border(standard):focus,
|
|
37
50
|
.root:border(standard):focus-within {
|
|
38
|
-
border: 1px solid var(--wds-color-
|
|
39
|
-
box-shadow: var(--wds-input-shadow-focus-standard);
|
|
51
|
+
border: 1px solid var(--wds-input-border-color-focus, var(--wsr-color-B10, #116DFF));
|
|
52
|
+
box-shadow: var(--wds-input-shadow-focus-standard, 0 0 0 3px var(--wsr-color-F00, #A6D0FF));
|
|
40
53
|
}
|
|
41
54
|
|
|
42
55
|
.root:border(standard):status(error) {
|
|
43
|
-
border: 1px solid var(--wds-color-
|
|
56
|
+
border: 1px solid var(--wds-color-border-destructive-secondary-active, var(--wsr-color-R10, #E62214));
|
|
44
57
|
}
|
|
45
58
|
.root:border(standard):status(error):focus,
|
|
46
59
|
.root:border(standard):status(error):focus-within {
|
|
47
|
-
border: 1px solid var(--wds-color-
|
|
48
|
-
box-shadow: 0 0 0 3px var(--
|
|
60
|
+
border: 1px solid var(--wds-color-border-destructive-secondary-active, var(--wsr-color-R10, #E62214));
|
|
61
|
+
box-shadow: var(--wds-input-shadow-focus-destructive, 0 0 0 3px var(--wsr-color-R40, #FBD0CD));
|
|
49
62
|
}
|
|
50
63
|
|
|
51
64
|
.root:border(standard):status(warning) {
|
|
52
|
-
border: 1px solid var(--wds-color-
|
|
65
|
+
border: 1px solid var(--wds-color-border-warning-secondary-active, var(--wsr-color-Y10, #FFB700));
|
|
53
66
|
}
|
|
54
67
|
.root:border(standard):status(warning):focus,
|
|
55
68
|
.root:border(standard):status(warning):focus-within {
|
|
56
|
-
border: 1px solid var(--wds-color-
|
|
57
|
-
box-shadow: 0 0 0 3px var(--
|
|
69
|
+
border: 1px solid var(--wds-color-border-warning-secondary-active, var(--wsr-color-Y10, #FFB700));
|
|
70
|
+
box-shadow: var(--wds-input-shadow-focus-warning, 0 0 0 3px var(--wsr-color-Y40, #FFE2A5));
|
|
58
71
|
}
|
|
59
72
|
|
|
60
73
|
.nativeInput {
|
|
@@ -78,7 +91,7 @@
|
|
|
78
91
|
overflow: hidden;
|
|
79
92
|
box-sizing: border-box;
|
|
80
93
|
flex-direction: row;
|
|
81
|
-
border-radius: var(--wds-border-radius-
|
|
94
|
+
border-radius: var(--wds-input-border-radius-default-medium, var(--wsr-border-radius-06, 6px));
|
|
82
95
|
}
|
|
83
96
|
.editor:isFullScreen {
|
|
84
97
|
max-width: 782px;
|
package/dist/esm/components/rich-text/rich-text-input/rich-text-editor/rich-text-editor.st.css.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
// @ts-nocheck
|
|
2
2
|
import { classesRuntime, statesRuntime } from "../../../../stylable-esm-runtime.js";
|
|
3
|
-
var _namespace_ = "
|
|
3
|
+
var _namespace_ = "richtexteditor4232484640";
|
|
4
4
|
var _style_ = classesRuntime.bind(null, _namespace_);
|
|
5
5
|
export var cssStates = statesRuntime.bind(null, _namespace_);
|
|
6
6
|
export var style = _style_;
|
|
7
7
|
export var st = _style_;
|
|
8
8
|
export var namespace = _namespace_;
|
|
9
|
-
export var classes = { "root": "
|
|
9
|
+
export var classes = { "root": "richtexteditor4232484640__root", "nativeInput": "richtexteditor4232484640__nativeInput", "editor": "richtexteditor4232484640__editor" };
|
|
10
10
|
export var keyframes = {};
|
|
11
11
|
export var layers = {};
|
|
12
12
|
export var containers = {};
|
|
13
13
|
export var stVars = {};
|
|
14
|
-
export var vars = { "wds-color-
|
|
14
|
+
export var vars = { "wds-input-border-color": "--wds-input-border-color", "wds-input-border-color-focus": "--wds-input-border-color-focus", "wds-input-shadow-focus-standard": "--wds-input-shadow-focus-standard", "wds-input-shadow-focus-destructive": "--wds-input-shadow-focus-destructive", "wds-input-shadow-focus-warning": "--wds-input-shadow-focus-warning", "wds-input-border-radius-default-medium": "--wds-input-border-radius-default-medium", "wds-color-border-destructive-secondary-active": "--wds-color-border-destructive-secondary-active", "wds-color-border-warning-secondary-active": "--wds-color-border-warning-secondary-active", "wsr-color-B10": "--wsr-color-B10", "wsr-color-B40": "--wsr-color-B40", "wsr-color-R10": "--wsr-color-R10", "wsr-color-R40": "--wsr-color-R40", "wsr-color-Y10": "--wsr-color-Y10", "wsr-color-Y40": "--wsr-color-Y40", "wsr-color-F00": "--wsr-color-F00", "wsr-border-radius-06": "--wsr-border-radius-06", "wds-color-black-700": "--wds-color-black-700" };
|
|
15
15
|
//# sourceMappingURL=rich-text-editor.st.css.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rich-text-editor.st.css.js","sourceRoot":"","sources":["../../../../../../src/components/rich-text/rich-text-input/rich-text-editor/rich-text-editor.st.css.ts"],"names":[],"mappings":"AAAA,cAAc;AAGd,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AAIpF,IAAI,WAAW,GAAG,
|
|
1
|
+
{"version":3,"file":"rich-text-editor.st.css.js","sourceRoot":"","sources":["../../../../../../src/components/rich-text/rich-text-input/rich-text-editor/rich-text-editor.st.css.ts"],"names":[],"mappings":"AAAA,cAAc;AAGd,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AAIpF,IAAI,WAAW,GAAG,0BAA0B,CAAC;AAC7C,IAAI,OAAO,GAAG,cAAc,CAAC,IAAI,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;AAErD,MAAM,CAAC,IAAI,SAAS,GAAG,aAAa,CAAC,IAAI,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;AAC7D,MAAM,CAAC,IAAI,KAAK,GAA2C,OAAO,CAAC;AACnE,MAAM,CAAC,IAAI,EAAE,GAA2C,OAAO,CAAC;AAEhE,MAAM,CAAC,IAAI,SAAS,GAAG,WAAW,CAAC;AACnC,MAAM,CAAC,IAAI,OAAO,GAAG,EAAC,MAAM,EAAC,gCAAgC,EAAC,aAAa,EAAC,uCAAuC,EAAC,QAAQ,EAAC,kCAAkC,EAAC,CAAC;AACjK,MAAM,CAAC,IAAI,SAAS,GAAG,EAAE,CAAC;AAC1B,MAAM,CAAC,IAAI,MAAM,GAAG,EAAE,CAAC;AACvB,MAAM,CAAC,IAAI,UAAU,GAAG,EAAE,CAAC;AAC3B,MAAM,CAAC,IAAI,MAAM,GAAG,EAAE,CAAC;AACvB,MAAM,CAAC,IAAI,IAAI,GAAG,EAAC,wBAAwB,EAAC,0BAA0B,EAAC,8BAA8B,EAAC,gCAAgC,EAAC,iCAAiC,EAAC,mCAAmC,EAAC,oCAAoC,EAAC,sCAAsC,EAAC,gCAAgC,EAAC,kCAAkC,EAAC,wCAAwC,EAAC,0CAA0C,EAAC,+CAA+C,EAAC,iDAAiD,EAAC,2CAA2C,EAAC,6CAA6C,EAAC,eAAe,EAAC,iBAAiB,EAAC,eAAe,EAAC,iBAAiB,EAAC,eAAe,EAAC,iBAAiB,EAAC,eAAe,EAAC,iBAAiB,EAAC,eAAe,EAAC,iBAAiB,EAAC,eAAe,EAAC,iBAAiB,EAAC,eAAe,EAAC,iBAAiB,EAAC,sBAAsB,EAAC,wBAAwB,EAAC,qBAAqB,EAAC,uBAAuB,EAAC,CAAC"}
|
package/dist/esm/components/rich-text/rich-text-input/rich-text-editor/toolbar/toolbar.st.css.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
// @ts-nocheck
|
|
2
2
|
import { classesRuntime, statesRuntime } from "../../../../../stylable-esm-runtime.js";
|
|
3
|
-
var _namespace_ = "
|
|
3
|
+
var _namespace_ = "toolbar541225243";
|
|
4
4
|
var _style_ = classesRuntime.bind(null, _namespace_);
|
|
5
5
|
export var cssStates = statesRuntime.bind(null, _namespace_);
|
|
6
6
|
export var style = _style_;
|
|
7
7
|
export var st = _style_;
|
|
8
8
|
export var namespace = _namespace_;
|
|
9
|
-
export var classes = { "root": "
|
|
9
|
+
export var classes = { "root": "toolbar541225243__root", "item": "toolbar541225243__item", "separator": "toolbar541225243__separator", "clearFormatting": "toolbar541225243__clearFormatting", "fullScreen": "toolbar541225243__fullScreen", "dropdownItemContent": "toolbar541225243__dropdownItemContent", "dropdownItemTitle": "toolbar541225243__dropdownItemTitle", "dropdownItemSubtitle": "toolbar541225243__dropdownItemSubtitle", "dropdownHeaderOne": "toolbar541225243__dropdownHeaderOne", "dropdownHeaderTwo": "toolbar541225243__dropdownHeaderTwo", "dropdownHeaderThree": "toolbar541225243__dropdownHeaderThree", "dropdownHeaderFour": "toolbar541225243__dropdownHeaderFour", "dropdownHeaderFive": "toolbar541225243__dropdownHeaderFive", "dropdownHeaderSix": "toolbar541225243__dropdownHeaderSix", "dropdownParagraphOne": "toolbar541225243__dropdownParagraphOne", "dropdownNormalText": "toolbar541225243__dropdownNormalText", "dropdownParagraphThree": "toolbar541225243__dropdownParagraphThree" };
|
|
10
10
|
export var keyframes = {};
|
|
11
11
|
export var layers = {};
|
|
12
12
|
export var containers = {};
|
package/dist/esm/components/rich-text/rich-text-input/rich-text-editor/toolbar/toolbar.st.css.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toolbar.st.css.js","sourceRoot":"","sources":["../../../../../../../src/components/rich-text/rich-text-input/rich-text-editor/toolbar/toolbar.st.css.ts"],"names":[],"mappings":"AAAA,cAAc;AAGd,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAC;AAIvF,IAAI,WAAW,GAAG,
|
|
1
|
+
{"version":3,"file":"toolbar.st.css.js","sourceRoot":"","sources":["../../../../../../../src/components/rich-text/rich-text-input/rich-text-editor/toolbar/toolbar.st.css.ts"],"names":[],"mappings":"AAAA,cAAc;AAGd,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAC;AAIvF,IAAI,WAAW,GAAG,kBAAkB,CAAC;AACrC,IAAI,OAAO,GAAG,cAAc,CAAC,IAAI,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;AAErD,MAAM,CAAC,IAAI,S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A4B,EAAC,eAAe,EAAC,iBAAiB,EAAC,eAAe,EAAC,iBAAiB,EAAC,CAAC"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
// @ts-nocheck
|
|
2
2
|
import { classesRuntime, statesRuntime } from "../../stylable-esm-runtime.js";
|
|
3
|
-
var _namespace_ = "
|
|
3
|
+
var _namespace_ = "textview2294932004";
|
|
4
4
|
var _style_ = classesRuntime.bind(null, _namespace_);
|
|
5
5
|
export var cssStates = statesRuntime.bind(null, _namespace_);
|
|
6
6
|
export var style = _style_;
|
|
7
7
|
export var st = _style_;
|
|
8
8
|
export var namespace = _namespace_;
|
|
9
|
-
export var classes = { "root": "
|
|
9
|
+
export var classes = { "root": "textview2294932004__root", "textView": "textview2294932004__textView" };
|
|
10
10
|
export var keyframes = {};
|
|
11
11
|
export var layers = {};
|
|
12
12
|
export var containers = {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text-view.st.css.js","sourceRoot":"","sources":["../../../../src/components/text/text-view.st.css.ts"],"names":[],"mappings":"AAAA,cAAc;AAGd,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAI9E,IAAI,WAAW,GAAG,
|
|
1
|
+
{"version":3,"file":"text-view.st.css.js","sourceRoot":"","sources":["../../../../src/components/text/text-view.st.css.ts"],"names":[],"mappings":"AAAA,cAAc;AAGd,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAI9E,IAAI,WAAW,GAAG,oBAAoB,CAAC;AACvC,IAAI,OAAO,GAAG,cAAc,CAAC,IAAI,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;AAErD,MAAM,CAAC,IAAI,SAAS,GAAG,aAAa,CAAC,IAAI,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;AAC7D,MAAM,CAAC,IAAI,KAAK,GAA2C,OAAO,CAAC;AACnE,MAAM,CAAC,IAAI,EAAE,GAA2C,OAAO,CAAC;AAEhE,MAAM,CAAC,IAAI,SAAS,GAAG,WAAW,CAAC;AACnC,MAAM,CAAC,IAAI,OAAO,GAAG,EAAC,MAAM,EAAC,0BAA0B,EAAC,UAAU,EAAC,8BAA8B,EAAC,CAAC;AACnG,MAAM,CAAC,IAAI,SAAS,GAAG,EAAE,CAAC;AAC1B,MAAM,CAAC,IAAI,MAAM,GAAG,EAAE,CAAC;AACvB,MAAM,CAAC,IAAI,UAAU,GAAG,EAAE,CAAC;AAC3B,MAAM,CAAC,IAAI,MAAM,GAAG,EAAE,CAAC;AACvB,MAAM,CAAC,IAAI,IAAI,GAAG,EAAE,CAAC"}
|
|
@@ -3,7 +3,7 @@ import { 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
|
-
import { useTranslations } from '../../hooks';
|
|
6
|
+
import { fieldRefHandle, useTranslations } from '../../hooks';
|
|
7
7
|
import { isDataValidOrNotSet, timeValidation, } from '../../validations/validations';
|
|
8
8
|
import { isEmpty } from '../../validations/string';
|
|
9
9
|
import { TypeMismatchExclamation } from '../exclamation/type-mismatch-exclamation';
|
|
@@ -27,10 +27,11 @@ const _FormTime = (props) => {
|
|
|
27
27
|
});
|
|
28
28
|
// TimeInput has no DOM ref to hand to field.ref, so bridge its imperative
|
|
29
29
|
// focus() — lets react-hook-form's shouldFocusError scroll to this field
|
|
30
|
-
// when it blocks save.
|
|
30
|
+
// when it blocks save. TimeInputImperativeActions has no select(), so the
|
|
31
|
+
// handle absorbs the calls react-hook-form makes beyond focus.
|
|
31
32
|
const timeRef = useRef(null);
|
|
32
33
|
useEffect(() => {
|
|
33
|
-
controller.field.ref(
|
|
34
|
+
controller.field.ref(fieldRefHandle(() => timeRef.current?.focus(), () => timeRef.current));
|
|
34
35
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
35
36
|
}, []);
|
|
36
37
|
return (React.createElement(FormField, { label: field.displayName, required: field.validation?.required, status: controller.fieldState.error ? 'error' : undefined, statusMessage: controller.fieldState.error?.message, dataHook: dataHook, suffix: isDataValidOrNotSet(controller.field.value, timeValidation) ? undefined : (React.createElement(TypeMismatchExclamation, { typeName: t('auto-patterns.fields.field_type_time_title'), clearButtonText: t('auto-patterns.fields.type_mismatch_clear'), convertButtonText: t('auto-patterns.fields.type_mismatch_convert'), onClear: () => controller.field.onChange(undefined), onChange: (value) => controller.field.onChange(value), convertDisabledText: t('auto-patterns.fields.type_mismatch_convert_disabled'), fieldName: field.displayName, isConverted: false, isConverting: false, convertedValue: "00:00:00.000", tooltipText: t('auto-patterns.fields.type_mismatch_tip', {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form-time.js","sourceRoot":"","sources":["../../../../src/components/time-input/form-time.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE/C,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAGnD,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"form-time.js","sourceRoot":"","sources":["../../../../src/components/time-input/form-time.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE/C,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM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AAQ,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,EACrD,QAAQ,EAAE,QAAQ,KAAK,CAAC,EAAE,EAAE,GAC5B,CACQ,CACb,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,QAAQ,GAAG,QAAQ,CAAC,SAAS,CAAC,CAAC"}
|
|
@@ -4,7 +4,7 @@ import { Replace, More, Download, Delete, Maximize, } from '@wix/wix-ui-icons-co
|
|
|
4
4
|
import { observer } from 'mobx-react-lite';
|
|
5
5
|
import { useIsMobile, useWixPatternsContainer } from '@wix/bex-core/react';
|
|
6
6
|
import { useController } from '@wix/bex-core/form';
|
|
7
|
-
import { useTranslations } from '../../hooks';
|
|
7
|
+
import { useFieldRef, useTranslations } from '../../hooks';
|
|
8
8
|
import { isEmpty } from '../../validations/string';
|
|
9
9
|
import { isDataValidOrNotSet } from '../../validations/validations';
|
|
10
10
|
import * as videoValidation from '../../validations/video';
|
|
@@ -29,6 +29,7 @@ const _FormVideo = (props) => {
|
|
|
29
29
|
},
|
|
30
30
|
},
|
|
31
31
|
});
|
|
32
|
+
const setFieldRef = useFieldRef(controller.field.ref);
|
|
32
33
|
async function openMedia() {
|
|
33
34
|
if (!openMediaManager)
|
|
34
35
|
return;
|
|
@@ -71,7 +72,7 @@ const _FormVideo = (props) => {
|
|
|
71
72
|
, {
|
|
72
73
|
// Only the empty state can fail `required`, so the add button is
|
|
73
74
|
// always the right target for react-hook-form's shouldFocusError.
|
|
74
|
-
ref:
|
|
75
|
+
ref: setFieldRef, dataHook: `video-${field.id}`, onAddImage: isMobile ? undefined : () => openMedia(), addImageInfo: t('auto-patterns.fields.add_video_tooltip'), height: MEDIA_HEIGHT, width: "100%" }))),
|
|
75
76
|
isPreviewOpen && (React.createElement(Modal, { isOpen: isPreviewOpen, onRequestClose: handleClosePreview },
|
|
76
77
|
React.createElement(CustomModalLayout, { title: field.displayName, onCloseButtonClick: handleClosePreview, content: React.createElement("div", { style: {
|
|
77
78
|
display: 'flex',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form-video.js","sourceRoot":"","sources":["../../../../src/components/video/form-video.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EACL,SAAS,EACT,WAAW,EACX,KAAK,EACL,iBAAiB,EACjB,YAAY,EACZ,GAAG,EACH,OAAO,EACP,UAAU,EACV,WAAW,EACX,KAAK,GACN,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,OAAO,EACP,IAAI,EACJ,QAAQ,EACR,MAAM,EACN,QAAQ,GACT,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAC3E,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"form-video.js","sourceRoot":"","sources":["../../../../src/components/video/form-video.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EACL,SAAS,EACT,WAAW,EACX,KAAK,EACL,iBAAiB,EACjB,YAAY,EACZ,GAAG,EACH,OAAO,EACP,UAAU,EACV,WAAW,EACX,KAAK,GACN,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,OAAO,EACP,IAAI,EACJ,QAAQ,EACR,MAAM,EACN,QAAQ,GACT,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAC3E,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD,OAAO,EAAE,WAAW,EAAE,eA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,GAAG,IAAC,KAAK,EAAC,MAAM,EAAC,QAAQ,EAAE,eAAe;YACzC,oBAAC,WAAW;YACV,iEAAiE;YACjE,kEAAkE;;gBADlE,iEAAiE;gBACjE,kEAAkE;gBAClE,GAAG,EAAE,WAAW,EAChB,QAAQ,EAAE,SAAS,KAAK,CAAC,EAAE,EAAE,EAC7B,UAAU,EAAE,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,SAAS,EAAE,EACpD,YAAY,EAAE,CAAC,CAAC,wCAAwC,CAAC,EACzD,MAAM,EAAE,YAAY,EACpB,KAAK,EAAC,MAAM,GACZ,CACE,CACP;QACA,aAAa,IAAI,CAChB,oBAAC,KAAK,IAAC,MAAM,EAAE,aAAa,EAAE,cAAc,EAAE,kBAAkB;YAC9D,oBAAC,iBAAiB,IAChB,KAAK,EAAE,KAAK,CAAC,WAAW,EACxB,kBAAkB,EAAE,kBAAkB,EACtC,OAAO,EACL,6BACE,KAAK,EAAE;wBACL,OAAO,EAAE,MAAM;wBACf,cAAc,EAAE,QAAQ;wBACxB,OAAO,EAAE,MAAM;qBAChB;oBAED,+BACE,QAAQ,QACR,QAAQ,QACR,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,EAC9C,MAAM,EAAE,QAAQ;wBAEf,QAAQ,IAAI,gCAAQ,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAC,WAAW,GAAG;uEAEjD,CACJ,GAER,CACI,CACT,CACS,CACb,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAAG,QAAQ,CAAC,UAAU,CAAC,CAAC"}
|
package/dist/esm/hooks/index.js
CHANGED
|
@@ -7,6 +7,7 @@ export * from './use-translations';
|
|
|
7
7
|
export * from './use-with-callback';
|
|
8
8
|
export * from './use-resize-effect';
|
|
9
9
|
export * from './use-cell-edit-keyboard';
|
|
10
|
+
export * from './use-field-ref';
|
|
10
11
|
export * from './use-merged-ref';
|
|
11
12
|
export * from './use-scroll-to-error-ref';
|
|
12
13
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC;AACzC,cAAc,kBAAkB,CAAC;AACjC,cAAc,2BAA2B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC;AACzC,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,2BAA2B,CAAC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# PR #5746 — kobiburnley review
|
|
2
|
+
|
|
3
|
+
[fix(fields): register a field ref that answers every call react-hook-form makes](https://github.com/wix-private/cairo/pull/5746)
|
|
4
|
+
|
|
5
|
+
> **Verdict: Request changes** — 1 blocker. (Posted as a comment review because GitHub will not let the
|
|
6
|
+
> author formally request changes on their own PR.)
|
|
7
|
+
>
|
|
8
|
+
> The diagnosis is right, and I checked it against the installed `react-hook-form` (7.56.4) rather than
|
|
9
|
+
> taking it on trust […] `fieldRefHandle` / `useFieldRef` are a clean way to close it […] I also confirmed
|
|
10
|
+
> the integration test is a real guard, not decoration.
|
|
11
|
+
>
|
|
12
|
+
> One blocker: the audit missed a call site with exactly the shape the helper exists for.
|
|
13
|
+
>
|
|
14
|
+
> — [pullrequestreview-5002194499](https://github.com/wix-private/cairo/pull/5746#pullrequestreview-5002194499)
|
|
15
|
+
|
|
16
|
+
All claims below were checked against the branch before being written down. Every one holds.
|
|
17
|
+
|
|
18
|
+
| # | Comment link | Description | Severity | Status | Resolution recommendation |
|
|
19
|
+
|---|---|---|---|---|---|
|
|
20
|
+
| 1 | [discussion_r3838295772](https://github.com/wix-private/cairo/pull/5746#discussion_r3838295772) — `packages/fields/src/components/time-input/form-time.tsx:46` | `form-time` registers a hand-rolled focus-only object, `controller.field.ref({ focus: () => timeRef.current?.focus() })`. Exactly the shape the helper exists for, missed by the audit, so it ships still broken while the PR reads as closing the trap. | Blocker | done | Fixed in `23dc894` — wrapped with `fieldRefHandle` as suggested. Missed originally because `form-time` calls `controller.field.ref(...)` directly in a `useEffect`, so the `inputRef=`/`ref=` grep never matched it. Covered by the table-driven `setFocus` guard. |
|
|
21
|
+
| 2 | [review summary](https://github.com/wix-private/cairo/pull/5746#pullrequestreview-5002194499) | PR body claims "audited all nine that register directly"; there are ~23 `controller.field.ref` sites. The 7 passing `ref=` to a WDS `Input`/`InputArea` get `InputImperativeActions`, which has `select` but no `setCustomValidity`/`reportValidity` — so the `shouldUseNativeValidation` half stays open in `form-url`, `form-email`, `form-short-text` (Input branch), `form-long-text`, `form-color`, `form-array`, `form-object`. | Major (accuracy) | done | PR description rewritten with the full 23-site table. `InputImperativeActions` confirmed as `{ focus, blur, select, setSelectionRange, clear, input }`. The `shouldUseNativeValidation` gap in the 7 `ref=`-on-`Input` sites is left open and stated as a follow-up rather than implied fixed. |
|
|
22
|
+
| 3 | [review summary](https://github.com/wix-private/cairo/pull/5746#pullrequestreview-5002194499) | Fix it once in `packages/core` instead. `packages/core/src/exports/form.ts` is `export * from 'react-hook-form'`, so core owns the entry point; a `useController` there installing the safe handle would cover all sites and every future one, making `useFieldRef` and the seven adopting edits unnecessary. As it stands the fix is opt-in — which is how `form-time` got missed. | Major (design) | dismiss | Not implemented; kept per-site by decision. Rationale recorded in the PR reply: core's `exports/form.ts` is a bare re-export, so wrapping `useController` there would turn it into real implementation and change behaviour for every consumer of `@wix/bex-core/form`, not just Cairo renderers. Filed as a follow-up — if it lands, `useFieldRef` and all adopting edits should be deleted and the `Input` group closes for free. |
|
|
23
|
+
| 4 | [review summary](https://github.com/wix-private/cairo/pull/5746#pullrequestreview-5002194499) | The same 3-line comment is copy-pasted verbatim into seven files; the `fieldRefHandle` docblock already says it, and `AGENTS.md` asks for a comment only when it tells the reader something the code cannot. | Nit | done | Removed from all seven files in `b64bfc4`. |
|
|
24
|
+
| 5 | [review summary](https://github.com/wix-private/cairo/pull/5746#pullrequestreview-5002194499) | `useFieldRef`'s type parameter `T` appears only in the return type, so every call site infers `FieldControl` and the annotation buys nothing. | Minor | done | `T` dropped in `a51e9c6`; takes and returns `FieldControl`. |
|
|
25
|
+
| 6 | [review summary](https://github.com/wix-private/cairo/pull/5746#pullrequestreview-5002194499) | Lint is not clean: `use-field-ref.ts:56` trips `prettier/prettier`. | Minor | done | Fixed in `c6406f6`. Root cause of the false "clean" report: all changed files were passed as one joined argument, so eslint matched nothing. Re-verified one file at a time. `form-video.tsx:73` `curly` warning remains but is unchanged from master. |
|
|
26
|
+
| 7 | [review summary](https://github.com/wix-private/cairo/pull/5746#pullrequestreview-5002194499) | Only `form-address` has an integration guard; the other six conversions would not notice a revert. | Test gap | done | Fixed in `94baa17`. Table-driven over one renderer per control shape: address, time, `FormDocument` (`AddItemActions`, shared with audio/multi-document/media-gallery), `FormImageInput` (`ImageViewer`, shared with video). Each verified failing via `git checkout origin/master -- <file>` — note `git checkout -- <file>` restores from HEAD and silently proves nothing once the change is committed. |
|
|
27
|
+
| 8 | [review summary](https://github.com/wix-private/cairo/pull/5746#pullrequestreview-5002194499) | In `EntityPageCustomField`, the new `control` closure and the `focus` callback each resolve consumer-then-`querySelector` separately; not wrong (focus needs `scrollIntoView` between the steps) but they will drift. | Nit | done | Fixed in `91147ff`. Both paths read one `control()`. The identity check I first wrote was also wrong, not just duplicative: with nothing focusable, `target` and `consumerRef.current` were both `null`, so it skipped the scroll in exactly the case needing it. Now keyed off `!consumerRef.current`. |
|
|
28
|
+
|
|
29
|
+
## Notes
|
|
30
|
+
|
|
31
|
+
- #3 is the pivot. If the fix moves into core's `useController`, then #1, #2, #4, #5 and #7 mostly evaporate and this
|
|
32
|
+
PR shrinks to deleting `useFieldRef` and reverting the seven adopting edits. Worth settling before spending
|
|
33
|
+
effort on the others.
|
|
34
|
+
- #1 is a blocker on its own terms and is a one-line fix either way, since `form-time` is broken today
|
|
35
|
+
regardless of which mechanism wins.
|
|
36
|
+
- The reviewer independently reproduced the address integration test (revert → `1 failed, 3 passed`), so the
|
|
37
|
+
guard is trusted; the gap is coverage of the other six (#7), not the approach.
|
|
38
|
+
|
|
39
|
+
## Outcome
|
|
40
|
+
|
|
41
|
+
All eight resolved: seven fixed, one (row 3) dismissed with rationale. Commits on `fix/delegating-field-ref`,
|
|
42
|
+
all pushed:
|
|
43
|
+
|
|
44
|
+
| Commit | Row |
|
|
45
|
+
|---|---|
|
|
46
|
+
| `23dc894` fix(TimeInput): give form-time a field ref that answers every call | 1 |
|
|
47
|
+
| `c6406f6` style(fields): format the fieldRefHandle call in useFieldRef | 6 |
|
|
48
|
+
| `a51e9c6` refactor(fields): drop useFieldRef's unusable type parameter | 5 |
|
|
49
|
+
| `b64bfc4` refactor(fields): drop the repeated useFieldRef comment | 4 |
|
|
50
|
+
| `91147ff` refactor(EntityPageCustomField): resolve the control once | 8 |
|
|
51
|
+
| `94baa17` test(fields): guard the other converted renderers against setFocus | 7 |
|
|
52
|
+
|
|
53
|
+
Row 2 was a PR-description correction, not code. Row 3 answered in
|
|
54
|
+
[issuecomment-5385655358](https://github.com/wix-private/cairo/pull/5746#issuecomment-5385655358).
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { useCallback, useRef } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Handle to register with react-hook-form, covering every method it may call.
|
|
4
|
+
*
|
|
5
|
+
* `useController` rewrites whatever is registered into
|
|
6
|
+
* `{ focus, select, setCustomValidity, reportValidity }` and calls all four
|
|
7
|
+
* through to the target. The guards check that wrapper rather than the target,
|
|
8
|
+
* so registering a control that only has `focus` makes `setFocus` with
|
|
9
|
+
* `shouldSelect`, or `shouldUseNativeValidation`, throw on the way to it.
|
|
10
|
+
*
|
|
11
|
+
* @param focus What to do when the field has to be reached.
|
|
12
|
+
* @param getControl The control the remaining calls go to, when there is one.
|
|
13
|
+
*/
|
|
14
|
+
export const fieldRefHandle = (focus, getControl) => ({
|
|
15
|
+
focus,
|
|
16
|
+
select: () => getControl()?.select?.(),
|
|
17
|
+
setCustomValidity: (message) => getControl()?.setCustomValidity?.(message),
|
|
18
|
+
reportValidity: () => getControl()?.reportValidity?.() ?? true,
|
|
19
|
+
});
|
|
20
|
+
/**
|
|
21
|
+
* Callback ref for a field's control. Pass it where the control lands and
|
|
22
|
+
* react-hook-form gets a handle that reaches it.
|
|
23
|
+
*
|
|
24
|
+
* @param registerRef `controller.field.ref` from useController.
|
|
25
|
+
*/
|
|
26
|
+
export const useFieldRef = (registerRef) => {
|
|
27
|
+
const control = useRef(null);
|
|
28
|
+
return useCallback((instance) => {
|
|
29
|
+
control.current = instance;
|
|
30
|
+
if (!instance) {
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
registerRef(fieldRefHandle(() => control.current?.focus?.(), () => control.current));
|
|
34
|
+
}, [registerRef]);
|
|
35
|
+
};
|
|
36
|
+
//# sourceMappingURL=use-field-ref.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-field-ref.js","sourceRoot":"","sources":["../../../src/hooks/use-field-ref.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAa5C;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAC5B,KAAiB,EACjB,UAAiD,EACjD,EAAE,CAAC,CAAC;IACJ,KAAK;IACL,MAAM,EAAE,GAAG,EAAE,CAAC,UAAU,EAAE,EAAE,MAAM,EAAE,EAAE;IACtC,iBAAiB,EAAE,CAAC,OAAe,EAAE,EAAE,CACrC,UAAU,EAAE,EAAE,iBAAiB,EAAE,CAAC,OAAO,CAAC;IAC5C,cAAc,EAAE,GAAG,EAAE,CAAC,UAAU,EAAE,EAAE,cAAc,EAAE,EAAE,IAAI,IAAI;CAC/D,CAAC,CAAC;AAEH;;;;;GAKG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,CACzB,WAAwC,EACG,EAAE;IAC7C,MAAM,OAAO,GACX,MAAM,CAAsB,IAAI,CAAC,CAAC;IAEpC,OAAO,WAAW,CAChB,CAAC,QAA6B,EAAE,EAAE;QAChC,OAAO,CAAC,OAAO,GAAG,QAAQ,CAAC;QAC3B,IAAI,CAAC,QAAQ,EAAE;YACb,OAAO;SACR;QACD,WAAW,CACT,cAAc,CACZ,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE,EAChC,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,CACtB,CACF,CAAC;IACJ,CAAC,EACD,CAAC,WAAW,CAAC,CACd,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { useCallback } from 'react';
|
|
2
|
+
import { fieldRefHandle } from './use-field-ref';
|
|
2
3
|
/**
|
|
3
4
|
* Ref for a field whose control cannot be handed to react-hook-form directly.
|
|
4
5
|
*
|
|
5
|
-
* react-hook-form focuses an invalid field by calling `focus()` on whatever
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
6
|
+
* react-hook-form focuses an invalid field by calling `focus()` on whatever was
|
|
7
|
+
* registered, so registering a plain wrapper element does nothing — a `div` is
|
|
8
|
+
* not focusable and the call is silently dropped. Registering an object with a
|
|
9
|
+
* `focus()` of our own works instead: it brings the wrapper into view, then
|
|
10
|
+
* focuses the control inside it when there is one.
|
|
10
11
|
*
|
|
11
12
|
* @param registerRef `controller.field.ref` from useController.
|
|
12
13
|
* @param focusSelector Control to focus inside the wrapper, when present.
|
|
@@ -15,12 +16,11 @@ export const useScrollToErrorRef = (registerRef, focusSelector) => useCallback((
|
|
|
15
16
|
if (!element) {
|
|
16
17
|
return;
|
|
17
18
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
});
|
|
19
|
+
const control = () => element.querySelector(focusSelector) ?? undefined;
|
|
20
|
+
registerRef(fieldRefHandle(() => {
|
|
21
|
+
// Not implemented in jsdom.
|
|
22
|
+
element.scrollIntoView?.({ block: 'center' });
|
|
23
|
+
control()?.focus();
|
|
24
|
+
}, control));
|
|
25
25
|
}, [registerRef, focusSelector]);
|
|
26
26
|
//# sourceMappingURL=use-scroll-to-error-ref.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-scroll-to-error-ref.js","sourceRoot":"","sources":["../../../src/hooks/use-scroll-to-error-ref.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAEpC;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CACjC,WAAwC,EACxC,aAAqB,EACrB,EAAE,CACF,WAAW,CACT,CAAC,OAAiB,EAAE,EAAE;IACpB,IAAI,CAAC,OAAO,EAAE;QACZ,OAAO;KACR;IAED,
|
|
1
|
+
{"version":3,"file":"use-scroll-to-error-ref.js","sourceRoot":"","sources":["../../../src/hooks/use-scroll-to-error-ref.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAEpC,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEjD;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CACjC,WAAwC,EACxC,aAAqB,EACrB,EAAE,CACF,WAAW,CACT,CAAC,OAAiB,EAAE,EAAE;IACpB,IAAI,CAAC,OAAO,EAAE;QACZ,OAAO;KACR;IAED,MAAM,OAAO,GAAG,GAAG,EAAE,CACnB,OAAO,CAAC,aAAa,CAAc,aAAa,CAAC,IAAI,SAAS,CAAC;IAEjE,WAAW,CACT,cAAc,CAAC,GAAG,EAAE;QAClB,4BAA4B;QAC5B,OAAO,CAAC,cAAc,EAAE,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAC;QAC9C,OAAO,EAAE,EAAE,KAAK,EAAE,CAAC;IACrB,CAAC,EAAE,OAAO,CAAC,CACZ,CAAC;AACJ,CAAC,EACD,CAAC,WAAW,EAAE,aAAa,CAAC,CAC7B,CAAC"}
|