@makeswift/runtime 0.0.0-3ead317 → 0.0.0-41fecbb

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.
@@ -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,6 +41,8 @@ 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");
41
47
  var boxModels = require("./box-models.cjs.js");
42
48
  var NextImage = require("next/image");
@@ -47,7 +53,6 @@ var scrollIntoView = require("scroll-into-view-if-needed");
47
53
  var NextLink = require("next/link");
48
54
  var reactUseGesture = require("react-use-gesture");
49
55
  var popcorn = require("@popmotion/popcorn");
50
- var uuid = require("uuid/v4");
51
56
  var formik = require("formik");
52
57
  var polished = require("polished");
53
58
  var slate = require("slate");
@@ -80,12 +85,12 @@ function _interopNamespace(e) {
80
85
  }
81
86
  var React__namespace = /* @__PURE__ */ _interopNamespace(React);
82
87
  var styled__default = /* @__PURE__ */ _interopDefaultLegacy(styled);
88
+ var uuid__default = /* @__PURE__ */ _interopDefaultLegacy(uuid);
83
89
  var NextImage__default = /* @__PURE__ */ _interopDefaultLegacy(NextImage);
84
90
  var ReactPlayer__default = /* @__PURE__ */ _interopDefaultLegacy(ReactPlayer);
85
91
  var ColorHelper__default = /* @__PURE__ */ _interopDefaultLegacy(ColorHelper);
86
92
  var scrollIntoView__default = /* @__PURE__ */ _interopDefaultLegacy(scrollIntoView);
87
93
  var NextLink__default = /* @__PURE__ */ _interopDefaultLegacy(NextLink);
88
- var uuid__default = /* @__PURE__ */ _interopDefaultLegacy(uuid);
89
94
  var Hotkeys__default = /* @__PURE__ */ _interopDefaultLegacy(Hotkeys);
90
95
  var ipsum__default = /* @__PURE__ */ _interopDefaultLegacy(ipsum);
91
96
  var Lists__default = /* @__PURE__ */ _interopDefaultLegacy(Lists);
