@atlaskit/editor-plugin-insert-block 27.0.8 → 28.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,20 @@
1
1
  # @atlaskit/editor-plugin-insert-block
2
2
 
3
+ ## 28.0.0
4
+
5
+ ### Patch Changes
6
+
7
+ - [`317175303ec6a`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/317175303ec6a) -
8
+ Build the registered quick-insert menu model with `getQuickInsertMenuModel` from
9
+ `@atlaskit/editor-common`.
10
+ - Updated dependencies
11
+
12
+ ## 27.0.9
13
+
14
+ ### Patch Changes
15
+
16
+ - Updated dependencies
17
+
3
18
  ## 27.0.8
4
19
 
5
20
  ### Patch Changes
@@ -85,13 +85,14 @@ var RegisteredInsertMenu = exports.RegisteredInsertMenu = function RegisteredIns
85
85
  });
86
86
  }, [components]);
87
87
  var model = (0, _react.useMemo)(function () {
88
- return query === '' ? (0, _registeredMenuModel.buildQuickInsertMenuModel)(components, _keys.MENU, hasSectionOverflowItems ? _registeredMenuModel.selectQuickInsertCategoryItems : undefined, surfaceContext, getItemRank) : (0, _registeredMenuModel.getMatchingQuickInsertComponents)({
88
+ return (0, _registeredMenuModel.getQuickInsertMenuModel)({
89
89
  components: components,
90
90
  formatMessage: formatMessage,
91
+ getItemRank: getItemRank,
91
92
  query: query,
92
93
  rootComponent: _keys.MENU,
93
- surfaceContext: surfaceContext,
94
- getItemRank: getItemRank
94
+ selectCategoryItems: hasSectionOverflowItems ? _registeredMenuModel.selectQuickInsertCategoryItems : undefined,
95
+ surfaceContext: surfaceContext
95
96
  });
96
97
  }, [components, formatMessage, getItemRank, hasSectionOverflowItems, query, surfaceContext]);
97
98
  var selectableItems = (0, _react.useMemo)(function () {
@@ -6,7 +6,7 @@ import { useIntl } from 'react-intl';
6
6
  import { getDocument } from '@atlaskit/browser-apis';
7
7
  import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages/insert-block';
8
8
  import { MENU } from '@atlaskit/editor-common/quick-insert/keys';
9
- import { buildQuickInsertMenuModel, getMatchingQuickInsertComponents, getQuickInsertMenuRows, selectQuickInsertCategoryItems } from '@atlaskit/editor-common/quick-insert/registered-menu-model';
9
+ import { getQuickInsertMenuModel, getQuickInsertMenuRows, selectQuickInsertCategoryItems } from '@atlaskit/editor-common/quick-insert/registered-menu-model';
10
10
  import { isSectionOverflowItemKey } from '@atlaskit/editor-common/type-ahead-is-section-overflow-item-key';
11
11
  import { TYPE_AHEAD_SURFACE_CONTEXT } from '@atlaskit/editor-common/type-ahead-surface-context';
12
12
  import { createSurfaceContext } from '@atlaskit/editor-ui-control-model/create-surface-context';
@@ -56,13 +56,14 @@ export const RegisteredInsertMenu = ({
56
56
  const hasSectionOverflowItems = useMemo(() => components.some(({
57
57
  key
58
58
  }) => isSectionOverflowItemKey(key)), [components]);
59
- const model = useMemo(() => query === '' ? buildQuickInsertMenuModel(components, MENU, hasSectionOverflowItems ? selectQuickInsertCategoryItems : undefined, surfaceContext, getItemRank) : getMatchingQuickInsertComponents({
59
+ const model = useMemo(() => getQuickInsertMenuModel({
60
60
  components,
61
61
  formatMessage,
62
+ getItemRank,
62
63
  query,
63
64
  rootComponent: MENU,
64
- surfaceContext,
65
- getItemRank
65
+ selectCategoryItems: hasSectionOverflowItems ? selectQuickInsertCategoryItems : undefined,
66
+ surfaceContext
66
67
  }), [components, formatMessage, getItemRank, hasSectionOverflowItems, query, surfaceContext]);
67
68
  const selectableItems = useMemo(() => getQuickInsertMenuRows(model).filter(row => row.type === 'menu-item'), [model]);
68
69
  const itemCount = selectableItems.length + (model.footer ? 1 : 0);
@@ -8,7 +8,7 @@ import { useIntl } from 'react-intl';
8
8
  import { getDocument } from '@atlaskit/browser-apis';
9
9
  import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages/insert-block';
10
10
  import { MENU } from '@atlaskit/editor-common/quick-insert/keys';
11
- import { buildQuickInsertMenuModel, getMatchingQuickInsertComponents, getQuickInsertMenuRows, selectQuickInsertCategoryItems } from '@atlaskit/editor-common/quick-insert/registered-menu-model';
11
+ import { getQuickInsertMenuModel, getQuickInsertMenuRows, selectQuickInsertCategoryItems } from '@atlaskit/editor-common/quick-insert/registered-menu-model';
12
12
  import { isSectionOverflowItemKey } from '@atlaskit/editor-common/type-ahead-is-section-overflow-item-key';
13
13
  import { TYPE_AHEAD_SURFACE_CONTEXT } from '@atlaskit/editor-common/type-ahead-surface-context';
14
14
  import { createSurfaceContext } from '@atlaskit/editor-ui-control-model/create-surface-context';
@@ -76,13 +76,14 @@ export var RegisteredInsertMenu = function RegisteredInsertMenu(_ref) {
76
76
  });
77
77
  }, [components]);
78
78
  var model = useMemo(function () {
79
- return query === '' ? buildQuickInsertMenuModel(components, MENU, hasSectionOverflowItems ? selectQuickInsertCategoryItems : undefined, surfaceContext, getItemRank) : getMatchingQuickInsertComponents({
79
+ return getQuickInsertMenuModel({
80
80
  components: components,
81
81
  formatMessage: formatMessage,
82
+ getItemRank: getItemRank,
82
83
  query: query,
83
84
  rootComponent: MENU,
84
- surfaceContext: surfaceContext,
85
- getItemRank: getItemRank
85
+ selectCategoryItems: hasSectionOverflowItems ? selectQuickInsertCategoryItems : undefined,
86
+ surfaceContext: surfaceContext
86
87
  });
87
88
  }, [components, formatMessage, getItemRank, hasSectionOverflowItems, query, surfaceContext]);
88
89
  var selectableItems = useMemo(function () {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-insert-block",
3
- "version": "27.0.8",
3
+ "version": "28.0.0",
4
4
  "description": "Insert block plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -23,33 +23,33 @@
23
23
  "dependencies": {
24
24
  "@atlaskit/browser-apis": "^1.2.0",
25
25
  "@atlaskit/css": "^1.1.0",
26
- "@atlaskit/editor-plugin-analytics": "^26.0.0",
27
- "@atlaskit/editor-plugin-block-type": "^30.0.0",
28
- "@atlaskit/editor-plugin-code-block": "^28.0.0",
29
- "@atlaskit/editor-plugin-connectivity": "^26.0.0",
30
- "@atlaskit/editor-plugin-date": "^28.0.0",
31
- "@atlaskit/editor-plugin-emoji": "^27.0.0",
32
- "@atlaskit/editor-plugin-expand": "^27.0.0",
33
- "@atlaskit/editor-plugin-extension": "^29.0.0",
34
- "@atlaskit/editor-plugin-feature-flags": "^25.0.0",
35
- "@atlaskit/editor-plugin-hyperlink": "^28.0.0",
36
- "@atlaskit/editor-plugin-image-upload": "^26.0.0",
37
- "@atlaskit/editor-plugin-layout": "^27.0.0",
38
- "@atlaskit/editor-plugin-media": "^28.1.0",
39
- "@atlaskit/editor-plugin-media-insert": "^44.0.0",
40
- "@atlaskit/editor-plugin-mentions": "^28.1.0",
41
- "@atlaskit/editor-plugin-metrics": "^27.0.0",
42
- "@atlaskit/editor-plugin-panel": "^28.0.0",
43
- "@atlaskit/editor-plugin-placeholder-text": "^27.0.0",
44
- "@atlaskit/editor-plugin-primary-toolbar": "^27.0.0",
45
- "@atlaskit/editor-plugin-quick-insert": "^26.1.0",
46
- "@atlaskit/editor-plugin-rule": "^26.0.0",
47
- "@atlaskit/editor-plugin-status": "^27.0.0",
48
- "@atlaskit/editor-plugin-table": "^38.0.0",
49
- "@atlaskit/editor-plugin-tasks-and-decisions": "^29.0.0",
50
- "@atlaskit/editor-plugin-toolbar": "^23.0.0",
51
- "@atlaskit/editor-plugin-type-ahead": "^27.0.0",
52
- "@atlaskit/editor-plugin-ui-control-registry": "^20.0.0",
26
+ "@atlaskit/editor-plugin-analytics": "^27.0.0",
27
+ "@atlaskit/editor-plugin-block-type": "^31.0.0",
28
+ "@atlaskit/editor-plugin-code-block": "^29.0.0",
29
+ "@atlaskit/editor-plugin-connectivity": "^27.0.0",
30
+ "@atlaskit/editor-plugin-date": "^29.0.0",
31
+ "@atlaskit/editor-plugin-emoji": "^28.0.0",
32
+ "@atlaskit/editor-plugin-expand": "^28.0.0",
33
+ "@atlaskit/editor-plugin-extension": "^30.0.0",
34
+ "@atlaskit/editor-plugin-feature-flags": "^26.0.0",
35
+ "@atlaskit/editor-plugin-hyperlink": "^29.0.0",
36
+ "@atlaskit/editor-plugin-image-upload": "^27.0.0",
37
+ "@atlaskit/editor-plugin-layout": "^28.0.0",
38
+ "@atlaskit/editor-plugin-media": "^29.0.0",
39
+ "@atlaskit/editor-plugin-media-insert": "^45.0.0",
40
+ "@atlaskit/editor-plugin-mentions": "^29.0.0",
41
+ "@atlaskit/editor-plugin-metrics": "^28.0.0",
42
+ "@atlaskit/editor-plugin-panel": "^29.0.0",
43
+ "@atlaskit/editor-plugin-placeholder-text": "^28.0.0",
44
+ "@atlaskit/editor-plugin-primary-toolbar": "^28.0.0",
45
+ "@atlaskit/editor-plugin-quick-insert": "^27.0.0",
46
+ "@atlaskit/editor-plugin-rule": "^27.0.0",
47
+ "@atlaskit/editor-plugin-status": "^28.0.0",
48
+ "@atlaskit/editor-plugin-table": "^39.0.0",
49
+ "@atlaskit/editor-plugin-tasks-and-decisions": "^30.0.0",
50
+ "@atlaskit/editor-plugin-toolbar": "^24.0.0",
51
+ "@atlaskit/editor-plugin-type-ahead": "^28.0.0",
52
+ "@atlaskit/editor-plugin-ui-control-registry": "^21.0.0",
53
53
  "@atlaskit/editor-prosemirror": "^9.0.0",
54
54
  "@atlaskit/editor-shared-styles": "^4.4.0",
55
55
  "@atlaskit/editor-toolbar": "^2.8.0",
@@ -62,8 +62,8 @@
62
62
  "@atlaskit/platform-feature-flags": "^2.2.0",
63
63
  "@atlaskit/primitives": "^22.5.0",
64
64
  "@atlaskit/textfield": "^10.2.0",
65
- "@atlaskit/tmp-editor-statsig": "^234.0.0",
66
- "@atlaskit/tokens": "^20.4.0",
65
+ "@atlaskit/tmp-editor-statsig": "^235.0.0",
66
+ "@atlaskit/tokens": "^20.5.0",
67
67
  "@babel/runtime": "^7.0.0",
68
68
  "@emotion/react": "^11.7.1",
69
69
  "bind-event-listener": "^3.0.0",
@@ -72,7 +72,7 @@
72
72
  "react-virtualized": "^9.22.6"
73
73
  },
74
74
  "peerDependencies": {
75
- "@atlaskit/editor-common": "^130.5.0",
75
+ "@atlaskit/editor-common": "^131.0.0",
76
76
  "react": "^18.2.0 || ^19.2.0",
77
77
  "react-dom": "^18.2.0 || ^19.2.0",
78
78
  "react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"