@atlaskit/editor-common 111.11.4 → 111.11.6
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 +25 -0
- package/dist/cjs/analytics/types/table-events.js +1 -0
- package/dist/cjs/extensibility/ExtensionNodeWrapper.js +1 -9
- package/dist/cjs/messages/block-menu.js +19 -9
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/node-anchor/node-anchor-provider.js +84 -37
- package/dist/cjs/ugc-tokens/editor-ugc-token-names.js +4 -0
- package/dist/cjs/ugc-tokens/index.js +7 -0
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/cjs/ui-menu/ArrowKeyNavigationProvider/MenuArrowKeyNavigationProvider/index.js +7 -1
- package/dist/es2019/analytics/types/table-events.js +1 -0
- package/dist/es2019/extensibility/ExtensionNodeWrapper.js +1 -9
- package/dist/es2019/messages/block-menu.js +19 -9
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/node-anchor/node-anchor-provider.js +84 -37
- package/dist/es2019/ugc-tokens/editor-ugc-token-names.js +4 -0
- package/dist/es2019/ugc-tokens/index.js +2 -1
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/es2019/ui-menu/ArrowKeyNavigationProvider/MenuArrowKeyNavigationProvider/index.js +7 -1
- package/dist/esm/analytics/types/table-events.js +1 -0
- package/dist/esm/extensibility/ExtensionNodeWrapper.js +1 -9
- package/dist/esm/messages/block-menu.js +19 -9
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/node-anchor/node-anchor-provider.js +84 -37
- package/dist/esm/ugc-tokens/editor-ugc-token-names.js +4 -0
- package/dist/esm/ugc-tokens/index.js +2 -1
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/esm/ui-menu/ArrowKeyNavigationProvider/MenuArrowKeyNavigationProvider/index.js +7 -1
- package/dist/types/analytics/types/ai-streaming.d.ts +1 -0
- package/dist/types/analytics/types/table-events.d.ts +6 -1
- package/dist/types/element-browser/components/ElementSearch.d.ts +1 -1
- package/dist/types/link/ConfigureLinkOverlay/Dropdown.d.ts +1 -1
- package/dist/types/link/ConfigureLinkOverlay/index.d.ts +1 -1
- package/dist/types/messages/block-menu.d.ts +10 -0
- package/dist/types/styles/shared/headings.d.ts +1 -1
- package/dist/types/styles/shared/media-single.d.ts +2 -2
- package/dist/types/styles/shared/native-anchor.d.ts +1 -1
- package/dist/types/styles/shared/table.d.ts +1 -1
- package/dist/types/styles/shared/tableCell.d.ts +1 -1
- package/dist/types/ugc-tokens/editor-ugc-token-names.d.ts +3 -0
- package/dist/types/ugc-tokens/index.d.ts +2 -1
- package/dist/types/ui/IntlProviderIfMissingWrapper/index.d.ts +2 -1
- package/dist/types/ui/MediaSingle/styled.d.ts +2 -2
- package/dist/types/ui/ResizerLegacy/styled.d.ts +1 -1
- package/dist/types/ui-menu/ArrowKeyNavigationProvider/types.d.ts +7 -1
- package/dist/types/ui-menu/ToolbarButton/index.d.ts +1 -1
- package/dist/types-ts4.5/analytics/types/ai-streaming.d.ts +1 -0
- package/dist/types-ts4.5/analytics/types/table-events.d.ts +6 -1
- package/dist/types-ts4.5/element-browser/components/ElementSearch.d.ts +1 -1
- package/dist/types-ts4.5/link/ConfigureLinkOverlay/Dropdown.d.ts +1 -1
- package/dist/types-ts4.5/link/ConfigureLinkOverlay/index.d.ts +1 -1
- package/dist/types-ts4.5/messages/block-menu.d.ts +10 -0
- package/dist/types-ts4.5/styles/shared/headings.d.ts +1 -1
- package/dist/types-ts4.5/styles/shared/media-single.d.ts +2 -2
- package/dist/types-ts4.5/styles/shared/native-anchor.d.ts +1 -1
- package/dist/types-ts4.5/styles/shared/table.d.ts +1 -1
- package/dist/types-ts4.5/styles/shared/tableCell.d.ts +1 -1
- package/dist/types-ts4.5/ugc-tokens/editor-ugc-token-names.d.ts +3 -0
- package/dist/types-ts4.5/ugc-tokens/index.d.ts +2 -1
- package/dist/types-ts4.5/ui/IntlProviderIfMissingWrapper/index.d.ts +2 -1
- package/dist/types-ts4.5/ui/MediaSingle/styled.d.ts +2 -2
- package/dist/types-ts4.5/ui/ResizerLegacy/styled.d.ts +1 -1
- package/dist/types-ts4.5/ui-menu/ArrowKeyNavigationProvider/types.d.ts +7 -1
- package/dist/types-ts4.5/ui-menu/ToolbarButton/index.d.ts +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,30 @@
|
|
|
1
1
|
# @atlaskit/editor-common
|
|
2
2
|
|
|
3
|
+
## 111.11.6
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`9d0d19d5018ae`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/9d0d19d5018ae) -
|
|
8
|
+
Remove jsx literal strings in block menu fall back components
|
|
9
|
+
- [`9030267782d4c`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/9030267782d4c) -
|
|
10
|
+
Re-do fix for table overflow in inline excerpt.
|
|
11
|
+
- Updated dependencies
|
|
12
|
+
|
|
13
|
+
## 111.11.5
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- [`7f6ca0d7b6afc`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/7f6ca0d7b6afc) -
|
|
18
|
+
Updated the table drag menu to fire a track analytic event when the menu is opened
|
|
19
|
+
- [`1ce3b7e203e89`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/1ce3b7e203e89) -
|
|
20
|
+
Add traceid attribute to noDocChange event
|
|
21
|
+
- [`3b3aa281c8524`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/3b3aa281c8524) -
|
|
22
|
+
Editor 4149 Fix keyboard navigation inside turn into
|
|
23
|
+
- [`49dad8567c387`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/49dad8567c387) -
|
|
24
|
+
EDITOR-4948 - Change performance mode threshold condition to include doc size, node count, and LCM
|
|
25
|
+
check.
|
|
26
|
+
- Updated dependencies
|
|
27
|
+
|
|
3
28
|
## 111.11.4
|
|
4
29
|
|
|
5
30
|
### Patch Changes
|
|
@@ -35,6 +35,7 @@ var TABLE_ACTION = exports.TABLE_ACTION = /*#__PURE__*/function (TABLE_ACTION) {
|
|
|
35
35
|
TABLE_ACTION["MOVED_COLUMN"] = "movedColumn";
|
|
36
36
|
TABLE_ACTION["CLONED_ROW"] = "clonedRow";
|
|
37
37
|
TABLE_ACTION["CLONED_COLUMN"] = "clonedColumn";
|
|
38
|
+
TABLE_ACTION["DRAG_MENU_OPENED"] = "dragMenuOpened";
|
|
38
39
|
/**
|
|
39
40
|
* This is a unique action that's used to track legacy table move behaviour flow of insert+copy+paste. Please use
|
|
40
41
|
* the MOVED_ROW | MOVED_COLUMN actions if you want to track events which move row/cols in a single step.
|
|
@@ -28,14 +28,6 @@ var styles = (0, _react2.css)({
|
|
|
28
28
|
position: 'relative'
|
|
29
29
|
}
|
|
30
30
|
});
|
|
31
|
-
|
|
32
|
-
// on exp cleanup, merge this style to the one above
|
|
33
|
-
var inlineExtensionFixStyles = (0, _react2.css)({
|
|
34
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
35
|
-
'&.inline-extension': {
|
|
36
|
-
maxWidth: '100%'
|
|
37
|
-
}
|
|
38
|
-
});
|
|
39
31
|
var hoverStyles = (0, _react2.css)({
|
|
40
32
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors
|
|
41
33
|
':has(.extension-label:hover) .extension-container, :has(.extension-edit-toggle-container:hover) .extension-container': {
|
|
@@ -88,6 +80,6 @@ var ExtensionNodeWrapper = exports.ExtensionNodeWrapper = function ExtensionNode
|
|
|
88
80
|
return (0, _react2.jsx)("span", {
|
|
89
81
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
|
|
90
82
|
className: wrapperClassNames,
|
|
91
|
-
css: [styles, (0, _expValEquals.expValEquals)('
|
|
83
|
+
css: [styles, (0, _expValEquals.expValEquals)('cc_editor_ttvc_release_bundle_one', 'extensionHoverRefactor', true) && hoverStyles]
|
|
92
84
|
}, children, nodeType === 'inlineExtension' && _whitespace.ZERO_WIDTH_SPACE);
|
|
93
85
|
};
|
|
@@ -19,12 +19,12 @@ var messages = exports.messages = (0, _reactIntlNext.defineMessages)({
|
|
|
19
19
|
moveUpBlock: {
|
|
20
20
|
id: 'fabric.editor.block.menu.move.up',
|
|
21
21
|
defaultMessage: 'Move up',
|
|
22
|
-
description: 'Move the selected block up'
|
|
22
|
+
description: 'Move the selected block up in the document'
|
|
23
23
|
},
|
|
24
24
|
moveDownBlock: {
|
|
25
25
|
id: 'fabric.editor.block.menu.move.down',
|
|
26
26
|
defaultMessage: 'Move down',
|
|
27
|
-
description: 'Move the selected block down'
|
|
27
|
+
description: 'Move the selected block down in the document'
|
|
28
28
|
},
|
|
29
29
|
copyLink: {
|
|
30
30
|
id: 'fabric.editor.block.menu.copy.link',
|
|
@@ -49,17 +49,17 @@ var messages = exports.messages = (0, _reactIntlNext.defineMessages)({
|
|
|
49
49
|
codeBlock: {
|
|
50
50
|
id: 'fabric.editor.block.menu.codeblock',
|
|
51
51
|
defaultMessage: 'Code block',
|
|
52
|
-
description: 'Convert to a code block'
|
|
52
|
+
description: 'Convert the selected block to a code block'
|
|
53
53
|
},
|
|
54
54
|
layout: {
|
|
55
55
|
id: 'fabric.editor.block.menu.layout',
|
|
56
56
|
defaultMessage: 'Layout',
|
|
57
|
-
description: 'Convert to a layout node'
|
|
57
|
+
description: 'Convert the selected block to a layout node'
|
|
58
58
|
},
|
|
59
59
|
deleteBlock: {
|
|
60
60
|
id: 'fabric.editor.block.menu.delete.block',
|
|
61
61
|
defaultMessage: 'Delete',
|
|
62
|
-
description: 'Delete the selected block'
|
|
62
|
+
description: 'Delete the selected block from the document'
|
|
63
63
|
},
|
|
64
64
|
turnInto: {
|
|
65
65
|
id: 'fabric.editor.block.menu.turn.into',
|
|
@@ -94,21 +94,31 @@ var messages = exports.messages = (0, _reactIntlNext.defineMessages)({
|
|
|
94
94
|
create: {
|
|
95
95
|
id: 'fabric.editor.block.menu.create',
|
|
96
96
|
defaultMessage: 'Create',
|
|
97
|
-
description: 'Menu section title'
|
|
97
|
+
description: 'Menu section title for creating new block types'
|
|
98
98
|
},
|
|
99
99
|
headings: {
|
|
100
100
|
id: 'fabric.editor.block.menu.headings',
|
|
101
101
|
defaultMessage: 'Headings',
|
|
102
|
-
description: 'Menu section title'
|
|
102
|
+
description: 'Menu section title for heading block types'
|
|
103
103
|
},
|
|
104
104
|
suggested: {
|
|
105
105
|
id: 'fabric.editor.block.menu.suggested',
|
|
106
106
|
defaultMessage: 'Suggested',
|
|
107
|
-
description: 'Menu section title'
|
|
107
|
+
description: 'Menu section title for suggested block types'
|
|
108
108
|
},
|
|
109
109
|
structure: {
|
|
110
110
|
id: 'fabric.editor.block.menu.structure',
|
|
111
111
|
defaultMessage: 'Structure',
|
|
112
|
-
description: 'Menu section title'
|
|
112
|
+
description: 'Menu section title for structural block types'
|
|
113
|
+
},
|
|
114
|
+
fallbackNestedMenu: {
|
|
115
|
+
id: 'fabric.editor.block.menu.fallback.nested.menu',
|
|
116
|
+
defaultMessage: 'Nested Menu',
|
|
117
|
+
description: 'Fallback text displayed for nested menu component in block menu when proper component is not available'
|
|
118
|
+
},
|
|
119
|
+
fallbackMenuItem: {
|
|
120
|
+
id: 'fabric.editor.block.menu.fallback.menu.item',
|
|
121
|
+
defaultMessage: 'Block Menu Item',
|
|
122
|
+
description: 'Fallback text displayed for menu item component in block menu when proper component is not available'
|
|
113
123
|
}
|
|
114
124
|
});
|
|
@@ -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.11.5";
|
|
23
23
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
24
24
|
// Remove URL as it has UGC
|
|
25
25
|
// Ignored via go/ees007
|
|
@@ -13,36 +13,23 @@ var _expVal = require("@atlaskit/tmp-editor-statsig/expVal");
|
|
|
13
13
|
var _utils = require("../utils");
|
|
14
14
|
var _dynamicBitArray = require("./dynamic-bit-array");
|
|
15
15
|
/**
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
* Note: legacy-content macros add a damped contribution based on ADF length to avoid
|
|
19
|
-
* parsing nested ADF on every check, which is inefficient.
|
|
20
|
-
*/
|
|
21
|
-
var countNodesInDoc = function countNodesInDoc(doc, lcmDampingFactor) {
|
|
22
|
-
var nodeCount = 0;
|
|
23
|
-
doc.descendants(function (node) {
|
|
24
|
-
var _node$attrs;
|
|
25
|
-
nodeCount += 1;
|
|
26
|
-
if (((_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.extensionKey) === 'legacy-content') {
|
|
27
|
-
var _node$attrs2;
|
|
28
|
-
var adfLength = (_node$attrs2 = node.attrs) === null || _node$attrs2 === void 0 || (_node$attrs2 = _node$attrs2.parameters) === null || _node$attrs2 === void 0 || (_node$attrs2 = _node$attrs2.adf) === null || _node$attrs2 === void 0 ? void 0 : _node$attrs2.length;
|
|
29
|
-
if (typeof adfLength === 'number' && lcmDampingFactor > 0) {
|
|
30
|
-
nodeCount += Math.ceil(adfLength / lcmDampingFactor);
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
});
|
|
34
|
-
return nodeCount;
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* Guard against test overrides returning booleans for numeric params.
|
|
16
|
+
* Gets a numeric experiment param, returning undefined if the value is not a valid number.
|
|
17
|
+
* This guards against test overrides returning booleans or strings for numeric params.
|
|
39
18
|
*/
|
|
40
|
-
var getNumericExperimentParam = function getNumericExperimentParam(
|
|
41
|
-
var rawValue = (0, _expVal.expVal)(
|
|
19
|
+
var getNumericExperimentParam = function getNumericExperimentParam(paramName, fallbackValue) {
|
|
20
|
+
var rawValue = (0, _expVal.expVal)('cc_editor_limited_mode_expanded', paramName, fallbackValue);
|
|
42
21
|
if (typeof rawValue === 'number') {
|
|
43
22
|
return rawValue;
|
|
44
23
|
}
|
|
45
|
-
|
|
24
|
+
|
|
25
|
+
// Handle string values from test overrides
|
|
26
|
+
if (typeof rawValue === 'string') {
|
|
27
|
+
var parsed = parseInt(rawValue, 10);
|
|
28
|
+
if (!isNaN(parsed)) {
|
|
29
|
+
return parsed;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
return undefined;
|
|
46
33
|
};
|
|
47
34
|
var NodeAnchorProvider = exports.NodeAnchorProvider = /*#__PURE__*/function () {
|
|
48
35
|
function NodeAnchorProvider() {
|
|
@@ -119,23 +106,83 @@ var NodeAnchorProvider = exports.NodeAnchorProvider = /*#__PURE__*/function () {
|
|
|
119
106
|
var nodeIdProviderMap = new WeakMap();
|
|
120
107
|
var LIMITED_MODE_NODE_SIZE_THRESHOLD = 40000;
|
|
121
108
|
|
|
122
|
-
|
|
123
|
-
|
|
109
|
+
/**
|
|
110
|
+
* Calculates custom document size including LCM ADF lengths (for non-expanded path).
|
|
111
|
+
* This function can be removed when cc_editor_limited_mode_expanded is cleaned up.
|
|
112
|
+
*/
|
|
113
|
+
var getCustomDocSize = function getCustomDocSize(doc) {
|
|
114
|
+
var lcmAdfLength = 0;
|
|
115
|
+
doc.descendants(function (node) {
|
|
116
|
+
var _node$attrs;
|
|
117
|
+
if (((_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.extensionKey) === 'legacy-content') {
|
|
118
|
+
var _node$attrs$parameter, _node$attrs2;
|
|
119
|
+
lcmAdfLength += (_node$attrs$parameter = (_node$attrs2 = node.attrs) === null || _node$attrs2 === void 0 || (_node$attrs2 = _node$attrs2.parameters) === null || _node$attrs2 === void 0 || (_node$attrs2 = _node$attrs2.adf) === null || _node$attrs2 === void 0 ? void 0 : _node$attrs2.length) !== null && _node$attrs$parameter !== void 0 ? _node$attrs$parameter : 0;
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
return doc.nodeSize + lcmAdfLength;
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Determines whether limited mode should be enabled.
|
|
127
|
+
* This logic mirrors the limited mode plugin implementation, but lives here to avoid a circular dependency.
|
|
128
|
+
* If it changes, update the matching logic in `editor-plugin-limited-mode/src/pm-plugins/main.ts`.
|
|
129
|
+
*
|
|
130
|
+
* Under the expanded gate, limited mode is activated when ANY of the following conditions are met:
|
|
131
|
+
* 1. Document size exceeds `docSizeThreshold` (if defined) - checked first as O(1)
|
|
132
|
+
* 2. Node count exceeds `nodeCountThreshold` (if defined)
|
|
133
|
+
* 3. Document contains a legacy-content macro (LCM) (if `includeLcmInThreshold` is true)
|
|
134
|
+
*
|
|
135
|
+
* Performance optimisations:
|
|
136
|
+
* - Doc size is checked first (O(1)) - if it exceeds threshold, we skip traversal entirely.
|
|
137
|
+
* - If `includeLcmInThreshold` is enabled and we find an LCM, we exit traversal early.
|
|
138
|
+
* - If neither node count nor LCM conditions are configured, we skip traversal entirely.
|
|
139
|
+
*/
|
|
124
140
|
var isLimitedModeEnabled = function isLimitedModeEnabled(editorView) {
|
|
141
|
+
var doc = editorView.state.doc;
|
|
125
142
|
if ((0, _expVal.expVal)('cc_editor_limited_mode_expanded', 'isEnabled', false)) {
|
|
126
|
-
var
|
|
127
|
-
var
|
|
128
|
-
var
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
143
|
+
var nodeCountThreshold = getNumericExperimentParam('nodeCountThreshold', 5000);
|
|
144
|
+
var docSizeThreshold = getNumericExperimentParam('docSizeThreshold', 30000);
|
|
145
|
+
var includeLcmInThreshold = Boolean((0, _expVal.expVal)('cc_editor_limited_mode_expanded', 'includeLcmInThreshold', false));
|
|
146
|
+
|
|
147
|
+
// Early exit: doc size exceeds threshold - O(1), no traversal needed
|
|
148
|
+
if (docSizeThreshold !== undefined && doc.nodeSize > docSizeThreshold) {
|
|
149
|
+
return true;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
// Early exit: no traversal needed if neither condition is configured
|
|
153
|
+
var needNodeCount = nodeCountThreshold !== undefined;
|
|
154
|
+
if (!needNodeCount && !includeLcmInThreshold) {
|
|
155
|
+
return false;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
// Single traversal for node count and/or LCM detection
|
|
159
|
+
var nodeCount = 0;
|
|
160
|
+
var hasLcm = false;
|
|
161
|
+
doc.descendants(function (node) {
|
|
133
162
|
var _node$attrs3;
|
|
163
|
+
nodeCount += 1;
|
|
134
164
|
if (((_node$attrs3 = node.attrs) === null || _node$attrs3 === void 0 ? void 0 : _node$attrs3.extensionKey) === 'legacy-content') {
|
|
135
|
-
|
|
136
|
-
|
|
165
|
+
hasLcm = true;
|
|
166
|
+
|
|
167
|
+
// Early exit: LCM found and condition is enabled - no need to continue counting
|
|
168
|
+
if (includeLcmInThreshold) {
|
|
169
|
+
return false;
|
|
170
|
+
}
|
|
137
171
|
}
|
|
138
172
|
});
|
|
173
|
+
|
|
174
|
+
// LCM condition takes precedence (if we early exited traversal, this is why)
|
|
175
|
+
if (includeLcmInThreshold && hasLcm) {
|
|
176
|
+
return true;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
// Check node count threshold
|
|
180
|
+
if (needNodeCount && nodeCount > nodeCountThreshold) {
|
|
181
|
+
return true;
|
|
182
|
+
}
|
|
183
|
+
return false;
|
|
184
|
+
} else {
|
|
185
|
+
var customDocSize = getCustomDocSize(doc);
|
|
139
186
|
return customDocSize > LIMITED_MODE_NODE_SIZE_THRESHOLD;
|
|
140
187
|
}
|
|
141
188
|
};
|
|
@@ -34,6 +34,10 @@ var editorUGCTokensModernized = exports.editorUGCTokensModernized = {
|
|
|
34
34
|
'editor.font.weight.heading.h5.bold': '700',
|
|
35
35
|
'editor.font.weight.heading.h6.bold': '700'
|
|
36
36
|
};
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* These styles are duplicated in packages/editor/editor-plugin-block-type/src/pm-plugins/ui/ToolbarBlockType/HeadingButton.tsx
|
|
40
|
+
*/
|
|
37
41
|
var editorUGCTokensRefreshed = exports.editorUGCTokensRefreshed = {
|
|
38
42
|
'editor.font.heading.h1': 'normal 600 1.71429em/1.16667 "Atlassian Sans", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Ubuntu, "Helvetica Neue", sans-serif',
|
|
39
43
|
'editor.font.heading.h2': 'normal 600 1.42857em/1.2 "Atlassian Sans", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Ubuntu, "Helvetica Neue", sans-serif',
|
|
@@ -10,4 +10,11 @@ Object.defineProperty(exports, "editorUGCToken", {
|
|
|
10
10
|
return _getEditorUgcToken.default;
|
|
11
11
|
}
|
|
12
12
|
});
|
|
13
|
+
Object.defineProperty(exports, "editorUGCTokensRefreshed", {
|
|
14
|
+
enumerable: true,
|
|
15
|
+
get: function get() {
|
|
16
|
+
return _editorUgcTokenNames.editorUGCTokensRefreshed;
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
var _editorUgcTokenNames = require("./editor-ugc-token-names");
|
|
13
20
|
var _getEditorUgcToken = _interopRequireDefault(require("./get-editor-ugc-token"));
|
|
@@ -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.11.5";
|
|
28
28
|
var halfFocusRing = 1;
|
|
29
29
|
var dropOffset = '0, 8';
|
|
30
30
|
var fadeIn = (0, _react2.keyframes)({
|
|
@@ -74,7 +74,10 @@ var MenuArrowKeyNavigationProvider = exports.MenuArrowKeyNavigationProvider = fu
|
|
|
74
74
|
}
|
|
75
75
|
}, [currentSelectedItemIndex, onSelection, incrementIndex, decrementIndex]);
|
|
76
76
|
(0, _react.useLayoutEffect)(function () {
|
|
77
|
-
|
|
77
|
+
// Backwards compatible behaviour:
|
|
78
|
+
// - `true` disables all key handling (no listeners attached)
|
|
79
|
+
// - a function is evaluated per event inside the handler
|
|
80
|
+
if (disableArrowKeyNavigation === true) {
|
|
78
81
|
return;
|
|
79
82
|
}
|
|
80
83
|
|
|
@@ -84,6 +87,9 @@ var MenuArrowKeyNavigationProvider = exports.MenuArrowKeyNavigationProvider = fu
|
|
|
84
87
|
*/
|
|
85
88
|
var handleKeyDown = function handleKeyDown(event) {
|
|
86
89
|
var _wrapperRef$current;
|
|
90
|
+
if (typeof disableArrowKeyNavigation === 'function' && disableArrowKeyNavigation(event)) {
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
87
93
|
var targetElement = event.target;
|
|
88
94
|
|
|
89
95
|
// Tab key on menu items can be handled in the parent components of dropdown menus with KeydownHandlerContext
|
|
@@ -29,6 +29,7 @@ export let TABLE_ACTION = /*#__PURE__*/function (TABLE_ACTION) {
|
|
|
29
29
|
TABLE_ACTION["MOVED_COLUMN"] = "movedColumn";
|
|
30
30
|
TABLE_ACTION["CLONED_ROW"] = "clonedRow";
|
|
31
31
|
TABLE_ACTION["CLONED_COLUMN"] = "clonedColumn";
|
|
32
|
+
TABLE_ACTION["DRAG_MENU_OPENED"] = "dragMenuOpened";
|
|
32
33
|
/**
|
|
33
34
|
* This is a unique action that's used to track legacy table move behaviour flow of insert+copy+paste. Please use
|
|
34
35
|
* the MOVED_ROW | MOVED_COLUMN actions if you want to track events which move row/cols in a single step.
|
|
@@ -20,14 +20,6 @@ const styles = css({
|
|
|
20
20
|
position: 'relative'
|
|
21
21
|
}
|
|
22
22
|
});
|
|
23
|
-
|
|
24
|
-
// on exp cleanup, merge this style to the one above
|
|
25
|
-
const inlineExtensionFixStyles = css({
|
|
26
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
27
|
-
'&.inline-extension': {
|
|
28
|
-
maxWidth: '100%'
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
23
|
const hoverStyles = css({
|
|
32
24
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors
|
|
33
25
|
':has(.extension-label:hover) .extension-container, :has(.extension-edit-toggle-container:hover) .extension-container': {
|
|
@@ -82,6 +74,6 @@ export const ExtensionNodeWrapper = ({
|
|
|
82
74
|
return jsx("span", {
|
|
83
75
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
|
|
84
76
|
className: wrapperClassNames,
|
|
85
|
-
css: [styles, expValEquals('
|
|
77
|
+
css: [styles, expValEquals('cc_editor_ttvc_release_bundle_one', 'extensionHoverRefactor', true) && hoverStyles]
|
|
86
78
|
}, children, nodeType === 'inlineExtension' && ZERO_WIDTH_SPACE);
|
|
87
79
|
};
|
|
@@ -13,12 +13,12 @@ export const messages = defineMessages({
|
|
|
13
13
|
moveUpBlock: {
|
|
14
14
|
id: 'fabric.editor.block.menu.move.up',
|
|
15
15
|
defaultMessage: 'Move up',
|
|
16
|
-
description: 'Move the selected block up'
|
|
16
|
+
description: 'Move the selected block up in the document'
|
|
17
17
|
},
|
|
18
18
|
moveDownBlock: {
|
|
19
19
|
id: 'fabric.editor.block.menu.move.down',
|
|
20
20
|
defaultMessage: 'Move down',
|
|
21
|
-
description: 'Move the selected block down'
|
|
21
|
+
description: 'Move the selected block down in the document'
|
|
22
22
|
},
|
|
23
23
|
copyLink: {
|
|
24
24
|
id: 'fabric.editor.block.menu.copy.link',
|
|
@@ -43,17 +43,17 @@ export const messages = defineMessages({
|
|
|
43
43
|
codeBlock: {
|
|
44
44
|
id: 'fabric.editor.block.menu.codeblock',
|
|
45
45
|
defaultMessage: 'Code block',
|
|
46
|
-
description: 'Convert to a code block'
|
|
46
|
+
description: 'Convert the selected block to a code block'
|
|
47
47
|
},
|
|
48
48
|
layout: {
|
|
49
49
|
id: 'fabric.editor.block.menu.layout',
|
|
50
50
|
defaultMessage: 'Layout',
|
|
51
|
-
description: 'Convert to a layout node'
|
|
51
|
+
description: 'Convert the selected block to a layout node'
|
|
52
52
|
},
|
|
53
53
|
deleteBlock: {
|
|
54
54
|
id: 'fabric.editor.block.menu.delete.block',
|
|
55
55
|
defaultMessage: 'Delete',
|
|
56
|
-
description: 'Delete the selected block'
|
|
56
|
+
description: 'Delete the selected block from the document'
|
|
57
57
|
},
|
|
58
58
|
turnInto: {
|
|
59
59
|
id: 'fabric.editor.block.menu.turn.into',
|
|
@@ -88,21 +88,31 @@ export const messages = defineMessages({
|
|
|
88
88
|
create: {
|
|
89
89
|
id: 'fabric.editor.block.menu.create',
|
|
90
90
|
defaultMessage: 'Create',
|
|
91
|
-
description: 'Menu section title'
|
|
91
|
+
description: 'Menu section title for creating new block types'
|
|
92
92
|
},
|
|
93
93
|
headings: {
|
|
94
94
|
id: 'fabric.editor.block.menu.headings',
|
|
95
95
|
defaultMessage: 'Headings',
|
|
96
|
-
description: 'Menu section title'
|
|
96
|
+
description: 'Menu section title for heading block types'
|
|
97
97
|
},
|
|
98
98
|
suggested: {
|
|
99
99
|
id: 'fabric.editor.block.menu.suggested',
|
|
100
100
|
defaultMessage: 'Suggested',
|
|
101
|
-
description: 'Menu section title'
|
|
101
|
+
description: 'Menu section title for suggested block types'
|
|
102
102
|
},
|
|
103
103
|
structure: {
|
|
104
104
|
id: 'fabric.editor.block.menu.structure',
|
|
105
105
|
defaultMessage: 'Structure',
|
|
106
|
-
description: 'Menu section title'
|
|
106
|
+
description: 'Menu section title for structural block types'
|
|
107
|
+
},
|
|
108
|
+
fallbackNestedMenu: {
|
|
109
|
+
id: 'fabric.editor.block.menu.fallback.nested.menu',
|
|
110
|
+
defaultMessage: 'Nested Menu',
|
|
111
|
+
description: 'Fallback text displayed for nested menu component in block menu when proper component is not available'
|
|
112
|
+
},
|
|
113
|
+
fallbackMenuItem: {
|
|
114
|
+
id: 'fabric.editor.block.menu.fallback.menu.item',
|
|
115
|
+
defaultMessage: 'Block Menu Item',
|
|
116
|
+
description: 'Fallback text displayed for menu item component in block menu when proper component is not available'
|
|
107
117
|
}
|
|
108
118
|
});
|
|
@@ -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.11.5";
|
|
8
8
|
const sanitiseSentryEvents = (data, _hint) => {
|
|
9
9
|
// Remove URL as it has UGC
|
|
10
10
|
// Ignored via go/ees007
|
|
@@ -5,36 +5,23 @@ import { isEmptyDocument } from '../utils';
|
|
|
5
5
|
import { DynamicBitArray } from './dynamic-bit-array';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* Note: legacy-content macros add a damped contribution based on ADF length to avoid
|
|
11
|
-
* parsing nested ADF on every check, which is inefficient.
|
|
12
|
-
*/
|
|
13
|
-
const countNodesInDoc = (doc, lcmDampingFactor) => {
|
|
14
|
-
let nodeCount = 0;
|
|
15
|
-
doc.descendants(node => {
|
|
16
|
-
var _node$attrs;
|
|
17
|
-
nodeCount += 1;
|
|
18
|
-
if (((_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.extensionKey) === 'legacy-content') {
|
|
19
|
-
var _node$attrs2, _node$attrs2$paramete, _node$attrs2$paramete2;
|
|
20
|
-
const adfLength = (_node$attrs2 = node.attrs) === null || _node$attrs2 === void 0 ? void 0 : (_node$attrs2$paramete = _node$attrs2.parameters) === null || _node$attrs2$paramete === void 0 ? void 0 : (_node$attrs2$paramete2 = _node$attrs2$paramete.adf) === null || _node$attrs2$paramete2 === void 0 ? void 0 : _node$attrs2$paramete2.length;
|
|
21
|
-
if (typeof adfLength === 'number' && lcmDampingFactor > 0) {
|
|
22
|
-
nodeCount += Math.ceil(adfLength / lcmDampingFactor);
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
|
-
return nodeCount;
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* Guard against test overrides returning booleans for numeric params.
|
|
8
|
+
* Gets a numeric experiment param, returning undefined if the value is not a valid number.
|
|
9
|
+
* This guards against test overrides returning booleans or strings for numeric params.
|
|
31
10
|
*/
|
|
32
|
-
const getNumericExperimentParam = (
|
|
33
|
-
const rawValue = expVal(
|
|
11
|
+
const getNumericExperimentParam = (paramName, fallbackValue) => {
|
|
12
|
+
const rawValue = expVal('cc_editor_limited_mode_expanded', paramName, fallbackValue);
|
|
34
13
|
if (typeof rawValue === 'number') {
|
|
35
14
|
return rawValue;
|
|
36
15
|
}
|
|
37
|
-
|
|
16
|
+
|
|
17
|
+
// Handle string values from test overrides
|
|
18
|
+
if (typeof rawValue === 'string') {
|
|
19
|
+
const parsed = parseInt(rawValue, 10);
|
|
20
|
+
if (!isNaN(parsed)) {
|
|
21
|
+
return parsed;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
return undefined;
|
|
38
25
|
};
|
|
39
26
|
export class NodeAnchorProvider {
|
|
40
27
|
constructor(limitedMode = false, emptyDoc = false) {
|
|
@@ -95,23 +82,83 @@ export class NodeAnchorProvider {
|
|
|
95
82
|
const nodeIdProviderMap = new WeakMap();
|
|
96
83
|
const LIMITED_MODE_NODE_SIZE_THRESHOLD = 40000;
|
|
97
84
|
|
|
98
|
-
|
|
99
|
-
|
|
85
|
+
/**
|
|
86
|
+
* Calculates custom document size including LCM ADF lengths (for non-expanded path).
|
|
87
|
+
* This function can be removed when cc_editor_limited_mode_expanded is cleaned up.
|
|
88
|
+
*/
|
|
89
|
+
const getCustomDocSize = doc => {
|
|
90
|
+
let lcmAdfLength = 0;
|
|
91
|
+
doc.descendants(node => {
|
|
92
|
+
var _node$attrs;
|
|
93
|
+
if (((_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.extensionKey) === 'legacy-content') {
|
|
94
|
+
var _node$attrs$parameter, _node$attrs2, _node$attrs2$paramete, _node$attrs2$paramete2;
|
|
95
|
+
lcmAdfLength += (_node$attrs$parameter = (_node$attrs2 = node.attrs) === null || _node$attrs2 === void 0 ? void 0 : (_node$attrs2$paramete = _node$attrs2.parameters) === null || _node$attrs2$paramete === void 0 ? void 0 : (_node$attrs2$paramete2 = _node$attrs2$paramete.adf) === null || _node$attrs2$paramete2 === void 0 ? void 0 : _node$attrs2$paramete2.length) !== null && _node$attrs$parameter !== void 0 ? _node$attrs$parameter : 0;
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
return doc.nodeSize + lcmAdfLength;
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Determines whether limited mode should be enabled.
|
|
103
|
+
* This logic mirrors the limited mode plugin implementation, but lives here to avoid a circular dependency.
|
|
104
|
+
* If it changes, update the matching logic in `editor-plugin-limited-mode/src/pm-plugins/main.ts`.
|
|
105
|
+
*
|
|
106
|
+
* Under the expanded gate, limited mode is activated when ANY of the following conditions are met:
|
|
107
|
+
* 1. Document size exceeds `docSizeThreshold` (if defined) - checked first as O(1)
|
|
108
|
+
* 2. Node count exceeds `nodeCountThreshold` (if defined)
|
|
109
|
+
* 3. Document contains a legacy-content macro (LCM) (if `includeLcmInThreshold` is true)
|
|
110
|
+
*
|
|
111
|
+
* Performance optimisations:
|
|
112
|
+
* - Doc size is checked first (O(1)) - if it exceeds threshold, we skip traversal entirely.
|
|
113
|
+
* - If `includeLcmInThreshold` is enabled and we find an LCM, we exit traversal early.
|
|
114
|
+
* - If neither node count nor LCM conditions are configured, we skip traversal entirely.
|
|
115
|
+
*/
|
|
100
116
|
const isLimitedModeEnabled = editorView => {
|
|
117
|
+
const doc = editorView.state.doc;
|
|
101
118
|
if (expVal('cc_editor_limited_mode_expanded', 'isEnabled', false)) {
|
|
102
|
-
const
|
|
103
|
-
const
|
|
104
|
-
const
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
119
|
+
const nodeCountThreshold = getNumericExperimentParam('nodeCountThreshold', 5000);
|
|
120
|
+
const docSizeThreshold = getNumericExperimentParam('docSizeThreshold', 30000);
|
|
121
|
+
const includeLcmInThreshold = Boolean(expVal('cc_editor_limited_mode_expanded', 'includeLcmInThreshold', false));
|
|
122
|
+
|
|
123
|
+
// Early exit: doc size exceeds threshold - O(1), no traversal needed
|
|
124
|
+
if (docSizeThreshold !== undefined && doc.nodeSize > docSizeThreshold) {
|
|
125
|
+
return true;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
// Early exit: no traversal needed if neither condition is configured
|
|
129
|
+
const needNodeCount = nodeCountThreshold !== undefined;
|
|
130
|
+
if (!needNodeCount && !includeLcmInThreshold) {
|
|
131
|
+
return false;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
// Single traversal for node count and/or LCM detection
|
|
135
|
+
let nodeCount = 0;
|
|
136
|
+
let hasLcm = false;
|
|
137
|
+
doc.descendants(node => {
|
|
109
138
|
var _node$attrs3;
|
|
139
|
+
nodeCount += 1;
|
|
110
140
|
if (((_node$attrs3 = node.attrs) === null || _node$attrs3 === void 0 ? void 0 : _node$attrs3.extensionKey) === 'legacy-content') {
|
|
111
|
-
|
|
112
|
-
|
|
141
|
+
hasLcm = true;
|
|
142
|
+
|
|
143
|
+
// Early exit: LCM found and condition is enabled - no need to continue counting
|
|
144
|
+
if (includeLcmInThreshold) {
|
|
145
|
+
return false;
|
|
146
|
+
}
|
|
113
147
|
}
|
|
114
148
|
});
|
|
149
|
+
|
|
150
|
+
// LCM condition takes precedence (if we early exited traversal, this is why)
|
|
151
|
+
if (includeLcmInThreshold && hasLcm) {
|
|
152
|
+
return true;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
// Check node count threshold
|
|
156
|
+
if (needNodeCount && nodeCount > nodeCountThreshold) {
|
|
157
|
+
return true;
|
|
158
|
+
}
|
|
159
|
+
return false;
|
|
160
|
+
} else {
|
|
161
|
+
const customDocSize = getCustomDocSize(doc);
|
|
115
162
|
return customDocSize > LIMITED_MODE_NODE_SIZE_THRESHOLD;
|
|
116
163
|
}
|
|
117
164
|
};
|
|
@@ -28,6 +28,10 @@ export const editorUGCTokensModernized = {
|
|
|
28
28
|
'editor.font.weight.heading.h5.bold': '700',
|
|
29
29
|
'editor.font.weight.heading.h6.bold': '700'
|
|
30
30
|
};
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* These styles are duplicated in packages/editor/editor-plugin-block-type/src/pm-plugins/ui/ToolbarBlockType/HeadingButton.tsx
|
|
34
|
+
*/
|
|
31
35
|
export const editorUGCTokensRefreshed = {
|
|
32
36
|
'editor.font.heading.h1': 'normal 600 1.71429em/1.16667 "Atlassian Sans", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Ubuntu, "Helvetica Neue", sans-serif',
|
|
33
37
|
'editor.font.heading.h2': 'normal 600 1.42857em/1.2 "Atlassian Sans", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Ubuntu, "Helvetica Neue", sans-serif',
|
|
@@ -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.11.5";
|
|
18
18
|
const halfFocusRing = 1;
|
|
19
19
|
const dropOffset = '0, 8';
|
|
20
20
|
const fadeIn = keyframes({
|