@atlaskit/ads-mcp 1.3.0 → 1.3.2
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/README.md +20 -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 +4 -1973
- package/dist/cjs/tools/get-atlaskit-hooks/atlaskit-hooks.codegen.js +1575 -33
- package/dist/cjs/tools/get-atlaskit-utilities/atlaskit-utilities.codegen.js +431 -436
- package/dist/cjs/tools/get-lint-rules/lint-rules-structured-content.codegen.js +4 -4
- package/dist/es2019/tools/get-all-components/components.codegen.js +2 -2
- package/dist/es2019/tools/get-atlaskit-components/atlaskit-components.codegen.js +3 -1966
- package/dist/es2019/tools/get-atlaskit-hooks/atlaskit-hooks.codegen.js +1575 -33
- package/dist/es2019/tools/get-atlaskit-utilities/atlaskit-utilities.codegen.js +431 -436
- package/dist/es2019/tools/get-lint-rules/lint-rules-structured-content.codegen.js +4 -4
- package/dist/esm/tools/get-all-components/components.codegen.js +2 -2
- package/dist/esm/tools/get-atlaskit-components/atlaskit-components.codegen.js +3 -1966
- package/dist/esm/tools/get-atlaskit-hooks/atlaskit-hooks.codegen.js +1575 -33
- package/dist/esm/tools/get-atlaskit-utilities/atlaskit-utilities.codegen.js +431 -436
- package/dist/esm/tools/get-lint-rules/lint-rules-structured-content.codegen.js +4 -4
- 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 +2 -2
- package/dist/types/tools/get-atlaskit-hooks/atlaskit-hooks.codegen.d.ts +1 -1
- package/dist/types/tools/get-atlaskit-hooks/types.d.ts +2 -1
- package/dist/types/tools/get-atlaskit-utilities/atlaskit-utilities.codegen.d.ts +1 -1
- package/dist/types/tools/get-atlaskit-utilities/types.d.ts +4 -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
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Structured content utilities from design-system *.docs.tsx files
|
|
5
5
|
*
|
|
6
|
-
* @codegen <<SignedSource::
|
|
6
|
+
* @codegen <<SignedSource::e4f346932028cd8a142bb0610697ed47>>
|
|
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,473 @@ export var atlaskitUtilities = [{
|
|
|
29
29
|
examples: [],
|
|
30
30
|
kind: 'function'
|
|
31
31
|
}, {
|
|
32
|
-
name: '
|
|
33
|
-
description: '
|
|
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: ['
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
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: '
|
|
44
|
-
type: 'string',
|
|
45
|
-
description: '
|
|
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: '
|
|
64
|
+
type: 'Promise<AxeResults>',
|
|
65
|
+
description: 'Resolves with the full axe results once the no-violations assertion passes.'
|
|
49
66
|
},
|
|
50
|
-
signature: '(
|
|
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: '
|
|
53
|
-
description: '
|
|
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: ['
|
|
56
|
-
keywords: ['
|
|
57
|
-
category: '
|
|
58
|
-
package: '@atlaskit/
|
|
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: '
|
|
63
|
-
type: '
|
|
64
|
-
description: '
|
|
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: '
|
|
67
|
-
type: '
|
|
68
|
-
description: '
|
|
168
|
+
name: 'createAnalyticsEvent',
|
|
169
|
+
type: 'CreateUIAnalyticsEvent',
|
|
170
|
+
description: 'The factory from `useAnalyticsEvents()` or `withAnalyticsEvents`.'
|
|
69
171
|
}],
|
|
70
172
|
returns: {
|
|
71
|
-
type: '
|
|
72
|
-
description: '
|
|
173
|
+
type: 'UIAnalyticsEvent',
|
|
174
|
+
description: 'The original (un-cloned) consumer event so callers can attach further context.'
|
|
73
175
|
},
|
|
74
|
-
signature: '(
|
|
176
|
+
signature: '(channel?: string) => (payload: AnalyticsEventPayload) => (createAnalyticsEvent: CreateUIAnalyticsEvent) => UIAnalyticsEvent'
|
|
75
177
|
}, {
|
|
76
|
-
name: '
|
|
77
|
-
description: '
|
|
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
|
|
80
|
-
keywords: ['
|
|
81
|
-
category: '
|
|
82
|
-
package: '@atlaskit/
|
|
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: '
|
|
87
|
-
type: '
|
|
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: '
|
|
192
|
+
type: 'boolean'
|
|
95
193
|
},
|
|
96
|
-
signature:
|
|
194
|
+
signature: '(obj: unknown) => obj is UIAnalyticsEvent'
|
|
97
195
|
}, {
|
|
98
|
-
name: '
|
|
99
|
-
description: '
|
|
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: [
|
|
102
|
-
keywords: ['
|
|
103
|
-
category: '
|
|
104
|
-
package: '@
|
|
199
|
+
usageGuidelines: ['Handlers must not throw — analytics 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
|
+
import: {
|
|
215
|
+
name: 'quickInsertPlugin',
|
|
216
|
+
package: '@atlaskit/editor-plugin-quick-insert',
|
|
217
|
+
type: 'named',
|
|
218
|
+
packagePath: '/Users/khall2/.codex/worktrees/bd80/atlassian-frontend-monorepo/platform/packages/editor/editor-plugin-quick-insert',
|
|
219
|
+
packageJson: {
|
|
220
|
+
name: '@atlaskit/editor-plugin-quick-insert',
|
|
221
|
+
version: '12.0.10',
|
|
222
|
+
description: 'Quick insert plugin for @atlaskit/editor-core',
|
|
223
|
+
author: 'Atlassian Pty Ltd',
|
|
224
|
+
license: 'Apache-2.0',
|
|
225
|
+
publishConfig: {
|
|
226
|
+
registry: 'https://registry.npmjs.org/'
|
|
227
|
+
},
|
|
228
|
+
atlassian: {
|
|
229
|
+
team: 'Editor: Lego',
|
|
230
|
+
singleton: true
|
|
231
|
+
},
|
|
232
|
+
repository: 'https://bitbucket.org/atlassian/atlassian-frontend-mirror',
|
|
233
|
+
main: 'dist/cjs/index.js',
|
|
234
|
+
module: 'dist/esm/index.js',
|
|
235
|
+
'module:es2019': 'dist/es2019/index.js',
|
|
236
|
+
types: 'dist/types/index.d.ts',
|
|
237
|
+
sideEffects: ['*.compiled.css'],
|
|
238
|
+
'atlaskit:src': 'src/index.ts',
|
|
239
|
+
exports: {
|
|
240
|
+
'.': './src/index.ts',
|
|
241
|
+
'./quick-insert-plugin': './src/entry-points/quick-insert-plugin.tsx',
|
|
242
|
+
'./quick-insert-plugin-type': './src/entry-points/quick-insert-plugin-type.ts'
|
|
243
|
+
},
|
|
244
|
+
dependencies: {
|
|
245
|
+
'@atlaskit/button': 'workspace:^',
|
|
246
|
+
'@atlaskit/editor-plugin-analytics': 'workspace:^',
|
|
247
|
+
'@atlaskit/editor-plugin-connectivity': 'workspace:^',
|
|
248
|
+
'@atlaskit/editor-plugin-metrics': 'workspace:^',
|
|
249
|
+
'@atlaskit/editor-plugin-type-ahead': 'workspace:^',
|
|
250
|
+
'@atlaskit/editor-prosemirror': 'workspace:^',
|
|
251
|
+
'@atlaskit/icon': 'workspace:^',
|
|
252
|
+
'@atlaskit/modal-dialog': 'workspace:^',
|
|
253
|
+
'@atlaskit/platform-feature-flags': 'workspace:^',
|
|
254
|
+
'@atlaskit/tmp-editor-statsig': 'workspace:^',
|
|
255
|
+
'@atlaskit/tokens': 'workspace:^',
|
|
256
|
+
'@babel/runtime': 'root:*',
|
|
257
|
+
'@emotion/react': 'root:*'
|
|
258
|
+
},
|
|
259
|
+
peerDependencies: {
|
|
260
|
+
'@atlaskit/editor-common': 'workspace:^',
|
|
261
|
+
react: '^18.2.0',
|
|
262
|
+
'react-dom': '^18.2.0',
|
|
263
|
+
'react-intl': '^5.25.1 || ^6.0.0 || ^7.0.0'
|
|
264
|
+
},
|
|
265
|
+
devDependencies: {
|
|
266
|
+
'@atlassian/structured-docs-types': 'workspace:^',
|
|
267
|
+
'@testing-library/react': 'root:*',
|
|
268
|
+
react: 'root:*',
|
|
269
|
+
'react-dom': 'root:*',
|
|
270
|
+
'react-intl': 'root:*',
|
|
271
|
+
'wait-for-expect': 'root:*'
|
|
272
|
+
},
|
|
273
|
+
techstack: {
|
|
274
|
+
'@atlassian/frontend': {
|
|
275
|
+
'code-structure': ['editor-plugin'],
|
|
276
|
+
'import-structure': ['atlassian-conventions'],
|
|
277
|
+
'circular-dependencies': ['file-and-folder-level']
|
|
278
|
+
},
|
|
279
|
+
'@repo/internal': {
|
|
280
|
+
'dom-events': 'use-bind-event-listener',
|
|
281
|
+
analytics: ['analytics-next'],
|
|
282
|
+
'design-tokens': ['color'],
|
|
283
|
+
theming: ['react-context'],
|
|
284
|
+
'ui-components': ['lite-mode'],
|
|
285
|
+
deprecation: 'no-deprecated-imports',
|
|
286
|
+
styling: ['emotion', 'emotion'],
|
|
287
|
+
imports: ['import-no-extraneous-disable-for-examples-and-docs']
|
|
288
|
+
}
|
|
289
|
+
},
|
|
290
|
+
'platform-feature-flags': {
|
|
291
|
+
platform_editor_ease_of_use_metrics: {
|
|
292
|
+
type: 'boolean'
|
|
293
|
+
},
|
|
294
|
+
platform_editor_fix_space_triggering_ai: {
|
|
295
|
+
type: 'boolean'
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
},
|
|
300
|
+
package: '@atlaskit/editor-plugin-quick-insert',
|
|
105
301
|
examples: [],
|
|
106
302
|
kind: 'function',
|
|
107
|
-
signature: '
|
|
303
|
+
signature: 'quickInsertPlugin: QuickInsertPlugin'
|
|
108
304
|
}, {
|
|
109
|
-
name: '
|
|
110
|
-
description: '
|
|
305
|
+
name: 'CustomAttributes',
|
|
306
|
+
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
307
|
status: 'general-availability',
|
|
112
|
-
usageGuidelines: ['
|
|
113
|
-
keywords: ['
|
|
114
|
-
category: '
|
|
115
|
-
package: '@
|
|
308
|
+
usageGuidelines: ['Keep custom attribute names stable — downstream analytics queries pivot on them. Coordinate any rename with the data-platform team before shipping.'],
|
|
309
|
+
keywords: ['feature-flag', 'type', 'CustomAttributes', 'exposure'],
|
|
310
|
+
category: 'experimentation',
|
|
311
|
+
package: '@atlaskit/feature-flag-client',
|
|
312
|
+
examples: [],
|
|
313
|
+
kind: 'type',
|
|
314
|
+
definition: 'type CustomAttributes = { [attributeName: string]: string | number | boolean | object }'
|
|
315
|
+
}, {
|
|
316
|
+
name: 'ExposureTriggerReason',
|
|
317
|
+
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.',
|
|
318
|
+
status: 'general-availability',
|
|
319
|
+
usageGuidelines: ['Use the enum members rather than literal strings when calling `trackFeatureFlag({ triggerReason })` — the literal values change if the backend renames a reason.'],
|
|
320
|
+
keywords: ['feature-flag', 'exposure', 'enum', 'ExposureTriggerReason'],
|
|
321
|
+
category: 'experimentation',
|
|
322
|
+
package: '@atlaskit/feature-flag-client',
|
|
323
|
+
examples: [],
|
|
324
|
+
kind: 'constant',
|
|
325
|
+
type: 'enum ExposureTriggerReason',
|
|
326
|
+
value: '{ OptIn = "optInExposure", Manual = "manualExposure", Default = "defaultExposure", AutoExposure = "autoExposure", hasCustomAttributes = "hasCustomAttributes" }'
|
|
327
|
+
}, {
|
|
328
|
+
name: 'FeatureFlagClient',
|
|
329
|
+
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.',
|
|
330
|
+
status: 'general-availability',
|
|
331
|
+
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.'],
|
|
332
|
+
keywords: ['feature-flag', 'feature-gate', 'experiment', 'switcheroo', 'FeatureFlagClient', 'client'],
|
|
333
|
+
category: 'experimentation',
|
|
334
|
+
package: '@atlaskit/feature-flag-client',
|
|
335
|
+
examples: [],
|
|
336
|
+
kind: 'constant',
|
|
337
|
+
type: 'class FeatureFlagClient',
|
|
338
|
+
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'
|
|
339
|
+
}, {
|
|
340
|
+
name: 'FlagValue',
|
|
341
|
+
description: 'Union of the value types a flag can return: `boolean | string | object`.',
|
|
342
|
+
status: 'general-availability',
|
|
343
|
+
keywords: ['feature-flag', 'type', 'FlagValue'],
|
|
344
|
+
category: 'experimentation',
|
|
345
|
+
package: '@atlaskit/feature-flag-client',
|
|
346
|
+
examples: [],
|
|
347
|
+
kind: 'type',
|
|
348
|
+
definition: 'type FlagValue = boolean | string | object'
|
|
349
|
+
}, {
|
|
350
|
+
name: 'convertToError',
|
|
351
|
+
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`.',
|
|
352
|
+
status: 'general-availability',
|
|
353
|
+
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.'],
|
|
354
|
+
keywords: ['utility', 'convertToError', 'error', 'frontend-utilities'],
|
|
355
|
+
category: 'utilities',
|
|
356
|
+
package: '@atlaskit/frontend-utilities',
|
|
116
357
|
examples: [],
|
|
117
358
|
kind: 'function',
|
|
118
359
|
parameters: [{
|
|
119
|
-
name: '
|
|
120
|
-
type: '
|
|
121
|
-
description: '
|
|
360
|
+
name: 'e',
|
|
361
|
+
type: 'unknown',
|
|
362
|
+
description: 'The caught value. Already-`Error` instances are returned unchanged.'
|
|
363
|
+
}],
|
|
364
|
+
returns: {
|
|
365
|
+
type: 'Error',
|
|
366
|
+
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).'
|
|
367
|
+
},
|
|
368
|
+
signature: '(e: unknown) => Error'
|
|
369
|
+
}, {
|
|
370
|
+
name: 'mockWindowStorage',
|
|
371
|
+
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).',
|
|
372
|
+
status: 'general-availability',
|
|
373
|
+
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.'],
|
|
374
|
+
keywords: ['utility', 'mockWindowStorage', 'storage', 'test', 'frontend-utilities'],
|
|
375
|
+
category: 'utilities',
|
|
376
|
+
package: '@atlaskit/frontend-utilities',
|
|
377
|
+
examples: [],
|
|
378
|
+
kind: 'function',
|
|
379
|
+
parameters: [{
|
|
380
|
+
name: 'storageToMock',
|
|
381
|
+
type: "('localStorage' | 'sessionStorage')[]",
|
|
382
|
+
description: 'Which storage objects to replace. Defaults to both.',
|
|
383
|
+
defaultValue: "['localStorage', 'sessionStorage']",
|
|
122
384
|
isOptional: true
|
|
385
|
+
}],
|
|
386
|
+
returns: {
|
|
387
|
+
type: 'void'
|
|
388
|
+
},
|
|
389
|
+
signature: "(storageToMock?: ('localStorage' | 'sessionStorage')[]) => void"
|
|
390
|
+
}, {
|
|
391
|
+
name: 'retryOnException',
|
|
392
|
+
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".',
|
|
393
|
+
status: 'general-availability',
|
|
394
|
+
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.'],
|
|
395
|
+
keywords: ['utility', 'retryOnException', 'retry', 'fetch', 'frontend-utilities'],
|
|
396
|
+
category: 'utilities',
|
|
397
|
+
package: '@atlaskit/frontend-utilities',
|
|
398
|
+
examples: [],
|
|
399
|
+
kind: 'function',
|
|
400
|
+
parameters: [{
|
|
401
|
+
name: 'invokeOperation',
|
|
402
|
+
type: '() => Promise<T>',
|
|
403
|
+
description: 'The async operation to attempt. Called once per attempt.'
|
|
123
404
|
}, {
|
|
124
|
-
name: '
|
|
125
|
-
type: '
|
|
126
|
-
description: '
|
|
127
|
-
isOptional: true
|
|
405
|
+
name: 'config',
|
|
406
|
+
type: '{ intervalsMS?: readonly number[]; retryOn?: (typeof Error)[] | ((e: Error) => boolean); captureException?: (error: Error, tags?: Record<string, string>) => void; onRetry?: (previousErr: Error) => void }',
|
|
407
|
+
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
408
|
}],
|
|
129
409
|
returns: {
|
|
130
|
-
type: 'Promise<
|
|
131
|
-
description: 'Resolves with the
|
|
410
|
+
type: 'Promise<T>',
|
|
411
|
+
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
412
|
},
|
|
133
|
-
signature: '(
|
|
413
|
+
signature: '<T>(invokeOperation: () => Promise<T>, config: RetryConfig) => Promise<T>'
|
|
414
|
+
}, {
|
|
415
|
+
name: 'simpleHash',
|
|
416
|
+
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.',
|
|
417
|
+
status: 'general-availability',
|
|
418
|
+
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.'],
|
|
419
|
+
keywords: ['utility', 'simpleHash', 'hash', 'frontend-utilities'],
|
|
420
|
+
category: 'utilities',
|
|
421
|
+
package: '@atlaskit/frontend-utilities',
|
|
422
|
+
examples: [],
|
|
423
|
+
kind: 'function',
|
|
424
|
+
parameters: [{
|
|
425
|
+
name: 'str',
|
|
426
|
+
type: 'string',
|
|
427
|
+
description: 'Input to hash.'
|
|
428
|
+
}],
|
|
429
|
+
returns: {
|
|
430
|
+
type: 'string',
|
|
431
|
+
description: 'Base-36 representation of a 32-bit signed-to-unsigned hash.'
|
|
432
|
+
},
|
|
433
|
+
signature: '(str: string) => string'
|
|
434
|
+
}, {
|
|
435
|
+
name: 'STORAGE_MOCK',
|
|
436
|
+
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.',
|
|
437
|
+
status: 'general-availability',
|
|
438
|
+
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.'],
|
|
439
|
+
keywords: ['constant', 'STORAGE_MOCK', 'storage', 'test', 'frontend-utilities'],
|
|
440
|
+
category: 'utilities',
|
|
441
|
+
package: '@atlaskit/frontend-utilities',
|
|
442
|
+
examples: [],
|
|
443
|
+
kind: 'constant',
|
|
444
|
+
type: 'Storage',
|
|
445
|
+
value: '{ length: 0; getItem(id); setItem(id, val); removeItem(id); clear(); key(index) } — backed by an in-memory `_data` record.'
|
|
446
|
+
}, {
|
|
447
|
+
name: 'init',
|
|
448
|
+
description: 'INSM tooling measures user-perceived interactivity of a page',
|
|
449
|
+
status: 'general-availability',
|
|
450
|
+
usageGuidelines: [],
|
|
451
|
+
accessibilityGuidelines: [],
|
|
452
|
+
keywords: ['editor', 'insm', 'atlaskit'],
|
|
453
|
+
category: 'editor',
|
|
454
|
+
import: {
|
|
455
|
+
name: 'init',
|
|
456
|
+
package: '@atlaskit/insm',
|
|
457
|
+
type: 'named',
|
|
458
|
+
packagePath: '/Users/khall2/.codex/worktrees/bd80/atlassian-frontend-monorepo/platform/packages/editor/insm',
|
|
459
|
+
packageJson: {
|
|
460
|
+
name: '@atlaskit/insm',
|
|
461
|
+
version: '1.0.11',
|
|
462
|
+
description: 'INSM tooling measures user-perceived interactivity of a page',
|
|
463
|
+
author: 'Atlassian Pty Ltd',
|
|
464
|
+
license: 'Apache-2.0',
|
|
465
|
+
publishConfig: {
|
|
466
|
+
registry: 'https://registry.npmjs.org/'
|
|
467
|
+
},
|
|
468
|
+
atlassian: {
|
|
469
|
+
team: 'Editor: Lego'
|
|
470
|
+
},
|
|
471
|
+
repository: 'https://bitbucket.org/atlassian/atlassian-frontend-monorepo',
|
|
472
|
+
main: 'dist/cjs/index.js',
|
|
473
|
+
module: 'dist/esm/index.js',
|
|
474
|
+
'module:es2019': 'dist/es2019/index.js',
|
|
475
|
+
types: 'dist/types/index.d.ts',
|
|
476
|
+
'atlaskit:src': 'src/index.ts',
|
|
477
|
+
exports: {
|
|
478
|
+
'.': './src/index.ts'
|
|
479
|
+
},
|
|
480
|
+
dependencies: {
|
|
481
|
+
'@atlaskit/analytics-listeners': 'workspace:^',
|
|
482
|
+
'@atlaskit/tmp-editor-statsig': 'workspace:^',
|
|
483
|
+
'@babel/runtime': 'root:*',
|
|
484
|
+
'bowser-ultralight': 'root:*'
|
|
485
|
+
},
|
|
486
|
+
peerDependencies: {
|
|
487
|
+
react: '^18.2.0'
|
|
488
|
+
},
|
|
489
|
+
devDependencies: {
|
|
490
|
+
'@atlassian/structured-docs-types': 'workspace:^',
|
|
491
|
+
react: 'root:*'
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
},
|
|
495
|
+
package: '@atlaskit/insm',
|
|
496
|
+
examples: [],
|
|
497
|
+
kind: 'function',
|
|
498
|
+
signature: 'init(options: INSMOptions): void'
|
|
134
499
|
}, {
|
|
135
500
|
name: 'BaseUrls',
|
|
136
501
|
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 +588,7 @@ export var atlaskitUtilities = [{
|
|
|
223
588
|
package: '@atlaskit/linking-common',
|
|
224
589
|
examples: [],
|
|
225
590
|
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 }'
|
|
591
|
+
definition: "type CardType = 'pending' | 'resolving' | 'resolved' | 'errored' | 'fallback' | 'unauthorized' | 'forbidden' | 'not_found'"
|
|
301
592
|
}, {
|
|
302
593
|
name: 'Datasource',
|
|
303
594
|
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 +610,6 @@ export var atlaskitUtilities = [{
|
|
|
319
610
|
kind: 'constant',
|
|
320
611
|
type: "'wide'",
|
|
321
612
|
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
613
|
}, {
|
|
333
614
|
name: 'EnvironmentsKeys',
|
|
334
615
|
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 +620,6 @@ export var atlaskitUtilities = [{
|
|
|
339
620
|
examples: [],
|
|
340
621
|
kind: 'type',
|
|
341
622
|
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
623
|
}, {
|
|
403
624
|
name: 'filterSiteProducts',
|
|
404
625
|
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 +639,6 @@ export var atlaskitUtilities = [{
|
|
|
418
639
|
description: 'Predicate suitable for `Array.prototype.filter`.'
|
|
419
640
|
},
|
|
420
641
|
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
642
|
}, {
|
|
432
643
|
name: 'getBaseUrl',
|
|
433
644
|
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 +662,6 @@ export var atlaskitUtilities = [{
|
|
|
451
662
|
type: 'string'
|
|
452
663
|
},
|
|
453
664
|
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
665
|
}, {
|
|
474
666
|
name: 'getResolverUrl',
|
|
475
667
|
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 +704,6 @@ export var atlaskitUtilities = [{
|
|
|
512
704
|
type: 'CardType'
|
|
513
705
|
},
|
|
514
706
|
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
707
|
}, {
|
|
532
708
|
name: 'getUrl',
|
|
533
709
|
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 +736,6 @@ export var atlaskitUtilities = [{
|
|
|
560
736
|
examples: [],
|
|
561
737
|
kind: 'type',
|
|
562
738
|
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
739
|
}, {
|
|
613
740
|
name: 'promiseDebounce',
|
|
614
741
|
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 +797,6 @@ export var atlaskitUtilities = [{
|
|
|
670
797
|
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
798
|
},
|
|
672
799
|
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
800
|
}, {
|
|
806
801
|
name: 'withFeatureFlaggedComponent',
|
|
807
802
|
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")`.',
|