@atlaskit/editor-plugin-quick-insert 22.0.10 → 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,23 @@
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
+
13
+ ## 22.0.11
14
+
15
+ ### Patch Changes
16
+
17
+ - [`9d953d03b62a1`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/9d953d03b62a1) -
18
+ Order non-template slash-command items under platform_editor_slash_command
19
+ - Updated dependencies
20
+
3
21
  ## 22.0.10
4
22
 
5
23
  ### Patch Changes
@@ -17,7 +17,7 @@ var GUID_ONLY_APP_KEY_REGEX = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-
17
17
  var isGuidOnlyAppKey = function isGuidOnlyAppKey(appKey) {
18
18
  return GUID_ONLY_APP_KEY_REGEX.test(appKey);
19
19
  };
20
- var sectionCategoryKeys = (0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)({}, _keys.BLOCK_TEMPLATES_SECTION.key, 'blockTemplates'), _keys.DATA_AND_CHARTS_SECTION.key, 'dataAndCharts'), _keys.EMBED_SECTION.key, 'embed'), _keys.MEDIA_SECTION.key, 'media'), _keys.OTHER_SECTION.key, 'other'), _keys.ROVO_SECTION.key, 'rovo'), _keys.STRUCTURE_SECTION.key, 'structure'), _keys.TEXT_FORMATTING_SECTION.key, 'textFormatting');
20
+ var sectionCategoryKeys = (0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)({}, _keys.BLOCK_TEMPLATES_SECTION.key, 'blockTemplates'), _keys.CREATE_SECTION.key, 'create'), _keys.DATA_AND_CHARTS_SECTION.key, 'dataAndCharts'), _keys.EMBED_SECTION.key, 'embed'), _keys.MEDIA_SECTION.key, 'media'), _keys.OTHER_SECTION.key, 'other'), _keys.ROVO_SECTION.key, 'rovo'), _keys.STRUCTURE_SECTION.key, 'structure'), _keys.TEXT_FORMATTING_SECTION.key, 'textFormatting');
21
21
  var legacyCategoryKeys = new Set(['admin', 'ai', 'block-templates', 'communication', 'confluence-content', 'data-and-charts', 'development', 'embed', 'external-content', 'formatting', 'media', 'navigation', 'other', 'reporting', 'skills', 'structure', 'text-formatting', 'visuals']);
22
22
  var isLegacyCategoryKey = function isLegacyCategoryKey(category) {
23
23
  return legacyCategoryKeys.has(category);
@@ -39,6 +39,7 @@ var calculateQuickInsertItemsAttributes = exports.calculateQuickInsertItemsAttri
39
39
  };
40
40
  var emptyCategoryCounts = {
41
41
  blockTemplates: emptyCategoryInformation(),
42
+ create: emptyCategoryInformation(),
42
43
  dataAndCharts: emptyCategoryInformation(),
43
44
  embed: emptyCategoryInformation(),
44
45
  media: emptyCategoryInformation(),
@@ -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,
@@ -17,7 +17,7 @@ var _keys = require("@atlaskit/editor-common/quick-insert/keys");
17
17
  var _messages = require("@atlaskit/editor-common/quick-insert/messages");
18
18
  var _text = require("@atlaskit/primitives/compiled/text");
19
19
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
20
- var sectionMessages = (0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)({}, _keys.BLOCK_TEMPLATES_SECTION.key, _messages.messages.categoryBlockTemplates), _keys.DATA_AND_CHARTS_SECTION.key, _messages.messages.categoryDataAndCharts), _keys.EMBED_SECTION.key, _messages.messages.categoryEmbed), _keys.MEDIA_SECTION.key, _messages.messages.categoryMedia), _keys.OTHER_SECTION.key, _messages.messages.categoryOther), _keys.ROVO_SECTION.key, _messages.messages.categoryRovo), _keys.STRUCTURE_SECTION.key, _messages.messages.categoryStructure), _keys.TEXT_FORMATTING_SECTION.key, _messages.messages.categoryTextFormatting);
20
+ var sectionMessages = (0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)({}, _keys.BLOCK_TEMPLATES_SECTION.key, _messages.messages.categoryBlockTemplates), _keys.CREATE_SECTION.key, _messages.messages.categoryCreate), _keys.DATA_AND_CHARTS_SECTION.key, _messages.messages.categoryDataAndCharts), _keys.EMBED_SECTION.key, _messages.messages.categoryEmbed), _keys.MEDIA_SECTION.key, _messages.messages.categoryMedia), _keys.OTHER_SECTION.key, _messages.messages.categoryOther), _keys.ROVO_SECTION.key, _messages.messages.categoryRovo), _keys.STRUCTURE_SECTION.key, _messages.messages.categoryStructure), _keys.TEXT_FORMATTING_SECTION.key, _messages.messages.categoryTextFormatting);
21
21
  var categoryGridStyles = null;
