@atlaskit/share 6.16.3 → 6.16.5
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 +14 -0
- package/afm-cc/tsconfig.json +2 -2
- package/afm-townsquare/tsconfig.json +99 -0
- package/clients/package.json +1 -1
- package/copy-link-button/package.json +1 -1
- package/dist/cjs/components/ShareDialogContainer.js +18 -5
- package/dist/cjs/components/analytics/analytics.js +12 -2
- package/dist/es2019/components/ShareDialogContainer.js +14 -1
- package/dist/es2019/components/analytics/analytics.js +9 -1
- package/dist/esm/components/ShareDialogContainer.js +19 -6
- package/dist/esm/components/analytics/analytics.js +11 -1
- package/dist/types/clients/AtlassianUrlShortenerClient.d.ts +2 -2
- package/dist/types/clients/ShareServiceClient.d.ts +1 -1
- package/dist/types/components/CopyLinkButton.d.ts +6 -6
- package/dist/types/components/CopyLinkButtonNext.d.ts +6 -6
- package/dist/types/components/ErrorBoundary.d.ts +1 -1
- package/dist/types/components/IntegrationButton.d.ts +1 -1
- package/dist/types/components/IntegrationButtonNext.d.ts +1 -1
- package/dist/types/components/IntegrationForm.d.ts +1 -1
- package/dist/types/components/LazyShareForm/LazyShareForm.d.ts +4 -4
- package/dist/types/components/LazyShareForm/LazyShareFormNext.d.ts +4 -4
- package/dist/types/components/ShareButton.d.ts +3 -3
- package/dist/types/components/ShareDialogContainer.d.ts +28 -28
- package/dist/types/components/ShareForm.d.ts +1 -1
- package/dist/types/components/ShareFormNext.d.ts +1 -1
- package/dist/types/components/ShareFormWrapper/ShareFormWrapper.d.ts +2 -2
- package/dist/types/components/ShareFormWrapper/compiled.d.ts +5 -5
- package/dist/types/components/ShareFormWrapper/styled.d.ts +5 -5
- package/dist/types/components/SplitButton.d.ts +6 -6
- package/dist/types/components/UserPickerField.d.ts +12 -12
- package/dist/types/components/analytics/analytics.d.ts +29 -21
- package/dist/types/types/Flag.d.ts +2 -2
- package/dist/types/types/OriginTracing.d.ts +1 -1
- package/dist/types/types/ShareContentState.d.ts +4 -4
- package/dist/types/types/ShareDialogContainer.d.ts +80 -81
- package/dist/types/types/ShareDialogWithTrigger.d.ts +12 -13
- package/dist/types/types/ShareEntities.d.ts +5 -6
- package/dist/types/types/ShareForm.d.ts +15 -16
- package/dist/types/types/User.d.ts +2 -2
- package/dist/types/types/UserPickerOptions.d.ts +12 -13
- package/dist/types/types/form.d.ts +0 -1
- package/dist/types-ts4.5/clients/AtlassianUrlShortenerClient.d.ts +2 -2
- package/dist/types-ts4.5/clients/ShareServiceClient.d.ts +1 -1
- package/dist/types-ts4.5/components/CopyLinkButton.d.ts +6 -6
- package/dist/types-ts4.5/components/CopyLinkButtonNext.d.ts +6 -6
- package/dist/types-ts4.5/components/ErrorBoundary.d.ts +1 -1
- package/dist/types-ts4.5/components/IntegrationButton.d.ts +1 -1
- package/dist/types-ts4.5/components/IntegrationButtonNext.d.ts +1 -1
- package/dist/types-ts4.5/components/IntegrationForm.d.ts +1 -1
- package/dist/types-ts4.5/components/LazyShareForm/LazyShareForm.d.ts +4 -4
- package/dist/types-ts4.5/components/LazyShareForm/LazyShareFormNext.d.ts +4 -4
- package/dist/types-ts4.5/components/ShareButton.d.ts +3 -3
- package/dist/types-ts4.5/components/ShareDialogContainer.d.ts +28 -28
- package/dist/types-ts4.5/components/ShareForm.d.ts +1 -1
- package/dist/types-ts4.5/components/ShareFormNext.d.ts +1 -1
- package/dist/types-ts4.5/components/ShareFormWrapper/ShareFormWrapper.d.ts +2 -2
- package/dist/types-ts4.5/components/ShareFormWrapper/compiled.d.ts +5 -5
- package/dist/types-ts4.5/components/ShareFormWrapper/styled.d.ts +5 -5
- package/dist/types-ts4.5/components/SplitButton.d.ts +6 -6
- package/dist/types-ts4.5/components/UserPickerField.d.ts +12 -12
- package/dist/types-ts4.5/components/analytics/analytics.d.ts +29 -21
- package/dist/types-ts4.5/types/Flag.d.ts +2 -2
- package/dist/types-ts4.5/types/OriginTracing.d.ts +1 -1
- package/dist/types-ts4.5/types/ShareContentState.d.ts +4 -4
- package/dist/types-ts4.5/types/ShareDialogContainer.d.ts +80 -81
- package/dist/types-ts4.5/types/ShareDialogWithTrigger.d.ts +12 -13
- package/dist/types-ts4.5/types/ShareEntities.d.ts +5 -6
- package/dist/types-ts4.5/types/ShareForm.d.ts +15 -16
- package/dist/types-ts4.5/types/User.d.ts +2 -2
- package/dist/types-ts4.5/types/UserPickerOptions.d.ts +12 -13
- package/dist/types-ts4.5/types/form.d.ts +0 -1
- package/package.json +11 -8
|
@@ -6,9 +6,9 @@ import type { OriginTracing, OriginTracingFactory, ShareData, ShareDialogContain
|
|
|
6
6
|
export declare const defaultConfig: ConfigResponse;
|
|
7
7
|
export type State = {
|
|
8
8
|
config?: ConfigResponse;
|
|
9
|
+
currentPageUrl: string;
|
|
9
10
|
isFetchingConfig: boolean;
|
|
10
11
|
shareActionCount: number;
|
|
11
|
-
currentPageUrl: string;
|
|
12
12
|
shortenedCopyLink: null | string;
|
|
13
13
|
shortenedCopyLinkData?: ShortenRequest;
|
|
14
14
|
};
|
|
@@ -49,8 +49,8 @@ export declare class ShareDialogContainerInternal extends React.Component<ShareD
|
|
|
49
49
|
}
|
|
50
50
|
export declare const ShareDialogContainer: React.ForwardRefExoticComponent<Omit<Pick<Omit<ShareDialogContainerProps, keyof WithAnalyticsEventsProps>, never> & {
|
|
51
51
|
integrationMode?: import("../types/ShareEntities").IntegrationMode | undefined;
|
|
52
|
-
shareIntegrations?: import("../types").Integration
|
|
53
|
-
additionalTabs?: import("../types").AdditionalTab
|
|
52
|
+
shareIntegrations?: Array<import("../types").Integration> | undefined;
|
|
53
|
+
additionalTabs?: Array<import("../types").AdditionalTab> | undefined;
|
|
54
54
|
builtInTabContentWidth?: number | undefined;
|
|
55
55
|
copyTooltipText?: string | undefined;
|
|
56
56
|
isPublicLink?: boolean | undefined;
|
|
@@ -65,49 +65,49 @@ export declare const ShareDialogContainer: React.ForwardRefExoticComponent<Omit<
|
|
|
65
65
|
additionalUserFields?: React.ReactNode;
|
|
66
66
|
isExtendedShareDialogEnabled?: boolean | undefined;
|
|
67
67
|
CustomSubmitButton?: React.FC<import("../types").RenderCustomSubmitButtonProps> | undefined;
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
urlShortenerClient?: UrlShortenerClient | undefined;
|
|
74
|
-
shortLinkData?: ShortenRequest | undefined;
|
|
75
|
-
dialogPlacement?: import("@popperjs/core").Placement | undefined;
|
|
68
|
+
bottomMessage?: React.ReactNode;
|
|
69
|
+
customFooter?: React.ReactNode;
|
|
70
|
+
customHeader?: React.ReactNode;
|
|
71
|
+
customTriggerButtonIcon?: React.ComponentType<import("@atlaskit/icon").NewCoreIconProps> | undefined;
|
|
72
|
+
dialogPlacement?: import("../types").DialogPlacement | undefined;
|
|
76
73
|
dialogZIndex?: number | undefined;
|
|
77
74
|
formatCopyLink?: ((origin: OriginTracing, link: string) => string) | undefined;
|
|
75
|
+
isAutoOpenDialog?: boolean | undefined;
|
|
76
|
+
isCopyDisabled?: boolean | undefined;
|
|
77
|
+
isMenuItemSelected?: boolean | undefined;
|
|
78
|
+
isSubmitShareDisabled?: boolean | undefined;
|
|
78
79
|
loadUserOptions?: import("@atlaskit/user-picker").LoadOptions | undefined;
|
|
80
|
+
onDialogClose?: (() => void) | undefined;
|
|
81
|
+
onDialogOpen?: (() => void) | undefined;
|
|
82
|
+
onSubmit?: ((formValues: ShareData) => void | Promise<void>) | undefined;
|
|
83
|
+
onTriggerButtonClick?: (() => void) | undefined;
|
|
79
84
|
originTracingFactory?: OriginTracingFactory | undefined;
|
|
85
|
+
product?: import("../types").ProductName | undefined;
|
|
80
86
|
productId?: import("../types").ProductId | undefined;
|
|
81
87
|
renderCustomTriggerButton?: import("../types").RenderCustomTriggerButton | undefined;
|
|
82
|
-
customTriggerButtonIcon?: React.ComponentType<import("@atlaskit/icon").NewCoreIconProps> | undefined;
|
|
83
88
|
shareAri?: string | undefined;
|
|
84
|
-
|
|
85
|
-
shareContentSubType?: string | undefined;
|
|
89
|
+
shareClient?: ShareClient | undefined;
|
|
86
90
|
shareContentId?: string | undefined;
|
|
91
|
+
shareContentSubType?: string | undefined;
|
|
92
|
+
shareContentType?: string | undefined;
|
|
93
|
+
shareeAction?: "view" | "edit" | undefined;
|
|
94
|
+
shareFieldsFooter?: React.ReactNode;
|
|
95
|
+
shareFormHelperMessage?: string | undefined;
|
|
96
|
+
shareFormTitle?: React.ReactNode;
|
|
87
97
|
shareLink?: string | undefined;
|
|
88
98
|
shareTitle?: string | undefined;
|
|
89
|
-
|
|
90
|
-
shareFormHelperMessage?: string | undefined;
|
|
99
|
+
shortLinkData?: ShortenRequest | undefined;
|
|
91
100
|
shouldCloseOnEscapePress?: boolean | undefined;
|
|
92
|
-
showFlags?: ((flags: import("../types").Flag
|
|
101
|
+
showFlags?: ((flags: Array<import("../types").Flag>) => void) | undefined;
|
|
102
|
+
tabIndex?: number | undefined;
|
|
93
103
|
triggerButtonAppearance?: "default" | "subtle" | "primary" | "discovery" | undefined;
|
|
94
104
|
triggerButtonIcon?: React.ComponentType<import("@atlaskit/icon").NewCoreIconProps> | undefined;
|
|
95
105
|
triggerButtonStyle?: import("../types").ShareButtonStyle | undefined;
|
|
96
106
|
triggerButtonTooltipPosition?: import("../types").TooltipPosition | undefined;
|
|
97
107
|
triggerButtonTooltipText?: React.ReactNode;
|
|
98
|
-
|
|
108
|
+
urlShortenerClient?: UrlShortenerClient | undefined;
|
|
99
109
|
useUrlShortener?: boolean | undefined;
|
|
100
|
-
shareeAction?: "view" | "edit" | undefined;
|
|
101
|
-
product?: import("../types").ProductName | undefined;
|
|
102
|
-
customHeader?: React.ReactNode;
|
|
103
|
-
customFooter?: React.ReactNode;
|
|
104
|
-
shareFieldsFooter?: React.ReactNode;
|
|
105
|
-
isCopyDisabled?: boolean | undefined;
|
|
106
|
-
isMenuItemSelected?: boolean | undefined;
|
|
107
|
-
tabIndex?: number | undefined;
|
|
108
110
|
workspaceAri?: string | undefined;
|
|
109
|
-
isSubmitShareDisabled?: boolean | undefined;
|
|
110
|
-
onSubmit?: ((formValues: ShareData) => void | Promise<void>) | undefined;
|
|
111
111
|
} & {
|
|
112
112
|
createAnalyticsEvent?: import("@atlaskit/analytics-next").CreateUIAnalyticsEvent | undefined;
|
|
113
113
|
ref?: React.Ref<any> | undefined;
|
|
@@ -8,8 +8,8 @@ import { type FormChildrenArgs, type MenuType, type ShareData, type ShareFormPro
|
|
|
8
8
|
export declare const formWrapperStyles: import("@emotion/react").SerializedStyles;
|
|
9
9
|
export declare const formFooterStyles: import("@emotion/react").SerializedStyles;
|
|
10
10
|
export type State = {
|
|
11
|
-
selectedTab: TabType;
|
|
12
11
|
selectedMenuItem: MenuType;
|
|
12
|
+
selectedTab: TabType;
|
|
13
13
|
};
|
|
14
14
|
export type InternalFormProps = FormChildrenArgs<ShareData> & ShareFormProps & WrappedComponentProps;
|
|
15
15
|
export declare const ShareForm: React.FC<ShareFormProps>;
|
|
@@ -2,8 +2,8 @@ import React from 'react';
|
|
|
2
2
|
import { type WrappedComponentProps } from 'react-intl-next';
|
|
3
3
|
import { type FormChildrenArgs, type MenuType, type ShareData, type ShareFormProps, TabType } from '../types';
|
|
4
4
|
export type State = {
|
|
5
|
-
selectedTab: TabType;
|
|
6
5
|
selectedMenuItem: MenuType;
|
|
6
|
+
selectedTab: TabType;
|
|
7
7
|
};
|
|
8
8
|
export type InternalFormProps = FormChildrenArgs<ShareData> & ShareFormProps & WrappedComponentProps;
|
|
9
9
|
export declare const ShareForm: React.FC<ShareFormProps>;
|
|
@@ -2,12 +2,12 @@ import React, { type ReactNode } from 'react';
|
|
|
2
2
|
import { type ShareDialogWithTriggerProps } from '../../types';
|
|
3
3
|
import { type IntegrationMode } from '../../types/ShareEntities';
|
|
4
4
|
export type ShareFormWrapperProps = Pick<ShareDialogWithTriggerProps, 'shareFormTitle' | 'isExtendedShareDialogEnabled'> & {
|
|
5
|
-
shouldShowTitle?: boolean;
|
|
6
5
|
children?: ReactNode;
|
|
7
|
-
header?: ReactNode;
|
|
8
6
|
footer?: ReactNode;
|
|
7
|
+
header?: ReactNode;
|
|
9
8
|
integrationMode?: IntegrationMode;
|
|
10
9
|
isMenuItemSelected?: boolean;
|
|
10
|
+
shouldShowTitle?: boolean;
|
|
11
11
|
};
|
|
12
12
|
declare const ShareFormWrapper: ({ shareFormTitle, shouldShowTitle, children, header, footer, integrationMode, isMenuItemSelected, isExtendedShareDialogEnabled, }: ShareFormWrapperProps) => React.JSX.Element;
|
|
13
13
|
export default ShareFormWrapper;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type IntegrationMode } from '../../types/ShareEntities';
|
|
3
3
|
export declare const InlineDialogFormWrapper: ({ children, integrationMode, isMenuItemSelected, isExtendedShareDialogEnabled, }: React.PropsWithChildren<{
|
|
4
|
-
integrationMode?: IntegrationMode
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
integrationMode?: IntegrationMode;
|
|
5
|
+
isExtendedShareDialogEnabled?: boolean;
|
|
6
|
+
isMenuItemSelected?: boolean;
|
|
7
7
|
}>) => React.JSX.Element;
|
|
8
8
|
export declare const InlineDialogContentWrapper: ({ children, label, isExtendedShareDialogEnabled, }: {
|
|
9
9
|
children: React.ReactNode;
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
isExtendedShareDialogEnabled?: boolean;
|
|
11
|
+
label?: string;
|
|
12
12
|
}) => React.JSX.Element;
|
|
@@ -6,9 +6,9 @@ import { type PropsWithChildren } from 'react';
|
|
|
6
6
|
import { jsx } from '@emotion/react';
|
|
7
7
|
import { type IntegrationMode } from '../../types/ShareEntities';
|
|
8
8
|
export declare const InlineDialogFormWrapper: ({ children, integrationMode, isMenuItemSelected, isExtendedShareDialogEnabled, }: PropsWithChildren<{
|
|
9
|
-
integrationMode?: IntegrationMode
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
integrationMode?: IntegrationMode;
|
|
10
|
+
isExtendedShareDialogEnabled?: boolean;
|
|
11
|
+
isMenuItemSelected?: boolean;
|
|
12
12
|
}>) => jsx.JSX.Element;
|
|
13
13
|
/**
|
|
14
14
|
* Apply the same styling, as previous @atlaskit/inline-dialog had,
|
|
@@ -17,6 +17,6 @@ export declare const InlineDialogFormWrapper: ({ children, integrationMode, isMe
|
|
|
17
17
|
* packages/design-system/inline-dialog/src/InlineDialog/styled.ts:20:3
|
|
18
18
|
*/
|
|
19
19
|
export declare const InlineDialogContentWrapper: ({ children, label, isExtendedShareDialogEnabled, }: PropsWithChildren<{
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
isExtendedShareDialogEnabled?: boolean;
|
|
21
|
+
label?: string;
|
|
22
22
|
}>) => jsx.JSX.Element;
|
|
@@ -7,16 +7,16 @@ import { type AnalyticsEventPayload } from '@atlaskit/analytics-next';
|
|
|
7
7
|
import { type IconButtonProps } from '@atlaskit/button/new';
|
|
8
8
|
import { type DialogPlacement, type Integration } from '../types';
|
|
9
9
|
type SplitButtonProps = {
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
createAndFireEvent: (payload: AnalyticsEventPayload) => void;
|
|
11
|
+
dialogPlacement?: DialogPlacement;
|
|
12
|
+
dialogZIndex?: number;
|
|
12
13
|
handleCloseSplitButton: () => void;
|
|
14
|
+
handleOpenSplitButton: () => void;
|
|
13
15
|
isUsingSplitButton: boolean;
|
|
14
|
-
shareIntegrations: Array<Integration>;
|
|
15
16
|
onIntegrationClick: (integration: Integration) => void;
|
|
17
|
+
shareButton: React.ReactNode;
|
|
18
|
+
shareIntegrations: Array<Integration>;
|
|
16
19
|
triggerButtonAppearance?: IconButtonProps['appearance'];
|
|
17
|
-
dialogZIndex?: number;
|
|
18
|
-
dialogPlacement?: DialogPlacement;
|
|
19
|
-
createAndFireEvent: (payload: AnalyticsEventPayload) => void;
|
|
20
20
|
};
|
|
21
21
|
export default function SplitButton({ shareButton, handleOpenSplitButton, handleCloseSplitButton, isUsingSplitButton, shareIntegrations, onIntegrationClick, triggerButtonAppearance, createAndFireEvent, }: SplitButtonProps): JSX.Element;
|
|
22
22
|
export {};
|
|
@@ -4,25 +4,25 @@ import { type LoadOptions, type OptionData, type Props as SmartUserPickerProps,
|
|
|
4
4
|
import { type ConfigResponse, type ProductName, type ShareError, type UserPickerOptions } from '../types';
|
|
5
5
|
export declare const REQUIRED = "REQUIRED";
|
|
6
6
|
export type Props = {
|
|
7
|
-
|
|
8
|
-
defaultValue?: OptionData[];
|
|
7
|
+
cloudId?: string;
|
|
9
8
|
config?: ConfigResponse;
|
|
10
|
-
|
|
11
|
-
product: ProductName;
|
|
12
|
-
onInputChange?: (query?: string, sessionId?: string) => void;
|
|
9
|
+
defaultValue?: OptionData[];
|
|
13
10
|
enableSmartUserPicker?: boolean;
|
|
11
|
+
helperMessage?: string;
|
|
12
|
+
isBrowseUsersDisabled?: boolean;
|
|
13
|
+
isExtendedShareDialogEnabled?: boolean;
|
|
14
|
+
isLoading?: boolean;
|
|
15
|
+
isPublicLink?: boolean;
|
|
16
|
+
loadOptions?: LoadOptions;
|
|
14
17
|
loggedInAccountId?: string;
|
|
15
|
-
cloudId?: string;
|
|
16
18
|
onChange?: (value: Value) => void;
|
|
17
|
-
|
|
18
|
-
isPublicLink?: boolean;
|
|
19
|
-
helperMessage?: string;
|
|
19
|
+
onInputChange?: (query?: string, sessionId?: string) => void;
|
|
20
20
|
orgId?: string;
|
|
21
|
-
|
|
21
|
+
product: ProductName;
|
|
22
|
+
productAttributes?: SmartUserPickerProps['productAttributes'];
|
|
23
|
+
selectPortalRef?: React.Ref<HTMLDivElement>;
|
|
22
24
|
shareError?: ShareError;
|
|
23
25
|
userPickerOptions?: UserPickerOptions;
|
|
24
|
-
productAttributes?: SmartUserPickerProps['productAttributes'];
|
|
25
|
-
isExtendedShareDialogEnabled?: boolean;
|
|
26
26
|
};
|
|
27
27
|
export declare class UserPickerFieldComponent extends React.Component<WrappedComponentProps & Props> {
|
|
28
28
|
private loadOptions;
|
|
@@ -17,34 +17,42 @@ export declare const shareMenuItemClicked: (subjectId: MenuItemSubjectIdType, sh
|
|
|
17
17
|
export declare const cancelShare: (start: number) => AnalyticsEventPayload;
|
|
18
18
|
export declare const shortUrlRequested: () => AnalyticsEventPayload;
|
|
19
19
|
export declare const shortUrlGenerated: (start: number, tooSlow: boolean) => AnalyticsEventPayload;
|
|
20
|
+
export declare const shareConfigurationLoaded: (attributes: {
|
|
21
|
+
disableSharingToEmails: boolean | undefined;
|
|
22
|
+
durationMs: number;
|
|
23
|
+
}) => AnalyticsEventPayload;
|
|
24
|
+
export declare const shareConfigurationLoadFailed: (attributes: {
|
|
25
|
+
durationMs: number;
|
|
26
|
+
statusCode: string | number | undefined;
|
|
27
|
+
}) => AnalyticsEventPayload;
|
|
20
28
|
export declare const copyLinkButtonClicked: ({ start, shareContentType, shareContentSubType, shareContentId, shareOrigin, isPublicLink, ari, }: {
|
|
29
|
+
ari?: string;
|
|
30
|
+
isPublicLink?: boolean;
|
|
31
|
+
shareContentId?: string;
|
|
32
|
+
shareContentSubType?: string;
|
|
33
|
+
shareContentType?: string;
|
|
34
|
+
shareOrigin?: OriginTracing;
|
|
21
35
|
start: number;
|
|
22
|
-
shareContentType?: string | undefined;
|
|
23
|
-
shareContentSubType?: string | undefined;
|
|
24
|
-
shareContentId?: string | undefined;
|
|
25
|
-
shareOrigin?: OriginTracing | undefined;
|
|
26
|
-
isPublicLink?: boolean | undefined;
|
|
27
|
-
ari?: string | undefined;
|
|
28
36
|
}) => AnalyticsEventPayload;
|
|
29
37
|
export declare const formShareSubmitted: ({ start, data, shareContentType, shareContentSubType, shareContentId, shareOrigin, isPublicLink, }: {
|
|
30
|
-
start: number;
|
|
31
38
|
data: DialogContentState;
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
39
|
+
isPublicLink?: boolean;
|
|
40
|
+
shareContentId?: string;
|
|
41
|
+
shareContentSubType?: string;
|
|
42
|
+
shareContentType?: string;
|
|
43
|
+
shareOrigin?: OriginTracing;
|
|
44
|
+
start: number;
|
|
37
45
|
}) => AnalyticsEventPayload;
|
|
38
46
|
export declare const jiraPageSharedEvent: ({ start, data, shareContentType, shareContentSubType, shareContentId, shareOrigin, isPublicLink, productAttributes, loggedInAccountId, source, actionSubjectId, }: {
|
|
39
|
-
|
|
47
|
+
actionSubjectId?: string;
|
|
40
48
|
data: DialogContentState;
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
shareContentId?: string | undefined;
|
|
44
|
-
shareOrigin?: OriginTracing | undefined;
|
|
45
|
-
isPublicLink?: boolean | undefined;
|
|
49
|
+
isPublicLink?: boolean;
|
|
50
|
+
loggedInAccountId?: string;
|
|
46
51
|
productAttributes?: any;
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
52
|
+
shareContentId?: string;
|
|
53
|
+
shareContentSubType?: string;
|
|
54
|
+
shareContentType?: string;
|
|
55
|
+
shareOrigin?: OriginTracing;
|
|
56
|
+
source?: string;
|
|
57
|
+
start: number;
|
|
50
58
|
}) => AnalyticsEventPayload;
|
|
@@ -2,9 +2,9 @@ export declare const OBJECT_SHARED = "object-shared";
|
|
|
2
2
|
export declare const ADMIN_NOTIFIED = "admin-notified";
|
|
3
3
|
export type FlagType = 'object-shared' | 'admin-notified';
|
|
4
4
|
export type MessageDescriptor = {
|
|
5
|
-
id: string;
|
|
6
|
-
description: string;
|
|
7
5
|
defaultMessage: string;
|
|
6
|
+
description: string;
|
|
7
|
+
id: string;
|
|
8
8
|
};
|
|
9
9
|
export type Flag = {
|
|
10
10
|
appearance: 'success';
|
|
@@ -10,8 +10,8 @@ export type OriginAnalyticAttributes = {
|
|
|
10
10
|
hasGeneratedId: boolean;
|
|
11
11
|
};
|
|
12
12
|
export type OriginTracing = {
|
|
13
|
-
id: string;
|
|
14
13
|
addToUrl: (link: string) => string;
|
|
14
|
+
id: string;
|
|
15
15
|
toAnalyticsAttributes: (attrs: OriginAnalyticAttributes) => OriginTracingWithIdGenerated | OriginTracingForSubSequentEvents;
|
|
16
16
|
};
|
|
17
17
|
export type OriginTracingFactory = () => OriginTracing;
|
|
@@ -2,17 +2,17 @@ import { type OptionData } from '@atlaskit/smart-user-picker';
|
|
|
2
2
|
import { type Comment } from './ShareEntities';
|
|
3
3
|
import { type User } from './User';
|
|
4
4
|
export type ShareContentState = {
|
|
5
|
-
users: User[];
|
|
6
5
|
comment?: Comment;
|
|
6
|
+
users: User[];
|
|
7
7
|
};
|
|
8
8
|
export type ShareError = {
|
|
9
|
-
message: string;
|
|
10
9
|
errorCode?: string;
|
|
11
10
|
helpUrl?: string;
|
|
11
|
+
message: string;
|
|
12
12
|
retryable: boolean;
|
|
13
13
|
};
|
|
14
14
|
export type ShareData = {
|
|
15
|
-
users: OptionData[];
|
|
16
|
-
comment: Comment;
|
|
17
15
|
[key: string]: unknown;
|
|
16
|
+
comment: Comment;
|
|
17
|
+
users: OptionData[];
|
|
18
18
|
};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import type { IconButtonProps } from '@atlaskit/button/new';
|
|
3
2
|
import type { NewCoreIconProps } from '@atlaskit/icon';
|
|
4
3
|
import type { LoadOptions, Props as SmartUserPickerProps, Value } from '@atlaskit/smart-user-picker';
|
|
@@ -14,25 +13,26 @@ import type { AdditionalTab, Integration, IntegrationMode } from './ShareEntitie
|
|
|
14
13
|
import type { RenderCustomSubmitButtonProps } from './ShareForm';
|
|
15
14
|
import type { UserPickerOptions } from './UserPickerOptions';
|
|
16
15
|
export type ShareDialogContainerProps = {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
* Optional, a default one is provided. */
|
|
23
|
-
shareClient?: ShareClient;
|
|
24
|
-
/** URL Shortener service client implementation that may shorten links for copy.
|
|
25
|
-
* Optional, a default one is provided. */
|
|
26
|
-
urlShortenerClient?: UrlShortenerClient;
|
|
27
|
-
/** Data provided to the `urlShortenerClient` to shorten the shared URL.
|
|
28
|
-
* If it is not provided, the link will not be shortened.
|
|
29
|
-
* If link shortening fails, the full URL will be shared instead. */
|
|
30
|
-
shortLinkData?: ShortenRequest;
|
|
16
|
+
additionalTabs?: Array<AdditionalTab>;
|
|
17
|
+
additionalUserFields?: React.ReactNode;
|
|
18
|
+
/** Message to be appended to the modal. */
|
|
19
|
+
bottomMessage?: React.ReactNode;
|
|
20
|
+
builtInTabContentWidth?: number;
|
|
31
21
|
/** Cloud ID of the instance.
|
|
32
22
|
* Note: we assume this props is stable. */
|
|
33
23
|
cloudId: string;
|
|
34
|
-
|
|
35
|
-
|
|
24
|
+
copyTooltipText?: string;
|
|
25
|
+
/**
|
|
26
|
+
* Footer for the share dialog.
|
|
27
|
+
*/
|
|
28
|
+
customFooter?: React.ReactNode;
|
|
29
|
+
/**
|
|
30
|
+
* Header for the share dialog.
|
|
31
|
+
*/
|
|
32
|
+
customHeader?: React.ReactNode;
|
|
33
|
+
CustomSubmitButton?: React.FC<RenderCustomSubmitButtonProps>;
|
|
34
|
+
/** An Icon used for the custom Share Dialog Trigger Button */
|
|
35
|
+
customTriggerButtonIcon?: React.ComponentType<NewCoreIconProps>;
|
|
36
36
|
/** Placement of the modal to the trigger button. */
|
|
37
37
|
dialogPlacement?: DialogPlacement;
|
|
38
38
|
/**
|
|
@@ -41,22 +41,63 @@ export type ShareDialogContainerProps = {
|
|
|
41
41
|
* Defaults to `layers.modal()` from `@atlaskit/theme`.
|
|
42
42
|
*/
|
|
43
43
|
dialogZIndex?: number;
|
|
44
|
+
/**
|
|
45
|
+
* Power the user picker with smarts. To enable smart user picker, the following props are used:
|
|
46
|
+
* - `product`: 'jira' or 'confluence'
|
|
47
|
+
* - `loggedInAccountId`: if not provided, defaults to obtaining from request context
|
|
48
|
+
* - `cloudId`
|
|
49
|
+
*/
|
|
50
|
+
enableSmartUserPicker?: boolean;
|
|
44
51
|
/** Transform function to provide custom formatted copy link.
|
|
45
52
|
* Optional, a default one is provided. */
|
|
46
53
|
formatCopyLink?: (origin: OriginTracing, link: string) => string;
|
|
54
|
+
integrationMode?: IntegrationMode;
|
|
55
|
+
isAutoOpenDialog?: boolean;
|
|
56
|
+
isBrowseUsersDisabled?: boolean;
|
|
57
|
+
isCopyDisabled?: boolean;
|
|
58
|
+
isExtendedShareDialogEnabled?: boolean;
|
|
59
|
+
isMenuItemSelected?: boolean;
|
|
60
|
+
isPublicLink?: boolean;
|
|
61
|
+
isSubmitShareDisabled?: boolean;
|
|
47
62
|
/** Function used to load users options asynchronously. Not needed if smart user picker is enabled. */
|
|
48
63
|
loadUserOptions?: LoadOptions;
|
|
64
|
+
/**
|
|
65
|
+
* The userId of the sharer. If not provided, smart user picker
|
|
66
|
+
* defaults it to the value 'Context'
|
|
67
|
+
* which will tell the recommendation service to extract the
|
|
68
|
+
* value from the request context.
|
|
69
|
+
*/
|
|
70
|
+
loggedInAccountId?: string;
|
|
71
|
+
onDialogClose?: () => void;
|
|
72
|
+
onDialogOpen?: () => void;
|
|
73
|
+
onSubmit?: (formValues: ShareData) => void | Promise<void>;
|
|
74
|
+
onTriggerButtonClick?: () => void;
|
|
75
|
+
onUserSelectionChange?: (value: Value) => void;
|
|
76
|
+
/** Organisation ID of the instance. */
|
|
77
|
+
orgId?: string;
|
|
49
78
|
/** Factory function to generate new Origin Tracing instance. */
|
|
50
79
|
originTracingFactory: OriginTracingFactory;
|
|
80
|
+
/**
|
|
81
|
+
* Optional, this prop can be `jira` or `confluence`. Default value is `confluence`.
|
|
82
|
+
* We use this prop to control different text messages in UI.
|
|
83
|
+
*/
|
|
84
|
+
product?: ProductName;
|
|
85
|
+
productAttributes?: SmartUserPickerProps['productAttributes'];
|
|
51
86
|
/** Product ID (Canonical ID) in ARI of the share request.
|
|
52
87
|
* Note: we assume this props is stable. */
|
|
53
88
|
productId: ProductId;
|
|
54
89
|
/** Render function for a custom Share Dialog Trigger Button. */
|
|
55
90
|
renderCustomTriggerButton?: RenderCustomTriggerButton;
|
|
56
|
-
/** An Icon used for the custom Share Dialog Trigger Button */
|
|
57
|
-
customTriggerButtonIcon?: React.ComponentType<NewCoreIconProps>;
|
|
58
91
|
/** Atlassian Resource Identifier of a Site resource to be shared. */
|
|
59
92
|
shareAri: string;
|
|
93
|
+
/** Share service client implementation that gets share configs and performs share.
|
|
94
|
+
* Optional, a default one is provided. */
|
|
95
|
+
shareClient?: ShareClient;
|
|
96
|
+
/** Content ID of the resource to be shared. Optional. */
|
|
97
|
+
shareContentId?: string;
|
|
98
|
+
/** Content SubType of the resource to be shared. Optional. */
|
|
99
|
+
/** embed */
|
|
100
|
+
shareContentSubType?: string;
|
|
60
101
|
/** 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:*/
|
|
61
102
|
/** blogpost */
|
|
62
103
|
/** board */
|
|
@@ -77,22 +118,25 @@ export type ShareDialogContainerProps = {
|
|
|
77
118
|
/** space */
|
|
78
119
|
/** Any other unlisted type will have a default message of "Link shared". */
|
|
79
120
|
shareContentType: string;
|
|
80
|
-
/**
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
/**
|
|
84
|
-
|
|
121
|
+
/** Action that will be performed by the recipient when he/she receives the notification. */
|
|
122
|
+
shareeAction?: 'view' | 'edit';
|
|
123
|
+
shareFieldsFooter?: React.ReactNode;
|
|
124
|
+
/** Copy for helper message to be displayed under share form input box.
|
|
125
|
+
* If set to empty string, no helper message will be displayed
|
|
126
|
+
*/
|
|
127
|
+
shareFormHelperMessage?: string;
|
|
128
|
+
/** Title of the share modal. */
|
|
129
|
+
shareFormTitle?: React.ReactNode;
|
|
130
|
+
shareIntegrations?: Array<Integration>;
|
|
85
131
|
/** Link of the resource to be shared (should NOT includes origin tracing).
|
|
86
132
|
* Optional, the current page URL is used by default. */
|
|
87
133
|
shareLink?: string;
|
|
88
134
|
/** Title of the resource to be shared that will be sent in notifications. */
|
|
89
135
|
shareTitle: string;
|
|
90
|
-
/**
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
*/
|
|
95
|
-
shareFormHelperMessage?: string;
|
|
136
|
+
/** Data provided to the `urlShortenerClient` to shorten the shared URL.
|
|
137
|
+
* If it is not provided, the link will not be shortened.
|
|
138
|
+
* If link shortening fails, the full URL will be shared instead. */
|
|
139
|
+
shortLinkData?: ShortenRequest;
|
|
96
140
|
/** To enable closing the modal on escape key press. */
|
|
97
141
|
shouldCloseOnEscapePress?: boolean;
|
|
98
142
|
/**
|
|
@@ -101,19 +145,9 @@ export type ShareDialogContainerProps = {
|
|
|
101
145
|
*/
|
|
102
146
|
showFlags: (flags: Array<Flag>) => void;
|
|
103
147
|
/**
|
|
104
|
-
*
|
|
105
|
-
* - `product`: 'jira' or 'confluence'
|
|
106
|
-
* - `loggedInAccountId`: if not provided, defaults to obtaining from request context
|
|
107
|
-
* - `cloudId`
|
|
108
|
-
*/
|
|
109
|
-
enableSmartUserPicker?: boolean;
|
|
110
|
-
/**
|
|
111
|
-
* The userId of the sharer. If not provided, smart user picker
|
|
112
|
-
* defaults it to the value 'Context'
|
|
113
|
-
* which will tell the recommendation service to extract the
|
|
114
|
-
* value from the request context.
|
|
148
|
+
* Optionally sets a tabIndex value if you need to set focus
|
|
115
149
|
*/
|
|
116
|
-
|
|
150
|
+
tabIndex?: number;
|
|
117
151
|
/** Appearance of the share modal trigger button */
|
|
118
152
|
triggerButtonAppearance?: IconButtonProps['appearance'];
|
|
119
153
|
/** Share button Icon */
|
|
@@ -124,49 +158,14 @@ export type ShareDialogContainerProps = {
|
|
|
124
158
|
triggerButtonTooltipPosition?: TooltipPosition;
|
|
125
159
|
/** Custom text of the tooltip on share modal trigger button. */
|
|
126
160
|
triggerButtonTooltipText?: React.ReactNode;
|
|
127
|
-
/**
|
|
128
|
-
|
|
161
|
+
/** URL Shortener service client implementation that may shorten links for copy.
|
|
162
|
+
* Optional, a default one is provided. */
|
|
163
|
+
urlShortenerClient?: UrlShortenerClient;
|
|
164
|
+
userPickerOptions?: UserPickerOptions;
|
|
129
165
|
/** @deprecated Use the `shortLinkData` prop instead.
|
|
130
166
|
*
|
|
131
167
|
* Whether we should use the Atlassian Url Shortener or not.
|
|
132
168
|
* Note that all products may not be supported. */
|
|
133
169
|
useUrlShortener?: boolean;
|
|
134
|
-
/** Action that will be performed by the recipient when he/she receives the notification. */
|
|
135
|
-
shareeAction?: 'view' | 'edit';
|
|
136
|
-
/**
|
|
137
|
-
* Optional, this prop can be `jira` or `confluence`. Default value is `confluence`.
|
|
138
|
-
* We use this prop to control different text messages in UI.
|
|
139
|
-
*/
|
|
140
|
-
product?: ProductName;
|
|
141
|
-
productAttributes?: SmartUserPickerProps['productAttributes'];
|
|
142
|
-
/**
|
|
143
|
-
* Header for the share dialog.
|
|
144
|
-
*/
|
|
145
|
-
customHeader?: React.ReactNode;
|
|
146
|
-
/**
|
|
147
|
-
* Footer for the share dialog.
|
|
148
|
-
*/
|
|
149
|
-
customFooter?: React.ReactNode;
|
|
150
|
-
userPickerOptions?: UserPickerOptions;
|
|
151
|
-
onUserSelectionChange?: (value: Value) => void;
|
|
152
|
-
shareFieldsFooter?: React.ReactNode;
|
|
153
|
-
isCopyDisabled?: boolean;
|
|
154
|
-
isPublicLink?: boolean;
|
|
155
|
-
integrationMode?: IntegrationMode;
|
|
156
|
-
isMenuItemSelected?: boolean;
|
|
157
|
-
shareIntegrations?: Array<Integration>;
|
|
158
|
-
additionalTabs?: Array<AdditionalTab>;
|
|
159
|
-
builtInTabContentWidth?: number;
|
|
160
|
-
/**
|
|
161
|
-
* Optionally sets a tabIndex value if you need to set focus
|
|
162
|
-
*/
|
|
163
|
-
tabIndex?: number;
|
|
164
|
-
copyTooltipText?: string;
|
|
165
|
-
isBrowseUsersDisabled?: boolean;
|
|
166
170
|
workspaceAri?: string;
|
|
167
|
-
isSubmitShareDisabled?: boolean;
|
|
168
|
-
isExtendedShareDialogEnabled?: boolean;
|
|
169
|
-
additionalUserFields?: React.ReactNode;
|
|
170
|
-
onSubmit?: (formValues: ShareData) => void | Promise<void>;
|
|
171
|
-
CustomSubmitButton?: React.FC<RenderCustomSubmitButtonProps>;
|
|
172
171
|
};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import type { AnalyticsEventPayload } from '@atlaskit/analytics-next';
|
|
3
2
|
import { type NewCoreIconProps } from '@atlaskit/icon';
|
|
4
3
|
import type { Placement } from '@atlaskit/popper';
|
|
@@ -10,10 +9,10 @@ import type { ShareDialogContainerProps } from './ShareDialogContainer';
|
|
|
10
9
|
import type { Integration } from './ShareEntities';
|
|
11
10
|
export type RenderCustomTriggerButton = (args: {
|
|
12
11
|
error?: ShareError;
|
|
12
|
+
iconBefore?: React.ComponentType<NewCoreIconProps>;
|
|
13
13
|
isDisabled?: boolean;
|
|
14
14
|
isSelected?: boolean;
|
|
15
15
|
onClick: () => void;
|
|
16
|
-
iconBefore?: React.ComponentType<NewCoreIconProps>;
|
|
17
16
|
}, triggerProps: TriggerProps) => React.ReactNode;
|
|
18
17
|
export type DialogPlacement = Placement;
|
|
19
18
|
/**
|
|
@@ -22,27 +21,27 @@ export type DialogPlacement = Placement;
|
|
|
22
21
|
*/
|
|
23
22
|
export type DialogBoundariesElement = 'viewport' | 'window' | 'scrollParent';
|
|
24
23
|
export type ShareDialogWithTriggerProps = Pick<ShareDialogContainerProps, 'onTriggerButtonClick' | 'isAutoOpenDialog' | 'shouldCloseOnEscapePress' | 'dialogPlacement' | 'loadUserOptions' | 'onDialogOpen' | 'onDialogClose' | 'onUserSelectionChange' | 'renderCustomTriggerButton' | 'customTriggerButtonIcon' | 'shareContentType' | 'shareContentSubType' | 'shareContentId' | 'shareFormTitle' | 'shareFormHelperMessage' | 'showFlags' | 'enableSmartUserPicker' | 'loggedInAccountId' | 'triggerButtonAppearance' | 'triggerButtonIcon' | 'triggerButtonStyle' | 'triggerButtonTooltipPosition' | 'triggerButtonTooltipText' | 'cloudId' | 'bottomMessage' | 'product' | 'productAttributes' | 'customHeader' | 'customFooter' | 'isCopyDisabled' | 'isPublicLink' | 'integrationMode' | 'isMenuItemSelected' | 'shareFieldsFooter' | 'shareIntegrations' | 'additionalTabs' | 'builtInTabContentWidth' | 'shareAri' | 'tabIndex' | 'copyTooltipText' | 'dialogZIndex' | 'orgId' | 'isBrowseUsersDisabled' | 'userPickerOptions' | 'isSubmitShareDisabled' | 'additionalUserFields' | 'isExtendedShareDialogEnabled' | 'CustomSubmitButton'> & {
|
|
25
|
-
|
|
26
|
-
isFetchingConfig?: boolean;
|
|
24
|
+
analyticsDecorator?: (payload: AnalyticsEventPayload) => AnalyticsEventPayload;
|
|
27
25
|
children?: RenderCustomTriggerButton;
|
|
26
|
+
config?: ConfigResponse;
|
|
28
27
|
copyLink: string;
|
|
29
|
-
analyticsDecorator?: (payload: AnalyticsEventPayload) => AnalyticsEventPayload;
|
|
30
|
-
isDisabled?: boolean;
|
|
31
|
-
onShareSubmit?: (shareContentState: ShareData) => Promise<any>;
|
|
32
28
|
copyLinkOrigin?: OriginTracing;
|
|
33
29
|
formShareOrigin?: OriginTracing;
|
|
30
|
+
isDisabled?: boolean;
|
|
31
|
+
isFetchingConfig?: boolean;
|
|
32
|
+
onShareSubmit?: (shareContentState: ShareData) => Promise<any>;
|
|
34
33
|
submitButtonLabel?: React.ReactNode;
|
|
35
34
|
};
|
|
36
35
|
export type ShareDialogWithTriggerStates = {
|
|
37
|
-
|
|
36
|
+
defaultValue: ShareData;
|
|
37
|
+
ignoreIntermediateState: boolean;
|
|
38
38
|
isDialogOpen: boolean;
|
|
39
|
+
isLoading: boolean;
|
|
40
|
+
isMenuItemSelected: boolean;
|
|
39
41
|
isSharing: boolean;
|
|
40
|
-
shareError?: ShareError;
|
|
41
|
-
ignoreIntermediateState: boolean;
|
|
42
|
-
defaultValue: ShareData;
|
|
43
42
|
isUsingSplitButton: boolean;
|
|
44
|
-
showIntegrationForm: boolean;
|
|
45
43
|
selectedIntegration: Integration | null;
|
|
44
|
+
shareError?: ShareError;
|
|
45
|
+
showIntegrationForm: boolean;
|
|
46
46
|
tabIndex: number;
|
|
47
|
-
isMenuItemSelected: boolean;
|
|
48
47
|
};
|