@makeswift/runtime 0.5.2 → 0.5.4

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 (73) hide show
  1. package/dist/Box.cjs.js +1 -1
  2. package/dist/Box.es.js +1 -1
  3. package/dist/Button.cjs.js +1 -1
  4. package/dist/Button.es.js +1 -1
  5. package/dist/Carousel.cjs.js +1 -1
  6. package/dist/Carousel.es.js +1 -1
  7. package/dist/Countdown.cjs.js +1 -1
  8. package/dist/Countdown.es.js +1 -1
  9. package/dist/Divider.cjs.js +1 -1
  10. package/dist/Divider.es.js +1 -1
  11. package/dist/Embed.cjs.js +1 -1
  12. package/dist/Embed.es.js +1 -1
  13. package/dist/Form.cjs.js +1 -1
  14. package/dist/Form.es.js +1 -1
  15. package/dist/Image.cjs.js +1 -1
  16. package/dist/Image.es.js +1 -1
  17. package/dist/LiveProvider.cjs.js +3 -3
  18. package/dist/LiveProvider.es.js +3 -3
  19. package/dist/Navigation.cjs.js +1 -1
  20. package/dist/Navigation.es.js +1 -1
  21. package/dist/PreviewProvider.cjs.js +18 -18
  22. package/dist/PreviewProvider.es.js +3 -3
  23. package/dist/Root.cjs.js +1 -1
  24. package/dist/Root.es.js +1 -1
  25. package/dist/SocialLinks.cjs.js +1 -1
  26. package/dist/SocialLinks.es.js +1 -1
  27. package/dist/Text.cjs.js +4 -4
  28. package/dist/Text.es.js +1 -1
  29. package/dist/Video.cjs.js +6 -2
  30. package/dist/Video.cjs.js.map +1 -1
  31. package/dist/Video.es.js +7 -3
  32. package/dist/Video.es.js.map +1 -1
  33. package/dist/actions.cjs.js +1 -6
  34. package/dist/actions.cjs.js.map +1 -1
  35. package/dist/actions.es.js +2 -6
  36. package/dist/actions.es.js.map +1 -1
  37. package/dist/components.cjs.js +1 -2
  38. package/dist/components.cjs.js.map +1 -1
  39. package/dist/components.es.js +2 -2
  40. package/dist/{react-page.cjs.js → constants.cjs.js} +17 -1
  41. package/dist/constants.cjs.js.map +1 -0
  42. package/dist/{react-page.es.js → constants.es.js} +17 -2
  43. package/dist/constants.es.js.map +1 -0
  44. package/dist/index.cjs.js +42 -66
  45. package/dist/index.cjs.js.map +1 -1
  46. package/dist/index.cjs2.js +6 -6
  47. package/dist/index.es.js +7 -30
  48. package/dist/index.es.js.map +1 -1
  49. package/dist/index.es2.js +2 -2
  50. package/dist/index.es3.js +1 -1
  51. package/dist/main.cjs.js +3 -2
  52. package/dist/main.cjs.js.map +1 -1
  53. package/dist/main.es.js +1 -1
  54. package/dist/next.cjs.js +1 -1
  55. package/dist/next.es.js +2 -2
  56. package/dist/react.cjs.js +1 -1
  57. package/dist/react.es.js +1 -1
  58. package/dist/types/src/api/react.d.ts +0 -1
  59. package/dist/types/src/api/react.d.ts.map +1 -1
  60. package/dist/types/src/components/builtin/Video/Video.d.ts.map +1 -1
  61. package/dist/types/src/components/builtin/index.d.ts +0 -1
  62. package/dist/types/src/components/builtin/index.d.ts.map +1 -1
  63. package/dist/types/src/index.d.ts +1 -0
  64. package/dist/types/src/index.d.ts.map +1 -1
  65. package/dist/types/src/next/index.d.ts.map +1 -1
  66. package/dist/types/src/state/actions.d.ts +1 -10
  67. package/dist/types/src/state/actions.d.ts.map +1 -1
  68. package/dist/types/src/state/makeswift-api-client.d.ts +2 -2
  69. package/dist/types/src/state/makeswift-api-client.d.ts.map +1 -1
  70. package/dist/types/src/state/modules/api-resources.d.ts.map +1 -1
  71. package/package.json +1 -1
  72. package/dist/react-page.cjs.js.map +0 -1
  73. package/dist/react-page.es.js.map +0 -1
package/dist/Box.cjs.js CHANGED
@@ -40,7 +40,7 @@ var index = require("./index.cjs2.js");
40
40
  var boxModels = require("./box-models.cjs.js");
41
41
  require("use-sync-external-store/shim/with-selector");
42
42
  require("next/dynamic");
43
- require("./react-page.cjs.js");
43
+ require("./constants.cjs.js");
44
44
  require("redux");
45
45
  require("redux-thunk");
46
46
  require("./actions.cjs.js");
