@atlaskit/editor-common 111.8.11 → 111.8.13

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 CHANGED
@@ -1,5 +1,26 @@
1
1
  # @atlaskit/editor-common
2
2
 
3
+ ## 111.8.13
4
+
5
+ ### Patch Changes
6
+
7
+ - [`41d5a8796f3e1`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/41d5a8796f3e1) -
8
+ [EDITOR-4472] Update content copy for sync block
9
+ - [`28434cbe03f1e`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/28434cbe03f1e) -
10
+ [ux] [EDITOR-2851]
11
+ - Implement unsync feature for source sync block
12
+ - Update deletion confirmation modal and reference block UI after source deletion
13
+
14
+ ## 111.8.12
15
+
16
+ ### Patch Changes
17
+
18
+ - [`87abc5dda86fe`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/87abc5dda86fe) -
19
+ [ux] Show last edited time in sync block tooltip
20
+ - [`9041ec452a104`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/9041ec452a104) -
21
+ [EDITOR-4515] clean up fg platform_editor_toolbar_aifc_patch_7
22
+ - Updated dependencies
23
+
3
24
  ## 111.8.11
4
25
 
5
26
  ### Patch Changes
@@ -22,8 +22,8 @@ var syncBlockMessages = exports.syncBlockMessages = (0, _reactIntlNext.defineMes
22
22
  description: 'Button label for editing the source of sync block element'
23
23
  },
24
24
  editSourceTooltip: {
25
- id: 'fabric.editor.editSourceTooltip',
26
- defaultMessage: 'Edit at the source location',
25
+ id: 'fabric.editor.editSourceTooltipEnabled',
26
+ defaultMessage: 'Edit synced content at source location',
27
27
  description: 'Tooltip for the button to navigate to the source page of the sync block element'
28
28
  },
29
29
  editSourceTooltipDisabled: {
@@ -86,15 +86,25 @@ var syncBlockMessages = exports.syncBlockMessages = (0, _reactIntlNext.defineMes
86
86
  defaultMessage: 'Synced from: {title}',
87
87
  description: 'Tooltip that shows the source page title of the synced block'
88
88
  },
89
+ referenceSyncBlockLastEdited: {
90
+ id: 'fabric.editor.referenceSyncBlockLastEdited',
91
+ defaultMessage: 'Last edited: ',
92
+ description: 'Tooltip that shows the last edited time of the synced block'
93
+ },
89
94
  taskInDestinationSyncedBlockTooltip: {
90
95
  id: 'fabric.editor.taskInDestinationSyncedBlockTooltip',
91
96
  defaultMessage: 'This content is synced. Edit it at the source.',
92
97
  description: 'Tooltip that shows when you hover over a task in the destination synced block'
93
98
  },
94
- deleteConfirmationModalTitle: {
95
- id: 'fabric.editor.deleteConfirmationModalTitle',
96
- defaultMessage: "You're about to delete synced content",
97
- description: 'Title of delete confirmation modal that appears when user tries to delete source synced block'
99
+ deleteConfirmationModalTitleSingle: {
100
+ id: 'fabric.editor.deleteConfirmationModalTitleSingle',
101
+ defaultMessage: 'Delete synced block?',
102
+ description: 'Title of delete confirmation modal that appears when user tries to delete source synced block that has no reference'
103
+ },
104
+ deleteConfirmationModalTitleMultiple: {
105
+ id: 'fabric.editor.deleteConfirmationModalTitleMultiple',
106
+ defaultMessage: 'Delete content in {count} locations?',
107
+ description: 'Title of delete confirmation modal that appears when user tries to delete source synced block that has references'
98
108
  },
99
109
  deleteConfirmationModalCancelButton: {
100
110
  id: 'fabric.editor.deleteConfirmationModalCancelButton',
@@ -116,6 +126,11 @@ var syncBlockMessages = exports.syncBlockMessages = (0, _reactIntlNext.defineMes
116
126
  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?',
117
127
  description: 'Description of delete confirmation modal that appears when user tries to delete source synced block'
118
128
  },
129
+ deleteConfirmationModalDescriptionNoRef: {
130
+ id: 'fabric.editor.deleteConfirmationModalDescriptionNoRef',
131
+ defaultMessage: "You'll no longer be able to reuse this synced block to keep content updated across locations. ",
132
+ description: 'Description of delete confirmation modal that appears when user tries to delete source synced block'
133
+ },
119
134
  createSyncBlockLabel: {
120
135
  id: 'fabric.editor.createSyncBlockLabel',
121
136
  defaultMessage: 'Create synced block',
@@ -137,8 +152,8 @@ var syncBlockMessages = exports.syncBlockMessages = (0, _reactIntlNext.defineMes
137
152
  description: 'Description in flag which appears when a sync block cannot be deleted in offline mode'
138
153
  },
139
154
  cannotDeleteTitle: {
140
- id: 'fabric.editor.error.title.cannotDelete',
141
- defaultMessage: "We couldn't delete the synced block",
155
+ id: 'fabric.editor.error.flag.title.cannotDelete',
156
+ defaultMessage: 'Failed to delete synced block',
142
157
  description: 'Title in flag which appears when a sync block cannot be deleted'
143
158
  },
144
159
  cannotDeleteDescription: {
@@ -181,14 +196,24 @@ var syncBlockMessages = exports.syncBlockMessages = (0, _reactIntlNext.defineMes
181
196
  defaultMessage: 'We’re unable to display this content as its source has been deleted or archived.',
182
197
  description: 'Description for error state where the synced block cannot be found'
183
198
  },
199
+ 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",
202
+ description: 'Description for error state where the synced block has its source unsynced'
203
+ },
204
+ 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.",
207
+ description: 'Description for error state where the synced block has its source unsynced'
208
+ },
184
209
  retryButton: {
185
210
  id: 'fabric.editor.retrySyncedBlock',
186
211
  defaultMessage: 'Try again',
187
212
  description: 'Label for button which retries loading the synced block'
188
213
  },
189
214
  offlineError: {
190
- id: 'fabric.editor.error.description.offline',
191
- defaultMessage: "We're unable to display this content at the moment because you are offline.",
215
+ id: 'fabric.editor.error.description.reference.offline',
216
+ defaultMessage: "We're unable to display synced blocks when you're offline",
192
217
  description: 'Error message which is shown over sync block when the editor is offline'
193
218
  },
194
219
  syncBlockCopiedTitle: {
@@ -265,5 +290,25 @@ var syncBlockMessages = exports.syncBlockMessages = (0, _reactIntlNext.defineMes
265
290
  id: 'fabric.editor.syncedBlock.unsync',
266
291
  defaultMessage: 'Unsync',
267
292
  description: 'Text on the button which unsyncs the sync block'
293
+ },
294
+ deleteConfirmationModalUnsyncButton: {
295
+ id: 'fabric.editor.deleteConfirmationModalUnsyncButton',
296
+ defaultMessage: 'Unsync',
297
+ description: 'Text on button which confirms unsyncing the sync block when user was trying to unsync source synced block'
298
+ },
299
+ unsyncConfirmationModalTitle: {
300
+ id: 'fabric.editor.unsyncConfirmationModalTitle',
301
+ defaultMessage: 'Unsync this content?',
302
+ description: 'Title of unsync confirmation modal that appears when user tries to unsync source synced block'
303
+ },
304
+ unsyncConfirmationModalDescriptionSingle: {
305
+ id: 'fabric.editor.unsyncConfirmationModalDescriptionSingle',
306
+ defaultMessage: 'Your content will stay here. It will no longer be a synced block.',
307
+ description: 'Description of unsync confirmation modal that appears when user tries to unsync source synced block with no reference'
308
+ },
309
+ unsyncConfirmationModalDescriptionMultiple: {
310
+ id: 'fabric.editor.unsyncConfirmationModalDescriptionMultiple',
311
+ defaultMessage: 'Your content will stay here. In {syncBlockCount} other synced locations it will appear as an “Unsynced block”. ',
312
+ description: 'Description of unsync confirmation modal that appears when user tries to unsync source synced block with multiple references'
268
313
  }
269
314
  });
@@ -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.8.10";
22
+ var packageVersion = "111.8.12";
23
23
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
24
24
  // Remove URL as it has UGC
25
25
  // Ignored via go/ees007
@@ -7,7 +7,6 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.EditorToolbarUIProvider = void 0;
8
8
  var _react = _interopRequireWildcard(require("react"));
9
9
  var _editorToolbar = require("@atlaskit/editor-toolbar");
10
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
11
10
  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); }
