@wix/patterns-fields 1.18.0 → 1.20.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 (194) hide show
  1. package/dist/cjs/assets/locale/messages_en.json +1 -1
  2. package/dist/cjs/components/address/input/address-input.st.css.js +3 -3
  3. package/dist/cjs/components/address/input/address-input.st.css.js.map +1 -1
  4. package/dist/cjs/components/audio/actions/actions-menu/actions-menu.st.css.js +3 -3
  5. package/dist/cjs/components/audio/actions/actions-menu/actions-menu.st.css.js.map +1 -1
  6. package/dist/cjs/components/audio/audio-field/form-audio-field.st.css.js +4 -4
  7. package/dist/cjs/components/audio/audio-field/form-audio-field.st.css.js.map +1 -1
  8. package/dist/cjs/components/audio/audio-player/audio-player.st.css.js +2 -2
  9. package/dist/cjs/components/audio/audio-player/audio-player.st.css.js.map +1 -1
  10. package/dist/cjs/components/color-view/color-view.st.css.js +4 -4
  11. package/dist/cjs/components/color-view/color-view.st.css.js.map +1 -1
  12. package/dist/cjs/components/delete-dialog/delete-dialog.st.css.js +3 -3
  13. package/dist/cjs/components/delete-dialog/delete-dialog.st.css.js.map +1 -1
  14. package/dist/cjs/components/document/form-document-field.st.css.js +7 -7
  15. package/dist/cjs/components/document/form-document-field.st.css.js.map +1 -1
  16. package/dist/cjs/components/exclamation/exclamation.st.css.js +5 -5
  17. package/dist/cjs/components/exclamation/exclamation.st.css.js.map +1 -1
  18. package/dist/cjs/components/highlighted-text/highlighted-text.st.css.js +5 -5
  19. package/dist/cjs/components/highlighted-text/highlighted-text.st.css.js.map +1 -1
  20. package/dist/cjs/components/image/cell-image-edit.js +35 -112
  21. package/dist/cjs/components/image/cell-image-edit.js.map +1 -1
  22. package/dist/cjs/components/image/thumbnail-replace-overlay.st.css.js +3 -3
  23. package/dist/cjs/components/image/thumbnail-replace-overlay.st.css.js.map +1 -1
  24. package/dist/cjs/components/media-control/paste-url-button.st.css.js +4 -4
  25. package/dist/cjs/components/media-control/paste-url-button.st.css.js.map +1 -1
  26. package/dist/cjs/components/media-gallery/cell-media-gallery-edit.js +301 -0
  27. package/dist/cjs/components/media-gallery/cell-media-gallery-edit.js.map +1 -0
  28. package/dist/cjs/components/media-gallery/cell-media-gallery-view.js +45 -0
  29. package/dist/cjs/components/media-gallery/cell-media-gallery-view.js.map +1 -0
  30. package/dist/cjs/components/media-gallery/form-media-gallery-field.st.css.js +10 -10
  31. package/dist/cjs/components/media-gallery/form-media-gallery-field.st.css.js.map +1 -1
  32. package/dist/cjs/components/media-gallery/index.js +12 -0
  33. package/dist/cjs/components/media-gallery/index.js.map +1 -1
  34. package/dist/cjs/components/media-image/media-image.st.css.js +4 -4
  35. package/dist/cjs/components/media-image/media-image.st.css.js.map +1 -1
  36. package/dist/cjs/components/media-image/overlays/overlay.st.css.js +4 -4
  37. package/dist/cjs/components/media-image/overlays/overlay.st.css.js.map +1 -1
  38. package/dist/cjs/components/media-loader/media-loader.st.css.js +3 -3
  39. package/dist/cjs/components/media-loader/media-loader.st.css.js.map +1 -1
  40. package/dist/cjs/components/media-tag/web-media-tag/media-tag.st.css.js +2 -2
  41. package/dist/cjs/components/media-tag/web-media-tag/media-tag.st.css.js.map +1 -1
  42. package/dist/cjs/components/multi-document/multi-document-input/form-multi-document.st.css.js +5 -5
  43. package/dist/cjs/components/multi-document/multi-document-input/form-multi-document.st.css.js.map +1 -1
  44. package/dist/cjs/components/rich-content/rich-content-input/default-value-input/rich-content-default-value-input.st.css.js +6 -6
  45. package/dist/cjs/components/rich-content/rich-content-input/default-value-input/rich-content-default-value-input.st.css.js.map +1 -1
  46. package/dist/cjs/components/rich-content/rich-content-input/form-input/rich-content-form-input.st.css.js +5 -5
  47. package/dist/cjs/components/rich-content/rich-content-input/form-input/rich-content-form-input.st.css.js.map +1 -1
  48. package/dist/cjs/components/rich-content/rich-content-input/form-read-only-input/rich-content-form-read-only-input.st.css.js +2 -2
  49. 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
  50. package/dist/cjs/components/rich-content/rich-content-input/rich-content-common/fullscreen-modal/fullscreen-modal.st.css.js +3 -3
  51. package/dist/cjs/components/rich-content/rich-content-input/rich-content-common/fullscreen-modal/fullscreen-modal.st.css.js.map +1 -1
  52. package/dist/cjs/components/rich-content/rich-content-input/rich-content-common/publish-loader/publish-loader.st.css.js +3 -3
  53. package/dist/cjs/components/rich-content/rich-content-input/rich-content-common/publish-loader/publish-loader.st.css.js.map +1 -1
  54. package/dist/cjs/components/rich-content/rich-content-input/rich-content-common/toggle-fullscreen-button/toggle-fullscreen-button.st.css.js +2 -2
  55. package/dist/cjs/components/rich-content/rich-content-input/rich-content-common/toggle-fullscreen-button/toggle-fullscreen-button.st.css.js.map +1 -1
  56. package/dist/cjs/components/rich-content/rich-content-input/rich-content-editor/rich-content-editor.st.css.js +8 -8
  57. package/dist/cjs/components/rich-content/rich-content-input/rich-content-editor/rich-content-editor.st.css.js.map +1 -1
  58. package/dist/cjs/components/rich-content/rich-content-input/rich-content-editor/rich-content-toolbar.st.css.js +4 -4
  59. package/dist/cjs/components/rich-content/rich-content-input/rich-content-editor/rich-content-toolbar.st.css.js.map +1 -1
  60. package/dist/cjs/components/rich-content/rich-content-input/rich-content-viewer/rich-content-viewer.st.css.js +4 -4
  61. package/dist/cjs/components/rich-content/rich-content-input/rich-content-viewer/rich-content-viewer.st.css.js.map +1 -1
  62. package/dist/cjs/components/rich-text/rich-text-input/rich-text-editor/rich-editor.st.css.js +20 -20
  63. package/dist/cjs/components/rich-text/rich-text-input/rich-text-editor/rich-editor.st.css.js.map +1 -1
  64. package/dist/cjs/components/rich-text/rich-text-input/rich-text-editor/rich-text-editor.st.css.js +4 -4
  65. package/dist/cjs/components/rich-text/rich-text-input/rich-text-editor/rich-text-editor.st.css.js.map +1 -1
  66. package/dist/cjs/components/rich-text/rich-text-input/rich-text-editor/toolbar/toolbar.st.css.js +20 -20
  67. package/dist/cjs/components/rich-text/rich-text-input/rich-text-editor/toolbar/toolbar.st.css.js.map +1 -1
  68. package/dist/cjs/components/text/text-view.st.css.js +3 -3
  69. package/dist/cjs/components/text/text-view.st.css.js.map +1 -1
  70. package/dist/cjs/hooks/index.js +6 -0
  71. package/dist/cjs/hooks/index.js.map +1 -1
  72. package/dist/cjs/hooks/use-cell-edit-keyboard.js +94 -0
  73. package/dist/cjs/hooks/use-cell-edit-keyboard.js.map +1 -0
  74. package/dist/cjs/styles.global.css +1 -1
  75. package/dist/esm/assets/locale/messages_en.json +1 -1
  76. package/dist/esm/components/address/input/address-input.st.css.js +2 -2
  77. package/dist/esm/components/address/input/address-input.st.css.js.map +1 -1
  78. package/dist/esm/components/audio/actions/actions-menu/actions-menu.st.css.js +2 -2
  79. package/dist/esm/components/audio/actions/actions-menu/actions-menu.st.css.js.map +1 -1
  80. package/dist/esm/components/audio/audio-field/form-audio-field.st.css.js +2 -2
  81. package/dist/esm/components/audio/audio-player/audio-player.st.css.js +2 -2
  82. package/dist/esm/components/color-view/color-view.st.css.js +2 -2
  83. package/dist/esm/components/color-view/color-view.st.css.js.map +1 -1
  84. package/dist/esm/components/delete-dialog/delete-dialog.st.css.js +2 -2
  85. package/dist/esm/components/document/form-document-field.st.css.js +2 -2
  86. package/dist/esm/components/exclamation/exclamation.st.css.js +2 -2
  87. package/dist/esm/components/highlighted-text/highlighted-text.st.css.js +3 -3
  88. package/dist/esm/components/image/cell-image-edit.js +7 -81
  89. package/dist/esm/components/image/cell-image-edit.js.map +1 -1
  90. package/dist/esm/components/image/thumbnail-replace-overlay.st.css.js +2 -2
  91. package/dist/esm/components/image/thumbnail-replace-overlay.st.css.js.map +1 -1
  92. package/dist/esm/components/media-control/paste-url-button.st.css.js +2 -2
  93. package/dist/esm/components/media-gallery/cell-media-gallery-edit.js +103 -0
  94. package/dist/esm/components/media-gallery/cell-media-gallery-edit.js.map +1 -0
  95. package/dist/esm/components/media-gallery/cell-media-gallery-view.js +11 -0
  96. package/dist/esm/components/media-gallery/cell-media-gallery-view.js.map +1 -0
  97. package/dist/esm/components/media-gallery/form-media-gallery-field.st.css.js +2 -2
  98. package/dist/esm/components/media-gallery/form-media-gallery-field.st.css.js.map +1 -1
  99. package/dist/esm/components/media-gallery/index.js +2 -0
  100. package/dist/esm/components/media-gallery/index.js.map +1 -1
  101. package/dist/esm/components/media-image/media-image.st.css.js +3 -3
  102. package/dist/esm/components/media-image/media-image.st.css.js.map +1 -1
  103. package/dist/esm/components/media-image/overlays/overlay.st.css.js +3 -3
  104. package/dist/esm/components/media-loader/media-loader.st.css.js +2 -2
  105. package/dist/esm/components/media-tag/web-media-tag/media-tag.st.css.js +2 -2
  106. package/dist/esm/components/media-tag/web-media-tag/media-tag.st.css.js.map +1 -1
  107. package/dist/esm/components/multi-document/multi-document-input/form-multi-document.st.css.js +2 -2
  108. package/dist/esm/components/multi-document/multi-document-input/form-multi-document.st.css.js.map +1 -1
  109. package/dist/esm/components/rich-content/rich-content-input/default-value-input/rich-content-default-value-input.st.css.js +3 -3
  110. package/dist/esm/components/rich-content/rich-content-input/form-input/rich-content-form-input.st.css.js +3 -3
  111. package/dist/esm/components/rich-content/rich-content-input/form-read-only-input/rich-content-form-read-only-input.st.css.js +2 -2
  112. package/dist/esm/components/rich-content/rich-content-input/rich-content-common/fullscreen-modal/fullscreen-modal.st.css.js +2 -2
  113. package/dist/esm/components/rich-content/rich-content-input/rich-content-common/publish-loader/publish-loader.st.css.js +2 -2
  114. package/dist/esm/components/rich-content/rich-content-input/rich-content-common/toggle-fullscreen-button/toggle-fullscreen-button.st.css.js +2 -2
  115. package/dist/esm/components/rich-content/rich-content-input/rich-content-editor/rich-content-editor.st.css.js +3 -3
  116. package/dist/esm/components/rich-content/rich-content-input/rich-content-editor/rich-content-editor.st.css.js.map +1 -1
  117. package/dist/esm/components/rich-content/rich-content-input/rich-content-editor/rich-content-toolbar.st.css.js +2 -2
  118. package/dist/esm/components/rich-content/rich-content-input/rich-content-editor/rich-content-toolbar.st.css.js.map +1 -1
  119. package/dist/esm/components/rich-content/rich-content-input/rich-content-viewer/rich-content-viewer.st.css.js +2 -2
  120. package/dist/esm/components/rich-content/rich-content-input/rich-content-viewer/rich-content-viewer.st.css.js.map +1 -1
  121. package/dist/esm/components/rich-text/rich-text-input/rich-text-editor/rich-editor.st.css.js +3 -3
  122. package/dist/esm/components/rich-text/rich-text-input/rich-text-editor/rich-text-editor.st.css.js +2 -2
  123. package/dist/esm/components/rich-text/rich-text-input/rich-text-editor/rich-text-editor.st.css.js.map +1 -1
  124. package/dist/esm/components/rich-text/rich-text-input/rich-text-editor/toolbar/toolbar.st.css.js +3 -3
  125. package/dist/esm/components/rich-text/rich-text-input/rich-text-editor/toolbar/toolbar.st.css.js.map +1 -1
  126. package/dist/esm/components/text/text-view.st.css.js +2 -2
  127. package/dist/esm/hooks/index.js +1 -0
  128. package/dist/esm/hooks/index.js.map +1 -1
  129. package/dist/esm/hooks/use-cell-edit-keyboard.js +81 -0
  130. package/dist/esm/hooks/use-cell-edit-keyboard.js.map +1 -0
  131. package/dist/esm/styles.global.css +1 -1
  132. package/dist/types/components/address/input/address-input.st.css.d.ts.map +1 -1
  133. package/dist/types/components/audio/actions/actions-menu/actions-menu.st.css.d.ts.map +1 -1
  134. package/dist/types/components/color-view/color-view.st.css.d.ts.map +1 -1
  135. package/dist/types/components/image/cell-image-edit.d.ts.map +1 -1
  136. package/dist/types/components/image/thumbnail-replace-overlay.st.css.d.ts.map +1 -1
  137. package/dist/types/components/media-gallery/cell-media-gallery-edit.d.ts +15 -0
  138. package/dist/types/components/media-gallery/cell-media-gallery-edit.d.ts.map +1 -0
  139. package/dist/types/components/media-gallery/cell-media-gallery-view.d.ts +11 -0
  140. package/dist/types/components/media-gallery/cell-media-gallery-view.d.ts.map +1 -0
  141. package/dist/types/components/media-gallery/form-media-gallery-field.st.css.d.ts.map +1 -1
  142. package/dist/types/components/media-gallery/index.d.ts +2 -0
  143. package/dist/types/components/media-gallery/index.d.ts.map +1 -1
  144. package/dist/types/components/media-image/media-image.st.css.d.ts.map +1 -1
  145. package/dist/types/components/media-tag/web-media-tag/media-tag.st.css.d.ts.map +1 -1
  146. package/dist/types/components/multi-document/multi-document-input/form-multi-document.st.css.d.ts.map +1 -1
  147. package/dist/types/components/rich-content/rich-content-input/rich-content-editor/rich-content-editor.st.css.d.ts.map +1 -1
  148. package/dist/types/components/rich-content/rich-content-input/rich-content-editor/rich-content-toolbar.st.css.d.ts.map +1 -1
  149. package/dist/types/components/rich-content/rich-content-input/rich-content-viewer/rich-content-viewer.st.css.d.ts.map +1 -1
  150. package/dist/types/components/rich-text/rich-text-input/rich-text-editor/rich-text-editor.st.css.d.ts.map +1 -1
  151. package/dist/types/components/rich-text/rich-text-input/rich-text-editor/toolbar/toolbar.st.css.d.ts.map +1 -1
  152. package/dist/types/hooks/index.d.ts +1 -0
  153. package/dist/types/hooks/index.d.ts.map +1 -1
  154. package/dist/types/hooks/use-cell-edit-keyboard.d.ts +26 -0
  155. package/dist/types/hooks/use-cell-edit-keyboard.d.ts.map +1 -0
  156. package/package.json +4 -4
  157. package/src/assets/locale/messages_en.json +1 -1
  158. package/src/components/address/input/address-input.st.css.ts +2 -2
  159. package/src/components/audio/actions/actions-menu/actions-menu.st.css.ts +2 -2
  160. package/src/components/audio/audio-field/form-audio-field.st.css.ts +2 -2
  161. package/src/components/audio/audio-player/audio-player.st.css.ts +2 -2
  162. package/src/components/color-view/color-view.st.css.ts +2 -2
  163. package/src/components/delete-dialog/delete-dialog.st.css.ts +2 -2
  164. package/src/components/document/form-document-field.st.css.ts +2 -2
  165. package/src/components/exclamation/exclamation.st.css.ts +2 -2
  166. package/src/components/highlighted-text/highlighted-text.st.css.ts +3 -3
  167. package/src/components/image/cell-image-edit.tsx +7 -89
  168. package/src/components/image/thumbnail-replace-overlay.st.css.ts +2 -2
  169. package/src/components/media-control/paste-url-button.st.css.ts +2 -2
  170. package/src/components/media-gallery/cell-media-gallery-edit.tsx +219 -0
  171. package/src/components/media-gallery/cell-media-gallery-view.tsx +32 -0
  172. package/src/components/media-gallery/form-media-gallery-field.st.css.ts +2 -2
  173. package/src/components/media-gallery/index.ts +2 -0
  174. package/src/components/media-image/media-image.st.css.ts +3 -3
  175. package/src/components/media-image/overlays/overlay.st.css.ts +3 -3
  176. package/src/components/media-loader/media-loader.st.css.ts +2 -2
  177. package/src/components/media-tag/web-media-tag/media-tag.st.css.ts +2 -2
  178. package/src/components/multi-document/multi-document-input/form-multi-document.st.css.ts +2 -2
  179. package/src/components/rich-content/rich-content-input/default-value-input/rich-content-default-value-input.st.css.ts +3 -3
  180. package/src/components/rich-content/rich-content-input/form-input/rich-content-form-input.st.css.ts +3 -3
  181. package/src/components/rich-content/rich-content-input/form-read-only-input/rich-content-form-read-only-input.st.css.ts +2 -2
  182. package/src/components/rich-content/rich-content-input/rich-content-common/fullscreen-modal/fullscreen-modal.st.css.ts +2 -2
  183. package/src/components/rich-content/rich-content-input/rich-content-common/publish-loader/publish-loader.st.css.ts +2 -2
  184. package/src/components/rich-content/rich-content-input/rich-content-common/toggle-fullscreen-button/toggle-fullscreen-button.st.css.ts +2 -2
  185. package/src/components/rich-content/rich-content-input/rich-content-editor/rich-content-editor.st.css.ts +3 -3
  186. package/src/components/rich-content/rich-content-input/rich-content-editor/rich-content-toolbar.st.css.ts +2 -2
  187. package/src/components/rich-content/rich-content-input/rich-content-viewer/rich-content-viewer.st.css.ts +2 -2
  188. package/src/components/rich-text/rich-text-input/rich-text-editor/rich-editor.st.css.ts +3 -3
  189. package/src/components/rich-text/rich-text-input/rich-text-editor/rich-text-editor.st.css.ts +2 -2
  190. package/src/components/rich-text/rich-text-input/rich-text-editor/toolbar/toolbar.st.css.ts +3 -3
  191. package/src/components/text/text-view.st.css.ts +2 -2
  192. package/src/hooks/index.ts +1 -0
  193. package/src/hooks/use-cell-edit-keyboard.ts +109 -0
  194. package/src/styles.global.css +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","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"}
