@limetech/lime-elements 37.16.0 → 37.17.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/dist/cjs/limel-text-editor.cjs.entry.js +255 -195
- package/dist/cjs/limel-text-editor.cjs.entry.js.map +1 -1
- package/dist/collection/components/text-editor/text-editor.css +1 -1
- package/dist/collection/components/text-editor/text-editor.js +2 -1
- package/dist/collection/components/text-editor/text-editor.js.map +1 -1
- package/dist/esm/limel-text-editor.entry.js +255 -195
- package/dist/esm/limel-text-editor.entry.js.map +1 -1
- package/dist/lime-elements/lime-elements.esm.js +1 -1
- package/dist/lime-elements/{p-56a13153.entry.js → p-a44742d3.entry.js} +2 -2
- package/dist/lime-elements/p-a44742d3.entry.js.map +1 -0
- package/package.json +2 -2
- package/dist/lime-elements/p-56a13153.entry.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
## [37.17.1](https://github.com/Lundalogik/lime-elements/compare/v37.17.0...v37.17.1) (2024-04-12)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
* **text-editor:** ensure menubar items won't grow tall ([314dca9](https://github.com/Lundalogik/lime-elements/commit/314dca9c6313ea7bf75d7b85499ac05830019674))
|
|
8
|
+
|
|
9
|
+
## [37.17.0](https://github.com/Lundalogik/lime-elements/compare/v37.16.0...v37.17.0) (2024-04-11)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### Features
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
* **text-editor:** add buttons for lists ([50a1020](https://github.com/Lundalogik/lime-elements/commit/50a1020de0d9e60c37eb333f06d98c8c25efd4e7))
|
|
16
|
+
|
|
1
17
|
## [37.16.0](https://github.com/Lundalogik/lime-elements/compare/v37.15.1...v37.16.0) (2024-04-11)
|
|
2
18
|
|
|
3
19
|
|
|
@@ -12406,6 +12406,259 @@ To reuse elements from this schema, extend or read from its
|
|
|
12406
12406
|
*/
|
|
12407
12407
|
const schema = new Schema({ nodes, marks });
|
|
12408
12408
|
|
|
12409
|
+
const olDOM = ["ol", 0], ulDOM = ["ul", 0], liDOM = ["li", 0];
|
|
12410
|
+
/**
|
|
12411
|
+
An ordered list [node spec](https://prosemirror.net/docs/ref/#model.NodeSpec). Has a single
|
|
12412
|
+
attribute, `order`, which determines the number at which the list
|
|
12413
|
+
starts counting, and defaults to 1. Represented as an `<ol>`
|
|
12414
|
+
element.
|
|
12415
|
+
*/
|
|
12416
|
+
const orderedList = {
|
|
12417
|
+
attrs: { order: { default: 1 } },
|
|
12418
|
+
parseDOM: [{ tag: "ol", getAttrs(dom) {
|
|
12419
|
+
return { order: dom.hasAttribute("start") ? +dom.getAttribute("start") : 1 };
|
|
12420
|
+
} }],
|
|
12421
|
+
toDOM(node) {
|
|
12422
|
+
return node.attrs.order == 1 ? olDOM : ["ol", { start: node.attrs.order }, 0];
|
|
12423
|
+
}
|
|
12424
|
+
};
|
|
12425
|
+
/**
|
|
12426
|
+
A bullet list node spec, represented in the DOM as `<ul>`.
|
|
12427
|
+
*/
|
|
12428
|
+
const bulletList = {
|
|
12429
|
+
parseDOM: [{ tag: "ul" }],
|
|
12430
|
+
toDOM() { return ulDOM; }
|
|
12431
|
+
};
|
|
12432
|
+
/**
|
|
12433
|
+
A list item (`<li>`) spec.
|
|
12434
|
+
*/
|
|
12435
|
+
const listItem = {
|
|
12436
|
+
parseDOM: [{ tag: "li" }],
|
|
12437
|
+
toDOM() { return liDOM; },
|
|
12438
|
+
defining: true
|
|
12439
|
+
};
|
|
12440
|
+
function add$1(obj, props) {
|
|
12441
|
+
let copy = {};
|
|
12442
|
+
for (let prop in obj)
|
|
12443
|
+
copy[prop] = obj[prop];
|
|
12444
|
+
for (let prop in props)
|
|
12445
|
+
copy[prop] = props[prop];
|
|
12446
|
+
return copy;
|
|
12447
|
+
}
|
|
12448
|
+
/**
|
|
12449
|
+
Convenience function for adding list-related node types to a map
|
|
12450
|
+
specifying the nodes for a schema. Adds
|
|
12451
|
+
[`orderedList`](https://prosemirror.net/docs/ref/#schema-list.orderedList) as `"ordered_list"`,
|
|
12452
|
+
[`bulletList`](https://prosemirror.net/docs/ref/#schema-list.bulletList) as `"bullet_list"`, and
|
|
12453
|
+
[`listItem`](https://prosemirror.net/docs/ref/#schema-list.listItem) as `"list_item"`.
|
|
12454
|
+
|
|
12455
|
+
`itemContent` determines the content expression for the list items.
|
|
12456
|
+
If you want the commands defined in this module to apply to your
|
|
12457
|
+
list structure, it should have a shape like `"paragraph block*"` or
|
|
12458
|
+
`"paragraph (ordered_list | bullet_list)*"`. `listGroup` can be
|
|
12459
|
+
given to assign a group name to the list node types, for example
|
|
12460
|
+
`"block"`.
|
|
12461
|
+
*/
|
|
12462
|
+
function addListNodes(nodes, itemContent, listGroup) {
|
|
12463
|
+
return nodes.append({
|
|
12464
|
+
ordered_list: add$1(orderedList, { content: "list_item+", group: listGroup }),
|
|
12465
|
+
bullet_list: add$1(bulletList, { content: "list_item+", group: listGroup }),
|
|
12466
|
+
list_item: add$1(listItem, { content: itemContent })
|
|
12467
|
+
});
|
|
12468
|
+
}
|
|
12469
|
+
/**
|
|
12470
|
+
Returns a command function that wraps the selection in a list with
|
|
12471
|
+
the given type an attributes. If `dispatch` is null, only return a
|
|
12472
|
+
value to indicate whether this is possible, but don't actually
|
|
12473
|
+
perform the change.
|
|
12474
|
+
*/
|
|
12475
|
+
function wrapInList(listType, attrs = null) {
|
|
12476
|
+
return function (state, dispatch) {
|
|
12477
|
+
let { $from, $to } = state.selection;
|
|
12478
|
+
let range = $from.blockRange($to), doJoin = false, outerRange = range;
|
|
12479
|
+
if (!range)
|
|
12480
|
+
return false;
|
|
12481
|
+
// This is at the top of an existing list item
|
|
12482
|
+
if (range.depth >= 2 && $from.node(range.depth - 1).type.compatibleContent(listType) && range.startIndex == 0) {
|
|
12483
|
+
// Don't do anything if this is the top of the list
|
|
12484
|
+
if ($from.index(range.depth - 1) == 0)
|
|
12485
|
+
return false;
|
|
12486
|
+
let $insert = state.doc.resolve(range.start - 2);
|
|
12487
|
+
outerRange = new NodeRange($insert, $insert, range.depth);
|
|
12488
|
+
if (range.endIndex < range.parent.childCount)
|
|
12489
|
+
range = new NodeRange($from, state.doc.resolve($to.end(range.depth)), range.depth);
|
|
12490
|
+
doJoin = true;
|
|
12491
|
+
}
|
|
12492
|
+
let wrap = findWrapping(outerRange, listType, attrs, range);
|
|
12493
|
+
if (!wrap)
|
|
12494
|
+
return false;
|
|
12495
|
+
if (dispatch)
|
|
12496
|
+
dispatch(doWrapInList(state.tr, range, wrap, doJoin, listType).scrollIntoView());
|
|
12497
|
+
return true;
|
|
12498
|
+
};
|
|
12499
|
+
}
|
|
12500
|
+
function doWrapInList(tr, range, wrappers, joinBefore, listType) {
|
|
12501
|
+
let content = Fragment.empty;
|
|
12502
|
+
for (let i = wrappers.length - 1; i >= 0; i--)
|
|
12503
|
+
content = Fragment.from(wrappers[i].type.create(wrappers[i].attrs, content));
|
|
12504
|
+
tr.step(new ReplaceAroundStep(range.start - (joinBefore ? 2 : 0), range.end, range.start, range.end, new Slice(content, 0, 0), wrappers.length, true));
|
|
12505
|
+
let found = 0;
|
|
12506
|
+
for (let i = 0; i < wrappers.length; i++)
|
|
12507
|
+
if (wrappers[i].type == listType)
|
|
12508
|
+
found = i + 1;
|
|
12509
|
+
let splitDepth = wrappers.length - found;
|
|
12510
|
+
let splitPos = range.start + wrappers.length - (joinBefore ? 2 : 0), parent = range.parent;
|
|
12511
|
+
for (let i = range.startIndex, e = range.endIndex, first = true; i < e; i++, first = false) {
|
|
12512
|
+
if (!first && canSplit(tr.doc, splitPos, splitDepth)) {
|
|
12513
|
+
tr.split(splitPos, splitDepth);
|
|
12514
|
+
splitPos += 2 * splitDepth;
|
|
12515
|
+
}
|
|
12516
|
+
splitPos += parent.child(i).nodeSize;
|
|
12517
|
+
}
|
|
12518
|
+
return tr;
|
|
12519
|
+
}
|
|
12520
|
+
/**
|
|
12521
|
+
Build a command that splits a non-empty textblock at the top level
|
|
12522
|
+
of a list item by also splitting that list item.
|
|
12523
|
+
*/
|
|
12524
|
+
function splitListItem(itemType, itemAttrs) {
|
|
12525
|
+
return function (state, dispatch) {
|
|
12526
|
+
let { $from, $to, node } = state.selection;
|
|
12527
|
+
if ((node && node.isBlock) || $from.depth < 2 || !$from.sameParent($to))
|
|
12528
|
+
return false;
|
|
12529
|
+
let grandParent = $from.node(-1);
|
|
12530
|
+
if (grandParent.type != itemType)
|
|
12531
|
+
return false;
|
|
12532
|
+
if ($from.parent.content.size == 0 && $from.node(-1).childCount == $from.indexAfter(-1)) {
|
|
12533
|
+
// In an empty block. If this is a nested list, the wrapping
|
|
12534
|
+
// list item should be split. Otherwise, bail out and let next
|
|
12535
|
+
// command handle lifting.
|
|
12536
|
+
if ($from.depth == 3 || $from.node(-3).type != itemType ||
|
|
12537
|
+
$from.index(-2) != $from.node(-2).childCount - 1)
|
|
12538
|
+
return false;
|
|
12539
|
+
if (dispatch) {
|
|
12540
|
+
let wrap = Fragment.empty;
|
|
12541
|
+
let depthBefore = $from.index(-1) ? 1 : $from.index(-2) ? 2 : 3;
|
|
12542
|
+
// Build a fragment containing empty versions of the structure
|
|
12543
|
+
// from the outer list item to the parent node of the cursor
|
|
12544
|
+
for (let d = $from.depth - depthBefore; d >= $from.depth - 3; d--)
|
|
12545
|
+
wrap = Fragment.from($from.node(d).copy(wrap));
|
|
12546
|
+
let depthAfter = $from.indexAfter(-1) < $from.node(-2).childCount ? 1
|
|
12547
|
+
: $from.indexAfter(-2) < $from.node(-3).childCount ? 2 : 3;
|
|
12548
|
+
// Add a second list item with an empty default start node
|
|
12549
|
+
wrap = wrap.append(Fragment.from(itemType.createAndFill()));
|
|
12550
|
+
let start = $from.before($from.depth - (depthBefore - 1));
|
|
12551
|
+
let tr = state.tr.replace(start, $from.after(-depthAfter), new Slice(wrap, 4 - depthBefore, 0));
|
|
12552
|
+
let sel = -1;
|
|
12553
|
+
tr.doc.nodesBetween(start, tr.doc.content.size, (node, pos) => {
|
|
12554
|
+
if (sel > -1)
|
|
12555
|
+
return false;
|
|
12556
|
+
if (node.isTextblock && node.content.size == 0)
|
|
12557
|
+
sel = pos + 1;
|
|
12558
|
+
});
|
|
12559
|
+
if (sel > -1)
|
|
12560
|
+
tr.setSelection(Selection.near(tr.doc.resolve(sel)));
|
|
12561
|
+
dispatch(tr.scrollIntoView());
|
|
12562
|
+
}
|
|
12563
|
+
return true;
|
|
12564
|
+
}
|
|
12565
|
+
let nextType = $to.pos == $from.end() ? grandParent.contentMatchAt(0).defaultType : null;
|
|
12566
|
+
let tr = state.tr.delete($from.pos, $to.pos);
|
|
12567
|
+
let types = nextType ? [itemAttrs ? { type: itemType, attrs: itemAttrs } : null, { type: nextType }] : undefined;
|
|
12568
|
+
if (!canSplit(tr.doc, $from.pos, 2, types))
|
|
12569
|
+
return false;
|
|
12570
|
+
if (dispatch)
|
|
12571
|
+
dispatch(tr.split($from.pos, 2, types).scrollIntoView());
|
|
12572
|
+
return true;
|
|
12573
|
+
};
|
|
12574
|
+
}
|
|
12575
|
+
/**
|
|
12576
|
+
Create a command to lift the list item around the selection up into
|
|
12577
|
+
a wrapping list.
|
|
12578
|
+
*/
|
|
12579
|
+
function liftListItem(itemType) {
|
|
12580
|
+
return function (state, dispatch) {
|
|
12581
|
+
let { $from, $to } = state.selection;
|
|
12582
|
+
let range = $from.blockRange($to, node => node.childCount > 0 && node.firstChild.type == itemType);
|
|
12583
|
+
if (!range)
|
|
12584
|
+
return false;
|
|
12585
|
+
if (!dispatch)
|
|
12586
|
+
return true;
|
|
12587
|
+
if ($from.node(range.depth - 1).type == itemType) // Inside a parent list
|
|
12588
|
+
return liftToOuterList(state, dispatch, itemType, range);
|
|
12589
|
+
else // Outer list node
|
|
12590
|
+
return liftOutOfList(state, dispatch, range);
|
|
12591
|
+
};
|
|
12592
|
+
}
|
|
12593
|
+
function liftToOuterList(state, dispatch, itemType, range) {
|
|
12594
|
+
let tr = state.tr, end = range.end, endOfList = range.$to.end(range.depth);
|
|
12595
|
+
if (end < endOfList) {
|
|
12596
|
+
// There are siblings after the lifted items, which must become
|
|
12597
|
+
// children of the last item
|
|
12598
|
+
tr.step(new ReplaceAroundStep(end - 1, endOfList, end, endOfList, new Slice(Fragment.from(itemType.create(null, range.parent.copy())), 1, 0), 1, true));
|
|
12599
|
+
range = new NodeRange(tr.doc.resolve(range.$from.pos), tr.doc.resolve(endOfList), range.depth);
|
|
12600
|
+
}
|
|
12601
|
+
const target = liftTarget(range);
|
|
12602
|
+
if (target == null)
|
|
12603
|
+
return false;
|
|
12604
|
+
tr.lift(range, target);
|
|
12605
|
+
let after = tr.mapping.map(end, -1) - 1;
|
|
12606
|
+
if (canJoin(tr.doc, after))
|
|
12607
|
+
tr.join(after);
|
|
12608
|
+
dispatch(tr.scrollIntoView());
|
|
12609
|
+
return true;
|
|
12610
|
+
}
|
|
12611
|
+
function liftOutOfList(state, dispatch, range) {
|
|
12612
|
+
let tr = state.tr, list = range.parent;
|
|
12613
|
+
// Merge the list items into a single big item
|
|
12614
|
+
for (let pos = range.end, i = range.endIndex - 1, e = range.startIndex; i > e; i--) {
|
|
12615
|
+
pos -= list.child(i).nodeSize;
|
|
12616
|
+
tr.delete(pos - 1, pos + 1);
|
|
12617
|
+
}
|
|
12618
|
+
let $start = tr.doc.resolve(range.start), item = $start.nodeAfter;
|
|
12619
|
+
if (tr.mapping.map(range.end) != range.start + $start.nodeAfter.nodeSize)
|
|
12620
|
+
return false;
|
|
12621
|
+
let atStart = range.startIndex == 0, atEnd = range.endIndex == list.childCount;
|
|
12622
|
+
let parent = $start.node(-1), indexBefore = $start.index(-1);
|
|
12623
|
+
if (!parent.canReplace(indexBefore + (atStart ? 0 : 1), indexBefore + 1, item.content.append(atEnd ? Fragment.empty : Fragment.from(list))))
|
|
12624
|
+
return false;
|
|
12625
|
+
let start = $start.pos, end = start + item.nodeSize;
|
|
12626
|
+
// Strip off the surrounding list. At the sides where we're not at
|
|
12627
|
+
// the end of the list, the existing list is closed. At sides where
|
|
12628
|
+
// this is the end, it is overwritten to its end.
|
|
12629
|
+
tr.step(new ReplaceAroundStep(start - (atStart ? 1 : 0), end + (atEnd ? 1 : 0), start + 1, end - 1, new Slice((atStart ? Fragment.empty : Fragment.from(list.copy(Fragment.empty)))
|
|
12630
|
+
.append(atEnd ? Fragment.empty : Fragment.from(list.copy(Fragment.empty))), atStart ? 0 : 1, atEnd ? 0 : 1), atStart ? 0 : 1));
|
|
12631
|
+
dispatch(tr.scrollIntoView());
|
|
12632
|
+
return true;
|
|
12633
|
+
}
|
|
12634
|
+
/**
|
|
12635
|
+
Create a command to sink the list item around the selection down
|
|
12636
|
+
into an inner list.
|
|
12637
|
+
*/
|
|
12638
|
+
function sinkListItem(itemType) {
|
|
12639
|
+
return function (state, dispatch) {
|
|
12640
|
+
let { $from, $to } = state.selection;
|
|
12641
|
+
let range = $from.blockRange($to, node => node.childCount > 0 && node.firstChild.type == itemType);
|
|
12642
|
+
if (!range)
|
|
12643
|
+
return false;
|
|
12644
|
+
let startIndex = range.startIndex;
|
|
12645
|
+
if (startIndex == 0)
|
|
12646
|
+
return false;
|
|
12647
|
+
let parent = range.parent, nodeBefore = parent.child(startIndex - 1);
|
|
12648
|
+
if (nodeBefore.type != itemType)
|
|
12649
|
+
return false;
|
|
12650
|
+
if (dispatch) {
|
|
12651
|
+
let nestedBefore = nodeBefore.lastChild && nodeBefore.lastChild.type == parent.type;
|
|
12652
|
+
let inner = Fragment.from(nestedBefore ? itemType.create() : null);
|
|
12653
|
+
let slice = new Slice(Fragment.from(itemType.create(null, Fragment.from(parent.type.create(null, inner)))), nestedBefore ? 3 : 1, 0);
|
|
12654
|
+
let before = range.start, after = range.end;
|
|
12655
|
+
dispatch(state.tr.step(new ReplaceAroundStep(before - (nestedBefore ? 3 : 1), after, before, after, slice, 1, true))
|
|
12656
|
+
.scrollIntoView());
|
|
12657
|
+
}
|
|
12658
|
+
return true;
|
|
12659
|
+
};
|
|
12660
|
+
}
|
|
12661
|
+
|
|
12409
12662
|
var base = {
|
|
12410
12663
|
8: "Backspace",
|
|
12411
12664
|
9: "Tab",
|
|
@@ -14925,199 +15178,6 @@ function getAllWrapping(node) {
|
|
|
14925
15178
|
return res;
|
|
14926
15179
|
}
|
|
14927
15180
|
|
|
14928
|
-
/**
|
|
14929
|
-
Returns a command function that wraps the selection in a list with
|
|
14930
|
-
the given type an attributes. If `dispatch` is null, only return a
|
|
14931
|
-
value to indicate whether this is possible, but don't actually
|
|
14932
|
-
perform the change.
|
|
14933
|
-
*/
|
|
14934
|
-
function wrapInList(listType, attrs = null) {
|
|
14935
|
-
return function (state, dispatch) {
|
|
14936
|
-
let { $from, $to } = state.selection;
|
|
14937
|
-
let range = $from.blockRange($to), doJoin = false, outerRange = range;
|
|
14938
|
-
if (!range)
|
|
14939
|
-
return false;
|
|
14940
|
-
// This is at the top of an existing list item
|
|
14941
|
-
if (range.depth >= 2 && $from.node(range.depth - 1).type.compatibleContent(listType) && range.startIndex == 0) {
|
|
14942
|
-
// Don't do anything if this is the top of the list
|
|
14943
|
-
if ($from.index(range.depth - 1) == 0)
|
|
14944
|
-
return false;
|
|
14945
|
-
let $insert = state.doc.resolve(range.start - 2);
|
|
14946
|
-
outerRange = new NodeRange($insert, $insert, range.depth);
|
|
14947
|
-
if (range.endIndex < range.parent.childCount)
|
|
14948
|
-
range = new NodeRange($from, state.doc.resolve($to.end(range.depth)), range.depth);
|
|
14949
|
-
doJoin = true;
|
|
14950
|
-
}
|
|
14951
|
-
let wrap = findWrapping(outerRange, listType, attrs, range);
|
|
14952
|
-
if (!wrap)
|
|
14953
|
-
return false;
|
|
14954
|
-
if (dispatch)
|
|
14955
|
-
dispatch(doWrapInList(state.tr, range, wrap, doJoin, listType).scrollIntoView());
|
|
14956
|
-
return true;
|
|
14957
|
-
};
|
|
14958
|
-
}
|
|
14959
|
-
function doWrapInList(tr, range, wrappers, joinBefore, listType) {
|
|
14960
|
-
let content = Fragment.empty;
|
|
14961
|
-
for (let i = wrappers.length - 1; i >= 0; i--)
|
|
14962
|
-
content = Fragment.from(wrappers[i].type.create(wrappers[i].attrs, content));
|
|
14963
|
-
tr.step(new ReplaceAroundStep(range.start - (joinBefore ? 2 : 0), range.end, range.start, range.end, new Slice(content, 0, 0), wrappers.length, true));
|
|
14964
|
-
let found = 0;
|
|
14965
|
-
for (let i = 0; i < wrappers.length; i++)
|
|
14966
|
-
if (wrappers[i].type == listType)
|
|
14967
|
-
found = i + 1;
|
|
14968
|
-
let splitDepth = wrappers.length - found;
|
|
14969
|
-
let splitPos = range.start + wrappers.length - (joinBefore ? 2 : 0), parent = range.parent;
|
|
14970
|
-
for (let i = range.startIndex, e = range.endIndex, first = true; i < e; i++, first = false) {
|
|
14971
|
-
if (!first && canSplit(tr.doc, splitPos, splitDepth)) {
|
|
14972
|
-
tr.split(splitPos, splitDepth);
|
|
14973
|
-
splitPos += 2 * splitDepth;
|
|
14974
|
-
}
|
|
14975
|
-
splitPos += parent.child(i).nodeSize;
|
|
14976
|
-
}
|
|
14977
|
-
return tr;
|
|
14978
|
-
}
|
|
14979
|
-
/**
|
|
14980
|
-
Build a command that splits a non-empty textblock at the top level
|
|
14981
|
-
of a list item by also splitting that list item.
|
|
14982
|
-
*/
|
|
14983
|
-
function splitListItem(itemType, itemAttrs) {
|
|
14984
|
-
return function (state, dispatch) {
|
|
14985
|
-
let { $from, $to, node } = state.selection;
|
|
14986
|
-
if ((node && node.isBlock) || $from.depth < 2 || !$from.sameParent($to))
|
|
14987
|
-
return false;
|
|
14988
|
-
let grandParent = $from.node(-1);
|
|
14989
|
-
if (grandParent.type != itemType)
|
|
14990
|
-
return false;
|
|
14991
|
-
if ($from.parent.content.size == 0 && $from.node(-1).childCount == $from.indexAfter(-1)) {
|
|
14992
|
-
// In an empty block. If this is a nested list, the wrapping
|
|
14993
|
-
// list item should be split. Otherwise, bail out and let next
|
|
14994
|
-
// command handle lifting.
|
|
14995
|
-
if ($from.depth == 3 || $from.node(-3).type != itemType ||
|
|
14996
|
-
$from.index(-2) != $from.node(-2).childCount - 1)
|
|
14997
|
-
return false;
|
|
14998
|
-
if (dispatch) {
|
|
14999
|
-
let wrap = Fragment.empty;
|
|
15000
|
-
let depthBefore = $from.index(-1) ? 1 : $from.index(-2) ? 2 : 3;
|
|
15001
|
-
// Build a fragment containing empty versions of the structure
|
|
15002
|
-
// from the outer list item to the parent node of the cursor
|
|
15003
|
-
for (let d = $from.depth - depthBefore; d >= $from.depth - 3; d--)
|
|
15004
|
-
wrap = Fragment.from($from.node(d).copy(wrap));
|
|
15005
|
-
let depthAfter = $from.indexAfter(-1) < $from.node(-2).childCount ? 1
|
|
15006
|
-
: $from.indexAfter(-2) < $from.node(-3).childCount ? 2 : 3;
|
|
15007
|
-
// Add a second list item with an empty default start node
|
|
15008
|
-
wrap = wrap.append(Fragment.from(itemType.createAndFill()));
|
|
15009
|
-
let start = $from.before($from.depth - (depthBefore - 1));
|
|
15010
|
-
let tr = state.tr.replace(start, $from.after(-depthAfter), new Slice(wrap, 4 - depthBefore, 0));
|
|
15011
|
-
let sel = -1;
|
|
15012
|
-
tr.doc.nodesBetween(start, tr.doc.content.size, (node, pos) => {
|
|
15013
|
-
if (sel > -1)
|
|
15014
|
-
return false;
|
|
15015
|
-
if (node.isTextblock && node.content.size == 0)
|
|
15016
|
-
sel = pos + 1;
|
|
15017
|
-
});
|
|
15018
|
-
if (sel > -1)
|
|
15019
|
-
tr.setSelection(Selection.near(tr.doc.resolve(sel)));
|
|
15020
|
-
dispatch(tr.scrollIntoView());
|
|
15021
|
-
}
|
|
15022
|
-
return true;
|
|
15023
|
-
}
|
|
15024
|
-
let nextType = $to.pos == $from.end() ? grandParent.contentMatchAt(0).defaultType : null;
|
|
15025
|
-
let tr = state.tr.delete($from.pos, $to.pos);
|
|
15026
|
-
let types = nextType ? [itemAttrs ? { type: itemType, attrs: itemAttrs } : null, { type: nextType }] : undefined;
|
|
15027
|
-
if (!canSplit(tr.doc, $from.pos, 2, types))
|
|
15028
|
-
return false;
|
|
15029
|
-
if (dispatch)
|
|
15030
|
-
dispatch(tr.split($from.pos, 2, types).scrollIntoView());
|
|
15031
|
-
return true;
|
|
15032
|
-
};
|
|
15033
|
-
}
|
|
15034
|
-
/**
|
|
15035
|
-
Create a command to lift the list item around the selection up into
|
|
15036
|
-
a wrapping list.
|
|
15037
|
-
*/
|
|
15038
|
-
function liftListItem(itemType) {
|
|
15039
|
-
return function (state, dispatch) {
|
|
15040
|
-
let { $from, $to } = state.selection;
|
|
15041
|
-
let range = $from.blockRange($to, node => node.childCount > 0 && node.firstChild.type == itemType);
|
|
15042
|
-
if (!range)
|
|
15043
|
-
return false;
|
|
15044
|
-
if (!dispatch)
|
|
15045
|
-
return true;
|
|
15046
|
-
if ($from.node(range.depth - 1).type == itemType) // Inside a parent list
|
|
15047
|
-
return liftToOuterList(state, dispatch, itemType, range);
|
|
15048
|
-
else // Outer list node
|
|
15049
|
-
return liftOutOfList(state, dispatch, range);
|
|
15050
|
-
};
|
|
15051
|
-
}
|
|
15052
|
-
function liftToOuterList(state, dispatch, itemType, range) {
|
|
15053
|
-
let tr = state.tr, end = range.end, endOfList = range.$to.end(range.depth);
|
|
15054
|
-
if (end < endOfList) {
|
|
15055
|
-
// There are siblings after the lifted items, which must become
|
|
15056
|
-
// children of the last item
|
|
15057
|
-
tr.step(new ReplaceAroundStep(end - 1, endOfList, end, endOfList, new Slice(Fragment.from(itemType.create(null, range.parent.copy())), 1, 0), 1, true));
|
|
15058
|
-
range = new NodeRange(tr.doc.resolve(range.$from.pos), tr.doc.resolve(endOfList), range.depth);
|
|
15059
|
-
}
|
|
15060
|
-
const target = liftTarget(range);
|
|
15061
|
-
if (target == null)
|
|
15062
|
-
return false;
|
|
15063
|
-
tr.lift(range, target);
|
|
15064
|
-
let after = tr.mapping.map(end, -1) - 1;
|
|
15065
|
-
if (canJoin(tr.doc, after))
|
|
15066
|
-
tr.join(after);
|
|
15067
|
-
dispatch(tr.scrollIntoView());
|
|
15068
|
-
return true;
|
|
15069
|
-
}
|
|
15070
|
-
function liftOutOfList(state, dispatch, range) {
|
|
15071
|
-
let tr = state.tr, list = range.parent;
|
|
15072
|
-
// Merge the list items into a single big item
|
|
15073
|
-
for (let pos = range.end, i = range.endIndex - 1, e = range.startIndex; i > e; i--) {
|
|
15074
|
-
pos -= list.child(i).nodeSize;
|
|
15075
|
-
tr.delete(pos - 1, pos + 1);
|
|
15076
|
-
}
|
|
15077
|
-
let $start = tr.doc.resolve(range.start), item = $start.nodeAfter;
|
|
15078
|
-
if (tr.mapping.map(range.end) != range.start + $start.nodeAfter.nodeSize)
|
|
15079
|
-
return false;
|
|
15080
|
-
let atStart = range.startIndex == 0, atEnd = range.endIndex == list.childCount;
|
|
15081
|
-
let parent = $start.node(-1), indexBefore = $start.index(-1);
|
|
15082
|
-
if (!parent.canReplace(indexBefore + (atStart ? 0 : 1), indexBefore + 1, item.content.append(atEnd ? Fragment.empty : Fragment.from(list))))
|
|
15083
|
-
return false;
|
|
15084
|
-
let start = $start.pos, end = start + item.nodeSize;
|
|
15085
|
-
// Strip off the surrounding list. At the sides where we're not at
|
|
15086
|
-
// the end of the list, the existing list is closed. At sides where
|
|
15087
|
-
// this is the end, it is overwritten to its end.
|
|
15088
|
-
tr.step(new ReplaceAroundStep(start - (atStart ? 1 : 0), end + (atEnd ? 1 : 0), start + 1, end - 1, new Slice((atStart ? Fragment.empty : Fragment.from(list.copy(Fragment.empty)))
|
|
15089
|
-
.append(atEnd ? Fragment.empty : Fragment.from(list.copy(Fragment.empty))), atStart ? 0 : 1, atEnd ? 0 : 1), atStart ? 0 : 1));
|
|
15090
|
-
dispatch(tr.scrollIntoView());
|
|
15091
|
-
return true;
|
|
15092
|
-
}
|
|
15093
|
-
/**
|
|
15094
|
-
Create a command to sink the list item around the selection down
|
|
15095
|
-
into an inner list.
|
|
15096
|
-
*/
|
|
15097
|
-
function sinkListItem(itemType) {
|
|
15098
|
-
return function (state, dispatch) {
|
|
15099
|
-
let { $from, $to } = state.selection;
|
|
15100
|
-
let range = $from.blockRange($to, node => node.childCount > 0 && node.firstChild.type == itemType);
|
|
15101
|
-
if (!range)
|
|
15102
|
-
return false;
|
|
15103
|
-
let startIndex = range.startIndex;
|
|
15104
|
-
if (startIndex == 0)
|
|
15105
|
-
return false;
|
|
15106
|
-
let parent = range.parent, nodeBefore = parent.child(startIndex - 1);
|
|
15107
|
-
if (nodeBefore.type != itemType)
|
|
15108
|
-
return false;
|
|
15109
|
-
if (dispatch) {
|
|
15110
|
-
let nestedBefore = nodeBefore.lastChild && nodeBefore.lastChild.type == parent.type;
|
|
15111
|
-
let inner = Fragment.from(nestedBefore ? itemType.create() : null);
|
|
15112
|
-
let slice = new Slice(Fragment.from(itemType.create(null, Fragment.from(parent.type.create(null, inner)))), nestedBefore ? 3 : 1, 0);
|
|
15113
|
-
let before = range.start, after = range.end;
|
|
15114
|
-
dispatch(state.tr.step(new ReplaceAroundStep(before - (nestedBefore ? 3 : 1), after, before, after, slice, 1, true))
|
|
15115
|
-
.scrollIntoView());
|
|
15116
|
-
}
|
|
15117
|
-
return true;
|
|
15118
|
-
};
|
|
15119
|
-
}
|
|
15120
|
-
|
|
15121
15181
|
/**
|
|
15122
15182
|
Input rules are regular expressions describing a piece of text
|
|
15123
15183
|
that, when typed, causes something to happen. This might be
|
|
@@ -15849,7 +15909,7 @@ function exampleSetup(options) {
|
|
|
15849
15909
|
}));
|
|
15850
15910
|
}
|
|
15851
15911
|
|
|
15852
|
-
const textEditorCss = "@charset \"UTF-8\";:host{--mdc-theme-primary:var(\n --lime-primary-color,\n rgb(var(--color-teal-default))\n );--mdc-theme-secondary:var(\n --lime-secondary-color,\n rgb(var(--contrast-1100))\n );--mdc-theme-on-primary:var(\n --lime-on-primary-color,\n rgb(var(--contrast-100))\n );--mdc-theme-on-secondary:var(\n --lime-on-secondary-color,\n rgb(var(--contrast-100))\n );--mdc-theme-text-disabled-on-background:var(\n --lime-text-disabled-on-background-color,\n rgba(var(--contrast-1700), 0.38)\n );--mdc-theme-text-primary-on-background:var(\n --lime-text-primary-on-background-color,\n rgba(var(--contrast-1700), 0.87)\n );--mdc-theme-text-secondary-on-background:var(\n --lime-text-secondary-on-background-color,\n rgba(var(--contrast-1700), 0.54)\n );--mdc-theme-error:var(\n --lime-error-background-color,\n rgb(var(--color-red-dark))\n );--lime-error-text-color:rgb(var(--color-red-darker));--mdc-theme-surface:var(\n --lime-surface-background-color,\n rgb(var(--contrast-100))\n );--mdc-theme-on-surface:var(\n --lime-on-surface-color,\n rgb(var(--contrast-1500))\n )}:host(limel-text-editor){isolation:isolate;display:block}*{box-sizing:border-box}.ProseMirror-menubar-wrapper{transition:border 0.2s ease;display:grid;grid-template-rows:auto 1fr;border-radius:0.25rem;border:1px solid;border-color:rgba(var(--contrast-700), 0.65)}.ProseMirror-menubar-wrapper:hover{border-color:rgba(var(--contrast-700), 1)}.ProseMirror-menubar-wrapper:focus-within{border-color:var(--mdc-theme-primary)}.ProseMirror-textblock-dropdown{min-width:3em}.ProseMirror-tooltip .ProseMirror-menu{width:-webkit-fit-content;width:fit-content;white-space:pre}.ProseMirror{position:relative;word-wrap:break-word;white-space:pre-wrap;white-space:break-spaces;-webkit-font-variant-ligatures:none;font-variant-ligatures:none;font-feature-settings:\"liga\" 0;border-bottom-left-radius:0.5rem;border-bottom-right-radius:0.5rem;padding:0.5rem 1rem;background-color:rgb(var(--contrast-100))}.ProseMirror [draggable][contenteditable=false]{user-select:text}.ProseMirror:focus-visible{outline:none}.ProseMirror-hideselection{caret-color:transparent}.ProseMirror-hideselection *::selection{background:transparent}.ProseMirror-hideselection *::-moz-selection{background:transparent}.ProseMirror-selectednode{outline:0.125rem solid rgb(var(--color-sky-light))}li.ProseMirror-selectednode{outline:none}li.ProseMirror-selectednode:after{content:\"\";position:absolute;left:-2rem;right:-0.125rem;top:-0.125rem;bottom:-0.125rem;border:0.125rem solid rgb(var(--color-sky-light));pointer-events:none}img.ProseMirror-separator{display:inline !important;border:none !important;margin:0 !important}div#editor .ProseMirror-menubar{position:sticky !important;z-index:1;top:0}div#editor .ProseMirror-menubar[style*=\"position: fixed\"]{box-shadow:0 0.25rem 0.5rem -0.5rem rgb(var(--color-black), 0.8)}.ProseMirror-menubar{position:relative;z-index:1;display:flex;flex-wrap:wrap;gap:0.25rem;align-items:center;padding:0.125rem;background-color:rgb(var(--contrast-100));border-top-left-radius:0.5rem;border-top-right-radius:0.5rem}.ProseMirror-menuitem{position:relative;flex-shrink:0;display:flex;align-items:center;justify-content:center;white-space:nowrap;line-height:1;
|
|
15912
|
+
const textEditorCss = "@charset \"UTF-8\";:host{--mdc-theme-primary:var(\n --lime-primary-color,\n rgb(var(--color-teal-default))\n );--mdc-theme-secondary:var(\n --lime-secondary-color,\n rgb(var(--contrast-1100))\n );--mdc-theme-on-primary:var(\n --lime-on-primary-color,\n rgb(var(--contrast-100))\n );--mdc-theme-on-secondary:var(\n --lime-on-secondary-color,\n rgb(var(--contrast-100))\n );--mdc-theme-text-disabled-on-background:var(\n --lime-text-disabled-on-background-color,\n rgba(var(--contrast-1700), 0.38)\n );--mdc-theme-text-primary-on-background:var(\n --lime-text-primary-on-background-color,\n rgba(var(--contrast-1700), 0.87)\n );--mdc-theme-text-secondary-on-background:var(\n --lime-text-secondary-on-background-color,\n rgba(var(--contrast-1700), 0.54)\n );--mdc-theme-error:var(\n --lime-error-background-color,\n rgb(var(--color-red-dark))\n );--lime-error-text-color:rgb(var(--color-red-darker));--mdc-theme-surface:var(\n --lime-surface-background-color,\n rgb(var(--contrast-100))\n );--mdc-theme-on-surface:var(\n --lime-on-surface-color,\n rgb(var(--contrast-1500))\n )}:host(limel-text-editor){isolation:isolate;display:block}*{box-sizing:border-box}.ProseMirror-menubar-wrapper{transition:border 0.2s ease;display:grid;grid-template-rows:auto 1fr;border-radius:0.25rem;border:1px solid;border-color:rgba(var(--contrast-700), 0.65)}.ProseMirror-menubar-wrapper:hover{border-color:rgba(var(--contrast-700), 1)}.ProseMirror-menubar-wrapper:focus-within{border-color:var(--mdc-theme-primary)}.ProseMirror-textblock-dropdown{min-width:3em}.ProseMirror-tooltip .ProseMirror-menu{width:-webkit-fit-content;width:fit-content;white-space:pre}.ProseMirror{position:relative;word-wrap:break-word;white-space:pre-wrap;white-space:break-spaces;-webkit-font-variant-ligatures:none;font-variant-ligatures:none;font-feature-settings:\"liga\" 0;border-bottom-left-radius:0.5rem;border-bottom-right-radius:0.5rem;padding:0.5rem 1rem;background-color:rgb(var(--contrast-100))}.ProseMirror [draggable][contenteditable=false]{user-select:text}.ProseMirror:focus-visible{outline:none}.ProseMirror-hideselection{caret-color:transparent}.ProseMirror-hideselection *::selection{background:transparent}.ProseMirror-hideselection *::-moz-selection{background:transparent}.ProseMirror-selectednode{outline:0.125rem solid rgb(var(--color-sky-light))}li.ProseMirror-selectednode{outline:none}li.ProseMirror-selectednode:after{content:\"\";position:absolute;left:-2rem;right:-0.125rem;top:-0.125rem;bottom:-0.125rem;border:0.125rem solid rgb(var(--color-sky-light));pointer-events:none}img.ProseMirror-separator{display:inline !important;border:none !important;margin:0 !important}div#editor .ProseMirror-menubar{position:sticky !important;z-index:1;top:0}div#editor .ProseMirror-menubar[style*=\"position: fixed\"]{box-shadow:0 0.25rem 0.5rem -0.5rem rgb(var(--color-black), 0.8)}.ProseMirror-menubar{position:relative;z-index:1;display:flex;flex-wrap:wrap;gap:0.25rem;align-items:center;padding:0.125rem;background-color:rgb(var(--contrast-100));border-top-left-radius:0.5rem;border-top-right-radius:0.5rem}.ProseMirror-menuitem{position:relative;flex-shrink:0;display:flex;align-items:center;justify-content:center;white-space:nowrap;line-height:1;height:1.5rem;min-width:1.5rem;border-radius:0.25rem;color:rgb(var(--contrast-1100));font-size:0.8125rem}.ProseMirror-menuitem:not(:has(.ProseMirror-menu-disabled)){transition:color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease, transform 0.1s ease-out;cursor:pointer;color:var(--mdc-theme-on-surface);background-color:transparent}.ProseMirror-menuitem:not(:has(.ProseMirror-menu-disabled)):hover{color:var(--mdc-theme-on-surface);background-color:var(--lime-elevated-surface-background-color);box-shadow:var(--button-shadow-hovered)}.ProseMirror-menuitem:not(:has(.ProseMirror-menu-disabled)):active{box-shadow:var(--button-shadow-pressed);transform:translate3d(0, 0.08rem, 0)}.ProseMirror-menuitem:has(.ProseMirror-menu-active){box-shadow:var(--button-shadow-inset);color:var(--mdc-theme-primary)}.ProseMirror-menuitem:has(.ProseMirror-menu-active) svg{color:var(--mdc-theme-primary)}.ProseMirror-menuitem:has(.ProseMirror-menu-dropdown-menu){box-shadow:var(--button-shadow-inset)}.ProseMirror-menuitem svg{fill:currentColor;height:1rem;color:rgb(var(--contrast-1100))}.ProseMirror-menuseparator{border-radius:1rem;background-color:rgb(var(--contrast-600));width:0.125rem;height:1rem}.ProseMirror-menu-dropdown{position:relative;display:flex;align-items:center;gap:0.5rem;padding:0 0.5rem}.ProseMirror-menu-dropdown:after{content:\"\";border-left:0.25rem solid transparent;border-right:0.25rem solid transparent;border-top:0.25rem solid currentColor}.ProseMirror-menu-dropdown-menu,.ProseMirror-menu-submenu{box-shadow:0px 5px 5px -3px rgba(0, 0, 0, 0.2), 0px 8px 10px 1px rgba(0, 0, 0, 0.14), 0px 3px 14px 2px rgba(0, 0, 0, 0.12)}.ProseMirror-menu-dropdown-menu{position:absolute;top:100%;background:rgb(var(--contrast-100));border-radius:0.25rem;padding:0.125rem}.ProseMirror-menu-submenu{position:absolute;background:rgb(var(--contrast-100));border-radius:0.25rem;padding:0.125rem;display:none;min-width:4em;left:100%;top:-0.75rem}.ProseMirror-menu-dropdown-item{transition:background-color 0.2s ease;cursor:pointer;border-radius:0.375rem;min-height:2.5rem;display:flex;align-items:center;width:100%}.ProseMirror-menu-dropdown-item>div{padding:0 1rem;width:100%}.ProseMirror-menu-dropdown-item:not(:has(.ProseMirror-menu-disabled)):hover{background-color:rgb(var(--contrast-300))}.ProseMirror-menu-submenu-wrap{position:relative;margin-right:-0.25rem}.ProseMirror-menu-submenu-wrap:hover .ProseMirror-menu-submenu{display:block}.ProseMirror-menu-submenu-label{position:relative;display:flex;align-items:center;justify-content:space-between;gap:0.5rem}.ProseMirror-menu-submenu-label:after{content:\"\";border-top:0.25rem solid transparent;border-bottom:0.25rem solid transparent;border-left:0.25rem solid currentColor}.ProseMirror-menu-disabled{opacity:0.3;cursor:default}.ProseMirror-menu-submenu-wrap-active .ProseMirror-menu-submenu{display:block}blockquote{position:relative;font-weight:100;font-size:0.875rem;max-width:100%;line-height:1.4;margin:0;padding:0.5rem 1.25rem;border-radius:0.05rem 0.75rem;background-color:rgb(var(--contrast-300))}blockquote:before,blockquote:after{position:absolute;font-size:2.75rem;opacity:0.4}blockquote:before{content:\"“\";left:0;top:-0.75rem}blockquote:after{content:\"”\";right:0;bottom:-2rem}:host(limel-markdown.truncate-paragraphs) p{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}p,a,li{font-size:0.875rem}p{margin-top:0;margin-bottom:0.5rem}p:only-child{margin-bottom:0}a{transition:color 0.2s ease;color:var(--markdown-hyperlink-color, rgb(var(--color-blue-dark)));text-decoration:none}a:hover{color:var(--markdown-hyperlink-color--hovered, rgb(var(--color-blue-default)))}hr{margin:1.75rem 0 2rem 0;border-width:0;border-top:1px solid rgb(var(--contrast-500))}dl{display:grid;grid-template-columns:1fr 2fr;grid-template-rows:1fr;margin-bottom:2rem;border:1px solid rgb(var(--contrast-400));border-radius:0.375rem;background-color:rgb(var(--contrast-200))}dl dt,dl dd{padding:0.375rem 0.5rem;font-size:0.875rem;margin:0}dl dt:nth-of-type(even),dl dd:nth-of-type(even){background-color:rgb(var(--contrast-300))}dl dt:first-child{border-top-left-radius:0.375rem}dl dt:last-child{border-bottom-left-radius:0.375rem}dl dd:first-child{border-top-right-radius:0.375rem}dl dd:last-child{border-bottom-right-radius:0.375rem}h1{font-size:1.875rem;line-height:1.875rem;margin-top:1.5rem;margin-bottom:0.75rem;letter-spacing:-0.0625rem}h2{font-size:1.625rem;line-height:1.625rem;margin-top:1.25rem;margin-bottom:0.75rem}h3{font-size:1.375rem;line-height:1.375rem;margin-top:1rem;margin-bottom:0.75rem}h4{font-size:1.25rem;line-height:1.25rem;margin-top:0.75rem;margin-bottom:0.5rem}h5{font-size:1.125rem;line-height:1.125rem;margin-top:0.75rem;margin-bottom:0.5rem}h6{font-size:1rem;line-height:1rem;margin-top:0.75rem;margin-bottom:0.5rem}ul{list-style:none}ul li{position:relative;margin-left:0.75rem}ul li:before{content:\"\";position:absolute;left:-0.5rem;top:0.5rem;width:0.25rem;height:0.25rem;border-radius:50%;background-color:rgb(var(--contrast-700));display:block}ol{margin-top:0.25rem;padding-left:1rem}ul{margin-top:0.25rem;padding-left:0}ul ul,ul ol,ol ol,ol ul{margin-left:0}li{margin-bottom:0.25rem}code{font-family:ui-monospace, \"Cascadia Code\", \"Source Code Pro\", Menlo, Consolas, \"DejaVu Sans Mono\", monospace;font-size:0.8125rem;letter-spacing:-0.0125rem;color:rgb(var(--contrast-1300));-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none;display:inline-block;border-radius:0.25rem;padding:0.03125rem 0.25rem;background-color:rgb(var(--contrast-600))}pre>code{display:block;margin:0.5rem 0;padding:0.5rem 0.75rem;overflow:auto;white-space:pre-wrap}:host(limel-markdown:not(.no-table-styles)) table{table-layout:auto;min-width:100%;border-collapse:collapse;border-spacing:0;background:transparent;margin:0.75rem 0;border:1px solid rgb(var(--contrast-400))}:host(limel-markdown:not(.no-table-styles)) th,:host(limel-markdown:not(.no-table-styles)) td{text-align:left;vertical-align:top;transition:background-color 0.2s ease;font-size:0.875rem}:host(limel-markdown:not(.no-table-styles)) td{padding:0.5rem 0.375rem 0.75rem 0.375rem}:host(limel-markdown:not(.no-table-styles)) tr th{background-color:rgb(var(--contrast-400));padding:0.25rem 0.375rem;font-weight:normal}:host(limel-markdown:not(.no-table-styles)) tr th:only-child{text-align:center}:host(limel-markdown:not(.no-table-styles)) tbody tr:nth-child(odd) td{background-color:rgb(var(--contrast-200))}:host(limel-markdown:not(.no-table-styles)) tbody tr:hover td{background-color:rgb(var(--contrast-300))}";
|
|
15853
15913
|
|
|
15854
15914
|
const TextEditor = class {
|
|
15855
15915
|
constructor(hostRef) {
|
|
@@ -15863,7 +15923,7 @@ const TextEditor = class {
|
|
|
15863
15923
|
}
|
|
15864
15924
|
componentDidLoad() {
|
|
15865
15925
|
const mySchema = new Schema({
|
|
15866
|
-
nodes: schema.spec.nodes,
|
|
15926
|
+
nodes: addListNodes(schema.spec.nodes, 'paragraph block*', 'block'),
|
|
15867
15927
|
marks: schema.spec.marks,
|
|
15868
15928
|
});
|
|
15869
15929
|
this.view = new EditorView(this.host.shadowRoot.querySelector('#editor'), {
|