@atlaskit/editor-common 78.17.1 → 78.18.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 +13 -0
- package/analytics/package.json +1 -1
- package/annotation/package.json +1 -1
- package/card/package.json +1 -1
- package/clipboard/package.json +1 -1
- package/collab/package.json +1 -1
- package/commands/package.json +1 -1
- package/constants/package.json +1 -1
- package/copy-button/package.json +1 -1
- package/core-utils/package.json +1 -1
- package/dist/cjs/element-browser/components/CategoryList.js +6 -2
- package/dist/cjs/element-browser/components/ElementList/ElementList.js +10 -6
- package/dist/cjs/element-browser/components/StatelessElementBrowser.js +82 -20
- package/dist/cjs/extensibility/Extension/Extension/index.js +17 -12
- package/dist/cjs/extensibility/MultiBodiedExtension/index.js +16 -12
- package/dist/cjs/hooks/useSharedPluginState.js +3 -0
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/es2019/element-browser/components/CategoryList.js +6 -2
- package/dist/es2019/element-browser/components/ElementList/ElementList.js +10 -6
- package/dist/es2019/element-browser/components/StatelessElementBrowser.js +81 -99
- package/dist/es2019/extensibility/Extension/Extension/index.js +16 -11
- package/dist/es2019/extensibility/MultiBodiedExtension/index.js +15 -11
- package/dist/es2019/hooks/useSharedPluginState.js +5 -0
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/esm/element-browser/components/CategoryList.js +6 -2
- package/dist/esm/element-browser/components/ElementList/ElementList.js +10 -6
- package/dist/esm/element-browser/components/StatelessElementBrowser.js +81 -20
- package/dist/esm/extensibility/Extension/Extension/index.js +17 -12
- package/dist/esm/extensibility/MultiBodiedExtension/index.js +16 -12
- package/dist/esm/hooks/useSharedPluginState.js +3 -0
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/types/analytics/types/enums.d.ts +2 -2
- package/dist/types/annotation/index.d.ts +2 -0
- package/dist/types/commands/index.d.ts +3 -3
- package/dist/types/element-browser/components/ElementSearch.d.ts +1 -1
- package/dist/types/floating-toolbar/index.d.ts +1 -1
- package/dist/types/link/LinkSearch/LinkSearchListItem.d.ts +2 -2
- package/dist/types/preset/plugin-injection-api.d.ts +1 -1
- package/dist/types/provider-helpers/promise-helpers.d.ts +2 -2
- package/dist/types/styles/shared/resizer.d.ts +3 -3
- package/dist/types/ui/Caption/index.d.ts +2 -2
- package/dist/types/ui/UnsupportedBlock/index.d.ts +2 -2
- package/dist/types/ui/UnsupportedInline/index.d.ts +2 -2
- package/dist/types/ui-color/ColorPalette/index.d.ts +2 -2
- package/dist/types/utils/compare-props.d.ts +2 -2
- package/dist/types/utils/imageLoader.d.ts +1 -1
- package/dist/types-ts4.5/analytics/types/enums.d.ts +2 -2
- package/dist/types-ts4.5/annotation/index.d.ts +2 -0
- package/dist/types-ts4.5/commands/index.d.ts +3 -3
- package/dist/types-ts4.5/element-browser/components/ElementSearch.d.ts +1 -1
- package/dist/types-ts4.5/floating-toolbar/index.d.ts +1 -1
- package/dist/types-ts4.5/link/LinkSearch/LinkSearchListItem.d.ts +2 -2
- package/dist/types-ts4.5/preset/plugin-injection-api.d.ts +2 -2
- package/dist/types-ts4.5/provider-helpers/promise-helpers.d.ts +2 -2
- package/dist/types-ts4.5/styles/shared/resizer.d.ts +3 -3
- package/dist/types-ts4.5/ui/Caption/index.d.ts +2 -2
- package/dist/types-ts4.5/ui/UnsupportedBlock/index.d.ts +2 -2
- package/dist/types-ts4.5/ui/UnsupportedInline/index.d.ts +2 -2
- package/dist/types-ts4.5/ui-color/ColorPalette/index.d.ts +2 -2
- package/dist/types-ts4.5/utils/compare-props.d.ts +2 -2
- package/dist/types-ts4.5/utils/imageLoader.d.ts +1 -1
- package/doc-utils/package.json +1 -1
- package/editor-analytics/package.json +1 -1
- package/element-browser/package.json +1 -1
- package/emoji/package.json +1 -1
- package/error-boundary/package.json +1 -1
- package/event-dispatcher/package.json +1 -1
- package/extensibility/package.json +1 -1
- package/extensions/package.json +1 -1
- package/floating-toolbar/package.json +1 -1
- package/guideline/package.json +1 -1
- package/hooks/package.json +1 -1
- package/icons/package.json +1 -1
- package/in-product/package.json +1 -1
- package/indentation/package.json +1 -1
- package/insert/package.json +1 -1
- package/keymaps/package.json +1 -1
- package/legacy-rank-plugins/package.json +1 -1
- package/link/package.json +1 -1
- package/lists/package.json +1 -1
- package/mark/package.json +1 -1
- package/media/package.json +1 -1
- package/media-inline/package.json +1 -1
- package/media-single/package.json +1 -1
- package/mention/package.json +1 -1
- package/messages/package.json +1 -1
- package/monitoring/package.json +1 -1
- package/node-width/package.json +1 -1
- package/normalize-feature-flags/package.json +1 -1
- package/package.json +4 -4
- package/panel/package.json +1 -1
- package/paste/package.json +1 -1
- package/portal-provider/package.json +1 -1
- package/preset/package.json +1 -1
- package/provider-factory/package.json +1 -1
- package/provider-helpers/package.json +1 -1
- package/quick-insert/package.json +1 -1
- package/react-node-view/package.json +1 -1
- package/resizer/package.json +1 -1
- package/safe-plugin/package.json +1 -1
- package/selection/package.json +1 -1
- package/selection-based-node-view/package.json +1 -1
- package/styles/package.json +1 -1
- package/transforms/package.json +1 -1
- package/type-ahead/package.json +1 -1
- package/types/package.json +1 -1
- package/ufo/package.json +1 -1
- package/ui/package.json +1 -1
- package/ui-color/package.json +1 -1
- package/ui-menu/package.json +1 -1
- package/ui-react/package.json +1 -1
- package/utils/package.json +1 -1
- package/validator/package.json +1 -1
- package/with-plugin-state/package.json +1 -1
|
@@ -5,109 +5,86 @@ import { css, jsx } from '@emotion/react';
|
|
|
5
5
|
import { FormattedMessage } from 'react-intl-next';
|
|
6
6
|
import { withAnalyticsContext, withAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
7
7
|
import { ACTION, ACTION_SUBJECT, EVENT_TYPE, fireAnalyticsEvent } from '../../analytics';
|
|
8
|
-
import { DEVICE_BREAKPOINT_NUMBERS, GRID_SIZE, INLINE_SIDEBAR_HEIGHT,
|
|
8
|
+
import { DEVICE_BREAKPOINT_NUMBERS, GRID_SIZE, INLINE_SIDEBAR_HEIGHT, SIDEBAR_HEADING_WRAPPER_HEIGHT, SIDEBAR_WIDTH } from '../constants';
|
|
9
9
|
import useContainerWidth from '../hooks/use-container-width';
|
|
10
10
|
import useSelectAndFocusOnArrowNavigation from '../hooks/use-select-and-focus-on-arrow-navigation';
|
|
11
11
|
import { ViewMore } from '../ViewMore';
|
|
12
12
|
import CategoryList from './CategoryList';
|
|
13
13
|
import ElementList from './ElementList/ElementList';
|
|
14
14
|
import ElementSearch from './ElementSearch';
|
|
15
|
-
const wrapper = css
|
|
16
|
-
width: 100
|
|
17
|
-
|
|
18
|
-
overflow: hidden
|
|
19
|
-
|
|
20
|
-
const baseBrowserContainerStyles = css
|
|
21
|
-
display: flex
|
|
22
|
-
height: 100
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
${
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
flex: 0 0 ${
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
const searchContainer = css`
|
|
89
|
-
padding-bottom: ${GRID_SIZE * 2}px;
|
|
90
|
-
`;
|
|
91
|
-
const mobileCategoryListWrapper = css`
|
|
92
|
-
display: flex;
|
|
93
|
-
overflow-x: auto;
|
|
94
|
-
|
|
95
|
-
padding: ${GRID_SIZE}px 0 ${GRID_SIZE * 2}px 0;
|
|
96
|
-
min-height: ${GRID_SIZE * 4}px;
|
|
97
|
-
|
|
98
|
-
overflow: -moz-scrollbars-none;
|
|
99
|
-
::-webkit-scrollbar {
|
|
100
|
-
display: none;
|
|
101
|
-
}
|
|
102
|
-
scrollbar-width: none;
|
|
103
|
-
-ms-overflow-style: none;
|
|
104
|
-
`;
|
|
105
|
-
const categoryListWrapper = css`
|
|
106
|
-
${mobileCategoryListWrapper}
|
|
107
|
-
padding: 0;
|
|
108
|
-
margin-top: ${GRID_SIZE * 3}px;
|
|
109
|
-
flex-direction: column;
|
|
110
|
-
`;
|
|
15
|
+
const wrapper = css({
|
|
16
|
+
width: '100%',
|
|
17
|
+
maxHeight: 'inherit',
|
|
18
|
+
overflow: 'hidden'
|
|
19
|
+
});
|
|
20
|
+
const baseBrowserContainerStyles = css({
|
|
21
|
+
display: 'flex',
|
|
22
|
+
height: '100%',
|
|
23
|
+
minHeight: '-webkit-fill-available'
|
|
24
|
+
});
|
|
25
|
+
const mobileElementBrowserContainer = css(baseBrowserContainerStyles, {
|
|
26
|
+
flexDirection: 'column'
|
|
27
|
+
});
|
|
28
|
+
const elementBrowserContainer = css(baseBrowserContainerStyles, {
|
|
29
|
+
flexDirection: 'row'
|
|
30
|
+
});
|
|
31
|
+
const baseSidebarStyles = css({
|
|
32
|
+
display: 'flex',
|
|
33
|
+
flexDirection: 'column',
|
|
34
|
+
overflowX: 'auto',
|
|
35
|
+
overflowY: 'hidden'
|
|
36
|
+
});
|
|
37
|
+
const mobileSideBar = css(baseSidebarStyles, {
|
|
38
|
+
flex: `0 0 ${INLINE_SIDEBAR_HEIGHT}`,
|
|
39
|
+
padding: `${"var(--ds-space-150, 12px)"} ${"var(--ds-space-150, 12px)"} 0 ${"var(--ds-space-150, 12px)"}`
|
|
40
|
+
});
|
|
41
|
+
const mobileSideBarShowCategories = css({
|
|
42
|
+
flex: '0 0 auto'
|
|
43
|
+
});
|
|
44
|
+
const sideBar = css(baseSidebarStyles, {
|
|
45
|
+
flex: "0 0 'auto'"
|
|
46
|
+
});
|
|
47
|
+
const sideBarShowCategories = css(baseSidebarStyles, {
|
|
48
|
+
flex: `0 0 ${SIDEBAR_WIDTH}`
|
|
49
|
+
});
|
|
50
|
+
const sidebarHeading = css({
|
|
51
|
+
flex: `0 0 ${SIDEBAR_HEADING_WRAPPER_HEIGHT}`,
|
|
52
|
+
display: 'inline-flex',
|
|
53
|
+
alignItems: 'center',
|
|
54
|
+
paddingLeft: "var(--ds-space-150, 12px)",
|
|
55
|
+
fontWeight: 700
|
|
56
|
+
});
|
|
57
|
+
const mobileMainContent = css({
|
|
58
|
+
flex: '1 1 auto',
|
|
59
|
+
display: 'flex',
|
|
60
|
+
flexDirection: 'column',
|
|
61
|
+
overflowY: 'auto',
|
|
62
|
+
height: '100%'
|
|
63
|
+
});
|
|
64
|
+
const mainContent = css(mobileMainContent, {
|
|
65
|
+
marginLeft: "var(--ds-space-200, 16px)",
|
|
66
|
+
height: 'auto'
|
|
67
|
+
});
|
|
68
|
+
const searchContainer = css({
|
|
69
|
+
paddingBottom: "var(--ds-space-200, 16px)"
|
|
70
|
+
});
|
|
71
|
+
const mobileCategoryListWrapper = css({
|
|
72
|
+
display: 'flex',
|
|
73
|
+
overflowX: 'auto',
|
|
74
|
+
padding: `${"var(--ds-space-200, 8px)"} 0 ${"var(--ds-space-200, 16px)"} 0`,
|
|
75
|
+
minHeight: `${GRID_SIZE * 4}px`,
|
|
76
|
+
overflow: '-moz-scrollbars-none',
|
|
77
|
+
'::-webkit-scrollbar': {
|
|
78
|
+
display: 'none'
|
|
79
|
+
},
|
|
80
|
+
scrollbarWidth: 'none',
|
|
81
|
+
MsOverflowStyle: 'none'
|
|
82
|
+
});
|
|
83
|
+
const categoryListWrapper = css(mobileCategoryListWrapper, {
|
|
84
|
+
padding: 0,
|
|
85
|
+
marginTop: "var(--ds-space-200, 24px)",
|
|
86
|
+
flexDirection: 'column'
|
|
87
|
+
});
|
|
111
88
|
function StatelessElementBrowser(props) {
|
|
112
89
|
const {
|
|
113
90
|
items,
|
|
@@ -296,12 +273,15 @@ function DesktopBrowser({
|
|
|
296
273
|
css: showCategories ? sideBarShowCategories : sideBar
|
|
297
274
|
}, jsx("h2", {
|
|
298
275
|
css: sidebarHeading,
|
|
299
|
-
"data-testid": "sidebar-heading"
|
|
276
|
+
"data-testid": "sidebar-heading",
|
|
277
|
+
id: "sidebar-heading"
|
|
300
278
|
}, jsx(FormattedMessage, {
|
|
301
279
|
id: "fabric.editor.elementbrowser.sidebar.heading",
|
|
302
280
|
defaultMessage: "Browse",
|
|
303
281
|
description: "Sidebar heading"
|
|
304
282
|
})), jsx("nav", {
|
|
283
|
+
role: "tablist",
|
|
284
|
+
"aria-labelledby": "sidebar-heading",
|
|
305
285
|
css: categoryListWrapper
|
|
306
286
|
}, jsx(CategoryList, {
|
|
307
287
|
categories: categories,
|
|
@@ -312,7 +292,9 @@ function DesktopBrowser({
|
|
|
312
292
|
css: mainContent,
|
|
313
293
|
onKeyDown: onKeyDown,
|
|
314
294
|
"data-testid": "main-content"
|
|
315
|
-
}, showSearch &&
|
|
295
|
+
}, showSearch &&
|
|
296
|
+
// eslint-disable-next-line
|
|
297
|
+
jsx("div", {
|
|
316
298
|
css: searchContainer
|
|
317
299
|
}, jsx(ElementSearch, {
|
|
318
300
|
onSearch: onSearch,
|
|
@@ -162,18 +162,23 @@ const widthPluginKey = {
|
|
|
162
162
|
}
|
|
163
163
|
};
|
|
164
164
|
const ExtensionDeprecated = props => {
|
|
165
|
-
return
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
165
|
+
return (
|
|
166
|
+
// @ts-ignore - 'WithPluginState' cannot be used as a JSX component.
|
|
167
|
+
// This error was introduced after upgrading to TypeScript 5
|
|
168
|
+
jsx(WithPluginState, {
|
|
169
|
+
editorView: props.view,
|
|
170
|
+
plugins: {
|
|
171
|
+
widthState: widthPluginKey
|
|
172
|
+
},
|
|
173
|
+
render: ({
|
|
174
|
+
widthState
|
|
175
|
+
}) => jsx(ExtensionWithPluginState, _extends({
|
|
176
|
+
widthState: widthState
|
|
177
|
+
}, props))
|
|
178
|
+
})
|
|
179
|
+
);
|
|
176
180
|
};
|
|
181
|
+
|
|
177
182
|
/**
|
|
178
183
|
* End workaround
|
|
179
184
|
*/
|
|
@@ -188,17 +188,21 @@ const widthPluginKey = {
|
|
|
188
188
|
}
|
|
189
189
|
};
|
|
190
190
|
const MultiBodiedExtensionDeprecated = props => {
|
|
191
|
-
return
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
191
|
+
return (
|
|
192
|
+
// @ts-ignore - 'WithPluginState' cannot be used as a JSX component.
|
|
193
|
+
// This error was introduced after upgrading to TypeScript 5
|
|
194
|
+
jsx(WithPluginState, {
|
|
195
|
+
editorView: props.editorView,
|
|
196
|
+
plugins: {
|
|
197
|
+
widthState: widthPluginKey
|
|
198
|
+
},
|
|
199
|
+
render: ({
|
|
200
|
+
widthState
|
|
201
|
+
}) => jsx(MultiBodiedExtensionWithWidth, _extends({
|
|
202
|
+
widthState: widthState
|
|
203
|
+
}, props))
|
|
204
|
+
})
|
|
205
|
+
);
|
|
202
206
|
};
|
|
203
207
|
/**
|
|
204
208
|
* End workaround
|
|
@@ -91,8 +91,13 @@ export function useSharedPluginState(injectionApi, plugins) {
|
|
|
91
91
|
// Create a memoized object containing the named plugins
|
|
92
92
|
const namedExternalPlugins = useMemo(() => pluginNames.reduce((acc, pluginName) => ({
|
|
93
93
|
...acc,
|
|
94
|
+
// @ts-expect-error - Implicit conversion of a 'symbol' to a 'string' will fail at runtime. Consider wrapping this expression in 'String(...)'
|
|
95
|
+
// This error was introduced after upgrading to TypeScript 5
|
|
94
96
|
[`${pluginName}State`]: injectionApi === null || injectionApi === void 0 ? void 0 : injectionApi[pluginName]
|
|
95
97
|
}), {}), [injectionApi, pluginNames]);
|
|
98
|
+
|
|
99
|
+
// @ts-expect-error - Type '`${K}State`' is not assignable to type '`${K}State`'. Two different types with this name exist, but they are unrelated.
|
|
100
|
+
// This error was introduced after upgrading to TypeScript 5
|
|
96
101
|
return useSharedPluginStateInternal(namedExternalPlugins);
|
|
97
102
|
}
|
|
98
103
|
function useSharedPluginStateInternal(externalPlugins) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
2
2
|
const packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
3
|
-
const packageVersion = "78.
|
|
3
|
+
const packageVersion = "78.18.0";
|
|
4
4
|
const sanitiseSentryEvents = (data, _hint) => {
|
|
5
5
|
// Remove URL as it has UGC
|
|
6
6
|
// TODO: Sanitise the URL instead of just removing it
|
|
@@ -7,7 +7,7 @@ import { createAndFireEvent, withAnalyticsContext, withAnalyticsEvents } from '@
|
|
|
7
7
|
import { N0, N50A, N60A, N900 } from '@atlaskit/theme/colors';
|
|
8
8
|
import Layer from '../Layer';
|
|
9
9
|
const packageName = "@atlaskit/editor-common";
|
|
10
|
-
const packageVersion = "78.
|
|
10
|
+
const packageVersion = "78.18.0";
|
|
11
11
|
const halfFocusRing = 1;
|
|
12
12
|
const dropOffset = '0, 8';
|
|
13
13
|
class DropList extends Component {
|
|
@@ -45,7 +45,6 @@ function CategoryListItem(_ref2) {
|
|
|
45
45
|
var ref = useFocus(focus);
|
|
46
46
|
var onClick = useCallback(function () {
|
|
47
47
|
onSelectCategory(category);
|
|
48
|
-
|
|
49
48
|
/**
|
|
50
49
|
* When user double clicks on same category, focus on first item.
|
|
51
50
|
*/
|
|
@@ -85,13 +84,18 @@ function CategoryListItem(_ref2) {
|
|
|
85
84
|
}, rest);
|
|
86
85
|
}, [category.name, selectedCategory]);
|
|
87
86
|
return jsx("div", {
|
|
88
|
-
css: buttonWrapper
|
|
87
|
+
css: buttonWrapper,
|
|
88
|
+
role: "presentation"
|
|
89
89
|
}, jsx(Button, {
|
|
90
90
|
appearance: "subtle",
|
|
91
91
|
isSelected: selectedCategory === category.name,
|
|
92
92
|
onClick: onClick,
|
|
93
93
|
onFocus: onFocus,
|
|
94
94
|
theme: getTheme,
|
|
95
|
+
role: "tab",
|
|
96
|
+
"aria-selected": selectedCategory === category.name ? 'true' : 'false',
|
|
97
|
+
"aria-controls": "browse-category-".concat(category.name, "-tab"),
|
|
98
|
+
id: "browse-category--".concat(category.name, "-button"),
|
|
95
99
|
ref: ref,
|
|
96
100
|
testId: "element-browser-category-item"
|
|
97
101
|
}, category.title));
|
|
@@ -103,16 +103,20 @@ function ElementList(_ref) {
|
|
|
103
103
|
}, props)));
|
|
104
104
|
};
|
|
105
105
|
}, [items, fullMode, selectedItemIndex, focusedItemIndex, props]);
|
|
106
|
-
return jsx(Fragment, null, jsx(ContainerWidthMonitor, null),
|
|
106
|
+
return jsx(Fragment, null, jsx(ContainerWidthMonitor, null), jsx("div", {
|
|
107
|
+
css: elementItemsWrapper,
|
|
108
|
+
"data-testid": "element-items",
|
|
109
|
+
id: selectedCategory ? "browse-category-".concat(selectedCategory, "-tab") : 'browse-category-tab',
|
|
110
|
+
"aria-labelledby": selectedCategory ? "browse-category--".concat(selectedCategory, "-button") : 'browse-category-button',
|
|
111
|
+
role: "tabpanel",
|
|
112
|
+
tabIndex: items.length === 0 ? 0 : undefined
|
|
113
|
+
}, !items.length ? emptyStateHandler ? emptyStateHandler({
|
|
107
114
|
mode: mode,
|
|
108
115
|
selectedCategory: selectedCategory,
|
|
109
116
|
searchTerm: searchTerm
|
|
110
117
|
}) : jsx(EmptyState, {
|
|
111
118
|
onExternalLinkClick: onExternalLinkClick
|
|
112
|
-
}) : jsx(
|
|
113
|
-
css: elementItemsWrapper,
|
|
114
|
-
"data-testid": "element-items"
|
|
115
|
-
}, jsx(Fragment, null, containerWidth > 0 && jsx(AutoSizer, {
|
|
119
|
+
}) : jsx(Fragment, null, containerWidth > 0 && jsx(AutoSizer, {
|
|
116
120
|
disableWidth: true
|
|
117
121
|
}, function (_ref3) {
|
|
118
122
|
var height = _ref3.height;
|
|
@@ -258,7 +262,7 @@ var elementItemWrapper = css({
|
|
|
258
262
|
button: {
|
|
259
263
|
height: '75px',
|
|
260
264
|
alignItems: 'flex-start',
|
|
261
|
-
padding: "var(--ds-space-150, 12px)"
|
|
265
|
+
padding: "var(--ds-space-150, 12px)".concat(" ", "var(--ds-space-150, 12px)", " 11px")
|
|
262
266
|
}
|
|
263
267
|
}
|
|
264
268
|
});
|
|
@@ -1,35 +1,91 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
|
-
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
4
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15;
|
|
5
3
|
/** @jsx jsx */
|
|
6
4
|
import React, { memo, useCallback, useEffect, useState } from 'react';
|
|
7
5
|
import { css, jsx } from '@emotion/react';
|
|
8
6
|
import { FormattedMessage } from 'react-intl-next';
|
|
9
7
|
import { withAnalyticsContext, withAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
10
8
|
import { ACTION, ACTION_SUBJECT, EVENT_TYPE, fireAnalyticsEvent } from '../../analytics';
|
|
11
|
-
import { DEVICE_BREAKPOINT_NUMBERS, GRID_SIZE, INLINE_SIDEBAR_HEIGHT,
|
|
9
|
+
import { DEVICE_BREAKPOINT_NUMBERS, GRID_SIZE, INLINE_SIDEBAR_HEIGHT, SIDEBAR_HEADING_WRAPPER_HEIGHT, SIDEBAR_WIDTH } from '../constants';
|
|
12
10
|
import useContainerWidth from '../hooks/use-container-width';
|
|
13
11
|
import useSelectAndFocusOnArrowNavigation from '../hooks/use-select-and-focus-on-arrow-navigation';
|
|
14
12
|
import { ViewMore } from '../ViewMore';
|
|
15
13
|
import CategoryList from './CategoryList';
|
|
16
14
|
import ElementList from './ElementList/ElementList';
|
|
17
15
|
import ElementSearch from './ElementSearch';
|
|
18
|
-
var wrapper = css(
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
var
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
var
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
var
|
|
32
|
-
|
|
16
|
+
var wrapper = css({
|
|
17
|
+
width: '100%',
|
|
18
|
+
maxHeight: 'inherit',
|
|
19
|
+
overflow: 'hidden'
|
|
20
|
+
});
|
|
21
|
+
var baseBrowserContainerStyles = css({
|
|
22
|
+
display: 'flex',
|
|
23
|
+
height: '100%',
|
|
24
|
+
minHeight: '-webkit-fill-available'
|
|
25
|
+
});
|
|
26
|
+
var mobileElementBrowserContainer = css(baseBrowserContainerStyles, {
|
|
27
|
+
flexDirection: 'column'
|
|
28
|
+
});
|
|
29
|
+
var elementBrowserContainer = css(baseBrowserContainerStyles, {
|
|
30
|
+
flexDirection: 'row'
|
|
31
|
+
});
|
|
32
|
+
var baseSidebarStyles = css({
|
|
33
|
+
display: 'flex',
|
|
34
|
+
flexDirection: 'column',
|
|
35
|
+
overflowX: 'auto',
|
|
36
|
+
overflowY: 'hidden'
|
|
37
|
+
});
|
|
38
|
+
var mobileSideBar = css(baseSidebarStyles, {
|
|
39
|
+
flex: "0 0 ".concat(INLINE_SIDEBAR_HEIGHT),
|
|
40
|
+
padding: "var(--ds-space-150, 12px)".concat(" ", "var(--ds-space-150, 12px)", " 0 ", "var(--ds-space-150, 12px)")
|
|
41
|
+
});
|
|
42
|
+
var mobileSideBarShowCategories = css({
|
|
43
|
+
flex: '0 0 auto'
|
|
44
|
+
});
|
|
45
|
+
var sideBar = css(baseSidebarStyles, {
|
|
46
|
+
flex: "0 0 'auto'"
|
|
47
|
+
});
|
|
48
|
+
var sideBarShowCategories = css(baseSidebarStyles, {
|
|
49
|
+
flex: "0 0 ".concat(SIDEBAR_WIDTH)
|
|
50
|
+
});
|
|
51
|
+
var sidebarHeading = css({
|
|
52
|
+
flex: "0 0 ".concat(SIDEBAR_HEADING_WRAPPER_HEIGHT),
|
|
53
|
+
display: 'inline-flex',
|
|
54
|
+
alignItems: 'center',
|
|
55
|
+
paddingLeft: "var(--ds-space-150, 12px)",
|
|
56
|
+
fontWeight: 700
|
|
57
|
+
});
|
|
58
|
+
var mobileMainContent = css({
|
|
59
|
+
flex: '1 1 auto',
|
|
60
|
+
display: 'flex',
|
|
61
|
+
flexDirection: 'column',
|
|
62
|
+
overflowY: 'auto',
|
|
63
|
+
height: '100%'
|
|
64
|
+
});
|
|
65
|
+
var mainContent = css(mobileMainContent, {
|
|
66
|
+
marginLeft: "var(--ds-space-200, 16px)",
|
|
67
|
+
height: 'auto'
|
|
68
|
+
});
|
|
69
|
+
var searchContainer = css({
|
|
70
|
+
paddingBottom: "var(--ds-space-200, 16px)"
|
|
71
|
+
});
|
|
72
|
+
var mobileCategoryListWrapper = css({
|
|
73
|
+
display: 'flex',
|
|
74
|
+
overflowX: 'auto',
|
|
75
|
+
padding: "var(--ds-space-200, 8px)".concat(" 0 ", "var(--ds-space-200, 16px)", " 0"),
|
|
76
|
+
minHeight: "".concat(GRID_SIZE * 4, "px"),
|
|
77
|
+
overflow: '-moz-scrollbars-none',
|
|
78
|
+
'::-webkit-scrollbar': {
|
|
79
|
+
display: 'none'
|
|
80
|
+
},
|
|
81
|
+
scrollbarWidth: 'none',
|
|
82
|
+
MsOverflowStyle: 'none'
|
|
83
|
+
});
|
|
84
|
+
var categoryListWrapper = css(mobileCategoryListWrapper, {
|
|
85
|
+
padding: 0,
|
|
86
|
+
marginTop: "var(--ds-space-200, 24px)",
|
|
87
|
+
flexDirection: 'column'
|
|
88
|
+
});
|
|
33
89
|
function StatelessElementBrowser(props) {
|
|
34
90
|
var items = props.items,
|
|
35
91
|
onSelectItem = props.onSelectItem,
|
|
@@ -215,12 +271,15 @@ function DesktopBrowser(_ref2) {
|
|
|
215
271
|
css: showCategories ? sideBarShowCategories : sideBar
|
|
216
272
|
}, jsx("h2", {
|
|
217
273
|
css: sidebarHeading,
|
|
218
|
-
"data-testid": "sidebar-heading"
|
|
274
|
+
"data-testid": "sidebar-heading",
|
|
275
|
+
id: "sidebar-heading"
|
|
219
276
|
}, jsx(FormattedMessage, {
|
|
220
277
|
id: "fabric.editor.elementbrowser.sidebar.heading",
|
|
221
278
|
defaultMessage: "Browse",
|
|
222
279
|
description: "Sidebar heading"
|
|
223
280
|
})), jsx("nav", {
|
|
281
|
+
role: "tablist",
|
|
282
|
+
"aria-labelledby": "sidebar-heading",
|
|
224
283
|
css: categoryListWrapper
|
|
225
284
|
}, jsx(CategoryList, {
|
|
226
285
|
categories: categories,
|
|
@@ -231,7 +290,9 @@ function DesktopBrowser(_ref2) {
|
|
|
231
290
|
css: mainContent,
|
|
232
291
|
onKeyDown: onKeyDown,
|
|
233
292
|
"data-testid": "main-content"
|
|
234
|
-
}, showSearch &&
|
|
293
|
+
}, showSearch &&
|
|
294
|
+
// eslint-disable-next-line
|
|
295
|
+
jsx("div", {
|
|
235
296
|
css: searchContainer
|
|
236
297
|
}, jsx(ElementSearch, {
|
|
237
298
|
onSearch: onSearch,
|
|
@@ -156,19 +156,24 @@ var widthPluginKey = {
|
|
|
156
156
|
}
|
|
157
157
|
};
|
|
158
158
|
var ExtensionDeprecated = function ExtensionDeprecated(props) {
|
|
159
|
-
return
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
159
|
+
return (
|
|
160
|
+
// @ts-ignore - 'WithPluginState' cannot be used as a JSX component.
|
|
161
|
+
// This error was introduced after upgrading to TypeScript 5
|
|
162
|
+
jsx(WithPluginState, {
|
|
163
|
+
editorView: props.view,
|
|
164
|
+
plugins: {
|
|
165
|
+
widthState: widthPluginKey
|
|
166
|
+
},
|
|
167
|
+
render: function render(_ref) {
|
|
168
|
+
var widthState = _ref.widthState;
|
|
169
|
+
return jsx(ExtensionWithPluginState, _extends({
|
|
170
|
+
widthState: widthState
|
|
171
|
+
}, props));
|
|
172
|
+
}
|
|
173
|
+
})
|
|
174
|
+
);
|
|
171
175
|
};
|
|
176
|
+
|
|
172
177
|
/**
|
|
173
178
|
* End workaround
|
|
174
179
|
*/
|
|
@@ -188,18 +188,22 @@ var widthPluginKey = {
|
|
|
188
188
|
}
|
|
189
189
|
};
|
|
190
190
|
var MultiBodiedExtensionDeprecated = function MultiBodiedExtensionDeprecated(props) {
|
|
191
|
-
return
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
191
|
+
return (
|
|
192
|
+
// @ts-ignore - 'WithPluginState' cannot be used as a JSX component.
|
|
193
|
+
// This error was introduced after upgrading to TypeScript 5
|
|
194
|
+
jsx(WithPluginState, {
|
|
195
|
+
editorView: props.editorView,
|
|
196
|
+
plugins: {
|
|
197
|
+
widthState: widthPluginKey
|
|
198
|
+
},
|
|
199
|
+
render: function render(_ref2) {
|
|
200
|
+
var widthState = _ref2.widthState;
|
|
201
|
+
return jsx(MultiBodiedExtensionWithWidth, _extends({
|
|
202
|
+
widthState: widthState
|
|
203
|
+
}, props));
|
|
204
|
+
}
|
|
205
|
+
})
|
|
206
|
+
);
|
|
203
207
|
};
|
|
204
208
|
/**
|
|
205
209
|
* End workaround
|
|
@@ -102,6 +102,9 @@ export function useSharedPluginState(injectionApi, plugins) {
|
|
|
102
102
|
return _objectSpread(_objectSpread({}, acc), {}, _defineProperty({}, "".concat(pluginName, "State"), injectionApi === null || injectionApi === void 0 ? void 0 : injectionApi[pluginName]));
|
|
103
103
|
}, {});
|
|
104
104
|
}, [injectionApi, pluginNames]);
|
|
105
|
+
|
|
106
|
+
// @ts-expect-error - Type '`${K}State`' is not assignable to type '`${K}State`'. Two different types with this name exist, but they are unrelated.
|
|
107
|
+
// This error was introduced after upgrading to TypeScript 5
|
|
105
108
|
return useSharedPluginStateInternal(namedExternalPlugins);
|
|
106
109
|
}
|
|
107
110
|
function useSharedPluginStateInternal(externalPlugins) {
|
|
@@ -6,7 +6,7 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
|
|
|
6
6
|
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; }
|
|
7
7
|
var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
8
8
|
var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
9
|
-
var packageVersion = "78.
|
|
9
|
+
var packageVersion = "78.18.0";
|
|
10
10
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
11
11
|
// Remove URL as it has UGC
|
|
12
12
|
// TODO: Sanitise the URL instead of just removing it
|
|
@@ -17,7 +17,7 @@ import { createAndFireEvent, withAnalyticsContext, withAnalyticsEvents } from '@
|
|
|
17
17
|
import { N0, N50A, N60A, N900 } from '@atlaskit/theme/colors';
|
|
18
18
|
import Layer from '../Layer';
|
|
19
19
|
var packageName = "@atlaskit/editor-common";
|
|
20
|
-
var packageVersion = "78.
|
|
20
|
+
var packageVersion = "78.18.0";
|
|
21
21
|
var halfFocusRing = 1;
|
|
22
22
|
var dropOffset = '0, 8';
|
|
23
23
|
var DropList = /*#__PURE__*/function (_Component) {
|
|
@@ -174,8 +174,8 @@ export declare enum INPUT_METHOD {
|
|
|
174
174
|
}
|
|
175
175
|
export declare enum TRIGGER_METHOD {
|
|
176
176
|
BUTTON = "button",
|
|
177
|
-
KEYBOARD = "keyboard",
|
|
178
|
-
SHORTCUT = "shortcut",
|
|
177
|
+
KEYBOARD = "keyboard",// single key, e.g. Esc, Enter
|
|
178
|
+
SHORTCUT = "shortcut",// combination of keys, e.g. Mod + F
|
|
179
179
|
TOOLBAR = "toolbar"
|
|
180
180
|
}
|
|
181
181
|
export declare enum ACTION_SUBJECT {
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
/// <reference path="../../../../../../typings/events.d.ts" />
|
|
1
2
|
/// <reference types="node" />
|
|
3
|
+
/// <reference types="node/events" />
|
|
2
4
|
import { EventEmitter } from 'events';
|
|
3
5
|
export type UpdateEvent = 'create' | 'delete' | 'resolve' | 'unresolve' | 'setselectedannotation';
|
|
4
6
|
export type VisibilityEvent = 'setvisibility';
|