12
11
  var EditorToolbarUIProvider = exports.EditorToolbarUIProvider = function EditorToolbarUIProvider(_ref) {
13
12
  var children = _ref.children,
@@ -22,23 +21,11 @@ var EditorToolbarUIProvider = exports.EditorToolbarUIProvider = function EditorT
22
21
  var isOpen = _ref2.isOpen,
23
22
  event = _ref2.event;
24
23
  if (!isOpen) {
25
- if ((0, _platformFeatureFlags.fg)('platform_editor_toolbar_aifc_patch_7')) {
26
- // Only refocus the editor when the dropdown closes via mouse or programmatic close.
27
- // When closed via keyboard Escape, keep focus on the trigger for better keyboard UX.
28
- var isKeyboardEscape = event instanceof KeyboardEvent && event.key === 'Escape';
29
- var shouldFocusEditor = !isKeyboardEscape;
30
- if (shouldFocusEditor) {
31
- // On Dropdown closed, focus is returned to trigger button by default in requestAnimationFrame
32
- // Hence, `.focus()` should also be called in requestAnimationFrame
33
- setTimeout(function () {
34
- return requestAnimationFrame(function () {
35
- api === null || api === void 0 || api.core.actions.focus({
36
- scrollIntoView: false
37
- });
38
- });
39
- }, 1);
40
- }
41
- } else {
24
+ // Only refocus the editor when the dropdown closes via mouse or programmatic close.
25
+ // When closed via keyboard Escape, keep focus on the trigger for better keyboard UX.
26
+ var isKeyboardEscape = event instanceof KeyboardEvent && event.key === 'Escape';
27
+ var shouldFocusEditor = !isKeyboardEscape;
28
+ if (shouldFocusEditor) {
42
29
  // On Dropdown closed, focus is returned to trigger button by default in requestAnimationFrame
43
30
  // Hence, `.focus()` should also be called in requestAnimationFrame
44
31
  setTimeout(function () {
@@ -50,6 +37,7 @@ var EditorToolbarUIProvider = exports.EditorToolbarUIProvider = function EditorT
50
37
  }, 1);
51
38
  }
52
39
  }
40
+ ;
53
41
  }, [api]);
