@milkdown/preset-gfm 6.3.1 → 6.4.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.
@@ -1 +1 @@
1
- {"version":3,"file":"strike-through.d.ts","sourceRoot":"","sources":["../src/strike-through.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,mBAAmB,4CAAsC,CAAC;AAGvE,eAAO,MAAM,aAAa,wFAiCxB,CAAC"}
1
+ {"version":3,"file":"strike-through.d.ts","sourceRoot":"","sources":["../src/strike-through.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,mBAAmB,4CAAsC,CAAC;AAGvE,eAAO,MAAM,aAAa,wFA8BxB,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import { Ctx } from '@milkdown/core';
2
2
  import { Plugin } from '@milkdown/prose/state';
3
- import { Utils } from '@milkdown/utils';
3
+ import { ThemeUtils } from '@milkdown/utils';
4
4
  export declare const key = "MILKDOWN_TABLE";
5
- export declare const operatorPlugin: (ctx: Ctx, utils: Utils) => Plugin<any>;
5
+ export declare const operatorPlugin: (ctx: Ctx, utils: ThemeUtils) => Plugin<any>;
6
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/table/operator-plugin/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AACrC,OAAO,EAAE,MAAM,EAAa,MAAM,uBAAuB,CAAC;AAE1D,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAWxC,eAAO,MAAM,GAAG,mBAAmB,CAAC;AAEpC,eAAO,MAAM,cAAc,QAAS,GAAG,SAAS,KAAK,gBAkFpD,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/table/operator-plugin/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AACrC,OAAO,EAAE,MAAM,EAAa,MAAM,uBAAuB,CAAC;AAE1D,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAW7C,eAAO,MAAM,GAAG,mBAAmB,CAAC;AAEpC,eAAO,MAAM,cAAc,QAAS,GAAG,SAAS,UAAU,gBAkFzD,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@milkdown/preset-gfm",
3
- "version": "6.3.1",
3
+ "version": "6.4.1",
4
4
  "type": "module",
5
5
  "main": "./lib/index.es.js",
6
6
  "types": "./lib/index.d.ts",
@@ -17,10 +17,10 @@
17
17
  "gfm"
18
18
  ],
19
19
  "devDependencies": {
20
- "@milkdown/core": "6.3.1",
21
- "@milkdown/design-system": "6.3.1",
22
- "@milkdown/preset-commonmark": "6.3.1",
23
- "@milkdown/prose": "6.3.1"
20
+ "@milkdown/core": "6.4.1",
21
+ "@milkdown/design-system": "6.4.1",
22
+ "@milkdown/preset-commonmark": "6.4.1",
23
+ "@milkdown/prose": "6.4.1"
24
24
  },
25
25
  "peerDependencies": {
26
26
  "@milkdown/core": "^6.0.1",
@@ -28,8 +28,8 @@
28
28
  "@milkdown/prose": "^6.0.1"
29
29
  },
30
30
  "dependencies": {
31
- "@milkdown/utils": "6.3.1",
32
- "@milkdown/exception": "6.3.1",
31
+ "@milkdown/utils": "6.4.1",
32
+ "@milkdown/exception": "6.4.1",
33
33
  "remark-gfm": "^3.0.0",
34
34
  "tslib": "^2.4.0"
35
35
  },
package/src/index.ts CHANGED
@@ -3,7 +3,6 @@ import { commands as commonmarkCommands, commonmark } from '@milkdown/preset-com
3
3
  import { $remark, AtomList } from '@milkdown/utils';
4
4
  import remarkGFM from 'remark-gfm';
5
5
 
6
- import { urlPlugin } from './auto-link';
7
6
  import { footnoteReference } from './footnote';
8
7
  import { footnoteDefinition } from './footnote/definition';
9
8
  import { strikeThrough, ToggleStrikeThrough } from './strike-through';
@@ -77,7 +76,6 @@ export const gfm = AtomList.create([
77
76
  ...commonmark,
78
77
  $remark(() => remarkGFM),
79
78
  table(),
80
- urlPlugin,
81
79
  strikeThrough(),
82
80
  taskListItem(),
83
81
  footnoteReference(),
@@ -1,6 +1,5 @@
1
1
  /* Copyright 2021, Milkdown by Mirone. */
2
2
  import { createCmd, createCmdKey } from '@milkdown/core';
3
- import { markRule } from '@milkdown/prose';
4
3
  import { toggleMark } from '@milkdown/prose/commands';
5
4
  import { createMark, createShortcut } from '@milkdown/utils';
6
5
 
@@ -15,6 +14,7 @@ export const strikeThrough = createMark<Keys>((utils) => {
15
14
  return {
16
15
  id,
17
16
  schema: () => ({
17
+ inclusive: false,
18
18
  parseDOM: [
19
19
  { tag: 'del' },
20
20
  { style: 'text-decoration', getAttrs: (value) => (value === 'line-through') as false },
@@ -35,10 +35,6 @@ export const strikeThrough = createMark<Keys>((utils) => {
35
35
  },
36
36
  },
37
37
  }),
38
- inputRules: (markType) => [
39
- markRule(/(?:~~)([^~]+)(?:~~)$/, markType),
40
- markRule(/(?:^|[^~])(~([^~]+)~)$/, markType),
41
- ],
42
38
  commands: (markType) => [createCmd(ToggleStrikeThrough, () => toggleMark(markType))],
43
39
  shortcuts: {
44
40
  [SupportedKeys.StrikeThrough]: createShortcut(ToggleStrikeThrough, 'Mod-Alt-x'),
@@ -3,7 +3,7 @@
3
3
  import { Ctx } from '@milkdown/core';
4
4
  import { Plugin, PluginKey } from '@milkdown/prose/state';
5
5
  import { Decoration, DecorationSet } from '@milkdown/prose/view';
6
- import { Utils } from '@milkdown/utils';
6
+ import { ThemeUtils } from '@milkdown/utils';
7
7
 
8
8
  import { CellSelection } from '../plugin';
9
9
  import { CellPos, getCellsInColumn, getCellsInRow } from '../utils';
@@ -16,7 +16,7 @@ import { createWidget } from './widget';
16
16
 
17
17
  export const key = 'MILKDOWN_TABLE';
18
18
 
19
- export const operatorPlugin = (ctx: Ctx, utils: Utils) => {
19
+ export const operatorPlugin = (ctx: Ctx, utils: ThemeUtils) => {
20
20
  return new Plugin({
21
21
  key: new PluginKey('MILKDOWN_TABLE_OP'),
22
22
  props: {
@@ -1,2 +0,0 @@
1
- export declare const urlPlugin: import("@milkdown/utils").$Prose;
2
- //# sourceMappingURL=auto-link.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"auto-link.d.ts","sourceRoot":"","sources":["../src/auto-link.ts"],"names":[],"mappings":"AAsBA,eAAO,MAAM,SAAS,kCAAiC,CAAC"}
package/src/auto-link.ts DELETED
@@ -1,23 +0,0 @@
1
- /* Copyright 2021, Milkdown by Mirone. */
2
- import { InputRule, inputRules } from '@milkdown/prose/inputrules';
3
- import { $prose } from '@milkdown/utils';
4
-
5
- const urlRegex = /https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_+.~#?&//=]*)$/;
6
-
7
- const proseUrlPlugin = () =>
8
- inputRules({
9
- rules: [
10
- new InputRule(urlRegex, (state, match, start, end) => {
11
- const { schema } = state;
12
- const [text] = match;
13
- if (!text) return null;
14
-
15
- const link = schema.marks['link']?.create({ href: text });
16
- if (!link) return null;
17
-
18
- return state.tr.replaceWith(start, end, schema.text(text)).addMark(start, text.length + start, link);
19
- }),
20
- ],
21
- });
22
-
23
- export const urlPlugin = $prose(() => proseUrlPlugin());