x-star-editor 0.6.3 → 0.6.5

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.
@@ -1,9 +1,9 @@
1
1
  import React from 'react';
2
2
  interface FadeProps {
3
3
  children: React.ReactNode;
4
- nodeRef: React.RefObject<HTMLDivElement>;
4
+ className: string;
5
5
  appear: boolean;
6
6
  timeout: number;
7
7
  }
8
- declare const Fade: ({ children, nodeRef, appear, timeout }: FadeProps) => React.JSX.Element;
8
+ declare const Fade: React.ForwardRefExoticComponent<FadeProps & React.RefAttributes<HTMLDivElement>>;
9
9
  export default Fade;
@@ -1,24 +1,34 @@
1
1
  import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
2
- import React, { useEffect, useState } from 'react';
3
- var Fade = function Fade(_ref) {
2
+ import React, { useEffect, useRef, useState } from 'react';
3
+ var Fade = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
4
4
  var children = _ref.children,
5
- nodeRef = _ref.nodeRef,
5
+ className = _ref.className,
6
6
  appear = _ref.appear,
7
7
  timeout = _ref.timeout;
8
+ var containerRef = useRef(null);
9
+ var composedRef = function composedRef(instance) {
10
+ if (typeof ref === 'function') {
11
+ ref(instance);
12
+ } else if (ref) {
13
+ ref.current = instance;
14
+ }
15
+ containerRef.current = instance;
16
+ };
8
17
  var _useState = useState(appear),
9
18
  _useState2 = _slicedToArray(_useState, 2),
10
19
  mount = _useState2[0],
11
20
  setMount = _useState2[1];
12
21
  useEffect(function () {
13
22
  if (appear) {
14
- if (nodeRef.current) {
15
- nodeRef.current.getBoundingClientRect();
16
- nodeRef.current.style.opacity = '1';
23
+ if (containerRef.current) {
24
+ // 强制浏览器进行重排,保证淡入效果
25
+ containerRef.current.getBoundingClientRect();
26
+ containerRef.current.style.opacity = '1';
17
27
  }
18
28
  setMount(true);
19
29
  } else {
20
- if (nodeRef.current) {
21
- nodeRef.current.style.opacity = '0';
30
+ if (containerRef.current) {
31
+ containerRef.current.style.opacity = '0';
22
32
  }
23
33
  var timer = window.setTimeout(function () {
24
34
  return setMount(false);
@@ -28,6 +38,9 @@ var Fade = function Fade(_ref) {
28
38
  };
29
39
  }
30
40
  }, [appear]);
31
- return /*#__PURE__*/React.createElement(React.Fragment, null, (appear || mount) && children);
32
- };
41
+ return (appear || mount) && /*#__PURE__*/React.createElement("div", {
42
+ ref: composedRef,
43
+ className: className
44
+ }, children);
45
+ });
33
46
  export default Fade;
@@ -51,7 +51,6 @@ var Item = function Item(_ref) {
51
51
  });
52
52
  var popoverMount = !!popover && popoverOpen;
53
53
  var tooltipMount = !popoverMount && !!tooltip && tooltipOpen;
54
- var tooltipRef = useRef(null);
55
54
  var popoverRef = useRef(null);
56
55
  useEffect(function () {
57
56
  if (popoverMount) {
@@ -93,20 +92,15 @@ var Item = function Item(_ref) {
93
92
  return setTooltipOpen(false);
94
93
  }
95
94
  }, children), /*#__PURE__*/React.createElement(Fade, {
96
- nodeRef: tooltipRef,
95
+ className: classNames("".concat(prefix, "-tooltip")),
97
96
  appear: tooltipMount,
98
97
  timeout: 300
99
- }, /*#__PURE__*/React.createElement("div", {
100
- ref: tooltipRef,
101
- className: classNames("".concat(prefix, "-tooltip"))
102
- }, tooltip)), /*#__PURE__*/React.createElement(Fade, {
103
- nodeRef: popoverRef,
98
+ }, tooltip), /*#__PURE__*/React.createElement(Fade, {
99
+ ref: popoverRef,
100
+ className: classNames("".concat(prefix, "-popover")),
104
101
  appear: popoverMount,
105
102
  timeout: 300
106
- }, /*#__PURE__*/React.createElement("div", {
107
- ref: popoverRef,
108
- className: classNames("".concat(prefix, "-popover"))
109
- }, popover)));
103
+ }, popover));
110
104
  };
