@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.
Files changed (28) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/compass.yml +38 -0
  3. package/dist/cjs/tools/get-all-components/components.codegen.js +2 -2
  4. package/dist/cjs/tools/get-atlaskit-components/atlaskit-components.codegen.js +3 -3625
  5. package/dist/cjs/tools/get-atlaskit-hooks/atlaskit-hooks.codegen.js +101 -33
  6. package/dist/cjs/tools/get-atlaskit-utilities/atlaskit-utilities.codegen.js +304 -436
  7. package/dist/cjs/tools/get-guidelines/guidelines-structured-content.codegen.js +4 -7
  8. package/dist/cjs/tools/get-lint-rules/lint-rules-structured-content.codegen.js +2 -6
  9. package/dist/es2019/tools/get-all-components/components.codegen.js +2 -2
  10. package/dist/es2019/tools/get-atlaskit-components/atlaskit-components.codegen.js +2 -3618
  11. package/dist/es2019/tools/get-atlaskit-hooks/atlaskit-hooks.codegen.js +101 -33
  12. package/dist/es2019/tools/get-atlaskit-utilities/atlaskit-utilities.codegen.js +304 -436
  13. package/dist/es2019/tools/get-guidelines/guidelines-structured-content.codegen.js +4 -7
  14. package/dist/es2019/tools/get-lint-rules/lint-rules-structured-content.codegen.js +2 -6
  15. package/dist/esm/tools/get-all-components/components.codegen.js +2 -2
  16. package/dist/esm/tools/get-atlaskit-components/atlaskit-components.codegen.js +2 -3618
  17. package/dist/esm/tools/get-atlaskit-hooks/atlaskit-hooks.codegen.js +101 -33
  18. package/dist/esm/tools/get-atlaskit-utilities/atlaskit-utilities.codegen.js +304 -436
  19. package/dist/esm/tools/get-guidelines/guidelines-structured-content.codegen.js +4 -7
  20. package/dist/esm/tools/get-lint-rules/lint-rules-structured-content.codegen.js +2 -6
  21. package/dist/types/tools/get-all-components/components.codegen.d.ts +1 -1
  22. package/dist/types/tools/get-atlaskit-components/atlaskit-components.codegen.d.ts +1 -1
  23. package/dist/types/tools/get-atlaskit-hooks/atlaskit-hooks.codegen.d.ts +1 -1
  24. package/dist/types/tools/get-atlaskit-utilities/atlaskit-utilities.codegen.d.ts +1 -1
  25. package/dist/types/tools/get-guidelines/guidelines-structured-content.codegen.d.ts +1 -1
  26. package/dist/types/tools/get-lint-rules/lint-rules-structured-content.codegen.d.ts +1 -1
  27. package/dist/types/tools/types.d.ts +14 -0
  28. package/package.json +2 -2
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * Structured content utilities from design-system *.docs.tsx files
5
5
  *
6
- * @codegen <<SignedSource::5377d3666260be828ea690f4b3ef04b7>>
6
+ * @codegen <<SignedSource::967196502e12df47cd3e9e9a05dcdaea>>
7
7
  * @codegenCommand yarn workspace @af/ads-ai-tooling codegen:atlaskit-utilities
8
8
  */
9
9
  /* eslint-disable @repo/internal/react/boolean-prop-naming-convention -- not our types */
