@atlaskit/editor-common 111.9.0 → 111.9.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 +25 -0
- package/dist/cjs/analytics/types/enums.js +1 -0
- package/dist/cjs/experiences/Experience.js +3 -3
- package/dist/cjs/experiences/ExperienceCheckDomMutation.js +1 -1
- package/dist/cjs/experiences/consts.js +4 -4
- package/dist/cjs/messages/syncBlock.js +10 -0
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/node-anchor/node-anchor-provider.js +50 -10
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/cjs/ui-color/ColorPalette/Palettes/highlightColorPalette.js +1 -18
- package/dist/cjs/ui-color/index.js +0 -6
- package/dist/es2019/analytics/types/enums.js +1 -0
- package/dist/es2019/experiences/Experience.js +3 -3
- package/dist/es2019/experiences/ExperienceCheckDomMutation.js +1 -1
- package/dist/es2019/experiences/consts.js +4 -4
- package/dist/es2019/messages/syncBlock.js +10 -0
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/node-anchor/node-anchor-provider.js +51 -10
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/es2019/ui-color/ColorPalette/Palettes/highlightColorPalette.js +1 -18
- package/dist/es2019/ui-color/index.js +1 -1
- package/dist/esm/analytics/types/enums.js +1 -0
- package/dist/esm/experiences/Experience.js +3 -3
- package/dist/esm/experiences/ExperienceCheckDomMutation.js +1 -1
- package/dist/esm/experiences/consts.js +4 -4
- package/dist/esm/messages/syncBlock.js +10 -0
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/node-anchor/node-anchor-provider.js +51 -10
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/esm/ui-color/ColorPalette/Palettes/highlightColorPalette.js +1 -18
- package/dist/esm/ui-color/index.js +1 -1
- package/dist/types/analytics/types/enums.d.ts +1 -0
- package/dist/types/analytics/types/sync-block-events.d.ts +4 -2
- package/dist/types/experiences/Experience.d.ts +3 -3
- package/dist/types/experiences/ExperienceCheckDomMutation.d.ts +2 -2
- package/dist/types/experiences/consts.d.ts +4 -4
- package/dist/types/experiences/types.d.ts +1 -1
- package/dist/types/messages/syncBlock.d.ts +10 -0
- package/dist/types/ui-color/ColorPalette/Palettes/highlightColorPalette.d.ts +0 -5
- package/dist/types/ui-color/index.d.ts +1 -1
- package/dist/types-ts4.5/analytics/types/enums.d.ts +1 -0
- package/dist/types-ts4.5/analytics/types/sync-block-events.d.ts +4 -2
- package/dist/types-ts4.5/experiences/Experience.d.ts +3 -3
- package/dist/types-ts4.5/experiences/ExperienceCheckDomMutation.d.ts +2 -2
- package/dist/types-ts4.5/experiences/consts.d.ts +4 -4
- package/dist/types-ts4.5/experiences/types.d.ts +1 -1
- package/dist/types-ts4.5/messages/syncBlock.d.ts +10 -0
- package/dist/types-ts4.5/ui-color/ColorPalette/Palettes/highlightColorPalette.d.ts +0 -5
- package/dist/types-ts4.5/ui-color/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.9.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`256b4fc86bae0`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/256b4fc86bae0) -
|
|
8
|
+
[ux] EDITOR-4464 Limited Mode: Change threshold to activate limited mode to use the node count
|
|
9
|
+
rather than the raw document size.
|
|
10
|
+
- [`25c388e0f807a`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/25c388e0f807a) -
|
|
11
|
+
EDITOR-4684 Clean up platform_editor_add_orange_highlight_color experiment - orange highlight
|
|
12
|
+
color is now permanently enabled
|
|
13
|
+
- Updated dependencies
|
|
14
|
+
|
|
15
|
+
## 111.9.1
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- [`81230b670d02c`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/81230b670d02c) -
|
|
20
|
+
ED-29744 camel case experience attributes
|
|
21
|
+
- [`7702ea47c5329`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/7702ea47c5329) -
|
|
22
|
+
Add messages for synced block unpublished flag
|
|
23
|
+
- [`2a9dfb4b326e6`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/2a9dfb4b326e6) -
|
|
24
|
+
EDITOR-4698 add missing analytics for fetch references, graphql subsciption update, reference sync
|
|
25
|
+
block insert and delete success
|
|
26
|
+
- Updated dependencies
|
|
27
|
+
|
|
3
28
|
## 111.9.0
|
|
4
29
|
|
|
5
30
|
### Minor Changes
|
|
@@ -125,6 +125,7 @@ var ACTION = exports.ACTION = /*#__PURE__*/function (ACTION) {
|
|
|
125
125
|
ACTION["SYNCED_BLOCK_CREATE"] = "syncedBlockCreate";
|
|
126
126
|
ACTION["SYNCED_BLOCK_UPDATE"] = "syncedBlockUpdate";
|
|
127
127
|
ACTION["SYNCED_BLOCK_FETCH"] = "syncedBlockFetch";
|
|
128
|
+
ACTION["SYNCED_BLOCK_FETCH_REFERENCES"] = "syncedBlockFetchReferences";
|
|
128
129
|
ACTION["SYNCED_BLOCK_DELETE"] = "syncedBlockDelete";
|
|
129
130
|
ACTION["SYNCED_BLOCK_GET_SOURCE_INFO"] = "syncedBlockGetSourceInfo";
|
|
130
131
|
ACTION["SYNCHRONY_DISCONNECTED"] = "synchronyDisconnected";
|
|
@@ -38,14 +38,14 @@ var Experience = exports.Experience = /*#__PURE__*/function () {
|
|
|
38
38
|
/**
|
|
39
39
|
* Creates a new Experience instance for tracking user experiences.
|
|
40
40
|
*
|
|
41
|
-
* @param id - Unique identifier for the experience e.g. '
|
|
41
|
+
* @param id - Unique identifier for the experience e.g. 'toolbarOpen' 'menuAction'
|
|
42
42
|
* @param options - Configuration options for the experience
|
|
43
43
|
* @param options.checks - Experience checks to monitor for completion
|
|
44
44
|
* @param options.dispatchAnalyticsEvent - Function to dispatch analytics events
|
|
45
45
|
* @param options.sampleRate - Sample rate for experienceSampled events
|
|
46
46
|
* @param options.metadata - Global metadata to attach to all events
|
|
47
|
-
* @param options.action - Optional sub identifier for the specific experience action e.g. 'bold' '
|
|
48
|
-
* @param options.actionSubjectId - Optional sub identifier for the experience action subject e.g. '
|
|
47
|
+
* @param options.action - Optional sub identifier for the specific experience action e.g. 'bold' 'insertTable'
|
|
48
|
+
* @param options.actionSubjectId - Optional sub identifier for the experience action subject e.g. 'selectionToolbar' 'quickInsert'
|
|
49
49
|
*/
|
|
50
50
|
function Experience(id, options) {
|
|
51
51
|
var _options$sampleRate;
|
|
@@ -45,7 +45,7 @@ var ExperienceCheckDomMutation = exports.ExperienceCheckDomMutation = /*#__PURE_
|
|
|
45
45
|
if (result) {
|
|
46
46
|
callback(result);
|
|
47
47
|
}
|
|
48
|
-
} catch (
|
|
48
|
+
} catch (_unused) {
|
|
49
49
|
callback({
|
|
50
50
|
status: 'failure',
|
|
51
51
|
reason: _consts.EXPERIENCE_FAILURE_REASON.DOM_MUTATION_CHECK_ERROR
|
|
@@ -18,11 +18,11 @@ var EXPERIENCE_FAILURE_REASON = exports.EXPERIENCE_FAILURE_REASON = {
|
|
|
18
18
|
/**
|
|
19
19
|
* Target element could not be found when starting DOM mutation observation
|
|
20
20
|
*/
|
|
21
|
-
DOM_MUTATION_TARGET_NOT_FOUND: '
|
|
21
|
+
DOM_MUTATION_TARGET_NOT_FOUND: 'domMutationTargetNotFound',
|
|
22
22
|
/**
|
|
23
23
|
* Error occurred during DOM mutation check execution
|
|
24
24
|
*/
|
|
25
|
-
DOM_MUTATION_CHECK_ERROR: '
|
|
25
|
+
DOM_MUTATION_CHECK_ERROR: 'domMutationCheckError'
|
|
26
26
|
};
|
|
27
27
|
|
|
28
28
|
/**
|
|
@@ -52,7 +52,7 @@ var DEFAULT_EXPERIENCE_SAMPLE_RATE = exports.DEFAULT_EXPERIENCE_SAMPLE_RATE = 0.
|
|
|
52
52
|
var EXPERIENCE_ID = exports.EXPERIENCE_ID = {
|
|
53
53
|
ASYNC_OPERATION: 'asyncOperation',
|
|
54
54
|
MENU_ACTION: 'menuAction',
|
|
55
|
-
MENU_OPEN: '
|
|
55
|
+
MENU_OPEN: 'menuOpen',
|
|
56
56
|
TOOLBAR_ACTION: 'toolbarAction',
|
|
57
|
-
TOOLBAR_OPEN: '
|
|
57
|
+
TOOLBAR_OPEN: 'toolbarOpen'
|
|
58
58
|
};
|
|
@@ -286,6 +286,16 @@ var syncBlockMessages = exports.syncBlockMessages = (0, _reactIntlNext.defineMes
|
|
|
286
286
|
defaultMessage: 'Request access',
|
|
287
287
|
description: 'Label shown in the synced location dropdown option when the sync block is not accessible to the user'
|
|
288
288
|
},
|
|
289
|
+
unpublishedSyncBlockPastedTitle: {
|
|
290
|
+
id: 'fabric.editor.unpublishedSyncBlockPastedTitle',
|
|
291
|
+
defaultMessage: 'Pasted from unpublished page',
|
|
292
|
+
description: 'Title in flag which appears when a reference to an unpublished sync block is pasted'
|
|
293
|
+
},
|
|
294
|
+
unpublishedSyncBlockPastedDescription: {
|
|
295
|
+
id: 'fabric.editor.unpublishedSyncBlockPastedDescription',
|
|
296
|
+
defaultMessage: 'When the page is published, the content will be displayed.',
|
|
297
|
+
description: 'Description in flag which appears when a reference to an unpublished sync block is pasted'
|
|
298
|
+
},
|
|
289
299
|
unsyncButton: {
|
|
290
300
|
id: 'fabric.editor.syncedBlock.unsync',
|
|
291
301
|
defaultMessage: 'Unsync',
|
|
@@ -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 = "111.
|
|
22
|
+
var packageVersion = "111.9.1";
|
|
23
23
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
24
24
|
// Remove URL as it has UGC
|
|
25
25
|
// Ignored via go/ees007
|
|
@@ -9,8 +9,41 @@ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/cl
|
|
|
9
9
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
10
10
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
11
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
12
|
+
var _expVal = require("@atlaskit/tmp-editor-statsig/expVal");
|
|
12
13
|
var _utils = require("../utils");
|
|
13
14
|
var _dynamicBitArray = require("./dynamic-bit-array");
|
|
15
|
+
/**
|
|
16
|
+
* Counts nodes in the document.
|
|
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.
|
|
39
|
+
*/
|
|
40
|
+
var getNumericExperimentParam = function getNumericExperimentParam(experimentName, paramName, fallbackValue) {
|
|
41
|
+
var rawValue = (0, _expVal.expVal)(experimentName, paramName, fallbackValue);
|
|
42
|
+
if (typeof rawValue === 'number') {
|
|
43
|
+
return rawValue;
|
|
44
|
+
}
|
|
45
|
+
return fallbackValue;
|
|
46
|
+
};
|
|
14
47
|
var NodeAnchorProvider = exports.NodeAnchorProvider = /*#__PURE__*/function () {
|
|
15
48
|
function NodeAnchorProvider() {
|
|
16
49
|
var limitedMode = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
@@ -89,15 +122,22 @@ var LIMITED_MODE_NODE_SIZE_THRESHOLD = 40000;
|
|
|
89
122
|
// This is duplicate from the limited mode plugin to avoid circular dependency
|
|
90
123
|
// We can refactor this later to have a shared util package
|
|
91
124
|
var isLimitedModeEnabled = function isLimitedModeEnabled(editorView) {
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
var
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
125
|
+
if ((0, _expVal.expVal)('cc_editor_limited_mode_expanded', 'isEnabled', false)) {
|
|
126
|
+
var lcmNodeCountDampingFactor = getNumericExperimentParam('cc_editor_limited_mode_expanded', 'lcmNodeCountDampingFactor', 10);
|
|
127
|
+
var nodeCountThreshold = getNumericExperimentParam('cc_editor_limited_mode_expanded', 'nodeCountThreshold', 1000);
|
|
128
|
+
var nodeCount = countNodesInDoc(editorView.state.doc, lcmNodeCountDampingFactor);
|
|
129
|
+
return nodeCount > nodeCountThreshold;
|
|
130
|
+
} else {
|
|
131
|
+
var customDocSize = editorView.state.doc.nodeSize;
|
|
132
|
+
editorView.state.doc.descendants(function (node) {
|
|
133
|
+
var _node$attrs3;
|
|
134
|
+
if (((_node$attrs3 = node.attrs) === null || _node$attrs3 === void 0 ? void 0 : _node$attrs3.extensionKey) === 'legacy-content') {
|
|
135
|
+
var _node$attrs$parameter, _node$attrs4;
|
|
136
|
+
customDocSize += (_node$attrs$parameter = (_node$attrs4 = node.attrs) === null || _node$attrs4 === void 0 || (_node$attrs4 = _node$attrs4.parameters) === null || _node$attrs4 === void 0 || (_node$attrs4 = _node$attrs4.adf) === null || _node$attrs4 === void 0 ? void 0 : _node$attrs4.length) !== null && _node$attrs$parameter !== void 0 ? _node$attrs$parameter : 0;
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
return customDocSize > LIMITED_MODE_NODE_SIZE_THRESHOLD;
|
|
140
|
+
}
|
|
101
141
|
};
|
|
102
142
|
|
|
103
143
|
// Get the NodeIdProvider for a specific EditorView instance.
|
|
@@ -105,7 +145,7 @@ var isLimitedModeEnabled = function isLimitedModeEnabled(editorView) {
|
|
|
105
145
|
var getNodeIdProvider = exports.getNodeIdProvider = function getNodeIdProvider(editorView) {
|
|
106
146
|
if (!nodeIdProviderMap.has(editorView)) {
|
|
107
147
|
if ((0, _platformFeatureFlags.fg)('platform_editor_native_anchor_patch_2')) {
|
|
108
|
-
// if the limited mode flag is on, enable limited mode based on
|
|
148
|
+
// if the limited mode flag is on, enable limited mode based on the threshold
|
|
109
149
|
// only for the first time
|
|
110
150
|
var limitedMode = isLimitedModeEnabled(editorView);
|
|
111
151
|
var isEmptyDoc = (0, _utils.isEmptyDocument)(editorView.state.doc);
|
|
@@ -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 = "111.
|
|
27
|
+
var packageVersion = "111.9.1";
|
|
28
28
|
var halfFocusRing = 1;
|
|
29
29
|
var dropOffset = '0, 8';
|
|
30
30
|
var fadeIn = (0, _react2.keyframes)({
|
|
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.
|
|
7
|
+
exports.highlightColorPalette = exports.REMOVE_HIGHLIGHT_COLOR = exports.EditorDiagonalLineIcon = void 0;
|
|
8
8
|
var _react = require("@emotion/react");
|
|
9
9
|
var _adfSchema = require("@atlaskit/adf-schema");
|
|
10
10
|
var _tokens = require("@atlaskit/tokens");
|
|
@@ -58,12 +58,6 @@ var EditorDiagonalLineIcon = exports.EditorDiagonalLineIcon = function EditorDia
|
|
|
58
58
|
})
|
|
59
59
|
);
|
|
60
60
|
};
|
|
61
|
-
|
|
62
|
-
// eslint-disable-next-line @repo/internal/deprecations/deprecation-ticket-required
|
|
63
|
-
/**
|
|
64
|
-
* @deprecated Use `highlightColorPaletteNext` instead, which supports both orange and yellow highlight color
|
|
65
|
-
* This will be removed when platform_editor_add_orange_highlight_color is cleaned up
|
|
66
|
-
*/
|
|
67
61
|
var highlightColorPalette = exports.highlightColorPalette = [{
|
|
68
62
|
value: REMOVE_HIGHLIGHT_COLOR,
|
|
69
63
|
label: 'No color',
|
|
@@ -74,15 +68,4 @@ var highlightColorPalette = exports.highlightColorPalette = [{
|
|
|
74
68
|
}];
|
|
75
69
|
_adfSchema.backgroundColorPalette.forEach(function (label, color) {
|
|
76
70
|
highlightColorPalette.push((0, _textColorPalette.mapPaletteColor)(label, color));
|
|
77
|
-
});
|
|
78
|
-
var highlightColorPaletteNext = exports.highlightColorPaletteNext = [{
|
|
79
|
-
value: REMOVE_HIGHLIGHT_COLOR,
|
|
80
|
-
label: 'No color',
|
|
81
|
-
// Mostly informative, only used for analytics
|
|
82
|
-
border: "var(--ds-border, #091E4224)",
|
|
83
|
-
message: (0, _getColorMessage.default)(_paletteMessages.default, 'no-color'),
|
|
84
|
-
decorator: (0, _react.jsx)(EditorDiagonalLineIcon, null)
|
|
85
|
-
}];
|
|
86
|
-
_adfSchema.backgroundColorPaletteNext.forEach(function (label, color) {
|
|
87
|
-
highlightColorPaletteNext.push((0, _textColorPalette.mapPaletteColor)(label, color));
|
|
88
71
|
});
|
|
@@ -94,12 +94,6 @@ Object.defineProperty(exports, "highlightColorPalette", {
|
|
|
94
94
|
return _highlightColorPalette.highlightColorPalette;
|
|
95
95
|
}
|
|
96
96
|
});
|
|
97
|
-
Object.defineProperty(exports, "highlightColorPaletteNext", {
|
|
98
|
-
enumerable: true,
|
|
99
|
-
get: function get() {
|
|
100
|
-
return _highlightColorPalette.highlightColorPaletteNext;
|
|
101
|
-
}
|
|
102
|
-
});
|
|
103
97
|
Object.defineProperty(exports, "panelBackgroundPalette", {
|
|
104
98
|
enumerable: true,
|
|
105
99
|
get: function get() {
|
|
@@ -119,6 +119,7 @@ export let ACTION = /*#__PURE__*/function (ACTION) {
|
|
|
119
119
|
ACTION["SYNCED_BLOCK_CREATE"] = "syncedBlockCreate";
|
|
120
120
|
ACTION["SYNCED_BLOCK_UPDATE"] = "syncedBlockUpdate";
|
|
121
121
|
ACTION["SYNCED_BLOCK_FETCH"] = "syncedBlockFetch";
|
|
122
|
+
ACTION["SYNCED_BLOCK_FETCH_REFERENCES"] = "syncedBlockFetchReferences";
|
|
122
123
|
ACTION["SYNCED_BLOCK_DELETE"] = "syncedBlockDelete";
|
|
123
124
|
ACTION["SYNCED_BLOCK_GET_SOURCE_INFO"] = "syncedBlockGetSourceInfo";
|
|
124
125
|
ACTION["SYNCHRONY_DISCONNECTED"] = "synchronyDisconnected";
|
|
@@ -27,14 +27,14 @@ export class Experience {
|
|
|
27
27
|
/**
|
|
28
28
|
* Creates a new Experience instance for tracking user experiences.
|
|
29
29
|
*
|
|
30
|
-
* @param id - Unique identifier for the experience e.g. '
|
|
30
|
+
* @param id - Unique identifier for the experience e.g. 'toolbarOpen' 'menuAction'
|
|
31
31
|
* @param options - Configuration options for the experience
|
|
32
32
|
* @param options.checks - Experience checks to monitor for completion
|
|
33
33
|
* @param options.dispatchAnalyticsEvent - Function to dispatch analytics events
|
|
34
34
|
* @param options.sampleRate - Sample rate for experienceSampled events
|
|
35
35
|
* @param options.metadata - Global metadata to attach to all events
|
|
36
|
-
* @param options.action - Optional sub identifier for the specific experience action e.g. 'bold' '
|
|
37
|
-
* @param options.actionSubjectId - Optional sub identifier for the experience action subject e.g. '
|
|
36
|
+
* @param options.action - Optional sub identifier for the specific experience action e.g. 'bold' 'insertTable'
|
|
37
|
+
* @param options.actionSubjectId - Optional sub identifier for the experience action subject e.g. 'selectionToolbar' 'quickInsert'
|
|
38
38
|
*/
|
|
39
39
|
constructor(id, options) {
|
|
40
40
|
var _options$sampleRate;
|
|
@@ -12,11 +12,11 @@ export const EXPERIENCE_FAILURE_REASON = {
|
|
|
12
12
|
/**
|
|
13
13
|
* Target element could not be found when starting DOM mutation observation
|
|
14
14
|
*/
|
|
15
|
-
DOM_MUTATION_TARGET_NOT_FOUND: '
|
|
15
|
+
DOM_MUTATION_TARGET_NOT_FOUND: 'domMutationTargetNotFound',
|
|
16
16
|
/**
|
|
17
17
|
* Error occurred during DOM mutation check execution
|
|
18
18
|
*/
|
|
19
|
-
DOM_MUTATION_CHECK_ERROR: '
|
|
19
|
+
DOM_MUTATION_CHECK_ERROR: 'domMutationCheckError'
|
|
20
20
|
};
|
|
21
21
|
|
|
22
22
|
/**
|
|
@@ -46,7 +46,7 @@ export const DEFAULT_EXPERIENCE_SAMPLE_RATE = 0.001;
|
|
|
46
46
|
export const EXPERIENCE_ID = {
|
|
47
47
|
ASYNC_OPERATION: 'asyncOperation',
|
|
48
48
|
MENU_ACTION: 'menuAction',
|
|
49
|
-
MENU_OPEN: '
|
|
49
|
+
MENU_OPEN: 'menuOpen',
|
|
50
50
|
TOOLBAR_ACTION: 'toolbarAction',
|
|
51
|
-
TOOLBAR_OPEN: '
|
|
51
|
+
TOOLBAR_OPEN: 'toolbarOpen'
|
|
52
52
|
};
|
|
@@ -280,6 +280,16 @@ export const syncBlockMessages = defineMessages({
|
|
|
280
280
|
defaultMessage: 'Request access',
|
|
281
281
|
description: 'Label shown in the synced location dropdown option when the sync block is not accessible to the user'
|
|
282
282
|
},
|
|
283
|
+
unpublishedSyncBlockPastedTitle: {
|
|
284
|
+
id: 'fabric.editor.unpublishedSyncBlockPastedTitle',
|
|
285
|
+
defaultMessage: 'Pasted from unpublished page',
|
|
286
|
+
description: 'Title in flag which appears when a reference to an unpublished sync block is pasted'
|
|
287
|
+
},
|
|
288
|
+
unpublishedSyncBlockPastedDescription: {
|
|
289
|
+
id: 'fabric.editor.unpublishedSyncBlockPastedDescription',
|
|
290
|
+
defaultMessage: 'When the page is published, the content will be displayed.',
|
|
291
|
+
description: 'Description in flag which appears when a reference to an unpublished sync block is pasted'
|
|
292
|
+
},
|
|
283
293
|
unsyncButton: {
|
|
284
294
|
id: 'fabric.editor.syncedBlock.unsync',
|
|
285
295
|
defaultMessage: 'Unsync',
|
|
@@ -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 = "111.
|
|
7
|
+
const packageVersion = "111.9.1";
|
|
8
8
|
const sanitiseSentryEvents = (data, _hint) => {
|
|
9
9
|
// Remove URL as it has UGC
|
|
10
10
|
// Ignored via go/ees007
|
|
@@ -1,7 +1,41 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
3
|
+
import { expVal } from '@atlaskit/tmp-editor-statsig/expVal';
|
|
3
4
|
import { isEmptyDocument } from '../utils';
|
|
4
5
|
import { DynamicBitArray } from './dynamic-bit-array';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Counts nodes in the document.
|
|
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.
|
|
31
|
+
*/
|
|
32
|
+
const getNumericExperimentParam = (experimentName, paramName, fallbackValue) => {
|
|
33
|
+
const rawValue = expVal(experimentName, paramName, fallbackValue);
|
|
34
|
+
if (typeof rawValue === 'number') {
|
|
35
|
+
return rawValue;
|
|
36
|
+
}
|
|
37
|
+
return fallbackValue;
|
|
38
|
+
};
|
|
5
39
|
export class NodeAnchorProvider {
|
|
6
40
|
constructor(limitedMode = false, emptyDoc = false) {
|
|
7
41
|
_defineProperty(this, "cache", new WeakMap());
|
|
@@ -64,15 +98,22 @@ const LIMITED_MODE_NODE_SIZE_THRESHOLD = 40000;
|
|
|
64
98
|
// This is duplicate from the limited mode plugin to avoid circular dependency
|
|
65
99
|
// We can refactor this later to have a shared util package
|
|
66
100
|
const isLimitedModeEnabled = editorView => {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
101
|
+
if (expVal('cc_editor_limited_mode_expanded', 'isEnabled', false)) {
|
|
102
|
+
const lcmNodeCountDampingFactor = getNumericExperimentParam('cc_editor_limited_mode_expanded', 'lcmNodeCountDampingFactor', 10);
|
|
103
|
+
const nodeCountThreshold = getNumericExperimentParam('cc_editor_limited_mode_expanded', 'nodeCountThreshold', 1000);
|
|
104
|
+
const nodeCount = countNodesInDoc(editorView.state.doc, lcmNodeCountDampingFactor);
|
|
105
|
+
return nodeCount > nodeCountThreshold;
|
|
106
|
+
} else {
|
|
107
|
+
let customDocSize = editorView.state.doc.nodeSize;
|
|
108
|
+
editorView.state.doc.descendants(node => {
|
|
109
|
+
var _node$attrs3;
|
|
110
|
+
if (((_node$attrs3 = node.attrs) === null || _node$attrs3 === void 0 ? void 0 : _node$attrs3.extensionKey) === 'legacy-content') {
|
|
111
|
+
var _node$attrs$parameter, _node$attrs4, _node$attrs4$paramete, _node$attrs4$paramete2;
|
|
112
|
+
customDocSize += (_node$attrs$parameter = (_node$attrs4 = node.attrs) === null || _node$attrs4 === void 0 ? void 0 : (_node$attrs4$paramete = _node$attrs4.parameters) === null || _node$attrs4$paramete === void 0 ? void 0 : (_node$attrs4$paramete2 = _node$attrs4$paramete.adf) === null || _node$attrs4$paramete2 === void 0 ? void 0 : _node$attrs4$paramete2.length) !== null && _node$attrs$parameter !== void 0 ? _node$attrs$parameter : 0;
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
return customDocSize > LIMITED_MODE_NODE_SIZE_THRESHOLD;
|
|
116
|
+
}
|
|
76
117
|
};
|
|
77
118
|
|
|
78
119
|
// Get the NodeIdProvider for a specific EditorView instance.
|
|
@@ -80,7 +121,7 @@ const isLimitedModeEnabled = editorView => {
|
|
|
80
121
|
export const getNodeIdProvider = editorView => {
|
|
81
122
|
if (!nodeIdProviderMap.has(editorView)) {
|
|
82
123
|
if (fg('platform_editor_native_anchor_patch_2')) {
|
|
83
|
-
// if the limited mode flag is on, enable limited mode based on
|
|
124
|
+
// if the limited mode flag is on, enable limited mode based on the threshold
|
|
84
125
|
// only for the first time
|
|
85
126
|
const limitedMode = isLimitedModeEnabled(editorView);
|
|
86
127
|
const isEmptyDoc = isEmptyDocument(editorView.state.doc);
|
|
@@ -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 = "111.
|
|
17
|
+
const packageVersion = "111.9.1";
|
|
18
18
|
const halfFocusRing = 1;
|
|
19
19
|
const dropOffset = '0, 8';
|
|
20
20
|
const fadeIn = keyframes({
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
7
7
|
import { jsx } from '@emotion/react';
|
|
8
|
-
import { backgroundColorPalette
|
|
8
|
+
import { backgroundColorPalette } from '@atlaskit/adf-schema';
|
|
9
9
|
import { useThemeObserver } from '@atlaskit/tokens';
|
|
10
10
|
import getColorMessage from './getColorMessage';
|
|
11
11
|
import paletteMessages from './paletteMessages';
|
|
@@ -49,12 +49,6 @@ export const EditorDiagonalLineIcon = () => {
|
|
|
49
49
|
})
|
|
50
50
|
);
|
|
51
51
|
};
|
|
52
|
-
|
|
53
|
-
// eslint-disable-next-line @repo/internal/deprecations/deprecation-ticket-required
|
|
54
|
-
/**
|
|
55
|
-
* @deprecated Use `highlightColorPaletteNext` instead, which supports both orange and yellow highlight color
|
|
56
|
-
* This will be removed when platform_editor_add_orange_highlight_color is cleaned up
|
|
57
|
-
*/
|
|
58
52
|
export const highlightColorPalette = [{
|
|
59
53
|
value: REMOVE_HIGHLIGHT_COLOR,
|
|
60
54
|
label: 'No color',
|
|
@@ -65,15 +59,4 @@ export const highlightColorPalette = [{
|
|
|
65
59
|
}];
|
|
66
60
|
backgroundColorPalette.forEach((label, color) => {
|
|
67
61
|
highlightColorPalette.push(mapPaletteColor(label, color));
|
|
68
|
-
});
|
|
69
|
-
export const highlightColorPaletteNext = [{
|
|
70
|
-
value: REMOVE_HIGHLIGHT_COLOR,
|
|
71
|
-
label: 'No color',
|
|
72
|
-
// Mostly informative, only used for analytics
|
|
73
|
-
border: "var(--ds-border, #091E4224)",
|
|
74
|
-
message: getColorMessage(paletteMessages, 'no-color'),
|
|
75
|
-
decorator: jsx(EditorDiagonalLineIcon, null)
|
|
76
|
-
}];
|
|
77
|
-
backgroundColorPaletteNext.forEach((label, color) => {
|
|
78
|
-
highlightColorPaletteNext.push(mapPaletteColor(label, color));
|
|
79
62
|
});
|
|
@@ -8,7 +8,7 @@ export { default as cellBackgroundColorPalette } from './ColorPalette/Palettes/c
|
|
|
8
8
|
export { default as colorPaletteMessages } from './ColorPalette/Palettes/paletteMessages';
|
|
9
9
|
export { panelBackgroundPalette } from './ColorPalette/Palettes/panelBackgroundPalette';
|
|
10
10
|
export { textColorPalette } from './ColorPalette/Palettes/textColorPalette';
|
|
11
|
-
export { highlightColorPalette,
|
|
11
|
+
export { highlightColorPalette, REMOVE_HIGHLIGHT_COLOR } from './ColorPalette/Palettes/highlightColorPalette';
|
|
12
12
|
export { backgroundPaletteTooltipMessages, borderPaletteTooltipMessages, chartsColorPaletteTooltipMessages, textPaletteTooltipMessages } from './ColorPalette/Palettes/paletteMessagesTokenModeNames';
|
|
13
13
|
export { DEFAULT_BORDER_COLOR } from './ColorPalette/Palettes/common';
|
|
14
14
|
export { default as borderColorPalette } from './ColorPalette/Palettes/borderColorPalette';
|
|
@@ -119,6 +119,7 @@ export var ACTION = /*#__PURE__*/function (ACTION) {
|
|
|
119
119
|
ACTION["SYNCED_BLOCK_CREATE"] = "syncedBlockCreate";
|
|
120
120
|
ACTION["SYNCED_BLOCK_UPDATE"] = "syncedBlockUpdate";
|
|
121
121
|
ACTION["SYNCED_BLOCK_FETCH"] = "syncedBlockFetch";
|
|
122
|
+
ACTION["SYNCED_BLOCK_FETCH_REFERENCES"] = "syncedBlockFetchReferences";
|
|
122
123
|
ACTION["SYNCED_BLOCK_DELETE"] = "syncedBlockDelete";
|
|
123
124
|
ACTION["SYNCED_BLOCK_GET_SOURCE_INFO"] = "syncedBlockGetSourceInfo";
|
|
124
125
|
ACTION["SYNCHRONY_DISCONNECTED"] = "synchronyDisconnected";
|
|
@@ -31,14 +31,14 @@ export var Experience = /*#__PURE__*/function () {
|
|
|
31
31
|
/**
|
|
32
32
|
* Creates a new Experience instance for tracking user experiences.
|
|
33
33
|
*
|
|
34
|
-
* @param id - Unique identifier for the experience e.g. '
|
|
34
|
+
* @param id - Unique identifier for the experience e.g. 'toolbarOpen' 'menuAction'
|
|
35
35
|
* @param options - Configuration options for the experience
|
|
36
36
|
* @param options.checks - Experience checks to monitor for completion
|
|
37
37
|
* @param options.dispatchAnalyticsEvent - Function to dispatch analytics events
|
|
38
38
|
* @param options.sampleRate - Sample rate for experienceSampled events
|
|
39
39
|
* @param options.metadata - Global metadata to attach to all events
|
|
40
|
-
* @param options.action - Optional sub identifier for the specific experience action e.g. 'bold' '
|
|
41
|
-
* @param options.actionSubjectId - Optional sub identifier for the experience action subject e.g. '
|
|
40
|
+
* @param options.action - Optional sub identifier for the specific experience action e.g. 'bold' 'insertTable'
|
|
41
|
+
* @param options.actionSubjectId - Optional sub identifier for the experience action subject e.g. 'selectionToolbar' 'quickInsert'
|
|
42
42
|
*/
|
|
43
43
|
function Experience(id, options) {
|
|
44
44
|
var _options$sampleRate;
|
|
@@ -12,11 +12,11 @@ export var EXPERIENCE_FAILURE_REASON = {
|
|
|
12
12
|
/**
|
|
13
13
|
* Target element could not be found when starting DOM mutation observation
|
|
14
14
|
*/
|
|
15
|
-
DOM_MUTATION_TARGET_NOT_FOUND: '
|
|
15
|
+
DOM_MUTATION_TARGET_NOT_FOUND: 'domMutationTargetNotFound',
|
|
16
16
|
/**
|
|
17
17
|
* Error occurred during DOM mutation check execution
|
|
18
18
|
*/
|
|
19
|
-
DOM_MUTATION_CHECK_ERROR: '
|
|
19
|
+
DOM_MUTATION_CHECK_ERROR: 'domMutationCheckError'
|
|
20
20
|
};
|
|
21
21
|
|
|
22
22
|
/**
|
|
@@ -46,7 +46,7 @@ export var DEFAULT_EXPERIENCE_SAMPLE_RATE = 0.001;
|
|
|
46
46
|
export var EXPERIENCE_ID = {
|
|
47
47
|
ASYNC_OPERATION: 'asyncOperation',
|
|
48
48
|
MENU_ACTION: 'menuAction',
|
|
49
|
-
MENU_OPEN: '
|
|
49
|
+
MENU_OPEN: 'menuOpen',
|
|
50
50
|
TOOLBAR_ACTION: 'toolbarAction',
|
|
51
|
-
TOOLBAR_OPEN: '
|
|
51
|
+
TOOLBAR_OPEN: 'toolbarOpen'
|
|
52
52
|
};
|
|
@@ -280,6 +280,16 @@ export var syncBlockMessages = defineMessages({
|
|
|
280
280
|
defaultMessage: 'Request access',
|
|
281
281
|
description: 'Label shown in the synced location dropdown option when the sync block is not accessible to the user'
|
|
282
282
|
},
|
|
283
|
+
unpublishedSyncBlockPastedTitle: {
|
|
284
|
+
id: 'fabric.editor.unpublishedSyncBlockPastedTitle',
|
|
285
|
+
defaultMessage: 'Pasted from unpublished page',
|
|
286
|
+
description: 'Title in flag which appears when a reference to an unpublished sync block is pasted'
|
|
287
|
+
},
|
|
288
|
+
unpublishedSyncBlockPastedDescription: {
|
|
289
|
+
id: 'fabric.editor.unpublishedSyncBlockPastedDescription',
|
|
290
|
+
defaultMessage: 'When the page is published, the content will be displayed.',
|
|
291
|
+
description: 'Description in flag which appears when a reference to an unpublished sync block is pasted'
|
|
292
|
+
},
|
|
283
293
|
unsyncButton: {
|
|
284
294
|
id: 'fabric.editor.syncedBlock.unsync',
|
|
285
295
|
defaultMessage: 'Unsync',
|
|
@@ -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 = "111.
|
|
13
|
+
var packageVersion = "111.9.1";
|
|
14
14
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
15
15
|
// Remove URL as it has UGC
|
|
16
16
|
// Ignored via go/ees007
|
|
@@ -2,8 +2,42 @@ 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
4
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
5
|
+
import { expVal } from '@atlaskit/tmp-editor-statsig/expVal';
|
|
5
6
|
import { isEmptyDocument } from '../utils';
|
|
6
7
|
import { DynamicBitArray } from './dynamic-bit-array';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Counts nodes in the document.
|
|
11
|
+
*
|
|
12
|
+
* Note: legacy-content macros add a damped contribution based on ADF length to avoid
|
|
13
|
+
* parsing nested ADF on every check, which is inefficient.
|
|
14
|
+
*/
|
|
15
|
+
var countNodesInDoc = function countNodesInDoc(doc, lcmDampingFactor) {
|
|
16
|
+
var nodeCount = 0;
|
|
17
|
+
doc.descendants(function (node) {
|
|
18
|
+
var _node$attrs;
|
|
19
|
+
nodeCount += 1;
|
|
20
|
+
if (((_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.extensionKey) === 'legacy-content') {
|
|
21
|
+
var _node$attrs2;
|
|
22
|
+
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;
|
|
23
|
+
if (typeof adfLength === 'number' && lcmDampingFactor > 0) {
|
|
24
|
+
nodeCount += Math.ceil(adfLength / lcmDampingFactor);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
return nodeCount;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Guard against test overrides returning booleans for numeric params.
|
|
33
|
+
*/
|
|
34
|
+
var getNumericExperimentParam = function getNumericExperimentParam(experimentName, paramName, fallbackValue) {
|
|
35
|
+
var rawValue = expVal(experimentName, paramName, fallbackValue);
|
|
36
|
+
if (typeof rawValue === 'number') {
|
|
37
|
+
return rawValue;
|
|
38
|
+
}
|
|
39
|
+
return fallbackValue;
|
|
40
|
+
};
|
|
7
41
|
export var NodeAnchorProvider = /*#__PURE__*/function () {
|
|
8
42
|
function NodeAnchorProvider() {
|
|
9
43
|
var limitedMode = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
@@ -82,15 +116,22 @@ var LIMITED_MODE_NODE_SIZE_THRESHOLD = 40000;
|
|
|
82
116
|
// This is duplicate from the limited mode plugin to avoid circular dependency
|
|
83
117
|
// We can refactor this later to have a shared util package
|
|
84
118
|
var isLimitedModeEnabled = function isLimitedModeEnabled(editorView) {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
var
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
119
|
+
if (expVal('cc_editor_limited_mode_expanded', 'isEnabled', false)) {
|
|
120
|
+
var lcmNodeCountDampingFactor = getNumericExperimentParam('cc_editor_limited_mode_expanded', 'lcmNodeCountDampingFactor', 10);
|
|
121
|
+
var nodeCountThreshold = getNumericExperimentParam('cc_editor_limited_mode_expanded', 'nodeCountThreshold', 1000);
|
|
122
|
+
var nodeCount = countNodesInDoc(editorView.state.doc, lcmNodeCountDampingFactor);
|
|
123
|
+
return nodeCount > nodeCountThreshold;
|
|
124
|
+
} else {
|
|
125
|
+
var customDocSize = editorView.state.doc.nodeSize;
|
|
126
|
+
editorView.state.doc.descendants(function (node) {
|
|
127
|
+
var _node$attrs3;
|
|
128
|
+
if (((_node$attrs3 = node.attrs) === null || _node$attrs3 === void 0 ? void 0 : _node$attrs3.extensionKey) === 'legacy-content') {
|
|
129
|
+
var _node$attrs$parameter, _node$attrs4;
|
|
130
|
+
customDocSize += (_node$attrs$parameter = (_node$attrs4 = node.attrs) === null || _node$attrs4 === void 0 || (_node$attrs4 = _node$attrs4.parameters) === null || _node$attrs4 === void 0 || (_node$attrs4 = _node$attrs4.adf) === null || _node$attrs4 === void 0 ? void 0 : _node$attrs4.length) !== null && _node$attrs$parameter !== void 0 ? _node$attrs$parameter : 0;
|
|
131
|
+
}
|
|
132
|
+
});
|
|
133
|
+
return customDocSize > LIMITED_MODE_NODE_SIZE_THRESHOLD;
|
|
134
|
+
}
|
|
94
135
|
};
|
|
95
136
|
|
|
96
137
|
// Get the NodeIdProvider for a specific EditorView instance.
|
|
@@ -98,7 +139,7 @@ var isLimitedModeEnabled = function isLimitedModeEnabled(editorView) {
|
|
|
98
139
|
export var getNodeIdProvider = function getNodeIdProvider(editorView) {
|
|
99
140
|
if (!nodeIdProviderMap.has(editorView)) {
|
|
100
141
|
if (fg('platform_editor_native_anchor_patch_2')) {
|
|
101
|
-
// if the limited mode flag is on, enable limited mode based on
|
|
142
|
+
// if the limited mode flag is on, enable limited mode based on the threshold
|
|
102
143
|
// only for the first time
|
|
103
144
|
var limitedMode = isLimitedModeEnabled(editorView);
|
|
104
145
|
var isEmptyDoc = isEmptyDocument(editorView.state.doc);
|
|
@@ -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 = "111.
|
|
24
|
+
var packageVersion = "111.9.1";
|
|
25
25
|
var halfFocusRing = 1;
|
|
26
26
|
var dropOffset = '0, 8';
|
|
27
27
|
var fadeIn = keyframes({
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
7
7
|
import { jsx } from '@emotion/react';
|
|
8
|
-
import { backgroundColorPalette
|
|
8
|
+
import { backgroundColorPalette } from '@atlaskit/adf-schema';
|
|
9
9
|
import { useThemeObserver } from '@atlaskit/tokens';
|
|
10
10
|
import getColorMessage from './getColorMessage';
|
|
11
11
|
import paletteMessages from './paletteMessages';
|
|
@@ -50,12 +50,6 @@ export var EditorDiagonalLineIcon = function EditorDiagonalLineIcon() {
|
|
|
50
50
|
})
|
|
51
51
|
);
|
|
52
52
|
};
|
|
53
|
-
|
|
54
|
-
// eslint-disable-next-line @repo/internal/deprecations/deprecation-ticket-required
|
|
55
|
-
/**
|
|
56
|
-
* @deprecated Use `highlightColorPaletteNext` instead, which supports both orange and yellow highlight color
|
|
57
|
-
* This will be removed when platform_editor_add_orange_highlight_color is cleaned up
|
|
58
|
-
*/
|
|
59
53
|
export var highlightColorPalette = [{
|
|
60
54
|
value: REMOVE_HIGHLIGHT_COLOR,
|
|
61
55
|
label: 'No color',
|
|
@@ -66,15 +60,4 @@ export var highlightColorPalette = [{
|
|
|
66
60
|
}];
|
|
67
61
|
backgroundColorPalette.forEach(function (label, color) {
|
|
68
62
|
highlightColorPalette.push(mapPaletteColor(label, color));
|
|
69
|
-
});
|
|
70
|
-
export var highlightColorPaletteNext = [{
|
|
71
|
-
value: REMOVE_HIGHLIGHT_COLOR,
|
|
72
|
-
label: 'No color',
|
|
73
|
-
// Mostly informative, only used for analytics
|
|
74
|
-
border: "var(--ds-border, #091E4224)",
|
|
75
|
-
message: getColorMessage(paletteMessages, 'no-color'),
|
|
76
|
-
decorator: jsx(EditorDiagonalLineIcon, null)
|
|
77
|
-
}];
|
|
78
|
-
backgroundColorPaletteNext.forEach(function (label, color) {
|
|
79
|
-
highlightColorPaletteNext.push(mapPaletteColor(label, color));
|
|
80
63
|
});
|
|
@@ -8,7 +8,7 @@ export { default as cellBackgroundColorPalette } from './ColorPalette/Palettes/c
|
|
|
8
8
|
export { default as colorPaletteMessages } from './ColorPalette/Palettes/paletteMessages';
|
|
9
9
|
export { panelBackgroundPalette } from './ColorPalette/Palettes/panelBackgroundPalette';
|
|
10
10
|
export { textColorPalette } from './ColorPalette/Palettes/textColorPalette';
|
|
11
|
-
export { highlightColorPalette,
|
|
11
|
+
export { highlightColorPalette, REMOVE_HIGHLIGHT_COLOR } from './ColorPalette/Palettes/highlightColorPalette';
|
|
12
12
|
export { backgroundPaletteTooltipMessages, borderPaletteTooltipMessages, chartsColorPaletteTooltipMessages, textPaletteTooltipMessages } from './ColorPalette/Palettes/paletteMessagesTokenModeNames';
|
|
13
13
|
export { DEFAULT_BORDER_COLOR } from './ColorPalette/Palettes/common';
|
|
14
14
|
export { default as borderColorPalette } from './ColorPalette/Palettes/borderColorPalette';
|
|
@@ -118,6 +118,7 @@ export declare enum ACTION {
|
|
|
118
118
|
SYNCED_BLOCK_CREATE = "syncedBlockCreate",
|
|
119
119
|
SYNCED_BLOCK_UPDATE = "syncedBlockUpdate",
|
|
120
120
|
SYNCED_BLOCK_FETCH = "syncedBlockFetch",
|
|
121
|
+
SYNCED_BLOCK_FETCH_REFERENCES = "syncedBlockFetchReferences",
|
|
121
122
|
SYNCED_BLOCK_DELETE = "syncedBlockDelete",
|
|
122
123
|
SYNCED_BLOCK_GET_SOURCE_INFO = "syncedBlockGetSourceInfo",
|
|
123
124
|
SYNCHRONY_DISCONNECTED = "synchronyDisconnected",
|
|
@@ -6,10 +6,10 @@ type SyncedBlockErrorAttributes = {
|
|
|
6
6
|
resourceId?: string;
|
|
7
7
|
};
|
|
8
8
|
type SyncedBlockSuccessAttributes = {
|
|
9
|
+
blockInstanceId?: string;
|
|
9
10
|
resourceId: string;
|
|
10
11
|
};
|
|
11
12
|
type FetchSyncedBlockSuccessAttributes = SyncedBlockSuccessAttributes & {
|
|
12
|
-
blockInstanceId?: string;
|
|
13
13
|
sourceProduct?: string;
|
|
14
14
|
};
|
|
15
15
|
export type SyncedBlockSourceURLErrorAEP = OperationalAEP<ACTION.ERROR, ACTION_SUBJECT.SYNCED_BLOCK, ACTION_SUBJECT_ID.SYNCED_BLOCK_SOURCE_URL, SyncedBlockErrorAttributes>;
|
|
@@ -25,6 +25,8 @@ export type SyncedBlockFetchSuccessAEP = OperationalAEP<ACTION.FETCHED, ACTION_S
|
|
|
25
25
|
export type SyncedBlockCreateSuccessAEP = OperationalAEP<ACTION.INSERTED, ACTION_SUBJECT.SYNCED_BLOCK, ACTION_SUBJECT_ID.SYNCED_BLOCK_CREATE, SyncedBlockSuccessAttributes>;
|
|
26
26
|
export type SyncedBlockUpdateSuccessAEP = OperationalAEP<ACTION.UPDATED, ACTION_SUBJECT.SYNCED_BLOCK, ACTION_SUBJECT_ID.SYNCED_BLOCK_UPDATE, SyncedBlockSuccessAttributes>;
|
|
27
27
|
export type SyncedBlockDeleteSuccessAEP = OperationalAEP<ACTION.DELETED, ACTION_SUBJECT.SYNCED_BLOCK, ACTION_SUBJECT_ID.SYNCED_BLOCK_DELETE, SyncedBlockSuccessAttributes>;
|
|
28
|
-
export type
|
|
28
|
+
export type ReferenceSyncedBlockCreateSuccessAEP = OperationalAEP<ACTION.INSERTED, ACTION_SUBJECT.SYNCED_BLOCK, ACTION_SUBJECT_ID.REFERENCE_SYNCED_BLOCK_CREATE, SyncedBlockSuccessAttributes>;
|
|
29
|
+
export type ReferenceSyncedBlockDeleteSuccessAEP = OperationalAEP<ACTION.DELETED, ACTION_SUBJECT.SYNCED_BLOCK, ACTION_SUBJECT_ID.REFERENCE_SYNCED_BLOCK_DELETE, SyncedBlockSuccessAttributes>;
|
|
30
|
+
export type SyncBlockEventPayload = SyncedBlockSourceURLErrorAEP | SyncedBlockUpdateCacheErrorAEP | SyncedBlockUpdateErrorAEP | SyncedBlockUpdateSuccessAEP | SyncedBlockCreateErrorAEP | SyncedBlockCreateSuccessAEP | SyncedBlockDeleteErrorAEP | SyncedBlockDeleteSuccessAEP | SyncedBlockGetSourceInfoErrorAEP | SyncedBlockFetchErrorAEP | SyncedBlockFetchSuccessAEP | ReferenceSyncedBlockUpdateErrorAEP | SyncedBlockFetchReferencesErrorAEP | ExperienceEventPayload | ReferenceSyncedBlockCreateSuccessAEP | ReferenceSyncedBlockDeleteSuccessAEP;
|
|
29
31
|
export type RendererSyncBlockEventPayload = SyncedBlockGetSourceInfoErrorAEP | SyncedBlockFetchErrorAEP | SyncedBlockFetchSuccessAEP | ReferenceSyncedBlockUpdateErrorAEP | ExperienceEventPayload;
|
|
30
32
|
export {};
|
|
@@ -90,14 +90,14 @@ export declare class Experience {
|
|
|
90
90
|
/**
|
|
91
91
|
* Creates a new Experience instance for tracking user experiences.
|
|
92
92
|
*
|
|
93
|
-
* @param id - Unique identifier for the experience e.g. '
|
|
93
|
+
* @param id - Unique identifier for the experience e.g. 'toolbarOpen' 'menuAction'
|
|
94
94
|
* @param options - Configuration options for the experience
|
|
95
95
|
* @param options.checks - Experience checks to monitor for completion
|
|
96
96
|
* @param options.dispatchAnalyticsEvent - Function to dispatch analytics events
|
|
97
97
|
* @param options.sampleRate - Sample rate for experienceSampled events
|
|
98
98
|
* @param options.metadata - Global metadata to attach to all events
|
|
99
|
-
* @param options.action - Optional sub identifier for the specific experience action e.g. 'bold' '
|
|
100
|
-
* @param options.actionSubjectId - Optional sub identifier for the experience action subject e.g. '
|
|
99
|
+
* @param options.action - Optional sub identifier for the specific experience action e.g. 'bold' 'insertTable'
|
|
100
|
+
* @param options.actionSubjectId - Optional sub identifier for the experience action subject e.g. 'selectionToolbar' 'quickInsert'
|
|
101
101
|
*/
|
|
102
102
|
constructor(id: ExperienceId, options: ExperienceOptions);
|
|
103
103
|
private startCheck;
|
|
@@ -23,7 +23,7 @@ export type ExperienceCheckDomMutationObserveConfig = {
|
|
|
23
23
|
/**
|
|
24
24
|
* Target element to observe for mutations
|
|
25
25
|
*
|
|
26
|
-
* If null or undefined, the experience will fail with '
|
|
26
|
+
* If null or undefined, the experience will fail with 'domMutationTargetNotFound'.
|
|
27
27
|
*/
|
|
28
28
|
target?: Node | null;
|
|
29
29
|
};
|
|
@@ -37,7 +37,7 @@ export type ExperienceCheckDomMutationConfig = {
|
|
|
37
37
|
*
|
|
38
38
|
* !!IMPORTANT!!
|
|
39
39
|
* Return null if the target element cannot be found.
|
|
40
|
-
* This will immediately fail the experience with experienceFailureReason '
|
|
40
|
+
* This will immediately fail the experience with experienceFailureReason 'domMutationTargetNotFound'.
|
|
41
41
|
*/
|
|
42
42
|
observeConfig: () => ExperienceCheckDomMutationObserveConfig | null;
|
|
43
43
|
/**
|
|
@@ -12,11 +12,11 @@ export declare const EXPERIENCE_FAILURE_REASON: {
|
|
|
12
12
|
/**
|
|
13
13
|
* Target element could not be found when starting DOM mutation observation
|
|
14
14
|
*/
|
|
15
|
-
readonly DOM_MUTATION_TARGET_NOT_FOUND: "
|
|
15
|
+
readonly DOM_MUTATION_TARGET_NOT_FOUND: "domMutationTargetNotFound";
|
|
16
16
|
/**
|
|
17
17
|
* Error occurred during DOM mutation check execution
|
|
18
18
|
*/
|
|
19
|
-
readonly DOM_MUTATION_CHECK_ERROR: "
|
|
19
|
+
readonly DOM_MUTATION_CHECK_ERROR: "domMutationCheckError";
|
|
20
20
|
};
|
|
21
21
|
/**
|
|
22
22
|
* Built-in abort reasons for experiences.
|
|
@@ -44,7 +44,7 @@ export declare const DEFAULT_EXPERIENCE_SAMPLE_RATE = 0.001;
|
|
|
44
44
|
export declare const EXPERIENCE_ID: {
|
|
45
45
|
readonly ASYNC_OPERATION: "asyncOperation";
|
|
46
46
|
readonly MENU_ACTION: "menuAction";
|
|
47
|
-
readonly MENU_OPEN: "
|
|
47
|
+
readonly MENU_OPEN: "menuOpen";
|
|
48
48
|
readonly TOOLBAR_ACTION: "toolbarAction";
|
|
49
|
-
readonly TOOLBAR_OPEN: "
|
|
49
|
+
readonly TOOLBAR_OPEN: "toolbarOpen";
|
|
50
50
|
};
|
|
@@ -8,6 +8,6 @@ export type CustomExperienceMetadata = {
|
|
|
8
8
|
* Represents the state of an experience throughout its lifecycle.
|
|
9
9
|
*/
|
|
10
10
|
export type ExperienceState = 'pending' | 'started' | 'aborted' | 'failed' | 'succeeded';
|
|
11
|
-
declare const EXPERIENCE_IDS: ("asyncOperation" | "menuAction" | "
|
|
11
|
+
declare const EXPERIENCE_IDS: ("asyncOperation" | "menuAction" | "menuOpen" | "toolbarAction" | "toolbarOpen")[];
|
|
12
12
|
export type ExperienceId = typeof EXPERIENCE_IDS[number];
|
|
13
13
|
export {};
|
|
@@ -279,6 +279,16 @@ export declare const syncBlockMessages: {
|
|
|
279
279
|
defaultMessage: string;
|
|
280
280
|
description: string;
|
|
281
281
|
};
|
|
282
|
+
unpublishedSyncBlockPastedTitle: {
|
|
283
|
+
id: string;
|
|
284
|
+
defaultMessage: string;
|
|
285
|
+
description: string;
|
|
286
|
+
};
|
|
287
|
+
unpublishedSyncBlockPastedDescription: {
|
|
288
|
+
id: string;
|
|
289
|
+
defaultMessage: string;
|
|
290
|
+
description: string;
|
|
291
|
+
};
|
|
282
292
|
unsyncButton: {
|
|
283
293
|
id: string;
|
|
284
294
|
defaultMessage: string;
|
|
@@ -6,9 +6,4 @@ import { jsx } from '@emotion/react';
|
|
|
6
6
|
import type { PaletteColor } from './type';
|
|
7
7
|
export declare const REMOVE_HIGHLIGHT_COLOR = "#00000000";
|
|
8
8
|
export declare const EditorDiagonalLineIcon: () => jsx.JSX.Element;
|
|
9
|
-
/**
|
|
10
|
-
* @deprecated Use `highlightColorPaletteNext` instead, which supports both orange and yellow highlight color
|
|
11
|
-
* This will be removed when platform_editor_add_orange_highlight_color is cleaned up
|
|
12
|
-
*/
|
|
13
9
|
export declare const highlightColorPalette: Array<PaletteColor>;
|
|
14
|
-
export declare const highlightColorPaletteNext: Array<PaletteColor>;
|
|
@@ -5,7 +5,7 @@ export { default as cellBackgroundColorPalette } from './ColorPalette/Palettes/c
|
|
|
5
5
|
export { default as colorPaletteMessages } from './ColorPalette/Palettes/paletteMessages';
|
|
6
6
|
export { panelBackgroundPalette } from './ColorPalette/Palettes/panelBackgroundPalette';
|
|
7
7
|
export { textColorPalette } from './ColorPalette/Palettes/textColorPalette';
|
|
8
|
-
export { highlightColorPalette,
|
|
8
|
+
export { highlightColorPalette, REMOVE_HIGHLIGHT_COLOR, } from './ColorPalette/Palettes/highlightColorPalette';
|
|
9
9
|
export { backgroundPaletteTooltipMessages, borderPaletteTooltipMessages, chartsColorPaletteTooltipMessages, textPaletteTooltipMessages, } from './ColorPalette/Palettes/paletteMessagesTokenModeNames';
|
|
10
10
|
export { DEFAULT_BORDER_COLOR } from './ColorPalette/Palettes/common';
|
|
11
11
|
export type { PaletteColor, PaletteTooltipMessages } from './ColorPalette/Palettes/type';
|
|
@@ -118,6 +118,7 @@ export declare enum ACTION {
|
|
|
118
118
|
SYNCED_BLOCK_CREATE = "syncedBlockCreate",
|
|
119
119
|
SYNCED_BLOCK_UPDATE = "syncedBlockUpdate",
|
|
120
120
|
SYNCED_BLOCK_FETCH = "syncedBlockFetch",
|
|
121
|
+
SYNCED_BLOCK_FETCH_REFERENCES = "syncedBlockFetchReferences",
|
|
121
122
|
SYNCED_BLOCK_DELETE = "syncedBlockDelete",
|
|
122
123
|
SYNCED_BLOCK_GET_SOURCE_INFO = "syncedBlockGetSourceInfo",
|
|
123
124
|
SYNCHRONY_DISCONNECTED = "synchronyDisconnected",
|
|
@@ -6,10 +6,10 @@ type SyncedBlockErrorAttributes = {
|
|
|
6
6
|
resourceId?: string;
|
|
7
7
|
};
|
|
8
8
|
type SyncedBlockSuccessAttributes = {
|
|
9
|
+
blockInstanceId?: string;
|
|
9
10
|
resourceId: string;
|
|
10
11
|
};
|
|
11
12
|
type FetchSyncedBlockSuccessAttributes = SyncedBlockSuccessAttributes & {
|
|
12
|
-
blockInstanceId?: string;
|
|
13
13
|
sourceProduct?: string;
|
|
14
14
|
};
|
|
15
15
|
export type SyncedBlockSourceURLErrorAEP = OperationalAEP<ACTION.ERROR, ACTION_SUBJECT.SYNCED_BLOCK, ACTION_SUBJECT_ID.SYNCED_BLOCK_SOURCE_URL, SyncedBlockErrorAttributes>;
|
|
@@ -25,6 +25,8 @@ export type SyncedBlockFetchSuccessAEP = OperationalAEP<ACTION.FETCHED, ACTION_S
|
|
|
25
25
|
export type SyncedBlockCreateSuccessAEP = OperationalAEP<ACTION.INSERTED, ACTION_SUBJECT.SYNCED_BLOCK, ACTION_SUBJECT_ID.SYNCED_BLOCK_CREATE, SyncedBlockSuccessAttributes>;
|
|
26
26
|
export type SyncedBlockUpdateSuccessAEP = OperationalAEP<ACTION.UPDATED, ACTION_SUBJECT.SYNCED_BLOCK, ACTION_SUBJECT_ID.SYNCED_BLOCK_UPDATE, SyncedBlockSuccessAttributes>;
|
|
27
27
|
export type SyncedBlockDeleteSuccessAEP = OperationalAEP<ACTION.DELETED, ACTION_SUBJECT.SYNCED_BLOCK, ACTION_SUBJECT_ID.SYNCED_BLOCK_DELETE, SyncedBlockSuccessAttributes>;
|
|
28
|
-
export type
|
|
28
|
+
export type ReferenceSyncedBlockCreateSuccessAEP = OperationalAEP<ACTION.INSERTED, ACTION_SUBJECT.SYNCED_BLOCK, ACTION_SUBJECT_ID.REFERENCE_SYNCED_BLOCK_CREATE, SyncedBlockSuccessAttributes>;
|
|
29
|
+
export type ReferenceSyncedBlockDeleteSuccessAEP = OperationalAEP<ACTION.DELETED, ACTION_SUBJECT.SYNCED_BLOCK, ACTION_SUBJECT_ID.REFERENCE_SYNCED_BLOCK_DELETE, SyncedBlockSuccessAttributes>;
|
|
30
|
+
export type SyncBlockEventPayload = SyncedBlockSourceURLErrorAEP | SyncedBlockUpdateCacheErrorAEP | SyncedBlockUpdateErrorAEP | SyncedBlockUpdateSuccessAEP | SyncedBlockCreateErrorAEP | SyncedBlockCreateSuccessAEP | SyncedBlockDeleteErrorAEP | SyncedBlockDeleteSuccessAEP | SyncedBlockGetSourceInfoErrorAEP | SyncedBlockFetchErrorAEP | SyncedBlockFetchSuccessAEP | ReferenceSyncedBlockUpdateErrorAEP | SyncedBlockFetchReferencesErrorAEP | ExperienceEventPayload | ReferenceSyncedBlockCreateSuccessAEP | ReferenceSyncedBlockDeleteSuccessAEP;
|
|
29
31
|
export type RendererSyncBlockEventPayload = SyncedBlockGetSourceInfoErrorAEP | SyncedBlockFetchErrorAEP | SyncedBlockFetchSuccessAEP | ReferenceSyncedBlockUpdateErrorAEP | ExperienceEventPayload;
|
|
30
32
|
export {};
|
|
@@ -90,14 +90,14 @@ export declare class Experience {
|
|
|
90
90
|
/**
|
|
91
91
|
* Creates a new Experience instance for tracking user experiences.
|
|
92
92
|
*
|
|
93
|
-
* @param id - Unique identifier for the experience e.g. '
|
|
93
|
+
* @param id - Unique identifier for the experience e.g. 'toolbarOpen' 'menuAction'
|
|
94
94
|
* @param options - Configuration options for the experience
|
|
95
95
|
* @param options.checks - Experience checks to monitor for completion
|
|
96
96
|
* @param options.dispatchAnalyticsEvent - Function to dispatch analytics events
|
|
97
97
|
* @param options.sampleRate - Sample rate for experienceSampled events
|
|
98
98
|
* @param options.metadata - Global metadata to attach to all events
|
|
99
|
-
* @param options.action - Optional sub identifier for the specific experience action e.g. 'bold' '
|
|
100
|
-
* @param options.actionSubjectId - Optional sub identifier for the experience action subject e.g. '
|
|
99
|
+
* @param options.action - Optional sub identifier for the specific experience action e.g. 'bold' 'insertTable'
|
|
100
|
+
* @param options.actionSubjectId - Optional sub identifier for the experience action subject e.g. 'selectionToolbar' 'quickInsert'
|
|
101
101
|
*/
|
|
102
102
|
constructor(id: ExperienceId, options: ExperienceOptions);
|
|
103
103
|
private startCheck;
|
|
@@ -23,7 +23,7 @@ export type ExperienceCheckDomMutationObserveConfig = {
|
|
|
23
23
|
/**
|
|
24
24
|
* Target element to observe for mutations
|
|
25
25
|
*
|
|
26
|
-
* If null or undefined, the experience will fail with '
|
|
26
|
+
* If null or undefined, the experience will fail with 'domMutationTargetNotFound'.
|
|
27
27
|
*/
|
|
28
28
|
target?: Node | null;
|
|
29
29
|
};
|
|
@@ -37,7 +37,7 @@ export type ExperienceCheckDomMutationConfig = {
|
|
|
37
37
|
*
|
|
38
38
|
* !!IMPORTANT!!
|
|
39
39
|
* Return null if the target element cannot be found.
|
|
40
|
-
* This will immediately fail the experience with experienceFailureReason '
|
|
40
|
+
* This will immediately fail the experience with experienceFailureReason 'domMutationTargetNotFound'.
|
|
41
41
|
*/
|
|
42
42
|
observeConfig: () => ExperienceCheckDomMutationObserveConfig | null;
|
|
43
43
|
/**
|
|
@@ -12,11 +12,11 @@ export declare const EXPERIENCE_FAILURE_REASON: {
|
|
|
12
12
|
/**
|
|
13
13
|
* Target element could not be found when starting DOM mutation observation
|
|
14
14
|
*/
|
|
15
|
-
readonly DOM_MUTATION_TARGET_NOT_FOUND: "
|
|
15
|
+
readonly DOM_MUTATION_TARGET_NOT_FOUND: "domMutationTargetNotFound";
|
|
16
16
|
/**
|
|
17
17
|
* Error occurred during DOM mutation check execution
|
|
18
18
|
*/
|
|
19
|
-
readonly DOM_MUTATION_CHECK_ERROR: "
|
|
19
|
+
readonly DOM_MUTATION_CHECK_ERROR: "domMutationCheckError";
|
|
20
20
|
};
|
|
21
21
|
/**
|
|
22
22
|
* Built-in abort reasons for experiences.
|
|
@@ -44,7 +44,7 @@ export declare const DEFAULT_EXPERIENCE_SAMPLE_RATE = 0.001;
|
|
|
44
44
|
export declare const EXPERIENCE_ID: {
|
|
45
45
|
readonly ASYNC_OPERATION: "asyncOperation";
|
|
46
46
|
readonly MENU_ACTION: "menuAction";
|
|
47
|
-
readonly MENU_OPEN: "
|
|
47
|
+
readonly MENU_OPEN: "menuOpen";
|
|
48
48
|
readonly TOOLBAR_ACTION: "toolbarAction";
|
|
49
|
-
readonly TOOLBAR_OPEN: "
|
|
49
|
+
readonly TOOLBAR_OPEN: "toolbarOpen";
|
|
50
50
|
};
|
|
@@ -8,6 +8,6 @@ export type CustomExperienceMetadata = {
|
|
|
8
8
|
* Represents the state of an experience throughout its lifecycle.
|
|
9
9
|
*/
|
|
10
10
|
export type ExperienceState = 'pending' | 'started' | 'aborted' | 'failed' | 'succeeded';
|
|
11
|
-
declare const EXPERIENCE_IDS: ("asyncOperation" | "menuAction" | "
|
|
11
|
+
declare const EXPERIENCE_IDS: ("asyncOperation" | "menuAction" | "menuOpen" | "toolbarAction" | "toolbarOpen")[];
|
|
12
12
|
export type ExperienceId = typeof EXPERIENCE_IDS[number];
|
|
13
13
|
export {};
|
|
@@ -279,6 +279,16 @@ export declare const syncBlockMessages: {
|
|
|
279
279
|
defaultMessage: string;
|
|
280
280
|
description: string;
|
|
281
281
|
};
|
|
282
|
+
unpublishedSyncBlockPastedTitle: {
|
|
283
|
+
id: string;
|
|
284
|
+
defaultMessage: string;
|
|
285
|
+
description: string;
|
|
286
|
+
};
|
|
287
|
+
unpublishedSyncBlockPastedDescription: {
|
|
288
|
+
id: string;
|
|
289
|
+
defaultMessage: string;
|
|
290
|
+
description: string;
|
|
291
|
+
};
|
|
282
292
|
unsyncButton: {
|
|
283
293
|
id: string;
|
|
284
294
|
defaultMessage: string;
|
|
@@ -6,9 +6,4 @@ import { jsx } from '@emotion/react';
|
|
|
6
6
|
import type { PaletteColor } from './type';
|
|
7
7
|
export declare const REMOVE_HIGHLIGHT_COLOR = "#00000000";
|
|
8
8
|
export declare const EditorDiagonalLineIcon: () => jsx.JSX.Element;
|
|
9
|
-
/**
|
|
10
|
-
* @deprecated Use `highlightColorPaletteNext` instead, which supports both orange and yellow highlight color
|
|
11
|
-
* This will be removed when platform_editor_add_orange_highlight_color is cleaned up
|
|
12
|
-
*/
|
|
13
9
|
export declare const highlightColorPalette: Array<PaletteColor>;
|
|
14
|
-
export declare const highlightColorPaletteNext: Array<PaletteColor>;
|
|
@@ -5,7 +5,7 @@ export { default as cellBackgroundColorPalette } from './ColorPalette/Palettes/c
|
|
|
5
5
|
export { default as colorPaletteMessages } from './ColorPalette/Palettes/paletteMessages';
|
|
6
6
|
export { panelBackgroundPalette } from './ColorPalette/Palettes/panelBackgroundPalette';
|
|
7
7
|
export { textColorPalette } from './ColorPalette/Palettes/textColorPalette';
|
|
8
|
-
export { highlightColorPalette,
|
|
8
|
+
export { highlightColorPalette, REMOVE_HIGHLIGHT_COLOR, } from './ColorPalette/Palettes/highlightColorPalette';
|
|
9
9
|
export { backgroundPaletteTooltipMessages, borderPaletteTooltipMessages, chartsColorPaletteTooltipMessages, textPaletteTooltipMessages, } from './ColorPalette/Palettes/paletteMessagesTokenModeNames';
|
|
10
10
|
export { DEFAULT_BORDER_COLOR } from './ColorPalette/Palettes/common';
|
|
11
11
|
export type { PaletteColor, PaletteTooltipMessages } from './ColorPalette/Palettes/type';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-common",
|
|
3
|
-
"version": "111.9.
|
|
3
|
+
"version": "111.9.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/"
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
"@atlaskit/platform-feature-flags-react": "^0.4.0",
|
|
71
71
|
"@atlaskit/popper": "^7.1.0",
|
|
72
72
|
"@atlaskit/primitives": "^17.1.0",
|
|
73
|
-
"@atlaskit/profilecard": "^24.
|
|
73
|
+
"@atlaskit/profilecard": "^24.34.0",
|
|
74
74
|
"@atlaskit/prosemirror-history": "^0.2.0",
|
|
75
75
|
"@atlaskit/react-ufo": "^5.0.0",
|
|
76
76
|
"@atlaskit/section-message": "^8.12.0",
|
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
"@atlaskit/task-decision": "^19.2.0",
|
|
82
82
|
"@atlaskit/textfield": "^8.2.0",
|
|
83
83
|
"@atlaskit/theme": "^21.0.0",
|
|
84
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
84
|
+
"@atlaskit/tmp-editor-statsig": "^17.0.0",
|
|
85
85
|
"@atlaskit/tokens": "^10.1.0",
|
|
86
86
|
"@atlaskit/tooltip": "^20.14.0",
|
|
87
87
|
"@atlaskit/width-detector": "^5.0.0",
|