@makeswift/runtime 0.20.3 → 0.20.4-canary.1
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/cjs/next/api-handler/handlers/manifest.js +1 -1
- package/dist/cjs/runtimes/react/controls.js +59 -475
- package/dist/cjs/runtimes/react/controls.js.map +1 -1
- package/dist/cjs/runtimes/react/legacy-controls.js +344 -0
- package/dist/cjs/runtimes/react/legacy-controls.js.map +1 -0
- package/dist/cjs/utils/deepEqual.js +2 -29
- package/dist/cjs/utils/deepEqual.js.map +1 -1
- package/dist/cjs/utils/is.js +3 -6
- package/dist/cjs/utils/is.js.map +1 -1
- package/dist/cjs/utils/partition.js +48 -0
- package/dist/cjs/utils/partition.js.map +1 -0
- package/dist/cjs/utils/shallowEqual.js +2 -28
- package/dist/cjs/utils/shallowEqual.js.map +1 -1
- package/dist/esm/next/api-handler/handlers/manifest.js +1 -1
- package/dist/esm/runtimes/react/controls.js +58 -507
- package/dist/esm/runtimes/react/controls.js.map +1 -1
- package/dist/esm/runtimes/react/legacy-controls.js +356 -0
- package/dist/esm/runtimes/react/legacy-controls.js.map +1 -0
- package/dist/esm/utils/deepEqual.js +1 -18
- package/dist/esm/utils/deepEqual.js.map +1 -1
- package/dist/esm/utils/is.js +3 -6
- package/dist/esm/utils/is.js.map +1 -1
- package/dist/esm/utils/partition.js +23 -0
- package/dist/esm/utils/partition.js.map +1 -0
- package/dist/esm/utils/shallowEqual.js +1 -17
- package/dist/esm/utils/shallowEqual.js.map +1 -1
- package/dist/types/runtimes/react/controls.d.ts +0 -6
- package/dist/types/runtimes/react/controls.d.ts.map +1 -1
- package/dist/types/runtimes/react/legacy-controls.d.ts +7 -0
- package/dist/types/runtimes/react/legacy-controls.d.ts.map +1 -0
- package/dist/types/utils/__tests__/partition.test.d.ts +2 -0
- package/dist/types/utils/__tests__/partition.test.d.ts.map +1 -0
- package/dist/types/utils/deepEqual.d.ts +1 -1
- package/dist/types/utils/deepEqual.d.ts.map +1 -1
- package/dist/types/utils/is.d.ts +2 -1
- package/dist/types/utils/is.d.ts.map +1 -1
- package/dist/types/utils/partition.d.ts +19 -0
- package/dist/types/utils/partition.d.ts.map +1 -0
- package/dist/types/utils/shallowEqual.d.ts +1 -1
- package/dist/types/utils/shallowEqual.d.ts.map +1 -1
- package/package.json +3 -3
|
@@ -36,7 +36,7 @@ async function handler(...args) {
|
|
|
36
36
|
const supportsPreviewMode = (0, import_ts_pattern.match)(args).with(routeHandlerPattern, () => false).with(apiRoutePattern, () => true).exhaustive();
|
|
37
37
|
const supportsDraftMode = (0, import_ts_pattern.match)(args).with(routeHandlerPattern, () => true).with(apiRoutePattern, () => false).exhaustive();
|
|
38
38
|
const body = {
|
|
39
|
-
version: "0.20.
|
|
39
|
+
version: "0.20.4-canary.1",
|
|
40
40
|
previewMode: supportsPreviewMode,
|
|
41
41
|
draftMode: supportsDraftMode,
|
|
42
42
|
interactionMode: true,
|
|
@@ -28,69 +28,24 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
29
|
var controls_exports = {};
|
|
30
30
|
__export(controls_exports, {
|
|
31
|
-
PropsValue: () => PropsValue
|
|
32
|
-
useBorderRadiusStyle: () => useBorderRadiusStyle,
|
|
33
|
-
useBorderStyle: () => useBorderStyle,
|
|
34
|
-
useShadowsStyle: () => useShadowsStyle
|
|
31
|
+
PropsValue: () => PropsValue
|
|
35
32
|
});
|
|
36
33
|
module.exports = __toCommonJS(controls_exports);
|
|
37
34
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
38
35
|
var import_react = require("react");
|
|
39
36
|
var ReactPage = __toESM(require("../../state/react-page"));
|
|
40
|
-
var import_hooks = require("../../components/hooks");
|
|
41
|
-
var import_responsive_style = require("../../components/utils/responsive-style");
|
|
42
37
|
var import_controls = require("../../controls");
|
|
38
|
+
var import_descriptors = require("../../prop-controllers/descriptors");
|
|
43
39
|
var import_style = require("./controls/style");
|
|
44
40
|
var import_control = require("./controls/control");
|
|
45
|
-
var import_components = require("./components");
|
|
46
41
|
var import_slot = require("./controls/slot");
|
|
47
|
-
var import_use_style = require("./use-style");
|
|
48
42
|
var import_rich_text = require("./controls/rich-text/rich-text");
|
|
49
43
|
var import_rich_text_v2 = require("./controls/rich-text-v2");
|
|
50
44
|
var import_use_store = require("./hooks/use-store");
|
|
51
45
|
var import_use_document_key = require("./hooks/use-document-key");
|
|
52
46
|
var import_use_selector = require("./hooks/use-selector");
|
|
53
|
-
var
|
|
54
|
-
var
|
|
55
|
-
var import_useResponsiveLengthPropControllerData = require("../../components/hooks/useResponsiveLengthPropControllerData");
|
|
56
|
-
var import_useNumberPropControllerData = require("../../components/hooks/useNumberPropControllerData");
|
|
57
|
-
var import_useResponsiveColorPropControllerData = require("../../components/hooks/useResponsiveColorPropControllerData");
|
|
58
|
-
var import_useTextStylePropControllerData = require("../../components/hooks/useTextStylePropControllerData");
|
|
59
|
-
var import_useNavigationLinksPropControllerData = require("../../components/hooks/useNavigationLinksPropControllerData");
|
|
60
|
-
var import_useTextAreaPropControllerData = require("../../components/hooks/useTextAreaPropControllerData");
|
|
61
|
-
var import_usePropValue = require("../../components/hooks/usePropValue");
|
|
62
|
-
var import_useGapYPropControllerData = require("../../components/hooks/useGapYPropControllerData");
|
|
63
|
-
var import_useElementIDPropControllerData = require("../../components/hooks/useElementIDPropControllerData");
|
|
64
|
-
var import_useTableFormFieldsPropControllerData = require("../../components/hooks/useTableFormFieldsPropControllerData");
|
|
65
|
-
var import_useGridPropControllerData = require("../../components/hooks/useGridPropControllerData");
|
|
66
|
-
var import_useImagePropControllerData = require("../../components/hooks/useImagePropControllerData");
|
|
67
|
-
var import_useImagesPropControllerData = require("../../components/hooks/useImagesPropControllerData");
|
|
68
|
-
var import_useBackgroundsPropControllerData = require("../../components/hooks/useBackgroundsPropControllerData");
|
|
69
|
-
var import_useTextInputPropControllerData = require("../../components/hooks/useTextInputPropControllerData");
|
|
70
|
-
function useWidthStyle(data, descriptor) {
|
|
71
|
-
const value = (0, import_prop_controllers.getWidthPropControllerDataResponsiveLengthData)(data);
|
|
72
|
-
return (0, import_use_style.useStyle)((0, import_responsive_style.useResponsiveWidth)(value, descriptor.options.defaultValue));
|
|
73
|
-
}
|
|
74
|
-
function usePaddingStyle(data) {
|
|
75
|
-
const value = (0, import_prop_controllers.getPaddingPropControllerDataResponsivePaddingData)(data);
|
|
76
|
-
return (0, import_use_style.useStyle)((0, import_responsive_style.useResponsivePadding)(value));
|
|
77
|
-
}
|
|
78
|
-
function useMarginStyle(data) {
|
|
79
|
-
const value = (0, import_prop_controllers.getMarginPropControllerDataResponsiveMarginData)(data);
|
|
80
|
-
return (0, import_use_style.useStyle)((0, import_responsive_style.useResponsiveMargin)(value));
|
|
81
|
-
}
|
|
82
|
-
function useBorderRadiusStyle(data) {
|
|
83
|
-
const value = (0, import_prop_controllers.getBorderRadiusPropControllerDataResponsiveBorderRadiusData)(data);
|
|
84
|
-
return (0, import_use_style.useStyle)((0, import_responsive_style.useResponsiveBorderRadius)(value));
|
|
85
|
-
}
|
|
86
|
-
function useShadowsStyle(data) {
|
|
87
|
-
return (0, import_use_style.useStyle)((0, import_responsive_style.useResponsiveShadow)((0, import_hooks.useBoxShadow)(data) ?? void 0));
|
|
88
|
-
}
|
|
89
|
-
function useBorderStyle(data) {
|
|
90
|
-
const value = (0, import_prop_controllers.getBorderPropControllerDataResponsiveBorderData)(data);
|
|
91
|
-
const borderData = (0, import_hooks.useBorder)(value);
|
|
92
|
-
return (0, import_use_style.useStyle)((0, import_responsive_style.useResponsiveBorder)(borderData ?? void 0));
|
|
93
|
-
}
|
|
47
|
+
var import_components = require("./components");
|
|
48
|
+
var import_legacy_controls = require("./legacy-controls");
|
|
94
49
|
function PropsValue({ element, children }) {
|
|
95
50
|
const store = (0, import_use_store.useStore)();
|
|
96
51
|
const propControllerDescriptorsRef = (0, import_react.useRef)(
|
|
@@ -105,467 +60,96 @@ function PropsValue({ element, children }) {
|
|
|
105
60
|
});
|
|
106
61
|
return Object.entries(propControllerDescriptorsRef.current).reduceRight(
|
|
107
62
|
(renderFn, [propName, descriptor]) => (propsValue) => {
|
|
108
|
-
if (
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
case import_controls.IconRadioGroupDefinition.type:
|
|
117
|
-
case import_controls.ImageDefinition.type:
|
|
118
|
-
case import_controls.ComboboxDefinition.type:
|
|
119
|
-
case import_controls.ShapeDefinition.type:
|
|
120
|
-
case import_controls.ListDefinition.type:
|
|
121
|
-
case import_controls.LinkDefinition.type:
|
|
122
|
-
case import_controls.StyleV2Definition.type:
|
|
123
|
-
case import_controls.unstable_TypographyDefinition.type:
|
|
124
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
125
|
-
import_control.ControlValue,
|
|
126
|
-
{
|
|
127
|
-
definition: descriptor,
|
|
128
|
-
data: props[propName],
|
|
129
|
-
control: propControllers?.[propName],
|
|
130
|
-
children: (value) => renderFn({ ...propsValue, [propName]: value })
|
|
131
|
-
}
|
|
132
|
-
);
|
|
133
|
-
case import_controls.StyleDefinition.type: {
|
|
134
|
-
const control = propControllers?.[propName] ?? null;
|
|
135
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
136
|
-
import_components.RenderHook,
|
|
137
|
-
{
|
|
138
|
-
hook: import_style.useFormattedStyle,
|
|
139
|
-
parameters: [props[propName], descriptor, control],
|
|
140
|
-
children: (value) => renderFn({ ...propsValue, [propName]: value })
|
|
141
|
-
},
|
|
142
|
-
descriptor.controlType
|
|
143
|
-
);
|
|
144
|
-
}
|
|
145
|
-
case import_controls.RichTextV1Definition.type: {
|
|
146
|
-
const control = propControllers?.[propName] ?? null;
|
|
147
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
148
|
-
import_components.RenderHook,
|
|
149
|
-
{
|
|
150
|
-
hook: import_rich_text.useRichText,
|
|
151
|
-
parameters: [props[propName], control],
|
|
152
|
-
children: (value) => renderFn({ ...propsValue, [propName]: value })
|
|
153
|
-
},
|
|
154
|
-
descriptor.controlType
|
|
155
|
-
);
|
|
156
|
-
}
|
|
157
|
-
case import_controls.RichTextV2Definition.type: {
|
|
158
|
-
const control = propControllers?.[propName] ?? null;
|
|
159
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
160
|
-
import_components.RenderHook,
|
|
161
|
-
{
|
|
162
|
-
hook: import_rich_text_v2.useRichTextV2,
|
|
163
|
-
parameters: [props[propName], descriptor, control],
|
|
164
|
-
children: (value) => renderFn({ ...propsValue, [propName]: value })
|
|
165
|
-
},
|
|
166
|
-
descriptor.controlType
|
|
167
|
-
);
|
|
168
|
-
}
|
|
169
|
-
case import_controls.SlotDefinition.type: {
|
|
170
|
-
const control = propControllers?.[propName] ?? null;
|
|
171
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
172
|
-
import_components.RenderHook,
|
|
173
|
-
{
|
|
174
|
-
hook: import_slot.useSlot,
|
|
175
|
-
parameters: [props[propName], control],
|
|
176
|
-
children: (value) => renderFn({ ...propsValue, [propName]: value })
|
|
177
|
-
},
|
|
178
|
-
descriptor.controlType
|
|
179
|
-
);
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
console.error(`Unknown control type: ${descriptor.controlType}`);
|
|
183
|
-
return renderFn({ ...propsValue, [propName]: props[propName] });
|
|
63
|
+
if ((0, import_descriptors.isLegacyDescriptor)(descriptor)) {
|
|
64
|
+
return (0, import_legacy_controls.resolveLegacyDescriptorProp)(
|
|
65
|
+
descriptor,
|
|
66
|
+
propName,
|
|
67
|
+
props[propName],
|
|
68
|
+
propsValue,
|
|
69
|
+
renderFn
|
|
70
|
+
);
|
|
184
71
|
}
|
|
185
|
-
switch (descriptor.
|
|
186
|
-
case
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
return renderFn({
|
|
201
|
-
...propsValue,
|
|
202
|
-
[propName]: (0, import_prop_controllers.getWidthPropControllerDataResponsiveLengthData)(props[propName])
|
|
203
|
-
});
|
|
204
|
-
}
|
|
205
|
-
case import_prop_controllers.Types.Padding:
|
|
206
|
-
switch (descriptor.options.format) {
|
|
207
|
-
case import_prop_controllers.PaddingPropControllerFormat.ClassName:
|
|
208
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
209
|
-
import_components.RenderHook,
|
|
210
|
-
{
|
|
211
|
-
hook: usePaddingStyle,
|
|
212
|
-
parameters: [props[propName]],
|
|
213
|
-
children: (value) => renderFn({ ...propsValue, [propName]: value })
|
|
214
|
-
},
|
|
215
|
-
descriptor.type
|
|
216
|
-
);
|
|
217
|
-
case import_prop_controllers.PaddingPropControllerFormat.ResponsiveValue:
|
|
218
|
-
default:
|
|
219
|
-
return renderFn({
|
|
220
|
-
...propsValue,
|
|
221
|
-
[propName]: (0, import_prop_controllers.getPaddingPropControllerDataResponsivePaddingData)(props[propName])
|
|
222
|
-
});
|
|
223
|
-
}
|
|
224
|
-
case import_prop_controllers.Types.Margin:
|
|
225
|
-
switch (descriptor.options.format) {
|
|
226
|
-
case import_prop_controllers.MarginPropControllerFormat.ClassName:
|
|
227
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
228
|
-
import_components.RenderHook,
|
|
229
|
-
{
|
|
230
|
-
hook: useMarginStyle,
|
|
231
|
-
parameters: [props[propName]],
|
|
232
|
-
children: (value) => renderFn({ ...propsValue, [propName]: value })
|
|
233
|
-
},
|
|
234
|
-
descriptor.type
|
|
235
|
-
);
|
|
236
|
-
case import_prop_controllers.MarginPropControllerFormat.ResponsiveValue:
|
|
237
|
-
default:
|
|
238
|
-
return renderFn({
|
|
239
|
-
...propsValue,
|
|
240
|
-
[propName]: (0, import_prop_controllers.getMarginPropControllerDataResponsiveMarginData)(props[propName])
|
|
241
|
-
});
|
|
242
|
-
}
|
|
243
|
-
case import_prop_controllers.Types.BorderRadius:
|
|
244
|
-
switch (descriptor.options.format) {
|
|
245
|
-
case import_prop_controllers.BorderRadiusPropControllerFormat.ClassName:
|
|
246
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
247
|
-
import_components.RenderHook,
|
|
248
|
-
{
|
|
249
|
-
hook: useBorderRadiusStyle,
|
|
250
|
-
parameters: [props[propName]],
|
|
251
|
-
children: (value) => renderFn({ ...propsValue, [propName]: value })
|
|
252
|
-
},
|
|
253
|
-
descriptor.type
|
|
254
|
-
);
|
|
255
|
-
case import_prop_controllers.BorderRadiusPropControllerFormat.ResponsiveValue:
|
|
256
|
-
default:
|
|
257
|
-
return renderFn({
|
|
258
|
-
...propsValue,
|
|
259
|
-
[propName]: (0, import_prop_controllers.getBorderRadiusPropControllerDataResponsiveBorderRadiusData)(
|
|
260
|
-
props[propName]
|
|
261
|
-
)
|
|
262
|
-
});
|
|
263
|
-
}
|
|
264
|
-
case import_prop_controllers.Types.Backgrounds:
|
|
72
|
+
switch (descriptor.controlType) {
|
|
73
|
+
case import_controls.CheckboxDefinition.type:
|
|
74
|
+
case import_controls.NumberDefinition.type:
|
|
75
|
+
case import_controls.TextInputDefinition.type:
|
|
76
|
+
case import_controls.TextAreaDefinition.type:
|
|
77
|
+
case import_controls.SelectDefinition.type:
|
|
78
|
+
case import_controls.ColorDefinition.type:
|
|
79
|
+
case import_controls.IconRadioGroupDefinition.type:
|
|
80
|
+
case import_controls.ImageDefinition.type:
|
|
81
|
+
case import_controls.ComboboxDefinition.type:
|
|
82
|
+
case import_controls.ShapeDefinition.type:
|
|
83
|
+
case import_controls.ListDefinition.type:
|
|
84
|
+
case import_controls.LinkDefinition.type:
|
|
85
|
+
case import_controls.StyleV2Definition.type:
|
|
86
|
+
case import_controls.unstable_TypographyDefinition.type:
|
|
265
87
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
266
|
-
|
|
88
|
+
import_control.ControlValue,
|
|
267
89
|
{
|
|
268
|
-
|
|
269
|
-
|
|
90
|
+
definition: descriptor,
|
|
91
|
+
data: props[propName],
|
|
92
|
+
control: propControllers?.[propName],
|
|
270
93
|
children: (value) => renderFn({ ...propsValue, [propName]: value })
|
|
271
|
-
}
|
|
272
|
-
descriptor.type
|
|
94
|
+
}
|
|
273
95
|
);
|
|
274
|
-
case
|
|
96
|
+
case import_controls.StyleDefinition.type: {
|
|
97
|
+
const control = propControllers?.[propName] ?? null;
|
|
275
98
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
276
99
|
import_components.RenderHook,
|
|
277
100
|
{
|
|
278
|
-
hook:
|
|
279
|
-
parameters: [props[propName]],
|
|
101
|
+
hook: import_style.useFormattedStyle,
|
|
102
|
+
parameters: [props[propName], descriptor, control],
|
|
280
103
|
children: (value) => renderFn({ ...propsValue, [propName]: value })
|
|
281
104
|
},
|
|
282
|
-
descriptor.
|
|
105
|
+
descriptor.controlType
|
|
283
106
|
);
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
{
|
|
288
|
-
hook: import_useImagesPropControllerData.useImagesPropControllerData,
|
|
289
|
-
parameters: [props[propName]],
|
|
290
|
-
children: (value) => renderFn({ ...propsValue, [propName]: value })
|
|
291
|
-
},
|
|
292
|
-
descriptor.type
|
|
293
|
-
);
|
|
294
|
-
case import_prop_controllers.Types.Number:
|
|
295
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
296
|
-
import_components.RenderHook,
|
|
297
|
-
{
|
|
298
|
-
hook: import_useNumberPropControllerData.useNumberPropControllerData,
|
|
299
|
-
parameters: [props[propName]],
|
|
300
|
-
children: (value) => renderFn({ ...propsValue, [propName]: value })
|
|
301
|
-
},
|
|
302
|
-
descriptor.type
|
|
303
|
-
);
|
|
304
|
-
case import_prop_controllers.Types.ResponsiveNumber:
|
|
305
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
306
|
-
import_components.RenderHook,
|
|
307
|
-
{
|
|
308
|
-
hook: (data) => (0, import_usePropValue.usePropValue)(import_prop_controllers.ResponsiveNumber, data),
|
|
309
|
-
parameters: [props[propName]],
|
|
310
|
-
children: (value) => renderFn({ ...propsValue, [propName]: value })
|
|
311
|
-
},
|
|
312
|
-
descriptor.type
|
|
313
|
-
);
|
|
314
|
-
case import_prop_controllers.Types.ResponsiveIconRadioGroup:
|
|
315
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
316
|
-
import_components.RenderHook,
|
|
317
|
-
{
|
|
318
|
-
hook: (data) => (0, import_usePropValue.usePropValue)(import_prop_controllers.ResponsiveIconRadioGroup, data),
|
|
319
|
-
parameters: [props[propName]],
|
|
320
|
-
children: (value) => renderFn({ ...propsValue, [propName]: value })
|
|
321
|
-
},
|
|
322
|
-
descriptor.type
|
|
323
|
-
);
|
|
324
|
-
case import_prop_controllers.Types.ResponsiveSelect:
|
|
325
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
326
|
-
import_components.RenderHook,
|
|
327
|
-
{
|
|
328
|
-
hook: (data) => (0, import_usePropValue.usePropValue)(import_prop_controllers.ResponsiveSelect, data),
|
|
329
|
-
parameters: [props[propName]],
|
|
330
|
-
children: (value) => renderFn({ ...propsValue, [propName]: value })
|
|
331
|
-
},
|
|
332
|
-
descriptor.type
|
|
333
|
-
);
|
|
334
|
-
case import_prop_controllers.Types.ResponsiveOpacity:
|
|
335
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
336
|
-
import_components.RenderHook,
|
|
337
|
-
{
|
|
338
|
-
hook: (data) => (0, import_usePropValue.usePropValue)(import_prop_controllers.ResponsiveOpacity, data),
|
|
339
|
-
parameters: [props[propName]],
|
|
340
|
-
children: (value) => renderFn({ ...propsValue, [propName]: value })
|
|
341
|
-
},
|
|
342
|
-
descriptor.type
|
|
343
|
-
);
|
|
344
|
-
case import_prop_controllers.Types.ResponsiveLength:
|
|
345
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
346
|
-
import_components.RenderHook,
|
|
347
|
-
{
|
|
348
|
-
hook: import_useResponsiveLengthPropControllerData.useResponsiveLengthPropControllerData,
|
|
349
|
-
parameters: [props[propName]],
|
|
350
|
-
children: (value) => renderFn({ ...propsValue, [propName]: value })
|
|
351
|
-
},
|
|
352
|
-
descriptor.type
|
|
353
|
-
);
|
|
354
|
-
case import_prop_controllers.Types.Shadows:
|
|
355
|
-
switch (descriptor.options.format) {
|
|
356
|
-
case import_prop_controllers.Shadows.Format.ClassName:
|
|
357
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
358
|
-
import_components.RenderHook,
|
|
359
|
-
{
|
|
360
|
-
hook: useShadowsStyle,
|
|
361
|
-
parameters: [props[propName]],
|
|
362
|
-
children: (value) => renderFn({ ...propsValue, [propName]: value })
|
|
363
|
-
},
|
|
364
|
-
descriptor.type
|
|
365
|
-
);
|
|
366
|
-
case import_prop_controllers.Shadows.Format.ResponsiveValue:
|
|
367
|
-
default:
|
|
368
|
-
return renderFn({
|
|
369
|
-
...propsValue,
|
|
370
|
-
[propName]: (0, import_prop_controllers.getShadowsPropControllerDataResponsiveShadowsData)(props[propName])
|
|
371
|
-
});
|
|
372
|
-
}
|
|
373
|
-
case import_prop_controllers.Types.Border:
|
|
374
|
-
switch (descriptor.options.format) {
|
|
375
|
-
case import_prop_controllers.BorderPropControllerFormat.ClassName:
|
|
376
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
377
|
-
import_components.RenderHook,
|
|
378
|
-
{
|
|
379
|
-
hook: useBorderStyle,
|
|
380
|
-
parameters: [props[propName]],
|
|
381
|
-
children: (value) => renderFn({ ...propsValue, [propName]: value })
|
|
382
|
-
},
|
|
383
|
-
descriptor.type
|
|
384
|
-
);
|
|
385
|
-
case import_prop_controllers.BorderPropControllerFormat.ResponsiveValue:
|
|
386
|
-
default:
|
|
387
|
-
return renderFn({
|
|
388
|
-
...propsValue,
|
|
389
|
-
[propName]: (0, import_prop_controllers.getBorderPropControllerDataResponsiveBorderData)(props[propName])
|
|
390
|
-
});
|
|
391
|
-
}
|
|
392
|
-
case import_prop_controllers.Types.ResponsiveColor:
|
|
393
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
394
|
-
import_components.RenderHook,
|
|
395
|
-
{
|
|
396
|
-
hook: import_useResponsiveColorPropControllerData.useResponsiveColorPropControllerData,
|
|
397
|
-
parameters: [props[propName]],
|
|
398
|
-
children: (value) => renderFn({ ...propsValue, [propName]: value })
|
|
399
|
-
},
|
|
400
|
-
descriptor.type
|
|
401
|
-
);
|
|
402
|
-
case import_prop_controllers.Types.Link:
|
|
403
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
404
|
-
import_components.RenderHook,
|
|
405
|
-
{
|
|
406
|
-
hook: import_hooks.useLinkPropControllerData,
|
|
407
|
-
parameters: [props[propName]],
|
|
408
|
-
children: (value) => renderFn({ ...propsValue, [propName]: value })
|
|
409
|
-
},
|
|
410
|
-
descriptor.type
|
|
411
|
-
);
|
|
412
|
-
case import_prop_controllers.Types.Checkbox:
|
|
413
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
414
|
-
import_components.RenderHook,
|
|
415
|
-
{
|
|
416
|
-
hook: import_hooks.useCheckboxPropControllerData,
|
|
417
|
-
parameters: [props[propName]],
|
|
418
|
-
children: (value) => renderFn({ ...propsValue, [propName]: value })
|
|
419
|
-
},
|
|
420
|
-
descriptor.type
|
|
421
|
-
);
|
|
422
|
-
case import_prop_controllers.Types.Date:
|
|
423
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
424
|
-
import_components.RenderHook,
|
|
425
|
-
{
|
|
426
|
-
hook: import_hooks.useDatePropControllerData,
|
|
427
|
-
parameters: [props[propName]],
|
|
428
|
-
children: (value) => renderFn({ ...propsValue, [propName]: value })
|
|
429
|
-
},
|
|
430
|
-
descriptor.type
|
|
431
|
-
);
|
|
432
|
-
case import_prop_controllers.Types.Font:
|
|
433
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
434
|
-
import_components.RenderHook,
|
|
435
|
-
{
|
|
436
|
-
hook: import_hooks.useFontPropControllerData,
|
|
437
|
-
parameters: [props[propName]],
|
|
438
|
-
children: (value) => renderFn({ ...propsValue, [propName]: value })
|
|
439
|
-
},
|
|
440
|
-
descriptor.type
|
|
441
|
-
);
|
|
442
|
-
case import_prop_controllers.Types.Video:
|
|
443
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
444
|
-
import_components.RenderHook,
|
|
445
|
-
{
|
|
446
|
-
hook: import_hooks.useVideoPropControllerData,
|
|
447
|
-
parameters: [props[propName]],
|
|
448
|
-
children: (value) => renderFn({ ...propsValue, [propName]: value })
|
|
449
|
-
},
|
|
450
|
-
descriptor.type
|
|
451
|
-
);
|
|
452
|
-
case import_prop_controllers.Types.Table:
|
|
453
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
454
|
-
import_components.RenderHook,
|
|
455
|
-
{
|
|
456
|
-
hook: import_hooks.useTablePropControllerData,
|
|
457
|
-
parameters: [props[propName]],
|
|
458
|
-
children: (value) => renderFn({ ...propsValue, [propName]: value })
|
|
459
|
-
},
|
|
460
|
-
descriptor.type
|
|
461
|
-
);
|
|
462
|
-
case import_prop_controllers.Types.TextStyle:
|
|
463
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
464
|
-
import_components.RenderHook,
|
|
465
|
-
{
|
|
466
|
-
hook: import_useTextStylePropControllerData.useTextStylePropControllerData,
|
|
467
|
-
parameters: [props[propName]],
|
|
468
|
-
children: (value) => renderFn({ ...propsValue, [propName]: value })
|
|
469
|
-
},
|
|
470
|
-
descriptor.type
|
|
471
|
-
);
|
|
472
|
-
case import_prop_controllers.Types.NavigationLinks:
|
|
473
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
474
|
-
import_components.RenderHook,
|
|
475
|
-
{
|
|
476
|
-
hook: import_useNavigationLinksPropControllerData.useNavigationLinksPropControllerData,
|
|
477
|
-
parameters: [props[propName]],
|
|
478
|
-
children: (value) => renderFn({ ...propsValue, [propName]: value })
|
|
479
|
-
},
|
|
480
|
-
descriptor.type
|
|
481
|
-
);
|
|
482
|
-
case import_prop_controllers.Types.TextInput:
|
|
483
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
484
|
-
import_components.RenderHook,
|
|
485
|
-
{
|
|
486
|
-
hook: import_useTextInputPropControllerData.useTextInputPropControllerData,
|
|
487
|
-
parameters: [props[propName]],
|
|
488
|
-
children: (value) => renderFn({ ...propsValue, [propName]: value })
|
|
489
|
-
},
|
|
490
|
-
descriptor.type
|
|
491
|
-
);
|
|
492
|
-
case import_prop_controllers.Types.TextArea:
|
|
493
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
494
|
-
import_components.RenderHook,
|
|
495
|
-
{
|
|
496
|
-
hook: import_useTextAreaPropControllerData.useTextAreaPropControllerData,
|
|
497
|
-
parameters: [props[propName]],
|
|
498
|
-
children: (value) => renderFn({ ...propsValue, [propName]: value })
|
|
499
|
-
},
|
|
500
|
-
descriptor.type
|
|
501
|
-
);
|
|
502
|
-
case import_prop_controllers.Types.GapX:
|
|
503
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
504
|
-
import_components.RenderHook,
|
|
505
|
-
{
|
|
506
|
-
hook: (data) => (0, import_usePropValue.usePropValue)(import_prop_controllers.GapX, data),
|
|
507
|
-
parameters: [props[propName]],
|
|
508
|
-
children: (value) => renderFn({ ...propsValue, [propName]: value })
|
|
509
|
-
},
|
|
510
|
-
descriptor.type
|
|
511
|
-
);
|
|
512
|
-
case import_prop_controllers.Types.GapY:
|
|
513
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
514
|
-
import_components.RenderHook,
|
|
515
|
-
{
|
|
516
|
-
hook: import_useGapYPropControllerData.useGapYPropControllerData,
|
|
517
|
-
parameters: [props[propName]],
|
|
518
|
-
children: (value) => renderFn({ ...propsValue, [propName]: value })
|
|
519
|
-
},
|
|
520
|
-
descriptor.type
|
|
521
|
-
);
|
|
522
|
-
case import_prop_controllers.Types.ElementID:
|
|
107
|
+
}
|
|
108
|
+
case import_controls.RichTextV1Definition.type: {
|
|
109
|
+
const control = propControllers?.[propName] ?? null;
|
|
523
110
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
524
111
|
import_components.RenderHook,
|
|
525
112
|
{
|
|
526
|
-
hook:
|
|
527
|
-
parameters: [props[propName]],
|
|
113
|
+
hook: import_rich_text.useRichText,
|
|
114
|
+
parameters: [props[propName], control],
|
|
528
115
|
children: (value) => renderFn({ ...propsValue, [propName]: value })
|
|
529
116
|
},
|
|
530
|
-
descriptor.
|
|
117
|
+
descriptor.controlType
|
|
531
118
|
);
|
|
532
|
-
|
|
119
|
+
}
|
|
120
|
+
case import_controls.RichTextV2Definition.type: {
|
|
121
|
+
const control = propControllers?.[propName] ?? null;
|
|
533
122
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
534
123
|
import_components.RenderHook,
|
|
535
124
|
{
|
|
536
|
-
hook:
|
|
537
|
-
parameters: [props[propName]],
|
|
125
|
+
hook: import_rich_text_v2.useRichTextV2,
|
|
126
|
+
parameters: [props[propName], descriptor, control],
|
|
538
127
|
children: (value) => renderFn({ ...propsValue, [propName]: value })
|
|
539
128
|
},
|
|
540
|
-
descriptor.
|
|
129
|
+
descriptor.controlType
|
|
541
130
|
);
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
[propName]: (0, import_prop_controllers.getSocialLinksPropControllerDataSocialLinksData)(props[propName])
|
|
546
|
-
});
|
|
547
|
-
case import_prop_controllers.Types.Grid:
|
|
131
|
+
}
|
|
132
|
+
case import_controls.SlotDefinition.type: {
|
|
133
|
+
const control = propControllers?.[propName] ?? null;
|
|
548
134
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
549
135
|
import_components.RenderHook,
|
|
550
136
|
{
|
|
551
|
-
hook:
|
|
552
|
-
parameters: [props[propName]],
|
|
137
|
+
hook: import_slot.useSlot,
|
|
138
|
+
parameters: [props[propName], control],
|
|
553
139
|
children: (value) => renderFn({ ...propsValue, [propName]: value })
|
|
554
140
|
},
|
|
555
|
-
descriptor.
|
|
141
|
+
descriptor.controlType
|
|
556
142
|
);
|
|
557
|
-
|
|
558
|
-
return renderFn({ ...propsValue, [propName]: props[propName] });
|
|
143
|
+
}
|
|
559
144
|
}
|
|
145
|
+
console.error(`Unknown control type: ${descriptor.controlType}`);
|
|
146
|
+
return renderFn({ ...propsValue, [propName]: props[propName] });
|
|
560
147
|
},
|
|
561
148
|
children
|
|
562
149
|
)({});
|
|
563
150
|
}
|
|
564
151
|
// Annotate the CommonJS export names for ESM import in node:
|
|
565
152
|
0 && (module.exports = {
|
|
566
|
-
PropsValue
|
|
567
|
-
useBorderRadiusStyle,
|
|
568
|
-
useBorderStyle,
|
|
569
|
-
useShadowsStyle
|
|
153
|
+
PropsValue
|
|
570
154
|
});
|
|
571
155
|
//# sourceMappingURL=controls.js.map
|