@atlaskit/editor-common 134.4.3 → 134.5.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,32 @@
1
1
  # @atlaskit/editor-common
2
2
 
3
+ ## 134.5.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`16f6c4b93584b`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/16f6c4b93584b) -
8
+ Preserve agent identity through Create with Rovo streaming and final replacement so generated
9
+ steps carry agentId. Add an optional agentIdentityAccountId to create commands and an optional
10
+ agentAttribution option to core.actions.replaceDocument. Enable Create with Rovo attribution
11
+ through the platform_editor_cwr_agent_attribution SPRT experiment.
12
+
13
+ Resolve missing agent identity alongside the chat request to avoid a sequential network wait.
14
+
15
+ ### Patch Changes
16
+
17
+ - [`f788907701e5b`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/f788907701e5b) -
18
+ Clean up experiment `platform_editor_ssr_reuse_requires_content`
19
+ - Updated dependencies
20
+
21
+ ## 134.4.4
22
+
23
+ ### Patch Changes
24
+
25
+ - [`b6b4846208707`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/b6b4846208707) -
26
+ Update Quick Insert recommendations for the Recommended V2 Hello proposal behind
27
+ `platform_editor_slash_command`, including product-specific Rovo Chat and inline Ask Rovo lists
28
+ and an Ask Rovo-only platform fallback.
29
+
3
30
  ## 134.4.3
4
31
 
5
32
  ### Patch Changes