54
42
  return /*#__PURE__*/_react.default.createElement(_editorToolbar.ToolbarUIProvider, {
55
43
  onDropdownOpenChanged: onDropdownOpenChanged,
@@ -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.8.10";
27
+ var packageVersion = "111.8.12";
28
28
  var halfFocusRing = 1;
29
29
  var dropOffset = '0, 8';
30
30
  var fadeIn = (0, _react2.keyframes)({
@@ -7,7 +7,6 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.ToolbarArrowKeyNavigationProvider = exports.KeyDownHandlerContext = void 0;
8
8
  var _react = _interopRequireWildcard(require("react"));
9
9
  var _react2 = require("@emotion/react");
10
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
11
10
  var _elementBrowser = require("../../element-browser");
12
11
  var _messages = require("../../messages");
13
12
  var _mediaInsert = require("../../messages/media-insert");
@@ -272,15 +271,8 @@ function isElementOrAncestorHiddenOrDisabled(element, rootNode) {
272
271
  function getFilteredFocusableElements(rootNode) {
273
272
  // The focusable elements from child components such as dropdown menus / popups are ignored
274
273
  return getFocusableElements(rootNode).filter(function (elm) {
275
- var style = window.getComputedStyle(elm);
276
- // ignore invisible element to avoid losing focus
277
- var isVisible = style.visibility !== 'hidden' && style.display !== 'none';
278
-
279
274
  // Check if element or any ancestor is hidden or disabled
280
275
  var isHiddenOrDisabled = isElementOrAncestorHiddenOrDisabled(elm, rootNode);
281
- if ((0, _platformFeatureFlags.fg)('platform_editor_toolbar_aifc_patch_7')) {
282
- return !elm.closest('[data-role="droplistContent"]') && !elm.closest('[data-emoji-picker-container="true"]') && !elm.closest('[data-test-id="color-picker-menu"]') && !elm.closest('.scroll-buttons') && !isHiddenOrDisabled;
283
- }
284
- return !elm.closest('[data-role="droplistContent"]') && !elm.closest('[data-emoji-picker-container="true"]') && !elm.closest('[data-test-id="color-picker-menu"]') && !elm.closest('.scroll-buttons') && isVisible;
276
+ return !elm.closest('[data-role="droplistContent"]') && !elm.closest('[data-emoji-picker-container="true"]') && !elm.closest('[data-test-id="color-picker-menu"]') && !elm.closest('.scroll-buttons') && !isHiddenOrDisabled;
285
277
  });
286
278
  }
@@ -16,8 +16,8 @@ export const syncBlockMessages = defineMessages({
16
16
  description: 'Button label for editing the source of sync block element'
17
17
  },
18
18
  editSourceTooltip: {
19
- id: 'fabric.editor.editSourceTooltip',
20
- defaultMessage: 'Edit at the source location',
19
+ id: 'fabric.editor.editSourceTooltipEnabled',
20
+ defaultMessage: 'Edit synced content at source location',
21
21
  description: 'Tooltip for the button to navigate to the source page of the sync block element'
22
22
  },
23
23
  editSourceTooltipDisabled: {
@@ -80,15 +80,25 @@ export const syncBlockMessages = defineMessages({
80
80
  defaultMessage: 'Synced from: {title}',
81
81
  description: 'Tooltip that shows the source page title of the synced block'
82
82
  },
83
+ referenceSyncBlockLastEdited: {
84
+ id: 'fabric.editor.referenceSyncBlockLastEdited',
85
+ defaultMessage: 'Last edited: ',
86
+ description: 'Tooltip that shows the last edited time of the synced block'
87
+ },
83
88
  taskInDestinationSyncedBlockTooltip: {
84
89
  id: 'fabric.editor.taskInDestinationSyncedBlockTooltip',
85
90
  defaultMessage: 'This content is synced. Edit it at the source.',
86
91
  description: 'Tooltip that shows when you hover over a task in the destination synced block'
87
92
  },
88
- deleteConfirmationModalTitle: {
89
- id: 'fabric.editor.deleteConfirmationModalTitle',
90
- defaultMessage: "You're about to delete synced content",
91
- description: 'Title of delete confirmation modal that appears when user tries to delete source synced block'
93
+ deleteConfirmationModalTitleSingle: {
94
+ id: 'fabric.editor.deleteConfirmationModalTitleSingle',
95
+ defaultMessage: 'Delete synced block?',
96
+ description: 'Title of delete confirmation modal that appears when user tries to delete source synced block that has no reference'
97
+ },
98
+ deleteConfirmationModalTitleMultiple: {
99
+ id: 'fabric.editor.deleteConfirmationModalTitleMultiple',
100
+ defaultMessage: 'Delete content in {count} locations?',
101
+ description: 'Title of delete confirmation modal that appears when user tries to delete source synced block that has references'
92
102
  },
93
103
  deleteConfirmationModalCancelButton: {
94
104
  id: 'fabric.editor.deleteConfirmationModalCancelButton',
@@ -110,6 +120,11 @@ export const syncBlockMessages = defineMessages({
110
120
  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?',
111
121
  description: 'Description of delete confirmation modal that appears when user tries to delete source synced block'
112
122
  },
123
+ deleteConfirmationModalDescriptionNoRef: {
124
+ id: 'fabric.editor.deleteConfirmationModalDescriptionNoRef',
125
+ defaultMessage: "You'll no longer be able to reuse this synced block to keep content updated across locations. ",
126
+ description: 'Description of delete confirmation modal that appears when user tries to delete source synced block'
127
+ },
113
128
  createSyncBlockLabel: {
114
129
  id: 'fabric.editor.createSyncBlockLabel',
115
130
  defaultMessage: 'Create synced block',
@@ -131,8 +146,8 @@ export const syncBlockMessages = defineMessages({
131
146
  description: 'Description in flag which appears when a sync block cannot be deleted in offline mode'
132
147
  },
133
148
  cannotDeleteTitle: {
134
- id: 'fabric.editor.error.title.cannotDelete',
135
- defaultMessage: "We couldn't delete the synced block",
149
+ id: 'fabric.editor.error.flag.title.cannotDelete',
150
+ defaultMessage: 'Failed to delete synced block',
136
151
  description: 'Title in flag which appears when a sync block cannot be deleted'
137
152
  },
138
153
  cannotDeleteDescription: {
@@ -175,14 +190,24 @@ export const syncBlockMessages = defineMessages({
175
190
  defaultMessage: 'We’re unable to display this content as its source has been deleted or archived.',
176
191
  description: 'Description for error state where the synced block cannot be found'
177
192
  },
193
+ 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",
196
+ description: 'Description for error state where the synced block has its source unsynced'
197
+ },
198
+ 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.",
201
+ description: 'Description for error state where the synced block has its source unsynced'
202
+ },
178
203
  retryButton: {
179
204
  id: 'fabric.editor.retrySyncedBlock',
180
205
  defaultMessage: 'Try again',
181
206
  description: 'Label for button which retries loading the synced block'
182
207
  },
183
208
  offlineError: {
184
- id: 'fabric.editor.error.description.offline',
185
- defaultMessage: `We're unable to display this content at the moment because you are offline.`,
209
+ id: 'fabric.editor.error.description.reference.offline',
210
+ defaultMessage: `We're unable to display synced blocks when you're offline`,
186
211
  description: 'Error message which is shown over sync block when the editor is offline'
187
212
  },
188
213
  syncBlockCopiedTitle: {
@@ -259,5 +284,25 @@ export const syncBlockMessages = defineMessages({
259
284
  id: 'fabric.editor.syncedBlock.unsync',
260
285
  defaultMessage: 'Unsync',
261
286
  description: 'Text on the button which unsyncs the sync block'
287
+ },
288
+ deleteConfirmationModalUnsyncButton: {
289
+ id: 'fabric.editor.deleteConfirmationModalUnsyncButton',
290
+ defaultMessage: 'Unsync',
291
+ description: 'Text on button which confirms unsyncing the sync block when user was trying to unsync source synced block'
292
+ },
293
+ unsyncConfirmationModalTitle: {
294
+ id: 'fabric.editor.unsyncConfirmationModalTitle',
295
+ defaultMessage: 'Unsync this content?',
296
+ description: 'Title of unsync confirmation modal that appears when user tries to unsync source synced block'
297
+ },
298
+ unsyncConfirmationModalDescriptionSingle: {
299
+ id: 'fabric.editor.unsyncConfirmationModalDescriptionSingle',
300
+ defaultMessage: 'Your content will stay here. It will no longer be a synced block.',
301
+ description: 'Description of unsync confirmation modal that appears when user tries to unsync source synced block with no reference'
302
+ },
303
+ unsyncConfirmationModalDescriptionMultiple: {
304
+ id: 'fabric.editor.unsyncConfirmationModalDescriptionMultiple',
305
+ defaultMessage: 'Your content will stay here. In {syncBlockCount} other synced locations it will appear as an “Unsynced block”. ',
306
+ description: 'Description of unsync confirmation modal that appears when user tries to unsync source synced block with multiple references'
262
307
  }
263
308
  });
@@ -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.8.10";
7
+ const packageVersion = "111.8.12";
8
8
  const sanitiseSentryEvents = (data, _hint) => {
9
9
  // Remove URL as it has UGC
10
10
  // Ignored via go/ees007
@@ -1,6 +1,5 @@
1
1
  import React, { useCallback } from 'react';
2
2
  import { ToolbarUIProvider } from '@atlaskit/editor-toolbar';
3
- import { fg } from '@atlaskit/platform-feature-flags';
4
3
  export const EditorToolbarUIProvider = ({
5
4
  children,
6
5
  api,
@@ -16,21 +15,11 @@ export const EditorToolbarUIProvider = ({
16
15
  event
17
16
  }) => {
18
17
  if (!isOpen) {
19
- if (fg('platform_editor_toolbar_aifc_patch_7')) {
20
- // Only refocus the editor when the dropdown closes via mouse or programmatic close.
21
- // When closed via keyboard Escape, keep focus on the trigger for better keyboard UX.
22
- const isKeyboardEscape = event instanceof KeyboardEvent && event.key === 'Escape';
23
- const shouldFocusEditor = !isKeyboardEscape;
24
- if (shouldFocusEditor) {
25
- // On Dropdown closed, focus is returned to trigger button by default in requestAnimationFrame
26
- // Hence, `.focus()` should also be called in requestAnimationFrame
27
- setTimeout(() => requestAnimationFrame(() => {
28
- api === null || api === void 0 ? void 0 : api.core.actions.focus({
29
- scrollIntoView: false
30
- });
31
- }), 1);
32
- }
33
- } else {
18
+ // Only refocus the editor when the dropdown closes via mouse or programmatic close.
19
+ // When closed via keyboard Escape, keep focus on the trigger for better keyboard UX.
20
+ const isKeyboardEscape = event instanceof KeyboardEvent && event.key === 'Escape';
21
+ const shouldFocusEditor = !isKeyboardEscape;
22
+ if (shouldFocusEditor) {
34
23
  // On Dropdown closed, focus is returned to trigger button by default in requestAnimationFrame
35
24
  // Hence, `.focus()` should also be called in requestAnimationFrame
36
25
  setTimeout(() => requestAnimationFrame(() => {
@@ -40,6 +29,7 @@ export const EditorToolbarUIProvider = ({
40
29
  }), 1);
41
30
  }
42
31
  }
32
+ ;
43
33
  }, [api]);
44
34
  return /*#__PURE__*/React.createElement(ToolbarUIProvider, {
45
35
  onDropdownOpenChanged: onDropdownOpenChanged,
@@ -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.8.10";
17
+ const packageVersion = "111.8.12";
18
18
  const halfFocusRing = 1;
19
19
  const dropOffset = '0, 8';
20
20
  const fadeIn = keyframes({
@@ -7,7 +7,6 @@ import React, { useCallback, useLayoutEffect, useMemo, useRef } from 'react';
7
7
 
8
8
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
9
9
  import { css, jsx } from '@emotion/react';
10
- import { fg } from '@atlaskit/platform-feature-flags';
11
10
  import { ELEMENT_BROWSER_ID } from '../../element-browser';
12
11
  import { fullPageMessages } from '../../messages';
13
12
  import { mediaInsertMessages } from '../../messages/media-insert';
@@ -264,15 +263,8 @@ function isElementOrAncestorHiddenOrDisabled(element, rootNode) {
264
263
  function getFilteredFocusableElements(rootNode) {
265
264
  // The focusable elements from child components such as dropdown menus / popups are ignored
266
265
  return getFocusableElements(rootNode).filter(elm => {
267
- const style = window.getComputedStyle(elm);
268
- // ignore invisible element to avoid losing focus
269
- const isVisible = style.visibility !== 'hidden' && style.display !== 'none';
270
-
271
266
  // Check if element or any ancestor is hidden or disabled
272
267
  const isHiddenOrDisabled = isElementOrAncestorHiddenOrDisabled(elm, rootNode);
273
- if (fg('platform_editor_toolbar_aifc_patch_7')) {
274
- return !elm.closest('[data-role="droplistContent"]') && !elm.closest('[data-emoji-picker-container="true"]') && !elm.closest('[data-test-id="color-picker-menu"]') && !elm.closest('.scroll-buttons') && !isHiddenOrDisabled;
275
- }
276
- return !elm.closest('[data-role="droplistContent"]') && !elm.closest('[data-emoji-picker-container="true"]') && !elm.closest('[data-test-id="color-picker-menu"]') && !elm.closest('.scroll-buttons') && isVisible;
268
+ return !elm.closest('[data-role="droplistContent"]') && !elm.closest('[data-emoji-picker-container="true"]') && !elm.closest('[data-test-id="color-picker-menu"]') && !elm.closest('.scroll-buttons') && !isHiddenOrDisabled;
277
269
  });
278
270
  }
@@ -16,8 +16,8 @@ export var syncBlockMessages = defineMessages({
16
16
  description: 'Button label for editing the source of sync block element'
17
17
  },
18
18
  editSourceTooltip: {
19
- id: 'fabric.editor.editSourceTooltip',
20
- defaultMessage: 'Edit at the source location',
19
+ id: 'fabric.editor.editSourceTooltipEnabled',
20
+ defaultMessage: 'Edit synced content at source location',
21
21
  description: 'Tooltip for the button to navigate to the source page of the sync block element'
22
22
  },
23
23
  editSourceTooltipDisabled: {
@@ -80,15 +80,25 @@ export var syncBlockMessages = defineMessages({
80
80
  defaultMessage: 'Synced from: {title}',
81
81
  description: 'Tooltip that shows the source page title of the synced block'
82
82
  },
83
+ referenceSyncBlockLastEdited: {
84
+ id: 'fabric.editor.referenceSyncBlockLastEdited',
85
+ defaultMessage: 'Last edited: ',
86
+ description: 'Tooltip that shows the last edited time of the synced block'
87
+ },
83
88
  taskInDestinationSyncedBlockTooltip: {
84
89
  id: 'fabric.editor.taskInDestinationSyncedBlockTooltip',
85
90
  defaultMessage: 'This content is synced. Edit it at the source.',
86
91
  description: 'Tooltip that shows when you hover over a task in the destination synced block'
87
92
  },
88
- deleteConfirmationModalTitle: {
89
- id: 'fabric.editor.deleteConfirmationModalTitle',
90
- defaultMessage: "You're about to delete synced content",
91
- description: 'Title of delete confirmation modal that appears when user tries to delete source synced block'
93
+ deleteConfirmationModalTitleSingle: {
94
+ id: 'fabric.editor.deleteConfirmationModalTitleSingle',
95
+ defaultMessage: 'Delete synced block?',
96
+ description: 'Title of delete confirmation modal that appears when user tries to delete source synced block that has no reference'
97
+ },
98
+ deleteConfirmationModalTitleMultiple: {
99
+ id: 'fabric.editor.deleteConfirmationModalTitleMultiple',
100
+ defaultMessage: 'Delete content in {count} locations?',
101
+ description: 'Title of delete confirmation modal that appears when user tries to delete source synced block that has references'
92
102
  },
93
103
  deleteConfirmationModalCancelButton: {
94
104
  id: 'fabric.editor.deleteConfirmationModalCancelButton',
@@ -110,6 +120,11 @@ export var syncBlockMessages = defineMessages({
110
120
  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?',
111
121
  description: 'Description of delete confirmation modal that appears when user tries to delete source synced block'
112
122
  },
123
+ deleteConfirmationModalDescriptionNoRef: {
124
+ id: 'fabric.editor.deleteConfirmationModalDescriptionNoRef',
125
+ defaultMessage: "You'll no longer be able to reuse this synced block to keep content updated across locations. ",
126
+ description: 'Description of delete confirmation modal that appears when user tries to delete source synced block'
127
+ },
113
128
  createSyncBlockLabel: {
114
129
  id: 'fabric.editor.createSyncBlockLabel',
115
130
  defaultMessage: 'Create synced block',
@@ -131,8 +146,8 @@ export var syncBlockMessages = defineMessages({
131
146
  description: 'Description in flag which appears when a sync block cannot be deleted in offline mode'
132
147
  },
133
148
  cannotDeleteTitle: {
134
- id: 'fabric.editor.error.title.cannotDelete',
135
- defaultMessage: "We couldn't delete the synced block",
149
+ id: 'fabric.editor.error.flag.title.cannotDelete',
150
+ defaultMessage: 'Failed to delete synced block',
136
151
  description: 'Title in flag which appears when a sync block cannot be deleted'
137
152
  },
138
153
  cannotDeleteDescription: {
@@ -175,14 +190,24 @@ export var syncBlockMessages = defineMessages({
175
190
  defaultMessage: 'We’re unable to display this content as its source has been deleted or archived.',
176
191
  description: 'Description for error state where the synced block cannot be found'
177
192
  },
193
+ 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",
196
+ description: 'Description for error state where the synced block has its source unsynced'
197
+ },
198
+ 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.",
201
+ description: 'Description for error state where the synced block has its source unsynced'
202
+ },
178
203
  retryButton: {
179
204
  id: 'fabric.editor.retrySyncedBlock',
180
205
  defaultMessage: 'Try again',
181
206
  description: 'Label for button which retries loading the synced block'
182
207
  },
183
208
  offlineError: {
184
- id: 'fabric.editor.error.description.offline',
185
- defaultMessage: "We're unable to display this content at the moment because you are offline.",
209
+ id: 'fabric.editor.error.description.reference.offline',
210
+ defaultMessage: "We're unable to display synced blocks when you're offline",
186
211
  description: 'Error message which is shown over sync block when the editor is offline'
187
212
  },
188
213
  syncBlockCopiedTitle: {
@@ -259,5 +284,25 @@ export var syncBlockMessages = defineMessages({
259
284
  id: 'fabric.editor.syncedBlock.unsync',
260
285
  defaultMessage: 'Unsync',
261
286
  description: 'Text on the button which unsyncs the sync block'
287
+ },
288
+ deleteConfirmationModalUnsyncButton: {
289
+ id: 'fabric.editor.deleteConfirmationModalUnsyncButton',
290
+ defaultMessage: 'Unsync',
291
+ description: 'Text on button which confirms unsyncing the sync block when user was trying to unsync source synced block'
292
+ },
293
+ unsyncConfirmationModalTitle: {
294
+ id: 'fabric.editor.unsyncConfirmationModalTitle',
295
+ defaultMessage: 'Unsync this content?',
296
+ description: 'Title of unsync confirmation modal that appears when user tries to unsync source synced block'
297
+ },
298
+ unsyncConfirmationModalDescriptionSingle: {
299
+ id: 'fabric.editor.unsyncConfirmationModalDescriptionSingle',
300
+ defaultMessage: 'Your content will stay here. It will no longer be a synced block.',
301
+ description: 'Description of unsync confirmation modal that appears when user tries to unsync source synced block with no reference'
302
+ },
303
+ unsyncConfirmationModalDescriptionMultiple: {
304
+ id: 'fabric.editor.unsyncConfirmationModalDescriptionMultiple',
305
+ defaultMessage: 'Your content will stay here. In {syncBlockCount} other synced locations it will appear as an “Unsynced block”. ',
306
+ description: 'Description of unsync confirmation modal that appears when user tries to unsync source synced block with multiple references'
262
307
  }
263
308
  });
@@ -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.8.10";
13
+ var packageVersion = "111.8.12";
14
14
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
15
15
  // Remove URL as it has UGC
16
16
  // Ignored via go/ees007
@@ -1,6 +1,5 @@
1
1
  import React, { useCallback } from 'react';
2
2
  import { ToolbarUIProvider } from '@atlaskit/editor-toolbar';
3
- import { fg } from '@atlaskit/platform-feature-flags';
4
3
  export var EditorToolbarUIProvider = function EditorToolbarUIProvider(_ref) {
5
4
  var children = _ref.children,
6
5
  api = _ref.api,
@@ -14,23 +13,11 @@ export var EditorToolbarUIProvider = function EditorToolbarUIProvider(_ref) {
14
13
  var isOpen = _ref2.isOpen,
15
14
  event = _ref2.event;
16
15
  if (!isOpen) {
17
- if (fg('platform_editor_toolbar_aifc_patch_7')) {
18
- // Only refocus the editor when the dropdown closes via mouse or programmatic close.
19
- // When closed via keyboard Escape, keep focus on the trigger for better keyboard UX.
20
- var isKeyboardEscape = event instanceof KeyboardEvent && event.key === 'Escape';
21
- var shouldFocusEditor = !isKeyboardEscape;
22
- if (shouldFocusEditor) {
23
- // On Dropdown closed, focus is returned to trigger button by default in requestAnimationFrame
24
- // Hence, `.focus()` should also be called in requestAnimationFrame
25
- setTimeout(function () {
26
- return requestAnimationFrame(function () {
27
- api === null || api === void 0 || api.core.actions.focus({
28
- scrollIntoView: false
29
- });
30
- });
31
- }, 1);
32
- }
33
- } else {
16
+ // Only refocus the editor when the dropdown closes via mouse or programmatic close.
17
+ // When closed via keyboard Escape, keep focus on the trigger for better keyboard UX.
18
+ var isKeyboardEscape = event instanceof KeyboardEvent && event.key === 'Escape';
19
+ var shouldFocusEditor = !isKeyboardEscape;
20
+ if (shouldFocusEditor) {
34
21
  // On Dropdown closed, focus is returned to trigger button by default in requestAnimationFrame
35
22
  // Hence, `.focus()` should also be called in requestAnimationFrame
36
23
  setTimeout(function () {
@@ -42,6 +29,7 @@ export var EditorToolbarUIProvider = function EditorToolbarUIProvider(_ref) {
42
29
  }, 1);
43
30
  }
44
31
  }
32
+ ;
45
33
  }, [api]);
46
34
  return /*#__PURE__*/React.createElement(ToolbarUIProvider, {
47
35
  onDropdownOpenChanged: onDropdownOpenChanged,
@@ -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.8.10";
24
+ var packageVersion = "111.8.12";
25
25
  var halfFocusRing = 1;
26
26
  var dropOffset = '0, 8';
27
27
  var fadeIn = keyframes({
@@ -7,7 +7,6 @@ import React, { useCallback, useLayoutEffect, useMemo, useRef } from 'react';
7
7
 
8
8
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
9
9
  import { css, jsx } from '@emotion/react';
10
- import { fg } from '@atlaskit/platform-feature-flags';
11
10
  import { ELEMENT_BROWSER_ID } from '../../element-browser';
12
11
  import { fullPageMessages } from '../../messages';
13
12
  import { mediaInsertMessages } from '../../messages/media-insert';
@@ -264,15 +263,8 @@ function isElementOrAncestorHiddenOrDisabled(element, rootNode) {
264
263
  function getFilteredFocusableElements(rootNode) {
265
264
  // The focusable elements from child components such as dropdown menus / popups are ignored
266
265
  return getFocusableElements(rootNode).filter(function (elm) {
267
- var style = window.getComputedStyle(elm);
268
- // ignore invisible element to avoid losing focus
269
- var isVisible = style.visibility !== 'hidden' && style.display !== 'none';
270
-
271
266
  // Check if element or any ancestor is hidden or disabled
272
267
  var isHiddenOrDisabled = isElementOrAncestorHiddenOrDisabled(elm, rootNode);
273
- if (fg('platform_editor_toolbar_aifc_patch_7')) {
274
- return !elm.closest('[data-role="droplistContent"]') && !elm.closest('[data-emoji-picker-container="true"]') && !elm.closest('[data-test-id="color-picker-menu"]') && !elm.closest('.scroll-buttons') && !isHiddenOrDisabled;
275
- }
276
- return !elm.closest('[data-role="droplistContent"]') && !elm.closest('[data-emoji-picker-container="true"]') && !elm.closest('[data-test-id="color-picker-menu"]') && !elm.closest('.scroll-buttons') && isVisible;
268
+ return !elm.closest('[data-role="droplistContent"]') && !elm.closest('[data-emoji-picker-container="true"]') && !elm.closest('[data-test-id="color-picker-menu"]') && !elm.closest('.scroll-buttons') && !isHiddenOrDisabled;
277
269
  });
278
270
  }
@@ -79,12 +79,22 @@ export declare const syncBlockMessages: {
79
79
  defaultMessage: string;
80
80
  description: string;
81
81
  };
82
+ referenceSyncBlockLastEdited: {
83
+ id: string;
84
+ defaultMessage: string;
85
+ description: string;
86
+ };
82
87
  taskInDestinationSyncedBlockTooltip: {
83
88
  id: string;
84
89
  defaultMessage: string;
85
90
  description: string;
86
91
  };
87
- deleteConfirmationModalTitle: {
92
+ deleteConfirmationModalTitleSingle: {
93
+ id: string;
94
+ defaultMessage: string;
95
+ description: string;
96
+ };
97
+ deleteConfirmationModalTitleMultiple: {
88
98
  id: string;
89
99
  defaultMessage: string;
90
100
  description: string;
@@ -109,6 +119,11 @@ export declare const syncBlockMessages: {
109
119
  defaultMessage: string;
110
120
  description: string;
111
121
  };
122
+ deleteConfirmationModalDescriptionNoRef: {
123
+ id: string;
124
+ defaultMessage: string;
125
+ description: string;
126
+ };
112
127
  createSyncBlockLabel: {
113
128
  id: string;
114
129
  defaultMessage: string;
@@ -174,6 +189,16 @@ export declare const syncBlockMessages: {
174
189
  defaultMessage: string;
175
190
  description: string;
176
191
  };
192
+ sourceUnsyncedDescription: {
193
+ id: string;
194
+ defaultMessage: string;
195
+ description: string;
196
+ };
197
+ sourceDeletedDescription: {
198
+ id: string;
199
+ defaultMessage: string;
200
+ description: string;
201
+ };
177
202
  retryButton: {
178
203
  id: string;
179
204
  defaultMessage: string;
@@ -259,4 +284,24 @@ export declare const syncBlockMessages: {
259
284
  defaultMessage: string;
260
285
  description: string;
261
286
  };
287
+ deleteConfirmationModalUnsyncButton: {
288
+ id: string;
289
+ defaultMessage: string;
290
+ description: string;
291
+ };
292
+ unsyncConfirmationModalTitle: {
293
+ id: string;
294
+ defaultMessage: string;
295
+ description: string;
296
+ };
297
+ unsyncConfirmationModalDescriptionSingle: {
298
+ id: string;
299
+ defaultMessage: string;
300
+ description: string;
301
+ };
302
+ unsyncConfirmationModalDescriptionMultiple: {
303
+ id: string;
304
+ defaultMessage: string;
305
+ description: string;
306
+ };
262
307
  };
@@ -79,12 +79,22 @@ export declare const syncBlockMessages: {
79
79
  defaultMessage: string;
80
80
  description: string;
81
81
  };
82
+ referenceSyncBlockLastEdited: {
83
+ id: string;
84
+ defaultMessage: string;
85
+ description: string;
86
+ };
82
87
  taskInDestinationSyncedBlockTooltip: {
83
88
  id: string;
84
89
  defaultMessage: string;
85
90
  description: string;
86
91
  };
87
- deleteConfirmationModalTitle: {
92
+ deleteConfirmationModalTitleSingle: {
93
+ id: string;
94
+ defaultMessage: string;
95
+ description: string;
96
+ };
97
+ deleteConfirmationModalTitleMultiple: {
88
98
  id: string;
89
99
  defaultMessage: string;
90
100
  description: string;
@@ -109,6 +119,11 @@ export declare const syncBlockMessages: {
109
119
  defaultMessage: string;
110
120
  description: string;
111
121
  };
122
+ deleteConfirmationModalDescriptionNoRef: {
123
+ id: string;
124
+ defaultMessage: string;
125
+ description: string;
126
+ };
112
127
  createSyncBlockLabel: {
113
128
  id: string;
114
129
  defaultMessage: string;
@@ -174,6 +189,16 @@ export declare const syncBlockMessages: {
174
189
  defaultMessage: string;
175
190
  description: string;
176
191
  };
192
+ sourceUnsyncedDescription: {
193
+ id: string;
194
+ defaultMessage: string;
195
+ description: string;
196
+ };
197
+ sourceDeletedDescription: {
198
+ id: string;
199
+ defaultMessage: string;
200
+ description: string;
201
+ };
177
202
  retryButton: {
178
203
  id: string;
179
204
  defaultMessage: string;
@@ -259,4 +284,24 @@ export declare const syncBlockMessages: {
259
284
  defaultMessage: string;
260
285
  description: string;
261
286
  };
287
+ deleteConfirmationModalUnsyncButton: {
288
+ id: string;
289
+ defaultMessage: string;
290
+ description: string;
291
+ };
292
+ unsyncConfirmationModalTitle: {
293
+ id: string;
294
+ defaultMessage: string;
295
+ description: string;
296
+ };
297
+ unsyncConfirmationModalDescriptionSingle: {
298
+ id: string;
299
+ defaultMessage: string;
300
+ description: string;
301
+ };
302
+ unsyncConfirmationModalDescriptionMultiple: {
303
+ id: string;
304
+ defaultMessage: string;
305
+ description: string;
306
+ };
262
307
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "111.8.11",
3
+ "version": "111.8.13",
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/"
@@ -50,7 +50,7 @@
50
50
  "@atlaskit/editor-toolbar": "^0.19.0",
51
51
  "@atlaskit/editor-toolbar-model": "^0.3.0",
52
52
  "@atlaskit/emoji": "^69.10.0",
53
- "@atlaskit/icon": "^29.4.0",
53
+ "@atlaskit/icon": "^30.0.0",
54
54
  "@atlaskit/icon-object": "^7.4.0",
55
55
  "@atlaskit/link": "^3.3.0",
56
56
  "@atlaskit/link-datasource": "^4.32.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.30.0",
84
+ "@atlaskit/tmp-editor-statsig": "^16.31.0",
85
85
  "@atlaskit/tokens": "^10.1.0",
86
86
  "@atlaskit/tooltip": "^20.14.0",
87
87
  "@atlaskit/width-detector": "^5.0.0",
@@ -120,7 +120,7 @@
120
120
  },
121
121
  "devDependencies": {
122
122
  "@atlaskit/media-core": "^37.0.0",
123
- "@atlassian/a11y-jest-testing": "^0.7.0",
123
+ "@atlassian/a11y-jest-testing": "^0.8.0",
124
124
  "@testing-library/dom": "^10.1.0",
125
125
  "@testing-library/jest-dom": "^6.4.5",
126
126
  "@testing-library/react": "^16.3.0",
@@ -232,9 +232,6 @@
232
232
  "platform_editor_link_picker_width_fix": {
233
233
  "type": "boolean"
234
234
  },
235
- "platform_editor_toolbar_aifc_patch_7": {
236
- "type": "boolean"
237
- },
238
235
  "platform_editor_content_mode_button_mvp": {
239
236
  "type": "boolean"
240
237
  },