@atlaskit/editor-common 118.12.0 → 119.0.0

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,40 @@
1
1
  # @atlaskit/editor-common
2
2
 
3
+ ## 119.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - [`bb37742539a7d`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/bb37742539a7d) -
8
+ Rename Quick Insert category analytics from app counts to macro counts, add reusable extension app
9
+ identity, and track internal, ecosystem, and all macro/app counts for externally provided items
10
+ behind `platform_editor_slash_app_category_analytics`. GUID-only app identities are grouped as
11
+ `unknown`.
12
+
13
+ Breaking change: `CategoryInformation` and `QuickInsertInformationAttributes` from
14
+ `@atlaskit/editor-common/analytics/types/quick-insert-events` have changed shape. Update usages to
15
+ the new fields (`internalMacroCount`, `internalAppCount`, `internalAppMacroMax`,
16
+ `ecosystemMacroCount`, `ecosystemAppCount`, `ecosystemAppMacroMax`, `allMacroCount`,
17
+ `allAppCount`, and `allAppMacroMax`) and add the `allCategories` aggregate. Remove references to
18
+ the removed `appCount` and `appMacros` fields. `ExtensionApp.ownership` has been replaced by
19
+ `ExtensionApp.source` (`internal` or `ecosystem`); update app metadata producers accordingly.
20
+
21
+ ### Minor Changes
22
+
23
+ - [`ddb1f3da1e991`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/ddb1f3da1e991) -
24
+ Track acceptance rate for backend-persisted agent edits. These arrive as remote collab steps
25
+ rather than frontend-streamed transformations, so they previously started no analytics session and
26
+ were absent from the metric. They now reuse the existing survival definition, and are recorded
27
+ only on the requesting user's client.
28
+
29
+ Gated by `platform_editor_agent_be_streaming`, which controls whether remote agent steps are
30
+ annotated at all, and by the agent type allowlist in
31
+ `platform_editor_backend_review_moment_agent_types`, which defaults to empty. Recording cannot
32
+ occur unless both permit it.
33
+
34
+ ### Patch Changes
35
+
36
+ - Updated dependencies
37
+
3
38
  ## 118.12.0
4
39
 
5
40
  ### Minor Changes
@@ -6,17 +6,23 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.buildMenuItem = buildMenuItem;
8
8
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
+ var _isExperimentEnabled = require("@atlaskit/platform-feature-experiments/is-experiment-enabled");
9
10
  var _manifestHelpers = require("./manifest-helpers");
