x-star-editor 0.6.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.
@@ -140,48 +140,48 @@ var headingOptions = [{
140
140
  depth: 6,
141
141
  fontSize: '0.9em'
142
142
  }];
143
- var mermaidOptions = [{
144
- label: 'Flowchart',
145
- 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]"
146
- }, {
147
- label: 'Sequence Diagram',
148
- value: "sequenceDiagram\n Alice->>John: Hello John, how are you?\n John-->>Alice: Great!\n Alice-)John: See you later!"
149
- }, {
150
- label: 'Class Diagram',
151
- 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 }"
152
- }, {
153
- label: 'State Diagram',
154
- value: "stateDiagram-v2\n [*] --> Still\n Still --> [*]\n\n Still --> Moving\n Moving --> Still\n Moving --> Crash\n Crash --> [*]"
155
- }, {
156
- label: 'Entity Relationship Diagram',
157
- value: "erDiagram\n CUSTOMER ||--o{ ORDER : places\n ORDER ||--|{ LINE-ITEM : contains\n CUSTOMER }|..|{ DELIVERY-ADDRESS : uses"
158
- }, {
159
- label: 'User Journey',
160
- 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"
161
- }, {
162
- label: 'Gantt',
163
- 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"
164
- }, {
165
- label: 'Pie Chart',
166
- value: "pie title Pets adopted by volunteers\n \"Dogs\" : 386\n \"Cats\" : 85\n \"Rats\" : 15"
167
- }, {
168
- label: 'Quadrant Chart',
169
- 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]"
170
- }, {
171
- label: 'Requirement Diagram',
172
- 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"
173
- }, {
174
- label: 'Gitgraph (Git) Diagram',
175
- 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"
176
- }, {
177
- label: 'Mindmaps',
178
- 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"
179
- }, {
180
- label: 'Timeline',
181
- value: "timeline\n title History of Social Media Platform\n 2002 : LinkedIn\n 2004 : Facebook\n : Google\n 2005 : Youtube\n 2006 : Twitter"
182
- }];
183
143
  export var getDefaultToolbarItemMap = function getDefaultToolbarItemMap(locale, onInsertFile) {
184
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
+ }];
185
185
  return {
186
186
  blockquote: {
187
187
  children: /*#__PURE__*/React.createElement(SvgBlockquote, {
@@ -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;
@@ -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
  };
@@ -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 {};
@@ -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;
@@ -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
  };
@@ -1847,8 +1847,8 @@ body {
1847
1847
  background-color: #c1def1;
1848
1848
  }
1849
1849
  .x-star-editor-slide-viewer .x-star-editor-slide {
1850
- width: 960px;
1851
- height: 540px;
1850
+ width: 1280px;
1851
+ height: 720px;
1852
1852
  padding: 0 32px;
1853
1853
  display: flex;
1854
1854
  flex-direction: column;
@@ -1889,7 +1889,7 @@ body {
1889
1889
  .x-star-editor-slide-viewer .x-star-editor-slide pre {
1890
1890
  width: 70%;
1891
1891
  }
1892
- .x-star-editor-slide-viewer .x-star-editor-slide img {
1892
+ .x-star-editor-slide-viewer .x-star-editor-slide img[id^=user-content-mermaid-] {
1893
1893
  width: 100%;
1894
1894
  max-height: 100%;
1895
1895
  }
@@ -200,7 +200,7 @@ var XStarSlideViewer = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
200
200
  var parentWidth = entries[0].contentRect.width; // 获取父容器的宽度
201
201
  // const pointData = signaturePadRef.current.toData();
202
202
  // const ratio = Math.max(window.devicePixelRatio || 1, 1);
203
- childRef.current.style.transform = "scale(".concat(parentWidth / 960, ")");
203
+ childRef.current.style.transform = "scale(".concat(parentWidth / 1280, ")");
204
204
  // canvasRef.current.width = parentWidth * ratio;
205
205
  // canvasRef.current.height = parentWidth * (9 / 16) * ratio;
206
206
  // pointData.forEach(({ points }) =>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "x-star-editor",
3
- "version": "0.6.0",
3
+ "version": "0.6.1",
4
4
  "description": "An editor developed by turingstar",
5
5
  "license": "MIT",
6
6
  "module": "dist/index.js",