@makeswift/runtime 0.9.10 → 0.9.12

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 (209) hide show
  1. package/dist/Box.cjs.js +1 -1
  2. package/dist/Box.es.js +1 -1
  3. package/dist/Button.cjs.js +1 -1
  4. package/dist/Button.es.js +1 -1
  5. package/dist/Carousel.cjs.js +1 -1
  6. package/dist/Carousel.es.js +1 -1
  7. package/dist/Countdown.cjs.js +1 -1
  8. package/dist/Countdown.es.js +1 -1
  9. package/dist/Divider.cjs.js +1 -1
  10. package/dist/Divider.es.js +1 -1
  11. package/dist/Form.cjs.js +1 -1
  12. package/dist/Form.es.js +1 -1
  13. package/dist/Image.cjs.js +1 -1
  14. package/dist/Image.es.js +1 -1
  15. package/dist/LiveProvider.cjs.js +1 -1
  16. package/dist/LiveProvider.es.js +3 -3
  17. package/dist/Navigation.cjs.js +1 -1
  18. package/dist/Navigation.es.js +1 -1
  19. package/dist/PreviewProvider.cjs.js +1 -1
  20. package/dist/PreviewProvider.es.js +3 -3
  21. package/dist/ReadOnlyText.cjs.js +18 -3
  22. package/dist/ReadOnlyText.cjs.js.map +1 -1
  23. package/dist/ReadOnlyText.es.js +20 -5
  24. package/dist/ReadOnlyText.es.js.map +1 -1
  25. package/dist/ReadOnlyTextV2.cjs.js +116 -240
  26. package/dist/ReadOnlyTextV2.cjs.js.map +1 -1
  27. package/dist/ReadOnlyTextV2.es.js +115 -238
  28. package/dist/ReadOnlyTextV2.es.js.map +1 -1
  29. package/dist/Root.cjs.js +1 -1
  30. package/dist/Root.es.js +1 -1
  31. package/dist/SocialLinks.cjs.js +1 -1
  32. package/dist/SocialLinks.es.js +1 -1
  33. package/dist/Text.cjs.js +1 -1
  34. package/dist/Text.es.js +1 -1
  35. package/dist/components.cjs.js +1 -1
  36. package/dist/components.es.js +1 -1
  37. package/dist/control-serialization.es.js +1 -1
  38. package/dist/controls.cjs.js +28 -18
  39. package/dist/controls.cjs.js.map +1 -1
  40. package/dist/controls.es.js +2 -2
  41. package/dist/index.cjs.js +47 -42
  42. package/dist/index.cjs.js.map +1 -1
  43. package/dist/index.cjs10.js +2 -2
  44. package/dist/index.cjs2.js +3 -3
  45. package/dist/index.cjs2.js.map +1 -1
  46. package/dist/index.cjs5.js +5 -6
  47. package/dist/index.cjs5.js.map +1 -1
  48. package/dist/index.cjs6.js +20 -0
  49. package/dist/index.cjs6.js.map +1 -1
  50. package/dist/index.cjs8.js +1 -1
  51. package/dist/index.cjs9.js +27 -31
  52. package/dist/index.cjs9.js.map +1 -1
  53. package/dist/index.es.js +22 -18
  54. package/dist/index.es.js.map +1 -1
  55. package/dist/index.es10.js +4 -4
  56. package/dist/index.es2.js +2 -2
  57. package/dist/index.es3.js +1 -1
  58. package/dist/index.es5.js +1 -2
  59. package/dist/index.es5.js.map +1 -1
  60. package/dist/index.es6.js +21 -2
  61. package/dist/index.es6.js.map +1 -1
  62. package/dist/index.es8.js +1 -1
  63. package/dist/index.es9.js +31 -35
  64. package/dist/index.es9.js.map +1 -1
  65. package/dist/next.cjs.js +1 -1
  66. package/dist/next.es.js +2 -2
  67. package/dist/react-page.cjs.js +310 -147
  68. package/dist/react-page.cjs.js.map +1 -1
  69. package/dist/react-page.es.js +297 -146
  70. package/dist/react-page.es.js.map +1 -1
  71. package/dist/react.cjs.js +1 -1
  72. package/dist/react.es.js +1 -1
  73. package/dist/slate.cjs.js +40 -27
  74. package/dist/slate.cjs.js.map +1 -1
  75. package/dist/slate.es.js +49 -37
  76. package/dist/slate.es.js.map +1 -1
  77. package/dist/{typography.cjs.js → text-input.cjs.js} +1 -9
  78. package/dist/text-input.cjs.js.map +1 -0
  79. package/dist/{typography.es.js → text-input.es.js} +2 -8
  80. package/dist/text-input.es.js.map +1 -0
  81. package/dist/types/src/api/react.d.ts +1 -1
  82. package/dist/types/src/api/react.d.ts.map +1 -1
  83. package/dist/types/src/components/builtin/Button/Button.d.ts +3 -39
  84. package/dist/types/src/components/builtin/Button/Button.d.ts.map +1 -1
  85. package/dist/types/src/components/builtin/Form/components/Field/components/Checkbox/index.d.ts +2 -2
  86. package/dist/types/src/components/builtin/Form/components/Field/components/Input/index.d.ts +1 -1
  87. package/dist/types/src/components/builtin/Form/components/Field/components/PlaceholderTableField/index.d.ts +0 -1
  88. package/dist/types/src/components/builtin/Form/components/Field/components/PlaceholderTableField/index.d.ts.map +1 -1
  89. package/dist/types/src/components/builtin/Form/components/Field/components/RadioButton/index.d.ts +2 -2
  90. package/dist/types/src/components/builtin/Form/components/Field/components/TextArea/index.d.ts +1 -1
  91. package/dist/types/src/components/builtin/Form/components/Field/index.d.ts +0 -1
  92. package/dist/types/src/components/builtin/Form/components/Field/index.d.ts.map +1 -1
  93. package/dist/types/src/components/builtin/Form/components/Spinner/index.d.ts +0 -1
  94. package/dist/types/src/components/builtin/Form/components/Spinner/index.d.ts.map +1 -1
  95. package/dist/types/src/components/builtin/Navigation/components/DropDownButton/index.d.ts +1 -1
  96. package/dist/types/src/components/builtin/Navigation/components/DropDownButton/index.d.ts.map +1 -1
  97. package/dist/types/src/components/builtin/Navigation/components/LinksPlaceholder/index.d.ts +0 -1
  98. package/dist/types/src/components/builtin/Navigation/components/LinksPlaceholder/index.d.ts.map +1 -1
  99. package/dist/types/src/components/builtin/Navigation/components/MobileMenu/components/MobileDropDownButton/index.d.ts +1 -1
  100. package/dist/types/src/components/builtin/Navigation/components/MobileMenu/components/MobileDropDownButton/index.d.ts.map +1 -1
  101. package/dist/types/src/components/builtin/Navigation/components/MobileMenu/index.d.ts +0 -1
  102. package/dist/types/src/components/builtin/Navigation/components/MobileMenu/index.d.ts.map +1 -1
  103. package/dist/types/src/components/builtin/SocialLinks/components/SocialLinksPlaceholder/index.d.ts +0 -1
  104. package/dist/types/src/components/builtin/SocialLinks/components/SocialLinksPlaceholder/index.d.ts.map +1 -1
  105. package/dist/types/src/components/builtin/SocialLinks/options.d.ts +23 -24
  106. package/dist/types/src/components/builtin/SocialLinks/options.d.ts.map +1 -1
  107. package/dist/types/src/components/builtin/Text/ReadOnlyText.d.ts +2 -2
  108. package/dist/types/src/components/builtin/Text/ReadOnlyText.d.ts.map +1 -1
  109. package/dist/types/src/components/builtin/Text/components/Element/block.d.ts +1 -2
  110. package/dist/types/src/components/builtin/Text/components/Element/block.d.ts.map +1 -1
  111. package/dist/types/src/components/builtin/Text/components/Element/element.d.ts +1 -2
  112. package/dist/types/src/components/builtin/Text/components/Element/element.d.ts.map +1 -1
  113. package/dist/types/src/components/builtin/Text/components/Element/inline.d.ts +1 -2
  114. package/dist/types/src/components/builtin/Text/components/Element/inline.d.ts.map +1 -1
  115. package/dist/types/src/components/builtin/Text/components/Leaf/leaf.d.ts +1 -2
  116. package/dist/types/src/components/builtin/Text/components/Leaf/leaf.d.ts.map +1 -1
  117. package/dist/types/src/components/page/Page.d.ts +0 -1
  118. package/dist/types/src/components/page/Page.d.ts.map +1 -1
  119. package/dist/types/src/components/shared/BackgroundsContainer/components/BackgroundVideo/index.d.ts +0 -1
  120. package/dist/types/src/components/shared/BackgroundsContainer/components/BackgroundVideo/index.d.ts.map +1 -1
  121. package/dist/types/src/components/shared/BackgroundsContainer/components/Backgrounds/index.d.ts +0 -1
  122. package/dist/types/src/components/shared/BackgroundsContainer/components/Backgrounds/index.d.ts.map +1 -1
  123. package/dist/types/src/components/shared/BackgroundsContainer/index.d.ts +1 -1
  124. package/dist/types/src/components/shared/GutterContainer/index.d.ts +1 -1
  125. package/dist/types/src/components/shared/GutterContainer/index.d.ts.map +1 -1
  126. package/dist/types/src/components/shared/Link/index.d.ts +1 -1
  127. package/dist/types/src/components/shared/Link/index.d.ts.map +1 -1
  128. package/dist/types/src/components/shared/grid-item.d.ts +1 -1
  129. package/dist/types/src/components/shared/grid-item.d.ts.map +1 -1
  130. package/dist/types/src/controls/list.d.ts +5 -2
  131. package/dist/types/src/controls/list.d.ts.map +1 -1
  132. package/dist/types/src/controls/rich-text/introspection.d.ts +5 -0
  133. package/dist/types/src/controls/rich-text/introspection.d.ts.map +1 -0
  134. package/dist/types/src/controls/rich-text/introspection.test.d.ts +2 -0
  135. package/dist/types/src/controls/rich-text/introspection.test.d.ts.map +1 -0
  136. package/dist/types/src/controls/rich-text-v2/introspection.d.ts +5 -0
  137. package/dist/types/src/controls/rich-text-v2/introspection.d.ts.map +1 -0
  138. package/dist/types/src/controls/rich-text-v2/introspection.test.d.ts +2 -0
  139. package/dist/types/src/controls/rich-text-v2/introspection.test.d.ts.map +1 -0
  140. package/dist/types/src/controls/rich-text-v2/rich-text-v2.d.ts +15 -3
  141. package/dist/types/src/controls/rich-text-v2/rich-text-v2.d.ts.map +1 -1
  142. package/dist/types/src/controls/rich-text-v2/translation.d.ts +1 -1
  143. package/dist/types/src/controls/rich-text-v2/translation.d.ts.map +1 -1
  144. package/dist/types/src/controls/shape.d.ts +5 -2
  145. package/dist/types/src/controls/shape.d.ts.map +1 -1
  146. package/dist/types/src/controls/typography.d.ts +2 -0
  147. package/dist/types/src/controls/typography.d.ts.map +1 -1
  148. package/dist/types/src/next/client.d.ts.map +1 -1
  149. package/dist/types/src/next/document.d.ts +1 -2
  150. package/dist/types/src/next/document.d.ts.map +1 -1
  151. package/dist/types/src/next/index.d.ts +1 -1
  152. package/dist/types/src/next/index.d.ts.map +1 -1
  153. package/dist/types/src/next/preview-mode.d.ts +1 -2
  154. package/dist/types/src/next/preview-mode.d.ts.map +1 -1
  155. package/dist/types/src/prop-controllers/descriptors.d.ts +10 -0
  156. package/dist/types/src/prop-controllers/descriptors.d.ts.map +1 -1
  157. package/dist/types/src/prop-controllers/introspection.d.ts +0 -2
  158. package/dist/types/src/prop-controllers/introspection.d.ts.map +1 -1
  159. package/dist/types/src/runtimes/react/components/render-hook.d.ts +0 -1
  160. package/dist/types/src/runtimes/react/components/render-hook.d.ts.map +1 -1
  161. package/dist/types/src/runtimes/react/controls/control.d.ts +0 -1
  162. package/dist/types/src/runtimes/react/controls/control.d.ts.map +1 -1
  163. package/dist/types/src/runtimes/react/controls/list.d.ts +0 -1
  164. package/dist/types/src/runtimes/react/controls/list.d.ts.map +1 -1
  165. package/dist/types/src/runtimes/react/controls/rich-text-v2/EditableTextV2/editable-text-v2.d.ts +1 -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/EditableTextV2/render-element.d.ts +1 -2
  168. package/dist/types/src/runtimes/react/controls/rich-text-v2/EditableTextV2/render-element.d.ts.map +1 -1
  169. package/dist/types/src/runtimes/react/controls/rich-text-v2/EditableTextV2/render-leaf.d.ts +1 -2
  170. package/dist/types/src/runtimes/react/controls/rich-text-v2/EditableTextV2/render-leaf.d.ts.map +1 -1
  171. package/dist/types/src/runtimes/react/controls/rich-text-v2/EditableTextV2/useRemoteChanges.d.ts +4 -0
  172. package/dist/types/src/runtimes/react/controls/rich-text-v2/EditableTextV2/useRemoteChanges.d.ts.map +1 -0
  173. package/dist/types/src/runtimes/react/controls/rich-text-v2/ReadOnlyTextV2.d.ts +7 -16
  174. package/dist/types/src/runtimes/react/controls/rich-text-v2/ReadOnlyTextV2.d.ts.map +1 -1
  175. package/dist/types/src/runtimes/react/controls/rich-text-v2/rich-text-v2.d.ts +1 -1
  176. package/dist/types/src/runtimes/react/controls/rich-text-v2/rich-text-v2.d.ts.map +1 -1
  177. package/dist/types/src/runtimes/react/controls/rich-text.d.ts +1 -1
  178. package/dist/types/src/runtimes/react/controls/rich-text.d.ts.map +1 -1
  179. package/dist/types/src/runtimes/react/controls/shape.d.ts +0 -1
  180. package/dist/types/src/runtimes/react/controls/shape.d.ts.map +1 -1
  181. package/dist/types/src/runtimes/react/controls/slot.d.ts +2 -2
  182. package/dist/types/src/runtimes/react/controls/slot.d.ts.map +1 -1
  183. package/dist/types/src/runtimes/react/controls/style-v2.d.ts +0 -1
  184. package/dist/types/src/runtimes/react/controls/style-v2.d.ts.map +1 -1
  185. package/dist/types/src/runtimes/react/controls.d.ts +0 -1
  186. package/dist/types/src/runtimes/react/controls.d.ts.map +1 -1
  187. package/dist/types/src/runtimes/react/find-dom-node.d.ts.map +1 -1
  188. package/dist/types/src/runtimes/react/index.d.ts +1 -1
  189. package/dist/types/src/runtimes/react/index.d.ts.map +1 -1
  190. package/dist/types/src/slate/LinkPlugin/index.d.ts.map +1 -1
  191. package/dist/types/src/slate/LocalChangesPlugin/index.d.ts +16 -0
  192. package/dist/types/src/slate/LocalChangesPlugin/index.d.ts.map +1 -0
  193. package/dist/types/src/slate/TextAlignPlugin/index.d.ts +3 -3
  194. package/dist/types/src/slate/TextAlignPlugin/index.d.ts.map +1 -1
  195. package/dist/types/src/slate/index.d.ts +1 -0
  196. package/dist/types/src/slate/index.d.ts.map +1 -1
  197. package/dist/types/src/slate/types.d.ts +2 -2
  198. package/dist/types/src/slate/types.d.ts.map +1 -1
  199. package/dist/types/src/slate/utils/responsive.d.ts +1 -1
  200. package/dist/types/src/slate/utils/responsive.d.ts.map +1 -1
  201. package/dist/types/src/state/modules/react-components.d.ts +2 -2
  202. package/dist/types/src/state/modules/react-components.d.ts.map +1 -1
  203. package/dist/types.cjs2.js +67 -48
  204. package/dist/types.cjs2.js.map +1 -1
  205. package/dist/types.es2.js +64 -45
  206. package/dist/types.es2.js.map +1 -1
  207. package/package.json +4 -5
  208. package/dist/typography.cjs.js.map +0 -1
  209. package/dist/typography.es.js.map +0 -1
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
- var typography = require("./typography.cjs.js");
3
+ var textInput = require("./text-input.cjs.js");
4
4
  var reactPage = require("./react-page.cjs.js");
