cherry-muse 1.0.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.
Files changed (226) hide show
  1. package/LICENSE +162 -0
  2. package/README.md +139 -0
  3. package/dist/addons/cherry-code-block-card-plugin.js +1 -0
  4. package/dist/addons/cherry-code-block-echarts-plugin.js +1 -0
  5. package/dist/addons/cherry-code-block-mermaid-plugin.js +1 -0
  6. package/dist/cherry-markdown.core.common.js +1 -0
  7. package/dist/cherry-markdown.core.js +1 -0
  8. package/dist/cherry-markdown.css +4089 -0
  9. package/dist/cherry-markdown.engine.core.common.js +1 -0
  10. package/dist/cherry-markdown.engine.core.esm.js +1 -0
  11. package/dist/cherry-markdown.engine.core.js +1 -0
  12. package/dist/cherry-markdown.esm.js +1 -0
  13. package/dist/cherry-markdown.js +70837 -0
  14. package/dist/cherry-markdown.js.map +1 -0
  15. package/dist/cherry-markdown.min.css +1 -0
  16. package/dist/cherry-markdown.min.js +1 -0
  17. package/dist/stats.html +4838 -0
  18. package/examples/scripts/pinyin/README.md +53 -0
  19. package/package.json +167 -0
  20. package/src/Cherry.config.js +411 -0
  21. package/src/Cherry.js +788 -0
  22. package/src/CherryStatic.js +70 -0
  23. package/src/Editor.js +746 -0
  24. package/src/Engine.js +334 -0
  25. package/src/Event.js +74 -0
  26. package/src/Factory.js +180 -0
  27. package/src/Logger.js +31 -0
  28. package/src/Previewer.js +1147 -0
  29. package/src/Sanitizer.js +4 -0
  30. package/src/Sanitizer.node.js +7 -0
  31. package/src/Stats.js +101 -0
  32. package/src/Theme.js +46 -0
  33. package/src/UrlCache.js +98 -0
  34. package/src/addons/cherry-code-block-card-plugin.js +213 -0
  35. package/src/addons/cherry-code-block-echarts-plugin.js +161 -0
  36. package/src/addons/cherry-code-block-mermaid-plugin.js +118 -0
  37. package/src/core/HookCenter.js +303 -0
  38. package/src/core/HooksConfig.js +106 -0
  39. package/src/core/ParagraphBase.js +314 -0
  40. package/src/core/SentenceBase.js +65 -0
  41. package/src/core/SyntaxBase.js +197 -0
  42. package/src/core/hooks/AutoLink.js +251 -0
  43. package/src/core/hooks/BackgroundColor.js +46 -0
  44. package/src/core/hooks/Badge.js +100 -0
  45. package/src/core/hooks/Blockquote.js +113 -0
  46. package/src/core/hooks/Br.js +85 -0
  47. package/src/core/hooks/CodeBlock.js +876 -0
  48. package/src/core/hooks/Color.js +78 -0
  49. package/src/core/hooks/CommentReference.js +96 -0
  50. package/src/core/hooks/Detail.js +138 -0
  51. package/src/core/hooks/Emoji.config.js +9388 -0
  52. package/src/core/hooks/Emoji.js +223 -0
  53. package/src/core/hooks/Emphasis.js +113 -0
  54. package/src/core/hooks/Footnote.js +125 -0
  55. package/src/core/hooks/FrontMatter.js +52 -0
  56. package/src/core/hooks/FrontMatterVars.js +82 -0
  57. package/src/core/hooks/Header.js +229 -0
  58. package/src/core/hooks/HighLight.js +37 -0
  59. package/src/core/hooks/Hr.js +52 -0
  60. package/src/core/hooks/HtmlBlock.js +159 -0
  61. package/src/core/hooks/Iframe.js +80 -0
  62. package/src/core/hooks/Image.js +276 -0
  63. package/src/core/hooks/InlineCode.js +45 -0
  64. package/src/core/hooks/InlineMath.js +142 -0
  65. package/src/core/hooks/Link.js +169 -0
  66. package/src/core/hooks/List.js +260 -0
  67. package/src/core/hooks/Mark.js +55 -0
  68. package/src/core/hooks/MathBlock.js +97 -0
  69. package/src/core/hooks/Panel.js +170 -0
  70. package/src/core/hooks/Paragraph.js +84 -0
  71. package/src/core/hooks/Ruby.js +34 -0
  72. package/src/core/hooks/Size.js +84 -0
  73. package/src/core/hooks/Strikethrough.js +54 -0
  74. package/src/core/hooks/Sub.js +47 -0
  75. package/src/core/hooks/SuggestList.js +317 -0
  76. package/src/core/hooks/Suggester.js +759 -0
  77. package/src/core/hooks/Sup.js +47 -0
  78. package/src/core/hooks/Table.js +315 -0
  79. package/src/core/hooks/Toc.js +290 -0
  80. package/src/core/hooks/Transfer.js +47 -0
  81. package/src/core/hooks/Underline.js +37 -0
  82. package/src/index.core.js +29 -0
  83. package/src/index.engine.core.js +62 -0
  84. package/src/index.engine.js +30 -0
  85. package/src/index.js +28 -0
  86. package/src/locales/index.js +21 -0
  87. package/src/locales/zh_CN.js +170 -0
  88. package/src/sass/cherry.scss +122 -0
  89. package/src/sass/components/bubble.scss +122 -0
  90. package/src/sass/components/codemirror.scss +628 -0
  91. package/src/sass/components/dropdown.scss +37 -0
  92. package/src/sass/components/editor.scss +78 -0
  93. package/src/sass/components/preview.scss +71 -0
  94. package/src/sass/components/prism.scss +142 -0
  95. package/src/sass/components/stats.scss +32 -0
  96. package/src/sass/components/toc.scss +184 -0
  97. package/src/sass/components/toolbar.scss +117 -0
  98. package/src/sass/core/AutoLink.scss +20 -0
  99. package/src/sass/core/BackgroundColor.scss +0 -0
  100. package/src/sass/core/Badge.scss +116 -0
  101. package/src/sass/core/Blockquote.scss +12 -0
  102. package/src/sass/core/Br.scss +0 -0
  103. package/src/sass/core/Card.scss +219 -0
  104. package/src/sass/core/CodeBlock.scss +205 -0
  105. package/src/sass/core/Color.scss +37 -0
  106. package/src/sass/core/CommentReference.scss +0 -0
  107. package/src/sass/core/Detail.scss +107 -0
  108. package/src/sass/core/Emoji.scss +127 -0
  109. package/src/sass/core/Emphasis.scss +9 -0
  110. package/src/sass/core/Footnote.scss +21 -0
  111. package/src/sass/core/FrontMatterVars.scss +19 -0
  112. package/src/sass/core/Header.scss +103 -0
  113. package/src/sass/core/HighLight.scss +0 -0
  114. package/src/sass/core/Hr.scss +10 -0
  115. package/src/sass/core/HtmlBlock.scss +0 -0
  116. package/src/sass/core/Iframe.scss +36 -0
  117. package/src/sass/core/Image.scss +59 -0
  118. package/src/sass/core/InlineCode.scss +10 -0
  119. package/src/sass/core/InlineMath.scss +11 -0
  120. package/src/sass/core/Link.scss +16 -0
  121. package/src/sass/core/List.scss +61 -0
  122. package/src/sass/core/Mark.scss +15 -0
  123. package/src/sass/core/MathBlock.scss +0 -0
  124. package/src/sass/core/Panel.scss +150 -0
  125. package/src/sass/core/Paragraph.scss +6 -0
  126. package/src/sass/core/Ruby.scss +0 -0
  127. package/src/sass/core/Size.scss +8 -0
  128. package/src/sass/core/Strikethrough.scss +0 -0
  129. package/src/sass/core/Sub.scss +5 -0
  130. package/src/sass/core/Suggester.scss +62 -0
  131. package/src/sass/core/Sup.scss +5 -0
  132. package/src/sass/core/Table.scss +127 -0
  133. package/src/sass/core/Toc.scss +28 -0
  134. package/src/sass/core/Transfer.scss +0 -0
  135. package/src/sass/core/Underline.scss +0 -0
  136. package/src/sass/google-fonts.scss +34 -0
  137. package/src/sass/index.scss +3 -0
  138. package/src/sass/prism/dark.scss +131 -0
  139. package/src/sass/prism/light.scss +143 -0
  140. package/src/sass/variables/colors.scss +96 -0
  141. package/src/toolbars/Bubble.js +232 -0
  142. package/src/toolbars/BubbleTable.js +147 -0
  143. package/src/toolbars/HookCenter.js +185 -0
  144. package/src/toolbars/MenuBase.js +357 -0
  145. package/src/toolbars/PreviewerBubble.js +558 -0
  146. package/src/toolbars/Toc.js +246 -0
  147. package/src/toolbars/Toolbar.js +401 -0
  148. package/src/toolbars/hooks/Audio.js +53 -0
  149. package/src/toolbars/hooks/Badge.js +80 -0
  150. package/src/toolbars/hooks/BarTable.js +41 -0
  151. package/src/toolbars/hooks/Bold.js +70 -0
  152. package/src/toolbars/hooks/Br.js +34 -0
  153. package/src/toolbars/hooks/Card.js +64 -0
  154. package/src/toolbars/hooks/CheckList.js +41 -0
  155. package/src/toolbars/hooks/Code.js +46 -0
  156. package/src/toolbars/hooks/Color.js +285 -0
  157. package/src/toolbars/hooks/Copy.js +139 -0
  158. package/src/toolbars/hooks/Detail.js +70 -0
  159. package/src/toolbars/hooks/ECharts.js +303 -0
  160. package/src/toolbars/hooks/Emoji.js +303 -0
  161. package/src/toolbars/hooks/Export.js +47 -0
  162. package/src/toolbars/hooks/File.js +54 -0
  163. package/src/toolbars/hooks/Formula.js +36 -0
  164. package/src/toolbars/hooks/FullScreen.js +55 -0
  165. package/src/toolbars/hooks/Graph.js +281 -0
  166. package/src/toolbars/hooks/H1.js +71 -0
  167. package/src/toolbars/hooks/H2.js +71 -0
  168. package/src/toolbars/hooks/H3.js +71 -0
  169. package/src/toolbars/hooks/Header.js +100 -0
  170. package/src/toolbars/hooks/Hr.js +35 -0
  171. package/src/toolbars/hooks/Iframe.js +35 -0
  172. package/src/toolbars/hooks/Image.js +60 -0
  173. package/src/toolbars/hooks/Insert.js +36 -0
  174. package/src/toolbars/hooks/Italic.js +70 -0
  175. package/src/toolbars/hooks/LineTable.js +41 -0
  176. package/src/toolbars/hooks/Link.js +46 -0
  177. package/src/toolbars/hooks/List.js +55 -0
  178. package/src/toolbars/hooks/Ol.js +41 -0
  179. package/src/toolbars/hooks/Panel.js +155 -0
  180. package/src/toolbars/hooks/Quote.js +45 -0
  181. package/src/toolbars/hooks/Redo.js +33 -0
  182. package/src/toolbars/hooks/Ruby.js +59 -0
  183. package/src/toolbars/hooks/Size.js +100 -0
  184. package/src/toolbars/hooks/Split.js +37 -0
  185. package/src/toolbars/hooks/Strikethrough.js +65 -0
  186. package/src/toolbars/hooks/Sub.js +58 -0
  187. package/src/toolbars/hooks/Sup.js +58 -0
  188. package/src/toolbars/hooks/SwitchModel.js +78 -0
  189. package/src/toolbars/hooks/Table.js +56 -0
  190. package/src/toolbars/hooks/Toc.js +35 -0
  191. package/src/toolbars/hooks/TogglePreview.js +79 -0
  192. package/src/toolbars/hooks/Ul.js +41 -0
  193. package/src/toolbars/hooks/Underline.js +65 -0
  194. package/src/toolbars/hooks/Undo.js +30 -0
  195. package/src/toolbars/hooks/Video.js +53 -0
  196. package/src/utils/LazyLoadImg.js +341 -0
  197. package/src/utils/autoindent.js +58 -0
  198. package/src/utils/codeBlockContentHandler.js +351 -0
  199. package/src/utils/config.js +98 -0
  200. package/src/utils/copy.js +55 -0
  201. package/src/utils/dialog.js +196 -0
  202. package/src/utils/dom.js +162 -0
  203. package/src/utils/downloadUtil.js +23 -0
  204. package/src/utils/env.js +22 -0
  205. package/src/utils/error.js +61 -0
  206. package/src/utils/event.js +38 -0
  207. package/src/utils/export.js +115 -0
  208. package/src/utils/file.js +121 -0
  209. package/src/utils/formulaUtilsHandler.js +230 -0
  210. package/src/utils/htmlparser.js +977 -0
  211. package/src/utils/image.js +99 -0
  212. package/src/utils/imgSizeHandler.js +279 -0
  213. package/src/utils/jsonUtils.js +17 -0
  214. package/src/utils/lineFeed.js +49 -0
  215. package/src/utils/listContentHandler.js +227 -0
  216. package/src/utils/lookbehind-replace.js +81 -0
  217. package/src/utils/mathjax.js +89 -0
  218. package/src/utils/myersDiff.js +211 -0
  219. package/src/utils/pasteHelper.js +253 -0
  220. package/src/utils/recount-pos.js +59 -0
  221. package/src/utils/regexp.js +295 -0
  222. package/src/utils/sanitize.js +477 -0
  223. package/src/utils/selection.js +50 -0
  224. package/src/utils/svgUtils.js +96 -0
  225. package/src/utils/tableContentHandler.js +592 -0
  226. package/tools/README.md +3 -0
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Copyright (C) 2021 THL A29 Limited, a Tencent company.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import SyntaxBase from '@/core/SyntaxBase';
17
+
18
+ export default class Underline extends SyntaxBase {
19
+ static HOOK_NAME = 'underline';
20
+
21
+ // constructor() {
22
+ // super();
23
+ // }
24
+
25
+ makeHtml(str) {
26
+ if (!this.test(str)) {
27
+ return str;
28
+ }
29
+ return str.replace(this.RULE.reg, '$1<span style="text-decoration: underline;">$2</span>$3');
30
+ }
31
+
32
+ rule() {
33
+ const ret = { begin: '(^| )\\/', end: '\\/( |$)', content: '([^\\n]+?)' };
34
+ ret.reg = new RegExp(ret.begin + ret.content + ret.end, 'g');
35
+ return ret;
36
+ }
37
+ }
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Copyright (C) 2021 THL A29 Limited, a Tencent company.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import Cherry from './Cherry';
17
+
18
+ import SyntaxHookBase from './core/SyntaxBase';
19
+ import MenuHookBase from './toolbars/MenuBase';
20
+
21
+ // in browser
22
+ if (window) {
23
+ // @ts-ignore
24
+ window.Cherry = Cherry;
25
+ }
26
+
27
+ export { SyntaxHookBase, MenuHookBase };
28
+
29
+ export default Cherry;
@@ -0,0 +1,62 @@
1
+ /**
2
+ * Copyright (C) 2021 THL A29 Limited, a Tencent company.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import mergeWith from 'lodash/mergeWith';
17
+
18
+ import Engine from './Engine';
19
+ import { CherryStatic } from './CherryStatic';
20
+ import SyntaxHookBase from './core/SyntaxBase';
21
+ import MenuHookBase from './toolbars/MenuBase';
22
+ import defaultConfig from './Cherry.config';
23
+ import { customizer } from './utils/config';
24
+ import cloneDeep from 'lodash/cloneDeep';
25
+ import { urlProcessorProxy } from './UrlCache';
26
+
27
+ class CherryEngine extends CherryStatic {
28
+ /**
29
+ * @private
30
+ */
31
+ static initialized = false;
32
+ // TODO: 共用config
33
+ /**
34
+ * @readonly
35
+ */
36
+ static config = {
37
+ defaults: defaultConfig,
38
+ };
39
+
40
+ /**
41
+ * @param {any} options
42
+ */
43
+ constructor(options) {
44
+ super();
45
+ CherryEngine.initialized = true;
46
+ const defaultConfigCopy = cloneDeep(CherryEngine.config.defaults);
47
+ const opts = mergeWith({}, defaultConfigCopy, options, customizer);
48
+
49
+ if (typeof opts.engine.global.urlProcessor === 'function') {
50
+ opts.engine.global.urlProcessor = urlProcessorProxy(opts.engine.global.urlProcessor);
51
+ }
52
+
53
+ // @ts-ignore hack Cherry Instance
54
+ return new Engine(opts, { options: opts });
55
+ }
56
+ }
57
+
58
+ export { SyntaxHookBase, MenuHookBase };
59
+
60
+ const CherryEngineExport = CherryEngine;
61
+
62
+ export default CherryEngineExport;
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Copyright (C) 2021 THL A29 Limited, a Tencent company.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import CherryEngine from './index.engine.core';
17
+ import MermaidCodeEngine from './addons/cherry-code-block-mermaid-plugin';
18
+ import Cherry from '@/index.core';
19
+ import EChartsCodeEngine from '@/addons/cherry-code-block-echarts-plugin';
20
+ import CardCodeEngine from '@/addons/cherry-code-block-card-plugin';
21
+
22
+ CherryEngine.usePlugin(MermaidCodeEngine, {
23
+ theme: 'default',
24
+ sequence: { useMaxWidth: false, showSequenceNumbers: true },
25
+ });
26
+
27
+ Cherry.usePlugin(EChartsCodeEngine, {});
28
+ Cherry.usePlugin(CardCodeEngine, {});
29
+ export * from './index.engine.core';
30
+ export default CherryEngine;
package/src/index.js ADDED
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Copyright (C) 2021 THL A29 Limited, a Tencent company.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import Cherry from './index.core';
17
+ import MermaidCodeEngine from '@/addons/cherry-code-block-mermaid-plugin';
18
+ import EChartsCodeEngine from '@/addons/cherry-code-block-echarts-plugin';
19
+ import CardCodeEngine from '@/addons/cherry-code-block-card-plugin';
20
+
21
+ Cherry.usePlugin(MermaidCodeEngine, {
22
+ theme: 'default',
23
+ sequence: { useMaxWidth: false },
24
+ });
25
+ Cherry.usePlugin(EChartsCodeEngine, {});
26
+ Cherry.usePlugin(CardCodeEngine, {});
27
+ export * from './index.core';
28
+ export default Cherry;
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Copyright (C) 2021 THL A29 Limited, a Tencent company.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ import zhCn from './zh_CN';
18
+
19
+ export default {
20
+ zh_CN: zhCn,
21
+ };
@@ -0,0 +1,170 @@
1
+ /**
2
+ * Copyright (C) 2021 THL A29 Limited, a Tencent company.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ export default {
17
+ switchModel: '模式切换',
18
+ switchEdit: '返回编辑',
19
+
20
+ pastePlain: '粘贴为纯文本格式',
21
+ pasteMarkdown: '粘贴为markdown格式',
22
+ hide: '隐藏(ctrl+0)',
23
+
24
+ //
25
+ audio: '音频',
26
+
27
+ badge: '徽章',
28
+ badgeTip: '提示徽章',
29
+ badgeInfo: '信息徽章',
30
+ badgeWarn: '警告徽章',
31
+ badgeDanger: '危险徽章',
32
+ badgeImportant: '重要徽章',
33
+ badgeTop: '上标徽章',
34
+ badgeCenter: '居中徽章',
35
+ badgeBottom: '下标徽章',
36
+
37
+ barTable: '柱状图表格',
38
+
39
+ bold: '加粗',
40
+
41
+ card: '卡片',
42
+ normalCard: '普通卡片',
43
+ noImageCard: '无图卡片',
44
+ imageCard: '图文卡片',
45
+
46
+ checklist: '清单',
47
+ //
48
+ code: '行内代码',
49
+ codeBlock: '代码块',
50
+ color: '颜色',
51
+ //
52
+ copy: '复制内容',
53
+ detail: '详情',
54
+
55
+ detailOpen: '默认展开详情',
56
+ detailClose: '默认关闭详情',
57
+
58
+ echarts: '图表',
59
+ basicBarChart: '基本柱状图',
60
+ stackedBarChart: '堆叠柱状图',
61
+ basicLineChart: '基础折线图',
62
+ stackedLineChart: '堆叠折线图',
63
+ areaChart: '区域面积图',
64
+ smoothCurveChart: '平滑曲线图',
65
+ ladderLineDiagram: '阶梯线图',
66
+ pieChart: '基础饼图',
67
+ circleDiagram: '圆环图',
68
+ roseChart: '玫瑰图',
69
+ scatterPlot: '基础散点图',
70
+ //
71
+ export: '导出',
72
+ exportToPdf: '导出PDF',
73
+ exportMarkdownFile: '导出MD',
74
+ exportHTMLFile: '导出HTML',
75
+
76
+ fullScreen: '全屏',
77
+
78
+ graph: '画图',
79
+
80
+ insertFlow: '流程图',
81
+ insertSeq: '时序图',
82
+ insertState: '状态图',
83
+ insertClass: '类图',
84
+ insertPie: '饼图',
85
+ insertGantt: '甘特图',
86
+ insertErDiagram: '实体关系图',
87
+ insertJourney: '用户旅程图',
88
+ insertQuadrantChart: '象限图',
89
+ insertRequirementDiagram: '需求图',
90
+ insertGitGraph: 'Git提交图',
91
+ insertC4Dynamic: 'C4 图',
92
+ insertMindmap: '思维导图',
93
+ insertXyChart: 'XY 图表',
94
+ insertTimeline: '时间线',
95
+ insertSankey: '桑基图',
96
+
97
+ header: '标题',
98
+ h1: '一级标题',
99
+ h2: '二级标题',
100
+ h3: '三级标题',
101
+ h4: '四级标题',
102
+ h5: '五级标题',
103
+
104
+ hr: '分隔线',
105
+
106
+ image: '图片',
107
+ insert: '插入',
108
+ br: '换行',
109
+ formula: '行内公式',
110
+ toc: '目录',
111
+
112
+ video: '视频',
113
+ link: '超链接',
114
+ file: '文件',
115
+ table: '表格',
116
+ 'line-table': '折线表格',
117
+ 'bar-table': '柱状表格',
118
+ headlessTable: '无头表格',
119
+ ruby: '拼音',
120
+
121
+ italic: '斜体',
122
+ list: '列表',
123
+ ol: '有序列表',
124
+ ul: '无序列表',
125
+
126
+ panel: '面板',
127
+ panelTip: '提示面板',
128
+ panelInfo: '信息面板',
129
+ panelWarn: '警告面板',
130
+ panelDanger: '危险面板',
131
+ panelImportant: '重要面板',
132
+ panelTop: '偏左面板',
133
+ panelCenter: '居中面板',
134
+ panelBottom: '偏右面板',
135
+
136
+ quote: '引用',
137
+ undo: '撤销',
138
+ redo: '恢复',
139
+
140
+ size: '大小',
141
+ 'size-1': '小',
142
+ 'size-2': '中',
143
+ 'size-3': '大',
144
+ 'size-4': '特大',
145
+
146
+ strikethrough: '删除线',
147
+ sub: '下标',
148
+ sup: '上标',
149
+
150
+ switchPreview: '预览',
151
+ tocListShow: '显示目录',
152
+ tocListHide: '隐藏目录',
153
+
154
+ previewClose: '关闭预览',
155
+ togglePreview: '预览',
156
+
157
+ underline: '下划线',
158
+
159
+ latexFormula: 'Latex公式',
160
+ latexFormulaInline: 'Latex行内公式',
161
+ highlight: '高亮',
162
+ footNoteTitle: '脚注标题',
163
+ footNoteText: '脚注内容',
164
+ wordCount: '字数',
165
+ wordParagraphs: '段落',
166
+ wordWords: '字数',
167
+ wordCharacters: '字符',
168
+ iframe: '嵌入网页',
169
+ emoji: `表情`,
170
+ };
@@ -0,0 +1,122 @@
1
+ @use "variables/colors";
2
+ @use "google-fonts" as *;
3
+
4
+ @use "components/bubble";
5
+ @use "components/toolbar" as *;
6
+ @use "components/dropdown" as *;
7
+ @use "components/codemirror" as *;
8
+ @use "components/editor" as *;
9
+ @use "components/preview" as *;
10
+ @use "components/toc" as *;
11
+ @use "components/stats" as * ;
12
+ .cherry {
13
+ display: flex;
14
+ flex-flow: row wrap;
15
+ align-items: stretch;
16
+ align-content: flex-start;
17
+ height: 100%;
18
+ min-height: 100px;
19
+ position: relative;
20
+ &.fullscreen {
21
+ position: fixed;
22
+ top: 0;
23
+ left: 0;
24
+ right: 0;
25
+ bottom: 0;
26
+ z-index: 2000;
27
+ }
28
+ .cherry-editor,
29
+ .cherry-previewer {
30
+ max-height: calc(100% - var(--toolbar-height));
31
+ min-height: calc(100% - var(--toolbar-height));
32
+ }
33
+
34
+ .CodeMirror {
35
+ height: 100%;
36
+ }
37
+
38
+ &.cherry--no-toolbar {
39
+ .cherry-toolbar,
40
+ .cherry-sidebar {
41
+ height: 0;
42
+ display: none;
43
+ }
44
+
45
+ .cherry-editor,
46
+ .cherry-previewer {
47
+ max-height: 100%;
48
+ min-height: 100%;
49
+ }
50
+ }
51
+
52
+ line-height: var(--line-height);
53
+ color: var(--text-color);
54
+ background: var(--bg-color);
55
+
56
+ font-size: var(--font-size);
57
+ font-family: var(--font-family), serif;
58
+
59
+ .cherry-drag {
60
+ width: 1rem;
61
+ cursor: ew-resize;
62
+ position: absolute;
63
+ z-index: 12;
64
+ background: transparent;
65
+
66
+ &.cherry-drag--show {
67
+ width: 0.5rem;
68
+ display: block;
69
+ background: var(--drag-bg-color);
70
+ }
71
+
72
+ &.cherry-drag--hidden {
73
+ display: none;
74
+ }
75
+ }
76
+
77
+ .cherry-editor-mask {
78
+ z-index: 10;
79
+ position: absolute;
80
+ display: none;
81
+ background: var(--editor-mask-bg);
82
+
83
+ &.cherry-editor-mask--show {
84
+ display: block;
85
+ }
86
+ }
87
+
88
+ .cherry-previewer-mask {
89
+ z-index: 10;
90
+ position: absolute;
91
+ display: none;
92
+ background: var(--previewer-mask-bg);
93
+
94
+ &.cherry-previewer-mask--show {
95
+ display: block;
96
+ }
97
+ }
98
+
99
+ *::-webkit-scrollbar {
100
+ height: 0.5rem;
101
+ width: 0.5rem;
102
+ background: transparent;
103
+ }
104
+
105
+ *::-webkit-scrollbar:hover {
106
+ background: transparent;
107
+ }
108
+
109
+ *::-webkit-scrollbar-thumb {
110
+ background: var(--hover-bg-color);
111
+ -webkit-border-radius: var(--border-radius);
112
+ }
113
+
114
+ *::-webkit-scrollbar-thumb:hover {
115
+ background: var(--panel-border-color);
116
+ }
117
+
118
+ *::-webkit-scrollbar-corner {
119
+ background: transparent;
120
+ }
121
+
122
+ }
@@ -0,0 +1,122 @@
1
+ $bubble-min-height: 2.1875rem; // 35px converted to rem (35 / 16)
2
+
3
+ .cherry-bubble {
4
+ position: absolute;
5
+
6
+ display: flex;
7
+ align-items: center;
8
+ justify-content: flex-start;
9
+ flex-wrap: wrap;
10
+
11
+ font-size: 0.875rem; // 14px converted to rem (14 / 16)
12
+
13
+ // min-height for overflow wrap
14
+ min-height: $bubble-min-height;
15
+ min-width: 3.125rem; // 50px converted to rem (50 / 16)
16
+
17
+ border: var(--border);
18
+ background-color: var(--bg-color);
19
+ box-shadow: 0 0.125rem 0.9375rem -0.3125rem rgba(0, 0, 0, 0.5); // 0 2px 15px -5px converted to rem
20
+ border-radius: var(--border-radius);
21
+ z-index: 8;
22
+
23
+ &.cherry-bubble--centered {
24
+ left: 50%;
25
+ transform: translateX(-50%);
26
+ }
27
+
28
+ // triangle
29
+ .cherry-bubble-top,
30
+ .cherry-bubble-bottom {
31
+ position: absolute;
32
+ left: 50%;
33
+
34
+ width: 0;
35
+ height: 0;
36
+
37
+ margin-left: -0.5rem; // 8px converted to rem (8 / 16)
38
+ border-left: 0.5rem solid rgba(0, 0, 0, 0); // 8px converted to rem
39
+ border-right: 0.5rem solid rgba(0, 0, 0, 0); // 8px converted to rem
40
+ }
41
+
42
+ .cherry-bubble-top {
43
+ top: 0;
44
+ transform: translateY(-100%);
45
+ border-bottom: 0.5rem solid var(--bg-color); // 8px converted to rem
46
+ }
47
+
48
+ .cherry-bubble-bottom {
49
+ bottom: 0;
50
+ transform: translateY(100%);
51
+ border-top: 0.5rem solid var(--bg-color); // 8px converted to rem
52
+ }
53
+
54
+ .cherry-toolbar-button {
55
+ display: inline-flex;
56
+ align-items: center;
57
+ justify-content: center;
58
+ // FIXME: remove fixed height
59
+ height: $bubble-min-height;
60
+
61
+ // line-height: calc($bubble-min-height - 0.125rem); // border 2px
62
+ cursor: pointer;
63
+ user-select: none;
64
+
65
+ &:hover {
66
+ border-color: var(--active-file-border-color);
67
+ background-color: var(--hover-bg-color);
68
+
69
+ }
70
+
71
+ &.cherry-toolbar-split {
72
+ height: 65%;
73
+ min-height: calc(0.65 * #{$bubble-min-height});
74
+ }
75
+ }
76
+
77
+ }
78
+
79
+ .cherry-switch-paste {
80
+ .switch-btn--bg {
81
+ position: absolute;
82
+ width: 50%;
83
+ height: 100%;
84
+ box-sizing: border-box;
85
+ z-index: -1;
86
+ left: 0;
87
+ top: 0;
88
+ opacity: 0.3;
89
+ background-color: var(--active-file-border-color);
90
+ border-radius: var(--border-radius);
91
+ transition: all 0.3s;
92
+ }
93
+ .cherry-toolbar-button {
94
+ display: inline-flex;
95
+ align-items: center;
96
+ justify-content: center;
97
+ width: 5rem; // 80px converted to rem (80 / 16)
98
+ text-align: center;
99
+ &:hover {
100
+ border-color: transparent;
101
+ }
102
+ }
103
+ &[data-type='text'] {
104
+ .cherry-text-btn {
105
+ color: var(--text-color);
106
+ }
107
+ .cherry-md-btn {
108
+ color: var(--hover-text-color);
109
+ }
110
+ }
111
+ &[data-type='md'] {
112
+ .cherry-md-btn {
113
+ color: var(--text-color);
114
+ }
115
+ .cherry-text-btn {
116
+ color: var(--hover-text-color);
117
+ }
118
+ .switch-btn--bg {
119
+ left: 50%;
120
+ }
121
+ }
122
+ }