@atlaskit/tmp-editor-statsig 9.27.0 → 9.28.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,13 @@
1
1
  # @atlaskit/editor-statsig-tmp
2
2
 
3
+ ## 9.28.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#200948](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/200948)
8
+ [`8dd9a944113d5`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/8dd9a944113d5) -
9
+ Introduced throttling for portals
10
+
3
11
  ## 9.27.0
4
12
 
5
13
  ### Minor Changes
@@ -0,0 +1,90 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.expVal = expVal;
8
+ exports.expValNoExposure = expValNoExposure;
9
+ var _featureGateJsClient = _interopRequireDefault(require("@atlaskit/feature-gate-js-client"));
10
+ var _experimentsConfig = require("./experiments-config");
11
+ var _setup = require("./setup");
12
+ function expValInternal(_ref) {
13
+ var _experimentConfig$pro;
14
+ var experimentName = _ref.experimentName,
15
+ experimentParam = _ref.experimentParam,
16
+ defaultValue = _ref.defaultValue,
17
+ fireExperimentExposure = _ref.fireExperimentExposure;
18
+ var experimentConfig = _experimentsConfig.editorExperimentsConfig[experimentName];
19
+ if (experimentConfig === undefined) {
20
+ // Warning! If a product is improperly configured (ie. their editor packages are misaligned)
21
+ // it can cause the editor to crash here or if the experiment does not exist.
22
+ // We will definitely crash via any code path later in this function - this just makes the error explicit and clear.
23
+ throw new Error("Editor experiment configuration is not defined ".concat(experimentName, ". Likely the experiment does not exist or editor package versions are misaligned"));
24
+ }
25
+ if (!_setup._product) {
26
+ // This will be hit in the case of a product not having setup the editor experiment tooling
27
+ return defaultValue;
28
+ }
29
+
30
+ // Typescript is complaining here about accessing the productKeys property
31
+ // Ignored via go/ees005
32
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
33
+ var experimentKey = experimentConfig === null || experimentConfig === void 0 || (_experimentConfig$pro = experimentConfig.productKeys) === null || _experimentConfig$pro === void 0 ? void 0 : _experimentConfig$pro[_setup._product];
34
+ if (!experimentKey) {
35
+ // This will be hit in the case of an experiment not being set up for the product
36
+ return defaultValue;
37
+ }
38
+
39
+ // eslint-disable-next-line @atlaskit/platform/use-recommended-utils
40
+ var experimentValue = _featureGateJsClient.default.getExperimentValue(experimentName, experimentParam, defaultValue, {
41
+ fireExperimentExposure: fireExperimentExposure
42
+ });
43
+ return experimentValue;
44
+ }
45
+
46
+ /**
47
+ * Use to check a any param value for an experiment
48
+ *
49
+ * **Note**: this will return the default value when the experiment;
50
+ * - is not being served to the client (ie. pre start)
51
+ * - or is not configured in experiments-config
52
+ *
53
+ * If you need to check a param value without an exposure check see {@link expParamEqualsNoExposure}
54
+ *
55
+ * @example
56
+ * ```ts
57
+ * const delay = expParamEquals('experiment-name', 'param-name', defaultValue)
58
+ * await new Promise(res => setTimeout(res, delay)
59
+ * ```
60
+ */
61
+ function expVal(experimentName, experimentParam, defaultValue) {
62
+ return expValInternal({
63
+ experimentName: experimentName,
64
+ experimentParam: experimentParam,
65
+ defaultValue: defaultValue,
66
+ fireExperimentExposure: true
67
+ });
68
+ }
69
+
70
+ /**
71
+ * Use to check a any param value for an experiment without firing an exposure event
72
+ *
73
+ * **Note**: this will return the default value when the experiment;
74
+ * - is not being served to the client (ie. pre start)
75
+ * - or is not configured in experiments-config
76
+ *
77
+ * @example
78
+ * ```ts
79
+ * const delay = expParamEqualsNoExposure('experiment-name', 'param-name', defaultValue)
80
+ * await new Promise(res => setTimeout(res, delay)
81
+ * ```
82
+ */
83
+ function expValNoExposure(experimentName, experimentParam, defaultValue) {
84
+ return expValInternal({
85
+ experimentName: experimentName,
86
+ experimentParam: experimentParam,
87
+ defaultValue: defaultValue,
88
+ fireExperimentExposure: false
89
+ });
90
+ }
@@ -359,6 +359,14 @@ var editorExperimentsConfig = exports.editorExperimentsConfig = {
359
359
  param: 'isEnabled',
360
360
  defaultValue: false
361
361
  }),