5
5
  var combobox = require("./combobox.cjs.js");
6
6
  require("redux");
@@ -13,21 +13,19 @@ require("@emotion/css");
13
13
  require("@emotion/serialize");
14
14
  require("@emotion/utils");
15
15
  require("slate");
16
- exports.Checkbox = typography.Checkbox;
17
- exports.CheckboxControlType = typography.CheckboxControlType;
18
- exports.IconRadioGroupControlType = typography.IconRadioGroupControlType;
19
- exports.Number = typography.Number;
20
- exports.NumberControlType = typography.NumberControlType;
21
- exports.Select = typography.Select;
22
- exports.SelectControlType = typography.SelectControlType;
23
- exports.TextArea = typography.TextArea;
24
- exports.TextAreaControlType = typography.TextAreaControlType;
25
- exports.TextInput = typography.TextInput;
26
- exports.TextInputControlType = typography.TextInputControlType;
27
- exports.TypographyControlType = typography.TypographyControlType;
28
- exports.unstable_IconRadioGroup = typography.unstable_IconRadioGroup;
29
- exports.unstable_IconRadioGroupIcon = typography.unstable_IconRadioGroupIcon;
30
- exports.unstable_Typography = typography.unstable_Typography;
16
+ exports.Checkbox = textInput.Checkbox;
17
+ exports.CheckboxControlType = textInput.CheckboxControlType;
18
+ exports.IconRadioGroupControlType = textInput.IconRadioGroupControlType;
19
+ exports.Number = textInput.Number;
20
+ exports.NumberControlType = textInput.NumberControlType;
21
+ exports.Select = textInput.Select;
22
+ exports.SelectControlType = textInput.SelectControlType;
23
+ exports.TextArea = textInput.TextArea;
24
+ exports.TextAreaControlType = textInput.TextAreaControlType;
25
+ exports.TextInput = textInput.TextInput;
26
+ exports.TextInputControlType = textInput.TextInputControlType;
27
+ exports.unstable_IconRadioGroup = textInput.unstable_IconRadioGroup;
28
+ exports.unstable_IconRadioGroupIcon = textInput.unstable_IconRadioGroupIcon;
31
29
  exports.Color = reactPage.Color;
