@makeswift/runtime 0.2.18 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (235) hide show
  1. package/dist/Box.cjs.js +35 -70
  2. package/dist/Box.cjs.js.map +1 -1
  3. package/dist/Box.es.js +34 -65
  4. package/dist/Box.es.js.map +1 -1
  5. package/dist/Button.cjs.js +176 -208
  6. package/dist/Button.cjs.js.map +1 -1
  7. package/dist/Button.es.js +177 -208
  8. package/dist/Button.es.js.map +1 -1
  9. package/dist/Carousel.cjs.js +227 -249
  10. package/dist/Carousel.cjs.js.map +1 -1
  11. package/dist/Carousel.es.js +229 -247
  12. package/dist/Carousel.es.js.map +1 -1
  13. package/dist/Countdown.cjs.js +270 -203
  14. package/dist/Countdown.cjs.js.map +1 -1
  15. package/dist/Countdown.es.js +273 -202
  16. package/dist/Countdown.es.js.map +1 -1
  17. package/dist/Divider.cjs.js +50 -71
  18. package/dist/Divider.cjs.js.map +1 -1
  19. package/dist/Divider.es.js +51 -68
  20. package/dist/Divider.es.js.map +1 -1
  21. package/dist/Embed.cjs.js +6 -17
  22. package/dist/Embed.cjs.js.map +1 -1
  23. package/dist/Embed.es.js +7 -14
  24. package/dist/Embed.es.js.map +1 -1
  25. package/dist/Form.cjs.js +723 -553
  26. package/dist/Form.cjs.js.map +1 -1
  27. package/dist/Form.es.js +723 -552
  28. package/dist/Form.es.js.map +1 -1
  29. package/dist/Image.cjs.js +16 -38
  30. package/dist/Image.cjs.js.map +1 -1
  31. package/dist/Image.es.js +17 -38
  32. package/dist/Image.es.js.map +1 -1
  33. package/dist/Navigation.cjs.js +318 -224
  34. package/dist/Navigation.cjs.js.map +1 -1
  35. package/dist/Navigation.es.js +318 -220
  36. package/dist/Navigation.es.js.map +1 -1
  37. package/dist/Root.cjs.js +116 -78
  38. package/dist/Root.cjs.js.map +1 -1
  39. package/dist/Root.es.js +99 -77
  40. package/dist/Root.es.js.map +1 -1
  41. package/dist/SocialLinks.cjs.js +119 -86
  42. package/dist/SocialLinks.cjs.js.map +1 -1
  43. package/dist/SocialLinks.es.js +120 -83
  44. package/dist/SocialLinks.es.js.map +1 -1
  45. package/dist/Text.cjs.js +83 -99
  46. package/dist/Text.cjs.js.map +1 -1
  47. package/dist/Text.es.js +84 -99
  48. package/dist/Text.es.js.map +1 -1
  49. package/dist/Video.cjs.js +8 -19
  50. package/dist/Video.cjs.js.map +1 -1
  51. package/dist/Video.es.js +8 -18
  52. package/dist/Video.es.js.map +1 -1
  53. package/dist/actions.cjs.js +6 -1
  54. package/dist/actions.cjs.js.map +1 -1
  55. package/dist/actions.es.js +6 -2
  56. package/dist/actions.es.js.map +1 -1
  57. package/dist/components.cjs.js +6 -18
  58. package/dist/components.cjs.js.map +1 -1
  59. package/dist/components.es.js +5 -8
  60. package/dist/components.es.js.map +1 -1
  61. package/dist/controls.es.js +1 -1
  62. package/dist/grid-item.cjs.js +612 -0
  63. package/dist/grid-item.cjs.js.map +1 -0
  64. package/dist/grid-item.es.js +604 -0
  65. package/dist/grid-item.es.js.map +1 -0
  66. package/dist/index.cjs.js +592 -275
  67. package/dist/index.cjs.js.map +1 -1
  68. package/dist/index.cjs2.js +98 -474
  69. package/dist/index.cjs2.js.map +1 -1
  70. package/dist/index.cjs3.js +20 -107
  71. package/dist/index.cjs3.js.map +1 -1
  72. package/dist/index.es.js +587 -274
  73. package/dist/index.es.js.map +1 -1
  74. package/dist/index.es2.js +99 -473
  75. package/dist/index.es2.js.map +1 -1
  76. package/dist/index.es3.js +21 -103
  77. package/dist/index.es3.js.map +1 -1
  78. package/dist/next.cjs.js +1 -2
  79. package/dist/next.cjs.js.map +1 -1
  80. package/dist/next.es.js +2 -3
  81. package/dist/next.es.js.map +1 -1
  82. package/dist/react-builder-preview.cjs.js +16 -3
  83. package/dist/react-builder-preview.cjs.js.map +1 -1
  84. package/dist/react-builder-preview.es.js +19 -6
  85. package/dist/react-builder-preview.es.js.map +1 -1
  86. package/dist/react.cjs.js +1 -2
  87. package/dist/react.cjs.js.map +1 -1
  88. package/dist/react.es.js +1 -2
  89. package/dist/react.es.js.map +1 -1
  90. package/dist/slot.cjs.js +41 -6
  91. package/dist/slot.cjs.js.map +1 -1
  92. package/dist/slot.es.js +36 -6
  93. package/dist/slot.es.js.map +1 -1
  94. package/dist/types/src/components/builtin/Box/Box.d.ts +7 -7
  95. package/dist/types/src/components/builtin/Box/Box.d.ts.map +1 -1
  96. package/dist/types/src/components/builtin/Box/components/Placeholder/index.d.ts.map +1 -1
  97. package/dist/types/src/components/builtin/Box/register.d.ts.map +1 -1
  98. package/dist/types/src/components/builtin/Button/Button.d.ts +46 -34
  99. package/dist/types/src/components/builtin/Button/Button.d.ts.map +1 -1
  100. package/dist/types/src/components/builtin/Carousel/Carousel.d.ts +5 -5
  101. package/dist/types/src/components/builtin/Carousel/Carousel.d.ts.map +1 -1
  102. package/dist/types/src/components/builtin/Carousel/register.d.ts.map +1 -1
  103. package/dist/types/src/components/builtin/Countdown/Countdown.d.ts +3 -3
  104. package/dist/types/src/components/builtin/Countdown/Countdown.d.ts.map +1 -1
  105. package/dist/types/src/components/builtin/Countdown/register.d.ts.map +1 -1
  106. package/dist/types/src/components/builtin/Divider/Divider.d.ts +3 -3
  107. package/dist/types/src/components/builtin/Divider/Divider.d.ts.map +1 -1
  108. package/dist/types/src/components/builtin/Divider/register.d.ts.map +1 -1
  109. package/dist/types/src/components/builtin/Embed/Embed.d.ts +3 -3
  110. package/dist/types/src/components/builtin/Embed/Embed.d.ts.map +1 -1
  111. package/dist/types/src/components/builtin/Form/Form.d.ts +3 -3
  112. package/dist/types/src/components/builtin/Form/Form.d.ts.map +1 -1
  113. package/dist/types/src/components/builtin/Form/components/Field/components/Checkbox/index.d.ts +4 -6
  114. package/dist/types/src/components/builtin/Form/components/Field/components/Checkbox/index.d.ts.map +1 -1
  115. package/dist/types/src/components/builtin/Form/components/Field/components/CheckboxTableField/index.d.ts +3 -0
  116. package/dist/types/src/components/builtin/Form/components/Field/components/CheckboxTableField/index.d.ts.map +1 -1
  117. package/dist/types/src/components/builtin/Form/components/Field/components/EmailTableField/index.d.ts +2 -0
  118. package/dist/types/src/components/builtin/Form/components/Field/components/EmailTableField/index.d.ts.map +1 -1
  119. package/dist/types/src/components/builtin/Form/components/Field/components/Input/index.d.ts +3 -7
  120. package/dist/types/src/components/builtin/Form/components/Field/components/Input/index.d.ts.map +1 -1
  121. package/dist/types/src/components/builtin/Form/components/Field/components/Label/index.d.ts +7 -13
  122. package/dist/types/src/components/builtin/Form/components/Field/components/Label/index.d.ts.map +1 -1
  123. package/dist/types/src/components/builtin/Form/components/Field/components/LongTextTableField/index.d.ts +2 -0
  124. package/dist/types/src/components/builtin/Form/components/Field/components/LongTextTableField/index.d.ts.map +1 -1
  125. package/dist/types/src/components/builtin/Form/components/Field/components/MultipleSelectTableField/index.d.ts.map +1 -1
  126. package/dist/types/src/components/builtin/Form/components/Field/components/NumberTableField/index.d.ts +2 -0
  127. package/dist/types/src/components/builtin/Form/components/Field/components/NumberTableField/index.d.ts.map +1 -1
  128. package/dist/types/src/components/builtin/Form/components/Field/components/PhoneNumberTableField/index.d.ts +2 -0
  129. package/dist/types/src/components/builtin/Form/components/Field/components/PhoneNumberTableField/index.d.ts.map +1 -1
  130. package/dist/types/src/components/builtin/Form/components/Field/components/PlaceholderTableField/index.d.ts.map +1 -1
  131. package/dist/types/src/components/builtin/Form/components/Field/components/RadioButton/index.d.ts +4 -8
  132. package/dist/types/src/components/builtin/Form/components/Field/components/RadioButton/index.d.ts.map +1 -1
  133. package/dist/types/src/components/builtin/Form/components/Field/components/SingleLineTextTableField/index.d.ts +2 -0
  134. package/dist/types/src/components/builtin/Form/components/Field/components/SingleLineTextTableField/index.d.ts.map +1 -1
  135. package/dist/types/src/components/builtin/Form/components/Field/components/SingleSelectTableField/components/TableColumnRadioButtonGroup/index.d.ts.map +1 -1
  136. package/dist/types/src/components/builtin/Form/components/Field/components/SingleSelectTableField/components/TableColumnSingleSelect/index.d.ts.map +1 -1
  137. package/dist/types/src/components/builtin/Form/components/Field/components/TextArea/index.d.ts +2 -7
  138. package/dist/types/src/components/builtin/Form/components/Field/components/TextArea/index.d.ts.map +1 -1
  139. package/dist/types/src/components/builtin/Form/components/Field/components/URLTableField/index.d.ts +2 -0
  140. package/dist/types/src/components/builtin/Form/components/Field/components/URLTableField/index.d.ts.map +1 -1
  141. package/dist/types/src/components/builtin/Form/components/Field/services/{cssField.d.ts → responsiveField.d.ts} +5 -4
  142. package/dist/types/src/components/builtin/Form/components/Field/services/responsiveField.d.ts.map +1 -0
  143. package/dist/types/src/components/builtin/Form/components/Placeholder/index.d.ts +2 -3
  144. package/dist/types/src/components/builtin/Form/components/Placeholder/index.d.ts.map +1 -1
  145. package/dist/types/src/components/builtin/Form/components/Spinner/index.d.ts.map +1 -1
  146. package/dist/types/src/components/builtin/Form/register.d.ts.map +1 -1
  147. package/dist/types/src/components/builtin/Image/Image.d.ts +7 -7
  148. package/dist/types/src/components/builtin/Image/Image.d.ts.map +1 -1
  149. package/dist/types/src/components/builtin/Navigation/Navigation.d.ts +3 -3
  150. package/dist/types/src/components/builtin/Navigation/Navigation.d.ts.map +1 -1
  151. package/dist/types/src/components/builtin/Navigation/components/DropDownButton/index.d.ts +8 -81
  152. package/dist/types/src/components/builtin/Navigation/components/DropDownButton/index.d.ts.map +1 -1
  153. package/dist/types/src/components/builtin/Navigation/components/LinksPlaceholder/index.d.ts.map +1 -1
  154. package/dist/types/src/components/builtin/Navigation/components/MobileMenu/components/MobileDropDownButton/index.d.ts +8 -81
  155. package/dist/types/src/components/builtin/Navigation/components/MobileMenu/components/MobileDropDownButton/index.d.ts.map +1 -1
  156. package/dist/types/src/components/builtin/Navigation/components/MobileMenu/index.d.ts.map +1 -1
  157. package/dist/types/src/components/builtin/Navigation/register.d.ts.map +1 -1
  158. package/dist/types/src/components/builtin/Root/Root.d.ts +1 -2
  159. package/dist/types/src/components/builtin/Root/Root.d.ts.map +1 -1
  160. package/dist/types/src/components/builtin/Root/components/Placeholder/index.d.ts +1 -2
  161. package/dist/types/src/components/builtin/Root/components/Placeholder/index.d.ts.map +1 -1
  162. package/dist/types/src/components/builtin/SocialLinks/SocialLinks.d.ts +3 -3
  163. package/dist/types/src/components/builtin/SocialLinks/SocialLinks.d.ts.map +1 -1
  164. package/dist/types/src/components/builtin/SocialLinks/components/SocialLinksPlaceholder/index.d.ts.map +1 -1
  165. package/dist/types/src/components/builtin/SocialLinks/register.d.ts.map +1 -1
  166. package/dist/types/src/components/builtin/Text/Text.d.ts +3 -3
  167. package/dist/types/src/components/builtin/Text/Text.d.ts.map +1 -1
  168. package/dist/types/src/components/builtin/Text/components/RichTextEditor/components/Block/index.d.ts +8 -11
  169. package/dist/types/src/components/builtin/Text/components/RichTextEditor/components/Block/index.d.ts.map +1 -1
  170. package/dist/types/src/components/builtin/Text/components/RichTextEditor/components/Mark/index.d.ts +3 -6
  171. package/dist/types/src/components/builtin/Text/components/RichTextEditor/components/Mark/index.d.ts.map +1 -1
  172. package/dist/types/src/components/builtin/Text/components/RichTextEditor/index.d.ts +1 -1
  173. package/dist/types/src/components/builtin/Text/components/RichTextEditor/index.d.ts.map +1 -1
  174. package/dist/types/src/components/builtin/Text/components/RichTextEditor/plugins/Link.d.ts.map +1 -1
  175. package/dist/types/src/components/builtin/Text/register.d.ts.map +1 -1
  176. package/dist/types/src/components/builtin/Video/Video.d.ts +4 -4
  177. package/dist/types/src/components/builtin/Video/Video.d.ts.map +1 -1
  178. package/dist/types/src/components/builtin/Video/register.d.ts.map +1 -1
  179. package/dist/types/src/components/hooks/useBackgrounds.d.ts +1 -1
  180. package/dist/types/src/components/hooks/useBackgrounds.d.ts.map +1 -1
  181. package/dist/types/src/components/index.d.ts +0 -1
  182. package/dist/types/src/components/index.d.ts.map +1 -1
  183. package/dist/types/src/components/shared/BackgroundsContainer/components/BackgroundVideo/index.d.ts.map +1 -1
  184. package/dist/types/src/components/shared/BackgroundsContainer/components/Backgrounds/index.d.ts.map +1 -1
  185. package/dist/types/src/components/shared/BackgroundsContainer/index.d.ts +255 -4
  186. package/dist/types/src/components/shared/BackgroundsContainer/index.d.ts.map +1 -1
  187. package/dist/types/src/components/shared/FallbackComponent/FallbackComponent.d.ts.map +1 -1
  188. package/dist/types/src/components/shared/GutterContainer/index.d.ts +8 -4
  189. package/dist/types/src/components/shared/GutterContainer/index.d.ts.map +1 -1
  190. package/dist/types/src/components/shared/grid-item.d.ts +17 -0
  191. package/dist/types/src/components/shared/grid-item.d.ts.map +1 -0
  192. package/dist/types/src/components/utils/responsive-style.d.ts +22 -1
  193. package/dist/types/src/components/utils/responsive-style.d.ts.map +1 -1
  194. package/dist/types/src/controls/style.d.ts +5 -65
  195. package/dist/types/src/controls/style.d.ts.map +1 -1
  196. package/dist/types/src/css/border-radius.d.ts +20 -0
  197. package/dist/types/src/css/border-radius.d.ts.map +1 -0
  198. package/dist/types/src/css/border.d.ts +31 -0
  199. package/dist/types/src/css/border.d.ts.map +1 -0
  200. package/dist/types/src/css/length-percentage.d.ts +10 -0
  201. package/dist/types/src/css/length-percentage.d.ts.map +1 -0
  202. package/dist/types/src/css/length.d.ts +14 -0
  203. package/dist/types/src/css/length.d.ts.map +1 -0
  204. package/dist/types/src/css/margin.d.ts +20 -0
  205. package/dist/types/src/css/margin.d.ts.map +1 -0
  206. package/dist/types/src/css/padding.d.ts +20 -0
  207. package/dist/types/src/css/padding.d.ts.map +1 -0
  208. package/dist/types/src/next/document.d.ts.map +1 -1
  209. package/dist/types/src/prop-controllers/descriptors.d.ts +96 -33
  210. package/dist/types/src/prop-controllers/descriptors.d.ts.map +1 -1
  211. package/dist/types/src/runtimes/react/controls/style.d.ts.map +1 -1
  212. package/dist/types/src/runtimes/react/controls.d.ts +10 -2
  213. package/dist/types/src/runtimes/react/controls.d.ts.map +1 -1
  214. package/dist/types/src/runtimes/react/use-global-style.d.ts +3 -0
  215. package/dist/types/src/runtimes/react/use-global-style.d.ts.map +1 -0
  216. package/dist/types/src/state/actions.d.ts +13 -1
  217. package/dist/types/src/state/actions.d.ts.map +1 -1
  218. package/dist/types/src/state/react-builder-preview.d.ts.map +1 -1
  219. package/dist/useMediaQuery.es.js +1 -1
  220. package/package.json +1 -3
  221. package/dist/cssMediaRules.cjs.js +0 -210
  222. package/dist/cssMediaRules.cjs.js.map +0 -1
  223. package/dist/cssMediaRules.es.js +0 -201
  224. package/dist/cssMediaRules.es.js.map +0 -1
  225. package/dist/index.cjs4.js +0 -18
  226. package/dist/index.cjs4.js.map +0 -1
  227. package/dist/index.es4.js +0 -13
  228. package/dist/index.es4.js.map +0 -1
  229. package/dist/types/src/components/builtin/Form/components/Field/services/cssField.d.ts.map +0 -1
  230. package/dist/types/src/components/utils/cssMediaRules.d.ts +0 -69
  231. package/dist/types/src/components/utils/cssMediaRules.d.ts.map +0 -1
  232. package/dist/useBoxShadow.cjs.js +0 -78
  233. package/dist/useBoxShadow.cjs.js.map +0 -1
  234. package/dist/useBoxShadow.es.js +0 -77
  235. package/dist/useBoxShadow.es.js.map +0 -1
