@makeswift/runtime 0.4.2 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (121) hide show
  1. package/dist/Box.cjs.js +35 -273
  2. package/dist/Box.cjs.js.map +1 -1
  3. package/dist/Box.es.js +34 -272
  4. package/dist/Box.es.js.map +1 -1
  5. package/dist/Button.cjs.js +4 -4
  6. package/dist/Button.es.js +5 -5
  7. package/dist/Carousel.cjs.js +8 -7
  8. package/dist/Carousel.cjs.js.map +1 -1
  9. package/dist/Carousel.es.js +7 -6
  10. package/dist/Carousel.es.js.map +1 -1
  11. package/dist/Countdown.cjs.js +3 -3
  12. package/dist/Countdown.es.js +4 -4
  13. package/dist/Divider.cjs.js +3 -3
  14. package/dist/Divider.es.js +4 -4
  15. package/dist/Embed.cjs.js +5 -4
  16. package/dist/Embed.cjs.js.map +1 -1
  17. package/dist/Embed.es.js +5 -4
  18. package/dist/Embed.es.js.map +1 -1
  19. package/dist/Form.cjs.js +4 -4
  20. package/dist/Form.es.js +5 -5
  21. package/dist/Image.cjs.js +21 -13
  22. package/dist/Image.cjs.js.map +1 -1
  23. package/dist/Image.es.js +22 -14
  24. package/dist/Image.es.js.map +1 -1
  25. package/dist/LiveProvider.cjs.js +62 -0
  26. package/dist/LiveProvider.cjs.js.map +1 -0
  27. package/dist/LiveProvider.es.js +60 -0
  28. package/dist/LiveProvider.es.js.map +1 -0
  29. package/dist/Navigation.cjs.js +9 -6
  30. package/dist/Navigation.cjs.js.map +1 -1
  31. package/dist/Navigation.es.js +9 -6
  32. package/dist/Navigation.es.js.map +1 -1
  33. package/dist/{react-builder-preview.cjs.js → PreviewProvider.cjs.js} +43 -16
  34. package/dist/PreviewProvider.cjs.js.map +1 -0
  35. package/dist/{react-builder-preview.es.js → PreviewProvider.es.js} +47 -15
  36. package/dist/PreviewProvider.es.js.map +1 -0
  37. package/dist/Root.cjs.js +10 -8
  38. package/dist/Root.cjs.js.map +1 -1
  39. package/dist/Root.es.js +8 -6
  40. package/dist/Root.es.js.map +1 -1
  41. package/dist/SocialLinks.cjs.js +5 -5
  42. package/dist/SocialLinks.es.js +6 -6
  43. package/dist/Text.cjs.js +4 -4
  44. package/dist/Text.cjs.js.map +1 -1
  45. package/dist/Text.es.js +5 -5
  46. package/dist/Text.es.js.map +1 -1
  47. package/dist/Video.cjs.js +3 -3
  48. package/dist/Video.es.js +4 -4
  49. package/dist/actions.es.js +1 -1
  50. package/dist/components.cjs.js +15 -12
  51. package/dist/components.cjs.js.map +1 -1
  52. package/dist/components.es.js +14 -11
  53. package/dist/components.es.js.map +1 -1
  54. package/dist/index.cjs.js +70 -69
  55. package/dist/index.cjs.js.map +1 -1
  56. package/dist/index.cjs2.js +710 -92
  57. package/dist/index.cjs2.js.map +1 -1
  58. package/dist/index.cjs3.js +107 -20
  59. package/dist/index.cjs3.js.map +1 -1
  60. package/dist/index.cjs4.js +59 -0
  61. package/dist/index.cjs4.js.map +1 -0
  62. package/dist/index.es.js +65 -68
  63. package/dist/index.es.js.map +1 -1
  64. package/dist/index.es2.js +707 -93
  65. package/dist/index.es2.js.map +1 -1
  66. package/dist/index.es3.js +103 -21
  67. package/dist/index.es3.js.map +1 -1
  68. package/dist/index.es4.js +58 -0
  69. package/dist/index.es4.js.map +1 -0
  70. package/dist/next-version.cjs.js +10 -0
  71. package/dist/next-version.cjs.js.map +1 -0
  72. package/dist/next-version.es.js +5 -0
  73. package/dist/next-version.es.js.map +1 -0
  74. package/dist/next.cjs.js +3 -3
  75. package/dist/next.es.js +4 -4
  76. package/dist/react-page.es.js +1 -1
  77. package/dist/react.cjs.js +4 -4
  78. package/dist/react.es.js +4 -4
  79. package/dist/types/src/components/builtin/Box/Box.d.ts +18 -26
  80. package/dist/types/src/components/builtin/Box/Box.d.ts.map +1 -1
  81. package/dist/types/src/components/builtin/Box/animations.d.ts +13 -60
  82. package/dist/types/src/components/builtin/Box/animations.d.ts.map +1 -1
  83. package/dist/types/src/components/builtin/Button/Button.d.ts +1 -1
  84. package/dist/types/src/components/builtin/Form/components/Field/components/Checkbox/index.d.ts +1 -1
  85. package/dist/types/src/components/builtin/Image/Image.d.ts.map +1 -1
  86. package/dist/types/src/components/hooks/useMediaQuery.d.ts +1 -1
  87. package/dist/types/src/components/hooks/useMediaQuery.d.ts.map +1 -1
  88. package/dist/types/src/components/shared/BackgroundsContainer/components/Backgrounds/index.d.ts.map +1 -1
  89. package/dist/types/src/components/shared/BackgroundsContainer/index.d.ts +1 -254
  90. package/dist/types/src/components/shared/BackgroundsContainer/index.d.ts.map +1 -1
  91. package/dist/types/src/components/shared/Link/index.d.ts.map +1 -1
  92. package/dist/types/src/components/shared/grid-item.d.ts +9 -6
  93. package/dist/types/src/components/shared/grid-item.d.ts.map +1 -1
  94. package/dist/types/src/next/client.d.ts +1 -0
  95. package/dist/types/src/next/client.d.ts.map +1 -1
  96. package/dist/types/src/next/index.d.ts.map +1 -1
  97. package/dist/types/src/next/next-version.d.ts +3 -0
  98. package/dist/types/src/next/next-version.d.ts.map +1 -0
  99. package/dist/types/src/runtimes/react/components/LiveProvider.d.ts +11 -0
  100. package/dist/types/src/runtimes/react/components/LiveProvider.d.ts.map +1 -0
  101. package/dist/types/src/runtimes/react/components/PreviewProvider.d.ts +11 -0
  102. package/dist/types/src/runtimes/react/components/PreviewProvider.d.ts.map +1 -0
  103. package/dist/types/src/runtimes/react/index.d.ts +3 -1
  104. package/dist/types/src/runtimes/react/index.d.ts.map +1 -1
  105. package/dist/types/src/state/react-builder-preview.d.ts +3 -1
  106. package/dist/types/src/state/react-builder-preview.d.ts.map +1 -1
  107. package/dist/useIsomorphicLayoutEffect.cjs.js +6 -0
  108. package/dist/useIsomorphicLayoutEffect.cjs.js.map +1 -0
  109. package/dist/useIsomorphicLayoutEffect.es.js +5 -0
  110. package/dist/useIsomorphicLayoutEffect.es.js.map +1 -0
  111. package/package.json +4 -4
  112. package/dist/grid-item.cjs.js +0 -592
  113. package/dist/grid-item.cjs.js.map +0 -1
  114. package/dist/grid-item.es.js +0 -584
  115. package/dist/grid-item.es.js.map +0 -1
  116. package/dist/react-builder-preview.cjs.js.map +0 -1
  117. package/dist/react-builder-preview.es.js.map +0 -1
  118. package/dist/useMediaQuery.cjs.js +0 -26
  119. package/dist/useMediaQuery.cjs.js.map +0 -1
  120. package/dist/useMediaQuery.es.js +0 -25
  121. package/dist/useMediaQuery.es.js.map +0 -1
