@atlaskit/editor-plugin-type-ahead 1.11.0 → 1.11.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.
Files changed (33) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/cjs/pm-plugins/decorations.js +8 -1
  3. package/dist/cjs/ui/AssistiveText.js +6 -9
  4. package/dist/es2019/index.js +3 -0
  5. package/dist/es2019/pm-plugins/decorations.js +8 -1
  6. package/dist/esm/index.js +3 -0
  7. package/dist/esm/pm-plugins/decorations.js +8 -1
  8. package/dist/esm/ui/AssistiveText.js +6 -9
  9. package/dist/types/pm-plugins/commands/insert-type-ahead-item.d.ts +1 -1
  10. package/dist/types/pm-plugins/commands/update-list-items.d.ts +1 -2
  11. package/dist/types/pm-plugins/item-is-disabled.d.ts +1 -2
  12. package/dist/types/pm-plugins/utils.d.ts +2 -2
  13. package/dist/types/types/index.d.ts +2 -2
  14. package/dist/types/ui/InputQuery.d.ts +1 -1
  15. package/dist/types/ui/TypeAheadList.d.ts +2 -2
  16. package/dist/types/ui/TypeAheadListItem.d.ts +1 -2
  17. package/dist/types/ui/TypeAheadPopup.d.ts +2 -2
  18. package/dist/types/ui/hooks/use-item-insert.d.ts +2 -2
  19. package/dist/types/ui/hooks/use-load-items.d.ts +1 -1
  20. package/dist/types/ui/hooks/use-on-force-select.d.ts +1 -1
  21. package/dist/types-ts4.5/pm-plugins/commands/insert-type-ahead-item.d.ts +1 -1
  22. package/dist/types-ts4.5/pm-plugins/commands/update-list-items.d.ts +1 -2
  23. package/dist/types-ts4.5/pm-plugins/item-is-disabled.d.ts +1 -2
  24. package/dist/types-ts4.5/pm-plugins/utils.d.ts +2 -2
  25. package/dist/types-ts4.5/types/index.d.ts +2 -2
  26. package/dist/types-ts4.5/ui/InputQuery.d.ts +1 -1
  27. package/dist/types-ts4.5/ui/TypeAheadList.d.ts +2 -2
  28. package/dist/types-ts4.5/ui/TypeAheadListItem.d.ts +1 -2
  29. package/dist/types-ts4.5/ui/TypeAheadPopup.d.ts +2 -2
  30. package/dist/types-ts4.5/ui/hooks/use-item-insert.d.ts +2 -2
  31. package/dist/types-ts4.5/ui/hooks/use-load-items.d.ts +1 -1
  32. package/dist/types-ts4.5/ui/hooks/use-on-force-select.d.ts +1 -1
  33. package/package.json +4 -4
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @atlaskit/editor-plugin-type-ahead
2
2
 
3
+ ## 1.11.2
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 1.11.1
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies
14
+
3
15
  ## 1.11.0
4
16
 
5
17
  ### Minor Changes
@@ -42,7 +42,14 @@ var factoryDecorations = exports.factoryDecorations = function factoryDecoration
42
42
  var typeaheadComponent = document.createElement('mark');
43
43
  var stats = new _statsModifier.StatsModifier();
44
44
  var shouldFocusCursorInsideQuery = true;