package/dist/index.cjs.js CHANGED
@@ -35,7 +35,7 @@ var __publicField = (obj, key, value) => {
35
35
  __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
36
36
  return value;
37
37
  };
38
- var _e;
38
+ var _c;
39
39
  var React = require("react");
40
40
  var withSelector = require("use-sync-external-store/shim/with-selector");
41
41
  var reactPage = require("./react-page.cjs.js");
@@ -48,10 +48,9 @@ var graphql = require("./graphql.cjs.js");
48
48
  var slot = require("./slot.cjs.js");
49
49
  var control = require("./control.cjs.js");
50
50
  var jsxRuntime = require("react/jsx-runtime");
51
- var styled = require("styled-components");
51
+ var css = require("@emotion/css");
52
52
  var textInput = require("./text-input.cjs.js");
53
53
  var combobox = require("./combobox.cjs.js");
54
- var css = require("@emotion/css");
55
54
  var ColorHelper = require("color");
56
55
  var scrollIntoView = require("scroll-into-view-if-needed");
57
56
  var boxModels = require("./box-models.cjs.js");
@@ -91,7 +90,6 @@ function _interopNamespace(e) {
91
90
  }
92
91
  var React__namespace = /* @__PURE__ */ _interopNamespace(React);
93
92
  var dynamic__default = /* @__PURE__ */ _interopDefaultLegacy(dynamic);
94
- var styled__default = /* @__PURE__ */ _interopDefaultLegacy(styled);
95
93
  var ColorHelper__default = /* @__PURE__ */ _interopDefaultLegacy(ColorHelper);
96
94
  var scrollIntoView__default = /* @__PURE__ */ _interopDefaultLegacy(scrollIntoView);
97
95
  var parse__default = /* @__PURE__ */ _interopDefaultLegacy(parse);
@@ -320,7 +318,7 @@ const INTROSPECTION_QUERY = client.gql`
320
318
  ${TYPOGRAPHY_FRAGMENT}
321
319
  `;