10
11
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
11
12
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
12
13
  function buildMenuItem(manifest, extensionModule) {
14
+ var _ref, _extensionModule$app;
13
15
  var title = extensionModule.title || manifest.title;
14
16
  var key = "".concat(manifest.key, ":").concat(extensionModule.key);
15
17
  var node = (0, _manifestHelpers.buildAction)(extensionModule.action, manifest);
16
18
  if (!node) {
17
19
  throw new Error("Couldn't find any action for ".concat(title, " (").concat(key, ")"));
18
20
  }
19
- return _objectSpread(_objectSpread({
21
+ return _objectSpread(_objectSpread(_objectSpread({}, (0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_slash_app_category_analytics') ? {
22
+ app: (_ref = (_extensionModule$app = extensionModule.app) !== null && _extensionModule$app !== void 0 ? _extensionModule$app : manifest.app) !== null && _ref !== void 0 ? _ref : {
23
+ key: manifest.key
24
+ }
25
+ } : {}), {}, {
20
26
  key: key,
21
27
  title: title,
22
28
  extensionType: manifest.type,
@@ -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 = "118.11.0";
31
+ var packageVersion = "118.12.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 = "118.11.0";
27
+ var packageVersion = "118.12.0";
28
28
  var halfFocusRing = 1;
29
29
  var dropOffset = '0, 8';
30
30
  var fadeIn = (0, _react2.keyframes)({
@@ -1,5 +1,7 @@
1
+ import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
1
2
  import { buildAction } from './manifest-helpers';
2
3
  export function buildMenuItem(manifest, extensionModule) {
4
+ var _ref, _extensionModule$app;
3
5
  const title = extensionModule.title || manifest.title;
4
6
  const key = `${manifest.key}:${extensionModule.key}`;
5
7
  const node = buildAction(extensionModule.action, manifest);
@@ -7,6 +9,11 @@ export function buildMenuItem(manifest, extensionModule) {
7
9
  throw new Error(`Couldn't find any action for ${title} (${key})`);
8
10
  }
9
11
  return {
12
+ ...(isExperimentEnabled('platform_editor_slash_app_category_analytics') ? {
13
+ app: (_ref = (_extensionModule$app = extensionModule.app) !== null && _extensionModule$app !== void 0 ? _extensionModule$app : manifest.app) !== null && _ref !== void 0 ? _ref : {
14
+ key: manifest.key
15
+ }
16
+ } : {}),
10
17
  key,
11
18
  title,
12
19
  extensionType: manifest.type,
@@ -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 = "118.11.0";
17
+ const packageVersion = "118.12.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 = "118.11.0";
17
+ const packageVersion = "118.12.0";
18
18
  const halfFocusRing = 1;
19
19
  const dropOffset = '0, 8';
20
20
  const fadeIn = keyframes({
@@ -1,15 +1,21 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
2
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
3
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
+ import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
4
5
  import { buildAction } from './manifest-helpers';
5
6
  export function buildMenuItem(manifest, extensionModule) {
7
+ var _ref, _extensionModule$app;
6
8
  var title = extensionModule.title || manifest.title;
7
9
  var key = "".concat(manifest.key, ":").concat(extensionModule.key);
8
10
  var node = buildAction(extensionModule.action, manifest);
9
11
  if (!node) {
10
12
  throw new Error("Couldn't find any action for ".concat(title, " (").concat(key, ")"));
11
13
  }
12
- return _objectSpread(_objectSpread({
14
+ return _objectSpread(_objectSpread(_objectSpread({}, isExperimentEnabled('platform_editor_slash_app_category_analytics') ? {
15
+ app: (_ref = (_extensionModule$app = extensionModule.app) !== null && _extensionModule$app !== void 0 ? _extensionModule$app : manifest.app) !== null && _ref !== void 0 ? _ref : {
16
+ key: manifest.key
17
+ }
18
+ } : {}), {}, {
13
19
  key: key,
14
20
  title: title,
15
21
  extensionType: manifest.type,
@@ -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 = "118.11.0";
23
+ var packageVersion = "118.12.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 = "118.11.0";
24
+ var packageVersion = "118.12.0";
25
25
  var halfFocusRing = 1;
26
26
  var dropOffset = '0, 8';
27
27
  var fadeIn = keyframes({
@@ -1,41 +1,22 @@
1
1
  import type { ACTION, ACTION_SUBJECT } from './enums';
2
2
  import type { OperationalAEP } from './utils';
3
- type CategoryInformation = {
4
- appCount: number;
3
+ export type CategoryInformation = {
4
+ internalMacroCount: number;
5
+ internalAppCount: number;
6
+ internalAppMacroMax: number;
7
+ ecosystemMacroCount: number;
8
+ ecosystemAppCount: number;
9
+ ecosystemAppMacroMax: number;
10
+ allMacroCount: number;
11
+ allAppCount: number;
12
+ allAppMacroMax: number;
5
13
  };
14
+ export type CategoryKey = 'blockTemplates' | 'dataAndCharts' | 'embed' | 'media' | 'other' | 'rovo' | 'structure' | 'textFormatting';
15
+ export type LegacyCategoryKey = 'admin' | 'ai' | 'block-templates' | 'communication' | 'confluence-content' | 'data-and-charts' | 'development' | 'embed' | 'external-content' | 'formatting' | 'media' | 'navigation' | 'other' | 'reporting' | 'skills' | 'structure' | 'text-formatting' | 'uncategorized' | 'visuals';
6
16
  export type QuickInsertInformationAttributes = {
7
- category: {
8
- blockTemplates: CategoryInformation;
9
- dataAndCharts: CategoryInformation;
10
- embed: CategoryInformation;
11
- media: CategoryInformation;
12
- other: CategoryInformation;
13
- rovo: CategoryInformation;
14
- structure: CategoryInformation;
15
- textFormatting: CategoryInformation;
16
- };
17
- legacyCategory: {
18
- admin: CategoryInformation;
19
- ai: CategoryInformation;
20
- 'block-templates': CategoryInformation;
21
- communication: CategoryInformation;
22
- 'confluence-content': CategoryInformation;
23
- 'data-and-charts': CategoryInformation;
24
- development: CategoryInformation;
25
- embed: CategoryInformation;
26
- 'external-content': CategoryInformation;
27
- formatting: CategoryInformation;
28
- media: CategoryInformation;
29
- navigation: CategoryInformation;
30
- other: CategoryInformation;
31
- reporting: CategoryInformation;
32
- skills: CategoryInformation;
33
- structure: CategoryInformation;
34
- 'text-formatting': CategoryInformation;
35
- uncategorized: CategoryInformation;
36
- visuals: CategoryInformation;
37
- };
17
+ category: Record<CategoryKey, CategoryInformation>;
18
+ legacyCategory: Record<LegacyCategoryKey, CategoryInformation>;
19
+ allCategories: CategoryInformation;
38
20
  };
39
21
  export type QuickInsertInformationAEP = OperationalAEP<ACTION.QUICK_INSERT_INFORMATION, ACTION_SUBJECT.QUICK_INSERT, undefined, QuickInsertInformationAttributes>;
40
22
  export type QuickInsertInformationEventPayload = QuickInsertInformationAEP;
41
- export {};
@@ -67,6 +67,20 @@ export interface AgentRemoteEditReviewData {
67
67
  * waiting for the idle debounce. `false`/absent ⇒ rely on the debounce.
68
68
  */
69
69
  complete?: boolean;
70
+ /**
71
+ * Whether the local client is the one that requested this agent edit, resolved by
72
+ * matching `actorUserId` against the local collab participant's AAID.
73
+ *
74
+ * Agent steps are broadcast to every collaborator, so anything that must happen
75
+ * exactly once per edit (notably acceptance-rate analytics) has to run on a single
76
+ * client. `false` when the local user is not the requester, and also when either AAID
77
+ * is unavailable: an unattributable batch would otherwise emit one event per connected
78
+ * client, and silently inflating a metric is worse than a known gap.
79
+ *
80
+ * Optional so producers predating this field stay valid; `undefined` is treated as
81
+ * "not the requester", keeping the fail-closed behaviour.
82
+ */
83
+ isLocalUserRequester?: boolean;
70
84
  /**
71
85
  * The coarse reviewable segments derived from the batch — one per edited
72
86
  * top-level region, with closed whole-node slices. Appended verbatim to
@@ -26,8 +26,16 @@ export type ExtensionModuleActionObject<T extends Parameters = Parameters> = {
26
26
  export type MaybeADFEntity = MaybeESModule<ADFEntity | Array<ADFEntity> | void>;
27
27
  export type ExtensionModuleActionHandler = (extensionAPI: ExtensionAPI) => Promise<MaybeADFEntity>;
28
28
  export type ExtensionModuleAction<T extends Parameters = Parameters> = ExtensionModuleActionObject<T> | ExtensionModuleActionHandler;
29
+ /** Identifies the app contributing an extension manifest or module. */
30
+ export type ExtensionApp = {
31
+ /** Stable, non-localized key shared by every extension contributed by the app. */
32
+ key: string;
33
+ /** Provenance of the extension contribution. Omit when provenance cannot be determined. */
34
+ source?: 'internal' | 'ecosystem';
35
+ };
29
36
  export type ExtensionModule<T extends Parameters = Parameters> = {
30
37
  action: ExtensionModuleAction<T>;
38
+ app?: ExtensionApp;
31
39
  categories?: string[];
32
40
  description?: string;
33
41
  featured?: boolean;
@@ -103,6 +111,7 @@ export type ExtensionDeprecationStatus = {
103
111
  message?: string | React.ReactNode;
104
112
  };
105
113
  export type ExtensionManifest<T extends Parameters = Parameters> = {
114
+ app?: ExtensionApp;
106
115
  autoConvert?: {
107
116
  matchers: Array<AutoConvertMatches>;
108
117
  };
@@ -1,7 +1,8 @@
1
1
  import type { ReactNode } from 'react';
2
2
  import type { ADFEntity } from '@atlaskit/adf-utils/types';
3
- import type { ExtensionKey, ExtensionModuleActionHandler, ExtensionType, Icon } from './extension-manifest';
3
+ import type { ExtensionApp, ExtensionKey, ExtensionModuleActionHandler, ExtensionType, Icon } from './extension-manifest';
4
4
  export type MenuItem = {
5
+ app?: ExtensionApp;
5
6
  categories: string[];
6
7
  description?: string;
7
8
  documentationUrl?: string;
@@ -2,6 +2,7 @@ import type { Node } from '@atlaskit/editor-prosemirror/model';
2
2
  import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
3
3
  import type { RegisterMenuItem } from '@atlaskit/editor-ui-control-model/types';
4
4
  import type { INPUT_METHOD } from '../analytics/types/enums';
5
+ import type { ExtensionApp } from '../extensions/types/extension-manifest';
5
6
  import type { TypeAheadItem } from '../types/type-ahead';
6
7
  export type QuickInsertActionInsert = (node?: Node | Record<string, any> | string, opts?: {
7
8
  selectInlineNode?: boolean;
@@ -16,6 +17,8 @@ export type QuickInsertItem = TypeAheadItem & {
16
17
  * @see packages/editor/editor-core/src/plugins/insert-block/ui/ToolbarInsertBlock/index.tsx for details
17
18
  */
18
19
  action: (insert: QuickInsertActionInsert, state: EditorState, source?: INPUT_METHOD.TOOLBAR | INPUT_METHOD.QUICK_INSERT | INPUT_METHOD.ELEMENT_BROWSER) => Transaction | false;
20
+ /** App contributing this item. */
21
+ app?: ExtensionApp;
19
22
  /** categories where to find the item */
20
23
  categories?: Array<string>;
21
24
  /** indicates if the item will be highlighted where appropriate (plus menu for now) */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "118.12.0",
3
+ "version": "119.0.0",
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/"