@atlaskit/editor-plugin-type-ahead 2.2.2 → 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 +18 -0
- package/dist/cjs/pm-plugins/decorations.js +3 -1
- package/dist/cjs/ui/TypeAheadPopup.js +18 -6
- package/dist/es2019/pm-plugins/decorations.js +3 -1
- package/dist/es2019/ui/TypeAheadPopup.js +22 -6
- package/dist/esm/pm-plugins/decorations.js +3 -1
- package/dist/esm/ui/TypeAheadPopup.js +18 -6
- package/package.json +10 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
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
|
+
|
|
12
|
+
## 2.2.3
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- [#132892](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/132892)
|
|
17
|
+
[`6db8f28318224`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/6db8f28318224) -
|
|
18
|
+
update type ahead locale, add key to ai preview react list child
|
|
19
|
+
- Updated dependencies
|
|
20
|
+
|
|
3
21
|
## 2.2.2
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
|
@@ -12,6 +12,7 @@ var _w3cKeyname = require("w3c-keyname");
|
|
|
12
12
|
var _history = require("@atlaskit/editor-prosemirror/history");
|
|
13
13
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
14
14
|
var _view = require("@atlaskit/editor-prosemirror/view");
|
|
15
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
15
16
|
var _colors = require("@atlaskit/theme/colors");
|
|
16
17
|
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
17
18
|
var _WrapperTypeAhead = require("../ui/WrapperTypeAhead");
|
|
@@ -93,7 +94,8 @@ var factoryDecorations = exports.factoryDecorations = function factoryDecoration
|
|
|
93
94
|
nodeViewPortalProviderAPI.render(function () {
|
|
94
95
|
var _popupMountRef$curren, _popupMountRef$curren2, _popupMountRef$curren3;
|
|
95
96
|
return /*#__PURE__*/_react.default.createElement(_reactIntlNext.IntlProvider, {
|
|
96
|
-
|
|
97
|
+
defaultLocale: (0, _platformFeatureFlags.fg)('platform_editor_update_type_ahead_locale') ? intl.defaultLocale || 'en-US' : undefined,
|
|
98
|
+
locale: intl.locale || ((0, _platformFeatureFlags.fg)('platform_editor_update_type_ahead_locale') ? 'en-US' : 'en'),
|
|
97
99
|
messages: intl.messages,
|
|
98
100
|
formats: intl.formats
|
|
99
101
|
}, /*#__PURE__*/_react.default.createElement(_WrapperTypeAhead.WrapperTypeAhead, {
|
|
@@ -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,
|
|
@@ -5,6 +5,7 @@ import { keyName as keyNameNormalized } from 'w3c-keyname';
|
|
|
5
5
|
import { redo, undo } from '@atlaskit/editor-prosemirror/history';
|
|
6
6
|
import { TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
7
7
|
import { Decoration, DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
8
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
8
9
|
import { B400 } from '@atlaskit/theme/colors';
|
|
9
10
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
10
11
|
import { WrapperTypeAhead } from '../ui/WrapperTypeAhead';
|
|
@@ -92,7 +93,8 @@ export const factoryDecorations = ({
|
|
|
92
93
|
nodeViewPortalProviderAPI.render(() => {
|
|
93
94
|
var _popupMountRef$curren, _popupMountRef$curren2, _popupMountRef$curren3;
|
|
94
95
|
return /*#__PURE__*/React.createElement(IntlProvider, {
|
|
95
|
-
|
|
96
|
+
defaultLocale: fg('platform_editor_update_type_ahead_locale') ? intl.defaultLocale || 'en-US' : undefined,
|
|
97
|
+
locale: intl.locale || (fg('platform_editor_update_type_ahead_locale') ? 'en-US' : 'en'),
|
|
96
98
|
messages: intl.messages,
|
|
97
99
|
formats: intl.formats
|
|
98
100
|
}, /*#__PURE__*/React.createElement(WrapperTypeAhead, {
|
|
@@ -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,
|
|
@@ -5,6 +5,7 @@ import { keyName as keyNameNormalized } from 'w3c-keyname';
|
|
|
5
5
|
import { redo, undo } from '@atlaskit/editor-prosemirror/history';
|
|
6
6
|
import { TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
7
7
|
import { Decoration, DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
8
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
8
9
|
import { B400 } from '@atlaskit/theme/colors';
|
|
9
10
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
10
11
|
import { WrapperTypeAhead } from '../ui/WrapperTypeAhead';
|
|
@@ -86,7 +87,8 @@ export var factoryDecorations = function factoryDecorations(_ref) {
|
|
|
86
87
|
nodeViewPortalProviderAPI.render(function () {
|
|
87
88
|
var _popupMountRef$curren, _popupMountRef$curren2, _popupMountRef$curren3;
|
|
88
89
|
return /*#__PURE__*/React.createElement(IntlProvider, {
|
|
89
|
-
|
|
90
|
+
defaultLocale: fg('platform_editor_update_type_ahead_locale') ? intl.defaultLocale || 'en-US' : undefined,
|
|
91
|
+
locale: intl.locale || (fg('platform_editor_update_type_ahead_locale') ? 'en-US' : 'en'),
|
|
90
92
|
messages: intl.messages,
|
|
91
93
|
formats: intl.formats
|
|
92
94
|
}, /*#__PURE__*/React.createElement(WrapperTypeAhead, {
|
|
@@ -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",
|
|
@@ -42,8 +42,8 @@
|
|
|
42
42
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
|
43
43
|
"@atlaskit/editor-shared-styles": "^3.4.0",
|
|
44
44
|
"@atlaskit/heading": "^5.1.0",
|
|
45
|
-
"@atlaskit/icon": "^25.
|
|
46
|
-
"@atlaskit/menu": "^3.
|
|
45
|
+
"@atlaskit/icon": "^25.2.0",
|
|
46
|
+
"@atlaskit/menu": "^3.2.0",
|
|
47
47
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
48
48
|
"@atlaskit/primitives": "^14.2.0",
|
|
49
49
|
"@atlaskit/prosemirror-input-rules": "^3.3.0",
|
|
@@ -95,6 +95,9 @@
|
|
|
95
95
|
}
|
|
96
96
|
},
|
|
97
97
|
"platform-feature-flags": {
|
|
98
|
+
"platform_editor_update_type_ahead_locale": {
|
|
99
|
+
"type": "boolean"
|
|
100
|
+
},
|
|
98
101
|
"platform_editor_offline_editing_ga": {
|
|
99
102
|
"type": "boolean"
|
|
100
103
|
},
|
|
@@ -103,6 +106,9 @@
|
|
|
103
106
|
},
|
|
104
107
|
"platform_editor_typeahead_dynamic_height_fix": {
|
|
105
108
|
"type": "boolean"
|
|
109
|
+
},
|
|
110
|
+
"platform_editor_controls_patch_1": {
|
|
111
|
+
"type": "boolean"
|
|
106
112
|
}
|
|
107
113
|
}
|
|
108
114
|
}
|