@atlaskit/editor-common 104.1.3 → 104.1.4
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 +10 -0
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/react-node-view/index.js +30 -11
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/react-node-view/index.js +30 -11
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/react-node-view/index.js +30 -11
- package/dist/esm/ui/DropList/index.js +1 -1
- package/package.json +5 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# @atlaskit/editor-common
|
|
2
2
|
|
|
3
|
+
## 104.1.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#149969](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/149969)
|
|
8
|
+
[`42c3f35e57188`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/42c3f35e57188) -
|
|
9
|
+
ED-27882: Get rid of parent offset check in \_handleRef in the react node view. Add metadata to
|
|
10
|
+
these calls in the \_handleRef and \_handleTableRef.
|
|
11
|
+
- Updated dependencies
|
|
12
|
+
|
|
3
13
|
## 104.1.3
|
|
4
14
|
|
|
5
15
|
### 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 = "104.1.
|
|
20
|
+
var packageVersion = "104.1.4";
|
|
21
21
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
22
22
|
// Remove URL as it has UGC
|
|
23
23
|
// Ignored via go/ees007
|
|
@@ -22,6 +22,7 @@ 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");
|
|
25
26
|
var _analytics = require("../analytics");
|
|
26
27
|
var _eventDispatcher = require("../event-dispatcher");
|
|
27
28
|
var _ErrorBoundary = require("../ui/ErrorBoundary");
|
|
@@ -159,13 +160,12 @@ var ReactNodeView = exports.default = /*#__PURE__*/function () {
|
|
|
159
160
|
// Ignored via go/ees005
|
|
160
161
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
161
162
|
var oldIgnoreMutation;
|
|
163
|
+
var parentOffset = 0; // Remove with feature gate: platform_editor_r18_fix_selection_resync
|
|
162
164
|
var selectionBookmark;
|
|
163
|
-
var parentOffset = 0;
|
|
164
165
|
var mutationsIgnored = false;
|
|
165
166
|
|
|
166
167
|
// move the contentDOM node inside the inner reference after rendering
|
|
167
168
|
if (node && contentDOM && !node.contains(contentDOM)) {
|
|
168
|
-
var _this$view$state$sele;
|
|
169
169
|
// @ts-ignore - ignoreMutation may not be declared
|
|
170
170
|
oldIgnoreMutation = this.ignoreMutation; // store ref to previous ignoreMutation
|
|
171
171
|
|
|
@@ -186,21 +186,40 @@ var ReactNodeView = exports.default = /*#__PURE__*/function () {
|
|
|
186
186
|
}
|
|
187
187
|
|
|
188
188
|
// ... and capture parent offset before DOM change
|
|
189
|
-
if ((
|
|
190
|
-
var _this$view$state$
|
|
191
|
-
|
|
189
|
+
if (!(0, _platformFeatureFlags.fg)('platform_editor_r18_fix_selection_resync')) {
|
|
190
|
+
var _this$view$state$sele;
|
|
191
|
+
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) {
|
|
192
|
+
var _this$view$state$sele2, _this$view$state$sele3;
|
|
193
|
+
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;
|
|
194
|
+
}
|
|
192
195
|
}
|
|
193
196
|
node.appendChild(contentDOM);
|
|
197
|
+
|
|
198
|
+
// After the next frame:
|
|
194
199
|
requestAnimationFrame(function () {
|
|
195
|
-
//
|
|
200
|
+
// Restore the original mutation handler
|
|
196
201
|
// @ts-ignore - this may not have been declared by implementing class
|
|
197
202
|
_this4.ignoreMutation = oldIgnoreMutation;
|
|
198
203
|
|
|
199
|
-
//
|
|
200
|
-
//
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
+
// Restore the selection only if:
|
|
205
|
+
// - We have a selection bookmark
|
|
206
|
+
// - Mutations were ignored during the table move
|
|
207
|
+
// - The bookmarked selection is different from the current selection.
|
|
208
|
+
if (selectionBookmark && mutationsIgnored) {
|
|
209
|
+
if ((0, _platformFeatureFlags.fg)('platform_editor_r18_fix_selection_resync')) {
|
|
210
|
+
var resolvedSelection = selectionBookmark.resolve(_this4.view.state.tr.doc);
|
|
211
|
+
// Don't set the selection if it's the same as the current selection.
|
|
212
|
+
if (!resolvedSelection.eq(_this4.view.state.selection)) {
|
|
213
|
+
var tr = _this4.view.state.tr.setSelection(resolvedSelection);
|
|
214
|
+
tr.setMeta('source', 'ReactNodeView:_handleRef:selection-resync');
|
|
215
|
+
_this4.view.dispatch(tr);
|
|
216
|
+
}
|
|
217
|
+
} else {
|
|
218
|
+
if (parentOffset > 0) {
|
|
219
|
+
// ... and dispatch expected selection state
|
|
220
|
+
_this4.view.dispatch(_this4.view.state.tr.setSelection(selectionBookmark.resolve(_this4.view.state.tr.doc)));
|
|
221
|
+
}
|
|
222
|
+
}
|
|
204
223
|
}
|
|
205
224
|
});
|
|
206
225
|
}
|
|
@@ -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 = "104.1.
|
|
26
|
+
var packageVersion = "104.1.4";
|
|
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 = "104.1.
|
|
4
|
+
const packageVersion = "104.1.4";
|
|
5
5
|
const sanitiseSentryEvents = (data, _hint) => {
|
|
6
6
|
// Remove URL as it has UGC
|
|
7
7
|
// Ignored via go/ees007
|
|
@@ -4,6 +4,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
4
4
|
/* eslint-disable @atlaskit/editor/no-re-export */
|
|
5
5
|
|
|
6
6
|
import React from 'react';
|
|
7
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
7
8
|
import { ACTION_SUBJECT, ACTION_SUBJECT_ID } from '../analytics';
|
|
8
9
|
import { createDispatch } from '../event-dispatcher';
|
|
9
10
|
import { ErrorBoundary } from '../ui/ErrorBoundary';
|
|
@@ -122,13 +123,12 @@ export default class ReactNodeView {
|
|
|
122
123
|
// Ignored via go/ees005
|
|
123
124
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
124
125
|
let oldIgnoreMutation;
|
|
126
|
+
let parentOffset = 0; // Remove with feature gate: platform_editor_r18_fix_selection_resync
|
|
125
127
|
let selectionBookmark;
|
|
126
|
-
let parentOffset = 0;
|
|
127
128
|
let mutationsIgnored = false;
|
|
128
129
|
|
|
129
130
|
// move the contentDOM node inside the inner reference after rendering
|
|
130
131
|
if (node && contentDOM && !node.contains(contentDOM)) {
|
|
131
|
-
var _this$view$state$sele;
|
|
132
132
|
// @ts-ignore - ignoreMutation may not be declared
|
|
133
133
|
oldIgnoreMutation = this.ignoreMutation; // store ref to previous ignoreMutation
|
|
134
134
|
|
|
@@ -149,21 +149,40 @@ export default class ReactNodeView {
|
|
|
149
149
|
}
|
|
150
150
|
|
|
151
151
|
// ... and capture parent offset before DOM change
|
|
152
|
-
if ((
|
|
153
|
-
var _this$view$state$
|
|
154
|
-
|
|
152
|
+
if (!fg('platform_editor_r18_fix_selection_resync')) {
|
|
153
|
+
var _this$view$state$sele;
|
|
154
|
+
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) {
|
|
155
|
+
var _this$view$state$sele2, _this$view$state$sele3, _this$view$state$sele4;
|
|
156
|
+
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
|
+
}
|
|
155
158
|
}
|
|
156
159
|
node.appendChild(contentDOM);
|
|
160
|
+
|
|
161
|
+
// After the next frame:
|
|
157
162
|
requestAnimationFrame(() => {
|
|
158
|
-
//
|
|
163
|
+
// Restore the original mutation handler
|
|
159
164
|
// @ts-ignore - this may not have been declared by implementing class
|
|
160
165
|
this.ignoreMutation = oldIgnoreMutation;
|
|
161
166
|
|
|
162
|
-
//
|
|
163
|
-
//
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
+
// Restore the selection only if:
|
|
168
|
+
// - We have a selection bookmark
|
|
169
|
+
// - Mutations were ignored during the table move
|
|
170
|
+
// - The bookmarked selection is different from the current selection.
|
|
171
|
+
if (selectionBookmark && mutationsIgnored) {
|
|
172
|
+
if (fg('platform_editor_r18_fix_selection_resync')) {
|
|
173
|
+
const resolvedSelection = selectionBookmark.resolve(this.view.state.tr.doc);
|
|
174
|
+
// Don't set the selection if it's the same as the current selection.
|
|
175
|
+
if (!resolvedSelection.eq(this.view.state.selection)) {
|
|
176
|
+
const tr = this.view.state.tr.setSelection(resolvedSelection);
|
|
177
|
+
tr.setMeta('source', 'ReactNodeView:_handleRef:selection-resync');
|
|
178
|
+
this.view.dispatch(tr);
|
|
179
|
+
}
|
|
180
|
+
} else {
|
|
181
|
+
if (parentOffset > 0) {
|
|
182
|
+
// ... and dispatch expected selection state
|
|
183
|
+
this.view.dispatch(this.view.state.tr.setSelection(selectionBookmark.resolve(this.view.state.tr.doc)));
|
|
184
|
+
}
|
|
185
|
+
}
|
|
167
186
|
}
|
|
168
187
|
});
|
|
169
188
|
}
|
|
@@ -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 = "104.1.
|
|
16
|
+
const packageVersion = "104.1.4";
|
|
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 = "104.1.
|
|
10
|
+
var packageVersion = "104.1.4";
|
|
11
11
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
12
12
|
// Remove URL as it has UGC
|
|
13
13
|
// Ignored via go/ees007
|
|
@@ -6,6 +6,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
6
6
|
/* eslint-disable @atlaskit/editor/no-re-export */
|
|
7
7
|
|
|
8
8
|
import React from 'react';
|
|
9
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
9
10
|
import { ACTION_SUBJECT, ACTION_SUBJECT_ID } from '../analytics';
|
|
10
11
|
import { createDispatch } from '../event-dispatcher';
|
|
11
12
|
import { ErrorBoundary } from '../ui/ErrorBoundary';
|
|
@@ -141,13 +142,12 @@ var ReactNodeView = /*#__PURE__*/function () {
|
|
|
141
142
|
// Ignored via go/ees005
|
|
142
143
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
143
144
|
var oldIgnoreMutation;
|
|
145
|
+
var parentOffset = 0; // Remove with feature gate: platform_editor_r18_fix_selection_resync
|
|
144
146
|
var selectionBookmark;
|
|
145
|
-
var parentOffset = 0;
|
|
146
147
|
var mutationsIgnored = false;
|
|
147
148
|
|
|
148
149
|
// move the contentDOM node inside the inner reference after rendering
|
|
149
150
|
if (node && contentDOM && !node.contains(contentDOM)) {
|
|
150
|
-
var _this$view$state$sele;
|
|
151
151
|
// @ts-ignore - ignoreMutation may not be declared
|
|
152
152
|
oldIgnoreMutation = this.ignoreMutation; // store ref to previous ignoreMutation
|
|
153
153
|
|
|
@@ -168,21 +168,40 @@ var ReactNodeView = /*#__PURE__*/function () {
|
|
|
168
168
|
}
|
|
169
169
|
|
|
170
170
|
// ... and capture parent offset before DOM change
|
|
171
|
-
if ((
|
|
172
|
-
var _this$view$state$
|
|
173
|
-
|
|
171
|
+
if (!fg('platform_editor_r18_fix_selection_resync')) {
|
|
172
|
+
var _this$view$state$sele;
|
|
173
|
+
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) {
|
|
174
|
+
var _this$view$state$sele2, _this$view$state$sele3;
|
|
175
|
+
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
|
+
}
|
|
174
177
|
}
|
|
175
178
|
node.appendChild(contentDOM);
|
|
179
|
+
|
|
180
|
+
// After the next frame:
|
|
176
181
|
requestAnimationFrame(function () {
|
|
177
|
-
//
|
|
182
|
+
// Restore the original mutation handler
|
|
178
183
|
// @ts-ignore - this may not have been declared by implementing class
|
|
179
184
|
_this4.ignoreMutation = oldIgnoreMutation;
|
|
180
185
|
|
|
181
|
-
//
|
|
182
|
-
//
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
+
// Restore the selection only if:
|
|
187
|
+
// - We have a selection bookmark
|
|
188
|
+
// - Mutations were ignored during the table move
|
|
189
|
+
// - The bookmarked selection is different from the current selection.
|
|
190
|
+
if (selectionBookmark && mutationsIgnored) {
|
|
191
|
+
if (fg('platform_editor_r18_fix_selection_resync')) {
|
|
192
|
+
var resolvedSelection = selectionBookmark.resolve(_this4.view.state.tr.doc);
|
|
193
|
+
// Don't set the selection if it's the same as the current selection.
|
|
194
|
+
if (!resolvedSelection.eq(_this4.view.state.selection)) {
|
|
195
|
+
var tr = _this4.view.state.tr.setSelection(resolvedSelection);
|
|
196
|
+
tr.setMeta('source', 'ReactNodeView:_handleRef:selection-resync');
|
|
197
|
+
_this4.view.dispatch(tr);
|
|
198
|
+
}
|
|
199
|
+
} else {
|
|
200
|
+
if (parentOffset > 0) {
|
|
201
|
+
// ... and dispatch expected selection state
|
|
202
|
+
_this4.view.dispatch(_this4.view.state.tr.setSelection(selectionBookmark.resolve(_this4.view.state.tr.doc)));
|
|
203
|
+
}
|
|
204
|
+
}
|
|
186
205
|
}
|
|
187
206
|
});
|
|
188
207
|
}
|
|
@@ -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 = "104.1.
|
|
23
|
+
var packageVersion = "104.1.4";
|
|
24
24
|
var halfFocusRing = 1;
|
|
25
25
|
var dropOffset = '0, 8';
|
|
26
26
|
// Ignored via go/ees005
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-common",
|
|
3
|
-
"version": "104.1.
|
|
3
|
+
"version": "104.1.4",
|
|
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/"
|
|
@@ -157,7 +157,7 @@
|
|
|
157
157
|
"@atlaskit/platform-feature-flags-react": "^0.2.0",
|
|
158
158
|
"@atlaskit/popper": "^7.0.0",
|
|
159
159
|
"@atlaskit/primitives": "^14.7.0",
|
|
160
|
-
"@atlaskit/profilecard": "^23.
|
|
160
|
+
"@atlaskit/profilecard": "^23.11.0",
|
|
161
161
|
"@atlaskit/react-ufo": "^3.10.0",
|
|
162
162
|
"@atlaskit/section-message": "^8.2.0",
|
|
163
163
|
"@atlaskit/smart-card": "^37.1.0",
|
|
@@ -378,6 +378,9 @@
|
|
|
378
378
|
},
|
|
379
379
|
"platform_editor_controls_patch_analytics": {
|
|
380
380
|
"type": "boolean"
|
|
381
|
+
},
|
|
382
|
+
"platform_editor_r18_fix_selection_resync": {
|
|
383
|
+
"type": "boolean"
|
|
381
384
|
}
|
|
382
385
|
}
|
|
383
386
|
}
|