@@ -197,7 +197,7 @@ var ExtensionNode = exports.ExtensionNode = /*#__PURE__*/function (_ReactNodeVie
197
197
  // invisible until the next `update()`, which for an untouched node only happens on user
198
198
  // interaction (HOT-306707). Treat an empty element as "no SSR DOM" so the node view takes
199
199
  // the normal React render path instead.
200
- if ((0, _fg.fg)('platform_editor_ssr_reuse_requires_content') && !element.querySelector('[data-testid="extension-node-wrapper"]')) {
200
+ if (!element.querySelector('[data-testid="extension-node-wrapper"]')) {
201
201
  this.cachedSsrElement = null;
202
202
  return null;
203
203
  }
@@ -27,7 +27,7 @@ var NETWORK_FAILURE_REGEX = /^network failure/i;
27
27
  var RESIZE_OBSERVER_LOOP_REGEX = /ResizeObserver loop completed with undelivered notifications/;
28
28
  var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
29
29
  var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
30
- var packageVersion = "134.4.2";
30
+ var packageVersion = "134.4.4";
31
31
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
32
32
  // Remove URL as it has UGC
33
33
  // Ignored via go/ees007
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.corePlugin = void 0;
7
7
  var _model = require("@atlaskit/editor-prosemirror/model");
8
8
  var _nodeAnchorProvider = require("../../node-anchor/node-anchor-provider");
9
+ var _transactionAgentAttribution = require("../../transaction-agent-attribution");
9
10
  var _processRawFragmentValue = require("../../utils/processRawFragmentValue");
10
11
  var _processRawValue = require("../../utils/processRawValue");
11
12
  var _editorCommands = require("../editor-commands");
@@ -130,6 +131,9 @@ var corePlugin = exports.corePlugin = function corePlugin(_ref) {
130
131
  var _options$scrollIntoVi2;
131
132
  var tr = state.tr.replaceWith(0, state.doc.nodeSize - 2, content);
132
133
  tr.setMeta('replaceDocument', true);
134
+ if (options !== null && options !== void 0 && options.agentAttribution) {
135
+ tr.setMeta(_transactionAgentAttribution.AGENT_ATTRIBUTION_META, options.agentAttribution);
136
+ }
133
137
  if ((options === null || options === void 0 ? void 0 : options.addToHistory) === false) {
134
138
  tr.setMeta('addToHistory', false);
135
139
  }
@@ -22,4 +22,4 @@ var createIsRecommendedItem = exports.createIsRecommendedItem = function createI
22
22
  };
23
23
 
24
24
  /** Default Quick Insert recommendations in their intended display order. */
25
- var defaultIsRecommendedItem = exports.defaultIsRecommendedItem = createIsRecommendedItem([_keys.ASK_ROVO_MENU_ITEM.key, _keys.HYPERLINK_MENU_ITEM.key, _keys.MEDIA_INSERT_MENU_ITEM.key, _keys.EMOJI_MENU_ITEM.key, _keys.MENTION_MENU_ITEM.key]);
25
+ var defaultIsRecommendedItem = exports.defaultIsRecommendedItem = createIsRecommendedItem([_keys.ASK_ROVO_MENU_ITEM.key]);
@@ -23,7 +23,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
23
23
  * @jsx jsx
24
24
  */ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
25
25
  var packageName = "@atlaskit/editor-common";
26
- var packageVersion = "134.4.2";
26
+ var packageVersion = "134.4.4";
27
27
  var halfFocusRing = 1;
28
28
  var dropOffset = '0, 8';
29
29
  // Ignored via go/ees005
@@ -161,7 +161,7 @@ export class ExtensionNode extends ReactNodeView {
161
161
  // invisible until the next `update()`, which for an untouched node only happens on user
162
162
  // interaction (HOT-306707). Treat an empty element as "no SSR DOM" so the node view takes
163
163
  // the normal React render path instead.
164
- if (fg('platform_editor_ssr_reuse_requires_content') && !element.querySelector('[data-testid="extension-node-wrapper"]')) {
164
+ if (!element.querySelector('[data-testid="extension-node-wrapper"]')) {
165
165
  this.cachedSsrElement = null;
166
166
  return null;
167
167
  }
@@ -13,7 +13,7 @@ const NETWORK_FAILURE_REGEX = /^network failure/i;
13
13
  const RESIZE_OBSERVER_LOOP_REGEX = /ResizeObserver loop completed with undelivered notifications/;
14
14
  const SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
15
15
  const packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
16
- const packageVersion = "134.4.2";
16
+ const packageVersion = "134.4.4";
17
17
  const sanitiseSentryEvents = (data, _hint) => {
18
18
  // Remove URL as it has UGC
19
19
  // Ignored via go/ees007
@@ -1,5 +1,6 @@
1
1
  import { Node } from '@atlaskit/editor-prosemirror/model';
2
2
  import { getNodeIdProvider } from '../../node-anchor/node-anchor-provider';
3
+ import { AGENT_ATTRIBUTION_META } from '../../transaction-agent-attribution';
3
4
  import { processRawFragmentValue } from '../../utils/processRawFragmentValue';
4
5
  import { processRawValue, processRawValueWithoutValidation } from '../../utils/processRawValue';
5
6
  import { editorCommandToPMCommand } from '../editor-commands';
@@ -130,6 +131,9 @@ export const corePlugin = ({
130
131
  var _options$scrollIntoVi2;
131
132
  const tr = state.tr.replaceWith(0, state.doc.nodeSize - 2, content);
132
133
  tr.setMeta('replaceDocument', true);
134
+ if (options !== null && options !== void 0 && options.agentAttribution) {
135
+ tr.setMeta(AGENT_ATTRIBUTION_META, options.agentAttribution);
136
+ }
133
137
  if ((options === null || options === void 0 ? void 0 : options.addToHistory) === false) {
134
138
  tr.setMeta('addToHistory', false);
135
139
  }
@@ -1,4 +1,4 @@
1
- import { ASK_ROVO_MENU_ITEM, EMOJI_MENU_ITEM, HYPERLINK_MENU_ITEM, MEDIA_INSERT_MENU_ITEM, MENTION_MENU_ITEM } from './keys';
1
+ import { ASK_ROVO_MENU_ITEM } from './keys';
2
2
 
3
3
  /** Resolves an item's recommendation, or excludes it with `null`. Lower ranks are shown first. */
4
4
 
@@ -16,4 +16,4 @@ export const createIsRecommendedItem = orderedKeys => {
16
16
  };
17
17
 
18
18
  /** Default Quick Insert recommendations in their intended display order. */
19
- export const defaultIsRecommendedItem = createIsRecommendedItem([ASK_ROVO_MENU_ITEM.key, HYPERLINK_MENU_ITEM.key, MEDIA_INSERT_MENU_ITEM.key, EMOJI_MENU_ITEM.key, MENTION_MENU_ITEM.key]);
19
+ export const defaultIsRecommendedItem = createIsRecommendedItem([ASK_ROVO_MENU_ITEM.key]);
@@ -13,7 +13,7 @@ import withAnalyticsContext from '@atlaskit/analytics-next/withAnalyticsContext'
13
13
  import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
14
14
  import Layer from '../Layer';
15
15
  const packageName = "@atlaskit/editor-common";
16
- const packageVersion = "134.4.2";
16
+ const packageVersion = "134.4.4";
17
17
  const halfFocusRing = 1;
18
18
  const dropOffset = '0, 8';
19
19
  // Ignored via go/ees005
@@ -187,7 +187,7 @@ export var ExtensionNode = /*#__PURE__*/function (_ReactNodeView) {
187
187
  // invisible until the next `update()`, which for an untouched node only happens on user
188
188
  // interaction (HOT-306707). Treat an empty element as "no SSR DOM" so the node view takes
189
189
  // the normal React render path instead.
190
- if (fg('platform_editor_ssr_reuse_requires_content') && !element.querySelector('[data-testid="extension-node-wrapper"]')) {
190
+ if (!element.querySelector('[data-testid="extension-node-wrapper"]')) {
191
191
  this.cachedSsrElement = null;
192
192
  return null;
193
193
  }
@@ -19,7 +19,7 @@ var NETWORK_FAILURE_REGEX = /^network failure/i;
19
19
  var RESIZE_OBSERVER_LOOP_REGEX = /ResizeObserver loop completed with undelivered notifications/;
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 = "134.4.2";
22
+ var packageVersion = "134.4.4";
23
23
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
24
24
  // Remove URL as it has UGC
25
25
  // Ignored via go/ees007
@@ -1,5 +1,6 @@
1
1
  import { Node } from '@atlaskit/editor-prosemirror/model';
2
2
  import { getNodeIdProvider } from '../../node-anchor/node-anchor-provider';
3
+ import { AGENT_ATTRIBUTION_META } from '../../transaction-agent-attribution';
3
4
  import { processRawFragmentValue } from '../../utils/processRawFragmentValue';
4
5
  import { processRawValue, processRawValueWithoutValidation } from '../../utils/processRawValue';
5
6
  import { editorCommandToPMCommand } from '../editor-commands';
@@ -125,6 +126,9 @@ export var corePlugin = function corePlugin(_ref) {
125
126
  var _options$scrollIntoVi2;
126
127
  var tr = state.tr.replaceWith(0, state.doc.nodeSize - 2, content);
127
128
  tr.setMeta('replaceDocument', true);
129
+ if (options !== null && options !== void 0 && options.agentAttribution) {
130
+ tr.setMeta(AGENT_ATTRIBUTION_META, options.agentAttribution);
131
+ }
128
132
  if ((options === null || options === void 0 ? void 0 : options.addToHistory) === false) {
129
133
  tr.setMeta('addToHistory', false);
130
134
  }
@@ -1,4 +1,4 @@
1
- import { ASK_ROVO_MENU_ITEM, EMOJI_MENU_ITEM, HYPERLINK_MENU_ITEM, MEDIA_INSERT_MENU_ITEM, MENTION_MENU_ITEM } from './keys';
1
+ import { ASK_ROVO_MENU_ITEM } from './keys';
2
2
 
3
3
  /** Resolves an item's recommendation, or excludes it with `null`. Lower ranks are shown first. */
4
4
 
@@ -17,4 +17,4 @@ export var createIsRecommendedItem = function createIsRecommendedItem(orderedKey
17
17
  };
18
18
 
19
19
  /** Default Quick Insert recommendations in their intended display order. */
20
- export var defaultIsRecommendedItem = createIsRecommendedItem([ASK_ROVO_MENU_ITEM.key, HYPERLINK_MENU_ITEM.key, MEDIA_INSERT_MENU_ITEM.key, EMOJI_MENU_ITEM.key, MENTION_MENU_ITEM.key]);
20
+ export var defaultIsRecommendedItem = createIsRecommendedItem([ASK_ROVO_MENU_ITEM.key]);
@@ -20,7 +20,7 @@ import withAnalyticsContext from '@atlaskit/analytics-next/withAnalyticsContext'
20
20
  import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
21
21
  import Layer from '../Layer';
22
22
  var packageName = "@atlaskit/editor-common";
23
- var packageVersion = "134.4.2";
23
+ var packageVersion = "134.4.4";
24
24
  var halfFocusRing = 1;
25
25
  var dropOffset = '0, 8';
26
26
  // Ignored via go/ees005
@@ -9,6 +9,7 @@ import type { Fragment, Node, Schema, Node as PMNode } from '@atlaskit/editor-pr
9
9
  import type { EditorState } from '@atlaskit/editor-prosemirror/state';
10
10
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
11
11
  import type { FireAnalyticsCallback } from '../analytics';
12
+ import type { AgentAttributionTransactionMeta } from '../transaction-agent-attribution';
12
13
  import type { EditorAppearance } from './editor-appearance';
13
14
  import type { EditorCommand, EditorCommandWithMetadata } from './editor-command';
14
15
  import type { EditorPlugin } from './editor-plugin';
@@ -68,13 +69,15 @@ export type CorePlugin = NextEditorPlugin<'core', {
68
69
  * @param replaceValue - The new content to replace the current content. It can be of any type.
69
70
  * @param options - Options
70
71
  * @param options.addToHistory (boolean) if the replacement should be added to history. True by default
72
+ * @param options.agentAttribution - Optional agent attribution for this replacement transaction.
71
73
  * @param options.scrollIntoView (boolean) if the view should also scroll on replace. True by default
72
74
  * @param options.skipValidation (boolean) if the validation should be skipped. False by default
73
75
  * @param options.transformer (Transformer<string>) transformer to convert the replaceValue into (example is from markdown)
74
76
  * @returns A boolean indicating whether the replacement was successful.
75
77
  */
76
- replaceDocument: (replaceValue: Node | Fragment | Array<Node> | Object | string, options?: {
78
+ replaceDocument: (replaceValue: Node | Fragment | Array<Node> | object | string, options?: {
77
79
  addToHistory?: boolean;
80
+ agentAttribution?: Partial<AgentAttributionTransactionMeta>;
78
81
  scrollIntoView?: boolean;
79
82
  skipValidation?: boolean;
80
83
  transformer?: Transformer<string>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "134.4.3",
3
+ "version": "134.5.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/"
@@ -54,8 +54,8 @@
54
54
  "@atlaskit/feature-gate-js-client": "^8.0.0",
55
55
  "@atlaskit/icon": "^38.0.0",
56
56
  "@atlaskit/link": "^5.1.0",
57
- "@atlaskit/link-datasource": "^7.11.0",
58
- "@atlaskit/link-picker": "^6.19.0",
57
+ "@atlaskit/link-datasource": "^7.12.0",
58
+ "@atlaskit/link-picker": "^6.20.0",
59
59
  "@atlaskit/logo": "^23.3.0",
60
60
  "@atlaskit/media-card": "^82.2.0",
61
61
  "@atlaskit/media-client": "^39.3.0",
@@ -79,13 +79,13 @@
79
79
  "@atlaskit/react-compiler-gating": "^0.2.0",
80
80
  "@atlaskit/react-ufo": "^8.3.0",
81
81
  "@atlaskit/section-message": "^10.2.0",
82
- "@atlaskit/smart-card": "^46.12.0",
83
- "@atlaskit/smart-user-picker": "^12.10.0",
82
+ "@atlaskit/smart-card": "^46.13.0",
83
+ "@atlaskit/smart-user-picker": "^12.11.0",
84
84
  "@atlaskit/spinner": "^20.4.0",
85
85
  "@atlaskit/task-decision": "^21.14.0",
86
86
  "@atlaskit/teams-app-config": "^3.1.0",
87
87
  "@atlaskit/textfield": "^10.3.0",
88
- "@atlaskit/tmp-editor-statsig": "^251.0.0",
88
+ "@atlaskit/tmp-editor-statsig": "^252.0.0",
89
89
  "@atlaskit/tokens": "^20.9.0",
90
90
  "@atlaskit/tooltip": "^24.4.0",
91
91
  "@atlaskit/width-detector": "^7.2.0",
@@ -131,6 +131,7 @@
131
131
  "@atlassian/experiment-test-utils": "^0.2.0",
132
132
  "@atlassian/feature-flags-test-utils": "^1.3.0",
133
133
  "@atlassian/testing-library": "^0.12.0",
134
+ "@react-loosely-lazy/manifest": "^1.0.0",
134
135
  "@testing-library/dom": "^10.1.0",
135
136
  "@testing-library/jest-dom": "^6.4.5",
136
137
  "@testing-library/react": "^16.3.0",
@@ -209,9 +210,6 @@
209
210
  "confluence_connect_macro_preset_height": {
210
211
  "type": "boolean"
211
212
  },
212
- "platform_editor_ssr_reuse_requires_content": {
213
- "type": "boolean"
214
- },
215
213
  "jfp_a11y_fix_create_issue_no_results_link_focus": {
216
214
  "type": "boolean"
217
215
  },