22
22
  var RegistryElementBrowserCategories = exports.RegistryElementBrowserCategories = function RegistryElementBrowserCategories(_ref) {
23
23
  var section = _ref.section,
@@ -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
  };
@@ -31,6 +31,9 @@ var categories = [{
31
31
  }, {
32
32
  message: _messages.messages.categoryMedia,
33
33
  section: _keys.MEDIA_SECTION
34
+ }, {
35
+ message: _messages.messages.categoryCreate,
36
+ section: _keys.CREATE_SECTION
34
37
  }, {
35
38
  message: _messages.messages.categoryEmbed,
36
39
  section: _keys.EMBED_SECTION
@@ -1,11 +1,12 @@
1
1
  import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
2
2
  import { getQuickInsertMenuItemParents } from '@atlaskit/editor-common/quick-insert/get-menu-item-parents';
3
- import { BLOCK_TEMPLATES_SECTION, DATA_AND_CHARTS_SECTION, EMBED_SECTION, MEDIA_SECTION, OTHER_SECTION, ROVO_SECTION, STRUCTURE_SECTION, TEXT_FORMATTING_SECTION } from '@atlaskit/editor-common/quick-insert/keys';
3
+ import { BLOCK_TEMPLATES_SECTION, CREATE_SECTION, DATA_AND_CHARTS_SECTION, EMBED_SECTION, MEDIA_SECTION, OTHER_SECTION, ROVO_SECTION, STRUCTURE_SECTION, TEXT_FORMATTING_SECTION } from '@atlaskit/editor-common/quick-insert/keys';
4
4
  export const QUICK_INSERT_ITEMS_ANALYTICS_DELAY_MS = 10_000;
5
5
  const GUID_ONLY_APP_KEY_REGEX = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/iu;
6
6
  const isGuidOnlyAppKey = appKey => GUID_ONLY_APP_KEY_REGEX.test(appKey);
7
7
  const sectionCategoryKeys = {
8
8
  [BLOCK_TEMPLATES_SECTION.key]: 'blockTemplates',
9
+ [CREATE_SECTION.key]: 'create',
9
10
  [DATA_AND_CHARTS_SECTION.key]: 'dataAndCharts',
10
11
  [EMBED_SECTION.key]: 'embed',
11
12
  [MEDIA_SECTION.key]: 'media',
@@ -32,6 +33,7 @@ export const calculateQuickInsertItemsAttributes = ({
32
33
  });
33
34
  const emptyCategoryCounts = {
34
35
  blockTemplates: emptyCategoryInformation(),
36
+ create: emptyCategoryInformation(),
35
37
  dataAndCharts: emptyCategoryInformation(),
36
38
  embed: emptyCategoryInformation(),
37
39
  media: emptyCategoryInformation(),
@@ -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,
@@ -4,11 +4,12 @@ import { ax, ix } from "@compiled/react/runtime";
4
4
  import React, { useCallback } from 'react';
5
5
  import { useIntl } from 'react-intl';
6
6
  import Button from '@atlaskit/button/default/button';
7
- import { BLOCK_TEMPLATES_SECTION, DATA_AND_CHARTS_SECTION, EMBED_SECTION, MEDIA_SECTION, OTHER_SECTION, ROVO_SECTION, STRUCTURE_SECTION, TEXT_FORMATTING_SECTION } from '@atlaskit/editor-common/quick-insert/keys';
7
+ import { BLOCK_TEMPLATES_SECTION, CREATE_SECTION, DATA_AND_CHARTS_SECTION, EMBED_SECTION, MEDIA_SECTION, OTHER_SECTION, ROVO_SECTION, STRUCTURE_SECTION, TEXT_FORMATTING_SECTION } from '@atlaskit/editor-common/quick-insert/keys';
8
8
  import { messages } from '@atlaskit/editor-common/quick-insert/messages';
9
9
  import { Text } from '@atlaskit/primitives/compiled/text';
10
10
  const sectionMessages = {
11
11
  [BLOCK_TEMPLATES_SECTION.key]: messages.categoryBlockTemplates,
12
+ [CREATE_SECTION.key]: messages.categoryCreate,
12
13
  [DATA_AND_CHARTS_SECTION.key]: messages.categoryDataAndCharts,
13
14
  [EMBED_SECTION.key]: messages.categoryEmbed,
14
15
  [MEDIA_SECTION.key]: messages.categoryMedia,
@@ -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
  };
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { useIntl } from 'react-intl';
3
- import { BLOCK_TEMPLATES_SECTION, DATA_AND_CHARTS_SECTION, EMBED_SECTION, MEDIA_SECTION, MENU, OTHER_SECTION, RECOMMENDED_SECTION, ROVO_SECTION, STRUCTURE_SECTION, TEXT_FORMATTING_SECTION, VIEW_ALL_ELEMENTS_MENU_ITEM } from '@atlaskit/editor-common/quick-insert/keys';
3
+ import { BLOCK_TEMPLATES_SECTION, CREATE_SECTION, DATA_AND_CHARTS_SECTION, EMBED_SECTION, MEDIA_SECTION, MENU, OTHER_SECTION, RECOMMENDED_SECTION, ROVO_SECTION, STRUCTURE_SECTION, TEXT_FORMATTING_SECTION, VIEW_ALL_ELEMENTS_MENU_ITEM } from '@atlaskit/editor-common/quick-insert/keys';
4
4
  import { QuickInsertMenuRoot } from '@atlaskit/editor-common/quick-insert/menu-root';
5
5
  import { QuickInsertMenuSection } from '@atlaskit/editor-common/quick-insert/menu-section';
6
6
  import { messages } from '@atlaskit/editor-common/quick-insert/messages';
@@ -20,6 +20,9 @@ const categories = [{
20
20
  }, {
21
21
  message: messages.categoryMedia,
22
22
  section: MEDIA_SECTION
23
+ }, {
24
+ message: messages.categoryCreate,
25
+ section: CREATE_SECTION
23
26
  }, {
24
27
  message: messages.categoryEmbed,
25
28
  section: EMBED_SECTION
@@ -4,13 +4,13 @@ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r)
4
4
  function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
5
5
  import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
6
6
  import { getQuickInsertMenuItemParents } from '@atlaskit/editor-common/quick-insert/get-menu-item-parents';
7
- import { BLOCK_TEMPLATES_SECTION, DATA_AND_CHARTS_SECTION, EMBED_SECTION, MEDIA_SECTION, OTHER_SECTION, ROVO_SECTION, STRUCTURE_SECTION, TEXT_FORMATTING_SECTION } from '@atlaskit/editor-common/quick-insert/keys';
7
+ import { BLOCK_TEMPLATES_SECTION, CREATE_SECTION, DATA_AND_CHARTS_SECTION, EMBED_SECTION, MEDIA_SECTION, OTHER_SECTION, ROVO_SECTION, STRUCTURE_SECTION, TEXT_FORMATTING_SECTION } from '@atlaskit/editor-common/quick-insert/keys';
8
8
  export var QUICK_INSERT_ITEMS_ANALYTICS_DELAY_MS = 10000;
9
9
  var GUID_ONLY_APP_KEY_REGEX = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
10
10
  var isGuidOnlyAppKey = function isGuidOnlyAppKey(appKey) {
11
11
  return GUID_ONLY_APP_KEY_REGEX.test(appKey);
12
12
  };
13
- var sectionCategoryKeys = _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, BLOCK_TEMPLATES_SECTION.key, 'blockTemplates'), DATA_AND_CHARTS_SECTION.key, 'dataAndCharts'), EMBED_SECTION.key, 'embed'), MEDIA_SECTION.key, 'media'), OTHER_SECTION.key, 'other'), ROVO_SECTION.key, 'rovo'), STRUCTURE_SECTION.key, 'structure'), TEXT_FORMATTING_SECTION.key, 'textFormatting');
13
+ var sectionCategoryKeys = _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, BLOCK_TEMPLATES_SECTION.key, 'blockTemplates'), CREATE_SECTION.key, 'create'), DATA_AND_CHARTS_SECTION.key, 'dataAndCharts'), EMBED_SECTION.key, 'embed'), MEDIA_SECTION.key, 'media'), OTHER_SECTION.key, 'other'), ROVO_SECTION.key, 'rovo'), STRUCTURE_SECTION.key, 'structure'), TEXT_FORMATTING_SECTION.key, 'textFormatting');
14
14
  var legacyCategoryKeys = new Set(['admin', 'ai', 'block-templates', 'communication', 'confluence-content', 'data-and-charts', 'development', 'embed', 'external-content', 'formatting', 'media', 'navigation', 'other', 'reporting', 'skills', 'structure', 'text-formatting', 'visuals']);
