@makeswift/runtime 0.5.3 → 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.
- package/dist/Box.cjs.js +1 -1
- package/dist/Box.es.js +1 -1
- package/dist/Button.cjs.js +1 -1
- package/dist/Button.es.js +1 -1
- package/dist/Carousel.cjs.js +1 -1
- package/dist/Carousel.es.js +1 -1
- package/dist/Countdown.cjs.js +1 -1
- package/dist/Countdown.es.js +1 -1
- package/dist/Divider.cjs.js +1 -1
- package/dist/Divider.es.js +1 -1
- package/dist/Embed.cjs.js +1 -1
- package/dist/Embed.es.js +1 -1
- package/dist/Form.cjs.js +1 -1
- package/dist/Form.es.js +1 -1
- package/dist/Image.cjs.js +1 -1
- package/dist/Image.es.js +1 -1
- package/dist/LiveProvider.cjs.js +3 -3
- package/dist/LiveProvider.es.js +2 -2
- package/dist/Navigation.cjs.js +1 -1
- package/dist/Navigation.es.js +1 -1
- package/dist/PreviewProvider.cjs.js +18 -18
- package/dist/PreviewProvider.es.js +2 -2
- package/dist/Root.cjs.js +1 -1
- package/dist/Root.es.js +1 -1
- package/dist/SocialLinks.cjs.js +1 -1
- package/dist/SocialLinks.es.js +1 -1
- package/dist/Text.cjs.js +4 -4
- package/dist/Text.es.js +1 -1
- package/dist/Video.cjs.js +1 -1
- package/dist/Video.es.js +1 -1
- package/dist/components.cjs.js +1 -2
- package/dist/components.cjs.js.map +1 -1
- package/dist/components.es.js +2 -2
- package/dist/{react-page.cjs.js → constants.cjs.js} +17 -1
- package/dist/constants.cjs.js.map +1 -0
- package/dist/{react-page.es.js → constants.es.js} +17 -2
- package/dist/constants.es.js.map +1 -0
- package/dist/index.cjs.js +40 -56
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.cjs2.js +6 -6
- package/dist/index.es.js +4 -19
- package/dist/index.es.js.map +1 -1
- package/dist/index.es2.js +2 -2
- package/dist/index.es3.js +1 -1
- package/dist/main.cjs.js +3 -2
- package/dist/main.cjs.js.map +1 -1
- package/dist/main.es.js +1 -1
- package/dist/next.cjs.js +1 -1
- package/dist/next.es.js +2 -2
- package/dist/react.cjs.js +1 -1
- package/dist/react.es.js +1 -1
- package/dist/types/src/components/builtin/index.d.ts +0 -1
- package/dist/types/src/components/builtin/index.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +1 -0
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/next/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/react-page.cjs.js.map +0 -1
- package/dist/react-page.es.js.map +0 -1
package/dist/index.cjs2.js
CHANGED
|
@@ -36,7 +36,7 @@ require("use-sync-external-store/shim");
|
|
|
36
36
|
require("./slot.cjs.js");
|
|
37
37
|
var css = require("@emotion/css");
|
|
38
38
|
var jsxRuntime = require("react/jsx-runtime");
|
|
39
|
-
var
|
|
39
|
+
var constants = require("./constants.cjs.js");
|
|
40
40
|
var NextImage = require("next/image");
|
|
41
41
|
var useIsomorphicLayoutEffect = require("./useIsomorphicLayoutEffect.cjs.js");
|
|
42
42
|
var ReactPlayer = require("react-player");
|
|
@@ -47,9 +47,9 @@ function _interopDefaultLegacy(e) {
|
|
|
47
47
|
var NextImage__default = /* @__PURE__ */ _interopDefaultLegacy(NextImage);
|
|
48
48
|
var ReactPlayer__default = /* @__PURE__ */ _interopDefaultLegacy(ReactPlayer);
|
|
49
49
|
function useBackgrounds(value) {
|
|
50
|
-
const fileIds =
|
|
50
|
+
const fileIds = constants.getBackgroundsFileIds(value);
|
|
51
51
|
const files = next.useFiles(fileIds);
|
|
52
|
-
const swatchIds =
|
|
52
|
+
const swatchIds = constants.getBackgroundsSwatchIds(value);
|
|
53
53
|
const swatches = next.useSwatches(swatchIds);
|
|
54
54
|
return React.useMemo(() => {
|
|
55
55
|
if (value == null)
|
|
@@ -72,7 +72,7 @@ function useBackgrounds(value) {
|
|
|
72
72
|
}
|
|
73
73
|
if (bg.type === "color" && bg.payload != null) {
|
|
74
74
|
const { swatchId, alpha } = bg.payload;
|
|
75
|
-
const swatch = swatches.filter(
|
|
75
|
+
const swatch = swatches.filter(constants.isNonNullable).find((s) => s && s.id === swatchId);
|
|
76
76
|
return { id: bg.id, type: "color", payload: { swatch, alpha } };
|
|
77
77
|
}
|
|
78
78
|
if (bg.type === "gradient" && bg.payload != null && bg.payload.stops.length > 0) {
|
|
@@ -86,7 +86,7 @@ function useBackgrounds(value) {
|
|
|
86
86
|
var _c = _b2, { color } = _c, restOfStop = __objRest(_c, ["color"]);
|
|
87
87
|
return __spreadProps(__spreadValues({}, restOfStop), {
|
|
88
88
|
color: color && {
|
|
89
|
-
swatch: swatches.filter(
|
|
89
|
+
swatch: swatches.filter(constants.isNonNullable).find((s) => s && s.id === color.swatchId),
|
|
90
90
|
alpha: color.alpha
|
|
91
91
|
}
|
|
92
92
|
});
|
|
@@ -106,7 +106,7 @@ function useBackgrounds(value) {
|
|
|
106
106
|
};
|
|
107
107
|
}
|
|
108
108
|
return null;
|
|
109
|
-
}).filter(
|
|
109
|
+
}).filter(constants.isNonNullable)
|
|
110
110
|
});
|
|
111
111
|
});
|
|
112
112
|
}, [files, swatches, value]);
|
package/dist/index.es.js
CHANGED
|
@@ -39,7 +39,7 @@ import * as React from "react";
|
|
|
39
39
|
import { useEffect, createContext, useContext, useState, useMemo, useRef, Children, createElement, forwardRef, memo, useCallback, Component, useImperativeHandle, Suspense } from "react";
|
|
40
40
|
import { useSyncExternalStoreWithSelector } from "use-sync-external-store/shim/with-selector";
|
|
41
41
|
import dynamic from "next/dynamic";
|
|
42
|
-
import { g as getPropControllerDescriptors, i as isElementReference, a as getElementSwatchIds, b as getFileIds, d as getTypographyIds, e as getTableIds, f as getPageIds, h as getElementChildren, j as createDocumentReference, k as getBorderSwatchIds, l as isNonNullable, m as getBoxShadowsSwatchIds, n as getResponsiveColorSwatchIds, o as getComponentPropControllerDescriptors, p as getPropControllers, q as configureStore$1, r as getDocument, s as getElementId, t as getIsInBuilder, u as copyElementTree, v as getReactComponent } from "./
|
|
42
|
+
import { g as getPropControllerDescriptors, i as isElementReference, a as getElementSwatchIds, b as getFileIds, d as getTypographyIds, e as getTableIds, f as getPageIds, h as getElementChildren, j as createDocumentReference, M as MakeswiftComponentType, k as getBorderSwatchIds, l as isNonNullable, m as getBoxShadowsSwatchIds, n as getResponsiveColorSwatchIds, o as getComponentPropControllerDescriptors, p as getPropControllers, q as configureStore$1, r as getDocument, s as getElementId, t as getIsInBuilder, u as copyElementTree, v as getReactComponent } from "./constants.es.js";
|
|
43
43
|
import { A as ActionTypes, f as introspectedResourcesFulfilled, g as apiResourceFulfilled, t as typographiesFulfilled, h as registerComponentHandleEffect, j as mountComponentEffect, k as registerComponentEffect, l as registerReactComponentEffect } from "./actions.es.js";
|
|
44
44
|
import { cache, cx } from "@emotion/css";
|
|
45
45
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
@@ -1049,7 +1049,7 @@ class Document$1 extends NextDocument {
|
|
|
1049
1049
|
});
|
|
1050
1050
|
}
|
|
1051
1051
|
}
|
|
1052
|
-
const version = "0.5.
|
|
1052
|
+
const version = "0.5.4";
|
|
1053
1053
|
function isErrorWithMessage(error) {
|
|
1054
1054
|
return typeof error === "object" && error !== null && "message" in error && typeof error.message === "string";
|
|
1055
1055
|
}
|
|
@@ -1293,7 +1293,7 @@ const Page = memo(({
|
|
|
1293
1293
|
preview: snapshot.preview,
|
|
1294
1294
|
children: /* @__PURE__ */ jsx(Page$1, {
|
|
1295
1295
|
document: snapshot.document
|
|
1296
|
-
})
|
|
1296
|
+
}, snapshot.document.data.key)
|
|
1297
1297
|
});
|
|
1298
1298
|
});
|
|
1299
1299
|
const keys = (o) => Object.keys(o);
|
|
@@ -1359,21 +1359,6 @@ const getDeviceMediaQuery = (device) => {
|
|
|
1359
1359
|
}
|
|
1360
1360
|
return parts.join(" and ");
|
|
1361
1361
|
};
|
|
1362
|
-
const MakeswiftComponentType = {
|
|
1363
|
-
Box: "./components/Box/index.js",
|
|
1364
|
-
Button: "./components/Button/index.js",
|
|
1365
|
-
Carousel: "./components/Carousel/index.js",
|
|
1366
|
-
Countdown: "./components/Countdown/index.js",
|
|
1367
|
-
Divider: "./components/Divider/index.js",
|
|
1368
|
-
Embed: "./components/Embed/index.js",
|
|
1369
|
-
Form: "./components/Form/index.js",
|
|
1370
|
-
Image: "./components/Image/index.js",
|
|
1371
|
-
Navigation: "./components/Navigation/index.js",
|
|
1372
|
-
Root: "./components/Root/index.js",
|
|
1373
|
-
SocialLinks: "./components/SocialLinks/index.js",
|
|
1374
|
-
Text: "./components/Text/index.js",
|
|
1375
|
-
Video: "./components/Video/index.js"
|
|
1376
|
-
};
|
|
1377
1362
|
const DEFAULT_BOX_ANIMATE_TYPE = "none";
|
|
1378
1363
|
const DEFAULT_BOX_ANIMATE_DELAY = 0;
|
|
1379
1364
|
const DEFAULT_BOX_ANIMATE_DURATION = 0.75;
|
|
@@ -3925,5 +3910,5 @@ const DocumentReference = memo(forwardRef(function DocumentReference2({
|
|
|
3925
3910
|
document: document2
|
|
3926
3911
|
});
|
|
3927
3912
|
}));
|
|
3928
|
-
export {
|
|
3913
|
+
export { Makeswift as $, Alignments as A, useFile as B, Contrasts as C, DocumentReference as D, Element as E, DEVICES as F, findDeviceOverride as G, serializeStyles as H, insertStyles as I, useTypography as J, useSwatches as K, shallowMergeFallbacks as L, useFiles as M, usePagePathnameSlice as N, useElementId as O, PageProvider as P, deepEqual as Q, RuntimeProvider as R, Shapes as S, storeContextDefaultValue as T, StoreContext as U, MakeswiftProvider as V, MakeswiftClient as W, getStaticPaths as X, getStaticProps as Y, getServerSideProps as Z, Page as _, ReactRuntime as a, PreviewModeScript as a0, Document$1 as a1, MakeswiftApiHandler as a2, forwardNextDynamicRef as a3, usePageId as b, DEFAULT_BOX_ANIMATE_TYPE as c, DEFAULT_BOX_ANIMATE_DELAY as d, DEFAULT_BOX_ANIMATE_DURATION as e, DEFAULT_ITEM_ANIMATE_TYPE as f, DEFAULT_ITEM_ANIMATE_DELAY as g, DEFAULT_ITEM_ANIMATE_DURATION as h, DEFAULT_ITEM_STAGGER_DURATION as i, useBorder as j, useBoxShadow as k, useResponsiveColor as l, useMediaQuery as m, Page$1 as n, useStyle as o, responsiveWidth as p, responsiveTextStyle as q, responsiveStyle as r, colorToString as s, Sizes as t, useIsInBuilder as u, useFormContext as v, responsiveGridItem as w, useTable as x, useMakeswiftClient as y, Provider as z };
|
|
3929
3914
|
//# sourceMappingURL=index.es.js.map
|