322
320
  async function introspect(element, client2, store) {
323
- var _a, _b, _c;
321
+ var _a, _b, _c2;
324
322
  const descriptors = reactPage.getPropControllerDescriptors(store.getState());
325
323
  const swatchIds = /* @__PURE__ */ new Set();
326
324
  const fileIds = /* @__PURE__ */ new Set();
@@ -392,7 +390,7 @@ async function introspect(element, client2, store) {
392
390
  query: TYPOGRAPHIES_BY_ID,
393
391
  variables: { ids: [...typographyIds] }
394
392
  });
395
- (_c = typographiesResult == null ? void 0 : typographiesResult.data) == null ? void 0 : _c.typographies.forEach((typography) => {
393
+ (_c2 = typographiesResult == null ? void 0 : typographiesResult.data) == null ? void 0 : _c2.typographies.forEach((typography) => {
396
394
  typography == null ? void 0 : typography.style.forEach((style) => {
397
395
  var _a2;
398
396
  const swatchId = (_a2 = style.value.color) == null ? void 0 : _a2.swatchId;
@@ -963,34 +961,25 @@ if (originalUrl.searchParams.has(searchParamName)) {
963
961
  }
964
962
  class Document$1 extends NextDocument__default["default"] {
965
963
  static async getInitialProps(ctx) {
966
- const sheet = new styled.ServerStyleSheet();
967
- const originalRenderPage = ctx.renderPage;
968
- try {
969
- ctx.renderPage = () => originalRenderPage({
970
- enhanceApp: (App) => (props) => sheet.collectStyles(/* @__PURE__ */ jsxRuntime.jsx(App, __spreadValues({}, props)))
971
- });
972
- const initialProps = await NextDocument__default["default"].getInitialProps(ctx);
973
- slate.KeyUtils.resetGenerator();
974
- const {
975
- extractCritical
976
- } = createEmotionServer__default["default"](css.cache);
977
- const {
978
- ids,
979
- css: css$1
980
- } = extractCritical(initialProps.html);
981
- return __spreadProps(__spreadValues({}, initialProps), {
982
- styles: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, {
983
- children: [initialProps.styles, sheet.getStyleElement(), /* @__PURE__ */ jsxRuntime.jsx("style", {
984
- "data-emotion": `css ${ids.join(" ")}`,
985
- dangerouslySetInnerHTML: {
986
- __html: css$1
987
- }
988
- })]
989
- })
990
- });
991
- } finally {
992
- sheet.seal();
993
- }
964
+ const initialProps = await NextDocument__default["default"].getInitialProps(ctx);
965
+ slate.KeyUtils.resetGenerator();
966
+ const {
967
+ extractCritical
968
+ } = createEmotionServer__default["default"](css.cache);
969
+ const {
970
+ ids,
971
+ css: css$1
972
+ } = extractCritical(initialProps.html);
973
+ return __spreadProps(__spreadValues({}, initialProps), {
974
+ styles: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, {
975
+ children: [initialProps.styles, /* @__PURE__ */ jsxRuntime.jsx("style", {
976
+ "data-emotion": `css ${ids.join(" ")}`,
977
+ dangerouslySetInnerHTML: {
978
+ __html: css$1
979
+ }
980
+ })]
981
+ })
982
+ });
994
983
  }
995
984
  render() {
996
985
  const {
@@ -1007,7 +996,7 @@ class Document$1 extends NextDocument__default["default"] {
1007
996
  });
1008
997
  }
1009
998
  }
1010
- const version = "0.2.18";
999
+ const version = "0.3.0";
1011
1000
  function isErrorWithMessage(error) {
1012
1001
  return typeof error === "object" && error !== null && "message" in error && typeof error.message === "string";
1013
1002
  }
@@ -1197,14 +1186,14 @@ async function getStaticPaths() {
1197
1186
  }
1198
1187
  const REVALIDATE_SECONDS = 1;
1199
1188
  async function getStaticProps(ctx) {
1200
- var _a, _b, _c;
1189
+ var _a, _b, _c2;
1201
1190
  deprecationWarning("getStaticProps");
1202
1191
  const makeswift = new Makeswift(getApiKey(), {
1203
1192
  apiOrigin: getApiOrigin()
1204
1193
  });
1205
1194
  const path = "/" + ((_b = (_a = ctx.params) == null ? void 0 : _a.path) != null ? _b : []).join("/");
1206
1195
  const snapshot = await makeswift.getPageSnapshot(path, {
1207
- preview: ((_c = ctx.previewData) == null ? void 0 : _c.makeswift) === true
1196
+ preview: ((_c2 = ctx.previewData) == null ? void 0 : _c2.makeswift) === true
1208
1197
  });
1209
1198
  if (snapshot == null)
1210
1199
  return {
@@ -1357,7 +1346,7 @@ function registerComponent$c(runtime) {
1357
1346
  props: {
1358
1347
  id: slot.ElementID(),
1359
1348
  backgrounds: slot.Backgrounds(),
1360
- width: slot.Width(),
1349
+ width: slot.Width({ format: slot.Width.Format.ClassName }),
1361
1350
  height: slot.ResponsiveIconRadioGroup({
1362
1351
  label: "Height",
1363
1352
  options: [
@@ -1380,8 +1369,9 @@ function registerComponent$c(runtime) {
1380
1369
  ],
1381
1370
  defaultValue: "flex-start"
1382
1371
  }),
1383
- margin: slot.Margin(),
1372
+ margin: slot.Margin({ format: slot.Margin.Format.ClassName }),
1384
1373
  padding: slot.Padding({
1374
+ format: slot.Padding.Format.ClassName,
1385
1375
  preset: [
1386
1376
  {
1387
1377
  deviceId: "desktop",
@@ -1394,9 +1384,9 @@ function registerComponent$c(runtime) {
1394
1384
  }
1395
1385
  ]
1396
1386
  }),
1397
- border: slot.Border(),
1398
- borderRadius: slot.BorderRadius(),
1399
- boxShadow: slot.Shadows(),
1387
+ border: slot.Border({ format: slot.Border.Format.ClassName }),
1388
+ borderRadius: slot.BorderRadius({ format: slot.BorderRadius.Format.ClassName }),
1389
+ boxShadow: slot.Shadows({ format: slot.Shadows.Format.ClassName }),
1400
1390
  rowGap: slot.GapY((props) => ({
1401
1391
  hidden: props.children == null
1402
1392
  })),
@@ -1545,7 +1535,7 @@ function registerComponent$b(runtime) {
1545
1535
  }),
1546
1536
  textStyle: slot.TextStyle(),
1547
1537
  width: slot.Width(),
1548
- margin: slot.Margin()
1538
+ margin: slot.Margin({ format: slot.Margin.Format.ClassName })
1549
1539
  }
1550
1540
  });
1551
1541
  }
@@ -1565,8 +1555,11 @@ function registerComponent$a(runtime) {
1565
1555
  { key: uuid__default["default"](), props: {} }
1566
1556
  ]
1567
1557
  }),
1568
- width: slot.Width({ defaultValue: { value: 400, unit: "px" } }),
1569
- margin: slot.Margin(),
1558
+ width: slot.Width({
1559
+ format: slot.Width.Format.ClassName,
1560
+ defaultValue: { value: 400, unit: "px" }
1561
+ }),
1562
+ margin: slot.Margin({ format: slot.Margin.Format.ClassName }),
1570
1563
  pageSize: slot.ResponsiveNumber((props) => {
1571
1564
  var _a;
1572
1565
  const images = props.images;
@@ -1641,8 +1634,8 @@ function registerComponent$a(runtime) {
1641
1634
  placeholder: "black",
1642
1635
  hidden: props.showDots === false
1643
1636
  })),
1644
- slideBorder: slot.Border(),
1645
- slideBorderRadius: slot.BorderRadius()
1637
+ slideBorder: slot.Border({ format: slot.Border.Format.ClassName }),
1638
+ slideBorderRadius: slot.BorderRadius({ format: slot.BorderRadius.Format.ClassName })
1646
1639
  }
1647
1640
  });
1648
1641
  }
@@ -1717,8 +1710,11 @@ function registerComponent$9(runtime) {
1717
1710
  label: "Label color",
1718
1711
  placeholder: "black"
1719
1712
  }),
1720
- width: slot.Width({ defaultValue: { value: 560, unit: "px" } }),
1721
- margin: slot.Margin(),
1713
+ width: slot.Width({
1714
+ format: slot.Width.Format.ClassName,
1715
+ defaultValue: { value: 560, unit: "px" }
1716
+ }),
1717
+ margin: slot.Margin({ format: slot.Margin.Format.ClassName }),
1722
1718
  daysLabel: slot.TextInput({ label: "Days label", placeholder: "Days" }),
1723
1719
  hoursLabel: slot.TextInput({ label: "Hours label", placeholder: "Hours" }),
1724
1720
  minutesLabel: slot.TextInput({
@@ -1758,8 +1754,11 @@ function registerComponent$8(runtime) {
1758
1754
  options: [{ value: "px", label: "Pixels", icon: "Px16" }]
1759
1755
  }),
1760
1756
  color: slot.ResponsiveColor({ placeholder: "black" }),
1761
- width: slot.Width({ defaultValue: { value: 100, unit: "%" } }),
1762
- margin: slot.Margin()
1757
+ width: slot.Width({
1758
+ format: slot.Width.Format.ClassName,
1759
+ defaultValue: { value: 100, unit: "%" }
1760
+ }),
1761
+ margin: slot.Margin({ format: slot.Margin.Format.ClassName })
1763
1762
  }
1764
1763
  });
1765
1764
  }
@@ -1773,8 +1772,8 @@ function registerComponent$7(runtime) {
1773
1772
  props: {
1774
1773
  id: slot.ElementID(),
1775
1774
  html: slot.TextArea({ label: "Code", rows: 20 }),
1776
- width: slot.Width({}),
1777
- margin: slot.Margin()
1775
+ width: slot.Width({ format: slot.Width.Format.ClassName }),
1776
+ margin: slot.Margin({ format: slot.Margin.Format.ClassName })
1778
1777
  }
1779
1778
  });
1780
1779
  }
@@ -1913,9 +1912,10 @@ function registerComponent$6(runtime) {
1913
1912
  })),
