@makeswift/runtime 0.7.5 → 0.7.7
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 +0 -1
- package/dist/Box.cjs.js.map +1 -1
- package/dist/Box.es.js +0 -1
- package/dist/Box.es.js.map +1 -1
- package/dist/Button.cjs.js +0 -1
- package/dist/Button.cjs.js.map +1 -1
- package/dist/Button.es.js +0 -1
- package/dist/Button.es.js.map +1 -1
- package/dist/Carousel.cjs.js +0 -1
- package/dist/Carousel.cjs.js.map +1 -1
- package/dist/Carousel.es.js +0 -1
- package/dist/Carousel.es.js.map +1 -1
- package/dist/Countdown.cjs.js +0 -1
- package/dist/Countdown.cjs.js.map +1 -1
- package/dist/Countdown.es.js +0 -1
- package/dist/Countdown.es.js.map +1 -1
- package/dist/Divider.cjs.js +0 -1
- package/dist/Divider.cjs.js.map +1 -1
- package/dist/Divider.es.js +0 -1
- package/dist/Divider.es.js.map +1 -1
- package/dist/EditableText.cjs.js +0 -1
- package/dist/EditableText.cjs.js.map +1 -1
- package/dist/EditableText.es.js +1 -2
- package/dist/EditableText.es.js.map +1 -1
- package/dist/Embed.cjs.js +0 -1
- package/dist/Embed.cjs.js.map +1 -1
- package/dist/Embed.es.js +0 -1
- package/dist/Embed.es.js.map +1 -1
- package/dist/Form.cjs.js +0 -1
- package/dist/Form.cjs.js.map +1 -1
- package/dist/Form.es.js +0 -1
- package/dist/Form.es.js.map +1 -1
- package/dist/Image.cjs.js +0 -1
- package/dist/Image.cjs.js.map +1 -1
- package/dist/Image.es.js +0 -1
- package/dist/Image.es.js.map +1 -1
- package/dist/LiveProvider.cjs.js +0 -1
- package/dist/LiveProvider.cjs.js.map +1 -1
- package/dist/LiveProvider.es.js +0 -1
- package/dist/LiveProvider.es.js.map +1 -1
- package/dist/Navigation.cjs.js +0 -1
- package/dist/Navigation.cjs.js.map +1 -1
- package/dist/Navigation.es.js +0 -1
- package/dist/Navigation.es.js.map +1 -1
- package/dist/PreviewProvider.cjs.js +6 -2
- package/dist/PreviewProvider.cjs.js.map +1 -1
- package/dist/PreviewProvider.es.js +8 -4
- package/dist/PreviewProvider.es.js.map +1 -1
- package/dist/ReadOnlyText.cjs.js +0 -1
- package/dist/ReadOnlyText.cjs.js.map +1 -1
- package/dist/ReadOnlyText.es.js +0 -1
- package/dist/ReadOnlyText.es.js.map +1 -1
- package/dist/Root.cjs.js +0 -1
- package/dist/Root.cjs.js.map +1 -1
- package/dist/Root.es.js +0 -1
- package/dist/Root.es.js.map +1 -1
- package/dist/SocialLinks.cjs.js +0 -1
- package/dist/SocialLinks.cjs.js.map +1 -1
- package/dist/SocialLinks.es.js +0 -1
- package/dist/SocialLinks.es.js.map +1 -1
- package/dist/Text.cjs.js +0 -1
- package/dist/Text.cjs.js.map +1 -1
- package/dist/Text.es.js +0 -1
- package/dist/Text.es.js.map +1 -1
- package/dist/Video.cjs.js +0 -1
- package/dist/Video.cjs.js.map +1 -1
- package/dist/Video.es.js +0 -1
- package/dist/Video.es.js.map +1 -1
- package/dist/builder.cjs.js +0 -1
- package/dist/builder.cjs.js.map +1 -1
- package/dist/builder.es.js +0 -1
- package/dist/builder.es.js.map +1 -1
- package/dist/components.cjs.js +0 -1
- package/dist/components.cjs.js.map +1 -1
- package/dist/components.es.js +0 -1
- package/dist/components.es.js.map +1 -1
- package/dist/constants.cjs.js +18 -3
- package/dist/constants.cjs.js.map +1 -1
- package/dist/constants.es.js +17 -3
- package/dist/constants.es.js.map +1 -1
- package/dist/control-serialization.cjs.js +107 -108
- package/dist/control-serialization.cjs.js.map +1 -1
- package/dist/control-serialization.es.js +1 -2
- package/dist/control-serialization.es.js.map +1 -1
- package/dist/controls.cjs.js +14 -11
- package/dist/controls.cjs.js.map +1 -1
- package/dist/controls.es.js +1 -2
- package/dist/controls.es.js.map +1 -1
- package/dist/index.cjs.js +133 -114
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.cjs5.js +0 -1
- package/dist/index.cjs5.js.map +1 -1
- package/dist/index.es.js +107 -88
- package/dist/index.es.js.map +1 -1
- package/dist/index.es5.js +0 -1
- package/dist/index.es5.js.map +1 -1
- package/dist/index.es6.js +1 -1
- package/dist/main.cjs.js +0 -1
- package/dist/main.cjs.js.map +1 -1
- package/dist/main.es.js +0 -1
- package/dist/main.es.js.map +1 -1
- package/dist/next.cjs.js +0 -1
- package/dist/next.cjs.js.map +1 -1
- package/dist/next.es.js +0 -1
- package/dist/next.es.js.map +1 -1
- package/dist/prop-controllers.es.js +1 -1
- package/dist/react.cjs.js +0 -1
- package/dist/react.cjs.js.map +1 -1
- package/dist/react.es.js +0 -1
- package/dist/react.es.js.map +1 -1
- package/dist/rich-text.cjs.js +499 -7
- package/dist/rich-text.cjs.js.map +1 -1
- package/dist/rich-text.es.js +484 -7
- package/dist/rich-text.es.js.map +1 -1
- 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/controls/control.d.ts +2 -1
- package/dist/types/src/controls/control.d.ts.map +1 -1
- package/dist/types/src/controls/list.d.ts +20 -0
- package/dist/types/src/controls/list.d.ts.map +1 -1
- package/dist/types/src/controls/shape.d.ts +21 -0
- package/dist/types/src/controls/shape.d.ts.map +1 -1
- package/dist/types/src/prop-controllers/instances.d.ts +3 -2
- package/dist/types/src/prop-controllers/instances.d.ts.map +1 -1
- package/dist/types/src/runtimes/react/controls/control.d.ts +6 -3
- package/dist/types/src/runtimes/react/controls/control.d.ts.map +1 -1
- package/dist/types/src/runtimes/react/controls/list.d.ts +3 -2
- package/dist/types/src/runtimes/react/controls/list.d.ts.map +1 -1
- package/dist/types/src/runtimes/react/controls/shape.d.ts +3 -2
- package/dist/types/src/runtimes/react/controls/shape.d.ts.map +1 -1
- package/dist/types/src/runtimes/react/controls.d.ts.map +1 -1
- package/dist/types/src/state/modules/read-only-documents.d.ts +1 -0
- package/dist/types/src/state/modules/read-only-documents.d.ts.map +1 -1
- package/dist/types/src/state/react-builder-preview.d.ts.map +1 -1
- package/dist/types/src/state/react-page.d.ts +6 -0
- package/dist/types/src/state/react-page.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/control.cjs.js +0 -437
- package/dist/control.cjs.js.map +0 -1
- package/dist/control.es.js +0 -426
- package/dist/control.es.js.map +0 -1
|
@@ -20,7 +20,6 @@ var __spreadValues = (a, b) => {
|
|
|
20
20
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
21
21
|
var combobox = require("./combobox.cjs.js");
|
|
22
22
|
var richText = require("./rich-text.cjs.js");
|
|
23
|
-
var control = require("./control.cjs.js");
|
|
24
23
|
function isSerializedFunction(value) {
|
|
25
24
|
return value instanceof MessagePort;
|
|
26
25
|
}
|
|
@@ -96,27 +95,27 @@ function deserializeShapeControlDefinition(definition) {
|
|
|
96
95
|
config: __spreadProps(__spreadValues({}, definition.config), { type })
|
|
97
96
|
});
|
|
98
97
|
}
|
|
99
|
-
function serializeShapeControl(
|
|
100
|
-
const { type } =
|
|
98
|
+
function serializeShapeControl(control) {
|
|
99
|
+
const { type } = control.options;
|
|
101
100
|
const transferables = [];
|
|
102
101
|
const serializedType = {};
|
|
103
|
-
Object.entries(type).forEach(([key,
|
|
104
|
-
const [serializedControl, serializedControlTransferables] = serializeControl(
|
|
102
|
+
Object.entries(type).forEach(([key, control2]) => {
|
|
103
|
+
const [serializedControl, serializedControlTransferables] = serializeControl(control2);
|
|
105
104
|
serializedType[key] = serializedControl;
|
|
106
105
|
transferables.push(...serializedControlTransferables);
|
|
107
106
|
});
|
|
108
|
-
return [__spreadProps(__spreadValues({},
|
|
107
|
+
return [__spreadProps(__spreadValues({}, control), { options: __spreadProps(__spreadValues({}, control.options), { type: serializedType }) }), transferables];
|
|
109
108
|
}
|
|
110
|
-
function deserializeShapeControl(
|
|
111
|
-
const { type } =
|
|
109
|
+
function deserializeShapeControl(control) {
|
|
110
|
+
const { type } = control.options;
|
|
112
111
|
const deserializedType = {};
|
|
113
|
-
Object.entries(type).forEach(([key,
|
|
114
|
-
deserializedType[key] = deserializeControl(
|
|
112
|
+
Object.entries(type).forEach(([key, control2]) => {
|
|
113
|
+
deserializedType[key] = deserializeControl(control2);
|
|
115
114
|
});
|
|
116
|
-
return __spreadProps(__spreadValues({},
|
|
115
|
+
return __spreadProps(__spreadValues({}, control), { options: __spreadProps(__spreadValues({}, control.options), { type: deserializedType }) });
|
|
117
116
|
}
|
|
118
|
-
function serializeListControl(
|
|
119
|
-
const { type, getItemLabel } =
|
|
117
|
+
function serializeListControl(control) {
|
|
118
|
+
const { type, getItemLabel } = control.options;
|
|
120
119
|
const transferables = [];
|
|
121
120
|
const [serializedType, serializedTypeTransferables] = serializeControl(type);
|
|
122
121
|
const serializedGetItemLabel = getItemLabel && serializeFunction(getItemLabel);
|
|
@@ -124,8 +123,8 @@ function serializeListControl(control2) {
|
|
|
124
123
|
if (serializedGetItemLabel != null)
|
|
125
124
|
transferables.push(serializedGetItemLabel);
|
|
126
125
|
return [
|
|
127
|
-
__spreadProps(__spreadValues({},
|
|
128
|
-
options: __spreadProps(__spreadValues({},
|
|
126
|
+
__spreadProps(__spreadValues({}, control), {
|
|
127
|
+
options: __spreadProps(__spreadValues({}, control.options), {
|
|
129
128
|
type: serializedType,
|
|
130
129
|
getItemLabel: serializedGetItemLabel
|
|
131
130
|
})
|
|
@@ -144,11 +143,11 @@ function deserializeListControl(serializedControl) {
|
|
|
144
143
|
})
|
|
145
144
|
});
|
|
146
145
|
}
|
|
147
|
-
function serializeTypeaheadControl(
|
|
148
|
-
const { getItems } =
|
|
146
|
+
function serializeTypeaheadControl(control) {
|
|
147
|
+
const { getItems } = control.options;
|
|
149
148
|
const serializedGetItems = getItems && serializeFunction(getItems);
|
|
150
149
|
return [
|
|
151
|
-
__spreadProps(__spreadValues({},
|
|
150
|
+
__spreadProps(__spreadValues({}, control), { options: __spreadProps(__spreadValues({}, control.options), { getItems: serializedGetItems }) }),
|
|
152
151
|
serializedGetItems == null ? [] : [serializedGetItems]
|
|
153
152
|
];
|
|
154
153
|
}
|
|
@@ -159,12 +158,12 @@ function deserializeTypeaheadControl(serializedControl) {
|
|
|
159
158
|
options: __spreadProps(__spreadValues({}, serializedControl.options), { getItems: deserializedGetItems })
|
|
160
159
|
});
|
|
161
160
|
}
|
|
162
|
-
function serializeGapXControl(
|
|
163
|
-
const { options } =
|
|
161
|
+
function serializeGapXControl(control) {
|
|
162
|
+
const { options } = control;
|
|
164
163
|
if (typeof options !== "function")
|
|
165
|
-
return [__spreadProps(__spreadValues({},
|
|
164
|
+
return [__spreadProps(__spreadValues({}, control), { options }), []];
|
|
166
165
|
const serializedOptions = serializeFunction(options);
|
|
167
|
-
return [__spreadProps(__spreadValues({},
|
|
166
|
+
return [__spreadProps(__spreadValues({}, control), { options: serializedOptions }), [serializedOptions]];
|
|
168
167
|
}
|
|
169
168
|
function deserializeGapXControl(serializedControl) {
|
|
170
169
|
const { options } = serializedControl;
|
|
@@ -173,12 +172,12 @@ function deserializeGapXControl(serializedControl) {
|
|
|
173
172
|
const deserializedOptions = deserializeFunction(options);
|
|
174
173
|
return __spreadProps(__spreadValues({}, serializedControl), { options: deserializedOptions });
|
|
175
174
|
}
|
|
176
|
-
function serializeGapYControl(
|
|
177
|
-
const { options } =
|
|
175
|
+
function serializeGapYControl(control) {
|
|
176
|
+
const { options } = control;
|
|
178
177
|
if (typeof options !== "function")
|
|
179
|
-
return [__spreadProps(__spreadValues({},
|
|
178
|
+
return [__spreadProps(__spreadValues({}, control), { options }), []];
|
|
180
179
|
const serializedOptions = serializeFunction(options);
|
|
181
|
-
return [__spreadProps(__spreadValues({},
|
|
180
|
+
return [__spreadProps(__spreadValues({}, control), { options: serializedOptions }), [serializedOptions]];
|
|
182
181
|
}
|
|
183
182
|
function deserializeGapYControl(serializedControl) {
|
|
184
183
|
const { options } = serializedControl;
|
|
@@ -187,12 +186,12 @@ function deserializeGapYControl(serializedControl) {
|
|
|
187
186
|
const deserializedOptions = deserializeFunction(options);
|
|
188
187
|
return __spreadProps(__spreadValues({}, serializedControl), { options: deserializedOptions });
|
|
189
188
|
}
|
|
190
|
-
function serializeResponsiveNumberControl(
|
|
191
|
-
const { options } =
|
|
189
|
+
function serializeResponsiveNumberControl(control) {
|
|
190
|
+
const { options } = control;
|
|
192
191
|
if (typeof options !== "function")
|
|
193
|
-
return [__spreadProps(__spreadValues({},
|
|
192
|
+
return [__spreadProps(__spreadValues({}, control), { options }), []];
|
|
194
193
|
const serializedOptions = serializeFunction(options);
|
|
195
|
-
return [__spreadProps(__spreadValues({},
|
|
194
|
+
return [__spreadProps(__spreadValues({}, control), { options: serializedOptions }), [serializedOptions]];
|
|
196
195
|
}
|
|
197
196
|
function deserializeResponsiveNumberControl(serializedControl) {
|
|
198
197
|
const { options } = serializedControl;
|
|
@@ -201,12 +200,12 @@ function deserializeResponsiveNumberControl(serializedControl) {
|
|
|
201
200
|
const deserializedOptions = deserializeFunction(options);
|
|
202
201
|
return __spreadProps(__spreadValues({}, serializedControl), { options: deserializedOptions });
|
|
203
202
|
}
|
|
204
|
-
function serializeCheckboxControl(
|
|
205
|
-
const { options } =
|
|
203
|
+
function serializeCheckboxControl(control) {
|
|
204
|
+
const { options } = control;
|
|
206
205
|
if (typeof options !== "function")
|
|
207
|
-
return [__spreadProps(__spreadValues({},
|
|
206
|
+
return [__spreadProps(__spreadValues({}, control), { options }), []];
|
|
208
207
|
const serializedOptions = serializeFunction(options);
|
|
209
|
-
return [__spreadProps(__spreadValues({},
|
|
208
|
+
return [__spreadProps(__spreadValues({}, control), { options: serializedOptions }), [serializedOptions]];
|
|
210
209
|
}
|
|
211
210
|
function deserializeCheckboxControl(serializedControl) {
|
|
212
211
|
const { options } = serializedControl;
|
|
@@ -215,12 +214,12 @@ function deserializeCheckboxControl(serializedControl) {
|
|
|
215
214
|
const deserializedOptions = deserializeFunction(options);
|
|
216
215
|
return __spreadProps(__spreadValues({}, serializedControl), { options: deserializedOptions });
|
|
217
216
|
}
|
|
218
|
-
function serializeResponsiveColorControl(
|
|
219
|
-
const { options } =
|
|
217
|
+
function serializeResponsiveColorControl(control) {
|
|
218
|
+
const { options } = control;
|
|
220
219
|
if (typeof options !== "function")
|
|
221
|
-
return [__spreadProps(__spreadValues({},
|
|
220
|
+
return [__spreadProps(__spreadValues({}, control), { options }), []];
|
|
222
221
|
const serializedOptions = serializeFunction(options);
|
|
223
|
-
return [__spreadProps(__spreadValues({},
|
|
222
|
+
return [__spreadProps(__spreadValues({}, control), { options: serializedOptions }), [serializedOptions]];
|
|
224
223
|
}
|
|
225
224
|
function deserializeResponsiveColorControl(serializedControl) {
|
|
226
225
|
const { options } = serializedControl;
|
|
@@ -229,12 +228,12 @@ function deserializeResponsiveColorControl(serializedControl) {
|
|
|
229
228
|
const deserializedOptions = deserializeFunction(options);
|
|
230
229
|
return __spreadProps(__spreadValues({}, serializedControl), { options: deserializedOptions });
|
|
231
230
|
}
|
|
232
|
-
function serializeNumberControl(
|
|
233
|
-
const { options } =
|
|
231
|
+
function serializeNumberControl(control) {
|
|
232
|
+
const { options } = control;
|
|
234
233
|
if (typeof options !== "function")
|
|
235
|
-
return [__spreadProps(__spreadValues({},
|
|
234
|
+
return [__spreadProps(__spreadValues({}, control), { options }), []];
|
|
236
235
|
const serializedOptions = serializeFunction(options);
|
|
237
|
-
return [__spreadProps(__spreadValues({},
|
|
236
|
+
return [__spreadProps(__spreadValues({}, control), { options: serializedOptions }), [serializedOptions]];
|
|
238
237
|
}
|
|
239
238
|
function deserializeNumberControl(serializedControl) {
|
|
240
239
|
const { options } = serializedControl;
|
|
@@ -243,12 +242,12 @@ function deserializeNumberControl(serializedControl) {
|
|
|
243
242
|
const deserializedOptions = deserializeFunction(options);
|
|
244
243
|
return __spreadProps(__spreadValues({}, serializedControl), { options: deserializedOptions });
|
|
245
244
|
}
|
|
246
|
-
function serializeResponsiveIconRadioGroupControl(
|
|
247
|
-
const { options } =
|
|
245
|
+
function serializeResponsiveIconRadioGroupControl(control) {
|
|
246
|
+
const { options } = control;
|
|
248
247
|
if (typeof options !== "function")
|
|
249
|
-
return [__spreadProps(__spreadValues({},
|
|
248
|
+
return [__spreadProps(__spreadValues({}, control), { options }), []];
|
|
250
249
|
const serializedOptions = serializeFunction(options);
|
|
251
|
-
return [__spreadProps(__spreadValues({},
|
|
250
|
+
return [__spreadProps(__spreadValues({}, control), { options: serializedOptions }), [serializedOptions]];
|
|
252
251
|
}
|
|
253
252
|
function deserializeResponsiveIconRadioGroupControl(serializedControl) {
|
|
254
253
|
const { options } = serializedControl;
|
|
@@ -257,12 +256,12 @@ function deserializeResponsiveIconRadioGroupControl(serializedControl) {
|
|
|
257
256
|
const deserializedOptions = deserializeFunction(options);
|
|
258
257
|
return __spreadProps(__spreadValues({}, serializedControl), { options: deserializedOptions });
|
|
259
258
|
}
|
|
260
|
-
function serializeDateControl(
|
|
261
|
-
const { options } =
|
|
259
|
+
function serializeDateControl(control) {
|
|
260
|
+
const { options } = control;
|
|
262
261
|
if (typeof options !== "function")
|
|
263
|
-
return [__spreadProps(__spreadValues({},
|
|
262
|
+
return [__spreadProps(__spreadValues({}, control), { options }), []];
|
|
264
263
|
const serializedOptions = serializeFunction(options);
|
|
265
|
-
return [__spreadProps(__spreadValues({},
|
|
264
|
+
return [__spreadProps(__spreadValues({}, control), { options: serializedOptions }), [serializedOptions]];
|
|
266
265
|
}
|
|
267
266
|
function deserializeDateControl(serializedControl) {
|
|
268
267
|
const { options } = serializedControl;
|
|
@@ -271,12 +270,12 @@ function deserializeDateControl(serializedControl) {
|
|
|
271
270
|
const deserializedOptions = deserializeFunction(options);
|
|
272
271
|
return __spreadProps(__spreadValues({}, serializedControl), { options: deserializedOptions });
|
|
273
272
|
}
|
|
274
|
-
function serializeLinkControl(
|
|
275
|
-
const { options } =
|
|
273
|
+
function serializeLinkControl(control) {
|
|
274
|
+
const { options } = control;
|
|
276
275
|
if (typeof options !== "function")
|
|
277
|
-
return [__spreadProps(__spreadValues({},
|
|
276
|
+
return [__spreadProps(__spreadValues({}, control), { options }), []];
|
|
278
277
|
const serializedOptions = serializeFunction(options);
|
|
279
|
-
return [__spreadProps(__spreadValues({},
|
|
278
|
+
return [__spreadProps(__spreadValues({}, control), { options: serializedOptions }), [serializedOptions]];
|
|
280
279
|
}
|
|
281
280
|
function deserializeLinkControl(serializedControl) {
|
|
282
281
|
const { options } = serializedControl;
|
|
@@ -285,12 +284,12 @@ function deserializeLinkControl(serializedControl) {
|
|
|
285
284
|
const deserializedOptions = deserializeFunction(options);
|
|
286
285
|
return __spreadProps(__spreadValues({}, serializedControl), { options: deserializedOptions });
|
|
287
286
|
}
|
|
288
|
-
function serializeTextInputControl(
|
|
289
|
-
const { options } =
|
|
287
|
+
function serializeTextInputControl(control) {
|
|
288
|
+
const { options } = control;
|
|
290
289
|
if (typeof options !== "function")
|
|
291
|
-
return [__spreadProps(__spreadValues({},
|
|
290
|
+
return [__spreadProps(__spreadValues({}, control), { options }), []];
|
|
292
291
|
const serializedOptions = serializeFunction(options);
|
|
293
|
-
return [__spreadProps(__spreadValues({},
|
|
292
|
+
return [__spreadProps(__spreadValues({}, control), { options: serializedOptions }), [serializedOptions]];
|
|
294
293
|
}
|
|
295
294
|
function deserializeTextInputControl(serializedControl) {
|
|
296
295
|
const { options } = serializedControl;
|
|
@@ -299,12 +298,12 @@ function deserializeTextInputControl(serializedControl) {
|
|
|
299
298
|
const deserializedOptions = deserializeFunction(options);
|
|
300
299
|
return __spreadProps(__spreadValues({}, serializedControl), { options: deserializedOptions });
|
|
301
300
|
}
|
|
302
|
-
function serializeResponsiveSelectControl(
|
|
303
|
-
const { options } =
|
|
301
|
+
function serializeResponsiveSelectControl(control) {
|
|
302
|
+
const { options } = control;
|
|
304
303
|
if (typeof options !== "function")
|
|
305
|
-
return [__spreadProps(__spreadValues({},
|
|
304
|
+
return [__spreadProps(__spreadValues({}, control), { options }), []];
|
|
306
305
|
const serializedOptions = serializeFunction(options);
|
|
307
|
-
return [__spreadProps(__spreadValues({},
|
|
306
|
+
return [__spreadProps(__spreadValues({}, control), { options: serializedOptions }), [serializedOptions]];
|
|
308
307
|
}
|
|
309
308
|
function deserializeResponsiveSelectControl(serializedControl) {
|
|
310
309
|
const { options } = serializedControl;
|
|
@@ -313,12 +312,12 @@ function deserializeResponsiveSelectControl(serializedControl) {
|
|
|
313
312
|
const deserializedOptions = deserializeFunction(options);
|
|
314
313
|
return __spreadProps(__spreadValues({}, serializedControl), { options: deserializedOptions });
|
|
315
314
|
}
|
|
316
|
-
function serializeResponsiveLengthControl(
|
|
317
|
-
const { options } =
|
|
315
|
+
function serializeResponsiveLengthControl(control) {
|
|
316
|
+
const { options } = control;
|
|
318
317
|
if (typeof options !== "function")
|
|
319
|
-
return [__spreadProps(__spreadValues({},
|
|
318
|
+
return [__spreadProps(__spreadValues({}, control), { options }), []];
|
|
320
319
|
const serializedOptions = serializeFunction(options);
|
|
321
|
-
return [__spreadProps(__spreadValues({},
|
|
320
|
+
return [__spreadProps(__spreadValues({}, control), { options: serializedOptions }), [serializedOptions]];
|
|
322
321
|
}
|
|
323
322
|
function deserializeResponsiveLengthControl(serializedControl) {
|
|
324
323
|
const { options } = serializedControl;
|
|
@@ -327,12 +326,12 @@ function deserializeResponsiveLengthControl(serializedControl) {
|
|
|
327
326
|
const deserializedOptions = deserializeFunction(options);
|
|
328
327
|
return __spreadProps(__spreadValues({}, serializedControl), { options: deserializedOptions });
|
|
329
328
|
}
|
|
330
|
-
function serializeTextStyleControl(
|
|
331
|
-
const { options } =
|
|
329
|
+
function serializeTextStyleControl(control) {
|
|
330
|
+
const { options } = control;
|
|
332
331
|
if (typeof options !== "function")
|
|
333
|
-
return [__spreadProps(__spreadValues({},
|
|
332
|
+
return [__spreadProps(__spreadValues({}, control), { options }), []];
|
|
334
333
|
const serializedOptions = serializeFunction(options);
|
|
335
|
-
return [__spreadProps(__spreadValues({},
|
|
334
|
+
return [__spreadProps(__spreadValues({}, control), { options: serializedOptions }), [serializedOptions]];
|
|
336
335
|
}
|
|
337
336
|
function deserializeTextStyleControl(serializedControl) {
|
|
338
337
|
const { options } = serializedControl;
|
|
@@ -341,12 +340,12 @@ function deserializeTextStyleControl(serializedControl) {
|
|
|
341
340
|
const deserializedOptions = deserializeFunction(options);
|
|
342
341
|
return __spreadProps(__spreadValues({}, serializedControl), { options: deserializedOptions });
|
|
343
342
|
}
|
|
344
|
-
function serializeImageControl(
|
|
345
|
-
const { options } =
|
|
343
|
+
function serializeImageControl(control) {
|
|
344
|
+
const { options } = control;
|
|
346
345
|
if (typeof options !== "function")
|
|
347
|
-
return [__spreadProps(__spreadValues({},
|
|
346
|
+
return [__spreadProps(__spreadValues({}, control), { options }), []];
|
|
348
347
|
const serializedOptions = serializeFunction(options);
|
|
349
|
-
return [__spreadProps(__spreadValues({},
|
|
348
|
+
return [__spreadProps(__spreadValues({}, control), { options: serializedOptions }), [serializedOptions]];
|
|
350
349
|
}
|
|
351
350
|
function deserializeImageControl(serializedControl) {
|
|
352
351
|
const { options } = serializedControl;
|
|
@@ -355,12 +354,12 @@ function deserializeImageControl(serializedControl) {
|
|
|
355
354
|
const deserializedOptions = deserializeFunction(options);
|
|
356
355
|
return __spreadProps(__spreadValues({}, serializedControl), { options: deserializedOptions });
|
|
357
356
|
}
|
|
358
|
-
function serializeRichTextControl(
|
|
359
|
-
const { options } =
|
|
357
|
+
function serializeRichTextControl(control) {
|
|
358
|
+
const { options } = control;
|
|
360
359
|
if (typeof options !== "function")
|
|
361
|
-
return [__spreadProps(__spreadValues({},
|
|
360
|
+
return [__spreadProps(__spreadValues({}, control), { options }), []];
|
|
362
361
|
const serializedOptions = serializeFunction(options);
|
|
363
|
-
return [__spreadProps(__spreadValues({},
|
|
362
|
+
return [__spreadProps(__spreadValues({}, control), { options: serializedOptions }), [serializedOptions]];
|
|
364
363
|
}
|
|
365
364
|
function deserializeRichTextControl(serializedControl) {
|
|
366
365
|
const { options } = serializedControl;
|
|
@@ -369,52 +368,52 @@ function deserializeRichTextControl(serializedControl) {
|
|
|
369
368
|
const deserializedOptions = deserializeFunction(options);
|
|
370
369
|
return __spreadProps(__spreadValues({}, serializedControl), { options: deserializedOptions });
|
|
371
370
|
}
|
|
372
|
-
function serializeControl(control
|
|
373
|
-
switch (control
|
|
371
|
+
function serializeControl(control) {
|
|
372
|
+
switch (control.type) {
|
|
374
373
|
case richText.Types.Checkbox:
|
|
375
|
-
return serializeCheckboxControl(control
|
|
374
|
+
return serializeCheckboxControl(control);
|
|
376
375
|
case richText.Types.List:
|
|
377
|
-
return serializeListControl(control
|
|
376
|
+
return serializeListControl(control);
|
|
378
377
|
case richText.Types.Shape:
|
|
379
|
-
return serializeShapeControl(control
|
|
378
|
+
return serializeShapeControl(control);
|
|
380
379
|
case richText.Types.Typeahead:
|
|
381
|
-
return serializeTypeaheadControl(control
|
|
380
|
+
return serializeTypeaheadControl(control);
|
|
382
381
|
case richText.Types.GapX:
|
|
383
|
-
return serializeGapXControl(control
|
|
382
|
+
return serializeGapXControl(control);
|
|
384
383
|
case richText.Types.GapY:
|
|
385
|
-
return serializeGapYControl(control
|
|
384
|
+
return serializeGapYControl(control);
|
|
386
385
|
case richText.Types.ResponsiveColor:
|
|
387
|
-
return serializeResponsiveColorControl(control
|
|
386
|
+
return serializeResponsiveColorControl(control);
|
|
388
387
|
case richText.Types.ResponsiveNumber:
|
|
389
|
-
return serializeResponsiveNumberControl(control
|
|
388
|
+
return serializeResponsiveNumberControl(control);
|
|
390
389
|
case richText.Types.Number:
|
|
391
|
-
return serializeNumberControl(control
|
|
390
|
+
return serializeNumberControl(control);
|
|
392
391
|
case richText.Types.ResponsiveIconRadioGroup:
|
|
393
|
-
return serializeResponsiveIconRadioGroupControl(control
|
|
392
|
+
return serializeResponsiveIconRadioGroupControl(control);
|
|
394
393
|
case richText.Types.ResponsiveSelect:
|
|
395
|
-
return serializeResponsiveSelectControl(control
|
|
394
|
+
return serializeResponsiveSelectControl(control);
|
|
396
395
|
case richText.Types.ResponsiveLength:
|
|
397
|
-
return serializeResponsiveLengthControl(control
|
|
396
|
+
return serializeResponsiveLengthControl(control);
|
|
398
397
|
case richText.Types.Date:
|
|
399
|
-
return serializeDateControl(control
|
|
398
|
+
return serializeDateControl(control);
|
|
400
399
|
case richText.Types.Link:
|
|
401
|
-
return serializeLinkControl(control
|
|
400
|
+
return serializeLinkControl(control);
|
|
402
401
|
case richText.Types.TextInput:
|
|
403
|
-
return serializeTextInputControl(control
|
|
402
|
+
return serializeTextInputControl(control);
|
|
404
403
|
case richText.Types.TextStyle:
|
|
405
|
-
return serializeTextStyleControl(control
|
|
404
|
+
return serializeTextStyleControl(control);
|
|
406
405
|
case richText.Types.Image:
|
|
407
|
-
return serializeImageControl(control
|
|
406
|
+
return serializeImageControl(control);
|
|
408
407
|
case richText.Types.RichText:
|
|
409
|
-
return serializeRichTextControl(control
|
|
408
|
+
return serializeRichTextControl(control);
|
|
410
409
|
case combobox.ComboboxControlType:
|
|
411
|
-
return serializeComboboxControlDefinition(control
|
|
412
|
-
case
|
|
413
|
-
return serializeShapeControlDefinition(control
|
|
414
|
-
case
|
|
415
|
-
return serializeListControlDefinition(control
|
|
410
|
+
return serializeComboboxControlDefinition(control);
|
|
411
|
+
case richText.ShapeControlType:
|
|
412
|
+
return serializeShapeControlDefinition(control);
|
|
413
|
+
case richText.ListControlType:
|
|
414
|
+
return serializeListControlDefinition(control);
|
|
416
415
|
default:
|
|
417
|
-
return [control
|
|
416
|
+
return [control, []];
|
|
418
417
|
}
|
|
419
418
|
}
|
|
420
419
|
function deserializeControl(serializedControl) {
|
|
@@ -457,17 +456,17 @@ function deserializeControl(serializedControl) {
|
|
|
457
456
|
return deserializeRichTextControl(serializedControl);
|
|
458
457
|
case combobox.ComboboxControlType:
|
|
459
458
|
return deserializeComboboxControlDefinition(serializedControl);
|
|
460
|
-
case
|
|
459
|
+
case richText.ShapeControlType:
|
|
461
460
|
return deserializeShapeControlDefinition(serializedControl);
|
|
462
|
-
case
|
|
461
|
+
case richText.ListControlType:
|
|
463
462
|
return deserializeListControlDefinition(serializedControl);
|
|
464
463
|
default:
|
|
465
464
|
return serializedControl;
|
|
466
465
|
}
|
|
467
466
|
}
|
|
468
467
|
function serializeControls(controls) {
|
|
469
|
-
return Object.entries(controls).reduce(([accControls, accTransferables], [key,
|
|
470
|
-
const [serializedControl, transferables] = serializeControl(
|
|
468
|
+
return Object.entries(controls).reduce(([accControls, accTransferables], [key, control]) => {
|
|
469
|
+
const [serializedControl, transferables] = serializeControl(control);
|
|
471
470
|
return [__spreadProps(__spreadValues({}, accControls), { [key]: serializedControl }), [...accTransferables, ...transferables]];
|
|
472
471
|
}, [{}, []]);
|
|
473
472
|
}
|