32
30
  exports.ColorControlType = reactPage.ColorControlType;
33
31
  exports.Image = reactPage.Image$1;
@@ -64,6 +62,7 @@ exports.StyleControlType = reactPage.StyleControlType;
64
62
  exports.StyleV2Control = reactPage.StyleV2Control;
65
63
  exports.StyleV2ControlMessageType = reactPage.StyleV2ControlMessageType;
66
64
  exports.StyleV2ControlType = reactPage.StyleV2ControlType;
65
+ exports.TypographyControlType = reactPage.TypographyControlType;
67
66
  exports.copy = reactPage.copy;
68
67
  exports.copyColorData = reactPage.copyColorData;
69
68
  exports.copyImageData = reactPage.copyImageData;
@@ -73,8 +72,18 @@ exports.copyShapeData = reactPage.copyShapeData;
73
72
  exports.copySlotData = reactPage.copySlotData;
74
73
  exports.copyStyleData = reactPage.copyStyleData;
75
74
  exports.createRichTextV2Plugin = reactPage.createRichTextV2Plugin;
76
- exports.introspectListData = reactPage.introspectListData;
77
- exports.introspectShapeData = reactPage.introspectShapeData;
75
+ exports.getListElementChildren = reactPage.getListElementChildren;
76
+ exports.getListFileIds = reactPage.getListFileIds;
77
+ exports.getListPageIds = reactPage.getListPageIds;
78
+ exports.getListSwatchIds = reactPage.getListSwatchIds;
79
+ exports.getListTypographyIds = reactPage.getListTypographyIds;
80
+ exports.getShapeElementChildren = reactPage.getShapeElementChildren;
81
+ exports.getShapeFileIds = reactPage.getShapeFileIds;
82
+ exports.getShapePageIds = reactPage.getShapePageIds;
83
+ exports.getShapeSwatchIds = reactPage.getShapeSwatchIds;
84
+ exports.getShapeTypographyIds = reactPage.getShapeTypographyIds;
85
+ exports.getTypographySwatchIds = reactPage.getTypographySwatchIds;
86
+ exports.getTypographyTypographyIds = reactPage.getTypographyTypographyIds;
78
87
  exports.isRichTextV1Data = reactPage.isRichTextV1Data;
