@atlaskit/editor-plugin-quick-insert 16.3.4 → 17.1.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 +23 -0
- package/dist/cjs/ui/RegistryElementBrowser/RegistryElementBrowser.js +4 -0
- package/dist/cjs/ui/RegistryElementBrowser/RegistryElementBrowserSearchResults.compiled.css +1 -0
- package/dist/cjs/ui/RegistryElementBrowser/RegistryElementBrowserSearchResults.js +8 -3
- package/dist/cjs/ui/RegistryElementBrowser/index.js +9 -3
- package/dist/es2019/ui/RegistryElementBrowser/RegistryElementBrowser.js +3 -0
- package/dist/es2019/ui/RegistryElementBrowser/RegistryElementBrowserSearchResults.compiled.css +1 -0
- package/dist/es2019/ui/RegistryElementBrowser/RegistryElementBrowserSearchResults.js +7 -3
- package/dist/es2019/ui/RegistryElementBrowser/index.js +3 -0
- package/dist/esm/ui/RegistryElementBrowser/RegistryElementBrowser.js +4 -0
- package/dist/esm/ui/RegistryElementBrowser/RegistryElementBrowserSearchResults.compiled.css +1 -0
- package/dist/esm/ui/RegistryElementBrowser/RegistryElementBrowserSearchResults.js +8 -3
- package/dist/esm/ui/RegistryElementBrowser/index.js +9 -3
- package/dist/types/ui/RegistryElementBrowser/RegistryElementBrowser.d.ts +2 -1
- package/dist/types/ui/RegistryElementBrowser/RegistryElementBrowserSearchResults.d.ts +2 -1
- package/package.json +8 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,28 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-quick-insert
|
|
2
2
|
|
|
3
|
+
## 17.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`a3884f09ad3e9`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/a3884f09ad3e9) -
|
|
8
|
+
Use elevation.surface.hovered for element browser item hover backgrounds when
|
|
9
|
+
platform_editor_slash_command is enabled. Keep hovered items square and preserve selected item
|
|
10
|
+
backgrounds on hover. Remove the registry element browser's top scroll border. Make custom empty
|
|
11
|
+
states span all result columns so Confluence Marketplace content is not constrained to a single
|
|
12
|
+
item column. Add an optional isLoading prop to the public RegistryElementBrowser component to
|
|
13
|
+
leave the results area blank until the initial registry snapshot is available, then render the
|
|
14
|
+
normal empty state whenever there are no results.
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- Updated dependencies
|
|
19
|
+
|
|
20
|
+
## 17.0.0
|
|
21
|
+
|
|
22
|
+
### Patch Changes
|
|
23
|
+
|
|
24
|
+
- Updated dependencies
|
|
25
|
+
|
|
3
26
|
## 16.3.4
|
|
4
27
|
|
|
5
28
|
### Patch Changes
|
|
@@ -42,6 +42,8 @@ var RegistryElementBrowser = exports.RegistryElementBrowser = function RegistryE
|
|
|
42
42
|
defaultSection = _ref.defaultSection,
|
|
43
43
|
helpUrl = _ref.helpUrl,
|
|
44
44
|
editorView = _ref.editorView,
|
|
45
|
+
_ref$isLoading = _ref.isLoading,
|
|
46
|
+
isLoading = _ref$isLoading === void 0 ? false : _ref$isLoading,
|
|
45
47
|
isOffline = _ref.isOffline,
|
|
46
48
|
isOpen = _ref.isOpen,
|
|
47
49
|
onClearSelection = _ref.onClearSelection,
|
|
@@ -135,6 +137,7 @@ var RegistryElementBrowser = exports.RegistryElementBrowser = function RegistryE
|
|
|
135
137
|
footer === null || footer === void 0 || footer.style.setProperty('height', '64px');
|
|
136
138
|
footer === null || footer === void 0 || footer.style.setProperty('padding-block', "var(--ds-space-200, 16px)");
|
|
137
139
|
var scrollableBody = node.querySelector("[data-testid=\"".concat(modalTestId, "--scrollable\"]"));
|
|
140
|
+
scrollableBody === null || scrollableBody === void 0 || scrollableBody.style.setProperty('border-block-start', 'none');
|
|
138
141
|
scrollableBody === null || scrollableBody === void 0 || scrollableBody.style.setProperty('border-block-end', 'none');
|
|
139
142
|
}, []);
|
|
140
143
|
var onKeyDown = (0, _react.useCallback)(function (event) {
|
|
@@ -214,6 +217,7 @@ var RegistryElementBrowser = exports.RegistryElementBrowser = function RegistryE
|
|
|
214
217
|
}), /*#__PURE__*/_react.default.createElement(_RegistryElementBrowserSearchResults.RegistryElementBrowserSearchResults, {
|
|
215
218
|
editorView: editorView,
|
|
216
219
|
emptyStateHandler: emptyStateHandler,
|
|
220
|
+
isLoading: isLoading,
|
|
217
221
|
isOffline: isOffline,
|
|
218
222
|
items: items,
|
|
219
223
|
query: query,
|
|
@@ -17,6 +17,7 @@ var _compiled = require("@atlaskit/primitives/compiled");
|
|
|
17
17
|
var _NotFoundIllustration = _interopRequireDefault(require("./NotFoundIllustration"));
|
|
18
18
|
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); }
|
|
19
19
|
var resultsGridStyles = null;
|
|
20
|
+
var emptyStateGridItemStyles = null;
|
|
20
21
|
var emptyStateWrapperStyles = null;
|
|
21
22
|
var emptyStateHeadingStyles = null;
|
|
22
23
|
var emptyStateSubheadingStyles = null;
|
|
@@ -56,6 +57,8 @@ var RegistryElementBrowserSearchResults = exports.RegistryElementBrowserSearchRe
|
|
|
56
57
|
var _emptyStateHandler;
|
|
57
58
|
var editorView = _ref2.editorView,
|
|
58
59
|
emptyStateHandler = _ref2.emptyStateHandler,
|
|
60
|
+
_ref2$isLoading = _ref2.isLoading,
|
|
61
|
+
isLoading = _ref2$isLoading === void 0 ? false : _ref2$isLoading,
|
|
59
62
|
isOffline = _ref2.isOffline,
|
|
60
63
|
items = _ref2.items,
|
|
61
64
|
query = _ref2.query,
|
|
@@ -86,12 +89,14 @@ var RegistryElementBrowserSearchResults = exports.RegistryElementBrowserSearchRe
|
|
|
86
89
|
key: item.registration.key,
|
|
87
90
|
onSelect: onSelect
|
|
88
91
|
});
|
|
89
|
-
}) :
|
|
92
|
+
}) : !isLoading ? /*#__PURE__*/_react.default.createElement("div", {
|
|
93
|
+
className: (0, _runtime.ax)(["_yyhyjvu9 _1ul9idpf _1bsb1osq"])
|
|
94
|
+
}, (_emptyStateHandler = emptyStateHandler === null || emptyStateHandler === void 0 ? void 0 : emptyStateHandler({
|
|
90
95
|
mode: 'full',
|
|
91
96
|
searchTerm: query,
|
|
92
97
|
selectedCategory: section
|
|
93
98
|
})) !== null && _emptyStateHandler !== void 0 ? _emptyStateHandler : /*#__PURE__*/_react.default.createElement("div", {
|
|
94
|
-
className: (0, _runtime.ax)(["
|
|
99
|
+
className: (0, _runtime.ax)(["_4cvr1h6o _1e0c1txw _2lx21bp4 _1bah1h6o _1bsb1osq"])
|
|
95
100
|
}, /*#__PURE__*/_react.default.createElement(_NotFoundIllustration.default, null), /*#__PURE__*/_react.default.createElement("div", {
|
|
96
101
|
className: (0, _runtime.ax)(["_11c81af2 _syazi7uo _19pk1ejb"])
|
|
97
102
|
}, formatMessage({
|
|
@@ -111,5 +116,5 @@ var RegistryElementBrowserSearchResults = exports.RegistryElementBrowserSearchRe
|
|
|
111
116
|
}, formatMessage({
|
|
112
117
|
defaultMessage: 'Explore Atlassian Marketplace',
|
|
113
118
|
id: 'editor.quick-insert.explore-marketplace'
|
|
114
|
-
}))))));
|
|
119
|
+
})))))) : null);
|
|
115
120
|
};
|
|
@@ -37,10 +37,14 @@ var RegistryElementBrowserContainer = exports.RegistryElementBrowserContainer =
|
|
|
37
37
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
38
38
|
snapshot = _useState2[0],
|
|
39
39
|
setSnapshot = _useState2[1];
|
|
40
|
-
var _useState3 = (0, _react.useState)(),
|
|
40
|
+
var _useState3 = (0, _react.useState)(false),
|
|
41
41
|
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
hasInitialized = _useState4[0],
|
|
43
|
+
setHasInitialized = _useState4[1];
|
|
44
|
+
var _useState5 = (0, _react.useState)(),
|
|
45
|
+
_useState6 = (0, _slicedToArray2.default)(_useState5, 2),
|
|
46
|
+
emptyStateHandler = _useState6[0],
|
|
47
|
+
setEmptyStateHandler = _useState6[1];
|
|
44
48
|
var wasOpen = (0, _react.useRef)(false);
|
|
45
49
|
var selectionHandler = (0, _react.useRef)(undefined);
|
|
46
50
|
var isInsertConfirmed = (0, _react.useRef)(false);
|
|
@@ -60,6 +64,7 @@ var RegistryElementBrowserContainer = exports.RegistryElementBrowserContainer =
|
|
|
60
64
|
if (isElementBrowserOpen && !wasOpen.current) {
|
|
61
65
|
var _pluginInjectionAPI$u, _pluginInjectionAPI$u2;
|
|
62
66
|
setSnapshot((_pluginInjectionAPI$u = pluginInjectionAPI === null || pluginInjectionAPI === void 0 || (_pluginInjectionAPI$u2 = pluginInjectionAPI.uiControlRegistry) === null || _pluginInjectionAPI$u2 === void 0 ? void 0 : _pluginInjectionAPI$u2.actions.getComponents(_keys.MENU.key)) !== null && _pluginInjectionAPI$u !== void 0 ? _pluginInjectionAPI$u : []);
|
|
67
|
+
setHasInitialized(true);
|
|
63
68
|
selectionHandler.current = undefined;
|
|
64
69
|
setEmptyStateHandler(function () {
|
|
65
70
|
return currentEmptyStateHandler;
|
|
@@ -134,6 +139,7 @@ var RegistryElementBrowserContainer = exports.RegistryElementBrowserContainer =
|
|
|
134
139
|
defaultSection: (_pluginKey$getState = _pluginKey.pluginKey.getState(editorView.state)) === null || _pluginKey$getState === void 0 ? void 0 : _pluginKey$getState.elementBrowserInitialCategory,
|
|
135
140
|
editorView: editorView,
|
|
136
141
|
isOffline: (0, _isOfflineMode.isOfflineMode)(mode),
|
|
142
|
+
isLoading: !hasInitialized,
|
|
137
143
|
isOpen: isElementBrowserOpen,
|
|
138
144
|
onClearSelection: onClearSelection,
|
|
139
145
|
onClose: onClose,
|
|
@@ -32,6 +32,7 @@ export const RegistryElementBrowser = ({
|
|
|
32
32
|
defaultSection,
|
|
33
33
|
helpUrl,
|
|
34
34
|
editorView,
|
|
35
|
+
isLoading = false,
|
|
35
36
|
isOffline,
|
|
36
37
|
isOpen,
|
|
37
38
|
onClearSelection,
|
|
@@ -108,6 +109,7 @@ export const RegistryElementBrowser = ({
|
|
|
108
109
|
footer === null || footer === void 0 ? void 0 : footer.style.setProperty('height', '64px');
|
|
109
110
|
footer === null || footer === void 0 ? void 0 : footer.style.setProperty('padding-block', "var(--ds-space-200, 16px)");
|
|
110
111
|
const scrollableBody = node.querySelector(`[data-testid="${modalTestId}--scrollable"]`);
|
|
112
|
+
scrollableBody === null || scrollableBody === void 0 ? void 0 : scrollableBody.style.setProperty('border-block-start', 'none');
|
|
111
113
|
scrollableBody === null || scrollableBody === void 0 ? void 0 : scrollableBody.style.setProperty('border-block-end', 'none');
|
|
112
114
|
}, []);
|
|
113
115
|
const onKeyDown = useCallback(event => {
|
|
@@ -185,6 +187,7 @@ export const RegistryElementBrowser = ({
|
|
|
185
187
|
}), /*#__PURE__*/React.createElement(RegistryElementBrowserSearchResults, {
|
|
186
188
|
editorView: editorView,
|
|
187
189
|
emptyStateHandler: emptyStateHandler,
|
|
190
|
+
isLoading: isLoading,
|
|
188
191
|
isOffline: isOffline,
|
|
189
192
|
items: items,
|
|
190
193
|
query: query,
|
|
@@ -8,6 +8,7 @@ import { QuickInsertProvider } from '@atlaskit/editor-common/quick-insert/provid
|
|
|
8
8
|
import { Text } from '@atlaskit/primitives/compiled';
|
|
9
9
|
import NotFoundIllustration from './NotFoundIllustration';
|
|
10
10
|
const resultsGridStyles = null;
|
|
11
|
+
const emptyStateGridItemStyles = null;
|
|
11
12
|
const emptyStateWrapperStyles = null;
|
|
12
13
|
const emptyStateHeadingStyles = null;
|
|
13
14
|
const emptyStateSubheadingStyles = null;
|
|
@@ -44,6 +45,7 @@ const RegistryElementBrowserItem = ({
|
|
|
44
45
|
export const RegistryElementBrowserSearchResults = ({
|
|
45
46
|
editorView,
|
|
46
47
|
emptyStateHandler,
|
|
48
|
+
isLoading = false,
|
|
47
49
|
isOffline,
|
|
48
50
|
items,
|
|
49
51
|
query,
|
|
@@ -75,12 +77,14 @@ export const RegistryElementBrowserSearchResults = ({
|
|
|
75
77
|
item: item,
|
|
76
78
|
key: item.registration.key,
|
|
77
79
|
onSelect: onSelect
|
|
78
|
-
})) :
|
|
80
|
+
})) : !isLoading ? /*#__PURE__*/React.createElement("div", {
|
|
81
|
+
className: ax(["_yyhyjvu9 _1ul9idpf _1bsb1osq"])
|
|
82
|
+
}, (_emptyStateHandler = emptyStateHandler === null || emptyStateHandler === void 0 ? void 0 : emptyStateHandler({
|
|
79
83
|
mode: 'full',
|
|
80
84
|
searchTerm: query,
|
|
81
85
|
selectedCategory: section
|
|
82
86
|
})) !== null && _emptyStateHandler !== void 0 ? _emptyStateHandler : /*#__PURE__*/React.createElement("div", {
|
|
83
|
-
className: ax(["
|
|
87
|
+
className: ax(["_4cvr1h6o _1e0c1txw _2lx21bp4 _1bah1h6o _1bsb1osq"])
|
|
84
88
|
}, /*#__PURE__*/React.createElement(NotFoundIllustration, null), /*#__PURE__*/React.createElement("div", {
|
|
85
89
|
className: ax(["_11c81af2 _syazi7uo _19pk1ejb"])
|
|
86
90
|
}, formatMessage({
|
|
@@ -100,5 +104,5 @@ export const RegistryElementBrowserSearchResults = ({
|
|
|
100
104
|
}, formatMessage({
|
|
101
105
|
defaultMessage: 'Explore Atlassian Marketplace',
|
|
102
106
|
id: 'editor.quick-insert.explore-marketplace'
|
|
103
|
-
}))))));
|
|
107
|
+
})))))) : null);
|
|
104
108
|
};
|
|
@@ -26,6 +26,7 @@ export const RegistryElementBrowserContainer = ({
|
|
|
26
26
|
};
|
|
27
27
|
});
|
|
28
28
|
const [snapshot, setSnapshot] = useState([]);
|
|
29
|
+
const [hasInitialized, setHasInitialized] = useState(false);
|
|
29
30
|
const [emptyStateHandler, setEmptyStateHandler] = useState();
|
|
30
31
|
const wasOpen = useRef(false);
|
|
31
32
|
const selectionHandler = useRef(undefined);
|
|
@@ -46,6 +47,7 @@ export const RegistryElementBrowserContainer = ({
|
|
|
46
47
|
if (isElementBrowserOpen && !wasOpen.current) {
|
|
47
48
|
var _pluginInjectionAPI$u, _pluginInjectionAPI$u2;
|
|
48
49
|
setSnapshot((_pluginInjectionAPI$u = pluginInjectionAPI === null || pluginInjectionAPI === void 0 ? void 0 : (_pluginInjectionAPI$u2 = pluginInjectionAPI.uiControlRegistry) === null || _pluginInjectionAPI$u2 === void 0 ? void 0 : _pluginInjectionAPI$u2.actions.getComponents(MENU.key)) !== null && _pluginInjectionAPI$u !== void 0 ? _pluginInjectionAPI$u : []);
|
|
50
|
+
setHasInitialized(true);
|
|
49
51
|
selectionHandler.current = undefined;
|
|
50
52
|
setEmptyStateHandler(() => currentEmptyStateHandler);
|
|
51
53
|
isInsertConfirmed.current = false;
|
|
@@ -113,6 +115,7 @@ export const RegistryElementBrowserContainer = ({
|
|
|
113
115
|
defaultSection: (_pluginKey$getState = pluginKey.getState(editorView.state)) === null || _pluginKey$getState === void 0 ? void 0 : _pluginKey$getState.elementBrowserInitialCategory,
|
|
114
116
|
editorView: editorView,
|
|
115
117
|
isOffline: isOfflineMode(mode),
|
|
118
|
+
isLoading: !hasInitialized,
|
|
116
119
|
isOpen: isElementBrowserOpen,
|
|
117
120
|
onClearSelection: onClearSelection,
|
|
118
121
|
onClose: onClose,
|
|
@@ -33,6 +33,8 @@ export var RegistryElementBrowser = function RegistryElementBrowser(_ref) {
|
|
|
33
33
|
defaultSection = _ref.defaultSection,
|
|
34
34
|
helpUrl = _ref.helpUrl,
|
|
35
35
|
editorView = _ref.editorView,
|
|
36
|
+
_ref$isLoading = _ref.isLoading,
|
|
37
|
+
isLoading = _ref$isLoading === void 0 ? false : _ref$isLoading,
|
|
36
38
|
isOffline = _ref.isOffline,
|
|
37
39
|
isOpen = _ref.isOpen,
|
|
38
40
|
onClearSelection = _ref.onClearSelection,
|
|
@@ -126,6 +128,7 @@ export var RegistryElementBrowser = function RegistryElementBrowser(_ref) {
|
|
|
126
128
|
footer === null || footer === void 0 || footer.style.setProperty('height', '64px');
|
|
127
129
|
footer === null || footer === void 0 || footer.style.setProperty('padding-block', "var(--ds-space-200, 16px)");
|
|
128
130
|
var scrollableBody = node.querySelector("[data-testid=\"".concat(modalTestId, "--scrollable\"]"));
|
|
131
|
+
scrollableBody === null || scrollableBody === void 0 || scrollableBody.style.setProperty('border-block-start', 'none');
|
|
129
132
|
scrollableBody === null || scrollableBody === void 0 || scrollableBody.style.setProperty('border-block-end', 'none');
|
|
130
133
|
}, []);
|
|
131
134
|
var onKeyDown = useCallback(function (event) {
|
|
@@ -205,6 +208,7 @@ export var RegistryElementBrowser = function RegistryElementBrowser(_ref) {
|
|
|
205
208
|
}), /*#__PURE__*/React.createElement(RegistryElementBrowserSearchResults, {
|
|
206
209
|
editorView: editorView,
|
|
207
210
|
emptyStateHandler: emptyStateHandler,
|
|
211
|
+
isLoading: isLoading,
|
|
208
212
|
isOffline: isOffline,
|
|
209
213
|
items: items,
|
|
210
214
|
query: query,
|
|
@@ -8,6 +8,7 @@ import { QuickInsertProvider } from '@atlaskit/editor-common/quick-insert/provid
|
|
|
8
8
|
import { Text } from '@atlaskit/primitives/compiled';
|
|
9
9
|
import NotFoundIllustration from './NotFoundIllustration';
|
|
10
10
|
var resultsGridStyles = null;
|
|
11
|
+
var emptyStateGridItemStyles = null;
|
|
11
12
|
var emptyStateWrapperStyles = null;
|
|
12
13
|
var emptyStateHeadingStyles = null;
|
|
13
14
|
var emptyStateSubheadingStyles = null;
|
|
@@ -47,6 +48,8 @@ export var RegistryElementBrowserSearchResults = function RegistryElementBrowser
|
|
|
47
48
|
var _emptyStateHandler;
|
|
48
49
|
var editorView = _ref2.editorView,
|
|
49
50
|
emptyStateHandler = _ref2.emptyStateHandler,
|
|
51
|
+
_ref2$isLoading = _ref2.isLoading,
|
|
52
|
+
isLoading = _ref2$isLoading === void 0 ? false : _ref2$isLoading,
|
|
50
53
|
isOffline = _ref2.isOffline,
|
|
51
54
|
items = _ref2.items,
|
|
52
55
|
query = _ref2.query,
|
|
@@ -77,12 +80,14 @@ export var RegistryElementBrowserSearchResults = function RegistryElementBrowser
|
|
|
77
80
|
key: item.registration.key,
|
|
78
81
|
onSelect: onSelect
|
|
79
82
|
});
|
|
80
|
-
}) :
|
|
83
|
+
}) : !isLoading ? /*#__PURE__*/React.createElement("div", {
|
|
84
|
+
className: ax(["_yyhyjvu9 _1ul9idpf _1bsb1osq"])
|
|
85
|
+
}, (_emptyStateHandler = emptyStateHandler === null || emptyStateHandler === void 0 ? void 0 : emptyStateHandler({
|
|
81
86
|
mode: 'full',
|
|
82
87
|
searchTerm: query,
|
|
83
88
|
selectedCategory: section
|
|
84
89
|
})) !== null && _emptyStateHandler !== void 0 ? _emptyStateHandler : /*#__PURE__*/React.createElement("div", {
|
|
85
|
-
className: ax(["
|
|
90
|
+
className: ax(["_4cvr1h6o _1e0c1txw _2lx21bp4 _1bah1h6o _1bsb1osq"])
|
|
86
91
|
}, /*#__PURE__*/React.createElement(NotFoundIllustration, null), /*#__PURE__*/React.createElement("div", {
|
|
87
92
|
className: ax(["_11c81af2 _syazi7uo _19pk1ejb"])
|
|
88
93
|
}, formatMessage({
|
|
@@ -102,5 +107,5 @@ export var RegistryElementBrowserSearchResults = function RegistryElementBrowser
|
|
|
102
107
|
}, formatMessage({
|
|
103
108
|
defaultMessage: 'Explore Atlassian Marketplace',
|
|
104
109
|
id: 'editor.quick-insert.explore-marketplace'
|
|
105
|
-
}))))));
|
|
110
|
+
})))))) : null);
|
|
106
111
|
};
|
|
@@ -28,10 +28,14 @@ export var RegistryElementBrowserContainer = function RegistryElementBrowserCont
|
|
|
28
28
|
_useState2 = _slicedToArray(_useState, 2),
|
|
29
29
|
snapshot = _useState2[0],
|
|
30
30
|
setSnapshot = _useState2[1];
|
|
31
|
-
var _useState3 = useState(),
|
|
31
|
+
var _useState3 = useState(false),
|
|
32
32
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
hasInitialized = _useState4[0],
|
|
34
|
+
setHasInitialized = _useState4[1];
|
|
35
|
+
var _useState5 = useState(),
|
|
36
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
37
|
+
emptyStateHandler = _useState6[0],
|
|
38
|
+
setEmptyStateHandler = _useState6[1];
|
|
35
39
|
var wasOpen = useRef(false);
|
|
36
40
|
var selectionHandler = useRef(undefined);
|
|
37
41
|
var isInsertConfirmed = useRef(false);
|
|
@@ -51,6 +55,7 @@ export var RegistryElementBrowserContainer = function RegistryElementBrowserCont
|
|
|
51
55
|
if (isElementBrowserOpen && !wasOpen.current) {
|
|
52
56
|
var _pluginInjectionAPI$u, _pluginInjectionAPI$u2;
|
|
53
57
|
setSnapshot((_pluginInjectionAPI$u = pluginInjectionAPI === null || pluginInjectionAPI === void 0 || (_pluginInjectionAPI$u2 = pluginInjectionAPI.uiControlRegistry) === null || _pluginInjectionAPI$u2 === void 0 ? void 0 : _pluginInjectionAPI$u2.actions.getComponents(MENU.key)) !== null && _pluginInjectionAPI$u !== void 0 ? _pluginInjectionAPI$u : []);
|
|
58
|
+
setHasInitialized(true);
|
|
54
59
|
selectionHandler.current = undefined;
|
|
55
60
|
setEmptyStateHandler(function () {
|
|
56
61
|
return currentEmptyStateHandler;
|
|
@@ -125,6 +130,7 @@ export var RegistryElementBrowserContainer = function RegistryElementBrowserCont
|
|
|
125
130
|
defaultSection: (_pluginKey$getState = pluginKey.getState(editorView.state)) === null || _pluginKey$getState === void 0 ? void 0 : _pluginKey$getState.elementBrowserInitialCategory,
|
|
126
131
|
editorView: editorView,
|
|
127
132
|
isOffline: isOfflineMode(mode),
|
|
133
|
+
isLoading: !hasInitialized,
|
|
128
134
|
isOpen: isElementBrowserOpen,
|
|
129
135
|
onClearSelection: onClearSelection,
|
|
130
136
|
onClose: onClose,
|
|
@@ -13,6 +13,7 @@ type Props = {
|
|
|
13
13
|
editorView: EditorView;
|
|
14
14
|
emptyStateHandler?: EmptyStateHandler;
|
|
15
15
|
helpUrl?: string;
|
|
16
|
+
isLoading?: boolean;
|
|
16
17
|
isOffline: boolean;
|
|
17
18
|
isOpen: boolean;
|
|
18
19
|
onClearSelection: () => void;
|
|
@@ -21,5 +22,5 @@ type Props = {
|
|
|
21
22
|
onConfirmInsert: () => void;
|
|
22
23
|
onSelect: (handler: QuickInsertSelectionHandler) => void;
|
|
23
24
|
};
|
|
24
|
-
export declare const RegistryElementBrowser: ({ components, emptyStateHandler, defaultSection, helpUrl, editorView, isOffline, isOpen, onClearSelection, onClose, onCloseComplete, onConfirmInsert, onSelect, }: Props) => React.JSX.Element | null;
|
|
25
|
+
export declare const RegistryElementBrowser: ({ components, emptyStateHandler, defaultSection, helpUrl, editorView, isLoading, isOffline, isOpen, onClearSelection, onClose, onCloseComplete, onConfirmInsert, onSelect, }: Props) => React.JSX.Element | null;
|
|
25
26
|
export {};
|
|
@@ -10,6 +10,7 @@ import type { RegistryElementBrowserItem } from './model';
|
|
|
10
10
|
type Props = {
|
|
11
11
|
editorView: EditorView;
|
|
12
12
|
emptyStateHandler?: EmptyStateHandler;
|
|
13
|
+
isLoading?: boolean;
|
|
13
14
|
isOffline: boolean;
|
|
14
15
|
items: RegistryElementBrowserItem[];
|
|
15
16
|
onKeyDown: (event: React.KeyboardEvent) => void;
|
|
@@ -26,5 +27,5 @@ declare const RegistryElementBrowserItem: ({ editorView, isOffline, isSelected,
|
|
|
26
27
|
item: RegistryElementBrowserItem;
|
|
27
28
|
onSelect: (key: string, handler: QuickInsertSelectionHandler) => void;
|
|
28
29
|
}) => React.JSX.Element | null;
|
|
29
|
-
export declare const RegistryElementBrowserSearchResults: ({ editorView, emptyStateHandler, isOffline, items, query, resultsId, section, selectedKey, onKeyDown, onSelect, }: Props) => React.JSX.Element;
|
|
30
|
+
export declare const RegistryElementBrowserSearchResults: ({ editorView, emptyStateHandler, isLoading, isOffline, items, query, resultsId, section, selectedKey, onKeyDown, onSelect, }: Props) => React.JSX.Element;
|
|
30
31
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-quick-insert",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "17.1.0",
|
|
4
4
|
"description": "Quick insert plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -23,11 +23,11 @@
|
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"@atlaskit/button": "^25.3.0",
|
|
25
25
|
"@atlaskit/css": "^1.1.0",
|
|
26
|
-
"@atlaskit/editor-plugin-analytics": "^
|
|
27
|
-
"@atlaskit/editor-plugin-connectivity": "^
|
|
28
|
-
"@atlaskit/editor-plugin-metrics": "^
|
|
29
|
-
"@atlaskit/editor-plugin-type-ahead": "^
|
|
30
|
-
"@atlaskit/editor-plugin-ui-control-registry": "^
|
|
26
|
+
"@atlaskit/editor-plugin-analytics": "^17.0.0",
|
|
27
|
+
"@atlaskit/editor-plugin-connectivity": "^17.0.0",
|
|
28
|
+
"@atlaskit/editor-plugin-metrics": "^18.0.0",
|
|
29
|
+
"@atlaskit/editor-plugin-type-ahead": "^18.0.0",
|
|
30
|
+
"@atlaskit/editor-plugin-ui-control-registry": "^11.0.0",
|
|
31
31
|
"@atlaskit/editor-prosemirror": "^8.0.0",
|
|
32
32
|
"@atlaskit/editor-tables": "^3.1.0",
|
|
33
33
|
"@atlaskit/editor-ui-control-model": "^2.9.0",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"@atlaskit/platform-feature-flags": "^2.2.0",
|
|
39
39
|
"@atlaskit/primitives": "^22.5.0",
|
|
40
40
|
"@atlaskit/textfield": "^10.2.0",
|
|
41
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
41
|
+
"@atlaskit/tmp-editor-statsig": "^180.0.0",
|
|
42
42
|
"@atlaskit/tokens": "^16.11.0",
|
|
43
43
|
"@atlaskit/tooltip": "^24.3.0",
|
|
44
44
|
"@babel/runtime": "^7.0.0",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"@emotion/react": "^11.7.1"
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|
|
49
|
-
"@atlaskit/editor-common": "^
|
|
49
|
+
"@atlaskit/editor-common": "^121.1.0",
|
|
50
50
|
"react": "^18.2.0 || ^19.2.0",
|
|
51
51
|
"react-dom": "^18.2.0 || ^19.2.0",
|
|
52
52
|
"react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
|