@makeswift/runtime 0.9.3 → 0.9.4
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 +1 -1
- package/dist/Box.es.js +2 -2
- package/dist/Button.cjs.js +1 -1
- package/dist/Button.es.js +2 -2
- package/dist/Carousel.cjs.js +1 -1
- package/dist/Carousel.es.js +2 -2
- package/dist/Countdown.cjs.js +1 -1
- package/dist/Countdown.es.js +2 -2
- package/dist/Divider.cjs.js +1 -1
- package/dist/Divider.es.js +2 -2
- package/dist/Embed.es.js +1 -1
- package/dist/Form.cjs.js +1 -1
- package/dist/Form.es.js +2 -2
- package/dist/Image.cjs.js +1 -1
- package/dist/Image.es.js +2 -2
- package/dist/LiveProvider.cjs.js +1 -1
- package/dist/LiveProvider.es.js +1 -1
- package/dist/Navigation.cjs.js +1 -1
- package/dist/Navigation.es.js +2 -2
- package/dist/PreviewProvider.cjs.js +1 -1
- package/dist/PreviewProvider.es.js +2 -2
- package/dist/ReadOnlyText.cjs.js +3 -4
- package/dist/ReadOnlyText.cjs.js.map +1 -1
- package/dist/ReadOnlyText.es.js +3 -4
- package/dist/ReadOnlyText.es.js.map +1 -1
- package/dist/ReadOnlyTextV2.cjs.js +10 -11
- package/dist/ReadOnlyTextV2.cjs.js.map +1 -1
- package/dist/ReadOnlyTextV2.es.js +9 -10
- package/dist/ReadOnlyTextV2.es.js.map +1 -1
- package/dist/Root.cjs.js +1 -1
- package/dist/Root.es.js +2 -2
- package/dist/SocialLinks.cjs.js +1 -1
- package/dist/SocialLinks.es.js +2 -2
- package/dist/Text.cjs.js +1 -1
- package/dist/Text.es.js +1 -1
- package/dist/Video.es.js +1 -1
- package/dist/components.cjs.js +1 -1
- package/dist/components.es.js +1 -1
- package/dist/control-serialization.es.js +1 -1
- package/dist/controls.cjs.js +18 -14
- package/dist/controls.cjs.js.map +1 -1
- package/dist/controls.es.js +2 -2
- package/dist/index.cjs.js +161 -49
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.cjs10.js +22 -10
- package/dist/index.cjs10.js.map +1 -1
- package/dist/index.cjs5.js +99 -5
- package/dist/index.cjs5.js.map +1 -1
- package/dist/index.cjs8.js +1 -1
- package/dist/index.cjs9.js +1 -1
- package/dist/index.es.js +148 -37
- package/dist/index.es.js.map +1 -1
- package/dist/index.es10.js +23 -11
- package/dist/index.es10.js.map +1 -1
- package/dist/index.es2.js +1 -1
- package/dist/index.es4.js +1 -1
- package/dist/index.es5.js +91 -2
- package/dist/index.es5.js.map +1 -1
- package/dist/index.es6.js +1 -1
- package/dist/index.es8.js +1 -1
- package/dist/index.es9.js +2 -2
- package/dist/next.cjs.js +1 -1
- package/dist/next.es.js +2 -2
- package/dist/react-page.cjs.js +97 -8
- package/dist/react-page.cjs.js.map +1 -1
- package/dist/react-page.es.js +95 -8
- package/dist/react-page.es.js.map +1 -1
- package/dist/react.cjs.js +1 -1
- package/dist/react.es.js +1 -1
- package/dist/slate.cjs.js +17 -70
- package/dist/slate.cjs.js.map +1 -1
- package/dist/slate.es.js +20 -74
- package/dist/slate.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/components/builtin/Text/ReadOnlyText.d.ts.map +1 -1
- package/dist/types/src/components/builtin/Text/components/Leaf/leaf.d.ts +0 -17
- package/dist/types/src/components/builtin/Text/components/Leaf/leaf.d.ts.map +1 -1
- package/dist/types/src/controls/control.d.ts +3 -2
- package/dist/types/src/controls/control.d.ts.map +1 -1
- package/dist/types/src/controls/index.d.ts +1 -0
- package/dist/types/src/controls/index.d.ts.map +1 -1
- package/dist/types/src/controls/list.d.ts +2 -0
- package/dist/types/src/controls/list.d.ts.map +1 -1
- package/dist/types/src/controls/shape.d.ts +2 -0
- package/dist/types/src/controls/shape.d.ts.map +1 -1
- package/dist/types/src/controls/typography.d.ts +31 -0
- package/dist/types/src/controls/typography.d.ts.map +1 -0
- package/dist/types/src/next/client.d.ts.map +1 -1
- package/dist/types/src/prop-controllers/descriptors.d.ts +6 -3
- package/dist/types/src/prop-controllers/descriptors.d.ts.map +1 -1
- package/dist/types/src/prop-controllers/introspection.d.ts +1 -1
- package/dist/types/src/prop-controllers/introspection.d.ts.map +1 -1
- package/dist/types/src/runtimes/react/controls/control.d.ts +3 -2
- package/dist/types/src/runtimes/react/controls/control.d.ts.map +1 -1
- package/dist/types/src/runtimes/react/controls/rich-text-v2/ReadOnlyTextV2.d.ts.map +1 -1
- package/dist/types/src/runtimes/react/controls/typography.d.ts +21 -0
- package/dist/types/src/runtimes/react/controls/typography.d.ts.map +1 -0
- package/dist/types/src/runtimes/react/controls.d.ts.map +1 -1
- package/dist/types/src/slate/TypographyPlugin/index.d.ts +9 -0
- package/dist/types/src/slate/TypographyPlugin/index.d.ts.map +1 -1
- package/dist/types.cjs2.js +5 -5
- package/dist/types.cjs2.js.map +1 -1
- package/dist/types.es2.js +2 -2
- package/dist/{text-input.cjs.js → typography.cjs.js} +9 -1
- package/dist/typography.cjs.js.map +1 -0
- package/dist/{text-input.es.js → typography.es.js} +8 -2
- package/dist/typography.es.js.map +1 -0
- package/package.json +1 -1
- package/dist/leaf.cjs.js +0 -182
- package/dist/leaf.cjs.js.map +0 -1
- package/dist/leaf.es.js +0 -179
- package/dist/leaf.es.js.map +0 -1
- package/dist/text-input.cjs.js.map +0 -1
- package/dist/text-input.es.js.map +0 -1
package/dist/react-page.es.js
CHANGED
|
@@ -587,6 +587,11 @@ function Link$1(options = {}) {
|
|
|
587
587
|
function List$1(options) {
|
|
588
588
|
return { type: Types.List, options };
|
|
589
589
|
}
|
|
590
|
+
function introspectListPropControllerData(descriptor, value, func) {
|
|
591
|
+
if (value == null)
|
|
592
|
+
return [];
|
|
593
|
+
return value.flatMap((item) => item.value ? func(descriptor.options.type, item.value) : []);
|
|
594
|
+
}
|
|
590
595
|
const MarginPropControllerFormat = {
|
|
591
596
|
ClassName: "makeswift::prop-controllers::margin::format::class-name",
|
|
592
597
|
ResponsiveValue: "makeswift::prop-controllers::margin::format::responsive-value"
|
|
@@ -641,6 +646,11 @@ Shadows.Format = ShadowsPropControllerFormat;
|
|
|
641
646
|
function Shape$1(options) {
|
|
642
647
|
return { type: Types.Shape, options };
|
|
643
648
|
}
|
|
649
|
+
function introspectShapePropControllerData(descriptor, value, func) {
|
|
650
|
+
if (value == null)
|
|
651
|
+
return [];
|
|
652
|
+
return Object.entries(descriptor.options.type).flatMap(([key, definition]) => func(definition, value[key]));
|
|
653
|
+
}
|
|
644
654
|
function SocialLinks(options = {}) {
|
|
645
655
|
return { type: Types.SocialLinks, options };
|
|
646
656
|
}
|
|
@@ -692,6 +702,7 @@ var descriptors = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePro
|
|
|
692
702
|
Images,
|
|
693
703
|
Link: Link$1,
|
|
694
704
|
List: List$1,
|
|
705
|
+
introspectListPropControllerData,
|
|
695
706
|
MarginPropControllerFormat,
|
|
696
707
|
Margin,
|
|
697
708
|
NavigationLinks,
|
|
@@ -708,6 +719,7 @@ var descriptors = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePro
|
|
|
708
719
|
ShadowsPropControllerFormat,
|
|
709
720
|
Shadows,
|
|
710
721
|
Shape: Shape$1,
|
|
722
|
+
introspectShapePropControllerData,
|
|
711
723
|
SocialLinks,
|
|
712
724
|
Table,
|
|
713
725
|
TableFormFields,
|
|
@@ -985,6 +997,11 @@ function copyListData(definition, value, context) {
|
|
|
985
997
|
value: copy(definition.config.type, item.value, context)
|
|
986
998
|
}));
|
|
987
999
|
}
|
|
1000
|
+
function introspectListData(definition, value, func) {
|
|
1001
|
+
if (value == null)
|
|
1002
|
+
return [];
|
|
1003
|
+
return value.flatMap((item) => func(definition.config.type, item.value));
|
|
1004
|
+
}
|
|
988
1005
|
const ShapeControlType = "makeswift::controls::shape";
|
|
989
1006
|
function Shape(config) {
|
|
990
1007
|
return { type: ShapeControlType, config };
|
|
@@ -1038,6 +1055,11 @@ function copyShapeData(definition, value, context) {
|
|
|
1038
1055
|
}
|
|
1039
1056
|
return newValue;
|
|
1040
1057
|
}
|
|
1058
|
+
function introspectShapeData(definition, value, func) {
|
|
1059
|
+
if (value == null)
|
|
1060
|
+
return [];
|
|
1061
|
+
return Object.entries(definition.config.type).flatMap(([key, definition2]) => func(definition2, value[key]));
|
|
1062
|
+
}
|
|
1041
1063
|
const SlotControlType = "makeswift::controls::slot";
|
|
1042
1064
|
function Slot() {
|
|
1043
1065
|
return { type: SlotControlType };
|
|
@@ -2347,8 +2369,16 @@ function getElementChildren(descriptor, prop) {
|
|
|
2347
2369
|
case ListControlType:
|
|
2348
2370
|
return prop.flatMap(({ value }) => getElementChildren(descriptor.config.type, value));
|
|
2349
2371
|
case ShapeControlType: {
|
|
2350
|
-
|
|
2351
|
-
|
|
2372
|
+
return introspectShapeData(descriptor, prop, getElementChildren);
|
|
2373
|
+
}
|
|
2374
|
+
case ListControlType: {
|
|
2375
|
+
return introspectListData(descriptor, prop, getElementChildren);
|
|
2376
|
+
}
|
|
2377
|
+
case Types.Shape: {
|
|
2378
|
+
return introspectShapePropControllerData(descriptor, prop, getElementChildren);
|
|
2379
|
+
}
|
|
2380
|
+
case Types.List: {
|
|
2381
|
+
return introspectListPropControllerData(descriptor, prop, getElementChildren);
|
|
2352
2382
|
}
|
|
2353
2383
|
default:
|
|
2354
2384
|
return [];
|
|
@@ -2408,7 +2438,7 @@ function getTypographyStyleSwatchIds(style) {
|
|
|
2408
2438
|
return (_a3 = typographyStyle.color) == null ? void 0 : _a3.swatchId;
|
|
2409
2439
|
}).filter(isNonNullable)) != null ? _a2 : [];
|
|
2410
2440
|
}
|
|
2411
|
-
function
|
|
2441
|
+
function getSwatchIds(descriptor, prop) {
|
|
2412
2442
|
var _a2;
|
|
2413
2443
|
if (prop == null)
|
|
2414
2444
|
return [];
|
|
@@ -2463,7 +2493,7 @@ function getElementSwatchIds(descriptor, prop) {
|
|
|
2463
2493
|
}
|
|
2464
2494
|
case StyleV2ControlType: {
|
|
2465
2495
|
const value = prop;
|
|
2466
|
-
return value.flatMap((value2) =>
|
|
2496
|
+
return value.flatMap((value2) => getSwatchIds(descriptor.config.type, value2.value));
|
|
2467
2497
|
}
|
|
2468
2498
|
case RichTextV2ControlType: {
|
|
2469
2499
|
let getDescendantSwatchIds = function(descendant) {
|
|
@@ -2481,19 +2511,31 @@ function getElementSwatchIds(descriptor, prop) {
|
|
|
2481
2511
|
var _a3;
|
|
2482
2512
|
return (_a3 = plugins == null ? void 0 : plugins.flatMap((plugin) => {
|
|
2483
2513
|
var _a4;
|
|
2484
|
-
return ((_a4 = plugin.control) == null ? void 0 : _a4.definition) && plugin.control.getElementValue ?
|
|
2514
|
+
return ((_a4 = plugin.control) == null ? void 0 : _a4.definition) && plugin.control.getElementValue ? getSwatchIds(plugin.control.definition, plugin.control.getElementValue(descendant)) : [];
|
|
2485
2515
|
})) != null ? _a3 : [];
|
|
2486
2516
|
}, getTextSwatchIds = function(text) {
|
|
2487
2517
|
var _a3;
|
|
2488
2518
|
return (_a3 = plugins == null ? void 0 : plugins.flatMap((plugin) => {
|
|
2489
2519
|
var _a4;
|
|
2490
|
-
return ((_a4 = plugin.control) == null ? void 0 : _a4.definition) && plugin.control.getLeafValue ?
|
|
2520
|
+
return ((_a4 = plugin.control) == null ? void 0 : _a4.definition) && plugin.control.getLeafValue ? getSwatchIds(plugin.control.definition, plugin.control.getLeafValue(text)) : [];
|
|
2491
2521
|
})) != null ? _a3 : [];
|
|
2492
2522
|
};
|
|
2493
2523
|
const descendants = prop;
|
|
2494
2524
|
const plugins = descriptor.config.plugins;
|
|
2495
2525
|
return descendants.flatMap((d) => getDescendantSwatchIds(d));
|
|
2496
2526
|
}
|
|
2527
|
+
case ShapeControlType: {
|
|
2528
|
+
return introspectShapeData(descriptor, prop, getSwatchIds);
|
|
2529
|
+
}
|
|
2530
|
+
case ListControlType: {
|
|
2531
|
+
return introspectListData(descriptor, prop, getSwatchIds);
|
|
2532
|
+
}
|
|
2533
|
+
case Types.Shape: {
|
|
2534
|
+
return introspectShapePropControllerData(descriptor, prop, getSwatchIds);
|
|
2535
|
+
}
|
|
2536
|
+
case Types.List: {
|
|
2537
|
+
return introspectListPropControllerData(descriptor, prop, getSwatchIds);
|
|
2538
|
+
}
|
|
2497
2539
|
default:
|
|
2498
2540
|
return [];
|
|
2499
2541
|
}
|
|
@@ -2528,6 +2570,18 @@ function getFileIds(descriptor, prop) {
|
|
|
2528
2570
|
const value = prop;
|
|
2529
2571
|
return value == null ? [] : [value];
|
|
2530
2572
|
}
|
|
2573
|
+
case ShapeControlType: {
|
|
2574
|
+
return introspectShapeData(descriptor, prop, getFileIds);
|
|
2575
|
+
}
|
|
2576
|
+
case ListControlType: {
|
|
2577
|
+
return introspectListData(descriptor, prop, getFileIds);
|
|
2578
|
+
}
|
|
2579
|
+
case Types.Shape: {
|
|
2580
|
+
return introspectShapePropControllerData(descriptor, prop, getFileIds);
|
|
2581
|
+
}
|
|
2582
|
+
case Types.List: {
|
|
2583
|
+
return introspectListPropControllerData(descriptor, prop, getFileIds);
|
|
2584
|
+
}
|
|
2531
2585
|
default:
|
|
2532
2586
|
return [];
|
|
2533
2587
|
}
|
|
@@ -2558,6 +2612,18 @@ function getTypographyIds(descriptor, prop) {
|
|
|
2558
2612
|
return [];
|
|
2559
2613
|
return getNodeTypographyIds(value.document);
|
|
2560
2614
|
}
|
|
2615
|
+
case ShapeControlType: {
|
|
2616
|
+
return introspectShapeData(descriptor, prop, getTypographyIds);
|
|
2617
|
+
}
|
|
2618
|
+
case ListControlType: {
|
|
2619
|
+
return introspectListData(descriptor, prop, getTypographyIds);
|
|
2620
|
+
}
|
|
2621
|
+
case Types.Shape: {
|
|
2622
|
+
return introspectShapePropControllerData(descriptor, prop, getTypographyIds);
|
|
2623
|
+
}
|
|
2624
|
+
case Types.List: {
|
|
2625
|
+
return introspectListPropControllerData(descriptor, prop, getTypographyIds);
|
|
2626
|
+
}
|
|
2561
2627
|
default:
|
|
2562
2628
|
return [];
|
|
2563
2629
|
}
|
|
@@ -2590,6 +2656,15 @@ function getPageIds(descriptor, prop) {
|
|
|
2590
2656
|
return [];
|
|
2591
2657
|
}
|
|
2592
2658
|
}
|
|
2659
|
+
case LinkControlType: {
|
|
2660
|
+
const value = prop;
|
|
2661
|
+
if (value == null)
|
|
2662
|
+
return [];
|
|
2663
|
+
switch (value.type) {
|
|
2664
|
+
case "OPEN_PAGE":
|
|
2665
|
+
return value.payload.pageId == null ? [] : [value.payload.pageId];
|
|
2666
|
+
}
|
|
2667
|
+
}
|
|
2593
2668
|
case Types.NavigationLinks: {
|
|
2594
2669
|
const value = prop;
|
|
2595
2670
|
if (value == null)
|
|
@@ -2658,6 +2733,18 @@ function getPageIds(descriptor, prop) {
|
|
|
2658
2733
|
return [];
|
|
2659
2734
|
return getNodePageIds(value.document);
|
|
2660
2735
|
}
|
|
2736
|
+
case ShapeControlType: {
|
|
2737
|
+
return introspectShapeData(descriptor, prop, getPageIds);
|
|
2738
|
+
}
|
|
2739
|
+
case ListControlType: {
|
|
2740
|
+
return introspectListData(descriptor, prop, getPageIds);
|
|
2741
|
+
}
|
|
2742
|
+
case Types.Shape: {
|
|
2743
|
+
return introspectShapePropControllerData(descriptor, prop, getPageIds);
|
|
2744
|
+
}
|
|
2745
|
+
case Types.List: {
|
|
2746
|
+
return introspectListPropControllerData(descriptor, prop, getPageIds);
|
|
2747
|
+
}
|
|
2661
2748
|
default:
|
|
2662
2749
|
return [];
|
|
2663
2750
|
}
|
|
@@ -2671,7 +2758,7 @@ var introspection = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineP
|
|
|
2671
2758
|
getBoxShadowsSwatchIds,
|
|
2672
2759
|
getResponsiveColorSwatchIds,
|
|
2673
2760
|
getTypographyStyleSwatchIds,
|
|
2674
|
-
|
|
2761
|
+
getSwatchIds,
|
|
2675
2762
|
getBackgroundsFileIds,
|
|
2676
2763
|
getFileIds,
|
|
2677
2764
|
getTypographyIds,
|
|
@@ -2846,5 +2933,5 @@ function configureStore({
|
|
|
2846
2933
|
locales: getInitialState(locales != null ? locales : preloadedState == null ? void 0 : preloadedState.locales)
|
|
2847
2934
|
}), applyMiddleware(thunk));
|
|
2848
2935
|
}
|
|
2849
|
-
export {
|
|
2936
|
+
export { StyleControlProperty as $, TableFormFields as A, Backgrounds as B, ComponentIcon as C, Date as D, ElementID as E, Font as F, GapY as G, Image$1 as H, Images as I, ResponsiveOpacity as J, NavigationLinks as K, Link$1 as L, Margin as M, Number as N, SocialLinks as O, Padding as P, RichText$1 as Q, RichTextPropControllerMessageType as R, Shadows as S, TableFormFieldsMessageType as T, useStyle as U, Video as V, Width as W, getBorderSwatchIds as X, isNonNullable as Y, getBoxShadowsSwatchIds as Z, getResponsiveColorSwatchIds as _, createDocumentReference as a, ObjectType as a$, ImageControlValueFormat as a0, isPropControllersHandle as a1, StyleControlType as a2, RichTextV2ControlType as a3, RichTextControlType as a4, SlotControlType as a5, StyleV2ControlType as a6, ListControlType as a7, ShapeControlType as a8, LinkControlType as a9, Image as aA, copyImageData as aB, Link as aC, copyLinkData as aD, List as aE, ListControlMessageType as aF, ListControl as aG, copyListData as aH, introspectListData as aI, Shape as aJ, ShapeControlMessageType as aK, ShapeControl as aL, copyShapeData as aM, introspectShapeData as aN, Slot as aO, SlotControlMessageType as aP, SlotControl as aQ, copySlotData as aR, mergeSlotData as aS, Style as aT, StyleControlMessageType as aU, StyleControl as aV, copyStyleData as aW, unstable_useStyleV2ClassName as aX, unstable_StyleV2 as aY, StyleV2ControlMessageType as aZ, StyleV2Control as a_, ImageControlType as aa, ColorControlType as ab, getComponentPropControllerDescriptors as ac, getPropControllers as ad, Types as ae, BorderPropControllerFormat as af, ShadowsPropControllerFormat as ag, BorderRadiusPropControllerFormat as ah, MarginPropControllerFormat as ai, PaddingPropControllerFormat as aj, WidthPropControllerFormat as ak, configureStore as al, copyElementTree as am, getBreakpoints as an, getDocument as ao, getElementId as ap, getIsPreview as aq, getIsInBuilder as ar, getReactComponent as as, getBuilderEditMode as at, getBackgroundsFileIds as au, getBackgroundsSwatchIds as av, Color as aw, copyColorData as ax, copy as ay, merge as az, isElementReference as b, RichText as b0, RichTextControlMessageType as b1, RichTextControl as b2, richTextDTOtoSelection as b3, richTextDTOtoDAO as b4, toSelectionDTO as b5, richTextDAOToDTO as b6, RichTextV2Mode as b7, createRichTextV2Plugin as b8, unstable_RichTextV2 as b9, reducer$1 as bA, getInitialState$2 as bB, RichTextV2ControlMessageType as ba, RichTextV2Control as bb, InlineType as bc, RootBlockType as bd, BlockType as be, BlockTextAlignment as bf, getInitialState$7 as bg, reducer$8 as bh, getDocument$1 as bi, getComponentsMeta as bj, getComponentPropControllerDescriptors$1 as bk, getLocales as bl, BuilderEditMode as bm, getDocumentKeysSortedByDepth as bn, getPropController as bo, getPropControllersHandle as bp, getElement as bq, getElementPropControllerDescriptors as br, createPropController as bs, reducer$7 as bt, reducer$9 as bu, reducer$6 as bv, reducer$5 as bw, reducer$4 as bx, reducer$3 as by, reducer$2 as bz, createDocument as c, descriptors as d, getSwatchIds as e, getFileIds as f, getPropControllerDescriptors as g, getTypographyIds as h, introspection as i, getTableIds as j, getPageIds as k, getElementChildren as l, ResponsiveIconRadioGroup as m, Border as n, BorderRadius as o, GapX as p, ResponsiveSelect as q, ResponsiveNumber as r, Checkbox as s, Grid as t, TextInput as u, ResponsiveColor as v, TextStyle as w, ResponsiveLength as x, TextArea as y, Table as z };
|
|
2850
2937
|
//# sourceMappingURL=react-page.es.js.map
|