362
+ // Added 2025-07-14
363
+ platform_editor_debounce_portal_provider: (0, _experimentBuilders.createBooleanExperiment)({
364
+ productKeys: {
365
+ confluence: 'platform_editor_debounce_portal_provider'
366
+ },
367
+ param: 'isEnabled',
368
+ defaultValue: false
369
+ }),
362
370
  // Added 2025-07-08 - Jira work sync description comment summary
363
371
  'jira-work-sync-desc-comment-summary': (0, _experimentBuilders.createBooleanExperiment)({
364
372
  productKeys: {
@@ -652,6 +660,14 @@ var editorExperimentsConfig = exports.editorExperimentsConfig = {
652
660
  param: 'isEnabled',
653
661
  defaultValue: false
654
662
  }),
663
+ // Added 2025-08-06
664
+ cc_editor_limited_mode: (0, _experimentBuilders.createBooleanExperiment)({
665
+ productKeys: {
666
+ confluence: 'cc_editor_limited_mode'
667
+ },
668
+ param: 'isEnabled',
669
+ defaultValue: false
670
+ }),
655
671
  // Added 2025-08-05
656
672
  platform_editor_tables_scaling_css: (0, _experimentBuilders.createBooleanExperiment)({
657
673
  productKeys: {
@@ -0,0 +1,83 @@
1
+ import FeatureGates from '@atlaskit/feature-gate-js-client';
2
+ import { editorExperimentsConfig } from './experiments-config';
3
+ import { _product } from './setup';
4
+ function expValInternal({
5
+ experimentName,
6
+ experimentParam,
7
+ defaultValue,
8
+ fireExperimentExposure
9
+ }) {
10
+ var _experimentConfig$pro;
11
+ const experimentConfig = editorExperimentsConfig[experimentName];
12
+ if (experimentConfig === undefined) {
13
+ // Warning! If a product is improperly configured (ie. their editor packages are misaligned)
14
+ // it can cause the editor to crash here or if the experiment does not exist.
15
+ // We will definitely crash via any code path later in this function - this just makes the error explicit and clear.
16
+ throw new Error(`Editor experiment configuration is not defined ${experimentName}. Likely the experiment does not exist or editor package versions are misaligned`);
17
+ }
18
+ if (!_product) {
19
+ // This will be hit in the case of a product not having setup the editor experiment tooling
20
+ return defaultValue;
21
+ }
22
+
23
+ // Typescript is complaining here about accessing the productKeys property
24
+ // Ignored via go/ees005
25
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
26
+ const experimentKey = experimentConfig === null || experimentConfig === void 0 ? void 0 : (_experimentConfig$pro = experimentConfig.productKeys) === null || _experimentConfig$pro === void 0 ? void 0 : _experimentConfig$pro[_product];
27
+ if (!experimentKey) {
28
+ // This will be hit in the case of an experiment not being set up for the product
29
+ return defaultValue;
30
+ }
31
+
32
+ // eslint-disable-next-line @atlaskit/platform/use-recommended-utils
33
+ const experimentValue = FeatureGates.getExperimentValue(experimentName, experimentParam, defaultValue, {
34
+ fireExperimentExposure: fireExperimentExposure
35
+ });
36
+ return experimentValue;
37
+ }
38
+
39
+ /**
40
+ * Use to check a any param value for an experiment
41
+ *
42
+ * **Note**: this will return the default value when the experiment;
43
+ * - is not being served to the client (ie. pre start)
44
+ * - or is not configured in experiments-config
45
+ *
46
+ * If you need to check a param value without an exposure check see {@link expParamEqualsNoExposure}
47
+ *
48
+ * @example
49
+ * ```ts
50
+ * const delay = expParamEquals('experiment-name', 'param-name', defaultValue)
51
+ * await new Promise(res => setTimeout(res, delay)
52
+ * ```
53
+ */
54
+ export function expVal(experimentName, experimentParam, defaultValue) {
55
+ return expValInternal({
56
+ experimentName,
57
+ experimentParam,
58
+ defaultValue,
59
+ fireExperimentExposure: true
60
+ });
61
+ }
62
+
63
+ /**
64
+ * Use to check a any param value for an experiment without firing an exposure event
65
+ *
66
+ * **Note**: this will return the default value when the experiment;
67
+ * - is not being served to the client (ie. pre start)
68
+ * - or is not configured in experiments-config
69
+ *
70
+ * @example
71
+ * ```ts
72
+ * const delay = expParamEqualsNoExposure('experiment-name', 'param-name', defaultValue)
73
+ * await new Promise(res => setTimeout(res, delay)
74
+ * ```
75
+ */
76
+ export function expValNoExposure(experimentName, experimentParam, defaultValue) {
77
+ return expValInternal({
78
+ experimentName,
79
+ experimentParam,
80
+ defaultValue,
81
+ fireExperimentExposure: false
82
+ });
83
+ }
@@ -353,6 +353,14 @@ export const editorExperimentsConfig = {
353
353
  param: 'isEnabled',
354
354
  defaultValue: false
355
355
  }),
356
+ // Added 2025-07-14
357
+ platform_editor_debounce_portal_provider: createBooleanExperiment({
358
+ productKeys: {
359
+ confluence: 'platform_editor_debounce_portal_provider'
360
+ },
361
+ param: 'isEnabled',
362
+ defaultValue: false
363
+ }),
356
364
  // Added 2025-07-08 - Jira work sync description comment summary
357
365
  'jira-work-sync-desc-comment-summary': createBooleanExperiment({
358
366
  productKeys: {
@@ -646,6 +654,14 @@ export const editorExperimentsConfig = {
646
654
  param: 'isEnabled',
647
655
  defaultValue: false
648
656
  }),
657
+ // Added 2025-08-06
658
+ cc_editor_limited_mode: createBooleanExperiment({
659
+ productKeys: {
660
+ confluence: 'cc_editor_limited_mode'
661
+ },
662
+ param: 'isEnabled',
663
+ defaultValue: false
664
+ }),
649
665
  // Added 2025-08-05
650
666
  platform_editor_tables_scaling_css: createBooleanExperiment({
651
667
  productKeys: {
@@ -0,0 +1,82 @@
1
+ import FeatureGates from '@atlaskit/feature-gate-js-client';
2
+ import { editorExperimentsConfig } from './experiments-config';
3
+ import { _product } from './setup';
4
+ function expValInternal(_ref) {
5
+ var _experimentConfig$pro;
6
+ var experimentName = _ref.experimentName,
7
+ experimentParam = _ref.experimentParam,
8
+ defaultValue = _ref.defaultValue,
9
+ fireExperimentExposure = _ref.fireExperimentExposure;
10
+ var experimentConfig = editorExperimentsConfig[experimentName];
11
+ if (experimentConfig === undefined) {
12
+ // Warning! If a product is improperly configured (ie. their editor packages are misaligned)
13
+ // it can cause the editor to crash here or if the experiment does not exist.
14
+ // We will definitely crash via any code path later in this function - this just makes the error explicit and clear.
15
+ throw new Error("Editor experiment configuration is not defined ".concat(experimentName, ". Likely the experiment does not exist or editor package versions are misaligned"));
16
+ }
17
+ if (!_product) {
18
+ // This will be hit in the case of a product not having setup the editor experiment tooling
19
+ return defaultValue;
20
+ }
21
+
22
+ // Typescript is complaining here about accessing the productKeys property
23
+ // Ignored via go/ees005
24
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
25
+ var experimentKey = experimentConfig === null || experimentConfig === void 0 || (_experimentConfig$pro = experimentConfig.productKeys) === null || _experimentConfig$pro === void 0 ? void 0 : _experimentConfig$pro[_product];
26
+ if (!experimentKey) {
27
+ // This will be hit in the case of an experiment not being set up for the product
28
+ return defaultValue;
29
+ }
30
+
31
+ // eslint-disable-next-line @atlaskit/platform/use-recommended-utils
32
+ var experimentValue = FeatureGates.getExperimentValue(experimentName, experimentParam, defaultValue, {
33
+ fireExperimentExposure: fireExperimentExposure
34
+ });
35
+ return experimentValue;
36
+ }
37
+
38
+ /**
39
+ * Use to check a any param value for an experiment
40
+ *
41
+ * **Note**: this will return the default value when the experiment;
42
+ * - is not being served to the client (ie. pre start)
43
+ * - or is not configured in experiments-config
44
+ *
45
+ * If you need to check a param value without an exposure check see {@link expParamEqualsNoExposure}
46
+ *
47
+ * @example
48
+ * ```ts
49
+ * const delay = expParamEquals('experiment-name', 'param-name', defaultValue)
50
+ * await new Promise(res => setTimeout(res, delay)
51
+ * ```
52
+ */
53
+ export function expVal(experimentName, experimentParam, defaultValue) {
54
+ return expValInternal({
55
+ experimentName: experimentName,
56
+ experimentParam: experimentParam,
57
+ defaultValue: defaultValue,
58
+ fireExperimentExposure: true
59
+ });
60
+ }
61
+
62
+ /**
63
+ * Use to check a any param value for an experiment without firing an exposure event
64
+ *
65
+ * **Note**: this will return the default value when the experiment;
66
+ * - is not being served to the client (ie. pre start)
67
+ * - or is not configured in experiments-config
68
+ *
69
+ * @example
70
+ * ```ts
71
+ * const delay = expParamEqualsNoExposure('experiment-name', 'param-name', defaultValue)
72
+ * await new Promise(res => setTimeout(res, delay)
73
+ * ```
74
+ */
75
+ export function expValNoExposure(experimentName, experimentParam, defaultValue) {
76
+ return expValInternal({
77
+ experimentName: experimentName,
78
+ experimentParam: experimentParam,
79
+ defaultValue: defaultValue,
80
+ fireExperimentExposure: false
81
+ });
82
+ }
@@ -353,6 +353,14 @@ export var editorExperimentsConfig = {
353
353
  param: 'isEnabled',
354
354
  defaultValue: false
355
355
  }),
356
+ // Added 2025-07-14
357
+ platform_editor_debounce_portal_provider: createBooleanExperiment({
358
+ productKeys: {
359
+ confluence: 'platform_editor_debounce_portal_provider'
360
+ },
361
+ param: 'isEnabled',
362
+ defaultValue: false
363
+ }),
356
364
  // Added 2025-07-08 - Jira work sync description comment summary
357
365
  'jira-work-sync-desc-comment-summary': createBooleanExperiment({
358
366
  productKeys: {
@@ -646,6 +654,14 @@ export var editorExperimentsConfig = {
646
654
  param: 'isEnabled',
647
655
  defaultValue: false
648
656
  }),
657
+ // Added 2025-08-06
658
+ cc_editor_limited_mode: createBooleanExperiment({
659
+ productKeys: {
660
+ confluence: 'cc_editor_limited_mode'
661
+ },
662
+ param: 'isEnabled',
663
+ defaultValue: false
664
+ }),
649
665
  // Added 2025-08-05
650
666
  platform_editor_tables_scaling_css: createBooleanExperiment({
651
667
  productKeys: {
@@ -0,0 +1,31 @@
1
+ import { type EditorExperimentsConfig } from './experiments-config';
2
+ /**
3
+ * Use to check a any param value for an experiment
4
+ *
5
+ * **Note**: this will return the default value when the experiment;
6
+ * - is not being served to the client (ie. pre start)
7
+ * - or is not configured in experiments-config
8
+ *
9
+ * If you need to check a param value without an exposure check see {@link expParamEqualsNoExposure}
10
+ *
11
+ * @example
12
+ * ```ts
13
+ * const delay = expParamEquals('experiment-name', 'param-name', defaultValue)
14
+ * await new Promise(res => setTimeout(res, delay)
15
+ * ```
16
+ */
17
+ export declare function expVal<ExperimentName extends keyof EditorExperimentsConfig, DefaultValue extends string | number | boolean>(experimentName: ExperimentName, experimentParam: string, defaultValue: DefaultValue): DefaultValue;
18
+ /**
19
+ * Use to check a any param value for an experiment without firing an exposure event
20
+ *
21
+ * **Note**: this will return the default value when the experiment;
22
+ * - is not being served to the client (ie. pre start)
23
+ * - or is not configured in experiments-config
24
+ *
25
+ * @example
26
+ * ```ts
27
+ * const delay = expParamEqualsNoExposure('experiment-name', 'param-name', defaultValue)
28
+ * await new Promise(res => setTimeout(res, delay)
29
+ * ```
30
+ */
31
+ export declare function expValNoExposure<ExperimentName extends keyof EditorExperimentsConfig, DefaultValue extends string | number | boolean>(experimentName: ExperimentName, experimentParam: string, defaultValue: DefaultValue): DefaultValue;
@@ -263,6 +263,12 @@ export declare const editorExperimentsConfig: {
263
263
  productKeys?: import("./types").ProductKeys;
264
264
  param: string;
265
265
  };
266
+ platform_editor_debounce_portal_provider: {
267
+ typeGuard: typeof import("./type-guards").isBoolean;
268
+ defaultValue: boolean;
269
+ productKeys?: import("./types").ProductKeys;
270
+ param: string;
271
+ };
266
272
  'jira-work-sync-desc-comment-summary': {
267
273
  typeGuard: typeof import("./type-guards").isBoolean;
268
274
  defaultValue: boolean;
@@ -483,6 +489,12 @@ export declare const editorExperimentsConfig: {
483
489
  productKeys?: import("./types").ProductKeys;
484
490
  param: string;
485
491
  };
492
+ cc_editor_limited_mode: {
493
+ typeGuard: typeof import("./type-guards").isBoolean;
494
+ defaultValue: boolean;
495
+ productKeys?: import("./types").ProductKeys;
496
+ param: string;
497
+ };
486
498
  platform_editor_tables_scaling_css: {
487
499
  typeGuard: typeof import("./type-guards").isBoolean;
488
500
  defaultValue: boolean;
@@ -0,0 +1,31 @@
1
+ import { type EditorExperimentsConfig } from './experiments-config';
2
+ /**
3
+ * Use to check a any param value for an experiment
4
+ *
5
+ * **Note**: this will return the default value when the experiment;
6
+ * - is not being served to the client (ie. pre start)
7
+ * - or is not configured in experiments-config
8
+ *
9
+ * If you need to check a param value without an exposure check see {@link expParamEqualsNoExposure}
10
+ *
11
+ * @example
12
+ * ```ts
13
+ * const delay = expParamEquals('experiment-name', 'param-name', defaultValue)
14
+ * await new Promise(res => setTimeout(res, delay)
15
+ * ```
16
+ */
17
+ export declare function expVal<ExperimentName extends keyof EditorExperimentsConfig, DefaultValue extends string | number | boolean>(experimentName: ExperimentName, experimentParam: string, defaultValue: DefaultValue): DefaultValue;
18
+ /**
19
+ * Use to check a any param value for an experiment without firing an exposure event
20
+ *
21
+ * **Note**: this will return the default value when the experiment;
22
+ * - is not being served to the client (ie. pre start)
23
+ * - or is not configured in experiments-config
24
+ *
25
+ * @example
26
+ * ```ts
27
+ * const delay = expParamEqualsNoExposure('experiment-name', 'param-name', defaultValue)
28
+ * await new Promise(res => setTimeout(res, delay)
29
+ * ```
30
+ */
31
+ export declare function expValNoExposure<ExperimentName extends keyof EditorExperimentsConfig, DefaultValue extends string | number | boolean>(experimentName: ExperimentName, experimentParam: string, defaultValue: DefaultValue): DefaultValue;
@@ -263,6 +263,12 @@ export declare const editorExperimentsConfig: {
263
263
  productKeys?: import("./types").ProductKeys;
264
264
  param: string;
265
265
  };
266
+ platform_editor_debounce_portal_provider: {
267
+ typeGuard: typeof import("./type-guards").isBoolean;
268
+ defaultValue: boolean;
269
+ productKeys?: import("./types").ProductKeys;
270
+ param: string;
271
+ };
266
272
  'jira-work-sync-desc-comment-summary': {
267
273
  typeGuard: typeof import("./type-guards").isBoolean;
268
274
  defaultValue: boolean;
@@ -483,6 +489,12 @@ export declare const editorExperimentsConfig: {
483
489
  productKeys?: import("./types").ProductKeys;
484
490
  param: string;
485
491
  };
492
+ cc_editor_limited_mode: {
493
+ typeGuard: typeof import("./type-guards").isBoolean;
494
+ defaultValue: boolean;
495
+ productKeys?: import("./types").ProductKeys;
496
+ param: string;
497
+ };
486
498
  platform_editor_tables_scaling_css: {
487
499
  typeGuard: typeof import("./type-guards").isBoolean;
488
500
  defaultValue: boolean;
@@ -0,0 +1,14 @@
1
+ {
2
+ "name": "@atlaskit/tmp-editor-statsig/expVal",
3
+ "main": "../dist/cjs/expVal.js",
4
+ "module": "../dist/esm/expVal.js",
5
+ "module:es2019": "../dist/es2019/expVal.js",
6
+ "types": "../dist/types/expVal.d.ts",
7
+ "typesVersions": {
8
+ ">=4.5 <5.4": {
9
+ "*": [
10
+ "../dist/types-ts4.5/expVal.d.ts"
11
+ ]
12
+ }
13
+ }
14
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/tmp-editor-statsig",
3
- "version": "9.27.0",
3
+ "version": "9.28.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",
@@ -36,6 +36,7 @@
36
36
  "./experiments": "./src/experiments.ts",
37
37
  "./experiments-config": "./src/experiments-config.ts",
38
38
  "./editor-experiments-test-utils": "./src/editor-experiments-test-utils.ts",
39
+ "./expVal": "./src/expVal.ts",
39
40
  "./exp-val-equals": "./src/exp-val-equals.ts",
40
41
  "./exp-val-equals-no-exposure": "./src/exp-val-equals-no-exposure.ts"
41
42
  },