@@ -239,20 +244,126 @@ const TABLE_BY_ID = client.gql`
239
244
  function isNonNullable(value) {
240
245
  return value != null;
241
246
  }
247
+ const typePolicies = {
248
+ Query: {
249
+ fields: {
250
+ swatches(existingData, {
251
+ args,
252
+ toReference
253
+ }) {
254
+ return existingData != null ? existingData : args == null ? void 0 : args.ids.map((id) => toReference({
255
+ __typename: "Swatch",
256
+ id
257
+ }, true));
258
+ },
259
+ file(existingData, {
260
+ args,
261
+ toReference
262
+ }) {
263
+ return existingData != null ? existingData : toReference({
264
+ __typename: "File",
265
+ id: args == null ? void 0 : args.id
266
+ }, true);
267
+ },
268
+ files(existingData, {
269
+ args,
270
+ toReference
271
+ }) {
272
+ return existingData != null ? existingData : args == null ? void 0 : args.ids.map((id) => toReference({
273
+ __typename: "File",
274
+ id
275
+ }, true));
276
+ },
277
+ typographies(existingData, {
278
+ args,
279
+ toReference
280
+ }) {
281
+ return existingData != null ? existingData : args == null ? void 0 : args.ids.map((id) => toReference({
282
+ __typename: "Typography",
283
+ id
284
+ }, true));
285
+ },
286
+ pagePathnamesById(existingData, {
287
+ args,
288
+ toReference
289
+ }) {
290
+ return existingData != null ? existingData : args == null ? void 0 : args.ids.map((id) => toReference({
291
+ __typename: "PagePathnameSlice",
292
+ id
293
+ }, true));
294
+ },
295
+ globalElement(existingData, {
296
+ args,
297
+ toReference
298
+ }) {
299
+ return existingData != null ? existingData : toReference({
300
+ __typename: "GlobalElement",
301
+ id: args == null ? void 0 : args.id
302
+ }, true);
303
+ },
304
+ table(existingData, {
305
+ args,
306
+ toReference
307
+ }) {
308
+ return existingData != null ? existingData : toReference({
309
+ __typename: "Table",
310
+ id: args == null ? void 0 : args.id
311
+ }, true);
312
+ }
313
+ }
314
+ }
315
+ };
316
+ function createApolloClient({
317
+ uri,
318
+ cacheData
319
+ }) {
320
+ const cache = new client.InMemoryCache({
321
+ typePolicies
322
+ });
323
+ if (cacheData)
324
+ cache.restore(cacheData);
325
+ return new client.ApolloClient({
326
+ uri,
327
+ cache
328
+ });
329
+ }
330
+ class MakeswiftClient {
331
+ constructor({
332
+ uri,
333
+ cacheData
334
+ }) {
335
+ __publicField(this, "apolloClient");
336
+ this.apolloClient = createApolloClient({
337
+ uri,
338
+ cacheData
339
+ });
340
+ }
341
+ async prefetch(element) {
342
+ const id = uuid__default["default"]();
343
+ await ssr.getDataFromTree(/* @__PURE__ */ jsxRuntime.jsx(RuntimeProvider, {
344
+ client: this,
345
+ defaultRootElements: /* @__PURE__ */ new Map([[id, element]]),
346
+ children: /* @__PURE__ */ jsxRuntime.jsx(DocumentReference, {
347
+ documentReference: reactPage.createDocumentReference(id)
348
+ })
349
+ }));
350
+ return this.apolloClient.cache.extract();
351
+ }
352
+ }
242
353
  const Context$2 = React.createContext(void 0);
243
354
  function useQuery(query, options) {
244
355
  const client$1 = React.useContext(Context$2);
245
356
  return client.useQuery(query, __spreadValues({
246
- client: client$1
357
+ client: client$1 == null ? void 0 : client$1.apolloClient
247
358
  }, options));
248
359
  }
249
360
  function useMutation(mutation, options) {
250
361
  const client$1 = React.useContext(Context$2);
251
362
  return client.useMutation(mutation, __spreadValues({
252
- client: client$1
363
+ client: client$1 == null ? void 0 : client$1.apolloClient
253
364
  }, options));
254
365
  }
255
- function ApolloProvider({
366
+ function MakeswiftProvider({
256
367
  client: client2,
257
368
  children
258
369
  }) {
@@ -1107,7 +1218,7 @@ function Parallax(_g2) {
1107
1218
  children: children(getProps)
1108
1219
  }));
1109
1220
  }
1110
- const Container$c = styled__default["default"].div`
1221
+ const Container$d = styled__default["default"].div`
1111
1222
  position: absolute;
1112
1223
  top: 0;
1113
1224
  left: 0;
@@ -1161,7 +1272,7 @@ function BackgroundVideo({
1161
1272
  }, [aspectRatio, zoom]);
1162
1273
  if (!ReactPlayer__default["default"].canPlay(url))
1163
1274
  return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, {});
1164
- return /* @__PURE__ */ jsxRuntime.jsxs(Container$c, {
1275
+ return /* @__PURE__ */ jsxRuntime.jsxs(Container$d, {
1165
1276
  ref: container,
1166
1277
  children: [container.current && /* @__PURE__ */ jsxRuntime.jsx(ReactPlayer__default["default"], {
1167
1278
  url,
@@ -1240,10 +1351,10 @@ const AbsoluteFill = styled__default["default"].div`
1240
1351
  right: 0;
1241
1352
  bottom: 0;
1242
1353
  `;
1243
- const Container$b = styled__default["default"](AbsoluteFill)`
1354
+ const Container$c = styled__default["default"](AbsoluteFill)`
1244
1355
  border-radius: inherit;
1245
1356
  `;
1246
- const BackgroundsContainer$1 = styled__default["default"](Container$b)`
1357
+ const BackgroundsContainer$1 = styled__default["default"](Container$c)`
1247
1358
  overflow: hidden;
