@atlaskit/editor-json-transformer 8.8.0 → 8.8.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @atlaskit/editor-json-transformer
2
2
 
3
+ ## 8.8.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [`fbbfaba77c9`](https://bitbucket.org/atlassian/atlassian-frontend/commits/fbbfaba77c9) - ED-13997 Fixed unhandled exception in encodeNode function
8
+
9
+ ## 8.8.1
10
+
11
+ ### Patch Changes
12
+
13
+ - [`8cc2f888c83`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8cc2f888c83) - Upgrade Typescript from `4.3.5` to `4.5.5`
14
+
3
15
  ## 8.8.0
4
16
 
5
17
  ### Minor Changes
package/dist/cjs/index.js CHANGED
@@ -112,7 +112,7 @@ var toJSON = function toJSON(node) {
112
112
  obj.attrs = (0, _adfSchema.toJSONTableHeader)(node).attrs;
113
113
  } else if (isExpand(node) || isNestedExpand(node)) {
114
114
  obj.attrs = (0, _adfSchema.expandToJSON)(node).attrs;
115
- } else if (Object.keys(node.attrs).length) {
115
+ } else if (node.attrs && Object.keys(node.attrs).length) {
116
116
  obj.attrs = node.attrs;
117
117
  }
118
118
 
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-json-transformer",
3
- "version": "8.8.0",
3
+ "version": "8.8.2",
4
4
  "sideEffects": false
5
5
  }
@@ -83,7 +83,7 @@ const toJSON = node => {
83
83
  obj.attrs = toJSONTableHeader(node).attrs;
84
84
  } else if (isExpand(node) || isNestedExpand(node)) {
85
85
  obj.attrs = expandToJSON(node).attrs;
86
- } else if (Object.keys(node.attrs).length) {
86
+ } else if (node.attrs && Object.keys(node.attrs).length) {
87
87
  obj.attrs = node.attrs;
88
88
  }
89
89
 
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-json-transformer",
3
- "version": "8.8.0",
3
+ "version": "8.8.2",
4
4
  "sideEffects": false
5
5
  }
package/dist/esm/index.js CHANGED
@@ -96,7 +96,7 @@ var toJSON = function toJSON(node) {
96
96
  obj.attrs = toJSONTableHeader(node).attrs;
97
97
  } else if (isExpand(node) || isNestedExpand(node)) {
98
98
  obj.attrs = expandToJSON(node).attrs;
99
- } else if (Object.keys(node.attrs).length) {
99
+ } else if (node.attrs && Object.keys(node.attrs).length) {
100
100
  obj.attrs = node.attrs;
101
101
  }
102
102
 
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-json-transformer",
3
- "version": "8.8.0",
3
+ "version": "8.8.2",
4
4
  "sideEffects": false
5
5
  }
@@ -0,0 +1,16 @@
1
+ import { Node as PMNode } from 'prosemirror-model';
2
+ import { JSONDocNode, JSONNode } from './types';
3
+ export type { JSONDocNode, JSONNode } from './types';
4
+ interface Transformer<T> {
5
+ encode(node: PMNode): T;
6
+ parse(content: T): PMNode;
7
+ }
8
+ export declare class JSONTransformer implements Transformer<JSONDocNode> {
9
+ encode(node: PMNode): JSONDocNode;
10
+ private internalParse;
11
+ parse(content: JSONDocNode): PMNode;
12
+ /**
13
+ * This method is used to encode a single node
14
+ */
15
+ encodeNode(node: PMNode): JSONNode;
16
+ }
@@ -0,0 +1,13 @@
1
+ interface MarkJson {
2
+ type: string;
3
+ attrs: {
4
+ [key: string]: any;
5
+ };
6
+ }
7
+ declare type CanOverrideUnsupportedMark = (markJson?: MarkJson) => boolean;
8
+ interface MarkOverrideRule {
9
+ canOverrideUnsupportedMark: CanOverrideUnsupportedMark;
10
+ }
11
+ declare type MarkOverrideRules = (type: string) => MarkOverrideRule;
12
+ export declare const markOverrideRuleFor: MarkOverrideRules;
13
+ export {};
@@ -0,0 +1,8 @@
1
+ import { JSONNode } from '../index';
2
+ export declare function removeMarks(node: JSONNode): {
3
+ type: string;
4
+ attrs?: object | undefined;
5
+ content?: (JSONNode | undefined)[] | undefined;
6
+ marks?: any[] | undefined;
7
+ text?: string | undefined;
8
+ };
@@ -0,0 +1,2 @@
1
+ import { JSONNode } from '../types';
2
+ export declare function sanitizeNode(json: JSONNode): JSONNode;
@@ -0,0 +1,2 @@
1
+ export { sanitizeNode } from './sanitize/sanitize-node';
2
+ export { removeMarks } from './sanitize/remove-marks';
@@ -0,0 +1,12 @@
1
+ export declare type JSONNode = {
2
+ type: string;
3
+ attrs?: object;
4
+ content?: Array<JSONNode | undefined>;
5
+ marks?: any[];
6
+ text?: string;
7
+ };
8
+ export declare type JSONDocNode = {
9
+ version: number;
10
+ type: 'doc';
11
+ content: JSONNode[];
12
+ };
@@ -4,5 +4,12 @@
4
4
  "module": "../dist/esm/markOverrideRules.js",
5
5
  "module:es2019": "../dist/es2019/markOverrideRules.js",
6
6
  "sideEffects": false,
