@valkyrianlabs/payload-markdown 1.3.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 (204) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +222 -0
  3. package/dist/blocks/MarkdownBlock/Component.d.ts +2 -0
  4. package/dist/blocks/MarkdownBlock/Component.js +13 -0
  5. package/dist/blocks/MarkdownBlock/Component.js.map +1 -0
  6. package/dist/blocks/MarkdownBlock/config.d.ts +2 -0
  7. package/dist/blocks/MarkdownBlock/config.js +20 -0
  8. package/dist/blocks/MarkdownBlock/config.js.map +1 -0
  9. package/dist/blocks/MarkdownBlock/types.d.js +3 -0
  10. package/dist/blocks/MarkdownBlock/types.d.js.map +1 -0
  11. package/dist/components/MarkdownRenderer/Component.client.d.ts +5 -0
  12. package/dist/components/MarkdownRenderer/Component.client.js +163 -0
  13. package/dist/components/MarkdownRenderer/Component.client.js.map +1 -0
  14. package/dist/components/MarkdownRenderer/Component.d.ts +3 -0
  15. package/dist/components/MarkdownRenderer/Component.js +87 -0
  16. package/dist/components/MarkdownRenderer/Component.js.map +1 -0
  17. package/dist/components/MarkdownRenderer/index.css +69 -0
  18. package/dist/components/MarkdownRenderer/index.module.css +45 -0
  19. package/dist/components/MarkdownRenderer/index.module.scss +43 -0
  20. package/dist/components/MarkdownRenderer/index.scss +83 -0
  21. package/dist/components/MarkdownRenderer/types.d.js +5 -0
  22. package/dist/components/MarkdownRenderer/types.d.js.map +1 -0
  23. package/dist/core/codeConfig.d.ts +6 -0
  24. package/dist/core/codeConfig.js +45 -0
  25. package/dist/core/codeConfig.js.map +1 -0
  26. package/dist/core/codeToHtml.d.ts +5 -0
  27. package/dist/core/codeToHtml.js +180 -0
  28. package/dist/core/codeToHtml.js.map +1 -0
  29. package/dist/core/plugins/rehypeApplyLayoutClasses.d.ts +4 -0
  30. package/dist/core/plugins/rehypeApplyLayoutClasses.js +72 -0
  31. package/dist/core/plugins/rehypeApplyLayoutClasses.js.map +1 -0
  32. package/dist/core/plugins/rehypeStripAuthoredInlineStyles.d.ts +3 -0
  33. package/dist/core/plugins/rehypeStripAuthoredInlineStyles.js +17 -0
  34. package/dist/core/plugins/rehypeStripAuthoredInlineStyles.js.map +1 -0
  35. package/dist/core/plugins/remarkCompileLayouts.d.ts +3 -0
  36. package/dist/core/plugins/remarkCompileLayouts.js +169 -0
  37. package/dist/core/plugins/remarkCompileLayouts.js.map +1 -0
  38. package/dist/core/plugins/remarkHeadingAnchorsAndToc.d.ts +3 -0
  39. package/dist/core/plugins/remarkHeadingAnchorsAndToc.js +68 -0
  40. package/dist/core/plugins/remarkHeadingAnchorsAndToc.js.map +1 -0
  41. package/dist/core/plugins/remarkLayoutDirectives.d.ts +3 -0
  42. package/dist/core/plugins/remarkLayoutDirectives.js +26 -0
  43. package/dist/core/plugins/remarkLayoutDirectives.js.map +1 -0
  44. package/dist/core/plugins/remarkLayoutSentinels.d.ts +3 -0
  45. package/dist/core/plugins/remarkLayoutSentinels.js +184 -0
  46. package/dist/core/plugins/remarkLayoutSentinels.js.map +1 -0
  47. package/dist/core/plugins/remarkLiftLayoutDirectives.d.ts +3 -0
  48. package/dist/core/plugins/remarkLiftLayoutDirectives.js +93 -0
  49. package/dist/core/plugins/remarkLiftLayoutDirectives.js.map +1 -0
  50. package/dist/core/plugins/remarkNormalizeLayoutSyntax.d.ts +3 -0
  51. package/dist/core/plugins/remarkValidateDirectiveThemes.d.ts +4 -0
  52. package/dist/core/plugins/remarkValidateDirectiveThemes.js +28 -0
  53. package/dist/core/plugins/remarkValidateDirectiveThemes.js.map +1 -0
  54. package/dist/core/renderMarkdown.d.ts +2 -0
  55. package/dist/core/renderMarkdown.js +270 -0
  56. package/dist/core/renderMarkdown.js.map +1 -0
  57. package/dist/core/types.d.js +7 -0
  58. package/dist/core/types.d.js.map +1 -0
  59. package/dist/core/types.d.ts +238 -0
  60. package/dist/core/types.js +5 -0
  61. package/dist/core/types.js.map +1 -0
  62. package/dist/directives/attributes.d.ts +14 -0
  63. package/dist/directives/attributes.js +121 -0
  64. package/dist/directives/attributes.js.map +1 -0
  65. package/dist/directives/definitions/callout.d.ts +6 -0
  66. package/dist/directives/definitions/callout.js +107 -0
  67. package/dist/directives/definitions/callout.js.map +1 -0
  68. package/dist/directives/definitions/card.d.ts +4 -0
  69. package/dist/directives/definitions/card.js +120 -0
  70. package/dist/directives/definitions/card.js.map +1 -0
  71. package/dist/directives/definitions/cards.d.ts +7 -0
  72. package/dist/directives/definitions/cards.js +72 -0
  73. package/dist/directives/definitions/cards.js.map +1 -0
  74. package/dist/directives/definitions/cell.d.ts +4 -0
  75. package/dist/directives/definitions/cell.js +44 -0
  76. package/dist/directives/definitions/cell.js.map +1 -0
  77. package/dist/directives/definitions/columns.d.ts +4 -0
  78. package/dist/directives/definitions/columns.js +89 -0
  79. package/dist/directives/definitions/columns.js.map +1 -0
  80. package/dist/directives/definitions/details.d.ts +2 -0
  81. package/dist/directives/definitions/details.js +76 -0
  82. package/dist/directives/definitions/details.js.map +1 -0
  83. package/dist/directives/definitions/section.d.ts +2 -0
  84. package/dist/directives/definitions/section.js +32 -0
  85. package/dist/directives/definitions/section.js.map +1 -0
  86. package/dist/directives/definitions/steps.d.ts +2 -0
  87. package/dist/directives/definitions/steps.js +242 -0
  88. package/dist/directives/definitions/steps.js.map +1 -0
  89. package/dist/directives/definitions/tab.d.ts +8 -0
  90. package/dist/directives/definitions/tab.js +59 -0
  91. package/dist/directives/definitions/tab.js.map +1 -0
  92. package/dist/directives/definitions/tabs.d.ts +2 -0
  93. package/dist/directives/definitions/tabs.js +197 -0
  94. package/dist/directives/definitions/tabs.js.map +1 -0
  95. package/dist/directives/definitions/toc.d.ts +7 -0
  96. package/dist/directives/definitions/toc.js +59 -0
  97. package/dist/directives/definitions/toc.js.map +1 -0
  98. package/dist/directives/diagnostics.d.ts +8 -0
  99. package/dist/directives/diagnostics.js +167 -0
  100. package/dist/directives/diagnostics.js.map +1 -0
  101. package/dist/directives/headingAnchors.d.ts +9 -0
  102. package/dist/directives/headingAnchors.js +54 -0
  103. package/dist/directives/headingAnchors.js.map +1 -0
  104. package/dist/directives/index.d.ts +5 -0
  105. package/dist/directives/index.js +6 -0
  106. package/dist/directives/index.js.map +1 -0
  107. package/dist/directives/registry.d.ts +20 -0
  108. package/dist/directives/registry.js +152 -0
  109. package/dist/directives/registry.js.map +1 -0
  110. package/dist/directives/renderData.d.ts +3 -0
  111. package/dist/directives/renderData.js +11 -0
  112. package/dist/directives/renderData.js.map +1 -0
  113. package/dist/directives/themes.d.ts +25 -0
  114. package/dist/directives/themes.js +274 -0
  115. package/dist/directives/themes.js.map +1 -0
  116. package/dist/directives/types.d.ts +72 -0
  117. package/dist/directives/types.js +3 -0
  118. package/dist/directives/types.js.map +1 -0
  119. package/dist/editor/MarkdownCodeMirror/Component.client.d.ts +8 -0
  120. package/dist/editor/MarkdownCodeMirror/Component.client.js +78 -0
  121. package/dist/editor/MarkdownCodeMirror/Component.client.js.map +1 -0
  122. package/dist/editor/MarkdownCodeMirror/Component.d.ts +9 -0
  123. package/dist/editor/MarkdownCodeMirror/Component.js +10 -0
  124. package/dist/editor/MarkdownCodeMirror/Component.js.map +1 -0
  125. package/dist/editor/MarkdownCodeMirror.d.ts +8 -0
  126. package/dist/editor/MarkdownCodeMirror.js +74 -0
  127. package/dist/editor/MarkdownCodeMirror.js.map +1 -0
  128. package/dist/editor/MarkdownEditor.d.ts +10 -0
  129. package/dist/editor/MarkdownEditor.js +22 -0
  130. package/dist/editor/MarkdownEditor.js.map +1 -0
  131. package/dist/editor/directives/completions.d.ts +5 -0
  132. package/dist/editor/directives/completions.js +93 -0
  133. package/dist/editor/directives/completions.js.map +1 -0
  134. package/dist/editor/directives/diagnostics.d.ts +1 -0
  135. package/dist/editor/directives/diagnostics.js +12 -0
  136. package/dist/editor/directives/diagnostics.js.map +1 -0
  137. package/dist/editor/themes/payload.d.ts +27 -0
  138. package/dist/editor/themes/payload.js +269 -0
  139. package/dist/editor/themes/payload.js.map +1 -0
  140. package/dist/editor/themes/support/highlighters.d.ts +20 -0
  141. package/dist/editor/themes/support/highlighters.js +1141 -0
  142. package/dist/editor/themes/support/highlighters.js.map +1 -0
  143. package/dist/editor/themes/support/lang.d.ts +40 -0
  144. package/dist/editor/themes/support/lang.js +201 -0
  145. package/dist/editor/themes/support/lang.js.map +1 -0
  146. package/dist/exports/advanced.d.ts +3 -0
  147. package/dist/exports/advanced.js +5 -0
  148. package/dist/exports/advanced.js.map +1 -0
  149. package/dist/exports/client.d.ts +1 -0
  150. package/dist/exports/client.js +2 -0
  151. package/dist/exports/client.js.map +1 -0
  152. package/dist/exports/server.d.ts +3 -0
  153. package/dist/exports/server.js +5 -0
  154. package/dist/exports/server.js.map +1 -0
  155. package/dist/field/BlocksParams/config.d.ts +7 -0
  156. package/dist/field/BlocksParams/config.js +149 -0
  157. package/dist/field/BlocksParams/config.js.map +1 -0
  158. package/dist/field/CodeBlock/config.d.ts +7 -0
  159. package/dist/field/CodeBlock/config.js +321 -0
  160. package/dist/field/CodeBlock/config.js.map +1 -0
  161. package/dist/field/CodeBlockConfig/config.d.ts +7 -0
  162. package/dist/field/CodeBlockConfig/config.js +306 -0
  163. package/dist/field/CodeBlockConfig/config.js.map +1 -0
  164. package/dist/field/CodeBlockParams/config.d.ts +7 -0
  165. package/dist/field/CodeBlockParams/config.js +321 -0
  166. package/dist/field/CodeBlockParams/config.js.map +1 -0
  167. package/dist/field/Config/config.d.ts +7 -0
  168. package/dist/field/Config/config.js +149 -0
  169. package/dist/field/Config/config.js.map +1 -0
  170. package/dist/field/MarkdownField/Component.d.ts +2 -0
  171. package/dist/field/MarkdownField/Component.js +42 -0
  172. package/dist/field/MarkdownField/Component.js.map +1 -0
  173. package/dist/field/MarkdownField/config.d.ts +3 -0
  174. package/dist/field/MarkdownField/config.js +20 -0
  175. package/dist/field/MarkdownField/config.js.map +1 -0
  176. package/dist/field/Tailwind/config.d.ts +9 -0
  177. package/dist/field/Tailwind/config.js +13 -0
  178. package/dist/field/Tailwind/config.js.map +1 -0
  179. package/dist/field/TailwindField/config.d.ts +9 -0
  180. package/dist/field/TailwindField/config.js +13 -0
  181. package/dist/field/TailwindField/config.js.map +1 -0
  182. package/dist/index.d.ts +10 -0
  183. package/dist/index.js +91 -0
  184. package/dist/index.js.map +1 -0
  185. package/dist/runtime/index.d.ts +36 -0
  186. package/dist/runtime/index.js +124 -0
  187. package/dist/runtime/index.js.map +1 -0
  188. package/dist/styles/directiveSurface.d.ts +11 -0
  189. package/dist/styles/directiveSurface.js +38 -0
  190. package/dist/styles/directiveSurface.js.map +1 -0
  191. package/dist/types/core.d.ts +285 -0
  192. package/dist/types/core.js +5 -0
  193. package/dist/types/core.js.map +1 -0
  194. package/dist/types/layoutToken.d.ts +1 -0
  195. package/dist/types/layoutToken.js +3 -0
  196. package/dist/types/layoutToken.js.map +1 -0
  197. package/dist/types/mdast.d.js +5 -0
  198. package/dist/types/mdast.d.js.map +1 -0
  199. package/dist/types.d.js +3 -0
  200. package/dist/types.d.js.map +1 -0
  201. package/dist/types.d.ts +80 -0
  202. package/dist/types.js +3 -0
  203. package/dist/types.js.map +1 -0
  204. package/package.json +181 -0
