@atlaskit/rovo-triggers 10.38.0 → 11.1.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,51 @@
1
1
  # @atlaskit/rovo-triggers
2
2
 
3
+ ## 11.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`c575d86f82b4a`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/c575d86f82b4a) -
8
+ Add an opt-in deferred seeded-chat opening lifecycle gated by
9
+ `jira_rovo_defer_view_chat_open_until_seeded`.
10
+ - [`ee866df2b4a26`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/ee866df2b4a26) -
11
+ Add optional `statusScope` and `isNewStatus` to the Jira workflow wizard ADD_STATUS payload.
12
+
13
+ ### Patch Changes
14
+
15
+ - Updated dependencies
16
+
17
+ ## 11.0.0
18
+
19
+ ### Major Changes
20
+
21
+ - [`de8897276a43e`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/de8897276a43e) -
22
+ Replace the `rovo-ext_context_bridge` feature gate with the `rovo-ext_context_bridge_exp`
23
+ experiment, read through its boolean `isEnabled` parameter.
24
+
25
+ **Breaking:** `@atlaskit/rovo-triggers/extension-context-bridge/constants` no longer exports
26
+ `BRIDGE_FEATURE_GATE`. Use `EXT_CONTEXT_BRIDGE_EXPERIMENT` instead, which holds the experiment key
27
+ rather than the gate key:
28
+
29
+ ```diff
30
+ - import { BRIDGE_FEATURE_GATE } from '@atlaskit/rovo-triggers/extension-context-bridge/constants';
31
+ + import { EXT_CONTEXT_BRIDGE_EXPERIMENT } from '@atlaskit/rovo-triggers/extension-context-bridge/constants';
32
+ ```
33
+
34
+ `ExtensionContextBridgeHost`, `ExtensionContextBridgeClient` and `ChatOpenerSubscriber` read the
35
+ experiment through `UNSAFE_expValNoExposure`, so none of them log exposure: the Host mounts at the
36
+ root of every page of an opted-in product, and exposure there would count product page loads
37
+ rather than extension users. The Rovo browser extension owns the single exposure call.
38
+
39
+ No behaviour change for consumers beyond the assignment source. The
40
+ `extensionContextBridgeEnabled` prop on `ChatOpenerSubscriber` is unchanged and still required to
41
+ opt in.
42
+
43
+ ### Minor Changes
44
+
45
+ - [`487372cfb38b7`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/487372cfb38b7) -
46
+ Send the `remix_custom_edit` experience, source page ID, and required editor context for editor
47
+ Custom Remix requests behind the `aifc_remix_custom_page_edit` gate.
48
+
3
49
  ## 10.38.0
4
50
 
5
51
  ### Minor Changes
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.ExtensionContextBridgeClient = void 0;
8
8
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
9
  var _react = require("react");
10
- var _fg = require("@atlaskit/platform-feature-flags/fg");
10
+ var _unsafeExpValNoExposure = require("@atlaskit/platform-feature-experiments/unsafe-exp-val-no-exposure");
11
11
  var _main = require("../../../main");
12
12
  var _constants = require("./constants");
13
13
  var _policy = require("./policy");
