@atlaskit/editor-plugin-quick-insert 6.0.6 → 6.0.8
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 +17 -0
- package/dist/cjs/pm-plugins/experiences/quick-insert-open-experience.js +3 -1
- package/dist/cjs/quickInsertPlugin.js +6 -4
- package/dist/es2019/pm-plugins/experiences/quick-insert-open-experience.js +3 -1
- package/dist/es2019/quickInsertPlugin.js +6 -4
- package/dist/esm/pm-plugins/experiences/quick-insert-open-experience.js +3 -1
- package/dist/esm/quickInsertPlugin.js +6 -4
- package/dist/types/pm-plugins/experiences/quick-insert-open-experience.d.ts +3 -1
- package/dist/types/quickInsertPluginType.d.ts +4 -2
- package/dist/types-ts4.5/pm-plugins/experiences/quick-insert-open-experience.d.ts +3 -1
- package/dist/types-ts4.5/quickInsertPluginType.d.ts +4 -2
- package/package.json +6 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-quick-insert
|
|
2
2
|
|
|
3
|
+
## 6.0.8
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`373dccb169d0b`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/373dccb169d0b) -
|
|
8
|
+
ED-29654 Editor experience custom tracking
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
11
|
+
## 6.0.7
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [`0d661119b4293`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/0d661119b4293) -
|
|
16
|
+
Clean up platform_editor_insertion experiment by shipping control variant. Remove modern TypeAhead
|
|
17
|
+
components and experiment infrastructure while preserving all existing functionality.
|
|
18
|
+
- Updated dependencies
|
|
19
|
+
|
|
3
20
|
## 6.0.6
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
|
@@ -27,7 +27,8 @@ var ABORT_REASON = {
|
|
|
27
27
|
* Abort: When user presses escape or backspace
|
|
28
28
|
*/
|
|
29
29
|
var getQuickInsertOpenExperiencePlugin = exports.getQuickInsertOpenExperiencePlugin = function getQuickInsertOpenExperiencePlugin(_ref) {
|
|
30
|
-
var refs = _ref.refs
|
|
30
|
+
var refs = _ref.refs,
|
|
31
|
+
dispatchAnalyticsEvent = _ref.dispatchAnalyticsEvent;
|
|
31
32
|
var targetEl;
|
|
32
33
|
var editorViewEl;
|
|
33
34
|
var getTarget = function getTarget() {
|
|
@@ -37,6 +38,7 @@ var getQuickInsertOpenExperiencePlugin = exports.getQuickInsertOpenExperiencePlu
|
|
|
37
38
|
return targetEl;
|
|
38
39
|
};
|
|
39
40
|
var experience = new _experiences.Experience('quick-insert-open', {
|
|
41
|
+
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
40
42
|
checks: [new _experiences.ExperienceCheckTimeout({
|
|
41
43
|
durationMs: 500
|
|
42
44
|
}), new _experiences.ExperienceCheckDomMutation({
|
|
@@ -19,7 +19,6 @@ var _typeAhead = require("@atlaskit/editor-common/type-ahead");
|
|
|
19
19
|
var _showMoreHorizontalEditorMore = _interopRequireDefault(require("@atlaskit/icon/core/migration/show-more-horizontal--editor-more"));
|
|
20
20
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
21
21
|
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
22
|
-
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
23
22
|
var _commands = require("./pm-plugins/commands");
|
|
24
23
|
var _quickInsertOpenExperience = require("./pm-plugins/experiences/quick-insert-open-experience");
|
|
25
24
|
var _pluginKey = require("./pm-plugins/plugin-key");
|
|
@@ -43,9 +42,8 @@ var quickInsertPlugin = exports.quickInsertPlugin = function quickInsertPlugin(_
|
|
|
43
42
|
var query = _ref2.query,
|
|
44
43
|
editorState = _ref2.editorState;
|
|
45
44
|
var quickInsertState = _pluginKey.pluginKey.getState(editorState);
|
|
46
|
-
var queryAllItems = '';
|
|
47
45
|
return Promise.resolve((0, _search.getQuickInsertSuggestions)({
|
|
48
|
-
query:
|
|
46
|
+
query: query,
|
|
49
47
|
disableDefaultItems: options === null || options === void 0 ? void 0 : options.disableDefaultItems,
|
|
50
48
|
prioritySortingFn: options === null || options === void 0 ? void 0 : options.prioritySortingFn
|
|
51
49
|
}, quickInsertState === null || quickInsertState === void 0 ? void 0 : quickInsertState.lazyDefaultItems, quickInsertState === null || quickInsertState === void 0 ? void 0 : quickInsertState.providedItems));
|
|
@@ -87,7 +85,11 @@ var quickInsertPlugin = exports.quickInsertPlugin = function quickInsertPlugin(_
|
|
|
87
85
|
name: 'quickInsertOpenExperience',
|
|
88
86
|
plugin: function plugin() {
|
|
89
87
|
return (0, _quickInsertOpenExperience.getQuickInsertOpenExperiencePlugin)({
|
|
90
|
-
refs: refs
|
|
88
|
+
refs: refs,
|
|
89
|
+
dispatchAnalyticsEvent: function dispatchAnalyticsEvent(payload) {
|
|
90
|
+
var _api$analytics;
|
|
91
|
+
return api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 || (_api$analytics = _api$analytics.actions) === null || _api$analytics === void 0 ? void 0 : _api$analytics.fireAnalyticsEvent(payload);
|
|
92
|
+
}
|
|
91
93
|
});
|
|
92
94
|
}
|
|
93
95
|
}] : []));
|
|
@@ -19,7 +19,8 @@ const ABORT_REASON = {
|
|
|
19
19
|
* Abort: When user presses escape or backspace
|
|
20
20
|
*/
|
|
21
21
|
export const getQuickInsertOpenExperiencePlugin = ({
|
|
22
|
-
refs
|
|
22
|
+
refs,
|
|
23
|
+
dispatchAnalyticsEvent
|
|
23
24
|
}) => {
|
|
24
25
|
let targetEl;
|
|
25
26
|
let editorViewEl;
|
|
@@ -30,6 +31,7 @@ export const getQuickInsertOpenExperiencePlugin = ({
|
|
|
30
31
|
return targetEl;
|
|
31
32
|
};
|
|
32
33
|
const experience = new Experience('quick-insert-open', {
|
|
34
|
+
dispatchAnalyticsEvent,
|
|
33
35
|
checks: [new ExperienceCheckTimeout({
|
|
34
36
|
durationMs: 500
|
|
35
37
|
}), new ExperienceCheckDomMutation({
|
|
@@ -8,7 +8,6 @@ import { TypeAheadAvailableNodes } from '@atlaskit/editor-common/type-ahead';
|
|
|
8
8
|
import ShowMoreHorizontalIcon from '@atlaskit/icon/core/migration/show-more-horizontal--editor-more';
|
|
9
9
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
10
10
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
11
|
-
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
12
11
|
import { createInsertItem, openElementBrowserModal } from './pm-plugins/commands';
|
|
13
12
|
import { getQuickInsertOpenExperiencePlugin } from './pm-plugins/experiences/quick-insert-open-experience';
|
|
14
13
|
import { pluginKey } from './pm-plugins/plugin-key';
|
|
@@ -32,9 +31,8 @@ export const quickInsertPlugin = ({
|
|
|
32
31
|
editorState
|
|
33
32
|
}) {
|
|
34
33
|
const quickInsertState = pluginKey.getState(editorState);
|
|
35
|
-
const queryAllItems = '';
|
|
36
34
|
return Promise.resolve(getQuickInsertSuggestions({
|
|
37
|
-
query:
|
|
35
|
+
query: query,
|
|
38
36
|
disableDefaultItems: options === null || options === void 0 ? void 0 : options.disableDefaultItems,
|
|
39
37
|
prioritySortingFn: options === null || options === void 0 ? void 0 : options.prioritySortingFn
|
|
40
38
|
}, quickInsertState === null || quickInsertState === void 0 ? void 0 : quickInsertState.lazyDefaultItems, quickInsertState === null || quickInsertState === void 0 ? void 0 : quickInsertState.providedItems));
|
|
@@ -75,7 +73,11 @@ export const quickInsertPlugin = ({
|
|
|
75
73
|
}, ...(expValEquals('platform_editor_experience_tracking', 'isEnabled', true) ? [{
|
|
76
74
|
name: 'quickInsertOpenExperience',
|
|
77
75
|
plugin: () => getQuickInsertOpenExperiencePlugin({
|
|
78
|
-
refs
|
|
76
|
+
refs,
|
|
77
|
+
dispatchAnalyticsEvent: payload => {
|
|
78
|
+
var _api$analytics, _api$analytics$action;
|
|
79
|
+
return api === null || api === void 0 ? void 0 : (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : (_api$analytics$action = _api$analytics.actions) === null || _api$analytics$action === void 0 ? void 0 : _api$analytics$action.fireAnalyticsEvent(payload);
|
|
80
|
+
}
|
|
79
81
|
})
|
|
80
82
|
}] : [])];
|
|
81
83
|
},
|
|
@@ -20,7 +20,8 @@ var ABORT_REASON = {
|
|
|
20
20
|
* Abort: When user presses escape or backspace
|
|
21
21
|
*/
|
|
22
22
|
export var getQuickInsertOpenExperiencePlugin = function getQuickInsertOpenExperiencePlugin(_ref) {
|
|
23
|
-
var refs = _ref.refs
|
|
23
|
+
var refs = _ref.refs,
|
|
24
|
+
dispatchAnalyticsEvent = _ref.dispatchAnalyticsEvent;
|
|
24
25
|
var targetEl;
|
|
25
26
|
var editorViewEl;
|
|
26
27
|
var getTarget = function getTarget() {
|
|
@@ -30,6 +31,7 @@ export var getQuickInsertOpenExperiencePlugin = function getQuickInsertOpenExper
|
|
|
30
31
|
return targetEl;
|
|
31
32
|
};
|
|
32
33
|
var experience = new Experience('quick-insert-open', {
|
|
34
|
+
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
33
35
|
checks: [new ExperienceCheckTimeout({
|
|
34
36
|
durationMs: 500
|
|
35
37
|
}), new ExperienceCheckDomMutation({
|
|
@@ -14,7 +14,6 @@ import { TypeAheadAvailableNodes } from '@atlaskit/editor-common/type-ahead';
|
|
|
14
14
|
import ShowMoreHorizontalIcon from '@atlaskit/icon/core/migration/show-more-horizontal--editor-more';
|
|
15
15
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
16
16
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
17
|
-
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
18
17
|
import { createInsertItem, openElementBrowserModal as _openElementBrowserModal } from './pm-plugins/commands';
|
|
19
18
|
import { getQuickInsertOpenExperiencePlugin } from './pm-plugins/experiences/quick-insert-open-experience';
|
|
20
19
|
import { pluginKey } from './pm-plugins/plugin-key';
|
|
@@ -36,9 +35,8 @@ export var quickInsertPlugin = function quickInsertPlugin(_ref) {
|
|
|
36
35
|
var query = _ref2.query,
|
|
37
36
|
editorState = _ref2.editorState;
|
|
38
37
|
var quickInsertState = pluginKey.getState(editorState);
|
|
39
|
-
var queryAllItems = '';
|
|
40
38
|
return Promise.resolve(getQuickInsertSuggestions({
|
|
41
|
-
query:
|
|
39
|
+
query: query,
|
|
42
40
|
disableDefaultItems: options === null || options === void 0 ? void 0 : options.disableDefaultItems,
|
|
43
41
|
prioritySortingFn: options === null || options === void 0 ? void 0 : options.prioritySortingFn
|
|
44
42
|
}, quickInsertState === null || quickInsertState === void 0 ? void 0 : quickInsertState.lazyDefaultItems, quickInsertState === null || quickInsertState === void 0 ? void 0 : quickInsertState.providedItems));
|
|
@@ -80,7 +78,11 @@ export var quickInsertPlugin = function quickInsertPlugin(_ref) {
|
|
|
80
78
|
name: 'quickInsertOpenExperience',
|
|
81
79
|
plugin: function plugin() {
|
|
82
80
|
return getQuickInsertOpenExperiencePlugin({
|
|
83
|
-
refs: refs
|
|
81
|
+
refs: refs,
|
|
82
|
+
dispatchAnalyticsEvent: function dispatchAnalyticsEvent(payload) {
|
|
83
|
+
var _api$analytics;
|
|
84
|
+
return api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 || (_api$analytics = _api$analytics.actions) === null || _api$analytics === void 0 ? void 0 : _api$analytics.fireAnalyticsEvent(payload);
|
|
85
|
+
}
|
|
84
86
|
});
|
|
85
87
|
}
|
|
86
88
|
}] : []));
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import type { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
|
|
1
2
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
3
|
type QuickInsertOpenExperienceOptions = {
|
|
4
|
+
dispatchAnalyticsEvent: DispatchAnalyticsEvent;
|
|
3
5
|
refs: {
|
|
4
6
|
popupsMountPoint?: HTMLElement;
|
|
5
7
|
wrapperElement?: HTMLElement;
|
|
@@ -13,5 +15,5 @@ type QuickInsertOpenExperienceOptions = {
|
|
|
13
15
|
* Failure: When 500ms passes without the quick insert menu being added to the DOM
|
|
14
16
|
* Abort: When user presses escape or backspace
|
|
15
17
|
*/
|
|
16
|
-
export declare const getQuickInsertOpenExperiencePlugin: ({ refs }: QuickInsertOpenExperienceOptions) => SafePlugin<any>;
|
|
18
|
+
export declare const getQuickInsertOpenExperiencePlugin: ({ refs, dispatchAnalyticsEvent }: QuickInsertOpenExperienceOptions) => SafePlugin<any>;
|
|
17
19
|
export {};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
2
2
|
import type { QuickInsertItem } from '@atlaskit/editor-common/provider-factory';
|
|
3
|
-
import type { Command, QuickInsertSharedState as CommonQuickInsertSharedState, EditorCommand, NextEditorPlugin, OptionalPlugin, QuickInsertHandler,
|
|
3
|
+
import type { Command, QuickInsertPluginOptions as CommonQuickInsertPluginOptions, QuickInsertSharedState as CommonQuickInsertSharedState, EditorCommand, NextEditorPlugin, OptionalPlugin, QuickInsertHandler, QuickInsertSearchOptions, TypeAheadHandler } from '@atlaskit/editor-common/types';
|
|
4
|
+
import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
4
5
|
import { type ConnectivityPlugin } from '@atlaskit/editor-plugin-connectivity';
|
|
5
6
|
import { type MetricsPlugin } from '@atlaskit/editor-plugin-metrics';
|
|
6
7
|
import type { TypeAheadInputMethod, TypeAheadPlugin } from '@atlaskit/editor-plugin-type-ahead';
|
|
@@ -21,7 +22,8 @@ export type QuickInsertPlugin = NextEditorPlugin<'quickInsert', {
|
|
|
21
22
|
dependencies: [
|
|
22
23
|
TypeAheadPlugin,
|
|
23
24
|
OptionalPlugin<ConnectivityPlugin>,
|
|
24
|
-
OptionalPlugin<MetricsPlugin
|
|
25
|
+
OptionalPlugin<MetricsPlugin>,
|
|
26
|
+
OptionalPlugin<AnalyticsPlugin>
|
|
25
27
|
];
|
|
26
28
|
pluginConfiguration: QuickInsertPluginOptions | undefined;
|
|
27
29
|
sharedState: QuickInsertSharedState | null;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import type { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
|
|
1
2
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
3
|
type QuickInsertOpenExperienceOptions = {
|
|
4
|
+
dispatchAnalyticsEvent: DispatchAnalyticsEvent;
|
|
3
5
|
refs: {
|
|
4
6
|
popupsMountPoint?: HTMLElement;
|
|
5
7
|
wrapperElement?: HTMLElement;
|
|
@@ -13,5 +15,5 @@ type QuickInsertOpenExperienceOptions = {
|
|
|
13
15
|
* Failure: When 500ms passes without the quick insert menu being added to the DOM
|
|
14
16
|
* Abort: When user presses escape or backspace
|
|
15
17
|
*/
|
|
16
|
-
export declare const getQuickInsertOpenExperiencePlugin: ({ refs }: QuickInsertOpenExperienceOptions) => SafePlugin<any>;
|
|
18
|
+
export declare const getQuickInsertOpenExperiencePlugin: ({ refs, dispatchAnalyticsEvent }: QuickInsertOpenExperienceOptions) => SafePlugin<any>;
|
|
17
19
|
export {};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
2
2
|
import type { QuickInsertItem } from '@atlaskit/editor-common/provider-factory';
|
|
3
|
-
import type { Command, QuickInsertSharedState as CommonQuickInsertSharedState, EditorCommand, NextEditorPlugin, OptionalPlugin, QuickInsertHandler,
|
|
3
|
+
import type { Command, QuickInsertPluginOptions as CommonQuickInsertPluginOptions, QuickInsertSharedState as CommonQuickInsertSharedState, EditorCommand, NextEditorPlugin, OptionalPlugin, QuickInsertHandler, QuickInsertSearchOptions, TypeAheadHandler } from '@atlaskit/editor-common/types';
|
|
4
|
+
import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
4
5
|
import { type ConnectivityPlugin } from '@atlaskit/editor-plugin-connectivity';
|
|
5
6
|
import { type MetricsPlugin } from '@atlaskit/editor-plugin-metrics';
|
|
6
7
|
import type { TypeAheadInputMethod, TypeAheadPlugin } from '@atlaskit/editor-plugin-type-ahead';
|
|
@@ -21,7 +22,8 @@ export type QuickInsertPlugin = NextEditorPlugin<'quickInsert', {
|
|
|
21
22
|
dependencies: [
|
|
22
23
|
TypeAheadPlugin,
|
|
23
24
|
OptionalPlugin<ConnectivityPlugin>,
|
|
24
|
-
OptionalPlugin<MetricsPlugin
|
|
25
|
+
OptionalPlugin<MetricsPlugin>,
|
|
26
|
+
OptionalPlugin<AnalyticsPlugin>
|
|
25
27
|
];
|
|
26
28
|
pluginConfiguration: QuickInsertPluginOptions | undefined;
|
|
27
29
|
sharedState: QuickInsertSharedState | null;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-quick-insert",
|
|
3
|
-
"version": "6.0.
|
|
3
|
+
"version": "6.0.8",
|
|
4
4
|
"description": "Quick insert plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -29,7 +29,8 @@
|
|
|
29
29
|
],
|
|
30
30
|
"atlaskit:src": "src/index.ts",
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@atlaskit/button": "^23.
|
|
32
|
+
"@atlaskit/button": "^23.6.0",
|
|
33
|
+
"@atlaskit/editor-plugin-analytics": "^6.2.0",
|
|
33
34
|
"@atlaskit/editor-plugin-connectivity": "^6.0.0",
|
|
34
35
|
"@atlaskit/editor-plugin-metrics": "^7.1.0",
|
|
35
36
|
"@atlaskit/editor-plugin-type-ahead": "^6.5.0",
|
|
@@ -38,13 +39,13 @@
|
|
|
38
39
|
"@atlaskit/modal-dialog": "^14.6.0",
|
|
39
40
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
40
41
|
"@atlaskit/theme": "^21.0.0",
|
|
41
|
-
"@atlaskit/tmp-editor-statsig": "^13.
|
|
42
|
-
"@atlaskit/tokens": "^
|
|
42
|
+
"@atlaskit/tmp-editor-statsig": "^13.33.0",
|
|
43
|
+
"@atlaskit/tokens": "^8.0.0",
|
|
43
44
|
"@babel/runtime": "^7.0.0",
|
|
44
45
|
"@emotion/react": "^11.7.1"
|
|
45
46
|
},
|
|
46
47
|
"peerDependencies": {
|
|
47
|
-
"@atlaskit/editor-common": "^110.
|
|
48
|
+
"@atlaskit/editor-common": "^110.25.0",
|
|
48
49
|
"react": "^18.2.0",
|
|
49
50
|
"react-dom": "^18.2.0",
|
|
50
51
|
"react-intl-next": "npm:react-intl@^5.18.1"
|