@atlaskit/editor-plugin-insert-block 19.0.11 → 20.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,31 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-insert-block
|
|
2
2
|
|
|
3
|
+
## 20.0.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 19.0.12
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`749f1c3c8359c`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/749f1c3c8359c) -
|
|
14
|
+
Retain the first 30 category results and include the first 10 ecosystem quick-insert registrations
|
|
15
|
+
when they fall beyond that cutoff.
|
|
16
|
+
|
|
17
|
+
Limit slash-command insert-menu category browsing while preserving uncapped search results.
|
|
18
|
+
|
|
19
|
+
Classify ecosystem quick-insert provider registrations without changing compatibility keys.
|
|
20
|
+
|
|
21
|
+
Preserve app provenance for Quick Insert items while the `platform_editor_slash_command`
|
|
22
|
+
experiment is enabled.
|
|
23
|
+
|
|
24
|
+
Enable Quick Insert category analytics while the `platform_editor_slash_command` experiment is
|
|
25
|
+
enabled.
|
|
26
|
+
|
|
27
|
+
- Updated dependencies
|
|
28
|
+
|
|
3
29
|
## 19.0.11
|
|
4
30
|
|
|
5
31
|
### Patch Changes
|
|
@@ -17,6 +17,7 @@ var _reactIntl = require("react-intl");
|
|
|
17
17
|
var _messages = require("@atlaskit/editor-common/messages");
|
|
18
18
|
var _registeredMenuModel = require("@atlaskit/editor-common/quick-insert/registered-menu-model");
|
|
19
19
|
var _keys = require("@atlaskit/editor-common/quick-insert/keys");
|
|
20
|
+
var _typeAheadIsSectionOverflowItemKey = require("@atlaskit/editor-common/type-ahead-is-section-overflow-item-key");
|
|
20
21
|
var _typeAheadSurfaceContext = require("@atlaskit/editor-common/type-ahead-surface-context");
|
|
21
22
|
var _createSurfaceContext = require("@atlaskit/editor-ui-control-model/create-surface-context");
|
|
22
23
|
var _compiled = require("@atlaskit/primitives/compiled");
|
|
@@ -63,19 +64,25 @@ var RegisteredInsertMenu = exports.RegisteredInsertMenu = function RegisteredIns
|
|
|
63
64
|
menuOpenId: menuOpenId
|
|
64
65
|
});
|
|
65
66
|
}, [menuOpenId]);
|
|
67
|
+
var hasSectionOverflowItems = (0, _react.useMemo)(function () {
|
|
68
|
+
return components.some(function (_ref2) {
|
|
69
|
+
var key = _ref2.key;
|
|
70
|
+
return (0, _typeAheadIsSectionOverflowItemKey.isSectionOverflowItemKey)(key);
|
|
71
|
+
});
|
|
72
|
+
}, [components]);
|
|
66
73
|
var model = (0, _react.useMemo)(function () {
|
|
67
|
-
return query === '' ? (0, _registeredMenuModel.buildQuickInsertMenuModel)(components, _keys.MENU, undefined, surfaceContext) : (0, _registeredMenuModel.getMatchingQuickInsertComponents)({
|
|
74
|
+
return query === '' ? (0, _registeredMenuModel.buildQuickInsertMenuModel)(components, _keys.MENU, hasSectionOverflowItems ? _registeredMenuModel.selectQuickInsertCategoryItems : undefined, surfaceContext) : (0, _registeredMenuModel.getMatchingQuickInsertComponents)({
|
|
68
75
|
components: components,
|
|
69
76
|
formatMessage: formatMessage,
|
|
70
77
|
query: query,
|
|
71
78
|
rootComponent: _keys.MENU,
|
|
72
79
|
surfaceContext: surfaceContext
|
|
73
80
|
});
|
|
74
|
-
}, [components, formatMessage, query, surfaceContext]);
|
|
81
|
+
}, [components, formatMessage, hasSectionOverflowItems, query, surfaceContext]);
|
|
75
82
|
var itemCount = (0, _react.useMemo)(function () {
|
|
76
|
-
return model.sections.reduce(function (count,
|
|
77
|
-
var
|
|
78
|
-
items = _arrayLikeToArray(
|
|
83
|
+
return model.sections.reduce(function (count, _ref3) {
|
|
84
|
+
var _ref4 = (0, _toArray2.default)(_ref3),
|
|
85
|
+
items = _arrayLikeToArray(_ref4).slice(1);
|
|
79
86
|
return count + items.length;
|
|
80
87
|
}, 0) + (model.footer ? 1 : 0);
|
|
81
88
|
}, [model.footer, model.sections]);
|
|
@@ -5,8 +5,9 @@ import React, { useCallback, useId, useMemo, useState } from 'react';
|
|
|
5
5
|
import { getDocument } from '@atlaskit/browser-apis';
|
|
6
6
|
import { useIntl } from 'react-intl';
|
|
7
7
|
import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
|
|
8
|
-
import { buildQuickInsertMenuModel, getMatchingQuickInsertComponents } from '@atlaskit/editor-common/quick-insert/registered-menu-model';
|
|
8
|
+
import { buildQuickInsertMenuModel, getMatchingQuickInsertComponents, selectQuickInsertCategoryItems } from '@atlaskit/editor-common/quick-insert/registered-menu-model';
|
|
9
9
|
import { MENU } from '@atlaskit/editor-common/quick-insert/keys';
|
|
10
|
+
import { isSectionOverflowItemKey } from '@atlaskit/editor-common/type-ahead-is-section-overflow-item-key';
|
|
10
11
|
import { TYPE_AHEAD_SURFACE_CONTEXT } from '@atlaskit/editor-common/type-ahead-surface-context';
|
|
11
12
|
import { createSurfaceContext } from '@atlaskit/editor-ui-control-model/create-surface-context';
|
|
12
13
|
import { Box } from '@atlaskit/primitives/compiled';
|
|
@@ -38,13 +39,16 @@ export const RegisteredInsertMenu = ({
|
|
|
38
39
|
const surfaceContext = useMemo(() => createSurfaceContext(TYPE_AHEAD_SURFACE_CONTEXT, {
|
|
39
40
|
menuOpenId
|
|
40
41
|
}), [menuOpenId]);
|
|
41
|
-
const
|
|
42
|
+
const hasSectionOverflowItems = useMemo(() => components.some(({
|
|
43
|
+
key
|
|
44
|
+
}) => isSectionOverflowItemKey(key)), [components]);
|
|
45
|
+
const model = useMemo(() => query === '' ? buildQuickInsertMenuModel(components, MENU, hasSectionOverflowItems ? selectQuickInsertCategoryItems : undefined, surfaceContext) : getMatchingQuickInsertComponents({
|
|
42
46
|
components,
|
|
43
47
|
formatMessage,
|
|
44
48
|
query,
|
|
45
49
|
rootComponent: MENU,
|
|
46
50
|
surfaceContext
|
|
47
|
-
}), [components, formatMessage, query, surfaceContext]);
|
|
51
|
+
}), [components, formatMessage, hasSectionOverflowItems, query, surfaceContext]);
|
|
48
52
|
const itemCount = useMemo(() => model.sections.reduce((count, [, ...items]) => count + items.length, 0) + (model.footer ? 1 : 0), [model.footer, model.sections]);
|
|
49
53
|
const isActiveItemMounted = selectedItemIndex >= 0 && selectedItemIndex < itemCount && (selectedItemIndex >= renderedItems.startIndex && selectedItemIndex <= renderedItems.stopIndex || Boolean(model.footer) && selectedItemIndex === itemCount - 1);
|
|
50
54
|
const activeItemId = `${listId}-${selectedItemIndex}`;
|
|
@@ -8,8 +8,9 @@ import React, { useCallback, useId, useMemo, useState } from 'react';
|
|
|
8
8
|
import { getDocument } from '@atlaskit/browser-apis';
|
|
9
9
|
import { useIntl } from 'react-intl';
|
|
10
10
|
import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
|
|
11
|
-
import { buildQuickInsertMenuModel, getMatchingQuickInsertComponents } from '@atlaskit/editor-common/quick-insert/registered-menu-model';
|
|
11
|
+
import { buildQuickInsertMenuModel, getMatchingQuickInsertComponents, selectQuickInsertCategoryItems } from '@atlaskit/editor-common/quick-insert/registered-menu-model';
|
|
12
12
|
import { MENU } from '@atlaskit/editor-common/quick-insert/keys';
|
|
13
|
+
import { isSectionOverflowItemKey } from '@atlaskit/editor-common/type-ahead-is-section-overflow-item-key';
|
|
13
14
|
import { TYPE_AHEAD_SURFACE_CONTEXT } from '@atlaskit/editor-common/type-ahead-surface-context';
|
|
14
15
|
import { createSurfaceContext } from '@atlaskit/editor-ui-control-model/create-surface-context';
|
|
15
16
|
import { Box } from '@atlaskit/primitives/compiled';
|
|
@@ -54,19 +55,25 @@ export var RegisteredInsertMenu = function RegisteredInsertMenu(_ref) {
|
|
|
54
55
|
menuOpenId: menuOpenId
|
|
55
56
|
});
|
|
56
57
|
}, [menuOpenId]);
|
|
58
|
+
var hasSectionOverflowItems = useMemo(function () {
|
|
59
|
+
return components.some(function (_ref2) {
|
|
60
|
+
var key = _ref2.key;
|
|
61
|
+
return isSectionOverflowItemKey(key);
|
|
62
|
+
});
|
|
63
|
+
}, [components]);
|
|
57
64
|
var model = useMemo(function () {
|
|
58
|
-
return query === '' ? buildQuickInsertMenuModel(components, MENU, undefined, surfaceContext) : getMatchingQuickInsertComponents({
|
|
65
|
+
return query === '' ? buildQuickInsertMenuModel(components, MENU, hasSectionOverflowItems ? selectQuickInsertCategoryItems : undefined, surfaceContext) : getMatchingQuickInsertComponents({
|
|
59
66
|
components: components,
|
|
60
67
|
formatMessage: formatMessage,
|
|
61
68
|
query: query,
|
|
62
69
|
rootComponent: MENU,
|
|
63
70
|
surfaceContext: surfaceContext
|
|
64
71
|
});
|
|
65
|
-
}, [components, formatMessage, query, surfaceContext]);
|
|
72
|
+
}, [components, formatMessage, hasSectionOverflowItems, query, surfaceContext]);
|
|
66
73
|
var itemCount = useMemo(function () {
|
|
67
|
-
return model.sections.reduce(function (count,
|
|
68
|
-
var
|
|
69
|
-
items = _arrayLikeToArray(
|
|
74
|
+
return model.sections.reduce(function (count, _ref3) {
|
|
75
|
+
var _ref4 = _toArray(_ref3),
|
|
76
|
+
items = _arrayLikeToArray(_ref4).slice(1);
|
|
70
77
|
return count + items.length;
|
|
71
78
|
}, 0) + (model.footer ? 1 : 0);
|
|
72
79
|
}, [model.footer, model.sections]);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-insert-block",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "20.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,34 +23,34 @@
|
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"@atlaskit/browser-apis": "^1.2.0",
|
|
25
25
|
"@atlaskit/css": "^1.1.0",
|
|
26
|
-
"@atlaskit/editor-plugin-analytics": "^
|
|
27
|
-
"@atlaskit/editor-plugin-block-type": "^
|
|
28
|
-
"@atlaskit/editor-plugin-code-block": "^
|
|
29
|
-
"@atlaskit/editor-plugin-connectivity": "^
|
|
30
|
-
"@atlaskit/editor-plugin-date": "^
|
|
31
|
-
"@atlaskit/editor-plugin-emoji": "^
|
|
32
|
-
"@atlaskit/editor-plugin-expand": "^
|
|
33
|
-
"@atlaskit/editor-plugin-extension": "^
|
|
34
|
-
"@atlaskit/editor-plugin-feature-flags": "^
|
|
35
|
-
"@atlaskit/editor-plugin-hyperlink": "^
|
|
36
|
-
"@atlaskit/editor-plugin-image-upload": "^
|
|
37
|
-
"@atlaskit/editor-plugin-layout": "^
|
|
38
|
-
"@atlaskit/editor-plugin-media": "^
|
|
39
|
-
"@atlaskit/editor-plugin-media-insert": "^
|
|
40
|
-
"@atlaskit/editor-plugin-mentions": "^
|
|
41
|
-
"@atlaskit/editor-plugin-metrics": "^
|
|
42
|
-
"@atlaskit/editor-plugin-panel": "^
|
|
43
|
-
"@atlaskit/editor-plugin-placeholder-text": "^
|
|
44
|
-
"@atlaskit/editor-plugin-primary-toolbar": "^
|
|
45
|
-
"@atlaskit/editor-plugin-quick-insert": "^
|
|
46
|
-
"@atlaskit/editor-plugin-rule": "^
|
|
47
|
-
"@atlaskit/editor-plugin-status": "^
|
|
48
|
-
"@atlaskit/editor-plugin-table": "^
|
|
49
|
-
"@atlaskit/editor-plugin-tasks-and-decisions": "^
|
|
50
|
-
"@atlaskit/editor-plugin-toolbar": "^
|
|
51
|
-
"@atlaskit/editor-plugin-type-ahead": "^
|
|
52
|
-
"@atlaskit/editor-plugin-ui-control-registry": "^
|
|
53
|
-
"@atlaskit/editor-prosemirror": "^
|
|
26
|
+
"@atlaskit/editor-plugin-analytics": "^19.0.0",
|
|
27
|
+
"@atlaskit/editor-plugin-block-type": "^23.0.0",
|
|
28
|
+
"@atlaskit/editor-plugin-code-block": "^21.0.0",
|
|
29
|
+
"@atlaskit/editor-plugin-connectivity": "^19.0.0",
|
|
30
|
+
"@atlaskit/editor-plugin-date": "^21.0.0",
|
|
31
|
+
"@atlaskit/editor-plugin-emoji": "^20.0.0",
|
|
32
|
+
"@atlaskit/editor-plugin-expand": "^20.0.0",
|
|
33
|
+
"@atlaskit/editor-plugin-extension": "^22.0.0",
|
|
34
|
+
"@atlaskit/editor-plugin-feature-flags": "^18.0.0",
|
|
35
|
+
"@atlaskit/editor-plugin-hyperlink": "^21.0.0",
|
|
36
|
+
"@atlaskit/editor-plugin-image-upload": "^19.0.0",
|
|
37
|
+
"@atlaskit/editor-plugin-layout": "^20.0.0",
|
|
38
|
+
"@atlaskit/editor-plugin-media": "^21.0.0",
|
|
39
|
+
"@atlaskit/editor-plugin-media-insert": "^36.0.0",
|
|
40
|
+
"@atlaskit/editor-plugin-mentions": "^21.0.0",
|
|
41
|
+
"@atlaskit/editor-plugin-metrics": "^20.0.0",
|
|
42
|
+
"@atlaskit/editor-plugin-panel": "^21.0.0",
|
|
43
|
+
"@atlaskit/editor-plugin-placeholder-text": "^20.0.0",
|
|
44
|
+
"@atlaskit/editor-plugin-primary-toolbar": "^20.0.0",
|
|
45
|
+
"@atlaskit/editor-plugin-quick-insert": "^19.0.0",
|
|
46
|
+
"@atlaskit/editor-plugin-rule": "^19.0.0",
|
|
47
|
+
"@atlaskit/editor-plugin-status": "^20.0.0",
|
|
48
|
+
"@atlaskit/editor-plugin-table": "^31.0.0",
|
|
49
|
+
"@atlaskit/editor-plugin-tasks-and-decisions": "^22.0.0",
|
|
50
|
+
"@atlaskit/editor-plugin-toolbar": "^16.0.0",
|
|
51
|
+
"@atlaskit/editor-plugin-type-ahead": "^20.0.0",
|
|
52
|
+
"@atlaskit/editor-plugin-ui-control-registry": "^13.0.0",
|
|
53
|
+
"@atlaskit/editor-prosemirror": "^9.0.0",
|
|
54
54
|
"@atlaskit/editor-shared-styles": "^4.3.0",
|
|
55
55
|
"@atlaskit/editor-toolbar": "^2.6.0",
|
|
56
56
|
"@atlaskit/editor-toolbar-model": "^1.2.0",
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"@atlaskit/primitives": "^22.5.0",
|
|
64
64
|
"@atlaskit/textfield": "^10.2.0",
|
|
65
65
|
"@atlaskit/tmp-editor-statsig": "^199.0.0",
|
|
66
|
-
"@atlaskit/tokens": "^18.
|
|
66
|
+
"@atlaskit/tokens": "^18.2.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": "^
|
|
75
|
+
"@atlaskit/editor-common": "^123.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"
|