@atlaskit/editor-wikimarkup-transformer 11.20.16 → 12.0.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.
Files changed (142) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/char/package.json +1 -8
  3. package/dist/cjs/encoder/marks/__base.js +12 -8
  4. package/dist/cjs/parser/builder/list-builder.js +5 -3
  5. package/dist/cjs/parser/builder/table-builder.js +5 -3
  6. package/dist/cjs/parser/nodes/mediaSingle.js +5 -6
  7. package/dist/cjs/parser/tokenize/common-formatter.js +5 -8
  8. package/dist/cjs/parser/tokenize/dash-token-creator.js +5 -3
  9. package/dist/cjs/parser/tokenize/issue-key.js +2 -1
  10. package/dist/cjs/parser/tokenize/link-text.js +5 -7
  11. package/dist/cjs/parser/tokenize/links/url-link.js +4 -3
  12. package/dist/cjs/parser/utils/text.js +5 -3
  13. package/dist/es2019/encoder/marks/__base.js +12 -8
  14. package/dist/es2019/parser/builder/list-builder.js +5 -3
  15. package/dist/es2019/parser/builder/table-builder.js +5 -3
  16. package/dist/es2019/parser/nodes/mediaSingle.js +5 -6
  17. package/dist/es2019/parser/tokenize/common-formatter.js +6 -8
  18. package/dist/es2019/parser/tokenize/dash-token-creator.js +5 -3
  19. package/dist/es2019/parser/tokenize/issue-key.js +2 -1
  20. package/dist/es2019/parser/tokenize/link-text.js +5 -7
  21. package/dist/es2019/parser/tokenize/links/url-link.js +4 -3
  22. package/dist/es2019/parser/utils/text.js +5 -3
  23. package/dist/esm/encoder/marks/__base.js +12 -8
  24. package/dist/esm/parser/builder/list-builder.js +5 -3
  25. package/dist/esm/parser/builder/table-builder.js +5 -3
  26. package/dist/esm/parser/nodes/mediaSingle.js +5 -6
  27. package/dist/esm/parser/tokenize/common-formatter.js +6 -8
  28. package/dist/esm/parser/tokenize/dash-token-creator.js +5 -3
  29. package/dist/esm/parser/tokenize/issue-key.js +2 -1
  30. package/dist/esm/parser/tokenize/link-text.js +5 -7
  31. package/dist/esm/parser/tokenize/links/url-link.js +4 -3
  32. package/dist/esm/parser/utils/text.js +5 -3
  33. package/interfaces/package.json +1 -8
  34. package/package.json +8 -16
  35. package/dist/types-ts4.5/char.d.ts +0 -1
  36. package/dist/types-ts4.5/encoder/emoji-unicode-mapping.d.ts +0 -3
  37. package/dist/types-ts4.5/encoder/index.d.ts +0 -9
  38. package/dist/types-ts4.5/encoder/marks/__base.d.ts +0 -5
  39. package/dist/types-ts4.5/encoder/marks/code.d.ts +0 -2
  40. package/dist/types-ts4.5/encoder/marks/color.d.ts +0 -2
  41. package/dist/types-ts4.5/encoder/marks/em.d.ts +0 -2
  42. package/dist/types-ts4.5/encoder/marks/link.d.ts +0 -2
  43. package/dist/types-ts4.5/encoder/marks/strike.d.ts +0 -2
  44. package/dist/types-ts4.5/encoder/marks/strong.d.ts +0 -6
  45. package/dist/types-ts4.5/encoder/marks/subsup.d.ts +0 -2
  46. package/dist/types-ts4.5/encoder/marks/underline.d.ts +0 -2
  47. package/dist/types-ts4.5/encoder/nodes/block-card.d.ts +0 -2
  48. package/dist/types-ts4.5/encoder/nodes/blockquote.d.ts +0 -2
  49. package/dist/types-ts4.5/encoder/nodes/bodied-sync-block.d.ts +0 -2
  50. package/dist/types-ts4.5/encoder/nodes/bullet-list.d.ts +0 -2
  51. package/dist/types-ts4.5/encoder/nodes/caption.d.ts +0 -2
  52. package/dist/types-ts4.5/encoder/nodes/code-block.d.ts +0 -2
  53. package/dist/types-ts4.5/encoder/nodes/date.d.ts +0 -2
  54. package/dist/types-ts4.5/encoder/nodes/decisionItem.d.ts +0 -3
  55. package/dist/types-ts4.5/encoder/nodes/decisionList.d.ts +0 -2
  56. package/dist/types-ts4.5/encoder/nodes/doc.d.ts +0 -2
  57. package/dist/types-ts4.5/encoder/nodes/embed-card.d.ts +0 -2
  58. package/dist/types-ts4.5/encoder/nodes/emoji.d.ts +0 -2
  59. package/dist/types-ts4.5/encoder/nodes/expand.d.ts +0 -2
  60. package/dist/types-ts4.5/encoder/nodes/hard-break.d.ts +0 -2
  61. package/dist/types-ts4.5/encoder/nodes/heading.d.ts +0 -2
  62. package/dist/types-ts4.5/encoder/nodes/inline-card.d.ts +0 -2
  63. package/dist/types-ts4.5/encoder/nodes/inlines.d.ts +0 -2
  64. package/dist/types-ts4.5/encoder/nodes/listItem.d.ts +0 -3
  65. package/dist/types-ts4.5/encoder/nodes/media-group.d.ts +0 -2
  66. package/dist/types-ts4.5/encoder/nodes/media-inline.d.ts +0 -2
  67. package/dist/types-ts4.5/encoder/nodes/media.d.ts +0 -2
  68. package/dist/types-ts4.5/encoder/nodes/mention.d.ts +0 -2
  69. package/dist/types-ts4.5/encoder/nodes/ordered-list.d.ts +0 -2
  70. package/dist/types-ts4.5/encoder/nodes/panel.d.ts +0 -2
  71. package/dist/types-ts4.5/encoder/nodes/paragraph.d.ts +0 -2
  72. package/dist/types-ts4.5/encoder/nodes/rule.d.ts +0 -2
  73. package/dist/types-ts4.5/encoder/nodes/status.d.ts +0 -2
  74. package/dist/types-ts4.5/encoder/nodes/table.d.ts +0 -2
  75. package/dist/types-ts4.5/encoder/nodes/taskItem.d.ts +0 -3
  76. package/dist/types-ts4.5/encoder/nodes/taskList.d.ts +0 -2
  77. package/dist/types-ts4.5/encoder/nodes/text.d.ts +0 -2
  78. package/dist/types-ts4.5/encoder/nodes/unknown.d.ts +0 -2
  79. package/dist/types-ts4.5/index.d.ts +0 -15
  80. package/dist/types-ts4.5/interfaces.d.ts +0 -74
  81. package/dist/types-ts4.5/parser/abstract-tree.d.ts +0 -11
  82. package/dist/types-ts4.5/parser/builder/list-builder.d.ts +0 -66
  83. package/dist/types-ts4.5/parser/builder/table-builder.d.ts +0 -45
  84. package/dist/types-ts4.5/parser/color.d.ts +0 -3
  85. package/dist/types-ts4.5/parser/error.d.ts +0 -1
  86. package/dist/types-ts4.5/parser/nodes/mediaGroup.d.ts +0 -3
  87. package/dist/types-ts4.5/parser/nodes/mediaSingle.d.ts +0 -5
  88. package/dist/types-ts4.5/parser/nodes/paragraph.d.ts +0 -7
  89. package/dist/types-ts4.5/parser/nodes/rule.d.ts +0 -3
  90. package/dist/types-ts4.5/parser/nodes/text.d.ts +0 -2
  91. package/dist/types-ts4.5/parser/text.d.ts +0 -10
  92. package/dist/types-ts4.5/parser/tokenize/adf-macro.d.ts +0 -2
  93. package/dist/types-ts4.5/parser/tokenize/anchor-macro.d.ts +0 -2
  94. package/dist/types-ts4.5/parser/tokenize/blockquote.d.ts +0 -2
  95. package/dist/types-ts4.5/parser/tokenize/citation.d.ts +0 -2
  96. package/dist/types-ts4.5/parser/tokenize/code-macro.d.ts +0 -2
  97. package/dist/types-ts4.5/parser/tokenize/color-macro.d.ts +0 -2
  98. package/dist/types-ts4.5/parser/tokenize/common-formatter.d.ts +0 -10
  99. package/dist/types-ts4.5/parser/tokenize/common-macro.d.ts +0 -10
  100. package/dist/types-ts4.5/parser/tokenize/dash-token-creator.d.ts +0 -2
  101. package/dist/types-ts4.5/parser/tokenize/deleted.d.ts +0 -2
  102. package/dist/types-ts4.5/parser/tokenize/double-dash-symbol.d.ts +0 -2
  103. package/dist/types-ts4.5/parser/tokenize/emoji.d.ts +0 -15
  104. package/dist/types-ts4.5/parser/tokenize/emphasis.d.ts +0 -2
  105. package/dist/types-ts4.5/parser/tokenize/file-link.d.ts +0 -3
  106. package/dist/types-ts4.5/parser/tokenize/force-line-break.d.ts +0 -2
  107. package/dist/types-ts4.5/parser/tokenize/hardbreak.d.ts +0 -2
  108. package/dist/types-ts4.5/parser/tokenize/heading.d.ts +0 -2
  109. package/dist/types-ts4.5/parser/tokenize/index.d.ts +0 -55
  110. package/dist/types-ts4.5/parser/tokenize/inserted.d.ts +0 -2
  111. package/dist/types-ts4.5/parser/tokenize/issue-key.d.ts +0 -20
  112. package/dist/types-ts4.5/parser/tokenize/keyword.d.ts +0 -19
  113. package/dist/types-ts4.5/parser/tokenize/link-text.d.ts +0 -3
  114. package/dist/types-ts4.5/parser/tokenize/links/attachment-link.d.ts +0 -4
  115. package/dist/types-ts4.5/parser/tokenize/links/issue-link.d.ts +0 -4
  116. package/dist/types-ts4.5/parser/tokenize/links/link-format.d.ts +0 -2
  117. package/dist/types-ts4.5/parser/tokenize/links/link-parser.d.ts +0 -17
  118. package/dist/types-ts4.5/parser/tokenize/links/link-resolver.d.ts +0 -5
  119. package/dist/types-ts4.5/parser/tokenize/links/mention-link.d.ts +0 -4
  120. package/dist/types-ts4.5/parser/tokenize/links/url-link.d.ts +0 -4
  121. package/dist/types-ts4.5/parser/tokenize/list.d.ts +0 -3
  122. package/dist/types-ts4.5/parser/tokenize/media.d.ts +0 -2
  123. package/dist/types-ts4.5/parser/tokenize/monospace.d.ts +0 -2
  124. package/dist/types-ts4.5/parser/tokenize/noformat-macro.d.ts +0 -2
  125. package/dist/types-ts4.5/parser/tokenize/panel-macro.d.ts +0 -2
  126. package/dist/types-ts4.5/parser/tokenize/quadruple-dash-symbol.d.ts +0 -2
  127. package/dist/types-ts4.5/parser/tokenize/quote-macro.d.ts +0 -8
  128. package/dist/types-ts4.5/parser/tokenize/ruler.d.ts +0 -2
  129. package/dist/types-ts4.5/parser/tokenize/strong.d.ts +0 -2
  130. package/dist/types-ts4.5/parser/tokenize/subscript.d.ts +0 -2
  131. package/dist/types-ts4.5/parser/tokenize/superscript.d.ts +0 -2
  132. package/dist/types-ts4.5/parser/tokenize/table.d.ts +0 -2
  133. package/dist/types-ts4.5/parser/tokenize/triple-dash-symbol.d.ts +0 -2
  134. package/dist/types-ts4.5/parser/tokenize/whitespace.d.ts +0 -3
  135. package/dist/types-ts4.5/parser/utils/attrs.d.ts +0 -3
  136. package/dist/types-ts4.5/parser/utils/color-name-mapping.d.ts +0 -10
  137. package/dist/types-ts4.5/parser/utils/escape.d.ts +0 -2
  138. package/dist/types-ts4.5/parser/utils/normalize.d.ts +0 -5
  139. package/dist/types-ts4.5/parser/utils/panel-type.d.ts +0 -3
  140. package/dist/types-ts4.5/parser/utils/text.d.ts +0 -25
  141. package/dist/types-ts4.5/parser/utils/title.d.ts +0 -7
  142. 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
