@atlaskit/tmp-editor-statsig 2.37.0 → 2.39.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,23 @@
1
1
  # @atlaskit/editor-statsig-tmp
2
2
 
3
+ ## 2.39.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#105009](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/105009)
8
+ [`a4039ebf7ed11`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/a4039ebf7ed11) -
9
+ [ux] Implement variant 2 cohorts experience for platform_editor_contextual_formatting_toolbar_v2
10
+ experiment
11
+
12
+ ## 2.38.0
13
+
14
+ ### Minor Changes
15
+
16
+ - [#103433](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/103433)
17
+ [`2ea2995145fa4`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/2ea2995145fa4) -
18
+ [ux] [https://product-fabric.atlassian.net/browse/EDF-2219] - add Advanced Prompt option into the
19
+ Editor AI Command Palette
20
+
3
21
  ## 2.37.0
4
22
 
5
23
  ### Minor Changes
@@ -258,6 +258,15 @@ var editorExperimentsConfig = exports.editorExperimentsConfig = {
258
258
  typeGuard: _typeGuards.isBoolean,
259
259
  defaultValue: false
260
260
  },
261
+ // Added 2025-01-15
262
+ platform_editor_ai_advanced_prompts: {
263
+ productKeys: {
264
+ confluence: 'platform_editor_ai_advanced_prompts'
265
+ },
266
+ param: 'isEnabled',
267
+ typeGuard: _typeGuards.isBoolean,
268
+ defaultValue: false
269
+ },
261
270
  expand_selection_range_to_include_inline_node: {
262
271
  productKeys: {
263
272
  confluence: 'expand_selection_range_to_include_inline_node'
@@ -292,5 +301,23 @@ var editorExperimentsConfig = exports.editorExperimentsConfig = {
292
301
  param: 'isEnabled',
293
302
  typeGuard: _typeGuards.isBoolean,
294
303
  defaultValue: false
304
+ },
305
+ // Added 2025-01-16
306
+ live_pages_graceful_edit: {
307
+ productKeys: {
308
+ confluence: 'live_pages_graceful_edit'
309
+ },
310
+ param: 'cohort',
311
+ typeGuard: (0, _typeGuards.oneOf)(['control', 'text-click-delayed', 'text-click-no-delay', 'initially-hide-toolbar']),
312
+ defaultValue: 'control'
313
+ },
314
+ // Added 2025-01-20
315
+ platform_editor_contextual_formatting_toolbar_v2: {
316
+ productKeys: {
317
+ confluence: 'platform_editor_contextual_formatting_toolbar_v2'
318
+ },
319
+ param: 'cohort',
320
+ typeGuard: (0, _typeGuards.oneOf)(['control', 'variant1', 'variant2']),
321
+ defaultValue: 'control'
295
322
  }
296
323
  };
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.editorExperiment = editorExperiment;
8
+ exports.unstable_editorExperimentParam = unstable_editorExperimentParam;
8
9
  var _featureGateJsClient = _interopRequireDefault(require("@atlaskit/feature-gate-js-client"));
9
10
  var _experimentsConfig = require("./experiments-config");
10
11
  var _setup = require("./setup");
@@ -85,4 +86,28 @@ function editorExperiment(experimentName, expectedExperimentValue) {
85
86
  fireExperimentExposure: options.exposure
86
87
  });
87
88
  return expectedExperimentValue === experimentValue;
89
+ }
90
+ // type Unstable_EditorExperimentParams = {};
91
+ /**
92
+ * @warning This currently lacks type safety on the param names and return values
93
+ * and has limited associated test tooling.
94
+ *
95
+ * It also only works for experiments where the key matches the productKey used.
96
+ *
97
+ * The typeguard and default value is also expected to move to the experiment config
98
+ */
99
+ function unstable_editorExperimentParam(experimentName, paramName, options) {
100
+ var _paramOverrides$exper, _options$exposure;
101
+ if (((_paramOverrides$exper = _setup._paramOverrides[experimentName]) === null || _paramOverrides$exper === void 0 ? void 0 : _paramOverrides$exper[paramName]) !== undefined) {
102
+ // This will be hit in the case of a test setting an override
103
+
104
+ return _setup._paramOverrides[experimentName][paramName];
105
+ }
106
+
107
+ // eslint-disable-next-line @atlaskit/platform/use-recommended-utils
108
+ var experimentValue = _featureGateJsClient.default.getExperimentValue(experimentName, paramName, options.defaultValue, {
109
+ typeGuard: options.typeGuard,
110
+ fireExperimentExposure: (_options$exposure = options.exposure) !== null && _options$exposure !== void 0 ? _options$exposure : false
111
+ });
112
+ return experimentValue;
88
113
  }
package/dist/cjs/setup.js CHANGED
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports._product = exports._overrides = void 0;
7
+ exports._product = exports._paramOverrides = exports._overrides = void 0;
8
8
  exports.setupEditorExperiments = setupEditorExperiments;
9
9
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
10
10
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
@@ -12,6 +12,7 @@ var _experimentsConfig = require("./experiments-config");
12
12
  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; }
