@milkdown/preset-gfm 7.2.3 → 7.2.4

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/lib/index.es.js CHANGED
@@ -2,10 +2,11 @@ import { expectDomTypeError as O } from "@milkdown/exception";
2
2
  import { paragraphSchema as Q, listItemSchema as Ie } from "@milkdown/preset-commonmark";
3
3
  import { InputRule as Y } from "@milkdown/prose/inputrules";
4
4
  import { $markAttr as $e, $markSchema as _e, $command as h, $useKeymap as ee, $nodeSchema as k, $inputRule as te, $prose as B, $remark as Pe } from "@milkdown/utils";
5
- import { commandsCtx as M } from "@milkdown/core";
5
+ import { commandsCtx as A } from "@milkdown/core";
6
6
  import { TextSelection as Ee, Selection as oe, PluginKey as De, Plugin as Oe } from "@milkdown/prose/state";
7
7
  import { TableMap as g, CellSelection as y, tableNodes as Be, goToNextCell as ne, isInTable as N, deleteTable as Ke, deleteColumn as He, deleteRow as Le, addColumnBefore as Fe, addColumnAfter as We, selectedRect as le, setCellAttr as ze, columnResizing as Ge, tableEditing as je } from "@milkdown/prose/tables";
8
- import { toggleMarkdownMark as Ze, findParentNode as Ve, cloneTr as A, browser as V } from "@milkdown/prose";
8
+ import { findParentNode as Ze, cloneTr as M, browser as V } from "@milkdown/prose";
9
+ import { toggleMark as Ve } from "@milkdown/prose/commands";
9
10
  import Ue from "remark-gfm";
