@atlaskit/editor-common 122.7.0 → 122.8.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 +26 -0
- package/dist/cjs/element-browser/components/ViewMore.js +1 -1
- package/dist/cjs/extensibility/Extension/Lozenge/ExtensionFloatingLabel.js +1 -1
- package/dist/cjs/extensibility/GeneratedContentReveal.js +1 -1
- package/dist/cjs/extensions/UnknownMacroPlaceholder.js +1 -1
- package/dist/cjs/icons/shared/PanelErrorIcon.js +1 -1
- package/dist/cjs/icons/shared/PanelInfoIcon.js +1 -1
- package/dist/cjs/icons/shared/PanelNoteIcon.js +1 -1
- package/dist/cjs/icons/shared/PanelSuccessIcon.js +1 -1
- package/dist/cjs/icons/shared/PanelWarningIcon.js +1 -1
- package/dist/cjs/media/messages/imageBorder.js +10 -0
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/quick-insert/CompactQuickInsertMenuItem.js +1 -1
- package/dist/cjs/quick-insert/QuickInsertHoverPreview.js +1 -1
- package/dist/cjs/table/NewSortingIcon.js +1 -1
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/cjs/ui/Shortcut/index.js +1 -1
- package/dist/cjs/ui/Toolbar/ButtonGroup.js +1 -1
- package/dist/cjs/ui/Toolbar/DropdownTriggerWrapper.js +1 -1
- package/dist/cjs/ui/Toolbar/DropdownWrapper.js +1 -1
- package/dist/cjs/ui/Toolbar/ExpandIcon.js +1 -1
- package/dist/cjs/ui/Toolbar/Separator.js +1 -1
- package/dist/cjs/ui-color/ColorPalette/index.js +4 -2
- package/dist/cjs/utils/areDocsEqualByBlockStructureAndText.js +51 -0
- package/dist/cjs/utils/document.js +1 -0
- package/dist/cjs/utils/filter/privacy-filter.js +2 -2
- package/dist/es2019/element-browser/components/ViewMore.js +1 -1
- package/dist/es2019/extensibility/Extension/Lozenge/ExtensionFloatingLabel.js +1 -1
- package/dist/es2019/extensibility/GeneratedContentReveal.js +1 -1
- package/dist/es2019/extensions/UnknownMacroPlaceholder.js +1 -1
- package/dist/es2019/icons/shared/PanelErrorIcon.js +1 -1
- package/dist/es2019/icons/shared/PanelInfoIcon.js +1 -1
- package/dist/es2019/icons/shared/PanelNoteIcon.js +1 -1
- package/dist/es2019/icons/shared/PanelSuccessIcon.js +1 -1
- package/dist/es2019/icons/shared/PanelWarningIcon.js +1 -1
- package/dist/es2019/media/messages/imageBorder.js +10 -0
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/quick-insert/CompactQuickInsertMenuItem.js +1 -1
- package/dist/es2019/quick-insert/QuickInsertHoverPreview.js +1 -1
- package/dist/es2019/table/NewSortingIcon.js +1 -1
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/es2019/ui/Shortcut/index.js +1 -1
- package/dist/es2019/ui/Toolbar/ButtonGroup.js +1 -1
- package/dist/es2019/ui/Toolbar/DropdownTriggerWrapper.js +1 -1
- package/dist/es2019/ui/Toolbar/DropdownWrapper.js +1 -1
- package/dist/es2019/ui/Toolbar/ExpandIcon.js +1 -1
- package/dist/es2019/ui/Toolbar/Separator.js +1 -1
- package/dist/es2019/ui-color/ColorPalette/index.js +4 -2
- package/dist/es2019/utils/areDocsEqualByBlockStructureAndText.js +46 -0
- package/dist/es2019/utils/document.js +1 -0
- package/dist/es2019/utils/filter/privacy-filter.js +1 -1
- package/dist/esm/element-browser/components/ViewMore.js +1 -1
- package/dist/esm/extensibility/Extension/Lozenge/ExtensionFloatingLabel.js +1 -1
- package/dist/esm/extensibility/GeneratedContentReveal.js +1 -1
- package/dist/esm/extensions/UnknownMacroPlaceholder.js +1 -1
- package/dist/esm/icons/shared/PanelErrorIcon.js +1 -1
- package/dist/esm/icons/shared/PanelInfoIcon.js +1 -1
- package/dist/esm/icons/shared/PanelNoteIcon.js +1 -1
- package/dist/esm/icons/shared/PanelSuccessIcon.js +1 -1
- package/dist/esm/icons/shared/PanelWarningIcon.js +1 -1
- package/dist/esm/media/messages/imageBorder.js +10 -0
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/quick-insert/CompactQuickInsertMenuItem.js +1 -1
- package/dist/esm/quick-insert/QuickInsertHoverPreview.js +1 -1
- package/dist/esm/table/NewSortingIcon.js +1 -1
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/esm/ui/Shortcut/index.js +1 -1
- package/dist/esm/ui/Toolbar/ButtonGroup.js +1 -1
- package/dist/esm/ui/Toolbar/DropdownTriggerWrapper.js +1 -1
- package/dist/esm/ui/Toolbar/DropdownWrapper.js +1 -1
- package/dist/esm/ui/Toolbar/ExpandIcon.js +1 -1
- package/dist/esm/ui/Toolbar/Separator.js +1 -1
- package/dist/esm/ui-color/ColorPalette/index.js +4 -2
- package/dist/esm/utils/areDocsEqualByBlockStructureAndText.js +46 -0
- package/dist/esm/utils/document.js +1 -0
- package/dist/esm/utils/filter/privacy-filter.js +1 -1
- package/dist/types/media/messages/imageBorder.d.ts +27 -17
- package/dist/types/ui-color/ColorPalette/index.d.ts +4 -0
- package/dist/types/utils/areDocsEqualByBlockStructureAndText.d.ts +6 -0
- package/package.json +7 -3
- package/utils/areDocsEqualByBlockStructureAndText/package.json +10 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,31 @@
|
|
|
1
1
|
# @atlaskit/editor-common
|
|
2
2
|
|
|
3
|
+
## 122.8.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`2bbc1c84de468`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/2bbc1c84de468) -
|
|
8
|
+
Migrate Volt consumer imports to existing definitions and align affected test mocks without
|
|
9
|
+
changing runtime behavior.
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
12
|
+
## 122.8.1
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- [`442abbe2a88e0`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/442abbe2a88e0) -
|
|
17
|
+
Normalize documents before relaxed show-diff comparisons when Confluence version-history diffing
|
|
18
|
+
is enabled.
|
|
19
|
+
|
|
20
|
+
## 122.8.0
|
|
21
|
+
|
|
22
|
+
### Minor Changes
|
|
23
|
+
|
|
24
|
+
- [`c942b90687404`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/c942b90687404) -
|
|
25
|
+
Add an optional `ariaLabel` prop to `ColorPalette` so consumers can give its radio group an
|
|
26
|
+
accessible name, and add image border color and size radio group labels to the image border
|
|
27
|
+
messages. Consumed behind `platform_editor_a11y_border_radiogroup_label`.
|
|
28
|
+
|
|
3
29
|
## 122.7.0
|
|
4
30
|
|
|
5
31
|
### Minor Changes
|
|
@@ -16,6 +16,11 @@ var imageBorderMessages = exports.imageBorderMessages = (0, _reactIntl.defineMes
|
|
|
16
16
|
defaultMessage: 'Image border options Color dropdown',
|
|
17
17
|
description: 'ARIA label for the dropdown to change the border color of an image.'
|
|
18
18
|
},
|
|
19
|
+
borderColorRadioGroupAriaLabel: {
|
|
20
|
+
id: 'fabric.editor.imageBorderColor.radioGroupAriaLabel',
|
|
21
|
+
defaultMessage: 'Color options',
|
|
22
|
+
description: 'ARIA label for the group of selectable border colors in the image border options panel.'
|
|
23
|
+
},
|
|
19
24
|
borderSize: {
|
|
20
25
|
id: 'fabric.editor.imageBorderSize',
|
|
21
26
|
defaultMessage: 'Size',
|
|
@@ -26,6 +31,11 @@ var imageBorderMessages = exports.imageBorderMessages = (0, _reactIntl.defineMes
|
|
|
26
31
|
defaultMessage: 'Image border options Size dropdown',
|
|
27
32
|
description: 'ARIA label for the dropdown to change the border size of an image.'
|
|
28
33
|
},
|
|
34
|
+
borderSizeRadioGroupAriaLabel: {
|
|
35
|
+
id: 'fabric.editor.imageBorderSize.radioGroupAriaLabel',
|
|
36
|
+
defaultMessage: 'Size options',
|
|
37
|
+
description: 'ARIA label for the group of selectable border sizes in the image border options panel.'
|
|
38
|
+
},
|
|
29
39
|
addBorder: {
|
|
30
40
|
id: 'fabric.editor.addImageBorder',
|
|
31
41
|
defaultMessage: 'Add border',
|
|
@@ -27,7 +27,7 @@ var NETWORK_FAILURE_REGEX = /^network failure/i;
|
|
|
27
27
|
var RESIZE_OBSERVER_LOOP_REGEX = /ResizeObserver loop completed with undelivered notifications/;
|
|
28
28
|
var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
29
29
|
var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
30
|
-
var packageVersion = "122.
|
|
30
|
+
var packageVersion = "122.8.1";
|
|
31
31
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
32
32
|
// Remove URL as it has UGC
|
|
33
33
|
// 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 = "122.
|
|
27
|
+
var packageVersion = "122.8.1";
|
|
28
28
|
var halfFocusRing = 1;
|
|
29
29
|
var dropOffset = '0, 8';
|
|
30
30
|
var fadeIn = (0, _react2.keyframes)({
|
|
@@ -55,7 +55,8 @@ var ColorPalette = function ColorPalette(props) {
|
|
|
55
55
|
selectedColor = props.selectedColor,
|
|
56
56
|
className = props.className,
|
|
57
57
|
formatMessage = props.intl.formatMessage,
|
|
58
|
-
paletteOptions = props.paletteOptions
|
|
58
|
+
paletteOptions = props.paletteOptions,
|
|
59
|
+
ariaLabel = props.ariaLabel;
|
|
59
60
|
var palette = paletteOptions.palette,
|
|
60
61
|
hexToPaletteColor = paletteOptions.hexToPaletteColor,
|
|
61
62
|
paletteColorTooltipMessages = paletteOptions.paletteColorTooltipMessages;
|
|
@@ -73,7 +74,8 @@ var ColorPalette = function ColorPalette(props) {
|
|
|
73
74
|
,
|
|
74
75
|
className: className,
|
|
75
76
|
key: "row-first-color-".concat(row[0].value),
|
|
76
|
-
role: "radiogroup"
|
|
77
|
+
role: "radiogroup",
|
|
78
|
+
"aria-label": ariaLabel
|
|
77
79
|
}, row.map(function (_ref) {
|
|
78
80
|
var value = _ref.value,
|
|
79
81
|
label = _ref.label,
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.areDocsEqualByBlockStructureAndText = areDocsEqualByBlockStructureAndText;
|
|
7
|
+
var _editorJsonTransformer = require("@atlaskit/editor-json-transformer");
|
|
8
|
+
var _fg = require("@atlaskit/platform-feature-flags/fg");
|
|
9
|
+
var _transform = require("@atlaskit/editor-prosemirror/transform");
|
|
10
|
+
/**
|
|
11
|
+
* Returns true when documents have the same text and block structure, while ignoring marks and
|
|
12
|
+
* attributes. This is useful when comparing documents produced by different serialization paths.
|
|
13
|
+
*/
|
|
14
|
+
function areDocsEqualByBlockStructureAndText(node1, node2) {
|
|
15
|
+
if ((0, _fg.fg)('confluence_ncs_step_diffing_version_history')) {
|
|
16
|
+
node1 = normalizeDocument(node1);
|
|
17
|
+
node2 = normalizeDocument(node2);
|
|
18
|
+
}
|
|
19
|
+
if (node1.textContent !== node2.textContent) {
|
|
20
|
+
return false;
|
|
21
|
+
}
|
|
22
|
+
var stripped1 = stripMarks(node1);
|
|
23
|
+
var stripped2 = stripMarks(node2);
|
|
24
|
+
return stripped1.nodeSize === stripped2.nodeSize && isBlockStructureEqual(stripped1, stripped2);
|
|
25
|
+
}
|
|
26
|
+
var transformers = new WeakMap();
|
|
27
|
+
function normalizeDocument(node) {
|
|
28
|
+
var schema = node.type.schema;
|
|
29
|
+
var transformer = transformers.get(schema);
|
|
30
|
+
if (!transformer) {
|
|
31
|
+
transformer = new _editorJsonTransformer.JSONTransformer(schema);
|
|
32
|
+
transformers.set(schema, transformer);
|
|
33
|
+
}
|
|
34
|
+
return transformer.parse(transformer.encode(node));
|
|
35
|
+
}
|
|
36
|
+
function stripMarks(doc) {
|
|
37
|
+
var tr = new _transform.Transform(doc);
|
|
38
|
+
tr.removeMark(0, doc.content.size);
|
|
39
|
+
return tr.doc;
|
|
40
|
+
}
|
|
41
|
+
function isBlockStructureEqual(node1, node2) {
|
|
42
|
+
if (node1.type !== node2.type || node1.childCount !== node2.childCount) {
|
|
43
|
+
return false;
|
|
44
|
+
}
|
|
45
|
+
for (var index = 0; index < node1.childCount; index++) {
|
|
46
|
+
if (!isBlockStructureEqual(node1.child(index), node2.child(index))) {
|
|
47
|
+
return false;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
return true;
|
|
51
|
+
}
|
|
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.sanitizeNodeForPrivacy = sanitizeNodeForPrivacy;
|
|
8
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
9
|
var _traverse = require("@atlaskit/adf-utils/traverse");
|
|
10
|
-
var
|
|
10
|
+
var _isResolvingMentionProvider = require("@atlaskit/mention/is-resolving-mention-provider");
|
|
11
11
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
12
12
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
13
13
|
/**
|
|
@@ -41,7 +41,7 @@ function sanitizeNodeForPrivacy(json, providerFactory) {
|
|
|
41
41
|
var _handler = function handler(_name, providerPromise) {
|
|
42
42
|
if (providerPromise) {
|
|
43
43
|
providerPromise.then(function (provider) {
|
|
44
|
-
if ((0,
|
|
44
|
+
if ((0, _isResolvingMentionProvider.isResolvingMentionProvider)(provider)) {
|
|
45
45
|
mentionNames.forEach(function (name, id) {
|
|
46
46
|
provider.cacheMentionName(id, name);
|
|
47
47
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* ExtensionFloatingLabel.tsx generated by @compiled/babel-plugin v3.0.
|
|
1
|
+
/* ExtensionFloatingLabel.tsx generated by @compiled/babel-plugin v3.0.1 */
|
|
2
2
|
import "./ExtensionFloatingLabel.compiled.css";
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { ax, ix } from "@compiled/react/runtime";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* GeneratedContentReveal.tsx generated by @compiled/babel-plugin v3.0.
|
|
1
|
+
/* GeneratedContentReveal.tsx generated by @compiled/babel-plugin v3.0.1 */
|
|
2
2
|
import "./GeneratedContentReveal.compiled.css";
|
|
3
3
|
import { ax, ix } from "@compiled/react/runtime";
|
|
4
4
|
import React, { useCallback, useEffect, useState } from 'react';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* UnknownMacroPlaceholder.tsx generated by @compiled/babel-plugin v3.0.
|
|
1
|
+
/* UnknownMacroPlaceholder.tsx generated by @compiled/babel-plugin v3.0.1 */
|
|
2
2
|
import "./UnknownMacroPlaceholder.compiled.css";
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { ax, ix } from "@compiled/react/runtime";
|
|
@@ -10,6 +10,11 @@ export const imageBorderMessages = defineMessages({
|
|
|
10
10
|
defaultMessage: 'Image border options Color dropdown',
|
|
11
11
|
description: 'ARIA label for the dropdown to change the border color of an image.'
|
|
12
12
|
},
|
|
13
|
+
borderColorRadioGroupAriaLabel: {
|
|
14
|
+
id: 'fabric.editor.imageBorderColor.radioGroupAriaLabel',
|
|
15
|
+
defaultMessage: 'Color options',
|
|
16
|
+
description: 'ARIA label for the group of selectable border colors in the image border options panel.'
|
|
17
|
+
},
|
|
13
18
|
borderSize: {
|
|
14
19
|
id: 'fabric.editor.imageBorderSize',
|
|
15
20
|
defaultMessage: 'Size',
|
|
@@ -20,6 +25,11 @@ export const imageBorderMessages = defineMessages({
|
|
|
20
25
|
defaultMessage: 'Image border options Size dropdown',
|
|
21
26
|
description: 'ARIA label for the dropdown to change the border size of an image.'
|
|
22
27
|
},
|
|
28
|
+
borderSizeRadioGroupAriaLabel: {
|
|
29
|
+
id: 'fabric.editor.imageBorderSize.radioGroupAriaLabel',
|
|
30
|
+
defaultMessage: 'Size options',
|
|
31
|
+
description: 'ARIA label for the group of selectable border sizes in the image border options panel.'
|
|
32
|
+
},
|
|
23
33
|
addBorder: {
|
|
24
34
|
id: 'fabric.editor.addImageBorder',
|
|
25
35
|
defaultMessage: 'Add border',
|
|
@@ -13,7 +13,7 @@ const NETWORK_FAILURE_REGEX = /^network failure/i;
|
|
|
13
13
|
const RESIZE_OBSERVER_LOOP_REGEX = /ResizeObserver loop completed with undelivered notifications/;
|
|
14
14
|
const SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
15
15
|
const packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
16
|
-
const packageVersion = "122.
|
|
16
|
+
const packageVersion = "122.8.1";
|
|
17
17
|
const sanitiseSentryEvents = (data, _hint) => {
|
|
18
18
|
// Remove URL as it has UGC
|
|
19
19
|
// Ignored via go/ees007
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* CompactQuickInsertMenuItem.tsx generated by @compiled/babel-plugin v3.0.
|
|
1
|
+
/* CompactQuickInsertMenuItem.tsx generated by @compiled/babel-plugin v3.0.1 */
|
|
2
2
|
import "./CompactQuickInsertMenuItem.compiled.css";
|
|
3
3
|
import { ax, ix } from "@compiled/react/runtime";
|
|
4
4
|
import React, { useState } from 'react';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* QuickInsertHoverPreview.tsx generated by @compiled/babel-plugin v3.0.
|
|
1
|
+
/* QuickInsertHoverPreview.tsx generated by @compiled/babel-plugin v3.0.1 */
|
|
2
2
|
import "./QuickInsertHoverPreview.compiled.css";
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { ax, ix } from "@compiled/react/runtime";
|
|
@@ -14,7 +14,7 @@ import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
|
|
|
14
14
|
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
15
15
|
import Layer from '../Layer';
|
|
16
16
|
const packageName = "@atlaskit/editor-common";
|
|
17
|
-
const packageVersion = "122.
|
|
17
|
+
const packageVersion = "122.8.1";
|
|
18
18
|
const halfFocusRing = 1;
|
|
19
19
|
const dropOffset = '0, 8';
|
|
20
20
|
const fadeIn = keyframes({
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* DropdownTriggerWrapper.tsx generated by @compiled/babel-plugin v3.0.
|
|
1
|
+
/* DropdownTriggerWrapper.tsx generated by @compiled/babel-plugin v3.0.1 */
|
|
2
2
|
import "./DropdownTriggerWrapper.compiled.css";
|
|
3
3
|
import { ax, ix } from "@compiled/react/runtime";
|
|
4
4
|
import React from 'react';
|
|
@@ -47,7 +47,8 @@ const ColorPalette = props => {
|
|
|
47
47
|
intl: {
|
|
48
48
|
formatMessage
|
|
49
49
|
},
|
|
50
|
-
paletteOptions
|
|
50
|
+
paletteOptions,
|
|
51
|
+
ariaLabel
|
|
51
52
|
} = props;
|
|
52
53
|
const {
|
|
53
54
|
palette,
|
|
@@ -68,7 +69,8 @@ const ColorPalette = props => {
|
|
|
68
69
|
,
|
|
69
70
|
className: className,
|
|
70
71
|
key: `row-first-color-${row[0].value}`,
|
|
71
|
-
role: "radiogroup"
|
|
72
|
+
role: "radiogroup",
|
|
73
|
+
"aria-label": ariaLabel
|
|
72
74
|
}, row.map(({
|
|
73
75
|
value,
|
|
74
76
|
label,
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { JSONTransformer } from '@atlaskit/editor-json-transformer';
|
|
2
|
+
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
3
|
+
import { Transform } from '@atlaskit/editor-prosemirror/transform';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Returns true when documents have the same text and block structure, while ignoring marks and
|
|
7
|
+
* attributes. This is useful when comparing documents produced by different serialization paths.
|
|
8
|
+
*/
|
|
9
|
+
export function areDocsEqualByBlockStructureAndText(node1, node2) {
|
|
10
|
+
if (fg('confluence_ncs_step_diffing_version_history')) {
|
|
11
|
+
node1 = normalizeDocument(node1);
|
|
12
|
+
node2 = normalizeDocument(node2);
|
|
13
|
+
}
|
|
14
|
+
if (node1.textContent !== node2.textContent) {
|
|
15
|
+
return false;
|
|
16
|
+
}
|
|
17
|
+
const stripped1 = stripMarks(node1);
|
|
18
|
+
const stripped2 = stripMarks(node2);
|
|
19
|
+
return stripped1.nodeSize === stripped2.nodeSize && isBlockStructureEqual(stripped1, stripped2);
|
|
20
|
+
}
|
|
21
|
+
const transformers = new WeakMap();
|
|
22
|
+
function normalizeDocument(node) {
|
|
23
|
+
const schema = node.type.schema;
|
|
24
|
+
let transformer = transformers.get(schema);
|
|
25
|
+
if (!transformer) {
|
|
26
|
+
transformer = new JSONTransformer(schema);
|
|
27
|
+
transformers.set(schema, transformer);
|
|
28
|
+
}
|
|
29
|
+
return transformer.parse(transformer.encode(node));
|
|
30
|
+
}
|
|
31
|
+
function stripMarks(doc) {
|
|
32
|
+
const tr = new Transform(doc);
|
|
33
|
+
tr.removeMark(0, doc.content.size);
|
|
34
|
+
return tr.doc;
|
|
35
|
+
}
|
|
36
|
+
function isBlockStructureEqual(node1, node2) {
|
|
37
|
+
if (node1.type !== node2.type || node1.childCount !== node2.childCount) {
|
|
38
|
+
return false;
|
|
39
|
+
}
|
|
40
|
+
for (let index = 0; index < node1.childCount; index++) {
|
|
41
|
+
if (!isBlockStructureEqual(node1.child(index), node2.child(index))) {
|
|
42
|
+
return false;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
return true;
|
|
46
|
+
}
|
|
@@ -155,6 +155,7 @@ function areFragmentsEqual(frag1, frag2, attributesToIgnore, opts) {
|
|
|
155
155
|
});
|
|
156
156
|
return childrenEqual;
|
|
157
157
|
}
|
|
158
|
+
|
|
158
159
|
// eslint-disable-next-line @atlaskit/editor/no-re-export
|
|
159
160
|
export { getStepRange } from './getStepRange';
|
|
160
161
|
// eslint-disable-next-line @atlaskit/editor/no-re-export
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { traverse } from '@atlaskit/adf-utils/traverse';
|
|
2
|
-
import { isResolvingMentionProvider } from '@atlaskit/mention/
|
|
2
|
+
import { isResolvingMentionProvider } from '@atlaskit/mention/is-resolving-mention-provider';
|
|
3
3
|
/**
|
|
4
4
|
* Sanitises a document where some content should not be in the document (e.g. mention names).
|
|
5
5
|
*
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* ExtensionFloatingLabel.tsx generated by @compiled/babel-plugin v3.0.
|
|
1
|
+
/* ExtensionFloatingLabel.tsx generated by @compiled/babel-plugin v3.0.1 */
|
|
2
2
|
import "./ExtensionFloatingLabel.compiled.css";
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { ax, ix } from "@compiled/react/runtime";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* GeneratedContentReveal.tsx generated by @compiled/babel-plugin v3.0.
|
|
1
|
+
/* GeneratedContentReveal.tsx generated by @compiled/babel-plugin v3.0.1 */
|
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
3
|
import "./GeneratedContentReveal.compiled.css";
|
|
4
4
|
import { ax, ix } from "@compiled/react/runtime";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* UnknownMacroPlaceholder.tsx generated by @compiled/babel-plugin v3.0.
|
|
1
|
+
/* UnknownMacroPlaceholder.tsx generated by @compiled/babel-plugin v3.0.1 */
|
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
3
|
import "./UnknownMacroPlaceholder.compiled.css";
|
|
4
4
|
import * as React from 'react';
|
|
@@ -10,6 +10,11 @@ export var imageBorderMessages = defineMessages({
|
|
|
10
10
|
defaultMessage: 'Image border options Color dropdown',
|
|
11
11
|
description: 'ARIA label for the dropdown to change the border color of an image.'
|
|
12
12
|
},
|
|
13
|
+
borderColorRadioGroupAriaLabel: {
|
|
14
|
+
id: 'fabric.editor.imageBorderColor.radioGroupAriaLabel',
|
|
15
|
+
defaultMessage: 'Color options',
|
|
16
|
+
description: 'ARIA label for the group of selectable border colors in the image border options panel.'
|
|
17
|
+
},
|
|
13
18
|
borderSize: {
|
|
14
19
|
id: 'fabric.editor.imageBorderSize',
|
|
15
20
|
defaultMessage: 'Size',
|
|
@@ -20,6 +25,11 @@ export var imageBorderMessages = defineMessages({
|
|
|
20
25
|
defaultMessage: 'Image border options Size dropdown',
|
|
21
26
|
description: 'ARIA label for the dropdown to change the border size of an image.'
|
|
22
27
|
},
|
|
28
|
+
borderSizeRadioGroupAriaLabel: {
|
|
29
|
+
id: 'fabric.editor.imageBorderSize.radioGroupAriaLabel',
|
|
30
|
+
defaultMessage: 'Size options',
|
|
31
|
+
description: 'ARIA label for the group of selectable border sizes in the image border options panel.'
|
|
32
|
+
},
|
|
23
33
|
addBorder: {
|
|
24
34
|
id: 'fabric.editor.addImageBorder',
|
|
25
35
|
defaultMessage: 'Add border',
|
|
@@ -19,7 +19,7 @@ var NETWORK_FAILURE_REGEX = /^network failure/i;
|
|
|
19
19
|
var RESIZE_OBSERVER_LOOP_REGEX = /ResizeObserver loop completed with undelivered notifications/;
|
|
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 = "122.
|
|
22
|
+
var packageVersion = "122.8.1";
|
|
23
23
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
24
24
|
// Remove URL as it has UGC
|
|
25
25
|
// Ignored via go/ees007
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* CompactQuickInsertMenuItem.tsx generated by @compiled/babel-plugin v3.0.
|
|
1
|
+
/* CompactQuickInsertMenuItem.tsx generated by @compiled/babel-plugin v3.0.1 */
|
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
3
|
import "./CompactQuickInsertMenuItem.compiled.css";
|
|
4
4
|
import { ax, ix } from "@compiled/react/runtime";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* QuickInsertHoverPreview.tsx generated by @compiled/babel-plugin v3.0.
|
|
1
|
+
/* QuickInsertHoverPreview.tsx generated by @compiled/babel-plugin v3.0.1 */
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
3
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
4
4
|
import "./QuickInsertHoverPreview.compiled.css";
|
|
@@ -21,7 +21,7 @@ import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
|
|
|
21
21
|
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
22
22
|
import Layer from '../Layer';
|
|
23
23
|
var packageName = "@atlaskit/editor-common";
|
|
24
|
-
var packageVersion = "122.
|
|
24
|
+
var packageVersion = "122.8.1";
|
|
25
25
|
var halfFocusRing = 1;
|
|
26
26
|
var dropOffset = '0, 8';
|
|
27
27
|
var fadeIn = keyframes({
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* DropdownTriggerWrapper.tsx generated by @compiled/babel-plugin v3.0.
|
|
1
|
+
/* DropdownTriggerWrapper.tsx generated by @compiled/babel-plugin v3.0.1 */
|
|
2
2
|
import "./DropdownTriggerWrapper.compiled.css";
|
|
3
3
|
import { ax, ix } from "@compiled/react/runtime";
|
|
4
4
|
import React from 'react';
|
|
@@ -47,7 +47,8 @@ var ColorPalette = function ColorPalette(props) {
|
|
|
47
47
|
selectedColor = props.selectedColor,
|
|
48
48
|
className = props.className,
|
|
49
49
|
formatMessage = props.intl.formatMessage,
|
|
50
|
-
paletteOptions = props.paletteOptions
|
|
50
|
+
paletteOptions = props.paletteOptions,
|
|
51
|
+
ariaLabel = props.ariaLabel;
|
|
51
52
|
var palette = paletteOptions.palette,
|
|
52
53
|
hexToPaletteColor = paletteOptions.hexToPaletteColor,
|
|
53
54
|
paletteColorTooltipMessages = paletteOptions.paletteColorTooltipMessages;
|
|
@@ -65,7 +66,8 @@ var ColorPalette = function ColorPalette(props) {
|
|
|
65
66
|
,
|
|
66
67
|
className: className,
|
|
67
68
|
key: "row-first-color-".concat(row[0].value),
|
|
68
|
-
role: "radiogroup"
|
|
69
|
+
role: "radiogroup",
|
|
70
|
+
"aria-label": ariaLabel
|
|
69
71
|
}, row.map(function (_ref) {
|
|
70
72
|
var value = _ref.value,
|
|
71
73
|
label = _ref.label,
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { JSONTransformer } from '@atlaskit/editor-json-transformer';
|
|
2
|
+
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
3
|
+
import { Transform } from '@atlaskit/editor-prosemirror/transform';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Returns true when documents have the same text and block structure, while ignoring marks and
|
|
7
|
+
* attributes. This is useful when comparing documents produced by different serialization paths.
|
|
8
|
+
*/
|
|
9
|
+
export function areDocsEqualByBlockStructureAndText(node1, node2) {
|
|
10
|
+
if (fg('confluence_ncs_step_diffing_version_history')) {
|
|
11
|
+
node1 = normalizeDocument(node1);
|
|
12
|
+
node2 = normalizeDocument(node2);
|
|
13
|
+
}
|
|
14
|
+
if (node1.textContent !== node2.textContent) {
|
|
15
|
+
return false;
|
|
16
|
+
}
|
|
17
|
+
var stripped1 = stripMarks(node1);
|
|
18
|
+
var stripped2 = stripMarks(node2);
|
|
19
|
+
return stripped1.nodeSize === stripped2.nodeSize && isBlockStructureEqual(stripped1, stripped2);
|
|
20
|
+
}
|
|
21
|
+
var transformers = new WeakMap();
|
|
22
|
+
function normalizeDocument(node) {
|
|
23
|
+
var schema = node.type.schema;
|
|
24
|
+
var transformer = transformers.get(schema);
|
|
25
|
+
if (!transformer) {
|
|
26
|
+
transformer = new JSONTransformer(schema);
|
|
27
|
+
transformers.set(schema, transformer);
|
|
28
|
+
}
|
|
29
|
+
return transformer.parse(transformer.encode(node));
|
|
30
|
+
}
|
|
31
|
+
function stripMarks(doc) {
|
|
32
|
+
var tr = new Transform(doc);
|
|
33
|
+
tr.removeMark(0, doc.content.size);
|
|
34
|
+
return tr.doc;
|
|
35
|
+
}
|
|
36
|
+
function isBlockStructureEqual(node1, node2) {
|
|
37
|
+
if (node1.type !== node2.type || node1.childCount !== node2.childCount) {
|
|
38
|
+
return false;
|
|
39
|
+
}
|
|
40
|
+
for (var index = 0; index < node1.childCount; index++) {
|
|
41
|
+
if (!isBlockStructureEqual(node1.child(index), node2.child(index))) {
|
|
42
|
+
return false;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
return true;
|
|
46
|
+
}
|
|
@@ -175,6 +175,7 @@ function areFragmentsEqual(frag1, frag2, attributesToIgnore, opts) {
|
|
|
175
175
|
});
|
|
176
176
|
return childrenEqual;
|
|
177
177
|
}
|
|
178
|
+
|
|
178
179
|
// eslint-disable-next-line @atlaskit/editor/no-re-export
|
|
179
180
|
export { getStepRange } from './getStepRange';
|
|
180
181
|
// eslint-disable-next-line @atlaskit/editor/no-re-export
|
|
@@ -2,7 +2,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
2
2
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
3
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
4
|
import { traverse } from '@atlaskit/adf-utils/traverse';
|
|
5
|
-
import { isResolvingMentionProvider } from '@atlaskit/mention/
|
|
5
|
+
import { isResolvingMentionProvider } from '@atlaskit/mention/is-resolving-mention-provider';
|
|
6
6
|
/**
|
|
7
7
|
* Sanitises a document where some content should not be in the document (e.g. mention names).
|
|
8
8
|
*
|
|
@@ -1,52 +1,62 @@
|
|
|
1
1
|
export declare const imageBorderMessages: {
|
|
2
|
-
|
|
3
|
-
id: string;
|
|
2
|
+
addBorder: {
|
|
4
3
|
defaultMessage: string;
|
|
5
4
|
description: string;
|
|
6
|
-
};
|
|
7
|
-
borderColorDropdownAriaLabel: {
|
|
8
5
|
id: string;
|
|
6
|
+
};
|
|
7
|
+
borderColor: {
|
|
9
8
|
defaultMessage: string;
|
|
10
9
|
description: string;
|
|
11
|
-
};
|
|
12
|
-
borderSize: {
|
|
13
10
|
id: string;
|
|
11
|
+
};
|
|
12
|
+
borderColorDropdownAriaLabel: {
|
|
14
13
|
defaultMessage: string;
|
|
15
14
|
description: string;
|
|
16
|
-
};
|
|
17
|
-
borderSizeDropdownAriaLabel: {
|
|
18
15
|
id: string;
|
|
16
|
+
};
|
|
17
|
+
borderColorRadioGroupAriaLabel: {
|
|
19
18
|
defaultMessage: string;
|
|
20
19
|
description: string;
|
|
21
|
-
};
|
|
22
|
-
addBorder: {
|
|
23
20
|
id: string;
|
|
21
|
+
};
|
|
22
|
+
borderOptions: {
|
|
24
23
|
defaultMessage: string;
|
|
25
24
|
description: string;
|
|
26
|
-
};
|
|
27
|
-
removeBorder: {
|
|
28
25
|
id: string;
|
|
26
|
+
};
|
|
27
|
+
borderSize: {
|
|
29
28
|
defaultMessage: string;
|
|
30
29
|
description: string;
|
|
31
|
-
};
|
|
32
|
-
borderOptions: {
|
|
33
30
|
id: string;
|
|
31
|
+
};
|
|
32
|
+
borderSizeBold: {
|
|
34
33
|
defaultMessage: string;
|
|
35
34
|
description: string;
|
|
36
|
-
};
|
|
37
|
-
borderSizeSubtle: {
|
|
38
35
|
id: string;
|
|
36
|
+
};
|
|
37
|
+
borderSizeDropdownAriaLabel: {
|
|
39
38
|
defaultMessage: string;
|
|
40
39
|
description: string;
|
|
40
|
+
id: string;
|
|
41
41
|
};
|
|
42
42
|
borderSizeMedium: {
|
|
43
|
+
defaultMessage: string;
|
|
44
|
+
description: string;
|
|
43
45
|
id: string;
|
|
46
|
+
};
|
|
47
|
+
borderSizeRadioGroupAriaLabel: {
|
|
44
48
|
defaultMessage: string;
|
|
45
49
|
description: string;
|
|
50
|
+
id: string;
|
|
46
51
|
};
|
|
47
|
-
|
|
52
|
+
borderSizeSubtle: {
|
|
53
|
+
defaultMessage: string;
|
|
54
|
+
description: string;
|
|
48
55
|
id: string;
|
|
56
|
+
};
|
|
57
|
+
removeBorder: {
|
|
49
58
|
defaultMessage: string;
|
|
50
59
|
description: string;
|
|
60
|
+
id: string;
|
|
51
61
|
};
|
|
52
62
|
};
|
|
@@ -6,6 +6,10 @@ import React from 'react';
|
|
|
6
6
|
import type { WithIntlProps, WrappedComponentProps } from 'react-intl';
|
|
7
7
|
import type { PaletteColor, PaletteTooltipMessages } from './Palettes/type';
|
|
8
8
|
interface Props {
|
|
9
|
+
/**
|
|
10
|
+
* Accessible name for the radio group each row of colors is rendered as.
|
|
11
|
+
*/
|
|
12
|
+
ariaLabel?: string;
|
|
9
13
|
className?: string;
|
|
10
14
|
cols?: number;
|
|
11
15
|
onClick: (value: string, label: string) => void;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Node } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
+
/**
|
|
3
|
+
* Returns true when documents have the same text and block structure, while ignoring marks and
|
|
4
|
+
* attributes. This is useful when comparing documents produced by different serialization paths.
|
|
5
|
+
*/
|
|
6
|
+
export declare function areDocsEqualByBlockStructureAndText(node1: Node, node2: Node): boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-common",
|
|
3
|
-
"version": "122.
|
|
3
|
+
"version": "122.8.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/"
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"@atlaskit/media-picker": "^72.4.0",
|
|
65
65
|
"@atlaskit/media-ui": "^30.16.0",
|
|
66
66
|
"@atlaskit/media-viewer": "^54.8.0",
|
|
67
|
-
"@atlaskit/mention": "^29.
|
|
67
|
+
"@atlaskit/mention": "^29.2.0",
|
|
68
68
|
"@atlaskit/menu": "^10.2.0",
|
|
69
69
|
"@atlaskit/object": "^2.3.0",
|
|
70
70
|
"@atlaskit/onboarding": "^15.4.0",
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
"@atlaskit/task-decision": "^21.10.0",
|
|
85
85
|
"@atlaskit/teams-app-config": "^3.1.0",
|
|
86
86
|
"@atlaskit/textfield": "^10.2.0",
|
|
87
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
87
|
+
"@atlaskit/tmp-editor-statsig": "^197.0.0",
|
|
88
88
|
"@atlaskit/tokens": "^17.0.0",
|
|
89
89
|
"@atlaskit/tooltip": "^24.3.0",
|
|
90
90
|
"@atlaskit/width-detector": "^7.2.0",
|
|
@@ -145,6 +145,10 @@
|
|
|
145
145
|
"sinon": "^2.2.0"
|
|
146
146
|
},
|
|
147
147
|
"platform-feature-flags": {
|
|
148
|
+
"confluence_ncs_step_diffing_version_history": {
|
|
149
|
+
"type": "boolean",
|
|
150
|
+
"referenceOnly": true
|
|
151
|
+
},
|
|
148
152
|
"platform_editor_add_text_color_tracking": {
|
|
149
153
|
"type": "boolean"
|
|
150
154
|
},
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@atlaskit/editor-common/utils/areDocsEqualByBlockStructureAndText",
|
|
3
|
+
"main": "../../dist/cjs/utils/areDocsEqualByBlockStructureAndText.js",
|
|
4
|
+
"module": "../../dist/esm/utils/areDocsEqualByBlockStructureAndText.js",
|
|
5
|
+
"module:es2019": "../../dist/es2019/utils/areDocsEqualByBlockStructureAndText.js",
|
|
6
|
+
"sideEffects": [
|
|
7
|
+
"**/*.compiled.css"
|
|
8
|
+
],
|
|
9
|
+
"types": "../../dist/types/utils/areDocsEqualByBlockStructureAndText.d.ts"
|
|
10
|
+
}
|