@atlaskit/editor-core 169.0.0 → 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 +26 -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/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/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/feature-flags-context/feature-flags-from-props.js +4 -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/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/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/create-editor/create-plugins-list.js +8 -1
- package/dist/esm/plugins/analytics/types/toolbar-button.js +2 -0
- 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/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/feature-flags-context/feature-flags-from-props.js +4 -2
- 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/panel/toolbar.js +9 -2
- 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/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/ElementBrowser/InsertMenu.js +12 -35
- package/dist/esm/ui/ElementBrowser/components/ElementList/ElementList.js +31 -89
- package/dist/esm/utils/clipboard.js +55 -0
- 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 +19 -19
- package/report.api.md +5373 -1324
- 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
|
@@ -11,16 +11,12 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
11
11
|
|
|
12
12
|
var _adfSchema = require("@atlaskit/adf-schema");
|
|
13
13
|
|
|
14
|
-
var _ToolbarLists = _interopRequireDefault(require("./ui/ToolbarLists"));
|
|
15
|
-
|
|
16
14
|
var _main = require("./pm-plugins/main");
|
|
17
15
|
|
|
18
16
|
var _inputRules = _interopRequireDefault(require("./pm-plugins/input-rules"));
|
|
19
17
|
|
|
20
18
|
var _keymap = _interopRequireDefault(require("./pm-plugins/keymap"));
|
|
21
19
|
|
|
22
|
-
var _WithPluginState = _interopRequireDefault(require("../../ui/WithPluginState"));
|
|
23
|
-
|
|
24
20
|
var _messages = require("./messages");
|
|
25
21
|
|
|
26
22
|
var _analytics = require("../analytics");
|
|
@@ -29,8 +25,6 @@ var _keymaps = require("../../keymaps");
|
|
|
29
25
|
|
|
30
26
|
var _assets = require("../quick-insert/assets");
|
|
31
27
|
|
|
32
|
-
var _types = require("../../ui/Toolbar/types");
|
|
33
|
-
|
|
34
28
|
var listPlugin = function listPlugin() {
|
|
35
29
|
return {
|
|
36
30
|
name: 'list',
|
|
@@ -116,43 +110,6 @@ var listPlugin = function listPlugin() {
|
|
|
116
110
|
}
|
|
117
111
|
}];
|
|
118
112
|
}
|
|
119
|
-
},
|
|
120
|
-
primaryToolbarComponent: function primaryToolbarComponent(_ref4) {
|
|
121
|
-
var editorView = _ref4.editorView,
|
|
122
|
-
popupsMountPoint = _ref4.popupsMountPoint,
|
|
123
|
-
popupsBoundariesElement = _ref4.popupsBoundariesElement,
|
|
124
|
-
popupsScrollableElement = _ref4.popupsScrollableElement,
|
|
125
|
-
toolbarSize = _ref4.toolbarSize,
|
|
126
|
-
disabled = _ref4.disabled,
|
|
127
|
-
isToolbarReducedSpacing = _ref4.isToolbarReducedSpacing;
|
|
128
|
-
var isSmall = toolbarSize < _types.ToolbarSize.L;
|
|
129
|
-
return /*#__PURE__*/_react.default.createElement(_WithPluginState.default, {
|
|
130
|
-
plugins: {
|
|
131
|
-
listState: _main.pluginKey
|
|
132
|
-
},
|
|
133
|
-
render: function render(_ref5) {
|
|
134
|
-
var listState = _ref5.listState;
|
|
135
|
-
|
|
136
|
-
if (!listState) {
|
|
137
|
-
return null;
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
return /*#__PURE__*/_react.default.createElement(_ToolbarLists.default, {
|
|
141
|
-
isSmall: isSmall,
|
|
142
|
-
isSeparator: true,
|
|
143
|
-
isReducedSpacing: isToolbarReducedSpacing,
|
|
144
|
-
disabled: disabled,
|
|
145
|
-
editorView: editorView,
|
|
146
|
-
popupsMountPoint: popupsMountPoint,
|
|
147
|
-
popupsBoundariesElement: popupsBoundariesElement,
|
|
148
|
-
popupsScrollableElement: popupsScrollableElement,
|
|
149
|
-
bulletListActive: listState.bulletListActive,
|
|
150
|
-
bulletListDisabled: listState.bulletListDisabled,
|
|
151
|
-
orderedListActive: listState.orderedListActive,
|
|
152
|
-
orderedListDisabled: listState.orderedListDisabled
|
|
153
|
-
});
|
|
154
|
-
}
|
|
155
|
-
});
|
|
156
113
|
}
|
|
157
114
|
};
|
|
158
115
|
};
|
|
@@ -45,6 +45,8 @@ var _analytics = require("../analytics");
|
|
|
45
45
|
|
|
46
46
|
var _message = require("./message");
|
|
47
47
|
|
|
48
|
+
var _utils2 = require("../copy-button/utils");
|
|
49
|
+
|
|
48
50
|
var _panelIconMap;
|
|
49
51
|
|
|
50
52
|
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; }
|
|
@@ -72,7 +74,7 @@ var panelIconMap = (_panelIconMap = {}, (0, _defineProperty2.default)(_panelIcon
|
|
|
72
74
|
}), _panelIconMap);
|
|
73
75
|
exports.panelIconMap = panelIconMap;
|
|
74
76
|
|
|
75
|
-
var getToolbarItems = function getToolbarItems(formatMessage, panelNodeType, isCustomPanelEnabled, isCustomPanelEditable, providerFactory, activePanelType, activePanelColor, activePanelIcon) {
|
|
77
|
+
var getToolbarItems = function getToolbarItems(formatMessage, panelNodeType, isCustomPanelEnabled, isCustomPanelEditable, providerFactory, activePanelType, activePanelColor, activePanelIcon, state) {
|
|
76
78
|
// TODO: ED-14403 investigate why these titles are not getting translated for the tooltips
|
|
77
79
|
var items = [{
|
|
78
80
|
id: 'editor.panel.info',
|
|
@@ -271,6 +273,12 @@ var getToolbarItems = function getToolbarItems(formatMessage, panelNodeType, isC
|
|
|
271
273
|
}
|
|
272
274
|
}
|
|
273
275
|
|
|
276
|
+
if (state && (0, _utils2.showCopyButton)(state)) {
|
|
277
|
+
items.push({
|
|
278
|
+
type: 'separator'
|
|
279
|
+
}, (0, _utils2.getCopyButtonConfig)(state, formatMessage, panelNodeType));
|
|
280
|
+
}
|
|
281
|
+
|
|
274
282
|
items.push({
|
|
275
283
|
type: 'separator'
|
|
276
284
|
}, {
|
|
@@ -309,7 +317,7 @@ var getToolbarConfig = function getToolbarConfig(state, intl) {
|
|
|
309
317
|
}; // force toolbar to be turned on
|
|
310
318
|
|
|
311
319
|
|
|
312
|
-
var items = getToolbarItems(formatMessage, nodeType, options.allowCustomPanel || false, options.allowCustomPanel && options.allowCustomPanelEdit || false, providerFactory, panelType, options.allowCustomPanel ? panelColor : undefined, options.allowCustomPanel ? panelIcon || isStandardPanel(panelType) : undefined);
|
|
320
|
+
var items = getToolbarItems(formatMessage, nodeType, options.allowCustomPanel || false, options.allowCustomPanel && options.allowCustomPanelEdit || false, providerFactory, panelType, options.allowCustomPanel ? panelColor : undefined, options.allowCustomPanel ? panelIcon || isStandardPanel(panelType) : undefined, state);
|
|
313
321
|
|
|
314
322
|
var getDomRef = function getDomRef(editorView) {
|
|
315
323
|
var domAtPos = editorView.domAtPos.bind(editorView);
|
|
@@ -107,7 +107,7 @@ var hoverRows = function hoverRows(hoveredRows, isInDanger) {
|
|
|
107
107
|
|
|
108
108
|
exports.hoverRows = hoverRows;
|
|
109
109
|
|
|
110
|
-
var hoverTable = function hoverTable(isInDanger) {
|
|
110
|
+
var hoverTable = function hoverTable(isInDanger, isSelected) {
|
|
111
111
|
return (0, _pluginFactory.createCommand)(function (state) {
|
|
112
112
|
var table = (0, _utils.findTable)(state.selection);
|
|
113
113
|
|
|
@@ -125,7 +125,7 @@ var hoverTable = function hoverTable(isInDanger) {
|
|
|
125
125
|
return false;
|
|
126
126
|
}
|
|
127
127
|
|
|
128
|
-
var decorations = (0, _utils2.createControlsHoverDecoration)(cells, 'table', isInDanger);
|
|
128
|
+
var decorations = (0, _utils2.createControlsHoverDecoration)(cells, 'table', isInDanger, isSelected);
|
|
129
129
|
return {
|
|
130
130
|
type: 'HOVER_TABLE',
|
|
131
131
|
data: {
|
|
@@ -41,6 +41,8 @@ var _prosemirrorUtils = require("prosemirror-utils");
|
|
|
41
41
|
|
|
42
42
|
var _dom = require("../../utils/dom");
|
|
43
43
|
|
|
44
|
+
var _utils2 = require("../copy-button/utils");
|
|
45
|
+
|
|
44
46
|
// TODO: ED-14403 investigate why these translations don't work
|
|
45
47
|
var messages = (0, _reactIntlNext.defineMessages)({
|
|
46
48
|
tableOptions: {
|
|
@@ -277,7 +279,9 @@ var getToolbarConfig = function getToolbarConfig(config) {
|
|
|
277
279
|
items: [menu, separator(menu.hidden)].concat((0, _toConsumableArray2.default)(cellItems), [{
|
|
278
280
|
type: 'extensions-placeholder',
|
|
279
281
|
separator: 'end'
|
|
280
|
-
}, {
|
|
282
|
+
}], (0, _toConsumableArray2.default)(state && (0, _utils2.showCopyButton)(state) ? [(0, _utils2.getCopyButtonConfig)(state, intl.formatMessage, nodeType, (0, _commands.hoverTable)(false, true), (0, _commands.clearHoverSelection)()), {
|
|
283
|
+
type: 'separator'
|
|
284
|
+
}] : []), [{
|
|
281
285
|
id: 'editor.table.delete',
|
|
282
286
|
type: 'button',
|
|
283
287
|
appearance: 'danger',
|
|
@@ -45,7 +45,7 @@ var createCellHoverDecoration = function createCellHoverDecoration(cells, type)
|
|
|
45
45
|
|
|
46
46
|
exports.createCellHoverDecoration = createCellHoverDecoration;
|
|
47
47
|
|
|
48
|
-
var createControlsHoverDecoration = function createControlsHoverDecoration(cells, type, danger) {
|
|
48
|
+
var createControlsHoverDecoration = function createControlsHoverDecoration(cells, type, danger, selected) {
|
|
49
49
|
return cells.map(function (cell) {
|
|
50
50
|
var classes = [_types.TableCssClassName.HOVERED_CELL];
|
|
51
51
|
|
|
@@ -53,6 +53,10 @@ var createControlsHoverDecoration = function createControlsHoverDecoration(cells
|
|
|
53
53
|
classes.push(_types.TableCssClassName.HOVERED_CELL_IN_DANGER);
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
+
if (selected) {
|
|
57
|
+
classes.push(_types.TableCssClassName.SELECTED_CELL);
|
|
58
|
+
}
|
|
59
|
+
|
|
56
60
|
classes.push(type === 'column' ? _types.TableCssClassName.HOVERED_COLUMN : type === 'row' ? _types.TableCssClassName.HOVERED_ROW : _types.TableCssClassName.HOVERED_TABLE);
|
|
57
61
|
var key;
|
|
58
62
|
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
|
|
10
|
+
var _react = _interopRequireDefault(require("react"));
|
|
11
|
+
|
|
12
|
+
var _ui = _interopRequireDefault(require("./ui"));
|
|
13
|
+
|
|
14
|
+
var _WithPluginState = _interopRequireDefault(require("../../ui/WithPluginState"));
|
|
15
|
+
|
|
16
|
+
var _types = require("../../ui/Toolbar/types");
|
|
17
|
+
|
|
18
|
+
var _main = require("../list/pm-plugins/main");
|
|
19
|
+
|
|
20
|
+
var toolbarListsIndentationPlugin = function toolbarListsIndentationPlugin(_ref) {
|
|
21
|
+
var showIndentationButtons = _ref.showIndentationButtons;
|
|
22
|
+
return {
|
|
23
|
+
name: 'toolbarListsIndentation',
|
|
24
|
+
primaryToolbarComponent: function primaryToolbarComponent(_ref2) {
|
|
25
|
+
var editorView = _ref2.editorView,
|
|
26
|
+
popupsMountPoint = _ref2.popupsMountPoint,
|
|
27
|
+
popupsBoundariesElement = _ref2.popupsBoundariesElement,
|
|
28
|
+
popupsScrollableElement = _ref2.popupsScrollableElement,
|
|
29
|
+
toolbarSize = _ref2.toolbarSize,
|
|
30
|
+
disabled = _ref2.disabled,
|
|
31
|
+
isToolbarReducedSpacing = _ref2.isToolbarReducedSpacing;
|
|
32
|
+
var isSmall = toolbarSize < _types.ToolbarSize.L;
|
|
33
|
+
return /*#__PURE__*/_react.default.createElement(_WithPluginState.default, {
|
|
34
|
+
plugins: {
|
|
35
|
+
listState: _main.pluginKey
|
|
36
|
+
},
|
|
37
|
+
render: function render(_ref3) {
|
|
38
|
+
var listState = _ref3.listState;
|
|
39
|
+
|
|
40
|
+
if (!listState) {
|
|
41
|
+
return null;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
return /*#__PURE__*/_react.default.createElement(_ui.default, {
|
|
45
|
+
isSmall: isSmall,
|
|
46
|
+
isReducedSpacing: isToolbarReducedSpacing,
|
|
47
|
+
disabled: disabled,
|
|
48
|
+
editorView: editorView,
|
|
49
|
+
popupsMountPoint: popupsMountPoint,
|
|
50
|
+
popupsBoundariesElement: popupsBoundariesElement,
|
|
51
|
+
popupsScrollableElement: popupsScrollableElement,
|
|
52
|
+
bulletListActive: listState.bulletListActive,
|
|
53
|
+
bulletListDisabled: listState.bulletListDisabled,
|
|
54
|
+
orderedListActive: listState.orderedListActive,
|
|
55
|
+
orderedListDisabled: listState.orderedListDisabled,
|
|
56
|
+
showIndentationButtons: !!showIndentationButtons
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
var _default = toolbarListsIndentationPlugin;
|
|
65
|
+
exports.default = _default;
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
+
|
|
7
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8
|
+
value: true
|
|
9
|
+
});
|
|
10
|
+
exports.Toolbar = Toolbar;
|
|
11
|
+
|
|
12
|
+
var _react = require("@emotion/react");
|
|
13
|
+
|
|
14
|
+
var _reactIntlNext = require("react-intl-next");
|
|
15
|
+
|
|
16
|
+
var _bulletList = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/bullet-list"));
|
|
17
|
+
|
|
18
|
+
var _numberList = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/number-list"));
|
|
19
|
+
|
|
20
|
+
var _indent = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/indent"));
|
|
21
|
+
|
|
22
|
+
var _outdent = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/outdent"));
|
|
23
|
+
|
|
24
|
+
var _keymaps = require("../../../keymaps");
|
|
25
|
+
|
|
26
|
+
var _ToolbarButton = _interopRequireWildcard(require("../../../ui/ToolbarButton"));
|
|
27
|
+
|
|
28
|
+
var _messages = require("../../list/messages");
|
|
29
|
+
|
|
30
|
+
var _messages2 = require("../../indentation/messages");
|
|
31
|
+
|
|
32
|
+
var _styles = require("../../../ui/styles");
|
|
33
|
+
|
|
34
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
35
|
+
|
|
36
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
37
|
+
|
|
38
|
+
/** @jsx jsx */
|
|
39
|
+
function Toolbar(props) {
|
|
40
|
+
var _useIntl = (0, _reactIntlNext.useIntl)(),
|
|
41
|
+
formatMessage = _useIntl.formatMessage;
|
|
42
|
+
|
|
43
|
+
var disabled = props.disabled,
|
|
44
|
+
isReducedSpacing = props.isReducedSpacing,
|
|
45
|
+
bulletListActive = props.bulletListActive,
|
|
46
|
+
bulletListDisabled = props.bulletListDisabled,
|
|
47
|
+
orderedListActive = props.orderedListActive,
|
|
48
|
+
orderedListDisabled = props.orderedListDisabled,
|
|
49
|
+
showIndentationButtons = props.showIndentationButtons,
|
|
50
|
+
onItemActivated = props.onItemActivated;
|
|
51
|
+
var labelUnorderedList = formatMessage(_messages.messages.unorderedList);
|
|
52
|
+
var labelOrderedList = formatMessage(_messages.messages.orderedList);
|
|
53
|
+
|
|
54
|
+
var handleOnItemActivated = function handleOnItemActivated(buttonName) {
|
|
55
|
+
return function (event) {
|
|
56
|
+
return onItemActivated({
|
|
57
|
+
editorView: props.editorView,
|
|
58
|
+
buttonName: buttonName
|
|
59
|
+
});
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
return (0, _react.jsx)("span", {
|
|
64
|
+
css: _styles.buttonGroupStyle
|
|
65
|
+
}, (0, _react.jsx)(_ToolbarButton.default, {
|
|
66
|
+
buttonId: _ToolbarButton.TOOLBAR_BUTTON.BULLET_LIST,
|
|
67
|
+
spacing: isReducedSpacing ? 'none' : 'default',
|
|
68
|
+
onClick: handleOnItemActivated('bullet_list'),
|
|
69
|
+
selected: bulletListActive,
|
|
70
|
+
"aria-pressed": bulletListActive,
|
|
71
|
+
"aria-label": labelUnorderedList,
|
|
72
|
+
disabled: bulletListDisabled || disabled,
|
|
73
|
+
title: (0, _react.jsx)(_keymaps.ToolTipContent, {
|
|
74
|
+
description: labelUnorderedList,
|
|
75
|
+
keymap: _keymaps.toggleBulletList
|
|
76
|
+
}),
|
|
77
|
+
iconBefore: (0, _react.jsx)(_bulletList.default, {
|
|
78
|
+
label: ""
|
|
79
|
+
})
|
|
80
|
+
}), (0, _react.jsx)(_ToolbarButton.default, {
|
|
81
|
+
buttonId: _ToolbarButton.TOOLBAR_BUTTON.ORDERED_LIST,
|
|
82
|
+
spacing: isReducedSpacing ? 'none' : 'default',
|
|
83
|
+
onClick: handleOnItemActivated('ordered_list'),
|
|
84
|
+
selected: orderedListActive,
|
|
85
|
+
"aria-pressed": orderedListActive,
|
|
86
|
+
"aria-label": labelOrderedList,
|
|
87
|
+
disabled: orderedListDisabled || disabled,
|
|
88
|
+
title: (0, _react.jsx)(_keymaps.ToolTipContent, {
|
|
89
|
+
description: labelOrderedList,
|
|
90
|
+
keymap: _keymaps.toggleOrderedList
|
|
91
|
+
}),
|
|
92
|
+
iconBefore: (0, _react.jsx)(_numberList.default, {
|
|
93
|
+
label: ""
|
|
94
|
+
})
|
|
95
|
+
}), showIndentationButtons && (0, _react.jsx)(_ToolbarButton.default, {
|
|
96
|
+
buttonId: _ToolbarButton.TOOLBAR_BUTTON.INDENT,
|
|
97
|
+
spacing: isReducedSpacing ? 'none' : 'default',
|
|
98
|
+
onClick: handleOnItemActivated('indent'),
|
|
99
|
+
iconBefore: (0, _react.jsx)(_indent.default, {
|
|
100
|
+
label: ""
|
|
101
|
+
}),
|
|
102
|
+
disabled: true,
|
|
103
|
+
title: (0, _react.jsx)(_keymaps.ToolTipContent, {
|
|
104
|
+
description: formatMessage(_messages2.messages.indent),
|
|
105
|
+
keymap: _keymaps.indent
|
|
106
|
+
})
|
|
107
|
+
}), showIndentationButtons && (0, _react.jsx)(_ToolbarButton.default, {
|
|
108
|
+
buttonId: _ToolbarButton.TOOLBAR_BUTTON.OUTDENT,
|
|
109
|
+
spacing: isReducedSpacing ? 'none' : 'default',
|
|
110
|
+
onClick: handleOnItemActivated('outdent'),
|
|
111
|
+
iconBefore: (0, _react.jsx)(_outdent.default, {
|
|
112
|
+
label: ""
|
|
113
|
+
}),
|
|
114
|
+
disabled: true,
|
|
115
|
+
title: (0, _react.jsx)(_keymaps.ToolTipContent, {
|
|
116
|
+
description: formatMessage(_messages2.messages.outdent),
|
|
117
|
+
keymap: _keymaps.outdent
|
|
118
|
+
})
|
|
119
|
+
}), (0, _react.jsx)("span", {
|
|
120
|
+
css: _styles.separatorStyles
|
|
121
|
+
}));
|
|
122
|
+
}
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.ToolbarDropdown = ToolbarDropdown;
|
|
9
|
+
|
|
10
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
11
|
+
|
|
12
|
+
var _react = require("@emotion/react");
|
|
13
|
+
|
|
14
|
+
var _react2 = _interopRequireDefault(require("react"));
|
|
15
|
+
|
|
16
|
+
var _reactIntlNext = require("react-intl-next");
|
|
17
|
+
|
|
18
|
+
var _chevronDown = _interopRequireDefault(require("@atlaskit/icon/glyph/chevron-down"));
|
|
19
|
+
|
|
20
|
+
var _bulletList = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/bullet-list"));
|
|
21
|
+
|
|
22
|
+
var _keymaps = require("../../../keymaps");
|
|
23
|
+
|
|
24
|
+
var _DropdownMenu = _interopRequireDefault(require("../../../ui/DropdownMenu"));
|
|
25
|
+
|
|
26
|
+
var _ToolbarButton = _interopRequireDefault(require("../../../ui/ToolbarButton"));
|
|
27
|
+
|
|
28
|
+
var _styles = require("../../../ui/styles");
|
|
29
|
+
|
|
30
|
+
var _messages = require("../../list/messages");
|
|
31
|
+
|
|
32
|
+
var _messages2 = require("../../indentation/messages");
|
|
33
|
+
|
|
34
|
+
/** @jsx jsx */
|
|
35
|
+
function ToolbarDropdown(props) {
|
|
36
|
+
var _useIntl = (0, _reactIntlNext.useIntl)(),
|
|
37
|
+
formatMessage = _useIntl.formatMessage;
|
|
38
|
+
|
|
39
|
+
var disabled = props.disabled,
|
|
40
|
+
isReducedSpacing = props.isReducedSpacing,
|
|
41
|
+
bulletListActive = props.bulletListActive,
|
|
42
|
+
orderedListActive = props.orderedListActive,
|
|
43
|
+
popupsMountPoint = props.popupsMountPoint,
|
|
44
|
+
popupsBoundariesElement = props.popupsBoundariesElement,
|
|
45
|
+
popupsScrollableElement = props.popupsScrollableElement,
|
|
46
|
+
onItemActivated = props.onItemActivated;
|
|
47
|
+
|
|
48
|
+
var _React$useState = _react2.default.useState(false),
|
|
49
|
+
_React$useState2 = (0, _slicedToArray2.default)(_React$useState, 2),
|
|
50
|
+
isDropdownOpen = _React$useState2[0],
|
|
51
|
+
setIsDropdownOpen = _React$useState2[1];
|
|
52
|
+
|
|
53
|
+
var labelLists = formatMessage(_messages.messages.lists);
|
|
54
|
+
|
|
55
|
+
var onOpenChange = function onOpenChange(attrs) {
|
|
56
|
+
setIsDropdownOpen(attrs.isDropdownOpen);
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
var handleTriggerClick = function handleTriggerClick() {
|
|
60
|
+
onOpenChange({
|
|
61
|
+
isDropdownOpen: !isDropdownOpen
|
|
62
|
+
});
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
var items = useItems(props);
|
|
66
|
+
|
|
67
|
+
var handleOnItemActivated = function handleOnItemActivated(_ref) {
|
|
68
|
+
var item = _ref.item;
|
|
69
|
+
setIsDropdownOpen(false);
|
|
70
|
+
return onItemActivated({
|
|
71
|
+
editorView: props.editorView,
|
|
72
|
+
buttonName: item.value.name
|
|
73
|
+
});
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
return (0, _react.jsx)("span", {
|
|
77
|
+
css: _styles.wrapperStyle
|
|
78
|
+
}, (0, _react.jsx)(_DropdownMenu.default, {
|
|
79
|
+
items: items,
|
|
80
|
+
onItemActivated: handleOnItemActivated,
|
|
81
|
+
mountTo: popupsMountPoint,
|
|
82
|
+
boundariesElement: popupsBoundariesElement,
|
|
83
|
+
scrollableElement: popupsScrollableElement,
|
|
84
|
+
isOpen: isDropdownOpen,
|
|
85
|
+
onOpenChange: onOpenChange,
|
|
86
|
+
fitHeight: 188,
|
|
87
|
+
fitWidth: 175,
|
|
88
|
+
shouldUseDefaultRole: true
|
|
89
|
+
}, (0, _react.jsx)(_ToolbarButton.default, {
|
|
90
|
+
spacing: isReducedSpacing ? 'none' : 'default',
|
|
91
|
+
selected: bulletListActive || orderedListActive,
|
|
92
|
+
"aria-expanded": isDropdownOpen,
|
|
93
|
+
"aria-haspopup": true,
|
|
94
|
+
"aria-label": labelLists,
|
|
95
|
+
disabled: disabled,
|
|
96
|
+
onClick: handleTriggerClick,
|
|
97
|
+
title: labelLists,
|
|
98
|
+
iconBefore: (0, _react.jsx)("span", {
|
|
99
|
+
css: _styles.wrapperStyle
|
|
100
|
+
}, (0, _react.jsx)(_bulletList.default, {
|
|
101
|
+
label: labelLists
|
|
102
|
+
}), (0, _react.jsx)("span", {
|
|
103
|
+
css: _styles.expandIconWrapperStyle
|
|
104
|
+
}, (0, _react.jsx)(_chevronDown.default, {
|
|
105
|
+
label: ""
|
|
106
|
+
})))
|
|
107
|
+
})), (0, _react.jsx)("span", {
|
|
108
|
+
css: _styles.separatorStyles
|
|
109
|
+
}));
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
function useItems(props) {
|
|
113
|
+
var _useIntl2 = (0, _reactIntlNext.useIntl)(),
|
|
114
|
+
formatMessage = _useIntl2.formatMessage;
|
|
115
|
+
|
|
116
|
+
var labelUnorderedList = formatMessage(_messages.messages.unorderedList);
|
|
117
|
+
var labelOrderedList = formatMessage(_messages.messages.orderedList);
|
|
118
|
+
var items = [{
|
|
119
|
+
key: 'unorderedList',
|
|
120
|
+
content: labelUnorderedList,
|
|
121
|
+
value: {
|
|
122
|
+
name: 'bullet_list'
|
|
123
|
+
},
|
|
124
|
+
isDisabled: props.bulletListDisabled,
|
|
125
|
+
isActive: Boolean(props.bulletListActive),
|
|
126
|
+
elemAfter: (0, _react.jsx)("div", {
|
|
127
|
+
css: _styles.shortcutStyle
|
|
128
|
+
}, (0, _keymaps.tooltip)(_keymaps.toggleBulletList))
|
|
129
|
+
}, {
|
|
130
|
+
key: 'orderedList',
|
|
131
|
+
content: labelOrderedList,
|
|
132
|
+
value: {
|
|
133
|
+
name: 'ordered_list'
|
|
134
|
+
},
|
|
135
|
+
isDisabled: props.orderedListDisabled,
|
|
136
|
+
isActive: Boolean(props.orderedListActive),
|
|
137
|
+
elemAfter: (0, _react.jsx)("div", {
|
|
138
|
+
css: _styles.shortcutStyle
|
|
139
|
+
}, (0, _keymaps.tooltip)(_keymaps.toggleOrderedList))
|
|
140
|
+
}];
|
|
141
|
+
|
|
142
|
+
if (props.showIndentationButtons) {
|
|
143
|
+
var labelIndent = formatMessage(_messages2.messages.indent);
|
|
144
|
+
var labelOutdent = formatMessage(_messages2.messages.outdent);
|
|
145
|
+
items.push({
|
|
146
|
+
key: 'indent',
|
|
147
|
+
content: labelIndent,
|
|
148
|
+
value: {
|
|
149
|
+
name: 'indent'
|
|
150
|
+
},
|
|
151
|
+
isDisabled: true,
|
|
152
|
+
isActive: false,
|
|
153
|
+
elemAfter: (0, _react.jsx)("div", {
|
|
154
|
+
css: _styles.shortcutStyle
|
|
155
|
+
}, (0, _keymaps.tooltip)(_keymaps.indent))
|
|
156
|
+
}, {
|
|
157
|
+
key: 'outdent',
|
|
158
|
+
content: labelOutdent,
|
|
159
|
+
value: {
|
|
160
|
+
name: 'outdent'
|
|
161
|
+
},
|
|
162
|
+
isDisabled: true,
|
|
163
|
+
isActive: false,
|
|
164
|
+
elemAfter: (0, _react.jsx)("div", {
|
|
165
|
+
css: _styles.shortcutStyle
|
|
166
|
+
}, (0, _keymaps.tooltip)(_keymaps.outdent))
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
return [{
|
|
171
|
+
items: items
|
|
172
|
+
}];
|
|
173
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = ToolbarListsIndentation;
|
|
7
|
+
|
|
8
|
+
var _react = require("@emotion/react");
|
|
9
|
+
|
|
10
|
+
var _onItemActivated = require("./onItemActivated");
|
|
11
|
+
|
|
12
|
+
var _ToolbarDropdown = require("./ToolbarDropdown");
|
|
13
|
+
|
|
14
|
+
var _Toolbar = require("./Toolbar");
|
|
15
|
+
|
|
16
|
+
/** @jsx jsx */
|
|
17
|
+
function ToolbarListsIndentation(props) {
|
|
18
|
+
var disabled = props.disabled,
|
|
19
|
+
isSmall = props.isSmall,
|
|
20
|
+
isReducedSpacing = props.isReducedSpacing,
|
|
21
|
+
bulletListActive = props.bulletListActive,
|
|
22
|
+
bulletListDisabled = props.bulletListDisabled,
|
|
23
|
+
orderedListActive = props.orderedListActive,
|
|
24
|
+
orderedListDisabled = props.orderedListDisabled,
|
|
25
|
+
showIndentationButtons = props.showIndentationButtons,
|
|
26
|
+
popupsMountPoint = props.popupsMountPoint,
|
|
27
|
+
popupsBoundariesElement = props.popupsBoundariesElement,
|
|
28
|
+
popupsScrollableElement = props.popupsScrollableElement;
|
|
29
|
+
|
|
30
|
+
if (isSmall) {
|
|
31
|
+
return (0, _react.jsx)(_ToolbarDropdown.ToolbarDropdown, {
|
|
32
|
+
editorView: props.editorView,
|
|
33
|
+
isReducedSpacing: isReducedSpacing,
|
|
34
|
+
popupsMountPoint: popupsMountPoint,
|
|
35
|
+
popupsBoundariesElement: popupsBoundariesElement,
|
|
36
|
+
popupsScrollableElement: popupsScrollableElement,
|
|
37
|
+
bulletListActive: bulletListActive,
|
|
38
|
+
bulletListDisabled: bulletListDisabled,
|
|
39
|
+
showIndentationButtons: showIndentationButtons,
|
|
40
|
+
orderedListActive: orderedListActive,
|
|
41
|
+
orderedListDisabled: orderedListDisabled,
|
|
42
|
+
disabled: disabled,
|
|
43
|
+
onItemActivated: _onItemActivated.onItemActivated
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
return (0, _react.jsx)(_Toolbar.Toolbar, {
|
|
48
|
+
editorView: props.editorView,
|
|
49
|
+
isReducedSpacing: isReducedSpacing,
|
|
50
|
+
bulletListActive: bulletListActive,
|
|
51
|
+
bulletListDisabled: bulletListDisabled,
|
|
52
|
+
showIndentationButtons: showIndentationButtons,
|
|
53
|
+
orderedListActive: orderedListActive,
|
|
54
|
+
orderedListDisabled: orderedListDisabled,
|
|
55
|
+
disabled: disabled,
|
|
56
|
+
onItemActivated: _onItemActivated.onItemActivated
|
|
57
|
+
});
|
|
58
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.onItemActivated = onItemActivated;
|
|
7
|
+
|
|
8
|
+
var _commands = require("../../list/commands");
|
|
9
|
+
|
|
10
|
+
var _analytics = require("../../analytics");
|
|
11
|
+
|
|
12
|
+
function onItemActivated(_ref) {
|
|
13
|
+
var buttonName = _ref.buttonName,
|
|
14
|
+
editorView = _ref.editorView;
|
|
15
|
+
|
|
16
|
+
switch (buttonName) {
|
|
17
|
+
case 'bullet_list':
|
|
18
|
+
(0, _commands.toggleBulletList)(editorView, _analytics.INPUT_METHOD.TOOLBAR);
|
|
19
|
+
break;
|
|
20
|
+
|
|
21
|
+
case 'ordered_list':
|
|
22
|
+
(0, _commands.toggleOrderedList)(editorView, _analytics.INPUT_METHOD.TOOLBAR);
|
|
23
|
+
break;
|
|
24
|
+
|
|
25
|
+
case 'indent':
|
|
26
|
+
editorView.someProp('handleKeyDown', function (handleKeyDown) {
|
|
27
|
+
return handleKeyDown(editorView, new KeyboardEvent('keydown', {
|
|
28
|
+
bubbles: true,
|
|
29
|
+
cancelable: true,
|
|
30
|
+
key: 'Tab',
|
|
31
|
+
code: 'Tab'
|
|
32
|
+
}));
|
|
33
|
+
});
|
|
34
|
+
break;
|
|
35
|
+
|
|
36
|
+
case 'outdent':
|
|
37
|
+
editorView.someProp('handleKeyDown', function (handleKeyDown) {
|
|
38
|
+
return handleKeyDown(editorView, new KeyboardEvent('keydown', {
|
|
39
|
+
bubbles: true,
|
|
40
|
+
cancelable: true,
|
|
41
|
+
shiftKey: true,
|
|
42
|
+
key: 'Tab',
|
|
43
|
+
code: 'Tab'
|
|
44
|
+
}));
|
|
45
|
+
});
|
|
46
|
+
break;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
@@ -15,7 +15,7 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
15
15
|
|
|
16
16
|
var _react2 = require("@emotion/react");
|
|
17
17
|
|
|
18
|
-
var
|
|
18
|
+
var _menu = require("@atlaskit/menu");
|
|
19
19
|
|
|
20
20
|
var _TypeAheadListItem = require("./TypeAheadListItem");
|
|
21
21
|
|
|
@@ -128,12 +128,11 @@ var TypeAheadListComponent = /*#__PURE__*/_react.default.memo(function (_ref) {
|
|
|
128
128
|
|
|
129
129
|
var estimatedHeight = items.length * LIST_ITEM_ESTIMATED_HEIGHT;
|
|
130
130
|
var height = Math.min(typeof renderedListHeight === 'number' ? renderedListHeight : estimatedHeight, fitHeight);
|
|
131
|
-
return (0, _react2.jsx)(
|
|
131
|
+
return (0, _react2.jsx)(_menu.MenuGroup, {
|
|
132
132
|
role: "listbox",
|
|
133
133
|
"aria-live": "polite",
|
|
134
134
|
"aria-label": intl.formatMessage(_messages.typeAheadListMessages.typeAheadResultLabel),
|
|
135
|
-
"aria-relevant": "additions removals"
|
|
136
|
-
theme: _TypeAheadListItem.itemTheme
|
|
135
|
+
"aria-relevant": "additions removals"
|
|
137
136
|
}, (0, _react2.jsx)(_useResizeObserver.ResizeObserverProvider, null, (0, _react2.jsx)(_DynamicHeightListItem.UpdateListItemHeightContext.Provider, {
|
|
138
137
|
value: setListItemHeight
|
|
139
138
|
}, (0, _react2.jsx)(_DynamicHeightListItem.ListItemActionsContext.Provider, {
|
|
@@ -152,7 +151,7 @@ var TypeAheadListComponent = /*#__PURE__*/_react.default.memo(function (_ref) {
|
|
|
152
151
|
width: LIST_WIDTH,
|
|
153
152
|
height: height,
|
|
154
153
|
overscanCount: 3,
|
|
155
|
-
css: (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n
|
|
154
|
+
css: (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n button {\n padding: 12px 12px 11px;\n\n span:last-child span:last-child {\n white-space: normal;\n }\n }\n "])))
|
|
156
155
|
}, _DynamicHeightListItem.DynamicHeightListItem))))));
|
|
157
156
|
});
|
|
158
157
|
|