@makeswift/runtime 0.0.0-646104a → 0.0.0-76a2297

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 (96) hide show
  1. package/dist/Page.cjs.js +215 -0
  2. package/dist/Page.cjs.js.map +1 -0
  3. package/dist/Page.es.js +209 -0
  4. package/dist/Page.es.js.map +1 -0
  5. package/dist/actions.cjs.js +5 -0
  6. package/dist/actions.cjs.js.map +1 -1
  7. package/dist/actions.es.js +5 -1
  8. package/dist/actions.es.js.map +1 -1
  9. package/dist/components.cjs.js +14 -1
  10. package/dist/components.cjs.js.map +1 -1
  11. package/dist/components.es.js +6 -2
  12. package/dist/components.es.js.map +1 -1
  13. package/dist/control-serialization.cjs.js +61 -5
  14. package/dist/control-serialization.cjs.js.map +1 -1
  15. package/dist/control-serialization.es.js +61 -5
  16. package/dist/control-serialization.es.js.map +1 -1
  17. package/dist/descriptors.cjs.js +6 -0
  18. package/dist/descriptors.cjs.js.map +1 -1
  19. package/dist/descriptors.es.js +6 -1
  20. package/dist/descriptors.es.js.map +1 -1
  21. package/dist/main.cjs.js +1 -0
  22. package/dist/main.cjs.js.map +1 -1
  23. package/dist/main.es.js +1 -1
  24. package/dist/next.cjs.js +36 -17
  25. package/dist/next.cjs.js.map +1 -1
  26. package/dist/next.es.js +37 -18
  27. package/dist/next.es.js.map +1 -1
  28. package/dist/react-builder-preview.cjs.js +3 -0
  29. package/dist/react-builder-preview.cjs.js.map +1 -1
  30. package/dist/react-builder-preview.es.js +4 -1
  31. package/dist/react-builder-preview.es.js.map +1 -1
  32. package/dist/react-page.cjs.js +1 -1
  33. package/dist/react-page.cjs.js.map +1 -1
  34. package/dist/react-page.es.js +2 -2
  35. package/dist/react-page.es.js.map +1 -1
  36. package/dist/react.cjs.js +4 -1
  37. package/dist/react.cjs.js.map +1 -1
  38. package/dist/react.cjs2.js +278 -83
  39. package/dist/react.cjs2.js.map +1 -1
  40. package/dist/react.es.js +4 -1
  41. package/dist/react.es.js.map +1 -1
  42. package/dist/react.es2.js +268 -82
  43. package/dist/react.es2.js.map +1 -1
  44. package/dist/types/api/react.d.ts +22 -4
  45. package/dist/types/api/react.d.ts.map +1 -1
  46. package/dist/types/builder/serialization/control-serialization.d.ts +55 -7
  47. package/dist/types/builder/serialization/control-serialization.d.ts.map +1 -1
  48. package/dist/types/components/builtin/Form/prop-controllers.d.ts +1 -0
  49. package/dist/types/components/builtin/Form/prop-controllers.d.ts.map +1 -0
  50. package/dist/types/components/builtin/Video/Video.d.ts +15 -0
  51. package/dist/types/components/builtin/Video/Video.d.ts.map +1 -0
  52. package/dist/types/components/builtin/Video/index.d.ts +2 -0
  53. package/dist/types/components/builtin/Video/index.d.ts.map +1 -0
  54. package/dist/types/components/builtin/Video/prop-controllers.d.ts +50 -0
  55. package/dist/types/components/builtin/Video/prop-controllers.d.ts.map +1 -0
  56. package/dist/types/components/builtin/index.d.ts.map +1 -1
  57. package/dist/types/components/hooks/useTableWorkspace.d.ts +14 -0
  58. package/dist/types/components/hooks/useTableWorkspace.d.ts.map +1 -0
  59. package/dist/types/components/index.d.ts +2 -0
  60. package/dist/types/components/index.d.ts.map +1 -1
  61. package/dist/types/components/page/BodySnippet.d.ts +7 -0
  62. package/dist/types/components/page/BodySnippet.d.ts.map +1 -0
  63. package/dist/types/components/page/Page.d.ts +45 -0
  64. package/dist/types/components/page/Page.d.ts.map +1 -0
  65. package/dist/types/components/page/index.d.ts +2 -0
  66. package/dist/types/components/page/index.d.ts.map +1 -0
  67. package/dist/types/components/utils/layout.d.ts +16 -0
  68. package/dist/types/components/utils/layout.d.ts.map +1 -0
  69. package/dist/types/components/utils/placeholders.d.ts +7 -0
  70. package/dist/types/components/utils/placeholders.d.ts.map +1 -1
  71. package/dist/types/components/utils/pollAnimationFrame.d.ts +2 -0
  72. package/dist/types/components/utils/pollAnimationFrame.d.ts.map +1 -0
  73. package/dist/types/components/utils/pollElementLayout.d.ts +8 -0
  74. package/dist/types/components/utils/pollElementLayout.d.ts.map +1 -0
  75. package/dist/types/components/utils/requestBatchedAnimationFrame.d.ts +4 -0
  76. package/dist/types/components/utils/requestBatchedAnimationFrame.d.ts.map +1 -0
  77. package/dist/types/index.d.ts +1 -1
  78. package/dist/types/index.d.ts.map +1 -1
  79. package/dist/types/next.d.ts +5 -4
  80. package/dist/types/next.d.ts.map +1 -1
  81. package/dist/types/prop-controllers/descriptors.d.ts +23 -5
  82. package/dist/types/prop-controllers/descriptors.d.ts.map +1 -1
  83. package/dist/types/prop-controllers/index.d.ts +1 -1
  84. package/dist/types/prop-controllers/index.d.ts.map +1 -1
  85. package/dist/types/runtimes/page.d.ts +9 -0
  86. package/dist/types/runtimes/page.d.ts.map +1 -0
  87. package/dist/types/runtimes/react.d.ts +3 -3
  88. package/dist/types/runtimes/react.d.ts.map +1 -1
  89. package/dist/types/state/actions.d.ts +9 -1
  90. package/dist/types/state/actions.d.ts.map +1 -1
  91. package/dist/types/state/react-builder-preview.d.ts.map +1 -1
  92. package/dist/types/utils/get-redirect-match.d.ts +10 -0
  93. package/dist/types/utils/get-redirect-match.d.ts.map +1 -0
  94. package/dist/types/utils/get-redirect-match.test.d.ts +1 -0
  95. package/dist/types/utils/get-redirect-match.test.d.ts.map +1 -0
  96. package/package.json +2 -1
