@atlaskit/ads-mcp 1.3.0 → 1.3.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.
- package/CHANGELOG.md +7 -0
- package/README.md +20 -0
- package/dist/cjs/tools/get-atlaskit-components/atlaskit-components.codegen.js +1694 -41
- package/dist/cjs/tools/get-lint-rules/lint-rules-structured-content.codegen.js +4 -4
- package/dist/es2019/tools/get-atlaskit-components/atlaskit-components.codegen.js +1694 -41
- package/dist/es2019/tools/get-lint-rules/lint-rules-structured-content.codegen.js +4 -4
- package/dist/esm/tools/get-atlaskit-components/atlaskit-components.codegen.js +1694 -41
- package/dist/esm/tools/get-lint-rules/lint-rules-structured-content.codegen.js +4 -4
- package/dist/types/tools/get-atlaskit-components/atlaskit-components.codegen.d.ts +2 -2
- package/dist/types/tools/get-lint-rules/lint-rules-structured-content.codegen.d.ts +1 -1
- package/package.json +2 -2
|
@@ -7,14 +7,38 @@ exports.atlaskitComponents = void 0;
|
|
|
7
7
|
/**
|
|
8
8
|
* THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
9
9
|
*
|
|
10
|
-
* Structured content components from
|
|
10
|
+
* Structured content components from *.docs.tsx files outside of design-system
|
|
11
11
|
*
|
|
12
|
-
* @codegen <<SignedSource::
|
|
12
|
+
* @codegen <<SignedSource::999acbcad5b6a38dac9cb18c47addfef>>
|
|
13
13
|
* @codegenCommand yarn workspace @af/ads-ai-tooling codegen:atlaskit-components
|
|
14
14
|
*/
|
|
15
15
|
/* eslint-disable @repo/internal/react/boolean-prop-naming-convention -- not our types */
|
|
16
16
|
|
|
17
17
|
var atlaskitComponents = exports.atlaskitComponents = [{
|
|
18
|
+
name: 'FabricAnalyticsListeners',
|
|
19
|
+
package: '@atlaskit/analytics-listeners',
|
|
20
|
+
description: 'A container component that mounts a set of pre-configured analytics listeners for common Atlassian channels (elements, editor, navigation, etc.).',
|
|
21
|
+
status: 'general-availability',
|
|
22
|
+
usageGuidelines: ['Mount this component near the root of your application to ensure all child components events are captured.', 'Provide an `AnalyticsWebClient` instance to the `client` prop to handle the actual event transmission.', 'Use `excludedChannels` to disable specific listeners if they are not needed or cause conflicts.'],
|
|
23
|
+
keywords: ['analytics', 'listeners', 'fabric', 'atlassian'],
|
|
24
|
+
category: 'analytics',
|
|
25
|
+
examples: ["import { AnalyticsContext } from '@atlaskit/analytics-next';\nimport FabricAnalyticsListeners from '../src/FabricAnalyticsListeners';\nimport { FabricChannel } from '../src/types';\nimport {\n\tcreateAnalyticsWebClientMock,\n\tcreateComponentWithAnalytics,\n\tcreateComponentWithAttributesWithAnalytics,\n} from './helpers';\nconst DummyElementsComponent = createComponentWithAnalytics(FabricChannel.elements);\nconst DummyElementsComponentWithAttributes = createComponentWithAttributesWithAnalytics(\n\tFabricChannel.elements,\n);\nconst DummyAtlaskitComponent = createComponentWithAnalytics(FabricChannel.atlaskit);\nconst DummyNavigationComponent = createComponentWithAnalytics(FabricChannel.navigation);\nconst DummyNotificationsComponent = createComponentWithAnalytics(FabricChannel.notifications);\nconst DummyLinkingPlatformComponent = createComponentWithAnalytics(FabricChannel.linkingPlatform);\nconst myOnClickHandler = () => {\n\tconsole.log('Button clicked ! Yay!');\n};\nfunction Example(): React.JSX.Element {\n\treturn (\n\t\t<FabricAnalyticsListeners client={createAnalyticsWebClientMock()}>\n\t\t\t<div>\n\t\t\t\t<DummyElementsComponent onClick={myOnClickHandler} />\n\t\t\t\t<AnalyticsContext data={{ issueId: 100, greeting: 'hello' }}>\n\t\t\t\t\t<AnalyticsContext data={{ issueId: 200 }}>\n\t\t\t\t\t\t<DummyElementsComponentWithAttributes onClick={myOnClickHandler} />\n\t\t\t\t\t</AnalyticsContext>\n\t\t\t\t</AnalyticsContext>\n\t\t\t\t<DummyAtlaskitComponent onClick={myOnClickHandler} />\n\t\t\t\t<AnalyticsContext\n\t\t\t\t\tdata={{\n\t\t\t\t\t\tcomponent: 'page',\n\t\t\t\t\t\tpackageName: '@atlaskit/page',\n\t\t\t\t\t\tpackageVersion: '2.0.1',\n\t\t\t\t\t\tattributes: { pageName: 'myPage' },\n\t\t\t\t\t\tsource: 'homePage',\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\t<AnalyticsContext\n\t\t\t\t\t\tdata={{\n\t\t\t\t\t\t\tcomponent: 'myComponent',\n\t\t\t\t\t\t\tpackageName: '@atlaskit/my-component',\n\t\t\t\t\t\t\tpackageVersion: '1.0.0',\n\t\t\t\t\t\t\tattributes: { customAttr: true },\n\t\t\t\t\t\t\tsource: 'componentPage',\n\t\t\t\t\t\t}}\n\t\t\t\t\t>\n\t\t\t\t\t\t<DummyNavigationComponent onClick={myOnClickHandler} />\n\t\t\t\t\t</AnalyticsContext>\n\t\t\t\t</AnalyticsContext>\n\t\t\t\t<AnalyticsContext data={{ attributes: { customAttribute: 'yes!' } }}>\n\t\t\t\t\t<DummyNotificationsComponent onClick={myOnClickHandler} />\n\t\t\t\t</AnalyticsContext>\n\t\t\t\t<DummyLinkingPlatformComponent onClick={myOnClickHandler} />\n\t\t\t</div>\n\t\t</FabricAnalyticsListeners>\n\t);\n}\nObject.assign(Example, {\n\tmeta: {\n\t\tnoListener: true,\n\t},\n});\nexport default Example;", "import { AnalyticsContext } from '@atlaskit/analytics-next';\nimport FabricAnalyticsListeners, { FabricChannel } from '../src';\nimport {\n\tcreateAnalyticsWebClientMock,\n\tcreateComponentWithAnalytics,\n\tcreateComponentWithAttributesWithAnalytics,\n} from './helpers';\nconst DummyElementsComponent = createComponentWithAnalytics(FabricChannel.elements);\nconst DummyElementsComponentWithAttributes = createComponentWithAttributesWithAnalytics(\n\tFabricChannel.elements,\n);\nconst DummyAtlaskitComponent = createComponentWithAnalytics(FabricChannel.atlaskit);\nconst myOnClickHandler = () => {\n\tconsole.log('Button clicked ! Yay!');\n};\nfunction Example(): React.JSX.Element {\n\treturn (\n\t\t<FabricAnalyticsListeners\n\t\t\tclient={createAnalyticsWebClientMock()}\n\t\t\texcludedChannels={[FabricChannel.atlaskit]}\n\t\t>\n\t\t\t<div>\n\t\t\t\t<p>Excluding analytics listener</p>\n\t\t\t\t<DummyElementsComponent onClick={myOnClickHandler} />\n\t\t\t\t<AnalyticsContext data={{ issueId: 100, greeting: 'hello' }}>\n\t\t\t\t\t<AnalyticsContext data={{ issueId: 200 }}>\n\t\t\t\t\t\t<DummyElementsComponentWithAttributes onClick={myOnClickHandler} />\n\t\t\t\t\t</AnalyticsContext>\n\t\t\t\t</AnalyticsContext>\n\t\t\t\t<DummyAtlaskitComponent onClick={myOnClickHandler} />\n\t\t\t</div>\n\t\t</FabricAnalyticsListeners>\n\t);\n}\nObject.assign(Example, {\n\tmeta: {\n\t\tnoListener: true,\n\t},\n});\nexport default Example;", "import Button from '@atlaskit/button/new';\nimport { token } from '@atlaskit/tokens';\nimport {\n\tcreateAnalyticsWebClientMock,\n\tcreateComponentWithAnalytics,\n\tIncorrectEventType,\n} from './helpers';\nimport { LOG_LEVEL } from '../src';\nimport FabricAnalyticsListeners from '../src/FabricAnalyticsListeners';\nimport { FabricChannel } from '../src/types';\nconst DummyElementsComponentWithAnalytics = createComponentWithAnalytics(FabricChannel.elements);\nconst DummyAtlaskitComponentWithAnalytics = createComponentWithAnalytics(FabricChannel.atlaskit);\nconst AtlaskitIncorrectEventType = IncorrectEventType(FabricChannel.atlaskit);\nconst myOnClickHandler = () => {\n\tconsole.log('Button clicked');\n};\nconst logLevels = [\n\t{ name: 'DEBUG', level: LOG_LEVEL.DEBUG },\n\t{ name: 'INFO', level: LOG_LEVEL.INFO },\n\t{ name: 'WARN', level: LOG_LEVEL.WARN },\n\t{ name: 'ERROR', level: LOG_LEVEL.ERROR },\n\t{ name: 'OFF', level: LOG_LEVEL.OFF },\n];\nclass Example extends React.Component {\n\tstate = {\n\t\tloggingLevelIdx: 0,\n\t};\n\tchangeLogLevel = (): void => {\n\t\tthis.setState({\n\t\t\tloggingLevelIdx: (this.state.loggingLevelIdx + 1) % logLevels.length,\n\t\t});\n\t};\n\trender(): React.JSX.Element {\n\t\tconst logLevel = logLevels[this.state.loggingLevelIdx];\n\t\treturn (\n\t\t\t<FabricAnalyticsListeners client={createAnalyticsWebClientMock()} logLevel={logLevel.level}>\n\t\t\t\t<div>\n\t\t\t\t\t{\n\t\t\t\t\t<div style={{ display: 'flex', alignItems: 'center' }}>\n\t\t\t\t\t\t<Button appearance=\"primary\" onClick={this.changeLogLevel}>\n\t\t\t\t\t\t\tChange log level\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\tpadding: `${token('space.200', '16px')} ${token('space.100', '8px')}`,\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\tLevel: {logLevel.name}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t{\n\t\t\t\t\t<div style={{ display: 'block' }}>\n\t\t\t\t\t\t<DummyElementsComponentWithAnalytics onClick={myOnClickHandler} />\n\t\t\t\t\t</div>\n\t\t\t\t\t{\n\t\t\t\t\t<div style={{ display: 'block' }}>\n\t\t\t\t\t\t<DummyAtlaskitComponentWithAnalytics onClick={myOnClickHandler} />\n\t\t\t\t\t</div>\n\t\t\t\t\t{\n\t\t\t\t\t<div style={{ display: 'block' }}>\n\t\t\t\t\t\t<AtlaskitIncorrectEventType onClick={myOnClickHandler} />\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</FabricAnalyticsListeners>\n\t\t);\n\t}\n}\nObject.assign(Example, {\n\tmeta: {\n\t\tnoListener: true,\n\t},\n});\nexport default Example;"],
|
|
26
|
+
props: [{
|
|
27
|
+
name: 'children',
|
|
28
|
+
type: 'string | number | boolean | ReactElement<any, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortal',
|
|
29
|
+
description: 'Children!'
|
|
30
|
+
}, {
|
|
31
|
+
name: 'client',
|
|
32
|
+
type: 'AnalyticsWebClient | Promise<AnalyticsWebClient>'
|
|
33
|
+
}, {
|
|
34
|
+
name: 'excludedChannels',
|
|
35
|
+
type: 'FabricChannel[]',
|
|
36
|
+
description: 'A list of individual listeners to exclude, identified by channel'
|
|
37
|
+
}, {
|
|
38
|
+
name: 'logLevel',
|
|
39
|
+
type: 'number'
|
|
40
|
+
}]
|
|
41
|
+
}, {
|
|
18
42
|
name: 'Conversation',
|
|
19
43
|
package: '@atlaskit/conversation',
|
|
20
44
|
description: 'DEPRECATED Render conversation threads',
|
|
@@ -697,6 +721,447 @@ var atlaskitComponents = exports.atlaskitComponents = [{
|
|
|
697
721
|
type: 'Schema<any, any>',
|
|
698
722
|
isRequired: true
|
|
699
723
|
}]
|
|
724
|
+
}, {
|
|
725
|
+
name: 'Emoji',
|
|
726
|
+
package: '@atlaskit/emoji',
|
|
727
|
+
description: 'A component for displaying a single emoji.',
|
|
728
|
+
status: 'general-availability',
|
|
729
|
+
usageGuidelines: ['Use `Emoji` to render a specific emoji by its ID or short name.'],
|
|
730
|
+
keywords: ['emoji', 'display'],
|
|
731
|
+
category: 'elements',
|
|
732
|
+
examples: ["// These imports are not included in the manifest file to avoid circular package dependencies blocking our Typescript and bundling tooling\nimport { getEmojiRepository } from '@atlaskit/util-data-test/get-emoji-repository';\nimport { Emoji } from '../src/element';\nimport { IntlProvider } from 'react-intl';\nconst emojiService = getEmojiRepository();\nexport const renderEmoji = (fitToHeight: number = 24): React.JSX.Element => {\n\tconst blueStar = emojiService.findById('atlassian-blue_star');\n\tconst blueStarEmoji = blueStar ? (\n\t\t<Emoji emoji={blueStar} showTooltip={true} fitToHeight={fitToHeight} />\n\t) : (\n\t\t<span>[blueStar emoji not found]</span>\n\t);\n\tconst wtf = emojiService.findByShortName(':wtf:');\n\tconst wtfEmoji = wtf ? (\n\t\t<Emoji emoji={wtf} showTooltip={true} fitToHeight={fitToHeight} selected={true} />\n\t) : (\n\t\t<span>[wtf emoji not found]</span>\n\t);\n\tconst grimacing = emojiService.findByShortName(':grimacing:');\n\tconst grimacingEmoji = grimacing ? (\n\t\t<Emoji emoji={grimacing} showTooltip={true} fitToHeight={fitToHeight} />\n\t) : (\n\t\t<span>[grimacing emoji not found]</span>\n\t);\n\treturn (\n\t\t<div style={{ lineHeight: `${fitToHeight}px` }}>\n\t\t\t{blueStarEmoji}\n\t\t\t{wtfEmoji}\n\t\t\t{grimacingEmoji}\n\t\t\tEmoji at {fitToHeight}px.\n\t\t</div>\n\t);\n};\nexport default function Example(): React.JSX.Element {\n\treturn (\n\t\t<IntlProvider locale=\"en\">\n\t\t\t<div>{renderEmoji(12)}</div>\n\t\t\t<br />\n\t\t\t<div>{renderEmoji()}</div>\n\t\t\t<br />\n\t\t\t<div>{renderEmoji(40)}</div>\n\t\t\t<br />\n\t\t\t<div>{renderEmoji(64)}</div>\n\t\t\t<br />\n\t\t</IntlProvider>\n\t);\n}"],
|
|
733
|
+
props: [{
|
|
734
|
+
name: 'autoWidth',
|
|
735
|
+
type: 'boolean',
|
|
736
|
+
description: "Auto Width takes the constraint of height and enables native scaling based on the emojis image.\nThis is primarily used when rendering emojis for SSR as the component does not know the width and height\nat the time of the render. It overrides the emoji representations width with 'auto' on the images width attribute\n\nUsed only for image based emojis"
|
|
737
|
+
}, {
|
|
738
|
+
name: 'disableLazyLoad',
|
|
739
|
+
type: 'boolean',
|
|
740
|
+
description: 'Disables lazy load on images'
|
|
741
|
+
}, {
|
|
742
|
+
name: 'editorEmoji',
|
|
743
|
+
type: 'boolean',
|
|
744
|
+
description: 'This should only be set when the emoji is being used in the Editor.\nCurrently when set -- this prevents any aria labels being added.\nThis is acceptable in Editor -- as it uses another technique to announce the emoji nodes.'
|
|
745
|
+
}, {
|
|
746
|
+
name: 'emoji',
|
|
747
|
+
type: 'EmojiDescription',
|
|
748
|
+
description: 'The emoji to render',
|
|
749
|
+
isRequired: true
|
|
750
|
+
}, {
|
|
751
|
+
name: 'fitToHeight',
|
|
752
|
+
type: 'number',
|
|
753
|
+
description: 'Fits emoji to height in pixels, keeping aspect ratio'
|
|
754
|
+
}, {
|
|
755
|
+
name: 'onDelete',
|
|
756
|
+
type: 'OnEmojiEvent<any>',
|
|
757
|
+
description: 'Called when an emoji is deleted'
|
|
758
|
+
}, {
|
|
759
|
+
name: 'onFocus',
|
|
760
|
+
type: 'OnEmojiEvent<any>',
|
|
761
|
+
description: 'Called when the mouse moves over the emoji.'
|
|
762
|
+
}, {
|
|
763
|
+
name: 'onLoadError',
|
|
764
|
+
type: 'OnEmojiEvent<HTMLImageElement>',
|
|
765
|
+
description: 'Callback for if an emoji image fails to load.'
|
|
766
|
+
}, {
|
|
767
|
+
name: 'onLoadSuccess',
|
|
768
|
+
type: '(emoji: EmojiDescription) => void',
|
|
769
|
+
description: 'Callback for if an emoji image succesfully loads.'
|
|
770
|
+
}, {
|
|
771
|
+
name: 'onMouseMove',
|
|
772
|
+
type: 'OnEmojiEvent<any>',
|
|
773
|
+
description: 'Called when the mouse moves over the emoji.'
|
|
774
|
+
}, {
|
|
775
|
+
name: 'onSelected',
|
|
776
|
+
type: 'OnEmojiEvent<any>',
|
|
777
|
+
description: 'Called when an emoji is selected'
|
|
778
|
+
}, {
|
|
779
|
+
name: 'preventFocusOnMouseDown',
|
|
780
|
+
type: 'boolean',
|
|
781
|
+
description: 'Prevent mouse selection from moving browser focus to the emoji.\nKeyboard selection still keeps focus on the emoji for grid navigation.'
|
|
782
|
+
}, {
|
|
783
|
+
name: 'renderUnicodeEmojiAsImage',
|
|
784
|
+
type: 'boolean',
|
|
785
|
+
description: 'Renders unicode emoji through an image representation when a fixed height is supplied.\nDefaults to `true`.'
|
|
786
|
+
}, {
|
|
787
|
+
name: 'selected',
|
|
788
|
+
type: 'boolean',
|
|
789
|
+
description: 'Show the emoji as selected'
|
|
790
|
+
}, {
|
|
791
|
+
name: 'selectOnHover',
|
|
792
|
+
type: 'boolean',
|
|
793
|
+
description: 'Automatically show the emoji as selected based on mouse hover.\nCSS, fast, does not require a re-render, but selected state not\nexternally controlled via props.'
|
|
794
|
+
}, {
|
|
795
|
+
name: 'shouldBeInteractive',
|
|
796
|
+
type: 'boolean',
|
|
797
|
+
description: 'Indicates whether emoji is an interactive element (tab index and role) or just a view'
|
|
798
|
+
}, {
|
|
799
|
+
name: 'showDelete',
|
|
800
|
+
type: 'boolean',
|
|
801
|
+
description: 'Show a delete button on mouse hover\nUsed only for custom emoji'
|
|
802
|
+
}, {
|
|
803
|
+
name: 'showTooltip',
|
|
804
|
+
type: 'boolean',
|
|
805
|
+
description: 'Show a tooltip on mouse hover.'
|
|
806
|
+
}]
|
|
807
|
+
}, {
|
|
808
|
+
name: 'EmojiPicker',
|
|
809
|
+
package: '@atlaskit/emoji',
|
|
810
|
+
description: 'A component that provides a searchable picker for emojis.',
|
|
811
|
+
status: 'general-availability',
|
|
812
|
+
usageGuidelines: ['Use `EmojiPicker` when you need to allow users to select an emoji from a list.', 'Requires an `EmojiResource` to fetch and manage emoji data.'],
|
|
813
|
+
keywords: ['emoji', 'picker', 'select'],
|
|
814
|
+
category: 'elements',
|
|
815
|
+
examples: ["import {\n\tUsageShowAndClearComponent,\n\ttype UsagingShowingProps,\n} from '../example-helpers/demo-emoji-usage-components';\nimport type { EmojiProvider } from '../src/resource';\nimport { EmojiPicker } from '../src/picker';\nimport { EmojiResource } from '../src/api/EmojiResource';\nimport { IntlProvider } from 'react-intl';\nconst config = {\n\tproviders: [{ url: 'https://api-private.stg.atlassian.com/emoji/standard' }],\n};\nclass UsageShowingEmojiPickerTextInput extends UsageShowAndClearComponent {\n\tconstructor(props: UsagingShowingProps) {\n\t\tsuper(props);\n\t}\n\tgetWrappedComponent() {\n\t\tconst { emojiResource } = this.props;\n\t\treturn (\n\t\t\t<EmojiPicker\n\t\t\t\tonSelection={this.onSelection}\n\t\t\t\temojiProvider={Promise.resolve(emojiResource as EmojiProvider)}\n\t\t\t/>\n\t\t);\n\t}\n}\nexport default function Example(): React.JSX.Element {\n\treturn (\n\t\t<IntlProvider locale=\"en\">\n\t\t\t<UsageShowingEmojiPickerTextInput emojiResource={new EmojiResource(config)} />\n\t\t</IntlProvider>\n\t);\n}"],
|
|
816
|
+
props: [{
|
|
817
|
+
name: 'emojiProvider',
|
|
818
|
+
type: 'Promise<EmojiProvider>',
|
|
819
|
+
description: 'Emoji Resource instance',
|
|
820
|
+
isRequired: true
|
|
821
|
+
}, {
|
|
822
|
+
name: 'hideToneSelector',
|
|
823
|
+
type: 'boolean',
|
|
824
|
+
description: 'Flag to disable tone selector.'
|
|
825
|
+
}, {
|
|
826
|
+
name: 'onPickerRef',
|
|
827
|
+
type: 'PickerRefHandler',
|
|
828
|
+
description: 'Callback to handle picker reference.'
|
|
829
|
+
}, {
|
|
830
|
+
name: 'onSelection',
|
|
831
|
+
type: 'OnEmojiEvent<any>',
|
|
832
|
+
description: 'Callback to be executed on emoji selection.'
|
|
833
|
+
}, {
|
|
834
|
+
name: 'size',
|
|
835
|
+
type: '"small" | "medium" | "large"',
|
|
836
|
+
description: "Size of Emoji Picker. default value is 'medium'."
|
|
837
|
+
}]
|
|
838
|
+
}, {
|
|
839
|
+
name: 'EmojiTypeAhead',
|
|
840
|
+
package: '@atlaskit/emoji',
|
|
841
|
+
description: 'A component that provides emoji suggestions based on user input.',
|
|
842
|
+
status: 'general-availability',
|
|
843
|
+
usageGuidelines: ['Use `EmojiTypeAhead` to provide a shortcut-based emoji selection experience (e.g., typing `:smile`).'],
|
|
844
|
+
keywords: ['emoji', 'typeahead', 'autocomplete'],
|
|
845
|
+
category: 'elements',
|
|
846
|
+
examples: ["import { layers } from '@atlaskit/theme/constants';\nimport React, { useRef, useState } from 'react';\n// These imports are not included in the manifest file to avoid circular package dependencies blocking our Typescript and bundling tooling\nimport { getEmojiResource } from '@atlaskit/util-data-test/get-emoji-resource';\nimport { lorem, onClose, onOpen, onSelection } from '../example-helpers';\nimport SearchTextInput from '../example-helpers/demo-search-text-input';\nimport type { TypeaheadProps } from '../example-helpers/typeahead-props';\nimport { EmojiTypeAhead } from '../src/typeahead';\nimport type { EmojiId, OptionalEmojiDescription } from '../src/types';\nimport debug from '../src/util/logger';\nimport { IntlProvider } from 'react-intl';\nconst loremContent = (\n\t<div>\n\t\t{\n\t\t<p style={{ width: '400px' }}>{lorem}</p>\n\t</div>\n);\nexport const EmojiTypeAheadTextInput = (\n\tprops: React.PropsWithChildren<TypeaheadProps>,\n): React.JSX.Element => {\n\tconst emojiTypeAheadRef = useRef<EmojiTypeAhead | null>();\n\tconst [active, setActive] = useState<boolean>(false);\n\tconst [query, setQuery] = useState<string>('');\n\tconst { onSelection, label, emojiProvider, position } = props;\n\tdebug('demo-emoji-text-input.render', position);\n\tconst target = position ? '#demo-input' : undefined;\n\tconst showEmojiPopup = () => {\n\t\tsetActive(true);\n\t};\n\tconst hideEmojiPopup = () => {\n\t\tsetActive(false);\n\t};\n\tconst handleSelection = (emojiId: EmojiId, emoji: OptionalEmojiDescription) => {\n\t\thideEmojiPopup();\n\t\tonSelection(emojiId, emoji);\n\t};\n\tconst updateSearch = (event: React.ChangeEvent<HTMLInputElement>) => {\n\t\tif (active) {\n\t\t\tsetQuery(event.target.value || '');\n\t\t}\n\t};\n\tconst handleSearchTextInputChange = (query: React.ChangeEvent<HTMLInputElement>) => {\n\t\tupdateSearch(query);\n\t};\n\tconst handleSearchTextInputUp = () => {\n\t\temojiTypeAheadRef.current?.selectPrevious();\n\t};\n\tconst handleSearchTextInputDown = () => {\n\t\temojiTypeAheadRef.current?.selectNext();\n\t};\n\tconst handleSearchTextInputEnter = () => {\n\t\temojiTypeAheadRef.current?.chooseCurrentSelection();\n\t};\n\tconst handleEmojiTypeAheadRef = (ref: EmojiTypeAhead | null) => {\n\t\temojiTypeAheadRef.current = ref;\n\t};\n\tconst handleEmojiTypeAheadSelection = (emojiId: EmojiId, emoji: OptionalEmojiDescription) => {\n\t\thandleSelection(emojiId, emoji);\n\t};\n\tconst searchInput = (\n\t\t<SearchTextInput\n\t\t\tinputId=\"demo-input\"\n\t\t\tlabel={label}\n\t\t\tonChange={handleSearchTextInputChange}\n\t\t\tonUp={handleSearchTextInputUp}\n\t\t\tonDown={handleSearchTextInputDown}\n\t\t\tonEnter={handleSearchTextInputEnter}\n\t\t\tonEscape={hideEmojiPopup}\n\t\t\tonFocus={showEmojiPopup}\n\t\t\tonBlur={hideEmojiPopup}\n\t\t/>\n\t);\n\tlet emojiTypeAhead;\n\tif (active) {\n\t\temojiTypeAhead = (\n\t\t\t<EmojiTypeAhead\n\t\t\t\ttarget={target}\n\t\t\t\tposition={position}\n\t\t\t\tonSelection={handleEmojiTypeAheadSelection}\n\t\t\t\tonOpen={onOpen}\n\t\t\t\tonClose={onClose}\n\t\t\t\tref={handleEmojiTypeAheadRef}\n\t\t\t\tquery={query}\n\t\t\t\temojiProvider={emojiProvider}\n\t\t\t\tzIndex={layers.modal()}\n\t\t\t/>\n\t\t);\n\t}\n\treturn (\n\t\t<div style={{ padding: '10px' }}>\n\t\t\t{searchInput}\n\t\t\t{emojiTypeAhead}\n\t\t\t{loremContent}\n\t\t</div>\n\t);\n};\nexport default function Example(): React.JSX.Element {\n\treturn (\n\t\t<IntlProvider locale=\"en\">\n\t\t\t<EmojiTypeAheadTextInput\n\t\t\t\tlabel=\"Emoji search\"\n\t\t\t\tonSelection={onSelection}\n\t\t\t\temojiProvider={getEmojiResource()}\n\t\t\t\tposition=\"below\"\n\t\t\t/>\n\t\t</IntlProvider>\n\t);\n}"],
|
|
847
|
+
props: [{
|
|
848
|
+
name: 'emojiProvider',
|
|
849
|
+
type: 'Promise<EmojiProvider>',
|
|
850
|
+
description: 'Emoji Resource instance',
|
|
851
|
+
isRequired: true
|
|
852
|
+
}, {
|
|
853
|
+
name: 'listLimit',
|
|
854
|
+
type: 'number',
|
|
855
|
+
description: 'Number of results to be displayed in the search results list'
|
|
856
|
+
}, {
|
|
857
|
+
name: 'offsetX',
|
|
858
|
+
type: 'number'
|
|
859
|
+
}, {
|
|
860
|
+
name: 'offsetY',
|
|
861
|
+
type: 'number'
|
|
862
|
+
}, {
|
|
863
|
+
name: 'onClose',
|
|
864
|
+
type: 'OnLifecycle',
|
|
865
|
+
description: 'Callback to be executed when typeahead component disappears'
|
|
866
|
+
}, {
|
|
867
|
+
name: 'onOpen',
|
|
868
|
+
type: 'OnLifecycle',
|
|
869
|
+
description: 'Callback to be executed when typeahead component is being shown'
|
|
870
|
+
}, {
|
|
871
|
+
name: 'onSelection',
|
|
872
|
+
type: 'OnEmojiEvent<any>',
|
|
873
|
+
description: 'Callback to be executed when user selects an emoji.'
|
|
874
|
+
}, {
|
|
875
|
+
name: 'position',
|
|
876
|
+
type: '"above" | "below" | "auto"'
|
|
877
|
+
}, {
|
|
878
|
+
name: 'query',
|
|
879
|
+
type: 'string',
|
|
880
|
+
description: 'Search query.'
|
|
881
|
+
}, {
|
|
882
|
+
name: 'target',
|
|
883
|
+
type: 'string | HTMLElement',
|
|
884
|
+
description: 'CSS selector, or target HTML element'
|
|
885
|
+
}, {
|
|
886
|
+
name: 'zIndex',
|
|
887
|
+
type: 'string | number'
|
|
888
|
+
}]
|
|
889
|
+
}, {
|
|
890
|
+
name: 'FeedbackCollector',
|
|
891
|
+
package: '@atlaskit/feedback-collector',
|
|
892
|
+
description: 'The main component for collecting user feedback.',
|
|
893
|
+
status: 'general-availability',
|
|
894
|
+
usageGuidelines: ['Use `FeedbackCollector` to trigger a feedback form from your application.', 'Provide `onClose` and `onSubmit` handlers to manage the feedback flow.'],
|
|
895
|
+
keywords: ['feedback', 'collector', 'atlassian'],
|
|
896
|
+
category: 'web-platform',
|
|
897
|
+
examples: ["import React, { useRef, useState } from 'react';\nimport Button from '@atlaskit/button/new';\nimport { FlagGroup } from '@atlaskit/flag';\nimport FeedbackCollector, { FeedbackFlag } from '../src';\nconst ENTRYPOINT_ID: string = 'e0d501eb-7386-4ba7-aedc-68dc1dde485a';\nconst name: string = 'Feedback Sender';\nconst aaid: string = 'test-aaid';\nconst DisplayFeedback = () => {\n\tconst ref = useRef<HTMLElement | null>(null);\n\tconst [isOpen, setIsOpen] = useState(false);\n\tconst [displayFlag, setDisplayFlag] = useState(false);\n\tconst open = () => setIsOpen(true);\n\tconst close = () => setIsOpen(false);\n\tconst displayFlagTrue = () => setDisplayFlag(true);\n\tconst hideFlag = () => setDisplayFlag(false);\n\treturn (\n\t\t<div>\n\t\t\t<Button appearance=\"primary\" onClick={open}>\n\t\t\t\tDisplay Feedback\n\t\t\t</Button>\n\t\t\t{isOpen && (\n\t\t\t\t<FeedbackCollector\n\t\t\t\t\tlocale={'en'}\n\t\t\t\t\turl={'https://api-private.atlassian.com'}\n\t\t\t\t\tonClose={close}\n\t\t\t\t\tonSubmit={displayFlagTrue}\n\t\t\t\t\tatlassianAccountId={aaid}\n\t\t\t\t\tname={name}\n\t\t\t\t\tentrypointId={ENTRYPOINT_ID}\n\t\t\t\t\tshouldReturnFocusRef={ref}\n\t\t\t\t/>\n\t\t\t)}\n\t\t\t<FlagGroup onDismissed={hideFlag}>{displayFlag && <FeedbackFlag />}</FlagGroup>\n\t\t</div>\n\t);\n};\nexport default (): React.JSX.Element => (\n\t<>\n\t\t<>Click the button to display the feedback collector.</>\n\t\t<DisplayFeedback />\n\t</>\n);"],
|
|
898
|
+
props: [{
|
|
899
|
+
name: 'additionalFields',
|
|
900
|
+
type: 'FieldType[]',
|
|
901
|
+
description: 'Additional fields to send to the widget service *',
|
|
902
|
+
isRequired: true
|
|
903
|
+
}, {
|
|
904
|
+
name: 'anonymousFeedback',
|
|
905
|
+
type: 'boolean',
|
|
906
|
+
description: 'Override to mark feedback as anonymous'
|
|
907
|
+
}, {
|
|
908
|
+
name: 'atlassianAccountId',
|
|
909
|
+
type: 'string',
|
|
910
|
+
description: "Optional parameter for feedback submitter's Atlassian Account ID"
|
|
911
|
+
}, {
|
|
912
|
+
name: 'canBeContactedAgreeValue',
|
|
913
|
+
type: 'string | Object | Object[]',
|
|
914
|
+
description: 'Override the agree value for the "can be contacted" custom field in your widget service',
|
|
915
|
+
isRequired: true
|
|
916
|
+
}, {
|
|
917
|
+
name: 'canBeContactedDeclineValue',
|
|
918
|
+
type: 'string | Object | Object[]',
|
|
919
|
+
description: 'Override the decline value for the "can be contacted" custom field in your widget service',
|
|
920
|
+
isRequired: true
|
|
921
|
+
}, {
|
|
922
|
+
name: 'canBeContactedFieldId',
|
|
923
|
+
type: 'string',
|
|
924
|
+
description: 'Override the default id for the "can be contacted" custom field in your widget service *',
|
|
925
|
+
isRequired: true
|
|
926
|
+
}, {
|
|
927
|
+
name: 'canBeContactedLabel',
|
|
928
|
+
type: 'string | number | ReactElement<any, string | JSXElementConstructor<any>>',
|
|
929
|
+
description: 'Message which will be shown next to the can be contacted checkbox'
|
|
930
|
+
}, {
|
|
931
|
+
name: 'canBeContactedLink',
|
|
932
|
+
type: 'string | number | boolean | ReactElement<any, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortal',
|
|
933
|
+
description: 'Link which will be shown below the can be contacted checkbox'
|
|
934
|
+
}, {
|
|
935
|
+
name: 'cancelButtonLabel',
|
|
936
|
+
type: 'string',
|
|
937
|
+
description: 'Message for cancel button label'
|
|
938
|
+
}, {
|
|
939
|
+
name: 'customContent',
|
|
940
|
+
type: 'string | number | ReactElement<any, string | JSXElementConstructor<any>>',
|
|
941
|
+
description: 'Optional custom modal content'
|
|
942
|
+
}, {
|
|
943
|
+
name: 'customerNameDefaultValue',
|
|
944
|
+
type: 'string | Object | Object[]',
|
|
945
|
+
description: 'Override the default value for the "customer name" custom field in your widget service',
|
|
946
|
+
isRequired: true
|
|
947
|
+
}, {
|
|
948
|
+
name: 'customerNameFieldId',
|
|
949
|
+
type: 'string',
|
|
950
|
+
description: 'Override the default id for the "customer name" custom field in your widget service',
|
|
951
|
+
isRequired: true
|
|
952
|
+
}, {
|
|
953
|
+
name: 'customFeedbackOptions',
|
|
954
|
+
type: 'OptionType[]',
|
|
955
|
+
description: 'Custom Select feedback options'
|
|
956
|
+
}, {
|
|
957
|
+
name: 'customFeedbackUrl',
|
|
958
|
+
type: 'string',
|
|
959
|
+
description: 'A custom URL for the Feedback Collector API, this field takes priority over `url`'
|
|
960
|
+
}, {
|
|
961
|
+
name: 'customGatewayUrl',
|
|
962
|
+
type: 'string',
|
|
963
|
+
description: 'A custom URL for the Stargate gateway, this field takes priority over `url`'
|
|
964
|
+
}, {
|
|
965
|
+
name: 'customTextAreaLabel',
|
|
966
|
+
type: 'string',
|
|
967
|
+
description: 'Optional custom label for TextArea when showTypeField is false'
|
|
968
|
+
}, {
|
|
969
|
+
name: 'descriptionDefaultValue',
|
|
970
|
+
type: 'string | Object | Object[]',
|
|
971
|
+
description: 'Override the default value for the "description" custom field in your widget service',
|
|
972
|
+
isRequired: true
|
|
973
|
+
}, {
|
|
974
|
+
name: 'descriptionFieldId',
|
|
975
|
+
type: 'string',
|
|
976
|
+
description: 'Override the default id for the "description" custom field in your widget service',
|
|
977
|
+
isRequired: true
|
|
978
|
+
}, {
|
|
979
|
+
name: 'dialogRef',
|
|
980
|
+
type: 'RefObject<HTMLElement>',
|
|
981
|
+
description: 'Ref to the rendered feedback dialog container'
|
|
982
|
+
}, {
|
|
983
|
+
name: 'disableSubmitButton',
|
|
984
|
+
type: 'boolean',
|
|
985
|
+
description: 'Disable submit button to allow custom content to handle validation'
|
|
986
|
+
}, {
|
|
987
|
+
name: 'email',
|
|
988
|
+
type: 'string',
|
|
989
|
+
description: "Optional parameter for feedback submitter's email address"
|
|
990
|
+
}, {
|
|
991
|
+
name: 'enrolInResearchLabel',
|
|
992
|
+
type: 'string | number | ReactElement<any, string | JSXElementConstructor<any>>',
|
|
993
|
+
description: 'Message which will be shown next to the enrol in research checkbox'
|
|
994
|
+
}, {
|
|
995
|
+
name: 'enrolInResearchLink',
|
|
996
|
+
type: 'string | number | ReactElement<any, string | JSXElementConstructor<any>>',
|
|
997
|
+
description: 'Message which will be shown below the enrol in research checkbox'
|
|
998
|
+
}, {
|
|
999
|
+
name: 'enrollInResearchAgreeValue',
|
|
1000
|
+
type: 'string | Object | Object[]',
|
|
1001
|
+
description: 'Override the agree value for the "enroll in research" custom field in your widget service',
|
|
1002
|
+
isRequired: true
|
|
1003
|
+
}, {
|
|
1004
|
+
name: 'enrollInResearchDeclineValue',
|
|
1005
|
+
type: 'string | Object | Object[]',
|
|
1006
|
+
description: 'Override the decline value for the "enroll in research" custom field in your widget service',
|
|
1007
|
+
isRequired: true
|
|
1008
|
+
}, {
|
|
1009
|
+
name: 'enrollInResearchFieldId',
|
|
1010
|
+
type: 'string',
|
|
1011
|
+
description: 'Override the default id for the "enroll in research" custom field in your widget service',
|
|
1012
|
+
isRequired: true
|
|
1013
|
+
}, {
|
|
1014
|
+
name: 'entrypointId',
|
|
1015
|
+
type: 'string',
|
|
1016
|
+
description: 'The id of the entrypoint in the feedback service; to acquire your entrypointId, visit the #feedback-collectors channel',
|
|
1017
|
+
isRequired: true
|
|
1018
|
+
}, {
|
|
1019
|
+
name: 'feedbackGroupLabels',
|
|
1020
|
+
type: '{ bug?: SelectOptionDetails; comment?: SelectOptionDetails; suggestion?: SelectOptionDetails; question?: SelectOptionDetails; ... 5 more ...; other?: SelectOptionDetails; }',
|
|
1021
|
+
description: 'Message for select option labels and field labels'
|
|
1022
|
+
}, {
|
|
1023
|
+
name: 'feedbackTitle',
|
|
1024
|
+
type: 'string | number',
|
|
1025
|
+
description: 'Message which will be shown as the title of the feedback dialog'
|
|
1026
|
+
}, {
|
|
1027
|
+
name: 'feedbackTitleDetails',
|
|
1028
|
+
type: 'string | number | ReactElement<any, string | JSXElementConstructor<any>>',
|
|
1029
|
+
description: 'Message which will be shown below the title of the feedback dialog'
|
|
1030
|
+
}, {
|
|
1031
|
+
name: 'locale',
|
|
1032
|
+
type: 'string',
|
|
1033
|
+
description: 'Locale for i18n',
|
|
1034
|
+
isRequired: true
|
|
1035
|
+
}, {
|
|
1036
|
+
name: 'name',
|
|
1037
|
+
type: 'string',
|
|
1038
|
+
description: 'The customer name'
|
|
1039
|
+
}, {
|
|
1040
|
+
name: 'onCancel',
|
|
1041
|
+
type: '(...args: any[]) => void',
|
|
1042
|
+
description: 'Optional function that will be called when the cancel button is clicked, in addition to onClose.'
|
|
1043
|
+
}, {
|
|
1044
|
+
name: 'onClose',
|
|
1045
|
+
type: '(...args: any[]) => void',
|
|
1046
|
+
description: 'Function that will be called to initiate the exit transition.\nWhen triggered by the cancel button the originating event and Atlaskit UI analytics\nevent are forwarded; programmatic close paths (e.g. after submit) invoke it with no\narguments. Typed as a variadic `any[]` to maximise backward compatibility with\nconsumers that declared any conceivable signature for this callback.',
|
|
1047
|
+
isRequired: true
|
|
1048
|
+
}, {
|
|
1049
|
+
name: 'onSubmit',
|
|
1050
|
+
type: '(formFields: FormFields) => void',
|
|
1051
|
+
description: 'Function that will be called optimistically after a delay when the feedback is submitted.',
|
|
1052
|
+
isRequired: true
|
|
1053
|
+
}, {
|
|
1054
|
+
name: 'selectLabel',
|
|
1055
|
+
type: 'string',
|
|
1056
|
+
description: 'Optional custom label for select field'
|
|
1057
|
+
}, {
|
|
1058
|
+
name: 'shouldGetEntitlementDetails',
|
|
1059
|
+
type: 'boolean',
|
|
1060
|
+
description: 'Whether to request email details and product entitlements'
|
|
1061
|
+
}, {
|
|
1062
|
+
name: 'shouldReturnFocusRef',
|
|
1063
|
+
type: 'RefObject<HTMLElement>',
|
|
1064
|
+
description: 'Optional ref to return focus to after feedback form is closed'
|
|
1065
|
+
}, {
|
|
1066
|
+
name: 'showDefaultTextFields',
|
|
1067
|
+
type: 'boolean',
|
|
1068
|
+
description: 'Override to hide the default text fields for feedback'
|
|
1069
|
+
}, {
|
|
1070
|
+
name: 'showRequiredFieldsSummary',
|
|
1071
|
+
type: 'boolean',
|
|
1072
|
+
description: 'Optional to show or hide the required fields summary'
|
|
1073
|
+
}, {
|
|
1074
|
+
name: 'showTypeField',
|
|
1075
|
+
type: 'boolean',
|
|
1076
|
+
description: 'Override to hide the feedback type select drop down for the feedback',
|
|
1077
|
+
isRequired: true
|
|
1078
|
+
}, {
|
|
1079
|
+
name: 'submitButtonLabel',
|
|
1080
|
+
type: 'string',
|
|
1081
|
+
description: 'Message for submit button label'
|
|
1082
|
+
}, {
|
|
1083
|
+
name: 'summaryDefaultValue',
|
|
1084
|
+
type: 'string | Object | Object[]',
|
|
1085
|
+
description: 'Override the default value for the "summary" custom field in your widget service',
|
|
1086
|
+
isRequired: true
|
|
1087
|
+
}, {
|
|
1088
|
+
name: 'summaryFieldId',
|
|
1089
|
+
type: 'string',
|
|
1090
|
+
description: 'Override the default id for the "summary" custom field in your widget service',
|
|
1091
|
+
isRequired: true
|
|
1092
|
+
}, {
|
|
1093
|
+
name: 'summaryPlaceholder',
|
|
1094
|
+
type: 'string',
|
|
1095
|
+
description: 'Message which will be shown inside the summary text field'
|
|
1096
|
+
}, {
|
|
1097
|
+
name: 'summaryTruncateLength',
|
|
1098
|
+
type: 'number',
|
|
1099
|
+
description: 'Number of characters that the "summary" field accepts, the rest will be truncated',
|
|
1100
|
+
isRequired: true
|
|
1101
|
+
}, {
|
|
1102
|
+
name: 'timeoutOnSubmit',
|
|
1103
|
+
type: 'number',
|
|
1104
|
+
description: 'After this delay the onSubmit callback will be triggered optimistically',
|
|
1105
|
+
isRequired: true
|
|
1106
|
+
}, {
|
|
1107
|
+
name: 'typeBugDefaultValue',
|
|
1108
|
+
type: 'string | Object | Object[]',
|
|
1109
|
+
description: 'Override the default value for the "Bug" type of response in your widget service',
|
|
1110
|
+
isRequired: true
|
|
1111
|
+
}, {
|
|
1112
|
+
name: 'typeCommentDefaultValue',
|
|
1113
|
+
type: 'string | Object | Object[]',
|
|
1114
|
+
description: 'Override the default value for the "Comment" type of response in your widget service',
|
|
1115
|
+
isRequired: true
|
|
1116
|
+
}, {
|
|
1117
|
+
name: 'typeEmptyDefaultValue',
|
|
1118
|
+
type: 'string | Object | Object[]',
|
|
1119
|
+
description: 'Override the default value for the "Empty" type of response in your widget service',
|
|
1120
|
+
isRequired: true
|
|
1121
|
+
}, {
|
|
1122
|
+
name: 'typeFieldId',
|
|
1123
|
+
type: 'string',
|
|
1124
|
+
description: 'Override the default id for the "type" custom field in your widget service',
|
|
1125
|
+
isRequired: true
|
|
1126
|
+
}, {
|
|
1127
|
+
name: 'typeQuestionDefaultValue',
|
|
1128
|
+
type: 'string | Object | Object[]',
|
|
1129
|
+
description: 'Override the default value for the "Question" type of response in your widget service',
|
|
1130
|
+
isRequired: true
|
|
1131
|
+
}, {
|
|
1132
|
+
name: 'typeSuggestionDefaultValue',
|
|
1133
|
+
type: 'string | Object | Object[]',
|
|
1134
|
+
description: 'Override the default value for the "Suggestion" type of response in your widget service',
|
|
1135
|
+
isRequired: true
|
|
1136
|
+
}, {
|
|
1137
|
+
name: 'url',
|
|
1138
|
+
type: 'string',
|
|
1139
|
+
description: 'Override the URL for all HTTPS calls, only needed if service is not behind stargate (like the Atlaskit frontend itself)'
|
|
1140
|
+
}]
|
|
1141
|
+
}, {
|
|
1142
|
+
name: 'FeedbackButton',
|
|
1143
|
+
package: '@atlaskit/feedback-collector',
|
|
1144
|
+
description: 'A button component used to trigger the feedback collector.',
|
|
1145
|
+
status: 'general-availability',
|
|
1146
|
+
usageGuidelines: ['Use `FeedbackButton` to provide a consistent trigger for the feedback collector.'],
|
|
1147
|
+
keywords: ['feedback', 'button', 'trigger'],
|
|
1148
|
+
category: 'web-platform',
|
|
1149
|
+
examples: ["import { FeedbackButton } from '../src';\nexport default (): React.JSX.Element => <FeedbackButton locale={'en'} entrypointId={'key1'} />;"],
|
|
1150
|
+
props: [{
|
|
1151
|
+
name: 'atlassianAccountId',
|
|
1152
|
+
type: 'string'
|
|
1153
|
+
}, {
|
|
1154
|
+
name: 'entrypointId',
|
|
1155
|
+
type: 'string',
|
|
1156
|
+
isRequired: true
|
|
1157
|
+
}, {
|
|
1158
|
+
name: 'locale',
|
|
1159
|
+
type: 'string',
|
|
1160
|
+
isRequired: true
|
|
1161
|
+
}, {
|
|
1162
|
+
name: 'shouldGetEntitlementDetails',
|
|
1163
|
+
type: 'boolean'
|
|
1164
|
+
}]
|
|
700
1165
|
}, {
|
|
701
1166
|
name: 'AssetsConfigModal',
|
|
702
1167
|
package: '@atlaskit/link-datasource',
|
|
@@ -1065,61 +1530,1010 @@ var atlaskitComponents = exports.atlaskitComponents = [{
|
|
|
1065
1530
|
description: 'The url of the linked resource for editing.'
|
|
1066
1531
|
}]
|
|
1067
1532
|
}, {
|
|
1068
|
-
name: '
|
|
1069
|
-
package: '@atlaskit/
|
|
1070
|
-
description: '
|
|
1533
|
+
name: 'AvatarPickerDialog',
|
|
1534
|
+
package: '@atlaskit/media-avatar-picker',
|
|
1535
|
+
description: 'Main dialog component that orchestrates the avatar selection experience.',
|
|
1071
1536
|
status: 'general-availability',
|
|
1072
|
-
usageGuidelines: ['Use
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
category: 'editor',
|
|
1077
|
-
examples: ["import type { ChangeEvent } from 'react';\nimport RendererDemo from './helper/RendererDemo';\nimport { SmartCardProvider, CardClient } from '@atlaskit/link-provider';\nimport { getSchemaBasedOnStage } from '@atlaskit/adf-schema/schema-default';\nimport type { ADFStage } from '@atlaskit/editor-common/validator';\nconst ADF_STAGE0 = 'stage0';\nconst ADF_FINAL = 'final';\nexport default function Example(): React.JSX.Element {\n\tconst [adfStage, setAdfStage] = React.useState<ADFStage>(ADF_FINAL);\n\tconst schema = getSchemaBasedOnStage(adfStage);\n\tconst onSchemaToggle = (event: ChangeEvent<HTMLInputElement>) => {\n\t\tsetAdfStage(event.currentTarget.checked ? ADF_STAGE0 : ADF_FINAL);\n\t};\n\tconst toggleCheckbox = (\n\t\t<label>\n\t\t\t{\n\t\t\t<input type=\"checkbox\" checked={adfStage === ADF_STAGE0} onChange={onSchemaToggle} />\n\t\t\tUse stage0 (experimental) document schema\n\t\t</label>\n\t);\n\treturn (\n\t\t<SmartCardProvider client={new CardClient('staging')}>\n\t\t\t<RendererDemo\n\t\t\t\tallowColumnSorting\n\t\t\t\tallowSelectAllTrap\n\t\t\t\tallowWrapCodeBlock\n\t\t\t\tallowCopyToClipboard\n\t\t\t\tserializer=\"react\"\n\t\t\t\tadfStage={adfStage}\n\t\t\t\tschema={schema}\n\t\t\t\tactionButtons={toggleCheckbox}\n\t\t\t\twithProviders\n\t\t\t/>\n\t\t</SmartCardProvider>\n\t);\n}", 'import RendererDemo from \'./helper/RendererDemo\';\nimport {\n\tNORMAL_SEVERITY_THRESHOLD,\n\tDEGRADED_SEVERITY_THRESHOLD,\n} from \'../../renderer/src/ui/Renderer\';\nexport default function Example(): React.JSX.Element {\n\treturn (\n\t\t<RendererDemo\n\t\t\tappearance="full-page"\n\t\t\tserializer="react"\n\t\t\tallowHeadingAnchorLinks\n\t\t\tallowColumnSorting={true}\n\t\t\tallowCopyToClipboard\n\t\t\tallowWrapCodeBlock\n\t\t\tUNSTABLE_allowTableAlignment\n\t\t\tUNSTABLE_allowTableResizing\n\t\t\tanalyticsEventSeverityTracking={{\n\t\t\t\tenabled: true,\n\t\t\t\tseverityNormalThreshold: NORMAL_SEVERITY_THRESHOLD,\n\t\t\t\tseverityDegradedThreshold: DEGRADED_SEVERITY_THRESHOLD,\n\t\t\t}}\n\t\t/>\n\t);\n}', 'import RendererDemo from \'./helper/RendererDemo\';\nexport default function Example(): React.JSX.Element {\n\treturn <RendererDemo withProviders={true} serializer="react" />;\n}'],
|
|
1537
|
+
usageGuidelines: ['Use `AvatarPickerDialog` when you need to allow users to upload or select an avatar.'],
|
|
1538
|
+
keywords: ['media', 'avatar', 'picker', 'upload'],
|
|
1539
|
+
category: 'media',
|
|
1540
|
+
examples: ["import { tallImage } from '@atlaskit/media-test-helpers';\nimport StatefulAvatarPickerDialog from '../example-helpers/StatefulAvatarPickerDialog';\nexport default (): React.JSX.Element => (\n\t<StatefulAvatarPickerDialog placeholder={<div>Loading...</div>} imageSource={tallImage} />\n);"],
|
|
1078
1541
|
props: [{
|
|
1079
|
-
name: '
|
|
1080
|
-
type: '
|
|
1081
|
-
description: '
|
|
1542
|
+
name: 'avatars',
|
|
1543
|
+
type: 'Avatar[]',
|
|
1544
|
+
description: 'This property is used to provide an array of pre-defined avatars. The **Avatar** object is a simple type with a single **dataURI: string** property. For convenience, this type is exported from the **@atlassian/media-avatar-picker** module along with the **AvatarPickerDialog** component.',
|
|
1545
|
+
isRequired: true
|
|
1082
1546
|
}, {
|
|
1083
|
-
name: '
|
|
1084
|
-
type: '
|
|
1547
|
+
name: 'defaultSelectedAvatar',
|
|
1548
|
+
type: 'Avatar',
|
|
1549
|
+
description: 'This property is used along with the **avatar** property. It allows you to set the currently selected pre-defined avatar. By default, there is no pre-defined avatar selected, even if the **avatars** property is set.'
|
|
1085
1550
|
}, {
|
|
1086
|
-
name: '
|
|
1087
|
-
type: '
|
|
1551
|
+
name: 'errorMessage',
|
|
1552
|
+
type: 'string',
|
|
1553
|
+
description: 'This optional property allows the consumer to display an error message. This may occur from a call to a service. The string is clipped if greater than 125 charaters (approximately 3 lines within the dialog).'
|
|
1088
1554
|
}, {
|
|
1089
|
-
name: '
|
|
1090
|
-
type: '
|
|
1555
|
+
name: 'imageSource',
|
|
1556
|
+
type: 'string',
|
|
1557
|
+
description: 'This optional property is used to set the selected image so that the component opens up with it visible already. The value should be a valid dataURI string. If an invalid dataURI is given, the bad format error state will be triggered and a message shown.'
|
|
1091
1558
|
}, {
|
|
1092
|
-
name: '
|
|
1093
|
-
type: 'boolean'
|
|
1559
|
+
name: 'isLoading',
|
|
1560
|
+
type: 'boolean',
|
|
1561
|
+
description: 'This optional property is used while the avatar is loaded.'
|
|
1094
1562
|
}, {
|
|
1095
|
-
name: '
|
|
1096
|
-
type: '
|
|
1563
|
+
name: 'maxImageSize',
|
|
1564
|
+
type: 'number',
|
|
1565
|
+
description: 'This optional property allows the consumer to define the maximum image size that can be uploaded.'
|
|
1097
1566
|
}, {
|
|
1098
|
-
name: '
|
|
1099
|
-
type: '
|
|
1567
|
+
name: 'onAvatarPicked',
|
|
1568
|
+
type: '((avatar: Avatar) => void) | ((avatar: Avatar, altText: string) => void)',
|
|
1569
|
+
description: 'This property is raised when the user clicks the **Save** button and there is a pre-defined avatar selected, and no image selected. An **Avatar** object with a **dataURI** property is passed.\nThis property is raised when the user clicks the **Save** button and there is a pre-defined avatar selected, and no image selected. Two arguments are passed, an **Avatar** object with a **dataURI** property, and an **altText** string.',
|
|
1570
|
+
isRequired: true
|
|
1100
1571
|
}, {
|
|
1101
|
-
name: '
|
|
1102
|
-
type: '
|
|
1572
|
+
name: 'onCancel',
|
|
1573
|
+
type: '() => void',
|
|
1574
|
+
description: 'This property is raised when the user clicks **Cancel** button.\n **Note** this does not close the dialog.\nIt is up to the consumer to re-render and remove the dialog from the UI.',
|
|
1575
|
+
isRequired: true
|
|
1103
1576
|
}, {
|
|
1104
|
-
name: '
|
|
1105
|
-
type: '
|
|
1577
|
+
name: 'onImagePicked',
|
|
1578
|
+
type: '((file: File, crop: CropProperties) => void) | ((file: File, crop: CropProperties, altText: string) => void)',
|
|
1579
|
+
description: 'This property is raised when the user clicks the **Save** button and there is a selected image.\nTwo arguments are passed, the **file:File** which is a blob, and the crop settings which is an object containing **x:number**,**y:number**, and **size:number** values, which are all relative to the coordinates of the selected image. **Note** due to limitations on Safari <= 10.0 and IE11, a **Blob** object will be returned instead of a **File**.\nThis still allows access to the image byte data to facilitate uploads, essentially minus the filename and date attributes.\nThis property is raised when the user clicks the **Save** button and there is a selected image.\nThree arguments are passed, the **file:File** which is a blob, the crop settings which is an object containing **x:number**,**y:number**, and **size:number** values, which are all relative to the coordinates of the selected image, and **altText:string**. **Note** due to limitations on Safari <= 10.0 and IE11, a **Blob** object will be returned instead of a **File**.\nThis still allows access to the image byte data to facilitate uploads, essentially minus the filename and date attributes.'
|
|
1106
1580
|
}, {
|
|
1107
|
-
name: '
|
|
1108
|
-
type: '
|
|
1581
|
+
name: 'onImagePickedDataURI',
|
|
1582
|
+
type: '((dataUri: string) => void) | ((dataUri: string, altText: string) => void)',
|
|
1583
|
+
description: 'This property is raised when the user clicks the **Save** button and there is a selected image. The selected image is provided as a dataURI string.\nThis property is raised when the user clicks the **Save** button and there is a selected image. The selected image is provided as a dataURI string, and the user-specified alt text is provided as an altText string.'
|
|
1109
1584
|
}, {
|
|
1110
|
-
name: '
|
|
1111
|
-
type: '
|
|
1585
|
+
name: 'outputSize',
|
|
1586
|
+
type: 'number',
|
|
1587
|
+
description: 'The target width/height of the resulting (square) avatar. Leave blank for default (200x200)'
|
|
1112
1588
|
}, {
|
|
1113
|
-
name: '
|
|
1114
|
-
type: 'boolean'
|
|
1589
|
+
name: 'placeholder',
|
|
1590
|
+
type: 'string | number | boolean | React.ReactElement<any, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | React.ReactPortal'
|
|
1115
1591
|
}, {
|
|
1116
|
-
name: '
|
|
1117
|
-
type: '
|
|
1592
|
+
name: 'predefinedAvatarsText',
|
|
1593
|
+
type: 'string',
|
|
1594
|
+
description: 'This property describes the text related to the Avatar.'
|
|
1118
1595
|
}, {
|
|
1119
|
-
name: '
|
|
1120
|
-
type: '
|
|
1596
|
+
name: 'primaryButtonText',
|
|
1597
|
+
type: 'string',
|
|
1598
|
+
description: 'The primary button text. The default is _Save_.'
|
|
1121
1599
|
}, {
|
|
1122
|
-
name: '
|
|
1600
|
+
name: 'requireAltText',
|
|
1601
|
+
type: 'boolean',
|
|
1602
|
+
description: 'This property allows the consumer to specify whether or not the user should be required to enter alt text.\nThis property allows the consumer to specify whether or not the user should be required to enter alt text.'
|
|
1603
|
+
}, {
|
|
1604
|
+
name: 'selectAvatarLabel',
|
|
1605
|
+
type: 'string',
|
|
1606
|
+
description: 'This optional property allows the consumer to define a custom label for select default avatar. The default is _Select a default avatar_.'
|
|
1607
|
+
}, {
|
|
1608
|
+
name: 'showMoreAvatarsButtonLabel',
|
|
1609
|
+
type: 'string',
|
|
1610
|
+
description: 'This optional property allows the consumer to define a custom label for the default avatars show more button. The default is _Show more_.'
|
|
1611
|
+
}, {
|
|
1612
|
+
name: 'title',
|
|
1613
|
+
type: 'string',
|
|
1614
|
+
description: 'The title text for the dialog. The default is _Upload an avatar_.'
|
|
1615
|
+
}]
|
|
1616
|
+
}, {
|
|
1617
|
+
name: 'ImageCropper',
|
|
1618
|
+
package: '@atlaskit/media-avatar-picker',
|
|
1619
|
+
description: 'Interactive component for cropping uploaded images.',
|
|
1620
|
+
status: 'general-availability',
|
|
1621
|
+
usageGuidelines: ['Use `ImageCropper` for standalone image cropping functionality.'],
|
|
1622
|
+
keywords: ['media', 'crop', 'image'],
|
|
1623
|
+
category: 'media',
|
|
1624
|
+
examples: ["import { IntlProvider } from 'react-intl';\nimport ImageCropper from '../src/image-cropper';\nimport { tallImage } from '@atlaskit/media-test-helpers';\nconst naturalWidth = 5360;\nconst onImageLoaded = (img: HTMLImageElement) =>\n\tconsole.log('onImageLoaded', img.naturalWidth, img.naturalHeight);\nconst onRemoveImage = () => console.log('onRemoveImage');\nconst onImageError = (errorMessage: string) => console.log('onImageError', errorMessage);\nexport default (): React.JSX.Element => (\n\t<IntlProvider locale=\"en\">\n\t\t<div>\n\t\t\t<div>\n\t\t\t\t<h1>default</h1>\n\t\t\t\t<ImageCropper\n\t\t\t\t\timageOrientation={1}\n\t\t\t\t\timageSource={tallImage}\n\t\t\t\t\timageWidth={naturalWidth}\n\t\t\t\t\ttop={-80}\n\t\t\t\t\tleft={-80}\n\t\t\t\t\tonDragStarted={() => console.log('DragStarted')}\n\t\t\t\t\tonImageLoaded={onImageLoaded}\n\t\t\t\t\tonRemoveImage={onRemoveImage}\n\t\t\t\t\tonImageError={onImageError}\n\t\t\t\t/>\n\t\t\t</div>\n\t\t\t<div>\n\t\t\t\t<h1>when image width is not set</h1>\n\t\t\t\t<ImageCropper\n\t\t\t\t\timageOrientation={1}\n\t\t\t\t\timageSource={tallImage}\n\t\t\t\t\ttop={-50}\n\t\t\t\t\tleft={-115}\n\t\t\t\t\tonImageLoaded={onImageLoaded}\n\t\t\t\t\tonRemoveImage={onRemoveImage}\n\t\t\t\t\tonImageError={onImageError}\n\t\t\t\t/>\n\t\t\t</div>\n\t\t\t<div>\n\t\t\t\t<h1>with custom container size</h1>\n\t\t\t\t<ImageCropper\n\t\t\t\t\timageOrientation={1}\n\t\t\t\t\timageSource={tallImage}\n\t\t\t\t\timageWidth={naturalWidth}\n\t\t\t\t\tonImageLoaded={onImageLoaded}\n\t\t\t\t\ttop={-50}\n\t\t\t\t\tleft={-115}\n\t\t\t\t\tcontainerSize={400}\n\t\t\t\t\tonRemoveImage={onRemoveImage}\n\t\t\t\t\tonImageError={onImageError}\n\t\t\t\t/>\n\t\t\t</div>\n\t\t\t<div>\n\t\t\t\t<h1>with circular mask</h1>\n\t\t\t\t<ImageCropper\n\t\t\t\t\timageOrientation={1}\n\t\t\t\t\timageSource={tallImage}\n\t\t\t\t\timageWidth={naturalWidth}\n\t\t\t\t\ttop={-70}\n\t\t\t\t\tleft={-90}\n\t\t\t\t\tisCircularMask={true}\n\t\t\t\t\tonImageLoaded={onImageLoaded}\n\t\t\t\t\tonRemoveImage={onRemoveImage}\n\t\t\t\t\tonImageError={onImageError}\n\t\t\t\t/>\n\t\t\t</div>\n\t\t</div>\n\t</IntlProvider>\n);"],
|
|
1625
|
+
props: [{
|
|
1626
|
+
name: 'containerSize',
|
|
1627
|
+
type: 'number'
|
|
1628
|
+
}, {
|
|
1629
|
+
name: 'imageHeight',
|
|
1630
|
+
type: 'number'
|
|
1631
|
+
}, {
|
|
1632
|
+
name: 'imageOrientation',
|
|
1633
|
+
type: 'number',
|
|
1634
|
+
isRequired: true
|
|
1635
|
+
}, {
|
|
1636
|
+
name: 'imageSource',
|
|
1637
|
+
type: 'string',
|
|
1638
|
+
isRequired: true
|
|
1639
|
+
}, {
|
|
1640
|
+
name: 'imageWidth',
|
|
1641
|
+
type: 'number'
|
|
1642
|
+
}, {
|
|
1643
|
+
name: 'isCircularMask',
|
|
1644
|
+
type: 'boolean'
|
|
1645
|
+
}, {
|
|
1646
|
+
name: 'left',
|
|
1647
|
+
type: 'number',
|
|
1648
|
+
isRequired: true
|
|
1649
|
+
}, {
|
|
1650
|
+
name: 'moveImage',
|
|
1651
|
+
type: '(key: string) => void'
|
|
1652
|
+
}, {
|
|
1653
|
+
name: 'onDragStarted',
|
|
1654
|
+
type: '(x: number, y: number) => void'
|
|
1655
|
+
}, {
|
|
1656
|
+
name: 'onImageError',
|
|
1657
|
+
type: '(errorMessage: string) => void',
|
|
1658
|
+
isRequired: true
|
|
1659
|
+
}, {
|
|
1660
|
+
name: 'onImageLoaded',
|
|
1661
|
+
type: '(image: HTMLImageElement) => void',
|
|
1662
|
+
isRequired: true
|
|
1663
|
+
}, {
|
|
1664
|
+
name: 'onRemoveImage',
|
|
1665
|
+
type: '() => void',
|
|
1666
|
+
isRequired: true
|
|
1667
|
+
}, {
|
|
1668
|
+
name: 'top',
|
|
1669
|
+
type: 'number',
|
|
1670
|
+
isRequired: true
|
|
1671
|
+
}]
|
|
1672
|
+
}, {
|
|
1673
|
+
name: 'Card',
|
|
1674
|
+
package: '@atlaskit/media-card',
|
|
1675
|
+
description: 'The main component for displaying media files as cards.',
|
|
1676
|
+
status: 'general-availability',
|
|
1677
|
+
usageGuidelines: ['Use `Card` to display media files in a grid or list.', 'Requires a `MediaClient` instance and a file identifier.'],
|
|
1678
|
+
keywords: ['media', 'card', 'file', 'display'],
|
|
1679
|
+
category: 'media',
|
|
1680
|
+
examples: ["/**\n * @jsxRuntime classic\n * @jsx jsx\n */\nimport { jsx } from '@emotion/react';\nimport { Component, type SyntheticEvent } from 'react';\nimport {\n\tdefaultCollectionName,\n\tgenericFileId,\n\taudioFileId,\n\taudioNoCoverFileId,\n\tvideoFileId,\n\tvideoProcessingFailedId,\n\tdocFileId,\n\tlargePdfFileId,\n\tarchiveFileId,\n\tunknownFileId,\n\terrorFileId,\n\tgifFileId,\n\tnoMetadataFileId,\n\tcreateUploadMediaClientConfig,\n\temptyImageFileId,\n} from '@atlaskit/media-test-helpers';\nimport Button from '@atlaskit/button/new';\nimport { Card } from '../src';\nimport {\n\tUploadController,\n\ttype FileIdentifier,\n\tMediaClient,\n\ttype MediaSubscribable,\n} from '@atlaskit/media-client';\nimport { cardWrapperStyles, cardFlowHeaderStyles } from '../example-helpers/styles';\nimport { MainWrapper } from '../example-helpers';\nconst mediaClientConfig = createUploadMediaClientConfig();\nconst mediaClient = new MediaClient(mediaClientConfig);\nexport interface ComponentProps {}\ntype fileId = {\n\tid: string;\n\tname?: string;\n};\nexport interface ComponentState {\n\tfileIds: fileId[];\n}\nconst fileIds = [\n\t{ id: genericFileId.id, name: 'Generic file' },\n\t{ id: audioFileId.id, name: 'Audio file' },\n\t{ id: audioNoCoverFileId.id, name: 'Audio no cover file' },\n\t{ id: videoFileId.id, name: 'Video file' },\n\t{ id: gifFileId.id, name: 'Gif file' },\n\t{ id: videoProcessingFailedId.id, name: 'Video processing failed' },\n\t{ id: errorFileId.id, name: 'Error file' },\n\t{ id: docFileId.id, name: 'Doc file' },\n\t{ id: largePdfFileId.id, name: 'Large pdf file' },\n\t{ id: archiveFileId.id, name: 'Archive file' },\n\t{ id: unknownFileId.id, name: 'Unknown file' },\n\t{ id: noMetadataFileId.id, name: 'No metadata file' },\n\t{ id: emptyImageFileId.id, name: 'Empty image file' },\n];\nclass Example extends Component<ComponentProps, ComponentState> {\n\tuploadController?: UploadController;\n\tstate: ComponentState = {\n\t\tfileIds,\n\t};\n\trenderCards() {\n\t\tconst { fileIds } = this.state;\n\t\tconst cards = fileIds.map(({ id, name }) => {\n\t\t\tconst identifier: FileIdentifier = {\n\t\t\t\tid,\n\t\t\t\tmediaItemType: 'file',\n\t\t\t\tcollectionName: defaultCollectionName,\n\t\t\t};\n\t\t\treturn (\n\t\t\t\t<div css={cardWrapperStyles} key={id}>\n\t\t\t\t\t<div>\n\t\t\t\t\t\t<h3>{name}</h3>\n\t\t\t\t\t\t<Card\n\t\t\t\t\t\t\tmediaClientConfig={mediaClientConfig}\n\t\t\t\t\t\t\tidentifier={identifier}\n\t\t\t\t\t\t\tshouldEnableDownloadButton\n\t\t\t\t\t\t\tshouldOpenMediaViewer\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t);\n\t\t});\n\t\treturn <div>{cards}</div>;\n\t}\n\tcancelUpload = () => {\n\t\tif (this.uploadController) {\n\t\t\tthis.uploadController.abort();\n\t\t}\n\t};\n\tuploadFile = async (event: SyntheticEvent<HTMLInputElement>) => {\n\t\tif (!event.currentTarget.files || !event.currentTarget.files.length) {\n\t\t\treturn;\n\t\t}\n\t\tconst file = event.currentTarget.files[0];\n\t\tconst uplodableFile = {\n\t\t\tcontent: file,\n\t\t\tname: file.name,\n\t\t\tcollection: defaultCollectionName,\n\t\t\tmimeType: file.type,\n\t\t};\n\t\tconst uploadController = new UploadController();\n\t\tconst stream = mediaClient.file.upload(uplodableFile, uploadController);\n\t\tthis.uploadController = uploadController;\n\t\tthis.addStream(stream);\n\t};\n\taddStream = (stream: MediaSubscribable) => {\n\t\tlet isIdSaved = false;\n\t\tconst subscription = stream.subscribe({\n\t\t\tnext: (state) => {\n\t\t\t\tconst { fileIds } = this.state;\n\t\t\t\tif (!isIdSaved && state.status === 'uploading') {\n\t\t\t\t\tisIdSaved = true;\n\t\t\t\t\tthis.setState({\n\t\t\t\t\t\tfileIds: [{ id: state.id }, ...fileIds],\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tif (state.status === 'processing') {\n\t\t\t\t\t// here we have the public id, AKA upload is finished\n\t\t\t\t\tconsole.log('public id', state.id);\n\t\t\t\t\tsubscription.unsubscribe();\n\t\t\t\t}\n\t\t\t},\n\t\t\tcomplete() {\n\t\t\t\tconsole.log('stream complete');\n\t\t\t},\n\t\t\terror(error) {\n\t\t\t\tconsole.log('stream error', error);\n\t\t\t},\n\t\t});\n\t};\n\trender() {\n\t\treturn (\n\t\t\t<React.Fragment>\n\t\t\t\t{\n\t\t\t\t<div css={cardFlowHeaderStyles}>\n\t\t\t\t\tUpload file <input type=\"file\" onChange={this.uploadFile} />\n\t\t\t\t\t<Button appearance=\"primary\" onClick={this.cancelUpload}>\n\t\t\t\t\t\tCancel upload\n\t\t\t\t\t</Button>\n\t\t\t\t</div>\n\t\t\t\t{this.renderCards()}\n\t\t\t</React.Fragment>\n\t\t);\n\t}\n}\nexport default (): React.JSX.Element => (\n\t<MainWrapper>\n\t\t<Example />\n\t</MainWrapper>\n);\n// We export the example without FFs dropdown for SSR test:\n// packages/media/media-card/src/__tests__/unit/server-side-hydrate.tsx\nexport const SSR = (): React.JSX.Element => <Example />;"],
|
|
1681
|
+
props: [{
|
|
1682
|
+
name: 'actions',
|
|
1683
|
+
type: 'CardAction[]'
|
|
1684
|
+
}, {
|
|
1685
|
+
name: 'alt',
|
|
1686
|
+
type: 'string'
|
|
1687
|
+
}, {
|
|
1688
|
+
name: 'appearance',
|
|
1689
|
+
type: '"auto" | "image" | "square" | "horizontal"'
|
|
1690
|
+
}, {
|
|
1691
|
+
name: 'backgroundColor',
|
|
1692
|
+
type: 'Globals | DataType.Color'
|
|
1693
|
+
}, {
|
|
1694
|
+
name: 'contextId',
|
|
1695
|
+
type: 'string',
|
|
1696
|
+
description: 'Retrieve auth based on a given context.'
|
|
1697
|
+
}, {
|
|
1698
|
+
name: 'dimensions',
|
|
1699
|
+
type: 'CardDimensions'
|
|
1700
|
+
}, {
|
|
1701
|
+
name: 'disableOverlay',
|
|
1702
|
+
type: 'boolean'
|
|
1703
|
+
}, {
|
|
1704
|
+
name: 'fallbackMediaNameFetcher',
|
|
1705
|
+
type: '(id: string) => Promise<string>',
|
|
1706
|
+
description: 'Optional fallback fetcher to retrieve the media filename from another service.\nWorkaround for #hot-301450 where media service is missing filenames for DC -> Cloud migrated media.\nReceives the file ID and should resolve to the filename string.'
|
|
1707
|
+
}, {
|
|
1708
|
+
name: 'featureFlags',
|
|
1709
|
+
type: 'MediaFeatureFlags'
|
|
1710
|
+
}, {
|
|
1711
|
+
name: 'identifier',
|
|
1712
|
+
type: 'FileIdentifier | ExternalImageIdentifier',
|
|
1713
|
+
description: 'Instance of file identifier.',
|
|
1714
|
+
isRequired: true
|
|
1715
|
+
}, {
|
|
1716
|
+
name: 'includeHashForDuplicateFiles',
|
|
1717
|
+
type: 'boolean',
|
|
1718
|
+
description: 'Sets options for viewer *'
|
|
1719
|
+
}, {
|
|
1720
|
+
name: 'isAIGenerating',
|
|
1721
|
+
type: 'boolean'
|
|
1722
|
+
}, {
|
|
1723
|
+
name: 'isLazy',
|
|
1724
|
+
type: 'boolean',
|
|
1725
|
+
description: 'Lazy loads the media file.'
|
|
1726
|
+
}, {
|
|
1727
|
+
name: 'mediaClientConfig',
|
|
1728
|
+
type: 'MediaClientConfig',
|
|
1729
|
+
isRequired: true
|
|
1730
|
+
}, {
|
|
1731
|
+
name: 'mediaSettings',
|
|
1732
|
+
type: '{ canUpdateVideoCaptions?: boolean; }',
|
|
1733
|
+
description: 'General Media Settings'
|
|
1734
|
+
}, {
|
|
1735
|
+
name: 'mediaViewerExtensions',
|
|
1736
|
+
type: 'MediaViewerExtensions',
|
|
1737
|
+
description: 'Extensions for the media viewer (e.g. comment button in header).'
|
|
1738
|
+
}, {
|
|
1739
|
+
name: 'mediaViewerItems',
|
|
1740
|
+
type: 'Identifier[]',
|
|
1741
|
+
description: 'Media file list to display in Media Viewer.'
|
|
1742
|
+
}, {
|
|
1743
|
+
name: 'onClick',
|
|
1744
|
+
type: 'CardOnClickCallback'
|
|
1745
|
+
}, {
|
|
1746
|
+
name: 'onError',
|
|
1747
|
+
type: '(reason: "upload" | "metadata-fetch" | "error-file-state" | "failed-processing" | "remote-preview-fetch" | "remote-preview-not-ready" | "remote-preview-fetch-ssr" | "local-preview-get" | ... 20 more ... | "download") => void',
|
|
1748
|
+
description: 'General Error handling include status errors and display errors'
|
|
1749
|
+
}, {
|
|
1750
|
+
name: 'onFullscreenChange',
|
|
1751
|
+
type: '(fullscreen: boolean) => void',
|
|
1752
|
+
description: 'Callback function to be called when video enters and exit fullscreen.\n`fullscreen = true` indicates video enters fullscreen\n`fullscreen = false` indicates video exits fullscreen'
|
|
1753
|
+
}, {
|
|
1754
|
+
name: 'onMouseEnter',
|
|
1755
|
+
type: '(result: CardEvent) => void'
|
|
1756
|
+
}, {
|
|
1757
|
+
name: 'onPreviewRender',
|
|
1758
|
+
type: '(fileId: string) => void'
|
|
1759
|
+
}, {
|
|
1760
|
+
name: 'originalDimensions',
|
|
1761
|
+
type: 'NumericalCardDimensions'
|
|
1762
|
+
}, {
|
|
1763
|
+
name: 'resizeMode',
|
|
1764
|
+
type: '"crop" | "fit" | "full-fit" | "stretchy-fit"'
|
|
1765
|
+
}, {
|
|
1766
|
+
name: 'selectable',
|
|
1767
|
+
type: 'boolean'
|
|
1768
|
+
}, {
|
|
1769
|
+
name: 'selected',
|
|
1770
|
+
type: 'boolean'
|
|
1771
|
+
}, {
|
|
1772
|
+
name: 'shouldEnableDownloadButton',
|
|
1773
|
+
type: 'boolean',
|
|
1774
|
+
description: 'Enables the download button for media file.'
|
|
1775
|
+
}, {
|
|
1776
|
+
name: 'shouldHideTooltip',
|
|
1777
|
+
type: 'boolean',
|
|
1778
|
+
description: 'Disable tooltip for the card'
|
|
1779
|
+
}, {
|
|
1780
|
+
name: 'shouldOpenMediaViewer',
|
|
1781
|
+
type: 'boolean',
|
|
1782
|
+
description: 'Uses media MediaViewer to preview the media file.'
|
|
1783
|
+
}, {
|
|
1784
|
+
name: 'ssr',
|
|
1785
|
+
type: '"client" | "server"',
|
|
1786
|
+
description: 'Server-Side-Rendering modes are "server" and "client"'
|
|
1787
|
+
}, {
|
|
1788
|
+
name: 'ssrFileState',
|
|
1789
|
+
type: 'UploadingFileState | ProcessingFileState | ProcessedFileState | ErrorFileState | ProcessingFailedState',
|
|
1790
|
+
description: "Pre-hydrated SSR metadata from a Relay fragment.\nWhen provided and `fg('platform_media_ssr_data_seed')` is on, the card seeds\n`useFileState` with this data and skips the `items()` API call for files\nwhose `processingStatus` is `succeeded`.\n@see https://product-fabric.atlassian.net/browse/BMPT-7914"
|
|
1791
|
+
}, {
|
|
1792
|
+
name: 'titleBoxBgColor',
|
|
1793
|
+
type: 'string'
|
|
1794
|
+
}, {
|
|
1795
|
+
name: 'titleBoxIcon',
|
|
1796
|
+
type: 'string'
|
|
1797
|
+
}, {
|
|
1798
|
+
name: 'useInlinePlayer',
|
|
1799
|
+
type: 'boolean',
|
|
1800
|
+
description: 'Uses the inline player for media file.'
|
|
1801
|
+
}, {
|
|
1802
|
+
name: 'videoControlsWrapperRef',
|
|
1803
|
+
type: '((instance: HTMLDivElement) => void) | React.RefObject<HTMLDivElement>'
|
|
1804
|
+
}, {
|
|
1805
|
+
name: 'viewerOptions',
|
|
1806
|
+
type: 'ViewerOptionsProps'
|
|
1807
|
+
}]
|
|
1808
|
+
}, {
|
|
1809
|
+
name: 'Browser',
|
|
1810
|
+
package: '@atlaskit/media-picker',
|
|
1811
|
+
description: 'A component that triggers the native browser file dialog.',
|
|
1812
|
+
status: 'general-availability',
|
|
1813
|
+
usageGuidelines: ['Use `Browser` to allow users to select files from their computer.'],
|
|
1814
|
+
keywords: ['media', 'picker', 'upload', 'browser'],
|
|
1815
|
+
category: 'media',
|
|
1816
|
+
examples: ["import { Component } from 'react';\nimport {\n\tdefaultCollectionName,\n\tdefaultMediaPickerCollectionName,\n\tmediaPickerAuthProvider,\n} from '@atlaskit/media-test-helpers';\nimport Button from '@atlaskit/button/new';\nimport DropdownMenu, { DropdownItem } from '@atlaskit/dropdown-menu';\nimport {\n\tMainWrapper,\n\tUploadPreviews,\n\ttype AuthEnvironment,\n\tPopupHeader,\n\tPopupContainer,\n} from '../example-helpers';\nimport { type UploadParams, type BrowserConfig } from '../src/types';\nimport { Browser } from '../src/';\nimport { type FileState, MediaClient } from '@atlaskit/media-client';\nimport { type MediaClientConfig } from '@atlaskit/media-core';\nexport interface BrowserWrapperState {\n\tcollectionName: string;\n\tauthEnvironment: AuthEnvironment;\n\tmediaClient?: MediaClient;\n\tbrowseConfig?: BrowserConfig;\n}\nclass BrowserWrapper extends Component<{}, BrowserWrapperState> {\n\tdropzoneContainer?: HTMLDivElement;\n\tprivate browseFn: Function = () => {};\n\tstate: BrowserWrapperState = {\n\t\tauthEnvironment: 'client',\n\t\tcollectionName: defaultMediaPickerCollectionName,\n\t};\n\tcomponentDidMount() {\n\t\tconst mediaClientConfig: MediaClientConfig = {\n\t\t\tauthProvider: mediaPickerAuthProvider(),\n\t\t};\n\t\tconst uploadParams: UploadParams = {\n\t\t\tcollection: this.state.collectionName,\n\t\t};\n\t\tconst browseConfig: BrowserConfig = {\n\t\t\tmultiple: true,\n\t\t\tfileExtensions: ['image/jpeg', 'image/png', 'video/mp4'],\n\t\t\tuploadParams,\n\t\t};\n\t\tconst mediaClient = new MediaClient(mediaClientConfig);\n\t\tmediaClient.on('file-added', this.onFileAdded);\n\t\tthis.setState({\n\t\t\tmediaClient,\n\t\t\tbrowseConfig,\n\t\t});\n\t}\n\tonFileAdded = (fileState: FileState) => {\n\t\tconsole.log('onFileAdded', fileState);\n\t};\n\tonOpen = () => {\n\t\tif (this.browseFn) {\n\t\t\tthis.browseFn();\n\t\t}\n\t};\n\tonCollectionChange = (\n\t\te: React.MouseEvent<Element, MouseEvent> | React.KeyboardEvent<Element>,\n\t) => {\n\t\tif (!(e.currentTarget instanceof HTMLElement)) {\n\t\t\treturn;\n\t\t}\n\t\tconst { innerText: collectionName } = e.currentTarget;\n\t\tconst { browseConfig } = this.state;\n\t\tif (!browseConfig) {\n\t\t\treturn;\n\t\t}\n\t\tconst uploadParams: UploadParams = {\n\t\t\tcollection: collectionName,\n\t\t};\n\t\tthis.setState({\n\t\t\tcollectionName,\n\t\t\tbrowseConfig: {\n\t\t\t\t...browseConfig,\n\t\t\t\tuploadParams,\n\t\t\t},\n\t\t});\n\t};\n\tonAuthTypeChange = (e: React.MouseEvent<Element, MouseEvent> | React.KeyboardEvent<Element>) => {\n\t\tif (!(e.currentTarget instanceof HTMLElement)) {\n\t\t\treturn;\n\t\t}\n\t\tconst { innerText: authEnvironment } = e.currentTarget;\n\t\tthis.setState({ authEnvironment: authEnvironment as AuthEnvironment });\n\t};\n\tonBrowseFn = (browse: () => void) => {\n\t\tthis.browseFn = browse;\n\t};\n\trender() {\n\t\tconst { collectionName, authEnvironment, mediaClient, browseConfig } = this.state;\n\t\tif (!browseConfig || !mediaClient) {\n\t\t\treturn null;\n\t\t}\n\t\treturn (\n\t\t\t<MainWrapper>\n\t\t\t\t<PopupContainer>\n\t\t\t\t\t<PopupHeader>\n\t\t\t\t\t\t<Button appearance=\"primary\" onClick={this.onOpen}>\n\t\t\t\t\t\t\tOpen\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t<DropdownMenu trigger={collectionName} shouldRenderToParent>\n\t\t\t\t\t\t\t<DropdownItem onClick={this.onCollectionChange}>\n\t\t\t\t\t\t\t\t{defaultMediaPickerCollectionName}\n\t\t\t\t\t\t\t</DropdownItem>\n\t\t\t\t\t\t\t<DropdownItem onClick={this.onCollectionChange}>{defaultCollectionName}</DropdownItem>\n\t\t\t\t\t\t</DropdownMenu>\n\t\t\t\t\t\t<DropdownMenu trigger={authEnvironment} shouldRenderToParent>\n\t\t\t\t\t\t\t<DropdownItem onClick={this.onAuthTypeChange}>client</DropdownItem>\n\t\t\t\t\t\t\t<DropdownItem onClick={this.onAuthTypeChange}>asap</DropdownItem>\n\t\t\t\t\t\t</DropdownMenu>\n\t\t\t\t\t</PopupHeader>\n\t\t\t\t\t<UploadPreviews>\n\t\t\t\t\t\t{({ onUploadsStart, onError, onPreviewUpdate }) => (\n\t\t\t\t\t\t\t<Browser\n\t\t\t\t\t\t\t\tonBrowseFn={this.onBrowseFn}\n\t\t\t\t\t\t\t\tmediaClientConfig={mediaClient.config}\n\t\t\t\t\t\t\t\tconfig={browseConfig}\n\t\t\t\t\t\t\t\tonUploadsStart={onUploadsStart}\n\t\t\t\t\t\t\t\tonError={onError}\n\t\t\t\t\t\t\t\tonPreviewUpdate={onPreviewUpdate}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</UploadPreviews>\n\t\t\t\t</PopupContainer>\n\t\t\t</MainWrapper>\n\t\t);\n\t}\n}\nexport default (): React.JSX.Element => <BrowserWrapper />;"],
|
|
1817
|
+
props: [{
|
|
1818
|
+
name: 'children',
|
|
1819
|
+
type: '(browse: () => void) => ReactChild'
|
|
1820
|
+
}, {
|
|
1821
|
+
name: 'config',
|
|
1822
|
+
type: 'BrowserConfig'
|
|
1823
|
+
}, {
|
|
1824
|
+
name: 'featureFlags',
|
|
1825
|
+
type: 'MediaFeatureFlags'
|
|
1826
|
+
}, {
|
|
1827
|
+
name: 'isOpen',
|
|
1828
|
+
type: 'boolean',
|
|
1829
|
+
description: 'when true, the dialog will show when the component is rendered\n(NOTE: without this value, no dialog will appear unless you use the **onBrowserFn** hook)'
|
|
1830
|
+
}, {
|
|
1831
|
+
name: 'mediaClientConfig',
|
|
1832
|
+
type: 'MediaClientConfig',
|
|
1833
|
+
isRequired: true
|
|
1834
|
+
}, {
|
|
1835
|
+
name: 'onBrowseFn',
|
|
1836
|
+
type: '(browse: () => void) => void',
|
|
1837
|
+
description: 'This prop will be mainly used for those contexts (like Editor) where there is no react lifecylce and we cannot rerender easily.\nOtherwise, isOpen prop is preferred.'
|
|
1838
|
+
}, {
|
|
1839
|
+
name: 'onCancelFn',
|
|
1840
|
+
type: '(cancel: (uniqueIdentifier: string) => void) => void'
|
|
1841
|
+
}, {
|
|
1842
|
+
name: 'onClose',
|
|
1843
|
+
type: '() => void'
|
|
1844
|
+
}, {
|
|
1845
|
+
name: 'onEnd',
|
|
1846
|
+
type: '(payload: UploadEndEventPayload) => void'
|
|
1847
|
+
}, {
|
|
1848
|
+
name: 'onError',
|
|
1849
|
+
type: '(payload: UploadErrorEventPayload) => void'
|
|
1850
|
+
}, {
|
|
1851
|
+
name: 'onPreviewUpdate',
|
|
1852
|
+
type: '(payload: UploadPreviewUpdateEventPayload) => void'
|
|
1853
|
+
}, {
|
|
1854
|
+
name: 'onUploadsStart',
|
|
1855
|
+
type: '(payload: UploadsStartEventPayload) => void'
|
|
1856
|
+
}]
|
|
1857
|
+
}, {
|
|
1858
|
+
name: 'Dropzone',
|
|
1859
|
+
package: '@atlaskit/media-picker',
|
|
1860
|
+
description: 'A component that provides a drag-and-drop area for file uploads.',
|
|
1861
|
+
status: 'general-availability',
|
|
1862
|
+
usageGuidelines: ['Use `Dropzone` to allow users to upload files by dragging them onto a specific area.'],
|
|
1863
|
+
keywords: ['media', 'picker', 'upload', 'dropzone'],
|
|
1864
|
+
category: 'media',
|
|
1865
|
+
examples: ["import { Component } from 'react';\nimport {\n\tdefaultMediaPickerCollectionName,\n\tcreateUploadMediaClientConfig,\n\tcreateStorybookMediaClientConfig,\n\tfakeMediaClient,\n} from '@atlaskit/media-test-helpers';\nimport Button from '@atlaskit/button/new';\nimport Toggle from '@atlaskit/toggle';\nimport Spinner from '@atlaskit/spinner';\nimport { type FileState } from '@atlaskit/media-client';\nimport {\n\tMainWrapper,\n\tUploadPreviews,\n\tDropzoneContainer,\n\tPopupHeader,\n\tPopupContainer,\n\tDropzoneContentWrapper,\n\tDropzoneItemsInfo,\n} from '../example-helpers';\nimport { Dropzone } from '../src';\nimport { type DropzoneConfig, type UploadsStartEventPayload } from '../src/types';\nexport interface DropzoneWrapperState {\n\tisConnectedToUsersCollection: boolean;\n\tisActive: boolean;\n\tisFetchingLastItems: boolean;\n\tlastItems: any[];\n\tdropzoneContainer?: HTMLElement;\n\tfileIds: string[];\n}\nconst mediaClientConfig = createUploadMediaClientConfig();\nconst nonUserMediaClientConfig = createStorybookMediaClientConfig({\n\tauthType: 'asap',\n});\nclass DropzoneWrapper extends Component<{}, DropzoneWrapperState> {\n\tdropzoneContainer?: HTMLDivElement;\n\tstate: DropzoneWrapperState = {\n\t\tisConnectedToUsersCollection: true,\n\t\tisActive: true,\n\t\tisFetchingLastItems: true,\n\t\tlastItems: [],\n\t\tfileIds: [],\n\t};\n\tonUploadsStart = (payload: UploadsStartEventPayload) => {\n\t\tconst fileIds = payload.files.map(({ id }) => id);\n\t\tthis.setState({ fileIds });\n\t};\n\trenderDragZone = () => {\n\t\tconst { isConnectedToUsersCollection, isActive, dropzoneContainer } = this.state;\n\t\tif (!isActive || !dropzoneContainer) {\n\t\t\treturn null;\n\t\t}\n\t\tconst dropzoneMediaClient = isConnectedToUsersCollection\n\t\t\t? fakeMediaClient(mediaClientConfig)\n\t\t\t: fakeMediaClient(nonUserMediaClientConfig);\n\t\tdropzoneMediaClient.on('file-added', this.onFileUploaded);\n\t\tconst config: DropzoneConfig = {\n\t\t\tcontainer: this.state.dropzoneContainer,\n\t\t\tuploadParams: {\n\t\t\t\tcollection: defaultMediaPickerCollectionName,\n\t\t\t},\n\t\t};\n\t\treturn (\n\t\t\t<UploadPreviews>\n\t\t\t\t{({ onUploadsStart, onError, onPreviewUpdate }) => (\n\t\t\t\t\t<Dropzone\n\t\t\t\t\t\tmediaClientConfig={dropzoneMediaClient.config}\n\t\t\t\t\t\tconfig={config}\n\t\t\t\t\t\tonUploadsStart={(payload) => {\n\t\t\t\t\t\t\tthis.onUploadsStart(payload);\n\t\t\t\t\t\t\tonUploadsStart(payload);\n\t\t\t\t\t\t}}\n\t\t\t\t\t\tonError={onError}\n\t\t\t\t\t\tonPreviewUpdate={onPreviewUpdate}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t</UploadPreviews>\n\t\t);\n\t};\n\tonFileUploaded = (fileState: FileState) => {\n\t\tconsole.log('onFileUploaded', fileState);\n\t};\n\tsaveDropzoneContainer = async (element: HTMLDivElement) => {\n\t\tthis.setState({ dropzoneContainer: element });\n\t};\n\tonConnectionChange = () => {\n\t\tconst isConnectedToUsersCollection = !this.state.isConnectedToUsersCollection;\n\t\tthis.setState({ isConnectedToUsersCollection });\n\t};\n\tonActiveChange = () => {\n\t\tconst { isActive } = this.state;\n\t\tthis.setState({ isActive: !isActive });\n\t};\n\trenderLastItems = () => {\n\t\tconst { isFetchingLastItems, lastItems } = this.state;\n\t\tif (isFetchingLastItems) {\n\t\t\treturn <Spinner size=\"large\" />;\n\t\t}\n\t\treturn lastItems.map((item, key) => {\n\t\t\tconst { id, details } = item;\n\t\t\t// details are not always present in the response\n\t\t\tconst name = details ? details.name : '<no-details>';\n\t\t\tconst mediaType = details ? details.mediaType : '<no-details>';\n\t\t\treturn (\n\t\t\t\t<div key={key}>\n\t\t\t\t\t{id} | {name} |{mediaType}\n\t\t\t\t</div>\n\t\t\t);\n\t\t});\n\t};\n\trender() {\n\t\tconst { isConnectedToUsersCollection, isActive } = this.state;\n\t\treturn (\n\t\t\t<MainWrapper>\n\t\t\t\t<PopupContainer>\n\t\t\t\t\t<PopupHeader>\n\t\t\t\t\t\t<Button appearance=\"danger\">Cancel uploads</Button>\n\t\t\t\t\t\tConnected to users collection\n\t\t\t\t\t\t<Toggle\n\t\t\t\t\t\t\tdefaultChecked={isConnectedToUsersCollection}\n\t\t\t\t\t\t\tonChange={this.onConnectionChange}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\tActive\n\t\t\t\t\t\t<Toggle defaultChecked={isActive} onChange={this.onActiveChange} />\n\t\t\t\t\t</PopupHeader>\n\t\t\t\t\t<DropzoneContentWrapper>\n\t\t\t\t\t\t<DropzoneContainer isActive={isActive} ref={this.saveDropzoneContainer} />\n\t\t\t\t\t\t<DropzoneItemsInfo>\n\t\t\t\t\t\t\t{this.renderDragZone()}\n\t\t\t\t\t\t\t<h1>User collection items</h1>\n\t\t\t\t\t\t\t{this.renderLastItems()}\n\t\t\t\t\t\t</DropzoneItemsInfo>\n\t\t\t\t\t</DropzoneContentWrapper>\n\t\t\t\t</PopupContainer>\n\t\t\t</MainWrapper>\n\t\t);\n\t}\n}\nexport default (): React.JSX.Element => <DropzoneWrapper />;"],
|
|
1866
|
+
props: [{
|
|
1867
|
+
name: 'config',
|
|
1868
|
+
type: 'LocalUploadConfig & DropzoneConfig',
|
|
1869
|
+
description: '',
|
|
1870
|
+
isRequired: true
|
|
1871
|
+
}, {
|
|
1872
|
+
name: 'featureFlags',
|
|
1873
|
+
type: 'MediaFeatureFlags'
|
|
1874
|
+
}, {
|
|
1875
|
+
name: 'mediaClientConfig',
|
|
1876
|
+
type: 'MediaClientConfig',
|
|
1877
|
+
isRequired: true
|
|
1878
|
+
}, {
|
|
1879
|
+
name: 'onCancelFn',
|
|
1880
|
+
type: '(cancel: (uniqueIdentifier: string) => void) => void'
|
|
1881
|
+
}, {
|
|
1882
|
+
name: 'onDragEnter',
|
|
1883
|
+
type: '(payload: DropzoneDragEnterEventPayload) => void'
|
|
1884
|
+
}, {
|
|
1885
|
+
name: 'onDragLeave',
|
|
1886
|
+
type: '(payload: DropzoneDragLeaveEventPayload) => void'
|
|
1887
|
+
}, {
|
|
1888
|
+
name: 'onDrop',
|
|
1889
|
+
type: '() => void'
|
|
1890
|
+
}, {
|
|
1891
|
+
name: 'onEnd',
|
|
1892
|
+
type: '(payload: UploadEndEventPayload) => void'
|
|
1893
|
+
}, {
|
|
1894
|
+
name: 'onError',
|
|
1895
|
+
type: '(payload: UploadErrorEventPayload) => void'
|
|
1896
|
+
}, {
|
|
1897
|
+
name: 'onPreviewUpdate',
|
|
1898
|
+
type: '(payload: UploadPreviewUpdateEventPayload) => void'
|
|
1899
|
+
}, {
|
|
1900
|
+
name: 'onUploadsStart',
|
|
1901
|
+
type: '(payload: UploadsStartEventPayload) => void'
|
|
1902
|
+
}]
|
|
1903
|
+
}, {
|
|
1904
|
+
name: 'Mention',
|
|
1905
|
+
package: '@atlaskit/mention',
|
|
1906
|
+
description: 'A component for displaying a single mention.',
|
|
1907
|
+
status: 'general-availability',
|
|
1908
|
+
usageGuidelines: ['Use `Mention` to render a mention for a user or team.'],
|
|
1909
|
+
keywords: ['mention', 'user', 'team'],
|
|
1910
|
+
category: 'elements',
|
|
1911
|
+
examples: ["import type UIAnalyticsEvent from '@atlaskit/analytics-next/UIAnalyticsEvent';\nimport AnalyticsListener from '@atlaskit/analytics-next/AnalyticsListener';\nimport { onMentionEvent } from '../example-helpers/index';\nimport Mention from '../src/components/Mention';\nimport { ELEMENTS_CHANNEL } from '../src/_constants';\nimport debug from '../src/util/logger';\nimport { mockMentionData as mentionData } from '../src/__tests__/unit/_test-helpers';\nimport {\n\tMENTION_ID_HIGHLIGHTED,\n\tMENTION_ID_WITH_CONTAINER_ACCESS,\n\tMENTION_ID_WITH_NO_ACCESS,\n} from '../src/__tests__/unit/_test-constants';\nimport { IntlProvider } from 'react-intl';\nconst padding = { padding: '10px' };\nconst listenerHandler = (e: UIAnalyticsEvent) => {\n\tdebug('Analytics Next handler - payload:', e.payload, ' context: ', e.context);\n};\nconst handler = (_mentionId: string, text: string, event?: any, analytics?: any) => {\n\tdebug('Old Analytics handler: ', text, ' ', event, ' - analytics: ', analytics);\n};\nexport default function Example(): React.JSX.Element {\n\treturn (\n\t\t<IntlProvider locale=\"en\">\n\t\t\t<div >\n\t\t\t\t{\n\t\t\t\t<div style={padding}>\n\t\t\t\t\t<AnalyticsListener onEvent={listenerHandler} channel={ELEMENTS_CHANNEL}>\n\t\t\t\t\t\t<Mention\n\t\t\t\t\t\t\t{...mentionData}\n\t\t\t\t\t\t\tid={MENTION_ID_WITH_CONTAINER_ACCESS}\n\t\t\t\t\t\t\taccessLevel={'CONTAINER'}\n\t\t\t\t\t\t\tonClick={handler}\n\t\t\t\t\t\t\tonMouseEnter={onMentionEvent}\n\t\t\t\t\t\t\tonMouseLeave={onMentionEvent}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</AnalyticsListener>\n\t\t\t\t</div>\n\t\t\t\t{\n\t\t\t\t<div style={padding}>\n\t\t\t\t\t<Mention\n\t\t\t\t\t\t{...mentionData}\n\t\t\t\t\t\tid={MENTION_ID_HIGHLIGHTED}\n\t\t\t\t\t\tisHighlighted={true}\n\t\t\t\t\t\tonClick={onMentionEvent}\n\t\t\t\t\t\tonMouseEnter={onMentionEvent}\n\t\t\t\t\t\tonMouseLeave={onMentionEvent}\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t\t{\n\t\t\t\t<div style={padding}>\n\t\t\t\t\t<Mention\n\t\t\t\t\t\t{...mentionData}\n\t\t\t\t\t\tid={MENTION_ID_WITH_NO_ACCESS}\n\t\t\t\t\t\taccessLevel={'NONE'}\n\t\t\t\t\t\tonClick={onMentionEvent}\n\t\t\t\t\t\tonMouseEnter={onMentionEvent}\n\t\t\t\t\t\tonMouseLeave={onMentionEvent}\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t\t{\n\t\t\t\t<div style={padding}>\n\t\t\t\t\t<Mention\n\t\t\t\t\t\t{...mentionData}\n\t\t\t\t\t\ttext=\"\"\n\t\t\t\t\t\tonClick={onMentionEvent}\n\t\t\t\t\t\tonMouseEnter={onMentionEvent}\n\t\t\t\t\t\tonMouseLeave={onMentionEvent}\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t\t{/* Disabled variant (with tooltip). The chip is automatically kept tab-focusable\n\t\t\t\t and gets aria-disabled + aria-label by the component itself. */}\n\t\t\t\t{\n\t\t\t\t<div style={padding}>\n\t\t\t\t\t<Mention\n\t\t\t\t\t\t{...mentionData}\n\t\t\t\t\t\tisDisabled\n\t\t\t\t\t\tdisabledTooltip=\"Only one agent can be active at a time\"\n\t\t\t\t\t\tonClick={onMentionEvent}\n\t\t\t\t\t\tonMouseEnter={onMentionEvent}\n\t\t\t\t\t\tonMouseLeave={onMentionEvent}\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t\t{/* Disabled variant without a tooltip — chip is still in the DISABLED visual state\n\t\t\t\t but has no on-hover affordance. */}\n\t\t\t\t{\n\t\t\t\t<div style={padding}>\n\t\t\t\t\t<Mention\n\t\t\t\t\t\t{...mentionData}\n\t\t\t\t\t\tisDisabled\n\t\t\t\t\t\tonClick={onMentionEvent}\n\t\t\t\t\t\tonMouseEnter={onMentionEvent}\n\t\t\t\t\t\tonMouseLeave={onMentionEvent}\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</IntlProvider>\n\t);\n}"],
|
|
1912
|
+
props: [{
|
|
1913
|
+
name: 'accessLevel',
|
|
1914
|
+
type: 'string'
|
|
1915
|
+
}, {
|
|
1916
|
+
name: 'disabledTooltip',
|
|
1917
|
+
type: 'string',
|
|
1918
|
+
description: 'Tooltip text shown on hover when the chip is disabled. Ignored when\n`isDisabled` is false. When omitted, no tooltip is rendered even if\n`isDisabled` is true.'
|
|
1919
|
+
}, {
|
|
1920
|
+
name: 'id',
|
|
1921
|
+
type: 'string',
|
|
1922
|
+
isRequired: true
|
|
1923
|
+
}, {
|
|
1924
|
+
name: 'isDisabled',
|
|
1925
|
+
type: 'boolean',
|
|
1926
|
+
description: 'When true, the mention chip is rendered in its disabled visual state\n(`MentionType.DISABLED`) and click handlers are not invoked. Takes\nprecedence over `isHighlighted` and the restricted state.'
|
|
1927
|
+
}, {
|
|
1928
|
+
name: 'isHighlighted',
|
|
1929
|
+
type: 'boolean'
|
|
1930
|
+
}, {
|
|
1931
|
+
name: 'localId',
|
|
1932
|
+
type: 'string'
|
|
1933
|
+
}, {
|
|
1934
|
+
name: 'onClick',
|
|
1935
|
+
type: '(mentionId: string, text: string, event?: SyntheticEvent<HTMLSpanElement, Event>) => void'
|
|
1936
|
+
}, {
|
|
1937
|
+
name: 'onHover',
|
|
1938
|
+
type: '() => void'
|
|
1939
|
+
}, {
|
|
1940
|
+
name: 'onMouseEnter',
|
|
1941
|
+
type: '(mentionId: string, text: string, event?: SyntheticEvent<HTMLSpanElement, Event>) => void'
|
|
1942
|
+
}, {
|
|
1943
|
+
name: 'onMouseLeave',
|
|
1944
|
+
type: '(mentionId: string, text: string, event?: SyntheticEvent<HTMLSpanElement, Event>) => void'
|
|
1945
|
+
}, {
|
|
1946
|
+
name: 'ssrPlaceholderId',
|
|
1947
|
+
type: 'string'
|
|
1948
|
+
}, {
|
|
1949
|
+
name: 'text',
|
|
1950
|
+
type: 'string',
|
|
1951
|
+
isRequired: true
|
|
1952
|
+
}]
|
|
1953
|
+
}, {
|
|
1954
|
+
name: 'MentionPicker',
|
|
1955
|
+
package: '@atlaskit/mention',
|
|
1956
|
+
description: 'A component that provides a searchable picker for mentions.',
|
|
1957
|
+
status: 'general-availability',
|
|
1958
|
+
usageGuidelines: ['Use `MentionPicker` to allow users to select a user or team to mention.', 'Requires a `MentionResource` to fetch and manage mention data.'],
|
|
1959
|
+
keywords: ['mention', 'picker', 'select'],
|
|
1960
|
+
category: 'elements',
|
|
1961
|
+
examples: ["import MentionTextInput from '../example-helpers/demo-mention-text-input';\nimport { onSelection, resourceProvider, MockPresenceResource } from '../example-helpers';\nexport default function Example(): React.JSX.Element {\n\treturn (\n\t\t<MentionTextInput\n\t\t\tlabel=\"User search\"\n\t\t\tonSelection={onSelection}\n\t\t\tresourceProvider={resourceProvider}\n\t\t\tpresenceProvider={new MockPresenceResource()}\n\t\t/>\n\t);\n}"],
|
|
1962
|
+
props: [{
|
|
1963
|
+
name: 'forwardedRef',
|
|
1964
|
+
type: '((instance: any) => void) | RefObject<any>'
|
|
1965
|
+
}, {
|
|
1966
|
+
name: 'offsetX',
|
|
1967
|
+
type: 'number'
|
|
1968
|
+
}, {
|
|
1969
|
+
name: 'offsetY',
|
|
1970
|
+
type: 'number'
|
|
1971
|
+
}, {
|
|
1972
|
+
name: 'onClose',
|
|
1973
|
+
type: 'OnClose'
|
|
1974
|
+
}, {
|
|
1975
|
+
name: 'onOpen',
|
|
1976
|
+
type: 'OnOpen'
|
|
1977
|
+
}, {
|
|
1978
|
+
name: 'onSelection',
|
|
1979
|
+
type: 'OnMentionEvent'
|
|
1980
|
+
}, {
|
|
1981
|
+
name: 'position',
|
|
1982
|
+
type: '"above" | "below" | "auto"'
|
|
1983
|
+
}, {
|
|
1984
|
+
name: 'presenceProvider',
|
|
1985
|
+
type: 'PresenceProvider'
|
|
1986
|
+
}, {
|
|
1987
|
+
name: 'query',
|
|
1988
|
+
type: 'string'
|
|
1989
|
+
}, {
|
|
1990
|
+
name: 'resourceProvider',
|
|
1991
|
+
type: 'MentionProvider',
|
|
1992
|
+
isRequired: true
|
|
1993
|
+
}, {
|
|
1994
|
+
name: 'target',
|
|
1995
|
+
type: 'string'
|
|
1996
|
+
}, {
|
|
1997
|
+
name: 'zIndex',
|
|
1998
|
+
type: 'string | number'
|
|
1999
|
+
}]
|
|
2000
|
+
}, {
|
|
2001
|
+
name: 'TopNav',
|
|
2002
|
+
package: '@atlaskit/navigation-system',
|
|
2003
|
+
description: 'The horizontal top navigation bar component.',
|
|
2004
|
+
status: 'general-availability',
|
|
2005
|
+
usageGuidelines: ['Render `TopNav` within the `Root` component to provide global navigation and actions.'],
|
|
2006
|
+
keywords: ['navigation', 'top-nav', 'header'],
|
|
2007
|
+
category: 'navigation',
|
|
2008
|
+
examples: ["/**\n * @jsxRuntime classic\n * @jsx jsx\n */\nimport { jsx } from '@compiled/react';\nimport AKBadge from '@atlaskit/badge';\nimport { cssMap } from '@atlaskit/css';\nimport AtlassianIntelligenceIcon from '@atlaskit/icon/core/atlassian-intelligence';\nimport SearchIcon from '@atlaskit/icon/core/search';\nimport { ConfluenceIcon } from '@atlaskit/logo';\nimport { Root } from '@atlaskit/navigation-system/layout/root';\nimport { SideNavToggleButton } from '@atlaskit/navigation-system/layout/side-nav';\nimport {\n\tTopNav,\n\tTopNavEnd,\n\tTopNavMiddle,\n\tTopNavStart,\n} from '@atlaskit/navigation-system/layout/top-nav';\nimport {\n\tAppLogo,\n\tAppSwitcher,\n\tChatButton,\n\tCreateButton,\n\tEndItem,\n\tHelp,\n\tProfile,\n\tSearch,\n\tSettings,\n} from '@atlaskit/navigation-system/top-nav-items';\nimport { Notifications } from '@atlaskit/navigation-system/top-nav-items/notifications';\nimport { Flex } from '@atlaskit/primitives/compiled';\nimport { token } from '@atlaskit/tokens';\nimport { WithResponsiveViewport } from './utils/example-utils';\nimport { MockSearch } from './utils/mock-search';\nconst iconSpacingStyles = cssMap({\n\tspace050: {\n\t\tpaddingBlock: token('space.050'),\n\t\tpaddingInline: token('space.050'),\n\t},\n});\nconst Badge = () => <AKBadge appearance=\"important\">{5}</AKBadge>;\nexport const TopNavigationExample: () => JSX.Element = () => (\n\t<WithResponsiveViewport>\n\t\t{/**\n\t\t * Wrapping in `Root to ensure the TopNav height is set correctly, as it would in a proper composed usage.\n\t\t * Root sets the top bar height CSS variable that TopNav uses to set its height\n\t\t */}\n\t\t<Root>\n\t\t\t<TopNav>\n\t\t\t\t<TopNavStart\n\t\t\t\t\tsideNavToggleButton={\n\t\t\t\t\t\t<SideNavToggleButton collapseLabel=\"Collapse sidebar\" expandLabel=\"Expand sidebar\" />\n\t\t\t\t\t}\n\t\t\t\t>\n\t\t\t\t\t<AppSwitcher label=\"App switcher\" onClick={() => alert('app switcher')} />\n\t\t\t\t\t<AppLogo\n\t\t\t\t\t\thref=\"http://www.atlassian.design\"\n\t\t\t\t\t\ticon={ConfluenceIcon}\n\t\t\t\t\t\tname=\"Confluence\"\n\t\t\t\t\t\tlabel=\"Home page\"\n\t\t\t\t\t/>\n\t\t\t\t</TopNavStart>\n\t\t\t\t<TopNavMiddle>\n\t\t\t\t\t<Search onClick={() => alert('mobile search')} label=\"Search\" />\n\t\t\t\t\t<CreateButton onClick={() => alert('create')}>Create</CreateButton>\n\t\t\t\t</TopNavMiddle>\n\t\t\t\t<TopNavEnd>\n\t\t\t\t\t<ChatButton onClick={() => alert('chat')}>Chat</ChatButton>\n\t\t\t\t\t<EndItem\n\t\t\t\t\t\ticon={AtlassianIntelligenceIcon}\n\t\t\t\t\t\tonClick={() => alert('inshelligence')}\n\t\t\t\t\t\tlabel=\"Atlassian Intelligence\"\n\t\t\t\t\t/>\n\t\t\t\t\t<Help onClick={() => alert('help')} label=\"Help\" />\n\t\t\t\t\t<Notifications\n\t\t\t\t\t\tbadge={Badge}\n\t\t\t\t\t\tonClick={() => alert('notifications')}\n\t\t\t\t\t\tlabel=\"Notifications\"\n\t\t\t\t\t/>\n\t\t\t\t\t<Settings onClick={() => alert('settings')} label=\"Settings\" />\n\t\t\t\t\t<Profile onClick={() => alert('User settings')} label=\"Your profile\" />\n\t\t\t\t</TopNavEnd>\n\t\t\t</TopNav>\n\t\t</Root>\n\t</WithResponsiveViewport>\n);\nexport const SearchRightElem: () => JSX.Element = () => (\n\t<WithResponsiveViewport>\n\t\t<Root>\n\t\t\t<TopNav>\n\t\t\t\t<TopNavStart sideNavToggleButton={null}>\n\t\t\t\t\t<AppSwitcher label=\"App switcher\" onClick={() => alert('app switcher')} />\n\t\t\t\t</TopNavStart>\n\t\t\t\t<TopNavMiddle>\n\t\t\t\t\t<Search\n\t\t\t\t\t\ticonBefore={AtlassianIntelligenceIcon}\n\t\t\t\t\t\telemAfter={\n\t\t\t\t\t\t\t<Flex xcss={iconSpacingStyles.space050}>\n\t\t\t\t\t\t\t\t<SearchIcon color={token('color.icon')} label=\"\" />\n\t\t\t\t\t\t\t</Flex>\n\t\t\t\t\t\t}\n\t\t\t\t\t\tonClick={() => alert('mobile search')}\n\t\t\t\t\t\tlabel=\"Search\"\n\t\t\t\t\t/>\n\t\t\t\t\t<CreateButton onClick={() => alert('create')}>Create</CreateButton>\n\t\t\t\t</TopNavMiddle>\n\t\t\t\t<TopNavEnd>\n\t\t\t\t\t<Settings onClick={() => alert('settings')} label=\"Settings\" />\n\t\t\t\t</TopNavEnd>\n\t\t\t</TopNav>\n\t\t</Root>\n\t</WithResponsiveViewport>\n);\nexport const TopNavigationEnlargedSearchInput: () => JSX.Element = () => (\n\t<WithResponsiveViewport>\n\t\t<Root>\n\t\t\t<TopNav>\n\t\t\t\t<TopNavStart sideNavToggleButton={null}>\n\t\t\t\t\t<AppSwitcher label=\"App switcher\" onClick={() => alert('app switcher')} />\n\t\t\t\t</TopNavStart>\n\t\t\t\t<div>\n\t\t\t\t\t<TopNavMiddle>\n\t\t\t\t\t\t<MockSearch isEnlarged />\n\t\t\t\t\t\t<CreateButton onClick={() => alert('create')}>Create</CreateButton>\n\t\t\t\t\t</TopNavMiddle>\n\t\t\t\t</div>\n\t\t\t\t<TopNavEnd>\n\t\t\t\t\t<Settings onClick={() => alert('settings')} label=\"Settings\" />\n\t\t\t\t</TopNavEnd>\n\t\t\t</TopNav>\n\t\t</Root>\n\t</WithResponsiveViewport>\n);\nexport default TopNavigationExample;"],
|
|
2009
|
+
props: [{
|
|
2010
|
+
name: 'children',
|
|
2011
|
+
type: 'string | number | boolean | React.ReactElement<any, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | React.ReactPortal',
|
|
2012
|
+
description: 'The content of the layout area.\nShould include `TopNavStart`, `TopNavMiddle`, and `TopNavEnd`.',
|
|
2013
|
+
isRequired: true
|
|
2014
|
+
}, {
|
|
2015
|
+
name: 'customTheme',
|
|
2016
|
+
type: '{ backgroundColor: string | RGB; highlightColor: string | RGB; }',
|
|
2017
|
+
description: 'Custom theme for the top navigation. This is a port of Nav 3 functionality, and not recommended for new usage,\nas it does not align with our future vision.'
|
|
2018
|
+
}, {
|
|
2019
|
+
name: 'height',
|
|
2020
|
+
type: 'number',
|
|
2021
|
+
description: 'Not intended for long term use. This is added to support the migration to the new page layout.\nWe may replace this prop in a future release.'
|
|
2022
|
+
}, {
|
|
2023
|
+
name: 'id',
|
|
2024
|
+
type: 'string',
|
|
2025
|
+
description: "The `id` attribute of the slot. Used to connect the layout slot's skip link to the layout element.\nIf not provided, a unique ID will be generated."
|
|
2026
|
+
}, {
|
|
2027
|
+
name: 'skipLinkLabel',
|
|
2028
|
+
type: 'string',
|
|
2029
|
+
description: "The label for this slot's skip link. Defaults to the slot's `label` value."
|
|
2030
|
+
}, {
|
|
2031
|
+
name: 'xcss',
|
|
2032
|
+
type: 'false | (XCSSValue<"backgroundColor", DesignTokenStyles, ""> & {} & XCSSPseudo<"backgroundColor", never, never, DesignTokenStyles> & XCSSMediaQuery<...> & { ...; } & { ...; })',
|
|
2033
|
+
description: 'Bounded style overrides.'
|
|
2034
|
+
}]
|
|
2035
|
+
}, {
|
|
2036
|
+
name: 'ProfileCard',
|
|
2037
|
+
package: '@atlaskit/profilecard',
|
|
2038
|
+
description: 'A component for displaying user information in a card.',
|
|
2039
|
+
status: 'general-availability',
|
|
2040
|
+
usageGuidelines: ['Use `ProfileCard` to show user details like name, avatar, and contact info.'],
|
|
2041
|
+
keywords: ['profile', 'user', 'card'],
|
|
2042
|
+
category: 'people-and-teams',
|
|
2043
|
+
examples: ["import { ProfileCard } from '../src';\nimport { profiles } from '../src/mocks';\nimport { reportingLinesData } from '../src/mocks/reporting-lines-data';\nimport ExampleWrapper from './helper/example-wrapper';\nimport { MainStage } from './helper/main-stage';\nconst avatarImage = profiles[4].User.avatarUrl;\nexport default function Example(): React.JSX.Element {\n\treturn (\n\t\t<ExampleWrapper>\n\t\t\t<MainStage>\n\t\t\t\t<ProfileCard\n\t\t\t\t\tavatarUrl={avatarImage}\n\t\t\t\t\tfullName=\"Rosalyn Franklin\"\n\t\t\t\t\tmeta=\"Manager\"\n\t\t\t\t\tnickname=\"rfranklin\"\n\t\t\t\t\temail=\"rfranklin@acme.com\"\n\t\t\t\t\ttimestring=\"18:45\"\n\t\t\t\t\tlocation=\"Somewhere, World\"\n\t\t\t\t\tactions={[\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: 'View profile',\n\t\t\t\t\t\t\tid: 'view-profile',\n\t\t\t\t\t\t\tcallback: () => {},\n\t\t\t\t\t\t},\n\t\t\t\t\t]}\n\t\t\t\t\treportingLines={reportingLinesData}\n\t\t\t\t\treportingLinesProfileUrl=\"/\"\n\t\t\t\t\tonReportingLinesClick={(user) => {\n\t\t\t\t\t\tconsole.log('Clicked on ' + user.pii?.name);\n\t\t\t\t\t}}\n\t\t\t\t/>\n\t\t\t</MainStage>\n\t\t</ExampleWrapper>\n\t);\n}"],
|
|
2044
|
+
props: [{
|
|
2045
|
+
name: 'accountType',
|
|
2046
|
+
type: 'string'
|
|
2047
|
+
}, {
|
|
2048
|
+
name: 'actions',
|
|
2049
|
+
type: 'ProfileCardAction[]'
|
|
2050
|
+
}, {
|
|
2051
|
+
name: 'addFlag',
|
|
2052
|
+
type: '(flag: any) => void'
|
|
2053
|
+
}, {
|
|
2054
|
+
name: 'agentActions',
|
|
2055
|
+
type: 'AgentActionsType'
|
|
2056
|
+
}, {
|
|
2057
|
+
name: 'avatarUrl',
|
|
2058
|
+
type: 'string'
|
|
2059
|
+
}, {
|
|
2060
|
+
name: 'clientFetchProfile',
|
|
2061
|
+
type: '() => void'
|
|
2062
|
+
}, {
|
|
2063
|
+
name: 'cloudId',
|
|
2064
|
+
type: 'string'
|
|
2065
|
+
}, {
|
|
2066
|
+
name: 'companyName',
|
|
2067
|
+
type: 'string'
|
|
2068
|
+
}, {
|
|
2069
|
+
name: 'customLozenges',
|
|
2070
|
+
type: 'LozengeProps[]'
|
|
2071
|
+
}, {
|
|
2072
|
+
name: 'disabledAccountMessage',
|
|
2073
|
+
type: 'string | number | boolean | React.ReactElement<any, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | React.ReactPortal'
|
|
2074
|
+
}, {
|
|
2075
|
+
name: 'disabledAriaAttributes',
|
|
2076
|
+
type: 'boolean'
|
|
2077
|
+
}, {
|
|
2078
|
+
name: 'email',
|
|
2079
|
+
type: 'string'
|
|
2080
|
+
}, {
|
|
2081
|
+
name: 'errorType',
|
|
2082
|
+
type: '{ reason: "default" | "NotFound"; }'
|
|
2083
|
+
}, {
|
|
2084
|
+
name: 'fireEvent',
|
|
2085
|
+
type: '<K extends keyof AnalyticsEventAttributes>(params_0: K, ...params_1: OptionalIfUndefined<AnalyticsEventAttributes[K]>) => void'
|
|
2086
|
+
}, {
|
|
2087
|
+
name: 'fullName',
|
|
2088
|
+
type: 'string'
|
|
2089
|
+
}, {
|
|
2090
|
+
name: 'hasDisabledAccountLozenge',
|
|
2091
|
+
type: 'boolean'
|
|
2092
|
+
}, {
|
|
2093
|
+
name: 'hasError',
|
|
2094
|
+
type: 'boolean'
|
|
2095
|
+
}, {
|
|
2096
|
+
name: 'hideAgentConversationStarters',
|
|
2097
|
+
type: 'boolean',
|
|
2098
|
+
description: 'When true (and feature-gated), hide the agent conversation starters section'
|
|
2099
|
+
}, {
|
|
2100
|
+
name: 'isBot',
|
|
2101
|
+
type: 'boolean'
|
|
2102
|
+
}, {
|
|
2103
|
+
name: 'isCurrentUser',
|
|
2104
|
+
type: 'boolean'
|
|
2105
|
+
}, {
|
|
2106
|
+
name: 'isKudosEnabled',
|
|
2107
|
+
type: 'boolean'
|
|
2108
|
+
}, {
|
|
2109
|
+
name: 'isLoading',
|
|
2110
|
+
type: 'boolean'
|
|
2111
|
+
}, {
|
|
2112
|
+
name: 'isRenderedInPortal',
|
|
2113
|
+
type: 'boolean',
|
|
2114
|
+
description: "Indicates whether the profile card is rendered in a portal.\n\nIf true, the profile card will auto-focus the name element when opened for better accessibility,\nkeeping the user's focus in the tab trap."
|
|
2115
|
+
}, {
|
|
2116
|
+
name: 'isServiceAccount',
|
|
2117
|
+
type: 'boolean'
|
|
2118
|
+
}, {
|
|
2119
|
+
name: 'isTriggeredUsingKeyboard',
|
|
2120
|
+
type: 'boolean'
|
|
2121
|
+
}, {
|
|
2122
|
+
name: 'location',
|
|
2123
|
+
type: 'string'
|
|
2124
|
+
}, {
|
|
2125
|
+
name: 'meta',
|
|
2126
|
+
type: 'string'
|
|
2127
|
+
}, {
|
|
2128
|
+
name: 'nickname',
|
|
2129
|
+
type: 'string'
|
|
2130
|
+
}, {
|
|
2131
|
+
name: 'onReportingLinesClick',
|
|
2132
|
+
type: '(user: ReportingLinesUser) => false | void',
|
|
2133
|
+
description: "Click handler when user clicks on manager's and direct reports' user avatar, un-clickable otherwise.\nReturning false will prevent the default behavior of opening the reporting lines page."
|
|
2134
|
+
}, {
|
|
2135
|
+
name: 'openKudosDrawer',
|
|
2136
|
+
type: '() => void'
|
|
2137
|
+
}, {
|
|
2138
|
+
name: 'reportingLines',
|
|
2139
|
+
type: 'TeamCentralReportingLinesData',
|
|
2140
|
+
description: 'Show manager and direct reports section on profile hover card, if available'
|
|
2141
|
+
}, {
|
|
2142
|
+
name: 'reportingLinesProfileUrl',
|
|
2143
|
+
type: 'string',
|
|
2144
|
+
description: "Base URL to populate href value for manager's and direct reports' user avatar"
|
|
2145
|
+
}, {
|
|
2146
|
+
name: 'status',
|
|
2147
|
+
type: '"active" | "inactive" | "closed"'
|
|
2148
|
+
}, {
|
|
2149
|
+
name: 'statusModifiedDate',
|
|
2150
|
+
type: 'number'
|
|
2151
|
+
}, {
|
|
2152
|
+
name: 'teamCentralBaseUrl',
|
|
2153
|
+
type: 'string'
|
|
2154
|
+
}, {
|
|
2155
|
+
name: 'timestring',
|
|
2156
|
+
type: 'string'
|
|
2157
|
+
}, {
|
|
2158
|
+
name: 'userId',
|
|
2159
|
+
type: 'string'
|
|
2160
|
+
}, {
|
|
2161
|
+
name: 'withoutElevation',
|
|
2162
|
+
type: 'boolean'
|
|
2163
|
+
}]
|
|
2164
|
+
}, {
|
|
2165
|
+
name: 'ProfileCardTrigger',
|
|
2166
|
+
package: '@atlaskit/profilecard',
|
|
2167
|
+
description: 'A component that triggers a profile card on hover or click.',
|
|
2168
|
+
status: 'general-availability',
|
|
2169
|
+
usageGuidelines: ['Use `ProfileCardTrigger` to wrap an element (like an avatar) that should show a profile card.'],
|
|
2170
|
+
keywords: ['profile', 'trigger', 'hover'],
|
|
2171
|
+
category: 'people-and-teams',
|
|
2172
|
+
examples: ["import React, { useState } from 'react';\n// Simulating import from '@atlaskit/profilecard/user'\nimport ProfileCardTrigger from '../src/components/User';\nimport { BlankSpace } from './helper/blank-space';\nimport ExampleWrapper from './helper/example-wrapper';\nimport { MainStage } from './helper/main-stage';\nimport { Section } from './helper/section';\nimport { getMockProfileClient } from './helper/util';\nconst mockClient = getMockProfileClient(10, 0);\nconst mockClientForInactiveAccount = getMockProfileClient(10, 0, {\n\tstatus: 'inactive',\n});\nconst mockClientForClosedAccountAndCustomMessage = getMockProfileClient(10, 0, {\n\tstatus: 'closed',\n\tdisabledAccountMessage:\n\t\t'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo.',\n\thasDisabledAccountLozenge: false,\n});\nconst defaultProps = {\n\tcloudId: 'DUMMY-10ae0bf3-157e-43f7-be45-f1bb13b39048',\n\tresourceClient: mockClient,\n};\nexport default function Example(): React.JSX.Element {\n\tconst [clickCount, setCount] = useState(0);\n\tconst [externalPropExampleIsVisible, setExternalPropExampleIsVisible] = useState(false);\n\treturn (\n\t\t<ExampleWrapper>\n\t\t\t<MainStage>\n\t\t\t\t<Section>\n\t\t\t\t\t<h4>Profilecard triggered by hover</h4>\n\t\t\t\t\t<p>\n\t\t\t\t\t\tInput for testing with focus <input type=\"text\" />\n\t\t\t\t\t</p>\n\t\t\t\t\t<span>\n\t\t\t\t\t\tLorem ipsum{' '}\n\t\t\t\t\t\t<ProfileCardTrigger\n\t\t\t\t\t\t\t{...defaultProps}\n\t\t\t\t\t\t\tuserId=\"1\"\n\t\t\t\t\t\t\tactions={[\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tlabel: 'View profile',\n\t\t\t\t\t\t\t\t\tid: 'view-profile',\n\t\t\t\t\t\t\t\t\tcallback: () => {},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t]}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<strong>hover over me</strong>\n\t\t\t\t\t\t</ProfileCardTrigger>{' '}\n\t\t\t\t\t\tdolor sit amet\n\t\t\t\t\t</span>\n\t\t\t\t</Section>\n\t\t\t\t<Section>\n\t\t\t\t\t<h4>Profilecard triggered by click</h4>\n\t\t\t\t\t<span>\n\t\t\t\t\t\tLorem ipsum{' '}\n\t\t\t\t\t\t<ProfileCardTrigger\n\t\t\t\t\t\t\t{...defaultProps}\n\t\t\t\t\t\t\tuserId=\"1\"\n\t\t\t\t\t\t\ttrigger=\"click\"\n\t\t\t\t\t\t\tactions={[\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tlabel: 'View profile',\n\t\t\t\t\t\t\t\t\tid: 'view-profile',\n\t\t\t\t\t\t\t\t\tcallback: () => {},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t]}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<strong>click me</strong>\n\t\t\t\t\t\t</ProfileCardTrigger>{' '}\n\t\t\t\t\t\tdolor sit amet\n\t\t\t\t\t</span>\n\t\t\t\t</Section>\n\t\t\t\t<Section>\n\t\t\t\t\t<h4>Profilecard triggered by external prop</h4>\n\t\t\t\t\t<span>\n\t\t\t\t\t\tLorem ipsum{' '}\n\t\t\t\t\t\t<ProfileCardTrigger\n\t\t\t\t\t\t\t{...defaultProps}\n\t\t\t\t\t\t\tuserId=\"1\"\n\t\t\t\t\t\t\ttrigger=\"click\"\n\t\t\t\t\t\t\tisVisible={externalPropExampleIsVisible}\n\t\t\t\t\t\t\tactions={[\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tlabel: 'View profile',\n\t\t\t\t\t\t\t\t\tid: 'view-profile',\n\t\t\t\t\t\t\t\t\tcallback: () => {},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t]}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<strong>click me</strong>\n\t\t\t\t\t\t</ProfileCardTrigger>{' '}\n\t\t\t\t\t\tdolor sit amet\n\t\t\t\t\t\t<button\n\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\tonClick={() => setExternalPropExampleIsVisible(!externalPropExampleIsVisible)}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\tToggle external prop\n\t\t\t\t\t\t</button>\n\t\t\t\t\t</span>\n\t\t\t\t</Section>\n\t\t\t\t<Section>\n\t\t\t\t\t<h4>Profilecard triggered for closed account</h4>\n\t\t\t\t\t<span>\n\t\t\t\t\t\tLorem ipsum{' '}\n\t\t\t\t\t\t<ProfileCardTrigger\n\t\t\t\t\t\t\t{...defaultProps}\n\t\t\t\t\t\t\tuserId=\"1\"\n\t\t\t\t\t\t\tresourceClient={getMockProfileClient(10, 0, {\n\t\t\t\t\t\t\t\tstatus: 'closed',\n\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t\ttrigger=\"click\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<strong>click me</strong>\n\t\t\t\t\t\t</ProfileCardTrigger>{' '}\n\t\t\t\t\t\tdolor sit amet\n\t\t\t\t\t</span>\n\t\t\t\t</Section>\n\t\t\t\t<Section>\n\t\t\t\t\t<h4>Profilecard triggered for inactive account</h4>\n\t\t\t\t\t<span>\n\t\t\t\t\t\tLorem ipsum{' '}\n\t\t\t\t\t\t<ProfileCardTrigger\n\t\t\t\t\t\t\t{...defaultProps}\n\t\t\t\t\t\t\tuserId=\"1\"\n\t\t\t\t\t\t\tresourceClient={mockClientForInactiveAccount}\n\t\t\t\t\t\t\ttrigger=\"click\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<strong>click me</strong>\n\t\t\t\t\t\t</ProfileCardTrigger>{' '}\n\t\t\t\t\t\tdolor sit amet\n\t\t\t\t\t</span>\n\t\t\t\t</Section>\n\t\t\t\t<Section>\n\t\t\t\t\t<h4>Profilecard triggered for customer account</h4>\n\t\t\t\t\t<span>\n\t\t\t\t\t\tLorem ipsum{' '}\n\t\t\t\t\t\t<ProfileCardTrigger\n\t\t\t\t\t\t\t{...defaultProps}\n\t\t\t\t\t\t\tuserId=\"3\"\n\t\t\t\t\t\t\tresourceClient={getMockProfileClient(10, 0, {\n\t\t\t\t\t\t\t\taccountType: 'customer',\n\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t\ttrigger=\"click\"\n\t\t\t\t\t\t\tactions={[\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tlabel: 'View profile',\n\t\t\t\t\t\t\t\t\tid: 'view-profile',\n\t\t\t\t\t\t\t\t\tcallback: () => {},\n\t\t\t\t\t\t\t\t\tshouldRender: (data: any) => data && data.accountType !== 'customer',\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t]}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<strong>click me</strong>\n\t\t\t\t\t\t</ProfileCardTrigger>{' '}\n\t\t\t\t\t\tdolor sit amet\n\t\t\t\t\t</span>\n\t\t\t\t</Section>\n\t\t\t\t<Section>\n\t\t\t\t\t<h4>Counting clicks of parent container</h4>\n\t\t\t\t\t{/**\n\t\t\t\t\t * If the user clicks on the trigger then we don't want that click\n\t\t\t\t\t * event to propagate out to parent containers. For example when\n\t\t\t\t\t * clicking a mention lozenge in an inline-edit.\n\t\t\t\t\t *\n\t\t\t\t\t * This example has the parent span counting how many times it was\n\t\t\t\t\t * clicked so we can easily verify that it's not triggered when\n\t\t\t\t\t * clicking the profile card trigger.\n\t\t\t\t\t */}\n\t\t\t\t\t<span\n\t\t\t\t\t\trole=\"presentation\"\n\t\t\t\t\t\ttabIndex={-1}\n\t\t\t\t\t\tonClick={() => setCount((c) => c + 1)}\n\t\t\t\t\t\tonKeyDown={() => setCount((c) => c + 1)}\n\t\t\t\t\t>\n\t\t\t\t\t\tLorem ipsum. Parent clicked {clickCount} times!{' '}\n\t\t\t\t\t\t<ProfileCardTrigger\n\t\t\t\t\t\t\t{...defaultProps}\n\t\t\t\t\t\t\tuserId=\"1\"\n\t\t\t\t\t\t\tresourceClient={mockClientForClosedAccountAndCustomMessage}\n\t\t\t\t\t\t\ttrigger=\"click\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<strong>click me</strong>\n\t\t\t\t\t\t</ProfileCardTrigger>{' '}\n\t\t\t\t\t\tdolor sit amet\n\t\t\t\t\t</span>\n\t\t\t\t</Section>\n\t\t\t\t<Section>\n\t\t\t\t\t<h4>\n\t\t\t\t\t\tProfilecard triggered for closed account and custom message and not show status lozenge\n\t\t\t\t\t</h4>\n\t\t\t\t\t<span>\n\t\t\t\t\t\tLorem ipsum{' '}\n\t\t\t\t\t\t<ProfileCardTrigger\n\t\t\t\t\t\t\t{...defaultProps}\n\t\t\t\t\t\t\tuserId=\"1\"\n\t\t\t\t\t\t\tresourceClient={mockClientForClosedAccountAndCustomMessage}\n\t\t\t\t\t\t\ttrigger=\"click\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<strong>click me</strong>\n\t\t\t\t\t\t</ProfileCardTrigger>{' '}\n\t\t\t\t\t\tdolor sit amet\n\t\t\t\t\t</span>\n\t\t\t\t</Section>\n\t\t\t\t<Section>\n\t\t\t\t\t<h4>Profilecard trigger hidden from screen readers</h4>\n\t\t\t\t\t<span>\n\t\t\t\t\t\tLorem ipsum{' '}\n\t\t\t\t\t\t<ProfileCardTrigger\n\t\t\t\t\t\t\t{...defaultProps}\n\t\t\t\t\t\t\tuserId=\"1\"\n\t\t\t\t\t\t\tactions={[\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tlabel: 'View profile',\n\t\t\t\t\t\t\t\t\tid: 'view-profile',\n\t\t\t\t\t\t\t\t\tcallback: () => {},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t]}\n\t\t\t\t\t\t\tariaHideProfileTrigger\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<strong>hover over me</strong>\n\t\t\t\t\t\t</ProfileCardTrigger>\n\t\t\t\t\t\t{' or '}\n\t\t\t\t\t\t<ProfileCardTrigger\n\t\t\t\t\t\t\t{...defaultProps}\n\t\t\t\t\t\t\tuserId=\"3\"\n\t\t\t\t\t\t\tresourceClient={getMockProfileClient(10, 0, {\n\t\t\t\t\t\t\t\taccountType: 'customer',\n\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t\ttrigger=\"click\"\n\t\t\t\t\t\t\tactions={[\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tlabel: 'View profile',\n\t\t\t\t\t\t\t\t\tid: 'view-profile',\n\t\t\t\t\t\t\t\t\tcallback: () => {},\n\t\t\t\t\t\t\t\t\tshouldRender: (data: any) => data && data.accountType !== 'customer',\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t]}\n\t\t\t\t\t\t\tariaHideProfileTrigger\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<strong>click me</strong>\n\t\t\t\t\t\t</ProfileCardTrigger>{' '}\n\t\t\t\t\t\tdolor sit amet\n\t\t\t\t\t</span>\n\t\t\t\t</Section>\n\t\t\t\t<BlankSpace>Scroll down to test focus behaviour</BlankSpace>\n\t\t\t\t<Section>\n\t\t\t\t\t<ProfileCardTrigger\n\t\t\t\t\t\t{...defaultProps}\n\t\t\t\t\t\tuserId=\"1\"\n\t\t\t\t\t\tactions={[\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlabel: 'View profile',\n\t\t\t\t\t\t\t\tid: 'view-profile',\n\t\t\t\t\t\t\t\tcallback: () => {},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t]}\n\t\t\t\t\t>\n\t\t\t\t\t\t<strong>Hover me.</strong>\n\t\t\t\t\t</ProfileCardTrigger>{' '}\n\t\t\t\t\t|||{' '}\n\t\t\t\t\t<ProfileCardTrigger\n\t\t\t\t\t\t{...defaultProps}\n\t\t\t\t\t\tuserId=\"1\"\n\t\t\t\t\t\ttrigger=\"click\"\n\t\t\t\t\t\tactions={[\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlabel: 'View profile',\n\t\t\t\t\t\t\t\tid: 'view-profile',\n\t\t\t\t\t\t\t\tcallback: () => {},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t]}\n\t\t\t\t\t>\n\t\t\t\t\t\t<strong>Click me.</strong>\n\t\t\t\t\t</ProfileCardTrigger>\n\t\t\t\t</Section>\n\t\t\t</MainStage>\n\t\t</ExampleWrapper>\n\t);\n}"],
|
|
2173
|
+
props: [{
|
|
2174
|
+
name: 'actions',
|
|
2175
|
+
type: 'ProfileCardAction[]',
|
|
2176
|
+
defaultValue: '[]'
|
|
2177
|
+
}, {
|
|
2178
|
+
name: 'addFlag',
|
|
2179
|
+
type: '(flag: any) => void'
|
|
2180
|
+
}, {
|
|
2181
|
+
name: 'agentActions',
|
|
2182
|
+
type: 'AgentActionsType'
|
|
2183
|
+
}, {
|
|
2184
|
+
name: 'ariaHideProfileTrigger',
|
|
2185
|
+
type: 'boolean',
|
|
2186
|
+
defaultValue: 'false'
|
|
2187
|
+
}, {
|
|
2188
|
+
name: 'ariaLabel',
|
|
2189
|
+
type: 'string'
|
|
2190
|
+
}, {
|
|
2191
|
+
name: 'ariaLabelledBy',
|
|
2192
|
+
type: 'string'
|
|
2193
|
+
}, {
|
|
2194
|
+
name: 'autoFocus',
|
|
2195
|
+
type: 'boolean'
|
|
2196
|
+
}, {
|
|
2197
|
+
name: 'children',
|
|
2198
|
+
type: 'string | number | boolean | React.ReactElement<any, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | React.ReactPortal',
|
|
2199
|
+
isRequired: true
|
|
2200
|
+
}, {
|
|
2201
|
+
name: 'cloudId',
|
|
2202
|
+
type: 'string',
|
|
2203
|
+
description: "A cloudId can be provided, and we'll verify that the target userId is an\n\tactual user in the specified site.\n\n\tInstead you can omit the cloudId and we won't do such a check.\n\n\tIf you have a cloudId and only want to show users who are in that site\n\tthen please provide it. If you're a site-less product or don't care about\n\tverifying that the shown user is in a particular site, don't provide a\n\tcloudId."
|
|
2204
|
+
}, {
|
|
2205
|
+
name: 'disabledAriaAttributes',
|
|
2206
|
+
type: 'boolean'
|
|
2207
|
+
}, {
|
|
2208
|
+
name: 'hideAgentConversationStarters',
|
|
2209
|
+
type: 'boolean',
|
|
2210
|
+
description: 'Hide the conversation starters. Defaults to false (conversation starters are shown by default).'
|
|
2211
|
+
}, {
|
|
2212
|
+
name: 'hideAgentMoreActions',
|
|
2213
|
+
type: 'boolean'
|
|
2214
|
+
}, {
|
|
2215
|
+
name: 'hideAiDisclaimer',
|
|
2216
|
+
type: 'boolean'
|
|
2217
|
+
}, {
|
|
2218
|
+
name: 'hideDelay',
|
|
2219
|
+
type: 'number',
|
|
2220
|
+
description: 'The delay in milliseconds before the profile card is hidden.\nPS: This is ignored when the isVisible is false or the trigger is clicked.'
|
|
2221
|
+
}, {
|
|
2222
|
+
name: 'isRenderedInPortal',
|
|
2223
|
+
type: 'boolean',
|
|
2224
|
+
description: "Indicates whether the profile card is rendered in a portal.\n\nIf true, the profile card will auto-focus the name element when opened for better accessibility,\nkeeping the user's focus in the tab trap."
|
|
2225
|
+
}, {
|
|
2226
|
+
name: 'isVisible',
|
|
2227
|
+
type: 'boolean'
|
|
2228
|
+
}, {
|
|
2229
|
+
name: 'offset',
|
|
2230
|
+
type: '[number, number]'
|
|
2231
|
+
}, {
|
|
2232
|
+
name: 'onReportingLinesClick',
|
|
2233
|
+
type: '(user: ReportingLinesUser) => void'
|
|
2234
|
+
}, {
|
|
2235
|
+
name: 'onVisibilityChange',
|
|
2236
|
+
type: '(isVisible: boolean) => void'
|
|
2237
|
+
}, {
|
|
2238
|
+
name: 'position',
|
|
2239
|
+
type: '"bottom-start" | "auto" | "auto-start" | "auto-end" | "bottom" | "bottom-end" | "left-start" | "left" | "left-end" | "top-end" | "top" | "top-start" | "right-end" | "right" | "right-start"',
|
|
2240
|
+
defaultValue: '"bottom-start"'
|
|
2241
|
+
}, {
|
|
2242
|
+
name: 'prepopulatedData',
|
|
2243
|
+
type: 'PrepopulatedData'
|
|
2244
|
+
}, {
|
|
2245
|
+
name: 'product',
|
|
2246
|
+
type: 'string'
|
|
2247
|
+
}, {
|
|
2248
|
+
name: 'reportingLinesProfileUrl',
|
|
2249
|
+
type: 'string'
|
|
2250
|
+
}, {
|
|
2251
|
+
name: 'resourceClient',
|
|
2252
|
+
type: 'ProfileClient',
|
|
2253
|
+
isRequired: true
|
|
2254
|
+
}, {
|
|
2255
|
+
name: 'showDelay',
|
|
2256
|
+
type: 'number',
|
|
2257
|
+
description: 'The delay in milliseconds before the profile card is shown.\nPS: This is ignored when the isVisible is true or the trigger is clicked.'
|
|
2258
|
+
}, {
|
|
2259
|
+
name: 'ssrPlaceholderId',
|
|
2260
|
+
type: 'string'
|
|
2261
|
+
}, {
|
|
2262
|
+
name: 'trigger',
|
|
2263
|
+
type: '"hover" | "click"',
|
|
2264
|
+
defaultValue: '"hover"'
|
|
2265
|
+
}, {
|
|
2266
|
+
name: 'userId',
|
|
2267
|
+
type: 'string',
|
|
2268
|
+
isRequired: true
|
|
2269
|
+
}, {
|
|
2270
|
+
name: 'viewingUserId',
|
|
2271
|
+
type: 'string'
|
|
2272
|
+
}]
|
|
2273
|
+
}, {
|
|
2274
|
+
name: 'ConnectedReactionPicker',
|
|
2275
|
+
package: '@atlaskit/reactions',
|
|
2276
|
+
description: 'A reaction picker component pre-wired with a reactions store.',
|
|
2277
|
+
status: 'general-availability',
|
|
2278
|
+
usageGuidelines: ['Use `ConnectedReactionPicker` to allow users to add reactions to content.', 'Requires a `ReactionsStore` to manage reaction state.'],
|
|
2279
|
+
keywords: ['reactions', 'picker', 'emoji'],
|
|
2280
|
+
category: 'elements',
|
|
2281
|
+
examples: ["import { type EmojiProvider } from '@atlaskit/emoji/resource';\nimport { getEmojiResource } from '@atlaskit/util-data-test/get-emoji-resource';\nimport { ConnectedReactionPicker, ConnectedReactionsView, type StorePropInput } from '../src';\nimport { ExampleWrapper, Example, Constants } from './utils';\nexport default (): React.JSX.Element => {\n\treturn (\n\t\t<ExampleWrapper>\n\t\t\t{(store: StorePropInput) => (\n\t\t\t\t<>\n\t\t\t\t\t<p>\n\t\t\t\t\t\t<strong>Memory store and Connected Picker view (same store)</strong>\n\t\t\t\t\t</p>\n\t\t\t\t\t<hr role=\"presentation\" />\n\t\t\t\t\t<Example\n\t\t\t\t\t\ttitle={'Regular picker view'}\n\t\t\t\t\t\tbody={\n\t\t\t\t\t\t\t<ConnectedReactionPicker\n\t\t\t\t\t\t\t\tstore={store}\n\t\t\t\t\t\t\t\tcontainerAri={`${Constants.ContainerAriPrefix}1`}\n\t\t\t\t\t\t\t\tari={`${Constants.AriPrefix}1`}\n\t\t\t\t\t\t\t\temojiProvider={getEmojiResource() as Promise<EmojiProvider>}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t\t<hr role=\"presentation\" />\n\t\t\t\t\t<Example\n\t\t\t\t\t\ttitle={\n\t\t\t\t\t\t\t'Use picker to add reaction, it will update reactions in a separate ConnectedReactionsView component below.'\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbody={\n\t\t\t\t\t\t\t<ConnectedReactionsView\n\t\t\t\t\t\t\t\tstore={store}\n\t\t\t\t\t\t\t\tcontainerAri={`${Constants.ContainerAriPrefix}1`}\n\t\t\t\t\t\t\t\tari={`${Constants.AriPrefix}1`}\n\t\t\t\t\t\t\t\temojiProvider={getEmojiResource() as Promise<EmojiProvider>}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t</>\n\t\t\t)}\n\t\t</ExampleWrapper>\n\t);\n};"],
|
|
2282
|
+
props: [{
|
|
2283
|
+
name: 'allowAllEmojis',
|
|
2284
|
+
type: 'boolean',
|
|
2285
|
+
description: 'Optional Show the "more emoji" selector icon for choosing emoji beyond the default list of emojis (defaults to false)'
|
|
2286
|
+
}, {
|
|
2287
|
+
name: 'ari',
|
|
2288
|
+
type: 'string',
|
|
2289
|
+
description: 'Individual id for a reaction',
|
|
2290
|
+
isRequired: true
|
|
2291
|
+
}, {
|
|
2292
|
+
name: 'containerAri',
|
|
2293
|
+
type: 'string',
|
|
2294
|
+
description: 'Wrapper id for reactions list',
|
|
2295
|
+
isRequired: true
|
|
2296
|
+
}, {
|
|
2297
|
+
name: 'disabled',
|
|
2298
|
+
type: 'boolean',
|
|
2299
|
+
description: 'Enable/Disable the button to be clickable (defaults to false)'
|
|
2300
|
+
}, {
|
|
2301
|
+
name: 'emojiPickerSize',
|
|
2302
|
+
type: '"small" | "medium" | "large"',
|
|
2303
|
+
description: 'Optional emoji picker size to control the size of emoji picker'
|
|
2304
|
+
}, {
|
|
2305
|
+
name: 'emojiProvider',
|
|
2306
|
+
type: 'Promise<EmojiProvider>',
|
|
2307
|
+
description: 'Provider for loading emojis',
|
|
2308
|
+
isRequired: true
|
|
2309
|
+
}, {
|
|
2310
|
+
name: 'hoverableReactionPicker',
|
|
2311
|
+
type: 'boolean',
|
|
2312
|
+
description: 'Optional prop for hoverable reaction picker'
|
|
2313
|
+
}, {
|
|
2314
|
+
name: 'hoverableReactionPickerDelay',
|
|
2315
|
+
type: 'number',
|
|
2316
|
+
description: 'Optional prop to set a delay for the reaction picker when it opens/closes on hover'
|
|
2317
|
+
}, {
|
|
2318
|
+
name: 'isListItem',
|
|
2319
|
+
type: 'boolean',
|
|
2320
|
+
description: 'Optional prop to say if the reactions component is in a list'
|
|
2321
|
+
}, {
|
|
2322
|
+
name: 'miniMode',
|
|
2323
|
+
type: 'boolean',
|
|
2324
|
+
description: 'apply "miniMode" className to the button'
|
|
2325
|
+
}, {
|
|
2326
|
+
name: 'onCancel',
|
|
2327
|
+
type: '() => void',
|
|
2328
|
+
description: 'Optional event handler when the emoji picker is clicked outside and closed'
|
|
2329
|
+
}, {
|
|
2330
|
+
name: 'onOpen',
|
|
2331
|
+
type: '() => void',
|
|
2332
|
+
description: 'Optional event handler when the emoji picker is opened'
|
|
2333
|
+
}, {
|
|
2334
|
+
name: 'onShowMore',
|
|
2335
|
+
type: '() => void',
|
|
2336
|
+
description: 'Optional event handler when the custom emoji picker icon is selected'
|
|
2337
|
+
}, {
|
|
2338
|
+
name: 'pickerQuickReactionEmojiIds',
|
|
2339
|
+
type: 'EmojiId[]',
|
|
2340
|
+
description: 'Optional emojis shown for user to select from when the reaction add button is clicked (defaults to pre-defined list of emojis {@link DefaultReactions})'
|
|
2341
|
+
}, {
|
|
2342
|
+
name: 'reactionPickerPlacement',
|
|
2343
|
+
type: 'AutoPlacement | BasePlacement | VariationPlacement',
|
|
2344
|
+
description: 'Optional prop for controlling the picker location'
|
|
2345
|
+
}, {
|
|
2346
|
+
name: 'reactionPickerPopperZIndex',
|
|
2347
|
+
type: 'number',
|
|
2348
|
+
description: 'Optional zIndex for the reaction picker popper'
|
|
2349
|
+
}, {
|
|
2350
|
+
name: 'reactionPickerStrategy',
|
|
2351
|
+
type: '"absolute" | "fixed"',
|
|
2352
|
+
description: 'Optional prop to set the strategy of the reaction picker popup'
|
|
2353
|
+
}, {
|
|
2354
|
+
name: 'reactionPickerTriggerIcon',
|
|
2355
|
+
type: 'string | number | boolean | React.ReactElement<any, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | React.ReactPortal',
|
|
2356
|
+
description: 'Optional prop for controlling icon inside Trigger'
|
|
2357
|
+
}, {
|
|
2358
|
+
name: 'reactionPickerTriggerText',
|
|
2359
|
+
type: 'string',
|
|
2360
|
+
description: 'Optional prop for controlling text of the trigger button'
|
|
2361
|
+
}, {
|
|
2362
|
+
name: 'showAddReactionText',
|
|
2363
|
+
type: 'boolean',
|
|
2364
|
+
description: 'Optional prop for displaying text to add a reaction'
|
|
2365
|
+
}, {
|
|
2366
|
+
name: 'showOpaqueBackground',
|
|
2367
|
+
type: 'boolean',
|
|
2368
|
+
description: 'Optional prop for using an opaque button background instead of a transparent background'
|
|
2369
|
+
}, {
|
|
2370
|
+
name: 'store',
|
|
2371
|
+
type: 'Store | Promise<Store>',
|
|
2372
|
+
description: 'Reference to the store.\n@remarks\nThis was initially implemented with a sync and Async versions and will be replaced with just a sync Store in a future release (Please use only the sync version)',
|
|
2373
|
+
isRequired: true
|
|
2374
|
+
}, {
|
|
2375
|
+
name: 'subtleReactionsSummaryAndPicker',
|
|
2376
|
+
type: 'boolean',
|
|
2377
|
+
description: 'Optional prop for applying subtle styling to reaction summary and picker'
|
|
2378
|
+
}, {
|
|
2379
|
+
name: 'tooltipContent',
|
|
2380
|
+
type: 'string | number | boolean | React.ReactElement<any, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | React.ReactPortal',
|
|
2381
|
+
description: 'Tooltip content for trigger button'
|
|
2382
|
+
}]
|
|
2383
|
+
}, {
|
|
2384
|
+
name: 'ConnectedReactionsView',
|
|
2385
|
+
package: '@atlaskit/reactions',
|
|
2386
|
+
description: 'A component for displaying the current reactions on a piece of content.',
|
|
2387
|
+
status: 'general-availability',
|
|
2388
|
+
usageGuidelines: ['Use `ConnectedReactionsView` to show the list of reactions and allow users to toggle their own reactions.'],
|
|
2389
|
+
keywords: ['reactions', 'view', 'display'],
|
|
2390
|
+
category: 'elements',
|
|
2391
|
+
examples: ["import { type EmojiProvider } from '@atlaskit/emoji/resource';\nimport { getEmojiResource } from '@atlaskit/util-data-test/get-emoji-resource';\nimport { ConnectedReactionsView, type StorePropInput } from '../src';\nimport { ExampleWrapper, Example, Constants as ExampleConstants } from './utils';\nimport { DefaultReactions } from '../src/shared/constants';\nexport default (): React.JSX.Element => {\n\treturn (\n\t\t<ExampleWrapper>\n\t\t\t{(store: StorePropInput) => (\n\t\t\t\t<>\n\t\t\t\t\t{/* Example 1 */}\n\t\t\t\t\t<Example\n\t\t\t\t\t\ttitle={\n\t\t\t\t\t\t\t'\"ConnectedReactionsView\" with a built in memory store and different emoji populated and several are selected.'\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbody={\n\t\t\t\t\t\t\t<ConnectedReactionsView\n\t\t\t\t\t\t\t\tstore={store}\n\t\t\t\t\t\t\t\tcontainerAri={`${ExampleConstants.ContainerAriPrefix}1`}\n\t\t\t\t\t\t\t\tari={`${ExampleConstants.AriPrefix}1`}\n\t\t\t\t\t\t\t\temojiProvider={getEmojiResource() as Promise<EmojiProvider>}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t\t<hr role=\"presentation\" />\n\t\t\t\t\t{/* Example 2 */}\n\t\t\t\t\t<Example\n\t\t\t\t\t\ttitle={'\"ConnectedReactionsView\" with miniMode for add reaction button'}\n\t\t\t\t\t\tbody={\n\t\t\t\t\t\t\t<ConnectedReactionsView\n\t\t\t\t\t\t\t\tstore={store}\n\t\t\t\t\t\t\t\tcontainerAri={`${ExampleConstants.ContainerAriPrefix}1`}\n\t\t\t\t\t\t\t\tari={`${ExampleConstants.AriPrefix}1`}\n\t\t\t\t\t\t\t\temojiProvider={getEmojiResource() as Promise<EmojiProvider>}\n\t\t\t\t\t\t\t\tallowAllEmojis\n\t\t\t\t\t\t\t\tminiMode\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t\t<hr role=\"presentation\" />\n\t\t\t\t\t<strong\n\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\tfontSize: '14px',\n\t\t\t\t\t\t\tmarginLeft: '10px',\n\t\t\t\t\t\t\ttextDecoration: 'underline',\n\t\t\t\t\t\t}}\n\t\t\t\t\t>\n\t\t\t\t\t\t\"allowAllEmojis\" prop - Show the \"more emoji\" selector icon for choosing emoji icons\n\t\t\t\t\t\tbeyond the default list of emojis (defaults to DEFAULT_REACTION_EMOJI_IDS)\n\t\t\t\t\t</strong>\n\t\t\t\t\t{/* Example 3 */}\n\t\t\t\t\t<Example\n\t\t\t\t\t\ttitle={\n\t\t\t\t\t\t\t'\"ConnectedReactionsView\" with allowAllEmojis prop set to true (Select custom emojis from the picker instead of just a pre-defined list)'\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbody={\n\t\t\t\t\t\t\t<ConnectedReactionsView\n\t\t\t\t\t\t\t\tstore={store}\n\t\t\t\t\t\t\t\tcontainerAri={`${ExampleConstants.ContainerAriPrefix}1`}\n\t\t\t\t\t\t\t\tari={`${ExampleConstants.AriPrefix}2`}\n\t\t\t\t\t\t\t\temojiProvider={getEmojiResource() as Promise<EmojiProvider>}\n\t\t\t\t\t\t\t\tallowAllEmojis\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t\t{/* Example 4 */}\n\t\t\t\t\t<Example\n\t\t\t\t\t\ttitle={'\"ConnectedReactionsView\" with allowAllEmojis flag set is not provided or false'}\n\t\t\t\t\t\tbody={\n\t\t\t\t\t\t\t<ConnectedReactionsView\n\t\t\t\t\t\t\t\tstore={store}\n\t\t\t\t\t\t\t\tcontainerAri={`${ExampleConstants.ContainerAriPrefix}1`}\n\t\t\t\t\t\t\t\tari={`${ExampleConstants.AriPrefix}3`}\n\t\t\t\t\t\t\t\temojiProvider={getEmojiResource() as Promise<EmojiProvider>}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t\t<hr role=\"presentation\" />\n\t\t\t\t\t<strong\n\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\tfontSize: '14px',\n\t\t\t\t\t\t\tmarginLeft: '10px',\n\t\t\t\t\t\t\ttextDecoration: 'underline',\n\t\t\t\t\t\t}}\n\t\t\t\t\t>\n\t\t\t\t\t\t\"pickerQuickReactionEmojiIds\" prop - emojis shown for user to select from the picker\n\t\t\t\t\t\tpopup when the reaction add button is clicked\n\t\t\t\t\t</strong>\n\t\t\t\t\t{/* Example 5 */}\n\t\t\t\t\t<Example\n\t\t\t\t\t\ttitle={\n\t\t\t\t\t\t\t'\"ConnectedReactionsView\" with non-empty pickerQuickReactionEmojiIds array populated a single item'\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbody={\n\t\t\t\t\t\t\t<ConnectedReactionsView\n\t\t\t\t\t\t\t\tstore={store}\n\t\t\t\t\t\t\t\tcontainerAri={`${ExampleConstants.ContainerAriPrefix}1`}\n\t\t\t\t\t\t\t\tari={`${ExampleConstants.AriPrefix}4`}\n\t\t\t\t\t\t\t\temojiProvider={getEmojiResource() as Promise<EmojiProvider>}\n\t\t\t\t\t\t\t\tallowAllEmojis\n\t\t\t\t\t\t\t\tpickerQuickReactionEmojiIds={[{ id: '1f44d', shortName: ':thumbsup:' }]}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t\t{/* Example 6 */}\n\t\t\t\t\t<Example\n\t\t\t\t\t\ttitle={\n\t\t\t\t\t\t\t'\"ConnectedReactionsView\" with empty pickerQuickReactionEmojiIds array (shows the full picker selector)'\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbody={\n\t\t\t\t\t\t\t<ConnectedReactionsView\n\t\t\t\t\t\t\t\tstore={store}\n\t\t\t\t\t\t\t\tcontainerAri={`${ExampleConstants.ContainerAriPrefix}1`}\n\t\t\t\t\t\t\t\tari={`${ExampleConstants.AriPrefix}5`}\n\t\t\t\t\t\t\t\temojiProvider={getEmojiResource() as Promise<EmojiProvider>}\n\t\t\t\t\t\t\t\tallowAllEmojis\n\t\t\t\t\t\t\t\tpickerQuickReactionEmojiIds={[]}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t\t<hr role=\"presentation\" />\n\t\t\t\t\t<strong\n\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\tfontSize: '14px',\n\t\t\t\t\t\t\tmarginLeft: '10px',\n\t\t\t\t\t\t\ttextDecoration: 'underline',\n\t\t\t\t\t\t}}\n\t\t\t\t\t>\n\t\t\t\t\t\t\"quickReactionEmojis\" prop - emojis that will be shown in the the primary view even if\n\t\t\t\t\t\tthe reaction count is zero and no emojis were created on the post/reply yet\n\t\t\t\t\t</strong>\n\t\t\t\t\t{/* Example 7 */}\n\t\t\t\t\t<Example\n\t\t\t\t\t\ttitle={\n\t\t\t\t\t\t\t'\"ConnectedReactionsView\" with quickReactionEmojis array without any emoji (undefined or empty array) added to the container|ari item'\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbody={\n\t\t\t\t\t\t\t<ConnectedReactionsView\n\t\t\t\t\t\t\t\tstore={store}\n\t\t\t\t\t\t\t\tcontainerAri={`${ExampleConstants.ContainerAriPrefix}1`}\n\t\t\t\t\t\t\t\tari={`${ExampleConstants.AriPrefix}6`}\n\t\t\t\t\t\t\t\temojiProvider={getEmojiResource() as Promise<EmojiProvider>}\n\t\t\t\t\t\t\t\tallowAllEmojis\n\t\t\t\t\t\t\t\tpickerQuickReactionEmojiIds={[]}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t\t{/* Example 8 */}\n\t\t\t\t\t<Example\n\t\t\t\t\t\ttitle={\n\t\t\t\t\t\t\t'\"ConnectedReactionsView\" with quickReactionEmojis array with some quick emoji icons selections to choose'\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbody={\n\t\t\t\t\t\t\t<ConnectedReactionsView\n\t\t\t\t\t\t\t\tstore={store}\n\t\t\t\t\t\t\t\tcontainerAri={`${ExampleConstants.ContainerAriPrefix}1`}\n\t\t\t\t\t\t\t\tari={`${ExampleConstants.AriPrefix}7`}\n\t\t\t\t\t\t\t\temojiProvider={getEmojiResource() as Promise<EmojiProvider>}\n\t\t\t\t\t\t\t\tquickReactionEmojis={{\n\t\t\t\t\t\t\t\t\tari: `${ExampleConstants.AriPrefix}7`,\n\t\t\t\t\t\t\t\t\tcontainerAri: `${ExampleConstants.ContainerAriPrefix}1`,\n\t\t\t\t\t\t\t\t\temojiIds: DefaultReactions.slice(3, 5).map((item) => item.id ?? ''),\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t\t{/* Example 9 */}\n\t\t\t\t\t<Example\n\t\t\t\t\t\ttitle={\n\t\t\t\t\t\t\t'\"ConnectedReactionsView\" with large emoji picker, emojiPickerSize could be small, medium or large (default to medium).'\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbody={\n\t\t\t\t\t\t\t<ConnectedReactionsView\n\t\t\t\t\t\t\t\tstore={store}\n\t\t\t\t\t\t\t\tcontainerAri={`${ExampleConstants.ContainerAriPrefix}1`}\n\t\t\t\t\t\t\t\tari={`${ExampleConstants.AriPrefix}7`}\n\t\t\t\t\t\t\t\temojiProvider={getEmojiResource() as Promise<EmojiProvider>}\n\t\t\t\t\t\t\t\temojiPickerSize=\"large\"\n\t\t\t\t\t\t\t\tallowAllEmojis\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t\t<hr role=\"presentation\" />\n\t\t\t\t\t<strong\n\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\tfontSize: '14px',\n\t\t\t\t\t\t\tmarginLeft: '10px',\n\t\t\t\t\t\t\ttextDecoration: 'underline',\n\t\t\t\t\t\t}}\n\t\t\t\t\t>\n\t\t\t\t\t\t\"allowUserDialog\" prop - enables a link within the reaction tooltip to show a full user\n\t\t\t\t\t\tlist associated with all reactions\n\t\t\t\t\t</strong>\n\t\t\t\t\t{/* Example 10 */}\n\t\t\t\t\t<Example\n\t\t\t\t\t\ttitle={'Connected reactions with reactions dialog enabled'}\n\t\t\t\t\t\tbody={\n\t\t\t\t\t\t\t<ConnectedReactionsView\n\t\t\t\t\t\t\t\tstore={store}\n\t\t\t\t\t\t\t\tcontainerAri={`${ExampleConstants.ContainerAriPrefix}1`}\n\t\t\t\t\t\t\t\tari={`${ExampleConstants.AriPrefix}1`}\n\t\t\t\t\t\t\t\temojiProvider={getEmojiResource() as Promise<EmojiProvider>}\n\t\t\t\t\t\t\t\tallowUserDialog\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t\t<hr role=\"presentation\" />\n\t\t\t\t\t<strong\n\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\tfontSize: '14px',\n\t\t\t\t\t\t\tmarginLeft: '10px',\n\t\t\t\t\t\t\ttextDecoration: 'underline',\n\t\t\t\t\t\t}}\n\t\t\t\t\t>\n\t\t\t\t\t\t\"allowUserDialog\" prop with callbacks - enables a link within the reaction tooltip to\n\t\t\t\t\t\tshow a full user list associated with all reactions with event callbacks shown\n\t\t\t\t\t</strong>\n\t\t\t\t\t{/* Example 11 */}\n\t\t\t\t\t<Example\n\t\t\t\t\t\ttitle={\n\t\t\t\t\t\t\t'Connected reactions with reactions dialog enabled and callbacks shown as alert dialogs'\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbody={\n\t\t\t\t\t\t\t<ConnectedReactionsView\n\t\t\t\t\t\t\t\tstore={store}\n\t\t\t\t\t\t\t\tcontainerAri={`${ExampleConstants.ContainerAriPrefix}1`}\n\t\t\t\t\t\t\t\tari={`${ExampleConstants.AriPrefix}1`}\n\t\t\t\t\t\t\t\temojiProvider={getEmojiResource() as Promise<EmojiProvider>}\n\t\t\t\t\t\t\t\tallowUserDialog\n\t\t\t\t\t\t\t\tonDialogCloseCallback={(e, event) => {\n\t\t\t\t\t\t\t\t\talert(`onDialogCloseCallback event`);\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\tonDialogOpenCallback={(emojiId, source) => {\n\t\t\t\t\t\t\t\t\talert(`onDialogOpenCallback event with emojiId = ${emojiId}, source = ${source}`);\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\tonDialogSelectReactionCallback={(emojiId: string) => {\n\t\t\t\t\t\t\t\t\talert(`onDialogSelectReactionCallback event with emojiId = ${emojiId}`);\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t\t<hr role=\"presentation\" />\n\t\t\t\t\t{/* Example 11 */}\n\t\t\t\t\t<Example\n\t\t\t\t\t\ttitle={\n\t\t\t\t\t\t\t'\"ConnectedReactionsView\" with a built in memory store and particle emojis enabled.'\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbody={\n\t\t\t\t\t\t\t<ConnectedReactionsView\n\t\t\t\t\t\t\t\tstore={store}\n\t\t\t\t\t\t\t\tcontainerAri={`${ExampleConstants.ContainerAriPrefix}1`}\n\t\t\t\t\t\t\t\tari={`${ExampleConstants.AriPrefix}1`}\n\t\t\t\t\t\t\t\temojiProvider={getEmojiResource() as Promise<EmojiProvider>}\n\t\t\t\t\t\t\t\tparticleEffectByEmojiEnabled\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t\t{/* Example 12 */}\n\t\t\t\t\t<Example\n\t\t\t\t\t\ttitle={'\"ConnectedReactionsView\" with isViewOnly'}\n\t\t\t\t\t\tbody={\n\t\t\t\t\t\t\t<ConnectedReactionsView\n\t\t\t\t\t\t\t\tstore={store}\n\t\t\t\t\t\t\t\tcontainerAri={`${ExampleConstants.ContainerAriPrefix}1`}\n\t\t\t\t\t\t\t\tari={`${ExampleConstants.AriPrefix}1`}\n\t\t\t\t\t\t\t\temojiProvider={getEmojiResource() as Promise<EmojiProvider>}\n\t\t\t\t\t\t\t\tisViewOnly\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t</>\n\t\t\t)}\n\t\t</ExampleWrapper>\n\t);\n};"],
|
|
2392
|
+
props: [{
|
|
2393
|
+
name: 'allowAllEmojis',
|
|
2394
|
+
type: 'boolean',
|
|
2395
|
+
description: 'Optional Show the "more emoji" selector icon for choosing emoji beyond the default list of emojis (defaults to false)'
|
|
2396
|
+
}, {
|
|
2397
|
+
name: 'allowSelectFromSummaryView',
|
|
2398
|
+
type: 'boolean',
|
|
2399
|
+
description: 'Optional prop for controlling if we can select emojis and display UI via summary view picker'
|
|
2400
|
+
}, {
|
|
2401
|
+
name: 'allowUserDialog',
|
|
2402
|
+
type: 'boolean',
|
|
2403
|
+
description: 'Optional prop from checking a feature gate for rendering Reactions Dialog'
|
|
2404
|
+
}, {
|
|
2405
|
+
name: 'ari',
|
|
2406
|
+
type: 'string',
|
|
2407
|
+
description: 'Individual id for a reaction',
|
|
2408
|
+
isRequired: true
|
|
2409
|
+
}, {
|
|
2410
|
+
name: 'containerAri',
|
|
2411
|
+
type: 'string',
|
|
2412
|
+
description: 'Wrapper id for reactions list',
|
|
2413
|
+
isRequired: true
|
|
2414
|
+
}, {
|
|
2415
|
+
name: 'emojiPickerSize',
|
|
2416
|
+
type: '"small" | "medium" | "large"',
|
|
2417
|
+
description: 'Optional emoji picker size to control the size of emoji picker'
|
|
2418
|
+
}, {
|
|
2419
|
+
name: 'emojiProvider',
|
|
2420
|
+
type: 'Promise<EmojiProvider>',
|
|
2421
|
+
description: 'Provider for loading emojis',
|
|
2422
|
+
isRequired: true
|
|
2423
|
+
}, {
|
|
2424
|
+
name: 'isViewOnly',
|
|
2425
|
+
type: 'boolean',
|
|
2426
|
+
description: 'Optional prop for controlling if the reactions component is view only, disabling adding reactions'
|
|
2427
|
+
}, {
|
|
2428
|
+
name: 'miniMode',
|
|
2429
|
+
type: 'boolean',
|
|
2430
|
+
description: 'apply "miniMode" className to the button'
|
|
2431
|
+
}, {
|
|
2432
|
+
name: 'onDialogCloseCallback',
|
|
2433
|
+
type: '(e: KeyboardOrMouseEvent, analyticEvent: UIAnalyticsEvent) => void',
|
|
2434
|
+
description: 'Optional callback function called when closing reactions dialog'
|
|
2435
|
+
}, {
|
|
2436
|
+
name: 'onDialogOpenCallback',
|
|
2437
|
+
type: '(emojiId: string, source?: string) => void',
|
|
2438
|
+
description: 'Optional callback function called when opening reactions dialog'
|
|
2439
|
+
}, {
|
|
2440
|
+
name: 'onDialogSelectReactionCallback',
|
|
2441
|
+
type: '(emojiId: string) => void',
|
|
2442
|
+
description: 'Optional callback function called when selecting a reaction in reactions dialog'
|
|
2443
|
+
}, {
|
|
2444
|
+
name: 'onlyRenderPicker',
|
|
2445
|
+
type: 'boolean',
|
|
2446
|
+
description: 'Optional prop to hide the user reactions and only render the picker'
|
|
2447
|
+
}, {
|
|
2448
|
+
name: 'onReactionSuccess',
|
|
2449
|
+
type: '(action: ReactionUpdateType, ari: string, emojiId: string, count: number) => void',
|
|
2450
|
+
description: 'Callback function when a reaction is successfully added'
|
|
2451
|
+
}, {
|
|
2452
|
+
name: 'particleEffectByEmojiEnabled',
|
|
2453
|
+
type: 'boolean',
|
|
2454
|
+
description: 'Optional boolean to control if particle animation on reactions appear'
|
|
2455
|
+
}, {
|
|
2456
|
+
name: 'pickerQuickReactionEmojiIds',
|
|
2457
|
+
type: 'EmojiId[]',
|
|
2458
|
+
description: 'Optional emojis shown for user to select from when the reaction add button is clicked (defaults to pre-defined list of emojis {@link DefaultReactions})'
|
|
2459
|
+
}, {
|
|
2460
|
+
name: 'quickReactionEmojis',
|
|
2461
|
+
type: 'QuickReactionEmojiSummary',
|
|
2462
|
+
description: 'quickReactionEmojiIds are emojis that will be shown in the the primary view even if the reaction count is zero'
|
|
2463
|
+
}, {
|
|
2464
|
+
name: 'reactionPickerPopperZIndex',
|
|
2465
|
+
type: 'number',
|
|
2466
|
+
description: 'Optional zIndex for the reaction picker popper'
|
|
2467
|
+
}, {
|
|
2468
|
+
name: 'store',
|
|
2469
|
+
type: 'Store | Promise<Store>',
|
|
2470
|
+
description: 'Reference to the store.\n@remarks\nThis was initially implemented with a sync and Async versions and will be replaced with just a sync Store in a future release (Please use only the sync version)',
|
|
2471
|
+
isRequired: true
|
|
2472
|
+
}, {
|
|
2473
|
+
name: 'subtleReactionsSummaryAndPicker',
|
|
2474
|
+
type: 'boolean',
|
|
2475
|
+
description: 'Optional prop for applying subtle styling to reaction summary and picker'
|
|
2476
|
+
}, {
|
|
2477
|
+
name: 'summaryViewEnabled',
|
|
2478
|
+
type: 'boolean',
|
|
2479
|
+
description: 'Enables a summary view for displaying reactions. If enabled and the number of reactions meets or exceeds the summaryViewThreshold, reactions will be shown in a more aggregated format.'
|
|
2480
|
+
}]
|
|
2481
|
+
}, {
|
|
2482
|
+
name: 'Renderer',
|
|
2483
|
+
package: '@atlaskit/renderer',
|
|
2484
|
+
description: 'Renderer component',
|
|
2485
|
+
status: 'general-availability',
|
|
2486
|
+
usageGuidelines: ['Use ReactRenderer with an ADF document; use a transformer (e.g. BitbucketTransformer) with ADFEncoder when your storage format is not ADF.', 'Avoid unnecessary props changes: extract static objects to constants, avoid passing new objects or anonymous functions on every render, use useMemo/useCallback for props and callbacks to prevent performance degradation.', 'Ensure only one version of Renderer sub-dependencies (adf-schema, editor-common, prosemirror-model, etc.) in your bundles; use deduplication or resolutions. Use correct peer dependency versions.', 'Use the truncated prop with maxHeight/fadeOutHeight when you need to cap rendered content with a fade; add polyfills for fetch and ES6/ES7 when targeting older browsers.'],
|
|
2487
|
+
contentGuidelines: [],
|
|
2488
|
+
accessibilityGuidelines: [],
|
|
2489
|
+
keywords: ['editor', 'renderer', 'atlaskit'],
|
|
2490
|
+
category: 'editor',
|
|
2491
|
+
examples: ["import type { ChangeEvent } from 'react';\nimport RendererDemo from './helper/RendererDemo';\nimport { SmartCardProvider, CardClient } from '@atlaskit/link-provider';\nimport { getSchemaBasedOnStage } from '@atlaskit/adf-schema/schema-default';\nimport type { ADFStage } from '@atlaskit/editor-common/validator';\nconst ADF_STAGE0 = 'stage0';\nconst ADF_FINAL = 'final';\nexport default function Example(): React.JSX.Element {\n\tconst [adfStage, setAdfStage] = React.useState<ADFStage>(ADF_FINAL);\n\tconst schema = getSchemaBasedOnStage(adfStage);\n\tconst onSchemaToggle = (event: ChangeEvent<HTMLInputElement>) => {\n\t\tsetAdfStage(event.currentTarget.checked ? ADF_STAGE0 : ADF_FINAL);\n\t};\n\tconst toggleCheckbox = (\n\t\t<label>\n\t\t\t{\n\t\t\t<input type=\"checkbox\" checked={adfStage === ADF_STAGE0} onChange={onSchemaToggle} />\n\t\t\tUse stage0 (experimental) document schema\n\t\t</label>\n\t);\n\treturn (\n\t\t<SmartCardProvider client={new CardClient('staging')}>\n\t\t\t<RendererDemo\n\t\t\t\tallowColumnSorting\n\t\t\t\tallowSelectAllTrap\n\t\t\t\tallowWrapCodeBlock\n\t\t\t\tallowCopyToClipboard\n\t\t\t\tserializer=\"react\"\n\t\t\t\tadfStage={adfStage}\n\t\t\t\tschema={schema}\n\t\t\t\tactionButtons={toggleCheckbox}\n\t\t\t\twithProviders\n\t\t\t/>\n\t\t</SmartCardProvider>\n\t);\n}", 'import RendererDemo from \'./helper/RendererDemo\';\nimport {\n\tNORMAL_SEVERITY_THRESHOLD,\n\tDEGRADED_SEVERITY_THRESHOLD,\n} from \'../../renderer/src/ui/Renderer\';\nexport default function Example(): React.JSX.Element {\n\treturn (\n\t\t<RendererDemo\n\t\t\tappearance="full-page"\n\t\t\tserializer="react"\n\t\t\tallowHeadingAnchorLinks\n\t\t\tallowColumnSorting={true}\n\t\t\tallowCopyToClipboard\n\t\t\tallowWrapCodeBlock\n\t\t\tUNSTABLE_allowTableAlignment\n\t\t\tUNSTABLE_allowTableResizing\n\t\t\tanalyticsEventSeverityTracking={{\n\t\t\t\tenabled: true,\n\t\t\t\tseverityNormalThreshold: NORMAL_SEVERITY_THRESHOLD,\n\t\t\t\tseverityDegradedThreshold: DEGRADED_SEVERITY_THRESHOLD,\n\t\t\t}}\n\t\t/>\n\t);\n}', 'import RendererDemo from \'./helper/RendererDemo\';\nexport default function Example(): React.JSX.Element {\n\treturn <RendererDemo withProviders={true} serializer="react" />;\n}'],
|
|
2492
|
+
props: [{
|
|
2493
|
+
name: 'addTelepointer',
|
|
2494
|
+
type: 'boolean',
|
|
2495
|
+
description: 'When enabled a trailing telepointer will be added to the rendered document\nfollowing content updates.\n\nContent is updated by passing a new value prop to the renderer.\n\nThe trailing pointer is updated by dom injection to the last text node which\nis updated as a result of a content update.'
|
|
2496
|
+
}, {
|
|
2497
|
+
name: 'adfStage',
|
|
2498
|
+
type: '"final" | "stage0"'
|
|
2499
|
+
}, {
|
|
2500
|
+
name: 'allowAltTextOnImages',
|
|
2501
|
+
type: 'boolean'
|
|
2502
|
+
}, {
|
|
2503
|
+
name: 'allowAnnotations',
|
|
2504
|
+
type: 'boolean'
|
|
2505
|
+
}, {
|
|
2506
|
+
name: 'allowColumnSorting',
|
|
2507
|
+
type: 'boolean'
|
|
2508
|
+
}, {
|
|
2509
|
+
name: 'allowCopyToClipboard',
|
|
2510
|
+
type: 'boolean'
|
|
2511
|
+
}, {
|
|
2512
|
+
name: 'allowCustomPanels',
|
|
2513
|
+
type: 'boolean'
|
|
2514
|
+
}, {
|
|
2515
|
+
name: 'allowDownloadCodeBlock',
|
|
2516
|
+
type: 'boolean'
|
|
2517
|
+
}, {
|
|
2518
|
+
name: 'allowFixedColumnWidthOption',
|
|
2519
|
+
type: 'boolean'
|
|
2520
|
+
}, {
|
|
2521
|
+
name: 'allowHeadingAnchorLinks',
|
|
2522
|
+
type: 'boolean | HeadingAnchorLinksConfig'
|
|
2523
|
+
}, {
|
|
2524
|
+
name: 'allowPlaceholderText',
|
|
2525
|
+
type: 'boolean'
|
|
2526
|
+
}, {
|
|
2527
|
+
name: 'allowRendererContainerStyles',
|
|
2528
|
+
type: 'boolean'
|
|
2529
|
+
}, {
|
|
2530
|
+
name: 'allowSelectAllTrap',
|
|
2531
|
+
type: 'boolean'
|
|
2532
|
+
}, {
|
|
2533
|
+
name: 'allowUgcScrubber',
|
|
2534
|
+
type: 'boolean'
|
|
2535
|
+
}, {
|
|
2536
|
+
name: 'allowWrapCodeBlock',
|
|
1123
2537
|
type: 'boolean'
|
|
1124
2538
|
}, {
|
|
1125
2539
|
name: 'analyticsEventSeverityTracking',
|
|
@@ -1974,4 +3388,243 @@ var atlaskitComponents = exports.atlaskitComponents = [{
|
|
|
1974
3388
|
name: 'isLinkComponent',
|
|
1975
3389
|
type: 'boolean'
|
|
1976
3390
|
}]
|
|
3391
|
+
}, {
|
|
3392
|
+
name: 'UserPicker',
|
|
3393
|
+
package: '@atlaskit/user-picker',
|
|
3394
|
+
description: 'The main user picker component.',
|
|
3395
|
+
status: 'general-availability',
|
|
3396
|
+
usageGuidelines: ['Use `UserPicker` for selecting users or teams in forms or filters.', 'Supports `isMulti` for selecting multiple items.'],
|
|
3397
|
+
keywords: ['user-picker', 'select', 'user', 'team'],
|
|
3398
|
+
category: 'elements',
|
|
3399
|
+
examples: ["import React, { useState } from 'react';\nimport { ExampleWrapper } from '../example-helpers/ExampleWrapper';\nimport UserPicker, { type OptionData } from '../src';\nconst Example = (): React.JSX.Element => {\n\tconst [selectedUser, setSelectedUser] = useState<OptionData>();\n\treturn (\n\t\t<ExampleWrapper>\n\t\t\t{({ options, onInputChange, onSelection }) => (\n\t\t\t\t<UserPicker\n\t\t\t\t\tfieldId=\"example\"\n\t\t\t\t\toptions={options}\n\t\t\t\t\tonChange={(option) => {\n\t\t\t\t\t\tif (option) {\n\t\t\t\t\t\t\tsetSelectedUser(option as OptionData);\n\t\t\t\t\t\t}\n\t\t\t\t\t}}\n\t\t\t\t\tonInputChange={onInputChange}\n\t\t\t\t\tonSelection={onSelection}\n\t\t\t\t\tvalue={selectedUser}\n\t\t\t\t\topenMenuOnFocus={false}\n\t\t\t\t/>\n\t\t\t)}\n\t\t</ExampleWrapper>\n\t);\n};\nexport default Example;", "import { ExampleWrapper } from '../example-helpers/ExampleWrapper';\nimport UserPicker from '../src';\nconst Example = (): React.JSX.Element => {\n\treturn (\n\t\t<ExampleWrapper>\n\t\t\t{({ options, onInputChange, onSelection }) => (\n\t\t\t\t<UserPicker\n\t\t\t\t\tfieldId=\"example\"\n\t\t\t\t\toptions={options}\n\t\t\t\t\tonChange={console.log}\n\t\t\t\t\tonInputChange={onInputChange}\n\t\t\t\t\tonSelection={onSelection}\n\t\t\t\t\tisMulti\n\t\t\t\t\tmaxPickerHeight={120}\n\t\t\t\t/>\n\t\t\t)}\n\t\t</ExampleWrapper>\n\t);\n};\nexport default Example;"],
|
|
3400
|
+
props: [{
|
|
3401
|
+
name: 'addMoreMessage',
|
|
3402
|
+
type: 'string'
|
|
3403
|
+
}, {
|
|
3404
|
+
name: 'allowEmail',
|
|
3405
|
+
type: 'boolean'
|
|
3406
|
+
}, {
|
|
3407
|
+
name: 'anchor',
|
|
3408
|
+
type: 'ComponentClass<any, any> | FunctionComponent<any>'
|
|
3409
|
+
}, {
|
|
3410
|
+
name: 'appearance',
|
|
3411
|
+
type: '"normal" | "compact"'
|
|
3412
|
+
}, {
|
|
3413
|
+
name: 'ariaDescribedBy',
|
|
3414
|
+
type: 'string'
|
|
3415
|
+
}, {
|
|
3416
|
+
name: 'ariaLabel',
|
|
3417
|
+
type: 'string'
|
|
3418
|
+
}, {
|
|
3419
|
+
name: 'ariaLabelledBy',
|
|
3420
|
+
type: 'string'
|
|
3421
|
+
}, {
|
|
3422
|
+
name: 'ariaLive',
|
|
3423
|
+
type: '"polite" | "off" | "assertive"'
|
|
3424
|
+
}, {
|
|
3425
|
+
name: 'autoFocus',
|
|
3426
|
+
type: 'boolean'
|
|
3427
|
+
}, {
|
|
3428
|
+
name: 'captureMenuScroll',
|
|
3429
|
+
type: 'boolean'
|
|
3430
|
+
}, {
|
|
3431
|
+
name: 'clearValueLabel',
|
|
3432
|
+
type: 'string'
|
|
3433
|
+
}, {
|
|
3434
|
+
name: 'closeMenuOnScroll',
|
|
3435
|
+
type: 'boolean | EventListener'
|
|
3436
|
+
}, {
|
|
3437
|
+
name: 'components',
|
|
3438
|
+
type: '{ Option?: ComponentType<OptionProps<OptionData, boolean, GroupBase<OptionData>>>; Group?: ComponentType<GroupProps<OptionData, boolean, GroupBase<...>>>; ... 19 more ...; ValueContainer?: ComponentType<...>; }'
|
|
3439
|
+
}, {
|
|
3440
|
+
name: 'customGroupAnalyticsLabels',
|
|
3441
|
+
type: '{ user?: string; team?: string; email?: string; group?: string; custom?: string; external_user?: string; }'
|
|
3442
|
+
}, {
|
|
3443
|
+
name: 'customGroupLabels',
|
|
3444
|
+
type: '{ user?: ReactNode; team?: ReactNode; email?: ReactNode; group?: ReactNode; custom?: ReactNode; external_user?: ReactNode; }'
|
|
3445
|
+
}, {
|
|
3446
|
+
name: 'defaultValue',
|
|
3447
|
+
type: 'Value | OptionIdentifier | OptionIdentifier[]'
|
|
3448
|
+
}, {
|
|
3449
|
+
name: 'disableInput',
|
|
3450
|
+
type: 'boolean'
|
|
3451
|
+
}, {
|
|
3452
|
+
name: 'emailLabel',
|
|
3453
|
+
type: 'string'
|
|
3454
|
+
}, {
|
|
3455
|
+
name: 'fieldId',
|
|
3456
|
+
type: 'string',
|
|
3457
|
+
isRequired: true
|
|
3458
|
+
}, {
|
|
3459
|
+
name: 'footer',
|
|
3460
|
+
type: 'string | number | boolean | ReactElement<any, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortal'
|
|
3461
|
+
}, {
|
|
3462
|
+
name: 'forwardedRef',
|
|
3463
|
+
type: '((instance: UserPickerRef) => void) | MutableRefObject<UserPickerRef>'
|
|
3464
|
+
}, {
|
|
3465
|
+
name: 'groupByTypeOrder',
|
|
3466
|
+
type: 'NonNullable<"user" | "team" | "email" | "group" | "custom" | "external_user">[]'
|
|
3467
|
+
}, {
|
|
3468
|
+
name: 'header',
|
|
3469
|
+
type: 'string | number | boolean | ReactElement<any, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortal'
|
|
3470
|
+
}, {
|
|
3471
|
+
name: 'height',
|
|
3472
|
+
type: 'string | number'
|
|
3473
|
+
}, {
|
|
3474
|
+
name: 'includeTeamsUpdates',
|
|
3475
|
+
type: 'boolean'
|
|
3476
|
+
}, {
|
|
3477
|
+
name: 'inputId',
|
|
3478
|
+
type: 'string'
|
|
3479
|
+
}, {
|
|
3480
|
+
name: 'isClearable',
|
|
3481
|
+
type: 'boolean'
|
|
3482
|
+
}, {
|
|
3483
|
+
name: 'isDisabled',
|
|
3484
|
+
type: 'boolean'
|
|
3485
|
+
}, {
|
|
3486
|
+
name: 'isFooterFocused',
|
|
3487
|
+
type: 'boolean'
|
|
3488
|
+
}, {
|
|
3489
|
+
name: 'isHeaderFocused',
|
|
3490
|
+
type: 'boolean'
|
|
3491
|
+
}, {
|
|
3492
|
+
name: 'isInvalid',
|
|
3493
|
+
type: 'boolean'
|
|
3494
|
+
}, {
|
|
3495
|
+
name: 'isLoading',
|
|
3496
|
+
type: 'boolean'
|
|
3497
|
+
}, {
|
|
3498
|
+
name: 'isMulti',
|
|
3499
|
+
type: 'boolean'
|
|
3500
|
+
}, {
|
|
3501
|
+
name: 'isValidEmail',
|
|
3502
|
+
type: '(inputText: string) => EmailValidationResponse'
|
|
3503
|
+
}, {
|
|
3504
|
+
name: 'loadOptions',
|
|
3505
|
+
type: 'LoadOptions'
|
|
3506
|
+
}, {
|
|
3507
|
+
name: 'loadOptionsErrorMessage',
|
|
3508
|
+
type: '(value: { inputValue: string; }) => ReactNode'
|
|
3509
|
+
}, {
|
|
3510
|
+
name: 'loadUserSource',
|
|
3511
|
+
type: 'LoadUserSource'
|
|
3512
|
+
}, {
|
|
3513
|
+
name: 'maxOptions',
|
|
3514
|
+
type: 'number'
|
|
3515
|
+
}, {
|
|
3516
|
+
name: 'maxPickerHeight',
|
|
3517
|
+
type: 'number'
|
|
3518
|
+
}, {
|
|
3519
|
+
name: 'menuIsOpen',
|
|
3520
|
+
type: 'boolean'
|
|
3521
|
+
}, {
|
|
3522
|
+
name: 'menuMinWidth',
|
|
3523
|
+
type: 'number'
|
|
3524
|
+
}, {
|
|
3525
|
+
name: 'menuPortalTarget',
|
|
3526
|
+
type: 'HTMLElement'
|
|
3527
|
+
}, {
|
|
3528
|
+
name: 'menuPosition',
|
|
3529
|
+
type: '"absolute" | "fixed"'
|
|
3530
|
+
}, {
|
|
3531
|
+
name: 'menuShouldBlockScroll',
|
|
3532
|
+
type: 'boolean'
|
|
3533
|
+
}, {
|
|
3534
|
+
name: 'minHeight',
|
|
3535
|
+
type: 'string | number'
|
|
3536
|
+
}, {
|
|
3537
|
+
name: 'name',
|
|
3538
|
+
type: 'string'
|
|
3539
|
+
}, {
|
|
3540
|
+
name: 'noBorder',
|
|
3541
|
+
type: 'boolean'
|
|
3542
|
+
}, {
|
|
3543
|
+
name: 'noOptionsMessage',
|
|
3544
|
+
type: 'ReactNode | ((value: { inputValue: string; }) => ReactNode)'
|
|
3545
|
+
}, {
|
|
3546
|
+
name: 'onBlur',
|
|
3547
|
+
type: '(sessionId?: string) => void'
|
|
3548
|
+
}, {
|
|
3549
|
+
name: 'onChange',
|
|
3550
|
+
type: '(value: Value, action: ActionTypes) => void'
|
|
3551
|
+
}, {
|
|
3552
|
+
name: 'onClear',
|
|
3553
|
+
type: '(sessionId?: string) => void'
|
|
3554
|
+
}, {
|
|
3555
|
+
name: 'onClose',
|
|
3556
|
+
type: '(sessionId?: string) => void'
|
|
3557
|
+
}, {
|
|
3558
|
+
name: 'onFocus',
|
|
3559
|
+
type: '(sessionId?: string) => void'
|
|
3560
|
+
}, {
|
|
3561
|
+
name: 'onInputChange',
|
|
3562
|
+
type: '(query?: string, sessionId?: string) => void'
|
|
3563
|
+
}, {
|
|
3564
|
+
name: 'onKeyDown',
|
|
3565
|
+
type: '(event: KeyboardEvent<Element>) => void'
|
|
3566
|
+
}, {
|
|
3567
|
+
name: 'onOpen',
|
|
3568
|
+
type: '(sessionId?: string) => void'
|
|
3569
|
+
}, {
|
|
3570
|
+
name: 'onSelection',
|
|
3571
|
+
type: '(value: Value, sessionId?: string, baseUserPicker?: BaseUserPickerWithoutAnalytics) => void'
|
|
3572
|
+
}, {
|
|
3573
|
+
name: 'open',
|
|
3574
|
+
type: 'boolean'
|
|
3575
|
+
}, {
|
|
3576
|
+
name: 'openMenuOnClick',
|
|
3577
|
+
type: 'boolean'
|
|
3578
|
+
}, {
|
|
3579
|
+
name: 'openMenuOnFocus',
|
|
3580
|
+
type: 'boolean'
|
|
3581
|
+
}, {
|
|
3582
|
+
name: 'options',
|
|
3583
|
+
type: 'OptionData[]'
|
|
3584
|
+
}, {
|
|
3585
|
+
name: 'placeholder',
|
|
3586
|
+
type: 'string | number | boolean | ReactElement<any, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortal'
|
|
3587
|
+
}, {
|
|
3588
|
+
name: 'placeholderAvatar',
|
|
3589
|
+
type: '"team" | "person"'
|
|
3590
|
+
}, {
|
|
3591
|
+
name: 'popupSelectProps',
|
|
3592
|
+
type: 'PopupSelectProps<OptionData, false, ModifierList>'
|
|
3593
|
+
}, {
|
|
3594
|
+
name: 'required',
|
|
3595
|
+
type: 'boolean'
|
|
3596
|
+
}, {
|
|
3597
|
+
name: 'search',
|
|
3598
|
+
type: 'string'
|
|
3599
|
+
}, {
|
|
3600
|
+
name: 'setIsFooterFocused',
|
|
3601
|
+
type: '(value: SetStateAction<boolean>) => void'
|
|
3602
|
+
}, {
|
|
3603
|
+
name: 'setIsHeaderFocused',
|
|
3604
|
+
type: '(value: SetStateAction<boolean>) => void'
|
|
3605
|
+
}, {
|
|
3606
|
+
name: 'showClearIndicator',
|
|
3607
|
+
type: 'boolean'
|
|
3608
|
+
}, {
|
|
3609
|
+
name: 'strategy',
|
|
3610
|
+
type: '"absolute" | "fixed"'
|
|
3611
|
+
}, {
|
|
3612
|
+
name: 'styles',
|
|
3613
|
+
type: '{ clearIndicator?: (base: any, props: ClearIndicatorProps<OptionType, false, GroupBase<OptionType>>) => any; container?: (base: any, props: ContainerProps<...>) => any; ... 18 more ...; valueContainer?: (base: any, props: ValueContainerProps<...>) => any; }'
|
|
3614
|
+
}, {
|
|
3615
|
+
name: 'subtle',
|
|
3616
|
+
type: 'boolean'
|
|
3617
|
+
}, {
|
|
3618
|
+
name: 'suggestEmailsForDomain',
|
|
3619
|
+
type: 'string'
|
|
3620
|
+
}, {
|
|
3621
|
+
name: 'textFieldBackgroundColor',
|
|
3622
|
+
type: 'boolean'
|
|
3623
|
+
}, {
|
|
3624
|
+
name: 'value',
|
|
3625
|
+
type: 'OptionData | OptionData[]'
|
|
3626
|
+
}, {
|
|
3627
|
+
name: 'width',
|
|
3628
|
+
type: 'string | number'
|
|
3629
|
+
}]
|
|
1977
3630
|
}];
|