@atlaskit/editor-common 117.0.2 → 117.1.1

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,25 @@
1
1
  # @atlaskit/editor-common
2
2
 
3
+ ## 117.1.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [`7167e21d35f98`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/7167e21d35f98) -
8
+ Include the source block in synced location toolbar counts and explain the empty state in a
9
+ tooltip
10
+ - [`66dd767196a39`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/66dd767196a39) -
11
+ Receive actingUserId and populate as required
12
+
13
+ ## 117.1.0
14
+
15
+ ### Minor Changes
16
+
17
+ - [`bf4e41c29b4ea`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/bf4e41c29b4ea) -
18
+ Add `migratedFrom` macro aliases for Connect-to-Forge rendering. Forge macro manifests can declare
19
+ `migratedFrom: ['legacy-connect-macro-key']`; consumers can use the new
20
+ `combineExtensionProviders(providers, { resolveExtension, resolvePreloadedExtension })` options to
21
+ resolve that alias before the normal provider lookup.
22
+
3
23
  ## 117.0.2
4
24
 
5
25
  ### Patch Changes
@@ -13,9 +13,12 @@ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r)
13
13
  function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
14
14
  /**
15
15
  * Allow to run methods from the `ExtensionProvider` interface across all providers seamlessly.
16
- * This handles promise racing and discards rejected promises safely.
16
+ * This handles optional explicit resolution, promise racing, and safely discarded rejections.
17
17
  */
18
18
  var _default = exports.default = function _default(extensionProviders) {
19
+ var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
20
+ resolveExtension = _ref.resolveExtension,
21
+ resolvePreloadedExtension = _ref.resolvePreloadedExtension;
19
22
  var providersCache = [];
20
23
  var _combineProviders = (0, _providerHelpers.combineProviders)(extensionProviders),
21
24
  invokeSingle = _combineProviders.invokeSingle,
@@ -53,6 +56,10 @@ var _default = exports.default = function _default(extensionProviders) {
53
56
  }))();
54
57
  },
55
58
  getPreloadedExtension: function getPreloadedExtension(type, key) {
59
+ var resolvedExtension = resolvePreloadedExtension === null || resolvePreloadedExtension === void 0 ? void 0 : resolvePreloadedExtension(type, key);
60
+ if (resolvedExtension) {
61
+ return resolvedExtension;
62
+ }
56
63
  if (providersCache.length === 0) {
57
64
  // preload() has not been called yet
58
65
  return;
@@ -82,7 +89,28 @@ var _default = exports.default = function _default(extensionProviders) {
82
89
  }
83
90
  },
84
91
  getExtension: function getExtension(type, key) {
85
- return invokeSingle('getExtension', [type, key]);
92
+ return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
93
+ var resolvedExtension;
94
+ return _regenerator.default.wrap(function (_context2) {
95
+ while (1) switch (_context2.prev = _context2.next) {
96
+ case 0:
97
+ _context2.next = 1;
98
+ return resolveExtension === null || resolveExtension === void 0 ? void 0 : resolveExtension(type, key);
99
+ case 1:
100
+ resolvedExtension = _context2.sent;
101
+ if (!resolvedExtension) {
102
+ _context2.next = 2;
103
+ break;
104
+ }
105
+ return _context2.abrupt("return", resolvedExtension);
106
+ case 2:
107
+ return _context2.abrupt("return", invokeSingle('getExtension', [type, key]));
108
+ case 3:
109
+ case "end":
110
+ return _context2.stop();
111
+ }
112
+ }, _callee2);
113
+ }))();
86
114
  },
87
115
  search: function search(keyword) {
88
116
  return invokeList('search', [keyword]);
@@ -15,5 +15,10 @@ var avatarGroupMessages = exports.avatarGroupMessages = (0, _reactIntl.defineMes
15
15
  id: 'fabric.editor.anonymous-collaborator',
16
16
  defaultMessage: 'Anonymous collaborator',
17
17
  description: 'The name of an anonymous collaborator, used when the participant name is not specified'
18
+ },
19
+ agentWithUser: {
20
+ id: 'fabric.editor.agent-with-user',
21
+ defaultMessage: '{agentName} with {userName}',
22
+ description: 'Tooltip text for an agent avatar in the editor presence avatar group. The agentName placeholder is the AI agent display name. The userName placeholder is the display name of the user the agent is acting on behalf of.'
18
23
  }
19
24
  });