111
105
  var codeOptions = [{
112
106
  label: 'C++',
@@ -140,10 +134,10 @@ var headingOptions = [{
140
134
  depth: 6,
141
135
  fontSize: '0.9em'
142
136
  }];
143
- export var getDefaultToolbarItemMap = function getDefaultToolbarItemMap(locale, onInsertFile) {
144
- var t = getFormat(locale, 'toolbarItem');
145
- var mermaidOptions = [{
146
- label: t('flowChat'),
137
+ var getMermaidOptions = function getMermaidOptions(locale) {
138
+ var t = getFormat(locale, 'mermaid');
139
+ return [{
140
+ label: t('flowchart'),
147
141
  value: "flowchart TD\n A[Start] --> B{Is it?}\n B -- Yes --> C[OK]\n C --> D[Rethink]\n D --> B\n B -- No ----> E[End]"
148
142
  }, {
149
143
  label: t('sequenceDiagram'),
@@ -155,13 +149,13 @@ export var getDefaultToolbarItemMap = function getDefaultToolbarItemMap(locale,
155
149
  label: t('stateDiagram'),
156
150
  value: "stateDiagram-v2\n [*] --> Still\n Still --> [*]\n \n Still --> Moving\n Moving --> Still\n Moving --> Crash\n Crash --> [*]"
157
151
  }, {
158
- label: t('ERDiagram'),
152
+ label: t('entityRelationshipDiagram'),
159
153
  value: "erDiagram\n CUSTOMER ||--o{ ORDER : places\n ORDER ||--|{ LINE-ITEM : contains\n CUSTOMER }|..|{ DELIVERY-ADDRESS : uses"
160
154
  }, {
161
155
  label: t('userJourney'),
162
156
  value: "journey\n title My working day\n section Go to work\n Make tea: 5: Me\n Go upstairs: 3: Me\n Do work: 1: Me, Cat\n section Go home\n Go downstairs: 5: Me\n Sit down: 5: Me"
163
157
  }, {
164
- label: t('Gantt'),
158
+ label: t('gantt'),
165
159
  value: "gantt\n title A Gantt Diagram\n dateFormat YYYY-MM-DD\n section Section\n A task :a1, 2014-01-01, 30d\n Another task :after a1, 20d\n section Another\n Task in Another :2014-01-12, 12d\n another task :24d"
166
160
  }, {
167
161
  label: t('pieChart'),
@@ -173,15 +167,18 @@ export var getDefaultToolbarItemMap = function getDefaultToolbarItemMap(locale,
173
167
  label: t('requirementDiagram'),
174
168
  value: "requirementDiagram\n \n requirement test_req {\n id: 1\n text: the test text.\n risk: high\n verifymethod: test\n }\n \n element test_entity {\n type: simulation\n }\n \n test_entity - satisfies -> test_req"
175
169
  }, {
176
- label: t('gitGraphDiagram'),
170
+ label: t('gitgraphDiagram'),
177
171
  value: "gitGraph\n commit\n commit\n branch develop\n checkout develop\n commit\n commit\n checkout main\n merge develop\n commit\n commit"
178
172
  }, {
179
- label: t('mindMaps'),
173
+ label: t('mindmap'),
180
174
  value: "mindmap\n root((mindmap))\n Origins\n Long history\n ::icon(fa fa-book)\n Popularisation\n British popular psychology author Tony Buzan\n Research\n On effectiveness<br/>and features\n On Automatic creation\n Uses\n Creative techniques\n Strategic planning\n Argument mapping\n Tools\n Pen and paper\n Mermaid"
181
175
  }, {
182
- label: t('timeLine'),
176
+ label: t('timeline'),
183
177
  value: "timeline\n title History of Social Media Platform\n 2002 : LinkedIn\n 2004 : Facebook\n : Google\n 2005 : Youtube\n 2006 : Twitter"
184
178
  }];
179
+ };
180
+ export var getDefaultToolbarItemMap = function getDefaultToolbarItemMap(locale, onInsertFile) {
181
+ var t = getFormat(locale, 'toolbarItem');
185
182
  return {
186
183
  blockquote: {
187
184
  children: /*#__PURE__*/React.createElement(SvgBlockquote, {
@@ -365,7 +362,7 @@ export var getDefaultToolbarItemMap = function getDefaultToolbarItemMap(locale,
365
362
  }),
366
363
  tooltip: t('mermaid'),
367
364
  popoverRender: function popoverRender(exec, close) {
368
- return mermaidOptions.map(function (_ref4) {
365
+ return getMermaidOptions(locale).map(function (_ref4) {
369
366
  var label = _ref4.label,
370
367
  value = _ref4.value;
371
368
  return /*#__PURE__*/React.createElement("div", {
@@ -0,0 +1,4 @@
1
+ import type { SVGProps } from 'react';
2
+ import React from 'react';
3
+ declare const SvgClear: (props: SVGProps<SVGSVGElement>) => React.JSX.Element;
4
+ export default SvgClear;
@@ -0,0 +1,20 @@
1
+ import _extends from "@babel/runtime/helpers/esm/extends";
2
+ import React from 'react';
3
+ var SvgClear = function SvgClear(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: "M12 18c-3.3 0-6-2.7-6-6s2.7-6 6-6 6 2.7 6 6-2.7 6-6 6m1.938-1.393a5.06 5.06 0 0 0 2.668-2.667 4.97 4.97 0 0 0 0-3.88 5.06 5.06 0 0 0-2.668-2.666 4.97 4.97 0 0 0-3.876 0 5.06 5.06 0 0 0-2.668 2.667 4.97 4.97 0 0 0 0 3.879 5.06 5.06 0 0 0 2.668 2.667 4.97 4.97 0 0 0 3.876 0"
14
+ }), /*#__PURE__*/React.createElement("path", {
15
+ d: "m9.251 14.027 4.776-4.776q.363-.362.725 0 .363.363 0 .725l-4.776 4.776q-.362.363-.725 0-.361-.362 0-.725"
16
+ }), /*#__PURE__*/React.createElement("path", {
17
+ d: "M14.752 14.027 9.976 9.251q-.362-.362-.725 0-.361.363 0 .725l4.776 4.776q.363.363.725 0 .363-.362 0-.725"
18
+ })));
19
+ };
20
+ export default SvgClear;
@@ -0,0 +1,4 @@
1
+ import type { SVGProps } from 'react';
2
+ import React from 'react';
3
+ declare const SvgEraser: (props: SVGProps<SVGSVGElement>) => React.JSX.Element;
4
+ export default SvgEraser;
@@ -0,0 +1,15 @@
1
+ import _extends from "@babel/runtime/helpers/esm/extends";
2
+ import React from 'react';
3
+ var SvgEraser = function SvgEraser(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.48 15.017 17 10.525 13.453 7.25l-4.378 4.363zm-.715.71-3.404-3.403-1.29 1.287a.247.247 0 0 0 .003.351l2.834 2.788h.829zm.443 1.023h5.291a.499.499 0 1 1 0 1H9.765a.5.5 0 0 1-.361-.157L6.272 14.47a1.015 1.015 0 0 1 .023-1.407l6.498-6.521a.99.99 0 0 1 1.403 0l3.513 3.278a1 1 0 0 1 0 1.41z"
13
+ }));
14
+ };
15
+ export default SvgEraser;
@@ -0,0 +1,4 @@
1
+ import type { SVGProps } from 'react';
2
+ import React from 'react';
3
+ declare const SvgPencil: (props: SVGProps<SVGSVGElement>) => React.JSX.Element;
4
+ export default SvgPencil;
@@ -0,0 +1,15 @@
1
+ import _extends from "@babel/runtime/helpers/esm/extends";
2
+ import React from 'react';
3
+ var SvgPencil = function SvgPencil(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: "M13.263 6.98a1.977 1.977 0 0 1 2.796 0l.87.868a1.977 1.977 0 0 1 0 2.797l-.93.928-5.788 5.79a.5.5 0 0 1-.368.144l-2.862-.104a.494.494 0 0 1-.476-.476L6.4 14.065a.5.5 0 0 1 .145-.367l5.79-5.79.004-.004zm-.58 1.977-5.287 5.287.08 2.187 2.187.08 5.287-5.288zm2.677-1.278a.99.99 0 0 0-1.397 0l-.58.578 2.267 2.267.579-.579a.99.99 0 0 0 .058-1.335l-.058-.062z"
13
+ }));
14
+ };
15
+ export default SvgPencil;
@@ -0,0 +1,4 @@
1
+ import type { SVGProps } from 'react';
2
+ import React from 'react';
3
+ declare const SvgScreenshot: (props: SVGProps<SVGSVGElement>) => React.JSX.Element;
4
+ export default SvgScreenshot;
@@ -0,0 +1,18 @@
1
+ import _extends from "@babel/runtime/helpers/esm/extends";
2
+ import React from 'react';
3
+ var SvgScreenshot = function SvgScreenshot(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: "M7.5 14.2V16a.5.5 0 0 0 .5.5h1.8c.11 0 .2.09.2.2v.6a.2.2 0 0 1-.2.2H8a1.5 1.5 0 0 1-1.493-1.356l-.007-.14V14.2c0-.11.09-.2.2-.2h.6c.11 0 .2.09.2.2m10 0V16a1.5 1.5 0 0 1-1.5 1.5h-1.8a.2.2 0 0 1-.2-.2v-.6c0-.11.09-.2.2-.2H16a.5.5 0 0 0 .492-.41l.007-.081.001-.018V14.2c0-.11.09-.2.2-.2h.6c.11 0 .2.09.2.2M16 6.5A1.5 1.5 0 0 1 17.5 8v1.8a.2.2 0 0 1-.2.2h-.6a.2.2 0 0 1-.2-.2V8a.5.5 0 0 0-.41-.492l-.081-.007-.018-.001H14.2a.2.2 0 0 1-.2-.2v-.6c0-.11.09-.2.2-.2zm-6 .2v.6a.2.2 0 0 1-.2.2H8a.5.5 0 0 0-.492.41l-.007.081-.001.018V9.8a.2.2 0 0 1-.2.2h-.6a.2.2 0 0 1-.2-.2V8a1.5 1.5 0 0 1 1.356-1.493l.14-.007H9.8c.11 0 .2.09.2.2M10.891 12.216a1.108 1.108 0 1 0 2.217 0 1.108 1.108 0 0 0-2.217 0"
14
+ }), /*#__PURE__*/React.createElement("path", {
15
+ d: "M14.557 10.08h-.868a.37.37 0 0 1-.322-.175l-.202-.286a.38.38 0 0 0-.316-.169h-1.78a.4.4 0 0 0-.323.169l-.196.286a.39.39 0 0 1-.322.175H9.45a.57.57 0 0 0-.575.567v3.238c0 .316.26.567.575.567h5.11a.564.564 0 0 0 .566-.567v-3.238a.567.567 0 0 0-.569-.567M12 13.788c-.862 0-1.57-.701-1.57-1.57a1.572 1.572 0 0 1 3.146 0c0 .869-.708 1.57-1.576 1.57"
16
+ })));
17
+ };
18
+ export default SvgScreenshot;
package/dist/index.d.ts CHANGED
@@ -2,7 +2,7 @@ export type { ToolbarItem } from './components/Toolbar';
2
2
  export { createSelection, getRange } from './utils/container';
3
3
  export { batchHandler, indentHandler, insertHandler, mutateHandler, redoHandler, selectHandler, setHandler, toggleHandler, undoHandler, } from './utils/handler';
4
4
  export type { Executor, Handler, KeyboardEventHandler } from './utils/handler';
5
- export { toHTML, toMarkdown, toText } from './utils/markdown';
5
+ export { cachedParse, toHTML, toMarkdown, toText } from './utils/markdown';
6
6
  export { default as XStarEditor, useEditorRef } from './x-star-editor';
7
7
  export type { XStarEditorHandle, XStarEditorProps } from './x-star-editor';
8
8
  export { default as XStarMdEditor, useMdEditorRef } from './x-star-md-editor';
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  export { createSelection, getRange } from "./utils/container";
2
2
  export { batchHandler, indentHandler, insertHandler, mutateHandler, redoHandler, selectHandler, setHandler, toggleHandler, undoHandler } from "./utils/handler";
3
- export { toHTML, toMarkdown, toText } from "./utils/markdown";
3
+ export { cachedParse, toHTML, toMarkdown, toText } from "./utils/markdown";
4
4
  export { default as XStarEditor, useEditorRef } from "./x-star-editor";
5
5
  export { default as XStarMdEditor, useMdEditorRef } from "./x-star-md-editor";
6
6
  export { default as XStarMdViewer, useMdViewerRef } from "./x-star-md-viewer";
@@ -34,19 +34,30 @@ declare const _default: {
34
34
  readonly undo: "Undo";
35
35
  readonly unorderedList: "Unordered List";
36
36
  readonly viewOnly: "View Only";
37
- readonly flowChat: "Flowchart";
38
- readonly sequenceDiagram: "sequenceDiagram";
37
+ };
38
+ readonly mermaid: {
39
+ readonly flowchart: "Flowchart";
40
+ readonly sequenceDiagram: "Sequence Diagram";
39
41
  readonly classDiagram: "Class Diagram";
40
42
  readonly stateDiagram: "State Diagram";
41
- readonly ERDiagram: "Entity Relationship Diagram";
43
+ readonly entityRelationshipDiagram: "Entity Relationship Diagram";
42
44
  readonly userJourney: "User Journey";
43
- readonly Gantt: "Gantt";
45
+ readonly gantt: "Gantt";
44
46
  readonly pieChart: "Pie Chart";
45
47
  readonly quadrantChart: "Quadrant Chart";
46
48
  readonly requirementDiagram: "Requirement Diagram";
47
- readonly gitGraphDiagram: "Gitgraph (Git) Diagram";
48
- readonly mindMaps: "Mindmaps";
49
- readonly timeLine: "Timeline";
49
+ readonly gitgraphDiagram: "Gitgraph Diagram";
50
+ readonly mindmap: "Mindmap";
51
+ readonly timeline: "Timeline";
52
+ };
53
+ readonly slideViewer: {
54
+ readonly undo: "Undo";
55
+ readonly redo: "Redo";
56
+ readonly clear: "Clear";
57
+ readonly pencil: "Pencil";
58
+ readonly eraser: "Eraser";
59
+ readonly screenshot: "Screenshot";
60
+ readonly fullscreen: "Fullscreen";
50
61
  };
51
62
  };
52
63
  export default _default;
@@ -33,19 +33,30 @@ export default {
33
33
  toMarkdown: 'To Markdown',
34
34
  undo: 'Undo',
35
35
  unorderedList: 'Unordered List',
36
- viewOnly: 'View Only',
37
- flowChat: 'Flowchart',
38
- sequenceDiagram: 'sequenceDiagram',
36
+ viewOnly: 'View Only'
37
+ },
38
+ mermaid: {
39
+ flowchart: 'Flowchart',
40
+ sequenceDiagram: 'Sequence Diagram',
39
41
  classDiagram: 'Class Diagram',
40
42
  stateDiagram: 'State Diagram',
41
- ERDiagram: 'Entity Relationship Diagram',
43
+ entityRelationshipDiagram: 'Entity Relationship Diagram',
42
44
  userJourney: 'User Journey',
43
- Gantt: 'Gantt',
45
+ gantt: 'Gantt',
44
46
  pieChart: 'Pie Chart',
45
47
  quadrantChart: 'Quadrant Chart',
46
48
  requirementDiagram: 'Requirement Diagram',
47
- gitGraphDiagram: 'Gitgraph (Git) Diagram',
48
- mindMaps: 'Mindmaps',
49
- timeLine: 'Timeline'
49
+ gitgraphDiagram: 'Gitgraph Diagram',
50
+ mindmap: 'Mindmap',
51
+ timeline: 'Timeline'
52
+ },
53
+ slideViewer: {
54
+ undo: 'Undo',
55
+ redo: 'Redo',
56
+ clear: 'Clear',
57
+ pencil: 'Pencil',
58
+ eraser: 'Eraser',
59
+ screenshot: 'Screenshot',
60
+ fullscreen: 'Fullscreen'
50
61
  }
51
62
  };
@@ -7,7 +7,7 @@ interface LocaleProviderProps {
7
7
  }
8
8
  export declare const LocaleProvider: ({ children, locale, }: LocaleProviderProps) => React.JSX.Element;
9
9
  type MessageMap = typeof zh_CN | typeof en_US;
10
- export declare const useLocale: <T extends "fileInput" | "toolbarItem">(slice: T) => {
10
+ export declare const useLocale: <T extends "fileInput" | "toolbarItem" | "mermaid" | "slideViewer">(slice: T) => {
11
11
  locale: string;
12
12
  format: <U extends keyof MessageMap[T]>(key: U) => ({
13
13
  readonly fileInput: {
@@ -45,19 +45,30 @@ export declare const useLocale: <T extends "fileInput" | "toolbarItem">(slice: T
45
45
  readonly undo: "撤销";
46
46
  readonly unorderedList: "无序列表";
47
47
  readonly viewOnly: "仅查看";
48
- readonly flowChat: "流程图";
49
- readonly sequenceDiagram: "时序图";
48
+ };
49
+ readonly mermaid: {
50
+ readonly flowchart: "流程图";
51
+ readonly sequenceDiagram: "序列图";
50
52
  readonly classDiagram: "类图";
51
53
  readonly stateDiagram: "状态图";
52
- readonly ERDiagram: "实体关系图";
54
+ readonly entityRelationshipDiagram: "实体关系图";
53
55
  readonly userJourney: "用户旅程图";
54
- readonly Gantt: "甘特图";
56
+ readonly gantt: "甘特图";
55
57
  readonly pieChart: "饼图";
56
- readonly quadrantChart: "四象限图";
58
+ readonly quadrantChart: "象限图";
57
59
  readonly requirementDiagram: "需求图";
58
- readonly gitGraphDiagram: "Git图";
59
- readonly mindMaps: "思维导图";
60
- readonly timeLine: "时间线图";
60
+ readonly gitgraphDiagram: "Gitgraph 图";
61
+ readonly mindmap: "思维导图";
62
+ readonly timeline: "时间线图";
63
+ };
64
+ readonly slideViewer: {
65
+ readonly undo: "撤销";
66
+ readonly redo: "恢复";
67
+ readonly clear: "清空";
68
+ readonly pencil: "画笔";
69
+ readonly eraser: "橡皮";
70
+ readonly screenshot: "截图";
71
+ readonly fullscreen: "全屏";
61
72
  };
62
73
  } | {
63
74
  readonly fileInput: {
@@ -95,23 +106,34 @@ export declare const useLocale: <T extends "fileInput" | "toolbarItem">(slice: T
95
106
  readonly undo: "Undo";
96
107
  readonly unorderedList: "Unordered List";
97
108
  readonly viewOnly: "View Only";
98
- readonly flowChat: "Flowchart";
99
- readonly sequenceDiagram: "sequenceDiagram";
109
+ };
110
+ readonly mermaid: {
111
+ readonly flowchart: "Flowchart";
112
+ readonly sequenceDiagram: "Sequence Diagram";
100
113
  readonly classDiagram: "Class Diagram";
101
114
  readonly stateDiagram: "State Diagram";
102
- readonly ERDiagram: "Entity Relationship Diagram";
115
+ readonly entityRelationshipDiagram: "Entity Relationship Diagram";
103
116
  readonly userJourney: "User Journey";
104
- readonly Gantt: "Gantt";
117
+ readonly gantt: "Gantt";
105
118
  readonly pieChart: "Pie Chart";
106
119
  readonly quadrantChart: "Quadrant Chart";
107
120
  readonly requirementDiagram: "Requirement Diagram";
108
- readonly gitGraphDiagram: "Gitgraph (Git) Diagram";
109
- readonly mindMaps: "Mindmaps";
110
- readonly timeLine: "Timeline";
121
+ readonly gitgraphDiagram: "Gitgraph Diagram";
122
+ readonly mindmap: "Mindmap";
123
+ readonly timeline: "Timeline";
124
+ };
125
+ readonly slideViewer: {
126
+ readonly undo: "Undo";
127
+ readonly redo: "Redo";
128
+ readonly clear: "Clear";
129
+ readonly pencil: "Pencil";
130
+ readonly eraser: "Eraser";
131
+ readonly screenshot: "Screenshot";
132
+ readonly fullscreen: "Fullscreen";
111
133
  };
112
134
  })[T][U];
113
135
  };
114
- export declare const getFormat: <T extends "fileInput" | "toolbarItem">(locale: string | undefined, slice: T) => <U extends keyof MessageMap[T]>(key: U) => ({
136
+ export declare const getFormat: <T extends "fileInput" | "toolbarItem" | "mermaid" | "slideViewer">(locale: string | undefined, slice: T) => <U extends keyof MessageMap[T]>(key: U) => ({
115
137
  readonly fileInput: {
116
138
  readonly cancel: "取消";
117
139
  readonly chooseFile: "选择文件";
@@ -147,19 +169,30 @@ export declare const getFormat: <T extends "fileInput" | "toolbarItem">(locale:
147
169
  readonly undo: "撤销";
148
170
  readonly unorderedList: "无序列表";
149
171
  readonly viewOnly: "仅查看";
150
- readonly flowChat: "流程图";
151
- readonly sequenceDiagram: "时序图";
172
+ };
173
+ readonly mermaid: {
174
+ readonly flowchart: "流程图";
175
+ readonly sequenceDiagram: "序列图";
152
176
  readonly classDiagram: "类图";
153
177
  readonly stateDiagram: "状态图";
154
- readonly ERDiagram: "实体关系图";
178
+ readonly entityRelationshipDiagram: "实体关系图";
155
179
  readonly userJourney: "用户旅程图";
156
- readonly Gantt: "甘特图";
180
+ readonly gantt: "甘特图";
157
181
  readonly pieChart: "饼图";
158
- readonly quadrantChart: "四象限图";
182
+ readonly quadrantChart: "象限图";
159
183
  readonly requirementDiagram: "需求图";
160
- readonly gitGraphDiagram: "Git图";
161
- readonly mindMaps: "思维导图";
162
- readonly timeLine: "时间线图";
184
+ readonly gitgraphDiagram: "Gitgraph 图";
185
+ readonly mindmap: "思维导图";
186
+ readonly timeline: "时间线图";
187
+ };
188
+ readonly slideViewer: {
189
+ readonly undo: "撤销";
190
+ readonly redo: "恢复";
191
+ readonly clear: "清空";
192
+ readonly pencil: "画笔";
193
+ readonly eraser: "橡皮";
194
+ readonly screenshot: "截图";
195
+ readonly fullscreen: "全屏";
163
196
  };
164
197
  } | {
165
198
  readonly fileInput: {
@@ -197,19 +230,30 @@ export declare const getFormat: <T extends "fileInput" | "toolbarItem">(locale:
197
230
  readonly undo: "Undo";
198
231
  readonly unorderedList: "Unordered List";
199
232
  readonly viewOnly: "View Only";
200
- readonly flowChat: "Flowchart";
201
- readonly sequenceDiagram: "sequenceDiagram";
233
+ };
234
+ readonly mermaid: {
235
+ readonly flowchart: "Flowchart";
236
+ readonly sequenceDiagram: "Sequence Diagram";
202
237
  readonly classDiagram: "Class Diagram";
203
238
  readonly stateDiagram: "State Diagram";
204
- readonly ERDiagram: "Entity Relationship Diagram";
239
+ readonly entityRelationshipDiagram: "Entity Relationship Diagram";
205
240
  readonly userJourney: "User Journey";
206
- readonly Gantt: "Gantt";
241
+ readonly gantt: "Gantt";
207
242
  readonly pieChart: "Pie Chart";
208
243
  readonly quadrantChart: "Quadrant Chart";
209
244
  readonly requirementDiagram: "Requirement Diagram";
210
- readonly gitGraphDiagram: "Gitgraph (Git) Diagram";
211
- readonly mindMaps: "Mindmaps";
212
- readonly timeLine: "Timeline";
245
+ readonly gitgraphDiagram: "Gitgraph Diagram";
246
+ readonly mindmap: "Mindmap";
247
+ readonly timeline: "Timeline";
248
+ };
249
+ readonly slideViewer: {
250
+ readonly undo: "Undo";
251
+ readonly redo: "Redo";
252
+ readonly clear: "Clear";
253
+ readonly pencil: "Pencil";
254
+ readonly eraser: "Eraser";
255
+ readonly screenshot: "Screenshot";
256
+ readonly fullscreen: "Fullscreen";
213
257
  };
214
258
  })[T][U];
215
259
  export {};
@@ -34,19 +34,30 @@ declare const _default: {
34
34
  readonly undo: "撤销";
35
35
  readonly unorderedList: "无序列表";
36
36
  readonly viewOnly: "仅查看";
37
- readonly flowChat: "流程图";
38
- readonly sequenceDiagram: "时序图";
37
+ };
38
+ readonly mermaid: {
39
+ readonly flowchart: "流程图";
40
+ readonly sequenceDiagram: "序列图";
39
41
  readonly classDiagram: "类图";
40
42
  readonly stateDiagram: "状态图";
41
- readonly ERDiagram: "实体关系图";
43
+ readonly entityRelationshipDiagram: "实体关系图";
42
44
  readonly userJourney: "用户旅程图";
43
- readonly Gantt: "甘特图";
45
+ readonly gantt: "甘特图";
44
46
  readonly pieChart: "饼图";
45
- readonly quadrantChart: "四象限图";
47
+ readonly quadrantChart: "象限图";
46
48
  readonly requirementDiagram: "需求图";
47
- readonly gitGraphDiagram: "Git图";
48
- readonly mindMaps: "思维导图";
49
- readonly timeLine: "时间线图";
49
+ readonly gitgraphDiagram: "Gitgraph 图";
50
+ readonly mindmap: "思维导图";
51
+ readonly timeline: "时间线图";
52
+ };
53
+ readonly slideViewer: {
54
+ readonly undo: "撤销";
55
+ readonly redo: "恢复";
56
+ readonly clear: "清空";
57
+ readonly pencil: "画笔";
58
+ readonly eraser: "橡皮";
59
+ readonly screenshot: "截图";
60
+ readonly fullscreen: "全屏";
50
61
  };
51
62
  };
52
63
  export default _default;
@@ -33,19 +33,30 @@ export default {
33
33
  toMarkdown: '转成 Markdown',
34
34
  undo: '撤销',
35
35
  unorderedList: '无序列表',
36
- viewOnly: '仅查看',
37
- flowChat: '流程图',
38
- sequenceDiagram: '时序图',
36
+ viewOnly: '仅查看'
37
+ },
38
+ mermaid: {
39
+ flowchart: '流程图',
40
+ sequenceDiagram: '序列图',
39
41
  classDiagram: '类图',
40
42
  stateDiagram: '状态图',
41
- ERDiagram: '实体关系图',
43
+ entityRelationshipDiagram: '实体关系图',
42
44
  userJourney: '用户旅程图',
43
- Gantt: '甘特图',
45
+ gantt: '甘特图',
44
46
  pieChart: '饼图',
45
- quadrantChart: '四象限图',
47
+ quadrantChart: '象限图',
46
48
  requirementDiagram: '需求图',
47
- gitGraphDiagram: 'Git图',
48
- mindMaps: '思维导图',
49
- timeLine: '时间线图'
49
+ gitgraphDiagram: 'Gitgraph 图',
50
+ mindmap: '思维导图',
51
+ timeline: '时间线图'
52
+ },
53
+ slideViewer: {
54
+ undo: '撤销',
55
+ redo: '恢复',
56
+ clear: '清空',
57
+ pencil: '画笔',
58
+ eraser: '橡皮',
59
+ screenshot: '截图',
60
+ fullscreen: '全屏'
50
61
  }
51
62
  };