@atlaskit/editor-plugin-quick-insert 22.0.11 → 23.0.0

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 CHANGED
@@ -1,5 +1,15 @@
1
1
  # @atlaskit/editor-plugin-quick-insert
2
2
 
3
+ ## 23.0.0
4
+
5
+ ### Patch Changes
6
+
7
+ - [`9bc88d7233d4c`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/9bc88d7233d4c) -
8
+ Order platform_editor_slash_command search results by category before match score.
9
+ - [`c906e2e4ceb34`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/c906e2e4ceb34) -
10
+ Clean up experiment `platform_editor_wide_slash_trigger`
11
+ - Updated dependencies
12
+
3
13
  ## 22.0.11
4
14
 
5
15
  ### Patch Changes
@@ -20,7 +20,6 @@ var _typeAhead = require("@atlaskit/editor-common/type-ahead");
20
20
  var _showMoreHorizontal = _interopRequireDefault(require("@atlaskit/icon/core/show-more-horizontal"));
21
21
  var _isExperimentEnabled = require("@atlaskit/platform-feature-experiments/is-experiment-enabled");
22
22
  var _fg = require("@atlaskit/platform-feature-flags/fg");
23
- var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
24
23
  var _appCategoryAnalytics = require("./app-category-analytics");
25
24
  var _commands = require("./pm-plugins/commands");
26
25
  var _quickInsertOpenExperience = require("./pm-plugins/experiences/quick-insert-open-experience");
@@ -46,7 +45,7 @@ var quickInsertPlugin = exports.quickInsertPlugin = function quickInsertPlugin(_
46
45
  id: _typeAhead.TypeAheadAvailableNodes.QUICK_INSERT,
47
46
  trigger: '/',
48
47
  // Support fullwidth slash (U+FF0F) used by Japanese/CJK keyboards (e.g. typing / on a Japanese keyboard layout)
49
- customRegex: (0, _expValEquals.expValEquals)('platform_editor_wide_slash_trigger', 'isEnabled', true) ? '[//]' : undefined,
48
+ customRegex: '[//]',
50
49
  headless: options === null || options === void 0 ? void 0 : options.headless,
51
50
  getItems: function getItems(_ref2) {
52
51
  var query = _ref2.query,
@@ -138,6 +138,7 @@ var getRegistryElementBrowserItems = exports.getRegistryElementBrowserItems = fu
138
138
  score: Math.min(1, Math.max(0, result.score))
139
139
  })] : [];
140
140
  }).sort(function (left, right) {
141
- return left.score - right.score || compareRanks(left.ranks, right.ranks) || left.registration.key.localeCompare(right.registration.key);
141
+ var _left$ranks$, _right$ranks$;
142
+ return ((_left$ranks$ = left.ranks[0]) !== null && _left$ranks$ !== void 0 ? _left$ranks$ : 0) - ((_right$ranks$ = right.ranks[0]) !== null && _right$ranks$ !== void 0 ? _right$ranks$ : 0) || left.score - right.score || compareRanks(left.ranks, right.ranks) || left.registration.key.localeCompare(right.registration.key);
142
143
  });
143
144
  };
@@ -9,7 +9,6 @@ import { TypeAheadAvailableNodes } from '@atlaskit/editor-common/type-ahead';
9
9
  import ShowMoreHorizontalIcon from '@atlaskit/icon/core/show-more-horizontal';
10
10
  import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
11
11
  import { fg } from '@atlaskit/platform-feature-flags/fg';
12
- import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
13
12
  import { createQuickInsertItemsAnalyticsScheduler } from './app-category-analytics';
14
13
  import { createInsertItem, openElementBrowser as openElementBrowserCommand, openElementBrowserModal } from './pm-plugins/commands';
15
14
  import { getQuickInsertOpenExperiencePlugin } from './pm-plugins/experiences/quick-insert-open-experience';
@@ -34,7 +33,7 @@ export const quickInsertPlugin = ({
34
33
  id: TypeAheadAvailableNodes.QUICK_INSERT,
35
34
  trigger: '/',
36
35
  // Support fullwidth slash (U+FF0F) used by Japanese/CJK keyboards (e.g. typing / on a Japanese keyboard layout)
37
- customRegex: expValEquals('platform_editor_wide_slash_trigger', 'isEnabled', true) ? '[//]' : undefined,
36
+ customRegex: '[//]',
38
37
  headless: options === null || options === void 0 ? void 0 : options.headless,
39
38
  getItems({
40
39
  query,
@@ -107,5 +107,8 @@ export const getRegistryElementBrowserItems = ({
107
107
  ...item,
108
108
  score: Math.min(1, Math.max(0, result.score))
109
109
  }] : [];
110
- }).sort((left, right) => left.score - right.score || compareRanks(left.ranks, right.ranks) || left.registration.key.localeCompare(right.registration.key));
110
+ }).sort((left, right) => {
111
+ var _left$ranks$, _right$ranks$;
112
+ return ((_left$ranks$ = left.ranks[0]) !== null && _left$ranks$ !== void 0 ? _left$ranks$ : 0) - ((_right$ranks$ = right.ranks[0]) !== null && _right$ranks$ !== void 0 ? _right$ranks$ : 0) || left.score - right.score || compareRanks(left.ranks, right.ranks) || left.registration.key.localeCompare(right.registration.key);
113
+ });
111
114
  };
