@makeswift/runtime 0.9.10 → 0.9.12
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 +1 -1
- package/dist/Button.cjs.js +1 -1
- package/dist/Button.es.js +1 -1
- package/dist/Carousel.cjs.js +1 -1
- package/dist/Carousel.es.js +1 -1
- package/dist/Countdown.cjs.js +1 -1
- package/dist/Countdown.es.js +1 -1
- package/dist/Divider.cjs.js +1 -1
- package/dist/Divider.es.js +1 -1
- package/dist/Form.cjs.js +1 -1
- package/dist/Form.es.js +1 -1
- package/dist/Image.cjs.js +1 -1
- package/dist/Image.es.js +1 -1
- package/dist/LiveProvider.cjs.js +1 -1
- package/dist/LiveProvider.es.js +3 -3
- package/dist/Navigation.cjs.js +1 -1
- package/dist/Navigation.es.js +1 -1
- package/dist/PreviewProvider.cjs.js +1 -1
- package/dist/PreviewProvider.es.js +3 -3
- package/dist/ReadOnlyText.cjs.js +18 -3
- package/dist/ReadOnlyText.cjs.js.map +1 -1
- package/dist/ReadOnlyText.es.js +20 -5
- package/dist/ReadOnlyText.es.js.map +1 -1
- package/dist/ReadOnlyTextV2.cjs.js +116 -240
- package/dist/ReadOnlyTextV2.cjs.js.map +1 -1
- package/dist/ReadOnlyTextV2.es.js +115 -238
- package/dist/ReadOnlyTextV2.es.js.map +1 -1
- package/dist/Root.cjs.js +1 -1
- package/dist/Root.es.js +1 -1
- package/dist/SocialLinks.cjs.js +1 -1
- package/dist/SocialLinks.es.js +1 -1
- package/dist/Text.cjs.js +1 -1
- package/dist/Text.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 +28 -18
- package/dist/controls.cjs.js.map +1 -1
- package/dist/controls.es.js +2 -2
- package/dist/index.cjs.js +47 -42
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.cjs10.js +2 -2
- package/dist/index.cjs2.js +3 -3
- package/dist/index.cjs2.js.map +1 -1
- package/dist/index.cjs5.js +5 -6
- package/dist/index.cjs5.js.map +1 -1
- package/dist/index.cjs6.js +20 -0
- package/dist/index.cjs6.js.map +1 -1
- package/dist/index.cjs8.js +1 -1
- package/dist/index.cjs9.js +27 -31
- package/dist/index.cjs9.js.map +1 -1
- package/dist/index.es.js +22 -18
- package/dist/index.es.js.map +1 -1
- package/dist/index.es10.js +4 -4
- package/dist/index.es2.js +2 -2
- package/dist/index.es3.js +1 -1
- package/dist/index.es5.js +1 -2
- package/dist/index.es5.js.map +1 -1
- package/dist/index.es6.js +21 -2
- package/dist/index.es6.js.map +1 -1
- package/dist/index.es8.js +1 -1
- package/dist/index.es9.js +31 -35
- package/dist/index.es9.js.map +1 -1
- package/dist/next.cjs.js +1 -1
- package/dist/next.es.js +2 -2
- package/dist/react-page.cjs.js +310 -147
- package/dist/react-page.cjs.js.map +1 -1
- package/dist/react-page.es.js +297 -146
- 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 +40 -27
- package/dist/slate.cjs.js.map +1 -1
- package/dist/slate.es.js +49 -37
- package/dist/slate.es.js.map +1 -1
- package/dist/{typography.cjs.js → text-input.cjs.js} +1 -9
- package/dist/text-input.cjs.js.map +1 -0
- package/dist/{typography.es.js → text-input.es.js} +2 -8
- package/dist/text-input.es.js.map +1 -0
- package/dist/types/src/api/react.d.ts +1 -1
- package/dist/types/src/api/react.d.ts.map +1 -1
- package/dist/types/src/components/builtin/Button/Button.d.ts +3 -39
- package/dist/types/src/components/builtin/Button/Button.d.ts.map +1 -1
- package/dist/types/src/components/builtin/Form/components/Field/components/Checkbox/index.d.ts +2 -2
- package/dist/types/src/components/builtin/Form/components/Field/components/Input/index.d.ts +1 -1
- package/dist/types/src/components/builtin/Form/components/Field/components/PlaceholderTableField/index.d.ts +0 -1
- package/dist/types/src/components/builtin/Form/components/Field/components/PlaceholderTableField/index.d.ts.map +1 -1
- package/dist/types/src/components/builtin/Form/components/Field/components/RadioButton/index.d.ts +2 -2
- package/dist/types/src/components/builtin/Form/components/Field/components/TextArea/index.d.ts +1 -1
- package/dist/types/src/components/builtin/Form/components/Field/index.d.ts +0 -1
- package/dist/types/src/components/builtin/Form/components/Field/index.d.ts.map +1 -1
- package/dist/types/src/components/builtin/Form/components/Spinner/index.d.ts +0 -1
- package/dist/types/src/components/builtin/Form/components/Spinner/index.d.ts.map +1 -1
- package/dist/types/src/components/builtin/Navigation/components/DropDownButton/index.d.ts +1 -1
- package/dist/types/src/components/builtin/Navigation/components/DropDownButton/index.d.ts.map +1 -1
- package/dist/types/src/components/builtin/Navigation/components/LinksPlaceholder/index.d.ts +0 -1
- package/dist/types/src/components/builtin/Navigation/components/LinksPlaceholder/index.d.ts.map +1 -1
- package/dist/types/src/components/builtin/Navigation/components/MobileMenu/components/MobileDropDownButton/index.d.ts +1 -1
- package/dist/types/src/components/builtin/Navigation/components/MobileMenu/components/MobileDropDownButton/index.d.ts.map +1 -1
- package/dist/types/src/components/builtin/Navigation/components/MobileMenu/index.d.ts +0 -1
- package/dist/types/src/components/builtin/Navigation/components/MobileMenu/index.d.ts.map +1 -1
- package/dist/types/src/components/builtin/SocialLinks/components/SocialLinksPlaceholder/index.d.ts +0 -1
- package/dist/types/src/components/builtin/SocialLinks/components/SocialLinksPlaceholder/index.d.ts.map +1 -1
- package/dist/types/src/components/builtin/SocialLinks/options.d.ts +23 -24
- package/dist/types/src/components/builtin/SocialLinks/options.d.ts.map +1 -1
- package/dist/types/src/components/builtin/Text/ReadOnlyText.d.ts +2 -2
- package/dist/types/src/components/builtin/Text/ReadOnlyText.d.ts.map +1 -1
- package/dist/types/src/components/builtin/Text/components/Element/block.d.ts +1 -2
- package/dist/types/src/components/builtin/Text/components/Element/block.d.ts.map +1 -1
- package/dist/types/src/components/builtin/Text/components/Element/element.d.ts +1 -2
- package/dist/types/src/components/builtin/Text/components/Element/element.d.ts.map +1 -1
- package/dist/types/src/components/builtin/Text/components/Element/inline.d.ts +1 -2
- package/dist/types/src/components/builtin/Text/components/Element/inline.d.ts.map +1 -1
- package/dist/types/src/components/builtin/Text/components/Leaf/leaf.d.ts +1 -2
- package/dist/types/src/components/builtin/Text/components/Leaf/leaf.d.ts.map +1 -1
- package/dist/types/src/components/page/Page.d.ts +0 -1
- package/dist/types/src/components/page/Page.d.ts.map +1 -1
- package/dist/types/src/components/shared/BackgroundsContainer/components/BackgroundVideo/index.d.ts +0 -1
- package/dist/types/src/components/shared/BackgroundsContainer/components/BackgroundVideo/index.d.ts.map +1 -1
- package/dist/types/src/components/shared/BackgroundsContainer/components/Backgrounds/index.d.ts +0 -1
- package/dist/types/src/components/shared/BackgroundsContainer/components/Backgrounds/index.d.ts.map +1 -1
- package/dist/types/src/components/shared/BackgroundsContainer/index.d.ts +1 -1
- package/dist/types/src/components/shared/GutterContainer/index.d.ts +1 -1
- package/dist/types/src/components/shared/GutterContainer/index.d.ts.map +1 -1
- package/dist/types/src/components/shared/Link/index.d.ts +1 -1
- package/dist/types/src/components/shared/Link/index.d.ts.map +1 -1
- package/dist/types/src/components/shared/grid-item.d.ts +1 -1
- package/dist/types/src/components/shared/grid-item.d.ts.map +1 -1
- package/dist/types/src/controls/list.d.ts +5 -2
- package/dist/types/src/controls/list.d.ts.map +1 -1
- package/dist/types/src/controls/rich-text/introspection.d.ts +5 -0
- package/dist/types/src/controls/rich-text/introspection.d.ts.map +1 -0
- package/dist/types/src/controls/rich-text/introspection.test.d.ts +2 -0
- package/dist/types/src/controls/rich-text/introspection.test.d.ts.map +1 -0
- package/dist/types/src/controls/rich-text-v2/introspection.d.ts +5 -0
- package/dist/types/src/controls/rich-text-v2/introspection.d.ts.map +1 -0
- package/dist/types/src/controls/rich-text-v2/introspection.test.d.ts +2 -0
- package/dist/types/src/controls/rich-text-v2/introspection.test.d.ts.map +1 -0
- package/dist/types/src/controls/rich-text-v2/rich-text-v2.d.ts +15 -3
- package/dist/types/src/controls/rich-text-v2/rich-text-v2.d.ts.map +1 -1
- package/dist/types/src/controls/rich-text-v2/translation.d.ts +1 -1
- package/dist/types/src/controls/rich-text-v2/translation.d.ts.map +1 -1
- package/dist/types/src/controls/shape.d.ts +5 -2
- package/dist/types/src/controls/shape.d.ts.map +1 -1
- package/dist/types/src/controls/typography.d.ts +2 -0
- package/dist/types/src/controls/typography.d.ts.map +1 -1
- package/dist/types/src/next/client.d.ts.map +1 -1
- package/dist/types/src/next/document.d.ts +1 -2
- package/dist/types/src/next/document.d.ts.map +1 -1
- package/dist/types/src/next/index.d.ts +1 -1
- package/dist/types/src/next/index.d.ts.map +1 -1
- package/dist/types/src/next/preview-mode.d.ts +1 -2
- package/dist/types/src/next/preview-mode.d.ts.map +1 -1
- package/dist/types/src/prop-controllers/descriptors.d.ts +10 -0
- package/dist/types/src/prop-controllers/descriptors.d.ts.map +1 -1
- package/dist/types/src/prop-controllers/introspection.d.ts +0 -2
- package/dist/types/src/prop-controllers/introspection.d.ts.map +1 -1
- package/dist/types/src/runtimes/react/components/render-hook.d.ts +0 -1
- package/dist/types/src/runtimes/react/components/render-hook.d.ts.map +1 -1
- package/dist/types/src/runtimes/react/controls/control.d.ts +0 -1
- package/dist/types/src/runtimes/react/controls/control.d.ts.map +1 -1
- package/dist/types/src/runtimes/react/controls/list.d.ts +0 -1
- package/dist/types/src/runtimes/react/controls/list.d.ts.map +1 -1
- package/dist/types/src/runtimes/react/controls/rich-text-v2/EditableTextV2/editable-text-v2.d.ts +1 -1
- package/dist/types/src/runtimes/react/controls/rich-text-v2/EditableTextV2/editable-text-v2.d.ts.map +1 -1
- package/dist/types/src/runtimes/react/controls/rich-text-v2/EditableTextV2/render-element.d.ts +1 -2
- package/dist/types/src/runtimes/react/controls/rich-text-v2/EditableTextV2/render-element.d.ts.map +1 -1
- package/dist/types/src/runtimes/react/controls/rich-text-v2/EditableTextV2/render-leaf.d.ts +1 -2
- package/dist/types/src/runtimes/react/controls/rich-text-v2/EditableTextV2/render-leaf.d.ts.map +1 -1
- package/dist/types/src/runtimes/react/controls/rich-text-v2/EditableTextV2/useRemoteChanges.d.ts +4 -0
- package/dist/types/src/runtimes/react/controls/rich-text-v2/EditableTextV2/useRemoteChanges.d.ts.map +1 -0
- package/dist/types/src/runtimes/react/controls/rich-text-v2/ReadOnlyTextV2.d.ts +7 -16
- package/dist/types/src/runtimes/react/controls/rich-text-v2/ReadOnlyTextV2.d.ts.map +1 -1
- package/dist/types/src/runtimes/react/controls/rich-text-v2/rich-text-v2.d.ts +1 -1
- package/dist/types/src/runtimes/react/controls/rich-text-v2/rich-text-v2.d.ts.map +1 -1
- package/dist/types/src/runtimes/react/controls/rich-text.d.ts +1 -1
- package/dist/types/src/runtimes/react/controls/rich-text.d.ts.map +1 -1
- package/dist/types/src/runtimes/react/controls/shape.d.ts +0 -1
- package/dist/types/src/runtimes/react/controls/shape.d.ts.map +1 -1
- package/dist/types/src/runtimes/react/controls/slot.d.ts +2 -2
- package/dist/types/src/runtimes/react/controls/slot.d.ts.map +1 -1
- package/dist/types/src/runtimes/react/controls/style-v2.d.ts +0 -1
- package/dist/types/src/runtimes/react/controls/style-v2.d.ts.map +1 -1
- package/dist/types/src/runtimes/react/controls.d.ts +0 -1
- package/dist/types/src/runtimes/react/controls.d.ts.map +1 -1
- package/dist/types/src/runtimes/react/find-dom-node.d.ts.map +1 -1
- package/dist/types/src/runtimes/react/index.d.ts +1 -1
- package/dist/types/src/runtimes/react/index.d.ts.map +1 -1
- package/dist/types/src/slate/LinkPlugin/index.d.ts.map +1 -1
- package/dist/types/src/slate/LocalChangesPlugin/index.d.ts +16 -0
- package/dist/types/src/slate/LocalChangesPlugin/index.d.ts.map +1 -0
- package/dist/types/src/slate/TextAlignPlugin/index.d.ts +3 -3
- package/dist/types/src/slate/TextAlignPlugin/index.d.ts.map +1 -1
- package/dist/types/src/slate/index.d.ts +1 -0
- package/dist/types/src/slate/index.d.ts.map +1 -1
- package/dist/types/src/slate/types.d.ts +2 -2
- package/dist/types/src/slate/types.d.ts.map +1 -1
- package/dist/types/src/slate/utils/responsive.d.ts +1 -1
- package/dist/types/src/slate/utils/responsive.d.ts.map +1 -1
- package/dist/types/src/state/modules/react-components.d.ts +2 -2
- package/dist/types/src/state/modules/react-components.d.ts.map +1 -1
- package/dist/types.cjs2.js +67 -48
- package/dist/types.cjs2.js.map +1 -1
- package/dist/types.es2.js +64 -45
- package/dist/types.es2.js.map +1 -1
- package/package.json +4 -5
- package/dist/typography.cjs.js.map +0 -1
- package/dist/typography.es.js.map +0 -1
package/dist/react-page.cjs.js
CHANGED
|
@@ -604,6 +604,21 @@ function introspectListPropControllerData(descriptor, value, func) {
|
|
|
604
604
|
return [];
|
|
605
605
|
return value.flatMap((item) => item.value ? func(descriptor.options.type, item.value) : []);
|
|
606
606
|
}
|
|
607
|
+
function getListPropControllerElementChildren(descriptor, value) {
|
|
608
|
+
return introspectListPropControllerData(descriptor, value, getElementChildren);
|
|
609
|
+
}
|
|
610
|
+
function getListPropControllerSwatchIds(descriptor, value) {
|
|
611
|
+
return introspectListPropControllerData(descriptor, value, getSwatchIds);
|
|
612
|
+
}
|
|
613
|
+
function getListPropControllerFileIds(descriptor, value) {
|
|
614
|
+
return introspectListPropControllerData(descriptor, value, getFileIds);
|
|
615
|
+
}
|
|
616
|
+
function getListPropControllerTypographyIds(descriptor, value) {
|
|
617
|
+
return introspectListPropControllerData(descriptor, value, getTypographyIds);
|
|
618
|
+
}
|
|
619
|
+
function getListPropControllerPageIds(descriptor, value) {
|
|
620
|
+
return introspectListPropControllerData(descriptor, value, getPageIds);
|
|
621
|
+
}
|
|
607
622
|
const MarginPropControllerFormat = {
|
|
608
623
|
ClassName: "makeswift::prop-controllers::margin::format::class-name",
|
|
609
624
|
ResponsiveValue: "makeswift::prop-controllers::margin::format::responsive-value"
|
|
@@ -663,6 +678,21 @@ function introspectShapePropControllerData(descriptor, value, func) {
|
|
|
663
678
|
return [];
|
|
664
679
|
return Object.entries(descriptor.options.type).flatMap(([key, definition]) => func(definition, value[key]));
|
|
665
680
|
}
|
|
681
|
+
function getShapePropControllerElementChildren(descriptor, value) {
|
|
682
|
+
return introspectShapePropControllerData(descriptor, value, getElementChildren);
|
|
683
|
+
}
|
|
684
|
+
function getShapePropControllerFileIds(descriptor, value) {
|
|
685
|
+
return introspectShapePropControllerData(descriptor, value, getFileIds);
|
|
686
|
+
}
|
|
687
|
+
function getShapePropControllerTypographyIds(descriptor, value) {
|
|
688
|
+
return introspectShapePropControllerData(descriptor, value, getTypographyIds);
|
|
689
|
+
}
|
|
690
|
+
function getShapePropControllerPageIds(descriptor, value) {
|
|
691
|
+
return introspectShapePropControllerData(descriptor, value, getPageIds);
|
|
692
|
+
}
|
|
693
|
+
function getShapePropControllerSwatchIds(descriptor, value) {
|
|
694
|
+
return introspectShapePropControllerData(descriptor, value, getSwatchIds);
|
|
695
|
+
}
|
|
666
696
|
function SocialLinks(options = {}) {
|
|
667
697
|
return { type: Types.SocialLinks, options };
|
|
668
698
|
}
|
|
@@ -715,6 +745,11 @@ var descriptors = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePro
|
|
|
715
745
|
Link: Link$1,
|
|
716
746
|
List: List$1,
|
|
717
747
|
introspectListPropControllerData,
|
|
748
|
+
getListPropControllerElementChildren,
|
|
749
|
+
getListPropControllerSwatchIds,
|
|
750
|
+
getListPropControllerFileIds,
|
|
751
|
+
getListPropControllerTypographyIds,
|
|
752
|
+
getListPropControllerPageIds,
|
|
718
753
|
MarginPropControllerFormat,
|
|
719
754
|
Margin,
|
|
720
755
|
NavigationLinks,
|
|
@@ -732,6 +767,11 @@ var descriptors = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePro
|
|
|
732
767
|
Shadows,
|
|
733
768
|
Shape: Shape$1,
|
|
734
769
|
introspectShapePropControllerData,
|
|
770
|
+
getShapePropControllerElementChildren,
|
|
771
|
+
getShapePropControllerFileIds,
|
|
772
|
+
getShapePropControllerTypographyIds,
|
|
773
|
+
getShapePropControllerPageIds,
|
|
774
|
+
getShapePropControllerSwatchIds,
|
|
735
775
|
SocialLinks,
|
|
736
776
|
Table,
|
|
737
777
|
TableFormFields,
|
|
@@ -1014,6 +1054,21 @@ function introspectListData(definition, value, func) {
|
|
|
1014
1054
|
return [];
|
|
1015
1055
|
return value.flatMap((item) => func(definition.config.type, item.value));
|
|
1016
1056
|
}
|
|
1057
|
+
function getListElementChildren(definition, value) {
|
|
1058
|
+
return introspectListData(definition, value, getElementChildren);
|
|
1059
|
+
}
|
|
1060
|
+
function getListSwatchIds(definition, value) {
|
|
1061
|
+
return introspectListData(definition, value, getSwatchIds);
|
|
1062
|
+
}
|
|
1063
|
+
function getListFileIds(definition, value) {
|
|
1064
|
+
return introspectListData(definition, value, getFileIds);
|
|
1065
|
+
}
|
|
1066
|
+
function getListTypographyIds(definition, value) {
|
|
1067
|
+
return introspectListData(definition, value, getTypographyIds);
|
|
1068
|
+
}
|
|
1069
|
+
function getListPageIds(definition, value) {
|
|
1070
|
+
return introspectListData(definition, value, getPageIds);
|
|
1071
|
+
}
|
|
1017
1072
|
const ShapeControlType = "makeswift::controls::shape";
|
|
1018
1073
|
function Shape(config) {
|
|
1019
1074
|
return { type: ShapeControlType, config };
|
|
@@ -1072,6 +1127,21 @@ function introspectShapeData(definition, value, func) {
|
|
|
1072
1127
|
return [];
|
|
1073
1128
|
return Object.entries(definition.config.type).flatMap(([key, definition2]) => func(definition2, value[key]));
|
|
1074
1129
|
}
|
|
1130
|
+
function getShapeElementChildren(definition, data) {
|
|
1131
|
+
return introspectShapeData(definition, data, getElementChildren);
|
|
1132
|
+
}
|
|
1133
|
+
function getShapeSwatchIds(definition, data) {
|
|
1134
|
+
return introspectShapeData(definition, data, getSwatchIds);
|
|
1135
|
+
}
|
|
1136
|
+
function getShapeTypographyIds(definition, data) {
|
|
1137
|
+
return introspectShapeData(definition, data, getTypographyIds);
|
|
1138
|
+
}
|
|
1139
|
+
function getShapePageIds(definition, data) {
|
|
1140
|
+
return introspectShapeData(definition, data, getPageIds);
|
|
1141
|
+
}
|
|
1142
|
+
function getShapeFileIds(definition, data) {
|
|
1143
|
+
return introspectShapeData(definition, data, getFileIds);
|
|
1144
|
+
}
|
|
1075
1145
|
const SlotControlType = "makeswift::controls::slot";
|
|
1076
1146
|
function Slot() {
|
|
1077
1147
|
return { type: SlotControlType };
|
|
@@ -2273,11 +2343,12 @@ class RichTextControl extends PropController {
|
|
|
2273
2343
|
function richTextV2DataToDescendents(data) {
|
|
2274
2344
|
return data.descendants;
|
|
2275
2345
|
}
|
|
2276
|
-
function richTextV2DescendentsToData(descendants) {
|
|
2346
|
+
function richTextV2DescendentsToData(descendants, key) {
|
|
2277
2347
|
return {
|
|
2278
2348
|
type: RichTextV2ControlType,
|
|
2279
2349
|
version: 2,
|
|
2280
|
-
descendants
|
|
2350
|
+
descendants,
|
|
2351
|
+
key
|
|
2281
2352
|
};
|
|
2282
2353
|
}
|
|
2283
2354
|
const RichTextV2ControlType = "makeswift::controls::rich-text-v2";
|
|
@@ -2306,7 +2377,9 @@ const RichTextV2ControlMessageType = {
|
|
|
2306
2377
|
ON_CHANGE: "makeswift::controls::rich-text-v2::control-message::on-change",
|
|
2307
2378
|
SELECT: "makeswift::controls::rich-text-v2::control-message::select",
|
|
2308
2379
|
SWITCH_TO_BUILD_MODE: "makeswift::controls::rich-text-v2::control-message::switch-to-build-mode",
|
|
2309
|
-
CHANGE_BOX_MODEL: "makeswift::controls::rich-text-v2::control-message::change-box-model"
|
|
2380
|
+
CHANGE_BOX_MODEL: "makeswift::controls::rich-text-v2::control-message::change-box-model",
|
|
2381
|
+
REDO: "makeswift::controls::rich-text-v2::control-message::redo",
|
|
2382
|
+
UNDO: "makeswift::controls::rich-text-v2::control-message::undo"
|
|
2310
2383
|
};
|
|
2311
2384
|
class RichTextV2Control extends PropController {
|
|
2312
2385
|
constructor(send, descriptor) {
|
|
@@ -2326,7 +2399,7 @@ class RichTextV2Control extends PropController {
|
|
|
2326
2399
|
case RichTextV2ControlMessageType.RESET_VALUE: {
|
|
2327
2400
|
if (this.defaultValue) {
|
|
2328
2401
|
this.editor.selection = null;
|
|
2329
|
-
this.editor.children = this.defaultValue
|
|
2402
|
+
this.editor.children = this.defaultValue;
|
|
2330
2403
|
this.editor.onChange();
|
|
2331
2404
|
}
|
|
2332
2405
|
break;
|
|
@@ -2350,29 +2423,35 @@ class RichTextV2Control extends PropController {
|
|
|
2350
2423
|
return (_a3 = plugin == null ? void 0 : plugin.control) == null ? void 0 : _a3.getValue(editor);
|
|
2351
2424
|
})) != null ? _c : []
|
|
2352
2425
|
});
|
|
2426
|
+
const _onChange = editor.onChange;
|
|
2427
|
+
this.editor.onChange = (options) => {
|
|
2428
|
+
_onChange(options);
|
|
2429
|
+
this.updatePluginValues();
|
|
2430
|
+
if (this.editor == null || (options == null ? void 0 : options.operation) == null)
|
|
2431
|
+
return;
|
|
2432
|
+
this.onLocalUserChange();
|
|
2433
|
+
};
|
|
2353
2434
|
}
|
|
2354
2435
|
setDefaultValue(defaultValue) {
|
|
2355
|
-
this.defaultValue =
|
|
2436
|
+
this.defaultValue = defaultValue;
|
|
2356
2437
|
this.send({
|
|
2357
2438
|
type: RichTextV2ControlMessageType.SET_DEFAULT_VALUE,
|
|
2358
|
-
value:
|
|
2439
|
+
value: defaultValue
|
|
2359
2440
|
});
|
|
2360
2441
|
}
|
|
2361
|
-
|
|
2362
|
-
this.
|
|
2363
|
-
|
|
2364
|
-
|
|
2365
|
-
|
|
2442
|
+
onLocalUserChange() {
|
|
2443
|
+
if (this.editor == null)
|
|
2444
|
+
return;
|
|
2445
|
+
this.send({
|
|
2446
|
+
type: RichTextV2ControlMessageType.ON_CHANGE,
|
|
2447
|
+
value: richTextV2DescendentsToData(this.editor.children, this.editor.currentKey)
|
|
2448
|
+
});
|
|
2366
2449
|
}
|
|
2367
|
-
|
|
2450
|
+
updatePluginValues() {
|
|
2368
2451
|
var _a2, _b, _c;
|
|
2369
2452
|
const editor = this.editor;
|
|
2370
2453
|
if (editor == null)
|
|
2371
2454
|
return;
|
|
2372
|
-
this.send({
|
|
2373
|
-
type: RichTextV2ControlMessageType.ON_CHANGE,
|
|
2374
|
-
value: richTextV2DescendentsToData(value)
|
|
2375
|
-
});
|
|
2376
2455
|
this.send({
|
|
2377
2456
|
type: RichTextV2ControlMessageType.SET_PLUGIN_CONTROL_VALUE,
|
|
2378
2457
|
value: (_c = (_b = (_a2 = this.descriptor.config) == null ? void 0 : _a2.plugins) == null ? void 0 : _b.map((plugin) => {
|
|
@@ -2381,6 +2460,18 @@ class RichTextV2Control extends PropController {
|
|
|
2381
2460
|
})) != null ? _c : []
|
|
2382
2461
|
});
|
|
2383
2462
|
}
|
|
2463
|
+
select() {
|
|
2464
|
+
this.send({ type: RichTextV2ControlMessageType.SELECT });
|
|
2465
|
+
}
|
|
2466
|
+
switchToBuildMode() {
|
|
2467
|
+
this.send({ type: RichTextV2ControlMessageType.SWITCH_TO_BUILD_MODE });
|
|
2468
|
+
}
|
|
2469
|
+
undo() {
|
|
2470
|
+
this.send({ type: RichTextV2ControlMessageType.UNDO });
|
|
2471
|
+
}
|
|
2472
|
+
redo() {
|
|
2473
|
+
this.send({ type: RichTextV2ControlMessageType.REDO });
|
|
2474
|
+
}
|
|
2384
2475
|
changeBoxModel(boxModel) {
|
|
2385
2476
|
this.send({ type: RichTextV2ControlMessageType.CHANGE_BOX_MODEL, payload: { boxModel } });
|
|
2386
2477
|
}
|
|
@@ -2391,6 +2482,149 @@ function isRichTextV1Data(value) {
|
|
|
2391
2482
|
function isNonNullable(value) {
|
|
2392
2483
|
return value != null;
|
|
2393
2484
|
}
|
|
2485
|
+
const TypographyControlType = "makeswift::controls::typography";
|
|
2486
|
+
function unstable_Typography() {
|
|
2487
|
+
return {
|
|
2488
|
+
type: TypographyControlType
|
|
2489
|
+
};
|
|
2490
|
+
}
|
|
2491
|
+
function getTypographySwatchIds(value) {
|
|
2492
|
+
var _a2;
|
|
2493
|
+
return (_a2 = value == null ? void 0 : value.style.flatMap((style) => {
|
|
2494
|
+
var _a3, _b;
|
|
2495
|
+
return (_b = (_a3 = style.value.color) == null ? void 0 : _a3.swatchId) != null ? _b : [];
|
|
2496
|
+
}).filter(isNonNullable)) != null ? _a2 : [];
|
|
2497
|
+
}
|
|
2498
|
+
function getTypographyTypographyIds(value) {
|
|
2499
|
+
return [value == null ? void 0 : value.id].filter(isNonNullable);
|
|
2500
|
+
}
|
|
2501
|
+
function getRichTextSwatchIds(value) {
|
|
2502
|
+
if (value == null || value.document == null)
|
|
2503
|
+
return [];
|
|
2504
|
+
return getNodeSwatchIds(value.document);
|
|
2505
|
+
function getNodeSwatchIds(node) {
|
|
2506
|
+
var _a2, _b, _c, _d;
|
|
2507
|
+
switch (node.object) {
|
|
2508
|
+
case "document":
|
|
2509
|
+
case "block":
|
|
2510
|
+
case "inline":
|
|
2511
|
+
return (_b = (_a2 = node.nodes) == null ? void 0 : _a2.flatMap(getNodeSwatchIds)) != null ? _b : [];
|
|
2512
|
+
case "text":
|
|
2513
|
+
return (_d = (_c = node.marks) == null ? void 0 : _c.flatMap(getMarkSwatchIds)) != null ? _d : [];
|
|
2514
|
+
default:
|
|
2515
|
+
return [];
|
|
2516
|
+
}
|
|
2517
|
+
}
|
|
2518
|
+
function getTypographyStyleSwatchIds(style) {
|
|
2519
|
+
var _a2;
|
|
2520
|
+
return (_a2 = style == null ? void 0 : style.map((override) => override.value).flatMap((typographyStyle) => {
|
|
2521
|
+
var _a3;
|
|
2522
|
+
return (_a3 = typographyStyle.color) == null ? void 0 : _a3.swatchId;
|
|
2523
|
+
}).filter(isNonNullable)) != null ? _a2 : [];
|
|
2524
|
+
}
|
|
2525
|
+
function getMarkSwatchIds(mark) {
|
|
2526
|
+
var _a2, _b;
|
|
2527
|
+
return getTypographyStyleSwatchIds((_b = (_a2 = mark.data) == null ? void 0 : _a2.value) == null ? void 0 : _b.style);
|
|
2528
|
+
}
|
|
2529
|
+
}
|
|
2530
|
+
function getRichTextTypographyIds(value) {
|
|
2531
|
+
if (value == null || value.document == null)
|
|
2532
|
+
return [];
|
|
2533
|
+
return getNodeSwatchIds(value.document);
|
|
2534
|
+
function getNodeSwatchIds(node) {
|
|
2535
|
+
var _a2, _b, _c, _d;
|
|
2536
|
+
switch (node.object) {
|
|
2537
|
+
case "document":
|
|
2538
|
+
case "block":
|
|
2539
|
+
case "inline":
|
|
2540
|
+
return (_b = (_a2 = node.nodes) == null ? void 0 : _a2.flatMap(getNodeSwatchIds)) != null ? _b : [];
|
|
2541
|
+
case "text":
|
|
2542
|
+
return (_d = (_c = node.marks) == null ? void 0 : _c.flatMap(getMarkSwatchIds)) != null ? _d : [];
|
|
2543
|
+
default:
|
|
2544
|
+
return [];
|
|
2545
|
+
}
|
|
2546
|
+
}
|
|
2547
|
+
function getMarkSwatchIds(mark) {
|
|
2548
|
+
var _a2, _b;
|
|
2549
|
+
return [(_b = (_a2 = mark.data) == null ? void 0 : _a2.value) == null ? void 0 : _b.id].filter(isNonNullable);
|
|
2550
|
+
}
|
|
2551
|
+
}
|
|
2552
|
+
function getRichTextPageIds(value) {
|
|
2553
|
+
if (value == null || value.document == null)
|
|
2554
|
+
return [];
|
|
2555
|
+
return getNodePageIds(value.document);
|
|
2556
|
+
function getNodePageIds(node) {
|
|
2557
|
+
var _a2, _b;
|
|
2558
|
+
switch (node.object) {
|
|
2559
|
+
case "document":
|
|
2560
|
+
case "block":
|
|
2561
|
+
return (_b = (_a2 = node.nodes) == null ? void 0 : _a2.flatMap(getNodePageIds)) != null ? _b : [];
|
|
2562
|
+
case "inline":
|
|
2563
|
+
return getInlinePageIds(node);
|
|
2564
|
+
default:
|
|
2565
|
+
return [];
|
|
2566
|
+
}
|
|
2567
|
+
}
|
|
2568
|
+
function getInlinePageIds(inline) {
|
|
2569
|
+
var _a2, _b, _c, _d;
|
|
2570
|
+
switch (inline.type) {
|
|
2571
|
+
case "link": {
|
|
2572
|
+
const nodePageIds = (_b = (_a2 = inline.nodes) == null ? void 0 : _a2.flatMap(getNodePageIds)) != null ? _b : [];
|
|
2573
|
+
const dataPageIds = inline.data ? getLinkDataPageIds(inline.data) : [];
|
|
2574
|
+
return [...nodePageIds, ...dataPageIds];
|
|
2575
|
+
}
|
|
2576
|
+
default:
|
|
2577
|
+
return (_d = (_c = inline.nodes) == null ? void 0 : _c.flatMap(getNodePageIds)) != null ? _d : [];
|
|
2578
|
+
}
|
|
2579
|
+
}
|
|
2580
|
+
function getLinkDataPageIds(link) {
|
|
2581
|
+
switch (link.type) {
|
|
2582
|
+
case "OPEN_PAGE":
|
|
2583
|
+
return link.payload.pageId == null ? [] : [link.payload.pageId];
|
|
2584
|
+
default:
|
|
2585
|
+
return [];
|
|
2586
|
+
}
|
|
2587
|
+
}
|
|
2588
|
+
}
|
|
2589
|
+
function introspectRichTextV2Data(definition, data, func) {
|
|
2590
|
+
const plugins = definition.config.plugins;
|
|
2591
|
+
return data.descendants.flatMap((d) => getDescendantTypographyIds(d));
|
|
2592
|
+
function getDescendantTypographyIds(descendant) {
|
|
2593
|
+
if (slate.Element.isElement(descendant)) {
|
|
2594
|
+
return [
|
|
2595
|
+
...getElementTypographyIds(descendant),
|
|
2596
|
+
...descendant.children.flatMap((d) => getDescendantTypographyIds(d))
|
|
2597
|
+
];
|
|
2598
|
+
}
|
|
2599
|
+
if (slate.Text.isText(descendant)) {
|
|
2600
|
+
return getTextTypographyIds(descendant);
|
|
2601
|
+
}
|
|
2602
|
+
return [];
|
|
2603
|
+
}
|
|
2604
|
+
function getElementTypographyIds(descendant) {
|
|
2605
|
+
var _a2;
|
|
2606
|
+
return (_a2 = plugins == null ? void 0 : plugins.flatMap((plugin) => {
|
|
2607
|
+
var _a3;
|
|
2608
|
+
return ((_a3 = plugin.control) == null ? void 0 : _a3.definition) && plugin.control.getElementValue ? func(plugin.control.definition, plugin.control.getElementValue(descendant)) : [];
|
|
2609
|
+
})) != null ? _a2 : [];
|
|
2610
|
+
}
|
|
2611
|
+
function getTextTypographyIds(text) {
|
|
2612
|
+
var _a2;
|
|
2613
|
+
return (_a2 = plugins == null ? void 0 : plugins.flatMap((plugin) => {
|
|
2614
|
+
var _a3;
|
|
2615
|
+
return ((_a3 = plugin.control) == null ? void 0 : _a3.definition) && plugin.control.getLeafValue ? func(plugin.control.definition, plugin.control.getLeafValue(text)) : [];
|
|
2616
|
+
})) != null ? _a2 : [];
|
|
2617
|
+
}
|
|
2618
|
+
}
|
|
2619
|
+
function getRichTextV2SwatchIds(definition, data) {
|
|
2620
|
+
return introspectRichTextV2Data(definition, data, getSwatchIds);
|
|
2621
|
+
}
|
|
2622
|
+
function getRichTextV2TypographyIds(definition, data) {
|
|
2623
|
+
return introspectRichTextV2Data(definition, data, getTypographyIds);
|
|
2624
|
+
}
|
|
2625
|
+
function getRichTextV2PageIds(definition, data) {
|
|
2626
|
+
return introspectRichTextV2Data(definition, data, getPageIds);
|
|
2627
|
+
}
|
|
2394
2628
|
function getElementChildren(descriptor, prop) {
|
|
2395
2629
|
if (prop == null)
|
|
2396
2630
|
return [];
|
|
@@ -2402,16 +2636,16 @@ function getElementChildren(descriptor, prop) {
|
|
|
2402
2636
|
case ListControlType:
|
|
2403
2637
|
return prop.flatMap(({ value }) => getElementChildren(descriptor.config.type, value));
|
|
2404
2638
|
case ShapeControlType: {
|
|
2405
|
-
return
|
|
2639
|
+
return getShapeElementChildren(descriptor, prop);
|
|
2406
2640
|
}
|
|
2407
2641
|
case ListControlType: {
|
|
2408
|
-
return
|
|
2642
|
+
return getListElementChildren(descriptor, prop);
|
|
2409
2643
|
}
|
|
2410
2644
|
case Types.Shape: {
|
|
2411
|
-
return
|
|
2645
|
+
return getShapePropControllerElementChildren(descriptor, prop);
|
|
2412
2646
|
}
|
|
2413
2647
|
case Types.List: {
|
|
2414
|
-
return
|
|
2648
|
+
return getListPropControllerElementChildren(descriptor, prop);
|
|
2415
2649
|
}
|
|
2416
2650
|
default:
|
|
2417
2651
|
return [];
|
|
@@ -2464,13 +2698,6 @@ function getResponsiveColorSwatchIds(value) {
|
|
|
2464
2698
|
var _a2;
|
|
2465
2699
|
return (_a2 = value == null ? void 0 : value.map((override) => override.value).map((color) => color.swatchId)) != null ? _a2 : [];
|
|
2466
2700
|
}
|
|
2467
|
-
function getTypographyStyleSwatchIds(style) {
|
|
2468
|
-
var _a2;
|
|
2469
|
-
return (_a2 = style == null ? void 0 : style.map((override) => override.value).flatMap((typographyStyle) => {
|
|
2470
|
-
var _a3;
|
|
2471
|
-
return (_a3 = typographyStyle.color) == null ? void 0 : _a3.swatchId;
|
|
2472
|
-
}).filter(isNonNullable)) != null ? _a2 : [];
|
|
2473
|
-
}
|
|
2474
2701
|
function getSwatchIds(descriptor, prop) {
|
|
2475
2702
|
var _a2, _b;
|
|
2476
2703
|
if (prop == null)
|
|
@@ -2498,78 +2725,38 @@ function getSwatchIds(descriptor, prop) {
|
|
|
2498
2725
|
return getResponsiveColorSwatchIds(prop);
|
|
2499
2726
|
case Types.Shadows:
|
|
2500
2727
|
return getBoxShadowsSwatchIds(prop);
|
|
2728
|
+
case RichTextControlType:
|
|
2501
2729
|
case Types.RichText: {
|
|
2502
|
-
|
|
2503
|
-
var _a3, _b2, _c, _d;
|
|
2504
|
-
switch (node.object) {
|
|
2505
|
-
case "document":
|
|
2506
|
-
case "block":
|
|
2507
|
-
case "inline":
|
|
2508
|
-
return (_b2 = (_a3 = node.nodes) == null ? void 0 : _a3.flatMap(getNodeSwatchIds)) != null ? _b2 : [];
|
|
2509
|
-
case "text":
|
|
2510
|
-
return (_d = (_c = node.marks) == null ? void 0 : _c.flatMap(getMarkSwatchIds)) != null ? _d : [];
|
|
2511
|
-
default:
|
|
2512
|
-
return [];
|
|
2513
|
-
}
|
|
2514
|
-
}, getMarkSwatchIds = function(mark) {
|
|
2515
|
-
var _a3, _b2;
|
|
2516
|
-
return getTypographyStyleSwatchIds((_b2 = (_a3 = mark.data) == null ? void 0 : _a3.value) == null ? void 0 : _b2.style);
|
|
2517
|
-
};
|
|
2518
|
-
const value = prop;
|
|
2519
|
-
if (value == null || value.document == null)
|
|
2520
|
-
return [];
|
|
2521
|
-
return getNodeSwatchIds(value.document);
|
|
2730
|
+
return getRichTextSwatchIds(prop);
|
|
2522
2731
|
}
|
|
2523
2732
|
case ColorControlType: {
|
|
2524
2733
|
const value = prop;
|
|
2525
2734
|
return (value == null ? void 0 : value.swatchId) == null ? [] : [value.swatchId];
|
|
2526
2735
|
}
|
|
2736
|
+
case TypographyControlType: {
|
|
2737
|
+
return getTypographySwatchIds(prop);
|
|
2738
|
+
}
|
|
2527
2739
|
case StyleV2ControlType: {
|
|
2528
2740
|
const value = prop;
|
|
2529
2741
|
return (_b = value == null ? void 0 : value.flatMap((value2) => getSwatchIds(descriptor.config.type, value2.value))) != null ? _b : [];
|
|
2530
2742
|
}
|
|
2531
2743
|
case RichTextV2ControlType: {
|
|
2532
|
-
let getDescendantSwatchIds = function(descendant) {
|
|
2533
|
-
if (slate.Element.isElement(descendant)) {
|
|
2534
|
-
return [
|
|
2535
|
-
...getSlateElementSwatchIds(descendant),
|
|
2536
|
-
...descendant.children.flatMap((d) => getDescendantSwatchIds(d))
|
|
2537
|
-
];
|
|
2538
|
-
}
|
|
2539
|
-
if (slate.Text.isText(descendant)) {
|
|
2540
|
-
return getTextSwatchIds(descendant);
|
|
2541
|
-
}
|
|
2542
|
-
return [];
|
|
2543
|
-
}, getSlateElementSwatchIds = function(descendant) {
|
|
2544
|
-
var _a3;
|
|
2545
|
-
return (_a3 = plugins == null ? void 0 : plugins.flatMap((plugin) => {
|
|
2546
|
-
var _a4;
|
|
2547
|
-
return ((_a4 = plugin.control) == null ? void 0 : _a4.definition) && plugin.control.getElementValue ? getSwatchIds(plugin.control.definition, plugin.control.getElementValue(descendant)) : [];
|
|
2548
|
-
})) != null ? _a3 : [];
|
|
2549
|
-
}, getTextSwatchIds = function(text) {
|
|
2550
|
-
var _a3;
|
|
2551
|
-
return (_a3 = plugins == null ? void 0 : plugins.flatMap((plugin) => {
|
|
2552
|
-
var _a4;
|
|
2553
|
-
return ((_a4 = plugin.control) == null ? void 0 : _a4.definition) && plugin.control.getLeafValue ? getSwatchIds(plugin.control.definition, plugin.control.getLeafValue(text)) : [];
|
|
2554
|
-
})) != null ? _a3 : [];
|
|
2555
|
-
};
|
|
2556
2744
|
const data = prop;
|
|
2557
|
-
const plugins = descriptor.config.plugins;
|
|
2558
2745
|
if (isRichTextV1Data(data))
|
|
2559
|
-
return
|
|
2560
|
-
return
|
|
2746
|
+
return getRichTextSwatchIds(data);
|
|
2747
|
+
return getRichTextV2SwatchIds(descriptor, data);
|
|
2561
2748
|
}
|
|
2562
2749
|
case ShapeControlType: {
|
|
2563
|
-
return
|
|
2750
|
+
return getShapeSwatchIds(descriptor, prop);
|
|
2564
2751
|
}
|
|
2565
2752
|
case ListControlType: {
|
|
2566
|
-
return
|
|
2753
|
+
return getListSwatchIds(descriptor, prop);
|
|
2567
2754
|
}
|
|
2568
2755
|
case Types.Shape: {
|
|
2569
|
-
return
|
|
2756
|
+
return getShapePropControllerSwatchIds(descriptor, prop);
|
|
2570
2757
|
}
|
|
2571
2758
|
case Types.List: {
|
|
2572
|
-
return
|
|
2759
|
+
return getListPropControllerSwatchIds(descriptor, prop);
|
|
2573
2760
|
}
|
|
2574
2761
|
default:
|
|
2575
2762
|
return [];
|
|
@@ -2606,16 +2793,16 @@ function getFileIds(descriptor, prop) {
|
|
|
2606
2793
|
return value == null ? [] : [value];
|
|
2607
2794
|
}
|
|
2608
2795
|
case ShapeControlType: {
|
|
2609
|
-
return
|
|
2796
|
+
return getShapeFileIds(descriptor, prop);
|
|
2610
2797
|
}
|
|
2611
2798
|
case ListControlType: {
|
|
2612
|
-
return
|
|
2799
|
+
return getListFileIds(descriptor, prop);
|
|
2613
2800
|
}
|
|
2614
2801
|
case Types.Shape: {
|
|
2615
|
-
return
|
|
2802
|
+
return getShapePropControllerFileIds(descriptor, prop);
|
|
2616
2803
|
}
|
|
2617
2804
|
case Types.List: {
|
|
2618
|
-
return
|
|
2805
|
+
return getListPropControllerFileIds(descriptor, prop);
|
|
2619
2806
|
}
|
|
2620
2807
|
default:
|
|
2621
2808
|
return [];
|
|
@@ -2625,39 +2812,30 @@ function getTypographyIds(descriptor, prop) {
|
|
|
2625
2812
|
if (prop == null)
|
|
2626
2813
|
return [];
|
|
2627
2814
|
switch (descriptor.type) {
|
|
2815
|
+
case TypographyControlType: {
|
|
2816
|
+
return getTypographyTypographyIds(prop);
|
|
2817
|
+
}
|
|
2818
|
+
case RichTextControlType:
|
|
2628
2819
|
case Types.RichText: {
|
|
2629
|
-
|
|
2630
|
-
|
|
2631
|
-
|
|
2632
|
-
|
|
2633
|
-
|
|
2634
|
-
|
|
2635
|
-
|
|
2636
|
-
case "text":
|
|
2637
|
-
return (_d = (_c = node.marks) == null ? void 0 : _c.flatMap(getMarkTypographyIds)) != null ? _d : [];
|
|
2638
|
-
default:
|
|
2639
|
-
return [];
|
|
2640
|
-
}
|
|
2641
|
-
}, getMarkTypographyIds = function(mark) {
|
|
2642
|
-
var _a2, _b;
|
|
2643
|
-
return [(_b = (_a2 = mark.data) == null ? void 0 : _a2.value) == null ? void 0 : _b.id].filter((id) => id != null);
|
|
2644
|
-
};
|
|
2645
|
-
const value = prop;
|
|
2646
|
-
if (value == null || value.document == null)
|
|
2647
|
-
return [];
|
|
2648
|
-
return getNodeTypographyIds(value.document);
|
|
2820
|
+
return getRichTextTypographyIds(prop);
|
|
2821
|
+
}
|
|
2822
|
+
case RichTextV2ControlType: {
|
|
2823
|
+
const data = prop;
|
|
2824
|
+
if (isRichTextV1Data(data))
|
|
2825
|
+
return getRichTextTypographyIds(data);
|
|
2826
|
+
return getRichTextV2TypographyIds(descriptor, data);
|
|
2649
2827
|
}
|
|
2650
2828
|
case ShapeControlType: {
|
|
2651
|
-
return
|
|
2829
|
+
return getShapeTypographyIds(descriptor, prop);
|
|
2652
2830
|
}
|
|
2653
2831
|
case ListControlType: {
|
|
2654
|
-
return
|
|
2832
|
+
return getListTypographyIds(descriptor, prop);
|
|
2655
2833
|
}
|
|
2656
2834
|
case Types.Shape: {
|
|
2657
|
-
return
|
|
2835
|
+
return getShapePropControllerTypographyIds(descriptor, prop);
|
|
2658
2836
|
}
|
|
2659
2837
|
case Types.List: {
|
|
2660
|
-
return
|
|
2838
|
+
return getListPropControllerTypographyIds(descriptor, prop);
|
|
2661
2839
|
}
|
|
2662
2840
|
default:
|
|
2663
2841
|
return [];
|
|
@@ -2734,53 +2912,27 @@ function getPageIds(descriptor, prop) {
|
|
|
2734
2912
|
}
|
|
2735
2913
|
})) != null ? _a2 : [];
|
|
2736
2914
|
}
|
|
2915
|
+
case RichTextControlType:
|
|
2737
2916
|
case Types.RichText: {
|
|
2738
|
-
|
|
2739
|
-
|
|
2740
|
-
|
|
2741
|
-
|
|
2742
|
-
|
|
2743
|
-
|
|
2744
|
-
|
|
2745
|
-
return getInlinePageIds(node);
|
|
2746
|
-
default:
|
|
2747
|
-
return [];
|
|
2748
|
-
}
|
|
2749
|
-
}, getInlinePageIds = function(inline) {
|
|
2750
|
-
var _a3, _b, _c, _d;
|
|
2751
|
-
switch (inline.type) {
|
|
2752
|
-
case "link": {
|
|
2753
|
-
const nodePageIds = (_b = (_a3 = inline.nodes) == null ? void 0 : _a3.flatMap(getNodePageIds)) != null ? _b : [];
|
|
2754
|
-
const dataPageIds = inline.data ? getLinkDataPageIds(inline.data) : [];
|
|
2755
|
-
return [...nodePageIds, ...dataPageIds];
|
|
2756
|
-
}
|
|
2757
|
-
default:
|
|
2758
|
-
return (_d = (_c = inline.nodes) == null ? void 0 : _c.flatMap(getNodePageIds)) != null ? _d : [];
|
|
2759
|
-
}
|
|
2760
|
-
}, getLinkDataPageIds = function(link) {
|
|
2761
|
-
switch (link.type) {
|
|
2762
|
-
case "OPEN_PAGE":
|
|
2763
|
-
return link.payload.pageId == null ? [] : [link.payload.pageId];
|
|
2764
|
-
default:
|
|
2765
|
-
return [];
|
|
2766
|
-
}
|
|
2767
|
-
};
|
|
2768
|
-
const value = prop;
|
|
2769
|
-
if (value == null || value.document == null)
|
|
2770
|
-
return [];
|
|
2771
|
-
return getNodePageIds(value.document);
|
|
2917
|
+
return getRichTextPageIds(prop);
|
|
2918
|
+
}
|
|
2919
|
+
case RichTextV2ControlType: {
|
|
2920
|
+
const data = prop;
|
|
2921
|
+
if (isRichTextV1Data(data))
|
|
2922
|
+
return getRichTextPageIds(data);
|
|
2923
|
+
return getRichTextV2PageIds(descriptor, data);
|
|
2772
2924
|
}
|
|
2773
2925
|
case ShapeControlType: {
|
|
2774
|
-
return
|
|
2926
|
+
return getShapePageIds(descriptor, prop);
|
|
2775
2927
|
}
|
|
2776
2928
|
case ListControlType: {
|
|
2777
|
-
return
|
|
2929
|
+
return getListPageIds(descriptor, prop);
|
|
2778
2930
|
}
|
|
2779
2931
|
case Types.Shape: {
|
|
2780
|
-
return
|
|
2932
|
+
return getShapePropControllerPageIds(descriptor, prop);
|
|
2781
2933
|
}
|
|
2782
2934
|
case Types.List: {
|
|
2783
|
-
return
|
|
2935
|
+
return getListPropControllerPageIds(descriptor, prop);
|
|
2784
2936
|
}
|
|
2785
2937
|
default:
|
|
2786
2938
|
return [];
|
|
@@ -2794,7 +2946,6 @@ var introspection = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineP
|
|
|
2794
2946
|
getBorderSwatchIds,
|
|
2795
2947
|
getBoxShadowsSwatchIds,
|
|
2796
2948
|
getResponsiveColorSwatchIds,
|
|
2797
|
-
getTypographyStyleSwatchIds,
|
|
2798
2949
|
getSwatchIds,
|
|
2799
2950
|
getBackgroundsFileIds,
|
|
2800
2951
|
getFileIds,
|
|
@@ -3054,6 +3205,7 @@ exports.TextArea = TextArea;
|
|
|
3054
3205
|
exports.TextInput = TextInput;
|
|
3055
3206
|
exports.TextStyle = TextStyle;
|
|
3056
3207
|
exports.Types = Types;
|
|
3208
|
+
exports.TypographyControlType = TypographyControlType;
|
|
3057
3209
|
exports.Video = Video;
|
|
3058
3210
|
exports.Width = Width;
|
|
3059
3211
|
exports.WidthPropControllerFormat = WidthPropControllerFormat;
|
|
@@ -3094,6 +3246,11 @@ exports.getInitialState = getInitialState$7;
|
|
|
3094
3246
|
exports.getInitialState$1 = getInitialState$2;
|
|
3095
3247
|
exports.getIsInBuilder = getIsInBuilder;
|
|
3096
3248
|
exports.getIsPreview = getIsPreview;
|
|
3249
|
+
exports.getListElementChildren = getListElementChildren;
|
|
3250
|
+
exports.getListFileIds = getListFileIds;
|
|
3251
|
+
exports.getListPageIds = getListPageIds;
|
|
3252
|
+
exports.getListSwatchIds = getListSwatchIds;
|
|
3253
|
+
exports.getListTypographyIds = getListTypographyIds;
|
|
3097
3254
|
exports.getLocales = getLocales;
|
|
3098
3255
|
exports.getPageIds = getPageIds;
|
|
3099
3256
|
exports.getPropController = getPropController;
|
|
@@ -3102,11 +3259,16 @@ exports.getPropControllers = getPropControllers;
|
|
|
3102
3259
|
exports.getPropControllersHandle = getPropControllersHandle;
|
|
3103
3260
|
exports.getReactComponent = getReactComponent;
|
|
3104
3261
|
exports.getResponsiveColorSwatchIds = getResponsiveColorSwatchIds;
|
|
3262
|
+
exports.getShapeElementChildren = getShapeElementChildren;
|
|
3263
|
+
exports.getShapeFileIds = getShapeFileIds;
|
|
3264
|
+
exports.getShapePageIds = getShapePageIds;
|
|
3265
|
+
exports.getShapeSwatchIds = getShapeSwatchIds;
|
|
3266
|
+
exports.getShapeTypographyIds = getShapeTypographyIds;
|
|
3105
3267
|
exports.getSwatchIds = getSwatchIds;
|
|
3106
3268
|
exports.getTableIds = getTableIds;
|
|
3107
3269
|
exports.getTypographyIds = getTypographyIds;
|
|
3108
|
-
exports.
|
|
3109
|
-
exports.
|
|
3270
|
+
exports.getTypographySwatchIds = getTypographySwatchIds;
|
|
3271
|
+
exports.getTypographyTypographyIds = getTypographyTypographyIds;
|
|
3110
3272
|
exports.introspection = introspection;
|
|
3111
3273
|
exports.isElementReference = isElementReference;
|
|
3112
3274
|
exports.isNonNullable = isNonNullable;
|
|
@@ -3132,6 +3294,7 @@ exports.richTextV2DescendentsToData = richTextV2DescendentsToData;
|
|
|
3132
3294
|
exports.toSelectionDTO = toSelectionDTO;
|
|
3133
3295
|
exports.unstable_RichTextV2 = unstable_RichTextV2;
|
|
3134
3296
|
exports.unstable_StyleV2 = unstable_StyleV2;
|
|
3297
|
+
exports.unstable_Typography = unstable_Typography;
|
|
3135
3298
|
exports.unstable_useStyleV2ClassName = unstable_useStyleV2ClassName;
|
|
3136
3299
|
exports.useStyle = useStyle;
|
|
3137
3300
|
//# sourceMappingURL=react-page.cjs.js.map
|