@atlaskit/editor-plugin-quick-insert 2.0.6 → 2.1.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 +14 -0
- package/dist/cjs/ui/search.js +7 -2
- package/dist/es2019/ui/search.js +6 -1
- package/dist/esm/ui/search.js +7 -2
- package/package.json +11 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-quick-insert
|
|
2
2
|
|
|
3
|
+
## 2.1.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 2.1.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- [#122563](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/122563)
|
|
14
|
+
[`ee7df79353727`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/ee7df79353727) -
|
|
15
|
+
Changes dedupe logic to check title and description instead of just title
|
|
16
|
+
|
|
3
17
|
## 2.0.6
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
package/dist/cjs/ui/search.js
CHANGED
|
@@ -8,6 +8,7 @@ exports.getQuickInsertSuggestions = void 0;
|
|
|
8
8
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
9
9
|
var _quickInsert = require("@atlaskit/editor-common/quick-insert");
|
|
10
10
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
11
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
11
12
|
var getQuickInsertSuggestions = exports.getQuickInsertSuggestions = function getQuickInsertSuggestions(searchOptions) {
|
|
12
13
|
var lazyDefaultItems = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function () {
|
|
13
14
|
return [];
|
|
@@ -21,9 +22,13 @@ var getQuickInsertSuggestions = exports.getQuickInsertSuggestions = function get
|
|
|
21
22
|
templateItems = searchOptions.templateItems,
|
|
22
23
|
prioritySortingFn = searchOptions.prioritySortingFn;
|
|
23
24
|
var defaultItems = disableDefaultItems ? [] : lazyDefaultItems();
|
|
24
|
-
var
|
|
25
|
+
var dedupeFn = (0, _platformFeatureFlags.fg)('platform_editor_quick_insert_dedupe_title_desc') ? function (item) {
|
|
26
|
+
var _item$description;
|
|
27
|
+
return "".concat(item.title, "-").concat((_item$description = item.description) !== null && _item$description !== void 0 ? _item$description : '');
|
|
28
|
+
} : function (item) {
|
|
25
29
|
return item.title;
|
|
26
|
-
}
|
|
30
|
+
};
|
|
31
|
+
var items = providedItems ? (0, _utils.dedupe)([].concat((0, _toConsumableArray2.default)(defaultItems), (0, _toConsumableArray2.default)(providedItems)), dedupeFn) : defaultItems;
|
|
27
32
|
|
|
28
33
|
// For platform_editor_element_level_templates experiment only
|
|
29
34
|
// clean up ticket ED-24873
|
package/dist/es2019/ui/search.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { find } from '@atlaskit/editor-common/quick-insert';
|
|
2
2
|
import { dedupe } from '@atlaskit/editor-common/utils';
|
|
3
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
3
4
|
export const getQuickInsertSuggestions = (searchOptions, lazyDefaultItems = () => [], providedItems) => {
|
|
4
5
|
// @ts-ignore
|
|
5
6
|
const {
|
|
@@ -11,7 +12,11 @@ export const getQuickInsertSuggestions = (searchOptions, lazyDefaultItems = () =
|
|
|
11
12
|
prioritySortingFn
|
|
12
13
|
} = searchOptions;
|
|
13
14
|
const defaultItems = disableDefaultItems ? [] : lazyDefaultItems();
|
|
14
|
-
const
|
|
15
|
+
const dedupeFn = fg('platform_editor_quick_insert_dedupe_title_desc') ? item => {
|
|
16
|
+
var _item$description;
|
|
17
|
+
return `${item.title}-${(_item$description = item.description) !== null && _item$description !== void 0 ? _item$description : ''}`;
|
|
18
|
+
} : item => item.title;
|
|
19
|
+
const items = providedItems ? dedupe([...defaultItems, ...providedItems], dedupeFn) : defaultItems;
|
|
15
20
|
|
|
16
21
|
// For platform_editor_element_level_templates experiment only
|
|
17
22
|
// clean up ticket ED-24873
|
package/dist/esm/ui/search.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
2
2
|
import { find } from '@atlaskit/editor-common/quick-insert';
|
|
3
3
|
import { dedupe } from '@atlaskit/editor-common/utils';
|
|
4
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
4
5
|
export var getQuickInsertSuggestions = function getQuickInsertSuggestions(searchOptions) {
|
|
5
6
|
var lazyDefaultItems = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function () {
|
|
6
7
|
return [];
|
|
@@ -14,9 +15,13 @@ export var getQuickInsertSuggestions = function getQuickInsertSuggestions(search
|
|
|
14
15
|
templateItems = searchOptions.templateItems,
|
|
15
16
|
prioritySortingFn = searchOptions.prioritySortingFn;
|
|
16
17
|
var defaultItems = disableDefaultItems ? [] : lazyDefaultItems();
|
|
17
|
-
var
|
|
18
|
+
var dedupeFn = fg('platform_editor_quick_insert_dedupe_title_desc') ? function (item) {
|
|
19
|
+
var _item$description;
|
|
20
|
+
return "".concat(item.title, "-").concat((_item$description = item.description) !== null && _item$description !== void 0 ? _item$description : '');
|
|
21
|
+
} : function (item) {
|
|
18
22
|
return item.title;
|
|
19
|
-
}
|
|
23
|
+
};
|
|
24
|
+
var items = providedItems ? dedupe([].concat(_toConsumableArray(defaultItems), _toConsumableArray(providedItems)), dedupeFn) : defaultItems;
|
|
20
25
|
|
|
21
26
|
// For platform_editor_element_level_templates experiment only
|
|
22
27
|
// clean up ticket ED-24873
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-quick-insert",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.1.1",
|
|
4
4
|
"description": "Quick insert plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -34,15 +34,16 @@
|
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@atlaskit/button": "^21.1.0",
|
|
37
|
-
"@atlaskit/editor-common": "^102.
|
|
37
|
+
"@atlaskit/editor-common": "^102.4.0",
|
|
38
38
|
"@atlaskit/editor-plugin-connectivity": "^2.0.0",
|
|
39
39
|
"@atlaskit/editor-plugin-type-ahead": "^2.1.0",
|
|
40
40
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
|
41
|
-
"@atlaskit/icon": "^
|
|
41
|
+
"@atlaskit/icon": "^25.0.0",
|
|
42
42
|
"@atlaskit/modal-dialog": "^13.0.0",
|
|
43
|
+
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
43
44
|
"@atlaskit/theme": "^18.0.0",
|
|
44
|
-
"@atlaskit/tmp-editor-statsig": "^3.
|
|
45
|
-
"@atlaskit/tokens": "^4.
|
|
45
|
+
"@atlaskit/tmp-editor-statsig": "^3.6.0",
|
|
46
|
+
"@atlaskit/tokens": "^4.4.0",
|
|
46
47
|
"@babel/runtime": "^7.0.0",
|
|
47
48
|
"@emotion/react": "^11.7.1"
|
|
48
49
|
},
|
|
@@ -94,5 +95,10 @@
|
|
|
94
95
|
"import-no-extraneous-disable-for-examples-and-docs"
|
|
95
96
|
]
|
|
96
97
|
}
|
|
98
|
+
},
|
|
99
|
+
"platform-feature-flags": {
|
|
100
|
+
"platform_editor_quick_insert_dedupe_title_desc": {
|
|
101
|
+
"type": "boolean"
|
|
102
|
+
}
|
|
97
103
|
}
|
|
98
104
|
}
|