@atlaskit/share 5.0.0 → 6.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.
- package/CHANGELOG.md +26 -0
- package/afm-cc/tsconfig.json +3 -0
- package/afm-jira/tsconfig.json +3 -0
- package/dist/cjs/components/CopyLinkButton.js +11 -7
- package/dist/cjs/components/CopyLinkButtonNext.compiled.css +8 -0
- package/dist/cjs/components/CopyLinkButtonNext.js +180 -0
- package/dist/cjs/components/IntegrationButton.js +10 -1
- package/dist/cjs/components/IntegrationButtonNext.compiled.css +7 -0
- package/dist/cjs/components/IntegrationButtonNext.js +38 -0
- package/dist/cjs/components/LazyShareForm/LazyShareFormNext.compiled.css +5 -0
- package/dist/cjs/components/LazyShareForm/LazyShareFormNext.js +138 -0
- package/dist/cjs/components/LazyShareForm/lazy.js +3 -1
- package/dist/cjs/components/LazyShareForm/lazyNext.compiled.css +5 -0
- package/dist/cjs/components/LazyShareForm/lazyNext.js +58 -0
- package/dist/cjs/components/ShareDialogWithTrigger.js +12 -8
- package/dist/cjs/components/ShareDialogWithTriggerNext.compiled.css +4 -0
- package/dist/cjs/components/ShareDialogWithTriggerNext.js +653 -0
- package/dist/cjs/components/ShareFormNext.compiled.css +21 -0
- package/dist/cjs/components/ShareFormNext.js +473 -0
- package/dist/cjs/components/ShareFormWrapper/ShareFormWrapper.js +6 -2
- package/dist/cjs/components/ShareFormWrapper/compiled.compiled.css +7 -0
- package/dist/cjs/components/ShareFormWrapper/compiled.js +48 -0
- package/dist/cjs/components/SplitButton.js +25 -17
- package/dist/cjs/components/UserPickerField.js +3 -1
- package/dist/cjs/components/analytics/analytics.js +1 -1
- package/dist/es2019/components/CopyLinkButton.js +3 -1
- package/dist/es2019/components/CopyLinkButtonNext.compiled.css +8 -0
- package/dist/es2019/components/CopyLinkButtonNext.js +151 -0
- package/dist/es2019/components/IntegrationButton.js +9 -1
- package/dist/es2019/components/IntegrationButtonNext.compiled.css +7 -0
- package/dist/es2019/components/IntegrationButtonNext.js +33 -0
- package/dist/es2019/components/LazyShareForm/LazyShareFormNext.compiled.css +5 -0
- package/dist/es2019/components/LazyShareForm/LazyShareFormNext.js +136 -0
- package/dist/es2019/components/LazyShareForm/lazy.js +3 -1
- package/dist/es2019/components/LazyShareForm/lazyNext.compiled.css +5 -0
- package/dist/es2019/components/LazyShareForm/lazyNext.js +43 -0
- package/dist/es2019/components/ShareDialogWithTrigger.js +4 -2
- package/dist/es2019/components/ShareDialogWithTriggerNext.compiled.css +4 -0
- package/dist/es2019/components/ShareDialogWithTriggerNext.js +593 -0
- package/dist/es2019/components/ShareFormNext.compiled.css +21 -0
- package/dist/es2019/components/ShareFormNext.js +417 -0
- package/dist/es2019/components/ShareFormWrapper/ShareFormWrapper.js +6 -2
- package/dist/es2019/components/ShareFormWrapper/compiled.compiled.css +7 -0
- package/dist/es2019/components/ShareFormWrapper/compiled.js +41 -0
- package/dist/es2019/components/SplitButton.js +9 -3
- package/dist/es2019/components/UserPickerField.js +3 -1
- package/dist/es2019/components/analytics/analytics.js +1 -1
- package/dist/esm/components/CopyLinkButton.js +10 -6
- package/dist/esm/components/CopyLinkButtonNext.compiled.css +8 -0
- package/dist/esm/components/CopyLinkButtonNext.js +173 -0
- package/dist/esm/components/IntegrationButton.js +11 -1
- package/dist/esm/components/IntegrationButtonNext.compiled.css +7 -0
- package/dist/esm/components/IntegrationButtonNext.js +31 -0
- package/dist/esm/components/LazyShareForm/LazyShareFormNext.compiled.css +5 -0
- package/dist/esm/components/LazyShareForm/LazyShareFormNext.js +131 -0
- package/dist/esm/components/LazyShareForm/lazy.js +3 -1
- package/dist/esm/components/LazyShareForm/lazyNext.compiled.css +5 -0
- package/dist/esm/components/LazyShareForm/lazyNext.js +46 -0
- package/dist/esm/components/ShareDialogWithTrigger.js +11 -7
- package/dist/esm/components/ShareDialogWithTriggerNext.compiled.css +4 -0
- package/dist/esm/components/ShareDialogWithTriggerNext.js +646 -0
- package/dist/esm/components/ShareFormNext.compiled.css +21 -0
- package/dist/esm/components/ShareFormNext.js +463 -0
- package/dist/esm/components/ShareFormWrapper/ShareFormWrapper.js +6 -2
- package/dist/esm/components/ShareFormWrapper/compiled.compiled.css +7 -0
- package/dist/esm/components/ShareFormWrapper/compiled.js +41 -0
- package/dist/esm/components/SplitButton.js +25 -17
- package/dist/esm/components/UserPickerField.js +3 -1
- package/dist/esm/components/analytics/analytics.js +1 -1
- package/dist/types/components/CopyLinkButton.d.ts +2 -1
- package/dist/types/components/CopyLinkButtonNext.d.ts +35 -0
- package/dist/types/components/IntegrationButtonNext.d.ts +11 -0
- package/dist/types/components/LazyShareForm/LazyShareFormNext.d.ts +21 -0
- package/dist/types/components/LazyShareForm/lazyNext.d.ts +4 -0
- package/dist/types/components/ShareDialogWithTrigger.d.ts +3 -3
- package/dist/types/components/ShareDialogWithTriggerNext.d.ts +47 -0
- package/dist/types/components/ShareFormNext.d.ts +9 -0
- package/dist/types/components/ShareFormWrapper/compiled.d.ts +10 -0
- package/dist/types-ts4.5/components/CopyLinkButton.d.ts +2 -1
- package/dist/types-ts4.5/components/CopyLinkButtonNext.d.ts +35 -0
- package/dist/types-ts4.5/components/IntegrationButtonNext.d.ts +11 -0
- package/dist/types-ts4.5/components/LazyShareForm/LazyShareFormNext.d.ts +21 -0
- package/dist/types-ts4.5/components/LazyShareForm/lazyNext.d.ts +4 -0
- package/dist/types-ts4.5/components/ShareDialogWithTrigger.d.ts +3 -3
- package/dist/types-ts4.5/components/ShareDialogWithTriggerNext.d.ts +47 -0
- package/dist/types-ts4.5/components/ShareFormNext.d.ts +9 -0
- package/dist/types-ts4.5/components/ShareFormWrapper/compiled.d.ts +10 -0
- package/package.json +29 -25
|
@@ -13,7 +13,7 @@ var buildAttributes = function buildAttributes() {
|
|
|
13
13
|
var attributes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
14
14
|
return _objectSpread({
|
|
15
15
|
packageName: "@atlaskit/share",
|
|
16
|
-
packageVersion: "
|
|
16
|
+
packageVersion: "6.0.0"
|
|
17
17
|
}, attributes);
|
|
18
18
|
};
|
|
19
19
|
var createEvent = function createEvent(eventType, source, action, actionSubject, actionSubjectId) {
|
|
@@ -15,6 +15,7 @@ import { Box, xcss } from '@atlaskit/primitives';
|
|
|
15
15
|
import { G300 } from '@atlaskit/theme/colors';
|
|
16
16
|
import { layers } from '@atlaskit/theme/constants';
|
|
17
17
|
import Tooltip from '@atlaskit/tooltip';
|
|
18
|
+
import CopyLinkButtonNext from './CopyLinkButtonNext';
|
|
18
19
|
import { InlineDialogContentWrapper } from './ShareFormWrapper/styled';
|
|
19
20
|
import Button from './styles';
|
|
20
21
|
const Z_INDEX = layers.modal();
|
|
@@ -51,7 +52,7 @@ export const HiddenInput = /*#__PURE__*/React.forwardRef(
|
|
|
51
52
|
readOnly: true
|
|
52
53
|
}));
|
|
53
54
|
// eslint-disable-next-line @repo/internal/react/no-class-components
|
|
54
|
-
export class
|
|
55
|
+
export class CopyLinkButtonInner extends React.Component {
|
|
55
56
|
constructor(...args) {
|
|
56
57
|
super(...args);
|
|
57
58
|
_defineProperty(this, "inputRef", /*#__PURE__*/React.createRef());
|
|
@@ -159,4 +160,5 @@ export class CopyLinkButton extends React.Component {
|
|
|
159
160
|
}));
|
|
160
161
|
}
|
|
161
162
|
}
|
|
163
|
+
export const CopyLinkButton = props => fg('share-compiled-migration') ? jsx(CopyLinkButtonNext, props) : jsx(CopyLinkButtonInner, props);
|
|
162
164
|
export default CopyLinkButton;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
._18u0mgjw{margin-left:var(--ds-space-negative-200,-1pc)}
|
|
2
|
+
._19pkx0bf{margin-top:var(--ds-space-negative-100,-8px)}
|
|
3
|
+
._1e0c1txw{display:flex}
|
|
4
|
+
._2hwxmgjw{margin-right:var(--ds-space-negative-200,-1pc)}
|
|
5
|
+
._2hwxv77o{margin-right:var(--ds-space-025,2px)}
|
|
6
|
+
._4cvr1h6o{align-items:center}
|
|
7
|
+
._azhw12x7{text-indent:var(--ds-space-075,6px)}
|
|
8
|
+
._otyrx0bf{margin-bottom:var(--ds-space-negative-100,-8px)}
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
/* CopyLinkButtonNext.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
2
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
|
+
import "./CopyLinkButtonNext.compiled.css";
|
|
4
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
5
|
+
import React from 'react';
|
|
6
|
+
import { cx } from '@atlaskit/css';
|
|
7
|
+
import LinkFilledIcon from '@atlaskit/icon/core/migration/link--link-filled';
|
|
8
|
+
import CheckCircleIcon from '@atlaskit/icon/core/migration/success--check-circle';
|
|
9
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
10
|
+
import Popup from '@atlaskit/popup';
|
|
11
|
+
import { Box } from '@atlaskit/primitives/compiled';
|
|
12
|
+
import { G300 } from '@atlaskit/theme/colors';
|
|
13
|
+
import { layers } from '@atlaskit/theme/constants';
|
|
14
|
+
import Tooltip from '@atlaskit/tooltip';
|
|
15
|
+
import { InlineDialogContentWrapper } from './ShareFormWrapper/compiled';
|
|
16
|
+
import Button from './styles';
|
|
17
|
+
const Z_INDEX = layers.modal();
|
|
18
|
+
const AUTO_DISMISS_SECONDS = 8;
|
|
19
|
+
export const AUTO_DISMISS_MS = AUTO_DISMISS_SECONDS * 1000;
|
|
20
|
+
const styles = {
|
|
21
|
+
messageContainer: "_1e0c1txw _4cvr1h6o _19pkx0bf _2hwxmgjw _otyrx0bf _18u0mgjw",
|
|
22
|
+
boxWrapper: "_2hwxv77o",
|
|
23
|
+
messageText: "_azhw12x7"
|
|
24
|
+
};
|
|
25
|
+
const isSafari = typeof window !== 'undefined' && window.navigator.userAgent.indexOf('Safari');
|
|
26
|
+
export const HiddenInput = /*#__PURE__*/React.forwardRef(
|
|
27
|
+
// we need a hidden input to reliably copy to clipboard across all browsers.
|
|
28
|
+
(props, ref) => /*#__PURE__*/React.createElement("input", {
|
|
29
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
30
|
+
style: {
|
|
31
|
+
position: 'absolute',
|
|
32
|
+
left: '-9999px'
|
|
33
|
+
},
|
|
34
|
+
tabIndex: -1,
|
|
35
|
+
"aria-hidden": true,
|
|
36
|
+
ref: ref,
|
|
37
|
+
value: props.text,
|
|
38
|
+
"aria-label": props.label,
|
|
39
|
+
readOnly: true
|
|
40
|
+
}));
|
|
41
|
+
// eslint-disable-next-line @repo/internal/react/no-class-components
|
|
42
|
+
export class CopyLinkButton extends React.Component {
|
|
43
|
+
constructor(...args) {
|
|
44
|
+
super(...args);
|
|
45
|
+
_defineProperty(this, "inputRef", /*#__PURE__*/React.createRef());
|
|
46
|
+
_defineProperty(this, "state", {
|
|
47
|
+
shouldShowCopiedMessage: false
|
|
48
|
+
});
|
|
49
|
+
_defineProperty(this, "clearAutoDismiss", () => {
|
|
50
|
+
if (this.autoDismiss) {
|
|
51
|
+
clearTimeout(this.autoDismiss);
|
|
52
|
+
this.autoDismiss = undefined;
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
_defineProperty(this, "handleClick", () => {
|
|
56
|
+
this.inputRef.current.select();
|
|
57
|
+
document.execCommand('copy');
|
|
58
|
+
if (this.props.onLinkCopy) {
|
|
59
|
+
this.props.onLinkCopy(this.props.link);
|
|
60
|
+
}
|
|
61
|
+
this.setState({
|
|
62
|
+
shouldShowCopiedMessage: true
|
|
63
|
+
}, () => {
|
|
64
|
+
this.clearAutoDismiss();
|
|
65
|
+
this.autoDismiss = setTimeout(() => {
|
|
66
|
+
this.setState({
|
|
67
|
+
shouldShowCopiedMessage: false
|
|
68
|
+
});
|
|
69
|
+
}, AUTO_DISMISS_MS);
|
|
70
|
+
});
|
|
71
|
+
});
|
|
72
|
+
_defineProperty(this, "handleDismissCopiedMessage", () => {
|
|
73
|
+
this.clearAutoDismiss();
|
|
74
|
+
this.setState({
|
|
75
|
+
shouldShowCopiedMessage: false
|
|
76
|
+
});
|
|
77
|
+
});
|
|
78
|
+
_defineProperty(this, "renderTriggerButton", triggerProps => {
|
|
79
|
+
const {
|
|
80
|
+
isDisabled,
|
|
81
|
+
copyLinkButtonText,
|
|
82
|
+
children,
|
|
83
|
+
iconBefore
|
|
84
|
+
} = this.props;
|
|
85
|
+
return /*#__PURE__*/React.createElement(Button, {
|
|
86
|
+
"aria-label": copyLinkButtonText,
|
|
87
|
+
isDisabled: isDisabled
|
|
88
|
+
// TODO: (from codemod)"link" and "subtle-link" appearances are only available in LinkButton, please either provide a href prop then migrate to LinkButton, or remove the appearance from the default button.
|
|
89
|
+
// https://product-fabric.atlassian.net/browse/DSP-18980
|
|
90
|
+
,
|
|
91
|
+
appearance: "subtle-link",
|
|
92
|
+
iconBefore: iconBefore || /*#__PURE__*/React.createElement(Box, {
|
|
93
|
+
xcss: cx(styles.boxWrapper)
|
|
94
|
+
}, /*#__PURE__*/React.createElement(LinkFilledIcon, {
|
|
95
|
+
LEGACY_margin: `0 ${"var(--ds-space-negative-025, -2px)"} 0 0`,
|
|
96
|
+
color: "currentColor",
|
|
97
|
+
label: "",
|
|
98
|
+
LEGACY_size: "medium"
|
|
99
|
+
})),
|
|
100
|
+
onClick: this.handleClick,
|
|
101
|
+
ref: triggerProps.ref
|
|
102
|
+
}, children || copyLinkButtonText);
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
componentWillUnmount() {
|
|
106
|
+
this.clearAutoDismiss();
|
|
107
|
+
}
|
|
108
|
+
render() {
|
|
109
|
+
const {
|
|
110
|
+
shouldShowCopiedMessage
|
|
111
|
+
} = this.state;
|
|
112
|
+
const {
|
|
113
|
+
copyTooltipText,
|
|
114
|
+
copiedToClipboardText
|
|
115
|
+
} = this.props;
|
|
116
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, isSafari &&
|
|
117
|
+
/*#__PURE__*/
|
|
118
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
119
|
+
React.createElement("div", {
|
|
120
|
+
className: "assistive",
|
|
121
|
+
"aria-live": "assertive"
|
|
122
|
+
}, shouldShowCopiedMessage && copiedToClipboardText), /*#__PURE__*/React.createElement(HiddenInput, {
|
|
123
|
+
ref: this.inputRef,
|
|
124
|
+
text: this.props.link,
|
|
125
|
+
label: copiedToClipboardText
|
|
126
|
+
}), /*#__PURE__*/React.createElement(Popup, {
|
|
127
|
+
zIndex: Z_INDEX,
|
|
128
|
+
autoFocus: false,
|
|
129
|
+
content: () => /*#__PURE__*/React.createElement(InlineDialogContentWrapper, null, /*#__PURE__*/React.createElement(Box, {
|
|
130
|
+
xcss: cx(styles.messageContainer),
|
|
131
|
+
testId: "message-container",
|
|
132
|
+
"aria-hidden": true
|
|
133
|
+
}, /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(CheckCircleIcon, {
|
|
134
|
+
spacing: "spacious",
|
|
135
|
+
label: "",
|
|
136
|
+
color: `var(--ds-icon-success, ${G300})`
|
|
137
|
+
}), /*#__PURE__*/React.createElement(Box, {
|
|
138
|
+
xcss: cx(styles.messageText)
|
|
139
|
+
}, copiedToClipboardText)))),
|
|
140
|
+
isOpen: shouldShowCopiedMessage,
|
|
141
|
+
onClose: this.handleDismissCopiedMessage,
|
|
142
|
+
placement: "top-start",
|
|
143
|
+
trigger: triggerProps => copyTooltipText ? /*#__PURE__*/React.createElement(Tooltip, {
|
|
144
|
+
content: copyTooltipText,
|
|
145
|
+
position: "bottom-start"
|
|
146
|
+
}, this.renderTriggerButton(triggerProps)) : this.renderTriggerButton(triggerProps),
|
|
147
|
+
shouldRenderToParent: fg('enable-appropriate-reading-order-in-share-dialog')
|
|
148
|
+
}));
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
export default CopyLinkButton;
|
|
@@ -7,7 +7,10 @@ import React from 'react';
|
|
|
7
7
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
8
8
|
import { css, jsx } from '@emotion/react';
|
|
9
9
|
import Button from '@atlaskit/button/custom-theme-button';
|
|
10
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
10
11
|
import { N500 } from '@atlaskit/theme/colors';
|
|
12
|
+
import IntegrationButtonNext from './IntegrationButtonNext';
|
|
13
|
+
|
|
11
14
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/design-system/no-css-tagged-template-expression -- Ignored via go/DSP-18766
|
|
12
15
|
const integrationButtonCopyWrapperStyle = css`
|
|
13
16
|
display: flex;
|
|
@@ -19,7 +22,7 @@ const integrationIconWrapperStyle = css`
|
|
|
19
22
|
margin: ${"var(--ds-space-025, 2px)"} ${"var(--ds-space-100, 8px)"} ${"var(--ds-space-0, 0px)"}
|
|
20
23
|
${"var(--ds-space-0, 0px)"};
|
|
21
24
|
`;
|
|
22
|
-
const
|
|
25
|
+
const IntegrationButtonInner = props => {
|
|
23
26
|
const {
|
|
24
27
|
text,
|
|
25
28
|
textColor,
|
|
@@ -38,5 +41,10 @@ const IntegrationButton = props => {
|
|
|
38
41
|
}, jsx(IntegrationIcon, null)), jsx("span", null, text)))
|
|
39
42
|
);
|
|
40
43
|
};
|
|
44
|
+
const IntegrationButton = props => fg('share-compiled-migration') ? jsx(IntegrationButtonNext, {
|
|
45
|
+
text: props.text,
|
|
46
|
+
onClick: props.onClick,
|
|
47
|
+
IntegrationIcon: props.IntegrationIcon
|
|
48
|
+
}) : jsx(IntegrationButtonInner, props);
|
|
41
49
|
IntegrationButton.displayName = 'IntegrationButton';
|
|
42
50
|
export default IntegrationButton;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
._18u0ze3t{margin-left:var(--ds-space-0,0)}
|
|
2
|
+
._19pkv77o{margin-top:var(--ds-space-025,2px)}
|
|
3
|
+
._1bah1e5h{justify-content:left}
|
|
4
|
+
._1e0c1txw{display:flex}
|
|
5
|
+
._2hwxu2gc{margin-right:var(--ds-space-100,8px)}
|
|
6
|
+
._otyrze3t{margin-bottom:var(--ds-space-0,0)}
|
|
7
|
+
._syaz10s3{color:var(--ds-text,#42526e)}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/* IntegrationButtonNext.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
2
|
+
import "./IntegrationButtonNext.compiled.css";
|
|
3
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import Button from '@atlaskit/button/new';
|
|
6
|
+
import { cx } from '@atlaskit/css';
|
|
7
|
+
import { Box, Text } from '@atlaskit/primitives/compiled';
|
|
8
|
+
import { N500 } from '@atlaskit/theme/colors';
|
|
9
|
+
const styles = {
|
|
10
|
+
integrationButtonCopyWrapperStyle: "_1e0c1txw _1bah1e5h _syaz10s3",
|
|
11
|
+
integrationIconWrapperStyle: "_19pkv77o _2hwxu2gc _otyrze3t _18u0ze3t"
|
|
12
|
+
};
|
|
13
|
+
const IntegrationButton = props => {
|
|
14
|
+
const {
|
|
15
|
+
text,
|
|
16
|
+
IntegrationIcon
|
|
17
|
+
} = props;
|
|
18
|
+
return /*#__PURE__*/React.createElement(Button, {
|
|
19
|
+
appearance: "subtle",
|
|
20
|
+
shouldFitContainer: true,
|
|
21
|
+
onClick: props.onClick
|
|
22
|
+
}, /*#__PURE__*/React.createElement(Box, {
|
|
23
|
+
as: "span",
|
|
24
|
+
xcss: cx(styles.integrationButtonCopyWrapperStyle)
|
|
25
|
+
}, /*#__PURE__*/React.createElement(Box, {
|
|
26
|
+
as: "span",
|
|
27
|
+
xcss: cx(styles.integrationIconWrapperStyle)
|
|
28
|
+
}, /*#__PURE__*/React.createElement(IntegrationIcon, null)), /*#__PURE__*/React.createElement(Text, {
|
|
29
|
+
color: "color.text"
|
|
30
|
+
}, text)));
|
|
31
|
+
};
|
|
32
|
+
IntegrationButton.displayName = 'IntegrationButton';
|
|
33
|
+
export default IntegrationButton;
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
/* LazyShareFormNext.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
2
|
+
import "./LazyShareFormNext.compiled.css";
|
|
3
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import { FormattedMessage } from 'react-intl-next';
|
|
6
|
+
import { AnalyticsContext } from '@atlaskit/analytics-next';
|
|
7
|
+
import { cx } from '@atlaskit/css';
|
|
8
|
+
import { Text } from '@atlaskit/primitives';
|
|
9
|
+
import { Box } from '@atlaskit/primitives/compiled';
|
|
10
|
+
import { messages } from '../../i18n';
|
|
11
|
+
import { INTEGRATION_MODAL_SOURCE } from '../analytics/analytics';
|
|
12
|
+
import { IntegrationForm } from '../IntegrationForm';
|
|
13
|
+
import { ShareForm } from '../ShareForm';
|
|
14
|
+
import { ShareFormWrapper } from '../ShareFormWrapper';
|
|
15
|
+
import { allowEmails } from '../utils';
|
|
16
|
+
const styles = {
|
|
17
|
+
footerBottomMessageStyles: "_1bsb1j89",
|
|
18
|
+
footerCustomStyles: "_19pkidpf _2hwx10v4 _otyrmgjw _18u010v4"
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* A Share form content which is lazy-loaded.
|
|
23
|
+
* Make sure this component is not exported inside main entry points `src/index.ts`
|
|
24
|
+
*/
|
|
25
|
+
function LazyShareForm(props) {
|
|
26
|
+
const {
|
|
27
|
+
copyLink,
|
|
28
|
+
config,
|
|
29
|
+
isFetchingConfig,
|
|
30
|
+
setIsLoading,
|
|
31
|
+
loadOptions,
|
|
32
|
+
shareFormTitle,
|
|
33
|
+
shareFormHelperMessage,
|
|
34
|
+
bottomMessage,
|
|
35
|
+
submitButtonLabel,
|
|
36
|
+
product,
|
|
37
|
+
productAttributes,
|
|
38
|
+
customFooter,
|
|
39
|
+
enableSmartUserPicker,
|
|
40
|
+
loggedInAccountId,
|
|
41
|
+
cloudId,
|
|
42
|
+
shareFieldsFooter,
|
|
43
|
+
onUserSelectionChange,
|
|
44
|
+
isPublicLink,
|
|
45
|
+
copyTooltipText,
|
|
46
|
+
shareIntegrations,
|
|
47
|
+
integrationMode,
|
|
48
|
+
additionalTabs,
|
|
49
|
+
builtInTabContentWidth,
|
|
50
|
+
isMenuItemSelected,
|
|
51
|
+
// actions
|
|
52
|
+
onLinkCopy,
|
|
53
|
+
onDismiss,
|
|
54
|
+
onSubmit,
|
|
55
|
+
onDialogClose,
|
|
56
|
+
onTabChange,
|
|
57
|
+
onMenuItemChange,
|
|
58
|
+
// ref
|
|
59
|
+
selectPortalRef,
|
|
60
|
+
// props from states of parent:
|
|
61
|
+
showIntegrationForm,
|
|
62
|
+
selectedIntegration,
|
|
63
|
+
isSharing,
|
|
64
|
+
shareError,
|
|
65
|
+
defaultValue,
|
|
66
|
+
showTitle,
|
|
67
|
+
orgId,
|
|
68
|
+
isBrowseUsersDisabled,
|
|
69
|
+
userPickerOptions,
|
|
70
|
+
isSubmitShareDisabled
|
|
71
|
+
} = props;
|
|
72
|
+
const footer = /*#__PURE__*/React.createElement("div", null, bottomMessage ? /*#__PURE__*/React.createElement(Box, {
|
|
73
|
+
xcss: cx(styles.footerBottomMessageStyles)
|
|
74
|
+
}, bottomMessage) : null, customFooter && selectedIntegration === null && /*#__PURE__*/React.createElement(Box, {
|
|
75
|
+
xcss: cx(styles.footerCustomStyles)
|
|
76
|
+
}, customFooter));
|
|
77
|
+
React.useEffect(() => {
|
|
78
|
+
setIsLoading(false);
|
|
79
|
+
});
|
|
80
|
+
const allowEmail = allowEmails(config);
|
|
81
|
+
return /*#__PURE__*/React.createElement(ShareFormWrapper, {
|
|
82
|
+
footer: footer
|
|
83
|
+
// form title will be determined by `title` and `showTitle` prop passed to `ShareForm`,
|
|
84
|
+
// so we don't need to show title via ShareFormWrapper
|
|
85
|
+
,
|
|
86
|
+
integrationMode: integrationMode,
|
|
87
|
+
isMenuItemSelected: isMenuItemSelected,
|
|
88
|
+
shouldShowTitle: false
|
|
89
|
+
}, showIntegrationForm && selectedIntegration !== null ? /*#__PURE__*/React.createElement(AnalyticsContext, {
|
|
90
|
+
data: {
|
|
91
|
+
source: INTEGRATION_MODAL_SOURCE
|
|
92
|
+
}
|
|
93
|
+
}, /*#__PURE__*/React.createElement(IntegrationForm, {
|
|
94
|
+
Content: selectedIntegration.Content,
|
|
95
|
+
onIntegrationClose: onDialogClose
|
|
96
|
+
})) : /*#__PURE__*/React.createElement(React.Fragment, null, allowEmail || !isBrowseUsersDisabled ? /*#__PURE__*/React.createElement(ShareForm, {
|
|
97
|
+
copyLink: copyLink,
|
|
98
|
+
loadOptions: loadOptions,
|
|
99
|
+
title: shareFormTitle,
|
|
100
|
+
showTitle: showTitle,
|
|
101
|
+
helperMessage: shareFormHelperMessage,
|
|
102
|
+
shareError: shareError,
|
|
103
|
+
defaultValue: defaultValue,
|
|
104
|
+
config: config,
|
|
105
|
+
submitButtonLabel: submitButtonLabel,
|
|
106
|
+
product: product,
|
|
107
|
+
productAttributes: productAttributes,
|
|
108
|
+
enableSmartUserPicker: enableSmartUserPicker,
|
|
109
|
+
loggedInAccountId: loggedInAccountId,
|
|
110
|
+
cloudId: cloudId,
|
|
111
|
+
fieldsFooter: shareFieldsFooter,
|
|
112
|
+
selectPortalRef: selectPortalRef,
|
|
113
|
+
copyTooltipText: copyTooltipText,
|
|
114
|
+
integrationMode: integrationMode,
|
|
115
|
+
shareIntegrations: shareIntegrations,
|
|
116
|
+
additionalTabs: additionalTabs,
|
|
117
|
+
builtInTabContentWidth: builtInTabContentWidth,
|
|
118
|
+
isSharing: isSharing,
|
|
119
|
+
isFetchingConfig: isFetchingConfig,
|
|
120
|
+
isPublicLink: isPublicLink,
|
|
121
|
+
orgId: orgId,
|
|
122
|
+
onSubmit: onSubmit,
|
|
123
|
+
onDismiss: onDismiss,
|
|
124
|
+
onLinkCopy: onLinkCopy,
|
|
125
|
+
onUserSelectionChange: onUserSelectionChange,
|
|
126
|
+
handleCloseDialog: onDialogClose,
|
|
127
|
+
onTabChange: onTabChange,
|
|
128
|
+
onMenuItemChange: onMenuItemChange,
|
|
129
|
+
isBrowseUsersDisabled: isBrowseUsersDisabled,
|
|
130
|
+
userPickerOptions: userPickerOptions,
|
|
131
|
+
isSubmitShareDisabled: isSubmitShareDisabled
|
|
132
|
+
}) : /*#__PURE__*/React.createElement(Text, {
|
|
133
|
+
as: "p"
|
|
134
|
+
}, /*#__PURE__*/React.createElement(FormattedMessage, messages.formNoPermissions))));
|
|
135
|
+
}
|
|
136
|
+
export default LazyShareForm;
|
|
@@ -6,8 +6,10 @@ import React, { lazy, Suspense } from 'react';
|
|
|
6
6
|
|
|
7
7
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
8
8
|
import { css, jsx } from '@emotion/react';
|
|
9
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
9
10
|
import Spinner from '@atlaskit/spinner';
|
|
10
11
|
import { ShareFormWrapper } from '../ShareFormWrapper';
|
|
12
|
+
import ComponentNext from './lazyNext';
|
|
11
13
|
const spinnerWrapperStyles = css({
|
|
12
14
|
width: '100%',
|
|
13
15
|
height: '100%',
|
|
@@ -38,7 +40,7 @@ const LoadingDialog = ({
|
|
|
38
40
|
css: spinnerWrapperStyles
|
|
39
41
|
}, jsx(Spinner, null)));
|
|
40
42
|
};
|
|
41
|
-
export default (props => jsx(Suspense, {
|
|
43
|
+
export default (props => fg('share-compiled-migration') ? jsx(ComponentNext, props) : jsx(Suspense, {
|
|
42
44
|
fallback: jsx(LoadingDialog, {
|
|
43
45
|
shareFormTitle: props.shareFormTitle,
|
|
44
46
|
showTitle: props.showTitle,
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/* lazyNext.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
2
|
+
import "./lazyNext.compiled.css";
|
|
3
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
4
|
+
import React, { lazy, Suspense } from 'react';
|
|
5
|
+
import { cx } from '@atlaskit/css';
|
|
6
|
+
import { Box } from '@atlaskit/primitives/compiled';
|
|
7
|
+
import Spinner from '@atlaskit/spinner';
|
|
8
|
+
import { ShareFormWrapper } from '../ShareFormWrapper';
|
|
9
|
+
const styles = {
|
|
10
|
+
spinnerWrapperStyles: "_1bsb1osq _4t3i1osq _1e0c1txw _1bah1h6o _ae4v1h6o"
|
|
11
|
+
};
|
|
12
|
+
const LazyShareFormLazy = /*#__PURE__*/lazy(() => import( /* webpackChunkName: "@atlaskit-internal_share-form-next" */
|
|
13
|
+
'./LazyShareFormNext'));
|
|
14
|
+
const LoadingDialog = ({
|
|
15
|
+
shareFormTitle,
|
|
16
|
+
showTitle,
|
|
17
|
+
setIsLoading,
|
|
18
|
+
integrationMode,
|
|
19
|
+
isMenuItemSelected
|
|
20
|
+
}) => {
|
|
21
|
+
React.useEffect(() => {
|
|
22
|
+
setIsLoading(true);
|
|
23
|
+
});
|
|
24
|
+
return /*#__PURE__*/React.createElement(ShareFormWrapper, {
|
|
25
|
+
shareFormTitle: shareFormTitle,
|
|
26
|
+
integrationMode: integrationMode,
|
|
27
|
+
isMenuItemSelected: isMenuItemSelected
|
|
28
|
+
// if `showTitle` is passed, we use it. Otherwise, we will show title for loading dialog.
|
|
29
|
+
,
|
|
30
|
+
shouldShowTitle: typeof showTitle === 'boolean' ? showTitle : true
|
|
31
|
+
}, /*#__PURE__*/React.createElement(Box, {
|
|
32
|
+
xcss: cx(styles.spinnerWrapperStyles)
|
|
33
|
+
}, /*#__PURE__*/React.createElement(Spinner, null)));
|
|
34
|
+
};
|
|
35
|
+
export default (props => /*#__PURE__*/React.createElement(Suspense, {
|
|
36
|
+
fallback: /*#__PURE__*/React.createElement(LoadingDialog, {
|
|
37
|
+
shareFormTitle: props.shareFormTitle,
|
|
38
|
+
showTitle: props.showTitle,
|
|
39
|
+
setIsLoading: props.setIsLoading,
|
|
40
|
+
integrationMode: props.integrationMode,
|
|
41
|
+
isMenuItemSelected: props.isMenuItemSelected
|
|
42
|
+
})
|
|
43
|
+
}, /*#__PURE__*/React.createElement(LazyShareFormLazy, props)));
|
|
@@ -26,6 +26,7 @@ import { isValidFailedExperience } from './analytics/ufoExperienceHelper';
|
|
|
26
26
|
import { renderShareDialogExp, shareSubmitExp } from './analytics/ufoExperiences';
|
|
27
27
|
import LazyShareFormLazy from './LazyShareForm/lazy';
|
|
28
28
|
import ShareButton from './ShareButton';
|
|
29
|
+
import { ShareDialogWithTriggerInternal as ShareDialogWithTriggerInternalNext } from './ShareDialogWithTriggerNext';
|
|
29
30
|
import SplitButton from './SplitButton';
|
|
30
31
|
import { generateSelectZIndex, resolveShareFooter } from './utils';
|
|
31
32
|
const shareButtonWrapperStyles = css({
|
|
@@ -46,7 +47,7 @@ export const IconShare = () => jsx(ShareIcon, {
|
|
|
46
47
|
});
|
|
47
48
|
|
|
48
49
|
// eslint-disable-next-line @repo/internal/react/no-class-components
|
|
49
|
-
export class
|
|
50
|
+
export class ShareDialogWithTriggerInternalLegacy extends React.PureComponent {
|
|
50
51
|
constructor(...args) {
|
|
51
52
|
super(...args);
|
|
52
53
|
_defineProperty(this, "containerRef", /*#__PURE__*/React.createRef());
|
|
@@ -612,7 +613,7 @@ export class ShareDialogWithTriggerInternal extends React.PureComponent {
|
|
|
612
613
|
);
|
|
613
614
|
}
|
|
614
615
|
}
|
|
615
|
-
_defineProperty(
|
|
616
|
+
_defineProperty(ShareDialogWithTriggerInternalLegacy, "defaultProps", {
|
|
616
617
|
isDisabled: false,
|
|
617
618
|
dialogPlacement: 'bottom-end',
|
|
618
619
|
shouldCloseOnEscapePress: true,
|
|
@@ -621,4 +622,5 @@ _defineProperty(ShareDialogWithTriggerInternal, "defaultProps", {
|
|
|
621
622
|
triggerButtonTooltipPosition: 'top',
|
|
622
623
|
dialogZIndex: layers.modal()
|
|
623
624
|
});
|
|
625
|
+
export const ShareDialogWithTriggerInternal = props => fg('share-compiled-migration') ? jsx(ShareDialogWithTriggerInternalNext, props) : jsx(ShareDialogWithTriggerInternalLegacy, props);
|
|
624
626
|
export const ShareDialogWithTrigger = withAnalyticsEvents()(injectIntl(ShareDialogWithTriggerInternal));
|