@doist/typist 1.0.11 → 1.0.13
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/CHANGELOG.md +12 -0
- package/LICENSE +1 -1
- package/dist/helpers/serializer.d.ts +12 -2
- package/dist/helpers/serializer.d.ts.map +1 -1
- package/dist/helpers/serializer.js +20 -1
- package/dist/serializers/html/extensions/disabled.d.ts +13 -0
- package/dist/serializers/html/extensions/disabled.d.ts.map +1 -0
- package/dist/serializers/html/extensions/disabled.js +125 -0
- package/dist/serializers/html/extensions/link.d.ts +3 -3
- package/dist/serializers/html/extensions/link.d.ts.map +1 -1
- package/dist/serializers/html/extensions/link.js +4 -7
- package/dist/serializers/html/html.d.ts +9 -2
- package/dist/serializers/html/html.d.ts.map +1 -1
- package/dist/serializers/html/html.js +47 -79
- package/dist/serializers/markdown/markdown.d.ts +5 -1
- package/dist/serializers/markdown/markdown.d.ts.map +1 -1
- package/dist/serializers/markdown/markdown.js +16 -13
- package/dist/serializers/markdown/plugins/image.js +1 -1
- package/dist/serializers/markdown/plugins/list-item.js +2 -2
- package/dist/serializers/markdown/plugins/paragraph.js +1 -1
- package/dist/serializers/markdown/plugins/strikethrough.js +2 -2
- package/dist/serializers/markdown/plugins/suggestion.d.ts.map +1 -1
- package/dist/serializers/markdown/plugins/suggestion.js +4 -2
- package/dist/serializers/markdown/plugins/task-item.js +2 -2
- package/package.json +52 -52
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
## [1.0.13](https://github.com/Doist/typist/compare/v1.0.12...v1.0.13) (2023-02-13)
|
|
2
|
+
|
|
3
|
+
### Bug Fixes
|
|
4
|
+
|
|
5
|
+
- **deps:** update tiptap packages to v2.0.0-beta.215 ([#129](https://github.com/Doist/typist/issues/129)) ([af22d22](https://github.com/Doist/typist/commit/af22d22eff6531c11114cb3122daa184657e504e))
|
|
6
|
+
|
|
7
|
+
## [1.0.12](https://github.com/Doist/typist/compare/v1.0.11...v1.0.12) (2023-01-06)
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
- **html-serializer:** Disables tokenizers if marks/nodes are not found in the editor schema ([#86](https://github.com/Doist/typist/issues/86)) ([0ed4a9b](https://github.com/Doist/typist/commit/0ed4a9b694d2b7dcfadce0c5aa3fdefec6d492c5))
|
|
12
|
+
|
|
1
13
|
## [1.0.11](https://github.com/Doist/typist/compare/v1.0.10...v1.0.11) (2022-12-21)
|
|
2
14
|
|
|
3
15
|
### Bug Fixes
|
package/LICENSE
CHANGED
|
@@ -1,4 +1,14 @@
|
|
|
1
|
-
import type { ParseRule } from 'prosemirror-model';
|
|
1
|
+
import type { ParseRule, Schema } from 'prosemirror-model';
|
|
2
|
+
/**
|
|
3
|
+
* Builds a partial regular expression that includes valid URL schemas used by all the available
|
|
4
|
+
* suggestion nodes from the given editor schema.
|
|
5
|
+
*
|
|
6
|
+
* @param schema The editor schema to be used for suggestion nodes detection.
|
|
7
|
+
*
|
|
8
|
+
* @returns A partial regular expression with valid URL schemas for the available suggestion nodes,
|
|
9
|
+
* `null` if there are no suggestion nodes in the editor schema.
|
|
10
|
+
*/
|
|
11
|
+
declare function buildSuggestionSchemaPartialRegex(schema: Schema): string | null;
|
|
2
12
|
/**
|
|
3
13
|
* Extract all tags from the given parse rules argument, and returns an array of said tags.
|
|
4
14
|
*
|
|
@@ -7,5 +17,5 @@ import type { ParseRule } from 'prosemirror-model';
|
|
|
7
17
|
* @returns An array of tags extracted from the parse rules.
|
|
8
18
|
*/
|
|
9
19
|
declare function extractTagsFromParseRules(parseRules?: readonly ParseRule[]): (keyof HTMLElementTagNameMap)[];
|
|
10
|
-
export { extractTagsFromParseRules };
|
|
20
|
+
export { buildSuggestionSchemaPartialRegex, extractTagsFromParseRules };
|
|
11
21
|
//# sourceMappingURL=serializer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serializer.d.ts","sourceRoot":"","sources":["../../src/helpers/serializer.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"serializer.d.ts","sourceRoot":"","sources":["../../src/helpers/serializer.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAE1D;;;;;;;;GAQG;AACH,iBAAS,iCAAiC,CAAC,MAAM,EAAE,MAAM,iBAYxD;AAED;;;;;;GAMG;AACH,iBAAS,yBAAyB,CAC9B,UAAU,CAAC,EAAE,SAAS,SAAS,EAAE,GAClC,CAAC,MAAM,qBAAqB,CAAC,EAAE,CAQjC;AAED,OAAO,EAAE,iCAAiC,EAAE,yBAAyB,EAAE,CAAA"}
|
|
@@ -1,3 +1,22 @@
|
|
|
1
|
+
import { kebabCase } from 'lodash-es';
|
|
2
|
+
/**
|
|
3
|
+
* Builds a partial regular expression that includes valid URL schemas used by all the available
|
|
4
|
+
* suggestion nodes from the given editor schema.
|
|
5
|
+
*
|
|
6
|
+
* @param schema The editor schema to be used for suggestion nodes detection.
|
|
7
|
+
*
|
|
8
|
+
* @returns A partial regular expression with valid URL schemas for the available suggestion nodes,
|
|
9
|
+
* `null` if there are no suggestion nodes in the editor schema.
|
|
10
|
+
*/
|
|
11
|
+
function buildSuggestionSchemaPartialRegex(schema) {
|
|
12
|
+
const suggestionNodes = Object.values(schema.nodes).filter((node) => node.name.endsWith('Suggestion'));
|
|
13
|
+
if (suggestionNodes.length === 0) {
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
return `(?:${suggestionNodes
|
|
17
|
+
.map((suggestionNode) => kebabCase(suggestionNode.name.replace(/Suggestion$/, '')))
|
|
18
|
+
.join('|')})://`;
|
|
19
|
+
}
|
|
1
20
|
/**
|
|
2
21
|
* Extract all tags from the given parse rules argument, and returns an array of said tags.
|
|
3
22
|
*
|
|
@@ -13,4 +32,4 @@ function extractTagsFromParseRules(parseRules) {
|
|
|
13
32
|
.filter((rule) => rule.tag)
|
|
14
33
|
.map((rule) => rule.tag);
|
|
15
34
|
}
|
|
16
|
-
export { extractTagsFromParseRules };
|
|
35
|
+
export { buildSuggestionSchemaPartialRegex, extractTagsFromParseRules };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { marked } from 'marked';
|
|
2
|
+
import type { Schema } from 'prosemirror-model';
|
|
3
|
+
/**
|
|
4
|
+
* A Marked extension which disables multiple parsing rules by disabling the rules respective
|
|
5
|
+
* tokenizers based on the availability of marks and/or nodes in the editor schema.
|
|
6
|
+
*
|
|
7
|
+
* @param schema The editor schema to be used for nodes and marks detection.
|
|
8
|
+
*/
|
|
9
|
+
declare function disabled(schema: Schema): {
|
|
10
|
+
tokenizer: Partial<Omit<marked.Tokenizer<false>, "constructor" | "options">>;
|
|
11
|
+
};
|
|
12
|
+
export { disabled };
|
|
13
|
+
//# sourceMappingURL=disabled.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"disabled.d.ts","sourceRoot":"","sources":["../../../../src/serializers/html/extensions/disabled.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAK/B,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAS/C;;;;;GAKG;AACH,iBAAS,QAAQ,CAAC,MAAM,EAAE,MAAM;;EAyI/B;AAED,OAAO,EAAE,QAAQ,EAAE,CAAA"}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { marked } from 'marked';
|
|
2
|
+
import { buildSuggestionSchemaPartialRegex } from '../../../helpers/serializer';
|
|
3
|
+
import { INITIAL_MARKED_OPTIONS } from '../html';
|
|
4
|
+
/**
|
|
5
|
+
* A Marked extension which disables multiple parsing rules by disabling the rules respective
|
|
6
|
+
* tokenizers based on the availability of marks and/or nodes in the editor schema.
|
|
7
|
+
*
|
|
8
|
+
* @param schema The editor schema to be used for nodes and marks detection.
|
|
9
|
+
*/
|
|
10
|
+
function disabled(schema) {
|
|
11
|
+
const markedTokenizer = new marked.Tokenizer(INITIAL_MARKED_OPTIONS);
|
|
12
|
+
const tokenizer = {};
|
|
13
|
+
if (!schema.nodes.blockquote) {
|
|
14
|
+
Object.assign(tokenizer, {
|
|
15
|
+
blockquote() {
|
|
16
|
+
return undefined;
|
|
17
|
+
},
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
if (!schema.marks.bold || !schema.marks.italic) {
|
|
21
|
+
Object.assign(tokenizer, {
|
|
22
|
+
emStrong() {
|
|
23
|
+
return undefined;
|
|
24
|
+
},
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
// Given that there isn't a one to one mapping between the bullet/ordered list nodes and Marked
|
|
28
|
+
// tokenizers, we need to conditionally disable the `list` tokenizer based on the input
|
|
29
|
+
if (!schema.nodes.bulletList || !schema.nodes.orderedList) {
|
|
30
|
+
Object.assign(tokenizer, {
|
|
31
|
+
list(src) {
|
|
32
|
+
const isOrdered = /^\d+/.test(src);
|
|
33
|
+
if ((isOrdered && schema.nodes.orderedList) ||
|
|
34
|
+
(!isOrdered && schema.nodes.bulletList)) {
|
|
35
|
+
return markedTokenizer.list.apply(this, [src]);
|
|
36
|
+
}
|
|
37
|
+
return undefined;
|
|
38
|
+
},
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
if (!schema.marks.code) {
|
|
42
|
+
Object.assign(tokenizer, {
|
|
43
|
+
codespan() {
|
|
44
|
+
return undefined;
|
|
45
|
+
},
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
if (!schema.nodes.codeBlock) {
|
|
49
|
+
Object.assign(tokenizer, {
|
|
50
|
+
code() {
|
|
51
|
+
return undefined;
|
|
52
|
+
},
|
|
53
|
+
fences() {
|
|
54
|
+
return undefined;
|
|
55
|
+
},
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
if (!schema.nodes.hardBreak) {
|
|
59
|
+
Object.assign(tokenizer, {
|
|
60
|
+
br() {
|
|
61
|
+
return undefined;
|
|
62
|
+
},
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
if (!schema.nodes.heading) {
|
|
66
|
+
Object.assign(tokenizer, {
|
|
67
|
+
heading() {
|
|
68
|
+
return undefined;
|
|
69
|
+
},
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
if (!schema.nodes.horizontalRule) {
|
|
73
|
+
Object.assign(tokenizer, {
|
|
74
|
+
hr() {
|
|
75
|
+
return undefined;
|
|
76
|
+
},
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
if (!schema.marks.link) {
|
|
80
|
+
Object.assign(tokenizer, {
|
|
81
|
+
url() {
|
|
82
|
+
return undefined;
|
|
83
|
+
},
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
// Given that there isn't a one to one mapping between the link/image mark/node and Marked
|
|
87
|
+
// tokenizers, nor Marked supports our custom Markdown syntax for suggestions, we need to
|
|
88
|
+
// conditionally disable the `link` tokenizer based on the input
|
|
89
|
+
if (!schema.marks.link || !schema.nodes.image) {
|
|
90
|
+
const suggestionSchemaPartialRegex = buildSuggestionSchemaPartialRegex(schema);
|
|
91
|
+
const suggestionSchemaRegex = suggestionSchemaPartialRegex
|
|
92
|
+
? new RegExp(`^\\[[^\\]]*\\]\\(${suggestionSchemaPartialRegex}`)
|
|
93
|
+
: null;
|
|
94
|
+
Object.assign(tokenizer, {
|
|
95
|
+
link(src) {
|
|
96
|
+
const isImage = /^!\[[^\]]*\]\([^)]+\)/.test(src);
|
|
97
|
+
const isSuggestion = suggestionSchemaRegex?.test(src);
|
|
98
|
+
if ((isImage && schema.nodes.image) ||
|
|
99
|
+
(!isImage && schema.marks.link) ||
|
|
100
|
+
isSuggestion) {
|
|
101
|
+
return markedTokenizer.link.apply(this, [src]);
|
|
102
|
+
}
|
|
103
|
+
return undefined;
|
|
104
|
+
},
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
if (!schema.marks.strike) {
|
|
108
|
+
Object.assign(tokenizer, {
|
|
109
|
+
del() {
|
|
110
|
+
return undefined;
|
|
111
|
+
},
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
if (!schema.nodes.table) {
|
|
115
|
+
Object.assign(tokenizer, {
|
|
116
|
+
table() {
|
|
117
|
+
return undefined;
|
|
118
|
+
},
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
return {
|
|
122
|
+
tokenizer,
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
export { disabled };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { marked } from 'marked';
|
|
2
|
-
import type { NodeType } from 'prosemirror-model';
|
|
3
2
|
/**
|
|
4
3
|
* A Marked extension which tweaks the `link` renderer to add support for suggestion nodes, while
|
|
5
4
|
* preserving the original renderer for standard links.
|
|
6
5
|
*
|
|
7
|
-
* @param
|
|
6
|
+
* @param suggestionSchemaRegex A regular expression with valid URL schemas for the available
|
|
7
|
+
* suggestion nodes.
|
|
8
8
|
*/
|
|
9
|
-
declare function link(
|
|
9
|
+
declare function link(suggestionSchemaRegex: RegExp): marked.MarkedExtension;
|
|
10
10
|
export { link };
|
|
11
11
|
//# sourceMappingURL=link.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"link.d.ts","sourceRoot":"","sources":["../../../../src/serializers/html/extensions/link.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"link.d.ts","sourceRoot":"","sources":["../../../../src/serializers/html/extensions/link.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAI/B;;;;;;GAMG;AACH,iBAAS,IAAI,CAAC,qBAAqB,EAAE,MAAM,GAAG,MAAM,CAAC,eAAe,CAgBnE;AAED,OAAO,EAAE,IAAI,EAAE,CAAA"}
|
|
@@ -1,20 +1,17 @@
|
|
|
1
|
-
import { kebabCase } from 'lodash-es';
|
|
2
1
|
import { marked } from 'marked';
|
|
3
2
|
const markedRenderer = new marked.Renderer();
|
|
4
3
|
/**
|
|
5
4
|
* A Marked extension which tweaks the `link` renderer to add support for suggestion nodes, while
|
|
6
5
|
* preserving the original renderer for standard links.
|
|
7
6
|
*
|
|
8
|
-
* @param
|
|
7
|
+
* @param suggestionSchemaRegex A regular expression with valid URL schemas for the available
|
|
8
|
+
* suggestion nodes.
|
|
9
9
|
*/
|
|
10
|
-
function link(
|
|
11
|
-
const linkSchemaRegex = new RegExp(`^(?:${suggestionNodes
|
|
12
|
-
.map((suggestionNode) => kebabCase(suggestionNode.name.replace(/Suggestion$/, '')))
|
|
13
|
-
.join('|')})://`);
|
|
10
|
+
function link(suggestionSchemaRegex) {
|
|
14
11
|
return {
|
|
15
12
|
renderer: {
|
|
16
13
|
link(href, title, text) {
|
|
17
|
-
if (href &&
|
|
14
|
+
if (href && suggestionSchemaRegex?.test(href)) {
|
|
18
15
|
const [, schema, id] = /^([a-z-]+):\/\/(\S+)$/i.exec(href) || [];
|
|
19
16
|
if (schema && id && text) {
|
|
20
17
|
return `<span data-${schema} data-id="${id}" data-label="${text}"></span>`;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { marked } from 'marked';
|
|
1
2
|
import type { Schema } from 'prosemirror-model';
|
|
2
3
|
/**
|
|
3
4
|
* The return type for the `createHTMLSerializer` function.
|
|
@@ -12,6 +13,12 @@ type HTMLSerializerReturnType = {
|
|
|
12
13
|
*/
|
|
13
14
|
serialize: (markdown: string) => string;
|
|
14
15
|
};
|
|
16
|
+
/**
|
|
17
|
+
* Sensible default options to initialize the Marked parser with.
|
|
18
|
+
*
|
|
19
|
+
* @see https://marked.js.org/using_advanced#options
|
|
20
|
+
*/
|
|
21
|
+
declare const INITIAL_MARKED_OPTIONS: marked.MarkedOptions;
|
|
15
22
|
/**
|
|
16
23
|
* Create a Markdown to HTML serializer with the Marked library for a rich-text editor, or use a
|
|
17
24
|
* custom serializer for a plain-text editor. The editor schema is used to detect which nodes and
|
|
@@ -19,9 +26,9 @@ type HTMLSerializerReturnType = {
|
|
|
19
26
|
*
|
|
20
27
|
* @param schema The editor schema to be used for nodes and marks detection.
|
|
21
28
|
*
|
|
22
|
-
* @returns A normalized
|
|
29
|
+
* @returns A normalized object for the HTML serializer.
|
|
23
30
|
*/
|
|
24
31
|
declare function createHTMLSerializer(schema: Schema): HTMLSerializerReturnType;
|
|
25
|
-
export { createHTMLSerializer };
|
|
32
|
+
export { createHTMLSerializer, INITIAL_MARKED_OPTIONS };
|
|
26
33
|
export type { HTMLSerializerReturnType };
|
|
27
34
|
//# sourceMappingURL=html.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"html.d.ts","sourceRoot":"","sources":["../../../src/serializers/html/html.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"html.d.ts","sourceRoot":"","sources":["../../../src/serializers/html/html.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAc/B,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAE/C;;GAEG;AACH,KAAK,wBAAwB,GAAG;IAC5B;;;;;;OAMG;IACH,SAAS,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,MAAM,CAAA;CAC1C,CAAA;AAED;;;;GAIG;AACH,QAAA,MAAM,sBAAsB,EAAE,MAAM,CAAC,aAMpC,CAAA;AAmCD;;;;;;;;GAQG;AACH,iBAAS,oBAAoB,CAAC,MAAM,EAAE,MAAM,GAAG,wBAAwB,CAiDtE;AAED,OAAO,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,CAAA;AAEvD,YAAY,EAAE,wBAAwB,EAAE,CAAA"}
|
|
@@ -2,8 +2,10 @@ import { escape, kebabCase } from 'lodash-es';
|
|
|
2
2
|
import { marked } from 'marked';
|
|
3
3
|
import { REGEX_LINE_BREAKS } from '../../constants/regular-expressions';
|
|
4
4
|
import { isPlainTextDocument } from '../../helpers/schema';
|
|
5
|
+
import { buildSuggestionSchemaPartialRegex } from '../../helpers/serializer';
|
|
5
6
|
import { checkbox } from './extensions/checkbox';
|
|
6
7
|
import { code } from './extensions/code';
|
|
8
|
+
import { disabled } from './extensions/disabled';
|
|
7
9
|
import { html } from './extensions/html';
|
|
8
10
|
import { link } from './extensions/link';
|
|
9
11
|
import { paragraph } from './extensions/paragraph';
|
|
@@ -14,76 +16,56 @@ import { taskList } from './extensions/task-list';
|
|
|
14
16
|
* @see https://marked.js.org/using_advanced#options
|
|
15
17
|
*/
|
|
16
18
|
const INITIAL_MARKED_OPTIONS = {
|
|
19
|
+
...marked.getDefaults(),
|
|
17
20
|
breaks: true,
|
|
18
21
|
gfm: true,
|
|
19
22
|
headerIds: false,
|
|
20
23
|
silent: true,
|
|
21
24
|
};
|
|
22
25
|
/**
|
|
23
|
-
*
|
|
26
|
+
* Create a custom Markdown to HTML serializer for plain-text editors only.
|
|
24
27
|
*
|
|
25
28
|
* @param schema The editor schema to be used for nodes and marks detection.
|
|
26
29
|
*
|
|
27
|
-
* @returns
|
|
30
|
+
* @returns A normalized object for the HTML serializer.
|
|
28
31
|
*/
|
|
29
|
-
function
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
32
|
+
function createHTMLSerializerForPlainTextEditor(schema) {
|
|
33
|
+
return {
|
|
34
|
+
serialize(markdown) {
|
|
35
|
+
// Converts special characters (i.e. `&`, `<`, `>`, `"`, and `'`) to their corresponding
|
|
36
|
+
// HTML entities because we need to output the full content as valid HTML (i.e. the
|
|
37
|
+
// editor should not drop invalid HTML).
|
|
38
|
+
let htmlResult = escape(markdown);
|
|
39
|
+
// Serialize all suggestion links if any suggestion node exists in the schema
|
|
40
|
+
Object.values(schema.nodes)
|
|
41
|
+
.filter((node) => node.name.endsWith('Suggestion'))
|
|
42
|
+
.forEach((suggestionNode) => {
|
|
43
|
+
const linkSchema = kebabCase(suggestionNode.name.replace(/Suggestion$/, ''));
|
|
44
|
+
htmlResult = htmlResult.replace(new RegExp(`\\[([^\\[]+)\\]\\((?:${linkSchema}):\\/\\/(\\d+)\\)`, 'gm'), `<span data-${linkSchema} data-id="$2" data-label="$1"></span>`);
|
|
45
|
+
});
|
|
46
|
+
// Return the serialized HTML with every line wrapped in a paragraph element
|
|
47
|
+
return htmlResult.replace(/^([^\n]+)\n?|\n+/gm, `<p>$1</p>`);
|
|
48
|
+
},
|
|
49
|
+
};
|
|
44
50
|
}
|
|
45
51
|
/**
|
|
46
|
-
*
|
|
52
|
+
* Create a Markdown to HTML serializer with the Marked library for a rich-text editor, or use a
|
|
53
|
+
* custom serializer for a plain-text editor. The editor schema is used to detect which nodes and
|
|
54
|
+
* marks are available in the editor, and only parses the input with the minimal required rules.
|
|
47
55
|
*
|
|
48
|
-
* @param markdown The input Markdown to be serialized to HTML.
|
|
49
56
|
* @param schema The editor schema to be used for nodes and marks detection.
|
|
50
57
|
*
|
|
51
|
-
* @returns
|
|
58
|
+
* @returns A normalized object for the HTML serializer.
|
|
52
59
|
*/
|
|
53
|
-
function
|
|
54
|
-
//
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
// @ts-ignore: Returning `undefined` is acceptable to disable tokens
|
|
63
|
-
tokenizer: {
|
|
64
|
-
...(!schema.marks.strike
|
|
65
|
-
? {
|
|
66
|
-
del() {
|
|
67
|
-
/* noop: disables tokenizer */
|
|
68
|
-
},
|
|
69
|
-
}
|
|
70
|
-
: {}),
|
|
71
|
-
...(!schema.nodes.heading
|
|
72
|
-
? {
|
|
73
|
-
heading() {
|
|
74
|
-
/* noop: disables tokenizer */
|
|
75
|
-
},
|
|
76
|
-
}
|
|
77
|
-
: {}),
|
|
78
|
-
...(!schema.nodes.table
|
|
79
|
-
? {
|
|
80
|
-
table() {
|
|
81
|
-
/* noop: disables tokenizer */
|
|
82
|
-
},
|
|
83
|
-
}
|
|
84
|
-
: {}),
|
|
85
|
-
},
|
|
86
|
-
});
|
|
60
|
+
function createHTMLSerializer(schema) {
|
|
61
|
+
// Returns a custom HTML serializer for plain-text editors
|
|
62
|
+
if (isPlainTextDocument(schema)) {
|
|
63
|
+
return createHTMLSerializerForPlainTextEditor(schema);
|
|
64
|
+
}
|
|
65
|
+
// Reset Marked instance to the initial options
|
|
66
|
+
marked.setOptions(INITIAL_MARKED_OPTIONS);
|
|
67
|
+
// Disable built-in rules that are not supported by the schema
|
|
68
|
+
marked.use(disabled(schema));
|
|
87
69
|
// Overwrite some built-in rules for handling of special behaviours
|
|
88
70
|
// (see documentation for each extension for more details)
|
|
89
71
|
marked.use(checkbox, html, paragraph(schema.nodes.image));
|
|
@@ -95,35 +77,21 @@ function serializeForRichTextEditor(markdown, schema) {
|
|
|
95
77
|
if (schema.nodes.taskList && schema.nodes.taskItem) {
|
|
96
78
|
marked.use(taskList);
|
|
97
79
|
}
|
|
98
|
-
//
|
|
99
|
-
const
|
|
80
|
+
// Build a regular expression with all the available suggestion nodes from the schema
|
|
81
|
+
const suggestionSchemaPartialRegex = buildSuggestionSchemaPartialRegex(schema);
|
|
100
82
|
// Overwrite the built-in link rule if any suggestion node exists in the schema
|
|
101
|
-
if (
|
|
102
|
-
marked.use(link(
|
|
83
|
+
if (suggestionSchemaPartialRegex) {
|
|
84
|
+
marked.use(link(new RegExp(`^${suggestionSchemaPartialRegex}`)));
|
|
103
85
|
}
|
|
104
|
-
// Return the serialized HTML parsed with Marked
|
|
105
|
-
return (marked
|
|
106
|
-
.parse(markdown)
|
|
107
|
-
// Removes newlines after tags from the HTML output with a specially crafted RegExp
|
|
108
|
-
// (needed to prevent the editor from converting newlines to blank paragraphs)
|
|
109
|
-
.replace(new RegExp(`>${REGEX_LINE_BREAKS.source}`, REGEX_LINE_BREAKS.flags), '>'));
|
|
110
|
-
}
|
|
111
|
-
/**
|
|
112
|
-
* Create a Markdown to HTML serializer with the Marked library for a rich-text editor, or use a
|
|
113
|
-
* custom serializer for a plain-text editor. The editor schema is used to detect which nodes and
|
|
114
|
-
* marks are available in the editor, and only parses the input with the minimal required rules.
|
|
115
|
-
*
|
|
116
|
-
* @param schema The editor schema to be used for nodes and marks detection.
|
|
117
|
-
*
|
|
118
|
-
* @returns A normalized `serialize` function.
|
|
119
|
-
*/
|
|
120
|
-
function createHTMLSerializer(schema) {
|
|
121
86
|
return {
|
|
122
87
|
serialize(markdown) {
|
|
123
|
-
return
|
|
124
|
-
|
|
125
|
-
|
|
88
|
+
return (marked
|
|
89
|
+
.parse(markdown)
|
|
90
|
+
// Removes line breaks after HTML tags from the HTML output with a specially
|
|
91
|
+
// crafted RegExp (this is needed to prevent the editor from converting newline
|
|
92
|
+
// control characters to blank paragraphs).
|
|
93
|
+
.replace(new RegExp(`>${REGEX_LINE_BREAKS.source}`, REGEX_LINE_BREAKS.flags), '>'));
|
|
126
94
|
},
|
|
127
95
|
};
|
|
128
96
|
}
|
|
129
|
-
export { createHTMLSerializer };
|
|
97
|
+
export { createHTMLSerializer, INITIAL_MARKED_OPTIONS };
|
|
@@ -30,9 +30,13 @@ declare const BULLET_LIST_MARKER = "-";
|
|
|
30
30
|
* a plain-text editor. The editor schema is used to detect which nodes and marks are available in
|
|
31
31
|
* the editor, and only parses the input with the minimal required rules.
|
|
32
32
|
*
|
|
33
|
+
* **Note:** Unlike the HTML serializer, built-in rules that are not supported by the schema are not
|
|
34
|
+
* disabled because if the schema does not support certain nodes/marks, the parsing rules don't have
|
|
35
|
+
* valid HTML elements to match in the editor HTML output.
|
|
36
|
+
*
|
|
33
37
|
* @param schema The editor schema to be used for nodes and marks detection.
|
|
34
38
|
*
|
|
35
|
-
* @returns A normalized
|
|
39
|
+
* @returns A normalized object for the Markdown serializer.
|
|
36
40
|
*/
|
|
37
41
|
declare function createMarkdownSerializer(schema: Schema, options?: MarkdownSerializerOptions): MarkdownSerializerReturnType;
|
|
38
42
|
export { BULLET_LIST_MARKER, createMarkdownSerializer };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"markdown.d.ts","sourceRoot":"","sources":["../../../src/serializers/markdown/markdown.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAE/C;;GAEG;AACH,KAAK,yBAAyB,GAAG;IAC7B;;OAEG;IACH,MAAM,CAAC,EAAE,KAAK,CAAA;CACjB,CAAA;AAED;;GAEG;AACH,KAAK,4BAA4B,GAAG;IAChC;;;;;;OAMG;IACH,SAAS,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAA;CACtC,CAAA;AAED;;GAEG;AACH,QAAA,MAAM,kBAAkB,MAAM,CAAA;AA8C9B
|
|
1
|
+
{"version":3,"file":"markdown.d.ts","sourceRoot":"","sources":["../../../src/serializers/markdown/markdown.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAE/C;;GAEG;AACH,KAAK,yBAAyB,GAAG;IAC7B;;OAEG;IACH,MAAM,CAAC,EAAE,KAAK,CAAA;CACjB,CAAA;AAED;;GAEG;AACH,KAAK,4BAA4B,GAAG;IAChC;;;;;;OAMG;IACH,SAAS,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAA;CACtC,CAAA;AAED;;GAEG;AACH,QAAA,MAAM,kBAAkB,MAAM,CAAA;AA8C9B;;;;;;;;;;;;GAYG;AACH,iBAAS,wBAAwB,CAC7B,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,EAAE,yBAAyB,GACpC,4BAA4B,CA4E9B;AAED,OAAO,EAAE,kBAAkB,EAAE,wBAAwB,EAAE,CAAA;AAEvD,YAAY,EAAE,4BAA4B,EAAE,CAAA"}
|
|
@@ -53,35 +53,38 @@ const INITIAL_TURNDOWN_OPTIONS = {
|
|
|
53
53
|
* a plain-text editor. The editor schema is used to detect which nodes and marks are available in
|
|
54
54
|
* the editor, and only parses the input with the minimal required rules.
|
|
55
55
|
*
|
|
56
|
+
* **Note:** Unlike the HTML serializer, built-in rules that are not supported by the schema are not
|
|
57
|
+
* disabled because if the schema does not support certain nodes/marks, the parsing rules don't have
|
|
58
|
+
* valid HTML elements to match in the editor HTML output.
|
|
59
|
+
*
|
|
56
60
|
* @param schema The editor schema to be used for nodes and marks detection.
|
|
57
61
|
*
|
|
58
|
-
* @returns A normalized
|
|
62
|
+
* @returns A normalized object for the Markdown serializer.
|
|
59
63
|
*/
|
|
60
64
|
function createMarkdownSerializer(schema, options) {
|
|
61
65
|
// Initialize Turndown with custom options
|
|
62
66
|
const turndown = new Turndown(INITIAL_TURNDOWN_OPTIONS);
|
|
63
|
-
// Turndown
|
|
64
|
-
//
|
|
65
|
-
//
|
|
66
|
-
//
|
|
67
|
-
//
|
|
68
|
-
//
|
|
69
|
-
//
|
|
67
|
+
// Turndown was built to convert HTML into Markdown, expecting the input to be standards
|
|
68
|
+
// compliant HTML. As such, it collapses all whitespace by default, and there's
|
|
69
|
+
// currently no way to opt-out of this behavior. However, for plain-text editors, we
|
|
70
|
+
// need to preserve Markdown whitespace (otherwise we lose syntax like nested lists) by
|
|
71
|
+
// replacing all instances of the space character (but only if it's preceded by another
|
|
72
|
+
// space character) by the non-breaking space character, and after processing the input
|
|
73
|
+
// with Turndown, we restore the original space character.
|
|
70
74
|
if (isPlainTextDocument(schema) || options?.escape === false) {
|
|
71
75
|
turndown.escape = (str) => str;
|
|
72
76
|
}
|
|
77
|
+
// Overwrite some built-in rules for handling of special behaviours
|
|
78
|
+
// (see documentation for each extension for more details)
|
|
79
|
+
turndown.use(paragraph(schema.nodes.paragraph, isPlainTextDocument(schema)));
|
|
73
80
|
// Overwrite the built-in `image` rule if the corresponding node exists in the schema
|
|
74
81
|
if (schema.nodes.image) {
|
|
75
82
|
turndown.use(image(schema.nodes.image));
|
|
76
83
|
}
|
|
77
84
|
// Overwrite the built-in `listItem` rule if the corresponding node exists in the schema
|
|
78
|
-
if (schema.nodes.listItem) {
|
|
85
|
+
if ((schema.nodes.bulletList || schema.nodes.orderedList) && schema.nodes.listItem) {
|
|
79
86
|
turndown.use(listItem(schema.nodes.listItem));
|
|
80
87
|
}
|
|
81
|
-
// Overwrite the built-in `paragraph` rule if the corresponding node exists in the schema
|
|
82
|
-
if (schema.nodes.paragraph) {
|
|
83
|
-
turndown.use(paragraph(schema.nodes.paragraph, isPlainTextDocument(schema)));
|
|
84
|
-
}
|
|
85
88
|
// Add a rule for `strikethrough` if the corresponding node exists in the schema
|
|
86
89
|
if (schema.marks.strike) {
|
|
87
90
|
turndown.use(strikethrough(schema.marks.strike));
|
|
@@ -17,7 +17,7 @@ function image(nodeType) {
|
|
|
17
17
|
return (turndown) => {
|
|
18
18
|
turndown.addRule(nodeType.name, {
|
|
19
19
|
filter: 'img',
|
|
20
|
-
replacement
|
|
20
|
+
replacement(_, node) {
|
|
21
21
|
const src = String(node.getAttribute('src'));
|
|
22
22
|
// Preserve Data URL image prefix with message about base64 being unsupported
|
|
23
23
|
const link = src.startsWith('data:') ? `${src.split(',')[0]},NOT_SUPPORTED` : src;
|
|
@@ -13,11 +13,11 @@ function listItem(nodeType) {
|
|
|
13
13
|
const tags = extractTagsFromParseRules(nodeType.spec.parseDOM);
|
|
14
14
|
return (turndown) => {
|
|
15
15
|
turndown.addRule(nodeType.name, {
|
|
16
|
-
filter
|
|
16
|
+
filter(node) {
|
|
17
17
|
return (tags.some((tag) => tag.toUpperCase() === node.nodeName) &&
|
|
18
18
|
node.getAttribute('data-type') !== 'taskItem');
|
|
19
19
|
},
|
|
20
|
-
replacement
|
|
20
|
+
replacement(content, node) {
|
|
21
21
|
const parentNode = node.parentNode;
|
|
22
22
|
let listItemMarker = `${BULLET_LIST_MARKER} `;
|
|
23
23
|
// Use a sequence of 1–9 digits for the ordered list marker (CommonMark specification)
|
|
@@ -11,10 +11,10 @@ function strikethrough(markType) {
|
|
|
11
11
|
const tags = extractTagsFromParseRules(markType.spec.parseDOM);
|
|
12
12
|
return (turndown) => {
|
|
13
13
|
turndown.addRule(markType.name, {
|
|
14
|
-
filter
|
|
14
|
+
filter(node) {
|
|
15
15
|
return tags.some((tag) => tag.toUpperCase() === node.nodeName);
|
|
16
16
|
},
|
|
17
|
-
replacement
|
|
17
|
+
replacement(content) {
|
|
18
18
|
return `~~${content}~~`;
|
|
19
19
|
},
|
|
20
20
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"suggestion.d.ts","sourceRoot":"","sources":["../../../../src/serializers/markdown/plugins/suggestion.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AACjD,OAAO,KAAK,QAAQ,MAAM,UAAU,CAAA;AAEpC;;;;;GAKG;AACH,iBAAS,UAAU,CAAC,QAAQ,EAAE,QAAQ,GAAG,QAAQ,CAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"suggestion.d.ts","sourceRoot":"","sources":["../../../../src/serializers/markdown/plugins/suggestion.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AACjD,OAAO,KAAK,QAAQ,MAAM,UAAU,CAAA;AAEpC;;;;;GAKG;AACH,iBAAS,UAAU,CAAC,QAAQ,EAAE,QAAQ,GAAG,QAAQ,CAAC,MAAM,CAgBvD;AAED,OAAO,EAAE,UAAU,EAAE,CAAA"}
|
|
@@ -9,8 +9,10 @@ function suggestion(nodeType) {
|
|
|
9
9
|
const attributeType = kebabCase(nodeType.name.replace(/Suggestion$/, ''));
|
|
10
10
|
return (turndown) => {
|
|
11
11
|
turndown.addRule(nodeType.name, {
|
|
12
|
-
filter
|
|
13
|
-
|
|
12
|
+
filter(node) {
|
|
13
|
+
return node.hasAttribute(`data-${attributeType}`);
|
|
14
|
+
},
|
|
15
|
+
replacement(_, node) {
|
|
14
16
|
const label = String(node.getAttribute('data-label'));
|
|
15
17
|
const id = String(node.getAttribute('data-id'));
|
|
16
18
|
return `[${label}](${attributeType}://${id})`;
|
|
@@ -13,11 +13,11 @@ function taskItem(nodeType) {
|
|
|
13
13
|
const tags = extractTagsFromParseRules(nodeType.spec.parseDOM);
|
|
14
14
|
return (turndown) => {
|
|
15
15
|
turndown.addRule(nodeType.name, {
|
|
16
|
-
filter
|
|
16
|
+
filter(node) {
|
|
17
17
|
return (tags.some((tag) => tag.toUpperCase().startsWith(node.nodeName)) &&
|
|
18
18
|
node.getAttribute('data-type') === 'taskItem');
|
|
19
19
|
},
|
|
20
|
-
replacement
|
|
20
|
+
replacement(content, node) {
|
|
21
21
|
const parentNode = node.parentNode;
|
|
22
22
|
let listItemMarker = `${BULLET_LIST_MARKER} `;
|
|
23
23
|
if (parentNode?.nodeName === 'UL') {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@doist/typist",
|
|
3
3
|
"description": "The mighty Tiptap-based rich-text editor React component that powers Doist products.",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.13",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://typist.doist.dev/",
|
|
7
7
|
"repository": "https://github.com/Doist/typist",
|
|
@@ -46,34 +46,34 @@
|
|
|
46
46
|
"validate:pre-push": "run-s test"
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@tiptap/core": "2.0.0-beta.
|
|
50
|
-
"@tiptap/extension-blockquote": "2.0.0-beta.
|
|
51
|
-
"@tiptap/extension-bold": "2.0.0-beta.
|
|
52
|
-
"@tiptap/extension-bullet-list": "2.0.0-beta.
|
|
53
|
-
"@tiptap/extension-character-count": "2.0.0-beta.
|
|
54
|
-
"@tiptap/extension-code": "2.0.0-beta.
|
|
55
|
-
"@tiptap/extension-code-block": "2.0.0-beta.
|
|
56
|
-
"@tiptap/extension-document": "2.0.0-beta.
|
|
57
|
-
"@tiptap/extension-dropcursor": "2.0.0-beta.
|
|
58
|
-
"@tiptap/extension-gapcursor": "2.0.0-beta.
|
|
59
|
-
"@tiptap/extension-hard-break": "2.0.0-beta.
|
|
60
|
-
"@tiptap/extension-heading": "2.0.0-beta.
|
|
61
|
-
"@tiptap/extension-history": "2.0.0-beta.
|
|
62
|
-
"@tiptap/extension-horizontal-rule": "2.0.0-beta.
|
|
63
|
-
"@tiptap/extension-image": "2.0.0-beta.
|
|
64
|
-
"@tiptap/extension-italic": "2.0.0-beta.
|
|
65
|
-
"@tiptap/extension-link": "2.0.0-beta.
|
|
66
|
-
"@tiptap/extension-list-item": "2.0.0-beta.
|
|
67
|
-
"@tiptap/extension-ordered-list": "2.0.0-beta.
|
|
68
|
-
"@tiptap/extension-paragraph": "2.0.0-beta.
|
|
69
|
-
"@tiptap/extension-placeholder": "2.0.0-beta.
|
|
70
|
-
"@tiptap/extension-strike": "2.0.0-beta.
|
|
71
|
-
"@tiptap/extension-task-item": "2.0.0-beta.
|
|
72
|
-
"@tiptap/extension-task-list": "2.0.0-beta.
|
|
73
|
-
"@tiptap/extension-text": "2.0.0-beta.
|
|
74
|
-
"@tiptap/extension-typography": "2.0.0-beta.
|
|
75
|
-
"@tiptap/react": "2.0.0-beta.
|
|
76
|
-
"@tiptap/suggestion": "2.0.0-beta.
|
|
49
|
+
"@tiptap/core": "2.0.0-beta.215",
|
|
50
|
+
"@tiptap/extension-blockquote": "2.0.0-beta.215",
|
|
51
|
+
"@tiptap/extension-bold": "2.0.0-beta.215",
|
|
52
|
+
"@tiptap/extension-bullet-list": "2.0.0-beta.215",
|
|
53
|
+
"@tiptap/extension-character-count": "2.0.0-beta.215",
|
|
54
|
+
"@tiptap/extension-code": "2.0.0-beta.215",
|
|
55
|
+
"@tiptap/extension-code-block": "2.0.0-beta.215",
|
|
56
|
+
"@tiptap/extension-document": "2.0.0-beta.215",
|
|
57
|
+
"@tiptap/extension-dropcursor": "2.0.0-beta.215",
|
|
58
|
+
"@tiptap/extension-gapcursor": "2.0.0-beta.215",
|
|
59
|
+
"@tiptap/extension-hard-break": "2.0.0-beta.215",
|
|
60
|
+
"@tiptap/extension-heading": "2.0.0-beta.215",
|
|
61
|
+
"@tiptap/extension-history": "2.0.0-beta.215",
|
|
62
|
+
"@tiptap/extension-horizontal-rule": "2.0.0-beta.215",
|
|
63
|
+
"@tiptap/extension-image": "2.0.0-beta.215",
|
|
64
|
+
"@tiptap/extension-italic": "2.0.0-beta.215",
|
|
65
|
+
"@tiptap/extension-link": "2.0.0-beta.215",
|
|
66
|
+
"@tiptap/extension-list-item": "2.0.0-beta.215",
|
|
67
|
+
"@tiptap/extension-ordered-list": "2.0.0-beta.215",
|
|
68
|
+
"@tiptap/extension-paragraph": "2.0.0-beta.215",
|
|
69
|
+
"@tiptap/extension-placeholder": "2.0.0-beta.215",
|
|
70
|
+
"@tiptap/extension-strike": "2.0.0-beta.215",
|
|
71
|
+
"@tiptap/extension-task-item": "2.0.0-beta.215",
|
|
72
|
+
"@tiptap/extension-task-list": "2.0.0-beta.215",
|
|
73
|
+
"@tiptap/extension-text": "2.0.0-beta.215",
|
|
74
|
+
"@tiptap/extension-typography": "2.0.0-beta.215",
|
|
75
|
+
"@tiptap/react": "2.0.0-beta.215",
|
|
76
|
+
"@tiptap/suggestion": "2.0.0-beta.215",
|
|
77
77
|
"prosemirror-codemark": "0.4.2",
|
|
78
78
|
"prosemirror-changeset": "2.2.0",
|
|
79
79
|
"prosemirror-collab": "1.3.0",
|
|
@@ -97,58 +97,58 @@
|
|
|
97
97
|
"devDependencies": {
|
|
98
98
|
"@doist/eslint-config": "8.1.3",
|
|
99
99
|
"@doist/prettier-config": "3.0.5",
|
|
100
|
-
"@doist/reactist": "17.
|
|
100
|
+
"@doist/reactist": "17.10.1",
|
|
101
101
|
"@mdx-js/react": "2.2.1",
|
|
102
102
|
"@semantic-release/changelog": "6.0.2",
|
|
103
103
|
"@semantic-release/exec": "6.0.3",
|
|
104
104
|
"@semantic-release/git": "10.0.1",
|
|
105
|
-
"@storybook/addon-a11y": "6.5.
|
|
106
|
-
"@storybook/addon-essentials": "6.5.
|
|
107
|
-
"@storybook/addons": "6.5.
|
|
108
|
-
"@storybook/builder-vite": "0.2.
|
|
105
|
+
"@storybook/addon-a11y": "6.5.16",
|
|
106
|
+
"@storybook/addon-essentials": "6.5.16",
|
|
107
|
+
"@storybook/addons": "6.5.16",
|
|
108
|
+
"@storybook/builder-vite": "0.2.7",
|
|
109
109
|
"@storybook/mdx2-csf": "0.0.3",
|
|
110
|
-
"@storybook/react": "6.5.
|
|
111
|
-
"@testing-library/dom": "8.
|
|
110
|
+
"@storybook/react": "6.5.16",
|
|
111
|
+
"@testing-library/dom": "8.20.0",
|
|
112
112
|
"@testing-library/jest-dom": "5.16.5",
|
|
113
113
|
"@testing-library/react": "13.4.0",
|
|
114
|
-
"@types/jest": "29.
|
|
114
|
+
"@types/jest": "29.4.0",
|
|
115
115
|
"@types/lodash-es": "4.17.6",
|
|
116
116
|
"@types/marked": "4.0.8",
|
|
117
|
-
"@types/react": "18.0.
|
|
118
|
-
"@types/react-dom": "18.0.
|
|
119
|
-
"@types/react-syntax-highlighter": "15.5.
|
|
117
|
+
"@types/react": "18.0.27",
|
|
118
|
+
"@types/react-dom": "18.0.10",
|
|
119
|
+
"@types/react-syntax-highlighter": "15.5.6",
|
|
120
120
|
"@types/turndown": "5.0.1",
|
|
121
121
|
"boring-avatars": "1.7.0",
|
|
122
122
|
"classnames": "2.3.2",
|
|
123
123
|
"conventional-changelog-conventionalcommits": "5.0.0",
|
|
124
124
|
"emoji-regex": "10.2.1",
|
|
125
|
-
"eslint": "8.
|
|
125
|
+
"eslint": "8.33.0",
|
|
126
126
|
"eslint-formatter-codeframe": "7.32.1",
|
|
127
|
-
"eslint-import-resolver-typescript": "3.5.
|
|
128
|
-
"eslint-plugin-jest": "27.1
|
|
127
|
+
"eslint-import-resolver-typescript": "3.5.3",
|
|
128
|
+
"eslint-plugin-jest": "27.2.1",
|
|
129
129
|
"eslint-plugin-simple-import-sort": "8.0.0",
|
|
130
130
|
"eslint-plugin-unicorn": "45.0.2",
|
|
131
131
|
"github-markdown-css": "5.1.0",
|
|
132
|
-
"husky": "8.0.
|
|
132
|
+
"husky": "8.0.3",
|
|
133
133
|
"ignore-sync": "6.0.2",
|
|
134
134
|
"is-ci": "3.0.1",
|
|
135
|
-
"jest": "29.
|
|
136
|
-
"jest-environment-jsdom": "29.
|
|
137
|
-
"lint-staged": "13.1.
|
|
135
|
+
"jest": "29.4.2",
|
|
136
|
+
"jest-environment-jsdom": "29.4.2",
|
|
137
|
+
"lint-staged": "13.1.1",
|
|
138
138
|
"npm-run-all": "4.1.5",
|
|
139
|
-
"prettier": "2.8.
|
|
139
|
+
"prettier": "2.8.4",
|
|
140
140
|
"react-icons": "4.7.1",
|
|
141
|
-
"react-markdown": "8.0.
|
|
141
|
+
"react-markdown": "8.0.5",
|
|
142
142
|
"react-syntax-highlighter": "15.5.0",
|
|
143
143
|
"rehype-raw": "6.1.1",
|
|
144
144
|
"remark-gfm": "3.0.1",
|
|
145
145
|
"rimraf": "3.0.2",
|
|
146
146
|
"semantic-release": "19.0.5",
|
|
147
147
|
"storybook-css-modules": "1.0.8",
|
|
148
|
-
"ts-jest": "29.0.
|
|
148
|
+
"ts-jest": "29.0.5",
|
|
149
149
|
"ts-node": "10.9.1",
|
|
150
|
-
"type-fest": "3.
|
|
151
|
-
"typescript": "4.9.
|
|
150
|
+
"type-fest": "3.5.6",
|
|
151
|
+
"typescript": "4.9.5",
|
|
152
152
|
"typescript-plugin-css-modules": "4.1.1"
|
|
153
153
|
},
|
|
154
154
|
"peerDependencies": {
|