@gravity-ui/markdown-editor 14.4.0 → 14.5.1
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/build/cjs/bundle/Editor.js +1 -0
- package/build/cjs/bundle/config/markup.d.ts +41 -17
- package/build/cjs/bundle/config/markup.js +413 -308
- package/build/cjs/bundle/config/wysiwyg.d.ts +29 -18
- package/build/cjs/bundle/config/wysiwyg.js +526 -310
- package/build/cjs/bundle/sticky/sticky.css +1 -1
- package/build/cjs/bundle/types.d.ts +2 -0
- package/build/cjs/extensions/behavior/Clipboard/utils.d.ts +1 -0
- package/build/cjs/extensions/behavior/Clipboard/utils.js +1 -0
- package/build/cjs/extensions/markdown/CodeBlock/handle-paste.js +5 -17
- package/build/cjs/extensions/yfm/Checkbox/CheckboxSpecs/const.d.ts +7 -0
- package/build/cjs/extensions/yfm/Checkbox/CheckboxSpecs/const.js +8 -1
- package/build/cjs/extensions/yfm/Checkbox/CheckboxSpecs/index.d.ts +1 -1
- package/build/cjs/extensions/yfm/Checkbox/CheckboxSpecs/index.js +2 -1
- package/build/cjs/extensions/yfm/Checkbox/CheckboxSpecs/schema.d.ts +1 -1
- package/build/cjs/extensions/yfm/Checkbox/CheckboxSpecs/schema.js +7 -7
- package/build/cjs/extensions/yfm/Checkbox/CheckboxSpecs/serializer.d.ts +1 -1
- package/build/cjs/extensions/yfm/Checkbox/CheckboxSpecs/serializer.js +2 -2
- package/build/cjs/extensions/yfm/Checkbox/const.d.ts +1 -1
- package/build/cjs/extensions/yfm/Checkbox/const.js +2 -1
- package/build/cjs/extensions/yfm/Checkbox/index.d.ts +2 -2
- package/build/cjs/extensions/yfm/Checkbox/index.js +4 -38
- package/build/cjs/extensions/yfm/Checkbox/nodeviews.d.ts +16 -0
- package/build/cjs/extensions/yfm/Checkbox/nodeviews.js +56 -0
- package/build/cjs/extensions/yfm/YfmFile/YfmFileSpecs/const.d.ts +12 -0
- package/build/cjs/extensions/yfm/YfmFile/YfmFileSpecs/const.js +21 -2
- package/build/cjs/extensions/yfm/YfmFile/YfmFileSpecs/index.d.ts +8 -1
- package/build/cjs/extensions/yfm/YfmFile/YfmFileSpecs/index.js +29 -5
- package/build/cjs/markup/codemirror/create.d.ts +1 -0
- package/build/cjs/markup/codemirror/create.js +41 -4
- package/build/cjs/markup/codemirror/html-to-markdown/converters.d.ts +111 -0
- package/build/cjs/markup/codemirror/html-to-markdown/converters.js +214 -0
- package/build/cjs/markup/codemirror/html-to-markdown/handlers.d.ts +104 -0
- package/build/cjs/markup/codemirror/html-to-markdown/handlers.js +233 -0
- package/build/cjs/markup/codemirror/html-to-markdown/helpers.d.ts +1 -0
- package/build/cjs/markup/codemirror/html-to-markdown/helpers.js +21 -0
- package/build/cjs/markup/commands/inline.js +18 -8
- package/build/cjs/utils/clipboard.d.ts +14 -0
- package/build/cjs/utils/clipboard.js +36 -1
- package/build/cjs/version.js +1 -1
- package/build/esm/bundle/Editor.js +1 -0
- package/build/esm/bundle/config/markup.d.ts +41 -17
- package/build/esm/bundle/config/markup.js +411 -307
- package/build/esm/bundle/config/wysiwyg.d.ts +29 -18
- package/build/esm/bundle/config/wysiwyg.js +499 -284
- package/build/esm/bundle/sticky/sticky.css +1 -1
- package/build/esm/bundle/types.d.ts +2 -0
- package/build/esm/extensions/behavior/Clipboard/utils.d.ts +1 -0
- package/build/esm/extensions/behavior/Clipboard/utils.js +1 -0
- package/build/esm/extensions/markdown/CodeBlock/handle-paste.js +2 -14
- package/build/esm/extensions/yfm/Checkbox/CheckboxSpecs/const.d.ts +7 -0
- package/build/esm/extensions/yfm/Checkbox/CheckboxSpecs/const.js +7 -0
- package/build/esm/extensions/yfm/Checkbox/CheckboxSpecs/index.d.ts +1 -1
- package/build/esm/extensions/yfm/Checkbox/CheckboxSpecs/index.js +1 -1
- package/build/esm/extensions/yfm/Checkbox/CheckboxSpecs/schema.d.ts +1 -1
- package/build/esm/extensions/yfm/Checkbox/CheckboxSpecs/schema.js +7 -7
- package/build/esm/extensions/yfm/Checkbox/CheckboxSpecs/serializer.d.ts +1 -1
- package/build/esm/extensions/yfm/Checkbox/CheckboxSpecs/serializer.js +2 -2
- package/build/esm/extensions/yfm/Checkbox/const.d.ts +1 -1
- package/build/esm/extensions/yfm/Checkbox/const.js +1 -1
- package/build/esm/extensions/yfm/Checkbox/index.d.ts +2 -2
- package/build/esm/extensions/yfm/Checkbox/index.js +3 -38
- package/build/esm/extensions/yfm/Checkbox/nodeviews.d.ts +16 -0
- package/build/esm/extensions/yfm/Checkbox/nodeviews.js +52 -0
- package/build/esm/extensions/yfm/YfmFile/YfmFileSpecs/const.d.ts +12 -0
- package/build/esm/extensions/yfm/YfmFile/YfmFileSpecs/const.js +21 -2
- package/build/esm/extensions/yfm/YfmFile/YfmFileSpecs/index.d.ts +8 -1
- package/build/esm/extensions/yfm/YfmFile/YfmFileSpecs/index.js +29 -6
- package/build/esm/markup/codemirror/create.d.ts +1 -0
- package/build/esm/markup/codemirror/create.js +40 -3
- package/build/esm/markup/codemirror/html-to-markdown/converters.d.ts +111 -0
- package/build/esm/markup/codemirror/html-to-markdown/converters.js +210 -0
- package/build/esm/markup/codemirror/html-to-markdown/handlers.d.ts +104 -0
- package/build/esm/markup/codemirror/html-to-markdown/handlers.js +215 -0
- package/build/esm/markup/codemirror/html-to-markdown/helpers.d.ts +1 -0
- package/build/esm/markup/codemirror/html-to-markdown/helpers.js +17 -0
- package/build/esm/markup/commands/inline.js +18 -8
- package/build/esm/utils/clipboard.d.ts +14 -0
- package/build/esm/utils/clipboard.js +32 -0
- package/build/esm/version.js +1 -1
- package/build/styles.css +1 -1
- package/package.json +9 -7
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.mListMoveListConfig = exports.mListsListConfig = exports.mHeadingListConfig = exports.mLiftListItemData = exports.mSinkListItemData = exports.mOrderedListItemData = exports.mBulletListItemData = exports.mHeading6ItemData = exports.mHeading5ItemData = exports.mHeading4ItemData = exports.mHeading3ItemData = exports.mHeading2ItemData = exports.mHeading1ItemData = exports.mMathListItem = exports.mEmojiItemData = exports.mHruleItemData = exports.mCodeBlockItemData = exports.mCodeblockItemData = exports.mMermaidItemData = exports.mMermaidButton = exports.mYfmHtmlBlockItemData = exports.mYfmHtmlBlockButton = exports.mMathBlockItemData = exports.mMathInlineItemData = exports.mTabsItemData = exports.mFileItemData = exports.mFilePopupData = exports.mImageItemData = exports.mImagePopupData = exports.mCodeItemData = exports.mTableItemData = exports.mTableButton = exports.mNoteItemData = exports.mNoteButton = exports.mCutItemData = exports.mCutButton = exports.mQuoteItemData = exports.mQuoteButton = exports.mLinkItemData = exports.mLinkButton = exports.mCheckboxItemData = exports.mCheckboxButton = exports.mMarkedItemData = exports.mMonospaceItemData = exports.mStrikethroughItemData = exports.mUnderlineItemData = exports.mItalicItemData = exports.mBoldItemData = exports.mRedoItemData = exports.mUndoItemData = void 0;
|
|
4
|
+
exports.mHiddenDataByPreset = exports.mToolbarConfigByPreset = exports.mToolbarConfig = exports.mBiusGroupConfig = exports.mHistoryGroupConfig = exports.mHiddenData = exports.mMathListConfig = exports.mCodeListConfig = void 0;
|
|
4
5
|
const tslib_1 = require("tslib");
|
|
5
6
|
const react_1 = tslib_1.__importDefault(require("react"));
|
|
6
7
|
const menubar_1 = require("../../i18n/menubar");
|
|
@@ -16,29 +17,26 @@ const noop = () => { };
|
|
|
16
17
|
const inactive = () => false;
|
|
17
18
|
const enable = () => true;
|
|
18
19
|
const disable = () => false;
|
|
19
|
-
exports.
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
},
|
|
40
|
-
];
|
|
41
|
-
/** Bold, Italic, Underline, Strike buttons group */
|
|
20
|
+
exports.mUndoItemData = {
|
|
21
|
+
id: action_names_1.ActionName.undo,
|
|
22
|
+
type: types_1.ToolbarDataType.SingleButton,
|
|
23
|
+
title: menubar_1.i18n.bind(null, 'undo'),
|
|
24
|
+
icon: icons_1.icons.undo,
|
|
25
|
+
hotkey: shortcuts_1.formatter.toView(shortcuts_1.Action.Undo),
|
|
26
|
+
exec: (e) => (0, commands_1.undo)(e.cm),
|
|
27
|
+
isActive: inactive,
|
|
28
|
+
isEnable: (e) => (0, commands_1.undoDepth)(e.cm.state) > 0,
|
|
29
|
+
};
|
|
30
|
+
exports.mRedoItemData = {
|
|
31
|
+
id: action_names_1.ActionName.redo,
|
|
32
|
+
type: types_1.ToolbarDataType.SingleButton,
|
|
33
|
+
title: menubar_1.i18n.bind(null, 'redo'),
|
|
34
|
+
icon: icons_1.icons.redo,
|
|
35
|
+
hotkey: shortcuts_1.formatter.toView(shortcuts_1.Action.Redo),
|
|
36
|
+
exec: (e) => (0, commands_1.redo)(e.cm),
|
|
37
|
+
isActive: inactive,
|
|
38
|
+
isEnable: (e) => (0, commands_1.redoDepth)(e.cm.state) > 0,
|
|
39
|
+
};
|
|
42
40
|
exports.mBoldItemData = {
|
|
43
41
|
id: action_names_1.ActionName.bold,
|
|
44
42
|
type: types_1.ToolbarDataType.SingleButton,
|
|
@@ -97,132 +95,6 @@ exports.mMarkedItemData = {
|
|
|
97
95
|
isActive: inactive,
|
|
98
96
|
isEnable: enable,
|
|
99
97
|
};
|
|
100
|
-
exports.mBiusGroupConfig = [
|
|
101
|
-
exports.mBoldItemData,
|
|
102
|
-
exports.mItalicItemData,
|
|
103
|
-
{
|
|
104
|
-
id: action_names_1.ActionName.underline,
|
|
105
|
-
type: types_1.ToolbarDataType.SingleButton,
|
|
106
|
-
title: menubar_1.i18n.bind(null, 'underline'),
|
|
107
|
-
icon: icons_1.icons.underline,
|
|
108
|
-
hotkey: shortcuts_1.formatter.toView(shortcuts_1.Action.Underline),
|
|
109
|
-
exec: (e) => (0, commands_1.toggleUnderline)(e.cm),
|
|
110
|
-
isActive: inactive,
|
|
111
|
-
isEnable: enable,
|
|
112
|
-
},
|
|
113
|
-
{
|
|
114
|
-
id: action_names_1.ActionName.strike,
|
|
115
|
-
type: types_1.ToolbarDataType.SingleButton,
|
|
116
|
-
title: menubar_1.i18n.bind(null, 'strike'),
|
|
117
|
-
icon: icons_1.icons.strikethrough,
|
|
118
|
-
hotkey: shortcuts_1.formatter.toView(shortcuts_1.Action.Strike),
|
|
119
|
-
exec: (e) => (0, commands_1.toggleStrikethrough)(e.cm),
|
|
120
|
-
isActive: inactive,
|
|
121
|
-
isEnable: enable,
|
|
122
|
-
},
|
|
123
|
-
{
|
|
124
|
-
id: action_names_1.ActionName.mono,
|
|
125
|
-
type: types_1.ToolbarDataType.SingleButton,
|
|
126
|
-
title: menubar_1.i18n.bind(null, 'mono'),
|
|
127
|
-
icon: icons_1.icons.mono,
|
|
128
|
-
exec: (e) => (0, commands_1.toggleMonospace)(e.cm),
|
|
129
|
-
isActive: inactive,
|
|
130
|
-
isEnable: enable,
|
|
131
|
-
},
|
|
132
|
-
{
|
|
133
|
-
id: action_names_1.ActionName.mark,
|
|
134
|
-
type: types_1.ToolbarDataType.SingleButton,
|
|
135
|
-
title: menubar_1.i18n.bind(null, 'mark'),
|
|
136
|
-
icon: icons_1.icons.mark,
|
|
137
|
-
exec: (e) => (0, commands_1.toggleMarked)(e.cm),
|
|
138
|
-
isActive: inactive,
|
|
139
|
-
isEnable: enable,
|
|
140
|
-
},
|
|
141
|
-
];
|
|
142
|
-
exports.mHeadingListConfig = {
|
|
143
|
-
icon: icons_1.icons.headline,
|
|
144
|
-
withArrow: true,
|
|
145
|
-
title: menubar_1.i18n.bind(null, 'heading'),
|
|
146
|
-
data: [
|
|
147
|
-
{
|
|
148
|
-
id: action_names_1.ActionName.heading1,
|
|
149
|
-
title: menubar_1.i18n.bind(null, 'heading1'),
|
|
150
|
-
icon: icons_1.icons.h1,
|
|
151
|
-
hotkey: shortcuts_1.formatter.toView(shortcuts_1.Action.Heading1),
|
|
152
|
-
exec: (e) => (0, commands_1.toH1)(e.cm),
|
|
153
|
-
isActive: inactive,
|
|
154
|
-
isEnable: enable,
|
|
155
|
-
},
|
|
156
|
-
{
|
|
157
|
-
id: action_names_1.ActionName.heading2,
|
|
158
|
-
title: menubar_1.i18n.bind(null, 'heading2'),
|
|
159
|
-
icon: icons_1.icons.h2,
|
|
160
|
-
hotkey: shortcuts_1.formatter.toView(shortcuts_1.Action.Heading2),
|
|
161
|
-
exec: (e) => (0, commands_1.toH2)(e.cm),
|
|
162
|
-
isActive: inactive,
|
|
163
|
-
isEnable: enable,
|
|
164
|
-
},
|
|
165
|
-
{
|
|
166
|
-
id: action_names_1.ActionName.heading3,
|
|
167
|
-
title: menubar_1.i18n.bind(null, 'heading3'),
|
|
168
|
-
icon: icons_1.icons.h3,
|
|
169
|
-
hotkey: shortcuts_1.formatter.toView(shortcuts_1.Action.Heading3),
|
|
170
|
-
exec: (e) => (0, commands_1.toH3)(e.cm),
|
|
171
|
-
isActive: inactive,
|
|
172
|
-
isEnable: enable,
|
|
173
|
-
},
|
|
174
|
-
{
|
|
175
|
-
id: action_names_1.ActionName.heading4,
|
|
176
|
-
title: menubar_1.i18n.bind(null, 'heading4'),
|
|
177
|
-
icon: icons_1.icons.h4,
|
|
178
|
-
hotkey: shortcuts_1.formatter.toView(shortcuts_1.Action.Heading4),
|
|
179
|
-
exec: (e) => (0, commands_1.toH4)(e.cm),
|
|
180
|
-
isActive: inactive,
|
|
181
|
-
isEnable: enable,
|
|
182
|
-
},
|
|
183
|
-
{
|
|
184
|
-
id: action_names_1.ActionName.heading5,
|
|
185
|
-
title: menubar_1.i18n.bind(null, 'heading5'),
|
|
186
|
-
icon: icons_1.icons.h5,
|
|
187
|
-
hotkey: shortcuts_1.formatter.toView(shortcuts_1.Action.Heading5),
|
|
188
|
-
exec: (e) => (0, commands_1.toH5)(e.cm),
|
|
189
|
-
isActive: inactive,
|
|
190
|
-
isEnable: enable,
|
|
191
|
-
},
|
|
192
|
-
{
|
|
193
|
-
id: action_names_1.ActionName.heading6,
|
|
194
|
-
title: menubar_1.i18n.bind(null, 'heading6'),
|
|
195
|
-
icon: icons_1.icons.h6,
|
|
196
|
-
hotkey: shortcuts_1.formatter.toView(shortcuts_1.Action.Heading6),
|
|
197
|
-
exec: (e) => (0, commands_1.toH6)(e.cm),
|
|
198
|
-
isActive: inactive,
|
|
199
|
-
isEnable: enable,
|
|
200
|
-
},
|
|
201
|
-
],
|
|
202
|
-
};
|
|
203
|
-
exports.mListsListConfig = {
|
|
204
|
-
icon: icons_1.icons.bulletList,
|
|
205
|
-
withArrow: true,
|
|
206
|
-
title: menubar_1.i18n.bind(null, 'list'),
|
|
207
|
-
data: [
|
|
208
|
-
{
|
|
209
|
-
id: action_names_1.ActionName.bulletList,
|
|
210
|
-
title: menubar_1.i18n.bind(null, 'ulist'),
|
|
211
|
-
icon: icons_1.icons.bulletList,
|
|
212
|
-
exec: (e) => (0, commands_1.toBulletList)(e.cm),
|
|
213
|
-
isActive: inactive,
|
|
214
|
-
isEnable: enable,
|
|
215
|
-
},
|
|
216
|
-
{
|
|
217
|
-
id: action_names_1.ActionName.orderedList,
|
|
218
|
-
title: menubar_1.i18n.bind(null, 'olist'),
|
|
219
|
-
icon: icons_1.icons.orderedList,
|
|
220
|
-
exec: (e) => (0, commands_1.toOrderedList)(e.cm),
|
|
221
|
-
isActive: inactive,
|
|
222
|
-
isEnable: enable,
|
|
223
|
-
},
|
|
224
|
-
],
|
|
225
|
-
};
|
|
226
98
|
exports.mCheckboxButton = {
|
|
227
99
|
id: action_names_1.ActionName.checkbox,
|
|
228
100
|
type: types_1.ToolbarDataType.SingleButton,
|
|
@@ -232,29 +104,7 @@ exports.mCheckboxButton = {
|
|
|
232
104
|
isActive: inactive,
|
|
233
105
|
isEnable: enable,
|
|
234
106
|
};
|
|
235
|
-
exports.
|
|
236
|
-
icon: icons_1.icons.lift,
|
|
237
|
-
withArrow: true,
|
|
238
|
-
title: 'Move list item',
|
|
239
|
-
data: [
|
|
240
|
-
{
|
|
241
|
-
id: action_names_1.ActionName.sinkListItem,
|
|
242
|
-
title: menubar_1.i18n.bind(null, 'list__action_sink'),
|
|
243
|
-
icon: icons_1.icons.sink,
|
|
244
|
-
exec: (e) => (0, commands_1.sinkListItem)(e.cm),
|
|
245
|
-
isActive: inactive,
|
|
246
|
-
isEnable: enable,
|
|
247
|
-
},
|
|
248
|
-
{
|
|
249
|
-
id: action_names_1.ActionName.liftListItem,
|
|
250
|
-
title: menubar_1.i18n.bind(null, 'list__action_lift'),
|
|
251
|
-
icon: icons_1.icons.lift,
|
|
252
|
-
exec: (e) => (0, commands_1.liftListItem)(e.cm),
|
|
253
|
-
isActive: inactive,
|
|
254
|
-
isEnable: enable,
|
|
255
|
-
},
|
|
256
|
-
],
|
|
257
|
-
};
|
|
107
|
+
exports.mCheckboxItemData = exports.mCheckboxButton;
|
|
258
108
|
exports.mLinkButton = {
|
|
259
109
|
id: action_names_1.ActionName.link,
|
|
260
110
|
type: types_1.ToolbarDataType.SingleButton,
|
|
@@ -264,16 +114,7 @@ exports.mLinkButton = {
|
|
|
264
114
|
isActive: inactive,
|
|
265
115
|
isEnable: enable,
|
|
266
116
|
};
|
|
267
|
-
exports.
|
|
268
|
-
id: action_names_1.ActionName.yfm_note,
|
|
269
|
-
type: types_1.ToolbarDataType.SingleButton,
|
|
270
|
-
title: menubar_1.i18n.bind(null, 'note'),
|
|
271
|
-
icon: icons_1.icons.note,
|
|
272
|
-
hotkey: shortcuts_1.formatter.toView(shortcuts_1.Action.Note),
|
|
273
|
-
exec: (e) => (0, commands_1.wrapToYfmNote)(e.cm),
|
|
274
|
-
isActive: inactive,
|
|
275
|
-
isEnable: enable,
|
|
276
|
-
};
|
|
117
|
+
exports.mLinkItemData = exports.mLinkButton;
|
|
277
118
|
exports.mQuoteButton = {
|
|
278
119
|
id: action_names_1.ActionName.quote,
|
|
279
120
|
type: types_1.ToolbarDataType.SingleButton,
|
|
@@ -283,6 +124,7 @@ exports.mQuoteButton = {
|
|
|
283
124
|
isActive: inactive,
|
|
284
125
|
isEnable: enable,
|
|
285
126
|
};
|
|
127
|
+
exports.mQuoteItemData = exports.mQuoteButton;
|
|
286
128
|
exports.mCutButton = {
|
|
287
129
|
id: action_names_1.ActionName.yfm_cut,
|
|
288
130
|
type: types_1.ToolbarDataType.SingleButton,
|
|
@@ -293,6 +135,18 @@ exports.mCutButton = {
|
|
|
293
135
|
isActive: inactive,
|
|
294
136
|
isEnable: enable,
|
|
295
137
|
};
|
|
138
|
+
exports.mCutItemData = exports.mCutButton;
|
|
139
|
+
exports.mNoteButton = {
|
|
140
|
+
id: action_names_1.ActionName.yfm_note,
|
|
141
|
+
type: types_1.ToolbarDataType.SingleButton,
|
|
142
|
+
title: menubar_1.i18n.bind(null, 'note'),
|
|
143
|
+
icon: icons_1.icons.note,
|
|
144
|
+
hotkey: shortcuts_1.formatter.toView(shortcuts_1.Action.Note),
|
|
145
|
+
exec: (e) => (0, commands_1.wrapToYfmNote)(e.cm),
|
|
146
|
+
isActive: inactive,
|
|
147
|
+
isEnable: enable,
|
|
148
|
+
};
|
|
149
|
+
exports.mNoteItemData = exports.mNoteButton;
|
|
296
150
|
exports.mTableButton = {
|
|
297
151
|
id: action_names_1.ActionName.table,
|
|
298
152
|
type: types_1.ToolbarDataType.SingleButton,
|
|
@@ -302,71 +156,13 @@ exports.mTableButton = {
|
|
|
302
156
|
isActive: inactive,
|
|
303
157
|
isEnable: enable,
|
|
304
158
|
};
|
|
305
|
-
exports.
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
hotkey: shortcuts_1.formatter.toView(shortcuts_1.Action.CodeBlock),
|
|
310
|
-
exec: (e) => (0, commands_1.wrapToCodeBlock)(e.cm),
|
|
311
|
-
isActive: inactive,
|
|
312
|
-
isEnable: enable,
|
|
313
|
-
};
|
|
314
|
-
exports.mCodeListConfig = {
|
|
159
|
+
exports.mTableItemData = exports.mTableButton;
|
|
160
|
+
exports.mCodeItemData = {
|
|
161
|
+
id: action_names_1.ActionName.code_inline,
|
|
162
|
+
title: menubar_1.i18n.bind(null, 'code_inline'),
|
|
315
163
|
icon: icons_1.icons.code,
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
data: [
|
|
319
|
-
{
|
|
320
|
-
id: action_names_1.ActionName.code_inline,
|
|
321
|
-
title: menubar_1.i18n.bind(null, 'code_inline'),
|
|
322
|
-
icon: icons_1.icons.code,
|
|
323
|
-
hotkey: shortcuts_1.formatter.toView(shortcuts_1.Action.Code),
|
|
324
|
-
exec: (e) => (0, commands_1.wrapToInlineCode)(e.cm),
|
|
325
|
-
isActive: inactive,
|
|
326
|
-
isEnable: enable,
|
|
327
|
-
},
|
|
328
|
-
exports.mCodeblockItemData,
|
|
329
|
-
],
|
|
330
|
-
};
|
|
331
|
-
exports.mMathListConfig = {
|
|
332
|
-
icon: icons_1.icons.functionInline,
|
|
333
|
-
withArrow: true,
|
|
334
|
-
title: menubar_1.i18n.bind(null, 'math'),
|
|
335
|
-
data: [
|
|
336
|
-
{
|
|
337
|
-
id: action_names_1.ActionName.math_inline,
|
|
338
|
-
title: menubar_1.i18n.bind(null, 'math_inline'),
|
|
339
|
-
icon: icons_1.icons.functionInline,
|
|
340
|
-
exec: (e) => (0, commands_1.wrapToMathInline)(e.cm),
|
|
341
|
-
isActive: inactive,
|
|
342
|
-
isEnable: enable,
|
|
343
|
-
},
|
|
344
|
-
{
|
|
345
|
-
id: action_names_1.ActionName.math_block,
|
|
346
|
-
title: menubar_1.i18n.bind(null, 'math_block'),
|
|
347
|
-
icon: icons_1.icons.functionBlock,
|
|
348
|
-
exec: (e) => (0, commands_1.wrapToMathBlock)(e.cm),
|
|
349
|
-
isActive: inactive,
|
|
350
|
-
isEnable: enable,
|
|
351
|
-
},
|
|
352
|
-
],
|
|
353
|
-
};
|
|
354
|
-
exports.mMathListItem = Object.assign({ id: 'math', type: types_1.ToolbarDataType.ListButton }, exports.mMathListConfig);
|
|
355
|
-
exports.mMermaidButton = {
|
|
356
|
-
id: action_names_1.ActionName.mermaid,
|
|
357
|
-
type: types_1.ToolbarDataType.SingleButton,
|
|
358
|
-
title: menubar_1.i18n.bind(null, 'mermaid'),
|
|
359
|
-
icon: icons_1.icons.mermaid,
|
|
360
|
-
exec: (e) => (0, commands_1.insertMermaidDiagram)(e.cm),
|
|
361
|
-
isActive: inactive,
|
|
362
|
-
isEnable: enable,
|
|
363
|
-
};
|
|
364
|
-
exports.mYfmHtmlBlockButton = {
|
|
365
|
-
id: action_names_1.ActionName.yfm_html_block,
|
|
366
|
-
type: types_1.ToolbarDataType.SingleButton,
|
|
367
|
-
title: menubar_1.i18n.bind(null, 'html'),
|
|
368
|
-
icon: icons_1.icons.html,
|
|
369
|
-
exec: (e) => (0, commands_1.insertYfmHtmlBlock)(e.cm),
|
|
164
|
+
hotkey: shortcuts_1.formatter.toView(shortcuts_1.Action.Code),
|
|
165
|
+
exec: (e) => (0, commands_1.wrapToInlineCode)(e.cm),
|
|
370
166
|
isActive: inactive,
|
|
371
167
|
isEnable: enable,
|
|
372
168
|
};
|
|
@@ -380,6 +176,7 @@ exports.mImagePopupData = {
|
|
|
380
176
|
isEnable: enable,
|
|
381
177
|
renderPopup: (props) => react_1.default.createElement(MToolbarImagePopup_1.MToolbarImagePopup, Object.assign({}, props)),
|
|
382
178
|
};
|
|
179
|
+
exports.mImageItemData = exports.mImagePopupData;
|
|
383
180
|
exports.mFilePopupData = {
|
|
384
181
|
id: 'file',
|
|
385
182
|
type: types_1.ToolbarDataType.ButtonPopup,
|
|
@@ -390,41 +187,62 @@ exports.mFilePopupData = {
|
|
|
390
187
|
isEnable: enable,
|
|
391
188
|
renderPopup: (props) => react_1.default.createElement(MToolbarFilePopup_1.MToolbarFilePopup, Object.assign({}, props)),
|
|
392
189
|
};
|
|
393
|
-
|
|
394
|
-
exports.
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
190
|
+
exports.mFileItemData = exports.mFilePopupData;
|
|
191
|
+
exports.mTabsItemData = {
|
|
192
|
+
id: 'tabs',
|
|
193
|
+
title: menubar_1.i18n.bind(null, 'tabs'),
|
|
194
|
+
icon: icons_1.icons.tabs,
|
|
195
|
+
type: types_1.ToolbarDataType.SingleButton,
|
|
196
|
+
exec: (e) => (0, commands_1.insertYfmTabs)(e.cm),
|
|
197
|
+
isActive: inactive,
|
|
198
|
+
isEnable: enable,
|
|
199
|
+
};
|
|
200
|
+
exports.mMathInlineItemData = {
|
|
201
|
+
id: action_names_1.ActionName.math_inline,
|
|
202
|
+
title: menubar_1.i18n.bind(null, 'math_inline'),
|
|
203
|
+
icon: icons_1.icons.functionInline,
|
|
204
|
+
exec: (e) => (0, commands_1.wrapToMathInline)(e.cm),
|
|
205
|
+
isActive: inactive,
|
|
206
|
+
isEnable: enable,
|
|
207
|
+
};
|
|
208
|
+
exports.mMathBlockItemData = {
|
|
209
|
+
id: action_names_1.ActionName.math_block,
|
|
210
|
+
title: menubar_1.i18n.bind(null, 'math_block'),
|
|
211
|
+
icon: icons_1.icons.functionBlock,
|
|
212
|
+
exec: (e) => (0, commands_1.wrapToMathBlock)(e.cm),
|
|
213
|
+
isActive: inactive,
|
|
214
|
+
isEnable: enable,
|
|
215
|
+
};
|
|
216
|
+
exports.mYfmHtmlBlockButton = {
|
|
217
|
+
id: action_names_1.ActionName.yfm_html_block,
|
|
218
|
+
type: types_1.ToolbarDataType.SingleButton,
|
|
219
|
+
title: menubar_1.i18n.bind(null, 'html'),
|
|
220
|
+
icon: icons_1.icons.html,
|
|
221
|
+
exec: (e) => (0, commands_1.insertYfmHtmlBlock)(e.cm),
|
|
222
|
+
isActive: inactive,
|
|
223
|
+
isEnable: enable,
|
|
224
|
+
};
|
|
225
|
+
exports.mYfmHtmlBlockItemData = exports.mYfmHtmlBlockButton;
|
|
226
|
+
exports.mMermaidButton = {
|
|
227
|
+
id: action_names_1.ActionName.mermaid,
|
|
228
|
+
type: types_1.ToolbarDataType.SingleButton,
|
|
229
|
+
title: menubar_1.i18n.bind(null, 'mermaid'),
|
|
230
|
+
icon: icons_1.icons.mermaid,
|
|
231
|
+
exec: (e) => (0, commands_1.insertMermaidDiagram)(e.cm),
|
|
232
|
+
isActive: inactive,
|
|
233
|
+
isEnable: enable,
|
|
234
|
+
};
|
|
235
|
+
exports.mMermaidItemData = exports.mMermaidButton;
|
|
236
|
+
exports.mCodeblockItemData = {
|
|
237
|
+
id: action_names_1.ActionName.code_block,
|
|
238
|
+
title: menubar_1.i18n.bind(null, 'codeblock'),
|
|
239
|
+
icon: icons_1.icons.codeBlock,
|
|
240
|
+
hotkey: shortcuts_1.formatter.toView(shortcuts_1.Action.CodeBlock),
|
|
241
|
+
exec: (e) => (0, commands_1.wrapToCodeBlock)(e.cm),
|
|
242
|
+
isActive: inactive,
|
|
243
|
+
isEnable: enable,
|
|
244
|
+
};
|
|
245
|
+
exports.mCodeBlockItemData = exports.mCodeblockItemData;
|
|
428
246
|
exports.mHruleItemData = {
|
|
429
247
|
id: 'hrule',
|
|
430
248
|
title: menubar_1.i18n.bind(null, 'hrule'),
|
|
@@ -444,42 +262,277 @@ exports.mEmojiItemData = {
|
|
|
444
262
|
isActive: inactive,
|
|
445
263
|
isEnable: disable,
|
|
446
264
|
};
|
|
447
|
-
exports.
|
|
448
|
-
id: '
|
|
449
|
-
|
|
450
|
-
icon: icons_1.icons.
|
|
451
|
-
|
|
452
|
-
|
|
265
|
+
exports.mMathListItem = {
|
|
266
|
+
id: 'math',
|
|
267
|
+
type: types_1.ToolbarDataType.ListButton,
|
|
268
|
+
icon: icons_1.icons.functionInline,
|
|
269
|
+
withArrow: true,
|
|
270
|
+
title: menubar_1.i18n.bind(null, 'math'),
|
|
271
|
+
data: [exports.mMathInlineItemData, exports.mMathBlockItemData],
|
|
272
|
+
};
|
|
273
|
+
exports.mHeading1ItemData = {
|
|
274
|
+
id: action_names_1.ActionName.heading1,
|
|
275
|
+
title: menubar_1.i18n.bind(null, 'heading1'),
|
|
276
|
+
icon: icons_1.icons.h1,
|
|
277
|
+
hotkey: shortcuts_1.formatter.toView(shortcuts_1.Action.Heading1),
|
|
278
|
+
exec: (e) => (0, commands_1.toH1)(e.cm),
|
|
279
|
+
isActive: inactive,
|
|
280
|
+
isEnable: enable,
|
|
281
|
+
};
|
|
282
|
+
exports.mHeading2ItemData = {
|
|
283
|
+
id: action_names_1.ActionName.heading2,
|
|
284
|
+
title: menubar_1.i18n.bind(null, 'heading2'),
|
|
285
|
+
icon: icons_1.icons.h2,
|
|
286
|
+
hotkey: shortcuts_1.formatter.toView(shortcuts_1.Action.Heading2),
|
|
287
|
+
exec: (e) => (0, commands_1.toH2)(e.cm),
|
|
288
|
+
isActive: inactive,
|
|
289
|
+
isEnable: enable,
|
|
290
|
+
};
|
|
291
|
+
exports.mHeading3ItemData = {
|
|
292
|
+
id: action_names_1.ActionName.heading3,
|
|
293
|
+
title: menubar_1.i18n.bind(null, 'heading3'),
|
|
294
|
+
icon: icons_1.icons.h3,
|
|
295
|
+
hotkey: shortcuts_1.formatter.toView(shortcuts_1.Action.Heading3),
|
|
296
|
+
exec: (e) => (0, commands_1.toH3)(e.cm),
|
|
297
|
+
isActive: inactive,
|
|
298
|
+
isEnable: enable,
|
|
299
|
+
};
|
|
300
|
+
exports.mHeading4ItemData = {
|
|
301
|
+
id: action_names_1.ActionName.heading4,
|
|
302
|
+
title: menubar_1.i18n.bind(null, 'heading4'),
|
|
303
|
+
icon: icons_1.icons.h4,
|
|
304
|
+
hotkey: shortcuts_1.formatter.toView(shortcuts_1.Action.Heading4),
|
|
305
|
+
exec: (e) => (0, commands_1.toH4)(e.cm),
|
|
306
|
+
isActive: inactive,
|
|
307
|
+
isEnable: enable,
|
|
308
|
+
};
|
|
309
|
+
exports.mHeading5ItemData = {
|
|
310
|
+
id: action_names_1.ActionName.heading5,
|
|
311
|
+
title: menubar_1.i18n.bind(null, 'heading5'),
|
|
312
|
+
icon: icons_1.icons.h5,
|
|
313
|
+
hotkey: shortcuts_1.formatter.toView(shortcuts_1.Action.Heading5),
|
|
314
|
+
exec: (e) => (0, commands_1.toH5)(e.cm),
|
|
315
|
+
isActive: inactive,
|
|
316
|
+
isEnable: enable,
|
|
317
|
+
};
|
|
318
|
+
exports.mHeading6ItemData = {
|
|
319
|
+
id: action_names_1.ActionName.heading6,
|
|
320
|
+
title: menubar_1.i18n.bind(null, 'heading6'),
|
|
321
|
+
icon: icons_1.icons.h6,
|
|
322
|
+
hotkey: shortcuts_1.formatter.toView(shortcuts_1.Action.Heading6),
|
|
323
|
+
exec: (e) => (0, commands_1.toH6)(e.cm),
|
|
324
|
+
isActive: inactive,
|
|
325
|
+
isEnable: enable,
|
|
326
|
+
};
|
|
327
|
+
exports.mBulletListItemData = {
|
|
328
|
+
id: action_names_1.ActionName.bulletList,
|
|
329
|
+
title: menubar_1.i18n.bind(null, 'ulist'),
|
|
330
|
+
icon: icons_1.icons.bulletList,
|
|
331
|
+
exec: (e) => (0, commands_1.toBulletList)(e.cm),
|
|
332
|
+
isActive: inactive,
|
|
333
|
+
isEnable: enable,
|
|
334
|
+
};
|
|
335
|
+
exports.mOrderedListItemData = {
|
|
336
|
+
id: action_names_1.ActionName.orderedList,
|
|
337
|
+
title: menubar_1.i18n.bind(null, 'olist'),
|
|
338
|
+
icon: icons_1.icons.orderedList,
|
|
339
|
+
exec: (e) => (0, commands_1.toOrderedList)(e.cm),
|
|
340
|
+
isActive: inactive,
|
|
341
|
+
isEnable: enable,
|
|
342
|
+
};
|
|
343
|
+
exports.mSinkListItemData = {
|
|
344
|
+
id: action_names_1.ActionName.sinkListItem,
|
|
345
|
+
title: menubar_1.i18n.bind(null, 'list__action_sink'),
|
|
346
|
+
icon: icons_1.icons.sink,
|
|
347
|
+
exec: (e) => (0, commands_1.sinkListItem)(e.cm),
|
|
453
348
|
isActive: inactive,
|
|
454
349
|
isEnable: enable,
|
|
455
350
|
};
|
|
351
|
+
exports.mLiftListItemData = {
|
|
352
|
+
id: action_names_1.ActionName.liftListItem,
|
|
353
|
+
title: menubar_1.i18n.bind(null, 'list__action_lift'),
|
|
354
|
+
icon: icons_1.icons.lift,
|
|
355
|
+
exec: (e) => (0, commands_1.liftListItem)(e.cm),
|
|
356
|
+
isActive: inactive,
|
|
357
|
+
isEnable: enable,
|
|
358
|
+
};
|
|
359
|
+
exports.mHeadingListConfig = {
|
|
360
|
+
icon: icons_1.icons.headline,
|
|
361
|
+
withArrow: true,
|
|
362
|
+
title: menubar_1.i18n.bind(null, 'heading'),
|
|
363
|
+
data: [
|
|
364
|
+
exports.mHeading1ItemData,
|
|
365
|
+
exports.mHeading2ItemData,
|
|
366
|
+
exports.mHeading3ItemData,
|
|
367
|
+
exports.mHeading4ItemData,
|
|
368
|
+
exports.mHeading5ItemData,
|
|
369
|
+
exports.mHeading6ItemData,
|
|
370
|
+
],
|
|
371
|
+
};
|
|
372
|
+
exports.mListsListConfig = {
|
|
373
|
+
icon: icons_1.icons.bulletList,
|
|
374
|
+
withArrow: true,
|
|
375
|
+
title: menubar_1.i18n.bind(null, 'list'),
|
|
376
|
+
data: [exports.mBulletListItemData, exports.mOrderedListItemData],
|
|
377
|
+
};
|
|
378
|
+
exports.mListMoveListConfig = {
|
|
379
|
+
icon: icons_1.icons.lift,
|
|
380
|
+
withArrow: true,
|
|
381
|
+
title: 'Move list item',
|
|
382
|
+
data: [exports.mSinkListItemData, exports.mLiftListItemData],
|
|
383
|
+
};
|
|
384
|
+
exports.mCodeListConfig = {
|
|
385
|
+
icon: icons_1.icons.code,
|
|
386
|
+
withArrow: true,
|
|
387
|
+
title: menubar_1.i18n.bind(null, 'code'),
|
|
388
|
+
data: [exports.mCodeItemData, exports.mCodeblockItemData],
|
|
389
|
+
};
|
|
390
|
+
exports.mMathListConfig = {
|
|
391
|
+
icon: icons_1.icons.functionInline,
|
|
392
|
+
withArrow: true,
|
|
393
|
+
title: menubar_1.i18n.bind(null, 'math'),
|
|
394
|
+
data: [exports.mMathInlineItemData, exports.mMathBlockItemData],
|
|
395
|
+
};
|
|
456
396
|
exports.mHiddenData = [exports.mHruleItemData, exports.mEmojiItemData, exports.mTabsItemData];
|
|
397
|
+
exports.mHistoryGroupConfig = [exports.mUndoItemData, exports.mRedoItemData];
|
|
398
|
+
exports.mBiusGroupConfig = [
|
|
399
|
+
exports.mBoldItemData,
|
|
400
|
+
exports.mItalicItemData,
|
|
401
|
+
exports.mUnderlineItemData,
|
|
402
|
+
exports.mStrikethroughItemData,
|
|
403
|
+
exports.mMonospaceItemData,
|
|
404
|
+
exports.mMarkedItemData,
|
|
405
|
+
];
|
|
406
|
+
exports.mToolbarConfig = [
|
|
407
|
+
[exports.mUndoItemData, exports.mRedoItemData],
|
|
408
|
+
exports.mBiusGroupConfig,
|
|
409
|
+
[
|
|
410
|
+
{
|
|
411
|
+
id: 'heading',
|
|
412
|
+
type: types_1.ToolbarDataType.ListButton,
|
|
413
|
+
icon: icons_1.icons.headline,
|
|
414
|
+
withArrow: true,
|
|
415
|
+
title: menubar_1.i18n.bind(null, 'heading'),
|
|
416
|
+
data: [
|
|
417
|
+
exports.mHeading1ItemData,
|
|
418
|
+
exports.mHeading2ItemData,
|
|
419
|
+
exports.mHeading3ItemData,
|
|
420
|
+
exports.mHeading4ItemData,
|
|
421
|
+
exports.mHeading5ItemData,
|
|
422
|
+
exports.mHeading6ItemData,
|
|
423
|
+
],
|
|
424
|
+
},
|
|
425
|
+
{
|
|
426
|
+
id: 'list',
|
|
427
|
+
type: types_1.ToolbarDataType.ListButton,
|
|
428
|
+
icon: icons_1.icons.bulletList,
|
|
429
|
+
withArrow: true,
|
|
430
|
+
title: menubar_1.i18n.bind(null, 'list'),
|
|
431
|
+
data: [exports.mBulletListItemData, exports.mOrderedListItemData],
|
|
432
|
+
},
|
|
433
|
+
{
|
|
434
|
+
id: 'colorify',
|
|
435
|
+
type: types_1.ToolbarDataType.ReactComponent,
|
|
436
|
+
component: MToolbarColors_1.MToolbarColors,
|
|
437
|
+
width: 42,
|
|
438
|
+
},
|
|
439
|
+
exports.mLinkButton,
|
|
440
|
+
exports.mNoteButton,
|
|
441
|
+
exports.mCutButton,
|
|
442
|
+
exports.mQuoteButton,
|
|
443
|
+
{
|
|
444
|
+
id: 'code',
|
|
445
|
+
type: types_1.ToolbarDataType.ListButton,
|
|
446
|
+
icon: icons_1.icons.code,
|
|
447
|
+
withArrow: true,
|
|
448
|
+
title: menubar_1.i18n.bind(null, 'code'),
|
|
449
|
+
data: [exports.mCodeItemData, exports.mCodeblockItemData],
|
|
450
|
+
},
|
|
451
|
+
],
|
|
452
|
+
[exports.mImagePopupData, exports.mFilePopupData, exports.mTableButton, exports.mCheckboxButton],
|
|
453
|
+
];
|
|
457
454
|
exports.mToolbarConfigByPreset = {
|
|
458
455
|
zero: [exports.mHistoryGroupConfig],
|
|
459
456
|
commonmark: [
|
|
460
|
-
exports.
|
|
457
|
+
[exports.mUndoItemData, exports.mRedoItemData],
|
|
461
458
|
[exports.mBoldItemData, exports.mItalicItemData],
|
|
462
459
|
[
|
|
463
|
-
|
|
464
|
-
|
|
460
|
+
{
|
|
461
|
+
id: 'heading',
|
|
462
|
+
type: types_1.ToolbarDataType.ListButton,
|
|
463
|
+
icon: icons_1.icons.headline,
|
|
464
|
+
withArrow: true,
|
|
465
|
+
title: menubar_1.i18n.bind(null, 'heading'),
|
|
466
|
+
data: [
|
|
467
|
+
exports.mHeading1ItemData,
|
|
468
|
+
exports.mHeading2ItemData,
|
|
469
|
+
exports.mHeading3ItemData,
|
|
470
|
+
exports.mHeading4ItemData,
|
|
471
|
+
exports.mHeading5ItemData,
|
|
472
|
+
exports.mHeading6ItemData,
|
|
473
|
+
],
|
|
474
|
+
},
|
|
475
|
+
{
|
|
476
|
+
id: 'list',
|
|
477
|
+
type: types_1.ToolbarDataType.ListButton,
|
|
478
|
+
icon: icons_1.icons.bulletList,
|
|
479
|
+
withArrow: true,
|
|
480
|
+
title: menubar_1.i18n.bind(null, 'list'),
|
|
481
|
+
data: [exports.mBulletListItemData, exports.mOrderedListItemData],
|
|
482
|
+
},
|
|
465
483
|
exports.mLinkButton,
|
|
466
484
|
exports.mQuoteButton,
|
|
467
|
-
|
|
485
|
+
{
|
|
486
|
+
id: 'code',
|
|
487
|
+
type: types_1.ToolbarDataType.ListButton,
|
|
488
|
+
icon: icons_1.icons.code,
|
|
489
|
+
withArrow: true,
|
|
490
|
+
title: menubar_1.i18n.bind(null, 'code'),
|
|
491
|
+
data: [exports.mCodeItemData, exports.mCodeblockItemData],
|
|
492
|
+
},
|
|
468
493
|
],
|
|
469
494
|
],
|
|
470
495
|
default: [
|
|
471
|
-
exports.
|
|
496
|
+
[exports.mUndoItemData, exports.mRedoItemData],
|
|
472
497
|
[exports.mBoldItemData, exports.mItalicItemData, exports.mStrikethroughItemData],
|
|
473
498
|
[
|
|
474
|
-
|
|
475
|
-
|
|
499
|
+
{
|
|
500
|
+
id: 'heading',
|
|
501
|
+
type: types_1.ToolbarDataType.ListButton,
|
|
502
|
+
icon: icons_1.icons.headline,
|
|
503
|
+
withArrow: true,
|
|
504
|
+
title: menubar_1.i18n.bind(null, 'heading'),
|
|
505
|
+
data: [
|
|
506
|
+
exports.mHeading1ItemData,
|
|
507
|
+
exports.mHeading2ItemData,
|
|
508
|
+
exports.mHeading3ItemData,
|
|
509
|
+
exports.mHeading4ItemData,
|
|
510
|
+
exports.mHeading5ItemData,
|
|
511
|
+
exports.mHeading6ItemData,
|
|
512
|
+
],
|
|
513
|
+
},
|
|
514
|
+
{
|
|
515
|
+
id: 'list',
|
|
516
|
+
type: types_1.ToolbarDataType.ListButton,
|
|
517
|
+
icon: icons_1.icons.bulletList,
|
|
518
|
+
withArrow: true,
|
|
519
|
+
title: menubar_1.i18n.bind(null, 'list'),
|
|
520
|
+
data: [exports.mBulletListItemData, exports.mOrderedListItemData],
|
|
521
|
+
},
|
|
476
522
|
exports.mLinkButton,
|
|
477
523
|
exports.mQuoteButton,
|
|
478
|
-
|
|
524
|
+
{
|
|
525
|
+
id: 'code',
|
|
526
|
+
type: types_1.ToolbarDataType.ListButton,
|
|
527
|
+
icon: icons_1.icons.code,
|
|
528
|
+
withArrow: true,
|
|
529
|
+
title: menubar_1.i18n.bind(null, 'code'),
|
|
530
|
+
data: [exports.mCodeItemData, exports.mCodeblockItemData],
|
|
531
|
+
},
|
|
479
532
|
],
|
|
480
533
|
],
|
|
481
534
|
yfm: [
|
|
482
|
-
exports.
|
|
535
|
+
[exports.mUndoItemData, exports.mRedoItemData],
|
|
483
536
|
[
|
|
484
537
|
exports.mBoldItemData,
|
|
485
538
|
exports.mItalicItemData,
|
|
@@ -488,13 +541,41 @@ exports.mToolbarConfigByPreset = {
|
|
|
488
541
|
exports.mMonospaceItemData,
|
|
489
542
|
],
|
|
490
543
|
[
|
|
491
|
-
|
|
492
|
-
|
|
544
|
+
{
|
|
545
|
+
id: 'heading',
|
|
546
|
+
type: types_1.ToolbarDataType.ListButton,
|
|
547
|
+
icon: icons_1.icons.headline,
|
|
548
|
+
withArrow: true,
|
|
549
|
+
title: menubar_1.i18n.bind(null, 'heading'),
|
|
550
|
+
data: [
|
|
551
|
+
exports.mHeading1ItemData,
|
|
552
|
+
exports.mHeading2ItemData,
|
|
553
|
+
exports.mHeading3ItemData,
|
|
554
|
+
exports.mHeading4ItemData,
|
|
555
|
+
exports.mHeading5ItemData,
|
|
556
|
+
exports.mHeading6ItemData,
|
|
557
|
+
],
|
|
558
|
+
},
|
|
559
|
+
{
|
|
560
|
+
id: 'list',
|
|
561
|
+
type: types_1.ToolbarDataType.ListButton,
|
|
562
|
+
icon: icons_1.icons.bulletList,
|
|
563
|
+
withArrow: true,
|
|
564
|
+
title: menubar_1.i18n.bind(null, 'list'),
|
|
565
|
+
data: [exports.mBulletListItemData, exports.mOrderedListItemData],
|
|
566
|
+
},
|
|
493
567
|
exports.mLinkButton,
|
|
494
568
|
exports.mNoteButton,
|
|
495
569
|
exports.mCutButton,
|
|
496
570
|
exports.mQuoteButton,
|
|
497
|
-
|
|
571
|
+
{
|
|
572
|
+
id: 'code',
|
|
573
|
+
type: types_1.ToolbarDataType.ListButton,
|
|
574
|
+
icon: icons_1.icons.code,
|
|
575
|
+
withArrow: true,
|
|
576
|
+
title: menubar_1.i18n.bind(null, 'code'),
|
|
577
|
+
data: [exports.mCodeItemData, exports.mCodeblockItemData],
|
|
578
|
+
},
|
|
498
579
|
],
|
|
499
580
|
[exports.mImagePopupData, exports.mFilePopupData, exports.mTableButton, exports.mCheckboxButton],
|
|
500
581
|
],
|
|
@@ -503,24 +584,42 @@ exports.mToolbarConfigByPreset = {
|
|
|
503
584
|
exports.mHiddenDataByPreset = {
|
|
504
585
|
zero: [],
|
|
505
586
|
commonmark: [
|
|
506
|
-
|
|
507
|
-
|
|
587
|
+
exports.mHeading1ItemData,
|
|
588
|
+
exports.mHeading2ItemData,
|
|
589
|
+
exports.mHeading3ItemData,
|
|
590
|
+
exports.mHeading4ItemData,
|
|
591
|
+
exports.mHeading5ItemData,
|
|
592
|
+
exports.mHeading6ItemData,
|
|
593
|
+
exports.mBulletListItemData,
|
|
594
|
+
exports.mOrderedListItemData,
|
|
508
595
|
exports.mLinkButton,
|
|
509
596
|
exports.mQuoteButton,
|
|
510
597
|
exports.mCodeblockItemData,
|
|
511
598
|
exports.mHruleItemData,
|
|
512
599
|
],
|
|
513
600
|
default: [
|
|
514
|
-
|
|
515
|
-
|
|
601
|
+
exports.mHeading1ItemData,
|
|
602
|
+
exports.mHeading2ItemData,
|
|
603
|
+
exports.mHeading3ItemData,
|
|
604
|
+
exports.mHeading4ItemData,
|
|
605
|
+
exports.mHeading5ItemData,
|
|
606
|
+
exports.mHeading6ItemData,
|
|
607
|
+
exports.mBulletListItemData,
|
|
608
|
+
exports.mOrderedListItemData,
|
|
516
609
|
exports.mLinkButton,
|
|
517
610
|
exports.mQuoteButton,
|
|
518
611
|
exports.mCodeblockItemData,
|
|
519
612
|
exports.mHruleItemData,
|
|
520
613
|
],
|
|
521
614
|
yfm: [
|
|
522
|
-
|
|
523
|
-
|
|
615
|
+
exports.mHeading1ItemData,
|
|
616
|
+
exports.mHeading2ItemData,
|
|
617
|
+
exports.mHeading3ItemData,
|
|
618
|
+
exports.mHeading4ItemData,
|
|
619
|
+
exports.mHeading5ItemData,
|
|
620
|
+
exports.mHeading6ItemData,
|
|
621
|
+
exports.mBulletListItemData,
|
|
622
|
+
exports.mOrderedListItemData,
|
|
524
623
|
exports.mLinkButton,
|
|
525
624
|
exports.mQuoteButton,
|
|
526
625
|
exports.mNoteButton,
|
|
@@ -534,8 +633,14 @@ exports.mHiddenDataByPreset = {
|
|
|
534
633
|
exports.mTabsItemData,
|
|
535
634
|
],
|
|
536
635
|
full: [
|
|
537
|
-
|
|
538
|
-
|
|
636
|
+
exports.mHeading1ItemData,
|
|
637
|
+
exports.mHeading2ItemData,
|
|
638
|
+
exports.mHeading3ItemData,
|
|
639
|
+
exports.mHeading4ItemData,
|
|
640
|
+
exports.mHeading5ItemData,
|
|
641
|
+
exports.mHeading6ItemData,
|
|
642
|
+
exports.mBulletListItemData,
|
|
643
|
+
exports.mOrderedListItemData,
|
|
539
644
|
exports.mLinkButton,
|
|
540
645
|
exports.mQuoteButton,
|
|
541
646
|
exports.mNoteButton,
|