@makeswift/runtime 0.1.9 → 0.1.10
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 +2 -3
- package/dist/Box.cjs.js.map +1 -1
- package/dist/Box.es.js +2 -3
- package/dist/Box.es.js.map +1 -1
- package/dist/Button.cjs.js +4 -3
- package/dist/Button.cjs.js.map +1 -1
- package/dist/Button.es.js +4 -3
- package/dist/Button.es.js.map +1 -1
- package/dist/Carousel.cjs.js +4 -3
- package/dist/Carousel.cjs.js.map +1 -1
- package/dist/Carousel.es.js +4 -3
- package/dist/Carousel.es.js.map +1 -1
- package/dist/Countdown.cjs.js +4 -3
- package/dist/Countdown.cjs.js.map +1 -1
- package/dist/Countdown.es.js +4 -3
- package/dist/Countdown.es.js.map +1 -1
- package/dist/Divider.cjs.js +4 -3
- package/dist/Divider.cjs.js.map +1 -1
- package/dist/Divider.es.js +4 -3
- package/dist/Divider.es.js.map +1 -1
- package/dist/Embed.cjs.js +4 -3
- package/dist/Embed.cjs.js.map +1 -1
- package/dist/Embed.es.js +4 -3
- package/dist/Embed.es.js.map +1 -1
- package/dist/Form.cjs.js +3 -4
- package/dist/Form.cjs.js.map +1 -1
- package/dist/Form.es.js +3 -4
- package/dist/Form.es.js.map +1 -1
- package/dist/Image.cjs2.js +4 -3
- package/dist/Image.cjs2.js.map +1 -1
- package/dist/Image.es2.js +4 -3
- package/dist/Image.es2.js.map +1 -1
- package/dist/Navigation.cjs.js +4 -3
- package/dist/Navigation.cjs.js.map +1 -1
- package/dist/Navigation.es.js +4 -3
- package/dist/Navigation.es.js.map +1 -1
- package/dist/Root.cjs.js +4 -3
- package/dist/Root.cjs.js.map +1 -1
- package/dist/Root.es.js +4 -3
- package/dist/Root.es.js.map +1 -1
- package/dist/SocialLinks.cjs.js +4 -3
- package/dist/SocialLinks.cjs.js.map +1 -1
- package/dist/SocialLinks.es.js +4 -3
- package/dist/SocialLinks.es.js.map +1 -1
- package/dist/Text.cjs.js +2 -3
- package/dist/Text.cjs.js.map +1 -1
- package/dist/Text.es.js +2 -3
- package/dist/Text.es.js.map +1 -1
- package/dist/Video.cjs.js +4 -3
- package/dist/Video.cjs.js.map +1 -1
- package/dist/Video.es.js +4 -3
- package/dist/Video.es.js.map +1 -1
- package/dist/actions.es.js +1 -1
- package/dist/builder.cjs.js +0 -2
- package/dist/builder.cjs.js.map +1 -1
- package/dist/builder.es.js +0 -2
- package/dist/builder.es.js.map +1 -1
- package/dist/components.cjs.js +2 -3
- package/dist/components.cjs.js.map +1 -1
- package/dist/components.es.js +2 -3
- package/dist/components.es.js.map +1 -1
- package/dist/control-serialization.cjs.js +37 -39
- package/dist/control-serialization.cjs.js.map +1 -1
- package/dist/control-serialization.es.js +1 -3
- package/dist/control-serialization.es.js.map +1 -1
- package/dist/controls.cjs.js +9 -5
- package/dist/controls.cjs.js.map +1 -1
- package/dist/controls.es.js +2 -2
- package/dist/cssMediaRules.cjs.js +1 -13
- package/dist/cssMediaRules.cjs.js.map +1 -1
- package/dist/cssMediaRules.es.js +1 -13
- package/dist/cssMediaRules.es.js.map +1 -1
- package/dist/image.cjs.js +269 -1
- package/dist/image.cjs.js.map +1 -1
- package/dist/image.es.js +230 -1
- package/dist/image.es.js.map +1 -1
- package/dist/index.cjs.js +382 -187
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +212 -18
- package/dist/index.es.js.map +1 -1
- package/dist/index.es2.js +1 -1
- package/dist/index.es3.js +1 -1
- package/dist/main.cjs.js +2 -3
- package/dist/main.cjs.js.map +1 -1
- package/dist/main.es.js +2 -3
- package/dist/main.es.js.map +1 -1
- package/dist/next.cjs.js +4 -3
- package/dist/next.cjs.js.map +1 -1
- package/dist/next.es.js +5 -4
- package/dist/next.es.js.map +1 -1
- package/dist/prop-controllers.cjs.js +5 -6
- package/dist/prop-controllers.cjs.js.map +1 -1
- package/dist/prop-controllers.es.js +2 -3
- package/dist/prop-controllers.es.js.map +1 -1
- package/dist/react-builder-preview.cjs.js +21 -78
- package/dist/react-builder-preview.cjs.js.map +1 -1
- package/dist/react-builder-preview.es.js +28 -85
- package/dist/react-builder-preview.es.js.map +1 -1
- package/dist/react-page.cjs.js +110 -45
- package/dist/react-page.cjs.js.map +1 -1
- package/dist/react-page.es.js +77 -17
- package/dist/react-page.es.js.map +1 -1
- package/dist/react.cjs.js +4 -3
- package/dist/react.cjs.js.map +1 -1
- package/dist/react.es.js +4 -3
- package/dist/react.es.js.map +1 -1
- package/dist/{instances.cjs.js → slot.cjs.js} +28 -4
- package/dist/slot.cjs.js.map +1 -0
- package/dist/{instances.es.js → slot.es.js} +23 -3
- package/dist/slot.es.js.map +1 -0
- package/dist/types/box-model.d.ts +1 -1
- package/dist/types/box-model.d.ts.map +1 -1
- package/dist/types/controls/index.d.ts +1 -0
- package/dist/types/controls/index.d.ts.map +1 -1
- package/dist/types/controls/slot.d.ts +42 -0
- package/dist/types/controls/slot.d.ts.map +1 -0
- package/dist/types/prop-controllers/descriptors.d.ts +2 -2
- package/dist/types/prop-controllers/descriptors.d.ts.map +1 -1
- package/dist/types/prop-controllers/instances.d.ts +3 -2
- package/dist/types/prop-controllers/instances.d.ts.map +1 -1
- package/dist/types/prop-controllers/introspection.d.ts.map +1 -1
- package/dist/types/runtimes/react/controls/slot.d.ts +30 -0
- package/dist/types/runtimes/react/controls/slot.d.ts.map +1 -0
- package/dist/types/runtimes/react/controls/style.d.ts.map +1 -1
- package/dist/types/runtimes/react/controls.d.ts.map +1 -1
- package/dist/types/runtimes/react/index.d.ts +4 -0
- package/dist/types/runtimes/react/index.d.ts.map +1 -1
- package/dist/types/runtimes/react/use-style.d.ts +3 -0
- package/dist/types/runtimes/react/use-style.d.ts.map +1 -0
- package/dist/types/state/modules/prop-controller-handles.d.ts +1 -0
- package/dist/types/state/modules/prop-controller-handles.d.ts.map +1 -1
- package/dist/types/state/react-builder-preview.d.ts.map +1 -1
- package/dist/types/state/react-page.d.ts +3 -0
- package/dist/types/state/react-page.d.ts.map +1 -1
- package/dist/useBoxShadow.es.js +1 -1
- package/package.json +2 -2
- package/dist/descriptors.cjs.js +0 -232
- package/dist/descriptors.cjs.js.map +0 -1
- package/dist/descriptors.es.js +0 -196
- package/dist/descriptors.es.js.map +0 -1
- package/dist/instances.cjs.js.map +0 -1
- package/dist/instances.es.js.map +0 -1
- package/dist/style.cjs.js +0 -41
- package/dist/style.cjs.js.map +0 -1
- package/dist/style.es.js +0 -38
- package/dist/style.es.js.map +0 -1
package/dist/index.cjs.js
CHANGED
|
@@ -50,14 +50,14 @@ var client = require("@apollo/client");
|
|
|
50
50
|
var batchHttp = require("@apollo/client/link/batch-http");
|
|
51
51
|
var graphql = require("./graphql.cjs.js");
|
|
52
52
|
var jsxRuntime = require("react/jsx-runtime");
|
|
53
|
-
var
|
|
53
|
+
var image = require("./image.cjs.js");
|
|
54
54
|
var textInput = require("./text-input.cjs.js");
|
|
55
55
|
var color = require("./color.cjs.js");
|
|
56
56
|
var shape = require("./shape.cjs.js");
|
|
57
|
-
var
|
|
58
|
-
var style = require("./style.cjs.js");
|
|
57
|
+
var slot = require("./slot.cjs.js");
|
|
59
58
|
var ColorHelper = require("color");
|
|
60
59
|
var scrollIntoView = require("scroll-into-view-if-needed");
|
|
60
|
+
var boxModels = require("./box-models.cjs.js");
|
|
61
61
|
var reactDom = require("react-dom");
|
|
62
62
|
var parse = require("html-react-parser");
|
|
63
63
|
var Head = require("next/head");
|
|
@@ -273,7 +273,7 @@ const INTROSPECTION_QUERY = client.gql`
|
|
|
273
273
|
`;
|
|
274
274
|
async function introspect(element, client2, store) {
|
|
275
275
|
var _a, _b, _c;
|
|
276
|
-
const descriptors
|
|
276
|
+
const descriptors = reactPage.getPropControllerDescriptors(store.getState());
|
|
277
277
|
const swatchIds = /* @__PURE__ */ new Set();
|
|
278
278
|
const fileIds = /* @__PURE__ */ new Set();
|
|
279
279
|
const typographyIds = /* @__PURE__ */ new Set();
|
|
@@ -306,13 +306,13 @@ async function introspect(element, client2, store) {
|
|
|
306
306
|
getResourcesFromElementDescriptors({ propName: descriptor.config.type }, { propName: item.value });
|
|
307
307
|
});
|
|
308
308
|
}
|
|
309
|
-
if (descriptor.type ===
|
|
309
|
+
if (descriptor.type === image.Types.Shape) {
|
|
310
310
|
const prop = props[propName];
|
|
311
311
|
if (prop == null)
|
|
312
312
|
return;
|
|
313
313
|
getResourcesFromElementDescriptors(descriptor.options.type, prop);
|
|
314
314
|
}
|
|
315
|
-
if (descriptor.type ===
|
|
315
|
+
if (descriptor.type === image.Types.List) {
|
|
316
316
|
const prop = props[propName];
|
|
317
317
|
if (prop == null)
|
|
318
318
|
return;
|
|
@@ -335,7 +335,7 @@ async function introspect(element, client2, store) {
|
|
|
335
335
|
} else {
|
|
336
336
|
element2 = current;
|
|
337
337
|
}
|
|
338
|
-
const elementDescriptors = descriptors
|
|
338
|
+
const elementDescriptors = descriptors.get(element2.type);
|
|
339
339
|
if (elementDescriptors == null)
|
|
340
340
|
continue;
|
|
341
341
|
getResourcesFromElementDescriptors(elementDescriptors, element2.props);
|
|
@@ -345,9 +345,9 @@ async function introspect(element, client2, store) {
|
|
|
345
345
|
variables: { ids: [...typographyIds] }
|
|
346
346
|
});
|
|
347
347
|
(_c = typographiesResult == null ? void 0 : typographiesResult.data) == null ? void 0 : _c.typographies.forEach((typography) => {
|
|
348
|
-
typography == null ? void 0 : typography.style.forEach((
|
|
348
|
+
typography == null ? void 0 : typography.style.forEach((style) => {
|
|
349
349
|
var _a2;
|
|
350
|
-
const swatchId = (_a2 =
|
|
350
|
+
const swatchId = (_a2 = style.value.color) == null ? void 0 : _a2.swatchId;
|
|
351
351
|
if (swatchId != null)
|
|
352
352
|
swatchIds.add(swatchId);
|
|
353
353
|
});
|
|
@@ -1127,10 +1127,10 @@ function registerComponent$c(runtime) {
|
|
|
1127
1127
|
type: "./components/Box/index.js",
|
|
1128
1128
|
label: "Box",
|
|
1129
1129
|
props: {
|
|
1130
|
-
id:
|
|
1131
|
-
backgrounds:
|
|
1132
|
-
width:
|
|
1133
|
-
height:
|
|
1130
|
+
id: image.ElementID(),
|
|
1131
|
+
backgrounds: image.Backgrounds(),
|
|
1132
|
+
width: image.Width(),
|
|
1133
|
+
height: image.ResponsiveIconRadioGroup({
|
|
1134
1134
|
label: "Height",
|
|
1135
1135
|
options: [
|
|
1136
1136
|
{ value: "auto", label: "Auto", icon: "HeightAuto16" },
|
|
@@ -1138,7 +1138,7 @@ function registerComponent$c(runtime) {
|
|
|
1138
1138
|
],
|
|
1139
1139
|
defaultValue: "auto"
|
|
1140
1140
|
}),
|
|
1141
|
-
verticalAlign:
|
|
1141
|
+
verticalAlign: image.ResponsiveIconRadioGroup({
|
|
1142
1142
|
label: "Align items",
|
|
1143
1143
|
options: [
|
|
1144
1144
|
{ value: "flex-start", label: "Top", icon: "VerticalAlignStart16" },
|
|
@@ -1152,8 +1152,8 @@ function registerComponent$c(runtime) {
|
|
|
1152
1152
|
],
|
|
1153
1153
|
defaultValue: "flex-start"
|
|
1154
1154
|
}),
|
|
1155
|
-
margin:
|
|
1156
|
-
padding:
|
|
1155
|
+
margin: image.Margin(),
|
|
1156
|
+
padding: image.Padding({
|
|
1157
1157
|
preset: [
|
|
1158
1158
|
{
|
|
1159
1159
|
deviceId: "desktop",
|
|
@@ -1166,16 +1166,16 @@ function registerComponent$c(runtime) {
|
|
|
1166
1166
|
}
|
|
1167
1167
|
]
|
|
1168
1168
|
}),
|
|
1169
|
-
border:
|
|
1170
|
-
borderRadius:
|
|
1171
|
-
boxShadow:
|
|
1172
|
-
rowGap:
|
|
1169
|
+
border: image.Border(),
|
|
1170
|
+
borderRadius: image.BorderRadius(),
|
|
1171
|
+
boxShadow: image.Shadows(),
|
|
1172
|
+
rowGap: image.GapY((props) => ({
|
|
1173
1173
|
hidden: props.children == null
|
|
1174
1174
|
})),
|
|
1175
|
-
columnGap:
|
|
1175
|
+
columnGap: image.GapX((props) => ({
|
|
1176
1176
|
hidden: props.children == null
|
|
1177
1177
|
})),
|
|
1178
|
-
boxAnimateType:
|
|
1178
|
+
boxAnimateType: image.ResponsiveSelect({
|
|
1179
1179
|
label: "Animate box in",
|
|
1180
1180
|
labelOrientation: "vertical",
|
|
1181
1181
|
options: [
|
|
@@ -1191,7 +1191,7 @@ function registerComponent$c(runtime) {
|
|
|
1191
1191
|
],
|
|
1192
1192
|
defaultValue: "none"
|
|
1193
1193
|
}),
|
|
1194
|
-
boxAnimateDuration:
|
|
1194
|
+
boxAnimateDuration: image.ResponsiveNumber((props, device) => ({
|
|
1195
1195
|
label: "Box duration",
|
|
1196
1196
|
defaultValue: DEFAULT_BOX_ANIMATE_DURATION,
|
|
1197
1197
|
min: 0.1,
|
|
@@ -1199,7 +1199,7 @@ function registerComponent$c(runtime) {
|
|
|
1199
1199
|
suffix: "s",
|
|
1200
1200
|
hidden: isHiddenBasedOnBoxAnimation(props, device)
|
|
1201
1201
|
})),
|
|
1202
|
-
boxAnimateDelay:
|
|
1202
|
+
boxAnimateDelay: image.ResponsiveNumber((props, device) => ({
|
|
1203
1203
|
label: "Box delay",
|
|
1204
1204
|
defaultValue: DEFAULT_BOX_ANIMATE_DELAY,
|
|
1205
1205
|
min: 0,
|
|
@@ -1207,7 +1207,7 @@ function registerComponent$c(runtime) {
|
|
|
1207
1207
|
suffix: "s",
|
|
1208
1208
|
hidden: isHiddenBasedOnBoxAnimation(props, device)
|
|
1209
1209
|
})),
|
|
1210
|
-
itemAnimateType:
|
|
1210
|
+
itemAnimateType: image.ResponsiveSelect({
|
|
1211
1211
|
label: "Animate items in",
|
|
1212
1212
|
labelOrientation: "vertical",
|
|
1213
1213
|
options: [
|
|
@@ -1223,7 +1223,7 @@ function registerComponent$c(runtime) {
|
|
|
1223
1223
|
],
|
|
1224
1224
|
defaultValue: "none"
|
|
1225
1225
|
}),
|
|
1226
|
-
itemAnimateDuration:
|
|
1226
|
+
itemAnimateDuration: image.ResponsiveNumber((props, device) => ({
|
|
1227
1227
|
label: "Items duration",
|
|
1228
1228
|
defaultValue: DEFAULT_BOX_ANIMATE_DURATION,
|
|
1229
1229
|
min: 0.1,
|
|
@@ -1231,7 +1231,7 @@ function registerComponent$c(runtime) {
|
|
|
1231
1231
|
suffix: "s",
|
|
1232
1232
|
hidden: isHiddenBasedOnItemAnimation(props, device)
|
|
1233
1233
|
})),
|
|
1234
|
-
itemAnimateDelay:
|
|
1234
|
+
itemAnimateDelay: image.ResponsiveNumber((props, device) => ({
|
|
1235
1235
|
label: "Items delay",
|
|
1236
1236
|
defaultValue: DEFAULT_ITEM_ANIMATE_DELAY,
|
|
1237
1237
|
min: 0,
|
|
@@ -1239,7 +1239,7 @@ function registerComponent$c(runtime) {
|
|
|
1239
1239
|
suffix: "s",
|
|
1240
1240
|
hidden: isHiddenBasedOnItemAnimation(props, device)
|
|
1241
1241
|
})),
|
|
1242
|
-
itemStaggerDuration:
|
|
1242
|
+
itemStaggerDuration: image.ResponsiveNumber((props, device) => ({
|
|
1243
1243
|
label: "Stagger",
|
|
1244
1244
|
min: 0,
|
|
1245
1245
|
step: 0.05,
|
|
@@ -1247,11 +1247,11 @@ function registerComponent$c(runtime) {
|
|
|
1247
1247
|
defaultValue: DEFAULT_ITEM_STAGGER_DURATION,
|
|
1248
1248
|
hidden: isHiddenBasedOnItemAnimation(props, device)
|
|
1249
1249
|
})),
|
|
1250
|
-
hidePlaceholder:
|
|
1250
|
+
hidePlaceholder: image.Checkbox((props) => ({
|
|
1251
1251
|
label: "Hide placeholder",
|
|
1252
1252
|
hidden: props.children != null
|
|
1253
1253
|
})),
|
|
1254
|
-
children:
|
|
1254
|
+
children: image.Grid()
|
|
1255
1255
|
}
|
|
1256
1256
|
});
|
|
1257
1257
|
}
|
|
@@ -1262,9 +1262,9 @@ function registerComponent$b(runtime) {
|
|
|
1262
1262
|
type: "./components/Button/index.js",
|
|
1263
1263
|
label: "Button",
|
|
1264
1264
|
props: {
|
|
1265
|
-
id:
|
|
1266
|
-
children:
|
|
1267
|
-
link:
|
|
1265
|
+
id: image.ElementID(),
|
|
1266
|
+
children: image.TextInput({ placeholder: "Button text" }),
|
|
1267
|
+
link: image.Link({
|
|
1268
1268
|
defaultValue: {
|
|
1269
1269
|
type: "OPEN_PAGE",
|
|
1270
1270
|
payload: {
|
|
@@ -1273,7 +1273,7 @@ function registerComponent$b(runtime) {
|
|
|
1273
1273
|
}
|
|
1274
1274
|
}
|
|
1275
1275
|
}),
|
|
1276
|
-
variant:
|
|
1276
|
+
variant: image.ResponsiveSelect({
|
|
1277
1277
|
label: "Style",
|
|
1278
1278
|
labelOrientation: "horizontal",
|
|
1279
1279
|
options: [
|
|
@@ -1287,7 +1287,7 @@ function registerComponent$b(runtime) {
|
|
|
1287
1287
|
],
|
|
1288
1288
|
defaultValue: "flat"
|
|
1289
1289
|
}),
|
|
1290
|
-
shape:
|
|
1290
|
+
shape: image.ResponsiveIconRadioGroup({
|
|
1291
1291
|
label: "Shape",
|
|
1292
1292
|
options: [
|
|
1293
1293
|
{ label: "Pill", value: "pill", icon: "ButtonPill16" },
|
|
@@ -1296,7 +1296,7 @@ function registerComponent$b(runtime) {
|
|
|
1296
1296
|
],
|
|
1297
1297
|
defaultValue: "rounded"
|
|
1298
1298
|
}),
|
|
1299
|
-
size:
|
|
1299
|
+
size: image.ResponsiveIconRadioGroup({
|
|
1300
1300
|
label: "Size",
|
|
1301
1301
|
options: [
|
|
1302
1302
|
{ label: "Small", value: "small", icon: "SizeSmall16" },
|
|
@@ -1305,19 +1305,19 @@ function registerComponent$b(runtime) {
|
|
|
1305
1305
|
],
|
|
1306
1306
|
defaultValue: "medium"
|
|
1307
1307
|
}),
|
|
1308
|
-
color:
|
|
1308
|
+
color: image.ResponsiveColor((props, device) => {
|
|
1309
1309
|
var _a;
|
|
1310
1310
|
const variant = props.variant;
|
|
1311
1311
|
const hidden = ((_a = findDeviceOverride(variant, device)) == null ? void 0 : _a.value) === "clear";
|
|
1312
1312
|
return { placeholder: "black", hidden };
|
|
1313
1313
|
}),
|
|
1314
|
-
textColor:
|
|
1314
|
+
textColor: image.ResponsiveColor({
|
|
1315
1315
|
label: "Text color",
|
|
1316
1316
|
placeholder: "white"
|
|
1317
1317
|
}),
|
|
1318
|
-
textStyle:
|
|
1319
|
-
width:
|
|
1320
|
-
margin:
|
|
1318
|
+
textStyle: image.TextStyle(),
|
|
1319
|
+
width: image.Width(),
|
|
1320
|
+
margin: image.Margin()
|
|
1321
1321
|
}
|
|
1322
1322
|
});
|
|
1323
1323
|
}
|
|
@@ -1329,17 +1329,17 @@ function registerComponent$a(runtime) {
|
|
|
1329
1329
|
label: "Carousel",
|
|
1330
1330
|
icon: "Carousel40",
|
|
1331
1331
|
props: {
|
|
1332
|
-
id:
|
|
1333
|
-
images:
|
|
1332
|
+
id: image.ElementID(),
|
|
1333
|
+
images: image.Images({
|
|
1334
1334
|
preset: [
|
|
1335
1335
|
{ key: uuid__default["default"](), props: {} },
|
|
1336
1336
|
{ key: uuid__default["default"](), props: {} },
|
|
1337
1337
|
{ key: uuid__default["default"](), props: {} }
|
|
1338
1338
|
]
|
|
1339
1339
|
}),
|
|
1340
|
-
width:
|
|
1341
|
-
margin:
|
|
1342
|
-
pageSize:
|
|
1340
|
+
width: image.Width({ defaultValue: { value: 400, unit: "px" } }),
|
|
1341
|
+
margin: image.Margin(),
|
|
1342
|
+
pageSize: image.ResponsiveNumber((props) => {
|
|
1343
1343
|
var _a;
|
|
1344
1344
|
const images = props.images;
|
|
1345
1345
|
const imagesLength = (_a = images == null ? void 0 : images.length) != null ? _a : 0;
|
|
@@ -1351,7 +1351,7 @@ function registerComponent$a(runtime) {
|
|
|
1351
1351
|
step: 1
|
|
1352
1352
|
};
|
|
1353
1353
|
}),
|
|
1354
|
-
step:
|
|
1354
|
+
step: image.ResponsiveNumber((props, device) => {
|
|
1355
1355
|
var _a, _b;
|
|
1356
1356
|
const pageSize = props.pageSize;
|
|
1357
1357
|
const pageSizeValue = (_b = (_a = findDeviceOverride(pageSize, device)) == null ? void 0 : _a.value) != null ? _b : 1;
|
|
@@ -1363,7 +1363,7 @@ function registerComponent$a(runtime) {
|
|
|
1363
1363
|
step: 1
|
|
1364
1364
|
};
|
|
1365
1365
|
}),
|
|
1366
|
-
slideAlignment:
|
|
1366
|
+
slideAlignment: image.ResponsiveIconRadioGroup({
|
|
1367
1367
|
label: "Alignment",
|
|
1368
1368
|
options: [
|
|
1369
1369
|
{ label: "Top", value: "flex-start", icon: "VerticalAlignStart16" },
|
|
@@ -1372,13 +1372,13 @@ function registerComponent$a(runtime) {
|
|
|
1372
1372
|
],
|
|
1373
1373
|
defaultValue: "center"
|
|
1374
1374
|
}),
|
|
1375
|
-
gap:
|
|
1375
|
+
gap: image.GapX({
|
|
1376
1376
|
label: "Gap",
|
|
1377
1377
|
step: 5,
|
|
1378
1378
|
defaultValue: { value: 0, unit: "px" }
|
|
1379
1379
|
}),
|
|
1380
|
-
autoplay:
|
|
1381
|
-
delay:
|
|
1380
|
+
autoplay: image.Checkbox({ label: "Autoplay" }),
|
|
1381
|
+
delay: image.Number((props) => ({
|
|
1382
1382
|
label: "Delay",
|
|
1383
1383
|
preset: 5,
|
|
1384
1384
|
min: 1,
|
|
@@ -1386,8 +1386,8 @@ function registerComponent$a(runtime) {
|
|
|
1386
1386
|
suffix: "seconds",
|
|
1387
1387
|
hidden: !props.autoplay
|
|
1388
1388
|
})),
|
|
1389
|
-
showArrows:
|
|
1390
|
-
arrowPosition:
|
|
1389
|
+
showArrows: image.Checkbox({ preset: true, label: "Show arrows" }),
|
|
1390
|
+
arrowPosition: image.ResponsiveIconRadioGroup((props) => ({
|
|
1391
1391
|
label: "Arrow position",
|
|
1392
1392
|
options: [
|
|
1393
1393
|
{ label: "Inside", value: "inside", icon: "ArrowInside16" },
|
|
@@ -1397,24 +1397,24 @@ function registerComponent$a(runtime) {
|
|
|
1397
1397
|
defaultValue: "inside",
|
|
1398
1398
|
hidden: props.showArrows === false
|
|
1399
1399
|
})),
|
|
1400
|
-
arrowColor:
|
|
1400
|
+
arrowColor: image.ResponsiveColor((props) => ({
|
|
1401
1401
|
label: "Arrow color",
|
|
1402
1402
|
placeholder: "black",
|
|
1403
1403
|
hidden: props.showArrows === false
|
|
1404
1404
|
})),
|
|
1405
|
-
arrowBackground:
|
|
1405
|
+
arrowBackground: image.ResponsiveColor((props) => ({
|
|
1406
1406
|
label: "Arrow background",
|
|
1407
1407
|
placeholder: "white",
|
|
1408
1408
|
hidden: props.showArrows === false
|
|
1409
1409
|
})),
|
|
1410
|
-
showDots:
|
|
1411
|
-
dotColor:
|
|
1410
|
+
showDots: image.Checkbox({ preset: true, label: "Show dots" }),
|
|
1411
|
+
dotColor: image.ResponsiveColor((props) => ({
|
|
1412
1412
|
label: "Dot color",
|
|
1413
1413
|
placeholder: "black",
|
|
1414
1414
|
hidden: props.showDots === false
|
|
1415
1415
|
})),
|
|
1416
|
-
slideBorder:
|
|
1417
|
-
slideBorderRadius:
|
|
1416
|
+
slideBorder: image.Border(),
|
|
1417
|
+
slideBorderRadius: image.BorderRadius()
|
|
1418
1418
|
}
|
|
1419
1419
|
});
|
|
1420
1420
|
}
|
|
@@ -1426,11 +1426,11 @@ function registerComponent$9(runtime) {
|
|
|
1426
1426
|
label: "Countdown",
|
|
1427
1427
|
icon: "Countdown40",
|
|
1428
1428
|
props: {
|
|
1429
|
-
id:
|
|
1430
|
-
date:
|
|
1429
|
+
id: image.ElementID(),
|
|
1430
|
+
date: image.Date(() => ({
|
|
1431
1431
|
preset: new Date(Date.now() + 1e3 * 60 * 60 * 24 * 2).toISOString()
|
|
1432
1432
|
})),
|
|
1433
|
-
variant:
|
|
1433
|
+
variant: image.ResponsiveIconRadioGroup({
|
|
1434
1434
|
label: "Style",
|
|
1435
1435
|
options: [
|
|
1436
1436
|
{ label: "Filled", value: "filled", icon: "CountdownSolid16" },
|
|
@@ -1449,7 +1449,7 @@ function registerComponent$9(runtime) {
|
|
|
1449
1449
|
],
|
|
1450
1450
|
defaultValue: "filled"
|
|
1451
1451
|
}),
|
|
1452
|
-
shape:
|
|
1452
|
+
shape: image.ResponsiveIconRadioGroup({
|
|
1453
1453
|
label: "Shape",
|
|
1454
1454
|
options: [
|
|
1455
1455
|
{ label: "Pill", value: "pill", icon: "ButtonPill16" },
|
|
@@ -1458,7 +1458,7 @@ function registerComponent$9(runtime) {
|
|
|
1458
1458
|
],
|
|
1459
1459
|
defaultValue: "rounded"
|
|
1460
1460
|
}),
|
|
1461
|
-
size:
|
|
1461
|
+
size: image.ResponsiveIconRadioGroup({
|
|
1462
1462
|
label: "Size",
|
|
1463
1463
|
options: [
|
|
1464
1464
|
{ label: "Small", value: "small", icon: "SizeSmall16" },
|
|
@@ -1467,7 +1467,7 @@ function registerComponent$9(runtime) {
|
|
|
1467
1467
|
],
|
|
1468
1468
|
defaultValue: "medium"
|
|
1469
1469
|
}),
|
|
1470
|
-
gap:
|
|
1470
|
+
gap: image.GapX({
|
|
1471
1471
|
preset: [{ deviceId: "desktop", value: { value: 10, unit: "px" } }],
|
|
1472
1472
|
label: "Gap",
|
|
1473
1473
|
step: 1,
|
|
@@ -1475,29 +1475,29 @@ function registerComponent$9(runtime) {
|
|
|
1475
1475
|
max: 100,
|
|
1476
1476
|
defaultValue: { value: 0, unit: "px" }
|
|
1477
1477
|
}),
|
|
1478
|
-
numberFont:
|
|
1479
|
-
numberColor:
|
|
1478
|
+
numberFont: image.Font({ label: "Number font" }),
|
|
1479
|
+
numberColor: image.ResponsiveColor({
|
|
1480
1480
|
label: "Number color",
|
|
1481
1481
|
placeholder: "white"
|
|
1482
1482
|
}),
|
|
1483
|
-
blockColor:
|
|
1483
|
+
blockColor: image.ResponsiveColor({
|
|
1484
1484
|
label: "Block color",
|
|
1485
1485
|
placeholder: "black"
|
|
1486
1486
|
}),
|
|
1487
|
-
labelFont:
|
|
1488
|
-
labelColor:
|
|
1487
|
+
labelFont: image.Font({ label: "Label font" }),
|
|
1488
|
+
labelColor: image.ResponsiveColor({
|
|
1489
1489
|
label: "Label color",
|
|
1490
1490
|
placeholder: "black"
|
|
1491
1491
|
}),
|
|
1492
|
-
width:
|
|
1493
|
-
margin:
|
|
1494
|
-
daysLabel:
|
|
1495
|
-
hoursLabel:
|
|
1496
|
-
minutesLabel:
|
|
1492
|
+
width: image.Width({ defaultValue: { value: 560, unit: "px" } }),
|
|
1493
|
+
margin: image.Margin(),
|
|
1494
|
+
daysLabel: image.TextInput({ label: "Days label", placeholder: "Days" }),
|
|
1495
|
+
hoursLabel: image.TextInput({ label: "Hours label", placeholder: "Hours" }),
|
|
1496
|
+
minutesLabel: image.TextInput({
|
|
1497
1497
|
label: "Minutes label",
|
|
1498
1498
|
placeholder: "Minutes"
|
|
1499
1499
|
}),
|
|
1500
|
-
secondsLabel:
|
|
1500
|
+
secondsLabel: image.TextInput({
|
|
1501
1501
|
label: "Seconds label",
|
|
1502
1502
|
placeholder: "Seconds"
|
|
1503
1503
|
})
|
|
@@ -1512,8 +1512,8 @@ function registerComponent$8(runtime) {
|
|
|
1512
1512
|
label: "Divider",
|
|
1513
1513
|
icon: "Divider40",
|
|
1514
1514
|
props: {
|
|
1515
|
-
id:
|
|
1516
|
-
variant:
|
|
1515
|
+
id: image.ElementID(),
|
|
1516
|
+
variant: image.ResponsiveSelect({
|
|
1517
1517
|
label: "Style",
|
|
1518
1518
|
labelOrientation: "horizontal",
|
|
1519
1519
|
options: [
|
|
@@ -1524,14 +1524,14 @@ function registerComponent$8(runtime) {
|
|
|
1524
1524
|
],
|
|
1525
1525
|
defaultValue: "solid"
|
|
1526
1526
|
}),
|
|
1527
|
-
thickness:
|
|
1527
|
+
thickness: image.ResponsiveLength({
|
|
1528
1528
|
label: "Height",
|
|
1529
1529
|
defaultValue: { value: 1, unit: "px" },
|
|
1530
1530
|
options: [{ value: "px", label: "Pixels", icon: "Px16" }]
|
|
1531
1531
|
}),
|
|
1532
|
-
color:
|
|
1533
|
-
width:
|
|
1534
|
-
margin:
|
|
1532
|
+
color: image.ResponsiveColor({ placeholder: "black" }),
|
|
1533
|
+
width: image.Width({ defaultValue: { value: 100, unit: "%" } }),
|
|
1534
|
+
margin: image.Margin()
|
|
1535
1535
|
}
|
|
1536
1536
|
});
|
|
1537
1537
|
}
|
|
@@ -1543,10 +1543,10 @@ function registerComponent$7(runtime) {
|
|
|
1543
1543
|
label: "Embed",
|
|
1544
1544
|
icon: "Code40",
|
|
1545
1545
|
props: {
|
|
1546
|
-
id:
|
|
1547
|
-
html:
|
|
1548
|
-
width:
|
|
1549
|
-
margin:
|
|
1546
|
+
id: image.ElementID(),
|
|
1547
|
+
html: image.TextArea({ label: "Code", rows: 20 }),
|
|
1548
|
+
width: image.Width({}),
|
|
1549
|
+
margin: image.Margin()
|
|
1550
1550
|
}
|
|
1551
1551
|
});
|
|
1552
1552
|
}
|
|
@@ -1582,10 +1582,10 @@ function registerComponent$6(runtime) {
|
|
|
1582
1582
|
label: "Form",
|
|
1583
1583
|
icon: "Form40",
|
|
1584
1584
|
props: {
|
|
1585
|
-
id:
|
|
1586
|
-
tableId:
|
|
1587
|
-
fields:
|
|
1588
|
-
submitLink:
|
|
1585
|
+
id: image.ElementID(),
|
|
1586
|
+
tableId: image.Table(),
|
|
1587
|
+
fields: image.TableFormFields(),
|
|
1588
|
+
submitLink: image.Link((props) => ({
|
|
1589
1589
|
label: "Redirect to",
|
|
1590
1590
|
options: [
|
|
1591
1591
|
{ value: "OPEN_PAGE", label: "Open page" },
|
|
@@ -1593,13 +1593,13 @@ function registerComponent$6(runtime) {
|
|
|
1593
1593
|
],
|
|
1594
1594
|
hidden: props.tableId == null
|
|
1595
1595
|
})),
|
|
1596
|
-
gap:
|
|
1596
|
+
gap: image.GapY((props) => ({
|
|
1597
1597
|
preset: [{ deviceId: "desktop", value: { value: 10, unit: "px" } }],
|
|
1598
1598
|
label: "Gap",
|
|
1599
1599
|
defaultValue: { value: 0, unit: "px" },
|
|
1600
1600
|
hidden: props.tableId == null
|
|
1601
1601
|
})),
|
|
1602
|
-
shape:
|
|
1602
|
+
shape: image.ResponsiveIconRadioGroup((props) => ({
|
|
1603
1603
|
label: "Shape",
|
|
1604
1604
|
options: [
|
|
1605
1605
|
{ label: "Pill", value: Shapes.PILL, icon: "ButtonPill16" },
|
|
@@ -1609,7 +1609,7 @@ function registerComponent$6(runtime) {
|
|
|
1609
1609
|
defaultValue: Shapes.ROUNDED,
|
|
1610
1610
|
hidden: props.tableId == null
|
|
1611
1611
|
})),
|
|
1612
|
-
size:
|
|
1612
|
+
size: image.ResponsiveIconRadioGroup((props) => ({
|
|
1613
1613
|
label: "Size",
|
|
1614
1614
|
options: [
|
|
1615
1615
|
{ label: "Small", value: Sizes.SMALL, icon: "SizeSmall16" },
|
|
@@ -1619,7 +1619,7 @@ function registerComponent$6(runtime) {
|
|
|
1619
1619
|
defaultValue: Sizes.MEDIUM,
|
|
1620
1620
|
hidden: (props == null ? void 0 : props.tableId) == null
|
|
1621
1621
|
})),
|
|
1622
|
-
contrast:
|
|
1622
|
+
contrast: image.ResponsiveIconRadioGroup((props) => ({
|
|
1623
1623
|
label: "Color",
|
|
1624
1624
|
options: [
|
|
1625
1625
|
{ label: "Light mode", value: Contrasts.LIGHT, icon: "Sun16" },
|
|
@@ -1628,8 +1628,8 @@ function registerComponent$6(runtime) {
|
|
|
1628
1628
|
defaultValue: Contrasts.LIGHT,
|
|
1629
1629
|
hidden: props.tableId == null
|
|
1630
1630
|
})),
|
|
1631
|
-
labelTextStyle:
|
|
1632
|
-
labelTextColor:
|
|
1631
|
+
labelTextStyle: image.TextStyle({ label: "Label text style" }),
|
|
1632
|
+
labelTextColor: image.ResponsiveColor((props, device) => {
|
|
1633
1633
|
const hidden = props.tableId == null;
|
|
1634
1634
|
const responsiveContrast = props.contrast;
|
|
1635
1635
|
const contrast = findDeviceOverride(responsiveContrast, device);
|
|
@@ -1639,23 +1639,23 @@ function registerComponent$6(runtime) {
|
|
|
1639
1639
|
placeholder: (contrast == null ? void 0 : contrast.value) === Contrasts.DARK ? "rgba(255,255,255,0.95)" : "rgba(0,0,0,0.8)"
|
|
1640
1640
|
};
|
|
1641
1641
|
}),
|
|
1642
|
-
submitTextStyle:
|
|
1643
|
-
brandColor:
|
|
1642
|
+
submitTextStyle: image.TextStyle({ label: "Button text style" }),
|
|
1643
|
+
brandColor: image.ResponsiveColor((props) => ({
|
|
1644
1644
|
label: "Button color",
|
|
1645
1645
|
placeholder: "black",
|
|
1646
1646
|
hidden: props.tableId == null
|
|
1647
1647
|
})),
|
|
1648
|
-
submitTextColor:
|
|
1648
|
+
submitTextColor: image.ResponsiveColor((props) => ({
|
|
1649
1649
|
label: "Button text color",
|
|
1650
1650
|
placeholder: "white",
|
|
1651
1651
|
hidden: props.tableId == null
|
|
1652
1652
|
})),
|
|
1653
|
-
submitLabel:
|
|
1653
|
+
submitLabel: image.TextInput((props) => ({
|
|
1654
1654
|
label: "Button label",
|
|
1655
1655
|
placeholder: "Submit",
|
|
1656
1656
|
hidden: props.tableId == null
|
|
1657
1657
|
})),
|
|
1658
|
-
submitVariant:
|
|
1658
|
+
submitVariant: image.ResponsiveSelect((props) => ({
|
|
1659
1659
|
label: "Button style",
|
|
1660
1660
|
options: [
|
|
1661
1661
|
{ value: "flat", label: "Flat" },
|
|
@@ -1669,11 +1669,11 @@ function registerComponent$6(runtime) {
|
|
|
1669
1669
|
defaultValue: "flat",
|
|
1670
1670
|
hidden: props.tableId == null
|
|
1671
1671
|
})),
|
|
1672
|
-
submitWidth:
|
|
1672
|
+
submitWidth: image.ResponsiveLength((props) => ({
|
|
1673
1673
|
label: "Button width",
|
|
1674
1674
|
hidden: props.tableId == null
|
|
1675
1675
|
})),
|
|
1676
|
-
submitAlignment:
|
|
1676
|
+
submitAlignment: image.ResponsiveIconRadioGroup((props) => ({
|
|
1677
1677
|
label: "Button alignment",
|
|
1678
1678
|
options: [
|
|
1679
1679
|
{ label: "Left", value: Alignments.LEFT, icon: "AlignLeft16" },
|
|
@@ -1683,11 +1683,11 @@ function registerComponent$6(runtime) {
|
|
|
1683
1683
|
defaultValue: Alignments.CENTER,
|
|
1684
1684
|
hidden: props.tableId == null
|
|
1685
1685
|
})),
|
|
1686
|
-
width:
|
|
1686
|
+
width: image.Width({
|
|
1687
1687
|
preset: [{ deviceId: "desktop", value: { value: 550, unit: "px" } }],
|
|
1688
1688
|
defaultValue: { value: 100, unit: "%" }
|
|
1689
1689
|
}),
|
|
1690
|
-
margin:
|
|
1690
|
+
margin: image.Margin()
|
|
1691
1691
|
}
|
|
1692
1692
|
});
|
|
1693
1693
|
}
|
|
@@ -1698,17 +1698,17 @@ function registerComponent$5(runtime) {
|
|
|
1698
1698
|
type: "./components/Image/index.js",
|
|
1699
1699
|
label: "Image",
|
|
1700
1700
|
props: {
|
|
1701
|
-
id:
|
|
1702
|
-
file:
|
|
1703
|
-
altText:
|
|
1704
|
-
link:
|
|
1705
|
-
width:
|
|
1706
|
-
margin:
|
|
1707
|
-
padding:
|
|
1708
|
-
border:
|
|
1709
|
-
borderRadius:
|
|
1710
|
-
boxShadow:
|
|
1711
|
-
opacity:
|
|
1701
|
+
id: image.ElementID(),
|
|
1702
|
+
file: image.Image(),
|
|
1703
|
+
altText: image.TextInput({ label: "Alt text" }),
|
|
1704
|
+
link: image.Link({ label: "On click" }),
|
|
1705
|
+
width: image.Width(),
|
|
1706
|
+
margin: image.Margin(),
|
|
1707
|
+
padding: image.Padding(),
|
|
1708
|
+
border: image.Border(),
|
|
1709
|
+
borderRadius: image.BorderRadius(),
|
|
1710
|
+
boxShadow: image.Shadows(),
|
|
1711
|
+
opacity: image.ResponsiveOpacity()
|
|
1712
1712
|
}
|
|
1713
1713
|
});
|
|
1714
1714
|
}
|
|
@@ -1720,21 +1720,21 @@ function registerComponent$4(runtime) {
|
|
|
1720
1720
|
label: "Navigation",
|
|
1721
1721
|
icon: "Navigation40",
|
|
1722
1722
|
props: {
|
|
1723
|
-
id:
|
|
1724
|
-
links:
|
|
1725
|
-
linkTextStyle:
|
|
1723
|
+
id: image.ElementID(),
|
|
1724
|
+
links: image.NavigationLinks(),
|
|
1725
|
+
linkTextStyle: image.TextStyle((props) => {
|
|
1726
1726
|
const links = props.links;
|
|
1727
1727
|
return {
|
|
1728
1728
|
label: "Link text style",
|
|
1729
1729
|
hidden: links == null || links.length === 0
|
|
1730
1730
|
};
|
|
1731
1731
|
}),
|
|
1732
|
-
showLogo:
|
|
1733
|
-
logoFile:
|
|
1732
|
+
showLogo: image.Checkbox({ preset: true, label: "Show logo" }),
|
|
1733
|
+
logoFile: image.Image((props) => ({
|
|
1734
1734
|
label: "Logo",
|
|
1735
1735
|
hidden: props.showLogo === false
|
|
1736
1736
|
})),
|
|
1737
|
-
logoWidth:
|
|
1737
|
+
logoWidth: image.ResponsiveLength((props) => ({
|
|
1738
1738
|
preset: [{ deviceId: "desktop", value: { value: 100, unit: "px" } }],
|
|
1739
1739
|
label: "Logo width",
|
|
1740
1740
|
min: 0,
|
|
@@ -1742,15 +1742,15 @@ function registerComponent$4(runtime) {
|
|
|
1742
1742
|
options: [{ value: "px", label: "Pixels", icon: "Px16" }],
|
|
1743
1743
|
hidden: props.showLogo === false
|
|
1744
1744
|
})),
|
|
1745
|
-
logoAltText:
|
|
1745
|
+
logoAltText: image.TextInput((props) => ({
|
|
1746
1746
|
label: "Logo alt text",
|
|
1747
1747
|
hidden: props.showLogo === false
|
|
1748
1748
|
})),
|
|
1749
|
-
logoLink:
|
|
1749
|
+
logoLink: image.Link((props) => ({
|
|
1750
1750
|
label: "Logo on click",
|
|
1751
1751
|
hidden: props.showLogo === false
|
|
1752
1752
|
})),
|
|
1753
|
-
alignment:
|
|
1753
|
+
alignment: image.ResponsiveIconRadioGroup({
|
|
1754
1754
|
label: "Alignment",
|
|
1755
1755
|
options: [
|
|
1756
1756
|
{ label: "Left", value: "flex-start", icon: "AlignLeft16" },
|
|
@@ -1759,7 +1759,7 @@ function registerComponent$4(runtime) {
|
|
|
1759
1759
|
],
|
|
1760
1760
|
defaultValue: "flex-end"
|
|
1761
1761
|
}),
|
|
1762
|
-
gutter:
|
|
1762
|
+
gutter: image.GapX({
|
|
1763
1763
|
preset: [{ deviceId: "desktop", value: { value: 10, unit: "px" } }],
|
|
1764
1764
|
label: "Link gap",
|
|
1765
1765
|
min: 0,
|
|
@@ -1767,14 +1767,14 @@ function registerComponent$4(runtime) {
|
|
|
1767
1767
|
step: 1,
|
|
1768
1768
|
defaultValue: { value: 0, unit: "px" }
|
|
1769
1769
|
}),
|
|
1770
|
-
mobileMenuAnimation:
|
|
1770
|
+
mobileMenuAnimation: image.ResponsiveSelect({
|
|
1771
1771
|
label: "Mobile menu",
|
|
1772
1772
|
options: [
|
|
1773
1773
|
{ value: "coverRight", label: "Cover from right" },
|
|
1774
1774
|
{ value: "coverLeft", label: "Cover from left" }
|
|
1775
1775
|
]
|
|
1776
1776
|
}),
|
|
1777
|
-
mobileMenuOpenIconColor:
|
|
1777
|
+
mobileMenuOpenIconColor: image.ResponsiveColor((props, device) => {
|
|
1778
1778
|
const mobileMenuAnimation = props.mobileMenuAnimation;
|
|
1779
1779
|
const hidden = !findDeviceOverride(mobileMenuAnimation, device);
|
|
1780
1780
|
return {
|
|
@@ -1783,7 +1783,7 @@ function registerComponent$4(runtime) {
|
|
|
1783
1783
|
hidden
|
|
1784
1784
|
};
|
|
1785
1785
|
}),
|
|
1786
|
-
mobileMenuCloseIconColor:
|
|
1786
|
+
mobileMenuCloseIconColor: image.ResponsiveColor((props, device) => {
|
|
1787
1787
|
const mobileMenuAnimation = props.mobileMenuAnimation;
|
|
1788
1788
|
const hidden = !findDeviceOverride(mobileMenuAnimation, device);
|
|
1789
1789
|
return {
|
|
@@ -1792,7 +1792,7 @@ function registerComponent$4(runtime) {
|
|
|
1792
1792
|
hidden
|
|
1793
1793
|
};
|
|
1794
1794
|
}),
|
|
1795
|
-
mobileMenuBackgroundColor:
|
|
1795
|
+
mobileMenuBackgroundColor: image.ResponsiveColor((props, device) => {
|
|
1796
1796
|
const mobileMenuAnimation = props.mobileMenuAnimation;
|
|
1797
1797
|
const hidden = !findDeviceOverride(mobileMenuAnimation, device);
|
|
1798
1798
|
return {
|
|
@@ -1801,8 +1801,8 @@ function registerComponent$4(runtime) {
|
|
|
1801
1801
|
hidden
|
|
1802
1802
|
};
|
|
1803
1803
|
}),
|
|
1804
|
-
width:
|
|
1805
|
-
margin:
|
|
1804
|
+
width: image.Width({ defaultValue: { value: 100, unit: "%" } }),
|
|
1805
|
+
margin: image.Margin()
|
|
1806
1806
|
}
|
|
1807
1807
|
});
|
|
1808
1808
|
}
|
|
@@ -1814,10 +1814,10 @@ function registerComponent$3(runtime) {
|
|
|
1814
1814
|
label: "Page",
|
|
1815
1815
|
hidden: true,
|
|
1816
1816
|
props: {
|
|
1817
|
-
children:
|
|
1818
|
-
backgrounds:
|
|
1819
|
-
rowGap:
|
|
1820
|
-
columnGap:
|
|
1817
|
+
children: image.Grid(),
|
|
1818
|
+
backgrounds: image.Backgrounds(),
|
|
1819
|
+
rowGap: image.GapY(),
|
|
1820
|
+
columnGap: image.GapX()
|
|
1821
1821
|
}
|
|
1822
1822
|
});
|
|
1823
1823
|
}
|
|
@@ -1829,8 +1829,8 @@ function registerComponent$2(runtime) {
|
|
|
1829
1829
|
label: "Social Links",
|
|
1830
1830
|
icon: "SocialLinks40",
|
|
1831
1831
|
props: {
|
|
1832
|
-
id:
|
|
1833
|
-
links:
|
|
1832
|
+
id: image.ElementID(),
|
|
1833
|
+
links: image.SocialLinks({
|
|
1834
1834
|
preset: {
|
|
1835
1835
|
links: [
|
|
1836
1836
|
{
|
|
@@ -1849,7 +1849,7 @@ function registerComponent$2(runtime) {
|
|
|
1849
1849
|
openInNewTab: false
|
|
1850
1850
|
}
|
|
1851
1851
|
}),
|
|
1852
|
-
shape:
|
|
1852
|
+
shape: image.ResponsiveIconRadioGroup((props) => {
|
|
1853
1853
|
const links = props.links;
|
|
1854
1854
|
return {
|
|
1855
1855
|
label: "Shape",
|
|
@@ -1863,7 +1863,7 @@ function registerComponent$2(runtime) {
|
|
|
1863
1863
|
hidden: links == null || links.links.length === 0
|
|
1864
1864
|
};
|
|
1865
1865
|
}),
|
|
1866
|
-
size:
|
|
1866
|
+
size: image.ResponsiveIconRadioGroup((props) => {
|
|
1867
1867
|
const links = props.links;
|
|
1868
1868
|
return {
|
|
1869
1869
|
label: "Size",
|
|
@@ -1876,7 +1876,7 @@ function registerComponent$2(runtime) {
|
|
|
1876
1876
|
hidden: links == null || links.links.length === 0
|
|
1877
1877
|
};
|
|
1878
1878
|
}),
|
|
1879
|
-
hoverStyle:
|
|
1879
|
+
hoverStyle: image.ResponsiveSelect((props) => {
|
|
1880
1880
|
const links = props.links;
|
|
1881
1881
|
const hidden = links == null || links.links.length === 0;
|
|
1882
1882
|
return {
|
|
@@ -1892,7 +1892,7 @@ function registerComponent$2(runtime) {
|
|
|
1892
1892
|
hidden
|
|
1893
1893
|
};
|
|
1894
1894
|
}),
|
|
1895
|
-
fill:
|
|
1895
|
+
fill: image.ResponsiveColor((props) => {
|
|
1896
1896
|
const links = props.links;
|
|
1897
1897
|
const hidden = links == null || links.links.length === 0;
|
|
1898
1898
|
return {
|
|
@@ -1900,7 +1900,7 @@ function registerComponent$2(runtime) {
|
|
|
1900
1900
|
hidden
|
|
1901
1901
|
};
|
|
1902
1902
|
}),
|
|
1903
|
-
backgroundColor:
|
|
1903
|
+
backgroundColor: image.ResponsiveColor((props) => {
|
|
1904
1904
|
const links = props.links;
|
|
1905
1905
|
const hidden = links == null || links.links.length === 0;
|
|
1906
1906
|
return {
|
|
@@ -1908,7 +1908,7 @@ function registerComponent$2(runtime) {
|
|
|
1908
1908
|
hidden
|
|
1909
1909
|
};
|
|
1910
1910
|
}),
|
|
1911
|
-
alignment:
|
|
1911
|
+
alignment: image.ResponsiveIconRadioGroup({
|
|
1912
1912
|
label: "Alignment",
|
|
1913
1913
|
options: [
|
|
1914
1914
|
{ label: "flex-start", value: "flex-start", icon: "AlignLeft16" },
|
|
@@ -1917,7 +1917,7 @@ function registerComponent$2(runtime) {
|
|
|
1917
1917
|
],
|
|
1918
1918
|
defaultValue: "center"
|
|
1919
1919
|
}),
|
|
1920
|
-
gutter:
|
|
1920
|
+
gutter: image.GapX({
|
|
1921
1921
|
preset: [{ deviceId: "desktop", value: { value: 10, unit: "px" } }],
|
|
1922
1922
|
label: "Link gap",
|
|
1923
1923
|
min: 0,
|
|
@@ -1925,8 +1925,8 @@ function registerComponent$2(runtime) {
|
|
|
1925
1925
|
step: 1,
|
|
1926
1926
|
defaultValue: { value: 0, unit: "px" }
|
|
1927
1927
|
}),
|
|
1928
|
-
width:
|
|
1929
|
-
margin:
|
|
1928
|
+
width: image.Width({ defaultValue: { value: 100, unit: "%" } }),
|
|
1929
|
+
margin: image.Margin({
|
|
1930
1930
|
preset: [
|
|
1931
1931
|
{
|
|
1932
1932
|
deviceId: "desktop",
|
|
@@ -1949,8 +1949,8 @@ function registerComponent$1(runtime) {
|
|
|
1949
1949
|
type: "./components/Text/index.js",
|
|
1950
1950
|
label: "Text",
|
|
1951
1951
|
props: {
|
|
1952
|
-
id:
|
|
1953
|
-
text:
|
|
1952
|
+
id: image.ElementID(),
|
|
1953
|
+
text: image.RichText(() => ({
|
|
1954
1954
|
preset: {
|
|
1955
1955
|
document: {
|
|
1956
1956
|
nodes: [
|
|
@@ -1993,11 +1993,11 @@ function registerComponent$1(runtime) {
|
|
|
1993
1993
|
}
|
|
1994
1994
|
}
|
|
1995
1995
|
})),
|
|
1996
|
-
width:
|
|
1996
|
+
width: image.Width({
|
|
1997
1997
|
preset: [{ deviceId: "desktop", value: { value: 700, unit: "px" } }],
|
|
1998
1998
|
defaultValue: { value: 100, unit: "%" }
|
|
1999
1999
|
}),
|
|
2000
|
-
margin:
|
|
2000
|
+
margin: image.Margin({
|
|
2001
2001
|
preset: [
|
|
2002
2002
|
{
|
|
2003
2003
|
deviceId: "desktop",
|
|
@@ -2021,11 +2021,11 @@ function registerComponent(runtime) {
|
|
|
2021
2021
|
label: "Video",
|
|
2022
2022
|
icon: "Video40",
|
|
2023
2023
|
props: {
|
|
2024
|
-
id:
|
|
2025
|
-
video:
|
|
2026
|
-
width:
|
|
2027
|
-
margin:
|
|
2028
|
-
borderRadius:
|
|
2024
|
+
id: image.ElementID(),
|
|
2025
|
+
video: image.Video({ preset: { controls: true } }),
|
|
2026
|
+
width: image.Width({ defaultValue: { value: 560, unit: "px" } }),
|
|
2027
|
+
margin: image.Margin(),
|
|
2028
|
+
borderRadius: image.BorderRadius()
|
|
2029
2029
|
}
|
|
2030
2030
|
});
|
|
2031
2031
|
}
|
|
@@ -2200,6 +2200,9 @@ function responsiveWidth(widthData, defaultValue = "100%") {
|
|
|
2200
2200
|
width: typeof width === "object" ? `${width.value}${width.unit}` : width
|
|
2201
2201
|
})));
|
|
2202
2202
|
}
|
|
2203
|
+
function colorToString(color2) {
|
|
2204
|
+
return color2 && color2.swatch ? `hsla(${color2.swatch.hue},${color2.swatch.saturation}%,${color2.swatch.lightness}%,${color2.alpha})` : "";
|
|
2205
|
+
}
|
|
2203
2206
|
function murmur2(str) {
|
|
2204
2207
|
var h = 0;
|
|
2205
2208
|
var k, i = 0, len = str.length;
|
|
@@ -2458,45 +2461,55 @@ var insertStyles = function insertStyles2(cache, serialized, isStringTag) {
|
|
|
2458
2461
|
} while (current !== void 0);
|
|
2459
2462
|
}
|
|
2460
2463
|
};
|
|
2461
|
-
|
|
2462
|
-
|
|
2464
|
+
const isServer = typeof window === "undefined";
|
|
2465
|
+
const useInsertionEffectSpecifier = "useInsertionEffect";
|
|
2466
|
+
const useInsertionEffect = (_e = React__namespace[useInsertionEffectSpecifier]) != null ? _e : React__namespace.useLayoutEffect;
|
|
2467
|
+
function useStyle(style) {
|
|
2468
|
+
const serialized = serializeStyles([style], css.cache.registered);
|
|
2469
|
+
registerStyles(css.cache, serialized, false);
|
|
2470
|
+
useInsertionEffect(() => {
|
|
2471
|
+
insertStyles(css.cache, serialized, false);
|
|
2472
|
+
});
|
|
2473
|
+
if (isServer)
|
|
2474
|
+
insertStyles(css.cache, serialized, false);
|
|
2475
|
+
return `${css.cache.key}-${serialized.name}`;
|
|
2463
2476
|
}
|
|
2464
|
-
function useStyleControlCssObject(style
|
|
2477
|
+
function useStyleControlCssObject(style, controlDefinition) {
|
|
2465
2478
|
const { properties } = controlDefinition.config;
|
|
2466
|
-
return __spreadValues(__spreadValues({}, properties.includes(
|
|
2479
|
+
return __spreadValues(__spreadValues({}, properties.includes(image.StyleControlProperty.Width) && {
|
|
2467
2480
|
maxWidth: "100%"
|
|
2468
2481
|
}), responsiveStyle([
|
|
2469
|
-
style
|
|
2470
|
-
style
|
|
2471
|
-
style
|
|
2472
|
-
useBorder(style
|
|
2473
|
-
style
|
|
2474
|
-
style
|
|
2482
|
+
style == null ? void 0 : style.width,
|
|
2483
|
+
style == null ? void 0 : style.margin,
|
|
2484
|
+
style == null ? void 0 : style.padding,
|
|
2485
|
+
useBorder(style == null ? void 0 : style.border),
|
|
2486
|
+
style == null ? void 0 : style.borderRadius,
|
|
2487
|
+
style == null ? void 0 : style.textStyle
|
|
2475
2488
|
], ([width, margin, padding, border, borderRadius, textStyle]) => {
|
|
2476
2489
|
var _a, _b, _c, _d, _e2, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s;
|
|
2477
|
-
return __spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues({}, properties.includes(
|
|
2490
|
+
return __spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues({}, properties.includes(image.StyleControlProperty.Width) && {
|
|
2478
2491
|
width: (_a = widthToString(width)) != null ? _a : "100%"
|
|
2479
|
-
}), properties.includes(
|
|
2492
|
+
}), properties.includes(image.StyleControlProperty.Margin) && {
|
|
2480
2493
|
marginTop: (_b = marginToString(margin == null ? void 0 : margin.marginTop)) != null ? _b : 0,
|
|
2481
2494
|
marginRight: (_c = marginToString(margin == null ? void 0 : margin.marginRight)) != null ? _c : "auto",
|
|
2482
2495
|
marginBottom: (_d = marginToString(margin == null ? void 0 : margin.marginBottom)) != null ? _d : 0,
|
|
2483
2496
|
marginLeft: (_e2 = marginToString(margin == null ? void 0 : margin.marginLeft)) != null ? _e2 : "auto"
|
|
2484
|
-
}), properties.includes(
|
|
2497
|
+
}), properties.includes(image.StyleControlProperty.Padding) && {
|
|
2485
2498
|
paddingTop: (_f = paddingToString(padding == null ? void 0 : padding.paddingTop)) != null ? _f : 0,
|
|
2486
2499
|
paddingRight: (_g = paddingToString(padding == null ? void 0 : padding.paddingRight)) != null ? _g : 0,
|
|
2487
2500
|
paddingBottom: (_h = paddingToString(padding == null ? void 0 : padding.paddingBottom)) != null ? _h : 0,
|
|
2488
2501
|
paddingLeft: (_i = paddingToString(padding == null ? void 0 : padding.paddingLeft)) != null ? _i : 0
|
|
2489
|
-
}), properties.includes(
|
|
2502
|
+
}), properties.includes(image.StyleControlProperty.Border) && {
|
|
2490
2503
|
borderTop: (_j = borderSideToString(border == null ? void 0 : border.borderTop)) != null ? _j : "0 solid black",
|
|
2491
2504
|
borderRight: (_k = borderSideToString(border == null ? void 0 : border.borderRight)) != null ? _k : "0 solid black",
|
|
2492
2505
|
borderBottom: (_l = borderSideToString(border == null ? void 0 : border.borderBottom)) != null ? _l : "0 solid black",
|
|
2493
2506
|
borderLeft: (_m = borderSideToString(border == null ? void 0 : border.borderLeft)) != null ? _m : "0 solid black"
|
|
2494
|
-
}), properties.includes(
|
|
2507
|
+
}), properties.includes(image.StyleControlProperty.BorderRadius) && {
|
|
2495
2508
|
borderTopLeftRadius: (_n = borderRadiusToString(borderRadius == null ? void 0 : borderRadius.borderTopLeftRadius)) != null ? _n : 0,
|
|
2496
2509
|
borderTopRightRadius: (_o = borderRadiusToString(borderRadius == null ? void 0 : borderRadius.borderTopRightRadius)) != null ? _o : 0,
|
|
2497
2510
|
borderBottomRightRadius: (_p = borderRadiusToString(borderRadius == null ? void 0 : borderRadius.borderBottomRightRadius)) != null ? _p : 0,
|
|
2498
2511
|
borderBottomLeftRadius: (_q = borderRadiusToString(borderRadius == null ? void 0 : borderRadius.borderBottomLeftRadius)) != null ? _q : 0
|
|
2499
|
-
}), properties.includes(
|
|
2512
|
+
}), properties.includes(image.StyleControlProperty.TextStyle) && __spreadProps(__spreadValues(__spreadValues(__spreadValues(__spreadValues({}, (textStyle == null ? void 0 : textStyle.fontFamily) && { fontFamily: textStyle.fontFamily }), (textStyle == null ? void 0 : textStyle.letterSpacing) && { letterSpacing: textStyle.letterSpacing }), (textStyle == null ? void 0 : textStyle.fontSize) && { fontSize: fontSizeToString(textStyle.fontSize) }), (textStyle == null ? void 0 : textStyle.fontWeight) && { fontWeight: textStyle.fontWeight }), {
|
|
2500
2513
|
textTransform: (_r = textStyle == null ? void 0 : textStyle.textTransform) != null ? _r : [],
|
|
2501
2514
|
fontStyle: (_s = textStyle == null ? void 0 : textStyle.fontStyle) != null ? _s : []
|
|
2502
2515
|
}));
|
|
@@ -2533,18 +2546,9 @@ function useStyleControlCssObject(style$1, controlDefinition) {
|
|
|
2533
2546
|
return `${fontSize.value}${fontSize.unit}`;
|
|
2534
2547
|
}
|
|
2535
2548
|
}
|
|
2536
|
-
const useInsertionEffectSpecifier = "useInsertionEffect";
|
|
2537
|
-
const useInsertionEffect = (_e = React__namespace[useInsertionEffectSpecifier]) != null ? _e : React__namespace.useLayoutEffect;
|
|
2538
|
-
const isServer = typeof window === "undefined";
|
|
2539
2549
|
function useFormattedStyle(styleControlData, controlDefinition) {
|
|
2540
|
-
const
|
|
2541
|
-
|
|
2542
|
-
return css.css(style2);
|
|
2543
|
-
const serialized = serializeStyles([style2], css.cache.registered);
|
|
2544
|
-
useInsertionEffect(() => {
|
|
2545
|
-
insertStyles(css.cache, serialized, false);
|
|
2546
|
-
});
|
|
2547
|
-
return `${css.cache.key}-${serialized.name}`;
|
|
2550
|
+
const style = useStyleControlCssObject(styleControlData, controlDefinition);
|
|
2551
|
+
return useStyle(style);
|
|
2548
2552
|
}
|
|
2549
2553
|
function RenderHook({
|
|
2550
2554
|
hook: useHook,
|
|
@@ -2771,13 +2775,186 @@ function ControlValue({
|
|
|
2771
2775
|
return children(data);
|
|
2772
2776
|
}
|
|
2773
2777
|
}
|
|
2778
|
+
const getIndexes = (spans, index) => {
|
|
2779
|
+
const flattened = spans.reduce((a, s) => a.concat(s), []);
|
|
2780
|
+
if (index < 0 || index > flattened.length)
|
|
2781
|
+
throw new RangeError();
|
|
2782
|
+
let remainder = index;
|
|
2783
|
+
let rowIndex = 0;
|
|
2784
|
+
while (rowIndex < spans.length - 1 && remainder >= spans[rowIndex].length) {
|
|
2785
|
+
remainder -= spans[rowIndex].length;
|
|
2786
|
+
rowIndex += 1;
|
|
2787
|
+
}
|
|
2788
|
+
return [rowIndex, remainder];
|
|
2789
|
+
};
|
|
2790
|
+
function useSlot(data, control) {
|
|
2791
|
+
if (data == null || data.elements.length === 0) {
|
|
2792
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Slot.Placeholder, {
|
|
2793
|
+
control
|
|
2794
|
+
});
|
|
2795
|
+
}
|
|
2796
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Slot, {
|
|
2797
|
+
control,
|
|
2798
|
+
children: data.elements.map((element, i) => /* @__PURE__ */ jsxRuntime.jsx(Slot.Item, {
|
|
2799
|
+
control,
|
|
2800
|
+
grid: data.columns,
|
|
2801
|
+
index: i,
|
|
2802
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(Element, {
|
|
2803
|
+
element
|
|
2804
|
+
})
|
|
2805
|
+
}, element.key))
|
|
2806
|
+
});
|
|
2807
|
+
}
|
|
2808
|
+
function Slot(_f) {
|
|
2809
|
+
var _g = _f, {
|
|
2810
|
+
as,
|
|
2811
|
+
control,
|
|
2812
|
+
children,
|
|
2813
|
+
className
|
|
2814
|
+
} = _g, restOfProps = __objRest(_g, [
|
|
2815
|
+
"as",
|
|
2816
|
+
"control",
|
|
2817
|
+
"children",
|
|
2818
|
+
"className"
|
|
2819
|
+
]);
|
|
2820
|
+
const As = as != null ? as : "div";
|
|
2821
|
+
const [element, setElement] = React.useState(null);
|
|
2822
|
+
const baseClassName = useStyle({
|
|
2823
|
+
display: "flex",
|
|
2824
|
+
flexWrap: "wrap",
|
|
2825
|
+
width: "100%"
|
|
2826
|
+
});
|
|
2827
|
+
React.useEffect(() => {
|
|
2828
|
+
if (element == null || control == null)
|
|
2829
|
+
return;
|
|
2830
|
+
return pollBoxModel({
|
|
2831
|
+
element,
|
|
2832
|
+
onBoxModelChange: (boxModel) => control.changeContainerBoxModel(boxModel)
|
|
2833
|
+
});
|
|
2834
|
+
}, [element, control]);
|
|
2835
|
+
return /* @__PURE__ */ jsxRuntime.jsx(As, __spreadProps(__spreadValues({}, restOfProps), {
|
|
2836
|
+
ref: setElement,
|
|
2837
|
+
className: css.cx(baseClassName, className),
|
|
2838
|
+
children
|
|
2839
|
+
}));
|
|
2840
|
+
}
|
|
2841
|
+
Slot.Placeholder = SlotPlaceholder;
|
|
2842
|
+
Slot.Item = SlotItem;
|
|
2843
|
+
function SlotItem(_h) {
|
|
2844
|
+
var _i = _h, {
|
|
2845
|
+
as,
|
|
2846
|
+
control,
|
|
2847
|
+
grid,
|
|
2848
|
+
index,
|
|
2849
|
+
children,
|
|
2850
|
+
className
|
|
2851
|
+
} = _i, restOfProps = __objRest(_i, [
|
|
2852
|
+
"as",
|
|
2853
|
+
"control",
|
|
2854
|
+
"grid",
|
|
2855
|
+
"index",
|
|
2856
|
+
"children",
|
|
2857
|
+
"className"
|
|
2858
|
+
]);
|
|
2859
|
+
const As = as != null ? as : "div";
|
|
2860
|
+
const [element, setElement] = React.useState(null);
|
|
2861
|
+
const baseClassName = useStyle(__spreadValues({
|
|
2862
|
+
display: "flex"
|
|
2863
|
+
}, responsiveStyle([grid], ([{
|
|
2864
|
+
count = 12,
|
|
2865
|
+
spans = [[12]]
|
|
2866
|
+
} = {}]) => {
|
|
2867
|
+
const [rowIndex, columnIndex] = getIndexes(spans, index);
|
|
2868
|
+
const span = spans[rowIndex][columnIndex];
|
|
2869
|
+
const flexBasis = `calc(100% * ${(span / count).toFixed(5)})`;
|
|
2870
|
+
return span === 0 ? {
|
|
2871
|
+
display: "none"
|
|
2872
|
+
} : {
|
|
2873
|
+
flexBasis,
|
|
2874
|
+
minWidth: flexBasis
|
|
2875
|
+
};
|
|
2876
|
+
})));
|
|
2877
|
+
React.useEffect(() => {
|
|
2878
|
+
if (element == null || control == null)
|
|
2879
|
+
return;
|
|
2880
|
+
return pollBoxModel({
|
|
2881
|
+
element,
|
|
2882
|
+
onBoxModelChange: (boxModel) => control.changeItemBoxModel(index, boxModel)
|
|
2883
|
+
});
|
|
2884
|
+
}, [element, control, index]);
|
|
2885
|
+
return /* @__PURE__ */ jsxRuntime.jsx(As, __spreadProps(__spreadValues({}, restOfProps), {
|
|
2886
|
+
ref: setElement,
|
|
2887
|
+
className: css.cx(baseClassName, className),
|
|
2888
|
+
children
|
|
2889
|
+
}));
|
|
2890
|
+
}
|
|
2891
|
+
function SlotPlaceholder({
|
|
2892
|
+
control
|
|
2893
|
+
}) {
|
|
2894
|
+
const [element, setElement] = React.useState(null);
|
|
2895
|
+
React.useEffect(() => {
|
|
2896
|
+
if (element == null || control == null)
|
|
2897
|
+
return;
|
|
2898
|
+
return pollBoxModel({
|
|
2899
|
+
element,
|
|
2900
|
+
onBoxModelChange: (boxModel) => control.changeContainerBoxModel(boxModel)
|
|
2901
|
+
});
|
|
2902
|
+
}, [element, control]);
|
|
2903
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", {
|
|
2904
|
+
ref: setElement,
|
|
2905
|
+
className: useStyle({
|
|
2906
|
+
width: "100%",
|
|
2907
|
+
background: "rgba(161, 168, 194, 0.18)",
|
|
2908
|
+
height: "80px"
|
|
2909
|
+
}),
|
|
2910
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("svg", {
|
|
2911
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2912
|
+
width: "100%",
|
|
2913
|
+
height: "100%",
|
|
2914
|
+
className: useStyle({
|
|
2915
|
+
overflow: "visible",
|
|
2916
|
+
padding: 8
|
|
2917
|
+
}),
|
|
2918
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("rect", {
|
|
2919
|
+
x: 0,
|
|
2920
|
+
y: 0,
|
|
2921
|
+
width: "100%",
|
|
2922
|
+
height: "100%",
|
|
2923
|
+
strokeWidth: 2,
|
|
2924
|
+
strokeDasharray: "4 2",
|
|
2925
|
+
fill: "none",
|
|
2926
|
+
stroke: "rgba(161, 168, 194, 0.40)",
|
|
2927
|
+
rx: "4",
|
|
2928
|
+
ry: "4"
|
|
2929
|
+
})
|
|
2930
|
+
})
|
|
2931
|
+
});
|
|
2932
|
+
}
|
|
2933
|
+
function pollBoxModel({
|
|
2934
|
+
element,
|
|
2935
|
+
onBoxModelChange
|
|
2936
|
+
}) {
|
|
2937
|
+
let currentBoxModel = null;
|
|
2938
|
+
const handleAnimationFrameRequest = () => {
|
|
2939
|
+
const measuredBoxModel = boxModels.getBox(element);
|
|
2940
|
+
if (!deepEqual(currentBoxModel, measuredBoxModel)) {
|
|
2941
|
+
currentBoxModel = measuredBoxModel;
|
|
2942
|
+
onBoxModelChange(currentBoxModel);
|
|
2943
|
+
}
|
|
2944
|
+
animationFrameHandle = requestAnimationFrame(handleAnimationFrameRequest);
|
|
2945
|
+
};
|
|
2946
|
+
let animationFrameHandle = requestAnimationFrame(handleAnimationFrameRequest);
|
|
2947
|
+
return () => {
|
|
2948
|
+
cancelAnimationFrame(animationFrameHandle);
|
|
2949
|
+
};
|
|
2950
|
+
}
|
|
2774
2951
|
function useDeviceMode() {
|
|
2775
2952
|
return "desktop";
|
|
2776
2953
|
}
|
|
2777
2954
|
function useWidth(value, descriptor, props) {
|
|
2778
2955
|
const deviceMode = useDeviceMode();
|
|
2779
2956
|
const options = React.useMemo(() => typeof descriptor.options === "function" ? descriptor.options(props, deviceMode) : descriptor.options, [props, deviceMode]);
|
|
2780
|
-
return React.useMemo(() => options.format ===
|
|
2957
|
+
return React.useMemo(() => options.format === image.WidthControlValueFormats.ClassName ? css.css(responsiveWidth(value, options.defaultValue)) : value, [value, options.defaultValue, options.format]);
|
|
2781
2958
|
}
|
|
2782
2959
|
function PropsValue({
|
|
2783
2960
|
element,
|
|
@@ -2787,7 +2964,14 @@ function PropsValue({
|
|
|
2787
2964
|
const store = useStore();
|
|
2788
2965
|
const propControllerDescriptorsRef = React.useRef((_a = reactPage.getComponentPropControllerDescriptors(store.getState(), element.type)) != null ? _a : {});
|
|
2789
2966
|
const props = element.props;
|
|
2967
|
+
const documentKey = useDocumentKey();
|
|
2968
|
+
const propControllers = useSelector((state) => {
|
|
2969
|
+
if (documentKey == null)
|
|
2970
|
+
return null;
|
|
2971
|
+
return reactPage.getPropControllers(state, documentKey, element.key);
|
|
2972
|
+
});
|
|
2790
2973
|
return Object.entries(propControllerDescriptorsRef.current).reduceRight((renderFn, [propName, descriptor]) => (propsValue) => {
|
|
2974
|
+
var _a2;
|
|
2791
2975
|
switch (descriptor.type) {
|
|
2792
2976
|
case textInput.CheckboxControlType:
|
|
2793
2977
|
case textInput.NumberControlType:
|
|
@@ -2807,7 +2991,7 @@ function PropsValue({
|
|
|
2807
2991
|
[propName]: value
|
|
2808
2992
|
}))
|
|
2809
2993
|
});
|
|
2810
|
-
case
|
|
2994
|
+
case image.StyleControlType:
|
|
2811
2995
|
return /* @__PURE__ */ jsxRuntime.jsx(RenderHook, {
|
|
2812
2996
|
hook: useFormattedStyle,
|
|
2813
2997
|
parameters: [props[propName], descriptor],
|
|
@@ -2815,7 +2999,17 @@ function PropsValue({
|
|
|
2815
2999
|
[propName]: value
|
|
2816
3000
|
}))
|
|
2817
3001
|
}, descriptor.type);
|
|
2818
|
-
case
|
|
3002
|
+
case slot.SlotControlType: {
|
|
3003
|
+
const control = (_a2 = propControllers == null ? void 0 : propControllers[propName]) != null ? _a2 : null;
|
|
3004
|
+
return /* @__PURE__ */ jsxRuntime.jsx(RenderHook, {
|
|
3005
|
+
hook: useSlot,
|
|
3006
|
+
parameters: [props[propName], control],
|
|
3007
|
+
children: (value) => renderFn(__spreadProps(__spreadValues({}, propsValue), {
|
|
3008
|
+
[propName]: value
|
|
3009
|
+
}))
|
|
3010
|
+
}, descriptor.type);
|
|
3011
|
+
}
|
|
3012
|
+
case image.Types.Width:
|
|
2819
3013
|
return /* @__PURE__ */ jsxRuntime.jsx(RenderHook, {
|
|
2820
3014
|
hook: useWidth,
|
|
2821
3015
|
parameters: [props[propName], descriptor, props],
|
|
@@ -2823,7 +3017,7 @@ function PropsValue({
|
|
|
2823
3017
|
[propName]: value
|
|
2824
3018
|
}))
|
|
2825
3019
|
}, descriptor.type);
|
|
2826
|
-
case
|
|
3020
|
+
case image.Types.ResponsiveColor:
|
|
2827
3021
|
return /* @__PURE__ */ jsxRuntime.jsx(RenderHook, {
|
|
2828
3022
|
hook: useResponsiveColor,
|
|
2829
3023
|
parameters: [props[propName]],
|
|
@@ -3157,6 +3351,7 @@ exports.findDeviceOverride = findDeviceOverride;
|
|
|
3157
3351
|
exports.forwardNextDynamicRef = forwardNextDynamicRef;
|
|
3158
3352
|
exports.getDevice = getDevice;
|
|
3159
3353
|
exports.getDeviceMediaQuery = getDeviceMediaQuery;
|
|
3354
|
+
exports.getIndexes = getIndexes;
|
|
3160
3355
|
exports.getServerSideProps = getServerSideProps;
|
|
3161
3356
|
exports.getStaticPaths = getStaticPaths;
|
|
3162
3357
|
exports.getStaticProps = getStaticProps;
|