15
15
  var isLegacyCategoryKey = function isLegacyCategoryKey(category) {
16
16
  return legacyCategoryKeys.has(category);
@@ -32,6 +32,7 @@ export var calculateQuickInsertItemsAttributes = function calculateQuickInsertIt
32
32
  };
33
33
  var emptyCategoryCounts = {
34
34
  blockTemplates: emptyCategoryInformation(),
35
+ create: emptyCategoryInformation(),
35
36
  dataAndCharts: emptyCategoryInformation(),
36
37
  embed: emptyCategoryInformation(),
37
38
  media: emptyCategoryInformation(),
@@ -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,
@@ -5,10 +5,10 @@ import { ax, ix } from "@compiled/react/runtime";
5
5
  import React, { useCallback } from 'react';
6
6
  import { useIntl } from 'react-intl';
7
7
  import Button from '@atlaskit/button/default/button';
8
- import { BLOCK_TEMPLATES_SECTION, DATA_AND_CHARTS_SECTION, EMBED_SECTION, MEDIA_SECTION, OTHER_SECTION, ROVO_SECTION, STRUCTURE_SECTION, TEXT_FORMATTING_SECTION } from '@atlaskit/editor-common/quick-insert/keys';
8
+ import { BLOCK_TEMPLATES_SECTION, CREATE_SECTION, DATA_AND_CHARTS_SECTION, EMBED_SECTION, MEDIA_SECTION, OTHER_SECTION, ROVO_SECTION, STRUCTURE_SECTION, TEXT_FORMATTING_SECTION } from '@atlaskit/editor-common/quick-insert/keys';
9
9
  import { messages } from '@atlaskit/editor-common/quick-insert/messages';
10
10
  import { Text } from '@atlaskit/primitives/compiled/text';
11
- var sectionMessages = _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, BLOCK_TEMPLATES_SECTION.key, messages.categoryBlockTemplates), DATA_AND_CHARTS_SECTION.key, messages.categoryDataAndCharts), EMBED_SECTION.key, messages.categoryEmbed), MEDIA_SECTION.key, messages.categoryMedia), OTHER_SECTION.key, messages.categoryOther), ROVO_SECTION.key, messages.categoryRovo), STRUCTURE_SECTION.key, messages.categoryStructure), TEXT_FORMATTING_SECTION.key, messages.categoryTextFormatting);
11
+ var sectionMessages = _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, BLOCK_TEMPLATES_SECTION.key, messages.categoryBlockTemplates), CREATE_SECTION.key, messages.categoryCreate), DATA_AND_CHARTS_SECTION.key, messages.categoryDataAndCharts), EMBED_SECTION.key, messages.categoryEmbed), MEDIA_SECTION.key, messages.categoryMedia), OTHER_SECTION.key, messages.categoryOther), ROVO_SECTION.key, messages.categoryRovo), STRUCTURE_SECTION.key, messages.categoryStructure), TEXT_FORMATTING_SECTION.key, messages.categoryTextFormatting);
12
12
  var categoryGridStyles = null;
