@atlaskit/editor-plugin-type-ahead 19.0.7 → 19.0.8

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 CHANGED
@@ -1,5 +1,17 @@
1
1
  # @atlaskit/editor-plugin-type-ahead
2
2
 
3
+ ## 19.0.8
4
+
5
+ ### Patch Changes
6
+
7
+ - [`a6ea70b003713`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/a6ea70b003713) -
8
+ Improve the slash-command menu behind `platform_editor_slash_command`: add optional light and dark
9
+ preview image URLs, show theme-aware previews for headings, quote, and list commands, and set the
10
+ registered menu to 320px wide and up to 480px tall while allowing short menus to hug their
11
+ contents. Previews fall back to the light image when no dark image is supplied and are not shown
12
+ when no URLs are supplied.
13
+ - Updated dependencies
14
+
3
15
  ## 19.0.7
4
16
 
5
17
  ### Patch Changes
@@ -1,6 +1,7 @@
1
1
  ._2rko12b0{border-radius:var(--ds-radius-small,4px)}
2
2
  ._1rjc1b66{padding-block:var(--ds-space-050,4px)}._16qs130s{box-shadow:var(--ds-shadow-overlay,0 8px 9pt #1e1f2126,0 0 1px #1e1f214f)}
3
3
  ._18m915vq{overflow-y:hidden}
4
- ._1bsb5x59{width:340px}
4
+ ._1bsbnklw{width:20pc}
5
5
  ._1reo15vq{overflow-x:hidden}
6
- ._bfhk1bhr{background-color:var(--ds-surface-overlay,#fff)}
6
+ ._bfhk1bhr{background-color:var(--ds-surface-overlay,#fff)}
7
+ ._vchhusvi{box-sizing:border-box}
@@ -1,4 +1,4 @@
1
- /* RegisteredTypeAheadMenu.tsx generated by @compiled/babel-plugin v3.0.1 */
1
+ /* RegisteredTypeAheadMenu.tsx generated by @compiled/babel-plugin v3.0.2 */
2
2
  "use strict";
3
3
 
4
4
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
@@ -26,9 +26,11 @@ var _TypeAheadMenuRenderer = require("./TypeAheadMenuRenderer");
26
26
  var _TypeAheadProvider = require("./TypeAheadProvider");
27
27
  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); }
28
28
  var styles = {
29
- menu: "_2rko12b0 _1reo15vq _18m915vq _1rjc1b66 _bfhk1bhr _16qs130s _1bsb5x59"
29
+ menu: "_2rko12b0 _1reo15vq _18m915vq _1rjc1b66 _bfhk1bhr _vchhusvi _16qs130s _1bsbnklw"
30
30
  };
31
- var DEFAULT_MENU_MAX_HEIGHT = 520;
31
+ var DEFAULT_MENU_MAX_HEIGHT = 480;
32
+ var MENU_VERTICAL_PADDING = 8;
33
+ var MENU_WIDTH = 320;
32
34
  var POPUP_OFFSET = [0, 8];
33
35
  var SECTION_OVERFLOW_LIMIT = 30;
34
36
  var RegisteredTypeAheadMenu = exports.RegisteredTypeAheadMenu = function RegisteredTypeAheadMenu(_ref) {
@@ -161,7 +163,7 @@ var RegisteredTypeAheadMenu = exports.RegisteredTypeAheadMenu = function Registe
161
163
  ariaLabel: null,
162
164
  boundariesElement: popupsBoundariesElement,
163
165
  fitHeight: maxHeight,
164
- fitWidth: 340,
166
+ fitWidth: MENU_WIDTH,
165
167
  mountTo: popupsMountPoint,
166
168
  offset: POPUP_OFFSET,
167
169
  preventOverflow: true,
@@ -171,6 +173,7 @@ var RegisteredTypeAheadMenu = exports.RegisteredTypeAheadMenu = function Registe
171
173
  }, /*#__PURE__*/_react.default.createElement(_compiled.Box, {
172
174
  ref: menuRef,
173
175
  "data-registered-type-ahead-menu": "",
176
+ testId: "registered-type-ahead-menu",
174
177
  xcss: styles.menu
175
178
  }, /*#__PURE__*/_react.default.createElement(_TypeAheadProvider.TypeAheadProvider, {
176
179
  value: typeAheadContextValue
@@ -178,7 +181,7 @@ var RegisteredTypeAheadMenu = exports.RegisteredTypeAheadMenu = function Registe
178
181
  Item: surface.Item,
179
182
  listLabel: surface.listLabel,
180
183
  listId: listId,
181
- maxHeight: maxHeight,
184
+ maxHeight: Math.max(0, maxHeight - MENU_VERTICAL_PADDING),
182
185
  model: menuModel,
183
186
  onItemHover: setSelectedItemIndex,
184
187
  selectedItemIndex: selectedItemIndex
@@ -1,4 +1,4 @@
1
- /* TypeAheadMenuFooter.tsx generated by @compiled/babel-plugin v3.0.1 */
1
+ /* TypeAheadMenuFooter.tsx generated by @compiled/babel-plugin v3.0.2 */
2
2
  "use strict";
3
3
 
4
4
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
@@ -21,7 +21,7 @@ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r
21
21
  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; } } }; }
22
22
  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; } }
23
23
  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; }