1248
1359
  ${(p) => cssMediaRules([p.visibility], ([visibility]) => styled.css`
1249
1360
  display: ${visibility === true ? "block" : "none"};
@@ -1267,7 +1378,7 @@ function Backgrounds({
1267
1378
  visibility,
1268
1379
  children: [...value].reverse().map((bg) => {
1269
1380
  if (bg.type === "color") {
1270
- return /* @__PURE__ */ jsxRuntime.jsx(Container$b, {
1381
+ return /* @__PURE__ */ jsxRuntime.jsx(Container$c, {
1271
1382
  style: {
1272
1383
  backgroundColor: getColor(bg.payload)
1273
1384
  }
@@ -1303,7 +1414,7 @@ function Backgrounds({
1303
1414
  }
1304
1415
  return /* @__PURE__ */ jsxRuntime.jsx(Parallax, {
1305
1416
  strength: parallax,
1306
- children: (getParallaxProps) => /* @__PURE__ */ jsxRuntime.jsx(Container$b, __spreadValues({}, getParallaxProps({
1417
+ children: (getParallaxProps) => /* @__PURE__ */ jsxRuntime.jsx(Container$c, __spreadValues({}, getParallaxProps({
1307
1418
  style: {
1308
1419
  backgroundImage: publicUrl != null ? `url('${publicUrl}')` : void 0,
1309
1420
  backgroundPosition,
@@ -1321,7 +1432,7 @@ function Backgrounds({
1321
1432
  isRadial
1322
1433
  } = bg.payload;
1323
1434
  const gradient = `${getStopsStyle(stops)}`;
1324
- return /* @__PURE__ */ jsxRuntime.jsx(Container$b, {
1435
+ return /* @__PURE__ */ jsxRuntime.jsx(Container$c, {
1325
1436
  style: {
1326
1437
  background: isRadial ? `radial-gradient(${gradient})` : `linear-gradient(${angle}rad, ${gradient})`
1327
1438
  }
@@ -1338,7 +1449,7 @@ function Backgrounds({
1338
1449
  } = bg.payload;
1339
1450
  return /* @__PURE__ */ jsxRuntime.jsx(Parallax, {
1340
1451
  strength: parallax,
1341
- children: (getParallaxProps) => /* @__PURE__ */ jsxRuntime.jsx(Container$b, __spreadProps(__spreadValues({}, getParallaxProps({})), {
1452
+ children: (getParallaxProps) => /* @__PURE__ */ jsxRuntime.jsx(Container$c, __spreadProps(__spreadValues({}, getParallaxProps({})), {
1342
1453
  children: /* @__PURE__ */ jsxRuntime.jsx(BackgroundVideo, {
1343
1454
  url,
1344
1455
  zoom,
@@ -1534,7 +1645,7 @@ const Box = React.forwardRef(function Box2({
1534
1645
  })
1535
1646
  }, key == null ? void 0 : key.container);
1536
1647
  });
1537
- function registerComponent$b(runtime) {
1648
+ function registerComponent$c(runtime) {
1538
1649
  return runtime.registerComponent(Box, {
1539
1650
  type: "./components/Box/index.js",
1540
1651
  label: "Box",
@@ -2032,7 +2143,7 @@ const Button$1 = React.forwardRef(function Button2(_m, ref) {
2032
2143
  children: children == null ? "Button Text" : children
2033
2144
  }));
2034
2145
  });
2035
- function registerComponent$a(runtime) {
2146
+ function registerComponent$b(runtime) {
2036
2147
  return runtime.registerComponent(Button$1, {
2037
2148
  type: "./components/Button/index.js",
2038
2149
  label: "Button",
@@ -2128,6 +2239,10 @@ const placeholders = {
2128
2239
  image: {
2129
2240
  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
2241
  dimensions: { width: 360, height: 240 }
2242
+ },
2243
+ video: {
2244
+ 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",
2245
+ dimensions: { width: 712, height: 400 }
2131
2246
  }
2132
2247
  };
2133
2248
  function loadImage(src) {
@@ -2233,7 +2348,7 @@ const ImageComponent = React.forwardRef(function Image2({
2233
2348
  })
2234
2349
  });
2235
2350
  });
2236
- function registerComponent$9(runtime) {
2351
+ function registerComponent$a(runtime) {
2237
2352
  return runtime.registerComponent(ImageComponent, {
2238
2353
  type: "./components/Image/index.js",
2239
2354
  label: "Image",
@@ -2282,7 +2397,7 @@ const RightChevron = () => /* @__PURE__ */ jsxRuntime.jsx("svg", {
2282
2397
  strokeWidth: "2"
2283
2398
  })
2284
2399
  });
2285
- const Container$a = styled__default["default"].div`
2400
+ const Container$b = styled__default["default"].div`
2286
2401
  position: relative;
2287
2402
  height: 100%;
2288
2403
  `;
@@ -2582,7 +2697,7 @@ const Carousel = React.forwardRef(function Carousel2({
2582
2697
  break;
2583
2698
  }
2584
2699
  },
2585
- children: [/* @__PURE__ */ jsxRuntime.jsxs(Container$a, {
2700
+ children: [/* @__PURE__ */ jsxRuntime.jsxs(Container$b, {
2586
2701
  children: [/* @__PURE__ */ jsxRuntime.jsx(ClipMask, {
2587
2702
  children: /* @__PURE__ */ jsxRuntime.jsx(Page, __spreadProps(__spreadValues({}, bindPage()), {
2588
2703
  animate: animation,
@@ -2658,7 +2773,7 @@ const Carousel = React.forwardRef(function Carousel2({
2658
2773
  })]
2659
2774
  });
2660
2775
  });
2661
- function registerComponent$8(runtime) {
2776
+ function registerComponent$9(runtime) {
2662
2777
  return runtime.registerComponent(Carousel, {
2663
2778
  type: "./components/Carousel/index.js",
2664
2779
  label: "Carousel",
@@ -2785,7 +2900,7 @@ const Segment = styled__default["default"].div`
2785
2900
  flex: 1;
2786
2901
  text-align: center;
2787
2902
  `;
2788
- const Container$9 = styled__default["default"].div`
2903
+ const Container$a = styled__default["default"].div`
2789
2904
  display: flex;
2790
2905
  ${cssWidth("560px")}
2791
2906
  ${cssMargin()}
@@ -3025,7 +3140,7 @@ const Countdown = React.forwardRef(function Countdown2({
3025
3140
  }, 1e3);
3026
3141
  return () => clearInterval(intervalId);
3027
3142
  }, [date]);
3028
- return /* @__PURE__ */ jsxRuntime.jsxs(Container$9, {
3143
+ return /* @__PURE__ */ jsxRuntime.jsxs(Container$a, {
3029
3144
  ref,
3030
3145
  id,
3031
3146
  width,
@@ -3074,7 +3189,7 @@ const Countdown = React.forwardRef(function Countdown2({
3074
3189
  })]
3075
3190
  });
3076
3191
  });
3077
- function registerComponent$7(runtime) {
3192
+ function registerComponent$8(runtime) {
3078
3193
  return runtime.registerComponent(Countdown, {
3079
3194
  type: "./components/Countdown/index.js",
3080
3195
  label: "Countdown",
@@ -3210,7 +3325,7 @@ const IE11MinHeightContainer = styled__default["default"].div`
3210
3325
  ${cssWidth()}
3211
3326
  ${cssMargin()}
3212
3327
  `;
3213
- const Container$8 = styled__default["default"].div`
3328
+ const Container$9 = styled__default["default"].div`
3214
3329
  display: flex;
3215
3330
  flex-direction: column;
3216
3331
  justify-content: center;
@@ -3269,7 +3384,7 @@ const Divider = React.forwardRef(function Divider2({
3269
3384
  id,
3270
3385
  width,
3271
3386
  margin,
3272
- children: /* @__PURE__ */ jsxRuntime.jsx(Container$8, {
3387
+ children: /* @__PURE__ */ jsxRuntime.jsx(Container$9, {
3273
3388
  children: /* @__PURE__ */ jsxRuntime.jsx(Line, {
3274
3389
  variant,
3275
3390
  thickness,
@@ -3278,7 +3393,7 @@ const Divider = React.forwardRef(function Divider2({
3278
3393
  })
3279
3394
  });
3280
3395
  });
3281
- function registerComponent$6(runtime) {
3396
+ function registerComponent$7(runtime) {
3282
3397
  return runtime.registerComponent(Divider, {
3283
3398
  type: "./components/Divider/index.js",
3284
3399
  label: "Divider",
@@ -3328,7 +3443,7 @@ function registerComponent$6(runtime) {
3328
3443
  }
3329
3444
  });
3330
3445
  }
3331
- const Container$7 = styled__default["default"].div`
3446
+ const Container$8 = styled__default["default"].div`
3332
3447
  min-height: 15px;
3333
3448
  ${cssWidth()}
3334
3449
  ${cssMargin()}
@@ -3408,7 +3523,7 @@ const Embed = React.forwardRef(function Embed2({
3408
3523
  }, [container, html]);
3409
3524
  if (shouldRender === false)
3410
3525
  return null;
3411
- return /* @__PURE__ */ jsxRuntime.jsx(Container$7, {
3526
+ return /* @__PURE__ */ jsxRuntime.jsx(Container$8, {
3412
3527
  ref: setContainer,
3413
3528
  id,
3414
3529
  margin,
@@ -3418,7 +3533,7 @@ const Embed = React.forwardRef(function Embed2({
3418
3533
  }
3419
3534
  });
3420
3535
  });
3421
- function registerComponent$5(runtime) {
3536
+ function registerComponent$6(runtime) {
3422
3537
  return runtime.registerComponent(Embed, {
3423
3538
  type: "./components/Embed/index.js",
3424
3539
  label: "Embed",
@@ -3640,7 +3755,7 @@ var Input$2 = React.forwardRef(function Input2(_o, ref) {
3640
3755
  brandColor
3641
3756
  }));
3642
3757
  });
3643
- const Container$6 = styled__default["default"].div`
3758
+ const Container$7 = styled__default["default"].div`
3644
3759
  display: flex;
3645
3760
  flex-direction: column;
3646
3761
  ${cssWidth()};
@@ -3675,7 +3790,7 @@ var Placeholder$1 = React.forwardRef(function Placeholder3({
3675
3790
  width,
3676
3791
  margin
3677
3792
  }, ref) {
3678
- return /* @__PURE__ */ jsxRuntime.jsxs(Container$6, {
3793
+ return /* @__PURE__ */ jsxRuntime.jsxs(Container$7, {
3679
3794
  ref,
3680
3795
  width,
3681
3796
  margin,
@@ -3842,7 +3957,7 @@ function getCheckmarkColor$1({
3842
3957
  l
3843
3958
  }).alpha(a).isLight() ? "rgba(0, 0, 0, 0.7)" : "rgba(255, 255, 255, 0.95)";
3844
3959
  }
3845
- const Container$5 = styled__default["default"].div`
3960
+ const Container$6 = styled__default["default"].div`
3846
3961
  position: relative;
3847
3962
  ${(props) => cssMediaRules([props.size], ([size = Sizes.MEDIUM]) => styled.css`
3848
3963
  height: ${getSizeHeight(size)}px;
@@ -3962,7 +4077,7 @@ var Checkbox = React.forwardRef(function Checkbox2(_w, ref) {
3962
4077
  contrast,
3963
4078
  brandColor
3964
4079
  } = useFormContext();
3965
- return /* @__PURE__ */ jsxRuntime.jsxs(Container$5, {
4080
+ return /* @__PURE__ */ jsxRuntime.jsxs(Container$6, {
3966
4081
  size,
3967
4082
  children: [/* @__PURE__ */ jsxRuntime.jsx(HiddenCheckbox, __spreadProps(__spreadValues({}, restOfProps), {
3968
4083
  type: "checkbox",
@@ -4105,7 +4220,7 @@ function getCheckmarkColor({
4105
4220
  l
4106
4221
  }).alpha(a).isLight() ? "rgba(0, 0, 0, 0.7)" : "rgba(255, 255, 255, 0.95)";
4107
4222
  }
4108
- const Container$4 = styled__default["default"].div`
4223
+ const Container$5 = styled__default["default"].div`
4109
4224
  position: relative;
4110
4225
  ${(props) => cssMediaRules([props.size], ([size = Sizes.MEDIUM]) => styled.css`
4111
4226
  height: ${getSizeHeight(size)}px;
@@ -4218,7 +4333,7 @@ var RadioButton = React.forwardRef(function RadioButton2(_C, ref) {
4218
4333
  contrast,
4219
4334
  brandColor
4220
4335
  } = useFormContext();
4221
- return /* @__PURE__ */ jsxRuntime.jsxs(Container$4, {
4336
+ return /* @__PURE__ */ jsxRuntime.jsxs(Container$5, {
4222
4337
  size,
4223
4338
  children: [/* @__PURE__ */ jsxRuntime.jsx(HiddenRadioButton, __spreadProps(__spreadValues({}, restOfProps), {
4224
4339
  ref,
@@ -4290,7 +4405,7 @@ var TableColumnRadioButtonGroup = React.forwardRef(function TableColumnRadioButt
4290
4405
  }, option.id))]
4291
4406
  });
4292
4407
  });
4293
- const Container$3 = styled__default["default"].div`
4408
+ const Container$4 = styled__default["default"].div`
4294
4409
  ${cssField()}
4295
4410
  display: flex;
4296
4411
  align-items: center;
@@ -4355,7 +4470,7 @@ var TableColumnSingleSelect = React.forwardRef(function TableColumnSingleSelect2
4355
4470
  children: [!hideLabel && /* @__PURE__ */ jsxRuntime.jsx(Label$1, {
4356
4471
  htmlFor: id,
4357
4472
  children: label
4358
- }), /* @__PURE__ */ jsxRuntime.jsxs(Container$3, {
4473
+ }), /* @__PURE__ */ jsxRuntime.jsxs(Container$4, {
4359
4474
  error,
4360
4475
  shape,
4361
4476
  size,
@@ -5048,7 +5163,7 @@ const Form = React.forwardRef(function Form2({
5048
5163
  })
5049
5164
  });
5050
5165
  });
5051
- function registerComponent$4(runtime) {
5166
+ function registerComponent$5(runtime) {
5052
5167
  return runtime.registerComponent(Form, {
5053
5168
  type: "./components/Form/index.js",
5054
5169
  label: "Form",
@@ -5608,7 +5723,7 @@ function MobileDropDownButton(_Y) {
5608
5723
  const ButtonLink = styled__default["default"](Button$1)`
5609
5724
  margin: 8px 0;
5610
5725
  `;
5611
- const Container$2 = styled__default["default"].div`
5726
+ const Container$3 = styled__default["default"].div`
5612
5727
  position: fixed;
5613
5728
  flex-direction: column;
5614
5729
  width: 100%;
@@ -5662,7 +5777,7 @@ function MobileMenu({
5662
5777
  onClose = () => {
5663
5778
  }
5664
5779
  }) {
5665
- return /* @__PURE__ */ jsxRuntime.jsxs(Container$2, {
5780
+ return /* @__PURE__ */ jsxRuntime.jsxs(Container$3, {
5666
5781
  animation,
5667
5782
  backgroundColor: useColor(backgroundColor),
5668
5783
  open,
@@ -5688,7 +5803,7 @@ function MobileMenu({
5688
5803
  })]
5689
5804
  });
5690
5805
  }
5691
- const Container$1 = styled__default["default"].nav`
5806
+ const Container$2 = styled__default["default"].nav`
5692
5807
  display: flex;
5693
5808
  align-items: center;
5694
5809
  ${cssWidth()}
@@ -5745,7 +5860,7 @@ const Navigation = React.forwardRef(function Navigation2({
5745
5860
  margin
5746
5861
  }, ref) {
5747
5862
  const [isOpen, setIsOpen] = React.useState(false);
5748
- return /* @__PURE__ */ jsxRuntime.jsxs(Container$1, {
5863
+ return /* @__PURE__ */ jsxRuntime.jsxs(Container$2, {
5749
5864
  ref,
5750
5865
  id,
5751
5866
  margin,
@@ -5793,7 +5908,7 @@ const Navigation = React.forwardRef(function Navigation2({
5793
5908
  })]
5794
5909
  });
5795
5910
  });
5796
- function registerComponent$3(runtime) {
5911
+ function registerComponent$4(runtime) {
5797
5912
  return runtime.registerComponent(Navigation, {
5798
5913
  type: "./components/Navigation/index.js",
5799
5914
  label: "Navigation",
@@ -5970,7 +6085,7 @@ const Root = React.forwardRef(function Page2({
5970
6085
  })]
5971
6086
  });
5972
6087
  });
5973
- function registerComponent$2(runtime) {
6088
+ function registerComponent$3(runtime) {
5974
6089
  return runtime.registerComponent(Root, {
5975
6090
  type: "./components/Root/index.js",
5976
6091
  label: "Page",
@@ -6647,7 +6762,7 @@ function SocialLinksPlaceholder({
6647
6762
  }, link.id))
6648
6763
  });
6649
6764
  }
6650
- const Container = styled__default["default"].div`
6765
+ const Container$1 = styled__default["default"].div`
6651
6766
  display: flex;
6652
6767
  flex-direction: row;
6653
6768
  flex-wrap: wrap;
@@ -6731,7 +6846,7 @@ const SocialLinks = React.forwardRef(function SocialLinks2({
6731
6846
  }, ref) {
6732
6847
  const fillData = useColor(fill);
6733
6848
  const backgroundColorData = useColor(backgroundColor);
6734
- return /* @__PURE__ */ jsxRuntime.jsx(Container, {
6849
+ return /* @__PURE__ */ jsxRuntime.jsx(Container$1, {
6735
6850
  ref,
6736
6851
  id,
6737
6852
  alignment,
@@ -6767,7 +6882,7 @@ const SocialLinks = React.forwardRef(function SocialLinks2({
6767
6882
  })
6768
6883
  });
6769
6884
  });
6770
- function registerComponent$1(runtime) {
6885
+ function registerComponent$2(runtime) {
6771
6886
  return runtime.registerComponent(SocialLinks, {
6772
6887
  type: "./components/SocialLinks/index.js",
6773
6888
  label: "Social Links",
@@ -7304,7 +7419,7 @@ const Text = React.forwardRef(function Text2({
7304
7419
  onKeyDown: handleKeyDown
7305
7420
  });
7306
7421
  });
7307
- function registerComponent(runtime) {
7422
+ function registerComponent$1(runtime) {
7308
7423
  return runtime.registerComponent(Text, {
7309
7424
  type: "./components/Text/index.js",
7310
7425
  label: "Text",
@@ -7382,19 +7497,103 @@ function registerComponent(runtime) {
7382
7497
  }
7383
7498
  });
7384
7499
  }
7500
+ const Container = styled__default["default"].div`
7501
+ display: flex;
7502
+ flex-direction: column;
7503
+ overflow: hidden;
7504
+ ${cssWidth("560px")}
7505
+ ${cssMargin()}
7506
+ ${cssBorderRadius()}
7507
+ `;
7508
+ const ASPECT_RATIO = 16 / 9;
7509
+ const Video = React.forwardRef(function Video2({
7510
+ id,
7511
+ video,
7512
+ width,
7513
+ margin,
7514
+ borderRadius
7515
+ }, ref) {
7516
+ const canPlayUrl = video && video.url != null && ReactPlayer__default["default"].canPlay(video.url);
7517
+ return /* @__PURE__ */ jsxRuntime.jsx(Container, {
7518
+ ref,
7519
+ id,
7520
+ width,
7521
+ margin,
7522
+ borderRadius,
7523
+ children: /* @__PURE__ */ jsxRuntime.jsx("div", {
7524
+ style: {
7525
+ position: "relative",
7526
+ paddingTop: `${100 / ASPECT_RATIO}%`
7527
+ },
7528
+ children: /* @__PURE__ */ jsxRuntime.jsx("div", {
7529
+ style: {
7530
+ position: "absolute",
7531
+ top: 0,
7532
+ left: 0,
7533
+ right: 0,
7534
+ bottom: 0
7535
+ },
7536
+ children: canPlayUrl === true ? /* @__PURE__ */ jsxRuntime.jsx(ReactPlayer__default["default"], __spreadProps(__spreadValues({}, video), {
7537
+ width: "100%",
7538
+ height: "100%",
7539
+ config: {
7540
+ vimeo: {
7541
+ playerOptions: {
7542
+ background: video != null && !video.controls
7543
+ }
7544
+ },
7545
+ wistia: {
7546
+ options: {
7547
+ endVideoBehavior: video != null && video.loop === true ? "loop" : "default"
7548
+ }
7549
+ }
7550
+ }
7551
+ })) : /* @__PURE__ */ jsxRuntime.jsx("img", {
7552
+ width: "100%",
7553
+ src: placeholders.video.src,
7554
+ alt: "Video Placeholder"
7555
+ })
7556
+ })
7557
+ })
7558
+ });
7559
+ });
7560
+ function registerComponent(runtime) {
7561
+ return runtime.registerComponent(Video, {
7562
+ type: "./components/Video/index.js",
7563
+ label: "Video",
7564
+ icon: "Video40",
7565
+ props: {
7566
+ id: descriptors.ElementID(),
7567
+ video: descriptors.Video({
7568
+ preset: {
7569
+ controls: true
7570
+ }
7571
+ }),
7572
+ width: descriptors.Width({
7573
+ defaultValue: {
7574
+ value: 560,
7575
+ unit: "px"
7576
+ }
7577
+ }),
7578
+ margin: descriptors.Margin(),
7579
+ borderRadius: descriptors.BorderRadius()
7580
+ }
7581
+ });
7582
+ }
7385
7583
  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);
7584
+ const unregisterBoxComponent = registerComponent$c(runtime);
7585
+ const unregisterButtonComponent = registerComponent$b(runtime);
7586
+ const unregisterCarouselComponent = registerComponent$9(runtime);
7587
+ const unregisterCountdownComponent = registerComponent$8(runtime);
7588
+ const unregisterDividerComponent = registerComponent$7(runtime);
7589
+ const unregisterEmbedComponent = registerComponent$6(runtime);
7590
+ const unregisterFormComponent = registerComponent$5(runtime);
7591
+ const unregisterImageComponent = registerComponent$a(runtime);
7592
+ const unregisterNavigationComponent = registerComponent$4(runtime);
7593
+ const unregisterRootComponent = registerComponent$3(runtime);
7594
+ const unregisterSocialLinksComponent = registerComponent$2(runtime);
7595
+ const unregisterTextComponent = registerComponent$1(runtime);
7596
+ const unregisterVideoComponent = registerComponent(runtime);
7398
7597
  return () => {
7399
7598
  unregisterBoxComponent();
7400
7599
  unregisterButtonComponent();
@@ -7408,6 +7607,8 @@ function registerBuiltinComponents(runtime) {
7408
7607
  unregisterRootComponent();
7409
7608
  unregisterSocialLinksComponent();
7410
7609
  unregisterTextComponent();
7610
+ unregisterTextComponent();
7611
+ unregisterVideoComponent();
7411
7612
  };
7412
7613
  }
7413
7614
  const contextDefaultValue = reactPage.configureStore();
@@ -7436,10 +7637,9 @@ function createReactRuntime(store) {
7436
7637
  const ReactRuntime = createReactRuntime(contextDefaultValue);
7437
7638
  const Context = React.createContext(contextDefaultValue);
7438
7639
  function RuntimeProvider({
7640
+ client: client2,
7439
7641
  children,
7440
- defaultRootElements,
7441
- registerComponents,
7442
- makeswiftApiEndpoint
7642
+ defaultRootElements
7443
7643
  }) {
7444
7644
  const [store, setStore] = React.useState(() => {
7445
7645
  const store2 = reactPage.configureStore({
@@ -7448,27 +7648,11 @@ function RuntimeProvider({
7448
7648
  });
7449
7649
  const runtime = createReactRuntime(store2);
7450
7650
  registerBuiltinComponents(runtime);
7451
- registerComponents == null ? void 0 : registerComponents(runtime);
7452
7651
  return store2;
7453
7652
  });
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
7653
  React.useEffect(() => {
7467
7654
  return registerBuiltinComponents(createReactRuntime(store));
7468
7655
  }, [store]);
7469
- React.useEffect(() => {
7470
- return registerComponents == null ? void 0 : registerComponents(createReactRuntime(store));
7471
- }, [store, registerComponents]);
7472
7656
  React.useEffect(() => {
7473
7657
  const isInBuilder = window.parent !== window;
7474
7658
  if (isInBuilder)
@@ -7479,20 +7663,17 @@ function RuntimeProvider({
7479
7663
  });
7480
7664
  setStore((store2) => ReactBuilderPreview.configureStore({
7481
7665
  preloadedState: store2.getState(),
7482
- client: client$1
7666
+ client: client2.apolloClient
7483
7667
  }));
7484
7668
  }
7485
- }, [client$1]);
7669
+ }, [client2]);
7486
7670
  React.useEffect(() => {
7487
7671
  const isInBuilder = window.parent !== window;
7488
7672
  if (!isInBuilder)
7489
7673
  return;
7490
- const lastDocumentOverflow = window.document.documentElement.style.overflow;
7491
- window.document.documentElement.style.overflow = "hidden";
7492
7674
  window.addEventListener("focusin", handleFocusIn);
7493
7675
  window.addEventListener("focusout", handlefocusOut);
7494
7676
  return () => {
7495
- window.document.documentElement.style.overflow = lastDocumentOverflow;
7496
7677
  window.addEventListener("focusin", handleFocusIn);
7497
7678
  window.removeEventListener("focusout", handlefocusOut);
7498
7679
  };
@@ -7509,8 +7690,8 @@ function RuntimeProvider({
7509
7690
  }, []);
7510
7691
  return /* @__PURE__ */ jsxRuntime.jsx(Context.Provider, {
7511
7692
  value: store,
7512
- children: /* @__PURE__ */ jsxRuntime.jsx(ApolloProvider, {
7513
- client: client$1,
7693
+ children: /* @__PURE__ */ jsxRuntime.jsx(MakeswiftProvider, {
7694
+ client: client2,
7514
7695
  children
7515
7696
  })
7516
7697
  });
@@ -7708,6 +7889,7 @@ exports.Element = Element$1;
7708
7889
  exports.Embed = Embed;
7709
7890
  exports.Form = Form;
7710
7891
  exports.ImageComponent = ImageComponent;
7892
+ exports.MakeswiftClient = MakeswiftClient;
7711
7893
  exports.Navigation = Navigation;
7712
7894
  exports.PageProvider = PageProvider;
7713
7895
  exports.ReactRuntime = ReactRuntime;
@@ -7725,7 +7907,7 @@ exports.cssPadding = cssPadding;
7725
7907
  exports.cssTextStyle = cssTextStyle;
7726
7908
  exports.cssWidth = cssWidth;
7727
7909
  exports.registerBuiltinComponents = registerBuiltinComponents;
7728
- exports.registerComponent = registerComponent$b;
7910
+ exports.registerComponent = registerComponent$c;
7729
7911
  exports.useBackgrounds = useBackgrounds;
7730
7912
  exports.useBorder = useBorder;
7731
7913
  exports.useBoxShadow = useBoxShadow;