@atlaskit/editor-wikimarkup-transformer 11.2.0 → 11.2.2

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 (123) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/char/package.json +2 -2
  3. package/dist/cjs/parser/tokenize/link-text.js +3 -3
  4. package/dist/cjs/version.json +1 -1
  5. package/dist/es2019/parser/tokenize/link-text.js +3 -3
  6. package/dist/es2019/version.json +1 -1
  7. package/dist/esm/parser/tokenize/link-text.js +3 -3
  8. package/dist/esm/version.json +1 -1
  9. package/dist/types/encoder/index.d.ts +3 -3
  10. package/dist/types/encoder/nodes/listItem.d.ts +1 -1
  11. package/dist/types/interfaces.d.ts +3 -3
  12. package/dist/types/parser/tokenize/index.d.ts +3 -3
  13. package/dist/types/parser/tokenize/issue-key.d.ts +1 -1
  14. package/dist/types-ts4.5/char.d.ts +1 -0
  15. package/dist/types-ts4.5/encoder/emoji-unicode-mapping.d.ts +3 -0
  16. package/dist/types-ts4.5/encoder/index.d.ts +9 -0
  17. package/dist/types-ts4.5/encoder/marks/__base.d.ts +5 -0
  18. package/dist/types-ts4.5/encoder/marks/code.d.ts +2 -0
  19. package/dist/types-ts4.5/encoder/marks/color.d.ts +2 -0
  20. package/dist/types-ts4.5/encoder/marks/em.d.ts +2 -0
  21. package/dist/types-ts4.5/encoder/marks/link.d.ts +2 -0
  22. package/dist/types-ts4.5/encoder/marks/strike.d.ts +2 -0
  23. package/dist/types-ts4.5/encoder/marks/strong.d.ts +6 -0
  24. package/dist/types-ts4.5/encoder/marks/subsup.d.ts +2 -0
  25. package/dist/types-ts4.5/encoder/marks/underline.d.ts +2 -0
  26. package/dist/types-ts4.5/encoder/nodes/block-card.d.ts +2 -0
  27. package/dist/types-ts4.5/encoder/nodes/blockquote.d.ts +2 -0
  28. package/dist/types-ts4.5/encoder/nodes/bullet-list.d.ts +2 -0
  29. package/dist/types-ts4.5/encoder/nodes/caption.d.ts +2 -0
  30. package/dist/types-ts4.5/encoder/nodes/code-block.d.ts +2 -0
  31. package/dist/types-ts4.5/encoder/nodes/date.d.ts +2 -0
  32. package/dist/types-ts4.5/encoder/nodes/decisionItem.d.ts +3 -0
  33. package/dist/types-ts4.5/encoder/nodes/decisionList.d.ts +2 -0
  34. package/dist/types-ts4.5/encoder/nodes/doc.d.ts +2 -0
  35. package/dist/types-ts4.5/encoder/nodes/embed-card.d.ts +2 -0
  36. package/dist/types-ts4.5/encoder/nodes/emoji.d.ts +2 -0
  37. package/dist/types-ts4.5/encoder/nodes/expand.d.ts +2 -0
  38. package/dist/types-ts4.5/encoder/nodes/hard-break.d.ts +2 -0
  39. package/dist/types-ts4.5/encoder/nodes/heading.d.ts +2 -0
  40. package/dist/types-ts4.5/encoder/nodes/inline-card.d.ts +2 -0
  41. package/dist/types-ts4.5/encoder/nodes/inlines.d.ts +2 -0
  42. package/dist/types-ts4.5/encoder/nodes/listItem.d.ts +3 -0
  43. package/dist/types-ts4.5/encoder/nodes/media-group.d.ts +2 -0
  44. package/dist/types-ts4.5/encoder/nodes/media-inline.d.ts +2 -0
  45. package/dist/types-ts4.5/encoder/nodes/media.d.ts +2 -0
  46. package/dist/types-ts4.5/encoder/nodes/mention.d.ts +2 -0
  47. package/dist/types-ts4.5/encoder/nodes/ordered-list.d.ts +2 -0
  48. package/dist/types-ts4.5/encoder/nodes/panel.d.ts +2 -0
  49. package/dist/types-ts4.5/encoder/nodes/paragraph.d.ts +2 -0
  50. package/dist/types-ts4.5/encoder/nodes/rule.d.ts +2 -0
  51. package/dist/types-ts4.5/encoder/nodes/status.d.ts +2 -0
  52. package/dist/types-ts4.5/encoder/nodes/table.d.ts +2 -0
  53. package/dist/types-ts4.5/encoder/nodes/taskItem.d.ts +3 -0
  54. package/dist/types-ts4.5/encoder/nodes/taskList.d.ts +2 -0
  55. package/dist/types-ts4.5/encoder/nodes/text.d.ts +2 -0
  56. package/dist/types-ts4.5/encoder/nodes/unknown.d.ts +2 -0
  57. package/dist/types-ts4.5/index.d.ts +15 -0
  58. package/dist/types-ts4.5/interfaces.d.ts +74 -0
  59. package/dist/types-ts4.5/parser/abstract-tree.d.ts +11 -0
  60. package/dist/types-ts4.5/parser/builder/list-builder.d.ts +66 -0
  61. package/dist/types-ts4.5/parser/builder/table-builder.d.ts +45 -0
  62. package/dist/types-ts4.5/parser/color.d.ts +3 -0
  63. package/dist/types-ts4.5/parser/error.d.ts +1 -0
  64. package/dist/types-ts4.5/parser/nodes/mediaGroup.d.ts +3 -0
  65. package/dist/types-ts4.5/parser/nodes/mediaSingle.d.ts +5 -0
  66. package/dist/types-ts4.5/parser/nodes/paragraph.d.ts +7 -0
  67. package/dist/types-ts4.5/parser/nodes/rule.d.ts +3 -0
  68. package/dist/types-ts4.5/parser/nodes/text.d.ts +2 -0
  69. package/dist/types-ts4.5/parser/text.d.ts +10 -0
  70. package/dist/types-ts4.5/parser/tokenize/adf-macro.d.ts +2 -0
  71. package/dist/types-ts4.5/parser/tokenize/anchor-macro.d.ts +2 -0
  72. package/dist/types-ts4.5/parser/tokenize/blockquote.d.ts +2 -0
  73. package/dist/types-ts4.5/parser/tokenize/citation.d.ts +2 -0
  74. package/dist/types-ts4.5/parser/tokenize/code-macro.d.ts +2 -0
  75. package/dist/types-ts4.5/parser/tokenize/color-macro.d.ts +2 -0
  76. package/dist/types-ts4.5/parser/tokenize/common-formatter.d.ts +10 -0
  77. package/dist/types-ts4.5/parser/tokenize/common-macro.d.ts +10 -0
  78. package/dist/types-ts4.5/parser/tokenize/dash-token-creator.d.ts +2 -0
  79. package/dist/types-ts4.5/parser/tokenize/deleted.d.ts +2 -0
  80. package/dist/types-ts4.5/parser/tokenize/double-dash-symbol.d.ts +1 -0
  81. package/dist/types-ts4.5/parser/tokenize/emoji.d.ts +15 -0
  82. package/dist/types-ts4.5/parser/tokenize/emphasis.d.ts +2 -0
  83. package/dist/types-ts4.5/parser/tokenize/file-link.d.ts +3 -0
  84. package/dist/types-ts4.5/parser/tokenize/force-line-break.d.ts +2 -0
  85. package/dist/types-ts4.5/parser/tokenize/hardbreak.d.ts +2 -0
  86. package/dist/types-ts4.5/parser/tokenize/heading.d.ts +2 -0
  87. package/dist/types-ts4.5/parser/tokenize/index.d.ts +55 -0
  88. package/dist/types-ts4.5/parser/tokenize/inserted.d.ts +2 -0
  89. package/dist/types-ts4.5/parser/tokenize/issue-key.d.ts +20 -0
  90. package/dist/types-ts4.5/parser/tokenize/keyword.d.ts +19 -0
  91. package/dist/types-ts4.5/parser/tokenize/link-text.d.ts +3 -0
  92. package/dist/types-ts4.5/parser/tokenize/links/attachment-link.d.ts +4 -0
  93. package/dist/types-ts4.5/parser/tokenize/links/issue-link.d.ts +4 -0
  94. package/dist/types-ts4.5/parser/tokenize/links/link-format.d.ts +2 -0
  95. package/dist/types-ts4.5/parser/tokenize/links/link-parser.d.ts +17 -0
  96. package/dist/types-ts4.5/parser/tokenize/links/link-resolver.d.ts +5 -0
  97. package/dist/types-ts4.5/parser/tokenize/links/mention-link.d.ts +4 -0
  98. package/dist/types-ts4.5/parser/tokenize/links/url-link.d.ts +4 -0
  99. package/dist/types-ts4.5/parser/tokenize/list.d.ts +3 -0
  100. package/dist/types-ts4.5/parser/tokenize/media.d.ts +2 -0
  101. package/dist/types-ts4.5/parser/tokenize/monospace.d.ts +2 -0
  102. package/dist/types-ts4.5/parser/tokenize/noformat-macro.d.ts +2 -0
  103. package/dist/types-ts4.5/parser/tokenize/panel-macro.d.ts +2 -0
  104. package/dist/types-ts4.5/parser/tokenize/quadruple-dash-symbol.d.ts +2 -0
  105. package/dist/types-ts4.5/parser/tokenize/quote-macro.d.ts +5 -0
  106. package/dist/types-ts4.5/parser/tokenize/ruler.d.ts +2 -0
  107. package/dist/types-ts4.5/parser/tokenize/strong.d.ts +2 -0
  108. package/dist/types-ts4.5/parser/tokenize/subscript.d.ts +2 -0
  109. package/dist/types-ts4.5/parser/tokenize/superscript.d.ts +2 -0
  110. package/dist/types-ts4.5/parser/tokenize/table.d.ts +2 -0
  111. package/dist/types-ts4.5/parser/tokenize/triple-dash-symbol.d.ts +1 -0
  112. package/dist/types-ts4.5/parser/tokenize/whitespace.d.ts +3 -0
  113. package/dist/types-ts4.5/parser/utils/attrs.d.ts +3 -0
  114. package/dist/types-ts4.5/parser/utils/color-name-mapping.d.ts +10 -0
  115. package/dist/types-ts4.5/parser/utils/escape.d.ts +2 -0
  116. package/dist/types-ts4.5/parser/utils/normalize.d.ts +4 -0
  117. package/dist/types-ts4.5/parser/utils/panel-type.d.ts +3 -0
  118. package/dist/types-ts4.5/parser/utils/text.d.ts +25 -0
  119. package/dist/types-ts4.5/parser/utils/title.d.ts +7 -0
  120. package/dist/types-ts4.5/parser/utils/url.d.ts +8 -0
  121. package/interfaces/package.json +2 -2
  122. package/package.json +15 -7
  123. package/tmp/api-report-tmp.d.ts +76 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @atlaskit/editor-wikimarkup-transformer
