@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.
Files changed (278) hide show
  1. package/dist/cjs/components/address/form-address.js +5 -3
  2. package/dist/cjs/components/address/form-address.js.map +1 -1
  3. package/dist/cjs/components/address/input/address-input.st.css.js +3 -3
  4. package/dist/cjs/components/address/input/address-input.st.css.js.map +1 -1
  5. package/dist/cjs/components/audio/actions/actions-menu/actions-menu.st.css.js +3 -3
  6. package/dist/cjs/components/audio/actions/actions-menu/actions-menu.st.css.js.map +1 -1
  7. package/dist/cjs/components/audio/audio-field/form-audio-field.st.css.js +4 -4
  8. package/dist/cjs/components/audio/audio-field/form-audio-field.st.css.js.map +1 -1
  9. package/dist/cjs/components/audio/audio-field/form-audio.js +5 -3
  10. package/dist/cjs/components/audio/audio-field/form-audio.js.map +1 -1
  11. package/dist/cjs/components/audio/audio-player/audio-player.st.css.js +2 -2
  12. package/dist/cjs/components/audio/audio-player/audio-player.st.css.js.map +1 -1
  13. package/dist/cjs/components/color-view/cell-color-view.st.css.js +3 -3
  14. package/dist/cjs/components/color-view/cell-color-view.st.css.js.map +1 -1
  15. package/dist/cjs/components/color-view/color-input.js +6 -5
  16. package/dist/cjs/components/color-view/color-input.js.map +1 -1
  17. package/dist/cjs/components/color-view/color-view.st.css.js +4 -4
  18. package/dist/cjs/components/color-view/color-view.st.css.js.map +1 -1
  19. package/dist/cjs/components/color-view/form-color.driver.js +8 -2
  20. package/dist/cjs/components/color-view/form-color.driver.js.map +1 -1
  21. package/dist/cjs/components/datetime-input/form-date-time.driver.js +4 -1
  22. package/dist/cjs/components/datetime-input/form-date-time.driver.js.map +1 -1
  23. package/dist/cjs/components/datetime-input/form-date-time.js +1 -0
  24. package/dist/cjs/components/datetime-input/form-date-time.js.map +1 -1
  25. package/dist/cjs/components/delete-dialog/delete-dialog.st.css.js +3 -3
  26. package/dist/cjs/components/delete-dialog/delete-dialog.st.css.js.map +1 -1
  27. package/dist/cjs/components/document/form-document-field.st.css.js +7 -7
  28. package/dist/cjs/components/document/form-document-field.st.css.js.map +1 -1
  29. package/dist/cjs/components/document/form-document.js +5 -3
  30. package/dist/cjs/components/document/form-document.js.map +1 -1
  31. package/dist/cjs/components/exclamation/exclamation.st.css.js +5 -5
  32. package/dist/cjs/components/exclamation/exclamation.st.css.js.map +1 -1
  33. package/dist/cjs/components/highlighted-text/highlighted-text.st.css.js +5 -5
  34. package/dist/cjs/components/highlighted-text/highlighted-text.st.css.js.map +1 -1
  35. package/dist/cjs/components/image/form-image-input.js +6 -4
  36. package/dist/cjs/components/image/form-image-input.js.map +1 -1
  37. package/dist/cjs/components/image/thumbnail-replace-overlay.st.css.js +3 -3
  38. package/dist/cjs/components/image/thumbnail-replace-overlay.st.css.js.map +1 -1
  39. package/dist/cjs/components/media-control/cell-media-edit-shell.st.css.js +2 -2
  40. package/dist/cjs/components/media-control/cell-media-edit-shell.st.css.js.map +1 -1
  41. package/dist/cjs/components/media-control/paste-url-button.st.css.js +4 -4
  42. package/dist/cjs/components/media-control/paste-url-button.st.css.js.map +1 -1
  43. package/dist/cjs/components/media-gallery/form-media-gallery-field.st.css.js +10 -10
  44. package/dist/cjs/components/media-gallery/form-media-gallery-field.st.css.js.map +1 -1
  45. package/dist/cjs/components/media-gallery/form-media-gallery.js +5 -3
  46. package/dist/cjs/components/media-gallery/form-media-gallery.js.map +1 -1
  47. package/dist/cjs/components/media-image/media-image.st.css.js +4 -4
  48. package/dist/cjs/components/media-image/media-image.st.css.js.map +1 -1
  49. package/dist/cjs/components/media-image/overlays/overlay.st.css.js +3 -3
  50. package/dist/cjs/components/media-image/overlays/overlay.st.css.js.map +1 -1
  51. package/dist/cjs/components/media-loader/media-loader.st.css.js +3 -3
  52. package/dist/cjs/components/media-loader/media-loader.st.css.js.map +1 -1
  53. package/dist/cjs/components/media-tag/web-media-tag/media-tag.st.css.js +2 -2
  54. package/dist/cjs/components/media-tag/web-media-tag/media-tag.st.css.js.map +1 -1
  55. package/dist/cjs/components/multi-document/cell-multi-document-edit.st.css.js +3 -3
  56. package/dist/cjs/components/multi-document/cell-multi-document-edit.st.css.js.map +1 -1
  57. package/dist/cjs/components/multi-document/multi-document-input/form-multi-document.js +5 -3
  58. package/dist/cjs/components/multi-document/multi-document-input/form-multi-document.js.map +1 -1
  59. package/dist/cjs/components/multi-document/multi-document-input/form-multi-document.st.css.js +5 -5
  60. package/dist/cjs/components/multi-document/multi-document-input/form-multi-document.st.css.js.map +1 -1
  61. package/dist/cjs/components/reference/cell-multi-reference-input.st.css.js +2 -2
  62. package/dist/cjs/components/reference/cell-multi-reference-input.st.css.js.map +1 -1
  63. package/dist/cjs/components/reference/cell-reference-input.st.css.js +3 -3
  64. package/dist/cjs/components/reference/cell-reference-input.st.css.js.map +1 -1
  65. package/dist/cjs/components/rich-content/rich-content-input/default-value-input/rich-content-default-value-input.st.css.js +4 -4
  66. package/dist/cjs/components/rich-content/rich-content-input/default-value-input/rich-content-default-value-input.st.css.js.map +1 -1
  67. package/dist/cjs/components/rich-content/rich-content-input/form-input/rich-content-form-input.st.css +15 -7
  68. package/dist/cjs/components/rich-content/rich-content-input/form-input/rich-content-form-input.st.css.js +11 -7
  69. package/dist/cjs/components/rich-content/rich-content-input/form-input/rich-content-form-input.st.css.js.map +1 -1
  70. package/dist/cjs/components/rich-content/rich-content-input/form-read-only-input/rich-content-form-read-only-input.st.css.js +2 -2
  71. 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
  72. package/dist/cjs/components/rich-content/rich-content-input/rich-content-common/fullscreen-modal/fullscreen-modal.st.css.js +3 -3
  73. package/dist/cjs/components/rich-content/rich-content-input/rich-content-common/fullscreen-modal/fullscreen-modal.st.css.js.map +1 -1
  74. package/dist/cjs/components/rich-content/rich-content-input/rich-content-common/publish-loader/publish-loader.st.css.js +3 -3
  75. package/dist/cjs/components/rich-content/rich-content-input/rich-content-common/publish-loader/publish-loader.st.css.js.map +1 -1
  76. package/dist/cjs/components/rich-content/rich-content-input/rich-content-common/toggle-fullscreen-button/toggle-fullscreen-button.st.css.js +2 -2
  77. package/dist/cjs/components/rich-content/rich-content-input/rich-content-common/toggle-fullscreen-button/toggle-fullscreen-button.st.css.js.map +1 -1
  78. package/dist/cjs/components/rich-content/rich-content-input/rich-content-editor/rich-content-editor.st.css.js +7 -7
  79. package/dist/cjs/components/rich-content/rich-content-input/rich-content-editor/rich-content-editor.st.css.js.map +1 -1
  80. package/dist/cjs/components/rich-content/rich-content-input/rich-content-editor/rich-content-toolbar.st.css.js +5 -5
  81. package/dist/cjs/components/rich-content/rich-content-input/rich-content-editor/rich-content-toolbar.st.css.js.map +1 -1
  82. package/dist/cjs/components/rich-content/rich-content-input/rich-content-viewer/rich-content-viewer.st.css.js +4 -4
  83. package/dist/cjs/components/rich-content/rich-content-input/rich-content-viewer/rich-content-viewer.st.css.js.map +1 -1
  84. package/dist/cjs/components/rich-text/rich-text-input/rich-text-editor/rich-editor.st.css.js +18 -18
  85. package/dist/cjs/components/rich-text/rich-text-input/rich-text-editor/rich-editor.st.css.js.map +1 -1
  86. package/dist/cjs/components/rich-text/rich-text-input/rich-text-editor/rich-text-editor.st.css +32 -19
  87. package/dist/cjs/components/rich-text/rich-text-input/rich-text-editor/rich-text-editor.st.css.js +20 -12
  88. package/dist/cjs/components/rich-text/rich-text-input/rich-text-editor/rich-text-editor.st.css.js.map +1 -1
  89. package/dist/cjs/components/rich-text/rich-text-input/rich-text-editor/toolbar/toolbar.st.css.js +18 -18
  90. package/dist/cjs/components/rich-text/rich-text-input/rich-text-editor/toolbar/toolbar.st.css.js.map +1 -1
  91. package/dist/cjs/components/text/text-view.st.css.js +3 -3
  92. package/dist/cjs/components/text/text-view.st.css.js.map +1 -1
  93. package/dist/cjs/components/time-input/form-time.js +9 -10
  94. package/dist/cjs/components/time-input/form-time.js.map +1 -1
  95. package/dist/cjs/components/video/form-video.js +30 -29
  96. package/dist/cjs/components/video/form-video.js.map +1 -1
  97. package/dist/cjs/hooks/index.js +6 -0
  98. package/dist/cjs/hooks/index.js.map +1 -1
  99. package/dist/cjs/hooks/pr-5746-kobiburnley-comments.md +54 -0
  100. package/dist/cjs/hooks/use-field-ref.js +60 -0
  101. package/dist/cjs/hooks/use-field-ref.js.map +1 -0
  102. package/dist/cjs/hooks/use-scroll-to-error-ref.js +15 -15
  103. package/dist/cjs/hooks/use-scroll-to-error-ref.js.map +1 -1
  104. package/dist/cjs/styles.global.css +1 -1
  105. package/dist/esm/components/address/form-address.js +3 -1
  106. package/dist/esm/components/address/form-address.js.map +1 -1
  107. package/dist/esm/components/address/input/address-input.st.css.js +2 -2
  108. package/dist/esm/components/audio/actions/actions-menu/actions-menu.st.css.js +2 -2
  109. package/dist/esm/components/audio/audio-field/form-audio-field.st.css.js +2 -2
  110. package/dist/esm/components/audio/audio-field/form-audio-field.st.css.js.map +1 -1
  111. package/dist/esm/components/audio/audio-field/form-audio.js +3 -1
  112. package/dist/esm/components/audio/audio-field/form-audio.js.map +1 -1
  113. package/dist/esm/components/audio/audio-player/audio-player.st.css.js +2 -2
  114. package/dist/esm/components/color-view/cell-color-view.st.css.js +2 -2
  115. package/dist/esm/components/color-view/color-input.js +1 -1
  116. package/dist/esm/components/color-view/color-input.js.map +1 -1
  117. package/dist/esm/components/color-view/color-view.st.css.js +2 -2
  118. package/dist/esm/components/color-view/form-color.driver.js +8 -2
  119. package/dist/esm/components/color-view/form-color.driver.js.map +1 -1
  120. package/dist/esm/components/datetime-input/form-date-time.driver.js +3 -0
  121. package/dist/esm/components/datetime-input/form-date-time.driver.js.map +1 -1
  122. package/dist/esm/components/datetime-input/form-date-time.js +1 -1
  123. package/dist/esm/components/datetime-input/form-date-time.js.map +1 -1
  124. package/dist/esm/components/delete-dialog/delete-dialog.st.css.js +2 -2
  125. package/dist/esm/components/document/form-document-field.st.css.js +2 -2
  126. package/dist/esm/components/document/form-document.js +3 -1
  127. package/dist/esm/components/document/form-document.js.map +1 -1
  128. package/dist/esm/components/exclamation/exclamation.st.css.js +2 -2
  129. package/dist/esm/components/highlighted-text/highlighted-text.st.css.js +3 -3
  130. package/dist/esm/components/image/form-image-input.js +3 -1
  131. package/dist/esm/components/image/form-image-input.js.map +1 -1
  132. package/dist/esm/components/image/thumbnail-replace-overlay.st.css.js +2 -2
  133. package/dist/esm/components/media-control/cell-media-edit-shell.st.css.js +2 -2
  134. package/dist/esm/components/media-control/cell-media-edit-shell.st.css.js.map +1 -1
  135. package/dist/esm/components/media-control/paste-url-button.st.css.js +2 -2
  136. package/dist/esm/components/media-control/paste-url-button.st.css.js.map +1 -1
  137. package/dist/esm/components/media-gallery/form-media-gallery-field.st.css.js +2 -2
  138. package/dist/esm/components/media-gallery/form-media-gallery.js +3 -1
  139. package/dist/esm/components/media-gallery/form-media-gallery.js.map +1 -1
  140. package/dist/esm/components/media-image/media-image.st.css.js +3 -3
  141. package/dist/esm/components/media-image/overlays/overlay.st.css.js +2 -2
  142. package/dist/esm/components/media-image/overlays/overlay.st.css.js.map +1 -1
  143. package/dist/esm/components/media-loader/media-loader.st.css.js +2 -2
  144. package/dist/esm/components/media-loader/media-loader.st.css.js.map +1 -1
  145. package/dist/esm/components/media-tag/web-media-tag/media-tag.st.css.js +2 -2
  146. package/dist/esm/components/multi-document/cell-multi-document-edit.st.css.js +2 -2
  147. package/dist/esm/components/multi-document/multi-document-input/form-multi-document.js +3 -1
  148. package/dist/esm/components/multi-document/multi-document-input/form-multi-document.js.map +1 -1
  149. package/dist/esm/components/multi-document/multi-document-input/form-multi-document.st.css.js +2 -2
  150. package/dist/esm/components/multi-document/multi-document-input/form-multi-document.st.css.js.map +1 -1
  151. package/dist/esm/components/reference/cell-multi-reference-input.st.css.js +2 -2
  152. package/dist/esm/components/reference/cell-reference-input.st.css.js +2 -2
  153. package/dist/esm/components/rich-content/rich-content-input/default-value-input/rich-content-default-value-input.st.css.js +2 -2
  154. package/dist/esm/components/rich-content/rich-content-input/form-input/rich-content-form-input.st.css +15 -7
  155. package/dist/esm/components/rich-content/rich-content-input/form-input/rich-content-form-input.st.css.js +3 -3
  156. package/dist/esm/components/rich-content/rich-content-input/form-input/rich-content-form-input.st.css.js.map +1 -1
  157. package/dist/esm/components/rich-content/rich-content-input/form-read-only-input/rich-content-form-read-only-input.st.css.js +2 -2
  158. 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
  159. package/dist/esm/components/rich-content/rich-content-input/rich-content-common/fullscreen-modal/fullscreen-modal.st.css.js +2 -2
  160. package/dist/esm/components/rich-content/rich-content-input/rich-content-common/publish-loader/publish-loader.st.css.js +2 -2
  161. package/dist/esm/components/rich-content/rich-content-input/rich-content-common/toggle-fullscreen-button/toggle-fullscreen-button.st.css.js +2 -2
  162. package/dist/esm/components/rich-content/rich-content-input/rich-content-editor/rich-content-editor.st.css.js +2 -2
  163. package/dist/esm/components/rich-content/rich-content-input/rich-content-editor/rich-content-toolbar.st.css.js +2 -2
  164. package/dist/esm/components/rich-content/rich-content-input/rich-content-viewer/rich-content-viewer.st.css.js +2 -2
  165. package/dist/esm/components/rich-content/rich-content-input/rich-content-viewer/rich-content-viewer.st.css.js.map +1 -1
  166. package/dist/esm/components/rich-text/rich-text-input/rich-text-editor/rich-editor.st.css.js +2 -2
  167. package/dist/esm/components/rich-text/rich-text-input/rich-text-editor/rich-editor.st.css.js.map +1 -1
  168. package/dist/esm/components/rich-text/rich-text-input/rich-text-editor/rich-text-editor.st.css +32 -19
  169. package/dist/esm/components/rich-text/rich-text-input/rich-text-editor/rich-text-editor.st.css.js +3 -3
  170. package/dist/esm/components/rich-text/rich-text-input/rich-text-editor/rich-text-editor.st.css.js.map +1 -1
  171. package/dist/esm/components/rich-text/rich-text-input/rich-text-editor/toolbar/toolbar.st.css.js +2 -2
  172. package/dist/esm/components/rich-text/rich-text-input/rich-text-editor/toolbar/toolbar.st.css.js.map +1 -1
  173. package/dist/esm/components/text/text-view.st.css.js +2 -2
  174. package/dist/esm/components/text/text-view.st.css.js.map +1 -1
  175. package/dist/esm/components/time-input/form-time.js +4 -3
  176. package/dist/esm/components/time-input/form-time.js.map +1 -1
  177. package/dist/esm/components/video/form-video.js +3 -2
  178. package/dist/esm/components/video/form-video.js.map +1 -1
  179. package/dist/esm/hooks/index.js +1 -0
  180. package/dist/esm/hooks/index.js.map +1 -1
  181. package/dist/esm/hooks/pr-5746-kobiburnley-comments.md +54 -0
  182. package/dist/esm/hooks/use-field-ref.js +36 -0
  183. package/dist/esm/hooks/use-field-ref.js.map +1 -0
  184. package/dist/esm/hooks/use-scroll-to-error-ref.js +12 -12
  185. package/dist/esm/hooks/use-scroll-to-error-ref.js.map +1 -1
  186. package/dist/esm/styles.global.css +1 -1
  187. package/dist/types/components/address/form-address.d.ts.map +1 -1
  188. package/dist/types/components/audio/audio-field/form-audio-field.st.css.d.ts.map +1 -1
  189. package/dist/types/components/audio/audio-field/form-audio.d.ts.map +1 -1
  190. package/dist/types/components/color-view/color-input.d.ts.map +1 -1
  191. package/dist/types/components/color-view/form-color.driver.d.ts +5 -15
  192. package/dist/types/components/color-view/form-color.driver.d.ts.map +1 -1
  193. package/dist/types/components/datetime-input/form-date-time.driver.d.ts +1 -0
  194. package/dist/types/components/datetime-input/form-date-time.driver.d.ts.map +1 -1
  195. package/dist/types/components/document/form-document.d.ts.map +1 -1
  196. package/dist/types/components/image/form-image-input.d.ts.map +1 -1
  197. package/dist/types/components/media-control/cell-media-edit-shell.st.css.d.ts.map +1 -1
  198. package/dist/types/components/media-control/paste-url-button.st.css.d.ts.map +1 -1
  199. package/dist/types/components/media-gallery/form-media-gallery.d.ts.map +1 -1
  200. package/dist/types/components/media-image/overlays/overlay.st.css.d.ts.map +1 -1
  201. package/dist/types/components/media-loader/media-loader.st.css.d.ts.map +1 -1
  202. package/dist/types/components/multi-document/multi-document-input/form-multi-document.d.ts.map +1 -1
  203. package/dist/types/components/multi-document/multi-document-input/form-multi-document.st.css.d.ts.map +1 -1
  204. package/dist/types/components/rich-content/rich-content-input/form-input/rich-content-form-input.st.css.d.ts +7 -3
  205. package/dist/types/components/rich-content/rich-content-input/form-input/rich-content-form-input.st.css.d.ts.map +1 -1
  206. 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
  207. package/dist/types/components/rich-content/rich-content-input/rich-content-viewer/rich-content-viewer.st.css.d.ts.map +1 -1
  208. package/dist/types/components/rich-text/rich-text-input/rich-text-editor/rich-editor.st.css.d.ts.map +1 -1
  209. package/dist/types/components/rich-text/rich-text-input/rich-text-editor/rich-text-editor.st.css.d.ts +16 -8
  210. package/dist/types/components/rich-text/rich-text-input/rich-text-editor/rich-text-editor.st.css.d.ts.map +1 -1
  211. package/dist/types/components/rich-text/rich-text-input/rich-text-editor/toolbar/toolbar.st.css.d.ts.map +1 -1
  212. package/dist/types/components/text/text-view.st.css.d.ts.map +1 -1
  213. package/dist/types/components/time-input/form-time.d.ts.map +1 -1
  214. package/dist/types/components/video/form-video.d.ts.map +1 -1
  215. package/dist/types/hooks/index.d.ts +1 -0
  216. package/dist/types/hooks/index.d.ts.map +1 -1
  217. package/dist/types/hooks/use-field-ref.d.ts +36 -0
  218. package/dist/types/hooks/use-field-ref.d.ts.map +1 -0
  219. package/dist/types/hooks/use-scroll-to-error-ref.d.ts +5 -5
  220. package/dist/types/hooks/use-scroll-to-error-ref.d.ts.map +1 -1
  221. package/package.json +4 -4
  222. package/src/__tests__/components/color-view/form-color.spec.tsx +46 -3
  223. package/src/__tests__/components/rich-editors-border.spec.ts +45 -0
  224. package/src/__tests__/hooks/use-field-ref.spec.tsx +132 -0
  225. package/src/components/address/form-address.tsx +4 -1
  226. package/src/components/address/input/address-input.st.css.ts +2 -2
  227. package/src/components/audio/actions/actions-menu/actions-menu.st.css.ts +2 -2
  228. package/src/components/audio/audio-field/form-audio-field.st.css.ts +2 -2
  229. package/src/components/audio/audio-field/form-audio.tsx +4 -1
  230. package/src/components/audio/audio-player/audio-player.st.css.ts +2 -2
  231. package/src/components/color-view/cell-color-view.st.css.ts +2 -2
  232. package/src/components/color-view/color-input.tsx +13 -2
  233. package/src/components/color-view/color-view.st.css.ts +2 -2
  234. package/src/components/color-view/form-color.driver.ts +8 -2
  235. package/src/components/datetime-input/form-date-time.driver.ts +3 -0
  236. package/src/components/datetime-input/form-date-time.tsx +1 -1
  237. package/src/components/delete-dialog/delete-dialog.st.css.ts +2 -2
  238. package/src/components/document/form-document-field.st.css.ts +2 -2
  239. package/src/components/document/form-document.tsx +4 -1
  240. package/src/components/exclamation/exclamation.st.css.ts +2 -2
  241. package/src/components/highlighted-text/highlighted-text.st.css.ts +3 -3
  242. package/src/components/image/form-image-input.tsx +4 -1
  243. package/src/components/image/thumbnail-replace-overlay.st.css.ts +2 -2
  244. package/src/components/media-control/cell-media-edit-shell.st.css.ts +2 -2
  245. package/src/components/media-control/paste-url-button.st.css.ts +2 -2
  246. package/src/components/media-gallery/form-media-gallery-field.st.css.ts +2 -2
  247. package/src/components/media-gallery/form-media-gallery.tsx +4 -1
  248. package/src/components/media-image/media-image.st.css.ts +3 -3
  249. package/src/components/media-image/overlays/overlay.st.css.ts +2 -2
  250. package/src/components/media-loader/media-loader.st.css.ts +2 -2
  251. package/src/components/media-tag/web-media-tag/media-tag.st.css.ts +2 -2
  252. package/src/components/multi-document/cell-multi-document-edit.st.css.ts +2 -2
  253. package/src/components/multi-document/multi-document-input/form-multi-document.st.css.ts +2 -2
  254. package/src/components/multi-document/multi-document-input/form-multi-document.tsx +4 -1
  255. package/src/components/reference/cell-multi-reference-input.st.css.ts +2 -2
  256. package/src/components/reference/cell-reference-input.st.css.ts +2 -2
  257. package/src/components/rich-content/rich-content-input/default-value-input/rich-content-default-value-input.st.css.ts +2 -2
  258. package/src/components/rich-content/rich-content-input/form-input/rich-content-form-input.st.css +15 -7
  259. package/src/components/rich-content/rich-content-input/form-input/rich-content-form-input.st.css.ts +3 -3
  260. package/src/components/rich-content/rich-content-input/form-read-only-input/rich-content-form-read-only-input.st.css.ts +2 -2
  261. package/src/components/rich-content/rich-content-input/rich-content-common/fullscreen-modal/fullscreen-modal.st.css.ts +2 -2
  262. package/src/components/rich-content/rich-content-input/rich-content-common/publish-loader/publish-loader.st.css.ts +2 -2
  263. package/src/components/rich-content/rich-content-input/rich-content-common/toggle-fullscreen-button/toggle-fullscreen-button.st.css.ts +2 -2
  264. package/src/components/rich-content/rich-content-input/rich-content-editor/rich-content-editor.st.css.ts +2 -2
  265. package/src/components/rich-content/rich-content-input/rich-content-editor/rich-content-toolbar.st.css.ts +2 -2
  266. package/src/components/rich-content/rich-content-input/rich-content-viewer/rich-content-viewer.st.css.ts +2 -2
  267. package/src/components/rich-text/rich-text-input/rich-text-editor/rich-editor.st.css.ts +2 -2
  268. package/src/components/rich-text/rich-text-input/rich-text-editor/rich-text-editor.st.css +32 -19
  269. package/src/components/rich-text/rich-text-input/rich-text-editor/rich-text-editor.st.css.ts +3 -3
  270. package/src/components/rich-text/rich-text-input/rich-text-editor/toolbar/toolbar.st.css.ts +2 -2
  271. package/src/components/text/text-view.st.css.ts +2 -2
  272. package/src/components/time-input/form-time.tsx +9 -3
  273. package/src/components/video/form-video.tsx +4 -2
  274. package/src/hooks/index.ts +1 -0
  275. package/src/hooks/pr-5746-kobiburnley-comments.md +54 -0
  276. package/src/hooks/use-field-ref.ts +65 -0
  277. package/src/hooks/use-scroll-to-error-ref.ts +15 -10
  278. package/src/styles.global.css +1 -1