1914
1913
  width: slot.Width({
1915
1914
  preset: [{ deviceId: "desktop", value: { value: 550, unit: "px" } }],
1916
- defaultValue: { value: 100, unit: "%" }
1915
+ defaultValue: { value: 100, unit: "%" },
1916
+ format: slot.Width.Format.ClassName
1917
1917
  }),
1918
- margin: slot.Margin()
1918
+ margin: slot.Margin({ format: slot.Margin.Format.ClassName })
1919
1919
  }
1920
1920
  });
1921
1921
  }
@@ -1931,11 +1931,11 @@ function registerComponent$5(runtime) {
1931
1931
  altText: slot.TextInput({ label: "Alt text" }),
1932
1932
  link: slot.Link({ label: "On click" }),
1933
1933
  width: slot.Width(),
1934
- margin: slot.Margin(),
1935
- padding: slot.Padding(),
1936
- border: slot.Border(),
1937
- borderRadius: slot.BorderRadius(),
1938
- boxShadow: slot.Shadows(),
1934
+ margin: slot.Margin({ format: slot.Margin.Format.ClassName }),
1935
+ padding: slot.Padding({ format: slot.Padding.Format.ClassName }),
1936
+ border: slot.Border({ format: slot.Border.Format.ClassName }),
1937
+ borderRadius: slot.BorderRadius({ format: slot.BorderRadius.Format.ClassName }),
1938
+ boxShadow: slot.Shadows({ format: slot.Shadows.Format.ClassName }),
1939
1939
  opacity: slot.ResponsiveOpacity()
1940
1940
  }
1941
1941
  });
@@ -2029,8 +2029,11 @@ function registerComponent$4(runtime) {
2029
2029
  hidden
2030
2030
  };
2031
2031
  }),
2032
- width: slot.Width({ defaultValue: { value: 100, unit: "%" } }),
2033
- margin: slot.Margin()
2032
+ width: slot.Width({
2033
+ format: slot.Width.Format.ClassName,
2034
+ defaultValue: { value: 100, unit: "%" }
2035
+ }),
2036
+ margin: slot.Margin({ format: slot.Margin.Format.ClassName })
2034
2037
  }
2035
2038
  });
2036
2039
  }
@@ -2153,8 +2156,12 @@ function registerComponent$2(runtime) {
2153
2156
  step: 1,
2154
2157
  defaultValue: { value: 0, unit: "px" }
2155
2158
  }),