1
+ {"version":3,"file":"index.d.ts","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"}
@@ -0,0 +1,26 @@
1
+ import React from 'react';
2
+ interface UseCellEditKeyboardOptions {
3
+ containerRef: React.RefObject<HTMLDivElement | null>;
4
+ onCancel?: () => void;
5
+ inputRef?: React.MutableRefObject<{
6
+ focus: () => void;
7
+ } | null | undefined>;
8
+ }
9
+ interface UseCellEditKeyboardResult {
10
+ handleContainerFocus: () => void;
11
+ handleContainerBlur: (e: React.FocusEvent) => void;
12
+ }
13
+ /**
14
+ * Shared keyboard/focus wiring for cell-edit components that contain buttons.
15
+ *
16
+ * - Wires inputRef so the parent table can focus the first button on Enter.
17
+ * - Sets/removes data-inner-focused on the container for CSS styling.
18
+ * - Native keydown handler: Escape → onCancel + return focus to gridcell;
19
+ * Tab / Shift+Tab → cycle through buttons, Tab off last returns to gridcell.
20
+ *
21
+ * Must use a native listener (not React onKeyDown) so stopPropagation fires
22
+ * before the React root's useKeyboardNavigation intercepts Tab.
23
+ */
24
+ export declare function useCellEditKeyboard({ containerRef, onCancel, inputRef, }: UseCellEditKeyboardOptions): UseCellEditKeyboardResult;
25
+ export {};
26
+ //# sourceMappingURL=use-cell-edit-keyboard.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-cell-edit-keyboard.d.ts","sourceRoot":"","sources":["../../../src/hooks/use-cell-edit-keyboard.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,UAAU,0BAA0B;IAClC,YAAY,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC;IACrD,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,QAAQ,CAAC,EAAE,KAAK,CAAC,gBAAgB,CAAC;QAAE,KAAK,EAAE,MAAM,IAAI,CAAA;KAAE,GAAG,IAAI,GAAG,SAAS,CAAC,CAAC;CAC7E;AAED,UAAU,yBAAyB;IACjC,oBAAoB,EAAE,MAAM,IAAI,CAAC;IACjC,mBAAmB,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,KAAK,IAAI,CAAC;CACpD;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,YAAY,EACZ,QAAQ,EACR,QAAQ,GACT,EAAE,0BAA0B,GAAG,yBAAyB,CA+ExD"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/patterns-fields",
3
- "version": "1.18.0",
3
+ "version": "1.20.0",
4
4
  "license": "UNLICENSED",
