@makeswift/runtime 0.0.6 → 0.0.9
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/builder.cjs.js +2 -1
- package/dist/builder.cjs.js.map +1 -1
- package/dist/builder.es.js +2 -1
- package/dist/builder.es.js.map +1 -1
- package/dist/components.cjs.js +3 -1
- package/dist/components.cjs.js.map +1 -1
- package/dist/components.es.js +3 -1
- package/dist/components.es.js.map +1 -1
- package/dist/control-serialization.cjs.js +17 -0
- package/dist/control-serialization.cjs.js.map +1 -1
- package/dist/control-serialization.es.js +17 -0
- package/dist/control-serialization.es.js.map +1 -1
- package/dist/controls.cjs.js +20 -0
- package/dist/controls.cjs.js.map +1 -1
- package/dist/controls.es.js +2 -0
- package/dist/controls.es.js.map +1 -1
- package/dist/descriptors.cjs.js.map +1 -1
- package/dist/descriptors.es.js.map +1 -1
- package/dist/index.cjs.js +206 -32
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +206 -32
- package/dist/index.es.js.map +1 -1
- package/dist/list.cjs.js +8 -0
- package/dist/list.cjs.js.map +1 -0
- package/dist/list.es.js +6 -0
- package/dist/list.es.js.map +1 -0
- package/dist/next.cjs.js +2 -0
- package/dist/next.cjs.js.map +1 -1
- package/dist/next.es.js +2 -0
- package/dist/next.es.js.map +1 -1
- package/dist/react-builder-preview.cjs.js +1 -0
- package/dist/react-builder-preview.cjs.js.map +1 -1
- package/dist/react-builder-preview.es.js +1 -0
- package/dist/react-builder-preview.es.js.map +1 -1
- package/dist/react-page.cjs.js.map +1 -1
- package/dist/react-page.es.js.map +1 -1
- package/dist/react.cjs.js +2 -0
- package/dist/react.cjs.js.map +1 -1
- package/dist/react.es.js +2 -0
- package/dist/react.es.js.map +1 -1
- package/dist/text-input.cjs.js +50 -0
- package/dist/text-input.cjs.js.map +1 -0
- package/dist/text-input.es.js +34 -0
- package/dist/text-input.es.js.map +1 -0
- package/dist/types/builder/serialization/control-serialization.d.ts +4 -2
- package/dist/types/builder/serialization/control-serialization.d.ts.map +1 -1
- package/dist/types/builder/serialization/controls/list.d.ts +5 -0
- package/dist/types/builder/serialization/controls/list.d.ts.map +1 -0
- package/dist/types/builder/serialization/controls/types.d.ts +10 -0
- package/dist/types/builder/serialization/controls/types.d.ts.map +1 -0
- package/dist/types/builder/serialization/index.d.ts +1 -0
- package/dist/types/builder/serialization/index.d.ts.map +1 -1
- package/dist/types/components/builtin/Carousel/Carousel.d.ts +3 -3
- package/dist/types/components/builtin/Carousel/Carousel.d.ts.map +1 -1
- package/dist/types/components/builtin/Countdown/Countdown.d.ts +3 -3
- package/dist/types/components/builtin/Countdown/Countdown.d.ts.map +1 -1
- package/dist/types/components/builtin/Divider/Divider.d.ts +1 -1
- package/dist/types/components/builtin/Divider/Divider.d.ts.map +1 -1
- package/dist/types/components/builtin/Form/Form.d.ts +3 -3
- package/dist/types/components/builtin/Form/Form.d.ts.map +1 -1
- package/dist/types/components/builtin/Form/context/FormContext.d.ts +1 -1
- package/dist/types/components/builtin/Form/context/FormContext.d.ts.map +1 -1
- package/dist/types/components/builtin/Navigation/Navigation.d.ts +3 -3
- package/dist/types/components/builtin/Navigation/Navigation.d.ts.map +1 -1
- package/dist/types/components/builtin/Navigation/components/DropDownButton/index.d.ts.map +1 -1
- package/dist/types/components/builtin/Navigation/components/MobileMenu/index.d.ts +2 -2
- package/dist/types/components/builtin/Navigation/components/MobileMenu/index.d.ts.map +1 -1
- package/dist/types/components/builtin/SocialLinks/SocialLinks.d.ts +2 -2
- package/dist/types/components/builtin/SocialLinks/SocialLinks.d.ts.map +1 -1
- package/dist/types/components/hooks/index.d.ts +1 -1
- package/dist/types/components/hooks/index.d.ts.map +1 -1
- package/dist/types/components/hooks/{useColor.d.ts → useResponsiveColor.d.ts} +2 -2
- package/dist/types/components/hooks/useResponsiveColor.d.ts.map +1 -0
- package/dist/types/controls/checkbox.d.ts +13 -0
- package/dist/types/controls/checkbox.d.ts.map +1 -0
- package/dist/types/controls/color.d.ts +16 -0
- package/dist/types/controls/color.d.ts.map +1 -0
- package/dist/types/controls/control.d.ts +12 -0
- package/dist/types/controls/control.d.ts.map +1 -0
- package/dist/types/controls/image.d.ts +12 -0
- package/dist/types/controls/image.d.ts.map +1 -0
- package/dist/types/controls/index.d.ts +10 -0
- package/dist/types/controls/index.d.ts.map +1 -1
- package/dist/types/controls/list.d.ts +26 -0
- package/dist/types/controls/list.d.ts.map +1 -0
- package/dist/types/controls/number.d.ts +18 -0
- package/dist/types/controls/number.d.ts.map +1 -0
- package/dist/types/controls/select.d.ts +22 -0
- package/dist/types/controls/select.d.ts.map +1 -0
- package/dist/types/controls/shape.d.ts +16 -0
- package/dist/types/controls/shape.d.ts.map +1 -0
- package/dist/types/controls/text-area.d.ts +14 -0
- package/dist/types/controls/text-area.d.ts.map +1 -0
- package/dist/types/controls/text-input.d.ts +13 -0
- package/dist/types/controls/text-input.d.ts.map +1 -0
- package/dist/types/prop-controllers/descriptors.d.ts +13 -2
- package/dist/types/prop-controllers/descriptors.d.ts.map +1 -1
- package/dist/types/runtimes/react/components/index.d.ts +2 -0
- package/dist/types/runtimes/react/components/index.d.ts.map +1 -0
- package/dist/types/runtimes/react/components/render-hook.d.ts +14 -0
- package/dist/types/runtimes/react/components/render-hook.d.ts.map +1 -0
- package/dist/types/runtimes/react/controls/checkbox.d.ts +4 -0
- package/dist/types/runtimes/react/controls/checkbox.d.ts.map +1 -0
- package/dist/types/runtimes/react/controls/color.d.ts +4 -0
- package/dist/types/runtimes/react/controls/color.d.ts.map +1 -0
- package/dist/types/runtimes/react/controls/control.d.ts +20 -0
- package/dist/types/runtimes/react/controls/control.d.ts.map +1 -0
- package/dist/types/runtimes/react/controls/image.d.ts +4 -0
- package/dist/types/runtimes/react/controls/image.d.ts.map +1 -0
- package/dist/types/runtimes/react/controls/list.d.ts +13 -0
- package/dist/types/runtimes/react/controls/list.d.ts.map +1 -0
- package/dist/types/runtimes/react/controls/number.d.ts +4 -0
- package/dist/types/runtimes/react/controls/number.d.ts.map +1 -0
- package/dist/types/runtimes/react/controls/select.d.ts +4 -0
- package/dist/types/runtimes/react/controls/select.d.ts.map +1 -0
- package/dist/types/runtimes/react/controls/shape.d.ts +14 -0
- package/dist/types/runtimes/react/controls/shape.d.ts.map +1 -0
- package/dist/types/runtimes/react/controls/style.d.ts.map +1 -1
- package/dist/types/runtimes/react/controls/text-area.d.ts +4 -0
- package/dist/types/runtimes/react/controls/text-area.d.ts.map +1 -0
- package/dist/types/runtimes/react/controls/text-input.d.ts +4 -0
- package/dist/types/runtimes/react/controls/text-input.d.ts.map +1 -0
- package/dist/types/runtimes/react/controls.d.ts +7 -1
- package/dist/types/runtimes/react/controls.d.ts.map +1 -1
- package/dist/types/runtimes/react/index.d.ts +1 -1
- package/dist/types/runtimes/react/index.d.ts.map +1 -1
- package/dist/types/state/modules/react-components.d.ts +4 -2
- package/dist/types/state/modules/react-components.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/types/components/hooks/useColor.d.ts.map +0 -1
package/dist/index.es.js
CHANGED
|
@@ -64,6 +64,8 @@ import Hotkeys from "slate-hotkeys";
|
|
|
64
64
|
import ipsum from "corporate-ipsum";
|
|
65
65
|
import { Editor } from "slate-react";
|
|
66
66
|
import Lists from "@convertkit/slate-lists";
|
|
67
|
+
import { S as ShapeControlType, I as ImageControlType, C as ColorControlType, a as SelectControlType, T as TextAreaControlType, b as TextInputControlType, N as NumberControlType, c as CheckboxControlType } from "./text-input.es.js";
|
|
68
|
+
import { L as ListControlType } from "./list.es.js";
|
|
67
69
|
import { a as StyleControlProperty, S as StyleControlType } from "./style.es.js";
|
|
68
70
|
import { findDOMNode } from "react-dom";
|
|
69
71
|
const PlaceholderBase$1 = styled.div`
|
|
@@ -521,7 +523,7 @@ function useBoxShadow(value) {
|
|
|
521
523
|
});
|
|
522
524
|
});
|
|
523
525
|
}
|
|
524
|
-
function
|
|
526
|
+
function useResponsiveColor(color) {
|
|
525
527
|
const swatchIds = color == null ? [] : [...Array.from(new Set(color.map(({ value: v }) => v && v.swatchId).filter(isNonNullable)))];
|
|
526
528
|
const skip = swatchIds.length === 0;
|
|
527
529
|
const { error, data = {} } = useQuery(SWATCHES_BY_ID, { skip, variables: { ids: swatchIds } });
|
|
@@ -5625,7 +5627,7 @@ function DropDownItem$1(_S) {
|
|
|
5625
5627
|
"color"
|
|
5626
5628
|
]);
|
|
5627
5629
|
return /* @__PURE__ */ jsx(StyledDropDownItem, __spreadProps(__spreadValues({}, restOfProps), {
|
|
5628
|
-
color:
|
|
5630
|
+
color: useResponsiveColor(color)
|
|
5629
5631
|
}));
|
|
5630
5632
|
}
|
|
5631
5633
|
function DropDownButton(_U) {
|
|
@@ -5654,8 +5656,8 @@ function DropDownButton(_U) {
|
|
|
5654
5656
|
return /* @__PURE__ */ jsxs(DropDownContainer, {
|
|
5655
5657
|
ref: container,
|
|
5656
5658
|
children: [/* @__PURE__ */ jsx(Button$1, __spreadProps(__spreadValues({}, restOfProps), {
|
|
5657
|
-
textColor:
|
|
5658
|
-
color:
|
|
5659
|
+
textColor: useResponsiveColor(textColor),
|
|
5660
|
+
color: useResponsiveColor(color),
|
|
5659
5661
|
children: /* @__PURE__ */ jsxs("div", {
|
|
5660
5662
|
style: {
|
|
5661
5663
|
display: "flex",
|
|
@@ -5736,7 +5738,7 @@ function DropDownItem(_W) {
|
|
|
5736
5738
|
"color"
|
|
5737
5739
|
]);
|
|
5738
5740
|
return /* @__PURE__ */ jsx(StyledLink$2, __spreadProps(__spreadValues({}, restOfProps), {
|
|
5739
|
-
color:
|
|
5741
|
+
color: useResponsiveColor(color)
|
|
5740
5742
|
}));
|
|
5741
5743
|
}
|
|
5742
5744
|
function MobileDropDownButton(_Y) {
|
|
@@ -5759,8 +5761,8 @@ function MobileDropDownButton(_Y) {
|
|
|
5759
5761
|
const [isOpen, setIsOpen] = useState(false);
|
|
5760
5762
|
return /* @__PURE__ */ jsxs(Fragment, {
|
|
5761
5763
|
children: [/* @__PURE__ */ jsx(ButtonLink$1, __spreadProps(__spreadValues({}, restOfProps), {
|
|
5762
|
-
textColor:
|
|
5763
|
-
color:
|
|
5764
|
+
textColor: useResponsiveColor(textColor),
|
|
5765
|
+
color: useResponsiveColor(color),
|
|
5764
5766
|
onPointerDown: () => setIsOpen((prev) => !prev),
|
|
5765
5767
|
children: /* @__PURE__ */ jsxs("div", {
|
|
5766
5768
|
style: {
|
|
@@ -5803,8 +5805,8 @@ function NavigationButton$1(props) {
|
|
|
5803
5805
|
"color"
|
|
5804
5806
|
]);
|
|
5805
5807
|
return /* @__PURE__ */ jsx(Button$1, __spreadProps(__spreadValues({}, restOfProps), {
|
|
5806
|
-
textColor:
|
|
5807
|
-
color:
|
|
5808
|
+
textColor: useResponsiveColor(textColor),
|
|
5809
|
+
color: useResponsiveColor(color)
|
|
5808
5810
|
}));
|
|
5809
5811
|
}
|
|
5810
5812
|
const ButtonLink = styled(NavigationButton$1)`
|
|
@@ -5935,8 +5937,8 @@ function NavigationButton(props) {
|
|
|
5935
5937
|
"color"
|
|
5936
5938
|
]);
|
|
5937
5939
|
return /* @__PURE__ */ jsx(Button$1, __spreadProps(__spreadValues({}, restOfProps), {
|
|
5938
|
-
textColor:
|
|
5939
|
-
color:
|
|
5940
|
+
textColor: useResponsiveColor(textColor),
|
|
5941
|
+
color: useResponsiveColor(color)
|
|
5940
5942
|
}));
|
|
5941
5943
|
}
|
|
5942
5944
|
const placeholder = {
|
|
@@ -8167,7 +8169,8 @@ function useStyleControlCssObject(style, controlDefinition) {
|
|
|
8167
8169
|
return `${borderRadius.value}${borderRadius.unit}`;
|
|
8168
8170
|
}
|
|
8169
8171
|
}
|
|
8170
|
-
const
|
|
8172
|
+
const useInsertionEffectSpecifier = "useInsertionEffect";
|
|
8173
|
+
const useInsertionEffect = (_ea = React[useInsertionEffectSpecifier]) != null ? _ea : React.useLayoutEffect;
|
|
8171
8174
|
function useFormattedStyle(styleControlData, controlDefinition) {
|
|
8172
8175
|
const style = useStyleControlCssObject(styleControlData, controlDefinition);
|
|
8173
8176
|
const serialized = serializeStyles([style], cache.registered);
|
|
@@ -8176,6 +8179,141 @@ function useFormattedStyle(styleControlData, controlDefinition) {
|
|
|
8176
8179
|
});
|
|
8177
8180
|
return `${cache.key}-${serialized.name}`;
|
|
8178
8181
|
}
|
|
8182
|
+
function RenderHook({
|
|
8183
|
+
hook: useHook,
|
|
8184
|
+
parameters,
|
|
8185
|
+
children
|
|
8186
|
+
}) {
|
|
8187
|
+
return children(useHook(...parameters));
|
|
8188
|
+
}
|
|
8189
|
+
function useCheckboxControlValue(data, definition) {
|
|
8190
|
+
return data != null ? data : definition.config.defaultValue;
|
|
8191
|
+
}
|
|
8192
|
+
function useColorValue(data, definition) {
|
|
8193
|
+
var _a, _b;
|
|
8194
|
+
const result = useQuery(SWATCHES_BY_ID, {
|
|
8195
|
+
variables: { ids: [data == null ? void 0 : data.swatchId] },
|
|
8196
|
+
skip: (data == null ? void 0 : data.swatchId) == null
|
|
8197
|
+
});
|
|
8198
|
+
if (data === void 0) {
|
|
8199
|
+
const { defaultValue } = definition.config;
|
|
8200
|
+
if (defaultValue === void 0)
|
|
8201
|
+
return void 0;
|
|
8202
|
+
let defaultColor;
|
|
8203
|
+
try {
|
|
8204
|
+
defaultColor = ColorHelper(definition.config.defaultValue);
|
|
8205
|
+
} catch {
|
|
8206
|
+
defaultColor = ColorHelper();
|
|
8207
|
+
}
|
|
8208
|
+
return defaultColor.rgb().string();
|
|
8209
|
+
}
|
|
8210
|
+
const [swatch] = (_b = (_a = result.data) == null ? void 0 : _a.swatches) != null ? _b : [null];
|
|
8211
|
+
return ColorHelper({ h: swatch == null ? void 0 : swatch.hue, s: swatch == null ? void 0 : swatch.saturation, l: swatch == null ? void 0 : swatch.lightness }).alpha(data.alpha).rgb().string();
|
|
8212
|
+
}
|
|
8213
|
+
function useImageControlValue(data) {
|
|
8214
|
+
var _a;
|
|
8215
|
+
return (_a = useFile(data)) == null ? void 0 : _a.publicUrl;
|
|
8216
|
+
}
|
|
8217
|
+
function ListControlValue({
|
|
8218
|
+
definition,
|
|
8219
|
+
data,
|
|
8220
|
+
children
|
|
8221
|
+
}) {
|
|
8222
|
+
return (data != null ? data : []).reduce((renderFn, item) => (listControlValue) => /* @__PURE__ */ jsx(ControlValue, {
|
|
8223
|
+
definition: definition.config.type,
|
|
8224
|
+
data: item.value,
|
|
8225
|
+
children: (value) => renderFn([value, ...listControlValue])
|
|
8226
|
+
}), children)([]);
|
|
8227
|
+
}
|
|
8228
|
+
function useNumber(numberControlData, controlDefinition) {
|
|
8229
|
+
return numberControlData != null ? numberControlData : controlDefinition.config.defaultValue;
|
|
8230
|
+
}
|
|
8231
|
+
function useSelectControlValue(data, definition) {
|
|
8232
|
+
return data != null ? data : definition == null ? void 0 : definition.config.defaultValue;
|
|
8233
|
+
}
|
|
8234
|
+
function ShapeControlValue({
|
|
8235
|
+
definition,
|
|
8236
|
+
data,
|
|
8237
|
+
children
|
|
8238
|
+
}) {
|
|
8239
|
+
return Object.entries(definition.config.type).reduce((renderFn, [key, controlDefinition]) => (shapeControlValue) => /* @__PURE__ */ jsx(ControlValue, {
|
|
8240
|
+
definition: controlDefinition,
|
|
8241
|
+
data: data == null ? void 0 : data[key],
|
|
8242
|
+
children: (value) => renderFn(__spreadProps(__spreadValues({}, shapeControlValue), {
|
|
8243
|
+
[key]: value
|
|
8244
|
+
}))
|
|
8245
|
+
}), children)({});
|
|
8246
|
+
}
|
|
8247
|
+
function useTextAreaValue(data, definition) {
|
|
8248
|
+
return data != null ? data : definition.config.defaultValue;
|
|
8249
|
+
}
|
|
8250
|
+
function useTextInputValue(data, definition) {
|
|
8251
|
+
return data != null ? data : definition.config.defaultValue;
|
|
8252
|
+
}
|
|
8253
|
+
function ControlValue({
|
|
8254
|
+
data,
|
|
8255
|
+
definition,
|
|
8256
|
+
children
|
|
8257
|
+
}) {
|
|
8258
|
+
switch (definition.type) {
|
|
8259
|
+
case CheckboxControlType:
|
|
8260
|
+
return /* @__PURE__ */ jsx(RenderHook, {
|
|
8261
|
+
hook: useCheckboxControlValue,
|
|
8262
|
+
parameters: [data, definition],
|
|
8263
|
+
children: (value) => children(value)
|
|
8264
|
+
}, definition.type);
|
|
8265
|
+
case NumberControlType:
|
|
8266
|
+
return /* @__PURE__ */ jsx(RenderHook, {
|
|
8267
|
+
hook: useNumber,
|
|
8268
|
+
parameters: [data, definition],
|
|
8269
|
+
children: (value) => children(value)
|
|
8270
|
+
}, definition.type);
|
|
8271
|
+
case TextInputControlType:
|
|
8272
|
+
return /* @__PURE__ */ jsx(RenderHook, {
|
|
8273
|
+
hook: useTextInputValue,
|
|
8274
|
+
parameters: [data, definition],
|
|
8275
|
+
children: (value) => children(value)
|
|
8276
|
+
}, definition.type);
|
|
8277
|
+
case TextAreaControlType:
|
|
8278
|
+
return /* @__PURE__ */ jsx(RenderHook, {
|
|
8279
|
+
hook: useTextAreaValue,
|
|
8280
|
+
parameters: [data, definition],
|
|
8281
|
+
children: (value) => children(value)
|
|
8282
|
+
}, definition.type);
|
|
8283
|
+
case SelectControlType:
|
|
8284
|
+
return /* @__PURE__ */ jsx(RenderHook, {
|
|
8285
|
+
hook: useSelectControlValue,
|
|
8286
|
+
parameters: [data, definition],
|
|
8287
|
+
children: (value) => children(value)
|
|
8288
|
+
}, definition.type);
|
|
8289
|
+
case ColorControlType:
|
|
8290
|
+
return /* @__PURE__ */ jsx(RenderHook, {
|
|
8291
|
+
hook: useColorValue,
|
|
8292
|
+
parameters: [data, definition],
|
|
8293
|
+
children: (value) => children(value)
|
|
8294
|
+
}, definition.type);
|
|
8295
|
+
case ImageControlType:
|
|
8296
|
+
return /* @__PURE__ */ jsx(RenderHook, {
|
|
8297
|
+
hook: useImageControlValue,
|
|
8298
|
+
parameters: [data],
|
|
8299
|
+
children: (value) => children(value)
|
|
8300
|
+
}, definition.type);
|
|
8301
|
+
case ShapeControlType:
|
|
8302
|
+
return /* @__PURE__ */ jsx(ShapeControlValue, {
|
|
8303
|
+
definition,
|
|
8304
|
+
data,
|
|
8305
|
+
children: (value) => children(value)
|
|
8306
|
+
});
|
|
8307
|
+
case ListControlType:
|
|
8308
|
+
return /* @__PURE__ */ jsx(ListControlValue, {
|
|
8309
|
+
definition,
|
|
8310
|
+
data,
|
|
8311
|
+
children: (value) => children(value)
|
|
8312
|
+
});
|
|
8313
|
+
default:
|
|
8314
|
+
return children(data);
|
|
8315
|
+
}
|
|
8316
|
+
}
|
|
8179
8317
|
function useDeviceMode() {
|
|
8180
8318
|
return "desktop";
|
|
8181
8319
|
}
|
|
@@ -8184,28 +8322,62 @@ function useWidth(value, descriptor, props) {
|
|
|
8184
8322
|
const options = useMemo(() => typeof descriptor.options === "function" ? descriptor.options(props, deviceMode) : descriptor.options, [props, deviceMode]);
|
|
8185
8323
|
return useMemo(() => options.format === WidthControlValueFormats.ClassName ? css$1(responsiveWidth(value, options.defaultValue)) : value, [value, options.defaultValue, options.format]);
|
|
8186
8324
|
}
|
|
8187
|
-
function
|
|
8188
|
-
|
|
8189
|
-
|
|
8190
|
-
|
|
8325
|
+
function PropsValue({
|
|
8326
|
+
element,
|
|
8327
|
+
children
|
|
8328
|
+
}) {
|
|
8191
8329
|
var _a;
|
|
8192
8330
|
const store = useStore();
|
|
8193
8331
|
const propControllerDescriptorsRef = useRef((_a = getComponentPropControllerDescriptors(store.getState(), element.type)) != null ? _a : {});
|
|
8194
8332
|
const props = element.props;
|
|
8195
|
-
return Object.
|
|
8333
|
+
return Object.entries(propControllerDescriptorsRef.current).reduceRight((renderFn, [propName, descriptor]) => (propsValue) => {
|
|
8196
8334
|
switch (descriptor.type) {
|
|
8197
|
-
case
|
|
8198
|
-
|
|
8199
|
-
|
|
8200
|
-
|
|
8201
|
-
case
|
|
8202
|
-
|
|
8335
|
+
case CheckboxControlType:
|
|
8336
|
+
case NumberControlType:
|
|
8337
|
+
case TextInputControlType:
|
|
8338
|
+
case TextAreaControlType:
|
|
8339
|
+
case SelectControlType:
|
|
8340
|
+
case ColorControlType:
|
|
8341
|
+
case ImageControlType:
|
|
8342
|
+
case ShapeControlType:
|
|
8343
|
+
case ListControlType:
|
|
8344
|
+
return /* @__PURE__ */ jsx(ControlValue, {
|
|
8345
|
+
definition: descriptor,
|
|
8346
|
+
data: props[propName],
|
|
8347
|
+
children: (value) => renderFn(__spreadProps(__spreadValues({}, propsValue), {
|
|
8348
|
+
[propName]: value
|
|
8349
|
+
}))
|
|
8350
|
+
});
|
|
8203
8351
|
case StyleControlType:
|
|
8204
|
-
return
|
|
8352
|
+
return /* @__PURE__ */ jsx(RenderHook, {
|
|
8353
|
+
hook: useFormattedStyle,
|
|
8354
|
+
parameters: [props[propName], descriptor],
|
|
8355
|
+
children: (value) => renderFn(__spreadProps(__spreadValues({}, propsValue), {
|
|
8356
|
+
[propName]: value
|
|
8357
|
+
}))
|
|
8358
|
+
}, descriptor.type);
|
|
8359
|
+
case Types.Width:
|
|
8360
|
+
return /* @__PURE__ */ jsx(RenderHook, {
|
|
8361
|
+
hook: useWidth,
|
|
8362
|
+
parameters: [props[propName], descriptor, props],
|
|
8363
|
+
children: (value) => renderFn(__spreadProps(__spreadValues({}, propsValue), {
|
|
8364
|
+
[propName]: value
|
|
8365
|
+
}))
|
|
8366
|
+
}, descriptor.type);
|
|
8367
|
+
case Types.ResponsiveColor:
|
|
8368
|
+
return /* @__PURE__ */ jsx(RenderHook, {
|
|
8369
|
+
hook: useResponsiveColor,
|
|
8370
|
+
parameters: [props[propName]],
|
|
8371
|
+
children: (value) => renderFn(__spreadProps(__spreadValues({}, propsValue), {
|
|
8372
|
+
[propName]: value
|
|
8373
|
+
}))
|
|
8374
|
+
}, descriptor.type);
|
|
8205
8375
|
default:
|
|
8206
|
-
return
|
|
8376
|
+
return renderFn(__spreadProps(__spreadValues({}, propsValue), {
|
|
8377
|
+
[propName]: props[propName]
|
|
8378
|
+
}));
|
|
8207
8379
|
}
|
|
8208
|
-
}));
|
|
8380
|
+
}, children)({});
|
|
8209
8381
|
}
|
|
8210
8382
|
function suppressWarningAndFindDomNode(instance) {
|
|
8211
8383
|
const error = console.error;
|
|
@@ -8385,7 +8557,6 @@ const ElementData = memo(forwardRef(function ElementData2({
|
|
|
8385
8557
|
elementData
|
|
8386
8558
|
}, ref) {
|
|
8387
8559
|
const Component2 = useComponent(elementData.type);
|
|
8388
|
-
const props = useProps(elementData);
|
|
8389
8560
|
const [handle, setHandle] = useState(null);
|
|
8390
8561
|
const [foundDomNode, setFoundDomNode] = useState(null);
|
|
8391
8562
|
useImperativeHandle(ref, () => handle != null ? handle : foundDomNode, [handle, foundDomNode]);
|
|
@@ -8398,10 +8569,13 @@ const ElementData = memo(forwardRef(function ElementData2({
|
|
|
8398
8569
|
}
|
|
8399
8570
|
return /* @__PURE__ */ jsx(FindDomNode, {
|
|
8400
8571
|
ref: setFoundDomNode,
|
|
8401
|
-
children: /* @__PURE__ */
|
|
8402
|
-
|
|
8403
|
-
|
|
8404
|
-
|
|
8572
|
+
children: /* @__PURE__ */ jsx(PropsValue, {
|
|
8573
|
+
element: elementData,
|
|
8574
|
+
children: (props) => /* @__PURE__ */ createElement(Component2, __spreadProps(__spreadValues({}, props), {
|
|
8575
|
+
key: elementData.key,
|
|
8576
|
+
ref: setHandle
|
|
8577
|
+
}))
|
|
8578
|
+
})
|
|
8405
8579
|
});
|
|
8406
8580
|
}));
|
|
8407
8581
|
const ElementReference = memo(forwardRef(function ElementReference2({
|
|
@@ -8497,5 +8671,5 @@ const DocumentReference = memo(forwardRef(function DocumentReference2({
|
|
|
8497
8671
|
document
|
|
8498
8672
|
});
|
|
8499
8673
|
}));
|
|
8500
|
-
export { useBackgrounds as A, Box as B, Carousel as C, DocumentReference as D, Element$1 as E, Form as F, useBorder as G, useBoxShadow as H, ImageComponent as I,
|
|
8674
|
+
export { useBackgrounds as A, Box as B, Carousel as C, DocumentReference as D, Element$1 as E, Form as F, useBorder as G, useBoxShadow as H, ImageComponent as I, useResponsiveColor as J, useFile as K, useMediaQuery as L, usePage as M, Navigation as N, useTable as O, PageProvider as P, MakeswiftClient as Q, RuntimeProvider as R, SocialLinks as S, Text as T, ReactRuntime as a, usePageId as b, Button$1 as c, Countdown as d, Divider as e, Embed as f, Root as g, registerComponent$c as h, DEFAULT_BOX_ANIMATE_TYPE as i, DEFAULT_BOX_ANIMATE_DELAY as j, DEFAULT_BOX_ANIMATE_DURATION as k, DEFAULT_ITEM_ANIMATE_TYPE as l, DEFAULT_ITEM_ANIMATE_DELAY as m, DEFAULT_ITEM_ANIMATE_DURATION as n, DEFAULT_ITEM_STAGGER_DURATION as o, cssMediaRules as p, cssWidth as q, registerBuiltinComponents as r, cssMargin as s, cssPadding as t, useIsInBuilder as u, cssBorder as v, cssBorderRadius as w, cssBoxShadow as x, cssGridItem as y, cssTextStyle as z };
|
|
8501
8675
|
//# sourceMappingURL=index.es.js.map
|