@@ -15,7 +15,6 @@ import { TypeAheadAvailableNodes } from '@atlaskit/editor-common/type-ahead';
15
15
  import ShowMoreHorizontalIcon from '@atlaskit/icon/core/show-more-horizontal';
16
16
  import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
17
17
  import { fg } from '@atlaskit/platform-feature-flags/fg';
18
- import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
19
18
  import { createQuickInsertItemsAnalyticsScheduler } from './app-category-analytics';
20
19
  import { createInsertItem, openElementBrowser as openElementBrowserCommand, openElementBrowserModal as _openElementBrowserModal } from './pm-plugins/commands';
21
20
  import { getQuickInsertOpenExperiencePlugin } from './pm-plugins/experiences/quick-insert-open-experience';
@@ -39,7 +38,7 @@ export var quickInsertPlugin = function quickInsertPlugin(_ref) {
39
38
  id: TypeAheadAvailableNodes.QUICK_INSERT,
40
39
  trigger: '/',
41
40
  // Support fullwidth slash (U+FF0F) used by Japanese/CJK keyboards (e.g. typing / on a Japanese keyboard layout)
42
- customRegex: expValEquals('platform_editor_wide_slash_trigger', 'isEnabled', true) ? '[//]' : undefined,
41
+ customRegex: '[//]',
43
42
  headless: options === null || options === void 0 ? void 0 : options.headless,
44
43
  getItems: function getItems(_ref2) {
45
44
  var query = _ref2.query,
@@ -131,6 +131,7 @@ export var getRegistryElementBrowserItems = function getRegistryElementBrowserIt
131
131
  score: Math.min(1, Math.max(0, result.score))
132
132
  })] : [];
133
133
  }).sort(function (left, right) {
134
- return left.score - right.score || compareRanks(left.ranks, right.ranks) || left.registration.key.localeCompare(right.registration.key);
134
+ var _left$ranks$, _right$ranks$;
135
+ return ((_left$ranks$ = left.ranks[0]) !== null && _left$ranks$ !== void 0 ? _left$ranks$ : 0) - ((_right$ranks$ = right.ranks[0]) !== null && _right$ranks$ !== void 0 ? _right$ranks$ : 0) || left.score - right.score || compareRanks(left.ranks, right.ranks) || left.registration.key.localeCompare(right.registration.key);
135
136
  });
136
137
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-quick-insert",
3
- "version": "22.0.11",
3
+ "version": "23.0.0",
4
4
  "description": "Quick insert plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -28,12 +28,12 @@
28
28
  "dependencies": {
29
29
  "@atlaskit/button": "^25.4.0",
30
30
  "@atlaskit/css": "^1.1.0",
31
- "@atlaskit/editor-plugin-analytics": "^22.0.0",
32
- "@atlaskit/editor-plugin-connectivity": "^22.0.0",
33
- "@atlaskit/editor-plugin-editor-viewmode": "^24.0.0",
34
- "@atlaskit/editor-plugin-metrics": "^23.0.0",
35
- "@atlaskit/editor-plugin-type-ahead": "^23.0.0",
36
- "@atlaskit/editor-plugin-ui-control-registry": "^16.0.0",
31
+ "@atlaskit/editor-plugin-analytics": "^23.0.0",
32
+ "@atlaskit/editor-plugin-connectivity": "^23.0.0",
33
+ "@atlaskit/editor-plugin-editor-viewmode": "^25.0.0",
34
+ "@atlaskit/editor-plugin-metrics": "^24.0.0",
35
+ "@atlaskit/editor-plugin-type-ahead": "^24.0.0",
36
+ "@atlaskit/editor-plugin-ui-control-registry": "^17.0.0",
37
37
  "@atlaskit/editor-prosemirror": "^9.0.0",
38
38
  "@atlaskit/editor-tables": "^3.2.0",
39
39
  "@atlaskit/editor-ui-control-model": "^2.10.0",
@@ -44,7 +44,7 @@
44
44
  "@atlaskit/platform-feature-flags": "^2.2.0",
45
45
  "@atlaskit/primitives": "^22.5.0",
46
46
  "@atlaskit/textfield": "^10.2.0",
47
- "@atlaskit/tmp-editor-statsig": "^218.0.0",
47
+ "@atlaskit/tmp-editor-statsig": "^219.0.0",
48
48
  "@atlaskit/tokens": "^20.1.0",
49
49
  "@atlaskit/tooltip": "^24.3.0",
50
50
  "@babel/runtime": "^7.0.0",
@@ -52,7 +52,7 @@
52
52
  "@emotion/react": "^11.7.1"
53
53
  },
54
54
  "peerDependencies": {
55
- "@atlaskit/editor-common": "^126.4.0",
55
+ "@atlaskit/editor-common": "^127.0.0",
56
56
  "react": "^18.2.0 || ^19.2.0",
57
57
  "react-dom": "^18.2.0 || ^19.2.0",
58
58
  "react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"