5
5
  "author": {
6
6
  "name": "Kobi",
@@ -112,7 +112,7 @@
112
112
  "@wix/atlas": "^1.0.35",
113
113
  "@wix/data": "^1.0.323",
114
114
  "@wix/media": "^1.0.231",
115
- "@wix/patterns-fields-utils": "1.12.0",
115
+ "@wix/patterns-fields-utils": "1.13.0",
116
116
  "@wix/rich-content": "1.0.37",
117
117
  "@wix/ricos": "^10.155.2",
118
118
  "@wix/wix-ui-icons-common": "^3.100.0",
@@ -138,7 +138,7 @@
138
138
  "@types/jest": "^27.5.2",
139
139
  "@types/lodash": "^4.17.20",
140
140
  "@types/react": "^16.14.68",
141
- "@wix/bex-core": "2.300.0",
141
+ "@wix/bex-core": "2.302.0",
142
142
  "@wix/design-system": "^1.271.0",
143
143
  "@wix/eslint-config-yoshi": "^6.74.0",
144
144
  "@wix/jest-yoshi-preset": "^6.74.0",
@@ -192,5 +192,5 @@
192
192
  "type": "yoshi-flow-library"
193
193
  }
194
194
  },
195
- "falconPackageHash": "f83b455d816fb72cce38a63a0442d2314222fb470d8497f8cc758688"
195
+ "falconPackageHash": "f7ea6631d8b07b4c682b9d231b9ab9876fb6b0b356370369c3d24800"
196
196
  }
