@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.
Files changed (88) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/afm-cc/tsconfig.json +3 -0
  3. package/afm-jira/tsconfig.json +3 -0
  4. package/dist/cjs/components/CopyLinkButton.js +11 -7
  5. package/dist/cjs/components/CopyLinkButtonNext.compiled.css +8 -0
  6. package/dist/cjs/components/CopyLinkButtonNext.js +180 -0
  7. package/dist/cjs/components/IntegrationButton.js +10 -1
  8. package/dist/cjs/components/IntegrationButtonNext.compiled.css +7 -0
  9. package/dist/cjs/components/IntegrationButtonNext.js +38 -0
  10. package/dist/cjs/components/LazyShareForm/LazyShareFormNext.compiled.css +5 -0
  11. package/dist/cjs/components/LazyShareForm/LazyShareFormNext.js +138 -0
  12. package/dist/cjs/components/LazyShareForm/lazy.js +3 -1
  13. package/dist/cjs/components/LazyShareForm/lazyNext.compiled.css +5 -0
  14. package/dist/cjs/components/LazyShareForm/lazyNext.js +58 -0
  15. package/dist/cjs/components/ShareDialogWithTrigger.js +12 -8
  16. package/dist/cjs/components/ShareDialogWithTriggerNext.compiled.css +4 -0
  17. package/dist/cjs/components/ShareDialogWithTriggerNext.js +653 -0
  18. package/dist/cjs/components/ShareFormNext.compiled.css +21 -0
  19. package/dist/cjs/components/ShareFormNext.js +473 -0
  20. package/dist/cjs/components/ShareFormWrapper/ShareFormWrapper.js +6 -2
  21. package/dist/cjs/components/ShareFormWrapper/compiled.compiled.css +7 -0
  22. package/dist/cjs/components/ShareFormWrapper/compiled.js +48 -0
  23. package/dist/cjs/components/SplitButton.js +25 -17
  24. package/dist/cjs/components/UserPickerField.js +3 -1
  25. package/dist/cjs/components/analytics/analytics.js +1 -1
  26. package/dist/es2019/components/CopyLinkButton.js +3 -1
  27. package/dist/es2019/components/CopyLinkButtonNext.compiled.css +8 -0
  28. package/dist/es2019/components/CopyLinkButtonNext.js +151 -0
  29. package/dist/es2019/components/IntegrationButton.js +9 -1
  30. package/dist/es2019/components/IntegrationButtonNext.compiled.css +7 -0
  31. package/dist/es2019/components/IntegrationButtonNext.js +33 -0
  32. package/dist/es2019/components/LazyShareForm/LazyShareFormNext.compiled.css +5 -0
  33. package/dist/es2019/components/LazyShareForm/LazyShareFormNext.js +136 -0
  34. package/dist/es2019/components/LazyShareForm/lazy.js +3 -1
  35. package/dist/es2019/components/LazyShareForm/lazyNext.compiled.css +5 -0
  36. package/dist/es2019/components/LazyShareForm/lazyNext.js +43 -0
  37. package/dist/es2019/components/ShareDialogWithTrigger.js +4 -2
  38. package/dist/es2019/components/ShareDialogWithTriggerNext.compiled.css +4 -0
  39. package/dist/es2019/components/ShareDialogWithTriggerNext.js +593 -0
  40. package/dist/es2019/components/ShareFormNext.compiled.css +21 -0
  41. package/dist/es2019/components/ShareFormNext.js +417 -0
  42. package/dist/es2019/components/ShareFormWrapper/ShareFormWrapper.js +6 -2
  43. package/dist/es2019/components/ShareFormWrapper/compiled.compiled.css +7 -0
  44. package/dist/es2019/components/ShareFormWrapper/compiled.js +41 -0
  45. package/dist/es2019/components/SplitButton.js +9 -3
  46. package/dist/es2019/components/UserPickerField.js +3 -1
  47. package/dist/es2019/components/analytics/analytics.js +1 -1
  48. package/dist/esm/components/CopyLinkButton.js +10 -6
  49. package/dist/esm/components/CopyLinkButtonNext.compiled.css +8 -0
  50. package/dist/esm/components/CopyLinkButtonNext.js +173 -0
  51. package/dist/esm/components/IntegrationButton.js +11 -1
  52. package/dist/esm/components/IntegrationButtonNext.compiled.css +7 -0
  53. package/dist/esm/components/IntegrationButtonNext.js +31 -0
  54. package/dist/esm/components/LazyShareForm/LazyShareFormNext.compiled.css +5 -0
  55. package/dist/esm/components/LazyShareForm/LazyShareFormNext.js +131 -0
  56. package/dist/esm/components/LazyShareForm/lazy.js +3 -1
  57. package/dist/esm/components/LazyShareForm/lazyNext.compiled.css +5 -0
  58. package/dist/esm/components/LazyShareForm/lazyNext.js +46 -0
  59. package/dist/esm/components/ShareDialogWithTrigger.js +11 -7
  60. package/dist/esm/components/ShareDialogWithTriggerNext.compiled.css +4 -0
  61. package/dist/esm/components/ShareDialogWithTriggerNext.js +646 -0
  62. package/dist/esm/components/ShareFormNext.compiled.css +21 -0
  63. package/dist/esm/components/ShareFormNext.js +463 -0
  64. package/dist/esm/components/ShareFormWrapper/ShareFormWrapper.js +6 -2
  65. package/dist/esm/components/ShareFormWrapper/compiled.compiled.css +7 -0
  66. package/dist/esm/components/ShareFormWrapper/compiled.js +41 -0
  67. package/dist/esm/components/SplitButton.js +25 -17
  68. package/dist/esm/components/UserPickerField.js +3 -1
  69. package/dist/esm/components/analytics/analytics.js +1 -1
  70. package/dist/types/components/CopyLinkButton.d.ts +2 -1
  71. package/dist/types/components/CopyLinkButtonNext.d.ts +35 -0
  72. package/dist/types/components/IntegrationButtonNext.d.ts +11 -0
  73. package/dist/types/components/LazyShareForm/LazyShareFormNext.d.ts +21 -0
  74. package/dist/types/components/LazyShareForm/lazyNext.d.ts +4 -0
  75. package/dist/types/components/ShareDialogWithTrigger.d.ts +3 -3
  76. package/dist/types/components/ShareDialogWithTriggerNext.d.ts +47 -0
  77. package/dist/types/components/ShareFormNext.d.ts +9 -0
  78. package/dist/types/components/ShareFormWrapper/compiled.d.ts +10 -0
  79. package/dist/types-ts4.5/components/CopyLinkButton.d.ts +2 -1
  80. package/dist/types-ts4.5/components/CopyLinkButtonNext.d.ts +35 -0
  81. package/dist/types-ts4.5/components/IntegrationButtonNext.d.ts +11 -0
  82. package/dist/types-ts4.5/components/LazyShareForm/LazyShareFormNext.d.ts +21 -0
  83. package/dist/types-ts4.5/components/LazyShareForm/lazyNext.d.ts +4 -0
  84. package/dist/types-ts4.5/components/ShareDialogWithTrigger.d.ts +3 -3
  85. package/dist/types-ts4.5/components/ShareDialogWithTriggerNext.d.ts +47 -0
  86. package/dist/types-ts4.5/components/ShareFormNext.d.ts +9 -0
  87. package/dist/types-ts4.5/components/ShareFormWrapper/compiled.d.ts +10 -0
  88. package/package.json +29 -25
