@makeswift/runtime 0.9.12 → 0.10.0
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 +3 -0
- package/dist/Box.cjs.js.map +1 -1
- package/dist/Box.es.js +4 -1
- package/dist/Box.es.js.map +1 -1
- package/dist/Button.cjs.js +3 -2
- package/dist/Button.cjs.js.map +1 -1
- package/dist/Button.es.js +4 -3
- package/dist/Button.es.js.map +1 -1
- package/dist/Carousel.cjs.js +3 -2
- package/dist/Carousel.cjs.js.map +1 -1
- package/dist/Carousel.es.js +4 -3
- package/dist/Carousel.es.js.map +1 -1
- package/dist/Countdown.cjs.js +3 -0
- package/dist/Countdown.cjs.js.map +1 -1
- package/dist/Countdown.es.js +4 -1
- package/dist/Countdown.es.js.map +1 -1
- package/dist/Divider.cjs.js +3 -0
- package/dist/Divider.cjs.js.map +1 -1
- package/dist/Divider.es.js +4 -1
- package/dist/Divider.es.js.map +1 -1
- package/dist/Embed.cjs.js +1 -0
- package/dist/Embed.cjs.js.map +1 -1
- package/dist/Embed.es.js +2 -1
- package/dist/Embed.es.js.map +1 -1
- package/dist/Form.cjs.js +13 -12
- package/dist/Form.cjs.js.map +1 -1
- package/dist/Form.es.js +5 -4
- package/dist/Form.es.js.map +1 -1
- package/dist/Image.cjs.js +11 -10
- package/dist/Image.cjs.js.map +1 -1
- package/dist/Image.es.js +11 -10
- package/dist/Image.es.js.map +1 -1
- package/dist/LiveProvider.cjs.js +3 -0
- package/dist/LiveProvider.cjs.js.map +1 -1
- package/dist/LiveProvider.es.js +5 -2
- package/dist/LiveProvider.es.js.map +1 -1
- package/dist/Navigation.cjs.js +11 -10
- package/dist/Navigation.cjs.js.map +1 -1
- package/dist/Navigation.es.js +11 -10
- package/dist/Navigation.es.js.map +1 -1
- package/dist/PreviewProvider.cjs.js +6 -3
- package/dist/PreviewProvider.cjs.js.map +1 -1
- package/dist/PreviewProvider.es.js +5 -2
- package/dist/PreviewProvider.es.js.map +1 -1
- package/dist/ReadOnlyText.cjs.js +19 -26
- package/dist/ReadOnlyText.cjs.js.map +1 -1
- package/dist/ReadOnlyText.es.js +15 -22
- package/dist/ReadOnlyText.es.js.map +1 -1
- package/dist/ReadOnlyTextV2.cjs.js +29 -26
- package/dist/ReadOnlyTextV2.cjs.js.map +1 -1
- package/dist/ReadOnlyTextV2.es.js +28 -25
- package/dist/ReadOnlyTextV2.es.js.map +1 -1
- package/dist/Root.cjs.js +3 -0
- package/dist/Root.cjs.js.map +1 -1
- package/dist/Root.es.js +4 -1
- package/dist/Root.es.js.map +1 -1
- package/dist/SocialLinks.cjs.js +6 -5
- package/dist/SocialLinks.cjs.js.map +1 -1
- package/dist/SocialLinks.es.js +7 -6
- package/dist/SocialLinks.es.js.map +1 -1
- package/dist/Text.cjs.js +12 -71
- package/dist/Text.cjs.js.map +1 -1
- package/dist/Text.es.js +13 -64
- package/dist/Text.es.js.map +1 -1
- package/dist/Video.cjs.js +1 -0
- package/dist/Video.cjs.js.map +1 -1
- package/dist/Video.es.js +2 -1
- package/dist/Video.es.js.map +1 -1
- package/dist/builder.cjs.js +2 -0
- package/dist/builder.cjs.js.map +1 -1
- package/dist/builder.es.js +2 -0
- package/dist/builder.es.js.map +1 -1
- package/dist/components.cjs.js +3 -2
- package/dist/components.cjs.js.map +1 -1
- package/dist/components.es.js +3 -2
- package/dist/components.es.js.map +1 -1
- package/dist/control-serialization.es.js +1 -1
- package/dist/controls.cjs.js +8 -8
- package/dist/controls.es.js +4 -2
- package/dist/controls.es.js.map +1 -1
- package/dist/index.cjs.js +276 -213
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.cjs3.js +21 -107
- package/dist/index.cjs3.js.map +1 -1
- package/dist/index.cjs4.js +16 -57
- package/dist/index.cjs4.js.map +1 -1
- package/dist/index.cjs5.js +53 -242
- package/dist/index.cjs5.js.map +1 -1
- package/dist/index.cjs6.js +0 -41
- package/dist/index.cjs6.js.map +1 -1
- package/dist/index.cjs7.js +376 -14
- package/dist/index.cjs7.js.map +1 -1
- package/dist/index.cjs8.js +275 -11
- package/dist/index.cjs8.js.map +1 -1
- package/dist/index.es.js +270 -206
- package/dist/index.es.js.map +1 -1
- package/dist/index.es2.js +2 -2
- package/dist/index.es3.js +22 -103
- package/dist/index.es3.js.map +1 -1
- package/dist/index.es4.js +16 -57
- package/dist/index.es4.js.map +1 -1
- package/dist/index.es5.js +53 -240
- package/dist/index.es5.js.map +1 -1
- package/dist/index.es6.js +1 -36
- package/dist/index.es6.js.map +1 -1
- package/dist/index.es7.js +372 -16
- package/dist/index.es7.js.map +1 -1
- package/dist/index.es8.js +270 -10
- package/dist/index.es8.js.map +1 -1
- package/dist/main.cjs.js +2 -0
- package/dist/main.cjs.js.map +1 -1
- package/dist/main.es.js +2 -0
- package/dist/main.es.js.map +1 -1
- package/dist/next.cjs.js +3 -0
- package/dist/next.cjs.js.map +1 -1
- package/dist/next.es.js +4 -1
- package/dist/next.es.js.map +1 -1
- package/dist/prop-controllers.cjs.js +2 -0
- package/dist/prop-controllers.cjs.js.map +1 -1
- package/dist/prop-controllers.es.js +2 -0
- package/dist/prop-controllers.es.js.map +1 -1
- package/dist/react-page.cjs.js +1450 -65
- package/dist/react-page.cjs.js.map +1 -1
- package/dist/react-page.es.js +1427 -66
- package/dist/react-page.es.js.map +1 -1
- package/dist/react.cjs.js +3 -0
- package/dist/react.cjs.js.map +1 -1
- package/dist/react.es.js +3 -0
- package/dist/react.es.js.map +1 -1
- package/dist/slate.cjs.js +33 -391
- package/dist/slate.cjs.js.map +1 -1
- package/dist/slate.es.js +15 -376
- package/dist/slate.es.js.map +1 -1
- package/dist/text-input.cjs.js +0 -22
- package/dist/text-input.cjs.js.map +1 -1
- package/dist/text-input.es.js +1 -18
- package/dist/text-input.es.js.map +1 -1
- package/dist/types/src/components/builtin/Text/Text.d.ts +3 -4
- package/dist/types/src/components/builtin/Text/Text.d.ts.map +1 -1
- package/dist/types/src/components/builtin/Text/register.d.ts.map +1 -1
- package/dist/types/src/controls/rich-text/fixtures/v2-data-types.d.ts.map +1 -1
- package/dist/types/src/controls/rich-text/rich-text.d.ts +0 -1
- package/dist/types/src/controls/rich-text/rich-text.d.ts.map +1 -1
- package/dist/types/src/controls/rich-text/translation.d.ts.map +1 -1
- package/dist/types/src/controls/rich-text-v2/plugin.d.ts +29 -0
- package/dist/types/src/controls/rich-text-v2/plugin.d.ts.map +1 -0
- package/dist/types/src/controls/rich-text-v2/rich-text-v2.d.ts +17 -31
- package/dist/types/src/controls/rich-text-v2/rich-text-v2.d.ts.map +1 -1
- package/dist/types/src/next/client.d.ts.map +1 -1
- package/dist/types/src/prop-controllers/descriptors.d.ts +1 -1
- package/dist/types/src/prop-controllers/descriptors.d.ts.map +1 -1
- package/dist/types/src/prop-controllers/introspection.d.ts.map +1 -1
- package/dist/types/src/runtimes/react/controls/control.d.ts +1 -1
- package/dist/types/src/runtimes/react/controls/control.d.ts.map +1 -1
- package/dist/types/src/{components/builtin/Text → runtimes/react/controls/rich-text}/EditableText/editable-text.d.ts +4 -3
- package/dist/types/src/runtimes/react/controls/rich-text/EditableText/editable-text.d.ts.map +1 -0
- package/dist/types/src/runtimes/react/controls/rich-text/EditableText/index.d.ts.map +1 -0
- package/dist/types/src/runtimes/react/controls/rich-text/EditableText/useSyncDOMSelection.d.ts.map +1 -0
- package/dist/types/src/{components/builtin/Text → runtimes/react/controls/rich-text}/EditableText/useSyncWithBuilder.d.ts +1 -1
- package/dist/types/src/runtimes/react/controls/rich-text/EditableText/useSyncWithBuilder.d.ts.map +1 -0
- package/dist/types/src/{components/builtin/Text → runtimes/react/controls/rich-text}/ReadOnlyText.d.ts +2 -2
- package/dist/types/src/runtimes/react/controls/rich-text/ReadOnlyText.d.ts.map +1 -0
- package/dist/types/src/{components/builtin/Text → runtimes/react/controls/rich-text}/components/Element/block.d.ts +1 -1
- package/dist/types/src/runtimes/react/controls/rich-text/components/Element/block.d.ts.map +1 -0
- package/dist/types/src/runtimes/react/controls/rich-text/components/Element/element.d.ts.map +1 -0
- package/dist/types/src/runtimes/react/controls/rich-text/components/Element/index.d.ts.map +1 -0
- package/dist/types/src/{components/builtin/Text → runtimes/react/controls/rich-text}/components/Element/inline.d.ts +1 -1
- package/dist/types/src/runtimes/react/controls/rich-text/components/Element/inline.d.ts.map +1 -0
- package/dist/types/src/runtimes/react/controls/rich-text/components/Leaf/index.d.ts.map +1 -0
- package/dist/types/src/runtimes/react/controls/rich-text/components/Leaf/leaf.d.ts.map +1 -0
- package/dist/types/src/runtimes/react/controls/rich-text/components/index.d.ts.map +1 -0
- package/dist/types/src/runtimes/react/controls/rich-text/index.d.ts +2 -0
- package/dist/types/src/runtimes/react/controls/rich-text/index.d.ts.map +1 -0
- package/dist/types/src/runtimes/react/controls/{rich-text.d.ts → rich-text/rich-text.d.ts} +1 -1
- package/dist/types/src/runtimes/react/controls/rich-text/rich-text.d.ts.map +1 -0
- 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 +2 -1
- 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 +2 -1
- 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.map +1 -1
- package/dist/types/src/runtimes/react/controls/rich-text-v2/ReadOnlyTextV2.d.ts +2 -1
- package/dist/types/src/runtimes/react/controls/rich-text-v2/ReadOnlyTextV2.d.ts.map +1 -1
- package/dist/types/src/slate/BlockPlugin/index.d.ts +3 -3
- package/dist/types/src/slate/BlockPlugin/index.d.ts.map +1 -1
- package/dist/types/src/slate/InlineModePlugin/index.d.ts +6 -4
- package/dist/types/src/slate/InlineModePlugin/index.d.ts.map +1 -1
- package/dist/types/src/slate/InlinePlugin/index.d.ts +3 -3
- package/dist/types/src/slate/InlinePlugin/index.d.ts.map +1 -1
- package/dist/types/src/slate/InlinePlugin/types.d.ts +1 -1
- package/dist/types/src/slate/InlinePlugin/types.d.ts.map +1 -1
- package/dist/types/src/slate/LinkPlugin/index.d.ts +3 -3
- package/dist/types/src/slate/LinkPlugin/index.d.ts.map +1 -1
- package/dist/types/src/slate/LinkPlugin/linkPluginWithoutRenderElement.d.ts +16 -0
- package/dist/types/src/slate/LinkPlugin/linkPluginWithoutRenderElement.d.ts.map +1 -0
- package/dist/types/src/slate/TextAlignPlugin/index.d.ts +3 -3
- package/dist/types/src/slate/TypographyPlugin/index.d.ts +3 -3
- package/dist/types/src/slate/TypographyPlugin/index.d.ts.map +1 -1
- package/dist/types/src/slate/types.d.ts +1 -10
- package/dist/types/src/slate/types.d.ts.map +1 -1
- package/dist/types/src/slate/utils/element.d.ts.map +1 -1
- package/dist/types/src/state/modules/locales.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/index.cjs10.js +0 -390
- package/dist/index.cjs10.js.map +0 -1
- package/dist/index.cjs9.js +0 -295
- package/dist/index.cjs9.js.map +0 -1
- package/dist/index.es10.js +0 -383
- package/dist/index.es10.js.map +0 -1
- package/dist/index.es9.js +0 -288
- package/dist/index.es9.js.map +0 -1
- package/dist/types/src/components/builtin/Text/EditableText/editable-text.d.ts.map +0 -1
- package/dist/types/src/components/builtin/Text/EditableText/index.d.ts.map +0 -1
- package/dist/types/src/components/builtin/Text/EditableText/useSyncDOMSelection.d.ts.map +0 -1
- package/dist/types/src/components/builtin/Text/EditableText/useSyncWithBuilder.d.ts.map +0 -1
- package/dist/types/src/components/builtin/Text/ReadOnlyText.d.ts.map +0 -1
- package/dist/types/src/components/builtin/Text/components/Element/block.d.ts.map +0 -1
- package/dist/types/src/components/builtin/Text/components/Element/element.d.ts.map +0 -1
- package/dist/types/src/components/builtin/Text/components/Element/index.d.ts.map +0 -1
- package/dist/types/src/components/builtin/Text/components/Element/inline.d.ts.map +0 -1
- package/dist/types/src/components/builtin/Text/components/Leaf/index.d.ts.map +0 -1
- package/dist/types/src/components/builtin/Text/components/Leaf/leaf.d.ts.map +0 -1
- package/dist/types/src/components/builtin/Text/components/index.d.ts.map +0 -1
- package/dist/types/src/runtimes/react/controls/rich-text.d.ts.map +0 -1
- package/dist/types.cjs2.js +0 -765
- package/dist/types.cjs2.js.map +0 -1
- package/dist/types.es2.js +0 -748
- package/dist/types.es2.js.map +0 -1
- /package/dist/types/src/{components/builtin/Text → runtimes/react/controls/rich-text}/EditableText/index.d.ts +0 -0
- /package/dist/types/src/{components/builtin/Text → runtimes/react/controls/rich-text}/EditableText/useSyncDOMSelection.d.ts +0 -0
- /package/dist/types/src/{components/builtin/Text → runtimes/react/controls/rich-text}/components/Element/element.d.ts +0 -0
- /package/dist/types/src/{components/builtin/Text → runtimes/react/controls/rich-text}/components/Element/index.d.ts +0 -0
- /package/dist/types/src/{components/builtin/Text → runtimes/react/controls/rich-text}/components/Leaf/index.d.ts +0 -0
- /package/dist/types/src/{components/builtin/Text → runtimes/react/controls/rich-text}/components/Leaf/leaf.d.ts +0 -0
- /package/dist/types/src/{components/builtin/Text → runtimes/react/controls/rich-text}/components/index.d.ts +0 -0
package/dist/react-page.cjs.js
CHANGED
|
@@ -18,6 +18,18 @@ var __spreadValues = (a, b) => {
|
|
|
18
18
|
return a;
|
|
19
19
|
};
|
|
20
20
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
21
|
+
var __objRest = (source, exclude) => {
|
|
22
|
+
var target = {};
|
|
23
|
+
for (var prop in source)
|
|
24
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
25
|
+
target[prop] = source[prop];
|
|
26
|
+
if (source != null && __getOwnPropSymbols)
|
|
27
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
28
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
29
|
+
target[prop] = source[prop];
|
|
30
|
+
}
|
|
31
|
+
return target;
|
|
32
|
+
};
|
|
21
33
|
var __publicField = (obj, key, value) => {
|
|
22
34
|
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
23
35
|
return value;
|
|
@@ -32,11 +44,14 @@ var css = require("@emotion/css");
|
|
|
32
44
|
var serialize = require("@emotion/serialize");
|
|
33
45
|
var utils = require("@emotion/utils");
|
|
34
46
|
var slate = require("slate");
|
|
47
|
+
var jsxRuntime = require("react/jsx-runtime");
|
|
48
|
+
var isHotkey = require("is-hotkey");
|
|
35
49
|
function _interopDefaultLegacy(e) {
|
|
36
50
|
return e && typeof e === "object" && "default" in e ? e : { "default": e };
|
|
37
51
|
}
|
|
38
52
|
var thunk__default = /* @__PURE__ */ _interopDefaultLegacy(thunk);
|
|
39
53
|
var React__default = /* @__PURE__ */ _interopDefaultLegacy(React);
|
|
54
|
+
var isHotkey__default = /* @__PURE__ */ _interopDefaultLegacy(isHotkey);
|
|
40
55
|
const ComponentIcon = {
|
|
41
56
|
Billing: "billing",
|
|
42
57
|
Bolt: "bolt",
|
|
@@ -290,6 +305,12 @@ function reducer$1(state = getInitialState(), action) {
|
|
|
290
305
|
}
|
|
291
306
|
}
|
|
292
307
|
function parseLocalesInput(input) {
|
|
308
|
+
if (input.locales == null) {
|
|
309
|
+
throw new Error(`Locales cannot be null or undefined. Please provide the locales array.`);
|
|
310
|
+
}
|
|
311
|
+
if (input.locales.includes(input.defaultLocale) === false) {
|
|
312
|
+
throw new Error(`Default locale "${input.defaultLocale}" is not included in locales: ${input.locales}. Please add the default locale to the locales array.`);
|
|
313
|
+
}
|
|
293
314
|
return {
|
|
294
315
|
locales: input.locales.map((locale) => actions.localeStringSchema.parse(locale)),
|
|
295
316
|
defaultLocale: actions.localeStringSchema.parse(input.defaultLocale),
|
|
@@ -676,7 +697,7 @@ function Shape$1(options) {
|
|
|
676
697
|
function introspectShapePropControllerData(descriptor, value, func) {
|
|
677
698
|
if (value == null)
|
|
678
699
|
return [];
|
|
679
|
-
return Object.entries(descriptor.options.type).flatMap(([key,
|
|
700
|
+
return Object.entries(descriptor.options.type).flatMap(([key, definition2]) => func(definition2, value[key]));
|
|
680
701
|
}
|
|
681
702
|
function getShapePropControllerElementChildren(descriptor, value) {
|
|
682
703
|
return introspectShapePropControllerData(descriptor, value, getElementChildren);
|
|
@@ -1042,32 +1063,32 @@ class ListControl extends PropController {
|
|
|
1042
1063
|
this.controls = /* @__PURE__ */ new Map();
|
|
1043
1064
|
}
|
|
1044
1065
|
}
|
|
1045
|
-
function copyListData(
|
|
1066
|
+
function copyListData(definition2, value, context) {
|
|
1046
1067
|
if (value == null)
|
|
1047
1068
|
return value;
|
|
1048
1069
|
return value && value.map((item) => __spreadProps(__spreadValues({}, item), {
|
|
1049
|
-
value: copy(
|
|
1070
|
+
value: copy(definition2.config.type, item.value, context)
|
|
1050
1071
|
}));
|
|
1051
1072
|
}
|
|
1052
|
-
function introspectListData(
|
|
1073
|
+
function introspectListData(definition2, value, func) {
|
|
1053
1074
|
if (value == null)
|
|
1054
1075
|
return [];
|
|
1055
|
-
return value.flatMap((item) => func(
|
|
1076
|
+
return value.flatMap((item) => func(definition2.config.type, item.value));
|
|
1056
1077
|
}
|
|
1057
|
-
function getListElementChildren(
|
|
1058
|
-
return introspectListData(
|
|
1078
|
+
function getListElementChildren(definition2, value) {
|
|
1079
|
+
return introspectListData(definition2, value, getElementChildren);
|
|
1059
1080
|
}
|
|
1060
|
-
function getListSwatchIds(
|
|
1061
|
-
return introspectListData(
|
|
1081
|
+
function getListSwatchIds(definition2, value) {
|
|
1082
|
+
return introspectListData(definition2, value, getSwatchIds);
|
|
1062
1083
|
}
|
|
1063
|
-
function getListFileIds(
|
|
1064
|
-
return introspectListData(
|
|
1084
|
+
function getListFileIds(definition2, value) {
|
|
1085
|
+
return introspectListData(definition2, value, getFileIds);
|
|
1065
1086
|
}
|
|
1066
|
-
function getListTypographyIds(
|
|
1067
|
-
return introspectListData(
|
|
1087
|
+
function getListTypographyIds(definition2, value) {
|
|
1088
|
+
return introspectListData(definition2, value, getTypographyIds);
|
|
1068
1089
|
}
|
|
1069
|
-
function getListPageIds(
|
|
1070
|
-
return introspectListData(
|
|
1090
|
+
function getListPageIds(definition2, value) {
|
|
1091
|
+
return introspectListData(definition2, value, getPageIds);
|
|
1071
1092
|
}
|
|
1072
1093
|
const ShapeControlType = "makeswift::controls::shape";
|
|
1073
1094
|
function Shape(config) {
|
|
@@ -1112,35 +1133,35 @@ class ShapeControl extends PropController {
|
|
|
1112
1133
|
this.setControls();
|
|
1113
1134
|
}
|
|
1114
1135
|
}
|
|
1115
|
-
function copyShapeData(
|
|
1136
|
+
function copyShapeData(definition2, value, context) {
|
|
1116
1137
|
if (value == null)
|
|
1117
1138
|
return value;
|
|
1118
1139
|
const newValue = {};
|
|
1119
|
-
for (const [key, itemDefinition] of Object.entries(
|
|
1140
|
+
for (const [key, itemDefinition] of Object.entries(definition2.config.type)) {
|
|
1120
1141
|
const prop = value[key];
|
|
1121
1142
|
newValue[key] = copy(itemDefinition, prop, context);
|
|
1122
1143
|
}
|
|
1123
1144
|
return newValue;
|
|
1124
1145
|
}
|
|
1125
|
-
function introspectShapeData(
|
|
1146
|
+
function introspectShapeData(definition2, value, func) {
|
|
1126
1147
|
if (value == null)
|
|
1127
1148
|
return [];
|
|
1128
|
-
return Object.entries(
|
|
1149
|
+
return Object.entries(definition2.config.type).flatMap(([key, definition22]) => func(definition22, value[key]));
|
|
1129
1150
|
}
|
|
1130
|
-
function getShapeElementChildren(
|
|
1131
|
-
return introspectShapeData(
|
|
1151
|
+
function getShapeElementChildren(definition2, data) {
|
|
1152
|
+
return introspectShapeData(definition2, data, getElementChildren);
|
|
1132
1153
|
}
|
|
1133
|
-
function getShapeSwatchIds(
|
|
1134
|
-
return introspectShapeData(
|
|
1154
|
+
function getShapeSwatchIds(definition2, data) {
|
|
1155
|
+
return introspectShapeData(definition2, data, getSwatchIds);
|
|
1135
1156
|
}
|
|
1136
|
-
function getShapeTypographyIds(
|
|
1137
|
-
return introspectShapeData(
|
|
1157
|
+
function getShapeTypographyIds(definition2, data) {
|
|
1158
|
+
return introspectShapeData(definition2, data, getTypographyIds);
|
|
1138
1159
|
}
|
|
1139
|
-
function getShapePageIds(
|
|
1140
|
-
return introspectShapeData(
|
|
1160
|
+
function getShapePageIds(definition2, data) {
|
|
1161
|
+
return introspectShapeData(definition2, data, getPageIds);
|
|
1141
1162
|
}
|
|
1142
|
-
function getShapeFileIds(
|
|
1143
|
-
return introspectShapeData(
|
|
1163
|
+
function getShapeFileIds(definition2, data) {
|
|
1164
|
+
return introspectShapeData(definition2, data, getFileIds);
|
|
1144
1165
|
}
|
|
1145
1166
|
const SlotControlType = "makeswift::controls::slot";
|
|
1146
1167
|
function Slot() {
|
|
@@ -1938,8 +1959,8 @@ function copy$1(descriptor, value, context) {
|
|
|
1938
1959
|
function copyElementReference(value, context) {
|
|
1939
1960
|
return context.replacementContext.globalElementIds.get(value) || value;
|
|
1940
1961
|
}
|
|
1941
|
-
function copy(
|
|
1942
|
-
switch (
|
|
1962
|
+
function copy(definition2, value, context) {
|
|
1963
|
+
switch (definition2.type) {
|
|
1943
1964
|
case Types.Backgrounds:
|
|
1944
1965
|
case Types.Grid:
|
|
1945
1966
|
case Types.NavigationLinks:
|
|
@@ -1953,7 +1974,7 @@ function copy(definition, value, context) {
|
|
|
1953
1974
|
case Types.Border:
|
|
1954
1975
|
case Types.RichText:
|
|
1955
1976
|
case Types.ElementID:
|
|
1956
|
-
return copy$1(
|
|
1977
|
+
return copy$1(definition2, value, context);
|
|
1957
1978
|
case ColorControlType:
|
|
1958
1979
|
return copyColorData(value, context);
|
|
1959
1980
|
case ImageControlType:
|
|
@@ -1961,9 +1982,9 @@ function copy(definition, value, context) {
|
|
|
1961
1982
|
case LinkControlType:
|
|
1962
1983
|
return copyLinkData(value, context);
|
|
1963
1984
|
case ShapeControlType:
|
|
1964
|
-
return copyShapeData(
|
|
1985
|
+
return copyShapeData(definition2, value, context);
|
|
1965
1986
|
case ListControlType:
|
|
1966
|
-
return copyListData(
|
|
1987
|
+
return copyListData(definition2, value, context);
|
|
1967
1988
|
case StyleControlType:
|
|
1968
1989
|
return copyStyleData(value, context);
|
|
1969
1990
|
case SlotControlType:
|
|
@@ -1972,14 +1993,31 @@ function copy(definition, value, context) {
|
|
|
1972
1993
|
return value;
|
|
1973
1994
|
}
|
|
1974
1995
|
}
|
|
1975
|
-
function merge(
|
|
1976
|
-
switch (
|
|
1996
|
+
function merge(definition2, a, b = a, context) {
|
|
1997
|
+
switch (definition2.type) {
|
|
1977
1998
|
case SlotControlType:
|
|
1978
1999
|
return mergeSlotData(a, b, context);
|
|
1979
2000
|
default:
|
|
1980
2001
|
return b;
|
|
1981
2002
|
}
|
|
1982
2003
|
}
|
|
2004
|
+
const unstable_IconRadioGroupIcon = {
|
|
2005
|
+
TextAlignCenter: "TextAlignCenter",
|
|
2006
|
+
TextAlignJustify: "TextAlignJustify",
|
|
2007
|
+
TextAlignLeft: "TextAlignLeft",
|
|
2008
|
+
TextAlignRight: "TextAlignRight",
|
|
2009
|
+
Superscript: "Superscript16",
|
|
2010
|
+
Subscript: "Subscript16",
|
|
2011
|
+
Code: "Code16"
|
|
2012
|
+
};
|
|
2013
|
+
const IconRadioGroupControlType = "makeswift::controls::icon-radio-group";
|
|
2014
|
+
function unstable_IconRadioGroup(config) {
|
|
2015
|
+
return { type: IconRadioGroupControlType, config };
|
|
2016
|
+
}
|
|
2017
|
+
const SelectControlType = "makeswift::controls::select";
|
|
2018
|
+
function Select(config) {
|
|
2019
|
+
return { type: SelectControlType, config };
|
|
2020
|
+
}
|
|
1983
2021
|
const isServer = typeof window === "undefined";
|
|
1984
2022
|
const useInsertionEffectSpecifier = "useInsertionEffect";
|
|
1985
2023
|
const useInsertionEffect = (_a = React__default["default"][useInsertionEffectSpecifier]) != null ? _a : React__default["default"].useLayoutEffect;
|
|
@@ -2045,7 +2083,6 @@ const ObjectType = {
|
|
|
2045
2083
|
};
|
|
2046
2084
|
const RootBlockType = {
|
|
2047
2085
|
Default: "default",
|
|
2048
|
-
Text: "text-block",
|
|
2049
2086
|
Paragraph: "paragraph",
|
|
2050
2087
|
Heading1: "heading-one",
|
|
2051
2088
|
Heading2: "heading-two",
|
|
@@ -2217,7 +2254,6 @@ function toNodeDTO(node) {
|
|
|
2217
2254
|
case BlockType.Heading5:
|
|
2218
2255
|
case BlockType.Heading6:
|
|
2219
2256
|
case BlockType.Default:
|
|
2220
|
-
case BlockType.Text:
|
|
2221
2257
|
case BlockType.BlockQuote:
|
|
2222
2258
|
case BlockType.Paragraph:
|
|
2223
2259
|
case BlockType.OrderedList:
|
|
@@ -2271,9 +2307,6 @@ function richTextDAOToDTO(children, selection) {
|
|
|
2271
2307
|
};
|
|
2272
2308
|
}
|
|
2273
2309
|
const RichTextControlType = "makeswift::controls::rich-text";
|
|
2274
|
-
function RichText() {
|
|
2275
|
-
return { type: RichTextControlType };
|
|
2276
|
-
}
|
|
2277
2310
|
const RichTextControlMessageType = {
|
|
2278
2311
|
CHANGE_BUILDER_EDIT_MODE: "CHANGE_BUILDER_EDIT_MODE",
|
|
2279
2312
|
INITIALIZE_EDITOR: "INITIALIZE_EDITOR",
|
|
@@ -2351,23 +2384,1354 @@ function richTextV2DescendentsToData(descendants, key) {
|
|
|
2351
2384
|
key
|
|
2352
2385
|
};
|
|
2353
2386
|
}
|
|
2354
|
-
const RichTextV2ControlType = "makeswift::controls::rich-text-v2";
|
|
2355
|
-
const RichTextV2Mode = {
|
|
2356
|
-
Inline: "makeswift::controls::rich-text-v2::mode::inline",
|
|
2357
|
-
Block: "makeswift::controls::rich-text-v2::mode::block"
|
|
2358
|
-
};
|
|
2359
2387
|
function createRichTextV2Plugin({
|
|
2360
2388
|
control,
|
|
2361
2389
|
withPlugin,
|
|
2362
|
-
onKeyDown,
|
|
2390
|
+
onKeyDown: onKeyDown2,
|
|
2363
2391
|
renderElement,
|
|
2364
2392
|
renderLeaf
|
|
2365
2393
|
}) {
|
|
2366
|
-
return { control, withPlugin, onKeyDown, renderElement, renderLeaf };
|
|
2394
|
+
return { control, withPlugin, onKeyDown: onKeyDown2, renderElement, renderLeaf };
|
|
2395
|
+
}
|
|
2396
|
+
const ElementUtils = {
|
|
2397
|
+
isRootBlock(node) {
|
|
2398
|
+
return slate.Element.isElement(node) && (slate.Element.isElementType(node, BlockType.Paragraph) || slate.Element.isElementType(node, BlockType.Heading1) || slate.Element.isElementType(node, BlockType.Heading2) || slate.Element.isElementType(node, BlockType.Heading3) || slate.Element.isElementType(node, BlockType.Heading3) || slate.Element.isElementType(node, BlockType.Heading4) || slate.Element.isElementType(node, BlockType.Heading5) || slate.Element.isElementType(node, BlockType.Heading6) || slate.Element.isElementType(node, BlockType.BlockQuote) || slate.Element.isElementType(node, BlockType.UnorderedList) || slate.Element.isElementType(node, BlockType.OrderedList) || slate.Element.isElementType(node, BlockType.Default));
|
|
2399
|
+
},
|
|
2400
|
+
isBlock(node) {
|
|
2401
|
+
return slate.Element.isElement(node) && (this.isRootBlock(node) || slate.Element.isElementType(node, BlockType.ListItem) || slate.Element.isElementType(node, BlockType.ListItemChild));
|
|
2402
|
+
},
|
|
2403
|
+
isInline(node) {
|
|
2404
|
+
return slate.Element.isElementType(node, InlineType.Code) || slate.Element.isElementType(node, InlineType.Link) || slate.Element.isElementType(node, InlineType.SubScript) || slate.Element.isElementType(node, InlineType.SuperScript);
|
|
2405
|
+
},
|
|
2406
|
+
isConvertibleToListTextNode(node) {
|
|
2407
|
+
return !this.isList(node) && !this.isListItem(node) && !this.isListItemChild(node);
|
|
2408
|
+
},
|
|
2409
|
+
isList(node) {
|
|
2410
|
+
return slate.Element.isElementType(node, BlockType.OrderedList) || slate.Element.isElementType(node, BlockType.UnorderedList);
|
|
2411
|
+
},
|
|
2412
|
+
isListItem(node) {
|
|
2413
|
+
return slate.Element.isElementType(node, BlockType.ListItem);
|
|
2414
|
+
},
|
|
2415
|
+
isListItemChild(node) {
|
|
2416
|
+
return slate.Element.isElementType(node, BlockType.ListItemChild);
|
|
2417
|
+
},
|
|
2418
|
+
createText() {
|
|
2419
|
+
return { text: "" };
|
|
2420
|
+
},
|
|
2421
|
+
createParagraph() {
|
|
2422
|
+
return {
|
|
2423
|
+
children: [this.createText()],
|
|
2424
|
+
type: BlockType.Paragraph
|
|
2425
|
+
};
|
|
2426
|
+
},
|
|
2427
|
+
createList(type = BlockType.UnorderedList) {
|
|
2428
|
+
return { children: [this.createText()], type };
|
|
2429
|
+
},
|
|
2430
|
+
createListItem() {
|
|
2431
|
+
return {
|
|
2432
|
+
children: [this.createListItemChild()],
|
|
2433
|
+
type: BlockType.ListItem
|
|
2434
|
+
};
|
|
2435
|
+
},
|
|
2436
|
+
createListItemChild() {
|
|
2437
|
+
return {
|
|
2438
|
+
children: [this.createText()],
|
|
2439
|
+
type: BlockType.ListItemChild
|
|
2440
|
+
};
|
|
2441
|
+
}
|
|
2442
|
+
};
|
|
2443
|
+
function isLinkElement(node) {
|
|
2444
|
+
return ElementUtils.isInline(node) && node.type === InlineType.Link;
|
|
2445
|
+
}
|
|
2446
|
+
function isLinkEntry(inline) {
|
|
2447
|
+
return ElementUtils.isInline(inline[0]) && inline[0].type === InlineType.Link;
|
|
2448
|
+
}
|
|
2449
|
+
function unhangRange(editor, range) {
|
|
2450
|
+
let [start, end] = slate.Range.edges(range);
|
|
2451
|
+
if (start.offset !== 0 || end.offset !== 0 || slate.Range.isCollapsed(range)) {
|
|
2452
|
+
return range;
|
|
2453
|
+
}
|
|
2454
|
+
const endBlock = slate.Editor.above(editor, {
|
|
2455
|
+
at: end,
|
|
2456
|
+
match: (n) => slate.Element.isElement(n) && slate.Editor.isBlock(editor, n)
|
|
2457
|
+
});
|
|
2458
|
+
const blockPath = endBlock ? endBlock[1] : [];
|
|
2459
|
+
const first = slate.Editor.start(editor, start);
|
|
2460
|
+
const before = { anchor: first, focus: end };
|
|
2461
|
+
let skip = true;
|
|
2462
|
+
for (const [node, path] of slate.Editor.nodes(editor, {
|
|
2463
|
+
at: before,
|
|
2464
|
+
match: slate.Text.isText,
|
|
2465
|
+
reverse: true
|
|
2466
|
+
})) {
|
|
2467
|
+
if (skip) {
|
|
2468
|
+
skip = false;
|
|
2469
|
+
continue;
|
|
2470
|
+
}
|
|
2471
|
+
if (node.text !== "" || slate.Path.isBefore(path, blockPath)) {
|
|
2472
|
+
end = { path, offset: node.text.length };
|
|
2473
|
+
break;
|
|
2474
|
+
}
|
|
2475
|
+
}
|
|
2476
|
+
return { anchor: start, focus: end };
|
|
2477
|
+
}
|
|
2478
|
+
function is(x, y) {
|
|
2479
|
+
if (x === y)
|
|
2480
|
+
return x !== 0 || y !== 0 || 1 / x === 1 / y;
|
|
2481
|
+
return x !== x && y !== y;
|
|
2482
|
+
}
|
|
2483
|
+
const { hasOwnProperty: hasOwnProperty$1 } = Object.prototype;
|
|
2484
|
+
const shallowEqual = (a, b) => {
|
|
2485
|
+
if (is(a, b))
|
|
2486
|
+
return true;
|
|
2487
|
+
if (typeof a !== "object" || a === null || typeof b !== "object" || b === null)
|
|
2488
|
+
return false;
|
|
2489
|
+
const keysA = Object.keys(a);
|
|
2490
|
+
const keysB = Object.keys(b);
|
|
2491
|
+
if (keysA.length !== keysB.length)
|
|
2492
|
+
return false;
|
|
2493
|
+
for (let i = 0; i < keysA.length; i += 1) {
|
|
2494
|
+
if (!hasOwnProperty$1.call(b, keysA[i]) || !is(a[keysA[i]], b[keysA[i]]))
|
|
2495
|
+
return false;
|
|
2496
|
+
}
|
|
2497
|
+
return true;
|
|
2498
|
+
};
|
|
2499
|
+
function isNonNullable(value) {
|
|
2500
|
+
return value != null;
|
|
2501
|
+
}
|
|
2502
|
+
const { hasOwnProperty } = Object.prototype;
|
|
2503
|
+
const deepEqual = (a, b) => {
|
|
2504
|
+
if (shallowEqual(a, b))
|
|
2505
|
+
return true;
|
|
2506
|
+
if (typeof a !== "object" || a === null || typeof b !== "object" || b === null)
|
|
2507
|
+
return false;
|
|
2508
|
+
const keysA = Object.keys(a);
|
|
2509
|
+
const keysB = Object.keys(b);
|
|
2510
|
+
if (keysA.length !== keysB.length)
|
|
2511
|
+
return false;
|
|
2512
|
+
for (let i = 0; i < keysA.length; i += 1) {
|
|
2513
|
+
if (!hasOwnProperty.call(b, keysA[i]) || !deepEqual(a[keysA[i]], b[keysA[i]]))
|
|
2514
|
+
return false;
|
|
2515
|
+
}
|
|
2516
|
+
return true;
|
|
2517
|
+
};
|
|
2518
|
+
function getSelection(editor) {
|
|
2519
|
+
if (editor.selection)
|
|
2520
|
+
return unhangRange(editor, editor.selection);
|
|
2521
|
+
return {
|
|
2522
|
+
anchor: slate.Editor.start(editor, []),
|
|
2523
|
+
focus: slate.Editor.end(editor, [])
|
|
2524
|
+
};
|
|
2525
|
+
}
|
|
2526
|
+
function getBlocksInSelection(editor) {
|
|
2527
|
+
return Array.from(slate.Editor.nodes(editor, {
|
|
2528
|
+
at: getSelection(editor),
|
|
2529
|
+
match: (node) => ElementUtils.isRootBlock(node)
|
|
2530
|
+
})).filter((entry) => ElementUtils.isRootBlock(entry[0]));
|
|
2531
|
+
}
|
|
2532
|
+
function getActiveBlockType(editor) {
|
|
2533
|
+
var _a2;
|
|
2534
|
+
const rootBlocks = getBlocksInSelection(editor).map(([node]) => node.type);
|
|
2535
|
+
return rootBlocks.reduce((a, b) => a === b ? b : null, (_a2 = rootBlocks.at(0)) != null ? _a2 : null);
|
|
2536
|
+
}
|
|
2537
|
+
function unwrapInline(editor, type) {
|
|
2538
|
+
slate.Transforms.unwrapNodes(editor, {
|
|
2539
|
+
match: (node) => ElementUtils.isInline(node) && node.type === type,
|
|
2540
|
+
at: getSelection(editor)
|
|
2541
|
+
});
|
|
2542
|
+
}
|
|
2543
|
+
function wrapInline(editor, inline) {
|
|
2544
|
+
slate.Transforms.wrapNodes(editor, inline, {
|
|
2545
|
+
at: getSelection(editor),
|
|
2546
|
+
split: true
|
|
2547
|
+
});
|
|
2548
|
+
}
|
|
2549
|
+
function filterForSubtreeRoots(entries) {
|
|
2550
|
+
return entries.filter(([, nodePath]) => !slate.Path.ancestors(nodePath).some((ancestor) => {
|
|
2551
|
+
return entries.some(([, path]) => slate.Path.equals(path, ancestor));
|
|
2552
|
+
}));
|
|
2553
|
+
}
|
|
2554
|
+
function getLinksAndTextInSelection(editor) {
|
|
2555
|
+
return Array.from(slate.Editor.nodes(editor, {
|
|
2556
|
+
at: getSelection(editor),
|
|
2557
|
+
match: (node) => ElementUtils.isInline(node) && isLinkElement(node) || slate.Text.isText(node)
|
|
2558
|
+
}));
|
|
2559
|
+
}
|
|
2560
|
+
const getValue$3 = (editor) => {
|
|
2561
|
+
var _a2;
|
|
2562
|
+
const roots = filterForSubtreeRoots(getLinksAndTextInSelection(editor));
|
|
2563
|
+
const areAllRootsLinks = roots.every(([root]) => isLinkElement(root) || slate.Text.isText(root));
|
|
2564
|
+
if (!areAllRootsLinks)
|
|
2565
|
+
return void 0;
|
|
2566
|
+
const matchingValues = roots.map(([node]) => node).filter(isLinkElement);
|
|
2567
|
+
const match = matchingValues.reduce((a, b) => deepEqual(a == null ? void 0 : a.link, b == null ? void 0 : b.link) ? b : null, (_a2 = matchingValues.at(0)) != null ? _a2 : void 0);
|
|
2568
|
+
return match == null ? match : match.link;
|
|
2569
|
+
};
|
|
2570
|
+
const onChange$1 = (editor, value) => {
|
|
2571
|
+
if (value == null)
|
|
2572
|
+
return unwrapInline(editor, InlineType.Link);
|
|
2573
|
+
const roots = filterForSubtreeRoots(getLinksAndTextInSelection(editor));
|
|
2574
|
+
const root = roots.at(0);
|
|
2575
|
+
if (roots.length === 1 && root != null && isLinkEntry(root)) {
|
|
2576
|
+
slate.Transforms.setNodes(editor, {
|
|
2577
|
+
link: value
|
|
2578
|
+
}, { at: root[1] });
|
|
2579
|
+
} else {
|
|
2580
|
+
unwrapInline(editor, InlineType.Link);
|
|
2581
|
+
wrapInline(editor, { type: InlineType.Link, link: value, children: [] });
|
|
2582
|
+
}
|
|
2583
|
+
};
|
|
2584
|
+
function LinkPlugin() {
|
|
2585
|
+
return createRichTextV2Plugin({
|
|
2586
|
+
control: {
|
|
2587
|
+
definition: Link({
|
|
2588
|
+
label: "On Click"
|
|
2589
|
+
}),
|
|
2590
|
+
onChange: onChange$1,
|
|
2591
|
+
getValue: getValue$3,
|
|
2592
|
+
getElementValue: (element) => {
|
|
2593
|
+
return ElementUtils.isInline(element) && isLinkElement(element) ? element.link : void 0;
|
|
2594
|
+
}
|
|
2595
|
+
}
|
|
2596
|
+
});
|
|
2597
|
+
}
|
|
2598
|
+
const supportedInlineOptions = [
|
|
2599
|
+
{
|
|
2600
|
+
icon: unstable_IconRadioGroupIcon.Superscript,
|
|
2601
|
+
label: "Superscript",
|
|
2602
|
+
value: "superscript"
|
|
2603
|
+
},
|
|
2604
|
+
{
|
|
2605
|
+
icon: unstable_IconRadioGroupIcon.Subscript,
|
|
2606
|
+
label: "Subscript",
|
|
2607
|
+
value: "subscript"
|
|
2608
|
+
},
|
|
2609
|
+
{
|
|
2610
|
+
icon: unstable_IconRadioGroupIcon.Code,
|
|
2611
|
+
label: "Code",
|
|
2612
|
+
value: "code"
|
|
2613
|
+
}
|
|
2614
|
+
];
|
|
2615
|
+
function isSupportedInlineType(inline) {
|
|
2616
|
+
return supportedInlineOptions.findIndex((option) => option.value === inline) !== -1;
|
|
2617
|
+
}
|
|
2618
|
+
function isSupportedInlineEntry(entry) {
|
|
2619
|
+
const node = entry[0];
|
|
2620
|
+
return ElementUtils.isInline(node) && supportedInlineOptions.findIndex((option) => option.value === node.type) !== -1;
|
|
2621
|
+
}
|
|
2622
|
+
function getSupportedInlinesAndTextInSelection(editor) {
|
|
2623
|
+
return Array.from(slate.Editor.nodes(editor, {
|
|
2624
|
+
at: getSelection(editor),
|
|
2625
|
+
match: (node) => ElementUtils.isInline(node) && isSupportedInlineType(node.type) || slate.Text.isText(node)
|
|
2626
|
+
}));
|
|
2627
|
+
}
|
|
2628
|
+
const getValue$2 = (editor) => {
|
|
2629
|
+
var _a2;
|
|
2630
|
+
const roots = filterForSubtreeRoots(getSupportedInlinesAndTextInSelection(editor));
|
|
2631
|
+
const areAllRootsSupportedInlineTypesOrText = roots.every((entry) => isSupportedInlineEntry(entry) || slate.Text.isText(entry[0]));
|
|
2632
|
+
if (!areAllRootsSupportedInlineTypesOrText)
|
|
2633
|
+
return void 0;
|
|
2634
|
+
const matchingValues = roots.filter(isSupportedInlineEntry).map(([node]) => node);
|
|
2635
|
+
const match = matchingValues.reduce((a, b) => (a == null ? void 0 : a.type) === (b == null ? void 0 : b.type) ? b : null, (_a2 = matchingValues.at(0)) != null ? _a2 : void 0);
|
|
2636
|
+
return match == null ? match : match.type;
|
|
2637
|
+
};
|
|
2638
|
+
const onChange = (editor, value) => {
|
|
2639
|
+
function unwrapAllSupportedTypes() {
|
|
2640
|
+
supportedInlineOptions.forEach(({ value: optionValue }) => unwrapInline(editor, optionValue));
|
|
2641
|
+
}
|
|
2642
|
+
function unwrapAllInlines() {
|
|
2643
|
+
slate.Transforms.unwrapNodes(editor, {
|
|
2644
|
+
match: (node) => ElementUtils.isInline(node),
|
|
2645
|
+
at: getSelection(editor)
|
|
2646
|
+
});
|
|
2647
|
+
}
|
|
2648
|
+
if (value == null)
|
|
2649
|
+
return unwrapAllSupportedTypes();
|
|
2650
|
+
if (!isSupportedInlineType(value))
|
|
2651
|
+
return;
|
|
2652
|
+
const roots = filterForSubtreeRoots(getSupportedInlinesAndTextInSelection(editor));
|
|
2653
|
+
const root = roots.at(0);
|
|
2654
|
+
if (roots.length === 1 && root != null && isSupportedInlineEntry(root) && root[0].type === value) {
|
|
2655
|
+
unwrapInline(editor, value);
|
|
2656
|
+
} else {
|
|
2657
|
+
unwrapAllInlines();
|
|
2658
|
+
wrapInline(editor, { type: value, children: [] });
|
|
2659
|
+
}
|
|
2660
|
+
};
|
|
2661
|
+
const withInline = (editor) => {
|
|
2662
|
+
const {
|
|
2663
|
+
isInline
|
|
2664
|
+
} = editor;
|
|
2665
|
+
editor.isInline = (entry) => {
|
|
2666
|
+
return ElementUtils.isInline(entry) && isInline(entry);
|
|
2667
|
+
};
|
|
2668
|
+
return editor;
|
|
2669
|
+
};
|
|
2670
|
+
function InlinePlugin() {
|
|
2671
|
+
return createRichTextV2Plugin({
|
|
2672
|
+
control: {
|
|
2673
|
+
definition: unstable_IconRadioGroup({
|
|
2674
|
+
label: "Inline",
|
|
2675
|
+
options: supportedInlineOptions
|
|
2676
|
+
}),
|
|
2677
|
+
onChange,
|
|
2678
|
+
getValue: getValue$2,
|
|
2679
|
+
getElementValue: (element) => {
|
|
2680
|
+
return ElementUtils.isInline(element) ? element.type : void 0;
|
|
2681
|
+
}
|
|
2682
|
+
},
|
|
2683
|
+
withPlugin: withInline,
|
|
2684
|
+
renderElement: (renderElement) => (props) => {
|
|
2685
|
+
return /* @__PURE__ */ jsxRuntime.jsx(InlinePluginComponent, __spreadProps(__spreadValues({}, props), {
|
|
2686
|
+
renderElement
|
|
2687
|
+
}));
|
|
2688
|
+
}
|
|
2689
|
+
});
|
|
2690
|
+
}
|
|
2691
|
+
function InlinePluginComponent(_b) {
|
|
2692
|
+
var _c = _b, {
|
|
2693
|
+
renderElement
|
|
2694
|
+
} = _c, props = __objRest(_c, [
|
|
2695
|
+
"renderElement"
|
|
2696
|
+
]);
|
|
2697
|
+
switch (props.element.type) {
|
|
2698
|
+
case InlineType.Code:
|
|
2699
|
+
return /* @__PURE__ */ jsxRuntime.jsx("code", __spreadProps(__spreadValues({}, props.attributes), {
|
|
2700
|
+
children: renderElement(props)
|
|
2701
|
+
}));
|
|
2702
|
+
case InlineType.SuperScript:
|
|
2703
|
+
return /* @__PURE__ */ jsxRuntime.jsx("sup", __spreadProps(__spreadValues({}, props.attributes), {
|
|
2704
|
+
children: renderElement(props)
|
|
2705
|
+
}));
|
|
2706
|
+
case InlineType.SubScript:
|
|
2707
|
+
return /* @__PURE__ */ jsxRuntime.jsx("sub", __spreadProps(__spreadValues({}, props.attributes), {
|
|
2708
|
+
children: renderElement(props)
|
|
2709
|
+
}));
|
|
2710
|
+
default:
|
|
2711
|
+
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
2712
|
+
children: renderElement(props)
|
|
2713
|
+
});
|
|
2714
|
+
}
|
|
2715
|
+
}
|
|
2716
|
+
function setResponsiveValue(editor, key, value, options) {
|
|
2717
|
+
slate.Editor.withoutNormalizing(editor, () => {
|
|
2718
|
+
const at = getSelection(editor);
|
|
2719
|
+
if (!at)
|
|
2720
|
+
return;
|
|
2721
|
+
const atRef = slate.Editor.rangeRef(editor, at);
|
|
2722
|
+
if (atRef.current) {
|
|
2723
|
+
slate.Transforms.setNodes(editor, {
|
|
2724
|
+
slice: true
|
|
2725
|
+
}, {
|
|
2726
|
+
at: atRef.current,
|
|
2727
|
+
match: options.match,
|
|
2728
|
+
split: options.split
|
|
2729
|
+
});
|
|
2730
|
+
}
|
|
2731
|
+
if (atRef.current) {
|
|
2732
|
+
const nodesToUpdate = Array.from(slate.Editor.nodes(editor, {
|
|
2733
|
+
at: atRef.current,
|
|
2734
|
+
match: (node, path) => options.match(node, path) && node.slice === true
|
|
2735
|
+
}));
|
|
2736
|
+
for (const [, path] of nodesToUpdate) {
|
|
2737
|
+
slate.Transforms.setNodes(editor, {
|
|
2738
|
+
[key]: value
|
|
2739
|
+
}, { at: path });
|
|
2740
|
+
}
|
|
2741
|
+
}
|
|
2742
|
+
atRef.unref();
|
|
2743
|
+
});
|
|
2744
|
+
}
|
|
2745
|
+
function normalizeResponsiveValue(editor, key, options) {
|
|
2746
|
+
return (entry) => {
|
|
2747
|
+
const [node, path] = entry;
|
|
2748
|
+
if (!options.match(node, path)) {
|
|
2749
|
+
return false;
|
|
2750
|
+
}
|
|
2751
|
+
const responsiveValue = node == null ? void 0 : node[key];
|
|
2752
|
+
if (Array.isArray(responsiveValue) && responsiveValue.length === 0) {
|
|
2753
|
+
slate.Transforms.unsetNodes(editor, key, { at: path });
|
|
2754
|
+
return true;
|
|
2755
|
+
}
|
|
2756
|
+
if ((node == null ? void 0 : node.slice) != null) {
|
|
2757
|
+
slate.Transforms.unsetNodes(editor, "slice", { at: path });
|
|
2758
|
+
return true;
|
|
2759
|
+
}
|
|
2760
|
+
return false;
|
|
2761
|
+
};
|
|
2762
|
+
}
|
|
2763
|
+
function responsiveShallowEqual(a = [], b = []) {
|
|
2764
|
+
const aObject = a.reduce((acc, curr) => __spreadProps(__spreadValues({}, acc), {
|
|
2765
|
+
[curr.deviceId]: curr.value
|
|
2766
|
+
}), {});
|
|
2767
|
+
const bObject = b.reduce((acc, curr) => __spreadProps(__spreadValues({}, acc), {
|
|
2768
|
+
[curr.deviceId]: curr.value
|
|
2769
|
+
}), {});
|
|
2770
|
+
const definedDevices = /* @__PURE__ */ new Set([...a.map((a2) => a2.deviceId), ...b.map((b2) => b2.deviceId)]);
|
|
2771
|
+
return Array.from(definedDevices).map((deviceId) => {
|
|
2772
|
+
const aVal = aObject[deviceId];
|
|
2773
|
+
const bVal = bObject[deviceId];
|
|
2774
|
+
if (aVal === void 0 && bVal === void 0)
|
|
2775
|
+
return { deviceId, value: void 0 };
|
|
2776
|
+
return shallowEqual(aVal, bVal) ? { deviceId, value: aVal } : { deviceId, value: null };
|
|
2777
|
+
});
|
|
2778
|
+
}
|
|
2779
|
+
function getValue$1(editor) {
|
|
2780
|
+
const matchingValues = Array.from(slate.Editor.nodes(editor, {
|
|
2781
|
+
at: getSelection(editor),
|
|
2782
|
+
match: ElementUtils.isRootBlock
|
|
2783
|
+
})).map(([node]) => node["textAlign"]);
|
|
2784
|
+
return matchingValues.length === 0 ? void 0 : matchingValues.reduce((a, b) => {
|
|
2785
|
+
return responsiveShallowEqual(a, b);
|
|
2786
|
+
});
|
|
2787
|
+
}
|
|
2788
|
+
const TEXT_ALIGN_KEY = "textAlign";
|
|
2789
|
+
const withTextAlign = (editor) => {
|
|
2790
|
+
const {
|
|
2791
|
+
normalizeNode
|
|
2792
|
+
} = editor;
|
|
2793
|
+
editor.normalizeNode = (entry) => {
|
|
2794
|
+
if (normalizeResponsiveValue(editor, TEXT_ALIGN_KEY, {
|
|
2795
|
+
match: ElementUtils.isRootBlock
|
|
2796
|
+
})(entry)) {
|
|
2797
|
+
return;
|
|
2798
|
+
}
|
|
2799
|
+
normalizeNode(entry);
|
|
2800
|
+
};
|
|
2801
|
+
return editor;
|
|
2802
|
+
};
|
|
2803
|
+
function TextAlignPlugin() {
|
|
2804
|
+
return createRichTextV2Plugin({
|
|
2805
|
+
control: {
|
|
2806
|
+
definition: unstable_StyleV2({
|
|
2807
|
+
type: unstable_IconRadioGroup({
|
|
2808
|
+
label: "Alignment",
|
|
2809
|
+
options: [{
|
|
2810
|
+
icon: unstable_IconRadioGroupIcon.TextAlignLeft,
|
|
2811
|
+
label: "Left Align",
|
|
2812
|
+
value: "left"
|
|
2813
|
+
}, {
|
|
2814
|
+
icon: unstable_IconRadioGroupIcon.TextAlignCenter,
|
|
2815
|
+
label: "Center Align",
|
|
2816
|
+
value: "center"
|
|
2817
|
+
}, {
|
|
2818
|
+
icon: unstable_IconRadioGroupIcon.TextAlignRight,
|
|
2819
|
+
label: "Right Align",
|
|
2820
|
+
value: "right"
|
|
2821
|
+
}, {
|
|
2822
|
+
icon: unstable_IconRadioGroupIcon.TextAlignJustify,
|
|
2823
|
+
label: "Justify",
|
|
2824
|
+
value: "justify"
|
|
2825
|
+
}],
|
|
2826
|
+
defaultValue: "left"
|
|
2827
|
+
}),
|
|
2828
|
+
getStyle(textAlign) {
|
|
2829
|
+
return {
|
|
2830
|
+
textAlign
|
|
2831
|
+
};
|
|
2832
|
+
}
|
|
2833
|
+
}),
|
|
2834
|
+
onChange: (editor, value) => setResponsiveValue(editor, TEXT_ALIGN_KEY, value, {
|
|
2835
|
+
match: ElementUtils.isRootBlock,
|
|
2836
|
+
split: false
|
|
2837
|
+
}),
|
|
2838
|
+
getValue: (editor) => getValue$1(editor),
|
|
2839
|
+
getElementValue: (element) => {
|
|
2840
|
+
return ElementUtils.isRootBlock(element) ? element.textAlign : void 0;
|
|
2841
|
+
}
|
|
2842
|
+
},
|
|
2843
|
+
withPlugin: withTextAlign,
|
|
2844
|
+
renderElement: (renderElement, className) => (props) => {
|
|
2845
|
+
return renderElement(__spreadProps(__spreadValues({}, props), {
|
|
2846
|
+
element: __spreadProps(__spreadValues({}, props.element), {
|
|
2847
|
+
className
|
|
2848
|
+
})
|
|
2849
|
+
}));
|
|
2850
|
+
}
|
|
2851
|
+
});
|
|
2852
|
+
}
|
|
2853
|
+
function setBlockKeyForDevice(editor, breakpoints, deviceId, key, value, options) {
|
|
2854
|
+
var _a2, _b;
|
|
2855
|
+
const at = (_a2 = options == null ? void 0 : options.at) != null ? _a2 : editor.selection;
|
|
2856
|
+
if (!at)
|
|
2857
|
+
return;
|
|
2858
|
+
const rootElements = getBlocksInSelection(editor);
|
|
2859
|
+
for (const [node, path] of rootElements) {
|
|
2860
|
+
if (ElementUtils.isBlock(node)) {
|
|
2861
|
+
const deviceValues = (_b = node[key]) != null ? _b : [];
|
|
2862
|
+
const currentDeviceValue = state_breakpoints.findBreakpointOverride(breakpoints, deviceValues, deviceId, (v) => v);
|
|
2863
|
+
const nextDeviceValue = __spreadProps(__spreadValues({}, currentDeviceValue), {
|
|
2864
|
+
deviceId,
|
|
2865
|
+
value
|
|
2866
|
+
});
|
|
2867
|
+
slate.Transforms.setNodes(editor, {
|
|
2868
|
+
[key]: [...deviceValues.filter((v) => v.deviceId !== deviceId), nextDeviceValue]
|
|
2869
|
+
}, { at: path });
|
|
2870
|
+
}
|
|
2871
|
+
}
|
|
2872
|
+
}
|
|
2873
|
+
function clearBlockKeyForDevice(editor, deviceId, key) {
|
|
2874
|
+
var _a2;
|
|
2875
|
+
const rootElements = getBlocksInSelection(editor);
|
|
2876
|
+
for (const [node, path] of rootElements) {
|
|
2877
|
+
if (ElementUtils.isBlock(node)) {
|
|
2878
|
+
const deviceOverrides = (_a2 = node[key]) != null ? _a2 : [];
|
|
2879
|
+
slate.Transforms.setNodes(editor, {
|
|
2880
|
+
[key]: deviceOverrides.filter((v) => v.deviceId !== deviceId)
|
|
2881
|
+
}, { at: path });
|
|
2882
|
+
}
|
|
2883
|
+
}
|
|
2884
|
+
}
|
|
2885
|
+
const EditorUtils = {
|
|
2886
|
+
getFirstAncestorList(editor, path) {
|
|
2887
|
+
try {
|
|
2888
|
+
const parentList = slate.Editor.above(editor, {
|
|
2889
|
+
at: path,
|
|
2890
|
+
match: (node) => ElementUtils.isList(node)
|
|
2891
|
+
});
|
|
2892
|
+
return parentList != null ? parentList : null;
|
|
2893
|
+
} catch (e) {
|
|
2894
|
+
return null;
|
|
2895
|
+
}
|
|
2896
|
+
},
|
|
2897
|
+
getFirstAncestorListItem(editor, path) {
|
|
2898
|
+
try {
|
|
2899
|
+
const parentListItem = slate.Editor.above(editor, {
|
|
2900
|
+
at: path,
|
|
2901
|
+
match: (node) => ElementUtils.isListItem(node)
|
|
2902
|
+
});
|
|
2903
|
+
return parentListItem != null ? parentListItem : null;
|
|
2904
|
+
} catch (e) {
|
|
2905
|
+
return null;
|
|
2906
|
+
}
|
|
2907
|
+
}
|
|
2908
|
+
};
|
|
2909
|
+
const LIST_ITEM_CHILD_POSITION = 0;
|
|
2910
|
+
const LIST_ITEM_LIST_POSITION = 1;
|
|
2911
|
+
function unwrapPath(editor, listItemPath) {
|
|
2912
|
+
const parentList = EditorUtils.getFirstAncestorList(editor, listItemPath);
|
|
2913
|
+
const listItemContainingParentList = EditorUtils.getFirstAncestorListItem(editor, listItemPath);
|
|
2914
|
+
if (!parentList || listItemContainingParentList)
|
|
2915
|
+
return;
|
|
2916
|
+
slate.Editor.withoutNormalizing(editor, () => {
|
|
2917
|
+
const listItemTextPath = [...listItemPath, LIST_ITEM_CHILD_POSITION];
|
|
2918
|
+
const listItemNestedListPath = [...listItemPath, LIST_ITEM_LIST_POSITION];
|
|
2919
|
+
if (slate.Node.has(editor, listItemNestedListPath)) {
|
|
2920
|
+
slate.Transforms.setNodes(editor, { type: parentList[0].type }, { at: listItemNestedListPath });
|
|
2921
|
+
slate.Transforms.liftNodes(editor, { at: listItemNestedListPath });
|
|
2922
|
+
slate.Transforms.liftNodes(editor, { at: slate.Path.next(listItemPath) });
|
|
2923
|
+
}
|
|
2924
|
+
if (slate.Node.has(editor, listItemTextPath)) {
|
|
2925
|
+
slate.Transforms.setNodes(editor, { type: BlockType.Paragraph }, {
|
|
2926
|
+
at: listItemTextPath
|
|
2927
|
+
});
|
|
2928
|
+
slate.Transforms.liftNodes(editor, { at: listItemTextPath });
|
|
2929
|
+
slate.Transforms.liftNodes(editor, { at: listItemPath });
|
|
2930
|
+
}
|
|
2931
|
+
});
|
|
2932
|
+
}
|
|
2933
|
+
function unwrapList(editor, options) {
|
|
2934
|
+
var _a2;
|
|
2935
|
+
const at = (_a2 = options == null ? void 0 : options.at) != null ? _a2 : editor.selection;
|
|
2936
|
+
if (!at)
|
|
2937
|
+
return;
|
|
2938
|
+
const listItems = Array.from(slate.Editor.nodes(editor, {
|
|
2939
|
+
at,
|
|
2940
|
+
match: (node) => {
|
|
2941
|
+
return slate.Element.isElement(node) && ElementUtils.isListItem(node);
|
|
2942
|
+
}
|
|
2943
|
+
}));
|
|
2944
|
+
const subRoots = filterForSubtreeRoots(listItems);
|
|
2945
|
+
const refs = subRoots.map(([_, path]) => slate.Editor.pathRef(editor, path));
|
|
2946
|
+
refs.forEach((ref) => {
|
|
2947
|
+
if (ref.current) {
|
|
2948
|
+
unwrapPath(editor, ref.current);
|
|
2949
|
+
}
|
|
2950
|
+
ref.unref();
|
|
2951
|
+
});
|
|
2952
|
+
}
|
|
2953
|
+
function wrapList(editor, options = { type: BlockType.UnorderedList }) {
|
|
2954
|
+
var _a2;
|
|
2955
|
+
const at = (_a2 = options.at) != null ? _a2 : editor.selection;
|
|
2956
|
+
if (!at)
|
|
2957
|
+
return;
|
|
2958
|
+
const nonListEntries = Array.from(slate.Editor.nodes(editor, {
|
|
2959
|
+
at,
|
|
2960
|
+
match: (node) => {
|
|
2961
|
+
return slate.Element.isElement(node) && ElementUtils.isConvertibleToListTextNode(node);
|
|
2962
|
+
}
|
|
2963
|
+
}));
|
|
2964
|
+
const refs = nonListEntries.map(([_, path]) => slate.Editor.pathRef(editor, path));
|
|
2965
|
+
refs.forEach((ref) => {
|
|
2966
|
+
const path = ref.current;
|
|
2967
|
+
if (path) {
|
|
2968
|
+
slate.Editor.withoutNormalizing(editor, () => {
|
|
2969
|
+
slate.Transforms.setNodes(editor, { type: BlockType.ListItemChild }, {
|
|
2970
|
+
at: path
|
|
2971
|
+
});
|
|
2972
|
+
slate.Transforms.wrapNodes(editor, ElementUtils.createListItem(), {
|
|
2973
|
+
match: (node) => ElementUtils.isListItemChild(node),
|
|
2974
|
+
at: path
|
|
2975
|
+
});
|
|
2976
|
+
slate.Transforms.wrapNodes(editor, ElementUtils.createList(options.type), {
|
|
2977
|
+
at: path
|
|
2978
|
+
});
|
|
2979
|
+
});
|
|
2980
|
+
}
|
|
2981
|
+
ref.unref();
|
|
2982
|
+
});
|
|
2983
|
+
}
|
|
2984
|
+
const LocationUtils = {
|
|
2985
|
+
getStartPath(location) {
|
|
2986
|
+
if (slate.Range.isRange(location))
|
|
2987
|
+
return slate.Range.start(location).path;
|
|
2988
|
+
if (slate.Point.isPoint(location))
|
|
2989
|
+
return location.path;
|
|
2990
|
+
return location;
|
|
2991
|
+
}
|
|
2992
|
+
};
|
|
2993
|
+
function getSelectedListItems(editor) {
|
|
2994
|
+
var _a2, _b;
|
|
2995
|
+
if (!editor.selection)
|
|
2996
|
+
return [];
|
|
2997
|
+
const start = LocationUtils.getStartPath(editor.selection);
|
|
2998
|
+
const listItems = slate.Editor.nodes(editor, {
|
|
2999
|
+
at: editor.selection,
|
|
3000
|
+
match: (node) => ElementUtils.isListItem(node)
|
|
3001
|
+
});
|
|
3002
|
+
const firstAncestorPath = (_b = (_a2 = EditorUtils.getFirstAncestorListItem(editor, start)) == null ? void 0 : _a2[1]) != null ? _b : [];
|
|
3003
|
+
return Array.from(listItems).filter((node) => slate.Path.isDescendant(start, node[1]) ? slate.Path.equals(node[1], firstAncestorPath) : !slate.Path.isAfter(start, node[1]));
|
|
3004
|
+
}
|
|
3005
|
+
function indentPath(editor, path) {
|
|
3006
|
+
const parent = slate.Node.parent(editor, path);
|
|
3007
|
+
if (!path || !slate.Path.hasPrevious(path) || !ElementUtils.isList(parent))
|
|
3008
|
+
return;
|
|
3009
|
+
const previosPath = slate.Path.previous(path);
|
|
3010
|
+
const previousChildListPath = [...previosPath, LIST_ITEM_LIST_POSITION];
|
|
3011
|
+
const previousHasChildList = slate.Node.has(editor, previousChildListPath);
|
|
3012
|
+
slate.Editor.withoutNormalizing(editor, () => {
|
|
3013
|
+
if (!previousHasChildList) {
|
|
3014
|
+
slate.Transforms.insertNodes(editor, ElementUtils.createList(parent.type), {
|
|
3015
|
+
at: previousChildListPath
|
|
3016
|
+
});
|
|
3017
|
+
}
|
|
3018
|
+
const previousChildList = slate.Node.get(editor, previousChildListPath);
|
|
3019
|
+
if (ElementUtils.isList(previousChildList)) {
|
|
3020
|
+
const index = previousHasChildList ? previousChildList.children.length : 0;
|
|
3021
|
+
slate.Transforms.moveNodes(editor, {
|
|
3022
|
+
at: path,
|
|
3023
|
+
to: [...previousChildListPath, index]
|
|
3024
|
+
});
|
|
3025
|
+
}
|
|
3026
|
+
});
|
|
3027
|
+
}
|
|
3028
|
+
function indent(editor) {
|
|
3029
|
+
if (!editor.selection)
|
|
3030
|
+
return;
|
|
3031
|
+
const listItems = getSelectedListItems(editor);
|
|
3032
|
+
const subRoots = filterForSubtreeRoots(listItems);
|
|
3033
|
+
const refs = subRoots.map(([_, path]) => slate.Editor.pathRef(editor, path));
|
|
3034
|
+
refs.forEach((ref) => {
|
|
3035
|
+
if (ref.current) {
|
|
3036
|
+
indentPath(editor, ref.current);
|
|
3037
|
+
}
|
|
3038
|
+
ref.unref();
|
|
3039
|
+
});
|
|
3040
|
+
}
|
|
3041
|
+
function dedentPath(editor, listItemPath) {
|
|
3042
|
+
const parentList = EditorUtils.getFirstAncestorList(editor, listItemPath);
|
|
3043
|
+
const listItemContainingParentList = EditorUtils.getFirstAncestorListItem(editor, listItemPath);
|
|
3044
|
+
if (!parentList || !listItemContainingParentList)
|
|
3045
|
+
return;
|
|
3046
|
+
const [parentListNode, parentListPath] = parentList;
|
|
3047
|
+
const [_, listItemContainingParentListPath] = listItemContainingParentList;
|
|
3048
|
+
const listItemPosition = listItemPath[listItemPath.length - 1];
|
|
3049
|
+
const previousSiblings = parentListNode.children.slice(0, listItemPosition);
|
|
3050
|
+
const nextSiblings = parentListNode.children.slice(listItemPosition + 1);
|
|
3051
|
+
slate.Editor.withoutNormalizing(editor, () => {
|
|
3052
|
+
nextSiblings.forEach(() => {
|
|
3053
|
+
const nextSiblingPath = [...parentListPath, listItemPosition + 1];
|
|
3054
|
+
indentPath(editor, nextSiblingPath);
|
|
3055
|
+
});
|
|
3056
|
+
slate.Transforms.moveNodes(editor, {
|
|
3057
|
+
at: listItemPath,
|
|
3058
|
+
to: slate.Path.next(listItemContainingParentListPath)
|
|
3059
|
+
});
|
|
3060
|
+
if (previousSiblings.length === 0) {
|
|
3061
|
+
slate.Transforms.removeNodes(editor, { at: parentListPath });
|
|
3062
|
+
}
|
|
3063
|
+
});
|
|
3064
|
+
}
|
|
3065
|
+
function dedent(editor) {
|
|
3066
|
+
if (!editor.selection)
|
|
3067
|
+
return;
|
|
3068
|
+
const listItems = getSelectedListItems(editor);
|
|
3069
|
+
const subRoots = filterForSubtreeRoots(listItems);
|
|
3070
|
+
const refs = subRoots.map(([_, path]) => slate.Editor.pathRef(editor, path));
|
|
3071
|
+
refs.forEach((ref) => {
|
|
3072
|
+
if (ref.current) {
|
|
3073
|
+
dedentPath(editor, ref.current);
|
|
3074
|
+
}
|
|
3075
|
+
ref.unref();
|
|
3076
|
+
});
|
|
3077
|
+
}
|
|
3078
|
+
function toggleList(editor, options = { type: BlockType.UnorderedList }) {
|
|
3079
|
+
var _a2;
|
|
3080
|
+
const at = (_a2 = options.at) != null ? _a2 : editor.selection;
|
|
3081
|
+
if (at == null)
|
|
3082
|
+
return;
|
|
3083
|
+
const start = LocationUtils.getStartPath(at);
|
|
3084
|
+
const ancestorPath = slate.Path.ancestors(start).at(1);
|
|
3085
|
+
if (!ancestorPath || !slate.Node.has(editor, ancestorPath))
|
|
3086
|
+
return;
|
|
3087
|
+
const ancestor = slate.Node.get(editor, ancestorPath);
|
|
3088
|
+
if (!ElementUtils.isList(ancestor)) {
|
|
3089
|
+
return wrapList(editor, { type: options.type, at });
|
|
3090
|
+
}
|
|
3091
|
+
if (ancestor.type === options.type) {
|
|
3092
|
+
unwrapList(editor, { at });
|
|
3093
|
+
} else {
|
|
3094
|
+
slate.Transforms.setNodes(editor, { type: options.type }, { at: ancestorPath });
|
|
3095
|
+
}
|
|
3096
|
+
}
|
|
3097
|
+
const BlockActions = {
|
|
3098
|
+
setBlockKeyForDevice,
|
|
3099
|
+
clearBlockKeyForDevice,
|
|
3100
|
+
wrapInline,
|
|
3101
|
+
unwrapInline
|
|
3102
|
+
};
|
|
3103
|
+
const ListActions = {
|
|
3104
|
+
unwrapList,
|
|
3105
|
+
wrapList,
|
|
3106
|
+
indent,
|
|
3107
|
+
dedent,
|
|
3108
|
+
toggleList
|
|
3109
|
+
};
|
|
3110
|
+
function onKeyDown(e, editor) {
|
|
3111
|
+
if (!editor.selection || Array.from(slate.Editor.nodes(editor, {
|
|
3112
|
+
match: (node) => ElementUtils.isListItem(node)
|
|
3113
|
+
})).length === 0)
|
|
3114
|
+
return;
|
|
3115
|
+
if (isHotkey__default["default"]("shift+tab", e)) {
|
|
3116
|
+
e.preventDefault();
|
|
3117
|
+
ListActions.dedent(editor);
|
|
3118
|
+
}
|
|
3119
|
+
if (isHotkey__default["default"]("tab", e)) {
|
|
3120
|
+
e.preventDefault();
|
|
3121
|
+
ListActions.indent(editor);
|
|
3122
|
+
}
|
|
3123
|
+
if (isHotkey__default["default"]("backspace", e)) {
|
|
3124
|
+
if (!editor.selection)
|
|
3125
|
+
return;
|
|
3126
|
+
if (slate.Range.isExpanded(editor.selection))
|
|
3127
|
+
return;
|
|
3128
|
+
const listItem = EditorUtils.getFirstAncestorListItem(editor, editor.selection.anchor.path);
|
|
3129
|
+
if (editor.selection.anchor.offset === 0 && listItem) {
|
|
3130
|
+
e.preventDefault();
|
|
3131
|
+
const parentListItem = EditorUtils.getFirstAncestorListItem(editor, listItem[1]);
|
|
3132
|
+
const list = EditorUtils.getFirstAncestorList(editor, listItem[1]);
|
|
3133
|
+
if (parentListItem) {
|
|
3134
|
+
ListActions.dedent(editor);
|
|
3135
|
+
} else if (list) {
|
|
3136
|
+
ListActions.unwrapList(editor);
|
|
3137
|
+
}
|
|
3138
|
+
return;
|
|
3139
|
+
}
|
|
3140
|
+
}
|
|
3141
|
+
if (isHotkey__default["default"]("enter", e)) {
|
|
3142
|
+
e.preventDefault();
|
|
3143
|
+
if (!editor.selection)
|
|
3144
|
+
return;
|
|
3145
|
+
if (slate.Range.isExpanded(editor.selection)) {
|
|
3146
|
+
slate.Transforms.delete(editor);
|
|
3147
|
+
return;
|
|
3148
|
+
}
|
|
3149
|
+
const listItem = EditorUtils.getFirstAncestorListItem(editor, editor.selection.anchor.path);
|
|
3150
|
+
if (editor.selection.anchor.offset === 0 && listItem && slate.Editor.string(editor, listItem[1]) === "") {
|
|
3151
|
+
const parentListItem = EditorUtils.getFirstAncestorListItem(editor, listItem[1]);
|
|
3152
|
+
if (parentListItem) {
|
|
3153
|
+
ListActions.dedent(editor);
|
|
3154
|
+
} else {
|
|
3155
|
+
ListActions.unwrapList(editor);
|
|
3156
|
+
}
|
|
3157
|
+
return;
|
|
3158
|
+
}
|
|
3159
|
+
slate.Transforms.splitNodes(editor, {
|
|
3160
|
+
at: editor.selection,
|
|
3161
|
+
always: true,
|
|
3162
|
+
match: (node) => ElementUtils.isListItem(node)
|
|
3163
|
+
});
|
|
3164
|
+
}
|
|
3165
|
+
if (isHotkey__default["default"]("shift+enter", e)) {
|
|
3166
|
+
e.preventDefault();
|
|
3167
|
+
editor.insertText("\n");
|
|
3168
|
+
}
|
|
3169
|
+
}
|
|
3170
|
+
function withBlock(editor) {
|
|
3171
|
+
const {
|
|
3172
|
+
normalizeNode
|
|
3173
|
+
} = editor;
|
|
3174
|
+
editor.isInline = (entry) => {
|
|
3175
|
+
return ElementUtils.isInline(entry);
|
|
3176
|
+
};
|
|
3177
|
+
editor.normalizeNode = (entry) => {
|
|
3178
|
+
var _a2;
|
|
3179
|
+
const [normalizationNode, normalizationPath] = entry;
|
|
3180
|
+
if (ElementUtils.isBlock(normalizationNode) && ((_a2 = normalizationNode == null ? void 0 : normalizationNode.textAlign) == null ? void 0 : _a2.length) == 0) {
|
|
3181
|
+
slate.Transforms.unsetNodes(editor, "textAlign", {
|
|
3182
|
+
at: normalizationPath
|
|
3183
|
+
});
|
|
3184
|
+
return;
|
|
3185
|
+
}
|
|
3186
|
+
if (ElementUtils.isListItem(normalizationNode)) {
|
|
3187
|
+
const pathToListItemText = [...normalizationPath, LIST_ITEM_CHILD_POSITION];
|
|
3188
|
+
if (slate.Node.has(editor, pathToListItemText)) {
|
|
3189
|
+
const nodeInListItemTextPosition = slate.Node.get(editor, pathToListItemText);
|
|
3190
|
+
if (ElementUtils.isRootBlock(nodeInListItemTextPosition)) {
|
|
3191
|
+
slate.Transforms.setNodes(editor, {
|
|
3192
|
+
type: BlockType.ListItemChild
|
|
3193
|
+
}, {
|
|
3194
|
+
at: pathToListItemText
|
|
3195
|
+
});
|
|
3196
|
+
return;
|
|
3197
|
+
}
|
|
3198
|
+
} else {
|
|
3199
|
+
slate.Transforms.insertNodes(editor, ElementUtils.createListItem(), {
|
|
3200
|
+
at: pathToListItemText
|
|
3201
|
+
});
|
|
3202
|
+
return;
|
|
3203
|
+
}
|
|
3204
|
+
}
|
|
3205
|
+
if (!slate.Text.isText(normalizationNode)) {
|
|
3206
|
+
const mergeableChildren = Array.from(slate.Node.children(editor, normalizationPath)).map((child, index, children) => {
|
|
3207
|
+
const potentialNodeToBeMerged = children.at(index + 1);
|
|
3208
|
+
if (!potentialNodeToBeMerged || !ElementUtils.isList(potentialNodeToBeMerged[0]) || !ElementUtils.isList(child[0]) || potentialNodeToBeMerged[0].type !== child[0].type) {
|
|
3209
|
+
return null;
|
|
3210
|
+
}
|
|
3211
|
+
return [slate.Editor.pathRef(editor, child[1]), slate.Editor.pathRef(editor, potentialNodeToBeMerged[1])];
|
|
3212
|
+
}).filter((mergeableNodes) => Boolean(mergeableNodes));
|
|
3213
|
+
if (mergeableChildren.length !== 0) {
|
|
3214
|
+
mergeableChildren.reverse().forEach(([nodePathRef, nodeToBeMergedPathRef]) => {
|
|
3215
|
+
const nodePath = nodePathRef.current;
|
|
3216
|
+
const nodeToBeMergedPath = nodeToBeMergedPathRef.current;
|
|
3217
|
+
if (nodePath == null || nodeToBeMergedPath == null)
|
|
3218
|
+
return;
|
|
3219
|
+
const nodeChildren = Array.from(slate.Node.children(editor, nodePath));
|
|
3220
|
+
const childrenToBeMerged = Array.from(slate.Node.children(editor, nodeToBeMergedPath));
|
|
3221
|
+
slate.Editor.withoutNormalizing(editor, () => {
|
|
3222
|
+
childrenToBeMerged.reverse().forEach(([_, childPath]) => {
|
|
3223
|
+
slate.Transforms.moveNodes(editor, {
|
|
3224
|
+
at: childPath,
|
|
3225
|
+
to: [...nodePath, nodeChildren.length]
|
|
3226
|
+
});
|
|
3227
|
+
});
|
|
3228
|
+
slate.Transforms.removeNodes(editor, {
|
|
3229
|
+
at: nodeToBeMergedPath
|
|
3230
|
+
});
|
|
3231
|
+
});
|
|
3232
|
+
nodePathRef.unref();
|
|
3233
|
+
nodeToBeMergedPathRef.unref();
|
|
3234
|
+
});
|
|
3235
|
+
return;
|
|
3236
|
+
}
|
|
3237
|
+
}
|
|
3238
|
+
normalizeNode(entry);
|
|
3239
|
+
};
|
|
3240
|
+
return editor;
|
|
3241
|
+
}
|
|
3242
|
+
const definition = Select({
|
|
3243
|
+
label: "Block",
|
|
3244
|
+
labelOrientation: "horizontal",
|
|
3245
|
+
options: [{
|
|
3246
|
+
value: BlockType.Paragraph,
|
|
3247
|
+
label: "Paragraph"
|
|
3248
|
+
}, {
|
|
3249
|
+
value: BlockType.Heading1,
|
|
3250
|
+
label: "Heading 1"
|
|
3251
|
+
}, {
|
|
3252
|
+
value: BlockType.Heading2,
|
|
3253
|
+
label: "Heading 2"
|
|
3254
|
+
}, {
|
|
3255
|
+
value: BlockType.Heading3,
|
|
3256
|
+
label: "Heading 3"
|
|
3257
|
+
}, {
|
|
3258
|
+
value: BlockType.Heading4,
|
|
3259
|
+
label: "Heading 4"
|
|
3260
|
+
}, {
|
|
3261
|
+
value: BlockType.Heading5,
|
|
3262
|
+
label: "Heading 5"
|
|
3263
|
+
}, {
|
|
3264
|
+
value: BlockType.Heading6,
|
|
3265
|
+
label: "Heading 6"
|
|
3266
|
+
}, {
|
|
3267
|
+
value: BlockType.UnorderedList,
|
|
3268
|
+
label: "Bulleted list"
|
|
3269
|
+
}, {
|
|
3270
|
+
value: BlockType.OrderedList,
|
|
3271
|
+
label: "Numbered list"
|
|
3272
|
+
}, {
|
|
3273
|
+
value: BlockType.BlockQuote,
|
|
3274
|
+
label: "Quote"
|
|
3275
|
+
}],
|
|
3276
|
+
defaultValue: BlockType.Paragraph
|
|
3277
|
+
});
|
|
3278
|
+
function BlockPlugin() {
|
|
3279
|
+
return createRichTextV2Plugin({
|
|
3280
|
+
withPlugin: withBlock,
|
|
3281
|
+
onKeyDown,
|
|
3282
|
+
control: {
|
|
3283
|
+
definition,
|
|
3284
|
+
onChange: (editor, value) => {
|
|
3285
|
+
const activeBlockType = getActiveBlockType(editor);
|
|
3286
|
+
if (value === BlockType.UnorderedList || value === BlockType.OrderedList) {
|
|
3287
|
+
ListActions.toggleList(editor, {
|
|
3288
|
+
type: value,
|
|
3289
|
+
at: getSelection(editor)
|
|
3290
|
+
});
|
|
3291
|
+
} else if (activeBlockType === value) {
|
|
3292
|
+
slate.Transforms.setNodes(editor, {
|
|
3293
|
+
type: BlockType.Default
|
|
3294
|
+
}, {
|
|
3295
|
+
at: getSelection(editor)
|
|
3296
|
+
});
|
|
3297
|
+
} else {
|
|
3298
|
+
ListActions.unwrapList(editor, {
|
|
3299
|
+
at: getSelection(editor)
|
|
3300
|
+
});
|
|
3301
|
+
slate.Transforms.setNodes(editor, {
|
|
3302
|
+
type: value != null ? value : BlockType.Default
|
|
3303
|
+
}, {
|
|
3304
|
+
at: getSelection(editor)
|
|
3305
|
+
});
|
|
3306
|
+
}
|
|
3307
|
+
},
|
|
3308
|
+
getValue: (editor) => {
|
|
3309
|
+
const activeBlock = getActiveBlockType(editor);
|
|
3310
|
+
if (activeBlock === RootBlockType.Default)
|
|
3311
|
+
return void 0;
|
|
3312
|
+
return activeBlock;
|
|
3313
|
+
}
|
|
3314
|
+
},
|
|
3315
|
+
renderElement: (renderElement) => (props) => /* @__PURE__ */ jsxRuntime.jsx(BlockPluginComponent, __spreadProps(__spreadValues({}, props), {
|
|
3316
|
+
renderElement
|
|
3317
|
+
}))
|
|
3318
|
+
});
|
|
3319
|
+
}
|
|
3320
|
+
function BlockPluginComponent(_d) {
|
|
3321
|
+
var _e = _d, {
|
|
3322
|
+
renderElement
|
|
3323
|
+
} = _e, props = __objRest(_e, [
|
|
3324
|
+
"renderElement"
|
|
3325
|
+
]);
|
|
3326
|
+
const blockStyles = [useStyle({
|
|
3327
|
+
margin: 0
|
|
3328
|
+
}), props.element.className];
|
|
3329
|
+
const quoteStyles = useStyle({
|
|
3330
|
+
padding: "0.5em 10px",
|
|
3331
|
+
fontSize: "1.25em",
|
|
3332
|
+
fontWeight: "300",
|
|
3333
|
+
borderLeft: "5px solid rgba(0, 0, 0, 0.1)"
|
|
3334
|
+
});
|
|
3335
|
+
const unorderedListStyles = useStyle({
|
|
3336
|
+
listStylePosition: "inside",
|
|
3337
|
+
paddingInlineStart: "20px",
|
|
3338
|
+
listStyleType: "disc",
|
|
3339
|
+
ul: {
|
|
3340
|
+
listStyleType: "circle"
|
|
3341
|
+
},
|
|
3342
|
+
"ul ul": {
|
|
3343
|
+
listStyleType: "square"
|
|
3344
|
+
}
|
|
3345
|
+
});
|
|
3346
|
+
const orderedListStyles = useStyle({
|
|
3347
|
+
listStylePosition: "inside",
|
|
3348
|
+
paddingInlineStart: "20px",
|
|
3349
|
+
listStyleType: "decimal"
|
|
3350
|
+
});
|
|
3351
|
+
switch (props.element.type) {
|
|
3352
|
+
case BlockType.Default:
|
|
3353
|
+
case BlockType.Paragraph:
|
|
3354
|
+
return /* @__PURE__ */ jsxRuntime.jsx("p", __spreadProps(__spreadValues({}, props.attributes), {
|
|
3355
|
+
className: css.cx(...blockStyles),
|
|
3356
|
+
children: renderElement(props)
|
|
3357
|
+
}));
|
|
3358
|
+
case BlockType.Heading1:
|
|
3359
|
+
return /* @__PURE__ */ jsxRuntime.jsx("h1", __spreadProps(__spreadValues({}, props.attributes), {
|
|
3360
|
+
className: css.cx(...blockStyles),
|
|
3361
|
+
children: renderElement(props)
|
|
3362
|
+
}));
|
|
3363
|
+
case BlockType.Heading2:
|
|
3364
|
+
return /* @__PURE__ */ jsxRuntime.jsx("h2", __spreadProps(__spreadValues({}, props.attributes), {
|
|
3365
|
+
className: css.cx(...blockStyles),
|
|
3366
|
+
children: renderElement(props)
|
|
3367
|
+
}));
|
|
3368
|
+
case BlockType.Heading3:
|
|
3369
|
+
return /* @__PURE__ */ jsxRuntime.jsx("h3", __spreadProps(__spreadValues({}, props.attributes), {
|
|
3370
|
+
className: css.cx(...blockStyles),
|
|
3371
|
+
children: renderElement(props)
|
|
3372
|
+
}));
|
|
3373
|
+
case BlockType.Heading4:
|
|
3374
|
+
return /* @__PURE__ */ jsxRuntime.jsx("h4", __spreadProps(__spreadValues({}, props.attributes), {
|
|
3375
|
+
className: css.cx(...blockStyles),
|
|
3376
|
+
children: renderElement(props)
|
|
3377
|
+
}));
|
|
3378
|
+
case BlockType.Heading5:
|
|
3379
|
+
return /* @__PURE__ */ jsxRuntime.jsx("h5", __spreadProps(__spreadValues({}, props.attributes), {
|
|
3380
|
+
className: css.cx(...blockStyles),
|
|
3381
|
+
children: renderElement(props)
|
|
3382
|
+
}));
|
|
3383
|
+
case BlockType.Heading6:
|
|
3384
|
+
return /* @__PURE__ */ jsxRuntime.jsx("h6", __spreadProps(__spreadValues({}, props.attributes), {
|
|
3385
|
+
className: css.cx(...blockStyles),
|
|
3386
|
+
children: renderElement(props)
|
|
3387
|
+
}));
|
|
3388
|
+
case BlockType.BlockQuote:
|
|
3389
|
+
return /* @__PURE__ */ jsxRuntime.jsx("blockquote", __spreadProps(__spreadValues({}, props.attributes), {
|
|
3390
|
+
className: css.cx(...blockStyles, quoteStyles),
|
|
3391
|
+
children: renderElement(props)
|
|
3392
|
+
}));
|
|
3393
|
+
case BlockType.OrderedList:
|
|
3394
|
+
return /* @__PURE__ */ jsxRuntime.jsx("ol", __spreadProps(__spreadValues({}, props.attributes), {
|
|
3395
|
+
className: css.cx(...blockStyles, orderedListStyles),
|
|
3396
|
+
children: renderElement(props)
|
|
3397
|
+
}));
|
|
3398
|
+
case BlockType.UnorderedList:
|
|
3399
|
+
return /* @__PURE__ */ jsxRuntime.jsx("ul", __spreadProps(__spreadValues({}, props.attributes), {
|
|
3400
|
+
className: css.cx(...blockStyles, unorderedListStyles),
|
|
3401
|
+
children: renderElement(props)
|
|
3402
|
+
}));
|
|
3403
|
+
case BlockType.ListItem:
|
|
3404
|
+
return /* @__PURE__ */ jsxRuntime.jsx("li", __spreadProps(__spreadValues({}, props.attributes), {
|
|
3405
|
+
className: css.cx(...blockStyles),
|
|
3406
|
+
children: renderElement(props)
|
|
3407
|
+
}));
|
|
3408
|
+
case BlockType.ListItemChild:
|
|
3409
|
+
return /* @__PURE__ */ jsxRuntime.jsx("span", __spreadProps(__spreadValues({}, props.attributes), {
|
|
3410
|
+
className: css.cx(...blockStyles),
|
|
3411
|
+
children: renderElement(props)
|
|
3412
|
+
}));
|
|
3413
|
+
default:
|
|
3414
|
+
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
3415
|
+
children: renderElement(props)
|
|
3416
|
+
});
|
|
3417
|
+
}
|
|
3418
|
+
}
|
|
3419
|
+
function clearActiveTypographyStyle(editor, options) {
|
|
3420
|
+
slate.Editor.withoutNormalizing(editor, () => {
|
|
3421
|
+
var _a2;
|
|
3422
|
+
const at = (_a2 = options == null ? void 0 : options.at) != null ? _a2 : editor.selection;
|
|
3423
|
+
if (!at)
|
|
3424
|
+
return;
|
|
3425
|
+
const atRef = slate.Editor.rangeRef(editor, at);
|
|
3426
|
+
if (atRef.current) {
|
|
3427
|
+
slate.Transforms.setNodes(editor, {
|
|
3428
|
+
slice: true
|
|
3429
|
+
}, {
|
|
3430
|
+
at: atRef.current,
|
|
3431
|
+
match: (node) => slate.Text.isText(node),
|
|
3432
|
+
split: slate.Range.isExpanded(atRef.current)
|
|
3433
|
+
});
|
|
3434
|
+
}
|
|
3435
|
+
if (atRef.current) {
|
|
3436
|
+
const textNodes = Array.from(slate.Editor.nodes(editor, {
|
|
3437
|
+
at: atRef.current,
|
|
3438
|
+
match: (node) => slate.Text.isText(node) && node.slice === true
|
|
3439
|
+
}));
|
|
3440
|
+
for (const [node, path] of textNodes) {
|
|
3441
|
+
if (slate.Text.isText(node)) {
|
|
3442
|
+
const typography = __spreadProps(__spreadValues({}, node.typography), {
|
|
3443
|
+
style: []
|
|
3444
|
+
});
|
|
3445
|
+
slate.Transforms.setNodes(editor, {
|
|
3446
|
+
typography
|
|
3447
|
+
}, { at: path });
|
|
3448
|
+
}
|
|
3449
|
+
}
|
|
3450
|
+
}
|
|
3451
|
+
atRef.unref();
|
|
3452
|
+
});
|
|
3453
|
+
}
|
|
3454
|
+
function clearDeviceActiveTypography(editor, currentDeviceId, options) {
|
|
3455
|
+
slate.Editor.withoutNormalizing(editor, () => {
|
|
3456
|
+
var _a2, _b, _c;
|
|
3457
|
+
const at = (_a2 = options == null ? void 0 : options.at) != null ? _a2 : editor.selection;
|
|
3458
|
+
if (!at)
|
|
3459
|
+
return;
|
|
3460
|
+
const atRef = slate.Editor.rangeRef(editor, at);
|
|
3461
|
+
if (atRef.current) {
|
|
3462
|
+
slate.Transforms.setNodes(editor, {
|
|
3463
|
+
slice: true
|
|
3464
|
+
}, {
|
|
3465
|
+
at: atRef.current,
|
|
3466
|
+
match: (node) => slate.Text.isText(node),
|
|
3467
|
+
split: slate.Range.isExpanded(atRef.current)
|
|
3468
|
+
});
|
|
3469
|
+
}
|
|
3470
|
+
if (atRef.current) {
|
|
3471
|
+
const textNodes = Array.from(slate.Editor.nodes(editor, {
|
|
3472
|
+
at: atRef.current,
|
|
3473
|
+
match: (node) => slate.Text.isText(node) && node.slice === true
|
|
3474
|
+
}));
|
|
3475
|
+
for (const [node, path] of textNodes) {
|
|
3476
|
+
if (slate.Text.isText(node)) {
|
|
3477
|
+
const typography = __spreadProps(__spreadValues({}, node.typography), {
|
|
3478
|
+
style: (_c = (_b = node == null ? void 0 : node.typography) == null ? void 0 : _b.style.filter(({ deviceId }) => deviceId !== currentDeviceId)) != null ? _c : []
|
|
3479
|
+
});
|
|
3480
|
+
slate.Transforms.setNodes(editor, {
|
|
3481
|
+
typography
|
|
3482
|
+
}, { at: path });
|
|
3483
|
+
}
|
|
3484
|
+
}
|
|
3485
|
+
}
|
|
3486
|
+
atRef.unref();
|
|
3487
|
+
});
|
|
3488
|
+
}
|
|
3489
|
+
function detachActiveTypography(editor, value, options) {
|
|
3490
|
+
slate.Editor.withoutNormalizing(editor, () => {
|
|
3491
|
+
var _a2;
|
|
3492
|
+
const at = (_a2 = options == null ? void 0 : options.at) != null ? _a2 : editor.selection;
|
|
3493
|
+
if (!at)
|
|
3494
|
+
return;
|
|
3495
|
+
const atRef = slate.Editor.rangeRef(editor, at);
|
|
3496
|
+
if (atRef.current) {
|
|
3497
|
+
slate.Transforms.setNodes(editor, {
|
|
3498
|
+
slice: true
|
|
3499
|
+
}, {
|
|
3500
|
+
at: atRef.current,
|
|
3501
|
+
match: (node) => slate.Text.isText(node),
|
|
3502
|
+
split: slate.Range.isExpanded(atRef.current)
|
|
3503
|
+
});
|
|
3504
|
+
}
|
|
3505
|
+
if (atRef.current) {
|
|
3506
|
+
const textNodes = Array.from(slate.Editor.nodes(editor, {
|
|
3507
|
+
at: atRef.current,
|
|
3508
|
+
match: (node) => slate.Text.isText(node) && node.slice === true
|
|
3509
|
+
}));
|
|
3510
|
+
for (const [node, path] of textNodes) {
|
|
3511
|
+
if (slate.Text.isText(node)) {
|
|
3512
|
+
slate.Transforms.setNodes(editor, {
|
|
3513
|
+
typography: {
|
|
3514
|
+
style: value
|
|
3515
|
+
}
|
|
3516
|
+
}, { at: path });
|
|
3517
|
+
}
|
|
3518
|
+
}
|
|
3519
|
+
}
|
|
3520
|
+
atRef.unref();
|
|
3521
|
+
});
|
|
2367
3522
|
}
|
|
2368
|
-
function
|
|
2369
|
-
|
|
3523
|
+
function setActiveTypographyId(editor, id, options) {
|
|
3524
|
+
var _a2;
|
|
3525
|
+
const at = (_a2 = options == null ? void 0 : options.at) != null ? _a2 : editor.selection;
|
|
3526
|
+
if (!at)
|
|
3527
|
+
return;
|
|
3528
|
+
slate.Transforms.setNodes(editor, {
|
|
3529
|
+
typography: {
|
|
3530
|
+
id,
|
|
3531
|
+
style: []
|
|
3532
|
+
}
|
|
3533
|
+
}, {
|
|
3534
|
+
at,
|
|
3535
|
+
match: (node) => slate.Text.isText(node),
|
|
3536
|
+
split: slate.Range.isExpanded(at)
|
|
3537
|
+
});
|
|
3538
|
+
}
|
|
3539
|
+
function setActiveTypographyStyle(editor, breakpoints, deviceId, prop, value, options) {
|
|
3540
|
+
slate.Editor.withoutNormalizing(editor, () => {
|
|
3541
|
+
var _a2, _b, _c;
|
|
3542
|
+
const at = (_a2 = options == null ? void 0 : options.at) != null ? _a2 : editor.selection;
|
|
3543
|
+
if (!at)
|
|
3544
|
+
return;
|
|
3545
|
+
const atRef = slate.Editor.rangeRef(editor, at);
|
|
3546
|
+
if (atRef.current) {
|
|
3547
|
+
slate.Transforms.setNodes(editor, {
|
|
3548
|
+
slice: true
|
|
3549
|
+
}, {
|
|
3550
|
+
at: atRef.current,
|
|
3551
|
+
match: (node) => slate.Text.isText(node),
|
|
3552
|
+
split: slate.Range.isExpanded(atRef.current)
|
|
3553
|
+
});
|
|
3554
|
+
}
|
|
3555
|
+
if (atRef.current) {
|
|
3556
|
+
const textNodes = Array.from(slate.Editor.nodes(editor, {
|
|
3557
|
+
at: atRef.current,
|
|
3558
|
+
match: (node) => slate.Text.isText(node) && node.slice === true
|
|
3559
|
+
}));
|
|
3560
|
+
for (const [node, path] of textNodes) {
|
|
3561
|
+
if (slate.Text.isText(node)) {
|
|
3562
|
+
const deviceOverrides = (_c = (_b = node == null ? void 0 : node.typography) == null ? void 0 : _b.style) != null ? _c : [];
|
|
3563
|
+
const deviceStyle = state_breakpoints.findBreakpointOverride(breakpoints, deviceOverrides, deviceId, (v) => v) || {
|
|
3564
|
+
value: {}
|
|
3565
|
+
};
|
|
3566
|
+
const nextDeviceStyle = {
|
|
3567
|
+
deviceId,
|
|
3568
|
+
value: __spreadProps(__spreadValues({}, deviceStyle.value), { [prop]: value })
|
|
3569
|
+
};
|
|
3570
|
+
const nextTypography = __spreadProps(__spreadValues({}, node.typography), {
|
|
3571
|
+
style: [...deviceOverrides.filter((v) => v.deviceId !== deviceId), nextDeviceStyle]
|
|
3572
|
+
});
|
|
3573
|
+
slate.Transforms.setNodes(editor, {
|
|
3574
|
+
typography: nextTypography
|
|
3575
|
+
}, { at: path });
|
|
3576
|
+
}
|
|
3577
|
+
}
|
|
3578
|
+
}
|
|
3579
|
+
atRef.unref();
|
|
3580
|
+
});
|
|
2370
3581
|
}
|
|
3582
|
+
function getValue(editor) {
|
|
3583
|
+
const matchingValues = Array.from(slate.Editor.nodes(editor, {
|
|
3584
|
+
at: getSelection(editor),
|
|
3585
|
+
match: slate.Text.isText
|
|
3586
|
+
})).map(([node]) => node["typography"]);
|
|
3587
|
+
return matchingValues;
|
|
3588
|
+
}
|
|
3589
|
+
const TypographyActions = {
|
|
3590
|
+
setActiveTypographyId,
|
|
3591
|
+
setActiveTypographyStyle,
|
|
3592
|
+
clearActiveTypographyStyle,
|
|
3593
|
+
clearDeviceActiveTypography,
|
|
3594
|
+
detachActiveTypography
|
|
3595
|
+
};
|
|
3596
|
+
const TYPOGRAPHY_KEY = "typography";
|
|
3597
|
+
function withTypography(editor) {
|
|
3598
|
+
const { normalizeNode } = editor;
|
|
3599
|
+
editor.normalizeNode = (entry) => {
|
|
3600
|
+
var _a2, _b;
|
|
3601
|
+
const [normalizationNode, normalizationPath] = entry;
|
|
3602
|
+
if (slate.Text.isText(normalizationNode) && ((_a2 = normalizationNode == null ? void 0 : normalizationNode.typography) == null ? void 0 : _a2.id) == null && ((_b = normalizationNode == null ? void 0 : normalizationNode.typography) == null ? void 0 : _b.style.length) === 0) {
|
|
3603
|
+
slate.Transforms.unsetNodes(editor, TYPOGRAPHY_KEY, { at: normalizationPath });
|
|
3604
|
+
return;
|
|
3605
|
+
}
|
|
3606
|
+
if (slate.Text.isText(normalizationNode) && (normalizationNode == null ? void 0 : normalizationNode.slice) != null) {
|
|
3607
|
+
slate.Transforms.unsetNodes(editor, "slice", { at: normalizationPath });
|
|
3608
|
+
return;
|
|
3609
|
+
}
|
|
3610
|
+
normalizeNode(entry);
|
|
3611
|
+
};
|
|
3612
|
+
return editor;
|
|
3613
|
+
}
|
|
3614
|
+
function TypographyPlugin() {
|
|
3615
|
+
return createRichTextV2Plugin({
|
|
3616
|
+
withPlugin: withTypography,
|
|
3617
|
+
control: {
|
|
3618
|
+
definition: unstable_Typography(),
|
|
3619
|
+
onChange: (editor, value) => {
|
|
3620
|
+
slate.Editor.withoutNormalizing(editor, () => {
|
|
3621
|
+
const at = getSelection(editor);
|
|
3622
|
+
if (!at)
|
|
3623
|
+
return;
|
|
3624
|
+
const atRef = slate.Editor.rangeRef(editor, at);
|
|
3625
|
+
if (atRef.current) {
|
|
3626
|
+
slate.Transforms.setNodes(editor, {
|
|
3627
|
+
slice: true
|
|
3628
|
+
}, {
|
|
3629
|
+
at: atRef.current,
|
|
3630
|
+
match: slate.Text.isText,
|
|
3631
|
+
split: true
|
|
3632
|
+
});
|
|
3633
|
+
}
|
|
3634
|
+
if (atRef.current) {
|
|
3635
|
+
const nodesToUpdate = Array.from(slate.Editor.nodes(editor, {
|
|
3636
|
+
at: atRef.current,
|
|
3637
|
+
match: (node) => slate.Text.isText(node) && node.slice === true
|
|
3638
|
+
}));
|
|
3639
|
+
if (nodesToUpdate.length !== (value == null ? void 0 : value.length))
|
|
3640
|
+
return console.error(`TypographyControl.onChange received the wrong number of arguments.
|
|
3641
|
+
Called with ${value == null ? void 0 : value.length} values mapping to ${nodesToUpdate.length} nodes.`);
|
|
3642
|
+
for (const [index, [, path]] of nodesToUpdate.entries()) {
|
|
3643
|
+
slate.Transforms.setNodes(editor, {
|
|
3644
|
+
typography: value == null ? void 0 : value.at(index)
|
|
3645
|
+
}, { at: path, match: slate.Text.isText });
|
|
3646
|
+
}
|
|
3647
|
+
}
|
|
3648
|
+
atRef.unref();
|
|
3649
|
+
});
|
|
3650
|
+
},
|
|
3651
|
+
getValue: (editor) => getValue(editor),
|
|
3652
|
+
getLeafValue: (text) => {
|
|
3653
|
+
return slate.Text.isText(text) ? text.typography : void 0;
|
|
3654
|
+
}
|
|
3655
|
+
},
|
|
3656
|
+
renderLeaf: (renderLeaf, className) => (props) => {
|
|
3657
|
+
return renderLeaf(__spreadProps(__spreadValues({}, props), {
|
|
3658
|
+
leaf: __spreadProps(__spreadValues({}, props.leaf), {
|
|
3659
|
+
className: `${props.leaf.className} ${className}`
|
|
3660
|
+
})
|
|
3661
|
+
}));
|
|
3662
|
+
}
|
|
3663
|
+
});
|
|
3664
|
+
}
|
|
3665
|
+
const BLOCK_ONE_PATH = [0];
|
|
3666
|
+
const BLOCK_TWO_PATH = [1];
|
|
3667
|
+
function withInlineMode(editor) {
|
|
3668
|
+
const {
|
|
3669
|
+
normalizeNode
|
|
3670
|
+
} = editor;
|
|
3671
|
+
editor.normalizeNode = (entry) => {
|
|
3672
|
+
const [normalizationNode, normalizationPath] = entry;
|
|
3673
|
+
if (slate.Path.equals(BLOCK_TWO_PATH, normalizationPath)) {
|
|
3674
|
+
slate.Transforms.mergeNodes(editor, {
|
|
3675
|
+
at: BLOCK_TWO_PATH
|
|
3676
|
+
});
|
|
3677
|
+
return;
|
|
3678
|
+
}
|
|
3679
|
+
if (slate.Path.isAncestor(BLOCK_ONE_PATH, normalizationPath) && ElementUtils.isBlock(normalizationNode)) {
|
|
3680
|
+
slate.Transforms.unwrapNodes(editor, {
|
|
3681
|
+
at: normalizationPath
|
|
3682
|
+
});
|
|
3683
|
+
return;
|
|
3684
|
+
}
|
|
3685
|
+
if (slate.Path.equals(BLOCK_ONE_PATH, normalizationPath)) {
|
|
3686
|
+
slate.Transforms.setNodes(editor, {
|
|
3687
|
+
type: BlockType.Default
|
|
3688
|
+
}, {
|
|
3689
|
+
at: normalizationPath
|
|
3690
|
+
});
|
|
3691
|
+
return;
|
|
3692
|
+
}
|
|
3693
|
+
normalizeNode(entry);
|
|
3694
|
+
};
|
|
3695
|
+
return editor;
|
|
3696
|
+
}
|
|
3697
|
+
function InlineModePlugin() {
|
|
3698
|
+
return createRichTextV2Plugin({
|
|
3699
|
+
onKeyDown: (e) => {
|
|
3700
|
+
if (isHotkey__default["default"]("enter", e))
|
|
3701
|
+
e.preventDefault();
|
|
3702
|
+
},
|
|
3703
|
+
withPlugin: withInlineMode,
|
|
3704
|
+
renderElement: (renderElement) => (props) => /* @__PURE__ */ jsxRuntime.jsx(InlineModePluginComponent, __spreadProps(__spreadValues({}, props), {
|
|
3705
|
+
renderElement
|
|
3706
|
+
}))
|
|
3707
|
+
});
|
|
3708
|
+
}
|
|
3709
|
+
function InlineModePluginComponent(_f) {
|
|
3710
|
+
var _g = _f, {
|
|
3711
|
+
renderElement
|
|
3712
|
+
} = _g, props = __objRest(_g, [
|
|
3713
|
+
"renderElement"
|
|
3714
|
+
]);
|
|
3715
|
+
return /* @__PURE__ */ jsxRuntime.jsx("span", __spreadProps(__spreadValues({}, props.attributes), {
|
|
3716
|
+
children: renderElement(props)
|
|
3717
|
+
}));
|
|
3718
|
+
}
|
|
3719
|
+
const RichTextV2ControlType = "makeswift::controls::rich-text-v2";
|
|
3720
|
+
const RichTextV2Mode = {
|
|
3721
|
+
Inline: "makeswift::controls::rich-text-v2::mode::inline",
|
|
3722
|
+
Block: "makeswift::controls::rich-text-v2::mode::block"
|
|
3723
|
+
};
|
|
3724
|
+
function RichText(config = {}) {
|
|
3725
|
+
return {
|
|
3726
|
+
type: RichTextV2ControlType,
|
|
3727
|
+
config: {
|
|
3728
|
+
mode: config.mode,
|
|
3729
|
+
defaultValue: config == null ? void 0 : config.unstable_defaultValue,
|
|
3730
|
+
plugins: (config == null ? void 0 : config.mode) === RichTextV2Mode.Inline ? [InlineModePlugin()] : [BlockPlugin(), TypographyPlugin(), TextAlignPlugin(), InlinePlugin(), LinkPlugin()]
|
|
3731
|
+
}
|
|
3732
|
+
};
|
|
3733
|
+
}
|
|
3734
|
+
RichText.Mode = RichTextV2Mode;
|
|
2371
3735
|
const RichTextV2ControlMessageType = {
|
|
2372
3736
|
RESET_VALUE: "makeswift::controls::rich-text-v2::control-message::reset-value",
|
|
2373
3737
|
FOCUS: "makeswift::controls::rich-text-v2::control-message::focus",
|
|
@@ -2401,6 +3765,7 @@ class RichTextV2Control extends PropController {
|
|
|
2401
3765
|
this.editor.selection = null;
|
|
2402
3766
|
this.editor.children = this.defaultValue;
|
|
2403
3767
|
this.editor.onChange();
|
|
3768
|
+
this.onLocalUserChange();
|
|
2404
3769
|
}
|
|
2405
3770
|
break;
|
|
2406
3771
|
}
|
|
@@ -2477,10 +3842,7 @@ class RichTextV2Control extends PropController {
|
|
|
2477
3842
|
}
|
|
2478
3843
|
}
|
|
2479
3844
|
function isRichTextV1Data(value) {
|
|
2480
|
-
return value !== void 0 && typeof value === "object" && !Array.isArray(value) && "
|
|
2481
|
-
}
|
|
2482
|
-
function isNonNullable(value) {
|
|
2483
|
-
return value != null;
|
|
3845
|
+
return value !== void 0 && typeof value === "object" && !Array.isArray(value) && "document" in value;
|
|
2484
3846
|
}
|
|
2485
3847
|
const TypographyControlType = "makeswift::controls::typography";
|
|
2486
3848
|
function unstable_Typography() {
|
|
@@ -2586,8 +3948,8 @@ function getRichTextPageIds(value) {
|
|
|
2586
3948
|
}
|
|
2587
3949
|
}
|
|
2588
3950
|
}
|
|
2589
|
-
function introspectRichTextV2Data(
|
|
2590
|
-
const plugins =
|
|
3951
|
+
function introspectRichTextV2Data(definition2, data, func) {
|
|
3952
|
+
const plugins = definition2.config.plugins;
|
|
2591
3953
|
return data.descendants.flatMap((d) => getDescendantTypographyIds(d));
|
|
2592
3954
|
function getDescendantTypographyIds(descendant) {
|
|
2593
3955
|
if (slate.Element.isElement(descendant)) {
|
|
@@ -2616,14 +3978,14 @@ function introspectRichTextV2Data(definition, data, func) {
|
|
|
2616
3978
|
})) != null ? _a2 : [];
|
|
2617
3979
|
}
|
|
2618
3980
|
}
|
|
2619
|
-
function getRichTextV2SwatchIds(
|
|
2620
|
-
return introspectRichTextV2Data(
|
|
3981
|
+
function getRichTextV2SwatchIds(definition2, data) {
|
|
3982
|
+
return introspectRichTextV2Data(definition2, data, getSwatchIds);
|
|
2621
3983
|
}
|
|
2622
|
-
function getRichTextV2TypographyIds(
|
|
2623
|
-
return introspectRichTextV2Data(
|
|
3984
|
+
function getRichTextV2TypographyIds(definition2, data) {
|
|
3985
|
+
return introspectRichTextV2Data(definition2, data, getTypographyIds);
|
|
2624
3986
|
}
|
|
2625
|
-
function getRichTextV2PageIds(
|
|
2626
|
-
return introspectRichTextV2Data(
|
|
3987
|
+
function getRichTextV2PageIds(definition2, data) {
|
|
3988
|
+
return introspectRichTextV2Data(definition2, data, getPageIds);
|
|
2627
3989
|
}
|
|
2628
3990
|
function getElementChildren(descriptor, prop) {
|
|
2629
3991
|
if (prop == null)
|
|
@@ -3125,6 +4487,8 @@ function configureStore({
|
|
|
3125
4487
|
}), redux.applyMiddleware(thunk__default["default"]));
|
|
3126
4488
|
}
|
|
3127
4489
|
exports.Backgrounds = Backgrounds;
|
|
4490
|
+
exports.BlockActions = BlockActions;
|
|
4491
|
+
exports.BlockPlugin = BlockPlugin;
|
|
3128
4492
|
exports.BlockTextAlignment = BlockTextAlignment;
|
|
3129
4493
|
exports.BlockType = BlockType;
|
|
3130
4494
|
exports.Border = Border;
|
|
@@ -3138,20 +4502,25 @@ exports.ColorControlType = ColorControlType;
|
|
|
3138
4502
|
exports.ComponentIcon = ComponentIcon;
|
|
3139
4503
|
exports.Date = Date;
|
|
3140
4504
|
exports.ElementID = ElementID;
|
|
4505
|
+
exports.ElementUtils = ElementUtils;
|
|
3141
4506
|
exports.Font = Font;
|
|
3142
4507
|
exports.GapX = GapX;
|
|
3143
4508
|
exports.GapY = GapY;
|
|
3144
4509
|
exports.Grid = Grid;
|
|
4510
|
+
exports.IconRadioGroupControlType = IconRadioGroupControlType;
|
|
3145
4511
|
exports.Image = Image$1;
|
|
3146
4512
|
exports.Image$1 = Image;
|
|
3147
4513
|
exports.ImageControlType = ImageControlType;
|
|
3148
4514
|
exports.ImageControlValueFormat = ImageControlValueFormat;
|
|
3149
4515
|
exports.Images = Images;
|
|
4516
|
+
exports.InlineModePlugin = InlineModePlugin;
|
|
4517
|
+
exports.InlinePlugin = InlinePlugin;
|
|
3150
4518
|
exports.InlineType = InlineType;
|
|
3151
4519
|
exports.Link = Link$1;
|
|
3152
4520
|
exports.Link$1 = Link;
|
|
3153
4521
|
exports.LinkControlType = LinkControlType;
|
|
3154
4522
|
exports.List = List;
|
|
4523
|
+
exports.ListActions = ListActions;
|
|
3155
4524
|
exports.ListControl = ListControl;
|
|
3156
4525
|
exports.ListControlMessageType = ListControlMessageType;
|
|
3157
4526
|
exports.ListControlType = ListControlType;
|
|
@@ -3168,8 +4537,7 @@ exports.ResponsiveLength = ResponsiveLength;
|
|
|
3168
4537
|
exports.ResponsiveNumber = ResponsiveNumber;
|
|
3169
4538
|
exports.ResponsiveOpacity = ResponsiveOpacity;
|
|
3170
4539
|
exports.ResponsiveSelect = ResponsiveSelect;
|
|
3171
|
-
exports.RichText = RichText
|
|
3172
|
-
exports.RichText$1 = RichText;
|
|
4540
|
+
exports.RichText = RichText;
|
|
3173
4541
|
exports.RichTextControl = RichTextControl;
|
|
3174
4542
|
exports.RichTextControlMessageType = RichTextControlMessageType;
|
|
3175
4543
|
exports.RichTextControlType = RichTextControlType;
|
|
@@ -3179,6 +4547,8 @@ exports.RichTextV2ControlMessageType = RichTextV2ControlMessageType;
|
|
|
3179
4547
|
exports.RichTextV2ControlType = RichTextV2ControlType;
|
|
3180
4548
|
exports.RichTextV2Mode = RichTextV2Mode;
|
|
3181
4549
|
exports.RootBlockType = RootBlockType;
|
|
4550
|
+
exports.Select = Select;
|
|
4551
|
+
exports.SelectControlType = SelectControlType;
|
|
3182
4552
|
exports.Shadows = Shadows;
|
|
3183
4553
|
exports.ShadowsPropControllerFormat = ShadowsPropControllerFormat;
|
|
3184
4554
|
exports.Shape = Shape;
|
|
@@ -3198,14 +4568,18 @@ exports.StyleControlType = StyleControlType;
|
|
|
3198
4568
|
exports.StyleV2Control = StyleV2Control;
|
|
3199
4569
|
exports.StyleV2ControlMessageType = StyleV2ControlMessageType;
|
|
3200
4570
|
exports.StyleV2ControlType = StyleV2ControlType;
|
|
4571
|
+
exports.TYPOGRAPHY_KEY = TYPOGRAPHY_KEY;
|
|
3201
4572
|
exports.Table = Table;
|
|
3202
4573
|
exports.TableFormFields = TableFormFields;
|
|
3203
4574
|
exports.TableFormFieldsMessageType = TableFormFieldsMessageType;
|
|
4575
|
+
exports.TextAlignPlugin = TextAlignPlugin;
|
|
3204
4576
|
exports.TextArea = TextArea;
|
|
3205
4577
|
exports.TextInput = TextInput;
|
|
3206
4578
|
exports.TextStyle = TextStyle;
|
|
3207
4579
|
exports.Types = Types;
|
|
4580
|
+
exports.TypographyActions = TypographyActions;
|
|
3208
4581
|
exports.TypographyControlType = TypographyControlType;
|
|
4582
|
+
exports.TypographyPlugin = TypographyPlugin;
|
|
3209
4583
|
exports.Video = Video;
|
|
3210
4584
|
exports.Width = Width;
|
|
3211
4585
|
exports.WidthPropControllerFormat = WidthPropControllerFormat;
|
|
@@ -3223,6 +4597,7 @@ exports.createDocument = createDocument;
|
|
|
3223
4597
|
exports.createDocumentReference = createDocumentReference;
|
|
3224
4598
|
exports.createPropController = createPropController;
|
|
3225
4599
|
exports.createRichTextV2Plugin = createRichTextV2Plugin;
|
|
4600
|
+
exports.deepEqual = deepEqual;
|
|
3226
4601
|
exports.descriptors = descriptors;
|
|
3227
4602
|
exports.getBackgroundsFileIds = getBackgroundsFileIds;
|
|
3228
4603
|
exports.getBackgroundsSwatchIds = getBackgroundsSwatchIds;
|
|
@@ -3269,13 +4644,17 @@ exports.getTableIds = getTableIds;
|
|
|
3269
4644
|
exports.getTypographyIds = getTypographyIds;
|
|
3270
4645
|
exports.getTypographySwatchIds = getTypographySwatchIds;
|
|
3271
4646
|
exports.getTypographyTypographyIds = getTypographyTypographyIds;
|
|
4647
|
+
exports.getValue = getValue$3;
|
|
3272
4648
|
exports.introspection = introspection;
|
|
3273
4649
|
exports.isElementReference = isElementReference;
|
|
4650
|
+
exports.isLinkElement = isLinkElement;
|
|
3274
4651
|
exports.isNonNullable = isNonNullable;
|
|
3275
4652
|
exports.isPropControllersHandle = isPropControllersHandle;
|
|
3276
4653
|
exports.isRichTextV1Data = isRichTextV1Data;
|
|
3277
4654
|
exports.merge = merge;
|
|
3278
4655
|
exports.mergeSlotData = mergeSlotData;
|
|
4656
|
+
exports.onChange = onChange$1;
|
|
4657
|
+
exports.onKeyDown = onKeyDown;
|
|
3279
4658
|
exports.parseLocalesInput = parseLocalesInput;
|
|
3280
4659
|
exports.reducer = reducer$8;
|
|
3281
4660
|
exports.reducer$1 = reducer$7;
|
|
@@ -3292,9 +4671,15 @@ exports.richTextDTOtoSelection = richTextDTOtoSelection;
|
|
|
3292
4671
|
exports.richTextV2DataToDescendents = richTextV2DataToDescendents;
|
|
3293
4672
|
exports.richTextV2DescendentsToData = richTextV2DescendentsToData;
|
|
3294
4673
|
exports.toSelectionDTO = toSelectionDTO;
|
|
3295
|
-
exports.
|
|
4674
|
+
exports.unstable_IconRadioGroup = unstable_IconRadioGroup;
|
|
4675
|
+
exports.unstable_IconRadioGroupIcon = unstable_IconRadioGroupIcon;
|
|
3296
4676
|
exports.unstable_StyleV2 = unstable_StyleV2;
|
|
3297
4677
|
exports.unstable_Typography = unstable_Typography;
|
|
3298
4678
|
exports.unstable_useStyleV2ClassName = unstable_useStyleV2ClassName;
|
|
3299
4679
|
exports.useStyle = useStyle;
|
|
4680
|
+
exports.withBlock = withBlock;
|
|
4681
|
+
exports.withInline = withInline;
|
|
4682
|
+
exports.withInlineMode = withInlineMode;
|
|
4683
|
+
exports.withTextAlign = withTextAlign;
|
|
4684
|
+
exports.withTypography = withTypography;
|
|
3300
4685
|
//# sourceMappingURL=react-page.cjs.js.map
|