package/dist/Box.es.js CHANGED
@@ -38,7 +38,7 @@ import { a as useBoxAnimation, b as areBoxAnimationPropsEqual, B as BackgroundsC
38
38
  import { p as parse, c as createBox } from "./box-models.es.js";
39
39
  import "use-sync-external-store/shim/with-selector";
40
40
  import "next/dynamic";
41
- import "./react-page.es.js";
41
+ import "./constants.es.js";
42
42
  import "redux";
43
43
  import "redux-thunk";
44
44
  import "./actions.es.js";
@@ -39,7 +39,7 @@ var css = require("@emotion/css");
39
39
  var jsxRuntime = require("react/jsx-runtime");
40
40
  require("use-sync-external-store/shim/with-selector");
41
41
  require("next/dynamic");
42
- require("./react-page.cjs.js");
42
+ require("./constants.cjs.js");
43
43
  require("redux");
44
44
  require("redux-thunk");
45
45
  require("./actions.cjs.js");
package/dist/Button.es.js CHANGED
@@ -37,7 +37,7 @@ import { cx } from "@emotion/css";
37
37
  import { jsx } from "react/jsx-runtime";
38
38
  import "use-sync-external-store/shim/with-selector";
39
39
  import "next/dynamic";
40
- import "./react-page.es.js";
40
+ import "./constants.es.js";
41
41
  import "redux";
42
42
  import "redux-thunk";
43
43
  import "./actions.es.js";
@@ -43,7 +43,7 @@ var css = require("@emotion/css");
43
43
  var jsxRuntime = require("react/jsx-runtime");
44
44
  require("use-sync-external-store/shim/with-selector");
45
45
  require("next/dynamic");
46
- require("./react-page.cjs.js");
46
+ require("./constants.cjs.js");
47
47
  require("redux");
48
48
  require("redux-thunk");
49
49
  require("./actions.cjs.js");
@@ -41,7 +41,7 @@ import { cx } from "@emotion/css";
41
41
  import { jsxs, jsx } from "react/jsx-runtime";
42
42
  import "use-sync-external-store/shim/with-selector";
43
43
  import "next/dynamic";
44
- import "./react-page.es.js";
44
+ import "./constants.es.js";
45
45
  import "redux";
46
46
  import "redux-thunk";
47
47
  import "./actions.es.js";
@@ -37,7 +37,7 @@ var next = require("./index.cjs.js");
37
37
  var jsxRuntime = require("react/jsx-runtime");
38
38
  require("use-sync-external-store/shim/with-selector");
39
39
  require("next/dynamic");
40
- require("./react-page.cjs.js");
40
+ require("./constants.cjs.js");
41
41
  require("redux");
42
42
  require("redux-thunk");
43
43
  require("./actions.cjs.js");
@@ -35,7 +35,7 @@ import { o as useStyle, r as responsiveStyle, s as colorToString } from "./index
35
35
  import { jsx, jsxs } from "react/jsx-runtime";
36
36
  import "use-sync-external-store/shim/with-selector";
37
37
  import "next/dynamic";
38
- import "./react-page.es.js";
38
+ import "./constants.es.js";
39
39
  import "redux";
40
40
  import "redux-thunk";
41
41
  import "./actions.es.js";
@@ -6,7 +6,7 @@ var css = require("@emotion/css");
6
6
  var jsxRuntime = require("react/jsx-runtime");
7
7
  require("use-sync-external-store/shim/with-selector");
8
8
  require("next/dynamic");
9
- require("./react-page.cjs.js");
9
+ require("./constants.cjs.js");
10
10
  require("redux");
11
11
  require("redux-thunk");
12
12
  require("./actions.cjs.js");
@@ -4,7 +4,7 @@ import { cx } from "@emotion/css";
4
4
  import { jsx } from "react/jsx-runtime";
5
5
  import "use-sync-external-store/shim/with-selector";
6
6
  import "next/dynamic";
7
- import "./react-page.es.js";
7
+ import "./constants.es.js";
8
8
  import "redux";
9
9
  import "redux-thunk";
10
10
  import "./actions.es.js";
package/dist/Embed.cjs.js CHANGED
@@ -7,7 +7,7 @@ var css = require("@emotion/css");
7
7
  var jsxRuntime = require("react/jsx-runtime");
8
8
  require("use-sync-external-store/shim/with-selector");
9
9
  require("next/dynamic");
10
- require("./react-page.cjs.js");
10
+ require("./constants.cjs.js");
11
11
  require("redux");
12
12
  require("redux-thunk");
13
13
  require("./actions.cjs.js");
package/dist/Embed.es.js CHANGED
@@ -5,7 +5,7 @@ import { cx } from "@emotion/css";
5
5
  import { jsx } from "react/jsx-runtime";
6
6
  import "use-sync-external-store/shim/with-selector";
7
7
  import "next/dynamic";
8
- import "./react-page.es.js";
8
+ import "./constants.es.js";
9
9
  import "redux";
10
10
  import "redux-thunk";
11
11
  import "./actions.es.js";
package/dist/Form.cjs.js CHANGED
@@ -42,7 +42,7 @@ var index = require("./index.cjs3.js");
42
42
  var boxModels = require("./box-models.cjs.js");
43
43
  require("use-sync-external-store/shim/with-selector");
44
44
  require("next/dynamic");
45
- require("./react-page.cjs.js");
45
+ require("./constants.cjs.js");
46
46
  require("redux");
47
47
  require("redux-thunk");
48
48
  require("./actions.cjs.js");
package/dist/Form.es.js CHANGED
@@ -41,7 +41,7 @@ import { L as Link } from "./index.es3.js";
41
41
  import { g as getBox } from "./box-models.es.js";
42
42
  import "use-sync-external-store/shim/with-selector";
43
43
  import "next/dynamic";
44
- import "./react-page.es.js";
44
+ import "./constants.es.js";
45
45
  import "redux";
46
46
  import "redux-thunk";
47
47
  import "./actions.es.js";
package/dist/Image.cjs.js CHANGED
@@ -10,7 +10,7 @@ var nextVersion = require("./next-version.cjs.js");
10
10
  var jsxRuntime = require("react/jsx-runtime");
11
11
  require("use-sync-external-store/shim/with-selector");
12
12
  require("next/dynamic");
13
- require("./react-page.cjs.js");
13
+ require("./constants.cjs.js");
14
14
  require("redux");
15
15
  require("redux-thunk");
16
16
  require("./actions.cjs.js");
package/dist/Image.es.js CHANGED
@@ -8,7 +8,7 @@ import { m as major } from "./next-version.es.js";
8
8
  import { jsx } from "react/jsx-runtime";
9
9
  import "use-sync-external-store/shim/with-selector";
10
10
  import "next/dynamic";
11
- import "./react-page.es.js";
11
+ import "./constants.es.js";
12
12
  import "redux";
13
13
  import "redux-thunk";
14
14
  import "./actions.es.js";
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  var React = require("react");
4
4
  var next = require("./index.cjs.js");
5
- var reactPage = require("./react-page.cjs.js");
5
+ var constants = require("./constants.cjs.js");
6
6
  var actions = require("./actions.cjs.js");
7
7
  var jsxRuntime = require("react/jsx-runtime");
8
8
  require("use-sync-external-store/shim/with-selector");
@@ -37,13 +37,13 @@ function LiveProvider({
37
37
  children,
38
38
  rootElements
39
39
  }) {
40
- const store = React.useMemo(() => reactPage.configureStore({
40
+ const store = React.useMemo(() => constants.configureStore({
41
41
  preloadedState: next.storeContextDefaultValue.getState(),
42
42
  rootElements
43
43
  }), [rootElements]);
44
44
  React.useEffect(() => {
45
45
  var _a;
46
- const unregisterDocuments = Array.from((_a = rootElements == null ? void 0 : rootElements.entries()) != null ? _a : []).map(([documentKey, rootElement]) => store.dispatch(actions.registerDocumentEffect(reactPage.createDocument(documentKey, rootElement))));
46
+ const unregisterDocuments = Array.from((_a = rootElements == null ? void 0 : rootElements.entries()) != null ? _a : []).map(([documentKey, rootElement]) => store.dispatch(actions.registerDocumentEffect(constants.createDocument(documentKey, rootElement))));
47
47
  return () => {
48
48
  unregisterDocuments.forEach((unregisterDocument) => {
49
49
  unregisterDocument();
@@ -1,7 +1,7 @@
1
1
  import { useMemo, useEffect } from "react";
2
- import { U as storeContextDefaultValue, V as StoreContext, W as MakeswiftProvider } from "./index.es.js";
3
- import { q as configureStore, c as createDocument } from "./react-page.es.js";
4
- import { G as registerDocumentEffect } from "./actions.es.js";
2
+ import { T as storeContextDefaultValue, U as StoreContext, V as MakeswiftProvider } from "./index.es.js";
3
+ import { q as configureStore, c as createDocument } from "./constants.es.js";
4
+ import { F as registerDocumentEffect } from "./actions.es.js";
5
5
  import { jsx } from "react/jsx-runtime";
6
6
  import "use-sync-external-store/shim/with-selector";
7
7
  import "next/dynamic";
@@ -48,7 +48,7 @@ require("./next-version.cjs.js");
48
48
  require("next/package.json");
49
49
  require("use-sync-external-store/shim/with-selector");
50
50
  require("next/dynamic");
51
- require("./react-page.cjs.js");
51
+ require("./constants.cjs.js");
52
52
  require("redux");
53
53
  require("redux-thunk");
54
54
  require("./actions.cjs.js");
@@ -47,7 +47,7 @@ import "./next-version.es.js";
47
47
  import "next/package.json";
48
48
  import "use-sync-external-store/shim/with-selector";
49
49
  import "next/dynamic";
50
- import "./react-page.es.js";
50
+ import "./constants.es.js";
51
51
  import "redux";
52
52
  import "redux-thunk";
53
53
  import "./actions.es.js";
@@ -24,7 +24,7 @@ var next = require("./index.cjs.js");
24
24
  var redux = require("redux");
25
25
  var thunk = require("redux-thunk");
26
26
  var immutable = require("immutable");
27
- var reactPage = require("./react-page.cjs.js");
27
+ var constants = require("./constants.cjs.js");
28
28
  var actions = require("./actions.cjs.js");
29
29
  var boxModels = require("./box-models.cjs.js");
30
30
  var slot = require("./slot.cjs.js");
@@ -74,24 +74,24 @@ function apply(data, operation) {
74
74
  function getInitialState({
75
75
  rootElements
76
76
  } = {}) {
77
- return reactPage.getInitialState({ rootElements });
77
+ return constants.getInitialState({ rootElements });
78
78
  }
79
79
  function getReadOnlyDocumentsStateSlice(state) {
80
80
  return state;
81
81
  }
82
82
  function getDocument(state, documentKey) {
83
- return reactPage.getDocument$1(getReadOnlyDocumentsStateSlice(state), documentKey);
83
+ return constants.getDocument$1(getReadOnlyDocumentsStateSlice(state), documentKey);
84
84
  }
85
85
  function reducer$1(state = getInitialState(), action) {
86
86
  var _a;
87
- const nextState = reactPage.reducer(state, action);
87
+ const nextState = constants.reducer(state, action);
88
88
  switch (action.type) {
89
89
  case actions.ActionTypes.CHANGE_DOCUMENT: {
90
90
  const currentRootElement = (_a = getDocument(nextState, action.payload.documentKey)) == null ? void 0 : _a.rootElement;
91
91
  if (currentRootElement == null)
92
92
  return nextState;
93
93
  const nextRootElement = apply(currentRootElement, action.payload.operation);
94
- return currentRootElement === nextRootElement ? nextState : new Map(nextState).set(action.payload.documentKey, reactPage.createDocument(action.payload.documentKey, nextRootElement));
94
+ return currentRootElement === nextRootElement ? nextState : new Map(nextState).set(action.payload.documentKey, constants.createDocument(action.payload.documentKey, nextRootElement));
95
95
  }
96
96
  default:
97
97
  return nextState;
@@ -99,12 +99,12 @@ function reducer$1(state = getInitialState(), action) {
99
99
  }
100
100
  const reducer = redux.combineReducers({
101
101
  documents: reducer$1,
102
- reactComponents: reactPage.reducer$1,
102
+ reactComponents: constants.reducer$1,
103
103
  boxModels: boxModels.reducer,
104
- componentsMeta: reactPage.reducer$2,
105
- propControllers: reactPage.reducer$3,
106
- propControllerHandles: reactPage.reducer$4,
107
- isInBuilder: reactPage.reducer$5
104
+ componentsMeta: constants.reducer$2,
105
+ propControllers: constants.reducer$3,
106
+ propControllerHandles: constants.reducer$4,
107
+ isInBuilder: constants.reducer$5
108
108
  });
109
109
  function getBoxModelsStateSlice(state) {
110
110
  return state.boxModels;
@@ -122,13 +122,13 @@ function getComponentsMetaStateSlice(state) {
122
122
  return state.componentsMeta;
123
123
  }
124
124
  function getComponentsMeta(state) {
125
- return reactPage.getComponentsMeta(getComponentsMetaStateSlice(state));
125
+ return constants.getComponentsMeta(getComponentsMetaStateSlice(state));
126
126
  }
127
127
  function getPropControllersStateSlice(state) {
128
128
  return state.propControllers;
129
129
  }
130
130
  function getComponentPropControllerDescriptors(state, componentType) {
131
- return reactPage.getComponentPropControllerDescriptors$1(getPropControllersStateSlice(state), componentType);
131
+ return constants.getComponentPropControllerDescriptors$1(getPropControllersStateSlice(state), componentType);
132
132
  }
133
133
  function getPropControllerHandlesStateSlice(state) {
134
134
  return state.propControllerHandles;
@@ -355,7 +355,7 @@ function messageChannelMiddleware() {
355
355
  }
356
356
  function createAndRegisterPropControllers(documentKey, elementKey) {
357
357
  return (dispatch, getState) => {
358
- const descriptors = reactPage.getElementPropControllerDescriptors(getState(), documentKey, elementKey);
358
+ const descriptors = constants.getElementPropControllerDescriptors(getState(), documentKey, elementKey);
359
359
  if (descriptors == null)
360
360
  return null;
361
361
  const propControllers = Object.entries(descriptors).reduce((acc, [propName, descriptor]) => {
@@ -372,9 +372,9 @@ function propControllerHandlesMiddleware() {
372
372
  switch (action.type) {
373
373
  case actions.ActionTypes.REGISTER_COMPONENT_HANDLE: {
374
374
  const { documentKey, elementKey, componentHandle } = action.payload;
375
- const element = reactPage.getElement(getState(), documentKey, elementKey);
375
+ const element = constants.getElement(getState(), documentKey, elementKey);
376
376
  const propControllers = dispatch(createAndRegisterPropControllers(documentKey, elementKey));
377
- if (element != null && !reactPage.isElementReference(element) && reactPage.isPropControllersHandle(componentHandle)) {
377
+ if (element != null && !constants.isElementReference(element) && constants.isPropControllersHandle(componentHandle)) {
378
378
  dispatch(actions.registerPropControllersHandle(documentKey, elementKey, componentHandle));
379
379
  componentHandle.setPropControllers(propControllers);
380
380
  }
@@ -382,13 +382,13 @@ function propControllerHandlesMiddleware() {
382
382
  }
383
383
  case actions.ActionTypes.UNREGISTER_COMPONENT_HANDLE: {
384
384
  const { documentKey, elementKey } = action.payload;
385
- const handle = reactPage.getPropControllersHandle(getPropControllerHandlesStateSlice(getState()), documentKey, elementKey);
385
+ const handle = constants.getPropControllersHandle(getPropControllerHandlesStateSlice(getState()), documentKey, elementKey);
386
386
  handle == null ? void 0 : handle.setPropControllers(null);
387
387
  dispatch(actions.unregisterPropControllers(documentKey, elementKey));
388
388
  break;
389
389
  }
390
390
  case actions.ActionTypes.MESSAGE_HOST_PROP_CONTROLLER: {
391
- const propController = reactPage.getPropController(getPropControllerHandlesStateSlice(getState()), action.payload.documentKey, action.payload.elementKey, action.payload.propName);
391
+ const propController = constants.getPropController(getPropControllerHandlesStateSlice(getState()), action.payload.documentKey, action.payload.elementKey, action.payload.propName);
392
392
  if (propController)
393
393
  propController.recv(action.payload.message);
394
394
  }
@@ -427,7 +427,7 @@ function PreviewProvider({
427
427
  }), [client, rootElements]);
428
428
  React.useEffect(() => {
429
429
  var _a;
430
- const unregisterDocuments = Array.from((_a = rootElements == null ? void 0 : rootElements.entries()) != null ? _a : []).map(([documentKey, rootElement]) => store.dispatch(actions.registerDocumentEffect(reactPage.createDocument(documentKey, rootElement))));
430
+ const unregisterDocuments = Array.from((_a = rootElements == null ? void 0 : rootElements.entries()) != null ? _a : []).map(([documentKey, rootElement]) => store.dispatch(actions.registerDocumentEffect(constants.createDocument(documentKey, rootElement))));
431
431
  return () => {
432
432
  unregisterDocuments.forEach((unregisterDocument) => {
433
433
  unregisterDocument();
@@ -18,12 +18,12 @@ var __spreadValues = (a, b) => {
18
18
  };
19
19
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
20
  import { useMemo, useEffect } from "react";
21
- import { T as deepEqual, U as storeContextDefaultValue, V as StoreContext, W as MakeswiftProvider } from "./index.es.js";
21
+ import { Q as deepEqual, T as storeContextDefaultValue, U as StoreContext, V as MakeswiftProvider } from "./index.es.js";
22
22
  import { createStore, applyMiddleware, combineReducers } from "redux";
23
23
  import thunk from "redux-thunk";
24
24
  import { removeIn, setIn } from "immutable";
25
- import { z as getInitialState$1, A as reducer$2, B as getDocument$1, c as createDocument, C as getComponentsMeta$1, D as getComponentPropControllerDescriptors$1, E as getPropController, F as getPropControllersHandle, G as getElement, H as getElementPropControllerDescriptors, i as isElementReference, I as isPropControllersHandle, J as reducer$3, K as reducer$5, L as reducer$6, M as reducer$7, N as reducer$8 } from "./react-page.es.js";
26
- import { A as ActionTypes, o as unregisterMeasurable, p as registerMeasurable, q as registerBuilderComponent, v as changeElementBoxModels, w as changeDocumentElementSize, x as handleWheel, y as handlePointerMove, z as setIsInBuilder, B as unregisterBuilderComponent, C as unregisterPropControllers, D as registerPropControllers, E as registerPropControllersHandle, F as messageBuilderPropController, G as registerDocumentEffect } from "./actions.es.js";
25
+ import { z as getInitialState$1, A as reducer$2, B as getDocument$1, c as createDocument, C as getComponentsMeta$1, D as getComponentPropControllerDescriptors$1, E as getPropController, F as getPropControllersHandle, G as getElement, H as getElementPropControllerDescriptors, i as isElementReference, I as isPropControllersHandle, J as reducer$3, K as reducer$5, L as reducer$6, N as reducer$7, O as reducer$8 } from "./constants.es.js";
26
+ import { A as ActionTypes, n as unregisterMeasurable, o as registerMeasurable, p as registerBuilderComponent, q as changeElementBoxModels, v as changeDocumentElementSize, w as handleWheel, x as handlePointerMove, y as setIsInBuilder, z as unregisterBuilderComponent, B as unregisterPropControllers, C as registerPropControllers, D as registerPropControllersHandle, E as messageBuilderPropController, F as registerDocumentEffect } from "./actions.es.js";
27
27
  import { i as isMeasurable, a as getMeasurables$1, b as getBoxModels$1, m as measure, d as getBoxModel$1, r as reducer$4 } from "./box-models.es.js";
28
28
  import { a5 as createPropController } from "./slot.es.js";
29
29
  import { a as serializeControls } from "./control-serialization.es.js";
package/dist/Root.cjs.js CHANGED
@@ -9,7 +9,7 @@ var index = require("./index.cjs2.js");
9
9
  var css = require("@emotion/css");
10
10
  require("use-sync-external-store/shim/with-selector");
11
11
  require("next/dynamic");
12
- require("./react-page.cjs.js");
12
+ require("./constants.cjs.js");
13
13
  require("redux");
14
14
  require("redux-thunk");
15
15
  require("./actions.cjs.js");
package/dist/Root.es.js CHANGED
@@ -8,7 +8,7 @@ import { B as BackgroundsContainer, G as GridItem } from "./index.es2.js";
8
8
  import { injectGlobal, cache } from "@emotion/css";
9
9
  import "use-sync-external-store/shim/with-selector";
10
10
  import "next/dynamic";
11
- import "./react-page.es.js";
11
+ import "./constants.es.js";
12
12
  import "redux";
13
13
  import "redux-thunk";
14
14
  import "./actions.es.js";
@@ -41,7 +41,7 @@ require("scroll-into-view-if-needed");
41
41
  require("next/link");
42
42
  require("use-sync-external-store/shim/with-selector");
43
43
  require("next/dynamic");
44
- require("./react-page.cjs.js");
44
+ require("./constants.cjs.js");
45
45
  require("redux");
46
46
  require("redux-thunk");
47
47
  require("./actions.cjs.js");
@@ -40,7 +40,7 @@ import "scroll-into-view-if-needed";
40
40
  import "next/link";
41
41
  import "use-sync-external-store/shim/with-selector";
42
42
  import "next/dynamic";
43
- import "./react-page.es.js";
43
+ import "./constants.es.js";
44
44
  import "redux";
45
45
  import "redux-thunk";
46
46
  import "./actions.es.js";
package/dist/Text.cjs.js CHANGED
@@ -39,7 +39,7 @@ var boxModels = require("./box-models.cjs.js");
39
39
  var slateReact = require("slate-react");
40
40
  var Lists = require("@convertkit/slate-lists");
41
41
  var next = require("./index.cjs.js");
42
- var reactPage = require("./react-page.cjs.js");
42
+ var constants = require("./constants.cjs.js");
43
43
  var css = require("@emotion/css");
44
44
  var jsxRuntime = require("react/jsx-runtime");
45
45
  var index = require("./index.cjs3.js");
@@ -101,11 +101,11 @@ function useTypographyMark(value) {
101
101
  var _a, _b, _c;
102
102
  const typography = next.useTypography((_a = value == null ? void 0 : value.id) != null ? _a : null);
103
103
  const swatchIds = [
104
- ...reactPage.getTypographyStyleSwatchIds(value == null ? void 0 : value.style),
105
- ...reactPage.getTypographyStyleSwatchIds(typography == null ? void 0 : typography.style)
104
+ ...constants.getTypographyStyleSwatchIds(value == null ? void 0 : value.style),
105
+ ...constants.getTypographyStyleSwatchIds(typography == null ? void 0 : typography.style)
106
106
  ];
107
107
  const swatches = next.useSwatches(swatchIds);
108
- return overrideTypographyStyle((_b = typography == null ? void 0 : typography.style.map(withColor(swatches.filter(reactPage.isNonNullable)))) != null ? _b : [], (_c = value == null ? void 0 : value.style.map(withColor(swatches.filter(reactPage.isNonNullable)))) != null ? _c : []);
108
+ return overrideTypographyStyle((_b = typography == null ? void 0 : typography.style.map(withColor(swatches.filter(constants.isNonNullable)))) != null ? _b : [], (_c = value == null ? void 0 : value.style.map(withColor(swatches.filter(constants.isNonNullable)))) != null ? _c : []);
109
109
  }
110
110
  function Mark(_a) {
111
111
  var _b = _a, {
package/dist/Text.es.js CHANGED
@@ -37,7 +37,7 @@ import { g as getBox } from "./box-models.es.js";
37
37
  import { Editor } from "slate-react";
38
38
  import Lists from "@convertkit/slate-lists";
39
39
  import { J as useTypography, K as useSwatches, G as findDeviceOverride, o as useStyle, r as responsiveStyle, L as shallowMergeFallbacks, s as colorToString, u as useIsInBuilder } from "./index.es.js";
40
- import { w as getTypographyStyleSwatchIds, l as isNonNullable } from "./react-page.es.js";
40
+ import { w as getTypographyStyleSwatchIds, l as isNonNullable } from "./constants.es.js";
41
41
  import { cx } from "@emotion/css";
42
42
  import { jsx } from "react/jsx-runtime";
43
43
  import { L as Link } from "./index.es3.js";
package/dist/Video.cjs.js CHANGED
@@ -27,7 +27,7 @@ var placeholders = require("./placeholders.cjs.js");
27
27
  var jsxRuntime = require("react/jsx-runtime");
28
28
  require("use-sync-external-store/shim/with-selector");
29
29
  require("next/dynamic");
30
- require("./react-page.cjs.js");
30
+ require("./constants.cjs.js");
31
31
  require("redux");
32
32
  require("redux-thunk");
33
33
  require("./actions.cjs.js");
@@ -66,6 +66,10 @@ const Video = React.forwardRef(function Video2({
66
66
  borderRadius
67
67
  }, ref) {
68
68
  const canPlayUrl = video && video.url != null && ReactPlayer__default["default"].canPlay(video.url);
69
+ const [shouldRenderReactPlayer, setShouldRenderReactPlayer] = React.useState(false);
70
+ React.useEffect(() => {
71
+ setShouldRenderReactPlayer(true);
72
+ }, []);
69
73
  return /* @__PURE__ */ jsxRuntime.jsx("div", {
70
74
  ref,
71
75
  id,
@@ -87,7 +91,7 @@ const Video = React.forwardRef(function Video2({
87
91
  right: 0,
88
92
  bottom: 0
89
93
  },
90
- children: canPlayUrl === true ? /* @__PURE__ */ jsxRuntime.jsx(ReactPlayer__default["default"], __spreadProps(__spreadValues({}, video), {
94
+ children: shouldRenderReactPlayer && canPlayUrl === true ? /* @__PURE__ */ jsxRuntime.jsx(ReactPlayer__default["default"], __spreadProps(__spreadValues({}, video), {
91
95
  width: "100%",
92
96
  height: "100%",
93
97
  config: {
@@ -1 +1 @@
1
- {"version":3,"file":"Video.cjs.js","sources":["../src/components/builtin/Video/Video.tsx"],"sourcesContent":["import { cx } from '@emotion/css'\nimport { forwardRef, Ref } from 'react'\nimport ReactPlayer from 'react-player'\n\nimport { ElementIDValue, VideoValue } from '../../../prop-controllers/descriptors'\nimport { useStyle } from '../../../runtimes/react/use-style'\nimport { placeholders } from '../../utils/placeholders'\n\ntype Props = {\n id?: ElementIDValue\n video?: VideoValue\n width?: string\n margin?: string\n borderRadius?: string\n}\n\nconst ASPECT_RATIO = 16 / 9\n\nconst Video = forwardRef(function Video(\n { id, video, width, margin, borderRadius }: Props,\n ref: Ref<HTMLDivElement>,\n) {\n const canPlayUrl = video && video.url != null && ReactPlayer.canPlay(video.url)\n\n return (\n <div\n ref={ref}\n id={id}\n className={cx(\n useStyle({ display: 'flex', flexDirection: 'column', overflow: 'hidden' }),\n width,\n margin,\n borderRadius,\n )}\n >\n <div style={{ position: 'relative', paddingTop: `${100 / ASPECT_RATIO}%` }}>\n <div style={{ position: 'absolute', top: 0, left: 0, right: 0, bottom: 0 }}>\n {canPlayUrl === true ? (\n <ReactPlayer\n {...video}\n width=\"100%\"\n height=\"100%\"\n config={{\n vimeo: { playerOptions: { background: video != null && !video.controls } },\n wistia: {\n options: {\n endVideoBehavior: video != null && video.loop === true ? 'loop' : 'default',\n },\n },\n }}\n />\n ) : (\n <img width=\"100%\" src={placeholders.video.src} alt=\"Video Placeholder\" />\n )}\n </div>\n </div>\n </div>\n )\n})\n\nexport default Video\n"],"names":["ASPECT_RATIO","Video","forwardRef","id","video","width","margin","borderRadius","ref","canPlayUrl","url","ReactPlayer","canPlay","cx","useStyle","display","flexDirection","overflow","position","paddingTop","top","left","right","bottom","_jsx","vimeo","playerOptions","background","controls","wistia","options","endVideoBehavior","loop","placeholders","src"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgBA,MAAMA,eAAe,KAAK;AAEpBC,MAAAA,QAAQC,MAAAA,WAAW,gBACvB;AAAA,EAAEC;AAAAA,EAAIC;AAAAA,EAAOC;AAAAA,EAAOC;AAAAA,EAAQC;AAAAA,GAC5BC,KACA;AACMC,QAAAA,aAAaL,SAASA,MAAMM,OAAO,QAAQC,qBAAAA,WAAYC,QAAQR,MAAMM,GAA1B;AAG/C,wCAAA,OAAA;AAAA,IACE;AAAA,IACA;AAAA,IACA,WAAWG,OACTC,cAAS;AAAA,MAAEC,SAAS;AAAA,MAAQC,eAAe;AAAA,MAAUC,UAAU;AAAA,IAAA,CAAvD,GACRZ,OACAC,QACAC,YAJW;AAAA,IAOb,yCAAA,OAAA;AAAA,MAAK,OAAO;AAAA,QAAEW,UAAU;AAAA,QAAYC,YAAa,GAAE,MAAMnB;AAAAA,MAAzD;AAAA,MACE,yCAAA,OAAA;AAAA,QAAK,OAAO;AAAA,UAAEkB,UAAU;AAAA,UAAYE,KAAK;AAAA,UAAGC,MAAM;AAAA,UAAGC,OAAO;AAAA,UAAGC,QAAQ;AAAA,QAAvE;AAAA,QAAA,UACGd,eAAe,OACde,2BAAAA,IAACb,qBAAAA,6CACKP;UACJ,OAAM;AAAA,UACN,QAAO;AAAA,UACP,QAAQ;AAAA,YACNqB,OAAO;AAAA,cAAEC,eAAe;AAAA,gBAAEC,YAAYvB,SAAS,QAAQ,CAACA,MAAMwB;AAAAA,cAAtC;AAAA,YADlB;AAAA,YAENC,QAAQ;AAAA,cACNC,SAAS;AAAA,gBACPC,kBAAkB3B,SAAS,QAAQA,MAAM4B,SAAS,OAAO,SAAS;AAAA,cAD3D;AAAA,YADH;AAAA,UAFF;AAAA,QAAA,EAJV,IAcAR,2BAAA,IAAA,OAAA;AAAA,UAAK,OAAM;AAAA,UAAO,KAAKS,aAAAA,aAAa7B,MAAM8B;AAAAA,UAAK,KAAI;AAAA,QAAA,CAAnD;AAAA,MAAA,CAhBJ;AAAA,IAAA,CADF;AAAA,EAAA,CAXJ;AAkCD,CAxCuB;;"}
1
+ {"version":3,"file":"Video.cjs.js","sources":["../src/components/builtin/Video/Video.tsx"],"sourcesContent":["import { cx } from '@emotion/css'\nimport { forwardRef, Ref, useEffect, useState } from 'react'\nimport ReactPlayer from 'react-player'\n\nimport { ElementIDValue, VideoValue } from '../../../prop-controllers/descriptors'\nimport { useStyle } from '../../../runtimes/react/use-style'\nimport { placeholders } from '../../utils/placeholders'\n\ntype Props = {\n id?: ElementIDValue\n video?: VideoValue\n width?: string\n margin?: string\n borderRadius?: string\n}\n\nconst ASPECT_RATIO = 16 / 9\n\nconst Video = forwardRef(function Video(\n { id, video, width, margin, borderRadius }: Props,\n ref: Ref<HTMLDivElement>,\n) {\n const canPlayUrl = video && video.url != null && ReactPlayer.canPlay(video.url)\n /**\n * @see https://github.com/cookpete/react-player/issues/1428\n */\n const [shouldRenderReactPlayer, setShouldRenderReactPlayer] = useState(false)\n\n useEffect(() => {\n setShouldRenderReactPlayer(true)\n }, [])\n\n return (\n <div\n ref={ref}\n id={id}\n className={cx(\n useStyle({ display: 'flex', flexDirection: 'column', overflow: 'hidden' }),\n width,\n margin,\n borderRadius,\n )}\n >\n <div style={{ position: 'relative', paddingTop: `${100 / ASPECT_RATIO}%` }}>\n <div style={{ position: 'absolute', top: 0, left: 0, right: 0, bottom: 0 }}>\n {shouldRenderReactPlayer && canPlayUrl === true ? (\n <ReactPlayer\n {...video}\n width=\"100%\"\n height=\"100%\"\n config={{\n vimeo: { playerOptions: { background: video != null && !video.controls } },\n wistia: {\n options: {\n endVideoBehavior: video != null && video.loop === true ? 'loop' : 'default',\n },\n },\n }}\n />\n ) : (\n <img width=\"100%\" src={placeholders.video.src} alt=\"Video Placeholder\" />\n )}\n </div>\n </div>\n </div>\n )\n})\n\nexport default Video\n"],"names":["ASPECT_RATIO","Video","forwardRef","id","video","width","margin","borderRadius","ref","canPlayUrl","url","ReactPlayer","canPlay","shouldRenderReactPlayer","setShouldRenderReactPlayer","useState","useEffect","cx","useStyle","display","flexDirection","overflow","position","paddingTop","top","left","right","bottom","vimeo","playerOptions","background","controls","wistia","options","endVideoBehavior","loop","_jsx","placeholders","src"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgBA,MAAMA,eAAe,KAAK;AAEpBC,MAAAA,QAAQC,MAAAA,WAAW,gBACvB;AAAA,EAAEC;AAAAA,EAAIC;AAAAA,EAAOC;AAAAA,EAAOC;AAAAA,EAAQC;AAAAA,GAC5BC,KACA;AACMC,QAAAA,aAAaL,SAASA,MAAMM,OAAO,QAAQC,qBAAAA,WAAYC,QAAQR,MAAMM,GAA1B;AAI3C,QAAA,CAACG,yBAAyBC,8BAA8BC,MAAAA,SAAS,KAAD;AAEtEC,QAAAA,UAAU,MAAM;AACdF,+BAA2B,IAAD;AAAA,EADnB,GAEN,CAFM,CAAA;AAKP,wCAAA,OAAA;AAAA,IACE;AAAA,IACA;AAAA,IACA,WAAWG,OACTC,cAAS;AAAA,MAAEC,SAAS;AAAA,MAAQC,eAAe;AAAA,MAAUC,UAAU;AAAA,IAAA,CAAvD,GACRhB,OACAC,QACAC,YAJW;AAAA,IAOb,yCAAA,OAAA;AAAA,MAAK,OAAO;AAAA,QAAEe,UAAU;AAAA,QAAYC,YAAa,GAAE,MAAMvB;AAAAA,MAAzD;AAAA,MACE,yCAAA,OAAA;AAAA,QAAK,OAAO;AAAA,UAAEsB,UAAU;AAAA,UAAYE,KAAK;AAAA,UAAGC,MAAM;AAAA,UAAGC,OAAO;AAAA,UAAGC,QAAQ;AAAA,QAAvE;AAAA,QACGd,UAAAA,2BAA2BJ,eAAe,sCACxCE,qBAAAA,YAAD,iCACMP,QADN;AAAA,UAEE,OAAM;AAAA,UACN,QAAO;AAAA,UACP,QAAQ;AAAA,YACNwB,OAAO;AAAA,cAAEC,eAAe;AAAA,gBAAEC,YAAY1B,SAAS,QAAQ,CAACA,MAAM2B;AAAAA,cAAtC;AAAA,YADlB;AAAA,YAENC,QAAQ;AAAA,cACNC,SAAS;AAAA,gBACPC,kBAAkB9B,SAAS,QAAQA,MAAM+B,SAAS,OAAO,SAAS;AAAA,cAD3D;AAAA,YADH;AAAA,UAFF;AAAA,QAAA,EAJV,IAcAC,2BAAA,IAAA,OAAA;AAAA,UAAK,OAAM;AAAA,UAAO,KAAKC,aAAAA,aAAajC,MAAMkC;AAAAA,UAAK,KAAI;AAAA,QAAA,CAAnD;AAAA,MAAA,CAhBJ;AAAA,IAAA,CADF;AAAA,EAAA,CAXJ;AAkCD,CAhDuB;;"}
package/dist/Video.es.js CHANGED
@@ -18,14 +18,14 @@ var __spreadValues = (a, b) => {
18
18
  };
19
19
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
20
  import { cx } from "@emotion/css";
21
- import { forwardRef } from "react";
21
+ import { forwardRef, useState, useEffect } from "react";
22
22
  import ReactPlayer from "react-player";
23
23
  import { o as useStyle } from "./index.es.js";
24
24
  import { p as placeholders } from "./placeholders.es.js";
25
25
  import { jsx } from "react/jsx-runtime";
26
26
  import "use-sync-external-store/shim/with-selector";
27
27
  import "next/dynamic";
28
- import "./react-page.es.js";
28
+ import "./constants.es.js";
29
29
  import "redux";
30
30
  import "redux-thunk";
31
31
  import "./actions.es.js";
@@ -60,6 +60,10 @@ const Video = forwardRef(function Video2({
60
60
  borderRadius
61
61
  }, ref) {
62
62
  const canPlayUrl = video && video.url != null && ReactPlayer.canPlay(video.url);
63
+ const [shouldRenderReactPlayer, setShouldRenderReactPlayer] = useState(false);
64
+ useEffect(() => {
65
+ setShouldRenderReactPlayer(true);
66
+ }, []);
63
67
  return /* @__PURE__ */ jsx("div", {
64
68
  ref,
65
69
  id,
@@ -81,7 +85,7 @@ const Video = forwardRef(function Video2({
81
85
  right: 0,
82
86
  bottom: 0
83
87
  },
84
- children: canPlayUrl === true ? /* @__PURE__ */ jsx(ReactPlayer, __spreadProps(__spreadValues({}, video), {
88
+ children: shouldRenderReactPlayer && canPlayUrl === true ? /* @__PURE__ */ jsx(ReactPlayer, __spreadProps(__spreadValues({}, video), {
85
89
  width: "100%",
86
90
  height: "100%",
87
91
  config: {
@@ -1 +1 @@
1
- {"version":3,"file":"Video.es.js","sources":["../src/components/builtin/Video/Video.tsx"],"sourcesContent":["import { cx } from '@emotion/css'\nimport { forwardRef, Ref } from 'react'\nimport ReactPlayer from 'react-player'\n\nimport { ElementIDValue, VideoValue } from '../../../prop-controllers/descriptors'\nimport { useStyle } from '../../../runtimes/react/use-style'\nimport { placeholders } from '../../utils/placeholders'\n\ntype Props = {\n id?: ElementIDValue\n video?: VideoValue\n width?: string\n margin?: string\n borderRadius?: string\n}\n\nconst ASPECT_RATIO = 16 / 9\n\nconst Video = forwardRef(function Video(\n { id, video, width, margin, borderRadius }: Props,\n ref: Ref<HTMLDivElement>,\n) {\n const canPlayUrl = video && video.url != null && ReactPlayer.canPlay(video.url)\n\n return (\n <div\n ref={ref}\n id={id}\n className={cx(\n useStyle({ display: 'flex', flexDirection: 'column', overflow: 'hidden' }),\n width,\n margin,\n borderRadius,\n )}\n >\n <div style={{ position: 'relative', paddingTop: `${100 / ASPECT_RATIO}%` }}>\n <div style={{ position: 'absolute', top: 0, left: 0, right: 0, bottom: 0 }}>\n {canPlayUrl === true ? (\n <ReactPlayer\n {...video}\n width=\"100%\"\n height=\"100%\"\n config={{\n vimeo: { playerOptions: { background: video != null && !video.controls } },\n wistia: {\n options: {\n endVideoBehavior: video != null && video.loop === true ? 'loop' : 'default',\n },\n },\n }}\n />\n ) : (\n <img width=\"100%\" src={placeholders.video.src} alt=\"Video Placeholder\" />\n )}\n </div>\n </div>\n </div>\n )\n})\n\nexport default Video\n"],"names":["ASPECT_RATIO","Video","forwardRef","id","video","width","margin","borderRadius","ref","canPlayUrl","url","ReactPlayer","canPlay","cx","useStyle","display","flexDirection","overflow","position","paddingTop","top","left","right","bottom","_jsx","vimeo","playerOptions","background","controls","wistia","options","endVideoBehavior","loop","placeholders","src"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgBA,MAAMA,eAAe,KAAK;AAEpBC,MAAAA,QAAQC,WAAW,gBACvB;AAAA,EAAEC;AAAAA,EAAIC;AAAAA,EAAOC;AAAAA,EAAOC;AAAAA,EAAQC;AAAAA,GAC5BC,KACA;AACMC,QAAAA,aAAaL,SAASA,MAAMM,OAAO,QAAQC,YAAYC,QAAQR,MAAMM,GAA1B;AAG/C,6BAAA,OAAA;AAAA,IACE;AAAA,IACA;AAAA,IACA,WAAWG,GACTC,SAAS;AAAA,MAAEC,SAAS;AAAA,MAAQC,eAAe;AAAA,MAAUC,UAAU;AAAA,IAAA,CAAvD,GACRZ,OACAC,QACAC,YAJW;AAAA,IAOb,8BAAA,OAAA;AAAA,MAAK,OAAO;AAAA,QAAEW,UAAU;AAAA,QAAYC,YAAa,GAAE,MAAMnB;AAAAA,MAAzD;AAAA,MACE,8BAAA,OAAA;AAAA,QAAK,OAAO;AAAA,UAAEkB,UAAU;AAAA,UAAYE,KAAK;AAAA,UAAGC,MAAM;AAAA,UAAGC,OAAO;AAAA,UAAGC,QAAQ;AAAA,QAAvE;AAAA,QAAA,UACGd,eAAe,OACde,oBAAC,8CACKpB;UACJ,OAAM;AAAA,UACN,QAAO;AAAA,UACP,QAAQ;AAAA,YACNqB,OAAO;AAAA,cAAEC,eAAe;AAAA,gBAAEC,YAAYvB,SAAS,QAAQ,CAACA,MAAMwB;AAAAA,cAAtC;AAAA,YADlB;AAAA,YAENC,QAAQ;AAAA,cACNC,SAAS;AAAA,gBACPC,kBAAkB3B,SAAS,QAAQA,MAAM4B,SAAS,OAAO,SAAS;AAAA,cAD3D;AAAA,YADH;AAAA,UAFF;AAAA,QAAA,EAJV,IAcAR,oBAAA,OAAA;AAAA,UAAK,OAAM;AAAA,UAAO,KAAKS,aAAa7B,MAAM8B;AAAAA,UAAK,KAAI;AAAA,QAAA,CAAnD;AAAA,MAAA,CAhBJ;AAAA,IAAA,CADF;AAAA,EAAA,CAXJ;AAkCD,CAxCuB;;"}
1
+ {"version":3,"file":"Video.es.js","sources":["../src/components/builtin/Video/Video.tsx"],"sourcesContent":["import { cx } from '@emotion/css'\nimport { forwardRef, Ref, useEffect, useState } from 'react'\nimport ReactPlayer from 'react-player'\n\nimport { ElementIDValue, VideoValue } from '../../../prop-controllers/descriptors'\nimport { useStyle } from '../../../runtimes/react/use-style'\nimport { placeholders } from '../../utils/placeholders'\n\ntype Props = {\n id?: ElementIDValue\n video?: VideoValue\n width?: string\n margin?: string\n borderRadius?: string\n}\n\nconst ASPECT_RATIO = 16 / 9\n\nconst Video = forwardRef(function Video(\n { id, video, width, margin, borderRadius }: Props,\n ref: Ref<HTMLDivElement>,\n) {\n const canPlayUrl = video && video.url != null && ReactPlayer.canPlay(video.url)\n /**\n * @see https://github.com/cookpete/react-player/issues/1428\n */\n const [shouldRenderReactPlayer, setShouldRenderReactPlayer] = useState(false)\n\n useEffect(() => {\n setShouldRenderReactPlayer(true)\n }, [])\n\n return (\n <div\n ref={ref}\n id={id}\n className={cx(\n useStyle({ display: 'flex', flexDirection: 'column', overflow: 'hidden' }),\n width,\n margin,\n borderRadius,\n )}\n >\n <div style={{ position: 'relative', paddingTop: `${100 / ASPECT_RATIO}%` }}>\n <div style={{ position: 'absolute', top: 0, left: 0, right: 0, bottom: 0 }}>\n {shouldRenderReactPlayer && canPlayUrl === true ? (\n <ReactPlayer\n {...video}\n width=\"100%\"\n height=\"100%\"\n config={{\n vimeo: { playerOptions: { background: video != null && !video.controls } },\n wistia: {\n options: {\n endVideoBehavior: video != null && video.loop === true ? 'loop' : 'default',\n },\n },\n }}\n />\n ) : (\n <img width=\"100%\" src={placeholders.video.src} alt=\"Video Placeholder\" />\n )}\n </div>\n </div>\n </div>\n )\n})\n\nexport default Video\n"],"names":["ASPECT_RATIO","Video","forwardRef","id","video","width","margin","borderRadius","ref","canPlayUrl","url","ReactPlayer","canPlay","shouldRenderReactPlayer","setShouldRenderReactPlayer","useState","useEffect","cx","useStyle","display","flexDirection","overflow","position","paddingTop","top","left","right","bottom","vimeo","playerOptions","background","controls","wistia","options","endVideoBehavior","loop","_jsx","placeholders","src"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgBA,MAAMA,eAAe,KAAK;AAEpBC,MAAAA,QAAQC,WAAW,gBACvB;AAAA,EAAEC;AAAAA,EAAIC;AAAAA,EAAOC;AAAAA,EAAOC;AAAAA,EAAQC;AAAAA,GAC5BC,KACA;AACMC,QAAAA,aAAaL,SAASA,MAAMM,OAAO,QAAQC,YAAYC,QAAQR,MAAMM,GAA1B;AAI3C,QAAA,CAACG,yBAAyBC,8BAA8BC,SAAS,KAAD;AAEtEC,YAAU,MAAM;AACdF,+BAA2B,IAAD;AAAA,EADnB,GAEN,CAFM,CAAA;AAKP,6BAAA,OAAA;AAAA,IACE;AAAA,IACA;AAAA,IACA,WAAWG,GACTC,SAAS;AAAA,MAAEC,SAAS;AAAA,MAAQC,eAAe;AAAA,MAAUC,UAAU;AAAA,IAAA,CAAvD,GACRhB,OACAC,QACAC,YAJW;AAAA,IAOb,8BAAA,OAAA;AAAA,MAAK,OAAO;AAAA,QAAEe,UAAU;AAAA,QAAYC,YAAa,GAAE,MAAMvB;AAAAA,MAAzD;AAAA,MACE,8BAAA,OAAA;AAAA,QAAK,OAAO;AAAA,UAAEsB,UAAU;AAAA,UAAYE,KAAK;AAAA,UAAGC,MAAM;AAAA,UAAGC,OAAO;AAAA,UAAGC,QAAQ;AAAA,QAAvE;AAAA,QACGd,UAAAA,2BAA2BJ,eAAe,2BACxC,aAAD,iCACML,QADN;AAAA,UAEE,OAAM;AAAA,UACN,QAAO;AAAA,UACP,QAAQ;AAAA,YACNwB,OAAO;AAAA,cAAEC,eAAe;AAAA,gBAAEC,YAAY1B,SAAS,QAAQ,CAACA,MAAM2B;AAAAA,cAAtC;AAAA,YADlB;AAAA,YAENC,QAAQ;AAAA,cACNC,SAAS;AAAA,gBACPC,kBAAkB9B,SAAS,QAAQA,MAAM+B,SAAS,OAAO,SAAS;AAAA,cAD3D;AAAA,YADH;AAAA,UAFF;AAAA,QAAA,EAJV,IAcAC,oBAAA,OAAA;AAAA,UAAK,OAAM;AAAA,UAAO,KAAKC,aAAajC,MAAMkC;AAAAA,UAAK,KAAI;AAAA,QAAA,CAAnD;AAAA,MAAA,CAhBJ;AAAA,IAAA,CADF;AAAA,EAAA,CAXJ;AAkCD,CAhDuB;;"}
@@ -34,8 +34,7 @@ const ActionTypes = {
34
34
  HANDLE_POINTER_MOVE: "HANDLE_POINTER_MOVE",
35
35
  API_RESOURCE_FULFILLED: "API_RESOURCE_FULFILLED",
36
36
  INTROSPECTED_RESOURCES_FULFILLED: "INTROSPECTED_RESOURCES_FULFILLED",
37
- TYPOGRAPHIES_FULFILLED: "TYPOGRAPHIES_FULFILLED",
38
- RESTORE_API_RESOURCES_CACHE: "RESTORE_API_RESOURCES_CACHE"
37
+ TYPOGRAPHIES_FULFILLED: "TYPOGRAPHIES_FULFILLED"
39
38
  };
40
39
  function init() {
41
40
  return { type: ActionTypes.INIT };
@@ -206,9 +205,6 @@ function introspectedResourcesFulfilled(introspectedResourceIds, introspectedRes
206
205
  payload: { introspectedResourceIds, introspectedResources }
207
206
  };
208
207
  }
209
- function restoreAPIResourcesCache(serializedState) {
210
- return { type: ActionTypes.RESTORE_API_RESOURCES_CACHE, payload: { serializedState } };
211
- }
212
208
  exports.ActionTypes = ActionTypes;
213
209
  exports.apiResourceFulfilled = apiResourceFulfilled;
214
210
  exports.changeApiResource = changeApiResource;
@@ -234,7 +230,6 @@ exports.registerMeasurable = registerMeasurable;
234
230
  exports.registerPropControllers = registerPropControllers;
235
231
  exports.registerPropControllersHandle = registerPropControllersHandle;
236
232
  exports.registerReactComponentEffect = registerReactComponentEffect;
237
- exports.restoreAPIResourcesCache = restoreAPIResourcesCache;
238
233
  exports.scrollDocumentElement = scrollDocumentElement;
239
234
  exports.setIsInBuilder = setIsInBuilder;
240
235
  exports.typographiesFulfilled = typographiesFulfilled;