@atlaskit/editor-plugin-type-ahead 27.0.3 → 27.0.5
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 +12 -0
- package/dist/cjs/pm-plugins/analytics.js +5 -5
- package/dist/cjs/pm-plugins/api.js +2 -2
- package/dist/cjs/pm-plugins/commands/insert-utils.js +2 -2
- package/dist/cjs/pm-plugins/commands/open-typeahead-at-cursor.js +1 -1
- package/dist/cjs/pm-plugins/input-rules.js +6 -5
- package/dist/cjs/pm-plugins/item-is-disabled.js +2 -2
- package/dist/cjs/pm-plugins/main.js +4 -4
- package/dist/cjs/pm-plugins/reducer.js +5 -5
- package/dist/cjs/pm-plugins/utils.js +10 -9
- package/dist/cjs/typeAheadPlugin.js +6 -6
- package/dist/cjs/ui/ContentComponent.js +2 -2
- package/dist/cjs/ui/InputQuery.js +22 -21
- package/dist/cjs/ui/TypeAheadErrorFallback/index.js +3 -3
- package/dist/cjs/ui/TypeAheadList.js +11 -10
- package/dist/cjs/ui/TypeAheadListItem.js +13 -12
- package/dist/cjs/ui/TypeAheadPopup.js +30 -29
- package/dist/cjs/ui/WrapperTypeAhead.js +4 -4
- package/dist/cjs/ui/registered-menu/RegisteredTypeAheadMenu.js +2 -2
- package/dist/cjs/ui/registered-menu/TypeAheadMenuRenderer.js +2 -2
- package/dist/cjs/ui/registered-menu/quick-insert/TypeAheadQuickInsertProvider.js +2 -2
- package/dist/cjs/ui/registered-menu/typeAheadSurfaces.js +4 -3
- package/dist/es2019/pm-plugins/analytics.js +1 -1
- package/dist/es2019/pm-plugins/api.js +1 -1
- package/dist/es2019/pm-plugins/commands/insert-utils.js +1 -1
- package/dist/es2019/pm-plugins/commands/open-typeahead-at-cursor.js +1 -1
- package/dist/es2019/pm-plugins/input-rules.js +3 -2
- package/dist/es2019/pm-plugins/item-is-disabled.js +1 -1
- package/dist/es2019/pm-plugins/main.js +2 -2
- package/dist/es2019/pm-plugins/reducer.js +2 -2
- package/dist/es2019/pm-plugins/utils.js +3 -2
- package/dist/es2019/typeAheadPlugin.js +1 -1
- package/dist/es2019/ui/ContentComponent.js +1 -1
- package/dist/es2019/ui/InputQuery.js +4 -3
- package/dist/es2019/ui/TypeAheadErrorFallback/index.js +1 -1
- package/dist/es2019/ui/TypeAheadList.js +5 -4
- package/dist/es2019/ui/TypeAheadListItem.js +7 -6
- package/dist/es2019/ui/TypeAheadPopup.js +5 -4
- package/dist/es2019/ui/WrapperTypeAhead.js +1 -1
- package/dist/es2019/ui/registered-menu/RegisteredTypeAheadMenu.js +1 -1
- package/dist/es2019/ui/registered-menu/TypeAheadMenuRenderer.js +1 -1
- package/dist/es2019/ui/registered-menu/quick-insert/TypeAheadQuickInsertProvider.js +1 -1
- package/dist/es2019/ui/registered-menu/typeAheadSurfaces.js +3 -2
- package/dist/esm/pm-plugins/analytics.js +1 -1
- package/dist/esm/pm-plugins/api.js +1 -1
- package/dist/esm/pm-plugins/commands/insert-utils.js +1 -1
- package/dist/esm/pm-plugins/commands/open-typeahead-at-cursor.js +1 -1
- package/dist/esm/pm-plugins/input-rules.js +3 -2
- package/dist/esm/pm-plugins/item-is-disabled.js +1 -1
- package/dist/esm/pm-plugins/main.js +2 -2
- package/dist/esm/pm-plugins/reducer.js +2 -2
- package/dist/esm/pm-plugins/utils.js +3 -2
- package/dist/esm/typeAheadPlugin.js +1 -1
- package/dist/esm/ui/ContentComponent.js +1 -1
- package/dist/esm/ui/InputQuery.js +4 -3
- package/dist/esm/ui/TypeAheadErrorFallback/index.js +1 -1
- package/dist/esm/ui/TypeAheadList.js +5 -4
- package/dist/esm/ui/TypeAheadListItem.js +7 -6
- package/dist/esm/ui/TypeAheadPopup.js +5 -4
- package/dist/esm/ui/WrapperTypeAhead.js +1 -1
- package/dist/esm/ui/registered-menu/RegisteredTypeAheadMenu.js +1 -1
- package/dist/esm/ui/registered-menu/TypeAheadMenuRenderer.js +1 -1
- package/dist/esm/ui/registered-menu/quick-insert/TypeAheadQuickInsertProvider.js +1 -1
- package/dist/esm/ui/registered-menu/typeAheadSurfaces.js +3 -2
- package/dist/types/pm-plugins/analytics.d.ts +3 -3
- package/dist/types/pm-plugins/api.d.ts +2 -2
- package/dist/types/pm-plugins/commands/clear-list-error.d.ts +1 -1
- package/dist/types/pm-plugins/commands/insert-type-ahead-item.d.ts +1 -1
- package/dist/types/pm-plugins/commands/open-typeahead-at-cursor.d.ts +1 -1
- package/dist/types/pm-plugins/commands/update-list-error.d.ts +1 -1
- package/dist/types/pm-plugins/commands/update-list-items.d.ts +2 -1
- package/dist/types/pm-plugins/commands/update-query.d.ts +1 -1
- package/dist/types/pm-plugins/commands/update-section-title.d.ts +2 -1
- package/dist/types/pm-plugins/commands/update-selected-index.d.ts +2 -1
- package/dist/types/pm-plugins/decorations.d.ts +2 -2
- package/dist/types/pm-plugins/input-rules.d.ts +1 -1
- package/dist/types/pm-plugins/item-is-disabled.d.ts +2 -1
- package/dist/types/pm-plugins/main.d.ts +2 -2
- package/dist/types/pm-plugins/utils.d.ts +2 -1
- package/dist/types/typeAheadPluginType.d.ts +8 -6
- package/dist/types/types/index.d.ts +3 -3
- package/dist/types/ui/ContentComponent.d.ts +1 -1
- package/dist/types/ui/InputQuery.d.ts +1 -1
- package/dist/types/ui/TypeAheadList.d.ts +2 -1
- package/dist/types/ui/TypeAheadListItem.d.ts +2 -1
- package/dist/types/ui/TypeAheadMenu.d.ts +1 -1
- package/dist/types/ui/TypeAheadPopup.d.ts +2 -1
- package/dist/types/ui/WrapperTypeAhead.d.ts +1 -1
- package/dist/types/ui/hooks/build-sectioned-result.d.ts +1 -1
- package/dist/types/ui/hooks/use-item-insert.d.ts +2 -1
- package/dist/types/ui/hooks/use-load-items.d.ts +2 -1
- package/dist/types/ui/hooks/use-on-force-select.d.ts +1 -1
- package/dist/types/ui/registered-menu/RegisteredTypeAheadMenu.d.ts +2 -1
- package/dist/types/ui/registered-menu/TypeAheadContext.d.ts +3 -2
- package/dist/types/ui/registered-menu/typeAheadSurfaces.d.ts +1 -1
- package/package.json +2 -2
|
@@ -10,16 +10,17 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/sli
|
|
|
10
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
11
|
var _react2 = require("@emotion/react");
|
|
12
12
|
var _rafSchd = _interopRequireDefault(require("raf-schd"));
|
|
13
|
-
var
|
|
14
|
-
var
|
|
13
|
+
var _enums = require("@atlaskit/editor-common/analytics/types/enums");
|
|
14
|
+
var _Popup = _interopRequireDefault(require("@atlaskit/editor-common/Popup"));
|
|
15
|
+
var _utils = require("@atlaskit/editor-common/Popup/utils");
|
|
15
16
|
var _typeAhead = require("@atlaskit/editor-common/type-ahead");
|
|
16
|
-
var
|
|
17
|
-
var
|
|
17
|
+
var _useSharedPluginStateWithSelector = require("@atlaskit/editor-common/useSharedPluginStateWithSelector");
|
|
18
|
+
var _constants = require("@atlaskit/editor-shared-styles/constants");
|
|
18
19
|
var _editorExperiment = require("@atlaskit/tmp-editor-statsig/editor-experiment");
|
|
19
20
|
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
20
|
-
var
|
|
21
|
-
var
|
|
22
|
-
var
|
|
21
|
+
var _analytics = require("../pm-plugins/analytics");
|
|
22
|
+
var _constants2 = require("../pm-plugins/constants");
|
|
23
|
+
var _utils2 = require("../pm-plugins/utils");
|
|
23
24
|
var _TypeAheadErrorFallback = require("./TypeAheadErrorFallback");
|
|
24
25
|
var _TypeAheadList = require("./TypeAheadList");
|
|
25
26
|
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); }
|
|
@@ -83,7 +84,7 @@ var TypeAheadPopup = exports.TypeAheadPopup = /*#__PURE__*/_react.default.memo(f
|
|
|
83
84
|
api = props.api,
|
|
84
85
|
showMoreOptionsButton = props.showMoreOptionsButton;
|
|
85
86
|
var ref = (0, _react.useRef)(null);
|
|
86
|
-
var _useSharedPluginState = (0,
|
|
87
|
+
var _useSharedPluginState = (0, _useSharedPluginStateWithSelector.useSharedPluginStateWithSelector)(api, ['featureFlags'], function (states) {
|
|
87
88
|
var _states$featureFlagsS;
|
|
88
89
|
return {
|
|
89
90
|
moreElementsInQuickInsertView: (_states$featureFlagsS = states.featureFlagsState) === null || _states$featureFlagsS === void 0 ? void 0 : _states$featureFlagsS.moreElementsInQuickInsertView
|
|
@@ -98,7 +99,7 @@ var TypeAheadPopup = exports.TypeAheadPopup = /*#__PURE__*/_react.default.memo(f
|
|
|
98
99
|
var activityStateRef = (0, _react.useRef)({
|
|
99
100
|
inputMethod: null,
|
|
100
101
|
closeAction: null,
|
|
101
|
-
invocationMethod: (_getPluginState = (0,
|
|
102
|
+
invocationMethod: (_getPluginState = (0, _utils2.getPluginState)(editorView.state)) === null || _getPluginState === void 0 ? void 0 : _getPluginState.inputMethod
|
|
102
103
|
});
|
|
103
104
|
var startTime = (0, _react.useMemo)(function () {
|
|
104
105
|
return performance.now();
|
|
@@ -115,9 +116,9 @@ var TypeAheadPopup = exports.TypeAheadPopup = /*#__PURE__*/_react.default.memo(f
|
|
|
115
116
|
var stopTime = performance.now();
|
|
116
117
|
var time = stopTime - startTime;
|
|
117
118
|
api === null || api === void 0 || (_api$analytics2 = api.analytics) === null || _api$analytics2 === void 0 || (_api$analytics2 = _api$analytics2.actions) === null || _api$analytics2 === void 0 || _api$analytics2.fireAnalyticsEvent({
|
|
118
|
-
action:
|
|
119
|
-
actionSubject:
|
|
120
|
-
eventType:
|
|
119
|
+
action: _enums.ACTION.RENDERED,
|
|
120
|
+
actionSubject: _enums.ACTION_SUBJECT.TYPEAHEAD,
|
|
121
|
+
eventType: _enums.EVENT_TYPE.OPERATIONAL,
|
|
121
122
|
attributes: {
|
|
122
123
|
time: time,
|
|
123
124
|
items: items.length,
|
|
@@ -136,9 +137,9 @@ var TypeAheadPopup = exports.TypeAheadPopup = /*#__PURE__*/_react.default.memo(f
|
|
|
136
137
|
return;
|
|
137
138
|
}
|
|
138
139
|
api === null || api === void 0 || (_api$analytics4 = api.analytics) === null || _api$analytics4 === void 0 || (_api$analytics4 = _api$analytics4.actions) === null || _api$analytics4 === void 0 || _api$analytics4.fireAnalyticsEvent({
|
|
139
|
-
action:
|
|
140
|
-
actionSubject:
|
|
141
|
-
eventType:
|
|
140
|
+
action: _enums.ACTION.VIEWED,
|
|
141
|
+
actionSubject: _enums.ACTION_SUBJECT.TYPEAHEAD_ITEM,
|
|
142
|
+
eventType: _enums.EVENT_TYPE.OPERATIONAL,
|
|
142
143
|
attributes: {
|
|
143
144
|
index: selectedIndex,
|
|
144
145
|
items: items.length
|
|
@@ -199,7 +200,7 @@ var TypeAheadPopup = exports.TypeAheadPopup = /*#__PURE__*/_react.default.memo(f
|
|
|
199
200
|
(0, _react.useLayoutEffect)(function () {
|
|
200
201
|
// Ignored via go/ees005
|
|
201
202
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
202
|
-
var scrollableElement = popupsScrollableElement || (0,
|
|
203
|
+
var scrollableElement = popupsScrollableElement || (0, _utils.findOverflowScrollParent)(anchorElement);
|
|
203
204
|
getFitHeight();
|
|
204
205
|
// Ignored via go/ees005
|
|
205
206
|
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
@@ -221,7 +222,7 @@ var TypeAheadPopup = exports.TypeAheadPopup = /*#__PURE__*/_react.default.memo(f
|
|
|
221
222
|
};
|
|
222
223
|
}, [anchorElement, popupsScrollableElement, getFitHeightDebounced, getFitHeight]);
|
|
223
224
|
(0, _react.useLayoutEffect)(function () {
|
|
224
|
-
var _ref2 = (0,
|
|
225
|
+
var _ref2 = (0, _utils2.getPluginState)(editorView.state) || {},
|
|
225
226
|
removePrefixTriggerOnCancel = _ref2.removePrefixTriggerOnCancel;
|
|
226
227
|
var focusOut = function focusOut(event) {
|
|
227
228
|
var _window$getSelection;
|
|
@@ -229,7 +230,7 @@ var TypeAheadPopup = exports.TypeAheadPopup = /*#__PURE__*/_react.default.memo(f
|
|
|
229
230
|
// Given the user is changing the focus
|
|
230
231
|
// When the target is inside the TypeAhead Popup
|
|
231
232
|
// Then the popup should stay open
|
|
232
|
-
if (relatedTarget instanceof HTMLElement && relatedTarget.closest && (relatedTarget.closest(".".concat(
|
|
233
|
+
if (relatedTarget instanceof HTMLElement && relatedTarget.closest && (relatedTarget.closest(".".concat(_constants2.TYPE_AHEAD_POPUP_CONTENT_CLASS)) || relatedTarget.closest("[data-type-ahead=\"".concat(_constants2.TYPE_AHEAD_DECORATION_DATA_ATTRIBUTE, "\"]")))) {
|
|
233
234
|
return;
|
|
234
235
|
}
|
|
235
236
|
|
|
@@ -254,7 +255,7 @@ var TypeAheadPopup = exports.TypeAheadPopup = /*#__PURE__*/_react.default.memo(f
|
|
|
254
255
|
}
|
|
255
256
|
cancel({
|
|
256
257
|
addPrefixTrigger: isEditorControlsEnabled ? !removePrefixTriggerOnCancel : true,
|
|
257
|
-
setSelectionAt:
|
|
258
|
+
setSelectionAt: _constants2.CloseSelectionOptions.AFTER_TEXT_INSERTED,
|
|
258
259
|
forceFocusOnEditor: false
|
|
259
260
|
});
|
|
260
261
|
};
|
|
@@ -272,14 +273,14 @@ var TypeAheadPopup = exports.TypeAheadPopup = /*#__PURE__*/_react.default.memo(f
|
|
|
272
273
|
// TODO: ED-17443 - When you press escape on typeahead panel, it should remove focus and close the panel
|
|
273
274
|
// This is the expected keyboard behaviour advised by the Accessibility team
|
|
274
275
|
(0, _react.useLayoutEffect)(function () {
|
|
275
|
-
var _ref3 = (0,
|
|
276
|
+
var _ref3 = (0, _utils2.getPluginState)(editorView.state) || {},
|
|
276
277
|
removePrefixTriggerOnCancel = _ref3.removePrefixTriggerOnCancel;
|
|
277
278
|
var escape = function escape(event) {
|
|
278
279
|
if (event.key === 'Escape') {
|
|
279
|
-
activityStateRef.current.inputMethod =
|
|
280
|
+
activityStateRef.current.inputMethod = _enums.INPUT_METHOD.KEYBOARD;
|
|
280
281
|
cancel({
|
|
281
282
|
addPrefixTrigger: isEditorControlsEnabled ? !removePrefixTriggerOnCancel : true,
|
|
282
|
-
setSelectionAt:
|
|
283
|
+
setSelectionAt: _constants2.CloseSelectionOptions.AFTER_TEXT_INSERTED,
|
|
283
284
|
forceFocusOnEditor: true
|
|
284
285
|
});
|
|
285
286
|
}
|
|
@@ -302,14 +303,14 @@ var TypeAheadPopup = exports.TypeAheadPopup = /*#__PURE__*/_react.default.memo(f
|
|
|
302
303
|
// eslint-disable-next-line @atlaskit/platform/no-preconditioning
|
|
303
304
|
openElementBrowserModal && (0, _editorExperiment.editorExperiment)('platform_editor_controls', 'variant1') && triggerHandler.id === _typeAhead.TypeAheadAvailableNodes.QUICK_INSERT) {
|
|
304
305
|
activityStateRef.current = {
|
|
305
|
-
inputMethod:
|
|
306
|
-
closeAction:
|
|
306
|
+
inputMethod: _enums.INPUT_METHOD.MOUSE,
|
|
307
|
+
closeAction: _enums.ACTION.VIEW_MORE,
|
|
307
308
|
invocationMethod: activityStateRef.current.invocationMethod
|
|
308
309
|
};
|
|
309
310
|
}
|
|
310
311
|
}, [openElementBrowserModal, triggerHandler.id]);
|
|
311
|
-
return (0, _react2.jsx)(
|
|
312
|
-
zIndex:
|
|
312
|
+
return (0, _react2.jsx)(_Popup.default, {
|
|
313
|
+
zIndex: _constants.akEditorFloatingDialogZIndex,
|
|
313
314
|
target: anchorElement,
|
|
314
315
|
mountTo: popupsMountPoint,
|
|
315
316
|
boundariesElement: popupsBoundariesElement,
|
|
@@ -325,7 +326,7 @@ var TypeAheadPopup = exports.TypeAheadPopup = /*#__PURE__*/_react.default.memo(f
|
|
|
325
326
|
if (selectedIndex > -1 && (0, _editorExperiment.editorExperiment)('platform_editor_controls', 'variant1')) {
|
|
326
327
|
// if selectedIndex is -1, it means that the user has not selected any item
|
|
327
328
|
// will be handled by WrapperTypeAhead
|
|
328
|
-
(0,
|
|
329
|
+
(0, _analytics.fireTypeAheadClosedAnalyticsEvent)(api, activityStateRef.current.closeAction || _enums.ACTION.CANCELLED, !isEmptyQuery, activityStateRef.current.inputMethod || _enums.INPUT_METHOD.MOUSE, activityStateRef.current.invocationMethod);
|
|
329
330
|
|
|
330
331
|
// reset activity state
|
|
331
332
|
activityStateRef.current = {
|
|
@@ -339,7 +340,7 @@ var TypeAheadPopup = exports.TypeAheadPopup = /*#__PURE__*/_react.default.memo(f
|
|
|
339
340
|
css: [typeAheadContent, moreElementsInQuickInsertViewEnabled && typeAheadContentOverride, showMoreOptionsButton && typeAheadWrapperWithViewMoreOverride, (0, _expValEquals.expValEquals)('cc-markdown-mode', 'isEnabled', true) && typeAheadContentOverrideBorder]
|
|
340
341
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
341
342
|
,
|
|
342
|
-
className:
|
|
343
|
+
className: _constants2.TYPE_AHEAD_POPUP_CONTENT_CLASS,
|
|
343
344
|
ref: ref
|
|
344
345
|
}, errorInfo ? (0, _react2.jsx)(_TypeAheadErrorFallback.TypeAheadErrorFallback, null) : (0, _react2.jsx)(_react.default.Fragment, null, (0, _react2.jsx)(Highlight, {
|
|
345
346
|
state: editorView.state,
|
|
@@ -355,7 +356,7 @@ var TypeAheadPopup = exports.TypeAheadPopup = /*#__PURE__*/_react.default.memo(f
|
|
|
355
356
|
if ((0, _editorExperiment.editorExperiment)('platform_editor_controls', 'variant1')) {
|
|
356
357
|
activityStateRef.current = {
|
|
357
358
|
inputMethod: inputMethod || null,
|
|
358
|
-
closeAction:
|
|
359
|
+
closeAction: _enums.ACTION.INSERTED,
|
|
359
360
|
invocationMethod: activityStateRef.current.invocationMethod
|
|
360
361
|
};
|
|
361
362
|
}
|
|
@@ -9,12 +9,12 @@ exports.WrapperTypeAhead = void 0;
|
|
|
9
9
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
10
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
11
|
var _reactIntl = require("react-intl");
|
|
12
|
-
var
|
|
12
|
+
var _enums = require("@atlaskit/editor-common/analytics/types/enums");
|
|
13
13
|
var _typeAhead = require("@atlaskit/editor-common/type-ahead");
|
|
14
14
|
var _fg = require("@atlaskit/platform-feature-flags/fg");
|
|
15
15
|
var _editorExperiment = require("@atlaskit/tmp-editor-statsig/editor-experiment");
|
|
16
16
|
var _expVal = require("@atlaskit/tmp-editor-statsig/expVal");
|
|
17
|
-
var
|
|
17
|
+
var _analytics = require("../pm-plugins/analytics");
|
|
18
18
|
var _updateQuery = require("../pm-plugins/commands/update-query");
|
|
19
19
|
var _itemIsDisabled2 = require("../pm-plugins/item-is-disabled");
|
|
20
20
|
var _utils = require("../pm-plugins/utils");
|
|
@@ -94,7 +94,7 @@ var WrapperTypeAhead = exports.WrapperTypeAhead = /*#__PURE__*/_react.default.me
|
|
|
94
94
|
forceFocusOnEditor = _ref2.forceFocusOnEditor;
|
|
95
95
|
if ((0, _editorExperiment.editorExperiment)('platform_editor_controls', 'variant1')) {
|
|
96
96
|
var _getPluginState;
|
|
97
|
-
(0,
|
|
97
|
+
(0, _analytics.fireTypeAheadClosedAnalyticsEvent)(api, _enums.ACTION.CANCELLED, !!queryRef.current, _enums.INPUT_METHOD.KEYBOARD, (_getPluginState = (0, _utils.getPluginState)(editorView.state)) === null || _getPluginState === void 0 ? void 0 : _getPluginState.inputMethod);
|
|
98
98
|
}
|
|
99
99
|
setClosed(true);
|
|
100
100
|
var fullquery = addPrefixTrigger ? "".concat(triggerHandler.trigger).concat(text) : text;
|
|
@@ -126,7 +126,7 @@ var WrapperTypeAhead = exports.WrapperTypeAhead = /*#__PURE__*/_react.default.me
|
|
|
126
126
|
}
|
|
127
127
|
if ((0, _editorExperiment.editorExperiment)('platform_editor_controls', 'variant1')) {
|
|
128
128
|
var _getPluginState2;
|
|
129
|
-
(0,
|
|
129
|
+
(0, _analytics.fireTypeAheadClosedAnalyticsEvent)(api, _enums.ACTION.INSERTED, !!queryRef.current, _enums.INPUT_METHOD.KEYBOARD, (_getPluginState2 = (0, _utils.getPluginState)(editorView.state)) === null || _getPluginState2 === void 0 ? void 0 : _getPluginState2.inputMethod);
|
|
130
130
|
}
|
|
131
131
|
setClosed(true);
|
|
132
132
|
queueMicrotask(function () {
|
|
@@ -12,11 +12,11 @@ var _runtime = require("@compiled/react/runtime");
|
|
|
12
12
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
13
13
|
var _react = _interopRequireWildcard(require("react"));
|
|
14
14
|
var _reactIntl = require("react-intl");
|
|
15
|
+
var _Popup = _interopRequireDefault(require("@atlaskit/editor-common/Popup"));
|
|
15
16
|
var _registeredMenuModel = require("@atlaskit/editor-common/quick-insert/registered-menu-model");
|
|
16
17
|
var _useMenuPopupSizing = require("@atlaskit/editor-common/quick-insert/use-menu-popup-sizing");
|
|
17
18
|
var _typeAheadIsSectionOverflowItemKey = require("@atlaskit/editor-common/type-ahead-is-section-overflow-item-key");
|
|
18
19
|
var _typeAheadSurfaceContext = require("@atlaskit/editor-common/type-ahead-surface-context");
|
|
19
|
-
var _ui = require("@atlaskit/editor-common/ui");
|
|
20
20
|
var _constants = require("@atlaskit/editor-shared-styles/constants");
|
|
21
21
|
var _createSurfaceContext = require("@atlaskit/editor-ui-control-model/create-surface-context");
|
|
22
22
|
var _isExperimentEnabled = require("@atlaskit/platform-feature-experiments/is-experiment-enabled");
|
|
@@ -220,7 +220,7 @@ var RegisteredTypeAheadMenu = exports.RegisteredTypeAheadMenu = function Registe
|
|
|
220
220
|
selectPreviousItem: selectPreviousItem,
|
|
221
221
|
shouldKeepOpenOnRegisteredMenu: true,
|
|
222
222
|
triggerQueryPrefix: triggerHandler.trigger
|
|
223
|
-
}), /*#__PURE__*/_react.default.createElement(
|
|
223
|
+
}), /*#__PURE__*/_react.default.createElement(_Popup.default, {
|
|
224
224
|
ariaLabel: null,
|
|
225
225
|
boundariesElement: popupsBoundariesElement,
|
|
226
226
|
fitHeight: menuHeight,
|
|
@@ -13,7 +13,7 @@ var _CellMeasurer = require("react-virtualized/dist/commonjs/CellMeasurer");
|
|
|
13
13
|
var _List = require("react-virtualized/dist/commonjs/List");
|
|
14
14
|
var _registeredMenuModel = require("@atlaskit/editor-common/quick-insert/registered-menu-model");
|
|
15
15
|
var _useMenuListHeight2 = require("@atlaskit/editor-common/quick-insert/use-menu-list-height");
|
|
16
|
-
var
|
|
16
|
+
var _messages = require("@atlaskit/editor-common/type-ahead/messages");
|
|
17
17
|
var _compiled = require("@atlaskit/primitives/compiled");
|
|
18
18
|
var _createTypeAheadRowRenderer = require("./createTypeAheadRowRenderer");
|
|
19
19
|
var _getTypeAheadGlobalViewMoreId = require("./getTypeAheadGlobalViewMoreId");
|
|
@@ -145,7 +145,7 @@ var TypeAheadMenuRenderer = exports.TypeAheadMenuRenderer = function TypeAheadMe
|
|
|
145
145
|
}, /*#__PURE__*/_react.default.createElement(_compiled.Text, {
|
|
146
146
|
align: "center",
|
|
147
147
|
as: "p"
|
|
148
|
-
}, intl.formatMessage(
|
|
148
|
+
}, intl.formatMessage(_messages.typeAheadListMessages.emptySearchResults))) : null, model.footer && /*#__PURE__*/_react.default.createElement(_TypeAheadMenuFooter.TypeAheadMenuFooter, {
|
|
149
149
|
id: (0, _getTypeAheadGlobalViewMoreId.getTypeAheadGlobalViewMoreId)(listId),
|
|
150
150
|
isSelected: selectedItemIndex === footerItemIndex,
|
|
151
151
|
Item: Item,
|
|
@@ -7,8 +7,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.TypeAheadQuickInsertProvider = void 0;
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
9
|
var _isOfflineMode = require("@atlaskit/editor-common/connectivity/isOfflineMode");
|
|
10
|
-
var _hooks = require("@atlaskit/editor-common/hooks");
|
|
11
10
|
var _provider = require("@atlaskit/editor-common/quick-insert/provider");
|
|
11
|
+
var _useSharedPluginStateWithSelector = require("@atlaskit/editor-common/useSharedPluginStateWithSelector");
|
|
12
12
|
var _insertTypeAheadItem = require("../../../pm-plugins/commands/insert-type-ahead-item");
|
|
13
13
|
var _useTypeAheadContext2 = require("../useTypeAheadContext");
|
|
14
14
|
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); }
|
|
@@ -25,7 +25,7 @@ var TypeAheadQuickInsertProvider = exports.TypeAheadQuickInsertProvider = functi
|
|
|
25
25
|
query = _useTypeAheadContext.query,
|
|
26
26
|
surfaceContext = _useTypeAheadContext.surfaceContext,
|
|
27
27
|
triggerHandler = _useTypeAheadContext.triggerHandler;
|
|
28
|
-
var _useSharedPluginState = (0,
|
|
28
|
+
var _useSharedPluginState = (0, _useSharedPluginStateWithSelector.useSharedPluginStateWithSelector)(api, ['connectivity'], function (_ref2) {
|
|
29
29
|
var connectivityState = _ref2.connectivityState;
|
|
30
30
|
return {
|
|
31
31
|
isOffline: (0, _isOfflineMode.isOfflineMode)(connectivityState === null || connectivityState === void 0 ? void 0 : connectivityState.mode)
|
|
@@ -4,17 +4,18 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.getTypeAheadSurface = void 0;
|
|
7
|
-
var
|
|
7
|
+
var _enums = require("@atlaskit/editor-common/analytics/types/enums");
|
|
8
8
|
var _keys = require("@atlaskit/editor-common/quick-insert/keys");
|
|
9
9
|
var _typeAhead = require("@atlaskit/editor-common/type-ahead");
|
|
10
|
+
var _messages = require("@atlaskit/editor-common/type-ahead/messages");
|
|
10
11
|
var _isExperimentEnabled = require("@atlaskit/platform-feature-experiments/is-experiment-enabled");
|
|
11
12
|
var _TypeAheadQuickInsertItem = require("./quick-insert/TypeAheadQuickInsertItem");
|
|
12
13
|
var _TypeAheadQuickInsertProvider = require("./quick-insert/TypeAheadQuickInsertProvider");
|
|
13
14
|
var quickInsertSurface = {
|
|
14
|
-
inputMethod:
|
|
15
|
+
inputMethod: _enums.INPUT_METHOD.QUICK_INSERT,
|
|
15
16
|
Item: _TypeAheadQuickInsertItem.TypeAheadQuickInsertItem,
|
|
16
17
|
listIdPrefix: 'quick-insert-menu',
|
|
17
|
-
listLabel:
|
|
18
|
+
listLabel: _messages.typeAheadListMessages.quickInsertInputLabel,
|
|
18
19
|
Provider: _TypeAheadQuickInsertProvider.TypeAheadQuickInsertProvider,
|
|
19
20
|
root: _keys.MENU
|
|
20
21
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
1
|
+
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics/types/enums';
|
|
2
2
|
export const fireTypeAheadClosedAnalyticsEvent = (api, closeAction, hasQuery, inputMethod, invocationMethod = null) => {
|
|
3
3
|
var _api$analytics;
|
|
4
4
|
api === null || api === void 0 ? void 0 : (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions.fireAnalyticsEvent({
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
1
|
+
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics/types/enums';
|
|
2
2
|
import { SelectItemMode, TypeAheadAvailableNodes } from '@atlaskit/editor-common/type-ahead';
|
|
3
3
|
import { closeTypeAhead } from './commands/close-type-ahead';
|
|
4
4
|
import { insertTypeAheadItem } from './commands/insert-type-ahead-item';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { normaliseNestedLayout, safeInsert } from '@atlaskit/editor-common/insert';
|
|
2
|
-
import { transformNodeIntoListItem } from '@atlaskit/editor-common/utils';
|
|
2
|
+
import { transformNodeIntoListItem } from '@atlaskit/editor-common/utils/insert-node-into-ordered-list';
|
|
3
3
|
import { isNodeOfSameBaseType } from '@atlaskit/editor-common/utils/node-type-utils';
|
|
4
4
|
import { Fragment, Node as PMNode, Slice } from '@atlaskit/editor-prosemirror/model';
|
|
5
5
|
import { NodeSelection, TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { GapCursorSelection } from '@atlaskit/editor-common/selection';
|
|
1
|
+
import { GapCursorSelection } from '@atlaskit/editor-common/selection/gap-cursor/selection';
|
|
2
2
|
import { NodeSelection, TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
3
3
|
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
4
4
|
import { ACTIONS } from '../actions';
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
1
|
+
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics/types/enums';
|
|
2
2
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
3
3
|
import { createRule } from '@atlaskit/editor-common/utils';
|
|
4
|
-
import {
|
|
4
|
+
import { leafNodeReplacementCharacter } from '@atlaskit/prosemirror-input-rules/constants';
|
|
5
|
+
import { createPlugin } from '@atlaskit/prosemirror-input-rules/utils';
|
|
5
6
|
import { openTypeAheadAtCursor } from '../pm-plugins/commands/open-typeahead-at-cursor';
|
|
6
7
|
export function inputRulePlugin(schema, typeAheads, featureFlags) {
|
|
7
8
|
if (!typeAheads || typeAheads.length === 0) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isOfflineMode } from '@atlaskit/editor-
|
|
1
|
+
import { isOfflineMode } from '@atlaskit/editor-common/connectivity/isOfflineMode';
|
|
2
2
|
export const itemIsDisabled = (item, api) => {
|
|
3
3
|
var _api$connectivity, _api$connectivity$sha;
|
|
4
4
|
const isOffline = isOfflineMode(api === null || api === void 0 ? void 0 : (_api$connectivity = api.connectivity) === null || _api$connectivity === void 0 ? void 0 : (_api$connectivity$sha = _api$connectivity.sharedState.currentState()) === null || _api$connectivity$sha === void 0 ? void 0 : _api$connectivity$sha.mode);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { InsertTypeAheadStep } from '@atlaskit/adf-schema/steps/type-ahead';
|
|
2
|
-
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
2
|
+
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics/types/enums';
|
|
3
3
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
4
|
-
import { closest } from '@atlaskit/editor-common/utils';
|
|
4
|
+
import { closest } from '@atlaskit/editor-common/utils/dom';
|
|
5
5
|
import { DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
6
6
|
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
7
7
|
import { ACTIONS } from './actions';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { InsertTypeAheadStages, InsertTypeAheadStep } from '@atlaskit/adf-schema/steps/type-ahead';
|
|
2
|
-
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
2
|
+
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics/types/enums';
|
|
3
3
|
import { DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
4
|
-
import { insm } from '@atlaskit/insm';
|
|
4
|
+
import { insm } from '@atlaskit/insm/api';
|
|
5
5
|
import { ACTIONS } from './actions';
|
|
6
6
|
import { pluginKey } from './key';
|
|
7
7
|
import { isTypeAheadHandler } from './utils';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { mentionMessages } from '@atlaskit/editor-common/messages';
|
|
2
|
-
import { TypeAheadAvailableNodes
|
|
1
|
+
import { mentionMessages } from '@atlaskit/editor-common/messages/mentions';
|
|
2
|
+
import { TypeAheadAvailableNodes } from '@atlaskit/editor-common/type-ahead';
|
|
3
|
+
import { typeAheadListMessages } from '@atlaskit/editor-common/type-ahead/messages';
|
|
3
4
|
import { AGENT_MENTION_LOAD_ERROR_ID } from '@atlaskit/mention/types';
|
|
4
5
|
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
5
6
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/editor-experiment';
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import React from 'react';
|
|
10
10
|
import { typeAheadQuery } from '@atlaskit/adf-schema/type-ahead-query';
|
|
11
|
-
import { ACTION, ACTION_SUBJECT, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
11
|
+
import { ACTION, ACTION_SUBJECT, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics/types/enums';
|
|
12
12
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
13
13
|
import { SelectItemMode, TypeAheadAvailableNodes } from '@atlaskit/editor-common/type-ahead';
|
|
14
14
|
import { DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/
|
|
2
|
+
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/useSharedPluginStateWithSelector';
|
|
3
3
|
import { getTypeAheadSurface } from './registered-menu/typeAheadSurfaces';
|
|
4
4
|
import { TypeAheadMenu } from './TypeAheadMenu';
|
|
5
5
|
export function ContentComponent({
|
|
@@ -8,10 +8,11 @@ import React, { Fragment, useCallback, useLayoutEffect, useRef, useState } from
|
|
|
8
8
|
import { css, jsx } from '@emotion/react';
|
|
9
9
|
import { useIntl } from 'react-intl';
|
|
10
10
|
import { keyName as keyNameNormalized } from 'w3c-keyname';
|
|
11
|
+
import { AssistiveText } from '@atlaskit/editor-common/AssistiveText';
|
|
11
12
|
import { getBrowserInfo } from '@atlaskit/editor-common/browser';
|
|
12
|
-
import { SelectItemMode
|
|
13
|
-
import {
|
|
14
|
-
import { blockNodesVerticalMargin } from '@atlaskit/editor-shared-styles';
|
|
13
|
+
import { SelectItemMode } from '@atlaskit/editor-common/type-ahead';
|
|
14
|
+
import { typeAheadListMessages } from '@atlaskit/editor-common/type-ahead/messages';
|
|
15
|
+
import { blockNodesVerticalMargin } from '@atlaskit/editor-shared-styles/constants';
|
|
15
16
|
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
16
17
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/editor-experiment';
|
|
17
18
|
import { CloseSelectionOptions, TYPE_AHEAD_DECORATION_ELEMENT_ID, TYPE_AHEAD_POPUP_CONTENT_CLASS } from '../pm-plugins/constants';
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled, @typescript-eslint/consistent-type-imports
|
|
6
6
|
import { css, jsx } from '@emotion/react';
|
|
7
7
|
import { useIntl } from 'react-intl';
|
|
8
|
-
import { typeAheadListMessages as messages } from '@atlaskit/editor-common/type-ahead';
|
|
8
|
+
import { typeAheadListMessages as messages } from '@atlaskit/editor-common/type-ahead/messages';
|
|
9
9
|
import { EmptyState } from './EmptyState';
|
|
10
10
|
import { GenericErrorSVG } from './GenericErrorSVG';
|
|
11
11
|
const minHeightComponentStyles = css({
|
|
@@ -10,10 +10,11 @@ import { css, jsx } from '@emotion/react';
|
|
|
10
10
|
import { injectIntl, useIntl } from 'react-intl';
|
|
11
11
|
import { CellMeasurer, CellMeasurerCache } from 'react-virtualized/dist/commonjs/CellMeasurer';
|
|
12
12
|
import { List } from 'react-virtualized/dist/commonjs/List';
|
|
13
|
-
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
13
|
+
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics/types/enums';
|
|
14
|
+
import { AssistiveText } from '@atlaskit/editor-common/AssistiveText';
|
|
15
|
+
import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages/insert-block';
|
|
16
|
+
import { SelectItemMode } from '@atlaskit/editor-common/type-ahead';
|
|
17
|
+
import { typeAheadListMessages } from '@atlaskit/editor-common/type-ahead/messages';
|
|
17
18
|
import MenuGroup from '@atlaskit/menu/menu-group';
|
|
18
19
|
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
19
20
|
import { Box, Inline, Text } from '@atlaskit/primitives/compiled';
|
|
@@ -8,12 +8,13 @@ import React, { useCallback, useLayoutEffect, useMemo } from 'react';
|
|
|
8
8
|
import { css, jsx } from '@emotion/react';
|
|
9
9
|
import { useIntl } from 'react-intl';
|
|
10
10
|
import { getBrowserInfo } from '@atlaskit/editor-common/browser';
|
|
11
|
-
import {
|
|
12
|
-
import
|
|
13
|
-
import { SelectItemMode
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
11
|
+
import { isOfflineMode } from '@atlaskit/editor-common/connectivity/isOfflineMode';
|
|
12
|
+
import IconFallback from '@atlaskit/editor-common/fallback';
|
|
13
|
+
import { SelectItemMode } from '@atlaskit/editor-common/type-ahead';
|
|
14
|
+
import { typeAheadListMessages } from '@atlaskit/editor-common/type-ahead/messages';
|
|
15
|
+
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/useSharedPluginStateWithSelector';
|
|
16
|
+
import { relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles/constants';
|
|
17
|
+
import { shortcutStyle } from '@atlaskit/editor-shared-styles/shortcut/main';
|
|
17
18
|
import ButtonItem from '@atlaskit/menu/button-item';
|
|
18
19
|
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
19
20
|
import VisuallyHidden from '@atlaskit/visually-hidden/visually-hidden';
|
|
@@ -7,11 +7,12 @@ import React, { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useSta
|
|
|
7
7
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled, @typescript-eslint/consistent-type-imports
|
|
8
8
|
import { css, jsx } from '@emotion/react';
|
|
9
9
|
import rafSchedule from 'raf-schd';
|
|
10
|
-
import { ACTION, ACTION_SUBJECT, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
11
|
-
import
|
|
10
|
+
import { ACTION, ACTION_SUBJECT, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics/types/enums';
|
|
11
|
+
import Popup from '@atlaskit/editor-common/Popup';
|
|
12
|
+
import { findOverflowScrollParent } from '@atlaskit/editor-common/Popup/utils';
|
|
12
13
|
import { TypeAheadAvailableNodes } from '@atlaskit/editor-common/type-ahead';
|
|
13
|
-
import {
|
|
14
|
-
import { akEditorFloatingDialogZIndex } from '@atlaskit/editor-shared-styles';
|
|
14
|
+
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/useSharedPluginStateWithSelector';
|
|
15
|
+
import { akEditorFloatingDialogZIndex } from '@atlaskit/editor-shared-styles/constants';
|
|
15
16
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/editor-experiment';
|
|
16
17
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
17
18
|
import { fireTypeAheadClosedAnalyticsEvent } from '../pm-plugins/analytics';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
2
2
|
import { useIntl } from 'react-intl';
|
|
3
|
-
import { ACTION, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
3
|
+
import { ACTION, INPUT_METHOD } from '@atlaskit/editor-common/analytics/types/enums';
|
|
4
4
|
import { SelectItemMode } from '@atlaskit/editor-common/type-ahead';
|
|
5
5
|
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
6
6
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/editor-experiment';
|
|
@@ -3,11 +3,11 @@ import "./RegisteredTypeAheadMenu.compiled.css";
|
|
|
3
3
|
import { ax, ix } from "@compiled/react/runtime";
|
|
4
4
|
import React, { useCallback, useId, useLayoutEffect, useMemo, useRef, useState, useSyncExternalStore } from 'react';
|
|
5
5
|
import { useIntl } from 'react-intl';
|
|
6
|
+
import Popup from '@atlaskit/editor-common/Popup';
|
|
6
7
|
import { buildQuickInsertMenuModel, getMatchingQuickInsertComponents, getQuickInsertMenuRows, selectQuickInsertCategoryItems } from '@atlaskit/editor-common/quick-insert/registered-menu-model';
|
|
7
8
|
import { useMenuPopupSizing } from '@atlaskit/editor-common/quick-insert/use-menu-popup-sizing';
|
|
8
9
|
import { isSectionOverflowItemKey } from '@atlaskit/editor-common/type-ahead-is-section-overflow-item-key';
|
|
9
10
|
import { TYPE_AHEAD_SURFACE_CONTEXT } from '@atlaskit/editor-common/type-ahead-surface-context';
|
|
10
|
-
import { Popup } from '@atlaskit/editor-common/ui';
|
|
11
11
|
import { akEditorFloatingDialogZIndex } from '@atlaskit/editor-shared-styles/constants';
|
|
12
12
|
import { createSurfaceContext } from '@atlaskit/editor-ui-control-model/create-surface-context';
|
|
13
13
|
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
@@ -4,7 +4,7 @@ import { CellMeasurerCache } from 'react-virtualized/dist/commonjs/CellMeasurer'
|
|
|
4
4
|
import { List } from 'react-virtualized/dist/commonjs/List';
|
|
5
5
|
import { getQuickInsertMenuRows } from '@atlaskit/editor-common/quick-insert/registered-menu-model';
|
|
6
6
|
import { useMenuListHeight } from '@atlaskit/editor-common/quick-insert/use-menu-list-height';
|
|
7
|
-
import { typeAheadListMessages } from '@atlaskit/editor-common/type-ahead';
|
|
7
|
+
import { typeAheadListMessages } from '@atlaskit/editor-common/type-ahead/messages';
|
|
8
8
|
import { Box, Text } from '@atlaskit/primitives/compiled';
|
|
9
9
|
import { createTypeAheadRowRenderer } from './createTypeAheadRowRenderer';
|
|
10
10
|
import { getTypeAheadGlobalViewMoreId } from './getTypeAheadGlobalViewMoreId';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useCallback, useMemo } from 'react';
|
|
2
2
|
import { isOfflineMode } from '@atlaskit/editor-common/connectivity/isOfflineMode';
|
|
3
|
-
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
|
|
4
3
|
import { QuickInsertProvider } from '@atlaskit/editor-common/quick-insert/provider';
|
|
4
|
+
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/useSharedPluginStateWithSelector';
|
|
5
5
|
import { performTypeAheadSelection } from '../../../pm-plugins/commands/insert-type-ahead-item';
|
|
6
6
|
import { useTypeAheadContext } from '../useTypeAheadContext';
|
|
7
7
|
export const TypeAheadQuickInsertProvider = ({
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
1
|
+
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics/types/enums';
|
|
2
2
|
import { MENU } from '@atlaskit/editor-common/quick-insert/keys';
|
|
3
|
-
import { TypeAheadAvailableNodes
|
|
3
|
+
import { TypeAheadAvailableNodes } from '@atlaskit/editor-common/type-ahead';
|
|
4
|
+
import { typeAheadListMessages } from '@atlaskit/editor-common/type-ahead/messages';
|
|
4
5
|
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
5
6
|
import { TypeAheadQuickInsertItem } from './quick-insert/TypeAheadQuickInsertItem';
|
|
6
7
|
import { TypeAheadQuickInsertProvider } from './quick-insert/TypeAheadQuickInsertProvider';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
1
|
+
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics/types/enums';
|
|
2
2
|
export var fireTypeAheadClosedAnalyticsEvent = function fireTypeAheadClosedAnalyticsEvent(api, closeAction, hasQuery, inputMethod) {
|
|
3
3
|
var _api$analytics;
|
|
4
4
|
var invocationMethod = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : null;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
1
|
+
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics/types/enums';
|
|
2
2
|
import { SelectItemMode, TypeAheadAvailableNodes } from '@atlaskit/editor-common/type-ahead';
|
|
3
3
|
import { closeTypeAhead } from './commands/close-type-ahead';
|
|
4
4
|
import { insertTypeAheadItem } from './commands/insert-type-ahead-item';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { normaliseNestedLayout, safeInsert } from '@atlaskit/editor-common/insert';
|
|
2
|
-
import { transformNodeIntoListItem } from '@atlaskit/editor-common/utils';
|
|
2
|
+
import { transformNodeIntoListItem } from '@atlaskit/editor-common/utils/insert-node-into-ordered-list';
|
|
3
3
|
import { isNodeOfSameBaseType } from '@atlaskit/editor-common/utils/node-type-utils';
|
|
4
4
|
import { Fragment, Node as PMNode, Slice } from '@atlaskit/editor-prosemirror/model';
|
|
5
5
|
import { NodeSelection, TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { GapCursorSelection } from '@atlaskit/editor-common/selection';
|
|
1
|
+
import { GapCursorSelection } from '@atlaskit/editor-common/selection/gap-cursor/selection';
|
|
2
2
|
import { NodeSelection, TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
3
3
|
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
4
4
|
import { ACTIONS } from '../actions';
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
1
|
+
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics/types/enums';
|
|
2
2
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
3
3
|
import { createRule } from '@atlaskit/editor-common/utils';
|
|
4
|
-
import {
|
|
4
|
+
import { leafNodeReplacementCharacter } from '@atlaskit/prosemirror-input-rules/constants';
|
|
5
|
+
import { createPlugin } from '@atlaskit/prosemirror-input-rules/utils';
|
|
5
6
|
import { openTypeAheadAtCursor } from '../pm-plugins/commands/open-typeahead-at-cursor';
|
|
6
7
|
export function inputRulePlugin(schema, typeAheads, featureFlags) {
|
|
7
8
|
if (!typeAheads || typeAheads.length === 0) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isOfflineMode } from '@atlaskit/editor-
|
|
1
|
+
import { isOfflineMode } from '@atlaskit/editor-common/connectivity/isOfflineMode';
|
|
2
2
|
export var itemIsDisabled = function itemIsDisabled(item, api) {
|
|
3
3
|
var _api$connectivity;
|
|
4
4
|
var isOffline = isOfflineMode(api === null || api === void 0 || (_api$connectivity = api.connectivity) === null || _api$connectivity === void 0 || (_api$connectivity = _api$connectivity.sharedState.currentState()) === null || _api$connectivity === void 0 ? void 0 : _api$connectivity.mode);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { InsertTypeAheadStep } from '@atlaskit/adf-schema/steps/type-ahead';
|
|
2
|
-
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
2
|
+
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics/types/enums';
|
|
3
3
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
4
|
-
import { closest } from '@atlaskit/editor-common/utils';
|
|
4
|
+
import { closest } from '@atlaskit/editor-common/utils/dom';
|
|
5
5
|
import { DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
6
6
|
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
7
7
|
import { ACTIONS } from './actions';
|