@atlaskit/editor-common 93.1.5 → 93.1.6
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 +24 -0
- package/afm-cc/tsconfig.json +3 -0
- package/dist/cjs/analytics/types/engagement-platform-events.js +5 -0
- package/dist/cjs/analytics/types/enums.js +1 -0
- package/dist/cjs/element-browser/components/StatelessElementBrowser.js +1 -2
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/cjs/ui/FloatingToolbar/Button.js +6 -2
- package/dist/cjs/ui/Mention/index.js +15 -3
- package/dist/cjs/ui/Mention/mention-with-providers.js +58 -8
- package/dist/cjs/ui/Pulse/Pulse.js +36 -0
- package/dist/cjs/ui-menu/ArrowKeyNavigationProvider/MenuArrowKeyNavigationProvider/index.js +2 -11
- package/dist/cjs/ui-menu/DropdownMenu/index.js +5 -20
- package/dist/cjs/ui-menu/ToolbarArrowKeyNavigationProvider/index.js +5 -9
- package/dist/es2019/analytics/types/engagement-platform-events.js +1 -0
- package/dist/es2019/analytics/types/enums.js +1 -0
- package/dist/es2019/element-browser/components/StatelessElementBrowser.js +1 -2
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/es2019/ui/FloatingToolbar/Button.js +6 -2
- package/dist/es2019/ui/Mention/index.js +15 -2
- package/dist/es2019/ui/Mention/mention-with-providers.js +49 -2
- package/dist/es2019/ui/Pulse/Pulse.js +29 -0
- package/dist/es2019/ui-menu/ArrowKeyNavigationProvider/MenuArrowKeyNavigationProvider/index.js +2 -11
- package/dist/es2019/ui-menu/DropdownMenu/index.js +5 -20
- package/dist/es2019/ui-menu/ToolbarArrowKeyNavigationProvider/index.js +5 -9
- package/dist/esm/analytics/types/engagement-platform-events.js +1 -0
- package/dist/esm/analytics/types/enums.js +1 -0
- package/dist/esm/element-browser/components/StatelessElementBrowser.js +1 -2
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/esm/ui/FloatingToolbar/Button.js +6 -2
- package/dist/esm/ui/Mention/index.js +15 -2
- package/dist/esm/ui/Mention/mention-with-providers.js +59 -10
- package/dist/esm/ui/Pulse/Pulse.js +29 -0
- package/dist/esm/ui-menu/ArrowKeyNavigationProvider/MenuArrowKeyNavigationProvider/index.js +2 -11
- package/dist/esm/ui-menu/DropdownMenu/index.js +5 -20
- package/dist/esm/ui-menu/ToolbarArrowKeyNavigationProvider/index.js +5 -9
- package/dist/types/analytics/types/engagement-platform-events.d.ts +20 -0
- package/dist/types/analytics/types/enums.d.ts +2 -1
- package/dist/types/analytics/types/events.d.ts +2 -1
- package/dist/types/types/floating-toolbar.d.ts +4 -0
- package/dist/types/ui/FloatingToolbar/Button.d.ts +3 -1
- package/dist/types/ui/Mention/mention-with-providers.d.ts +2 -1
- package/dist/types/ui/Pulse/Pulse.d.ts +18 -0
- package/dist/types-ts4.5/analytics/types/engagement-platform-events.d.ts +20 -0
- package/dist/types-ts4.5/analytics/types/enums.d.ts +2 -1
- package/dist/types-ts4.5/analytics/types/events.d.ts +2 -1
- package/dist/types-ts4.5/types/floating-toolbar.d.ts +4 -0
- package/dist/types-ts4.5/ui/FloatingToolbar/Button.d.ts +3 -1
- package/dist/types-ts4.5/ui/Mention/mention-with-providers.d.ts +2 -1
- package/dist/types-ts4.5/ui/Pulse/Pulse.d.ts +18 -0
- package/package.json +7 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
# @atlaskit/editor-common
|
|
2
2
|
|
|
3
|
+
## 93.1.6
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#150384](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/150384)
|
|
8
|
+
[`d3dad252dbe46`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/d3dad252dbe46) -
|
|
9
|
+
[EDF-1177](https://product-fabric.atlassian.net/browse/EDF-1177) - add pulse effect support into
|
|
10
|
+
editor floating toolbar
|
|
11
|
+
- [#150125](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/150125)
|
|
12
|
+
[`79a44707fe935`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/79a44707fe935) -
|
|
13
|
+
[ED-24001] This change is cleaning up the feature gate for the image border options dropdown a11y
|
|
14
|
+
fix.
|
|
15
|
+
- [#150606](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/150606)
|
|
16
|
+
[`7680d21f5d481`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/7680d21f5d481) -
|
|
17
|
+
[ED-24257] This change cleans up the feature gate for the main toolbar navigation escape fix.
|
|
18
|
+
- [#150606](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/150606)
|
|
19
|
+
[`d4d1f4dc8f6dc`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/d4d1f4dc8f6dc) -
|
|
20
|
+
ED-24117: upgrades mention with provider to fc for react 18 migration
|
|
21
|
+
- [#150384](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/150384)
|
|
22
|
+
[`704af5d7d4a1a`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/704af5d7d4a1a) -
|
|
23
|
+
[EDF-1668](https://product-fabric.atlassian.net/browse/EDF-1668) - add external message API
|
|
24
|
+
support into editor-plugin-engagement-platform
|
|
25
|
+
- Updated dependencies
|
|
26
|
+
|
|
3
27
|
## 93.1.5
|
|
4
28
|
|
|
5
29
|
### Patch Changes
|
package/afm-cc/tsconfig.json
CHANGED
|
@@ -259,6 +259,7 @@ var ACTION_SUBJECT = exports.ACTION_SUBJECT = /*#__PURE__*/function (ACTION_SUBJ
|
|
|
259
259
|
ACTION_SUBJECT["ELEMENT"] = "element";
|
|
260
260
|
ACTION_SUBJECT["CONTEXT_MENU"] = "contextMenu";
|
|
261
261
|
ACTION_SUBJECT["INLINE_DIALOG"] = "inlineDialog";
|
|
262
|
+
ACTION_SUBJECT["ENGAGEMENT_PLATFORM"] = "engagementPlatform";
|
|
262
263
|
return ACTION_SUBJECT;
|
|
263
264
|
}({});
|
|
264
265
|
var ACTION_SUBJECT_ID = exports.ACTION_SUBJECT_ID = /*#__PURE__*/function (ACTION_SUBJECT_ID) {
|
|
@@ -13,7 +13,6 @@ var _react2 = require("@emotion/react");
|
|
|
13
13
|
var _reactIntlNext = require("react-intl-next");
|
|
14
14
|
var _withAnalyticsContext = _interopRequireDefault(require("@atlaskit/analytics-next/withAnalyticsContext"));
|
|
15
15
|
var _withAnalyticsEvents = _interopRequireDefault(require("@atlaskit/analytics-next/withAnalyticsEvents"));
|
|
16
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
17
16
|
var _analytics = require("../../analytics");
|
|
18
17
|
var _constants = require("../constants");
|
|
19
18
|
var _useContainerWidth2 = _interopRequireDefault(require("../hooks/use-container-width"));
|
|
@@ -226,7 +225,7 @@ function StatelessElementBrowser(props) {
|
|
|
226
225
|
return (0, _react2.jsx)("div", {
|
|
227
226
|
css: wrapper,
|
|
228
227
|
"data-testid": "element-browser",
|
|
229
|
-
id:
|
|
228
|
+
id: _constants.ELEMENT_BROWSER_ID
|
|
230
229
|
}, (0, _react2.jsx)(ContainerWidthMonitor, null), containerWidth < _constants.DEVICE_BREAKPOINT_NUMBERS.medium ? (0, _react2.jsx)(MobileBrowser, (0, _extends2.default)({}, props, {
|
|
231
230
|
selectedItemIndex: selectedItemIndex,
|
|
232
231
|
focusedItemIndex: focusedItemIndex,
|
|
@@ -17,7 +17,7 @@ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return
|
|
|
17
17
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
18
18
|
var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
19
19
|
var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
20
|
-
var packageVersion = "93.1.
|
|
20
|
+
var packageVersion = "93.1.6";
|
|
21
21
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
22
22
|
// Remove URL as it has UGC
|
|
23
23
|
// TODO: Sanitise the URL instead of just removing it
|
|
@@ -24,7 +24,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
|
|
|
24
24
|
* @jsx jsx
|
|
25
25
|
*/ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
26
26
|
var packageName = "@atlaskit/editor-common";
|
|
27
|
-
var packageVersion = "93.1.
|
|
27
|
+
var packageVersion = "93.1.6";
|
|
28
28
|
var halfFocusRing = 1;
|
|
29
29
|
var dropOffset = '0, 8';
|
|
30
30
|
var DropList = /*#__PURE__*/function (_Component) {
|
|
@@ -11,6 +11,7 @@ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/h
|
|
|
11
11
|
var _react = _interopRequireWildcard(require("react"));
|
|
12
12
|
var _customThemeButton = _interopRequireDefault(require("@atlaskit/button/custom-theme-button"));
|
|
13
13
|
var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
|
|
14
|
+
var _Pulse = require("../Pulse/Pulse");
|
|
14
15
|
var _styles = require("./styles");
|
|
15
16
|
var _excluded = ["buttonStyles"];
|
|
16
17
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
@@ -45,7 +46,8 @@ var _default = exports.default = function _default(_ref) {
|
|
|
45
46
|
tabIndex = _ref.tabIndex,
|
|
46
47
|
areaControls = _ref.areaControls,
|
|
47
48
|
ariaLabel = _ref.ariaLabel,
|
|
48
|
-
isRadioButton = _ref.isRadioButton
|
|
49
|
+
isRadioButton = _ref.isRadioButton,
|
|
50
|
+
pulse = _ref.pulse;
|
|
49
51
|
// Check if there's only an icon and add additional styles
|
|
50
52
|
var iconOnly = (icon || iconAfter) && !children;
|
|
51
53
|
var customSpacing = iconOnly ? _styles.iconOnlySpacing : {};
|
|
@@ -68,6 +70,8 @@ var _default = exports.default = function _default(_ref) {
|
|
|
68
70
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
69
71
|
onMouseEnter: onMouseEnter,
|
|
70
72
|
onMouseLeave: onMouseLeave
|
|
73
|
+
}, /*#__PURE__*/_react.default.createElement(_Pulse.Pulse, {
|
|
74
|
+
pulse: pulse
|
|
71
75
|
}, /*#__PURE__*/_react.default.createElement(_customThemeButton.default
|
|
72
76
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
73
77
|
, {
|
|
@@ -110,5 +114,5 @@ var _default = exports.default = function _default(_ref) {
|
|
|
110
114
|
// should be fixed here https://a11y-internal.atlassian.net/browse/DST-287
|
|
111
115
|
,
|
|
112
116
|
tabIndex: tabIndex
|
|
113
|
-
}, children)));
|
|
117
|
+
}, children))));
|
|
114
118
|
};
|
|
@@ -14,12 +14,13 @@ var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime
|
|
|
14
14
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
15
15
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
16
16
|
var _react = _interopRequireWildcard(require("react"));
|
|
17
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
17
18
|
var _providerFactory = require("../../provider-factory");
|
|
18
|
-
var _mentionWithProviders =
|
|
19
|
+
var _mentionWithProviders = require("./mention-with-providers");
|
|
19
20
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
20
21
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
21
22
|
function _createSuper(t) { var r = _isNativeReflectConstruct(); return function () { var e, o = (0, _getPrototypeOf2.default)(t); if (r) { var s = (0, _getPrototypeOf2.default)(this).constructor; e = Reflect.construct(o, arguments, s); } else e = o.apply(this, arguments); return (0, _possibleConstructorReturn2.default)(this, e); }; }
|
|
22
|
-
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
23
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /* eslint-disable @repo/internal/react/no-class-components */
|
|
23
24
|
var Mention = exports.default = /*#__PURE__*/function (_PureComponent) {
|
|
24
25
|
(0, _inherits2.default)(Mention, _PureComponent);
|
|
25
26
|
var _super = _createSuper(Mention);
|
|
@@ -36,7 +37,18 @@ var Mention = exports.default = /*#__PURE__*/function (_PureComponent) {
|
|
|
36
37
|
localId = _this$props.localId;
|
|
37
38
|
var mentionProvider = providers.mentionProvider,
|
|
38
39
|
profilecardProvider = providers.profilecardProvider;
|
|
39
|
-
|
|
40
|
+
if ((0, _platformFeatureFlags.fg)('platform_editor_react18_mention_with_provider')) {
|
|
41
|
+
return /*#__PURE__*/_react.default.createElement(_mentionWithProviders.MentionWithProviders, {
|
|
42
|
+
id: id,
|
|
43
|
+
text: text,
|
|
44
|
+
accessLevel: accessLevel,
|
|
45
|
+
localId: localId,
|
|
46
|
+
eventHandlers: eventHandlers,
|
|
47
|
+
mentionProvider: mentionProvider,
|
|
48
|
+
profilecardProvider: profilecardProvider
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
return /*#__PURE__*/_react.default.createElement(_mentionWithProviders.MentionWithProvidersOld, {
|
|
40
52
|
id: id,
|
|
41
53
|
text: text,
|
|
42
54
|
accessLevel: accessLevel,
|
|
@@ -5,7 +5,7 @@ var _typeof = require("@babel/runtime/helpers/typeof");
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.
|
|
8
|
+
exports.MentionWithProvidersOld = exports.MentionWithProviders = void 0;
|
|
9
9
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
10
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
11
11
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
@@ -14,6 +14,7 @@ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits
|
|
|
14
14
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
15
15
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
16
16
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
17
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
17
18
|
var _react = _interopRequireWildcard(require("react"));
|
|
18
19
|
var _element = require("@atlaskit/mention/element");
|
|
19
20
|
var _mentionWithProfilecard = _interopRequireDefault(require("./mention-with-profilecard"));
|
|
@@ -23,12 +24,61 @@ function _createSuper(t) { var r = _isNativeReflectConstruct(); return function
|
|
|
23
24
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
24
25
|
var GENERIC_USER_IDS = ['HipChat', 'all', 'here'];
|
|
25
26
|
var noop = function noop() {};
|
|
26
|
-
var MentionWithProviders = exports.
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
var MentionWithProviders = exports.MentionWithProviders = function MentionWithProviders(_ref) {
|
|
28
|
+
var accessLevel = _ref.accessLevel,
|
|
29
|
+
eventHandlers = _ref.eventHandlers,
|
|
30
|
+
id = _ref.id,
|
|
31
|
+
mentionProvider = _ref.mentionProvider,
|
|
32
|
+
profilecardProviderResolver = _ref.profilecardProvider,
|
|
33
|
+
text = _ref.text,
|
|
34
|
+
localId = _ref.localId;
|
|
35
|
+
var _useState = (0, _react.useState)(null),
|
|
36
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
37
|
+
profilecardProvider = _useState2[0],
|
|
38
|
+
setProfilecardProvider = _useState2[1];
|
|
39
|
+
var mountedRef = (0, _react.useRef)(true);
|
|
40
|
+
(0, _react.useLayoutEffect)(function () {
|
|
41
|
+
mountedRef.current = true;
|
|
42
|
+
return function () {
|
|
43
|
+
mountedRef.current = false;
|
|
44
|
+
};
|
|
45
|
+
}, []);
|
|
46
|
+
(0, _react.useLayoutEffect)(function () {
|
|
47
|
+
// We are not using async/await here to avoid having an intermediate Promise
|
|
48
|
+
// introduced by the transpiler.
|
|
49
|
+
// This will allow consumer to use a SynchronousPromise.resolve and avoid useless
|
|
50
|
+
// rerendering
|
|
51
|
+
profilecardProviderResolver === null || profilecardProviderResolver === void 0 || profilecardProviderResolver.then(function (result) {
|
|
52
|
+
if (mountedRef.current) {
|
|
53
|
+
setProfilecardProvider(result);
|
|
54
|
+
}
|
|
55
|
+
}).catch(function () {
|
|
56
|
+
if (mountedRef.current) {
|
|
57
|
+
setProfilecardProvider(null);
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
}, [profilecardProviderResolver]);
|
|
61
|
+
var MentionComponent = profilecardProviderResolver && GENERIC_USER_IDS.indexOf(id) === -1 ? _mentionWithProfilecard.default : _element.ResourcedMention;
|
|
62
|
+
return /*#__PURE__*/_react.default.createElement(MentionComponent, {
|
|
63
|
+
id: id,
|
|
64
|
+
text: text,
|
|
65
|
+
accessLevel: accessLevel,
|
|
66
|
+
localId: localId,
|
|
67
|
+
mentionProvider: mentionProvider,
|
|
68
|
+
profilecardProvider: profilecardProvider,
|
|
69
|
+
onClick: eventHandlers === null || eventHandlers === void 0 ? void 0 : eventHandlers.onClick,
|
|
70
|
+
onMouseEnter: eventHandlers === null || eventHandlers === void 0 ? void 0 : eventHandlers.onMouseEnter,
|
|
71
|
+
onMouseLeave: eventHandlers === null || eventHandlers === void 0 ? void 0 : eventHandlers.onMouseLeave
|
|
72
|
+
});
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
// eslint-disable-next-line @repo/internal/react/no-class-components
|
|
76
|
+
var MentionWithProvidersOld = exports.MentionWithProvidersOld = /*#__PURE__*/function (_PureComponent) {
|
|
77
|
+
(0, _inherits2.default)(MentionWithProvidersOld, _PureComponent);
|
|
78
|
+
var _super = _createSuper(MentionWithProvidersOld);
|
|
79
|
+
function MentionWithProvidersOld() {
|
|
30
80
|
var _this;
|
|
31
|
-
(0, _classCallCheck2.default)(this,
|
|
81
|
+
(0, _classCallCheck2.default)(this, MentionWithProvidersOld);
|
|
32
82
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
33
83
|
args[_key] = arguments[_key];
|
|
34
84
|
}
|
|
@@ -38,7 +88,7 @@ var MentionWithProviders = exports.default = /*#__PURE__*/function (_PureCompone
|
|
|
38
88
|
});
|
|
39
89
|
return _this;
|
|
40
90
|
}
|
|
41
|
-
(0, _createClass2.default)(
|
|
91
|
+
(0, _createClass2.default)(MentionWithProvidersOld, [{
|
|
42
92
|
key: "UNSAFE_componentWillMount",
|
|
43
93
|
value: function UNSAFE_componentWillMount() {
|
|
44
94
|
this.updateProfilecardProvider(this.props);
|
|
@@ -100,5 +150,5 @@ var MentionWithProviders = exports.default = /*#__PURE__*/function (_PureCompone
|
|
|
100
150
|
}, actionHandlers));
|
|
101
151
|
}
|
|
102
152
|
}]);
|
|
103
|
-
return
|
|
153
|
+
return MentionWithProvidersOld;
|
|
104
154
|
}(_react.PureComponent);
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.Pulse = Pulse;
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _onboarding = require("@atlaskit/onboarding");
|
|
10
|
+
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
11
|
+
/**
|
|
12
|
+
* Wraps children with {@link SpotlightPulse} component.
|
|
13
|
+
*
|
|
14
|
+
* It adds pulse effect to children if `pulse` is `true`.
|
|
15
|
+
*
|
|
16
|
+
* This custom component exists because the {@link SpotlightPulse} with `pulse={false}` renders extra `div` around `children`.
|
|
17
|
+
* We want to keep `children` as it is if there is no `pulse`.
|
|
18
|
+
*/
|
|
19
|
+
function Pulse(_ref) {
|
|
20
|
+
var pulse = _ref.pulse,
|
|
21
|
+
_ref$radius = _ref.radius,
|
|
22
|
+
radius = _ref$radius === void 0 ? 3 : _ref$radius,
|
|
23
|
+
children = _ref.children;
|
|
24
|
+
if ((0, _experiments.editorExperiment)('platform_editor_ai_onboarding', 'test') && pulse) {
|
|
25
|
+
return (
|
|
26
|
+
/*#__PURE__*/
|
|
27
|
+
// SpotlightPulse shows pulse effect if `pulse` is `undefined`.
|
|
28
|
+
// That's why we need to cast `pulse` to `false` if it's `undefined`.
|
|
29
|
+
_react.default.createElement(_onboarding.SpotlightPulse, {
|
|
30
|
+
radius: radius,
|
|
31
|
+
pulse: pulse !== null && pulse !== void 0 ? pulse : false
|
|
32
|
+
}, children)
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, children);
|
|
36
|
+
}
|
|
@@ -8,7 +8,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
8
8
|
exports.MenuArrowKeyNavigationProvider = void 0;
|
|
9
9
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
10
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
12
11
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
13
12
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
14
13
|
var hasEnabledItems = function hasEnabledItems(list) {
|
|
@@ -131,11 +130,7 @@ var MenuArrowKeyNavigationProvider = exports.MenuArrowKeyNavigationProvider = fu
|
|
|
131
130
|
if (targetElement instanceof HTMLElement && !targetElement.closest('.custom-key-handler-wrapper')) {
|
|
132
131
|
return;
|
|
133
132
|
}
|
|
134
|
-
if (
|
|
135
|
-
if (!disableCloseOnArrowClick) {
|
|
136
|
-
handleClose(event);
|
|
137
|
-
}
|
|
138
|
-
} else {
|
|
133
|
+
if (!disableCloseOnArrowClick) {
|
|
139
134
|
handleClose(event);
|
|
140
135
|
}
|
|
141
136
|
if (targetElement instanceof HTMLElement && !targetElement.closest('[data-testid="editor-floating-toolbar"]')) {
|
|
@@ -146,11 +141,7 @@ var MenuArrowKeyNavigationProvider = exports.MenuArrowKeyNavigationProvider = fu
|
|
|
146
141
|
if (targetElement instanceof HTMLElement && !targetElement.closest('.custom-key-handler-wrapper')) {
|
|
147
142
|
return;
|
|
148
143
|
}
|
|
149
|
-
if (
|
|
150
|
-
if (!disableCloseOnArrowClick) {
|
|
151
|
-
handleClose(event);
|
|
152
|
-
}
|
|
153
|
-
} else {
|
|
144
|
+
if (!disableCloseOnArrowClick) {
|
|
154
145
|
handleClose(event);
|
|
155
146
|
}
|
|
156
147
|
if (targetElement instanceof HTMLElement && !targetElement.closest('[data-testid="editor-floating-toolbar"]')) {
|
|
@@ -193,9 +193,9 @@ var DropdownMenuWrapper = exports.default = /*#__PURE__*/function (_PureComponen
|
|
|
193
193
|
shouldFitContainer: true,
|
|
194
194
|
isTriggerNotTabbable: true,
|
|
195
195
|
handleClickOutside: this.handleClose,
|
|
196
|
-
handleEscapeKeydown:
|
|
196
|
+
handleEscapeKeydown: handleEscapeKeydown || this.handleCloseAndFocus,
|
|
197
197
|
handleEnterKeydown: function handleEnterKeydown(e) {
|
|
198
|
-
if ((0, _platformFeatureFlags.fg)('platform_editor_a11y_table_context_menu')
|
|
198
|
+
if ((0, _platformFeatureFlags.fg)('platform_editor_a11y_table_context_menu')) {
|
|
199
199
|
if (!allowEnterDefaultBehavior) {
|
|
200
200
|
e.preventDefault();
|
|
201
201
|
}
|
|
@@ -309,27 +309,12 @@ function DropdownMenuItem(_ref) {
|
|
|
309
309
|
var _handleSubmenuActive = function _handleSubmenuActive(event) {
|
|
310
310
|
setSubmenuActive(Boolean(event.target instanceof HTMLElement && event.target.closest(".".concat(_styles.DropdownMenuSharedCssClassName.SUBMENU))));
|
|
311
311
|
};
|
|
312
|
-
var ariaLabel;
|
|
313
|
-
|
|
314
|
-
ariaLabel = item['aria-label'] === '' ? undefined : item['aria-label'] || String(item.content);
|
|
315
|
-
} else {
|
|
316
|
-
ariaLabel = item['aria-label'] || String(item.content);
|
|
317
|
-
}
|
|
318
|
-
var testId;
|
|
319
|
-
if ((0, _platformFeatureFlags.fg)('platform-editor-a11y-image-border-options-dropdown')) {
|
|
320
|
-
testId = item['data-testid'] || "dropdown-item__".concat(item.content);
|
|
321
|
-
} else {
|
|
322
|
-
testId = "dropdown-item__".concat(String(item.content));
|
|
323
|
-
}
|
|
312
|
+
var ariaLabel = item['aria-label'] === '' ? undefined : item['aria-label'] || String(item.content);
|
|
313
|
+
var testId = item['data-testid'] || "dropdown-item__".concat(item.content);
|
|
324
314
|
|
|
325
315
|
// From time to time we don't want to have any tabIndex on item wrapper
|
|
326
316
|
// especially when we pass any interactive element as a item.content
|
|
327
|
-
var tabIndex;
|
|
328
|
-
if ((0, _platformFeatureFlags.fg)('platform-editor-a11y-image-border-options-dropdown')) {
|
|
329
|
-
tabIndex = item.wrapperTabIndex === null ? undefined : item.wrapperTabIndex || -1;
|
|
330
|
-
} else {
|
|
331
|
-
tabIndex = -1;
|
|
332
|
-
}
|
|
317
|
+
var tabIndex = item.wrapperTabIndex === null ? undefined : item.wrapperTabIndex || -1;
|
|
333
318
|
var dropListItem = (0, _react2.jsx)("div", {
|
|
334
319
|
css: function css() {
|
|
335
320
|
return buttonStyles(item.isActive, submenuActive);
|
|
@@ -7,7 +7,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.ToolbarArrowKeyNavigationProvider = exports.KeyDownHandlerContext = void 0;
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
9
|
var _react2 = require("@emotion/react");
|
|
10
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
11
10
|
var _elementBrowser = require("../../element-browser");
|
|
12
11
|
var _messages = require("../../messages");
|
|
13
12
|
var _ui = require("../../ui");
|
|
@@ -122,7 +121,7 @@ var ToolbarArrowKeyNavigationProvider = exports.ToolbarArrowKeyNavigationProvide
|
|
|
122
121
|
* @param event
|
|
123
122
|
*/
|
|
124
123
|
var handleKeyDown = function handleKeyDown(event) {
|
|
125
|
-
var _document$querySelect, _document$querySelect2, _wrapperRef$current2;
|
|
124
|
+
var _document$querySelect, _document$querySelect2, _wrapperRef$current, _wrapperRef$current2;
|
|
126
125
|
// To trap the focus inside the horizontal toolbar for left and right arrow keys
|
|
127
126
|
var targetElement = event.target;
|
|
128
127
|
if (targetElement instanceof HTMLElement && !targetElement.closest("".concat(childComponentSelector))) {
|
|
@@ -136,13 +135,10 @@ var ToolbarArrowKeyNavigationProvider = exports.ToolbarArrowKeyNavigationProvide
|
|
|
136
135
|
// if menu wrapper exists, then a menu is open and arrow keys will be handled by MenuArrowKeyNavigationProvider
|
|
137
136
|
return;
|
|
138
137
|
}
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
// if element browser is open, then arrow keys will be handled by MenuArrowKeyNavigationProvider
|
|
144
|
-
return;
|
|
145
|
-
}
|
|
138
|
+
var elementBrowser = wrapperRef === null || wrapperRef === void 0 || (_wrapperRef$current = wrapperRef.current) === null || _wrapperRef$current === void 0 ? void 0 : _wrapperRef$current.querySelector("#".concat(_elementBrowser.ELEMENT_BROWSER_ID));
|
|
139
|
+
if (elementBrowser) {
|
|
140
|
+
// if element browser is open, then arrow keys will be handled by MenuArrowKeyNavigationProvider
|
|
141
|
+
return;
|
|
146
142
|
}
|
|
147
143
|
var filteredFocusableElements = getFilteredFocusableElements(wrapperRef === null || wrapperRef === void 0 ? void 0 : wrapperRef.current);
|
|
148
144
|
if (!filteredFocusableElements || (filteredFocusableElements === null || filteredFocusableElements === void 0 ? void 0 : filteredFocusableElements.length) === 0) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -253,6 +253,7 @@ export let ACTION_SUBJECT = /*#__PURE__*/function (ACTION_SUBJECT) {
|
|
|
253
253
|
ACTION_SUBJECT["ELEMENT"] = "element";
|
|
254
254
|
ACTION_SUBJECT["CONTEXT_MENU"] = "contextMenu";
|
|
255
255
|
ACTION_SUBJECT["INLINE_DIALOG"] = "inlineDialog";
|
|
256
|
+
ACTION_SUBJECT["ENGAGEMENT_PLATFORM"] = "engagementPlatform";
|
|
256
257
|
return ACTION_SUBJECT;
|
|
257
258
|
}({});
|
|
258
259
|
export let ACTION_SUBJECT_ID = /*#__PURE__*/function (ACTION_SUBJECT_ID) {
|
|
@@ -10,7 +10,6 @@ import { css, jsx } from '@emotion/react';
|
|
|
10
10
|
import { FormattedMessage } from 'react-intl-next';
|
|
11
11
|
import withAnalyticsContext from '@atlaskit/analytics-next/withAnalyticsContext';
|
|
12
12
|
import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
|
|
13
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
14
13
|
import { ACTION, ACTION_SUBJECT, EVENT_TYPE, fireAnalyticsEvent } from '../../analytics';
|
|
15
14
|
import { DEVICE_BREAKPOINT_NUMBERS, ELEMENT_BROWSER_ID, GRID_SIZE, INLINE_SIDEBAR_HEIGHT, SIDEBAR_HEADING_WRAPPER_HEIGHT, SIDEBAR_WIDTH } from '../constants';
|
|
16
15
|
import useContainerWidth from '../hooks/use-container-width';
|
|
@@ -215,7 +214,7 @@ function StatelessElementBrowser(props) {
|
|
|
215
214
|
return jsx("div", {
|
|
216
215
|
css: wrapper,
|
|
217
216
|
"data-testid": "element-browser",
|
|
218
|
-
id:
|
|
217
|
+
id: ELEMENT_BROWSER_ID
|
|
219
218
|
}, jsx(ContainerWidthMonitor, null), containerWidth < DEVICE_BREAKPOINT_NUMBERS.medium ? jsx(MobileBrowser, _extends({}, props, {
|
|
220
219
|
selectedItemIndex: selectedItemIndex,
|
|
221
220
|
focusedItemIndex: focusedItemIndex,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { isFedRamp } from './environment';
|
|
2
2
|
const SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
3
3
|
const packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
4
|
-
const packageVersion = "93.1.
|
|
4
|
+
const packageVersion = "93.1.6";
|
|
5
5
|
const sanitiseSentryEvents = (data, _hint) => {
|
|
6
6
|
// Remove URL as it has UGC
|
|
7
7
|
// TODO: Sanitise the URL instead of just removing it
|
|
@@ -13,7 +13,7 @@ import withAnalyticsContext from '@atlaskit/analytics-next/withAnalyticsContext'
|
|
|
13
13
|
import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
|
|
14
14
|
import Layer from '../Layer';
|
|
15
15
|
const packageName = "@atlaskit/editor-common";
|
|
16
|
-
const packageVersion = "93.1.
|
|
16
|
+
const packageVersion = "93.1.6";
|
|
17
17
|
const halfFocusRing = 1;
|
|
18
18
|
const dropOffset = '0, 8';
|
|
19
19
|
class DropList extends Component {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React, { useEffect } from 'react';
|
|
2
2
|
import Button from '@atlaskit/button/custom-theme-button';
|
|
3
3
|
import Tooltip from '@atlaskit/tooltip';
|
|
4
|
+
import { Pulse } from '../Pulse/Pulse';
|
|
4
5
|
import { getButtonStyles, iconOnlySpacing } from './styles';
|
|
5
6
|
export default (({
|
|
6
7
|
title,
|
|
@@ -28,7 +29,8 @@ export default (({
|
|
|
28
29
|
tabIndex,
|
|
29
30
|
areaControls,
|
|
30
31
|
ariaLabel,
|
|
31
|
-
isRadioButton
|
|
32
|
+
isRadioButton,
|
|
33
|
+
pulse
|
|
32
34
|
}) => {
|
|
33
35
|
// Check if there's only an icon and add additional styles
|
|
34
36
|
const iconOnly = (icon || iconAfter) && !children;
|
|
@@ -52,6 +54,8 @@ export default (({
|
|
|
52
54
|
}, /*#__PURE__*/React.createElement("div", {
|
|
53
55
|
onMouseEnter: onMouseEnter,
|
|
54
56
|
onMouseLeave: onMouseLeave
|
|
57
|
+
}, /*#__PURE__*/React.createElement(Pulse, {
|
|
58
|
+
pulse: pulse
|
|
55
59
|
}, /*#__PURE__*/React.createElement(Button
|
|
56
60
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
57
61
|
, {
|
|
@@ -100,5 +104,5 @@ export default (({
|
|
|
100
104
|
// should be fixed here https://a11y-internal.atlassian.net/browse/DST-287
|
|
101
105
|
,
|
|
102
106
|
tabIndex: tabIndex
|
|
103
|
-
}, children)));
|
|
107
|
+
}, children))));
|
|
104
108
|
});
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
/* eslint-disable @repo/internal/react/no-class-components */
|
|
2
3
|
import React, { PureComponent } from 'react';
|
|
4
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
3
5
|
import { ProviderFactory, WithProviders } from '../../provider-factory';
|
|
4
|
-
import MentionWithProviders from './mention-with-providers';
|
|
6
|
+
import { MentionWithProviders, MentionWithProvidersOld } from './mention-with-providers';
|
|
5
7
|
export default class Mention extends PureComponent {
|
|
6
8
|
constructor(props) {
|
|
7
9
|
super(props);
|
|
@@ -17,7 +19,18 @@ export default class Mention extends PureComponent {
|
|
|
17
19
|
mentionProvider,
|
|
18
20
|
profilecardProvider
|
|
19
21
|
} = providers;
|
|
20
|
-
|
|
22
|
+
if (fg('platform_editor_react18_mention_with_provider')) {
|
|
23
|
+
return /*#__PURE__*/React.createElement(MentionWithProviders, {
|
|
24
|
+
id: id,
|
|
25
|
+
text: text,
|
|
26
|
+
accessLevel: accessLevel,
|
|
27
|
+
localId: localId,
|
|
28
|
+
eventHandlers: eventHandlers,
|
|
29
|
+
mentionProvider: mentionProvider,
|
|
30
|
+
profilecardProvider: profilecardProvider
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
return /*#__PURE__*/React.createElement(MentionWithProvidersOld, {
|
|
21
34
|
id: id,
|
|
22
35
|
text: text,
|
|
23
36
|
accessLevel: accessLevel,
|
|
@@ -1,11 +1,58 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
|
-
import React, { PureComponent } from 'react';
|
|
3
|
+
import React, { PureComponent, useLayoutEffect, useRef, useState } from 'react';
|
|
4
4
|
import { ResourcedMention } from '@atlaskit/mention/element';
|
|
5
5
|
import ResourcedMentionWithProfilecard from './mention-with-profilecard';
|
|
6
6
|
const GENERIC_USER_IDS = ['HipChat', 'all', 'here'];
|
|
7
7
|
const noop = () => {};
|
|
8
|
-
export
|
|
8
|
+
export const MentionWithProviders = ({
|
|
9
|
+
accessLevel,
|
|
10
|
+
eventHandlers,
|
|
11
|
+
id,
|
|
12
|
+
mentionProvider,
|
|
13
|
+
profilecardProvider: profilecardProviderResolver,
|
|
14
|
+
text,
|
|
15
|
+
localId
|
|
16
|
+
}) => {
|
|
17
|
+
const [profilecardProvider, setProfilecardProvider] = useState(null);
|
|
18
|
+
const mountedRef = useRef(true);
|
|
19
|
+
useLayoutEffect(() => {
|
|
20
|
+
mountedRef.current = true;
|
|
21
|
+
return () => {
|
|
22
|
+
mountedRef.current = false;
|
|
23
|
+
};
|
|
24
|
+
}, []);
|
|
25
|
+
useLayoutEffect(() => {
|
|
26
|
+
// We are not using async/await here to avoid having an intermediate Promise
|
|
27
|
+
// introduced by the transpiler.
|
|
28
|
+
// This will allow consumer to use a SynchronousPromise.resolve and avoid useless
|
|
29
|
+
// rerendering
|
|
30
|
+
profilecardProviderResolver === null || profilecardProviderResolver === void 0 ? void 0 : profilecardProviderResolver.then(result => {
|
|
31
|
+
if (mountedRef.current) {
|
|
32
|
+
setProfilecardProvider(result);
|
|
33
|
+
}
|
|
34
|
+
}).catch(() => {
|
|
35
|
+
if (mountedRef.current) {
|
|
36
|
+
setProfilecardProvider(null);
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
}, [profilecardProviderResolver]);
|
|
40
|
+
const MentionComponent = profilecardProviderResolver && GENERIC_USER_IDS.indexOf(id) === -1 ? ResourcedMentionWithProfilecard : ResourcedMention;
|
|
41
|
+
return /*#__PURE__*/React.createElement(MentionComponent, {
|
|
42
|
+
id: id,
|
|
43
|
+
text: text,
|
|
44
|
+
accessLevel: accessLevel,
|
|
45
|
+
localId: localId,
|
|
46
|
+
mentionProvider: mentionProvider,
|
|
47
|
+
profilecardProvider: profilecardProvider,
|
|
48
|
+
onClick: eventHandlers === null || eventHandlers === void 0 ? void 0 : eventHandlers.onClick,
|
|
49
|
+
onMouseEnter: eventHandlers === null || eventHandlers === void 0 ? void 0 : eventHandlers.onMouseEnter,
|
|
50
|
+
onMouseLeave: eventHandlers === null || eventHandlers === void 0 ? void 0 : eventHandlers.onMouseLeave
|
|
51
|
+
});
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
// eslint-disable-next-line @repo/internal/react/no-class-components
|
|
55
|
+
export class MentionWithProvidersOld extends PureComponent {
|
|
9
56
|
constructor(...args) {
|
|
10
57
|
super(...args);
|
|
11
58
|
_defineProperty(this, "state", {
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { SpotlightPulse } from '@atlaskit/onboarding';
|
|
3
|
+
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
4
|
+
/**
|
|
5
|
+
* Wraps children with {@link SpotlightPulse} component.
|
|
6
|
+
*
|
|
7
|
+
* It adds pulse effect to children if `pulse` is `true`.
|
|
8
|
+
*
|
|
9
|
+
* This custom component exists because the {@link SpotlightPulse} with `pulse={false}` renders extra `div` around `children`.
|
|
10
|
+
* We want to keep `children` as it is if there is no `pulse`.
|
|
11
|
+
*/
|
|
12
|
+
export function Pulse({
|
|
13
|
+
pulse,
|
|
14
|
+
radius = 3,
|
|
15
|
+
children
|
|
16
|
+
}) {
|
|
17
|
+
if (editorExperiment('platform_editor_ai_onboarding', 'test') && pulse) {
|
|
18
|
+
return (
|
|
19
|
+
/*#__PURE__*/
|
|
20
|
+
// SpotlightPulse shows pulse effect if `pulse` is `undefined`.
|
|
21
|
+
// That's why we need to cast `pulse` to `false` if it's `undefined`.
|
|
22
|
+
React.createElement(SpotlightPulse, {
|
|
23
|
+
radius: radius,
|
|
24
|
+
pulse: pulse !== null && pulse !== void 0 ? pulse : false
|
|
25
|
+
}, children)
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, children);
|
|
29
|
+
}
|