@atlaskit/editor-common 99.15.0 → 99.16.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,13 @@
1
1
  # @atlaskit/editor-common
2
2
 
3
+ ## 99.16.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#114421](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/114421)
8
+ [`1b137b82b89d3`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/1b137b82b89d3) -
9
+ [ECOHELP-54944] Strip macro IDs on paste for extensions and inline extensions
10
+
3
11
  ## 99.15.0
4
12
 
5
13
  ### Minor Changes
@@ -17,7 +17,7 @@ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return
17
17
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
18
18
  var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
19
19
  var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
20
- var packageVersion = "99.15.0";
20
+ var packageVersion = "99.16.0";
21
21
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
22
22
  // Remove URL as it has UGC
23
23
  // TODO: Sanitise the URL instead of just removing it
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.transformSliceToRemoveOpenMultiBodiedExtension = exports.transformSliceToRemoveOpenBodiedExtension = exports.transformSliceToRemoveLegacyContentMacro = void 0;
6
+ exports.transformSliceToRemoveOpenMultiBodiedExtension = exports.transformSliceToRemoveOpenBodiedExtension = exports.transformSliceToRemoveMacroId = exports.transformSliceToRemoveLegacyContentMacro = void 0;
7
7
  var _adfSchema = require("@atlaskit/adf-schema");
8
8
  var _model = require("@atlaskit/editor-prosemirror/model");
9
9
  var _slice = require("../utils/slice");
@@ -93,4 +93,19 @@ var transformSliceToRemoveLegacyContentMacro = exports.transformSliceToRemoveLeg
93
93
  }
94
94
  return node;
95
95
  });
96
+ };
97
+ var transformSliceToRemoveMacroId = exports.transformSliceToRemoveMacroId = function transformSliceToRemoveMacroId(slice, schema) {
98
+ var _schema$nodes2 = schema.nodes,
99
+ extension = _schema$nodes2.extension,
100
+ inlineExtension = _schema$nodes2.inlineExtension;
101
+ return (0, _slice.mapSlice)(slice, function (node) {
102
+ var _node$attrs$parameter2;
103
+ if ([extension, inlineExtension].includes(node.type) && typeof ((_node$attrs$parameter2 = node.attrs.parameters) === null || _node$attrs$parameter2 === void 0 || (_node$attrs$parameter2 = _node$attrs$parameter2.macroMetadata) === null || _node$attrs$parameter2 === void 0 || (_node$attrs$parameter2 = _node$attrs$parameter2.macroId) === null || _node$attrs$parameter2 === void 0 ? void 0 : _node$attrs$parameter2.value) !== 'undefined') {
104
+ // Strip the macroId. While pasting on the same page, macroId does not change until the page
105
+ // is published and causes collision with the existing macroId where switching tabs of one
106
+ // node changes the tabs for the other node
107
+ delete node.attrs.parameters.macroMetadata.macroId;
108
+ }
109
+ return node;
110
+ });
96
111
  };
@@ -69,6 +69,12 @@ Object.defineProperty(exports, "transformSliceToRemoveLegacyContentMacro", {
69
69
  return _extension.transformSliceToRemoveLegacyContentMacro;
70
70
  }
71
71
  });
