@milkdown/preset-commonmark 7.0.0-next.0 → 7.0.0-next.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.
Files changed (69) hide show
  1. package/lib/composed/commands.d.ts.map +1 -1
  2. package/lib/composed/inputrules.d.ts.map +1 -1
  3. package/lib/composed/keymap.d.ts.map +1 -1
  4. package/lib/composed/plugins.d.ts +2 -1
  5. package/lib/composed/plugins.d.ts.map +1 -1
  6. package/lib/composed/schema.d.ts.map +1 -1
  7. package/lib/index.d.ts.map +1 -1
  8. package/lib/index.es.js +15 -17
  9. package/lib/index.es.js.map +1 -1
  10. package/lib/mark/emphasis.d.ts.map +1 -1
  11. package/lib/mark/inline-code.d.ts.map +1 -1
  12. package/lib/mark/link.d.ts.map +1 -1
  13. package/lib/mark/strong.d.ts.map +1 -1
  14. package/lib/node/blockquote.d.ts.map +1 -1
  15. package/lib/node/bullet-list.d.ts.map +1 -1
  16. package/lib/node/code-block.d.ts.map +1 -1
  17. package/lib/node/doc.d.ts.map +1 -1
  18. package/lib/node/hardbreak.d.ts.map +1 -1
  19. package/lib/node/heading.d.ts.map +1 -1
  20. package/lib/node/hr.d.ts.map +1 -1
  21. package/lib/node/image.d.ts.map +1 -1
  22. package/lib/node/list-item.d.ts +1 -1
  23. package/lib/node/list-item.d.ts.map +1 -1
  24. package/lib/node/ordered-list.d.ts.map +1 -1
  25. package/lib/node/paragraph.d.ts.map +1 -1
  26. package/lib/node/text.d.ts.map +1 -1
  27. package/lib/plugin/hardbreak-clear-mark-plugin.d.ts.map +1 -1
  28. package/lib/plugin/hardbreak-filter-plugin.d.ts.map +1 -1
  29. package/lib/plugin/inline-nodes-cursor-plugin.d.ts +0 -4
  30. package/lib/plugin/inline-nodes-cursor-plugin.d.ts.map +1 -1
  31. package/lib/plugin/inline-sync-plugin/config.d.ts.map +1 -1
  32. package/lib/plugin/inline-sync-plugin/inline-sync-plugin.d.ts.map +1 -1
  33. package/lib/plugin/remark-add-order-in-list-plugin.d.ts.map +1 -1
  34. package/lib/plugin/remark-inline-link-plugin.d.ts.map +1 -1
  35. package/lib/plugin/remark-line-break.d.ts.map +1 -1
  36. package/lib/plugin/sync-heading-id-plugin.d.ts.map +1 -1
  37. package/package.json +6 -6
  38. package/src/composed/commands.ts +1 -0
  39. package/src/composed/inputrules.ts +1 -0
  40. package/src/composed/keymap.ts +1 -0
  41. package/src/composed/plugins.ts +3 -1
  42. package/src/composed/schema.ts +1 -0
  43. package/src/index.ts +1 -0
  44. package/src/mark/emphasis.ts +5 -0
  45. package/src/mark/inline-code.ts +6 -0
  46. package/src/mark/link.ts +9 -0
  47. package/src/mark/strong.ts +6 -0
  48. package/src/node/blockquote.ts +7 -0
  49. package/src/node/bullet-list.ts +7 -0
  50. package/src/node/code-block.ts +10 -0
  51. package/src/node/doc.ts +1 -0
  52. package/src/node/hardbreak.ts +8 -0
  53. package/src/node/heading.ts +16 -2
  54. package/src/node/hr.ts +6 -0
  55. package/src/node/image.ts +11 -0
  56. package/src/node/list-item.ts +46 -1
  57. package/src/node/ordered-list.ts +6 -0
  58. package/src/node/paragraph.ts +6 -0
  59. package/src/node/text.ts +1 -0
  60. package/src/plugin/hardbreak-clear-mark-plugin.ts +1 -0
  61. package/src/plugin/hardbreak-filter-plugin.ts +3 -1
  62. package/src/plugin/inline-nodes-cursor-plugin.ts +1 -4
  63. package/src/plugin/inline-sync-plugin/config.ts +15 -1
  64. package/src/plugin/inline-sync-plugin/inline-sync-plugin.ts +5 -0
  65. package/src/plugin/remark-add-order-in-list-plugin.ts +1 -0
  66. package/src/plugin/remark-inline-link-plugin.ts +1 -0
  67. package/src/plugin/remark-line-break.ts +3 -0
  68. package/src/plugin/sync-heading-id-plugin.ts +2 -0
  69. package/src/plugin/sync-list-order-plugin.ts +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../src/composed/commands.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAInD,eAAO,MAAM,QAAQ,EAAE,cAAc,EAwBpC,CAAA"}