10
11
  const d = (e, t) => (Object.assign(e, {
11
12
  meta: {
@@ -44,10 +45,7 @@ d(x.ctx, {
44
45
  displayName: "MarkSchemaCtx<strikethrough>",
45
46
  group: "Strikethrough"
46
47
  });
47
- const H = h("ToggleStrikeThrough", () => () => {
48
- const e = x.type();
49
- return Ze(e, "~~");
50
- });
48
+ const H = h("ToggleStrikeThrough", (e) => () => Ve(x.type(e)));
51
49
  d(H, {
52
50
  displayName: "Command<ToggleStrikethrough>",
53
51
  group: "Strikethrough"
@@ -56,7 +54,7 @@ const L = ee("strikeThroughKeymap", {
56
54
  ToggleStrikethrough: {
57
55
  shortcuts: "Mod-Alt-x",
58
56
  command: (e) => {
59
- const t = e.get(M);
57
+ const t = e.get(A);
60
58
  return () => t.call(H.key);
61
59
  }
62
60
  }
@@ -69,10 +67,10 @@ d(L.shortcuts, {
69
67
  displayName: "Keymap<strikethrough>",
70
68
  group: "Strikethrough"
71
69
  });
72
- const re = (e = 3, t = 3) => {
73
- const n = Array(t).fill(0).map(() => R.type().createAndFill()), o = Array(t).fill(0).map(() => I.type().createAndFill()), l = Array(e).fill(0).map((r, a) => S.type().create(null, a === 0 ? o : n));
74
- return T.type().create(null, l);
75
- }, w = (e) => Ve((t) => t.type.spec.tableRole === "table")(e), b = (e, t) => {
70
+ const re = (e, t = 3, n = 3) => {
71
+ const o = Array(n).fill(0).map(() => R.type(e).createAndFill()), l = Array(n).fill(0).map(() => I.type(e).createAndFill()), r = Array(t).fill(0).map((s, c) => S.type(e).create(null, c === 0 ? l : o));
72
+ return T.type(e).create(null, r);
73
+ }, w = (e) => Ze((t) => t.type.spec.tableRole === "table")(e), b = (e, t) => {
76
74
  const n = w(t);
77
75
  if (!n)
78
76
  return;
@@ -82,10 +80,10 @@ const re = (e = 3, t = 3) => {
82
80
  const r = n.node.nodeAt(l);
83
81
  if (!r)
84
82
  return;
85
- const a = l + n.start;
83
+ const s = l + n.start;
86
84
  return {
87
- pos: a,
88
- start: a + 1,
85
+ pos: s,
86
+ start: s + 1,
89
87
  node: r
90
88
  };
91
89
  }).filter((l) => l != null);
@@ -99,10 +97,10 @@ const re = (e = 3, t = 3) => {
99
97
  const r = n.node.nodeAt(l);
100
98
  if (!r)
101
99
  return;
102
- const a = l + n.start;
100
+ const s = l + n.start;
103
101
  return {
104
- pos: a,
105
- start: a + 1,
102
+ pos: s,
103
+ start: s + 1,
106
104
  node: r
107
105
  };
108
106
  }).filter((l) => l != null);
@@ -117,8 +115,8 @@ const re = (e = 3, t = 3) => {
117
115
  top: 0,
118
116
  bottom: n.height
119
117
  }).map((l) => {
120
- const r = t.node.nodeAt(l), a = l + t.start;
121
- return { pos: a, start: a + 1, node: r };
118
+ const r = t.node.nodeAt(l), s = l + t.start;
119
+ return { pos: s, start: s + 1, node: r };
122
120
  });
123
121
  }, qe = (e) => {
124
122
  const t = Xe(e.selection);
@@ -126,47 +124,47 @@ const re = (e = 3, t = 3) => {
126
124
  const n = e.doc.resolve(t[0].pos), o = t[t.length - 1];
127
125
  if (o) {
128
126
  const l = e.doc.resolve(o.pos);
129
- return A(e.setSelection(new y(l, n)));
127
+ return M(e.setSelection(new y(l, n)));
130
128
  }
131
129
  }
132
130
  return e;
133
131
  };
134
- function ae(e, { map: t, tableStart: n, table: o }, l) {
135
- const r = Array(l).fill(0).reduce((i, c, m) => i + o.child(m).nodeSize, n), a = Array(t.width).fill(0).map((i, c) => {
136
- const m = o.nodeAt(t.map[c]);
137
- return R.type().createAndFill({ alignment: m == null ? void 0 : m.attrs.alignment });
132
+ function ae(e, t, { map: n, tableStart: o, table: l }, r) {
133
+ const s = Array(r).fill(0).reduce((i, m, a) => i + l.child(a).nodeSize, o), c = Array(n.width).fill(0).map((i, m) => {
134
+ const a = l.nodeAt(n.map[m]);
135
+ return R.type(e).createAndFill({ alignment: a == null ? void 0 : a.attrs.alignment });
138
136
  });
139
- return e.insert(r, S.type().create(null, a)), e;
137
+ return t.insert(s, S.type(e).create(null, c)), t;
140
138
  }
141
139
  const se = (e) => (t) => (n) => {
142
140
  const o = w(n.selection), l = e === "row";
143
141
  if (o) {
144
142
  const r = g.get(o.node);
145
143
  if (t >= 0 && t < (l ? r.height : r.width)) {
146
- const a = r.positionAt(
144
+ const s = r.positionAt(
147
145
  l ? t : r.height - 1,
148
146
  l ? r.width - 1 : t,
149
147
  o.node
150
- ), i = n.doc.resolve(o.start + a), c = l ? y.rowSelection : y.colSelection, m = r.positionAt(l ? t : 0, l ? 0 : t, o.node), s = n.doc.resolve(o.start + m);
151
- return A(n.setSelection(c(i, s)));
148
+ ), c = n.doc.resolve(o.start + s), i = l ? y.rowSelection : y.colSelection, m = r.positionAt(l ? t : 0, l ? 0 : t, o.node), a = n.doc.resolve(o.start + m);
149
+ return M(n.setSelection(i(c, a)));
152
150
  }
153
151
  }
154
152
  return n;
155
153
  }, Je = se("row"), Qe = se("col"), U = (e) => e[0].map((t, n) => e.map((o) => o[n])), ce = (e, t) => {
156
154
  const n = [], o = g.get(e);
157
155
  for (let r = 0; r < o.height; r++) {
158
- const a = e.child(r), i = [];
159
- for (let c = 0; c < o.width; c++) {
160
- if (!t[r][c])
156
+ const s = e.child(r), c = [];
157
+ for (let i = 0; i < o.width; i++) {
158
+ if (!t[r][i])
161
159
  continue;
162
- const m = o.map[r * o.width + c], s = t[r][c], p = e.nodeAt(m).type.createChecked(
163
- Object.assign({}, s.attrs),
164
- s.content,
165
- s.marks
160
+ const m = o.map[r * o.width + i], a = t[r][i], p = e.nodeAt(m).type.createChecked(
161
+ Object.assign({}, a.attrs),
162
+ a.content,
163
+ a.marks
166
164
  );
167
- i.push(p);
165
+ c.push(p);
168
166
  }
169
- n.push(a.type.createChecked(a.attrs, i, a.marks));
167
+ n.push(s.type.createChecked(s.attrs, c, s.marks));
170
168
  }
171
169
  return e.type.createChecked(
172
170
  e.attrs,
@@ -177,21 +175,21 @@ const se = (e) => (t) => (n) => {
177
175
  const t = g.get(e), n = [];
178
176
  for (let o = 0; o < t.height; o++) {
179
177
  const l = [], r = {};
180
- for (let a = 0; a < t.width; a++) {
181
- const i = t.map[o * t.width + a], c = e.nodeAt(i), m = t.findCell(i);
182
- if (r[i] || m.top !== o) {
178
+ for (let s = 0; s < t.width; s++) {
179
+ const c = t.map[o * t.width + s], i = e.nodeAt(c), m = t.findCell(c);
180
+ if (r[c] || m.top !== o) {
183
181
  l.push(null);
184
182
  continue;
185
183
  }
186
- r[i] = !0, l.push(c);
184
+ r[c] = !0, l.push(i);
187
185
  }
188
186
  n.push(l);
189
187
  }
190
188
  return n;
191
189
  }, de = (e, t, n, o) => {
192
- const l = t[0] > n[0] ? -1 : 1, r = e.splice(t[0], t.length), a = r.length % 2 === 0 ? 1 : 0;
193
- let i;
194
- return o === -1 && l === 1 ? i = n[0] - 1 : o === 1 && l === -1 ? i = n[n.length - 1] - a + 1 : i = l === -1 ? n[0] : n[n.length - 1] - a, e.splice(i, 0, ...r), e;
190
+ const l = t[0] > n[0] ? -1 : 1, r = e.splice(t[0], t.length), s = r.length % 2 === 0 ? 1 : 0;
191
+ let c;
192
+ return o === -1 && l === 1 ? c = n[0] - 1 : o === 1 && l === -1 ? c = n[n.length - 1] - s + 1 : c = l === -1 ? n[0] : n[n.length - 1] - s, e.splice(c, 0, ...r), e;
195
193
  }, Ye = (e, t, n, o) => {
196
194
  let l = U(ie(e.node));
197
195
  return l = de(l, t, n, o), l = U(l), ce(e.node, l);
@@ -200,122 +198,122 @@ const se = (e) => (t) => (n) => {
200
198
  return l = de(l, t, n, o), ce(e.node, l);
201
199
  }, X = (e, t) => {
202
200
  let n = e, o = e;
203
- for (let s = e; s >= 0; s--) {
204
- const u = b(s, t.selection);
201
+ for (let a = e; a >= 0; a--) {
202
+ const u = b(a, t.selection);
205
203
  u && u.forEach((p) => {
206
- const f = p.node.attrs.colspan + s - 1;
207
- f >= n && (n = s), f > o && (o = f);
204
+ const f = p.node.attrs.colspan + a - 1;
205
+ f >= n && (n = a), f > o && (o = f);
208
206
  });
209
207
  }
210
- for (let s = e; s <= o; s++) {
211
- const u = b(s, t.selection);
208
+ for (let a = e; a <= o; a++) {
209
+ const u = b(a, t.selection);
212
210
  u && u.forEach((p) => {
213
- const f = p.node.attrs.colspan + s - 1;
211
+ const f = p.node.attrs.colspan + a - 1;
214
212
  p.node.attrs.colspan > 1 && f > o && (o = f);
215
213
  });
216
214
  }
217
215
  const l = [];
218
- for (let s = n; s <= o; s++) {
219
- const u = b(s, t.selection);
220
- u && u.length && l.push(s);
216
+ for (let a = n; a <= o; a++) {
217
+ const u = b(a, t.selection);
218
+ u && u.length && l.push(a);
221
219
  }
222
220
  n = l[0], o = l[l.length - 1];
223
- const r = b(n, t.selection), a = C(0, t.selection), i = t.doc.resolve(
221
+ const r = b(n, t.selection), s = C(0, t.selection), c = t.doc.resolve(
224
222
  r[r.length - 1].pos
225
223
  );
226
- let c;
227
- for (let s = o; s >= n; s--) {
228
- const u = b(s, t.selection);
224
+ let i;
225
+ for (let a = o; a >= n; a--) {
226
+ const u = b(a, t.selection);
229
227
  if (u && u.length) {
230
- for (let p = a.length - 1; p >= 0; p--)
231
- if (a[p].pos === u[0].pos) {
232
- c = u[0];
228
+ for (let p = s.length - 1; p >= 0; p--)
229
+ if (s[p].pos === u[0].pos) {
230
+ i = u[0];
233
231
  break;
234
232
  }
235
- if (c)
233
+ if (i)
236
234
  break;
237
235
  }
238
236
  }
239
- const m = t.doc.resolve(c.pos);
240
- return { $anchor: i, $head: m, indexes: l };
237
+ const m = t.doc.resolve(i.pos);
238
+ return { $anchor: c, $head: m, indexes: l };
241
239
  }, q = (e, t) => {
242
240
  let n = e, o = e;
243
- for (let s = e; s >= 0; s--)
244
- C(s, t.selection).forEach((p) => {
245
- const f = p.node.attrs.rowspan + s - 1;
246
- f >= n && (n = s), f > o && (o = f);
241
+ for (let a = e; a >= 0; a--)
242
+ C(a, t.selection).forEach((p) => {
243
+ const f = p.node.attrs.rowspan + a - 1;
244
+ f >= n && (n = a), f > o && (o = f);
247
245
  });
248
- for (let s = e; s <= o; s++)
249
- C(s, t.selection).forEach((p) => {
250
- const f = p.node.attrs.rowspan + s - 1;
246
+ for (let a = e; a <= o; a++)
247
+ C(a, t.selection).forEach((p) => {
248
+ const f = p.node.attrs.rowspan + a - 1;
251
249
  p.node.attrs.rowspan > 1 && f > o && (o = f);
252
250
  });
253
251
  const l = [];
254
- for (let s = n; s <= o; s++) {
255
- const u = C(s, t.selection);
256
- u && u.length && l.push(s);
252
+ for (let a = n; a <= o; a++) {
253
+ const u = C(a, t.selection);
254
+ u && u.length && l.push(a);
257
255
  }
258
256
  n = l[0], o = l[l.length - 1];
259
- const r = C(n, t.selection), a = b(0, t.selection), i = t.doc.resolve(r[r.length - 1].pos);
260
- let c;
261
- for (let s = o; s >= n; s--) {
262
- const u = C(s, t.selection);
257
+ const r = C(n, t.selection), s = b(0, t.selection), c = t.doc.resolve(r[r.length - 1].pos);
258
+ let i;
259
+ for (let a = o; a >= n; a--) {
260
+ const u = C(a, t.selection);
263
261
  if (u && u.length) {
264
- for (let p = a.length - 1; p >= 0; p--)
265
- if (a[p].pos === u[0].pos) {
266
- c = u[0];
262
+ for (let p = s.length - 1; p >= 0; p--)
263
+ if (s[p].pos === u[0].pos) {
264
+ i = u[0];
267
265
  break;
268
266
  }
269
- if (c)
267
+ if (i)
270
268
  break;
271
269
  }
272
270
  }
273
- const m = t.doc.resolve(c.pos);
274
- return { $anchor: i, $head: m, indexes: l };
271
+ const m = t.doc.resolve(i.pos);
272
+ return { $anchor: c, $head: m, indexes: l };
275
273
  };
276
274
  function tt(e, t, n, o = !0) {
277
275
  const l = w(e.selection);
278
276
  if (!l)
279
277
  return e;
280
- const { indexes: r } = X(t, e), { indexes: a } = X(n, e);
278
+ const { indexes: r } = X(t, e), { indexes: s } = X(n, e);
281
279
  if (r.includes(n))
282
280
  return e;
283
- const i = Ye(
281
+ const c = Ye(
284
282
  l,
285
283
  r,
286
- a,
284
+ s,
287
285
  0
288
- ), c = A(e).replaceWith(
286
+ ), i = M(e).replaceWith(
289
287
  l.pos,
290
288
  l.pos + l.node.nodeSize,
291
- i
289
+ c
292
290
  );
293
291
  if (!o)
294
- return c;
295
- const m = g.get(i), s = l.start, u = n, p = m.positionAt(m.height - 1, u, i), f = c.doc.resolve(s + p), $ = y.colSelection, _ = m.positionAt(0, u, i), P = c.doc.resolve(s + _);
296
- return c.setSelection($(f, P));
292
+ return i;
293
+ const m = g.get(c), a = l.start, u = n, p = m.positionAt(m.height - 1, u, c), f = i.doc.resolve(a + p), $ = y.colSelection, _ = m.positionAt(0, u, c), P = i.doc.resolve(a + _);
294
+ return i.setSelection($(f, P));
297
295
  }
298
296
  function ot(e, t, n, o = !0) {
299
297
  const l = w(e.selection);
300
298
  if (!l)
301
299
  return e;
302
- const { indexes: r } = q(t, e), { indexes: a } = q(n, e);
300
+ const { indexes: r } = q(t, e), { indexes: s } = q(n, e);
303
301
  if (r.includes(n))
304
302
  return e;
305
- const i = et(
303
+ const c = et(
306
304
  l,
307
305
  r,
308
- a,
306
+ s,
309
307
  0
310
- ), c = A(e).replaceWith(
308
+ ), i = M(e).replaceWith(
311
309
  l.pos,
312
310
  l.pos + l.node.nodeSize,
313
- i
311
+ c
314
312
  );
315
313
  if (!o)
316
- return c;
317
- const m = g.get(i), s = l.start, u = n, p = m.positionAt(u, m.width - 1, i), f = c.doc.resolve(s + p), $ = y.rowSelection, _ = m.positionAt(u, 0, i), P = c.doc.resolve(s + _);
318
- return c.setSelection($(f, P));
314
+ return i;
315
+ const m = g.get(c), a = l.start, u = n, p = m.positionAt(u, m.width - 1, c), f = i.doc.resolve(a + p), $ = y.rowSelection, _ = m.positionAt(u, 0, c), P = i.doc.resolve(a + _);
316
+ return i.setSelection($(f, P));
319
317
  }
320
318
  const v = Be({
321
319
  tableGroup: "block",
@@ -334,10 +332,10 @@ const v = Be({
334
332
  parseMarkdown: {
335
333
  match: (e) => e.type === "table",
336
334
  runner: (e, t, n) => {
337
- const o = t.align, l = t.children.map((r, a) => ({
335
+ const o = t.align, l = t.children.map((r, s) => ({
338
336
  ...r,
339
337
  align: o,
340
- isHeader: a === 0
338
+ isHeader: s === 0
341
339
  }));
342
340
  e.openNode(n), e.next(l), e.closeNode();
343
341
  }
@@ -369,9 +367,9 @@ const S = k("table_row", () => ({
369
367
  parseMarkdown: {
370
368
  match: (e) => e.type === "tableRow",
371
369
  runner: (e, t, n) => {
372
- const o = t.align, l = t.children.map((r, a) => ({
370
+ const o = t.align, l = t.children.map((r, s) => ({
373
371
  ...r,
374
- align: o[a],
372
+ align: o[s],
375
373
  isHeader: t.isHeader
376
374
  }));
377
375
  e.openNode(n), e.next(l), e.closeNode();
@@ -440,18 +438,19 @@ d(I.ctx, {
440
438
  displayName: "NodeSchemaCtx<tableHeader>",
441
439
  group: "Table"
442
440
  });
443
- const me = te(() => new Y(
441
+ const me = te((e) => new Y(
444
442
  /^\|(?<col>\d+)[xX](?<row>\d+)\|\s$/,
445
- (e, t, n, o) => {
446
- var i, c;
447
- const l = e.doc.resolve(n);
448
- if (!l.node(-1).canReplaceWith(l.index(-1), l.indexAfter(-1), T.type()))
443
+ (t, n, o, l) => {
444
+ var i, m;
445
+ const r = t.doc.resolve(o);
446
+ if (!r.node(-1).canReplaceWith(r.index(-1), r.indexAfter(-1), T.type(e)))
449
447
  return null;
450
- const r = re(
451
- Number((i = t.groups) == null ? void 0 : i.row),
452
- Number((c = t.groups) == null ? void 0 : c.col)
453
- ), a = e.tr.replaceRangeWith(n, o, r).scrollIntoView();
454
- return a.setSelection(Ee.create(a.doc, n + 3));
448
+ const s = re(
449
+ e,
450
+ Number((i = n.groups) == null ? void 0 : i.row),
451
+ Number((m = n.groups) == null ? void 0 : m.col)
452
+ ), c = t.tr.replaceRangeWith(o, l, s);
453
+ return c.setSelection(Ee.create(c.doc, o + 3)).scrollIntoView();
455
454
  }
456
455
  ));
457
456
  d(me, {
@@ -468,19 +467,19 @@ d(W, {
468
467
  displayName: "Command<goToNextTableCellCommand>",
469
468
  group: "Table"
470
469
  });
471
- const z = h("BreakTable", () => () => (e, t) => {
472
- if (!N(e))
470
+ const z = h("BreakTable", (e) => () => (t, n) => {
471
+ if (!N(t))
473
472
  return !1;
474
- const { $head: n } = e.selection, o = n.after(), l = e.tr.replaceWith(o, o, Q.type().createAndFill());
475
- return l.setSelection(oe.near(l.doc.resolve(o), 1)).scrollIntoView(), t == null || t(l), !0;
473
+ const { $head: o } = t.selection, l = o.after(), r = t.tr.replaceWith(l, l, Q.type(e).createAndFill());
474
+ return r.setSelection(oe.near(r.doc.resolve(l), 1)).scrollIntoView(), n == null || n(r), !0;
476
475
  });
477
476
  d(z, {
478
477
  displayName: "Command<breakTableCommand>",
479
478
  group: "Table"
480
479
  });
481
- const ue = h("InsertTable", () => ({ row: e, col: t } = {}) => (n, o) => {
482
- const { selection: l, tr: r } = n, { from: a } = l, i = re(e, t), c = r.replaceSelectionWith(i), m = oe.findFrom(c.doc.resolve(a), 1, !0);
483
- return m && (o == null || o(c.setSelection(m))), !0;
480
+ const ue = h("InsertTable", (e) => ({ row: t, col: n } = {}) => (o, l) => {
481
+ const { selection: r, tr: s } = o, { from: c } = r, i = re(e, t, n), m = s.replaceSelectionWith(i), a = oe.findFrom(m.doc.resolve(c), 1, !0);
482
+ return a && m.setSelection(a), l == null || l(m), !0;
484
483
  });
485
484
  d(ue, {
486
485
  displayName: "Command<insertTableCommand>",
@@ -547,12 +546,12 @@ d(ke, {
547
546
  displayName: "Command<addColAfterCommand>",
548
547
  group: "Table"
549
548
  });
550
- const we = h("AddRowBefore", () => () => (e, t) => {
551
- if (!N(e))
549
+ const we = h("AddRowBefore", (e) => () => (t, n) => {
550
+ if (!N(t))
552
551
  return !1;
553
- if (t) {
554
- const n = le(e);
555
- t(ae(e.tr, n, n.top));
552
+ if (n) {
553
+ const o = le(t);
554
+ n(ae(e, t.tr, o, o.top));
556
555
  }
557
556
  return !0;
558
557
  });
@@ -560,12 +559,12 @@ d(we, {
560
559
  displayName: "Command<addRowBeforeCommand>",
561
560
  group: "Table"
562
561
  });
563
- const Ne = h("AddRowAfter", () => () => (e, t) => {
564
- if (!N(e))
562
+ const Ne = h("AddRowAfter", (e) => () => (t, n) => {
563
+ if (!N(t))
565
564
  return !1;
566
- if (t) {
567
- const n = le(e);
568
- t(ae(e.tr, n, n.bottom));
565
+ if (n) {
566
+ const o = le(t);
567
+ n(ae(e, t.tr, o, o.bottom));
569
568
  }
570
569
  return !0;
571
570
  });
@@ -582,21 +581,21 @@ const G = ee("tableKeymap", {
582
581
  NextCell: {
583
582
  shortcuts: ["Mod-]", "Tab"],
584
583
  command: (e) => {
585
- const t = e.get(M);
584
+ const t = e.get(A);
586
585
  return () => t.call(W.key);
587
586
  }
588
587
  },
589
588
  PrevCell: {
590
589
  shortcuts: ["Mod-[", "Shift-Tab"],
591
590
  command: (e) => {
592
- const t = e.get(M);
591
+ const t = e.get(A);
593
592
  return () => t.call(F.key);
594
593
  }
595
594
  },
596
595
  ExitTable: {
597
596
  shortcuts: ["Mod-Enter"],
598
597
  command: (e) => {
599
- const t = e.get(M);
598
+ const t = e.get(A);
600
599
  return () => t.call(z.key);
601
600
  }
602
601
  }
@@ -773,8 +772,8 @@ const Se = Ie.extendSchema((e) => (t) => {
773
772
  n.parseMarkdown.runner(o, l, r);
774
773
  return;
775
774
  }
776
- const a = l.label != null ? `${l.label}.` : "•", i = l.checked != null ? !!l.checked : null, c = l.label != null ? "ordered" : "bullet", m = l.spread != null ? `${l.spread}` : "true";
777
- o.openNode(r, { label: a, listType: c, spread: m, checked: i }), o.next(l.children), o.closeNode();
775
+ const s = l.label != null ? `${l.label}.` : "•", c = l.checked != null ? !!l.checked : null, i = l.label != null ? "ordered" : "bullet", m = l.spread != null ? `${l.spread}` : "true";
776
+ o.openNode(r, { label: s, listType: i, spread: m, checked: c }), o.next(l.children), o.closeNode();
778
777
  }
779
778
  },
780
779
  toMarkdown: {
@@ -784,8 +783,8 @@ const Se = Ie.extendSchema((e) => (t) => {
784
783
  n.toMarkdown.runner(o, l);
785
784
  return;
786
785
  }
787
- const r = l.attrs.label, a = l.attrs.listType, i = l.attrs.spread === "true", c = l.attrs.checked;
788
- o.openNode("listItem", void 0, { label: r, listType: a, spread: i, checked: c }), o.next(l.content), o.closeNode();
786
+ const r = l.attrs.label, s = l.attrs.listType, c = l.attrs.spread === "true", i = l.attrs.checked;
787
+ o.openNode("listItem", void 0, { label: r, listType: s, spread: c, checked: i }), o.next(l.content), o.closeNode();
789
788
  }
790
789
  }
791
790
  };
@@ -795,15 +794,15 @@ d(Se, {
795
794
  group: "ListItem"
796
795
  });
797
796
  const Re = te(() => new Y(/^\[(?<checked>\s|x)\]\s$/, (e, t, n, o) => {
798
- var s;
797
+ var a;
799
798
  const l = e.doc.resolve(n);
800
- let r = 0, a = l.node(r);
801
- for (; a && a.type.name !== "list_item"; )
802
- r--, a = l.node(r);
803
- if (!a || a.attrs.checked != null)
799
+ let r = 0, s = l.node(r);
800
+ for (; s && s.type.name !== "list_item"; )
801
+ r--, s = l.node(r);
802
+ if (!s || s.attrs.checked != null)
804
803
  return null;
805
- const i = ((s = t.groups) == null ? void 0 : s.checked) === "x", c = l.before(r), m = e.tr;
806
- return m.deleteRange(n, o).setNodeMarkup(c, void 0, { ...a.attrs, checked: i }), m;
804
+ const c = ((a = t.groups) == null ? void 0 : a.checked) === "x", i = l.before(r), m = e.tr;
805
+ return m.deleteRange(n, o).setNodeMarkup(i, void 0, { ...s.attrs, checked: c }), m;
807
806
  }));
808
807
  d(Re, {
809
808
  displayName: "InputRule<wrapInTaskListInputRule>",
@@ -815,30 +814,30 @@ const nt = [
815
814
  ].flat(), lt = [
816
815
  me,
817
816
  Re
818
- ], Me = B(() => {
819
- const e = new De("MILKDOWN_AUTO_INSERT_ZERO_SPACE"), t = (o) => o.type === Q.type(), n = (o) => t(o) && o.nodeSize === 2;
817
+ ], Ae = B((e) => {
818
+ const t = new De("MILKDOWN_AUTO_INSERT_ZERO_SPACE"), n = (l) => l.type === Q.type(e), o = (l) => n(l) && l.nodeSize === 2;
820
819
  return new Oe({
821
- key: e,
820
+ key: t,
822
821
  props: {
823
822
  handleDOMEvents: {
824
- compositionstart(o) {
825
- const { state: l, dispatch: r } = o, { tr: a, selection: i } = l, { $from: c } = i;
826
- return V.safari && N(l) && i.empty && n(c.parent) && r(a.insertText("⁠", c.start())), !1;
823
+ compositionstart(l) {
824
+ const { state: r, dispatch: s } = l, { tr: c, selection: i } = r, { $from: m } = i;
825
+ return V.safari && N(r) && i.empty && o(m.parent) && s(c.insertText("⁠", m.start())), !1;
827
826
  },
828
- compositionend(o) {
829
- const { state: l, dispatch: r } = o, { tr: a, selection: i } = l, { $from: c } = i;
830
- return V.safari && N(l) && i.empty && t(c.parent) && c.parent.textContent.startsWith("⁠") && r(a.delete(c.start(), c.start() + 1)), !1;
827
+ compositionend(l) {
828
+ const { state: r, dispatch: s } = l, { tr: c, selection: i } = r, { $from: m } = i;
829
+ return V.safari && N(r) && i.empty && n(m.parent) && m.parent.textContent.startsWith("⁠") && s(c.delete(m.start(), m.start() + 1)), !1;
831
830
  }
832
831
  }
833
832
  }
834
833
  });
835
834
  });
836
- d(Me, {
835
+ d(Ae, {
837
836
  displayName: "Prose<autoInsertZeroSpaceInTablePlugin>",
838
837
  group: "Prose"
839
838
  });
840
- const Ae = B(() => Ge({}));
841
- d(Ae, {
839
+ const Me = B(() => Ge({}));
840
+ d(Me, {
842
841
  displayName: "Prose<columnResizingPlugin>",
843
842
  group: "Prose"
844
843
  });
@@ -853,8 +852,8 @@ d(ve, {
853
852
  group: "Remark"
854
853
  });
855
854
  const rt = [
856
- Me,
857
855
  Ae,
856
+ Me,
858
857
  xe,
859
858
  ve
860
859
  ], at = [
@@ -884,7 +883,7 @@ const rt = [
884
883
  ke,
885
884
  Te,
886
885
  H
887
- ], bt = [at, lt, nt, rt, st].flat();
886
+ ], Ct = [at, lt, nt, rt, st].flat();
888
887
  export {
889
888
  ke as addColAfterCommand,
890
889
  ye as addColBeforeCommand,
@@ -902,7 +901,7 @@ export {
902
901
  Xe as getAllCellsInTable,
903
902
  b as getCellsInCol,
904
903
  C as getCellsInRow,
905
- bt as gfm,
904
+ Ct as gfm,
906
905
  W as goToNextTableCellCommand,
907
906
  F as goToPrevTableCellCommand,
908
907
  lt as inputrules,