@@ -0,0 +1,269 @@
1
+ import { markdown } from '@codemirror/lang-markdown';
2
+ import { HighlightStyle, syntaxHighlighting } from '@codemirror/language';
3
+ import { EditorView } from '@codemirror/view';
4
+ import { tags as t, Tag } from '@lezer/highlight';
5
+ import { supportedLangHighlight } from './support/highlighters.js';
6
+ import { languages } from './support/lang.js';
7
+ const activeLine = '#6699ff0b', bracketMatch = '#bad0f847', chalky = '#e5c07b', coral = '#e06c75', cursor = '#a5edff', cyan = '#56b6c2', highlightBackground = '#2c313a', invalid = '#ff6b81', ivory = '#c4c9d5', malibu = '#61afef', sage = '#98c379', searchMatch = '#72a1ff59', searchMatchOutline = '#457dff', selection = '#ffffff', selectionBackground = '#3E4451', selectionMatch = '#aafe661a', stone = '#7d8799', tooltipBackground = '#353a42', violet = '#e47cd2', whiskey = '#d19a66';
8
+ export const color = {
9
+ activeLine,
10
+ bracketMatch,
11
+ chalky,
12
+ coral,
13
+ cursor,
14
+ cyan,
15
+ highlightBackground,
16
+ invalid,
17
+ ivory,
18
+ malibu,
19
+ sage,
20
+ searchMatch,
21
+ searchMatchOutline,
22
+ selection,
23
+ selectionBackground,
24
+ selectionMatch,
25
+ stone,
26
+ tooltipBackground,
27
+ violet,
28
+ whiskey
29
+ };
30
+ export const payloadTheme = EditorView.theme({
31
+ '&': {
32
+ backgroundColor: 'transparent',
33
+ color: ivory,
34
+ fontSize: '1.05rem'
35
+ },
36
+ '.cm-content': {
37
+ caretColor: cursor,
38
+ padding: '0.75rem'
39
+ },
40
+ '.cm-scroller': {
41
+ fontFamily: 'monospace'
42
+ },
43
+ '.cm-cursor, .cm-dropCursor': {
44
+ borderLeftColor: cursor
45
+ },
46
+ '.cm-selectionBackground': {
47
+ backgroundColor: selectionBackground
48
+ },
49
+ '.cm-content ::selection': {
50
+ backgroundColor: selectionBackground,
51
+ color: selection
52
+ },
53
+ '.cm-selectionBackground, .cm-content ::selection': {
54
+ color: selection
55
+ },
56
+ '.cm-activeLine': {
57
+ backgroundColor: activeLine
58
+ },
59
+ '.cm-selectionMatch': {
60
+ backgroundColor: selectionMatch
61
+ },
62
+ '&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket': {
63
+ backgroundColor: bracketMatch
64
+ },
65
+ '.cm-gutters': {
66
+ backgroundColor: 'transparent',
67
+ border: 'none',
68
+ color: stone
69
+ },
70
+ '.cm-activeLineGutter': {
71
+ backgroundColor: highlightBackground
72
+ },
73
+ '.cm-searchMatch': {
74
+ backgroundColor: searchMatch,
75
+ outline: `1px solid ${searchMatchOutline}`
76
+ },
77
+ '.cm-searchMatch.cm-searchMatch-selected': {
78
+ backgroundColor: '#6199ff2f'
79
+ },
80
+ '.cm-foldPlaceholder': {
81
+ backgroundColor: 'transparent',
82
+ border: 'none',
83
+ color: ivory
84
+ },
85
+ '.cm-tooltip': {
86
+ backgroundColor: tooltipBackground,
87
+ border: 'none',
88
+ color: ivory
89
+ },
90
+ '.cm-tooltip .cm-tooltip-arrow:before': {
91
+ borderBottomColor: 'transparent',
92
+ borderTopColor: 'transparent'
93
+ },
94
+ '.cm-tooltip .cm-tooltip-arrow:after': {
95
+ borderBottomColor: tooltipBackground,
96
+ borderTopColor: tooltipBackground
97
+ },
98
+ '.cm-tooltip-autocomplete': {
99
+ '& > ul > li[aria-selected]': {
100
+ backgroundColor: highlightBackground,
101
+ color: ivory
102
+ }
103
+ }
104
+ }, {
105
+ dark: true
106
+ });
107
+ // Keep custom directive highlighting compatible with keyword semantics
108
+ const mdQualifierTag = Tag.define(t.keyword);
109
+ export const payloadHighlightStyle = HighlightStyle.define([
110
+ // Directives + language keywords
111
+ {
112
+ color: violet,
113
+ tag: [
114
+ mdQualifierTag,
115
+ t.keyword
116
+ ]
117
+ },
118
+ // Names / identifiers that should read warm
119
+ {
120
+ color: coral,
121
+ tag: [
122
+ t.name,
123
+ t.deleted,
124
+ t.character,
125
+ t.propertyName,
126
+ t.macroName
127
+ ]
128
+ },
129
+ // Functions and labels should pop cooler like JetBrains method names
130
+ {
131
+ color: malibu,
132
+ tag: [
133
+ t.function(t.variableName),
134
+ t.function(t.propertyName),
135
+ t.labelName
136
+ ]
137
+ },
138
+ // Constants / enum-like / builtins
139
+ {
140
+ color: whiskey,
141
+ tag: [
142
+ t.color,
143
+ t.constant(t.name),
144
+ t.standard(t.name),
145
+ t.atom,
146
+ t.bool,
147
+ t.special(t.variableName)
148
+ ]
149
+ },
150
+ // Definitions and separators
151
+ {
152
+ color: ivory,
153
+ tag: [
154
+ t.definition(t.name),
155
+ t.separator
156
+ ]
157
+ },
158
+ // Types / classes / annotations / namespaces / numerics
159
+ {
160
+ color: chalky,
161
+ tag: [
162
+ t.typeName,
163
+ t.className,
164
+ t.number,
165
+ t.changed,
166
+ t.annotation,
167
+ t.modifier,
168
+ t.self,
169
+ t.namespace
170
+ ]
171
+ },
172
+ // Operators / escapes / urls / regex / special strings
173
+ {
174
+ color: cyan,
175
+ tag: [
176
+ t.operator,
177
+ t.operatorKeyword,
178
+ t.url,
179
+ t.escape,
180
+ t.regexp,
181
+ t.link,
182
+ t.special(t.string)
183
+ ]
184
+ },
185
+ // Comments + meta
186
+ {
187
+ color: stone,
188
+ tag: [
189
+ t.meta,
190
+ t.comment
191
+ ]
192
+ },
193
+ // Markdown emphasis
194
+ {
195
+ fontWeight: 'bold',
196
+ tag: t.strong
197
+ },
198
+ {
199
+ fontStyle: 'italic',
200
+ tag: t.emphasis
201
+ },
202
+ {
203
+ tag: t.strikethrough,
204
+ textDecoration: 'line-through'
205
+ },
206
+ {
207
+ color: stone,
208
+ tag: t.link,
209
+ textDecoration: 'underline'
210
+ },
211
+ {
212
+ color: coral,
213
+ fontWeight: 'bold',
214
+ tag: t.heading
215
+ },
216
+ // Strings / inserted text / processing-ish constructs
217
+ {
218
+ color: sage,
219
+ tag: [
220
+ t.processingInstruction,
221
+ t.string,
222
+ t.inserted
223
+ ]
224
+ },
225
+ // Actually-invalid syntax should look wrong
226
+ {
227
+ color: invalid,
228
+ tag: t.invalid
229
+ }
230
+ ]);
231
+ const directiveBlock = {
232
+ defineNodes: [
233
+ {
234
+ name: 'DirectiveLine',
235
+ block: true,
236
+ style: mdQualifierTag
237
+ }
238
+ ],
239
+ parseBlock: [
240
+ {
241
+ name: 'DirectiveLine',
242
+ before: 'HTMLBlock',
243
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
244
+ parse (cx, line) {
245
+ const startInLine = line.pos;
246
+ const text = line.text.slice(startInLine);
247
+ if (!text.startsWith(':::')) return false;
248
+ const from = cx.lineStart + startInLine;
249
+ const to = cx.lineStart + line.text.length;
250
+ cx.addElement(cx.elt('DirectiveLine', from, to));
251
+ cx.nextLine();
252
+ return true;
253
+ }
254
+ }
255
+ ]
256
+ };
257
+ export const payloadMarkdownTheme = [
258
+ payloadTheme,
259
+ syntaxHighlighting(payloadHighlightStyle),
260
+ ...supportedLangHighlight,
261
+ markdown({
262
+ codeLanguages: languages,
263
+ extensions: [
264
+ directiveBlock
265
+ ]
266
+ })
267
+ ];
268
+
269
+ //# sourceMappingURL=payload.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/editor/themes/payload.ts"],"sourcesContent":["import type { Extension } from '@codemirror/state'\n\nimport { markdown } from '@codemirror/lang-markdown'\nimport { HighlightStyle, syntaxHighlighting } from '@codemirror/language'\nimport { EditorView } from '@codemirror/view'\nimport { tags as t, Tag } from '@lezer/highlight'\n\nimport { supportedLangHighlight } from './support/highlighters.js'\nimport { languages } from './support/lang.js'\n\nconst activeLine = '#6699ff0b',\n bracketMatch = '#bad0f847',\n chalky = '#e5c07b',\n coral = '#e06c75',\n cursor = '#a5edff',\n cyan = '#56b6c2',\n highlightBackground = '#2c313a',\n invalid = '#ff6b81',\n ivory = '#c4c9d5',\n malibu = '#61afef',\n sage = '#98c379',\n searchMatch = '#72a1ff59',\n searchMatchOutline = '#457dff',\n selection = '#ffffff',\n selectionBackground = '#3E4451',\n selectionMatch = '#aafe661a',\n stone = '#7d8799',\n tooltipBackground = '#353a42',\n violet = '#e47cd2',\n whiskey = '#d19a66'\n\nexport const color = {\n activeLine,\n bracketMatch,\n chalky,\n coral,\n cursor,\n cyan,\n highlightBackground,\n invalid,\n ivory,\n malibu,\n sage,\n searchMatch,\n searchMatchOutline,\n selection,\n selectionBackground,\n selectionMatch,\n stone,\n tooltipBackground,\n violet,\n whiskey,\n}\n\nexport const payloadTheme = EditorView.theme(\n {\n '&': {\n backgroundColor: 'transparent',\n color: ivory,\n fontSize: '1.05rem',\n },\n\n '.cm-content': {\n caretColor: cursor,\n padding: '0.75rem',\n },\n\n '.cm-scroller': {\n fontFamily: 'monospace',\n },\n\n '.cm-cursor, .cm-dropCursor': {\n borderLeftColor: cursor,\n },\n\n '.cm-selectionBackground': {\n backgroundColor: selectionBackground,\n },\n\n '.cm-content ::selection': {\n backgroundColor: selectionBackground,\n color: selection,\n },\n\n '.cm-selectionBackground, .cm-content ::selection': {\n color: selection,\n },\n\n '.cm-activeLine': {\n backgroundColor: activeLine,\n },\n\n '.cm-selectionMatch': {\n backgroundColor: selectionMatch,\n },\n\n '&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket': {\n backgroundColor: bracketMatch,\n },\n\n '.cm-gutters': {\n backgroundColor: 'transparent',\n border: 'none',\n color: stone,\n },\n\n '.cm-activeLineGutter': {\n backgroundColor: highlightBackground,\n },\n\n '.cm-searchMatch': {\n backgroundColor: searchMatch,\n outline: `1px solid ${searchMatchOutline}`,\n },\n\n '.cm-searchMatch.cm-searchMatch-selected': {\n backgroundColor: '#6199ff2f',\n },\n\n '.cm-foldPlaceholder': {\n backgroundColor: 'transparent',\n border: 'none',\n color: ivory,\n },\n\n '.cm-tooltip': {\n backgroundColor: tooltipBackground,\n border: 'none',\n color: ivory,\n },\n\n '.cm-tooltip .cm-tooltip-arrow:before': {\n borderBottomColor: 'transparent',\n borderTopColor: 'transparent',\n },\n\n '.cm-tooltip .cm-tooltip-arrow:after': {\n borderBottomColor: tooltipBackground,\n borderTopColor: tooltipBackground,\n },\n\n '.cm-tooltip-autocomplete': {\n '& > ul > li[aria-selected]': {\n backgroundColor: highlightBackground,\n color: ivory,\n },\n },\n },\n { dark: true },\n)\n\n// Keep custom directive highlighting compatible with keyword semantics\nconst mdQualifierTag = Tag.define(t.keyword)\n\nexport const payloadHighlightStyle = HighlightStyle.define([\n // Directives + language keywords\n { color: violet, tag: [mdQualifierTag, t.keyword] },\n\n // Names / identifiers that should read warm\n { color: coral, tag: [t.name, t.deleted, t.character, t.propertyName, t.macroName] },\n\n // Functions and labels should pop cooler like JetBrains method names\n { color: malibu, tag: [t.function(t.variableName), t.function(t.propertyName), t.labelName] },\n\n // Constants / enum-like / builtins\n {\n color: whiskey,\n tag: [\n t.color,\n t.constant(t.name),\n t.standard(t.name),\n t.atom,\n t.bool,\n t.special(t.variableName),\n ],\n },\n\n // Definitions and separators\n { color: ivory, tag: [t.definition(t.name), t.separator] },\n\n // Types / classes / annotations / namespaces / numerics\n {\n color: chalky,\n tag: [\n t.typeName,\n t.className,\n t.number,\n t.changed,\n t.annotation,\n t.modifier,\n t.self,\n t.namespace,\n ],\n },\n\n // Operators / escapes / urls / regex / special strings\n {\n color: cyan,\n tag: [t.operator, t.operatorKeyword, t.url, t.escape, t.regexp, t.link, t.special(t.string)],\n },\n\n // Comments + meta\n { color: stone, tag: [t.meta, t.comment] },\n\n // Markdown emphasis\n { fontWeight: 'bold', tag: t.strong },\n { fontStyle: 'italic', tag: t.emphasis },\n { tag: t.strikethrough, textDecoration: 'line-through' },\n { color: stone, tag: t.link, textDecoration: 'underline' },\n { color: coral, fontWeight: 'bold', tag: t.heading },\n\n // Strings / inserted text / processing-ish constructs\n { color: sage, tag: [t.processingInstruction, t.string, t.inserted] },\n\n // Actually-invalid syntax should look wrong\n { color: invalid, tag: t.invalid },\n])\n\nconst directiveBlock = {\n defineNodes: [\n {\n name: 'DirectiveLine',\n block: true,\n style: mdQualifierTag,\n },\n ],\n\n parseBlock: [\n {\n name: 'DirectiveLine',\n before: 'HTMLBlock',\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n parse(cx: any, line: any) {\n const startInLine = line.pos\n const text = line.text.slice(startInLine)\n\n if (!text.startsWith(':::')) return false\n\n const from = cx.lineStart + startInLine\n const to = cx.lineStart + line.text.length\n\n cx.addElement(cx.elt('DirectiveLine', from, to))\n cx.nextLine()\n\n return true\n },\n },\n ],\n}\n\nexport const payloadMarkdownTheme: Extension = [\n payloadTheme,\n syntaxHighlighting(payloadHighlightStyle),\n ...supportedLangHighlight,\n markdown({\n codeLanguages: languages,\n extensions: [directiveBlock],\n }),\n]\n"],"names":["markdown","HighlightStyle","syntaxHighlighting","EditorView","tags","t","Tag","supportedLangHighlight","languages","activeLine","bracketMatch","chalky","coral","cursor","cyan","highlightBackground","invalid","ivory","malibu","sage","searchMatch","searchMatchOutline","selection","selectionBackground","selectionMatch","stone","tooltipBackground","violet","whiskey","color","payloadTheme","theme","backgroundColor","fontSize","caretColor","padding","fontFamily","borderLeftColor","border","outline","borderBottomColor","borderTopColor","dark","mdQualifierTag","define","keyword","payloadHighlightStyle","tag","name","deleted","character","propertyName","macroName","function","variableName","labelName","constant","standard","atom","bool","special","definition","separator","typeName","className","number","changed","annotation","modifier","self","namespace","operator","operatorKeyword","url","escape","regexp","link","string","meta","comment","fontWeight","strong","fontStyle","emphasis","strikethrough","textDecoration","heading","processingInstruction","inserted","directiveBlock","defineNodes","block","style","parseBlock","before","parse","cx","line","startInLine","pos","text","slice","startsWith","from","lineStart","to","length","addElement","elt","nextLine","payloadMarkdownTheme","codeLanguages","extensions"],"mappings":"AAEA,SAASA,QAAQ,QAAQ,4BAA2B;AACpD,SAASC,cAAc,EAAEC,kBAAkB,QAAQ,uBAAsB;AACzE,SAASC,UAAU,QAAQ,mBAAkB;AAC7C,SAASC,QAAQC,CAAC,EAAEC,GAAG,QAAQ,mBAAkB;AAEjD,SAASC,sBAAsB,QAAQ,4BAA2B;AAClE,SAASC,SAAS,QAAQ,oBAAmB;AAE7C,MAAMC,aAAa,aACjBC,eAAe,aACfC,SAAS,WACTC,QAAQ,WACRC,SAAS,WACTC,OAAO,WACPC,sBAAsB,WACtBC,UAAU,WACVC,QAAQ,WACRC,SAAS,WACTC,OAAO,WACPC,cAAc,aACdC,qBAAqB,WACrBC,YAAY,WACZC,sBAAsB,WACtBC,iBAAiB,aACjBC,QAAQ,WACRC,oBAAoB,WACpBC,SAAS,WACTC,UAAU;AAEZ,OAAO,MAAMC,QAAQ;IACnBpB;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;AACF,EAAC;AAED,OAAO,MAAME,eAAe3B,WAAW4B,KAAK,CAC1C;IACE,KAAK;QACHC,iBAAiB;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,SAAS;QACP+G,eAAevG;QACfwG,YAAY;YAACvB;SAAe;IAC9B;CACD,CAAA"}
@@ -0,0 +1,20 @@
1
+ import type { Extension } from '@codemirror/state';
2
+ export declare const angularHighlight: Extension;
3
+ export declare const cppHighlight: Extension;
4
+ export declare const cssHighlight: Extension;
5
+ export declare const goHighlight: Extension;
6
+ export declare const htmlHighlight: Extension;
7
+ export declare const javaHighlight: Extension;
8
+ export declare const javascriptHighlight: Extension;
9
+ export declare const typescriptHighlight: Extension;
10
+ export declare const jsonHighlight: Extension;
11
+ export declare const markdownHighlight: Extension;
12
+ export declare const phpHighlight: Extension;
13
+ export declare const pythonHighlight: Extension;
14
+ export declare const rustHighlight: Extension;
15
+ export declare const sassHighlight: Extension;
16
+ export declare const sqlHighlight: Extension;
17
+ export declare const vueHighlight: Extension;
18
+ export declare const xmlHighlight: Extension;
19
+ export declare const yamlHighlight: Extension;
20
+ export declare const supportedLangHighlight: Extension[];