@@ -30,6 +30,10 @@ var __objRest = (source, exclude) => {
30
30
  }
31
31
  return target;
32
32
  };
33
+ var __publicField = (obj, key, value) => {
34
+ __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
35
+ return value;
36
+ };
33
37
  var React = require("react");
34
38
  var withSelector = require("use-sync-external-store/shim/with-selector");
35
39
  var client = require("@apollo/client");
@@ -37,7 +41,11 @@ var reactPage = require("./react-page.cjs.js");
37
41
  var actions = require("./actions.cjs.js");
38
42
  var styled = require("styled-components");
39
43
  var framerMotion = require("framer-motion");
44
+ var ssr = require("@apollo/client/react/ssr");
45
+ var uuid = require("uuid/v4");
40
46
  var jsxRuntime = require("react/jsx-runtime");
47
+ require("html-react-parser");
48
+ require("next/head");
41
49
  var boxModels = require("./box-models.cjs.js");
42
50
  var NextImage = require("next/image");
43
51
  var ReactPlayer = require("react-player");
@@ -47,7 +55,6 @@ var scrollIntoView = require("scroll-into-view-if-needed");
47
55
  var NextLink = require("next/link");
48
56
  var reactUseGesture = require("react-use-gesture");
49
57
  var popcorn = require("@popmotion/popcorn");
50
- var uuid = require("uuid/v4");
51
58
  var formik = require("formik");
52
59
  var polished = require("polished");
53
60
  var slate = require("slate");
@@ -80,12 +87,12 @@ function _interopNamespace(e) {
80
87
  }
81
88
  var React__namespace = /* @__PURE__ */ _interopNamespace(React);
82
89
  var styled__default = /* @__PURE__ */ _interopDefaultLegacy(styled);
90
+ var uuid__default = /* @__PURE__ */ _interopDefaultLegacy(uuid);
83
91
  var NextImage__default = /* @__PURE__ */ _interopDefaultLegacy(NextImage);
84
92
  var ReactPlayer__default = /* @__PURE__ */ _interopDefaultLegacy(ReactPlayer);
85
93
  var ColorHelper__default = /* @__PURE__ */ _interopDefaultLegacy(ColorHelper);
86
94
  var scrollIntoView__default = /* @__PURE__ */ _interopDefaultLegacy(scrollIntoView);
87
95
  var NextLink__default = /* @__PURE__ */ _interopDefaultLegacy(NextLink);
88
- var uuid__default = /* @__PURE__ */ _interopDefaultLegacy(uuid);
89
96
  var Hotkeys__default = /* @__PURE__ */ _interopDefaultLegacy(Hotkeys);
90
97
  var ipsum__default = /* @__PURE__ */ _interopDefaultLegacy(ipsum);
91
98
  var Lists__default = /* @__PURE__ */ _interopDefaultLegacy(Lists);