2
2
 
3
+ ## 11.2.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [`a142ba1aa28`](https://bitbucket.org/atlassian/atlassian-frontend/commits/a142ba1aa28) - [ED17172] Bump prosemirror-model to 1.16.0 and prosemirror-view to 1.23.7 and removed work-arounds for fixed issues
8
+
9
+ ## 11.2.1
10
+
11
+ ### Patch Changes
12
+
13
+ - [`41fae2c6f68`](https://bitbucket.org/atlassian/atlassian-frontend/commits/41fae2c6f68) - Upgrade Typescript from `4.5.5` to `4.9.5`
14
+
3
15
  ## 11.2.0
4
16
 
5
17
  ### Minor Changes
package/char/package.json CHANGED
@@ -6,9 +6,9 @@
6
6
  "sideEffects": false,
7
7
  "types": "../dist/types/char.d.ts",
8
8
  "typesVersions": {
9
- ">=4.0 <4.5": {
9
+ ">=4.5 <4.9": {
10
10
  "*": [
11
- "../dist/types-ts4.0/char.d.ts"
11
+ "../dist/types-ts4.5/char.d.ts"
12
12
  ]
13
13
  }
14
14
  }
@@ -13,11 +13,11 @@ var linkText = function linkText(_ref) {
13
13
  var input = _ref.input,
14
14
  position = _ref.position,
15
15
  schema = _ref.schema;
16
- var match = input.substring(position).match(LINK_TEXT_REGEXP);
17
- if (!match) {
16
+ var matches = input.substring(position).match(LINK_TEXT_REGEXP);
17
+ if (!matches) {
18
18
  return fallback(input, position);
19
19
  }
20
- match = trimBadEndChar(match);
20
+ var match = trimBadEndChar(matches);
21
21
 
22
22
  // Remove mailto:
23
23
  var textRepresentation = match[1] === 'mailto:' ? match[2] : match[0];
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-wikimarkup-transformer",
3
- "version": "11.2.0",
3
+ "version": "11.2.2",
4
4
  "sideEffects": false
5
5
  }
@@ -7,11 +7,11 @@ export const linkText = ({
7
7
  position,
8
8
  schema
9
9
  }) => {
10
- let match = input.substring(position).match(LINK_TEXT_REGEXP);
11
- if (!match) {
10
+ let matches = input.substring(position).match(LINK_TEXT_REGEXP);
11
+ if (!matches) {
12
12
  return fallback(input, position);
13
13
  }
14
- match = trimBadEndChar(match);
14
+ const match = trimBadEndChar(matches);
15
15
 
16
16
  // Remove mailto:
17
17
  const textRepresentation = match[1] === 'mailto:' ? match[2] : match[0];
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-wikimarkup-transformer",
3
- "version": "11.2.0",
3
+ "version": "11.2.2",
4
4
  "sideEffects": false
5
5
  }
@@ -6,11 +6,11 @@ export var linkText = function linkText(_ref) {
6
6
  var input = _ref.input,
7
7
  position = _ref.position,
8
8
  schema = _ref.schema;
9
- var match = input.substring(position).match(LINK_TEXT_REGEXP);
10
- if (!match) {
9
+ var matches = input.substring(position).match(LINK_TEXT_REGEXP);
10
+ if (!matches) {
11
11
  return fallback(input, position);
12
12
  }
13
- match = trimBadEndChar(match);
13
+ var match = trimBadEndChar(matches);
14
14
 
15
15
  // Remove mailto:
16
16
  var textRepresentation = match[1] === 'mailto:' ? match[2] : match[0];
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-wikimarkup-transformer",
3
- "version": "11.2.0",
3
+ "version": "11.2.2",
4
4
  "sideEffects": false
5
5
  }
@@ -1,8 +1,8 @@
1
1
  import { Node as PMNode } from 'prosemirror-model';
2
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 = {
3
+ export type MarkEncoder = (text: string, attrs: any) => string;
4
+ export type NodeEncoder = (node: PMNode, opts?: NodeEncoderOpts) => string;
5
+ export type NodeEncoderOpts = {
6
6
  parent?: PMNode;
7
7
  context?: Context;
8
8
  };
@@ -1,3 +1,3 @@
1
1
  import { Node as PMNode } from 'prosemirror-model';
2
2
  import { Context } from '../../interfaces';
3
- export declare const listItem: (node: PMNode, prefix: string, context?: Context | undefined) => string;
3
+ export declare const listItem: (node: PMNode, prefix: string, context?: Context) => string;
@@ -26,8 +26,8 @@ export interface List {
26
26
  type: ListType;
27
27
  parent?: ListItem;
28
28
  }
29
- export declare type ListType = 'bulletList' | 'orderedList';
30
- export declare type CellType = 'tableHeader' | 'tableCell';
29
+ export type ListType = 'bulletList' | 'orderedList';
30
+ export type CellType = 'tableHeader' | 'tableCell';
31
31
  export interface TableCell {
32
32
  type: CellType;
33
33
  content: PMNode[];
@@ -51,7 +51,7 @@ export interface MediaConversionMap {
51
51
  embed?: boolean;
52
52
  };
53
53
  }
54
- export declare type TokenErrCallback = (err: Error, tokenType: string) => void;
54
+ export type TokenErrCallback = (err: Error, tokenType: string) => void;
55
55
  export interface Context {
56
56
  readonly issueKeyRegex?: RegExp | undefined;
57
57
  readonly tokenErrCallback?: TokenErrCallback;
@@ -44,9 +44,9 @@ export interface PMNodeToken {
44
44
  readonly nodes: PMNode[];
45
45
  readonly length: number;
46
46
  }
47
- export declare type TokenErrCallback = (err: Error, tokenType: string) => void;
48
- export declare type Token = TextToken | PMNodeToken;
49
- export declare type TokenParser = ({ input, position, schema, context, }: {
47
+ export type TokenErrCallback = (err: Error, tokenType: string) => void;
48
+ export type Token = TextToken | PMNodeToken;
49
+ export type TokenParser = ({ input, position, schema, context, }: {
50
50
  input: string;
51
51
  position: number;
52
52
  schema: Schema;
@@ -17,4 +17,4 @@ export interface Issue {
17
17
  export declare const issueKey: TokenParser;
18
18
  export declare const getIssue: (context: Context, key: string) => Issue | null;
19
19
  export declare const buildInlineCard: (schema: Schema, issue: Issue) => PMNode[];
20
- export declare const buildIssueKeyRegex: (inlineCardConversion?: ConversionMap | undefined) => RegExp | undefined;
20
+ export declare const buildIssueKeyRegex: (inlineCardConversion?: ConversionMap) => RegExp | undefined;
@@ -0,0 +1 @@
1
+ export declare const EM_DASH = "\u2014";
@@ -0,0 +1,3 @@
1
+ export declare const mapping: {
2
+ [key: string]: string;
3
+ };
@@ -0,0 +1,9 @@
1
+ import { Node as PMNode } from 'prosemirror-model';
2
+ import { 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
+ parent?: PMNode;
7
+ context?: Context;
8
+ };
9
+ export declare function encode(node: PMNode, context?: Context): string;
@@ -0,0 +1,5 @@
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;
@@ -0,0 +1,2 @@
1
+ import { MarkEncoder } from '..';
2
+ export declare const code: MarkEncoder;
@@ -0,0 +1,2 @@
1
+ import { MarkEncoder } from '..';
2
+ export declare const textColor: MarkEncoder;
@@ -0,0 +1,2 @@
1
+ import { MarkEncoder } from '..';
2
+ export declare const em: MarkEncoder;
@@ -0,0 +1,2 @@
1
+ import { MarkEncoder } from '..';
2
+ export declare const link: MarkEncoder;
@@ -0,0 +1,2 @@
1
+ import { MarkEncoder } from '..';
2
+ export declare const strike: MarkEncoder;
@@ -0,0 +1,6 @@
1
+ import { 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;
@@ -0,0 +1,2 @@
1
+ import { MarkEncoder } from '..';
2
+ export declare const subsup: MarkEncoder;
@@ -0,0 +1,2 @@
1
+ import { MarkEncoder } from '..';
2
+ export declare const underline: MarkEncoder;
@@ -0,0 +1,2 @@
1
+ import { NodeEncoder } from '..';
2
+ export declare const blockCard: NodeEncoder;
@@ -0,0 +1,2 @@
1
+ import { NodeEncoder } from '..';
2
+ export declare const blockquote: NodeEncoder;
@@ -0,0 +1,2 @@
1
+ import { NodeEncoder } from '..';
2
+ export declare const bulletList: NodeEncoder;
@@ -0,0 +1,2 @@
1
+ import { NodeEncoder } from '..';
2
+ export declare const caption: NodeEncoder;
@@ -0,0 +1,2 @@
1
+ import { NodeEncoder } from '..';
2
+ export declare const codeBlock: NodeEncoder;
@@ -0,0 +1,2 @@
1
+ import { NodeEncoder } from '..';
2
+ export declare const date: NodeEncoder;
@@ -0,0 +1,3 @@
1
+ import { Node as PMNode } from 'prosemirror-model';
2
+ import { NodeEncoderOpts } from '..';
3
+ export declare const decisionItem: (node: PMNode, { context }?: NodeEncoderOpts) => string;
@@ -0,0 +1,2 @@
1
+ import { NodeEncoder } from '..';
2
+ export declare const decisionList: NodeEncoder;
@@ -0,0 +1,2 @@
1
+ import { NodeEncoder } from '../';
2
+ export declare const doc: NodeEncoder;
@@ -0,0 +1,2 @@
1
+ import { NodeEncoder } from '..';
2
+ export declare const embedCard: NodeEncoder;
@@ -0,0 +1,2 @@
1
+ import { NodeEncoder } from '..';
2
+ export declare const emoji: NodeEncoder;
@@ -0,0 +1,2 @@
1
+ import { NodeEncoder } from '..';
2
+ export declare const expand: NodeEncoder;
@@ -0,0 +1,2 @@
1
+ import { NodeEncoder } from '..';
2
+ export declare const hardBreak: NodeEncoder;
@@ -0,0 +1,2 @@
1
+ import { NodeEncoder } from '..';
2
+ export declare const heading: NodeEncoder;
@@ -0,0 +1,2 @@
1
+ import { NodeEncoder } from '..';
2
+ export declare const inlineCard: NodeEncoder;
@@ -0,0 +1,2 @@
1
+ import { NodeEncoder } from '..';
2
+ export declare const inlines: NodeEncoder;
@@ -0,0 +1,3 @@
1
+ import { Node as PMNode } from 'prosemirror-model';
2
+ import { Context } from '../../interfaces';
3
+ export declare const listItem: (node: PMNode, prefix: string, context?: Context) => string;
@@ -0,0 +1,2 @@
1
+ import { NodeEncoder } from '..';
2
+ export declare const mediaGroup: NodeEncoder;
@@ -0,0 +1,2 @@
1
+ import { NodeEncoder } from '..';
2
+ export declare const mediaInline: NodeEncoder;
@@ -0,0 +1,2 @@
1
+ import { NodeEncoder } from '..';
2
+ export declare const media: NodeEncoder;
@@ -0,0 +1,2 @@
1
+ import { NodeEncoder } from '..';
2
+ export declare const mention: NodeEncoder;
@@ -0,0 +1,2 @@
1
+ import { NodeEncoder } from '..';
2
+ export declare const orderedList: NodeEncoder;
@@ -0,0 +1,2 @@
1
+ import { NodeEncoder } from '..';
2
+ export declare const panel: NodeEncoder;
@@ -0,0 +1,2 @@
1
+ import { NodeEncoder } from '..';
2
+ export declare const paragraph: NodeEncoder;
@@ -0,0 +1,2 @@
1
+ import { NodeEncoder } from '..';
2
+ export declare const rule: NodeEncoder;
@@ -0,0 +1,2 @@
1
+ import { NodeEncoder } from '..';
2
+ export declare const status: NodeEncoder;
@@ -0,0 +1,2 @@
1
+ import { NodeEncoder } from '..';
2
+ export declare const table: NodeEncoder;
@@ -0,0 +1,3 @@
1
+ import { Node as PMNode } from 'prosemirror-model';
2
+ import { NodeEncoderOpts } from '..';
3
+ export declare const taskItem: (node: PMNode, nestedLevel: number, { context }?: NodeEncoderOpts) => string;
@@ -0,0 +1,2 @@
1
+ import { NodeEncoder } from '..';
2
+ export declare const taskList: NodeEncoder;
@@ -0,0 +1,2 @@
1
+ import { NodeEncoder } from '..';
2
+ export declare const text: NodeEncoder;
@@ -0,0 +1,2 @@
1
+ import { NodeEncoder } from '..';
2
+ export declare const unknown: NodeEncoder;
@@ -0,0 +1,15 @@
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;
@@ -0,0 +1,74 @@
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 type ListType = 'bulletList' | 'orderedList';
30
+ export 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 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
+ }
@@ -0,0 +1,11 @@
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
+ }
@@ -0,0 +1,66 @@
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
+ }
@@ -0,0 +1,45 @@
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
+ }
@@ -0,0 +1,3 @@
1
+ export declare function getEditorColor(attrs: {
2
+ [key: string]: string;
3
+ }): string | null;
@@ -0,0 +1 @@
1
+ export declare function error(message: string, _input: string, line: number, column: number): void;
@@ -0,0 +1,3 @@
1
+ import { Node as PMNode, Schema } from 'prosemirror-model';
2
+ import { Context } from '../../interfaces';
3
+ export default function getMediaGroupNodeView(schema: Schema, filename: string, context?: Context): PMNode;
@@ -0,0 +1,5 @@
1
+ import { Node as PMNode, Schema } from 'prosemirror-model';
2
+ import { Context } from '../../interfaces';
3
+ export default function getMediaSingleNodeView(schema: Schema, filename: string, attrs: {
4
+ [key: string]: string;
5
+ }, context?: Context): PMNode;
@@ -0,0 +1,7 @@
1
+ import { Node as PMNode, Schema } from '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[];
@@ -0,0 +1,3 @@
1
+ import { Node as PMNode, NodeType, Schema } from 'prosemirror-model';
2
+ export default function getRuleNodeView(schema: Schema, containerNodeType: NodeType | null): PMNode;
3
+ export declare function createRuleNode(schema: Schema): PMNode[];
@@ -0,0 +1,2 @@
1
+ import { Mark as PMMark, Node as PMNode, Schema } from 'prosemirror-model';
2
+ export declare function createTextNode(input: string, schema: Schema, marks?: PMMark[]): PMNode[];
@@ -0,0 +1,10 @@
1
+ import { Node as PMNode, Schema } from 'prosemirror-model';
2
+ import { TokenType } from './tokenize';
3
+ import { Context } from '../interfaces';
4
+ export declare function parseString({ input, schema, ignoreTokenTypes, context, includeLeadingSpace, }: {
5
+ input: string;
6
+ schema: Schema;
7
+ ignoreTokenTypes: TokenType[];
8
+ context: Context;
9
+ includeLeadingSpace?: boolean;
10
+ }): PMNode[];
@@ -0,0 +1,2 @@
1
+ import { TokenParser } from '.';
2
+ export declare const adfMacro: TokenParser;