@atlaskit/editor-common 112.17.0 → 112.17.1
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 +10 -0
- package/afm-cc/tsconfig.json +0 -3
- package/afm-products/tsconfig.json +0 -3
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/cjs/ui/FloatingToolbar/Button.js +3 -19
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/es2019/ui/FloatingToolbar/Button.js +4 -16
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/esm/ui/FloatingToolbar/Button.js +4 -20
- package/dist/types/types/floating-toolbar.d.ts +0 -11
- package/dist/types/types/index.d.ts +1 -1
- package/dist/types/ui/FloatingToolbar/Button.d.ts +0 -2
- package/dist/types-ts4.5/types/floating-toolbar.d.ts +0 -11
- package/dist/types-ts4.5/types/index.d.ts +1 -1
- package/dist/types-ts4.5/ui/FloatingToolbar/Button.d.ts +0 -2
- package/package.json +3 -4
- package/dist/cjs/ui/FloatingToolbar/ButtonSpotlightCard.js +0 -42
- package/dist/es2019/ui/FloatingToolbar/ButtonSpotlightCard.js +0 -33
- package/dist/esm/ui/FloatingToolbar/ButtonSpotlightCard.js +0 -36
- package/dist/types/ui/FloatingToolbar/ButtonSpotlightCard.d.ts +0 -11
- package/dist/types-ts4.5/ui/FloatingToolbar/ButtonSpotlightCard.d.ts +0 -11
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# @atlaskit/editor-common
|
|
2
2
|
|
|
3
|
+
## 112.17.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`2e8697decd076`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/2e8697decd076) -
|
|
8
|
+
Migrate @atlaskit/onboarding to @atlaskit/spotlight, gate pulse removal behind
|
|
9
|
+
platform_editor_spotlight_migration experiment. Remove dead spotlight config code from floating
|
|
10
|
+
toolbar.
|
|
11
|
+
- Updated dependencies
|
|
12
|
+
|
|
3
13
|
## 112.17.0
|
|
4
14
|
|
|
5
15
|
### Minor Changes
|
package/afm-cc/tsconfig.json
CHANGED
|
@@ -140,9 +140,6 @@
|
|
|
140
140
|
{
|
|
141
141
|
"path": "../../../platform/feature-flags-react/afm-products/tsconfig.json"
|
|
142
142
|
},
|
|
143
|
-
{
|
|
144
|
-
"path": "../../../design-system/popper/afm-products/tsconfig.json"
|
|
145
|
-
},
|
|
146
143
|
{
|
|
147
144
|
"path": "../../../design-system/primitives/afm-products/tsconfig.json"
|
|
148
145
|
},
|
|
@@ -19,7 +19,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
19
19
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
20
20
|
var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
21
21
|
var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
22
|
-
var packageVersion = "112.
|
|
22
|
+
var packageVersion = "112.17.0";
|
|
23
23
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
24
24
|
// Remove URL as it has UGC
|
|
25
25
|
// Ignored via go/ees007
|
|
@@ -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 = "112.
|
|
27
|
+
var packageVersion = "112.17.0";
|
|
28
28
|
var halfFocusRing = 1;
|
|
29
29
|
var dropOffset = '0, 8';
|
|
30
30
|
var fadeIn = (0, _react2.keyframes)({
|
|
@@ -6,11 +6,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
exports.default = void 0;
|
|
9
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
9
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
10
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
12
11
|
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
13
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
14
12
|
var _react = _interopRequireWildcard(require("react"));
|
|
15
13
|
var _customThemeButton = _interopRequireDefault(require("@atlaskit/button/custom-theme-button"));
|
|
16
14
|
var _platformFeatureFlagsReact = require("@atlaskit/platform-feature-flags-react");
|
|
@@ -18,7 +16,6 @@ var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
|
18
16
|
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
19
17
|
var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
|
|
20
18
|
var _Pulse = require("../Pulse/Pulse");
|
|
21
|
-
var _ButtonSpotlightCard = require("./ButtonSpotlightCard");
|
|
22
19
|
var _styles = require("./styles");
|
|
23
20
|
var _excluded = ["buttonStyles"];
|
|
24
21
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof3(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
@@ -60,7 +57,6 @@ var FloatingToolbarButton = function FloatingToolbarButton(_ref, forwardedRef) {
|
|
|
60
57
|
ariaLabel = _ref.ariaLabel,
|
|
61
58
|
isRadioButton = _ref.isRadioButton,
|
|
62
59
|
pulse = _ref.pulse,
|
|
63
|
-
spotlightConfig = _ref.spotlightConfig,
|
|
64
60
|
areAnyNewToolbarFlagsEnabled = _ref.areAnyNewToolbarFlagsEnabled;
|
|
65
61
|
// Check if there's only an icon and add additional styles
|
|
66
62
|
var iconOnly = (icon || iconAfter) && !children;
|
|
@@ -72,10 +68,6 @@ var FloatingToolbarButton = function FloatingToolbarButton(_ref, forwardedRef) {
|
|
|
72
68
|
*/
|
|
73
69
|
var ariaChecked = isRadioButton ? Boolean(isButtonPressed) : undefined;
|
|
74
70
|
var ariaPressed = isRadioButton ? undefined : isButtonPressed;
|
|
75
|
-
var _useState = (0, _react.useState)(null),
|
|
76
|
-
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
77
|
-
spotlightReferenceElement = _useState2[0],
|
|
78
|
-
setSpotlightReferenceElement = _useState2[1];
|
|
79
71
|
(0, _react.useEffect)(function () {
|
|
80
72
|
onMount === null || onMount === void 0 || onMount();
|
|
81
73
|
return function () {
|
|
@@ -83,12 +75,9 @@ var FloatingToolbarButton = function FloatingToolbarButton(_ref, forwardedRef) {
|
|
|
83
75
|
};
|
|
84
76
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
85
77
|
}, []);
|
|
86
|
-
var onSpotlightTargetClick = spotlightConfig !== null && spotlightConfig !== void 0 && spotlightConfig.isSpotlightOpen ? spotlightConfig === null || spotlightConfig === void 0 ? void 0 : spotlightConfig.onTargetClick : undefined;
|
|
87
78
|
var handleOnClick = (0, _react.useCallback)(function (event) {
|
|
88
|
-
// fire the spotlight onTargetClick callback if a spotlight is rendered and callback is provided
|
|
89
|
-
onSpotlightTargetClick === null || onSpotlightTargetClick === void 0 || onSpotlightTargetClick();
|
|
90
79
|
onClick === null || onClick === void 0 || onClick(event);
|
|
91
|
-
}, [onClick
|
|
80
|
+
}, [onClick]);
|
|
92
81
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_tooltip.default
|
|
93
82
|
// Only fallback to title for tooltip if title is not shown
|
|
94
83
|
, {
|
|
@@ -100,7 +89,7 @@ var FloatingToolbarButton = function FloatingToolbarButton(_ref, forwardedRef) {
|
|
|
100
89
|
onMouseEnter: (0, _expValEquals.expValEquals)('editor_a11y__enghealth-46814_fy26', 'isEnabled', true) ? undefined : onMouseEnter,
|
|
101
90
|
onMouseLeave: (0, _expValEquals.expValEquals)('editor_a11y__enghealth-46814_fy26', 'isEnabled', true) ? undefined : onMouseLeave
|
|
102
91
|
}, /*#__PURE__*/_react.default.createElement(_Pulse.Pulse, {
|
|
103
|
-
pulse:
|
|
92
|
+
pulse: !(0, _expValEquals.expValEquals)('platform_editor_spotlight_migration', 'isEnabled', true) && pulse
|
|
104
93
|
}, /*#__PURE__*/_react.default.createElement(_customThemeButton.default
|
|
105
94
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop, @atlaskit/design-system/no-unsafe-style-overrides -- Ignored via go/DSP-18766
|
|
106
95
|
, {
|
|
@@ -108,7 +97,6 @@ var FloatingToolbarButton = function FloatingToolbarButton(_ref, forwardedRef) {
|
|
|
108
97
|
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
109
98
|
,
|
|
110
99
|
ref: function ref(buttonElement) {
|
|
111
|
-
setSpotlightReferenceElement(buttonElement);
|
|
112
100
|
if (forwardedRef && (0, _experiments.editorExperiment)('platform_synced_block', true)) {
|
|
113
101
|
if (typeof forwardedRef === 'function') {
|
|
114
102
|
forwardedRef(buttonElement);
|
|
@@ -160,11 +148,7 @@ var FloatingToolbarButton = function FloatingToolbarButton(_ref, forwardedRef) {
|
|
|
160
148
|
// should be fixed here https://a11y-internal.atlassian.net/browse/DST-287
|
|
161
149
|
,
|
|
162
150
|
tabIndex: tabIndex
|
|
163
|
-
}, children))))
|
|
164
|
-
referenceElement: spotlightReferenceElement
|
|
165
|
-
// Ignored via go/ees005
|
|
166
|
-
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
167
|
-
}, spotlightConfig.spotlightCardOptions)));
|
|
151
|
+
}, children)))));
|
|
168
152
|
};
|
|
169
153
|
|
|
170
154
|
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
@@ -4,7 +4,7 @@ import { isFedRamp } from './environment';
|
|
|
4
4
|
import { normaliseSentryBreadcrumbs, SERIALIZABLE_ATTRIBUTES } from './normalise-sentry-breadcrumbs';
|
|
5
5
|
const SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
6
6
|
const packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
7
|
-
const packageVersion = "112.
|
|
7
|
+
const packageVersion = "112.17.0";
|
|
8
8
|
const sanitiseSentryEvents = (data, _hint) => {
|
|
9
9
|
// Remove URL as it has UGC
|
|
10
10
|
// Ignored via go/ees007
|
|
@@ -14,7 +14,7 @@ import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
|
|
|
14
14
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
15
15
|
import Layer from '../Layer';
|
|
16
16
|
const packageName = "@atlaskit/editor-common";
|
|
17
|
-
const packageVersion = "112.
|
|
17
|
+
const packageVersion = "112.17.0";
|
|
18
18
|
const halfFocusRing = 1;
|
|
19
19
|
const dropOffset = '0, 8';
|
|
20
20
|
const fadeIn = keyframes({
|
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import React, { forwardRef, useCallback, useEffect, useState } from 'react';
|
|
1
|
+
import React, { forwardRef, useCallback, useEffect } from 'react';
|
|
3
2
|
import Button from '@atlaskit/button/custom-theme-button';
|
|
4
3
|
import { componentWithCondition } from '@atlaskit/platform-feature-flags-react';
|
|
5
4
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
6
5
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
7
6
|
import Tooltip from '@atlaskit/tooltip';
|
|
8
7
|
import { Pulse } from '../Pulse/Pulse';
|
|
9
|
-
import { ButtonSpotlightCard } from './ButtonSpotlightCard';
|
|
10
8
|
import { getButtonStyles, iconOnlySpacing } from './styles';
|
|
11
9
|
const customSizeAndPadding = {
|
|
12
10
|
minWidth: "var(--ds-space-400, 32px)",
|
|
@@ -42,7 +40,6 @@ const FloatingToolbarButton = ({
|
|
|
42
40
|
ariaLabel,
|
|
43
41
|
isRadioButton,
|
|
44
42
|
pulse,
|
|
45
|
-
spotlightConfig,
|
|
46
43
|
areAnyNewToolbarFlagsEnabled
|
|
47
44
|
}, forwardedRef) => {
|
|
48
45
|
// Check if there's only an icon and add additional styles
|
|
@@ -55,18 +52,14 @@ const FloatingToolbarButton = ({
|
|
|
55
52
|
*/
|
|
56
53
|
const ariaChecked = isRadioButton ? Boolean(isButtonPressed) : undefined;
|
|
57
54
|
const ariaPressed = isRadioButton ? undefined : isButtonPressed;
|
|
58
|
-
const [spotlightReferenceElement, setSpotlightReferenceElement] = useState(null);
|
|
59
55
|
useEffect(() => {
|
|
60
56
|
onMount === null || onMount === void 0 ? void 0 : onMount();
|
|
61
57
|
return () => onUnmount === null || onUnmount === void 0 ? void 0 : onUnmount();
|
|
62
58
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
63
59
|
}, []);
|
|
64
|
-
const onSpotlightTargetClick = spotlightConfig !== null && spotlightConfig !== void 0 && spotlightConfig.isSpotlightOpen ? spotlightConfig === null || spotlightConfig === void 0 ? void 0 : spotlightConfig.onTargetClick : undefined;
|
|
65
60
|
const handleOnClick = useCallback(event => {
|
|
66
|
-
// fire the spotlight onTargetClick callback if a spotlight is rendered and callback is provided
|
|
67
|
-
onSpotlightTargetClick === null || onSpotlightTargetClick === void 0 ? void 0 : onSpotlightTargetClick();
|
|
68
61
|
onClick === null || onClick === void 0 ? void 0 : onClick(event);
|
|
69
|
-
}, [onClick
|
|
62
|
+
}, [onClick]);
|
|
70
63
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Tooltip
|
|
71
64
|
// Only fallback to title for tooltip if title is not shown
|
|
72
65
|
, {
|
|
@@ -78,7 +71,7 @@ const FloatingToolbarButton = ({
|
|
|
78
71
|
onMouseEnter: expValEquals('editor_a11y__enghealth-46814_fy26', 'isEnabled', true) ? undefined : onMouseEnter,
|
|
79
72
|
onMouseLeave: expValEquals('editor_a11y__enghealth-46814_fy26', 'isEnabled', true) ? undefined : onMouseLeave
|
|
80
73
|
}, /*#__PURE__*/React.createElement(Pulse, {
|
|
81
|
-
pulse:
|
|
74
|
+
pulse: !expValEquals('platform_editor_spotlight_migration', 'isEnabled', true) && pulse
|
|
82
75
|
}, /*#__PURE__*/React.createElement(Button
|
|
83
76
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop, @atlaskit/design-system/no-unsafe-style-overrides -- Ignored via go/DSP-18766
|
|
84
77
|
, {
|
|
@@ -86,7 +79,6 @@ const FloatingToolbarButton = ({
|
|
|
86
79
|
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
87
80
|
,
|
|
88
81
|
ref: buttonElement => {
|
|
89
|
-
setSpotlightReferenceElement(buttonElement);
|
|
90
82
|
if (forwardedRef && editorExperiment('platform_synced_block', true)) {
|
|
91
83
|
if (typeof forwardedRef === 'function') {
|
|
92
84
|
forwardedRef(buttonElement);
|
|
@@ -145,11 +137,7 @@ const FloatingToolbarButton = ({
|
|
|
145
137
|
// should be fixed here https://a11y-internal.atlassian.net/browse/DST-287
|
|
146
138
|
,
|
|
147
139
|
tabIndex: tabIndex
|
|
148
|
-
}, children))))
|
|
149
|
-
referenceElement: spotlightReferenceElement
|
|
150
|
-
// Ignored via go/ees005
|
|
151
|
-
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
152
|
-
}, spotlightConfig.spotlightCardOptions)));
|
|
140
|
+
}, children)))));
|
|
153
141
|
};
|
|
154
142
|
|
|
155
143
|
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
@@ -10,7 +10,7 @@ import { isFedRamp } from './environment';
|
|
|
10
10
|
import { normaliseSentryBreadcrumbs, SERIALIZABLE_ATTRIBUTES } from './normalise-sentry-breadcrumbs';
|
|
11
11
|
var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
12
12
|
var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
13
|
-
var packageVersion = "112.
|
|
13
|
+
var packageVersion = "112.17.0";
|
|
14
14
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
15
15
|
// Remove URL as it has UGC
|
|
16
16
|
// Ignored via go/ees007
|
|
@@ -21,7 +21,7 @@ import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
|
|
|
21
21
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
22
22
|
import Layer from '../Layer';
|
|
23
23
|
var packageName = "@atlaskit/editor-common";
|
|
24
|
-
var packageVersion = "112.
|
|
24
|
+
var packageVersion = "112.17.0";
|
|
25
25
|
var halfFocusRing = 1;
|
|
26
26
|
var dropOffset = '0, 8';
|
|
27
27
|
var fadeIn = keyframes({
|
|
@@ -1,19 +1,16 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
2
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
4
3
|
import _typeof from "@babel/runtime/helpers/typeof";
|
|
5
|
-
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
6
4
|
var _excluded = ["buttonStyles"];
|
|
7
5
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
8
6
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
9
|
-
import React, { forwardRef, useCallback, useEffect
|
|
7
|
+
import React, { forwardRef, useCallback, useEffect } from 'react';
|
|
10
8
|
import Button from '@atlaskit/button/custom-theme-button';
|
|
11
9
|
import { componentWithCondition } from '@atlaskit/platform-feature-flags-react';
|
|
12
10
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
13
11
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
14
12
|
import Tooltip from '@atlaskit/tooltip';
|
|
15
13
|
import { Pulse } from '../Pulse/Pulse';
|
|
16
|
-
import { ButtonSpotlightCard } from './ButtonSpotlightCard';
|
|
17
14
|
import { getButtonStyles, iconOnlySpacing } from './styles';
|
|
18
15
|
var customSizeAndPadding = {
|
|
19
16
|
minWidth: "var(--ds-space-400, 32px)",
|
|
@@ -51,7 +48,6 @@ var FloatingToolbarButton = function FloatingToolbarButton(_ref, forwardedRef) {
|
|
|
51
48
|
ariaLabel = _ref.ariaLabel,
|
|
52
49
|
isRadioButton = _ref.isRadioButton,
|
|
53
50
|
pulse = _ref.pulse,
|
|
54
|
-
spotlightConfig = _ref.spotlightConfig,
|
|
55
51
|
areAnyNewToolbarFlagsEnabled = _ref.areAnyNewToolbarFlagsEnabled;
|
|
56
52
|
// Check if there's only an icon and add additional styles
|
|
57
53
|
var iconOnly = (icon || iconAfter) && !children;
|
|
@@ -63,10 +59,6 @@ var FloatingToolbarButton = function FloatingToolbarButton(_ref, forwardedRef) {
|
|
|
63
59
|
*/
|
|
64
60
|
var ariaChecked = isRadioButton ? Boolean(isButtonPressed) : undefined;
|
|
65
61
|
var ariaPressed = isRadioButton ? undefined : isButtonPressed;
|
|
66
|
-
var _useState = useState(null),
|
|
67
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
68
|
-
spotlightReferenceElement = _useState2[0],
|
|
69
|
-
setSpotlightReferenceElement = _useState2[1];
|
|
70
62
|
useEffect(function () {
|
|
71
63
|
onMount === null || onMount === void 0 || onMount();
|
|
72
64
|
return function () {
|
|
@@ -74,12 +66,9 @@ var FloatingToolbarButton = function FloatingToolbarButton(_ref, forwardedRef) {
|
|
|
74
66
|
};
|
|
75
67
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
76
68
|
}, []);
|
|
77
|
-
var onSpotlightTargetClick = spotlightConfig !== null && spotlightConfig !== void 0 && spotlightConfig.isSpotlightOpen ? spotlightConfig === null || spotlightConfig === void 0 ? void 0 : spotlightConfig.onTargetClick : undefined;
|
|
78
69
|
var handleOnClick = useCallback(function (event) {
|
|
79
|
-
// fire the spotlight onTargetClick callback if a spotlight is rendered and callback is provided
|
|
80
|
-
onSpotlightTargetClick === null || onSpotlightTargetClick === void 0 || onSpotlightTargetClick();
|
|
81
70
|
onClick === null || onClick === void 0 || onClick(event);
|
|
82
|
-
}, [onClick
|
|
71
|
+
}, [onClick]);
|
|
83
72
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Tooltip
|
|
84
73
|
// Only fallback to title for tooltip if title is not shown
|
|
85
74
|
, {
|
|
@@ -91,7 +80,7 @@ var FloatingToolbarButton = function FloatingToolbarButton(_ref, forwardedRef) {
|
|
|
91
80
|
onMouseEnter: expValEquals('editor_a11y__enghealth-46814_fy26', 'isEnabled', true) ? undefined : onMouseEnter,
|
|
92
81
|
onMouseLeave: expValEquals('editor_a11y__enghealth-46814_fy26', 'isEnabled', true) ? undefined : onMouseLeave
|
|
93
82
|
}, /*#__PURE__*/React.createElement(Pulse, {
|
|
94
|
-
pulse:
|
|
83
|
+
pulse: !expValEquals('platform_editor_spotlight_migration', 'isEnabled', true) && pulse
|
|
95
84
|
}, /*#__PURE__*/React.createElement(Button
|
|
96
85
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop, @atlaskit/design-system/no-unsafe-style-overrides -- Ignored via go/DSP-18766
|
|
97
86
|
, {
|
|
@@ -99,7 +88,6 @@ var FloatingToolbarButton = function FloatingToolbarButton(_ref, forwardedRef) {
|
|
|
99
88
|
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
100
89
|
,
|
|
101
90
|
ref: function ref(buttonElement) {
|
|
102
|
-
setSpotlightReferenceElement(buttonElement);
|
|
103
91
|
if (forwardedRef && editorExperiment('platform_synced_block', true)) {
|
|
104
92
|
if (typeof forwardedRef === 'function') {
|
|
105
93
|
forwardedRef(buttonElement);
|
|
@@ -151,11 +139,7 @@ var FloatingToolbarButton = function FloatingToolbarButton(_ref, forwardedRef) {
|
|
|
151
139
|
// should be fixed here https://a11y-internal.atlassian.net/browse/DST-287
|
|
152
140
|
,
|
|
153
141
|
tabIndex: tabIndex
|
|
154
|
-
}, children))))
|
|
155
|
-
referenceElement: spotlightReferenceElement
|
|
156
|
-
// Ignored via go/ees005
|
|
157
|
-
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
158
|
-
}, spotlightConfig.spotlightCardOptions)));
|
|
142
|
+
}, children)))));
|
|
159
143
|
};
|
|
160
144
|
|
|
161
145
|
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
@@ -4,8 +4,6 @@ import type { Node, NodeType } from '@atlaskit/editor-prosemirror/model';
|
|
|
4
4
|
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
5
5
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
6
6
|
import type { EmojiId } from '@atlaskit/emoji/types';
|
|
7
|
-
import type { SpotlightCard } from '@atlaskit/onboarding';
|
|
8
|
-
import type { Placement } from '@atlaskit/popper';
|
|
9
7
|
import type { TooltipProps } from '@atlaskit/tooltip';
|
|
10
8
|
import type { DispatchAnalyticsEvent } from '../analytics/types/dispatch-analytics-event';
|
|
11
9
|
import type { DropdownMenuItemProps } from '../floating-toolbar';
|
|
@@ -130,14 +128,6 @@ export type ConfirmationDialogProps = {
|
|
|
130
128
|
options?: ConfirmDialogOptions;
|
|
131
129
|
testId?: string;
|
|
132
130
|
};
|
|
133
|
-
export type FloatingToolbarButtonSpotlightConfig = {
|
|
134
|
-
isSpotlightOpen: boolean;
|
|
135
|
-
onTargetClick?: () => void;
|
|
136
|
-
pulse?: boolean;
|
|
137
|
-
spotlightCardOptions: React.ComponentProps<typeof SpotlightCard> & {
|
|
138
|
-
placement?: Placement;
|
|
139
|
-
};
|
|
140
|
-
};
|
|
141
131
|
export type FloatingToolbarCopyButton = {
|
|
142
132
|
hidden?: boolean;
|
|
143
133
|
items: Array<FloatingToolbarSeparator | MarkOptions | NodeOptions>;
|
|
@@ -175,7 +165,6 @@ export type FloatingToolbarButton<T extends Object> = {
|
|
|
175
165
|
pulse?: boolean;
|
|
176
166
|
selected?: boolean;
|
|
177
167
|
showTitle?: boolean;
|
|
178
|
-
spotlightConfig?: FloatingToolbarButtonSpotlightConfig;
|
|
179
168
|
supportsViewMode?: boolean;
|
|
180
169
|
tabIndex?: number | null | undefined;
|
|
181
170
|
target?: string;
|
|
@@ -13,7 +13,7 @@ export type { FeatureFlags, FeatureFlagKey, GetEditorFeatureFlags } from './feat
|
|
|
13
13
|
export type { Browsers, Range, DisableSpellcheckByBrowser } from './supported-browsers';
|
|
14
14
|
export type { EditorContainerWidth, GetEditorContainerWidth } from './editor-container-width';
|
|
15
15
|
export type { EmptyStateHandler, EmptyStateHandlerParams } from './empty-state-handler';
|
|
16
|
-
export type { RenderOptionsPropsT, DropdownOptionT, DropdownOptions, ExtensionDropdownOptions, SelectOption, ButtonAppearance, Icon, RenderOptionsProps, AlignType, ConfirmDialogChildInfo, ConfirmDialogOptions, ConfirmationDialogProps, FloatingToolbarButton, FloatingToolbarCopyButton, FloatingToolbarInput, FloatingToolbarCustom, FloatingToolbarListPicker, FloatingToolbarColorPicker, FloatingToolbarEmojiPicker, FloatingToolbarDatePicker, FloatingToolbarSelect, FloatingToolbarSeparator, FloatingToolbarDropdown, FloatingToolbarFallbackItem, FloatingToolbarItem, FloatingToolbarConfig, FloatingToolbarHandler,
|
|
16
|
+
export type { RenderOptionsPropsT, DropdownOptionT, DropdownOptions, ExtensionDropdownOptions, SelectOption, ButtonAppearance, Icon, RenderOptionsProps, AlignType, ConfirmDialogChildInfo, ConfirmDialogOptions, ConfirmationDialogProps, FloatingToolbarButton, FloatingToolbarCopyButton, FloatingToolbarInput, FloatingToolbarCustom, FloatingToolbarListPicker, FloatingToolbarColorPicker, FloatingToolbarEmojiPicker, FloatingToolbarDatePicker, FloatingToolbarSelect, FloatingToolbarSeparator, FloatingToolbarDropdown, FloatingToolbarFallbackItem, FloatingToolbarItem, FloatingToolbarConfig, FloatingToolbarHandler, typeOption, FloatingToolbarOverflowDropdown, FloatingToolbarOverflowDropdownOptions, OverflowDropdownHeading, OverflowDropdownOption, } from './floating-toolbar';
|
|
17
17
|
export type { MarkOptions, NodeOptions } from './copy-button';
|
|
18
18
|
export type { ContextPanelHandler } from './context-panel';
|
|
19
19
|
export type { EditorAppearance, EditorContentMode } from './editor-appearance';
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { TooltipProps } from '@atlaskit/tooltip';
|
|
3
3
|
import type { ButtonAppearance } from '../../types';
|
|
4
|
-
import type { FloatingToolbarButtonSpotlightConfig } from '../../types/floating-toolbar';
|
|
5
4
|
export interface Props {
|
|
6
5
|
appearance?: ButtonAppearance;
|
|
7
6
|
areaControls?: string;
|
|
@@ -28,7 +27,6 @@ export interface Props {
|
|
|
28
27
|
/** If true, the component will have pulse onboarding effect around it. */
|
|
29
28
|
pulse?: boolean;
|
|
30
29
|
selected?: boolean;
|
|
31
|
-
spotlightConfig?: FloatingToolbarButtonSpotlightConfig;
|
|
32
30
|
tabIndex?: number | null | undefined;
|
|
33
31
|
target?: string;
|
|
34
32
|
testId?: string;
|
|
@@ -4,8 +4,6 @@ import type { Node, NodeType } from '@atlaskit/editor-prosemirror/model';
|
|
|
4
4
|
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
5
5
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
6
6
|
import type { EmojiId } from '@atlaskit/emoji/types';
|
|
7
|
-
import type { SpotlightCard } from '@atlaskit/onboarding';
|
|
8
|
-
import type { Placement } from '@atlaskit/popper';
|
|
9
7
|
import type { TooltipProps } from '@atlaskit/tooltip';
|
|
10
8
|
import type { DispatchAnalyticsEvent } from '../analytics/types/dispatch-analytics-event';
|
|
11
9
|
import type { DropdownMenuItemProps } from '../floating-toolbar';
|
|
@@ -130,14 +128,6 @@ export type ConfirmationDialogProps = {
|
|
|
130
128
|
options?: ConfirmDialogOptions;
|
|
131
129
|
testId?: string;
|
|
132
130
|
};
|
|
133
|
-
export type FloatingToolbarButtonSpotlightConfig = {
|
|
134
|
-
isSpotlightOpen: boolean;
|
|
135
|
-
onTargetClick?: () => void;
|
|
136
|
-
pulse?: boolean;
|
|
137
|
-
spotlightCardOptions: React.ComponentProps<typeof SpotlightCard> & {
|
|
138
|
-
placement?: Placement;
|
|
139
|
-
};
|
|
140
|
-
};
|
|
141
131
|
export type FloatingToolbarCopyButton = {
|
|
142
132
|
hidden?: boolean;
|
|
143
133
|
items: Array<FloatingToolbarSeparator | MarkOptions | NodeOptions>;
|
|
@@ -175,7 +165,6 @@ export type FloatingToolbarButton<T extends Object> = {
|
|
|
175
165
|
pulse?: boolean;
|
|
176
166
|
selected?: boolean;
|
|
177
167
|
showTitle?: boolean;
|
|
178
|
-
spotlightConfig?: FloatingToolbarButtonSpotlightConfig;
|
|
179
168
|
supportsViewMode?: boolean;
|
|
180
169
|
tabIndex?: number | null | undefined;
|
|
181
170
|
target?: string;
|
|
@@ -13,7 +13,7 @@ export type { FeatureFlags, FeatureFlagKey, GetEditorFeatureFlags } from './feat
|
|
|
13
13
|
export type { Browsers, Range, DisableSpellcheckByBrowser } from './supported-browsers';
|
|
14
14
|
export type { EditorContainerWidth, GetEditorContainerWidth } from './editor-container-width';
|
|
15
15
|
export type { EmptyStateHandler, EmptyStateHandlerParams } from './empty-state-handler';
|
|
16
|
-
export type { RenderOptionsPropsT, DropdownOptionT, DropdownOptions, ExtensionDropdownOptions, SelectOption, ButtonAppearance, Icon, RenderOptionsProps, AlignType, ConfirmDialogChildInfo, ConfirmDialogOptions, ConfirmationDialogProps, FloatingToolbarButton, FloatingToolbarCopyButton, FloatingToolbarInput, FloatingToolbarCustom, FloatingToolbarListPicker, FloatingToolbarColorPicker, FloatingToolbarEmojiPicker, FloatingToolbarDatePicker, FloatingToolbarSelect, FloatingToolbarSeparator, FloatingToolbarDropdown, FloatingToolbarFallbackItem, FloatingToolbarItem, FloatingToolbarConfig, FloatingToolbarHandler,
|
|
16
|
+
export type { RenderOptionsPropsT, DropdownOptionT, DropdownOptions, ExtensionDropdownOptions, SelectOption, ButtonAppearance, Icon, RenderOptionsProps, AlignType, ConfirmDialogChildInfo, ConfirmDialogOptions, ConfirmationDialogProps, FloatingToolbarButton, FloatingToolbarCopyButton, FloatingToolbarInput, FloatingToolbarCustom, FloatingToolbarListPicker, FloatingToolbarColorPicker, FloatingToolbarEmojiPicker, FloatingToolbarDatePicker, FloatingToolbarSelect, FloatingToolbarSeparator, FloatingToolbarDropdown, FloatingToolbarFallbackItem, FloatingToolbarItem, FloatingToolbarConfig, FloatingToolbarHandler, typeOption, FloatingToolbarOverflowDropdown, FloatingToolbarOverflowDropdownOptions, OverflowDropdownHeading, OverflowDropdownOption, } from './floating-toolbar';
|
|
17
17
|
export type { MarkOptions, NodeOptions } from './copy-button';
|
|
18
18
|
export type { ContextPanelHandler } from './context-panel';
|
|
19
19
|
export type { EditorAppearance, EditorContentMode } from './editor-appearance';
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { TooltipProps } from '@atlaskit/tooltip';
|
|
3
3
|
import type { ButtonAppearance } from '../../types';
|
|
4
|
-
import type { FloatingToolbarButtonSpotlightConfig } from '../../types/floating-toolbar';
|
|
5
4
|
export interface Props {
|
|
6
5
|
appearance?: ButtonAppearance;
|
|
7
6
|
areaControls?: string;
|
|
@@ -28,7 +27,6 @@ export interface Props {
|
|
|
28
27
|
/** If true, the component will have pulse onboarding effect around it. */
|
|
29
28
|
pulse?: boolean;
|
|
30
29
|
selected?: boolean;
|
|
31
|
-
spotlightConfig?: FloatingToolbarButtonSpotlightConfig;
|
|
32
30
|
tabIndex?: number | null | undefined;
|
|
33
31
|
target?: string;
|
|
34
32
|
testId?: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-common",
|
|
3
|
-
"version": "112.17.
|
|
3
|
+
"version": "112.17.1",
|
|
4
4
|
"description": "A package that contains common classes and components for editor and renderer",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"@atlaskit/analytics-listeners": "^10.0.0",
|
|
37
37
|
"@atlaskit/analytics-namespaced-context": "^7.2.0",
|
|
38
38
|
"@atlaskit/analytics-next": "^11.2.0",
|
|
39
|
-
"@atlaskit/atlassian-context": "^0.
|
|
39
|
+
"@atlaskit/atlassian-context": "^0.7.0",
|
|
40
40
|
"@atlaskit/browser-apis": "^0.0.1",
|
|
41
41
|
"@atlaskit/button": "^23.10.0",
|
|
42
42
|
"@atlaskit/codemod-utils": "^4.2.0",
|
|
@@ -69,7 +69,6 @@
|
|
|
69
69
|
"@atlaskit/onboarding": "^14.5.0",
|
|
70
70
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
71
71
|
"@atlaskit/platform-feature-flags-react": "^0.4.0",
|
|
72
|
-
"@atlaskit/popper": "^7.1.0",
|
|
73
72
|
"@atlaskit/primitives": "^18.1.0",
|
|
74
73
|
"@atlaskit/profilecard": "^24.46.0",
|
|
75
74
|
"@atlaskit/prosemirror-history": "^0.2.0",
|
|
@@ -80,7 +79,7 @@
|
|
|
80
79
|
"@atlaskit/spinner": "^19.0.0",
|
|
81
80
|
"@atlaskit/task-decision": "^19.3.0",
|
|
82
81
|
"@atlaskit/textfield": "^8.2.0",
|
|
83
|
-
"@atlaskit/tmp-editor-statsig": "^54.
|
|
82
|
+
"@atlaskit/tmp-editor-statsig": "^54.3.0",
|
|
84
83
|
"@atlaskit/tokens": "^11.4.0",
|
|
85
84
|
"@atlaskit/tooltip": "^21.1.0",
|
|
86
85
|
"@atlaskit/width-detector": "^5.0.0",
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.ButtonSpotlightCard = void 0;
|
|
8
|
-
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
9
|
-
var _react = _interopRequireDefault(require("react"));
|
|
10
|
-
var _onboarding = require("@atlaskit/onboarding");
|
|
11
|
-
var _popper = require("@atlaskit/popper");
|
|
12
|
-
var _excluded = ["referenceElement", "placement"]; // eslint-disable-next-line @atlaskit/design-system/use-spotlight-package
|
|
13
|
-
/*
|
|
14
|
-
* ButtonSpotlightCard is an editor custom spotlight that renders next to a floating toolbar button.
|
|
15
|
-
* It is built on top of the SpotlightCard component from @atlaskit/onboarding.
|
|
16
|
-
* It avoids the issue of the native atlaskit Spotlight component rendering outside the editor bounds and takes focus away from the editor.
|
|
17
|
-
*/
|
|
18
|
-
var ButtonSpotlightCard = exports.ButtonSpotlightCard = function ButtonSpotlightCard(props) {
|
|
19
|
-
var referenceElement = props.referenceElement,
|
|
20
|
-
_props$placement = props.placement,
|
|
21
|
-
placement = _props$placement === void 0 ? 'top-start' : _props$placement,
|
|
22
|
-
spotlightCardProps = (0, _objectWithoutProperties2.default)(props, _excluded);
|
|
23
|
-
return /*#__PURE__*/_react.default.createElement(_popper.Popper, {
|
|
24
|
-
referenceElement: referenceElement,
|
|
25
|
-
placement: placement,
|
|
26
|
-
strategy: "absolute"
|
|
27
|
-
}, function (_ref) {
|
|
28
|
-
var ref = _ref.ref,
|
|
29
|
-
style = _ref.style;
|
|
30
|
-
return (
|
|
31
|
-
/*#__PURE__*/
|
|
32
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
|
|
33
|
-
_react.default.createElement("div", {
|
|
34
|
-
ref: ref,
|
|
35
|
-
style: style
|
|
36
|
-
}, /*#__PURE__*/_react.default.createElement(_onboarding.SpotlightCard
|
|
37
|
-
// Ignored via go/ees005
|
|
38
|
-
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
39
|
-
, spotlightCardProps))
|
|
40
|
-
);
|
|
41
|
-
});
|
|
42
|
-
};
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
// eslint-disable-next-line @atlaskit/design-system/use-spotlight-package
|
|
3
|
-
import { SpotlightCard } from '@atlaskit/onboarding';
|
|
4
|
-
import { Popper } from '@atlaskit/popper';
|
|
5
|
-
/*
|
|
6
|
-
* ButtonSpotlightCard is an editor custom spotlight that renders next to a floating toolbar button.
|
|
7
|
-
* It is built on top of the SpotlightCard component from @atlaskit/onboarding.
|
|
8
|
-
* It avoids the issue of the native atlaskit Spotlight component rendering outside the editor bounds and takes focus away from the editor.
|
|
9
|
-
*/
|
|
10
|
-
export const ButtonSpotlightCard = props => {
|
|
11
|
-
const {
|
|
12
|
-
referenceElement,
|
|
13
|
-
placement = 'top-start',
|
|
14
|
-
...spotlightCardProps
|
|
15
|
-
} = props;
|
|
16
|
-
return /*#__PURE__*/React.createElement(Popper, {
|
|
17
|
-
referenceElement: referenceElement,
|
|
18
|
-
placement: placement,
|
|
19
|
-
strategy: "absolute"
|
|
20
|
-
}, ({
|
|
21
|
-
ref,
|
|
22
|
-
style
|
|
23
|
-
}) =>
|
|
24
|
-
/*#__PURE__*/
|
|
25
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
|
|
26
|
-
React.createElement("div", {
|
|
27
|
-
ref: ref,
|
|
28
|
-
style: style
|
|
29
|
-
}, /*#__PURE__*/React.createElement(SpotlightCard
|
|
30
|
-
// Ignored via go/ees005
|
|
31
|
-
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
32
|
-
, spotlightCardProps)));
|
|
33
|
-
};
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
2
|
-
var _excluded = ["referenceElement", "placement"];
|
|
3
|
-
import React from 'react';
|
|
4
|
-
// eslint-disable-next-line @atlaskit/design-system/use-spotlight-package
|
|
5
|
-
import { SpotlightCard } from '@atlaskit/onboarding';
|
|
6
|
-
import { Popper } from '@atlaskit/popper';
|
|
7
|
-
/*
|
|
8
|
-
* ButtonSpotlightCard is an editor custom spotlight that renders next to a floating toolbar button.
|
|
9
|
-
* It is built on top of the SpotlightCard component from @atlaskit/onboarding.
|
|
10
|
-
* It avoids the issue of the native atlaskit Spotlight component rendering outside the editor bounds and takes focus away from the editor.
|
|
11
|
-
*/
|
|
12
|
-
export var ButtonSpotlightCard = function ButtonSpotlightCard(props) {
|
|
13
|
-
var referenceElement = props.referenceElement,
|
|
14
|
-
_props$placement = props.placement,
|
|
15
|
-
placement = _props$placement === void 0 ? 'top-start' : _props$placement,
|
|
16
|
-
spotlightCardProps = _objectWithoutProperties(props, _excluded);
|
|
17
|
-
return /*#__PURE__*/React.createElement(Popper, {
|
|
18
|
-
referenceElement: referenceElement,
|
|
19
|
-
placement: placement,
|
|
20
|
-
strategy: "absolute"
|
|
21
|
-
}, function (_ref) {
|
|
22
|
-
var ref = _ref.ref,
|
|
23
|
-
style = _ref.style;
|
|
24
|
-
return (
|
|
25
|
-
/*#__PURE__*/
|
|
26
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
|
|
27
|
-
React.createElement("div", {
|
|
28
|
-
ref: ref,
|
|
29
|
-
style: style
|
|
30
|
-
}, /*#__PURE__*/React.createElement(SpotlightCard
|
|
31
|
-
// Ignored via go/ees005
|
|
32
|
-
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
33
|
-
, spotlightCardProps))
|
|
34
|
-
);
|
|
35
|
-
});
|
|
36
|
-
};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { ComponentProps } from 'react';
|
|
3
|
-
import { SpotlightCard } from '@atlaskit/onboarding';
|
|
4
|
-
import type { Placement } from '@atlaskit/popper';
|
|
5
|
-
type PropsFromSpotlightCard = ComponentProps<typeof SpotlightCard>;
|
|
6
|
-
export type ButtonSpotlightCardProps = PropsFromSpotlightCard & {
|
|
7
|
-
placement?: Placement;
|
|
8
|
-
referenceElement: HTMLElement;
|
|
9
|
-
};
|
|
10
|
-
export declare const ButtonSpotlightCard: (props: ButtonSpotlightCardProps) => React.JSX.Element;
|
|
11
|
-
export {};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { ComponentProps } from 'react';
|
|
3
|
-
import { SpotlightCard } from '@atlaskit/onboarding';
|
|
4
|
-
import type { Placement } from '@atlaskit/popper';
|
|
5
|
-
type PropsFromSpotlightCard = ComponentProps<typeof SpotlightCard>;
|
|
6
|
-
export type ButtonSpotlightCardProps = PropsFromSpotlightCard & {
|
|
7
|
-
placement?: Placement;
|
|
8
|
-
referenceElement: HTMLElement;
|
|
9
|
-
};
|
|
10
|
-
export declare const ButtonSpotlightCard: (props: ButtonSpotlightCardProps) => React.JSX.Element;
|
|
11
|
-
export {};
|