13
13
  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; } /* eslint-disable @atlaskit/editor/no-re-export */ // Entry file in package.json
14
14
  var _overrides = exports._overrides = {};
15
+ var _paramOverrides = exports._paramOverrides = {};
15
16
  var _product;
16
17
 
17
18
  /**
@@ -27,17 +28,22 @@ var _product;
27
28
  */
28
29
  function setupEditorExperiments(product,
29
30
  /**
30
- * Overrides are used to set the value of an experiment for testing purposes.
31
- * This is useful when you want to test a specific value of an experiment.
31
+ * Overrides are used to set the group of an experiment for testing purposes.
32
+ * This is useful when you want to test a specific experiment group.
32
33
  */
33
- overrides) {
34
- if (overrides) {
34
+ groupOverrides,
35
+ /**
36
+ * Param overrides are used to set the experiment parameters for testing purposes.
37
+ * This is useful when you want to tweak the experiment parameters for testing.
38
+ */
39
+ paramOverrides) {
40
+ if (groupOverrides) {
35
41
  // When setting up overrides, we want to ensure that experiments don't end up with invalid
36
42
  // values.
37
43
  // For production usage -- this is done via the feature flag client which takes the type
38
44
  // and performs equivalent logic.
39
45
  // @ts-ignore
40
- overrides = Object.entries(overrides).reduce(function (acc, _ref) {
46
+ groupOverrides = Object.entries(groupOverrides).reduce(function (acc, _ref) {
41
47
  var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
42
48
  key = _ref2[0],
43
49
  value = _ref2[1];
@@ -47,7 +53,10 @@ overrides) {
47
53
  }
48
54
  return acc;
49
55
  }, {});
50
- exports._overrides = _overrides = overrides;
56
+ exports._overrides = _overrides = groupOverrides;
51
57
  }
52
58
  exports._product = _product = product;
59
+ if (paramOverrides) {
60
+ exports._paramOverrides = _paramOverrides = paramOverrides;
61
+ }
53
62
  }
@@ -252,6 +252,15 @@ export const editorExperimentsConfig = {
252
252
  typeGuard: isBoolean,
253
253
  defaultValue: false
254
254
  },
255
+ // Added 2025-01-15
256
+ platform_editor_ai_advanced_prompts: {
257
+ productKeys: {
258
+ confluence: 'platform_editor_ai_advanced_prompts'
259
+ },
260
+ param: 'isEnabled',
261
+ typeGuard: isBoolean,
262
+ defaultValue: false
263
+ },
255
264
  expand_selection_range_to_include_inline_node: {
256
265
  productKeys: {
257
266
  confluence: 'expand_selection_range_to_include_inline_node'
@@ -286,5 +295,23 @@ export const editorExperimentsConfig = {
286
295
  param: 'isEnabled',
287
296
  typeGuard: isBoolean,
288
297
  defaultValue: false
298
+ },
299
+ // Added 2025-01-16
300
+ live_pages_graceful_edit: {
301
+ productKeys: {
302
+ confluence: 'live_pages_graceful_edit'
303
+ },
304
+ param: 'cohort',
305
+ typeGuard: oneOf(['control', 'text-click-delayed', 'text-click-no-delay', 'initially-hide-toolbar']),
306
+ defaultValue: 'control'
307
+ },
308
+ // Added 2025-01-20
309
+ platform_editor_contextual_formatting_toolbar_v2: {
310
+ productKeys: {
311
+ confluence: 'platform_editor_contextual_formatting_toolbar_v2'
312
+ },
313
+ param: 'cohort',
314
+ typeGuard: oneOf(['control', 'variant1', 'variant2']),
315
+ defaultValue: 'control'
289
316
  }
290
317
  };
@@ -3,7 +3,7 @@
3
3
 
4
4
  import FeatureGates from '@atlaskit/feature-gate-js-client';
5
5
  import { editorExperimentsConfig } from './experiments-config';
6
- import { _overrides, _product } from './setup';
6
+ import { _overrides, _paramOverrides, _product } from './setup';
7
7
 
8
8
  /**
9
9
  * Check the value of an editor experiment.
@@ -78,4 +78,28 @@ export function editorExperiment(experimentName, expectedExperimentValue, option
78
78
  fireExperimentExposure: options.exposure
79
79
  });
80
80
  return expectedExperimentValue === experimentValue;
81
+ }
82
+ // type Unstable_EditorExperimentParams = {};
83
+ /**
84
+ * @warning This currently lacks type safety on the param names and return values
85
+ * and has limited associated test tooling.
86
+ *
87
+ * It also only works for experiments where the key matches the productKey used.
88
+ *
89
+ * The typeguard and default value is also expected to move to the experiment config
90
+ */
91
+ export function unstable_editorExperimentParam(experimentName, paramName, options) {
92
+ var _paramOverrides$exper, _options$exposure;
93
+ if (((_paramOverrides$exper = _paramOverrides[experimentName]) === null || _paramOverrides$exper === void 0 ? void 0 : _paramOverrides$exper[paramName]) !== undefined) {
94
+ // This will be hit in the case of a test setting an override
95
+
96
+ return _paramOverrides[experimentName][paramName];
97
+ }
98
+
99
+ // eslint-disable-next-line @atlaskit/platform/use-recommended-utils
100
+ const experimentValue = FeatureGates.getExperimentValue(experimentName, paramName, options.defaultValue, {
101
+ typeGuard: options.typeGuard,
102
+ fireExperimentExposure: (_options$exposure = options.exposure) !== null && _options$exposure !== void 0 ? _options$exposure : false
103
+ });
104
+ return experimentValue;
81
105
  }
@@ -3,6 +3,7 @@
3
3
 
4
4
  import { editorExperimentsConfig } from './experiments-config';
5
5
  export let _overrides = {};
6
+ export let _paramOverrides = {};
6
7
  export let _product;
7
8
 
8
9
  /**
@@ -18,17 +19,22 @@ export let _product;
18
19
  */
19
20
  export function setupEditorExperiments(product,
20
21
  /**
21
- * Overrides are used to set the value of an experiment for testing purposes.
22
- * This is useful when you want to test a specific value of an experiment.
22
+ * Overrides are used to set the group of an experiment for testing purposes.
23
+ * This is useful when you want to test a specific experiment group.
23
24
  */
24
- overrides) {
25
- if (overrides) {
25
+ groupOverrides,
26
+ /**
27
+ * Param overrides are used to set the experiment parameters for testing purposes.
28
+ * This is useful when you want to tweak the experiment parameters for testing.
29
+ */
30
+ paramOverrides) {
31
+ if (groupOverrides) {
26
32
  // When setting up overrides, we want to ensure that experiments don't end up with invalid
27
33
  // values.
28
34
  // For production usage -- this is done via the feature flag client which takes the type
29
35
  // and performs equivalent logic.
30
36
  // @ts-ignore
31
- overrides = Object.entries(overrides).reduce((acc, [key, value]) => {
37
+ groupOverrides = Object.entries(groupOverrides).reduce((acc, [key, value]) => {
32
38
  const config = editorExperimentsConfig[key];
33
39
  if (config) {
34
40
  acc = {
@@ -38,7 +44,10 @@ overrides) {
38
44
  }
39
45
  return acc;
40
46
  }, {});
41
- _overrides = overrides;
47
+ _overrides = groupOverrides;
42
48
  }
43
49
  _product = product;
50
+ if (paramOverrides) {
51
+ _paramOverrides = paramOverrides;
52
+ }
44
53
  }
@@ -252,6 +252,15 @@ export var editorExperimentsConfig = {
252
252
  typeGuard: isBoolean,
253
253
  defaultValue: false
254
254
  },
255
+ // Added 2025-01-15
256
+ platform_editor_ai_advanced_prompts: {
257
+ productKeys: {
258
+ confluence: 'platform_editor_ai_advanced_prompts'
259
+ },
260
+ param: 'isEnabled',
261
+ typeGuard: isBoolean,
262
+ defaultValue: false
263
+ },
255
264
  expand_selection_range_to_include_inline_node: {
256
265
  productKeys: {
257
266
  confluence: 'expand_selection_range_to_include_inline_node'
@@ -286,5 +295,23 @@ export var editorExperimentsConfig = {
286
295
  param: 'isEnabled',
287
296
  typeGuard: isBoolean,
288
297
  defaultValue: false
298
+ },
299
+ // Added 2025-01-16
300
+ live_pages_graceful_edit: {
301
+ productKeys: {
302
+ confluence: 'live_pages_graceful_edit'
303
+ },
304
+ param: 'cohort',
305
+ typeGuard: oneOf(['control', 'text-click-delayed', 'text-click-no-delay', 'initially-hide-toolbar']),
306
+ defaultValue: 'control'
307
+ },
308
+ // Added 2025-01-20
309
+ platform_editor_contextual_formatting_toolbar_v2: {
310
+ productKeys: {
311
+ confluence: 'platform_editor_contextual_formatting_toolbar_v2'
312
+ },
313
+ param: 'cohort',
314
+ typeGuard: oneOf(['control', 'variant1', 'variant2']),
315
+ defaultValue: 'control'
289
316
  }
290
317
  };
@@ -3,7 +3,7 @@
3
3
 
4
4
  import FeatureGates from '@atlaskit/feature-gate-js-client';
5
5
  import { editorExperimentsConfig } from './experiments-config';
6
- import { _overrides, _product } from './setup';
6
+ import { _overrides, _paramOverrides, _product } from './setup';
7
7
 
8
8
  /**
9
9
  * Check the value of an editor experiment.
@@ -79,4 +79,28 @@ export function editorExperiment(experimentName, expectedExperimentValue) {
79
79
  fireExperimentExposure: options.exposure
80
80
  });
81
81
  return expectedExperimentValue === experimentValue;
82
+ }
83
+ // type Unstable_EditorExperimentParams = {};
84
+ /**
85
+ * @warning This currently lacks type safety on the param names and return values
86
+ * and has limited associated test tooling.
87
+ *
88
+ * It also only works for experiments where the key matches the productKey used.
89
+ *
90
+ * The typeguard and default value is also expected to move to the experiment config
91
+ */
92
+ export function unstable_editorExperimentParam(experimentName, paramName, options) {
93
+ var _paramOverrides$exper, _options$exposure;
94
+ if (((_paramOverrides$exper = _paramOverrides[experimentName]) === null || _paramOverrides$exper === void 0 ? void 0 : _paramOverrides$exper[paramName]) !== undefined) {
95
+ // This will be hit in the case of a test setting an override
96
+
97
+ return _paramOverrides[experimentName][paramName];
98
+ }
99
+
100
+ // eslint-disable-next-line @atlaskit/platform/use-recommended-utils
101
+ var experimentValue = FeatureGates.getExperimentValue(experimentName, paramName, options.defaultValue, {
102
+ typeGuard: options.typeGuard,
103
+ fireExperimentExposure: (_options$exposure = options.exposure) !== null && _options$exposure !== void 0 ? _options$exposure : false
104
+ });
105
+ return experimentValue;
82
106
  }
package/dist/esm/setup.js CHANGED
@@ -7,6 +7,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
7
7
 
8
8
  import { editorExperimentsConfig } from './experiments-config';
9
9
  export var _overrides = {};
10
+ export var _paramOverrides = {};
10
11
  export var _product;
11
12
 
12
13
  /**
@@ -22,17 +23,22 @@ export var _product;
22
23
  */
23
24
  export function setupEditorExperiments(product,
24
25
  /**
25
- * Overrides are used to set the value of an experiment for testing purposes.
26
- * This is useful when you want to test a specific value of an experiment.
26
+ * Overrides are used to set the group of an experiment for testing purposes.
27
+ * This is useful when you want to test a specific experiment group.
27
28
  */
28
- overrides) {
29
- if (overrides) {
29
+ groupOverrides,
30
+ /**
31
+ * Param overrides are used to set the experiment parameters for testing purposes.
32
+ * This is useful when you want to tweak the experiment parameters for testing.
33
+ */
34
+ paramOverrides) {
35
+ if (groupOverrides) {
30
36
  // When setting up overrides, we want to ensure that experiments don't end up with invalid
31
37
  // values.
32
38
  // For production usage -- this is done via the feature flag client which takes the type
33
39
  // and performs equivalent logic.
34
40
  // @ts-ignore
35
- overrides = Object.entries(overrides).reduce(function (acc, _ref) {
41
+ groupOverrides = Object.entries(groupOverrides).reduce(function (acc, _ref) {
36
42
  var _ref2 = _slicedToArray(_ref, 2),
37
43
  key = _ref2[0],
38
44
  value = _ref2[1];
@@ -42,7 +48,10 @@ overrides) {
42
48
  }
43
49
  return acc;
44
50
  }, {});
45
- _overrides = overrides;
51
+ _overrides = groupOverrides;
46
52
  }
47
53
  _product = product;
54
+ if (paramOverrides) {
55
+ _paramOverrides = paramOverrides;
56
+ }
48
57
  }
@@ -45,7 +45,7 @@ declare function eeTest<ExperimentName extends keyof EditorExperimentsConfig>(ex
45
45
  false: DescribeBody;
46
46
  }, otherExperiments?: EditorExperimentOverrides): void;
47
47
  declare namespace eeTest {
48
- var describe: <ExperimentName extends "example-boolean" | "example-multivariate" | "test-new-experiments-package" | "basic-text-transformations" | "element-level-templates" | "add-media-from-url" | "nested-dnd" | "insert-menu-in-right-rail" | "support_table_in_comment" | "platform_editor_exp_lazy_node_views" | "platform_renderer_table_sticky_scrollbar" | "nest-media-and-codeblock-in-quote" | "nested-expand-in-expand" | "editor_ai_-_multi_prompts" | "comment_on_bodied_extensions" | "advanced_layouts" | "support_table_in_comment_jira" | "comment_on_inline_node_spotlight" | "platform_editor_ai-prompts-placeholder" | "nested-tables-in-tables" | "platform_editor_ai_mentions_support" | "platform_editor_ai_change_tone_floating_toolbar" | "issue_view_action_items" | "contextual_formatting_toolbar" | "platform_editor_ai_1p_smart_link_unfurl_in_prompt" | "platform_editor_ai_unsplash_page_header" | "expand_selection_range_to_include_inline_node" | "platform_editor_blockquote_in_text_formatting_menu" | "platform_editor_advanced_code_blocks" | "platform_editor_element_drag_and_drop_multiselect">(experimentName: ExperimentName, describeName: string) => {
48
+ var describe: <ExperimentName extends "example-boolean" | "example-multivariate" | "test-new-experiments-package" | "basic-text-transformations" | "element-level-templates" | "add-media-from-url" | "nested-dnd" | "insert-menu-in-right-rail" | "support_table_in_comment" | "platform_editor_exp_lazy_node_views" | "platform_renderer_table_sticky_scrollbar" | "nest-media-and-codeblock-in-quote" | "nested-expand-in-expand" | "editor_ai_-_multi_prompts" | "comment_on_bodied_extensions" | "advanced_layouts" | "support_table_in_comment_jira" | "comment_on_inline_node_spotlight" | "platform_editor_ai-prompts-placeholder" | "nested-tables-in-tables" | "platform_editor_ai_mentions_support" | "platform_editor_ai_change_tone_floating_toolbar" | "issue_view_action_items" | "contextual_formatting_toolbar" | "platform_editor_ai_1p_smart_link_unfurl_in_prompt" | "platform_editor_ai_unsplash_page_header" | "platform_editor_ai_advanced_prompts" | "expand_selection_range_to_include_inline_node" | "platform_editor_blockquote_in_text_formatting_menu" | "platform_editor_advanced_code_blocks" | "platform_editor_element_drag_and_drop_multiselect" | "live_pages_graceful_edit" | "platform_editor_contextual_formatting_toolbar_v2">(experimentName: ExperimentName, describeName: string) => {
49
49
  variant: (value: {
50
50
  'example-boolean': {
51
51
  productKeys: {
@@ -256,6 +256,14 @@ declare namespace eeTest {
256
256
  typeGuard: typeof import("./type-guards").isBoolean;
257
257
  defaultValue: boolean;
258
258
  };
259
+ platform_editor_ai_advanced_prompts: {
260
+ productKeys: {
261
+ confluence: string;
262
+ };
263
+ param: string;
264
+ typeGuard: typeof import("./type-guards").isBoolean;
265
+ defaultValue: boolean;
266
+ };
259
267
  expand_selection_range_to_include_inline_node: {
260
268
  productKeys: {
261
269
  confluence: string;
@@ -288,6 +296,22 @@ declare namespace eeTest {
288
296
  typeGuard: typeof import("./type-guards").isBoolean;
289
297
  defaultValue: boolean;
290
298
  };
299
+ live_pages_graceful_edit: {
300
+ productKeys: {
301
+ confluence: string;
302
+ };
303
+ param: string;
304
+ typeGuard: (value: unknown) => value is "control" | "text-click-delayed" | "text-click-no-delay" | "initially-hide-toolbar";
305
+ defaultValue: "control" | "text-click-delayed" | "text-click-no-delay" | "initially-hide-toolbar";
306
+ };
307
+ platform_editor_contextual_formatting_toolbar_v2: {
308
+ productKeys: {
309
+ confluence: string;
310
+ };
311
+ param: string;
312
+ typeGuard: (value: unknown) => value is "control" | "variant1" | "variant2";
313
+ defaultValue: "control" | "variant1" | "variant2";
314
+ };
291
315
  }[ExperimentName]["defaultValue"], describeBody: jest.EmptyFunction) => void;
292
316
  each: (describeBody: jest.EmptyFunction) => void;
293
317
  };
@@ -215,6 +215,14 @@ export declare const editorExperimentsConfig: {
215
215
  typeGuard: typeof isBoolean;
216
216
  defaultValue: boolean;
217
217
  };
218
+ platform_editor_ai_advanced_prompts: {
219
+ productKeys: {
220
+ confluence: string;
221
+ };
222
+ param: string;
223
+ typeGuard: typeof isBoolean;
224
+ defaultValue: boolean;
225
+ };
218
226
  expand_selection_range_to_include_inline_node: {
219
227
  productKeys: {
220
228
  confluence: string;
@@ -247,4 +255,20 @@ export declare const editorExperimentsConfig: {
247
255
  typeGuard: typeof isBoolean;
248
256
  defaultValue: boolean;
249
257
  };
258
+ live_pages_graceful_edit: {
259
+ productKeys: {
260
+ confluence: string;
261
+ };
262
+ param: string;
263
+ typeGuard: (value: unknown) => value is "control" | "text-click-delayed" | "text-click-no-delay" | "initially-hide-toolbar";
264
+ defaultValue: "control" | "text-click-delayed" | "text-click-no-delay" | "initially-hide-toolbar";
265
+ };
266
+ platform_editor_contextual_formatting_toolbar_v2: {
267
+ productKeys: {
268
+ confluence: string;
269
+ };
270
+ param: string;
271
+ typeGuard: (value: unknown) => value is "control" | "variant1" | "variant2";
272
+ defaultValue: "control" | "variant1" | "variant2";
273
+ };
250
274
  };
@@ -44,3 +44,22 @@ import { type EditorExperimentsConfig } from './experiments-config';
44
44
  export declare function editorExperiment<ExperimentName extends keyof EditorExperimentsConfig>(experimentName: ExperimentName, expectedExperimentValue: EditorExperimentsConfig[ExperimentName]['defaultValue'], options?: {
45
45
  exposure: boolean;
46
46
  }): boolean;
47
+ type Unstable_EditorExperimentParams = {
48
+ live_pages_graceful_edit: {
49
+ params: 'view-mode-intent-to-edit' | 'delay';
50
+ };
51
+ };
52
+ /**
53
+ * @warning This currently lacks type safety on the param names and return values
54
+ * and has limited associated test tooling.
55
+ *
56
+ * It also only works for experiments where the key matches the productKey used.
57
+ *
58
+ * The typeguard and default value is also expected to move to the experiment config
59
+ */
60
+ export declare function unstable_editorExperimentParam<ExperimentName extends keyof Unstable_EditorExperimentParams, ParamKey extends Unstable_EditorExperimentParams[ExperimentName]['params'], ParamValue = unknown>(experimentName: ExperimentName, paramName: ParamKey, options: {
61
+ exposure?: boolean;
62
+ typeGuard: (value: unknown) => value is ParamValue;
63
+ defaultValue: ParamValue;
64
+ }): ParamValue;
65
+ export {};
@@ -2,6 +2,11 @@ import { editorExperimentsConfig } from './experiments-config';
2
2
  export type EditorExperimentOverrides = Partial<{
3
3
  [ExperimentName in keyof typeof editorExperimentsConfig]: (typeof editorExperimentsConfig)[ExperimentName]['defaultValue'];
4
4
  }>;
5
+ export type EditorExperimentParamOverrides = {
6
+ [experimentName: string]: {
7
+ [paramName: string]: any;
8
+ };
9
+ };
5
10
  export declare let _overrides: Partial<{
6
11
  'example-boolean': boolean;
7
12
  'example-multivariate': "one" | "two" | "three";
@@ -29,11 +34,15 @@ export declare let _overrides: Partial<{
29
34
  contextual_formatting_toolbar: boolean;
30
35
  platform_editor_ai_1p_smart_link_unfurl_in_prompt: boolean;
31
36
  platform_editor_ai_unsplash_page_header: boolean;
37
+ platform_editor_ai_advanced_prompts: boolean;
32
38
  expand_selection_range_to_include_inline_node: boolean;
33
39
  platform_editor_blockquote_in_text_formatting_menu: boolean;
34
40
  platform_editor_advanced_code_blocks: boolean;
35
41
  platform_editor_element_drag_and_drop_multiselect: boolean;
42
+ live_pages_graceful_edit: "control" | "text-click-delayed" | "text-click-no-delay" | "initially-hide-toolbar";
43
+ platform_editor_contextual_formatting_toolbar_v2: "control" | "variant1" | "variant2";
36
44
  }>;
45
+ export declare let _paramOverrides: EditorExperimentParamOverrides;
37
46
  export declare let _product: 'confluence' | 'jira' | 'test' | undefined;
38
47
  /**
39
48
  * This function is used to set up the editor experiments for testing purposes.
@@ -48,7 +57,12 @@ export declare let _product: 'confluence' | 'jira' | 'test' | undefined;
48
57
  */
49
58
  export declare function setupEditorExperiments(product: 'confluence' | 'jira' | 'test',
50
59
  /**
51
- * Overrides are used to set the value of an experiment for testing purposes.
52
- * This is useful when you want to test a specific value of an experiment.
60
+ * Overrides are used to set the group of an experiment for testing purposes.
61
+ * This is useful when you want to test a specific experiment group.
53
62
  */
54
- overrides?: EditorExperimentOverrides): void;
63
+ groupOverrides?: EditorExperimentOverrides,
64
+ /**
65
+ * Param overrides are used to set the experiment parameters for testing purposes.
66
+ * This is useful when you want to tweak the experiment parameters for testing.
67
+ */
68
+ paramOverrides?: EditorExperimentParamOverrides): void;
@@ -45,7 +45,7 @@ declare function eeTest<ExperimentName extends keyof EditorExperimentsConfig>(ex
45
45
  false: DescribeBody;
46
46
  }, otherExperiments?: EditorExperimentOverrides): void;
47
47
  declare namespace eeTest {
48
- var describe: <ExperimentName extends "example-boolean" | "example-multivariate" | "test-new-experiments-package" | "basic-text-transformations" | "element-level-templates" | "add-media-from-url" | "nested-dnd" | "insert-menu-in-right-rail" | "support_table_in_comment" | "platform_editor_exp_lazy_node_views" | "platform_renderer_table_sticky_scrollbar" | "nest-media-and-codeblock-in-quote" | "nested-expand-in-expand" | "editor_ai_-_multi_prompts" | "comment_on_bodied_extensions" | "advanced_layouts" | "support_table_in_comment_jira" | "comment_on_inline_node_spotlight" | "platform_editor_ai-prompts-placeholder" | "nested-tables-in-tables" | "platform_editor_ai_mentions_support" | "platform_editor_ai_change_tone_floating_toolbar" | "issue_view_action_items" | "contextual_formatting_toolbar" | "platform_editor_ai_1p_smart_link_unfurl_in_prompt" | "platform_editor_ai_unsplash_page_header" | "expand_selection_range_to_include_inline_node" | "platform_editor_blockquote_in_text_formatting_menu" | "platform_editor_advanced_code_blocks" | "platform_editor_element_drag_and_drop_multiselect">(experimentName: ExperimentName, describeName: string) => {
48
+ var describe: <ExperimentName extends "example-boolean" | "example-multivariate" | "test-new-experiments-package" | "basic-text-transformations" | "element-level-templates" | "add-media-from-url" | "nested-dnd" | "insert-menu-in-right-rail" | "support_table_in_comment" | "platform_editor_exp_lazy_node_views" | "platform_renderer_table_sticky_scrollbar" | "nest-media-and-codeblock-in-quote" | "nested-expand-in-expand" | "editor_ai_-_multi_prompts" | "comment_on_bodied_extensions" | "advanced_layouts" | "support_table_in_comment_jira" | "comment_on_inline_node_spotlight" | "platform_editor_ai-prompts-placeholder" | "nested-tables-in-tables" | "platform_editor_ai_mentions_support" | "platform_editor_ai_change_tone_floating_toolbar" | "issue_view_action_items" | "contextual_formatting_toolbar" | "platform_editor_ai_1p_smart_link_unfurl_in_prompt" | "platform_editor_ai_unsplash_page_header" | "platform_editor_ai_advanced_prompts" | "expand_selection_range_to_include_inline_node" | "platform_editor_blockquote_in_text_formatting_menu" | "platform_editor_advanced_code_blocks" | "platform_editor_element_drag_and_drop_multiselect" | "live_pages_graceful_edit" | "platform_editor_contextual_formatting_toolbar_v2">(experimentName: ExperimentName, describeName: string) => {
49
49
  variant: (value: {
50
50
  'example-boolean': {
51
51
  productKeys: {
@@ -256,6 +256,14 @@ declare namespace eeTest {
256
256
  typeGuard: typeof import("./type-guards").isBoolean;
257
257
  defaultValue: boolean;
258
258
  };
259
+ platform_editor_ai_advanced_prompts: {
260
+ productKeys: {
261
+ confluence: string;
262
+ };
263
+ param: string;
264
+ typeGuard: typeof import("./type-guards").isBoolean;
265
+ defaultValue: boolean;
266
+ };
259
267
  expand_selection_range_to_include_inline_node: {
260
268
  productKeys: {
261
269
  confluence: string;
@@ -288,6 +296,22 @@ declare namespace eeTest {
288
296
  typeGuard: typeof import("./type-guards").isBoolean;
289
297
  defaultValue: boolean;
290
298
  };
299
+ live_pages_graceful_edit: {
300
+ productKeys: {
301
+ confluence: string;
302
+ };
303
+ param: string;
304
+ typeGuard: (value: unknown) => value is "control" | "text-click-delayed" | "text-click-no-delay" | "initially-hide-toolbar";
305
+ defaultValue: "control" | "text-click-delayed" | "text-click-no-delay" | "initially-hide-toolbar";
306
+ };
307
+ platform_editor_contextual_formatting_toolbar_v2: {
308
+ productKeys: {
309
+ confluence: string;
310
+ };
311
+ param: string;
312
+ typeGuard: (value: unknown) => value is "control" | "variant1" | "variant2";
313
+ defaultValue: "control" | "variant1" | "variant2";
314
+ };
291
315
  }[ExperimentName]["defaultValue"], describeBody: jest.EmptyFunction) => void;
292
316
  each: (describeBody: jest.EmptyFunction) => void;
293
317
  };
@@ -215,6 +215,14 @@ export declare const editorExperimentsConfig: {
215
215
  typeGuard: typeof isBoolean;
216
216
  defaultValue: boolean;
217
217
  };
218
+ platform_editor_ai_advanced_prompts: {
219
+ productKeys: {
220
+ confluence: string;
221
+ };
222
+ param: string;
223
+ typeGuard: typeof isBoolean;
224
+ defaultValue: boolean;
225
+ };
218
226
  expand_selection_range_to_include_inline_node: {
219
227
  productKeys: {
220
228
  confluence: string;
@@ -247,4 +255,20 @@ export declare const editorExperimentsConfig: {
247
255
  typeGuard: typeof isBoolean;
248
256
  defaultValue: boolean;
249
257
  };
258
+ live_pages_graceful_edit: {
259
+ productKeys: {
260
+ confluence: string;
261
+ };
262
+ param: string;
263
+ typeGuard: (value: unknown) => value is "control" | "text-click-delayed" | "text-click-no-delay" | "initially-hide-toolbar";
264
+ defaultValue: "control" | "text-click-delayed" | "text-click-no-delay" | "initially-hide-toolbar";
265
+ };
266
+ platform_editor_contextual_formatting_toolbar_v2: {
267
+ productKeys: {
268
+ confluence: string;
269
+ };
270
+ param: string;
271
+ typeGuard: (value: unknown) => value is "control" | "variant1" | "variant2";
272
+ defaultValue: "control" | "variant1" | "variant2";
273
+ };
250
274
  };
@@ -44,3 +44,22 @@ import { type EditorExperimentsConfig } from './experiments-config';
44
44
  export declare function editorExperiment<ExperimentName extends keyof EditorExperimentsConfig>(experimentName: ExperimentName, expectedExperimentValue: EditorExperimentsConfig[ExperimentName]['defaultValue'], options?: {
45
45
  exposure: boolean;
46
46
  }): boolean;
47
+ type Unstable_EditorExperimentParams = {
48
+ live_pages_graceful_edit: {
49
+ params: 'view-mode-intent-to-edit' | 'delay';
50
+ };
51
+ };
52
+ /**
53
+ * @warning This currently lacks type safety on the param names and return values
54
+ * and has limited associated test tooling.
55
+ *
56
+ * It also only works for experiments where the key matches the productKey used.
57
+ *
58
+ * The typeguard and default value is also expected to move to the experiment config
59
+ */
60
+ export declare function unstable_editorExperimentParam<ExperimentName extends keyof Unstable_EditorExperimentParams, ParamKey extends Unstable_EditorExperimentParams[ExperimentName]['params'], ParamValue = unknown>(experimentName: ExperimentName, paramName: ParamKey, options: {
61
+ exposure?: boolean;
62
+ typeGuard: (value: unknown) => value is ParamValue;
63
+ defaultValue: ParamValue;
64
+ }): ParamValue;
65
+ export {};
@@ -2,6 +2,11 @@ import { editorExperimentsConfig } from './experiments-config';
2
2
  export type EditorExperimentOverrides = Partial<{
3
3
  [ExperimentName in keyof typeof editorExperimentsConfig]: (typeof editorExperimentsConfig)[ExperimentName]['defaultValue'];
4
4
  }>;
5
+ export type EditorExperimentParamOverrides = {
6
+ [experimentName: string]: {
7
+ [paramName: string]: any;
8
+ };
9
+ };
5
10
  export declare let _overrides: Partial<{
6
11
  'example-boolean': boolean;
7
12
  'example-multivariate': "one" | "two" | "three";
@@ -29,11 +34,15 @@ export declare let _overrides: Partial<{
29
34
  contextual_formatting_toolbar: boolean;
30
35
  platform_editor_ai_1p_smart_link_unfurl_in_prompt: boolean;
31
36
  platform_editor_ai_unsplash_page_header: boolean;
37
+ platform_editor_ai_advanced_prompts: boolean;
32
38
  expand_selection_range_to_include_inline_node: boolean;
33
39
  platform_editor_blockquote_in_text_formatting_menu: boolean;
34
40
  platform_editor_advanced_code_blocks: boolean;
35
41
  platform_editor_element_drag_and_drop_multiselect: boolean;
42
+ live_pages_graceful_edit: "control" | "text-click-delayed" | "text-click-no-delay" | "initially-hide-toolbar";
43
+ platform_editor_contextual_formatting_toolbar_v2: "control" | "variant1" | "variant2";
36
44
  }>;
45
+ export declare let _paramOverrides: EditorExperimentParamOverrides;
37
46
  export declare let _product: 'confluence' | 'jira' | 'test' | undefined;
38
47
  /**
39
48
  * This function is used to set up the editor experiments for testing purposes.
@@ -48,7 +57,12 @@ export declare let _product: 'confluence' | 'jira' | 'test' | undefined;
48
57
  */
49
58
  export declare function setupEditorExperiments(product: 'confluence' | 'jira' | 'test',
50
59
  /**
51
- * Overrides are used to set the value of an experiment for testing purposes.
52
- * This is useful when you want to test a specific value of an experiment.
60
+ * Overrides are used to set the group of an experiment for testing purposes.
61
+ * This is useful when you want to test a specific experiment group.
53
62
  */
54
- overrides?: EditorExperimentOverrides): void;
63
+ groupOverrides?: EditorExperimentOverrides,
64
+ /**
65
+ * Param overrides are used to set the experiment parameters for testing purposes.
66
+ * This is useful when you want to tweak the experiment parameters for testing.
67
+ */
68
+ paramOverrides?: EditorExperimentParamOverrides): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/tmp-editor-statsig",
3
- "version": "2.37.0",
3
+ "version": "2.39.0",
4
4
  "description": "Temp plugin to ease use of statsig feature flags until platform feature flags are available",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",