@atlaskit/share 3.5.1 → 3.5.3
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 +12 -0
- package/clients/package.json +8 -1
- package/copy-link-button/package.json +8 -1
- package/dist/cjs/clients/AtlassianUrlShortenerClient.js +5 -1
- package/dist/cjs/components/analytics/analytics.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/clients/AtlassianUrlShortenerClient.js +4 -1
- package/dist/es2019/components/analytics/analytics.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/clients/AtlassianUrlShortenerClient.js +5 -1
- package/dist/esm/components/analytics/analytics.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types-ts4.0/clients/AtlassianUrlShortenerClient.d.ts +16 -0
- package/dist/types-ts4.0/clients/ShareServiceClient.d.ts +25 -0
- package/dist/types-ts4.0/clients/index.d.ts +2 -0
- package/dist/types-ts4.0/components/CommentField.d.ts +6 -0
- package/dist/types-ts4.0/components/CopyLinkButton.d.ts +37 -0
- package/dist/types-ts4.0/components/ErrorBoundary.d.ts +4 -0
- package/dist/types-ts4.0/components/IntegrationButton.d.ts +10 -0
- package/dist/types-ts4.0/components/IntegrationForm.d.ts +11 -0
- package/dist/types-ts4.0/components/LazyShareForm/LazyShareForm.d.ts +20 -0
- package/dist/types-ts4.0/components/LazyShareForm/index.d.ts +1 -0
- package/dist/types-ts4.0/components/LazyShareForm/lazy.d.ts +4 -0
- package/dist/types-ts4.0/components/MessagesIntlProvider.d.ts +9 -0
- package/dist/types-ts4.0/components/ShareButton.d.ts +13 -0
- package/dist/types-ts4.0/components/ShareDialogContainer.d.ts +59 -0
- package/dist/types-ts4.0/components/ShareDialogWithTrigger.d.ts +43 -0
- package/dist/types-ts4.0/components/ShareForm.d.ts +11 -0
- package/dist/types-ts4.0/components/ShareFormWrapper/ShareFormWrapper.d.ts +9 -0
- package/dist/types-ts4.0/components/ShareFormWrapper/index.d.ts +1 -0
- package/dist/types-ts4.0/components/ShareFormWrapper/styled.d.ts +10 -0
- package/dist/types-ts4.0/components/ShareHeader.d.ts +8 -0
- package/dist/types-ts4.0/components/SlackIcon.d.ts +3 -0
- package/dist/types-ts4.0/components/SplitButton.d.ts +19 -0
- package/dist/types-ts4.0/components/UserPickerField.d.ts +28 -0
- package/dist/types-ts4.0/components/analytics/analytics.d.ts +19 -0
- package/dist/types-ts4.0/components/analytics/ufoExperienceHelper.d.ts +2 -0
- package/dist/types-ts4.0/components/analytics/ufoExperiences.d.ts +3 -0
- package/dist/types-ts4.0/components/colorSlackIcon.d.ts +3 -0
- package/dist/types-ts4.0/components/localStorageUtils.d.ts +5 -0
- package/dist/types-ts4.0/components/monochromeSlackIcon.d.ts +3 -0
- package/dist/types-ts4.0/components/styles.d.ts +5 -0
- package/dist/types-ts4.0/components/utils.d.ts +20 -0
- package/dist/types-ts4.0/i18n/cs.d.ts +43 -0
- package/dist/types-ts4.0/i18n/da.d.ts +43 -0
- package/dist/types-ts4.0/i18n/de.d.ts +43 -0
- package/dist/types-ts4.0/i18n/en.d.ts +35 -0
- package/dist/types-ts4.0/i18n/en_GB.d.ts +35 -0
- package/dist/types-ts4.0/i18n/en_ZZ.d.ts +43 -0
- package/dist/types-ts4.0/i18n/es.d.ts +43 -0
- package/dist/types-ts4.0/i18n/et.d.ts +30 -0
- package/dist/types-ts4.0/i18n/fi.d.ts +43 -0
- package/dist/types-ts4.0/i18n/fr.d.ts +43 -0
- package/dist/types-ts4.0/i18n/hu.d.ts +43 -0
- package/dist/types-ts4.0/i18n/index.d.ts +36 -0
- package/dist/types-ts4.0/i18n/is.d.ts +33 -0
- package/dist/types-ts4.0/i18n/it.d.ts +43 -0
- package/dist/types-ts4.0/i18n/ja.d.ts +43 -0
- package/dist/types-ts4.0/i18n/ko.d.ts +43 -0
- package/dist/types-ts4.0/i18n/languages.d.ts +33 -0
- package/dist/types-ts4.0/i18n/nb.d.ts +43 -0
- package/dist/types-ts4.0/i18n/nl.d.ts +43 -0
- package/dist/types-ts4.0/i18n/pl.d.ts +43 -0
- package/dist/types-ts4.0/i18n/pt_BR.d.ts +43 -0
- package/dist/types-ts4.0/i18n/pt_PT.d.ts +30 -0
- package/dist/types-ts4.0/i18n/ro.d.ts +33 -0
- package/dist/types-ts4.0/i18n/ru.d.ts +43 -0
- package/dist/types-ts4.0/i18n/sk.d.ts +30 -0
- package/dist/types-ts4.0/i18n/sv.d.ts +43 -0
- package/dist/types-ts4.0/i18n/th.d.ts +43 -0
- package/dist/types-ts4.0/i18n/tr.d.ts +43 -0
- package/dist/types-ts4.0/i18n/uk.d.ts +43 -0
- package/dist/types-ts4.0/i18n/vi.d.ts +43 -0
- package/dist/types-ts4.0/i18n/zh.d.ts +43 -0
- package/dist/types-ts4.0/i18n/zh_TW.d.ts +43 -0
- package/dist/types-ts4.0/i18n.d.ts +172 -0
- package/dist/types-ts4.0/index.d.ts +4 -0
- package/dist/types-ts4.0/types/Flag.d.ts +13 -0
- package/dist/types-ts4.0/types/OriginTracing.d.ts +17 -0
- package/dist/types-ts4.0/types/Products.d.ts +3 -0
- package/dist/types-ts4.0/types/ShareButton.d.ts +2 -0
- package/dist/types-ts4.0/types/ShareContentState.d.ts +14 -0
- package/dist/types-ts4.0/types/ShareDialogContainer.d.ts +144 -0
- package/dist/types-ts4.0/types/ShareDialogWithTrigger.d.ts +45 -0
- package/dist/types-ts4.0/types/ShareEntities.d.ts +30 -0
- package/dist/types-ts4.0/types/ShareForm.d.ts +31 -0
- package/dist/types-ts4.0/types/User.d.ts +9 -0
- package/dist/types-ts4.0/types/form.d.ts +5 -0
- package/dist/types-ts4.0/types/index.d.ts +17 -0
- package/dist/types-ts4.0/util/i18n-util.d.ts +17 -0
- package/package.json +11 -4
- package/report.api.md +114 -152
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/share
|
|
2
2
|
|
|
3
|
+
## 3.5.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`8cc2f888c83`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8cc2f888c83) - Upgrade Typescript from `4.3.5` to `4.5.5`
|
|
8
|
+
|
|
9
|
+
## 3.5.2
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`e9a46954c0f`](https://bitbucket.org/atlassian/atlassian-frontend/commits/e9a46954c0f) - added examples of copy link button
|
|
14
|
+
|
|
3
15
|
## 3.5.1
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/clients/package.json
CHANGED
|
@@ -3,5 +3,12 @@
|
|
|
3
3
|
"main": "../dist/cjs/clients/index.js",
|
|
4
4
|
"module": "../dist/esm/clients/index.js",
|
|
5
5
|
"module:es2019": "../dist/es2019/clients/index.js",
|
|
6
|
-
"types": "../dist/types/clients/index.d.ts"
|
|
6
|
+
"types": "../dist/types/clients/index.d.ts",
|
|
7
|
+
"typesVersions": {
|
|
8
|
+
">=4.0 <4.5": {
|
|
9
|
+
"*": [
|
|
10
|
+
"../dist/types-ts4.0/clients/index.d.ts"
|
|
11
|
+
]
|
|
12
|
+
}
|
|
13
|
+
}
|
|
7
14
|
}
|
|
@@ -3,5 +3,12 @@
|
|
|
3
3
|
"main": "../dist/cjs/components/CopyLinkButton.js",
|
|
4
4
|
"module": "../dist/esm/components/CopyLinkButton.js",
|
|
5
5
|
"module:es2019": "../dist/es2019/components/CopyLinkButton.js",
|
|
6
|
-
"types": "../dist/types/components/CopyLinkButton.d.ts"
|
|
6
|
+
"types": "../dist/types/components/CopyLinkButton.d.ts",
|
|
7
|
+
"typesVersions": {
|
|
8
|
+
">=4.0 <4.5": {
|
|
9
|
+
"*": [
|
|
10
|
+
"../dist/types-ts4.0/components/CopyLinkButton.d.ts"
|
|
11
|
+
]
|
|
12
|
+
}
|
|
13
|
+
}
|
|
7
14
|
}
|
|
@@ -69,7 +69,11 @@ var AtlassianUrlShortenerClient = /*#__PURE__*/function () {
|
|
|
69
69
|
case 14:
|
|
70
70
|
_context.prev = 14;
|
|
71
71
|
_context.t0 = _context["catch"](0);
|
|
72
|
-
|
|
72
|
+
|
|
73
|
+
if (_context.t0 instanceof Error) {
|
|
74
|
+
_context.t0.message = "While shortening URL: ".concat(_context.t0.message, "!");
|
|
75
|
+
}
|
|
76
|
+
|
|
73
77
|
throw _context.t0;
|
|
74
78
|
|
|
75
79
|
case 18:
|
|
@@ -19,7 +19,7 @@ var buildAttributes = function buildAttributes() {
|
|
|
19
19
|
var attributes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
20
20
|
return _objectSpread({
|
|
21
21
|
packageName: "@atlaskit/share",
|
|
22
|
-
packageVersion: "3.5.
|
|
22
|
+
packageVersion: "3.5.3"
|
|
23
23
|
}, attributes);
|
|
24
24
|
};
|
|
25
25
|
|
package/dist/cjs/version.json
CHANGED
|
@@ -21,7 +21,10 @@ export class AtlassianUrlShortenerClient {
|
|
|
21
21
|
|
|
22
22
|
return result;
|
|
23
23
|
} catch (err) {
|
|
24
|
-
err
|
|
24
|
+
if (err instanceof Error) {
|
|
25
|
+
err.message = `While shortening URL: ${err.message}!`;
|
|
26
|
+
}
|
|
27
|
+
|
|
25
28
|
throw err;
|
|
26
29
|
}
|
|
27
30
|
}
|
package/dist/es2019/version.json
CHANGED
|
@@ -56,7 +56,11 @@ export var AtlassianUrlShortenerClient = /*#__PURE__*/function () {
|
|
|
56
56
|
case 14:
|
|
57
57
|
_context.prev = 14;
|
|
58
58
|
_context.t0 = _context["catch"](0);
|
|
59
|
-
|
|
59
|
+
|
|
60
|
+
if (_context.t0 instanceof Error) {
|
|
61
|
+
_context.t0.message = "While shortening URL: ".concat(_context.t0.message, "!");
|
|
62
|
+
}
|
|
63
|
+
|
|
60
64
|
throw _context.t0;
|
|
61
65
|
|
|
62
66
|
case 18:
|
|
@@ -10,7 +10,7 @@ var buildAttributes = function buildAttributes() {
|
|
|
10
10
|
var attributes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
11
11
|
return _objectSpread({
|
|
12
12
|
packageName: "@atlaskit/share",
|
|
13
|
-
packageVersion: "3.5.
|
|
13
|
+
packageVersion: "3.5.3"
|
|
14
14
|
}, attributes);
|
|
15
15
|
};
|
|
16
16
|
|
package/dist/esm/version.json
CHANGED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface ShortenRequest {
|
|
2
|
+
cloudId?: string;
|
|
3
|
+
product: string;
|
|
4
|
+
type: string;
|
|
5
|
+
params: Record<string, string>;
|
|
6
|
+
query?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface ShortenResponse {
|
|
9
|
+
shortUrl: string;
|
|
10
|
+
}
|
|
11
|
+
export interface UrlShortenerClient {
|
|
12
|
+
shorten(data: ShortenRequest): Promise<ShortenResponse>;
|
|
13
|
+
}
|
|
14
|
+
export declare class AtlassianUrlShortenerClient implements UrlShortenerClient {
|
|
15
|
+
shorten(data: ShortenRequest): Promise<ShortenResponse>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ServiceConfig } from '@atlaskit/util-service-support';
|
|
2
|
+
import { Comment, Content, MetaData, User } from '../types';
|
|
3
|
+
export interface ShareClient {
|
|
4
|
+
share(content: Content, recipients: User[], metadata: MetaData, comment?: Comment): Promise<ShareResponse>;
|
|
5
|
+
getConfig(cloudId: string): Promise<ConfigResponse>;
|
|
6
|
+
}
|
|
7
|
+
export declare type ShareRequest = (content: Content, recipients: User[], metadata: MetaData, comment?: Comment) => Promise<ShareResponse>;
|
|
8
|
+
export declare type ShareResponse = {
|
|
9
|
+
shareRequestId: string;
|
|
10
|
+
};
|
|
11
|
+
export declare type ConfigResponse = {
|
|
12
|
+
disableSharingToEmails?: boolean;
|
|
13
|
+
};
|
|
14
|
+
export declare const DEFAULT_SHARE_PATH = "share";
|
|
15
|
+
export declare const SHARE_CONFIG_PATH = "share/configuration";
|
|
16
|
+
export declare const DEFAULT_SHARE_SERVICE_URL = "/gateway/api";
|
|
17
|
+
export declare class ShareServiceClient implements ShareClient {
|
|
18
|
+
private serviceConfig;
|
|
19
|
+
constructor(serviceConfig?: Partial<ServiceConfig>);
|
|
20
|
+
getConfig(cloudId: string): Promise<ConfigResponse>;
|
|
21
|
+
/**
|
|
22
|
+
* To send a POST request to the share endpoint in Share service
|
|
23
|
+
*/
|
|
24
|
+
share(content: Content, recipients: User[], metadata: MetaData, comment?: Comment): Promise<ShareResponse>;
|
|
25
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import React, { ReactElement } from 'react';
|
|
3
|
+
import { jsx } from '@emotion/react';
|
|
4
|
+
import { TriggerProps } from '@atlaskit/popup';
|
|
5
|
+
export declare const AUTO_DISMISS_MS: number;
|
|
6
|
+
export declare const messageContainerStyle: import("@emotion/react").SerializedStyles;
|
|
7
|
+
declare type InputProps = {
|
|
8
|
+
text: string;
|
|
9
|
+
};
|
|
10
|
+
export declare const HiddenInput: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement>>;
|
|
11
|
+
export declare type Props = {
|
|
12
|
+
onLinkCopy?: (link: string) => void;
|
|
13
|
+
link: string;
|
|
14
|
+
isDisabled?: boolean;
|
|
15
|
+
copyTooltipText?: string;
|
|
16
|
+
children?: string | ReactElement;
|
|
17
|
+
copyLinkButtonText: string;
|
|
18
|
+
copiedToClipboardText: string;
|
|
19
|
+
iconBefore?: ReactElement;
|
|
20
|
+
};
|
|
21
|
+
export declare type State = {
|
|
22
|
+
shouldShowCopiedMessage: boolean;
|
|
23
|
+
};
|
|
24
|
+
export declare class CopyLinkButton extends React.Component<Props, State> {
|
|
25
|
+
private autoDismiss;
|
|
26
|
+
private inputRef;
|
|
27
|
+
state: {
|
|
28
|
+
shouldShowCopiedMessage: boolean;
|
|
29
|
+
};
|
|
30
|
+
componentWillUnmount(): void;
|
|
31
|
+
private clearAutoDismiss;
|
|
32
|
+
private handleClick;
|
|
33
|
+
private handleDismissCopiedMessage;
|
|
34
|
+
renderTriggerButton: (triggerProps: TriggerProps) => jsx.JSX.Element;
|
|
35
|
+
render(): jsx.JSX.Element;
|
|
36
|
+
}
|
|
37
|
+
export default CopyLinkButton;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
|
|
3
|
+
declare const _default: React.ForwardRefExoticComponent<Omit<WithAnalyticsEventsProps, keyof WithAnalyticsEventsProps> & React.RefAttributes<any>>;
|
|
4
|
+
export default _default;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { CustomThemeButtonProps } from '@atlaskit/button/types';
|
|
4
|
+
declare type Props = CustomThemeButtonProps & {
|
|
5
|
+
text: React.ReactNode;
|
|
6
|
+
IntegrationIcon: React.ComponentType;
|
|
7
|
+
textColor?: string;
|
|
8
|
+
};
|
|
9
|
+
declare const IntegrationButton: React.FC<Props>;
|
|
10
|
+
export default IntegrationButton;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { jsx } from '@emotion/react';
|
|
4
|
+
import { IntegrationContentProps } from '../types';
|
|
5
|
+
export declare const formWrapperStyle: import("@emotion/react").SerializedStyles;
|
|
6
|
+
export declare type IntegrationFormProps = {
|
|
7
|
+
Content: React.ComponentType<IntegrationContentProps> | null;
|
|
8
|
+
onIntegrationClose?: () => void;
|
|
9
|
+
changeTab?: (index: number) => void;
|
|
10
|
+
};
|
|
11
|
+
export declare const IntegrationForm: ({ Content, onIntegrationClose, changeTab, }: IntegrationFormProps) => jsx.JSX.Element;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { LoadOptions } from '@atlaskit/smart-user-picker';
|
|
3
|
+
import type { ShareData, ShareDialogWithTriggerProps, ShareDialogWithTriggerStates } from '../../types';
|
|
4
|
+
import { IntegrationFormProps } from '../IntegrationForm';
|
|
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' | 'orgId'> & 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
|
+
setIsLoading: (isLoading: boolean) => void;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* A Share form content which is lazy-loaded.
|
|
17
|
+
* Make sure this component is not exported inside main entry points `src/index.ts`
|
|
18
|
+
*/
|
|
19
|
+
declare function LazyShareForm(props: LazyShareFormProps): JSX.Element;
|
|
20
|
+
export default LazyShareForm;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './LazyShareForm';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { WrappedComponentProps } from 'react-intl-next';
|
|
3
|
+
export interface Props {
|
|
4
|
+
children: React.ReactChild;
|
|
5
|
+
}
|
|
6
|
+
declare const _default: React.FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps<"intl">>> & {
|
|
7
|
+
WrappedComponent: React.ComponentType<Props & WrappedComponentProps<"intl">>;
|
|
8
|
+
};
|
|
9
|
+
export default _default;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Appearance } from '@atlaskit/button/types';
|
|
3
|
+
export declare type Props = {
|
|
4
|
+
appearance?: Appearance;
|
|
5
|
+
iconBefore?: React.ReactChild;
|
|
6
|
+
isLoading?: boolean;
|
|
7
|
+
isSelected?: boolean;
|
|
8
|
+
isDisabled?: boolean;
|
|
9
|
+
onClick: (e: React.MouseEvent<HTMLElement>) => void;
|
|
10
|
+
text?: React.ReactNode;
|
|
11
|
+
};
|
|
12
|
+
export declare const ShareButton: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLElement>>;
|
|
13
|
+
export default ShareButton;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { AnalyticsEventPayload, WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
|
|
3
|
+
import { ShortenRequest } from '../clients/AtlassianUrlShortenerClient';
|
|
4
|
+
import { ConfigResponse } from '../clients/ShareServiceClient';
|
|
5
|
+
import type { OriginTracing, OriginTracingFactory, ShareData, ShareDialogContainerProps } from '../types';
|
|
6
|
+
export declare const defaultConfig: ConfigResponse;
|
|
7
|
+
export declare type State = {
|
|
8
|
+
config?: ConfigResponse;
|
|
9
|
+
isFetchingConfig: boolean;
|
|
10
|
+
shareActionCount: number;
|
|
11
|
+
currentPageUrl: string;
|
|
12
|
+
shortenedCopyLink: null | string;
|
|
13
|
+
shortenedCopyLinkData?: ShortenRequest;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* This component serves as a Provider to provide customizable implementations
|
|
17
|
+
* to ShareDialogTrigger component
|
|
18
|
+
*/
|
|
19
|
+
export declare class ShareDialogContainerInternal extends React.Component<WithAnalyticsEventsProps & ShareDialogContainerProps, State> {
|
|
20
|
+
private shareClient;
|
|
21
|
+
private urlShortenerClient;
|
|
22
|
+
private _isMounted;
|
|
23
|
+
private _urlShorteningRequestCounter;
|
|
24
|
+
private _lastUrlShorteningWasTooSlow;
|
|
25
|
+
static defaultProps: {
|
|
26
|
+
enableSmartUserPicker: boolean;
|
|
27
|
+
shareeAction: "view" | "edit";
|
|
28
|
+
product: string;
|
|
29
|
+
};
|
|
30
|
+
constructor(props: ShareDialogContainerProps);
|
|
31
|
+
componentDidMount(): void;
|
|
32
|
+
componentWillUnmount(): void;
|
|
33
|
+
componentDidUpdate(prevProps: ShareDialogContainerProps): void;
|
|
34
|
+
private createAndFireEvent;
|
|
35
|
+
fetchConfig: () => void;
|
|
36
|
+
handleSubmitShare: ({ users, comment }: ShareData) => Promise<void>;
|
|
37
|
+
handleDialogOpen: () => Promise<void>;
|
|
38
|
+
decorateAnalytics: (payload: AnalyticsEventPayload) => AnalyticsEventPayload;
|
|
39
|
+
getUniqueCopyLinkOriginTracing: import("memoize-one").MemoizedFn<(link: string, originTracingFactory: OriginTracingFactory) => OriginTracing>;
|
|
40
|
+
getUniqueFormShareOriginTracing: import("memoize-one").MemoizedFn<(link: string, originTracingFactory: OriginTracingFactory, shareCount: number) => OriginTracing>;
|
|
41
|
+
getUpToDateShortenedCopyLink: (data: ShortenRequest) => Promise<string | null>;
|
|
42
|
+
getRawLink(): string;
|
|
43
|
+
getCopyLinkOriginTracing(): OriginTracing;
|
|
44
|
+
getFormShareOriginTracing(): OriginTracing;
|
|
45
|
+
getFullCopyLink(): string;
|
|
46
|
+
shouldShortenCopyLink(): boolean;
|
|
47
|
+
getShortenedCopyLink(): string | undefined;
|
|
48
|
+
getCopyLink(): string;
|
|
49
|
+
addOriginToShortQuery(query?: string): string;
|
|
50
|
+
getShortLinkData(props: ShareDialogContainerProps): ShortenRequest | undefined;
|
|
51
|
+
updateShortCopyLink(): void;
|
|
52
|
+
getFormShareLink: () => string;
|
|
53
|
+
render(): JSX.Element;
|
|
54
|
+
}
|
|
55
|
+
export declare const ShareDialogContainer: React.ForwardRefExoticComponent<Pick<Omit<WithAnalyticsEventsProps & ShareDialogContainerProps, keyof WithAnalyticsEventsProps>, "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" | "orgId" | "shareClient" | "urlShortenerClient" | "shortLinkData" | "formatCopyLink" | "originTracingFactory" | "productId" | "shareLink" | "shareTitle" | "useUrlShortener"> & Partial<Pick<Omit<WithAnalyticsEventsProps & ShareDialogContainerProps, keyof WithAnalyticsEventsProps>, "enableSmartUserPicker" | "product" | "shareeAction">> & Partial<Pick<{
|
|
56
|
+
enableSmartUserPicker: boolean;
|
|
57
|
+
shareeAction: "view" | "edit";
|
|
58
|
+
product: string;
|
|
59
|
+
}, never>> & React.RefAttributes<any>>;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { jsx } from '@emotion/react';
|
|
4
|
+
import { WrappedComponentProps } from 'react-intl-next';
|
|
5
|
+
import { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
|
|
6
|
+
import { TriggerProps } from '@atlaskit/popup';
|
|
7
|
+
import { Integration, ShareData, ShareDialogWithTriggerProps, ShareDialogWithTriggerStates } from '../types';
|
|
8
|
+
export declare const defaultShareContentState: ShareData;
|
|
9
|
+
declare type ShareDialogWithTriggerInternalProps = ShareDialogWithTriggerProps & WrappedComponentProps & WithAnalyticsEventsProps;
|
|
10
|
+
export declare class ShareDialogWithTriggerInternal extends React.PureComponent<ShareDialogWithTriggerInternalProps, ShareDialogWithTriggerStates> {
|
|
11
|
+
static defaultProps: Partial<ShareDialogWithTriggerProps>;
|
|
12
|
+
private containerRef;
|
|
13
|
+
/**
|
|
14
|
+
* Because the PopUp component has a higher zIndex it causes
|
|
15
|
+
* the select to be rendered within it, and add scrollbars.
|
|
16
|
+
* We will render the select options the PopUp outside,
|
|
17
|
+
*/
|
|
18
|
+
private selectPortalRef;
|
|
19
|
+
private start;
|
|
20
|
+
state: ShareDialogWithTriggerStates;
|
|
21
|
+
componentDidMount(): void;
|
|
22
|
+
componentDidUpdate(prevProps: ShareDialogWithTriggerProps): void;
|
|
23
|
+
private closeAndResetDialog;
|
|
24
|
+
private createAndFireEvent;
|
|
25
|
+
private onTabChange;
|
|
26
|
+
private getFlags;
|
|
27
|
+
private setIsLoading;
|
|
28
|
+
private focus;
|
|
29
|
+
private handleKeyDown;
|
|
30
|
+
private handleDialogOpen;
|
|
31
|
+
private onTriggerClick;
|
|
32
|
+
private handleCloseDialog;
|
|
33
|
+
private handleShareSubmit;
|
|
34
|
+
private handleFormDismiss;
|
|
35
|
+
handleCopyLink: () => void;
|
|
36
|
+
handleIntegrationClick: (integration: Integration) => void;
|
|
37
|
+
renderShareTriggerButton: (triggerProps: TriggerProps) => React.ReactNode;
|
|
38
|
+
handleOpenSplitButton: () => void;
|
|
39
|
+
handleCloseSplitButton: () => void;
|
|
40
|
+
render(): jsx.JSX.Element;
|
|
41
|
+
}
|
|
42
|
+
export declare const ShareDialogWithTrigger: React.ComponentType<ShareDialogWithTriggerProps>;
|
|
43
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { WrappedComponentProps } from 'react-intl-next';
|
|
4
|
+
import { FormChildrenArgs, ShareData, ShareFormProps, TabType } from '../types';
|
|
5
|
+
export declare const formWrapperStyles: import("@emotion/react").SerializedStyles;
|
|
6
|
+
export declare const formFooterStyles: import("@emotion/react").SerializedStyles;
|
|
7
|
+
export declare type State = {
|
|
8
|
+
selectedTab: TabType;
|
|
9
|
+
};
|
|
10
|
+
export declare type InternalFormProps = FormChildrenArgs<ShareData> & ShareFormProps & WrappedComponentProps;
|
|
11
|
+
export declare const ShareForm: React.FC<ShareFormProps>;
|
|
@@ -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,10 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export declare const InlineDialogFormWrapper: React.FC;
|
|
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: React.FC;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Theme } from '@emotion/react';
|
|
4
|
+
export declare type Props = {
|
|
5
|
+
title?: React.ReactNode;
|
|
6
|
+
};
|
|
7
|
+
export declare const getFormHeaderTitleStyles: (theme: Theme) => import("@emotion/react").SerializedStyles;
|
|
8
|
+
export declare const ShareHeader: React.StatelessComponent<Props>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { AnalyticsEventPayload } from '@atlaskit/analytics-next';
|
|
4
|
+
import { Appearance } from '@atlaskit/button/types';
|
|
5
|
+
import { DialogPlacement, Integration } from '../types';
|
|
6
|
+
declare type SplitButtonProps = {
|
|
7
|
+
shareButton: React.ReactNode;
|
|
8
|
+
handleOpenSplitButton: () => void;
|
|
9
|
+
handleCloseSplitButton: () => void;
|
|
10
|
+
isUsingSplitButton: boolean;
|
|
11
|
+
shareIntegrations: Array<Integration>;
|
|
12
|
+
onIntegrationClick: (integration: Integration) => void;
|
|
13
|
+
triggerButtonAppearance?: Appearance;
|
|
14
|
+
dialogZIndex?: number;
|
|
15
|
+
dialogPlacement?: DialogPlacement;
|
|
16
|
+
createAndFireEvent: (payload: AnalyticsEventPayload) => void;
|
|
17
|
+
};
|
|
18
|
+
export default function SplitButton({ shareButton, handleOpenSplitButton, handleCloseSplitButton, isUsingSplitButton, shareIntegrations, onIntegrationClick, triggerButtonAppearance, dialogZIndex, dialogPlacement, createAndFireEvent, }: SplitButtonProps): JSX.Element;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { WrappedComponentProps } from 'react-intl-next';
|
|
3
|
+
import { LoadOptions, OptionData, Value } from '@atlaskit/smart-user-picker';
|
|
4
|
+
import { ConfigResponse, ProductName } from '../types';
|
|
5
|
+
export declare const REQUIRED = "REQUIRED";
|
|
6
|
+
export declare type Props = {
|
|
7
|
+
loadOptions?: LoadOptions;
|
|
8
|
+
defaultValue?: OptionData[];
|
|
9
|
+
config?: ConfigResponse;
|
|
10
|
+
isLoading?: boolean;
|
|
11
|
+
product: ProductName;
|
|
12
|
+
onInputChange?: (query?: string, sessionId?: string) => void;
|
|
13
|
+
enableSmartUserPicker?: boolean;
|
|
14
|
+
loggedInAccountId?: string;
|
|
15
|
+
cloudId?: string;
|
|
16
|
+
onChange?: (value: Value) => void;
|
|
17
|
+
selectPortalRef?: React.Ref<HTMLDivElement>;
|
|
18
|
+
isPublicLink?: boolean;
|
|
19
|
+
helperMessage?: string;
|
|
20
|
+
orgId?: string;
|
|
21
|
+
};
|
|
22
|
+
export declare class UserPickerFieldComponent extends React.Component<WrappedComponentProps & Props> {
|
|
23
|
+
private loadOptions;
|
|
24
|
+
private getInviteWarningMessage;
|
|
25
|
+
private handleUserPickerTransform;
|
|
26
|
+
render(): JSX.Element;
|
|
27
|
+
}
|
|
28
|
+
export declare const UserPickerField: React.ComponentType<Props>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { AnalyticsEventPayload } from '@atlaskit/analytics-next';
|
|
2
|
+
import { DialogContentState, OriginTracing } from '../../types';
|
|
3
|
+
export declare const CHANNEL_ID = "fabric-elements";
|
|
4
|
+
export declare const ANALYTICS_SOURCE = "shareModal";
|
|
5
|
+
export declare const INTEGRATION_MODAL_SOURCE = "integrationShareDialog";
|
|
6
|
+
export declare const screenEvent: ({ isPublicLink }: {
|
|
7
|
+
isPublicLink?: boolean | undefined;
|
|
8
|
+
}) => AnalyticsEventPayload;
|
|
9
|
+
export declare const shareSplitButtonEvent: () => AnalyticsEventPayload;
|
|
10
|
+
export declare const shareIntegrationButtonEvent: (type?: string) => AnalyticsEventPayload;
|
|
11
|
+
export declare const errorEncountered: (actionSubjectId: string | undefined, attributes?: any) => AnalyticsEventPayload;
|
|
12
|
+
export declare const shareTriggerButtonClicked: () => AnalyticsEventPayload;
|
|
13
|
+
export declare type TabSubjectIdType = 'shareTab' | 'shareToSlackTab';
|
|
14
|
+
export declare const shareTabClicked: (subjectId: TabSubjectIdType) => AnalyticsEventPayload;
|
|
15
|
+
export declare const cancelShare: (start: number) => AnalyticsEventPayload;
|
|
16
|
+
export declare const shortUrlRequested: () => AnalyticsEventPayload;
|
|
17
|
+
export declare const shortUrlGenerated: (start: number, tooSlow: boolean) => AnalyticsEventPayload;
|
|
18
|
+
export declare const copyLinkButtonClicked: (start: number, shareContentType?: string | undefined, shareOrigin?: OriginTracing | undefined, isPublicLink?: boolean, ari?: string | undefined) => AnalyticsEventPayload;
|
|
19
|
+
export declare const formShareSubmitted: (start: number, data: DialogContentState, shareContentType?: string | undefined, shareOrigin?: OriginTracing | undefined, isPublicLink?: boolean) => AnalyticsEventPayload;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ProductName } from '../types';
|
|
2
|
+
export declare const getDefaultSlackWorkSpace: (product: ProductName) => string | null;
|
|
3
|
+
export declare const setDefaultSlackWorkSpace: (product: ProductName, value: string) => void;
|
|
4
|
+
export declare const getIsOnboardingDismissed: (product: ProductName) => string | null;
|
|
5
|
+
export declare const setIsOnboardingDismissed: (product: ProductName, value: string) => void;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { OptionData } from '@atlaskit/smart-user-picker';
|
|
3
|
+
import { ConfigResponse, User } from '../types';
|
|
4
|
+
import type { IntegrationMode } from '../types/ShareEntities';
|
|
5
|
+
/**
|
|
6
|
+
* We need to generate correct zIndex, for the PopUp and for the Select inside it.
|
|
7
|
+
* The PopUp's defaults to `layers.layer()` from @atlaskit/theme. But if user provides
|
|
8
|
+
* a different value, we need check it, and in case of Select Portal z-index, we need to
|
|
9
|
+
* top it, so it's visible in the popup.
|
|
10
|
+
*/
|
|
11
|
+
export declare const zIndexAddition: number;
|
|
12
|
+
export declare const generateSelectZIndex: (dialogZIndex?: number | undefined) => number;
|
|
13
|
+
/**
|
|
14
|
+
* Helper to get around TS error of property `current` not being
|
|
15
|
+
* part of React's `ref` object.
|
|
16
|
+
*/
|
|
17
|
+
export declare const getMenuPortalTargetCurrentHTML: (ref?: import("react").Ref<HTMLDivElement> | undefined) => HTMLDivElement | null;
|
|
18
|
+
export declare const optionDataToUsers: (optionDataArray: OptionData[]) => User[];
|
|
19
|
+
export declare const allowEmails: (config?: ConfigResponse | undefined) => boolean;
|
|
20
|
+
export declare const resolveShareFooter: (integrationMode: IntegrationMode | undefined, tabIndex: number, customFooter: React.ReactNode) => React.ReactNode | undefined;
|