@atlaskit/ads-mcp 1.9.0 → 1.9.1

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 (23) hide show
  1. package/CHANGELOG.md +7 -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 +3 -3
  5. package/dist/cjs/tools/migration-guides/migrations/onboarding-multi-step.js +2 -2
  6. package/dist/cjs/tools/migration-guides/migrations/onboarding-single-step.js +2 -2
  7. package/dist/cjs/tools/migration-guides/migrations/onboarding-with-motion.js +2 -2
  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 +3 -3
  11. package/dist/es2019/tools/migration-guides/migrations/onboarding-multi-step.js +4 -2
  12. package/dist/es2019/tools/migration-guides/migrations/onboarding-single-step.js +3 -3
  13. package/dist/es2019/tools/migration-guides/migrations/onboarding-with-motion.js +2 -2
  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 +3 -3
  17. package/dist/esm/tools/migration-guides/migrations/onboarding-multi-step.js +2 -2
  18. package/dist/esm/tools/migration-guides/migrations/onboarding-single-step.js +2 -2
  19. package/dist/esm/tools/migration-guides/migrations/onboarding-with-motion.js +2 -2
  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/package.json +1 -1
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * Structured content hooks from design-system *.docs.tsx files
5
5
  *
6
- * @codegen <<SignedSource::dca500b15add7e7bd2d514df52d664ce>>
6
+ * @codegen <<SignedSource::eff635a23ccace1d4e4c6ef6efc21551>>
7
7
  * @codegenCommand yarn workspace @af/ads-ai-tooling codegen
8
8
  */
9
9
  /* eslint-disable @repo/internal/react/boolean-prop-naming-convention -- not our types */
