@atlaskit/editor-wikimarkup-transformer 11.1.8 → 11.1.10
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/dist/cjs/parser/tokenize/table.js +16 -10
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/parser/tokenize/table.js +16 -10
- package/dist/es2019/version.json +1 -1
- package/dist/esm/parser/tokenize/table.js +16 -10
- package/dist/esm/version.json +1 -1
- package/package.json +5 -12
- package/report.api.md +1 -1
- package/dist/types-ts4.0/char.d.ts +0 -1
- package/dist/types-ts4.0/encoder/emoji-unicode-mapping.d.ts +0 -3
- package/dist/types-ts4.0/encoder/index.d.ts +0 -9
- package/dist/types-ts4.0/encoder/marks/__base.d.ts +0 -5
- package/dist/types-ts4.0/encoder/marks/code.d.ts +0 -2
- package/dist/types-ts4.0/encoder/marks/color.d.ts +0 -2
- package/dist/types-ts4.0/encoder/marks/em.d.ts +0 -2
- package/dist/types-ts4.0/encoder/marks/link.d.ts +0 -2
- package/dist/types-ts4.0/encoder/marks/strike.d.ts +0 -2
- package/dist/types-ts4.0/encoder/marks/strong.d.ts +0 -6
- package/dist/types-ts4.0/encoder/marks/subsup.d.ts +0 -2
- package/dist/types-ts4.0/encoder/marks/underline.d.ts +0 -2
- package/dist/types-ts4.0/encoder/nodes/block-card.d.ts +0 -2
- package/dist/types-ts4.0/encoder/nodes/blockquote.d.ts +0 -2
- package/dist/types-ts4.0/encoder/nodes/bullet-list.d.ts +0 -2
- package/dist/types-ts4.0/encoder/nodes/caption.d.ts +0 -2
- package/dist/types-ts4.0/encoder/nodes/code-block.d.ts +0 -2
- package/dist/types-ts4.0/encoder/nodes/date.d.ts +0 -2
- package/dist/types-ts4.0/encoder/nodes/decisionItem.d.ts +0 -3
- package/dist/types-ts4.0/encoder/nodes/decisionList.d.ts +0 -2
- package/dist/types-ts4.0/encoder/nodes/doc.d.ts +0 -2
- package/dist/types-ts4.0/encoder/nodes/embed-card.d.ts +0 -2
- package/dist/types-ts4.0/encoder/nodes/emoji.d.ts +0 -2
- package/dist/types-ts4.0/encoder/nodes/expand.d.ts +0 -2
- package/dist/types-ts4.0/encoder/nodes/hard-break.d.ts +0 -2
- package/dist/types-ts4.0/encoder/nodes/heading.d.ts +0 -2
- package/dist/types-ts4.0/encoder/nodes/inline-card.d.ts +0 -2
- package/dist/types-ts4.0/encoder/nodes/inlines.d.ts +0 -2
- package/dist/types-ts4.0/encoder/nodes/listItem.d.ts +0 -3
- package/dist/types-ts4.0/encoder/nodes/media-group.d.ts +0 -2
- package/dist/types-ts4.0/encoder/nodes/media-inline.d.ts +0 -2
- package/dist/types-ts4.0/encoder/nodes/media.d.ts +0 -2
- package/dist/types-ts4.0/encoder/nodes/mention.d.ts +0 -2
- package/dist/types-ts4.0/encoder/nodes/ordered-list.d.ts +0 -2
- package/dist/types-ts4.0/encoder/nodes/panel.d.ts +0 -2
- package/dist/types-ts4.0/encoder/nodes/paragraph.d.ts +0 -2
- package/dist/types-ts4.0/encoder/nodes/rule.d.ts +0 -2
- package/dist/types-ts4.0/encoder/nodes/status.d.ts +0 -2
- package/dist/types-ts4.0/encoder/nodes/table.d.ts +0 -2
- package/dist/types-ts4.0/encoder/nodes/taskItem.d.ts +0 -3
- package/dist/types-ts4.0/encoder/nodes/taskList.d.ts +0 -2
- package/dist/types-ts4.0/encoder/nodes/text.d.ts +0 -2
- package/dist/types-ts4.0/encoder/nodes/unknown.d.ts +0 -2
- package/dist/types-ts4.0/index.d.ts +0 -15
- package/dist/types-ts4.0/interfaces.d.ts +0 -74
- package/dist/types-ts4.0/parser/abstract-tree.d.ts +0 -11
- package/dist/types-ts4.0/parser/builder/list-builder.d.ts +0 -66
- package/dist/types-ts4.0/parser/builder/table-builder.d.ts +0 -45
- package/dist/types-ts4.0/parser/color.d.ts +0 -3
- package/dist/types-ts4.0/parser/error.d.ts +0 -1
- package/dist/types-ts4.0/parser/nodes/mediaGroup.d.ts +0 -3
- package/dist/types-ts4.0/parser/nodes/mediaSingle.d.ts +0 -5
- package/dist/types-ts4.0/parser/nodes/paragraph.d.ts +0 -7
- package/dist/types-ts4.0/parser/nodes/rule.d.ts +0 -3
- package/dist/types-ts4.0/parser/nodes/text.d.ts +0 -2
- package/dist/types-ts4.0/parser/text.d.ts +0 -10
- package/dist/types-ts4.0/parser/tokenize/adf-macro.d.ts +0 -2
- package/dist/types-ts4.0/parser/tokenize/anchor-macro.d.ts +0 -2
- package/dist/types-ts4.0/parser/tokenize/blockquote.d.ts +0 -2
- package/dist/types-ts4.0/parser/tokenize/citation.d.ts +0 -2
- package/dist/types-ts4.0/parser/tokenize/code-macro.d.ts +0 -2
- package/dist/types-ts4.0/parser/tokenize/color-macro.d.ts +0 -2
- package/dist/types-ts4.0/parser/tokenize/common-formatter.d.ts +0 -10
- package/dist/types-ts4.0/parser/tokenize/common-macro.d.ts +0 -10
- package/dist/types-ts4.0/parser/tokenize/dash-token-creator.d.ts +0 -2
- package/dist/types-ts4.0/parser/tokenize/deleted.d.ts +0 -2
- package/dist/types-ts4.0/parser/tokenize/double-dash-symbol.d.ts +0 -1
- package/dist/types-ts4.0/parser/tokenize/emoji.d.ts +0 -15
- package/dist/types-ts4.0/parser/tokenize/emphasis.d.ts +0 -2
- package/dist/types-ts4.0/parser/tokenize/file-link.d.ts +0 -3
- package/dist/types-ts4.0/parser/tokenize/force-line-break.d.ts +0 -2
- package/dist/types-ts4.0/parser/tokenize/hardbreak.d.ts +0 -2
- package/dist/types-ts4.0/parser/tokenize/heading.d.ts +0 -2
- package/dist/types-ts4.0/parser/tokenize/index.d.ts +0 -55
- package/dist/types-ts4.0/parser/tokenize/inserted.d.ts +0 -2
- package/dist/types-ts4.0/parser/tokenize/issue-key.d.ts +0 -20
- package/dist/types-ts4.0/parser/tokenize/keyword.d.ts +0 -19
- package/dist/types-ts4.0/parser/tokenize/link-text.d.ts +0 -3
- package/dist/types-ts4.0/parser/tokenize/links/attachment-link.d.ts +0 -4
- package/dist/types-ts4.0/parser/tokenize/links/issue-link.d.ts +0 -4
- package/dist/types-ts4.0/parser/tokenize/links/link-format.d.ts +0 -2
- package/dist/types-ts4.0/parser/tokenize/links/link-parser.d.ts +0 -17
- package/dist/types-ts4.0/parser/tokenize/links/link-resolver.d.ts +0 -5
- package/dist/types-ts4.0/parser/tokenize/links/mention-link.d.ts +0 -4
- package/dist/types-ts4.0/parser/tokenize/links/url-link.d.ts +0 -4
- package/dist/types-ts4.0/parser/tokenize/list.d.ts +0 -3
- package/dist/types-ts4.0/parser/tokenize/media.d.ts +0 -2
- package/dist/types-ts4.0/parser/tokenize/monospace.d.ts +0 -2
- package/dist/types-ts4.0/parser/tokenize/noformat-macro.d.ts +0 -2
- package/dist/types-ts4.0/parser/tokenize/panel-macro.d.ts +0 -2
- package/dist/types-ts4.0/parser/tokenize/quadruple-dash-symbol.d.ts +0 -2
- package/dist/types-ts4.0/parser/tokenize/quote-macro.d.ts +0 -5
- package/dist/types-ts4.0/parser/tokenize/ruler.d.ts +0 -2
- package/dist/types-ts4.0/parser/tokenize/strong.d.ts +0 -2
- package/dist/types-ts4.0/parser/tokenize/subscript.d.ts +0 -2
- package/dist/types-ts4.0/parser/tokenize/superscript.d.ts +0 -2
- package/dist/types-ts4.0/parser/tokenize/table.d.ts +0 -2
- package/dist/types-ts4.0/parser/tokenize/triple-dash-symbol.d.ts +0 -1
- package/dist/types-ts4.0/parser/tokenize/whitespace.d.ts +0 -3
- package/dist/types-ts4.0/parser/utils/attrs.d.ts +0 -3
- package/dist/types-ts4.0/parser/utils/color-name-mapping.d.ts +0 -10
- package/dist/types-ts4.0/parser/utils/escape.d.ts +0 -2
- package/dist/types-ts4.0/parser/utils/normalize.d.ts +0 -4
- package/dist/types-ts4.0/parser/utils/panel-type.d.ts +0 -3
- package/dist/types-ts4.0/parser/utils/text.d.ts +0 -25
- package/dist/types-ts4.0/parser/utils/title.d.ts +0 -7
- package/dist/types-ts4.0/parser/utils/url.d.ts +0 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/editor-wikimarkup-transformer
|
|
2
2
|
|
|
3
|
+
## 11.1.10
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`6eb39a91ca0`](https://bitbucket.org/atlassian/atlassian-frontend/commits/6eb39a91ca0) - Fixed ADF parsing issue related to codeblock inside table header
|
|
8
|
+
|
|
9
|
+
## 11.1.9
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`13721843343`](https://bitbucket.org/atlassian/atlassian-frontend/commits/13721843343) - Added support for multiple hardbreaks inside a table
|
|
14
|
+
|
|
3
15
|
## 11.1.8
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -98,16 +98,22 @@ var table = function table(_ref) {
|
|
|
98
98
|
|
|
99
99
|
case processState.LINE_BREAK:
|
|
100
100
|
{
|
|
101
|
+
//ADFEXP-156 (Prevent table from closing on multiple line breaks and relying on | for closing of table)
|
|
101
102
|
// If we encounter an empty line, we should end the table
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
103
|
+
// const emptyLineMatch = substring.match(EMPTY_LINE_REGEXP);
|
|
104
|
+
// if (emptyLineMatch) {
|
|
105
|
+
// bufferToCells(
|
|
106
|
+
// cellStyle,
|
|
107
|
+
// buffer.join(''),
|
|
108
|
+
// cellsBuffer,
|
|
109
|
+
// schema,
|
|
110
|
+
// ignoreTokenTypes,
|
|
111
|
+
// context,
|
|
112
|
+
// );
|
|
113
|
+
// currentState = processState.END_TABLE;
|
|
114
|
+
// continue;
|
|
115
|
+
// }
|
|
116
|
+
// If we enconter a new row
|
|
111
117
|
var cellMatch = substring.match(CELL_REGEXP);
|
|
112
118
|
|
|
113
119
|
if (cellMatch) {
|
|
@@ -372,7 +378,7 @@ function createTableHeader(pmNode, schema) {
|
|
|
372
378
|
|
|
373
379
|
if (pmNode.type.name === 'text' && !(0, _text2.hasAnyOfMarks)(pmNode, ['strong', 'code'])) {
|
|
374
380
|
return pmNode.mark([].concat((0, _toConsumableArray2.default)(pmNode.marks), [mark]));
|
|
375
|
-
} else if (pmNode.childCount > 0 && pmNode.firstChild && pmNode.child(0)) {
|
|
381
|
+
} else if (pmNode.childCount > 0 && pmNode.firstChild && pmNode.child(0) && pmNode.type.name !== 'codeBlock') {
|
|
376
382
|
var jsonNode = traverseJsonNodeAndAddMarks(pmNode.toJSON(), 'strong', schema);
|
|
377
383
|
pmNode = _prosemirrorModel.Node.fromJSON(schema, jsonNode);
|
|
378
384
|
return pmNode;
|
package/dist/cjs/version.json
CHANGED
|
@@ -77,16 +77,22 @@ export const table = ({
|
|
|
77
77
|
|
|
78
78
|
case processState.LINE_BREAK:
|
|
79
79
|
{
|
|
80
|
+
//ADFEXP-156 (Prevent table from closing on multiple line breaks and relying on | for closing of table)
|
|
80
81
|
// If we encounter an empty line, we should end the table
|
|
81
|
-
const emptyLineMatch = substring.match(EMPTY_LINE_REGEXP);
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
82
|
+
// const emptyLineMatch = substring.match(EMPTY_LINE_REGEXP);
|
|
83
|
+
// if (emptyLineMatch) {
|
|
84
|
+
// bufferToCells(
|
|
85
|
+
// cellStyle,
|
|
86
|
+
// buffer.join(''),
|
|
87
|
+
// cellsBuffer,
|
|
88
|
+
// schema,
|
|
89
|
+
// ignoreTokenTypes,
|
|
90
|
+
// context,
|
|
91
|
+
// );
|
|
92
|
+
// currentState = processState.END_TABLE;
|
|
93
|
+
// continue;
|
|
94
|
+
// }
|
|
95
|
+
// If we enconter a new row
|
|
90
96
|
const cellMatch = substring.match(CELL_REGEXP);
|
|
91
97
|
|
|
92
98
|
if (cellMatch) {
|
|
@@ -346,7 +352,7 @@ function createTableHeader(pmNode, schema) {
|
|
|
346
352
|
|
|
347
353
|
if (pmNode.type.name === 'text' && !hasAnyOfMarks(pmNode, ['strong', 'code'])) {
|
|
348
354
|
return pmNode.mark([...pmNode.marks, mark]);
|
|
349
|
-
} else if (pmNode.childCount > 0 && pmNode.firstChild && pmNode.child(0)) {
|
|
355
|
+
} else if (pmNode.childCount > 0 && pmNode.firstChild && pmNode.child(0) && pmNode.type.name !== 'codeBlock') {
|
|
350
356
|
const jsonNode = traverseJsonNodeAndAddMarks(pmNode.toJSON(), 'strong', schema);
|
|
351
357
|
pmNode = PMNode.fromJSON(schema, jsonNode);
|
|
352
358
|
return pmNode;
|
package/dist/es2019/version.json
CHANGED
|
@@ -78,16 +78,22 @@ export var table = function table(_ref) {
|
|
|
78
78
|
|
|
79
79
|
case processState.LINE_BREAK:
|
|
80
80
|
{
|
|
81
|
+
//ADFEXP-156 (Prevent table from closing on multiple line breaks and relying on | for closing of table)
|
|
81
82
|
// If we encounter an empty line, we should end the table
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
83
|
+
// const emptyLineMatch = substring.match(EMPTY_LINE_REGEXP);
|
|
84
|
+
// if (emptyLineMatch) {
|
|
85
|
+
// bufferToCells(
|
|
86
|
+
// cellStyle,
|
|
87
|
+
// buffer.join(''),
|
|
88
|
+
// cellsBuffer,
|
|
89
|
+
// schema,
|
|
90
|
+
// ignoreTokenTypes,
|
|
91
|
+
// context,
|
|
92
|
+
// );
|
|
93
|
+
// currentState = processState.END_TABLE;
|
|
94
|
+
// continue;
|
|
95
|
+
// }
|
|
96
|
+
// If we enconter a new row
|
|
91
97
|
var cellMatch = substring.match(CELL_REGEXP);
|
|
92
98
|
|
|
93
99
|
if (cellMatch) {
|
|
@@ -350,7 +356,7 @@ function createTableHeader(pmNode, schema) {
|
|
|
350
356
|
|
|
351
357
|
if (pmNode.type.name === 'text' && !hasAnyOfMarks(pmNode, ['strong', 'code'])) {
|
|
352
358
|
return pmNode.mark([].concat(_toConsumableArray(pmNode.marks), [mark]));
|
|
353
|
-
} else if (pmNode.childCount > 0 && pmNode.firstChild && pmNode.child(0)) {
|
|
359
|
+
} else if (pmNode.childCount > 0 && pmNode.firstChild && pmNode.child(0) && pmNode.type.name !== 'codeBlock') {
|
|
354
360
|
var jsonNode = traverseJsonNodeAndAddMarks(pmNode.toJSON(), 'strong', schema);
|
|
355
361
|
pmNode = PMNode.fromJSON(schema, jsonNode);
|
|
356
362
|
return pmNode;
|
package/dist/esm/version.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-wikimarkup-transformer",
|
|
3
|
-
"version": "11.1.
|
|
3
|
+
"version": "11.1.10",
|
|
4
4
|
"description": "Wiki markup transformer for JIRA and Confluence",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -12,13 +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.0 <4.5": {
|
|
17
|
-
"*": [
|
|
18
|
-
"dist/types-ts4.0/*"
|
|
19
|
-
]
|
|
20
|
-
}
|
|
21
|
-
},
|
|
22
15
|
"sideEffects": false,
|
|
23
16
|
"atlaskit:src": "src/index.ts",
|
|
24
17
|
"atlassian": {
|
|
@@ -40,13 +33,13 @@
|
|
|
40
33
|
"devDependencies": {
|
|
41
34
|
"@atlaskit/activity": "^1.0.1",
|
|
42
35
|
"@atlaskit/docs": "*",
|
|
43
|
-
"@atlaskit/editor-common": "^70.
|
|
44
|
-
"@atlaskit/editor-core": "^
|
|
36
|
+
"@atlaskit/editor-common": "^70.3.0",
|
|
37
|
+
"@atlaskit/editor-core": "^175.0.0",
|
|
45
38
|
"@atlaskit/editor-test-helpers": "^17.2.0",
|
|
46
39
|
"@atlaskit/mention": "^21.0.0",
|
|
47
40
|
"@atlaskit/profilecard": "^17.2.0",
|
|
48
|
-
"@atlaskit/renderer": "^
|
|
49
|
-
"@atlaskit/util-data-test": "^17.
|
|
41
|
+
"@atlaskit/renderer": "^103.0.0",
|
|
42
|
+
"@atlaskit/util-data-test": "^17.6.0",
|
|
50
43
|
"@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
|
|
51
44
|
"@emotion/react": "^11.7.1",
|
|
52
45
|
"@types/prosemirror-model": "^1.11.0",
|
package/report.api.md
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const EM_DASH = "\u2014";
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { Node as PMNode } from 'prosemirror-model';
|
|
2
|
-
import { Context } from '../interfaces';
|
|
3
|
-
export declare type MarkEncoder = (text: string, attrs: any) => string;
|
|
4
|
-
export declare type NodeEncoder = (node: PMNode, opts?: NodeEncoderOpts) => string;
|
|
5
|
-
export declare type NodeEncoderOpts = {
|
|
6
|
-
parent?: PMNode;
|
|
7
|
-
context?: Context;
|
|
8
|
-
};
|
|
9
|
-
export declare function encode(node: PMNode, context?: Context): string;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { Node as PMNode, Schema } from 'prosemirror-model';
|
|
2
|
-
import { 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 { Node as PMNode } from 'prosemirror-model';
|
|
2
|
-
export interface AddArgs {
|
|
3
|
-
style: string | null;
|
|
4
|
-
content: PMNode[];
|
|
5
|
-
}
|
|
6
|
-
export interface Builder {
|
|
7
|
-
type: string;
|
|
8
|
-
/**
|
|
9
|
-
* Add a item to the builder
|
|
10
|
-
* @param {AddCellArgs[]} items
|
|
11
|
-
*/
|
|
12
|
-
add(items: AddArgs[]): void;
|
|
13
|
-
/**
|
|
14
|
-
* Compile a prosemirror node from the root list
|
|
15
|
-
* @returns {PMNode}
|
|
16
|
-
*/
|
|
17
|
-
buildPMNode(): PMNode;
|
|
18
|
-
}
|
|
19
|
-
export interface ListItem {
|
|
20
|
-
content?: any[];
|
|
21
|
-
parent: List;
|
|
22
|
-
children: List[];
|
|
23
|
-
}
|
|
24
|
-
export interface List {
|
|
25
|
-
children: ListItem[];
|
|
26
|
-
type: ListType;
|
|
27
|
-
parent?: ListItem;
|
|
28
|
-
}
|
|
29
|
-
export declare type ListType = 'bulletList' | 'orderedList';
|
|
30
|
-
export declare type CellType = 'tableHeader' | 'tableCell';
|
|
31
|
-
export interface TableCell {
|
|
32
|
-
type: CellType;
|
|
33
|
-
content: PMNode[];
|
|
34
|
-
}
|
|
35
|
-
export interface TableRow {
|
|
36
|
-
cells: TableCell[];
|
|
37
|
-
}
|
|
38
|
-
export interface Table {
|
|
39
|
-
rows: TableRow[];
|
|
40
|
-
}
|
|
41
|
-
export interface AddCellArgs extends AddArgs {
|
|
42
|
-
style: string;
|
|
43
|
-
content: PMNode[];
|
|
44
|
-
}
|
|
45
|
-
export interface ConversionMap {
|
|
46
|
-
[key: string]: string;
|
|
47
|
-
}
|
|
48
|
-
export interface MediaConversionMap {
|
|
49
|
-
[key: string]: {
|
|
50
|
-
transform?: string;
|
|
51
|
-
embed?: boolean;
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
export declare type TokenErrCallback = (err: Error, tokenType: string) => void;
|
|
55
|
-
export interface Context {
|
|
56
|
-
readonly issueKeyRegex?: RegExp | undefined;
|
|
57
|
-
readonly tokenErrCallback?: TokenErrCallback;
|
|
58
|
-
readonly conversion?: {
|
|
59
|
-
readonly inlineCardConversion?: ConversionMap;
|
|
60
|
-
readonly mediaConversion?: MediaConversionMap;
|
|
61
|
-
mentionConversion?: ConversionMap;
|
|
62
|
-
};
|
|
63
|
-
readonly hydration?: {
|
|
64
|
-
readonly media?: {
|
|
65
|
-
targetCollectionId?: string;
|
|
66
|
-
};
|
|
67
|
-
};
|
|
68
|
-
readonly defaults?: {
|
|
69
|
-
readonly media?: {
|
|
70
|
-
width: number | null;
|
|
71
|
-
height: number | null;
|
|
72
|
-
};
|
|
73
|
-
};
|
|
74
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { Node as PMNode, Schema } from 'prosemirror-model';
|
|
2
|
-
import { 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 { Node as PMNode, Schema } from 'prosemirror-model';
|
|
2
|
-
import { 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 { Node as PMNode, Schema } from 'prosemirror-model';
|
|
2
|
-
import { 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;
|