@@ -0,0 +1,173 @@
1
+ /* CopyLinkButtonNext.tsx generated by @compiled/babel-plugin v0.36.1 */
2
+ import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
3
+ import _createClass from "@babel/runtime/helpers/createClass";
4
+ import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
5
+ import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
6
+ import _inherits from "@babel/runtime/helpers/inherits";
7
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
8
+ import "./CopyLinkButtonNext.compiled.css";
9
+ import { ax, ix } from "@compiled/react/runtime";
10
+ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
11
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
12
+ import React from 'react';
13
+ import { cx } from '@atlaskit/css';
14
+ import LinkFilledIcon from '@atlaskit/icon/core/migration/link--link-filled';
15
+ import CheckCircleIcon from '@atlaskit/icon/core/migration/success--check-circle';
16
+ import { fg } from '@atlaskit/platform-feature-flags';
17
+ import Popup from '@atlaskit/popup';
18
+ import { Box } from '@atlaskit/primitives/compiled';
19
+ import { G300 } from '@atlaskit/theme/colors';
20
+ import { layers } from '@atlaskit/theme/constants';
21
+ import Tooltip from '@atlaskit/tooltip';
22
+ import { InlineDialogContentWrapper } from './ShareFormWrapper/compiled';
23
+ import Button from './styles';
24
+ var Z_INDEX = layers.modal();
25
+ var AUTO_DISMISS_SECONDS = 8;
26
+ export var AUTO_DISMISS_MS = AUTO_DISMISS_SECONDS * 1000;
27
+ var styles = {
28
+ messageContainer: "_1e0c1txw _4cvr1h6o _19pkx0bf _2hwxmgjw _otyrx0bf _18u0mgjw",
29
+ boxWrapper: "_2hwxv77o",
30
+ messageText: "_azhw12x7"
31
+ };
32
+ var isSafari = typeof window !== 'undefined' && window.navigator.userAgent.indexOf('Safari');
33
+ export var HiddenInput = /*#__PURE__*/React.forwardRef(
34
+ // we need a hidden input to reliably copy to clipboard across all browsers.
35
+ function (props, ref) {
36
+ return /*#__PURE__*/React.createElement("input", {
37
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
38
+ style: {
39
+ position: 'absolute',
40
+ left: '-9999px'
41
+ },
42
+ tabIndex: -1,
43
+ "aria-hidden": true,
44
+ ref: ref,
45
+ value: props.text,
46
+ "aria-label": props.label,
47
+ readOnly: true
48
+ });
49
+ });
50
+ // eslint-disable-next-line @repo/internal/react/no-class-components
51
+ export var CopyLinkButton = /*#__PURE__*/function (_React$Component) {
52
+ function CopyLinkButton() {
53
+ var _this;
54
+ _classCallCheck(this, CopyLinkButton);
55
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
56
+ args[_key] = arguments[_key];
57
+ }
58
+ _this = _callSuper(this, CopyLinkButton, [].concat(args));
59
+ _defineProperty(_this, "inputRef", /*#__PURE__*/React.createRef());
60
+ _defineProperty(_this, "state", {
61
+ shouldShowCopiedMessage: false
62
+ });
63
+ _defineProperty(_this, "clearAutoDismiss", function () {
64
+ if (_this.autoDismiss) {
65
+ clearTimeout(_this.autoDismiss);
66
+ _this.autoDismiss = undefined;
67
+ }
68
+ });
69
+ _defineProperty(_this, "handleClick", function () {
70
+ _this.inputRef.current.select();
71
+ document.execCommand('copy');
72
+ if (_this.props.onLinkCopy) {
73
+ _this.props.onLinkCopy(_this.props.link);
74
+ }
75
+ _this.setState({
76
+ shouldShowCopiedMessage: true
77
+ }, function () {
78
+ _this.clearAutoDismiss();
79
+ _this.autoDismiss = setTimeout(function () {
80
+ _this.setState({
81
+ shouldShowCopiedMessage: false
82
+ });
83
+ }, AUTO_DISMISS_MS);
84
+ });
85
+ });
86
+ _defineProperty(_this, "handleDismissCopiedMessage", function () {
87
+ _this.clearAutoDismiss();
88
+ _this.setState({
89
+ shouldShowCopiedMessage: false
90
+ });
91
+ });
92
+ _defineProperty(_this, "renderTriggerButton", function (triggerProps) {
93
+ var _this$props = _this.props,
94
+ isDisabled = _this$props.isDisabled,
95
+ copyLinkButtonText = _this$props.copyLinkButtonText,
96
+ children = _this$props.children,
97
+ iconBefore = _this$props.iconBefore;
98
+ return /*#__PURE__*/React.createElement(Button, {
99
+ "aria-label": copyLinkButtonText,
100
+ isDisabled: isDisabled
101
+ // 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.
102
+ // https://product-fabric.atlassian.net/browse/DSP-18980
103
+ ,
104
+ appearance: "subtle-link",
105
+ iconBefore: iconBefore || /*#__PURE__*/React.createElement(Box, {
106
+ xcss: cx(styles.boxWrapper)
107
+ }, /*#__PURE__*/React.createElement(LinkFilledIcon, {
108
+ LEGACY_margin: "0 ".concat("var(--ds-space-negative-025, -2px)", " 0 0"),
109
+ color: "currentColor",
110
+ label: "",
111
+ LEGACY_size: "medium"
112
+ })),
113
+ onClick: _this.handleClick,
114
+ ref: triggerProps.ref
115
+ }, children || copyLinkButtonText);
116
+ });
117
+ return _this;
118
+ }
119
+ _inherits(CopyLinkButton, _React$Component);
120
+ return _createClass(CopyLinkButton, [{
121
+ key: "componentWillUnmount",
122
+ value: function componentWillUnmount() {
123
+ this.clearAutoDismiss();
124
+ }
125
+ }, {
126
+ key: "render",
127
+ value: function render() {
128
+ var _this2 = this;
129
+ var shouldShowCopiedMessage = this.state.shouldShowCopiedMessage;
130
+ var _this$props2 = this.props,
131
+ copyTooltipText = _this$props2.copyTooltipText,
132
+ copiedToClipboardText = _this$props2.copiedToClipboardText;
133
+ return /*#__PURE__*/React.createElement(React.Fragment, null, isSafari &&
134
+ /*#__PURE__*/
135
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
136
+ React.createElement("div", {
137
+ className: "assistive",
138
+ "aria-live": "assertive"
139
+ }, shouldShowCopiedMessage && copiedToClipboardText), /*#__PURE__*/React.createElement(HiddenInput, {
140
+ ref: this.inputRef,
141
+ text: this.props.link,
142
+ label: copiedToClipboardText
143
+ }), /*#__PURE__*/React.createElement(Popup, {
144
+ zIndex: Z_INDEX,
145
+ autoFocus: false,
146
+ content: function content() {
147
+ return /*#__PURE__*/React.createElement(InlineDialogContentWrapper, null, /*#__PURE__*/React.createElement(Box, {
148
+ xcss: cx(styles.messageContainer),
149
+ testId: "message-container",
150
+ "aria-hidden": true
151
+ }, /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(CheckCircleIcon, {
152
+ spacing: "spacious",
153
+ label: "",
154
+ color: "var(--ds-icon-success, ".concat(G300, ")")
155
+ }), /*#__PURE__*/React.createElement(Box, {
156
+ xcss: cx(styles.messageText)
157
+ }, copiedToClipboardText))));
158
+ },
159
+ isOpen: shouldShowCopiedMessage,
160
+ onClose: this.handleDismissCopiedMessage,
161
+ placement: "top-start",
162
+ trigger: function trigger(triggerProps) {
163
+ return copyTooltipText ? /*#__PURE__*/React.createElement(Tooltip, {
164
+ content: copyTooltipText,
165
+ position: "bottom-start"
166
+ }, _this2.renderTriggerButton(triggerProps)) : _this2.renderTriggerButton(triggerProps);
167
+ },
168
+ shouldRenderToParent: fg('enable-appropriate-reading-order-in-share-dialog')
169
+ }));
170
+ }
171
+ }]);
172
+ }(React.Component);
173
+ export default CopyLinkButton;
@@ -11,13 +11,16 @@ import React from 'react';
11
11
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
12
12
  import { css, jsx } from '@emotion/react';
