@atlaskit/editor-json-transformer 9.4.0 → 9.5.0

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
+ ## 9.5.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`52e80c8d44e5f`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/52e80c8d44e5f) -
8
+ Behind `platform_editor_sanitize_selection_fragments`, `getFragmentsFromSelection` now sanitises
9
+ selection fragments via `JSONTransformer.encodeNode` instead of the raw `nodeToJSON`, so the
10
+ schema-only `panel_c1` container variant no longer leaks to Remix and other AI selection-context
11
+ consumers when `platform_editor_nest_table_in_panel` is enabled. `keepNestedTables: true` is
12
+ passed to keep nested tables intact. `encodeNode` and editor-common's `nodeToJSON` now accept
13
+ `SanitizeNodeOptions`, matching `encode`.
14
+
3
15
  ## 9.4.0
4
16
 
5
17
  ### Minor Changes
@@ -91,7 +91,8 @@ var JSONTransformer = exports.JSONTransformer = /*#__PURE__*/function () {
91
91
  }, {
92
92
  key: "encodeNode",
93
93
  value: function encodeNode(node) {
94
- return (0, _sanitizeNode.sanitizeNode)((0, _toJSON.toJSON)(node, this.mentionMap));
94
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
95
+ return (0, _sanitizeNode.sanitizeNode)((0, _toJSON.toJSON)(node, this.mentionMap), options);
95
96
  }
96
97
  }]);
97
98
  }();
@@ -69,7 +69,7 @@ export class JSONTransformer {
69
69
  /**
70
70
  * This method is used to encode a single node
71
71
  */
72
- encodeNode(node) {
73
- return sanitizeNode(toJSON(node, this.mentionMap));
72
+ encodeNode(node, options = {}) {
73
+ return sanitizeNode(toJSON(node, this.mentionMap), options);
74
74
  }
75
75
  }
@@ -84,7 +84,8 @@ export var JSONTransformer = /*#__PURE__*/function () {
84
84
  }, {
85
85
  key: "encodeNode",
86
86
  value: function encodeNode(node) {
87
- return sanitizeNode(toJSON(node, this.mentionMap));
87
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
88
+ return sanitizeNode(toJSON(node, this.mentionMap), options);
88
89
  }
89
90
  }]);
90
91
  }();
@@ -22,6 +22,6 @@ export declare class JSONTransformer implements Transformer<JSONDocNode> {
22
22
  /**
23
23
  * This method is used to encode a single node
24
24
  */
25
- encodeNode(node: PMNode): JSONNode;
25
+ encodeNode(node: PMNode, options?: SanitizeNodeOptions): JSONNode;
26
26
  }
27
27
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-json-transformer",
3
- "version": "9.4.0",
3
+ "version": "9.5.0",
4
4
  "description": "JSON transformer",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -22,13 +22,13 @@
22
22
  },
23
23
  "dependencies": {
24
24
  "@atlaskit/adf-schema": "^57.0.0",
25
- "@atlaskit/adf-utils": "^20.6.0",
25
+ "@atlaskit/adf-utils": "^20.7.0",
26
26
  "@atlaskit/editor-prosemirror": "^8.0.0",
27
27
  "@babel/runtime": "^7.0.0",
28
28
  "lodash": "^4.17.21"
29
29
  },
30
30
  "devDependencies": {
31
- "@atlassian/a11y-jest-testing": "^0.15.0",
31
+ "@atlassian/a11y-jest-testing": "^0.16.0",
32
32
  "@atlassian/structured-docs-types": "workspace:^",
33
33
  "react": "^19.2.0"
34
34
  },