@atlaskit/tmp-editor-statsig 2.38.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 +9 -0
- package/dist/cjs/experiments-config.js +18 -0
- package/dist/cjs/experiments.js +25 -0
- package/dist/cjs/setup.js +16 -7
- package/dist/es2019/experiments-config.js +18 -0
- package/dist/es2019/experiments.js +25 -1
- package/dist/es2019/setup.js +15 -6
- package/dist/esm/experiments-config.js +18 -0
- package/dist/esm/experiments.js +25 -1
- package/dist/esm/setup.js +15 -6
- package/dist/types/editor-experiments-test-utils.d.ts +17 -1
- package/dist/types/experiments-config.d.ts +16 -0
- package/dist/types/experiments.d.ts +19 -0
- package/dist/types/setup.d.ts +16 -3
- package/dist/types-ts4.5/editor-experiments-test-utils.d.ts +17 -1
- package/dist/types-ts4.5/experiments-config.d.ts +16 -0
- package/dist/types-ts4.5/experiments.d.ts +19 -0
- package/dist/types-ts4.5/setup.d.ts +16 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
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
|
+
|
|
3
12
|
## 2.38.0
|
|
4
13
|
|
|
5
14
|
### Minor Changes
|
|
@@ -301,5 +301,23 @@ var editorExperimentsConfig = exports.editorExperimentsConfig = {
|
|
|
301
301
|
param: 'isEnabled',
|
|
302
302
|
typeGuard: _typeGuards.isBoolean,
|
|
303
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'
|
|
304
322
|
}
|
|
305
323
|
};
|
package/dist/cjs/experiments.js
CHANGED
|
@@ -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
|
|
31
|
-
* This is useful when you want to test a specific
|
|
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
|
-
|
|
34
|
-
|
|
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
|
-
|
|
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 =
|
|
56
|
+
exports._overrides = _overrides = groupOverrides;
|
|
51
57
|
}
|
|
52
58
|
exports._product = _product = product;
|
|
59
|
+
if (paramOverrides) {
|
|
60
|
+
exports._paramOverrides = _paramOverrides = paramOverrides;
|
|
61
|
+
}
|
|
53
62
|
}
|
|
@@ -295,5 +295,23 @@ export const editorExperimentsConfig = {
|
|
|
295
295
|
param: 'isEnabled',
|
|
296
296
|
typeGuard: isBoolean,
|
|
297
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'
|
|
298
316
|
}
|
|
299
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
|
}
|
package/dist/es2019/setup.js
CHANGED
|
@@ -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
|
|
22
|
-
* This is useful when you want to test a specific
|
|
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
|
-
|
|
25
|
-
|
|
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
|
-
|
|
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 =
|
|
47
|
+
_overrides = groupOverrides;
|
|
42
48
|
}
|
|
43
49
|
_product = product;
|
|
50
|
+
if (paramOverrides) {
|
|
51
|
+
_paramOverrides = paramOverrides;
|
|
52
|
+
}
|
|
44
53
|
}
|
|
@@ -295,5 +295,23 @@ export var editorExperimentsConfig = {
|
|
|
295
295
|
param: 'isEnabled',
|
|
296
296
|
typeGuard: isBoolean,
|
|
297
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'
|
|
298
316
|
}
|
|
299
317
|
};
|
package/dist/esm/experiments.js
CHANGED
|
@@ -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
|
|
26
|
-
* This is useful when you want to test a specific
|
|
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
|
-
|
|
29
|
-
|
|
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
|
-
|
|
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 =
|
|
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" | "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">(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: {
|
|
@@ -296,6 +296,22 @@ declare namespace eeTest {
|
|
|
296
296
|
typeGuard: typeof import("./type-guards").isBoolean;
|
|
297
297
|
defaultValue: boolean;
|
|
298
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
|
+
};
|
|
299
315
|
}[ExperimentName]["defaultValue"], describeBody: jest.EmptyFunction) => void;
|
|
300
316
|
each: (describeBody: jest.EmptyFunction) => void;
|
|
301
317
|
};
|
|
@@ -255,4 +255,20 @@ export declare const editorExperimentsConfig: {
|
|
|
255
255
|
typeGuard: typeof isBoolean;
|
|
256
256
|
defaultValue: boolean;
|
|
257
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
|
+
};
|
|
258
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 {};
|
package/dist/types/setup.d.ts
CHANGED
|
@@ -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";
|
|
@@ -34,7 +39,10 @@ export declare let _overrides: Partial<{
|
|
|
34
39
|
platform_editor_blockquote_in_text_formatting_menu: boolean;
|
|
35
40
|
platform_editor_advanced_code_blocks: boolean;
|
|
36
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";
|
|
37
44
|
}>;
|
|
45
|
+
export declare let _paramOverrides: EditorExperimentParamOverrides;
|
|
38
46
|
export declare let _product: 'confluence' | 'jira' | 'test' | undefined;
|
|
39
47
|
/**
|
|
40
48
|
* This function is used to set up the editor experiments for testing purposes.
|
|
@@ -49,7 +57,12 @@ export declare let _product: 'confluence' | 'jira' | 'test' | undefined;
|
|
|
49
57
|
*/
|
|
50
58
|
export declare function setupEditorExperiments(product: 'confluence' | 'jira' | 'test',
|
|
51
59
|
/**
|
|
52
|
-
* Overrides are used to set the
|
|
53
|
-
* This is useful when you want to test a specific
|
|
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.
|
|
54
62
|
*/
|
|
55
|
-
|
|
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" | "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">(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: {
|
|
@@ -296,6 +296,22 @@ declare namespace eeTest {
|
|
|
296
296
|
typeGuard: typeof import("./type-guards").isBoolean;
|
|
297
297
|
defaultValue: boolean;
|
|
298
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
|
+
};
|
|
299
315
|
}[ExperimentName]["defaultValue"], describeBody: jest.EmptyFunction) => void;
|
|
300
316
|
each: (describeBody: jest.EmptyFunction) => void;
|
|
301
317
|
};
|
|
@@ -255,4 +255,20 @@ export declare const editorExperimentsConfig: {
|
|
|
255
255
|
typeGuard: typeof isBoolean;
|
|
256
256
|
defaultValue: boolean;
|
|
257
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
|
+
};
|
|
258
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";
|
|
@@ -34,7 +39,10 @@ export declare let _overrides: Partial<{
|
|
|
34
39
|
platform_editor_blockquote_in_text_formatting_menu: boolean;
|
|
35
40
|
platform_editor_advanced_code_blocks: boolean;
|
|
36
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";
|
|
37
44
|
}>;
|
|
45
|
+
export declare let _paramOverrides: EditorExperimentParamOverrides;
|
|
38
46
|
export declare let _product: 'confluence' | 'jira' | 'test' | undefined;
|
|
39
47
|
/**
|
|
40
48
|
* This function is used to set up the editor experiments for testing purposes.
|
|
@@ -49,7 +57,12 @@ export declare let _product: 'confluence' | 'jira' | 'test' | undefined;
|
|
|
49
57
|
*/
|
|
50
58
|
export declare function setupEditorExperiments(product: 'confluence' | 'jira' | 'test',
|
|
51
59
|
/**
|
|
52
|
-
* Overrides are used to set the
|
|
53
|
-
* This is useful when you want to test a specific
|
|
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.
|
|
54
62
|
*/
|
|
55
|
-
|
|
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