@atlaskit/ads-mcp 1.12.12 → 1.12.14
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 +15 -0
- package/dist/cjs/tools/get-all-components/components.codegen.js +2 -2
- package/dist/cjs/tools/get-atlaskit-components/atlaskit-components.codegen.js +2 -2
- package/dist/cjs/tools/get-atlaskit-hooks/atlaskit-hooks.codegen.js +5 -5
- package/dist/cjs/tools/get-atlaskit-utilities/atlaskit-utilities.codegen.js +2 -2
- package/dist/cjs/tools/migration-guides/migrations/onboarding-with-motion.js +5 -5
- package/dist/es2019/tools/get-all-components/components.codegen.js +2 -2
- package/dist/es2019/tools/get-atlaskit-components/atlaskit-components.codegen.js +2 -2
- package/dist/es2019/tools/get-atlaskit-hooks/atlaskit-hooks.codegen.js +5 -5
- package/dist/es2019/tools/get-atlaskit-utilities/atlaskit-utilities.codegen.js +2 -2
- package/dist/es2019/tools/migration-guides/migrations/onboarding-with-motion.js +23 -30
- package/dist/esm/tools/get-all-components/components.codegen.js +2 -2
- package/dist/esm/tools/get-atlaskit-components/atlaskit-components.codegen.js +2 -2
- package/dist/esm/tools/get-atlaskit-hooks/atlaskit-hooks.codegen.js +5 -5
- package/dist/esm/tools/get-atlaskit-utilities/atlaskit-utilities.codegen.js +2 -2
- package/dist/esm/tools/migration-guides/migrations/onboarding-with-motion.js +5 -5
- package/dist/types/tools/get-all-components/components.codegen.d.ts +1 -1
- package/dist/types/tools/get-atlaskit-components/atlaskit-components.codegen.d.ts +1 -1
- package/dist/types/tools/get-atlaskit-hooks/atlaskit-hooks.codegen.d.ts +1 -1
- package/dist/types/tools/get-atlaskit-utilities/atlaskit-utilities.codegen.d.ts +1 -1
- package/package.json +3 -3
|
@@ -9,7 +9,7 @@ exports.atlaskitHooks = void 0;
|
|
|
9
9
|
*
|
|
10
10
|
* Structured content hooks from design-system *.docs.tsx files
|
|
11
11
|
*
|
|
12
|
-
* @codegen <<SignedSource::
|
|
12
|
+
* @codegen <<SignedSource::70b33ac14924cd95daf60fdf0f0d61cc>>
|
|
13
13
|
* @codegenCommand afm workspace @af/ads-ai-tooling codegen
|
|
14
14
|
*/
|
|
15
15
|
/* eslint-disable @repo/internal/react/boolean-prop-naming-convention -- not our types */
|
|
@@ -27,7 +27,7 @@ var atlaskitHooks = exports.atlaskitHooks = [{
|
|
|
27
27
|
description: '`createAnalyticsEvent` is referentially stable per nearest `AnalyticsContext`, so it is safe to put in dependency arrays.'
|
|
28
28
|
},
|
|
29
29
|
package: '@atlaskit/analytics-next',
|
|
30
|
-
examples: ["import React, { type FC, type MouseEvent, useCallback } from 'react';\nimport AnalyticsListener from '
|
|
30
|
+
examples: ["import React, { type FC, type MouseEvent, useCallback } from 'react';\nimport AnalyticsListener from '@atlaskit/analytics-next/AnalyticsListener';\nimport type UIAnalyticsEvent from '@atlaskit/analytics-next/UIAnalyticsEvent';\nimport { useAnalyticsEvents } from '@atlaskit/analytics-next/useAnalyticsEvents';\nimport { useCallbackWithAnalytics } from '@atlaskit/analytics-next/useCallbackWithAnalytics';\nimport { usePlatformLeafEventHandler } from '@atlaskit/analytics-next/usePlatformLeafEventHandler';\nimport withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';\nimport type { WithAnalyticsEventsProps } from '@atlaskit/analytics-next/withAnalyticsEvents';\ninterface Props extends WithAnalyticsEventsProps {\n\tchildren: React.ReactNode;\n\tonClick: (e: MouseEvent<HTMLButtonElement>) => void;\n}\nconst ButtonBase = ({ createAnalyticsEvent, onClick, ...rest }: Props) => {\n\tconst handleClick = useCallback(\n\t\t(e: MouseEvent<HTMLButtonElement>) => {\n\t\t\t// Create our analytics event\n\t\t\tconst analyticsEvent = createAnalyticsEvent!({\n\t\t\t\taction: 'click',\n\t\t\t});\n\t\t\t// Fire our analytics event on the 'atlaskit' channel\n\t\t\tanalyticsEvent.fire('atlaskit');\n\t\t\tif (onClick) {\n\t\t\t\tonClick(e);\n\t\t\t}\n\t\t},\n\t\t[onClick, createAnalyticsEvent],\n\t);\n\treturn <button {...rest} onClick={handleClick} />;\n};\nconst Button = withAnalyticsEvents()(ButtonBase);\nconst ButtonUsingHook: FC<Props> = ({ onClick, ...props }) => {\n\t// Decompose function from the hook\n\tconst { createAnalyticsEvent } = useAnalyticsEvents();\n\tconst handleClick = useCallback(\n\t\t(e: MouseEvent<HTMLButtonElement>) => {\n\t\t\t// Create our analytics event\n\t\t\tconst analyticsEvent = createAnalyticsEvent({ action: 'click' });\n\t\t\t// Fire our analytics event\n\t\t\tanalyticsEvent.fire('atlaskit');\n\t\t\tif (onClick) {\n\t\t\t\tonClick(e);\n\t\t\t}\n\t\t},\n\t\t[onClick, createAnalyticsEvent],\n\t);\n\treturn <button {...props} onClick={handleClick} />;\n};\nconst ButtonUsingCallback: FC<Props> = ({ onClick, ...props }) => {\n\tconst handleClick = useCallbackWithAnalytics(onClick, { action: 'click' }, 'atlaskit');\n\treturn <button {...props} onClick={handleClick} />;\n};\nconst ButtonUsingEventHandlerHook = ({\n\tonClick,\n\tchildren,\n}: {\n\tchildren: React.ReactNode;\n\tonClick: (\n\t\tmouseEvent: React.MouseEvent<HTMLButtonElement>,\n\t\tanalyticsEvent: UIAnalyticsEvent,\n\t) => void;\n}) => {\n\tconst handleClick = usePlatformLeafEventHandler({\n\t\tfn: onClick,\n\t\taction: 'clicked',\n\t\tcomponentName: 'fancy-button',\n\t\tpackageName: '@atlaskit/fancy-button',\n\t\tpackageVersion: '0.1.0',\n\t});\n\treturn <button onClick={handleClick}>{children}</button>;\n};\nconst App: FC = () => {\n\tconst handleEvent = (analyticsEvent: UIAnalyticsEvent) => {\n\t\tconst { payload, context } = analyticsEvent;\n\t\tconsole.log('Received event:', { payload, context });\n\t};\n\tconst onClickHandler = () => console.log('onClickCallback');\n\treturn (\n\t\t<AnalyticsListener channel=\"atlaskit\" onEvent={handleEvent}>\n\t\t\t<Button onClick={onClickHandler}>Click me (withAnalyticsEvents)</Button>\n\t\t\t<br />\n\t\t\t<ButtonUsingHook onClick={onClickHandler}>Click me (useAnalyticsEvents)</ButtonUsingHook>\n\t\t\t<br />\n\t\t\t<ButtonUsingCallback onClick={onClickHandler}>\n\t\t\t\tClick me (useCallbackWithAnalytics)\n\t\t\t</ButtonUsingCallback>\n\t\t\t<br />\n\t\t\t<ButtonUsingEventHandlerHook onClick={onClickHandler}>\n\t\t\t\tClick me (usePlatformLeafEventHandler)\n\t\t\t</ButtonUsingEventHandlerHook>\n\t\t</AnalyticsListener>\n\t);\n};\nexport default App;"]
|
|
31
31
|
}, {
|
|
32
32
|
name: 'useInterval',
|
|
33
33
|
description: 'Declarative wrapper around `setInterval`. Re-runs the latest `callback` every `delay` milliseconds and clears the timer on unmount or when `delay` changes. Passing `null` for `delay` pauses the timer without unmounting the hook.',
|
|
@@ -326,7 +326,7 @@ var atlaskitHooks = exports.atlaskitHooks = [{
|
|
|
326
326
|
keywords: ['smart-card', 'hooks', 'useSmartLinkActions', 'actions'],
|
|
327
327
|
category: 'linking',
|
|
328
328
|
package: '@atlaskit/smart-card',
|
|
329
|
-
examples: ["import React, { useCallback } from 'react';\nimport Button from '@atlaskit/button/default/button';\nimport { SmartCardProvider } from '@atlaskit/link-provider/smart-card-provider';\nimport {\n\tResolvedClient,\n\tResolvedClientUrl,\n} from '@atlaskit/link-test-helpers/smart-card/mocks/clients';\nimport { Box } from '@atlaskit/primitives/compiled/box';\nimport { Card } from '
|
|
329
|
+
examples: ["import React, { useCallback } from 'react';\nimport Button from '@atlaskit/button/default/button';\nimport { SmartCardProvider } from '@atlaskit/link-provider/smart-card-provider';\nimport {\n\tResolvedClient,\n\tResolvedClientUrl,\n} from '@atlaskit/link-test-helpers/smart-card/mocks/clients';\nimport { Box } from '@atlaskit/primitives/compiled/box';\nimport { Card } from '@atlaskit/smart-card/card/lazy';\nimport { CardAction } from '@atlaskit/smart-card/enums';\nimport { useSmartLinkActions } from '@atlaskit/smart-card/hook/use-smart-link-actions';\nimport ExampleContainer from './example-container';\nconst PreviewButton = ({ url }: { url: string }) => {\n\tconst actions = useSmartLinkActions({ url, appearance: 'block' });\n\t// actions are returned in an array, find the preview action\n\tconst previewAction = actions.find((action) => action.id === 'preview-content');\n\tconst handleClick = useCallback(() => {\n\t\tif (previewAction) {\n\t\t\tpreviewAction.invoke();\n\t\t}\n\t}, [previewAction]);\n\tif (!previewAction) {\n\t\treturn null;\n\t}\n\treturn <Button onClick={handleClick}>{previewAction.text}</Button>;\n};\nconst UseSmartLinkActionsExample = (): React.JSX.Element => (\n\t<ExampleContainer>\n\t\t<SmartCardProvider client={new ResolvedClient()}>\n\t\t\t<Card\n\t\t\t\tappearance=\"block\"\n\t\t\t\turl={ResolvedClientUrl}\n\t\t\t\tactionOptions={{ hide: false, exclude: [CardAction.PreviewAction] }}\n\t\t\t/>\n\t\t\t<Box paddingBlockStart=\"space.200\">\n\t\t\t\t<PreviewButton url={ResolvedClientUrl} />\n\t\t\t</Box>\n\t\t</SmartCardProvider>\n\t</ExampleContainer>\n);\nexport default UseSmartLinkActionsExample;"]
|
|
330
330
|
}, {
|
|
331
331
|
name: 'useSmartLinkEvents',
|
|
332
332
|
description: 'Hook that returns a SmartLinkEvents object for dispatching analytics events for a given URL. Currently supports insertSmartLink.',
|
|
@@ -336,7 +336,7 @@ var atlaskitHooks = exports.atlaskitHooks = [{
|
|
|
336
336
|
keywords: ['smart-card', 'hooks', 'analytics', 'useSmartLinkEvents', 'events'],
|
|
337
337
|
category: 'linking',
|
|
338
338
|
package: '@atlaskit/smart-card',
|
|
339
|
-
examples: ["import AnalyticsContext from '@atlaskit/analytics-next/AnalyticsContext';\nimport AnalyticsListener from '@atlaskit/analytics-next/AnalyticsListener';\nimport type UIAnalyticsEvent from '@atlaskit/analytics-next/UIAnalyticsEvent';\nimport { cssMap } from '@atlaskit/css';\nimport Heading from '@atlaskit/heading/heading';\nimport { SmartCardProvider } from '@atlaskit/link-provider/smart-card-provider';\nimport {\n\tResolvedClient,\n\tResolvedClientUrl,\n} from '@atlaskit/link-test-helpers/smart-card/mocks/clients';\nimport { Box } from '@atlaskit/primitives/compiled/box';\nimport { Text } from '@atlaskit/primitives/compiled/text';\nimport {
|
|
339
|
+
examples: ["import AnalyticsContext from '@atlaskit/analytics-next/AnalyticsContext';\nimport AnalyticsListener from '@atlaskit/analytics-next/AnalyticsListener';\nimport type UIAnalyticsEvent from '@atlaskit/analytics-next/UIAnalyticsEvent';\nimport { cssMap } from '@atlaskit/css';\nimport Heading from '@atlaskit/heading/heading';\nimport { SmartCardProvider } from '@atlaskit/link-provider/smart-card-provider';\nimport {\n\tResolvedClient,\n\tResolvedClientUrl,\n} from '@atlaskit/link-test-helpers/smart-card/mocks/clients';\nimport { Box } from '@atlaskit/primitives/compiled/box';\nimport { Text } from '@atlaskit/primitives/compiled/text';\nimport { Card } from '@atlaskit/smart-card/card/lazy';\nimport { token } from '@atlaskit/tokens';\nconst styles = cssMap({\n\theading: { marginBottom: token('space.100') },\n\tstack: { marginTop: token('space.100') },\n});\ntype ExampleComponentProps = {\n\tsetRecentEvents: React.Dispatch<React.SetStateAction<UIAnalyticsEvent[]>>;\n};\nconst ExampleComponent = ({ setRecentEvents }: ExampleComponentProps): JSX.Element => {\n\tconst handleOnClick = React.useCallback(\n\t\t(e: React.MouseEvent<Element, MouseEvent> | React.KeyboardEvent<Element>) => {\n\t\t\te.preventDefault();\n\t\t\treturn;\n\t\t},\n\t\t[],\n\t);\n\treturn (\n\t\t<AnalyticsListener\n\t\t\tonEvent={(event) => {\n\t\t\t\tsetRecentEvents((prevEvents) => [...prevEvents, event]);\n\t\t\t}}\n\t\t\tchannel=\"*\"\n\t\t>\n\t\t\t<AnalyticsContext\n\t\t\t\tdata={{\n\t\t\t\t\tsource: 'content',\n\t\t\t\t\tattributes: {\n\t\t\t\t\t\tdisplayCategory: 'link',\n\t\t\t\t\t\tdisplay: 'url',\n\t\t\t\t\t\tid: '123',\n\t\t\t\t\t},\n\t\t\t\t}}\n\t\t\t>\n\t\t\t\t<SmartCardProvider client={new ResolvedClient('dev')}>\n\t\t\t\t\t<Card\n\t\t\t\t\t\turl={ResolvedClientUrl}\n\t\t\t\t\t\tappearance=\"inline\"\n\t\t\t\t\t\tplatform=\"web\"\n\t\t\t\t\t\tshowHoverPreview={true}\n\t\t\t\t\t\tonClick={handleOnClick}\n\t\t\t\t\t/>\n\t\t\t\t</SmartCardProvider>\n\t\t\t</AnalyticsContext>\n\t\t</AnalyticsListener>\n\t);\n};\nexport default (): React.JSX.Element => {\n\tconst [recentEvents, setRecentEvents] = React.useState<UIAnalyticsEvent[]>([]);\n\tconst mostRecent10Events = React.useMemo(() => {\n\t\treturn Array.from({ length: 10 }, (_, i) => {\n\t\t\treturn recentEvents.at(recentEvents.length - i - 1);\n\t\t});\n\t}, [recentEvents]);\n\treturn (\n\t\t<Box>\n\t\t\t<Box xcss={styles.heading}>\n\t\t\t\t<Heading size=\"medium\">Interact with the link below and see events being fired</Heading>\n\t\t\t</Box>\n\t\t\t<ExampleComponent setRecentEvents={setRecentEvents} />\n\t\t\t<Box xcss={styles.stack}>\n\t\t\t\t<Heading size=\"small\">The 10 Most Recent Events Fired</Heading>\n\t\t\t\t<ol>\n\t\t\t\t\t{mostRecent10Events.map((event, index) => {\n\t\t\t\t\t\tif (event === undefined) {\n\t\t\t\t\t\t\treturn <li key={index}></li>;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconst { action, actionSubject, eventType } = event.payload;\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<li key={index}>\n\t\t\t\t\t\t\t\t<Text\n\t\t\t\t\t\t\t\t\tkey={index}\n\t\t\t\t\t\t\t\t>{`actionSubject: ${actionSubject}, action: ${action}, eventType: ${eventType}`}</Text>\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t);\n\t\t\t\t\t})}\n\t\t\t\t</ol>\n\t\t\t</Box>\n\t\t</Box>\n\t);\n};"]
|
|
340
340
|
}, {
|
|
341
341
|
name: 'useAgentSessions',
|
|
342
342
|
description: 'Reads normalized account-scoped Rovo agent sessions and keeps the Relay result current after lifecycle events.',
|
|
@@ -1640,7 +1640,7 @@ var atlaskitHooks = exports.atlaskitHooks = [{
|
|
|
1640
1640
|
keywords: ['rovo', 'chat', 'ai', 'platform'],
|
|
1641
1641
|
category: 'rovo',
|
|
1642
1642
|
package: '@atlassian/rovo-pins',
|
|
1643
|
-
examples: ["/**\n * Example: PinnedWorkSection with pinned items.\n *\n * Demos the \"Your team's work\" heading, \"+\" button, and item list shown once at least one\n * epic, project, or goal is pinned. See `01-pinned-work-section.tsx` for the empty-state\n * demo shown before anything is pinned. The last row has a deliberately long title —\n * hovering it shows a tooltip with the full text once it overflows.\n */\nimport React, { useEffect } from 'react';\nimport { IntlProvider } from 'react-intl';\nimport { cssMap } from '@atlaskit/css';\nimport { Box } from '@atlaskit/primitives/compiled/box';\nimport { token } from '@atlaskit/tokens';\nimport {
|
|
1643
|
+
examples: ["/**\n * Example: PinnedWorkSection with pinned items.\n *\n * Demos the \"Your team's work\" heading, \"+\" button, and item list shown once at least one\n * epic, project, or goal is pinned. See `01-pinned-work-section.tsx` for the empty-state\n * demo shown before anything is pinned. The last row has a deliberately long title —\n * hovering it shows a tooltip with the full text once it overflows.\n */\nimport React, { useEffect } from 'react';\nimport { IntlProvider } from 'react-intl';\nimport { cssMap } from '@atlaskit/css';\nimport { Box } from '@atlaskit/primitives/compiled/box';\nimport { token } from '@atlaskit/tokens';\nimport { PinnedWorkSection } from '@atlassian/rovo-pins/PinnedWorkSection';\nimport { usePinnedItems } from '@atlassian/rovo-pins/store';\nimport type { SearchWorkItem } from '@atlassian/rovo-pins/types';\nconst EXAMPLE_CLOUD_ID = 'example-cloud-id';\nconst EXAMPLE_PRODUCT = 'jira';\nconst MOCK_ITEMS: SearchWorkItem[] = [\n\t{\n\t\tari: 'ari:cloud:jira:site/1:epic/1',\n\t\turl: 'https://example.atlassian.net/browse/EPIC-1',\n\t\tpinType: 'JiraIssue',\n\t\tname: 'Your Work tab: Pin objects',\n\t},\n\t{\n\t\tari: 'ari:cloud:jira:site/1:project/1',\n\t\turl: 'https://example.atlassian.net/jira/projects/1',\n\t\tpinType: 'AtlasProject',\n\t\tname: 'Rovo For You',\n\t},\n\t{\n\t\tari: 'ari:cloud:jira:site/1:goal/1',\n\t\turl: 'https://example.atlassian.net/goals/1',\n\t\tpinType: 'AtlasGoal',\n\t\tname: 'Grow Rovo weekly active users',\n\t},\n\t{\n\t\tari: 'ari:cloud:jira:site/1:epic/2',\n\t\turl: 'https://example.atlassian.net/browse/EPIC-2',\n\t\tpinType: 'JiraIssue',\n\t\tname: 'A deliberately very long epic title used to demo single-line overflow clipping',\n\t},\n];\nconst styles = cssMap({\n\twrapper: {\n\t\twidth: '360px',\n\t\tpaddingTop: token('space.300'),\n\t\tpaddingRight: token('space.200'),\n\t\tpaddingBottom: token('space.300'),\n\t\tpaddingLeft: token('space.200'),\n\t},\n});\n/**\n * Pins the mock items once on mount via the real `pin()` action, then renders its children.\n * `usePinnedItems` now calls the real create endpoint, so this demo only shows the populated\n * state when previewed against a live backend for `EXAMPLE_CLOUD_ID` — same `cloudId` as\n * `PinnedWorkSection` below, so both share the same `useQuery` cache entry.\n */\nconst PinMockItemsOnMount = ({ children }: { children: React.ReactNode }): React.JSX.Element => {\n\tconst { pin } = usePinnedItems({ cloudId: EXAMPLE_CLOUD_ID, product: EXAMPLE_PRODUCT });\n\tuseEffect(() => {\n\t\t// pin() prepends each item, so pin in reverse to render top-to-bottom in\n\t\t// MOCK_ITEMS' declared order — matching 02-pinned-item-row.tsx.\n\t\t[...MOCK_ITEMS].reverse().forEach((item) => {\n\t\t\tpin(item);\n\t\t});\n\t\t// Intentionally run once on mount only — MOCK_ITEMS is a static, module-level constant.\n\t}, []);\n\treturn <>{children}</>;\n};\nexport default function PinnedWorkSectionWithItemsExample(): React.JSX.Element {\n\treturn (\n\t\t<IntlProvider locale=\"en\">\n\t\t\t<PinMockItemsOnMount>\n\t\t\t\t<Box xcss={styles.wrapper}>\n\t\t\t\t\t<PinnedWorkSection\n\t\t\t\t\t\tcloudId={EXAMPLE_CLOUD_ID}\n\t\t\t\t\t\tproduct={EXAMPLE_PRODUCT}\n\t\t\t\t\t\tonPinWorkClick={() => {}}\n\t\t\t\t\t\tonStartChat={() => {}}\n\t\t\t\t\t/>\n\t\t\t\t</Box>\n\t\t\t</PinMockItemsOnMount>\n\t\t</IntlProvider>\n\t);\n}"]
|
|
1644
1644
|
}, {
|
|
1645
1645
|
name: 'useInfiniteScroll',
|
|
1646
1646
|
description: 'Coordinates loading more inline-browse results when a scroll sentinel enters view.',
|