@atlaskit/editor-plugin-toolbar-lists-indentation 0.2.2 → 0.2.3
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 +6 -0
- package/dist/cjs/ui/Toolbar.js +17 -15
- package/dist/cjs/ui/ToolbarDropdown.js +15 -17
- package/dist/cjs/ui/index.js +5 -2
- package/dist/es2019/ui/Toolbar.js +16 -15
- package/dist/es2019/ui/ToolbarDropdown.js +14 -17
- package/dist/es2019/ui/index.js +4 -2
- package/dist/esm/ui/Toolbar.js +16 -15
- package/dist/esm/ui/ToolbarDropdown.js +14 -17
- package/dist/esm/ui/index.js +4 -2
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-toolbar-lists-indentation
|
|
2
2
|
|
|
3
|
+
## 0.2.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#59147](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/59147) [`f12e489f23b0`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/f12e489f23b0) - Re-build and deploy packages to NPM to resolve React/Compiled not found error (HOT-106483).
|
|
8
|
+
|
|
3
9
|
## 0.2.2
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
package/dist/cjs/ui/Toolbar.js
CHANGED
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.Toolbar = Toolbar;
|
|
8
8
|
var _react = require("react");
|
|
9
|
+
var _react2 = require("@emotion/react");
|
|
9
10
|
var _reactIntlNext = require("react-intl-next");
|
|
10
11
|
var _keymaps = require("@atlaskit/editor-common/keymaps");
|
|
11
12
|
var _messages = require("@atlaskit/editor-common/messages");
|
|
@@ -15,6 +16,8 @@ var _bulletList = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/bu
|
|
|
15
16
|
var _indent = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/indent"));
|
|
16
17
|
var _numberList = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/number-list"));
|
|
17
18
|
var _outdent = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/outdent"));
|
|
19
|
+
/** @jsx jsx */
|
|
20
|
+
|
|
18
21
|
function Toolbar(props) {
|
|
19
22
|
var _useIntl = (0, _reactIntlNext.useIntl)(),
|
|
20
23
|
formatMessage = _useIntl.formatMessage;
|
|
@@ -55,11 +58,10 @@ function Toolbar(props) {
|
|
|
55
58
|
}
|
|
56
59
|
}, [outdentButtonRef, outdentDisabled, isOutdentButtonFocused]);
|
|
57
60
|
return (
|
|
58
|
-
/*#__PURE__*/
|
|
59
61
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
60
|
-
|
|
62
|
+
(0, _react2.jsx)("span", {
|
|
61
63
|
css: _styles.buttonGroupStyle
|
|
62
|
-
},
|
|
64
|
+
}, (0, _react2.jsx)(_uiMenu.ToolbarButton, {
|
|
63
65
|
buttonId: _uiMenu.TOOLBAR_BUTTON.BULLET_LIST,
|
|
64
66
|
testId: labelUnorderedList,
|
|
65
67
|
spacing: isReducedSpacing ? 'none' : 'default',
|
|
@@ -69,14 +71,14 @@ function Toolbar(props) {
|
|
|
69
71
|
"aria-label": (0, _keymaps.tooltip)(_keymaps.toggleBulletList, labelUnorderedList),
|
|
70
72
|
"aria-keyshortcuts": (0, _keymaps.getAriaKeyshortcuts)(_keymaps.toggleBulletList),
|
|
71
73
|
disabled: bulletListDisabled || disabled,
|
|
72
|
-
title:
|
|
74
|
+
title: (0, _react2.jsx)(_keymaps.ToolTipContent, {
|
|
73
75
|
description: labelUnorderedList,
|
|
74
76
|
keymap: _keymaps.toggleBulletList
|
|
75
77
|
}),
|
|
76
|
-
iconBefore:
|
|
78
|
+
iconBefore: (0, _react2.jsx)(_bulletList.default, {
|
|
77
79
|
label: ""
|
|
78
80
|
})
|
|
79
|
-
}),
|
|
81
|
+
}), (0, _react2.jsx)(_uiMenu.ToolbarButton, {
|
|
80
82
|
buttonId: _uiMenu.TOOLBAR_BUTTON.ORDERED_LIST,
|
|
81
83
|
testId: labelOrderedList,
|
|
82
84
|
spacing: isReducedSpacing ? 'none' : 'default',
|
|
@@ -86,46 +88,46 @@ function Toolbar(props) {
|
|
|
86
88
|
"aria-label": (0, _keymaps.tooltip)(_keymaps.toggleOrderedList, labelOrderedList),
|
|
87
89
|
"aria-keyshortcuts": (0, _keymaps.getAriaKeyshortcuts)(_keymaps.toggleOrderedList),
|
|
88
90
|
disabled: orderedListDisabled || disabled,
|
|
89
|
-
title:
|
|
91
|
+
title: (0, _react2.jsx)(_keymaps.ToolTipContent, {
|
|
90
92
|
description: labelOrderedList,
|
|
91
93
|
keymap: _keymaps.toggleOrderedList
|
|
92
94
|
}),
|
|
93
|
-
iconBefore:
|
|
95
|
+
iconBefore: (0, _react2.jsx)(_numberList.default, {
|
|
94
96
|
label: ""
|
|
95
97
|
})
|
|
96
|
-
}), showIndentationButtons &&
|
|
98
|
+
}), showIndentationButtons && (0, _react2.jsx)(_uiMenu.ToolbarButton, {
|
|
97
99
|
buttonId: _uiMenu.TOOLBAR_BUTTON.OUTDENT,
|
|
98
100
|
testId: _uiMenu.TOOLBAR_BUTTON.OUTDENT,
|
|
99
101
|
ref: outdentButtonRef,
|
|
100
102
|
spacing: isReducedSpacing ? 'none' : 'default',
|
|
101
103
|
onClick: handleOnItemActivated('outdent'),
|
|
102
|
-
iconBefore:
|
|
104
|
+
iconBefore: (0, _react2.jsx)(_outdent.default, {
|
|
103
105
|
label: ""
|
|
104
106
|
}),
|
|
105
107
|
disabled: outdentDisabled || disabled,
|
|
106
108
|
"aria-label": (0, _keymaps.tooltip)(_keymaps.outdent, outdentMessage),
|
|
107
109
|
"aria-keyshortcuts": (0, _keymaps.getAriaKeyshortcuts)(_keymaps.outdent),
|
|
108
|
-
title:
|
|
110
|
+
title: (0, _react2.jsx)(_keymaps.ToolTipContent, {
|
|
109
111
|
description: outdentMessage,
|
|
110
112
|
keymap: _keymaps.outdent
|
|
111
113
|
})
|
|
112
|
-
}), showIndentationButtons &&
|
|
114
|
+
}), showIndentationButtons && (0, _react2.jsx)(_uiMenu.ToolbarButton, {
|
|
113
115
|
buttonId: _uiMenu.TOOLBAR_BUTTON.INDENT,
|
|
114
116
|
testId: _uiMenu.TOOLBAR_BUTTON.INDENT,
|
|
115
117
|
ref: indentButtonRef,
|
|
116
118
|
spacing: isReducedSpacing ? 'none' : 'default',
|
|
117
119
|
onClick: handleOnItemActivated('indent'),
|
|
118
|
-
iconBefore:
|
|
120
|
+
iconBefore: (0, _react2.jsx)(_indent.default, {
|
|
119
121
|
label: ""
|
|
120
122
|
}),
|
|
121
123
|
disabled: indentDisabled || disabled,
|
|
122
124
|
"aria-label": (0, _keymaps.tooltip)(_keymaps.indent, indentMessage),
|
|
123
125
|
"aria-keyshortcuts": (0, _keymaps.getAriaKeyshortcuts)(_keymaps.indent),
|
|
124
|
-
title:
|
|
126
|
+
title: (0, _react2.jsx)(_keymaps.ToolTipContent, {
|
|
125
127
|
description: indentMessage,
|
|
126
128
|
keymap: _keymaps.indent
|
|
127
129
|
})
|
|
128
|
-
}),
|
|
130
|
+
}), (0, _react2.jsx)("span", {
|
|
129
131
|
css: _styles.separatorStyles
|
|
130
132
|
}))
|
|
131
133
|
);
|
|
@@ -7,6 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.ToolbarDropdown = ToolbarDropdown;
|
|
8
8
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
9
9
|
var _react = _interopRequireDefault(require("react"));
|
|
10
|
+
var _react2 = require("@emotion/react");
|
|
10
11
|
var _reactIntlNext = require("react-intl-next");
|
|
11
12
|
var _keymaps = require("@atlaskit/editor-common/keymaps");
|
|
12
13
|
var _messages = require("@atlaskit/editor-common/messages");
|
|
@@ -15,6 +16,8 @@ var _uiMenu = require("@atlaskit/editor-common/ui-menu");
|
|
|
15
16
|
var _shortcut = require("@atlaskit/editor-shared-styles/shortcut");
|
|
16
17
|
var _chevronDown = _interopRequireDefault(require("@atlaskit/icon/glyph/chevron-down"));
|
|
17
18
|
var _bulletList = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/bullet-list"));
|
|
19
|
+
/** @jsx jsx */
|
|
20
|
+
|
|
18
21
|
function ToolbarDropdown(props) {
|
|
19
22
|
var _useIntl = (0, _reactIntlNext.useIntl)(),
|
|
20
23
|
formatMessage = _useIntl.formatMessage;
|
|
@@ -62,11 +65,10 @@ function ToolbarDropdown(props) {
|
|
|
62
65
|
});
|
|
63
66
|
};
|
|
64
67
|
return (
|
|
65
|
-
/*#__PURE__*/
|
|
66
68
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
67
|
-
|
|
69
|
+
(0, _react2.jsx)("span", {
|
|
68
70
|
css: _styles.wrapperStyle
|
|
69
|
-
},
|
|
71
|
+
}, (0, _react2.jsx)(_uiMenu.DropdownMenuWithKeyboardNavigation, {
|
|
70
72
|
items: items,
|
|
71
73
|
onItemActivated: handleOnItemActivated,
|
|
72
74
|
mountTo: popupsMountPoint,
|
|
@@ -83,7 +85,7 @@ function ToolbarDropdown(props) {
|
|
|
83
85
|
}
|
|
84
86
|
return isOpenedByKeyboard;
|
|
85
87
|
}
|
|
86
|
-
},
|
|
88
|
+
}, (0, _react2.jsx)(_uiMenu.ToolbarButton, {
|
|
87
89
|
spacing: isReducedSpacing ? 'none' : 'default',
|
|
88
90
|
selected: bulletListActive || orderedListActive,
|
|
89
91
|
"aria-expanded": isDropdownOpen,
|
|
@@ -94,18 +96,17 @@ function ToolbarDropdown(props) {
|
|
|
94
96
|
onKeyDown: handleOnKeyDown,
|
|
95
97
|
title: labelLists,
|
|
96
98
|
iconBefore:
|
|
97
|
-
/*#__PURE__*/
|
|
98
99
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
99
|
-
|
|
100
|
+
(0, _react2.jsx)("span", {
|
|
100
101
|
css: _styles.wrapperStyle
|
|
101
|
-
},
|
|
102
|
+
}, (0, _react2.jsx)(_bulletList.default, {
|
|
102
103
|
label: labelLists
|
|
103
|
-
}),
|
|
104
|
+
}), (0, _react2.jsx)("span", {
|
|
104
105
|
css: _styles.expandIconWrapperStyle
|
|
105
|
-
},
|
|
106
|
+
}, (0, _react2.jsx)(_chevronDown.default, {
|
|
106
107
|
label: ""
|
|
107
108
|
})))
|
|
108
|
-
})),
|
|
109
|
+
})), (0, _react2.jsx)("span", {
|
|
109
110
|
css: _styles.separatorStyles
|
|
110
111
|
}))
|
|
111
112
|
);
|
|
@@ -124,9 +125,8 @@ function useItems(props) {
|
|
|
124
125
|
isDisabled: props.bulletListDisabled,
|
|
125
126
|
isActive: Boolean(props.bulletListActive),
|
|
126
127
|
elemAfter:
|
|
127
|
-
/*#__PURE__*/
|
|
128
128
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
129
|
-
|
|
129
|
+
(0, _react2.jsx)("div", {
|
|
130
130
|
css: _shortcut.shortcutStyle
|
|
131
131
|
}, (0, _keymaps.tooltip)(_keymaps.toggleBulletList))
|
|
132
132
|
}, {
|
|
@@ -138,9 +138,8 @@ function useItems(props) {
|
|
|
138
138
|
isDisabled: props.orderedListDisabled,
|
|
139
139
|
isActive: Boolean(props.orderedListActive),
|
|
140
140
|
elemAfter:
|
|
141
|
-
/*#__PURE__*/
|
|
142
141
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
143
|
-
|
|
142
|
+
(0, _react2.jsx)("div", {
|
|
144
143
|
css: _shortcut.shortcutStyle
|
|
145
144
|
}, (0, _keymaps.tooltip)(_keymaps.toggleOrderedList))
|
|
146
145
|
}];
|
|
@@ -156,9 +155,8 @@ function useItems(props) {
|
|
|
156
155
|
isDisabled: props.outdentDisabled,
|
|
157
156
|
isActive: false,
|
|
158
157
|
elemAfter:
|
|
159
|
-
/*#__PURE__*/
|
|
160
158
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
161
|
-
|
|
159
|
+
(0, _react2.jsx)("div", {
|
|
162
160
|
css: _shortcut.shortcutStyle
|
|
163
161
|
}, (0, _keymaps.tooltip)(_keymaps.outdent))
|
|
164
162
|
}, {
|
|
@@ -170,7 +168,7 @@ function useItems(props) {
|
|
|
170
168
|
isDisabled: props.indentDisabled,
|
|
171
169
|
isActive: false,
|
|
172
170
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
173
|
-
elemAfter:
|
|
171
|
+
elemAfter: (0, _react2.jsx)("div", {
|
|
174
172
|
css: _shortcut.shortcutStyle
|
|
175
173
|
}, (0, _keymaps.tooltip)(_keymaps.indent))
|
|
176
174
|
});
|
package/dist/cjs/ui/index.js
CHANGED
|
@@ -4,9 +4,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = ToolbarListsIndentation;
|
|
7
|
+
var _react = require("@emotion/react");
|
|
7
8
|
var _onItemActivated = require("./onItemActivated");
|
|
8
9
|
var _Toolbar = require("./Toolbar");
|
|
9
10
|
var _ToolbarDropdown = require("./ToolbarDropdown");
|
|
11
|
+
/** @jsx jsx */
|
|
12
|
+
|
|
10
13
|
function ToolbarListsIndentation(props) {
|
|
11
14
|
var disabled = props.disabled,
|
|
12
15
|
isSmall = props.isSmall,
|
|
@@ -25,7 +28,7 @@ function ToolbarListsIndentation(props) {
|
|
|
25
28
|
featureFlags = props.featureFlags,
|
|
26
29
|
pluginInjectionApi = props.pluginInjectionApi;
|
|
27
30
|
if (isSmall) {
|
|
28
|
-
return
|
|
31
|
+
return (0, _react.jsx)(_ToolbarDropdown.ToolbarDropdown, {
|
|
29
32
|
editorView: props.editorView,
|
|
30
33
|
isReducedSpacing: isReducedSpacing,
|
|
31
34
|
popupsMountPoint: popupsMountPoint,
|
|
@@ -43,7 +46,7 @@ function ToolbarListsIndentation(props) {
|
|
|
43
46
|
featureFlags: featureFlags
|
|
44
47
|
});
|
|
45
48
|
}
|
|
46
|
-
return
|
|
49
|
+
return (0, _react.jsx)(_Toolbar.Toolbar, {
|
|
47
50
|
editorView: props.editorView,
|
|
48
51
|
isReducedSpacing: isReducedSpacing,
|
|
49
52
|
bulletListActive: bulletListActive,
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
1
2
|
import { useEffect, useRef } from 'react';
|
|
3
|
+
import { jsx } from '@emotion/react';
|
|
2
4
|
import { useIntl } from 'react-intl-next';
|
|
3
5
|
import { getAriaKeyshortcuts, toggleBulletList as toggleBulletListKeymap, indent as toggleIndentKeymap, toggleOrderedList as toggleOrderedListKeymap, outdent as toggleOutdentKeymap, tooltip, ToolTipContent } from '@atlaskit/editor-common/keymaps';
|
|
4
6
|
import { indentationMessages, listMessages as messages } from '@atlaskit/editor-common/messages';
|
|
@@ -47,11 +49,10 @@ export function Toolbar(props) {
|
|
|
47
49
|
}
|
|
48
50
|
}, [outdentButtonRef, outdentDisabled, isOutdentButtonFocused]);
|
|
49
51
|
return (
|
|
50
|
-
/*#__PURE__*/
|
|
51
52
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
52
|
-
|
|
53
|
+
jsx("span", {
|
|
53
54
|
css: buttonGroupStyle
|
|
54
|
-
},
|
|
55
|
+
}, jsx(ToolbarButton, {
|
|
55
56
|
buttonId: TOOLBAR_BUTTON.BULLET_LIST,
|
|
56
57
|
testId: labelUnorderedList,
|
|
57
58
|
spacing: isReducedSpacing ? 'none' : 'default',
|
|
@@ -61,14 +62,14 @@ export function Toolbar(props) {
|
|
|
61
62
|
"aria-label": tooltip(toggleBulletListKeymap, labelUnorderedList),
|
|
62
63
|
"aria-keyshortcuts": getAriaKeyshortcuts(toggleBulletListKeymap),
|
|
63
64
|
disabled: bulletListDisabled || disabled,
|
|
64
|
-
title:
|
|
65
|
+
title: jsx(ToolTipContent, {
|
|
65
66
|
description: labelUnorderedList,
|
|
66
67
|
keymap: toggleBulletListKeymap
|
|
67
68
|
}),
|
|
68
|
-
iconBefore:
|
|
69
|
+
iconBefore: jsx(BulletListIcon, {
|
|
69
70
|
label: ""
|
|
70
71
|
})
|
|
71
|
-
}),
|
|
72
|
+
}), jsx(ToolbarButton, {
|
|
72
73
|
buttonId: TOOLBAR_BUTTON.ORDERED_LIST,
|
|
73
74
|
testId: labelOrderedList,
|
|
74
75
|
spacing: isReducedSpacing ? 'none' : 'default',
|
|
@@ -78,46 +79,46 @@ export function Toolbar(props) {
|
|
|
78
79
|
"aria-label": tooltip(toggleOrderedListKeymap, labelOrderedList),
|
|
79
80
|
"aria-keyshortcuts": getAriaKeyshortcuts(toggleOrderedListKeymap),
|
|
80
81
|
disabled: orderedListDisabled || disabled,
|
|
81
|
-
title:
|
|
82
|
+
title: jsx(ToolTipContent, {
|
|
82
83
|
description: labelOrderedList,
|
|
83
84
|
keymap: toggleOrderedListKeymap
|
|
84
85
|
}),
|
|
85
|
-
iconBefore:
|
|
86
|
+
iconBefore: jsx(NumberListIcon, {
|
|
86
87
|
label: ""
|
|
87
88
|
})
|
|
88
|
-
}), showIndentationButtons &&
|
|
89
|
+
}), showIndentationButtons && jsx(ToolbarButton, {
|
|
89
90
|
buttonId: TOOLBAR_BUTTON.OUTDENT,
|
|
90
91
|
testId: TOOLBAR_BUTTON.OUTDENT,
|
|
91
92
|
ref: outdentButtonRef,
|
|
92
93
|
spacing: isReducedSpacing ? 'none' : 'default',
|
|
93
94
|
onClick: handleOnItemActivated('outdent'),
|
|
94
|
-
iconBefore:
|
|
95
|
+
iconBefore: jsx(OutdentIcon, {
|
|
95
96
|
label: ""
|
|
96
97
|
}),
|
|
97
98
|
disabled: outdentDisabled || disabled,
|
|
98
99
|
"aria-label": tooltip(toggleOutdentKeymap, outdentMessage),
|
|
99
100
|
"aria-keyshortcuts": getAriaKeyshortcuts(toggleOutdentKeymap),
|
|
100
|
-
title:
|
|
101
|
+
title: jsx(ToolTipContent, {
|
|
101
102
|
description: outdentMessage,
|
|
102
103
|
keymap: toggleOutdentKeymap
|
|
103
104
|
})
|
|
104
|
-
}), showIndentationButtons &&
|
|
105
|
+
}), showIndentationButtons && jsx(ToolbarButton, {
|
|
105
106
|
buttonId: TOOLBAR_BUTTON.INDENT,
|
|
106
107
|
testId: TOOLBAR_BUTTON.INDENT,
|
|
107
108
|
ref: indentButtonRef,
|
|
108
109
|
spacing: isReducedSpacing ? 'none' : 'default',
|
|
109
110
|
onClick: handleOnItemActivated('indent'),
|
|
110
|
-
iconBefore:
|
|
111
|
+
iconBefore: jsx(IndentIcon, {
|
|
111
112
|
label: ""
|
|
112
113
|
}),
|
|
113
114
|
disabled: indentDisabled || disabled,
|
|
114
115
|
"aria-label": tooltip(toggleIndentKeymap, indentMessage),
|
|
115
116
|
"aria-keyshortcuts": getAriaKeyshortcuts(toggleIndentKeymap),
|
|
116
|
-
title:
|
|
117
|
+
title: jsx(ToolTipContent, {
|
|
117
118
|
description: indentMessage,
|
|
118
119
|
keymap: toggleIndentKeymap
|
|
119
120
|
})
|
|
120
|
-
}),
|
|
121
|
+
}), jsx("span", {
|
|
121
122
|
css: separatorStyles
|
|
122
123
|
}))
|
|
123
124
|
);
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
1
2
|
import React from 'react';
|
|
3
|
+
import { jsx } from '@emotion/react';
|
|
2
4
|
import { useIntl } from 'react-intl-next';
|
|
3
5
|
import { toggleBulletList as toggleBulletListKeymap, indent as toggleIndentKeymap, toggleOrderedList as toggleOrderedListKeymap, outdent as toggleOutdentKeymap, tooltip } from '@atlaskit/editor-common/keymaps';
|
|
4
6
|
import { indentationMessages, listMessages } from '@atlaskit/editor-common/messages';
|
|
@@ -51,11 +53,10 @@ export function ToolbarDropdown(props) {
|
|
|
51
53
|
});
|
|
52
54
|
};
|
|
53
55
|
return (
|
|
54
|
-
/*#__PURE__*/
|
|
55
56
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
56
|
-
|
|
57
|
+
jsx("span", {
|
|
57
58
|
css: wrapperStyle
|
|
58
|
-
},
|
|
59
|
+
}, jsx(DropdownMenu, {
|
|
59
60
|
items: items,
|
|
60
61
|
onItemActivated: handleOnItemActivated,
|
|
61
62
|
mountTo: popupsMountPoint,
|
|
@@ -72,7 +73,7 @@ export function ToolbarDropdown(props) {
|
|
|
72
73
|
}
|
|
73
74
|
return isOpenedByKeyboard;
|
|
74
75
|
}
|
|
75
|
-
},
|
|
76
|
+
}, jsx(ToolbarButton, {
|
|
76
77
|
spacing: isReducedSpacing ? 'none' : 'default',
|
|
77
78
|
selected: bulletListActive || orderedListActive,
|
|
78
79
|
"aria-expanded": isDropdownOpen,
|
|
@@ -83,18 +84,17 @@ export function ToolbarDropdown(props) {
|
|
|
83
84
|
onKeyDown: handleOnKeyDown,
|
|
84
85
|
title: labelLists,
|
|
85
86
|
iconBefore:
|
|
86
|
-
/*#__PURE__*/
|
|
87
87
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
88
|
-
|
|
88
|
+
jsx("span", {
|
|
89
89
|
css: wrapperStyle
|
|
90
|
-
},
|
|
90
|
+
}, jsx(BulletListIcon, {
|
|
91
91
|
label: labelLists
|
|
92
|
-
}),
|
|
92
|
+
}), jsx("span", {
|
|
93
93
|
css: expandIconWrapperStyle
|
|
94
|
-
},
|
|
94
|
+
}, jsx(ExpandIcon, {
|
|
95
95
|
label: ""
|
|
96
96
|
})))
|
|
97
|
-
})),
|
|
97
|
+
})), jsx("span", {
|
|
98
98
|
css: separatorStyles
|
|
99
99
|
}))
|
|
100
100
|
);
|
|
@@ -114,9 +114,8 @@ function useItems(props) {
|
|
|
114
114
|
isDisabled: props.bulletListDisabled,
|
|
115
115
|
isActive: Boolean(props.bulletListActive),
|
|
116
116
|
elemAfter:
|
|
117
|
-
/*#__PURE__*/
|
|
118
117
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
119
|
-
|
|
118
|
+
jsx("div", {
|
|
120
119
|
css: shortcutStyle
|
|
121
120
|
}, tooltip(toggleBulletListKeymap))
|
|
122
121
|
}, {
|
|
@@ -128,9 +127,8 @@ function useItems(props) {
|
|
|
128
127
|
isDisabled: props.orderedListDisabled,
|
|
129
128
|
isActive: Boolean(props.orderedListActive),
|
|
130
129
|
elemAfter:
|
|
131
|
-
/*#__PURE__*/
|
|
132
130
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
133
|
-
|
|
131
|
+
jsx("div", {
|
|
134
132
|
css: shortcutStyle
|
|
135
133
|
}, tooltip(toggleOrderedListKeymap))
|
|
136
134
|
}];
|
|
@@ -146,9 +144,8 @@ function useItems(props) {
|
|
|
146
144
|
isDisabled: props.outdentDisabled,
|
|
147
145
|
isActive: false,
|
|
148
146
|
elemAfter:
|
|
149
|
-
/*#__PURE__*/
|
|
150
147
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
151
|
-
|
|
148
|
+
jsx("div", {
|
|
152
149
|
css: shortcutStyle
|
|
153
150
|
}, tooltip(toggleOutdentKeymap))
|
|
154
151
|
}, {
|
|
@@ -160,7 +157,7 @@ function useItems(props) {
|
|
|
160
157
|
isDisabled: props.indentDisabled,
|
|
161
158
|
isActive: false,
|
|
162
159
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
163
|
-
elemAfter:
|
|
160
|
+
elemAfter: jsx("div", {
|
|
164
161
|
css: shortcutStyle
|
|
165
162
|
}, tooltip(toggleIndentKeymap))
|
|
166
163
|
});
|
package/dist/es2019/ui/index.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { jsx } from '@emotion/react';
|
|
1
3
|
import { onItemActivated } from './onItemActivated';
|
|
2
4
|
import { Toolbar } from './Toolbar';
|
|
3
5
|
import { ToolbarDropdown } from './ToolbarDropdown';
|
|
@@ -21,7 +23,7 @@ export default function ToolbarListsIndentation(props) {
|
|
|
21
23
|
pluginInjectionApi
|
|
22
24
|
} = props;
|
|
23
25
|
if (isSmall) {
|
|
24
|
-
return
|
|
26
|
+
return jsx(ToolbarDropdown, {
|
|
25
27
|
editorView: props.editorView,
|
|
26
28
|
isReducedSpacing: isReducedSpacing,
|
|
27
29
|
popupsMountPoint: popupsMountPoint,
|
|
@@ -39,7 +41,7 @@ export default function ToolbarListsIndentation(props) {
|
|
|
39
41
|
featureFlags: featureFlags
|
|
40
42
|
});
|
|
41
43
|
}
|
|
42
|
-
return
|
|
44
|
+
return jsx(Toolbar, {
|
|
43
45
|
editorView: props.editorView,
|
|
44
46
|
isReducedSpacing: isReducedSpacing,
|
|
45
47
|
bulletListActive: bulletListActive,
|
package/dist/esm/ui/Toolbar.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
1
2
|
import { useEffect, useRef } from 'react';
|
|
3
|
+
import { jsx } from '@emotion/react';
|
|
2
4
|
import { useIntl } from 'react-intl-next';
|
|
3
5
|
import { getAriaKeyshortcuts, toggleBulletList as toggleBulletListKeymap, indent as toggleIndentKeymap, toggleOrderedList as toggleOrderedListKeymap, outdent as toggleOutdentKeymap, tooltip, ToolTipContent } from '@atlaskit/editor-common/keymaps';
|
|
4
6
|
import { indentationMessages, listMessages as messages } from '@atlaskit/editor-common/messages';
|
|
@@ -48,11 +50,10 @@ export function Toolbar(props) {
|
|
|
48
50
|
}
|
|
49
51
|
}, [outdentButtonRef, outdentDisabled, isOutdentButtonFocused]);
|
|
50
52
|
return (
|
|
51
|
-
/*#__PURE__*/
|
|
52
53
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
53
|
-
|
|
54
|
+
jsx("span", {
|
|
54
55
|
css: buttonGroupStyle
|
|
55
|
-
},
|
|
56
|
+
}, jsx(ToolbarButton, {
|
|
56
57
|
buttonId: TOOLBAR_BUTTON.BULLET_LIST,
|
|
57
58
|
testId: labelUnorderedList,
|
|
58
59
|
spacing: isReducedSpacing ? 'none' : 'default',
|
|
@@ -62,14 +63,14 @@ export function Toolbar(props) {
|
|
|
62
63
|
"aria-label": tooltip(toggleBulletListKeymap, labelUnorderedList),
|
|
63
64
|
"aria-keyshortcuts": getAriaKeyshortcuts(toggleBulletListKeymap),
|
|
64
65
|
disabled: bulletListDisabled || disabled,
|
|
65
|
-
title:
|
|
66
|
+
title: jsx(ToolTipContent, {
|
|
66
67
|
description: labelUnorderedList,
|
|
67
68
|
keymap: toggleBulletListKeymap
|
|
68
69
|
}),
|
|
69
|
-
iconBefore:
|
|
70
|
+
iconBefore: jsx(BulletListIcon, {
|
|
70
71
|
label: ""
|
|
71
72
|
})
|
|
72
|
-
}),
|
|
73
|
+
}), jsx(ToolbarButton, {
|
|
73
74
|
buttonId: TOOLBAR_BUTTON.ORDERED_LIST,
|
|
74
75
|
testId: labelOrderedList,
|
|
75
76
|
spacing: isReducedSpacing ? 'none' : 'default',
|
|
@@ -79,46 +80,46 @@ export function Toolbar(props) {
|
|
|
79
80
|
"aria-label": tooltip(toggleOrderedListKeymap, labelOrderedList),
|
|
80
81
|
"aria-keyshortcuts": getAriaKeyshortcuts(toggleOrderedListKeymap),
|
|
81
82
|
disabled: orderedListDisabled || disabled,
|
|
82
|
-
title:
|
|
83
|
+
title: jsx(ToolTipContent, {
|
|
83
84
|
description: labelOrderedList,
|
|
84
85
|
keymap: toggleOrderedListKeymap
|
|
85
86
|
}),
|
|
86
|
-
iconBefore:
|
|
87
|
+
iconBefore: jsx(NumberListIcon, {
|
|
87
88
|
label: ""
|
|
88
89
|
})
|
|
89
|
-
}), showIndentationButtons &&
|
|
90
|
+
}), showIndentationButtons && jsx(ToolbarButton, {
|
|
90
91
|
buttonId: TOOLBAR_BUTTON.OUTDENT,
|
|
91
92
|
testId: TOOLBAR_BUTTON.OUTDENT,
|
|
92
93
|
ref: outdentButtonRef,
|
|
93
94
|
spacing: isReducedSpacing ? 'none' : 'default',
|
|
94
95
|
onClick: handleOnItemActivated('outdent'),
|
|
95
|
-
iconBefore:
|
|
96
|
+
iconBefore: jsx(OutdentIcon, {
|
|
96
97
|
label: ""
|
|
97
98
|
}),
|
|
98
99
|
disabled: outdentDisabled || disabled,
|
|
99
100
|
"aria-label": tooltip(toggleOutdentKeymap, outdentMessage),
|
|
100
101
|
"aria-keyshortcuts": getAriaKeyshortcuts(toggleOutdentKeymap),
|
|
101
|
-
title:
|
|
102
|
+
title: jsx(ToolTipContent, {
|
|
102
103
|
description: outdentMessage,
|
|
103
104
|
keymap: toggleOutdentKeymap
|
|
104
105
|
})
|
|
105
|
-
}), showIndentationButtons &&
|
|
106
|
+
}), showIndentationButtons && jsx(ToolbarButton, {
|
|
106
107
|
buttonId: TOOLBAR_BUTTON.INDENT,
|
|
107
108
|
testId: TOOLBAR_BUTTON.INDENT,
|
|
108
109
|
ref: indentButtonRef,
|
|
109
110
|
spacing: isReducedSpacing ? 'none' : 'default',
|
|
110
111
|
onClick: handleOnItemActivated('indent'),
|
|
111
|
-
iconBefore:
|
|
112
|
+
iconBefore: jsx(IndentIcon, {
|
|
112
113
|
label: ""
|
|
113
114
|
}),
|
|
114
115
|
disabled: indentDisabled || disabled,
|
|
115
116
|
"aria-label": tooltip(toggleIndentKeymap, indentMessage),
|
|
116
117
|
"aria-keyshortcuts": getAriaKeyshortcuts(toggleIndentKeymap),
|
|
117
|
-
title:
|
|
118
|
+
title: jsx(ToolTipContent, {
|
|
118
119
|
description: indentMessage,
|
|
119
120
|
keymap: toggleIndentKeymap
|
|
120
121
|
})
|
|
121
|
-
}),
|
|
122
|
+
}), jsx("span", {
|
|
122
123
|
css: separatorStyles
|
|
123
124
|
}))
|
|
124
125
|
);
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
+
/** @jsx jsx */
|
|
2
3
|
import React from 'react';
|
|
4
|
+
import { jsx } from '@emotion/react';
|
|
3
5
|
import { useIntl } from 'react-intl-next';
|
|
4
6
|
import { toggleBulletList as toggleBulletListKeymap, indent as toggleIndentKeymap, toggleOrderedList as toggleOrderedListKeymap, outdent as toggleOutdentKeymap, tooltip } from '@atlaskit/editor-common/keymaps';
|
|
5
7
|
import { indentationMessages, listMessages } from '@atlaskit/editor-common/messages';
|
|
@@ -55,11 +57,10 @@ export function ToolbarDropdown(props) {
|
|
|
55
57
|
});
|
|
56
58
|
};
|
|
57
59
|
return (
|
|
58
|
-
/*#__PURE__*/
|
|
59
60
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
60
|
-
|
|
61
|
+
jsx("span", {
|
|
61
62
|
css: wrapperStyle
|
|
62
|
-
},
|
|
63
|
+
}, jsx(DropdownMenu, {
|
|
63
64
|
items: items,
|
|
64
65
|
onItemActivated: handleOnItemActivated,
|
|
65
66
|
mountTo: popupsMountPoint,
|
|
@@ -76,7 +77,7 @@ export function ToolbarDropdown(props) {
|
|
|
76
77
|
}
|
|
77
78
|
return isOpenedByKeyboard;
|
|
78
79
|
}
|
|
79
|
-
},
|
|
80
|
+
}, jsx(ToolbarButton, {
|
|
80
81
|
spacing: isReducedSpacing ? 'none' : 'default',
|
|
81
82
|
selected: bulletListActive || orderedListActive,
|
|
82
83
|
"aria-expanded": isDropdownOpen,
|
|
@@ -87,18 +88,17 @@ export function ToolbarDropdown(props) {
|
|
|
87
88
|
onKeyDown: handleOnKeyDown,
|
|
88
89
|
title: labelLists,
|
|
89
90
|
iconBefore:
|
|
90
|
-
/*#__PURE__*/
|
|
91
91
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
92
|
-
|
|
92
|
+
jsx("span", {
|
|
93
93
|
css: wrapperStyle
|
|
94
|
-
},
|
|
94
|
+
}, jsx(BulletListIcon, {
|
|
95
95
|
label: labelLists
|
|
96
|
-
}),
|
|
96
|
+
}), jsx("span", {
|
|
97
97
|
css: expandIconWrapperStyle
|
|
98
|
-
},
|
|
98
|
+
}, jsx(ExpandIcon, {
|
|
99
99
|
label: ""
|
|
100
100
|
})))
|
|
101
|
-
})),
|
|
101
|
+
})), jsx("span", {
|
|
102
102
|
css: separatorStyles
|
|
103
103
|
}))
|
|
104
104
|
);
|
|
@@ -117,9 +117,8 @@ function useItems(props) {
|
|
|
117
117
|
isDisabled: props.bulletListDisabled,
|
|
118
118
|
isActive: Boolean(props.bulletListActive),
|
|
119
119
|
elemAfter:
|
|
120
|
-
/*#__PURE__*/
|
|
121
120
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
122
|
-
|
|
121
|
+
jsx("div", {
|
|
123
122
|
css: shortcutStyle
|
|
124
123
|
}, tooltip(toggleBulletListKeymap))
|
|
125
124
|
}, {
|
|
@@ -131,9 +130,8 @@ function useItems(props) {
|
|
|
131
130
|
isDisabled: props.orderedListDisabled,
|
|
132
131
|
isActive: Boolean(props.orderedListActive),
|
|
133
132
|
elemAfter:
|
|
134
|
-
/*#__PURE__*/
|
|
135
133
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
136
|
-
|
|
134
|
+
jsx("div", {
|
|
137
135
|
css: shortcutStyle
|
|
138
136
|
}, tooltip(toggleOrderedListKeymap))
|
|
139
137
|
}];
|
|
@@ -149,9 +147,8 @@ function useItems(props) {
|
|
|
149
147
|
isDisabled: props.outdentDisabled,
|
|
150
148
|
isActive: false,
|
|
151
149
|
elemAfter:
|
|
152
|
-
/*#__PURE__*/
|
|
153
150
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
154
|
-
|
|
151
|
+
jsx("div", {
|
|
155
152
|
css: shortcutStyle
|
|
156
153
|
}, tooltip(toggleOutdentKeymap))
|
|
157
154
|
}, {
|
|
@@ -163,7 +160,7 @@ function useItems(props) {
|
|
|
163
160
|
isDisabled: props.indentDisabled,
|
|
164
161
|
isActive: false,
|
|
165
162
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
166
|
-
elemAfter:
|
|
163
|
+
elemAfter: jsx("div", {
|
|
167
164
|
css: shortcutStyle
|
|
168
165
|
}, tooltip(toggleIndentKeymap))
|
|
169
166
|
});
|
package/dist/esm/ui/index.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { jsx } from '@emotion/react';
|
|
1
3
|
import { onItemActivated } from './onItemActivated';
|
|
2
4
|
import { Toolbar } from './Toolbar';
|
|
3
5
|
import { ToolbarDropdown } from './ToolbarDropdown';
|
|
@@ -19,7 +21,7 @@ export default function ToolbarListsIndentation(props) {
|
|
|
19
21
|
featureFlags = props.featureFlags,
|
|
20
22
|
pluginInjectionApi = props.pluginInjectionApi;
|
|
21
23
|
if (isSmall) {
|
|
22
|
-
return
|
|
24
|
+
return jsx(ToolbarDropdown, {
|
|
23
25
|
editorView: props.editorView,
|
|
24
26
|
isReducedSpacing: isReducedSpacing,
|
|
25
27
|
popupsMountPoint: popupsMountPoint,
|
|
@@ -37,7 +39,7 @@ export default function ToolbarListsIndentation(props) {
|
|
|
37
39
|
featureFlags: featureFlags
|
|
38
40
|
});
|
|
39
41
|
}
|
|
40
|
-
return
|
|
42
|
+
return jsx(Toolbar, {
|
|
41
43
|
editorView: props.editorView,
|
|
42
44
|
isReducedSpacing: isReducedSpacing,
|
|
43
45
|
bulletListActive: bulletListActive,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-toolbar-lists-indentation",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.3",
|
|
4
4
|
"description": "Toolbar lists and indentation plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
".": "./src/index.ts"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@atlaskit/editor-common": "^76.
|
|
34
|
+
"@atlaskit/editor-common": "^76.25.0",
|
|
35
35
|
"@atlaskit/editor-plugin-analytics": "^0.3.0",
|
|
36
36
|
"@atlaskit/editor-plugin-block-type": "^3.0.0",
|
|
37
37
|
"@atlaskit/editor-plugin-feature-flags": "^1.0.0",
|