@atlaskit/ads-mcp 1.3.1 → 1.4.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 +14 -0
- package/compass.yml +38 -0
- package/dist/cjs/tools/get-all-components/components.codegen.js +2 -2
- package/dist/cjs/tools/get-atlaskit-components/atlaskit-components.codegen.js +3 -3625
- package/dist/cjs/tools/get-atlaskit-hooks/atlaskit-hooks.codegen.js +101 -33
- package/dist/cjs/tools/get-atlaskit-utilities/atlaskit-utilities.codegen.js +304 -436
- package/dist/cjs/tools/get-guidelines/guidelines-structured-content.codegen.js +4 -7
- package/dist/cjs/tools/get-lint-rules/lint-rules-structured-content.codegen.js +2 -6
- package/dist/es2019/tools/get-all-components/components.codegen.js +2 -2
- package/dist/es2019/tools/get-atlaskit-components/atlaskit-components.codegen.js +2 -3618
- package/dist/es2019/tools/get-atlaskit-hooks/atlaskit-hooks.codegen.js +101 -33
- package/dist/es2019/tools/get-atlaskit-utilities/atlaskit-utilities.codegen.js +304 -436
- package/dist/es2019/tools/get-guidelines/guidelines-structured-content.codegen.js +4 -7
- package/dist/es2019/tools/get-lint-rules/lint-rules-structured-content.codegen.js +2 -6
- package/dist/esm/tools/get-all-components/components.codegen.js +2 -2
- package/dist/esm/tools/get-atlaskit-components/atlaskit-components.codegen.js +2 -3618
- package/dist/esm/tools/get-atlaskit-hooks/atlaskit-hooks.codegen.js +101 -33
- package/dist/esm/tools/get-atlaskit-utilities/atlaskit-utilities.codegen.js +304 -436
- package/dist/esm/tools/get-guidelines/guidelines-structured-content.codegen.js +4 -7
- package/dist/esm/tools/get-lint-rules/lint-rules-structured-content.codegen.js +2 -6
- package/dist/types/tools/get-all-components/components.codegen.d.ts +1 -1
- package/dist/types/tools/get-atlaskit-components/atlaskit-components.codegen.d.ts +1 -1
- package/dist/types/tools/get-atlaskit-hooks/atlaskit-hooks.codegen.d.ts +1 -1
- package/dist/types/tools/get-atlaskit-utilities/atlaskit-utilities.codegen.d.ts +1 -1
- package/dist/types/tools/get-guidelines/guidelines-structured-content.codegen.d.ts +1 -1
- package/dist/types/tools/get-lint-rules/lint-rules-structured-content.codegen.d.ts +1 -1
- package/dist/types/tools/types.d.ts +14 -0
- package/package.json +2 -2
|
@@ -9,7 +9,7 @@ exports.atlaskitUtilities = void 0;
|
|
|
9
9
|
*
|
|
10
10
|
* Structured content utilities from design-system *.docs.tsx files
|
|
11
11
|
*
|
|
12
|
-
* @codegen <<SignedSource::
|
|
12
|
+
* @codegen <<SignedSource::967196502e12df47cd3e9e9a05dcdaea>>
|
|
13
13
|
* @codegenCommand yarn workspace @af/ads-ai-tooling codegen:atlaskit-utilities
|
|
14
14
|
*/
|
|
15
15
|
/* eslint-disable @repo/internal/react/boolean-prop-naming-convention -- not our types */
|
|
@@ -35,108 +35,346 @@ var atlaskitUtilities = exports.atlaskitUtilities = [{
|
|
|
35
35
|
examples: [],
|
|
36
36
|
kind: 'function'
|
|
37
37
|
}, {
|
|
38
|
-
name: '
|
|
39
|
-
description: '
|
|
38
|
+
name: 'autoA11yCheck',
|
|
39
|
+
description: 'Runs the `@sa11y/jest` audit against the current document after each `it()` block. Wired into the design-system jest setup, so every component test gets a free a11y pass without per-test boilerplate.',
|
|
40
|
+
status: 'general-availability',
|
|
41
|
+
usageGuidelines: ["Already registered globally for `packages/design-system/*` tests — you typically should not call this directly. If a package is intentionally excluded (see `ignorePackages` in `scan-document.tsx`), opt back in by importing this and registering it in that package's jest setup.", 'If a single test must skip the audit (long-running snapshot tests, intentional violations under review), use `skipA11yAudit()` inside that test rather than disabling the whole hook.'],
|
|
42
|
+
keywords: ['accessibility', 'a11y', 'autoA11yCheck', 'sa11y', 'jest', 'testing'],
|
|
43
|
+
category: 'testing',
|
|
44
|
+
package: '@af/accessibility-testing',
|
|
45
|
+
examples: [],
|
|
46
|
+
kind: 'function',
|
|
47
|
+
signature: '() => void'
|
|
48
|
+
}, {
|
|
49
|
+
name: 'axe',
|
|
50
|
+
description: 'Pre-configured wrapper around `jest-axe` that runs against either a provided element/HTML string or `document.body.innerHTML` by default. Asserts no violations via `expect(...).toHaveNoViolations()` and returns the full axe results.',
|
|
40
51
|
status: 'general-availability',
|
|
41
|
-
usageGuidelines: ['
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
package: '@atlaskit/pragmatic-drag-and-drop-live-region',
|
|
52
|
+
usageGuidelines: ['Reach for `axe()` inside a specific test (e.g. after rendering a component variant) when you need a one-off accessibility assertion. For repo-wide enforcement, prefer `autoA11yCheck()`, which runs as part of the existing test lifecycle.', "Pass the rendered component's container rather than the whole document when possible — it keeps the audit scope tight and the error output readable."],
|
|
53
|
+
keywords: ['accessibility', 'a11y', 'axe', 'jest-axe', 'testing'],
|
|
54
|
+
category: 'testing',
|
|
55
|
+
package: '@af/accessibility-testing',
|
|
46
56
|
examples: [],
|
|
47
57
|
kind: 'function',
|
|
48
58
|
parameters: [{
|
|
49
|
-
name: '
|
|
50
|
-
type: 'string',
|
|
51
|
-
description: '
|
|
59
|
+
name: 'html',
|
|
60
|
+
type: 'Element | string',
|
|
61
|
+
description: 'DOM element or HTML string to audit. Omit to scan `document.body.innerHTML` (the `region` rule is disabled in that case because most jest fixtures lack landmark roles).',
|
|
62
|
+
isOptional: true
|
|
63
|
+
}, {
|
|
64
|
+
name: 'options',
|
|
65
|
+
type: 'JestAxeConfigureOptions',
|
|
66
|
+
description: 'Axe configuration overrides merged on top of the design-system defaults.',
|
|
67
|
+
isOptional: true
|
|
52
68
|
}],
|
|
53
69
|
returns: {
|
|
54
|
-
type: '
|
|
70
|
+
type: 'Promise<AxeResults>',
|
|
71
|
+
description: 'Resolves with the full axe results once the no-violations assertion passes.'
|
|
55
72
|
},
|
|
56
|
-
signature: '(
|
|
73
|
+
signature: '(html?: Element | string, options?: JestAxeConfigureOptions) => Promise<AxeResults>'
|
|
74
|
+
}, {
|
|
75
|
+
name: 'resetA11yAuditSkip',
|
|
76
|
+
description: 'Clears the per-test skip flag set by `skipA11yAudit()`. Called automatically by the test setup so consumers rarely invoke this directly.',
|
|
77
|
+
status: 'general-availability',
|
|
78
|
+
usageGuidelines: ['Only call this manually if you are running a custom jest harness that does not already invoke `autoA11yCheck()`.'],
|
|
79
|
+
keywords: ['accessibility', 'a11y', 'resetA11yAuditSkip', 'jest', 'testing'],
|
|
80
|
+
category: 'testing',
|
|
81
|
+
package: '@af/accessibility-testing',
|
|
82
|
+
examples: [],
|
|
83
|
+
kind: 'function',
|
|
84
|
+
signature: '() => void'
|
|
85
|
+
}, {
|
|
86
|
+
name: 'shouldSkipA11yTest',
|
|
87
|
+
description: 'Returns true when the current jest test path falls under a package that is excluded from automatic auditing (e.g. tooling-only packages with no React surface).',
|
|
88
|
+
status: 'general-availability',
|
|
89
|
+
usageGuidelines: ['Used internally by `autoA11yCheck()`. Consumers typically should not call this directly — surface a skip via `skipA11yAudit()` instead.'],
|
|
90
|
+
keywords: ['accessibility', 'a11y', 'shouldSkipA11yTest', 'jest', 'testing'],
|
|
91
|
+
category: 'testing',
|
|
92
|
+
package: '@af/accessibility-testing',
|
|
93
|
+
examples: [],
|
|
94
|
+
kind: 'function',
|
|
95
|
+
signature: '() => boolean'
|
|
96
|
+
}, {
|
|
97
|
+
name: 'skipA11yAudit',
|
|
98
|
+
description: 'Marks the current test so that `autoA11yCheck()` skips its audit. The skip is one-shot — it is cleared by `resetA11yAuditSkip()` between tests.',
|
|
99
|
+
status: 'general-availability',
|
|
100
|
+
usageGuidelines: ['Use sparingly. Prefer fixing the violation, or scoping the test to a smaller fixture, before reaching for a skip.', 'Always leave a comment next to the call explaining why the audit is skipped (e.g. tracked violation link or external library limitation).'],
|
|
101
|
+
keywords: ['accessibility', 'a11y', 'skipA11yAudit', 'jest', 'testing'],
|
|
102
|
+
category: 'testing',
|
|
103
|
+
package: '@af/accessibility-testing',
|
|
104
|
+
examples: [],
|
|
105
|
+
kind: 'function',
|
|
106
|
+
signature: '() => void'
|
|
107
|
+
}, {
|
|
108
|
+
name: 'getSuspenseResource',
|
|
109
|
+
description: 'Creates a one-shot Suspense resource: `read()` throws a pending promise until the matching `load().complete()` or `load().fail()` is called. Use to drive a component into and out of a Suspense fallback inside a test.',
|
|
110
|
+
status: 'general-availability',
|
|
111
|
+
usageGuidelines: ['Create a fresh resource per test — the internal state machine is one-shot and asserts when `load()` is called twice.', 'Always await `complete()` / `fail()` before making assertions about the post-fallback UI, otherwise React will not have committed the updated tree.'],
|
|
112
|
+
keywords: ['testing', 'suspense', 'react', 'getSuspenseResource'],
|
|
113
|
+
category: 'testing',
|
|
114
|
+
package: '@af/react-unit-testing',
|
|
115
|
+
examples: [],
|
|
116
|
+
kind: 'function',
|
|
117
|
+
parameters: [],
|
|
118
|
+
returns: {
|
|
119
|
+
type: 'TResource',
|
|
120
|
+
description: '`{ read, load }` — `read()` is what a component calls inside render to suspend, `load()` returns `{ complete, fail }` to resolve or reject the pending promise from the test body.'
|
|
121
|
+
},
|
|
122
|
+
signature: '() => TResource'
|
|
123
|
+
}, {
|
|
124
|
+
name: 'toBeSuspendable',
|
|
125
|
+
description: 'Jest matcher that asserts the given render thunk suspends at least once before settling. Imported for the side effect of registering itself onto `expect`.',
|
|
126
|
+
status: 'general-availability',
|
|
127
|
+
usageGuidelines: ['Pass a thunk that returns a `ReactNode` (`() => <App />`), not a component or an element directly. The matcher needs to re-invoke the thunk across renders.', 'Import the module once from your jest setup file — the matcher self-registers on import.'],
|
|
128
|
+
keywords: ['testing', 'jest', 'matcher', 'suspense', 'toBeSuspendable'],
|
|
129
|
+
category: 'testing',
|
|
130
|
+
package: '@af/react-unit-testing',
|
|
131
|
+
examples: [],
|
|
132
|
+
kind: 'function',
|
|
133
|
+
signature: 'expect(() => ReactNode).toBeSuspendable()'
|
|
134
|
+
}, {
|
|
135
|
+
name: 'toPassStrictMode',
|
|
136
|
+
description: 'Jest matcher that asserts the given component does not log any of the known React Strict Mode warnings (legacy lifecycles, legacy context, etc.).',
|
|
137
|
+
status: 'general-availability',
|
|
138
|
+
usageGuidelines: ['Run on the root component you want to certify — strict-mode warnings bubble down, so a passing root means the whole subtree is clean.', 'Failures print the offending warning verbatim. Resolve by migrating off the deprecated API rather than suppressing the warning.'],
|
|
139
|
+
keywords: ['testing', 'jest', 'matcher', 'strict-mode', 'toPassStrictMode'],
|
|
140
|
+
category: 'testing',
|
|
141
|
+
package: '@af/react-unit-testing',
|
|
142
|
+
examples: [],
|
|
143
|
+
kind: 'function',
|
|
144
|
+
signature: 'expect(() => ReactNode).toPassStrictMode()'
|
|
145
|
+
}, {
|
|
146
|
+
name: 'TResource',
|
|
147
|
+
description: 'Public shape of the value returned by `getSuspenseResource()`. Useful when stashing a resource on a ref or passing it between helpers.',
|
|
148
|
+
status: 'general-availability',
|
|
149
|
+
keywords: ['testing', 'suspense', 'type', 'TResource'],
|
|
150
|
+
category: 'testing',
|
|
151
|
+
package: '@af/react-unit-testing',
|
|
152
|
+
examples: [],
|
|
153
|
+
kind: 'type',
|
|
154
|
+
definition: 'type TResource = { read: () => void | never; load: () => { complete: () => Promise<void>; fail: () => Promise<void> } }'
|
|
57
155
|
}, {
|
|
58
|
-
name: '
|
|
59
|
-
description: '
|
|
156
|
+
name: 'createAndFireEvent',
|
|
157
|
+
description: 'Curried helper that builds a `UIAnalyticsEvent` for a payload and fires it on a channel in one go. The original event is also returned so the call site can keep working with it.',
|
|
60
158
|
status: 'general-availability',
|
|
61
|
-
usageGuidelines: ['
|
|
62
|
-
keywords: ['
|
|
63
|
-
category: '
|
|
64
|
-
package: '@atlaskit/
|
|
159
|
+
usageGuidelines: ['Reach for `createAndFireEvent` when you want a one-liner inside an event handler. For more complex flows, build and fire the event explicitly.'],
|
|
160
|
+
keywords: ['analytics', 'utility', 'createAndFireEvent', 'analytics-next'],
|
|
161
|
+
category: 'analytics',
|
|
162
|
+
package: '@atlaskit/analytics-next',
|
|
65
163
|
examples: [],
|
|
66
164
|
kind: 'function',
|
|
67
165
|
parameters: [{
|
|
68
|
-
name: '
|
|
69
|
-
type: '
|
|
70
|
-
description: '
|
|
166
|
+
name: 'channel',
|
|
167
|
+
type: 'string',
|
|
168
|
+
description: 'Optional channel to fire on.',
|
|
169
|
+
isOptional: true
|
|
170
|
+
}, {
|
|
171
|
+
name: 'payload',
|
|
172
|
+
type: 'AnalyticsEventPayload'
|
|
71
173
|
}, {
|
|
72
|
-
name: '
|
|
73
|
-
type: '
|
|
74
|
-
description: '
|
|
174
|
+
name: 'createAnalyticsEvent',
|
|
175
|
+
type: 'CreateUIAnalyticsEvent',
|
|
176
|
+
description: 'The factory from `useAnalyticsEvents()` or `withAnalyticsEvents`.'
|
|
75
177
|
}],
|
|
76
178
|
returns: {
|
|
77
|
-
type: '
|
|
78
|
-
description: '
|
|
179
|
+
type: 'UIAnalyticsEvent',
|
|
180
|
+
description: 'The original (un-cloned) consumer event so callers can attach further context.'
|
|
79
181
|
},
|
|
80
|
-
signature: '(
|
|
182
|
+
signature: '(channel?: string) => (payload: AnalyticsEventPayload) => (createAnalyticsEvent: CreateUIAnalyticsEvent) => UIAnalyticsEvent'
|
|
81
183
|
}, {
|
|
82
|
-
name: '
|
|
83
|
-
description: '
|
|
184
|
+
name: 'isUIAnalyticsEvent',
|
|
185
|
+
description: 'Type-guard that returns true if the given value is a `UIAnalyticsEvent` (including instances from older copies of `analytics-next`).',
|
|
84
186
|
status: 'general-availability',
|
|
85
|
-
usageGuidelines: ['Use
|
|
86
|
-
keywords: ['
|
|
87
|
-
category: '
|
|
88
|
-
package: '@atlaskit/
|
|
187
|
+
usageGuidelines: ['Use in listener handlers when you receive events from third-party code and need to narrow before reading `.payload`.'],
|
|
188
|
+
keywords: ['analytics', 'guard', 'isUIAnalyticsEvent', 'analytics-next'],
|
|
189
|
+
category: 'analytics',
|
|
190
|
+
package: '@atlaskit/analytics-next',
|
|
89
191
|
examples: [],
|
|
90
192
|
kind: 'function',
|
|
91
193
|
parameters: [{
|
|
92
|
-
name: '
|
|
93
|
-
type: '
|
|
94
|
-
}, {
|
|
95
|
-
name: 'opts',
|
|
96
|
-
type: "{ operations: { 'reorder-before'?: Availability; 'reorder-after'?: Availability; combine?: Availability }; element: Element; input: Input; axis?: Axis }",
|
|
97
|
-
description: 'Each operation defaults to `"not-available"`. `axis` defaults to `"vertical"` for traditional top-to-bottom lists.'
|
|
194
|
+
name: 'obj',
|
|
195
|
+
type: 'unknown'
|
|
98
196
|
}],
|
|
99
197
|
returns: {
|
|
100
|
-
type: '
|
|
198
|
+
type: 'boolean'
|
|
101
199
|
},
|
|
102
|
-
signature:
|
|
200
|
+
signature: '(obj: unknown) => obj is UIAnalyticsEvent'
|
|
103
201
|
}, {
|
|
104
|
-
name: '
|
|
105
|
-
description: '
|
|
202
|
+
name: 'UIAnalyticsEventHandler',
|
|
203
|
+
description: 'Signature for any function that receives events from an `AnalyticsListener`. Implement to forward events to your analytics SDK.',
|
|
106
204
|
status: 'general-availability',
|
|
107
|
-
usageGuidelines: [
|
|
108
|
-
keywords: ['
|
|
109
|
-
category: '
|
|
110
|
-
package: '@
|
|
205
|
+
usageGuidelines: ['Handlers must not throw — analytics must never crash product UI. The runtime swallows handler errors in production and logs them in development.'],
|
|
206
|
+
keywords: ['analytics', 'type', 'handler', 'UIAnalyticsEventHandler', 'analytics-next'],
|
|
207
|
+
category: 'analytics',
|
|
208
|
+
package: '@atlaskit/analytics-next',
|
|
209
|
+
examples: [],
|
|
210
|
+
kind: 'type',
|
|
211
|
+
definition: '(event: UIAnalyticsEvent, channel?: string) => void'
|
|
212
|
+
}, {
|
|
213
|
+
name: 'quickInsertPlugin',
|
|
214
|
+
description: 'Quick insert plugin for @atlaskit/editor-core',
|
|
215
|
+
status: 'general-availability',
|
|
216
|
+
usageGuidelines: [],
|
|
217
|
+
accessibilityGuidelines: [],
|
|
218
|
+
keywords: ['editor', 'editor-plugin-quick-insert', 'atlaskit'],
|
|
219
|
+
category: 'editor',
|
|
220
|
+
package: '@atlaskit/editor-plugin-quick-insert',
|
|
111
221
|
examples: [],
|
|
112
222
|
kind: 'function',
|
|
113
|
-
signature: '
|
|
223
|
+
signature: 'quickInsertPlugin: QuickInsertPlugin'
|
|
114
224
|
}, {
|
|
115
|
-
name: '
|
|
116
|
-
description: '
|
|
225
|
+
name: 'CustomAttributes',
|
|
226
|
+
description: 'Free-form attribute bag attached to an exposure event. Keys are validated against the reserved-attribute list at runtime — colliding with a reserved key throws.',
|
|
117
227
|
status: 'general-availability',
|
|
118
|
-
usageGuidelines: ['
|
|
119
|
-
keywords: ['
|
|
120
|
-
category: '
|
|
121
|
-
package: '@
|
|
228
|
+
usageGuidelines: ['Keep custom attribute names stable — downstream analytics queries pivot on them. Coordinate any rename with the data-platform team before shipping.'],
|
|
229
|
+
keywords: ['feature-flag', 'type', 'CustomAttributes', 'exposure'],
|
|
230
|
+
category: 'experimentation',
|
|
231
|
+
package: '@atlaskit/feature-flag-client',
|
|
232
|
+
examples: [],
|
|
233
|
+
kind: 'type',
|
|
234
|
+
definition: 'type CustomAttributes = { [attributeName: string]: string | number | boolean | object }'
|
|
235
|
+
}, {
|
|
236
|
+
name: 'ExposureTriggerReason',
|
|
237
|
+
description: 'Enum describing why an exposure event was fired (auto vs. manual vs. consumer opt-in). Surfaced on the exposure event payload so downstream analytics can de-duplicate auto vs. manual fires.',
|
|
238
|
+
status: 'general-availability',
|
|
239
|
+
usageGuidelines: ['Use the enum members rather than literal strings when calling `trackFeatureFlag({ triggerReason })` — the literal values change if the backend renames a reason.'],
|
|
240
|
+
keywords: ['feature-flag', 'exposure', 'enum', 'ExposureTriggerReason'],
|
|
241
|
+
category: 'experimentation',
|
|
242
|
+
package: '@atlaskit/feature-flag-client',
|
|
243
|
+
examples: [],
|
|
244
|
+
kind: 'constant',
|
|
245
|
+
type: 'enum ExposureTriggerReason',
|
|
246
|
+
value: '{ OptIn = "optInExposure", Manual = "manualExposure", Default = "defaultExposure", AutoExposure = "autoExposure", hasCustomAttributes = "hasCustomAttributes" }'
|
|
247
|
+
}, {
|
|
248
|
+
name: 'FeatureFlagClient',
|
|
249
|
+
description: 'Default export. The runtime client developers construct and interact with — it evaluates flags from an in-memory flag set, caches per-key flag wrappers, and fires exposure events through the supplied analytics handler. Construct one instance per app bootstrap and pass it through context.',
|
|
250
|
+
status: 'general-availability',
|
|
251
|
+
usageGuidelines: ['Construct one client per app and pass it through context — do not new up additional clients per component, or duplicate exposures will fire.', 'Provide an `analyticsHandler` at construction time. Constructing without one is an error: the client will throw via `enforceAttributes`.', '`isAutomaticExposuresEnabled` enables the TAC auto-exposure pipeline (downstream consumers opt in). `ignoreTypes: true` disables the runtime type guard on evaluation — only set in tests.', 'Prefer the typed value getters (`getBooleanValue`, `getVariantValue`, `getJSONValue`) over `getRawValue` so wrong-type explanations land in the exposure event.', '`getJSONValue` does not fire an exposure — pair it with `trackFeatureFlag` if the consumer needs an exposure event for the JSON read.', 'If you need to short-circuit exposure firing (e.g. evaluate-then-decide flows), use `shouldTrackExposureEvent: false` paired with an explicit `trackFeatureFlag` call once the decision is made.', '`setFlags` replaces or extends the in-memory flag set and invalidates cached wrappers for any keys it touches; safe to call after a late-arriving bootstrap payload.', '`clear` drops the entire flag set, wrapper cache, and tracked-flag set — primarily useful in tests or when re-bootstrapping after a tenant switch.'],
|
|
252
|
+
keywords: ['feature-flag', 'feature-gate', 'experiment', 'switcheroo', 'FeatureFlagClient', 'client'],
|
|
253
|
+
category: 'experimentation',
|
|
254
|
+
package: '@atlaskit/feature-flag-client',
|
|
255
|
+
examples: [],
|
|
256
|
+
kind: 'constant',
|
|
257
|
+
type: 'class FeatureFlagClient',
|
|
258
|
+
value: 'new FeatureFlagClient({ analyticsHandler, flags?, isAutomaticExposuresEnabled?, ignoreTypes? })\n .setFlags(flags: Flags): void\n .setAnalyticsHandler(analyticsHandler?: AnalyticsHandler): void\n .setIsAutomaticExposuresEnabled(isEnabled: boolean): void\n .getBooleanValue(flagKey, { default, exposureData?, shouldTrackExposureEvent? }): boolean\n .getVariantValue(flagKey, { default, oneOf, exposureData?, shouldTrackExposureEvent? }): string\n .getJSONValue(flagKey): object\n .getRawValue(flagKey, { default, exposureData?, shouldTrackExposureEvent? }): FlagValue\n .getFlagEvaluation<T>(flagKey, { default, exposureData?, shouldTrackExposureEvent? }): FlagShape<T>\n .trackFeatureFlag(flagKey, options?: TrackFeatureFlagOptions): void\n .clear(): void'
|
|
259
|
+
}, {
|
|
260
|
+
name: 'FlagValue',
|
|
261
|
+
description: 'Union of the value types a flag can return: `boolean | string | object`.',
|
|
262
|
+
status: 'general-availability',
|
|
263
|
+
keywords: ['feature-flag', 'type', 'FlagValue'],
|
|
264
|
+
category: 'experimentation',
|
|
265
|
+
package: '@atlaskit/feature-flag-client',
|
|
266
|
+
examples: [],
|
|
267
|
+
kind: 'type',
|
|
268
|
+
definition: 'type FlagValue = boolean | string | object'
|
|
269
|
+
}, {
|
|
270
|
+
name: 'convertToError',
|
|
271
|
+
description: 'Normalises any value thrown by a `try`/`catch` into an `Error` instance — useful at the boundary between untyped JS code (which can throw strings, objects, or `undefined`) and TypeScript code that wants a real `Error`.',
|
|
272
|
+
status: 'general-availability',
|
|
273
|
+
usageGuidelines: ['Use at every catch boundary that hands the error to logging, Sentry, or analytics — those consumers all assume a real `Error` with `.message` and a stack.', 'Object errors are JSON-serialised; circular objects fall back to `String(...)`, so the stack you log will reflect where `convertToError` was called, not where the original value was thrown.'],
|
|
274
|
+
keywords: ['utility', 'convertToError', 'error', 'frontend-utilities'],
|
|
275
|
+
category: 'utilities',
|
|
276
|
+
package: '@atlaskit/frontend-utilities',
|
|
122
277
|
examples: [],
|
|
123
278
|
kind: 'function',
|
|
124
279
|
parameters: [{
|
|
125
|
-
name: '
|
|
126
|
-
type: '
|
|
127
|
-
description: '
|
|
280
|
+
name: 'e',
|
|
281
|
+
type: 'unknown',
|
|
282
|
+
description: 'The caught value. Already-`Error` instances are returned unchanged.'
|
|
283
|
+
}],
|
|
284
|
+
returns: {
|
|
285
|
+
type: 'Error',
|
|
286
|
+
description: 'The original value if it was already an `Error`; otherwise a freshly-constructed `Error` whose message describes the original (`JSON.stringify`d for objects, `String(...)`d otherwise).'
|
|
287
|
+
},
|
|
288
|
+
signature: '(e: unknown) => Error'
|
|
289
|
+
}, {
|
|
290
|
+
name: 'mockWindowStorage',
|
|
291
|
+
description: 'Test helper that replaces `window.localStorage` and/or `window.sessionStorage` with an in-memory `STORAGE_MOCK` so unit tests can exercise storage-dependent code without touching the real browser storage (and without crashing in jsdom environments where storage may be disabled).',
|
|
292
|
+
status: 'general-availability',
|
|
293
|
+
usageGuidelines: ['Call once per test (in `beforeEach`) — each call installs a fresh `STORAGE_MOCK`, so tests are isolated.', 'Handles SSR/jsdom environments where `window` may be undefined — safe to call in any Jest test.', 'Production code must never call this. It is wired up under the `./local-storage` subpath alongside the test mock.'],
|
|
294
|
+
keywords: ['utility', 'mockWindowStorage', 'storage', 'test', 'frontend-utilities'],
|
|
295
|
+
category: 'utilities',
|
|
296
|
+
package: '@atlaskit/frontend-utilities',
|
|
297
|
+
examples: [],
|
|
298
|
+
kind: 'function',
|
|
299
|
+
parameters: [{
|
|
300
|
+
name: 'storageToMock',
|
|
301
|
+
type: "('localStorage' | 'sessionStorage')[]",
|
|
302
|
+
description: 'Which storage objects to replace. Defaults to both.',
|
|
303
|
+
defaultValue: "['localStorage', 'sessionStorage']",
|
|
128
304
|
isOptional: true
|
|
305
|
+
}],
|
|
306
|
+
returns: {
|
|
307
|
+
type: 'void'
|
|
308
|
+
},
|
|
309
|
+
signature: "(storageToMock?: ('localStorage' | 'sessionStorage')[]) => void"
|
|
310
|
+
}, {
|
|
311
|
+
name: 'retryOnException',
|
|
312
|
+
description: 'Retries an async `invokeOperation` while the most recent error is in the `retryOn` allow-list, sleeping between attempts per `intervalsMS`. The sleep schedule defines both the number of retries and the delays between them — `intervalsMS: [0, 50, 100]` means "try once, then up to three retries at 0 ms, 50 ms, and 100 ms".',
|
|
313
|
+
status: 'general-availability',
|
|
314
|
+
usageGuidelines: ['Pre-baked schedules live in `@atlaskit/frontend-utilities/retry-operation`: `NO_RETRIES`, `UP_TO_TWO_INSTANT_RETRIES`, `DEFAULT_RETRIES` (`[0, 50, 100]`), `LAZY_LOAD_RETRIES` (`[100, 500, 1000]`). Prefer one of those over hand-rolled arrays so retry semantics stay consistent across products.', '`retryOn` is allow-list, not deny-list — unmatched errors short-circuit and reject immediately. Throw `FailedFetchError` (or your own type that extends `Error`) from inside `invokeOperation` to opt into retries.', '`captureException` should fire-and-forget — do not throw from it, or the retry loop bails. Use it for Sentry reporting on every attempt.'],
|
|
315
|
+
keywords: ['utility', 'retryOnException', 'retry', 'fetch', 'frontend-utilities'],
|
|
316
|
+
category: 'utilities',
|
|
317
|
+
package: '@atlaskit/frontend-utilities',
|
|
318
|
+
examples: [],
|
|
319
|
+
kind: 'function',
|
|
320
|
+
parameters: [{
|
|
321
|
+
name: 'invokeOperation',
|
|
322
|
+
type: '() => Promise<T>',
|
|
323
|
+
description: 'The async operation to attempt. Called once per attempt.'
|
|
129
324
|
}, {
|
|
130
|
-
name: '
|
|
131
|
-
type: '
|
|
132
|
-
description: '
|
|
133
|
-
isOptional: true
|
|
325
|
+
name: 'config',
|
|
326
|
+
type: '{ intervalsMS?: readonly number[]; retryOn?: (typeof Error)[] | ((e: Error) => boolean); captureException?: (error: Error, tags?: Record<string, string>) => void; onRetry?: (previousErr: Error) => void }',
|
|
327
|
+
description: '`intervalsMS` defaults to `NO_RETRIES` (no retries). `retryOn` defaults to `[FailedFetchError]`. `captureException` is called for every caught error, including the final one. `onRetry` fires only between attempts, never before the first.'
|
|
134
328
|
}],
|
|
135
329
|
returns: {
|
|
136
|
-
type: 'Promise<
|
|
137
|
-
description: 'Resolves with the
|
|
330
|
+
type: 'Promise<T>',
|
|
331
|
+
description: 'Resolves with the operation result on the first successful attempt. Rejects with the last caught error once `intervalsMS` is exhausted or an unmatched error is thrown.'
|
|
138
332
|
},
|
|
139
|
-
signature: '(
|
|
333
|
+
signature: '<T>(invokeOperation: () => Promise<T>, config: RetryConfig) => Promise<T>'
|
|
334
|
+
}, {
|
|
335
|
+
name: 'simpleHash',
|
|
336
|
+
description: 'Deterministic 32-bit string hash rendered in base-36 (e.g. `"hello" -> "y2sl1f"`). Stable across runs for the same input. NOT cryptographic — collisions are easy and the algorithm is not suitable for security.',
|
|
337
|
+
status: 'general-availability',
|
|
338
|
+
usageGuidelines: ['Use for stable cache keys, telemetry-bucket assignments, or generating short anonymous identifiers from a known input.', 'Do NOT use for password hashing, signing, or anything else where collisions or pre-image resistance matter.', 'Output is stable across runtimes — safe to embed in URLs and analytics events.'],
|
|
339
|
+
keywords: ['utility', 'simpleHash', 'hash', 'frontend-utilities'],
|
|
340
|
+
category: 'utilities',
|
|
341
|
+
package: '@atlaskit/frontend-utilities',
|
|
342
|
+
examples: [],
|
|
343
|
+
kind: 'function',
|
|
344
|
+
parameters: [{
|
|
345
|
+
name: 'str',
|
|
346
|
+
type: 'string',
|
|
347
|
+
description: 'Input to hash.'
|
|
348
|
+
}],
|
|
349
|
+
returns: {
|
|
350
|
+
type: 'string',
|
|
351
|
+
description: 'Base-36 representation of a 32-bit signed-to-unsigned hash.'
|
|
352
|
+
},
|
|
353
|
+
signature: '(str: string) => string'
|
|
354
|
+
}, {
|
|
355
|
+
name: 'STORAGE_MOCK',
|
|
356
|
+
description: 'In-memory implementation of the DOM `Storage` interface used by `mockWindowStorage`. Exported directly so tests that need their own scoped mock (e.g. for `globalThis` shimming or browser-extension storage) can use it as a building block.',
|
|
357
|
+
status: 'general-availability',
|
|
358
|
+
usageGuidelines: ['Prefer `mockWindowStorage()` for typical Jest setups. Reach for `STORAGE_MOCK` directly only when you need to install storage somewhere other than `window` (e.g. a worker global).', 'The mock is mutable and shared — wrap it with `{ ...STORAGE_MOCK }` before installing if you want per-test isolation manually.'],
|
|
359
|
+
keywords: ['constant', 'STORAGE_MOCK', 'storage', 'test', 'frontend-utilities'],
|
|
360
|
+
category: 'utilities',
|
|
361
|
+
package: '@atlaskit/frontend-utilities',
|
|
362
|
+
examples: [],
|
|
363
|
+
kind: 'constant',
|
|
364
|
+
type: 'Storage',
|
|
365
|
+
value: '{ length: 0; getItem(id); setItem(id, val); removeItem(id); clear(); key(index) } — backed by an in-memory `_data` record.'
|
|
366
|
+
}, {
|
|
367
|
+
name: 'init',
|
|
368
|
+
description: 'INSM tooling measures user-perceived interactivity of a page',
|
|
369
|
+
status: 'general-availability',
|
|
370
|
+
usageGuidelines: [],
|
|
371
|
+
accessibilityGuidelines: [],
|
|
372
|
+
keywords: ['editor', 'insm', 'atlaskit'],
|
|
373
|
+
category: 'editor',
|
|
374
|
+
package: '@atlaskit/insm',
|
|
375
|
+
examples: [],
|
|
376
|
+
kind: 'function',
|
|
377
|
+
signature: 'init(options: INSMOptions): void'
|
|
140
378
|
}, {
|
|
141
379
|
name: 'BaseUrls',
|
|
142
380
|
description: 'Record of resolver environments to Stargate base URLs. Three production aliases (`prd`, `prod`, `production`) all map to the same host; the same goes for `dev` / `development` and `stg` / `staging`. Underlying source of truth for `getBaseUrl`; exported for tests and downstream packages that need to match on the host.',
|
|
@@ -229,81 +467,7 @@ var atlaskitUtilities = exports.atlaskitUtilities = [{
|
|
|
229
467
|
package: '@atlaskit/linking-common',
|
|
230
468
|
examples: [],
|
|
231
469
|
kind: 'type',
|
|
232
|
-
definition: "type CardType = 'pending' | 'resolving' | 'resolved' | 'errored' | 'fallback' | 'unauthorized' | 'forbidden' | 'not_found'"
|
|
233
|
-
}, {
|
|
234
|
-
name: 'cleanup',
|
|
235
|
-
description: 'Removes the singleton live-region node from the DOM. No-op if `announce` has never been called. Mostly useful in tests to reset state between cases.',
|
|
236
|
-
status: 'general-availability',
|
|
237
|
-
usageGuidelines: ['Call from a test teardown to keep the DOM tidy between runs. Production apps rarely need this — the node is harmless to leave in place.'],
|
|
238
|
-
keywords: ['pragmatic-drag-and-drop', 'pdnd', 'live-region', 'cleanup', 'teardown'],
|
|
239
|
-
category: 'drag-and-drop',
|
|
240
|
-
package: '@atlaskit/pragmatic-drag-and-drop-live-region',
|
|
241
|
-
examples: [],
|
|
242
|
-
kind: 'function',
|
|
243
|
-
parameters: [],
|
|
244
|
-
returns: {
|
|
245
|
-
type: 'void'
|
|
246
|
-
},
|
|
247
|
-
signature: '() => void'
|
|
248
|
-
}, {
|
|
249
|
-
name: 'convertToError',
|
|
250
|
-
description: 'Normalises any value thrown by a `try`/`catch` into an `Error` instance — useful at the boundary between untyped JS code (which can throw strings, objects, or `undefined`) and TypeScript code that wants a real `Error`.',
|
|
251
|
-
status: 'general-availability',
|
|
252
|
-
usageGuidelines: ['Use at every catch boundary that hands the error to logging, Sentry, or analytics — those consumers all assume a real `Error` with `.message` and a stack.', 'Object errors are JSON-serialised; circular objects fall back to `String(...)`, so the stack you log will reflect where `convertToError` was called, not where the original value was thrown.'],
|
|
253
|
-
keywords: ['utility', 'convertToError', 'error', 'frontend-utilities'],
|
|
254
|
-
category: 'utilities',
|
|
255
|
-
package: '@atlaskit/frontend-utilities',
|
|
256
|
-
examples: [],
|
|
257
|
-
kind: 'function',
|
|
258
|
-
parameters: [{
|
|
259
|
-
name: 'e',
|
|
260
|
-
type: 'unknown',
|
|
261
|
-
description: 'The caught value. Already-`Error` instances are returned unchanged.'
|
|
262
|
-
}],
|
|
263
|
-
returns: {
|
|
264
|
-
type: 'Error',
|
|
265
|
-
description: 'The original value if it was already an `Error`; otherwise a freshly-constructed `Error` whose message describes the original (`JSON.stringify`d for objects, `String(...)`d otherwise).'
|
|
266
|
-
},
|
|
267
|
-
signature: '(e: unknown) => Error'
|
|
268
|
-
}, {
|
|
269
|
-
name: 'createAndFireEvent',
|
|
270
|
-
description: 'Curried helper that builds a `UIAnalyticsEvent` for a payload and fires it on a channel in one go. The original event is also returned so the call site can keep working with it.',
|
|
271
|
-
status: 'general-availability',
|
|
272
|
-
usageGuidelines: ['Reach for `createAndFireEvent` when you want a one-liner inside an event handler. For more complex flows, build and fire the event explicitly.'],
|
|
273
|
-
keywords: ['analytics', 'utility', 'createAndFireEvent', 'analytics-next'],
|
|
274
|
-
category: 'analytics',
|
|
275
|
-
package: '@atlaskit/analytics-next',
|
|
276
|
-
examples: [],
|
|
277
|
-
kind: 'function',
|
|
278
|
-
parameters: [{
|
|
279
|
-
name: 'channel',
|
|
280
|
-
type: 'string',
|
|
281
|
-
description: 'Optional channel to fire on.',
|
|
282
|
-
isOptional: true
|
|
283
|
-
}, {
|
|
284
|
-
name: 'payload',
|
|
285
|
-
type: 'AnalyticsEventPayload'
|
|
286
|
-
}, {
|
|
287
|
-
name: 'createAnalyticsEvent',
|
|
288
|
-
type: 'CreateUIAnalyticsEvent',
|
|
289
|
-
description: 'The factory from `useAnalyticsEvents()` or `withAnalyticsEvents`.'
|
|
290
|
-
}],
|
|
291
|
-
returns: {
|
|
292
|
-
type: 'UIAnalyticsEvent',
|
|
293
|
-
description: 'The original (un-cloned) consumer event so callers can attach further context.'
|
|
294
|
-
},
|
|
295
|
-
signature: '(channel?: string) => (payload: AnalyticsEventPayload) => (createAnalyticsEvent: CreateUIAnalyticsEvent) => UIAnalyticsEvent'
|
|
296
|
-
}, {
|
|
297
|
-
name: 'CustomAttributes',
|
|
298
|
-
description: 'Free-form attribute bag attached to an exposure event. Keys are validated against the reserved-attribute list at runtime — colliding with a reserved key throws.',
|
|
299
|
-
status: 'general-availability',
|
|
300
|
-
usageGuidelines: ['Keep custom attribute names stable — downstream analytics queries pivot on them. Coordinate any rename with the data-platform team before shipping.'],
|
|
301
|
-
keywords: ['feature-flag', 'type', 'CustomAttributes', 'exposure'],
|
|
302
|
-
category: 'experimentation',
|
|
303
|
-
package: '@atlaskit/feature-flag-client',
|
|
304
|
-
examples: [],
|
|
305
|
-
kind: 'type',
|
|
306
|
-
definition: 'type CustomAttributes = { [attributeName: string]: string | number | boolean | object }'
|
|
470
|
+
definition: "type CardType = 'pending' | 'resolving' | 'resolved' | 'errored' | 'fallback' | 'unauthorized' | 'forbidden' | 'not_found'"
|
|
307
471
|
}, {
|
|
308
472
|
name: 'Datasource',
|
|
309
473
|
description: 'Public contract for a Datasource node — id, parameters bag (generic, defaults to `Record<string, unknown>`), and the view configs that describe how the resolved rows should render. Exchanged between the editor, Confluence/Jira renderers, and the resolver.',
|
|
@@ -325,16 +489,6 @@ var atlaskitUtilities = exports.atlaskitUtilities = [{
|
|
|
325
489
|
kind: 'constant',
|
|
326
490
|
type: "'wide'",
|
|
327
491
|
value: "'wide'"
|
|
328
|
-
}, {
|
|
329
|
-
name: 'Edge',
|
|
330
|
-
description: 'Imported from `@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge`. String literal union of the four cardinal edges of a drop target.',
|
|
331
|
-
status: 'general-availability',
|
|
332
|
-
keywords: ['pdnd', 'hitbox', 'Edge', 'type'],
|
|
333
|
-
category: 'drag-and-drop',
|
|
334
|
-
package: '@atlaskit/pragmatic-drag-and-drop-hitbox',
|
|
335
|
-
examples: [],
|
|
336
|
-
kind: 'type',
|
|
337
|
-
definition: "type Edge = 'top' | 'right' | 'bottom' | 'left'"
|
|
338
492
|
}, {
|
|
339
493
|
name: 'EnvironmentsKeys',
|
|
340
494
|
description: 'String union of the resolver environments understood by `getBaseUrl` / `getResolverUrl`. Three environments with two-or-three aliases each (`dev` / `development`, `stg` / `staging`, `prd` / `prod` / `production`), plus a special `custom` value that pairs with the `baseUrlOverride` arg for SSR / non-standard hosts.',
|
|
@@ -345,66 +499,6 @@ var atlaskitUtilities = exports.atlaskitUtilities = [{
|
|
|
345
499
|
examples: [],
|
|
346
500
|
kind: 'type',
|
|
347
501
|
definition: "type EnvironmentsKeys = 'dev' | 'development' | 'stg' | 'staging' | 'prd' | 'prod' | 'production' | 'custom'"
|
|
348
|
-
}, {
|
|
349
|
-
name: 'ExposureTriggerReason',
|
|
350
|
-
description: 'Enum describing why an exposure event was fired (auto vs. manual vs. consumer opt-in). Surfaced on the exposure event payload so downstream analytics can de-duplicate auto vs. manual fires.',
|
|
351
|
-
status: 'general-availability',
|
|
352
|
-
usageGuidelines: ['Use the enum members rather than literal strings when calling `trackFeatureFlag({ triggerReason })` — the literal values change if the backend renames a reason.'],
|
|
353
|
-
keywords: ['feature-flag', 'exposure', 'enum', 'ExposureTriggerReason'],
|
|
354
|
-
category: 'experimentation',
|
|
355
|
-
package: '@atlaskit/feature-flag-client',
|
|
356
|
-
examples: [],
|
|
357
|
-
kind: 'constant',
|
|
358
|
-
type: 'enum ExposureTriggerReason',
|
|
359
|
-
value: '{ OptIn = "optInExposure", Manual = "manualExposure", Default = "defaultExposure", AutoExposure = "autoExposure", hasCustomAttributes = "hasCustomAttributes" }'
|
|
360
|
-
}, {
|
|
361
|
-
name: 'extractClosestEdge',
|
|
362
|
-
description: 'Imported from `@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge`. Reads the edge previously written by `attachClosestEdge`. Returns `null` if no edge was attached.',
|
|
363
|
-
status: 'general-availability',
|
|
364
|
-
usageGuidelines: ['Use in `onDrag` or `onDrop` to decide whether to render the drop indicator above/below/left/right of the target.'],
|
|
365
|
-
keywords: ['pdnd', 'hitbox', 'extractClosestEdge', 'edge'],
|
|
366
|
-
category: 'drag-and-drop',
|
|
367
|
-
package: '@atlaskit/pragmatic-drag-and-drop-hitbox',
|
|
368
|
-
examples: [],
|
|
369
|
-
kind: 'function',
|
|
370
|
-
parameters: [{
|
|
371
|
-
name: 'userData',
|
|
372
|
-
type: 'Record<string | symbol, unknown>',
|
|
373
|
-
description: 'The `userData` produced by `attachClosestEdge`, typically read from the dropped target.'
|
|
374
|
-
}],
|
|
375
|
-
returns: {
|
|
376
|
-
type: 'Edge | null'
|
|
377
|
-
},
|
|
378
|
-
signature: '(userData: Record<string | symbol, unknown>) => Edge | null'
|
|
379
|
-
}, {
|
|
380
|
-
name: 'extractInstruction',
|
|
381
|
-
description: 'Imported from `@atlaskit/pragmatic-drag-and-drop-hitbox/list-item`. Reads the instruction previously written by `attachInstruction`. Returns `null` when no instruction is available (e.g. all operations were blocked).',
|
|
382
|
-
status: 'general-availability',
|
|
383
|
-
keywords: ['pdnd', 'hitbox', 'extractInstruction', 'reorder', 'list-item'],
|
|
384
|
-
category: 'drag-and-drop',
|
|
385
|
-
package: '@atlaskit/pragmatic-drag-and-drop-hitbox',
|
|
386
|
-
examples: [],
|
|
387
|
-
kind: 'function',
|
|
388
|
-
parameters: [{
|
|
389
|
-
name: 'userData',
|
|
390
|
-
type: 'Record<string | symbol, unknown>'
|
|
391
|
-
}],
|
|
392
|
-
returns: {
|
|
393
|
-
type: 'Instruction | null'
|
|
394
|
-
},
|
|
395
|
-
signature: '(userData: Record<string | symbol, unknown>) => Instruction | null'
|
|
396
|
-
}, {
|
|
397
|
-
name: 'FeatureFlagClient',
|
|
398
|
-
description: 'Default export. The runtime client developers construct and interact with — it evaluates flags from an in-memory flag set, caches per-key flag wrappers, and fires exposure events through the supplied analytics handler. Construct one instance per app bootstrap and pass it through context.',
|
|
399
|
-
status: 'general-availability',
|
|
400
|
-
usageGuidelines: ['Construct one client per app and pass it through context — do not new up additional clients per component, or duplicate exposures will fire.', 'Provide an `analyticsHandler` at construction time. Constructing without one is an error: the client will throw via `enforceAttributes`.', '`isAutomaticExposuresEnabled` enables the TAC auto-exposure pipeline (downstream consumers opt in). `ignoreTypes: true` disables the runtime type guard on evaluation — only set in tests.', 'Prefer the typed value getters (`getBooleanValue`, `getVariantValue`, `getJSONValue`) over `getRawValue` so wrong-type explanations land in the exposure event.', '`getJSONValue` does not fire an exposure — pair it with `trackFeatureFlag` if the consumer needs an exposure event for the JSON read.', 'If you need to short-circuit exposure firing (e.g. evaluate-then-decide flows), use `shouldTrackExposureEvent: false` paired with an explicit `trackFeatureFlag` call once the decision is made.', '`setFlags` replaces or extends the in-memory flag set and invalidates cached wrappers for any keys it touches; safe to call after a late-arriving bootstrap payload.', '`clear` drops the entire flag set, wrapper cache, and tracked-flag set — primarily useful in tests or when re-bootstrapping after a tenant switch.'],
|
|
401
|
-
keywords: ['feature-flag', 'feature-gate', 'experiment', 'switcheroo', 'FeatureFlagClient', 'client'],
|
|
402
|
-
category: 'experimentation',
|
|
403
|
-
package: '@atlaskit/feature-flag-client',
|
|
404
|
-
examples: [],
|
|
405
|
-
kind: 'constant',
|
|
406
|
-
type: 'class FeatureFlagClient',
|
|
407
|
-
value: 'new FeatureFlagClient({ analyticsHandler, flags?, isAutomaticExposuresEnabled?, ignoreTypes? })\n .setFlags(flags: Flags): void\n .setAnalyticsHandler(analyticsHandler?: AnalyticsHandler): void\n .setIsAutomaticExposuresEnabled(isEnabled: boolean): void\n .getBooleanValue(flagKey, { default, exposureData?, shouldTrackExposureEvent? }): boolean\n .getVariantValue(flagKey, { default, oneOf, exposureData?, shouldTrackExposureEvent? }): string\n .getJSONValue(flagKey): object\n .getRawValue(flagKey, { default, exposureData?, shouldTrackExposureEvent? }): FlagValue\n .getFlagEvaluation<T>(flagKey, { default, exposureData?, shouldTrackExposureEvent? }): FlagShape<T>\n .trackFeatureFlag(flagKey, options?: TrackFeatureFlagOptions): void\n .clear(): void'
|
|
408
502
|
}, {
|
|
409
503
|
name: 'filterSiteProducts',
|
|
410
504
|
description: 'Curried predicate factory. Given a list of products to require, returns a `(site: AvailableSite) => boolean` that keeps sites whose `products` overlap with the required list. Used by the link picker to limit results to sites the user can actually use for the target product.',
|
|
@@ -424,16 +518,6 @@ var atlaskitUtilities = exports.atlaskitUtilities = [{
|
|
|
424
518
|
description: 'Predicate suitable for `Array.prototype.filter`.'
|
|
425
519
|
},
|
|
426
520
|
signature: '(availableSitesProducts: AvailableSitesProductType[]) => (site: AvailableSite) => boolean'
|
|
427
|
-
}, {
|
|
428
|
-
name: 'FlagValue',
|
|
429
|
-
description: 'Union of the value types a flag can return: `boolean | string | object`.',
|
|
430
|
-
status: 'general-availability',
|
|
431
|
-
keywords: ['feature-flag', 'type', 'FlagValue'],
|
|
432
|
-
category: 'experimentation',
|
|
433
|
-
package: '@atlaskit/feature-flag-client',
|
|
434
|
-
examples: [],
|
|
435
|
-
kind: 'type',
|
|
436
|
-
definition: 'type FlagValue = boolean | string | object'
|
|
437
521
|
}, {
|
|
438
522
|
name: 'getBaseUrl',
|
|
439
523
|
description: 'Resolves the Atlassian gateway base URL for the given environment. Maps `dev`/`development`, `stg`/`staging`, and `prd`/`prod`/`production` to the matching Stargate host. With `envKey === "custom"` it returns `baseUrlOverride` (or prod as a fallback); with no `envKey` and no override it returns `window.location.origin` so calls flow through the Edge Proxy on the current host.',
|
|
@@ -457,25 +541,6 @@ var atlaskitUtilities = exports.atlaskitUtilities = [{
|
|
|
457
541
|
type: 'string'
|
|
458
542
|
},
|
|
459
543
|
signature: '(envKey?: EnvironmentsKeys, baseUrlOverride?: string) => string'
|
|
460
|
-
}, {
|
|
461
|
-
name: 'getReorderDestinationIndex',
|
|
462
|
-
description: 'Imported from `@atlaskit/pragmatic-drag-and-drop-hitbox/list-item`. Pure function that returns the array index the dragged item should land at, given the start index, the index of the drop target, the closest edge of that target, and the axis. Use after `extractClosestEdge` to translate edge info into a concrete index for an array splice/move.',
|
|
463
|
-
status: 'general-availability',
|
|
464
|
-
usageGuidelines: ['Use as the final step of a list reorder in `onDrop` — apply the returned index to your array model.'],
|
|
465
|
-
keywords: ['pdnd', 'hitbox', 'getReorderDestinationIndex', 'reorder'],
|
|
466
|
-
category: 'drag-and-drop',
|
|
467
|
-
package: '@atlaskit/pragmatic-drag-and-drop-hitbox',
|
|
468
|
-
examples: [],
|
|
469
|
-
kind: 'function',
|
|
470
|
-
parameters: [{
|
|
471
|
-
name: 'opts',
|
|
472
|
-
type: "{ startIndex: number; closestEdgeOfTarget: Edge | null; indexOfTarget: number; axis: 'vertical' | 'horizontal' }"
|
|
473
|
-
}],
|
|
474
|
-
returns: {
|
|
475
|
-
type: 'number',
|
|
476
|
-
description: 'The destination index. If the start and target indices are the same, or either index is `-1`, the original `startIndex` is returned unchanged.'
|
|
477
|
-
},
|
|
478
|
-
signature: "(opts: { startIndex: number; closestEdgeOfTarget: Edge | null; indexOfTarget: number; axis: 'horizontal' | 'vertical' }) => number"
|
|
479
544
|
}, {
|
|
480
545
|
name: 'getResolverUrl',
|
|
481
546
|
description: 'Returns the object-resolver service URL for the given environment. With no args it returns the Edge Proxy path `/gateway/api/object-resolver` (which fixes cookie issues with strict browser policies); with `envKey` or `baseUrlOverride` it returns the Stargate-direct URL via `getBaseUrl`; with `envKey === "custom"` it returns `baseUrlOverride` (or the Edge Proxy path as a fallback).',
|
|
@@ -518,22 +583,6 @@ var atlaskitUtilities = exports.atlaskitUtilities = [{
|
|
|
518
583
|
type: 'CardType'
|
|
519
584
|
},
|
|
520
585
|
signature: "({ meta }: { meta: JsonLd.Response['meta'] }) => CardType"
|
|
521
|
-
}, {
|
|
522
|
-
name: 'getSuspenseResource',
|
|
523
|
-
description: 'Creates a one-shot Suspense resource: `read()` throws a pending promise until the matching `load().complete()` or `load().fail()` is called. Use to drive a component into and out of a Suspense fallback inside a test.',
|
|
524
|
-
status: 'general-availability',
|
|
525
|
-
usageGuidelines: ['Create a fresh resource per test — the internal state machine is one-shot and asserts when `load()` is called twice.', 'Always await `complete()` / `fail()` before making assertions about the post-fallback UI, otherwise React will not have committed the updated tree.'],
|
|
526
|
-
keywords: ['testing', 'suspense', 'react', 'getSuspenseResource'],
|
|
527
|
-
category: 'testing',
|
|
528
|
-
package: '@af/react-unit-testing',
|
|
529
|
-
examples: [],
|
|
530
|
-
kind: 'function',
|
|
531
|
-
parameters: [],
|
|
532
|
-
returns: {
|
|
533
|
-
type: 'TResource',
|
|
534
|
-
description: '`{ read, load }` — `read()` is what a component calls inside render to suspend, `load()` returns `{ complete, fail }` to resolve or reject the pending promise from the test body.'
|
|
535
|
-
},
|
|
536
|
-
signature: '() => TResource'
|
|
537
586
|
}, {
|
|
538
587
|
name: 'getUrl',
|
|
539
588
|
description: 'Selector that pulls the `CardState` for a given URL out of the Smart Card Redux store. Returns `{ status: "pending" }` as a default when no entry exists yet, so consumers can render their pending UI without an explicit null check.',
|
|
@@ -566,55 +615,6 @@ var atlaskitUtilities = exports.atlaskitUtilities = [{
|
|
|
566
615
|
examples: [],
|
|
567
616
|
kind: 'type',
|
|
568
617
|
definition: "interface InlineCardAdf { type: 'inlineCard'; attrs: { url: string } }"
|
|
569
|
-
}, {
|
|
570
|
-
name: 'Instruction',
|
|
571
|
-
description: 'Imported from `@atlaskit/pragmatic-drag-and-drop-hitbox/list-item`. Discriminated union describing what a drop on a list item should do. `operation` is one of `reorder-before` | `reorder-after` | `combine`. `blocked: true` signals the operation is logically valid but has been disallowed (so consumers can show a "not allowed" affordance).',
|
|
572
|
-
status: 'general-availability',
|
|
573
|
-
keywords: ['pdnd', 'hitbox', 'Instruction', 'type', 'reorder'],
|
|
574
|
-
category: 'drag-and-drop',
|
|
575
|
-
package: '@atlaskit/pragmatic-drag-and-drop-hitbox',
|
|
576
|
-
examples: [],
|
|
577
|
-
kind: 'type',
|
|
578
|
-
definition: "type Instruction = { operation: 'reorder-before' | 'reorder-after' | 'combine'; blocked: boolean; axis: 'horizontal' | 'vertical' }"
|
|
579
|
-
}, {
|
|
580
|
-
name: 'isUIAnalyticsEvent',
|
|
581
|
-
description: 'Type-guard that returns true if the given value is a `UIAnalyticsEvent` (including instances from older copies of `analytics-next`).',
|
|
582
|
-
status: 'general-availability',
|
|
583
|
-
usageGuidelines: ['Use in listener handlers when you receive events from third-party code and need to narrow before reading `.payload`.'],
|
|
584
|
-
keywords: ['analytics', 'guard', 'isUIAnalyticsEvent', 'analytics-next'],
|
|
585
|
-
category: 'analytics',
|
|
586
|
-
package: '@atlaskit/analytics-next',
|
|
587
|
-
examples: [],
|
|
588
|
-
kind: 'function',
|
|
589
|
-
parameters: [{
|
|
590
|
-
name: 'obj',
|
|
591
|
-
type: 'unknown'
|
|
592
|
-
}],
|
|
593
|
-
returns: {
|
|
594
|
-
type: 'boolean'
|
|
595
|
-
},
|
|
596
|
-
signature: '(obj: unknown) => obj is UIAnalyticsEvent'
|
|
597
|
-
}, {
|
|
598
|
-
name: 'mockWindowStorage',
|
|
599
|
-
description: 'Test helper that replaces `window.localStorage` and/or `window.sessionStorage` with an in-memory `STORAGE_MOCK` so unit tests can exercise storage-dependent code without touching the real browser storage (and without crashing in jsdom environments where storage may be disabled).',
|
|
600
|
-
status: 'general-availability',
|
|
601
|
-
usageGuidelines: ['Call once per test (in `beforeEach`) — each call installs a fresh `STORAGE_MOCK`, so tests are isolated.', 'Handles SSR/jsdom environments where `window` may be undefined — safe to call in any Jest test.', 'Production code must never call this. It is wired up under the `./local-storage` subpath alongside the test mock.'],
|
|
602
|
-
keywords: ['utility', 'mockWindowStorage', 'storage', 'test', 'frontend-utilities'],
|
|
603
|
-
category: 'utilities',
|
|
604
|
-
package: '@atlaskit/frontend-utilities',
|
|
605
|
-
examples: [],
|
|
606
|
-
kind: 'function',
|
|
607
|
-
parameters: [{
|
|
608
|
-
name: 'storageToMock',
|
|
609
|
-
type: "('localStorage' | 'sessionStorage')[]",
|
|
610
|
-
description: 'Which storage objects to replace. Defaults to both.',
|
|
611
|
-
defaultValue: "['localStorage', 'sessionStorage']",
|
|
612
|
-
isOptional: true
|
|
613
|
-
}],
|
|
614
|
-
returns: {
|
|
615
|
-
type: 'void'
|
|
616
|
-
},
|
|
617
|
-
signature: "(storageToMock?: ('localStorage' | 'sessionStorage')[]) => void"
|
|
618
618
|
}, {
|
|
619
619
|
name: 'promiseDebounce',
|
|
620
620
|
description: 'Higher-order helper that returns a debounced wrapper around an async function. Each call cancels the previous pending timeout, so only the final invocation within `time` ms actually runs `cb`. Earlier callers receive promises that remain **pending forever** — they are never rejected.',
|
|
@@ -676,138 +676,6 @@ var atlaskitUtilities = exports.atlaskitUtilities = [{
|
|
|
676
676
|
description: 'Resolves with the parsed JSON body. Rejects with `NetworkError` for string errors / `TypeError` (typically network failures), or with the raw `Response` for unexpected status codes.'
|
|
677
677
|
},
|
|
678
678
|
signature: '<T = JsonLd.Response>(method: string, url: string, data?: any, headers?: HeadersInit, statuses?: number[]) => Promise<T>'
|
|
679
|
-
}, {
|
|
680
|
-
name: 'resetA11yAuditSkip',
|
|
681
|
-
description: 'Clears the per-test skip flag set by `skipA11yAudit()`. Called automatically by the test setup so consumers rarely invoke this directly.',
|
|
682
|
-
status: 'general-availability',
|
|
683
|
-
usageGuidelines: ['Only call this manually if you are running a custom jest harness that does not already invoke `autoA11yCheck()`.'],
|
|
684
|
-
keywords: ['accessibility', 'a11y', 'resetA11yAuditSkip', 'jest', 'testing'],
|
|
685
|
-
category: 'testing',
|
|
686
|
-
package: '@af/accessibility-testing',
|
|
687
|
-
examples: [],
|
|
688
|
-
kind: 'function',
|
|
689
|
-
signature: '() => void'
|
|
690
|
-
}, {
|
|
691
|
-
name: 'retryOnException',
|
|
692
|
-
description: 'Retries an async `invokeOperation` while the most recent error is in the `retryOn` allow-list, sleeping between attempts per `intervalsMS`. The sleep schedule defines both the number of retries and the delays between them — `intervalsMS: [0, 50, 100]` means "try once, then up to three retries at 0 ms, 50 ms, and 100 ms".',
|
|
693
|
-
status: 'general-availability',
|
|
694
|
-
usageGuidelines: ['Pre-baked schedules live in `@atlaskit/frontend-utilities/retry-operation`: `NO_RETRIES`, `UP_TO_TWO_INSTANT_RETRIES`, `DEFAULT_RETRIES` (`[0, 50, 100]`), `LAZY_LOAD_RETRIES` (`[100, 500, 1000]`). Prefer one of those over hand-rolled arrays so retry semantics stay consistent across products.', '`retryOn` is allow-list, not deny-list — unmatched errors short-circuit and reject immediately. Throw `FailedFetchError` (or your own type that extends `Error`) from inside `invokeOperation` to opt into retries.', '`captureException` should fire-and-forget — do not throw from it, or the retry loop bails. Use it for Sentry reporting on every attempt.'],
|
|
695
|
-
keywords: ['utility', 'retryOnException', 'retry', 'fetch', 'frontend-utilities'],
|
|
696
|
-
category: 'utilities',
|
|
697
|
-
package: '@atlaskit/frontend-utilities',
|
|
698
|
-
examples: [],
|
|
699
|
-
kind: 'function',
|
|
700
|
-
parameters: [{
|
|
701
|
-
name: 'invokeOperation',
|
|
702
|
-
type: '() => Promise<T>',
|
|
703
|
-
description: 'The async operation to attempt. Called once per attempt.'
|
|
704
|
-
}, {
|
|
705
|
-
name: 'config',
|
|
706
|
-
type: '{ intervalsMS?: readonly number[]; retryOn?: (typeof Error)[] | ((e: Error) => boolean); captureException?: (error: Error, tags?: Record<string, string>) => void; onRetry?: (previousErr: Error) => void }',
|
|
707
|
-
description: '`intervalsMS` defaults to `NO_RETRIES` (no retries). `retryOn` defaults to `[FailedFetchError]`. `captureException` is called for every caught error, including the final one. `onRetry` fires only between attempts, never before the first.'
|
|
708
|
-
}],
|
|
709
|
-
returns: {
|
|
710
|
-
type: 'Promise<T>',
|
|
711
|
-
description: 'Resolves with the operation result on the first successful attempt. Rejects with the last caught error once `intervalsMS` is exhausted or an unmatched error is thrown.'
|
|
712
|
-
},
|
|
713
|
-
signature: '<T>(invokeOperation: () => Promise<T>, config: RetryConfig) => Promise<T>'
|
|
714
|
-
}, {
|
|
715
|
-
name: 'shouldSkipA11yTest',
|
|
716
|
-
description: 'Returns true when the current jest test path falls under a package that is excluded from automatic auditing (e.g. tooling-only packages with no React surface).',
|
|
717
|
-
status: 'general-availability',
|
|
718
|
-
usageGuidelines: ['Used internally by `autoA11yCheck()`. Consumers typically should not call this directly — surface a skip via `skipA11yAudit()` instead.'],
|
|
719
|
-
keywords: ['accessibility', 'a11y', 'shouldSkipA11yTest', 'jest', 'testing'],
|
|
720
|
-
category: 'testing',
|
|
721
|
-
package: '@af/accessibility-testing',
|
|
722
|
-
examples: [],
|
|
723
|
-
kind: 'function',
|
|
724
|
-
signature: '() => boolean'
|
|
725
|
-
}, {
|
|
726
|
-
name: 'simpleHash',
|
|
727
|
-
description: 'Deterministic 32-bit string hash rendered in base-36 (e.g. `"hello" -> "y2sl1f"`). Stable across runs for the same input. NOT cryptographic — collisions are easy and the algorithm is not suitable for security.',
|
|
728
|
-
status: 'general-availability',
|
|
729
|
-
usageGuidelines: ['Use for stable cache keys, telemetry-bucket assignments, or generating short anonymous identifiers from a known input.', 'Do NOT use for password hashing, signing, or anything else where collisions or pre-image resistance matter.', 'Output is stable across runtimes — safe to embed in URLs and analytics events.'],
|
|
730
|
-
keywords: ['utility', 'simpleHash', 'hash', 'frontend-utilities'],
|
|
731
|
-
category: 'utilities',
|
|
732
|
-
package: '@atlaskit/frontend-utilities',
|
|
733
|
-
examples: [],
|
|
734
|
-
kind: 'function',
|
|
735
|
-
parameters: [{
|
|
736
|
-
name: 'str',
|
|
737
|
-
type: 'string',
|
|
738
|
-
description: 'Input to hash.'
|
|
739
|
-
}],
|
|
740
|
-
returns: {
|
|
741
|
-
type: 'string',
|
|
742
|
-
description: 'Base-36 representation of a 32-bit signed-to-unsigned hash.'
|
|
743
|
-
},
|
|
744
|
-
signature: '(str: string) => string'
|
|
745
|
-
}, {
|
|
746
|
-
name: 'skipA11yAudit',
|
|
747
|
-
description: 'Marks the current test so that `autoA11yCheck()` skips its audit. The skip is one-shot — it is cleared by `resetA11yAuditSkip()` between tests.',
|
|
748
|
-
status: 'general-availability',
|
|
749
|
-
usageGuidelines: ['Use sparingly. Prefer fixing the violation, or scoping the test to a smaller fixture, before reaching for a skip.', 'Always leave a comment next to the call explaining why the audit is skipped (e.g. tracked violation link or external library limitation).'],
|
|
750
|
-
keywords: ['accessibility', 'a11y', 'skipA11yAudit', 'jest', 'testing'],
|
|
751
|
-
category: 'testing',
|
|
752
|
-
package: '@af/accessibility-testing',
|
|
753
|
-
examples: [],
|
|
754
|
-
kind: 'function',
|
|
755
|
-
signature: '() => void'
|
|
756
|
-
}, {
|
|
757
|
-
name: 'STORAGE_MOCK',
|
|
758
|
-
description: 'In-memory implementation of the DOM `Storage` interface used by `mockWindowStorage`. Exported directly so tests that need their own scoped mock (e.g. for `globalThis` shimming or browser-extension storage) can use it as a building block.',
|
|
759
|
-
status: 'general-availability',
|
|
760
|
-
usageGuidelines: ['Prefer `mockWindowStorage()` for typical Jest setups. Reach for `STORAGE_MOCK` directly only when you need to install storage somewhere other than `window` (e.g. a worker global).', 'The mock is mutable and shared — wrap it with `{ ...STORAGE_MOCK }` before installing if you want per-test isolation manually.'],
|
|
761
|
-
keywords: ['constant', 'STORAGE_MOCK', 'storage', 'test', 'frontend-utilities'],
|
|
762
|
-
category: 'utilities',
|
|
763
|
-
package: '@atlaskit/frontend-utilities',
|
|
764
|
-
examples: [],
|
|
765
|
-
kind: 'constant',
|
|
766
|
-
type: 'Storage',
|
|
767
|
-
value: '{ length: 0; getItem(id); setItem(id, val); removeItem(id); clear(); key(index) } — backed by an in-memory `_data` record.'
|
|
768
|
-
}, {
|
|
769
|
-
name: 'toBeSuspendable',
|
|
770
|
-
description: 'Jest matcher that asserts the given render thunk suspends at least once before settling. Imported for the side effect of registering itself onto `expect`.',
|
|
771
|
-
status: 'general-availability',
|
|
772
|
-
usageGuidelines: ['Pass a thunk that returns a `ReactNode` (`() => <App />`), not a component or an element directly. The matcher needs to re-invoke the thunk across renders.', 'Import the module once from your jest setup file — the matcher self-registers on import.'],
|
|
773
|
-
keywords: ['testing', 'jest', 'matcher', 'suspense', 'toBeSuspendable'],
|
|
774
|
-
category: 'testing',
|
|
775
|
-
package: '@af/react-unit-testing',
|
|
776
|
-
examples: [],
|
|
777
|
-
kind: 'function',
|
|
778
|
-
signature: 'expect(() => ReactNode).toBeSuspendable()'
|
|
779
|
-
}, {
|
|
780
|
-
name: 'toPassStrictMode',
|
|
781
|
-
description: 'Jest matcher that asserts the given component does not log any of the known React Strict Mode warnings (legacy lifecycles, legacy context, etc.).',
|
|
782
|
-
status: 'general-availability',
|
|
783
|
-
usageGuidelines: ['Run on the root component you want to certify — strict-mode warnings bubble down, so a passing root means the whole subtree is clean.', 'Failures print the offending warning verbatim. Resolve by migrating off the deprecated API rather than suppressing the warning.'],
|
|
784
|
-
keywords: ['testing', 'jest', 'matcher', 'strict-mode', 'toPassStrictMode'],
|
|
785
|
-
category: 'testing',
|
|
786
|
-
package: '@af/react-unit-testing',
|
|
787
|
-
examples: [],
|
|
788
|
-
kind: 'function',
|
|
789
|
-
signature: 'expect(() => ReactNode).toPassStrictMode()'
|
|
790
|
-
}, {
|
|
791
|
-
name: 'TResource',
|
|
792
|
-
description: 'Public shape of the value returned by `getSuspenseResource()`. Useful when stashing a resource on a ref or passing it between helpers.',
|
|
793
|
-
status: 'general-availability',
|
|
794
|
-
keywords: ['testing', 'suspense', 'type', 'TResource'],
|
|
795
|
-
category: 'testing',
|
|
796
|
-
package: '@af/react-unit-testing',
|
|
797
|
-
examples: [],
|
|
798
|
-
kind: 'type',
|
|
799
|
-
definition: 'type TResource = { read: () => void | never; load: () => { complete: () => Promise<void>; fail: () => Promise<void> } }'
|
|
800
|
-
}, {
|
|
801
|
-
name: 'UIAnalyticsEventHandler',
|
|
802
|
-
description: 'Signature for any function that receives events from an `AnalyticsListener`. Implement to forward events to your analytics SDK.',
|
|
803
|
-
status: 'general-availability',
|
|
804
|
-
usageGuidelines: ['Handlers must not throw — analytics must never crash product UI. The runtime swallows handler errors in production and logs them in development.'],
|
|
805
|
-
keywords: ['analytics', 'type', 'handler', 'UIAnalyticsEventHandler', 'analytics-next'],
|
|
806
|
-
category: 'analytics',
|
|
807
|
-
package: '@atlaskit/analytics-next',
|
|
808
|
-
examples: [],
|
|
809
|
-
kind: 'type',
|
|
810
|
-
definition: '(event: UIAnalyticsEvent, channel?: string) => void'
|
|
811
679
|
}, {
|
|
812
680
|
name: 'withFeatureFlaggedComponent',
|
|
813
681
|
description: 'Higher-order component that swaps between two implementations based on a feature-gate function. Lets a package ship a new component behind a gate without forking the consuming call sites. The gate function is invoked per render — pass `() => fg("my_gate_name")`.',
|