@@ -0,0 +1,45 @@
1
+ import fs from 'fs';
2
+ import path from 'path';
3
+
4
+ // CAIRO-4561: both editors rendered with no border at all. The rules were
5
+ // there, but they read `var(--wds-color-blue-300)` with no fallback, and a
6
+ // custom property that resolves to nothing makes the whole declaration invalid
7
+ // — so the border was dropped rather than falling back to a default. WDS Input
8
+ // spells every one of these as `var(--token, var(--wsr-token, #literal))`.
9
+ const STYLESHEETS = [
10
+ 'components/rich-text/rich-text-input/rich-text-editor/rich-text-editor.st.css',
11
+ 'components/rich-content/rich-content-input/form-input/rich-content-form-input.st.css',
12
+ ];
13
+
14
+ const read = (relative: string) =>
15
+ fs.readFileSync(path.join(__dirname, '../../', relative), 'utf8');
16
+
17
+ /** Every declaration whose property is border-ish or a shadow. */
18
+ const borderDeclarations = (css: string) =>
19
+ css
20
+ .split(/[;{}]/)
21
+ .map((chunk) => chunk.trim())
22
+ .filter((chunk) => /^(border[\w-]*|box-shadow)\s*:/.test(chunk));
23
+
24
+ describe('rich editor borders', () => {
25
+ it.each(STYLESHEETS)('declares a visible border in %s', (relative) => {
26
+ const declarations = borderDeclarations(read(relative));
27
+
28
+ expect(
29
+ declarations.some((d) => d.includes('var(--wds-input-border-color,')),
30
+ ).toBe(true);
31
+ });
32
+
33
+ it.each(STYLESHEETS)(
34
+ 'gives every custom property in a border declaration a fallback in %s',
35
+ (relative) => {
36
+ const withoutFallback = borderDeclarations(read(relative)).filter((d) =>
37
+ Array.from(d.matchAll(/var\(\s*(--[\w-]+)\s*([,)])/g)).some(
38
+ ([, , delimiter]) => delimiter === ')',
39
+ ),
40
+ );
41
+
42
+ expect(withoutFallback).toEqual([]);
43
+ },
44
+ );
45
+ });
@@ -0,0 +1,132 @@
1
+ import '../../testkit/test-polyfills';
2
+
3
+ import React from 'react';
4
+ import { act, render } from '@testing-library/react';
5
+ import type { Field } from '@wix/bex-core';
6
+ import { useForm } from '@wix/bex-core/form';
7
+ import type { Control, FieldValues } from '@wix/bex-core/form';
8
+
9
+ import { PatternsFieldsTestProvider } from '../../testkit/patterns-fields-test-provider';
10
+ import { FormAddress } from '../../components/address/form-address';
11
+ import { FormTime } from '../../components/time-input/form-time';
12
+ import { FormDocument } from '../../components/document/form-document';
13
+ import { FormImageInput } from '../../components/image/form-image-input';
14
+ import { fieldRefHandle } from '../../hooks';
15
+
16
+ interface Case {
17
+ name: string;
18
+ Component: React.ComponentType<any>;
19
+ field: Field;
20
+ }
21
+
22
+ const field = (id: string, type: string): Field =>
23
+ ({
24
+ id,
25
+ displayName: id,
26
+ type,
27
+ validation: { required: true },
28
+ } as Field);
29
+
30
+ // Every control here answers focus() and nothing else, which is the shape that
31
+ // used to make setFocus with shouldSelect throw.
32
+ const CASES: Case[] = [
33
+ // AddressInputImperativeHandle: { focus, clear }
34
+ {
35
+ name: 'FormAddress',
36
+ Component: FormAddress,
37
+ field: field('location', 'ADDRESS'),
38
+ },
39
+ // TimeInputImperativeActions: no select()
40
+ { name: 'FormTime', Component: FormTime, field: field('start', 'TIME') },
41
+ // AddItemActions: { blur, focus }. Shared with audio, multi-document and
42
+ // media-gallery, so one of the four covers that shape.
43
+ {
44
+ name: 'FormDocument',
45
+ Component: FormDocument,
46
+ field: field('spec', 'DOCUMENT'),
47
+ },
48
+ // ImageViewer instance, shared with video.
49
+ {
50
+ name: 'FormImageInput',
51
+ Component: FormImageInput,
52
+ field: field('cover', 'IMAGE'),
53
+ },
54
+ ];
55
+
56
+ describe('fieldRefHandle', () => {
57
+ it('sends focus to the given callback', () => {
58
+ const focus = jest.fn();
59
+
60
+ fieldRefHandle(focus, () => undefined).focus();
61
+
62
+ expect(focus).toHaveBeenCalled();
63
+ });
64
+
65
+ // The whole point: a control with only focus() must not make the other
66
+ // calls blow up, because react-hook-form makes them unconditionally.
67
+ it('absorbs the calls a focus-only control cannot answer', () => {
68
+ const handle = fieldRefHandle(
69
+ () => {},
70
+ () => ({ focus: () => {} }),
71
+ );
72
+
73
+ expect(() => handle.select()).not.toThrow();
74
+ expect(() => handle.setCustomValidity('nope')).not.toThrow();
75
+ expect(handle.reportValidity()).toBe(true);
76
+ });
77
+
78
+ it('passes the calls on to a control that does answer them', () => {
79
+ const control = {
80
+ focus: jest.fn(),
81
+ select: jest.fn(),
82
+ setCustomValidity: jest.fn(),
83
+ reportValidity: jest.fn().mockReturnValue(false),
84
+ };
85
+ const handle = fieldRefHandle(control.focus, () => control);
86
+
87
+ handle.select();
88
+ handle.setCustomValidity('bad');
89
+
90
+ expect(control.select).toHaveBeenCalled();
91
+ expect(control.setCustomValidity).toHaveBeenCalledWith('bad');
92
+ expect(handle.reportValidity()).toBe(false);
93
+ });
94
+ });
95
+
96
+ describe.each(CASES)(
97
+ '$name, whose control only has focus',
98
+ ({ Component, field: f }) => {
99
+ let form: ReturnType<typeof useForm<FieldValues>> | undefined;
100
+
101
+ const Harness = () => {
102
+ const methods = useForm<FieldValues>({ mode: 'onChange' });
103
+ form = methods;
104
+ return (
105
+ <Component
106
+ field={f}
107
+ value={undefined as never}
108
+ onChange={() => {}}
109
+ dataHook={`${f.id}-field`}
110
+ formControl={methods.control as Control<FieldValues>}
111
+ data={{}}
112
+ />
113
+ );
114
+ };
115
+
116
+ // react-hook-form reaches select() through the handle it wraps around
117
+ // whatever was registered, so a focus-only control used to throw here.
118
+ it('survives setFocus with shouldSelect', () => {
119
+ render(
120
+ <PatternsFieldsTestProvider>
121
+ <Harness />
122
+ </PatternsFieldsTestProvider>,
123
+ );
124
+
125
+ expect(() =>
126
+ act(() => {
127
+ form!.setFocus(f.id, { shouldSelect: true });
128
+ }),
129
+ ).not.toThrow();
130
+ });
131
+ },
132
+ );
@@ -9,6 +9,7 @@ import type { Address } from '../../types/address';
9
9
  import { isEmpty } from '../../validations/value';
