@atlaskit/editor-common 134.7.1 → 134.7.2
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 +22 -0
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/quick-insert/CompactQuickInsertMenuItem.compiled.css +2 -9
- package/dist/cjs/quick-insert/CompactQuickInsertMenuItem.js +6 -6
- package/dist/cjs/quick-insert/ElementBrowserQuickInsertMenuItem.js +76 -103
- package/dist/cjs/quick-insert/QuickInsertHoverPreview.compiled.css +1 -38
- package/dist/cjs/quick-insert/QuickInsertHoverPreview.js +9 -93
- package/dist/cjs/quick-insert/QuickInsertMenuItem.js +2 -1
- package/dist/cjs/quick-insert/QuickInsertPreviewContent.compiled.css +38 -0
- package/dist/cjs/quick-insert/QuickInsertPreviewContent.js +142 -0
- package/dist/cjs/quick-insert/QuickInsertShortcut.compiled.css +10 -0
- package/dist/cjs/quick-insert/QuickInsertShortcut.js +28 -0
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/cjs/ui/Layer/index.js +14 -208
- package/dist/cjs/vanilla-tooltip/index.js +5 -14
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/quick-insert/CompactQuickInsertMenuItem.compiled.css +2 -9
- package/dist/es2019/quick-insert/CompactQuickInsertMenuItem.js +6 -6
- package/dist/es2019/quick-insert/ElementBrowserQuickInsertMenuItem.js +74 -101
- package/dist/es2019/quick-insert/QuickInsertHoverPreview.compiled.css +1 -38
- package/dist/es2019/quick-insert/QuickInsertHoverPreview.js +10 -86
- package/dist/es2019/quick-insert/QuickInsertMenuItem.js +2 -1
- package/dist/es2019/quick-insert/QuickInsertPreviewContent.compiled.css +38 -0
- package/dist/es2019/quick-insert/QuickInsertPreviewContent.js +126 -0
- package/dist/es2019/quick-insert/QuickInsertShortcut.compiled.css +10 -0
- package/dist/es2019/quick-insert/QuickInsertShortcut.js +19 -0
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/es2019/ui/Layer/index.js +15 -192
- package/dist/es2019/vanilla-tooltip/index.js +7 -15
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/quick-insert/CompactQuickInsertMenuItem.compiled.css +2 -9
- package/dist/esm/quick-insert/CompactQuickInsertMenuItem.js +6 -6
- package/dist/esm/quick-insert/ElementBrowserQuickInsertMenuItem.js +77 -104
- package/dist/esm/quick-insert/QuickInsertHoverPreview.compiled.css +1 -38
- package/dist/esm/quick-insert/QuickInsertHoverPreview.js +10 -93
- package/dist/esm/quick-insert/QuickInsertMenuItem.js +2 -1
- package/dist/esm/quick-insert/QuickInsertPreviewContent.compiled.css +38 -0
- package/dist/esm/quick-insert/QuickInsertPreviewContent.js +135 -0
- package/dist/esm/quick-insert/QuickInsertShortcut.compiled.css +10 -0
- package/dist/esm/quick-insert/QuickInsertShortcut.js +21 -0
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/esm/ui/Layer/index.js +15 -211
- package/dist/esm/vanilla-tooltip/index.js +7 -15
- package/dist/types/quick-insert/ElementBrowserQuickInsertMenuItem.d.ts +7 -1
- package/dist/types/quick-insert/QuickInsertHoverPreview.d.ts +0 -1
- package/dist/types/quick-insert/QuickInsertPreviewContent.d.ts +24 -0
- package/dist/types/quick-insert/QuickInsertShortcut.d.ts +13 -0
- package/dist/types/ui/Layer/index.d.ts +1 -15
- package/dist/types/vanilla-tooltip/index.d.ts +1 -1
- package/package.json +2 -7
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
/* QuickInsertPreviewContent.tsx generated by @compiled/babel-plugin v3.0.2 */
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
5
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
+
Object.defineProperty(exports, "__esModule", {
|
|
7
|
+
value: true
|
|
8
|
+
});
|
|
9
|
+
exports.QuickInsertPreviewContent = void 0;
|
|
10
|
+
require("./QuickInsertPreviewContent.compiled.css");
|
|
11
|
+
var _runtime = require("@compiled/react/runtime");
|
|
12
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
13
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
14
|
+
var _reactIntl = require("react-intl");
|
|
15
|
+
var _box = require("@atlaskit/primitives/compiled/box");
|
|
16
|
+
var _inline = require("@atlaskit/primitives/compiled/inline");
|
|
17
|
+
var _text = require("@atlaskit/primitives/compiled/text");
|
|
18
|
+
var _useThemeObserver2 = require("@atlaskit/tokens/use-theme-observer");
|
|
19
|
+
var _messages = require("./messages");
|
|
20
|
+
var _QuickInsertShortcut = require("./QuickInsertShortcut");
|
|
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" != _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); }
|
|
22
|
+
// Multiline clamping requires styles outside @atlaskit/css's schema.
|
|
23
|
+
var layoutStyles = {
|
|
24
|
+
titleRow: "_1ul9idpf",
|
|
25
|
+
titleIcon: "_4cvr1h6o _1e0c1txw _1o9zidpf _1bah1h6o",
|
|
26
|
+
attributionText: "_16jlkb7n _1o9zkb7n _i0dl1wug _1ul9idpf _1i4qfg65"
|
|
27
|
+
};
|
|
28
|
+
var styles = {
|
|
29
|
+
root: "_1e0c1txw _2lx21bp4 _16jlkb7n _1ul9idpf",
|
|
30
|
+
content: "_zulpu2gc _1e0c1txw _2lx21bp4 _16jlkb7n",
|
|
31
|
+
title: "_11c81qyo _16jlidpf _1o9zkb7n _i0dl1wug _syazazsu _1ul9idpf _1i4qfg65",
|
|
32
|
+
clampedTitle: "_1reo15vq _18m915vq _1e0ccj1k _sudp1e54 _1yyjcs5v",
|
|
33
|
+
description: "_11c8fhey _1reo15vq _18m915vq _syazi7uo _1e0ccj1k _1i4qfg65 _sudp1e54 _1yyjegat",
|
|
34
|
+
unclampedDescription: "_11c8fhey _syazi7uo _1i4qfg65",
|
|
35
|
+
disabledText: "_syaz1gmx",
|
|
36
|
+
imageArea: "_2rko12b0 _1reo15vq _18m915vq _bfhkhfxm _4t3i68cl _6rthu2gc _1bsb1osq",
|
|
37
|
+
image: "_1e0c1ule _4t3i1osq _5ral1f51 _1bsb1osq",
|
|
38
|
+
imageHidden: "_3um015vq",
|
|
39
|
+
attribution: "_zulp1b66 _4cvr1h6o _syazazsu _1e0c1txw _1pfh1wug _1i4qfg65",
|
|
40
|
+
compactAttribution: "_11c8wadc",
|
|
41
|
+
attributionIcon: "_16jlidpf _1o9zidpf _i0dlexct _4cvr1h6o _1e0c1txw _4t3i7vkz _1bah1h6o _1bsb7vkz"
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* The image, title, description, and attribution shared by the Quick Insert hover preview and
|
|
46
|
+
* Element Browser tiles. It fills its container; callers own its width and accessible name.
|
|
47
|
+
*/
|
|
48
|
+
var QuickInsertPreviewContent = exports.QuickInsertPreviewContent = function QuickInsertPreviewContent(_ref) {
|
|
49
|
+
var _preview$attribution, _preview$attribution2;
|
|
50
|
+
var description = _ref.description,
|
|
51
|
+
icon = _ref.icon,
|
|
52
|
+
id = _ref.id,
|
|
53
|
+
_ref$isDisabled = _ref.isDisabled,
|
|
54
|
+
isDisabled = _ref$isDisabled === void 0 ? false : _ref$isDisabled,
|
|
55
|
+
lozenge = _ref.lozenge,
|
|
56
|
+
preview = _ref.preview,
|
|
57
|
+
shortcut = _ref.shortcut,
|
|
58
|
+
_ref$shouldClampText = _ref.shouldClampText,
|
|
59
|
+
shouldClampText = _ref$shouldClampText === void 0 ? true : _ref$shouldClampText,
|
|
60
|
+
title = _ref.title;
|
|
61
|
+
var _useIntl = (0, _reactIntl.useIntl)(),
|
|
62
|
+
formatMessage = _useIntl.formatMessage;
|
|
63
|
+
var _useThemeObserver = (0, _useThemeObserver2.useThemeObserver)(),
|
|
64
|
+
colorMode = _useThemeObserver.colorMode;
|
|
65
|
+
var imageUrl = preview.image ? colorMode === 'dark' && preview.image.dark ? preview.image.dark : preview.image.light : undefined;
|
|
66
|
+
var AttributionIcon = (_preview$attribution = preview.attribution) === null || _preview$attribution === void 0 ? void 0 : _preview$attribution.icon;
|
|
67
|
+
var attributionName = (_preview$attribution2 = preview.attribution) === null || _preview$attribution2 === void 0 ? void 0 : _preview$attribution2.name;
|
|
68
|
+
var formattedAttributionName = typeof attributionName === 'string' ? attributionName : attributionName ? formatMessage(attributionName) : '';
|
|
69
|
+
var titleRow = /*#__PURE__*/_react.default.createElement(_inline.Inline, {
|
|
70
|
+
alignBlock: "center",
|
|
71
|
+
space: "space.100",
|
|
72
|
+
xcss: layoutStyles.titleRow
|
|
73
|
+
}, icon && /*#__PURE__*/_react.default.createElement(_box.Box, {
|
|
74
|
+
as: "span",
|
|
75
|
+
"aria-hidden": "true",
|
|
76
|
+
xcss: layoutStyles.titleIcon
|
|
77
|
+
}, icon), /*#__PURE__*/_react.default.createElement("span", {
|
|
78
|
+
"aria-hidden": "true",
|
|
79
|
+
className: (0, _runtime.ax)([styles.title, shouldClampText && styles.clampedTitle, isDisabled && styles.disabledText])
|
|
80
|
+
}, title), lozenge);
|
|
81
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
82
|
+
id: id,
|
|
83
|
+
className: (0, _runtime.ax)([styles.root])
|
|
84
|
+
}, imageUrl && /*#__PURE__*/_react.default.createElement(PreviewImage, {
|
|
85
|
+
key: imageUrl,
|
|
86
|
+
imageUrl: imageUrl
|
|
87
|
+
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
88
|
+
className: (0, _runtime.ax)([styles.content])
|
|
89
|
+
}, shortcut ? /*#__PURE__*/_react.default.createElement(_inline.Inline, {
|
|
90
|
+
alignBlock: "start",
|
|
91
|
+
space: "space.100",
|
|
92
|
+
spread: "space-between"
|
|
93
|
+
}, titleRow, /*#__PURE__*/_react.default.createElement(_QuickInsertShortcut.QuickInsertShortcut, {
|
|
94
|
+
isDisabled: isDisabled,
|
|
95
|
+
shortcut: shortcut
|
|
96
|
+
})) : titleRow, description && /*#__PURE__*/_react.default.createElement("div", {
|
|
97
|
+
className: (0, _runtime.ax)([shouldClampText && styles.description, !shouldClampText && styles.unclampedDescription, isDisabled && styles.disabledText])
|
|
98
|
+
}, description), preview.attribution && /*#__PURE__*/_react.default.createElement("div", {
|
|
99
|
+
className: (0, _runtime.ax)([styles.attribution, shouldClampText && styles.compactAttribution, isDisabled && styles.disabledText])
|
|
100
|
+
}, AttributionIcon && /*#__PURE__*/_react.default.createElement("span", {
|
|
101
|
+
"aria-hidden": "true",
|
|
102
|
+
className: (0, _runtime.ax)([styles.attributionIcon])
|
|
103
|
+
}, /*#__PURE__*/_react.default.createElement(AttributionIcon, null)), /*#__PURE__*/_react.default.createElement("span", {
|
|
104
|
+
className: (0, _runtime.ax)([layoutStyles.attributionText])
|
|
105
|
+
}, /*#__PURE__*/_react.default.createElement(_text.Text, {
|
|
106
|
+
size: "small",
|
|
107
|
+
color: isDisabled ? 'color.text.disabled' : 'color.text.subtle'
|
|
108
|
+
}, AttributionIcon ? formattedAttributionName : formatMessage(_messages.messages.previewAttributionBy, {
|
|
109
|
+
name: formattedAttributionName
|
|
110
|
+
}))))));
|
|
111
|
+
};
|
|
112
|
+
var PreviewImage = function PreviewImage(_ref2) {
|
|
113
|
+
var imageUrl = _ref2.imageUrl;
|
|
114
|
+
var _useState = (0, _react.useState)(false),
|
|
115
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
116
|
+
hasFailed = _useState2[0],
|
|
117
|
+
setHasFailed = _useState2[1];
|
|
118
|
+
var _useState3 = (0, _react.useState)(false),
|
|
119
|
+
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
120
|
+
hasLoaded = _useState4[0],
|
|
121
|
+
setHasLoaded = _useState4[1];
|
|
122
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
123
|
+
"aria-hidden": "true",
|
|
124
|
+
"data-testid": "quick-insert-preview-image-area",
|
|
125
|
+
className: (0, _runtime.ax)([styles.imageArea])
|
|
126
|
+
}, !hasFailed && /*#__PURE__*/_react.default.createElement("img", {
|
|
127
|
+
"aria-hidden": "true",
|
|
128
|
+
"data-testid": "quick-insert-hover-preview"
|
|
129
|
+
// Element Browser tiles below the fold load as they scroll into view.
|
|
130
|
+
,
|
|
131
|
+
loading: "lazy",
|
|
132
|
+
src: imageUrl,
|
|
133
|
+
alt: "",
|
|
134
|
+
onLoad: function onLoad() {
|
|
135
|
+
return setHasLoaded(true);
|
|
136
|
+
},
|
|
137
|
+
onError: function onError() {
|
|
138
|
+
return setHasFailed(true);
|
|
139
|
+
},
|
|
140
|
+
className: (0, _runtime.ax)([styles.image, !hasLoaded && styles.imageHidden])
|
|
141
|
+
}));
|
|
142
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
._11c8wadc{font:var(--ds-font-body-small,normal 400 9pt/1pc "Atlassian Sans",ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif)}
|
|
2
|
+
._2rko12b0{border-radius:var(--ds-radius-small,4px)}
|
|
3
|
+
._18zr1b66{padding-inline:var(--ds-space-050,4px)}
|
|
4
|
+
._1rjcv77o{padding-block:var(--ds-space-025,2px)}
|
|
5
|
+
._1o9zidpf{flex-shrink:0}
|
|
6
|
+
._bfhk187o{background-color:var(--ds-background-disabled,#0515240f)}
|
|
7
|
+
._bfhki8nm{background-color:var(--ds-background-neutral,#0515240f)}
|
|
8
|
+
._o5721q9c{white-space:nowrap}
|
|
9
|
+
._syaz1gmx{color:var(--ds-text-disabled,#080f214a)}
|
|
10
|
+
._syazazsu{color:var(--ds-text-subtle,#505258)}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/* QuickInsertShortcut.tsx generated by @compiled/babel-plugin v3.0.2 */
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.QuickInsertShortcut = void 0;
|
|
9
|
+
require("./QuickInsertShortcut.compiled.css");
|
|
10
|
+
var _runtime = require("@compiled/react/runtime");
|
|
11
|
+
var _react = _interopRequireDefault(require("react"));
|
|
12
|
+
var styles = {
|
|
13
|
+
shortcut: "_2rko12b0 _11c8wadc _1rjcv77o _18zr1b66 _bfhki8nm _syazazsu _1o9zidpf _o5721q9c",
|
|
14
|
+
disabled: "_bfhk187o _syaz1gmx"
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* The keyboard or markdown shortcut chip shown beside a Quick Insert item's title, in both the
|
|
19
|
+
* slash-menu row and the Element Browser tile.
|
|
20
|
+
*/
|
|
21
|
+
var QuickInsertShortcut = exports.QuickInsertShortcut = function QuickInsertShortcut(_ref) {
|
|
22
|
+
var _ref$isDisabled = _ref.isDisabled,
|
|
23
|
+
isDisabled = _ref$isDisabled === void 0 ? false : _ref$isDisabled,
|
|
24
|
+
shortcut = _ref.shortcut;
|
|
25
|
+
return /*#__PURE__*/_react.default.createElement("span", {
|
|
26
|
+
className: (0, _runtime.ax)([styles.shortcut, isDisabled && styles.disabled])
|
|
27
|
+
}, shortcut);
|
|
28
|
+
};
|
|
@@ -23,7 +23,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
|
|
|
23
23
|
* @jsx jsx
|
|
24
24
|
*/ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
25
25
|
var packageName = "@atlaskit/editor-common";
|
|
26
|
-
var packageVersion = "134.7.
|
|
26
|
+
var packageVersion = "134.7.1";
|
|
27
27
|
var halfFocusRing = 1;
|
|
28
28
|
var dropOffset = '0, 8';
|
|
29
29
|
// Ignored via go/ees005
|
|
@@ -7,40 +7,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
});
|
|
8
8
|
exports.default = Layer;
|
|
9
9
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
10
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
11
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
12
|
-
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
13
|
-
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
14
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
15
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
16
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
17
|
-
var _popper = _interopRequireDefault(require("popper.js"));
|
|
18
|
-
var _rafSchd = _interopRequireDefault(require("raf-schd"));
|
|
19
11
|
var _fg = require("@atlaskit/platform-feature-flags/fg");
|
|
20
12
|
var _main = require("@atlaskit/popper/main");
|
|
13
|
+
var _manager = require("@atlaskit/popper/manager");
|
|
21
14
|
var _helpers = require("./internal/helpers");
|
|
22
15
|
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); }
|
|
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; }
|
|
24
|
-
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; }
|
|
25
|
-
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
|
|
26
|
-
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } // eslint-disable-next-line @atlaskit/design-system/no-third-party-layering -- existing usage from before this rule was added
|
|
27
|
-
// eslint-disable-next-line @atlaskit/design-system/no-third-party-layering -- existing usage from before this rule was added
|
|
28
|
-
// eslint-disable-line import/extensions
|
|
29
|
-
var defaultState = {
|
|
30
|
-
hasExtractedStyles: false,
|
|
31
|
-
// We set these default offsets to prevent a flash of popper content in the wrong position
|
|
32
|
-
// which can cause incorrect height calculations. Popper will calculate these values
|
|
33
|
-
offsets: {
|
|
34
|
-
popper: {
|
|
35
|
-
left: -9999,
|
|
36
|
-
top: -9999,
|
|
37
|
-
position: null
|
|
38
|
-
}
|
|
39
|
-
},
|
|
40
|
-
cssPosition: 'absolute',
|
|
41
|
-
originalHeight: null,
|
|
42
|
-
maxHeight: null
|
|
43
|
-
};
|
|
44
16
|
function defaultOnPositioned() {}
|
|
45
17
|
var defaultProps = {
|
|
46
18
|
boundariesElement: 'viewport',
|
|
@@ -53,170 +25,6 @@ var defaultProps = {
|
|
|
53
25
|
isAlwaysFixed: false,
|
|
54
26
|
onPositioned: defaultOnPositioned
|
|
55
27
|
};
|
|
56
|
-
|
|
57
|
-
// Ignored via go/ees005
|
|
58
|
-
// eslint-disable-next-line @repo/internal/react/no-class-components
|
|
59
|
-
var LegacyLayer = /*#__PURE__*/function (_Component) {
|
|
60
|
-
function LegacyLayer(props) {
|
|
61
|
-
var _this;
|
|
62
|
-
(0, _classCallCheck2.default)(this, LegacyLayer);
|
|
63
|
-
_this = _callSuper(this, LegacyLayer, [props]);
|
|
64
|
-
(0, _defineProperty2.default)(_this, "targetRef", /*#__PURE__*/_react.default.createRef());
|
|
65
|
-
(0, _defineProperty2.default)(_this, "contentRef", /*#__PURE__*/_react.default.createRef());
|
|
66
|
-
(0, _defineProperty2.default)(_this, "extractStyles", function (state) {
|
|
67
|
-
if (state) {
|
|
68
|
-
var popperHeight = state.offsets.popper.height;
|
|
69
|
-
var left = Math.round(state.offsets.popper.left);
|
|
70
|
-
var top = Math.round(state.offsets.popper.top);
|
|
71
|
-
var cssPosition = 'absolute';
|
|
72
|
-
var originalHeight = _this.state.originalHeight || popperHeight;
|
|
73
|
-
var maxHeight = _this.calculateMaxHeight(originalHeight, popperHeight, top, cssPosition);
|
|
74
|
-
_this.setState({
|
|
75
|
-
// position: fixed or absolute
|
|
76
|
-
cssPosition: cssPosition,
|
|
77
|
-
hasExtractedStyles: true,
|
|
78
|
-
transform: "translate3d(".concat(left, "px, ").concat(top, "px, 0px)"),
|
|
79
|
-
originalHeight: originalHeight,
|
|
80
|
-
maxHeight: maxHeight
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
});
|
|
84
|
-
_this.state = defaultState;
|
|
85
|
-
_this.extractStyles = (0, _rafSchd.default)(_this.extractStyles.bind(_this));
|
|
86
|
-
return _this;
|
|
87
|
-
}
|
|
88
|
-
(0, _inherits2.default)(LegacyLayer, _Component);
|
|
89
|
-
return (0, _createClass2.default)(LegacyLayer, [{
|
|
90
|
-
key: "componentDidMount",
|
|
91
|
-
value: function componentDidMount() {
|
|
92
|
-
this.applyPopper(this.props);
|
|
93
|
-
}
|
|
94
|
-
}, {
|
|
95
|
-
key: "componentDidUpdate",
|
|
96
|
-
value: function componentDidUpdate(prevProps, prevState) {
|
|
97
|
-
var onPositioned = this.props.onPositioned;
|
|
98
|
-
var hasExtractedStyles = this.state.hasExtractedStyles;
|
|
99
|
-
if (this.props !== prevProps) {
|
|
100
|
-
this.applyPopper(this.props);
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
// This flag is set the first time the position is calculated from Popper and applied to the content
|
|
104
|
-
if (!prevState.hasExtractedStyles && hasExtractedStyles && onPositioned) {
|
|
105
|
-
onPositioned();
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
}, {
|
|
109
|
-
key: "componentWillUnmount",
|
|
110
|
-
value: function componentWillUnmount() {
|
|
111
|
-
// this.extractStyles.cancel();
|
|
112
|
-
if (this.popper) {
|
|
113
|
-
this.popper.destroy();
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
/* Calculate the max height of the popper if it's height is greater than the viewport to prevent
|
|
118
|
-
* the bottom of the popper not being viewable.
|
|
119
|
-
* Only works if the popper uses viewport as the boundary and has a fixed position ancestor.
|
|
120
|
-
*/
|
|
121
|
-
}, {
|
|
122
|
-
key: "calculateMaxHeight",
|
|
123
|
-
value: function calculateMaxHeight(originalHeight, currentHeight, positionTop, cssPosition) {
|
|
124
|
-
var DocumentElementClientHeight = 0;
|
|
125
|
-
if (document.documentElement) {
|
|
126
|
-
DocumentElementClientHeight = document.documentElement.clientHeight;
|
|
127
|
-
}
|
|
128
|
-
if (cssPosition !== 'fixed') {
|
|
129
|
-
return null;
|
|
130
|
-
}
|
|
131
|
-
var viewportHeight = Math.max(DocumentElementClientHeight, window.innerHeight || 0);
|
|
132
|
-
return viewportHeight < originalHeight && currentHeight + positionTop >= viewportHeight - 50 ?
|
|
133
|
-
// allow some spacing either side of viewport height
|
|
134
|
-
viewportHeight - 12 : null;
|
|
135
|
-
}
|
|
136
|
-
}, {
|
|
137
|
-
key: "applyPopper",
|
|
138
|
-
value: function applyPopper(props) {
|
|
139
|
-
if (!this.targetRef.current || !this.contentRef.current) {
|
|
140
|
-
return;
|
|
141
|
-
}
|
|
142
|
-
if (this.popper) {
|
|
143
|
-
this.popper.destroy();
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
// "new Popper(...)" operation is very expensive when called on virtual DOM.
|
|
147
|
-
// This condition reduces the number of calls so we can run our tests faster
|
|
148
|
-
// (time was reduced from 100s to 13s).
|
|
149
|
-
if (!props.content) {
|
|
150
|
-
return;
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
// we wrap our target in a div so that we can safely get a reference to it, but we pass the
|
|
154
|
-
// actual target to popper
|
|
155
|
-
var isAlwaysFixed = false;
|
|
156
|
-
var actualTarget = this.targetRef.current.children[0];
|
|
157
|
-
var popperOpts = {
|
|
158
|
-
placement: (0, _helpers.positionPropToPopperPosition)(props.position),
|
|
159
|
-
onCreate: this.extractStyles,
|
|
160
|
-
onUpdate: this.extractStyles,
|
|
161
|
-
modifiers: {
|
|
162
|
-
applyStyle: {
|
|
163
|
-
enabled: false
|
|
164
|
-
},
|
|
165
|
-
hide: {
|
|
166
|
-
enabled: false
|
|
167
|
-
},
|
|
168
|
-
offset: {
|
|
169
|
-
enabled: true,
|
|
170
|
-
offset: this.props.offset
|
|
171
|
-
},
|
|
172
|
-
flip: {
|
|
173
|
-
enabled: false,
|
|
174
|
-
flipVariations: true,
|
|
175
|
-
boundariesElement: 'viewport',
|
|
176
|
-
padding: 0 // leave 0 pixels between popper and the boundariesElement
|
|
177
|
-
},
|
|
178
|
-
preventOverflow: {
|
|
179
|
-
enabled: false,
|
|
180
|
-
escapeWithReference: true
|
|
181
|
-
}
|
|
182
|
-
},
|
|
183
|
-
positionFixed: isAlwaysFixed
|
|
184
|
-
};
|
|
185
|
-
if (actualTarget) {
|
|
186
|
-
this.popper = new _popper.default(actualTarget, this.contentRef.current, popperOpts);
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
}, {
|
|
190
|
-
key: "render",
|
|
191
|
-
value: function render() {
|
|
192
|
-
var _this$state = this.state,
|
|
193
|
-
transform = _this$state.transform,
|
|
194
|
-
hasExtractedStyles = _this$state.hasExtractedStyles,
|
|
195
|
-
maxHeight = _this$state.maxHeight;
|
|
196
|
-
var opacity = hasExtractedStyles ? {} : {
|
|
197
|
-
opacity: 0
|
|
198
|
-
};
|
|
199
|
-
return /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("div", {
|
|
200
|
-
ref: this.targetRef
|
|
201
|
-
}, this.props.children), /*#__PURE__*/_react.default.createElement("div", {
|
|
202
|
-
ref: this.contentRef,
|
|
203
|
-
style: _objectSpread({
|
|
204
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
205
|
-
top: 0,
|
|
206
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
207
|
-
left: 0,
|
|
208
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
209
|
-
position: 'absolute',
|
|
210
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
211
|
-
transform: transform,
|
|
212
|
-
maxHeight: maxHeight ? maxHeight : 'auto'
|
|
213
|
-
}, opacity)
|
|
214
|
-
}, this.props.content));
|
|
215
|
-
}
|
|
216
|
-
}]);
|
|
217
|
-
}(_react.Component);
|
|
218
|
-
// working with extract-react-types
|
|
219
|
-
(0, _defineProperty2.default)(LegacyLayer, "defaultProps", defaultProps);
|
|
220
28
|
function parseOffset(_ref) {
|
|
221
29
|
var offset = _ref.offset;
|
|
222
30
|
var _offset$split = offset.split(','),
|
|
@@ -301,11 +109,17 @@ function PopperInterop(_ref3) {
|
|
|
301
109
|
}, [children]);
|
|
302
110
|
return /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("div", {
|
|
303
111
|
ref: targetRef
|
|
304
|
-
}, children), content
|
|
112
|
+
}, children), content ?
|
|
113
|
+
/*#__PURE__*/
|
|
114
|
+
// Mount `content` in the same commit as the Layer, before `referenceElement` resolves.
|
|
115
|
+
// Callers act on the content DOM in that commit: DropList focuses it, and menus
|
|
116
|
+
// dispatch `ArrowDown` to focus their first item. The `Manager` stops Popper from
|
|
117
|
+
// using an ancestor `Manager`'s reference until `referenceElement` is set.
|
|
118
|
+
_react.default.createElement(_manager.Manager, null, /*#__PURE__*/_react.default.createElement(_main.Popper, {
|
|
305
119
|
modifiers: modifiers,
|
|
306
120
|
offset: parsedOffset,
|
|
307
121
|
placement: (0, _helpers.positionPropToPopperPosition)(position),
|
|
308
|
-
referenceElement: referenceElement,
|
|
122
|
+
referenceElement: referenceElement !== null && referenceElement !== void 0 ? referenceElement : undefined,
|
|
309
123
|
strategy: strategy
|
|
310
124
|
}, function (_ref4) {
|
|
311
125
|
var ref = _ref4.ref,
|
|
@@ -314,10 +128,10 @@ function PopperInterop(_ref3) {
|
|
|
314
128
|
ref: ref,
|
|
315
129
|
style: style
|
|
316
130
|
}, content);
|
|
317
|
-
}) : /*#__PURE__*/_react.default.createElement("div", null));
|
|
131
|
+
})) : /*#__PURE__*/_react.default.createElement("div", null));
|
|
318
132
|
}
|
|
319
133
|
|
|
320
|
-
/**
|
|
134
|
+
/** Positions `content` next to `children` with the ADS Popper wrapper. */
|
|
321
135
|
function Layer(_ref5) {
|
|
322
136
|
var _ref5$children = _ref5.children,
|
|
323
137
|
children = _ref5$children === void 0 ? defaultProps.children : _ref5$children,
|
|
@@ -329,19 +143,11 @@ function Layer(_ref5) {
|
|
|
329
143
|
onPositioned = _ref5$onPositioned === void 0 ? defaultProps.onPositioned : _ref5$onPositioned,
|
|
330
144
|
_ref5$position = _ref5.position,
|
|
331
145
|
position = _ref5$position === void 0 ? defaultProps.position : _ref5$position;
|
|
332
|
-
|
|
333
|
-
return /*#__PURE__*/_react.default.createElement(PopperInterop, {
|
|
334
|
-
content: content,
|
|
335
|
-
offset: offset,
|
|
336
|
-
onPositioned: onPositioned,
|
|
337
|
-
position: position,
|
|
338
|
-
strategy: "absolute"
|
|
339
|
-
}, children);
|
|
340
|
-
}
|
|
341
|
-
return /*#__PURE__*/_react.default.createElement(LegacyLayer, {
|
|
146
|
+
return /*#__PURE__*/_react.default.createElement(PopperInterop, {
|
|
342
147
|
content: content,
|
|
343
148
|
offset: offset,
|
|
344
149
|
onPositioned: onPositioned,
|
|
345
|
-
position: position
|
|
150
|
+
position: position,
|
|
151
|
+
strategy: "absolute"
|
|
346
152
|
}, children);
|
|
347
153
|
}
|
|
@@ -8,10 +8,8 @@ exports.VanillaTooltip = exports.VANILLA_TOOLTIP_DEFAULT_CLASS = void 0;
|
|
|
8
8
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
9
9
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
10
10
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
-
var _core = require("@popperjs/core");
|
|
12
11
|
var _bindEventListener = require("bind-event-listener");
|
|
13
12
|
var _isExperimentEnabled = require("@atlaskit/platform-feature-experiments/is-experiment-enabled");
|
|
14
|
-
var _fg = require("@atlaskit/platform-feature-flags/fg");
|
|
15
13
|
var _unsafeImperative = require("@atlaskit/popper/unsafe-imperative");
|
|
16
14
|
var _error = require("../monitoring/error");
|
|
17
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; }
|
|
@@ -54,12 +52,6 @@ var generateTooltipId = function () {
|
|
|
54
52
|
return typeof crypto !== 'undefined' && typeof crypto.randomUUID === 'function' ? "".concat(TOOLTIP_ID_PREFIX, "-").concat(crypto.randomUUID()) : "".concat(TOOLTIP_ID_PREFIX, "-").concat(count += 1);
|
|
55
53
|
};
|
|
56
54
|
}();
|
|
57
|
-
function getCreatePopper() {
|
|
58
|
-
if ((0, _fg.fg)('platform-dst-popper-consolidation')) {
|
|
59
|
-
return _unsafeImperative.createPopper;
|
|
60
|
-
}
|
|
61
|
-
return _core.createPopper;
|
|
62
|
-
}
|
|
63
55
|
|
|
64
56
|
/**
|
|
65
57
|
* A tooltip component similar to "@atlaskit/tooltip" but built for vanilla scenarios
|
|
@@ -287,7 +279,7 @@ var VanillaTooltip = exports.VanillaTooltip = /*#__PURE__*/function () {
|
|
|
287
279
|
}, {
|
|
288
280
|
key: "createPopperInstance",
|
|
289
281
|
value: function createPopperInstance() {
|
|
290
|
-
this.popperInstance =
|
|
282
|
+
this.popperInstance = (0, _unsafeImperative.createPopper)(this.trigger, this.tooltip, {
|
|
291
283
|
placement: this.placement,
|
|
292
284
|
modifiers: [startingOffset]
|
|
293
285
|
});
|
|
@@ -376,13 +368,12 @@ var VanillaTooltip = exports.VanillaTooltip = /*#__PURE__*/function () {
|
|
|
376
368
|
var _this3$popperInstance;
|
|
377
369
|
// Released rather than reconfigured. The instance was previously kept for the
|
|
378
370
|
// trigger's whole lifetime, so every element the pointer passed over retained
|
|
379
|
-
// one — and
|
|
380
|
-
//
|
|
371
|
+
// one — and an instance owns a detached React root, so that was a retained
|
|
372
|
+
// root per hovered trigger.
|
|
381
373
|
//
|
|
382
374
|
// Destroying is also the only way to release that root's capture-phase
|
|
383
|
-
// `scroll`/`resize` listeners
|
|
384
|
-
//
|
|
385
|
-
// does nothing.
|
|
375
|
+
// `scroll`/`resize` listeners, where the `eventListeners: false`
|
|
376
|
+
// reconfiguration in the control arm is accepted but does nothing.
|
|
386
377
|
(_this3$popperInstance = _this3.popperInstance) === null || _this3$popperInstance === void 0 || _this3$popperInstance.destroy();
|
|
387
378
|
_this3.popperInstance = undefined;
|
|
388
379
|
_this3.tooltip.style.opacity = '0';
|
|
@@ -13,7 +13,7 @@ const NETWORK_FAILURE_REGEX = /^network failure/i;
|
|
|
13
13
|
const RESIZE_OBSERVER_LOOP_REGEX = /ResizeObserver loop completed with undelivered notifications/;
|
|
14
14
|
const SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
15
15
|
const packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
16
|
-
const packageVersion = "134.7.
|
|
16
|
+
const packageVersion = "134.7.1";
|
|
17
17
|
const sanitiseSentryEvents = (data, _hint) => {
|
|
18
18
|
// Remove URL as it has UGC
|
|
19
19
|
// Ignored via go/ees007
|
|
@@ -1,12 +1,7 @@
|
|
|
1
|
-
._11c8wadc{font:var(--ds-font-body-small,normal 400 9pt/1pc "Atlassian Sans",ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif)}
|
|
2
|
-
._2rko12b0{border-radius:var(--ds-radius-small,4px)}
|
|
3
1
|
._2rko1mok{border-radius:var(--ds-radius-large,8px)}
|
|
4
2
|
._189ee4h9{border-width:var(--ds-border-width,1px)}
|
|
5
|
-
._18zr1b66{padding-inline:var(--ds-space-050,4px)}
|
|
6
3
|
._1dqonqa1{border-style:solid}
|
|
7
|
-
._1h6d1l7x{border-color:var(--ds-border,#0b120e24)}
|
|
8
|
-
._1rjcv77o{padding-block:var(--ds-space-025,2px)}
|
|
9
|
-
._16jlkb7n{flex-grow:1}
|
|
4
|
+
._1h6d1l7x{border-color:var(--ds-border,#0b120e24)}._16jlkb7n{flex-grow:1}
|
|
10
5
|
._18m915vq{overflow-y:hidden}
|
|
11
6
|
._1bah1h6o{justify-content:center}
|
|
12
7
|
._1bsbzwfg{width:2pc}
|
|
@@ -21,8 +16,6 @@
|
|
|
21
16
|
._4cvr1h6o{align-items:center}
|
|
22
17
|
._4t3izwfg{height:2pc}
|
|
23
18
|
._bfhk1bhr{background-color:var(--ds-surface-overlay,#fff)}
|
|
24
|
-
._bfhki8nm{background-color:var(--ds-background-neutral,#0515240f)}
|
|
25
19
|
._i0dlidpf{flex-basis:0}
|
|
26
20
|
._rpzpjdj5 [style*="--ds-icon-accent-gray"]{color:inherit!important}
|
|
27
|
-
._syaz1q3r{color:var(--ds-icon,#292a2e)}
|
|
28
|
-
._syazazsu{color:var(--ds-text-subtle,#505258)}
|
|
21
|
+
._syaz1q3r{color:var(--ds-icon,#292a2e)}
|
|
@@ -11,12 +11,12 @@ import { Pressable } from '@atlaskit/primitives/pressable';
|
|
|
11
11
|
import { xcss } from '@atlaskit/primitives/xcss/xcss';
|
|
12
12
|
import { QuickInsertHoverPreview } from './QuickInsertHoverPreview';
|
|
13
13
|
import { useQuickInsertMenuItemSelection } from './quickInsertMenuItemUtils';
|
|
14
|
+
import { QuickInsertShortcut } from './QuickInsertShortcut';
|
|
14
15
|
import { useQuickInsertContext } from './useQuickInsertContext';
|
|
15
16
|
const styles = {
|
|
16
17
|
iconContainer: "_4cvr1h6o _1e0c1txw _1o9zidpf _1bah1h6o _1tke1tcg _1ul91tcg",
|
|
17
18
|
content: "_16jlkb7n _1o9zkb7n _i0dlidpf _1ul9idpf",
|
|
18
|
-
iconLarge: "_2rko1mok _1reo15vq _18m915vq _1h6d1l7x _1dqonqa1 _189ee4h9 _4cvr1h6o _bfhk1bhr _1e0c1txw _4t3izwfg _1bah1h6o _1bsbzwfg"
|
|
19
|
-
shortcut: "_2rko12b0 _11c8wadc _1rjcv77o _18zr1b66 _bfhki8nm _syazazsu"
|
|
19
|
+
iconLarge: "_2rko1mok _1reo15vq _18m915vq _1h6d1l7x _1dqonqa1 _189ee4h9 _4cvr1h6o _bfhk1bhr _1e0c1txw _4t3izwfg _1bah1h6o _1bsbzwfg"
|
|
20
20
|
};
|
|
21
21
|
const iconColorStyles = null;
|
|
22
22
|
|
|
@@ -151,10 +151,10 @@ export const CompactQuickInsertMenuItem = ({
|
|
|
151
151
|
}, lozenge ? /*#__PURE__*/React.createElement(Inline, {
|
|
152
152
|
alignBlock: "center",
|
|
153
153
|
space: "space.100"
|
|
154
|
-
}, rowTitle, lozenge) : rowTitle, shortcut && /*#__PURE__*/React.createElement(
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
}
|
|
154
|
+
}, rowTitle, lozenge) : rowTitle, shortcut && /*#__PURE__*/React.createElement(QuickInsertShortcut, {
|
|
155
|
+
isDisabled: isDisabled,
|
|
156
|
+
shortcut: shortcut
|
|
157
|
+
}))), shouldRenderPreview && referenceElement && /*#__PURE__*/React.createElement(QuickInsertHoverPreview, {
|
|
158
158
|
key: (_ref = (_resolvedPreview$imag = (_resolvedPreview$imag2 = resolvedPreview.image) === null || _resolvedPreview$imag2 === void 0 ? void 0 : _resolvedPreview$imag2.light) !== null && _resolvedPreview$imag !== void 0 ? _resolvedPreview$imag : previewAttributionKey) !== null && _ref !== void 0 ? _ref : title,
|
|
159
159
|
id: previewId,
|
|
160
160
|
description: resolvedDescription,
|