2156
- width: slot.Width({ defaultValue: { value: 100, unit: "%" } }),
2159
+ width: slot.Width({
2160
+ format: slot.Width.Format.ClassName,
2161
+ defaultValue: { value: 100, unit: "%" }
2162
+ }),
2157
2163
  margin: slot.Margin({
2164
+ format: slot.Margin.Format.ClassName,
2158
2165
  preset: [
2159
2166
  {
2160
2167
  deviceId: "desktop",
@@ -2222,10 +2229,12 @@ function registerComponent$1(runtime) {
2222
2229
  }
2223
2230
  })),
2224
2231
  width: slot.Width({
2232
+ format: slot.Width.Format.ClassName,
2225
2233
  preset: [{ deviceId: "desktop", value: { value: 700, unit: "px" } }],
2226
2234
  defaultValue: { value: 100, unit: "%" }
2227
2235
  }),
2228
2236
  margin: slot.Margin({
2237
+ format: slot.Margin.Format.ClassName,
2229
2238
  preset: [
2230
2239
  {
2231
2240
  deviceId: "desktop",
@@ -2251,9 +2260,12 @@ function registerComponent(runtime) {
2251
2260
  props: {
2252
2261
  id: slot.ElementID(),
2253
2262
  video: slot.Video({ preset: { controls: true } }),
2254
- width: slot.Width({ defaultValue: { value: 560, unit: "px" } }),
2255
- margin: slot.Margin(),
2256
- borderRadius: slot.BorderRadius()
2263
+ width: slot.Width({
2264
+ format: slot.Width.Format.ClassName,
2265
+ defaultValue: { value: 560, unit: "px" }
2266
+ }),
2267
+ margin: slot.Margin({ format: slot.Margin.Format.ClassName }),
2268
+ borderRadius: slot.BorderRadius({ format: slot.BorderRadius.Format.ClassName })
2257
2269
  }
2258
2270
  });
2259
2271
  }
@@ -2288,149 +2300,6 @@ function registerBuiltinComponents(runtime) {
2288
2300
  unregisterVideoComponent();
2289
2301
  };
2290
2302
  }
2291
- var _path;
2292
- function _extends() {
2293
- _extends = Object.assign || function(target) {
2294
- for (var i = 1; i < arguments.length; i++) {
2295
- var source = arguments[i];
2296
- for (var key in source) {
2297
- if (Object.prototype.hasOwnProperty.call(source, key)) {
2298
- target[key] = source[key];
2299
- }
2300
- }
2301
- }
2302
- return target;
2303
- };
2304
- return _extends.apply(this, arguments);
2305
- }
2306
- var SvgWarning20 = function SvgWarning202(props) {
2307
- return /* @__PURE__ */ React__namespace.createElement("svg", _extends({
2308
- width: 20,
2309
- height: 20,
2310
- viewBox: "0 0 20 20",
2311
- xmlns: "http://www.w3.org/2000/svg"
2312
- }, props), _path || (_path = /* @__PURE__ */ React__namespace.createElement("path", {
2313
- fillRule: "evenodd",
2314
- clipRule: "evenodd",
2315
- d: "M2.89864 18H17.1014C18.4183 18 19.2633 16.6003 18.65 15.4349L11.5486 1.94236C10.8925 0.69577 9.10749 0.695766 8.45139 1.94236L1.35003 15.4349C0.736692 16.6003 1.58174 18 2.89864 18ZM9 6C9 5.44772 9.44771 5 10 5C10.5523 5 11 5.44772 11 6V11C11 11.5523 10.5523 12 10 12C9.44771 12 9 11.5523 9 11V6ZM11.25 14.75C11.25 15.4404 10.6904 16 10 16C9.30964 16 8.75 15.4404 8.75 14.75C8.75 14.0596 9.30964 13.5 10 13.5C10.6904 13.5 11.25 14.0596 11.25 14.75Z"
2316
- })));
2317
- };
2318
- const ErrorDiv = styled__default["default"]("div")`
2319
- width: 100%;
2320
- height: 54px;
2321
- background-color: #fcedf2;
2322
- border-radius: 6px;
2323
- padding: 16px;
2324
- display: flex;
2325
- align-items: center;
2326
- gap: 8px;
2327
- color: #c73e6d;
2328
- fill: currentColor;
2329
- font-family: Heebo, sans-serif;
2330
- font-size: 16px;
2331
- `;
2332
- const FallbackComponent = React.forwardRef(function FallbackComponent2({
2333
- text
2334
- }, ref) {
2335
- return /* @__PURE__ */ jsxRuntime.jsxs(ErrorDiv, {
2336
- ref,
2337
- children: [/* @__PURE__ */ jsxRuntime.jsx(SvgWarning20, {}), /* @__PURE__ */ jsxRuntime.jsx("span", {
2338
- children: text
2339
- })]
2340
- });
2341
- });
2342
- function isNonNullable(value) {
2343
- return value != null;
2344
- }
2345
- function mapSideColor(swatches, _c) {
2346
- var _d = _c, { color } = _d, restOfSide = __objRest(_d, ["color"]);
2347
- return __spreadProps(__spreadValues({}, restOfSide), {
2348
- color: color && {
2349
- alpha: color.alpha,
2350
- swatch: swatches.find((s) => s && s.id === color.swatchId)
2351
- }
2352
- });
2353
- }
2354
- function useBorder(value) {
2355
- const swatchIds = value == null ? [] : [
2356
- ...Array.from(new Set(value.map(({ value: { borderTop, borderLeft, borderBottom, borderRight } }) => [
2357
- borderTop && borderTop.color && borderTop.color.swatchId,
2358
- borderBottom && borderBottom.color && borderBottom.color.swatchId,
2359
- borderLeft && borderLeft.color && borderLeft.color.swatchId,
2360
- borderRight && borderRight.color && borderRight.color.swatchId
2361
- ]).reduce((a, b) => a.concat(b)).filter(isNonNullable)))
2362
- ];
2363
- const skip = value == null || swatchIds.length === 0;
2364
- const { error, data = {} } = useQuery(SWATCHES_BY_ID, { skip, variables: { ids: swatchIds } });
2365
- if (value == null || error != null)
2366
- return null;
2367
- const { swatches = [] } = data;
2368
- return value.map((_a) => {
2369
- var _b = _a, { value: { borderTop, borderBottom, borderLeft, borderRight } } = _b, rest = __objRest(_b, ["value"]);
2370
- return __spreadProps(__spreadValues({}, rest), {
2371
- value: {
2372
- borderTop: borderTop && mapSideColor(swatches, borderTop),
2373
- borderBottom: borderBottom && mapSideColor(swatches, borderBottom),
2374
- borderLeft: borderLeft && mapSideColor(swatches, borderLeft),
2375
- borderRight: borderRight && mapSideColor(swatches, borderRight)
2376
- }
2377
- });
2378
- });
2379
- }
2380
- function useResponsiveColor(color) {
2381
- const swatchIds = color == null ? [] : [...Array.from(new Set(color.map(({ value: v }) => v && v.swatchId).filter(isNonNullable)))];
2382
- const skip = swatchIds.length === 0;
2383
- const { error, data = {} } = useQuery(SWATCHES_BY_ID, { skip, variables: { ids: swatchIds } });
2384
- if (color == null || error != null)
2385
- return null;
2386
- const { swatches = [] } = data;
2387
- return color.map((_a) => {
2388
- var _b = _a, { value: v } = _b, rest = __objRest(_b, ["value"]);
2389
- const { swatchId, alpha } = v;
2390
- const swatch = swatches.find((s) => s && s.id === swatchId);
2391
- return swatch == null ? null : __spreadProps(__spreadValues({}, rest), { value: { swatch, alpha } });
2392
- }).filter(isNonNullable);
2393
- }
2394
- function useFile(fileId) {
2395
- const { error, data = {} } = useQuery(FILE_BY_ID, {
2396
- skip: fileId == null,
2397
- variables: { id: fileId }
2398
- });
2399
- if (fileId == null || error != null)
2400
- return null;
2401
- return data.file;
2402
- }
2403
- const isSSR = typeof window === "undefined" || /ServerSideRendering/.test(window.navigator && window.navigator.userAgent);
2404
- const useIsomorphicLayoutEffect = isSSR ? React.useEffect : React.useLayoutEffect;
2405
- function usePage(pageId) {
2406
- const { error, data = {} } = useQuery(PAGE_PATHNAMES_BY_ID, {
2407
- skip: pageId == null,
2408
- variables: { ids: [pageId] }
2409
- });
2410
- if (pageId == null || error != null)
2411
- return null;
2412
- const { pagePathnamesById: [page] = [] } = data;
2413
- return page;
2414
- }
2415
- function responsiveStyle(responsiveValues, join$1, strategy) {
2416
- return join(responsiveValues, join$1, strategy).reduce((acc, { deviceId, value }) => {
2417
- const device = getDevice(deviceId);
2418
- const mediaQuery = getDeviceMediaQuery(device);
2419
- return __spreadProps(__spreadValues({}, acc), {
2420
- [mediaQuery]: __spreadValues(__spreadValues({}, acc[mediaQuery]), value)
2421
- });
2422
- }, {});
2423
- }
2424
- function responsiveWidth(widthData, defaultValue = "100%") {
2425
- return __spreadValues({
2426
- maxWidth: "100%"
2427
- }, responsiveStyle([widthData], ([width = defaultValue]) => ({
2428
- width: typeof width === "object" ? `${width.value}${width.unit}` : width
2429
- })));
2430
- }
2431
- function colorToString(color) {
2432
- return color && color.swatch ? `hsla(${color.swatch.hue},${color.swatch.saturation}%,${color.swatch.lightness}%,${color.alpha})` : "";
2433
- }
2434
2303
  function murmur2(str) {
2435
2304
  var h = 0;
2436
2305
  var k, i = 0, len = str.length;
@@ -2691,7 +2560,7 @@ var insertStyles = function insertStyles2(cache, serialized, isStringTag) {
2691
2560
  };
2692
2561
  const isServer = typeof window === "undefined";
2693
2562
  const useInsertionEffectSpecifier = "useInsertionEffect";
2694
- const useInsertionEffect = (_e = React__namespace[useInsertionEffectSpecifier]) != null ? _e : React__namespace.useLayoutEffect;
2563
+ const useInsertionEffect = (_c = React__namespace[useInsertionEffectSpecifier]) != null ? _c : React__namespace.useLayoutEffect;
2695
2564
  function useStyle(style) {
2696
2565
  const serialized = serializeStyles([style], css.cache.registered);
2697
2566
  registerStyles(css.cache, serialized, false);
@@ -2702,6 +2571,379 @@ function useStyle(style) {
2702
2571
  insertStyles(css.cache, serialized, false);
2703
2572
  return `${css.cache.key}-${serialized.name}`;
2704
2573
  }
2574
+ var _path;
2575
+ function _extends() {
2576
+ _extends = Object.assign || function(target) {
2577
+ for (var i = 1; i < arguments.length; i++) {
2578
+ var source = arguments[i];
2579
+ for (var key in source) {
2580
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
2581
+ target[key] = source[key];
2582
+ }
2583
+ }
2584
+ }
2585
+ return target;
2586
+ };
2587
+ return _extends.apply(this, arguments);
2588
+ }
2589
+ var SvgWarning20 = function SvgWarning202(props) {
2590
+ return /* @__PURE__ */ React__namespace.createElement("svg", _extends({
2591
+ width: 20,
2592
+ height: 20,
2593
+ viewBox: "0 0 20 20",
2594
+ xmlns: "http://www.w3.org/2000/svg"
2595
+ }, props), _path || (_path = /* @__PURE__ */ React__namespace.createElement("path", {
2596
+ fillRule: "evenodd",
2597
+ clipRule: "evenodd",
2598
+ d: "M2.89864 18H17.1014C18.4183 18 19.2633 16.6003 18.65 15.4349L11.5486 1.94236C10.8925 0.69577 9.10749 0.695766 8.45139 1.94236L1.35003 15.4349C0.736692 16.6003 1.58174 18 2.89864 18ZM9 6C9 5.44772 9.44771 5 10 5C10.5523 5 11 5.44772 11 6V11C11 11.5523 10.5523 12 10 12C9.44771 12 9 11.5523 9 11V6ZM11.25 14.75C11.25 15.4404 10.6904 16 10 16C9.30964 16 8.75 15.4404 8.75 14.75C8.75 14.0596 9.30964 13.5 10 13.5C10.6904 13.5 11.25 14.0596 11.25 14.75Z"
2599
+ })));
2600
+ };
2601
+ const FallbackComponent = React.forwardRef(function FallbackComponent2({
2602
+ text
2603
+ }, ref) {
2604
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", {
2605
+ ref,
2606
+ className: useStyle({
2607
+ width: "100%",
2608
+ height: 54,
2609
+ backgroundColor: "#fcedf2",
2610
+ borderRadius: 6,
2611
+ padding: 16,
2612
+ display: "flex",
2613
+ alignItems: "center",
2614
+ gap: 8,
2615
+ color: "#c73e6d",
2616
+ fill: "currentColor",
2617
+ fontFamily: "Heebo, sans-serif",
2618
+ fontSize: 16
2619
+ }),
2620
+ children: [/* @__PURE__ */ jsxRuntime.jsx(SvgWarning20, {}), /* @__PURE__ */ jsxRuntime.jsx("span", {
2621
+ children: text
2622
+ })]
2623
+ });
2624
+ });
2625
+ function isNonNullable(value) {
2626
+ return value != null;
2627
+ }
2628
+ function mapSideColor(swatches, _d) {
2629
+ var _e = _d, { color } = _e, restOfSide = __objRest(_e, ["color"]);
2630
+ return __spreadProps(__spreadValues({}, restOfSide), {
2631
+ color: color && {
2632
+ alpha: color.alpha,
2633
+ swatch: swatches.find((s) => s && s.id === color.swatchId)
2634
+ }
2635
+ });
2636
+ }
2637
+ function useBorder(value) {
2638
+ const swatchIds = value == null ? [] : [
2639
+ ...Array.from(new Set(value.map(({ value: { borderTop, borderLeft, borderBottom, borderRight } }) => [
2640
+ borderTop && borderTop.color && borderTop.color.swatchId,
2641
+ borderBottom && borderBottom.color && borderBottom.color.swatchId,
2642
+ borderLeft && borderLeft.color && borderLeft.color.swatchId,
2643
+ borderRight && borderRight.color && borderRight.color.swatchId
2644
+ ]).reduce((a, b) => a.concat(b)).filter(isNonNullable)))
2645
+ ];
2646
+ const skip = value == null || swatchIds.length === 0;
2647
+ const { error, data = {} } = useQuery(SWATCHES_BY_ID, { skip, variables: { ids: swatchIds } });
2648
+ if (value == null || error != null)
2649
+ return null;
2650
+ const { swatches = [] } = data;
2651
+ return value.map((_a) => {
2652
+ var _b = _a, { value: { borderTop, borderBottom, borderLeft, borderRight } } = _b, rest = __objRest(_b, ["value"]);
2653
+ return __spreadProps(__spreadValues({}, rest), {
2654
+ value: {
2655
+ borderTop: borderTop && mapSideColor(swatches, borderTop),
2656
+ borderBottom: borderBottom && mapSideColor(swatches, borderBottom),
2657
+ borderLeft: borderLeft && mapSideColor(swatches, borderLeft),
2658
+ borderRight: borderRight && mapSideColor(swatches, borderRight)
2659
+ }
2660
+ });
2661
+ });
2662
+ }
2663
+ const ShadowDefaultValue = {
2664
+ inset: false,
2665
+ offsetX: 0,
2666
+ offsetY: 2,
2667
+ blurRadius: 4,
2668
+ spreadRadius: 0,
2669
+ color: null
2670
+ };
2671
+ function useBoxShadow(value) {
2672
+ const swatchIds = value == null ? [] : [
2673
+ ...Array.from(new Set(value.map(({ value: shadows }) => shadows.map(({ payload: { color } }) => color && color.swatchId)).reduce((a, b) => a.concat(b), []).filter(isNonNullable)))
2674
+ ];
2675
+ const skip = value == null || swatchIds.length === 0;
2676
+ const { error, data = {} } = useQuery(SWATCHES_BY_ID, { skip, variables: { ids: swatchIds } });
2677
+ if (value == null || error != null)
2678
+ return null;
2679
+ const { swatches = [] } = data;
2680
+ return value.map((_a) => {
2681
+ var _b = _a, { value: shadows } = _b, restOfValue = __objRest(_b, ["value"]);
2682
+ return __spreadProps(__spreadValues({}, restOfValue), {
2683
+ value: shadows.map((_a2) => {
2684
+ var _b2 = _a2, {
2685
+ payload: { color, inset, offsetX, offsetY, blurRadius, spreadRadius }
2686
+ } = _b2, restOfShadow = __objRest(_b2, [
2687
+ "payload"
2688
+ ]);
2689
+ return __spreadProps(__spreadValues({}, restOfShadow), {
2690
+ payload: {
2691
+ color: color != null ? {
2692
+ swatch: swatches.find((s) => s && s.id === color.swatchId),
2693
+ alpha: color.alpha
2694
+ } : null,
2695
+ inset: inset != null ? inset : ShadowDefaultValue.inset,
2696
+ offsetX: offsetX != null ? offsetX : ShadowDefaultValue.offsetX,
2697
+ offsetY: offsetY != null ? offsetY : ShadowDefaultValue.offsetY,
2698
+ blurRadius: blurRadius != null ? blurRadius : ShadowDefaultValue.blurRadius,
2699
+ spreadRadius: spreadRadius != null ? spreadRadius : ShadowDefaultValue.spreadRadius
2700
+ }
2701
+ });
2702
+ })
2703
+ });
2704
+ });
2705
+ }
2706
+ function useResponsiveColor(color) {
2707
+ const swatchIds = color == null ? [] : [...Array.from(new Set(color.map(({ value: v }) => v && v.swatchId).filter(isNonNullable)))];
2708
+ const skip = swatchIds.length === 0;
2709
+ const { error, data = {} } = useQuery(SWATCHES_BY_ID, { skip, variables: { ids: swatchIds } });
2710
+ if (color == null || error != null)
2711
+ return null;
2712
+ const { swatches = [] } = data;
2713
+ return color.map((_a) => {
2714
+ var _b = _a, { value: v } = _b, rest = __objRest(_b, ["value"]);
2715
+ const { swatchId, alpha } = v;
2716
+ const swatch = swatches.find((s) => s && s.id === swatchId);
2717
+ return swatch == null ? null : __spreadProps(__spreadValues({}, rest), { value: { swatch, alpha } });
2718
+ }).filter(isNonNullable);
2719
+ }
2720
+ function useFile(fileId) {
2721
+ const { error, data = {} } = useQuery(FILE_BY_ID, {
2722
+ skip: fileId == null,
2723
+ variables: { id: fileId }
2724
+ });
2725
+ if (fileId == null || error != null)
2726
+ return null;
2727
+ return data.file;
2728
+ }
2729
+ const isSSR = typeof window === "undefined" || /ServerSideRendering/.test(window.navigator && window.navigator.userAgent);
2730
+ const useIsomorphicLayoutEffect = isSSR ? React.useEffect : React.useLayoutEffect;
2731
+ function usePage(pageId) {
2732
+ const { error, data = {} } = useQuery(PAGE_PATHNAMES_BY_ID, {
2733
+ skip: pageId == null,
2734
+ variables: { ids: [pageId] }
2735
+ });
2736
+ if (pageId == null || error != null)
2737
+ return null;
2738
+ const { pagePathnamesById: [page] = [] } = data;
2739
+ return page;
2740
+ }
2741
+ const getIndexes = (spans, index) => {
2742
+ const flattened = spans.reduce((a, s) => a.concat(s), []);
2743
+ if (index < 0 || index > flattened.length)
2744
+ throw new RangeError();
2745
+ let remainder = index;
2746
+ let rowIndex = 0;
2747
+ while (rowIndex < spans.length - 1 && remainder >= spans[rowIndex].length) {
2748
+ remainder -= spans[rowIndex].length;
2749
+ rowIndex += 1;
2750
+ }
2751
+ return [rowIndex, remainder];
2752
+ };
2753
+ function lengthDataToString(data) {
2754
+ if (typeof data === "object")
2755
+ return `${data.value}${data.unit}`;
2756
+ if (typeof data === "number")
2757
+ return `${data}px`;
2758
+ return data;
2759
+ }
2760
+ function paddingPropertyDataToStyle(data, defaultValue = {}) {
2761
+ var _a, _b, _c2, _d;
2762
+ const paddingTop = (_a = data.paddingTop) != null ? _a : defaultValue.paddingTop;
2763
+ const paddingRight = (_b = data.paddingRight) != null ? _b : defaultValue.paddingRight;
2764
+ const paddingBottom = (_c2 = data.paddingBottom) != null ? _c2 : defaultValue.paddingBottom;
2765
+ const paddingLeft = (_d = data.paddingLeft) != null ? _d : defaultValue.paddingLeft;
2766
+ const style = {};
2767
+ if (paddingTop)
2768
+ style.paddingTop = lengthDataToString(paddingTop);
2769
+ if (paddingRight)
2770
+ style.paddingRight = lengthDataToString(paddingRight);
2771
+ if (paddingBottom)
2772
+ style.paddingBottom = lengthDataToString(paddingBottom);
2773
+ if (paddingLeft)
2774
+ style.paddingLeft = lengthDataToString(paddingLeft);
2775
+ return style;
2776
+ }
2777
+ function marginPropertyDataToStyle(data, defaultValue = {}) {
2778
+ var _a, _b, _c2, _d;
2779
+ const marginTop = (_a = data.marginTop) != null ? _a : defaultValue.marginTop;
2780
+ const marginRight = (_b = data.marginRight) != null ? _b : defaultValue.marginRight;
2781
+ const marginBottom = (_c2 = data.marginBottom) != null ? _c2 : defaultValue.marginBottom;
2782
+ const marginLeft = (_d = data.marginLeft) != null ? _d : defaultValue.marginLeft;
2783
+ const style = {};
2784
+ if (marginTop)
2785
+ style.marginTop = lengthDataToString(marginTop);
2786
+ if (marginRight)
2787
+ style.marginRight = lengthDataToString(marginRight);
2788
+ if (marginBottom)
2789
+ style.marginBottom = lengthDataToString(marginBottom);
2790
+ if (marginLeft)
2791
+ style.marginLeft = lengthDataToString(marginLeft);
2792
+ return style;
2793
+ }
2794
+ function lengthPercentageDataToString(data) {
2795
+ if (typeof data === "object")
2796
+ return `${data.value}${data.unit}`;
2797
+ if (typeof data === "number")
2798
+ return `${data}px`;
2799
+ return data;
2800
+ }
2801
+ function borderRadiusPropertyDataToStyle(data, defaultValue = {}) {
2802
+ var _a, _b, _c2, _d;
2803
+ const borderTopLeftRadius = (_a = data.borderTopLeftRadius) != null ? _a : defaultValue.borderTopLeftRadius;
2804
+ const borderTopRightRadius = (_b = data.borderTopRightRadius) != null ? _b : defaultValue.borderTopRightRadius;
2805
+ const borderBottomRightRadius = (_c2 = data.borderBottomRightRadius) != null ? _c2 : defaultValue.borderBottomRightRadius;
2806
+ const borderBottomLeftRadius = (_d = data.borderBottomLeftRadius) != null ? _d : defaultValue.borderBottomLeftRadius;
2807
+ const style = {};
2808
+ if (borderTopLeftRadius) {
2809
+ style.borderTopLeftRadius = lengthPercentageDataToString(borderTopLeftRadius);
2810
+ }
2811
+ if (borderTopRightRadius) {
2812
+ style.borderTopRightRadius = lengthPercentageDataToString(borderTopRightRadius);
2813
+ }
2814
+ if (borderBottomRightRadius) {
2815
+ style.borderBottomRightRadius = lengthPercentageDataToString(borderBottomRightRadius);
2816
+ }
2817
+ if (borderBottomLeftRadius) {
2818
+ style.borderBottomLeftRadius = lengthPercentageDataToString(borderBottomLeftRadius);
2819
+ }
2820
+ return style;
2821
+ }
2822
+ function colorToString(color) {
2823
+ return color && color.swatch ? `hsla(${color.swatch.hue},${color.swatch.saturation}%,${color.swatch.lightness}%,${color.alpha})` : "";
2824
+ }
2825
+ function borderPropertyDataToStyle(data, defaultValue = {}) {
2826
+ var _a, _b, _c2, _d;
2827
+ const borderTop = (_a = data.borderTop) != null ? _a : defaultValue.borderTop;
2828
+ const borderRight = (_b = data.borderRight) != null ? _b : defaultValue.borderRight;
2829
+ const borderBottom = (_c2 = data.borderBottom) != null ? _c2 : defaultValue.borderBottom;
2830
+ const borderLeft = (_d = data.borderLeft) != null ? _d : defaultValue.borderLeft;
2831
+ const style = {};
2832
+ if (borderTop)
2833
+ style.borderTop = borderSideToString(borderTop);
2834
+ if (borderRight)
2835
+ style.borderRight = borderSideToString(borderRight);
2836
+ if (borderBottom)
2837
+ style.borderBottom = borderSideToString(borderBottom);
2838
+ if (borderLeft)
2839
+ style.borderLeft = borderSideToString(borderLeft);
2840
+ return style;
2841
+ }
2842
+ function borderSideToString(borderSide) {
2843
+ if (typeof borderSide === "string")
2844
+ return borderSide;
2845
+ if (typeof borderSide === "number")
2846
+ return `${borderSide}px`;
2847
+ const { width, color, style } = borderSide;
2848
+ return `${width != null ? width : 0}px ${style} ${color != null ? colorToString(color) : "black"}`;
2849
+ }
2850
+ function responsiveStyle(responsiveValues, join$1, strategy) {
2851
+ return join(responsiveValues, join$1, strategy).reduce((acc, { deviceId, value }) => {
2852
+ const device = getDevice(deviceId);
2853
+ const mediaQuery = getDeviceMediaQuery(device);
2854
+ return __spreadProps(__spreadValues({}, acc), {
2855
+ [mediaQuery]: __spreadValues(__spreadValues({}, acc[mediaQuery]), value)
2856
+ });
2857
+ }, {});
2858
+ }
2859
+ function responsiveWidth(widthData, defaultValue = "100%") {
2860
+ return __spreadValues({
2861
+ maxWidth: "100%"
2862
+ }, responsiveStyle([widthData], ([width = defaultValue]) => ({
2863
+ width: typeof width === "object" ? `${width.value}${width.unit}` : width
2864
+ })));
2865
+ }
2866
+ function responsivePadding(paddingData, defaultValue = {}) {
2867
+ return responsiveStyle([paddingData], ([padding = {}]) => paddingPropertyDataToStyle(padding, Object.assign({ paddingTop: 0, paddingRight: 0, paddingBottom: 0, paddingLeft: 0 }, defaultValue)));
2868
+ }
2869
+ function responsiveMargin(marginData, defaultValue = {}) {
2870
+ return responsiveStyle([marginData], ([margin = {}]) => marginPropertyDataToStyle(margin, Object.assign({ marginTop: 0, marginRight: "auto", marginBottom: 0, marginLeft: "auto" }, defaultValue)));
2871
+ }
2872
+ function responsiveBorderRadius(borderRadiusData, defaultValue = {}) {
2873
+ return responsiveStyle([borderRadiusData], ([borderRadius = {}]) => borderRadiusPropertyDataToStyle(borderRadius, Object.assign({
2874
+ borderTopLeftRadius: 0,
2875
+ borderTopRightRadius: 0,
2876
+ borderBottomRightRadius: 0,
2877
+ borderBottomLeftRadius: 0
2878
+ }, defaultValue)));
2879
+ }
2880
+ function responsiveBorder(borderData, defaultValue = {}) {
2881
+ return responsiveStyle([borderData], ([border = {}]) => borderPropertyDataToStyle(border, Object.assign({
2882
+ borderTop: "0px solid black",
2883
+ borderRight: "0px solid black",
2884
+ borderBottom: "0px solid black",
2885
+ borderLeft: "0px solid black"
2886
+ }, defaultValue)));
2887
+ }
2888
+ const floor = (d) => (v) => Math.floor(10 ** d * v) / 10 ** d;
2889
+ function responsiveGridItem(props) {
2890
+ return __spreadValues({
2891
+ display: "flex"
2892
+ }, responsiveStyle([props.grid, props.columnGap, props.rowGap], ([
2893
+ { spans, count } = { spans: [[12]], count: 12 },
2894
+ columnGap = { value: 0, unit: "px" },
2895
+ rowGap = { value: 0, unit: "px" }
2896
+ ]) => {
2897
+ const [rowIndex, columnIndex] = getIndexes(spans, props.index);
2898
+ const firstCol = columnIndex === 0;
2899
+ const lastCol = columnIndex === spans[rowIndex].length - 1;
2900
+ const span = spans[rowIndex][columnIndex];
2901
+ const fraction = floor(5)(span / count);
2902
+ const width = `${fraction} * (100% + ${columnGap.value}${columnGap.unit})`;
2903
+ const excessWidth = `${Number(firstCol) + Number(lastCol)} * ${columnGap.value}${columnGap.unit} / 2`;
2904
+ const iePrecisionError = "0.01px";
2905
+ const flexBasis = `calc(${width} - ${excessWidth} - ${iePrecisionError})`;
2906
+ const firstRow = rowIndex === 0;
2907
+ const lastRow = rowIndex === spans.length - 1;
2908
+ return span === 0 ? { display: "none" } : {
2909
+ flexBasis,
2910
+ minWidth: flexBasis,
2911
+ maxWidth: flexBasis,
2912
+ paddingLeft: firstCol ? 0 : `${columnGap.value / 2}${columnGap.unit}`,
2913
+ paddingRight: lastCol ? 0 : `${columnGap.value / 2}${columnGap.unit}`,
2914
+ paddingTop: firstRow ? 0 : `${rowGap.value / 2}${rowGap.unit}`,
2915
+ paddingBottom: lastRow ? 0 : `${rowGap.value / 2}${rowGap.unit}`
2916
+ };
2917
+ }));
2918
+ }
2919
+ const getBoxShadow = (shadows) => shadows.map(({ payload: { inset, offsetX, offsetY, blurRadius, spreadRadius, color } }) => `${inset ? "inset " : ""}${offsetX.toFixed(1)}px ${offsetY.toFixed(1)}px ${blurRadius}px ${spreadRadius}px ${color != null ? colorToString(color) : "rgba(0,0,0,0.2)"}`).filter(Boolean).join();
2920
+ function responsiveShadow(value) {
2921
+ return responsiveStyle([value], ([shadow = []]) => ({
2922
+ boxShadow: getBoxShadow(shadow)
2923
+ }));
2924
+ }
2925
+ function responsiveTextStyle(value) {
2926
+ return responsiveStyle([value], ([
2927
+ textStyle = {
2928
+ fontFamily: null,
2929
+ letterSpacing: null,
2930
+ fontSize: null,
2931
+ fontWeight: null,
2932
+ textTransform: [],
2933
+ fontStyle: []
2934
+ }
2935
+ ]) => {
2936
+ const {
2937
+ fontSize,
2938
+ fontWeight,
2939
+ fontStyle = [],
2940
+ textTransform = [],
2941
+ letterSpacing,
2942
+ fontFamily
2943
+ } = textStyle;
2944
+ return __spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues({}, fontFamily == null ? {} : { fontFamily }), fontWeight == null ? {} : { fontWeight }), letterSpacing == null ? {} : { letterSpacing }), fontSize == null ? {} : { fontSize: `${fontSize.value}${fontSize.unit}` }), textTransform.includes("uppercase") ? { textTransform: "uppercase" } : {}), fontStyle.includes("italic") ? { fontStyle: "italic" } : {});
2945
+ });
2946
+ }
2705
2947
  function useStyleControlCssObject(style, controlDefinition) {
2706
2948
  const { properties } = controlDefinition.config;
2707
2949
  return __spreadValues(__spreadValues({}, properties.includes(slot.StyleControlProperty.Width) && {
@@ -2714,52 +2956,40 @@ function useStyleControlCssObject(style, controlDefinition) {
2714
2956
  style == null ? void 0 : style.borderRadius,
2715
2957
  style == null ? void 0 : style.textStyle
2716
2958
  ], ([width, margin, padding, border, borderRadius, textStyle]) => {
2717
- var _a, _b, _c, _d, _e2, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s;
2959
+ var _a, _b, _c2, _d, _e, _f, _g, _h, _i, _j, _k;
2718
2960
  return __spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues({}, properties.includes(slot.StyleControlProperty.Width) && {
2719
2961
  width: (_a = widthToString(width)) != null ? _a : "100%"
2720
- }), properties.includes(slot.StyleControlProperty.Margin) && {
2721
- marginTop: (_b = marginToString(margin == null ? void 0 : margin.marginTop)) != null ? _b : 0,
2722
- marginRight: (_c = marginToString(margin == null ? void 0 : margin.marginRight)) != null ? _c : "auto",
2723
- marginBottom: (_d = marginToString(margin == null ? void 0 : margin.marginBottom)) != null ? _d : 0,
2724
- marginLeft: (_e2 = marginToString(margin == null ? void 0 : margin.marginLeft)) != null ? _e2 : "auto"
2725
- }), properties.includes(slot.StyleControlProperty.Padding) && {
2726
- paddingTop: (_f = paddingToString(padding == null ? void 0 : padding.paddingTop)) != null ? _f : 0,
2727
- paddingRight: (_g = paddingToString(padding == null ? void 0 : padding.paddingRight)) != null ? _g : 0,
2728
- paddingBottom: (_h = paddingToString(padding == null ? void 0 : padding.paddingBottom)) != null ? _h : 0,
2729
- paddingLeft: (_i = paddingToString(padding == null ? void 0 : padding.paddingLeft)) != null ? _i : 0
2730
- }), properties.includes(slot.StyleControlProperty.Border) && {
2731
- borderTop: (_j = borderSideToString(border == null ? void 0 : border.borderTop)) != null ? _j : "0 solid black",
2732
- borderRight: (_k = borderSideToString(border == null ? void 0 : border.borderRight)) != null ? _k : "0 solid black",
2733
- borderBottom: (_l = borderSideToString(border == null ? void 0 : border.borderBottom)) != null ? _l : "0 solid black",
2734
- borderLeft: (_m = borderSideToString(border == null ? void 0 : border.borderLeft)) != null ? _m : "0 solid black"
2962
+ }), properties.includes(slot.StyleControlProperty.Margin) && margin != null && marginPropertyDataToStyle(margin, {
2963
+ marginTop: 0,
2964
+ marginRight: "auto",
2965
+ marginBottom: 0,
2966
+ marginLeft: "auto"
2967
+ })), properties.includes(slot.StyleControlProperty.Padding) && padding != null && paddingPropertyDataToStyle(padding, {
2968
+ paddingTop: 0,
2969
+ paddingRight: 0,
2970
+ paddingBottom: 0,
2971
+ paddingLeft: 0
2972
+ })), properties.includes(slot.StyleControlProperty.Border) && {
2973
+ borderTop: (_b = borderSideToString2(border == null ? void 0 : border.borderTop)) != null ? _b : "0 solid black",
2974
+ borderRight: (_c2 = borderSideToString2(border == null ? void 0 : border.borderRight)) != null ? _c2 : "0 solid black",
2975
+ borderBottom: (_d = borderSideToString2(border == null ? void 0 : border.borderBottom)) != null ? _d : "0 solid black",
2976
+ borderLeft: (_e = borderSideToString2(border == null ? void 0 : border.borderLeft)) != null ? _e : "0 solid black"
2735
2977
  }), properties.includes(slot.StyleControlProperty.BorderRadius) && {
2736
- borderTopLeftRadius: (_n = borderRadiusToString(borderRadius == null ? void 0 : borderRadius.borderTopLeftRadius)) != null ? _n : 0,
2737
- borderTopRightRadius: (_o = borderRadiusToString(borderRadius == null ? void 0 : borderRadius.borderTopRightRadius)) != null ? _o : 0,
2738
- borderBottomRightRadius: (_p = borderRadiusToString(borderRadius == null ? void 0 : borderRadius.borderBottomRightRadius)) != null ? _p : 0,
2739
- borderBottomLeftRadius: (_q = borderRadiusToString(borderRadius == null ? void 0 : borderRadius.borderBottomLeftRadius)) != null ? _q : 0
2978
+ borderTopLeftRadius: (_f = borderRadiusToString(borderRadius == null ? void 0 : borderRadius.borderTopLeftRadius)) != null ? _f : 0,
2979
+ borderTopRightRadius: (_g = borderRadiusToString(borderRadius == null ? void 0 : borderRadius.borderTopRightRadius)) != null ? _g : 0,
2980
+ borderBottomRightRadius: (_h = borderRadiusToString(borderRadius == null ? void 0 : borderRadius.borderBottomRightRadius)) != null ? _h : 0,
2981
+ borderBottomLeftRadius: (_i = borderRadiusToString(borderRadius == null ? void 0 : borderRadius.borderBottomLeftRadius)) != null ? _i : 0
2740
2982
  }), properties.includes(slot.StyleControlProperty.TextStyle) && __spreadProps(__spreadValues(__spreadValues(__spreadValues(__spreadValues({}, (textStyle == null ? void 0 : textStyle.fontFamily) && { fontFamily: textStyle.fontFamily }), (textStyle == null ? void 0 : textStyle.letterSpacing) && { letterSpacing: textStyle.letterSpacing }), (textStyle == null ? void 0 : textStyle.fontSize) && { fontSize: fontSizeToString(textStyle.fontSize) }), (textStyle == null ? void 0 : textStyle.fontWeight) && { fontWeight: textStyle.fontWeight }), {
2741
- textTransform: (_r = textStyle == null ? void 0 : textStyle.textTransform) != null ? _r : [],
2742
- fontStyle: (_s = textStyle == null ? void 0 : textStyle.fontStyle) != null ? _s : []
2983
+ textTransform: (_j = textStyle == null ? void 0 : textStyle.textTransform) != null ? _j : [],
2984
+ fontStyle: (_k = textStyle == null ? void 0 : textStyle.fontStyle) != null ? _k : []
2743
2985
  }));