24
- var LIST_WIDTH = 340;
24
+ var LIST_WIDTH = 320;
25
25
  var ESTIMATED_ROW_HEIGHT = 56;
26
26
  var MENU_FOOTER_HEIGHT = 48;
27
27
  var TypeAheadMenuRenderer = exports.TypeAheadMenuRenderer = function TypeAheadMenuRenderer(_ref) {
@@ -1,6 +1,7 @@
1
1
  ._2rko12b0{border-radius:var(--ds-radius-small,4px)}
2
2
  ._1rjc1b66{padding-block:var(--ds-space-050,4px)}._16qs130s{box-shadow:var(--ds-shadow-overlay,0 8px 9pt #1e1f2126,0 0 1px #1e1f214f)}
3
3
  ._18m915vq{overflow-y:hidden}
4
- ._1bsb5x59{width:340px}
4
+ ._1bsbnklw{width:20pc}
5
5
  ._1reo15vq{overflow-x:hidden}
6
- ._bfhk1bhr{background-color:var(--ds-surface-overlay,#fff)}
6
+ ._bfhk1bhr{background-color:var(--ds-surface-overlay,#fff)}
7
+ ._vchhusvi{box-sizing:border-box}
@@ -1,4 +1,4 @@
1
- /* RegisteredTypeAheadMenu.tsx generated by @compiled/babel-plugin v3.0.1 */
1
+ /* RegisteredTypeAheadMenu.tsx generated by @compiled/babel-plugin v3.0.2 */
2
2
  import "./RegisteredTypeAheadMenu.compiled.css";
3
3
  import { ax, ix } from "@compiled/react/runtime";
4
4
  import React, { useCallback, useId, useLayoutEffect, useMemo, useRef, useState } from 'react';
@@ -16,9 +16,11 @@ import { getTypeAheadItemId } from './getTypeAheadItemId';
16
16
  import { TypeAheadMenuRenderer } from './TypeAheadMenuRenderer';
17
17
  import { TypeAheadProvider } from './TypeAheadProvider';
18
18
  const styles = {
19
- menu: "_2rko12b0 _1reo15vq _18m915vq _1rjc1b66 _bfhk1bhr _16qs130s _1bsb5x59"
19
+ menu: "_2rko12b0 _1reo15vq _18m915vq _1rjc1b66 _bfhk1bhr _vchhusvi _16qs130s _1bsbnklw"
20
20
  };
21
- const DEFAULT_MENU_MAX_HEIGHT = 520;
21
+ const DEFAULT_MENU_MAX_HEIGHT = 480;
22
+ const MENU_VERTICAL_PADDING = 8;
23
+ const MENU_WIDTH = 320;
22
24
  const POPUP_OFFSET = [0, 8];
23
25
  const SECTION_OVERFLOW_LIMIT = 30;
24
26
  export const RegisteredTypeAheadMenu = ({
@@ -130,7 +132,7 @@ export const RegisteredTypeAheadMenu = ({
130
132
  ariaLabel: null,
131
133
  boundariesElement: popupsBoundariesElement,
132
134
  fitHeight: maxHeight,
133
- fitWidth: 340,
135
+ fitWidth: MENU_WIDTH,
134
136
  mountTo: popupsMountPoint,
135
137
  offset: POPUP_OFFSET,
136
138
  preventOverflow: true,
@@ -140,6 +142,7 @@ export const RegisteredTypeAheadMenu = ({
140
142
  }, /*#__PURE__*/React.createElement(Box, {
141
143
  ref: menuRef,
142
144
  "data-registered-type-ahead-menu": "",
145
+ testId: "registered-type-ahead-menu",
143
146
  xcss: styles.menu
144
147
  }, /*#__PURE__*/React.createElement(TypeAheadProvider, {
145
148
  value: typeAheadContextValue
@@ -147,7 +150,7 @@ export const RegisteredTypeAheadMenu = ({
147
150
  Item: surface.Item,
148
151
  listLabel: surface.listLabel,
149
152
  listId: listId,
150
- maxHeight: maxHeight,
153
+ maxHeight: Math.max(0, maxHeight - MENU_VERTICAL_PADDING),
151
154
  model: menuModel,
152
155
  onItemHover: setSelectedItemIndex,
153
156
  selectedItemIndex: selectedItemIndex
@@ -1,4 +1,4 @@
1
- /* TypeAheadMenuFooter.tsx generated by @compiled/babel-plugin v3.0.1 */
1
+ /* TypeAheadMenuFooter.tsx generated by @compiled/babel-plugin v3.0.2 */
2
2
  import "./TypeAheadMenuFooter.compiled.css";
3
3
  import { ax, ix } from "@compiled/react/runtime";
4
4
  import React from 'react';
@@ -8,7 +8,7 @@ import { createTypeAheadRowRenderer } from './createTypeAheadRowRenderer';
8
8
  import { getTypeAheadGlobalViewMoreId } from './getTypeAheadGlobalViewMoreId';
9
9
  import { PassThrough } from './PassThrough';
10
10
  import { TypeAheadMenuFooter } from './TypeAheadMenuFooter';
11
- const LIST_WIDTH = 340;
11
+ const LIST_WIDTH = 320;
12
12
  const ESTIMATED_ROW_HEIGHT = 56;
13
13
  const MENU_FOOTER_HEIGHT = 48;
14
14
  export const TypeAheadMenuRenderer = ({
@@ -1,6 +1,7 @@
1
1
  ._2rko12b0{border-radius:var(--ds-radius-small,4px)}
2
2
  ._1rjc1b66{padding-block:var(--ds-space-050,4px)}._16qs130s{box-shadow:var(--ds-shadow-overlay,0 8px 9pt #1e1f2126,0 0 1px #1e1f214f)}
3
3
  ._18m915vq{overflow-y:hidden}
4
- ._1bsb5x59{width:340px}
4
+ ._1bsbnklw{width:20pc}
5
5
  ._1reo15vq{overflow-x:hidden}
6
- ._bfhk1bhr{background-color:var(--ds-surface-overlay,#fff)}
6
+ ._bfhk1bhr{background-color:var(--ds-surface-overlay,#fff)}
7
+ ._vchhusvi{box-sizing:border-box}
@@ -1,4 +1,4 @@
1
- /* RegisteredTypeAheadMenu.tsx generated by @compiled/babel-plugin v3.0.1 */
1
+ /* RegisteredTypeAheadMenu.tsx generated by @compiled/babel-plugin v3.0.2 */
2
2
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
3
3
  import "./RegisteredTypeAheadMenu.compiled.css";
4
4
  import { ax, ix } from "@compiled/react/runtime";
@@ -17,9 +17,11 @@ import { getTypeAheadItemId } from './getTypeAheadItemId';
17
17
  import { TypeAheadMenuRenderer } from './TypeAheadMenuRenderer';
18
18
  import { TypeAheadProvider } from './TypeAheadProvider';
19
19
  var styles = {
20
- menu: "_2rko12b0 _1reo15vq _18m915vq _1rjc1b66 _bfhk1bhr _16qs130s _1bsb5x59"
20
+ menu: "_2rko12b0 _1reo15vq _18m915vq _1rjc1b66 _bfhk1bhr _vchhusvi _16qs130s _1bsbnklw"
21
21
  };
22
- var DEFAULT_MENU_MAX_HEIGHT = 520;
22
+ var DEFAULT_MENU_MAX_HEIGHT = 480;
23
+ var MENU_VERTICAL_PADDING = 8;
24
+ var MENU_WIDTH = 320;
23
25
  var POPUP_OFFSET = [0, 8];
24
26
  var SECTION_OVERFLOW_LIMIT = 30;
25
27
  export var RegisteredTypeAheadMenu = function RegisteredTypeAheadMenu(_ref) {
@@ -152,7 +154,7 @@ export var RegisteredTypeAheadMenu = function RegisteredTypeAheadMenu(_ref) {
152
154
  ariaLabel: null,
153
155
  boundariesElement: popupsBoundariesElement,
154
156
  fitHeight: maxHeight,
155
- fitWidth: 340,
157
+ fitWidth: MENU_WIDTH,
156
158
  mountTo: popupsMountPoint,
157
159
  offset: POPUP_OFFSET,
158
160
  preventOverflow: true,
@@ -162,6 +164,7 @@ export var RegisteredTypeAheadMenu = function RegisteredTypeAheadMenu(_ref) {
162
164
  }, /*#__PURE__*/React.createElement(Box, {
163
165
  ref: menuRef,
164
166
  "data-registered-type-ahead-menu": "",
167
+ testId: "registered-type-ahead-menu",
165
168
  xcss: styles.menu
166
169
  }, /*#__PURE__*/React.createElement(TypeAheadProvider, {
167
170
  value: typeAheadContextValue
@@ -169,7 +172,7 @@ export var RegisteredTypeAheadMenu = function RegisteredTypeAheadMenu(_ref) {
169
172
  Item: surface.Item,
170
173
  listLabel: surface.listLabel,
171
174
  listId: listId,
172
- maxHeight: maxHeight,
175
+ maxHeight: Math.max(0, maxHeight - MENU_VERTICAL_PADDING),
173
176
  model: menuModel,
174
177
  onItemHover: setSelectedItemIndex,
175
178
  selectedItemIndex: selectedItemIndex
@@ -1,4 +1,4 @@
1
- /* TypeAheadMenuFooter.tsx generated by @compiled/babel-plugin v3.0.1 */
1
+ /* TypeAheadMenuFooter.tsx generated by @compiled/babel-plugin v3.0.2 */
2
2
  import "./TypeAheadMenuFooter.compiled.css";
3
3
  import { ax, ix } from "@compiled/react/runtime";
4
4
  import React from 'react';
@@ -12,7 +12,7 @@ import { createTypeAheadRowRenderer } from './createTypeAheadRowRenderer';
12
12
  import { getTypeAheadGlobalViewMoreId } from './getTypeAheadGlobalViewMoreId';
13
13
  import { PassThrough } from './PassThrough';
14
14
  import { TypeAheadMenuFooter } from './TypeAheadMenuFooter';
15
- var LIST_WIDTH = 340;
15
+ var LIST_WIDTH = 320;
16
16
  var ESTIMATED_ROW_HEIGHT = 56;
17
17
  var MENU_FOOTER_HEIGHT = 48;
18
18
  export var TypeAheadMenuRenderer = function TypeAheadMenuRenderer(_ref) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-type-ahead",
3
- "version": "19.0.7",
3
+ "version": "19.0.8",
4
4
  "description": "Type-ahead plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -42,7 +42,7 @@
42
42
  "@atlaskit/primitives": "^22.5.0",
43
43
  "@atlaskit/prosemirror-history": "^1.2.0",
44
44
  "@atlaskit/prosemirror-input-rules": "^4.1.0",
45
- "@atlaskit/tmp-editor-statsig": "^195.0.0",
45
+ "@atlaskit/tmp-editor-statsig": "^196.0.0",
46
46
  "@atlaskit/tokens": "^17.0.0",
47
47
  "@atlaskit/visually-hidden": "^4.4.0",
48
48
  "@babel/runtime": "^7.0.0",
@@ -54,7 +54,7 @@
54
54
  "w3c-keyname": "^2.1.8"
55
55
  },
56
56
  "peerDependencies": {
57
- "@atlaskit/editor-common": "^122.6.0",
57
+ "@atlaskit/editor-common": "^122.7.0",
58
58
  "react": "^18.2.0 || ^19.2.0",
59
59
  "react-dom": "^18.2.0 || ^19.2.0",
60
60
  "react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"