13
13
  export var RegistryElementBrowserCategories = function RegistryElementBrowserCategories(_ref) {
14
14
  var section = _ref.section,
@@ -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
  };
@@ -4,7 +4,7 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
4
4
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
5
5
  import React from 'react';
6
6
  import { useIntl } from 'react-intl';
7
- import { BLOCK_TEMPLATES_SECTION, DATA_AND_CHARTS_SECTION, EMBED_SECTION, MEDIA_SECTION, MENU, OTHER_SECTION, RECOMMENDED_SECTION, ROVO_SECTION, STRUCTURE_SECTION, TEXT_FORMATTING_SECTION, VIEW_ALL_ELEMENTS_MENU_ITEM } from '@atlaskit/editor-common/quick-insert/keys';
7
+ import { BLOCK_TEMPLATES_SECTION, CREATE_SECTION, DATA_AND_CHARTS_SECTION, EMBED_SECTION, MEDIA_SECTION, MENU, OTHER_SECTION, RECOMMENDED_SECTION, ROVO_SECTION, STRUCTURE_SECTION, TEXT_FORMATTING_SECTION, VIEW_ALL_ELEMENTS_MENU_ITEM } from '@atlaskit/editor-common/quick-insert/keys';
8
8
  import { QuickInsertMenuRoot } from '@atlaskit/editor-common/quick-insert/menu-root';
9
9
  import { QuickInsertMenuSection } from '@atlaskit/editor-common/quick-insert/menu-section';
10
10
  import { messages } from '@atlaskit/editor-common/quick-insert/messages';
@@ -24,6 +24,9 @@ var categories = [{
24
24
  }, {
25
25
  message: messages.categoryMedia,
26
26
  section: MEDIA_SECTION
27
+ }, {
28
+ message: messages.categoryCreate,
29
+ section: CREATE_SECTION
27
30
  }, {
28
31
  message: messages.categoryEmbed,
29
32
  section: EMBED_SECTION
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-quick-insert",
3
- "version": "22.0.10",
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"