@sendbird/actionbook-core 0.10.4 → 0.10.5
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/ui/index.js +13 -1
- package/dist/ui/index.js.map +1 -1
- package/package.json +1 -1
package/dist/ui/index.js
CHANGED
|
@@ -2840,10 +2840,22 @@ function handleListInputRule(state, start, end, listType, attrs) {
|
|
|
2840
2840
|
const { depth: listDepth, node: listNode } = parentList;
|
|
2841
2841
|
const paraContentSize = $from.parent.content.size;
|
|
2842
2842
|
const matchedLen = end - start;
|
|
2843
|
-
|
|
2843
|
+
const isMarkerOnly = paraContentSize === matchedLen;
|
|
2844
2844
|
if (listNode.type === listType) {
|
|
2845
|
+
if (isMarkerOnly && listType === actionbookSchema.nodes.orderedList && attrs?.start != null) {
|
|
2846
|
+
const newStart = attrs.start;
|
|
2847
|
+
const currentStart = listNode.attrs.start ?? 1;
|
|
2848
|
+
if (newStart !== currentStart) {
|
|
2849
|
+
const listStart = $from.before(listDepth);
|
|
2850
|
+
const tr2 = state.tr.delete(start, end);
|
|
2851
|
+
tr2.setNodeMarkup(tr2.mapping.map(listStart), void 0, { ...listNode.attrs, start: newStart });
|
|
2852
|
+
tr2.setSelection(TextSelection.near(tr2.doc.resolve(tr2.mapping.map(start))));
|
|
2853
|
+
return tr2;
|
|
2854
|
+
}
|
|
2855
|
+
}
|
|
2845
2856
|
return NOOP;
|
|
2846
2857
|
}
|
|
2858
|
+
if (!isMarkerOnly) return NOOP;
|
|
2847
2859
|
const { listItem: liType } = actionbookSchema.nodes;
|
|
2848
2860
|
const tr = state.tr.delete(start, end);
|
|
2849
2861
|
const $pos = tr.doc.resolve(tr.mapping.map(resolvePos));
|