1
+ {"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../src/composed/commands.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAKnD,eAAO,MAAM,QAAQ,EAAE,cAAc,EAwBpC,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"inputrules.d.ts","sourceRoot":"","sources":["../../src/composed/inputrules.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAGnD,eAAO,MAAM,UAAU,EAAE,cAAc,EAO/B,CAAA"}
1
+ {"version":3,"file":"inputrules.d.ts","sourceRoot":"","sources":["../../src/composed/inputrules.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAInD,eAAO,MAAM,UAAU,EAAE,cAAc,EAO/B,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"keymap.d.ts","sourceRoot":"","sources":["../../src/composed/keymap.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAInD,eAAO,MAAM,MAAM,EAAE,cAAc,EAa3B,CAAA"}
1
+ {"version":3,"file":"keymap.d.ts","sourceRoot":"","sources":["../../src/composed/keymap.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAKnD,eAAO,MAAM,MAAM,EAAE,cAAc,EAa3B,CAAA"}
@@ -1,2 +1,3 @@
1
- export declare const plugins: (import("@milkdown/utils").$Prose | import("@milkdown/utils").$Remark | import("@milkdown/utils").$Ctx<import("../plugin").InlineSyncConfig, "inlineSyncConfig"> | import("@milkdown/utils").$Ctx<string[], "hardbreakFilterNodes">)[];
1
+ import type { MilkdownPlugin } from '@milkdown/ctx';
2
+ export declare const plugins: MilkdownPlugin[];
2
3
  //# sourceMappingURL=plugins.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"plugins.d.ts","sourceRoot":"","sources":["../../src/composed/plugins.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,OAAO,wOAgBnB,CAAA"}
1
+ {"version":3,"file":"plugins.d.ts","sourceRoot":"","sources":["../../src/composed/plugins.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAInD,eAAO,MAAM,OAAO,EAAE,cAAc,EAgBnC,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/composed/schema.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAInD,eAAO,MAAM,MAAM,EAAE,cAAc,EA+C3B,CAAA"}
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/composed/schema.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAKnD,eAAO,MAAM,MAAM,EAAE,cAAc,EA+C3B,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,cAAc,QAAQ,CAAA;AACtB,cAAc,QAAQ,CAAA;AACtB,cAAc,UAAU,CAAA;AACxB,cAAc,YAAY,CAAA;AAE1B,eAAO,MAAM,UAAU,0CAAyD,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,cAAc,QAAQ,CAAA;AACtB,cAAc,QAAQ,CAAA;AACtB,cAAc,UAAU,CAAA;AACxB,cAAc,YAAY,CAAA;AAG1B,eAAO,MAAM,UAAU,0CAAyD,CAAA"}
package/lib/index.es.js CHANGED
@@ -6,7 +6,7 @@ import { expectDomTypeError as b } from "@milkdown/exception";
6
6
  import { textblockTypeInputRule as ee, wrappingInputRule as V, InputRule as te } from "@milkdown/prose/inputrules";
7
7
  import { TextSelection as re, Selection as ne, PluginKey as N, Plugin as C } from "@milkdown/prose/state";
8
8
  import { findSelectedNodeOfType as We } from "@milkdown/prose";
9
- import { sinkListItem as qe, splitListItem as Fe, liftListItem as Ve } from "@milkdown/prose/schema-list";
9
+ import { sinkListItem as qe, liftListItem as Fe, splitListItem as Ve } from "@milkdown/prose/schema-list";
10
10
  import { ReplaceStep as Ge, AddMarkStep as ze } from "@milkdown/prose/transform";
11
11
  import { Decoration as J, DecorationSet as Q } from "@milkdown/prose/view";
12
12
  import { visit as oe } from "unist-util-visit";
@@ -249,17 +249,15 @@ const ae = H("emphasis"), se = K("emphasis", (r) => ({
249
249
  }
250
250
  }
251
251
  };
252
- }), nt = I(
253
- (r) => ee(/^(?<hashes>#+)\s$/, T.type(), (e) => {
254
- var s, l;
255
- const t = ((l = (s = e.groups) == null ? void 0 : s.hashes) == null ? void 0 : l.length) || 0, n = r.get(R), { $from: o } = n.state.selection, a = o.node();
256
- if (a.type.name === "heading") {
257
- let c = Number(a.attrs.level) + Number(t);
258
- return c > 6 && (c = 6), { level: c };
259
- }
260
- return { level: t };
261
- })
262
- ), M = u("WrapInHeading", () => (r) => (r ?? (r = 1), r < 1 ? S(L.type()) : S(T.type(), { level: r }))), ke = u("DowngradeHeading", () => () => (r, e, t) => {
252
+ }), nt = I((r) => ee(/^(?<hashes>#+)\s$/, T.type(), (e) => {
253
+ var s, l;
254
+ const t = ((l = (s = e.groups) == null ? void 0 : s.hashes) == null ? void 0 : l.length) || 0, n = r.get(R), { $from: o } = n.state.selection, a = o.node();
255
+ if (a.type.name === "heading") {
256
+ let c = Number(a.attrs.level) + Number(t);
257
+ return c > 6 && (c = 6), { level: c };
258
+ }
259
+ return { level: t };
260
+ })), M = u("WrapInHeading", () => (r) => (r ?? (r = 1), r < 1 ? S(L.type()) : S(T.type(), { level: r }))), ke = u("DowngradeHeading", () => () => (r, e, t) => {
263
261
  const { $from: n } = r.selection, o = n.node();
264
262
  if (o.type !== T.type() || !r.selection.empty || n.parentOffset !== 0)
265
263
  return !1;
@@ -719,7 +717,7 @@ const ae = H("emphasis"), se = K("emphasis", (r) => ({
719
717
  shortcuts: "Enter",
720
718
  command: (r) => {
721
719
  const e = r.get(m);
722
- return () => e.call(Oe.key);
720
+ return () => e.call(_e.key);
723
721
  }
724
722
  },
725
723
  SinkListItem: {
@@ -733,7 +731,7 @@ const ae = H("emphasis"), se = K("emphasis", (r) => ({
733
731
  shortcuts: ["Shift-Tab", "Mod-["],
734
732
  command: (r) => {
735
733
  const e = r.get(m);
736
- return () => e.call(_e.key);
734
+ return () => e.call(Oe.key);
737
735
  }
738
736
  }
739
737
  }), Mt = X("text", () => ({
@@ -802,8 +800,8 @@ const ae = H("emphasis"), se = K("emphasis", (r) => ({
802
800
  Le,
803
801
  xe,
804
802
  De,
805
- Oe,
806
803
  _e,
804
+ Oe,
807
805
  le,
808
806
  pe,
809
807
  de,
@@ -1156,7 +1154,7 @@ export {
1156
1154
  it as insertImageCommand,
1157
1155
  cr as insertImageInputRule,
1158
1156
  Nt as keymap,
1159
- _e as liftListItemCommand,
1157
+ Oe as liftListItemCommand,
1160
1158
  me as linkAttr,
1161
1159
  v as linkSchema,
1162
1160
  Te as listItemAttr,
@@ -1174,7 +1172,7 @@ export {
1174
1172
  Pt as remarkLineBreak,
1175
1173
  It as schema,
1176
1174
  De as sinkListItemCommand,
1177
- Oe as splitListItemCommand,
1175
+ _e as splitListItemCommand,
1178
1176
  ce as strongAttr,
1179
1177
  Ye as strongKeymap,
1180
1178
  ie as strongSchema,