10
10
 
11
11
  import { FormAddressInput } from './input/form-address-input';
12
+ import { useFieldRef } from '../../hooks';
12
13
 
13
14
  export interface FormAddressProps extends BaseInputProps<Address> {}
14
15
 
@@ -31,6 +32,8 @@ const _FormAddress = (props: FormAddressProps) => {
31
32
  },
32
33
  });
33
34
 
35
+ const setFieldRef = useFieldRef(controller.field.ref);
36
+
34
37
  return (
35
38
  <FormField
36
39
  label={field.displayName}
@@ -45,7 +48,7 @@ const _FormAddress = (props: FormAddressProps) => {
45
48
  onChange={(value) => controller.field.onChange?.(value)}
46
49
  // Hand the input to react-hook-form so shouldFocusError scrolls to +
47
50
  // focuses this field when it blocks save.
48
- inputRef={controller.field.ref}
51
+ inputRef={setFieldRef}
49
52
  dataHook={`address-${field.id}`}
50
53
  field={field.id}
51
54
  />
@@ -5,7 +5,7 @@ import { classesRuntime, statesRuntime } from "../../../stylable-esm-runtime.js"
5
5
 
6
6
 
7
7
 
8
- var _namespace_ = "addressinput249613619";
8
+ var _namespace_ = "addressinput517975534";
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":"addressinput249613619__root","tableAddressInput":"addressinput249613619__tableAddressInput"};
16
+ export var classes = {"root":"addressinput517975534__root","tableAddressInput":"addressinput517975534__tableAddressInput"};
17
17
  export var keyframes = {};
18
18
  export var layers = {};
19
19
  export var containers = {};
@@ -5,7 +5,7 @@ import { classesRuntime, statesRuntime } from "../../../../stylable-esm-runtime.
5
5
 
6
6
 
7
7
 
8
- var _namespace_ = "actionsmenu101643419";
8
+ var _namespace_ = "actionsmenu425944360";
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":"actionsmenu101643419__root","action":"actionsmenu101643419__action"};
16
+ export var classes = {"root":"actionsmenu425944360__root","action":"actionsmenu425944360__action"};
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_ = "formaudiofield606935778";
8
+ var _namespace_ = "formaudiofield4018066963";
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":"formaudiofield606935778__root","addItem":"formaudiofield606935778__addItem","mediaTitle":"formaudiofield606935778__mediaTitle"};
16
+ export var classes = {"root":"formaudiofield4018066963__root","addItem":"formaudiofield4018066963__addItem","mediaTitle":"formaudiofield4018066963__mediaTitle"};
17
17
  export var keyframes = {};
18
18
  export var layers = {};
19
19
  export var containers = {};
@@ -7,6 +7,7 @@ import { useController } from '@wix/bex-core/form';
7
7
  import { BaseInputProps } from '../../../types/base-input';
8
8
  import { isEmpty } from '../../../validations/string';
9
9
  import { FormAudioField } from './form-audio-field';
10
+ import { useFieldRef } from '../../../hooks';
10
11
 
11
12
  export interface FormAudioProps extends BaseInputProps<string> {}
12
13
 
@@ -30,6 +31,8 @@ const _FormAudio = (props: FormAudioProps) => {
30
31
  },
31
32
  });
