@atlaskit/ads-mcp 1.12.11 → 1.12.13

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 (25) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/dist/cjs/tools/get-all-components/components.codegen.js +2 -2
  3. package/dist/cjs/tools/get-atlaskit-components/atlaskit-components.codegen.js +2 -2
  4. package/dist/cjs/tools/get-atlaskit-hooks/atlaskit-hooks.codegen.js +5 -5
  5. package/dist/cjs/tools/get-atlaskit-utilities/atlaskit-utilities.codegen.js +2 -2
  6. package/dist/cjs/tools/get-lint-rules/lint-rules-structured-content.codegen.js +41 -25
  7. package/dist/cjs/tools/migration-guides/migrations/onboarding-with-motion.js +5 -5
  8. package/dist/es2019/tools/get-all-components/components.codegen.js +2 -2
  9. package/dist/es2019/tools/get-atlaskit-components/atlaskit-components.codegen.js +2 -2
  10. package/dist/es2019/tools/get-atlaskit-hooks/atlaskit-hooks.codegen.js +5 -5
  11. package/dist/es2019/tools/get-atlaskit-utilities/atlaskit-utilities.codegen.js +2 -2
  12. package/dist/es2019/tools/get-lint-rules/lint-rules-structured-content.codegen.js +41 -25
  13. package/dist/es2019/tools/migration-guides/migrations/onboarding-with-motion.js +23 -30
  14. package/dist/esm/tools/get-all-components/components.codegen.js +2 -2
  15. package/dist/esm/tools/get-atlaskit-components/atlaskit-components.codegen.js +2 -2
  16. package/dist/esm/tools/get-atlaskit-hooks/atlaskit-hooks.codegen.js +5 -5
  17. package/dist/esm/tools/get-atlaskit-utilities/atlaskit-utilities.codegen.js +2 -2
  18. package/dist/esm/tools/get-lint-rules/lint-rules-structured-content.codegen.js +41 -25
  19. package/dist/esm/tools/migration-guides/migrations/onboarding-with-motion.js +5 -5
  20. package/dist/types/tools/get-all-components/components.codegen.d.ts +1 -1
  21. package/dist/types/tools/get-atlaskit-components/atlaskit-components.codegen.d.ts +1 -1
  22. package/dist/types/tools/get-atlaskit-hooks/atlaskit-hooks.codegen.d.ts +1 -1
  23. package/dist/types/tools/get-atlaskit-utilities/atlaskit-utilities.codegen.d.ts +1 -1
  24. package/dist/types/tools/get-lint-rules/lint-rules-structured-content.codegen.d.ts +1 -1
  25. package/package.json +3 -3
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * Structured content hooks from design-system *.docs.tsx files
5
5
  *
6
- * @codegen <<SignedSource::b5f167ff34a386b064b052413e41a745>>
6
+ * @codegen <<SignedSource::70b33ac14924cd95daf60fdf0f0d61cc>>
7
7
  * @codegenCommand afm workspace @af/ads-ai-tooling codegen
8
8
  */
9
9
  /* eslint-disable @repo/internal/react/boolean-prop-naming-convention -- not our types */
@@ -21,7 +21,7 @@ export var atlaskitHooks = [{
21
21
  description: '`createAnalyticsEvent` is referentially stable per nearest `AnalyticsContext`, so it is safe to put in dependency arrays.'
22
22
  },
23
23
  package: '@atlaskit/analytics-next',
24
- examples: ["import React, { type FC, type MouseEvent, useCallback } from 'react';\nimport AnalyticsListener from '../src/components/AnalyticsListener';\nimport type UIAnalyticsEvent from '../src/events/UIAnalyticsEvent';\nimport withAnalyticsEvents, {\n\ttype WithAnalyticsEventsProps,\n} from '../src/hocs/withAnalyticsEvents';\nimport { useAnalyticsEvents } from '../src/hooks/useAnalyticsEvents';\nimport { useCallbackWithAnalytics } from '../src/hooks/useCallbackWithAnalytics';\nimport { usePlatformLeafEventHandler } from '../src/hooks/usePlatformLeafEventHandler';\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;"]
24
+ 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;"]
25
25
  }, {
26
26
  name: 'useInterval',
27
27
  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.',
@@ -320,7 +320,7 @@ export var atlaskitHooks = [{
320
320
  keywords: ['smart-card', 'hooks', 'useSmartLinkActions', 'actions'],
321
321
  category: 'linking',
322
322
  package: '@atlaskit/smart-card',
323
- 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 '../../src';\nimport { CardAction } from '../../src/constants';\nimport { useSmartLinkActions } from '../../src/hooks';\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;"]
323
+ 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;"]
324
324
  }, {
325
325
  name: 'useSmartLinkEvents',
326
326
  description: 'Hook that returns a SmartLinkEvents object for dispatching analytics events for a given URL. Currently supports insertSmartLink.',
@@ -330,7 +330,7 @@ export var atlaskitHooks = [{
330
330
  keywords: ['smart-card', 'hooks', 'analytics', 'useSmartLinkEvents', 'events'],
331
331
  category: 'linking',
332
332
  package: '@atlaskit/smart-card',
333
- 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 { token } from '@atlaskit/tokens';\nimport { Card } from '../../src';\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};"]
333
+ 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};"]
334
334
  }, {
335
335
  name: 'useAgentSessions',
336
336
  description: 'Reads normalized account-scoped Rovo agent sessions and keeps the Relay result current after lifecycle events.',
@@ -1634,7 +1634,7 @@ export var atlaskitHooks = [{
1634
1634
  keywords: ['rovo', 'chat', 'ai', 'platform'],
1635
1635
  category: 'rovo',
1636
1636
  package: '@atlassian/rovo-pins',
1637
- 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 { usePinnedItems } from '../src/services/pinned-items-store';\nimport type { SearchWorkItem } from '../src/types';\nimport { PinnedWorkSection } from '../src/ui/pinned-work-section/PinnedWorkSection';\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}"]
1637
+ 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}"]
1638
1638
  }, {
1639
1639
  name: 'useInfiniteScroll',
1640
1640
  description: 'Coordinates loading more inline-browse results when a scroll sentinel enters view.',