13
13
  import Button from '@atlaskit/button/custom-theme-button';
14
+ import { fg } from '@atlaskit/platform-feature-flags';
14
15
  import { N500 } from '@atlaskit/theme/colors';
16
+ import IntegrationButtonNext from './IntegrationButtonNext';
17
+
15
18
  // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/design-system/no-css-tagged-template-expression -- Ignored via go/DSP-18766
16
19
  var integrationButtonCopyWrapperStyle = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n\tdisplay: flex;\n\tjustify-content: left;\n"])));
17
20
 
18
21
  // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/design-system/no-css-tagged-template-expression -- Ignored via go/DSP-18766
19
22
  var integrationIconWrapperStyle = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n\tmargin: ", " ", " ", "\n\t\t", ";\n"])), "var(--ds-space-025, 2px)", "var(--ds-space-100, 8px)", "var(--ds-space-0, 0px)", "var(--ds-space-0, 0px)");
20
- var IntegrationButton = function IntegrationButton(props) {
23
+ var IntegrationButtonInner = function IntegrationButtonInner(props) {
21
24
  var text = props.text,
22
25
  textColor = props.textColor,
23
26
  IntegrationIcon = props.IntegrationIcon,
@@ -34,5 +37,12 @@ var IntegrationButton = function IntegrationButton(props) {
34
37
  }, jsx(IntegrationIcon, null)), jsx("span", null, text)))
