@livemark/markdown 0.0.0-stage → 0.44.2

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 (184) hide show
  1. package/LICENSE.md +9 -0
  2. package/README.md +5 -2
  3. package/build/actions/markdown/compile.d.ts +27 -0
  4. package/build/actions/markdown/compile.js +48 -0
  5. package/build/actions/processor/create.d.ts +17 -0
  6. package/build/actions/processor/create.js +212 -0
  7. package/build/components/Abbr.d.ts +5 -0
  8. package/build/components/Abbr.js +7 -0
  9. package/build/components/AnsiCode.d.ts +4 -0
  10. package/build/components/AnsiCode.js +7 -0
  11. package/build/components/Audio.d.ts +4 -0
  12. package/build/components/Audio.js +9 -0
  13. package/build/components/Badge.d.ts +5 -0
  14. package/build/components/Badge.js +7 -0
  15. package/build/components/Button.d.ts +7 -0
  16. package/build/components/Button.js +11 -0
  17. package/build/components/Callout.d.ts +8 -0
  18. package/build/components/Callout.js +41 -0
  19. package/build/components/Card.d.ts +7 -0
  20. package/build/components/Card.js +16 -0
  21. package/build/components/Cards.d.ts +4 -0
  22. package/build/components/Cards.js +6 -0
  23. package/build/components/CodeBlock.d.ts +1 -0
  24. package/build/components/CodeBlock.js +50 -0
  25. package/build/components/CodeTabs.d.ts +6 -0
  26. package/build/components/CodeTabs.js +48 -0
  27. package/build/components/Column.d.ts +4 -0
  28. package/build/components/Column.js +6 -0
  29. package/build/components/Columns.d.ts +5 -0
  30. package/build/components/Columns.js +8 -0
  31. package/build/components/DefinitionList.d.ts +7 -0
  32. package/build/components/DefinitionList.js +14 -0
  33. package/build/components/Details.d.ts +5 -0
  34. package/build/components/Details.js +10 -0
  35. package/build/components/Filetree.d.ts +4 -0
  36. package/build/components/Filetree.js +22 -0
  37. package/build/components/FootnoteRef.d.ts +4 -0
  38. package/build/components/FootnoteRef.js +33 -0
  39. package/build/components/Heading.d.ts +8 -0
  40. package/build/components/Heading.js +18 -0
  41. package/build/components/Icon.d.ts +5 -0
  42. package/build/components/Icon.js +10 -0
  43. package/build/components/Markdown.d.ts +13 -0
  44. package/build/components/Markdown.js +75 -0
  45. package/build/components/Mermaid.d.ts +4 -0
  46. package/build/components/Mermaid.js +10 -0
  47. package/build/components/MermaidRenderer.d.ts +4 -0
  48. package/build/components/MermaidRenderer.js +44 -0
  49. package/build/components/PackageTabs.d.ts +9 -0
  50. package/build/components/PackageTabs.js +26 -0
  51. package/build/components/SortableTable.d.ts +5 -0
  52. package/build/components/SortableTable.js +63 -0
  53. package/build/components/Tab.d.ts +5 -0
  54. package/build/components/Tab.js +6 -0
  55. package/build/components/Tabs.d.ts +5 -0
  56. package/build/components/Tabs.js +46 -0
  57. package/build/components/Toc.d.ts +4 -0
  58. package/build/components/Toc.js +14 -0
  59. package/build/components/Video.d.ts +4 -0
  60. package/build/components/Video.js +13 -0
  61. package/build/components/ZoomImage.d.ts +4 -0
  62. package/build/components/ZoomImage.js +26 -0
  63. package/build/elements/badge.d.ts +7 -0
  64. package/build/elements/badge.js +36 -0
  65. package/build/elements/button.d.ts +8 -0
  66. package/build/elements/button.js +37 -0
  67. package/build/elements/card.d.ts +11 -0
  68. package/build/elements/card.js +25 -0
  69. package/build/elements/collapsible.d.ts +5 -0
  70. package/build/elements/collapsible.js +13 -0
  71. package/build/elements/hover-card.d.ts +5 -0
  72. package/build/elements/hover-card.js +14 -0
  73. package/build/elements/separator.d.ts +3 -0
  74. package/build/elements/separator.js +8 -0
  75. package/build/elements/table.d.ts +9 -0
  76. package/build/elements/table.js +28 -0
  77. package/build/elements/tooltip.d.ts +6 -0
  78. package/build/elements/tooltip.js +17 -0
  79. package/build/helpers/ansi.d.ts +3 -0
  80. package/build/helpers/ansi.js +208 -0
  81. package/build/helpers/article-link.d.ts +7 -0
  82. package/build/helpers/article-link.js +8 -0
  83. package/build/helpers/code-icon.d.ts +2 -0
  84. package/build/helpers/code-icon.js +57 -0
  85. package/build/helpers/content-warnings.d.ts +8 -0
  86. package/build/helpers/content-warnings.js +47 -0
  87. package/build/helpers/dynamic-icon-resolver.d.ts +5 -0
  88. package/build/helpers/dynamic-icon-resolver.js +11 -0
  89. package/build/helpers/dynamic-icon.d.ts +5 -0
  90. package/build/helpers/dynamic-icon.js +14 -0
  91. package/build/helpers/frontmatter.d.ts +5 -0
  92. package/build/helpers/frontmatter.js +16 -0
  93. package/build/helpers/icon-names.d.ts +11 -0
  94. package/build/helpers/icon-names.js +35 -0
  95. package/build/helpers/message-format.d.ts +2 -0
  96. package/build/helpers/message-format.js +7 -0
  97. package/build/helpers/node-text.d.ts +9 -0
  98. package/build/helpers/node-text.js +9 -0
  99. package/build/helpers/site-messages.d.ts +86 -0
  100. package/build/helpers/site-messages.js +7 -0
  101. package/build/helpers/toc-context.d.ts +5 -0
  102. package/build/helpers/toc-context.js +8 -0
  103. package/build/helpers/toc-outline.d.ts +3 -0
  104. package/build/helpers/toc-outline.js +16 -0
  105. package/build/helpers/youtube-id.d.ts +2 -0
  106. package/build/helpers/youtube-id.js +25 -0
  107. package/build/hooks/icons.d.ts +13 -0
  108. package/build/hooks/icons.js +12 -0
  109. package/build/hooks/messages.d.ts +95 -0
  110. package/build/hooks/messages.js +17 -0
  111. package/build/models/message.d.ts +177 -0
  112. package/build/models/message.js +88 -0
  113. package/build/models/plugins.d.ts +10 -0
  114. package/build/models/plugins.js +6 -0
  115. package/build/models/theme.d.ts +76 -0
  116. package/build/models/theme.js +71 -0
  117. package/build/models/toc.d.ts +5 -0
  118. package/build/models/toc.js +2 -0
  119. package/build/plugins/twoslash.d.ts +13 -0
  120. package/build/plugins/twoslash.js +146 -0
  121. package/package.json +63 -3
  122. package/source/actions/markdown/compile.ts +82 -0
  123. package/source/actions/processor/create.ts +235 -0
  124. package/source/components/Abbr.tsx +13 -0
  125. package/source/components/AnsiCode.tsx +17 -0
  126. package/source/components/Audio.tsx +18 -0
  127. package/source/components/Badge.tsx +9 -0
  128. package/source/components/Button.tsx +33 -0
  129. package/source/components/Callout.tsx +68 -0
  130. package/source/components/Card.tsx +48 -0
  131. package/source/components/Cards.tsx +8 -0
  132. package/source/components/CodeBlock.tsx +144 -0
  133. package/source/components/CodeTabs.tsx +81 -0
  134. package/source/components/Column.tsx +4 -0
  135. package/source/components/Columns.tsx +10 -0
  136. package/source/components/DefinitionList.tsx +18 -0
  137. package/source/components/Details.tsx +30 -0
  138. package/source/components/Filetree.tsx +63 -0
  139. package/source/components/FootnoteRef.tsx +52 -0
  140. package/source/components/Heading.tsx +20 -0
  141. package/source/components/Icon.tsx +10 -0
  142. package/source/components/Markdown.tsx +89 -0
  143. package/source/components/Mermaid.tsx +20 -0
  144. package/source/components/MermaidRenderer.tsx +48 -0
  145. package/source/components/PackageTabs.tsx +72 -0
  146. package/source/components/SortableTable.tsx +81 -0
  147. package/source/components/Tab.tsx +4 -0
  148. package/source/components/Tabs.tsx +75 -0
  149. package/source/components/Toc.tsx +30 -0
  150. package/source/components/Video.tsx +28 -0
  151. package/source/components/ZoomImage.tsx +25 -0
  152. package/source/elements/badge.tsx +53 -0
  153. package/source/elements/button.tsx +61 -0
  154. package/source/elements/card.tsx +102 -0
  155. package/source/elements/collapsible.tsx +15 -0
  156. package/source/elements/hover-card.tsx +47 -0
  157. package/source/elements/separator.tsx +22 -0
  158. package/source/elements/table.tsx +103 -0
  159. package/source/elements/tooltip.tsx +60 -0
  160. package/source/helpers/ansi.ts +210 -0
  161. package/source/helpers/article-link.ts +11 -0
  162. package/source/helpers/code-icon.ts +59 -0
  163. package/source/helpers/content-warnings.ts +56 -0
  164. package/source/helpers/dynamic-icon-resolver.tsx +9 -0
  165. package/source/helpers/dynamic-icon.tsx +19 -0
  166. package/source/helpers/frontmatter.ts +16 -0
  167. package/source/helpers/icon-names.ts +37 -0
  168. package/source/helpers/message-format.ts +5 -0
  169. package/source/helpers/node-text.ts +14 -0
  170. package/source/helpers/site-messages.ts +8 -0
  171. package/source/helpers/toc-context.ts +10 -0
  172. package/source/helpers/toc-outline.ts +23 -0
  173. package/source/helpers/youtube-id.ts +23 -0
  174. package/source/hooks/icons.ts +18 -0
  175. package/source/hooks/messages.ts +28 -0
  176. package/source/models/message.ts +96 -0
  177. package/source/models/plugins.ts +11 -0
  178. package/source/models/theme.ts +78 -0
  179. package/source/models/toc.ts +5 -0
  180. package/source/plugins/twoslash.ts +163 -0
  181. package/source/standalone.css +7 -0
  182. package/source/styles/general.css +214 -0
  183. package/source/styles/markdown.css +231 -0
  184. package/source/styles/shape.css +14 -0
