md2x 0.7.3 → 0.7.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.
Files changed (141) hide show
  1. package/README.md +17 -7
  2. package/dist/chunks/chunk-54X5GPSM.js +1552 -0
  3. package/dist/chunks/chunk-US45GBOT.js +415 -0
  4. package/dist/chunks/docx-exporter-7C6T4DFB.js +1 -0
  5. package/dist/core-worker.js +1764 -0
  6. package/dist/index.js +1 -1
  7. package/dist/md2x.js +7 -5
  8. package/dist/renderer/core-worker-browser.js +1775 -0
  9. package/dist/renderer/live-runtime-canvas.js +24 -0
  10. package/dist/renderer/live-runtime-core.js +14 -0
  11. package/dist/renderer/live-runtime-dot.js +27 -0
  12. package/dist/renderer/live-runtime-html.js +14 -0
  13. package/dist/renderer/live-runtime-infographic.js +593 -0
  14. package/dist/renderer/live-runtime-md2x.js +24 -0
  15. package/dist/renderer/live-runtime-mermaid.js +14 -0
  16. package/dist/renderer/live-runtime-svg.js +14 -0
  17. package/dist/renderer/live-runtime-vega.js +218 -0
  18. package/dist/renderer/puppeteer-render.html +9 -1
  19. package/dist/renderer/puppeteer-runtime-core.js +14 -0
  20. package/dist/types/node/src/host/browser-renderer.d.ts +1 -175
  21. package/dist/types/node/src/host/core.d.ts +59 -0
  22. package/dist/types/node/src/host/index.d.ts +4 -47
  23. package/dist/types/node/src/host/node-exporter.d.ts +1 -84
  24. package/dist/types/node/src/host/node-platform.d.ts +1 -23
  25. package/dist/types/node/src/host/templates-data.d.ts +5 -0
  26. package/dist/types/node/src/host/themes-data.d.ts +2385 -0
  27. package/dist/types/node/src/host/types.d.ts +251 -0
  28. package/dist/types/node/src/index.d.ts +2 -3
  29. package/dist/types/src/types/index.d.ts +1 -1
  30. package/dist/types/src/types/render.d.ts +12 -0
  31. package/package.json +10 -2
  32. package/dist/chunks/chunk-2LPNL4GA.js +0 -1
  33. package/dist/chunks/chunk-3P5X57NT.js +0 -262
  34. package/dist/chunks/chunk-3VL755NO.js +0 -1
  35. package/dist/chunks/chunk-5DPTQTJJ.js +0 -1
  36. package/dist/chunks/chunk-AK6TXLWO.js +0 -1
  37. package/dist/chunks/chunk-CN4F5HOV.js +0 -5
  38. package/dist/chunks/chunk-CVKZIRZW.js +0 -5
  39. package/dist/chunks/chunk-DFROP2PD.js +0 -11
  40. package/dist/chunks/chunk-DJGIYXVP.js +0 -3
  41. package/dist/chunks/chunk-EFKQH5UR.js +0 -108
  42. package/dist/chunks/chunk-IENSDROB.js +0 -1
  43. package/dist/chunks/chunk-LLCWR7UA.js +0 -1
  44. package/dist/chunks/chunk-MHCTK6WW.js +0 -1
  45. package/dist/chunks/chunk-NM6J3ND7.js +0 -1
  46. package/dist/chunks/chunk-PARPCLXM.js +0 -1
  47. package/dist/chunks/chunk-PUOHPY5L.js +0 -16
  48. package/dist/chunks/chunk-R65AQGTF.js +0 -1
  49. package/dist/chunks/chunk-R6G2575A.js +0 -3
  50. package/dist/chunks/chunk-RLHZRADD.js +0 -1391
  51. package/dist/chunks/chunk-TRGQPVRY.js +0 -2
  52. package/dist/chunks/chunk-URO5RPHJ.js +0 -9
  53. package/dist/chunks/chunk-YFL3W3OS.js +0 -1
  54. package/dist/chunks/chunk-Z4LVGK7Y.js +0 -1
  55. package/dist/chunks/docx-exporter-ZZ76JXFU.js +0 -1
  56. package/dist/chunks/rehype-highlight-Y4Q4RX67.js +0 -1
  57. package/dist/chunks/rehype-katex-FXTCTSUE.js +0 -1
  58. package/dist/chunks/rehype-stringify-4CQSSRDL.js +0 -1
  59. package/dist/chunks/remark-gfm-BUZ4SLP3.js +0 -1
  60. package/dist/chunks/remark-math-HEZQAPFK.js +0 -1
  61. package/dist/chunks/remark-parse-QC7TSXTK.js +0 -1
  62. package/dist/chunks/remark-rehype-C2LX643P.js +0 -1
  63. package/dist/chunks/remark-super-sub-EP2AQS54.js +0 -1
  64. package/dist/chunks/theme-manager-AZBU2SLL.js +0 -1
  65. package/dist/chunks/theme-to-css-GLV3WYDU.js +0 -85
  66. package/dist/chunks/unified-PU53JLVJ.js +0 -1
  67. package/dist/chunks/unist-util-visit-SBSD62C6.js +0 -1
  68. package/dist/renderer/puppeteer-render-worker.js +0 -830
  69. package/dist/templates/html/example.html +0 -35
  70. package/dist/templates/svelte/example.svelte +0 -18
  71. package/dist/templates/vue/PrinterComponent.vue +0 -875
  72. package/dist/templates/vue/example.vue +0 -17
  73. package/dist/templates/vue/mapLibre.vue +0 -371
  74. package/dist/themes/code-themes/business-contrast.json +0 -31
  75. package/dist/themes/code-themes/colorful.json +0 -32
  76. package/dist/themes/code-themes/cool-modern.json +0 -31
  77. package/dist/themes/code-themes/high-contrast.json +0 -31
  78. package/dist/themes/code-themes/light-clean.json +0 -31
  79. package/dist/themes/code-themes/warm-book.json +0 -31
  80. package/dist/themes/color-schemes/candy.json +0 -34
  81. package/dist/themes/color-schemes/cool.json +0 -34
  82. package/dist/themes/color-schemes/coral.json +0 -34
  83. package/dist/themes/color-schemes/dino.json +0 -34
  84. package/dist/themes/color-schemes/forest.json +0 -34
  85. package/dist/themes/color-schemes/garden.json +0 -34
  86. package/dist/themes/color-schemes/neutral.json +0 -34
  87. package/dist/themes/color-schemes/ocean.json +0 -34
  88. package/dist/themes/color-schemes/rainbow.json +0 -43
  89. package/dist/themes/color-schemes/sakura.json +0 -34
  90. package/dist/themes/color-schemes/sepia.json +0 -34
  91. package/dist/themes/color-schemes/space.json +0 -34
  92. package/dist/themes/color-schemes/starry.json +0 -34
  93. package/dist/themes/color-schemes/sunset.json +0 -34
  94. package/dist/themes/color-schemes/warm.json +0 -34
  95. package/dist/themes/font-config.json +0 -184
  96. package/dist/themes/layout-schemes/academic.json +0 -40
  97. package/dist/themes/layout-schemes/book.json +0 -40
  98. package/dist/themes/layout-schemes/document.json +0 -40
  99. package/dist/themes/layout-schemes/magazine.json +0 -40
  100. package/dist/themes/layout-schemes/student.json +0 -40
  101. package/dist/themes/layout-schemes/technical.json +0 -40
  102. package/dist/themes/presets/academic.json +0 -24
  103. package/dist/themes/presets/business.json +0 -22
  104. package/dist/themes/presets/candy.json +0 -23
  105. package/dist/themes/presets/century.json +0 -22
  106. package/dist/themes/presets/coral.json +0 -22
  107. package/dist/themes/presets/default.json +0 -22
  108. package/dist/themes/presets/dinosaur.json +0 -23
  109. package/dist/themes/presets/elegant.json +0 -22
  110. package/dist/themes/presets/forest.json +0 -22
  111. package/dist/themes/presets/garamond.json +0 -22
  112. package/dist/themes/presets/garden.json +0 -23
  113. package/dist/themes/presets/handwritten.json +0 -23
  114. package/dist/themes/presets/heiti.json +0 -22
  115. package/dist/themes/presets/magazine.json +0 -24
  116. package/dist/themes/presets/manuscript.json +0 -22
  117. package/dist/themes/presets/minimal.json +0 -22
  118. package/dist/themes/presets/mixed.json +0 -24
  119. package/dist/themes/presets/newspaper.json +0 -24
  120. package/dist/themes/presets/ocean.json +0 -22
  121. package/dist/themes/presets/palatino.json +0 -22
  122. package/dist/themes/presets/rainbow.json +0 -23
  123. package/dist/themes/presets/space.json +0 -23
  124. package/dist/themes/presets/starry.json +0 -23
  125. package/dist/themes/presets/sunset.json +0 -22
  126. package/dist/themes/presets/swiss.json +0 -22
  127. package/dist/themes/presets/technical.json +0 -22
  128. package/dist/themes/presets/typewriter.json +0 -23
  129. package/dist/themes/presets/verdana.json +0 -22
  130. package/dist/themes/presets/water.json +0 -22
  131. package/dist/themes/registry.json +0 -270
  132. package/dist/themes/table-styles/academic.json +0 -30
  133. package/dist/themes/table-styles/borderless.json +0 -26
  134. package/dist/themes/table-styles/compact.json +0 -24
  135. package/dist/themes/table-styles/grid.json +0 -22
  136. package/dist/themes/table-styles/high-contrast.json +0 -22
  137. package/dist/themes/table-styles/minimal-gray.json +0 -26
  138. package/dist/themes/table-styles/modern-tech.json +0 -34
  139. package/dist/themes/table-styles/professional.json +0 -34
  140. package/dist/themes/table-styles/zebra.json +0 -22
  141. package/dist/types/src/utils/theme-to-css.d.ts +0 -171
