@atlaskit/editor-wikimarkup-transformer 11.20.15 → 12.0.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/CHANGELOG.md +34 -0
- package/char/package.json +1 -8
- package/dist/cjs/encoder/marks/__base.js +12 -8
- package/dist/cjs/parser/builder/list-builder.js +5 -3
- package/dist/cjs/parser/builder/table-builder.js +5 -3
- package/dist/cjs/parser/nodes/mediaSingle.js +5 -6
- package/dist/cjs/parser/tokenize/common-formatter.js +5 -8
- package/dist/cjs/parser/tokenize/dash-token-creator.js +5 -3
- package/dist/cjs/parser/tokenize/issue-key.js +2 -1
- package/dist/cjs/parser/tokenize/link-text.js +5 -7
- package/dist/cjs/parser/tokenize/links/url-link.js +4 -3
- package/dist/cjs/parser/utils/text.js +5 -3
- package/dist/es2019/encoder/marks/__base.js +12 -8
- package/dist/es2019/parser/builder/list-builder.js +5 -3
- package/dist/es2019/parser/builder/table-builder.js +5 -3
- package/dist/es2019/parser/nodes/mediaSingle.js +5 -6
- package/dist/es2019/parser/tokenize/common-formatter.js +6 -8
- package/dist/es2019/parser/tokenize/dash-token-creator.js +5 -3
- package/dist/es2019/parser/tokenize/issue-key.js +2 -1
- package/dist/es2019/parser/tokenize/link-text.js +5 -7
- package/dist/es2019/parser/tokenize/links/url-link.js +4 -3
- package/dist/es2019/parser/utils/text.js +5 -3
- package/dist/esm/encoder/marks/__base.js +12 -8
- package/dist/esm/parser/builder/list-builder.js +5 -3
- package/dist/esm/parser/builder/table-builder.js +5 -3
- package/dist/esm/parser/nodes/mediaSingle.js +5 -6
- package/dist/esm/parser/tokenize/common-formatter.js +6 -8
- package/dist/esm/parser/tokenize/dash-token-creator.js +5 -3
- package/dist/esm/parser/tokenize/issue-key.js +2 -1
- package/dist/esm/parser/tokenize/link-text.js +5 -7
- package/dist/esm/parser/tokenize/links/url-link.js +4 -3
- package/dist/esm/parser/utils/text.js +5 -3
- package/interfaces/package.json +1 -8
- package/package.json +8 -16
- package/dist/types-ts4.5/char.d.ts +0 -1
- package/dist/types-ts4.5/encoder/emoji-unicode-mapping.d.ts +0 -3
- package/dist/types-ts4.5/encoder/index.d.ts +0 -9
- package/dist/types-ts4.5/encoder/marks/__base.d.ts +0 -5
- package/dist/types-ts4.5/encoder/marks/code.d.ts +0 -2
- package/dist/types-ts4.5/encoder/marks/color.d.ts +0 -2
- package/dist/types-ts4.5/encoder/marks/em.d.ts +0 -2
- package/dist/types-ts4.5/encoder/marks/link.d.ts +0 -2
- package/dist/types-ts4.5/encoder/marks/strike.d.ts +0 -2
- package/dist/types-ts4.5/encoder/marks/strong.d.ts +0 -6
- package/dist/types-ts4.5/encoder/marks/subsup.d.ts +0 -2
- package/dist/types-ts4.5/encoder/marks/underline.d.ts +0 -2
- package/dist/types-ts4.5/encoder/nodes/block-card.d.ts +0 -2
- package/dist/types-ts4.5/encoder/nodes/blockquote.d.ts +0 -2
- package/dist/types-ts4.5/encoder/nodes/bodied-sync-block.d.ts +0 -2
- package/dist/types-ts4.5/encoder/nodes/bullet-list.d.ts +0 -2
- package/dist/types-ts4.5/encoder/nodes/caption.d.ts +0 -2
- package/dist/types-ts4.5/encoder/nodes/code-block.d.ts +0 -2
- package/dist/types-ts4.5/encoder/nodes/date.d.ts +0 -2
- package/dist/types-ts4.5/encoder/nodes/decisionItem.d.ts +0 -3
- package/dist/types-ts4.5/encoder/nodes/decisionList.d.ts +0 -2
- package/dist/types-ts4.5/encoder/nodes/doc.d.ts +0 -2
- package/dist/types-ts4.5/encoder/nodes/embed-card.d.ts +0 -2
- package/dist/types-ts4.5/encoder/nodes/emoji.d.ts +0 -2
- package/dist/types-ts4.5/encoder/nodes/expand.d.ts +0 -2
- package/dist/types-ts4.5/encoder/nodes/hard-break.d.ts +0 -2
- package/dist/types-ts4.5/encoder/nodes/heading.d.ts +0 -2
- package/dist/types-ts4.5/encoder/nodes/inline-card.d.ts +0 -2
- package/dist/types-ts4.5/encoder/nodes/inlines.d.ts +0 -2
- package/dist/types-ts4.5/encoder/nodes/listItem.d.ts +0 -3
- package/dist/types-ts4.5/encoder/nodes/media-group.d.ts +0 -2
- package/dist/types-ts4.5/encoder/nodes/media-inline.d.ts +0 -2
- package/dist/types-ts4.5/encoder/nodes/media.d.ts +0 -2
- package/dist/types-ts4.5/encoder/nodes/mention.d.ts +0 -2
- package/dist/types-ts4.5/encoder/nodes/ordered-list.d.ts +0 -2
- package/dist/types-ts4.5/encoder/nodes/panel.d.ts +0 -2
- package/dist/types-ts4.5/encoder/nodes/paragraph.d.ts +0 -2
- package/dist/types-ts4.5/encoder/nodes/rule.d.ts +0 -2
- package/dist/types-ts4.5/encoder/nodes/status.d.ts +0 -2
- package/dist/types-ts4.5/encoder/nodes/table.d.ts +0 -2
- package/dist/types-ts4.5/encoder/nodes/taskItem.d.ts +0 -3
- package/dist/types-ts4.5/encoder/nodes/taskList.d.ts +0 -2
- package/dist/types-ts4.5/encoder/nodes/text.d.ts +0 -2
- package/dist/types-ts4.5/encoder/nodes/unknown.d.ts +0 -2
- package/dist/types-ts4.5/index.d.ts +0 -15
- package/dist/types-ts4.5/interfaces.d.ts +0 -74
- package/dist/types-ts4.5/parser/abstract-tree.d.ts +0 -11
- package/dist/types-ts4.5/parser/builder/list-builder.d.ts +0 -66
- package/dist/types-ts4.5/parser/builder/table-builder.d.ts +0 -45
- package/dist/types-ts4.5/parser/color.d.ts +0 -3
- package/dist/types-ts4.5/parser/error.d.ts +0 -1
- package/dist/types-ts4.5/parser/nodes/mediaGroup.d.ts +0 -3
- package/dist/types-ts4.5/parser/nodes/mediaSingle.d.ts +0 -5
- package/dist/types-ts4.5/parser/nodes/paragraph.d.ts +0 -7
- package/dist/types-ts4.5/parser/nodes/rule.d.ts +0 -3
- package/dist/types-ts4.5/parser/nodes/text.d.ts +0 -2
- package/dist/types-ts4.5/parser/text.d.ts +0 -10
- package/dist/types-ts4.5/parser/tokenize/adf-macro.d.ts +0 -2
- package/dist/types-ts4.5/parser/tokenize/anchor-macro.d.ts +0 -2
- package/dist/types-ts4.5/parser/tokenize/blockquote.d.ts +0 -2
- package/dist/types-ts4.5/parser/tokenize/citation.d.ts +0 -2
- package/dist/types-ts4.5/parser/tokenize/code-macro.d.ts +0 -2
- package/dist/types-ts4.5/parser/tokenize/color-macro.d.ts +0 -2
- package/dist/types-ts4.5/parser/tokenize/common-formatter.d.ts +0 -10
- package/dist/types-ts4.5/parser/tokenize/common-macro.d.ts +0 -10
- package/dist/types-ts4.5/parser/tokenize/dash-token-creator.d.ts +0 -2
- package/dist/types-ts4.5/parser/tokenize/deleted.d.ts +0 -2
- package/dist/types-ts4.5/parser/tokenize/double-dash-symbol.d.ts +0 -2
- package/dist/types-ts4.5/parser/tokenize/emoji.d.ts +0 -15
- package/dist/types-ts4.5/parser/tokenize/emphasis.d.ts +0 -2
- package/dist/types-ts4.5/parser/tokenize/file-link.d.ts +0 -3
- package/dist/types-ts4.5/parser/tokenize/force-line-break.d.ts +0 -2
- package/dist/types-ts4.5/parser/tokenize/hardbreak.d.ts +0 -2
- package/dist/types-ts4.5/parser/tokenize/heading.d.ts +0 -2
- package/dist/types-ts4.5/parser/tokenize/index.d.ts +0 -55
- package/dist/types-ts4.5/parser/tokenize/inserted.d.ts +0 -2
- package/dist/types-ts4.5/parser/tokenize/issue-key.d.ts +0 -20
- package/dist/types-ts4.5/parser/tokenize/keyword.d.ts +0 -19
- package/dist/types-ts4.5/parser/tokenize/link-text.d.ts +0 -3
- package/dist/types-ts4.5/parser/tokenize/links/attachment-link.d.ts +0 -4
- package/dist/types-ts4.5/parser/tokenize/links/issue-link.d.ts +0 -4
- package/dist/types-ts4.5/parser/tokenize/links/link-format.d.ts +0 -2
- package/dist/types-ts4.5/parser/tokenize/links/link-parser.d.ts +0 -17
- package/dist/types-ts4.5/parser/tokenize/links/link-resolver.d.ts +0 -5
- package/dist/types-ts4.5/parser/tokenize/links/mention-link.d.ts +0 -4
- package/dist/types-ts4.5/parser/tokenize/links/url-link.d.ts +0 -4
- package/dist/types-ts4.5/parser/tokenize/list.d.ts +0 -3
- package/dist/types-ts4.5/parser/tokenize/media.d.ts +0 -2
- package/dist/types-ts4.5/parser/tokenize/monospace.d.ts +0 -2
- package/dist/types-ts4.5/parser/tokenize/noformat-macro.d.ts +0 -2
- package/dist/types-ts4.5/parser/tokenize/panel-macro.d.ts +0 -2
- package/dist/types-ts4.5/parser/tokenize/quadruple-dash-symbol.d.ts +0 -2
- package/dist/types-ts4.5/parser/tokenize/quote-macro.d.ts +0 -8
- package/dist/types-ts4.5/parser/tokenize/ruler.d.ts +0 -2
- package/dist/types-ts4.5/parser/tokenize/strong.d.ts +0 -2
- package/dist/types-ts4.5/parser/tokenize/subscript.d.ts +0 -2
- package/dist/types-ts4.5/parser/tokenize/superscript.d.ts +0 -2
- package/dist/types-ts4.5/parser/tokenize/table.d.ts +0 -2
- package/dist/types-ts4.5/parser/tokenize/triple-dash-symbol.d.ts +0 -2
- package/dist/types-ts4.5/parser/tokenize/whitespace.d.ts +0 -3
- package/dist/types-ts4.5/parser/utils/attrs.d.ts +0 -3
- package/dist/types-ts4.5/parser/utils/color-name-mapping.d.ts +0 -10
- package/dist/types-ts4.5/parser/utils/escape.d.ts +0 -2
- package/dist/types-ts4.5/parser/utils/normalize.d.ts +0 -5
- package/dist/types-ts4.5/parser/utils/panel-type.d.ts +0 -3
- package/dist/types-ts4.5/parser/utils/text.d.ts +0 -25
- package/dist/types-ts4.5/parser/utils/title.d.ts +0 -7
- package/dist/types-ts4.5/parser/utils/url.d.ts +0 -8
|
@@ -3,6 +3,10 @@ import { linkFormat } from './links/link-format';
|
|
|
3
3
|
import { parseNewlineOnly } from './whitespace';
|
|
4
4
|
import { parseMacroKeyword } from './keyword';
|
|
5
5
|
import { escapeHandler } from '../utils/escape';
|
|
6
|
+
|
|
7
|
+
// Ignored via go/ees005
|
|
8
|
+
// eslint-disable-next-line require-unicode-regexp
|
|
9
|
+
var ALPHANUMERIC_OR_NON_ASCII_REGEX = /[a-zA-Z0-9]|[^\u0000-\u007F]/;
|
|
6
10
|
var processState = {
|
|
7
11
|
START: 0,
|
|
8
12
|
BUFFER: 1,
|
|
@@ -32,10 +36,7 @@ export function commonFormatter(input, position, schema, opt) {
|
|
|
32
36
|
* formatter
|
|
33
37
|
*/
|
|
34
38
|
var charBeforeOpening = input.charAt(position - 1);
|
|
35
|
-
if (!openingWrapped &&
|
|
36
|
-
// Ignored via go/ees005
|
|
37
|
-
// eslint-disable-next-line require-unicode-regexp
|
|
38
|
-
/[a-zA-Z0-9]|[^\u0000-\u007F]/.test(charBeforeOpening) && charBeforeOpening !== "\xA0") {
|
|
39
|
+
if (!openingWrapped && ALPHANUMERIC_OR_NON_ASCII_REGEX.test(charBeforeOpening) && charBeforeOpening !== "\xA0") {
|
|
39
40
|
return fallback(input, index, openingSymbolLength);
|
|
40
41
|
}
|
|
41
42
|
}
|
|
@@ -94,10 +95,7 @@ export function commonFormatter(input, position, schema, opt) {
|
|
|
94
95
|
*/
|
|
95
96
|
if (index < input.length) {
|
|
96
97
|
var charAfterEnd = input.charAt(index);
|
|
97
|
-
if (!closingWrapped &&
|
|
98
|
-
// Ignored via go/ees005
|
|
99
|
-
// eslint-disable-next-line require-unicode-regexp
|
|
100
|
-
/[a-zA-Z0-9]|[^\u0000-\u007F]/.test(charAfterEnd) && charAfterEnd !== "\xA0") {
|
|
98
|
+
if (!closingWrapped && ALPHANUMERIC_OR_NON_ASCII_REGEX.test(charAfterEnd) && charAfterEnd !== "\xA0") {
|
|
101
99
|
buffer.push(charsMatchClosingSymbol);
|
|
102
100
|
state = processState.BUFFER;
|
|
103
101
|
continue;
|
|
@@ -22,8 +22,10 @@ export var createDashTokenParser = function createDashTokenParser(token, fallbac
|
|
|
22
22
|
return token;
|
|
23
23
|
};
|
|
24
24
|
};
|
|
25
|
+
|
|
26
|
+
// Ignored via go/ees005
|
|
27
|
+
// eslint-disable-next-line require-unicode-regexp
|
|
28
|
+
var WHITESPACE_REGEX = /\s/;
|
|
25
29
|
var isSpace = function isSpace(char) {
|
|
26
|
-
|
|
27
|
-
// eslint-disable-next-line require-unicode-regexp
|
|
28
|
-
return /\s/.test(char);
|
|
30
|
+
return WHITESPACE_REGEX.test(char);
|
|
29
31
|
};
|
|
@@ -65,8 +65,9 @@ var withInlineCardFromTextStamp = function withInlineCardFromTextStamp(issue) {
|
|
|
65
65
|
|
|
66
66
|
// Ignored via go/ees005
|
|
67
67
|
// eslint-disable-next-line require-unicode-regexp
|
|
68
|
+
var ALLOWED_CHARS_REGEX = /\s|\(|\)|!|\.|\,|\/|\:/;
|
|
68
69
|
var isNotAllowedChars = function isNotAllowedChars(char) {
|
|
69
|
-
return
|
|
70
|
+
return !ALLOWED_CHARS_REGEX.test(char);
|
|
70
71
|
};
|
|
71
72
|
export var buildIssueKeyRegex = function buildIssueKeyRegex(inlineCardConversion) {
|
|
72
73
|
if (!inlineCardConversion) {
|
|
@@ -57,13 +57,11 @@ function fallback(input, position) {
|
|
|
57
57
|
};
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
+
// Ignored via go/ees005
|
|
61
|
+
// eslint-disable-next-line require-unicode-regexp
|
|
62
|
+
var BAD_END_CHARS_REGEX = /[.,>)\];}"\'!]*$/;
|
|
63
|
+
|
|
60
64
|
// removes bad characters from the end of regex match
|
|
61
65
|
function trimBadEndChar(input) {
|
|
62
|
-
return [
|
|
63
|
-
// Ignored via go/ees005
|
|
64
|
-
// eslint-disable-next-line require-unicode-regexp
|
|
65
|
-
input[0].replace(/[.,>)\];}"\'!]*$/, ''), input[1],
|
|
66
|
-
// Ignored via go/ees005
|
|
67
|
-
// eslint-disable-next-line require-unicode-regexp
|
|
68
|
-
input[2].replace(/[.,>)\];}"\'!]*$/, '')];
|
|
66
|
+
return [input[0].replace(BAD_END_CHARS_REGEX, ''), input[1], input[2].replace(BAD_END_CHARS_REGEX, '')];
|
|
69
67
|
}
|
|
@@ -3,6 +3,9 @@ import { TokenType } from '../index';
|
|
|
3
3
|
import { isSafeUrl } from '@atlaskit/adf-schema';
|
|
4
4
|
import { parseString } from '../../text';
|
|
5
5
|
import { hasAnyOfMarks } from '../../utils/text';
|
|
6
|
+
// Ignored via go/ees005
|
|
7
|
+
// eslint-disable-next-line require-unicode-regexp
|
|
8
|
+
var MAILTO_PREFIX_REGEX = /^mailto:/;
|
|
6
9
|
export function urlLinkResolver(link, schema, context) {
|
|
7
10
|
var output = [];
|
|
8
11
|
var url = link.notLinkBody;
|
|
@@ -15,9 +18,7 @@ export function urlLinkResolver(link, schema, context) {
|
|
|
15
18
|
ignoreTokenTypes: ignoreTokenTypes,
|
|
16
19
|
schema: schema,
|
|
17
20
|
context: context,
|
|
18
|
-
|
|
19
|
-
// eslint-disable-next-line require-unicode-regexp
|
|
20
|
-
input: textRepresentation.replace(/^mailto:/, '')
|
|
21
|
+
input: textRepresentation.replace(MAILTO_PREFIX_REGEX, '')
|
|
21
22
|
});
|
|
22
23
|
var decoratedContent = rawContent.map(function (n) {
|
|
23
24
|
var mark = schema.marks.link.create({
|
|
@@ -10,10 +10,12 @@ export function hasAnyOfMarks(node, types) {
|
|
|
10
10
|
}) !== -1;
|
|
11
11
|
}) !== -1;
|
|
12
12
|
}
|
|
13
|
+
|
|
14
|
+
// Ignored via go/ees005
|
|
15
|
+
// eslint-disable-next-line require-unicode-regexp
|
|
16
|
+
var DIGIT_REGEX = /^\d$/;
|
|
13
17
|
export function isDigit(value) {
|
|
14
|
-
|
|
15
|
-
// eslint-disable-next-line require-unicode-regexp
|
|
16
|
-
return !!value.match(/^\d$/);
|
|
18
|
+
return !!value.match(DIGIT_REGEX);
|
|
17
19
|
}
|
|
18
20
|
export function isBlank(value) {
|
|
19
21
|
return value === null || value.trim() === '';
|
package/interfaces/package.json
CHANGED
|
@@ -4,12 +4,5 @@
|
|
|
4
4
|
"module": "../dist/esm/interfaces.js",
|
|
5
5
|
"module:es2019": "../dist/es2019/interfaces.js",
|
|
6
6
|
"sideEffects": false,
|
|
7
|
-
"types": "../dist/types/interfaces.d.ts"
|
|
8
|
-
"typesVersions": {
|
|
9
|
-
">=4.5 <5.9": {
|
|
10
|
-
"*": [
|
|
11
|
-
"../dist/types-ts4.5/interfaces.d.ts"
|
|
12
|
-
]
|
|
13
|
-
}
|
|
14
|
-
}
|
|
7
|
+
"types": "../dist/types/interfaces.d.ts"
|
|
15
8
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-wikimarkup-transformer",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "12.0.0",
|
|
4
4
|
"description": "Wiki markup transformer for JIRA and Confluence",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -12,14 +12,6 @@
|
|
|
12
12
|
"module": "dist/esm/index.js",
|
|
13
13
|
"module:es2019": "dist/es2019/index.js",
|
|
14
14
|
"types": "dist/types/index.d.ts",
|
|
15
|
-
"typesVersions": {
|
|
16
|
-
">=4.5 <4.9": {
|
|
17
|
-
"*": [
|
|
18
|
-
"dist/types-ts4.5/*",
|
|
19
|
-
"dist/types-ts4.5/index.d.ts"
|
|
20
|
-
]
|
|
21
|
-
}
|
|
22
|
-
},
|
|
23
15
|
"sideEffects": false,
|
|
24
16
|
"atlaskit:src": "src/index.ts",
|
|
25
17
|
"atlassian": {
|
|
@@ -29,18 +21,18 @@
|
|
|
29
21
|
}
|
|
30
22
|
},
|
|
31
23
|
"dependencies": {
|
|
32
|
-
"@atlaskit/adf-schema": "^
|
|
33
|
-
"@atlaskit/editor-json-transformer": "^
|
|
34
|
-
"@atlaskit/editor-prosemirror": "^
|
|
24
|
+
"@atlaskit/adf-schema": "^55.0.0",
|
|
25
|
+
"@atlaskit/editor-json-transformer": "^9.0.0",
|
|
26
|
+
"@atlaskit/editor-prosemirror": "^8.0.0",
|
|
35
27
|
"@babel/runtime": "^7.0.0"
|
|
36
28
|
},
|
|
37
29
|
"devDependencies": {
|
|
38
30
|
"@atlaskit/activity": "^1.0.1",
|
|
39
|
-
"@atlaskit/editor-core": "^
|
|
31
|
+
"@atlaskit/editor-core": "^221.0.0",
|
|
40
32
|
"@atlaskit/editor-test-helpers": "workspace:^",
|
|
41
|
-
"@atlaskit/mention": "^
|
|
42
|
-
"@atlaskit/tokens": "^
|
|
43
|
-
"@atlaskit/util-data-test": "^
|
|
33
|
+
"@atlaskit/mention": "^27.0.0",
|
|
34
|
+
"@atlaskit/tokens": "^14.0.0",
|
|
35
|
+
"@atlaskit/util-data-test": "^19.0.0",
|
|
44
36
|
"@atlassian/structured-docs-types": "workspace:^",
|
|
45
37
|
"@emotion/react": "^11.7.1",
|
|
46
38
|
"@types/debug": "^4.1.10",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const EM_DASH = "\u2014";
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
-
import type { Context } from '../interfaces';
|
|
3
|
-
export type MarkEncoder = (text: string, attrs: any) => string;
|
|
4
|
-
export type NodeEncoder = (node: PMNode, opts?: NodeEncoderOpts) => string;
|
|
5
|
-
export type NodeEncoderOpts = {
|
|
6
|
-
context?: Context;
|
|
7
|
-
parent?: PMNode;
|
|
8
|
-
};
|
|
9
|
-
export declare function encode(node: PMNode, context?: Context): string;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { Node as PMNode, Schema } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
-
import type { Context } from './interfaces';
|
|
3
|
-
interface Transformer<T> {
|
|
4
|
-
encode: (node: PMNode) => T;
|
|
5
|
-
parse: (content: T) => PMNode;
|
|
6
|
-
}
|
|
7
|
-
export declare class WikiMarkupTransformer implements Transformer<string> {
|
|
8
|
-
private schema;
|
|
9
|
-
constructor(schema?: Schema);
|
|
10
|
-
private sanitizeWikiMarkup;
|
|
11
|
-
encode(node: PMNode, context?: Context): string;
|
|
12
|
-
parse(wikiMarkup: string, context?: Context): PMNode;
|
|
13
|
-
private buildContext;
|
|
14
|
-
}
|
|
15
|
-
export default WikiMarkupTransformer;
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
-
export interface AddArgs {
|
|
3
|
-
content: PMNode[];
|
|
4
|
-
style: string | null;
|
|
5
|
-
}
|
|
6
|
-
export interface Builder {
|
|
7
|
-
/**
|
|
8
|
-
* Add a item to the builder
|
|
9
|
-
* @param {AddCellArgs[]} items
|
|
10
|
-
*/
|
|
11
|
-
add: (items: AddCellArgs[]) => void;
|
|
12
|
-
/**
|
|
13
|
-
* Compile a prosemirror node from the root list
|
|
14
|
-
* @returns {PMNode}
|
|
15
|
-
*/
|
|
16
|
-
buildPMNode: () => PMNode;
|
|
17
|
-
type: string;
|
|
18
|
-
}
|
|
19
|
-
export interface ListItem {
|
|
20
|
-
children: List[];
|
|
21
|
-
content?: any[];
|
|
22
|
-
parent: List;
|
|
23
|
-
}
|
|
24
|
-
export interface List {
|
|
25
|
-
children: ListItem[];
|
|
26
|
-
parent?: ListItem;
|
|
27
|
-
type: ListType;
|
|
28
|
-
}
|
|
29
|
-
export type ListType = 'bulletList' | 'orderedList';
|
|
30
|
-
export type CellType = 'tableHeader' | 'tableCell';
|
|
31
|
-
export interface TableCell {
|
|
32
|
-
content: PMNode[];
|
|
33
|
-
type: CellType;
|
|
34
|
-
}
|
|
35
|
-
export interface TableRow {
|
|
36
|
-
cells: TableCell[];
|
|
37
|
-
}
|
|
38
|
-
export interface Table {
|
|
39
|
-
rows: TableRow[];
|
|
40
|
-
}
|
|
41
|
-
export interface AddCellArgs extends AddArgs {
|
|
42
|
-
content: PMNode[];
|
|
43
|
-
style: string;
|
|
44
|
-
}
|
|
45
|
-
export interface ConversionMap {
|
|
46
|
-
[key: string]: string;
|
|
47
|
-
}
|
|
48
|
-
export interface MediaConversionMap {
|
|
49
|
-
[key: string]: {
|
|
50
|
-
embed?: boolean;
|
|
51
|
-
transform?: string;
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
export type TokenErrCallback = (err: Error, tokenType: string) => void;
|
|
55
|
-
export interface Context {
|
|
56
|
-
readonly conversion?: {
|
|
57
|
-
readonly inlineCardConversion?: ConversionMap;
|
|
58
|
-
readonly mediaConversion?: MediaConversionMap;
|
|
59
|
-
mentionConversion?: ConversionMap;
|
|
60
|
-
};
|
|
61
|
-
readonly defaults?: {
|
|
62
|
-
readonly media?: {
|
|
63
|
-
height: number | null;
|
|
64
|
-
width: number | null;
|
|
65
|
-
};
|
|
66
|
-
};
|
|
67
|
-
readonly hydration?: {
|
|
68
|
-
readonly media?: {
|
|
69
|
-
targetCollectionId?: string;
|
|
70
|
-
};
|
|
71
|
-
};
|
|
72
|
-
readonly issueKeyRegex?: RegExp | undefined;
|
|
73
|
-
readonly tokenErrCallback?: TokenErrCallback;
|
|
74
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { Node as PMNode, Schema } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
-
import type { Context } from '../interfaces';
|
|
3
|
-
export default class AbstractTree {
|
|
4
|
-
private schema;
|
|
5
|
-
private wikiMarkup;
|
|
6
|
-
constructor(schema: Schema, wikiMarkup: string);
|
|
7
|
-
/**
|
|
8
|
-
* Convert reduced macros tree into prosemirror model tree
|
|
9
|
-
*/
|
|
10
|
-
getProseMirrorModel(context: Context): PMNode;
|
|
11
|
-
}
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import type { Node as PMNode, Schema } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
-
import type { AddArgs, ListType } from '../../interfaces';
|
|
3
|
-
/**
|
|
4
|
-
* Return the type of a list from the bullets
|
|
5
|
-
*/
|
|
6
|
-
export declare function getType(bullets: string): ListType;
|
|
7
|
-
export declare class ListBuilder {
|
|
8
|
-
private schema;
|
|
9
|
-
private root;
|
|
10
|
-
private lastDepth;
|
|
11
|
-
private lastList;
|
|
12
|
-
constructor(schema: Schema, bullets: string);
|
|
13
|
-
/**
|
|
14
|
-
* Return the type of the base list
|
|
15
|
-
* @returns {ListType}
|
|
16
|
-
*/
|
|
17
|
-
get type(): ListType;
|
|
18
|
-
/**
|
|
19
|
-
* Add a list item to the builder
|
|
20
|
-
* @param {AddArgs[]} items
|
|
21
|
-
*/
|
|
22
|
-
add(items: AddArgs[]): void;
|
|
23
|
-
/**
|
|
24
|
-
* Compile a prosemirror node from the root list
|
|
25
|
-
* @returns {PMNode[]}
|
|
26
|
-
*/
|
|
27
|
-
buildPMNode(): PMNode[];
|
|
28
|
-
/**
|
|
29
|
-
* Build prosemirror bulletList or orderedList node
|
|
30
|
-
* @param {List} list
|
|
31
|
-
* @returns {PMNode}
|
|
32
|
-
*/
|
|
33
|
-
private parseList;
|
|
34
|
-
/**
|
|
35
|
-
* Build prosemirror listItem node
|
|
36
|
-
* This function would possibly return non listItem nodes
|
|
37
|
-
* which we need to break out later
|
|
38
|
-
* @param {ListItem} item
|
|
39
|
-
*/
|
|
40
|
-
private parseListItem;
|
|
41
|
-
private isParagraphEmptyTextNode;
|
|
42
|
-
private createListItem;
|
|
43
|
-
/**
|
|
44
|
-
* Add an item at the same level as the current list item
|
|
45
|
-
* @param {ListType} type
|
|
46
|
-
* @param {PMNode} content
|
|
47
|
-
* @returns {PMNode}
|
|
48
|
-
*/
|
|
49
|
-
private addListItem;
|
|
50
|
-
/**
|
|
51
|
-
* Append the past content to the last accessed list node (multiline entries)
|
|
52
|
-
* @param {PMNode[]} content
|
|
53
|
-
*/
|
|
54
|
-
private appendToLastItem;
|
|
55
|
-
/**
|
|
56
|
-
* Created a nested list structure of N depth under the current node
|
|
57
|
-
* @param {number} depth
|
|
58
|
-
* @param {ListType} type
|
|
59
|
-
*/
|
|
60
|
-
private createNest;
|
|
61
|
-
/**
|
|
62
|
-
* Find the Nth list ancestor of the current list
|
|
63
|
-
* @param {number} depth
|
|
64
|
-
*/
|
|
65
|
-
private findAncestor;
|
|
66
|
-
}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import type { Node as PMNode, Schema } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
-
import type { AddCellArgs, Builder } from '../../interfaces';
|
|
3
|
-
export declare class TableBuilder implements Builder {
|
|
4
|
-
private schema;
|
|
5
|
-
private root;
|
|
6
|
-
private lastRow?;
|
|
7
|
-
constructor(schema: Schema);
|
|
8
|
-
/**
|
|
9
|
-
* Return the type of the base element
|
|
10
|
-
* @returns {string}
|
|
11
|
-
*/
|
|
12
|
-
get type(): string;
|
|
13
|
-
/**
|
|
14
|
-
* Add new cells to the table
|
|
15
|
-
* @param {AddCellArgs[]} cells
|
|
16
|
-
*/
|
|
17
|
-
add(cells: AddCellArgs[]): void;
|
|
18
|
-
/**
|
|
19
|
-
* Build a prosemirror table from the data
|
|
20
|
-
* @returns {PMNode}
|
|
21
|
-
*/
|
|
22
|
-
buildPMNode(): PMNode;
|
|
23
|
-
private emptyTableCell;
|
|
24
|
-
private emptyTableRow;
|
|
25
|
-
/**
|
|
26
|
-
* Build prosemirror table node
|
|
27
|
-
* @returns {PMNode}
|
|
28
|
-
*/
|
|
29
|
-
private buildTableNode;
|
|
30
|
-
/**
|
|
31
|
-
* Build prosemirror tr node
|
|
32
|
-
* @returns {PMNode}
|
|
33
|
-
*/
|
|
34
|
-
private buildTableRowNode;
|
|
35
|
-
/**
|
|
36
|
-
* Build prosemirror td/th node
|
|
37
|
-
* @param {TableCell} cell
|
|
38
|
-
* @returns {PMNode}
|
|
39
|
-
*/
|
|
40
|
-
private buildTableCellNode;
|
|
41
|
-
/**
|
|
42
|
-
* Add a new row to the table
|
|
43
|
-
*/
|
|
44
|
-
private addRow;
|
|
45
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function error(message: string, _input: string, line: number, column: number): void;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { Node as PMNode, Schema } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
-
import type { Context } from '../../interfaces';
|
|
3
|
-
export default function getMediaSingleNodeView(schema: Schema, filename: string, attrs: {
|
|
4
|
-
[key: string]: string;
|
|
5
|
-
}, context?: Context): PMNode;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { Node as PMNode, Schema } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
-
export declare function createEmptyParagraphNode(schema: Schema): PMNode;
|
|
3
|
-
/**
|
|
4
|
-
* Create paragraphs from inline nodes. Function will return
|
|
5
|
-
* an empty array in case only hardbreaks are present
|
|
6
|
-
*/
|
|
7
|
-
export declare function createParagraphNodeFromInlineNodes(inlineNodes: PMNode[], schema: Schema): PMNode[];
|