@atlaskit/editor-common 116.47.0 → 116.48.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 +65 -0
- package/afm-cc/tsconfig.json +3 -0
- package/afm-products/tsconfig.json +3 -0
- package/dist/cjs/element-browser/components/ViewMore.js +1 -1
- package/dist/cjs/extensibility/Extension/Lozenge/ExtensionFloatingLabel.js +1 -1
- package/dist/cjs/extensions/UnknownMacroPlaceholder.js +1 -1
- package/dist/cjs/icons/shared/PanelErrorIcon.js +1 -1
- package/dist/cjs/icons/shared/PanelInfoIcon.js +1 -1
- package/dist/cjs/icons/shared/PanelNoteIcon.js +1 -1
- package/dist/cjs/icons/shared/PanelSuccessIcon.js +1 -1
- package/dist/cjs/icons/shared/PanelWarningIcon.js +1 -1
- package/dist/cjs/messages/syncBlock.js +30 -0
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/table/NewSortingIcon.js +1 -1
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/cjs/ui/Layer/index.js +138 -18
- package/dist/cjs/ui/Shortcut/index.js +1 -1
- package/dist/cjs/ui/Toolbar/ButtonGroup.js +1 -1
- package/dist/cjs/ui/Toolbar/DropdownTriggerWrapper.js +1 -1
- package/dist/cjs/ui/Toolbar/DropdownWrapper.js +1 -1
- package/dist/cjs/ui/Toolbar/ExpandIcon.js +1 -1
- package/dist/cjs/ui/Toolbar/Separator.js +1 -1
- package/dist/cjs/ui-color/ColorPalette/Palettes/lightBackgroundPaletteTooltipMessages.js +0 -45
- package/dist/cjs/ui-color/ColorPalette/Palettes/paletteMessages.js +0 -60
- package/dist/cjs/ui-color/index.js +0 -7
- package/dist/cjs/vanilla-tooltip/index.js +9 -1
- package/dist/es2019/element-browser/components/ViewMore.js +1 -1
- package/dist/es2019/extensibility/Extension/Lozenge/ExtensionFloatingLabel.js +1 -1
- package/dist/es2019/extensions/UnknownMacroPlaceholder.js +1 -1
- package/dist/es2019/icons/shared/PanelErrorIcon.js +1 -1
- package/dist/es2019/icons/shared/PanelInfoIcon.js +1 -1
- package/dist/es2019/icons/shared/PanelNoteIcon.js +1 -1
- package/dist/es2019/icons/shared/PanelSuccessIcon.js +1 -1
- package/dist/es2019/icons/shared/PanelWarningIcon.js +1 -1
- package/dist/es2019/messages/syncBlock.js +30 -0
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/table/NewSortingIcon.js +1 -1
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/es2019/ui/Layer/index.js +120 -13
- package/dist/es2019/ui/Shortcut/index.js +1 -1
- package/dist/es2019/ui/Toolbar/ButtonGroup.js +1 -1
- package/dist/es2019/ui/Toolbar/DropdownTriggerWrapper.js +1 -1
- package/dist/es2019/ui/Toolbar/DropdownWrapper.js +1 -1
- package/dist/es2019/ui/Toolbar/ExpandIcon.js +1 -1
- package/dist/es2019/ui/Toolbar/Separator.js +1 -1
- package/dist/es2019/ui-color/ColorPalette/Palettes/lightBackgroundPaletteTooltipMessages.js +0 -45
- package/dist/es2019/ui-color/ColorPalette/Palettes/paletteMessages.js +0 -60
- package/dist/es2019/ui-color/index.js +0 -1
- package/dist/es2019/vanilla-tooltip/index.js +10 -2
- package/dist/esm/element-browser/components/ViewMore.js +1 -1
- package/dist/esm/extensibility/Extension/Lozenge/ExtensionFloatingLabel.js +1 -1
- package/dist/esm/extensions/UnknownMacroPlaceholder.js +1 -1
- package/dist/esm/icons/shared/PanelErrorIcon.js +1 -1
- package/dist/esm/icons/shared/PanelInfoIcon.js +1 -1
- package/dist/esm/icons/shared/PanelNoteIcon.js +1 -1
- package/dist/esm/icons/shared/PanelSuccessIcon.js +1 -1
- package/dist/esm/icons/shared/PanelWarningIcon.js +1 -1
- package/dist/esm/messages/syncBlock.js +30 -0
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/table/NewSortingIcon.js +1 -1
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/esm/ui/Layer/index.js +138 -19
- package/dist/esm/ui/Shortcut/index.js +1 -1
- package/dist/esm/ui/Toolbar/ButtonGroup.js +1 -1
- package/dist/esm/ui/Toolbar/DropdownTriggerWrapper.js +1 -1
- package/dist/esm/ui/Toolbar/DropdownWrapper.js +1 -1
- package/dist/esm/ui/Toolbar/ExpandIcon.js +1 -1
- package/dist/esm/ui/Toolbar/Separator.js +1 -1
- package/dist/esm/ui-color/ColorPalette/Palettes/lightBackgroundPaletteTooltipMessages.js +0 -45
- package/dist/esm/ui-color/ColorPalette/Palettes/paletteMessages.js +0 -60
- package/dist/esm/ui-color/index.js +0 -1
- package/dist/esm/vanilla-tooltip/index.js +10 -2
- package/dist/types/messages/syncBlock.d.ts +30 -0
- package/dist/types/ui/Layer/index.d.ts +3 -26
- package/dist/types/ui/Layer/internal/helpers.d.ts +1 -1
- package/dist/types/ui-color/ColorPalette/Palettes/lightBackgroundPaletteTooltipMessages.d.ts +1 -46
- package/dist/types/ui-color/ColorPalette/Palettes/paletteMessages.d.ts +0 -60
- package/dist/types/ui-color/index.d.ts +0 -1
- package/package.json +9 -4
- package/dist/cjs/ui-color/ColorPalette/Palettes/cellBackgroundColorPaletteNew.js +0 -28
- package/dist/es2019/ui-color/ColorPalette/Palettes/cellBackgroundColorPaletteNew.js +0 -21
- package/dist/esm/ui-color/ColorPalette/Palettes/cellBackgroundColorPaletteNew.js +0 -21
- package/dist/types/ui-color/ColorPalette/Palettes/cellBackgroundColorPaletteNew.d.ts +0 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,70 @@
|
|
|
1
1
|
# @atlaskit/editor-common
|
|
2
2
|
|
|
3
|
+
## 116.48.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 116.48.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- [`ff72ee885c82b`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/ff72ee885c82b) -
|
|
14
|
+
[ux] Prompt users with a feedback flag after undoing or deleting a synced block, and open the
|
|
15
|
+
product feedback collector only when they choose Give feedback. Keep the prompt UI and scoped
|
|
16
|
+
action alignment in the synced block plugin while preserving Flag's built-in action buttons.
|
|
17
|
+
|
|
18
|
+
Products check and persist the prompt allowance around the shared flag lifecycle:
|
|
19
|
+
|
|
20
|
+
```ts
|
|
21
|
+
{
|
|
22
|
+
shouldShowFeedbackPrompt: () => !feedbackStorage.has('prompt-shown'),
|
|
23
|
+
onFeedbackPromptShown: () => feedbackStorage.set('prompt-shown', true),
|
|
24
|
+
onGiveFeedback: (context) => openFeedbackCollector(context),
|
|
25
|
+
}
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
- [`17014b0e91a7f`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/17014b0e91a7f) -
|
|
29
|
+
Update the synced locations activation empty state
|
|
30
|
+
- [`7cecf41634d18`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/7cecf41634d18) -
|
|
31
|
+
Revert the lime, orange, and magenta table cell background color options.
|
|
32
|
+
|
|
33
|
+
### Patch Changes
|
|
34
|
+
|
|
35
|
+
- [`6902b31db1608`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/6902b31db1608) -
|
|
36
|
+
Consolidate direct Popper.js callers behind `@atlaskit/popper` compatibility entry points and
|
|
37
|
+
feature-gated consumer adapters.
|
|
38
|
+
|
|
39
|
+
`@atlaskit/popper` now exposes compatibility entry points so existing direct `popper.js` /
|
|
40
|
+
`react-popper` callers can move their dependency ownership onto `@atlaskit/popper` without a full
|
|
41
|
+
rewrite:
|
|
42
|
+
- `@atlaskit/popper/react-popper` re-exports the React `usePopper` hook and `Manager` / `Popper` /
|
|
43
|
+
`Reference` render-prop components.
|
|
44
|
+
- `@atlaskit/popper/unsafe-imperative` re-exports the raw Popper.js v2 `createPopper` for
|
|
45
|
+
non-React, imperative callers. This is an escape hatch for existing callers only. Do not use it
|
|
46
|
+
for new code; build new overlays on `@atlaskit/top-layer` instead.
|
|
47
|
+
|
|
48
|
+
```ts
|
|
49
|
+
// Imperative callers (migrating away from a direct `@popperjs/core` / `popper.js` import):
|
|
50
|
+
import { createPopper } from '@atlaskit/popper/unsafe-imperative';
|
|
51
|
+
|
|
52
|
+
const instance = createPopper(referenceElement, popperElement, {
|
|
53
|
+
placement: 'bottom-start',
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
// React callers (migrating away from a direct `react-popper` import):
|
|
57
|
+
import { usePopper } from '@atlaskit/popper/react-popper';
|
|
58
|
+
|
|
59
|
+
const { styles, attributes } = usePopper(referenceElement, popperElement, {
|
|
60
|
+
placement: 'bottom-start',
|
|
61
|
+
});
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
- [`04f47b1369740`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/04f47b1369740) -
|
|
65
|
+
Clarify source synced block labels and show more of referenced titles
|
|
66
|
+
- Updated dependencies
|
|
67
|
+
|
|
3
68
|
## 116.47.0
|
|
4
69
|
|
|
5
70
|
### Minor Changes
|
package/afm-cc/tsconfig.json
CHANGED
|
@@ -139,6 +139,9 @@
|
|
|
139
139
|
{
|
|
140
140
|
"path": "../../../platform/feature-flags-react/afm-products/tsconfig.json"
|
|
141
141
|
},
|
|
142
|
+
{
|
|
143
|
+
"path": "../../../design-system/popper/afm-products/tsconfig.json"
|
|
144
|
+
},
|
|
142
145
|
{
|
|
143
146
|
"path": "../../../design-system/primitives/afm-products/tsconfig.json"
|
|
144
147
|
},
|
|
@@ -46,6 +46,11 @@ var syncBlockMessages = exports.syncBlockMessages = (0, _reactIntl.defineMessage
|
|
|
46
46
|
defaultMessage: 'Synced block',
|
|
47
47
|
description: 'Label which appears above the synced block when it is selected'
|
|
48
48
|
},
|
|
49
|
+
sourceSyncedBlockLabel: {
|
|
50
|
+
id: 'fabric.editor.sourceSyncedBlock.label.text',
|
|
51
|
+
defaultMessage: 'Source synced block',
|
|
52
|
+
description: 'Label which identifies the editable source synced block when it is selected'
|
|
53
|
+
},
|
|
49
54
|
unsyncedBlockLabel: {
|
|
50
55
|
id: 'fabric.editor.unsyncedBlock.label.text',
|
|
51
56
|
defaultMessage: 'Unsynced block',
|
|
@@ -206,6 +211,26 @@ var syncBlockMessages = exports.syncBlockMessages = (0, _reactIntl.defineMessage
|
|
|
206
211
|
defaultMessage: 'You appear to be offline. Please connect to the internet to create synced content.',
|
|
207
212
|
description: 'Description in flag which appears when a sync block cannot be created in offline mode'
|
|
208
213
|
},
|
|
214
|
+
feedbackFlagTitle: {
|
|
215
|
+
id: 'editor-common.messages.syncBlock.feedbackFlagTitle',
|
|
216
|
+
defaultMessage: 'Help us improve Synced blocks',
|
|
217
|
+
description: 'Title of the flag inviting users to give feedback about synced blocks'
|
|
218
|
+
},
|
|
219
|
+
feedbackFlagDescription: {
|
|
220
|
+
id: 'editor-common.messages.syncBlock.feedbackFlagDescription',
|
|
221
|
+
defaultMessage: 'We’d love your feedback. This quick survey should take less than a minute.',
|
|
222
|
+
description: 'Description of the flag inviting users to give feedback about synced blocks'
|
|
223
|
+
},
|
|
224
|
+
feedbackFlagGiveFeedback: {
|
|
225
|
+
id: 'editor-common.messages.syncBlock.feedbackFlagGiveFeedback',
|
|
226
|
+
defaultMessage: 'Give feedback',
|
|
227
|
+
description: 'Action that opens the synced blocks feedback collector'
|
|
228
|
+
},
|
|
229
|
+
feedbackFlagNoThanks: {
|
|
230
|
+
id: 'editor-common.messages.syncBlock.feedbackFlagNoThanks',
|
|
231
|
+
defaultMessage: 'No thanks',
|
|
232
|
+
description: 'Action that dismisses the synced blocks feedback invitation'
|
|
233
|
+
},
|
|
209
234
|
loadingSyncedContent: {
|
|
210
235
|
id: 'fabric.editor.syncedBlockLoadingSyncedContent',
|
|
211
236
|
defaultMessage: 'Loading synced content',
|
|
@@ -321,6 +346,11 @@ var syncBlockMessages = exports.syncBlockMessages = (0, _reactIntl.defineMessage
|
|
|
321
346
|
defaultMessage: 'Copy and paste synced blocks to reuse in other locations.',
|
|
322
347
|
description: 'Message shown in the synced location dropdown menu when no shared locations are found'
|
|
323
348
|
},
|
|
349
|
+
syncedLocationDropdownActivationNoResults: {
|
|
350
|
+
id: 'editor-common.messages.syncBlock.syncedLocationDropdownActivationNoResults',
|
|
351
|
+
defaultMessage: 'To reuse content, copy and paste this block to sync to other locations',
|
|
352
|
+
description: 'Instruction shown in the activation synced locations dropdown when a synced block has no references. It explains how to create the first reference.'
|
|
353
|
+
},
|
|
324
354
|
syncedLocationDropdownLearnMoreLink: {
|
|
325
355
|
id: 'fabric.editor.syncedLocationDropdownLearnMoreLink',
|
|
326
356
|
defaultMessage: 'Learn more about synced blocks',
|
|
@@ -28,7 +28,7 @@ var NETWORK_FAILURE_REGEX = /^network failure/i;
|
|
|
28
28
|
var RESIZE_OBSERVER_LOOP_REGEX = /ResizeObserver loop completed with undelivered notifications/;
|
|
29
29
|
var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
30
30
|
var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
31
|
-
var packageVersion = "116.
|
|
31
|
+
var packageVersion = "116.48.0";
|
|
32
32
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
33
33
|
// Remove URL as it has UGC
|
|
34
34
|
// 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 = "116.
|
|
27
|
+
var packageVersion = "116.48.0";
|
|
28
28
|
var halfFocusRing = 1;
|
|
29
29
|
var dropOffset = '0, 8';
|
|
30
30
|
var fadeIn = (0, _react2.keyframes)({
|
|
@@ -5,7 +5,8 @@ var _typeof = require("@babel/runtime/helpers/typeof");
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.default =
|
|
8
|
+
exports.default = Layer;
|
|
9
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
9
10
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
10
11
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
11
12
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
@@ -15,6 +16,8 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
|
15
16
|
var _react = _interopRequireWildcard(require("react"));
|
|
16
17
|
var _popper = _interopRequireDefault(require("popper.js"));
|
|
17
18
|
var _rafSchd = _interopRequireDefault(require("raf-schd"));
|
|
19
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
20
|
+
var _popper2 = require("@atlaskit/popper/popper");
|
|
18
21
|
var _helpers = require("./internal/helpers");
|
|
19
22
|
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
23
|
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; }
|
|
@@ -36,14 +39,26 @@ var defaultState = {
|
|
|
36
39
|
originalHeight: null,
|
|
37
40
|
maxHeight: null
|
|
38
41
|
};
|
|
42
|
+
function defaultOnPositioned() {}
|
|
43
|
+
var defaultProps = {
|
|
44
|
+
boundariesElement: 'viewport',
|
|
45
|
+
children: null,
|
|
46
|
+
content: null,
|
|
47
|
+
offset: '0, 0',
|
|
48
|
+
position: 'right middle',
|
|
49
|
+
zIndex: 400,
|
|
50
|
+
lockScroll: false,
|
|
51
|
+
isAlwaysFixed: false,
|
|
52
|
+
onPositioned: defaultOnPositioned
|
|
53
|
+
};
|
|
39
54
|
|
|
40
55
|
// Ignored via go/ees005
|
|
41
56
|
// eslint-disable-next-line @repo/internal/react/no-class-components
|
|
42
|
-
var
|
|
43
|
-
function
|
|
57
|
+
var LegacyLayer = /*#__PURE__*/function (_Component) {
|
|
58
|
+
function LegacyLayer(props) {
|
|
44
59
|
var _this;
|
|
45
|
-
(0, _classCallCheck2.default)(this,
|
|
46
|
-
_this = _callSuper(this,
|
|
60
|
+
(0, _classCallCheck2.default)(this, LegacyLayer);
|
|
61
|
+
_this = _callSuper(this, LegacyLayer, [props]);
|
|
47
62
|
(0, _defineProperty2.default)(_this, "targetRef", /*#__PURE__*/_react.default.createRef());
|
|
48
63
|
(0, _defineProperty2.default)(_this, "contentRef", /*#__PURE__*/_react.default.createRef());
|
|
49
64
|
(0, _defineProperty2.default)(_this, "extractStyles", function (state) {
|
|
@@ -68,8 +83,8 @@ var Layer = exports.default = /*#__PURE__*/function (_Component) {
|
|
|
68
83
|
_this.extractStyles = (0, _rafSchd.default)(_this.extractStyles.bind(_this));
|
|
69
84
|
return _this;
|
|
70
85
|
}
|
|
71
|
-
(0, _inherits2.default)(
|
|
72
|
-
return (0, _createClass2.default)(
|
|
86
|
+
(0, _inherits2.default)(LegacyLayer, _Component);
|
|
87
|
+
return (0, _createClass2.default)(LegacyLayer, [{
|
|
73
88
|
key: "componentDidMount",
|
|
74
89
|
value: function componentDidMount() {
|
|
75
90
|
this.applyPopper(this.props);
|
|
@@ -199,14 +214,119 @@ var Layer = exports.default = /*#__PURE__*/function (_Component) {
|
|
|
199
214
|
}]);
|
|
200
215
|
}(_react.Component);
|
|
201
216
|
// working with extract-react-types
|
|
202
|
-
(0, _defineProperty2.default)(
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
}
|
|
217
|
+
(0, _defineProperty2.default)(LegacyLayer, "defaultProps", defaultProps);
|
|
218
|
+
function parseOffset(_ref) {
|
|
219
|
+
var offset = _ref.offset;
|
|
220
|
+
var _offset$split = offset.split(','),
|
|
221
|
+
_offset$split2 = (0, _slicedToArray2.default)(_offset$split, 2),
|
|
222
|
+
rawSkidding = _offset$split2[0],
|
|
223
|
+
rawDistance = _offset$split2[1];
|
|
224
|
+
var skidding = Number.parseFloat(rawSkidding);
|
|
225
|
+
var distance = Number.parseFloat(rawDistance);
|
|
226
|
+
return [Number.isFinite(skidding) ? skidding : 0, Number.isFinite(distance) ? distance : 0];
|
|
227
|
+
}
|
|
228
|
+
var popperInteropModifiers = [{
|
|
229
|
+
name: 'flip',
|
|
230
|
+
enabled: false
|
|
231
|
+
}, {
|
|
232
|
+
name: 'preventOverflow',
|
|
233
|
+
enabled: false
|
|
234
|
+
}, {
|
|
235
|
+
name: 'hide',
|
|
236
|
+
enabled: false
|
|
237
|
+
}];
|
|
238
|
+
function usePopperInteropModifiers(_ref2) {
|
|
239
|
+
var onPositioned = _ref2.onPositioned;
|
|
240
|
+
var onPositionedRef = (0, _react.useRef)(onPositioned);
|
|
241
|
+
var hasPositionedRef = (0, _react.useRef)(false);
|
|
242
|
+
(0, _react.useLayoutEffect)(function () {
|
|
243
|
+
onPositionedRef.current = onPositioned;
|
|
244
|
+
}, [onPositioned]);
|
|
245
|
+
return (0, _react.useMemo)(function () {
|
|
246
|
+
return [].concat(popperInteropModifiers, [{
|
|
247
|
+
name: 'editorLayerFirstPositioned',
|
|
248
|
+
enabled: true,
|
|
249
|
+
// React Popper commits calculated styles in `write`; the legacy callback ran afterwards.
|
|
250
|
+
phase: 'afterWrite',
|
|
251
|
+
fn: function fn() {
|
|
252
|
+
if (hasPositionedRef.current) {
|
|
253
|
+
return;
|
|
254
|
+
}
|
|
255
|
+
hasPositionedRef.current = true;
|
|
256
|
+
onPositionedRef.current();
|
|
257
|
+
}
|
|
258
|
+
}]);
|
|
259
|
+
}, []);
|
|
260
|
+
}
|
|
261
|
+
function PopperInterop(_ref3) {
|
|
262
|
+
var children = _ref3.children,
|
|
263
|
+
content = _ref3.content,
|
|
264
|
+
offset = _ref3.offset,
|
|
265
|
+
onPositioned = _ref3.onPositioned,
|
|
266
|
+
position = _ref3.position,
|
|
267
|
+
strategy = _ref3.strategy;
|
|
268
|
+
var targetRef = (0, _react.useRef)(null);
|
|
269
|
+
var _useState = (0, _react.useState)(null),
|
|
270
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
271
|
+
referenceElement = _useState2[0],
|
|
272
|
+
setReferenceElement = _useState2[1];
|
|
273
|
+
var modifiers = usePopperInteropModifiers({
|
|
274
|
+
onPositioned: onPositioned
|
|
275
|
+
});
|
|
276
|
+
// Popper v2 compares the offset prop by reference, so memoise to avoid re-running positioning every render.
|
|
277
|
+
var parsedOffset = (0, _react.useMemo)(function () {
|
|
278
|
+
return parseOffset({
|
|
279
|
+
offset: offset
|
|
280
|
+
});
|
|
281
|
+
}, [offset]);
|
|
282
|
+
(0, _react.useLayoutEffect)(function () {
|
|
283
|
+
var _targetRef$current;
|
|
284
|
+
var actualTarget = (_targetRef$current = targetRef.current) === null || _targetRef$current === void 0 ? void 0 : _targetRef$current.children[0];
|
|
285
|
+
setReferenceElement(actualTarget instanceof HTMLElement ? actualTarget : null);
|
|
286
|
+
}, [children]);
|
|
287
|
+
return /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("div", {
|
|
288
|
+
ref: targetRef
|
|
289
|
+
}, children), content && referenceElement ? /*#__PURE__*/_react.default.createElement(_popper2.Popper, {
|
|
290
|
+
modifiers: modifiers,
|
|
291
|
+
offset: parsedOffset,
|
|
292
|
+
placement: (0, _helpers.positionPropToPopperPosition)(position),
|
|
293
|
+
referenceElement: referenceElement,
|
|
294
|
+
strategy: strategy
|
|
295
|
+
}, function (_ref4) {
|
|
296
|
+
var ref = _ref4.ref,
|
|
297
|
+
style = _ref4.style;
|
|
298
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
299
|
+
ref: ref,
|
|
300
|
+
style: style
|
|
301
|
+
}, content);
|
|
302
|
+
}) : /*#__PURE__*/_react.default.createElement("div", null));
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
/** Selects the reversible Popper v1 or ADS wrapper implementation. */
|
|
306
|
+
function Layer(_ref5) {
|
|
307
|
+
var _ref5$children = _ref5.children,
|
|
308
|
+
children = _ref5$children === void 0 ? defaultProps.children : _ref5$children,
|
|
309
|
+
_ref5$content = _ref5.content,
|
|
310
|
+
content = _ref5$content === void 0 ? defaultProps.content : _ref5$content,
|
|
311
|
+
_ref5$offset = _ref5.offset,
|
|
312
|
+
offset = _ref5$offset === void 0 ? defaultProps.offset : _ref5$offset,
|
|
313
|
+
_ref5$onPositioned = _ref5.onPositioned,
|
|
314
|
+
onPositioned = _ref5$onPositioned === void 0 ? defaultProps.onPositioned : _ref5$onPositioned,
|
|
315
|
+
_ref5$position = _ref5.position,
|
|
316
|
+
position = _ref5$position === void 0 ? defaultProps.position : _ref5$position;
|
|
317
|
+
if ((0, _platformFeatureFlags.fg)('platform-dst-popper-consolidation')) {
|
|
318
|
+
return /*#__PURE__*/_react.default.createElement(PopperInterop, {
|
|
319
|
+
content: content,
|
|
320
|
+
offset: offset,
|
|
321
|
+
onPositioned: onPositioned,
|
|
322
|
+
position: position,
|
|
323
|
+
strategy: "absolute"
|
|
324
|
+
}, children);
|
|
325
|
+
}
|
|
326
|
+
return /*#__PURE__*/_react.default.createElement(LegacyLayer, {
|
|
327
|
+
content: content,
|
|
328
|
+
offset: offset,
|
|
329
|
+
onPositioned: onPositioned,
|
|
330
|
+
position: position
|
|
331
|
+
}, children);
|
|
332
|
+
}
|
|
@@ -115,50 +115,5 @@ var lightBackgroundPaletteTooltipMessages = exports.lightBackgroundPaletteToolti
|
|
|
115
115
|
id: 'fabric.theme.bold-gray',
|
|
116
116
|
defaultMessage: 'Bold gray',
|
|
117
117
|
description: 'The text is shown as a tooltip label for a color swatch in the editor background color picker when the user hovers over the bold gray color option.'
|
|
118
|
-
},
|
|
119
|
-
'#EFFFD6': {
|
|
120
|
-
id: 'fabric.theme.subtle-lime',
|
|
121
|
-
defaultMessage: 'Subtle lime',
|
|
122
|
-
description: 'The text is shown as a tooltip label for a color swatch in the editor background color picker when the user hovers over the subtle lime color option.'
|
|
123
|
-
},
|
|
124
|
-
'#D3F1A7': {
|
|
125
|
-
id: 'fabric.theme.lime',
|
|
126
|
-
defaultMessage: 'Lime',
|
|
127
|
-
description: 'The text is shown as a tooltip label for a color swatch in the editor background color picker when the user hovers over the lime color option.'
|
|
128
|
-
},
|
|
129
|
-
'#BDE97C': {
|
|
130
|
-
id: 'fabric.theme.bold-lime',
|
|
131
|
-
defaultMessage: 'Bold lime',
|
|
132
|
-
description: 'The text is shown as a tooltip label for a color swatch in the editor background color picker when the user hovers over the bold lime color option.'
|
|
133
|
-
},
|
|
134
|
-
'#FFF5DB': {
|
|
135
|
-
id: 'fabric.theme.subtle-orange',
|
|
136
|
-
defaultMessage: 'Subtle orange',
|
|
137
|
-
description: 'The text is shown as a tooltip label for a color swatch in the editor background color picker when the user hovers over the subtle orange color option.'
|
|
138
|
-
},
|
|
139
|
-
'#FCE4A6': {
|
|
140
|
-
id: 'fabric.theme.orange',
|
|
141
|
-
defaultMessage: 'Orange',
|
|
142
|
-
description: 'The text is shown as a tooltip label for a color swatch in the editor background color picker when the user hovers over the orange color option.'
|
|
143
|
-
},
|
|
144
|
-
'#FBD779': {
|
|
145
|
-
id: 'fabric.theme.bold-orange',
|
|
146
|
-
defaultMessage: 'Bold orange',
|
|
147
|
-
description: 'The text is shown as a tooltip label for a color swatch in the editor background color picker when the user hovers over the bold orange color option.'
|
|
148
|
-
},
|
|
149
|
-
'#FFECF8': {
|
|
150
|
-
id: 'fabric.theme.subtle-magenta',
|
|
151
|
-
defaultMessage: 'Subtle magenta',
|
|
152
|
-
description: 'The text is shown as a tooltip label for a color swatch in the editor background color picker when the user hovers over the subtle magenta color option.'
|
|
153
|
-
},
|
|
154
|
-
'#FDD0EC': {
|
|
155
|
-
id: 'fabric.theme.magenta',
|
|
156
|
-
defaultMessage: 'Magenta',
|
|
157
|
-
description: 'The text is shown as a tooltip label for a color swatch in the editor background color picker when the user hovers over the magenta color option.'
|
|
158
|
-
},
|
|
159
|
-
'#FCB6E1': {
|
|
160
|
-
id: 'fabric.theme.bold-magenta',
|
|
161
|
-
defaultMessage: 'Bold magenta',
|
|
162
|
-
description: 'The text is shown as a tooltip label for a color swatch in the editor background color picker when the user hovers over the bold magenta color option.'
|
|
163
118
|
}
|
|
164
119
|
});
|
|
@@ -156,66 +156,6 @@ var _default_1 = (0, _reactIntl.defineMessages)({
|
|
|
156
156
|
defaultMessage: 'Bold gray',
|
|
157
157
|
description: 'Tooltip label for the bold gray color swatch displayed in the editor toolbar color palette when users select text or highlight colors.'
|
|
158
158
|
},
|
|
159
|
-
'subtle-lime': {
|
|
160
|
-
id: 'fabric.theme.subtle-lime',
|
|
161
|
-
defaultMessage: 'Subtle lime',
|
|
162
|
-
description: 'Tooltip label for the subtle lime color swatch displayed in the editor toolbar color palette when users select text or highlight colors.'
|
|
163
|
-
},
|
|
164
|
-
'bold-lime': {
|
|
165
|
-
id: 'fabric.theme.bold-lime',
|
|
166
|
-
defaultMessage: 'Bold lime',
|
|
167
|
-
description: 'Tooltip label for the bold lime color swatch displayed in the editor toolbar color palette when users select text or highlight colors.'
|
|
168
|
-
},
|
|
169
|
-
'subtle-orange': {
|
|
170
|
-
id: 'fabric.theme.subtle-orange',
|
|
171
|
-
defaultMessage: 'Subtle orange',
|
|
172
|
-
description: 'Tooltip label for the subtle orange color swatch displayed in the editor toolbar color palette when users select text or highlight colors.'
|
|
173
|
-
},
|
|
174
|
-
'bold-orange': {
|
|
175
|
-
id: 'fabric.theme.bold-orange',
|
|
176
|
-
defaultMessage: 'Bold orange',
|
|
177
|
-
description: 'Tooltip label for the bold orange color swatch displayed in the editor toolbar color palette when users select text or highlight colors.'
|
|
178
|
-
},
|
|
179
|
-
'subtle-magenta': {
|
|
180
|
-
id: 'fabric.theme.subtle-magenta',
|
|
181
|
-
defaultMessage: 'Subtle magenta',
|
|
182
|
-
description: 'Tooltip label for the subtle magenta color swatch displayed in the editor toolbar color palette when users select text or highlight colors.'
|
|
183
|
-
},
|
|
184
|
-
'bold-magenta': {
|
|
185
|
-
id: 'fabric.theme.bold-magenta',
|
|
186
|
-
defaultMessage: 'Bold magenta',
|
|
187
|
-
description: 'Tooltip label for the bold magenta color swatch displayed in the editor toolbar color palette when users select text or highlight colors.'
|
|
188
|
-
},
|
|
189
|
-
'bold-blue': {
|
|
190
|
-
id: 'fabric.theme.bold-blue',
|
|
191
|
-
defaultMessage: 'Bold blue',
|
|
192
|
-
description: 'Tooltip label for the bold blue color swatch displayed in the editor toolbar color palette when users select text or highlight colors.'
|
|
193
|
-
},
|
|
194
|
-
'bold-teal': {
|
|
195
|
-
id: 'fabric.theme.bold-teal',
|
|
196
|
-
defaultMessage: 'Bold teal',
|
|
197
|
-
description: 'Tooltip label for the bold teal color swatch displayed in the editor toolbar color palette when users select text or highlight colors.'
|
|
198
|
-
},
|
|
199
|
-
'bold-green': {
|
|
200
|
-
id: 'fabric.theme.bold-green',
|
|
201
|
-
defaultMessage: 'Bold green',
|
|
202
|
-
description: 'Tooltip label for the bold green color swatch displayed in the editor toolbar color palette when users select text or highlight colors.'
|
|
203
|
-
},
|
|
204
|
-
'bold-yellow': {
|
|
205
|
-
id: 'fabric.theme.bold-yellow',
|
|
206
|
-
defaultMessage: 'Bold yellow',
|
|
207
|
-
description: 'Tooltip label for the bold yellow color swatch displayed in the editor toolbar color palette when users select text or highlight colors.'
|
|
208
|
-
},
|
|
209
|
-
'bold-red': {
|
|
210
|
-
id: 'fabric.theme.bold-red',
|
|
211
|
-
defaultMessage: 'Bold red',
|
|
212
|
-
description: 'Tooltip label for the bold red color swatch displayed in the editor toolbar color palette when users select text or highlight colors.'
|
|
213
|
-
},
|
|
214
|
-
'bold-purple': {
|
|
215
|
-
id: 'fabric.theme.bold-purple',
|
|
216
|
-
defaultMessage: 'Bold purple',
|
|
217
|
-
description: 'Tooltip label for the bold purple color swatch displayed in the editor toolbar color palette when users select text or highlight colors.'
|
|
218
|
-
},
|
|
219
159
|
// Colors only used in highlight palette
|
|
220
160
|
'no-color': {
|
|
221
161
|
id: 'fabric.theme.no-color',
|
|
@@ -64,12 +64,6 @@ Object.defineProperty(exports, "cellBackgroundColorPalette", {
|
|
|
64
64
|
return _cellBackgroundColorPalette.default;
|
|
65
65
|
}
|
|
66
66
|
});
|
|
67
|
-
Object.defineProperty(exports, "cellBackgroundColorPaletteNew", {
|
|
68
|
-
enumerable: true,
|
|
69
|
-
get: function get() {
|
|
70
|
-
return _cellBackgroundColorPaletteNew.default;
|
|
71
|
-
}
|
|
72
|
-
});
|
|
73
67
|
Object.defineProperty(exports, "chartsColorPaletteTooltipMessages", {
|
|
74
68
|
enumerable: true,
|
|
75
69
|
get: function get() {
|
|
@@ -181,7 +175,6 @@ var _utils = require("./ColorPalette/utils");
|
|
|
181
175
|
var _getHighlightColorInNonActiveTheme = require("./ColorPalette/getHighlightColorInNonActiveTheme");
|
|
182
176
|
var _getTextColorInNonActiveTheme = require("./ColorPalette/getTextColorInNonActiveTheme");
|
|
183
177
|
var _cellBackgroundColorPalette = _interopRequireDefault(require("./ColorPalette/Palettes/cellBackgroundColorPalette"));
|
|
184
|
-
var _cellBackgroundColorPaletteNew = _interopRequireDefault(require("./ColorPalette/Palettes/cellBackgroundColorPaletteNew"));
|
|
185
178
|
var _paletteMessages = _interopRequireDefault(require("./ColorPalette/Palettes/paletteMessages"));
|
|
186
179
|
var _panelBackgroundPalette = require("./ColorPalette/Palettes/panelBackgroundPalette");
|
|
187
180
|
var _panelBackgroundPaletteNew = require("./ColorPalette/Palettes/panelBackgroundPaletteNew");
|
|
@@ -10,6 +10,8 @@ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/creat
|
|
|
10
10
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
11
|
var _core = require("@popperjs/core");
|
|
12
12
|
var _bindEventListener = require("bind-event-listener");
|
|
13
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
14
|
+
var _unsafeImperative = require("@atlaskit/popper/unsafe-imperative");
|
|
13
15
|
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; }
|
|
14
16
|
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) { (0, _defineProperty2.default)(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; }
|
|
15
17
|
var startingOffset = {
|
|
@@ -24,6 +26,12 @@ var endingOffset = {
|
|
|
24
26
|
offset: [0, 8]
|
|
25
27
|
}
|
|
26
28
|
};
|
|
29
|
+
function getCreatePopper() {
|
|
30
|
+
if ((0, _platformFeatureFlags.fg)('platform-dst-popper-consolidation')) {
|
|
31
|
+
return _unsafeImperative.createPopper;
|
|
32
|
+
}
|
|
33
|
+
return _core.createPopper;
|
|
34
|
+
}
|
|
27
35
|
|
|
28
36
|
/**
|
|
29
37
|
* A tooltip component similar to "@atlaskit/tooltip" but built for vanilla scenarios
|
|
@@ -109,7 +117,7 @@ var VanillaTooltip = exports.VanillaTooltip = /*#__PURE__*/function () {
|
|
|
109
117
|
return (0, _createClass2.default)(VanillaTooltip, [{
|
|
110
118
|
key: "createPopperInstance",
|
|
111
119
|
value: function createPopperInstance() {
|
|
112
|
-
this.popperInstance = (
|
|
120
|
+
this.popperInstance = getCreatePopper()(this.button, this.tooltip, {
|
|
113
121
|
placement: 'top',
|
|
114
122
|
modifiers: [startingOffset]
|
|
115
123
|
});
|