@makeswift/runtime 0.9.0 → 0.9.2
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 +15 -15
- package/dist/Box.cjs.js.map +1 -1
- package/dist/Box.es.js +10 -10
- package/dist/Button.cjs.js +12 -12
- package/dist/Button.cjs.js.map +1 -1
- package/dist/Button.es.js +10 -10
- package/dist/Carousel.cjs.js +28 -28
- package/dist/Carousel.cjs.js.map +1 -1
- package/dist/Carousel.es.js +7 -7
- package/dist/Countdown.cjs.js +15 -15
- package/dist/Countdown.cjs.js.map +1 -1
- package/dist/Countdown.es.js +7 -7
- package/dist/Divider.cjs.js +12 -12
- package/dist/Divider.cjs.js.map +1 -1
- package/dist/Divider.es.js +10 -10
- package/dist/Embed.cjs.js +3 -30
- package/dist/Embed.cjs.js.map +1 -1
- package/dist/Embed.es.js +2 -29
- package/dist/Embed.es.js.map +1 -1
- package/dist/Form.cjs.js +51 -51
- package/dist/Form.cjs.js.map +1 -1
- package/dist/Form.es.js +7 -7
- package/dist/Image.cjs.js +8 -8
- package/dist/Image.cjs.js.map +1 -1
- package/dist/Image.es.js +7 -7
- package/dist/LiveProvider.cjs.js +6 -6
- package/dist/LiveProvider.es.js +8 -8
- package/dist/Navigation.cjs.js +27 -27
- package/dist/Navigation.cjs.js.map +1 -1
- package/dist/Navigation.es.js +6 -6
- package/dist/PreviewProvider.cjs.js +7 -7
- package/dist/PreviewProvider.cjs.js.map +1 -1
- package/dist/PreviewProvider.es.js +7 -7
- package/dist/ReadOnlyText.cjs.js +16 -13
- package/dist/ReadOnlyText.cjs.js.map +1 -1
- package/dist/ReadOnlyText.es.js +11 -8
- package/dist/ReadOnlyText.es.js.map +1 -1
- package/dist/ReadOnlyTextV2.cjs.js +13 -10
- package/dist/ReadOnlyTextV2.cjs.js.map +1 -1
- package/dist/ReadOnlyTextV2.es.js +9 -6
- package/dist/ReadOnlyTextV2.es.js.map +1 -1
- package/dist/Root.cjs.js +8 -8
- package/dist/Root.cjs.js.map +1 -1
- package/dist/Root.es.js +6 -6
- package/dist/SocialLinks.cjs.js +14 -14
- package/dist/SocialLinks.cjs.js.map +1 -1
- package/dist/SocialLinks.es.js +10 -10
- package/dist/Text.cjs.js +4 -4
- package/dist/Text.es.js +5 -5
- package/dist/Video.cjs.js +3 -30
- package/dist/Video.cjs.js.map +1 -1
- package/dist/Video.es.js +2 -29
- package/dist/Video.es.js.map +1 -1
- package/dist/builder.cjs.js +4 -2
- package/dist/builder.cjs.js.map +1 -1
- package/dist/builder.es.js +4 -2
- package/dist/builder.es.js.map +1 -1
- package/dist/components.cjs.js +9 -9
- package/dist/components.es.js +9 -9
- package/dist/control-serialization.cjs.js +88 -12
- package/dist/control-serialization.cjs.js.map +1 -1
- package/dist/control-serialization.es.js +89 -13
- package/dist/control-serialization.es.js.map +1 -1
- package/dist/controls.cjs.js +15 -4
- package/dist/controls.cjs.js.map +1 -1
- package/dist/controls.es.js +6 -3
- package/dist/controls.es.js.map +1 -1
- package/dist/deepEqual.cjs.js +40 -0
- package/dist/deepEqual.cjs.js.map +1 -0
- package/dist/deepEqual.es.js +39 -0
- package/dist/deepEqual.es.js.map +1 -0
- package/dist/index.cjs.js +102 -98
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.cjs10.js +173 -249
- package/dist/index.cjs10.js.map +1 -1
- package/dist/index.cjs11.js +375 -0
- package/dist/index.cjs11.js.map +1 -0
- package/dist/index.cjs2.js +14 -16
- package/dist/index.cjs2.js.map +1 -1
- package/dist/index.cjs4.js +2 -1
- package/dist/index.cjs4.js.map +1 -1
- package/dist/index.cjs6.js +700 -22
- package/dist/index.cjs6.js.map +1 -1
- package/dist/index.cjs7.js +37 -13
- package/dist/index.cjs7.js.map +1 -1
- package/dist/index.cjs8.js +17 -41
- package/dist/index.cjs8.js.map +1 -1
- package/dist/index.cjs9.js +13 -266
- package/dist/index.cjs9.js.map +1 -1
- package/dist/index.es.js +85 -80
- package/dist/index.es.js.map +1 -1
- package/dist/index.es10.js +174 -250
- package/dist/index.es10.js.map +1 -1
- package/dist/index.es11.js +368 -0
- package/dist/index.es11.js.map +1 -0
- package/dist/index.es2.js +3 -5
- package/dist/index.es2.js.map +1 -1
- package/dist/index.es3.js +1 -1
- package/dist/index.es4.js +2 -1
- package/dist/index.es4.js.map +1 -1
- package/dist/index.es6.js +695 -22
- package/dist/index.es6.js.map +1 -1
- package/dist/index.es7.js +33 -14
- package/dist/index.es7.js.map +1 -1
- package/dist/index.es8.js +17 -39
- package/dist/index.es8.js.map +1 -1
- package/dist/index.es9.js +12 -261
- package/dist/index.es9.js.map +1 -1
- package/dist/leaf.cjs.js +1 -1
- package/dist/leaf.cjs.js.map +1 -1
- package/dist/leaf.es.js +2 -2
- package/dist/main.cjs.js +4 -2
- package/dist/main.cjs.js.map +1 -1
- package/dist/main.es.js +4 -2
- package/dist/main.es.js.map +1 -1
- package/dist/next.cjs.js +3 -3
- package/dist/next.es.js +4 -4
- package/dist/prop-controllers.cjs.js +4 -2
- package/dist/prop-controllers.cjs.js.map +1 -1
- package/dist/prop-controllers.es.js +4 -2
- package/dist/prop-controllers.es.js.map +1 -1
- package/dist/react-page.cjs.js +958 -1431
- package/dist/react-page.cjs.js.map +1 -1
- package/dist/react-page.es.js +852 -1343
- package/dist/react-page.es.js.map +1 -1
- package/dist/react.cjs.js +3 -3
- package/dist/react.es.js +3 -3
- package/dist/select.cjs.js +21 -0
- package/dist/select.cjs.js.map +1 -0
- package/dist/select.es.js +16 -0
- package/dist/select.es.js.map +1 -0
- package/dist/slate.cjs.js +213 -12
- package/dist/slate.cjs.js.map +1 -1
- package/dist/slate.es.js +207 -6
- package/dist/slate.es.js.map +1 -1
- package/dist/types/src/api/react.d.ts.map +1 -1
- package/dist/types/src/builder/serialization/control-serialization.d.ts +3 -3
- package/dist/types/src/builder/serialization/control-serialization.d.ts.map +1 -1
- package/dist/types/src/builder/serialization/controls/rich-text-v2.d.ts +2 -2
- package/dist/types/src/builder/serialization/controls/rich-text-v2.d.ts.map +1 -1
- package/dist/types/src/builder/serialization/controls/style-v2.d.ts +5 -0
- package/dist/types/src/builder/serialization/controls/style-v2.d.ts.map +1 -0
- package/dist/types/src/components/builtin/Button/Button.d.ts +1 -1
- package/dist/types/src/components/builtin/Form/components/Field/components/Checkbox/index.d.ts +1 -1
- package/dist/types/src/components/hooks/useIsomorphicLayoutEffect.d.ts +2 -2
- package/dist/types/src/components/hooks/useIsomorphicLayoutEffect.d.ts.map +1 -1
- package/dist/types/src/components/page/Page.d.ts.map +1 -1
- package/dist/types/src/controls/control.d.ts +4 -2
- package/dist/types/src/controls/control.d.ts.map +1 -1
- package/dist/types/src/controls/icon-radio-group.d.ts +29 -0
- package/dist/types/src/controls/icon-radio-group.d.ts.map +1 -0
- package/dist/types/src/controls/index.d.ts +2 -0
- package/dist/types/src/controls/index.d.ts.map +1 -1
- package/dist/types/src/controls/rich-text/translation.d.ts +1 -1
- package/dist/types/src/controls/rich-text/translation.d.ts.map +1 -1
- package/dist/types/src/controls/rich-text-v2/rich-text-v2.d.ts +12 -3
- package/dist/types/src/controls/rich-text-v2/rich-text-v2.d.ts.map +1 -1
- package/dist/types/src/controls/shape.d.ts +1 -2
- package/dist/types/src/controls/shape.d.ts.map +1 -1
- package/dist/types/src/controls/style-v2.d.ts +64 -0
- package/dist/types/src/controls/style-v2.d.ts.map +1 -0
- package/dist/types/src/next/client.d.ts.map +1 -1
- package/dist/types/src/next/document.d.ts.map +1 -1
- package/dist/types/src/prop-controllers/descriptors.d.ts +6 -3
- package/dist/types/src/prop-controllers/descriptors.d.ts.map +1 -1
- package/dist/types/src/prop-controllers/instances.d.ts +2 -2
- package/dist/types/src/prop-controllers/instances.d.ts.map +1 -1
- package/dist/types/src/prop-controllers/introspection.d.ts.map +1 -1
- package/dist/types/src/runtimes/react/controls/control.d.ts +5 -2
- package/dist/types/src/runtimes/react/controls/control.d.ts.map +1 -1
- package/dist/types/src/runtimes/react/controls/icon-radio-group.d.ts +4 -0
- package/dist/types/src/runtimes/react/controls/icon-radio-group.d.ts.map +1 -0
- package/dist/types/src/runtimes/react/controls/rich-text-v2/EditableTextV2/editable-text-v2.d.ts +2 -1
- package/dist/types/src/runtimes/react/controls/rich-text-v2/EditableTextV2/editable-text-v2.d.ts.map +1 -1
- package/dist/types/src/runtimes/react/controls/rich-text-v2/EditableTextV2/render-element.d.ts +10 -0
- package/dist/types/src/runtimes/react/controls/rich-text-v2/EditableTextV2/render-element.d.ts.map +1 -0
- package/dist/types/src/runtimes/react/controls/rich-text-v2/EditableTextV2/render-leaf.d.ts +10 -0
- package/dist/types/src/runtimes/react/controls/rich-text-v2/EditableTextV2/render-leaf.d.ts.map +1 -0
- package/dist/types/src/runtimes/react/controls/rich-text-v2/rich-text-v2.d.ts +1 -1
- package/dist/types/src/runtimes/react/controls/rich-text-v2/rich-text-v2.d.ts.map +1 -1
- package/dist/types/src/runtimes/react/controls/style-v2.d.ts +13 -0
- package/dist/types/src/runtimes/react/controls/style-v2.d.ts.map +1 -0
- package/dist/types/src/runtimes/react/controls.d.ts.map +1 -1
- package/dist/types/src/runtimes/react/index.d.ts.map +1 -1
- package/dist/types/src/slate/BlockPlugin/index.d.ts +4 -0
- package/dist/types/src/slate/BlockPlugin/index.d.ts.map +1 -1
- package/dist/types/src/slate/ColorPlugin/index.d.ts +10 -0
- package/dist/types/src/slate/ColorPlugin/index.d.ts.map +1 -0
- package/dist/types/src/slate/InlineModePlugin/index.d.ts +2 -0
- package/dist/types/src/slate/InlineModePlugin/index.d.ts.map +1 -1
- package/dist/types/src/slate/TextAlignPlugin/index.d.ts +9 -0
- package/dist/types/src/slate/TextAlignPlugin/index.d.ts.map +1 -0
- package/dist/types/src/slate/index.d.ts +2 -0
- package/dist/types/src/slate/index.d.ts.map +1 -1
- package/dist/types/src/slate/types.d.ts +39 -0
- package/dist/types/src/slate/types.d.ts.map +1 -1
- package/dist/types/src/slate/utils/responsive.d.ts +16 -0
- package/dist/types/src/slate/utils/responsive.d.ts.map +1 -0
- package/dist/useMediaQuery.es.js +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -34,29 +34,28 @@ var __publicField = (obj, key, value) => {
|
|
|
34
34
|
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
35
35
|
return value;
|
|
36
36
|
};
|
|
37
|
-
var _e;
|
|
38
37
|
import * as React from "react";
|
|
39
38
|
import { useEffect, createContext, useContext, useState, useMemo, useRef, Children, createElement, forwardRef, memo, useId, useCallback, useImperativeHandle, Component, Suspense } from "react";
|
|
40
39
|
import { useSyncExternalStoreWithSelector } from "use-sync-external-store/shim/with-selector";
|
|
41
40
|
import dynamic from "next/dynamic";
|
|
42
|
-
import { a as createDocumentReference, g as getPropControllerDescriptors, b as isElementReference, e as getElementSwatchIds, f as getFileIds, h as getTypographyIds, j as getTableIds, k as getPageIds, l as getElementChildren, S as ShapeControlType, L as ListControlType, m as Types, E as ElementID, B as Backgrounds, W as Width, n as ResponsiveIconRadioGroup, M as Margin, P as Padding, o as Border, p as BorderRadius, q as Shadows, G as GapY, r as GapX, s as ResponsiveSelect, t as ResponsiveNumber, u as Checkbox, v as Grid, w as TextInput, x as Link, y as ResponsiveColor, z as TextStyle, C as ComponentIcon, I as Images, N as Number$1, D as Date$1, F as Font, A as ResponsiveLength, H as TextArea, J as Table, K as TableFormFields, O as Image, Q as ResponsiveOpacity, U as NavigationLinks, V as SocialLinks, X as RichText, Y as Video, Z as
|
|
41
|
+
import { a as createDocumentReference, g as getPropControllerDescriptors, b as isElementReference, e as getElementSwatchIds, f as getFileIds, h as getTypographyIds, j as getTableIds, k as getPageIds, l as getElementChildren, S as ShapeControlType, L as ListControlType, m as Types, E as ElementID, B as Backgrounds, W as Width, n as ResponsiveIconRadioGroup, M as Margin, P as Padding, o as Border, p as BorderRadius, q as Shadows, G as GapY, r as GapX, s as ResponsiveSelect, t as ResponsiveNumber, u as Checkbox, v as Grid, w as TextInput, x as Link, y as ResponsiveColor, z as TextStyle, C as ComponentIcon, I as Images, N as Number$1, D as Date$1, F as Font, A as ResponsiveLength, H as TextArea, J as Table, K as TableFormFields, O as Image, Q as ResponsiveOpacity, U as NavigationLinks, V as SocialLinks, X as RichText, Y as Video, Z as useStyle, _ as getBorderSwatchIds, $ as isNonNullable, a0 as getBoxShadowsSwatchIds, a1 as getResponsiveColorSwatchIds, a2 as StyleControlProperty, a3 as ImageControlValueFormat, a4 as isPropControllersHandle, a5 as StyleControlType, a6 as RichTextV2ControlType, a7 as RichTextControlType, a8 as SlotControlType, a9 as StyleV2ControlType, aa as LinkControlType, ab as ImageControlType, ac as ColorControlType, ad as getComponentPropControllerDescriptors, ae as getPropControllers, af as BorderPropControllerFormat, ag as ShadowsPropControllerFormat, ah as BorderRadiusPropControllerFormat, ai as MarginPropControllerFormat, aj as PaddingPropControllerFormat, ak as WidthPropControllerFormat, al as configureStore$1, am as copyElementTree, an as getBreakpoints, ao as getDocument, ap as getElementId, aq as getIsPreview, ar as getIsInBuilder, as as getReactComponent, at as getBuilderEditMode } from "./react-page.es.js";
|
|
43
42
|
import { A as ActionTypes, n as apiResourceFulfilled, o as registerComponentEffect, p as registerReactComponentEffect, q as registerComponentHandleEffect, t as mountComponentEffect } from "./actions.es.js";
|
|
44
|
-
import { cache, cx } from "@emotion/css";
|
|
45
|
-
import { serializeStyles } from "@emotion/serialize";
|
|
46
|
-
import { registerStyles, insertStyles } from "@emotion/utils";
|
|
47
43
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
48
44
|
import { T as TextAreaControlType, a as TextInputControlType, N as NumberControlType, C as CheckboxControlType } from "./text-input.es.js";
|
|
49
45
|
import { C as ComboboxControlType } from "./combobox.es.js";
|
|
46
|
+
import { I as IconRadioGroupControlType, S as SelectControlType } from "./select.es.js";
|
|
50
47
|
import "slate";
|
|
51
|
-
import { getBaseBreakpoint, findBreakpointOverride, DefaultBreakpointID, join, getBreakpoint, getBreakpointMediaQuery, parseBreakpointsInput } from "./state/breakpoints.es.js";
|
|
52
|
-
import "is-hotkey";
|
|
53
|
-
import "slate-react";
|
|
54
48
|
import { useSyncExternalStore } from "use-sync-external-store/shim";
|
|
55
49
|
import { createStore, applyMiddleware } from "redux";
|
|
56
50
|
import thunk from "redux-thunk";
|
|
57
51
|
import { A as APIResourceType } from "./types.es.js";
|
|
52
|
+
import { d as deepEqual } from "./deepEqual.es.js";
|
|
53
|
+
import { getBaseBreakpoint, findBreakpointOverride, DefaultBreakpointID, join, getBreakpoint, getBreakpointMediaQuery, parseBreakpointsInput } from "./state/breakpoints.es.js";
|
|
58
54
|
import { g as getBox, i as isMeasurable, m as measure } from "./box-models.es.js";
|
|
59
55
|
import ColorHelper from "color";
|
|
56
|
+
import { cache, cx } from "@emotion/css";
|
|
57
|
+
import "@emotion/serialize";
|
|
58
|
+
import "@emotion/utils";
|
|
60
59
|
import scrollIntoView from "scroll-into-view-if-needed";
|
|
61
60
|
import { findDOMNode } from "react-dom";
|
|
62
61
|
import parse from "html-react-parser";
|
|
@@ -72,43 +71,6 @@ import { parse as parse$1 } from "set-cookie-parser";
|
|
|
72
71
|
import { M as MakeswiftComponentType } from "./constants.es.js";
|
|
73
72
|
import { v4 } from "uuid";
|
|
74
73
|
import ipsum from "corporate-ipsum";
|
|
75
|
-
function is(x, y) {
|
|
76
|
-
if (x === y)
|
|
77
|
-
return x !== 0 || y !== 0 || 1 / x === 1 / y;
|
|
78
|
-
return x !== x && y !== y;
|
|
79
|
-
}
|
|
80
|
-
const { hasOwnProperty: hasOwnProperty$1 } = Object.prototype;
|
|
81
|
-
const shallowEqual = (a, b) => {
|
|
82
|
-
if (is(a, b))
|
|
83
|
-
return true;
|
|
84
|
-
if (typeof a !== "object" || a === null || typeof b !== "object" || b === null)
|
|
85
|
-
return false;
|
|
86
|
-
const keysA = Object.keys(a);
|
|
87
|
-
const keysB = Object.keys(b);
|
|
88
|
-
if (keysA.length !== keysB.length)
|
|
89
|
-
return false;
|
|
90
|
-
for (let i = 0; i < keysA.length; i += 1) {
|
|
91
|
-
if (!hasOwnProperty$1.call(b, keysA[i]) || !is(a[keysA[i]], b[keysA[i]]))
|
|
92
|
-
return false;
|
|
93
|
-
}
|
|
94
|
-
return true;
|
|
95
|
-
};
|
|
96
|
-
const { hasOwnProperty } = Object.prototype;
|
|
97
|
-
const deepEqual = (a, b) => {
|
|
98
|
-
if (shallowEqual(a, b))
|
|
99
|
-
return true;
|
|
100
|
-
if (typeof a !== "object" || a === null || typeof b !== "object" || b === null)
|
|
101
|
-
return false;
|
|
102
|
-
const keysA = Object.keys(a);
|
|
103
|
-
const keysB = Object.keys(b);
|
|
104
|
-
if (keysA.length !== keysB.length)
|
|
105
|
-
return false;
|
|
106
|
-
for (let i = 0; i < keysA.length; i += 1) {
|
|
107
|
-
if (!hasOwnProperty.call(b, keysA[i]) || !deepEqual(a[keysA[i]], b[keysA[i]]))
|
|
108
|
-
return false;
|
|
109
|
-
}
|
|
110
|
-
return true;
|
|
111
|
-
};
|
|
112
74
|
const SCRIPT_TAG = "script";
|
|
113
75
|
function BodySnippet({
|
|
114
76
|
code,
|
|
@@ -1151,7 +1113,7 @@ async function fonts(_req, res, { getFonts } = {}) {
|
|
|
1151
1113
|
const fonts2 = (_a = await (getFonts == null ? void 0 : getFonts())) != null ? _a : [];
|
|
1152
1114
|
return res.json(fonts2);
|
|
1153
1115
|
}
|
|
1154
|
-
const version = "0.9.
|
|
1116
|
+
const version = "0.9.2";
|
|
1155
1117
|
async function handler(req, res, { apiKey, unstable_siteVersions }) {
|
|
1156
1118
|
if (req.query.secret !== apiKey) {
|
|
1157
1119
|
return res.status(401).json({ message: "Unauthorized" });
|
|
@@ -2423,19 +2385,6 @@ function registerBuiltinComponents(runtime) {
|
|
|
2423
2385
|
unregisterVideoComponent();
|
|
2424
2386
|
};
|
|
2425
2387
|
}
|
|
2426
|
-
const isServer = typeof window === "undefined";
|
|
2427
|
-
const useInsertionEffectSpecifier = "useInsertionEffect";
|
|
2428
|
-
const useInsertionEffect = (_e = React[useInsertionEffectSpecifier]) != null ? _e : React.useLayoutEffect;
|
|
2429
|
-
function useStyle(style) {
|
|
2430
|
-
const serialized = serializeStyles([style], cache.registered);
|
|
2431
|
-
registerStyles(cache, serialized, false);
|
|
2432
|
-
useInsertionEffect(() => {
|
|
2433
|
-
insertStyles(cache, serialized, false);
|
|
2434
|
-
});
|
|
2435
|
-
if (isServer)
|
|
2436
|
-
insertStyles(cache, serialized, false);
|
|
2437
|
-
return `${cache.key}-${serialized.name}`;
|
|
2438
|
-
}
|
|
2439
2388
|
var _path;
|
|
2440
2389
|
function _extends() {
|
|
2441
2390
|
_extends = Object.assign || function(target) {
|
|
@@ -2579,8 +2528,8 @@ function useTable(tableId) {
|
|
|
2579
2528
|
}, [client, tableId]);
|
|
2580
2529
|
return table;
|
|
2581
2530
|
}
|
|
2582
|
-
function mapSideColor(swatches,
|
|
2583
|
-
var
|
|
2531
|
+
function mapSideColor(swatches, _e) {
|
|
2532
|
+
var _f = _e, { color } = _f, restOfSide = __objRest(_f, ["color"]);
|
|
2584
2533
|
return __spreadProps(__spreadValues({}, restOfSide), {
|
|
2585
2534
|
color: color && {
|
|
2586
2535
|
alpha: color.alpha,
|
|
@@ -2898,7 +2847,7 @@ const defaultPadding = {
|
|
|
2898
2847
|
paddingBottom: 0,
|
|
2899
2848
|
paddingLeft: 0
|
|
2900
2849
|
};
|
|
2901
|
-
function useStyleControlCssObject(style, controlDefinition) {
|
|
2850
|
+
function useStyleControlCssObject$1(style, controlDefinition) {
|
|
2902
2851
|
const { properties } = controlDefinition.config;
|
|
2903
2852
|
return __spreadValues(__spreadValues({}, properties.includes(StyleControlProperty.Width) && {
|
|
2904
2853
|
maxWidth: "100%"
|
|
@@ -2910,14 +2859,14 @@ function useStyleControlCssObject(style, controlDefinition) {
|
|
|
2910
2859
|
style == null ? void 0 : style.borderRadius,
|
|
2911
2860
|
style == null ? void 0 : style.textStyle
|
|
2912
2861
|
], ([width, margin, padding, border, borderRadius, textStyle]) => {
|
|
2913
|
-
var _a, _b, _c, _d,
|
|
2862
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
|
|
2914
2863
|
return __spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues({}, properties.includes(StyleControlProperty.Width) && {
|
|
2915
2864
|
width: (_a = widthToString(width)) != null ? _a : "100%"
|
|
2916
2865
|
}), properties.includes(StyleControlProperty.Margin) && marginPropertyDataToStyle(margin != null ? margin : defaultMargin, defaultMargin)), properties.includes(StyleControlProperty.Padding) && paddingPropertyDataToStyle(padding != null ? padding : defaultPadding, defaultPadding)), properties.includes(StyleControlProperty.Border) && {
|
|
2917
2866
|
borderTop: (_b = borderSideToString2(border == null ? void 0 : border.borderTop)) != null ? _b : "0 solid black",
|
|
2918
2867
|
borderRight: (_c = borderSideToString2(border == null ? void 0 : border.borderRight)) != null ? _c : "0 solid black",
|
|
2919
2868
|
borderBottom: (_d = borderSideToString2(border == null ? void 0 : border.borderBottom)) != null ? _d : "0 solid black",
|
|
2920
|
-
borderLeft: (
|
|
2869
|
+
borderLeft: (_e = borderSideToString2(border == null ? void 0 : border.borderLeft)) != null ? _e : "0 solid black"
|
|
2921
2870
|
}), properties.includes(StyleControlProperty.BorderRadius) && {
|
|
2922
2871
|
borderTopLeftRadius: (_f = borderRadiusToString(borderRadius == null ? void 0 : borderRadius.borderTopLeftRadius)) != null ? _f : 0,
|
|
2923
2872
|
borderTopRightRadius: (_g = borderRadiusToString(borderRadius == null ? void 0 : borderRadius.borderTopRightRadius)) != null ? _g : 0,
|
|
@@ -2949,7 +2898,7 @@ function useStyleControlCssObject(style, controlDefinition) {
|
|
|
2949
2898
|
}
|
|
2950
2899
|
}
|
|
2951
2900
|
function useFormattedStyle(styleControlData, controlDefinition, control) {
|
|
2952
|
-
const style = useStyleControlCssObject(styleControlData, controlDefinition);
|
|
2901
|
+
const style = useStyleControlCssObject$1(styleControlData, controlDefinition);
|
|
2953
2902
|
const guid = useId().replaceAll(":", "");
|
|
2954
2903
|
const styleClassName = useStyle(style);
|
|
2955
2904
|
const classNames = `${styleClassName} ${guid}`;
|
|
@@ -3006,6 +2955,9 @@ function useColorValue(data, definition) {
|
|
|
3006
2955
|
function useComboboxControlValue(data) {
|
|
3007
2956
|
return data == null ? void 0 : data.value;
|
|
3008
2957
|
}
|
|
2958
|
+
function useIconRadioGroupValue(iconRadioGroupControlData, controlDefinition) {
|
|
2959
|
+
return iconRadioGroupControlData != null ? iconRadioGroupControlData : controlDefinition.config.defaultValue;
|
|
2960
|
+
}
|
|
3009
2961
|
function useImageControlValue(data, definition) {
|
|
3010
2962
|
var _a;
|
|
3011
2963
|
const format = (_a = definition.config.format) != null ? _a : ImageControlValueFormat.URL;
|
|
@@ -3109,7 +3061,7 @@ function ListControlValue({
|
|
|
3109
3061
|
function useNumber(numberControlData, controlDefinition) {
|
|
3110
3062
|
return numberControlData != null ? numberControlData : controlDefinition.config.defaultValue;
|
|
3111
3063
|
}
|
|
3112
|
-
const Text = forwardNextDynamicRef((patch) => dynamic(() => patch(import("./index.
|
|
3064
|
+
const Text = forwardNextDynamicRef((patch) => dynamic(() => patch(import("./index.es9.js"))));
|
|
3113
3065
|
function useRichText(data, control) {
|
|
3114
3066
|
const textCallbackRef = useCallback((handle) => {
|
|
3115
3067
|
var _a;
|
|
@@ -3123,12 +3075,13 @@ function useRichText(data, control) {
|
|
|
3123
3075
|
ref: textCallbackRef
|
|
3124
3076
|
});
|
|
3125
3077
|
}
|
|
3126
|
-
const EditableText = forwardNextDynamicRef((patch) => dynamic(() => patch(import("./index.
|
|
3078
|
+
const EditableText = forwardNextDynamicRef((patch) => dynamic(() => patch(import("./index.es10.js"))));
|
|
3127
3079
|
const ReadOnlyText = forwardNextDynamicRef((patch) => dynamic(() => patch(import("./ReadOnlyTextV2.es.js"))));
|
|
3128
|
-
function useRichTextV2(data, control) {
|
|
3080
|
+
function useRichTextV2(data, definition, control) {
|
|
3129
3081
|
const isPreview = useIsPreview();
|
|
3130
3082
|
return isPreview ? /* @__PURE__ */ jsx(EditableText, {
|
|
3131
3083
|
text: data,
|
|
3084
|
+
definition,
|
|
3132
3085
|
control
|
|
3133
3086
|
}) : /* @__PURE__ */ jsx(ReadOnlyText, {
|
|
3134
3087
|
text: data,
|
|
@@ -3190,13 +3143,13 @@ function useSlot(data, control) {
|
|
|
3190
3143
|
}, element.key))
|
|
3191
3144
|
});
|
|
3192
3145
|
}
|
|
3193
|
-
function Slot(
|
|
3194
|
-
var
|
|
3146
|
+
function Slot(_g) {
|
|
3147
|
+
var _h = _g, {
|
|
3195
3148
|
as,
|
|
3196
3149
|
control,
|
|
3197
3150
|
children,
|
|
3198
3151
|
className
|
|
3199
|
-
} =
|
|
3152
|
+
} = _h, restOfProps = __objRest(_h, [
|
|
3200
3153
|
"as",
|
|
3201
3154
|
"control",
|
|
3202
3155
|
"children",
|
|
@@ -3225,15 +3178,15 @@ function Slot(_h) {
|
|
|
3225
3178
|
}
|
|
3226
3179
|
Slot.Placeholder = SlotPlaceholder;
|
|
3227
3180
|
Slot.Item = SlotItem;
|
|
3228
|
-
function SlotItem(
|
|
3229
|
-
var
|
|
3181
|
+
function SlotItem(_i) {
|
|
3182
|
+
var _j = _i, {
|
|
3230
3183
|
as,
|
|
3231
3184
|
control,
|
|
3232
3185
|
grid,
|
|
3233
3186
|
index,
|
|
3234
3187
|
children,
|
|
3235
3188
|
className
|
|
3236
|
-
} =
|
|
3189
|
+
} = _j, restOfProps = __objRest(_j, [
|
|
3237
3190
|
"as",
|
|
3238
3191
|
"control",
|
|
3239
3192
|
"grid",
|
|
@@ -3315,6 +3268,43 @@ function SlotPlaceholder({
|
|
|
3315
3268
|
})
|
|
3316
3269
|
});
|
|
3317
3270
|
}
|
|
3271
|
+
function useStyleControlCssObject(styleControlData, controlDefinition) {
|
|
3272
|
+
var _a;
|
|
3273
|
+
const breakpoints = useBreakpoints();
|
|
3274
|
+
return __spreadValues(__spreadValues({}, controlDefinition.config.getStyle((_a = findBreakpointOverride(breakpoints, styleControlData, getBaseBreakpoint(breakpoints).id)) == null ? void 0 : _a.value)), breakpoints.reduce((styles, breakpoint) => {
|
|
3275
|
+
var _a2;
|
|
3276
|
+
return __spreadProps(__spreadValues({}, styles), {
|
|
3277
|
+
[getBreakpointMediaQuery(breakpoint)]: controlDefinition.config.getStyle((_a2 = findBreakpointOverride(breakpoints, styleControlData, breakpoint.id)) == null ? void 0 : _a2.value)
|
|
3278
|
+
});
|
|
3279
|
+
}, {}));
|
|
3280
|
+
}
|
|
3281
|
+
function useFormattedStyleV2(styleControlData, controlDefinition) {
|
|
3282
|
+
const styles = useStyleControlCssObject(styleControlData, controlDefinition);
|
|
3283
|
+
return useStyle(styles);
|
|
3284
|
+
}
|
|
3285
|
+
function StyleV2ControlValue({
|
|
3286
|
+
definition,
|
|
3287
|
+
data,
|
|
3288
|
+
children,
|
|
3289
|
+
control
|
|
3290
|
+
}) {
|
|
3291
|
+
return (data != null ? data : []).reduceRight((renderFn, deviceOverrideData) => (responsiveValue) => {
|
|
3292
|
+
return /* @__PURE__ */ jsx(ControlValue, {
|
|
3293
|
+
definition: definition.config.type,
|
|
3294
|
+
data: deviceOverrideData.value,
|
|
3295
|
+
control: control == null ? void 0 : control.control,
|
|
3296
|
+
children: (value) => renderFn([__spreadProps(__spreadValues({}, deviceOverrideData), {
|
|
3297
|
+
value
|
|
3298
|
+
}), ...responsiveValue])
|
|
3299
|
+
});
|
|
3300
|
+
}, (value) => {
|
|
3301
|
+
return /* @__PURE__ */ jsx(RenderHook, {
|
|
3302
|
+
hook: useFormattedStyleV2,
|
|
3303
|
+
parameters: [value, definition],
|
|
3304
|
+
children: (value2) => children(value2)
|
|
3305
|
+
}, definition.type);
|
|
3306
|
+
})([]);
|
|
3307
|
+
}
|
|
3318
3308
|
function useTextAreaValue(data, definition) {
|
|
3319
3309
|
return data != null ? data : definition.config.defaultValue;
|
|
3320
3310
|
}
|
|
@@ -3364,6 +3354,12 @@ function ControlValue({
|
|
|
3364
3354
|
parameters: [data, definition],
|
|
3365
3355
|
children: (value) => children(value)
|
|
3366
3356
|
}, definition.type);
|
|
3357
|
+
case IconRadioGroupControlType:
|
|
3358
|
+
return /* @__PURE__ */ jsx(RenderHook, {
|
|
3359
|
+
hook: useIconRadioGroupValue,
|
|
3360
|
+
parameters: [data, definition],
|
|
3361
|
+
children: (value) => children(value)
|
|
3362
|
+
}, definition.type);
|
|
3367
3363
|
case ImageControlType:
|
|
3368
3364
|
return /* @__PURE__ */ jsx(RenderHook, {
|
|
3369
3365
|
hook: useImageControlValue,
|
|
@@ -3396,6 +3392,13 @@ function ControlValue({
|
|
|
3396
3392
|
control,
|
|
3397
3393
|
children: (value) => children(value)
|
|
3398
3394
|
});
|
|
3395
|
+
case StyleV2ControlType:
|
|
3396
|
+
return /* @__PURE__ */ jsx(StyleV2ControlValue, {
|
|
3397
|
+
data,
|
|
3398
|
+
definition,
|
|
3399
|
+
control,
|
|
3400
|
+
children: (value) => children(value)
|
|
3401
|
+
}, definition.type);
|
|
3399
3402
|
case SlotControlType:
|
|
3400
3403
|
return /* @__PURE__ */ jsx(RenderHook, {
|
|
3401
3404
|
hook: useSlot,
|
|
@@ -3411,7 +3414,7 @@ function ControlValue({
|
|
|
3411
3414
|
case RichTextV2ControlType:
|
|
3412
3415
|
return /* @__PURE__ */ jsx(RenderHook, {
|
|
3413
3416
|
hook: useRichTextV2,
|
|
3414
|
-
parameters: [data, control],
|
|
3417
|
+
parameters: [data, definition, control],
|
|
3415
3418
|
children: (value) => children(value)
|
|
3416
3419
|
}, definition.type);
|
|
3417
3420
|
case StyleControlType:
|
|
@@ -3467,11 +3470,13 @@ function PropsValue({
|
|
|
3467
3470
|
case TextAreaControlType:
|
|
3468
3471
|
case SelectControlType:
|
|
3469
3472
|
case ColorControlType:
|
|
3473
|
+
case IconRadioGroupControlType:
|
|
3470
3474
|
case ImageControlType:
|
|
3471
3475
|
case ComboboxControlType:
|
|
3472
3476
|
case ShapeControlType:
|
|
3473
3477
|
case ListControlType:
|
|
3474
3478
|
case LinkControlType:
|
|
3479
|
+
case StyleV2ControlType:
|
|
3475
3480
|
return /* @__PURE__ */ jsx(ControlValue, {
|
|
3476
3481
|
definition: descriptor,
|
|
3477
3482
|
data: props[propName],
|
|
@@ -3504,7 +3509,7 @@ function PropsValue({
|
|
|
3504
3509
|
const control = (_c = propControllers == null ? void 0 : propControllers[propName]) != null ? _c : null;
|
|
3505
3510
|
return /* @__PURE__ */ jsx(RenderHook, {
|
|
3506
3511
|
hook: useRichTextV2,
|
|
3507
|
-
parameters: [props[propName], control],
|
|
3512
|
+
parameters: [props[propName], descriptor, control],
|
|
3508
3513
|
children: (value) => renderFn(__spreadProps(__spreadValues({}, propsValue), {
|
|
3509
3514
|
[propName]: value
|
|
3510
3515
|
}))
|
|
@@ -3761,10 +3766,10 @@ registerBuiltinComponents(ReactRuntime);
|
|
|
3761
3766
|
const StoreContext = createContext(ReactRuntime.store);
|
|
3762
3767
|
const PreviewProvider = dynamic(() => import("./PreviewProvider.es.js"));
|
|
3763
3768
|
const LiveProvider = dynamic(() => import("./LiveProvider.es.js"));
|
|
3764
|
-
function RuntimeProvider(
|
|
3765
|
-
var
|
|
3769
|
+
function RuntimeProvider(_k) {
|
|
3770
|
+
var _l = _k, {
|
|
3766
3771
|
preview
|
|
3767
|
-
} =
|
|
3772
|
+
} = _l, props = __objRest(_l, [
|
|
3768
3773
|
"preview"
|
|
3769
3774
|
]);
|
|
3770
3775
|
return preview ? /* @__PURE__ */ jsx(PreviewProvider, __spreadValues({}, props)) : /* @__PURE__ */ jsx(LiveProvider, __spreadValues({}, props));
|
|
@@ -3965,5 +3970,5 @@ const DocumentReference = memo(forwardRef(function DocumentReference2({
|
|
|
3965
3970
|
document: document2
|
|
3966
3971
|
});
|
|
3967
3972
|
}));
|
|
3968
|
-
export {
|
|
3973
|
+
export { MakeswiftApiHandler as $, Alignments as A, forwardNextDynamicRef as B, Contrasts as C, DocumentReference as D, Element$1 as E, useIsPreview as F, useFiles as G, useSwatches as H, usePagePathnameSlice as I, useElementId as J, ElementImperativeHandle as K, StoreContext as L, MakeswiftProvider as M, ControlValue as N, useBuilderEditMode as O, PageProvider as P, pollBoxModel as Q, RuntimeProvider as R, Shapes as S, useTypography as T, getStaticPaths as U, getStaticProps as V, getServerSideProps as W, Page as X, Makeswift as Y, PreviewModeScript as Z, Document$1 as _, ReactRuntime as a, 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, Page$1 as m, useResponsiveStyle as n, useResponsiveWidth as o, useResponsiveTextStyle as p, colorToString as q, useBreakpoints as r, Sizes as s, useFormContext as t, useIsInBuilder as u, useResponsiveGridItem as v, useTable as w, useMakeswiftClient as x, Provider as y, useFile as z };
|
|
3969
3974
|
//# sourceMappingURL=index.es.js.map
|