79
88
  exports.merge = reactPage.merge;
80
89
  exports.mergeSlotData = reactPage.mergeSlotData;
@@ -86,6 +95,7 @@ exports.richTextV2DescendentsToData = reactPage.richTextV2DescendentsToData;
86
95
  exports.toSelectionDTO = reactPage.toSelectionDTO;
87
96
  exports.unstable_RichTextV2 = reactPage.unstable_RichTextV2;
88
97
  exports.unstable_StyleV2 = reactPage.unstable_StyleV2;
98
+ exports.unstable_Typography = reactPage.unstable_Typography;
89
99
  exports.unstable_useStyleV2ClassName = reactPage.unstable_useStyleV2ClassName;
90
100
  exports.Combobox = combobox.Combobox;
91
101
  exports.ComboboxControlType = combobox.ComboboxControlType;
@@ -1 +1 @@
1
- {"version":3,"file":"controls.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"controls.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,5 +1,5 @@
1
- export { c as Checkbox, C as CheckboxControlType, I as IconRadioGroupControlType, e as Number, N as NumberControlType, f as Select, S as SelectControlType, g as TextArea, a as TextAreaControlType, h as TextInput, b as TextInputControlType, T as TypographyControlType, d as unstable_IconRadioGroup, u as unstable_IconRadioGroupIcon, i as unstable_Typography } from "./typography.es.js";
2
- export { ay as Color, ac as ColorControlType, aC as Image, ab as ImageControlType, a0 as ImageControlValueFormat, aE as Link, aa as LinkControlType, aG as List, aI as ListControl, aH as ListControlMessageType, a8 as ListControlType, b1 as ObjectType, b2 as RichText, b4 as RichTextControl, b3 as RichTextControlMessageType, a5 as RichTextControlType, bd as RichTextV2Control, bc as RichTextV2ControlMessageType, a4 as RichTextV2ControlType, b9 as RichTextV2Mode, aL as Shape, aN as ShapeControl, aM as ShapeControlMessageType, a9 as ShapeControlType, aQ as Slot, aS as SlotControl, aR as SlotControlMessageType, a6 as SlotControlType, aV as Style, aX as StyleControl, aW as StyleControlMessageType, $ as StyleControlProperty, a3 as StyleControlType, b0 as StyleV2Control, a$ as StyleV2ControlMessageType, a7 as StyleV2ControlType, aA as copy, az as copyColorData, aD as copyImageData, aF as copyLinkData, aJ as copyListData, aO as copyShapeData, aT as copySlotData, aY as copyStyleData, ba as createRichTextV2Plugin, aK as introspectListData, aP as introspectShapeData, a2 as isRichTextV1Data, aB as merge, aU as mergeSlotData, b8 as richTextDAOToDTO, b6 as richTextDTOtoDAO, b5 as richTextDTOtoSelection, be as richTextV2DataToDescendents, bf as richTextV2DescendentsToData, b7 as toSelectionDTO, bb as unstable_RichTextV2, a_ as unstable_StyleV2, aZ as unstable_useStyleV2ClassName } from "./react-page.es.js";
1
+ export { b as Checkbox, C as CheckboxControlType, I as IconRadioGroupControlType, d as Number, N as NumberControlType, e as Select, S as SelectControlType, f as TextArea, T as TextAreaControlType, g as TextInput, a as TextInputControlType, c as unstable_IconRadioGroup, u as unstable_IconRadioGroupIcon } from "./text-input.es.js";
2
+ export { az as Color, ad as ColorControlType, aD as Image, ac as ImageControlType, $ as ImageControlValueFormat, aF as Link, ab as LinkControlType, aH as List, aJ as ListControl, aI as ListControlMessageType, a9 as ListControlType, ba as ObjectType, bb as RichText, bd as RichTextControl, bc as RichTextControlMessageType, a6 as RichTextControlType, bm as RichTextV2Control, bl as RichTextV2ControlMessageType, a5 as RichTextV2ControlType, bi as RichTextV2Mode, aQ as Shape, aS as ShapeControl, aR as ShapeControlMessageType, aa as ShapeControlType, aZ as Slot, a$ as SlotControl, a_ as SlotControlMessageType, a7 as SlotControlType, b2 as Style, b4 as StyleControl, b3 as StyleControlMessageType, _ as StyleControlProperty, a4 as StyleControlType, b9 as StyleV2Control, b8 as StyleV2ControlMessageType, a8 as StyleV2ControlType, a3 as TypographyControlType, aB as copy, aA as copyColorData, aE as copyImageData, aG as copyLinkData, aK as copyListData, aT as copyShapeData, b0 as copySlotData, b5 as copyStyleData, bj as createRichTextV2Plugin, aL as getListElementChildren, aN as getListFileIds, aP as getListPageIds, aM as getListSwatchIds, aO as getListTypographyIds, aU as getShapeElementChildren, aY as getShapeFileIds, aX as getShapePageIds, aV as getShapeSwatchIds, aW as getShapeTypographyIds, bq as getTypographySwatchIds, br as getTypographyTypographyIds, a1 as isRichTextV1Data, aC as merge, b1 as mergeSlotData, bh as richTextDAOToDTO, bf as richTextDTOtoDAO, be as richTextDTOtoSelection, bn as richTextV2DataToDescendents, bo as richTextV2DescendentsToData, bg as toSelectionDTO, bk as unstable_RichTextV2, b7 as unstable_StyleV2, bp as unstable_Typography, b6 as unstable_useStyleV2ClassName } from "./react-page.es.js";
3
3
  export { a as Combobox, C as ComboboxControlType } from "./combobox.es.js";
4
4
  import "redux";
5
5
  import "redux-thunk";
package/dist/index.cjs.js CHANGED
@@ -41,7 +41,7 @@ var dynamic = require("next/dynamic");
41
41
  var reactPage = require("./react-page.cjs.js");
42
42
  var actions = require("./actions.cjs.js");
43
43
  var jsxRuntime = require("react/jsx-runtime");
44
- var typography = require("./typography.cjs.js");
44
+ var textInput = require("./text-input.cjs.js");
45
45
  var combobox = require("./combobox.cjs.js");
46
46
  require("slate");
47
47
  var shim = require("use-sync-external-store/shim");
@@ -950,7 +950,8 @@ Received "${apiKey}" instead.`);
950
950
  return response;
951
951
  }
952
952
  async getPages() {
953
- const response = await this.fetch(`/v2/pages`, {
953
+ const isUsingVersioning = this.siteVersion != null;
954
+ const response = await this.fetch(`/${isUsingVersioning ? "v3" : "v2"}/pages`, {
954
955
  headers: {
955
956
  "Makeswift-Site-Version": MakeswiftSiteVersion.Live
956
957
  }
@@ -968,7 +969,8 @@ Received "${apiKey}" instead.`);
968
969
  }