@@ -0,0 +1,231 @@
1
+ @import "katex/dist/katex.min.css";
2
+ @reference "./general.css";
3
+
4
+ @layer components {
5
+ /* A bare URL or long inline code is one unbreakable word that widens the whole
6
+ page on a phone, so it scrolls sideways. */
7
+ .prose {
8
+ overflow-wrap: break-word;
9
+ }
10
+
11
+ .prose :is(h1, h2, h3, h4, h5, h6) {
12
+ @apply scroll-mt-28 md:scroll-mt-20;
13
+ }
14
+
15
+ .prose :is(h1, h2, h3, h4, h5, h6)[id] {
16
+ position: relative;
17
+ }
18
+
19
+ .prose :is(h1, h2, h3, h4, h5, h6)[id]::after {
20
+ content: "";
21
+ display: inline-block;
22
+ width: 0.6em;
23
+ height: 0.6em;
24
+ margin-left: 0.4em;
25
+ vertical-align: middle;
26
+ opacity: 0;
27
+ transition: opacity 0.15s;
28
+ background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71'/%3E%3Cpath d='M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71'/%3E%3C/svg%3E");
29
+ background-size: contain;
30
+ background-repeat: no-repeat;
31
+ }
32
+
33
+ .prose :is(h1, h2, h3, h4, h5, h6)[id]:hover::after {
34
+ opacity: 0.5;
35
+ }
36
+
37
+ .prose :is(h1, h2, h3, h4, h5, h6)[id] a,
38
+ .prose :is(h1, h2, h3, h4, h5, h6)[id] a:hover {
39
+ color: inherit !important;
40
+ text-decoration: none !important;
41
+ }
42
+
43
+ .prose pre code .line {
44
+ @apply px-4;
45
+ }
46
+
47
+ /* `code` is a flex column, where an empty line span collapses to no height */
48
+ .prose pre code .line:empty::before {
49
+ content: " ";
50
+ }
51
+
52
+ .prose pre code .line.highlighted {
53
+ @apply bg-primary/10;
54
+ }
55
+
56
+ .prose pre code .line.diff.add {
57
+ @apply bg-positive/15;
58
+ }
59
+
60
+ .prose pre code .line.diff.remove {
61
+ @apply bg-destructive/15;
62
+ }
63
+
64
+ .prose pre code .line.diff.add::before {
65
+ content: "+";
66
+ @apply text-positive-tint-foreground absolute left-1;
67
+ }
68
+
69
+ .prose pre code .line.diff.remove::before {
70
+ content: "-";
71
+ @apply text-destructive-tint-foreground absolute left-1;
72
+ }
73
+
74
+ .prose pre code .line.highlighted.error {
75
+ @apply bg-destructive/15;
76
+ }
77
+
78
+ .prose pre code .line.highlighted.warning {
79
+ @apply bg-warning/15;
80
+ }
81
+
82
+ .prose pre.has-focused code .line:not(.focused) {
83
+ @apply opacity-30;
84
+ }
85
+
86
+ .prose pre.has-focused code .line.focused {
87
+ @apply opacity-100;
88
+ }
89
+
90
+ .prose pre code .highlighted-word {
91
+ @apply bg-primary/20 rounded px-0.5 py-0.5;
92
+ }
93
+
94
+ .prose pre.line-numbers code .line::before {
95
+ counter-increment: line;
96
+ content: counter(line);
97
+ display: inline-block;
98
+ width: 2rem;
99
+ margin-right: 1rem;
100
+ text-align: right;
101
+ color: var(--color-muted-foreground);
102
+ opacity: 0.5;
103
+ user-select: none;
104
+ }
105
+
106
+ .prose pre code .twoslash-popup-container {
107
+ @apply absolute z-10 translate-y-1 rounded-md border border-border bg-popover px-3 py-1.5 text-xs shadow-md;
108
+ }
109
+
110
+ .prose pre code .twoslash-popup-type {
111
+ @apply font-mono text-muted-foreground;
112
+ }
113
+
114
+ .prose pre code .twoslash-error-line {
115
+ @apply bg-destructive/10;
116
+ }
117
+
118
+ .prose pre code .twoslash-tag-line {
119
+ @apply opacity-50;
120
+ }
121
+
122
+ .prose pre code .twoslash-completion-list {
123
+ @apply absolute z-10 translate-y-1 rounded-md border border-border bg-popover p-1 text-xs shadow-md;
124
+ }
125
+
126
+ .prose pre code .twoslash-completion-list .twoslash-completion-item {
127
+ @apply px-2 py-0.5;
128
+ }
129
+
130
+ .prose pre code .twoslash-hover .twoslash-popup-container {
131
+ @apply hidden;
132
+ }
133
+
134
+ .prose pre code .twoslash-hover:hover .twoslash-popup-container {
135
+ @apply block;
136
+ }
137
+
138
+ .prose :not(pre) > code {
139
+ @apply bg-muted/70 border border-border rounded-md px-1.5 py-0.5 text-sm font-mono;
140
+ }
141
+
142
+ .prose :not(pre) > code::before,
143
+ .prose :not(pre) > code::after {
144
+ content: none !important;
145
+ }
146
+
147
+ .prose :not(pre) > span.shiki {
148
+ /* !important beats the theme background html.highlight writes inline */
149
+ @apply bg-muted/70! border border-border rounded-md px-1.5 py-0.5 text-sm font-mono;
150
+ }
151
+
152
+ .prose :not(pre) > span.shiki > code {
153
+ @apply border-0 bg-transparent p-0;
154
+ }
155
+
156
+ .prose :not(pre) > span.shiki .line {
157
+ display: inline;
158
+ }
159
+
160
+ .dark .shiki span {
161
+ color: var(--shiki-dark) !important;
162
+ }
163
+
164
+ .katex-display {
165
+ @apply overflow-x-auto overflow-y-hidden;
166
+ }
167
+
168
+ .katex {
169
+ @apply overflow-x-auto overflow-y-hidden;
170
+ }
171
+
172
+ .prose ul:has(> li > input[type="checkbox"]) {
173
+ padding-inline-start: 0.5em;
174
+ }
175
+
176
+ .prose ul > li:has(> input[type="checkbox"]) {
177
+ list-style-type: none;
178
+ padding-left: 0;
179
+ }
180
+
181
+ .prose [data-footnotes] {
182
+ @apply mt-8 border-t border-border pt-4 text-sm text-muted-foreground;
183
+ }
184
+
185
+ .prose [data-footnotes] ol {
186
+ @apply list-decimal pl-6;
187
+ }
188
+
189
+ .prose sup a[data-footnote-ref] {
190
+ @apply ml-0.5 px-0.5 text-primary text-xs no-underline font-medium;
191
+ }
192
+
193
+ .prose [data-footnotes] a[data-footnote-backref] {
194
+ @apply text-primary no-underline;
195
+ }
196
+
197
+ .prose dl {
198
+ @apply my-4;
199
+ }
200
+
201
+ .prose dt {
202
+ @apply font-semibold mt-4 first:mt-0;
203
+ }
204
+
205
+ .prose dd {
206
+ @apply ml-6 mt-1 text-muted-foreground;
207
+ }
208
+
209
+ .prose {
210
+ counter-reset: step;
211
+ }
212
+
213
+ .prose [data-step] {
214
+ counter-increment: step;
215
+ }
216
+
217
+ .prose [data-step]::before {
218
+ content: counter(step);
219
+ display: inline-flex;
220
+ align-items: center;
221
+ justify-content: center;
222
+ width: 1.5rem;
223
+ height: 1.5rem;
224
+ border-radius: 9999px;
225
+ background: var(--color-primary);
226
+ color: white;
227
+ font-size: 0.75rem;
228
+ font-weight: 600;
229
+ margin-right: 0.5rem;
230
+ }
231
+ }
@@ -0,0 +1,14 @@
1
+ /* Elements name these, never a raw `rounded-md`: controls are pills, rows and cards 1rem,
2
+ panels 1.5rem. Pills ignore `--radius`; only the `sm`…`xl` scale follows it. */
3
+ @theme inline {
4
+ --radius-control: 9999px;
5
+ --radius-control-sm: 9999px;
6
+ --radius-control-xs: 9999px;
7
+ --radius-control-inset: 9999px;
8
+ --radius-textarea: 1rem;
9
+ --radius-row: 1rem;
10
+ --radius-card: 1rem;
11
+ --radius-panel: 1.5rem;
12
+ --radius-menu: 1rem;
13
+ --radius-menu-item: calc(1rem - 4px);
14
+ }