@atlaskit/editor-plugin-type-ahead 12.1.14 → 13.0.1
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 +19 -0
- package/dist/cjs/pm-plugins/reducer.js +4 -9
- package/dist/cjs/ui/WrapperTypeAhead.js +1 -1
- package/dist/es2019/pm-plugins/reducer.js +4 -9
- package/dist/es2019/ui/WrapperTypeAhead.js +1 -1
- package/dist/esm/pm-plugins/reducer.js +4 -9
- package/dist/esm/ui/WrapperTypeAhead.js +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-type-ahead
|
|
2
2
|
|
|
3
|
+
## 13.0.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`0e797fd81675f`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/0e797fd81675f) -
|
|
8
|
+
Cleaning up interactivity monitoring experiment
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
11
|
+
## 13.0.0
|
|
12
|
+
|
|
13
|
+
### Major Changes
|
|
14
|
+
|
|
15
|
+
- [`f62c983c6394a`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/f62c983c6394a) -
|
|
16
|
+
Replace platform_editor_typeahead_empty_query_fix with platform_editor_agent_mentions
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- Updated dependencies
|
|
21
|
+
|
|
3
22
|
## 12.1.14
|
|
4
23
|
|
|
5
24
|
### Patch Changes
|
|
@@ -10,7 +10,6 @@ var _steps = require("@atlaskit/adf-schema/steps");
|
|
|
10
10
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
11
11
|
var _view = require("@atlaskit/editor-prosemirror/view");
|
|
12
12
|
var _insm = require("@atlaskit/insm");
|
|
13
|
-
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
14
13
|
var _expVal = require("@atlaskit/tmp-editor-statsig/expVal");
|
|
15
14
|
var _actions = require("./actions");
|
|
16
15
|
var _key = require("./key");
|
|
@@ -65,6 +64,7 @@ var createReducer = exports.createReducer = function createReducer(_ref2) {
|
|
|
65
64
|
createDecorations = _ref2.createDecorations;
|
|
66
65
|
var findHandler = createFindHandler(typeAheadHandlers);
|
|
67
66
|
var openMenu = function openMenu(currentPluginState, _ref3) {
|
|
67
|
+
var _insm$session;
|
|
68
68
|
var tr = _ref3.tr,
|
|
69
69
|
triggerHandler = _ref3.triggerHandler,
|
|
70
70
|
inputMethod = _ref3.inputMethod,
|
|
@@ -80,10 +80,7 @@ var createReducer = exports.createReducer = function createReducer(_ref2) {
|
|
|
80
80
|
decorationSet = _createDecorations.decorationSet,
|
|
81
81
|
decorationElement = _createDecorations.decorationElement,
|
|
82
82
|
stats = _createDecorations.stats;
|
|
83
|
-
|
|
84
|
-
var _insm$session;
|
|
85
|
-
(_insm$session = _insm.insm.session) === null || _insm$session === void 0 || _insm$session.startFeature('typeaheadOpen');
|
|
86
|
-
}
|
|
83
|
+
(_insm$session = _insm.insm.session) === null || _insm$session === void 0 || _insm$session.startFeature('typeaheadOpen');
|
|
87
84
|
return _objectSpread(_objectSpread({}, currentPluginState), {}, {
|
|
88
85
|
stats: stats,
|
|
89
86
|
decorationSet: decorationSet,
|
|
@@ -99,11 +96,9 @@ var createReducer = exports.createReducer = function createReducer(_ref2) {
|
|
|
99
96
|
});
|
|
100
97
|
};
|
|
101
98
|
var closeMenu = function closeMenu(currentPluginState) {
|
|
99
|
+
var _insm$session2;
|
|
102
100
|
removeDecorations(currentPluginState.decorationSet);
|
|
103
|
-
|
|
104
|
-
var _insm$session2;
|
|
105
|
-
(_insm$session2 = _insm.insm.session) === null || _insm$session2 === void 0 || _insm$session2.endFeature('typeaheadOpen');
|
|
106
|
-
}
|
|
101
|
+
(_insm$session2 = _insm.insm.session) === null || _insm$session2 === void 0 || _insm$session2.endFeature('typeaheadOpen');
|
|
107
102
|
return _objectSpread(_objectSpread({}, currentPluginState), {}, {
|
|
108
103
|
inputMethod: null,
|
|
109
104
|
query: '',
|
|
@@ -141,7 +141,7 @@ var WrapperTypeAhead = exports.WrapperTypeAhead = /*#__PURE__*/_react.default.me
|
|
|
141
141
|
(0, _react.useEffect)(function () {
|
|
142
142
|
var view = editorViewRef.current;
|
|
143
143
|
var pluginState = (0, _utils.getPluginState)(view.state);
|
|
144
|
-
var shouldSkipEmptyQuery = !(0, _expVal.expVal)('
|
|
144
|
+
var shouldSkipEmptyQuery = !(0, _expVal.expVal)('platform_editor_agent_mentions', 'isEnabled', false) && query.length === 0;
|
|
145
145
|
if (shouldSkipEmptyQuery || query === (pluginState === null || pluginState === void 0 ? void 0 : pluginState.query) || !(pluginState !== null && pluginState !== void 0 && pluginState.triggerHandler)) {
|
|
146
146
|
return;
|
|
147
147
|
}
|
|
@@ -2,7 +2,6 @@ import { InsertTypeAheadStages, InsertTypeAheadStep } from '@atlaskit/adf-schema
|
|
|
2
2
|
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
3
3
|
import { DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
4
4
|
import { insm } from '@atlaskit/insm';
|
|
5
|
-
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
6
5
|
import { expVal } from '@atlaskit/tmp-editor-statsig/expVal';
|
|
7
6
|
import { ACTIONS } from './actions';
|
|
8
7
|
import { pluginKey } from './key';
|
|
@@ -63,6 +62,7 @@ export const createReducer = ({
|
|
|
63
62
|
selectedIndex,
|
|
64
63
|
removePrefixTriggerOnCancel
|
|
65
64
|
}) => {
|
|
65
|
+
var _insm$session;
|
|
66
66
|
removeDecorations(currentPluginState.decorationSet);
|
|
67
67
|
const {
|
|
68
68
|
decorationSet,
|
|
@@ -73,10 +73,7 @@ export const createReducer = ({
|
|
|
73
73
|
inputMethod,
|
|
74
74
|
reopenQuery
|
|
75
75
|
});
|
|
76
|
-
|
|
77
|
-
var _insm$session;
|
|
78
|
-
(_insm$session = insm.session) === null || _insm$session === void 0 ? void 0 : _insm$session.startFeature('typeaheadOpen');
|
|
79
|
-
}
|
|
76
|
+
(_insm$session = insm.session) === null || _insm$session === void 0 ? void 0 : _insm$session.startFeature('typeaheadOpen');
|
|
80
77
|
return {
|
|
81
78
|
...currentPluginState,
|
|
82
79
|
stats,
|
|
@@ -93,11 +90,9 @@ export const createReducer = ({
|
|
|
93
90
|
};
|
|
94
91
|
};
|
|
95
92
|
const closeMenu = currentPluginState => {
|
|
93
|
+
var _insm$session2;
|
|
96
94
|
removeDecorations(currentPluginState.decorationSet);
|
|
97
|
-
|
|
98
|
-
var _insm$session2;
|
|
99
|
-
(_insm$session2 = insm.session) === null || _insm$session2 === void 0 ? void 0 : _insm$session2.endFeature('typeaheadOpen');
|
|
100
|
-
}
|
|
95
|
+
(_insm$session2 = insm.session) === null || _insm$session2 === void 0 ? void 0 : _insm$session2.endFeature('typeaheadOpen');
|
|
101
96
|
return {
|
|
102
97
|
...currentPluginState,
|
|
103
98
|
inputMethod: null,
|
|
@@ -122,7 +122,7 @@ export const WrapperTypeAhead = /*#__PURE__*/React.memo(({
|
|
|
122
122
|
current: view
|
|
123
123
|
} = editorViewRef;
|
|
124
124
|
const pluginState = getPluginState(view.state);
|
|
125
|
-
const shouldSkipEmptyQuery = !expVal('
|
|
125
|
+
const shouldSkipEmptyQuery = !expVal('platform_editor_agent_mentions', 'isEnabled', false) && query.length === 0;
|
|
126
126
|
if (shouldSkipEmptyQuery || query === (pluginState === null || pluginState === void 0 ? void 0 : pluginState.query) || !(pluginState !== null && pluginState !== void 0 && pluginState.triggerHandler)) {
|
|
127
127
|
return;
|
|
128
128
|
}
|
|
@@ -5,7 +5,6 @@ import { InsertTypeAheadStages, InsertTypeAheadStep } from '@atlaskit/adf-schema
|
|
|
5
5
|
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
6
6
|
import { DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
7
7
|
import { insm } from '@atlaskit/insm';
|
|
8
|
-
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
9
8
|
import { expVal } from '@atlaskit/tmp-editor-statsig/expVal';
|
|
10
9
|
import { ACTIONS } from './actions';
|
|
11
10
|
import { pluginKey } from './key';
|
|
@@ -58,6 +57,7 @@ export var createReducer = function createReducer(_ref2) {
|
|
|
58
57
|
createDecorations = _ref2.createDecorations;
|
|
59
58
|
var findHandler = createFindHandler(typeAheadHandlers);
|
|
60
59
|
var openMenu = function openMenu(currentPluginState, _ref3) {
|
|
60
|
+
var _insm$session;
|
|
61
61
|
var tr = _ref3.tr,
|
|
62
62
|
triggerHandler = _ref3.triggerHandler,
|
|
63
63
|
inputMethod = _ref3.inputMethod,
|
|
@@ -73,10 +73,7 @@ export var createReducer = function createReducer(_ref2) {
|
|
|
73
73
|
decorationSet = _createDecorations.decorationSet,
|
|
74
74
|
decorationElement = _createDecorations.decorationElement,
|
|
75
75
|
stats = _createDecorations.stats;
|
|
76
|
-
|
|
77
|
-
var _insm$session;
|
|
78
|
-
(_insm$session = insm.session) === null || _insm$session === void 0 || _insm$session.startFeature('typeaheadOpen');
|
|
79
|
-
}
|
|
76
|
+
(_insm$session = insm.session) === null || _insm$session === void 0 || _insm$session.startFeature('typeaheadOpen');
|
|
80
77
|
return _objectSpread(_objectSpread({}, currentPluginState), {}, {
|
|
81
78
|
stats: stats,
|
|
82
79
|
decorationSet: decorationSet,
|
|
@@ -92,11 +89,9 @@ export var createReducer = function createReducer(_ref2) {
|
|
|
92
89
|
});
|
|
93
90
|
};
|
|
94
91
|
var closeMenu = function closeMenu(currentPluginState) {
|
|
92
|
+
var _insm$session2;
|
|
95
93
|
removeDecorations(currentPluginState.decorationSet);
|
|
96
|
-
|
|
97
|
-
var _insm$session2;
|
|
98
|
-
(_insm$session2 = insm.session) === null || _insm$session2 === void 0 || _insm$session2.endFeature('typeaheadOpen');
|
|
99
|
-
}
|
|
94
|
+
(_insm$session2 = insm.session) === null || _insm$session2 === void 0 || _insm$session2.endFeature('typeaheadOpen');
|
|
100
95
|
return _objectSpread(_objectSpread({}, currentPluginState), {}, {
|
|
101
96
|
inputMethod: null,
|
|
102
97
|
query: '',
|
|
@@ -132,7 +132,7 @@ export var WrapperTypeAhead = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
132
132
|
useEffect(function () {
|
|
133
133
|
var view = editorViewRef.current;
|
|
134
134
|
var pluginState = getPluginState(view.state);
|
|
135
|
-
var shouldSkipEmptyQuery = !expVal('
|
|
135
|
+
var shouldSkipEmptyQuery = !expVal('platform_editor_agent_mentions', 'isEnabled', false) && query.length === 0;
|
|
136
136
|
if (shouldSkipEmptyQuery || query === (pluginState === null || pluginState === void 0 ? void 0 : pluginState.query) || !(pluginState !== null && pluginState !== void 0 && pluginState.triggerHandler)) {
|
|
137
137
|
return;
|
|
138
138
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-type-ahead",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "13.0.1",
|
|
4
4
|
"description": "Type-ahead plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"@atlaskit/primitives": "^20.5.0",
|
|
37
37
|
"@atlaskit/prosemirror-history": "^1.0.0",
|
|
38
38
|
"@atlaskit/prosemirror-input-rules": "^4.0.0",
|
|
39
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
39
|
+
"@atlaskit/tmp-editor-statsig": "^124.0.0",
|
|
40
40
|
"@atlaskit/tokens": "^15.5.0",
|
|
41
41
|
"@atlaskit/visually-hidden": "^4.1.0",
|
|
42
42
|
"@babel/runtime": "^7.0.0",
|