@makeswift/runtime 0.7.13 → 0.7.14
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/ReadOnlyText.cjs.js +15 -26
- package/dist/ReadOnlyText.cjs.js.map +1 -1
- package/dist/ReadOnlyText.es.js +15 -25
- package/dist/ReadOnlyText.es.js.map +1 -1
- package/dist/controls.cjs.js +1 -4
- package/dist/controls.cjs.js.map +1 -1
- package/dist/controls.es.js +1 -2
- package/dist/controls.es.js.map +1 -1
- package/dist/index.cjs.js +2 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.cjs6.js +143 -132
- package/dist/index.cjs6.js.map +1 -1
- package/dist/index.es.js +2 -2
- package/dist/index.es6.js +144 -133
- package/dist/index.es6.js.map +1 -1
- package/dist/introspection.cjs.js +0 -1
- package/dist/introspection.cjs.js.map +1 -1
- package/dist/introspection.es.js +1 -1
- package/dist/{typography.cjs.js → leaf.cjs.js} +49 -12
- package/dist/leaf.cjs.js.map +1 -0
- package/dist/{typography.es.js → leaf.es.js} +49 -12
- package/dist/leaf.es.js.map +1 -0
- package/dist/next.es.js +1 -1
- package/dist/rich-text.cjs.js +29 -43
- package/dist/rich-text.cjs.js.map +1 -1
- package/dist/rich-text.es.js +30 -44
- package/dist/rich-text.es.js.map +1 -1
- package/dist/types/src/components/builtin/Form/components/Field/components/Checkbox/index.d.ts +1 -1
- package/dist/types/src/components/builtin/Text/EditableText/editable-text.d.ts.map +1 -1
- package/dist/types/src/components/builtin/Text/EditableText/useSyncWithBuilder.d.ts.map +1 -1
- package/dist/types/src/components/builtin/Text/ReadOnlyText.d.ts +2 -5
- package/dist/types/src/components/builtin/Text/ReadOnlyText.d.ts.map +1 -1
- package/dist/types/src/components/builtin/Text/components/Leaf/index.d.ts +0 -1
- package/dist/types/src/components/builtin/Text/components/Leaf/index.d.ts.map +1 -1
- package/dist/types/src/components/builtin/Text/components/Leaf/leaf.d.ts +21 -0
- package/dist/types/src/components/builtin/Text/components/Leaf/leaf.d.ts.map +1 -1
- package/dist/types/src/controls/rich-text/index.d.ts +0 -1
- package/dist/types/src/controls/rich-text/index.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/types.d.ts +47 -27
- package/dist/types/src/controls/rich-text/types.d.ts.map +1 -1
- package/dist/types/src/slate/BlockPlugin/clearBlockKeyForDevice.d.ts +5 -0
- package/dist/types/src/slate/BlockPlugin/clearBlockKeyForDevice.d.ts.map +1 -0
- package/dist/types/src/slate/BlockPlugin/index.d.ts +9 -0
- package/dist/types/src/slate/BlockPlugin/index.d.ts.map +1 -0
- package/dist/types/src/slate/BlockPlugin/setBlockKeyForDevice.d.ts +5 -0
- package/dist/types/src/slate/BlockPlugin/setBlockKeyForDevice.d.ts.map +1 -0
- package/dist/types/src/slate/BlockPlugin/types.d.ts +4 -0
- package/dist/types/src/slate/BlockPlugin/types.d.ts.map +1 -0
- package/dist/types/src/slate/ListPlugin/constants.d.ts.map +1 -0
- package/dist/types/src/slate/ListPlugin/dedent.d.ts.map +1 -0
- package/dist/types/src/slate/ListPlugin/indent.d.ts.map +1 -0
- package/dist/types/src/{components/builtin/Text/EditableText/ListPlugin/ListPlugin.d.ts → slate/ListPlugin/index.d.ts} +6 -2
- package/dist/types/src/slate/ListPlugin/index.d.ts.map +1 -0
- package/dist/types/src/{components/builtin/Text/EditableText/ListPlugin/lib → slate/ListPlugin}/toggleList.d.ts +1 -1
- package/dist/types/src/slate/ListPlugin/toggleList.d.ts.map +1 -0
- package/dist/types/src/slate/ListPlugin/unwrapList.d.ts.map +1 -0
- package/dist/types/src/slate/ListPlugin/utils/filterForSubtreeRoots.d.ts.map +1 -0
- package/dist/types/src/slate/ListPlugin/utils/getSelectedListItems.d.ts.map +1 -0
- package/dist/types/src/slate/ListPlugin/utils/location.d.ts.map +1 -0
- package/dist/types/src/{components/builtin/Text/EditableText/ListPlugin/lib → slate/ListPlugin}/wrapList.d.ts +1 -1
- package/dist/types/src/slate/ListPlugin/wrapList.d.ts.map +1 -0
- package/dist/types/src/slate/TypographyPlugin/clearActiveTypographyStyle.d.ts +3 -0
- package/dist/types/src/slate/TypographyPlugin/clearActiveTypographyStyle.d.ts.map +1 -0
- package/dist/types/src/slate/TypographyPlugin/clearDeviceActiveTypography.d.ts +3 -0
- package/dist/types/src/slate/TypographyPlugin/clearDeviceActiveTypography.d.ts.map +1 -0
- package/dist/types/src/slate/TypographyPlugin/detachActiveTypography.d.ts +4 -0
- package/dist/types/src/slate/TypographyPlugin/detachActiveTypography.d.ts.map +1 -0
- package/dist/types/src/slate/TypographyPlugin/index.d.ts +15 -0
- package/dist/types/src/slate/TypographyPlugin/index.d.ts.map +1 -0
- package/dist/types/src/slate/TypographyPlugin/setActiveTypographyId.d.ts +3 -0
- package/dist/types/src/slate/TypographyPlugin/setActiveTypographyId.d.ts.map +1 -0
- package/dist/types/src/slate/TypographyPlugin/setActiveTypographyStyle.d.ts +3 -0
- package/dist/types/src/slate/TypographyPlugin/setActiveTypographyStyle.d.ts.map +1 -0
- package/dist/types/src/slate/index.d.ts +4 -0
- package/dist/types/src/slate/index.d.ts.map +1 -0
- package/dist/types/src/{components/builtin/Text/EditableText/ListPlugin/lib → slate}/utils/editor.d.ts +1 -1
- package/dist/types/src/slate/utils/editor.d.ts.map +1 -0
- package/dist/types/src/{components/builtin/Text/EditableText/ListPlugin/lib → slate}/utils/element.d.ts +3 -5
- package/dist/types/src/slate/utils/element.d.ts.map +1 -0
- package/package.json +8 -1
- package/dist/compare.cjs.js +0 -126
- package/dist/compare.cjs.js.map +0 -1
- package/dist/compare.es.js +0 -124
- package/dist/compare.es.js.map +0 -1
- package/dist/types/src/components/builtin/Text/EditableText/ListPlugin/ListPlugin.d.ts.map +0 -1
- package/dist/types/src/components/builtin/Text/EditableText/ListPlugin/constants.d.ts.map +0 -1
- package/dist/types/src/components/builtin/Text/EditableText/ListPlugin/index.d.ts +0 -2
- package/dist/types/src/components/builtin/Text/EditableText/ListPlugin/index.d.ts.map +0 -1
- package/dist/types/src/components/builtin/Text/EditableText/ListPlugin/lib/dedent.d.ts.map +0 -1
- package/dist/types/src/components/builtin/Text/EditableText/ListPlugin/lib/indent.d.ts.map +0 -1
- package/dist/types/src/components/builtin/Text/EditableText/ListPlugin/lib/index.d.ts +0 -6
- package/dist/types/src/components/builtin/Text/EditableText/ListPlugin/lib/index.d.ts.map +0 -1
- package/dist/types/src/components/builtin/Text/EditableText/ListPlugin/lib/toggleList.d.ts.map +0 -1
- package/dist/types/src/components/builtin/Text/EditableText/ListPlugin/lib/unwrapList.d.ts.map +0 -1
- package/dist/types/src/components/builtin/Text/EditableText/ListPlugin/lib/utils/editor.d.ts.map +0 -1
- package/dist/types/src/components/builtin/Text/EditableText/ListPlugin/lib/utils/element.d.ts.map +0 -1
- package/dist/types/src/components/builtin/Text/EditableText/ListPlugin/lib/utils/filterForSubtreeRoots.d.ts.map +0 -1
- package/dist/types/src/components/builtin/Text/EditableText/ListPlugin/lib/utils/getSelectedListItems.d.ts.map +0 -1
- package/dist/types/src/components/builtin/Text/EditableText/ListPlugin/lib/utils/location.d.ts.map +0 -1
- package/dist/types/src/components/builtin/Text/EditableText/ListPlugin/lib/wrapList.d.ts.map +0 -1
- package/dist/types/src/components/builtin/Text/EditableText/ListPlugin/test/dedent.test.d.ts +0 -3
- package/dist/types/src/components/builtin/Text/EditableText/ListPlugin/test/dedent.test.d.ts.map +0 -1
- package/dist/types/src/components/builtin/Text/EditableText/ListPlugin/test/indent.test.d.ts +0 -3
- package/dist/types/src/components/builtin/Text/EditableText/ListPlugin/test/indent.test.d.ts.map +0 -1
- package/dist/types/src/components/builtin/Text/EditableText/ListPlugin/test/normalization.test.d.ts +0 -3
- package/dist/types/src/components/builtin/Text/EditableText/ListPlugin/test/normalization.test.d.ts.map +0 -1
- package/dist/types/src/components/builtin/Text/EditableText/ListPlugin/test/slate-test-helper.d.ts +0 -48
- package/dist/types/src/components/builtin/Text/EditableText/ListPlugin/test/slate-test-helper.d.ts.map +0 -1
- package/dist/types/src/components/builtin/Text/EditableText/ListPlugin/test/toggleList.test.d.ts +0 -3
- package/dist/types/src/components/builtin/Text/EditableText/ListPlugin/test/toggleList.test.d.ts.map +0 -1
- package/dist/types/src/components/builtin/Text/EditableText/ListPlugin/test/types.d.ts +0 -21
- package/dist/types/src/components/builtin/Text/EditableText/ListPlugin/test/types.d.ts.map +0 -1
- package/dist/types/src/components/builtin/Text/EditableText/ListPlugin/test/unwrapList.test.d.ts +0 -3
- package/dist/types/src/components/builtin/Text/EditableText/ListPlugin/test/unwrapList.test.d.ts.map +0 -1
- package/dist/types/src/components/builtin/Text/EditableText/ListPlugin/test/utils/filterForSubtreeRoots.test.d.ts +0 -2
- package/dist/types/src/components/builtin/Text/EditableText/ListPlugin/test/utils/filterForSubtreeRoots.test.d.ts.map +0 -1
- package/dist/types/src/components/builtin/Text/EditableText/ListPlugin/test/utils/getSelectedListItems.test.d.ts +0 -3
- package/dist/types/src/components/builtin/Text/EditableText/ListPlugin/test/utils/getSelectedListItems.test.d.ts.map +0 -1
- package/dist/types/src/components/builtin/Text/EditableText/ListPlugin/test/wrapList.test.d.ts +0 -3
- package/dist/types/src/components/builtin/Text/EditableText/ListPlugin/test/wrapList.test.d.ts.map +0 -1
- package/dist/types/src/components/builtin/Text/components/Leaf/typography.d.ts +0 -27
- package/dist/types/src/components/builtin/Text/components/Leaf/typography.d.ts.map +0 -1
- package/dist/types/src/controls/rich-text/compare.d.ts +0 -5
- package/dist/types/src/controls/rich-text/compare.d.ts.map +0 -1
- package/dist/types/src/controls/rich-text/compare.test.d.ts +0 -2
- package/dist/types/src/controls/rich-text/compare.test.d.ts.map +0 -1
- package/dist/typography.cjs.js.map +0 -1
- package/dist/typography.es.js.map +0 -1
- /package/dist/types/src/{components/builtin/Text/EditableText → slate}/ListPlugin/constants.d.ts +0 -0
- /package/dist/types/src/{components/builtin/Text/EditableText/ListPlugin/lib → slate/ListPlugin}/dedent.d.ts +0 -0
- /package/dist/types/src/{components/builtin/Text/EditableText/ListPlugin/lib → slate/ListPlugin}/indent.d.ts +0 -0
- /package/dist/types/src/{components/builtin/Text/EditableText/ListPlugin/lib → slate/ListPlugin}/unwrapList.d.ts +0 -0
- /package/dist/types/src/{components/builtin/Text/EditableText/ListPlugin/lib → slate/ListPlugin}/utils/filterForSubtreeRoots.d.ts +0 -0
- /package/dist/types/src/{components/builtin/Text/EditableText/ListPlugin/lib → slate/ListPlugin}/utils/getSelectedListItems.d.ts +0 -0
- /package/dist/types/src/{components/builtin/Text/EditableText/ListPlugin/lib → slate/ListPlugin}/utils/location.d.ts +0 -0
package/dist/index.cjs6.js
CHANGED
|
@@ -37,15 +37,14 @@ var slateReact = require("slate-react");
|
|
|
37
37
|
var css = require("@emotion/css");
|
|
38
38
|
var boxModels = require("./box-models.cjs.js");
|
|
39
39
|
var richText = require("./rich-text.cjs.js");
|
|
40
|
-
var
|
|
40
|
+
var leaf = require("./leaf.cjs.js");
|
|
41
|
+
var next = require("./index.cjs.js");
|
|
41
42
|
var jsxRuntime = require("react/jsx-runtime");
|
|
43
|
+
var index = require("./index.cjs3.js");
|
|
44
|
+
var isHotkey = require("is-hotkey");
|
|
42
45
|
require("use-sync-external-store/shim");
|
|
43
|
-
var next = require("./index.cjs.js");
|
|
44
46
|
require("@emotion/serialize");
|
|
45
47
|
require("@emotion/utils");
|
|
46
|
-
var index = require("./index.cjs3.js");
|
|
47
|
-
var compare = require("./compare.cjs.js");
|
|
48
|
-
var isHotkey = require("is-hotkey");
|
|
49
48
|
require("css-box-model");
|
|
50
49
|
require("./actions.cjs.js");
|
|
51
50
|
require("./introspection.cjs.js");
|
|
@@ -75,23 +74,6 @@ function _interopDefaultLegacy(e) {
|
|
|
75
74
|
return e && typeof e === "object" && "default" in e ? e : { "default": e };
|
|
76
75
|
}
|
|
77
76
|
var isHotkey__default = /* @__PURE__ */ _interopDefaultLegacy(isHotkey);
|
|
78
|
-
function Leaf(_a) {
|
|
79
|
-
var _b = _a, {
|
|
80
|
-
leaf
|
|
81
|
-
} = _b, props = __objRest(_b, [
|
|
82
|
-
"leaf"
|
|
83
|
-
]);
|
|
84
|
-
switch (leaf.type) {
|
|
85
|
-
case richText.TextType.Typography:
|
|
86
|
-
return /* @__PURE__ */ jsxRuntime.jsx(typography.TypographyLeaf, __spreadValues({
|
|
87
|
-
leaf
|
|
88
|
-
}, props));
|
|
89
|
-
default:
|
|
90
|
-
return /* @__PURE__ */ jsxRuntime.jsx("span", __spreadProps(__spreadValues({}, props.attributes), {
|
|
91
|
-
children: props.children
|
|
92
|
-
}));
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
77
|
function BlockElement({
|
|
96
78
|
element,
|
|
97
79
|
attributes,
|
|
@@ -176,10 +158,10 @@ function BlockElement({
|
|
|
176
158
|
}));
|
|
177
159
|
}
|
|
178
160
|
}
|
|
179
|
-
function StyledLink(
|
|
180
|
-
var
|
|
161
|
+
function StyledLink(_a) {
|
|
162
|
+
var _b = _a, {
|
|
181
163
|
className
|
|
182
|
-
} =
|
|
164
|
+
} = _b, restOfProps = __objRest(_b, [
|
|
183
165
|
"className"
|
|
184
166
|
]);
|
|
185
167
|
return /* @__PURE__ */ jsxRuntime.jsx(index.Link, __spreadProps(__spreadValues({}, restOfProps), {
|
|
@@ -213,10 +195,10 @@ function InlineElement({
|
|
|
213
195
|
}));
|
|
214
196
|
}
|
|
215
197
|
}
|
|
216
|
-
function Element(
|
|
217
|
-
var
|
|
198
|
+
function Element(_c) {
|
|
199
|
+
var _d = _c, {
|
|
218
200
|
element
|
|
219
|
-
} =
|
|
201
|
+
} = _d, props = __objRest(_d, [
|
|
220
202
|
"element"
|
|
221
203
|
]);
|
|
222
204
|
switch (element.type) {
|
|
@@ -252,7 +234,7 @@ function useSyncWithBuilder(editor, text) {
|
|
|
252
234
|
if (shouldCommit && text) {
|
|
253
235
|
const nextValue = richText.richTextDTOtoDAO(text);
|
|
254
236
|
const nextSelection = richText.richTextDTOtoSelection(text);
|
|
255
|
-
if (!
|
|
237
|
+
if (!next.deepEqual(editor.children, nextValue) || !next.deepEqual(editor.selection, nextSelection)) {
|
|
256
238
|
editor.children = nextValue;
|
|
257
239
|
editor.selection = nextSelection;
|
|
258
240
|
editor.onChange();
|
|
@@ -271,15 +253,17 @@ function useSyncWithBuilder(editor, text) {
|
|
|
271
253
|
}, [shouldCommit]);
|
|
272
254
|
return React.useCallback(() => setShouldCommit(false), []);
|
|
273
255
|
}
|
|
256
|
+
const LIST_ITEM_CHILD_POSITION = 0;
|
|
257
|
+
const LIST_ITEM_LIST_POSITION = 1;
|
|
274
258
|
const ElementUtils = {
|
|
275
|
-
|
|
276
|
-
return
|
|
259
|
+
isBlock(node) {
|
|
260
|
+
return slate.Element.isElement(node) && (slate.Element.isElementType(node, richText.BlockType.Paragraph) || slate.Element.isElementType(node, richText.BlockType.Heading1) || slate.Element.isElementType(node, richText.BlockType.Heading2) || slate.Element.isElementType(node, richText.BlockType.Heading3) || slate.Element.isElementType(node, richText.BlockType.Heading3) || slate.Element.isElementType(node, richText.BlockType.Heading4) || slate.Element.isElementType(node, richText.BlockType.Heading5) || slate.Element.isElementType(node, richText.BlockType.Heading6) || slate.Element.isElementType(node, richText.BlockType.BlockQuote) || slate.Element.isElementType(node, richText.BlockType.UnorderedList) || slate.Element.isElementType(node, richText.BlockType.OrderedList) || slate.Element.isElementType(node, richText.BlockType.ListItem) || slate.Element.isElementType(node, richText.BlockType.ListItemChild));
|
|
277
261
|
},
|
|
278
|
-
|
|
279
|
-
return slate.Element.isElementType(node, richText.
|
|
262
|
+
isInline(node) {
|
|
263
|
+
return slate.Element.isElement(node) && (slate.Element.isElementType(node, richText.InlineType.Link) || slate.Element.isElementType(node, richText.InlineType.Link) || slate.Element.isElementType(node, richText.InlineType.SubScript) || slate.Element.isElementType(node, richText.InlineType.SuperScript));
|
|
280
264
|
},
|
|
281
|
-
|
|
282
|
-
return
|
|
265
|
+
isConvertibleToListTextNode(node) {
|
|
266
|
+
return !this.isList(node) && !this.isListItem(node) && !this.isListItemChild(node);
|
|
283
267
|
},
|
|
284
268
|
isParagraph(node) {
|
|
285
269
|
return slate.Element.isElementType(node, richText.BlockType.Paragraph);
|
|
@@ -294,7 +278,7 @@ const ElementUtils = {
|
|
|
294
278
|
return slate.Element.isElementType(node, richText.BlockType.ListItemChild);
|
|
295
279
|
},
|
|
296
280
|
createText() {
|
|
297
|
-
return { text: ""
|
|
281
|
+
return { text: "" };
|
|
298
282
|
},
|
|
299
283
|
createParagraph() {
|
|
300
284
|
return {
|
|
@@ -318,36 +302,6 @@ const ElementUtils = {
|
|
|
318
302
|
};
|
|
319
303
|
}
|
|
320
304
|
};
|
|
321
|
-
function wrapList(editor, options = { type: richText.BlockType.UnorderedList }) {
|
|
322
|
-
if (!editor.selection)
|
|
323
|
-
return;
|
|
324
|
-
const nonListEntries = Array.from(slate.Editor.nodes(editor, {
|
|
325
|
-
at: editor.selection,
|
|
326
|
-
match: (node) => {
|
|
327
|
-
return slate.Element.isElement(node) && ElementUtils.isConvertibleToListTextNode(node);
|
|
328
|
-
}
|
|
329
|
-
}));
|
|
330
|
-
const refs = nonListEntries.map(([_, path]) => slate.Editor.pathRef(editor, path));
|
|
331
|
-
refs.forEach((ref) => {
|
|
332
|
-
const path = ref.current;
|
|
333
|
-
if (path) {
|
|
334
|
-
slate.Editor.withoutNormalizing(editor, () => {
|
|
335
|
-
slate.Transforms.setNodes(editor, { type: richText.BlockType.ListItemChild }, {
|
|
336
|
-
at: path
|
|
337
|
-
});
|
|
338
|
-
slate.Transforms.wrapNodes(editor, ElementUtils.createListItem(), {
|
|
339
|
-
at: path
|
|
340
|
-
});
|
|
341
|
-
slate.Transforms.wrapNodes(editor, ElementUtils.createList(options.type), {
|
|
342
|
-
at: path
|
|
343
|
-
});
|
|
344
|
-
});
|
|
345
|
-
}
|
|
346
|
-
ref.unref();
|
|
347
|
-
});
|
|
348
|
-
}
|
|
349
|
-
const LIST_ITEM_CHILD_POSITION = 0;
|
|
350
|
-
const LIST_ITEM_LIST_POSITION = 1;
|
|
351
305
|
const EditorUtils = {
|
|
352
306
|
getFirstAncestorList(editor, path) {
|
|
353
307
|
const parentList = slate.Editor.above(editor, {
|
|
@@ -390,58 +344,6 @@ function getSelectedListItems(editor) {
|
|
|
390
344
|
const firstAncestorPath = (_b = (_a = EditorUtils.getFirstAncestorListItem(editor, start)) == null ? void 0 : _a[1]) != null ? _b : [];
|
|
391
345
|
return Array.from(listItems).filter((node) => slate.Path.isDescendant(start, node[1]) ? slate.Path.equals(node[1], firstAncestorPath) : !slate.Path.isAfter(start, node[1]));
|
|
392
346
|
}
|
|
393
|
-
function unwrapPath(editor, listItemPath) {
|
|
394
|
-
const parentList = EditorUtils.getFirstAncestorList(editor, listItemPath);
|
|
395
|
-
const listItemContainingParentList = EditorUtils.getFirstAncestorListItem(editor, listItemPath);
|
|
396
|
-
if (!parentList || listItemContainingParentList)
|
|
397
|
-
return;
|
|
398
|
-
slate.Editor.withoutNormalizing(editor, () => {
|
|
399
|
-
const listItemTextPath = [...listItemPath, LIST_ITEM_CHILD_POSITION];
|
|
400
|
-
const listItemNestedListPath = [...listItemPath, LIST_ITEM_LIST_POSITION];
|
|
401
|
-
if (slate.Node.has(editor, listItemNestedListPath)) {
|
|
402
|
-
slate.Transforms.setNodes(editor, { type: parentList[0].type }, { at: listItemNestedListPath });
|
|
403
|
-
slate.Transforms.liftNodes(editor, { at: listItemNestedListPath });
|
|
404
|
-
slate.Transforms.liftNodes(editor, { at: slate.Path.next(listItemPath) });
|
|
405
|
-
}
|
|
406
|
-
if (slate.Node.has(editor, listItemTextPath)) {
|
|
407
|
-
slate.Transforms.setNodes(editor, { type: richText.BlockType.Paragraph }, {
|
|
408
|
-
at: listItemTextPath
|
|
409
|
-
});
|
|
410
|
-
slate.Transforms.liftNodes(editor, { at: listItemTextPath });
|
|
411
|
-
slate.Transforms.liftNodes(editor, { at: listItemPath });
|
|
412
|
-
}
|
|
413
|
-
});
|
|
414
|
-
}
|
|
415
|
-
function unwrapList(editor) {
|
|
416
|
-
if (!editor.selection)
|
|
417
|
-
return;
|
|
418
|
-
const listItems = getSelectedListItems(editor);
|
|
419
|
-
const subRoots = filterForSubtreeRoots(listItems);
|
|
420
|
-
const refs = subRoots.map(([_, path]) => slate.Editor.pathRef(editor, path));
|
|
421
|
-
refs.forEach((ref) => {
|
|
422
|
-
if (ref.current) {
|
|
423
|
-
unwrapPath(editor, ref.current);
|
|
424
|
-
}
|
|
425
|
-
ref.unref();
|
|
426
|
-
});
|
|
427
|
-
}
|
|
428
|
-
function toggleList(editor, options = { type: richText.BlockType.UnorderedList }) {
|
|
429
|
-
if (!editor.selection)
|
|
430
|
-
return;
|
|
431
|
-
const start = LocationUtils.getStartPath(editor.selection);
|
|
432
|
-
const ancestorPath = slate.Path.ancestors(start).at(1);
|
|
433
|
-
if (!ancestorPath || !slate.Node.has(editor, ancestorPath))
|
|
434
|
-
return;
|
|
435
|
-
const ancestor = slate.Node.get(editor, ancestorPath);
|
|
436
|
-
if (!ElementUtils.isList(ancestor)) {
|
|
437
|
-
return wrapList(editor, { type: options.type });
|
|
438
|
-
}
|
|
439
|
-
if (ancestor.type === options.type) {
|
|
440
|
-
unwrapList(editor);
|
|
441
|
-
} else {
|
|
442
|
-
slate.Transforms.setNodes(editor, { type: options.type }, { at: ancestorPath });
|
|
443
|
-
}
|
|
444
|
-
}
|
|
445
347
|
function indentPath(editor, path) {
|
|
446
348
|
const parent = slate.Node.parent(editor, path);
|
|
447
349
|
if (!path || !slate.Path.hasPrevious(path) || !ElementUtils.isList(parent))
|
|
@@ -515,6 +417,86 @@ function dedent(editor) {
|
|
|
515
417
|
ref.unref();
|
|
516
418
|
});
|
|
517
419
|
}
|
|
420
|
+
function unwrapPath(editor, listItemPath) {
|
|
421
|
+
const parentList = EditorUtils.getFirstAncestorList(editor, listItemPath);
|
|
422
|
+
const listItemContainingParentList = EditorUtils.getFirstAncestorListItem(editor, listItemPath);
|
|
423
|
+
if (!parentList || listItemContainingParentList)
|
|
424
|
+
return;
|
|
425
|
+
slate.Editor.withoutNormalizing(editor, () => {
|
|
426
|
+
const listItemTextPath = [...listItemPath, LIST_ITEM_CHILD_POSITION];
|
|
427
|
+
const listItemNestedListPath = [...listItemPath, LIST_ITEM_LIST_POSITION];
|
|
428
|
+
if (slate.Node.has(editor, listItemNestedListPath)) {
|
|
429
|
+
slate.Transforms.setNodes(editor, { type: parentList[0].type }, { at: listItemNestedListPath });
|
|
430
|
+
slate.Transforms.liftNodes(editor, { at: listItemNestedListPath });
|
|
431
|
+
slate.Transforms.liftNodes(editor, { at: slate.Path.next(listItemPath) });
|
|
432
|
+
}
|
|
433
|
+
if (slate.Node.has(editor, listItemTextPath)) {
|
|
434
|
+
slate.Transforms.setNodes(editor, { type: richText.BlockType.Paragraph }, {
|
|
435
|
+
at: listItemTextPath
|
|
436
|
+
});
|
|
437
|
+
slate.Transforms.liftNodes(editor, { at: listItemTextPath });
|
|
438
|
+
slate.Transforms.liftNodes(editor, { at: listItemPath });
|
|
439
|
+
}
|
|
440
|
+
});
|
|
441
|
+
}
|
|
442
|
+
function unwrapList(editor) {
|
|
443
|
+
if (!editor.selection)
|
|
444
|
+
return;
|
|
445
|
+
const listItems = getSelectedListItems(editor);
|
|
446
|
+
const subRoots = filterForSubtreeRoots(listItems);
|
|
447
|
+
const refs = subRoots.map(([_, path]) => slate.Editor.pathRef(editor, path));
|
|
448
|
+
refs.forEach((ref) => {
|
|
449
|
+
if (ref.current) {
|
|
450
|
+
unwrapPath(editor, ref.current);
|
|
451
|
+
}
|
|
452
|
+
ref.unref();
|
|
453
|
+
});
|
|
454
|
+
}
|
|
455
|
+
function wrapList(editor, options = { type: richText.BlockType.UnorderedList }) {
|
|
456
|
+
if (!editor.selection)
|
|
457
|
+
return;
|
|
458
|
+
const nonListEntries = Array.from(slate.Editor.nodes(editor, {
|
|
459
|
+
at: editor.selection,
|
|
460
|
+
match: (node) => {
|
|
461
|
+
return slate.Element.isElement(node) && ElementUtils.isConvertibleToListTextNode(node);
|
|
462
|
+
}
|
|
463
|
+
}));
|
|
464
|
+
const refs = nonListEntries.map(([_, path]) => slate.Editor.pathRef(editor, path));
|
|
465
|
+
refs.forEach((ref) => {
|
|
466
|
+
const path = ref.current;
|
|
467
|
+
if (path) {
|
|
468
|
+
slate.Editor.withoutNormalizing(editor, () => {
|
|
469
|
+
slate.Transforms.setNodes(editor, { type: richText.BlockType.ListItemChild }, {
|
|
470
|
+
at: path
|
|
471
|
+
});
|
|
472
|
+
slate.Transforms.wrapNodes(editor, ElementUtils.createListItem(), {
|
|
473
|
+
at: path
|
|
474
|
+
});
|
|
475
|
+
slate.Transforms.wrapNodes(editor, ElementUtils.createList(options.type), {
|
|
476
|
+
at: path
|
|
477
|
+
});
|
|
478
|
+
});
|
|
479
|
+
}
|
|
480
|
+
ref.unref();
|
|
481
|
+
});
|
|
482
|
+
}
|
|
483
|
+
function toggleList(editor, options = { type: richText.BlockType.UnorderedList }) {
|
|
484
|
+
if (!editor.selection)
|
|
485
|
+
return;
|
|
486
|
+
const start = LocationUtils.getStartPath(editor.selection);
|
|
487
|
+
const ancestorPath = slate.Path.ancestors(start).at(1);
|
|
488
|
+
if (!ancestorPath || !slate.Node.has(editor, ancestorPath))
|
|
489
|
+
return;
|
|
490
|
+
const ancestor = slate.Node.get(editor, ancestorPath);
|
|
491
|
+
if (!ElementUtils.isList(ancestor)) {
|
|
492
|
+
return wrapList(editor, { type: options.type });
|
|
493
|
+
}
|
|
494
|
+
if (ancestor.type === options.type) {
|
|
495
|
+
unwrapList(editor);
|
|
496
|
+
} else {
|
|
497
|
+
slate.Transforms.setNodes(editor, { type: options.type }, { at: ancestorPath });
|
|
498
|
+
}
|
|
499
|
+
}
|
|
518
500
|
const List = {
|
|
519
501
|
unwrapList,
|
|
520
502
|
wrapList,
|
|
@@ -581,6 +563,7 @@ function onKeyDown(e, editor) {
|
|
|
581
563
|
}
|
|
582
564
|
}
|
|
583
565
|
function withList(editor) {
|
|
566
|
+
const { normalizeNode } = editor;
|
|
584
567
|
editor.normalizeNode = (entry) => {
|
|
585
568
|
const [normalizationNode, normalizationPath] = entry;
|
|
586
569
|
if (ElementUtils.isListItem(normalizationNode)) {
|
|
@@ -600,18 +583,10 @@ function withList(editor) {
|
|
|
600
583
|
return;
|
|
601
584
|
}
|
|
602
585
|
}
|
|
603
|
-
if (
|
|
604
|
-
Array.from(slate.Node.children(editor, normalizationPath)).forEach(([node, path]) => {
|
|
605
|
-
if (ElementUtils.isText(node)) {
|
|
606
|
-
slate.Transforms.removeNodes(editor, { at: path });
|
|
607
|
-
return;
|
|
608
|
-
}
|
|
609
|
-
});
|
|
610
|
-
}
|
|
611
|
-
if (!ElementUtils.isText(normalizationNode) && !ElementUtils.isTypography(normalizationNode)) {
|
|
586
|
+
if (!slate.Text.isText(normalizationNode)) {
|
|
612
587
|
const mergeableChildren = Array.from(slate.Node.children(editor, normalizationPath)).map((child, index2, children) => {
|
|
613
588
|
const potentialNodeToBeMerged = children.at(index2 + 1);
|
|
614
|
-
if (!potentialNodeToBeMerged || !ElementUtils.isList(potentialNodeToBeMerged[0]) || potentialNodeToBeMerged[0].type !== child[0].type) {
|
|
589
|
+
if (!potentialNodeToBeMerged || !ElementUtils.isList(potentialNodeToBeMerged[0]) || !ElementUtils.isList(child[0]) || potentialNodeToBeMerged[0].type !== child[0].type) {
|
|
615
590
|
return null;
|
|
616
591
|
}
|
|
617
592
|
return [
|
|
@@ -642,13 +617,39 @@ function withList(editor) {
|
|
|
642
617
|
return;
|
|
643
618
|
}
|
|
644
619
|
}
|
|
620
|
+
normalizeNode(entry);
|
|
621
|
+
};
|
|
622
|
+
return editor;
|
|
623
|
+
}
|
|
624
|
+
function withTypography(editor) {
|
|
625
|
+
const { normalizeNode } = editor;
|
|
626
|
+
editor.normalizeNode = (entry) => {
|
|
627
|
+
var _a, _b;
|
|
628
|
+
const [normalizationNode, normalizationPath] = entry;
|
|
629
|
+
if (slate.Text.isText(normalizationNode) && ((_a = normalizationNode == null ? void 0 : normalizationNode.typography) == null ? void 0 : _a.id) == null && ((_b = normalizationNode == null ? void 0 : normalizationNode.typography) == null ? void 0 : _b.style.length) === 0) {
|
|
630
|
+
slate.Transforms.unsetNodes(editor, "typography", { at: normalizationPath });
|
|
631
|
+
return;
|
|
632
|
+
}
|
|
633
|
+
normalizeNode(entry);
|
|
634
|
+
};
|
|
635
|
+
return editor;
|
|
636
|
+
}
|
|
637
|
+
function withBlock(editor) {
|
|
638
|
+
const { normalizeNode } = editor;
|
|
639
|
+
editor.normalizeNode = (entry) => {
|
|
640
|
+
var _a;
|
|
641
|
+
const [normalizationNode, normalizationPath] = entry;
|
|
642
|
+
if (ElementUtils.isBlock(normalizationNode) && ((_a = normalizationNode == null ? void 0 : normalizationNode.textAlign) == null ? void 0 : _a.length) == 0) {
|
|
643
|
+
slate.Transforms.unsetNodes(editor, "textAlign", { at: normalizationPath });
|
|
644
|
+
return;
|
|
645
|
+
}
|
|
646
|
+
normalizeNode(entry);
|
|
645
647
|
};
|
|
646
648
|
return editor;
|
|
647
649
|
}
|
|
648
650
|
const defaultText = [{
|
|
649
651
|
type: richText.BlockType.Paragraph,
|
|
650
652
|
children: [{
|
|
651
|
-
type: richText.TextType.Text,
|
|
652
653
|
text: ""
|
|
653
654
|
}]
|
|
654
655
|
}];
|
|
@@ -658,11 +659,20 @@ const EditableText = React.forwardRef(function EditableText2({
|
|
|
658
659
|
width,
|
|
659
660
|
margin
|
|
660
661
|
}, ref) {
|
|
661
|
-
const [editor] = React.useState(() => withList(slateReact.withReact(slate.createEditor())));
|
|
662
|
+
const [editor] = React.useState(() => withBlock(withTypography(withList(slateReact.withReact(slate.createEditor())))));
|
|
662
663
|
const delaySync = useSyncWithBuilder(editor, text);
|
|
663
664
|
const editMode = next.useBuilderEditMode();
|
|
664
665
|
const [propControllers, setPropControllers] = React.useState(null);
|
|
665
666
|
const controller = propControllers == null ? void 0 : propControllers.text;
|
|
667
|
+
React.useEffect(() => {
|
|
668
|
+
if (controller == null)
|
|
669
|
+
return;
|
|
670
|
+
const element = slateReact.ReactEditor.toDOMNode(editor, editor);
|
|
671
|
+
return next.pollBoxModel({
|
|
672
|
+
element,
|
|
673
|
+
onBoxModelChange: (boxModel) => controller.changeBoxModel(boxModel)
|
|
674
|
+
});
|
|
675
|
+
}, [editor, controller]);
|
|
666
676
|
React.useImperativeHandle(ref, () => ({
|
|
667
677
|
getDomNode() {
|
|
668
678
|
return slateReact.ReactEditor.toDOMNode(editor, editor);
|
|
@@ -694,12 +704,13 @@ const EditableText = React.forwardRef(function EditableText2({
|
|
|
694
704
|
onChange: delaySync,
|
|
695
705
|
children: /* @__PURE__ */ jsxRuntime.jsx(slateReact.Editable, {
|
|
696
706
|
id,
|
|
697
|
-
renderLeaf: Leaf,
|
|
707
|
+
renderLeaf: leaf.Leaf,
|
|
698
708
|
renderElement: Element,
|
|
699
709
|
onKeyDown: handleKeyDown,
|
|
700
710
|
onFocus: handleFocus,
|
|
701
711
|
className: css.cx(width, margin),
|
|
702
|
-
readOnly: editMode === richText.BuilderEditMode.INTERACT
|
|
712
|
+
readOnly: editMode === richText.BuilderEditMode.INTERACT,
|
|
713
|
+
placeholder: "Write some text..."
|
|
703
714
|
})
|
|
704
715
|
});
|
|
705
716
|
});
|
package/dist/index.cjs6.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs6.js","sources":["../src/components/builtin/Text/components/Leaf/leaf.tsx","../src/components/builtin/Text/components/Element/block.tsx","../src/components/builtin/Text/components/Element/inline.tsx","../src/components/builtin/Text/components/Element/element.tsx","../src/components/builtin/Text/EditableText/useSyncWithBuilder.tsx","../src/components/builtin/Text/EditableText/ListPlugin/lib/utils/element.ts","../src/components/builtin/Text/EditableText/ListPlugin/lib/wrapList.ts","../src/components/builtin/Text/EditableText/ListPlugin/constants.ts","../src/components/builtin/Text/EditableText/ListPlugin/lib/utils/editor.ts","../src/components/builtin/Text/EditableText/ListPlugin/lib/utils/filterForSubtreeRoots.ts","../src/components/builtin/Text/EditableText/ListPlugin/lib/utils/location.ts","../src/components/builtin/Text/EditableText/ListPlugin/lib/utils/getSelectedListItems.ts","../src/components/builtin/Text/EditableText/ListPlugin/lib/unwrapList.ts","../src/components/builtin/Text/EditableText/ListPlugin/lib/toggleList.ts","../src/components/builtin/Text/EditableText/ListPlugin/lib/indent.ts","../src/components/builtin/Text/EditableText/ListPlugin/lib/dedent.ts","../src/components/builtin/Text/EditableText/ListPlugin/ListPlugin.ts","../src/components/builtin/Text/EditableText/editable-text.tsx"],"sourcesContent":["import { RenderLeafProps } from 'slate-react'\nimport { TextType } from '../../../../../controls'\nimport { TypographyLeaf } from './typography'\n\nexport function Leaf({ leaf, ...props }: RenderLeafProps) {\n switch (leaf.type) {\n case TextType.Typography:\n return <TypographyLeaf leaf={leaf} {...props} />\n\n default:\n return <span {...props.attributes}>{props.children}</span>\n }\n}\n","import { cx } from '@emotion/css'\nimport { RenderElementProps } from 'slate-react'\nimport { Block, BlockType } from '../../../../../controls'\nimport { useStyle } from '../../../../../runtimes/react/use-style'\nimport { responsiveStyle } from '../../../../utils/responsive-style'\n\nexport interface InlineRenderElementProps extends RenderElementProps {\n element: Block\n}\n\nexport function BlockElement({ element, attributes, children }: InlineRenderElementProps) {\n const blockStyles = [\n useStyle({ margin: 0 }),\n useStyle(responsiveStyle([element.textAlign], ([textAlign = 'left']) => ({ textAlign }))),\n ]\n\n switch (element.type) {\n case BlockType.Paragraph:\n return (\n <p {...attributes} className={cx(...blockStyles)}>\n {children}\n </p>\n )\n case BlockType.Heading1:\n return (\n <h1 {...attributes} className={cx(...blockStyles)}>\n {children}\n </h1>\n )\n case BlockType.Heading2:\n return (\n <h2 {...attributes} className={cx(...blockStyles)}>\n {children}\n </h2>\n )\n case BlockType.Heading3:\n return (\n <h3 {...attributes} className={cx(...blockStyles)}>\n {children}\n </h3>\n )\n case BlockType.Heading4:\n return (\n <h4 {...attributes} className={cx(...blockStyles)}>\n {children}\n </h4>\n )\n case BlockType.Heading5:\n return (\n <h5 {...attributes} className={cx(...blockStyles)}>\n {children}\n </h5>\n )\n case BlockType.Heading6:\n return (\n <h6 {...attributes} className={cx(...blockStyles)}>\n {children}\n </h6>\n )\n case BlockType.BlockQuote:\n return (\n <blockquote\n {...attributes}\n className={cx(\n ...blockStyles,\n useStyle({\n padding: '0.5em 10px',\n fontSize: '1.25em',\n fontWeight: '300',\n borderLeft: '5px solid rgba(0, 0, 0, 0.1)',\n }),\n )}\n >\n {children}\n </blockquote>\n )\n case BlockType.OrderedList:\n return (\n <ol {...attributes} className={cx(...blockStyles)} style={{ listStylePosition: 'inside' }}>\n {children}\n </ol>\n )\n case BlockType.UnorderedList:\n return (\n <ul {...attributes} className={cx(...blockStyles)} style={{ listStylePosition: 'inside' }}>\n {children}\n </ul>\n )\n case BlockType.ListItem:\n return (\n <li {...attributes} className={cx(...blockStyles)}>\n {children}\n </li>\n )\n case BlockType.ListItemChild:\n return (\n <span {...attributes} className={cx(...blockStyles)}>\n {children}\n </span>\n )\n }\n}\n","import { cx } from '@emotion/css'\nimport { ComponentPropsWithoutRef } from 'react'\nimport { RenderElementProps } from 'slate-react'\nimport { Inline, InlineType } from '../../../../../controls'\nimport { useStyle } from '../../../../../runtimes/react/use-style'\nimport { Link } from '../../../../shared/Link'\n\nfunction StyledLink({ className, ...restOfProps }: ComponentPropsWithoutRef<typeof Link>) {\n return <Link {...restOfProps} className={cx(useStyle({ textDecoration: 'none' }), className)} />\n}\n\nexport interface InlineRenderElementProps extends RenderElementProps {\n element: Inline\n}\n\nexport function InlineElement({ element, attributes, children }: InlineRenderElementProps) {\n switch (element.type) {\n case InlineType.Code:\n return <code {...attributes}>{children}</code>\n case InlineType.SuperScript:\n return <sup {...attributes}>{children}</sup>\n case InlineType.SubScript:\n return <sub {...attributes}>{children}</sub>\n case InlineType.Link:\n return (\n <StyledLink {...attributes} link={element.link}>\n {children}\n </StyledLink>\n )\n }\n}\n","import { RenderElementProps } from 'slate-react'\nimport { BlockType, InlineType } from '../../../../../controls'\nimport { BlockElement } from './block'\nimport { InlineElement } from './inline'\n\nexport function Element({ element, ...props }: RenderElementProps) {\n switch (element.type) {\n case InlineType.Code:\n case InlineType.SuperScript:\n case InlineType.SubScript:\n case InlineType.Link:\n return <InlineElement element={element} {...props} />\n case BlockType.Paragraph:\n case BlockType.Heading1:\n case BlockType.Heading2:\n case BlockType.Heading3:\n case BlockType.BlockQuote:\n case BlockType.OrderedList:\n case BlockType.UnorderedList:\n case BlockType.ListItem:\n case BlockType.ListItemChild:\n return <BlockElement element={element} {...props} />\n default:\n return <span {...props.attributes}>{props.children}</span>\n }\n}\n","import { useState, useEffect, useCallback } from 'react'\nimport { Editor } from 'slate'\nimport {\n compareRichTextDAO,\n compareRichTextSelection,\n richTextDTOtoDAO,\n richTextDTOtoSelection,\n} from '../../../../controls'\nimport { RichTextValue } from '../../../../prop-controllers'\n\nconst COMMIT_DEBOUNCE_DELAY = 500\n\n/**\n * Compare new prop value with current editor and update editor\n * if the values are not equal. \n */\nexport function useSyncWithBuilder(editor: Editor, text?: RichTextValue) {\n const [shouldCommit, setShouldCommit] = useState(true)\n\n useEffect(() => {\n if (shouldCommit && text) {\n const nextValue = richTextDTOtoDAO(text)\n const nextSelection = richTextDTOtoSelection(text)\n if (\n !compareRichTextDAO(editor.children, nextValue) ||\n !compareRichTextSelection(editor.selection, nextSelection)\n ) {\n editor.children = nextValue\n editor.selection = nextSelection\n editor.onChange()\n }\n }\n }, [editor, shouldCommit, text])\n\n useEffect(() => {\n if (shouldCommit) return\n\n const timeoutId = window.setTimeout(() => {\n setShouldCommit(true)\n }, COMMIT_DEBOUNCE_DELAY)\n\n return () => {\n window.clearTimeout(timeoutId)\n }\n }, [shouldCommit])\n\n return useCallback(() => setShouldCommit(false), [])\n}\n","import { Node, Element, Text } from 'slate'\nimport {\n TextType,\n BlockType,\n Block,\n ParagraphElement,\n OrderedListElement,\n UnorderedListElement,\n ListItemElement,\n ListItemChildElement,\n} from '../../../../../../../controls'\n\nexport const ElementUtils = {\n isConvertibleToListTextNode(node: Node) {\n return (\n !this.isList(node) &&\n !this.isListItem(node) &&\n !this.isListItemChild(node) &&\n !this.isText(node) &&\n !this.isTypography(node)\n )\n },\n isText(node: Node) {\n return Element.isElementType(node, TextType.Text) || Text.isText(node)\n },\n isTypography(node: Node) {\n return Element.isElementType(node, TextType.Typography)\n },\n isParagraph(node: Node): node is ParagraphElement {\n return Element.isElementType(node, BlockType.Paragraph)\n },\n isList(node: Node): node is OrderedListElement | UnorderedListElement {\n return (\n Element.isElementType(node, BlockType.OrderedList) ||\n Element.isElementType(node, BlockType.UnorderedList)\n )\n },\n isListItem(node: Node): node is ListItemElement {\n return Element.isElementType(node, BlockType.ListItem)\n },\n isListItemChild(node: Node): node is ListItemChildElement {\n return Element.isElementType(node, BlockType.ListItemChild)\n },\n createText() {\n return { text: '', type: TextType.Text }\n },\n createParagraph() {\n return {\n children: [this.createText()],\n type: BlockType.Paragraph,\n }\n },\n createList(type: BlockType = BlockType.UnorderedList): Block {\n return { children: [this.createText()], type }\n },\n createListItem(): Block {\n return {\n children: [this.createListItemChild()],\n type: BlockType.ListItem,\n }\n },\n createListItemChild(): Block {\n return {\n children: [this.createText()],\n type: BlockType.ListItemChild,\n }\n },\n}\n","import { Editor, Element, Transforms } from 'slate'\nimport { BlockType } from '../../../../../../controls'\nimport { ElementUtils } from './utils/element'\n\ntype WrapListOptions = {\n type: typeof BlockType.UnorderedList | typeof BlockType.OrderedList\n}\n\nexport function wrapList(\n editor: Editor,\n options: WrapListOptions = { type: BlockType.UnorderedList },\n) {\n if (!editor.selection) return\n\n const nonListEntries = Array.from(\n Editor.nodes(editor, {\n at: editor.selection,\n match: node => {\n return Element.isElement(node) && ElementUtils.isConvertibleToListTextNode(node)\n },\n }),\n )\n\n const refs = nonListEntries.map(([_, path]) => Editor.pathRef(editor, path))\n\n refs.forEach(ref => {\n const path = ref.current\n if (path) {\n Editor.withoutNormalizing(editor, () => {\n Transforms.setNodes(\n editor,\n { type: BlockType.ListItemChild },\n {\n at: path,\n },\n )\n Transforms.wrapNodes(editor, ElementUtils.createListItem(), {\n at: path,\n })\n Transforms.wrapNodes(editor, ElementUtils.createList(options.type), {\n at: path,\n })\n })\n }\n ref.unref()\n })\n}\n","export const LIST_ITEM_CHILD_POSITION = 0\nexport const LIST_ITEM_LIST_POSITION = 1\n","import { Path, Editor, NodeEntry } from 'slate'\nimport { ListElement, ListItemElement } from '../../../../../../../controls'\nimport { ElementUtils } from './element'\n\nexport const EditorUtils = {\n getFirstAncestorList(editor: Editor, path: Path): NodeEntry<ListElement> | null {\n const parentList = Editor.above(editor, {\n at: path,\n match: (node): node is ListElement => ElementUtils.isList(node),\n })\n return parentList ?? null\n },\n getFirstAncestorListItem(editor: Editor, path: Path): NodeEntry<ListItemElement> | null {\n const parentListItem = Editor.above(editor, {\n at: path,\n match: (node): node is ListItemElement => ElementUtils.isListItem(node),\n })\n\n return parentListItem ?? null\n },\n}\n","import type { Node, NodeEntry } from 'slate'\nimport { Path } from 'slate'\n\nexport function filterForSubtreeRoots(entries: NodeEntry<Node>[]): NodeEntry<Node>[] {\n return entries.filter(\n ([, nodePath]) =>\n !Path.ancestors(nodePath).some(ancestor => {\n return entries.some(([, path]) => Path.equals(path, ancestor))\n }),\n )\n}\n","import { Range, Point, Path, Location } from 'slate'\n\nexport const LocationUtils = {\n getStartPath(location: Location): Path {\n if (Range.isRange(location)) return Range.start(location).path\n if (Point.isPoint(location)) return location.path\n return location\n },\n}\n","import type { Element, NodeEntry } from 'slate'\nimport { Editor, Path } from 'slate'\nimport { EditorUtils } from './editor'\nimport { ElementUtils } from './element'\nimport { LocationUtils } from './location'\n\nexport function getSelectedListItems(editor: Editor): NodeEntry<Element>[] {\n if (!editor.selection) return []\n\n const start = LocationUtils.getStartPath(editor.selection)\n const listItems = Editor.nodes(editor, {\n at: editor.selection,\n match: node => ElementUtils.isListItem(node),\n })\n const firstAncestorPath = EditorUtils.getFirstAncestorListItem(editor, start)?.[1] ?? []\n\n return Array.from(listItems).filter((node): node is NodeEntry<Element> =>\n Path.isDescendant(start, node[1])\n ? Path.equals(node[1], firstAncestorPath)\n : !Path.isAfter(start, node[1]),\n )\n}\n\nexport function getSelectedLists(editor: Editor): NodeEntry<Element>[] {\n if (!editor.selection) return []\n\n const start = LocationUtils.getStartPath(editor.selection)\n const lists = Editor.nodes(editor, {\n at: editor.selection,\n match: node => ElementUtils.isList(node),\n })\n const firstAncestorPath = EditorUtils.getFirstAncestorList(editor, start)?.[1] ?? []\n\n return Array.from(lists).filter((node): node is NodeEntry<Element> =>\n Path.isDescendant(start, node[1])\n ? Path.equals(node[1], firstAncestorPath)\n : !Path.isAfter(start, node[1]),\n )\n}\n","import { Editor, Transforms, Path, Node } from 'slate'\nimport { BlockType } from '../../../../../../controls'\nimport { LIST_ITEM_CHILD_POSITION, LIST_ITEM_LIST_POSITION } from '../constants'\nimport { EditorUtils } from './utils/editor'\nimport { filterForSubtreeRoots } from './utils/filterForSubtreeRoots'\nimport { getSelectedListItems } from './utils/getSelectedListItems'\n\nexport function unwrapPath(editor: Editor, listItemPath: Path) {\n const parentList = EditorUtils.getFirstAncestorList(editor, listItemPath)\n const listItemContainingParentList = EditorUtils.getFirstAncestorListItem(editor, listItemPath)\n //if this is a nested item we don't want to unwrap it\n if (!parentList || listItemContainingParentList) return\n\n Editor.withoutNormalizing(editor, () => {\n const listItemTextPath = [...listItemPath, LIST_ITEM_CHILD_POSITION]\n const listItemNestedListPath = [...listItemPath, LIST_ITEM_LIST_POSITION]\n\n if (Node.has(editor, listItemNestedListPath)) {\n Transforms.setNodes(editor, { type: parentList[0].type }, { at: listItemNestedListPath })\n Transforms.liftNodes(editor, { at: listItemNestedListPath })\n Transforms.liftNodes(editor, { at: Path.next(listItemPath) })\n }\n\n if (Node.has(editor, listItemTextPath)) {\n Transforms.setNodes(\n editor,\n { type: BlockType.Paragraph },\n {\n at: listItemTextPath,\n },\n )\n Transforms.liftNodes(editor, { at: listItemTextPath })\n Transforms.liftNodes(editor, { at: listItemPath })\n }\n })\n}\n\nexport function unwrapList(editor: Editor) {\n if (!editor.selection) return\n\n const listItems = getSelectedListItems(editor)\n const subRoots = filterForSubtreeRoots(listItems)\n const refs = subRoots.map(([_, path]) => Editor.pathRef(editor, path))\n\n refs.forEach(ref => {\n if (ref.current) {\n unwrapPath(editor, ref.current)\n }\n ref.unref()\n })\n}\n","import { Editor, Node, Path, Transforms } from 'slate'\nimport { BlockType } from '../../../../../../controls'\nimport { unwrapList } from './unwrapList'\nimport { ElementUtils } from './utils/element'\nimport { LocationUtils } from './utils/location'\nimport { wrapList } from './wrapList'\n\ntype ToggleListOptions = {\n type: typeof BlockType.UnorderedList | typeof BlockType.OrderedList\n}\n\nexport function toggleList(\n editor: Editor,\n options: ToggleListOptions = { type: BlockType.UnorderedList },\n) {\n if (!editor.selection) return\n const start = LocationUtils.getStartPath(editor.selection)\n const ancestorPath = Path.ancestors(start).at(1)\n if (!ancestorPath || !Node.has(editor, ancestorPath)) return\n const ancestor = Node.get(editor, ancestorPath)\n\n if (!ElementUtils.isList(ancestor)) {\n return wrapList(editor, { type: options.type })\n }\n\n if (ancestor.type === options.type) {\n unwrapList(editor)\n } else {\n Transforms.setNodes(editor, { type: options.type }, { at: ancestorPath })\n }\n}\n","import { Editor, Node, Path, Transforms } from 'slate'\nimport { LIST_ITEM_LIST_POSITION } from '../constants'\nimport { ElementUtils } from './utils/element'\nimport { filterForSubtreeRoots } from './utils/filterForSubtreeRoots'\nimport { getSelectedListItems } from './utils/getSelectedListItems'\n\nexport function indentPath(editor: Editor, path: Path) {\n const parent = Node.parent(editor, path)\n if (!path || !Path.hasPrevious(path) || !ElementUtils.isList(parent) ) return\n\n \n const previosPath = Path.previous(path)\n\n const previousChildListPath = [...previosPath, LIST_ITEM_LIST_POSITION]\n const previousHasChildList = Node.has(editor, previousChildListPath)\n\n Editor.withoutNormalizing(editor, () => {\n if (!previousHasChildList) {\n Transforms.insertNodes(editor, ElementUtils.createList(parent.type), {\n at: previousChildListPath,\n })\n }\n\n const previousChildList = Node.get(editor, previousChildListPath)\n\n if (ElementUtils.isList(previousChildList)) {\n const index = previousHasChildList ? previousChildList.children.length : 0\n Transforms.moveNodes(editor, {\n at: path,\n to: [...previousChildListPath, index],\n })\n }\n })\n}\n\nexport function indent(editor: Editor) {\n if (!editor.selection) return\n\n const listItems = getSelectedListItems(editor)\n const subRoots = filterForSubtreeRoots(listItems)\n const refs = subRoots.map(([_, path]) => Editor.pathRef(editor, path))\n\n refs.forEach(ref => {\n if (ref.current) {\n indentPath(editor, ref.current)\n }\n ref.unref()\n })\n}\n","import { Editor, Path, Transforms } from 'slate'\nimport { indentPath } from './indent'\nimport { getSelectedListItems } from './utils/getSelectedListItems'\nimport { filterForSubtreeRoots } from './utils/filterForSubtreeRoots'\nimport { EditorUtils } from './utils/editor'\n\nfunction dedentPath(editor: Editor, listItemPath: Path) {\n const parentList = EditorUtils.getFirstAncestorList(editor, listItemPath)\n const listItemContainingParentList = EditorUtils.getFirstAncestorListItem(editor, listItemPath)\n if (!parentList || !listItemContainingParentList) return\n\n const [parentListNode, parentListPath] = parentList\n const [_, listItemContainingParentListPath] = listItemContainingParentList\n\n const listItemPosition = listItemPath[listItemPath.length - 1]\n const previousSiblings = parentListNode.children.slice(0, listItemPosition)\n const nextSiblings = parentListNode.children.slice(listItemPosition + 1)\n\n Editor.withoutNormalizing(editor, () => {\n // put next siblings into list item\n nextSiblings.forEach(() => {\n const nextSiblingPath = [...parentListPath, listItemPosition + 1]\n indentPath(editor, nextSiblingPath)\n })\n // move list item to parent list\n Transforms.moveNodes(editor, {\n at: listItemPath,\n to: Path.next(listItemContainingParentListPath),\n })\n // delete old parent list if there are no other list items\n if (previousSiblings.length === 0) {\n Transforms.removeNodes(editor, { at: parentListPath })\n }\n })\n}\n\nexport function dedent(editor: Editor) {\n if (!editor.selection) return\n\n const listItems = getSelectedListItems(editor)\n const subRoots = filterForSubtreeRoots(listItems)\n const refs = subRoots.map(([_, path]) => Editor.pathRef(editor, path))\n\n refs.forEach(ref => {\n if (ref.current) {\n dedentPath(editor, ref.current)\n }\n ref.unref()\n })\n}\n","import type { KeyboardEvent } from 'react'\nimport { Editor, Transforms, Range, Node, PathRef } from 'slate'\nimport isHotkey from 'is-hotkey'\nimport { ElementUtils } from './lib/utils/element'\nimport { unwrapList, wrapList, indent, dedent, toggleList } from './lib'\nimport { EditorUtils } from './lib/utils/editor'\nimport { LIST_ITEM_CHILD_POSITION } from './constants'\nimport { BlockType } from '../../../../../controls'\n\nexport const List = {\n unwrapList,\n wrapList,\n indent,\n dedent,\n toggleList,\n}\n\nexport function onKeyDown(e: KeyboardEvent, editor: Editor) {\n if (\n !editor.selection ||\n Array.from(Editor.nodes(editor, { match: node => ElementUtils.isListItem(node) })).length === 0\n )\n return\n\n if (isHotkey('shift+tab', e)) {\n e.preventDefault()\n List.dedent(editor)\n }\n\n if (isHotkey('tab', e)) {\n e.preventDefault()\n List.indent(editor)\n }\n\n if (isHotkey('backspace', e)) {\n if (!editor.selection) return\n if (Range.isExpanded(editor.selection)) return\n const listItem = EditorUtils.getFirstAncestorListItem(editor, editor.selection.anchor.path)\n if (editor.selection.anchor.offset === 0 && listItem) {\n e.preventDefault()\n const parentListItem = EditorUtils.getFirstAncestorListItem(editor, listItem[1])\n const list = EditorUtils.getFirstAncestorList(editor, listItem[1])\n\n if (parentListItem) {\n List.dedent(editor)\n } else if (list) {\n List.unwrapList(editor)\n }\n return\n }\n }\n\n if (isHotkey('enter', e)) {\n e.preventDefault()\n\n if (!editor.selection) return\n\n if (Range.isExpanded(editor.selection)) {\n Transforms.delete(editor)\n return\n }\n\n const listItem = EditorUtils.getFirstAncestorListItem(editor, editor.selection.anchor.path)\n if (\n editor.selection.anchor.offset === 0 &&\n listItem &&\n Editor.string(editor, listItem[1]) === ''\n ) {\n const parentListItem = EditorUtils.getFirstAncestorListItem(editor, listItem[1])\n\n if (parentListItem) {\n List.dedent(editor)\n } else {\n List.unwrapList(editor)\n }\n return\n }\n\n Transforms.splitNodes(editor, {\n at: editor.selection,\n always: true,\n match: node => ElementUtils.isListItem(node),\n })\n }\n\n if (isHotkey('shift+enter', e)) {\n e.preventDefault()\n editor.insertText('\\n')\n }\n}\n\nexport function withList(editor: Editor) {\n editor.normalizeNode = entry => {\n const [normalizationNode, normalizationPath] = entry\n\n // Normalization for converting children of list items to list item children\n // In the case of backspace from position 0 of node into a list this converts the node into a list item.\n if (ElementUtils.isListItem(normalizationNode)) {\n const pathToListItemText = [...normalizationPath, LIST_ITEM_CHILD_POSITION]\n\n if (Node.has(editor, pathToListItemText)) {\n const nodeInListItemTextPosition = Node.get(editor, pathToListItemText)\n if (ElementUtils.isParagraph(nodeInListItemTextPosition)) {\n Transforms.setNodes(\n editor,\n { type: BlockType.ListItemChild },\n {\n at: pathToListItemText,\n },\n )\n return\n }\n } else {\n Transforms.insertNodes(editor, ElementUtils.createListItem(), {\n at: pathToListItemText,\n })\n return\n }\n }\n\n // Normalization for removing stray text elements from lists\n if (ElementUtils.isList(normalizationNode)) {\n Array.from(Node.children(editor, normalizationPath)).forEach(([node, path]) => {\n if (ElementUtils.isText(node)) {\n Transforms.removeNodes(editor, { at: path })\n return\n }\n })\n }\n\n // Normalization for merging adjacent lists of the same type\n if (!ElementUtils.isText(normalizationNode) && !ElementUtils.isTypography(normalizationNode)) {\n const mergeableChildren = Array.from(Node.children(editor, normalizationPath))\n .map((child, index, children) => {\n const potentialNodeToBeMerged = children.at(index + 1)\n if (\n !potentialNodeToBeMerged ||\n !ElementUtils.isList(potentialNodeToBeMerged[0]) ||\n potentialNodeToBeMerged[0].type !== child[0].type\n ) {\n return null\n }\n return [\n Editor.pathRef(editor, child[1]),\n Editor.pathRef(editor, potentialNodeToBeMerged[1]),\n ]\n })\n .filter((mergeableNodes): mergeableNodes is PathRef[] => Boolean(mergeableNodes))\n\n if (mergeableChildren.length !== 0) {\n mergeableChildren.reverse().forEach(([nodePathRef, nodeToBeMergedPathRef]) => {\n const nodePath = nodePathRef.current\n const nodeToBeMergedPath = nodeToBeMergedPathRef.current\n if (nodePath == null || nodeToBeMergedPath == null) return\n const nodeChildren = Array.from(Node.children(editor, nodePath))\n const childrenToBeMerged = Array.from(Node.children(editor, nodeToBeMergedPath))\n Editor.withoutNormalizing(editor, () => {\n childrenToBeMerged.forEach(([_, childPath], index) => {\n Transforms.moveNodes(editor, {\n at: childPath,\n to: [...nodePath, nodeChildren.length + index],\n })\n })\n Transforms.removeNodes(editor, { at: nodeToBeMergedPath })\n })\n nodePathRef.unref()\n nodeToBeMergedPathRef.unref()\n })\n return\n }\n }\n }\n\n return editor\n}\n","import {\n forwardRef,\n KeyboardEvent,\n Ref,\n useCallback,\n useEffect,\n useImperativeHandle,\n useMemo,\n useState,\n} from 'react'\n\nimport { createEditor } from 'slate'\nimport { Slate, Editable, withReact, ReactEditor } from 'slate-react'\n\nimport { ElementIDValue, RichTextValue } from '../../../../prop-controllers/descriptors'\nimport { cx } from '@emotion/css'\nimport { DescriptorsPropControllers } from '../../../../prop-controllers/instances'\nimport { Descriptors } from '../../../../runtimes/react/controls/rich-text'\nimport { getBox } from '../../../../box-model'\nimport { PropControllersHandle } from '../../../../state/modules/prop-controller-handles'\nimport { BlockType, RichTextDAO, richTextDTOtoDAO, TextType } from '../../../../controls'\nimport { Leaf } from '../components/Leaf'\nimport { Element } from '../components/Element'\nimport { useSyncWithBuilder } from './useSyncWithBuilder'\nimport { onKeyDown, withList } from './ListPlugin'\nimport isHotkey from 'is-hotkey'\nimport { useBuilderEditMode } from '../../../../runtimes/react'\nimport { BuilderEditMode } from '../../../../state/modules/builder-edit-mode'\n\ntype Props = {\n id?: ElementIDValue\n text?: RichTextValue\n width?: string\n margin?: string\n}\n\nconst defaultText: RichTextDAO = [\n { type: BlockType.Paragraph, children: [{ type: TextType.Text, text: '' }] },\n]\n\nexport const EditableText = forwardRef(function EditableText(\n { id, text, width, margin }: Props,\n ref: Ref<PropControllersHandle<Descriptors>>,\n) {\n const [editor] = useState(() => withList(withReact(createEditor())))\n const delaySync = useSyncWithBuilder(editor, text)\n const editMode = useBuilderEditMode()\n\n const [propControllers, setPropControllers] =\n useState<DescriptorsPropControllers<Descriptors> | null>(null)\n const controller = propControllers?.text\n\n useImperativeHandle(\n ref,\n () => ({\n getDomNode() {\n return ReactEditor.toDOMNode(editor, editor)\n },\n getBoxModel() {\n return getBox(ReactEditor.toDOMNode(editor, editor))\n },\n setPropControllers,\n }),\n [editor, setPropControllers],\n )\n\n const initialValue = useMemo(() => (text ? richTextDTOtoDAO(text) : defaultText), [text])\n\n useEffect(() => {\n controller?.setSlateEditor(editor)\n }, [controller, editor])\n\n const handleFocus = useCallback(() => {\n controller?.focus()\n }, [controller])\n\n const handleKeyDown = useCallback(\n (e: KeyboardEvent) => {\n if (isHotkey('mod+shift+z', e)) return controller?.redo()\n if (isHotkey('mod+z', e)) return controller?.undo()\n if (isHotkey('escape')(e)) return controller?.blur()\n onKeyDown(e, editor)\n },\n [controller, editor],\n )\n\n return (\n <Slate editor={editor} value={initialValue} onChange={delaySync}>\n <Editable\n id={id}\n renderLeaf={Leaf}\n renderElement={Element}\n onKeyDown={handleKeyDown}\n onFocus={handleFocus}\n className={cx(width, margin)}\n readOnly={editMode === BuilderEditMode.INTERACT}\n />\n </Slate>\n )\n})\n\nexport default EditableText\n"],"names":["leaf","props","type","TextType","Typography","TypographyLeaf","attributes","children","element","blockStyles","useStyle","margin","responsiveStyle","textAlign","BlockType","Paragraph","cx","Heading1","Heading2","Heading3","Heading4","Heading5","Heading6","BlockQuote","padding","fontSize","fontWeight","borderLeft","OrderedList","listStylePosition","UnorderedList","ListItem","ListItemChild","className","restOfProps","Link","textDecoration","InlineType","Code","SuperScript","SubScript","link","COMMIT_DEBOUNCE_DELAY","editor","text","shouldCommit","setShouldCommit","useState","useEffect","nextValue","richTextDTOtoDAO","nextSelection","richTextDTOtoSelection","compareRichTextDAO","compareRichTextSelection","selection","onChange","timeoutId","window","setTimeout","clearTimeout","useCallback","Element","Text","Editor","Transforms","Path","Range","Point","Node","isHotkey","defaultText","EditableText","forwardRef","id","width","ref","withList","withReact","createEditor","delaySync","useSyncWithBuilder","editMode","useBuilderEditMode","propControllers","setPropControllers","controller","useImperativeHandle","getDomNode","ReactEditor","toDOMNode","getBoxModel","getBox","initialValue","useMemo","setSlateEditor","handleFocus","focus","handleKeyDown","e","redo","undo","blur","onKeyDown","Slate","Editable","Leaf","BuilderEditMode","INTERACT"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIqB,cAAA,IAAqC;AAArC,eAAEA;AAAAA;AAAAA,MAAF,IAAWC,kBAAX,IAAWA;AAAAA,IAATD;AAAAA;AACbA,UAAAA,KAAKE;AAAAA,SACNC,SAASC,SAAAA;AACZ,4CAAQC,WAAAA,gBAAD;AAAA,QAAgB;AAAA,SAAgBJ,MAAvC;AAAA;AAGO,4CAAA,QAAA,iCAAUA,MAAMK,aAAhB;AAAA,QAAA,UAA6BL,MAAMM;AAAAA,MAAAA,EAA1C;AAAA;AAEL;ACF4B,sBAAA;AAAA,EAAEC;AAAAA,EAASF;AAAAA,EAAYC;AAAAA,GAAsC;AAClFE,QAAAA,cAAc,CAClBC,cAAS;AAAA,IAAEC,QAAQ;AAAA,EAAA,CAAX,GACRD,KAAAA,SAASE,KAAgB,gBAAA,CAACJ,QAAQK,SAAT,GAAqB,CAAC,CAACA,YAAY,YAAa;AAAA,IAAEA;AAAAA,EAAAA,EAAnD,CAAhB,CAFU;AAKZL,UAAAA,QAAQN;AAAAA,SACTY,SAAUC,UAAAA;AACb,kFACST;QAAY,WAAWU,IAAAA,GAAG,GAAGP,WAAJ;AAAA,QAC7BF;AAAAA,MAAAA,EAFL;AAAA,SAKGO,SAAUG,UAAAA;AACb,mFACUX;QAAY,WAAWU,IAAAA,GAAG,GAAGP,WAAJ;AAAA,QAC9BF;AAA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A9B,CAAD;AAAA,IALV;AAAA,IAOL0C;AAAAA,EAEF,IAAA,CAAC1C,QAAQ0C,kBAAT,CAXiB;AAcbQ,QAAAA,eAAeC,cAAQ,MAAOlD,OAAOM,SAAAA,iBAAiBN,IAAD,IAAS2B,aAAc,CAAC3B,IAAD,CAAtD;AAE5BI,QAAAA,UAAU,MAAM;AACdsC,6CAAYS,eAAepD;AAAAA,EAA3B,GACC,CAAC2C,YAAY3C,MAAb,CAFM;AAIHqD,QAAAA,cAAcnC,MAAAA,YAAY,MAAM;AACpCyB,6CAAYW;AAAAA,EAAZ,GACC,CAACX,UAAD,CAF4B;AAIzBY,QAAAA,gBAAgBrC,kBACpB,CAACsC,MAAqB;AAChB7B,QAAAA,kBAAAA,WAAS,eAAe6B,CAAhB;AAAoB,aAAOb,yCAAYc;AAC/C9B,QAAAA,kBAAAA,WAAS,SAAS6B,CAAV;AAAc,aAAOb,yCAAYe;AACzC/B,QAAAA,kBAAAA,WAAS,QAAD,EAAW6B,CAAnB;AAAuB,aAAOb,yCAAYgB;AAC9CC,cAAUJ,GAAGxD,MAAJ;AAAA,EAAA,GAEX,CAAC2C,YAAY3C,MAAb,CAP+B;AAUjC,wCACG6D,WAAAA,OAAD;AAAA,IAAO;AAAA,IAAgB,OAAOX;AAAAA,IAAc,UAAUb;AAAAA,IAAtD,yCACGyB,qBAAD;AAAA,MACE;AAAA,MACA,YAAYC;AAAAA,MACZ,eAAe5C;AAAAA,MACf,WAAWoC;AAAAA,MACX,SAASF;AAAAA,MACT,WAAWhF,IAAAA,GAAG2D,OAAOhE,MAAR;AAAA,MACb,UAAUuE,aAAayB,SAAAA,gBAAgBC;AAAAA,IAAAA,CAPzC;AAAA,EAAA,CAFJ;AAaD,CA3DqC;AA6DtC,IAAA,iBAAepC;;;"}
|
|
1
|
+
{"version":3,"file":"index.cjs6.js","sources":["../src/components/builtin/Text/components/Element/block.tsx","../src/components/builtin/Text/components/Element/inline.tsx","../src/components/builtin/Text/components/Element/element.tsx","../src/components/builtin/Text/EditableText/useSyncWithBuilder.tsx","../src/slate/ListPlugin/constants.ts","../src/slate/utils/element.ts","../src/slate/utils/editor.ts","../src/slate/ListPlugin/utils/filterForSubtreeRoots.ts","../src/slate/ListPlugin/utils/location.ts","../src/slate/ListPlugin/utils/getSelectedListItems.ts","../src/slate/ListPlugin/indent.ts","../src/slate/ListPlugin/dedent.ts","../src/slate/ListPlugin/unwrapList.ts","../src/slate/ListPlugin/wrapList.ts","../src/slate/ListPlugin/toggleList.ts","../src/slate/ListPlugin/index.ts","../src/slate/TypographyPlugin/index.ts","../src/slate/BlockPlugin/index.ts","../src/components/builtin/Text/EditableText/editable-text.tsx"],"sourcesContent":["import { cx } from '@emotion/css'\nimport { RenderElementProps } from 'slate-react'\nimport { Block, BlockType } from '../../../../../controls'\nimport { useStyle } from '../../../../../runtimes/react/use-style'\nimport { responsiveStyle } from '../../../../utils/responsive-style'\n\nexport interface InlineRenderElementProps extends RenderElementProps {\n element: Block\n}\n\nexport function BlockElement({ element, attributes, children }: InlineRenderElementProps) {\n const blockStyles = [\n useStyle({ margin: 0 }),\n useStyle(responsiveStyle([element.textAlign], ([textAlign = 'left']) => ({ textAlign }))),\n ]\n\n switch (element.type) {\n case BlockType.Paragraph:\n return (\n <p {...attributes} className={cx(...blockStyles)}>\n {children}\n </p>\n )\n case BlockType.Heading1:\n return (\n <h1 {...attributes} className={cx(...blockStyles)}>\n {children}\n </h1>\n )\n case BlockType.Heading2:\n return (\n <h2 {...attributes} className={cx(...blockStyles)}>\n {children}\n </h2>\n )\n case BlockType.Heading3:\n return (\n <h3 {...attributes} className={cx(...blockStyles)}>\n {children}\n </h3>\n )\n case BlockType.Heading4:\n return (\n <h4 {...attributes} className={cx(...blockStyles)}>\n {children}\n </h4>\n )\n case BlockType.Heading5:\n return (\n <h5 {...attributes} className={cx(...blockStyles)}>\n {children}\n </h5>\n )\n case BlockType.Heading6:\n return (\n <h6 {...attributes} className={cx(...blockStyles)}>\n {children}\n </h6>\n )\n case BlockType.BlockQuote:\n return (\n <blockquote\n {...attributes}\n className={cx(\n ...blockStyles,\n useStyle({\n padding: '0.5em 10px',\n fontSize: '1.25em',\n fontWeight: '300',\n borderLeft: '5px solid rgba(0, 0, 0, 0.1)',\n }),\n )}\n >\n {children}\n </blockquote>\n )\n case BlockType.OrderedList:\n return (\n <ol {...attributes} className={cx(...blockStyles)} style={{ listStylePosition: 'inside' }}>\n {children}\n </ol>\n )\n case BlockType.UnorderedList:\n return (\n <ul {...attributes} className={cx(...blockStyles)} style={{ listStylePosition: 'inside' }}>\n {children}\n </ul>\n )\n case BlockType.ListItem:\n return (\n <li {...attributes} className={cx(...blockStyles)}>\n {children}\n </li>\n )\n case BlockType.ListItemChild:\n return (\n <span {...attributes} className={cx(...blockStyles)}>\n {children}\n </span>\n )\n }\n}\n","import { cx } from '@emotion/css'\nimport { ComponentPropsWithoutRef } from 'react'\nimport { RenderElementProps } from 'slate-react'\nimport { Inline, InlineType } from '../../../../../controls'\nimport { useStyle } from '../../../../../runtimes/react/use-style'\nimport { Link } from '../../../../shared/Link'\n\nfunction StyledLink({ className, ...restOfProps }: ComponentPropsWithoutRef<typeof Link>) {\n return <Link {...restOfProps} className={cx(useStyle({ textDecoration: 'none' }), className)} />\n}\n\nexport interface InlineRenderElementProps extends RenderElementProps {\n element: Inline\n}\n\nexport function InlineElement({ element, attributes, children }: InlineRenderElementProps) {\n switch (element.type) {\n case InlineType.Code:\n return <code {...attributes}>{children}</code>\n case InlineType.SuperScript:\n return <sup {...attributes}>{children}</sup>\n case InlineType.SubScript:\n return <sub {...attributes}>{children}</sub>\n case InlineType.Link:\n return (\n <StyledLink {...attributes} link={element.link}>\n {children}\n </StyledLink>\n )\n }\n}\n","import { RenderElementProps } from 'slate-react'\nimport { BlockType, InlineType } from '../../../../../controls'\nimport { BlockElement } from './block'\nimport { InlineElement } from './inline'\n\nexport function Element({ element, ...props }: RenderElementProps) {\n switch (element.type) {\n case InlineType.Code:\n case InlineType.SuperScript:\n case InlineType.SubScript:\n case InlineType.Link:\n return <InlineElement element={element} {...props} />\n case BlockType.Paragraph:\n case BlockType.Heading1:\n case BlockType.Heading2:\n case BlockType.Heading3:\n case BlockType.BlockQuote:\n case BlockType.OrderedList:\n case BlockType.UnorderedList:\n case BlockType.ListItem:\n case BlockType.ListItemChild:\n return <BlockElement element={element} {...props} />\n default:\n return <span {...props.attributes}>{props.children}</span>\n }\n}\n","import { useState, useEffect, useCallback } from 'react'\nimport { Editor } from 'slate'\nimport { richTextDTOtoDAO, richTextDTOtoSelection } from '../../../../controls'\nimport { RichTextValue } from '../../../../prop-controllers'\nimport deepEqual from '../../../../utils/deepEqual'\n\nconst COMMIT_DEBOUNCE_DELAY = 500\n\n/**\n * Compare new prop value with current editor and update editor\n * if the values are not equal.\n */\nexport function useSyncWithBuilder(editor: Editor, text?: RichTextValue) {\n const [shouldCommit, setShouldCommit] = useState(true)\n\n useEffect(() => {\n if (shouldCommit && text) {\n const nextValue = richTextDTOtoDAO(text)\n const nextSelection = richTextDTOtoSelection(text)\n if (!deepEqual(editor.children, nextValue) || !deepEqual(editor.selection, nextSelection)) {\n editor.children = nextValue\n editor.selection = nextSelection\n editor.onChange()\n }\n }\n }, [editor, shouldCommit, text])\n\n useEffect(() => {\n if (shouldCommit) return\n\n const timeoutId = window.setTimeout(() => {\n setShouldCommit(true)\n }, COMMIT_DEBOUNCE_DELAY)\n\n return () => {\n window.clearTimeout(timeoutId)\n }\n }, [shouldCommit])\n\n return useCallback(() => setShouldCommit(false), [])\n}\n","export const LIST_ITEM_CHILD_POSITION = 0\nexport const LIST_ITEM_LIST_POSITION = 1\n","import { Node, Element } from 'slate'\nimport {\n BlockType,\n Block,\n ParagraphElement,\n OrderedListElement,\n UnorderedListElement,\n ListItemElement,\n ListItemChildElement,\n Inline,\n InlineType,\n} from '../../controls'\n\nexport const ElementUtils = {\n isBlock(node: Node): node is Block {\n return (\n Element.isElement(node) &&\n (Element.isElementType(node, BlockType.Paragraph) ||\n Element.isElementType(node, BlockType.Heading1) ||\n Element.isElementType(node, BlockType.Heading2) ||\n Element.isElementType(node, BlockType.Heading3) ||\n Element.isElementType(node, BlockType.Heading3) ||\n Element.isElementType(node, BlockType.Heading4) ||\n Element.isElementType(node, BlockType.Heading5) ||\n Element.isElementType(node, BlockType.Heading6) ||\n Element.isElementType(node, BlockType.BlockQuote) ||\n Element.isElementType(node, BlockType.UnorderedList) ||\n Element.isElementType(node, BlockType.OrderedList) ||\n Element.isElementType(node, BlockType.ListItem) ||\n Element.isElementType(node, BlockType.ListItemChild))\n )\n },\n isInline(node: Node): node is Inline {\n return (\n Element.isElement(node) &&\n (Element.isElementType(node, InlineType.Link) ||\n Element.isElementType(node, InlineType.Link) ||\n Element.isElementType(node, InlineType.SubScript) ||\n Element.isElementType(node, InlineType.SuperScript))\n )\n },\n isConvertibleToListTextNode(node: Node) {\n return !this.isList(node) && !this.isListItem(node) && !this.isListItemChild(node)\n },\n isParagraph(node: Node): node is ParagraphElement {\n return Element.isElementType(node, BlockType.Paragraph)\n },\n isList(node: Node): node is OrderedListElement | UnorderedListElement {\n return (\n Element.isElementType(node, BlockType.OrderedList) ||\n Element.isElementType(node, BlockType.UnorderedList)\n )\n },\n isListItem(node: Node): node is ListItemElement {\n return Element.isElementType(node, BlockType.ListItem)\n },\n isListItemChild(node: Node): node is ListItemChildElement {\n return Element.isElementType(node, BlockType.ListItemChild)\n },\n createText() {\n return { text: '' }\n },\n createParagraph() {\n return {\n children: [this.createText()],\n type: BlockType.Paragraph,\n }\n },\n createList(type: BlockType = BlockType.UnorderedList): Block {\n return { children: [this.createText()], type }\n },\n createListItem(): Block {\n return {\n children: [this.createListItemChild()],\n type: BlockType.ListItem,\n }\n },\n createListItemChild(): Block {\n return {\n children: [this.createText()],\n type: BlockType.ListItemChild,\n }\n },\n}\n","import { Path, Editor, NodeEntry } from 'slate'\nimport { ListElement, ListItemElement } from '../../controls'\nimport { ElementUtils } from './element'\n\nexport const EditorUtils = {\n getFirstAncestorList(editor: Editor, path: Path): NodeEntry<ListElement> | null {\n const parentList = Editor.above(editor, {\n at: path,\n match: (node): node is ListElement => ElementUtils.isList(node),\n })\n return parentList ?? null\n },\n getFirstAncestorListItem(editor: Editor, path: Path): NodeEntry<ListItemElement> | null {\n const parentListItem = Editor.above(editor, {\n at: path,\n match: (node): node is ListItemElement => ElementUtils.isListItem(node),\n })\n\n return parentListItem ?? null\n },\n}\n","import type { Node, NodeEntry } from 'slate'\nimport { Path } from 'slate'\n\nexport function filterForSubtreeRoots(entries: NodeEntry<Node>[]): NodeEntry<Node>[] {\n return entries.filter(\n ([, nodePath]) =>\n !Path.ancestors(nodePath).some(ancestor => {\n return entries.some(([, path]) => Path.equals(path, ancestor))\n }),\n )\n}\n","import { Range, Point, Path, Location } from 'slate'\n\nexport const LocationUtils = {\n getStartPath(location: Location): Path {\n if (Range.isRange(location)) return Range.start(location).path\n if (Point.isPoint(location)) return location.path\n return location\n },\n}\n","import type { Element, NodeEntry } from 'slate'\nimport { Editor, Path } from 'slate'\nimport { EditorUtils } from '../../utils/editor'\nimport { ElementUtils } from '../../utils/element'\nimport { LocationUtils } from './location'\n\nexport function getSelectedListItems(editor: Editor): NodeEntry<Element>[] {\n if (!editor.selection) return []\n\n const start = LocationUtils.getStartPath(editor.selection)\n const listItems = Editor.nodes(editor, {\n at: editor.selection,\n match: node => ElementUtils.isListItem(node),\n })\n const firstAncestorPath = EditorUtils.getFirstAncestorListItem(editor, start)?.[1] ?? []\n\n return Array.from(listItems).filter((node): node is NodeEntry<Element> =>\n Path.isDescendant(start, node[1])\n ? Path.equals(node[1], firstAncestorPath)\n : !Path.isAfter(start, node[1]),\n )\n}\n\nexport function getSelectedLists(editor: Editor): NodeEntry<Element>[] {\n if (!editor.selection) return []\n\n const start = LocationUtils.getStartPath(editor.selection)\n const lists = Editor.nodes(editor, {\n at: editor.selection,\n match: node => ElementUtils.isList(node),\n })\n const firstAncestorPath = EditorUtils.getFirstAncestorList(editor, start)?.[1] ?? []\n\n return Array.from(lists).filter((node): node is NodeEntry<Element> =>\n Path.isDescendant(start, node[1])\n ? Path.equals(node[1], firstAncestorPath)\n : !Path.isAfter(start, node[1]),\n )\n}\n","import { Editor, Node, Path, Transforms } from 'slate'\nimport { ElementUtils } from '../utils/element'\nimport { LIST_ITEM_LIST_POSITION } from './constants'\nimport { filterForSubtreeRoots } from './utils/filterForSubtreeRoots'\nimport { getSelectedListItems } from './utils/getSelectedListItems'\n\nexport function indentPath(editor: Editor, path: Path) {\n const parent = Node.parent(editor, path)\n if (!path || !Path.hasPrevious(path) || !ElementUtils.isList(parent)) return\n\n const previosPath = Path.previous(path)\n\n const previousChildListPath = [...previosPath, LIST_ITEM_LIST_POSITION]\n const previousHasChildList = Node.has(editor, previousChildListPath)\n\n Editor.withoutNormalizing(editor, () => {\n if (!previousHasChildList) {\n Transforms.insertNodes(editor, ElementUtils.createList(parent.type), {\n at: previousChildListPath,\n })\n }\n\n const previousChildList = Node.get(editor, previousChildListPath)\n\n if (ElementUtils.isList(previousChildList)) {\n const index = previousHasChildList ? previousChildList.children.length : 0\n Transforms.moveNodes(editor, {\n at: path,\n to: [...previousChildListPath, index],\n })\n }\n })\n}\n\nexport function indent(editor: Editor) {\n if (!editor.selection) return\n\n const listItems = getSelectedListItems(editor)\n const subRoots = filterForSubtreeRoots(listItems)\n const refs = subRoots.map(([_, path]) => Editor.pathRef(editor, path))\n\n refs.forEach(ref => {\n if (ref.current) {\n indentPath(editor, ref.current)\n }\n ref.unref()\n })\n}\n","import { Editor, Path, Transforms } from 'slate'\nimport { indentPath } from './indent'\nimport { getSelectedListItems } from './utils/getSelectedListItems'\nimport { filterForSubtreeRoots } from './utils/filterForSubtreeRoots'\nimport { EditorUtils } from '../utils/editor'\n\nfunction dedentPath(editor: Editor, listItemPath: Path) {\n const parentList = EditorUtils.getFirstAncestorList(editor, listItemPath)\n const listItemContainingParentList = EditorUtils.getFirstAncestorListItem(editor, listItemPath)\n if (!parentList || !listItemContainingParentList) return\n\n const [parentListNode, parentListPath] = parentList\n const [_, listItemContainingParentListPath] = listItemContainingParentList\n\n const listItemPosition = listItemPath[listItemPath.length - 1]\n const previousSiblings = parentListNode.children.slice(0, listItemPosition)\n const nextSiblings = parentListNode.children.slice(listItemPosition + 1)\n\n Editor.withoutNormalizing(editor, () => {\n // put next siblings into list item\n nextSiblings.forEach(() => {\n const nextSiblingPath = [...parentListPath, listItemPosition + 1]\n indentPath(editor, nextSiblingPath)\n })\n // move list item to parent list\n Transforms.moveNodes(editor, {\n at: listItemPath,\n to: Path.next(listItemContainingParentListPath),\n })\n // delete old parent list if there are no other list items\n if (previousSiblings.length === 0) {\n Transforms.removeNodes(editor, { at: parentListPath })\n }\n })\n}\n\nexport function dedent(editor: Editor) {\n if (!editor.selection) return\n\n const listItems = getSelectedListItems(editor)\n const subRoots = filterForSubtreeRoots(listItems)\n const refs = subRoots.map(([_, path]) => Editor.pathRef(editor, path))\n\n refs.forEach(ref => {\n if (ref.current) {\n dedentPath(editor, ref.current)\n }\n ref.unref()\n })\n}\n","import { Editor, Transforms, Path, Node } from 'slate'\nimport { BlockType } from '../../controls'\nimport { EditorUtils } from '../utils/editor'\nimport { LIST_ITEM_CHILD_POSITION, LIST_ITEM_LIST_POSITION } from './constants'\nimport { filterForSubtreeRoots } from './utils/filterForSubtreeRoots'\nimport { getSelectedListItems } from './utils/getSelectedListItems'\n\nexport function unwrapPath(editor: Editor, listItemPath: Path) {\n const parentList = EditorUtils.getFirstAncestorList(editor, listItemPath)\n const listItemContainingParentList = EditorUtils.getFirstAncestorListItem(editor, listItemPath)\n //if this is a nested item we don't want to unwrap it\n if (!parentList || listItemContainingParentList) return\n\n Editor.withoutNormalizing(editor, () => {\n const listItemTextPath = [...listItemPath, LIST_ITEM_CHILD_POSITION]\n const listItemNestedListPath = [...listItemPath, LIST_ITEM_LIST_POSITION]\n\n if (Node.has(editor, listItemNestedListPath)) {\n Transforms.setNodes(editor, { type: parentList[0].type }, { at: listItemNestedListPath })\n Transforms.liftNodes(editor, { at: listItemNestedListPath })\n Transforms.liftNodes(editor, { at: Path.next(listItemPath) })\n }\n\n if (Node.has(editor, listItemTextPath)) {\n Transforms.setNodes(\n editor,\n { type: BlockType.Paragraph },\n {\n at: listItemTextPath,\n },\n )\n Transforms.liftNodes(editor, { at: listItemTextPath })\n Transforms.liftNodes(editor, { at: listItemPath })\n }\n })\n}\n\nexport function unwrapList(editor: Editor) {\n if (!editor.selection) return\n\n const listItems = getSelectedListItems(editor)\n const subRoots = filterForSubtreeRoots(listItems)\n const refs = subRoots.map(([_, path]) => Editor.pathRef(editor, path))\n\n refs.forEach(ref => {\n if (ref.current) {\n unwrapPath(editor, ref.current)\n }\n ref.unref()\n })\n}\n","import { Editor, Element, Transforms } from 'slate'\nimport { BlockType } from '../../controls'\nimport { ElementUtils } from '../utils/element'\n\ntype WrapListOptions = {\n type: typeof BlockType.UnorderedList | typeof BlockType.OrderedList\n}\n\nexport function wrapList(\n editor: Editor,\n options: WrapListOptions = { type: BlockType.UnorderedList },\n) {\n if (!editor.selection) return\n\n const nonListEntries = Array.from(\n Editor.nodes(editor, {\n at: editor.selection,\n match: node => {\n return Element.isElement(node) && ElementUtils.isConvertibleToListTextNode(node)\n },\n }),\n )\n\n const refs = nonListEntries.map(([_, path]) => Editor.pathRef(editor, path))\n\n refs.forEach(ref => {\n const path = ref.current\n if (path) {\n Editor.withoutNormalizing(editor, () => {\n Transforms.setNodes(\n editor,\n { type: BlockType.ListItemChild },\n {\n at: path,\n },\n )\n Transforms.wrapNodes(editor, ElementUtils.createListItem(), {\n at: path,\n })\n Transforms.wrapNodes(editor, ElementUtils.createList(options.type), {\n at: path,\n })\n })\n }\n ref.unref()\n })\n}\n","import { Editor, Node, Path, Transforms } from 'slate'\nimport { BlockType } from '../../controls'\nimport { ElementUtils } from '../utils/element'\nimport { unwrapList } from './unwrapList'\nimport { LocationUtils } from './utils/location'\nimport { wrapList } from './wrapList'\n\ntype ToggleListOptions = {\n type: typeof BlockType.UnorderedList | typeof BlockType.OrderedList\n}\n\nexport function toggleList(\n editor: Editor,\n options: ToggleListOptions = { type: BlockType.UnorderedList },\n) {\n if (!editor.selection) return\n const start = LocationUtils.getStartPath(editor.selection)\n const ancestorPath = Path.ancestors(start).at(1)\n if (!ancestorPath || !Node.has(editor, ancestorPath)) return\n const ancestor = Node.get(editor, ancestorPath)\n\n if (!ElementUtils.isList(ancestor)) {\n return wrapList(editor, { type: options.type })\n }\n\n if (ancestor.type === options.type) {\n unwrapList(editor)\n } else {\n Transforms.setNodes(editor, { type: options.type }, { at: ancestorPath })\n }\n}\n","import type { KeyboardEvent } from 'react'\nimport { Editor, Transforms, Range, Node, PathRef, Text } from 'slate'\nimport isHotkey from 'is-hotkey'\nimport { LIST_ITEM_CHILD_POSITION } from './constants'\nimport { EditorUtils } from '../utils/editor'\nimport { ElementUtils } from '../utils/element'\nimport { dedent } from './dedent'\nimport { indent } from './indent'\nimport { toggleList } from './toggleList'\nimport { unwrapList } from './unwrapList'\nimport { wrapList } from './wrapList'\nimport { BlockType } from '../../controls'\n\nexport const List = {\n unwrapList,\n wrapList,\n indent,\n dedent,\n toggleList,\n}\n\nexport function onKeyDown(e: KeyboardEvent, editor: Editor) {\n if (\n !editor.selection ||\n Array.from(Editor.nodes(editor, { match: node => ElementUtils.isListItem(node) })).length === 0\n )\n return\n\n if (isHotkey('shift+tab', e)) {\n e.preventDefault()\n List.dedent(editor)\n }\n\n if (isHotkey('tab', e)) {\n e.preventDefault()\n List.indent(editor)\n }\n\n if (isHotkey('backspace', e)) {\n if (!editor.selection) return\n if (Range.isExpanded(editor.selection)) return\n const listItem = EditorUtils.getFirstAncestorListItem(editor, editor.selection.anchor.path)\n if (editor.selection.anchor.offset === 0 && listItem) {\n e.preventDefault()\n const parentListItem = EditorUtils.getFirstAncestorListItem(editor, listItem[1])\n const list = EditorUtils.getFirstAncestorList(editor, listItem[1])\n\n if (parentListItem) {\n List.dedent(editor)\n } else if (list) {\n List.unwrapList(editor)\n }\n return\n }\n }\n\n if (isHotkey('enter', e)) {\n e.preventDefault()\n\n if (!editor.selection) return\n\n if (Range.isExpanded(editor.selection)) {\n Transforms.delete(editor)\n return\n }\n\n const listItem = EditorUtils.getFirstAncestorListItem(editor, editor.selection.anchor.path)\n if (\n editor.selection.anchor.offset === 0 &&\n listItem &&\n Editor.string(editor, listItem[1]) === ''\n ) {\n const parentListItem = EditorUtils.getFirstAncestorListItem(editor, listItem[1])\n\n if (parentListItem) {\n List.dedent(editor)\n } else {\n List.unwrapList(editor)\n }\n return\n }\n\n Transforms.splitNodes(editor, {\n at: editor.selection,\n always: true,\n match: node => ElementUtils.isListItem(node),\n })\n }\n\n if (isHotkey('shift+enter', e)) {\n e.preventDefault()\n editor.insertText('\\n')\n }\n}\n\nexport function withList(editor: Editor) {\n const { normalizeNode } = editor\n editor.normalizeNode = entry => {\n const [normalizationNode, normalizationPath] = entry\n\n // Normalization for converting children of list items to list item children\n // In the case of backspace from position 0 of node into a list this converts the node into a list item.\n if (ElementUtils.isListItem(normalizationNode)) {\n const pathToListItemText = [...normalizationPath, LIST_ITEM_CHILD_POSITION]\n\n if (Node.has(editor, pathToListItemText)) {\n const nodeInListItemTextPosition = Node.get(editor, pathToListItemText)\n if (ElementUtils.isParagraph(nodeInListItemTextPosition)) {\n Transforms.setNodes(\n editor,\n { type: BlockType.ListItemChild },\n {\n at: pathToListItemText,\n },\n )\n return\n }\n } else {\n Transforms.insertNodes(editor, ElementUtils.createListItem(), {\n at: pathToListItemText,\n })\n return\n }\n }\n\n // Normalization for merging adjacent lists of the same type\n if (!Text.isText(normalizationNode)) {\n const mergeableChildren = Array.from(Node.children(editor, normalizationPath))\n .map((child, index, children) => {\n const potentialNodeToBeMerged = children.at(index + 1)\n if (\n !potentialNodeToBeMerged ||\n !ElementUtils.isList(potentialNodeToBeMerged[0]) ||\n !ElementUtils.isList(child[0]) ||\n potentialNodeToBeMerged[0].type !== child[0].type\n ) {\n return null\n }\n return [\n Editor.pathRef(editor, child[1]),\n Editor.pathRef(editor, potentialNodeToBeMerged[1]),\n ]\n })\n .filter((mergeableNodes): mergeableNodes is PathRef[] => Boolean(mergeableNodes))\n\n if (mergeableChildren.length !== 0) {\n mergeableChildren.reverse().forEach(([nodePathRef, nodeToBeMergedPathRef]) => {\n const nodePath = nodePathRef.current\n const nodeToBeMergedPath = nodeToBeMergedPathRef.current\n if (nodePath == null || nodeToBeMergedPath == null) return\n const nodeChildren = Array.from(Node.children(editor, nodePath))\n const childrenToBeMerged = Array.from(Node.children(editor, nodeToBeMergedPath))\n Editor.withoutNormalizing(editor, () => {\n childrenToBeMerged.forEach(([_, childPath], index) => {\n Transforms.moveNodes(editor, {\n at: childPath,\n to: [...nodePath, nodeChildren.length + index],\n })\n })\n Transforms.removeNodes(editor, { at: nodeToBeMergedPath })\n })\n nodePathRef.unref()\n nodeToBeMergedPathRef.unref()\n })\n return\n }\n }\n\n normalizeNode(entry)\n }\n\n return editor\n}\n","import { Editor, Text, Transforms } from 'slate'\nimport { clearActiveTypographyStyle } from './clearActiveTypographyStyle'\nimport { clearDeviceActiveTypography } from './clearDeviceActiveTypography'\nimport { detachActiveTypography } from './detachActiveTypography'\nimport { setActiveTypographyId } from './setActiveTypographyId'\nimport { setActiveTypographyStyle } from './setActiveTypographyStyle'\n\nexport const Typography = {\n setActiveTypographyId,\n setActiveTypographyStyle,\n clearActiveTypographyStyle,\n clearDeviceActiveTypography,\n detachActiveTypography,\n}\n\nexport function withTypography(editor: Editor) {\n const { normalizeNode } = editor\n editor.normalizeNode = entry => {\n const [normalizationNode, normalizationPath] = entry\n // Normalization typography with empty style and id to be text\n if (\n Text.isText(normalizationNode) &&\n normalizationNode?.typography?.id == null &&\n normalizationNode?.typography?.style.length === 0\n ) {\n Transforms.unsetNodes(editor, 'typography', { at: normalizationPath })\n return\n }\n\n normalizeNode(entry)\n }\n\n return editor\n}\n","import { Editor, Transforms } from 'slate'\nimport { setBlockKeyForDevice } from './setBlockKeyForDevice'\nimport { clearBlockKeyForDevice } from './clearBlockKeyForDevice'\nimport { ElementUtils } from '../utils/element'\n\nexport const Block = {\n setBlockKeyForDevice: setBlockKeyForDevice,\n clearBlockKeyForDevice: clearBlockKeyForDevice,\n}\n\nexport function withBlock(editor: Editor) {\n const { normalizeNode } = editor\n editor.normalizeNode = entry => {\n const [normalizationNode, normalizationPath] = entry\n // Normalization textAlign with empty array of values\n if (ElementUtils.isBlock(normalizationNode) && normalizationNode?.textAlign?.length == 0) {\n Transforms.unsetNodes(editor, 'textAlign', { at: normalizationPath })\n return\n }\n\n normalizeNode(entry)\n }\n\n return editor\n}\n","import {\n forwardRef,\n KeyboardEvent,\n Ref,\n useCallback,\n useEffect,\n useImperativeHandle,\n useMemo,\n useState,\n} from 'react'\n\nimport { createEditor } from 'slate'\nimport { Slate, Editable, withReact, ReactEditor } from 'slate-react'\n\nimport { ElementIDValue, RichTextValue } from '../../../../prop-controllers/descriptors'\nimport { cx } from '@emotion/css'\nimport { DescriptorsPropControllers } from '../../../../prop-controllers/instances'\nimport { Descriptors } from '../../../../runtimes/react/controls/rich-text'\nimport { getBox } from '../../../../box-model'\nimport { PropControllersHandle } from '../../../../state/modules/prop-controller-handles'\nimport { BlockType, RichTextDAO, richTextDTOtoDAO } from '../../../../controls'\nimport { Leaf } from '../components/Leaf'\nimport { Element } from '../components/Element'\nimport { useSyncWithBuilder } from './useSyncWithBuilder'\nimport isHotkey from 'is-hotkey'\nimport { useBuilderEditMode } from '../../../../runtimes/react'\nimport { BuilderEditMode } from '../../../../state/modules/builder-edit-mode'\nimport { onKeyDown, withBlock, withList, withTypography } from '../../../../slate'\nimport { pollBoxModel } from '../../../../runtimes/react/poll-box-model'\n\ntype Props = {\n id?: ElementIDValue\n text?: RichTextValue\n width?: string\n margin?: string\n}\n\nconst defaultText: RichTextDAO = [{ type: BlockType.Paragraph, children: [{ text: '' }] }]\n\nexport const EditableText = forwardRef(function EditableText(\n { id, text, width, margin }: Props,\n ref: Ref<PropControllersHandle<Descriptors>>,\n) {\n const [editor] = useState(() => withBlock(withTypography(withList(withReact(createEditor())))))\n const delaySync = useSyncWithBuilder(editor, text)\n const editMode = useBuilderEditMode()\n\n const [propControllers, setPropControllers] =\n useState<DescriptorsPropControllers<Descriptors> | null>(null)\n const controller = propControllers?.text\n\n useEffect(() => {\n if (controller == null) return\n\n const element = ReactEditor.toDOMNode(editor, editor)\n\n return pollBoxModel({\n element,\n onBoxModelChange: boxModel => controller.changeBoxModel(boxModel),\n })\n }, [editor, controller])\n\n useImperativeHandle(\n ref,\n () => ({\n getDomNode() {\n return ReactEditor.toDOMNode(editor, editor)\n },\n getBoxModel() {\n return getBox(ReactEditor.toDOMNode(editor, editor))\n },\n setPropControllers,\n }),\n [editor, setPropControllers],\n )\n\n const initialValue = useMemo(() => (text ? richTextDTOtoDAO(text) : defaultText), [text])\n\n useEffect(() => {\n controller?.setSlateEditor(editor)\n }, [controller, editor])\n\n const handleFocus = useCallback(() => {\n controller?.focus()\n }, [controller])\n\n const handleKeyDown = useCallback(\n (e: KeyboardEvent) => {\n if (isHotkey('mod+shift+z', e)) return controller?.redo()\n if (isHotkey('mod+z', e)) return controller?.undo()\n if (isHotkey('escape')(e)) return controller?.blur()\n onKeyDown(e, editor)\n },\n [controller, editor],\n )\n\n return (\n <Slate editor={editor} value={initialValue} onChange={delaySync}>\n <Editable\n id={id}\n renderLeaf={Leaf}\n renderElement={Element}\n onKeyDown={handleKeyDown}\n onFocus={handleFocus}\n className={cx(width, margin)}\n readOnly={editMode === BuilderEditMode.INTERACT}\n placeholder=\"Write some text...\"\n />\n </Slate>\n )\n})\n\nexport default EditableText\n"],"names":["element","attributes","children","blockStyles","useStyle","margin","responsiveStyle","textAlign","type","BlockType","Paragraph","cx","Heading1","Heading2","Heading3","Heading4","Heading5","Heading6","BlockQuote","padding","fontSize","fontWeight","borderLeft","OrderedList","listStylePosition","UnorderedList","ListItem","ListItemChild","className","restOfProps","Link","textDecoration","InlineType","Code","SuperScript","SubScript","link","props","COMMIT_DEBOUNCE_DELAY","editor","text","shouldCommit","setShouldCommit","useState","useEffect","nextValue","richTextDTOtoDAO","nextSelection","richTextDTOtoSelection","deepEqual","selection","onChange","timeoutId","window","setTimeout","clearTimeout","useCallback","Element","Editor","Path","Range","Point","Node","Transforms","isHotkey","Text","defaultText","EditableText","forwardRef","id","width","ref","withBlock","withTypography","withList","withReact","createEditor","delaySync","useSyncWithBuilder","editMode","useBuilderEditMode","propControllers","setPropControllers","controller","ReactEditor","toDOMNode","pollBoxModel","onBoxModelChange","boxModel","changeBoxModel","useImperativeHandle","getDomNode","getBoxModel","getBox","initialValue","useMemo","setSlateEditor","handleFocus","focus","handleKeyDown","e","redo","undo","blur","onKeyDown","Slate","Editable","Leaf","BuilderEditMode","INTERACT"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAU6B,sBAAA;AAAA,EAAEA;AAAAA,EAASC;AAAAA,EAAYC;AAAAA,GAAsC;AAClFC,QAAAA,cAAc,CAClBC,cAAS;AAAA,IAAEC,QAAQ;AAAA,EAAA,CAAX,GACRD,KAAAA,SAASE,KAAgB,gBAAA,CAACN,QAAQO,SAAT,GAAqB,CAAC,CAACA,YAAY,YAAa;AAAA,IAAEA;AAAAA,EAAAA,EAAnD,CAAhB,CAFU;AAKZP,UAAAA,QAAQQ;AAAAA,SACTC,SAAUC,UAAAA;AACb,kFACST;QAAY,WAAWU,IAAAA,GAAG,GAAGR,WAAJ;AAAA,QAC7BD;AAAAA,MAAAA,EAFL;AAAA,SAKGO,SAAUG,UAAAA;AACb,mFACUX;QAAY,WAAWU,IAAAA,GAAG,GAAGR,WAAJ;AAAA,QAC9BD;AAAAA,MAAAA,EAFL;AAAA,SAKGO,SAAUI,UAAAA;AACb,mFACUZ;QAAY,WAAWU,IAAAA,GAAG,GAAGR,WAAJ;AAAA,QAC9BD;AAAAA,MAAAA,EAFL;AAAA,SAKGO,SAAUK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