7
- "types": "../dist/types/markOverrideRules.d.ts"
7
+ "types": "../dist/types/markOverrideRules.d.ts",
8
+ "typesVersions": {
9
+ ">=4.0 <4.5": {
10
+ "*": [
11
+ "../dist/types-ts4.0/markOverrideRules.d.ts"
12
+ ]
13
+ }
14
+ }
8
15
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-json-transformer",
3
- "version": "8.8.0",
3
+ "version": "8.8.2",
4
4
  "description": "JSON transformer",
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.0 <4.5": {
17
+ "*": [
18
+ "dist/types-ts4.0/*",
19
+ "dist/types-ts4.0/index.d.ts"
20
+ ]
21
+ }
22
+ },
15
23
  "sideEffects": false,
16
24
  "atlaskit:src": "src/index.ts",
17
25
  "atlassian": {
@@ -38,12 +46,12 @@
38
46
  "devDependencies": {
39
47
  "@atlaskit/docs": "*",
40
48
  "@atlaskit/editor-bitbucket-transformer": "^7.2.0",
41
- "@atlaskit/editor-common": "^69.2.0",
49
+ "@atlaskit/editor-common": "^70.2.0",
42
50
  "@atlaskit/editor-confluence-transformer": "^8.1.0",
43
- "@atlaskit/editor-core": "^172.1.0",
51
+ "@atlaskit/editor-core": "^175.0.0",
44
52
  "@atlaskit/editor-jira-transformer": "^8.2.0",
45
53
  "@atlaskit/editor-markdown-transformer": "^4.1.0",
46
- "@atlaskit/editor-test-helpers": "^17.1.0",
54
+ "@atlaskit/editor-test-helpers": "^17.2.0",
47
55
  "@atlaskit/editor-wikimarkup-transformer": "^11.1.0",
48
56
  "@atlaskit/util-data-test": "^17.5.0",
49
57
  "@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
@@ -52,7 +60,7 @@
52
60
  "prosemirror-view": "1.23.2",
53
61
  "react": "^16.8.0",
54
62
  "styled-components": "^3.2.6",
55
- "typescript": "4.3.5"
63
+ "typescript": "4.5.5"
56
64
  },
57
65
  "techstack": {
58
66
  "@atlassian/frontend": {
@@ -60,7 +68,10 @@
60
68
  },
61
69
  "@repo/internal": {
62
70
  "deprecation": "no-deprecated-imports",
63
- "theming": "tokens"
71
+ "theming": "tokens",
72
+ "styling": [
73
+ "emotion"
74
+ ]
64
75
  }
65
76
  },
66
77
  "prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.1"
package/report.api.md CHANGED
@@ -2,16 +2,24 @@
2
2
 
3
3
  > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
4
4
 
5
+ <!--
6
+ Generated API Report version: 2.0
7
+ -->
8
+
9
+ [Learn more about API reports](https://hello.atlassian.net/wiki/spaces/UR/pages/1825484529/Package+API+Reports)
10
+
5
11
  ```ts
6
12
  import { Node as Node_2 } from 'prosemirror-model';
7
13
 
8
- export declare type JSONDocNode = {
14
+ // @public (undocumented)
15
+ export type JSONDocNode = {
9
16
  version: number;
10
17
  type: 'doc';
11
18
  content: JSONNode[];
12
19
  };
13
20
 
14
- export declare type JSONNode = {
21
+ // @public (undocumented)
22
+ export type JSONNode = {
15
23
  type: string;
16
24
  attrs?: object;
17
25
  content?: Array<JSONNode | undefined>;
@@ -19,20 +27,22 @@ export declare type JSONNode = {
19
27
  text?: string;
20
28
  };
21
29
 
22
- export declare class JSONTransformer implements Transformer_2<JSONDocNode> {
30
+ // @public (undocumented)
31
+ export class JSONTransformer implements Transformer_2<JSONDocNode> {
32
+ // (undocumented)
23
33
  encode(node: Node_2): JSONDocNode;
24
- private internalParse;
25
- parse(content: JSONDocNode): Node_2;
26
- /**
27
- * This method is used to encode a single node
28
- */
29
34
  encodeNode(node: Node_2): JSONNode;
35
+ // (undocumented)
36
+ parse(content: JSONDocNode): Node_2;
30
37
  }
31
38
 
32
- declare interface Transformer_2<T> {
39
+ // @public (undocumented)
40
+ interface Transformer_2<T> {
41
+ // (undocumented)
33
42
  encode(node: Node_2): T;
43
+ // (undocumented)
34
44
  parse(content: T): Node_2;
35
45
  }
36
46
 
37
- export {};
47
+ // (No @packageDocumentation comment for this package)
38
48
  ```
@@ -4,5 +4,12 @@
4
4
  "module": "../dist/esm/sanitize.js",
5
5
  "module:es2019": "../dist/es2019/sanitize.js",
6
6
  "sideEffects": false,
7
- "types": "../dist/types/sanitize.d.ts"
7
+ "types": "../dist/types/sanitize.d.ts",
8
+ "typesVersions": {
9
+ ">=4.0 <4.5": {
10
+ "*": [
11
+ "../dist/types-ts4.0/sanitize.d.ts"
12
+ ]
13
+ }
14
+ }
8
15
  }
@@ -4,5 +4,12 @@
4
4
  "module": "../dist/esm/types.js",
5
5
  "module:es2019": "../dist/es2019/types.js",
6
6
  "sideEffects": false,
7
- "types": "../dist/types/types.d.ts"
7
+ "types": "../dist/types/types.d.ts",
8
+ "typesVersions": {
9
+ ">=4.0 <4.5": {
10
+ "*": [
11
+ "../dist/types-ts4.0/types.d.ts"
12
+ ]
13
+ }
14
+ }
8
15
  }