@makeswift/runtime 0.9.0 → 0.9.1

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 (183) hide show
  1. package/dist/Box.cjs.js +15 -14
  2. package/dist/Box.cjs.js.map +1 -1
  3. package/dist/Box.es.js +10 -9
  4. package/dist/Box.es.js.map +1 -1
  5. package/dist/Button.cjs.js +12 -11
  6. package/dist/Button.cjs.js.map +1 -1
  7. package/dist/Button.es.js +10 -9
  8. package/dist/Button.es.js.map +1 -1
  9. package/dist/Carousel.cjs.js +26 -25
  10. package/dist/Carousel.cjs.js.map +1 -1
  11. package/dist/Carousel.es.js +5 -4
  12. package/dist/Carousel.es.js.map +1 -1
  13. package/dist/Countdown.cjs.js +15 -14
  14. package/dist/Countdown.cjs.js.map +1 -1
  15. package/dist/Countdown.es.js +7 -6
  16. package/dist/Countdown.es.js.map +1 -1
  17. package/dist/Divider.cjs.js +12 -11
  18. package/dist/Divider.cjs.js.map +1 -1
  19. package/dist/Divider.es.js +10 -9
  20. package/dist/Divider.es.js.map +1 -1
  21. package/dist/Embed.cjs.js +4 -29
  22. package/dist/Embed.cjs.js.map +1 -1
  23. package/dist/Embed.es.js +3 -28
  24. package/dist/Embed.es.js.map +1 -1
  25. package/dist/Form.cjs.js +51 -50
  26. package/dist/Form.cjs.js.map +1 -1
  27. package/dist/Form.es.js +7 -6
  28. package/dist/Form.es.js.map +1 -1
  29. package/dist/Image.cjs.js +8 -7
  30. package/dist/Image.cjs.js.map +1 -1
  31. package/dist/Image.es.js +7 -6
  32. package/dist/Image.es.js.map +1 -1
  33. package/dist/LiveProvider.cjs.js +4 -3
  34. package/dist/LiveProvider.cjs.js.map +1 -1
  35. package/dist/LiveProvider.es.js +6 -5
  36. package/dist/LiveProvider.es.js.map +1 -1
  37. package/dist/Navigation.cjs.js +26 -25
  38. package/dist/Navigation.cjs.js.map +1 -1
  39. package/dist/Navigation.es.js +5 -4
  40. package/dist/Navigation.es.js.map +1 -1
  41. package/dist/PreviewProvider.cjs.js +6 -5
  42. package/dist/PreviewProvider.cjs.js.map +1 -1
  43. package/dist/PreviewProvider.es.js +6 -5
  44. package/dist/PreviewProvider.es.js.map +1 -1
  45. package/dist/ReadOnlyText.cjs.js +14 -13
  46. package/dist/ReadOnlyText.cjs.js.map +1 -1
  47. package/dist/ReadOnlyText.es.js +9 -8
  48. package/dist/ReadOnlyText.es.js.map +1 -1
  49. package/dist/ReadOnlyTextV2.cjs.js +11 -10
  50. package/dist/ReadOnlyTextV2.cjs.js.map +1 -1
  51. package/dist/ReadOnlyTextV2.es.js +7 -6
  52. package/dist/ReadOnlyTextV2.es.js.map +1 -1
  53. package/dist/Root.cjs.js +7 -6
  54. package/dist/Root.cjs.js.map +1 -1
  55. package/dist/Root.es.js +5 -4
  56. package/dist/Root.es.js.map +1 -1
  57. package/dist/SocialLinks.cjs.js +14 -13
  58. package/dist/SocialLinks.cjs.js.map +1 -1
  59. package/dist/SocialLinks.es.js +10 -9
  60. package/dist/SocialLinks.es.js.map +1 -1
  61. package/dist/Text.cjs.js +4 -3
  62. package/dist/Text.cjs.js.map +1 -1
  63. package/dist/Text.es.js +5 -4
  64. package/dist/Text.es.js.map +1 -1
  65. package/dist/Video.cjs.js +4 -29
  66. package/dist/Video.cjs.js.map +1 -1
  67. package/dist/Video.es.js +3 -28
  68. package/dist/Video.es.js.map +1 -1
  69. package/dist/builder.cjs.js +5 -0
  70. package/dist/builder.cjs.js.map +1 -1
  71. package/dist/builder.es.js +5 -0
  72. package/dist/builder.es.js.map +1 -1
  73. package/dist/components.cjs.js +9 -8
  74. package/dist/components.cjs.js.map +1 -1
  75. package/dist/components.es.js +9 -8
  76. package/dist/components.es.js.map +1 -1
  77. package/dist/control-serialization.cjs.js +88 -9
  78. package/dist/control-serialization.cjs.js.map +1 -1
  79. package/dist/control-serialization.es.js +89 -10
  80. package/dist/control-serialization.es.js.map +1 -1
  81. package/dist/controls.cjs.js +10 -0
  82. package/dist/controls.cjs.js.map +1 -1
  83. package/dist/controls.es.js +6 -1
  84. package/dist/controls.es.js.map +1 -1
  85. package/dist/deepEqual.cjs.js +40 -0
  86. package/dist/deepEqual.cjs.js.map +1 -0
  87. package/dist/deepEqual.es.js +39 -0
  88. package/dist/deepEqual.es.js.map +1 -0
  89. package/dist/index.cjs.js +62 -91
  90. package/dist/index.cjs.js.map +1 -1
  91. package/dist/index.cjs10.js +8 -7
  92. package/dist/index.cjs10.js.map +1 -1
  93. package/dist/index.cjs2.js +13 -13
  94. package/dist/index.cjs2.js.map +1 -1
  95. package/dist/index.cjs4.js +2 -1
  96. package/dist/index.cjs4.js.map +1 -1
  97. package/dist/index.cjs8.js +4 -3
  98. package/dist/index.cjs8.js.map +1 -1
  99. package/dist/index.cjs9.js +69 -105
  100. package/dist/index.cjs9.js.map +1 -1
  101. package/dist/index.es.js +47 -75
  102. package/dist/index.es.js.map +1 -1
  103. package/dist/index.es10.js +5 -4
  104. package/dist/index.es10.js.map +1 -1
  105. package/dist/index.es2.js +2 -2
  106. package/dist/index.es3.js +1 -1
  107. package/dist/index.es4.js +2 -1
  108. package/dist/index.es4.js.map +1 -1
  109. package/dist/index.es6.js +1 -1
  110. package/dist/index.es8.js +4 -3
  111. package/dist/index.es8.js.map +1 -1
  112. package/dist/index.es9.js +71 -107
  113. package/dist/index.es9.js.map +1 -1
  114. package/dist/leaf.cjs.js +1 -1
  115. package/dist/leaf.cjs.js.map +1 -1
  116. package/dist/leaf.es.js +2 -2
  117. package/dist/main.cjs.js +5 -0
  118. package/dist/main.cjs.js.map +1 -1
  119. package/dist/main.es.js +5 -0
  120. package/dist/main.es.js.map +1 -1
  121. package/dist/next.cjs.js +4 -3
  122. package/dist/next.cjs.js.map +1 -1
  123. package/dist/next.es.js +5 -4
  124. package/dist/next.es.js.map +1 -1
  125. package/dist/prop-controllers.cjs.js +5 -0
  126. package/dist/prop-controllers.cjs.js.map +1 -1
  127. package/dist/prop-controllers.es.js +5 -0
  128. package/dist/prop-controllers.es.js.map +1 -1
  129. package/dist/react-page.cjs.js +376 -203
  130. package/dist/react-page.cjs.js.map +1 -1
  131. package/dist/react-page.es.js +349 -204
  132. package/dist/react-page.es.js.map +1 -1
  133. package/dist/react.cjs.js +4 -3
  134. package/dist/react.cjs.js.map +1 -1
  135. package/dist/react.es.js +4 -3
  136. package/dist/react.es.js.map +1 -1
  137. package/dist/slate.cjs.js +88 -4
  138. package/dist/slate.cjs.js.map +1 -1
  139. package/dist/slate.es.js +89 -5
  140. package/dist/slate.es.js.map +1 -1
  141. package/dist/types/src/builder/serialization/control-serialization.d.ts +3 -3
  142. package/dist/types/src/builder/serialization/control-serialization.d.ts.map +1 -1
  143. package/dist/types/src/builder/serialization/controls/rich-text-v2.d.ts +2 -2
  144. package/dist/types/src/builder/serialization/controls/rich-text-v2.d.ts.map +1 -1
  145. package/dist/types/src/builder/serialization/controls/style-v2.d.ts +5 -0
  146. package/dist/types/src/builder/serialization/controls/style-v2.d.ts.map +1 -0
  147. package/dist/types/src/components/builtin/Button/Button.d.ts +1 -1
  148. package/dist/types/src/components/builtin/Form/components/Field/components/Checkbox/index.d.ts +1 -1
  149. package/dist/types/src/components/hooks/useIsomorphicLayoutEffect.d.ts +2 -2
  150. package/dist/types/src/components/hooks/useIsomorphicLayoutEffect.d.ts.map +1 -1
  151. package/dist/types/src/controls/control.d.ts +3 -2
  152. package/dist/types/src/controls/control.d.ts.map +1 -1
  153. package/dist/types/src/controls/index.d.ts +1 -0
  154. package/dist/types/src/controls/index.d.ts.map +1 -1
  155. package/dist/types/src/controls/rich-text-v2/rich-text-v2.d.ts +8 -3
  156. package/dist/types/src/controls/rich-text-v2/rich-text-v2.d.ts.map +1 -1
  157. package/dist/types/src/controls/style-v2.d.ts +55 -0
  158. package/dist/types/src/controls/style-v2.d.ts.map +1 -0
  159. package/dist/types/src/prop-controllers/descriptors.d.ts +4 -3
  160. package/dist/types/src/prop-controllers/descriptors.d.ts.map +1 -1
  161. package/dist/types/src/prop-controllers/instances.d.ts +2 -2
  162. package/dist/types/src/prop-controllers/instances.d.ts.map +1 -1
  163. package/dist/types/src/runtimes/react/controls/control.d.ts +3 -2
  164. package/dist/types/src/runtimes/react/controls/control.d.ts.map +1 -1
  165. package/dist/types/src/runtimes/react/controls/rich-text-v2/EditableTextV2/editable-text-v2.d.ts +2 -1
  166. package/dist/types/src/runtimes/react/controls/rich-text-v2/EditableTextV2/editable-text-v2.d.ts.map +1 -1
  167. package/dist/types/src/runtimes/react/controls/rich-text-v2/rich-text-v2.d.ts +1 -1
  168. package/dist/types/src/runtimes/react/controls/rich-text-v2/rich-text-v2.d.ts.map +1 -1
  169. package/dist/types/src/runtimes/react/controls/style-v2.d.ts +4 -0
  170. package/dist/types/src/runtimes/react/controls/style-v2.d.ts.map +1 -0
  171. package/dist/types/src/runtimes/react/controls.d.ts.map +1 -1
  172. package/dist/types/src/slate/BlockPlugin/index.d.ts +3 -0
  173. package/dist/types/src/slate/BlockPlugin/index.d.ts.map +1 -1
  174. package/dist/types/src/slate/InlineModePlugin/index.d.ts +1 -0
  175. package/dist/types/src/slate/InlineModePlugin/index.d.ts.map +1 -1
  176. package/dist/types/src/slate/TextAlignPlugin/index.d.ts +9 -0
  177. package/dist/types/src/slate/TextAlignPlugin/index.d.ts.map +1 -0
  178. package/dist/types/src/slate/index.d.ts +1 -0
  179. package/dist/types/src/slate/index.d.ts.map +1 -1
  180. package/dist/types/src/slate/types.d.ts +18 -0
  181. package/dist/types/src/slate/types.d.ts.map +1 -1
  182. package/dist/useMediaQuery.es.js +1 -1
  183. package/package.json +1 -1
