@atlaskit/editor-core 167.0.3 → 169.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 +38 -0
- package/dist/cjs/create-editor/create-plugins-list.js +7 -0
- package/dist/cjs/plugins/analytics/types/toolbar-button.js +2 -0
- package/dist/cjs/plugins/annotation/pm-plugins/inline-comment.js +2 -2
- package/dist/cjs/plugins/breakout/index.js +7 -0
- package/dist/cjs/plugins/breakout/ui/LayoutButton.js +3 -1
- package/dist/cjs/plugins/card/pm-plugins/util/resolve.js +6 -1
- package/dist/cjs/plugins/card/styles.js +4 -2
- package/dist/cjs/plugins/card/toolbar.js +6 -1
- package/dist/cjs/plugins/code-block/styles.js +17 -41
- package/dist/cjs/plugins/code-block/ui/class-names.js +5 -2
- package/dist/cjs/plugins/collab-edit/index.js +2 -2
- package/dist/cjs/plugins/collab-edit/provider/channel.js +2 -2
- package/dist/cjs/plugins/copy-button/commands.js +85 -0
- package/dist/cjs/plugins/copy-button/index.js +27 -0
- package/dist/cjs/plugins/copy-button/pm-plugins/main.js +38 -0
- package/dist/cjs/plugins/copy-button/pm-plugins/plugin-key.js +11 -0
- package/dist/cjs/plugins/copy-button/utils.js +51 -0
- package/dist/cjs/plugins/extension/context-panel.js +2 -2
- package/dist/cjs/plugins/extension/pm-plugins/main.js +2 -2
- package/dist/cjs/plugins/feature-flags-context/feature-flags-from-props.js +4 -2
- package/dist/cjs/plugins/floating-toolbar/ui/ExtensionsPlaceholder.js +2 -2
- package/dist/cjs/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.js +2 -2
- package/dist/cjs/plugins/indentation/messages.js +23 -0
- package/dist/cjs/plugins/index.js +16 -0
- package/dist/cjs/plugins/list/index.js +0 -43
- package/dist/cjs/plugins/macro/actions.js +2 -2
- package/dist/cjs/plugins/media/nodeviews/mediaInline.js +2 -2
- package/dist/cjs/plugins/media/nodeviews/mediaSingle.js +2 -2
- package/dist/cjs/plugins/media/ui/ResizableMediaSingle/index.js +2 -2
- package/dist/cjs/plugins/panel/toolbar.js +10 -2
- package/dist/cjs/plugins/table/commands/hover.js +2 -2
- package/dist/cjs/plugins/table/toolbar.js +5 -1
- package/dist/cjs/plugins/table/utils/decoration.js +5 -1
- package/dist/cjs/plugins/toolbar-lists-indentation/index.js +65 -0
- package/dist/cjs/plugins/toolbar-lists-indentation/types.js +5 -0
- package/dist/cjs/plugins/toolbar-lists-indentation/ui/Toolbar.js +122 -0
- package/dist/cjs/plugins/toolbar-lists-indentation/ui/ToolbarDropdown.js +173 -0
- package/dist/cjs/plugins/toolbar-lists-indentation/ui/index.js +58 -0
- package/dist/cjs/plugins/toolbar-lists-indentation/ui/onItemActivated.js +48 -0
- package/dist/cjs/plugins/type-ahead/ui/TypeAheadList.js +4 -5
- package/dist/cjs/plugins/type-ahead/ui/TypeAheadListItem.js +17 -51
- package/dist/cjs/ui/ConfigPanel/ConfigPanel.js +2 -2
- package/dist/cjs/ui/ConfigPanel/Fields/CustomSelect.js +2 -2
- package/dist/cjs/ui/ConfigPanel/Fields/UserSelect.js +2 -2
- package/dist/cjs/ui/ConfigPanel/transformers.js +2 -2
- package/dist/cjs/ui/ElementBrowser/InsertMenu.js +12 -39
- package/dist/cjs/ui/ElementBrowser/components/ElementList/ElementList.js +31 -87
- package/dist/cjs/utils/clipboard.js +67 -2
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/create-editor/create-plugins-list.js +8 -1
- package/dist/es2019/plugins/analytics/types/toolbar-button.js +2 -0
- package/dist/es2019/plugins/breakout/index.js +7 -0
- package/dist/es2019/plugins/breakout/ui/LayoutButton.js +3 -1
- package/dist/es2019/plugins/card/pm-plugins/util/resolve.js +6 -1
- package/dist/es2019/plugins/card/styles.js +5 -0
- package/dist/es2019/plugins/card/toolbar.js +5 -1
- package/dist/es2019/plugins/code-block/styles.js +18 -95
- package/dist/es2019/plugins/code-block/ui/class-names.js +3 -2
- package/dist/es2019/plugins/copy-button/commands.js +64 -0
- package/dist/es2019/plugins/copy-button/index.js +15 -0
- package/dist/es2019/plugins/copy-button/pm-plugins/main.js +28 -0
- package/dist/es2019/plugins/copy-button/pm-plugins/plugin-key.js +2 -0
- package/dist/es2019/plugins/copy-button/utils.js +29 -0
- package/dist/es2019/plugins/feature-flags-context/feature-flags-from-props.js +4 -2
- package/dist/es2019/plugins/indentation/messages.js +14 -0
- package/dist/es2019/plugins/index.js +3 -1
- package/dist/es2019/plugins/list/index.js +1 -44
- package/dist/es2019/plugins/panel/toolbar.js +9 -2
- package/dist/es2019/plugins/table/commands/hover.js +2 -2
- package/dist/es2019/plugins/table/toolbar.js +5 -2
- package/dist/es2019/plugins/table/utils/decoration.js +5 -1
- package/dist/es2019/plugins/toolbar-lists-indentation/index.js +53 -0
- package/dist/es2019/plugins/toolbar-lists-indentation/types.js +1 -0
- package/dist/es2019/plugins/toolbar-lists-indentation/ui/Toolbar.js +94 -0
- package/dist/es2019/plugins/toolbar-lists-indentation/ui/ToolbarDropdown.js +149 -0
- package/dist/es2019/plugins/toolbar-lists-indentation/ui/index.js +49 -0
- package/dist/es2019/plugins/toolbar-lists-indentation/ui/onItemActivated.js +35 -0
- package/dist/es2019/plugins/type-ahead/ui/TypeAheadList.js +11 -10
- package/dist/es2019/plugins/type-ahead/ui/TypeAheadListItem.js +17 -48
- package/dist/es2019/ui/ElementBrowser/InsertMenu.js +10 -30
- package/dist/es2019/ui/ElementBrowser/components/ElementList/ElementList.js +34 -93
- package/dist/es2019/utils/clipboard.js +26 -0
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/actions/index.js +1 -1
- package/dist/esm/create-editor/ErrorBoundary.js +1 -1
- package/dist/esm/create-editor/create-plugins-list.js +8 -1
- package/dist/esm/editor.js +2 -1
- package/dist/esm/plugins/analytics/types/toolbar-button.js +2 -0
- package/dist/esm/plugins/annotation/pm-plugins/inline-comment.js +1 -1
- package/dist/esm/plugins/breakout/index.js +7 -0
- package/dist/esm/plugins/breakout/ui/LayoutButton.js +3 -1
- package/dist/esm/plugins/card/pm-plugins/util/resolve.js +6 -1
- package/dist/esm/plugins/card/styles.js +2 -1
- package/dist/esm/plugins/card/toolbar.js +5 -1
- package/dist/esm/plugins/code-block/styles.js +16 -35
- package/dist/esm/plugins/code-block/ui/class-names.js +3 -2
- package/dist/esm/plugins/collab-edit/index.js +1 -1
- package/dist/esm/plugins/collab-edit/provider/channel.js +1 -1
- package/dist/esm/plugins/copy-button/commands.js +66 -0
- package/dist/esm/plugins/copy-button/index.js +17 -0
- package/dist/esm/plugins/copy-button/pm-plugins/main.js +26 -0
- package/dist/esm/plugins/copy-button/pm-plugins/plugin-key.js +2 -0
- package/dist/esm/plugins/copy-button/utils.js +31 -0
- package/dist/esm/plugins/custom-autoformat/doc.js +1 -1
- package/dist/esm/plugins/custom-autoformat/index.js +1 -1
- package/dist/esm/plugins/extension/actions.js +1 -1
- package/dist/esm/plugins/extension/context-panel.js +1 -1
- package/dist/esm/plugins/extension/pm-plugins/main.js +1 -1
- package/dist/esm/plugins/extension/ui/Extension/ExtensionComponent.js +1 -1
- package/dist/esm/plugins/feature-flags-context/feature-flags-from-props.js +4 -2
- package/dist/esm/plugins/feedback-dialog/index.js +1 -1
- package/dist/esm/plugins/feedback-dialog/loadJiraCollectorDialogScript.js +1 -1
- package/dist/esm/plugins/find-replace/utils/batch-decorations.js +1 -1
- package/dist/esm/plugins/floating-toolbar/ui/ExtensionsPlaceholder.js +1 -1
- package/dist/esm/plugins/hyperlink/HyperlinkToolbarAppearance.js +1 -1
- package/dist/esm/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.js +2 -1
- package/dist/esm/plugins/image-upload/pm-plugins/main.js +1 -1
- package/dist/esm/plugins/indentation/messages.js +14 -0
- package/dist/esm/plugins/index.js +3 -1
- package/dist/esm/plugins/list/index.js +1 -41
- package/dist/esm/plugins/macro/actions.js +1 -1
- package/dist/esm/plugins/media/nodeviews/mediaGroup.js +1 -1
- package/dist/esm/plugins/media/nodeviews/mediaInline.js +2 -1
- package/dist/esm/plugins/media/nodeviews/mediaNodeUpdater.js +1 -1
- package/dist/esm/plugins/media/nodeviews/mediaNodeView/media.js +1 -1
- package/dist/esm/plugins/media/nodeviews/mediaSingle.js +1 -1
- package/dist/esm/plugins/media/picker-facade.js +1 -1
- package/dist/esm/plugins/media/pm-plugins/main.js +1 -1
- package/dist/esm/plugins/media/toolbar/utils.js +1 -1
- package/dist/esm/plugins/media/ui/MediaPicker/PickerFacadeProvider.js +1 -1
- package/dist/esm/plugins/media/ui/ResizableMediaSingle/index.js +1 -1
- package/dist/esm/plugins/media/utils/check-media-type.js +1 -1
- package/dist/esm/plugins/panel/toolbar.js +9 -2
- package/dist/esm/plugins/paste/handlers.js +1 -1
- package/dist/esm/plugins/paste/pm-plugins/main.js +1 -1
- package/dist/esm/plugins/quick-insert/index.js +1 -1
- package/dist/esm/plugins/table/commands/hover.js +2 -2
- package/dist/esm/plugins/table/toolbar.js +5 -2
- package/dist/esm/plugins/table/utils/decoration.js +5 -1
- package/dist/esm/plugins/tasks-and-decisions/ui/Task/task-item-with-providers.js +1 -1
- package/dist/esm/plugins/toolbar-lists-indentation/index.js +51 -0
- package/dist/esm/plugins/toolbar-lists-indentation/types.js +1 -0
- package/dist/esm/plugins/toolbar-lists-indentation/ui/Toolbar.js +96 -0
- package/dist/esm/plugins/toolbar-lists-indentation/ui/ToolbarDropdown.js +153 -0
- package/dist/esm/plugins/toolbar-lists-indentation/ui/index.js +47 -0
- package/dist/esm/plugins/toolbar-lists-indentation/ui/onItemActivated.js +39 -0
- package/dist/esm/plugins/type-ahead/ui/TypeAheadList.js +6 -8
- package/dist/esm/plugins/type-ahead/ui/TypeAheadListItem.js +18 -51
- package/dist/esm/ui/ConfigPanel/ConfigPanel.js +1 -1
- package/dist/esm/ui/ConfigPanel/Fields/CustomSelect.js +1 -1
- package/dist/esm/ui/ConfigPanel/Fields/UserSelect.js +1 -1
- package/dist/esm/ui/ConfigPanel/FormErrorBoundary.js +1 -1
- package/dist/esm/ui/ConfigPanel/transformers.js +1 -1
- package/dist/esm/ui/ElementBrowser/InsertMenu.js +12 -35
- package/dist/esm/ui/ElementBrowser/components/ElementList/ElementList.js +31 -89
- package/dist/esm/ui/LinkSearch/index.js +1 -1
- package/dist/esm/ui/ToolbarFeedback/index.js +1 -1
- package/dist/esm/utils/action.js +1 -1
- package/dist/esm/utils/clipboard.js +56 -1
- package/dist/esm/utils/extensions.js +1 -1
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/plugins/analytics/types/toolbar-button.d.ts +3 -1
- package/dist/types/plugins/card/styles.d.ts +1 -0
- package/dist/types/plugins/copy-button/commands.d.ts +4 -0
- package/dist/types/plugins/copy-button/index.d.ts +3 -0
- package/dist/types/plugins/copy-button/pm-plugins/main.d.ts +3 -0
- package/dist/types/plugins/copy-button/pm-plugins/plugin-key.d.ts +2 -0
- package/dist/types/plugins/copy-button/utils.d.ts +7 -0
- package/dist/types/plugins/indentation/messages.d.ts +12 -0
- package/dist/types/plugins/index.d.ts +2 -0
- package/dist/types/plugins/panel/toolbar.d.ts +1 -1
- package/dist/types/plugins/table/commands/hover.d.ts +1 -1
- package/dist/types/plugins/table/utils/decoration.d.ts +1 -1
- package/dist/types/plugins/text-formatting/utils.d.ts +1 -1
- package/dist/types/plugins/toolbar-lists-indentation/index.d.ts +5 -0
- package/dist/types/plugins/toolbar-lists-indentation/types.d.ts +16 -0
- package/dist/types/plugins/toolbar-lists-indentation/ui/Toolbar.d.ts +4 -0
- package/dist/types/plugins/toolbar-lists-indentation/ui/ToolbarDropdown.d.ts +9 -0
- package/dist/types/plugins/{list/ui/ToolbarLists → toolbar-lists-indentation/ui}/index.d.ts +4 -10
- package/dist/types/plugins/toolbar-lists-indentation/ui/onItemActivated.d.ts +6 -0
- package/dist/types/plugins/type-ahead/ui/TypeAheadListItem.d.ts +0 -25
- package/dist/types/types/feature-flags.d.ts +18 -0
- package/dist/types/ui/ElementBrowser/components/ElementList/ElementList.d.ts +11 -0
- package/dist/types/utils/clipboard.d.ts +1 -0
- package/package.json +25 -25
- package/report.api.md +6747 -0
- package/dist/cjs/plugins/list/ui/ToolbarLists/index.js +0 -266
- package/dist/es2019/plugins/list/ui/ToolbarLists/index.js +0 -220
- package/dist/esm/plugins/list/ui/ToolbarLists/index.js +0 -241
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { jsx } from '@emotion/react';
|
|
3
|
+
import { onItemActivated } from './onItemActivated';
|
|
4
|
+
import { ToolbarDropdown } from './ToolbarDropdown';
|
|
5
|
+
import { Toolbar } from './Toolbar';
|
|
6
|
+
export default function ToolbarListsIndentation(props) {
|
|
7
|
+
var disabled = props.disabled,
|
|
8
|
+
isSmall = props.isSmall,
|
|
9
|
+
isReducedSpacing = props.isReducedSpacing,
|
|
10
|
+
bulletListActive = props.bulletListActive,
|
|
11
|
+
bulletListDisabled = props.bulletListDisabled,
|
|
12
|
+
orderedListActive = props.orderedListActive,
|
|
13
|
+
orderedListDisabled = props.orderedListDisabled,
|
|
14
|
+
showIndentationButtons = props.showIndentationButtons,
|
|
15
|
+
popupsMountPoint = props.popupsMountPoint,
|
|
16
|
+
popupsBoundariesElement = props.popupsBoundariesElement,
|
|
17
|
+
popupsScrollableElement = props.popupsScrollableElement;
|
|
18
|
+
|
|
19
|
+
if (isSmall) {
|
|
20
|
+
return jsx(ToolbarDropdown, {
|
|
21
|
+
editorView: props.editorView,
|
|
22
|
+
isReducedSpacing: isReducedSpacing,
|
|
23
|
+
popupsMountPoint: popupsMountPoint,
|
|
24
|
+
popupsBoundariesElement: popupsBoundariesElement,
|
|
25
|
+
popupsScrollableElement: popupsScrollableElement,
|
|
26
|
+
bulletListActive: bulletListActive,
|
|
27
|
+
bulletListDisabled: bulletListDisabled,
|
|
28
|
+
showIndentationButtons: showIndentationButtons,
|
|
29
|
+
orderedListActive: orderedListActive,
|
|
30
|
+
orderedListDisabled: orderedListDisabled,
|
|
31
|
+
disabled: disabled,
|
|
32
|
+
onItemActivated: onItemActivated
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
return jsx(Toolbar, {
|
|
37
|
+
editorView: props.editorView,
|
|
38
|
+
isReducedSpacing: isReducedSpacing,
|
|
39
|
+
bulletListActive: bulletListActive,
|
|
40
|
+
bulletListDisabled: bulletListDisabled,
|
|
41
|
+
showIndentationButtons: showIndentationButtons,
|
|
42
|
+
orderedListActive: orderedListActive,
|
|
43
|
+
orderedListDisabled: orderedListDisabled,
|
|
44
|
+
disabled: disabled,
|
|
45
|
+
onItemActivated: onItemActivated
|
|
46
|
+
});
|
|
47
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { toggleBulletList, toggleOrderedList } from '../../list/commands';
|
|
2
|
+
import { INPUT_METHOD } from '../../analytics';
|
|
3
|
+
export function onItemActivated(_ref) {
|
|
4
|
+
var buttonName = _ref.buttonName,
|
|
5
|
+
editorView = _ref.editorView;
|
|
6
|
+
|
|
7
|
+
switch (buttonName) {
|
|
8
|
+
case 'bullet_list':
|
|
9
|
+
toggleBulletList(editorView, INPUT_METHOD.TOOLBAR);
|
|
10
|
+
break;
|
|
11
|
+
|
|
12
|
+
case 'ordered_list':
|
|
13
|
+
toggleOrderedList(editorView, INPUT_METHOD.TOOLBAR);
|
|
14
|
+
break;
|
|
15
|
+
|
|
16
|
+
case 'indent':
|
|
17
|
+
editorView.someProp('handleKeyDown', function (handleKeyDown) {
|
|
18
|
+
return handleKeyDown(editorView, new KeyboardEvent('keydown', {
|
|
19
|
+
bubbles: true,
|
|
20
|
+
cancelable: true,
|
|
21
|
+
key: 'Tab',
|
|
22
|
+
code: 'Tab'
|
|
23
|
+
}));
|
|
24
|
+
});
|
|
25
|
+
break;
|
|
26
|
+
|
|
27
|
+
case 'outdent':
|
|
28
|
+
editorView.someProp('handleKeyDown', function (handleKeyDown) {
|
|
29
|
+
return handleKeyDown(editorView, new KeyboardEvent('keydown', {
|
|
30
|
+
bubbles: true,
|
|
31
|
+
cancelable: true,
|
|
32
|
+
shiftKey: true,
|
|
33
|
+
key: 'Tab',
|
|
34
|
+
code: 'Tab'
|
|
35
|
+
}));
|
|
36
|
+
});
|
|
37
|
+
break;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -4,10 +4,9 @@ var _templateObject;
|
|
|
4
4
|
|
|
5
5
|
/** @jsx jsx */
|
|
6
6
|
import React, { useMemo, useEffect, useRef, useCallback, useLayoutEffect } from 'react';
|
|
7
|
-
import { jsx, css } from '@emotion/react';
|
|
8
|
-
|
|
9
|
-
import {
|
|
10
|
-
import { ICON_HEIGHT, itemTheme, ITEM_PADDING } from './TypeAheadListItem';
|
|
7
|
+
import { jsx, css } from '@emotion/react';
|
|
8
|
+
import { MenuGroup } from '@atlaskit/menu';
|
|
9
|
+
import { ICON_HEIGHT, ITEM_PADDING } from './TypeAheadListItem';
|
|
11
10
|
import { VariableSizeList as List } from 'react-window';
|
|
12
11
|
import { ResizeObserverProvider } from './hooks/use-resize-observer';
|
|
13
12
|
import { useDynamicListHeightCalculation } from './hooks/use-dynamic-list-height-calculation';
|
|
@@ -104,12 +103,11 @@ var TypeAheadListComponent = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
104
103
|
|
|
105
104
|
var estimatedHeight = items.length * LIST_ITEM_ESTIMATED_HEIGHT;
|
|
106
105
|
var height = Math.min(typeof renderedListHeight === 'number' ? renderedListHeight : estimatedHeight, fitHeight);
|
|
107
|
-
return jsx(
|
|
106
|
+
return jsx(MenuGroup, {
|
|
108
107
|
role: "listbox",
|
|
109
108
|
"aria-live": "polite",
|
|
110
109
|
"aria-label": intl.formatMessage(typeAheadListMessages.typeAheadResultLabel),
|
|
111
|
-
"aria-relevant": "additions removals"
|
|
112
|
-
theme: itemTheme
|
|
110
|
+
"aria-relevant": "additions removals"
|
|
113
111
|
}, jsx(ResizeObserverProvider, null, jsx(UpdateListItemHeightContext.Provider, {
|
|
114
112
|
value: setListItemHeight
|
|
115
113
|
}, jsx(ListItemActionsContext.Provider, {
|
|
@@ -128,7 +126,7 @@ var TypeAheadListComponent = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
128
126
|
width: LIST_WIDTH,
|
|
129
127
|
height: height,
|
|
130
128
|
overscanCount: 3,
|
|
131
|
-
css: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n
|
|
129
|
+
css: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n button {\n padding: 12px 12px 11px;\n\n span:last-child span:last-child {\n white-space: normal;\n }\n }\n "])))
|
|
132
130
|
}, DynamicHeightListItem))))));
|
|
133
131
|
});
|
|
134
132
|
export var TypeAheadList = injectIntl(TypeAheadListComponent);
|
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
2
|
|
|
4
3
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
5
4
|
|
|
6
5
|
/** @jsx jsx */
|
|
7
6
|
import React, { useCallback, useMemo, useRef, useLayoutEffect } from 'react';
|
|
8
7
|
import { css, jsx } from '@emotion/react';
|
|
9
|
-
import {
|
|
8
|
+
import { DN600, N200, N800 } from '@atlaskit/theme/colors';
|
|
10
9
|
import { themed } from '@atlaskit/theme/components';
|
|
11
|
-
import { borderRadius } from '@atlaskit/theme/constants';
|
|
12
|
-
|
|
13
|
-
import Item, { itemThemeNamespace } from '@atlaskit/item';
|
|
10
|
+
import { borderRadius } from '@atlaskit/theme/constants';
|
|
11
|
+
import { ButtonItem } from '@atlaskit/menu';
|
|
14
12
|
import { relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
|
|
15
13
|
import IconFallback from '../../quick-insert/assets/fallback';
|
|
16
14
|
import { shortcutStyle } from '../../../ui/styles';
|
|
@@ -19,46 +17,16 @@ import { token } from '@atlaskit/tokens';
|
|
|
19
17
|
export var ICON_HEIGHT = 40;
|
|
20
18
|
export var ICON_WIDTH = 40;
|
|
21
19
|
export var ITEM_PADDING = 12;
|
|
22
|
-
export var itemTheme = _defineProperty({}, itemThemeNamespace, {
|
|
23
|
-
padding: {
|
|
24
|
-
default: {
|
|
25
|
-
bottom: ITEM_PADDING,
|
|
26
|
-
left: ITEM_PADDING,
|
|
27
|
-
right: ITEM_PADDING,
|
|
28
|
-
top: ITEM_PADDING
|
|
29
|
-
}
|
|
30
|
-
},
|
|
31
|
-
beforeItemSpacing: {
|
|
32
|
-
default: function _default() {
|
|
33
|
-
return ITEM_PADDING;
|
|
34
|
-
}
|
|
35
|
-
},
|
|
36
|
-
borderRadius: function borderRadius() {
|
|
37
|
-
return 0;
|
|
38
|
-
},
|
|
39
|
-
hover: {
|
|
40
|
-
// background: colors.transparent, transparent is not a thing
|
|
41
|
-
text: colorsText,
|
|
42
|
-
secondaryText: token('color.text.subtlest', N200)
|
|
43
|
-
},
|
|
44
|
-
selected: {
|
|
45
|
-
background: themed({
|
|
46
|
-
light: token('color.background.neutral.subtle.hovered', N20),
|
|
47
|
-
dark: token('color.background.neutral.subtle.hovered', DN70)
|
|
48
|
-
}),
|
|
49
|
-
text: themed({
|
|
50
|
-
light: token('color.text', N800),
|
|
51
|
-
dark: token('color.text', DN600)
|
|
52
|
-
}),
|
|
53
|
-
secondaryText: themed({
|
|
54
|
-
light: token('color.text.subtlest', N200),
|
|
55
|
-
dark: token('color.text.subtlest', DN300)
|
|
56
|
-
})
|
|
57
|
-
}
|
|
58
|
-
});
|
|
59
20
|
export var itemIcon = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n width: ", "px;\n height: ", "px;\n overflow: hidden;\n border: 1px solid ", "; /* N60 at 50% */\n border-radius: ", "px;\n box-sizing: border-box;\n\n display: flex;\n justify-content: center;\n align-items: center;\n\n div {\n width: ", "px;\n height: ", "px;\n }\n"])), ICON_WIDTH, ICON_HEIGHT, token('color.border', 'rgba(223, 225, 229, 0.5)'), borderRadius(), ICON_WIDTH, ICON_HEIGHT);
|
|
60
21
|
var itemBody = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: row;\n flex-wrap: nowrap;\n justify-content: space-between;\n line-height: 1.4;\n"])));
|
|
61
|
-
|
|
22
|
+
|
|
23
|
+
var itemText = function itemText(theme) {
|
|
24
|
+
return css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n white-space: initial;\n color: ", ";\n .item-description {\n font-size: ", ";\n color: ", ";\n margin-top: 4px;\n }\n"])), themed({
|
|
25
|
+
light: token('color.text', N800),
|
|
26
|
+
dark: token('color.text', DN600)
|
|
27
|
+
})(theme), relativeFontSizeToBase16(11.67), token('color.text.subtlest', N200));
|
|
28
|
+
};
|
|
29
|
+
|
|
62
30
|
var itemAfter = css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n flex: 0 0 auto;\n"])));
|
|
63
31
|
var hidden = {
|
|
64
32
|
overflow: 'hidden'
|
|
@@ -134,26 +102,25 @@ export var TypeAheadListItem = function TypeAheadListItem(_ref2) {
|
|
|
134
102
|
return customItem;
|
|
135
103
|
}
|
|
136
104
|
|
|
137
|
-
return jsx(
|
|
105
|
+
return jsx("span", {
|
|
106
|
+
onMouseMove: onMouseMove
|
|
107
|
+
}, jsx(ButtonItem, {
|
|
138
108
|
onClick: insertSelectedItem,
|
|
139
|
-
|
|
140
|
-
elemBefore: elementIcon,
|
|
109
|
+
iconBefore: elementIcon,
|
|
141
110
|
isSelected: isSelected,
|
|
142
111
|
"aria-selected": isSelected,
|
|
143
112
|
"aria-label": item.title,
|
|
144
113
|
role: "option",
|
|
145
|
-
|
|
114
|
+
description: item.description
|
|
146
115
|
}, jsx("div", {
|
|
147
116
|
css: itemBody
|
|
148
117
|
}, jsx("div", {
|
|
149
118
|
css: itemText
|
|
150
119
|
}, jsx("div", {
|
|
151
120
|
className: "item-title"
|
|
152
|
-
}, item.title),
|
|
153
|
-
className: "item-description"
|
|
154
|
-
}, item.description)), jsx("div", {
|
|
121
|
+
}, item.title)), jsx("div", {
|
|
155
122
|
css: itemAfter
|
|
156
123
|
}, item.keyshortcut && jsx("div", {
|
|
157
124
|
css: shortcutStyle
|
|
158
|
-
}, item.keyshortcut))));
|
|
125
|
+
}, item.keyshortcut)))));
|
|
159
126
|
};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
3
2
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
4
3
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
5
4
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
@@ -8,6 +7,7 @@ import _inherits from "@babel/runtime/helpers/inherits";
|
|
|
8
7
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
9
8
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
10
9
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
10
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
11
11
|
|
|
12
12
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
13
13
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
3
2
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
4
3
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
4
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
5
5
|
import React, { useEffect, useState } from 'react';
|
|
6
6
|
import { injectIntl } from 'react-intl-next';
|
|
7
7
|
import { messages } from '../messages';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
3
2
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
4
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
5
4
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
6
5
|
var _excluded = ["value"];
|
|
6
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
7
7
|
|
|
8
8
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
9
9
|
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
2
1
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
3
2
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
4
3
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
@@ -7,6 +6,7 @@ import _inherits from "@babel/runtime/helpers/inherits";
|
|
|
7
6
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
8
7
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
9
8
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
9
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
10
10
|
|
|
11
11
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
12
12
|
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
-
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
3
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
4
3
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
5
4
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
@@ -11,6 +10,7 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
11
10
|
|
|
12
11
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
13
12
|
|
|
13
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
14
14
|
import { isFieldset, isDateRange, isTabGroup, isTabField, isExpand, getFieldSerializer, getFieldDeserializer } from '@atlaskit/editor-common/extensions';
|
|
15
15
|
import { getNameFromDuplicateField, isDuplicateField } from './utils';
|
|
16
16
|
|
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
4
3
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
5
4
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
6
5
|
var _excluded = ["children"];
|
|
7
6
|
|
|
8
|
-
var _templateObject, _templateObject2, _templateObject3;
|
|
7
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
9
8
|
|
|
10
9
|
/** @jsx jsx */
|
|
11
|
-
import
|
|
10
|
+
import { useState, useCallback } from 'react';
|
|
12
11
|
import { css, jsx } from '@emotion/react';
|
|
13
|
-
|
|
14
|
-
import Item, { itemThemeNamespace } from '@atlaskit/item'; // AFP-2532 TODO: Fix automatic suppressions below
|
|
12
|
+
import { Section, ButtonItem } from '@atlaskit/menu'; // AFP-2532 TODO: Fix automatic suppressions below
|
|
15
13
|
// eslint-disable-next-line @atlassian/tangerine/import/entry-points
|
|
16
14
|
|
|
17
15
|
import { borderRadius, gridSize } from '@atlaskit/theme';
|
|
@@ -115,26 +113,17 @@ var InsertMenu = function InsertMenu(_ref) {
|
|
|
115
113
|
|
|
116
114
|
var ViewMore = function ViewMore(_ref3) {
|
|
117
115
|
var item = _ref3.item;
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
if (e.which === ENTER_KEY || e.which === SPACE_KEY) {
|
|
123
|
-
// @ts-ignore We manually transformed "view more" to a quickInsert item
|
|
124
|
-
// action would always toggle the ModalElementBrowser
|
|
125
|
-
item.action();
|
|
126
|
-
}
|
|
127
|
-
}, [item]);
|
|
128
|
-
return jsx(Item, {
|
|
116
|
+
return jsx(Section, {
|
|
117
|
+
hasSeparator: true
|
|
118
|
+
}, jsx(ButtonItem, {
|
|
129
119
|
onClick: item.action,
|
|
130
|
-
|
|
120
|
+
iconBefore: jsx("div", {
|
|
131
121
|
css: itemBefore
|
|
132
122
|
}, item.icon()),
|
|
133
123
|
"aria-describedby": item.title,
|
|
134
124
|
"data-testid": "view-more-elements-item",
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
}, item.title);
|
|
125
|
+
css: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n padding: 0px 12px;\n "])))
|
|
126
|
+
}, item.title));
|
|
138
127
|
};
|
|
139
128
|
|
|
140
129
|
var getSvgIconForItem = function getSvgIconForItem(_ref4) {
|
|
@@ -167,7 +156,7 @@ var getInsertMenuHeight = function getInsertMenuHeight(_ref5) {
|
|
|
167
156
|
};
|
|
168
157
|
|
|
169
158
|
var insertMenuWrapper = function insertMenuWrapper(theme, itemCount) {
|
|
170
|
-
return css(
|
|
159
|
+
return css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n width: 320px;\n height: ", "px;\n background-color: ", ";\n border-radius: ", "px;\n box-shadow: ", ";\n"])), getInsertMenuHeight({
|
|
171
160
|
itemCount: itemCount
|
|
172
161
|
}), themed({
|
|
173
162
|
light: token('elevation.surface.overlay', N0),
|
|
@@ -175,20 +164,8 @@ var insertMenuWrapper = function insertMenuWrapper(theme, itemCount) {
|
|
|
175
164
|
})(theme), borderRadius(), token('elevation.shadow.overlay', "0 0 0 1px ".concat(N30A, ",\n 0 2px 1px ").concat(N30A, ",\n 0 0 20px -6px ").concat(N60A)));
|
|
176
165
|
};
|
|
177
166
|
|
|
178
|
-
var itemBefore = css(
|
|
179
|
-
var
|
|
180
|
-
var HEIGHT = 40;
|
|
181
|
-
|
|
182
|
-
var viewMoreItemTheme = _defineProperty({}, itemThemeNamespace, {
|
|
183
|
-
padding: {
|
|
184
|
-
default: {
|
|
185
|
-
left: PADDING_LEFT
|
|
186
|
-
}
|
|
187
|
-
},
|
|
188
|
-
height: HEIGHT
|
|
189
|
-
});
|
|
190
|
-
|
|
191
|
-
var flexWrapperStyles = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n display: flex;\n flex: 1;\n box-sizing: border-box;\n overflow: hidden;\n"])));
|
|
167
|
+
var itemBefore = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n width: 40px;\n height: 40px;\n box-sizing: border-box;\n display: flex;\n justify-content: center;\n align-items: center;\n margin-right: ", "px;\n"])), gridSize() / 2);
|
|
168
|
+
var flexWrapperStyles = css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n display: flex;\n flex: 1;\n box-sizing: border-box;\n overflow: hidden;\n"])));
|
|
192
169
|
|
|
193
170
|
var FlexWrapper = function FlexWrapper(props) {
|
|
194
171
|
var children = props.children,
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
2
|
import _extends from "@babel/runtime/helpers/extends";
|
|
4
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
5
4
|
|
|
@@ -7,19 +6,13 @@ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _temp
|
|
|
7
6
|
|
|
8
7
|
var _excluded = ["items", "mode", "selectedItemIndex", "focusedItemIndex", "setColumnCount", "createAnalyticsEvent", "emptyStateHandler", "selectedCategory", "searchTerm"];
|
|
9
8
|
|
|
10
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
11
|
-
|
|
12
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
13
|
-
|
|
14
9
|
/** @jsx jsx */
|
|
15
10
|
import React, { Fragment, memo, useCallback, useEffect, useMemo } from 'react';
|
|
16
11
|
import { css, jsx } from '@emotion/react';
|
|
17
|
-
import memoizeOne from 'memoize-one';
|
|
18
12
|
import { AutoSizer } from 'react-virtualized/dist/commonjs/AutoSizer';
|
|
19
13
|
import { Collection } from 'react-virtualized/dist/commonjs/Collection';
|
|
20
|
-
|
|
21
|
-
import
|
|
22
|
-
import { B100, N20, N200 } from '@atlaskit/theme/colors';
|
|
14
|
+
import { ButtonItem } from '@atlaskit/menu';
|
|
15
|
+
import { B100, N200 } from '@atlaskit/theme/colors';
|
|
23
16
|
import Tooltip from '@atlaskit/tooltip';
|
|
24
17
|
import { relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
|
|
25
18
|
import { token } from '@atlaskit/tokens';
|
|
@@ -28,7 +21,7 @@ import { ACTION, ACTION_SUBJECT, EVENT_TYPE, fireAnalyticsEvent } from '../../..
|
|
|
28
21
|
import IconFallback from '../../../../plugins/quick-insert/assets/fallback';
|
|
29
22
|
import { itemIcon } from '../../../../plugins/type-ahead/ui/TypeAheadListItem';
|
|
30
23
|
import { shortcutStyle } from '../../../styles';
|
|
31
|
-
import {
|
|
24
|
+
import { ELEMENT_LIST_PADDING, SCROLLBAR_THUMB_COLOR, SCROLLBAR_TRACK_COLOR, SCROLLBAR_WIDTH } from '../../constants';
|
|
32
25
|
import useContainerWidth from '../../hooks/use-container-width';
|
|
33
26
|
import useFocus from '../../hooks/use-focus';
|
|
34
27
|
import { Modes } from '../../types';
|
|
@@ -128,44 +121,9 @@ function ElementList(_ref) {
|
|
|
128
121
|
}))));
|
|
129
122
|
}
|
|
130
123
|
|
|
131
|
-
var getStyles = memoizeOne(function (mode) {
|
|
132
|
-
return _objectSpread(_objectSpread({}, mode === Modes.full && {
|
|
133
|
-
'-ms-flex': 'auto',
|
|
134
|
-
position: 'relative',
|
|
135
|
-
boxSizing: 'border-box'
|
|
136
|
-
}), {}, {
|
|
137
|
-
height: {
|
|
138
|
-
default: ELEMENT_ITEM_HEIGHT
|
|
139
|
-
},
|
|
140
|
-
padding: {
|
|
141
|
-
default: {
|
|
142
|
-
top: GRID_SIZE * 1.5,
|
|
143
|
-
right: GRID_SIZE * 1.5,
|
|
144
|
-
bottom: GRID_SIZE * 1.5,
|
|
145
|
-
left: GRID_SIZE * 1.5
|
|
146
|
-
}
|
|
147
|
-
},
|
|
148
|
-
borderRadius: GRID_SIZE / 2,
|
|
149
|
-
// TODO: apply a different background for when a selected item is hovered.
|
|
150
|
-
// Not possible due to current implementation of @atlaskit/item component.
|
|
151
|
-
selected: {
|
|
152
|
-
background: token('color.background.selected', N20)
|
|
153
|
-
},
|
|
154
|
-
hover: {
|
|
155
|
-
background: token('color.background.neutral.subtle.hovered', 'rgb(244, 245, 247)')
|
|
156
|
-
},
|
|
157
|
-
active: {
|
|
158
|
-
background: token('color.background.neutral.subtle.pressed', 'rgb(244, 245, 247)')
|
|
159
|
-
},
|
|
160
|
-
beforeItemSpacing: {
|
|
161
|
-
default: GRID_SIZE * 1.5
|
|
162
|
-
}
|
|
163
|
-
});
|
|
164
|
-
});
|
|
165
124
|
var MemoizedElementItem = /*#__PURE__*/memo(ElementItem);
|
|
166
125
|
MemoizedElementItem.displayName = 'MemoizedElementItem';
|
|
167
|
-
|
|
168
|
-
function ElementItem(_ref4) {
|
|
126
|
+
export function ElementItem(_ref4) {
|
|
169
127
|
var inlineMode = _ref4.inlineMode,
|
|
170
128
|
selected = _ref4.selected,
|
|
171
129
|
item = _ref4.item,
|
|
@@ -174,11 +132,6 @@ function ElementItem(_ref4) {
|
|
|
174
132
|
focus = _ref4.focus,
|
|
175
133
|
setFocusedItemIndex = _ref4.setFocusedItemIndex;
|
|
176
134
|
var ref = useFocus(focus);
|
|
177
|
-
var theme = useMemo(function () {
|
|
178
|
-
return {
|
|
179
|
-
'@atlaskit-shared-theme/item': getStyles(inlineMode ? 'inline' : 'full')
|
|
180
|
-
};
|
|
181
|
-
}, [inlineMode]);
|
|
182
135
|
/**
|
|
183
136
|
* Note: props.onSelectItem(item) is not called here as the StatelessElementBrowser's
|
|
184
137
|
* useEffect would trigger it on selectedItemIndex change. (Line 106-110)
|
|
@@ -190,33 +143,29 @@ function ElementItem(_ref4) {
|
|
|
190
143
|
e.stopPropagation();
|
|
191
144
|
setFocusedItemIndex(index);
|
|
192
145
|
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
var onDoubleClick = useCallback(function (e) {
|
|
198
|
-
if (inlineMode) {
|
|
199
|
-
return;
|
|
200
|
-
}
|
|
146
|
+
switch (e.nativeEvent.detail) {
|
|
147
|
+
case 0:
|
|
148
|
+
onInsertItem(item);
|
|
149
|
+
break;
|
|
201
150
|
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
151
|
+
case 1:
|
|
152
|
+
if (inlineMode) {
|
|
153
|
+
onInsertItem(item);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
break;
|
|
208
157
|
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
158
|
+
case 2:
|
|
159
|
+
if (!inlineMode) {
|
|
160
|
+
onInsertItem(item);
|
|
161
|
+
}
|
|
212
162
|
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
onInsertItem(item);
|
|
163
|
+
break;
|
|
164
|
+
|
|
165
|
+
default:
|
|
166
|
+
return;
|
|
218
167
|
}
|
|
219
|
-
}, [index, item, onInsertItem, setFocusedItemIndex]);
|
|
168
|
+
}, [index, inlineMode, item, onInsertItem, setFocusedItemIndex]);
|
|
220
169
|
var icon = item.icon,
|
|
221
170
|
title = item.title,
|
|
222
171
|
description = item.description,
|
|
@@ -224,35 +173,28 @@ function ElementItem(_ref4) {
|
|
|
224
173
|
return jsx(Tooltip, {
|
|
225
174
|
content: description,
|
|
226
175
|
testId: "element-item-tooltip-".concat(index)
|
|
227
|
-
}, jsx(
|
|
176
|
+
}, jsx(ButtonItem, {
|
|
228
177
|
onClick: onClick,
|
|
229
|
-
|
|
230
|
-
elemBefore: jsx(ElementBefore, {
|
|
178
|
+
iconBefore: jsx(ElementBefore, {
|
|
231
179
|
icon: icon,
|
|
232
180
|
title: title
|
|
233
181
|
}),
|
|
234
182
|
isSelected: selected,
|
|
235
183
|
"aria-describedby": title,
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
"data-testid": "element-item-".concat(index),
|
|
239
|
-
tabIndex: 0,
|
|
240
|
-
style: inlineMode ? null : itemStyleOverrides,
|
|
241
|
-
theme: theme
|
|
184
|
+
ref: ref,
|
|
185
|
+
testId: "element-item-".concat(index)
|
|
242
186
|
}, jsx(ItemContent, {
|
|
187
|
+
style: inlineMode ? null : itemStyleOverrides,
|
|
188
|
+
tabIndex: 0,
|
|
243
189
|
title: title,
|
|
244
190
|
description: description,
|
|
245
191
|
keyshortcut: keyshortcut
|
|
246
192
|
})));
|
|
247
193
|
}
|
|
248
194
|
/**
|
|
249
|
-
* Some properties (specified in 'BaseItem' packages/design-system/item/src/styled/Item.js) cannot be changed with
|
|
250
|
-
* ThemeProvider as they are of higher specificity.
|
|
251
|
-
*
|
|
252
195
|
* Inline mode should use the existing Align-items:center value.
|
|
253
196
|
*/
|
|
254
197
|
|
|
255
|
-
|
|
256
198
|
var itemStyleOverrides = {
|
|
257
199
|
alignItems: 'flex-start'
|
|
258
200
|
};
|
|
@@ -285,8 +227,8 @@ var ItemContent = /*#__PURE__*/memo(function (_ref6) {
|
|
|
285
227
|
}, description)));
|
|
286
228
|
});
|
|
287
229
|
var scrollbarStyle = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n ::-webkit-scrollbar {\n width: ", "px;\n }\n ::-webkit-scrollbar-track-piece {\n background: ", ";\n }\n ::-webkit-scrollbar-thumb {\n background: ", ";\n }\n\n /** Firefox **/\n scrollbar-color: ", " ", ";\n\n -ms-overflow-style: -ms-autohiding-scrollbar;\n"])), SCROLLBAR_WIDTH, SCROLLBAR_TRACK_COLOR, SCROLLBAR_THUMB_COLOR, SCROLLBAR_THUMB_COLOR, SCROLLBAR_TRACK_COLOR);
|
|
288
|
-
var elementItemsWrapper = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n flex: 1;\n flex-flow: row wrap;\n align-items: flex-start;\n justify-content: flex-start;\n overflow: hidden;\n padding: ", "px; // For Focus outline\n\n .ReactVirtualized__Collection {\n ", ";\n border-radius: 3px; // Standard border-radius across other components like Search or Item.\n outline: none;\n\n :focus {\n box-shadow: 0 0 0 ", "px\n ", ";\n }\n }\n .ReactVirtualized__Collection__innerScrollContainer {\n div[class='element-item-wrapper']:last-child {\n padding-bottom: 4px;\n }\n }\n
|
|
289
|
-
var elementItemWrapper = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n
|
|
230
|
+
var elementItemsWrapper = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n flex: 1;\n flex-flow: row wrap;\n align-items: flex-start;\n justify-content: flex-start;\n overflow: hidden;\n padding: ", "px; // For Focus outline\n\n .ReactVirtualized__Collection {\n ", ";\n border-radius: 3px; // Standard border-radius across other components like Search or Item.\n outline: none;\n\n :focus {\n box-shadow: 0 0 0 ", "px\n ", ";\n }\n }\n .ReactVirtualized__Collection__innerScrollContainer {\n div[class='element-item-wrapper']:last-child {\n padding-bottom: 4px;\n }\n }\n"])), ELEMENT_LIST_PADDING, scrollbarStyle, ELEMENT_LIST_PADDING, token('color.border.focused', B100));
|
|
231
|
+
var elementItemWrapper = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n div {\n button {\n height: 75px;\n align-items: flex-start;\n padding: 12px 12px 11px;\n }\n }\n"])));
|
|
290
232
|
var itemBody = css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: row;\n flex-wrap: nowrap;\n justify-content: space-between;\n line-height: 1.4;\n width: 100%;\n\n margin-top: -2px; // Fixes the Item Icon and text's alignment issue\n"])));
|
|
291
233
|
/*
|
|
292
234
|
* -webkit-line-clamp is also supported by firefox 🎉
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
2
1
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
3
2
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
4
3
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
@@ -7,6 +6,7 @@ import _inherits from "@babel/runtime/helpers/inherits";
|
|
|
7
6
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
8
7
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
9
8
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
9
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
10
10
|
|
|
11
11
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
12
12
|
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
2
1
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
3
2
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
4
3
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
@@ -7,6 +6,7 @@ import _inherits from "@babel/runtime/helpers/inherits";
|
|
|
7
6
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
8
7
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
9
8
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
9
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
10
10
|
|
|
11
11
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
12
12
|
|
package/dist/esm/utils/action.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
2
1
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
2
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
3
3
|
import { Selection } from 'prosemirror-state';
|
|
4
4
|
import { pluginKey as extensionPluginKey } from '../plugins/extension/plugin-key';
|
|
5
5
|
import { forceAutoSave } from '../plugins/extension/commands';
|