@atlaskit/share 1.0.2 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/clients/package.json +7 -0
  3. package/dist/cjs/clients/ShareServiceClient.js +1 -7
  4. package/dist/cjs/clients/index.js +13 -0
  5. package/dist/cjs/components/CopyLinkButton.js +15 -11
  6. package/dist/cjs/components/IntegrationForm.js +5 -2
  7. package/dist/cjs/components/LazyShareForm/LazyShareForm.js +105 -0
  8. package/dist/cjs/components/LazyShareForm/index.js +15 -0
  9. package/dist/cjs/components/LazyShareForm/lazy.js +53 -0
  10. package/dist/cjs/components/LazyShareForm/styled.js +28 -0
  11. package/dist/cjs/components/ShareDialogContainer.js +1 -1
  12. package/dist/cjs/components/ShareDialogWithTrigger.js +26 -38
  13. package/dist/cjs/components/ShareForm.js +33 -14
  14. package/dist/cjs/components/ShareFormWrapper/ShareFormWrapper.js +29 -0
  15. package/dist/cjs/components/ShareFormWrapper/index.js +15 -0
  16. package/dist/cjs/components/ShareFormWrapper/styled.js +31 -0
  17. package/dist/cjs/components/styles.js +1 -20
  18. package/dist/cjs/i18n.js +10 -10
  19. package/dist/cjs/index.js +0 -8
  20. package/dist/cjs/types/ShareDialogContainer.js +5 -0
  21. package/dist/cjs/types/ShareForm.js +5 -0
  22. package/dist/cjs/version.json +1 -1
  23. package/dist/es2019/clients/ShareServiceClient.js +1 -7
  24. package/dist/es2019/clients/index.js +1 -0
  25. package/dist/es2019/components/CopyLinkButton.js +12 -4
  26. package/dist/es2019/components/IntegrationForm.js +2 -2
  27. package/dist/es2019/components/LazyShareForm/LazyShareForm.js +92 -0
  28. package/dist/es2019/components/LazyShareForm/index.js +1 -0
  29. package/dist/es2019/components/LazyShareForm/lazy.js +26 -0
  30. package/dist/es2019/components/LazyShareForm/styled.js +16 -0
  31. package/dist/es2019/components/ShareDialogContainer.js +1 -1
  32. package/dist/es2019/components/ShareDialogWithTrigger.js +27 -39
  33. package/dist/es2019/components/ShareForm.js +23 -4
  34. package/dist/es2019/components/ShareFormWrapper/ShareFormWrapper.js +14 -0
  35. package/dist/es2019/components/ShareFormWrapper/index.js +1 -0
  36. package/dist/es2019/components/ShareFormWrapper/styled.js +15 -0
  37. package/dist/es2019/components/styles.js +1 -15
  38. package/dist/es2019/i18n.js +10 -10
  39. package/dist/es2019/index.js +0 -1
  40. package/dist/es2019/types/ShareDialogContainer.js +1 -0
  41. package/dist/es2019/types/ShareForm.js +1 -0
  42. package/dist/es2019/version.json +1 -1
  43. package/dist/esm/clients/ShareServiceClient.js +1 -7
  44. package/dist/esm/clients/index.js +1 -0
  45. package/dist/esm/components/CopyLinkButton.js +12 -4
  46. package/dist/esm/components/IntegrationForm.js +5 -2
  47. package/dist/esm/components/LazyShareForm/LazyShareForm.js +87 -0
  48. package/dist/esm/components/LazyShareForm/index.js +1 -0
  49. package/dist/esm/components/LazyShareForm/lazy.js +31 -0
  50. package/dist/esm/components/LazyShareForm/styled.js +9 -0
  51. package/dist/esm/components/ShareDialogContainer.js +1 -1
  52. package/dist/esm/components/ShareDialogWithTrigger.js +28 -35
  53. package/dist/esm/components/ShareForm.js +33 -13
  54. package/dist/esm/components/ShareFormWrapper/ShareFormWrapper.js +17 -0
  55. package/dist/esm/components/ShareFormWrapper/index.js +1 -0
  56. package/dist/esm/components/ShareFormWrapper/styled.js +15 -0
  57. package/dist/esm/components/styles.js +1 -16
  58. package/dist/esm/i18n.js +10 -10
  59. package/dist/esm/index.js +0 -1
  60. package/dist/esm/types/ShareDialogContainer.js +1 -0
  61. package/dist/esm/types/ShareForm.js +1 -0
  62. package/dist/esm/version.json +1 -1
  63. package/dist/types/clients/ShareServiceClient.d.ts +2 -2
  64. package/dist/types/clients/index.d.ts +2 -0
  65. package/dist/types/components/IntegrationForm.d.ts +4 -5
  66. package/dist/types/components/LazyShareForm/LazyShareForm.d.ts +19 -0
  67. package/dist/types/components/LazyShareForm/index.d.ts +1 -0
  68. package/dist/types/components/LazyShareForm/lazy.d.ts +4 -0
  69. package/dist/types/components/LazyShareForm/styled.d.ts +4 -0
  70. package/dist/types/components/ShareDialogContainer.d.ts +10 -148
  71. package/dist/types/components/ShareDialogWithTrigger.d.ts +10 -71
  72. package/dist/types/components/ShareForm.d.ts +3 -44
  73. package/dist/types/components/ShareFormWrapper/ShareFormWrapper.d.ts +9 -0
  74. package/dist/types/components/ShareFormWrapper/index.d.ts +1 -0
  75. package/dist/types/components/ShareFormWrapper/styled.d.ts +9 -0
  76. package/dist/types/components/styles.d.ts +0 -7
  77. package/dist/types/i18n.d.ts +10 -10
  78. package/dist/types/index.d.ts +1 -4
  79. package/dist/types/types/ShareContentState.d.ts +2 -2
  80. package/dist/types/types/ShareDialogContainer.d.ts +142 -0
  81. package/dist/types/types/ShareDialogWithTrigger.d.ts +30 -3
  82. package/dist/types/types/ShareForm.d.ts +31 -0
  83. package/dist/types/types/index.d.ts +4 -2
  84. package/package.json +6 -2