- // Ignored via go/ees005
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 !/\s|\(|\)|!|\.|\,|\/|\:/.test(char);
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
- // Ignored via go/ees005
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
- // Ignored via go/ees005
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() === '';
@@ -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": "11.20.16",
3
+ "version": "12.0.1",
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": "^54.0.0",
33
- "@atlaskit/editor-json-transformer": "^8.33.0",
34
- "@atlaskit/editor-prosemirror": "^7.3.0",
24
+ "@atlaskit/adf-schema": "^56.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": "^220.3.0",
31
+ "@atlaskit/editor-core": "^221.1.0",
40
32
  "@atlaskit/editor-test-helpers": "workspace:^",
41
- "@atlaskit/mention": "^26.2.0",
42
- "@atlaskit/tokens": "^13.3.0",
43
- "@atlaskit/util-data-test": "^18.6.0",
33
+ "@atlaskit/mention": "^27.1.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,3 +0,0 @@
1
- export declare const mapping: {
2
- [key: string]: string;
3
- };
@@ -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,5 +0,0 @@
1
- /**
2
- * For text that has leading and ending space. We don't want to
3
- * convert it to `* strong *. Instead, we need it to be ` *strong* `
4
- */
5
- export declare const baseMarkPattern: (text: string, token: string) => string;
@@ -1,2 +0,0 @@
1
- import type { MarkEncoder } from '..';
2
- export declare const code: MarkEncoder;
@@ -1,2 +0,0 @@
1
- import type { MarkEncoder } from '..';
2
- export declare const textColor: MarkEncoder;
@@ -1,2 +0,0 @@
1
- import type { MarkEncoder } from '..';
2
- export declare const em: MarkEncoder;
@@ -1,2 +0,0 @@
1
- import type { MarkEncoder } from '..';
2
- export declare const link: MarkEncoder;
@@ -1,2 +0,0 @@
1
- import type { MarkEncoder } from '..';
2
- export declare const strike: MarkEncoder;
@@ -1,6 +0,0 @@
1
- import type { MarkEncoder } from '..';
2
- /**
3
- * For text that has leading and ending space. We don't want to
4
- * convert it to `*strong *. Instead, we need it to be `*strong* `
5
- */
6
- export declare const strong: MarkEncoder;
@@ -1,2 +0,0 @@
1
- import type { MarkEncoder } from '..';
2
- export declare const subsup: MarkEncoder;
@@ -1,2 +0,0 @@
1
- import type { MarkEncoder } from '..';
2
- export declare const underline: MarkEncoder;
@@ -1,2 +0,0 @@
1
- import type { NodeEncoder } from '..';
2
- export declare const blockCard: NodeEncoder;
@@ -1,2 +0,0 @@
1
- import type { NodeEncoder } from '..';
2
- export declare const blockquote: NodeEncoder;
@@ -1,2 +0,0 @@
1
- import type { NodeEncoder } from '..';
2
- export declare const bodiedSyncBlock: NodeEncoder;
@@ -1,2 +0,0 @@
1
- import type { NodeEncoder } from '..';
2
- export declare const bulletList: NodeEncoder;
@@ -1,2 +0,0 @@
1
- import type { NodeEncoder } from '..';
2
- export declare const caption: NodeEncoder;
@@ -1,2 +0,0 @@
1
- import type { NodeEncoder } from '..';
2
- export declare const codeBlock: NodeEncoder;
@@ -1,2 +0,0 @@
1
- import type { NodeEncoder } from '..';
2
- export declare const date: NodeEncoder;
@@ -1,3 +0,0 @@
1
- import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
2
- import type { NodeEncoderOpts } from '..';
3
- export declare const decisionItem: (node: PMNode, { context }?: NodeEncoderOpts) => string;
@@ -1,2 +0,0 @@
1
- import type { NodeEncoder } from '..';
2
- export declare const decisionList: NodeEncoder;
@@ -1,2 +0,0 @@
1
- import type { NodeEncoder } from '../';
2
- export declare const doc: NodeEncoder;
@@ -1,2 +0,0 @@
1
- import type { NodeEncoder } from '..';
2
- export declare const embedCard: NodeEncoder;
@@ -1,2 +0,0 @@
1
- import type { NodeEncoder } from '..';
2
- export declare const emoji: NodeEncoder;
@@ -1,2 +0,0 @@
1
- import type { NodeEncoder } from '..';
2
- export declare const expand: NodeEncoder;
@@ -1,2 +0,0 @@
1
- import type { NodeEncoder } from '..';
2
- export declare const hardBreak: NodeEncoder;
@@ -1,2 +0,0 @@
1
- import type { NodeEncoder } from '..';
2
- export declare const heading: NodeEncoder;
@@ -1,2 +0,0 @@
1
- import type { NodeEncoder } from '..';
2
- export declare const inlineCard: NodeEncoder;
@@ -1,2 +0,0 @@
1
- import type { NodeEncoder } from '..';
2
- export declare const inlines: NodeEncoder;
@@ -1,3 +0,0 @@
1
- import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
2
- import type { Context } from '../../interfaces';
3
- export declare const listItem: (node: PMNode, prefix: string, context?: Context) => string;
@@ -1,2 +0,0 @@
1
- import type { NodeEncoder } from '..';
2
- export declare const mediaGroup: NodeEncoder;
@@ -1,2 +0,0 @@
1
- import type { NodeEncoder } from '..';
2
- export declare const mediaInline: NodeEncoder;
@@ -1,2 +0,0 @@
1
- import type { NodeEncoder } from '..';
2
- export declare const media: NodeEncoder;
@@ -1,2 +0,0 @@
1
- import type { NodeEncoder } from '..';
2
- export declare const mention: NodeEncoder;
@@ -1,2 +0,0 @@
1
- import type { NodeEncoder } from '..';
2
- export declare const orderedList: NodeEncoder;
@@ -1,2 +0,0 @@
1
- import type { NodeEncoder } from '..';
2
- export declare const panel: NodeEncoder;
@@ -1,2 +0,0 @@
1
- import type { NodeEncoder } from '..';
2
- export declare const paragraph: NodeEncoder;
@@ -1,2 +0,0 @@
1
- import type { NodeEncoder } from '..';
2
- export declare const rule: NodeEncoder;
@@ -1,2 +0,0 @@
1
- import type { NodeEncoder } from '..';
2
- export declare const status: NodeEncoder;
@@ -1,2 +0,0 @@
1
- import type { NodeEncoder } from '..';
2
- export declare const table: NodeEncoder;
@@ -1,3 +0,0 @@
1
- import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
2
- import type { NodeEncoderOpts } from '..';
3
- export declare const taskItem: (node: PMNode, nestedLevel: number, { context }?: NodeEncoderOpts) => string;
@@ -1,2 +0,0 @@
1
- import type { NodeEncoder } from '..';
2
- export declare const taskList: NodeEncoder;
@@ -1,2 +0,0 @@
1
- import type { NodeEncoder } from '..';
2
- export declare const text: NodeEncoder;
@@ -1,2 +0,0 @@
1
- import type { NodeEncoder } from '..';
2
- export declare const unknown: NodeEncoder;
@@ -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,3 +0,0 @@
1
- export declare function getEditorColor(attrs: {
2
- [key: string]: string;
3
- }): string | null;
@@ -1 +0,0 @@
1
- export declare function error(message: string, _input: string, line: number, column: number): void;
@@ -1,3 +0,0 @@
1
- import type { Node as PMNode, Schema } from '@atlaskit/editor-prosemirror/model';
2
- import type { Context } from '../../interfaces';
3
- export default function getMediaGroupNodeView(schema: Schema, filename: string, context?: Context): PMNode;
@@ -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[];
@@ -1,3 +0,0 @@
1
- import type { Node as PMNode, NodeType, Schema } from '@atlaskit/editor-prosemirror/model';
2
- export default function getRuleNodeView(schema: Schema, containerNodeType: NodeType | null): PMNode;
3
- export declare function createRuleNode(schema: Schema): PMNode[];