@@ -60,8 +60,9 @@ var isChatFocused = function isChatFocused() {
60
60
  var ExtensionContextBridgeClient = exports.ExtensionContextBridgeClient = function ExtensionContextBridgeClient(_ref) {
61
61
  var transport = _ref.transport,
62
62
  allowedOrigins = _ref.allowedOrigins;
63
- // Self-gated. Matches `BRIDGE_FEATURE_GATE` in `./constants`.
64
- var active = (0, _fg.fg)('rovo-ext_context_bridge');
63
+ // Self-gated. Matches `EXT_CONTEXT_BRIDGE_EXPERIMENT` in `./constants`. No-exposure read: the
64
+ // extension decides whether to mount this and owns the exposure call.
65
+ var active = (0, _unsafeExpValNoExposure.UNSAFE_expValNoExposure)('rovo-ext_context_bridge_exp', 'isEnabled', false) === true;
65
66
  var publish = (0, _main.usePublish)('ai-mate');
66
67
  var lastKnownSelectionRef = (0, _react.useRef)(null);
67
68
  var activeTransport = (0, _react.useMemo)(function () {
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.ExtensionContextBridgeHost = void 0;
8
8
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
9
  var _react = require("react");
10
- var _fg = require("@atlaskit/platform-feature-flags/fg");
10
+ var _unsafeExpValNoExposure = require("@atlaskit/platform-feature-experiments/unsafe-exp-val-no-exposure");
11
11
  var _main = require("../../../main");
12
12
  var _analytics = require("./analytics");
13
13
  var _constants = require("./constants");
@@ -56,8 +56,12 @@ var ExtensionContextBridgeHost = exports.ExtensionContextBridgeHost = function E
56
56
  isAiEnabled = _ref.isAiEnabled,
57
57
  onRelayDecision = _ref.onRelayDecision;
58
58
  // Self-gated (not taken from the consumer) so this cannot mount by mistake wherever
59
- // `ChatOpenerSubscriber` renders. Matches `BRIDGE_FEATURE_GATE` in `./constants`.
60
- var active = (0, _fg.fg)('rovo-ext_context_bridge');
59
+ // `ChatOpenerSubscriber` renders. Matches `EXT_CONTEXT_BRIDGE_EXPERIMENT` in `./constants`.
60
+ //
61
+ // No-exposure read on purpose: this component mounts on every page of an opted-in product, so
62
+ // firing exposure here would measure product page loads instead of extension users. The
63
+ // extension logs the one exposure. See `./constants`.
64
+ var active = (0, _unsafeExpValNoExposure.UNSAFE_expValNoExposure)('rovo-ext_context_bridge_exp', 'isEnabled', false) === true;
61
65
  var activeTransport = (0, _react.useMemo)(function () {
62
66
  if (!active) {
63
67
  return undefined;
@@ -3,13 +3,19 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.BRIDGE_TO_PRODUCT = exports.BRIDGE_TO_EXTENSION = exports.BRIDGE_SOURCE = exports.BRIDGE_MESSAGE_MARKER = exports.BRIDGE_FEATURE_GATE = exports.BRIDGE_CONTROL_REQUEST_CONTEXT = void 0;
6
+ exports.EXT_CONTEXT_BRIDGE_EXPERIMENT = exports.BRIDGE_TO_PRODUCT = exports.BRIDGE_TO_EXTENSION = exports.BRIDGE_SOURCE = exports.BRIDGE_MESSAGE_MARKER = exports.BRIDGE_CONTROL_REQUEST_CONTEXT = void 0;
7
7
  /**
8
- * Feature gate for the extension context bridge; both Host and Client self-gate on it.
9
- * `fg()` requires a static literal, so call sites inline this value rather than importing it;
10
- * tests resolve the gate through this constant so the two cannot drift apart.
8
+ * Statsig experiment for the extension context bridge; both Host and Client self-gate on its
9
+ * boolean `isEnabled` parameter. Call sites inline this value rather than importing it, since the
10
+ * experiment runtime takes a static literal; tests resolve the experiment through this constant so
11
+ * the two cannot drift apart.
12
+ *
13
+ * Read here **without** logging exposure. Host mounts at the root of every page of an opted-in
14
+ * product, so an exposure-firing read would count product page loads rather than extension users.
15
+ * The extension owns the single exposure call, at the point the user is on a page the bridge can
16
+ * act on.
11
17
  */
12
- var BRIDGE_FEATURE_GATE = exports.BRIDGE_FEATURE_GATE = 'rovo-ext_context_bridge';
18
+ var EXT_CONTEXT_BRIDGE_EXPERIMENT = exports.EXT_CONTEXT_BRIDGE_EXPERIMENT = 'rovo-ext_context_bridge_exp';
13
19
 
14
20
  /** Marker on every bridge `postMessage`, so listeners can ignore unrelated messages. */
15
21
  var BRIDGE_MESSAGE_MARKER = exports.BRIDGE_MESSAGE_MARKER = '__rovoExtContextBridge';
@@ -1,5 +1,5 @@
1
1
  import { useEffect, useMemo, useRef } from 'react';
2
- import { fg } from '@atlaskit/platform-feature-flags/fg';
2
+ import { UNSAFE_expValNoExposure } from '@atlaskit/platform-feature-experiments/unsafe-exp-val-no-exposure';
3
3
  import { usePublish, useSubscribeAll } from '../../../main';
4
4
  import { BRIDGE_CONTROL_REQUEST_CONTEXT, BRIDGE_MESSAGE_MARKER, BRIDGE_SOURCE, BRIDGE_TO_EXTENSION, BRIDGE_TO_PRODUCT } from './constants';
5
5
  import { shouldRelayToProduct } from './policy';
@@ -52,8 +52,9 @@ export const ExtensionContextBridgeClient = ({
52
52
  transport,
53
53
  allowedOrigins
54
54
  }) => {
55
- // Self-gated. Matches `BRIDGE_FEATURE_GATE` in `./constants`.
56
- const active = fg('rovo-ext_context_bridge');
55
+ // Self-gated. Matches `EXT_CONTEXT_BRIDGE_EXPERIMENT` in `./constants`. No-exposure read: the
56
+ // extension decides whether to mount this and owns the exposure call.
57
+ const active = UNSAFE_expValNoExposure('rovo-ext_context_bridge_exp', 'isEnabled', false) === true;
57
58
  const publish = usePublish('ai-mate');
58
59
  const lastKnownSelectionRef = useRef(null);
59
60
  const activeTransport = useMemo(() => {
@@ -1,5 +1,5 @@
1
1
  import { useEffect, useMemo, useRef } from 'react';
2
- import { fg } from '@atlaskit/platform-feature-flags/fg';
2
+ import { UNSAFE_expValNoExposure } from '@atlaskit/platform-feature-experiments/unsafe-exp-val-no-exposure';
3
3
  import { useSubscribeAll } from '../../../main';
4
4
  import { getContextKey, reportRelayDecision } from './analytics';
5
5
  import { BRIDGE_CONTROL_REQUEST_CONTEXT, BRIDGE_MESSAGE_MARKER, BRIDGE_SOURCE, BRIDGE_TO_EXTENSION, BRIDGE_TO_PRODUCT } from './constants';
@@ -49,8 +49,12 @@ export const ExtensionContextBridgeHost = ({
49
49
  onRelayDecision
50
50
  }) => {
51
51
  // Self-gated (not taken from the consumer) so this cannot mount by mistake wherever
52
- // `ChatOpenerSubscriber` renders. Matches `BRIDGE_FEATURE_GATE` in `./constants`.
53
- const active = fg('rovo-ext_context_bridge');
52
+ // `ChatOpenerSubscriber` renders. Matches `EXT_CONTEXT_BRIDGE_EXPERIMENT` in `./constants`.
53
+ //
54
+ // No-exposure read on purpose: this component mounts on every page of an opted-in product, so
55
+ // firing exposure here would measure product page loads instead of extension users. The
56
+ // extension logs the one exposure. See `./constants`.
57
+ const active = UNSAFE_expValNoExposure('rovo-ext_context_bridge_exp', 'isEnabled', false) === true;
54
58
  const activeTransport = useMemo(() => {
55
59
  if (!active) {
56
60
  return undefined;
@@ -1,9 +1,15 @@
1
1
  /**
2
- * Feature gate for the extension context bridge; both Host and Client self-gate on it.
3
- * `fg()` requires a static literal, so call sites inline this value rather than importing it;
4
- * tests resolve the gate through this constant so the two cannot drift apart.
2
+ * Statsig experiment for the extension context bridge; both Host and Client self-gate on its
3
+ * boolean `isEnabled` parameter. Call sites inline this value rather than importing it, since the
4
+ * experiment runtime takes a static literal; tests resolve the experiment through this constant so
5
+ * the two cannot drift apart.
6
+ *
7
+ * Read here **without** logging exposure. Host mounts at the root of every page of an opted-in
8
+ * product, so an exposure-firing read would count product page loads rather than extension users.
9
+ * The extension owns the single exposure call, at the point the user is on a page the bridge can
10
+ * act on.
5
11
  */
6
- export const BRIDGE_FEATURE_GATE = 'rovo-ext_context_bridge';
12
+ export const EXT_CONTEXT_BRIDGE_EXPERIMENT = 'rovo-ext_context_bridge_exp';
7
13
 
8
14
  /** Marker on every bridge `postMessage`, so listeners can ignore unrelated messages. */
9
15
  export const BRIDGE_MESSAGE_MARKER = '__rovoExtContextBridge';
@@ -2,7 +2,7 @@ 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
4
  import { useEffect, useMemo, useRef } from 'react';
5
- import { fg } from '@atlaskit/platform-feature-flags/fg';
5
+ import { UNSAFE_expValNoExposure } from '@atlaskit/platform-feature-experiments/unsafe-exp-val-no-exposure';
6
6
  import { usePublish, useSubscribeAll } from '../../../main';
7
7
  import { BRIDGE_CONTROL_REQUEST_CONTEXT, BRIDGE_MESSAGE_MARKER, BRIDGE_SOURCE, BRIDGE_TO_EXTENSION, BRIDGE_TO_PRODUCT } from './constants';
8
8
  import { shouldRelayToProduct } from './policy';
@@ -54,8 +54,9 @@ var isChatFocused = function isChatFocused() {
54
54
  export var ExtensionContextBridgeClient = function ExtensionContextBridgeClient(_ref) {
55
55
  var transport = _ref.transport,
56
56
  allowedOrigins = _ref.allowedOrigins;
57
- // Self-gated. Matches `BRIDGE_FEATURE_GATE` in `./constants`.
58
- var active = fg('rovo-ext_context_bridge');
57
+ // Self-gated. Matches `EXT_CONTEXT_BRIDGE_EXPERIMENT` in `./constants`. No-exposure read: the
58
+ // extension decides whether to mount this and owns the exposure call.
59
+ var active = UNSAFE_expValNoExposure('rovo-ext_context_bridge_exp', 'isEnabled', false) === true;
59
60
  var publish = usePublish('ai-mate');
60
61
  var lastKnownSelectionRef = useRef(null);
61
62
  var activeTransport = useMemo(function () {
@@ -1,6 +1,6 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
2
  import { useEffect, useMemo, useRef } from 'react';
3
- import { fg } from '@atlaskit/platform-feature-flags/fg';
3
+ import { UNSAFE_expValNoExposure } from '@atlaskit/platform-feature-experiments/unsafe-exp-val-no-exposure';
4
4
  import { useSubscribeAll } from '../../../main';
5
5
  import { getContextKey, reportRelayDecision } from './analytics';
6
6
  import { BRIDGE_CONTROL_REQUEST_CONTEXT, BRIDGE_MESSAGE_MARKER, BRIDGE_SOURCE, BRIDGE_TO_EXTENSION, BRIDGE_TO_PRODUCT } from './constants';
@@ -49,8 +49,12 @@ export var ExtensionContextBridgeHost = function ExtensionContextBridgeHost(_ref
49
49
  isAiEnabled = _ref.isAiEnabled,
50
50
  onRelayDecision = _ref.onRelayDecision;
51
51
  // Self-gated (not taken from the consumer) so this cannot mount by mistake wherever
52
- // `ChatOpenerSubscriber` renders. Matches `BRIDGE_FEATURE_GATE` in `./constants`.
53
- var active = fg('rovo-ext_context_bridge');
52
+ // `ChatOpenerSubscriber` renders. Matches `EXT_CONTEXT_BRIDGE_EXPERIMENT` in `./constants`.
53
+ //
54
+ // No-exposure read on purpose: this component mounts on every page of an opted-in product, so
55
+ // firing exposure here would measure product page loads instead of extension users. The
56
+ // extension logs the one exposure. See `./constants`.
57
+ var active = UNSAFE_expValNoExposure('rovo-ext_context_bridge_exp', 'isEnabled', false) === true;
54
58
  var activeTransport = useMemo(function () {
55
59
  if (!active) {
56
60
  return undefined;
@@ -1,9 +1,15 @@
1
1
  /**
2
- * Feature gate for the extension context bridge; both Host and Client self-gate on it.
3
- * `fg()` requires a static literal, so call sites inline this value rather than importing it;
4
- * tests resolve the gate through this constant so the two cannot drift apart.
2
+ * Statsig experiment for the extension context bridge; both Host and Client self-gate on its
3
+ * boolean `isEnabled` parameter. Call sites inline this value rather than importing it, since the
4
+ * experiment runtime takes a static literal; tests resolve the experiment through this constant so
5
+ * the two cannot drift apart.
6
+ *
7
+ * Read here **without** logging exposure. Host mounts at the root of every page of an opted-in
8
+ * product, so an exposure-firing read would count product page loads rather than extension users.
9
+ * The extension owns the single exposure call, at the point the user is on a page the bridge can
10
+ * act on.
5
11
  */
6
- export var BRIDGE_FEATURE_GATE = 'rovo-ext_context_bridge';
12
+ export var EXT_CONTEXT_BRIDGE_EXPERIMENT = 'rovo-ext_context_bridge_exp';
7
13
 
8
14
  /** Marker on every bridge `postMessage`, so listeners can ignore unrelated messages. */
9
15
  export var BRIDGE_MESSAGE_MARKER = '__rovoExtContextBridge';
@@ -1,9 +1,15 @@
1
1
  /**
2
- * Feature gate for the extension context bridge; both Host and Client self-gate on it.
3
- * `fg()` requires a static literal, so call sites inline this value rather than importing it;
4
- * tests resolve the gate through this constant so the two cannot drift apart.
2
+ * Statsig experiment for the extension context bridge; both Host and Client self-gate on its
3
+ * boolean `isEnabled` parameter. Call sites inline this value rather than importing it, since the
4
+ * experiment runtime takes a static literal; tests resolve the experiment through this constant so
5
+ * the two cannot drift apart.
6
+ *
7
+ * Read here **without** logging exposure. Host mounts at the root of every page of an opted-in
8
+ * product, so an exposure-firing read would count product page loads rather than extension users.
9
+ * The extension owns the single exposure call, at the point the user is on a page the bridge can
10
+ * act on.
5
11
  */
6
- export declare const BRIDGE_FEATURE_GATE = "rovo-ext_context_bridge";
12
+ export declare const EXT_CONTEXT_BRIDGE_EXPERIMENT = "rovo-ext_context_bridge_exp";
7
13
  /** Marker on every bridge `postMessage`, so listeners can ignore unrelated messages. */
8
14
  export declare const BRIDGE_MESSAGE_MARKER: '__rovoExtContextBridge';
9
15
  /** Read context flows product -> extension; actions flow extension -> product. */
@@ -100,7 +100,7 @@ export type ChatCreationContextParams = {
100
100
  source?: string;
101
101
  shouldUseExistingContent?: boolean;
102
102
  isViewMode?: boolean;
103
- experience?: 'cwr' | 'cwr_type' | 'cwr_edit' | 'cwr_existing' | 'inline_edit' | 'remix' | 'remix_edit' | 'remix_object' | 'remix_custom' | 'chat_edit' | 'chat_view' | 'keep_existing_page_structure';
103
+ experience?: 'cwr' | 'cwr_type' | 'cwr_edit' | 'cwr_existing' | 'inline_edit' | 'remix' | 'remix_edit' | 'remix_object' | 'remix_custom' | 'remix_custom_edit' | 'chat_edit' | 'chat_view' | 'keep_existing_page_structure';
104
104
  contentTypes?: string[];
105
105
  blocks?: string[];
106
106
  spaceKey?: string;
@@ -137,6 +137,11 @@ export type ChatNewPayload = PayloadCore<'chat-new', {
137
137
  rovoJourneyId?: string;
138
138
  minionAlias?: string;
139
139
  skipCreatingSeededConversation?: boolean;
140
+ /**
141
+ * Opens the Rovo shell with loading while the seeded conversation is created, then selects
142
+ * that conversation once ready. Has no effect when `skipCreatingSeededConversation` is true.
143
+ */
144
+ deferOpenUntilSeeded?: boolean;
140
145
  selectedSpace?: {
141
146
  id: string;
142
147
  name: string;
@@ -487,6 +492,8 @@ export type AddStatusRovoPayload = {
487
492
  statusId: StatusId;
488
493
  statusName: string;
489
494
  statusCategory: StatusCategory;
495
+ statusScope?: 'GLOBAL' | 'PROJECT';
496
+ isNewStatus?: boolean;
490
497
  };
491
498
  export type UpdateStatusRovoPayload = {
492
499
  statusId: StatusId;
package/package.json CHANGED
@@ -1,12 +1,17 @@
1
1
  {
2
2
  "name": "@atlaskit/rovo-triggers",
3
- "version": "10.38.0",
3
+ "version": "11.1.0",
4
4
  "description": "Provides various trigger events to drive Rovo Chat functionality, such as a publish-subscribe and URL parameter hooks",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "publishConfig": {
7
7
  "registry": "https://registry.npmjs.org/"
8
8
  },
9
9
  "atlassian": {
10
+ "website": {
11
+ "tags": [
12
+ "platform-labs"
13
+ ]
14
+ },
10
15
  "react-compiler": {
11
16
  "enabled": true,
12
17
  "gating": {
@@ -28,7 +33,8 @@
28
33
  ],
29
34
  "atlaskit:src": "src/index.ts",
30
35
  "dependencies": {
31
- "@atlaskit/adf-schema": "^57.4.0",
36
+ "@atlaskit/adf-schema": "^57.5.0",
37
+ "@atlaskit/platform-feature-experiments": "^0.3.0",
32
38
  "@atlaskit/platform-feature-flags": "^2.2.0",
33
39
  "@atlaskit/react-compiler-gating": "^0.2.0",
34
40
  "@babel/runtime": "^7.0.0",
@@ -44,7 +50,8 @@
44
50
  "@atlaskit/primitives": "^22.5.0",
45
51
  "@atlaskit/ssr": "workspace:^",
46
52
  "@atlassian/a11y-jest-testing": "^0.17.0",
47
- "@atlassian/conversation-assistant-service-api": "^17.13.0",
53
+ "@atlassian/conversation-assistant-service-api": "^19.1.0",
54
+ "@atlassian/experiment-test-utils": "^0.2.0",
48
55
  "@atlassian/feature-flags-test-utils": "^1.3.0",
49
56
  "@atlassian/testing-library": "^0.11.0",
50
57
  "@atlassian/workbench": "workspace:*",
@@ -54,9 +61,6 @@
54
61
  "wait-for-expect": "^1.2.0"
55
62
  },
56
63
  "platform-feature-flags": {
57
- "rovo-ext_context_bridge": {
58
- "type": "boolean"
59
- },
60
64
  "rovo_chat_replace_url_param_history": {
61
65
  "type": "boolean"
62
66
  }