35
38
  );
36
39
  };
40
+ var IntegrationButton = function IntegrationButton(props) {
41
+ return fg('share-compiled-migration') ? jsx(IntegrationButtonNext, {
42
+ text: props.text,
43
+ onClick: props.onClick,
44
+ IntegrationIcon: props.IntegrationIcon
45
+ }) : jsx(IntegrationButtonInner, props);
46
+ };
37
47
  IntegrationButton.displayName = 'IntegrationButton';
38
48
  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,31 @@
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
+ var styles = {
10
+ integrationButtonCopyWrapperStyle: "_1e0c1txw _1bah1e5h _syaz10s3",
11
+ integrationIconWrapperStyle: "_19pkv77o _2hwxu2gc _otyrze3t _18u0ze3t"
12
+ };
13
+ var IntegrationButton = function IntegrationButton(props) {
14
+ var text = props.text,
15
+ IntegrationIcon = props.IntegrationIcon;
16
+ return /*#__PURE__*/React.createElement(Button, {
17
+ appearance: "subtle",
18
+ shouldFitContainer: true,
19
+ onClick: props.onClick
20
+ }, /*#__PURE__*/React.createElement(Box, {
21
+ as: "span",
22
+ xcss: cx(styles.integrationButtonCopyWrapperStyle)
23
+ }, /*#__PURE__*/React.createElement(Box, {
24
+ as: "span",
25
+ xcss: cx(styles.integrationIconWrapperStyle)
26
+ }, /*#__PURE__*/React.createElement(IntegrationIcon, null)), /*#__PURE__*/React.createElement(Text, {
27
+ color: "color.text"
28
+ }, text)));
29
+ };
30
+ IntegrationButton.displayName = 'IntegrationButton';
31
+ export default IntegrationButton;
@@ -0,0 +1,5 @@
1
+ ._18u010v4{margin-left:var(--ds-space-negative-300,-24px)}
2
+ ._19pkidpf{margin-top:0}
3
+ ._1bsb1j89{width:22pc}
4
+ ._2hwx10v4{margin-right:var(--ds-space-negative-300,-24px)}
5
+ ._otyrmgjw{margin-bottom:var(--ds-space-negative-200,-1pc)}
@@ -0,0 +1,131 @@
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
+ var 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
+ var copyLink = props.copyLink,
27
+ config = props.config,
28
+ isFetchingConfig = props.isFetchingConfig,
29
+ setIsLoading = props.setIsLoading,
30
+ loadOptions = props.loadOptions,
31
+ shareFormTitle = props.shareFormTitle,
32
+ shareFormHelperMessage = props.shareFormHelperMessage,
33
+ bottomMessage = props.bottomMessage,
34
+ submitButtonLabel = props.submitButtonLabel,
35
+ product = props.product,
36
+ productAttributes = props.productAttributes,
37
+ customFooter = props.customFooter,
38
+ enableSmartUserPicker = props.enableSmartUserPicker,
39
+ loggedInAccountId = props.loggedInAccountId,
40
+ cloudId = props.cloudId,
41
+ shareFieldsFooter = props.shareFieldsFooter,
42
+ onUserSelectionChange = props.onUserSelectionChange,
43
+ isPublicLink = props.isPublicLink,
44
+ copyTooltipText = props.copyTooltipText,
45
+ shareIntegrations = props.shareIntegrations,
46
+ integrationMode = props.integrationMode,
47
+ additionalTabs = props.additionalTabs,
48
+ builtInTabContentWidth = props.builtInTabContentWidth,
49
+ isMenuItemSelected = props.isMenuItemSelected,
50
+ onLinkCopy = props.onLinkCopy,
51
+ onDismiss = props.onDismiss,
52
+ onSubmit = props.onSubmit,
53
+ onDialogClose = props.onDialogClose,
54
+ onTabChange = props.onTabChange,
55
+ onMenuItemChange = props.onMenuItemChange,
56
+ selectPortalRef = props.selectPortalRef,
57
+ showIntegrationForm = props.showIntegrationForm,
58
+ selectedIntegration = props.selectedIntegration,
59
+ isSharing = props.isSharing,
60
+ shareError = props.shareError,
61
+ defaultValue = props.defaultValue,
62
+ showTitle = props.showTitle,
63
+ orgId = props.orgId,
64
+ isBrowseUsersDisabled = props.isBrowseUsersDisabled,
65
+ userPickerOptions = props.userPickerOptions,
66
+ isSubmitShareDisabled = props.isSubmitShareDisabled;
67
+ var footer = /*#__PURE__*/React.createElement("div", null, bottomMessage ? /*#__PURE__*/React.createElement(Box, {
68
+ xcss: cx(styles.footerBottomMessageStyles)
69
+ }, bottomMessage) : null, customFooter && selectedIntegration === null && /*#__PURE__*/React.createElement(Box, {
70
+ xcss: cx(styles.footerCustomStyles)
71
+ }, customFooter));
72
+ React.useEffect(function () {
73
+ setIsLoading(false);
74
+ });
75
+ var allowEmail = allowEmails(config);
76
+ return /*#__PURE__*/React.createElement(ShareFormWrapper, {
77
+ footer: footer
78
+ // form title will be determined by `title` and `showTitle` prop passed to `ShareForm`,
79
+ // so we don't need to show title via ShareFormWrapper
80
+ ,
81
+ integrationMode: integrationMode,
82
+ isMenuItemSelected: isMenuItemSelected,
83
+ shouldShowTitle: false
84
+ }, showIntegrationForm && selectedIntegration !== null ? /*#__PURE__*/React.createElement(AnalyticsContext, {
85
+ data: {
86
+ source: INTEGRATION_MODAL_SOURCE
87
+ }
88
+ }, /*#__PURE__*/React.createElement(IntegrationForm, {
89
+ Content: selectedIntegration.Content,
90
+ onIntegrationClose: onDialogClose
91
+ })) : /*#__PURE__*/React.createElement(React.Fragment, null, allowEmail || !isBrowseUsersDisabled ? /*#__PURE__*/React.createElement(ShareForm, {
92
+ copyLink: copyLink,
93
+ loadOptions: loadOptions,
94
+ title: shareFormTitle,
95
+ showTitle: showTitle,
96
+ helperMessage: shareFormHelperMessage,
97
+ shareError: shareError,
98
+ defaultValue: defaultValue,
99
+ config: config,
100
+ submitButtonLabel: submitButtonLabel,
101
+ product: product,
102
+ productAttributes: productAttributes,
103
+ enableSmartUserPicker: enableSmartUserPicker,
104
+ loggedInAccountId: loggedInAccountId,
105
+ cloudId: cloudId,
106
+ fieldsFooter: shareFieldsFooter,
107
+ selectPortalRef: selectPortalRef,
108
+ copyTooltipText: copyTooltipText,
109
+ integrationMode: integrationMode,
110
+ shareIntegrations: shareIntegrations,
111
+ additionalTabs: additionalTabs,
112
+ builtInTabContentWidth: builtInTabContentWidth,
113
+ isSharing: isSharing,
114
+ isFetchingConfig: isFetchingConfig,
115
+ isPublicLink: isPublicLink,
116
+ orgId: orgId,
117
+ onSubmit: onSubmit,
118
+ onDismiss: onDismiss,
119
+ onLinkCopy: onLinkCopy,
120
+ onUserSelectionChange: onUserSelectionChange,
121
+ handleCloseDialog: onDialogClose,
122
+ onTabChange: onTabChange,
123
+ onMenuItemChange: onMenuItemChange,
124
+ isBrowseUsersDisabled: isBrowseUsersDisabled,
125
+ userPickerOptions: userPickerOptions,
126
+ isSubmitShareDisabled: isSubmitShareDisabled
127
+ }) : /*#__PURE__*/React.createElement(Text, {
128
+ as: "p"
129
+ }, /*#__PURE__*/React.createElement(FormattedMessage, messages.formNoPermissions))));
130
+ }
131
+ 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
  var spinnerWrapperStyles = css({
12
14
  width: '100%',
13
15
  height: '100%',
@@ -40,7 +42,7 @@ var LoadingDialog = function LoadingDialog(_ref) {
40
42
  }, jsx(Spinner, null)));