@@ -22,17 +22,44 @@ var __publicField = (obj, key, value) => {
22
22
  __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
23
23
  return value;
24
24
  };
25
+ var _a;
25
26
  var redux = require("redux");
26
27
  var thunk = require("redux-thunk");
27
28
  var actions = require("./actions.cjs.js");
28
29
  var state_breakpoints = require("./state/breakpoints.cjs.js");
30
+ var React = require("react");
31
+ var css = require("@emotion/css");
32
+ var serialize = require("@emotion/serialize");
33
+ var utils = require("@emotion/utils");
29
34
  var slate = require("slate");
30
35
  var isHotkey = require("is-hotkey");
31
36
  require("slate-react");
37
+ var jsxRuntime = require("react/jsx-runtime");
32
38
  function _interopDefaultLegacy(e) {
33
39
  return e && typeof e === "object" && "default" in e ? e : { "default": e };
34
40
  }
41
+ function _interopNamespace(e) {
42
+ if (e && e.__esModule)
43
+ return e;
44
+ var n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
45
+ if (e) {
46
+ Object.keys(e).forEach(function(k) {
47
+ if (k !== "default") {
48
+ var d = Object.getOwnPropertyDescriptor(e, k);
49
+ Object.defineProperty(n, k, d.get ? d : {
50
+ enumerable: true,
51
+ get: function() {
52
+ return e[k];
53
+ }
54
+ });
55
+ }
56
+ });
57
+ }
58
+ n["default"] = e;
59
+ return Object.freeze(n);
60
+ }
35
61
  var thunk__default = /* @__PURE__ */ _interopDefaultLegacy(thunk);
62
+ var React__namespace = /* @__PURE__ */ _interopNamespace(React);
36
63
  var isHotkey__default = /* @__PURE__ */ _interopDefaultLegacy(isHotkey);