@@ -95,7 +95,7 @@
95
95
  "CMS.mediaGallery.emptyHint": "Select images and videos to add",
96
96
  "CMS.mediaGallery.manageGallery": "Manage media",
97
97
  "CMS.mediaGallery.preview": "Preview",
98
- "CMS.mediaGallery.clear": "Clear",
98
+ "CMS.mediaGallery.clear": "Delete gallery",
99
99
  "CMS.mediaGallery.addMedia": "Add media",
100
100
  "CMS.mediaGallery.replaceItem": "Replace Media",
101
101
 
@@ -5,7 +5,7 @@ import { classesRuntime, statesRuntime } from "../../../stylable-esm-runtime.js"
5
5
 
6
6
 
7
7
 
8
- var _namespace_ = "addressinput1079778";
8
+ var _namespace_ = "addressinput436106120";
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":"addressinput1079778__root","tableAddressInput":"addressinput1079778__tableAddressInput"};
16
+ export var classes = {"root":"addressinput436106120__root","tableAddressInput":"addressinput436106120__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_ = "actionsmenu603157293";
8
+ var _namespace_ = "actionsmenu3423259781";
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":"actionsmenu603157293__root","action":"actionsmenu603157293__action"};
16
+ export var classes = {"root":"actionsmenu3423259781__root","action":"actionsmenu3423259781__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_ = "formaudiofield1019037637";
8
+ var _namespace_ = "formaudiofield3739761485";
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":"formaudiofield1019037637__root","addItem":"formaudiofield1019037637__addItem","mediaTitle":"formaudiofield1019037637__mediaTitle"};
16
+ export var classes = {"root":"formaudiofield3739761485__root","addItem":"formaudiofield3739761485__addItem","mediaTitle":"formaudiofield3739761485__mediaTitle"};
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_ = "audioplayer3953334470";
8
+ var _namespace_ = "audioplayer2631043297";
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":"audioplayer3953334470__root"};
16
+ export var classes = {"root":"audioplayer2631043297__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_ = "colorview192563780";
8
+ var _namespace_ = "colorview1533225918";
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":"colorview192563780__root","view":"colorview192563780__view","fillPreview":"colorview192563780__fillPreview"};
16
+ export var classes = {"root":"colorview1533225918__root","view":"colorview1533225918__view","fillPreview":"colorview1533225918__fillPreview"};
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_ = "deletedialog3941549956";
8
+ var _namespace_ = "deletedialog2766386481";
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":"deletedialog3941549956__root","layout":"deletedialog3941549956__layout"};
16
+ export var classes = {"root":"deletedialog2766386481__root","layout":"deletedialog2766386481__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_ = "formdocumentfield3650067196";
8
+ var _namespace_ = "formdocumentfield1710149784";
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":"formdocumentfield3650067196__root","viewWrapper":"formdocumentfield3650067196__viewWrapper","textWidth":"formdocumentfield3650067196__textWidth","documentLoader":"formdocumentfield3650067196__documentLoader","addDocument":"formdocumentfield3650067196__addDocument","addItemWrapper":"formdocumentfield3650067196__addItemWrapper"};
16
+ export var classes = {"root":"formdocumentfield1710149784__root","viewWrapper":"formdocumentfield1710149784__viewWrapper","textWidth":"formdocumentfield1710149784__textWidth","documentLoader":"formdocumentfield1710149784__documentLoader","addDocument":"formdocumentfield1710149784__addDocument","addItemWrapper":"formdocumentfield1710149784__addItemWrapper"};
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_ = "exclamation4028169285";
8
+ var _namespace_ = "exclamation1025289217";
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":"exclamation4028169285__root","exclamation":"exclamation4028169285__exclamation","actions":"exclamation4028169285__actions","action":"exclamation4028169285__action"};
16
+ export var classes = {"root":"exclamation1025289217__root","exclamation":"exclamation1025289217__exclamation","actions":"exclamation1025289217__actions","action":"exclamation1025289217__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_ = "highlightedtext2257165359";
8
+ var _namespace_ = "highlightedtext1593671152";
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":"highlightedtext2257165359__root","substring":"highlightedtext2257165359__substring"};
17
- export var keyframes = {"highlighted":"highlightedtext2257165359__highlighted","highlighted-match":"highlightedtext2257165359__highlighted-match"};
16
+ export var classes = {"root":"highlightedtext1593671152__root","substring":"highlightedtext1593671152__substring"};
17
+ export var keyframes = {"highlighted":"highlightedtext1593671152__highlighted","highlighted-match":"highlightedtext1593671152__highlighted-match"};
18
18
  export var layers = {};
19
19
  export var containers = {};
20
20
  export var stVars = {};
@@ -1,4 +1,4 @@
1
- import React, { useCallback, useEffect, useRef } from 'react';
1
+ import React, { useCallback, useRef } from 'react';
2
2
  import {
3
3
  Box,
4
4
  IconButton,
@@ -15,7 +15,7 @@ import {
15
15
  Delete,
16
16
  } from '@wix/wix-ui-icons-common';
17
17
  import { MEDIA_TYPES } from '../../utils/media-utils';
18
- import { useTranslations } from '../../hooks';
18
+ import { useTranslations, useCellEditKeyboard } from '../../hooks';
19
19
  import {
20
20
  useMediaControl,
21
21
  usePasteURLForm,
@@ -98,93 +98,11 @@ export const CellImageEdit: React.FC<CellImageEditProps> = ({
98
98
  onCommit();
99
99
  }, [onChange, onCommit]);
100
100
 
101
- // Wire inputRef so the cell-level useEffect can focus the first button when
102
- // the user presses Enter on a focused image cell (inner focus activation).
103
- useEffect(() => {
104
- if (!inputRef) return;
105
- inputRef.current = {
106
- focus: () => {
107
- const first =
108
- containerRef.current?.querySelectorAll<HTMLElement>('button')[0];
109
- first?.focus();
110
- },
111
- };
112
- return () => {
113
- inputRef.current = null;
114
- };
115
- }, [inputRef]);
116
-
117
- const handleContainerFocus = useCallback(() => {
118
- containerRef.current?.setAttribute('data-inner-focused', '');
119
- }, []);
120
-
121
- const handleContainerBlur = useCallback((e: React.FocusEvent) => {
122
- if (!e.currentTarget.contains(e.relatedTarget as Node | null)) {
123
- containerRef.current?.removeAttribute('data-inner-focused');
124
- }
125
- }, []);
126
-
127
- const focusCell = useCallback(() => {
128
- const cellDiv = containerRef.current?.closest(
129
- '[role="gridcell"]',
130
- ) as HTMLElement | null;
131
- cellDiv?.focus({ preventScroll: true });
132
- }, []);
133
-
134
- // Native keydown listener — must be native (not React onKeyDown) so that
135
- // e.stopPropagation() fires during the native bubble phase, before the event
136
- // reaches the React root where useKeyboardNavigation's onKeyDown would
137
- // otherwise intercept Tab and move to the next cell.
138
- useEffect(() => {
139
- const el = containerRef.current;
140
- if (!el) return;
141
-
142
- const handleKeyDown = (e: KeyboardEvent) => {
143
- if (e.key === 'Escape') {
144
- e.preventDefault();
145
- e.stopPropagation();
146
- // Cancel any in-progress edit (e.g. if isEditing was set before opening
147
- // a modal that then got dismissed via keyboard), then return focus to the
148
- // cell div. The useCellFocusAndEditing useEffect will also refocus the
149
- // cell div if isEditing transitions false→false is a no-op, so we also
150
- // call focusCell() directly as a reliable fallback.
151
- onCancel?.();
152
- focusCell();
153
- return;
154
- }
155
-
156
- // Tab while a button in this component is focused: cycle through the
157
- // interactive elements. Tab off the last (or Shift+Tab off the first)
158
- // returns focus to the cell div for normal cell-level navigation.
159
- if (e.key === 'Tab') {
160
- const buttons = Array.from(el.querySelectorAll<HTMLElement>('button'));
161
- const currentIdx = buttons.indexOf(
162
- document.activeElement as HTMLElement,
163
- );
164
- if (currentIdx === -1) return; // focus is not on one of our buttons — pass through
165
-
166
- e.preventDefault();
167
- e.stopPropagation();
168
-
169
- if (!e.shiftKey) {
170
- if (currentIdx >= buttons.length - 1) {
171
- focusCell();
172
- } else {
173
- buttons[currentIdx + 1]?.focus();
174
- }
175
- } else {
176
- if (currentIdx <= 0) {
177
- focusCell();
178
- } else {
179
- buttons[currentIdx - 1]?.focus();
180
- }
181
- }
182
- }
183
- };
184
-
185
- el.addEventListener('keydown', handleKeyDown);
186
- return () => el.removeEventListener('keydown', handleKeyDown);
187
- }, [focusCell, onCancel]);
101
+ const { handleContainerFocus, handleContainerBlur } = useCellEditKeyboard({
102
+ containerRef,
103
+ onCancel,
104
+ inputRef,
105
+ });
188
106
 
189
107
  if (loading) {
190
108
  return (
@@ -5,7 +5,7 @@ import { classesRuntime, statesRuntime } from "../../stylable-esm-runtime.js";
5
5
 
6
6
 
7
7
 
8
- var _namespace_ = "thumbnailreplaceoverlay78307533";
8
+ var _namespace_ = "thumbnailreplaceoverlay3138302508";
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":"thumbnailreplaceoverlay78307533__root","icon":"thumbnailreplaceoverlay78307533__icon"};
16
+ export var classes = {"root":"thumbnailreplaceoverlay3138302508__root","icon":"thumbnailreplaceoverlay3138302508__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_ = "pasteurlbutton2614320603";
8
+ var _namespace_ = "pasteurlbutton1583106728";
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":"pasteurlbutton2614320603__root","iconButtonTooltip":"pasteurlbutton2614320603__iconButtonTooltip","iconButton":"pasteurlbutton2614320603__iconButton"};
16
+ export var classes = {"root":"pasteurlbutton1583106728__root","iconButtonTooltip":"pasteurlbutton1583106728__iconButtonTooltip","iconButton":"pasteurlbutton1583106728__iconButton"};
17
17
  export var keyframes = {};
18
18
  export var layers = {};
19
19
  export var containers = {};
@@ -0,0 +1,219 @@
1
+ import React, { useCallback, useRef, useState } from 'react';
2
+ import {
3
+ AvatarGroup,
4
+ Box,
5
+ IconButton,
6
+ PopoverMenu,
7
+ Tooltip,
8
+ } from '@wix/design-system';
9
+ import {
10
+ Add,
11
+ MoreSmall,
12
+ Refresh,
13
+ Delete,
14
+ Maximize,
15
+ } from '@wix/wix-ui-icons-common';
16
+ import { files } from '@wix/media';
17
+ import { mediaURItoImageURL, ThumbnailSize, getMediaURL } from '../../auto-field-types';
18
+ import type { WixCodeGalleryItem } from '../../auto-field-types';
19
+ import { useTranslations, useCellEditKeyboard } from '../../hooks';
20
+ import { executeDownloading } from '../../utils/media-utils';
21
+ import { useMediaGalleryDialog } from './media-gallery-dialog/hooks';
22
+ import { MediaGalleryDialog } from './media-gallery-dialog/media-gallery-dialog';
23
+ import { MediaPreviewModal } from './media-preview-modal';
24
+
25
+ const mediaGalleryPreviewTextKeys = {
26
+ replace: 'CMS.mediaGallery.preview.replace',
27
+ download: 'CMS.mediaGallery.preview.download',
28
+ delete: 'CMS.mediaGallery.preview.delete',
29
+ } as const;
30
+
31
+ export interface CellMediaGalleryEditProps {
32
+ value: WixCodeGalleryItem[] | null;
33
+ onChange: (value: WixCodeGalleryItem[] | null) => void;
34
+ onCommit: () => void;
35
+ onCancel?: () => void;
36
+ onStartEdit?: () => void;
37
+ inputRef?: React.MutableRefObject<{ focus: () => void } | null | undefined>;
38
+ dataHook?: string;
39
+ }
40
+
41
+ export const CellMediaGalleryEdit: React.FC<CellMediaGalleryEditProps> = ({
42
+ value,
43
+ onChange,
44
+ onCommit,
45
+ onCancel,
46
+ onStartEdit,
47
+ inputRef,
48
+ dataHook,
49
+ }) => {
50
+ const { t } = useTranslations();
51
+ const containerRef = useRef<HTMLDivElement | null>(null);
52
+ const hasValue = Boolean(value?.length);
53
+ const [isPreviewOpen, setIsPreviewOpen] = useState(false);
54
+ // Tracks whether a commit happened during the current external-UI session.
55
+ // Prevents calling onCancel() after the user already committed (e.g., clear
56
+ // in the preview modal fires onClear then onClose, but we should not cancel).
57
+ const didCommitRef = useRef(false);
58
+
59
+ const avatarItems = (value ?? []).map((item) => ({
60
+ imgProps: { src: mediaURItoImageURL(item.src, ThumbnailSize.S) },
61
+ }));
62
+
63
+ const { openMediaGalleryDialog, ...dialogProps } = useMediaGalleryDialog({
64
+ initialOpen: false,
65
+ items: value ?? [],
66
+ onChange: (items: WixCodeGalleryItem[]) => {
67
+ didCommitRef.current = true;
68
+ onChange(items.length > 0 ? items : null);
69
+ onCommit();
70
+ },
71
+ });
72
+
73
+ const handleOpenGallery = useCallback(() => {
74
+ didCommitRef.current = false;
75
+ onStartEdit?.();
76
+ openMediaGalleryDialog();
77
+ }, [onStartEdit, openMediaGalleryDialog]);
78
+
79
+ const handleOpenPreview = useCallback(() => {
80
+ didCommitRef.current = false;
81
+ onStartEdit?.();
82
+ setIsPreviewOpen(true);
83
+ }, [onStartEdit]);
84
+
85
+ const handlePreviewClose = useCallback(() => {
86
+ setIsPreviewOpen(false);
87
+ if (!didCommitRef.current) {
88
+ onCancel?.();
89
+ }
90
+ didCommitRef.current = false;
91
+ }, [onCancel]);
92
+
93
+ const handlePreviewRequestMedia = useCallback(() => {
94
+ setIsPreviewOpen(false);
95
+ openMediaGalleryDialog();
96
+ }, [openMediaGalleryDialog]);
97
+
98
+ const handlePreviewClear = useCallback(() => {
99
+ didCommitRef.current = true;
100
+ onChange(null);
101
+ onCommit();
102
+ }, [onChange, onCommit]);
103
+
104
+ const handleClearAll = useCallback(() => {
105
+ onChange(null);
106
+ onCommit();
107
+ }, [onChange, onCommit]);
108
+
109
+ const onDownloadMedia = useCallback(
110
+ async (mediaUri?: string) => {
111
+ const uri = mediaUri ?? value?.[0]?.src;
112
+ if (!uri) return;
113
+ try {
114
+ const result = await files.generateFileDownloadUrl(uri);
115
+ const downloadUrl = result.downloadUrls?.[0]?.url;
116
+ if (!downloadUrl) throw new Error('No download URL returned');
117
+ executeDownloading(downloadUrl);
118
+ } catch {
119
+ executeDownloading(getMediaURL(uri));
120
+ }
121
+ },
122
+ [value],
123
+ );
124
+
125
+ const { handleContainerFocus, handleContainerBlur } = useCellEditKeyboard({
126
+ containerRef,
127
+ onCancel,
128
+ inputRef,
129
+ });
130
+
131
+ return (
132
+ <div
133
+ ref={containerRef}
134
+ data-hook={dataHook}
135
+ style={{ width: '100%', height: '100%' }}
136
+ onFocus={handleContainerFocus}
137
+ onBlur={handleContainerBlur}
138
+ >
139
+ <Box
140
+ align="space-between"
141
+ verticalAlign="middle"
142
+ height="100%"
143
+ padding="0 8px"
144
+ style={{ boxSizing: 'border-box' }}
145
+ >
146
+ {hasValue ? (
147
+ <AvatarGroup items={avatarItems} size="tiny" type="condensed" />
148
+ ) : (
149
+ <Tooltip content={t('CMS.mediaGallery.addGallery')} appendTo="window">
150
+ <IconButton
151
+ size="tiny"
152
+ priority="secondary"
153
+ dataHook="gallery-edit-add-button"
154
+ onClick={handleOpenGallery}
155
+ >
156
+ <Add />
157
+ </IconButton>
158
+ </Tooltip>
159
+ )}
160
+
161
+ {hasValue ? (
162
+ <PopoverMenu
163
+ textSize="small"
164
+ appendTo="window"
165
+ triggerElement={
166
+ <Tooltip
167
+ content={t('auto-patterns.fields.more_actions_tooltip')}
168
+ appendTo="window"
169
+ >
170
+ <IconButton
171
+ size="tiny"
172
+ priority="tertiary"
173
+ dataHook="gallery-edit-more-button"
174
+ >
175
+ <MoreSmall />
176
+ </IconButton>
177
+ </Tooltip>
178
+ }
179
+ >
180
+ <PopoverMenu.MenuItem
181
+ dataHook="gallery-edit-action-manage"
182
+ text={t('CMS.mediaGallery.manageGallery')}
183
+ prefixIcon={<Refresh />}
184
+ onClick={handleOpenGallery}
185
+ />
186
+ <PopoverMenu.MenuItem
187
+ dataHook="gallery-edit-action-preview"
188
+ text={t('CMS.mediaGallery.preview')}
189
+ prefixIcon={<Maximize />}
190
+ onClick={handleOpenPreview}
191
+ />
192
+ <PopoverMenu.Divider />
193
+ <PopoverMenu.MenuItem
194
+ dataHook="gallery-edit-action-clear"
195
+ text={t('CMS.mediaGallery.clear')}
196
+ skin="destructive"
197
+ prefixIcon={<Delete />}
198
+ onClick={handleClearAll}
199
+ />
200
+ </PopoverMenu>
201
+ ) : null}
202
+ </Box>
203
+
204
+ {dialogProps.isOpen && <MediaGalleryDialog {...dialogProps} />}
205
+
206
+ <MediaPreviewModal
207
+ isOpen={isPreviewOpen}
208
+ onClose={handlePreviewClose}
209
+ value={(value ?? []).map((item) => item.src)}
210
+ onRequestMedia={handlePreviewRequestMedia}
211
+ onClearMedia={handlePreviewClear}
212
+ onDownloadMedia={onDownloadMedia}
213
+ textKeys={mediaGalleryPreviewTextKeys}
214
+ />
215
+ </div>
216
+ );
217
+ };
218
+
219
+ CellMediaGalleryEdit.displayName = 'CellMediaGalleryEdit';
@@ -0,0 +1,32 @@
1
+ import React from 'react';
2
+ import { AvatarGroup, Box } from '@wix/design-system';
3
+ import { mediaURItoImageURL, ThumbnailSize } from '../../auto-field-types';
4
+ import type { WixCodeGalleryItem } from '../../auto-field-types';
5
+
6
+ export interface CellMediaGalleryViewProps {
7
+ data: WixCodeGalleryItem[] | null;
8
+ dataHook?: string;
9
+ }
10
+
11
+ export function CellMediaGalleryView({ data, dataHook }: CellMediaGalleryViewProps) {
12
+ const items = (data ?? []).map((item) => ({
13
+ imgProps: { src: mediaURItoImageURL(item.src, ThumbnailSize.S) },
14
+ }));
15
+
16
+ return (
17
+ <Box
18
+ dataHook={dataHook}
19
+ verticalAlign="middle"
20
+ height="100%"
21
+ width="100%"
22
+ padding="0 8px"
23
+ overflow="hidden"
24
+ >
25
+ {items.length > 0 ? (
26
+ <AvatarGroup items={items} size="tiny" type="condensed" />
27
+ ) : null}
28
+ </Box>
29
+ );
30
+ }
31
+
32
+ CellMediaGalleryView.displayName = 'CellMediaGalleryView';