@@ -331,6 +331,11 @@ var syncBlockMessages = exports.syncBlockMessages = (0, _reactIntl.defineMessage
331
331
  defaultMessage: 'Loading synced locations',
332
332
  description: 'Accessible label for the spinner while synced locations are loading.'
333
333
  },
334
+ syncedLocationDropdownNoReferencesTooltip: {
335
+ id: 'editor-common.messages.syncBlock.syncedLocationDropdownNoReferencesTooltip.ai-non-final',
336
+ defaultMessage: 'Not yet synced to any other locations',
337
+ description: 'Tooltip for the synced locations toolbar button when the selected synced block has no references.'
338
+ },
334
339
  syncedLocationDropdownHeading: {
335
340
  id: 'fabric.editor.syncedLocationDropdownHeading',
336
341
  defaultMessage: '{count} locations:',
@@ -28,7 +28,7 @@ var NETWORK_FAILURE_REGEX = /^network failure/i;
28
28
  var RESIZE_OBSERVER_LOOP_REGEX = /ResizeObserver loop completed with undelivered notifications/;
29
29
  var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
30
30
  var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
31
- var packageVersion = "117.0.1";
31
+ var packageVersion = "117.1.0";
32
32
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
33
33
  // Remove URL as it has UGC
34
34
  // Ignored via go/ees007
@@ -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 = "117.0.1";
27
+ var packageVersion = "117.1.0";
28
28
  var halfFocusRing = 1;
29
29
  var dropOffset = '0, 8';
30
30
  var fadeIn = (0, _react2.keyframes)({
@@ -1,9 +1,12 @@
1
1
  import { combineProviders } from '../provider-helpers';
2
2
  /**
3
3
  * Allow to run methods from the `ExtensionProvider` interface across all providers seamlessly.
4
- * This handles promise racing and discards rejected promises safely.
4
+ * This handles optional explicit resolution, promise racing, and safely discarded rejections.
5
5
  */
6
- export default (extensionProviders => {
6
+ export default ((extensionProviders, {
7
+ resolveExtension,
8
+ resolvePreloadedExtension
9
+ } = {}) => {
7
10
  let providersCache = [];
8
11
  const {
9
12
  invokeSingle,
@@ -23,6 +26,10 @@ export default (extensionProviders => {
23
26
  }));
24
27
  },
25
28
  getPreloadedExtension(type, key) {
29
+ const resolvedExtension = resolvePreloadedExtension === null || resolvePreloadedExtension === void 0 ? void 0 : resolvePreloadedExtension(type, key);
30
+ if (resolvedExtension) {
31
+ return resolvedExtension;
32
+ }
26
33
  if (providersCache.length === 0) {
27
34
  // preload() has not been called yet
28
35
  return;
@@ -42,7 +49,11 @@ export default (extensionProviders => {
42
49
  }
43
50
  }
44
51
  },
45
- getExtension(type, key) {
52
+ async getExtension(type, key) {
53
+ const resolvedExtension = await (resolveExtension === null || resolveExtension === void 0 ? void 0 : resolveExtension(type, key));
54
+ if (resolvedExtension) {
55
+ return resolvedExtension;
56
+ }
46
57
  return invokeSingle('getExtension', [type, key]);
47
58
  },
48
59
  search(keyword) {
@@ -9,5 +9,10 @@ export const avatarGroupMessages = defineMessages({
9
9
  id: 'fabric.editor.anonymous-collaborator',
10
10
  defaultMessage: 'Anonymous collaborator',
11
11
  description: 'The name of an anonymous collaborator, used when the participant name is not specified'
12
+ },
13
+ agentWithUser: {
14
+ id: 'fabric.editor.agent-with-user',
15
+ defaultMessage: '{agentName} with {userName}',
16
+ description: 'Tooltip text for an agent avatar in the editor presence avatar group. The agentName placeholder is the AI agent display name. The userName placeholder is the display name of the user the agent is acting on behalf of.'
12
17
  }
13
18
  });
@@ -325,6 +325,11 @@ export const syncBlockMessages = defineMessages({
325
325
  defaultMessage: 'Loading synced locations',
326
326
  description: 'Accessible label for the spinner while synced locations are loading.'
327
327
  },
328
+ syncedLocationDropdownNoReferencesTooltip: {
329
+ id: 'editor-common.messages.syncBlock.syncedLocationDropdownNoReferencesTooltip.ai-non-final',
330
+ defaultMessage: 'Not yet synced to any other locations',
331
+ description: 'Tooltip for the synced locations toolbar button when the selected synced block has no references.'
332
+ },
328
333
  syncedLocationDropdownHeading: {
329
334
  id: 'fabric.editor.syncedLocationDropdownHeading',
330
335
  defaultMessage: '{count} locations:',
@@ -14,7 +14,7 @@ const NETWORK_FAILURE_REGEX = /^network failure/i;
14
14
  const RESIZE_OBSERVER_LOOP_REGEX = /ResizeObserver loop completed with undelivered notifications/;
15
15
  const SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
16
16
  const packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
17
- const packageVersion = "117.0.1";
17
+ const packageVersion = "117.1.0";
18
18
  const sanitiseSentryEvents = (data, _hint) => {
19
19
  // Remove URL as it has UGC
20
20
  // Ignored via go/ees007
@@ -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 = "117.0.1";
17
+ const packageVersion = "117.1.0";
18
18
  const halfFocusRing = 1;
19
19
  const dropOffset = '0, 8';
20
20
  const fadeIn = keyframes({
@@ -6,9 +6,12 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";
6
6
  import { combineProviders } from '../provider-helpers';
7
7
  /**
8
8
  * Allow to run methods from the `ExtensionProvider` interface across all providers seamlessly.
9
- * This handles promise racing and discards rejected promises safely.
9
+ * This handles optional explicit resolution, promise racing, and safely discarded rejections.
10
10
  */
11
11
  export default (function (extensionProviders) {
12
+ var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
13
+ resolveExtension = _ref.resolveExtension,
14
+ resolvePreloadedExtension = _ref.resolvePreloadedExtension;
12
15
  var providersCache = [];
13
16
  var _combineProviders = combineProviders(extensionProviders),
14
17
  invokeSingle = _combineProviders.invokeSingle,
@@ -46,6 +49,10 @@ export default (function (extensionProviders) {
46
49
  }))();
47
50
  },
48
51
  getPreloadedExtension: function getPreloadedExtension(type, key) {
52
+ var resolvedExtension = resolvePreloadedExtension === null || resolvePreloadedExtension === void 0 ? void 0 : resolvePreloadedExtension(type, key);
53
+ if (resolvedExtension) {
54
+ return resolvedExtension;
55
+ }
49
56
  if (providersCache.length === 0) {
50
57
  // preload() has not been called yet
51
58
  return;
@@ -75,7 +82,28 @@ export default (function (extensionProviders) {
75
82
  }
76
83
  },
77
84
  getExtension: function getExtension(type, key) {
78
- return invokeSingle('getExtension', [type, key]);
85
+ return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
86
+ var resolvedExtension;
87
+ return _regeneratorRuntime.wrap(function (_context2) {
88
+ while (1) switch (_context2.prev = _context2.next) {
89
+ case 0:
90
+ _context2.next = 1;
91
+ return resolveExtension === null || resolveExtension === void 0 ? void 0 : resolveExtension(type, key);
92
+ case 1:
93
+ resolvedExtension = _context2.sent;
94
+ if (!resolvedExtension) {
95
+ _context2.next = 2;
96
+ break;
97
+ }
98
+ return _context2.abrupt("return", resolvedExtension);
99
+ case 2:
100
+ return _context2.abrupt("return", invokeSingle('getExtension', [type, key]));
101
+ case 3:
102
+ case "end":
103
+ return _context2.stop();
104
+ }
105
+ }, _callee2);
106
+ }))();
79
107
  },
80
108
  search: function search(keyword) {
81
109
  return invokeList('search', [keyword]);
@@ -9,5 +9,10 @@ export var avatarGroupMessages = defineMessages({
9
9
  id: 'fabric.editor.anonymous-collaborator',
10
10
  defaultMessage: 'Anonymous collaborator',
11
11
  description: 'The name of an anonymous collaborator, used when the participant name is not specified'
12
+ },
13
+ agentWithUser: {
14
+ id: 'fabric.editor.agent-with-user',
15
+ defaultMessage: '{agentName} with {userName}',
16
+ description: 'Tooltip text for an agent avatar in the editor presence avatar group. The agentName placeholder is the AI agent display name. The userName placeholder is the display name of the user the agent is acting on behalf of.'
12
17
  }
13
18
  });
@@ -325,6 +325,11 @@ export var syncBlockMessages = defineMessages({
325
325
  defaultMessage: 'Loading synced locations',
326
326
  description: 'Accessible label for the spinner while synced locations are loading.'
327
327
  },
328
+ syncedLocationDropdownNoReferencesTooltip: {
329
+ id: 'editor-common.messages.syncBlock.syncedLocationDropdownNoReferencesTooltip.ai-non-final',
330
+ defaultMessage: 'Not yet synced to any other locations',
331
+ description: 'Tooltip for the synced locations toolbar button when the selected synced block has no references.'
332
+ },
328
333
  syncedLocationDropdownHeading: {
329
334
  id: 'fabric.editor.syncedLocationDropdownHeading',
330
335
  defaultMessage: '{count} locations:',
@@ -20,7 +20,7 @@ var NETWORK_FAILURE_REGEX = /^network failure/i;
20
20
  var RESIZE_OBSERVER_LOOP_REGEX = /ResizeObserver loop completed with undelivered notifications/;
21
21
  var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
22
22
  var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
23
- var packageVersion = "117.0.1";
23
+ var packageVersion = "117.1.0";
24
24
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
25
25
  // Remove URL as it has UGC
26
26
  // Ignored via go/ees007
@@ -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 = "117.0.1";
24
+ var packageVersion = "117.1.0";
25
25
  var halfFocusRing = 1;
26
26
  var dropOffset = '0, 8';
27
27
  var fadeIn = keyframes({
@@ -376,6 +376,7 @@ type ProviderParticipantPermitLevel = {
376
376
  isPermittedToView?: boolean;
377
377
  };
378
378
  export interface CollabParticipant {
379
+ actingUserId?: string;
379
380
  avatar: string;
380
381
  cursorPos?: number;
381
382
  isGuest?: boolean;
@@ -386,6 +387,7 @@ export interface CollabParticipant {
386
387
  presenceActivity?: PresenceActivity;
387
388
  presenceId?: string;
388
389
  sessionId: string;
390
+ userId?: string;
389
391
  }
390
392
  export type ProviderParticipant = CollabParticipant & {
391
393
  clientId: number | string;
@@ -1,7 +1,12 @@
1
+ import type { ExtensionKey, ExtensionManifest, ExtensionType } from './types/extension-manifest';
1
2
  import type { ExtensionProvider } from './types/extension-provider';
3
+ type CombineExtensionProvidersOptions = {
4
+ resolveExtension?: (type: ExtensionType, key: ExtensionKey) => Promise<ExtensionManifest | undefined>;
5
+ resolvePreloadedExtension?: (type: ExtensionType, key: ExtensionKey) => ExtensionManifest | undefined;
6
+ };
2
7
  export default _default;
3
8
  /**
4
9
  * Allow to run methods from the `ExtensionProvider` interface across all providers seamlessly.
5
- * This handles promise racing and discards rejected promises safely.
10
+ * This handles optional explicit resolution, promise racing, and safely discarded rejections.
6
11
  */
7
- declare function _default(extensionProviders: (ExtensionProvider | Promise<ExtensionProvider>)[]): ExtensionProvider;
12
+ declare function _default(extensionProviders: (ExtensionProvider | Promise<ExtensionProvider>)[], { resolveExtension, resolvePreloadedExtension }?: CombineExtensionProvidersOptions): ExtensionProvider;
@@ -1,12 +1,17 @@
1
1
  export declare const avatarGroupMessages: {
2
- editors: {
3
- id: string;
2
+ agentWithUser: {
4
3
  defaultMessage: string;
5
4
  description: string;
5
+ id: string;
6
6
  };
7
7
  anonymousCollaborator: {
8
+ defaultMessage: string;
9
+ description: string;
8
10
  id: string;
11
+ };
12
+ editors: {
9
13
  defaultMessage: string;
10
14
  description: string;
15
+ id: string;
11
16
  };
12
17
  };
@@ -409,6 +409,11 @@ export declare const syncBlockMessages: {
409
409
  description: string;
410
410
  id: string;
411
411
  };
412
+ syncedLocationDropdownNoReferencesTooltip: {
413
+ defaultMessage: string;
414
+ description: string;
415
+ id: string;
416
+ };
412
417
  syncedLocationDropdownNoResults: {
413
418
  defaultMessage: string;
414
419
  description: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "117.0.2",
3
+ "version": "117.1.1",
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/"