2744
2986
  }));
2745
2987
  function widthToString(widthProperty) {
2746
2988
  if (widthProperty == null)
2747
2989
  return null;
2748
- return `${widthProperty.value}${widthProperty.unit}`;
2749
- }
2750
- function marginToString(marginProperty) {
2751
- if (marginProperty == null)
2752
- return null;
2753
- if (marginProperty === "auto")
2754
- return marginProperty;
2755
- return `${marginProperty.value}${marginProperty.unit}`;
2756
- }
2757
- function paddingToString(paddingProperty) {
2758
- if (paddingProperty == null)
2759
- return null;
2760
- return `${paddingProperty.value}${paddingProperty.unit}`;
2990
+ return lengthPercentageDataToString(widthProperty);
2761
2991
  }
2762
- function borderSideToString(borderSide) {
2992
+ function borderSideToString2(borderSide) {
2763
2993
  if (borderSide == null)
2764
2994
  return null;
2765
2995
  const { width, color, style: style2 } = borderSide;
@@ -2768,7 +2998,7 @@ function useStyleControlCssObject(style, controlDefinition) {
2768
2998
  function borderRadiusToString(borderRadius) {
2769
2999
  if (borderRadius == null)
2770
3000
  return null;
2771
- return `${borderRadius.value}${borderRadius.unit}`;
3001
+ return lengthPercentageDataToString(borderRadius);
2772
3002
  }
2773
3003
  function fontSizeToString(fontSize) {
2774
3004
  return `${fontSize.value}${fontSize.unit}`;
@@ -3003,18 +3233,6 @@ function ControlValue({
3003
3233
  return children(data);
3004
3234
  }
3005
3235
  }
3006
- const getIndexes = (spans, index) => {
3007
- const flattened = spans.reduce((a, s) => a.concat(s), []);
3008
- if (index < 0 || index > flattened.length)
3009
- throw new RangeError();
3010
- let remainder = index;
3011
- let rowIndex = 0;
3012
- while (rowIndex < spans.length - 1 && remainder >= spans[rowIndex].length) {
3013
- remainder -= spans[rowIndex].length;
3014
- rowIndex += 1;
3015
- }
3016
- return [rowIndex, remainder];
3017
- };
3018
3236
  function useSlot(data, control2) {
3019
3237
  if (data == null || data.elements.length === 0) {
3020
3238
  return /* @__PURE__ */ jsxRuntime.jsx(Slot.Placeholder, {
@@ -3177,13 +3395,25 @@ function pollBoxModel({
3177
3395
  onBoxModelChange(null);
3178
3396
  };
3179
3397
  }
3180
- function useDeviceMode() {
3181
- return "desktop";
3398
+ function useWidthStyle(value, descriptor) {
3399
+ return useStyle(responsiveWidth(value, descriptor.options.defaultValue));
3400
+ }
3401
+ function usePaddingStyle(value) {
3402
+ return useStyle(responsivePadding(value));
3403
+ }
3404
+ function useMarginStyle(value) {
3405
+ return useStyle(responsiveMargin(value));
3406
+ }
3407
+ function useBorderRadiusStyle(value) {
3408
+ return useStyle(responsiveBorderRadius(value));
3409
+ }
3410
+ function useShadowsStyle(value) {
3411
+ const shadowValue = useBoxShadow(value);
3412
+ return useStyle(responsiveShadow(shadowValue != null ? shadowValue : void 0));
3182
3413
  }
3183
- function useWidth(value, descriptor, props) {
3184
- const deviceMode = useDeviceMode();
3185
- const options = React.useMemo(() => typeof descriptor.options === "function" ? descriptor.options(props, deviceMode) : descriptor.options, [props, deviceMode]);
3186
- return React.useMemo(() => options.format === slot.WidthControlValueFormats.ClassName ? css.css(responsiveWidth(value, options.defaultValue)) : value, [value, options.defaultValue, options.format]);
3414
+ function useBorderStyle(value) {
3415
+ const borderData = useBorder(value);
3416
+ return useStyle(responsiveBorder(borderData != null ? borderData : void 0));
3187
3417
  }
3188
3418
  function PropsValue({
3189
3419
  element,
@@ -3239,13 +3469,95 @@ function PropsValue({
3239
3469
  }, descriptor.type);
3240
3470
  }
3241
3471
  case slot.Types.Width:
3242
- return /* @__PURE__ */ jsxRuntime.jsx(RenderHook, {
3243
- hook: useWidth,
3244
- parameters: [props[propName], descriptor, props],
3245
- children: (value) => renderFn(__spreadProps(__spreadValues({}, propsValue), {
3246
- [propName]: value
3247
- }))
3248
- }, descriptor.type);
3472
+ switch (descriptor.options.format) {
3473
+ case slot.WidthPropControllerFormat.ClassName:
3474
+ return /* @__PURE__ */ jsxRuntime.jsx(RenderHook, {
3475
+ hook: useWidthStyle,
3476
+ parameters: [props[propName], descriptor],
3477
+ children: (value) => renderFn(__spreadProps(__spreadValues({}, propsValue), {
3478
+ [propName]: value
3479
+ }))
3480
+ }, descriptor.type);
3481
+ default:
3482
+ return renderFn(__spreadProps(__spreadValues({}, propsValue), {
3483
+ [propName]: props[propName]
3484
+ }));
3485
+ }
3486
+ case slot.Types.Padding:
3487
+ switch (descriptor.options.format) {
3488
+ case slot.PaddingPropControllerFormat.ClassName:
3489
+ return /* @__PURE__ */ jsxRuntime.jsx(RenderHook, {
3490
+ hook: usePaddingStyle,
3491
+ parameters: [props[propName]],
3492
+ children: (value) => renderFn(__spreadProps(__spreadValues({}, propsValue), {
3493
+ [propName]: value
3494
+ }))
3495
+ }, descriptor.type);
3496
+ default:
3497
+ return renderFn(__spreadProps(__spreadValues({}, propsValue), {
3498
+ [propName]: props[propName]
3499
+ }));
3500
+ }
3501
+ case slot.Types.Margin:
3502
+ switch (descriptor.options.format) {
3503
+ case slot.MarginPropControllerFormat.ClassName:
3504
+ return /* @__PURE__ */ jsxRuntime.jsx(RenderHook, {
3505
+ hook: useMarginStyle,
3506
+ parameters: [props[propName]],
3507
+ children: (value) => renderFn(__spreadProps(__spreadValues({}, propsValue), {
3508
+ [propName]: value
3509
+ }))
3510
+ }, descriptor.type);
3511
+ default:
3512
+ return renderFn(__spreadProps(__spreadValues({}, propsValue), {
3513
+ [propName]: props[propName]
3514
+ }));
3515
+ }
3516
+ case slot.Types.BorderRadius:
3517
+ switch (descriptor.options.format) {
3518
+ case slot.BorderRadiusPropControllerFormat.ClassName:
3519
+ return /* @__PURE__ */ jsxRuntime.jsx(RenderHook, {
3520
+ hook: useBorderRadiusStyle,
3521
+ parameters: [props[propName]],
3522
+ children: (value) => renderFn(__spreadProps(__spreadValues({}, propsValue), {
3523
+ [propName]: value
3524
+ }))
3525
+ }, descriptor.type);
3526
+ default:
3527
+ return renderFn(__spreadProps(__spreadValues({}, propsValue), {
3528
+ [propName]: props[propName]
3529
+ }));
3530
+ }
3531
+ case slot.Types.Shadows:
3532
+ switch (descriptor.options.format) {
3533
+ case slot.ShadowsPropControllerFormat.ClassName:
3534
+ return /* @__PURE__ */ jsxRuntime.jsx(RenderHook, {
3535
+ hook: useShadowsStyle,
3536
+ parameters: [props[propName]],
3537
+ children: (value) => renderFn(__spreadProps(__spreadValues({}, propsValue), {
3538
+ [propName]: value
3539
+ }))
3540
+ }, descriptor.type);
3541
+ default:
3542
+ return renderFn(__spreadProps(__spreadValues({}, propsValue), {
3543
+ [propName]: props[propName]
3544
+ }));
3545
+ }
3546
+ case slot.Types.Border:
3547
+ switch (descriptor.options.format) {
3548
+ case slot.BorderPropControllerFormat.ClassName:
3549
+ return /* @__PURE__ */ jsxRuntime.jsx(RenderHook, {
3550
+ hook: useBorderStyle,
3551
+ parameters: [props[propName]],
3552
+ children: (value) => renderFn(__spreadProps(__spreadValues({}, propsValue), {
3553
+ [propName]: value
3554
+ }))
3555
+ }, descriptor.type);
3556
+ default:
3557
+ return renderFn(__spreadProps(__spreadValues({}, propsValue), {
3558
+ [propName]: props[propName]
3559
+ }));
3560
+ }
3249
3561
  case slot.Types.ResponsiveColor:
3250
3562
  return /* @__PURE__ */ jsxRuntime.jsx(RenderHook, {
3251
3563
  hook: useResponsiveColor,
@@ -3585,16 +3897,20 @@ exports.colorToString = colorToString;
3585
3897
  exports.deepEqual = deepEqual;
3586
3898
  exports.findDeviceOverride = findDeviceOverride;
3587
3899
  exports.forwardNextDynamicRef = forwardNextDynamicRef;
3588
- exports.getDevice = getDevice;
3589
3900
  exports.getDeviceMediaQuery = getDeviceMediaQuery;
3590
- exports.getIndexes = getIndexes;
3591
3901
  exports.getServerSideProps = getServerSideProps;
3592
3902
  exports.getStaticPaths = getStaticPaths;
3593
3903
  exports.getStaticProps = getStaticProps;
3904
+ exports.insertStyles = insertStyles;
3594
3905
  exports.isNonNullable = isNonNullable;
3595
- exports.join = join;
3906
+ exports.responsiveGridItem = responsiveGridItem;
3907
+ exports.responsiveStyle = responsiveStyle;
3908
+ exports.responsiveTextStyle = responsiveTextStyle;
3909
+ exports.responsiveWidth = responsiveWidth;
3910
+ exports.serializeStyles = serializeStyles;
3596
3911
  exports.shallowMergeFallbacks = shallowMergeFallbacks;
3597
3912
  exports.useBorder = useBorder;
3913
+ exports.useBoxShadow = useBoxShadow;
3598
3914
  exports.useElementId = useElementId;
3599
3915
  exports.useFile = useFile;
3600
3916
  exports.useFormContext = useFormContext;
@@ -3605,4 +3921,5 @@ exports.usePage = usePage;
3605
3921
  exports.usePageId = usePageId;
3606
3922
  exports.useQuery = useQuery;
3607
3923
  exports.useResponsiveColor = useResponsiveColor;
3924
+ exports.useStyle = useStyle;
3608
3925
  //# sourceMappingURL=index.cjs.js.map