45
- var deco = _view.Decoration.widget($cursor.pos, function (editorView, getDecorationPosition) {
45
+ var deco = _view.Decoration.widget($cursor.pos, function (editorView, getDecorationPositionUnsafe) {
46
+ var getDecorationPosition = function getDecorationPosition() {
47
+ try {
48
+ return getDecorationPositionUnsafe();
49
+ } catch (e) {
50
+ return undefined;
51
+ }
52
+ };
46
53
  typeaheadComponent.setAttribute('id', decorationId);
47
54
  typeaheadComponent.setAttribute('role', 'search');
48
55
  typeaheadComponent.dataset.typeAheadQuery = 'true';
@@ -9,10 +9,9 @@ exports.AssistiveTextNew = exports.AssistiveText = void 0;
9
9
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
10
10
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
11
11
  var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
12
- var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
13
- var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
14
12
  var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
15
13
  var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
14
+ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
16
15
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
17
16
  var _react = _interopRequireWildcard(require("react"));
18
17
  var _react2 = require("@emotion/react");
@@ -20,7 +19,7 @@ var _debounce = _interopRequireDefault(require("lodash/debounce"));
20
19
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
21
20
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
22
21
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
23
- function _createSuper(t) { var r = _isNativeReflectConstruct(); return function () { var e, o = (0, _getPrototypeOf2.default)(t); if (r) { var s = (0, _getPrototypeOf2.default)(this).constructor; e = Reflect.construct(o, arguments, s); } else e = o.apply(this, arguments); return (0, _possibleConstructorReturn2.default)(this, e); }; }
22
+ 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)); }
24
23
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /**
25
24
  * @jsxRuntime classic
26
25
  * @jsx jsx
@@ -39,16 +38,14 @@ var assitiveTextStyles = (0, _react2.css)({
39
38
  width: '1px'
40
39
  });
41
40
  var AssistveTextOld = /*#__PURE__*/function (_React$Component) {
42
- (0, _inherits2.default)(AssistveTextOld, _React$Component);
43
- var _super = _createSuper(AssistveTextOld);
44
41
  function AssistveTextOld() {
45
42
  var _this;
46
43
  (0, _classCallCheck2.default)(this, AssistveTextOld);
47
44
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
48
45
  args[_key] = arguments[_key];
49
46
  }
50
- _this = _super.call.apply(_super, [this].concat(args));
51
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "state", {
47
+ _this = _callSuper(this, AssistveTextOld, [].concat(args));
48
+ (0, _defineProperty2.default)(_this, "state", {
52
49
  bump: false,
53
50
  //when the same text needs to be read again, Hence it needs to be toggled between __status--A and __status--B
54
51
  debounced: false,
@@ -56,7 +53,8 @@ var AssistveTextOld = /*#__PURE__*/function (_React$Component) {
56
53
  });
57
54
  return _this;
58
55
  }
59
- (0, _createClass2.default)(AssistveTextOld, [{
56
+ (0, _inherits2.default)(AssistveTextOld, _React$Component);
57
+ return (0, _createClass2.default)(AssistveTextOld, [{
60
58
  key: "UNSAFE_componentWillMount",
61
59
  value: function UNSAFE_componentWillMount() {
62
60
  var _this2 = this;
@@ -118,7 +116,6 @@ var AssistveTextOld = /*#__PURE__*/function (_React$Component) {
118
116
  }, "".concat(!silenced && debounced && !bump ? assistiveText : '')));
119
117
  }
120
118
  }]);
121
- return AssistveTextOld;
122
119
  }(_react.default.Component);
123
120
  (0, _defineProperty2.default)(AssistveTextOld, "defaultProps", {
124
121
  statusDebounceMillis: 1400,
@@ -1 +1,4 @@
1
+ /* eslint-disable @atlaskit/editor/no-re-export */
2
+ // Entry file in package.json
3
+
1
4
  export { typeAheadPlugin } from './typeAheadPlugin';
@@ -41,7 +41,14 @@ export const factoryDecorations = ({
41
41
  const typeaheadComponent = document.createElement('mark');
42
42
  const stats = new StatsModifier();
43
43
  let shouldFocusCursorInsideQuery = true;
44
- const deco = Decoration.widget($cursor.pos, (editorView, getDecorationPosition) => {
44
+ const deco = Decoration.widget($cursor.pos, (editorView, getDecorationPositionUnsafe) => {
45
+ const getDecorationPosition = () => {
46
+ try {
47
+ return getDecorationPositionUnsafe();
48
+ } catch (e) {
49
+ return undefined;
50
+ }
51
+ };
45
52
  typeaheadComponent.setAttribute('id', decorationId);
46
53
  typeaheadComponent.setAttribute('role', 'search');
47
54
  typeaheadComponent.dataset.typeAheadQuery = 'true';
package/dist/esm/index.js CHANGED
@@ -1 +1,4 @@
1
+ /* eslint-disable @atlaskit/editor/no-re-export */
2
+ // Entry file in package.json
3
+
1
4
  export { typeAheadPlugin } from './typeAheadPlugin';
@@ -35,7 +35,14 @@ export var factoryDecorations = function factoryDecorations(_ref) {
35
35
  var typeaheadComponent = document.createElement('mark');
36
36
  var stats = new StatsModifier();
37
37
  var shouldFocusCursorInsideQuery = true;
38
- var deco = Decoration.widget($cursor.pos, function (editorView, getDecorationPosition) {
38
+ var deco = Decoration.widget($cursor.pos, function (editorView, getDecorationPositionUnsafe) {
39
+ var getDecorationPosition = function getDecorationPosition() {
40
+ try {
41
+ return getDecorationPositionUnsafe();
42
+ } catch (e) {
43
+ return undefined;
44
+ }
45
+ };
39
46
  typeaheadComponent.setAttribute('id', decorationId);
40
47
  typeaheadComponent.setAttribute('role', 'search');
41
48
  typeaheadComponent.dataset.typeAheadQuery = 'true';
@@ -1,12 +1,11 @@
1
1
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
2
  import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
3
3
  import _createClass from "@babel/runtime/helpers/createClass";
4
- import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
5
- import _inherits from "@babel/runtime/helpers/inherits";
6
4
  import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
7
5
  import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
6
+ import _inherits from "@babel/runtime/helpers/inherits";
8
7
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
9
- function _createSuper(t) { var r = _isNativeReflectConstruct(); return function () { var e, o = _getPrototypeOf(t); if (r) { var s = _getPrototypeOf(this).constructor; e = Reflect.construct(o, arguments, s); } else e = o.apply(this, arguments); return _possibleConstructorReturn(this, e); }; }
8
+ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
10
9
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
11
10
  /**
12
11
  * @jsxRuntime classic
@@ -33,16 +32,14 @@ var assitiveTextStyles = css({
33
32
  width: '1px'
34
33
  });
35
34
  var AssistveTextOld = /*#__PURE__*/function (_React$Component) {
36
- _inherits(AssistveTextOld, _React$Component);
37
- var _super = _createSuper(AssistveTextOld);
38
35
  function AssistveTextOld() {
39
36
  var _this;
40
37
  _classCallCheck(this, AssistveTextOld);
41
38
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
42
39
  args[_key] = arguments[_key];
43
40
  }
44
- _this = _super.call.apply(_super, [this].concat(args));
45
- _defineProperty(_assertThisInitialized(_this), "state", {
41
+ _this = _callSuper(this, AssistveTextOld, [].concat(args));
42
+ _defineProperty(_this, "state", {
46
43
  bump: false,
47
44
  //when the same text needs to be read again, Hence it needs to be toggled between __status--A and __status--B
48
45
  debounced: false,
@@ -50,7 +47,8 @@ var AssistveTextOld = /*#__PURE__*/function (_React$Component) {
50
47
  });
51
48
  return _this;
52
49
  }
53
- _createClass(AssistveTextOld, [{
50
+ _inherits(AssistveTextOld, _React$Component);
51
+ return _createClass(AssistveTextOld, [{
54
52
  key: "UNSAFE_componentWillMount",
55
53
  value: function UNSAFE_componentWillMount() {
56
54
  var _this2 = this;
@@ -112,7 +110,6 @@ var AssistveTextOld = /*#__PURE__*/function (_React$Component) {
112
110
  }, "".concat(!silenced && debounced && !bump ? assistiveText : '')));
113
111
  }
114
112
  }]);
115
- return AssistveTextOld;
116
113
  }(React.Component);
117
114
  _defineProperty(AssistveTextOld, "defaultProps", {
118
115
  statusDebounceMillis: 1400,
@@ -1,6 +1,6 @@
1
1
  import { SelectItemMode } from '@atlaskit/editor-common/type-ahead';
2
+ import type { TypeAheadHandler, TypeAheadItem } from '@atlaskit/editor-common/types';
2
3
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
3
- import type { TypeAheadHandler, TypeAheadItem } from '../../types';
4
4
  type Props = {
5
5
  item: TypeAheadItem;
6
6
  handler: TypeAheadHandler;
@@ -1,3 +1,2 @@
1
- import type { Command } from '@atlaskit/editor-common/types';
2
- import type { TypeAheadItem } from '../../types';
1
+ import type { Command, TypeAheadItem } from '@atlaskit/editor-common/types';
3
2
  export declare const updateListItem: (items: Array<TypeAheadItem>) => Command;
@@ -1,4 +1,3 @@
1
- import { type ExtractInjectionAPI } from '@atlaskit/editor-common/types';
1
+ import { type ExtractInjectionAPI, type TypeAheadItem } from '@atlaskit/editor-common/types';
2
2
  import { type TypeAheadPlugin } from '../typeAheadPluginType';
3
- import type { TypeAheadItem } from '../types';
4
3
  export declare const itemIsDisabled: (item: TypeAheadItem | undefined, api: ExtractInjectionAPI<TypeAheadPlugin> | undefined) => boolean;
@@ -1,9 +1,9 @@
1
1
  import type { IntlShape } from 'react-intl-next';
2
- import { type ExtractInjectionAPI } from '@atlaskit/editor-common/types';
2
+ import { type ExtractInjectionAPI, type TypeAheadItem } from '@atlaskit/editor-common/types';
3
3
  import type { EditorState } from '@atlaskit/editor-prosemirror/state';
4
4
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
5
5
  import { type TypeAheadPlugin } from '../typeAheadPluginType';
6
- import type { TypeAheadHandler, TypeAheadItem } from '../types';
6
+ import type { TypeAheadHandler } from '../types';
7
7
  export declare const isTypeAheadHandler: (handler: any) => handler is TypeAheadHandler;
8
8
  /** Is a typeahead plugin open? */
9
9
  export declare const isTypeAheadOpen: (editorState: EditorState) => boolean;
@@ -1,10 +1,10 @@
1
1
  import type { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
2
2
  import type { SelectItemMode } from '@atlaskit/editor-common/type-ahead';
3
- import type { TypeAheadForceSelect, TypeAheadHandler, TypeAheadInsert, TypeAheadItem, TypeAheadItemRenderProps, TypeAheadSelectItem, TypeAheadStats, UiComponentFactoryParams } from '@atlaskit/editor-common/types';
3
+ import type { TypeAheadHandler, TypeAheadItem, TypeAheadStats, UiComponentFactoryParams } from '@atlaskit/editor-common/types';
4
4
  import type { EditorState, ReadonlyTransaction, Transaction } from '@atlaskit/editor-prosemirror/state';
5
5
  import type { DecorationSet } from '@atlaskit/editor-prosemirror/view';
6
+ export type { TypeAheadHandler } from '@atlaskit/editor-common/types';
6
7
  import type { CloseSelectionOptions } from '../pm-plugins/constants';
7
- export type { TypeAheadStats, TypeAheadItemRenderProps, TypeAheadInsert, TypeAheadSelectItem, TypeAheadItem, TypeAheadForceSelect, TypeAheadHandler, };
8
8
  export type OnSelectItem = (props: {
9
9
  index: number;
10
10
  item: TypeAheadItem;
@@ -5,9 +5,9 @@
5
5
  import React from 'react';
6
6
  import { jsx } from '@emotion/react';
7
7
  import { SelectItemMode } from '@atlaskit/editor-common/type-ahead';
8
+ import type { TypeAheadItem } from '@atlaskit/editor-common/types';
8
9
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
9
10
  import { CloseSelectionOptions } from '../pm-plugins/constants';
10
- import type { TypeAheadItem } from '../types';
11
11
  type InputQueryProps = {
12
12
  triggerQueryPrefix: string;
13
13
  onQueryChange: (query: string) => void;
@@ -5,10 +5,10 @@
5
5
  import React from 'react';
6
6
  import type { WrappedComponentProps } from 'react-intl-next';
7
7
  import { SelectItemMode } from '@atlaskit/editor-common/type-ahead';
8
- import { type ExtractInjectionAPI } from '@atlaskit/editor-common/types';
8
+ import { type ExtractInjectionAPI, type TypeAheadItem } from '@atlaskit/editor-common/types';
9
9
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
10
10
  import { type TypeAheadPlugin } from '../typeAheadPluginType';
11
- import type { TypeAheadHandler, TypeAheadItem } from '../types';
11
+ import type { TypeAheadHandler } from '../types';
12
12
  export declare const TypeAheadList: React.FC<import("react-intl-next").WithIntlProps<{
13
13
  items: Array<TypeAheadItem>;
14
14
  selectedIndex: number;
@@ -5,9 +5,8 @@
5
5
  import React from 'react';
6
6
  import { jsx } from '@emotion/react';
7
7
  import { SelectItemMode } from '@atlaskit/editor-common/type-ahead';
8
- import { type ExtractInjectionAPI } from '@atlaskit/editor-common/types';
8
+ import { type ExtractInjectionAPI, type TypeAheadItem } from '@atlaskit/editor-common/types';
9
9
  import { type TypeAheadPlugin } from '../typeAheadPluginType';
10
- import type { TypeAheadItem } from '../types';
11
10
  export declare const itemIcon: import("@emotion/react").SerializedStyles;
12
11
  type TypeAheadListItemProps = {
13
12
  item: TypeAheadItem;
@@ -5,11 +5,11 @@
5
5
  import React from 'react';
6
6
  import { jsx } from '@emotion/react';
7
7
  import type { SelectItemMode } from '@atlaskit/editor-common/type-ahead';
8
- import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
8
+ import type { ExtractInjectionAPI, TypeAheadItem, TypeAheadHandler } from '@atlaskit/editor-common/types';
9
9
  import type { DecorationSet, EditorView } from '@atlaskit/editor-prosemirror/view';
10
10
  import { CloseSelectionOptions } from '../pm-plugins/constants';
11
11
  import type { TypeAheadPlugin } from '../typeAheadPluginType';
12
- import type { OnSelectItem, TypeAheadHandler, TypeAheadItem } from '../types';
12
+ import type { OnSelectItem } from '../types';
13
13
  type TypeAheadPopupProps = {
14
14
  triggerHandler: TypeAheadHandler;
15
15
  editorView: EditorView;
@@ -1,5 +1,5 @@
1
- import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
1
+ import type { ExtractInjectionAPI, TypeAheadHandler, TypeAheadItem } from '@atlaskit/editor-common/types';
2
2
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
3
3
  import type { TypeAheadPlugin } from '../../typeAheadPluginType';
4
- import type { OnInsertSelectedItem, OnItemMatch, OnTextInsert, TypeAheadHandler, TypeAheadItem } from '../../types';
4
+ import type { OnInsertSelectedItem, OnItemMatch, OnTextInsert } from '../../types';
5
5
  export declare const useItemInsert: (triggerHandler: TypeAheadHandler, editorView: EditorView, items: Array<TypeAheadItem>, api: ExtractInjectionAPI<TypeAheadPlugin> | undefined) => [OnInsertSelectedItem, OnTextInsert, OnItemMatch];
@@ -1,3 +1,3 @@
1
+ import type { TypeAheadHandler, TypeAheadItem } from '@atlaskit/editor-common/types';
1
2
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
2
- import type { TypeAheadHandler, TypeAheadItem } from '../../types';
3
3
  export declare const useLoadItems: (triggerHandler: TypeAheadHandler, editorView: EditorView, query: string) => Array<TypeAheadItem>;
@@ -1,5 +1,5 @@
1
+ import type { TypeAheadHandler, TypeAheadItem } from '@atlaskit/editor-common/types';
1
2
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
2
- import type { TypeAheadHandler, TypeAheadItem } from '../../types';
3
3
  type Props = {
4
4
  triggerHandler: TypeAheadHandler;
5
5
  items: Array<TypeAheadItem>;
@@ -1,6 +1,6 @@
1
1
  import { SelectItemMode } from '@atlaskit/editor-common/type-ahead';
2
+ import type { TypeAheadHandler, TypeAheadItem } from '@atlaskit/editor-common/types';
2
3
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
3
- import type { TypeAheadHandler, TypeAheadItem } from '../../types';
4
4
  type Props = {
5
5
  item: TypeAheadItem;
6
6
  handler: TypeAheadHandler;
@@ -1,3 +1,2 @@
1
- import type { Command } from '@atlaskit/editor-common/types';
2
- import type { TypeAheadItem } from '../../types';
1
+ import type { Command, TypeAheadItem } from '@atlaskit/editor-common/types';
3
2
  export declare const updateListItem: (items: Array<TypeAheadItem>) => Command;
@@ -1,4 +1,3 @@
1
- import { type ExtractInjectionAPI } from '@atlaskit/editor-common/types';
1
+ import { type ExtractInjectionAPI, type TypeAheadItem } from '@atlaskit/editor-common/types';
2
2
  import { type TypeAheadPlugin } from '../typeAheadPluginType';
3
- import type { TypeAheadItem } from '../types';
4
3
  export declare const itemIsDisabled: (item: TypeAheadItem | undefined, api: ExtractInjectionAPI<TypeAheadPlugin> | undefined) => boolean;
@@ -1,9 +1,9 @@
1
1
  import type { IntlShape } from 'react-intl-next';
2
- import { type ExtractInjectionAPI } from '@atlaskit/editor-common/types';
2
+ import { type ExtractInjectionAPI, type TypeAheadItem } from '@atlaskit/editor-common/types';
3
3
  import type { EditorState } from '@atlaskit/editor-prosemirror/state';
4
4
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
5
5
  import { type TypeAheadPlugin } from '../typeAheadPluginType';
6
- import type { TypeAheadHandler, TypeAheadItem } from '../types';
6
+ import type { TypeAheadHandler } from '../types';
7
7
  export declare const isTypeAheadHandler: (handler: any) => handler is TypeAheadHandler;
8
8
  /** Is a typeahead plugin open? */
9
9
  export declare const isTypeAheadOpen: (editorState: EditorState) => boolean;
@@ -1,10 +1,10 @@
1
1
  import type { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
2
2
  import type { SelectItemMode } from '@atlaskit/editor-common/type-ahead';
3
- import type { TypeAheadForceSelect, TypeAheadHandler, TypeAheadInsert, TypeAheadItem, TypeAheadItemRenderProps, TypeAheadSelectItem, TypeAheadStats, UiComponentFactoryParams } from '@atlaskit/editor-common/types';
3
+ import type { TypeAheadHandler, TypeAheadItem, TypeAheadStats, UiComponentFactoryParams } from '@atlaskit/editor-common/types';
4
4
  import type { EditorState, ReadonlyTransaction, Transaction } from '@atlaskit/editor-prosemirror/state';
5
5
  import type { DecorationSet } from '@atlaskit/editor-prosemirror/view';
6
+ export type { TypeAheadHandler } from '@atlaskit/editor-common/types';
6
7
  import type { CloseSelectionOptions } from '../pm-plugins/constants';
7
- export type { TypeAheadStats, TypeAheadItemRenderProps, TypeAheadInsert, TypeAheadSelectItem, TypeAheadItem, TypeAheadForceSelect, TypeAheadHandler, };
8
8
  export type OnSelectItem = (props: {
9
9
  index: number;
10
10
  item: TypeAheadItem;
@@ -5,9 +5,9 @@
5
5
  import React from 'react';
6
6
  import { jsx } from '@emotion/react';
7
7
  import { SelectItemMode } from '@atlaskit/editor-common/type-ahead';
8
+ import type { TypeAheadItem } from '@atlaskit/editor-common/types';
8
9
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
9
10
  import { CloseSelectionOptions } from '../pm-plugins/constants';
10
- import type { TypeAheadItem } from '../types';
11
11
  type InputQueryProps = {
12
12
  triggerQueryPrefix: string;
13
13
  onQueryChange: (query: string) => void;
@@ -5,10 +5,10 @@
5
5
  import React from 'react';
6
6
  import type { WrappedComponentProps } from 'react-intl-next';
7
7
  import { SelectItemMode } from '@atlaskit/editor-common/type-ahead';
8
- import { type ExtractInjectionAPI } from '@atlaskit/editor-common/types';
8
+ import { type ExtractInjectionAPI, type TypeAheadItem } from '@atlaskit/editor-common/types';
9
9
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
10
10
  import { type TypeAheadPlugin } from '../typeAheadPluginType';
11
- import type { TypeAheadHandler, TypeAheadItem } from '../types';
11
+ import type { TypeAheadHandler } from '../types';
12
12
  export declare const TypeAheadList: React.FC<import("react-intl-next").WithIntlProps<{
13
13
  items: Array<TypeAheadItem>;
14
14
  selectedIndex: number;
@@ -5,9 +5,8 @@
5
5
  import React from 'react';
6
6
  import { jsx } from '@emotion/react';
7
7
  import { SelectItemMode } from '@atlaskit/editor-common/type-ahead';
8
- import { type ExtractInjectionAPI } from '@atlaskit/editor-common/types';
8
+ import { type ExtractInjectionAPI, type TypeAheadItem } from '@atlaskit/editor-common/types';
9
9
  import { type TypeAheadPlugin } from '../typeAheadPluginType';
10
- import type { TypeAheadItem } from '../types';
11
10
  export declare const itemIcon: import("@emotion/react").SerializedStyles;
12
11
  type TypeAheadListItemProps = {
13
12
  item: TypeAheadItem;
@@ -5,11 +5,11 @@
5
5
  import React from 'react';
6
6
  import { jsx } from '@emotion/react';
7
7
  import type { SelectItemMode } from '@atlaskit/editor-common/type-ahead';
8
- import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
8
+ import type { ExtractInjectionAPI, TypeAheadItem, TypeAheadHandler } from '@atlaskit/editor-common/types';
9
9
  import type { DecorationSet, EditorView } from '@atlaskit/editor-prosemirror/view';
10
10
  import { CloseSelectionOptions } from '../pm-plugins/constants';
11
11
  import type { TypeAheadPlugin } from '../typeAheadPluginType';
12
- import type { OnSelectItem, TypeAheadHandler, TypeAheadItem } from '../types';
12
+ import type { OnSelectItem } from '../types';
13
13
  type TypeAheadPopupProps = {
14
14
  triggerHandler: TypeAheadHandler;
15
15
  editorView: EditorView;
@@ -1,7 +1,7 @@
1
- import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
1
+ import type { ExtractInjectionAPI, TypeAheadHandler, TypeAheadItem } from '@atlaskit/editor-common/types';
2
2
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
3
3
  import type { TypeAheadPlugin } from '../../typeAheadPluginType';
4
- import type { OnInsertSelectedItem, OnItemMatch, OnTextInsert, TypeAheadHandler, TypeAheadItem } from '../../types';
4
+ import type { OnInsertSelectedItem, OnItemMatch, OnTextInsert } from '../../types';
5
5
  export declare const useItemInsert: (triggerHandler: TypeAheadHandler, editorView: EditorView, items: Array<TypeAheadItem>, api: ExtractInjectionAPI<TypeAheadPlugin> | undefined) => [
6
6
  OnInsertSelectedItem,
7
7
  OnTextInsert,
@@ -1,3 +1,3 @@
1
+ import type { TypeAheadHandler, TypeAheadItem } from '@atlaskit/editor-common/types';
1
2
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
2
- import type { TypeAheadHandler, TypeAheadItem } from '../../types';
3
3
  export declare const useLoadItems: (triggerHandler: TypeAheadHandler, editorView: EditorView, query: string) => Array<TypeAheadItem>;
@@ -1,5 +1,5 @@
1
+ import type { TypeAheadHandler, TypeAheadItem } from '@atlaskit/editor-common/types';
1
2
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
2
- import type { TypeAheadHandler, TypeAheadItem } from '../../types';
3
3
  type Props = {
4
4
  triggerHandler: TypeAheadHandler;
5
5
  items: Array<TypeAheadItem>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-type-ahead",
3
- "version": "1.11.0",
3
+ "version": "1.11.2",
4
4
  "description": "Type-ahead plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -32,16 +32,16 @@
32
32
  },
33
33
  "dependencies": {
34
34
  "@atlaskit/adf-schema": "^46.1.0",
35
- "@atlaskit/editor-common": "^95.10.0",
35
+ "@atlaskit/editor-common": "^97.0.0",
36
36
  "@atlaskit/editor-plugin-analytics": "^1.10.0",
37
- "@atlaskit/editor-plugin-connectivity": "^1.0.0",
37
+ "@atlaskit/editor-plugin-connectivity": "^1.1.0",
38
38
  "@atlaskit/editor-prosemirror": "6.2.1",
39
39
  "@atlaskit/editor-shared-styles": "^3.2.0",
40
40
  "@atlaskit/menu": "^2.13.0",
41
41
  "@atlaskit/platform-feature-flags": "^0.3.0",
42
42
  "@atlaskit/prosemirror-input-rules": "^3.2.0",
43
43
  "@atlaskit/theme": "^14.0.0",
44
- "@atlaskit/tokens": "^2.4.0",
44
+ "@atlaskit/tokens": "^2.5.0",
45
45
  "@babel/runtime": "^7.0.0",
46
46
  "@emotion/react": "^11.7.1",
47
47
  "lodash": "^4.17.21",