@atlaskit/editor-common 92.1.1 → 92.1.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,14 @@
1
1
  # @atlaskit/editor-common
2
2
 
3
+ ## 92.1.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [#148109](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/148109)
8
+ [`ac5a4bdf86ac6`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/ac5a4bdf86ac6) -
9
+ Fix selection sync in React 18 for certain nodes.
10
+ - Updated dependencies
11
+
3
12
  ## 92.1.1
4
13
 
5
14
  ### Patch 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 = "92.1.1";
20
+ var packageVersion = "92.1.2";
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
@@ -22,7 +22,6 @@ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/cl
22
22
  var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
23
23
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
24
24
  var _react = _interopRequireDefault(require("react"));
25
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
26
25
  var _analytics = require("../analytics");
27
26
  var _eventDispatcher = require("../event-dispatcher");
28
27
  var _ErrorBoundary = require("../ui/ErrorBoundary");
@@ -151,48 +150,44 @@ var ReactNodeView = exports.default = /*#__PURE__*/function () {
151
150
 
152
151
  // move the contentDOM node inside the inner reference after rendering
153
152
  if (node && contentDOM && !node.contains(contentDOM)) {
154
- if ((0, _platformFeatureFlags.fg)('platform_editor_react_18_prosemirror_sel_resync')) {
155
- var _this$view$state$sele;
156
- // @ts-ignore - ignoreMutation may not be declared
157
- oldIgnoreMutation = this.ignoreMutation; // store ref to previous ignoreMutation
153
+ var _this$view$state$sele;
154
+ // @ts-ignore - ignoreMutation may not be declared
155
+ oldIgnoreMutation = this.ignoreMutation; // store ref to previous ignoreMutation
158
156
 
159
- // ignore all mutations caused by ProseMirror's MutationObserver triggering
160
- // after DOM change, except selection changes
161
- // @ts-ignore ProseMirror adds selection type to MutationRecord
162
- this.ignoreMutation = function (m) {
163
- var isSelectionMutation = m.type === 'selection';
164
- if (!isSelectionMutation) {
165
- mutationsIgnored = true;
166
- }
167
- return !isSelectionMutation;
168
- };
169
-
170
- // capture document selection state before React DOM changes triggers ProseMirror selection change transaction
171
- if (this.view.state.selection.visible) {
172
- selectionBookmark = this.view.state.selection.getBookmark();
157
+ // ignore all mutations caused by ProseMirror's MutationObserver triggering
158
+ // after DOM change, except selection changes
159
+ // @ts-ignore ProseMirror adds selection type to MutationRecord
160
+ this.ignoreMutation = function (m) {
161
+ var isSelectionMutation = m.type === 'selection';
162
+ if (!isSelectionMutation) {
163
+ mutationsIgnored = true;
173
164
  }
165
+ return !isSelectionMutation;
166
+ };
174
167
 
175
- // ... and capture parent offset before DOM change
176
- if (((_this$view$state$sele = this.view.state.selection) === null || _this$view$state$sele === void 0 ? void 0 : _this$view$state$sele.ranges.length) > 0) {
177
- var _this$view$state$sele2, _this$view$state$sele3;
178
- parentOffset = (_this$view$state$sele2 = (_this$view$state$sele3 = this.view.state.selection) === null || _this$view$state$sele3 === void 0 || (_this$view$state$sele3 = _this$view$state$sele3.ranges[0].$from) === null || _this$view$state$sele3 === void 0 ? void 0 : _this$view$state$sele3.parentOffset) !== null && _this$view$state$sele2 !== void 0 ? _this$view$state$sele2 : 0;
179
- }
168
+ // capture document selection state before React DOM changes triggers ProseMirror selection change transaction
169
+ if (this.view.state.selection.visible) {
170
+ selectionBookmark = this.view.state.selection.getBookmark();
180
171
  }
181
- node.appendChild(contentDOM);
182
- if ((0, _platformFeatureFlags.fg)('platform_editor_react_18_prosemirror_sel_resync')) {
183
- requestAnimationFrame(function () {
184
- // Reset ignoreMutation after frame ....
185
- // @ts-ignore - this may not have been declared by implementing class
186
- _this4.ignoreMutation = oldIgnoreMutation;
187
172
 
188
- // only trigger selection re-sync if the selection is not at the start of the
189
- // node, and DOM mutations were ignored
190
- if (selectionBookmark && mutationsIgnored && parentOffset > 0) {
191
- // ... and dispatch expected selection state
192
- _this4.view.dispatch(_this4.view.state.tr.setSelection(selectionBookmark.resolve(_this4.view.state.tr.doc)));
193
- }
194
- });
173
+ // ... and capture parent offset before DOM change
174
+ if (((_this$view$state$sele = this.view.state.selection) === null || _this$view$state$sele === void 0 ? void 0 : _this$view$state$sele.ranges.length) > 0) {
175
+ var _this$view$state$sele2, _this$view$state$sele3;
176
+ parentOffset = (_this$view$state$sele2 = (_this$view$state$sele3 = this.view.state.selection) === null || _this$view$state$sele3 === void 0 || (_this$view$state$sele3 = _this$view$state$sele3.ranges[0].$from) === null || _this$view$state$sele3 === void 0 ? void 0 : _this$view$state$sele3.parentOffset) !== null && _this$view$state$sele2 !== void 0 ? _this$view$state$sele2 : 0;
195
177
  }
178
+ node.appendChild(contentDOM);
179
+ requestAnimationFrame(function () {
180
+ // Reset ignoreMutation after frame ....
181
+ // @ts-ignore - this may not have been declared by implementing class
182
+ _this4.ignoreMutation = oldIgnoreMutation;
183
+
184
+ // only trigger selection re-sync if the selection is not at the start of the
185
+ // node, and DOM mutations were ignored
186
+ if (selectionBookmark && mutationsIgnored && parentOffset > 0) {
187
+ // ... and dispatch expected selection state
188
+ _this4.view.dispatch(_this4.view.state.tr.setSelection(selectionBookmark.resolve(_this4.view.state.tr.doc)));
189
+ }
190
+ });
196
191
  }
197
192
  }
198
193
  }, {
@@ -25,7 +25,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
25
25
  * @jsx jsx
26
26
  */ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
27
27
  var packageName = "@atlaskit/editor-common";
28
- var packageVersion = "92.1.1";
28
+ var packageVersion = "92.1.2";
29
29
  var halfFocusRing = 1;
30
30
  var dropOffset = '0, 8';
31
31
  var DropList = /*#__PURE__*/function (_Component) {
@@ -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 = "92.1.1";
4
+ const packageVersion = "92.1.2";
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
@@ -1,7 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
3
  import React from 'react';
4
- import { fg } from '@atlaskit/platform-feature-flags';
5
4
  import { ACTION_SUBJECT, ACTION_SUBJECT_ID } from '../analytics';
6
5
  import { createDispatch } from '../event-dispatcher';
7
6
  import { ErrorBoundary } from '../ui/ErrorBoundary';
@@ -113,48 +112,44 @@ export default class ReactNodeView {
113
112
 
114
113
  // move the contentDOM node inside the inner reference after rendering
115
114
  if (node && contentDOM && !node.contains(contentDOM)) {
116
- if (fg('platform_editor_react_18_prosemirror_sel_resync')) {
117
- var _this$view$state$sele;
118
- // @ts-ignore - ignoreMutation may not be declared
119
- oldIgnoreMutation = this.ignoreMutation; // store ref to previous ignoreMutation
115
+ var _this$view$state$sele;
116
+ // @ts-ignore - ignoreMutation may not be declared
117
+ oldIgnoreMutation = this.ignoreMutation; // store ref to previous ignoreMutation
120
118
 
121
- // ignore all mutations caused by ProseMirror's MutationObserver triggering
122
- // after DOM change, except selection changes
123
- // @ts-ignore ProseMirror adds selection type to MutationRecord
124
- this.ignoreMutation = m => {
125
- const isSelectionMutation = m.type === 'selection';
126
- if (!isSelectionMutation) {
127
- mutationsIgnored = true;
128
- }
129
- return !isSelectionMutation;
130
- };
131
-
132
- // capture document selection state before React DOM changes triggers ProseMirror selection change transaction
133
- if (this.view.state.selection.visible) {
134
- selectionBookmark = this.view.state.selection.getBookmark();
119
+ // ignore all mutations caused by ProseMirror's MutationObserver triggering
120
+ // after DOM change, except selection changes
121
+ // @ts-ignore ProseMirror adds selection type to MutationRecord
122
+ this.ignoreMutation = m => {
123
+ const isSelectionMutation = m.type === 'selection';
124
+ if (!isSelectionMutation) {
125
+ mutationsIgnored = true;
135
126
  }
127
+ return !isSelectionMutation;
128
+ };
136
129
 
137
- // ... and capture parent offset before DOM change
138
- if (((_this$view$state$sele = this.view.state.selection) === null || _this$view$state$sele === void 0 ? void 0 : _this$view$state$sele.ranges.length) > 0) {
139
- var _this$view$state$sele2, _this$view$state$sele3, _this$view$state$sele4;
140
- parentOffset = (_this$view$state$sele2 = (_this$view$state$sele3 = this.view.state.selection) === null || _this$view$state$sele3 === void 0 ? void 0 : (_this$view$state$sele4 = _this$view$state$sele3.ranges[0].$from) === null || _this$view$state$sele4 === void 0 ? void 0 : _this$view$state$sele4.parentOffset) !== null && _this$view$state$sele2 !== void 0 ? _this$view$state$sele2 : 0;
141
- }
130
+ // capture document selection state before React DOM changes triggers ProseMirror selection change transaction
131
+ if (this.view.state.selection.visible) {
132
+ selectionBookmark = this.view.state.selection.getBookmark();
142
133
  }
143
- node.appendChild(contentDOM);
144
- if (fg('platform_editor_react_18_prosemirror_sel_resync')) {
145
- requestAnimationFrame(() => {
146
- // Reset ignoreMutation after frame ....
147
- // @ts-ignore - this may not have been declared by implementing class
148
- this.ignoreMutation = oldIgnoreMutation;
149
134
 
150
- // only trigger selection re-sync if the selection is not at the start of the
151
- // node, and DOM mutations were ignored
152
- if (selectionBookmark && mutationsIgnored && parentOffset > 0) {
153
- // ... and dispatch expected selection state
154
- this.view.dispatch(this.view.state.tr.setSelection(selectionBookmark.resolve(this.view.state.tr.doc)));
155
- }
156
- });
135
+ // ... and capture parent offset before DOM change
136
+ if (((_this$view$state$sele = this.view.state.selection) === null || _this$view$state$sele === void 0 ? void 0 : _this$view$state$sele.ranges.length) > 0) {
137
+ var _this$view$state$sele2, _this$view$state$sele3, _this$view$state$sele4;
138
+ parentOffset = (_this$view$state$sele2 = (_this$view$state$sele3 = this.view.state.selection) === null || _this$view$state$sele3 === void 0 ? void 0 : (_this$view$state$sele4 = _this$view$state$sele3.ranges[0].$from) === null || _this$view$state$sele4 === void 0 ? void 0 : _this$view$state$sele4.parentOffset) !== null && _this$view$state$sele2 !== void 0 ? _this$view$state$sele2 : 0;
157
139
  }
140
+ node.appendChild(contentDOM);
141
+ requestAnimationFrame(() => {
142
+ // Reset ignoreMutation after frame ....
143
+ // @ts-ignore - this may not have been declared by implementing class
144
+ this.ignoreMutation = oldIgnoreMutation;
145
+
146
+ // only trigger selection re-sync if the selection is not at the start of the
147
+ // node, and DOM mutations were ignored
148
+ if (selectionBookmark && mutationsIgnored && parentOffset > 0) {
149
+ // ... and dispatch expected selection state
150
+ this.view.dispatch(this.view.state.tr.setSelection(selectionBookmark.resolve(this.view.state.tr.doc)));
151
+ }
152
+ });
158
153
  }
159
154
  }
160
155
  render(props, forwardRef) {
@@ -14,7 +14,7 @@ import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
14
14
  import { N0, N50A, N60A, N900 } from '@atlaskit/theme/colors';
15
15
  import Layer from '../Layer';
16
16
  const packageName = "@atlaskit/editor-common";
17
- const packageVersion = "92.1.1";
17
+ const packageVersion = "92.1.2";
18
18
  const halfFocusRing = 1;
19
19
  const dropOffset = '0, 8';
20
20
  class DropList extends Component {
@@ -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 = "92.1.1";
10
+ var packageVersion = "92.1.2";
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
@@ -3,7 +3,6 @@ import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
3
3
  import _createClass from "@babel/runtime/helpers/createClass";
4
4
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
5
5
  import React from 'react';
6
- import { fg } from '@atlaskit/platform-feature-flags';
7
6
  import { ACTION_SUBJECT, ACTION_SUBJECT_ID } from '../analytics';
8
7
  import { createDispatch } from '../event-dispatcher';
9
8
  import { ErrorBoundary } from '../ui/ErrorBoundary';
@@ -132,48 +131,44 @@ var ReactNodeView = /*#__PURE__*/function () {
132
131
 
133
132
  // move the contentDOM node inside the inner reference after rendering
134
133
  if (node && contentDOM && !node.contains(contentDOM)) {
135
- if (fg('platform_editor_react_18_prosemirror_sel_resync')) {
136
- var _this$view$state$sele;
137
- // @ts-ignore - ignoreMutation may not be declared
138
- oldIgnoreMutation = this.ignoreMutation; // store ref to previous ignoreMutation
134
+ var _this$view$state$sele;
135
+ // @ts-ignore - ignoreMutation may not be declared
136
+ oldIgnoreMutation = this.ignoreMutation; // store ref to previous ignoreMutation
139
137
 
140
- // ignore all mutations caused by ProseMirror's MutationObserver triggering
141
- // after DOM change, except selection changes
142
- // @ts-ignore ProseMirror adds selection type to MutationRecord
143
- this.ignoreMutation = function (m) {
144
- var isSelectionMutation = m.type === 'selection';
145
- if (!isSelectionMutation) {
146
- mutationsIgnored = true;
147
- }
148
- return !isSelectionMutation;
149
- };
150
-
151
- // capture document selection state before React DOM changes triggers ProseMirror selection change transaction
152
- if (this.view.state.selection.visible) {
153
- selectionBookmark = this.view.state.selection.getBookmark();
138
+ // ignore all mutations caused by ProseMirror's MutationObserver triggering
139
+ // after DOM change, except selection changes
140
+ // @ts-ignore ProseMirror adds selection type to MutationRecord
141
+ this.ignoreMutation = function (m) {
142
+ var isSelectionMutation = m.type === 'selection';
143
+ if (!isSelectionMutation) {
144
+ mutationsIgnored = true;
154
145
  }
146
+ return !isSelectionMutation;
147
+ };
155
148
 
156
- // ... and capture parent offset before DOM change
157
- if (((_this$view$state$sele = this.view.state.selection) === null || _this$view$state$sele === void 0 ? void 0 : _this$view$state$sele.ranges.length) > 0) {
158
- var _this$view$state$sele2, _this$view$state$sele3;
159
- parentOffset = (_this$view$state$sele2 = (_this$view$state$sele3 = this.view.state.selection) === null || _this$view$state$sele3 === void 0 || (_this$view$state$sele3 = _this$view$state$sele3.ranges[0].$from) === null || _this$view$state$sele3 === void 0 ? void 0 : _this$view$state$sele3.parentOffset) !== null && _this$view$state$sele2 !== void 0 ? _this$view$state$sele2 : 0;
160
- }
149
+ // capture document selection state before React DOM changes triggers ProseMirror selection change transaction
150
+ if (this.view.state.selection.visible) {
151
+ selectionBookmark = this.view.state.selection.getBookmark();
161
152
  }
162
- node.appendChild(contentDOM);
163
- if (fg('platform_editor_react_18_prosemirror_sel_resync')) {
164
- requestAnimationFrame(function () {
165
- // Reset ignoreMutation after frame ....
166
- // @ts-ignore - this may not have been declared by implementing class
167
- _this4.ignoreMutation = oldIgnoreMutation;
168
153
 
169
- // only trigger selection re-sync if the selection is not at the start of the
170
- // node, and DOM mutations were ignored
171
- if (selectionBookmark && mutationsIgnored && parentOffset > 0) {
172
- // ... and dispatch expected selection state
173
- _this4.view.dispatch(_this4.view.state.tr.setSelection(selectionBookmark.resolve(_this4.view.state.tr.doc)));
174
- }
175
- });
154
+ // ... and capture parent offset before DOM change
155
+ if (((_this$view$state$sele = this.view.state.selection) === null || _this$view$state$sele === void 0 ? void 0 : _this$view$state$sele.ranges.length) > 0) {
156
+ var _this$view$state$sele2, _this$view$state$sele3;
157
+ parentOffset = (_this$view$state$sele2 = (_this$view$state$sele3 = this.view.state.selection) === null || _this$view$state$sele3 === void 0 || (_this$view$state$sele3 = _this$view$state$sele3.ranges[0].$from) === null || _this$view$state$sele3 === void 0 ? void 0 : _this$view$state$sele3.parentOffset) !== null && _this$view$state$sele2 !== void 0 ? _this$view$state$sele2 : 0;
176
158
  }
159
+ node.appendChild(contentDOM);
160
+ requestAnimationFrame(function () {
161
+ // Reset ignoreMutation after frame ....
162
+ // @ts-ignore - this may not have been declared by implementing class
163
+ _this4.ignoreMutation = oldIgnoreMutation;
164
+
165
+ // only trigger selection re-sync if the selection is not at the start of the
166
+ // node, and DOM mutations were ignored
167
+ if (selectionBookmark && mutationsIgnored && parentOffset > 0) {
168
+ // ... and dispatch expected selection state
169
+ _this4.view.dispatch(_this4.view.state.tr.setSelection(selectionBookmark.resolve(_this4.view.state.tr.doc)));
170
+ }
171
+ });
177
172
  }
178
173
  }
179
174
  }, {
@@ -22,7 +22,7 @@ import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
22
22
  import { N0, N50A, N60A, N900 } from '@atlaskit/theme/colors';
23
23
  import Layer from '../Layer';
24
24
  var packageName = "@atlaskit/editor-common";
25
- var packageVersion = "92.1.1";
25
+ var packageVersion = "92.1.2";
26
26
  var halfFocusRing = 1;
27
27
  var dropOffset = '0, 8';
28
28
  var DropList = /*#__PURE__*/function (_Component) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "92.1.1",
3
+ "version": "92.1.2",
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/"
@@ -128,7 +128,7 @@
128
128
  "@atlaskit/icon": "^22.20.0",
129
129
  "@atlaskit/icon-object": "^6.5.0",
130
130
  "@atlaskit/link-datasource": "^3.2.0",
131
- "@atlaskit/link-picker": "^1.46.0",
131
+ "@atlaskit/link-picker": "^1.47.0",
132
132
  "@atlaskit/media-card": "^78.5.0",
133
133
  "@atlaskit/media-client": "^28.0.0",
134
134
  "@atlaskit/media-client-react": "^2.2.0",
@@ -267,9 +267,6 @@
267
267
  "cc_page_experiences_live_search_wysiwyg": {
268
268
  "type": "boolean"
269
269
  },
270
- "platform_editor_react_18_prosemirror_sel_resync": {
271
- "type": "boolean"
272
- },
273
270
  "platform-fix-table-ssr-resizing": {
274
271
  "type": "boolean"
275
272
  },