@atlaskit/editor-common 111.32.1 → 111.34.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 +27 -0
- package/dist/cjs/messages/block-type.js +5 -0
- package/dist/cjs/messages/codeBlock.js +19 -0
- package/dist/cjs/messages/index.js +14 -0
- package/dist/cjs/messages/roleDescription.js +14 -0
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/cjs/ui/OverflowShadow/shadowObserver.js +7 -0
- package/dist/cjs/utils/document.js +63 -6
- package/dist/es2019/messages/block-type.js +5 -0
- package/dist/es2019/messages/codeBlock.js +13 -0
- package/dist/es2019/messages/index.js +2 -0
- package/dist/es2019/messages/roleDescription.js +8 -0
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/es2019/ui/OverflowShadow/shadowObserver.js +7 -0
- package/dist/es2019/utils/document.js +40 -6
- package/dist/esm/messages/block-type.js +5 -0
- package/dist/esm/messages/codeBlock.js +13 -0
- package/dist/esm/messages/index.js +2 -0
- package/dist/esm/messages/roleDescription.js +8 -0
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/esm/ui/OverflowShadow/shadowObserver.js +7 -0
- package/dist/esm/utils/document.js +63 -6
- package/dist/types/messages/block-type.d.ts +5 -0
- package/dist/types/messages/codeBlock.d.ts +12 -0
- package/dist/types/messages/index.d.ts +2 -0
- package/dist/types/messages/roleDescription.d.ts +7 -0
- package/dist/types/utils/document.d.ts +4 -1
- package/dist/types/utils/list.d.ts +5 -1
- package/dist/types-ts4.5/messages/block-type.d.ts +5 -0
- package/dist/types-ts4.5/messages/codeBlock.d.ts +12 -0
- package/dist/types-ts4.5/messages/index.d.ts +2 -0
- package/dist/types-ts4.5/messages/roleDescription.d.ts +7 -0
- package/dist/types-ts4.5/utils/document.d.ts +4 -1
- package/dist/types-ts4.5/utils/list.d.ts +5 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,32 @@
|
|
|
1
1
|
# @atlaskit/editor-common
|
|
2
2
|
|
|
3
|
+
## 111.34.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`dd5154ad0dec5`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/dd5154ad0dec5) -
|
|
8
|
+
[A11Y-10416] Add new i18n message for codeblock aria descriptions around textboc roles
|
|
9
|
+
|
|
10
|
+
### Patch Changes
|
|
11
|
+
|
|
12
|
+
- [`c15b7a3426c66`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/c15b7a3426c66) -
|
|
13
|
+
[ux] EDITOR-5626 Flexible list behaviour
|
|
14
|
+
- [`29e8db48dc55b`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/29e8db48dc55b) -
|
|
15
|
+
[ux] EDITOR-5622 Remove sentinels when shadowObserver is cleaned up
|
|
16
|
+
- Updated dependencies
|
|
17
|
+
|
|
18
|
+
## 111.33.0
|
|
19
|
+
|
|
20
|
+
### Minor Changes
|
|
21
|
+
|
|
22
|
+
- [`e7825d1698274`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/e7825d1698274) -
|
|
23
|
+
Improve areNodesEqualIgnoreAttrs by adding option ignoreMarkOrder which ensures the order of the
|
|
24
|
+
marks does not result in a "false" which can break some cases of diffs.
|
|
25
|
+
|
|
26
|
+
### Patch Changes
|
|
27
|
+
|
|
28
|
+
- Updated dependencies
|
|
29
|
+
|
|
3
30
|
## 111.32.1
|
|
4
31
|
|
|
5
32
|
### Patch Changes
|
|
@@ -178,6 +178,11 @@ var messages = exports.messages = (0, _reactIntlNext.defineMessages)({
|
|
|
178
178
|
defaultMessage: 'Panel',
|
|
179
179
|
description: 'Visually distinguishes your text by adding a panel'
|
|
180
180
|
},
|
|
181
|
+
textBoxAriaLabel: {
|
|
182
|
+
id: 'fabric.editor.aria.textbox',
|
|
183
|
+
defaultMessage: 'textbox',
|
|
184
|
+
description: 'This is the definition of the HTML role textbox, it needs to be translated in the same way that a textbox with a HTML role of textbox'
|
|
185
|
+
},
|
|
181
186
|
other: {
|
|
182
187
|
id: 'fabric.editor.other',
|
|
183
188
|
defaultMessage: 'Others...',
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.codeBlockMessages = void 0;
|
|
7
|
+
var _reactIntlNext = require("react-intl-next");
|
|
8
|
+
var codeBlockMessages = exports.codeBlockMessages = (0, _reactIntlNext.defineMessages)({
|
|
9
|
+
codeblockLanguageAriaDescription: {
|
|
10
|
+
id: 'fabric.editor.codeBlock.languageAriaDescription',
|
|
11
|
+
defaultMessage: 'Code snippet language: {language}.',
|
|
12
|
+
description: 'A short message that provides information about what code language is being used in a code block for accessibility purposes, punctuation mark at the end as another message comes after'
|
|
13
|
+
},
|
|
14
|
+
codeBlockLanguageNotSet: {
|
|
15
|
+
id: 'fabric.editor.codeBlock.languageNotSet',
|
|
16
|
+
defaultMessage: 'Code language not set.',
|
|
17
|
+
description: 'A short message that provides information that the code block language has not been set for accessibility purposes, punctuation mark at the end as another message comes after'
|
|
18
|
+
}
|
|
19
|
+
});
|
|
@@ -63,6 +63,12 @@ Object.defineProperty(exports, "codeBlockButtonMessages", {
|
|
|
63
63
|
return _codeBlockButton.codeBlockButtonMessages;
|
|
64
64
|
}
|
|
65
65
|
});
|
|
66
|
+
Object.defineProperty(exports, "codeBlockMessages", {
|
|
67
|
+
enumerable: true,
|
|
68
|
+
get: function get() {
|
|
69
|
+
return _codeBlock.codeBlockMessages;
|
|
70
|
+
}
|
|
71
|
+
});
|
|
66
72
|
Object.defineProperty(exports, "colorPickerButtonMessages", {
|
|
67
73
|
enumerable: true,
|
|
68
74
|
get: function get() {
|
|
@@ -196,6 +202,12 @@ Object.defineProperty(exports, "placeholderTextMessages", {
|
|
|
196
202
|
return _placeholderText.placeholderTextMessages;
|
|
197
203
|
}
|
|
198
204
|
});
|
|
205
|
+
Object.defineProperty(exports, "roleDescriptionMessages", {
|
|
206
|
+
enumerable: true,
|
|
207
|
+
get: function get() {
|
|
208
|
+
return _roleDescription.roleDescriptionMessages;
|
|
209
|
+
}
|
|
210
|
+
});
|
|
199
211
|
Object.defineProperty(exports, "selectionExtensionMessages", {
|
|
200
212
|
enumerable: true,
|
|
201
213
|
get: function get() {
|
|
@@ -279,6 +291,7 @@ var _colorPickerButton = require("./color-picker-button");
|
|
|
279
291
|
var _link = require("./link");
|
|
280
292
|
var _linkToolbar = require("./link-toolbar");
|
|
281
293
|
var _unsupportedContent = require("./unsupportedContent");
|
|
294
|
+
var _codeBlock = require("./codeBlock");
|
|
282
295
|
var _codeBlockButton = require("./codeBlockButton");
|
|
283
296
|
var _insertBlock = require("./insert-block");
|
|
284
297
|
var _mediaAndEmbedToolbar = require("./media-and-embed-toolbar");
|
|
@@ -310,6 +323,7 @@ var _selectionExtension = require("./selection-extension");
|
|
|
310
323
|
var _selectionToolbar = require("./selection-toolbar");
|
|
311
324
|
var _contextPanel = require("./context-panel");
|
|
312
325
|
var _trackChanges = require("./track-changes");
|
|
326
|
+
var _roleDescription = require("./roleDescription");
|
|
313
327
|
var _syncBlock = require("./syncBlock");
|
|
314
328
|
var _limitedMode = require("./limited-mode");
|
|
315
329
|
var _companyHubTextColor = require("./company-hub-text-color");
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.roleDescriptionMessages = void 0;
|
|
7
|
+
var _reactIntlNext = require("react-intl-next");
|
|
8
|
+
var roleDescriptionMessages = exports.roleDescriptionMessages = (0, _reactIntlNext.defineMessages)({
|
|
9
|
+
codeSnippetTextBox: {
|
|
10
|
+
id: 'fabric.editor.ariaRoleDescription.codeSnippetTextBox',
|
|
11
|
+
defaultMessage: 'codesnippet textbox',
|
|
12
|
+
description: 'Aria role description for code snippet textbox. We are overriding the HTML role textbox so the translation should match the translation of the HTML role textbox in the language being used, but with "code snippet" added to the beginning to differentiate it from a regular textbox.'
|
|
13
|
+
}
|
|
14
|
+
});
|
|
@@ -19,7 +19,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
19
19
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
20
20
|
var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
21
21
|
var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
22
|
-
var packageVersion = "
|
|
22
|
+
var packageVersion = "111.33.0";
|
|
23
23
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
24
24
|
// Remove URL as it has UGC
|
|
25
25
|
// Ignored via go/ees007
|
|
@@ -24,7 +24,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
|
|
|
24
24
|
* @jsx jsx
|
|
25
25
|
*/ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
26
26
|
var packageName = "@atlaskit/editor-common";
|
|
27
|
-
var packageVersion = "
|
|
27
|
+
var packageVersion = "111.33.0";
|
|
28
28
|
var halfFocusRing = 1;
|
|
29
29
|
var dropOffset = '0, 8';
|
|
30
30
|
var fadeIn = (0, _react2.keyframes)({
|
|
@@ -8,6 +8,7 @@ exports.shadowObserverClassNames = exports.ShadowObserver = exports.ShadowKeys =
|
|
|
8
8
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
9
9
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
10
10
|
var _defineProperty3 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
+
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
11
12
|
var ShadowKeys = exports.ShadowKeys = /*#__PURE__*/function (ShadowKeys) {
|
|
12
13
|
ShadowKeys["SHOW_LEFT_SHADOW"] = "showLeftShadow";
|
|
13
14
|
ShadowKeys["SHOW_RIGHT_SHADOW"] = "showRightShadow";
|
|
@@ -84,6 +85,12 @@ var ShadowObserver = exports.ShadowObserver = /*#__PURE__*/function () {
|
|
|
84
85
|
this.intersectionObserver = undefined;
|
|
85
86
|
this.requestCallbackId && cancelIdleCallback(this.requestCallbackId);
|
|
86
87
|
}
|
|
88
|
+
if ((0, _expValEquals.expValEquals)('platform_editor_renderer_shadow_observer_cleanup', 'isEnabled', true)) {
|
|
89
|
+
var _this$sentinels$left, _this$sentinels$right;
|
|
90
|
+
(_this$sentinels$left = this.sentinels.left) === null || _this$sentinels$left === void 0 || _this$sentinels$left.remove();
|
|
91
|
+
(_this$sentinels$right = this.sentinels.right) === null || _this$sentinels$right === void 0 || _this$sentinels$right.remove();
|
|
92
|
+
this.sentinels = {};
|
|
93
|
+
}
|
|
87
94
|
}
|
|
88
95
|
}]);
|
|
89
96
|
}();
|
|
@@ -15,7 +15,11 @@ exports.isSelectionEndOfParagraph = exports.isReplaceDocOperation = void 0;
|
|
|
15
15
|
exports.nodesBetweenChanged = nodesBetweenChanged;
|
|
16
16
|
var _clamp = _interopRequireDefault(require("lodash/clamp"));
|
|
17
17
|
var _transform = require("@atlaskit/editor-prosemirror/transform");
|
|
18
|
+
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
18
19
|
var _editorCoreUtils = require("./editor-core-utils");
|
|
20
|
+
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
|
|
21
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
22
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
19
23
|
var getStepRange = exports.getStepRange = function getStepRange(transaction) {
|
|
20
24
|
var from = -1;
|
|
21
25
|
var to = -1;
|
|
@@ -150,7 +154,44 @@ var isReplaceDocOperation = exports.isReplaceDocOperation = function isReplaceDo
|
|
|
150
154
|
return hasStepReplacingEntireDocument;
|
|
151
155
|
});
|
|
152
156
|
};
|
|
153
|
-
|
|
157
|
+
function marksEqualInOrder(m1, m2) {
|
|
158
|
+
if (m1.length !== m2.length) return false;
|
|
159
|
+
return m1.every(function (m, i) {
|
|
160
|
+
return m.eq(m2[i]);
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
function marksEqualIgnoringOrder(m1, m2) {
|
|
164
|
+
if (m1.length !== m2.length) {
|
|
165
|
+
return false;
|
|
166
|
+
}
|
|
167
|
+
var m2Used = new Set();
|
|
168
|
+
var _iterator = _createForOfIteratorHelper(m1),
|
|
169
|
+
_step;
|
|
170
|
+
try {
|
|
171
|
+
var _loop = function _loop() {
|
|
172
|
+
var mark1 = _step.value;
|
|
173
|
+
var idx = m2.findIndex(function (mark2, i) {
|
|
174
|
+
return !m2Used.has(i) && mark1.eq(mark2);
|
|
175
|
+
});
|
|
176
|
+
if (idx === -1) {
|
|
177
|
+
return {
|
|
178
|
+
v: false
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
m2Used.add(idx);
|
|
182
|
+
},
|
|
183
|
+
_ret;
|
|
184
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
185
|
+
_ret = _loop();
|
|
186
|
+
if (_ret) return _ret.v;
|
|
187
|
+
}
|
|
188
|
+
} catch (err) {
|
|
189
|
+
_iterator.e(err);
|
|
190
|
+
} finally {
|
|
191
|
+
_iterator.f();
|
|
192
|
+
}
|
|
193
|
+
return true;
|
|
194
|
+
}
|
|
154
195
|
/**
|
|
155
196
|
* Compares two ProseMirror documents for equality, ignoring attributes
|
|
156
197
|
* which don't affect the document structure.
|
|
@@ -160,16 +201,28 @@ var isReplaceDocOperation = exports.isReplaceDocOperation = function isReplaceDo
|
|
|
160
201
|
* @param doc1 PMNode
|
|
161
202
|
* @param doc2 PMNode
|
|
162
203
|
* @param attributesToIgnore Specific array of attribute keys to ignore - defaults to ignoring all
|
|
204
|
+
* @param opts.ignoreMarkOrder If mark order should be ignored to still be equal (e.g. reversed annotation marks). When not provided, controlled by platform_editor_are_nodes_equal_ignore_mark_order feature gate (defaults to true when gate is on).
|
|
163
205
|
* @returns boolean
|
|
164
206
|
*/
|
|
165
|
-
|
|
207
|
+
|
|
208
|
+
function areNodesEqualIgnoreAttrs(node1, node2, attributesToIgnore, opts) {
|
|
209
|
+
var _opts$ignoreMarkOrder;
|
|
210
|
+
var ignoreMarkOrder = (_opts$ignoreMarkOrder = opts === null || opts === void 0 ? void 0 : opts.ignoreMarkOrder) !== null && _opts$ignoreMarkOrder !== void 0 ? _opts$ignoreMarkOrder : (0, _expValEquals.expValEquals)('platform_editor_are_nodes_equal_ignore_mark_order', 'isEnabled', true);
|
|
166
211
|
if (node1.isText) {
|
|
212
|
+
if (ignoreMarkOrder) {
|
|
213
|
+
return node1.text === node2.text && marksEqualIgnoringOrder(node1.marks, node2.marks);
|
|
214
|
+
}
|
|
167
215
|
return node1.eq(node2);
|
|
168
216
|
}
|
|
217
|
+
var marksEqual = ignoreMarkOrder ? marksEqualIgnoringOrder(node1.marks, node2.marks) : marksEqualInOrder(node1.marks, node2.marks);
|
|
169
218
|
|
|
170
219
|
// If no attributes to ignore, compare all attributes
|
|
171
220
|
if (!attributesToIgnore || attributesToIgnore.length === 0) {
|
|
172
|
-
|
|
221
|
+
if ((0, _expValEquals.expValEquals)('platform_editor_are_nodes_equal_ignore_mark_order', 'isEnabled', true)) {
|
|
222
|
+
return node1 === node2 || node1.hasMarkup(node2.type, node1.attrs, node1.marks) && marksEqual && areFragmentsEqual(node1.content, node2.content, undefined, opts);
|
|
223
|
+
} else {
|
|
224
|
+
return node1 === node2 || node1.hasMarkup(node2.type, node1.attrs, node2.marks) && areFragmentsEqual(node1.content, node2.content);
|
|
225
|
+
}
|
|
173
226
|
}
|
|
174
227
|
|
|
175
228
|
// Build attrs to compare by excluding ignored attributes
|
|
@@ -180,16 +233,20 @@ function areNodesEqualIgnoreAttrs(node1, node2, attributesToIgnore) {
|
|
|
180
233
|
attrsToCompare[key] = node1.attrs[key];
|
|
181
234
|
}
|
|
182
235
|
}
|
|
183
|
-
|
|
236
|
+
if ((0, _expValEquals.expValEquals)('platform_editor_are_nodes_equal_ignore_mark_order', 'isEnabled', true)) {
|
|
237
|
+
return node1 === node2 || node1.type === node2.type && node1.hasMarkup(node2.type, attrsToCompare, node1.marks) && marksEqual && areFragmentsEqual(node1.content, node2.content, attributesToIgnore, opts);
|
|
238
|
+
} else {
|
|
239
|
+
return node1 === node2 || node1.hasMarkup(node2.type, attrsToCompare, node2.marks) && areFragmentsEqual(node1.content, node2.content, attributesToIgnore);
|
|
240
|
+
}
|
|
184
241
|
}
|
|
185
|
-
function areFragmentsEqual(frag1, frag2, attributesToIgnore) {
|
|
242
|
+
function areFragmentsEqual(frag1, frag2, attributesToIgnore, opts) {
|
|
186
243
|
if (frag1.content.length !== frag2.content.length) {
|
|
187
244
|
return false;
|
|
188
245
|
}
|
|
189
246
|
var childrenEqual = true;
|
|
190
247
|
frag1.content.forEach(function (child, i) {
|
|
191
248
|
var otherChild = frag2.child(i);
|
|
192
|
-
if (child === otherChild || otherChild && areNodesEqualIgnoreAttrs(child, otherChild, attributesToIgnore)) {
|
|
249
|
+
if (child === otherChild || otherChild && areNodesEqualIgnoreAttrs(child, otherChild, attributesToIgnore, opts)) {
|
|
193
250
|
return;
|
|
194
251
|
}
|
|
195
252
|
childrenEqual = false;
|
|
@@ -172,6 +172,11 @@ export const messages = defineMessages({
|
|
|
172
172
|
defaultMessage: 'Panel',
|
|
173
173
|
description: 'Visually distinguishes your text by adding a panel'
|
|
174
174
|
},
|
|
175
|
+
textBoxAriaLabel: {
|
|
176
|
+
id: 'fabric.editor.aria.textbox',
|
|
177
|
+
defaultMessage: 'textbox',
|
|
178
|
+
description: 'This is the definition of the HTML role textbox, it needs to be translated in the same way that a textbox with a HTML role of textbox'
|
|
179
|
+
},
|
|
175
180
|
other: {
|
|
176
181
|
id: 'fabric.editor.other',
|
|
177
182
|
defaultMessage: 'Others...',
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { defineMessages } from 'react-intl-next';
|
|
2
|
+
export const codeBlockMessages = defineMessages({
|
|
3
|
+
codeblockLanguageAriaDescription: {
|
|
4
|
+
id: 'fabric.editor.codeBlock.languageAriaDescription',
|
|
5
|
+
defaultMessage: 'Code snippet language: {language}.',
|
|
6
|
+
description: 'A short message that provides information about what code language is being used in a code block for accessibility purposes, punctuation mark at the end as another message comes after'
|
|
7
|
+
},
|
|
8
|
+
codeBlockLanguageNotSet: {
|
|
9
|
+
id: 'fabric.editor.codeBlock.languageNotSet',
|
|
10
|
+
defaultMessage: 'Code language not set.',
|
|
11
|
+
description: 'A short message that provides information that the code block language has not been set for accessibility purposes, punctuation mark at the end as another message comes after'
|
|
12
|
+
}
|
|
13
|
+
});
|
|
@@ -12,6 +12,7 @@ export { colorPickerButtonMessages } from './color-picker-button';
|
|
|
12
12
|
export { linkMessages } from './link';
|
|
13
13
|
export { linkToolbarMessages } from './link-toolbar';
|
|
14
14
|
export { unsupportedContentMessages } from './unsupportedContent';
|
|
15
|
+
export { codeBlockMessages } from './codeBlock';
|
|
15
16
|
export { codeBlockButtonMessages } from './codeBlockButton';
|
|
16
17
|
export { toolbarInsertBlockMessages } from './insert-block';
|
|
17
18
|
export { toolbarMessages as mediaAndEmbedToolbarMessages } from './media-and-embed-toolbar';
|
|
@@ -43,6 +44,7 @@ export { selectionExtensionMessages } from './selection-extension';
|
|
|
43
44
|
export { selectionToolbarMessages } from './selection-toolbar';
|
|
44
45
|
export { contextPanelMessages } from './context-panel';
|
|
45
46
|
export { trackChangesMessages } from './track-changes';
|
|
47
|
+
export { roleDescriptionMessages } from './roleDescription';
|
|
46
48
|
export { syncBlockMessages } from './syncBlock';
|
|
47
49
|
export { limitedModeMessages } from './limited-mode';
|
|
48
50
|
export { companyHubTextColorMessages } from './company-hub-text-color';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { defineMessages } from 'react-intl-next';
|
|
2
|
+
export const roleDescriptionMessages = defineMessages({
|
|
3
|
+
codeSnippetTextBox: {
|
|
4
|
+
id: 'fabric.editor.ariaRoleDescription.codeSnippetTextBox',
|
|
5
|
+
defaultMessage: 'codesnippet textbox',
|
|
6
|
+
description: 'Aria role description for code snippet textbox. We are overriding the HTML role textbox so the translation should match the translation of the HTML role textbox in the language being used, but with "code snippet" added to the beginning to differentiate it from a regular textbox.'
|
|
7
|
+
}
|
|
8
|
+
});
|
|
@@ -4,7 +4,7 @@ import { isFedRamp } from './environment';
|
|
|
4
4
|
import { normaliseSentryBreadcrumbs, SERIALIZABLE_ATTRIBUTES } from './normalise-sentry-breadcrumbs';
|
|
5
5
|
const SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
6
6
|
const packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
7
|
-
const packageVersion = "
|
|
7
|
+
const packageVersion = "111.33.0";
|
|
8
8
|
const sanitiseSentryEvents = (data, _hint) => {
|
|
9
9
|
// Remove URL as it has UGC
|
|
10
10
|
// Ignored via go/ees007
|
|
@@ -14,7 +14,7 @@ import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
|
|
|
14
14
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
15
15
|
import Layer from '../Layer';
|
|
16
16
|
const packageName = "@atlaskit/editor-common";
|
|
17
|
-
const packageVersion = "
|
|
17
|
+
const packageVersion = "111.33.0";
|
|
18
18
|
const halfFocusRing = 1;
|
|
19
19
|
const dropOffset = '0, 8';
|
|
20
20
|
const fadeIn = keyframes({
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
2
3
|
export let ShadowKeys = /*#__PURE__*/function (ShadowKeys) {
|
|
3
4
|
ShadowKeys["SHOW_LEFT_SHADOW"] = "showLeftShadow";
|
|
4
5
|
ShadowKeys["SHOW_RIGHT_SHADOW"] = "showRightShadow";
|
|
@@ -75,5 +76,11 @@ export class ShadowObserver {
|
|
|
75
76
|
this.intersectionObserver = undefined;
|
|
76
77
|
this.requestCallbackId && cancelIdleCallback(this.requestCallbackId);
|
|
77
78
|
}
|
|
79
|
+
if (expValEquals('platform_editor_renderer_shadow_observer_cleanup', 'isEnabled', true)) {
|
|
80
|
+
var _this$sentinels$left, _this$sentinels$right;
|
|
81
|
+
(_this$sentinels$left = this.sentinels.left) === null || _this$sentinels$left === void 0 ? void 0 : _this$sentinels$left.remove();
|
|
82
|
+
(_this$sentinels$right = this.sentinels.right) === null || _this$sentinels$right === void 0 ? void 0 : _this$sentinels$right.remove();
|
|
83
|
+
this.sentinels = {};
|
|
84
|
+
}
|
|
78
85
|
}
|
|
79
86
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import clamp from 'lodash/clamp';
|
|
2
2
|
import { ReplaceStep } from '@atlaskit/editor-prosemirror/transform';
|
|
3
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
3
4
|
import { isEmptyParagraph } from './editor-core-utils';
|
|
4
5
|
export const getStepRange = transaction => {
|
|
5
6
|
let from = -1;
|
|
@@ -137,7 +138,24 @@ export const isReplaceDocOperation = (transactions, oldState) => {
|
|
|
137
138
|
return hasStepReplacingEntireDocument;
|
|
138
139
|
});
|
|
139
140
|
};
|
|
140
|
-
|
|
141
|
+
function marksEqualInOrder(m1, m2) {
|
|
142
|
+
if (m1.length !== m2.length) return false;
|
|
143
|
+
return m1.every((m, i) => m.eq(m2[i]));
|
|
144
|
+
}
|
|
145
|
+
function marksEqualIgnoringOrder(m1, m2) {
|
|
146
|
+
if (m1.length !== m2.length) {
|
|
147
|
+
return false;
|
|
148
|
+
}
|
|
149
|
+
const m2Used = new Set();
|
|
150
|
+
for (const mark1 of m1) {
|
|
151
|
+
const idx = m2.findIndex((mark2, i) => !m2Used.has(i) && mark1.eq(mark2));
|
|
152
|
+
if (idx === -1) {
|
|
153
|
+
return false;
|
|
154
|
+
}
|
|
155
|
+
m2Used.add(idx);
|
|
156
|
+
}
|
|
157
|
+
return true;
|
|
158
|
+
}
|
|
141
159
|
/**
|
|
142
160
|
* Compares two ProseMirror documents for equality, ignoring attributes
|
|
143
161
|
* which don't affect the document structure.
|
|
@@ -147,16 +165,28 @@ export const isReplaceDocOperation = (transactions, oldState) => {
|
|
|
147
165
|
* @param doc1 PMNode
|
|
148
166
|
* @param doc2 PMNode
|
|
149
167
|
* @param attributesToIgnore Specific array of attribute keys to ignore - defaults to ignoring all
|
|
168
|
+
* @param opts.ignoreMarkOrder If mark order should be ignored to still be equal (e.g. reversed annotation marks). When not provided, controlled by platform_editor_are_nodes_equal_ignore_mark_order feature gate (defaults to true when gate is on).
|
|
150
169
|
* @returns boolean
|
|
151
170
|
*/
|
|
152
|
-
|
|
171
|
+
|
|
172
|
+
export function areNodesEqualIgnoreAttrs(node1, node2, attributesToIgnore, opts) {
|
|
173
|
+
var _opts$ignoreMarkOrder;
|
|
174
|
+
const ignoreMarkOrder = (_opts$ignoreMarkOrder = opts === null || opts === void 0 ? void 0 : opts.ignoreMarkOrder) !== null && _opts$ignoreMarkOrder !== void 0 ? _opts$ignoreMarkOrder : expValEquals('platform_editor_are_nodes_equal_ignore_mark_order', 'isEnabled', true);
|
|
153
175
|
if (node1.isText) {
|
|
176
|
+
if (ignoreMarkOrder) {
|
|
177
|
+
return node1.text === node2.text && marksEqualIgnoringOrder(node1.marks, node2.marks);
|
|
178
|
+
}
|
|
154
179
|
return node1.eq(node2);
|
|
155
180
|
}
|
|
181
|
+
const marksEqual = ignoreMarkOrder ? marksEqualIgnoringOrder(node1.marks, node2.marks) : marksEqualInOrder(node1.marks, node2.marks);
|
|
156
182
|
|
|
157
183
|
// If no attributes to ignore, compare all attributes
|
|
158
184
|
if (!attributesToIgnore || attributesToIgnore.length === 0) {
|
|
159
|
-
|
|
185
|
+
if (expValEquals('platform_editor_are_nodes_equal_ignore_mark_order', 'isEnabled', true)) {
|
|
186
|
+
return node1 === node2 || node1.hasMarkup(node2.type, node1.attrs, node1.marks) && marksEqual && areFragmentsEqual(node1.content, node2.content, undefined, opts);
|
|
187
|
+
} else {
|
|
188
|
+
return node1 === node2 || node1.hasMarkup(node2.type, node1.attrs, node2.marks) && areFragmentsEqual(node1.content, node2.content);
|
|
189
|
+
}
|
|
160
190
|
}
|
|
161
191
|
|
|
162
192
|
// Build attrs to compare by excluding ignored attributes
|
|
@@ -167,16 +197,20 @@ export function areNodesEqualIgnoreAttrs(node1, node2, attributesToIgnore) {
|
|
|
167
197
|
attrsToCompare[key] = node1.attrs[key];
|
|
168
198
|
}
|
|
169
199
|
}
|
|
170
|
-
|
|
200
|
+
if (expValEquals('platform_editor_are_nodes_equal_ignore_mark_order', 'isEnabled', true)) {
|
|
201
|
+
return node1 === node2 || node1.type === node2.type && node1.hasMarkup(node2.type, attrsToCompare, node1.marks) && marksEqual && areFragmentsEqual(node1.content, node2.content, attributesToIgnore, opts);
|
|
202
|
+
} else {
|
|
203
|
+
return node1 === node2 || node1.hasMarkup(node2.type, attrsToCompare, node2.marks) && areFragmentsEqual(node1.content, node2.content, attributesToIgnore);
|
|
204
|
+
}
|
|
171
205
|
}
|
|
172
|
-
function areFragmentsEqual(frag1, frag2, attributesToIgnore) {
|
|
206
|
+
function areFragmentsEqual(frag1, frag2, attributesToIgnore, opts) {
|
|
173
207
|
if (frag1.content.length !== frag2.content.length) {
|
|
174
208
|
return false;
|
|
175
209
|
}
|
|
176
210
|
let childrenEqual = true;
|
|
177
211
|
frag1.content.forEach((child, i) => {
|
|
178
212
|
const otherChild = frag2.child(i);
|
|
179
|
-
if (child === otherChild || otherChild && areNodesEqualIgnoreAttrs(child, otherChild, attributesToIgnore)) {
|
|
213
|
+
if (child === otherChild || otherChild && areNodesEqualIgnoreAttrs(child, otherChild, attributesToIgnore, opts)) {
|
|
180
214
|
return;
|
|
181
215
|
}
|
|
182
216
|
childrenEqual = false;
|
|
@@ -172,6 +172,11 @@ export var messages = defineMessages({
|
|
|
172
172
|
defaultMessage: 'Panel',
|
|
173
173
|
description: 'Visually distinguishes your text by adding a panel'
|
|
174
174
|
},
|
|
175
|
+
textBoxAriaLabel: {
|
|
176
|
+
id: 'fabric.editor.aria.textbox',
|
|
177
|
+
defaultMessage: 'textbox',
|
|
178
|
+
description: 'This is the definition of the HTML role textbox, it needs to be translated in the same way that a textbox with a HTML role of textbox'
|
|
179
|
+
},
|
|
175
180
|
other: {
|
|
176
181
|
id: 'fabric.editor.other',
|
|
177
182
|
defaultMessage: 'Others...',
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { defineMessages } from 'react-intl-next';
|
|
2
|
+
export var codeBlockMessages = defineMessages({
|
|
3
|
+
codeblockLanguageAriaDescription: {
|
|
4
|
+
id: 'fabric.editor.codeBlock.languageAriaDescription',
|
|
5
|
+
defaultMessage: 'Code snippet language: {language}.',
|
|
6
|
+
description: 'A short message that provides information about what code language is being used in a code block for accessibility purposes, punctuation mark at the end as another message comes after'
|
|
7
|
+
},
|
|
8
|
+
codeBlockLanguageNotSet: {
|
|
9
|
+
id: 'fabric.editor.codeBlock.languageNotSet',
|
|
10
|
+
defaultMessage: 'Code language not set.',
|
|
11
|
+
description: 'A short message that provides information that the code block language has not been set for accessibility purposes, punctuation mark at the end as another message comes after'
|
|
12
|
+
}
|
|
13
|
+
});
|
|
@@ -12,6 +12,7 @@ export { colorPickerButtonMessages } from './color-picker-button';
|
|
|
12
12
|
export { linkMessages } from './link';
|
|
13
13
|
export { linkToolbarMessages } from './link-toolbar';
|
|
14
14
|
export { unsupportedContentMessages } from './unsupportedContent';
|
|
15
|
+
export { codeBlockMessages } from './codeBlock';
|
|
15
16
|
export { codeBlockButtonMessages } from './codeBlockButton';
|
|
16
17
|
export { toolbarInsertBlockMessages } from './insert-block';
|
|
17
18
|
export { toolbarMessages as mediaAndEmbedToolbarMessages } from './media-and-embed-toolbar';
|
|
@@ -43,6 +44,7 @@ export { selectionExtensionMessages } from './selection-extension';
|
|
|
43
44
|
export { selectionToolbarMessages } from './selection-toolbar';
|
|
44
45
|
export { contextPanelMessages } from './context-panel';
|
|
45
46
|
export { trackChangesMessages } from './track-changes';
|
|
47
|
+
export { roleDescriptionMessages } from './roleDescription';
|
|
46
48
|
export { syncBlockMessages } from './syncBlock';
|
|
47
49
|
export { limitedModeMessages } from './limited-mode';
|
|
48
50
|
export { companyHubTextColorMessages } from './company-hub-text-color';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { defineMessages } from 'react-intl-next';
|
|
2
|
+
export var roleDescriptionMessages = defineMessages({
|
|
3
|
+
codeSnippetTextBox: {
|
|
4
|
+
id: 'fabric.editor.ariaRoleDescription.codeSnippetTextBox',
|
|
5
|
+
defaultMessage: 'codesnippet textbox',
|
|
6
|
+
description: 'Aria role description for code snippet textbox. We are overriding the HTML role textbox so the translation should match the translation of the HTML role textbox in the language being used, but with "code snippet" added to the beginning to differentiate it from a regular textbox.'
|
|
7
|
+
}
|
|
8
|
+
});
|
|
@@ -10,7 +10,7 @@ import { isFedRamp } from './environment';
|
|
|
10
10
|
import { normaliseSentryBreadcrumbs, SERIALIZABLE_ATTRIBUTES } from './normalise-sentry-breadcrumbs';
|
|
11
11
|
var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
12
12
|
var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
13
|
-
var packageVersion = "
|
|
13
|
+
var packageVersion = "111.33.0";
|
|
14
14
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
15
15
|
// Remove URL as it has UGC
|
|
16
16
|
// Ignored via go/ees007
|
|
@@ -21,7 +21,7 @@ import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
|
|
|
21
21
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
22
22
|
import Layer from '../Layer';
|
|
23
23
|
var packageName = "@atlaskit/editor-common";
|
|
24
|
-
var packageVersion = "
|
|
24
|
+
var packageVersion = "111.33.0";
|
|
25
25
|
var halfFocusRing = 1;
|
|
26
26
|
var dropOffset = '0, 8';
|
|
27
27
|
var fadeIn = keyframes({
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
2
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
3
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
4
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
4
5
|
export var ShadowKeys = /*#__PURE__*/function (ShadowKeys) {
|
|
5
6
|
ShadowKeys["SHOW_LEFT_SHADOW"] = "showLeftShadow";
|
|
6
7
|
ShadowKeys["SHOW_RIGHT_SHADOW"] = "showRightShadow";
|
|
@@ -77,6 +78,12 @@ export var ShadowObserver = /*#__PURE__*/function () {
|
|
|
77
78
|
this.intersectionObserver = undefined;
|
|
78
79
|
this.requestCallbackId && cancelIdleCallback(this.requestCallbackId);
|
|
79
80
|
}
|
|
81
|
+
if (expValEquals('platform_editor_renderer_shadow_observer_cleanup', 'isEnabled', true)) {
|
|
82
|
+
var _this$sentinels$left, _this$sentinels$right;
|
|
83
|
+
(_this$sentinels$left = this.sentinels.left) === null || _this$sentinels$left === void 0 || _this$sentinels$left.remove();
|
|
84
|
+
(_this$sentinels$right = this.sentinels.right) === null || _this$sentinels$right === void 0 || _this$sentinels$right.remove();
|
|
85
|
+
this.sentinels = {};
|
|
86
|
+
}
|
|
80
87
|
}
|
|
81
88
|
}]);
|
|
82
89
|
}();
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
+
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
|
|
2
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
3
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
1
4
|
import clamp from 'lodash/clamp';
|
|
2
5
|
import { ReplaceStep } from '@atlaskit/editor-prosemirror/transform';
|
|
6
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
3
7
|
import { isEmptyParagraph } from './editor-core-utils';
|
|
4
8
|
export var getStepRange = function getStepRange(transaction) {
|
|
5
9
|
var from = -1;
|
|
@@ -135,7 +139,44 @@ export var isReplaceDocOperation = function isReplaceDocOperation(transactions,
|
|
|
135
139
|
return hasStepReplacingEntireDocument;
|
|
136
140
|
});
|
|
137
141
|
};
|
|
138
|
-
|
|
142
|
+
function marksEqualInOrder(m1, m2) {
|
|
143
|
+
if (m1.length !== m2.length) return false;
|
|
144
|
+
return m1.every(function (m, i) {
|
|
145
|
+
return m.eq(m2[i]);
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
function marksEqualIgnoringOrder(m1, m2) {
|
|
149
|
+
if (m1.length !== m2.length) {
|
|
150
|
+
return false;
|
|
151
|
+
}
|
|
152
|
+
var m2Used = new Set();
|
|
153
|
+
var _iterator = _createForOfIteratorHelper(m1),
|
|
154
|
+
_step;
|
|
155
|
+
try {
|
|
156
|
+
var _loop = function _loop() {
|
|
157
|
+
var mark1 = _step.value;
|
|
158
|
+
var idx = m2.findIndex(function (mark2, i) {
|
|
159
|
+
return !m2Used.has(i) && mark1.eq(mark2);
|
|
160
|
+
});
|
|
161
|
+
if (idx === -1) {
|
|
162
|
+
return {
|
|
163
|
+
v: false
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
m2Used.add(idx);
|
|
167
|
+
},
|
|
168
|
+
_ret;
|
|
169
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
170
|
+
_ret = _loop();
|
|
171
|
+
if (_ret) return _ret.v;
|
|
172
|
+
}
|
|
173
|
+
} catch (err) {
|
|
174
|
+
_iterator.e(err);
|
|
175
|
+
} finally {
|
|
176
|
+
_iterator.f();
|
|
177
|
+
}
|
|
178
|
+
return true;
|
|
179
|
+
}
|
|
139
180
|
/**
|
|
140
181
|
* Compares two ProseMirror documents for equality, ignoring attributes
|
|
141
182
|
* which don't affect the document structure.
|
|
@@ -145,16 +186,28 @@ export var isReplaceDocOperation = function isReplaceDocOperation(transactions,
|
|
|
145
186
|
* @param doc1 PMNode
|
|
146
187
|
* @param doc2 PMNode
|
|
147
188
|
* @param attributesToIgnore Specific array of attribute keys to ignore - defaults to ignoring all
|
|
189
|
+
* @param opts.ignoreMarkOrder If mark order should be ignored to still be equal (e.g. reversed annotation marks). When not provided, controlled by platform_editor_are_nodes_equal_ignore_mark_order feature gate (defaults to true when gate is on).
|
|
148
190
|
* @returns boolean
|
|
149
191
|
*/
|
|
150
|
-
|
|
192
|
+
|
|
193
|
+
export function areNodesEqualIgnoreAttrs(node1, node2, attributesToIgnore, opts) {
|
|
194
|
+
var _opts$ignoreMarkOrder;
|
|
195
|
+
var ignoreMarkOrder = (_opts$ignoreMarkOrder = opts === null || opts === void 0 ? void 0 : opts.ignoreMarkOrder) !== null && _opts$ignoreMarkOrder !== void 0 ? _opts$ignoreMarkOrder : expValEquals('platform_editor_are_nodes_equal_ignore_mark_order', 'isEnabled', true);
|
|
151
196
|
if (node1.isText) {
|
|
197
|
+
if (ignoreMarkOrder) {
|
|
198
|
+
return node1.text === node2.text && marksEqualIgnoringOrder(node1.marks, node2.marks);
|
|
199
|
+
}
|
|
152
200
|
return node1.eq(node2);
|
|
153
201
|
}
|
|
202
|
+
var marksEqual = ignoreMarkOrder ? marksEqualIgnoringOrder(node1.marks, node2.marks) : marksEqualInOrder(node1.marks, node2.marks);
|
|
154
203
|
|
|
155
204
|
// If no attributes to ignore, compare all attributes
|
|
156
205
|
if (!attributesToIgnore || attributesToIgnore.length === 0) {
|
|
157
|
-
|
|
206
|
+
if (expValEquals('platform_editor_are_nodes_equal_ignore_mark_order', 'isEnabled', true)) {
|
|
207
|
+
return node1 === node2 || node1.hasMarkup(node2.type, node1.attrs, node1.marks) && marksEqual && areFragmentsEqual(node1.content, node2.content, undefined, opts);
|
|
208
|
+
} else {
|
|
209
|
+
return node1 === node2 || node1.hasMarkup(node2.type, node1.attrs, node2.marks) && areFragmentsEqual(node1.content, node2.content);
|
|
210
|
+
}
|
|
158
211
|
}
|
|
159
212
|
|
|
160
213
|
// Build attrs to compare by excluding ignored attributes
|
|
@@ -165,16 +218,20 @@ export function areNodesEqualIgnoreAttrs(node1, node2, attributesToIgnore) {
|
|
|
165
218
|
attrsToCompare[key] = node1.attrs[key];
|
|
166
219
|
}
|
|
167
220
|
}
|
|
168
|
-
|
|
221
|
+
if (expValEquals('platform_editor_are_nodes_equal_ignore_mark_order', 'isEnabled', true)) {
|
|
222
|
+
return node1 === node2 || node1.type === node2.type && node1.hasMarkup(node2.type, attrsToCompare, node1.marks) && marksEqual && areFragmentsEqual(node1.content, node2.content, attributesToIgnore, opts);
|
|
223
|
+
} else {
|
|
224
|
+
return node1 === node2 || node1.hasMarkup(node2.type, attrsToCompare, node2.marks) && areFragmentsEqual(node1.content, node2.content, attributesToIgnore);
|
|
225
|
+
}
|
|
169
226
|
}
|
|
170
|
-
function areFragmentsEqual(frag1, frag2, attributesToIgnore) {
|
|
227
|
+
function areFragmentsEqual(frag1, frag2, attributesToIgnore, opts) {
|
|
171
228
|
if (frag1.content.length !== frag2.content.length) {
|
|
172
229
|
return false;
|
|
173
230
|
}
|
|
174
231
|
var childrenEqual = true;
|
|
175
232
|
frag1.content.forEach(function (child, i) {
|
|
176
233
|
var otherChild = frag2.child(i);
|
|
177
|
-
if (child === otherChild || otherChild && areNodesEqualIgnoreAttrs(child, otherChild, attributesToIgnore)) {
|
|
234
|
+
if (child === otherChild || otherChild && areNodesEqualIgnoreAttrs(child, otherChild, attributesToIgnore, opts)) {
|
|
178
235
|
return;
|
|
179
236
|
}
|
|
180
237
|
childrenEqual = false;
|
|
@@ -169,6 +169,11 @@ export declare const messages: {
|
|
|
169
169
|
defaultMessage: string;
|
|
170
170
|
description: string;
|
|
171
171
|
};
|
|
172
|
+
textBoxAriaLabel: {
|
|
173
|
+
id: string;
|
|
174
|
+
defaultMessage: string;
|
|
175
|
+
description: string;
|
|
176
|
+
};
|
|
172
177
|
other: {
|
|
173
178
|
id: string;
|
|
174
179
|
defaultMessage: string;
|
|
@@ -8,6 +8,7 @@ export { colorPickerButtonMessages } from './color-picker-button';
|
|
|
8
8
|
export { linkMessages } from './link';
|
|
9
9
|
export { linkToolbarMessages } from './link-toolbar';
|
|
10
10
|
export { unsupportedContentMessages } from './unsupportedContent';
|
|
11
|
+
export { codeBlockMessages } from './codeBlock';
|
|
11
12
|
export { codeBlockButtonMessages } from './codeBlockButton';
|
|
12
13
|
export { toolbarInsertBlockMessages } from './insert-block';
|
|
13
14
|
export { toolbarMessages as mediaAndEmbedToolbarMessages } from './media-and-embed-toolbar';
|
|
@@ -39,6 +40,7 @@ export { selectionExtensionMessages } from './selection-extension';
|
|
|
39
40
|
export { selectionToolbarMessages } from './selection-toolbar';
|
|
40
41
|
export { contextPanelMessages } from './context-panel';
|
|
41
42
|
export { trackChangesMessages } from './track-changes';
|
|
43
|
+
export { roleDescriptionMessages } from './roleDescription';
|
|
42
44
|
export { syncBlockMessages } from './syncBlock';
|
|
43
45
|
export { limitedModeMessages } from './limited-mode';
|
|
44
46
|
export { companyHubTextColorMessages } from './company-hub-text-color';
|
|
@@ -31,7 +31,10 @@ export declare const isReplaceDocOperation: (transactions: readonly Transaction[
|
|
|
31
31
|
* @param doc1 PMNode
|
|
32
32
|
* @param doc2 PMNode
|
|
33
33
|
* @param attributesToIgnore Specific array of attribute keys to ignore - defaults to ignoring all
|
|
34
|
+
* @param opts.ignoreMarkOrder If mark order should be ignored to still be equal (e.g. reversed annotation marks). When not provided, controlled by platform_editor_are_nodes_equal_ignore_mark_order feature gate (defaults to true when gate is on).
|
|
34
35
|
* @returns boolean
|
|
35
36
|
*/
|
|
36
|
-
export declare function areNodesEqualIgnoreAttrs(node1: Node, node2: Node, attributesToIgnore?: string[]
|
|
37
|
+
export declare function areNodesEqualIgnoreAttrs(node1: Node, node2: Node, attributesToIgnore?: string[], opts?: {
|
|
38
|
+
ignoreMarkOrder?: boolean;
|
|
39
|
+
}): boolean;
|
|
37
40
|
export {};
|
|
@@ -7,7 +7,11 @@ interface GetItemCounterDigitsSize {
|
|
|
7
7
|
order?: number;
|
|
8
8
|
}
|
|
9
9
|
export declare const getItemCounterDigitsSize: (options: GetItemCounterDigitsSize) => number | undefined;
|
|
10
|
-
export declare function isListNode(node: Node | null | undefined):
|
|
10
|
+
export declare function isListNode(node: Node | null | undefined): node is Node & {
|
|
11
|
+
type: {
|
|
12
|
+
name: 'orderedList' | 'bulletList';
|
|
13
|
+
};
|
|
14
|
+
};
|
|
11
15
|
export declare function isParagraphNode(node: Node | null | undefined): boolean;
|
|
12
16
|
export declare function isListItemNode(node: Node | null | undefined): boolean;
|
|
13
17
|
export declare function isBulletList(node: Node | null | undefined): boolean;
|
|
@@ -169,6 +169,11 @@ export declare const messages: {
|
|
|
169
169
|
defaultMessage: string;
|
|
170
170
|
description: string;
|
|
171
171
|
};
|
|
172
|
+
textBoxAriaLabel: {
|
|
173
|
+
id: string;
|
|
174
|
+
defaultMessage: string;
|
|
175
|
+
description: string;
|
|
176
|
+
};
|
|
172
177
|
other: {
|
|
173
178
|
id: string;
|
|
174
179
|
defaultMessage: string;
|
|
@@ -8,6 +8,7 @@ export { colorPickerButtonMessages } from './color-picker-button';
|
|
|
8
8
|
export { linkMessages } from './link';
|
|
9
9
|
export { linkToolbarMessages } from './link-toolbar';
|
|
10
10
|
export { unsupportedContentMessages } from './unsupportedContent';
|
|
11
|
+
export { codeBlockMessages } from './codeBlock';
|
|
11
12
|
export { codeBlockButtonMessages } from './codeBlockButton';
|
|
12
13
|
export { toolbarInsertBlockMessages } from './insert-block';
|
|
13
14
|
export { toolbarMessages as mediaAndEmbedToolbarMessages } from './media-and-embed-toolbar';
|
|
@@ -39,6 +40,7 @@ export { selectionExtensionMessages } from './selection-extension';
|
|
|
39
40
|
export { selectionToolbarMessages } from './selection-toolbar';
|
|
40
41
|
export { contextPanelMessages } from './context-panel';
|
|
41
42
|
export { trackChangesMessages } from './track-changes';
|
|
43
|
+
export { roleDescriptionMessages } from './roleDescription';
|
|
42
44
|
export { syncBlockMessages } from './syncBlock';
|
|
43
45
|
export { limitedModeMessages } from './limited-mode';
|
|
44
46
|
export { companyHubTextColorMessages } from './company-hub-text-color';
|
|
@@ -31,7 +31,10 @@ export declare const isReplaceDocOperation: (transactions: readonly Transaction[
|
|
|
31
31
|
* @param doc1 PMNode
|
|
32
32
|
* @param doc2 PMNode
|
|
33
33
|
* @param attributesToIgnore Specific array of attribute keys to ignore - defaults to ignoring all
|
|
34
|
+
* @param opts.ignoreMarkOrder If mark order should be ignored to still be equal (e.g. reversed annotation marks). When not provided, controlled by platform_editor_are_nodes_equal_ignore_mark_order feature gate (defaults to true when gate is on).
|
|
34
35
|
* @returns boolean
|
|
35
36
|
*/
|
|
36
|
-
export declare function areNodesEqualIgnoreAttrs(node1: Node, node2: Node, attributesToIgnore?: string[]
|
|
37
|
+
export declare function areNodesEqualIgnoreAttrs(node1: Node, node2: Node, attributesToIgnore?: string[], opts?: {
|
|
38
|
+
ignoreMarkOrder?: boolean;
|
|
39
|
+
}): boolean;
|
|
37
40
|
export {};
|
|
@@ -7,7 +7,11 @@ interface GetItemCounterDigitsSize {
|
|
|
7
7
|
order?: number;
|
|
8
8
|
}
|
|
9
9
|
export declare const getItemCounterDigitsSize: (options: GetItemCounterDigitsSize) => number | undefined;
|
|
10
|
-
export declare function isListNode(node: Node | null | undefined):
|
|
10
|
+
export declare function isListNode(node: Node | null | undefined): node is Node & {
|
|
11
|
+
type: {
|
|
12
|
+
name: 'orderedList' | 'bulletList';
|
|
13
|
+
};
|
|
14
|
+
};
|
|
11
15
|
export declare function isParagraphNode(node: Node | null | undefined): boolean;
|
|
12
16
|
export declare function isListItemNode(node: Node | null | undefined): boolean;
|
|
13
17
|
export declare function isBulletList(node: Node | null | undefined): boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-common",
|
|
3
|
-
"version": "111.
|
|
3
|
+
"version": "111.34.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/"
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
"@atlaskit/task-decision": "^19.3.0",
|
|
83
83
|
"@atlaskit/textfield": "^8.2.0",
|
|
84
84
|
"@atlaskit/theme": "^22.0.0",
|
|
85
|
-
"@atlaskit/tmp-editor-statsig": "^35.
|
|
85
|
+
"@atlaskit/tmp-editor-statsig": "^35.7.0",
|
|
86
86
|
"@atlaskit/tokens": "^11.1.0",
|
|
87
87
|
"@atlaskit/tooltip": "^20.14.0",
|
|
88
88
|
"@atlaskit/width-detector": "^5.0.0",
|