@atlaskit/editor-common 111.9.2 → 111.9.4

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,20 @@
1
1
  # @atlaskit/editor-common
2
2
 
3
+ ## 111.9.4
4
+
5
+ ### Patch Changes
6
+
7
+ - [`faddbf566c913`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/faddbf566c913) -
8
+ [ux] Add error message in reference sync block when source is unpublished
9
+
10
+ ## 111.9.3
11
+
12
+ ### Patch Changes
13
+
14
+ - [`f11ff647ea458`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/f11ff647ea458) -
15
+ [ux] [EDITOR-4521] Implement source deleted reference UI, update block deleted/unsynced reference
16
+ UI to add delete button, unsynced label and source title/url
17
+
3
18
  ## 111.9.2
4
19
 
5
20
  ### 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',
@@ -216,6 +231,11 @@ var syncBlockMessages = exports.syncBlockMessages = (0, _reactIntlNext.defineMes
216
231
  defaultMessage: "We're unable to display synced blocks when you're offline",
217
232
  description: 'Error message which is shown over sync block when the editor is offline'
218
233
  },
234
+ unpublishedError: {
235
+ id: 'fabric.editor.error.description.reference.unpublished',
236
+ defaultMessage: 'Synced content will display <link>when the page is published</link>',
237
+ description: 'Error message which is shown over sync block when the source page is unpublished.'
238
+ },
219
239
  syncBlockCopiedTitle: {
220
240
  id: 'fabric.editor.syncBlockCopiedTitle',
221
241
  defaultMessage: 'Synced block copied to clipboard',
@@ -318,7 +338,7 @@ var syncBlockMessages = exports.syncBlockMessages = (0, _reactIntlNext.defineMes
318
338
  },
319
339
  unsyncConfirmationModalDescriptionMultiple: {
320
340
  id: 'fabric.editor.unsyncConfirmationModalDescriptionMultiple',
321
- defaultMessage: 'Your content will stay here. In {syncBlockCount} other synced locations it will appear as an “Unsynced block”. ',
341
+ 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
342
  description: 'Description of unsync confirmation modal that appears when user tries to unsync source synced block with multiple references'
323
343
  },
324
344
  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.1";
22
+ var packageVersion = "111.9.3";
23
23
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
24
24
  // Remove URL as it has UGC
25
25
  // Ignored via go/ees007
@@ -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.1";
27
+ var packageVersion = "111.9.3";
28
28
  var halfFocusRing = 1;
29
29
  var dropOffset = '0, 8';
30
30
  var fadeIn = (0, _react2.keyframes)({
@@ -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',
@@ -210,6 +225,11 @@ export const syncBlockMessages = defineMessages({
210
225
  defaultMessage: `We're unable to display synced blocks when you're offline`,
211
226
  description: 'Error message which is shown over sync block when the editor is offline'
212
227
  },
228
+ unpublishedError: {
229
+ id: 'fabric.editor.error.description.reference.unpublished',
230
+ defaultMessage: 'Synced content will display <link>when the page is published</link>',
231
+ description: 'Error message which is shown over sync block when the source page is unpublished.'
232
+ },
213
233
  syncBlockCopiedTitle: {
214
234
  id: 'fabric.editor.syncBlockCopiedTitle',
215
235
  defaultMessage: 'Synced block copied to clipboard',
@@ -312,7 +332,7 @@ export const syncBlockMessages = defineMessages({
312
332
  },
313
333
  unsyncConfirmationModalDescriptionMultiple: {
314
334
  id: 'fabric.editor.unsyncConfirmationModalDescriptionMultiple',
315
- defaultMessage: 'Your content will stay here. In {syncBlockCount} other synced locations it will appear as an “Unsynced block”. ',
335
+ 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
336
  description: 'Description of unsync confirmation modal that appears when user tries to unsync source synced block with multiple references'
317
337
  },
318
338
  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.1";
7
+ const packageVersion = "111.9.3";
8
8
  const sanitiseSentryEvents = (data, _hint) => {
9
9
  // Remove URL as it has UGC
10
10
  // Ignored via go/ees007
@@ -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.1";
17
+ const packageVersion = "111.9.3";
18
18
  const halfFocusRing = 1;
19
19
  const dropOffset = '0, 8';
20
20
  const fadeIn = keyframes({
@@ -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',
@@ -210,6 +225,11 @@ export var syncBlockMessages = defineMessages({
210
225
  defaultMessage: "We're unable to display synced blocks when you're offline",
211
226
  description: 'Error message which is shown over sync block when the editor is offline'
212
227
  },
228
+ unpublishedError: {
229
+ id: 'fabric.editor.error.description.reference.unpublished',
230
+ defaultMessage: 'Synced content will display <link>when the page is published</link>',
231
+ description: 'Error message which is shown over sync block when the source page is unpublished.'
232
+ },
213
233
  syncBlockCopiedTitle: {
214
234
  id: 'fabric.editor.syncBlockCopiedTitle',
215
235
  defaultMessage: 'Synced block copied to clipboard',
@@ -312,7 +332,7 @@ export var syncBlockMessages = defineMessages({
312
332
  },
313
333
  unsyncConfirmationModalDescriptionMultiple: {
314
334
  id: 'fabric.editor.unsyncConfirmationModalDescriptionMultiple',
315
- defaultMessage: 'Your content will stay here. In {syncBlockCount} other synced locations it will appear as an “Unsynced block”. ',
335
+ 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
336
  description: 'Description of unsync confirmation modal that appears when user tries to unsync source synced block with multiple references'
317
337
  },
318
338
  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.1";
13
+ var packageVersion = "111.9.3";
14
14
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
15
15
  // Remove URL as it has UGC
16
16
  // Ignored via go/ees007
@@ -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.1";
24
+ var packageVersion = "111.9.3";
25
25
  var halfFocusRing = 1;
26
26
  var dropOffset = '0, 8';
27
27
  var fadeIn = keyframes({
@@ -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;
@@ -209,6 +224,11 @@ export declare const syncBlockMessages: {
209
224
  defaultMessage: string;
210
225
  description: string;
211
226
  };
227
+ unpublishedError: {
228
+ id: string;
229
+ defaultMessage: string;
230
+ description: string;
231
+ };
212
232
  syncBlockCopiedTitle: {
213
233
  id: string;
214
234
  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';
@@ -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;
@@ -209,6 +224,11 @@ export declare const syncBlockMessages: {
209
224
  defaultMessage: string;
210
225
  description: string;
211
226
  };
227
+ unpublishedError: {
228
+ id: string;
229
+ defaultMessage: string;
230
+ description: string;
231
+ };
212
232
  syncBlockCopiedTitle: {
213
233
  id: string;
214
234
  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';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "111.9.2",
3
+ "version": "111.9.4",
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/"
@@ -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": "^17.0.0",
84
+ "@atlaskit/tmp-editor-statsig": "^17.1.0",
85
85
  "@atlaskit/tokens": "^10.1.0",
86
86
  "@atlaskit/tooltip": "^20.14.0",
87
87
  "@atlaskit/width-detector": "^5.0.0",