969
970
  async getSwatches(ids, preview) {
970
971
  var _a;
971
- const url = new URL(`v1/swatches/bulk`, this.apiOrigin);
972
+ const isUsingVersioning = this.siteVersion != null;
973
+ const url = new URL(`${isUsingVersioning ? "v2" : "v1"}/swatches/bulk`, this.apiOrigin);
972
974
  ids.forEach((id) => {
973
975
  url.searchParams.append("ids", id);
974
976
  });
@@ -1051,8 +1053,8 @@ Received "${apiKey}" instead.`);
1051
1053
  getResourcesFromElementDescriptors(elementDescriptors, element2.props);
1052
1054
  }
1053
1055
  const typographies = await this.getTypographies([...typographyIds]);
1054
- typographies.forEach((typography2) => {
1055
- typography2 == null ? void 0 : typography2.style.forEach((style) => {
1056
+ typographies.forEach((typography) => {
1057
+ typography == null ? void 0 : typography.style.forEach((style) => {
1056
1058
  var _a;
1057
1059
  const swatchId = (_a = style.value.color) == null ? void 0 : _a.swatchId;
1058
1060
  if (swatchId != null)
@@ -1087,7 +1089,7 @@ Received "${apiKey}" instead.`);
1087
1089
  var _a;
1088
1090
  return {
1089
1091
  id,
1090
- value: (_a = typographies.find((typography2) => (typography2 == null ? void 0 : typography2.id) === id)) != null ? _a : null
1092
+ value: (_a = typographies.find((typography) => (typography == null ? void 0 : typography.id) === id)) != null ? _a : null
1091
1093
  };
