@atlaskit/editor-common 111.9.1 → 111.9.3

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.
Files changed (36) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/dist/cjs/messages/syncBlock.js +22 -7
  3. package/dist/cjs/monitoring/error.js +1 -1
  4. package/dist/cjs/node-anchor/node-anchor-provider.js +50 -10
  5. package/dist/cjs/sync-block/SyncBlockActionsContext.js +27 -0
  6. package/dist/cjs/sync-block.js +14 -1
  7. package/dist/cjs/ui/DropList/index.js +1 -1
  8. package/dist/cjs/ui-color/ColorPalette/Palettes/highlightColorPalette.js +1 -18
  9. package/dist/cjs/ui-color/index.js +0 -6
  10. package/dist/es2019/messages/syncBlock.js +22 -7
  11. package/dist/es2019/monitoring/error.js +1 -1
  12. package/dist/es2019/node-anchor/node-anchor-provider.js +51 -10
  13. package/dist/es2019/sync-block/SyncBlockActionsContext.js +18 -0
  14. package/dist/es2019/sync-block.js +2 -1
  15. package/dist/es2019/ui/DropList/index.js +1 -1
  16. package/dist/es2019/ui-color/ColorPalette/Palettes/highlightColorPalette.js +1 -18
  17. package/dist/es2019/ui-color/index.js +1 -1
  18. package/dist/esm/messages/syncBlock.js +22 -7
  19. package/dist/esm/monitoring/error.js +1 -1
  20. package/dist/esm/node-anchor/node-anchor-provider.js +51 -10
  21. package/dist/esm/sync-block/SyncBlockActionsContext.js +19 -0
  22. package/dist/esm/sync-block.js +2 -1
  23. package/dist/esm/ui/DropList/index.js +1 -1
  24. package/dist/esm/ui-color/ColorPalette/Palettes/highlightColorPalette.js +1 -18
  25. package/dist/esm/ui-color/index.js +1 -1
  26. package/dist/types/messages/syncBlock.d.ts +15 -0
  27. package/dist/types/sync-block/SyncBlockActionsContext.d.ts +19 -0
  28. package/dist/types/sync-block.d.ts +1 -0
  29. package/dist/types/ui-color/ColorPalette/Palettes/highlightColorPalette.d.ts +0 -5
  30. package/dist/types/ui-color/index.d.ts +1 -1
  31. package/dist/types-ts4.5/messages/syncBlock.d.ts +15 -0
  32. package/dist/types-ts4.5/sync-block/SyncBlockActionsContext.d.ts +19 -0
  33. package/dist/types-ts4.5/sync-block.d.ts +1 -0
  34. package/dist/types-ts4.5/ui-color/ColorPalette/Palettes/highlightColorPalette.d.ts +0 -5
  35. package/dist/types-ts4.5/ui-color/index.d.ts +1 -1
  36. package/package.json +3 -3
package/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # @atlaskit/editor-common
2
2
 
3
+ ## 111.9.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [`f11ff647ea458`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/f11ff647ea458) -
8
+ [ux] [EDITOR-4521] Implement source deleted reference UI, update block deleted/unsynced reference
9
+ UI to add delete button, unsynced label and source title/url
10
+
11
+ ## 111.9.2
12
+
13
+ ### Patch Changes
14
+
15
+ - [`256b4fc86bae0`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/256b4fc86bae0) -
16
+ [ux] EDITOR-4464 Limited Mode: Change threshold to activate limited mode to use the node count
17
+ rather than the raw document size.
18
+ - [`25c388e0f807a`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/25c388e0f807a) -
19
+ EDITOR-4684 Clean up platform_editor_add_orange_highlight_color experiment - orange highlight
20
+ color is now permanently enabled
21
+ - Updated dependencies
22
+
3
23
  ## 111.9.1
4
24
 
5
25
  ### Patch Changes
@@ -41,6 +41,11 @@ var syncBlockMessages = exports.syncBlockMessages = (0, _reactIntlNext.defineMes
41
41
  defaultMessage: 'Synced block',
42
42
  description: 'Label which appears above the synced block when it is selected'
43
43
  },
