@atlaskit/tmp-editor-statsig 1.4.1 → 2.0.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,22 @@
1
1
  # @atlaskit/editor-statsig-tmp
2
2
 
3
+ ## 2.0.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#136295](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/136295)
8
+ [`0150dad7ca580`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/0150dad7ca580) -
9
+ Add new experiment for insert menu in right rail, allow right menu to be opened from main toolbar
10
+ '+' button
11
+
12
+ ## 2.0.0
13
+
14
+ ### Major Changes
15
+
16
+ - [#136209](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/136209)
17
+ [`2d0d9036c143a`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/2d0d9036c143a) -
18
+ [ED-24790] Add support for editor experiments in gemini tests
19
+
3
20
  ## 1.4.1
4
21
 
5
22
  ### Patch Changes
@@ -8,7 +8,7 @@ exports.eeTest = eeTest;
8
8
  var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
9
9
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
10
10
  var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
11
- var _experiments = require("./experiments");
11
+ var _setup = require("./setup");
12
12
  var _experimentsConfig = require("./experiments-config");
13
13
  // This is loosely based on the `ffTest` util from `@atlassian/feature-flags-test-utils` package.
14
14
 
@@ -48,10 +48,10 @@ var _experimentsConfig = require("./experiments-config");
48
48
  * ```
49
49
  */
50
50
  function eeTest(experimentName, cases, otherExperiments) {
51
- (0, _experiments.setupEditorExperiments)('test', {});
51
+ (0, _setup.setupEditorExperiments)('test', {});
52
52
  describe("eeTest: ".concat(experimentName), function () {
53
53
  afterEach(function () {
54
- (0, _experiments.setupEditorExperiments)('test', otherExperiments !== null && otherExperiments !== void 0 ? otherExperiments : {});
54
+ (0, _setup.setupEditorExperiments)('test', otherExperiments !== null && otherExperiments !== void 0 ? otherExperiments : {});
55
55
  });
56
56
  var isBooleanExperiment = typeof _experimentsConfig.editorExperimentsConfig[experimentName].defaultValue === 'boolean';
57
57
  if (isBooleanExperiment && Object.keys(cases).length !== 2) {
@@ -65,7 +65,7 @@ function eeTest(experimentName, cases, otherExperiments) {
65
65
  case 0:
66
66
  testCaseKey = value; // For boolean experiments, we need to convert the 'on' and 'off' cases to boolean `true` and `false` values.
67
67
  convertedValue = isBooleanExperiment ? testCaseKey === 'true' ? true : false : testCaseKey;
68
- (0, _experiments.setupEditorExperiments)('test', (0, _defineProperty2.default)({}, experimentName, convertedValue));
68
+ (0, _setup.setupEditorExperiments)('test', (0, _defineProperty2.default)({}, experimentName, convertedValue));
69
69
  testCase = cases[testCaseKey]; // @ts-ignore
70
70
  _context.next = 6;
71
71
  return Promise.resolve(testCase());
@@ -93,5 +93,14 @@ var editorExperimentsConfig = exports.editorExperimentsConfig = {
93
93
  param: 'isEnabled',
94
94
  typeGuard: isBoolean,
95
95
  defaultValue: false
96
+ },
97
+ // Added 2024-08-29
98
+ 'insert-menu-in-right-rail': {
99
+ productKeys: {
100
+ confluence: 'platform_editor_insert_menu_in_right_rail'
101
+ },
102
+ param: 'isEnabled',
103
+ typeGuard: isBoolean,
104
+ defaultValue: false
96
105
  }
97
106
  };
@@ -5,52 +5,9 @@ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.editorExperiment = editorExperiment;
8
- exports.setupEditorExperiments = setupEditorExperiments;
9
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
10
- var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
11
8
  var _featureGateJsClient = _interopRequireDefault(require("@atlaskit/feature-gate-js-client"));
12
9
  var _experimentsConfig = require("./experiments-config");
13
- 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; }
14
- 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; }
15
- var _overrides = {};
16
- var _product;
17
-
18
- /**
19
- * This function is used to set up the editor experiments for testing purposes.
20
- * It should be called before running code that depends on editor experiments.
21
- *
22
- * @example
23
- * ```ts
24
- * setupEditorExperiments('confluence', {
25
- * 'experiment-name': 'value',
26
- * });
27
- * ```
28
- */
29
- function setupEditorExperiments(product,
30
- /**
31
- * Overrides are used to set the value of an experiment for testing purposes.
32
- * This is useful when you want to test a specific value of an experiment.
33
- */
34
- overrides) {
35
- if (overrides) {
36
- // When setting up overrides, we want to ensure that experiments don't end up with invalid
37
- // values.
38
- // For production usage -- this is done via the feature flag client which takes the type
39
- // and performs equivalent logic.
40
- // @ts-ignore
41
- overrides = Object.entries(overrides).reduce(function (acc, _ref) {
42
- var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
43
- key = _ref2[0],
44
- value = _ref2[1];
45
- var config = _experimentsConfig.editorExperimentsConfig[key];
46
- acc = _objectSpread(_objectSpread({}, acc), {}, (0, _defineProperty2.default)({}, key, config.typeGuard(value) ? value : config.defaultValue));
47
- return acc;
48
- }, {});
49
- _overrides = overrides;
50
- }
51
- _product = product;
52
- }
53
-
10
+ var _setup = require("./setup");
54
11
  /**
55
12
  * Check the value of an editor experiment.
56
13
  *
@@ -99,21 +56,23 @@ function editorExperiment(experimentName, expectedExperimentValue) {
99
56
  exposure: false
100
57
  };
101
58
  var experimentConfig = _experimentsConfig.editorExperimentsConfig[experimentName];
102
- if (_overrides[experimentName] !== undefined) {
59
+ if (_setup._overrides[experimentName] !== undefined) {
103
60
  // This will be hit in the case of a test setting an override
104
- return _overrides[experimentName] === expectedExperimentValue;
61
+ return _setup._overrides[experimentName] === expectedExperimentValue;
105
62
  }
106
- if (!_product) {
63
+ if (!_setup._product) {
107
64
  // This will be hit in the case of a product not having setup the editor experiment tooling
108
65
  return experimentConfig.defaultValue === expectedExperimentValue;
109
66
  }
110
67
 
111
68
  // Typescript is complaining here about accessing the productKeys property
112
- var experimentKey = (_experimentConfig$pro = experimentConfig.productKeys) === null || _experimentConfig$pro === void 0 ? void 0 : _experimentConfig$pro[_product];
69
+ var experimentKey = (_experimentConfig$pro = experimentConfig.productKeys) === null || _experimentConfig$pro === void 0 ? void 0 : _experimentConfig$pro[_setup._product];
113
70
  if (!experimentKey) {
114
71
  // This will be hit in the case of an experiment not being set up for the product
115
72
  return _experimentsConfig.editorExperimentsConfig[experimentName].defaultValue === expectedExperimentValue;
116
73
  }
74
+
75
+ // eslint-disable-next-line @atlaskit/platform/use-recommended-utils
117
76
  var experimentValue = _featureGateJsClient.default.getExperimentValue(
118
77
  // @ts-ignore
119
78
  experimentKey, experimentConfig.param, experimentConfig.defaultValue, {
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports._product = exports._overrides = void 0;
8
+ exports.setupEditorExperiments = setupEditorExperiments;
9
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
10
+ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
11
+ var _experimentsConfig = require("./experiments-config");
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
+ 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; }
14
+ var _overrides = exports._overrides = {};
15
+ var _product;
16
+
17
+ /**
18
+ * This function is used to set up the editor experiments for testing purposes.
19
+ * It should be called before running code that depends on editor experiments.
20
+ *
21
+ * @example
22
+ * ```ts
23
+ * setupEditorExperiments('confluence', {
24
+ * 'experiment-name': 'value',
25
+ * });
26
+ * ```
27
+ */
28
+ function setupEditorExperiments(product,
29
+ /**
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.
32
+ */
33
+ overrides) {
34
+ if (overrides) {
35
+ // When setting up overrides, we want to ensure that experiments don't end up with invalid
36
+ // values.
37
+ // For production usage -- this is done via the feature flag client which takes the type
38
+ // and performs equivalent logic.
39
+ // @ts-ignore
40
+ overrides = Object.entries(overrides).reduce(function (acc, _ref) {
41
+ var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
42
+ key = _ref2[0],
43
+ value = _ref2[1];
44
+ var config = _experimentsConfig.editorExperimentsConfig[key];
45
+ if (config) {
46
+ acc = _objectSpread(_objectSpread({}, acc), {}, (0, _defineProperty2.default)({}, key, config.typeGuard(value) ? value : config.defaultValue));
47
+ }
48
+ return acc;
49
+ }, {});
50
+ exports._overrides = _overrides = overrides;
51
+ }
52
+ exports._product = _product = product;
53
+ }
@@ -1,6 +1,6 @@
1
1
  // This is loosely based on the `ffTest` util from `@atlassian/feature-flags-test-utils` package.
2
2
 
3
- import { setupEditorExperiments } from './experiments';
3
+ import { setupEditorExperiments } from './setup';
4
4
  import { editorExperimentsConfig } from './experiments-config';
5
5
 
6
6
  /**
@@ -87,5 +87,14 @@ export const editorExperimentsConfig = {
87
87
  param: 'isEnabled',
88
88
  typeGuard: isBoolean,
89
89
  defaultValue: false
90
+ },
91
+ // Added 2024-08-29
92
+ 'insert-menu-in-right-rail': {
93
+ productKeys: {
94
+ confluence: 'platform_editor_insert_menu_in_right_rail'
95
+ },
96
+ param: 'isEnabled',
97
+ typeGuard: isBoolean,
98
+ defaultValue: false
90
99
  }
91
100
  };
@@ -1,43 +1,6 @@
1
1
  import FeatureGates from '@atlaskit/feature-gate-js-client';
2
2
  import { editorExperimentsConfig } from './experiments-config';
3
- let _overrides = {};
4
- let _product;
5
-
6
- /**
7
- * This function is used to set up the editor experiments for testing purposes.
8
- * It should be called before running code that depends on editor experiments.
9
- *
10
- * @example
11
- * ```ts
12
- * setupEditorExperiments('confluence', {
13
- * 'experiment-name': 'value',
14
- * });
15
- * ```
16
- */
17
- export function setupEditorExperiments(product,
18
- /**
19
- * Overrides are used to set the value of an experiment for testing purposes.
20
- * This is useful when you want to test a specific value of an experiment.
21
- */
22
- overrides) {
23
- if (overrides) {
24
- // When setting up overrides, we want to ensure that experiments don't end up with invalid
25
- // values.
26
- // For production usage -- this is done via the feature flag client which takes the type
27
- // and performs equivalent logic.
28
- // @ts-ignore
29
- overrides = Object.entries(overrides).reduce((acc, [key, value]) => {
30
- const config = editorExperimentsConfig[key];
31
- acc = {
32
- ...acc,
33
- [key]: config.typeGuard(value) ? value : config.defaultValue
34
- };
35
- return acc;
36
- }, {});
37
- _overrides = overrides;
38
- }
39
- _product = product;
40
- }
3
+ import { _overrides, _product } from './setup';
41
4
 
42
5
  /**
43
6
  * Check the value of an editor experiment.
@@ -101,6 +64,8 @@ export function editorExperiment(experimentName, expectedExperimentValue, option
101
64
  // This will be hit in the case of an experiment not being set up for the product
102
65
  return editorExperimentsConfig[experimentName].defaultValue === expectedExperimentValue;
103
66
  }
67
+
68
+ // eslint-disable-next-line @atlaskit/platform/use-recommended-utils
104
69
  const experimentValue = FeatureGates.getExperimentValue(
105
70
  // @ts-ignore
106
71
  experimentKey, experimentConfig.param, experimentConfig.defaultValue, {
@@ -0,0 +1,41 @@
1
+ import { editorExperimentsConfig } from './experiments-config';
2
+ export let _overrides = {};
3
+ export let _product;
4
+
5
+ /**
6
+ * This function is used to set up the editor experiments for testing purposes.
7
+ * It should be called before running code that depends on editor experiments.
8
+ *
9
+ * @example
10
+ * ```ts
11
+ * setupEditorExperiments('confluence', {
12
+ * 'experiment-name': 'value',
13
+ * });
14
+ * ```
15
+ */
16
+ export function setupEditorExperiments(product,
17
+ /**
18
+ * Overrides are used to set the value of an experiment for testing purposes.
19
+ * This is useful when you want to test a specific value of an experiment.
20
+ */
21
+ overrides) {
22
+ if (overrides) {
23
+ // When setting up overrides, we want to ensure that experiments don't end up with invalid
24
+ // values.
25
+ // For production usage -- this is done via the feature flag client which takes the type
26
+ // and performs equivalent logic.
27
+ // @ts-ignore
28
+ overrides = Object.entries(overrides).reduce((acc, [key, value]) => {
29
+ const config = editorExperimentsConfig[key];
30
+ if (config) {
31
+ acc = {
32
+ ...acc,
33
+ [key]: config.typeGuard(value) ? value : config.defaultValue
34
+ };
35
+ }
36
+ return acc;
37
+ }, {});
38
+ _overrides = overrides;
39
+ }
40
+ _product = product;
41
+ }
@@ -3,7 +3,7 @@ import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
3
3
  import _regeneratorRuntime from "@babel/runtime/regenerator";
4
4
  // This is loosely based on the `ffTest` util from `@atlassian/feature-flags-test-utils` package.
5
5
 
6
- import { setupEditorExperiments } from './experiments';
6
+ import { setupEditorExperiments } from './setup';
7
7
  import { editorExperimentsConfig } from './experiments-config';
8
8
 
9
9
  /**
@@ -87,5 +87,14 @@ export var editorExperimentsConfig = {
87
87
  param: 'isEnabled',
88
88
  typeGuard: isBoolean,
89
89
  defaultValue: false
90
+ },
91
+ // Added 2024-08-29
92
+ 'insert-menu-in-right-rail': {
93
+ productKeys: {
94
+ confluence: 'platform_editor_insert_menu_in_right_rail'
95
+ },
96
+ param: 'isEnabled',
97
+ typeGuard: isBoolean,
98
+ defaultValue: false
90
99
  }
91
100
  };
@@ -1,47 +1,6 @@
1
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
- import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
3
- 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; }
4
- 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; }
5
1
  import FeatureGates from '@atlaskit/feature-gate-js-client';
6
2
  import { editorExperimentsConfig } from './experiments-config';
7
- var _overrides = {};
8
- var _product;
9
-
10
- /**
11
- * This function is used to set up the editor experiments for testing purposes.
12
- * It should be called before running code that depends on editor experiments.
13
- *
14
- * @example
15
- * ```ts
16
- * setupEditorExperiments('confluence', {
17
- * 'experiment-name': 'value',
18
- * });
19
- * ```
20
- */
21
- export function setupEditorExperiments(product,
22
- /**
23
- * Overrides are used to set the value of an experiment for testing purposes.
24
- * This is useful when you want to test a specific value of an experiment.
25
- */
26
- overrides) {
27
- if (overrides) {
28
- // When setting up overrides, we want to ensure that experiments don't end up with invalid
29
- // values.
30
- // For production usage -- this is done via the feature flag client which takes the type
31
- // and performs equivalent logic.
32
- // @ts-ignore
33
- overrides = Object.entries(overrides).reduce(function (acc, _ref) {
34
- var _ref2 = _slicedToArray(_ref, 2),
35
- key = _ref2[0],
36
- value = _ref2[1];
37
- var config = editorExperimentsConfig[key];
38
- acc = _objectSpread(_objectSpread({}, acc), {}, _defineProperty({}, key, config.typeGuard(value) ? value : config.defaultValue));
39
- return acc;
40
- }, {});
41
- _overrides = overrides;
42
- }
43
- _product = product;
44
- }
3
+ import { _overrides, _product } from './setup';
45
4
 
46
5
  /**
47
6
  * Check the value of an editor experiment.
@@ -106,6 +65,8 @@ export function editorExperiment(experimentName, expectedExperimentValue) {
106
65
  // This will be hit in the case of an experiment not being set up for the product
107
66
  return editorExperimentsConfig[experimentName].defaultValue === expectedExperimentValue;
108
67
  }
68
+
69
+ // eslint-disable-next-line @atlaskit/platform/use-recommended-utils
109
70
  var experimentValue = FeatureGates.getExperimentValue(
110
71
  // @ts-ignore
111
72
  experimentKey, experimentConfig.param, experimentConfig.defaultValue, {
@@ -0,0 +1,45 @@
1
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
+ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
3
+ 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; }
4
+ 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; }
5
+ import { editorExperimentsConfig } from './experiments-config';
6
+ export var _overrides = {};
7
+ export var _product;
8
+
9
+ /**
10
+ * This function is used to set up the editor experiments for testing purposes.
11
+ * It should be called before running code that depends on editor experiments.
12
+ *
13
+ * @example
14
+ * ```ts
15
+ * setupEditorExperiments('confluence', {
16
+ * 'experiment-name': 'value',
17
+ * });
18
+ * ```
19
+ */
20
+ export function setupEditorExperiments(product,
21
+ /**
22
+ * Overrides are used to set the value of an experiment for testing purposes.
23
+ * This is useful when you want to test a specific value of an experiment.
24
+ */
25
+ overrides) {
26
+ if (overrides) {
27
+ // When setting up overrides, we want to ensure that experiments don't end up with invalid
28
+ // values.
29
+ // For production usage -- this is done via the feature flag client which takes the type
30
+ // and performs equivalent logic.
31
+ // @ts-ignore
32
+ overrides = Object.entries(overrides).reduce(function (acc, _ref) {
33
+ var _ref2 = _slicedToArray(_ref, 2),
34
+ key = _ref2[0],
35
+ value = _ref2[1];
36
+ var config = editorExperimentsConfig[key];
37
+ if (config) {
38
+ acc = _objectSpread(_objectSpread({}, acc), {}, _defineProperty({}, key, config.typeGuard(value) ? value : config.defaultValue));
39
+ }
40
+ return acc;
41
+ }, {});
42
+ _overrides = overrides;
43
+ }
44
+ _product = product;
45
+ }
@@ -1,4 +1,4 @@
1
- import { type EditorExperimentOverrides } from './experiments';
1
+ import { type EditorExperimentOverrides } from './setup';
2
2
  import { type EditorExperimentsConfig } from './experiments-config';
3
3
  /**
4
4
  * This is a utility function for testing editor experiments.
@@ -71,5 +71,13 @@ export declare const editorExperimentsConfig: {
71
71
  typeGuard: typeof isBoolean;
72
72
  defaultValue: boolean;
73
73
  };
74
+ 'insert-menu-in-right-rail': {
75
+ productKeys: {
76
+ confluence: string;
77
+ };
78
+ param: string;
79
+ typeGuard: typeof isBoolean;
80
+ defaultValue: boolean;
81
+ };
74
82
  };
75
83
  export {};
@@ -1,24 +1,4 @@
1
- import { type EditorExperimentsConfig, editorExperimentsConfig } from './experiments-config';
2
- export type EditorExperimentOverrides = Partial<{
3
- [ExperimentName in keyof typeof editorExperimentsConfig]: (typeof editorExperimentsConfig)[ExperimentName]['defaultValue'];
4
- }>;
5
- /**
6
- * This function is used to set up the editor experiments for testing purposes.
7
- * It should be called before running code that depends on editor experiments.
8
- *
9
- * @example
10
- * ```ts
11
- * setupEditorExperiments('confluence', {
12
- * 'experiment-name': 'value',
13
- * });
14
- * ```
15
- */
16
- export declare function setupEditorExperiments(product: 'confluence' | 'jira' | 'test',
17
- /**
18
- * Overrides are used to set the value of an experiment for testing purposes.
19
- * This is useful when you want to test a specific value of an experiment.
20
- */
21
- overrides?: EditorExperimentOverrides): void;
1
+ import { type EditorExperimentsConfig } from './experiments-config';
22
2
  /**
23
3
  * Check the value of an editor experiment.
24
4
  *
@@ -0,0 +1,33 @@
1
+ import { editorExperimentsConfig } from './experiments-config';
2
+ export type EditorExperimentOverrides = Partial<{
3
+ [ExperimentName in keyof typeof editorExperimentsConfig]: (typeof editorExperimentsConfig)[ExperimentName]['defaultValue'];
4
+ }>;
5
+ export declare let _overrides: Partial<{
6
+ 'example-boolean': boolean;
7
+ 'example-multivariate': "one" | "two" | "three";
8
+ 'test-new-experiments-package': boolean;
9
+ 'basic-text-transformations': boolean;
10
+ 'platform-editor-ai-condensed-floating-toobar': boolean;
11
+ 'dnd-input-performance-optimisation': boolean;
12
+ 'element-level-templates': boolean;
13
+ 'nested-dnd': boolean;
14
+ 'insert-menu-in-right-rail': boolean;
15
+ }>;
16
+ export declare let _product: 'confluence' | 'jira' | 'test' | undefined;
17
+ /**
18
+ * This function is used to set up the editor experiments for testing purposes.
19
+ * It should be called before running code that depends on editor experiments.
20
+ *
21
+ * @example
22
+ * ```ts
23
+ * setupEditorExperiments('confluence', {
24
+ * 'experiment-name': 'value',
25
+ * });
26
+ * ```
27
+ */
28
+ export declare function setupEditorExperiments(product: 'confluence' | 'jira' | 'test',
29
+ /**
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.
32
+ */
33
+ overrides?: EditorExperimentOverrides): void;
@@ -1,4 +1,4 @@
1
- import { type EditorExperimentOverrides } from './experiments';
1
+ import { type EditorExperimentOverrides } from './setup';
2
2
  import { type EditorExperimentsConfig } from './experiments-config';
3
3
  /**
4
4
  * This is a utility function for testing editor experiments.
@@ -71,5 +71,13 @@ export declare const editorExperimentsConfig: {
71
71
  typeGuard: typeof isBoolean;
72
72
  defaultValue: boolean;
73
73
  };
74
+ 'insert-menu-in-right-rail': {
75
+ productKeys: {
76
+ confluence: string;
77
+ };
78
+ param: string;
79
+ typeGuard: typeof isBoolean;
80
+ defaultValue: boolean;
81
+ };
74
82
  };
75
83
  export {};
@@ -1,24 +1,4 @@
1
- import { type EditorExperimentsConfig, editorExperimentsConfig } from './experiments-config';
2
- export type EditorExperimentOverrides = Partial<{
3
- [ExperimentName in keyof typeof editorExperimentsConfig]: (typeof editorExperimentsConfig)[ExperimentName]['defaultValue'];
4
- }>;
5
- /**
6
- * This function is used to set up the editor experiments for testing purposes.
7
- * It should be called before running code that depends on editor experiments.
8
- *
9
- * @example
10
- * ```ts
11
- * setupEditorExperiments('confluence', {
12
- * 'experiment-name': 'value',
13
- * });
14
- * ```
15
- */
16
- export declare function setupEditorExperiments(product: 'confluence' | 'jira' | 'test',
17
- /**
18
- * Overrides are used to set the value of an experiment for testing purposes.
19
- * This is useful when you want to test a specific value of an experiment.
20
- */
21
- overrides?: EditorExperimentOverrides): void;
1
+ import { type EditorExperimentsConfig } from './experiments-config';
22
2
  /**
23
3
  * Check the value of an editor experiment.
24
4
  *
@@ -0,0 +1,33 @@
1
+ import { editorExperimentsConfig } from './experiments-config';
2
+ export type EditorExperimentOverrides = Partial<{
3
+ [ExperimentName in keyof typeof editorExperimentsConfig]: (typeof editorExperimentsConfig)[ExperimentName]['defaultValue'];
4
+ }>;
5
+ export declare let _overrides: Partial<{
6
+ 'example-boolean': boolean;
7
+ 'example-multivariate': "one" | "two" | "three";
8
+ 'test-new-experiments-package': boolean;
9
+ 'basic-text-transformations': boolean;
10
+ 'platform-editor-ai-condensed-floating-toobar': boolean;
11
+ 'dnd-input-performance-optimisation': boolean;
12
+ 'element-level-templates': boolean;
13
+ 'nested-dnd': boolean;
14
+ 'insert-menu-in-right-rail': boolean;
15
+ }>;
16
+ export declare let _product: 'confluence' | 'jira' | 'test' | undefined;
17
+ /**
18
+ * This function is used to set up the editor experiments for testing purposes.
19
+ * It should be called before running code that depends on editor experiments.
20
+ *
21
+ * @example
22
+ * ```ts
23
+ * setupEditorExperiments('confluence', {
24
+ * 'experiment-name': 'value',
25
+ * });
26
+ * ```
27
+ */
28
+ export declare function setupEditorExperiments(product: 'confluence' | 'jira' | 'test',
29
+ /**
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.
32
+ */
33
+ overrides?: EditorExperimentOverrides): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/tmp-editor-statsig",
3
- "version": "1.4.1",
3
+ "version": "2.0.1",
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",
@@ -29,6 +29,7 @@
29
29
  },
30
30
  "atlaskit:src": "src/index.ts",
31
31
  "af:exports": {
32
+ "./setup": "./src/setup.ts",
32
33
  "./experiments": "./src/experiments.ts",
33
34
  "./experiments-config": "./src/experiments-config.ts",
34
35
  "./editor-experiments-test-utils": "./src/editor-experiments-test-utils.ts"
@@ -0,0 +1,14 @@
1
+ {
2
+ "name": "@atlaskit/tmp-editor-statsig/setup",
3
+ "main": "../dist/cjs/setup.js",
4
+ "module": "../dist/esm/setup.js",
5
+ "module:es2019": "../dist/es2019/setup.js",
6
+ "types": "../dist/types/setup.d.ts",
7
+ "typesVersions": {
8
+ ">=4.5 <5.4": {
9
+ "*": [
10
+ "../dist/types-ts4.5/setup.d.ts"
11
+ ]
12
+ }
13
+ }
14
+ }