package/dist/Box.es.js CHANGED
@@ -29,27 +29,26 @@ var __objRest = (source, exclude) => {
29
29
  }
30
30
  return target;
31
31
  };
32
- import { forwardRef, useCallback, useEffect, useState, useRef, useImperativeHandle } from "react";
33
- import { useReducedMotion, useAnimation, motion } from "framer-motion";
32
+ import { forwardRef, useRef, useState, useImperativeHandle, useEffect } from "react";
34
33
  import { cx } from "@emotion/css";
35
- import { n as useStyle, c as DEFAULT_BOX_ANIMATE_TYPE, e as DEFAULT_BOX_ANIMATE_DURATION, d as DEFAULT_BOX_ANIMATE_DELAY, f as DEFAULT_ITEM_ANIMATE_TYPE, h as DEFAULT_ITEM_ANIMATE_DURATION, g as DEFAULT_ITEM_ANIMATE_DELAY, i as DEFAULT_ITEM_STAGGER_DURATION, r as responsiveStyle, E as Element } from "./index.es.js";
34
+ import { v4 } from "uuid";
35
+ import { o as useStyle, r as responsiveStyle, E as Element } from "./index.es.js";
36
36
  import { jsx } from "react/jsx-runtime";
37
- import "use-sync-external-store/shim";
38
- import "./slot.es.js";
39
- import { u as useMediaQuery } from "./useMediaQuery.es.js";
37
+ import { a as useBoxAnimation, b as areBoxAnimationPropsEqual, B as BackgroundsContainer, G as GridItem } from "./index.es2.js";
40
38
  import { p as parse, c as createBox } from "./box-models.es.js";
41
- import { B as BackgroundsContainer, G as GridItem } from "./grid-item.es.js";
42
39
  import "use-sync-external-store/shim/with-selector";
40
+ import "next/dynamic";
43
41
  import "./react-page.es.js";
44
42
  import "redux";
45
43
  import "redux-thunk";
46
44
  import "./actions.es.js";
45
+ import "./slot.es.js";
47
46
  import "./control.es.js";
48
- import "next/dynamic";
49
- import "slate";
50
- import "./types.es.js";
51
47
  import "./text-input.es.js";
52
48
  import "./combobox.es.js";
49
+ import "use-sync-external-store/shim";
50
+ import "slate";
51
+ import "./types.es.js";
53
52
  import "color";
54
53
  import "scroll-into-view-if-needed";
55
54
  import "react-dom";
@@ -63,9 +62,12 @@ import "http-proxy";
63
62
  import "set-cookie-parser";
64
63
  import "uuid/v4";
65
64
  import "corporate-ipsum";
66
- import "css-box-model";
67
65
  import "next/image";
66
+ import "./useIsomorphicLayoutEffect.es.js";
68
67
  import "react-player";
68
+ import "./next-version.es.js";
69
+ import "next/package.json";
70
+ import "css-box-model";
69
71
  var Placeholder = forwardRef(function Placeholder2(_a, ref) {
70
72
  var _b = _a, {
71
73
  hide = false
@@ -105,238 +107,6 @@ var Placeholder = forwardRef(function Placeholder2(_a, ref) {
105
107
  })
106
108
  }));
107
109
  });
