x-star-editor 0.2.1 → 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/dist/components/FileInput.js +2 -2
- package/dist/components/Toolbar.js +184 -44
- package/dist/icons/Blockquote.d.ts +4 -0
- package/dist/icons/Blockquote.js +16 -0
- package/dist/icons/Code.d.ts +4 -0
- package/dist/icons/Code.js +15 -0
- package/dist/icons/Delete.d.ts +4 -0
- package/dist/icons/Delete.js +15 -0
- package/dist/icons/Emphasis.d.ts +4 -0
- package/dist/icons/Emphasis.js +15 -0
- package/dist/icons/EnterFullscreen.d.ts +4 -0
- package/dist/icons/EnterFullscreen.js +15 -0
- package/dist/icons/ExitFullscreen.d.ts +4 -0
- package/dist/icons/ExitFullscreen.js +15 -0
- package/dist/icons/Heading.d.ts +4 -0
- package/dist/icons/Heading.js +15 -0
- package/dist/icons/Image.d.ts +4 -0
- package/dist/icons/Image.js +15 -0
- package/dist/icons/InlineCode.d.ts +4 -0
- package/dist/icons/InlineCode.js +19 -0
- package/dist/icons/InlineMath.d.ts +4 -0
- package/dist/icons/InlineMath.js +25 -0
- package/dist/icons/Link.d.ts +4 -0
- package/dist/icons/Link.js +15 -0
- package/dist/icons/Math.d.ts +4 -0
- package/dist/icons/Math.js +15 -0
- package/dist/icons/OrderedList.d.ts +4 -0
- package/dist/icons/OrderedList.js +15 -0
- package/dist/icons/Redo.d.ts +4 -0
- package/dist/icons/Redo.js +15 -0
- package/dist/icons/Strong.d.ts +4 -0
- package/dist/icons/Strong.js +15 -0
- package/dist/icons/Table.d.ts +4 -0
- package/dist/icons/Table.js +15 -0
- package/dist/icons/ThematicBreak.d.ts +4 -0
- package/dist/icons/ThematicBreak.js +15 -0
- package/dist/icons/ToHtml.d.ts +4 -0
- package/dist/icons/ToHtml.js +15 -0
- package/dist/icons/ToMarkdown.d.ts +4 -0
- package/dist/icons/ToMarkdown.js +15 -0
- package/dist/icons/Undo.d.ts +4 -0
- package/dist/icons/Undo.js +15 -0
- package/dist/icons/UnorderedList.d.ts +4 -0
- package/dist/icons/UnorderedList.js +15 -0
- package/dist/locales/en_US.d.ts +7 -0
- package/dist/locales/en_US.js +8 -1
- package/dist/locales/index.d.ts +28 -0
- package/dist/locales/zh_CN.d.ts +7 -0
- package/dist/locales/zh_CN.js +8 -1
- package/dist/styles/index.css +8 -48
- package/dist/utils/container.d.ts +2 -3
- package/dist/utils/container.js +2 -7
- package/dist/utils/markdown.d.ts +6 -6
- package/dist/utils/markdown.js +147 -50
- package/dist/x-star-editor/index.d.ts +3 -2
- package/dist/x-star-editor/index.js +12 -6
- package/dist/x-star-md-editor/index.js +4 -3
- package/dist/x-star-md-viewer/index.d.ts +1 -1
- package/dist/x-star-md-viewer/index.js +44 -14
- package/package.json +9 -5
- package/dist/styles/icons/blockquote.svg +0 -18
- package/dist/styles/icons/code.svg +0 -18
- package/dist/styles/icons/delete.svg +0 -18
- package/dist/styles/icons/emphasis.svg +0 -18
- package/dist/styles/icons/heading.svg +0 -16
- package/dist/styles/icons/image.svg +0 -18
- package/dist/styles/icons/inline-code.svg +0 -19
- package/dist/styles/icons/inline-math.svg +0 -20
- package/dist/styles/icons/link.svg +0 -18
- package/dist/styles/icons/math.svg +0 -17
- package/dist/styles/icons/redo.svg +0 -18
- package/dist/styles/icons/strong.svg +0 -18
- package/dist/styles/icons/thematic-break.svg +0 -18
- package/dist/styles/icons/undo.svg +0 -18
|
@@ -19,7 +19,7 @@ var FileInput = function FileInput(_ref) {
|
|
|
19
19
|
var _useState5 = useState(''),
|
|
20
20
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
21
21
|
url = _useState6[0],
|
|
22
|
-
|
|
22
|
+
setURL = _useState6[1];
|
|
23
23
|
var _useState7 = useState(''),
|
|
24
24
|
_useState8 = _slicedToArray(_useState7, 2),
|
|
25
25
|
description = _useState8[0],
|
|
@@ -63,7 +63,7 @@ var FileInput = function FileInput(_ref) {
|
|
|
63
63
|
}, t('url'), /*#__PURE__*/React.createElement("input", {
|
|
64
64
|
className: classNames("".concat(prefix, "input")),
|
|
65
65
|
onChange: function onChange(e) {
|
|
66
|
-
return
|
|
66
|
+
return setURL(e.target.value);
|
|
67
67
|
}
|
|
68
68
|
})), /*#__PURE__*/React.createElement("label", {
|
|
69
69
|
className: classNames("".concat(prefix, "field"))
|
|
@@ -1,10 +1,35 @@
|
|
|
1
|
+
import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
|
|
2
|
+
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
1
3
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
4
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
3
5
|
import classNames from 'classnames';
|
|
4
6
|
import React, { useEffect, useRef, useState } from 'react';
|
|
7
|
+
import SvgBlockquote from "../icons/Blockquote";
|
|
8
|
+
import SvgCode from "../icons/Code";
|
|
9
|
+
import SvgDelete from "../icons/Delete";
|
|
10
|
+
import SvgEmphasis from "../icons/Emphasis";
|
|
11
|
+
import SvgEnterFullscreen from "../icons/EnterFullscreen";
|
|
12
|
+
import SvgExitFullscreen from "../icons/ExitFullscreen";
|
|
13
|
+
import SvgHeading from "../icons/Heading";
|
|
14
|
+
import SvgImage from "../icons/Image";
|
|
15
|
+
import SvgInlineCode from "../icons/InlineCode";
|
|
16
|
+
import SvgInlineMath from "../icons/InlineMath";
|
|
17
|
+
import SvgLink from "../icons/Link";
|
|
18
|
+
import SvgMath from "../icons/Math";
|
|
19
|
+
import SvgOrderedList from "../icons/OrderedList";
|
|
20
|
+
import SvgRedo from "../icons/Redo";
|
|
21
|
+
import SvgStrong from "../icons/Strong";
|
|
22
|
+
import SvgTable from "../icons/Table";
|
|
23
|
+
import SvgThematicBreak from "../icons/ThematicBreak";
|
|
24
|
+
import SvgToHTML from "../icons/ToHtml";
|
|
25
|
+
import SvgToMarkdown from "../icons/ToMarkdown";
|
|
26
|
+
import SvgUndo from "../icons/Undo";
|
|
27
|
+
import SvgUnorderedList from "../icons/UnorderedList";
|
|
5
28
|
import { getFormat } from "../locales";
|
|
29
|
+
import { createSelection } from "../utils/container";
|
|
6
30
|
import { prefix } from "../utils/global";
|
|
7
31
|
import { redoHandler, toggleHandler, undoHandler } from "../utils/handler";
|
|
32
|
+
import { toHTML, toMarkdown } from "../utils/markdown";
|
|
8
33
|
import Fade from "./Fade";
|
|
9
34
|
import FileInput from "./FileInput";
|
|
10
35
|
var Button = function Button(_ref) {
|
|
@@ -86,14 +111,14 @@ var Button = function Button(_ref) {
|
|
|
86
111
|
}, popover)));
|
|
87
112
|
};
|
|
88
113
|
export var getDefaultToolbarItemMap = function getDefaultToolbarItemMap() {
|
|
114
|
+
var _SvgEnterFullscreen, _t;
|
|
89
115
|
var locale = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
90
116
|
var onInsertFile = arguments.length > 1 ? arguments[1] : undefined;
|
|
91
|
-
var iconPrefix = "".concat(prefix, "icon-");
|
|
92
117
|
var t = getFormat(locale, 'toolbarItem');
|
|
93
118
|
return {
|
|
94
119
|
blockquote: {
|
|
95
|
-
children: /*#__PURE__*/React.createElement(
|
|
96
|
-
className: classNames("".concat(prefix, "icon")
|
|
120
|
+
children: /*#__PURE__*/React.createElement(SvgBlockquote, {
|
|
121
|
+
className: classNames("".concat(prefix, "icon"))
|
|
97
122
|
}),
|
|
98
123
|
tooltip: t('blockquote'),
|
|
99
124
|
onClick: function onClick(exec) {
|
|
@@ -103,8 +128,8 @@ export var getDefaultToolbarItemMap = function getDefaultToolbarItemMap() {
|
|
|
103
128
|
}
|
|
104
129
|
},
|
|
105
130
|
code: {
|
|
106
|
-
children: /*#__PURE__*/React.createElement(
|
|
107
|
-
className: classNames("".concat(prefix, "icon")
|
|
131
|
+
children: /*#__PURE__*/React.createElement(SvgCode, {
|
|
132
|
+
className: classNames("".concat(prefix, "icon"))
|
|
108
133
|
}),
|
|
109
134
|
tooltip: t('code'),
|
|
110
135
|
popoverRender: function popoverRender(exec, close) {
|
|
@@ -124,8 +149,8 @@ export var getDefaultToolbarItemMap = function getDefaultToolbarItemMap() {
|
|
|
124
149
|
}
|
|
125
150
|
},
|
|
126
151
|
delete: {
|
|
127
|
-
children: /*#__PURE__*/React.createElement(
|
|
128
|
-
className: classNames("".concat(prefix, "icon")
|
|
152
|
+
children: /*#__PURE__*/React.createElement(SvgDelete, {
|
|
153
|
+
className: classNames("".concat(prefix, "icon"))
|
|
129
154
|
}),
|
|
130
155
|
tooltip: t('delete'),
|
|
131
156
|
onClick: function onClick(exec) {
|
|
@@ -135,8 +160,8 @@ export var getDefaultToolbarItemMap = function getDefaultToolbarItemMap() {
|
|
|
135
160
|
}
|
|
136
161
|
},
|
|
137
162
|
emphasis: {
|
|
138
|
-
children: /*#__PURE__*/React.createElement(
|
|
139
|
-
className: classNames("".concat(prefix, "icon")
|
|
163
|
+
children: /*#__PURE__*/React.createElement(SvgEmphasis, {
|
|
164
|
+
className: classNames("".concat(prefix, "icon"))
|
|
140
165
|
}),
|
|
141
166
|
tooltip: t('emphasis'),
|
|
142
167
|
onClick: function onClick(exec) {
|
|
@@ -145,9 +170,17 @@ export var getDefaultToolbarItemMap = function getDefaultToolbarItemMap() {
|
|
|
145
170
|
}));
|
|
146
171
|
}
|
|
147
172
|
},
|
|
173
|
+
fullscreen: {
|
|
174
|
+
children: (_SvgEnterFullscreen = /*#__PURE__*/React.createElement(SvgEnterFullscreen, {
|
|
175
|
+
className: classNames("".concat(prefix, "icon"))
|
|
176
|
+
})) !== null && _SvgEnterFullscreen !== void 0 ? _SvgEnterFullscreen : /*#__PURE__*/React.createElement(SvgExitFullscreen, {
|
|
177
|
+
className: classNames("".concat(prefix, "icon"))
|
|
178
|
+
}),
|
|
179
|
+
tooltip: (_t = t('enterFullscreen')) !== null && _t !== void 0 ? _t : t('exitFullscreen')
|
|
180
|
+
},
|
|
148
181
|
heading: {
|
|
149
|
-
children: /*#__PURE__*/React.createElement(
|
|
150
|
-
className: classNames("".concat(prefix, "icon")
|
|
182
|
+
children: /*#__PURE__*/React.createElement(SvgHeading, {
|
|
183
|
+
className: classNames("".concat(prefix, "icon"))
|
|
151
184
|
}),
|
|
152
185
|
tooltip: t('heading'),
|
|
153
186
|
popoverRender: function popoverRender(exec, close) {
|
|
@@ -170,8 +203,8 @@ export var getDefaultToolbarItemMap = function getDefaultToolbarItemMap() {
|
|
|
170
203
|
}
|
|
171
204
|
},
|
|
172
205
|
image: {
|
|
173
|
-
children: /*#__PURE__*/React.createElement(
|
|
174
|
-
className: classNames("".concat(prefix, "icon")
|
|
206
|
+
children: /*#__PURE__*/React.createElement(SvgImage, {
|
|
207
|
+
className: classNames("".concat(prefix, "icon"))
|
|
175
208
|
}),
|
|
176
209
|
tooltip: t('image'),
|
|
177
210
|
popoverRender: function popoverRender(exec, close) {
|
|
@@ -196,8 +229,8 @@ export var getDefaultToolbarItemMap = function getDefaultToolbarItemMap() {
|
|
|
196
229
|
}
|
|
197
230
|
},
|
|
198
231
|
inlineCode: {
|
|
199
|
-
children: /*#__PURE__*/React.createElement(
|
|
200
|
-
className: classNames("".concat(prefix, "icon")
|
|
232
|
+
children: /*#__PURE__*/React.createElement(SvgInlineCode, {
|
|
233
|
+
className: classNames("".concat(prefix, "icon"))
|
|
201
234
|
}),
|
|
202
235
|
tooltip: t('inlineCode'),
|
|
203
236
|
onClick: function onClick(exec) {
|
|
@@ -207,8 +240,8 @@ export var getDefaultToolbarItemMap = function getDefaultToolbarItemMap() {
|
|
|
207
240
|
}
|
|
208
241
|
},
|
|
209
242
|
inlineMath: {
|
|
210
|
-
children: /*#__PURE__*/React.createElement(
|
|
211
|
-
className: classNames("".concat(prefix, "icon")
|
|
243
|
+
children: /*#__PURE__*/React.createElement(SvgInlineMath, {
|
|
244
|
+
className: classNames("".concat(prefix, "icon"))
|
|
212
245
|
}),
|
|
213
246
|
tooltip: t('inlineMath'),
|
|
214
247
|
onClick: function onClick(exec) {
|
|
@@ -218,8 +251,8 @@ export var getDefaultToolbarItemMap = function getDefaultToolbarItemMap() {
|
|
|
218
251
|
}
|
|
219
252
|
},
|
|
220
253
|
link: {
|
|
221
|
-
children: /*#__PURE__*/React.createElement(
|
|
222
|
-
className: classNames("".concat(prefix, "icon")
|
|
254
|
+
children: /*#__PURE__*/React.createElement(SvgLink, {
|
|
255
|
+
className: classNames("".concat(prefix, "icon"))
|
|
223
256
|
}),
|
|
224
257
|
tooltip: t('link'),
|
|
225
258
|
popoverRender: function popoverRender(exec, close) {
|
|
@@ -244,8 +277,8 @@ export var getDefaultToolbarItemMap = function getDefaultToolbarItemMap() {
|
|
|
244
277
|
}
|
|
245
278
|
},
|
|
246
279
|
math: {
|
|
247
|
-
children: /*#__PURE__*/React.createElement(
|
|
248
|
-
className: classNames("".concat(prefix, "icon")
|
|
280
|
+
children: /*#__PURE__*/React.createElement(SvgMath, {
|
|
281
|
+
className: classNames("".concat(prefix, "icon"))
|
|
249
282
|
}),
|
|
250
283
|
tooltip: t('math'),
|
|
251
284
|
onClick: function onClick(exec) {
|
|
@@ -254,11 +287,17 @@ export var getDefaultToolbarItemMap = function getDefaultToolbarItemMap() {
|
|
|
254
287
|
}));
|
|
255
288
|
}
|
|
256
289
|
},
|
|
290
|
+
orderedList: {
|
|
291
|
+
children: /*#__PURE__*/React.createElement(SvgOrderedList, {
|
|
292
|
+
className: classNames("".concat(prefix, "icon"))
|
|
293
|
+
}),
|
|
294
|
+
tooltip: t('orderedList')
|
|
295
|
+
},
|
|
257
296
|
redo: function redo(_ref2) {
|
|
258
297
|
var history = _ref2.history;
|
|
259
298
|
return {
|
|
260
|
-
children: /*#__PURE__*/React.createElement(
|
|
261
|
-
className: classNames("".concat(prefix, "icon")
|
|
299
|
+
children: /*#__PURE__*/React.createElement(SvgRedo, {
|
|
300
|
+
className: classNames("".concat(prefix, "icon"))
|
|
262
301
|
}),
|
|
263
302
|
disabled: history.index === history.states.length - 1,
|
|
264
303
|
tooltip: t('redo'),
|
|
@@ -268,8 +307,8 @@ export var getDefaultToolbarItemMap = function getDefaultToolbarItemMap() {
|
|
|
268
307
|
};
|
|
269
308
|
},
|
|
270
309
|
strong: {
|
|
271
|
-
children: /*#__PURE__*/React.createElement(
|
|
272
|
-
className: classNames("".concat(prefix, "icon")
|
|
310
|
+
children: /*#__PURE__*/React.createElement(SvgStrong, {
|
|
311
|
+
className: classNames("".concat(prefix, "icon"))
|
|
273
312
|
}),
|
|
274
313
|
tooltip: t('strong'),
|
|
275
314
|
onClick: function onClick(exec) {
|
|
@@ -278,9 +317,15 @@ export var getDefaultToolbarItemMap = function getDefaultToolbarItemMap() {
|
|
|
278
317
|
}));
|
|
279
318
|
}
|
|
280
319
|
},
|
|
320
|
+
table: {
|
|
321
|
+
children: /*#__PURE__*/React.createElement(SvgTable, {
|
|
322
|
+
className: classNames("".concat(prefix, "icon"))
|
|
323
|
+
}),
|
|
324
|
+
tooltip: t('table')
|
|
325
|
+
},
|
|
281
326
|
thematicBreak: {
|
|
282
|
-
children: /*#__PURE__*/React.createElement(
|
|
283
|
-
className: classNames("".concat(prefix, "icon")
|
|
327
|
+
children: /*#__PURE__*/React.createElement(SvgThematicBreak, {
|
|
328
|
+
className: classNames("".concat(prefix, "icon"))
|
|
284
329
|
}),
|
|
285
330
|
tooltip: t('thematicBreak'),
|
|
286
331
|
onClick: function onClick(exec) {
|
|
@@ -289,11 +334,95 @@ export var getDefaultToolbarItemMap = function getDefaultToolbarItemMap() {
|
|
|
289
334
|
}));
|
|
290
335
|
}
|
|
291
336
|
},
|
|
292
|
-
|
|
293
|
-
|
|
337
|
+
toHTML: {
|
|
338
|
+
children: /*#__PURE__*/React.createElement(SvgToHTML, {
|
|
339
|
+
className: classNames("".concat(prefix, "icon"))
|
|
340
|
+
}),
|
|
341
|
+
tooltip: t('toHTML'),
|
|
342
|
+
onClick: function onClick(exec) {
|
|
343
|
+
return exec( /*#__PURE__*/function () {
|
|
344
|
+
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(_ref3) {
|
|
345
|
+
var sourceCode, selection, dispatch;
|
|
346
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
347
|
+
while (1) switch (_context.prev = _context.next) {
|
|
348
|
+
case 0:
|
|
349
|
+
sourceCode = _ref3.sourceCode, selection = _ref3.selection, dispatch = _ref3.dispatch;
|
|
350
|
+
_context.t0 = dispatch;
|
|
351
|
+
_context.next = 4;
|
|
352
|
+
return toHTML(sourceCode);
|
|
353
|
+
case 4:
|
|
354
|
+
_context.t1 = _context.sent;
|
|
355
|
+
_context.t2 = createSelection(0);
|
|
356
|
+
_context.t3 = {
|
|
357
|
+
sourceCode: _context.t1,
|
|
358
|
+
selection: _context.t2
|
|
359
|
+
};
|
|
360
|
+
_context.t4 = selection;
|
|
361
|
+
_context.t5 = {
|
|
362
|
+
type: 'set',
|
|
363
|
+
payload: _context.t3,
|
|
364
|
+
selection: _context.t4
|
|
365
|
+
};
|
|
366
|
+
return _context.abrupt("return", (0, _context.t0)(_context.t5));
|
|
367
|
+
case 10:
|
|
368
|
+
case "end":
|
|
369
|
+
return _context.stop();
|
|
370
|
+
}
|
|
371
|
+
}, _callee);
|
|
372
|
+
}));
|
|
373
|
+
return function (_x) {
|
|
374
|
+
return _ref4.apply(this, arguments);
|
|
375
|
+
};
|
|
376
|
+
}());
|
|
377
|
+
}
|
|
378
|
+
},
|
|
379
|
+
toMarkdown: {
|
|
380
|
+
children: /*#__PURE__*/React.createElement(SvgToMarkdown, {
|
|
381
|
+
className: classNames("".concat(prefix, "icon"))
|
|
382
|
+
}),
|
|
383
|
+
tooltip: t('toMarkdown'),
|
|
384
|
+
onClick: function onClick(exec) {
|
|
385
|
+
return exec( /*#__PURE__*/function () {
|
|
386
|
+
var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(_ref5) {
|
|
387
|
+
var sourceCode, selection, dispatch;
|
|
388
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
389
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
390
|
+
case 0:
|
|
391
|
+
sourceCode = _ref5.sourceCode, selection = _ref5.selection, dispatch = _ref5.dispatch;
|
|
392
|
+
_context2.t0 = dispatch;
|
|
393
|
+
_context2.next = 4;
|
|
394
|
+
return toMarkdown(sourceCode);
|
|
395
|
+
case 4:
|
|
396
|
+
_context2.t1 = _context2.sent;
|
|
397
|
+
_context2.t2 = createSelection(0);
|
|
398
|
+
_context2.t3 = {
|
|
399
|
+
sourceCode: _context2.t1,
|
|
400
|
+
selection: _context2.t2
|
|
401
|
+
};
|
|
402
|
+
_context2.t4 = selection;
|
|
403
|
+
_context2.t5 = {
|
|
404
|
+
type: 'set',
|
|
405
|
+
payload: _context2.t3,
|
|
406
|
+
selection: _context2.t4
|
|
407
|
+
};
|
|
408
|
+
return _context2.abrupt("return", (0, _context2.t0)(_context2.t5));
|
|
409
|
+
case 10:
|
|
410
|
+
case "end":
|
|
411
|
+
return _context2.stop();
|
|
412
|
+
}
|
|
413
|
+
}, _callee2);
|
|
414
|
+
}));
|
|
415
|
+
return function (_x2) {
|
|
416
|
+
return _ref6.apply(this, arguments);
|
|
417
|
+
};
|
|
418
|
+
}());
|
|
419
|
+
}
|
|
420
|
+
},
|
|
421
|
+
undo: function undo(_ref7) {
|
|
422
|
+
var history = _ref7.history;
|
|
294
423
|
return {
|
|
295
|
-
children: /*#__PURE__*/React.createElement(
|
|
296
|
-
className: classNames("".concat(prefix, "icon")
|
|
424
|
+
children: /*#__PURE__*/React.createElement(SvgUndo, {
|
|
425
|
+
className: classNames("".concat(prefix, "icon"))
|
|
297
426
|
}),
|
|
298
427
|
disabled: !history.index,
|
|
299
428
|
tooltip: t('undo'),
|
|
@@ -301,18 +430,29 @@ export var getDefaultToolbarItemMap = function getDefaultToolbarItemMap() {
|
|
|
301
430
|
return exec(undoHandler());
|
|
302
431
|
}
|
|
303
432
|
};
|
|
433
|
+
},
|
|
434
|
+
unorderedList: {
|
|
435
|
+
children: /*#__PURE__*/React.createElement(SvgUnorderedList, {
|
|
436
|
+
className: classNames("".concat(prefix, "icon"))
|
|
437
|
+
}),
|
|
438
|
+
tooltip: t('unorderedList')
|
|
304
439
|
}
|
|
305
440
|
};
|
|
306
441
|
};
|
|
307
442
|
export var getDefaultToolbarItems = function getDefaultToolbarItems() {
|
|
308
|
-
return [['heading', 'strong', 'emphasis', 'delete'], ['thematicBreak', 'blockquote'],
|
|
443
|
+
return [['heading', 'strong', 'emphasis', 'delete'], ['thematicBreak', 'blockquote'],
|
|
444
|
+
// ['table', 'orderedList', 'unorderedList'],
|
|
445
|
+
['link', 'image'], ['inlineCode', 'code', 'inlineMath', 'math'], ['toMarkdown', 'toHTML'], ['undo', 'redo']
|
|
446
|
+
// ['fullscreen'],
|
|
447
|
+
];
|
|
309
448
|
};
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
449
|
+
|
|
450
|
+
var Toolbar = function Toolbar(_ref8) {
|
|
451
|
+
var className = _ref8.className,
|
|
452
|
+
style = _ref8.style,
|
|
453
|
+
itemMap = _ref8.itemMap,
|
|
454
|
+
items = _ref8.items,
|
|
455
|
+
exec = _ref8.exec;
|
|
316
456
|
var toolbarRef = useRef(null);
|
|
317
457
|
var ctx = exec(function (ctx) {
|
|
318
458
|
return ctx;
|
|
@@ -331,12 +471,12 @@ var Toolbar = function Toolbar(_ref4) {
|
|
|
331
471
|
if (!toolbarItem) {
|
|
332
472
|
return undefined;
|
|
333
473
|
}
|
|
334
|
-
var
|
|
335
|
-
children =
|
|
336
|
-
disabled =
|
|
337
|
-
tooltip =
|
|
338
|
-
_popoverRender =
|
|
339
|
-
_onClick2 =
|
|
474
|
+
var _ref9 = typeof toolbarItem === 'function' ? toolbarItem(ctx) : toolbarItem,
|
|
475
|
+
children = _ref9.children,
|
|
476
|
+
disabled = _ref9.disabled,
|
|
477
|
+
tooltip = _ref9.tooltip,
|
|
478
|
+
_popoverRender = _ref9.popoverRender,
|
|
479
|
+
_onClick2 = _ref9.onClick;
|
|
340
480
|
return /*#__PURE__*/React.createElement(Button, {
|
|
341
481
|
key: index,
|
|
342
482
|
toolbarRef: toolbarRef,
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
var SvgBlockquote = function SvgBlockquote(props) {
|
|
4
|
+
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
5
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
6
|
+
width: "1em",
|
|
7
|
+
height: "1em",
|
|
8
|
+
viewBox: "0 0 24 24"
|
|
9
|
+
}, props), /*#__PURE__*/React.createElement("g", {
|
|
10
|
+
fill: "currentColor",
|
|
11
|
+
fillRule: "evenodd"
|
|
12
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
13
|
+
d: "M10.75 8.067c-1.93 1.24-3.003 2.683-3.217 4.33-.334 2.563 1.958 3.818 3.12 2.69 1.161-1.127.465-2.558-.376-2.949-.841-.39-1.355-.255-1.266-.777.09-.523 1.287-1.972 2.338-2.647a.192.192 0 0 0 .029-.262l-.26-.337c-.113-.147-.221-.142-.367-.048ZM15.834 8.067c-1.93 1.24-3.003 2.683-3.218 4.33-.334 2.563 1.959 3.818 3.12 2.69 1.161-1.127.465-2.558-.376-2.949-.84-.39-1.355-.255-1.265-.777.09-.523 1.286-1.972 2.337-2.647a.192.192 0 0 0 .03-.262l-.26-.337c-.114-.147-.222-.142-.368-.048Z"
|
|
14
|
+
})));
|
|
15
|
+
};
|
|
16
|
+
export default SvgBlockquote;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
var SvgCode = function SvgCode(props) {
|
|
4
|
+
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
5
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
6
|
+
width: "1em",
|
|
7
|
+
height: "1em",
|
|
8
|
+
viewBox: "0 0 24 24"
|
|
9
|
+
}, props), /*#__PURE__*/React.createElement("path", {
|
|
10
|
+
fill: "currentColor",
|
|
11
|
+
fillRule: "nonzero",
|
|
12
|
+
d: "M8 15.47v-2.153c0-.482-.336-.872-.75-.872H7v-.93h.25c.414 0 .75-.391.75-.873V8.49c0-.964.672-1.745 1.5-1.745h.5v1.163h-.5a.467.467 0 0 0-.354.17A.633.633 0 0 0 9 8.49v2.384c0 .503-.277.948-.687 1.106.41.157.687.602.687 1.105v2.384c0 .155.053.303.146.412.094.109.221.17.354.17h.5v1.163h-.5c-.828 0-1.5-.781-1.5-1.745Zm8.143 0c0 .963-.672 1.744-1.5 1.744h-.5v-1.163h.5c.276 0 .5-.26.5-.582v-2.384c0-.503.277-.948.687-1.105-.41-.158-.687-.603-.687-1.106V8.49c0-.321-.224-.582-.5-.582h-.5V6.745h.5c.828 0 1.5.781 1.5 1.745v2.152c0 .482.336.872.75.872h.25v.93h-.25c-.414 0-.75.391-.75.873v2.152Z"
|
|
13
|
+
}));
|
|
14
|
+
};
|
|
15
|
+
export default SvgCode;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
var SvgDelete = function SvgDelete(props) {
|
|
4
|
+
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
5
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
6
|
+
width: "1em",
|
|
7
|
+
height: "1em",
|
|
8
|
+
viewBox: "0 0 24 24"
|
|
9
|
+
}, props), /*#__PURE__*/React.createElement("path", {
|
|
10
|
+
fill: "currentColor",
|
|
11
|
+
fillRule: "nonzero",
|
|
12
|
+
d: "M18.016 11.48h-5.224l-.432-.082-.422-.079c-.7-.137-1.123-.273-1.46-.467-.48-.28-.713-.66-.713-1.164 0-.506.207-.926.601-1.217.388-.287.94-.439 1.597-.439.75 0 1.328.197 1.72.586.2.196.346.438.435.719.018.056.038.136.059.243a.139.139 0 0 0 .135.112h.995a.139.139 0 0 0 .138-.138V9.54a2.584 2.584 0 0 0-.844-1.727c-.606-.553-1.499-.844-2.58-.844-.988 0-1.878.247-2.505.696-.35.251-.62.563-.801.925-.185.37-.278.799-.278 1.27 0 .404.078.745.237 1.046.113.215.268.404.466.574H5.984a.11.11 0 0 0-.109.11v.82c0 .06.05.11.11.11h5.922l.08.016c.423.085.677.142.911.208.315.089.555.182.755.294.49.276.729.672.729 1.216 0 .483-.212.914-.596 1.215-.417.326-1.034.497-1.785.497-.597 0-1.103-.116-1.506-.342a1.738 1.738 0 0 1-.853-1.073.14.14 0 0 0-.133-.102h-1.09a.139.139 0 0 0-.138.138v.013l.008.078c.09.668.415 1.214.967 1.625.644.475 1.55.727 2.622.727 1.151 0 2.117-.27 2.792-.784.342-.258.604-.576.78-.943.179-.37.27-.791.27-1.25 0-.436-.08-.8-.243-1.114a1.882 1.882 0 0 0-.298-.42h2.837c.06 0 .109-.05.109-.11v-.82a.11.11 0 0 0-.11-.109Z"
|
|
13
|
+
}));
|
|
14
|
+
};
|
|
15
|
+
export default SvgDelete;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
var SvgEmphasis = function SvgEmphasis(props) {
|
|
4
|
+
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
5
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
6
|
+
width: "1em",
|
|
7
|
+
height: "1em",
|
|
8
|
+
viewBox: "0 0 24 24"
|
|
9
|
+
}, props), /*#__PURE__*/React.createElement("path", {
|
|
10
|
+
fill: "currentColor",
|
|
11
|
+
fillRule: "nonzero",
|
|
12
|
+
d: "M15.91 7.188h-5.906a.11.11 0 0 0-.11.109v.875c0 .06.05.11.11.11h2.477l-2.133 7.437H8.131a.11.11 0 0 0-.11.11v.874c0 .06.05.11.11.11h5.906c.06 0 .11-.05.11-.11v-.875a.11.11 0 0 0-.11-.11h-2.551l2.133-7.437h2.291c.06 0 .11-.049.11-.11v-.874a.11.11 0 0 0-.11-.11Z"
|
|
13
|
+
}));
|
|
14
|
+
};
|
|
15
|
+
export default SvgEmphasis;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
var SvgEnterFullscreen = function SvgEnterFullscreen(props) {
|
|
4
|
+
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
5
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
6
|
+
width: "1em",
|
|
7
|
+
height: "1em",
|
|
8
|
+
viewBox: "0 0 24 24"
|
|
9
|
+
}, props), /*#__PURE__*/React.createElement("path", {
|
|
10
|
+
fill: "currentColor",
|
|
11
|
+
fillRule: "nonzero",
|
|
12
|
+
d: "M9.795 6.5h-2.88a.415.415 0 0 0-.415.415v2.906c0 .114.093.207.208.207h.622a.208.208 0 0 0 .208-.207V7.538h2.257a.208.208 0 0 0 .207-.208v-.622a.208.208 0 0 0-.207-.208Zm7.497 7.472h-.622a.208.208 0 0 0-.208.207v2.283h-2.257a.208.208 0 0 0-.207.208v.622c0 .115.093.208.207.208h2.88c.23 0 .415-.185.415-.415v-2.906a.208.208 0 0 0-.208-.207Zm-7.497 2.49H7.538V14.18a.208.208 0 0 0-.208-.207h-.622a.208.208 0 0 0-.208.207v2.906c0 .23.185.415.415.415h2.88a.208.208 0 0 0 .207-.208v-.622a.208.208 0 0 0-.207-.208Zm7.29-9.962h-2.88a.208.208 0 0 0-.207.208v.622c0 .114.093.208.207.208h2.257V9.82c0 .114.094.207.208.207h.622a.208.208 0 0 0 .208-.207V6.915a.415.415 0 0 0-.415-.415Z"
|
|
13
|
+
}));
|
|
14
|
+
};
|
|
15
|
+
export default SvgEnterFullscreen;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
var SvgExitFullscreen = function SvgExitFullscreen(props) {
|
|
4
|
+
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
5
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
6
|
+
width: "1em",
|
|
7
|
+
height: "1em",
|
|
8
|
+
viewBox: "0 0 24 24"
|
|
9
|
+
}, props), /*#__PURE__*/React.createElement("path", {
|
|
10
|
+
fill: "currentColor",
|
|
11
|
+
fillRule: "nonzero",
|
|
12
|
+
d: "M9.587 13.972h-2.88a.208.208 0 0 0-.207.207v.623c0 .114.093.207.208.207h2.257v2.283c0 .115.093.208.207.208h.623a.208.208 0 0 0 .207-.208v-2.905a.415.415 0 0 0-.415-.415ZM9.795 6.5h-.623a.208.208 0 0 0-.207.208V8.99H6.708a.208.208 0 0 0-.208.207v.623c0 .114.093.207.208.207h2.88c.229 0 .414-.185.414-.415V6.708a.208.208 0 0 0-.207-.208Zm7.497 7.472h-2.88a.415.415 0 0 0-.414.415v2.905c0 .115.093.208.207.208h.623a.208.208 0 0 0 .207-.208V15.01h2.257a.208.208 0 0 0 .208-.207v-.623a.208.208 0 0 0-.208-.207Zm0-4.981h-2.257V6.708a.208.208 0 0 0-.207-.208h-.623a.208.208 0 0 0-.207.208v2.905c0 .23.185.415.415.415h2.88a.208.208 0 0 0 .207-.207v-.623a.208.208 0 0 0-.208-.207Z"
|
|
13
|
+
}));
|
|
14
|
+
};
|
|
15
|
+
export default SvgExitFullscreen;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
var SvgHeading = function SvgHeading(props) {
|
|
4
|
+
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
5
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
6
|
+
width: "1em",
|
|
7
|
+
height: "1em",
|
|
8
|
+
viewBox: "0 0 24 24"
|
|
9
|
+
}, props), /*#__PURE__*/React.createElement("path", {
|
|
10
|
+
fill: "currentColor",
|
|
11
|
+
fillRule: "nonzero",
|
|
12
|
+
d: "M9.524 7.331c.06 0 .11.08.11.179v4.208h4.9V7.51c0-.079.032-.146.075-.17l.035-.009h.88c.06 0 .11.08.11.179v9.643c0 .098-.05.178-.11.178h-.88c-.06 0-.11-.08-.11-.178v-4.335h-4.9v4.335c0 .078-.032.145-.075.17l-.035.008h-.88c-.06 0-.11-.08-.11-.178V7.51c0-.098.05-.179.11-.179Z"
|
|
13
|
+
}));
|
|
14
|
+
};
|
|
15
|
+
export default SvgHeading;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
var SvgImage = function SvgImage(props) {
|
|
4
|
+
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
5
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
6
|
+
width: "1em",
|
|
7
|
+
height: "1em",
|
|
8
|
+
viewBox: "0 0 24 24"
|
|
9
|
+
}, props), /*#__PURE__*/React.createElement("path", {
|
|
10
|
+
fill: "currentColor",
|
|
11
|
+
fillRule: "nonzero",
|
|
12
|
+
d: "M17.688 7.188H6.313a.437.437 0 0 0-.438.437v8.75c0 .242.196.438.438.438h11.375a.437.437 0 0 0 .437-.438v-8.75a.437.437 0 0 0-.438-.438Zm-.547 8.64H6.859v-.545l1.894-2.247 2.052 2.434 3.192-3.784 3.144 3.726v.416Zm0-1.774-3.06-3.629a.109.109 0 0 0-.167 0l-3.109 3.686-1.969-2.334a.109.109 0 0 0-.166 0l-1.81 2.147V8.172h10.28v5.882Zm-7.985-2.82a1.203 1.203 0 1 0 0-2.406 1.203 1.203 0 0 0 0 2.406Zm0-1.586a.382.382 0 1 1 .002.765.382.382 0 0 1-.002-.765Z"
|
|
13
|
+
}));
|
|
14
|
+
};
|
|
15
|
+
export default SvgImage;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
var SvgInlineCode = function SvgInlineCode(props) {
|
|
4
|
+
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
5
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
6
|
+
width: "1em",
|
|
7
|
+
height: "1em",
|
|
8
|
+
viewBox: "0 0 24 24"
|
|
9
|
+
}, props), /*#__PURE__*/React.createElement("g", {
|
|
10
|
+
fill: "currentColor",
|
|
11
|
+
fillRule: "nonzero"
|
|
12
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
13
|
+
d: "m10.994 16.609 3.044-8.842c.003-.007.005-.015.006-.022l-3.05 8.864Z",
|
|
14
|
+
opacity: 0.224
|
|
15
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
16
|
+
d: "M14.04 7.306h-.923a.11.11 0 0 0-.104.074L9.85 16.566a.11.11 0 0 0 .104.145h.927a.11.11 0 0 0 .104-.073l.01-.03 3.05-8.863.101-.292a.111.111 0 0 0-.105-.146Zm4.011 4.559a.236.236 0 0 0-.037-.037L15.02 9.486a.109.109 0 0 0-.176.086v1.111c0 .035.015.066.042.087L16.458 12l-1.572 1.23a.11.11 0 0 0-.042.087v1.111a.11.11 0 0 0 .176.086l2.994-2.342a.22.22 0 0 0 .037-.307ZM8.98 9.485l-2.994 2.343a.22.22 0 0 0 0 .345l2.994 2.341c.019.015.042.024.067.024.06 0 .11-.05.11-.11v-1.111a.106.106 0 0 0-.043-.087L7.542 12l1.572-1.23a.11.11 0 0 0 .042-.087V9.572a.109.109 0 0 0-.176-.086Z"
|
|
17
|
+
})));
|
|
18
|
+
};
|
|
19
|
+
export default SvgInlineCode;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
var SvgInlineMath = function SvgInlineMath(props) {
|
|
4
|
+
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
5
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
6
|
+
width: "1em",
|
|
7
|
+
height: "1em",
|
|
8
|
+
viewBox: "0 0 24 24"
|
|
9
|
+
}, props), /*#__PURE__*/React.createElement("g", {
|
|
10
|
+
fill: "currentColor",
|
|
11
|
+
fillRule: "evenodd",
|
|
12
|
+
transform: "translate(5 5)"
|
|
13
|
+
}, /*#__PURE__*/React.createElement("rect", {
|
|
14
|
+
width: 10,
|
|
15
|
+
height: 1,
|
|
16
|
+
x: 2,
|
|
17
|
+
y: 3,
|
|
18
|
+
rx: 0.1
|
|
19
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
20
|
+
d: "M4 4h1v6.9a.1.1 0 0 1-.1.1h-.8a.1.1 0 0 1-.1-.1V4ZM9 4h1v7h-.5a.5.5 0 0 1-.5-.5V4Z"
|
|
21
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
22
|
+
d: "M9 10h3.4a.1.1 0 0 1 .1.1v.8a.1.1 0 0 1-.1.1H9.5a.5.5 0 0 1-.5-.5V10Z"
|
|
23
|
+
})));
|
|
24
|
+
};
|
|
25
|
+
export default SvgInlineMath;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
var SvgLink = function SvgLink(props) {
|
|
4
|
+
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
5
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
6
|
+
width: "1em",
|
|
7
|
+
height: "1em",
|
|
8
|
+
viewBox: "0 0 24 24"
|
|
9
|
+
}, props), /*#__PURE__*/React.createElement("path", {
|
|
10
|
+
fill: "currentColor",
|
|
11
|
+
fillRule: "nonzero",
|
|
12
|
+
d: "M12.848 14.097a.11.11 0 0 0-.155 0l-1.589 1.589a1.964 1.964 0 0 1-2.789 0 1.964 1.964 0 0 1 0-2.79l1.59-1.588a.11.11 0 0 0 0-.154l-.545-.544a.11.11 0 0 0-.155 0l-1.588 1.588a2.956 2.956 0 0 0 0 4.184 2.957 2.957 0 0 0 4.183 0l1.59-1.589a.11.11 0 0 0 0-.154l-.542-.542Zm3.535-6.48a2.956 2.956 0 0 0-4.183 0l-1.59 1.588a.11.11 0 0 0 0 .155l.542.543a.11.11 0 0 0 .155 0l1.589-1.589a1.964 1.964 0 0 1 2.789 0 1.964 1.964 0 0 1 0 2.79l-1.59 1.588a.11.11 0 0 0 0 .154l.545.544a.11.11 0 0 0 .155 0l1.588-1.588a2.96 2.96 0 0 0 0-4.185Zm-3.042 2.473a.11.11 0 0 0-.154 0l-3.097 3.095a.11.11 0 0 0 0 .155l.541.541a.11.11 0 0 0 .155 0l3.095-3.095a.11.11 0 0 0 0-.155l-.54-.541Z"
|
|
13
|
+
}));
|
|
14
|
+
};
|
|
15
|
+
export default SvgLink;
|