@@ -29,108 +29,346 @@ export var atlaskitUtilities = [{
29
29
  examples: [],
30
30
  kind: 'function'
31
31
  }, {
32
- name: 'announce',
33
- description: 'Pushes a message to the shared visually-hidden live region (creating it lazily on first call). The update is debounced by ~1s so that focus-change events around the drag do not interrupt the announcement.',
32
+ name: 'autoA11yCheck',
33
+ 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.',
34
+ status: 'general-availability',
35
+ 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.'],
36
+ keywords: ['accessibility', 'a11y', 'autoA11yCheck', 'sa11y', 'jest', 'testing'],
37
+ category: 'testing',
38
+ package: '@af/accessibility-testing',
39
+ examples: [],
40
+ kind: 'function',
41
+ signature: '() => void'
42
+ }, {
43
+ name: 'axe',
44
+ 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.',
34
45
  status: 'general-availability',
35
- usageGuidelines: ['Call `announce` from drag lifecycle callbacks (`onDragStart`, `onDrop`, custom keyboard shortcuts) when the next state change has no other accessible signal.', 'Keep messages short and use the imperative ("Picked up card 3", "Moved to top of list") long sentences are likely to be interrupted by the next focus change.', 'Localise messages at the call site; this package does no translation.'],
36
- accessibilityGuidelines: ['Pairs with the rest of `@atlaskit/pragmatic-drag-and-drop-react-accessibility`. Use this when neither focus movement nor visible text already communicates the change to assistive tech.'],
37
- keywords: ['pragmatic-drag-and-drop', 'pdnd', 'live-region', 'a11y', 'announce', 'screen-reader'],
38
- category: 'drag-and-drop',
39
- package: '@atlaskit/pragmatic-drag-and-drop-live-region',
46
+ 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."],
47
+ keywords: ['accessibility', 'a11y', 'axe', 'jest-axe', 'testing'],
48
+ category: 'testing',
49
+ package: '@af/accessibility-testing',
40
50
  examples: [],
41
51
  kind: 'function',
42
52
  parameters: [{
43
- name: 'message',
44
- type: 'string',
45
- description: 'Plain text to be read by screen readers.'
53
+ name: 'html',
54
+ type: 'Element | string',
55
+ 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).',
56
+ isOptional: true
57
+ }, {
58
+ name: 'options',
59
+ type: 'JestAxeConfigureOptions',
60
+ description: 'Axe configuration overrides merged on top of the design-system defaults.',
61
+ isOptional: true
46
62
  }],
47
63
  returns: {
48
- type: 'void'
64
+ type: 'Promise<AxeResults>',
65
+ description: 'Resolves with the full axe results once the no-violations assertion passes.'
49
66
  },
50
- signature: '(message: string) => void'
67
+ signature: '(html?: Element | string, options?: JestAxeConfigureOptions) => Promise<AxeResults>'
68
+ }, {
69
+ name: 'resetA11yAuditSkip',
70
+ description: 'Clears the per-test skip flag set by `skipA11yAudit()`. Called automatically by the test setup so consumers rarely invoke this directly.',
71
+ status: 'general-availability',
72
+ usageGuidelines: ['Only call this manually if you are running a custom jest harness that does not already invoke `autoA11yCheck()`.'],
73
+ keywords: ['accessibility', 'a11y', 'resetA11yAuditSkip', 'jest', 'testing'],
74
+ category: 'testing',
75
+ package: '@af/accessibility-testing',
76
+ examples: [],
77
+ kind: 'function',
78
+ signature: '() => void'
79
+ }, {
80
+ name: 'shouldSkipA11yTest',
81
+ 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).',
82
+ status: 'general-availability',
83
+ usageGuidelines: ['Used internally by `autoA11yCheck()`. Consumers typically should not call this directly — surface a skip via `skipA11yAudit()` instead.'],
84
+ keywords: ['accessibility', 'a11y', 'shouldSkipA11yTest', 'jest', 'testing'],
85
+ category: 'testing',
86
+ package: '@af/accessibility-testing',
87
+ examples: [],
88
+ kind: 'function',
89
+ signature: '() => boolean'
90
+ }, {
91
+ name: 'skipA11yAudit',
92
+ description: 'Marks the current test so that `autoA11yCheck()` skips its audit. The skip is one-shot — it is cleared by `resetA11yAuditSkip()` between tests.',
93
+ status: 'general-availability',
94
+ 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).'],
95
+ keywords: ['accessibility', 'a11y', 'skipA11yAudit', 'jest', 'testing'],
96
+ category: 'testing',
97
+ package: '@af/accessibility-testing',
98
+ examples: [],
99
+ kind: 'function',
100
+ signature: '() => void'
101
+ }, {
102
+ name: 'getSuspenseResource',
103
+ 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.',
104
+ status: 'general-availability',
105
+ 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.'],
106
+ keywords: ['testing', 'suspense', 'react', 'getSuspenseResource'],
107
+ category: 'testing',
108
+ package: '@af/react-unit-testing',
109
+ examples: [],
110
+ kind: 'function',
111
+ parameters: [],
112
+ returns: {
113
+ type: 'TResource',
114
+ 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.'
115
+ },
116
+ signature: '() => TResource'
117
+ }, {
118
+ name: 'toBeSuspendable',
119
+ 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`.',
120
+ status: 'general-availability',
121
+ 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.'],
122
+ keywords: ['testing', 'jest', 'matcher', 'suspense', 'toBeSuspendable'],
123
+ category: 'testing',
124
+ package: '@af/react-unit-testing',
125
+ examples: [],
126
+ kind: 'function',
127
+ signature: 'expect(() => ReactNode).toBeSuspendable()'
128
+ }, {
129
+ name: 'toPassStrictMode',
130
+ description: 'Jest matcher that asserts the given component does not log any of the known React Strict Mode warnings (legacy lifecycles, legacy context, etc.).',
131
+ status: 'general-availability',
132
+ 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.'],
133
+ keywords: ['testing', 'jest', 'matcher', 'strict-mode', 'toPassStrictMode'],
134
+ category: 'testing',
135
+ package: '@af/react-unit-testing',
136
+ examples: [],
137
+ kind: 'function',
138
+ signature: 'expect(() => ReactNode).toPassStrictMode()'
139
+ }, {
140
+ name: 'TResource',
141
+ description: 'Public shape of the value returned by `getSuspenseResource()`. Useful when stashing a resource on a ref or passing it between helpers.',
142
+ status: 'general-availability',
143
+ keywords: ['testing', 'suspense', 'type', 'TResource'],
144
+ category: 'testing',
145
+ package: '@af/react-unit-testing',
146
+ examples: [],
147
+ kind: 'type',
148
+ definition: 'type TResource = { read: () => void | never; load: () => { complete: () => Promise<void>; fail: () => Promise<void> } }'
51
149
  }, {
52
- name: 'attachClosestEdge',
53
- description: 'Imported from `@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge`. Computes which of the `allowedEdges` of an element is closest to the pointer and stores the result against a private symbol in `userData`. Pair with `extractClosestEdge` in `onDrop` for type-safe lookup.',
150
+ name: 'createAndFireEvent',
151
+ 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.',
54
152
  status: 'general-availability',
55
- usageGuidelines: ['Call from inside a drop target `getData` so the closest edge tracks the pointer as it moves.', 'Always pair with `extractClosestEdge` the value is stored against a non-public `Symbol` and is not directly accessible.'],
56
- keywords: ['pdnd', 'hitbox', 'attachClosestEdge', 'edge'],
57
- category: 'drag-and-drop',
58
- package: '@atlaskit/pragmatic-drag-and-drop-hitbox',
153
+ usageGuidelines: ['Reach for `createAndFireEvent` when you want a one-liner inside an event handler. For more complex flows, build and fire the event explicitly.'],
154
+ keywords: ['analytics', 'utility', 'createAndFireEvent', 'analytics-next'],
155
+ category: 'analytics',
156
+ package: '@atlaskit/analytics-next',
59
157
  examples: [],
60
158
  kind: 'function',
61
159
  parameters: [{
62
- name: 'userData',
63
- type: 'Record<string | symbol, unknown>',
64
- description: 'The data object you are returning from the drop target `getData`. Returned as a new object — non-mutating.'
160
+ name: 'channel',
161
+ type: 'string',
162
+ description: 'Optional channel to fire on.',
163
+ isOptional: true
164
+ }, {
165
+ name: 'payload',
166
+ type: 'AnalyticsEventPayload'
65
167
  }, {
66
- name: 'opts',
67
- type: '{ element: Element; input: Input; allowedEdges: Edge[] }',
68
- description: '`element` is the drop target DOM node, `input` is the pointer input from the drop event, `allowedEdges` is the subset of `top` | `right` | `bottom` | `left` that should be considered.'
168
+ name: 'createAnalyticsEvent',
169
+ type: 'CreateUIAnalyticsEvent',
170
+ description: 'The factory from `useAnalyticsEvents()` or `withAnalyticsEvents`.'
69
171
  }],
70
172
  returns: {
71
- type: 'Record<string | symbol, unknown>',
72
- description: 'A shallow copy of `userData` with the closest edge attached.'
173
+ type: 'UIAnalyticsEvent',
174
+ description: 'The original (un-cloned) consumer event so callers can attach further context.'
73
175
  },
74
- signature: '(userData: Record<string | symbol, unknown>, opts: { element: Element; input: Input; allowedEdges: Edge[] }) => Record<string | symbol, unknown>'
176
+ signature: '(channel?: string) => (payload: AnalyticsEventPayload) => (createAnalyticsEvent: CreateUIAnalyticsEvent) => UIAnalyticsEvent'
75
177
  }, {
76
- name: 'attachInstruction',
77
- description: 'Imported from `@atlaskit/pragmatic-drag-and-drop-hitbox/list-item`. Computes a list-item drop instruction (reorder-before, reorder-after, or combine) based on the operations declared as available, then stores it against `userData`. Disabled operations are silently ignored so the hitbox auto-adjusts.',
178
+ name: 'isUIAnalyticsEvent',
179
+ description: 'Type-guard that returns true if the given value is a `UIAnalyticsEvent` (including instances from older copies of `analytics-next`).',
78
180
  status: 'general-availability',
79
- usageGuidelines: ['Use when implementing list reorder UI — pair with `extractInstruction` in `onDrop` to perform the actual move.', 'When all operations are `"not-available"` the helper returns `userData` unchanged; `extractInstruction` will then return `null`.'],
80
- keywords: ['pdnd', 'hitbox', 'attachInstruction', 'reorder', 'list-item'],
81
- category: 'drag-and-drop',
82
- package: '@atlaskit/pragmatic-drag-and-drop-hitbox',
181
+ usageGuidelines: ['Use in listener handlers when you receive events from third-party code and need to narrow before reading `.payload`.'],
182
+ keywords: ['analytics', 'guard', 'isUIAnalyticsEvent', 'analytics-next'],
183
+ category: 'analytics',
184
+ package: '@atlaskit/analytics-next',
83
185
  examples: [],
84
186
  kind: 'function',
85
187
  parameters: [{
86
- name: 'userData',
87
- type: 'Record<string | symbol, unknown>'
88
- }, {
89
- name: 'opts',
90
- type: "{ operations: { 'reorder-before'?: Availability; 'reorder-after'?: Availability; combine?: Availability }; element: Element; input: Input; axis?: Axis }",
91
- description: 'Each operation defaults to `"not-available"`. `axis` defaults to `"vertical"` for traditional top-to-bottom lists.'
188
+ name: 'obj',
189
+ type: 'unknown'
92
190
  }],
93
191
  returns: {
94
- type: 'Record<string | symbol, unknown>'
192
+ type: 'boolean'
95
193
  },
96
- signature: "(userData: Record<string | symbol, unknown>, opts: { operations: { [op: string]: 'available' | 'blocked' | 'not-available' }; element: Element; input: Input; axis?: 'horizontal' | 'vertical' }) => Record<string | symbol, unknown>"
194
+ signature: '(obj: unknown) => obj is UIAnalyticsEvent'
97
195
  }, {
98
- name: 'autoA11yCheck',
99
- 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.',
196
+ name: 'UIAnalyticsEventHandler',
197
+ description: 'Signature for any function that receives events from an `AnalyticsListener`. Implement to forward events to your analytics SDK.',
100
198
  status: 'general-availability',
101
- 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.'],
102
- keywords: ['accessibility', 'a11y', 'autoA11yCheck', 'sa11y', 'jest', 'testing'],
103
- category: 'testing',
104
- package: '@af/accessibility-testing',
199
+ usageGuidelines: ['Handlers must not throwanalytics must never crash product UI. The runtime swallows handler errors in production and logs them in development.'],
200
+ keywords: ['analytics', 'type', 'handler', 'UIAnalyticsEventHandler', 'analytics-next'],
201
+ category: 'analytics',
202
+ package: '@atlaskit/analytics-next',
203
+ examples: [],
204
+ kind: 'type',
205
+ definition: '(event: UIAnalyticsEvent, channel?: string) => void'
206
+ }, {
207
+ name: 'quickInsertPlugin',
208
+ description: 'Quick insert plugin for @atlaskit/editor-core',
209
+ status: 'general-availability',
210
+ usageGuidelines: [],
211
+ accessibilityGuidelines: [],
212
+ keywords: ['editor', 'editor-plugin-quick-insert', 'atlaskit'],
213
+ category: 'editor',
214
+ package: '@atlaskit/editor-plugin-quick-insert',
105
215
  examples: [],
106
216
  kind: 'function',
107
- signature: '() => void'
217
+ signature: 'quickInsertPlugin: QuickInsertPlugin'
108
218
  }, {
109
- name: 'axe',
110
- 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.',
219
+ name: 'CustomAttributes',
220
+ 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.',
111
221
  status: 'general-availability',
112
- 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."],
113
- keywords: ['accessibility', 'a11y', 'axe', 'jest-axe', 'testing'],
114
- category: 'testing',
115
- package: '@af/accessibility-testing',
222
+ usageGuidelines: ['Keep custom attribute names stable downstream analytics queries pivot on them. Coordinate any rename with the data-platform team before shipping.'],
223
+ keywords: ['feature-flag', 'type', 'CustomAttributes', 'exposure'],
224
+ category: 'experimentation',
225
+ package: '@atlaskit/feature-flag-client',
226
+ examples: [],
227
+ kind: 'type',
228
+ definition: 'type CustomAttributes = { [attributeName: string]: string | number | boolean | object }'
229
+ }, {
230
+ name: 'ExposureTriggerReason',
231
+ 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.',
232
+ status: 'general-availability',
233
+ usageGuidelines: ['Use the enum members rather than literal strings when calling `trackFeatureFlag({ triggerReason })` — the literal values change if the backend renames a reason.'],
234
+ keywords: ['feature-flag', 'exposure', 'enum', 'ExposureTriggerReason'],
235
+ category: 'experimentation',
236
+ package: '@atlaskit/feature-flag-client',
237
+ examples: [],
238
+ kind: 'constant',
239
+ type: 'enum ExposureTriggerReason',
240
+ value: '{ OptIn = "optInExposure", Manual = "manualExposure", Default = "defaultExposure", AutoExposure = "autoExposure", hasCustomAttributes = "hasCustomAttributes" }'
241
+ }, {
242
+ name: 'FeatureFlagClient',
243
+ 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.',
244
+ status: 'general-availability',
245
+ 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.'],
246
+ keywords: ['feature-flag', 'feature-gate', 'experiment', 'switcheroo', 'FeatureFlagClient', 'client'],
247
+ category: 'experimentation',
248
+ package: '@atlaskit/feature-flag-client',
249
+ examples: [],
250
+ kind: 'constant',
251
+ type: 'class FeatureFlagClient',
252
+ 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'
253
+ }, {
254
+ name: 'FlagValue',
255
+ description: 'Union of the value types a flag can return: `boolean | string | object`.',
256
+ status: 'general-availability',
257
+ keywords: ['feature-flag', 'type', 'FlagValue'],
258
+ category: 'experimentation',
259
+ package: '@atlaskit/feature-flag-client',
260
+ examples: [],
261
+ kind: 'type',
262
+ definition: 'type FlagValue = boolean | string | object'
263
+ }, {
264
+ name: 'convertToError',
265
+ 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`.',
266
+ status: 'general-availability',
267
+ 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.'],
268
+ keywords: ['utility', 'convertToError', 'error', 'frontend-utilities'],
269
+ category: 'utilities',
270
+ package: '@atlaskit/frontend-utilities',
116
271
  examples: [],
117
272
  kind: 'function',
118
273
  parameters: [{
119
- name: 'html',
120
- type: 'Element | string',
121
- 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).',
274
+ name: 'e',
275
+ type: 'unknown',
276
+ description: 'The caught value. Already-`Error` instances are returned unchanged.'
277
+ }],
278
+ returns: {
279
+ type: 'Error',
280
+ 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).'
281
+ },
282
+ signature: '(e: unknown) => Error'
283
+ }, {
284
+ name: 'mockWindowStorage',
285
+ 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).',
286
+ status: 'general-availability',
287
+ 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.'],
288
+ keywords: ['utility', 'mockWindowStorage', 'storage', 'test', 'frontend-utilities'],
289
+ category: 'utilities',
290
+ package: '@atlaskit/frontend-utilities',
291
+ examples: [],
292
+ kind: 'function',
293
+ parameters: [{
294
+ name: 'storageToMock',
295
+ type: "('localStorage' | 'sessionStorage')[]",
296
+ description: 'Which storage objects to replace. Defaults to both.',
297
+ defaultValue: "['localStorage', 'sessionStorage']",
122
298
  isOptional: true
299
+ }],
300
+ returns: {
301
+ type: 'void'
302
+ },
303
+ signature: "(storageToMock?: ('localStorage' | 'sessionStorage')[]) => void"
304
+ }, {
305
+ name: 'retryOnException',
306
+ 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".',
307
+ status: 'general-availability',
308
+ 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.'],
309
+ keywords: ['utility', 'retryOnException', 'retry', 'fetch', 'frontend-utilities'],
310
+ category: 'utilities',
311
+ package: '@atlaskit/frontend-utilities',
312
+ examples: [],
313
+ kind: 'function',
314
+ parameters: [{
315
+ name: 'invokeOperation',
316
+ type: '() => Promise<T>',
317
+ description: 'The async operation to attempt. Called once per attempt.'
123
318
  }, {
124
- name: 'options',
125
- type: 'JestAxeConfigureOptions',
126
- description: 'Axe configuration overrides merged on top of the design-system defaults.',
127
- isOptional: true
319
+ name: 'config',
320
+ type: '{ intervalsMS?: readonly number[]; retryOn?: (typeof Error)[] | ((e: Error) => boolean); captureException?: (error: Error, tags?: Record<string, string>) => void; onRetry?: (previousErr: Error) => void }',
321
+ 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.'
128
322
  }],
129
323
  returns: {
130
- type: 'Promise<AxeResults>',
131
- description: 'Resolves with the full axe results once the no-violations assertion passes.'
324
+ type: 'Promise<T>',
325
+ 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.'
132
326
  },
133
- signature: '(html?: Element | string, options?: JestAxeConfigureOptions) => Promise<AxeResults>'
327
+ signature: '<T>(invokeOperation: () => Promise<T>, config: RetryConfig) => Promise<T>'
328
+ }, {
329
+ name: 'simpleHash',
330
+ 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.',
331
+ status: 'general-availability',
332
+ 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.'],
333
+ keywords: ['utility', 'simpleHash', 'hash', 'frontend-utilities'],
334
+ category: 'utilities',
335
+ package: '@atlaskit/frontend-utilities',
336
+ examples: [],
337
+ kind: 'function',
338
+ parameters: [{
339
+ name: 'str',
340
+ type: 'string',
341
+ description: 'Input to hash.'
342
+ }],
343
+ returns: {
344
+ type: 'string',
345
+ description: 'Base-36 representation of a 32-bit signed-to-unsigned hash.'
346
+ },
347
+ signature: '(str: string) => string'
348
+ }, {
349
+ name: 'STORAGE_MOCK',
350
+ 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.',
351
+ status: 'general-availability',
352
+ 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.'],
353
+ keywords: ['constant', 'STORAGE_MOCK', 'storage', 'test', 'frontend-utilities'],
354
+ category: 'utilities',
355
+ package: '@atlaskit/frontend-utilities',
356
+ examples: [],
357
+ kind: 'constant',
358
+ type: 'Storage',
359
+ value: '{ length: 0; getItem(id); setItem(id, val); removeItem(id); clear(); key(index) } — backed by an in-memory `_data` record.'
360
+ }, {
361
+ name: 'init',
362
+ description: 'INSM tooling measures user-perceived interactivity of a page',
363
+ status: 'general-availability',
364
+ usageGuidelines: [],
365
+ accessibilityGuidelines: [],
366
+ keywords: ['editor', 'insm', 'atlaskit'],
367
+ category: 'editor',
368
+ package: '@atlaskit/insm',
369
+ examples: [],
370
+ kind: 'function',
371
+ signature: 'init(options: INSMOptions): void'
134
372
  }, {
135
373
  name: 'BaseUrls',
136
374
  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.',
@@ -223,81 +461,7 @@ export var atlaskitUtilities = [{
223
461
  package: '@atlaskit/linking-common',
224
462
  examples: [],
225
463
  kind: 'type',
226
- definition: "type CardType = 'pending' | 'resolving' | 'resolved' | 'errored' | 'fallback' | 'unauthorized' | 'forbidden' | 'not_found'"
227
- }, {
228
- name: 'cleanup',
229
- 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.',
230
- status: 'general-availability',
231
- 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.'],
232
- keywords: ['pragmatic-drag-and-drop', 'pdnd', 'live-region', 'cleanup', 'teardown'],
233
- category: 'drag-and-drop',
234
- package: '@atlaskit/pragmatic-drag-and-drop-live-region',
235
- examples: [],
236
- kind: 'function',
237
- parameters: [],
238
- returns: {
239
- type: 'void'
240
- },
241
- signature: '() => void'
242
- }, {
243
- name: 'convertToError',
244
- 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`.',
245
- status: 'general-availability',
246
- 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.'],
247
- keywords: ['utility', 'convertToError', 'error', 'frontend-utilities'],
248
- category: 'utilities',
249
- package: '@atlaskit/frontend-utilities',
250
- examples: [],
251
- kind: 'function',
252
- parameters: [{
253
- name: 'e',
254
- type: 'unknown',
255
- description: 'The caught value. Already-`Error` instances are returned unchanged.'
256
- }],
257
- returns: {
258
- type: 'Error',
259
- 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).'
260
- },
261
- signature: '(e: unknown) => Error'
262
- }, {
263
- name: 'createAndFireEvent',
264
- 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.',
265
- status: 'general-availability',
266
- usageGuidelines: ['Reach for `createAndFireEvent` when you want a one-liner inside an event handler. For more complex flows, build and fire the event explicitly.'],
267
- keywords: ['analytics', 'utility', 'createAndFireEvent', 'analytics-next'],
268
- category: 'analytics',
269
- package: '@atlaskit/analytics-next',
270
- examples: [],
271
- kind: 'function',
272
- parameters: [{
273
- name: 'channel',
274
- type: 'string',
275
- description: 'Optional channel to fire on.',
276
- isOptional: true
277
- }, {
278
- name: 'payload',
279
- type: 'AnalyticsEventPayload'
280
- }, {
281
- name: 'createAnalyticsEvent',
282
- type: 'CreateUIAnalyticsEvent',
283
- description: 'The factory from `useAnalyticsEvents()` or `withAnalyticsEvents`.'
284
- }],
285
- returns: {
286
- type: 'UIAnalyticsEvent',
287
- description: 'The original (un-cloned) consumer event so callers can attach further context.'
288
- },
289
- signature: '(channel?: string) => (payload: AnalyticsEventPayload) => (createAnalyticsEvent: CreateUIAnalyticsEvent) => UIAnalyticsEvent'
290
- }, {
291
- name: 'CustomAttributes',
292
- 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.',
293
- status: 'general-availability',
294
- usageGuidelines: ['Keep custom attribute names stable — downstream analytics queries pivot on them. Coordinate any rename with the data-platform team before shipping.'],
295
- keywords: ['feature-flag', 'type', 'CustomAttributes', 'exposure'],
296
- category: 'experimentation',
297
- package: '@atlaskit/feature-flag-client',
298
- examples: [],
299
- kind: 'type',
300
- definition: 'type CustomAttributes = { [attributeName: string]: string | number | boolean | object }'
464
+ definition: "type CardType = 'pending' | 'resolving' | 'resolved' | 'errored' | 'fallback' | 'unauthorized' | 'forbidden' | 'not_found'"
301
465
  }, {
302
466
  name: 'Datasource',
303
467
  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.',
@@ -319,16 +483,6 @@ export var atlaskitUtilities = [{
319
483
  kind: 'constant',
320
484
  type: "'wide'",
321
485
  value: "'wide'"
322
- }, {
323
- name: 'Edge',
324
- description: 'Imported from `@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge`. String literal union of the four cardinal edges of a drop target.',
325
- status: 'general-availability',
326
- keywords: ['pdnd', 'hitbox', 'Edge', 'type'],
327
- category: 'drag-and-drop',
328
- package: '@atlaskit/pragmatic-drag-and-drop-hitbox',
329
- examples: [],
330
- kind: 'type',
331
- definition: "type Edge = 'top' | 'right' | 'bottom' | 'left'"
332
486
  }, {
333
487
  name: 'EnvironmentsKeys',
334
488
  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.',
@@ -339,66 +493,6 @@ export var atlaskitUtilities = [{
339
493
  examples: [],
340
494
  kind: 'type',
341
495
  definition: "type EnvironmentsKeys = 'dev' | 'development' | 'stg' | 'staging' | 'prd' | 'prod' | 'production' | 'custom'"
342
- }, {
343
- name: 'ExposureTriggerReason',
344
- 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.',
345
- status: 'general-availability',
346
- usageGuidelines: ['Use the enum members rather than literal strings when calling `trackFeatureFlag({ triggerReason })` — the literal values change if the backend renames a reason.'],
347
- keywords: ['feature-flag', 'exposure', 'enum', 'ExposureTriggerReason'],
348
- category: 'experimentation',
349
- package: '@atlaskit/feature-flag-client',
350
- examples: [],
351
- kind: 'constant',
352
- type: 'enum ExposureTriggerReason',
353
- value: '{ OptIn = "optInExposure", Manual = "manualExposure", Default = "defaultExposure", AutoExposure = "autoExposure", hasCustomAttributes = "hasCustomAttributes" }'
354
- }, {
355
- name: 'extractClosestEdge',
356
- 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.',
357
- status: 'general-availability',
358
- usageGuidelines: ['Use in `onDrag` or `onDrop` to decide whether to render the drop indicator above/below/left/right of the target.'],
359
- keywords: ['pdnd', 'hitbox', 'extractClosestEdge', 'edge'],
360
- category: 'drag-and-drop',
361
- package: '@atlaskit/pragmatic-drag-and-drop-hitbox',
362
- examples: [],
363
- kind: 'function',
364
- parameters: [{
365
- name: 'userData',
366
- type: 'Record<string | symbol, unknown>',
367
- description: 'The `userData` produced by `attachClosestEdge`, typically read from the dropped target.'
368
- }],
369
- returns: {
370
- type: 'Edge | null'
371
- },
372
- signature: '(userData: Record<string | symbol, unknown>) => Edge | null'
373
- }, {
374
- name: 'extractInstruction',
375
- 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).',
376
- status: 'general-availability',
377
- keywords: ['pdnd', 'hitbox', 'extractInstruction', 'reorder', 'list-item'],
378
- category: 'drag-and-drop',
379
- package: '@atlaskit/pragmatic-drag-and-drop-hitbox',
380
- examples: [],
381
- kind: 'function',
382
- parameters: [{
383
- name: 'userData',
384
- type: 'Record<string | symbol, unknown>'
385
- }],
386
- returns: {
387
- type: 'Instruction | null'
388
- },
389
- signature: '(userData: Record<string | symbol, unknown>) => Instruction | null'
390
- }, {
391
- name: 'FeatureFlagClient',
392
- 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.',
393
- status: 'general-availability',
394
- 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.'],
395
- keywords: ['feature-flag', 'feature-gate', 'experiment', 'switcheroo', 'FeatureFlagClient', 'client'],
396
- category: 'experimentation',
397
- package: '@atlaskit/feature-flag-client',
398
- examples: [],
399
- kind: 'constant',
400
- type: 'class FeatureFlagClient',
401
- 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'
402
496
  }, {
403
497
  name: 'filterSiteProducts',
404
498
  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.',
@@ -418,16 +512,6 @@ export var atlaskitUtilities = [{
418
512
  description: 'Predicate suitable for `Array.prototype.filter`.'
419
513
  },
420
514
  signature: '(availableSitesProducts: AvailableSitesProductType[]) => (site: AvailableSite) => boolean'
421
- }, {
422
- name: 'FlagValue',
423
- description: 'Union of the value types a flag can return: `boolean | string | object`.',
424
- status: 'general-availability',
425
- keywords: ['feature-flag', 'type', 'FlagValue'],
426
- category: 'experimentation',
427
- package: '@atlaskit/feature-flag-client',
428
- examples: [],
429
- kind: 'type',
430
- definition: 'type FlagValue = boolean | string | object'
431
515
  }, {
432
516
  name: 'getBaseUrl',
433
517
  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.',
@@ -451,25 +535,6 @@ export var atlaskitUtilities = [{
451
535
  type: 'string'
452
536
  },
453
537
  signature: '(envKey?: EnvironmentsKeys, baseUrlOverride?: string) => string'
454
- }, {
455
- name: 'getReorderDestinationIndex',
456
- 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.',
457
- status: 'general-availability',
458
- usageGuidelines: ['Use as the final step of a list reorder in `onDrop` — apply the returned index to your array model.'],
459
- keywords: ['pdnd', 'hitbox', 'getReorderDestinationIndex', 'reorder'],
460
- category: 'drag-and-drop',
461
- package: '@atlaskit/pragmatic-drag-and-drop-hitbox',
462
- examples: [],
463
- kind: 'function',
464
- parameters: [{
465
- name: 'opts',
466
- type: "{ startIndex: number; closestEdgeOfTarget: Edge | null; indexOfTarget: number; axis: 'vertical' | 'horizontal' }"
467
- }],
468
- returns: {
469
- type: 'number',
470
- description: 'The destination index. If the start and target indices are the same, or either index is `-1`, the original `startIndex` is returned unchanged.'
471
- },
472
- signature: "(opts: { startIndex: number; closestEdgeOfTarget: Edge | null; indexOfTarget: number; axis: 'horizontal' | 'vertical' }) => number"
473
538
  }, {
474
539
  name: 'getResolverUrl',
475
540
  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).',
@@ -512,22 +577,6 @@ export var atlaskitUtilities = [{
512
577
  type: 'CardType'
513
578
  },
514
579
  signature: "({ meta }: { meta: JsonLd.Response['meta'] }) => CardType"
515
- }, {
516
- name: 'getSuspenseResource',
517
- 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.',
518
- status: 'general-availability',
519
- 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.'],
520
- keywords: ['testing', 'suspense', 'react', 'getSuspenseResource'],
521
- category: 'testing',
522
- package: '@af/react-unit-testing',
523
- examples: [],
524
- kind: 'function',
525
- parameters: [],
526
- returns: {
527
- type: 'TResource',
528
- 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.'
529
- },
530
- signature: '() => TResource'
531
580
  }, {
532
581
  name: 'getUrl',
533
582
  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.',
@@ -560,55 +609,6 @@ export var atlaskitUtilities = [{
560
609
  examples: [],
561
610
  kind: 'type',
562
611
  definition: "interface InlineCardAdf { type: 'inlineCard'; attrs: { url: string } }"
563
- }, {
564
- name: 'Instruction',
565
- 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).',
566
- status: 'general-availability',
567
- keywords: ['pdnd', 'hitbox', 'Instruction', 'type', 'reorder'],
568
- category: 'drag-and-drop',
569
- package: '@atlaskit/pragmatic-drag-and-drop-hitbox',
570
- examples: [],
571
- kind: 'type',
572
- definition: "type Instruction = { operation: 'reorder-before' | 'reorder-after' | 'combine'; blocked: boolean; axis: 'horizontal' | 'vertical' }"
573
- }, {
574
- name: 'isUIAnalyticsEvent',
575
- description: 'Type-guard that returns true if the given value is a `UIAnalyticsEvent` (including instances from older copies of `analytics-next`).',
576
- status: 'general-availability',
577
- usageGuidelines: ['Use in listener handlers when you receive events from third-party code and need to narrow before reading `.payload`.'],
578
- keywords: ['analytics', 'guard', 'isUIAnalyticsEvent', 'analytics-next'],
579
- category: 'analytics',
580
- package: '@atlaskit/analytics-next',
581
- examples: [],
582
- kind: 'function',
583
- parameters: [{
584
- name: 'obj',
585
- type: 'unknown'
586
- }],
587
- returns: {
588
- type: 'boolean'
589
- },
590
- signature: '(obj: unknown) => obj is UIAnalyticsEvent'
591
- }, {
592
- name: 'mockWindowStorage',
593
- 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).',
594
- status: 'general-availability',
595
- 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.'],
596
- keywords: ['utility', 'mockWindowStorage', 'storage', 'test', 'frontend-utilities'],
597
- category: 'utilities',
598
- package: '@atlaskit/frontend-utilities',
599
- examples: [],
600
- kind: 'function',
601
- parameters: [{
602
- name: 'storageToMock',
603
- type: "('localStorage' | 'sessionStorage')[]",
604
- description: 'Which storage objects to replace. Defaults to both.',
605
- defaultValue: "['localStorage', 'sessionStorage']",
606
- isOptional: true
607
- }],
608
- returns: {
609
- type: 'void'
610
- },
611
- signature: "(storageToMock?: ('localStorage' | 'sessionStorage')[]) => void"
612
612
  }, {
613
613
  name: 'promiseDebounce',
614
614
  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.',
@@ -670,138 +670,6 @@ export var atlaskitUtilities = [{
670
670
  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.'
671
671
  },
672
672
  signature: '<T = JsonLd.Response>(method: string, url: string, data?: any, headers?: HeadersInit, statuses?: number[]) => Promise<T>'
673
- }, {
674
- name: 'resetA11yAuditSkip',
675
- description: 'Clears the per-test skip flag set by `skipA11yAudit()`. Called automatically by the test setup so consumers rarely invoke this directly.',
676
- status: 'general-availability',
677
- usageGuidelines: ['Only call this manually if you are running a custom jest harness that does not already invoke `autoA11yCheck()`.'],
678
- keywords: ['accessibility', 'a11y', 'resetA11yAuditSkip', 'jest', 'testing'],
679
- category: 'testing',
680
- package: '@af/accessibility-testing',
681
- examples: [],
682
- kind: 'function',
683
- signature: '() => void'
684
- }, {
685
- name: 'retryOnException',
686
- 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".',
687
- status: 'general-availability',
688
- 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.'],
689
- keywords: ['utility', 'retryOnException', 'retry', 'fetch', 'frontend-utilities'],
690
- category: 'utilities',
691
- package: '@atlaskit/frontend-utilities',
692
- examples: [],
693
- kind: 'function',
694
- parameters: [{
695
- name: 'invokeOperation',
696
- type: '() => Promise<T>',
697
- description: 'The async operation to attempt. Called once per attempt.'
698
- }, {
699
- name: 'config',
700
- type: '{ intervalsMS?: readonly number[]; retryOn?: (typeof Error)[] | ((e: Error) => boolean); captureException?: (error: Error, tags?: Record<string, string>) => void; onRetry?: (previousErr: Error) => void }',
701
- 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.'
702
- }],
703
- returns: {
704
- type: 'Promise<T>',
705
- 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.'
706
- },
707
- signature: '<T>(invokeOperation: () => Promise<T>, config: RetryConfig) => Promise<T>'
708
- }, {
709
- name: 'shouldSkipA11yTest',
710
- 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).',
711
- status: 'general-availability',
712
- usageGuidelines: ['Used internally by `autoA11yCheck()`. Consumers typically should not call this directly — surface a skip via `skipA11yAudit()` instead.'],
713
- keywords: ['accessibility', 'a11y', 'shouldSkipA11yTest', 'jest', 'testing'],
714
- category: 'testing',
715
- package: '@af/accessibility-testing',
716
- examples: [],
717
- kind: 'function',
718
- signature: '() => boolean'
719
- }, {
720
- name: 'simpleHash',
721
- 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.',
722
- status: 'general-availability',
723
- 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.'],
724
- keywords: ['utility', 'simpleHash', 'hash', 'frontend-utilities'],
725
- category: 'utilities',
726
- package: '@atlaskit/frontend-utilities',
727
- examples: [],
728
- kind: 'function',
729
- parameters: [{
730
- name: 'str',
731
- type: 'string',
732
- description: 'Input to hash.'
733
- }],
734
- returns: {
735
- type: 'string',
736
- description: 'Base-36 representation of a 32-bit signed-to-unsigned hash.'
737
- },
738
- signature: '(str: string) => string'
739
- }, {
740
- name: 'skipA11yAudit',
741
- description: 'Marks the current test so that `autoA11yCheck()` skips its audit. The skip is one-shot — it is cleared by `resetA11yAuditSkip()` between tests.',
742
- status: 'general-availability',
743
- 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).'],
744
- keywords: ['accessibility', 'a11y', 'skipA11yAudit', 'jest', 'testing'],
745
- category: 'testing',
746
- package: '@af/accessibility-testing',
747
- examples: [],
748
- kind: 'function',
749
- signature: '() => void'
750
- }, {
751
- name: 'STORAGE_MOCK',
752
- 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.',
753
- status: 'general-availability',
754
- 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.'],
755
- keywords: ['constant', 'STORAGE_MOCK', 'storage', 'test', 'frontend-utilities'],
756
- category: 'utilities',
757
- package: '@atlaskit/frontend-utilities',
758
- examples: [],
759
- kind: 'constant',
760
- type: 'Storage',
761
- value: '{ length: 0; getItem(id); setItem(id, val); removeItem(id); clear(); key(index) } — backed by an in-memory `_data` record.'
762
- }, {
763
- name: 'toBeSuspendable',
764
- 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`.',
765
- status: 'general-availability',
766
- 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.'],
767
- keywords: ['testing', 'jest', 'matcher', 'suspense', 'toBeSuspendable'],
768
- category: 'testing',
769
- package: '@af/react-unit-testing',
770
- examples: [],
771
- kind: 'function',
772
- signature: 'expect(() => ReactNode).toBeSuspendable()'
773
- }, {
774
- name: 'toPassStrictMode',
775
- description: 'Jest matcher that asserts the given component does not log any of the known React Strict Mode warnings (legacy lifecycles, legacy context, etc.).',
776
- status: 'general-availability',
777
- 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.'],
778
- keywords: ['testing', 'jest', 'matcher', 'strict-mode', 'toPassStrictMode'],
779
- category: 'testing',
780
- package: '@af/react-unit-testing',
781
- examples: [],
782
- kind: 'function',
783
- signature: 'expect(() => ReactNode).toPassStrictMode()'
784
- }, {
785
- name: 'TResource',
786
- description: 'Public shape of the value returned by `getSuspenseResource()`. Useful when stashing a resource on a ref or passing it between helpers.',
787
- status: 'general-availability',
788
- keywords: ['testing', 'suspense', 'type', 'TResource'],
789
- category: 'testing',
790
- package: '@af/react-unit-testing',
791
- examples: [],
792
- kind: 'type',
793
- definition: 'type TResource = { read: () => void | never; load: () => { complete: () => Promise<void>; fail: () => Promise<void> } }'
794
- }, {
795
- name: 'UIAnalyticsEventHandler',
796
- description: 'Signature for any function that receives events from an `AnalyticsListener`. Implement to forward events to your analytics SDK.',
797
- status: 'general-availability',
798
- usageGuidelines: ['Handlers must not throw — analytics must never crash product UI. The runtime swallows handler errors in production and logs them in development.'],
799
- keywords: ['analytics', 'type', 'handler', 'UIAnalyticsEventHandler', 'analytics-next'],
800
- category: 'analytics',
801
- package: '@atlaskit/analytics-next',
802
- examples: [],
803
- kind: 'type',
804
- definition: '(event: UIAnalyticsEvent, channel?: string) => void'
805
673
  }, {
806
674
  name: 'withFeatureFlaggedComponent',
807
675
  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")`.',