32
33
 
34
+ const setFieldRef = useFieldRef(controller.field.ref);
35
+
33
36
  return (
34
37
  <FormField
35
38
  label={field.displayName}
@@ -42,7 +45,7 @@ const _FormAudio = (props: FormAudioProps) => {
42
45
  // Hand the add button to react-hook-form so
43
46
  // shouldFocusError scrolls to + focuses this field when it
44
47
  // blocks save.
45
- inputRef={controller.field.ref}
48
+ inputRef={setFieldRef}
46
49
  data={controller.field.value}
47
50
  onChange={(value) => controller.field.onChange(value)}
48
51
  onClear={() => controller.field.onChange(null)}
@@ -5,7 +5,7 @@ import { classesRuntime, statesRuntime } from "../../../stylable-esm-runtime.js"
5
5
 
6
6
 
7
7
 
8
- var _namespace_ = "audioplayer2613344239";
8
+ var _namespace_ = "audioplayer1561698613";
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":"audioplayer2613344239__root"};
16
+ export var classes = {"root":"audioplayer1561698613__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_ = "cellcolorview1178629535";
8
+ var _namespace_ = "cellcolorview1736640766";
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":"cellcolorview1178629535__root","hashPrefix":"cellcolorview1178629535__hashPrefix"};
16
+ export var classes = {"root":"cellcolorview1736640766__root","hashPrefix":"cellcolorview1736640766__hashPrefix"};
17
17
  export var keyframes = {};
18
18
  export var layers = {};
19
19
  export var containers = {};
@@ -131,14 +131,25 @@ export const ColorInput = forwardRef<InputImperativeActions, ColorInputProps>(
131
131
  zIndex={5001}
132
132
  >
133
133
  <Popover.Element>
134
- {!colorValue && (isFocused || showPicker) ? (
134
+ {/* Both swatches keep the mousedown default from moving focus.
135
+ Without it the press focuses the swatch, and the re-render
136
+ that follows the click detaches it — WDS Popover then reads
137
+ the click as landing outside itself and closes again, so the
138
+ picker only opened on a later click. For the same reason the
139
+ branch must not depend on `showPicker`: the swatch has to
140
+ survive its own click. */}
141
+ {!colorValue && isFocused ? (
135
142
  <FillButton
136
143
  onClick={onPreviewClick}
137
144
  onMouseDown={(e) => e.preventDefault()}
138
145
  tooltipContent={t('auto-patterns.fields.add_color_tooltip')}
139
146
  />
140
147
  ) : (
141
- <FillPreview fill={colorValue} onClick={onPreviewClick} />
148
+ <FillPreview
149
+ fill={colorValue}
150
+ onClick={onPreviewClick}
151
+ onMouseDown={(e) => e.preventDefault()}
152
+ />
142
153
  )}
143
154
  </Popover.Element>
144
155
  <Popover.Content>
@@ -5,7 +5,7 @@ import { classesRuntime, statesRuntime } from "../../stylable-esm-runtime.js";
5
5
 
6
6
 
7
7
 
8
- var _namespace_ = "colorview2624366234";
8
+ var _namespace_ = "colorview3482796446";
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":"colorview2624366234__root","view":"colorview2624366234__view","fillPreview":"colorview2624366234__fillPreview"};
16
+ export var classes = {"root":"colorview3482796446__root","view":"colorview3482796446__view","fillPreview":"colorview3482796446__fillPreview"};
17
17
  export var keyframes = {};
18
18
  export var layers = {};
19
19
  export var containers = {};
@@ -25,8 +25,14 @@ export function FormColorDriver(
25
25
  ...baseUniDriverFactory(base),
26
26
  getLabel: () => getFormFieldLabelText(formField),
27
27
  getValue: () => input.getValue(),
28
- getFillButton: () => FillButtonUniDriver(base, body),
29
- getFillPreview: () => FillPreviewUniDriver(base, body),
28
+ // The WDS drivers scope their queries to `base`, but `exists()` comes from
29
+ // the shared base factory and only reports on `base` itself — which here is
30
+ // the whole field, so it is true either way. Query the swatch directly.
31
+ hasFillButton: () => base.$('[data-hook="fillbutton"]').exists(),
32
+ hasFillPreview: () => base.$('[data-hook="fill-preview-button"]').exists(),
33
+ clickFillButton: () => FillButtonUniDriver(base, body).click(),
34
+ clickFillPreview: () => FillPreviewUniDriver(base, body).click(),
35
+ isPickerOpen: () => body.$('[data-hook="color-picker-hsb"]').exists(),
30
36
  isRequired: () => formField.isRequired(),
31
37
  hasError: () => formField.hasStatus('error'),
32
38
  getErrorMessage: () => formField.getStatusMessage(),
@@ -38,5 +38,8 @@ export function FormDateTimeDriver(
38
38
  timeInput.hasStatus('error'),
39
39
  getTimeErrorMessage: () => timeInput.getStatusMessage(),
40
40
  isRequired: () => formField.isRequired(),
41
+ // WDS Layout mirrors its `gap` prop onto `data-gap`; it is the only
42
+ // element in this field carrying that attribute.
43
+ getInputsGap: () => base.$('[data-gap]').attr('data-gap'),
41
44
  };
42
45
  }
@@ -74,7 +74,7 @@ const _FormDateTime = (props: FormDateTimeProps) => {
74
74
  required={field.validation?.required}
75
75
  dataHook={dataHook}
76
76
  >
77
- <Layout>
77
+ <Layout gap="12px">
78
78
  <Cell span={6}>
79
79
  <DatePicker
80
80
  ref={(internalRef) => {
@@ -5,7 +5,7 @@ import { classesRuntime, statesRuntime } from "../../stylable-esm-runtime.js";
5
5
 
6
6
 
7
7
 
8
- var _namespace_ = "deletedialog1579435053";
8
+ var _namespace_ = "deletedialog1207540592";
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":"deletedialog1579435053__root","layout":"deletedialog1579435053__layout"};
16
+ export var classes = {"root":"deletedialog1207540592__root","layout":"deletedialog1207540592__layout"};
17
17
  export var keyframes = {};
18
18
  export var layers = {};
19
19
  export var containers = {};
@@ -5,7 +5,7 @@ import { classesRuntime, statesRuntime } from "../../stylable-esm-runtime.js";
5
5
 
6
6
 
7
7
 
8
- var _namespace_ = "formdocumentfield3894914095";
8
+ var _namespace_ = "formdocumentfield2347234029";
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":"formdocumentfield3894914095__root","viewWrapper":"formdocumentfield3894914095__viewWrapper","textWidth":"formdocumentfield3894914095__textWidth","documentLoader":"formdocumentfield3894914095__documentLoader","addDocument":"formdocumentfield3894914095__addDocument","addItemWrapper":"formdocumentfield3894914095__addItemWrapper"};
16
+ export var classes = {"root":"formdocumentfield2347234029__root","viewWrapper":"formdocumentfield2347234029__viewWrapper","textWidth":"formdocumentfield2347234029__textWidth","documentLoader":"formdocumentfield2347234029__documentLoader","addDocument":"formdocumentfield2347234029__addDocument","addItemWrapper":"formdocumentfield2347234029__addItemWrapper"};
17
17
  export var keyframes = {};
18
18
  export var layers = {};
19
19
  export var containers = {};
@@ -7,6 +7,7 @@ import { useController } from '@wix/bex-core/form';
7
7
  import { BaseInputProps } from '../../types/base-input';
8
8
  import { isEmpty } from '../../validations/string';
9
9
  import { FormDocumentField } from './form-document-field';
10
+ import { useFieldRef } from '../../hooks';
10
11
 
11
12
  export interface FormDocumentProps extends BaseInputProps<string> {}
12
13
 
@@ -30,6 +31,8 @@ const _FormDocument = (props: FormDocumentProps) => {
30
31
  },
31
32
  });
32
33
 
34
+ const setFieldRef = useFieldRef(controller.field.ref);
35
+
33
36
  return (
34
37
  <FormField
35
38
  label={field.displayName}
@@ -42,7 +45,7 @@ const _FormDocument = (props: FormDocumentProps) => {
42
45
  // Hand the add button to react-hook-form so
43
46
  // shouldFocusError scrolls to + focuses this field when it
44
47
  // blocks save.
45
- inputRef={controller.field.ref}
48
+ inputRef={setFieldRef}
46
49
  data={controller.field.value}
47
50
  onChange={(value) => controller.field.onChange(value)}
48
51
  onClear={() => controller.field.onChange(null)}
@@ -5,7 +5,7 @@ import { classesRuntime, statesRuntime } from "../../stylable-esm-runtime.js";
5
5
 
6
6
 
7
7
 
8
- var _namespace_ = "exclamation2180886733";
8
+ var _namespace_ = "exclamation1187432506";
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":"exclamation2180886733__root","exclamation":"exclamation2180886733__exclamation","actions":"exclamation2180886733__actions","action":"exclamation2180886733__action"};
16
+ export var classes = {"root":"exclamation1187432506__root","exclamation":"exclamation1187432506__exclamation","actions":"exclamation1187432506__actions","action":"exclamation1187432506__action"};
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_ = "highlightedtext3218260618";
8
+ var _namespace_ = "highlightedtext3214489151";
9
9
  var _style_ = classesRuntime.bind(null, _namespace_);
10
10
 
11
11
  export var cssStates = statesRuntime.bind(null, _namespace_);
@@ -13,8 +13,8 @@ export var style: import("@stylable/runtime").STFunction = _style_;
13
13
  export var st: import("@stylable/runtime").STFunction = _style_;
14
14
 
15
15
  export var namespace = _namespace_;
16
- export var classes = {"root":"highlightedtext3218260618__root","substring":"highlightedtext3218260618__substring"};
17
- export var keyframes = {"highlighted":"highlightedtext3218260618__highlighted","highlighted-match":"highlightedtext3218260618__highlighted-match"};
16
+ export var classes = {"root":"highlightedtext3214489151__root","substring":"highlightedtext3214489151__substring"};
17
+ export var keyframes = {"highlighted":"highlightedtext3214489151__highlighted","highlighted-match":"highlightedtext3214489151__highlighted-match"};
18
18
  export var layers = {};
19
19
  export var containers = {};
20
20
  export var stVars = {};
@@ -8,6 +8,7 @@ import { BaseInputProps } from '../../types/base-input';
8
8
  import { isEmpty } from '../../validations/string';
9
9
  import { getImageUrl } from '../../utils/get-image-url';
10
10
  import { MEDIA_HEIGHT, MEDIA_MAX_WIDTH } from '../../utils/media-constants';
11
+ import { useFieldRef } from '../../hooks';
11
12
 
12
13
  export interface FormImageInputProps extends BaseInputProps<string> {}
13
14
 
@@ -50,6 +51,8 @@ const _FormImageInput = (props: FormImageInputProps) => {
50
51
  },
51
52
  });
52
53
 
54
+ const setFieldRef = useFieldRef(controller.field.ref);
55
+
53
56
  const imageUrl =
54
57
  controller.field.value && getImageUrl(controller.field.value);
55
58
 
@@ -66,7 +69,7 @@ const _FormImageInput = (props: FormImageInputProps) => {
66
69
  // ImageViewer keeps its focus node on whichever button is live, so
67
70
  // one ref serves both the empty and filled states. Lets
68
71
  // react-hook-form's shouldFocusError reach this field.
69
- ref={controller.field.ref}
72
+ ref={setFieldRef}
70
73
  imageUrl={imageUrl}
71
74
  dataHook={`image-${field.id}`}
72
75
  onAddImage={isMobile ? undefined : () => openMedia()}
@@ -5,7 +5,7 @@ import { classesRuntime, statesRuntime } from "../../stylable-esm-runtime.js";
5
5
 
6
6
 
7
7
 
8
- var _namespace_ = "thumbnailreplaceoverlay1250295104";
8
+ var _namespace_ = "thumbnailreplaceoverlay1382391847";
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":"thumbnailreplaceoverlay1250295104__root","icon":"thumbnailreplaceoverlay1250295104__icon"};
16
+ export var classes = {"root":"thumbnailreplaceoverlay1382391847__root","icon":"thumbnailreplaceoverlay1382391847__icon"};
17
17
  export var keyframes = {};
18
18
  export var layers = {};
19
19
  export var containers = {};
@@ -5,7 +5,7 @@ import { classesRuntime, statesRuntime } from "../../stylable-esm-runtime.js";
5
5
 
6
6
 
7
7
 
8
- var _namespace_ = "cellmediaeditshell222630220";
8
+ var _namespace_ = "cellmediaeditshell84193258";
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":"cellmediaeditshell222630220__root"};
16
+ export var classes = {"root":"cellmediaeditshell84193258__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_ = "pasteurlbutton285657028";
8
+ var _namespace_ = "pasteurlbutton2608013352";
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":"pasteurlbutton285657028__root","iconButtonTooltip":"pasteurlbutton285657028__iconButtonTooltip","iconButton":"pasteurlbutton285657028__iconButton"};
16
+ export var classes = {"root":"pasteurlbutton2608013352__root","iconButtonTooltip":"pasteurlbutton2608013352__iconButtonTooltip","iconButton":"pasteurlbutton2608013352__iconButton"};
17
17
  export var keyframes = {};
18
18
  export var layers = {};
19
19
  export var containers = {};
@@ -5,7 +5,7 @@ import { classesRuntime, statesRuntime } from "../../stylable-esm-runtime.js";
5
5
 
6
6
 
7
7
 
8
- var _namespace_ = "formmediagalleryfield2943984590";
8
+ var _namespace_ = "formmediagalleryfield4011032354";
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":"formmediagalleryfield2943984590__root","container":"formmediagalleryfield2943984590__container","viewBox":"formmediagalleryfield2943984590__viewBox","addItemWrapper":"formmediagalleryfield2943984590__addItemWrapper","addItem":"formmediagalleryfield2943984590__addItem","overlay":"formmediagalleryfield2943984590__overlay","image":"formmediagalleryfield2943984590__image","previewImage":"formmediagalleryfield2943984590__previewImage","previewVideo":"formmediagalleryfield2943984590__previewVideo"};
16
+ export var classes = {"root":"formmediagalleryfield4011032354__root","container":"formmediagalleryfield4011032354__container","viewBox":"formmediagalleryfield4011032354__viewBox","addItemWrapper":"formmediagalleryfield4011032354__addItemWrapper","addItem":"formmediagalleryfield4011032354__addItem","overlay":"formmediagalleryfield4011032354__overlay","image":"formmediagalleryfield4011032354__image","previewImage":"formmediagalleryfield4011032354__previewImage","previewVideo":"formmediagalleryfield4011032354__previewVideo"};
17
17
  export var keyframes = {};
18
18
  export var layers = {};
19
19
  export var containers = {};
@@ -7,6 +7,7 @@ import { BaseInputProps } from '../../types/base-input';
7
7
  import type { WixCodeGalleryItem } from '../../auto-field-types';
8
8
  import { isEmpty } from '../../validations/array';
9
9
  import { FormMediaGalleryField } from './form-media-gallery-field';
10
+ import { useFieldRef } from '../../hooks';
10
11
 
11
12
  export interface FormMediaGalleryProps
12
13
  extends BaseInputProps<WixCodeGalleryItem[]> {
@@ -31,6 +32,8 @@ const _FormMediaGallery = (props: FormMediaGalleryProps) => {
31
32
  },
32
33
  });
33
34
 
35
+ const setFieldRef = useFieldRef(controller.field.ref);
36
+
34
37
  return (
35
38
  <FormField
36
39
  label={field.displayName}
@@ -43,7 +46,7 @@ const _FormMediaGallery = (props: FormMediaGalleryProps) => {
43
46
  // Hand the add button to react-hook-form so
44
47
  // shouldFocusError scrolls to + focuses this field when it
45
48
  // blocks save.
46
- inputRef={controller.field.ref}
49
+ inputRef={setFieldRef}
47
50
  data={controller.field.value}
48
51
  onChange={(value) => controller.field.onChange(value)}
49
52
  onClear={() => controller.field.onChange([])}