@atlaskit/editor-common 134.7.1 → 134.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +40 -0
- package/dist/cjs/extensibility/Extension/Extension/index.js +3 -1
- package/dist/cjs/extensibility/MultiBodiedExtension/index.js +3 -1
- package/dist/cjs/extensibility/utils/get-breakout-width.js +27 -0
- package/dist/cjs/extensibility/utils/has-breakout-width.js +11 -0
- package/dist/cjs/extensibility/utils/should-extension-breakout.js +10 -1
- package/dist/cjs/extensions/messages.js +5 -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/HoverLinkOverlay/index.js +45 -10
- package/dist/cjs/ui/Layer/index.js +14 -208
- package/dist/cjs/vanilla-tooltip/index.js +5 -14
- package/dist/es2019/extensibility/Extension/Extension/index.js +3 -1
- package/dist/es2019/extensibility/MultiBodiedExtension/index.js +3 -1
- package/dist/es2019/extensibility/utils/get-breakout-width.js +9 -0
- package/dist/es2019/extensibility/utils/has-breakout-width.js +4 -0
- package/dist/es2019/extensibility/utils/should-extension-breakout.js +9 -1
- package/dist/es2019/extensions/messages.js +5 -0
- 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/HoverLinkOverlay/index.js +36 -3
- package/dist/es2019/ui/Layer/index.js +15 -192
- package/dist/es2019/vanilla-tooltip/index.js +7 -15
- package/dist/esm/extensibility/Extension/Extension/index.js +3 -1
- package/dist/esm/extensibility/MultiBodiedExtension/index.js +3 -1
- package/dist/esm/extensibility/utils/get-breakout-width.js +21 -0
- package/dist/esm/extensibility/utils/has-breakout-width.js +6 -0
- package/dist/esm/extensibility/utils/should-extension-breakout.js +10 -1
- package/dist/esm/extensions/messages.js +5 -0
- 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/HoverLinkOverlay/index.js +45 -10
- package/dist/esm/ui/Layer/index.js +15 -211
- package/dist/esm/vanilla-tooltip/index.js +7 -15
- package/dist/types/extensibility/utils/get-breakout-width.d.ts +3 -0
- package/dist/types/extensibility/utils/has-breakout-width.d.ts +3 -0
- package/dist/types/extensibility/utils/should-extension-breakout.d.ts +2 -1
- package/dist/types/extensions/messages.d.ts +24 -19
- 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/extensibility/get-breakout-width/package.json +10 -0
- package/extensibility/has-breakout-width/package.json +10 -0
- package/package.json +3 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,45 @@
|
|
|
1
1
|
# @atlaskit/editor-common
|
|
2
2
|
|
|
3
|
+
## 134.8.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`af6421f9b80ca`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/af6421f9b80ca) -
|
|
8
|
+
[EDITOR-9924] When `platform_editor_lovability_resize_exts_gracefully` and
|
|
9
|
+
`platform_editor_lovability_resize_exts_patch_1` are enabled, use the breakout mark for extension
|
|
10
|
+
node width across both resizing cohorts and synchronize existing layouts with breakout widths for
|
|
11
|
+
users in the resizing: false cohort.
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [`56839f6b1b63c`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/56839f6b1b63c) -
|
|
16
|
+
Defer smart-link hover overlay measurements with a one-shot ResizeObserver and avoid interleaving
|
|
17
|
+
hidden-label style writes with layout reads in the `platform_editor_improve_inp_batch_2`
|
|
18
|
+
experiment treatment.
|
|
19
|
+
- Updated dependencies
|
|
20
|
+
|
|
21
|
+
## 134.7.2
|
|
22
|
+
|
|
23
|
+
### Patch Changes
|
|
24
|
+
|
|
25
|
+
- [`f1dbe14f9e8d0`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/f1dbe14f9e8d0) -
|
|
26
|
+
Cleanup `feature_gate` `platform-dst-popper-consolidation`. `PopupSelect`, the Editor `Layer` and
|
|
27
|
+
`VanillaTooltip` now always position through `@atlaskit/popper`, and the direct `react-popper`,
|
|
28
|
+
`popper.js` and `@popperjs/core` paths are removed.
|
|
29
|
+
|
|
30
|
+
`Layer` mounts its content in the commit that opens it again, as the `popper.js` path did, so
|
|
31
|
+
Editor dropdown menus opened by keyboard focus their first item.
|
|
32
|
+
|
|
33
|
+
- [`7b6b2186d8c8b`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/7b6b2186d8c8b) -
|
|
34
|
+
Element Browser (platform_editor_slash_command experiment): show Recommended elements above All
|
|
35
|
+
elements in the All category; render every tile as its hover preview card (image, full
|
|
36
|
+
description, attribution) with lazily loaded images, equal heights per row and aligned footers;
|
|
37
|
+
show each tile's shortcut beside its title, which uses the hover preview's title style; enlarge
|
|
38
|
+
the modal to 1072x804 with 264px tiles; and support arrow-key navigation across rows of different
|
|
39
|
+
widths. Unclamped Quick Insert hover previews (Rovo skills) use the same subtle heading title as
|
|
40
|
+
other previews.
|
|
41
|
+
- Updated dependencies
|
|
42
|
+
|
|
3
43
|
## 134.7.1
|
|
4
44
|
|
|
5
45
|
### Patch Changes
|
|
@@ -21,6 +21,7 @@ var _hooks = require("../../../hooks");
|
|
|
21
21
|
var _NodeViewContentHole = require("../../../react-node-view/NodeViewContentHole");
|
|
22
22
|
var _ui = require("../../../ui");
|
|
23
23
|
var _utils = require("../../../utils");
|
|
24
|
+
var _hasBreakoutWidth = require("../../utils/has-breakout-width");
|
|
24
25
|
var _shouldExtensionBreakout = require("../../utils/should-extension-breakout");
|
|
25
26
|
var _ExtensionCommentBadge = require("../ExtensionCommentBadge");
|
|
26
27
|
var _Lozenge = _interopRequireDefault(require("../Lozenge"));
|
|
@@ -113,7 +114,8 @@ function ExtensionWithPluginState(props) {
|
|
|
113
114
|
editorAppearance: editorAppearance,
|
|
114
115
|
hasBreakoutMark: (_node$marks = node.marks) === null || _node$marks === void 0 ? void 0 : _node$marks.some(function (mark) {
|
|
115
116
|
return mark.type.name === 'breakout';
|
|
116
|
-
})
|
|
117
|
+
}),
|
|
118
|
+
hasBreakoutWidth: (0, _hasBreakoutWidth.hasBreakoutWidth)(node.marks)
|
|
117
119
|
});
|
|
118
120
|
|
|
119
121
|
// We don't want to show border for non-empty 1p bodied extensions in live pages
|
|
@@ -24,6 +24,7 @@ var _MultiBodiedExtension = require("../../ui/MultiBodiedExtension");
|
|
|
24
24
|
var _utils = require("../../utils");
|
|
25
25
|
var _Lozenge = _interopRequireDefault(require("../Extension/Lozenge"));
|
|
26
26
|
var _ExtensionFloatingLabel = require("../Extension/Lozenge/ExtensionFloatingLabel");
|
|
27
|
+
var _hasBreakoutWidth = require("../utils/has-breakout-width");
|
|
27
28
|
var _shouldExtensionBreakout = require("../utils/should-extension-breakout");
|
|
28
29
|
var _actionApi = require("./action-api");
|
|
29
30
|
var _styles = require("./styles");
|
|
@@ -256,7 +257,8 @@ var MultiBodiedExtensionWithWidth = function MultiBodiedExtensionWithWidth(_ref2
|
|
|
256
257
|
isTopLevelNode: true,
|
|
257
258
|
hasBreakoutMark: (_node$marks = node.marks) === null || _node$marks === void 0 ? void 0 : _node$marks.some(function (mark) {
|
|
258
259
|
return mark.type.name === 'breakout';
|
|
259
|
-
})
|
|
260
|
+
}),
|
|
261
|
+
hasBreakoutWidth: (0, _hasBreakoutWidth.hasBreakoutWidth)(node.marks)
|
|
260
262
|
});
|
|
261
263
|
var mbeWrapperStyles = {};
|
|
262
264
|
if (shouldBreakout) {
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getBreakoutWidth = void 0;
|
|
7
|
+
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
|
|
8
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
9
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
10
|
+
/** returns the breakout width if the node has a breakout mark with a positive breakout width. */
|
|
11
|
+
var getBreakoutWidth = exports.getBreakoutWidth = function getBreakoutWidth(marks) {
|
|
12
|
+
var _iterator = _createForOfIteratorHelper(marks !== null && marks !== void 0 ? marks : []),
|
|
13
|
+
_step;
|
|
14
|
+
try {
|
|
15
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
16
|
+
var mark = _step.value;
|
|
17
|
+
if (mark.type.name === 'breakout' && typeof mark.attrs.width === 'number' && mark.attrs.width > 0) {
|
|
18
|
+
return mark.attrs.width;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
} catch (err) {
|
|
22
|
+
_iterator.e(err);
|
|
23
|
+
} finally {
|
|
24
|
+
_iterator.f();
|
|
25
|
+
}
|
|
26
|
+
return undefined;
|
|
27
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.hasBreakoutWidth = void 0;
|
|
7
|
+
var _getBreakoutWidth = require("./get-breakout-width");
|
|
8
|
+
/** returns true if the node has a breakout mark with a positive breakout width. */
|
|
9
|
+
var hasBreakoutWidth = exports.hasBreakoutWidth = function hasBreakoutWidth(marks) {
|
|
10
|
+
return (0, _getBreakoutWidth.getBreakoutWidth)(marks) !== undefined;
|
|
11
|
+
};
|
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.shouldExtensionBreakout = void 0;
|
|
7
7
|
var _isExperimentEnabled = require("@atlaskit/platform-feature-experiments/is-experiment-enabled");
|
|
8
|
+
var _fg = require("@atlaskit/platform-feature-flags/fg");
|
|
8
9
|
var breakoutLayouts = new Set(['full-width', 'wide']);
|
|
9
10
|
var shouldRespectBreakoutForAppearance = function shouldRespectBreakoutForAppearance(appearance) {
|
|
10
11
|
if (!appearance) {
|
|
@@ -24,8 +25,16 @@ var shouldExtensionBreakout = exports.shouldExtensionBreakout = function shouldE
|
|
|
24
25
|
isTopLevelNode = _ref$isTopLevelNode === void 0 ? true : _ref$isTopLevelNode,
|
|
25
26
|
editorAppearance = _ref.editorAppearance,
|
|
26
27
|
_ref$hasBreakoutMark = _ref.hasBreakoutMark,
|
|
27
|
-
hasBreakoutMark = _ref$hasBreakoutMark === void 0 ? false : _ref$hasBreakoutMark
|
|
28
|
+
hasBreakoutMark = _ref$hasBreakoutMark === void 0 ? false : _ref$hasBreakoutMark,
|
|
29
|
+
_ref$hasBreakoutWidth = _ref.hasBreakoutWidth,
|
|
30
|
+
hasBreakoutWidth = _ref$hasBreakoutWidth === void 0 ? false : _ref$hasBreakoutWidth;
|
|
28
31
|
// the breakout mark wrapper owns the width, so the legacy layout must not size the node too
|
|
32
|
+
if ((0, _fg.fg)('platform_editor_lovability_resize_exts_gracefully') && (0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_lovability_resize_exts_patch_1') && hasBreakoutWidth) {
|
|
33
|
+
return false;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// once platform_editor_lovability_resize_exts_patch_1 is rolled out, we can remove this redundant check.
|
|
37
|
+
// because the previous check should have returned false already for extensions with breakout widths.
|
|
29
38
|
if (hasBreakoutMark && (0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_lovability_resize_extensions')) {
|
|
30
39
|
return false;
|
|
31
40
|
}
|
|
@@ -13,6 +13,11 @@ exports.messages = void 0;
|
|
|
13
13
|
var _reactIntl = require("react-intl");
|
|
14
14
|
var _configPanelMessages = require("./configPanelMessages");
|
|
15
15
|
var messages = exports.messages = (0, _reactIntl.defineMessages)({
|
|
16
|
+
customWidth: {
|
|
17
|
+
id: 'fabric.editor.extension.customWidth',
|
|
18
|
+
defaultMessage: 'Custom width',
|
|
19
|
+
description: 'Label for the layout button in the extension toolbar when the extension has been resized to a custom width.'
|
|
20
|
+
},
|
|
16
21
|
edit: {
|
|
17
22
|
id: 'fabric.editor.edit',
|
|
18
23
|
defaultMessage: 'Edit',
|
|
@@ -27,7 +27,7 @@ var NETWORK_FAILURE_REGEX = /^network failure/i;
|
|
|
27
27
|
var RESIZE_OBSERVER_LOOP_REGEX = /ResizeObserver loop completed with undelivered notifications/;
|
|
28
28
|
var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
29
29
|
var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
30
|
-
var packageVersion = "134.7.
|
|
30
|
+
var packageVersion = "134.7.2";
|
|
31
31
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
32
32
|
// Remove URL as it has UGC
|
|
33
33
|
// 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)}
|
|
@@ -18,6 +18,7 @@ var _pressable = require("@atlaskit/primitives/pressable");
|
|
|
18
18
|
var _xcss = require("@atlaskit/primitives/xcss/xcss");
|
|
19
19
|
var _QuickInsertHoverPreview = require("./QuickInsertHoverPreview");
|
|
20
20
|
var _quickInsertMenuItemUtils = require("./quickInsertMenuItemUtils");
|
|
21
|
+
var _QuickInsertShortcut = require("./QuickInsertShortcut");
|
|
21
22
|
var _useQuickInsertContext = require("./useQuickInsertContext");
|
|
22
23
|
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
24
|
// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- Compiled primitives do not provide Pressable.
|
|
@@ -25,8 +26,7 @@ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r
|
|
|
25
26
|
var styles = {
|
|
26
27
|
iconContainer: "_4cvr1h6o _1e0c1txw _1o9zidpf _1bah1h6o _1tke1tcg _1ul91tcg",
|
|
27
28
|
content: "_16jlkb7n _1o9zkb7n _i0dlidpf _1ul9idpf",
|
|
28
|
-
iconLarge: "_2rko1mok _1reo15vq _18m915vq _1h6d1l7x _1dqonqa1 _189ee4h9 _4cvr1h6o _bfhk1bhr _1e0c1txw _4t3izwfg _1bah1h6o _1bsbzwfg"
|
|
29
|
-
shortcut: "_2rko12b0 _11c8wadc _1rjcv77o _18zr1b66 _bfhki8nm _syazazsu"
|
|
29
|
+
iconLarge: "_2rko1mok _1reo15vq _18m915vq _1h6d1l7x _1dqonqa1 _189ee4h9 _4cvr1h6o _bfhk1bhr _1e0c1txw _4t3izwfg _1bah1h6o _1bsbzwfg"
|
|
30
30
|
};
|
|
31
31
|
var iconColorStyles = null;
|
|
32
32
|
|
|
@@ -165,10 +165,10 @@ var CompactQuickInsertMenuItem = exports.CompactQuickInsertMenuItem = function C
|
|
|
165
165
|
}, lozenge ? /*#__PURE__*/_react.default.createElement(_inline.Inline, {
|
|
166
166
|
alignBlock: "center",
|
|
167
167
|
space: "space.100"
|
|
168
|
-
}, rowTitle, lozenge) : rowTitle, shortcut && /*#__PURE__*/_react.default.createElement(
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
}
|
|
168
|
+
}, rowTitle, lozenge) : rowTitle, shortcut && /*#__PURE__*/_react.default.createElement(_QuickInsertShortcut.QuickInsertShortcut, {
|
|
169
|
+
isDisabled: isDisabled,
|
|
170
|
+
shortcut: shortcut
|
|
171
|
+
}))), shouldRenderPreview && referenceElement && /*#__PURE__*/_react.default.createElement(_QuickInsertHoverPreview.QuickInsertHoverPreview, {
|
|
172
172
|
key: (_ref3 = (_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 && _ref3 !== void 0 ? _ref3 : title,
|
|
173
173
|
id: previewId,
|
|
174
174
|
description: resolvedDescription,
|
|
@@ -9,88 +9,76 @@ exports.ElementBrowserQuickInsertMenuItem = void 0;
|
|
|
9
9
|
require("./ElementBrowserQuickInsertMenuItem.compiled.css");
|
|
10
10
|
var _runtime = require("@compiled/react/runtime");
|
|
11
11
|
var _react = _interopRequireWildcard(require("react"));
|
|
12
|
-
var _isExperimentEnabled = require("@atlaskit/platform-feature-experiments/is-experiment-enabled");
|
|
13
12
|
var _box = require("@atlaskit/primitives/box");
|
|
14
|
-
var _inline = require("@atlaskit/primitives/inline");
|
|
15
13
|
var _pressable = require("@atlaskit/primitives/pressable");
|
|
16
|
-
var _stack = require("@atlaskit/primitives/stack");
|
|
17
|
-
var _text = require("@atlaskit/primitives/text");
|
|
18
14
|
var _xcss = require("@atlaskit/primitives/xcss/xcss");
|
|
19
15
|
var _quickInsertMenuItemUtils = require("./quickInsertMenuItemUtils");
|
|
16
|
+
var _QuickInsertPreviewContent = require("./QuickInsertPreviewContent");
|
|
20
17
|
var _useQuickInsertContext = require("./useQuickInsertContext");
|
|
21
18
|
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
19
|
/* eslint-disable @atlaskit/design-system/no-emotion-primitives -- Compiled primitives do not provide Pressable. */
|
|
23
|
-
var
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
borderRadius: 'radius.
|
|
20
|
+
var cardStyles = (0, _xcss.xcss)({
|
|
21
|
+
backgroundColor: 'elevation.surface',
|
|
22
|
+
borderColor: 'color.border',
|
|
23
|
+
borderRadius: 'radius.large',
|
|
24
|
+
borderStyle: 'solid',
|
|
25
|
+
borderWidth: 'border.width',
|
|
27
26
|
color: 'color.text',
|
|
28
27
|
cursor: 'pointer',
|
|
29
28
|
display: 'flex',
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
flexDirection: 'column',
|
|
30
|
+
gap: 'space.100',
|
|
31
|
+
// Fills the grid row so every tile in a row is as tall as the tallest one.
|
|
32
|
+
height: '100%',
|
|
32
33
|
padding: 'space.150',
|
|
33
34
|
textAlign: 'start',
|
|
34
|
-
width: '100%'
|
|
35
|
+
width: '100%',
|
|
36
|
+
':hover': {
|
|
37
|
+
backgroundColor: 'elevation.surface.hovered'
|
|
38
|
+
}
|
|
35
39
|
});
|
|
36
|
-
|
|
37
|
-
|
|
40
|
+
|
|
41
|
+
// Each state is a complete style so the tile can pick one without composing styles at render.
|
|
42
|
+
var selectedCardStyles = (0, _xcss.xcss)({
|
|
38
43
|
backgroundColor: 'color.background.selected',
|
|
39
|
-
|
|
44
|
+
borderColor: 'color.border.selected',
|
|
45
|
+
borderRadius: 'radius.large',
|
|
46
|
+
borderStyle: 'solid',
|
|
47
|
+
borderWidth: 'border.width',
|
|
40
48
|
color: 'color.text',
|
|
41
49
|
cursor: 'pointer',
|
|
42
50
|
display: 'flex',
|
|
43
|
-
|
|
44
|
-
|
|
51
|
+
flexDirection: 'column',
|
|
52
|
+
gap: 'space.100',
|
|
53
|
+
height: '100%',
|
|
45
54
|
padding: 'space.150',
|
|
46
|
-
position: 'relative',
|
|
47
55
|
textAlign: 'start',
|
|
48
56
|
width: '100%',
|
|
49
|
-
'
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
insetInlineStart: 'space.0',
|
|
56
|
-
pointerEvents: 'none',
|
|
57
|
-
position: 'absolute'
|
|
57
|
+
':hover': {
|
|
58
|
+
backgroundColor: 'color.background.selected.hovered'
|
|
59
|
+
},
|
|
60
|
+
// Keyboard focus draws the focus ring, so drop the selected border to avoid a double outline.
|
|
61
|
+
':focus-visible': {
|
|
62
|
+
borderColor: 'color.border'
|
|
58
63
|
}
|
|
59
64
|
});
|
|
60
|
-
var
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
borderRadius: 'radius.
|
|
65
|
+
var disabledCardStyles = (0, _xcss.xcss)({
|
|
66
|
+
backgroundColor: 'elevation.surface',
|
|
67
|
+
borderColor: 'color.border',
|
|
68
|
+
borderRadius: 'radius.large',
|
|
69
|
+
borderStyle: 'solid',
|
|
70
|
+
borderWidth: 'border.width',
|
|
64
71
|
color: 'color.text.disabled',
|
|
65
72
|
cursor: 'not-allowed',
|
|
66
73
|
display: 'flex',
|
|
67
|
-
|
|
68
|
-
|
|
74
|
+
flexDirection: 'column',
|
|
75
|
+
gap: 'space.100',
|
|
76
|
+
height: '100%',
|
|
69
77
|
padding: 'space.150',
|
|
70
78
|
textAlign: 'start',
|
|
71
79
|
width: '100%'
|
|
72
80
|
});
|
|
73
|
-
var hoveredItemStyles = (0, _xcss.xcss)({
|
|
74
|
-
':hover': {
|
|
75
|
-
backgroundColor: 'elevation.surface.hovered',
|
|
76
|
-
borderRadius: 'radius.medium'
|
|
77
|
-
}
|
|
78
|
-
});
|
|
79
81
|
var iconStyles = (0, _xcss.xcss)({
|
|
80
|
-
alignItems: 'center',
|
|
81
|
-
backgroundColor: 'elevation.surface.overlay',
|
|
82
|
-
borderColor: 'color.border',
|
|
83
|
-
borderRadius: 'radius.medium',
|
|
84
|
-
borderStyle: 'solid',
|
|
85
|
-
borderWidth: 'border.width',
|
|
86
|
-
display: 'flex',
|
|
87
|
-
flexShrink: 0,
|
|
88
|
-
height: '40px',
|
|
89
|
-
justifyContent: 'center',
|
|
90
|
-
overflow: 'hidden',
|
|
91
|
-
width: '40px'
|
|
92
|
-
});
|
|
93
|
-
var iconLargeStyles = (0, _xcss.xcss)({
|
|
94
82
|
alignItems: 'center',
|
|
95
83
|
backgroundColor: 'elevation.surface.overlay',
|
|
96
84
|
borderColor: 'color.border',
|
|
@@ -99,10 +87,10 @@ var iconLargeStyles = (0, _xcss.xcss)({
|
|
|
99
87
|
borderWidth: 'border.width',
|
|
100
88
|
display: 'flex',
|
|
101
89
|
flexShrink: 0,
|
|
102
|
-
height: '
|
|
90
|
+
height: '32px',
|
|
103
91
|
justifyContent: 'center',
|
|
104
92
|
overflow: 'hidden',
|
|
105
|
-
width: '
|
|
93
|
+
width: '32px'
|
|
106
94
|
});
|
|
107
95
|
var iconColorStyles = null;
|
|
108
96
|
|
|
@@ -115,25 +103,24 @@ var iconColorStyles = null;
|
|
|
115
103
|
var pinnedIconColorResetStyles = null;
|
|
116
104
|
/* eslint-enable @atlaskit/design-system/no-unsafe-design-token-usage, @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-important-styles */
|
|
117
105
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
paddingInline: 'space.050'
|
|
125
|
-
});
|
|
106
|
+
/**
|
|
107
|
+
* An Element Browser tile: the item's hover preview card (image, title, full description, and
|
|
108
|
+
* attribution), with its shortcut beside the title. Items without a preview image show their icon,
|
|
109
|
+
* always in a bordered box, above the title instead. The hover card's small title icon
|
|
110
|
+
* (`previewIcon`) is not shown, so a tile never repeats its icon.
|
|
111
|
+
*/
|
|
126
112
|
var ElementBrowserQuickInsertMenuItem = exports.ElementBrowserQuickInsertMenuItem = function ElementBrowserQuickInsertMenuItem(_ref) {
|
|
127
113
|
var ariaLabel = _ref.ariaLabel,
|
|
128
114
|
description = _ref.description,
|
|
129
115
|
iconBefore = _ref.iconBefore,
|
|
130
|
-
isDisabled = _ref.isDisabled,
|
|
116
|
+
_ref$isDisabled = _ref.isDisabled,
|
|
117
|
+
isDisabled = _ref$isDisabled === void 0 ? false : _ref$isDisabled,
|
|
131
118
|
lozenge = _ref.lozenge,
|
|
132
119
|
onSelect = _ref.onSelect,
|
|
120
|
+
preview = _ref.preview,
|
|
121
|
+
previewImageUrls = _ref.previewImageUrls,
|
|
133
122
|
shortcut = _ref.shortcut,
|
|
134
123
|
titleContent = _ref.titleContent,
|
|
135
|
-
_ref$shouldWrapIcon = _ref.shouldWrapIcon,
|
|
136
|
-
shouldWrapIcon = _ref$shouldWrapIcon === void 0 ? true : _ref$shouldWrapIcon,
|
|
137
124
|
title = _ref.title;
|
|
138
125
|
var _useQuickInsertContex = (0, _useQuickInsertContext.useQuickInsertContext)(),
|
|
139
126
|
item = _useQuickInsertContex.item;
|
|
@@ -145,50 +132,36 @@ var ElementBrowserQuickInsertMenuItem = exports.ElementBrowserQuickInsertMenuIte
|
|
|
145
132
|
isSelected = _ref2.isSelected;
|
|
146
133
|
var itemDescription = description !== null && description !== void 0 ? description : item === null || item === void 0 ? void 0 : item.description;
|
|
147
134
|
var handleClick = (0, _quickInsertMenuItemUtils.useQuickInsertMenuItemSelection)(onSelect);
|
|
148
|
-
var
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
weight: "medium"
|
|
156
|
-
}, title);
|
|
157
|
-
|
|
158
|
-
// Disabled items keep the dimmed colour inherited from the item.
|
|
135
|
+
var descriptionId = (0, _react.useId)();
|
|
136
|
+
var resolvedPreview = (0, _react.useMemo)(function () {
|
|
137
|
+
return preview !== null && preview !== void 0 ? preview : previewImageUrls ? {
|
|
138
|
+
image: previewImageUrls
|
|
139
|
+
} : {};
|
|
140
|
+
}, [preview, previewImageUrls]);
|
|
141
|
+
var hasDescription = Boolean(itemDescription || resolvedPreview.attribution || shortcut);
|
|
159
142
|
var icon = iconBefore ? /*#__PURE__*/_react.default.createElement("span", {
|
|
160
143
|
className: (0, _runtime.ax)(["_rpzpjdj5 _1pgcjdj5", !isDisabled && "_syaz1q3r"])
|
|
161
|
-
}, iconBefore) :
|
|
144
|
+
}, iconBefore) : undefined;
|
|
162
145
|
return /*#__PURE__*/_react.default.createElement(_pressable.Pressable, {
|
|
163
|
-
"aria-
|
|
146
|
+
"aria-describedby": hasDescription ? descriptionId : undefined,
|
|
147
|
+
"aria-label": ariaLabel !== null && ariaLabel !== void 0 ? ariaLabel : title,
|
|
164
148
|
"aria-selected": isSelected,
|
|
165
149
|
id: id,
|
|
166
150
|
isDisabled: isDisabled,
|
|
167
151
|
onClick: handleClick,
|
|
168
152
|
role: "option",
|
|
169
|
-
tabIndex: isSelected ? 0 : -1
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
xcss:
|
|
173
|
-
},
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
}
|
|
183
|
-
alignBlock: "center",
|
|
184
|
-
space: "space.100"
|
|
185
|
-
}, itemTitle, lozenge) : itemTitle, shortcut && /*#__PURE__*/_react.default.createElement(_box.Box, {
|
|
186
|
-
as: "span",
|
|
187
|
-
xcss: shortcutStyles
|
|
188
|
-
}, shortcut)), itemDescription && /*#__PURE__*/_react.default.createElement(_text.Text, {
|
|
189
|
-
color: "color.text.subtlest",
|
|
190
|
-
maxLines: 2,
|
|
191
|
-
size: "small",
|
|
192
|
-
weight: "regular"
|
|
193
|
-
}, itemDescription)));
|
|
153
|
+
tabIndex: isSelected ? 0 : -1,
|
|
154
|
+
xcss: isDisabled ? disabledCardStyles : isSelected ? selectedCardStyles : cardStyles
|
|
155
|
+
}, !resolvedPreview.image && icon && /*#__PURE__*/_react.default.createElement(_box.Box, {
|
|
156
|
+
xcss: iconStyles
|
|
157
|
+
}, icon), /*#__PURE__*/_react.default.createElement(_QuickInsertPreviewContent.QuickInsertPreviewContent, {
|
|
158
|
+
description: itemDescription,
|
|
159
|
+
id: hasDescription ? descriptionId : undefined,
|
|
160
|
+
isDisabled: isDisabled,
|
|
161
|
+
lozenge: lozenge,
|
|
162
|
+
preview: resolvedPreview,
|
|
163
|
+
shortcut: shortcut,
|
|
164
|
+
shouldClampText: false,
|
|
165
|
+
title: titleContent !== null && titleContent !== void 0 ? titleContent : title
|
|
166
|
+
}));
|
|
194
167
|
};
|
|
@@ -1,50 +1,13 @@
|
|
|
1
|
-
._11c81qyo{font:var(--ds-font-heading-xsmall,normal 653 14px/20px "Atlassian Sans",ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif)}
|
|
2
|
-
._11c8fhey{font:var(--ds-font-body,normal 400 14px/20px "Atlassian Sans",ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif)}
|
|
3
|
-
._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)}
|
|
4
|
-
._2rko12b0{border-radius:var(--ds-radius-small,4px)}
|
|
5
1
|
._2rko1qi0{border-radius:var(--ds-radius-medium,6px)}
|
|
6
|
-
._zulp1b66{gap:var(--ds-space-050,4px)}
|
|
7
|
-
._zulpu2gc{gap:var(--ds-space-100,8px)}
|
|
8
2
|
._18zrutpp{padding-inline:var(--ds-space-150,9pt)}
|
|
9
|
-
._1rjcutpp{padding-block:var(--ds-space-150,9pt)}
|
|
10
|
-
._16jlidpf{flex-grow:0}
|
|
11
|
-
._16jlkb7n{flex-grow:1}
|
|
12
|
-
._16qs130s{box-shadow:var(--ds-shadow-overlay,0 8px 9pt #1e1f2126,0 0 1px #1e1f214f)}
|
|
3
|
+
._1rjcutpp{padding-block:var(--ds-space-150,9pt)}._16qs130s{box-shadow:var(--ds-shadow-overlay,0 8px 9pt #1e1f2126,0 0 1px #1e1f214f)}
|
|
13
4
|
._18m915vq{overflow-y:hidden}
|
|
14
|
-
._1bah1h6o{justify-content:center}
|
|
15
|
-
._1bsb1osq{width:100%}
|
|
16
|
-
._1bsb7vkz{width:1pc}
|
|
17
5
|
._1bsbncxg{width:264px}
|
|
18
|
-
._1bsbp3fh{width:15pc}
|
|
19
|
-
._1e0c1txw{display:flex}
|
|
20
|
-
._1e0c1ule{display:block}
|
|
21
|
-
._1e0ccj1k{display:-webkit-box}
|
|
22
|
-
._1i4qfg65{overflow-wrap:anywhere}
|
|
23
|
-
._1o9zidpf{flex-shrink:0}
|
|
24
|
-
._1o9zkb7n{flex-shrink:1}
|
|
25
6
|
._1pby16oo{z-index:510}
|
|
26
7
|
._1reo15vq{overflow-x:hidden}
|
|
27
|
-
._1ul9idpf{min-width:0}
|
|
28
|
-
._1yyjcs5v{-webkit-line-clamp:2}
|
|
29
|
-
._1yyjegat{-webkit-line-clamp:4}
|
|
30
|
-
._2lx21bp4{flex-direction:column}
|
|
31
|
-
._3um015vq{visibility:hidden}
|
|
32
|
-
._4cvr1h6o{align-items:center}
|
|
33
|
-
._4t3i1osq{height:100%}
|
|
34
|
-
._4t3i68cl{height:90pt}
|
|
35
|
-
._4t3i7vkz{height:1pc}
|
|
36
|
-
._5ral1f51{object-fit:contain}
|
|
37
|
-
._6rthu2gc{margin-block-end:var(--ds-space-100,8px)}
|
|
38
8
|
._bfhk1bhr{background-color:var(--ds-surface-overlay,#fff)}
|
|
39
|
-
._bfhkhfxm{background-color:var(--ds-surface-sunken,#f8f8f8)}
|
|
40
9
|
._c71l1kw7{max-height:inherit}
|
|
41
10
|
._c71lk6is{max-height:calc(100vh - 1pc)}
|
|
42
|
-
._i0dl1wug{flex-basis:auto}
|
|
43
|
-
._i0dlexct{flex-basis:16px}
|
|
44
|
-
._k48pwu06{font-weight:var(--ds-font-weight-bold,653)}
|
|
45
11
|
._p12f1oec{max-width:calc(100vw - 1pc)}
|
|
46
12
|
._p12f1osq{max-width:100%}
|
|
47
|
-
._sudp1e54{-webkit-box-orient:vertical}
|
|
48
|
-
._syazazsu{color:var(--ds-text-subtle,#505258)}
|
|
49
|
-
._syazi7uo{color:var(--ds-text,#292a2e)}
|
|
50
13
|
._vchhusvi{box-sizing:border-box}
|