@tiptap/extension-list 3.26.1 → 3.27.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Node, Extension, Editor } from '@tiptap/core';
1
+ import { Node, Extension, Editor, JSONContent } from '@tiptap/core';
2
2
  import * as prosemirror_model from 'prosemirror-model';
3
3
  import { NodeType, Node as Node$1 } from '@tiptap/pm/model';
4
4
  import { EditorState } from '@tiptap/pm/state';
@@ -183,6 +183,71 @@ declare const orderedListInputRegex: RegExp;
183
183
  */
184
184
  declare const OrderedList: Node<OrderedListOptions, any>;
185
185
 
186
+ /**
187
+ * Marker segment for ordered list lines: numeric, roman, or 1–2 letter alpha.
188
+ * Roman is matched before alpha so "iii" is roman; invalid romans like "aa" fall through to alpha.
189
+ */
190
+ declare const ORDERED_LIST_MARKER_PATTERN: string;
191
+ /**
192
+ * Convert a number to lowercase roman numerals.
193
+ * @example toRoman(1) // 'i'
194
+ * @example toRoman(4) // 'iv'
195
+ */
196
+ declare function toRoman(num: number): string;
197
+ /**
198
+ * Convert a number to uppercase roman numerals.
199
+ * @example toRomanUpper(1) // 'I'
200
+ * @example toRomanUpper(4) // 'IV'
201
+ */
202
+ declare function toRomanUpper(num: number): string;
203
+ /**
204
+ * Extract the list marker type from a marker string.
205
+ * Supports "1", "a", "A", "i", "I" marker styles.
206
+ *
207
+ * @param marker The text content of the list marker (e.g. "a", "1", "iii", "b")
208
+ * @returns The normalized type string, or undefined for default numeric type
209
+ */
210
+ declare function detectMarkerType(marker: string): string | undefined;
211
+ /**
212
+ * Convert a list marker string to its numeric start position.
213
+ *
214
+ * @param marker The text content of the list marker (e.g. "3", "b", "II")
215
+ * @returns The 1-based start value for the ordered list
216
+ */
217
+ declare function markerToStart(marker: string): number;
218
+ /**
219
+ * Returns true when all markers share the same style and increment by 1.
220
+ * Style is inferred from the first marker so ambiguous letters (e.g. "c", "i")
221
+ * are not re-classified differently on later lines.
222
+ */
223
+ declare function areOrderedListMarkersSequential(markers: string[]): boolean;
224
+ interface ParsedListMarker {
225
+ type?: string;
226
+ start: number;
227
+ }
228
+ /**
229
+ * Parse a list marker into HTML ordered-list attrs (type + start).
230
+ */
231
+ declare function parseListMarker(marker: string): ParsedListMarker;
232
+ /**
233
+ * Build orderedList node attrs from the first list item marker.
234
+ */
235
+ declare function buildOrderedListAttrsFromMarker(marker: string): Record<string, string | number>;
236
+ /**
237
+ * Returns the list marker prefix for a given item at a given index.
238
+ *
239
+ * @param type The list type attribute (e.g. "a", "A", "i", "I", null/undefined for default)
240
+ * @param index The zero-based index of the list item
241
+ * @param separator The separator to use (default: ". ")
242
+ * @returns The marker string (e.g. "a. ", "I. ", "1. ")
243
+ */
244
+ declare function getListMarker(type: string | null | undefined, index: number, separator?: string): string;
245
+
246
+ /**
247
+ * Parse plain-text pasted ordered list lines into JSONContent, or null if not a typed list.
248
+ */
249
+ declare function parsePlainTextOrderedListPaste(text: string): JSONContent | null;
250
+
186
251
  interface TaskItemOptions {
187
252
  /**
188
253
  * A callback function that is called when the checkbox is clicked while the editor is in readonly mode.
@@ -297,4 +362,4 @@ interface ListKitOptions {
297
362
  */
298
363
  declare const ListKit: Extension<ListKitOptions, any>;
299
364
 
300
- export { BulletList, type BulletListOptions, ListItem, type ListItemOptions, ListKeymap, type ListKeymapOptions, ListKit, type ListKitOptions, OrderedList, type OrderedListOptions, TaskItem, type TaskItemOptions, TaskList, type TaskListOptions, bulletListInputRegex, inputRegex, index as listHelpers, orderedListInputRegex };
365
+ export { BulletList, type BulletListOptions, ListItem, type ListItemOptions, ListKeymap, type ListKeymapOptions, ListKit, type ListKitOptions, ORDERED_LIST_MARKER_PATTERN, OrderedList, type OrderedListOptions, TaskItem, type TaskItemOptions, TaskList, type TaskListOptions, areOrderedListMarkersSequential, buildOrderedListAttrsFromMarker, bulletListInputRegex, detectMarkerType, getListMarker, inputRegex, index as listHelpers, markerToStart, orderedListInputRegex, parseListMarker, parsePlainTextOrderedListPaste, toRoman, toRomanUpper };
package/dist/index.js CHANGED
@@ -194,6 +194,194 @@ var createBranchingListDeleteKeymap = (itemName, wrapperNames) => {
194
194
  });
