x-star-editor 0.5.0 → 0.6.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/dist/components/Toolbar.js +40 -75
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -1
- package/dist/locales/en_US.d.ts +13 -0
- package/dist/locales/en_US.js +14 -1
- package/dist/locales/index.d.ts +52 -0
- package/dist/locales/zh_CN.d.ts +13 -0
- package/dist/locales/zh_CN.js +14 -1
- package/dist/styles/cursor/editor-eraser.png +0 -0
- package/dist/styles/cursor/pencil.png +0 -0
- package/dist/styles/index.css +1455 -1261
- package/dist/themes/lark.css +160 -59
- package/dist/utils/markdown.d.ts +8 -1
- package/dist/utils/markdown.js +31 -4
- package/dist/utils/slide/index.d.ts +0 -0
- package/dist/utils/slide/index.js +32 -0
- package/dist/x-star-md-viewer/index.js +8 -5
- package/dist/x-star-slide-viewer/index.d.ts +42 -0
- package/dist/x-star-slide-viewer/index.js +367 -0
- package/package.json +4 -1
|
@@ -140,83 +140,48 @@ var headingOptions = [{
|
|
|
140
140
|
depth: 6,
|
|
141
141
|
fontSize: '0.9em'
|
|
142
142
|
}];
|
|
143
|
-
var mermaidOptions = [
|
|
144
|
-
// {
|
|
145
|
-
// label: 'Flowchart',
|
|
146
|
-
// value: `flowchart TD
|
|
147
|
-
// A[Start] --> B{Is it?}
|
|
148
|
-
// B -- Yes --> C[OK]
|
|
149
|
-
// C --> D[Rethink]
|
|
150
|
-
// D --> B
|
|
151
|
-
// B -- No ----> E[End]`,
|
|
152
|
-
// },
|
|
153
|
-
{
|
|
154
|
-
label: 'Sequence Diagram',
|
|
155
|
-
value: "sequenceDiagram\n Alice->>John: Hello John, how are you?\n John-->>Alice: Great!\n Alice-)John: See you later!"
|
|
156
|
-
}, {
|
|
157
|
-
label: 'Class Diagram',
|
|
158
|
-
value: "classDiagram\n class BankAccount\n BankAccount : +String owner\n BankAccount : +Bigdecimal balance\n BankAccount : +deposit(amount)\n BankAccount : +withdrawal(amount)"
|
|
159
|
-
},
|
|
160
|
-
// {
|
|
161
|
-
// label: 'State Diagram',
|
|
162
|
-
// value: `stateDiagram-v2
|
|
163
|
-
// [*] --> Still
|
|
164
|
-
// Still --> [*]
|
|
165
|
-
|
|
166
|
-
// Still --> Moving
|
|
167
|
-
// Moving --> Still
|
|
168
|
-
// Moving --> Crash
|
|
169
|
-
// Crash --> [*]`,
|
|
170
|
-
// },
|
|
171
|
-
// {
|
|
172
|
-
// label: 'Entity Relationship Diagram',
|
|
173
|
-
// value: `erDiagram
|
|
174
|
-
// CUSTOMER ||--o{ ORDER : places
|
|
175
|
-
// ORDER ||--|{ LINE-ITEM : contains
|
|
176
|
-
// CUSTOMER }|..|{ DELIVERY-ADDRESS : uses`,
|
|
177
|
-
// },
|
|
178
|
-
{
|
|
179
|
-
label: 'User Journey',
|
|
180
|
-
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"
|
|
181
|
-
}, {
|
|
182
|
-
label: 'Gantt',
|
|
183
|
-
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"
|
|
184
|
-
}, {
|
|
185
|
-
label: 'Pie Chart',
|
|
186
|
-
value: "pie title Pets adopted by volunteers\n \"Dogs\" : 386\n \"Cats\" : 85\n \"Rats\" : 15"
|
|
187
|
-
}, {
|
|
188
|
-
label: 'Quadrant Chart',
|
|
189
|
-
value: "quadrantChart\n title Reach and engagement of campaigns\n x-axis Low Reach --> High Reach\n y-axis Low Engagement --> High Engagement\n quadrant-1 We should expand\n quadrant-2 Need to promote\n quadrant-3 Re-evaluate\n quadrant-4 May be improved\n Campaign A: [0.3, 0.6]\n Campaign B: [0.45, 0.23]\n Campaign C: [0.57, 0.69]\n Campaign D: [0.78, 0.34]\n Campaign E: [0.40, 0.34]\n Campaign F: [0.35, 0.78]"
|
|
190
|
-
},
|
|
191
|
-
// {
|
|
192
|
-
// label: 'Requirement Diagram',
|
|
193
|
-
// value: `requirementDiagram
|
|
194
|
-
|
|
195
|
-
// requirement test_req {
|
|
196
|
-
// id: 1
|
|
197
|
-
// text: the test text.
|
|
198
|
-
// risk: high
|
|
199
|
-
// verifymethod: test
|
|
200
|
-
// }
|
|
201
|
-
|
|
202
|
-
// element test_entity {
|
|
203
|
-
// type: simulation
|
|
204
|
-
// }
|
|
205
|
-
|
|
206
|
-
// test_entity - satisfies -> test_req`,
|
|
207
|
-
// },
|
|
208
|
-
{
|
|
209
|
-
label: 'Gitgraph (Git) Diagram',
|
|
210
|
-
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"
|
|
211
|
-
}, {
|
|
212
|
-
label: 'Mindmaps',
|
|
213
|
-
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"
|
|
214
|
-
}, {
|
|
215
|
-
label: 'Timeline',
|
|
216
|
-
value: "timeline\n title History of Social Media Platform\n 2002 : LinkedIn\n 2004 : Facebook\n : Google\n 2005 : Youtube\n 2006 : Twitter"
|
|
217
|
-
}];
|
|
218
143
|
export var getDefaultToolbarItemMap = function getDefaultToolbarItemMap(locale, onInsertFile) {
|
|
219
144
|
var t = getFormat(locale, 'toolbarItem');
|
|
145
|
+
var mermaidOptions = [{
|
|
146
|
+
label: t('flowChat'),
|
|
147
|
+
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
|
+
}, {
|
|
149
|
+
label: t('sequenceDiagram'),
|
|
150
|
+
value: "sequenceDiagram\n Alice->>John: Hello John, how are you?\n John-->>Alice: Great!\n Alice-)John: See you later!"
|
|
151
|
+
}, {
|
|
152
|
+
label: t('classDiagram'),
|
|
153
|
+
value: "classDiagram\n Animal <|-- Duck\n Animal <|-- Fish\n Animal <|-- Zebra\n Animal : +int age\n Animal : +String gender\n Animal: +isMammal()\n Animal: +mate()\n class Duck{\n +String beakColor\n +swim()\n +quack()\n }\n class Fish{\n -int sizeInFeet\n -canEat()\n }\n class Zebra{\n +bool is_wild\n +run()\n }"
|
|
154
|
+
}, {
|
|
155
|
+
label: t('stateDiagram'),
|
|
156
|
+
value: "stateDiagram-v2\n [*] --> Still\n Still --> [*]\n \n Still --> Moving\n Moving --> Still\n Moving --> Crash\n Crash --> [*]"
|
|
157
|
+
}, {
|
|
158
|
+
label: t('ERDiagram'),
|
|
159
|
+
value: "erDiagram\n CUSTOMER ||--o{ ORDER : places\n ORDER ||--|{ LINE-ITEM : contains\n CUSTOMER }|..|{ DELIVERY-ADDRESS : uses"
|
|
160
|
+
}, {
|
|
161
|
+
label: t('userJourney'),
|
|
162
|
+
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
|
+
}, {
|
|
164
|
+
label: t('Gantt'),
|
|
165
|
+
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
|
+
}, {
|
|
167
|
+
label: t('pieChart'),
|
|
168
|
+
value: "pie title Pets adopted by volunteers\n \"Dogs\" : 386\n \"Cats\" : 85\n \"Rats\" : 15"
|
|
169
|
+
}, {
|
|
170
|
+
label: t('quadrantChart'),
|
|
171
|
+
value: "quadrantChart\n title Reach and engagement of campaigns\n x-axis Low Reach --> High Reach\n y-axis Low Engagement --> High Engagement\n quadrant-1 We should expand\n quadrant-2 Need to promote\n quadrant-3 Re-evaluate\n quadrant-4 May be improved\n Campaign A: [0.3, 0.6]\n Campaign B: [0.45, 0.23]\n Campaign C: [0.57, 0.69]\n Campaign D: [0.78, 0.34]\n Campaign E: [0.40, 0.34]\n Campaign F: [0.35, 0.78]"
|
|
172
|
+
}, {
|
|
173
|
+
label: t('requirementDiagram'),
|
|
174
|
+
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
|
+
}, {
|
|
176
|
+
label: t('gitGraphDiagram'),
|
|
177
|
+
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
|
+
}, {
|
|
179
|
+
label: t('mindMaps'),
|
|
180
|
+
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
|
+
}, {
|
|
182
|
+
label: t('timeLine'),
|
|
183
|
+
value: "timeline\n title History of Social Media Platform\n 2002 : LinkedIn\n 2004 : Facebook\n : Google\n 2005 : Youtube\n 2006 : Twitter"
|
|
184
|
+
}];
|
|
220
185
|
return {
|
|
221
186
|
blockquote: {
|
|
222
187
|
children: /*#__PURE__*/React.createElement(SvgBlockquote, {
|
package/dist/index.d.ts
CHANGED
|
@@ -9,3 +9,5 @@ export { default as XStarMdEditor, useMdEditorRef } from './x-star-md-editor';
|
|
|
9
9
|
export type { XStarMdEditorHandle, XStarMdEditorPlugin, XStarMdEditorProps, } from './x-star-md-editor';
|
|
10
10
|
export { default as XStarMdViewer, useMdViewerRef } from './x-star-md-viewer';
|
|
11
11
|
export type { XStarMdViewerHandle, XStarMdViewerPlugin, XStarMdViewerProps, } from './x-star-md-viewer';
|
|
12
|
+
export { default as XStarSlideViewer, useSlideViewerRef, } from './x-star-slide-viewer';
|
|
13
|
+
export type { XStarSlideViewerHandle, XStarSlideViewerPlugin, XStarSlideViewerProps, } from './x-star-slide-viewer';
|
package/dist/index.js
CHANGED
|
@@ -3,4 +3,5 @@ export { batchHandler, insertHandler, mutateHandler, redoHandler, selectHandler,
|
|
|
3
3
|
export { 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
|
-
export { default as XStarMdViewer, useMdViewerRef } from "./x-star-md-viewer";
|
|
6
|
+
export { default as XStarMdViewer, useMdViewerRef } from "./x-star-md-viewer";
|
|
7
|
+
export { default as XStarSlideViewer, useSlideViewerRef } from "./x-star-slide-viewer";
|
package/dist/locales/en_US.d.ts
CHANGED
|
@@ -34,6 +34,19 @@ 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";
|
|
39
|
+
readonly classDiagram: "Class Diagram";
|
|
40
|
+
readonly stateDiagram: "State Diagram";
|
|
41
|
+
readonly ERDiagram: "Entity Relationship Diagram";
|
|
42
|
+
readonly userJourney: "User Journey";
|
|
43
|
+
readonly Gantt: "Gantt";
|
|
44
|
+
readonly pieChart: "Pie Chart";
|
|
45
|
+
readonly quadrantChart: "Quadrant Chart";
|
|
46
|
+
readonly requirementDiagram: "Requirement Diagram";
|
|
47
|
+
readonly gitGraphDiagram: "Gitgraph (Git) Diagram";
|
|
48
|
+
readonly mindMaps: "Mindmaps";
|
|
49
|
+
readonly timeLine: "Timeline";
|
|
37
50
|
};
|
|
38
51
|
};
|
|
39
52
|
export default _default;
|
package/dist/locales/en_US.js
CHANGED
|
@@ -33,6 +33,19 @@ export default {
|
|
|
33
33
|
toMarkdown: 'To Markdown',
|
|
34
34
|
undo: 'Undo',
|
|
35
35
|
unorderedList: 'Unordered List',
|
|
36
|
-
viewOnly: 'View Only'
|
|
36
|
+
viewOnly: 'View Only',
|
|
37
|
+
flowChat: 'Flowchart',
|
|
38
|
+
sequenceDiagram: 'sequenceDiagram',
|
|
39
|
+
classDiagram: 'Class Diagram',
|
|
40
|
+
stateDiagram: 'State Diagram',
|
|
41
|
+
ERDiagram: 'Entity Relationship Diagram',
|
|
42
|
+
userJourney: 'User Journey',
|
|
43
|
+
Gantt: 'Gantt',
|
|
44
|
+
pieChart: 'Pie Chart',
|
|
45
|
+
quadrantChart: 'Quadrant Chart',
|
|
46
|
+
requirementDiagram: 'Requirement Diagram',
|
|
47
|
+
gitGraphDiagram: 'Gitgraph (Git) Diagram',
|
|
48
|
+
mindMaps: 'Mindmaps',
|
|
49
|
+
timeLine: 'Timeline'
|
|
37
50
|
}
|
|
38
51
|
};
|
package/dist/locales/index.d.ts
CHANGED
|
@@ -45,6 +45,19 @@ 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: "时序图";
|
|
50
|
+
readonly classDiagram: "类图";
|
|
51
|
+
readonly stateDiagram: "状态图";
|
|
52
|
+
readonly ERDiagram: "实体关系图";
|
|
53
|
+
readonly userJourney: "用户旅程图";
|
|
54
|
+
readonly Gantt: "甘特图";
|
|
55
|
+
readonly pieChart: "饼图";
|
|
56
|
+
readonly quadrantChart: "四象限图";
|
|
57
|
+
readonly requirementDiagram: "需求图";
|
|
58
|
+
readonly gitGraphDiagram: "Git图";
|
|
59
|
+
readonly mindMaps: "思维导图";
|
|
60
|
+
readonly timeLine: "时间线图";
|
|
48
61
|
};
|
|
49
62
|
} | {
|
|
50
63
|
readonly fileInput: {
|
|
@@ -82,6 +95,19 @@ export declare const useLocale: <T extends "fileInput" | "toolbarItem">(slice: T
|
|
|
82
95
|
readonly undo: "Undo";
|
|
83
96
|
readonly unorderedList: "Unordered List";
|
|
84
97
|
readonly viewOnly: "View Only";
|
|
98
|
+
readonly flowChat: "Flowchart";
|
|
99
|
+
readonly sequenceDiagram: "sequenceDiagram";
|
|
100
|
+
readonly classDiagram: "Class Diagram";
|
|
101
|
+
readonly stateDiagram: "State Diagram";
|
|
102
|
+
readonly ERDiagram: "Entity Relationship Diagram";
|
|
103
|
+
readonly userJourney: "User Journey";
|
|
104
|
+
readonly Gantt: "Gantt";
|
|
105
|
+
readonly pieChart: "Pie Chart";
|
|
106
|
+
readonly quadrantChart: "Quadrant Chart";
|
|
107
|
+
readonly requirementDiagram: "Requirement Diagram";
|
|
108
|
+
readonly gitGraphDiagram: "Gitgraph (Git) Diagram";
|
|
109
|
+
readonly mindMaps: "Mindmaps";
|
|
110
|
+
readonly timeLine: "Timeline";
|
|
85
111
|
};
|
|
86
112
|
})[T][U];
|
|
87
113
|
};
|
|
@@ -121,6 +147,19 @@ export declare const getFormat: <T extends "fileInput" | "toolbarItem">(locale:
|
|
|
121
147
|
readonly undo: "撤销";
|
|
122
148
|
readonly unorderedList: "无序列表";
|
|
123
149
|
readonly viewOnly: "仅查看";
|
|
150
|
+
readonly flowChat: "流程图";
|
|
151
|
+
readonly sequenceDiagram: "时序图";
|
|
152
|
+
readonly classDiagram: "类图";
|
|
153
|
+
readonly stateDiagram: "状态图";
|
|
154
|
+
readonly ERDiagram: "实体关系图";
|
|
155
|
+
readonly userJourney: "用户旅程图";
|
|
156
|
+
readonly Gantt: "甘特图";
|
|
157
|
+
readonly pieChart: "饼图";
|
|
158
|
+
readonly quadrantChart: "四象限图";
|
|
159
|
+
readonly requirementDiagram: "需求图";
|
|
160
|
+
readonly gitGraphDiagram: "Git图";
|
|
161
|
+
readonly mindMaps: "思维导图";
|
|
162
|
+
readonly timeLine: "时间线图";
|
|
124
163
|
};
|
|
125
164
|
} | {
|
|
126
165
|
readonly fileInput: {
|
|
@@ -158,6 +197,19 @@ export declare const getFormat: <T extends "fileInput" | "toolbarItem">(locale:
|
|
|
158
197
|
readonly undo: "Undo";
|
|
159
198
|
readonly unorderedList: "Unordered List";
|
|
160
199
|
readonly viewOnly: "View Only";
|
|
200
|
+
readonly flowChat: "Flowchart";
|
|
201
|
+
readonly sequenceDiagram: "sequenceDiagram";
|
|
202
|
+
readonly classDiagram: "Class Diagram";
|
|
203
|
+
readonly stateDiagram: "State Diagram";
|
|
204
|
+
readonly ERDiagram: "Entity Relationship Diagram";
|
|
205
|
+
readonly userJourney: "User Journey";
|
|
206
|
+
readonly Gantt: "Gantt";
|
|
207
|
+
readonly pieChart: "Pie Chart";
|
|
208
|
+
readonly quadrantChart: "Quadrant Chart";
|
|
209
|
+
readonly requirementDiagram: "Requirement Diagram";
|
|
210
|
+
readonly gitGraphDiagram: "Gitgraph (Git) Diagram";
|
|
211
|
+
readonly mindMaps: "Mindmaps";
|
|
212
|
+
readonly timeLine: "Timeline";
|
|
161
213
|
};
|
|
162
214
|
})[T][U];
|
|
163
215
|
export {};
|
package/dist/locales/zh_CN.d.ts
CHANGED
|
@@ -34,6 +34,19 @@ declare const _default: {
|
|
|
34
34
|
readonly undo: "撤销";
|
|
35
35
|
readonly unorderedList: "无序列表";
|
|
36
36
|
readonly viewOnly: "仅查看";
|
|
37
|
+
readonly flowChat: "流程图";
|
|
38
|
+
readonly sequenceDiagram: "时序图";
|
|
39
|
+
readonly classDiagram: "类图";
|
|
40
|
+
readonly stateDiagram: "状态图";
|
|
41
|
+
readonly ERDiagram: "实体关系图";
|
|
42
|
+
readonly userJourney: "用户旅程图";
|
|
43
|
+
readonly Gantt: "甘特图";
|
|
44
|
+
readonly pieChart: "饼图";
|
|
45
|
+
readonly quadrantChart: "四象限图";
|
|
46
|
+
readonly requirementDiagram: "需求图";
|
|
47
|
+
readonly gitGraphDiagram: "Git图";
|
|
48
|
+
readonly mindMaps: "思维导图";
|
|
49
|
+
readonly timeLine: "时间线图";
|
|
37
50
|
};
|
|
38
51
|
};
|
|
39
52
|
export default _default;
|
package/dist/locales/zh_CN.js
CHANGED
|
@@ -33,6 +33,19 @@ export default {
|
|
|
33
33
|
toMarkdown: '转成 Markdown',
|
|
34
34
|
undo: '撤销',
|
|
35
35
|
unorderedList: '无序列表',
|
|
36
|
-
viewOnly: '仅查看'
|
|
36
|
+
viewOnly: '仅查看',
|
|
37
|
+
flowChat: '流程图',
|
|
38
|
+
sequenceDiagram: '时序图',
|
|
39
|
+
classDiagram: '类图',
|
|
40
|
+
stateDiagram: '状态图',
|
|
41
|
+
ERDiagram: '实体关系图',
|
|
42
|
+
userJourney: '用户旅程图',
|
|
43
|
+
Gantt: '甘特图',
|
|
44
|
+
pieChart: '饼图',
|
|
45
|
+
quadrantChart: '四象限图',
|
|
46
|
+
requirementDiagram: '需求图',
|
|
47
|
+
gitGraphDiagram: 'Git图',
|
|
48
|
+
mindMaps: '思维导图',
|
|
49
|
+
timeLine: '时间线图'
|
|
37
50
|
}
|
|
38
51
|
};
|
|
Binary file
|
|
Binary file
|