1092
1094
  }),
1093
1095
  [types.APIResourceType.Table]: [...tableIds].map((id) => {
@@ -1120,11 +1122,12 @@ Received "${apiKey}" instead.`);
1120
1122
  unstable_locale
1121
1123
  } = {}) {
1122
1124
  var _a;
1125
+ const isUsingVersioning = this.siteVersion != null;
1123
1126
  const siteVersion = (_a = this.siteVersion) != null ? _a : previewOverride ? MakeswiftSiteVersion.Working : MakeswiftSiteVersion.Live;
1124
1127
  const searchParams = new URLSearchParams();
1125
1128
  if (unstable_locale)
1126
1129
  searchParams.set("locale", unstable_locale);
1127
- const response = await this.fetch(`/v2/pages/${encodeURIComponent(pathname)}/document?${searchParams.toString()}`, {
1130
+ const response = await this.fetch(`/${isUsingVersioning ? "v3" : "v2"}/pages/${encodeURIComponent(pathname)}/document?${searchParams.toString()}`, {
1128
1131
  headers: { "Makeswift-Site-Version": siteVersion }
1129
1132
  });
1130
1133
  if (!response.ok) {
@@ -1147,7 +1150,8 @@ Received "${apiKey}" instead.`);
1147
1150
  };
1148
1151
  }
1149
1152
  async getSwatch(swatchId) {
1150
- const response = await this.fetch(`v1/swatches/${swatchId}`);
1153
+ const isUsingVersioning = this.siteVersion != null;
1154
+ const response = await this.fetch(`${isUsingVersioning ? "v2" : "v1"}/swatches/${swatchId}`);
1151
1155
  if (!response.ok) {
1152
1156
  if (response.status !== 404)
1153
1157
  console.error("Failed to get swatch", await response.json());
@@ -1236,7 +1240,7 @@ async function fonts(_req, res, { getFonts } = {}) {
1236
1240
  const fonts2 = (_a = await (getFonts == null ? void 0 : getFonts())) != null ? _a : [];
1237
1241
  return res.json(fonts2);
1238
1242
  }
1239
- const version = "0.9.10";
1243
+ const version = "0.9.12";
1240
1244
  async function handler(req, res, { apiKey, unstable_siteVersions }) {
1241
1245
  if (req.query.secret !== apiKey) {
1242
1246
  return res.status(401).json({ message: "Unauthorized" });
@@ -2593,6 +2597,9 @@ const FallbackComponent = React.forwardRef(function FallbackComponent2({
2593
2597
  })]
2594
2598
  });
2595
2599
  });