195
195
  };
196
196
 
197
+ // src/ordered-list/roman.ts
198
+ var ROMAN_NUMERALS = [
199
+ [1e3, "m"],
200
+ [900, "cm"],
201
+ [500, "d"],
202
+ [400, "cd"],
203
+ [100, "c"],
204
+ [90, "xc"],
205
+ [50, "l"],
206
+ [40, "xl"],
207
+ [10, "x"],
208
+ [9, "ix"],
209
+ [5, "v"],
210
+ [4, "iv"],
211
+ [1, "i"]
212
+ ];
213
+ var ALPHA_NUMERALS = "abcdefghijklmnopqrstuvwxyz";
214
+ var ORDERED_LIST_ALPHA_MARKER_PATTERN = "[a-zA-Z]{1,2}";
215
+ var ORDERED_LIST_MARKER_PATTERN = String.raw`\d+|[ivxlcdmIVXLCDM]+|${ORDERED_LIST_ALPHA_MARKER_PATTERN}`;
216
+ function toRoman(num) {
217
+ let remaining = num;
218
+ let result = "";
219
+ for (const [value, numeral] of ROMAN_NUMERALS) {
220
+ while (remaining >= value) {
221
+ result += numeral;
222
+ remaining -= value;
223
+ }
224
+ }
225
+ return result;
226
+ }
227
+ function toRomanUpper(num) {
228
+ return toRoman(num).toUpperCase();
229
+ }
230
+ function fromRoman(roman) {
231
+ const lower = roman.toLowerCase();
232
+ let index = 0;
233
+ let result = 0;
234
+ while (index < lower.length) {
235
+ let matched = false;
236
+ for (const [value, numeral] of ROMAN_NUMERALS) {
237
+ if (lower.startsWith(numeral, index)) {
238
+ result += value;
239
+ index += numeral.length;
240
+ matched = true;
241
+ break;
242
+ }
243
+ }
244
+ if (!matched) {
245
+ return 0;
246
+ }
247
+ }
248
+ return result;
249
+ }
250
+ function isValidRoman(marker) {
251
+ if (!/^[ivxlcdmIVXLCDM]+$/.test(marker)) {
252
+ return false;
253
+ }
254
+ const value = fromRoman(marker);
255
+ if (value <= 0) {
256
+ return false;
257
+ }
258
+ const expected = marker === marker.toLowerCase() ? toRoman(value) : toRomanUpper(value);
259
+ return expected === marker;
260
+ }
261
+ function fromAlpha(marker) {
262
+ const lower = marker.toLowerCase();
263
+ if (lower.length === 1) {
264
+ return lower.charCodeAt(0) - "a".charCodeAt(0) + 1;
265
+ }
266
+ if (lower.length === 2) {
267
+ const first = lower.charCodeAt(0) - "a".charCodeAt(0);
268
+ const second = lower.charCodeAt(1) - "a".charCodeAt(0);
269
+ return (first + 1) * 26 + second + 1;
270
+ }
271
+ return 0;
272
+ }
273
+ function toRomanAlpha(num) {
274
+ if (num <= 26) {
275
+ return ALPHA_NUMERALS[num - 1];
276
+ }
277
+ const first = Math.floor((num - 1) / 26) - 1;
278
+ const second = (num - 1) % 26;
279
+ if (first < 0) {
280
+ return ALPHA_NUMERALS[second];
281
+ }
282
+ return ALPHA_NUMERALS[first] + ALPHA_NUMERALS[second];
283
+ }
284
+ function detectMarkerType(marker) {
285
+ if (!marker || /^\d+$/.test(marker)) {
286
+ return void 0;
287
+ }
288
+ if (isValidRoman(marker)) {
289
+ return marker === marker.toLowerCase() ? "i" : "I";
290
+ }
291
+ if (/^[a-z]{1,2}$/.test(marker)) {
292
+ return "a";
293
+ }
294
+ if (/^[A-Z]{1,2}$/.test(marker)) {
295
+ return "A";
296
+ }
297
+ return void 0;
298
+ }
299
+ function markerToStart(marker) {
300
+ if (/^\d+$/.test(marker)) {
301
+ return parseInt(marker, 10);
302
+ }
303
+ const type = detectMarkerType(marker);
304
+ if (type === "i" || type === "I") {
305
+ return fromRoman(marker);
306
+ }
307
+ if (type === "a" || type === "A") {
308
+ const start = fromAlpha(marker);
309
+ return start > 0 ? start : 1;
310
+ }
311
+ const parsed = parseInt(marker, 10);
312
+ return Number.isNaN(parsed) ? 1 : parsed;
313
+ }
314
+ function startToMarker(type, start) {
315
+ if (type === "numeric") {
316
+ return String(start);
317
+ }
318
+ switch (type) {
319
+ case "a":
320
+ return toRomanAlpha(start);
321
+ case "A":
322
+ return toRomanAlpha(start).toUpperCase();
323
+ case "i":
324
+ return toRoman(start);
325
+ case "I":
326
+ return toRomanUpper(start);
327
+ default:
328
+ return String(start);
329
+ }
330
+ }
331
+ function areOrderedListMarkersSequential(markers) {
332
+ var _a;
333
+ if (markers.length === 0) {
334
+ return false;
335
+ }
336
+ const firstType = (_a = detectMarkerType(markers[0])) != null ? _a : "numeric";
337
+ const firstStart = markerToStart(markers[0]);
338
+ if (firstStart < 1) {
339
+ return false;
340
+ }
341
+ for (let i = 0; i < markers.length; i++) {
342
+ const expected = startToMarker(firstType, firstStart + i);
343
+ if (markers[i] !== expected) {
344
+ return false;
345
+ }
346
+ }
347
+ return true;
348
+ }
349
+ function parseListMarker(marker) {
350
+ return {
351
+ type: detectMarkerType(marker),
352
+ start: markerToStart(marker)
353
+ };
354
+ }
355
+ function buildOrderedListAttrsFromMarker(marker) {
356
+ const { type, start } = parseListMarker(marker);
357
+ const attrs = {};
358
+ if (type) {
359
+ attrs.type = type;
360
+ }
361
+ if (start !== 1) {
362
+ attrs.start = start;
363
+ }
364
+ return attrs;
365
+ }
366
+ function getListMarker(type, index, separator = ". ") {
367
+ const position = index + 1;
368
+ if (!type || type === "1") {
369
+ return `${position}${separator}`;
370
+ }
371
+ switch (type) {
372
+ case "a":
373
+ return `${toRomanAlpha(position)}${separator}`;
374
+ case "A":
375
+ return `${toRomanAlpha(position).toUpperCase()}${separator}`;
376
+ case "i":
377
+ return `${toRoman(position)}${separator}`;
378
+ case "I":
379
+ return `${toRomanUpper(position)}${separator}`;
380
+ default:
381
+ return `${position}${separator}`;
382
+ }
383
+ }
384
+
197
385
  // src/item/list-item.ts
