@atlaskit/editor-wikimarkup-transformer 11.16.0 → 11.16.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.
- package/CHANGELOG.md +8 -0
- package/dist/cjs/parser/tokenize/links/link-resolver.js +1 -1
- package/dist/es2019/parser/tokenize/links/link-resolver.js +1 -1
- package/dist/esm/parser/tokenize/links/link-resolver.js +1 -1
- package/dist/types/encoder/index.d.ts +1 -1
- package/dist/types/interfaces.d.ts +14 -14
- package/dist/types/parser/text.d.ts +3 -3
- package/dist/types/parser/tokenize/common-formatter.d.ts +1 -1
- package/dist/types/parser/tokenize/common-macro.d.ts +1 -1
- package/dist/types/parser/tokenize/index.d.ts +5 -5
- package/dist/types/parser/tokenize/keyword.d.ts +1 -1
- package/dist/types/parser/tokenize/links/link-parser.d.ts +6 -6
- package/dist/types/parser/utils/color-name-mapping.d.ts +2 -2
- package/dist/types-ts4.5/encoder/index.d.ts +1 -1
- package/dist/types-ts4.5/interfaces.d.ts +14 -14
- package/dist/types-ts4.5/parser/text.d.ts +3 -3
- package/dist/types-ts4.5/parser/tokenize/common-formatter.d.ts +1 -1
- package/dist/types-ts4.5/parser/tokenize/common-macro.d.ts +1 -1
- package/dist/types-ts4.5/parser/tokenize/index.d.ts +5 -5
- package/dist/types-ts4.5/parser/tokenize/keyword.d.ts +1 -1
- package/dist/types-ts4.5/parser/tokenize/links/link-parser.d.ts +6 -6
- package/dist/types-ts4.5/parser/utils/color-name-mapping.d.ts +2 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @atlaskit/editor-wikimarkup-transformer
|
|
2
2
|
|
|
3
|
+
## 11.16.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`0fdcb6f2f96fd`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/0fdcb6f2f96fd) -
|
|
8
|
+
Sorted type and interface props to improve Atlaskit docs
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
3
11
|
## 11.16.0
|
|
4
12
|
|
|
5
13
|
### Minor Changes
|
|
@@ -18,7 +18,7 @@ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length)
|
|
|
18
18
|
*
|
|
19
19
|
* @param context The render context
|
|
20
20
|
* @param parsedLink The parsed link information
|
|
21
|
-
* @
|
|
21
|
+
* @returns the corresponding link. If no link can be created, null is returned
|
|
22
22
|
*/
|
|
23
23
|
|
|
24
24
|
// jira-components/jira-core/src/main/resources/system-contentlinkresolvers-plugin.xml
|
|
@@ -10,7 +10,7 @@ import { issueLinkResolver } from './issue-link';
|
|
|
10
10
|
*
|
|
11
11
|
* @param context The render context
|
|
12
12
|
* @param parsedLink The parsed link information
|
|
13
|
-
* @
|
|
13
|
+
* @returns the corresponding link. If no link can be created, null is returned
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
16
|
// jira-components/jira-core/src/main/resources/system-contentlinkresolvers-plugin.xml
|
|
@@ -13,7 +13,7 @@ import { issueLinkResolver } from './issue-link';
|
|
|
13
13
|
*
|
|
14
14
|
* @param context The render context
|
|
15
15
|
* @param parsedLink The parsed link information
|
|
16
|
-
* @
|
|
16
|
+
* @returns the corresponding link. If no link can be created, null is returned
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
19
|
// jira-components/jira-core/src/main/resources/system-contentlinkresolvers-plugin.xml
|
|
@@ -3,7 +3,7 @@ import { type Context } from '../interfaces';
|
|
|
3
3
|
export type MarkEncoder = (text: string, attrs: any) => string;
|
|
4
4
|
export type NodeEncoder = (node: PMNode, opts?: NodeEncoderOpts) => string;
|
|
5
5
|
export type NodeEncoderOpts = {
|
|
6
|
-
parent?: PMNode;
|
|
7
6
|
context?: Context;
|
|
7
|
+
parent?: PMNode;
|
|
8
8
|
};
|
|
9
9
|
export declare function encode(node: PMNode, context?: Context): string;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { type Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
2
2
|
export interface AddArgs {
|
|
3
|
-
style: string | null;
|
|
4
3
|
content: PMNode[];
|
|
4
|
+
style: string | null;
|
|
5
5
|
}
|
|
6
6
|
export interface Builder {
|
|
7
|
-
type: string;
|
|
8
7
|
/**
|
|
9
8
|
* Add a item to the builder
|
|
10
9
|
* @param {AddCellArgs[]} items
|
|
@@ -15,22 +14,23 @@ export interface Builder {
|
|
|
15
14
|
* @returns {PMNode}
|
|
16
15
|
*/
|
|
17
16
|
buildPMNode: () => PMNode;
|
|
17
|
+
type: string;
|
|
18
18
|
}
|
|
19
19
|
export interface ListItem {
|
|
20
|
+
children: List[];
|
|
20
21
|
content?: any[];
|
|
21
22
|
parent: List;
|
|
22
|
-
children: List[];
|
|
23
23
|
}
|
|
24
24
|
export interface List {
|
|
25
25
|
children: ListItem[];
|
|
26
|
-
type: ListType;
|
|
27
26
|
parent?: ListItem;
|
|
27
|
+
type: ListType;
|
|
28
28
|
}
|
|
29
29
|
export type ListType = 'bulletList' | 'orderedList';
|
|
30
30
|
export type CellType = 'tableHeader' | 'tableCell';
|
|
31
31
|
export interface TableCell {
|
|
32
|
-
type: CellType;
|
|
33
32
|
content: PMNode[];
|
|
33
|
+
type: CellType;
|
|
34
34
|
}
|
|
35
35
|
export interface TableRow {
|
|
36
36
|
cells: TableCell[];
|
|
@@ -39,36 +39,36 @@ export interface Table {
|
|
|
39
39
|
rows: TableRow[];
|
|
40
40
|
}
|
|
41
41
|
export interface AddCellArgs extends AddArgs {
|
|
42
|
-
style: string;
|
|
43
42
|
content: PMNode[];
|
|
43
|
+
style: string;
|
|
44
44
|
}
|
|
45
45
|
export interface ConversionMap {
|
|
46
46
|
[key: string]: string;
|
|
47
47
|
}
|
|
48
48
|
export interface MediaConversionMap {
|
|
49
49
|
[key: string]: {
|
|
50
|
-
transform?: string;
|
|
51
50
|
embed?: boolean;
|
|
51
|
+
transform?: string;
|
|
52
52
|
};
|
|
53
53
|
}
|
|
54
54
|
export type TokenErrCallback = (err: Error, tokenType: string) => void;
|
|
55
55
|
export interface Context {
|
|
56
|
-
readonly issueKeyRegex?: RegExp | undefined;
|
|
57
|
-
readonly tokenErrCallback?: TokenErrCallback;
|
|
58
56
|
readonly conversion?: {
|
|
59
57
|
readonly inlineCardConversion?: ConversionMap;
|
|
60
58
|
readonly mediaConversion?: MediaConversionMap;
|
|
61
59
|
mentionConversion?: ConversionMap;
|
|
62
60
|
};
|
|
63
|
-
readonly
|
|
61
|
+
readonly defaults?: {
|
|
64
62
|
readonly media?: {
|
|
65
|
-
|
|
63
|
+
height: number | null;
|
|
64
|
+
width: number | null;
|
|
66
65
|
};
|
|
67
66
|
};
|
|
68
|
-
readonly
|
|
67
|
+
readonly hydration?: {
|
|
69
68
|
readonly media?: {
|
|
70
|
-
|
|
71
|
-
height: number | null;
|
|
69
|
+
targetCollectionId?: string;
|
|
72
70
|
};
|
|
73
71
|
};
|
|
72
|
+
readonly issueKeyRegex?: RegExp | undefined;
|
|
73
|
+
readonly tokenErrCallback?: TokenErrCallback;
|
|
74
74
|
}
|
|
@@ -2,9 +2,9 @@ import { type Node as PMNode, type Schema } from '@atlaskit/editor-prosemirror/m
|
|
|
2
2
|
import { TokenType } from './tokenize';
|
|
3
3
|
import { type Context } from '../interfaces';
|
|
4
4
|
export declare function parseString({ input, schema, ignoreTokenTypes, context, includeLeadingSpace, }: {
|
|
5
|
-
input: string;
|
|
6
|
-
schema: Schema;
|
|
7
|
-
ignoreTokenTypes: TokenType[];
|
|
8
5
|
context: Context;
|
|
6
|
+
ignoreTokenTypes: TokenType[];
|
|
9
7
|
includeLeadingSpace?: boolean;
|
|
8
|
+
input: string;
|
|
9
|
+
schema: Schema;
|
|
10
10
|
}): PMNode[];
|
|
@@ -2,9 +2,9 @@ import type { Schema } from '@atlaskit/editor-prosemirror/model';
|
|
|
2
2
|
import type { Token } from './';
|
|
3
3
|
import type { Context } from '../../interfaces';
|
|
4
4
|
export interface FormatterOption {
|
|
5
|
+
closing: string;
|
|
5
6
|
context: Context;
|
|
6
7
|
opening: string;
|
|
7
|
-
closing: string;
|
|
8
8
|
rawContentProcessor: (raw: string, length: number) => Token;
|
|
9
9
|
}
|
|
10
10
|
export declare function commonFormatter(input: string, position: number, schema: Schema, opt: FormatterOption): Token;
|
|
@@ -2,9 +2,9 @@ import { type Schema } from '@atlaskit/editor-prosemirror/model';
|
|
|
2
2
|
import { type Token } from './';
|
|
3
3
|
import { type Context } from '../../interfaces';
|
|
4
4
|
export interface MacroOption {
|
|
5
|
+
context: Context;
|
|
5
6
|
keyword: string;
|
|
6
7
|
paired: boolean;
|
|
7
|
-
context: Context;
|
|
8
8
|
rawContentProcessor: (rawAttrs: string, rawContent: string, length: number, schema: Schema, context: Context) => Token;
|
|
9
9
|
}
|
|
10
10
|
export declare function commonMacro(input: string, schema: Schema, opt: MacroOption): Token;
|
|
@@ -35,21 +35,21 @@ export declare enum TokenType {
|
|
|
35
35
|
FORCE_LINE_BREAK = "FORCE_LINE_BREAK"
|
|
36
36
|
}
|
|
37
37
|
export interface TextToken {
|
|
38
|
-
readonly type: 'text';
|
|
39
|
-
readonly text: string;
|
|
40
38
|
readonly length: number;
|
|
39
|
+
readonly text: string;
|
|
40
|
+
readonly type: 'text';
|
|
41
41
|
}
|
|
42
42
|
export interface PMNodeToken {
|
|
43
|
-
readonly type: 'pmnode';
|
|
44
|
-
readonly nodes: PMNode[];
|
|
45
43
|
readonly length: number;
|
|
44
|
+
readonly nodes: PMNode[];
|
|
45
|
+
readonly type: 'pmnode';
|
|
46
46
|
}
|
|
47
47
|
export type TokenErrCallback = (err: Error, tokenType: string) => void;
|
|
48
48
|
export type Token = TextToken | PMNodeToken;
|
|
49
49
|
export type TokenParser = ({ input, position, schema, context, }: {
|
|
50
|
+
context: Context;
|
|
50
51
|
input: string;
|
|
51
52
|
position: number;
|
|
52
53
|
schema: Schema;
|
|
53
|
-
context: Context;
|
|
54
54
|
}) => Token;
|
|
55
55
|
export declare function parseToken(input: string, type: TokenType, position: number, schema: Schema, context: Context): Token;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
export interface Link {
|
|
2
|
-
readonly originalLinkText: string;
|
|
3
2
|
readonly linkBody: string | null;
|
|
4
|
-
readonly notLinkBody: string;
|
|
5
3
|
readonly linkTitle: string | null;
|
|
4
|
+
readonly notLinkBody: string;
|
|
5
|
+
readonly originalLinkText: string;
|
|
6
6
|
}
|
|
7
7
|
export declare function parseLink(linkText: string): Link;
|
|
8
8
|
export interface ContentLink extends Link {
|
|
9
|
-
readonly spaceKey: string | null;
|
|
10
|
-
readonly destinationTitle: string;
|
|
11
9
|
readonly anchor: string | null;
|
|
12
|
-
readonly shortcutName: string | null;
|
|
13
|
-
readonly shortcutValue: string | null;
|
|
14
10
|
readonly attachmentName: string | null;
|
|
15
11
|
readonly contentId: number;
|
|
12
|
+
readonly destinationTitle: string;
|
|
13
|
+
readonly shortcutName: string | null;
|
|
14
|
+
readonly shortcutValue: string | null;
|
|
15
|
+
readonly spaceKey: string | null;
|
|
16
16
|
}
|
|
17
17
|
export declare function parseContentLink(link: Link | string): ContentLink;
|
|
@@ -3,7 +3,7 @@ import { type Context } from '../interfaces';
|
|
|
3
3
|
export type MarkEncoder = (text: string, attrs: any) => string;
|
|
4
4
|
export type NodeEncoder = (node: PMNode, opts?: NodeEncoderOpts) => string;
|
|
5
5
|
export type NodeEncoderOpts = {
|
|
6
|
-
parent?: PMNode;
|
|
7
6
|
context?: Context;
|
|
7
|
+
parent?: PMNode;
|
|
8
8
|
};
|
|
9
9
|
export declare function encode(node: PMNode, context?: Context): string;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { type Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
2
2
|
export interface AddArgs {
|
|
3
|
-
style: string | null;
|
|
4
3
|
content: PMNode[];
|
|
4
|
+
style: string | null;
|
|
5
5
|
}
|
|
6
6
|
export interface Builder {
|
|
7
|
-
type: string;
|
|
8
7
|
/**
|
|
9
8
|
* Add a item to the builder
|
|
10
9
|
* @param {AddCellArgs[]} items
|
|
@@ -15,22 +14,23 @@ export interface Builder {
|
|
|
15
14
|
* @returns {PMNode}
|
|
16
15
|
*/
|
|
17
16
|
buildPMNode: () => PMNode;
|
|
17
|
+
type: string;
|
|
18
18
|
}
|
|
19
19
|
export interface ListItem {
|
|
20
|
+
children: List[];
|
|
20
21
|
content?: any[];
|
|
21
22
|
parent: List;
|
|
22
|
-
children: List[];
|
|
23
23
|
}
|
|
24
24
|
export interface List {
|
|
25
25
|
children: ListItem[];
|
|
26
|
-
type: ListType;
|
|
27
26
|
parent?: ListItem;
|
|
27
|
+
type: ListType;
|
|
28
28
|
}
|
|
29
29
|
export type ListType = 'bulletList' | 'orderedList';
|
|
30
30
|
export type CellType = 'tableHeader' | 'tableCell';
|
|
31
31
|
export interface TableCell {
|
|
32
|
-
type: CellType;
|
|
33
32
|
content: PMNode[];
|
|
33
|
+
type: CellType;
|
|
34
34
|
}
|
|
35
35
|
export interface TableRow {
|
|
36
36
|
cells: TableCell[];
|
|
@@ -39,36 +39,36 @@ export interface Table {
|
|
|
39
39
|
rows: TableRow[];
|
|
40
40
|
}
|
|
41
41
|
export interface AddCellArgs extends AddArgs {
|
|
42
|
-
style: string;
|
|
43
42
|
content: PMNode[];
|
|
43
|
+
style: string;
|
|
44
44
|
}
|
|
45
45
|
export interface ConversionMap {
|
|
46
46
|
[key: string]: string;
|
|
47
47
|
}
|
|
48
48
|
export interface MediaConversionMap {
|
|
49
49
|
[key: string]: {
|
|
50
|
-
transform?: string;
|
|
51
50
|
embed?: boolean;
|
|
51
|
+
transform?: string;
|
|
52
52
|
};
|
|
53
53
|
}
|
|
54
54
|
export type TokenErrCallback = (err: Error, tokenType: string) => void;
|
|
55
55
|
export interface Context {
|
|
56
|
-
readonly issueKeyRegex?: RegExp | undefined;
|
|
57
|
-
readonly tokenErrCallback?: TokenErrCallback;
|
|
58
56
|
readonly conversion?: {
|
|
59
57
|
readonly inlineCardConversion?: ConversionMap;
|
|
60
58
|
readonly mediaConversion?: MediaConversionMap;
|
|
61
59
|
mentionConversion?: ConversionMap;
|
|
62
60
|
};
|
|
63
|
-
readonly
|
|
61
|
+
readonly defaults?: {
|
|
64
62
|
readonly media?: {
|
|
65
|
-
|
|
63
|
+
height: number | null;
|
|
64
|
+
width: number | null;
|
|
66
65
|
};
|
|
67
66
|
};
|
|
68
|
-
readonly
|
|
67
|
+
readonly hydration?: {
|
|
69
68
|
readonly media?: {
|
|
70
|
-
|
|
71
|
-
height: number | null;
|
|
69
|
+
targetCollectionId?: string;
|
|
72
70
|
};
|
|
73
71
|
};
|
|
72
|
+
readonly issueKeyRegex?: RegExp | undefined;
|
|
73
|
+
readonly tokenErrCallback?: TokenErrCallback;
|
|
74
74
|
}
|
|
@@ -2,9 +2,9 @@ import { type Node as PMNode, type Schema } from '@atlaskit/editor-prosemirror/m
|
|
|
2
2
|
import { TokenType } from './tokenize';
|
|
3
3
|
import { type Context } from '../interfaces';
|
|
4
4
|
export declare function parseString({ input, schema, ignoreTokenTypes, context, includeLeadingSpace, }: {
|
|
5
|
-
input: string;
|
|
6
|
-
schema: Schema;
|
|
7
|
-
ignoreTokenTypes: TokenType[];
|
|
8
5
|
context: Context;
|
|
6
|
+
ignoreTokenTypes: TokenType[];
|
|
9
7
|
includeLeadingSpace?: boolean;
|
|
8
|
+
input: string;
|
|
9
|
+
schema: Schema;
|
|
10
10
|
}): PMNode[];
|
|
@@ -2,9 +2,9 @@ import type { Schema } from '@atlaskit/editor-prosemirror/model';
|
|
|
2
2
|
import type { Token } from './';
|
|
3
3
|
import type { Context } from '../../interfaces';
|
|
4
4
|
export interface FormatterOption {
|
|
5
|
+
closing: string;
|
|
5
6
|
context: Context;
|
|
6
7
|
opening: string;
|
|
7
|
-
closing: string;
|
|
8
8
|
rawContentProcessor: (raw: string, length: number) => Token;
|
|
9
9
|
}
|
|
10
10
|
export declare function commonFormatter(input: string, position: number, schema: Schema, opt: FormatterOption): Token;
|
|
@@ -2,9 +2,9 @@ import { type Schema } from '@atlaskit/editor-prosemirror/model';
|
|
|
2
2
|
import { type Token } from './';
|
|
3
3
|
import { type Context } from '../../interfaces';
|
|
4
4
|
export interface MacroOption {
|
|
5
|
+
context: Context;
|
|
5
6
|
keyword: string;
|
|
6
7
|
paired: boolean;
|
|
7
|
-
context: Context;
|
|
8
8
|
rawContentProcessor: (rawAttrs: string, rawContent: string, length: number, schema: Schema, context: Context) => Token;
|
|
9
9
|
}
|
|
10
10
|
export declare function commonMacro(input: string, schema: Schema, opt: MacroOption): Token;
|
|
@@ -35,21 +35,21 @@ export declare enum TokenType {
|
|
|
35
35
|
FORCE_LINE_BREAK = "FORCE_LINE_BREAK"
|
|
36
36
|
}
|
|
37
37
|
export interface TextToken {
|
|
38
|
-
readonly type: 'text';
|
|
39
|
-
readonly text: string;
|
|
40
38
|
readonly length: number;
|
|
39
|
+
readonly text: string;
|
|
40
|
+
readonly type: 'text';
|
|
41
41
|
}
|
|
42
42
|
export interface PMNodeToken {
|
|
43
|
-
readonly type: 'pmnode';
|
|
44
|
-
readonly nodes: PMNode[];
|
|
45
43
|
readonly length: number;
|
|
44
|
+
readonly nodes: PMNode[];
|
|
45
|
+
readonly type: 'pmnode';
|
|
46
46
|
}
|
|
47
47
|
export type TokenErrCallback = (err: Error, tokenType: string) => void;
|
|
48
48
|
export type Token = TextToken | PMNodeToken;
|
|
49
49
|
export type TokenParser = ({ input, position, schema, context, }: {
|
|
50
|
+
context: Context;
|
|
50
51
|
input: string;
|
|
51
52
|
position: number;
|
|
52
53
|
schema: Schema;
|
|
53
|
-
context: Context;
|
|
54
54
|
}) => Token;
|
|
55
55
|
export declare function parseToken(input: string, type: TokenType, position: number, schema: Schema, context: Context): Token;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
export interface Link {
|
|
2
|
-
readonly originalLinkText: string;
|
|
3
2
|
readonly linkBody: string | null;
|
|
4
|
-
readonly notLinkBody: string;
|
|
5
3
|
readonly linkTitle: string | null;
|
|
4
|
+
readonly notLinkBody: string;
|
|
5
|
+
readonly originalLinkText: string;
|
|
6
6
|
}
|
|
7
7
|
export declare function parseLink(linkText: string): Link;
|
|
8
8
|
export interface ContentLink extends Link {
|
|
9
|
-
readonly spaceKey: string | null;
|
|
10
|
-
readonly destinationTitle: string;
|
|
11
9
|
readonly anchor: string | null;
|
|
12
|
-
readonly shortcutName: string | null;
|
|
13
|
-
readonly shortcutValue: string | null;
|
|
14
10
|
readonly attachmentName: string | null;
|
|
15
11
|
readonly contentId: number;
|
|
12
|
+
readonly destinationTitle: string;
|
|
13
|
+
readonly shortcutName: string | null;
|
|
14
|
+
readonly shortcutValue: string | null;
|
|
15
|
+
readonly spaceKey: string | null;
|
|
16
16
|
}
|
|
17
17
|
export declare function parseContentLink(link: Link | string): ContentLink;
|