2600
+ function isNonNullable(value) {
2601
+ return value != null;
2602
+ }
2596
2603
  function useSwatch(swatchId) {
2597
2604
  const client = useMakeswiftClient();
2598
2605
  const readSwatch = () => swatchId == null ? null : client.readSwatch(swatchId);
@@ -2648,12 +2655,12 @@ function useFiles(fileIds) {
2648
2655
  function useTypography(typographyId) {
2649
2656
  const client = useMakeswiftClient();
2650
2657
  const readTypography = () => typographyId == null ? null : client.readTypography(typographyId);
2651
- const typography2 = shim.useSyncExternalStore(client.subscribe, readTypography, readTypography);
2658
+ const typography = shim.useSyncExternalStore(client.subscribe, readTypography, readTypography);
2652
2659
  React.useEffect(() => {
2653
2660
  if (typographyId != null)
2654
2661
  client.fetchTypography(typographyId).catch(console.error);
2655
2662
  }, [client, typographyId]);
2656
- return typography2;
2663
+ return typography;
2657
2664
  }
2658
2665
  function useGlobalElement(globalElementId) {
2659
2666
  const client = useMakeswiftClient();
@@ -2701,7 +2708,7 @@ function mapSideColor(swatches, _e) {
2701
2708
  return __spreadProps(__spreadValues({}, restOfSide), {
2702
2709
  color: color && {
2703
2710
  alpha: color.alpha,
2704
- swatch: swatches.filter(reactPage.isNonNullable).find((s) => s && s.id === color.swatchId)
2711
+ swatch: swatches.filter(isNonNullable).find((s) => s && s.id === color.swatchId)
2705
2712
  }
2706
2713
  });
2707
2714
  }
@@ -2747,7 +2754,7 @@ function useBoxShadow(value) {
2747
2754
  return __spreadProps(__spreadValues({}, restOfShadow), {
2748
2755
  payload: {
2749
2756
  color: color != null ? {
2750
- swatch: swatches.filter(reactPage.isNonNullable).find((s) => s && s.id === color.swatchId),
2757
+ swatch: swatches.filter(isNonNullable).find((s) => s && s.id === color.swatchId),
2751
2758
  alpha: color.alpha
2752
2759
  } : null,
2753
2760
  inset: inset != null ? inset : ShadowDefaultValue.inset,
@@ -2771,7 +2778,7 @@ function useResponsiveColor(color) {
2771
2778
  const { swatchId, alpha } = v;
2772
2779
  const swatch = swatches.find((s) => s && s.id === swatchId);
2773
2780
  return swatch == null ? null : __spreadProps(__spreadValues({}, rest), { value: { swatch, alpha } });
2774
- }).filter(reactPage.isNonNullable);
2781
+ }).filter(isNonNullable);
2775
2782
  }
2776
2783
  const getIndexes = (spans, index) => {
2777
2784
  const flattened = spans.reduce((a, s) => a.concat(s), []);
@@ -3267,7 +3274,7 @@ function useRichTextV2(data, definition, control) {
3267
3274
  control
3268
3275
  }) : /* @__PURE__ */ jsxRuntime.jsx(ReadOnlyText, {
3269
3276
  text: data,
3270
- control
3277
+ definition
3271
3278
  });
3272
3279
  }
3273
3280
  function useSelectControlValue(data, definition) {
@@ -3493,15 +3500,12 @@ function useTextAreaValue(data, definition) {
3493
3500
  function useTextInputValue(data, definition) {
3494
3501
  return data != null ? data : definition.config.defaultValue;
3495
3502
  }
3496
- function isNonNullable(value) {
3497
- return value != null;
3498
- }
3499
- function typographyFragementToTypographyControlData(typography2) {
3500
- if (typography2 == null)
3503
+ function typographyFragementToTypographyControlData(typography) {
3504
+ if (typography == null)
3501
3505
  return void 0;
3502
3506
  return {
3503
- id: typography2.id,
3504
- style: typography2.style.map(({ deviceId, value }) => {
3507
+ id: typography.id,
3508
+ style: typography.style.map(({ deviceId, value }) => {
3505
3509
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
3506
3510
  return {
3507
3511
  deviceId,
@@ -3527,7 +3531,7 @@ function getTypographyStyleSwatchIds(style) {
3527
3531
  return (_a = style == null ? void 0 : style.map((override) => override.value).flatMap((typographyStyle) => {
3528
3532
  var _a2;
3529
3533
  return (_a2 = typographyStyle.color) == null ? void 0 : _a2.swatchId;
3530
- }).filter(isNonNullable)) != null ? _a : [];
3534
+ }).filter(reactPage.isNonNullable)) != null ? _a : [];
3531
3535
  }
3532
3536
  const withColor = (swatches) => (deviceRawTypographyValue) => {
3533
3537
  var _b, _c;
@@ -3555,15 +3559,15 @@ const withColor = (swatches) => (deviceRawTypographyValue) => {
3555
3559
  const getDeviceId = ({ deviceId }) => deviceId;
3556
3560
  function useEnhancedTypography(value) {
3557
3561
  var _a, _b, _c;
3558
- const typography2 = typographyFragementToTypographyControlData(useTypography((_a = value == null ? void 0 : value.id) != null ? _a : null));
3559
- const source = (_b = typography2 == null ? void 0 : typography2.style) != null ? _b : [];
3562
+ const typography = typographyFragementToTypographyControlData(useTypography((_a = value == null ? void 0 : value.id) != null ? _a : null));
3563
+ const source = (_b = typography == null ? void 0 : typography.style) != null ? _b : [];
3560
3564
  const override = (_c = value == null ? void 0 : value.style) != null ? _c : [];
3561
3565
  const breakpoints = useBreakpoints();
3562
3566
  const swatchIds = [
3563
3567
  ...getTypographyStyleSwatchIds(value == null ? void 0 : value.style),
3564
- ...getTypographyStyleSwatchIds(typography2 == null ? void 0 : typography2.style)
3568
+ ...getTypographyStyleSwatchIds(typography == null ? void 0 : typography.style)
3565
3569
  ];
3566
- const swatches = useSwatches(swatchIds).filter(isNonNullable);
3570
+ const swatches = useSwatches(swatchIds).filter(reactPage.isNonNullable);
3567
3571
  const enhancedSource = source.map(withColor(swatches));
3568
3572
  const enhancedOverride = override.map(withColor(swatches));
3569
3573
  const devices = [
@@ -3590,7 +3594,7 @@ function useEnhancedTypography(value) {
3590
3594
  };
3591
3595
  }
3592
3596
  return null;
3593
- }).filter(isNonNullable);
3597
+ }).filter(reactPage.isNonNullable);
3594
3598
  }
3595
3599
  function useTypographyClassName(value) {
3596
3600
  return reactPage.useStyle(useResponsiveStyle([value], ([value2]) => {
@@ -3632,31 +3636,31 @@ function ControlValue({
3632
3636
  control
3633
3637
  }) {
3634
3638
  switch (definition.type) {
3635
- case typography.CheckboxControlType:
3639
+ case textInput.CheckboxControlType:
3636
3640
  return /* @__PURE__ */ jsxRuntime.jsx(RenderHook, {
3637
3641
  hook: useCheckboxControlValue,
3638
3642
  parameters: [data, definition],
3639
3643
  children: (value) => children(value)
3640
3644
  }, definition.type);
3641
- case typography.NumberControlType:
3645
+ case textInput.NumberControlType:
3642
3646
  return /* @__PURE__ */ jsxRuntime.jsx(RenderHook, {
3643
3647
  hook: useNumber,
3644
3648
  parameters: [data, definition],
3645
3649
  children: (value) => children(value)
3646
3650
  }, definition.type);
3647
- case typography.TextInputControlType:
3651
+ case textInput.TextInputControlType:
3648
3652
  return /* @__PURE__ */ jsxRuntime.jsx(RenderHook, {
3649
3653
  hook: useTextInputValue,
3650
3654
  parameters: [data, definition],
3651
3655
  children: (value) => children(value)
3652
3656
  }, definition.type);
3653
- case typography.TextAreaControlType:
3657
+ case textInput.TextAreaControlType:
3654
3658
  return /* @__PURE__ */ jsxRuntime.jsx(RenderHook, {
3655
3659
  hook: useTextAreaValue,
3656
3660
  parameters: [data, definition],
3657
3661
  children: (value) => children(value)
3658
3662
  }, definition.type);
3659
- case typography.SelectControlType:
3663
+ case textInput.SelectControlType:
3660
3664
  return /* @__PURE__ */ jsxRuntime.jsx(RenderHook, {
3661
3665
  hook: useSelectControlValue,
3662
3666
  parameters: [data, definition],
@@ -3668,7 +3672,7 @@ function ControlValue({
3668
3672
  parameters: [data, definition],
3669
3673
  children: (value) => children(value)
3670
3674
  }, definition.type);
3671
- case typography.IconRadioGroupControlType:
3675
+ case textInput.IconRadioGroupControlType:
3672
3676
  return /* @__PURE__ */ jsxRuntime.jsx(RenderHook, {
3673
3677
  hook: useIconRadioGroupValue,
3674
3678
  parameters: [data, definition],
@@ -3737,7 +3741,7 @@ function ControlValue({
3737
3741
  parameters: [data, definition, control],
3738
3742
  children: (value) => children(value)
3739
3743
  }, definition.type);
3740
- case typography.TypographyControlType:
3744
+ case reactPage.TypographyControlType:
3741
3745
  return /* @__PURE__ */ jsxRuntime.jsx(RenderHook, {
3742
3746
  hook: useTypographyValue,
3743
3747
  parameters: [data],
@@ -3784,20 +3788,20 @@ function PropsValue({
3784
3788
  return Object.entries(propControllerDescriptorsRef.current).reduceRight((renderFn, [propName, descriptor]) => (propsValue) => {
3785
3789
  var _a2, _b, _c, _d;
3786
3790
  switch (descriptor.type) {
3787
- case typography.CheckboxControlType:
3788
- case typography.NumberControlType:
3789
- case typography.TextInputControlType:
3790
- case typography.TextAreaControlType:
3791
- case typography.SelectControlType:
3791
+ case textInput.CheckboxControlType:
3792
+ case textInput.NumberControlType:
3793
+ case textInput.TextInputControlType:
3794
+ case textInput.TextAreaControlType:
3795
+ case textInput.SelectControlType:
3792
3796
  case reactPage.ColorControlType:
3793
- case typography.IconRadioGroupControlType:
3797
+ case textInput.IconRadioGroupControlType:
3794
3798
  case reactPage.ImageControlType:
3795
3799
  case combobox.ComboboxControlType:
3796
3800
  case reactPage.ShapeControlType:
3797
3801
  case reactPage.ListControlType:
3798
3802
  case reactPage.LinkControlType:
3799
3803
  case reactPage.StyleV2ControlType:
3800
- case typography.TypographyControlType:
3804
+ case reactPage.TypographyControlType:
3801
3805
  return /* @__PURE__ */ jsxRuntime.jsx(ControlValue, {
3802
3806
  definition: descriptor,
3803
3807
  data: props[propName],
@@ -4328,6 +4332,7 @@ exports.forwardNextDynamicRef = forwardNextDynamicRef;
4328
4332
  exports.getServerSideProps = getServerSideProps;
4329
4333
  exports.getStaticPaths = getStaticPaths;
4330
4334
  exports.getStaticProps = getStaticProps;
4335
+ exports.isNonNullable = isNonNullable;
4331
4336
  exports.pollBoxModel = pollBoxModel;
4332
4337
  exports.shallowEqual = shallowEqual;
4333
4338
  exports.useBorder = useBorder;