@atlaskit/editor-plugin-type-ahead 17.0.9 → 17.1.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 +17 -0
- package/dist/cjs/pm-plugins/utils.js +4 -4
- package/dist/cjs/ui/InputQuery.js +2 -2
- package/dist/cjs/ui/TypeAheadList.js +1 -1
- package/dist/cjs/ui/TypeAheadMenu.js +2 -2
- package/dist/cjs/ui/TypeAheadPopup.js +5 -5
- package/dist/cjs/ui/WrapperTypeAhead.js +4 -4
- package/dist/cjs/ui/hooks/use-load-items.js +3 -3
- package/dist/es2019/pm-plugins/utils.js +1 -1
- package/dist/es2019/ui/InputQuery.js +1 -1
- package/dist/es2019/ui/TypeAheadList.js +1 -1
- package/dist/es2019/ui/TypeAheadMenu.js +1 -1
- package/dist/es2019/ui/TypeAheadPopup.js +1 -1
- package/dist/es2019/ui/WrapperTypeAhead.js +1 -1
- package/dist/es2019/ui/hooks/use-load-items.js +1 -1
- package/dist/esm/pm-plugins/utils.js +1 -1
- package/dist/esm/ui/InputQuery.js +1 -1
- package/dist/esm/ui/TypeAheadList.js +1 -1
- package/dist/esm/ui/TypeAheadMenu.js +1 -1
- package/dist/esm/ui/TypeAheadPopup.js +1 -1
- package/dist/esm/ui/WrapperTypeAhead.js +1 -1
- package/dist/esm/ui/hooks/use-load-items.js +1 -1
- package/package.json +14 -14
- package/report.api.md +0 -131
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-type-ahead
|
|
2
2
|
|
|
3
|
+
## 17.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`bd2c5b0112185`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/bd2c5b0112185) -
|
|
8
|
+
Remove stale API report artifacts from published Platform packages.
|
|
9
|
+
|
|
10
|
+
### Patch Changes
|
|
11
|
+
|
|
12
|
+
- Updated dependencies
|
|
13
|
+
|
|
14
|
+
## 17.0.10
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- Updated dependencies
|
|
19
|
+
|
|
3
20
|
## 17.0.9
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.skipForwardToSafeItem = exports.skipBackwardToSafeItem = exports.moveSelectedIndex = exports.isTypeAheadOpen = exports.isTypeAheadHandler = exports.isTypeAheadAllowed = exports.getTypeAheadQuery = exports.getTypeAheadListAriaLabels = exports.getTypeAheadHandler = exports.getPluginState = exports.findHandlerByTrigger = exports.findHandler = void 0;
|
|
7
7
|
var _typeAhead = require("@atlaskit/editor-common/type-ahead");
|
|
8
8
|
var _fg = require("@atlaskit/platform-feature-flags/fg");
|
|
9
|
-
var
|
|
9
|
+
var _editorExperiment = require("@atlaskit/tmp-editor-statsig/editor-experiment");
|
|
10
10
|
var _updateSelectedIndex = require("./commands/update-selected-index");
|
|
11
11
|
var _itemIsDisabled = require("./item-is-disabled");
|
|
12
12
|
var _key = require("./key");
|
|
@@ -60,7 +60,7 @@ var skipForwardToSafeItem = exports.skipForwardToSafeItem = function skipForward
|
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
// We got to the end of the list ^, now try from the start
|
|
63
|
-
if ((0,
|
|
63
|
+
if ((0, _editorExperiment.editorExperiment)('platform_editor_offline_editing_web', true)) {
|
|
64
64
|
for (var _idx = 0; _idx < nextIndex; _idx++) {
|
|
65
65
|
if (!itemIsDisabled(_idx)) {
|
|
66
66
|
return _idx;
|
|
@@ -84,7 +84,7 @@ var skipBackwardToSafeItem = exports.skipBackwardToSafeItem = function skipBackw
|
|
|
84
84
|
}
|
|
85
85
|
|
|
86
86
|
// We got to the start of the list ^, now try from the end
|
|
87
|
-
if ((0,
|
|
87
|
+
if ((0, _editorExperiment.editorExperiment)('platform_editor_offline_editing_web', true)) {
|
|
88
88
|
for (var _idx2 = listSize; _idx2 > nextIndex; _idx2--) {
|
|
89
89
|
if (!itemIsDisabled(_idx2)) {
|
|
90
90
|
return _idx2;
|
|
@@ -168,7 +168,7 @@ var getTypeAheadListAriaLabels = exports.getTypeAheadListAriaLabels = function g
|
|
|
168
168
|
case '@':
|
|
169
169
|
{
|
|
170
170
|
var _item$mention, _item$mention2, _item$mention3;
|
|
171
|
-
var description = (0,
|
|
171
|
+
var description = (0, _editorExperiment.editorExperiment)('platform_editor_agent_mentions', true) && (0, _fg.fg)('platform_editor_mention_typeahead_profilecard') ? item === null || item === void 0 || (_item$mention = item.mention) === null || _item$mention === void 0 ? void 0 : _item$mention.description : undefined;
|
|
172
172
|
var name = (item === null || item === void 0 || (_item$mention2 = item.mention) === null || _item$mention2 === void 0 ? void 0 : _item$mention2.name) || '';
|
|
173
173
|
var shortName = (item === null || item === void 0 || (_item$mention3 = item.mention) === null || _item$mention3 === void 0 ? void 0 : _item$mention3.mentionName) || '';
|
|
174
174
|
return {
|
|
@@ -15,7 +15,7 @@ var _browser = require("@atlaskit/editor-common/browser");
|
|
|
15
15
|
var _typeAhead = require("@atlaskit/editor-common/type-ahead");
|
|
16
16
|
var _ui = require("@atlaskit/editor-common/ui");
|
|
17
17
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
18
|
-
var
|
|
18
|
+
var _editorExperiment = require("@atlaskit/tmp-editor-statsig/editor-experiment");
|
|
19
19
|
var _constants = require("../pm-plugins/constants");
|
|
20
20
|
var _utils = require("../pm-plugins/utils");
|
|
21
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); }
|
|
@@ -97,7 +97,7 @@ var InputQuery = exports.InputQuery = /*#__PURE__*/_react.default.memo(function
|
|
|
97
97
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
98
98
|
query = _useState2[0],
|
|
99
99
|
setQuery = _useState2[1];
|
|
100
|
-
var isEditorControlsEnabled = (0,
|
|
100
|
+
var isEditorControlsEnabled = (0, _editorExperiment.editorExperiment)('platform_editor_controls', 'variant1');
|
|
101
101
|
var cleanedInputContent = (0, _react.useCallback)(function () {
|
|
102
102
|
var _ref$current;
|
|
103
103
|
var raw = ((_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.textContent) || '';
|
|
@@ -549,6 +549,6 @@ var TypeAheadListComponent = /*#__PURE__*/_react.default.memo(function (_ref4) {
|
|
|
549
549
|
})));
|
|
550
550
|
});
|
|
551
551
|
|
|
552
|
-
// eslint-disable-next-line @typescript-eslint/
|
|
552
|
+
// eslint-disable-next-line @typescript-eslint/no-restricted-types
|
|
553
553
|
var TypeAheadList = exports.TypeAheadList = (0, _reactIntl.injectIntl)(TypeAheadListComponent);
|
|
554
554
|
TypeAheadList.displayName = 'TypeAheadList';
|
|
@@ -9,7 +9,7 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/sli
|
|
|
9
9
|
var _react = _interopRequireDefault(require("react"));
|
|
10
10
|
var _typeAhead = require("@atlaskit/editor-common/type-ahead");
|
|
11
11
|
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
12
|
-
var
|
|
12
|
+
var _editorExperiment = require("@atlaskit/tmp-editor-statsig/editor-experiment");
|
|
13
13
|
var _updateSelectedIndex = require("../pm-plugins/commands/update-selected-index");
|
|
14
14
|
var _useItemInsert3 = require("./hooks/use-item-insert");
|
|
15
15
|
var _TypeAheadPopup = require("./TypeAheadPopup");
|
|
@@ -85,7 +85,7 @@ var TypeAheadMenu = exports.TypeAheadMenu = /*#__PURE__*/_react.default.memo(fun
|
|
|
85
85
|
// @ts-ignore
|
|
86
86
|
var openElementBrowserModal = triggerHandler === null || triggerHandler === void 0 ? void 0 : triggerHandler.openElementBrowserModal;
|
|
87
87
|
var showMoreOptionsButton = false;
|
|
88
|
-
if ((0,
|
|
88
|
+
if ((0, _editorExperiment.editorExperiment)('platform_editor_controls', 'variant1')) {
|
|
89
89
|
showMoreOptionsButton = !!(triggerHandler !== null && triggerHandler !== void 0 && triggerHandler.getMoreOptionsButtonConfig);
|
|
90
90
|
}
|
|
91
91
|
var emptyItem = _react.default.useMemo(function () {
|
|
@@ -17,7 +17,7 @@ var _ui = require("@atlaskit/editor-common/ui");
|
|
|
17
17
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
18
18
|
var _featureGates = _interopRequireDefault(require("@atlaskit/feature-gate-js-client/feature-gates"));
|
|
19
19
|
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
20
|
-
var
|
|
20
|
+
var _editorExperiment = require("@atlaskit/tmp-editor-statsig/editor-experiment");
|
|
21
21
|
var _analytics2 = require("../pm-plugins/analytics");
|
|
22
22
|
var _constants = require("../pm-plugins/constants");
|
|
23
23
|
var _utils = require("../pm-plugins/utils");
|
|
@@ -93,7 +93,7 @@ var TypeAheadPopup = exports.TypeAheadPopup = /*#__PURE__*/_react.default.memo(f
|
|
|
93
93
|
}),
|
|
94
94
|
moreElementsInQuickInsertView = _useSharedPluginState.moreElementsInQuickInsertView;
|
|
95
95
|
var moreElementsInQuickInsertViewEnabled = moreElementsInQuickInsertView && triggerHandler.id === _typeAhead.TypeAheadAvailableNodes.QUICK_INSERT;
|
|
96
|
-
var isEditorControlsEnabled = (0,
|
|
96
|
+
var isEditorControlsEnabled = (0, _editorExperiment.editorExperiment)('platform_editor_controls', 'variant1');
|
|
97
97
|
var defaultMenuHeight = (0, _react.useMemo)(function () {
|
|
98
98
|
return moreElementsInQuickInsertViewEnabled ? DEFAULT_TYPEAHEAD_MENU_HEIGHT_NEW : DEFAULT_TYPEAHEAD_MENU_HEIGHT;
|
|
99
99
|
}, [moreElementsInQuickInsertViewEnabled]);
|
|
@@ -305,7 +305,7 @@ var TypeAheadPopup = exports.TypeAheadPopup = /*#__PURE__*/_react.default.memo(f
|
|
|
305
305
|
var onMoreOptionsClicked = (0, _react.useCallback)(function () {
|
|
306
306
|
if (
|
|
307
307
|
// eslint-disable-next-line @atlaskit/platform/no-preconditioning
|
|
308
|
-
openElementBrowserModal && (0,
|
|
308
|
+
openElementBrowserModal && (0, _editorExperiment.editorExperiment)('platform_editor_controls', 'variant1') && triggerHandler.id === _typeAhead.TypeAheadAvailableNodes.QUICK_INSERT) {
|
|
309
309
|
activityStateRef.current = {
|
|
310
310
|
inputMethod: _analytics.INPUT_METHOD.MOUSE,
|
|
311
311
|
closeAction: _analytics.ACTION.VIEW_MORE,
|
|
@@ -327,7 +327,7 @@ var TypeAheadPopup = exports.TypeAheadPopup = /*#__PURE__*/_react.default.memo(f
|
|
|
327
327
|
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
328
328
|
,
|
|
329
329
|
onUnmount: function onUnmount() {
|
|
330
|
-
if (selectedIndex > -1 && (0,
|
|
330
|
+
if (selectedIndex > -1 && (0, _editorExperiment.editorExperiment)('platform_editor_controls', 'variant1')) {
|
|
331
331
|
// if selectedIndex is -1, it means that the user has not selected any item
|
|
332
332
|
// will be handled by WrapperTypeAhead
|
|
333
333
|
(0, _analytics2.fireTypeAheadClosedAnalyticsEvent)(api, activityStateRef.current.closeAction || _analytics.ACTION.CANCELLED, !isEmptyQuery, activityStateRef.current.inputMethod || _analytics.INPUT_METHOD.MOUSE, activityStateRef.current.invocationMethod);
|
|
@@ -358,7 +358,7 @@ var TypeAheadPopup = exports.TypeAheadPopup = /*#__PURE__*/_react.default.memo(f
|
|
|
358
358
|
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
359
359
|
,
|
|
360
360
|
onItemClick: function onItemClick(mode, index, inputMethod) {
|
|
361
|
-
if ((0,
|
|
361
|
+
if ((0, _editorExperiment.editorExperiment)('platform_editor_controls', 'variant1')) {
|
|
362
362
|
activityStateRef.current = {
|
|
363
363
|
inputMethod: inputMethod || null,
|
|
364
364
|
closeAction: _analytics.ACTION.INSERTED,
|
|
@@ -12,7 +12,7 @@ var _reactIntl = require("react-intl");
|
|
|
12
12
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
13
13
|
var _typeAhead = require("@atlaskit/editor-common/type-ahead");
|
|
14
14
|
var _fg = require("@atlaskit/platform-feature-flags/fg");
|
|
15
|
-
var
|
|
15
|
+
var _editorExperiment = require("@atlaskit/tmp-editor-statsig/editor-experiment");
|
|
16
16
|
var _expVal = require("@atlaskit/tmp-editor-statsig/expVal");
|
|
17
17
|
var _analytics2 = require("../pm-plugins/analytics");
|
|
18
18
|
var _updateQuery = require("../pm-plugins/commands/update-query");
|
|
@@ -41,7 +41,7 @@ var WrapperTypeAhead = exports.WrapperTypeAhead = /*#__PURE__*/_react.default.me
|
|
|
41
41
|
// @ts-ignore
|
|
42
42
|
var openElementBrowserModal = triggerHandler === null || triggerHandler === void 0 ? void 0 : triggerHandler.openElementBrowserModal;
|
|
43
43
|
var showMoreOptionsButton = false;
|
|
44
|
-
if ((0,
|
|
44
|
+
if ((0, _editorExperiment.editorExperiment)('platform_editor_controls', 'variant1')) {
|
|
45
45
|
showMoreOptionsButton = !!(triggerHandler !== null && triggerHandler !== void 0 && triggerHandler.getMoreOptionsButtonConfig);
|
|
46
46
|
}
|
|
47
47
|
var intl = (0, _reactIntl.useIntl)();
|
|
@@ -92,7 +92,7 @@ var WrapperTypeAhead = exports.WrapperTypeAhead = /*#__PURE__*/_react.default.me
|
|
|
92
92
|
addPrefixTrigger = _ref2.addPrefixTrigger,
|
|
93
93
|
text = _ref2.text,
|
|
94
94
|
forceFocusOnEditor = _ref2.forceFocusOnEditor;
|
|
95
|
-
if ((0,
|
|
95
|
+
if ((0, _editorExperiment.editorExperiment)('platform_editor_controls', 'variant1')) {
|
|
96
96
|
var _getPluginState;
|
|
97
97
|
(0, _analytics2.fireTypeAheadClosedAnalyticsEvent)(api, _analytics.ACTION.CANCELLED, !!queryRef.current, _analytics.INPUT_METHOD.KEYBOARD, (_getPluginState = (0, _utils.getPluginState)(editorView.state)) === null || _getPluginState === void 0 ? void 0 : _getPluginState.inputMethod);
|
|
98
98
|
}
|
|
@@ -124,7 +124,7 @@ var WrapperTypeAhead = exports.WrapperTypeAhead = /*#__PURE__*/_react.default.me
|
|
|
124
124
|
if (safeSelectedIndex === -1) {
|
|
125
125
|
return;
|
|
126
126
|
}
|
|
127
|
-
if ((0,
|
|
127
|
+
if ((0, _editorExperiment.editorExperiment)('platform_editor_controls', 'variant1')) {
|
|
128
128
|
var _getPluginState2;
|
|
129
129
|
(0, _analytics2.fireTypeAheadClosedAnalyticsEvent)(api, _analytics.ACTION.INSERTED, !!queryRef.current, _analytics.INPUT_METHOD.KEYBOARD, (_getPluginState2 = (0, _utils.getPluginState)(editorView.state)) === null || _getPluginState2 === void 0 ? void 0 : _getPluginState2.inputMethod);
|
|
130
130
|
}
|
|
@@ -8,7 +8,7 @@ exports.useLoadItems = void 0;
|
|
|
8
8
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
9
9
|
var _react = require("react");
|
|
10
10
|
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
11
|
-
var
|
|
11
|
+
var _editorExperiment = require("@atlaskit/tmp-editor-statsig/editor-experiment");
|
|
12
12
|
var _clearListError = require("../../pm-plugins/commands/clear-list-error");
|
|
13
13
|
var _updateListError = require("../../pm-plugins/commands/update-list-error");
|
|
14
14
|
var _updateListItems = require("../../pm-plugins/commands/update-list-items");
|
|
@@ -38,7 +38,7 @@ var useLoadItems = exports.useLoadItems = function useLoadItems(triggerHandler,
|
|
|
38
38
|
editorState: editorView.state
|
|
39
39
|
};
|
|
40
40
|
var view = editorViewRef.current;
|
|
41
|
-
if ((0,
|
|
41
|
+
if ((0, _editorExperiment.editorExperiment)('platform_editor_offline_editing_web', true)) {
|
|
42
42
|
// Clear any existing error state before making a new request
|
|
43
43
|
queueMicrotask(function () {
|
|
44
44
|
api === null || api === void 0 || api.core.actions.execute((0, _clearListError.clearListError)());
|
|
@@ -83,7 +83,7 @@ var useLoadItems = exports.useLoadItems = function useLoadItems(triggerHandler,
|
|
|
83
83
|
// `.catch((e) => updateListError(e)(...))` path.
|
|
84
84
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
85
85
|
var handleError = function handleError(e) {
|
|
86
|
-
if ((0,
|
|
86
|
+
if ((0, _editorExperiment.editorExperiment)('platform_editor_offline_editing_web', true)) {
|
|
87
87
|
if (e) {
|
|
88
88
|
if (componentIsMounted.current) {
|
|
89
89
|
setItems(EMPTY_LIST_ITEM);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { TypeAheadAvailableNodes, typeAheadListMessages } from '@atlaskit/editor-common/type-ahead';
|
|
2
2
|
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
3
|
-
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/
|
|
3
|
+
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/editor-experiment';
|
|
4
4
|
import { updateSelectedIndex } from './commands/update-selected-index';
|
|
5
5
|
import { itemIsDisabled } from './item-is-disabled';
|
|
6
6
|
import { pluginKey as typeAheadPluginKey } from './key';
|
|
@@ -12,7 +12,7 @@ import { getBrowserInfo } from '@atlaskit/editor-common/browser';
|
|
|
12
12
|
import { SelectItemMode, typeAheadListMessages } from '@atlaskit/editor-common/type-ahead';
|
|
13
13
|
import { AssistiveText } from '@atlaskit/editor-common/ui';
|
|
14
14
|
import { blockNodesVerticalMargin } from '@atlaskit/editor-shared-styles';
|
|
15
|
-
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/
|
|
15
|
+
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/editor-experiment';
|
|
16
16
|
import { CloseSelectionOptions, TYPE_AHEAD_DECORATION_ELEMENT_ID, TYPE_AHEAD_POPUP_CONTENT_CLASS } from '../pm-plugins/constants';
|
|
17
17
|
import { getPluginState } from '../pm-plugins/utils';
|
|
18
18
|
const querySpanStyles = css({
|
|
@@ -521,6 +521,6 @@ const TypeAheadListComponent = /*#__PURE__*/React.memo(({
|
|
|
521
521
|
})));
|
|
522
522
|
});
|
|
523
523
|
|
|
524
|
-
// eslint-disable-next-line @typescript-eslint/
|
|
524
|
+
// eslint-disable-next-line @typescript-eslint/no-restricted-types
|
|
525
525
|
export const TypeAheadList = injectIntl(TypeAheadListComponent);
|
|
526
526
|
TypeAheadList.displayName = 'TypeAheadList';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { SelectItemMode } from '@atlaskit/editor-common/type-ahead';
|
|
3
3
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
4
|
-
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/
|
|
4
|
+
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/editor-experiment';
|
|
5
5
|
import { updateSelectedIndex } from '../pm-plugins/commands/update-selected-index';
|
|
6
6
|
import { useItemInsert } from './hooks/use-item-insert';
|
|
7
7
|
import { TypeAheadPopup } from './TypeAheadPopup';
|
|
@@ -14,7 +14,7 @@ import { findOverflowScrollParent, Popup } from '@atlaskit/editor-common/ui';
|
|
|
14
14
|
import { akEditorFloatingDialogZIndex } from '@atlaskit/editor-shared-styles';
|
|
15
15
|
import FeatureGates from '@atlaskit/feature-gate-js-client/feature-gates';
|
|
16
16
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
17
|
-
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/
|
|
17
|
+
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/editor-experiment';
|
|
18
18
|
import { fireTypeAheadClosedAnalyticsEvent } from '../pm-plugins/analytics';
|
|
19
19
|
import { CloseSelectionOptions, TYPE_AHEAD_DECORATION_DATA_ATTRIBUTE, TYPE_AHEAD_POPUP_CONTENT_CLASS } from '../pm-plugins/constants';
|
|
20
20
|
import { getPluginState } from '../pm-plugins/utils';
|
|
@@ -3,7 +3,7 @@ import { useIntl } from 'react-intl';
|
|
|
3
3
|
import { ACTION, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
4
4
|
import { SelectItemMode } from '@atlaskit/editor-common/type-ahead';
|
|
5
5
|
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
6
|
-
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/
|
|
6
|
+
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/editor-experiment';
|
|
7
7
|
import { expVal } from '@atlaskit/tmp-editor-statsig/expVal';
|
|
8
8
|
import { fireTypeAheadClosedAnalyticsEvent } from '../pm-plugins/analytics';
|
|
9
9
|
import { updateQuery } from '../pm-plugins/commands/update-query';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useEffect, useRef, useState } from 'react';
|
|
2
2
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
3
|
-
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/
|
|
3
|
+
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/editor-experiment';
|
|
4
4
|
import { clearListError } from '../../pm-plugins/commands/clear-list-error';
|
|
5
5
|
import { updateListError } from '../../pm-plugins/commands/update-list-error';
|
|
6
6
|
import { updateListItem } from '../../pm-plugins/commands/update-list-items';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { TypeAheadAvailableNodes, typeAheadListMessages } from '@atlaskit/editor-common/type-ahead';
|
|
2
2
|
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
3
|
-
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/
|
|
3
|
+
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/editor-experiment';
|
|
4
4
|
import { updateSelectedIndex } from './commands/update-selected-index';
|
|
5
5
|
import { itemIsDisabled } from './item-is-disabled';
|
|
6
6
|
import { pluginKey as typeAheadPluginKey } from './key';
|
|
@@ -13,7 +13,7 @@ import { getBrowserInfo } from '@atlaskit/editor-common/browser';
|
|
|
13
13
|
import { SelectItemMode, typeAheadListMessages } from '@atlaskit/editor-common/type-ahead';
|
|
14
14
|
import { AssistiveText } from '@atlaskit/editor-common/ui';
|
|
15
15
|
import { blockNodesVerticalMargin } from '@atlaskit/editor-shared-styles';
|
|
16
|
-
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/
|
|
16
|
+
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/editor-experiment';
|
|
17
17
|
import { CloseSelectionOptions, TYPE_AHEAD_DECORATION_ELEMENT_ID, TYPE_AHEAD_POPUP_CONTENT_CLASS } from '../pm-plugins/constants';
|
|
18
18
|
import { getPluginState } from '../pm-plugins/utils';
|
|
19
19
|
var querySpanStyles = css({
|
|
@@ -540,6 +540,6 @@ var TypeAheadListComponent = /*#__PURE__*/React.memo(function (_ref4) {
|
|
|
540
540
|
})));
|
|
541
541
|
});
|
|
542
542
|
|
|
543
|
-
// eslint-disable-next-line @typescript-eslint/
|
|
543
|
+
// eslint-disable-next-line @typescript-eslint/no-restricted-types
|
|
544
544
|
export var TypeAheadList = injectIntl(TypeAheadListComponent);
|
|
545
545
|
TypeAheadList.displayName = 'TypeAheadList';
|
|
@@ -2,7 +2,7 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { SelectItemMode } from '@atlaskit/editor-common/type-ahead';
|
|
4
4
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
5
|
-
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/
|
|
5
|
+
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/editor-experiment';
|
|
6
6
|
import { updateSelectedIndex } from '../pm-plugins/commands/update-selected-index';
|
|
7
7
|
import { useItemInsert } from './hooks/use-item-insert';
|
|
8
8
|
import { TypeAheadPopup } from './TypeAheadPopup';
|
|
@@ -15,7 +15,7 @@ import { findOverflowScrollParent, Popup } from '@atlaskit/editor-common/ui';
|
|
|
15
15
|
import { akEditorFloatingDialogZIndex } from '@atlaskit/editor-shared-styles';
|
|
16
16
|
import FeatureGates from '@atlaskit/feature-gate-js-client/feature-gates';
|
|
17
17
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
18
|
-
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/
|
|
18
|
+
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/editor-experiment';
|
|
19
19
|
import { fireTypeAheadClosedAnalyticsEvent } from '../pm-plugins/analytics';
|
|
20
20
|
import { CloseSelectionOptions, TYPE_AHEAD_DECORATION_DATA_ATTRIBUTE, TYPE_AHEAD_POPUP_CONTENT_CLASS } from '../pm-plugins/constants';
|
|
21
21
|
import { getPluginState } from '../pm-plugins/utils';
|
|
@@ -4,7 +4,7 @@ import { useIntl } from 'react-intl';
|
|
|
4
4
|
import { ACTION, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
5
5
|
import { SelectItemMode } from '@atlaskit/editor-common/type-ahead';
|
|
6
6
|
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
7
|
-
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/
|
|
7
|
+
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/editor-experiment';
|
|
8
8
|
import { expVal } from '@atlaskit/tmp-editor-statsig/expVal';
|
|
9
9
|
import { fireTypeAheadClosedAnalyticsEvent } from '../pm-plugins/analytics';
|
|
10
10
|
import { updateQuery } from '../pm-plugins/commands/update-query';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
2
|
import { useEffect, useRef, useState } from 'react';
|
|
3
3
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
4
|
-
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/
|
|
4
|
+
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/editor-experiment';
|
|
5
5
|
import { clearListError } from '../../pm-plugins/commands/clear-list-error';
|
|
6
6
|
import { updateListError } from '../../pm-plugins/commands/update-list-error';
|
|
7
7
|
import { updateListItem } from '../../pm-plugins/commands/update-list-items';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-type-ahead",
|
|
3
|
-
"version": "17.0
|
|
3
|
+
"version": "17.1.0",
|
|
4
4
|
"description": "Type-ahead plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -23,27 +23,27 @@
|
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"@atlaskit/adf-schema": "^57.2.0",
|
|
25
25
|
"@atlaskit/css": "^1.1.0",
|
|
26
|
-
"@atlaskit/editor-plugin-analytics": "^16.
|
|
26
|
+
"@atlaskit/editor-plugin-analytics": "^16.1.0",
|
|
27
27
|
"@atlaskit/editor-plugin-connectivity": "^16.0.0",
|
|
28
|
-
"@atlaskit/editor-plugin-context-panel": "^18.
|
|
28
|
+
"@atlaskit/editor-plugin-context-panel": "^18.1.0",
|
|
29
29
|
"@atlaskit/editor-plugin-metrics": "^17.0.0",
|
|
30
30
|
"@atlaskit/editor-plugin-ui-control-registry": "^10.0.0",
|
|
31
31
|
"@atlaskit/editor-prosemirror": "^8.0.0",
|
|
32
|
-
"@atlaskit/editor-shared-styles": "^4.
|
|
32
|
+
"@atlaskit/editor-shared-styles": "^4.1.0",
|
|
33
33
|
"@atlaskit/editor-ui-control-model": "^2.9.0",
|
|
34
34
|
"@atlaskit/feature-gate-js-client": "^6.0.0",
|
|
35
|
-
"@atlaskit/heading": "^7.
|
|
36
|
-
"@atlaskit/icon": "^37.
|
|
35
|
+
"@atlaskit/heading": "^7.2.0",
|
|
36
|
+
"@atlaskit/icon": "^37.6.0",
|
|
37
37
|
"@atlaskit/insm": "^3.0.0",
|
|
38
|
-
"@atlaskit/menu": "^10.
|
|
38
|
+
"@atlaskit/menu": "^10.2.0",
|
|
39
39
|
"@atlaskit/platform-feature-experiments": "^0.3.0",
|
|
40
|
-
"@atlaskit/platform-feature-flags": "^2.
|
|
41
|
-
"@atlaskit/primitives": "^22.
|
|
40
|
+
"@atlaskit/platform-feature-flags": "^2.2.0",
|
|
41
|
+
"@atlaskit/primitives": "^22.5.0",
|
|
42
42
|
"@atlaskit/prosemirror-history": "^1.2.0",
|
|
43
|
-
"@atlaskit/prosemirror-input-rules": "^4.
|
|
44
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
45
|
-
"@atlaskit/tokens": "^16.
|
|
46
|
-
"@atlaskit/visually-hidden": "^4.
|
|
43
|
+
"@atlaskit/prosemirror-input-rules": "^4.1.0",
|
|
44
|
+
"@atlaskit/tmp-editor-statsig": "^168.0.0",
|
|
45
|
+
"@atlaskit/tokens": "^16.10.0",
|
|
46
|
+
"@atlaskit/visually-hidden": "^4.4.0",
|
|
47
47
|
"@babel/runtime": "^7.0.0",
|
|
48
48
|
"@emotion/react": "^11.7.1",
|
|
49
49
|
"lodash": "^4.17.21",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"w3c-keyname": "^2.1.8"
|
|
54
54
|
},
|
|
55
55
|
"peerDependencies": {
|
|
56
|
-
"@atlaskit/editor-common": "^120.
|
|
56
|
+
"@atlaskit/editor-common": "^120.9.0",
|
|
57
57
|
"react": "^18.2.0 || ^19.2.0",
|
|
58
58
|
"react-dom": "^18.2.0 || ^19.2.0",
|
|
59
59
|
"react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
|
package/report.api.md
DELETED
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
<!-- API Report Version: 2.3 -->
|
|
2
|
-
|
|
3
|
-
## API Report File for "@atlaskit/editor-plugin-type-ahead"
|
|
4
|
-
|
|
5
|
-
> Do not edit this file. This report is auto-generated using
|
|
6
|
-
> [API Extractor](https://api-extractor.com/).
|
|
7
|
-
> [Learn more about API reports](https://hello.atlassian.net/wiki/spaces/UR/pages/1825484529/Package+API+Reports)
|
|
8
|
-
|
|
9
|
-
### Table of contents
|
|
10
|
-
|
|
11
|
-
- [Main Entry Types](#main-entry-types)
|
|
12
|
-
- [Peer Dependencies](#peer-dependencies)
|
|
13
|
-
|
|
14
|
-
### Main Entry Types
|
|
15
|
-
|
|
16
|
-
<!--SECTION START: Main Entry Types-->
|
|
17
|
-
|
|
18
|
-
```ts
|
|
19
|
-
import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
20
|
-
import type { Command } from '@atlaskit/editor-common/types';
|
|
21
|
-
import type { DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
22
|
-
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
23
|
-
import type { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
24
|
-
import type { NextEditorPlugin } from '@atlaskit/editor-common/types';
|
|
25
|
-
import type { OptionalPlugin } from '@atlaskit/editor-common/types';
|
|
26
|
-
import type { SelectItemMode } from '@atlaskit/editor-common/type-ahead';
|
|
27
|
-
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
28
|
-
import type { TypeAheadHandler } from '@atlaskit/editor-common/types';
|
|
29
|
-
import type { TypeAheadItem } from '@atlaskit/editor-common/types';
|
|
30
|
-
import type { TypeAheadStats } from '@atlaskit/editor-common/types';
|
|
31
|
-
|
|
32
|
-
// @public (undocumented)
|
|
33
|
-
type CloseTypeAheadProps = {
|
|
34
|
-
insertCurrentQueryAsRawText: boolean;
|
|
35
|
-
attachCommand?: Command;
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
// @public (undocumented)
|
|
39
|
-
type InsertTypeAheadItemProps = {
|
|
40
|
-
triggerHandler: TypeAheadHandler;
|
|
41
|
-
contentItem: TypeAheadItem;
|
|
42
|
-
query: string;
|
|
43
|
-
sourceListItem: TypeAheadItem[];
|
|
44
|
-
mode?: SelectItemMode;
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
// @public (undocumented)
|
|
48
|
-
type OpenTypeAheadProps = {
|
|
49
|
-
triggerHandler: TypeAheadHandler;
|
|
50
|
-
inputMethod: TypeAheadInputMethod;
|
|
51
|
-
query?: string;
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
export { TypeAheadHandler };
|
|
55
|
-
|
|
56
|
-
// @public (undocumented)
|
|
57
|
-
export type TypeAheadInputMethod =
|
|
58
|
-
| INPUT_METHOD.INSERT_MENU
|
|
59
|
-
| INPUT_METHOD.KEYBOARD
|
|
60
|
-
| INPUT_METHOD.QUICK_INSERT
|
|
61
|
-
| INPUT_METHOD.TOOLBAR;
|
|
62
|
-
|
|
63
|
-
// @public
|
|
64
|
-
export type TypeAheadPlugin = NextEditorPlugin<
|
|
65
|
-
'typeAhead',
|
|
66
|
-
{
|
|
67
|
-
pluginConfiguration: TypeAheadPluginOptions | undefined;
|
|
68
|
-
dependencies: [OptionalPlugin<AnalyticsPlugin>];
|
|
69
|
-
sharedState: {
|
|
70
|
-
query: string;
|
|
71
|
-
isOpen: boolean;
|
|
72
|
-
isAllowed: boolean;
|
|
73
|
-
currentHandler?: TypeAheadHandler;
|
|
74
|
-
};
|
|
75
|
-
actions: {
|
|
76
|
-
isOpen: (editorState: EditorState) => boolean;
|
|
77
|
-
isAllowed: (editorState: EditorState) => boolean;
|
|
78
|
-
insert: (props: InsertTypeAheadItemProps) => boolean;
|
|
79
|
-
findHandlerByTrigger: (trigger: string) => TypeAheadHandler | null;
|
|
80
|
-
open: (props: OpenTypeAheadProps) => boolean;
|
|
81
|
-
close: (props: CloseTypeAheadProps) => boolean;
|
|
82
|
-
openAtTransaction: (props: OpenTypeAheadProps) => (tr: Transaction) => boolean;
|
|
83
|
-
};
|
|
84
|
-
}
|
|
85
|
-
>;
|
|
86
|
-
|
|
87
|
-
// @public
|
|
88
|
-
export const typeAheadPlugin: TypeAheadPlugin;
|
|
89
|
-
|
|
90
|
-
// @public (undocumented)
|
|
91
|
-
export type TypeAheadPluginOptions = {
|
|
92
|
-
isMobile?: boolean;
|
|
93
|
-
};
|
|
94
|
-
|
|
95
|
-
// @public (undocumented)
|
|
96
|
-
export type TypeAheadPluginState = {
|
|
97
|
-
decorationSet: DecorationSet;
|
|
98
|
-
decorationElement: HTMLElement | null;
|
|
99
|
-
typeAheadHandlers: Array<TypeAheadHandler>;
|
|
100
|
-
query: string;
|
|
101
|
-
items: Array<TypeAheadItem>;
|
|
102
|
-
triggerHandler?: TypeAheadHandler;
|
|
103
|
-
selectedIndex: number;
|
|
104
|
-
stats: TypeAheadStatsSerializable | null;
|
|
105
|
-
inputMethod: TypeAheadInputMethod | null;
|
|
106
|
-
};
|
|
107
|
-
|
|
108
|
-
// @public (undocumented)
|
|
109
|
-
interface TypeAheadStatsSerializable extends TypeAheadStats {
|
|
110
|
-
// (undocumented)
|
|
111
|
-
serialize: () => TypeAheadStats;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
// (No @packageDocumentation comment for this package)
|
|
115
|
-
```
|
|
116
|
-
|
|
117
|
-
<!--SECTION END: Main Entry Types-->
|
|
118
|
-
|
|
119
|
-
### Peer Dependencies
|
|
120
|
-
|
|
121
|
-
<!--SECTION START: Peer Dependencies-->
|
|
122
|
-
|
|
123
|
-
```json
|
|
124
|
-
{
|
|
125
|
-
"react": "^16.8.0",
|
|
126
|
-
"react-dom": "^16.8.0",
|
|
127
|
-
"react-intl": "npm:react-intl@^5.18.1"
|
|
128
|
-
}
|
|
129
|
-
```
|
|
130
|
-
|
|
131
|
-
<!--SECTION END: Peer Dependencies-->
|