72
+ Object.defineProperty(exports, "transformSliceToRemoveMacroId", {
73
+ enumerable: true,
74
+ get: function get() {
75
+ return _extension.transformSliceToRemoveMacroId;
76
+ }
77
+ });
72
78
  Object.defineProperty(exports, "transformSliceToRemoveOpenBodiedExtension", {
73
79
  enumerable: true,
74
80
  get: function get() {
@@ -23,7 +23,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
23
23
  * @jsx jsx
24
24
  */ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
25
25
  var packageName = "@atlaskit/editor-common";
26
- var packageVersion = "99.15.0";
26
+ var packageVersion = "99.16.0";
27
27
  var halfFocusRing = 1;
28
28
  var dropOffset = '0, 8';
29
29
  // Ignored via go/ees005
@@ -1,7 +1,7 @@
1
1
  import { isFedRamp } from './environment';
2
2
  const SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
3
3
  const packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
4
- const packageVersion = "99.15.0";
4
+ const packageVersion = "99.16.0";
5
5
  const sanitiseSentryEvents = (data, _hint) => {
6
6
  // Remove URL as it has UGC
7
7
  // TODO: Sanitise the URL instead of just removing it
@@ -93,4 +93,20 @@ export const transformSliceToRemoveLegacyContentMacro = (slice, schema) => {
93
93
  }
94
94
  return node;
95
95
  });
96
+ };
97
+ export const transformSliceToRemoveMacroId = (slice, schema) => {
98
+ const {
99
+ extension,
100
+ inlineExtension
101
+ } = schema.nodes;
102
+ return mapSlice(slice, node => {
103
+ var _node$attrs$parameter4, _node$attrs$parameter5, _node$attrs$parameter6;
104
+ if ([extension, inlineExtension].includes(node.type) && typeof ((_node$attrs$parameter4 = node.attrs.parameters) === null || _node$attrs$parameter4 === void 0 ? void 0 : (_node$attrs$parameter5 = _node$attrs$parameter4.macroMetadata) === null || _node$attrs$parameter5 === void 0 ? void 0 : (_node$attrs$parameter6 = _node$attrs$parameter5.macroId) === null || _node$attrs$parameter6 === void 0 ? void 0 : _node$attrs$parameter6.value) !== 'undefined') {
105
+ // Strip the macroId. While pasting on the same page, macroId does not change until the page
106
+ // is published and causes collision with the existing macroId where switching tabs of one
107
+ // node changes the tabs for the other node
108
+ delete node.attrs.parameters.macroMetadata.macroId;
109
+ }
110
+ return node;
111
+ });
96
112
  };
@@ -3,6 +3,6 @@
3
3
 
4
4
  export { unwrapContentFromLayout, removeLayoutFromFirstChild, removeLayoutFromLastChild, transformSliceToRemoveOpenLayoutNodes, transformSingleColumnLayout } from './layout';
5
5
  export { findExpand, transformSliceToRemoveOpenExpand, transformSliceToRemoveOpenNestedExpand, transformSliceNestedExpandToExpand, transformSliceExpandToNestedExpand } from './expand';
6
- export { transformSliceToRemoveOpenBodiedExtension, transformSliceToRemoveOpenMultiBodiedExtension, transformSliceToRemoveLegacyContentMacro } from './extension';
6
+ export { transformSliceToRemoveOpenBodiedExtension, transformSliceToRemoveOpenMultiBodiedExtension, transformSliceToRemoveLegacyContentMacro, transformSliceToRemoveMacroId } from './extension';
7
7
  export { transformSliceToJoinAdjacentCodeBlocks, transformSingleLineCodeBlockToCodeMark, findCodeBlock } from './code-block';
8
8
  export { transformSliceToDecisionList } from './decision-list';
@@ -13,7 +13,7 @@ import withAnalyticsContext from '@atlaskit/analytics-next/withAnalyticsContext'
13
13
  import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
14
14
  import Layer from '../Layer';
15
15
  const packageName = "@atlaskit/editor-common";
16
- const packageVersion = "99.15.0";
16
+ const packageVersion = "99.16.0";
17
17
  const halfFocusRing = 1;
18
18
  const dropOffset = '0, 8';
19
19
  // Ignored via go/ees005
@@ -7,7 +7,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
7
7
  import { isFedRamp } from './environment';
8
8
  var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
9
9
  var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
10
- var packageVersion = "99.15.0";
10
+ var packageVersion = "99.16.0";
11
11
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
12
12
  // Remove URL as it has UGC
13
13
  // TODO: Sanitise the URL instead of just removing it
@@ -88,4 +88,19 @@ export var transformSliceToRemoveLegacyContentMacro = function transformSliceToR
88
88
  }
89
89
  return node;
90
90
  });
91
+ };
92
+ export var transformSliceToRemoveMacroId = function transformSliceToRemoveMacroId(slice, schema) {
93
+ var _schema$nodes2 = schema.nodes,
94
+ extension = _schema$nodes2.extension,
95
+ inlineExtension = _schema$nodes2.inlineExtension;
96
+ return mapSlice(slice, function (node) {
97
+ var _node$attrs$parameter2;
98
+ if ([extension, inlineExtension].includes(node.type) && typeof ((_node$attrs$parameter2 = node.attrs.parameters) === null || _node$attrs$parameter2 === void 0 || (_node$attrs$parameter2 = _node$attrs$parameter2.macroMetadata) === null || _node$attrs$parameter2 === void 0 || (_node$attrs$parameter2 = _node$attrs$parameter2.macroId) === null || _node$attrs$parameter2 === void 0 ? void 0 : _node$attrs$parameter2.value) !== 'undefined') {
99
+ // Strip the macroId. While pasting on the same page, macroId does not change until the page
100
+ // is published and causes collision with the existing macroId where switching tabs of one
101
+ // node changes the tabs for the other node
102
+ delete node.attrs.parameters.macroMetadata.macroId;
103
+ }
104
+ return node;
105
+ });
91
106
  };
@@ -3,6 +3,6 @@
3
3
 
4
4
  export { unwrapContentFromLayout, removeLayoutFromFirstChild, removeLayoutFromLastChild, transformSliceToRemoveOpenLayoutNodes, transformSingleColumnLayout } from './layout';
5
5
  export { findExpand, transformSliceToRemoveOpenExpand, transformSliceToRemoveOpenNestedExpand, transformSliceNestedExpandToExpand, transformSliceExpandToNestedExpand } from './expand';