@@ -239,20 +246,126 @@ const TABLE_BY_ID = client.gql`
239
246
  function isNonNullable(value) {
240
247
  return value != null;
241
248
  }
249
+ const typePolicies = {
250
+ Query: {
251
+ fields: {
252
+ swatches(existingData, {
253
+ args,
254
+ toReference
255
+ }) {
256
+ return existingData != null ? existingData : args == null ? void 0 : args.ids.map((id) => toReference({
257
+ __typename: "Swatch",
258
+ id
259
+ }, true));
260
+ },
261
+ file(existingData, {
262
+ args,
263
+ toReference
264
+ }) {
265
+ return existingData != null ? existingData : toReference({
266
+ __typename: "File",
267
+ id: args == null ? void 0 : args.id
268
+ }, true);
269
+ },
270
+ files(existingData, {
271
+ args,
272
+ toReference
273
+ }) {
274
+ return existingData != null ? existingData : args == null ? void 0 : args.ids.map((id) => toReference({
275
+ __typename: "File",
276
+ id
277
+ }, true));
278
+ },
279
+ typographies(existingData, {
280
+ args,
281
+ toReference
282
+ }) {
283
+ return existingData != null ? existingData : args == null ? void 0 : args.ids.map((id) => toReference({
284
+ __typename: "Typography",
285
+ id
286
+ }, true));
287
+ },
288
+ pagePathnamesById(existingData, {
289
+ args,
290
+ toReference
291
+ }) {
292
+ return existingData != null ? existingData : args == null ? void 0 : args.ids.map((id) => toReference({
293
+ __typename: "PagePathnameSlice",
294
+ id
295
+ }, true));
296
+ },
297
+ globalElement(existingData, {
298
+ args,
299
+ toReference
300
+ }) {
301
+ return existingData != null ? existingData : toReference({
302
+ __typename: "GlobalElement",
303
+ id: args == null ? void 0 : args.id
304
+ }, true);
305
+ },
306
+ table(existingData, {
307
+ args,
308
+ toReference
309
+ }) {
310
+ return existingData != null ? existingData : toReference({
311
+ __typename: "Table",
312
+ id: args == null ? void 0 : args.id
313
+ }, true);
314
+ }
315
+ }
316
+ }
317
+ };
318
+ function createApolloClient({
319
+ uri,
320
+ cacheData
321
+ }) {
322
+ const cache = new client.InMemoryCache({
323
+ typePolicies
324
+ });
325
+ if (cacheData)
326
+ cache.restore(cacheData);
327
+ return new client.ApolloClient({
328
+ uri,
329
+ cache
330
+ });
331
+ }
332
+ class MakeswiftClient {
333
+ constructor({
334
+ uri,
335
+ cacheData
336
+ }) {
337
+ __publicField(this, "apolloClient");
338
+ this.apolloClient = createApolloClient({
339
+ uri,
340
+ cacheData
341
+ });
342
+ }
343
+ async prefetch(element) {
344
+ const id = uuid__default["default"]();
345
+ await ssr.getDataFromTree(/* @__PURE__ */ jsxRuntime.jsx(RuntimeProvider, {
346
+ client: this,
347
+ defaultRootElements: /* @__PURE__ */ new Map([[id, element]]),
348
+ children: /* @__PURE__ */ jsxRuntime.jsx(DocumentReference, {
349
+ documentReference: reactPage.createDocumentReference(id)
350
+ })
351
+ }));
352
+ return this.apolloClient.cache.extract();
353
+ }
354
+ }
242
355
  const Context$2 = React.createContext(void 0);
243
356
  function useQuery(query, options) {
244
357
  const client$1 = React.useContext(Context$2);
245
358
  return client.useQuery(query, __spreadValues({
246
- client: client$1
359
+ client: client$1 == null ? void 0 : client$1.apolloClient
247
360
  }, options));
248
361
  }
249
362
  function useMutation(mutation, options) {
250
363
  const client$1 = React.useContext(Context$2);
251
364
  return client.useMutation(mutation, __spreadValues({
252
- client: client$1
365
+ client: client$1 == null ? void 0 : client$1.apolloClient
253
366
  }, options));
254
367
  }
255
- function ApolloProvider({
368
+ function MakeswiftProvider({
256
369
  client: client2,
257
370
  children
258
371
  }) {
@@ -1107,7 +1220,7 @@ function Parallax(_g2) {
1107
1220
  children: children(getProps)
1108
1221
  }));
1109
1222
  }
1110
- const Container$c = styled__default["default"].div`
1223
+ const Container$d = styled__default["default"].div`
1111
1224
  position: absolute;
1112
1225
  top: 0;
1113
1226
  left: 0;
@@ -1161,7 +1274,7 @@ function BackgroundVideo({
1161
1274
  }, [aspectRatio, zoom]);
1162
1275
  if (!ReactPlayer__default["default"].canPlay(url))
1163
1276
  return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, {});
1164
- return /* @__PURE__ */ jsxRuntime.jsxs(Container$c, {
1277
+ return /* @__PURE__ */ jsxRuntime.jsxs(Container$d, {
1165
1278
  ref: container,
1166
1279
  children: [container.current && /* @__PURE__ */ jsxRuntime.jsx(ReactPlayer__default["default"], {
1167
1280
  url,
@@ -1240,10 +1353,10 @@ const AbsoluteFill = styled__default["default"].div`
1240
1353
  right: 0;
1241
1354
  bottom: 0;
1242
1355
  `;
1243
- const Container$b = styled__default["default"](AbsoluteFill)`
1356
+ const Container$c = styled__default["default"](AbsoluteFill)`
1244
1357
  border-radius: inherit;
1245
1358
  `;
1246
- const BackgroundsContainer$1 = styled__default["default"](Container$b)`
1359
+ const BackgroundsContainer$1 = styled__default["default"](Container$c)`
1247
1360
  overflow: hidden;
