@seafile/sdoc-editor 1.0.62 → 1.0.63

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.
@@ -219,7 +219,8 @@ const EditableArticle = _ref => {
219
219
  onCut: eventProxy.onCut,
220
220
  onCopy: eventProxy.onCopy,
221
221
  onCompositionStart: eventProxy.onCompositionStart,
222
- id: "sdoc-editor"
222
+ id: "sdoc-editor",
223
+ "aria-label": "textbox"
223
224
  })), /*#__PURE__*/_react.default.createElement(_extension.SideToolbar, null), showComment && /*#__PURE__*/_react.default.createElement(_comment.default, {
224
225
  editor: editor,
225
226
  type: "editor"
@@ -19,6 +19,7 @@ var _tooltip = _interopRequireDefault(require("../../../../components/tooltip"))
19
19
  require("./index.css");
20
20
  const ColorMenu = _ref => {
21
21
  let {
22
+ ariaLabel,
22
23
  iconClass,
23
24
  id,
24
25
  isRichEditor,
@@ -107,6 +108,7 @@ const ColorMenu = _ref => {
107
108
  const buttonId = `button-${id}`;
108
109
  return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("button", {
109
110
  type: "button",
111
+ "aria-label": ariaLabel,
110
112
  className: validClassName,
111
113
  id: buttonId,
112
114
  disabled: disabled
@@ -21,7 +21,8 @@ const MenuItem = _ref => {
21
21
  className,
22
22
  iconClass,
23
23
  id,
24
- text
24
+ text,
25
+ ariaLabel
25
26
  } = _ref;
26
27
  const {
27
28
  t
@@ -41,6 +42,7 @@ const MenuItem = _ref => {
41
42
  return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("button", {
42
43
  id: id,
43
44
  type: "button",
45
+ "aria-label": ariaLabel,
44
46
  className: validClassName,
45
47
  disabled: disabled,
46
48
  "data-active": isActive,
@@ -26,6 +26,7 @@ const MoreDropdown = _ref => {
26
26
  return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("button", {
27
27
  className: validClassName,
28
28
  type: "button",
29
+ "aria-label": "more",
29
30
  id: buttonId
30
31
  }, /*#__PURE__*/_react.default.createElement("i", {
31
32
  className: "sdocfont sdoc-more"
@@ -96,21 +96,25 @@ const MENUS_CONFIG_MAP = exports.MENUS_CONFIG_MAP = {
96
96
  id: ITALIC,
97
97
  iconClass: 'sdocfont sdoc-italic',
98
98
  text: 'Italic',
99
+ ariaLabel: 'italic',
99
100
  type: TEXT_STYLE_MAP.ITALIC
100
101
  }, {
101
102
  id: BOLD,
102
103
  iconClass: 'sdocfont sdoc-bold',
103
104
  text: 'Bold',
105
+ ariaLabel: 'bold',
104
106
  type: TEXT_STYLE_MAP.BOLD
105
107
  }, {
106
108
  id: UNDERLINE,
107
109
  iconClass: 'sdocfont sdoc-underline',
108
110
  text: 'Underline',
111
+ ariaLabel: 'underline',
109
112
  type: TEXT_STYLE_MAP.UNDERLINE
110
113
  }, {
111
114
  id: `sdoc-${HIGHLIGHT_COLOR}`,
112
115
  iconClass: 'sdocfont sdoc-highlight-color',
113
116
  text: 'Highlight_color',
117
+ ariaLabel: 'background color',
114
118
  type: TEXT_STYLE_MAP.HIGHLIGHT_COLOR,
115
119
  isColor: true,
116
120
  recentUsedColorsKey: _color.RECENT_USED_HIGHLIGHT_COLORS_KEY,
@@ -119,6 +123,7 @@ const MENUS_CONFIG_MAP = exports.MENUS_CONFIG_MAP = {
119
123
  id: `sdoc-font-${COLOR}`,
120
124
  iconClass: 'sdocfont sdoc-font-color',
121
125
  text: 'Font_color',
126
+ ariaLabel: 'font color',
122
127
  type: TEXT_STYLE_MAP.COLOR,
123
128
  defaultColor: _color.DEFAULT_FONT_COLOR,
124
129
  isColor: true,
@@ -43,6 +43,7 @@ class QuoteMenu extends _react.default.Component {
43
43
  const props = {
44
44
  isRichEditor,
45
45
  className,
46
+ ariaLabel: 'blockquote',
46
47
  ...menuConfig,
47
48
  disabled: this.isDisabled(),
48
49
  isActive: this.isActive(),
@@ -40,6 +40,7 @@ const CalloutMenu = _ref => {
40
40
  return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_commons.MenuItem, Object.assign({
41
41
  isRichEditor: isRichEditor,
42
42
  className: className,
43
+ ariaLabel: "callout",
43
44
  disabled: (0, _helper.isMenuDisabled)(editor, readonly),
44
45
  isActive: (0, _helper.isMenuActive)(editor),
45
46
  onMouseDown: handleClick
@@ -46,6 +46,7 @@ class CheckListMenu extends _react.default.Component {
46
46
  const props = {
47
47
  isRichEditor,
48
48
  className,
49
+ ariaLabel: 'check list',
49
50
  ...menuConfig,
50
51
  disabled: this.isDisabled(),
51
52
  isActive: this.isActive(),
@@ -24,6 +24,7 @@ const ClearFormatMenu = _ref => {
24
24
  const props = {
25
25
  isRichEditor,
26
26
  className,
27
+ ariaLabel: 'clear',
27
28
  ...menuConfig,
28
29
  disabled: (0, _helpers.isMenuDisabled)(editor, readonly),
29
30
  isActive: false,
@@ -46,12 +46,14 @@ class ListMenu extends _react.default.Component {
46
46
  const {
47
47
  isRichEditor,
48
48
  className,
49
- type
49
+ type,
50
+ ariaLabel
50
51
  } = this.props;
51
52
  const menuConfig = _constants.MENUS_CONFIG_MAP[type];
52
53
  const props = {
53
54
  isRichEditor,
54
55
  className,
56
+ ariaLabel,
55
57
  ...menuConfig,
56
58
  disabled: this.isDisabled(),
57
59
  isActive: this.isActive(),
@@ -70,6 +70,7 @@ const SearchReplaceMenu = _ref => {
70
70
  return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_commons.MenuItem, Object.assign({
71
71
  isRichEditor: isRichEditor,
72
72
  className: className,
73
+ ariaLabel: "search",
73
74
  disabled: false,
74
75
  isActive: isOpenPopover,
75
76
  onMouseDown: onMouseDown
@@ -57,6 +57,7 @@ const TextAlignMenu = _ref => {
57
57
  curType = 'align_' + curType;
58
58
  return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("button", {
59
59
  type: "button",
60
+ "aria-label": "text align",
60
61
  className: validClassName,
61
62
  id: buttonId,
62
63
  disabled: disabled
@@ -93,6 +93,7 @@ const TextStyleMenuList = _ref2 => {
93
93
  let itemProps = {
94
94
  isRichEditor,
95
95
  className,
96
+ ariaLabel: item === null || item === void 0 ? void 0 : item.ariaLabel,
96
97
  disabled: isDisabled(),
97
98
  isActive: isActive(item.type),
98
99
  onMouseDown: item.isColor ? () => {} : onMouseDown
@@ -55,11 +55,13 @@ const HeaderToolbar = _ref => {
55
55
  }), /*#__PURE__*/_react.default.createElement(_menu2.default, {
56
56
  editor: editor,
57
57
  type: _constants.UNORDERED_LIST,
58
- readonly: readonly
58
+ readonly: readonly,
59
+ ariaLabel: "unordered list"
59
60
  }), /*#__PURE__*/_react.default.createElement(_menu2.default, {
60
61
  editor: editor,
61
62
  type: _constants.ORDERED_LIST,
62
- readonly: readonly
63
+ readonly: readonly,
64
+ ariaLabel: "ordered list"
63
65
  }), /*#__PURE__*/_react.default.createElement(_menu4.default, {
64
66
  editor: editor,
65
67
  readonly: readonly
@@ -49,6 +49,7 @@ class HistoryMenu extends _react.default.Component {
49
49
  const undoProps = {
50
50
  isRichEditor,
51
51
  className,
52
+ ariaLabel: 'undo',
52
53
  ...undoConfig,
53
54
  disabled: this.isDisabled(_constants.UNDO),
54
55
  isActive: false,
@@ -57,6 +58,7 @@ class HistoryMenu extends _react.default.Component {
57
58
  const redoProps = {
58
59
  isRichEditor,
59
60
  className,
61
+ ariaLabel: 'redo',
60
62
  ...redoConfig,
61
63
  disabled: this.isDisabled(_constants.REDO),
62
64
  isActive: false,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seafile/sdoc-editor",
3
- "version": "1.0.62",
3
+ "version": "1.0.63",
4
4
  "private": false,
5
5
  "description": "This is a sdoc editor",
6
6
  "main": "dist/index.js",