@@ -2,7 +2,7 @@ import { ServiceConfig } from '@atlaskit/util-service-support';
2
2
  import { Comment, Content, MetaData, User } from '../types';
3
3
  export interface ShareClient {
4
4
  share(content: Content, recipients: User[], metadata: MetaData, comment?: Comment): Promise<ShareResponse>;
5
- getConfig(cloudId: string, enableEmailPermissionCheck?: boolean): Promise<ConfigResponse>;
5
+ getConfig(cloudId: string): Promise<ConfigResponse>;
6
6
  }
7
7
  export declare type ShareRequest = (content: Content, recipients: User[], metadata: MetaData, comment?: Comment) => Promise<ShareResponse>;
8
8
  export declare type ShareResponse = {
@@ -17,7 +17,7 @@ export declare const DEFAULT_SHARE_SERVICE_URL = "/gateway/api";
17
17
  export declare class ShareServiceClient implements ShareClient {
18
18
  private serviceConfig;
19
19
  constructor(serviceConfig?: Partial<ServiceConfig>);
20
- getConfig(cloudId: string, enableEmailPermissionCheck?: boolean): Promise<ConfigResponse>;
20
+ getConfig(cloudId: string): Promise<ConfigResponse>;
21
21
  /**
22
22
  * To send a POST request to the share endpoint in Share service
23
23
  */
@@ -0,0 +1,2 @@
1
+ export { ShareServiceClient } from './ShareServiceClient';
2
+ export type { ShareClient } from './ShareServiceClient';
@@ -1,9 +1,8 @@
1
1
  import React from 'react';
2
2
  import { IntegrationContentProps } from '../types';
3
3
  export declare const FormWrapper: import("styled-components").StyledComponentClass<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, any, React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>>;
4
- declare type Props = {
5
- Content: React.ComponentType<IntegrationContentProps>;
6
- onIntegrationClose: () => void;
4
+ export declare type IntegrationFormProps = {
5
+ Content: React.ComponentType<IntegrationContentProps> | null;
6
+ onIntegrationClose?: () => void;
7
7
  };
8
- export declare const IntegrationForm: ({ Content, onIntegrationClose }: Props) => JSX.Element;
9
- export {};
8
+ export declare const IntegrationForm: ({ Content, onIntegrationClose, }: IntegrationFormProps) => JSX.Element;
@@ -0,0 +1,19 @@
1
+ /// <reference types="react" />
2
+ import type { LoadOptions } from '@atlaskit/user-picker';
3
+ import { IntegrationFormProps } from '../IntegrationForm';
4
+ import type { ShareData, ShareDialogWithTriggerProps, ShareDialogWithTriggerStates } from '../../types';
5
+ export declare type LazyShareFormProps = Pick<ShareDialogWithTriggerProps, 'copyLink' | 'config' | 'isFetchingConfig' | 'loadUserOptions' | 'shareFormTitle' | 'shareFormHelperMessage' | 'bottomMessage' | 'submitButtonLabel' | 'product' | 'customFooter' | 'enableSmartUserPicker' | 'loggedInAccountId' | 'cloudId' | 'shareFieldsFooter' | 'onUserSelectionChange' | 'isPublicLink' | 'copyTooltipText' | 'shareIntegrations' | 'integrationMode' | 'onDialogClose'> & Pick<ShareDialogWithTriggerStates, 'showIntegrationForm' | 'selectedIntegration' | 'isSharing' | 'shareError' | 'defaultValue'> & Pick<IntegrationFormProps, 'Content'> & {
6
+ onLinkCopy: () => void;
7
+ onDismiss: (data: ShareData) => void;
8
+ onSubmit: (data: ShareData) => void;
9
+ onTabChange: (index: number) => void;
10
+ loadOptions?: LoadOptions;
11
+ selectPortalRef: any;
12
+ showTitle: boolean;
13
+ };
14
+ /**
15
+ * A Share form content which is lazy-loaded.
16
+ * Make sure this component is not exported inside main entry points `src/index.ts`
17
+ */
18
+ declare function LazyShareForm(props: LazyShareFormProps): JSX.Element;
19
+ export default LazyShareForm;
@@ -0,0 +1 @@
1
+ export { default } from './LazyShareForm';
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import type { LazyShareFormProps } from './LazyShareForm';
3
+ declare const _default: (props: LazyShareFormProps) => JSX.Element;
4
+ export default _default;
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ export declare const BottomMessageWrapper: import("styled-components").StyledComponentClass<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, any, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>>;
3
+ export declare const CustomFooterWrapper: import("styled-components").StyledComponentClass<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, any, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>>;
4
+ export declare const SpinnerWrapper: import("styled-components").StyledComponentClass<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, any, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>>;
@@ -1,148 +1,10 @@
1
1
  import { AnalyticsEventPayload, WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
2
- import { Appearance } from '@atlaskit/button/types';
3
- import { LoadOptions, Value } from '@atlaskit/user-picker';
4
2
  import React from 'react';
5
- import { UrlShortenerClient, ShortenRequest } from '../clients/AtlassianUrlShortenerClient';
6
- import { ConfigResponse, ShareClient } from '../clients/ShareServiceClient';
7
- import { DialogContentState, DialogPlacement, Flag, OriginTracing, OriginTracingFactory, ProductId, ProductName, RenderCustomTriggerButton, ShareButtonStyle, TooltipPosition, Integration } from '../types';
8
- import { IconProps } from '@atlaskit/icon';
9
- import { IntegrationMode } from '../types/ShareEntities';
3
+ import { ShortenRequest } from '../clients/AtlassianUrlShortenerClient';
4
+ import { ConfigResponse } from '../clients/ShareServiceClient';
5
+ import { ShareData, OriginTracing, OriginTracingFactory } from '../types';
6
+ import type { ShareDialogContainerProps } from '../types';
10
7
  export declare const defaultConfig: ConfigResponse;
11
- export declare type Props = {
12
- onTriggerButtonClick?: () => void;
13
- onDialogOpen?: () => void;
14
- onDialogClose?: () => void;
15
- isAutoOpenDialog?: boolean;
16
- /** Share service client implementation that gets share configs and performs share.
17
- * Optional, a default one is provided. */
18
- shareClient?: ShareClient;
19
- /** URL Shortener service client implementation that may shorten links for copy.
20
- * Optional, a default one is provided. */
21
- urlShortenerClient?: UrlShortenerClient;
22
- /** Data provided to the `urlShortenerClient` to shorten the shared URL.
23
- * If it is not provided, the link will not be shortened.
24
- * If link shortening fails, the full URL will be shared instead. */
25
- shortLinkData?: ShortenRequest;
26
- /** Cloud ID of the instance.
27
- * Note: we assume this props is stable. */
28
- cloudId: string;
29
- /** Placement of the modal to the trigger button. */
30
- dialogPlacement?: DialogPlacement;
31
- /**
32
- * Z-index that the popup should be displayed in.
33
- * This is passed to the portal component.
34
- * Defaults to `layers.modal()` from `@atlaskit/theme`.
35
- */
36
- dialogZIndex?: number;
37
- /** Transform function to provide custom formatted copy link.
38
- * Optional, a default one is provided. */
39
- formatCopyLink?: (origin: OriginTracing, link: string) => string;
40
- /** Function used to load users options asynchronously. Not needed if smart user picker is enabled. */
41
- loadUserOptions?: LoadOptions;
42
- /** Factory function to generate new Origin Tracing instance. */
43
- originTracingFactory: OriginTracingFactory;
44
- /** Product ID (Canonical ID) in ARI of the share request.
45
- * Note: we assume this props is stable. */
46
- productId: ProductId;
47
- /** Render function for a custom Share Dialog Trigger Button. */
48
- renderCustomTriggerButton?: RenderCustomTriggerButton;
49
- /** Atlassian Resource Identifier of a Site resource to be shared. */
50
- shareAri: string;
51
- /** Content Type of the resource to be shared. It will also affect on the successful share message in the flag. A pre-defined list as follows:*/
52
- /** blogpost */
53
- /** board */
54
- /** calendar */
55
- /** draft */
56
- /** filter */
57
- /** issue */
58
- /** media */
59
- /** page */
60
- /** project */
61
- /** pullrequest */
62
- /** question */
63
- /** report */
64
- /** repository */
65
- /** request */
66
- /** roadmap */
67
- /** site */
68
- /** space */
69
- /** Any other unlisted type will have a default message of "Link shared". */
70
- shareContentType: string;
71
- /** Link of the resource to be shared (should NOT includes origin tracing).
72
- * Optional, the current page URL is used by default. */
73
- shareLink?: string;
74
- /** Title of the resource to be shared that will be sent in notifications. */
75
- shareTitle: string;
76
- /** Title of the share modal. */
77
- shareFormTitle?: React.ReactNode;
78
- /** Copy for helper message to be displayed under share form input box. */
79
- shareFormHelperMessage?: string;
80
- /** To enable closing the modal on escape key press. */
81
- shouldCloseOnEscapePress?: boolean;
82
- /**
83
- * Callback function for showing successful share flag(s) with a parameter providing details of the flag, including the type of the message with a localized default title
84
- * This package has an opinion on showing flag(s) upon successful share, and Flag system is NOT provided. Instead, showFlag prop is available for this purpose.
85
- */
86
- showFlags: (flags: Array<Flag>) => void;
87
- /**
88
- * Power the user picker with smarts. To enable smart user picker, the following props are used:
89
- * - `product`: 'jira' or 'confluence'
90
- * - `loggedInAccountId`: if not provided, defaults to obtaining from request context
91
- * - `cloudId`
92
- */
93
- enableSmartUserPicker?: boolean;
94
- /**
95
- * When true, the component will call the Share service to check whether the
96
- * site has sharing to emails enabled.
97
- */
98
- enableEmailPermissionCheck?: boolean;
99
- /**
100
- * The userId of the sharer. If not provided, smart user picker
101
- * defaults it to the value 'Context'
102
- * which will tell the recommendation service to extract the
103
- * value from the request context.
104
- */
105
- loggedInAccountId?: string;
106
- /** Appearance of the share modal trigger button */
107
- triggerButtonAppearance?: Appearance;
108
- /** Share button Icon */
109
- triggerButtonIcon?: React.ComponentType<IconProps>;
110
- /** Style of the share modal trigger button. */
111
- triggerButtonStyle?: ShareButtonStyle;
112
- /** Position of the tooltip on share modal trigger button. */
113
- triggerButtonTooltipPosition?: TooltipPosition;
114
- /** Custom text of the tooltip on share modal trigger button. */
115
- triggerButtonTooltipText?: React.ReactNode;
116
- /** Message to be appended to the modal. */
117
- bottomMessage?: React.ReactNode;
118
- /** @deprecated Use the `shortLinkData` prop instead.
119
- *
120
- * Whether we should use the Atlassian Url Shortener or not.
121
- * Note that all products may not be supported. */
122
- useUrlShortener?: boolean;
123
- /** Action that will be performed by the recipient when he/she receives the notification. */
124
- shareeAction?: 'view' | 'edit';
125
- /**
126
- * Optional, this prop can be `jira` or `confluence`. Default value is `confluence`.
127
- * We use this prop to control different text messages in UI.
128
- */
129
- product?: ProductName;
130
- /**
131
- * Footer for the share dialog.
132
- */
133
- customFooter?: React.ReactNode;
134
- onUserSelectionChange?: (value: Value) => void;
135
- shareFieldsFooter?: React.ReactNode;
136
- isCopyDisabled?: boolean;
137
- isPublicLink?: boolean;
138
- integrationMode?: IntegrationMode;
139
- shareIntegrations?: Array<Integration>;
140
- /**
141
- * Optionally sets a tabIndex value if you need to set focus
142
- */
143
- tabIndex?: number;
144
- copyTooltipText?: string;
145
- };
146
8
  export declare type State = {
147
9
  config?: ConfigResponse;
148
10
  isFetchingConfig: boolean;
@@ -155,7 +17,7 @@ export declare type State = {
155
17
  * This component serves as a Provider to provide customizable implementations
156
18
  * to ShareDialogTrigger component
157
19
  */
158
- export declare class ShareDialogContainerInternal extends React.Component<WithAnalyticsEventsProps & Props, State> {
20
+ export declare class ShareDialogContainerInternal extends React.Component<WithAnalyticsEventsProps & ShareDialogContainerProps, State> {
159
21
  private shareClient;
160
22
  private urlShortenerClient;
161
23
  private _isMounted;
@@ -166,13 +28,13 @@ export declare class ShareDialogContainerInternal extends React.Component<WithAn
166
28
  shareeAction: "view" | "edit";
167
29
  product: string;
168
30
  };
169
- constructor(props: Props);
31
+ constructor(props: ShareDialogContainerProps);
170
32
  componentDidMount(): void;
171
33
  componentWillUnmount(): void;
172
- componentDidUpdate(prevProps: Props): void;
34
+ componentDidUpdate(prevProps: ShareDialogContainerProps): void;
173
35
  private createAndFireEvent;
174
36
  fetchConfig: () => void;
175
- handleSubmitShare: ({ users, comment, }: DialogContentState) => Promise<void>;
37
+ handleSubmitShare: ({ users, comment }: ShareData) => Promise<void>;
176
38
  handleDialogOpen: () => Promise<void>;
177
39
  decorateAnalytics: (payload: AnalyticsEventPayload) => AnalyticsEventPayload;
178
40
  getUniqueCopyLinkOriginTracing: import("memoize-one").MemoizedFn<(link: string, originTracingFactory: OriginTracingFactory) => OriginTracing>;
@@ -186,12 +48,12 @@ export declare class ShareDialogContainerInternal extends React.Component<WithAn
186
48
  getShortenedCopyLink(): string | undefined;
187
49
  getCopyLink(): string;
188
50
  addOriginToShortQuery(query?: string): string;
189
- getShortLinkData(props: Props): ShortenRequest | undefined;
51
+ getShortLinkData(props: ShareDialogContainerProps): ShortenRequest | undefined;
190
52
  updateShortCopyLink(): void;
191
53
  getFormShareLink: () => string;
192
54
  render(): JSX.Element;
193
55
  }
194
- export declare const ShareDialogContainer: React.ForwardRefExoticComponent<Pick<Pick<WithAnalyticsEventsProps & Props, "isPublicLink" | "tabIndex" | "triggerButtonAppearance" | "shareIntegrations" | "dialogZIndex" | "dialogPlacement" | "copyTooltipText" | "product" | "enableSmartUserPicker" | "loggedInAccountId" | "cloudId" | "onUserSelectionChange" | "integrationMode" | "onTriggerButtonClick" | "isAutoOpenDialog" | "loadUserOptions" | "onDialogOpen" | "onDialogClose" | "renderCustomTriggerButton" | "shareContentType" | "shareFormTitle" | "shareFormHelperMessage" | "shouldCloseOnEscapePress" | "showFlags" | "triggerButtonIcon" | "triggerButtonStyle" | "triggerButtonTooltipPosition" | "triggerButtonTooltipText" | "bottomMessage" | "customFooter" | "shareFieldsFooter" | "isCopyDisabled" | "shareAri" | "shareClient" | "urlShortenerClient" | "shortLinkData" | "formatCopyLink" | "originTracingFactory" | "productId" | "shareLink" | "shareTitle" | "enableEmailPermissionCheck" | "useUrlShortener" | "shareeAction">, "isPublicLink" | "tabIndex" | "triggerButtonAppearance" | "shareIntegrations" | "dialogZIndex" | "dialogPlacement" | "copyTooltipText" | "loggedInAccountId" | "cloudId" | "onUserSelectionChange" | "integrationMode" | "onTriggerButtonClick" | "isAutoOpenDialog" | "loadUserOptions" | "onDialogOpen" | "onDialogClose" | "renderCustomTriggerButton" | "shareContentType" | "shareFormTitle" | "shareFormHelperMessage" | "shouldCloseOnEscapePress" | "showFlags" | "triggerButtonIcon" | "triggerButtonStyle" | "triggerButtonTooltipPosition" | "triggerButtonTooltipText" | "bottomMessage" | "customFooter" | "shareFieldsFooter" | "isCopyDisabled" | "shareAri" | "shareClient" | "urlShortenerClient" | "shortLinkData" | "formatCopyLink" | "originTracingFactory" | "productId" | "shareLink" | "shareTitle" | "enableEmailPermissionCheck" | "useUrlShortener"> & Partial<Pick<Pick<WithAnalyticsEventsProps & Props, "isPublicLink" | "tabIndex" | "triggerButtonAppearance" | "shareIntegrations" | "dialogZIndex" | "dialogPlacement" | "copyTooltipText" | "product" | "enableSmartUserPicker" | "loggedInAccountId" | "cloudId" | "onUserSelectionChange" | "integrationMode" | "onTriggerButtonClick" | "isAutoOpenDialog" | "loadUserOptions" | "onDialogOpen" | "onDialogClose" | "renderCustomTriggerButton" | "shareContentType" | "shareFormTitle" | "shareFormHelperMessage" | "shouldCloseOnEscapePress" | "showFlags" | "triggerButtonIcon" | "triggerButtonStyle" | "triggerButtonTooltipPosition" | "triggerButtonTooltipText" | "bottomMessage" | "customFooter" | "shareFieldsFooter" | "isCopyDisabled" | "shareAri" | "shareClient" | "urlShortenerClient" | "shortLinkData" | "formatCopyLink" | "originTracingFactory" | "productId" | "shareLink" | "shareTitle" | "enableEmailPermissionCheck" | "useUrlShortener" | "shareeAction">, "product" | "enableSmartUserPicker" | "shareeAction">> & Partial<Pick<{
56
+ export declare const ShareDialogContainer: React.ForwardRefExoticComponent<Pick<Pick<WithAnalyticsEventsProps & ShareDialogContainerProps, "onTriggerButtonClick" | "isAutoOpenDialog" | "shouldCloseOnEscapePress" | "dialogPlacement" | "loadUserOptions" | "onDialogOpen" | "onDialogClose" | "onUserSelectionChange" | "renderCustomTriggerButton" | "shareContentType" | "shareFormTitle" | "shareFormHelperMessage" | "showFlags" | "enableSmartUserPicker" | "loggedInAccountId" | "triggerButtonAppearance" | "triggerButtonIcon" | "triggerButtonStyle" | "triggerButtonTooltipPosition" | "triggerButtonTooltipText" | "cloudId" | "bottomMessage" | "product" | "customFooter" | "isCopyDisabled" | "isPublicLink" | "integrationMode" | "shareFieldsFooter" | "shareIntegrations" | "shareAri" | "tabIndex" | "copyTooltipText" | "dialogZIndex" | "shareClient" | "urlShortenerClient" | "shortLinkData" | "formatCopyLink" | "originTracingFactory" | "productId" | "shareLink" | "shareTitle" | "useUrlShortener" | "shareeAction">, "onTriggerButtonClick" | "isAutoOpenDialog" | "shouldCloseOnEscapePress" | "dialogPlacement" | "loadUserOptions" | "onDialogOpen" | "onDialogClose" | "onUserSelectionChange" | "renderCustomTriggerButton" | "shareContentType" | "shareFormTitle" | "shareFormHelperMessage" | "showFlags" | "loggedInAccountId" | "triggerButtonAppearance" | "triggerButtonIcon" | "triggerButtonStyle" | "triggerButtonTooltipPosition" | "triggerButtonTooltipText" | "cloudId" | "bottomMessage" | "customFooter" | "isCopyDisabled" | "isPublicLink" | "integrationMode" | "shareFieldsFooter" | "shareIntegrations" | "shareAri" | "tabIndex" | "copyTooltipText" | "dialogZIndex" | "shareClient" | "urlShortenerClient" | "shortLinkData" | "formatCopyLink" | "originTracingFactory" | "productId" | "shareLink" | "shareTitle" | "useUrlShortener"> & Partial<Pick<Pick<WithAnalyticsEventsProps & ShareDialogContainerProps, "onTriggerButtonClick" | "isAutoOpenDialog" | "shouldCloseOnEscapePress" | "dialogPlacement" | "loadUserOptions" | "onDialogOpen" | "onDialogClose" | "onUserSelectionChange" | "renderCustomTriggerButton" | "shareContentType" | "shareFormTitle" | "shareFormHelperMessage" | "showFlags" | "enableSmartUserPicker" | "loggedInAccountId" | "triggerButtonAppearance" | "triggerButtonIcon" | "triggerButtonStyle" | "triggerButtonTooltipPosition" | "triggerButtonTooltipText" | "cloudId" | "bottomMessage" | "product" | "customFooter" | "isCopyDisabled" | "isPublicLink" | "integrationMode" | "shareFieldsFooter" | "shareIntegrations" | "shareAri" | "tabIndex" | "copyTooltipText" | "dialogZIndex" | "shareClient" | "urlShortenerClient" | "shortLinkData" | "formatCopyLink" | "originTracingFactory" | "productId" | "shareLink" | "shareTitle" | "useUrlShortener" | "shareeAction">, "enableSmartUserPicker" | "product" | "shareeAction">> & Partial<Pick<{
195
57
  enableSmartUserPicker: boolean;
196
58
  shareeAction: "view" | "edit";
197
59
  product: string;
@@ -1,73 +1,12 @@
1
- import { AnalyticsEventPayload, WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
2
- import { Appearance } from '@atlaskit/button/types';
3
- import { TriggerProps } from '@atlaskit/popup';
4
- import { LoadOptions, Value } from '@atlaskit/user-picker';
5
1
  import React from 'react';
2
+ import { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
3
+ import { TriggerProps } from '@atlaskit/popup';
6
4
  import { WrappedComponentProps } from 'react-intl-next';
7
- import { ConfigResponse, DialogContentState, DialogPlacement, Flag, OriginTracing, ProductName, RenderCustomTriggerButton, ShareButtonStyle, ShareError, TooltipPosition, Integration } from '../types';
8
- import { IconProps } from '@atlaskit/icon';
9
- import { IntegrationMode } from '../types/ShareEntities';
10
- declare type DialogState = {
11
- isDialogOpen: boolean;
12
- isSharing: boolean;
13
- shareError?: ShareError;
14
- ignoreIntermediateState: boolean;
15
- defaultValue: DialogContentState;
16
- isUsingSplitButton: boolean;
17
- showIntegrationForm: boolean;
18
- selectedIntegration: Integration | null;
19
- };
20
- export declare type State = DialogState;
21
- export declare type Props = {
22
- onTriggerButtonClick?: () => void;
23
- isAutoOpenDialog?: boolean;
24
- config?: ConfigResponse;
25
- isFetchingConfig?: boolean;
26
- children?: RenderCustomTriggerButton;
27
- copyLink: string;
28
- analyticsDecorator?: (payload: AnalyticsEventPayload) => AnalyticsEventPayload;
29
- dialogPlacement?: DialogPlacement;
30
- dialogZIndex?: number;
31
- isDisabled?: boolean;
32
- loadUserOptions?: LoadOptions;
33
- onDialogOpen?: () => void;
34
- onDialogClose?: () => void;
35
- onShareSubmit?: (shareContentState: DialogContentState) => Promise<any>;
36
- renderCustomTriggerButton?: RenderCustomTriggerButton;
37
- shareContentType: string;
38
- shareFormTitle?: React.ReactNode;
39
- shareFormHelperMessage?: string;
40
- copyLinkOrigin?: OriginTracing;
41
- formShareOrigin?: OriginTracing;
42
- shouldCloseOnEscapePress?: boolean;
43
- showFlags: (flags: Array<Flag>) => void;
44
- enableSmartUserPicker?: boolean;
45
- loggedInAccountId?: string;
46
- cloudId?: string;
47
- triggerButtonAppearance?: Appearance;
48
- triggerButtonIcon?: React.ComponentType<IconProps>;
49
- triggerButtonStyle?: ShareButtonStyle;
50
- triggerButtonTooltipPosition?: TooltipPosition;
51
- triggerButtonTooltipText?: React.ReactNode;
52
- bottomMessage?: React.ReactNode;
53
- submitButtonLabel?: React.ReactNode;
54
- product: ProductName;
55
- customFooter?: React.ReactNode;
56
- onUserSelectionChange?: (value: Value) => void;
57
- shareFieldsFooter?: React.ReactNode;
58
- isCopyDisabled?: boolean;
59
- isPublicLink?: boolean;
60
- integrationMode?: IntegrationMode;
61
- shareIntegrations?: Array<Integration>;
62
- /** Atlassian Resource Identifier of a Site resource to be shared. */
63
- shareAri?: string;
64
- tabIndex?: number;
65
- copyTooltipText?: string;
66
- };
67
- export declare const defaultShareContentState: DialogContentState;
68
- declare type ShareDialogWithTriggerInternalProps = Props & WrappedComponentProps & WithAnalyticsEventsProps;
69
- export declare class ShareDialogWithTriggerInternal extends React.PureComponent<ShareDialogWithTriggerInternalProps, State> {
70
- static defaultProps: Partial<Props>;
5
+ import { ShareData, Integration, ShareDialogWithTriggerProps, ShareDialogWithTriggerStates } from '../types';
6
+ export declare const defaultShareContentState: ShareData;
7
+ declare type ShareDialogWithTriggerInternalProps = ShareDialogWithTriggerProps & WrappedComponentProps & WithAnalyticsEventsProps;
8
+ export declare class ShareDialogWithTriggerInternal extends React.PureComponent<ShareDialogWithTriggerInternalProps, ShareDialogWithTriggerStates> {
9
+ static defaultProps: Partial<ShareDialogWithTriggerProps>;
71
10
  private containerRef;
72
11
  /**
73
12
  * Because the PopUp component has a higher zIndex it causes
@@ -76,9 +15,9 @@ export declare class ShareDialogWithTriggerInternal extends React.PureComponent<
76
15
  */
77
16
  private selectPortalRef;
78
17
  private start;
79
- state: State;
18
+ state: ShareDialogWithTriggerStates;
80
19
  componentDidMount(): void;
81
- componentDidUpdate(prevProps: Props): void;
20
+ componentDidUpdate(prevProps: ShareDialogWithTriggerProps): void;
82
21
  private closeAndResetDialog;
83
22
  private createAndFireEvent;
84
23
  private onTabChange;
@@ -96,5 +35,5 @@ export declare class ShareDialogWithTriggerInternal extends React.PureComponent<
96
35
  handleCloseSplitButton: () => void;
97
36
  render(): JSX.Element;
98
37
  }
99
- export declare const ShareDialogWithTrigger: React.ComponentType<Props>;
38
+ export declare const ShareDialogWithTrigger: React.ComponentType<ShareDialogWithTriggerProps>;
100
39
  export {};
@@ -1,52 +1,11 @@
1
- import { LoadOptions, OptionData, Value } from '@atlaskit/user-picker';
2
1
  import React from 'react';
3
2
  import { WrappedComponentProps } from 'react-intl-next';
4
- import { Comment, ConfigResponse, DialogContentState, FormChildrenArgs, Integration, ProductName } from '../types';
5
- import { IntegrationMode } from '../types/ShareEntities';
3
+ import { FormChildrenArgs, ShareFormProps, ShareData } from '../types';
6
4
  interface FormWrapperType {
7
5
  isMainShare?: boolean;
8
6
  }
9
7
  export declare const FormWrapper: import("styled-components").StyledComponentClass<React.ClassAttributes<HTMLDivElement> & React.HTMLAttributes<HTMLDivElement> & FormWrapperType, any, React.ClassAttributes<HTMLDivElement> & React.HTMLAttributes<HTMLDivElement> & FormWrapperType>;
10
8
  export declare const FormFooter: import("styled-components").StyledComponentClass<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, any, React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>>;
11
- declare type ShareError = {
12
- message: string;
13
- };
14
- export declare type ShareData = {
15
- users: OptionData[];
16
- comment: Comment;
17
- };
18
- export declare type Props = {
19
- config?: ConfigResponse;
20
- isFetchingConfig?: boolean;
21
- copyLink: string;
22
- isSharing?: boolean;
23
- loadOptions?: LoadOptions;
24
- onLinkCopy?: (link: string) => void;
25
- onSubmit?: (data: ShareData) => void;
26
- shareError?: ShareError;
27
- submitButtonLabel?: React.ReactNode;
28
- title?: React.ReactNode;
29
- showTitle?: boolean;
30
- helperMessage?: string;
31
- onDismiss?: (data: ShareData) => void;
32
- defaultValue?: DialogContentState;
33
- product: ProductName;
34
- onUserInputChange?: (query?: string, sessionId?: string) => void;
35
- onTabChange?: (index: number) => void;
36
- enableSmartUserPicker?: boolean;
37
- loggedInAccountId?: string;
38
- cloudId?: string;
39
- onUserSelectionChange?: (value: Value) => void;
40
- fieldsFooter?: React.ReactNode;
41
- selectPortalRef?: React.Ref<HTMLDivElement>;
42
- isDisabled?: boolean;
43
- isPublicLink?: boolean;
44
- isSplitButton?: boolean;
45
- copyTooltipText?: string;
46
- integrationMode?: IntegrationMode;
47
- handleCloseDialog?: () => void;
48
- shareIntegrations?: Array<Integration>;
49
- };
50
- export declare type InternalFormProps = FormChildrenArgs<ShareData> & Props & WrappedComponentProps;
51
- export declare const ShareForm: React.FC<Props>;
9
+ export declare type InternalFormProps = FormChildrenArgs<ShareData> & ShareFormProps & WrappedComponentProps;
10
+ export declare const ShareForm: React.FC<ShareFormProps>;
52
11
  export {};
@@ -0,0 +1,9 @@
1
+ import { ReactNode } from 'react';
2
+ import { ShareDialogWithTriggerProps } from '../../types';
3
+ export declare type ShareFormWrapperProps = Pick<ShareDialogWithTriggerProps, 'shareFormTitle'> & {
4
+ shouldShowTitle?: boolean;
5
+ children?: ReactNode;
6
+ footer?: ReactNode;
7
+ };
8
+ declare const ShareFormWrapper: ({ shareFormTitle, shouldShowTitle, children, footer, }: ShareFormWrapperProps) => JSX.Element;
9
+ export default ShareFormWrapper;
@@ -0,0 +1 @@
1
+ export { default as ShareFormWrapper } from './ShareFormWrapper';
@@ -0,0 +1,9 @@
1
+ /// <reference types="react" />
2
+ export declare const InlineDialogFormWrapper: import("styled-components").StyledComponentClass<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, any, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>>;
3
+ /**
4
+ * Apply the same styling, as previous @atlaskit/inline-dialog had,
5
+ * compared to the @atlaskit/popup we are now using.
6
+ *
7
+ * packages/design-system/inline-dialog/src/InlineDialog/styled.ts:20:3
8
+ */
9
+ export declare const InlineDialogContentWrapper: import("styled-components").StyledComponentClass<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, any, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>>;
@@ -1,12 +1,5 @@
1
1
  import React from 'react';
2
2
  import { CustomThemeButtonProps } from '@atlaskit/button/types';
3
3
  export declare const MAX_PICKER_HEIGHT = 102;
4
- /**
5
- * Apply the same styling, as previous @atlaskit/inline-dialog had,
6
- * compared to the @atlaskit/popup we are now using.
7
- *
8
- * packages/design-system/inline-dialog/src/InlineDialog/styled.ts:20:3
9
- */
10
- export declare const InlineDialogContentWrapper: import("styled-components").StyledComponentClass<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, any, React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>>;
11
4
  declare const StyledButton: React.StatelessComponent<CustomThemeButtonProps>;
12
5
  export default StyledButton;
@@ -99,11 +99,6 @@ export declare const messages: {
99
99
  defaultMessage: string;
100
100
  description: string;
101
101
  };
102
- copyLinkButtonIconLabel: {
103
- id: string;
104
- defaultMessage: string;
105
- description: string;
106
- };
107
102
  copyLinkButtonText: {
108
103
  id: string;
109
104
  defaultMessage: string;
@@ -114,11 +109,6 @@ export declare const messages: {
114
109
  defaultMessage: string;
115
110
  description: string;
116
111
  };
117
- copiedToClipboardIconLabel: {
118
- id: string;
119
- defaultMessage: string;
120
- description: string;
121
- };
122
112
  copiedToClipboardMessage: {
123
113
  id: string;
124
114
  defaultMessage: string;
@@ -159,4 +149,14 @@ export declare const messages: {
159
149
  defaultMessage: string;
160
150
  description: string;
161
151
  };
152
+ shareMainTabTextJira: {
153
+ id: string;
154
+ defaultMessage: string;
155
+ description: string;
156
+ };
157
+ shareMainTabTextConfluence: {
158
+ id: string;
159
+ defaultMessage: string;
160
+ description: string;
161
+ };
162
162
  };
@@ -1,6 +1,3 @@
1
- export { ShareServiceClient } from './clients/ShareServiceClient';
2
- export type { ShareClient } from './clients/ShareServiceClient';
3
1
  export { ShareDialogContainer } from './components/ShareDialogContainer';
4
- export type { Props as ShareDialogContainerProps } from './components/ShareDialogContainer';
5
2
  export { ADMIN_NOTIFIED, OBJECT_SHARED, } from './types';
6
- export type { Comment, Content, DialogContentState, DialogPlacement, Flag, FlagType, FormChildrenArgs, KeysOfType, MessageDescriptor, MetaData, OriginAnalyticAttributes, OriginTracing, OriginTracingFactory, OriginTracingForSubSequentEvents, OriginTracingWithIdGenerated, ProductId, ProductName, RenderCustomTriggerButton, ShareButtonStyle, ShareContentState, ShareError, ShareRequest, ShareResponse, ConfigResponse, TooltipPosition, User, UserWithEmail, UserWithId, } from './types';
3
+ export type { Comment, Content, DialogContentState, DialogPlacement, Flag, FlagType, FormChildrenArgs, KeysOfType, MessageDescriptor, MetaData, OriginAnalyticAttributes, OriginTracing, OriginTracingFactory, OriginTracingForSubSequentEvents, OriginTracingWithIdGenerated, ProductId, ProductName, RenderCustomTriggerButton, ShareButtonStyle, ShareContentState, ShareError, ShareRequest, ShareResponse, ConfigResponse, TooltipPosition, User, UserWithEmail, UserWithId, ShareDialogContainerProps, } from './types';
@@ -8,7 +8,7 @@ export declare type ShareContentState = {
8
8
  export declare type ShareError = {
9
9
  message: string;
10
10
  };
11
- export declare type DialogContentState = {
11
+ export declare type ShareData = {
12
12
  users: OptionData[];
13
- comment?: Comment;
13
+ comment: Comment;
14
14
  };