1248
1361
  ${(p) => cssMediaRules([p.visibility], ([visibility]) => styled.css`
1249
1362
  display: ${visibility === true ? "block" : "none"};
@@ -1267,7 +1380,7 @@ function Backgrounds({
1267
1380
  visibility,
1268
1381
  children: [...value].reverse().map((bg) => {
1269
1382
  if (bg.type === "color") {
1270
- return /* @__PURE__ */ jsxRuntime.jsx(Container$b, {
1383
+ return /* @__PURE__ */ jsxRuntime.jsx(Container$c, {
1271
1384
  style: {
1272
1385
  backgroundColor: getColor(bg.payload)
1273
1386
  }
@@ -1303,7 +1416,7 @@ function Backgrounds({
1303
1416
  }
1304
1417
  return /* @__PURE__ */ jsxRuntime.jsx(Parallax, {
1305
1418
  strength: parallax,
1306
- children: (getParallaxProps) => /* @__PURE__ */ jsxRuntime.jsx(Container$b, __spreadValues({}, getParallaxProps({
1419
+ children: (getParallaxProps) => /* @__PURE__ */ jsxRuntime.jsx(Container$c, __spreadValues({}, getParallaxProps({
1307
1420
  style: {
1308
1421
  backgroundImage: publicUrl != null ? `url('${publicUrl}')` : void 0,
1309
1422
  backgroundPosition,
@@ -1321,7 +1434,7 @@ function Backgrounds({
1321
1434
  isRadial
1322
1435
  } = bg.payload;
1323
1436
  const gradient = `${getStopsStyle(stops)}`;
1324
- return /* @__PURE__ */ jsxRuntime.jsx(Container$b, {
1437
+ return /* @__PURE__ */ jsxRuntime.jsx(Container$c, {
1325
1438
  style: {
1326
1439
  background: isRadial ? `radial-gradient(${gradient})` : `linear-gradient(${angle}rad, ${gradient})`
1327
1440
  }
@@ -1338,7 +1451,7 @@ function Backgrounds({
1338
1451
  } = bg.payload;
1339
1452
  return /* @__PURE__ */ jsxRuntime.jsx(Parallax, {
1340
1453
  strength: parallax,
1341
- children: (getParallaxProps) => /* @__PURE__ */ jsxRuntime.jsx(Container$b, __spreadProps(__spreadValues({}, getParallaxProps({})), {
1454
+ children: (getParallaxProps) => /* @__PURE__ */ jsxRuntime.jsx(Container$c, __spreadProps(__spreadValues({}, getParallaxProps({})), {
1342
1455
  children: /* @__PURE__ */ jsxRuntime.jsx(BackgroundVideo, {
1343
1456
  url,
1344
1457
  zoom,
@@ -1534,7 +1647,7 @@ const Box = React.forwardRef(function Box2({
1534
1647
  })
1535
1648
  }, key == null ? void 0 : key.container);
1536
1649
  });
1537
- function registerComponent$b(runtime) {
1650
+ function registerComponent$c(runtime) {
1538
1651
  return runtime.registerComponent(Box, {
1539
1652
  type: "./components/Box/index.js",
1540
1653
  label: "Box",
@@ -2032,7 +2145,7 @@ const Button$1 = React.forwardRef(function Button2(_m, ref) {
2032
2145
  children: children == null ? "Button Text" : children
2033
2146
  }));
2034
2147
  });
2035
- function registerComponent$a(runtime) {
2148
+ function registerComponent$b(runtime) {
2036
2149
  return runtime.registerComponent(Button$1, {
2037
2150
  type: "./components/Button/index.js",
2038
2151
  label: "Button",
@@ -2128,6 +2241,10 @@ const placeholders = {
2128
2241
  image: {
2129
2242
  src: "data:image/svg+xml,%3Csvg width='360' height='240' viewBox='0 0 360 240' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cg clip-path='url(%23clip0)'%3E%3Cpath d='M0 0H360V240H0V0Z' fill='%23A1A8C2' fill-opacity='0.18'/%3E%3Cpath d='M260 59C260 78.33 244.33 94 225 94C205.67 94 190 78.33 190 59C190 39.67 205.67 24 225 24C244.33 24 260 39.67 260 59Z' fill='%23A1A8C2' fill-opacity='0.25'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M319 250H417L291.485 124.485C286.799 119.799 279.201 119.799 274.515 124.485L234 165L319 250Z' fill='%23A1A8C2' fill-opacity='0.25'/%3E%3Cpath d='M311 250L-89 250L102.515 58.4853C107.201 53.799 114.799 53.799 119.485 58.4853L311 250Z' fill='%23A1A8C2' fill-opacity='0.25'/%3E%3C/g%3E%3Cdefs%3E%3CclipPath id='clip0'%3E%3Cpath d='M0 0H360V240H0V0Z' fill='white'/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E%0A",
2130
2243
  dimensions: { width: 360, height: 240 }
2244
+ },
2245
+ video: {
2246
+ src: "data:image/svg+xml,%3Csvg width='712' height='400' viewBox='0 0 712 400' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M712 0H0V400H712V0ZM356 240C378.091 240 396 222.091 396 200C396 177.909 378.091 160 356 160C333.909 160 316 177.909 316 200C316 222.091 333.909 240 356 240Z' fill='%23A1A8C2' fill-opacity='0.18'/%3E%3Cpath d='M344 216.503V183.497C344 181.95 345.681 180.989 347.014 181.773L375.069 198.276C376.384 199.049 376.384 200.951 375.069 201.724L347.014 218.227C345.681 219.011 344 218.05 344 216.503Z' fill='%23A1A8C2' fill-opacity='0.4'/%3E%3C/svg%3E%0A",
2247
+ dimensions: { width: 712, height: 400 }
2131
2248
  }
2132
2249
  };
2133
2250
  function loadImage(src) {
@@ -2233,7 +2350,7 @@ const ImageComponent = React.forwardRef(function Image2({
2233
2350
  })
2234
2351
  });
2235
2352
  });
2236
- function registerComponent$9(runtime) {
2353
+ function registerComponent$a(runtime) {
2237
2354
  return runtime.registerComponent(ImageComponent, {
2238
2355
  type: "./components/Image/index.js",
2239
2356
  label: "Image",
@@ -2282,7 +2399,7 @@ const RightChevron = () => /* @__PURE__ */ jsxRuntime.jsx("svg", {
2282
2399
  strokeWidth: "2"
2283
2400
  })
2284
2401
  });
2285
- const Container$a = styled__default["default"].div`
2402
+ const Container$b = styled__default["default"].div`
2286
2403
  position: relative;
2287
2404
  height: 100%;
2288
2405
  `;
@@ -2582,7 +2699,7 @@ const Carousel = React.forwardRef(function Carousel2({
2582
2699
  break;
2583
2700
  }
2584
2701
  },
2585
- children: [/* @__PURE__ */ jsxRuntime.jsxs(Container$a, {
2702
+ children: [/* @__PURE__ */ jsxRuntime.jsxs(Container$b, {
2586
2703
  children: [/* @__PURE__ */ jsxRuntime.jsx(ClipMask, {
2587
2704
  children: /* @__PURE__ */ jsxRuntime.jsx(Page, __spreadProps(__spreadValues({}, bindPage()), {
2588
2705
  animate: animation,
@@ -2658,7 +2775,7 @@ const Carousel = React.forwardRef(function Carousel2({
2658
2775
  })]
2659
2776
  });
2660
2777
  });
2661
- function registerComponent$8(runtime) {
2778
+ function registerComponent$9(runtime) {
2662
2779
  return runtime.registerComponent(Carousel, {
2663
2780
  type: "./components/Carousel/index.js",
2664
2781
  label: "Carousel",
@@ -2785,7 +2902,7 @@ const Segment = styled__default["default"].div`
2785
2902
  flex: 1;
2786
2903
  text-align: center;
2787
2904
  `;
2788
- const Container$9 = styled__default["default"].div`
2905
+ const Container$a = styled__default["default"].div`
2789
2906
  display: flex;
2790
2907
  ${cssWidth("560px")}
2791
2908
  ${cssMargin()}
@@ -3025,7 +3142,7 @@ const Countdown = React.forwardRef(function Countdown2({
3025
3142
  }, 1e3);
3026
3143
  return () => clearInterval(intervalId);
3027
3144
  }, [date]);
3028
- return /* @__PURE__ */ jsxRuntime.jsxs(Container$9, {
3145
+ return /* @__PURE__ */ jsxRuntime.jsxs(Container$a, {
3029
3146
  ref,
3030
3147
  id,
3031
3148
  width,
@@ -3074,7 +3191,7 @@ const Countdown = React.forwardRef(function Countdown2({
3074
3191
  })]
3075
3192
  });
3076
3193
  });
3077
- function registerComponent$7(runtime) {
3194
+ function registerComponent$8(runtime) {
3078
3195
  return runtime.registerComponent(Countdown, {
3079
3196
  type: "./components/Countdown/index.js",
3080
3197
  label: "Countdown",
@@ -3210,7 +3327,7 @@ const IE11MinHeightContainer = styled__default["default"].div`
3210
3327
  ${cssWidth()}
3211
3328
  ${cssMargin()}
3212
3329
  `;
3213
- const Container$8 = styled__default["default"].div`
3330
+ const Container$9 = styled__default["default"].div`
3214
3331
  display: flex;
3215
3332
  flex-direction: column;
3216
3333
  justify-content: center;
@@ -3269,7 +3386,7 @@ const Divider = React.forwardRef(function Divider2({
3269
3386
  id,
3270
3387
  width,
3271
3388
  margin,
3272
- children: /* @__PURE__ */ jsxRuntime.jsx(Container$8, {
3389
+ children: /* @__PURE__ */ jsxRuntime.jsx(Container$9, {
3273
3390
  children: /* @__PURE__ */ jsxRuntime.jsx(Line, {
3274
3391
  variant,
3275
3392
  thickness,
@@ -3278,7 +3395,7 @@ const Divider = React.forwardRef(function Divider2({
3278
3395
  })
3279
3396
  });
3280
3397
  });
3281
- function registerComponent$6(runtime) {
3398
+ function registerComponent$7(runtime) {
3282
3399
  return runtime.registerComponent(Divider, {
3283
3400
  type: "./components/Divider/index.js",
3284
3401
  label: "Divider",
@@ -3328,7 +3445,7 @@ function registerComponent$6(runtime) {
3328
3445
  }
3329
3446
  });
3330
3447
  }
3331
- const Container$7 = styled__default["default"].div`
3448
+ const Container$8 = styled__default["default"].div`
3332
3449
  min-height: 15px;
3333
3450
  ${cssWidth()}
3334
3451
  ${cssMargin()}
@@ -3408,7 +3525,7 @@ const Embed = React.forwardRef(function Embed2({
3408
3525
  }, [container, html]);
3409
3526
  if (shouldRender === false)
3410
3527
  return null;
3411
- return /* @__PURE__ */ jsxRuntime.jsx(Container$7, {
3528
+ return /* @__PURE__ */ jsxRuntime.jsx(Container$8, {
3412
3529
  ref: setContainer,
3413
3530
  id,
3414
3531
  margin,
@@ -3418,7 +3535,7 @@ const Embed = React.forwardRef(function Embed2({
3418
3535
  }
3419
3536
  });
3420
3537
  });
3421
- function registerComponent$5(runtime) {
3538
+ function registerComponent$6(runtime) {
3422
3539
  return runtime.registerComponent(Embed, {
3423
3540
  type: "./components/Embed/index.js",
3424
3541
  label: "Embed",
@@ -3640,7 +3757,7 @@ var Input$2 = React.forwardRef(function Input2(_o, ref) {
3640
3757
  brandColor
3641
3758
  }));
3642
3759
  });
3643
- const Container$6 = styled__default["default"].div`
3760
+ const Container$7 = styled__default["default"].div`
3644
3761
  display: flex;
3645
3762
  flex-direction: column;
3646
3763
  ${cssWidth()};
@@ -3675,7 +3792,7 @@ var Placeholder$1 = React.forwardRef(function Placeholder3({
3675
3792
  width,
3676
3793
  margin
3677
3794
  }, ref) {
3678
- return /* @__PURE__ */ jsxRuntime.jsxs(Container$6, {
3795
+ return /* @__PURE__ */ jsxRuntime.jsxs(Container$7, {
3679
3796
  ref,
3680
3797
  width,
3681
3798
  margin,
@@ -3842,7 +3959,7 @@ function getCheckmarkColor$1({
3842
3959
  l
3843
3960
  }).alpha(a).isLight() ? "rgba(0, 0, 0, 0.7)" : "rgba(255, 255, 255, 0.95)";
3844
3961
  }
3845
- const Container$5 = styled__default["default"].div`
3962
+ const Container$6 = styled__default["default"].div`
3846
3963
  position: relative;
3847
3964
  ${(props) => cssMediaRules([props.size], ([size = Sizes.MEDIUM]) => styled.css`
3848
3965
  height: ${getSizeHeight(size)}px;
@@ -3962,7 +4079,7 @@ var Checkbox = React.forwardRef(function Checkbox2(_w, ref) {
3962
4079
  contrast,
3963
4080
  brandColor
3964
4081
  } = useFormContext();
3965
- return /* @__PURE__ */ jsxRuntime.jsxs(Container$5, {
4082
+ return /* @__PURE__ */ jsxRuntime.jsxs(Container$6, {
3966
4083
  size,
3967
4084
  children: [/* @__PURE__ */ jsxRuntime.jsx(HiddenCheckbox, __spreadProps(__spreadValues({}, restOfProps), {
3968
4085
  type: "checkbox",
@@ -4105,7 +4222,7 @@ function getCheckmarkColor({
4105
4222
  l
4106
4223
  }).alpha(a).isLight() ? "rgba(0, 0, 0, 0.7)" : "rgba(255, 255, 255, 0.95)";
4107
4224
  }
4108
- const Container$4 = styled__default["default"].div`
4225
+ const Container$5 = styled__default["default"].div`
4109
4226
  position: relative;
4110
4227
  ${(props) => cssMediaRules([props.size], ([size = Sizes.MEDIUM]) => styled.css`
4111
4228
  height: ${getSizeHeight(size)}px;
@@ -4218,7 +4335,7 @@ var RadioButton = React.forwardRef(function RadioButton2(_C, ref) {
4218
4335
  contrast,
4219
4336
  brandColor
4220
4337
  } = useFormContext();
4221
- return /* @__PURE__ */ jsxRuntime.jsxs(Container$4, {
4338
+ return /* @__PURE__ */ jsxRuntime.jsxs(Container$5, {
4222
4339
  size,
4223
4340
  children: [/* @__PURE__ */ jsxRuntime.jsx(HiddenRadioButton, __spreadProps(__spreadValues({}, restOfProps), {
4224
4341
  ref,
@@ -4290,7 +4407,7 @@ var TableColumnRadioButtonGroup = React.forwardRef(function TableColumnRadioButt
4290
4407
  }, option.id))]
4291
4408
  });
4292
4409
  });
4293
- const Container$3 = styled__default["default"].div`
4410
+ const Container$4 = styled__default["default"].div`
4294
4411
  ${cssField()}
4295
4412
  display: flex;
4296
4413
  align-items: center;
@@ -4355,7 +4472,7 @@ var TableColumnSingleSelect = React.forwardRef(function TableColumnSingleSelect2
4355
4472
  children: [!hideLabel && /* @__PURE__ */ jsxRuntime.jsx(Label$1, {
4356
4473
  htmlFor: id,
4357
4474
  children: label
4358
- }), /* @__PURE__ */ jsxRuntime.jsxs(Container$3, {
4475
+ }), /* @__PURE__ */ jsxRuntime.jsxs(Container$4, {
4359
4476
  error,
4360
4477
  shape,
4361
4478
  size,
@@ -5048,7 +5165,7 @@ const Form = React.forwardRef(function Form2({
5048
5165
  })
5049
5166
  });
5050
5167
  });
5051
- function registerComponent$4(runtime) {
5168
+ function registerComponent$5(runtime) {
5052
5169
  return runtime.registerComponent(Form, {
5053
5170
  type: "./components/Form/index.js",
5054
5171
  label: "Form",
@@ -5608,7 +5725,7 @@ function MobileDropDownButton(_Y) {
5608
5725
  const ButtonLink = styled__default["default"](Button$1)`
5609
5726
  margin: 8px 0;
5610
5727
  `;
5611
- const Container$2 = styled__default["default"].div`
5728
+ const Container$3 = styled__default["default"].div`
5612
5729
  position: fixed;
5613
5730
  flex-direction: column;
5614
5731
  width: 100%;
@@ -5662,7 +5779,7 @@ function MobileMenu({
5662
5779
  onClose = () => {
5663
5780
  }
5664
5781
  }) {
5665
- return /* @__PURE__ */ jsxRuntime.jsxs(Container$2, {
5782
+ return /* @__PURE__ */ jsxRuntime.jsxs(Container$3, {
5666
5783
  animation,
5667
5784
  backgroundColor: useColor(backgroundColor),
5668
5785
  open,
@@ -5688,7 +5805,7 @@ function MobileMenu({
5688
5805
  })]
5689
5806
  });
5690
5807
  }
5691
- const Container$1 = styled__default["default"].nav`
5808
+ const Container$2 = styled__default["default"].nav`
5692
5809
  display: flex;
5693
5810
  align-items: center;
5694
5811
  ${cssWidth()}
@@ -5745,7 +5862,7 @@ const Navigation = React.forwardRef(function Navigation2({
5745
5862
  margin
5746
5863
  }, ref) {
5747
5864
  const [isOpen, setIsOpen] = React.useState(false);
5748
- return /* @__PURE__ */ jsxRuntime.jsxs(Container$1, {
5865
+ return /* @__PURE__ */ jsxRuntime.jsxs(Container$2, {
5749
5866
  ref,
5750
5867
  id,
5751
5868
  margin,
@@ -5793,7 +5910,7 @@ const Navigation = React.forwardRef(function Navigation2({
5793
5910
  })]
5794
5911
  });
5795
5912
  });
5796
- function registerComponent$3(runtime) {
5913
+ function registerComponent$4(runtime) {
5797
5914
  return runtime.registerComponent(Navigation, {
5798
5915
  type: "./components/Navigation/index.js",
5799
5916
  label: "Navigation",
@@ -5970,7 +6087,7 @@ const Root = React.forwardRef(function Page2({
5970
6087
  })]
5971
6088
  });
5972
6089
  });
5973
- function registerComponent$2(runtime) {
6090
+ function registerComponent$3(runtime) {
5974
6091
  return runtime.registerComponent(Root, {
5975
6092
  type: "./components/Root/index.js",
5976
6093
  label: "Page",
@@ -6647,7 +6764,7 @@ function SocialLinksPlaceholder({
6647
6764
  }, link.id))
6648
6765
  });
6649
6766
  }
6650
- const Container = styled__default["default"].div`
6767
+ const Container$1 = styled__default["default"].div`
6651
6768
  display: flex;
6652
6769
  flex-direction: row;
6653
6770
  flex-wrap: wrap;
@@ -6731,7 +6848,7 @@ const SocialLinks = React.forwardRef(function SocialLinks2({
6731
6848
  }, ref) {
6732
6849
  const fillData = useColor(fill);
6733
6850
  const backgroundColorData = useColor(backgroundColor);
6734
- return /* @__PURE__ */ jsxRuntime.jsx(Container, {
6851
+ return /* @__PURE__ */ jsxRuntime.jsx(Container$1, {
6735
6852
  ref,
6736
6853
  id,
6737
6854
  alignment,
@@ -6767,7 +6884,7 @@ const SocialLinks = React.forwardRef(function SocialLinks2({
6767
6884
  })
6768
6885
  });
6769
6886
  });
6770
- function registerComponent$1(runtime) {
6887
+ function registerComponent$2(runtime) {
6771
6888
  return runtime.registerComponent(SocialLinks, {
6772
6889
  type: "./components/SocialLinks/index.js",
6773
6890
  label: "Social Links",
@@ -7304,7 +7421,7 @@ const Text = React.forwardRef(function Text2({
7304
7421
  onKeyDown: handleKeyDown
7305
7422
  });
7306
7423
  });
7307
- function registerComponent(runtime) {
7424
+ function registerComponent$1(runtime) {
7308
7425
  return runtime.registerComponent(Text, {
7309
7426
  type: "./components/Text/index.js",
7310
7427
  label: "Text",
@@ -7382,19 +7499,103 @@ function registerComponent(runtime) {
7382
7499
  }
7383
7500
  });
7384
7501
  }
7502
+ const Container = styled__default["default"].div`
7503
+ display: flex;
7504
+ flex-direction: column;
7505
+ overflow: hidden;
7506
+ ${cssWidth("560px")}
7507
+ ${cssMargin()}
7508
+ ${cssBorderRadius()}
7509
+ `;
7510
+ const ASPECT_RATIO = 16 / 9;
7511
+ const Video = React.forwardRef(function Video2({
7512
+ id,
7513
+ video,
7514
+ width,
7515
+ margin,
7516
+ borderRadius
7517
+ }, ref) {
7518
+ const canPlayUrl = video && video.url != null && ReactPlayer__default["default"].canPlay(video.url);
7519
+ return /* @__PURE__ */ jsxRuntime.jsx(Container, {
7520
+ ref,
7521
+ id,
7522
+ width,
7523
+ margin,
7524
+ borderRadius,
7525
+ children: /* @__PURE__ */ jsxRuntime.jsx("div", {
7526
+ style: {
7527
+ position: "relative",
7528
+ paddingTop: `${100 / ASPECT_RATIO}%`
7529
+ },
7530
+ children: /* @__PURE__ */ jsxRuntime.jsx("div", {
7531
+ style: {
7532
+ position: "absolute",
7533
+ top: 0,
7534
+ left: 0,
7535
+ right: 0,
7536
+ bottom: 0
7537
+ },
7538
+ children: canPlayUrl === true ? /* @__PURE__ */ jsxRuntime.jsx(ReactPlayer__default["default"], __spreadProps(__spreadValues({}, video), {
7539
+ width: "100%",
7540
+ height: "100%",
7541
+ config: {
7542
+ vimeo: {
7543
+ playerOptions: {
7544
+ background: video != null && !video.controls
7545
+ }
7546
+ },
7547
+ wistia: {
7548
+ options: {
7549
+ endVideoBehavior: video != null && video.loop === true ? "loop" : "default"
7550
+ }
7551
+ }
7552
+ }
7553
+ })) : /* @__PURE__ */ jsxRuntime.jsx("img", {
7554
+ width: "100%",
7555
+ src: placeholders.video.src,
7556
+ alt: "Video Placeholder"
7557
+ })
7558
+ })
7559
+ })
7560
+ });
7561
+ });
7562
+ function registerComponent(runtime) {
7563
+ return runtime.registerComponent(Video, {
7564
+ type: "./components/Video/index.js",
7565
+ label: "Video",
7566
+ icon: "Video40",
7567
+ props: {
7568
+ id: descriptors.ElementID(),
7569
+ video: descriptors.Video({
7570
+ preset: {
7571
+ controls: true
7572
+ }
7573
+ }),
7574
+ width: descriptors.Width({
7575
+ defaultValue: {
7576
+ value: 560,
7577
+ unit: "px"
7578
+ }
7579
+ }),
7580
+ margin: descriptors.Margin(),
7581
+ borderRadius: descriptors.BorderRadius()
7582
+ }
7583
+ });
7584
+ }
7385
7585
  function registerBuiltinComponents(runtime) {
7386
- const unregisterBoxComponent = registerComponent$b(runtime);
7387
- const unregisterButtonComponent = registerComponent$a(runtime);
7388
- const unregisterCarouselComponent = registerComponent$8(runtime);
7389
- const unregisterCountdownComponent = registerComponent$7(runtime);
7390
- const unregisterDividerComponent = registerComponent$6(runtime);
7391
- const unregisterEmbedComponent = registerComponent$5(runtime);
7392
- const unregisterFormComponent = registerComponent$4(runtime);
7393
- const unregisterImageComponent = registerComponent$9(runtime);
7394
- const unregisterNavigationComponent = registerComponent$3(runtime);
7395
- const unregisterRootComponent = registerComponent$2(runtime);
7396
- const unregisterSocialLinksComponent = registerComponent$1(runtime);
7397
- const unregisterTextComponent = registerComponent(runtime);
7586
+ const unregisterBoxComponent = registerComponent$c(runtime);
7587
+ const unregisterButtonComponent = registerComponent$b(runtime);
7588
+ const unregisterCarouselComponent = registerComponent$9(runtime);
7589
+ const unregisterCountdownComponent = registerComponent$8(runtime);
7590
+ const unregisterDividerComponent = registerComponent$7(runtime);
7591
+ const unregisterEmbedComponent = registerComponent$6(runtime);
7592
+ const unregisterFormComponent = registerComponent$5(runtime);
7593
+ const unregisterImageComponent = registerComponent$a(runtime);
7594
+ const unregisterNavigationComponent = registerComponent$4(runtime);
7595
+ const unregisterRootComponent = registerComponent$3(runtime);
7596
+ const unregisterSocialLinksComponent = registerComponent$2(runtime);
7597
+ const unregisterTextComponent = registerComponent$1(runtime);
7598
+ const unregisterVideoComponent = registerComponent(runtime);
7398
7599
  return () => {
7399
7600
  unregisterBoxComponent();
7400
7601
  unregisterButtonComponent();
@@ -7408,6 +7609,8 @@ function registerBuiltinComponents(runtime) {
7408
7609
  unregisterRootComponent();
7409
7610
  unregisterSocialLinksComponent();
7410
7611
  unregisterTextComponent();
7612
+ unregisterTextComponent();
7613
+ unregisterVideoComponent();
7411
7614
  };
7412
7615
  }
7413
7616
  const contextDefaultValue = reactPage.configureStore();
@@ -7436,10 +7639,9 @@ function createReactRuntime(store) {
7436
7639
  const ReactRuntime = createReactRuntime(contextDefaultValue);
7437
7640
  const Context = React.createContext(contextDefaultValue);
7438
7641
  function RuntimeProvider({
7642
+ client: client2,
7439
7643
  children,
7440
- defaultRootElements,
7441
- registerComponents,
7442
- makeswiftApiEndpoint
7644
+ defaultRootElements
7443
7645
  }) {
7444
7646
  const [store, setStore] = React.useState(() => {
7445
7647
  const store2 = reactPage.configureStore({
@@ -7448,27 +7650,11 @@ function RuntimeProvider({
7448
7650
  });
7449
7651
  const runtime = createReactRuntime(store2);
7450
7652
  registerBuiltinComponents(runtime);
7451
- registerComponents == null ? void 0 : registerComponents(runtime);
7452
7653
  return store2;
7453
7654
  });
7454
- const [client$1, setClient] = React.useState(new client.ApolloClient({
7455
- uri: makeswiftApiEndpoint,
7456
- cache: new client.InMemoryCache()
7457
- }));
7458
- React.useEffect(() => {
7459
- setClient(({
7460
- cache
7461
- }) => new client.ApolloClient({
7462
- uri: makeswiftApiEndpoint,
7463
- cache
7464
- }));
7465
- }, [makeswiftApiEndpoint]);
7466
7655
  React.useEffect(() => {
7467
7656
  return registerBuiltinComponents(createReactRuntime(store));
7468
7657
  }, [store]);
7469
- React.useEffect(() => {
7470
- return registerComponents == null ? void 0 : registerComponents(createReactRuntime(store));
7471
- }, [store, registerComponents]);
7472
7658
  React.useEffect(() => {
7473
7659
  const isInBuilder = window.parent !== window;
7474
7660
  if (isInBuilder)
@@ -7479,10 +7665,10 @@ function RuntimeProvider({
7479
7665
  });
7480
7666
  setStore((store2) => ReactBuilderPreview.configureStore({
7481
7667
  preloadedState: store2.getState(),
7482
- client: client$1
7668
+ client: client2.apolloClient
7483
7669
  }));
7484
7670
  }
7485
- }, [client$1]);
7671
+ }, [client2]);
7486
7672
  React.useEffect(() => {
7487
7673
  const isInBuilder = window.parent !== window;
7488
7674
  if (!isInBuilder)
@@ -7506,8 +7692,8 @@ function RuntimeProvider({
7506
7692
  }, []);
7507
7693
  return /* @__PURE__ */ jsxRuntime.jsx(Context.Provider, {
7508
7694
  value: store,
7509
- children: /* @__PURE__ */ jsxRuntime.jsx(ApolloProvider, {
7510
- client: client$1,
7695
+ children: /* @__PURE__ */ jsxRuntime.jsx(MakeswiftProvider, {
7696
+ client: client2,
7511
7697
  children
7512
7698
  })
7513
7699
  });
@@ -7705,6 +7891,7 @@ exports.Element = Element$1;
7705
7891
  exports.Embed = Embed;
7706
7892
  exports.Form = Form;
7707
7893
  exports.ImageComponent = ImageComponent;
7894
+ exports.MakeswiftClient = MakeswiftClient;
7708
7895
  exports.Navigation = Navigation;
7709
7896
  exports.PageProvider = PageProvider;
7710
7897
  exports.ReactRuntime = ReactRuntime;
@@ -7722,7 +7909,15 @@ exports.cssPadding = cssPadding;
7722
7909
  exports.cssTextStyle = cssTextStyle;
7723
7910
  exports.cssWidth = cssWidth;
7724
7911
  exports.registerBuiltinComponents = registerBuiltinComponents;
7725
- exports.registerComponent = registerComponent$b;
7912
+ exports.registerComponent = registerComponent$c;
7913
+ exports.useBackgrounds = useBackgrounds;
7914
+ exports.useBorder = useBorder;
7915
+ exports.useBoxShadow = useBoxShadow;
7916
+ exports.useColor = useColor;
7917
+ exports.useFile = useFile;
7726
7918
  exports.useIsInBuilder = useIsInBuilder;
7919
+ exports.useMediaQuery = useMediaQuery;
7920
+ exports.usePage = usePage;
7727
7921
  exports.usePageId = usePageId;
7922
+ exports.useTable = useTable;
7728
7923
  //# sourceMappingURL=react.cjs2.js.map