198
386
  function isSameLineOrderedListToken(token) {
199
387
  var _a, _b;
@@ -296,13 +484,15 @@ var ListItem = Node2.create({
296
484
  node,
297
485
  h,
298
486
  (context) => {
299
- var _a, _b;
487
+ var _a, _b, _c, _d;
300
488
  if (context.parentType === "bulletList") {
301
489
  return "- ";
302
490
  }
303
491
  if (context.parentType === "orderedList") {
304
492
  const start = ((_b = (_a = context.meta) == null ? void 0 : _a.parentAttrs) == null ? void 0 : _b.start) || 1;
305
- return `${start + context.index}. `;
493
+ const type = (_d = (_c = context.meta) == null ? void 0 : _c.parentAttrs) == null ? void 0 : _d.type;
494
+ const index = start - 1 + (context.index || 0);
495
+ return getListMarker(type, index, ". ");
306
496
  }
307
497
  return "- ";
308
498
  },
@@ -596,17 +786,25 @@ var ListKeymap = Extension2.create({
596
786
  import { Extension as Extension3 } from "@tiptap/core";
597
787
 
598
788
  // src/ordered-list/ordered-list.ts
789
+ import { Plugin } from "@tiptap/pm/state";
599
790
  import { mergeAttributes as mergeAttributes3, Node as Node3, wrappingInputRule as wrappingInputRule2 } from "@tiptap/core";
600
791
 
601
792
  // src/ordered-list/utils.ts
602
- var ORDERED_LIST_ITEM_REGEX = /^(\s*)(\d+)\.\s+(.*)$/;
793
+ var ORDERED_LIST_ITEM_REGEX = new RegExp(
794
+ `^(\\s*)(${ORDERED_LIST_MARKER_PATTERN})([.)])\\s+(.*)$`
795
+ );
796
+ var ORDERED_LIST_LINE_START_REGEX = new RegExp(
797
+ `^(\\s*)(${ORDERED_LIST_MARKER_PATTERN})([.)])\\s+`
798
+ );
603
799
  var INDENTED_LINE_REGEX = /^\s/;
800
+ function isOrderedListMarkerLine(line) {
801
+ return ORDERED_LIST_ITEM_REGEX.test(line.trimStart());
802
+ }
604
803
  function isBlockContentLine(line) {
605
804
  const trimmedLine = line.trimStart();
606
805
  return (
607
806
  // oxlint-disable-next-line prefer-string-starts-ends-with
608
- /^[-+*]\s+/.test(trimmedLine) || // oxlint-disable-next-line prefer-string-starts-ends-with
609
- /^\d+\.\s+/.test(trimmedLine) || // oxlint-disable-next-line prefer-string-starts-ends-with
807
+ /^[-+*]\s+/.test(trimmedLine) || isOrderedListMarkerLine(trimmedLine) || // oxlint-disable-next-line prefer-string-starts-ends-with
610
808
  /^>\s?/.test(trimmedLine) || // oxlint-disable-next-line prefer-string-starts-ends-with
611
809
  /^```/.test(trimmedLine) || // oxlint-disable-next-line prefer-string-starts-ends-with
612
810
  /^~~~/.test(trimmedLine)
@@ -648,8 +846,11 @@ function collectOrderedListItems(lines) {
648
846
  if (!match) {
649
847
  break;
650
848
  }
651
- const [, indent, number, content] = match;
849
+ const [, indent, marker, _separator, content] = match;
652
850
  const indentLevel = indent.length;
851
+ const number = parseInt(marker, 10);
852
+ const markerType = isNaN(number) ? detectMarkerType(marker) : void 0;
853
+ const itemNumber = isNaN(number) ? markerToStart(marker) : number;
653
854
  const itemContentLines = [content];
654
855
  let nextLineIndex = currentLineIndex + 1;
655
856
  const itemLines = [line];
@@ -680,7 +881,8 @@ function collectOrderedListItems(lines) {
680
881
  }
681
882
  listItems.push({
682
883
  indent: indentLevel,
683
- number: parseInt(number, 10),
884
+ number: itemNumber,
885
+ type: markerType,
684
886
  content: itemContentLines.join("\n").trim(),
685
887
  contentLines: itemContentLines,
686
888
  raw: itemLines.join("\n")
@@ -690,6 +892,44 @@ function collectOrderedListItems(lines) {
690
892
  }
691
893
  return [listItems, consumed];
692
894
  }
895
+ var PLAIN_TEXT_ORDERED_LIST_LINE_REGEX = new RegExp(
896
+ `^(${ORDERED_LIST_MARKER_PATTERN})([.)])\\s+(.+)$`
897
+ );
898
+ function parsePlainTextOrderedListPaste(text) {
899
+ const lines = text.split("\n").filter((l) => l.trim().length > 0);
900
+ if (lines.length === 0) {
901
+ return null;
902
+ }
903
+ const parsedItems = [];
904
+ for (const line of lines) {
905
+ const match = line.trim().match(PLAIN_TEXT_ORDERED_LIST_LINE_REGEX);
906
+ if (!match) {
907
+ return null;
908
+ }
909
+ parsedItems.push({
910
+ marker: match[1],
911
+ content: match[3]
912
+ });
913
+ }
914
+ const markers = parsedItems.map((item) => item.marker);
915
+ if (!areOrderedListMarkersSequential(markers)) {
916
+ return null;
917
+ }
918
+ const attrs = buildOrderedListAttrsFromMarker(parsedItems[0].marker);
919
+ return {
920
+ type: "orderedList",
921
+ attrs,
922
+ content: parsedItems.map((item) => ({
923
+ type: "listItem",
924
+ content: [
925
+ {
926
+ type: "paragraph",
927
+ content: [{ type: "text", text: item.content }]
928
+ }
929
+ ]
930
+ }))
931
+ };
932
+ }
693
933
  function buildNestedStructure(items, baseIndent, lexer) {
694
934
  const result = [];
695
935
  let currentIndex = 0;
@@ -724,6 +964,7 @@ function buildNestedStructure(items, baseIndent, lexer) {
724
964
  type: "list",
725
965
  ordered: true,
726
966
  start: nestedItems[0].number,
967
+ typeMarker: nestedItems[0].type,
727
968
  items: nestedListItems,
728
969
  raw: nestedItems.map((nestedItem) => nestedItem.raw).join("\n")
729
970
  });
@@ -775,6 +1016,27 @@ function parseListItems(items, helpers) {
775
1016
  var ListItemName2 = "listItem";
776
1017
  var TextStyleName2 = "textStyle";
777
1018
  var orderedListInputRegex = /^(\d+)\.\s$/;
1019
+ function cssListStyleTypeToHtmlType(style) {
1020
+ const match = style.match(/list-style-type\s*:\s*([^;]+)/i);
1021
+ if (!match) {
1022
+ return null;
1023
+ }
1024
+ const cssValue = match[1].trim().toLowerCase();
1025
+ switch (cssValue) {
1026
+ case "upper-roman":
1027
+ return "I";
1028
+ case "lower-roman":
1029
+ return "i";
1030
+ case "upper-alpha":
1031
+ case "upper-latin":
1032
+ return "A";
1033
+ case "lower-alpha":
1034
+ case "lower-latin":
1035
+ return "a";
1036
+ default:
1037
+ return null;
1038
+ }
1039
+ }
778
1040
  var OrderedList = Node3.create({
779
1041
  name: "orderedList",
780
1042
  addOptions() {
@@ -799,7 +1061,30 @@ var OrderedList = Node3.create({
799
1061
  },
800
1062
  type: {
801
1063
  default: null,
802
- parseHTML: (element) => element.getAttribute("type")
1064
+ parseHTML: (element) => {
1065
+ const htmlType = element.getAttribute("type");
1066
+ if (htmlType) {
1067
+ return htmlType;
1068
+ }
1069
+ const style = element.getAttribute("style");
1070
+ if (style) {
1071
+ const mappedFromOl = cssListStyleTypeToHtmlType(style);
1072
+ if (mappedFromOl) {
1073
+ return mappedFromOl;
1074
+ }
1075
+ }
1076
+ const firstLi = element.querySelector("li");
1077
+ if (firstLi) {
1078
+ const liStyle = firstLi.getAttribute("style");
1079
+ if (liStyle) {
1080
+ const mappedFromLi = cssListStyleTypeToHtmlType(liStyle);
1081
+ if (mappedFromLi) {
1082
+ return mappedFromLi;
1083
+ }
1084
+ }
1085
+ }
1086
+ return null;
1087
+ }
803
1088
  }
804
1089
  };
805
1090
  },
@@ -811,8 +1096,15 @@ var OrderedList = Node3.create({
811
1096
  ];
812
1097
  },
813
1098
  renderHTML({ HTMLAttributes }) {
814
- const { start, ...attributesWithoutStart } = HTMLAttributes;
815
- return start === 1 ? ["ol", mergeAttributes3(this.options.HTMLAttributes, attributesWithoutStart), 0] : ["ol", mergeAttributes3(this.options.HTMLAttributes, HTMLAttributes), 0];
1099
+ const { start, type, ...attributesWithoutType } = HTMLAttributes;
1100
+ const attrs = mergeAttributes3(this.options.HTMLAttributes, attributesWithoutType);
1101
+ if (start !== 1) {
1102
+ attrs.start = start;
1103
+ }
1104
+ if (type && type !== "1") {
1105
+ attrs.type = type;
1106
+ }
1107
+ return ["ol", attrs, 0];
816
1108
  },
817
1109
  markdownTokenName: "list",
818
1110
  parseMarkdown: (token, helpers) => {
@@ -820,11 +1112,19 @@ var OrderedList = Node3.create({
820
1112
  return [];
821
1113
  }
822
1114
  const startValue = token.start || 1;
1115
+ const typeValue = token.typeMarker;
823
1116
  const content = token.items ? parseListItems(token.items, helpers) : [];
1117
+ const attrs = {};
824
1118
  if (startValue !== 1) {
1119
+ attrs.start = startValue;
1120
+ }
1121
+ if (typeValue) {
1122
+ attrs.type = typeValue;
1123
+ }
1124
+ if (Object.keys(attrs).length > 0) {
825
1125
  return {
826
1126
  type: "orderedList",
827
- attrs: { start: startValue },
1127
+ attrs,
828
1128
  content
829
1129
  };
830
1130
  }
@@ -843,12 +1143,12 @@ var OrderedList = Node3.create({
843
1143
  name: "orderedList",
844
1144
  level: "block",
845
1145
  start: (src) => {
846
- const match = src.match(/^(\s*)(\d+)\.\s+/);
1146
+ const match = src.match(ORDERED_LIST_LINE_START_REGEX);
847
1147
  const index = match == null ? void 0 : match.index;
848
1148
  return index !== void 0 ? index : -1;
849
1149
  },
850
1150
  tokenize: (src, _tokens, lexer) => {
851
- var _a;
1151
+ var _a, _b;
852
1152
  const lines = src.split("\n");
853
1153
  const [listItems, consumed] = collectOrderedListItems(lines);
854
1154
  if (listItems.length === 0) {
@@ -859,10 +1159,12 @@ var OrderedList = Node3.create({
859
1159
  return void 0;
860
1160
  }
861
1161
  const startValue = ((_a = listItems[0]) == null ? void 0 : _a.number) || 1;
1162
+ const typeMarker = (_b = listItems[0]) == null ? void 0 : _b.type;
862
1163
  return {
863
1164
  type: "list",
864
1165
  ordered: true,
865
1166
  start: startValue,
1167
+ typeMarker,
866
1168
  items,
867
1169
  raw: lines.slice(0, consumed).join("\n")
868
1170
  };
@@ -886,12 +1188,47 @@ var OrderedList = Node3.create({
886
1188
  "Mod-Shift-7": () => this.editor.commands.toggleOrderedList()
887
1189
  };
888
1190
  },
1191
+ addProseMirrorPlugins() {
1192
+ return [
1193
+ new Plugin({
1194
+ props: {
1195
+ handlePaste: (view, event) => {
1196
+ var _a, _b;
1197
+ const html = (_a = event.clipboardData) == null ? void 0 : _a.getData("text/html");
1198
+ if (html == null ? void 0 : html.trim()) {
1199
+ return false;
1200
+ }
1201
+ const text = (_b = event.clipboardData) == null ? void 0 : _b.getData("text/plain");
1202
+ if (!text) {
1203
+ return false;
1204
+ }
1205
+ const orderedListContent = parsePlainTextOrderedListPaste(text);
1206
+ if (!orderedListContent) {
1207
+ return false;
1208
+ }
1209
+ try {
1210
+ const orderedListNode = view.state.schema.nodeFromJSON(orderedListContent);
1211
+ const tr = view.state.tr.replaceSelectionWith(orderedListNode);
1212
+ view.dispatch(tr);
1213
+ return true;
1214
+ } catch {
1215
+ return false;
1216
+ }
1217
+ }
1218
+ }
1219
+ })
1220
+ ];
1221
+ },
889
1222
  addInputRules() {
1223
+ const joinPredicate = (match, node) => {
1224
+ const hasDefaultType = !node.attrs.type || node.attrs.type === "1";
1225
+ return hasDefaultType && node.childCount + node.attrs.start === +match[1];
1226
+ };
890
1227
  let inputRule = wrappingInputRule2({
891
1228
  find: orderedListInputRegex,
892
1229
  type: this.type,
893
1230
  getAttributes: (match) => ({ start: +match[1] }),
894
- joinPredicate: (match, node) => node.childCount + node.attrs.start === +match[1]
1231
+ joinPredicate
895
1232
  });
896
1233
  if (this.options.keepMarks || this.options.keepAttributes) {
897
1234
  inputRule = wrappingInputRule2({
@@ -900,7 +1237,7 @@ var OrderedList = Node3.create({
900
1237
  keepMarks: this.options.keepMarks,
901
1238
  keepAttributes: this.options.keepAttributes,
902
1239
  getAttributes: (match) => ({ start: +match[1], ...this.editor.getAttributes(TextStyleName2) }),
903
- joinPredicate: (match, node) => node.childCount + node.attrs.start === +match[1],
1240
+ joinPredicate,
904
1241
  editor: this.editor
905
1242
  });
906
1243
  }
@@ -1284,12 +1621,22 @@ export {
1284
1621
  ListItem,
1285
1622
  ListKeymap,
1286
1623
  ListKit,
1624
+ ORDERED_LIST_MARKER_PATTERN,
1287
1625
  OrderedList,
1288
1626
  TaskItem,
1289
1627
  TaskList,
1628
+ areOrderedListMarkersSequential,
1629
+ buildOrderedListAttrsFromMarker,
1290
1630
  bulletListInputRegex,
1631
+ detectMarkerType,
1632
+ getListMarker,
1291
1633
  inputRegex,
1292
1634
  listHelpers_exports as listHelpers,
1293
- orderedListInputRegex
1635
+ markerToStart,
1636
+ orderedListInputRegex,
1637
+ parseListMarker,
1638
+ parsePlainTextOrderedListPaste,
1639
+ toRoman,
1640
+ toRomanUpper
1294
1641
  };
1295
1642
  //# sourceMappingURL=index.js.map