@atlaskit/editor-plugin-type-ahead 2.2.3 → 2.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-type-ahead
|
|
2
2
|
|
|
3
|
+
## 2.2.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#133624](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/133624)
|
|
8
|
+
[`0054ad6978c1b`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/0054ad6978c1b) -
|
|
9
|
+
Fixed issue when search term is added to document when opening view more from Quickinsert
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
3
12
|
## 2.2.3
|
|
4
13
|
|
|
5
14
|
### Patch Changes
|
|
@@ -17,6 +17,7 @@ var _ui = require("@atlaskit/editor-common/ui");
|
|
|
17
17
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
18
18
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
19
19
|
var _colors = require("@atlaskit/theme/colors");
|
|
20
|
+
var _closeTypeAhead = require("../pm-plugins/commands/close-type-ahead");
|
|
20
21
|
var _constants = require("../pm-plugins/constants");
|
|
21
22
|
var _TypeAheadErrorFallback = require("./TypeAheadErrorFallback");
|
|
22
23
|
var _TypeAheadList = require("./TypeAheadList");
|
|
@@ -293,16 +294,27 @@ var TypeAheadPopup = exports.TypeAheadPopup = /*#__PURE__*/_react.default.memo(f
|
|
|
293
294
|
|
|
294
295
|
// @ts-ignore
|
|
295
296
|
var openElementBrowserModal = triggerHandler === null || triggerHandler === void 0 ? void 0 : triggerHandler.openElementBrowserModal;
|
|
297
|
+
var close = function close(editorView) {
|
|
298
|
+
var tr = editorView.state.tr;
|
|
299
|
+
(0, _closeTypeAhead.closeTypeAhead)(tr);
|
|
300
|
+
editorView.dispatch(tr);
|
|
301
|
+
};
|
|
296
302
|
var onViewMoreClick = (0, _react.useCallback)(function () {
|
|
303
|
+
if ((0, _platformFeatureFlags.fg)('platform_editor_controls_patch_1')) {
|
|
304
|
+
close(editorView);
|
|
305
|
+
}
|
|
306
|
+
|
|
297
307
|
// TODO: ED-26959 - when clean up, remove config in quick insert plugin
|
|
298
308
|
// platform/packages/editor/editor-plugin-quick-insert/src/quickInsertPlugin.tsx (typeAhead.openElementBrowserModal)
|
|
299
309
|
openElementBrowserModal === null || openElementBrowserModal === void 0 || openElementBrowserModal();
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
310
|
+
if (!(0, _platformFeatureFlags.fg)('platform_editor_controls_patch_1')) {
|
|
311
|
+
cancel({
|
|
312
|
+
addPrefixTrigger: false,
|
|
313
|
+
setSelectionAt: _constants.CloseSelectionOptions.AFTER_TEXT_INSERTED,
|
|
314
|
+
forceFocusOnEditor: false
|
|
315
|
+
});
|
|
316
|
+
}
|
|
317
|
+
}, [cancel, editorView, openElementBrowserModal]);
|
|
306
318
|
return (0, _react2.jsx)(_ui.Popup, {
|
|
307
319
|
zIndex: _editorSharedStyles.akEditorFloatingDialogZIndex,
|
|
308
320
|
target: anchorElement,
|
|
@@ -14,6 +14,7 @@ import { findOverflowScrollParent, Popup } from '@atlaskit/editor-common/ui';
|
|
|
14
14
|
import { akEditorFloatingDialogZIndex } from '@atlaskit/editor-shared-styles';
|
|
15
15
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
16
16
|
import { N0, N50A, N60A } from '@atlaskit/theme/colors';
|
|
17
|
+
import { closeTypeAhead } from '../pm-plugins/commands/close-type-ahead';
|
|
17
18
|
import { CloseSelectionOptions, TYPE_AHEAD_DECORATION_DATA_ATTRIBUTE, TYPE_AHEAD_POPUP_CONTENT_CLASS } from '../pm-plugins/constants';
|
|
18
19
|
import { TypeAheadErrorFallback } from './TypeAheadErrorFallback';
|
|
19
20
|
import { TypeAheadList } from './TypeAheadList';
|
|
@@ -286,16 +287,31 @@ export const TypeAheadPopup = /*#__PURE__*/React.memo(props => {
|
|
|
286
287
|
|
|
287
288
|
// @ts-ignore
|
|
288
289
|
const openElementBrowserModal = triggerHandler === null || triggerHandler === void 0 ? void 0 : triggerHandler.openElementBrowserModal;
|
|
290
|
+
const close = editorView => {
|
|
291
|
+
const {
|
|
292
|
+
state: {
|
|
293
|
+
tr
|
|
294
|
+
}
|
|
295
|
+
} = editorView;
|
|
296
|
+
closeTypeAhead(tr);
|
|
297
|
+
editorView.dispatch(tr);
|
|
298
|
+
};
|
|
289
299
|
const onViewMoreClick = useCallback(() => {
|
|
300
|
+
if (fg('platform_editor_controls_patch_1')) {
|
|
301
|
+
close(editorView);
|
|
302
|
+
}
|
|
303
|
+
|
|
290
304
|
// TODO: ED-26959 - when clean up, remove config in quick insert plugin
|
|
291
305
|
// platform/packages/editor/editor-plugin-quick-insert/src/quickInsertPlugin.tsx (typeAhead.openElementBrowserModal)
|
|
292
306
|
openElementBrowserModal === null || openElementBrowserModal === void 0 ? void 0 : openElementBrowserModal();
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
307
|
+
if (!fg('platform_editor_controls_patch_1')) {
|
|
308
|
+
cancel({
|
|
309
|
+
addPrefixTrigger: false,
|
|
310
|
+
setSelectionAt: CloseSelectionOptions.AFTER_TEXT_INSERTED,
|
|
311
|
+
forceFocusOnEditor: false
|
|
312
|
+
});
|
|
313
|
+
}
|
|
314
|
+
}, [cancel, editorView, openElementBrowserModal]);
|
|
299
315
|
return jsx(Popup, {
|
|
300
316
|
zIndex: akEditorFloatingDialogZIndex,
|
|
301
317
|
target: anchorElement,
|
|
@@ -15,6 +15,7 @@ import { findOverflowScrollParent, Popup } from '@atlaskit/editor-common/ui';
|
|
|
15
15
|
import { akEditorFloatingDialogZIndex } from '@atlaskit/editor-shared-styles';
|
|
16
16
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
17
17
|
import { N0, N50A, N60A } from '@atlaskit/theme/colors';
|
|
18
|
+
import { closeTypeAhead } from '../pm-plugins/commands/close-type-ahead';
|
|
18
19
|
import { CloseSelectionOptions, TYPE_AHEAD_DECORATION_DATA_ATTRIBUTE, TYPE_AHEAD_POPUP_CONTENT_CLASS } from '../pm-plugins/constants';
|
|
19
20
|
import { TypeAheadErrorFallback } from './TypeAheadErrorFallback';
|
|
20
21
|
import { TypeAheadList } from './TypeAheadList';
|
|
@@ -282,16 +283,27 @@ export var TypeAheadPopup = /*#__PURE__*/React.memo(function (props) {
|
|
|
282
283
|
|
|
283
284
|
// @ts-ignore
|
|
284
285
|
var openElementBrowserModal = triggerHandler === null || triggerHandler === void 0 ? void 0 : triggerHandler.openElementBrowserModal;
|
|
286
|
+
var close = function close(editorView) {
|
|
287
|
+
var tr = editorView.state.tr;
|
|
288
|
+
closeTypeAhead(tr);
|
|
289
|
+
editorView.dispatch(tr);
|
|
290
|
+
};
|
|
285
291
|
var onViewMoreClick = useCallback(function () {
|
|
292
|
+
if (fg('platform_editor_controls_patch_1')) {
|
|
293
|
+
close(editorView);
|
|
294
|
+
}
|
|
295
|
+
|
|
286
296
|
// TODO: ED-26959 - when clean up, remove config in quick insert plugin
|
|
287
297
|
// platform/packages/editor/editor-plugin-quick-insert/src/quickInsertPlugin.tsx (typeAhead.openElementBrowserModal)
|
|
288
298
|
openElementBrowserModal === null || openElementBrowserModal === void 0 || openElementBrowserModal();
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
299
|
+
if (!fg('platform_editor_controls_patch_1')) {
|
|
300
|
+
cancel({
|
|
301
|
+
addPrefixTrigger: false,
|
|
302
|
+
setSelectionAt: CloseSelectionOptions.AFTER_TEXT_INSERTED,
|
|
303
|
+
forceFocusOnEditor: false
|
|
304
|
+
});
|
|
305
|
+
}
|
|
306
|
+
}, [cancel, editorView, openElementBrowserModal]);
|
|
295
307
|
return jsx(Popup, {
|
|
296
308
|
zIndex: akEditorFloatingDialogZIndex,
|
|
297
309
|
target: anchorElement,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-type-ahead",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.4",
|
|
4
4
|
"description": "Type-ahead plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@atlaskit/adf-schema": "^47.6.0",
|
|
37
|
-
"@atlaskit/editor-common": "^102.
|
|
37
|
+
"@atlaskit/editor-common": "^102.14.0",
|
|
38
38
|
"@atlaskit/editor-element-browser": "^0.1.0",
|
|
39
39
|
"@atlaskit/editor-plugin-analytics": "^2.2.0",
|
|
40
40
|
"@atlaskit/editor-plugin-connectivity": "^2.0.0",
|
|
@@ -106,6 +106,9 @@
|
|
|
106
106
|
},
|
|
107
107
|
"platform_editor_typeahead_dynamic_height_fix": {
|
|
108
108
|
"type": "boolean"
|
|
109
|
+
},
|
|
110
|
+
"platform_editor_controls_patch_1": {
|
|
111
|
+
"type": "boolean"
|
|
109
112
|
}
|
|
110
113
|
}
|
|
111
114
|
}
|