37
64
  const ComponentIcon = {
38
65
  Billing: "billing",
@@ -101,8 +128,8 @@ function getDocuments(state) {
101
128
  return state;
102
129
  }
103
130
  function getDocument$1(state, documentKey) {
104
- var _a;
105
- return (_a = getDocuments(state).get(documentKey)) != null ? _a : null;
131
+ var _a2;
132
+ return (_a2 = getDocuments(state).get(documentKey)) != null ? _a2 : null;
106
133
  }
107
134
  function reducer$8(state = getInitialState$7(), action) {
108
135
  switch (action.type) {
@@ -126,8 +153,8 @@ function getReactComponents(state) {
126
153
  return state;
127
154
  }
128
155
  function getReactComponent$1(state, type) {
129
- var _a;
130
- return (_a = getReactComponents(state).get(type)) != null ? _a : null;
156
+ var _a2;
157
+ return (_a2 = getReactComponents(state).get(type)) != null ? _a2 : null;
131
158
  }
132
159
  function reducer$7(state = getInitialState$6(), action) {
133
160
  switch (action.type) {
@@ -151,8 +178,8 @@ function getPropControllerDescriptors$1(state) {
151
178
  return state;
152
179
  }
153
180
  function getComponentPropControllerDescriptors$1(state, componentType) {
154
- var _a;
155
- return (_a = getPropControllerDescriptors$1(state).get(componentType)) != null ? _a : null;
181
+ var _a2;
182
+ return (_a2 = getPropControllerDescriptors$1(state).get(componentType)) != null ? _a2 : null;
156
183
  }
157
184
  function reducer$6(state = getInitialState$5(), action) {
158
185
  switch (action.type) {
@@ -177,24 +204,24 @@ function getInitialState$4() {
177
204
  return { handles: /* @__PURE__ */ new Map(), instances: /* @__PURE__ */ new Map() };
178
205
  }
179
206
  function getPropControllersHandle(state, documentKey, elementKey) {
180
- var _a, _b;
181
- return (_b = (_a = state.handles.get(documentKey)) == null ? void 0 : _a.get(elementKey)) != null ? _b : null;
207
+ var _a2, _b;
208
+ return (_b = (_a2 = state.handles.get(documentKey)) == null ? void 0 : _a2.get(elementKey)) != null ? _b : null;
182
209
  }
183
210
  function getPropControllers$1(state, documentKey, elementKey) {
184
- var _a, _b;
185
- return (_b = (_a = state.instances.get(documentKey)) == null ? void 0 : _a.get(elementKey)) != null ? _b : null;
211
+ var _a2, _b;
212
+ return (_b = (_a2 = state.instances.get(documentKey)) == null ? void 0 : _a2.get(elementKey)) != null ? _b : null;
186
213
  }
187
214
  function getPropController(state, documentKey, elementKey, propName) {
188
- var _a, _b;
189
- return (_b = (_a = getPropControllers$1(state, documentKey, elementKey)) == null ? void 0 : _a[propName]) != null ? _b : null;
215
+ var _a2, _b;
216
+ return (_b = (_a2 = getPropControllers$1(state, documentKey, elementKey)) == null ? void 0 : _a2[propName]) != null ? _b : null;
190
217
  }
191
218
  function reducer$5(state = getInitialState$4(), action) {
192
- var _a, _b, _c, _d;
219
+ var _a2, _b, _c, _d;
193
220
  switch (action.type) {
194
221
  case actions.ActionTypes.REGISTER_PROP_CONTROLLERS_HANDLE: {
195
222
  const { documentKey, elementKey, handle } = action.payload;
196
223
  return __spreadProps(__spreadValues({}, state), {
197
- handles: new Map(state.handles).set(documentKey, new Map((_a = state.handles.get(documentKey)) != null ? _a : []).set(elementKey, handle))
224
+ handles: new Map(state.handles).set(documentKey, new Map((_a2 = state.handles.get(documentKey)) != null ? _a2 : []).set(elementKey, handle))
198
225
  });
199
226
  }
200
227
  case actions.ActionTypes.UNREGISTER_PROP_CONTROLLERS_HANDLE: {
@@ -259,9 +286,9 @@ function reducer$2(state = getInitialState$1(), action) {
259
286
  }
260
287
  }
261
288
  function getInitialState(initialState) {
262
- var _a, _b, _c;
289
+ var _a2, _b, _c;
263
290
  return {
264
- locales: (_a = initialState == null ? void 0 : initialState.locales) != null ? _a : [],
291
+ locales: (_a2 = initialState == null ? void 0 : initialState.locales) != null ? _a2 : [],
265
292
  locale: (_b = initialState == null ? void 0 : initialState.locale) != null ? _b : null,
266
293
  defaultLocale: (_c = initialState == null ? void 0 : initialState.defaultLocale) != null ? _c : null
267
294
  };
@@ -291,11 +318,11 @@ function Color(config = {}) {
291
318
  return { type: ColorControlType, config };
292
319
  }
293
320
  function copyColorData(value, context) {
294
- var _a;
321
+ var _a2;
295
322
  if (value == null)
296
323
  return value;
297
324
  return __spreadProps(__spreadValues({}, value), {
298
- swatchId: (_a = context.replacementContext.swatchIds.get(value.swatchId)) != null ? _a : value.swatchId
325
+ swatchId: (_a2 = context.replacementContext.swatchIds.get(value.swatchId)) != null ? _a2 : value.swatchId
299
326
  });
300
327
  }
301
328
  const ImageControlType = "makeswift::controls::image";
@@ -308,10 +335,10 @@ function Image$1(config = {}) {
308
335
  }
309
336
  Image$1.Format = ImageControlValueFormat;
310
337
  function copyImageData(value, context) {
311
- var _a;
338
+ var _a2;
312
339
  if (value == null)
313
340
  return value;
314
- return (_a = context.replacementContext.fileIds.get(value)) != null ? _a : value;
341
+ return (_a2 = context.replacementContext.fileIds.get(value)) != null ? _a2 : value;
315
342
  }
316
343
  if (void 0) {
317
344
  const { describe, test, expect } = void 0;
@@ -344,7 +371,7 @@ function Link$1(config = {}) {
344
371
  return { type: LinkControlType, config };
345
372
  }
346
373
  function copyLinkData(value, context) {
347
- var _a;
374
+ var _a2;
348
375
  if (value == null)
349
376
  return value;
350
377
  if (value.type === "OPEN_PAGE") {
@@ -352,7 +379,7 @@ function copyLinkData(value, context) {
352
379
  if (pageId != null) {
353
380
  return __spreadProps(__spreadValues({}, value), {
354
381
  payload: __spreadProps(__spreadValues({}, value.payload), {
355
- pageId: (_a = context.replacementContext.pageIds.get(pageId)) != null ? _a : pageId
382
+ pageId: (_a2 = context.replacementContext.pageIds.get(pageId)) != null ? _a2 : pageId
356
383
  })
357
384
  });
358
385
  }
@@ -505,6 +532,8 @@ function createPropController(descriptor, send) {
505
532
  return new ShapeControl(send, descriptor);
506
533
  case StyleControlType:
507
534
  return new StyleControl(send);
535
+ case StyleV2ControlType:
536
+ return new StyleV2Control(send);
508
537
  default:
509
538
  return new DefaultPropController(send);
510
539
  }
@@ -643,10 +672,10 @@ const AllStyleControlProperties = [
643
672
  StyleControlProperty.TextStyle
644
673
  ];
645
674
  function Style(params) {
646
- var _a;
675
+ var _a2;
647
676
  return {
648
677
  type: StyleControlType,
649
- config: { properties: (_a = params == null ? void 0 : params.properties) != null ? _a : StyleControlDefaultProperties }
678
+ config: { properties: (_a2 = params == null ? void 0 : params.properties) != null ? _a2 : StyleControlDefaultProperties }
650
679
  };
651
680
  }
652
681
  Style.Default = StyleControlDefaultProperties;
@@ -864,22 +893,22 @@ function copy$e(value, context) {
864
893
  return value;
865
894
  return value.map((override) => __spreadProps(__spreadValues({}, override), {
866
895
  value: override.value.map((backgroundItem) => {
867
- var _a, _b;
896
+ var _a2, _b;
868
897
  switch (backgroundItem.type) {
869
898
  case "color":
870
899
  return __spreadProps(__spreadValues({}, backgroundItem), {
871
900
  payload: backgroundItem.payload === null ? null : __spreadProps(__spreadValues({}, backgroundItem.payload), {
872
- swatchId: (_a = context.replacementContext.swatchIds.get(backgroundItem.payload.swatchId)) != null ? _a : backgroundItem.payload.swatchId
901
+ swatchId: (_a2 = context.replacementContext.swatchIds.get(backgroundItem.payload.swatchId)) != null ? _a2 : backgroundItem.payload.swatchId
873
902
  })
874
903
  });
875
904
  case "gradient":
876
905
  return __spreadProps(__spreadValues({}, backgroundItem), {
877
906
  payload: __spreadProps(__spreadValues({}, backgroundItem.payload), {
878
907
  stops: backgroundItem.payload.stops.map((stop) => {
879
- var _a2;
908
+ var _a3;
880
909
  return __spreadProps(__spreadValues({}, stop), {
881
910
  color: stop.color == null ? null : __spreadProps(__spreadValues({}, stop.color), {
882
- swatchId: (_a2 = context.replacementContext.swatchIds.get(stop.color.swatchId)) != null ? _a2 : stop.color.swatchId
911
+ swatchId: (_a3 = context.replacementContext.swatchIds.get(stop.color.swatchId)) != null ? _a3 : stop.color.swatchId
883
912
  })
884
913
  });
885
914
  })
@@ -905,7 +934,7 @@ function copy$d(value, context) {
905
934
  });
906
935
  }
907
936
  function copy$c(value, context) {
908
- var _a, _b;
937
+ var _a2, _b;
909
938
  if (value == null)
910
939
  return value;
911
940
  switch (value.type) {
@@ -915,7 +944,7 @@ function copy$c(value, context) {
915
944
  return value;
916
945
  return __spreadProps(__spreadValues({}, value), {
917
946
  payload: __spreadProps(__spreadValues({}, value.payload), {
918
- pageId: (_a = context.replacementContext.pageIds.get(pageId)) != null ? _a : pageId
947
+ pageId: (_a2 = context.replacementContext.pageIds.get(pageId)) != null ? _a2 : pageId
919
948
  })
920
949
  });
921
950
  }
@@ -948,10 +977,10 @@ function copy$b(value, context) {
948
977
  payload: __spreadProps(__spreadValues({}, item.payload), {
949
978
  link: link != null ? copy$c(link, context) : void 0,
950
979
  color: color != null ? color.map((override) => {
951
- var _a;
980
+ var _a2;
952
981
  return __spreadProps(__spreadValues({}, override), {
953
982
  value: __spreadProps(__spreadValues({}, override.value), {
954
- swatchId: (_a = context.replacementContext.swatchIds.get(override.value.swatchId)) != null ? _a : override.value.swatchId
983
+ swatchId: (_a2 = context.replacementContext.swatchIds.get(override.value.swatchId)) != null ? _a2 : override.value.swatchId
955
984
  })
956
985
  });
957
986
  }) : void 0
@@ -1009,14 +1038,14 @@ function copy$a(value, context) {
1009
1038
  return value;
1010
1039
  return value.map((override) => __spreadProps(__spreadValues({}, override), { value: override.value.map(copyShadowItem) }));
1011
1040
  function copyShadowItem(item) {
1012
- var _a;
1041
+ var _a2;
1013
1042
  const { color } = item.payload;
1014
1043
  if (color == null)
1015
1044
  return item;
1016
1045
  return __spreadProps(__spreadValues({}, item), {
1017
1046
  payload: __spreadProps(__spreadValues({}, item.payload), {
1018
1047
  color: __spreadProps(__spreadValues({}, color), {
1019
- swatchId: (_a = context.replacementContext.swatchIds.get(color.swatchId)) != null ? _a : color.swatchId
1048
+ swatchId: (_a2 = context.replacementContext.swatchIds.get(color.swatchId)) != null ? _a2 : color.swatchId
1020
1049
  })
1021
1050
  })
1022
1051
  });
@@ -1070,10 +1099,10 @@ if (void 0) {
1070
1099
  });
1071
1100
  }
1072
1101
  function copy$9(value, context) {
1073
- var _a;
1102
+ var _a2;
1074
1103
  if (value == null)
1075
1104
  return value;
1076
- return (_a = context.replacementContext.fileIds.get(value)) != null ? _a : value;
1105
+ return (_a2 = context.replacementContext.fileIds.get(value)) != null ? _a2 : value;
1077
1106
  }
1078
1107
  if (void 0) {
1079
1108
  const { describe, test, expect } = void 0;
@@ -1106,13 +1135,13 @@ function copy$8(value, context) {
1106
1135
  return value;
1107
1136
  return value.map(copyImagesPanelItem);
1108
1137
  function copyImagesPanelItem(imagesPanelItem) {
1109
- var _a;
1138
+ var _a2;
1110
1139
  const { file } = imagesPanelItem.props;
1111
1140
  if (file == null)
1112
1141
  return imagesPanelItem;
1113
1142
  return __spreadProps(__spreadValues({}, imagesPanelItem), {
1114
1143
  props: __spreadProps(__spreadValues({}, imagesPanelItem.props), {
1115
- file: (_a = context.replacementContext.fileIds.get(file)) != null ? _a : file
1144
+ file: (_a2 = context.replacementContext.fileIds.get(file)) != null ? _a2 : file
1116
1145
  })
1117
1146
  });
1118
1147
  }
@@ -1161,9 +1190,9 @@ function copy$7(value, context) {
1161
1190
  return value;
1162
1191
  return value.map((override) => __spreadProps(__spreadValues({}, override), { value: copyColorValue(override.value) }));
1163
1192
  function copyColorValue(colorValue) {
1164
- var _a;
1193
+ var _a2;
1165
1194
  return __spreadProps(__spreadValues({}, colorValue), {
1166
- swatchId: (_a = context.replacementContext.swatchIds.get(colorValue.swatchId)) != null ? _a : colorValue.swatchId
1195
+ swatchId: (_a2 = context.replacementContext.swatchIds.get(colorValue.swatchId)) != null ? _a2 : colorValue.swatchId
1167
1196
  });
1168
1197
  }
1169
1198
  }
@@ -1172,9 +1201,9 @@ function copy$6(value, context) {
1172
1201
  return value;
1173
1202
  return __spreadProps(__spreadValues({}, value), { fields: value.fields.map(copyFormFieldsPanelItem) });
1174
1203
  function copyFormFieldsPanelItem(item) {
1175
- var _a;
1204
+ var _a2;
1176
1205
  return __spreadProps(__spreadValues({}, item), {
1177
- tableColumnId: (_a = context.replacementContext.tableColumnIds.get(item.tableColumnId)) != null ? _a : item.tableColumnId
1206
+ tableColumnId: (_a2 = context.replacementContext.tableColumnIds.get(item.tableColumnId)) != null ? _a2 : item.tableColumnId
1178
1207
  });
1179
1208
  }
1180
1209
  }
@@ -1228,10 +1257,10 @@ if (void 0) {
1228
1257
  });
1229
1258
  }
1230
1259
  function copy$5(value, context) {
1231
- var _a;
1260
+ var _a2;
1232
1261
  if (value == null)
1233
1262
  return value;
1234
- return (_a = context.replacementContext.tableIds.get(value)) != null ? _a : value;
1263
+ return (_a2 = context.replacementContext.tableIds.get(value)) != null ? _a2 : value;
1235
1264
  }
1236
1265
  if (void 0) {
1237
1266
  const { describe, test, expect } = void 0;
@@ -1273,13 +1302,13 @@ function copy$4(value, context) {
1273
1302
  };
1274
1303
  }
1275
1304
  function copyBorderSide(borderSide) {
1276
- var _a;
1305
+ var _a2;
1277
1306
  const { color } = borderSide;
1278
1307
  if (color == null)
1279
1308
  return borderSide;
1280
1309
  return __spreadProps(__spreadValues({}, borderSide), {
1281
1310
  color: __spreadProps(__spreadValues({}, color), {
1282
- swatchId: (_a = context.replacementContext.swatchIds.get(color.swatchId)) != null ? _a : color.swatchId
1311
+ swatchId: (_a2 = context.replacementContext.swatchIds.get(color.swatchId)) != null ? _a2 : color.swatchId
1283
1312
  })
1284
1313
  });
1285
1314
  }
@@ -1393,24 +1422,24 @@ function copy$3(value, context) {
1393
1422
  return value;
1394
1423
  return __spreadProps(__spreadValues({}, value), { document: value.document ? copyNode(value.document) : value.document });
1395
1424
  function copyNode(node) {
1396
- var _a;
1425
+ var _a2;
1397
1426
  switch (node.object) {
1398
1427
  case "document":
1399
1428
  case "block":
1400
1429
  case "inline":
1401
1430
  return copyInline(node);
1402
1431
  case "text":
1403
- return __spreadProps(__spreadValues({}, node), { marks: (_a = node.marks) == null ? void 0 : _a.map(copyMark) });
1432
+ return __spreadProps(__spreadValues({}, node), { marks: (_a2 = node.marks) == null ? void 0 : _a2.map(copyMark) });
1404
1433
  default:
1405
1434
  return node;
1406
1435
  }
1407
1436
  }
1408
1437
  function copyInline(inline) {
1409
- var _a, _b;
1438
+ var _a2, _b;
1410
1439
  switch (inline.type) {
1411
1440
  case "link":
1412
1441
  return __spreadProps(__spreadValues({}, inline), {
1413
- nodes: (_a = inline.nodes) == null ? void 0 : _a.map(copyNode),
1442
+ nodes: (_a2 = inline.nodes) == null ? void 0 : _a2.map(copyNode),
1414
1443
  data: inline.data ? copyLinkData2(inline.data) : inline.data
1415
1444
  });
1416
1445
  default:
@@ -1418,7 +1447,7 @@ function copy$3(value, context) {
1418
1447
  }
1419
1448
  }
1420
1449
  function copyLinkData2(data) {
1421
- var _a, _b;
1450
+ var _a2, _b;
1422
1451
  switch (data.type) {
1423
1452
  case "OPEN_PAGE": {
1424
1453
  const pageId = data.payload.pageId;
@@ -1426,7 +1455,7 @@ function copy$3(value, context) {
1426
1455
  return data;
1427
1456
  return __spreadProps(__spreadValues({}, data), {
1428
1457
  payload: __spreadProps(__spreadValues({}, data.payload), {
1429
- pageId: (_a = context.replacementContext.pageIds.get(pageId)) != null ? _a : data.payload.pageId
1458
+ pageId: (_a2 = context.replacementContext.pageIds.get(pageId)) != null ? _a2 : data.payload.pageId
1430
1459
  })
1431
1460
  });
1432
1461
  }
@@ -1447,20 +1476,20 @@ function copy$3(value, context) {
1447
1476
  }
1448
1477
  }
1449
1478
  function copyMark(mark) {
1450
- var _a, _b, _c, _d;
1479
+ var _a2, _b, _c, _d;
1451
1480
  switch (mark.type) {
1452
1481
  case "typography": {
1453
- const typographyId = (_a = mark.data) == null ? void 0 : _a.value.id;
1482
+ const typographyId = (_a2 = mark.data) == null ? void 0 : _a2.value.id;
1454
1483
  return __spreadProps(__spreadValues({}, mark), {
1455
1484
  data: __spreadProps(__spreadValues({}, mark.data), {
1456
1485
  value: __spreadProps(__spreadValues({}, (_b = mark.data) == null ? void 0 : _b.value), {
1457
1486
  id: (_c = context.replacementContext.typographyIds.get(typographyId)) != null ? _c : typographyId,
1458
1487
  style: (_d = mark.data) == null ? void 0 : _d.value.style.map((override) => {
1459
- var _a2, _b2, _c2;
1488
+ var _a3, _b2, _c2;
1460
1489
  return __spreadProps(__spreadValues({}, override), {
1461
1490
  value: __spreadProps(__spreadValues({}, override.value), {
1462
1491
  color: override.value.color == null ? override.value.color : __spreadProps(__spreadValues({}, override.value.color), {
1463
- swatchId: (_c2 = context.replacementContext.swatchIds.get((_a2 = override.value.color) == null ? void 0 : _a2.swatchId)) != null ? _c2 : (_b2 = override.value.color) == null ? void 0 : _b2.swatchId
1492
+ swatchId: (_c2 = context.replacementContext.swatchIds.get((_a3 = override.value.color) == null ? void 0 : _a3.swatchId)) != null ? _c2 : (_b2 = override.value.color) == null ? void 0 : _b2.swatchId
1464
1493
  })
1465
1494
  })
1466
1495
  });
@@ -1657,6 +1686,37 @@ const SelectControlType = "makeswift::controls::select";
1657
1686
  function Select(config) {
1658
1687
  return { type: SelectControlType, config };
1659
1688
  }
1689
+ const isServer = typeof window === "undefined";
1690
+ const useInsertionEffectSpecifier = "useInsertionEffect";
1691
+ const useInsertionEffect = (_a = React__namespace[useInsertionEffectSpecifier]) != null ? _a : React__namespace.useLayoutEffect;
1692
+ function useStyle(style) {
1693
+ const serialized = serialize.serializeStyles([style], css.cache.registered);
1694
+ utils.registerStyles(css.cache, serialized, false);
1695
+ useInsertionEffect(() => {
1696
+ utils.insertStyles(css.cache, serialized, false);
1697
+ });
1698
+ if (isServer)
1699
+ utils.insertStyles(css.cache, serialized, false);
1700
+ return `${css.cache.key}-${serialized.name}`;
1701
+ }
1702
+ const StyleV2ControlType = "makeswift::controls::style-v2";
1703
+ const unstable_useStyleV2ClassName = useStyle;
1704
+ function unstable_StyleV2(config) {
1705
+ return { type: StyleV2ControlType, config };
1706
+ }
1707
+ const StyleV2ControlMessageType = {
1708
+ CHANGE_BOX_MODEL: "makeswift::controls::style::message::change-box-model"
1709
+ };
1710
+ class StyleV2Control extends PropController {
1711
+ constructor(send) {
1712
+ super(send);
1713
+ }
1714
+ changeBoxModel(boxModel) {
1715
+ this.send({ type: StyleV2ControlMessageType.CHANGE_BOX_MODEL, payload: { boxModel } });
1716
+ }
1717
+ recv() {
1718
+ }
1719
+ }
1660
1720
  const ObjectType = {
1661
1721
  Value: "value",
1662
1722
  Text: "text",
@@ -1793,13 +1853,13 @@ function getBlocksInSelection(editor) {
1793
1853
  })).filter((entry) => ElementUtils.isRootBlock(entry[0]));
1794
1854
  }
1795
1855
  function getActiveBlockType(editor) {
1796
- var _a;
1856
+ var _a2;
1797
1857
  const rootBlocks = getBlocksInSelection(editor).map(([node]) => node.type);
1798
- return rootBlocks.reduce((a, b) => a === b ? b : null, (_a = rootBlocks.at(0)) != null ? _a : null);
1858
+ return rootBlocks.reduce((a, b) => a === b ? b : null, (_a2 = rootBlocks.at(0)) != null ? _a2 : null);
1799
1859
  }
1800
1860
  function setBlockKeyForDevice(editor, breakpoints, deviceId, key, value, options) {
1801
- var _a, _b;
1802
- const at = (_a = options == null ? void 0 : options.at) != null ? _a : editor.selection;
1861
+ var _a2, _b;
1862
+ const at = (_a2 = options == null ? void 0 : options.at) != null ? _a2 : editor.selection;
1803
1863
  if (!at)
1804
1864
  return;
1805
1865
  const rootElements = getBlocksInSelection(editor);
@@ -1818,11 +1878,11 @@ function setBlockKeyForDevice(editor, breakpoints, deviceId, key, value, options
1818
1878
  }
1819
1879
  }
1820
1880
  function clearBlockKeyForDevice(editor, deviceId, key) {
1821
- var _a;
1881
+ var _a2;
1822
1882
  const rootElements = getBlocksInSelection(editor);
1823
1883
  for (const [node, path] of rootElements) {
1824
1884
  if (ElementUtils.isBlock(node)) {
1825
- const deviceOverrides = (_a = node[key]) != null ? _a : [];
1885
+ const deviceOverrides = (_a2 = node[key]) != null ? _a2 : [];
1826
1886
  slate.Transforms.setNodes(editor, {
1827
1887
  [key]: deviceOverrides.filter((v) => v.deviceId !== deviceId)
1828
1888
  }, { at: path });
@@ -1895,8 +1955,8 @@ function unwrapPath(editor, listItemPath) {
1895
1955
  });
1896
1956
  }
1897
1957
  function unwrapList(editor, options) {
1898
- var _a;
1899
- const at = (_a = options == null ? void 0 : options.at) != null ? _a : editor.selection;
1958
+ var _a2;
1959
+ const at = (_a2 = options == null ? void 0 : options.at) != null ? _a2 : editor.selection;
1900
1960
  if (!at)
1901
1961
  return;
1902
1962
  const listItems = Array.from(slate.Editor.nodes(editor, {
@@ -1915,8 +1975,8 @@ function unwrapList(editor, options) {
1915
1975
  });
1916
1976
  }
1917
1977
  function wrapList(editor, options = { type: BlockType.UnorderedList }) {
1918
- var _a;
1919
- const at = (_a = options.at) != null ? _a : editor.selection;
1978
+ var _a2;
1979
+ const at = (_a2 = options.at) != null ? _a2 : editor.selection;
1920
1980
  if (!at)
1921
1981
  return;
1922
1982
  const nonListEntries = Array.from(slate.Editor.nodes(editor, {
@@ -1955,7 +2015,7 @@ const LocationUtils = {
1955
2015
  }
1956
2016
  };
1957
2017
  function getSelectedListItems(editor) {
1958
- var _a, _b;
2018
+ var _a2, _b;
1959
2019
  if (!editor.selection)
1960
2020
  return [];
1961
2021
  const start = LocationUtils.getStartPath(editor.selection);
@@ -1963,7 +2023,7 @@ function getSelectedListItems(editor) {
1963
2023
  at: editor.selection,
1964
2024
  match: (node) => ElementUtils.isListItem(node)
1965
2025
  });
1966
- const firstAncestorPath = (_b = (_a = EditorUtils.getFirstAncestorListItem(editor, start)) == null ? void 0 : _a[1]) != null ? _b : [];
2026
+ const firstAncestorPath = (_b = (_a2 = EditorUtils.getFirstAncestorListItem(editor, start)) == null ? void 0 : _a2[1]) != null ? _b : [];
1967
2027
  return Array.from(listItems).filter((node) => slate.Path.isDescendant(start, node[1]) ? slate.Path.equals(node[1], firstAncestorPath) : !slate.Path.isAfter(start, node[1]));
1968
2028
  }
1969
2029
  function indentPath(editor, path) {
@@ -2040,8 +2100,8 @@ function dedent(editor) {
2040
2100
  });
2041
2101
  }
2042
2102
  function toggleList(editor, options = { type: BlockType.UnorderedList }) {
2043
- var _a;
2044
- const at = (_a = options.at) != null ? _a : editor.selection;
2103
+ var _a2;
2104
+ const at = (_a2 = options.at) != null ? _a2 : editor.selection;
2045
2105
  if (at == null)
2046
2106
  return;
2047
2107
  const start = LocationUtils.getStartPath(at);
@@ -2072,7 +2132,9 @@ const ListActions = {
2072
2132
  toggleList
2073
2133
  };
2074
2134
  function onKeyDown(e, editor) {
2075
- if (!editor.selection || Array.from(slate.Editor.nodes(editor, { match: (node) => ElementUtils.isListItem(node) })).length === 0)
2135
+ if (!editor.selection || Array.from(slate.Editor.nodes(editor, {
2136
+ match: (node) => ElementUtils.isListItem(node)
2137
+ })).length === 0)
2076
2138
  return;
2077
2139
  if (isHotkey__default["default"]("shift+tab", e)) {
2078
2140
  e.preventDefault();
@@ -2130,15 +2192,19 @@ function onKeyDown(e, editor) {
2130
2192
  }
2131
2193
  }
2132
2194
  function withBlock(editor) {
2133
- const { normalizeNode } = editor;
2195
+ const {
2196
+ normalizeNode
2197
+ } = editor;
2134
2198
  editor.isInline = (entry) => {
2135
2199
  return ElementUtils.isInline(entry);
2136
2200
  };
2137
2201
  editor.normalizeNode = (entry) => {
2138
- var _a;
2202
+ var _a2;
2139
2203
  const [normalizationNode, normalizationPath] = entry;
2140
- if (ElementUtils.isBlock(normalizationNode) && ((_a = normalizationNode == null ? void 0 : normalizationNode.textAlign) == null ? void 0 : _a.length) == 0) {
2141
- slate.Transforms.unsetNodes(editor, "textAlign", { at: normalizationPath });
2204
+ if (ElementUtils.isBlock(normalizationNode) && ((_a2 = normalizationNode == null ? void 0 : normalizationNode.textAlign) == null ? void 0 : _a2.length) == 0) {
2205
+ slate.Transforms.unsetNodes(editor, "textAlign", {
2206
+ at: normalizationPath
2207
+ });
2142
2208
  return;
2143
2209
  }
2144
2210
  if (ElementUtils.isListItem(normalizationNode)) {
@@ -2146,7 +2212,9 @@ function withBlock(editor) {
2146
2212
  if (slate.Node.has(editor, pathToListItemText)) {
2147
2213
  const nodeInListItemTextPosition = slate.Node.get(editor, pathToListItemText);
2148
2214
  if (ElementUtils.isRootBlock(nodeInListItemTextPosition)) {
2149
- slate.Transforms.setNodes(editor, { type: BlockType.ListItemChild }, {
2215
+ slate.Transforms.setNodes(editor, {
2216
+ type: BlockType.ListItemChild
2217
+ }, {
2150
2218
  at: pathToListItemText
2151
2219
  });
2152
2220
  return;
@@ -2164,10 +2232,7 @@ function withBlock(editor) {
2164
2232
  if (!potentialNodeToBeMerged || !ElementUtils.isList(potentialNodeToBeMerged[0]) || !ElementUtils.isList(child[0]) || potentialNodeToBeMerged[0].type !== child[0].type) {
2165
2233
  return null;
2166
2234
  }
2167
- return [
2168
- slate.Editor.pathRef(editor, child[1]),
2169
- slate.Editor.pathRef(editor, potentialNodeToBeMerged[1])
2170
- ];
2235
+ return [slate.Editor.pathRef(editor, child[1]), slate.Editor.pathRef(editor, potentialNodeToBeMerged[1])];
2171
2236
  }).filter((mergeableNodes) => Boolean(mergeableNodes));
2172
2237
  if (mergeableChildren.length !== 0) {
2173
2238
  mergeableChildren.reverse().forEach(([nodePathRef, nodeToBeMergedPathRef]) => {
@@ -2184,7 +2249,9 @@ function withBlock(editor) {
2184
2249
  to: [...nodePath, nodeChildren.length]
2185
2250
  });
2186
2251
  });
2187
- slate.Transforms.removeNodes(editor, { at: nodeToBeMergedPath });
2252
+ slate.Transforms.removeNodes(editor, {
2253
+ at: nodeToBeMergedPath
2254
+ });
2188
2255
  });
2189
2256
  nodePathRef.unref();
2190
2257
  nodeToBeMergedPathRef.unref();
@@ -2199,48 +2266,37 @@ function withBlock(editor) {
2199
2266
  const definition = Select({
2200
2267
  label: "Block",
2201
2268
  labelOrientation: "horizontal",
2202
- options: [
2203
- {
2204
- value: BlockType.Paragraph,
2205
- label: "Paragraph"
2206
- },
2207
- {
2208
- value: BlockType.Heading1,
2209
- label: "Heading 1"
2210
- },
2211
- {
2212
- value: BlockType.Heading2,
2213
- label: "Heading 2"
2214
- },
2215
- {
2216
- value: BlockType.Heading3,
2217
- label: "Heading 3"
2218
- },
2219
- {
2220
- value: BlockType.Heading4,
2221
- label: "Heading 4"
2222
- },
2223
- {
2224
- value: BlockType.Heading5,
2225
- label: "Heading 5"
2226
- },
2227
- {
2228
- value: BlockType.Heading6,
2229
- label: "Heading 6"
2230
- },
2231
- {
2232
- value: BlockType.UnorderedList,
2233
- label: "Bulleted list"
2234
- },
2235
- {
2236
- value: BlockType.OrderedList,
2237
- label: "Numbered list"
2238
- },
2239
- {
2240
- value: BlockType.BlockQuote,
2241
- label: "Quote"
2242
- }
2243
- ],
2269
+ options: [{
2270
+ value: BlockType.Paragraph,
2271
+ label: "Paragraph"
2272
+ }, {
2273
+ value: BlockType.Heading1,
2274
+ label: "Heading 1"
2275
+ }, {
2276
+ value: BlockType.Heading2,
2277
+ label: "Heading 2"
2278
+ }, {
2279
+ value: BlockType.Heading3,
2280
+ label: "Heading 3"
2281
+ }, {
2282
+ value: BlockType.Heading4,
2283
+ label: "Heading 4"
2284
+ }, {
2285
+ value: BlockType.Heading5,
2286
+ label: "Heading 5"
2287
+ }, {
2288
+ value: BlockType.Heading6,
2289
+ label: "Heading 6"
2290
+ }, {
2291
+ value: BlockType.UnorderedList,
2292
+ label: "Bulleted list"
2293
+ }, {
2294
+ value: BlockType.OrderedList,
2295
+ label: "Numbered list"
2296
+ }, {
2297
+ value: BlockType.BlockQuote,
2298
+ label: "Quote"
2299
+ }],
2244
2300
  defaultValue: BlockType.Paragraph
2245
2301
  });
2246
2302
  function BlockPlugin() {
@@ -2259,14 +2315,18 @@ function BlockPlugin() {
2259
2315
  } else if (activeBlockType === value) {
2260
2316
  slate.Transforms.setNodes(editor, {
2261
2317
  type: BlockType.Default
2262
- }, { at: getSelection(editor) });
2318
+ }, {
2319
+ at: getSelection(editor)
2320
+ });
2263
2321
  } else {
2264
2322
  ListActions.unwrapList(editor, {
2265
2323
  at: getSelection(editor)
2266
2324
  });
2267
2325
  slate.Transforms.setNodes(editor, {
2268
2326
  type: value != null ? value : BlockType.Default
2269
- }, { at: getSelection(editor) });
2327
+ }, {
2328
+ at: getSelection(editor)
2329
+ });
2270
2330
  }
2271
2331
  },
2272
2332
  getValue: (editor) => {
@@ -2275,9 +2335,114 @@ function BlockPlugin() {
2275
2335
  return void 0;
2276
2336
  return activeBlock;
2277
2337
  }
2278
- }
2338
+ },
2339
+ renderElement: (renderElement) => (props) => /* @__PURE__ */ jsxRuntime.jsx(BlockPluginComponent, __spreadProps(__spreadValues({}, props), {
2340
+ renderElement
2341
+ }))
2279
2342
  });
2280
2343
  }
2344
+ function BlockPluginComponent({
2345
+ element,
2346
+ attributes,
2347
+ children,
2348
+ renderElement
2349
+ }) {
2350
+ const blockStyles = [useStyle({
2351
+ margin: 0
2352
+ }), element.className];
2353
+ const quoteStyles = useStyle({
2354
+ padding: "0.5em 10px",
2355
+ fontSize: "1.25em",
2356
+ fontWeight: "300",
2357
+ borderLeft: "5px solid rgba(0, 0, 0, 0.1)"
2358
+ });
2359
+ switch (element.type) {
2360
+ case BlockType.Text:
2361
+ return /* @__PURE__ */ jsxRuntime.jsx("span", __spreadProps(__spreadValues({}, attributes), {
2362
+ className: css.cx(...blockStyles),
2363
+ children
2364
+ }));
2365
+ case BlockType.Paragraph:
2366
+ return /* @__PURE__ */ jsxRuntime.jsx("p", __spreadProps(__spreadValues({}, attributes), {
2367
+ className: css.cx(...blockStyles),
2368
+ children
2369
+ }));
2370
+ case BlockType.Heading1:
2371
+ return /* @__PURE__ */ jsxRuntime.jsx("h1", __spreadProps(__spreadValues({}, attributes), {
2372
+ className: css.cx(...blockStyles),
2373
+ children
2374
+ }));
2375
+ case BlockType.Heading2:
2376
+ return /* @__PURE__ */ jsxRuntime.jsx("h2", __spreadProps(__spreadValues({}, attributes), {
2377
+ className: css.cx(...blockStyles),
2378
+ children
2379
+ }));
2380
+ case BlockType.Heading3:
2381
+ return /* @__PURE__ */ jsxRuntime.jsx("h3", __spreadProps(__spreadValues({}, attributes), {
2382
+ className: css.cx(...blockStyles),
2383
+ children
2384
+ }));
2385
+ case BlockType.Heading4:
2386
+ return /* @__PURE__ */ jsxRuntime.jsx("h4", __spreadProps(__spreadValues({}, attributes), {
2387
+ className: css.cx(...blockStyles),
2388
+ children
2389
+ }));
2390
+ case BlockType.Heading5:
2391
+ return /* @__PURE__ */ jsxRuntime.jsx("h5", __spreadProps(__spreadValues({}, attributes), {
2392
+ className: css.cx(...blockStyles),
2393
+ children
2394
+ }));
2395
+ case BlockType.Heading6:
2396
+ return /* @__PURE__ */ jsxRuntime.jsx("h6", __spreadProps(__spreadValues({}, attributes), {
2397
+ className: css.cx(...blockStyles),
2398
+ children
2399
+ }));
2400
+ case BlockType.BlockQuote:
2401
+ return /* @__PURE__ */ jsxRuntime.jsx("blockquote", __spreadProps(__spreadValues({}, attributes), {
2402
+ className: css.cx(...blockStyles, quoteStyles),
2403
+ children
2404
+ }));
2405
+ case BlockType.OrderedList:
2406
+ return /* @__PURE__ */ jsxRuntime.jsx("ol", __spreadProps(__spreadValues({}, attributes), {
2407
+ className: css.cx(...blockStyles),
2408
+ style: {
2409
+ listStylePosition: "inside"
2410
+ },
2411
+ children
2412
+ }));
2413
+ case BlockType.UnorderedList:
2414
+ return /* @__PURE__ */ jsxRuntime.jsx("ul", __spreadProps(__spreadValues({}, attributes), {
2415
+ className: css.cx(...blockStyles),
2416
+ style: {
2417
+ listStylePosition: "inside"
2418
+ },
2419
+ children
2420
+ }));
2421
+ case BlockType.ListItem:
2422
+ return /* @__PURE__ */ jsxRuntime.jsx("li", __spreadProps(__spreadValues({}, attributes), {
2423
+ className: css.cx(...blockStyles),
2424
+ children
2425
+ }));
2426
+ case BlockType.ListItemChild:
2427
+ return /* @__PURE__ */ jsxRuntime.jsx("span", __spreadProps(__spreadValues({}, attributes), {
2428
+ className: css.cx(...blockStyles),
2429
+ children
2430
+ }));
2431
+ case BlockType.Default:
2432
+ return /* @__PURE__ */ jsxRuntime.jsx("p", __spreadProps(__spreadValues({}, attributes), {
2433
+ className: css.cx(...blockStyles),
2434
+ children
2435
+ }));
2436
+ default:
2437
+ return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, {
2438
+ children: renderElement({
2439
+ element,
2440
+ attributes,
2441
+ children
2442
+ })
2443
+ });
2444
+ }
2445
+ }
2281
2446
  const RichTextV2ControlType = "makeswift::controls::rich-text-v2";
2282
2447
  const RichTextV2Mode = {
2283
2448
  Inline: "makeswift::controls::rich-text-v2::mode::inline",
@@ -2286,9 +2451,10 @@ const RichTextV2Mode = {
2286
2451
  function createRichTextV2Plugin({
2287
2452
  control,
2288
2453
  withPlugin,
2289
- onKeyDown: onKeyDown2
2454
+ onKeyDown: onKeyDown2,
2455
+ renderElement
2290
2456
  }) {
2291
- return { control, withPlugin, onKeyDown: onKeyDown2 };
2457
+ return { control, withPlugin, onKeyDown: onKeyDown2, renderElement };
2292
2458
  }
2293
2459
  function unstable_RichTextV2(config = {}) {
2294
2460
  return { type: RichTextV2ControlType, config };
@@ -2311,7 +2477,7 @@ class RichTextV2Control extends PropController {
2311
2477
  __publicField(this, "defaultValue", null);
2312
2478
  __publicField(this, "descriptor");
2313
2479
  __publicField(this, "recv", (message) => {
2314
- var _a, _b, _c;
2480
+ var _a2, _b, _c;
2315
2481
  if (!this.editor)
2316
2482
  return;
2317
2483
  switch (message.type) {
@@ -2328,7 +2494,7 @@ class RichTextV2Control extends PropController {
2328
2494
  break;
2329
2495
  }
2330
2496
  case RichTextV2ControlMessageType.RUN_PLUGIN_CONTROL_ACTION: {
2331
- (_c = (_b = (_a = this.descriptor.config.plugins) == null ? void 0 : _a.at(message.pluginIndex)) == null ? void 0 : _b.control) == null ? void 0 : _c.onChange(this.editor, message.value);
2497
+ (_c = (_b = (_a2 = this.descriptor.config.plugins) == null ? void 0 : _a2.at(message.pluginIndex)) == null ? void 0 : _b.control) == null ? void 0 : _c.onChange(this.editor, message.value);
2332
2498
  break;
2333
2499
  }
2334
2500
  }
@@ -2337,13 +2503,13 @@ class RichTextV2Control extends PropController {
2337
2503
  this.send = send;
2338
2504
  }
2339
2505
  setEditor(editor) {
2340
- var _a, _b, _c;
2506
+ var _a2, _b, _c;
2341
2507
  this.editor = editor;
2342
2508
  this.send({
2343
2509
  type: RichTextV2ControlMessageType.SET_PLUGIN_CONTROL_VALUE,
2344
- value: (_c = (_b = (_a = this.descriptor.config) == null ? void 0 : _a.plugins) == null ? void 0 : _b.map((plugin) => {
2345
- var _a2;
2346
- return (_a2 = plugin == null ? void 0 : plugin.control) == null ? void 0 : _a2.getValue(editor);
2510
+ value: (_c = (_b = (_a2 = this.descriptor.config) == null ? void 0 : _a2.plugins) == null ? void 0 : _b.map((plugin) => {
2511
+ var _a3;
2512
+ return (_a3 = plugin == null ? void 0 : plugin.control) == null ? void 0 : _a3.getValue(editor);
2347
2513
  })) != null ? _c : []
2348
2514
  });
2349
2515
  }
@@ -2358,7 +2524,7 @@ class RichTextV2Control extends PropController {
2358
2524
  this.send({ type: RichTextV2ControlMessageType.SWITCH_TO_BUILD_MODE });
2359
2525
  }
2360
2526
  onChange(value) {
2361
- var _a, _b, _c;
2527
+ var _a2, _b, _c;
2362
2528
  const editor = this.editor;
2363
2529
  if (editor == null)
2364
2530
  return;
@@ -2368,9 +2534,9 @@ class RichTextV2Control extends PropController {
2368
2534
  });
2369
2535
  this.send({
2370
2536
  type: RichTextV2ControlMessageType.SET_PLUGIN_CONTROL_VALUE,
2371
- value: (_c = (_b = (_a = this.descriptor.config) == null ? void 0 : _a.plugins) == null ? void 0 : _b.map((plugin) => {
2372
- var _a2;
2373
- return (_a2 = plugin == null ? void 0 : plugin.control) == null ? void 0 : _a2.getValue(editor);
2537
+ value: (_c = (_b = (_a2 = this.descriptor.config) == null ? void 0 : _a2.plugins) == null ? void 0 : _b.map((plugin) => {
2538
+ var _a3;
2539
+ return (_a3 = plugin == null ? void 0 : plugin.control) == null ? void 0 : _a3.getValue(editor);
2374
2540
  })) != null ? _c : []
2375
2541
  });
2376
2542
  }
@@ -2384,8 +2550,8 @@ function isText(node) {
2384
2550
  return false;
2385
2551
  }
2386
2552
  function toTextDAO(node) {
2387
- var _a, _b, _c, _d;
2388
- const typographyMark = (_a = node.marks) == null ? void 0 : _a.find((mark) => mark.type === "typography");
2553
+ var _a2, _b, _c, _d;
2554
+ const typographyMark = (_a2 = node.marks) == null ? void 0 : _a2.find((mark) => mark.type === "typography");
2389
2555
  return [
2390
2556
  {
2391
2557
  text: (_b = node.text) != null ? _b : "",
@@ -2394,12 +2560,12 @@ function toTextDAO(node) {
2394
2560
  ];
2395
2561
  }
2396
2562
  function toInlineDAO(node) {
2397
- var _a, _b, _c, _d;
2563
+ var _a2, _b, _c, _d;
2398
2564
  switch (node.type) {
2399
2565
  case InlineType.Link:
2400
2566
  return [
2401
2567
  {
2402
- children: (_b = (_a = node.nodes) == null ? void 0 : _a.flatMap(toInlineOrTextDAO)) != null ? _b : [],
2568
+ children: (_b = (_a2 = node.nodes) == null ? void 0 : _a2.flatMap(toInlineOrTextDAO)) != null ? _b : [],
2403
2569
  [node.type]: node.data,
2404
2570
  type: node.type
2405
2571
  }
@@ -2428,7 +2594,7 @@ function toInlineOrTextDAO(node) {
2428
2594
  }
2429
2595
  }
2430
2596
  function toNodeDAO(node) {
2431
- var _a, _b;
2597
+ var _a2, _b;
2432
2598
  switch (node.object) {
2433
2599
  case ObjectType.Inline:
2434
2600
  case ObjectType.Text:
@@ -2438,7 +2604,7 @@ function toNodeDAO(node) {
2438
2604
  {
2439
2605
  type: node.type,
2440
2606
  textAlign: (node == null ? void 0 : node.data) && "textAlign" in node.data ? node == null ? void 0 : node.data.textAlign : void 0,
2441
- children: (_b = (_a = node.nodes) == null ? void 0 : _a.flatMap(toNodeDAO)) != null ? _b : []
2607
+ children: (_b = (_a2 = node.nodes) == null ? void 0 : _a2.flatMap(toNodeDAO)) != null ? _b : []
2442
2608
  }
2443
2609
  ];
2444
2610
  default:
@@ -2446,8 +2612,8 @@ function toNodeDAO(node) {
2446
2612
  }
2447
2613
  }
2448
2614
  function richTextDTOtoSelection(data) {
2449
- var _a, _b, _c, _d;
2450
- if (((_b = (_a = data.selection) == null ? void 0 : _a.anchor) == null ? void 0 : _b.offset) != null && data.selection.anchor.path != null && ((_d = (_c = data.selection) == null ? void 0 : _c.focus) == null ? void 0 : _d.offset) != null && data.selection.focus.path != null)
2615
+ var _a2, _b, _c, _d;
2616
+ if (((_b = (_a2 = data.selection) == null ? void 0 : _a2.anchor) == null ? void 0 : _b.offset) != null && data.selection.anchor.path != null && ((_d = (_c = data.selection) == null ? void 0 : _c.focus) == null ? void 0 : _d.offset) != null && data.selection.focus.path != null)
2451
2617
  return {
2452
2618
  anchor: {
2453
2619
  offset: data.selection.anchor.offset,
@@ -2461,8 +2627,8 @@ function richTextDTOtoSelection(data) {
2461
2627
  return null;
2462
2628
  }
2463
2629
  function richTextDTOtoDAO(data) {
2464
- var _a, _b, _c;
2465
- return (_c = (_b = (_a = data.document) == null ? void 0 : _a.nodes) == null ? void 0 : _b.flatMap(toNodeDAO)) != null ? _c : [];
2630
+ var _a2, _b, _c;
2631
+ return (_c = (_b = (_a2 = data.document) == null ? void 0 : _a2.nodes) == null ? void 0 : _b.flatMap(toNodeDAO)) != null ? _c : [];
2466
2632
  }
2467
2633
  function toInlineOrTextDTO(node) {
2468
2634
  if (isText(node)) {
@@ -2506,7 +2672,7 @@ function toInlineOrTextDTO(node) {
2506
2672
  }
2507
2673
  }
2508
2674
  function toNodeDTO(node) {
2509
- var _a, _b;
2675
+ var _a2, _b;
2510
2676
  if (isText(node))
2511
2677
  return toInlineOrTextDTO(node);
2512
2678
  switch (node.type) {
@@ -2531,7 +2697,7 @@ function toNodeDTO(node) {
2531
2697
  textAlign: node.textAlign
2532
2698
  } : {},
2533
2699
  object: "block",
2534
- nodes: (_b = (_a = node.children) == null ? void 0 : _a.flatMap(toNodeDTO)) != null ? _b : []
2700
+ nodes: (_b = (_a2 = node.children) == null ? void 0 : _a2.flatMap(toNodeDTO)) != null ? _b : []
2535
2701
  }
2536
2702
  ];
2537
2703
  default:
@@ -2895,51 +3061,51 @@ function getElementId$1(descriptor, prop) {
2895
3061
  }
2896
3062
  }
2897
3063
  function getBackgroundsSwatchIds(value) {
2898
- var _a;
2899
- return (_a = value == null ? void 0 : value.flatMap((override) => override.value).flatMap((backgroundItem) => {
2900
- var _a2;
3064
+ var _a2;
3065
+ return (_a2 = value == null ? void 0 : value.flatMap((override) => override.value).flatMap((backgroundItem) => {
3066
+ var _a3;
2901
3067
  switch (backgroundItem.type) {
2902
3068
  case "color":
2903
- return ((_a2 = backgroundItem.payload) == null ? void 0 : _a2.swatchId) == null ? [] : [backgroundItem.payload.swatchId];
3069
+ return ((_a3 = backgroundItem.payload) == null ? void 0 : _a3.swatchId) == null ? [] : [backgroundItem.payload.swatchId];
2904
3070
  case "gradient":
2905
3071
  return backgroundItem.payload.stops.flatMap((stop) => stop.color == null ? [] : stop.color.swatchId);
2906
3072
  default:
2907
3073
  return [];
2908
3074
  }
2909
- })) != null ? _a : [];
3075
+ })) != null ? _a2 : [];
2910
3076
  }
2911
3077
  function getBorderSwatchIds(value) {
2912
- var _a;
2913
- return (_a = value == null ? void 0 : value.flatMap((override) => override.value).flatMap((borderValue) => {
2914
- var _a2, _b, _c, _d, _e, _f, _g, _h;
3078
+ var _a2;
3079
+ return (_a2 = value == null ? void 0 : value.flatMap((override) => override.value).flatMap((borderValue) => {
3080
+ var _a3, _b, _c, _d, _e, _f, _g, _h;
2915
3081
  return [
2916
- (_b = (_a2 = borderValue.borderTop) == null ? void 0 : _a2.color) == null ? void 0 : _b.swatchId,
3082
+ (_b = (_a3 = borderValue.borderTop) == null ? void 0 : _a3.color) == null ? void 0 : _b.swatchId,
2917
3083
  (_d = (_c = borderValue.borderRight) == null ? void 0 : _c.color) == null ? void 0 : _d.swatchId,
2918
3084
  (_f = (_e = borderValue.borderBottom) == null ? void 0 : _e.color) == null ? void 0 : _f.swatchId,
2919
3085
  (_h = (_g = borderValue.borderLeft) == null ? void 0 : _g.color) == null ? void 0 : _h.swatchId
2920
3086
  ].filter((swatchId) => swatchId != null);
2921
- })) != null ? _a : [];
3087
+ })) != null ? _a2 : [];
2922
3088
  }
2923
3089
  function getBoxShadowsSwatchIds(value) {
2924
- var _a;
2925
- return (_a = value == null ? void 0 : value.flatMap((override) => override.value).map((item) => {
2926
- var _a2;
2927
- return (_a2 = item.payload.color) == null ? void 0 : _a2.swatchId;
2928
- }).filter((swatchId) => swatchId != null)) != null ? _a : [];
3090
+ var _a2;
3091
+ return (_a2 = value == null ? void 0 : value.flatMap((override) => override.value).map((item) => {
3092
+ var _a3;
3093
+ return (_a3 = item.payload.color) == null ? void 0 : _a3.swatchId;
3094
+ }).filter((swatchId) => swatchId != null)) != null ? _a2 : [];
2929
3095
  }
2930
3096
  function getResponsiveColorSwatchIds(value) {
2931
- var _a;
2932
- return (_a = value == null ? void 0 : value.map((override) => override.value).map((color) => color.swatchId)) != null ? _a : [];
3097
+ var _a2;
3098
+ return (_a2 = value == null ? void 0 : value.map((override) => override.value).map((color) => color.swatchId)) != null ? _a2 : [];
2933
3099
  }
2934
3100
  function getTypographyStyleSwatchIds(style) {
2935
- var _a;
2936
- return (_a = style == null ? void 0 : style.map((override) => override.value).flatMap((typographyStyle) => {
2937
- var _a2;
2938
- return (_a2 = typographyStyle.color) == null ? void 0 : _a2.swatchId;
2939
- }).filter(isNonNullable)) != null ? _a : [];
3101
+ var _a2;
3102
+ return (_a2 = style == null ? void 0 : style.map((override) => override.value).flatMap((typographyStyle) => {
3103
+ var _a3;
3104
+ return (_a3 = typographyStyle.color) == null ? void 0 : _a3.swatchId;
3105
+ }).filter(isNonNullable)) != null ? _a2 : [];
2940
3106
  }
2941
3107
  function getElementSwatchIds(descriptor, prop) {
2942
- var _a;
3108
+ var _a2;
2943
3109
  if (prop == null)
2944
3110
  return [];
2945
3111
  switch (descriptor.type) {
@@ -2949,17 +3115,17 @@ function getElementSwatchIds(descriptor, prop) {
2949
3115
  return getBorderSwatchIds(prop);
2950
3116
  case Types.NavigationLinks: {
2951
3117
  const value = prop;
2952
- return (_a = value == null ? void 0 : value.flatMap((item) => {
2953
- var _a2, _b, _c, _d;
3118
+ return (_a2 = value == null ? void 0 : value.flatMap((item) => {
3119
+ var _a3, _b, _c, _d;
2954
3120
  switch (item.type) {
2955
3121
  case "button":
2956
3122
  case "dropdown":
2957
3123
  return [
2958
- ...(_b = (_a2 = item.payload.color) == null ? void 0 : _a2.map((override) => override.value).map((color) => color.swatchId)) != null ? _b : [],
3124
+ ...(_b = (_a3 = item.payload.color) == null ? void 0 : _a3.map((override) => override.value).map((color) => color.swatchId)) != null ? _b : [],
2959
3125
  ...(_d = (_c = item.payload.textColor) == null ? void 0 : _c.map((override) => override.value).map((color) => color.swatchId)) != null ? _d : []
2960
3126
  ];
2961
3127
  }
2962
- })) != null ? _a : [];
3128
+ })) != null ? _a2 : [];
2963
3129
  }
2964
3130
  case Types.ResponsiveColor:
2965
3131
  return getResponsiveColorSwatchIds(prop);
@@ -2967,20 +3133,20 @@ function getElementSwatchIds(descriptor, prop) {
2967
3133
  return getBoxShadowsSwatchIds(prop);
2968
3134
  case Types.RichText: {
2969
3135
  let getNodeSwatchIds = function(node) {
2970
- var _a2, _b, _c, _d;
3136
+ var _a3, _b, _c, _d;
2971
3137
  switch (node.object) {
2972
3138
  case "document":
2973
3139
  case "block":
2974
3140
  case "inline":
2975
- return (_b = (_a2 = node.nodes) == null ? void 0 : _a2.flatMap(getNodeSwatchIds)) != null ? _b : [];
3141
+ return (_b = (_a3 = node.nodes) == null ? void 0 : _a3.flatMap(getNodeSwatchIds)) != null ? _b : [];
2976
3142
  case "text":
2977
3143
  return (_d = (_c = node.marks) == null ? void 0 : _c.flatMap(getMarkSwatchIds)) != null ? _d : [];
2978
3144
  default:
2979
3145
  return [];
2980
3146
  }
2981
3147
  }, getMarkSwatchIds = function(mark) {
2982
- var _a2, _b;
2983
- return getTypographyStyleSwatchIds((_b = (_a2 = mark.data) == null ? void 0 : _a2.value) == null ? void 0 : _b.style);
3148
+ var _a3, _b;
3149
+ return getTypographyStyleSwatchIds((_b = (_a3 = mark.data) == null ? void 0 : _a3.value) == null ? void 0 : _b.style);
2984
3150
  };
2985
3151
  const value = prop;
2986
3152
  if (value == null || value.document == null)
@@ -2996,18 +3162,18 @@ function getElementSwatchIds(descriptor, prop) {
2996
3162
  }
2997
3163
  }
2998
3164
  function getBackgroundsFileIds(value) {
2999
- var _a;
3000
- return (_a = value == null ? void 0 : value.flatMap((override) => override.value).flatMap((backgroundItem) => {
3165
+ var _a2;
3166
+ return (_a2 = value == null ? void 0 : value.flatMap((override) => override.value).flatMap((backgroundItem) => {
3001
3167
  switch (backgroundItem.type) {
3002
3168
  case "image":
3003
3169
  return [backgroundItem.payload.imageId];
3004
3170
  default:
3005
3171
  return [];
3006
3172
  }
3007
- })) != null ? _a : [];
3173
+ })) != null ? _a2 : [];
3008
3174
  }
3009
3175
  function getFileIds(descriptor, prop) {
3010
- var _a;
3176
+ var _a2;
3011
3177
  if (prop == null)
3012
3178
  return [];
3013
3179
  switch (descriptor.type) {
@@ -3019,7 +3185,7 @@ function getFileIds(descriptor, prop) {
3019
3185
  }
3020
3186
  case Types.Images: {
3021
3187
  const value = prop;
3022
- return (_a = value == null ? void 0 : value.flatMap((item) => item.props.file == null ? [] : [item.props.file])) != null ? _a : [];
3188
+ return (_a2 = value == null ? void 0 : value.flatMap((item) => item.props.file == null ? [] : [item.props.file])) != null ? _a2 : [];
3023
3189
  }
3024
3190
  case ImageControlType: {
3025
3191
  const value = prop;
@@ -3035,20 +3201,20 @@ function getTypographyIds(descriptor, prop) {
3035
3201
  switch (descriptor.type) {
3036
3202
  case Types.RichText: {
3037
3203
  let getNodeTypographyIds = function(node) {
3038
- var _a, _b, _c, _d;
3204
+ var _a2, _b, _c, _d;
3039
3205
  switch (node.object) {
3040
3206
  case "document":
3041
3207
  case "block":
3042
3208
  case "inline":
3043
- return (_b = (_a = node.nodes) == null ? void 0 : _a.flatMap(getNodeTypographyIds)) != null ? _b : [];
3209
+ return (_b = (_a2 = node.nodes) == null ? void 0 : _a2.flatMap(getNodeTypographyIds)) != null ? _b : [];
3044
3210
  case "text":
3045
3211
  return (_d = (_c = node.marks) == null ? void 0 : _c.flatMap(getMarkTypographyIds)) != null ? _d : [];
3046
3212
  default:
3047
3213
  return [];
3048
3214
  }
3049
3215
  }, getMarkTypographyIds = function(mark) {
3050
- var _a, _b;
3051
- return [(_b = (_a = mark.data) == null ? void 0 : _a.value) == null ? void 0 : _b.id].filter((id) => id != null);
3216
+ var _a2, _b;
3217
+ return [(_b = (_a2 = mark.data) == null ? void 0 : _a2.value) == null ? void 0 : _b.id].filter((id) => id != null);
3052
3218
  };
3053
3219
  const value = prop;
3054
3220
  if (value == null || value.document == null)
@@ -3072,7 +3238,7 @@ function getTableIds(descriptor, prop) {
3072
3238
  }
3073
3239
  }
3074
3240
  function getPageIds(descriptor, prop) {
3075
- var _a;
3241
+ var _a2;
3076
3242
  if (prop == null)
3077
3243
  return [];
3078
3244
  switch (descriptor.type) {
@@ -3091,8 +3257,8 @@ function getPageIds(descriptor, prop) {
3091
3257
  const value = prop;
3092
3258
  if (value == null)
3093
3259
  return [];
3094
- return (_a = value == null ? void 0 : value.flatMap((item) => {
3095
- var _a2, _b;
3260
+ return (_a2 = value == null ? void 0 : value.flatMap((item) => {
3261
+ var _a3, _b;
3096
3262
  switch (item.type) {
3097
3263
  case "button": {
3098
3264
  if (item.payload.link == null)
@@ -3105,7 +3271,7 @@ function getPageIds(descriptor, prop) {
3105
3271
  }
3106
3272
  }
3107
3273
  case "dropdown": {
3108
- return (_b = (_a2 = item.payload.links) == null ? void 0 : _a2.flatMap((link) => {
3274
+ return (_b = (_a3 = item.payload.links) == null ? void 0 : _a3.flatMap((link) => {
3109
3275
  if (link.payload.link == null)
3110
3276
  return [];
3111
3277
  switch (link.payload.link.type) {
@@ -3117,25 +3283,25 @@ function getPageIds(descriptor, prop) {
3117
3283
  })) != null ? _b : [];
3118
3284
  }
3119
3285
  }
3120
- })) != null ? _a : [];
3286
+ })) != null ? _a2 : [];
3121
3287
  }
3122
3288
  case Types.RichText: {
3123
3289
  let getNodePageIds = function(node) {
3124
- var _a2, _b;
3290
+ var _a3, _b;
3125
3291
  switch (node.object) {
3126
3292
  case "document":
3127
3293
  case "block":
3128
- return (_b = (_a2 = node.nodes) == null ? void 0 : _a2.flatMap(getNodePageIds)) != null ? _b : [];
3294
+ return (_b = (_a3 = node.nodes) == null ? void 0 : _a3.flatMap(getNodePageIds)) != null ? _b : [];
3129
3295
  case "inline":
3130
3296
  return getInlinePageIds(node);
3131
3297
  default:
3132
3298
  return [];
3133
3299
  }
3134
3300
  }, getInlinePageIds = function(inline) {
3135
- var _a2, _b, _c, _d;
3301
+ var _a3, _b, _c, _d;
3136
3302
  switch (inline.type) {
3137
3303
  case "link": {
3138
- const nodePageIds = (_b = (_a2 = inline.nodes) == null ? void 0 : _a2.flatMap(getNodePageIds)) != null ? _b : [];
3304
+ const nodePageIds = (_b = (_a3 = inline.nodes) == null ? void 0 : _a3.flatMap(getNodePageIds)) != null ? _b : [];
3139
3305
  const dataPageIds = inline.data ? getLinkDataPageIds(inline.data) : [];
3140
3306
  return [...nodePageIds, ...dataPageIds];
3141
3307
  }
@@ -3250,14 +3416,14 @@ function getDocumentKeysSortedByDepth(state) {
3250
3416
  elements.set(key, getDocumentElements(state, key));
3251
3417
  });
3252
3418
  keys.sort((a, b) => {
3253
- var _a;
3254
- return ((_a = elements.get(a)) == null ? void 0 : _a.has(b)) ? -1 : 1;
3419
+ var _a2;
3420
+ return ((_a2 = elements.get(a)) == null ? void 0 : _a2.has(b)) ? -1 : 1;
3255
3421
  });
3256
3422
  return keys;
3257
3423
  }
3258
3424
  function getElement(state, documentKey, elementKey) {
3259
- var _a;
3260
- return (_a = getDocumentElements(state, documentKey).get(elementKey)) != null ? _a : null;
3425
+ var _a2;
3426
+ return (_a2 = getDocumentElements(state, documentKey).get(elementKey)) != null ? _a2 : null;
3261
3427
  }
3262
3428
  function getElementPropControllerDescriptors(state, documentKey, elementKey) {
3263
3429
  const element = getElement(state, documentKey, elementKey);
@@ -3420,6 +3586,9 @@ exports.StyleControl = StyleControl;
3420
3586
  exports.StyleControlMessageType = StyleControlMessageType;
3421
3587
  exports.StyleControlProperty = StyleControlProperty;
3422
3588
  exports.StyleControlType = StyleControlType;
3589
+ exports.StyleV2Control = StyleV2Control;
3590
+ exports.StyleV2ControlMessageType = StyleV2ControlMessageType;
3591
+ exports.StyleV2ControlType = StyleV2ControlType;
3423
3592
  exports.Table = Table;
3424
3593
  exports.TableFormFields = TableFormFields;
3425
3594
  exports.TableFormFieldsMessageType = TableFormFieldsMessageType;
@@ -3447,6 +3616,7 @@ exports.createRichTextV2Plugin = createRichTextV2Plugin;
3447
3616
  exports.descriptors = descriptors;
3448
3617
  exports.getBackgroundsFileIds = getBackgroundsFileIds;
3449
3618
  exports.getBackgroundsSwatchIds = getBackgroundsSwatchIds;
3619
+ exports.getBlocksInSelection = getBlocksInSelection;
3450
3620
  exports.getBorderSwatchIds = getBorderSwatchIds;
3451
3621
  exports.getBoxShadowsSwatchIds = getBoxShadowsSwatchIds;
3452
3622
  exports.getBreakpoints = getBreakpoints;
@@ -3498,5 +3668,8 @@ exports.richTextDTOtoDAO = richTextDTOtoDAO;
3498
3668
  exports.richTextDTOtoSelection = richTextDTOtoSelection;
3499
3669
  exports.toSelectionDTO = toSelectionDTO;
3500
3670
  exports.unstable_RichTextV2 = unstable_RichTextV2;
3671
+ exports.unstable_StyleV2 = unstable_StyleV2;
3672
+ exports.unstable_useStyleV2ClassName = unstable_useStyleV2ClassName;
3673
+ exports.useStyle = useStyle;
3501
3674
  exports.withBlock = withBlock;
3502
3675
  //# sourceMappingURL=react-page.cjs.js.map