41
43
  };
42
44
  export default (function (props) {
43
- return jsx(Suspense, {
45
+ return fg('share-compiled-migration') ? jsx(ComponentNext, props) : jsx(Suspense, {
44
46
  fallback: jsx(LoadingDialog, {
45
47
  shareFormTitle: props.shareFormTitle,
46
48
  showTitle: props.showTitle,
@@ -0,0 +1,5 @@
1
+ ._1bah1h6o{justify-content:center}
2
+ ._1bsb1osq{width:100%}
3
+ ._1e0c1txw{display:flex}
4
+ ._4t3i1osq{height:100%}
5
+ ._ae4v1h6o{align-content:center}
@@ -0,0 +1,46 @@
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
+ var styles = {
10
+ spinnerWrapperStyles: "_1bsb1osq _4t3i1osq _1e0c1txw _1bah1h6o _ae4v1h6o"
11
+ };
12
+ var LazyShareFormLazy = /*#__PURE__*/lazy(function () {
13
+ return import( /* webpackChunkName: "@atlaskit-internal_share-form-next" */
14
+ './LazyShareFormNext');
15
+ });
16
+ var LoadingDialog = function LoadingDialog(_ref) {
17
+ var shareFormTitle = _ref.shareFormTitle,
18
+ showTitle = _ref.showTitle,
19
+ setIsLoading = _ref.setIsLoading,
20
+ integrationMode = _ref.integrationMode,
21
+ isMenuItemSelected = _ref.isMenuItemSelected;
22
+ React.useEffect(function () {
23
+ setIsLoading(true);
24
+ });
25
+ return /*#__PURE__*/React.createElement(ShareFormWrapper, {
26
+ shareFormTitle: shareFormTitle,
27
+ integrationMode: integrationMode,
28
+ isMenuItemSelected: isMenuItemSelected
29
+ // if `showTitle` is passed, we use it. Otherwise, we will show title for loading dialog.
30
+ ,
31
+ shouldShowTitle: typeof showTitle === 'boolean' ? showTitle : true
32
+ }, /*#__PURE__*/React.createElement(Box, {
33
+ xcss: cx(styles.spinnerWrapperStyles)
34
+ }, /*#__PURE__*/React.createElement(Spinner, null)));
35
+ };
36
+ export default (function (props) {
37
+ return /*#__PURE__*/React.createElement(Suspense, {
38
+ fallback: /*#__PURE__*/React.createElement(LoadingDialog, {
39
+ shareFormTitle: props.shareFormTitle,
40
+ showTitle: props.showTitle,
41
+ setIsLoading: props.setIsLoading,
42
+ integrationMode: props.integrationMode,
43
+ isMenuItemSelected: props.isMenuItemSelected
44
+ })
45
+ }, /*#__PURE__*/React.createElement(LazyShareFormLazy, props));
46
+ });
@@ -37,6 +37,7 @@ import { isValidFailedExperience } from './analytics/ufoExperienceHelper';
37
37
  import { renderShareDialogExp, shareSubmitExp } from './analytics/ufoExperiences';
38
38
  import LazyShareFormLazy from './LazyShareForm/lazy';
39
39
  import ShareButton from './ShareButton';
40
+ import { ShareDialogWithTriggerInternal as ShareDialogWithTriggerInternalNext } from './ShareDialogWithTriggerNext';
40
41
  import SplitButton from './SplitButton';
41
42
  import { generateSelectZIndex, resolveShareFooter } from './utils';
42
43
  var shareButtonWrapperStyles = css({
@@ -59,14 +60,14 @@ export var IconShare = function IconShare() {
59
60
  };
60
61
 
61
62
  // eslint-disable-next-line @repo/internal/react/no-class-components
62
- export var ShareDialogWithTriggerInternal = /*#__PURE__*/function (_React$PureComponent) {
63
- function ShareDialogWithTriggerInternal() {
63
+ export var ShareDialogWithTriggerInternalLegacy = /*#__PURE__*/function (_React$PureComponent) {
64
+ function ShareDialogWithTriggerInternalLegacy() {
64
65
  var _this;
65
- _classCallCheck(this, ShareDialogWithTriggerInternal);
66
+ _classCallCheck(this, ShareDialogWithTriggerInternalLegacy);
66
67
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
67
68
  args[_key] = arguments[_key];
68
69
  }
69
- _this = _callSuper(this, ShareDialogWithTriggerInternal, [].concat(args));
70
+ _this = _callSuper(this, ShareDialogWithTriggerInternalLegacy, [].concat(args));
70
71
  _defineProperty(_this, "containerRef", /*#__PURE__*/React.createRef());
71
72
  /**
72
73
  * Because the PopUp component has a higher zIndex it causes
@@ -469,8 +470,8 @@ export var ShareDialogWithTriggerInternal = /*#__PURE__*/function (_React$PureCo
469
470
  });
470
471
  return _this;
471
472
  }
472
- _inherits(ShareDialogWithTriggerInternal, _React$PureComponent);
473
- return _createClass(ShareDialogWithTriggerInternal, [{
473
+ _inherits(ShareDialogWithTriggerInternalLegacy, _React$PureComponent);
474
+ return _createClass(ShareDialogWithTriggerInternalLegacy, [{
474
475
  key: "componentDidMount",
475
476
  value: function componentDidMount() {
476
477
  if (this.props.isAutoOpenDialog) {
@@ -665,7 +666,7 @@ export var ShareDialogWithTriggerInternal = /*#__PURE__*/function (_React$PureCo
665
666
  }
666
667
  }]);
667
668
  }(React.PureComponent);
668
- _defineProperty(ShareDialogWithTriggerInternal, "defaultProps", {
669
+ _defineProperty(ShareDialogWithTriggerInternalLegacy, "defaultProps", {
669
670
  isDisabled: false,
670
671
  dialogPlacement: 'bottom-end',
671
672
  shouldCloseOnEscapePress: true,
@@ -674,4 +675,7 @@ _defineProperty(ShareDialogWithTriggerInternal, "defaultProps", {
674
675
  triggerButtonTooltipPosition: 'top',
675
676
  dialogZIndex: layers.modal()
676
677
  });
678
+ export var ShareDialogWithTriggerInternal = function ShareDialogWithTriggerInternal(props) {
679
+ return fg('share-compiled-migration') ? jsx(ShareDialogWithTriggerInternalNext, props) : jsx(ShareDialogWithTriggerInternalLegacy, props);
680
+ };
677
681
  export var ShareDialogWithTrigger = withAnalyticsEvents()(injectIntl(ShareDialogWithTriggerInternal));
@@ -0,0 +1,4 @@
1
+ ._12ji1r31{outline-color:currentColor}
2
+ ._12y31o36{outline-width:medium}
3
+ ._1e0c116y{display:inline-flex}
4
+ ._1qu2glyw{outline-style:none}