@atlaskit/editor-plugin-type-ahead 1.3.1 → 1.4.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 +21 -0
- package/dist/cjs/plugin.js +14 -10
- package/dist/es2019/plugin.js +15 -11
- package/dist/esm/plugin.js +15 -11
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-type-ahead
|
|
2
2
|
|
|
3
|
+
## 1.4.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#116224](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/116224)
|
|
8
|
+
[`ff938650963d9`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/ff938650963d9) -
|
|
9
|
+
ED-23775 This change prevents duplicated analytic events from firing when inserting mentions and
|
|
10
|
+
emojis via the quickInsert typeAhead menu.
|
|
11
|
+
|
|
12
|
+
## 1.4.0
|
|
13
|
+
|
|
14
|
+
### Minor Changes
|
|
15
|
+
|
|
16
|
+
- [#115247](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/115247)
|
|
17
|
+
[`251d23ff9e6c8`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/251d23ff9e6c8) -
|
|
18
|
+
upgrade adf-schema version to 38.0.0
|
|
19
|
+
|
|
20
|
+
### Patch Changes
|
|
21
|
+
|
|
22
|
+
- Updated dependencies
|
|
23
|
+
|
|
3
24
|
## 1.3.1
|
|
4
25
|
|
|
5
26
|
### Patch Changes
|
package/dist/cjs/plugin.js
CHANGED
|
@@ -279,16 +279,20 @@ var typeAheadPlugin = exports.typeAheadPlugin = function typeAheadPlugin(_ref) {
|
|
|
279
279
|
newTriggerHandler.onOpen(newEditorState);
|
|
280
280
|
}
|
|
281
281
|
if (newTriggerHandler && isANewHandler) {
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
282
|
+
// if the typeahead opens another typeahead via the quickInsert we do NOT want to fire this analytic event (mentions and emojis) as it is already being fired from editor-plugin-analytics
|
|
283
|
+
var isDuplicateInvokedEvent = newPluginState.inputMethod === _analytics.INPUT_METHOD.QUICK_INSERT && Object.values(_typeAhead.TypeAheadAvailableNodes).includes(newTriggerHandler.id);
|
|
284
|
+
if (!isDuplicateInvokedEvent) {
|
|
285
|
+
var _api$analytics3;
|
|
286
|
+
api === null || api === void 0 || (_api$analytics3 = api.analytics) === null || _api$analytics3 === void 0 || (_api$analytics3 = _api$analytics3.actions) === null || _api$analytics3 === void 0 || _api$analytics3.fireAnalyticsEvent({
|
|
287
|
+
action: _analytics.ACTION.INVOKED,
|
|
288
|
+
actionSubject: _analytics.ACTION_SUBJECT.TYPEAHEAD,
|
|
289
|
+
actionSubjectId: newTriggerHandler.id || 'not_set',
|
|
290
|
+
attributes: {
|
|
291
|
+
inputMethod: newPluginState.inputMethod || _analytics.INPUT_METHOD.KEYBOARD
|
|
292
|
+
},
|
|
293
|
+
eventType: _analytics.EVENT_TYPE.UI
|
|
294
|
+
});
|
|
295
|
+
}
|
|
292
296
|
}
|
|
293
297
|
}
|
|
294
298
|
};
|
package/dist/es2019/plugin.js
CHANGED
|
@@ -10,7 +10,7 @@ import React from 'react';
|
|
|
10
10
|
import { typeAheadQuery } from '@atlaskit/adf-schema';
|
|
11
11
|
import { ACTION, ACTION_SUBJECT, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
12
12
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
13
|
-
import { SelectItemMode } from '@atlaskit/editor-common/type-ahead';
|
|
13
|
+
import { SelectItemMode, TypeAheadAvailableNodes } from '@atlaskit/editor-common/type-ahead';
|
|
14
14
|
import { DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
15
15
|
import { insertTypeAheadItem } from './commands/insert-type-ahead-item';
|
|
16
16
|
import { inputRulePlugin } from './pm-plugins/input-rules';
|
|
@@ -279,16 +279,20 @@ export const typeAheadPlugin = ({
|
|
|
279
279
|
newTriggerHandler.onOpen(newEditorState);
|
|
280
280
|
}
|
|
281
281
|
if (newTriggerHandler && isANewHandler) {
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
282
|
+
// if the typeahead opens another typeahead via the quickInsert we do NOT want to fire this analytic event (mentions and emojis) as it is already being fired from editor-plugin-analytics
|
|
283
|
+
const isDuplicateInvokedEvent = newPluginState.inputMethod === INPUT_METHOD.QUICK_INSERT && Object.values(TypeAheadAvailableNodes).includes(newTriggerHandler.id);
|
|
284
|
+
if (!isDuplicateInvokedEvent) {
|
|
285
|
+
var _api$analytics3, _api$analytics3$actio;
|
|
286
|
+
api === null || api === void 0 ? void 0 : (_api$analytics3 = api.analytics) === null || _api$analytics3 === void 0 ? void 0 : (_api$analytics3$actio = _api$analytics3.actions) === null || _api$analytics3$actio === void 0 ? void 0 : _api$analytics3$actio.fireAnalyticsEvent({
|
|
287
|
+
action: ACTION.INVOKED,
|
|
288
|
+
actionSubject: ACTION_SUBJECT.TYPEAHEAD,
|
|
289
|
+
actionSubjectId: newTriggerHandler.id || 'not_set',
|
|
290
|
+
attributes: {
|
|
291
|
+
inputMethod: newPluginState.inputMethod || INPUT_METHOD.KEYBOARD
|
|
292
|
+
},
|
|
293
|
+
eventType: EVENT_TYPE.UI
|
|
294
|
+
});
|
|
295
|
+
}
|
|
292
296
|
}
|
|
293
297
|
}
|
|
294
298
|
};
|
package/dist/esm/plugin.js
CHANGED
|
@@ -10,7 +10,7 @@ import React from 'react';
|
|
|
10
10
|
import { typeAheadQuery } from '@atlaskit/adf-schema';
|
|
11
11
|
import { ACTION, ACTION_SUBJECT, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
12
12
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
13
|
-
import { SelectItemMode } from '@atlaskit/editor-common/type-ahead';
|
|
13
|
+
import { SelectItemMode, TypeAheadAvailableNodes } from '@atlaskit/editor-common/type-ahead';
|
|
14
14
|
import { DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
15
15
|
import { insertTypeAheadItem } from './commands/insert-type-ahead-item';
|
|
16
16
|
import { inputRulePlugin } from './pm-plugins/input-rules';
|
|
@@ -271,16 +271,20 @@ export var typeAheadPlugin = function typeAheadPlugin(_ref) {
|
|
|
271
271
|
newTriggerHandler.onOpen(newEditorState);
|
|
272
272
|
}
|
|
273
273
|
if (newTriggerHandler && isANewHandler) {
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
274
|
+
// if the typeahead opens another typeahead via the quickInsert we do NOT want to fire this analytic event (mentions and emojis) as it is already being fired from editor-plugin-analytics
|
|
275
|
+
var isDuplicateInvokedEvent = newPluginState.inputMethod === INPUT_METHOD.QUICK_INSERT && Object.values(TypeAheadAvailableNodes).includes(newTriggerHandler.id);
|
|
276
|
+
if (!isDuplicateInvokedEvent) {
|
|
277
|
+
var _api$analytics3;
|
|
278
|
+
api === null || api === void 0 || (_api$analytics3 = api.analytics) === null || _api$analytics3 === void 0 || (_api$analytics3 = _api$analytics3.actions) === null || _api$analytics3 === void 0 || _api$analytics3.fireAnalyticsEvent({
|
|
279
|
+
action: ACTION.INVOKED,
|
|
280
|
+
actionSubject: ACTION_SUBJECT.TYPEAHEAD,
|
|
281
|
+
actionSubjectId: newTriggerHandler.id || 'not_set',
|
|
282
|
+
attributes: {
|
|
283
|
+
inputMethod: newPluginState.inputMethod || INPUT_METHOD.KEYBOARD
|
|
284
|
+
},
|
|
285
|
+
eventType: EVENT_TYPE.UI
|
|
286
|
+
});
|
|
287
|
+
}
|
|
284
288
|
}
|
|
285
289
|
}
|
|
286
290
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-type-ahead",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.1",
|
|
4
4
|
"description": "Type-ahead plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -32,12 +32,12 @@
|
|
|
32
32
|
".": "./src/index.ts"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@atlaskit/adf-schema": "^
|
|
36
|
-
"@atlaskit/editor-common": "^83.
|
|
37
|
-
"@atlaskit/editor-plugin-analytics": "^1.
|
|
35
|
+
"@atlaskit/adf-schema": "^38.0.0",
|
|
36
|
+
"@atlaskit/editor-common": "^83.4.0",
|
|
37
|
+
"@atlaskit/editor-plugin-analytics": "^1.4.0",
|
|
38
38
|
"@atlaskit/editor-prosemirror": "4.0.1",
|
|
39
39
|
"@atlaskit/editor-shared-styles": "^2.12.0",
|
|
40
|
-
"@atlaskit/menu": "^2.
|
|
40
|
+
"@atlaskit/menu": "^2.6.0",
|
|
41
41
|
"@atlaskit/prosemirror-input-rules": "^3.1.0",
|
|
42
42
|
"@atlaskit/theme": "^12.11.0",
|
|
43
43
|
"@atlaskit/tokens": "^1.53.0",
|