@@ -254,7 +254,7 @@ export const atlaskitHooks = [{
254
254
  keywords: ['smart-card', 'hooks', 'useSmartLinkActions', 'actions'],
255
255
  category: 'linking',
256
256
  package: '@atlaskit/smart-card',
257
- examples: ["import React, { useCallback } from 'react';\nimport Button from '@atlaskit/button/new';\nimport { SmartCardProvider } from '@atlaskit/link-provider';\nimport { ResolvedClient, ResolvedClientUrl } from '@atlaskit/link-test-helpers';\nimport { Box } from '@atlaskit/primitives/compiled';\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;"]
257
+ examples: ["import React, { useCallback } from 'react';\nimport Button from '@atlaskit/button/default/button';\nimport { SmartCardProvider } from '@atlaskit/link-provider';\nimport { ResolvedClient, ResolvedClientUrl } from '@atlaskit/link-test-helpers';\nimport { Box } from '@atlaskit/primitives/compiled';\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;"]
258
258
  }, {
259
259
  name: 'useSmartLinkEvents',
260
260
  description: 'Hook that returns a SmartLinkEvents object for dispatching analytics events for a given URL. Currently supports insertSmartLink.',
@@ -264,7 +264,7 @@ export const atlaskitHooks = [{
264
264
  keywords: ['smart-card', 'hooks', 'analytics', 'useSmartLinkEvents', 'events'],
265
265
  category: 'linking',
266
266
  package: '@atlaskit/smart-card',
267
- examples: ["import {\n\tAnalyticsContext,\n\tAnalyticsListener,\n\ttype UIAnalyticsEvent,\n} from '@atlaskit/analytics-next';\nimport Heading from '@atlaskit/heading';\nimport { SmartCardProvider } from '@atlaskit/link-provider';\nimport { ResolvedClient, ResolvedClientUrl } from '@atlaskit/link-test-helpers';\nimport { Box, Text, xcss } from '@atlaskit/primitives';\nimport { Card } from '../../src';\nconst headingBoxStyles = xcss({\n\tmarginBottom: 'space.100',\n});\nconst stackBoxStyles = xcss({\n\tmarginTop: '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={headingBoxStyles}>\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={stackBoxStyles}>\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};"]
267
+ examples: ["import AnalyticsContext from '@atlaskit/analytics-next/AnalyticsContext';\nimport AnalyticsListener from '@atlaskit/analytics-next/AnalyticsListener';\nimport type UIAnalyticsEvent from '@atlaskit/analytics-next/UIAnalyticsEvent';\nimport Heading from '@atlaskit/heading/heading';\nimport { SmartCardProvider } from '@atlaskit/link-provider';\nimport { ResolvedClient, ResolvedClientUrl } from '@atlaskit/link-test-helpers';\nimport { Box, Text, xcss } from '@atlaskit/primitives';\nimport { Card } from '../../src';\nconst headingBoxStyles = xcss({\n\tmarginBottom: 'space.100',\n});\nconst stackBoxStyles = xcss({\n\tmarginTop: '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={headingBoxStyles}>\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={stackBoxStyles}>\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};"]
268
268
  }, {
269
269
  name: 'useAllMessages',
270
270
  description: 'Returns every non-dismissed message in a placement with a placement-bound wrapper. Use it when one surface renders messages from multiple templates.',
@@ -9,7 +9,8 @@ export const onboardingMultiStep = {
9
9
  title: 'Migrate multi step spotlight tour',
10
10
  description: 'Replace the single SpotlightManager pattern with multiple PopoverProvider instances, one for each target in the tour',
11
11
  before: `import React, { useState } from 'react';
12
- import Button, { IconButton } from '@atlaskit/button/new';
12
+ import Button from '@atlaskit/button/default/button';
13
+ import IconButton from '@atlaskit/button/icon/button';
13
14
  import CommentAddIcon from '@atlaskit/icon/core/comment-add';
14
15
  import CopyIcon from '@atlaskit/icon/core/copy';
15
16
  import {
@@ -74,7 +75,8 @@ const OnboardingTour = () => {
74
75
  );
75
76
  };`,
76
77
  after: `import React, { useState } from 'react';
77
- import Button, { IconButton } from '@atlaskit/button/new';
78
+ import Button from '@atlaskit/button/default/button';
79
+ import IconButton from '@atlaskit/button/icon/button';
78
80
  import CommentAddIcon from '@atlaskit/icon/core/comment-add';
79
81
  import CopyIcon from '@atlaskit/icon/core/copy';
80
82
  import { Text } from '@atlaskit/primitives/compiled';
@@ -11,7 +11,7 @@ export const onboardingSingleStep = {
11
11
  before: `
12
12
  // file1.tsx
13
13
  import React, { useState } from 'react';
14
- import Button from '@atlaskit/button/new';
14
+ import Button from '@atlaskit/button/default/button';
15
15
  import { Spotlight } from '@atlaskit/onboarding';
16
16
 
17
17
  const OnboardingSpotlight = () => {
@@ -40,7 +40,7 @@ const OnboardingSpotlight = () => {
40
40
 
41
41
  // file2.tsx
42
42
  import React from 'react';
43
- import Button from '@atlaskit/button/new';
43
+ import Button from '@atlaskit/button/default/button';
44
44
  import { Spotlight } from '@atlaskit/onboarding';
45
45
 
46
46
  const SomeFeature = () => {
@@ -55,7 +55,7 @@ const SomeFeature = () => {
55
55
  after: `
56
56
  // file2.tsx -- the Spotlight has been co-located to the targeted element.
57
57
  import React, { useState } from 'react';
58
- import Button from '@atlaskit/button/new';
58
+ import Button from '@atlaskit/button/default/button';
59
59
  import { Text } from '@atlaskit/primitives/compiled';
60
60
  import {
61
61
  PopoverContent,
@@ -9,7 +9,7 @@ export const onboardingWithMotion = {
9
9
  title: 'Migrate spotlight with transition animation',
10
10
  description: 'Replace SpotlightTransition with FadeIn from @atlaskit/motion wrapped around the SpotlightCard',
11
11
  before: `import React, { useState } from 'react';
12
- import Button from '@atlaskit/button/new';
12
+ import Button from '@atlaskit/button/default/button';
13
13
  import {
14
14
  Spotlight,
15
15
  SpotlightManager,
@@ -53,7 +53,7 @@ const OnboardingSpotlightWithTransition = () => {
53
53
  );
54
54
  };`,
55
55
  after: `import React, { useState } from 'react';
56
- import Button from '@atlaskit/button/new';
56
+ import Button from '@atlaskit/button/default/button';
57
57
  import { FadeIn } from '@atlaskit/motion';
58
58
  import { Text } from '@atlaskit/primitives/compiled';
59
59
  import {