108
- const defaultExitedProps = {
109
- opacity: 0,
110
- x: 0,
111
- y: 0,
112
- scale: 1
113
- };
114
- const boxAnimations = {
115
- none: {
116
- entered: {
117
- opacity: 1
118
- },
119
- exited: __spreadProps(__spreadValues({}, defaultExitedProps), {
120
- opacity: 1
121
- }),
122
- transition: {}
123
- },
124
- fadeIn: {
125
- exited: defaultExitedProps,
126
- entered: {
127
- opacity: 1
128
- },
129
- transition: {}
130
- },
131
- fadeLeft: {
132
- exited: __spreadProps(__spreadValues({}, defaultExitedProps), {
133
- x: 60
134
- }),
135
- entered: {
136
- opacity: 1,
137
- x: 0
138
- },
139
- transition: {
140
- x: {
141
- type: "tween",
142
- ease: [0.165, 0.84, 0.44, 1]
143
- }
144
- }
145
- },
146
- fadeRight: {
147
- exited: __spreadProps(__spreadValues({}, defaultExitedProps), {
148
- x: -60
149
- }),
150
- entered: {
151
- opacity: 1,
152
- x: 0
153
- },
154
- transition: {
155
- x: {
156
- type: "tween",
157
- ease: [0.165, 0.84, 0.44, 1]
158
- }
159
- }
160
- },
161
- fadeUp: {
162
- exited: __spreadProps(__spreadValues({}, defaultExitedProps), {
163
- y: 80
164
- }),
165
- entered: {
166
- opacity: 1,
167
- y: 0
168
- },
169
- transition: {
170
- y: {
171
- type: "tween",
172
- ease: [0.165, 0.84, 0.44, 1]
173
- }
174
- }
175
- },
176
- fadeDown: {
177
- exited: __spreadProps(__spreadValues({}, defaultExitedProps), {
178
- y: -80
179
- }),
180
- entered: {
181
- opacity: 1,
182
- y: 0
183
- },
184
- transition: {
185
- y: {
186
- type: "tween",
187
- ease: [0.165, 0.84, 0.44, 1]
188
- }
189
- }
190
- },
191
- blurIn: {
192
- exited: __spreadProps(__spreadValues({}, defaultExitedProps), {
193
- filter: "blur(20px)"
194
- }),
195
- entered: {
196
- opacity: 1,
197
- filter: "blur(0px)"
198
- },
199
- transition: {}
200
- },
201
- scaleDown: {
202
- exited: __spreadProps(__spreadValues({}, defaultExitedProps), {
203
- scale: 1.2
204
- }),
205
- entered: {
206
- opacity: 1,
207
- scale: 1
208
- },
209
- transition: {
210
- scale: {
211
- type: "tween",
212
- ease: [0.165, 0.84, 0.44, 1]
213
- }
214
- }
215
- },
216
- scaleUp: {
217
- exited: __spreadProps(__spreadValues({}, defaultExitedProps), {
218
- scale: 0.75
219
- }),
220
- entered: {
221
- opacity: 1,
222
- scale: 1
223
- },
224
- transition: {
225
- scale: {
226
- type: "tween",
227
- ease: [0.165, 0.84, 0.44, 1]
228
- }
229
- }
230
- }
231
- };
232
- const mergeCustomTransitionWithDefault = (transitions, props) => transitions ? Object.keys(transitions).reduce((a, c) => __spreadProps(__spreadValues({}, a), {
233
- [c]: __spreadValues(__spreadValues({}, transitions[c]), props)
234
- }), props) : props;
235
- const useElementOnScreen = (element, options) => {
236
- const [isVisible, setIsVisible] = useState(false);
237
- useEffect(() => {
238
- const observer = new IntersectionObserver(intersectionCallback, options);
239
- if (element)
240
- observer.observe(element);
241
- return () => {
242
- if (element)
243
- observer.unobserve(element);
244
- };
245
- function intersectionCallback([entry]) {
246
- if (entry == null ? void 0 : entry.isIntersecting) {
247
- setIsVisible(true);
248
- }
249
- }
250
- }, [element, options]);
251
- return isVisible;
252
- };
253
- const useBoxAnimations = (_c) => {
254
- var _d = _c, {
255
- boxElement,
256
- elements
257
- } = _d, props = __objRest(_d, [
258
- "boxElement",
259
- "elements"
260
- ]);
261
- const reducedMotion = useReducedMotion();
262
- const boxAnimateType = useMediaQuery(props.boxAnimateType) || DEFAULT_BOX_ANIMATE_TYPE;
263
- const boxAnimateDuration = useMediaQuery(props.boxAnimateDuration) || DEFAULT_BOX_ANIMATE_DURATION;
264
- const boxAnimateDelay = useMediaQuery(props.boxAnimateDelay) || DEFAULT_BOX_ANIMATE_DELAY;
265
- const itemAnimateType = useMediaQuery(props.itemAnimateType) || DEFAULT_ITEM_ANIMATE_TYPE;
266
- const itemAnimateDuration = useMediaQuery(props.itemAnimateDuration) || DEFAULT_ITEM_ANIMATE_DURATION;
267
- const itemAnimateDelay = useMediaQuery(props.itemAnimateDelay) || DEFAULT_ITEM_ANIMATE_DELAY;
268
- const itemStaggerDuration = useMediaQuery(props.itemStaggerDuration) || DEFAULT_ITEM_STAGGER_DURATION;
269
- const isBoxVisible = useElementOnScreen(boxElement, {
270
- root: null,
271
- rootMargin: `0px 0px -10% 0px`,
272
- threshold: 0.2
273
- });
274
- const itemControls = useAnimation();
275
- const boxControls = useAnimation();
276
- const setSequence = useCallback((variant) => {
277
- boxControls.stop();
278
- itemControls.stop();
279
- boxControls.set(variant);
280
- itemControls.set(variant);
281
- }, [boxControls, itemControls]);
282
- const playSequence = useCallback(() => {
283
- boxControls.stop();
284
- itemControls.stop();
285
- boxControls.set("exited");
286
- itemControls.set("exited");
287
- boxControls.start("entered");
288
- itemControls.start("entered");
289
- }, [boxControls, itemControls]);
290
- useEffect(() => {
291
- if (isBoxVisible) {
292
- setSequence("entered");
293
- }
294
- }, [elements == null ? void 0 : elements.map((e) => e.key).sort().join(), setSequence]);
295
- useEffect(() => {
296
- if (isBoxVisible) {
297
- playSequence();
298
- }
299
- }, [isBoxVisible, boxAnimateType, boxAnimateDuration, boxAnimateDelay, itemAnimateType, itemAnimateDuration, itemAnimateDelay, itemStaggerDuration, reducedMotion, playSequence]);
300
- const boxVariant = boxAnimations[boxAnimateType];
301
- const itemVariant = boxAnimations[itemAnimateType];
302
- return {
303
- initial: {
304
- container: reducedMotion ? "entered" : "exited",
305
- parent: reducedMotion ? "entered" : "exited"
306
- },
307
- animate: {
308
- container: reducedMotion ? void 0 : boxControls,
309
- parent: reducedMotion ? void 0 : itemControls
310
- },
311
- variants: {
312
- container: {
313
- exited: boxVariant.exited,
314
- entered: boxVariant.entered
315
- },
316
- child: {
317
- exited: itemVariant.exited,
318
- entered: itemVariant.entered
319
- }
320
- },
321
- transition: {
322
- container: mergeCustomTransitionWithDefault(boxVariant.transition, {
323
- delay: boxAnimateDelay,
324
- duration: boxAnimateDuration
325
- }),
326
- parent: {
327
- delayChildren: itemAnimateDelay,
328
- staggerChildren: itemStaggerDuration,
329
- duration: itemAnimateDuration
330
- },
331
- child: mergeCustomTransitionWithDefault(itemVariant.transition, {
332
- duration: itemAnimateDuration
333
- })
334
- },
335
- key: {
336
- container: boxAnimateType + boxAnimateDuration + boxAnimateDelay + itemAnimateType + itemAnimateDuration + itemAnimateDelay + itemStaggerDuration + reducedMotion
337
- }
338
- };
339
- };
340
110
  const Box = forwardRef(function Box2({
341
111
  id,
342
112
  backgrounds,
@@ -362,8 +132,6 @@ const Box = forwardRef(function Box2({
362
132
  }, ref) {
363
133
  const innerRef = useRef(null);
364
134
  const [boxElement, setBoxElement] = useState(null);
365
- const hasAnimations = boxAnimateType != null || itemAnimateType != null;
366
- const Grid = hasAnimations ? motion.div : "div";
367
135
  useImperativeHandle(ref, () => ({
368
136
  getBoxModel() {
369
137
  var _a, _b, _c, _d;
@@ -403,38 +171,35 @@ const Box = forwardRef(function Box2({
403
171
  const gridItemClassName = useStyle(responsiveStyle([verticalAlign], ([alignItems = "flex-start"]) => ({
404
172
  alignItems
405
173
  })));
406
- const {
407
- initial,
408
- animate,
409
- variants,
410
- transition,
411
- key
412
- } = useBoxAnimations({
174
+ const [animationClassName, replayAnimation] = useBoxAnimation(boxElement, boxAnimateType, boxAnimateDuration, boxAnimateDelay, itemAnimateType);
175
+ const [key, setKey] = useState(() => v4());
176
+ const animationProps = {
413
177
  boxAnimateType,
414
178
  boxAnimateDuration,
415
179
  boxAnimateDelay,
416
- itemAnimateDelay,
417
180
  itemAnimateType,
418
181
  itemAnimateDuration,
419
- itemStaggerDuration,
420
- boxElement,
421
- elements: children == null ? void 0 : children.elements
422
- });
182
+ itemAnimateDelay,
183
+ itemStaggerDuration
184
+ };
185
+ const prevAnimationProps = useRef(animationProps);
186
+ useEffect(() => {
187
+ if (!areBoxAnimationPropsEqual(prevAnimationProps.current, animationProps)) {
188
+ replayAnimation();
189
+ setKey(v4());
190
+ prevAnimationProps.current = animationProps;
191
+ }
192
+ }, [replayAnimation, animationProps]);
423
193
  return /* @__PURE__ */ jsx(BackgroundsContainer, {
424
194
  ref: setBoxElement,
425
- hasAnimations,
426
195
  id,
427
196
  className: cx(width, margin, borderRadius, useStyle({
428
197
  display: "flex"
429
198
  }), useStyle(responsiveStyle([height], ([alignSelf = "auto"]) => ({
430
199
  alignSelf
431
- })))),
200
+ }))), animationClassName),
432
201
  backgrounds,
433
- animate: animate == null ? void 0 : animate.container,
434
- initial: initial == null ? void 0 : initial.container,
435
- variants: variants == null ? void 0 : variants.container,
436
- transition: transition == null ? void 0 : transition.container,
437
- children: /* @__PURE__ */ jsx(Grid, {
202
+ children: /* @__PURE__ */ jsx("div", {
438
203
  ref: innerRef,
439
204
  className: cx(padding, boxShadow, border, useStyle({
440
205
  display: "flex",
@@ -443,26 +208,23 @@ const Box = forwardRef(function Box2({
443
208
  }), useStyle(responsiveStyle([verticalAlign], ([alignContent = "flex-start"]) => ({
444
209
  alignContent
445
210
  })))),
446
- animate: animate == null ? void 0 : animate.parent,
447
- initial: initial == null ? void 0 : initial.parent,
448
- transition: transition == null ? void 0 : transition.parent,
449
211
  children: children && children.elements.length > 0 ? children.elements.map((child, index) => /* @__PURE__ */ jsx(GridItem, {
450
- as: hasAnimations ? motion.div : "div",
451
212
  className: gridItemClassName,
452
213
  grid: children.columns,
453
214
  index,
215
+ itemAnimateDuration,
216
+ itemAnimateDelay,
217
+ itemStaggerDuration,
454
218
  columnGap,
455
219
  rowGap,
456
- variants: variants == null ? void 0 : variants.child,
457
- transition: transition == null ? void 0 : transition.child,
458
220
  children: /* @__PURE__ */ jsx(Element, {
459
221
  element: child
460
222
  })
461
223
  }, child.key)) : /* @__PURE__ */ jsx(Placeholder, {
462
224
  hide: hidePlaceholder
463
225
  })
464
- })
465
- }, key == null ? void 0 : key.container);
226
+ }, key)
227
+ });
466
228
  });
467
229
  export { Box as default };
468
230
  //# sourceMappingURL=Box.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Box.es.js","sources":["../src/components/builtin/Box/components/Placeholder/index.tsx","../src/components/builtin/Box/animations.tsx","../src/components/builtin/Box/Box.tsx"],"sourcesContent":["import { forwardRef, Ref } from 'react'\nimport { useStyle } from '../../../../../runtimes/react/use-style'\n\ntype Props = { hide?: boolean }\n\nexport default forwardRef(function Placeholder(\n { hide = false, ...restOfProps }: Props,\n ref: Ref<HTMLDivElement>,\n) {\n return (\n <div\n {...restOfProps}\n ref={ref}\n style={{ visibility: hide ? 'hidden' : 'initial' }}\n className={useStyle({\n width: '100%',\n background: 'rgba(161, 168, 194, 0.18)',\n height: 80,\n padding: 8,\n })}\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"100%\"\n height=\"100%\"\n style={{ overflow: 'visible' }}\n >\n <rect\n x={0}\n y={0}\n width=\"100%\"\n height=\"100%\"\n strokeWidth={2}\n strokeDasharray=\"4 2\"\n fill=\"none\"\n stroke=\"rgba(161, 168, 194, 0.40)\"\n rx=\"4\"\n ry=\"4\"\n />\n </svg>\n </div>\n )\n})\n","import {\n TargetAndTransition,\n Transition,\n useAnimation,\n useReducedMotion,\n Variants,\n MotionProps,\n} from 'framer-motion'\nimport { TransitionMap } from 'framer-motion/types/types'\nimport { useCallback, useEffect, useState } from 'react'\n\nimport { ResponsiveValue } from '../../../prop-controllers'\nimport { useMediaQuery } from '../../hooks'\nimport { Element } from '../../../state/react-page'\nimport {\n BoxAnimateIn,\n DEFAULT_BOX_ANIMATE_DELAY,\n DEFAULT_BOX_ANIMATE_DURATION,\n DEFAULT_BOX_ANIMATE_TYPE,\n DEFAULT_ITEM_ANIMATE_DELAY,\n DEFAULT_ITEM_ANIMATE_DURATION,\n DEFAULT_ITEM_ANIMATE_TYPE,\n DEFAULT_ITEM_STAGGER_DURATION,\n} from './constants'\n\nconst defaultExitedProps = {\n opacity: 0,\n x: 0,\n y: 0,\n scale: 1,\n}\n\ntype BoxAnimationVariants = {\n entered: TargetAndTransition\n exited: TargetAndTransition\n}\n\nexport const boxAnimations: {\n [key in BoxAnimateIn]: {\n transition: TransitionMap\n } & BoxAnimationVariants\n} = {\n none: {\n entered: {\n opacity: 1,\n },\n exited: {\n ...defaultExitedProps,\n opacity: 1,\n },\n transition: {},\n },\n fadeIn: {\n exited: defaultExitedProps,\n entered: {\n opacity: 1,\n },\n transition: {},\n },\n fadeLeft: {\n exited: {\n ...defaultExitedProps,\n x: 60,\n },\n entered: {\n opacity: 1,\n x: 0,\n },\n transition: {\n x: {\n type: 'tween',\n ease: [0.165, 0.84, 0.44, 1],\n },\n },\n },\n fadeRight: {\n exited: {\n ...defaultExitedProps,\n x: -60,\n },\n entered: {\n opacity: 1,\n x: 0,\n },\n transition: {\n x: {\n type: 'tween',\n ease: [0.165, 0.84, 0.44, 1],\n },\n },\n },\n fadeUp: {\n exited: {\n ...defaultExitedProps,\n y: 80,\n },\n entered: {\n opacity: 1,\n y: 0,\n },\n transition: {\n y: {\n type: 'tween',\n ease: [0.165, 0.84, 0.44, 1],\n },\n },\n },\n fadeDown: {\n exited: {\n ...defaultExitedProps,\n y: -80,\n },\n entered: {\n opacity: 1,\n y: 0,\n },\n transition: {\n y: {\n type: 'tween',\n ease: [0.165, 0.84, 0.44, 1],\n },\n },\n },\n blurIn: {\n exited: {\n ...defaultExitedProps,\n filter: 'blur(20px)',\n },\n entered: {\n opacity: 1,\n filter: 'blur(0px)',\n },\n transition: {},\n },\n scaleDown: {\n exited: {\n ...defaultExitedProps,\n scale: 1.2,\n },\n entered: {\n opacity: 1,\n scale: 1,\n },\n transition: {\n scale: {\n type: 'tween',\n ease: [0.165, 0.84, 0.44, 1],\n },\n },\n },\n scaleUp: {\n exited: {\n ...defaultExitedProps,\n scale: 0.75,\n },\n entered: {\n opacity: 1,\n scale: 1,\n },\n transition: {\n scale: {\n type: 'tween',\n ease: [0.165, 0.84, 0.44, 1],\n },\n },\n },\n}\n\nconst mergeCustomTransitionWithDefault = (\n transitions: TransitionMap,\n props: Transition,\n): TransitionMap | Transition =>\n transitions\n ? Object.keys(transitions).reduce(\n (a, c) => ({\n ...a,\n [c]: {\n ...transitions[c as string],\n ...props,\n },\n }),\n props,\n )\n : props\n\nexport type BoxAnimationType = {\n containerAnimationProps: {\n transition: Transition\n variants: Variants\n }\n parentAnimationProps: {\n transition: Transition\n }\n childAnimationProps: {\n transition: Transition\n variants: Variants\n }\n}\n\nconst useElementOnScreen = (element: HTMLElement | null, options: IntersectionObserverInit) => {\n const [isVisible, setIsVisible] = useState(false)\n\n useEffect(() => {\n const observer = new IntersectionObserver(intersectionCallback, options)\n\n if (element) observer.observe(element)\n\n return () => {\n if (element) observer.unobserve(element)\n }\n\n function intersectionCallback([entry]: IntersectionObserverEntry[]) {\n if (entry?.isIntersecting) {\n setIsVisible(true)\n }\n }\n }, [element, options])\n\n return isVisible\n}\n\ntype UseBoxAnimationsPayload = {\n initial?: { container: MotionProps['initial']; parent: MotionProps['initial'] }\n animate?: { container: MotionProps['animate']; parent: MotionProps['animate'] }\n variants?: { container: MotionProps['variants']; child: MotionProps['variants'] }\n transition?: {\n container: MotionProps['transition']\n parent: MotionProps['transition']\n child: MotionProps['transition']\n }\n key?: { container: string }\n}\n\nexport const useBoxAnimations = ({\n boxElement,\n elements,\n ...props\n}: {\n boxAnimateType: ResponsiveValue<BoxAnimateIn> | undefined\n boxAnimateDuration: ResponsiveValue<number> | undefined\n boxAnimateDelay: ResponsiveValue<number> | undefined\n itemAnimateType: ResponsiveValue<BoxAnimateIn> | undefined\n itemAnimateDuration: ResponsiveValue<number> | undefined\n itemAnimateDelay: ResponsiveValue<number> | undefined\n itemStaggerDuration: ResponsiveValue<number> | undefined\n boxElement: HTMLElement | null\n elements: Element[] | undefined\n}): UseBoxAnimationsPayload => {\n const reducedMotion = useReducedMotion()\n const boxAnimateType = useMediaQuery(props.boxAnimateType) || DEFAULT_BOX_ANIMATE_TYPE\n const boxAnimateDuration = useMediaQuery(props.boxAnimateDuration) || DEFAULT_BOX_ANIMATE_DURATION\n const boxAnimateDelay = useMediaQuery(props.boxAnimateDelay) || DEFAULT_BOX_ANIMATE_DELAY\n const itemAnimateType = useMediaQuery(props.itemAnimateType) || DEFAULT_ITEM_ANIMATE_TYPE\n const itemAnimateDuration =\n useMediaQuery(props.itemAnimateDuration) || DEFAULT_ITEM_ANIMATE_DURATION\n const itemAnimateDelay = useMediaQuery(props.itemAnimateDelay) || DEFAULT_ITEM_ANIMATE_DELAY\n const itemStaggerDuration =\n useMediaQuery(props.itemStaggerDuration) || DEFAULT_ITEM_STAGGER_DURATION\n\n const isBoxVisible = useElementOnScreen(boxElement, {\n root: null,\n rootMargin: `0px 0px -10% 0px`,\n threshold: 0.2,\n })\n\n const itemControls = useAnimation()\n const boxControls = useAnimation()\n\n const setSequence = useCallback(\n (variant: keyof BoxAnimationVariants) => {\n boxControls.stop()\n itemControls.stop()\n boxControls.set(variant)\n itemControls.set(variant)\n },\n [boxControls, itemControls],\n )\n\n const playSequence = useCallback(() => {\n boxControls.stop()\n itemControls.stop()\n boxControls.set('exited')\n itemControls.set('exited')\n boxControls.start('entered')\n itemControls.start('entered')\n }, [boxControls, itemControls])\n\n useEffect(() => {\n if (isBoxVisible) {\n setSequence('entered')\n }\n }, [\n elements\n ?.map(e => e.key)\n .sort()\n .join(),\n setSequence,\n ])\n\n useEffect(() => {\n if (isBoxVisible) {\n playSequence()\n }\n }, [\n isBoxVisible,\n boxAnimateType,\n boxAnimateDuration,\n boxAnimateDelay,\n itemAnimateType,\n itemAnimateDuration,\n itemAnimateDelay,\n itemStaggerDuration,\n reducedMotion,\n playSequence,\n ])\n\n const boxVariant = boxAnimations[boxAnimateType]\n const itemVariant = boxAnimations[itemAnimateType]\n\n return {\n initial: {\n container: reducedMotion ? 'entered' : 'exited',\n parent: reducedMotion ? 'entered' : 'exited',\n },\n animate: {\n container: reducedMotion ? undefined : boxControls,\n parent: reducedMotion ? undefined : itemControls,\n },\n variants: {\n container: {\n exited: boxVariant.exited,\n entered: boxVariant.entered,\n },\n child: {\n exited: itemVariant.exited,\n entered: itemVariant.entered,\n },\n },\n transition: {\n container: mergeCustomTransitionWithDefault(boxVariant.transition, {\n delay: boxAnimateDelay,\n duration: boxAnimateDuration,\n }),\n parent: {\n delayChildren: itemAnimateDelay,\n staggerChildren: itemStaggerDuration,\n duration: itemAnimateDuration,\n },\n child: mergeCustomTransitionWithDefault(itemVariant.transition, {\n duration: itemAnimateDuration,\n }),\n },\n key: {\n container:\n boxAnimateType +\n boxAnimateDuration +\n boxAnimateDelay +\n itemAnimateType +\n itemAnimateDuration +\n itemAnimateDelay +\n itemStaggerDuration +\n reducedMotion,\n },\n }\n}\n","import { forwardRef, Ref, useImperativeHandle, useRef, useState } from 'react'\nimport { motion } from 'framer-motion'\nimport { cx } from '@emotion/css'\n\nimport { Element } from '../../../runtimes/react'\nimport Placeholder from './components/Placeholder'\nimport { useBoxAnimations } from './animations'\nimport {\n ElementIDValue,\n ResponsiveIconRadioGroupValue,\n GridValue,\n GapYValue,\n GapXValue,\n CheckboxValue,\n ResponsiveSelectValue,\n ResponsiveNumberValue,\n BackgroundsValue,\n} from '../../../prop-controllers/descriptors'\nimport { BoxModelHandle, parse, createBox } from '../../../box-model'\nimport BackgroundsContainer from '../../shared/BackgroundsContainer'\nimport { BoxAnimateIn } from './constants'\nimport { responsiveStyle } from '../../utils/responsive-style'\nimport { GridItem } from '../../shared/grid-item'\nimport { useStyle } from '../../../runtimes/react/use-style'\n\ntype Props = {\n id?: ElementIDValue\n backgrounds?: BackgroundsValue\n width?: string\n height?: ResponsiveIconRadioGroupValue<'auto' | 'stretch'>\n verticalAlign?: ResponsiveIconRadioGroupValue<\n 'flex-start' | 'center' | 'flex-end' | 'space-between'\n >\n margin?: string\n padding?: string\n border?: string\n borderRadius?: string\n boxShadow?: string\n rowGap?: GapYValue\n columnGap?: GapXValue\n boxAnimateType?: ResponsiveSelectValue<BoxAnimateIn>\n boxAnimateDuration?: ResponsiveNumberValue\n boxAnimateDelay?: ResponsiveNumberValue\n itemAnimateType?: ResponsiveSelectValue<BoxAnimateIn>\n itemAnimateDuration?: ResponsiveNumberValue\n itemAnimateDelay?: ResponsiveNumberValue\n itemStaggerDuration?: ResponsiveNumberValue\n hidePlaceholder?: CheckboxValue\n children?: GridValue\n}\n\nconst Box = forwardRef(function Box(\n {\n id,\n backgrounds,\n width,\n height,\n margin,\n padding,\n border,\n children,\n borderRadius,\n boxShadow,\n rowGap,\n columnGap,\n hidePlaceholder,\n verticalAlign,\n boxAnimateType,\n boxAnimateDuration,\n boxAnimateDelay,\n itemAnimateDelay,\n itemAnimateType,\n itemAnimateDuration,\n itemStaggerDuration,\n }: Props,\n ref: Ref<BoxModelHandle>,\n) {\n const innerRef = useRef<HTMLDivElement | null>(null)\n const [boxElement, setBoxElement] = useState<HTMLElement | null>(null)\n const hasAnimations = boxAnimateType != null || itemAnimateType != null\n const Grid = hasAnimations ? motion.div : 'div'\n\n useImperativeHandle(\n ref,\n () => ({\n getBoxModel() {\n const paddingBoxElement = innerRef.current\n const borderBoxElement = innerRef.current\n const marginBoxElement = boxElement\n const borderBox = innerRef.current?.getBoundingClientRect()\n const paddingBoxComputedStyle =\n paddingBoxElement?.ownerDocument.defaultView?.getComputedStyle(paddingBoxElement)\n const borderBoxComputedStyle =\n borderBoxElement?.ownerDocument.defaultView?.getComputedStyle(borderBoxElement)\n const marginBoxComputedStyle =\n marginBoxElement?.ownerDocument.defaultView?.getComputedStyle(marginBoxElement)\n const padding = paddingBoxComputedStyle && {\n top: parse(paddingBoxComputedStyle.paddingTop),\n right: parse(paddingBoxComputedStyle.paddingRight),\n bottom: parse(paddingBoxComputedStyle.paddingBottom),\n left: parse(paddingBoxComputedStyle.paddingLeft),\n }\n const border = borderBoxComputedStyle && {\n top: parse(borderBoxComputedStyle.borderTopWidth),\n right: parse(borderBoxComputedStyle.borderRightWidth),\n bottom: parse(borderBoxComputedStyle.borderBottomWidth),\n left: parse(borderBoxComputedStyle.borderLeftWidth),\n }\n const margin = marginBoxComputedStyle && {\n top: parse(marginBoxComputedStyle.marginTop),\n right: parse(marginBoxComputedStyle.marginRight),\n bottom: parse(marginBoxComputedStyle.marginBottom),\n left: parse(marginBoxComputedStyle.marginLeft),\n }\n\n return borderBox ? createBox({ borderBox, padding, border, margin }) : null\n },\n }),\n [boxElement],\n )\n\n const gridItemClassName = useStyle(\n responsiveStyle([verticalAlign], ([alignItems = 'flex-start']) => ({ alignItems })),\n )\n\n const { initial, animate, variants, transition, key } = useBoxAnimations({\n boxAnimateType,\n boxAnimateDuration,\n boxAnimateDelay,\n itemAnimateDelay,\n itemAnimateType,\n itemAnimateDuration,\n itemStaggerDuration,\n boxElement,\n elements: children?.elements,\n })\n\n return (\n <BackgroundsContainer\n ref={setBoxElement}\n hasAnimations={hasAnimations}\n id={id}\n className={cx(\n width,\n margin,\n borderRadius,\n useStyle({ display: 'flex' }),\n useStyle(responsiveStyle([height], ([alignSelf = 'auto']) => ({ alignSelf }))),\n )}\n backgrounds={backgrounds}\n animate={animate?.container}\n initial={initial?.container}\n variants={variants?.container}\n transition={transition?.container}\n key={key?.container}\n >\n <Grid\n ref={innerRef}\n className={cx(\n padding,\n boxShadow,\n border,\n useStyle({ display: 'flex', flexWrap: 'wrap', width: '100%' }),\n useStyle(\n responsiveStyle([verticalAlign], ([alignContent = 'flex-start']) => ({ alignContent })),\n ),\n )}\n animate={animate?.parent}\n initial={initial?.parent}\n transition={transition?.parent}\n >\n {children && children.elements.length > 0 ? (\n children.elements.map((child, index) => (\n <GridItem\n as={hasAnimations ? motion.div : 'div'}\n key={child.key}\n className={gridItemClassName}\n grid={children.columns}\n index={index}\n columnGap={columnGap}\n rowGap={rowGap}\n // @ts-ignore: `variants` is not a prop for `div`, but it is for `motion.div`.\n variants={variants?.child}\n transition={transition?.child}\n >\n <Element element={child} />\n </GridItem>\n ))\n ) : (\n <Placeholder hide={hidePlaceholder} />\n )}\n </Grid>\n </BackgroundsContainer>\n )\n})\n\nexport default Box\n"],"names":["forwardRef","ref","hide","restOfProps","visibility","useStyle","width","background","height","padding","overflow","defaultExitedProps","opacity","x","y","scale","boxAnimations","none","entered","exited","transition","fadeIn","fadeLeft","type","ease","fadeRight","fadeUp","fadeDown","blurIn","filter","scaleDown","scaleUp","mergeCustomTransitionWithDefault","transitions","props","Object","keys","reduce","a","c","useElementOnScreen","element","options","isVisible","setIsVisible","useState","useEffect","observer","IntersectionObserver","intersectionCallback","observe","unobserve","entry","isIntersecting","useBoxAnimations","boxElement","elements","reducedMotion","useReducedMotion","boxAnimateType","useMediaQuery","DEFAULT_BOX_ANIMATE_TYPE","boxAnimateDuration","DEFAULT_BOX_ANIMATE_DURATION","boxAnimateDelay","DEFAULT_BOX_ANIMATE_DELAY","itemAnimateType","DEFAULT_ITEM_ANIMATE_TYPE","itemAnimateDuration","DEFAULT_ITEM_ANIMATE_DURATION","itemAnimateDelay","DEFAULT_ITEM_ANIMATE_DELAY","itemStaggerDuration","DEFAULT_ITEM_STAGGER_DURATION","isBoxVisible","root","rootMargin","threshold","itemControls","useAnimation","boxControls","setSequence","useCallback","variant","stop","set","playSequence","start","map","e","key","sort","join","boxVariant","itemVariant","initial","container","parent","animate","undefined","variants","child","delay","duration","delayChildren","staggerChildren","Box","id","backgrounds","margin","border","children","borderRadius","boxShadow","rowGap","columnGap","hidePlaceholder","verticalAlign","innerRef","useRef","setBoxElement","hasAnimations","Grid","motion","div","useImperativeHandle","getBoxModel","paddingBoxElement","current","borderBoxElement","marginBoxElement","borderBox","getBoundingClientRect","paddingBoxComputedStyle","ownerDocument","defaultView","getComputedStyle","borderBoxComputedStyle","marginBoxComputedStyle","top","parse","paddingTop","right","paddingRight","bottom","paddingBottom","left","paddingLeft","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","marginTop","marginRight","marginBottom","marginLeft","createBox","gridItemClassName","responsiveStyle","alignItems","cx","display","alignSelf","flexWrap","alignContent","length","index","columns"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,IAAA,cAAeA,WAAW,sBACxB,IACAC,KACA;AAFA,eAAEC;AAAAA,WAAO;AAAA,MAAT,IAAmBC,wBAAnB,IAAmBA;AAAAA,IAAjBD;AAAAA;AAGF,qEAEQC;IACJ;AAAA,IACA,OAAO;AAAA,MAAEC,YAAYF,OAAO,WAAW;AAAA,IAHzC;AAAA,IAIE,WAAWG,SAAS;AAAA,MAClBC,OAAO;AAAA,MACPC,YAAY;AAAA,MACZC,QAAQ;AAAA,MACRC,SAAS;AAAA,IAAA,CAJQ;AAAA,IAOnB,8BAAA,OAAA;AAAA,MACE,OAAM;AAAA,MACN,OAAM;AAAA,MACN,QAAO;AAAA,MACP,OAAO;AAAA,QAAEC,UAAU;AAAA,MAJrB;AAAA,MAME,8BAAA,QAAA;AAAA,QACE,GAAG;AAAA,QACH,GAAG;AAAA,QACH,OAAM;AAAA,QACN,QAAO;AAAA,QACP,aAAa;AAAA,QACb,iBAAgB;AAAA,QAChB,MAAK;AAAA,QACL,QAAO;AAAA,QACP,IAAG;AAAA,QACH,IAAG;AAAA,MA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X,MAAM9C,SAASwD;AAAAA,QACf;AAAA,QACA;AAAA,QACA;AAAA,QAEA,UAAUnE,qCAAUC;AAAAA,QACpB,YAAYjF,yCAAYiF;AAAAA,QAV1B,8BAYG,SAAD;AAAA,UAAS,SAASA;AAAAA,QAAAA,CAAlB;AAAA,SAVKA,MAAMX,GAFb,CADF,wBAiBC,aAAD;AAAA,QAAa,MAAM0B;AAAAA,MAAAA,CAAnB;AAAA,IAAA,CAjCJ;AAAA,EAAA,GAFK1B,2BAAKM,SAhBZ;AAwDH,CA/IqB;;"}
1
+ {"version":3,"file":"Box.es.js","sources":["../src/components/builtin/Box/components/Placeholder/index.tsx","../src/components/builtin/Box/Box.tsx"],"sourcesContent":["import { forwardRef, Ref } from 'react'\nimport { useStyle } from '../../../../../runtimes/react/use-style'\n\ntype Props = { hide?: boolean }\n\nexport default forwardRef(function Placeholder(\n { hide = false, ...restOfProps }: Props,\n ref: Ref<HTMLDivElement>,\n) {\n return (\n <div\n {...restOfProps}\n ref={ref}\n style={{ visibility: hide ? 'hidden' : 'initial' }}\n className={useStyle({\n width: '100%',\n background: 'rgba(161, 168, 194, 0.18)',\n height: 80,\n padding: 8,\n })}\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"100%\"\n height=\"100%\"\n style={{ overflow: 'visible' }}\n >\n <rect\n x={0}\n y={0}\n width=\"100%\"\n height=\"100%\"\n strokeWidth={2}\n strokeDasharray=\"4 2\"\n fill=\"none\"\n stroke=\"rgba(161, 168, 194, 0.40)\"\n rx=\"4\"\n ry=\"4\"\n />\n </svg>\n </div>\n )\n})\n","import { forwardRef, Ref, useEffect, useImperativeHandle, useRef, useState } from 'react'\nimport { cx } from '@emotion/css'\nimport { v4 as uuid } from 'uuid'\n\nimport { Element } from '../../../runtimes/react'\nimport Placeholder from './components/Placeholder'\nimport { areBoxAnimationPropsEqual, BoxAnimationProps, useBoxAnimation } from './animations'\nimport {\n ElementIDValue,\n ResponsiveIconRadioGroupValue,\n GridValue,\n GapYValue,\n GapXValue,\n CheckboxValue,\n BackgroundsValue,\n} from '../../../prop-controllers/descriptors'\nimport { BoxModelHandle, parse, createBox } from '../../../box-model'\nimport BackgroundsContainer from '../../shared/BackgroundsContainer'\nimport { responsiveStyle } from '../../utils/responsive-style'\nimport { GridItem } from '../../shared/grid-item'\nimport { useStyle } from '../../../runtimes/react/use-style'\n\ntype Props = {\n id?: ElementIDValue\n backgrounds?: BackgroundsValue\n width?: string\n height?: ResponsiveIconRadioGroupValue<'auto' | 'stretch'>\n verticalAlign?: ResponsiveIconRadioGroupValue<\n 'flex-start' | 'center' | 'flex-end' | 'space-between'\n >\n margin?: string\n padding?: string\n border?: string\n borderRadius?: string\n boxShadow?: string\n rowGap?: GapYValue\n columnGap?: GapXValue\n hidePlaceholder?: CheckboxValue\n children?: GridValue\n} & BoxAnimationProps\n\nconst Box = forwardRef(function Box(\n {\n id,\n backgrounds,\n width,\n height,\n margin,\n padding,\n border,\n children,\n borderRadius,\n boxShadow,\n rowGap,\n columnGap,\n hidePlaceholder,\n verticalAlign,\n boxAnimateType,\n boxAnimateDuration,\n boxAnimateDelay,\n itemAnimateDelay,\n itemAnimateType,\n itemAnimateDuration,\n itemStaggerDuration,\n }: Props,\n ref: Ref<BoxModelHandle>,\n) {\n const innerRef = useRef<HTMLDivElement | null>(null)\n const [boxElement, setBoxElement] = useState<HTMLElement | null>(null)\n\n useImperativeHandle(\n ref,\n () => ({\n getBoxModel() {\n const paddingBoxElement = innerRef.current\n const borderBoxElement = innerRef.current\n const marginBoxElement = boxElement\n const borderBox = innerRef.current?.getBoundingClientRect()\n const paddingBoxComputedStyle =\n paddingBoxElement?.ownerDocument.defaultView?.getComputedStyle(paddingBoxElement)\n const borderBoxComputedStyle =\n borderBoxElement?.ownerDocument.defaultView?.getComputedStyle(borderBoxElement)\n const marginBoxComputedStyle =\n marginBoxElement?.ownerDocument.defaultView?.getComputedStyle(marginBoxElement)\n const padding = paddingBoxComputedStyle && {\n top: parse(paddingBoxComputedStyle.paddingTop),\n right: parse(paddingBoxComputedStyle.paddingRight),\n bottom: parse(paddingBoxComputedStyle.paddingBottom),\n left: parse(paddingBoxComputedStyle.paddingLeft),\n }\n const border = borderBoxComputedStyle && {\n top: parse(borderBoxComputedStyle.borderTopWidth),\n right: parse(borderBoxComputedStyle.borderRightWidth),\n bottom: parse(borderBoxComputedStyle.borderBottomWidth),\n left: parse(borderBoxComputedStyle.borderLeftWidth),\n }\n const margin = marginBoxComputedStyle && {\n top: parse(marginBoxComputedStyle.marginTop),\n right: parse(marginBoxComputedStyle.marginRight),\n bottom: parse(marginBoxComputedStyle.marginBottom),\n left: parse(marginBoxComputedStyle.marginLeft),\n }\n\n return borderBox ? createBox({ borderBox, padding, border, margin }) : null\n },\n }),\n [boxElement],\n )\n\n const gridItemClassName = useStyle(\n responsiveStyle([verticalAlign], ([alignItems = 'flex-start']) => ({ alignItems })),\n )\n\n const [animationClassName, replayAnimation] = useBoxAnimation(\n boxElement,\n boxAnimateType,\n boxAnimateDuration,\n boxAnimateDelay,\n itemAnimateType,\n )\n\n const [key, setKey] = useState(() => uuid())\n\n const animationProps = {\n boxAnimateType,\n boxAnimateDuration,\n boxAnimateDelay,\n itemAnimateType,\n itemAnimateDuration,\n itemAnimateDelay,\n itemStaggerDuration,\n }\n\n const prevAnimationProps = useRef(animationProps)\n useEffect(() => {\n if (!areBoxAnimationPropsEqual(prevAnimationProps.current, animationProps)) {\n replayAnimation()\n setKey(uuid())\n prevAnimationProps.current = animationProps\n }\n }, [replayAnimation, animationProps])\n\n return (\n <BackgroundsContainer\n ref={setBoxElement}\n id={id}\n className={cx(\n width,\n margin,\n borderRadius,\n useStyle({ display: 'flex' }),\n useStyle(responsiveStyle([height], ([alignSelf = 'auto']) => ({ alignSelf }))),\n animationClassName,\n )}\n backgrounds={backgrounds}\n >\n <div\n ref={innerRef}\n key={key}\n className={cx(\n padding,\n boxShadow,\n border,\n useStyle({ display: 'flex', flexWrap: 'wrap', width: '100%' }),\n useStyle(\n responsiveStyle([verticalAlign], ([alignContent = 'flex-start']) => ({ alignContent })),\n ),\n )}\n >\n {children && children.elements.length > 0 ? (\n children.elements.map((child, index) => (\n <GridItem\n key={child.key}\n className={gridItemClassName}\n grid={children.columns}\n index={index}\n itemAnimateDuration={itemAnimateDuration}\n itemAnimateDelay={itemAnimateDelay}\n itemStaggerDuration={itemStaggerDuration}\n columnGap={columnGap}\n rowGap={rowGap}\n >\n <Element element={child} />\n </GridItem>\n ))\n ) : (\n <Placeholder hide={hidePlaceholder} />\n )}\n </div>\n </BackgroundsContainer>\n )\n})\n\nexport default Box\n"],"names":["forwardRef","ref","hide","restOfProps","visibility","useStyle","width","background","height","padding","overflow","Box","id","backgrounds","margin","border","children","borderRadius","boxShadow","rowGap","columnGap","hidePlaceholder","verticalAlign","boxAnimateType","boxAnimateDuration","boxAnimateDelay","itemAnimateDelay","itemAnimateType","itemAnimateDuration","itemStaggerDuration","innerRef","useRef","boxElement","setBoxElement","useState","useImperativeHandle","getBoxModel","paddingBoxElement","current","borderBoxElement","marginBoxElement","borderBox","getBoundingClientRect","paddingBoxComputedStyle","ownerDocument","defaultView","getComputedStyle","borderBoxComputedStyle","marginBoxComputedStyle","top","parse","paddingTop","right","paddingRight","bottom","paddingBottom","left","paddingLeft","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","marginTop","marginRight","marginBottom","marginLeft","createBox","gridItemClassName","responsiveStyle","alignItems","animationClassName","replayAnimation","useBoxAnimation","key","setKey","uuid","animationProps","prevAnimationProps","useEffect","areBoxAnimationPropsEqual","cx","display","alignSelf","flexWrap","alignContent","elements","length","map","child","index","columns"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,IAAA,cAAeA,WAAW,sBACxB,IACAC,KACA;AAFA,eAAEC;AAAAA,WAAO;AAAA,MAAT,IAAmBC,wBAAnB,IAAmBA;AAAAA,IAAjBD;A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G,SAAD;AAAA,UAAS,SAASF;AAAAA,QAAAA,CAAlB;AAAA,SAVKA,MAAMf,GADb,CADF,wBAgBC,aAAD;AAAA,QAAa,MAAMpD;AAAAA,MAAAA,CAAnB;AAAA,OA5BGoD,GAFP;AAAA,EAAA,CAdJ;AAiDD,CAtJqB;;"}
@@ -34,22 +34,22 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
34
34
  var React = require("react");
35
35
  var ColorHelper = require("color");
36
36
  var next = require("./index.cjs.js");
37
- var index = require("./index.cjs2.js");
37
+ var index = require("./index.cjs3.js");
38
38
  var css = require("@emotion/css");
39
39
  var jsxRuntime = require("react/jsx-runtime");
40
40
  require("use-sync-external-store/shim/with-selector");
41
+ require("next/dynamic");
41
42
  require("./react-page.cjs.js");
42
43
  require("redux");
43
44
  require("redux-thunk");
44
45
  require("./actions.cjs.js");
45
46
  require("./slot.cjs.js");
46
47
  require("./control.cjs.js");
47
- require("next/dynamic");
48
- require("slate");
49
- require("./types.cjs.js");
50
48
  require("./text-input.cjs.js");
51
49
  require("./combobox.cjs.js");
52
50
  require("use-sync-external-store/shim");
51
+ require("slate");
52
+ require("./types.cjs.js");
53
53
  require("scroll-into-view-if-needed");
54
54
  require("./box-models.cjs.js");
55
55
  require("css-box-model");
package/dist/Button.es.js CHANGED
@@ -31,23 +31,23 @@ var __objRest = (source, exclude) => {
31
31
  };
32
32
  import { forwardRef } from "react";
33
33
  import ColorHelper from "color";
34
- import { n as useStyle, o as responsiveWidth, r as responsiveStyle, p as responsiveTextStyle, q as colorToString } from "./index.es.js";
35
- import { L as Link } from "./index.es2.js";
34
+ import { o as useStyle, p as responsiveWidth, r as responsiveStyle, q as responsiveTextStyle, s as colorToString } from "./index.es.js";
35
+ import { L as Link } from "./index.es3.js";
36
36
  import { cx } from "@emotion/css";
37
37
  import { jsx } from "react/jsx-runtime";
38
38
  import "use-sync-external-store/shim/with-selector";
39
+ import "next/dynamic";
39
40
  import "./react-page.es.js";
40
41
  import "redux";
41
42
  import "redux-thunk";
42
43
  import "./actions.es.js";
43
44
  import "./slot.es.js";
44
45
  import "./control.es.js";
45
- import "next/dynamic";
46
- import "slate";
47
- import "./types.es.js";
48
46
  import "./text-input.es.js";
49
47
  import "./combobox.es.js";
50
48
  import "use-sync-external-store/shim";
49
+ import "slate";
50
+ import "./types.es.js";
51
51
  import "scroll-into-view-if-needed";
52
52
  import "./box-models.es.js";
53
53
  import "css-box-model";
@@ -38,21 +38,20 @@ var popcorn = require("@popmotion/popcorn");
38
38
  var next = require("./index.cjs.js");
39
39
  require("use-sync-external-store/shim");
40
40
  require("./slot.cjs.js");
41
- var useMediaQuery = require("./useMediaQuery.cjs.js");
42
41
  var Image = require("./Image.cjs.js");
43
42
  var css = require("@emotion/css");
44
43
  var jsxRuntime = require("react/jsx-runtime");
45
44
  require("use-sync-external-store/shim/with-selector");
45
+ require("next/dynamic");
46
46
  require("./react-page.cjs.js");
47
47
  require("redux");
48
48
  require("redux-thunk");
49
49
  require("./actions.cjs.js");
50
50
  require("./control.cjs.js");
51
- require("next/dynamic");
52
- require("slate");
53
- require("./types.cjs.js");
54
51
  require("./text-input.cjs.js");
55
52
  require("./combobox.cjs.js");
53
+ require("slate");
54
+ require("./types.cjs.js");
56
55
  require("color");
57
56
  require("scroll-into-view-if-needed");
58
57
  require("./box-models.cjs.js");
@@ -70,8 +69,10 @@ require("uuid/v4");
70
69
  require("corporate-ipsum");
71
70
  require("next/image");
72
71
  require("./placeholders.cjs.js");
73
- require("./index.cjs2.js");
72
+ require("./index.cjs3.js");
74
73
  require("next/link");
74
+ require("./next-version.cjs.js");
75
+ require("next/package.json");
75
76
  const LeftChevron = () => /* @__PURE__ */ jsxRuntime.jsx("svg", {
76
77
  xmlns: "http://www.w3.org/2000/svg",
77
78
  width: "10",
@@ -122,8 +123,8 @@ const Carousel = React.forwardRef(function Carousel2({
122
123
  const [index, setIndex] = React.useState(0);
123
124
  const swipe = React.useRef(0);
124
125
  const startIndex = popcorn.wrap(0, images.length, index);
125
- const pageSize = useMediaQuery.useMediaQuery(responsivePageSize) || 1;
126
- const step = useMediaQuery.useMediaQuery(responsiveStep) || 1;
126
+ const pageSize = next.useMediaQuery(responsivePageSize) || 1;
127
+ const step = next.useMediaQuery(responsiveStep) || 1;
127
128
  const endIndex = startIndex + pageSize;
128
129
  const pageCount = Math.ceil((images.length - pageSize) / step + 1);
129
130
  const pageIndex = Math.ceil(startIndex / step);