@atlaskit/editor-wikimarkup-transformer 11.2.0 → 11.2.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 CHANGED
@@ -1,5 +1,11 @@
1
1
  # @atlaskit/editor-wikimarkup-transformer
2
2
 
3
+ ## 11.2.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [`41fae2c6f68`](https://bitbucket.org/atlassian/atlassian-frontend/commits/41fae2c6f68) - Upgrade Typescript from `4.5.5` to `4.9.5`
8
+
3
9
  ## 11.2.0
4
10
 
5
11
  ### 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.1",
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.1",
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.1",
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;
@@ -6,9 +6,9 @@
6
6
  "sideEffects": false,
7
7
  "types": "../dist/types/interfaces.d.ts",
8
8
  "typesVersions": {
9
- ">=4.0 <4.5": {
9
+ ">=4.5 <4.9": {
10
10
  "*": [
11
- "../dist/types-ts4.0/interfaces.d.ts"
11
+ "../dist/types-ts4.5/interfaces.d.ts"
12
12
  ]
13
13
  }
14
14
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-wikimarkup-transformer",
3
- "version": "11.2.0",
3
+ "version": "11.2.1",
4
4
  "description": "Wiki markup transformer for JIRA and Confluence",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -12,6 +12,14 @@
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
+ },
15
23
  "sideEffects": false,
16
24
  "atlaskit:src": "src/index.ts",
17
25
  "atlassian": {
@@ -35,7 +43,7 @@
35
43
  "@atlaskit/docs": "*",
36
44
  "@atlaskit/editor-common": "^74.0.0",
37
45
  "@atlaskit/editor-core": "^183.0.0",
38
- "@atlaskit/editor-test-helpers": "^18.2.0",
46
+ "@atlaskit/editor-test-helpers": "^18.3.0",
39
47
  "@atlaskit/mention": "^22.1.0",
40
48
  "@atlaskit/profilecard": "^19.3.0",
41
49
  "@atlaskit/renderer": "^108.0.0",
@@ -48,7 +56,7 @@
48
56
  "react": "^16.8.0",
49
57
  "react-intl-next": "npm:react-intl@^5.18.1",
50
58
  "rxjs": "^5.5.0",
51
- "typescript": "4.5.5"
59
+ "typescript": "~4.9.5"
52
60
  },
53
61
  "prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.1"
54
62
  }
@@ -0,0 +1,76 @@
1
+ ## API Report File for "@atlaskit/editor-wikimarkup-transformer"
2
+
3
+ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
4
+
5
+ ```ts
6
+
7
+ import { Node as Node_2 } from 'prosemirror-model';
8
+ import { Schema } from 'prosemirror-model';
9
+
10
+ // @public (undocumented)
11
+ interface Context {
12
+ // (undocumented)
13
+ readonly conversion?: {
14
+ readonly inlineCardConversion?: ConversionMap;
15
+ readonly mediaConversion?: MediaConversionMap;
16
+ mentionConversion?: ConversionMap;
17
+ };
18
+ // (undocumented)
19
+ readonly defaults?: {
20
+ readonly media?: {
21
+ width: null | number;
22
+ height: null | number;
23
+ };
24
+ };
25
+ // (undocumented)
26
+ readonly hydration?: {
27
+ readonly media?: {
28
+ targetCollectionId?: string;
29
+ };
30
+ };
31
+ // (undocumented)
32
+ readonly issueKeyRegex?: RegExp | undefined;
33
+ // (undocumented)
34
+ readonly tokenErrCallback?: TokenErrCallback;
35
+ }
36
+
37
+ // @public (undocumented)
38
+ interface ConversionMap {
39
+ // (undocumented)
40
+ [key: string]: string;
41
+ }
42
+
43
+ // @public (undocumented)
44
+ interface MediaConversionMap {
45
+ // (undocumented)
46
+ [key: string]: {
47
+ transform?: string;
48
+ embed?: boolean;
49
+ };
50
+ }
51
+
52
+ // @public (undocumented)
53
+ type TokenErrCallback = (err: Error, tokenType: string) => void;
54
+
55
+ // @public (undocumented)
56
+ interface Transformer_2<T> {
57
+ // (undocumented)
58
+ encode(node: Node_2): T;
59
+ // (undocumented)
60
+ parse(content: T): Node_2;
61
+ }
62
+
63
+ // @public (undocumented)
64
+ class WikiMarkupTransformer implements Transformer_2<string> {
65
+ constructor(schema?: Schema);
66
+ // (undocumented)
67
+ encode(node: Node_2, context?: Context): string;
68
+ // (undocumented)
69
+ parse(wikiMarkup: string, context?: Context): Node_2;
70
+ }
71
+ export { WikiMarkupTransformer }
72
+ export default WikiMarkupTransformer;
73
+
74
+ // (No @packageDocumentation comment for this package)
75
+
76
+ ```