44
+ unsyncedBlockLabel: {
45
+ id: 'fabric.editor.unsyncedBlock.label.text',
46
+ defaultMessage: 'Unsynced block',
47
+ description: 'Label which appears above the unsynced block when it is selected'
48
+ },
44
49
  permissionDeniedHeading: {
45
50
  id: 'fabric.editor.syncedBlockPermissionDeniedHeading',
46
51
  defaultMessage: 'Request access to view synced block',
@@ -103,7 +108,7 @@ var syncBlockMessages = exports.syncBlockMessages = (0, _reactIntlNext.defineMes
103
108
  },
104
109
  deleteConfirmationModalTitleMultiple: {
105
110
  id: 'fabric.editor.deleteConfirmationModalTitleMultiple',
106
- defaultMessage: 'Delete content in {count} locations?',
111
+ defaultMessage: 'Delete content in {count, plural, one {1 location} other {# locations}}?',
107
112
  description: 'Title of delete confirmation modal that appears when user tries to delete source synced block that has references'
108
113
  },
109
114
  deleteConfirmationModalCancelButton: {
@@ -121,6 +126,11 @@ var syncBlockMessages = exports.syncBlockMessages = (0, _reactIntlNext.defineMes
121
126
  defaultMessage: 'Try again',
122
127
  description: 'Text on button which retries deleting the sync block when the previous deletion failed'
123
128
  },
129
+ deleteConfirmationModalDescriptionMultiple: {
130
+ id: 'fabric.editor.deleteConfirmationModalDescriptionMultiple',
131
+ defaultMessage: 'Deleting this content will also remove it from synced locations, where it will appear as an “Unsynced block”.',
132
+ description: 'Description of delete confirmation modal that appears when user tries to delete source synced block'
133
+ },
124
134
  deleteConfirmationModalDescription: {
125
135
  id: 'fabric.editor.deleteConfirmationModalDescriptionSingle',
126
136
  defaultMessage: 'Deleting this content will also remove {syncBlockCount, plural, one {a synced block. References to this block} other {# synced blocks. References to these blocks}} in other locations will show an error. Continue with deletion?',
@@ -193,19 +203,24 @@ var syncBlockMessages = exports.syncBlockMessages = (0, _reactIntlNext.defineMes
193
203
  },
194
204
  notFoundDescription: {
195
205
  id: 'fabric.editor.syncedBlockNotFoundDescription.non-final',
196
- defaultMessage: 'We’re unable to display this content as its source has been deleted or archived.',
206
+ defaultMessage: "We're unable to display this content as its source has been deleted or archived.",
197
207
  description: 'Description for error state where the synced block cannot be found'
198
208
  },
199
209
  sourceUnsyncedDescription: {
200
- id: 'fabric.editor.syncedBlockSourceUnsyncedDescription.non-final',
201
- defaultMessage: "We're unable to display this content as it's been unsynced from source document",
210
+ id: 'fabric.editor.syncedBlockSourceUnsyncedDescription',
211
+ defaultMessage: "We're unable to display this content as it's been unsynced from <a>{title}</a>.",
202
212
  description: 'Description for error state where the synced block has its source unsynced'
203
213
  },
204
214
  sourceDeletedDescription: {
205
- id: 'fabric.editor.syncedBlockSourceDeletedDescription.non-final',
206
- defaultMessage: "We're unable to display this content as it's been deleted from source document.",
215
+ id: 'fabric.editor.syncedBlockSourceDeletedDescription',
216
+ defaultMessage: "We're unable to display this content as it's been deleted from <a>{title}</a>.",
207
217
  description: 'Description for error state where the synced block has its source unsynced'
208
218
  },
219
+ genericNotFoundDescription: {
220
+ id: 'fabric.editor.syncedBlockGenericNotFoundDescription',
221
+ defaultMessage: "We're unable to display this synced content as it's been deleted or unsynced.",
222
+ description: 'Description for error state where the synced block has its source unsynced or deleted'
223
+ },
209
224
  retryButton: {
210
225
  id: 'fabric.editor.retrySyncedBlock',
211
226
  defaultMessage: 'Try again',
@@ -318,7 +333,7 @@ var syncBlockMessages = exports.syncBlockMessages = (0, _reactIntlNext.defineMes
318
333
  },
319
334
  unsyncConfirmationModalDescriptionMultiple: {
320
335
  id: 'fabric.editor.unsyncConfirmationModalDescriptionMultiple',
321
- defaultMessage: 'Your content will stay here. In {syncBlockCount} other synced locations it will appear as an “Unsynced block”. ',
336
+ defaultMessage: 'Your content will stay here. In {syncBlockCount, plural, one {1 other synced location} other {# other synced locations}} it will appear as an “Unsynced block”. ',
322
337
  description: 'Description of unsync confirmation modal that appears when user tries to unsync source synced block with multiple references'
323
338
  },
324
339
  cannotPasteSyncedBlockTitle: {
@@ -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.9.0";
22
+ var packageVersion = "111.9.2";
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
- var customDocSize = editorView.state.doc.nodeSize;
93
- editorView.state.doc.descendants(function (node) {
94
- var _node$attrs;
95
- if (((_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.extensionKey) === 'legacy-content') {
96
- var _node$attrs$parameter, _node$attrs2;
97
- customDocSize += (_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;
98
- }
99
- });
100
- return customDocSize > LIMITED_MODE_NODE_SIZE_THRESHOLD;
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 document size
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);
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+
3
+ var _typeof = require("@babel/runtime/helpers/typeof");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.useSyncBlockActions = exports.SyncBlockActionsProvider = void 0;
8
+ var _react = _interopRequireWildcard(require("react"));
9
+ 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); }
10
+ var SyncBlockActionsContext = /*#__PURE__*/(0, _react.createContext)(null);
11
+ var useSyncBlockActions = exports.useSyncBlockActions = function useSyncBlockActions() {
12
+ return (0, _react.useContext)(SyncBlockActionsContext);
13
+ };
14
+ var SyncBlockActionsProvider = exports.SyncBlockActionsProvider = function SyncBlockActionsProvider(_ref) {
15
+ var children = _ref.children,
16
+ removeSyncBlock = _ref.removeSyncBlock,
17
+ fetchSyncBlockSourceInfo = _ref.fetchSyncBlockSourceInfo;
18
+ var value = (0, _react.useMemo)(function () {
19
+ return {
20
+ deleteSyncBlock: removeSyncBlock,
21
+ fetchSourceInfo: fetchSyncBlockSourceInfo
22
+ };
23
+ }, [removeSyncBlock, fetchSyncBlockSourceInfo]);
24
+ return /*#__PURE__*/_react.default.createElement(SyncBlockActionsContext.Provider, {
25
+ value: value
26
+ }, children);
27
+ };
@@ -9,6 +9,12 @@ Object.defineProperty(exports, "BodiedSyncBlockSharedCssClassName", {
9
9
  return _syncBlock.BodiedSyncBlockSharedCssClassName;
10
10
  }
11
11
  });
12
+ Object.defineProperty(exports, "SyncBlockActionsProvider", {
13
+ enumerable: true,
14
+ get: function get() {
15
+ return _SyncBlockActionsContext.SyncBlockActionsProvider;
16
+ }
17
+ });
12
18
  Object.defineProperty(exports, "SyncBlockLabelSharedCssClassName", {
13
19
  enumerable: true,
14
20
  get: function get() {
@@ -33,4 +39,11 @@ Object.defineProperty(exports, "SyncBlockStateCssClassName", {
33
39
  return _syncBlock.SyncBlockStateCssClassName;
34
40
  }
35
41
  });
36
- var _syncBlock = require("./styles/shared/sync-block");
42
+ Object.defineProperty(exports, "useSyncBlockActions", {
43
+ enumerable: true,
44
+ get: function get() {
45
+ return _SyncBlockActionsContext.useSyncBlockActions;
46
+ }
47
+ });
48
+ var _syncBlock = require("./styles/shared/sync-block");
49
+ var _SyncBlockActionsContext = require("./sync-block/SyncBlockActionsContext");
@@ -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.9.0";
27
+ var packageVersion = "111.9.2";
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.highlightColorPaletteNext = exports.highlightColorPalette = exports.REMOVE_HIGHLIGHT_COLOR = exports.EditorDiagonalLineIcon = void 0;
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() {
@@ -35,6 +35,11 @@ export const syncBlockMessages = defineMessages({
35
35
  defaultMessage: 'Synced block',
36
36
  description: 'Label which appears above the synced block when it is selected'
37
37
  },
38
+ unsyncedBlockLabel: {
39
+ id: 'fabric.editor.unsyncedBlock.label.text',
40
+ defaultMessage: 'Unsynced block',
41
+ description: 'Label which appears above the unsynced block when it is selected'
42
+ },
38
43
  permissionDeniedHeading: {
39
44
  id: 'fabric.editor.syncedBlockPermissionDeniedHeading',
40
45
  defaultMessage: 'Request access to view synced block',
@@ -97,7 +102,7 @@ export const syncBlockMessages = defineMessages({
97
102
  },
98
103
  deleteConfirmationModalTitleMultiple: {
99
104
  id: 'fabric.editor.deleteConfirmationModalTitleMultiple',
100
- defaultMessage: 'Delete content in {count} locations?',
105
+ defaultMessage: 'Delete content in {count, plural, one {1 location} other {# locations}}?',
101
106
  description: 'Title of delete confirmation modal that appears when user tries to delete source synced block that has references'
102
107
  },
103
108
  deleteConfirmationModalCancelButton: {
@@ -115,6 +120,11 @@ export const syncBlockMessages = defineMessages({
115
120
  defaultMessage: 'Try again',
116
121
  description: 'Text on button which retries deleting the sync block when the previous deletion failed'
117
122
  },
123
+ deleteConfirmationModalDescriptionMultiple: {
124
+ id: 'fabric.editor.deleteConfirmationModalDescriptionMultiple',
125
+ defaultMessage: 'Deleting this content will also remove it from synced locations, where it will appear as an “Unsynced block”.',
126
+ description: 'Description of delete confirmation modal that appears when user tries to delete source synced block'
127
+ },
118
128
  deleteConfirmationModalDescription: {
119
129
  id: 'fabric.editor.deleteConfirmationModalDescriptionSingle',
120
130
  defaultMessage: 'Deleting this content will also remove {syncBlockCount, plural, one {a synced block. References to this block} other {# synced blocks. References to these blocks}} in other locations will show an error. Continue with deletion?',
@@ -187,19 +197,24 @@ export const syncBlockMessages = defineMessages({
187
197
  },
188
198
  notFoundDescription: {
189
199
  id: 'fabric.editor.syncedBlockNotFoundDescription.non-final',
190
- defaultMessage: 'We’re unable to display this content as its source has been deleted or archived.',
200
+ defaultMessage: "We're unable to display this content as its source has been deleted or archived.",
191
201
  description: 'Description for error state where the synced block cannot be found'
192
202
  },
193
203
  sourceUnsyncedDescription: {
194
- id: 'fabric.editor.syncedBlockSourceUnsyncedDescription.non-final',
195
- defaultMessage: "We're unable to display this content as it's been unsynced from source document",
204
+ id: 'fabric.editor.syncedBlockSourceUnsyncedDescription',
205
+ defaultMessage: "We're unable to display this content as it's been unsynced from <a>{title}</a>.",
196
206
  description: 'Description for error state where the synced block has its source unsynced'
197
207
  },
198
208
  sourceDeletedDescription: {
199
- id: 'fabric.editor.syncedBlockSourceDeletedDescription.non-final',
200
- defaultMessage: "We're unable to display this content as it's been deleted from source document.",
209
+ id: 'fabric.editor.syncedBlockSourceDeletedDescription',
210
+ defaultMessage: "We're unable to display this content as it's been deleted from <a>{title}</a>.",
201
211
  description: 'Description for error state where the synced block has its source unsynced'
202
212
  },
213
+ genericNotFoundDescription: {
214
+ id: 'fabric.editor.syncedBlockGenericNotFoundDescription',
215
+ defaultMessage: "We're unable to display this synced content as it's been deleted or unsynced.",
216
+ description: 'Description for error state where the synced block has its source unsynced or deleted'
217
+ },
203
218
  retryButton: {
204
219
  id: 'fabric.editor.retrySyncedBlock',
205
220
  defaultMessage: 'Try again',
@@ -312,7 +327,7 @@ export const syncBlockMessages = defineMessages({
312
327
  },
313
328
  unsyncConfirmationModalDescriptionMultiple: {
314
329
  id: 'fabric.editor.unsyncConfirmationModalDescriptionMultiple',
315
- defaultMessage: 'Your content will stay here. In {syncBlockCount} other synced locations it will appear as an “Unsynced block”. ',
330
+ defaultMessage: 'Your content will stay here. In {syncBlockCount, plural, one {1 other synced location} other {# other synced locations}} it will appear as an “Unsynced block”. ',
316
331
  description: 'Description of unsync confirmation modal that appears when user tries to unsync source synced block with multiple references'
317
332
  },
318
333
  cannotPasteSyncedBlockTitle: {
@@ -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.9.0";
7
+ const packageVersion = "111.9.2";
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
- let customDocSize = editorView.state.doc.nodeSize;
68
- editorView.state.doc.descendants(node => {
69
- var _node$attrs;
70
- if (((_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.extensionKey) === 'legacy-content') {
71
- var _node$attrs$parameter, _node$attrs2, _node$attrs2$paramete, _node$attrs2$paramete2;
72
- customDocSize += (_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;
73
- }
74
- });
75
- return customDocSize > LIMITED_MODE_NODE_SIZE_THRESHOLD;
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 document size
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);
@@ -0,0 +1,18 @@
1
+ import React, { createContext, useContext, useMemo } from 'react';
2
+ const SyncBlockActionsContext = /*#__PURE__*/createContext(null);
3
+ export const useSyncBlockActions = () => {
4
+ return useContext(SyncBlockActionsContext);
5
+ };
6
+ export const SyncBlockActionsProvider = ({
7
+ children,
8
+ removeSyncBlock,
9
+ fetchSyncBlockSourceInfo
10
+ }) => {
11
+ const value = useMemo(() => ({
12
+ deleteSyncBlock: removeSyncBlock,
13
+ fetchSourceInfo: fetchSyncBlockSourceInfo
14
+ }), [removeSyncBlock, fetchSyncBlockSourceInfo]);
15
+ return /*#__PURE__*/React.createElement(SyncBlockActionsContext.Provider, {
16
+ value: value
17
+ }, children);
18
+ };
@@ -1,4 +1,5 @@
1
1
  // Disable no-re-export rule for entry point files
2
2
  /* eslint-disable @atlaskit/editor/no-re-export */
3
3
 
4
- export { BodiedSyncBlockSharedCssClassName, SyncBlockSharedCssClassName, SyncBlockLabelSharedCssClassName, SyncBlockStateCssClassName, SyncBlockRendererDataAttributeName } from './styles/shared/sync-block';
4
+ export { BodiedSyncBlockSharedCssClassName, SyncBlockSharedCssClassName, SyncBlockLabelSharedCssClassName, SyncBlockStateCssClassName, SyncBlockRendererDataAttributeName } from './styles/shared/sync-block';
5
+ export { SyncBlockActionsProvider, useSyncBlockActions } from './sync-block/SyncBlockActionsContext';
@@ -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.9.0";
17
+ const packageVersion = "111.9.2";
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, backgroundColorPaletteNext } from '@atlaskit/adf-schema';
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, highlightColorPaletteNext, REMOVE_HIGHLIGHT_COLOR } from './ColorPalette/Palettes/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';
@@ -35,6 +35,11 @@ export var syncBlockMessages = defineMessages({
35
35
  defaultMessage: 'Synced block',
36
36
  description: 'Label which appears above the synced block when it is selected'
37
37
  },
38
+ unsyncedBlockLabel: {
39
+ id: 'fabric.editor.unsyncedBlock.label.text',
40
+ defaultMessage: 'Unsynced block',
41
+ description: 'Label which appears above the unsynced block when it is selected'
42
+ },
38
43
  permissionDeniedHeading: {
39
44
  id: 'fabric.editor.syncedBlockPermissionDeniedHeading',
40
45
  defaultMessage: 'Request access to view synced block',
@@ -97,7 +102,7 @@ export var syncBlockMessages = defineMessages({
97
102
  },
98
103
  deleteConfirmationModalTitleMultiple: {
99
104
  id: 'fabric.editor.deleteConfirmationModalTitleMultiple',
100
- defaultMessage: 'Delete content in {count} locations?',
105
+ defaultMessage: 'Delete content in {count, plural, one {1 location} other {# locations}}?',
101
106
  description: 'Title of delete confirmation modal that appears when user tries to delete source synced block that has references'
102
107
  },
103
108
  deleteConfirmationModalCancelButton: {
@@ -115,6 +120,11 @@ export var syncBlockMessages = defineMessages({
115
120
  defaultMessage: 'Try again',
116
121
  description: 'Text on button which retries deleting the sync block when the previous deletion failed'
117
122
  },
123
+ deleteConfirmationModalDescriptionMultiple: {
124
+ id: 'fabric.editor.deleteConfirmationModalDescriptionMultiple',
125
+ defaultMessage: 'Deleting this content will also remove it from synced locations, where it will appear as an “Unsynced block”.',
126
+ description: 'Description of delete confirmation modal that appears when user tries to delete source synced block'
127
+ },
118
128
  deleteConfirmationModalDescription: {
119
129
  id: 'fabric.editor.deleteConfirmationModalDescriptionSingle',
120
130
  defaultMessage: 'Deleting this content will also remove {syncBlockCount, plural, one {a synced block. References to this block} other {# synced blocks. References to these blocks}} in other locations will show an error. Continue with deletion?',
@@ -187,19 +197,24 @@ export var syncBlockMessages = defineMessages({
187
197
  },
188
198
  notFoundDescription: {
189
199
  id: 'fabric.editor.syncedBlockNotFoundDescription.non-final',
190
- defaultMessage: 'We’re unable to display this content as its source has been deleted or archived.',
200
+ defaultMessage: "We're unable to display this content as its source has been deleted or archived.",
191
201
  description: 'Description for error state where the synced block cannot be found'
192
202
  },
193
203
  sourceUnsyncedDescription: {
194
- id: 'fabric.editor.syncedBlockSourceUnsyncedDescription.non-final',
195
- defaultMessage: "We're unable to display this content as it's been unsynced from source document",
204
+ id: 'fabric.editor.syncedBlockSourceUnsyncedDescription',
205
+ defaultMessage: "We're unable to display this content as it's been unsynced from <a>{title}</a>.",
196
206
  description: 'Description for error state where the synced block has its source unsynced'
197
207
  },
198
208
  sourceDeletedDescription: {
199
- id: 'fabric.editor.syncedBlockSourceDeletedDescription.non-final',
200
- defaultMessage: "We're unable to display this content as it's been deleted from source document.",
209
+ id: 'fabric.editor.syncedBlockSourceDeletedDescription',
210
+ defaultMessage: "We're unable to display this content as it's been deleted from <a>{title}</a>.",
201
211
  description: 'Description for error state where the synced block has its source unsynced'
202
212
  },
213
+ genericNotFoundDescription: {
214
+ id: 'fabric.editor.syncedBlockGenericNotFoundDescription',
215
+ defaultMessage: "We're unable to display this synced content as it's been deleted or unsynced.",
216
+ description: 'Description for error state where the synced block has its source unsynced or deleted'
217
+ },
203
218
  retryButton: {
204
219
  id: 'fabric.editor.retrySyncedBlock',
205
220
  defaultMessage: 'Try again',
@@ -312,7 +327,7 @@ export var syncBlockMessages = defineMessages({
312
327
  },
313
328
  unsyncConfirmationModalDescriptionMultiple: {
314
329
  id: 'fabric.editor.unsyncConfirmationModalDescriptionMultiple',
315
- defaultMessage: 'Your content will stay here. In {syncBlockCount} other synced locations it will appear as an “Unsynced block”. ',
330
+ defaultMessage: 'Your content will stay here. In {syncBlockCount, plural, one {1 other synced location} other {# other synced locations}} it will appear as an “Unsynced block”. ',
316
331
  description: 'Description of unsync confirmation modal that appears when user tries to unsync source synced block with multiple references'
317
332
  },
318
333
  cannotPasteSyncedBlockTitle: {
@@ -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.9.0";
13
+ var packageVersion = "111.9.2";
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
- var customDocSize = editorView.state.doc.nodeSize;
86
- editorView.state.doc.descendants(function (node) {
87
- var _node$attrs;
88
- if (((_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.extensionKey) === 'legacy-content') {
89
- var _node$attrs$parameter, _node$attrs2;
90
- customDocSize += (_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;
91
- }
92
- });
93
- return customDocSize > LIMITED_MODE_NODE_SIZE_THRESHOLD;
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 document size
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);
@@ -0,0 +1,19 @@
1
+ import React, { createContext, useContext, useMemo } from 'react';
2
+ var SyncBlockActionsContext = /*#__PURE__*/createContext(null);
3
+ export var useSyncBlockActions = function useSyncBlockActions() {
4
+ return useContext(SyncBlockActionsContext);
5
+ };
6
+ export var SyncBlockActionsProvider = function SyncBlockActionsProvider(_ref) {
7
+ var children = _ref.children,
8
+ removeSyncBlock = _ref.removeSyncBlock,
9
+ fetchSyncBlockSourceInfo = _ref.fetchSyncBlockSourceInfo;
10
+ var value = useMemo(function () {
11
+ return {
12
+ deleteSyncBlock: removeSyncBlock,
13
+ fetchSourceInfo: fetchSyncBlockSourceInfo
14
+ };
15
+ }, [removeSyncBlock, fetchSyncBlockSourceInfo]);
16
+ return /*#__PURE__*/React.createElement(SyncBlockActionsContext.Provider, {
17
+ value: value
18
+ }, children);
19
+ };
@@ -1,4 +1,5 @@
1
1
  // Disable no-re-export rule for entry point files
2
2
  /* eslint-disable @atlaskit/editor/no-re-export */
3
3
 
4
- export { BodiedSyncBlockSharedCssClassName, SyncBlockSharedCssClassName, SyncBlockLabelSharedCssClassName, SyncBlockStateCssClassName, SyncBlockRendererDataAttributeName } from './styles/shared/sync-block';
4
+ export { BodiedSyncBlockSharedCssClassName, SyncBlockSharedCssClassName, SyncBlockLabelSharedCssClassName, SyncBlockStateCssClassName, SyncBlockRendererDataAttributeName } from './styles/shared/sync-block';
5
+ export { SyncBlockActionsProvider, useSyncBlockActions } from './sync-block/SyncBlockActionsContext';
@@ -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.9.0";
24
+ var packageVersion = "111.9.2";
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, backgroundColorPaletteNext } from '@atlaskit/adf-schema';
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, highlightColorPaletteNext, REMOVE_HIGHLIGHT_COLOR } from './ColorPalette/Palettes/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';
@@ -34,6 +34,11 @@ export declare const syncBlockMessages: {
34
34
  defaultMessage: string;
35
35
  description: string;
36
36
  };
37
+ unsyncedBlockLabel: {
38
+ id: string;
39
+ defaultMessage: string;
40
+ description: string;
41
+ };
37
42
  permissionDeniedHeading: {
38
43
  id: string;
39
44
  defaultMessage: string;
@@ -114,6 +119,11 @@ export declare const syncBlockMessages: {
114
119
  defaultMessage: string;
115
120
  description: string;
116
121
  };
122
+ deleteConfirmationModalDescriptionMultiple: {
123
+ id: string;
124
+ defaultMessage: string;
125
+ description: string;
126
+ };
117
127
  deleteConfirmationModalDescription: {
118
128
  id: string;
119
129
  defaultMessage: string;
@@ -199,6 +209,11 @@ export declare const syncBlockMessages: {
199
209
  defaultMessage: string;
200
210
  description: string;
201
211
  };
212
+ genericNotFoundDescription: {
213
+ id: string;
214
+ defaultMessage: string;
215
+ description: string;
216
+ };
202
217
  retryButton: {
203
218
  id: string;
204
219
  defaultMessage: string;
@@ -0,0 +1,19 @@
1
+ import React, { type ReactNode } from 'react';
2
+ export interface SyncBlockActionsContextValue {
3
+ deleteSyncBlock?: () => void;
4
+ fetchSourceInfo: (sourceAri: string, hasAccess: boolean) => Promise<{
5
+ title?: string;
6
+ url?: string;
7
+ } | undefined>;
8
+ }
9
+ export declare const useSyncBlockActions: () => SyncBlockActionsContextValue | null;
10
+ interface SyncBlockActionsProviderProps {
11
+ children: ReactNode;
12
+ fetchSyncBlockSourceInfo: (sourceAri: string) => Promise<{
13
+ title?: string;
14
+ url?: string;
15
+ } | undefined>;
16
+ removeSyncBlock?: () => void;
17
+ }
18
+ export declare const SyncBlockActionsProvider: ({ children, removeSyncBlock, fetchSyncBlockSourceInfo, }: SyncBlockActionsProviderProps) => React.JSX.Element;
19
+ export {};
@@ -1 +1,2 @@
1
1
  export { BodiedSyncBlockSharedCssClassName, SyncBlockSharedCssClassName, SyncBlockLabelSharedCssClassName, SyncBlockStateCssClassName, SyncBlockRendererDataAttributeName, } from './styles/shared/sync-block';
2
+ export { SyncBlockActionsProvider, useSyncBlockActions, } from './sync-block/SyncBlockActionsContext';
@@ -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, highlightColorPaletteNext, REMOVE_HIGHLIGHT_COLOR, } from './ColorPalette/Palettes/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';
@@ -34,6 +34,11 @@ export declare const syncBlockMessages: {
34
34
  defaultMessage: string;
35
35
  description: string;
36
36
  };
37
+ unsyncedBlockLabel: {
38
+ id: string;
39
+ defaultMessage: string;
40
+ description: string;
41
+ };
37
42
  permissionDeniedHeading: {
38
43
  id: string;
39
44
  defaultMessage: string;
@@ -114,6 +119,11 @@ export declare const syncBlockMessages: {
114
119
  defaultMessage: string;
115
120
  description: string;
116
121
  };
122
+ deleteConfirmationModalDescriptionMultiple: {
123
+ id: string;
124
+ defaultMessage: string;
125
+ description: string;
126
+ };
117
127
  deleteConfirmationModalDescription: {
118
128
  id: string;
119
129
  defaultMessage: string;
@@ -199,6 +209,11 @@ export declare const syncBlockMessages: {
199
209
  defaultMessage: string;
200
210
  description: string;
201
211
  };
212
+ genericNotFoundDescription: {
213
+ id: string;
214
+ defaultMessage: string;
215
+ description: string;
216
+ };
202
217
  retryButton: {
203
218
  id: string;
204
219
  defaultMessage: string;
@@ -0,0 +1,19 @@
1
+ import React, { type ReactNode } from 'react';
2
+ export interface SyncBlockActionsContextValue {
3
+ deleteSyncBlock?: () => void;
4
+ fetchSourceInfo: (sourceAri: string, hasAccess: boolean) => Promise<{
5
+ title?: string;
6
+ url?: string;
7
+ } | undefined>;
8
+ }
9
+ export declare const useSyncBlockActions: () => SyncBlockActionsContextValue | null;
10
+ interface SyncBlockActionsProviderProps {
11
+ children: ReactNode;
12
+ fetchSyncBlockSourceInfo: (sourceAri: string) => Promise<{
13
+ title?: string;
14
+ url?: string;
15
+ } | undefined>;
16
+ removeSyncBlock?: () => void;
17
+ }
18
+ export declare const SyncBlockActionsProvider: ({ children, removeSyncBlock, fetchSyncBlockSourceInfo, }: SyncBlockActionsProviderProps) => React.JSX.Element;
19
+ export {};
@@ -1 +1,2 @@
1
1
  export { BodiedSyncBlockSharedCssClassName, SyncBlockSharedCssClassName, SyncBlockLabelSharedCssClassName, SyncBlockStateCssClassName, SyncBlockRendererDataAttributeName, } from './styles/shared/sync-block';
2
+ export { SyncBlockActionsProvider, useSyncBlockActions, } from './sync-block/SyncBlockActionsContext';
@@ -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, highlightColorPaletteNext, REMOVE_HIGHLIGHT_COLOR, } from './ColorPalette/Palettes/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.1",
3
+ "version": "111.9.3",
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.33.0",
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": "^16.35.0",
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",