@@ -1,34 +0,0 @@
1
- {
2
- "id": "modern-tech",
3
- "name": "现代科技",
4
- "name_en": "Modern Tech",
5
- "description": "蓝色主题 + 圆角边框,适合技术文档和产品说明",
6
- "description_en": "Blue theme with rounded borders, ideal for tech docs and product guides",
7
- "border": {
8
- "headerTop": {
9
- "width": "2pt",
10
- "style": "single"
11
- },
12
- "headerBottom": {
13
- "width": "2pt",
14
- "style": "single"
15
- },
16
- "rowBottom": {
17
- "width": "1pt",
18
- "style": "single"
19
- },
20
- "lastRowBottom": {
21
- "width": "2pt",
22
- "style": "single"
23
- }
24
- },
25
- "header": {
26
- "fontWeight": "bold"
27
- },
28
- "cell": {
29
- "padding": "10pt"
30
- },
31
- "zebra": {
32
- "enabled": false
33
- }
34
- }
@@ -1,34 +0,0 @@
1
- {
2
- "id": "professional",
3
- "name": "专业风格",
4
- "name_en": "Professional",
5
- "description": "粗表头边框 + 细分隔线",
6
- "description_en": "Thick header border + thin separators",
7
- "border": {
8
- "headerTop": {
9
- "width": "2pt",
10
- "style": "single"
11
- },
12
- "headerBottom": {
13
- "width": "2pt",
14
- "style": "single"
15
- },
16
- "rowBottom": {
17
- "width": "1pt",
18
- "style": "single"
19
- },
20
- "lastRowBottom": {
21
- "width": "2pt",
22
- "style": "single"
23
- }
24
- },
25
- "header": {
26
- "fontWeight": "bold"
27
- },
28
- "cell": {
29
- "padding": "8pt"
30
- },
31
- "zebra": {
32
- "enabled": false
33
- }
34
- }
@@ -1,22 +0,0 @@
1
- {
2
- "id": "zebra",
3
- "name": "斑马纹",
4
- "name_en": "Zebra",
5
- "description": "奇偶行不同背景色,无边框",
6
- "description_en": "Alternating row colors, no borders",
7
- "border": {
8
- "headerBottom": {
9
- "width": "1pt",
10
- "style": "single"
11
- }
12
- },
13
- "header": {
14
- "fontWeight": "bold"
15
- },
16
- "cell": {
17
- "padding": "8pt"
18
- },
19
- "zebra": {
20
- "enabled": true
21
- }
22
- }
@@ -1,171 +0,0 @@
1
- /**
2
- * Theme to CSS Converter
3
- * Converts theme configuration to CSS styles
4
- *
5
- * Theme v2.0 Format:
6
- * - fontScheme: only font families (no sizes)
7
- * - layoutScheme: all sizes and spacing (absolute pt values)
8
- * - colorScheme: colors (text, accent, code background)
9
- * - tableStyle: table styling
10
- * - codeTheme: code syntax highlighting
11
- */
12
- import type { ColorScheme } from '../types/index';
13
- /**
14
- * Heading style configuration (font-related properties only)
15
- */
16
- interface HeadingConfig {
17
- fontFamily?: string;
18
- fontWeight?: string;
19
- }
20
- /**
21
- * Font scheme configuration (font-related properties only)
22
- * Layout properties (fontSize, lineHeight, spacing) are in LayoutScheme
23
- * Color properties are in ColorScheme
24
- */
25
- interface FontScheme {
26
- body: {
27
- fontFamily: string;
28
- };
29
- headings: {
30
- fontFamily: string;
31
- fontWeight?: string;
32
- [key: string]: string | HeadingConfig | undefined;
33
- };
34
- code: {
35
- fontFamily: string;
36
- };
37
- }
38
- /**
39
- * Theme configuration (v2.0 format)
40
- */
41
- export interface ThemeConfig {
42
- fontScheme: FontScheme;
43
- layoutScheme: string;
44
- colorScheme: string;
45
- tableStyle: string;
46
- codeTheme: string;
47
- /** Diagram rendering style: 'normal' or 'handDrawn' (default: 'handDrawn') */
48
- diagramStyle?: 'normal' | 'handDrawn';
49
- }
50
- /**
51
- * Border configuration (layout properties only, color from ColorScheme)
52
- */
53
- interface BorderConfig {
54
- style: string;
55
- width: string;
56
- }
57
- /**
58
- * Table style configuration (layout properties only, colors from ColorScheme)
59
- */
60
- export interface TableStyleConfig {
61
- border?: {
62
- all?: BorderConfig;
63
- headerTop?: BorderConfig;
64
- headerBottom?: BorderConfig;
65
- rowBottom?: BorderConfig;
66
- lastRowBottom?: BorderConfig;
67
- };
68
- header: {
69
- fontWeight?: string;
70
- fontSize?: string;
71
- };
72
- cell: {
73
- padding: string;
74
- };
75
- zebra?: {
76
- enabled: boolean;
77
- };
78
- }
79
- /**
80
- * Code theme configuration
81
- */
82
- export interface CodeThemeConfig {
83
- colors: Record<string, string>;
84
- foreground: string;
85
- }
86
- /**
87
- * Layout scheme heading configuration
88
- */
89
- interface LayoutHeadingConfig {
90
- fontSize: string;
91
- spacingBefore: string;
92
- spacingAfter: string;
93
- alignment?: 'left' | 'center' | 'right';
94
- }
95
- /**
96
- * Layout scheme block configuration
97
- */
98
- interface LayoutBlockConfig {
99
- spacingBefore?: string;
100
- spacingAfter?: string;
101
- paddingVertical?: string;
102
- paddingHorizontal?: string;
103
- }
104
- /**
105
- * Layout scheme configuration (absolute pt values)
106
- */
107
- export interface LayoutScheme {
108
- id: string;
109
- name: string;
110
- name_en: string;
111
- description: string;
112
- description_en?: string;
113
- body: {
114
- fontSize: string;
115
- lineHeight: number;
116
- };
117
- headings: {
118
- h1: LayoutHeadingConfig;
119
- h2: LayoutHeadingConfig;
120
- h3: LayoutHeadingConfig;
121
- h4: LayoutHeadingConfig;
122
- h5: LayoutHeadingConfig;
123
- h6: LayoutHeadingConfig;
124
- };
125
- code: {
126
- fontSize: string;
127
- };
128
- blocks: {
129
- paragraph: LayoutBlockConfig;
130
- list: LayoutBlockConfig;
131
- listItem: LayoutBlockConfig;
132
- blockquote: LayoutBlockConfig;
133
- codeBlock: LayoutBlockConfig;
134
- table: LayoutBlockConfig;
135
- horizontalRule: LayoutBlockConfig;
136
- };
137
- }
138
- /**
139
- * Font configuration for themeManager
140
- */
141
- export interface FontConfig {
142
- [key: string]: unknown;
143
- }
144
- /**
145
- * Convert theme configuration to CSS
146
- * @param theme - Theme configuration object
147
- * @param layoutScheme - Layout scheme configuration
148
- * @param colorScheme - Color scheme configuration
149
- * @param tableStyle - Table style configuration
150
- * @param codeTheme - Code highlighting theme
151
- * @returns CSS string
152
- */
153
- export declare function themeToCSS(theme: ThemeConfig, layoutScheme: LayoutScheme, colorScheme: ColorScheme, tableStyle: TableStyleConfig, codeTheme: CodeThemeConfig): string;
154
- /**
155
- * Apply theme CSS to the page
156
- * @param css - CSS string to apply
157
- */
158
- export declare function applyThemeCSS(css: string): void;
159
- /**
160
- * Load and apply complete theme
161
- * Platforms only need to call this with themeId - all theme logic is handled internally
162
- * @param themeId - Theme ID to load
163
- */
164
- export declare function loadAndApplyTheme(themeId: string): Promise<void>;
165
- /**
166
- * Switch to a different theme with smooth transition
167
- * @param themeId - Theme ID to switch to
168
- * @returns Success status
169
- */
170
- export declare function switchTheme(themeId: string): Promise<boolean>;
171
- export {};