6
- export { transformSliceToRemoveOpenBodiedExtension, transformSliceToRemoveOpenMultiBodiedExtension, transformSliceToRemoveLegacyContentMacro } from './extension';
6
+ export { transformSliceToRemoveOpenBodiedExtension, transformSliceToRemoveOpenMultiBodiedExtension, transformSliceToRemoveLegacyContentMacro, transformSliceToRemoveMacroId } from './extension';
7
7
  export { transformSliceToJoinAdjacentCodeBlocks, transformSingleLineCodeBlockToCodeMark, findCodeBlock } from './code-block';
8
8
  export { transformSliceToDecisionList } from './decision-list';
@@ -20,7 +20,7 @@ import withAnalyticsContext from '@atlaskit/analytics-next/withAnalyticsContext'
20
20
  import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
21
21
  import Layer from '../Layer';
22
22
  var packageName = "@atlaskit/editor-common";
23
- var packageVersion = "99.15.0";
23
+ var packageVersion = "99.16.0";
24
24
  var halfFocusRing = 1;
25
25
  var dropOffset = '0, 8';
26
26
  // Ignored via go/ees005
@@ -11,3 +11,4 @@ export declare const transformSliceToRemoveOpenBodiedExtension: (slice: Slice, s
11
11
  */
12
12
  export declare const transformSliceToRemoveOpenMultiBodiedExtension: (slice: Slice, schema: Schema) => Slice;
13
13
  export declare const transformSliceToRemoveLegacyContentMacro: (slice: Slice, schema: Schema) => Slice;
14
+ export declare const transformSliceToRemoveMacroId: (slice: Slice, schema: Schema) => Slice;
@@ -1,5 +1,5 @@
1
1
  export { unwrapContentFromLayout, removeLayoutFromFirstChild, removeLayoutFromLastChild, transformSliceToRemoveOpenLayoutNodes, transformSingleColumnLayout, } from './layout';
2
2
  export { findExpand, transformSliceToRemoveOpenExpand, transformSliceToRemoveOpenNestedExpand, transformSliceNestedExpandToExpand, transformSliceExpandToNestedExpand, } from './expand';
3
- export { transformSliceToRemoveOpenBodiedExtension, transformSliceToRemoveOpenMultiBodiedExtension, transformSliceToRemoveLegacyContentMacro, } from './extension';
3
+ export { transformSliceToRemoveOpenBodiedExtension, transformSliceToRemoveOpenMultiBodiedExtension, transformSliceToRemoveLegacyContentMacro, transformSliceToRemoveMacroId, } from './extension';
4
4
  export { transformSliceToJoinAdjacentCodeBlocks, transformSingleLineCodeBlockToCodeMark, findCodeBlock, } from './code-block';
5
5
  export { transformSliceToDecisionList } from './decision-list';
@@ -11,3 +11,4 @@ export declare const transformSliceToRemoveOpenBodiedExtension: (slice: Slice, s
11
11
  */
12
12
  export declare const transformSliceToRemoveOpenMultiBodiedExtension: (slice: Slice, schema: Schema) => Slice;
13
13
  export declare const transformSliceToRemoveLegacyContentMacro: (slice: Slice, schema: Schema) => Slice;
14
+ export declare const transformSliceToRemoveMacroId: (slice: Slice, schema: Schema) => Slice;
@@ -1,5 +1,5 @@
1
1
  export { unwrapContentFromLayout, removeLayoutFromFirstChild, removeLayoutFromLastChild, transformSliceToRemoveOpenLayoutNodes, transformSingleColumnLayout, } from './layout';
2
2
  export { findExpand, transformSliceToRemoveOpenExpand, transformSliceToRemoveOpenNestedExpand, transformSliceNestedExpandToExpand, transformSliceExpandToNestedExpand, } from './expand';
3
- export { transformSliceToRemoveOpenBodiedExtension, transformSliceToRemoveOpenMultiBodiedExtension, transformSliceToRemoveLegacyContentMacro, } from './extension';
3
+ export { transformSliceToRemoveOpenBodiedExtension, transformSliceToRemoveOpenMultiBodiedExtension, transformSliceToRemoveLegacyContentMacro, transformSliceToRemoveMacroId, } from './extension';
4
4
  export { transformSliceToJoinAdjacentCodeBlocks, transformSingleLineCodeBlockToCodeMark, findCodeBlock, } from './code-block';
5
5
  export { transformSliceToDecisionList } from './decision-list';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "99.15.0",
3
+ "version": "99.16.0",
4
4
  "description": "A package that contains common classes and components for editor and renderer",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -132,7 +132,7 @@
132
132
  "@atlaskit/emoji": "^67.14.0",
133
133
  "@atlaskit/icon": "^23.9.0",
134
134
  "@atlaskit/icon-object": "^6.11.0",
135
- "@atlaskit/link-datasource": "^3.19.0",
135
+ "@atlaskit/link-datasource": "^3.20.0",
136
136
  "@atlaskit/link-picker": "^1.49.0",
137
137
  "@atlaskit/media-card": "^78.19.0",
138
138
  "@atlaskit/media-client": "^31.1.0",