@mantine-vue/code-highlight 1.1.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.
package/cjs/index.cjs ADDED
@@ -0,0 +1,1985 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ let _mantine_vue_core = require("@mantine-vue/core");
3
+ let _mantine_vue_hooks = require("@mantine-vue/hooks");
4
+ let vue = require("vue");
5
+ var CodeHighlight_module_default = {
6
+ root: "_root_1avu3_1",
7
+ codeHighlight: "_codeHighlight_1avu3_5",
8
+ inlineCodeHighlight: "_inlineCodeHighlight_1avu3_37",
9
+ pre: "_pre_1avu3_71",
10
+ code: "_code_1avu3_5",
11
+ controls: "_controls_1avu3_101",
12
+ control: "_control_1avu3_101",
13
+ controlTooltip: "_controlTooltip_1avu3_146",
14
+ codeWrapper: "_codeWrapper_1avu3_158",
15
+ lineNumbers: "_lineNumbers_1avu3_165",
16
+ scrollarea: "_scrollarea_1avu3_182",
17
+ showCodeButton: "_showCodeButton_1avu3_207",
18
+ file: "_file_1avu3_234",
19
+ fileIcon: "_fileIcon_1avu3_305",
20
+ filesScrollarea: "_filesScrollarea_1avu3_311",
21
+ files: "_files_1avu3_311"
22
+ };
23
+ //#endregion
24
+ //#region src/CodeHighlightProvider/adapters/plain-text-adapter.ts
25
+ var plainTextAdapter = { getHighlighter: () => ({ code }) => ({
26
+ highlightedCode: code,
27
+ isHighlighted: false
28
+ }) };
29
+ //#endregion
30
+ //#region src/CodeHighlightProvider/CodeHighlightProvider.ts
31
+ var CodeHighlightContext = Symbol("CodeHighlightContext");
32
+ function provideCodeHighlightAdapterContext(value) {
33
+ (0, vue.provide)(CodeHighlightContext, value);
34
+ }
35
+ function useHighlight() {
36
+ return (0, vue.inject)(CodeHighlightContext, null)?.highlight || plainTextAdapter.getHighlighter(null);
37
+ }
38
+ var CodeHighlightAdapterProvider = (0, vue.defineComponent)({
39
+ name: "CodeHighlightAdapterProvider",
40
+ props: { adapter: {
41
+ type: Object,
42
+ required: true
43
+ } },
44
+ setup(props, { slots }) {
45
+ const context = (0, vue.ref)(null);
46
+ const highlight = (0, vue.computed)(() => props.adapter.getHighlighter(context.value));
47
+ (0, vue.onMounted)(() => {
48
+ props.adapter.loadContext?.().then((value) => {
49
+ context.value = value;
50
+ });
51
+ });
52
+ provideCodeHighlightAdapterContext({
53
+ adapter: props.adapter,
54
+ get highlight() {
55
+ return highlight.value;
56
+ }
57
+ });
58
+ return () => (0, vue.h)("div", { style: { display: "contents" } }, slots.default?.());
59
+ }
60
+ });
61
+ //#endregion
62
+ //#region src/CodeHighlight/CodeHighlight.context.ts
63
+ var [provideCodeHighlightContext, useCodeHighlightContext] = (0, _mantine_vue_core.createSafeContext)("CodeHighlightProvider was not found in the component tree");
64
+ //#endregion
65
+ //#region src/CodeHighlight/CodeHighlightControl/CodeHighlightControl.ts
66
+ var CodeHighlightControl = (0, vue.defineComponent)({
67
+ name: "CodeHighlightControl",
68
+ inheritAttrs: false,
69
+ props: {
70
+ tooltipLabel: {
71
+ type: String,
72
+ default: void 0
73
+ },
74
+ classNames: {
75
+ type: [Object, Function],
76
+ default: void 0
77
+ },
78
+ styles: {
79
+ type: [Object, Function],
80
+ default: void 0
81
+ },
82
+ vars: {
83
+ type: [Object, Function],
84
+ default: void 0
85
+ },
86
+ component: {
87
+ type: String,
88
+ default: "button"
89
+ },
90
+ onClick: {
91
+ type: Function,
92
+ default: void 0
93
+ }
94
+ },
95
+ setup(rawProps, { attrs, slots }) {
96
+ const props = (0, _mantine_vue_core.useProps)("CodeHighlightControl", null, rawProps);
97
+ const ctx = useCodeHighlightContext();
98
+ return () => {
99
+ const tooltipStyles = ctx.getStyles("controlTooltip");
100
+ const control = (0, vue.h)(_mantine_vue_core.ActionIcon, {
101
+ ...ctx.getStyles("control"),
102
+ ...attrs,
103
+ component: props.component,
104
+ variant: "none",
105
+ "data-code-color-scheme": ctx.codeColorScheme,
106
+ onClick: props.onClick
107
+ }, slots);
108
+ return props.tooltipLabel ? (0, vue.h)(_mantine_vue_core.Tooltip, {
109
+ label: props.tooltipLabel,
110
+ fz: "sm",
111
+ position: "bottom",
112
+ classNames: { tooltip: tooltipStyles.class },
113
+ styles: { tooltip: tooltipStyles.style },
114
+ "data-code-color-scheme": ctx.codeColorScheme,
115
+ transitionProps: { duration: 0 }
116
+ }, () => control) : control;
117
+ };
118
+ }
119
+ });
120
+ //#endregion
121
+ //#region src/CodeHighlight/CopyCodeButton/CopyIcon.ts
122
+ var CopyIcon = (0, vue.defineComponent)({
123
+ name: "CopyIcon",
124
+ inheritAttrs: false,
125
+ props: { copied: {
126
+ type: Boolean,
127
+ required: true
128
+ } },
129
+ setup(props, { attrs }) {
130
+ return () => (0, vue.h)("svg", {
131
+ ...attrs,
132
+ xmlns: "http://www.w3.org/2000/svg",
133
+ viewBox: "0 0 24 24",
134
+ strokeWidth: "2",
135
+ stroke: "currentColor",
136
+ fill: "none",
137
+ strokeLinecap: "round",
138
+ strokeLinejoin: "round"
139
+ }, props.copied ? [(0, vue.h)("path", {
140
+ stroke: "none",
141
+ d: "M0 0h24v24H0z",
142
+ fill: "none"
143
+ }), (0, vue.h)("path", { d: "M5 12l5 5l10 -10" })] : [
144
+ (0, vue.h)("path", {
145
+ stroke: "none",
146
+ d: "M0 0h24v24H0z",
147
+ fill: "none"
148
+ }),
149
+ (0, vue.h)("path", { d: "M8 8m0 2a2 2 0 0 1 2 -2h8a2 2 0 0 1 2 2v8a2 2 0 0 1 -2 2h-8a2 2 0 0 1 -2 -2z" }),
150
+ (0, vue.h)("path", { d: "M16 8v-2a2 2 0 0 0 -2 -2h-8a2 2 0 0 0 -2 2v8a2 2 0 0 0 2 2h2" })
151
+ ]);
152
+ }
153
+ });
154
+ //#endregion
155
+ //#region src/CodeHighlight/CopyCodeButton/CopyCodeButton.ts
156
+ var CopyCodeButton = (0, vue.defineComponent)({
157
+ name: "CopyCodeButton",
158
+ props: {
159
+ code: {
160
+ type: String,
161
+ required: true
162
+ },
163
+ copiedLabel: {
164
+ type: String,
165
+ default: "Copied"
166
+ },
167
+ copyLabel: {
168
+ type: String,
169
+ default: "Copy"
170
+ }
171
+ },
172
+ setup(props) {
173
+ const clipboard = (0, _mantine_vue_hooks.useClipboard)();
174
+ return () => (0, vue.h)(CodeHighlightControl, {
175
+ onClick: () => clipboard.copy(props.code.trim()),
176
+ variant: "none",
177
+ tooltipLabel: clipboard.copied.value ? props.copiedLabel : props.copyLabel,
178
+ "aria-label": clipboard.copied.value ? props.copiedLabel : `${props.copyLabel} code`
179
+ }, () => (0, vue.h)(CopyIcon, { copied: clipboard.copied.value }));
180
+ }
181
+ });
182
+ //#endregion
183
+ //#region src/CodeHighlight/ExpandCodeButton/ExpandIcon.ts
184
+ var ExpandIcon = (0, vue.defineComponent)({
185
+ name: "ExpandIcon",
186
+ inheritAttrs: false,
187
+ props: { expanded: {
188
+ type: Boolean,
189
+ required: true
190
+ } },
191
+ setup(props, { attrs }) {
192
+ return () => (0, vue.h)("svg", {
193
+ ...attrs,
194
+ xmlns: "http://www.w3.org/2000/svg",
195
+ viewBox: "0 0 24 24",
196
+ strokeWidth: "2",
197
+ stroke: "currentColor",
198
+ fill: "none",
199
+ strokeLinecap: "round",
200
+ strokeLinejoin: "round"
201
+ }, props.expanded ? [
202
+ (0, vue.h)("path", {
203
+ stroke: "none",
204
+ d: "M0 0h24v24H0z",
205
+ fill: "none"
206
+ }),
207
+ (0, vue.h)("path", { d: "M12 13v-8l-3 3m6 0l-3 -3" }),
208
+ (0, vue.h)("path", { d: "M9 17l1 0" }),
209
+ (0, vue.h)("path", { d: "M14 17l1 0" }),
210
+ (0, vue.h)("path", { d: "M19 17l1 0" }),
211
+ (0, vue.h)("path", { d: "M4 17l1 0" })
212
+ ] : [
213
+ (0, vue.h)("path", {
214
+ stroke: "none",
215
+ d: "M0 0h24v24H0z",
216
+ fill: "none"
217
+ }),
218
+ (0, vue.h)("path", { d: "M12 11v8l3 -3m-6 0l3 3" }),
219
+ (0, vue.h)("path", { d: "M9 7l1 0" }),
220
+ (0, vue.h)("path", { d: "M14 7l1 0" }),
221
+ (0, vue.h)("path", { d: "M19 7l1 0" }),
222
+ (0, vue.h)("path", { d: "M4 7l1 0" })
223
+ ]);
224
+ }
225
+ });
226
+ //#endregion
227
+ //#region src/CodeHighlight/ExpandCodeButton/ExpandCodeButton.ts
228
+ var ExpandCodeButton = (0, vue.defineComponent)({
229
+ name: "ExpandCodeButton",
230
+ props: {
231
+ expanded: {
232
+ type: Boolean,
233
+ required: true
234
+ },
235
+ onExpand: {
236
+ type: Function,
237
+ required: true
238
+ },
239
+ collapseCodeLabel: {
240
+ type: String,
241
+ default: "Collapse code"
242
+ },
243
+ expandCodeLabel: {
244
+ type: String,
245
+ default: "Expand code"
246
+ }
247
+ },
248
+ setup(props) {
249
+ return () => (0, vue.h)(CodeHighlightControl, {
250
+ onClick: () => props.onExpand(!props.expanded),
251
+ tooltipLabel: props.expanded ? props.collapseCodeLabel : props.expandCodeLabel,
252
+ "aria-label": props.expanded ? props.collapseCodeLabel : props.expandCodeLabel
253
+ }, () => (0, vue.h)(ExpandIcon, { expanded: props.expanded }));
254
+ }
255
+ });
256
+ //#endregion
257
+ //#region src/CodeHighlight/CodeHighlight.ts
258
+ var defaultProps = {
259
+ withCopyButton: true,
260
+ expandCodeLabel: "Expand code",
261
+ collapseCodeLabel: "Collapse code"
262
+ };
263
+ var varsResolver$1 = (0, _mantine_vue_core.createVarsResolver)((theme, { maxCollapsedHeight, background, radius }) => ({ codeHighlight: {
264
+ "--ch-max-height": (0, _mantine_vue_core.rem)(maxCollapsedHeight),
265
+ "--ch-background": background ? (0, _mantine_vue_core.getThemeColor)(background, theme) : void 0,
266
+ "--ch-radius": typeof radius !== "undefined" ? (0, _mantine_vue_core.getRadius)(radius) : void 0
267
+ } }));
268
+ function renderHtmlOrText(isHighlighted, highlightedCode, code) {
269
+ return isHighlighted ? { innerHTML: highlightedCode } : { textContent: code.trim() };
270
+ }
271
+ function cx(...values) {
272
+ return values.filter(Boolean);
273
+ }
274
+ function resolveColorScheme(value) {
275
+ if (value !== "auto") return value;
276
+ return typeof window !== "undefined" && window.matchMedia?.("(prefers-color-scheme: dark)").matches ? "dark" : "light";
277
+ }
278
+ var CodeHighlightBase = (0, vue.defineComponent)({
279
+ name: "CodeHighlight",
280
+ inheritAttrs: false,
281
+ props: {
282
+ code: {
283
+ type: String,
284
+ required: true
285
+ },
286
+ language: {
287
+ type: String,
288
+ default: void 0
289
+ },
290
+ copyLabel: {
291
+ type: String,
292
+ default: void 0
293
+ },
294
+ copiedLabel: {
295
+ type: String,
296
+ default: void 0
297
+ },
298
+ defaultExpanded: {
299
+ type: Boolean,
300
+ default: void 0
301
+ },
302
+ expanded: {
303
+ type: Boolean,
304
+ default: void 0
305
+ },
306
+ onExpandedChange: {
307
+ type: Function,
308
+ default: void 0
309
+ },
310
+ maxCollapsedHeight: {
311
+ type: [String, Number],
312
+ default: void 0
313
+ },
314
+ withCopyButton: {
315
+ type: Boolean,
316
+ default: void 0
317
+ },
318
+ withExpandButton: {
319
+ type: Boolean,
320
+ default: false
321
+ },
322
+ expandCodeLabel: {
323
+ type: String,
324
+ default: void 0
325
+ },
326
+ collapseCodeLabel: {
327
+ type: String,
328
+ default: void 0
329
+ },
330
+ background: {
331
+ type: String,
332
+ default: void 0
333
+ },
334
+ radius: {
335
+ type: [String, Number],
336
+ default: void 0
337
+ },
338
+ withBorder: {
339
+ type: Boolean,
340
+ default: false
341
+ },
342
+ withLineNumbers: {
343
+ type: Boolean,
344
+ default: false
345
+ },
346
+ controls: {
347
+ type: [Array, Function],
348
+ default: void 0
349
+ },
350
+ codeColorScheme: {
351
+ type: String,
352
+ default: void 0
353
+ },
354
+ __withOffset: {
355
+ type: Boolean,
356
+ default: false
357
+ },
358
+ __staticSelector: {
359
+ type: String,
360
+ default: void 0
361
+ },
362
+ __inline: {
363
+ type: Boolean,
364
+ default: false
365
+ },
366
+ classNames: {
367
+ type: [Object, Function],
368
+ default: void 0
369
+ },
370
+ styles: {
371
+ type: [Object, Function],
372
+ default: void 0
373
+ },
374
+ vars: {
375
+ type: [Object, Function],
376
+ default: void 0
377
+ },
378
+ unstyled: {
379
+ type: Boolean,
380
+ default: false
381
+ }
382
+ },
383
+ setup(rawProps, { attrs }) {
384
+ const props = (0, _mantine_vue_core.useProps)("CodeHighlight", defaultProps, rawProps);
385
+ const mantine = (0, _mantine_vue_core.useMantineContext)();
386
+ const getStyles = (0, _mantine_vue_core.useStyles)({
387
+ name: props.__staticSelector || "CodeHighlight",
388
+ classes: CodeHighlight_module_default,
389
+ props,
390
+ className: attrs.class,
391
+ style: attrs.style,
392
+ classNames: props.classNames,
393
+ styles: props.styles,
394
+ vars: props.vars,
395
+ unstyled: props.unstyled,
396
+ varsResolver: varsResolver$1,
397
+ rootSelector: "codeHighlight"
398
+ });
399
+ const [expanded, setExpanded] = (0, _mantine_vue_hooks.useUncontrolled)({
400
+ value: () => props.expanded,
401
+ defaultValue: props.defaultExpanded,
402
+ finalValue: true,
403
+ onChange: (value) => props.onExpandedChange?.(value)
404
+ });
405
+ const highlight = useHighlight();
406
+ provideCodeHighlightContext({
407
+ getStyles,
408
+ get codeColorScheme() {
409
+ return props.codeColorScheme;
410
+ }
411
+ });
412
+ return () => {
413
+ const colorScheme = resolveColorScheme(mantine.colorScheme.value);
414
+ const highlightedCode = highlight({
415
+ code: props.code.trim(),
416
+ language: props.language,
417
+ colorScheme: props.codeColorScheme ?? colorScheme
418
+ });
419
+ const codeContent = renderHtmlOrText(highlightedCode.isHighlighted, highlightedCode.highlightedCode, props.code);
420
+ if (props.__inline) return (0, vue.h)(_mantine_vue_core.Box, {
421
+ component: "code",
422
+ ...attrs,
423
+ ...highlightedCode.codeElementProps,
424
+ ...getStyles("codeHighlight", {
425
+ className: cx(highlightedCode.codeElementProps?.class, attrs.class),
426
+ style: [highlightedCode.codeElementProps?.style, attrs.style]
427
+ }),
428
+ "data-with-border": props.withBorder || void 0,
429
+ ...codeContent
430
+ });
431
+ const renderedControls = typeof props.controls === "function" ? props.controls() : props.controls;
432
+ const controlsArray = Array.isArray(renderedControls) ? renderedControls : renderedControls ? [renderedControls] : [];
433
+ const shouldDisplayControls = controlsArray.length > 0 || props.withExpandButton || props.withCopyButton;
434
+ return (0, vue.h)(_mantine_vue_core.Box, {
435
+ ...attrs,
436
+ ...getStyles("codeHighlight"),
437
+ dir: "ltr",
438
+ "data-code-color-scheme": props.codeColorScheme,
439
+ "data-with-border": props.withBorder || void 0
440
+ }, () => [
441
+ shouldDisplayControls ? (0, vue.h)("div", {
442
+ ...getStyles("controls"),
443
+ "data-with-offset": props.__withOffset || void 0
444
+ }, [
445
+ ...controlsArray,
446
+ props.withExpandButton ? (0, vue.h)(ExpandCodeButton, {
447
+ expanded: expanded.value,
448
+ onExpand: setExpanded,
449
+ expandCodeLabel: props.expandCodeLabel,
450
+ collapseCodeLabel: props.collapseCodeLabel
451
+ }) : null,
452
+ props.withCopyButton ? (0, vue.h)(CopyCodeButton, {
453
+ code: props.code,
454
+ copiedLabel: props.copiedLabel,
455
+ copyLabel: props.copyLabel
456
+ }) : null
457
+ ]) : null,
458
+ (0, vue.h)(_mantine_vue_core.ScrollArea, {
459
+ type: "hover",
460
+ scrollbarSize: 4,
461
+ dir: "ltr",
462
+ offsetScrollbars: false,
463
+ "data-collapsed": !expanded.value || void 0,
464
+ styles: { viewport: { overscrollBehaviorInline: "none" } },
465
+ ...getStyles("scrollarea")
466
+ }, () => (0, vue.h)("div", getStyles("codeWrapper"), [props.withLineNumbers ? (0, vue.h)("div", {
467
+ ...getStyles("lineNumbers"),
468
+ "data-with-offset": props.__withOffset || void 0
469
+ }, props.code.trim().split("\n").map((_, index) => (0, vue.h)("div", { key: index }, index + 1))) : null, (0, vue.h)("pre", {
470
+ ...getStyles("pre"),
471
+ "data-with-offset": props.__withOffset || void 0
472
+ }, (0, vue.h)("code", {
473
+ ...highlightedCode.codeElementProps,
474
+ ...getStyles("code", {
475
+ className: highlightedCode.codeElementProps?.class,
476
+ style: highlightedCode.codeElementProps?.style
477
+ }),
478
+ ...codeContent
479
+ }))])),
480
+ (0, vue.h)(_mantine_vue_core.UnstyledButton, {
481
+ ...getStyles("showCodeButton"),
482
+ mod: { hidden: expanded.value },
483
+ onClick: () => setExpanded(true),
484
+ "data-code-color-scheme": props.codeColorScheme
485
+ }, () => props.expandCodeLabel)
486
+ ]);
487
+ };
488
+ }
489
+ });
490
+ var CodeHighlight = Object.assign(CodeHighlightBase, {
491
+ classes: CodeHighlight_module_default,
492
+ varsResolver: varsResolver$1,
493
+ Control: CodeHighlightControl
494
+ });
495
+ //#endregion
496
+ //#region src/CodeHighlight/InlineCodeHighlight.ts
497
+ var varsResolver = (0, _mantine_vue_core.createVarsResolver)((theme, { background, radius }) => ({ inlineCodeHighlight: {
498
+ "--ch-background": background ? (0, _mantine_vue_core.getThemeColor)(background, theme) : void 0,
499
+ "--ch-radius": typeof radius !== "undefined" ? (0, _mantine_vue_core.getRadius)(radius) : void 0
500
+ } }));
501
+ var InlineCodeHighlight = (0, vue.defineComponent)({
502
+ name: "InlineCodeHighlight",
503
+ inheritAttrs: false,
504
+ props: {
505
+ code: {
506
+ type: String,
507
+ required: true
508
+ },
509
+ language: {
510
+ type: String,
511
+ default: void 0
512
+ },
513
+ background: {
514
+ type: String,
515
+ default: void 0
516
+ },
517
+ radius: {
518
+ type: [String, Number],
519
+ default: void 0
520
+ },
521
+ withBorder: {
522
+ type: Boolean,
523
+ default: false
524
+ },
525
+ classNames: {
526
+ type: [Object, Function],
527
+ default: void 0
528
+ },
529
+ styles: {
530
+ type: [Object, Function],
531
+ default: void 0
532
+ },
533
+ vars: {
534
+ type: [Object, Function],
535
+ default: void 0
536
+ },
537
+ unstyled: {
538
+ type: Boolean,
539
+ default: false
540
+ }
541
+ },
542
+ setup(rawProps, { attrs }) {
543
+ const props = (0, _mantine_vue_core.useProps)("InlineCodeHighlight", null, rawProps);
544
+ const getStyles = (0, _mantine_vue_core.useStyles)({
545
+ name: "InlineCodeHighlight",
546
+ classes: CodeHighlight_module_default,
547
+ props,
548
+ className: attrs.class,
549
+ style: attrs.style,
550
+ classNames: props.classNames,
551
+ styles: props.styles,
552
+ unstyled: props.unstyled,
553
+ vars: props.vars,
554
+ varsResolver,
555
+ rootSelector: "inlineCodeHighlight"
556
+ });
557
+ return () => (0, vue.h)(CodeHighlight, {
558
+ ...attrs,
559
+ ...props,
560
+ ...getStyles("inlineCodeHighlight"),
561
+ __inline: true
562
+ });
563
+ }
564
+ });
565
+ Object.assign(InlineCodeHighlight, {
566
+ classes: CodeHighlight_module_default,
567
+ varsResolver
568
+ });
569
+ //#endregion
570
+ //#region src/CodeHighlightTabs/FileIcon.ts
571
+ var FileIcon = (0, vue.defineComponent)({
572
+ name: "FileIcon",
573
+ inheritAttrs: false,
574
+ props: {
575
+ fileName: {
576
+ type: String,
577
+ default: void 0
578
+ },
579
+ getFileIcon: {
580
+ type: Function,
581
+ default: void 0
582
+ },
583
+ fileIcon: {
584
+ type: [
585
+ String,
586
+ Number,
587
+ Object,
588
+ Function,
589
+ Array
590
+ ],
591
+ default: void 0
592
+ }
593
+ },
594
+ setup(props, { attrs }) {
595
+ return () => {
596
+ if (props.fileIcon) return (0, vue.h)("span", attrs, props.fileIcon);
597
+ if (props.getFileIcon && props.fileName) return (0, vue.h)("span", attrs, props.getFileIcon(props.fileName));
598
+ return null;
599
+ };
600
+ }
601
+ });
602
+ //#endregion
603
+ //#region src/CodeHighlightTabs/CodeHighlightTabs.ts
604
+ var CodeHighlightTabs = (0, vue.defineComponent)({
605
+ name: "CodeHighlightTabs",
606
+ inheritAttrs: false,
607
+ props: {
608
+ code: {
609
+ type: Array,
610
+ required: true
611
+ },
612
+ getFileIcon: {
613
+ type: Function,
614
+ default: void 0
615
+ },
616
+ defaultActiveTab: {
617
+ type: Number,
618
+ default: void 0
619
+ },
620
+ activeTab: {
621
+ type: Number,
622
+ default: void 0
623
+ },
624
+ onTabChange: {
625
+ type: Function,
626
+ default: void 0
627
+ },
628
+ defaultExpanded: {
629
+ type: Boolean,
630
+ default: void 0
631
+ },
632
+ expanded: {
633
+ type: Boolean,
634
+ default: void 0
635
+ },
636
+ onExpandedChange: {
637
+ type: Function,
638
+ default: void 0
639
+ },
640
+ withCopyButton: {
641
+ type: Boolean,
642
+ default: void 0
643
+ },
644
+ withExpandButton: {
645
+ type: Boolean,
646
+ default: false
647
+ },
648
+ withBorder: {
649
+ type: Boolean,
650
+ default: false
651
+ },
652
+ radius: {
653
+ type: [String, Number],
654
+ default: void 0
655
+ },
656
+ maxCollapsedHeight: {
657
+ type: [String, Number],
658
+ default: void 0
659
+ },
660
+ copyLabel: {
661
+ type: String,
662
+ default: void 0
663
+ },
664
+ copiedLabel: {
665
+ type: String,
666
+ default: void 0
667
+ },
668
+ expandCodeLabel: {
669
+ type: String,
670
+ default: void 0
671
+ },
672
+ collapseCodeLabel: {
673
+ type: String,
674
+ default: void 0
675
+ },
676
+ background: {
677
+ type: String,
678
+ default: void 0
679
+ },
680
+ controls: {
681
+ type: [Array, Function],
682
+ default: void 0
683
+ },
684
+ codeColorScheme: {
685
+ type: String,
686
+ default: void 0
687
+ },
688
+ withLineNumbers: {
689
+ type: Boolean,
690
+ default: false
691
+ },
692
+ classNames: {
693
+ type: [Object, Function],
694
+ default: void 0
695
+ },
696
+ styles: {
697
+ type: [Object, Function],
698
+ default: void 0
699
+ },
700
+ vars: {
701
+ type: [Object, Function],
702
+ default: void 0
703
+ },
704
+ unstyled: {
705
+ type: Boolean,
706
+ default: false
707
+ }
708
+ },
709
+ setup(rawProps, { attrs }) {
710
+ const props = (0, _mantine_vue_core.useProps)("CodeHighlightTabs", null, rawProps);
711
+ const getStyles = (0, _mantine_vue_core.useStyles)({
712
+ name: "CodeHighlightTabs",
713
+ classes: CodeHighlight_module_default,
714
+ props,
715
+ className: attrs.class,
716
+ style: attrs.style,
717
+ classNames: props.classNames,
718
+ styles: props.styles,
719
+ unstyled: props.unstyled,
720
+ vars: props.vars
721
+ });
722
+ const [value, setValue] = (0, _mantine_vue_hooks.useUncontrolled)({
723
+ defaultValue: props.defaultActiveTab,
724
+ value: () => props.activeTab,
725
+ finalValue: 0,
726
+ onChange: (tab) => props.onTabChange?.(tab)
727
+ });
728
+ const [expanded, setExpanded] = (0, _mantine_vue_hooks.useUncontrolled)({
729
+ defaultValue: props.defaultExpanded,
730
+ value: () => props.expanded,
731
+ finalValue: true,
732
+ onChange: (next) => props.onExpandedChange?.(next)
733
+ });
734
+ (0, vue.watch)(() => [value.value, props.code.length], ([currentValue, length]) => {
735
+ if (currentValue >= length) setValue(length - 1);
736
+ }, { immediate: true });
737
+ return () => {
738
+ if (props.code.length <= 0) return null;
739
+ const currentCode = props.code[value.value] || {
740
+ code: "",
741
+ language: "tsx",
742
+ fileName: ""
743
+ };
744
+ const files = props.code.map((node, index) => (0, vue.h)(_mantine_vue_core.UnstyledButton, {
745
+ ...getStyles("file"),
746
+ key: node.fileName ?? index,
747
+ mod: { active: index === value.value },
748
+ onClick: () => setValue(index),
749
+ "data-color-scheme": props.codeColorScheme
750
+ }, () => [(0, vue.h)(FileIcon, {
751
+ fileIcon: node.icon,
752
+ getFileIcon: props.getFileIcon,
753
+ fileName: node.fileName,
754
+ key: "file-icon",
755
+ ...getStyles("fileIcon")
756
+ }), (0, vue.h)("span", { key: "file-name" }, node.fileName)]));
757
+ return (0, vue.h)(_mantine_vue_core.Box, {
758
+ ...attrs,
759
+ ...getStyles("root")
760
+ }, () => [(0, vue.h)(_mantine_vue_core.ScrollArea, {
761
+ type: "never",
762
+ dir: "ltr",
763
+ offsetScrollbars: false,
764
+ ...getStyles("filesScrollarea")
765
+ }, () => (0, vue.h)("div", getStyles("files"), files)), (0, vue.h)(CodeHighlight, {
766
+ code: currentCode.code,
767
+ language: currentCode.language,
768
+ expanded: expanded.value,
769
+ onExpandedChange: setExpanded,
770
+ withCopyButton: props.withCopyButton,
771
+ withExpandButton: props.withExpandButton,
772
+ withBorder: props.withBorder,
773
+ radius: props.radius,
774
+ maxCollapsedHeight: props.maxCollapsedHeight,
775
+ copiedLabel: props.copiedLabel,
776
+ copyLabel: props.copyLabel,
777
+ expandCodeLabel: props.expandCodeLabel,
778
+ collapseCodeLabel: props.collapseCodeLabel,
779
+ background: props.background,
780
+ controls: props.controls,
781
+ codeColorScheme: props.codeColorScheme,
782
+ withLineNumbers: props.withLineNumbers,
783
+ __withOffset: true,
784
+ __staticSelector: "CodeHighlightTabs",
785
+ classNames: props.classNames,
786
+ styles: props.styles
787
+ })]);
788
+ };
789
+ }
790
+ });
791
+ Object.assign(CodeHighlightTabs, { classes: CodeHighlight_module_default });
792
+ //#endregion
793
+ //#region src/CodeHighlightProvider/adapters/highlight-js-adapter.ts
794
+ function createHighlightJsAdapter(hljs) {
795
+ return { getHighlighter: () => ({ code, language }) => {
796
+ const lang = hljs.getLanguage(language) ? language : "plaintext";
797
+ return {
798
+ highlightedCode: hljs.highlight(code.trim(), { language: lang }).value,
799
+ isHighlighted: true,
800
+ codeElementProps: { class: `hljs ${lang}` }
801
+ };
802
+ } };
803
+ }
804
+ //#endregion
805
+ //#region src/CodeHighlightProvider/adapters/shiki-themes.ts
806
+ var light = {
807
+ colors: {
808
+ "activityBar.activeBorder": "#fd8c73",
809
+ "activityBar.background": "#ffffff",
810
+ "activityBar.border": "#d0d7de",
811
+ "activityBar.foreground": "#1f2328",
812
+ "activityBar.inactiveForeground": "#656d76",
813
+ "activityBarBadge.background": "#0969da",
814
+ "activityBarBadge.foreground": "#ffffff",
815
+ "badge.background": "#0969da",
816
+ "badge.foreground": "#ffffff",
817
+ "breadcrumb.activeSelectionForeground": "#656d76",
818
+ "breadcrumb.focusForeground": "#1f2328",
819
+ "breadcrumb.foreground": "#656d76",
820
+ "breadcrumbPicker.background": "#ffffff",
821
+ "button.background": "#1f883d",
822
+ "button.foreground": "#ffffff",
823
+ "button.hoverBackground": "#1a7f37",
824
+ "button.secondaryBackground": "#ebecf0",
825
+ "button.secondaryForeground": "#24292f",
826
+ "button.secondaryHoverBackground": "#f3f4f6",
827
+ "checkbox.background": "#f6f8fa",
828
+ "checkbox.border": "#d0d7de",
829
+ "debugConsole.errorForeground": "#cf222e",
830
+ "debugConsole.infoForeground": "#57606a",
831
+ "debugConsole.sourceForeground": "#9a6700",
832
+ "debugConsole.warningForeground": "#7d4e00",
833
+ "debugConsoleInputIcon.foreground": "#6639ba",
834
+ "debugIcon.breakpointForeground": "#cf222e",
835
+ "debugTokenExpression.boolean": "#116329",
836
+ "debugTokenExpression.error": "#a40e26",
837
+ "debugTokenExpression.name": "#0550ae",
838
+ "debugTokenExpression.number": "#116329",
839
+ "debugTokenExpression.string": "#0a3069",
840
+ "debugTokenExpression.value": "#0a3069",
841
+ "debugToolBar.background": "#ffffff",
842
+ descriptionForeground: "#656d76",
843
+ "diffEditor.insertedLineBackground": "#aceebb4d",
844
+ "diffEditor.insertedTextBackground": "#6fdd8b80",
845
+ "diffEditor.removedLineBackground": "#ffcecb4d",
846
+ "diffEditor.removedTextBackground": "#ff818266",
847
+ "dropdown.background": "#ffffff",
848
+ "dropdown.border": "#d0d7de",
849
+ "dropdown.foreground": "#1f2328",
850
+ "dropdown.listBackground": "#ffffff",
851
+ "editor.background": "#ffffff",
852
+ "editor.findMatchBackground": "#bf8700",
853
+ "editor.findMatchHighlightBackground": "#fae17d80",
854
+ "editor.focusedStackFrameHighlightBackground": "#4ac26b66",
855
+ "editor.foldBackground": "#6e77811a",
856
+ "editor.foreground": "#1f2328",
857
+ "editor.lineHighlightBackground": "#eaeef280",
858
+ "editor.linkedEditingBackground": "#0969da12",
859
+ "editor.selectionHighlightBackground": "#4ac26b40",
860
+ "editor.stackFrameHighlightBackground": "#d4a72c66",
861
+ "editor.wordHighlightBackground": "#eaeef280",
862
+ "editor.wordHighlightBorder": "#afb8c199",
863
+ "editor.wordHighlightStrongBackground": "#afb8c14d",
864
+ "editor.wordHighlightStrongBorder": "#afb8c199",
865
+ "editorBracketHighlight.foreground1": "#0969da",
866
+ "editorBracketHighlight.foreground2": "#1a7f37",
867
+ "editorBracketHighlight.foreground3": "#9a6700",
868
+ "editorBracketHighlight.foreground4": "#cf222e",
869
+ "editorBracketHighlight.foreground5": "#bf3989",
870
+ "editorBracketHighlight.foreground6": "#8250df",
871
+ "editorBracketHighlight.unexpectedBracket.foreground": "#656d76",
872
+ "editorBracketMatch.background": "#4ac26b40",
873
+ "editorBracketMatch.border": "#4ac26b99",
874
+ "editorCursor.foreground": "#0969da",
875
+ "editorGroup.border": "#d0d7de",
876
+ "editorGroupHeader.tabsBackground": "#f6f8fa",
877
+ "editorGroupHeader.tabsBorder": "#d0d7de",
878
+ "editorGutter.addedBackground": "#4ac26b66",
879
+ "editorGutter.deletedBackground": "#ff818266",
880
+ "editorGutter.modifiedBackground": "#d4a72c66",
881
+ "editorIndentGuide.activeBackground": "#1f23283d",
882
+ "editorIndentGuide.background": "#1f23281f",
883
+ "editorInlayHint.background": "#afb8c133",
884
+ "editorInlayHint.foreground": "#656d76",
885
+ "editorInlayHint.paramBackground": "#afb8c133",
886
+ "editorInlayHint.paramForeground": "#656d76",
887
+ "editorInlayHint.typeBackground": "#afb8c133",
888
+ "editorInlayHint.typeForeground": "#656d76",
889
+ "editorLineNumber.activeForeground": "#1f2328",
890
+ "editorLineNumber.foreground": "#8c959f",
891
+ "editorOverviewRuler.border": "#ffffff",
892
+ "editorWhitespace.foreground": "#afb8c1",
893
+ "editorWidget.background": "#ffffff",
894
+ errorForeground: "#cf222e",
895
+ focusBorder: "#0969da",
896
+ foreground: "#1f2328",
897
+ "gitDecoration.addedResourceForeground": "#1a7f37",
898
+ "gitDecoration.conflictingResourceForeground": "#bc4c00",
899
+ "gitDecoration.deletedResourceForeground": "#cf222e",
900
+ "gitDecoration.ignoredResourceForeground": "#6e7781",
901
+ "gitDecoration.modifiedResourceForeground": "#9a6700",
902
+ "gitDecoration.submoduleResourceForeground": "#656d76",
903
+ "gitDecoration.untrackedResourceForeground": "#1a7f37",
904
+ "icon.foreground": "#656d76",
905
+ "input.background": "#ffffff",
906
+ "input.border": "#d0d7de",
907
+ "input.foreground": "#1f2328",
908
+ "input.placeholderForeground": "#6e7781",
909
+ "keybindingLabel.foreground": "#1f2328",
910
+ "list.activeSelectionBackground": "#afb8c133",
911
+ "list.activeSelectionForeground": "#1f2328",
912
+ "list.focusBackground": "#ddf4ff",
913
+ "list.focusForeground": "#1f2328",
914
+ "list.highlightForeground": "#0969da",
915
+ "list.hoverBackground": "#eaeef280",
916
+ "list.hoverForeground": "#1f2328",
917
+ "list.inactiveFocusBackground": "#ddf4ff",
918
+ "list.inactiveSelectionBackground": "#afb8c133",
919
+ "list.inactiveSelectionForeground": "#1f2328",
920
+ "minimapSlider.activeBackground": "#8c959f47",
921
+ "minimapSlider.background": "#8c959f33",
922
+ "minimapSlider.hoverBackground": "#8c959f3d",
923
+ "notificationCenterHeader.background": "#f6f8fa",
924
+ "notificationCenterHeader.foreground": "#656d76",
925
+ "notifications.background": "#ffffff",
926
+ "notifications.border": "#d0d7de",
927
+ "notifications.foreground": "#1f2328",
928
+ "notificationsErrorIcon.foreground": "#cf222e",
929
+ "notificationsInfoIcon.foreground": "#0969da",
930
+ "notificationsWarningIcon.foreground": "#9a6700",
931
+ "panel.background": "#f6f8fa",
932
+ "panel.border": "#d0d7de",
933
+ "panelInput.border": "#d0d7de",
934
+ "panelTitle.activeBorder": "#fd8c73",
935
+ "panelTitle.activeForeground": "#1f2328",
936
+ "panelTitle.inactiveForeground": "#656d76",
937
+ "pickerGroup.border": "#d0d7de",
938
+ "pickerGroup.foreground": "#656d76",
939
+ "progressBar.background": "#0969da",
940
+ "quickInput.background": "#ffffff",
941
+ "quickInput.foreground": "#1f2328",
942
+ "scrollbar.shadow": "#6e778133",
943
+ "scrollbarSlider.activeBackground": "#8c959f47",
944
+ "scrollbarSlider.background": "#8c959f33",
945
+ "scrollbarSlider.hoverBackground": "#8c959f3d",
946
+ "settings.headerForeground": "#1f2328",
947
+ "settings.modifiedItemIndicator": "#d4a72c66",
948
+ "sideBar.background": "#f6f8fa",
949
+ "sideBar.border": "#d0d7de",
950
+ "sideBar.foreground": "#1f2328",
951
+ "sideBarSectionHeader.background": "#f6f8fa",
952
+ "sideBarSectionHeader.border": "#d0d7de",
953
+ "sideBarSectionHeader.foreground": "#1f2328",
954
+ "sideBarTitle.foreground": "#1f2328",
955
+ "statusBar.background": "#ffffff",
956
+ "statusBar.border": "#d0d7de",
957
+ "statusBar.debuggingBackground": "#cf222e",
958
+ "statusBar.debuggingForeground": "#ffffff",
959
+ "statusBar.focusBorder": "#0969da80",
960
+ "statusBar.foreground": "#656d76",
961
+ "statusBar.noFolderBackground": "#ffffff",
962
+ "statusBarItem.activeBackground": "#1f23281f",
963
+ "statusBarItem.focusBorder": "#0969da",
964
+ "statusBarItem.hoverBackground": "#1f232814",
965
+ "statusBarItem.prominentBackground": "#afb8c133",
966
+ "statusBarItem.remoteBackground": "#eaeef2",
967
+ "statusBarItem.remoteForeground": "#1f2328",
968
+ "symbolIcon.arrayForeground": "#953800",
969
+ "symbolIcon.booleanForeground": "#0550ae",
970
+ "symbolIcon.classForeground": "#953800",
971
+ "symbolIcon.colorForeground": "#0a3069",
972
+ "symbolIcon.constantForeground": "#116329",
973
+ "symbolIcon.constructorForeground": "#3e1f79",
974
+ "symbolIcon.enumeratorForeground": "#953800",
975
+ "symbolIcon.enumeratorMemberForeground": "#0550ae",
976
+ "symbolIcon.eventForeground": "#57606a",
977
+ "symbolIcon.fieldForeground": "#953800",
978
+ "symbolIcon.fileForeground": "#7d4e00",
979
+ "symbolIcon.folderForeground": "#7d4e00",
980
+ "symbolIcon.functionForeground": "#6639ba",
981
+ "symbolIcon.interfaceForeground": "#953800",
982
+ "symbolIcon.keyForeground": "#0550ae",
983
+ "symbolIcon.keywordForeground": "#a40e26",
984
+ "symbolIcon.methodForeground": "#6639ba",
985
+ "symbolIcon.moduleForeground": "#a40e26",
986
+ "symbolIcon.namespaceForeground": "#a40e26",
987
+ "symbolIcon.nullForeground": "#0550ae",
988
+ "symbolIcon.numberForeground": "#116329",
989
+ "symbolIcon.objectForeground": "#953800",
990
+ "symbolIcon.operatorForeground": "#0a3069",
991
+ "symbolIcon.packageForeground": "#953800",
992
+ "symbolIcon.propertyForeground": "#953800",
993
+ "symbolIcon.referenceForeground": "#0550ae",
994
+ "symbolIcon.snippetForeground": "#0550ae",
995
+ "symbolIcon.stringForeground": "#0a3069",
996
+ "symbolIcon.structForeground": "#953800",
997
+ "symbolIcon.textForeground": "#0a3069",
998
+ "symbolIcon.typeParameterForeground": "#0a3069",
999
+ "symbolIcon.unitForeground": "#0550ae",
1000
+ "symbolIcon.variableForeground": "#953800",
1001
+ "tab.activeBackground": "#ffffff",
1002
+ "tab.activeBorder": "#ffffff",
1003
+ "tab.activeBorderTop": "#fd8c73",
1004
+ "tab.activeForeground": "#1f2328",
1005
+ "tab.border": "#d0d7de",
1006
+ "tab.hoverBackground": "#ffffff",
1007
+ "tab.inactiveBackground": "#f6f8fa",
1008
+ "tab.inactiveForeground": "#656d76",
1009
+ "tab.unfocusedActiveBorder": "#ffffff",
1010
+ "tab.unfocusedActiveBorderTop": "#d0d7de",
1011
+ "tab.unfocusedHoverBackground": "#eaeef280",
1012
+ "terminal.ansiBlack": "#24292f",
1013
+ "terminal.ansiBlue": "#0969da",
1014
+ "terminal.ansiBrightBlack": "#57606a",
1015
+ "terminal.ansiBrightBlue": "#218bff",
1016
+ "terminal.ansiBrightCyan": "#3192aa",
1017
+ "terminal.ansiBrightGreen": "#1a7f37",
1018
+ "terminal.ansiBrightMagenta": "#a475f9",
1019
+ "terminal.ansiBrightRed": "#a40e26",
1020
+ "terminal.ansiBrightWhite": "#8c959f",
1021
+ "terminal.ansiBrightYellow": "#633c01",
1022
+ "terminal.ansiCyan": "#1b7c83",
1023
+ "terminal.ansiGreen": "#116329",
1024
+ "terminal.ansiMagenta": "#8250df",
1025
+ "terminal.ansiRed": "#cf222e",
1026
+ "terminal.ansiWhite": "#6e7781",
1027
+ "terminal.ansiYellow": "#4d2d00",
1028
+ "terminal.foreground": "#1f2328",
1029
+ "textBlockQuote.background": "#f6f8fa",
1030
+ "textBlockQuote.border": "#d0d7de",
1031
+ "textCodeBlock.background": "#afb8c133",
1032
+ "textLink.activeForeground": "#0969da",
1033
+ "textLink.foreground": "#0969da",
1034
+ "textPreformat.foreground": "#656d76",
1035
+ "textSeparator.foreground": "#d8dee4",
1036
+ "titleBar.activeBackground": "#ffffff",
1037
+ "titleBar.activeForeground": "#656d76",
1038
+ "titleBar.border": "#d0d7de",
1039
+ "titleBar.inactiveBackground": "#f6f8fa",
1040
+ "titleBar.inactiveForeground": "#656d76",
1041
+ "tree.indentGuidesStroke": "#d8dee4",
1042
+ "welcomePage.buttonBackground": "#f6f8fa",
1043
+ "welcomePage.buttonHoverBackground": "#f3f4f6"
1044
+ },
1045
+ displayName: "GitHub Light Default",
1046
+ semanticHighlighting: true,
1047
+ tokenColors: [
1048
+ {
1049
+ scope: [
1050
+ "comment",
1051
+ "punctuation.definition.comment",
1052
+ "string.comment"
1053
+ ],
1054
+ settings: { foreground: "#6e7781" }
1055
+ },
1056
+ {
1057
+ scope: ["constant.other.placeholder", "constant.character"],
1058
+ settings: { foreground: "#cf222e" }
1059
+ },
1060
+ {
1061
+ scope: [
1062
+ "constant",
1063
+ "entity.name.constant",
1064
+ "variable.other.constant",
1065
+ "variable.other.enummember",
1066
+ "variable.language",
1067
+ "entity"
1068
+ ],
1069
+ settings: { foreground: "#0550ae" }
1070
+ },
1071
+ {
1072
+ scope: [
1073
+ "entity.name",
1074
+ "meta.export.default",
1075
+ "meta.definition.variable"
1076
+ ],
1077
+ settings: { foreground: "#953800" }
1078
+ },
1079
+ {
1080
+ scope: [
1081
+ "variable.parameter.function",
1082
+ "meta.jsx.children",
1083
+ "meta.block",
1084
+ "meta.tag.attributes",
1085
+ "entity.name.constant",
1086
+ "meta.object.member",
1087
+ "meta.embedded.expression"
1088
+ ],
1089
+ settings: { foreground: "#1f2328" }
1090
+ },
1091
+ {
1092
+ scope: "entity.name.function",
1093
+ settings: { foreground: "#8250df" }
1094
+ },
1095
+ {
1096
+ scope: ["entity.name.tag", "support.class.component"],
1097
+ settings: { foreground: "#116329" }
1098
+ },
1099
+ {
1100
+ scope: "keyword",
1101
+ settings: { foreground: "#cf222e" }
1102
+ },
1103
+ {
1104
+ scope: ["storage", "storage.type"],
1105
+ settings: { foreground: "#cf222e" }
1106
+ },
1107
+ {
1108
+ scope: [
1109
+ "storage.modifier.package",
1110
+ "storage.modifier.import",
1111
+ "storage.type.java"
1112
+ ],
1113
+ settings: { foreground: "#1f2328" }
1114
+ },
1115
+ {
1116
+ scope: ["string", "string punctuation.section.embedded source"],
1117
+ settings: { foreground: "#0a3069" }
1118
+ },
1119
+ {
1120
+ scope: "support",
1121
+ settings: { foreground: "#0550ae" }
1122
+ },
1123
+ {
1124
+ scope: "meta.property-name",
1125
+ settings: { foreground: "#0550ae" }
1126
+ },
1127
+ {
1128
+ scope: "variable",
1129
+ settings: { foreground: "#953800" }
1130
+ },
1131
+ {
1132
+ scope: "variable.other",
1133
+ settings: { foreground: "#1f2328" }
1134
+ },
1135
+ {
1136
+ scope: "invalid.broken",
1137
+ settings: {
1138
+ fontStyle: "italic",
1139
+ foreground: "#82071e"
1140
+ }
1141
+ },
1142
+ {
1143
+ scope: "invalid.deprecated",
1144
+ settings: {
1145
+ fontStyle: "italic",
1146
+ foreground: "#82071e"
1147
+ }
1148
+ },
1149
+ {
1150
+ scope: "invalid.illegal",
1151
+ settings: {
1152
+ fontStyle: "italic",
1153
+ foreground: "#82071e"
1154
+ }
1155
+ },
1156
+ {
1157
+ scope: "invalid.unimplemented",
1158
+ settings: {
1159
+ fontStyle: "italic",
1160
+ foreground: "#82071e"
1161
+ }
1162
+ },
1163
+ {
1164
+ scope: "carriage-return",
1165
+ settings: {
1166
+ background: "#cf222e",
1167
+ content: "^M",
1168
+ fontStyle: "italic underline",
1169
+ foreground: "#f6f8fa"
1170
+ }
1171
+ },
1172
+ {
1173
+ scope: "message.error",
1174
+ settings: { foreground: "#82071e" }
1175
+ },
1176
+ {
1177
+ scope: "string variable",
1178
+ settings: { foreground: "#0550ae" }
1179
+ },
1180
+ {
1181
+ scope: ["source.regexp", "string.regexp"],
1182
+ settings: { foreground: "#0a3069" }
1183
+ },
1184
+ {
1185
+ scope: [
1186
+ "string.regexp.character-class",
1187
+ "string.regexp constant.character.escape",
1188
+ "string.regexp source.ruby.embedded",
1189
+ "string.regexp string.regexp.arbitrary-repitition"
1190
+ ],
1191
+ settings: { foreground: "#0a3069" }
1192
+ },
1193
+ {
1194
+ scope: "string.regexp constant.character.escape",
1195
+ settings: {
1196
+ fontStyle: "bold",
1197
+ foreground: "#116329"
1198
+ }
1199
+ },
1200
+ {
1201
+ scope: "support.constant",
1202
+ settings: { foreground: "#0550ae" }
1203
+ },
1204
+ {
1205
+ scope: "support.variable",
1206
+ settings: { foreground: "#0550ae" }
1207
+ },
1208
+ {
1209
+ scope: "support.type.property-name.json",
1210
+ settings: { foreground: "#116329" }
1211
+ },
1212
+ {
1213
+ scope: "meta.module-reference",
1214
+ settings: { foreground: "#0550ae" }
1215
+ },
1216
+ {
1217
+ scope: "punctuation.definition.list.begin.markdown",
1218
+ settings: { foreground: "#953800" }
1219
+ },
1220
+ {
1221
+ scope: ["markup.heading", "markup.heading entity.name"],
1222
+ settings: {
1223
+ fontStyle: "bold",
1224
+ foreground: "#0550ae"
1225
+ }
1226
+ },
1227
+ {
1228
+ scope: "markup.quote",
1229
+ settings: { foreground: "#116329" }
1230
+ },
1231
+ {
1232
+ scope: "markup.italic",
1233
+ settings: {
1234
+ fontStyle: "italic",
1235
+ foreground: "#1f2328"
1236
+ }
1237
+ },
1238
+ {
1239
+ scope: "markup.bold",
1240
+ settings: {
1241
+ fontStyle: "bold",
1242
+ foreground: "#1f2328"
1243
+ }
1244
+ },
1245
+ {
1246
+ scope: ["markup.underline"],
1247
+ settings: { fontStyle: "underline" }
1248
+ },
1249
+ {
1250
+ scope: ["markup.strikethrough"],
1251
+ settings: { fontStyle: "strikethrough" }
1252
+ },
1253
+ {
1254
+ scope: "markup.inline.raw",
1255
+ settings: { foreground: "#0550ae" }
1256
+ },
1257
+ {
1258
+ scope: [
1259
+ "markup.deleted",
1260
+ "meta.diff.header.from-file",
1261
+ "punctuation.definition.deleted"
1262
+ ],
1263
+ settings: {
1264
+ background: "#ffebe9",
1265
+ foreground: "#82071e"
1266
+ }
1267
+ },
1268
+ {
1269
+ scope: ["punctuation.section.embedded"],
1270
+ settings: { foreground: "#cf222e" }
1271
+ },
1272
+ {
1273
+ scope: [
1274
+ "markup.inserted",
1275
+ "meta.diff.header.to-file",
1276
+ "punctuation.definition.inserted"
1277
+ ],
1278
+ settings: {
1279
+ background: "#dafbe1",
1280
+ foreground: "#116329"
1281
+ }
1282
+ },
1283
+ {
1284
+ scope: ["markup.changed", "punctuation.definition.changed"],
1285
+ settings: {
1286
+ background: "#ffd8b5",
1287
+ foreground: "#953800"
1288
+ }
1289
+ },
1290
+ {
1291
+ scope: ["markup.ignored", "markup.untracked"],
1292
+ settings: {
1293
+ background: "#0550ae",
1294
+ foreground: "#eaeef2"
1295
+ }
1296
+ },
1297
+ {
1298
+ scope: "meta.diff.range",
1299
+ settings: {
1300
+ fontStyle: "bold",
1301
+ foreground: "#8250df"
1302
+ }
1303
+ },
1304
+ {
1305
+ scope: "meta.diff.header",
1306
+ settings: { foreground: "#0550ae" }
1307
+ },
1308
+ {
1309
+ scope: "meta.separator",
1310
+ settings: {
1311
+ fontStyle: "bold",
1312
+ foreground: "#0550ae"
1313
+ }
1314
+ },
1315
+ {
1316
+ scope: "meta.output",
1317
+ settings: { foreground: "#0550ae" }
1318
+ },
1319
+ {
1320
+ scope: [
1321
+ "brackethighlighter.tag",
1322
+ "brackethighlighter.curly",
1323
+ "brackethighlighter.round",
1324
+ "brackethighlighter.square",
1325
+ "brackethighlighter.angle",
1326
+ "brackethighlighter.quote"
1327
+ ],
1328
+ settings: { foreground: "#57606a" }
1329
+ },
1330
+ {
1331
+ scope: "brackethighlighter.unmatched",
1332
+ settings: { foreground: "#82071e" }
1333
+ },
1334
+ {
1335
+ scope: ["constant.other.reference.link", "string.other.link"],
1336
+ settings: { foreground: "#0a3069" }
1337
+ }
1338
+ ],
1339
+ type: "light"
1340
+ };
1341
+ var dark = {
1342
+ type: "dark",
1343
+ colors: {
1344
+ "dropdown.background": "#525252",
1345
+ "list.activeSelectionBackground": "#707070",
1346
+ "quickInputList.focusBackground": "#707070",
1347
+ "list.inactiveSelectionBackground": "#4e4e4e",
1348
+ "list.hoverBackground": "#444444",
1349
+ "list.highlightForeground": "#e58520",
1350
+ "button.background": "#565656",
1351
+ "editor.background": "#1e1e1e",
1352
+ "editor.foreground": "#c5c8c6",
1353
+ "editor.selectionBackground": "#676b7180",
1354
+ "minimap.selectionHighlight": "#676b7180",
1355
+ "editor.selectionHighlightBackground": "#575b6180",
1356
+ "editor.lineHighlightBackground": "#303030",
1357
+ "editorLineNumber.activeForeground": "#949494",
1358
+ "editor.wordHighlightBackground": "#4747a180",
1359
+ "editor.wordHighlightStrongBackground": "#6767ce80",
1360
+ "editorCursor.foreground": "#c07020",
1361
+ "editorWhitespace.foreground": "#505037",
1362
+ "editorIndentGuide.background": "#505037",
1363
+ "editorIndentGuide.activeBackground": "#707057",
1364
+ "editorGroupHeader.tabsBackground": "#282828",
1365
+ "tab.inactiveBackground": "#404040",
1366
+ "tab.border": "#303030",
1367
+ "tab.inactiveForeground": "#d8d8d8",
1368
+ "tab.lastPinnedBorder": "#505050",
1369
+ "peekView.border": "#3655b5",
1370
+ "panelTitle.activeForeground": "#ffffff",
1371
+ "statusBar.background": "#505050",
1372
+ "statusBar.debuggingBackground": "#505050",
1373
+ "statusBar.noFolderBackground": "#505050",
1374
+ "titleBar.activeBackground": "#505050",
1375
+ "statusBarItem.remoteBackground": "#3655b5",
1376
+ "ports.iconRunningProcessForeground": "#CCCCCC",
1377
+ "activityBar.background": "#353535",
1378
+ "activityBar.foreground": "#ffffff",
1379
+ "activityBarBadge.background": "#3655b5",
1380
+ "sideBar.background": "#272727",
1381
+ "sideBarSectionHeader.background": "#505050",
1382
+ "menu.background": "#272727",
1383
+ "menu.foreground": "#CCCCCC",
1384
+ "pickerGroup.foreground": "#b0b0b0",
1385
+ "inputOption.activeBorder": "#3655b5",
1386
+ focusBorder: "#3655b5",
1387
+ "terminal.ansiBlack": "#1e1e1e",
1388
+ "terminal.ansiRed": "#C4265E",
1389
+ "terminal.ansiGreen": "#86B42B",
1390
+ "terminal.ansiYellow": "#B3B42B",
1391
+ "terminal.ansiBlue": "#6A7EC8",
1392
+ "terminal.ansiMagenta": "#8C6BC8",
1393
+ "terminal.ansiCyan": "#56ADBC",
1394
+ "terminal.ansiWhite": "#e3e3dd",
1395
+ "terminal.ansiBrightBlack": "#666666",
1396
+ "terminal.ansiBrightRed": "#f92672",
1397
+ "terminal.ansiBrightGreen": "#A6E22E",
1398
+ "terminal.ansiBrightYellow": "#e2e22e",
1399
+ "terminal.ansiBrightBlue": "#819aff",
1400
+ "terminal.ansiBrightMagenta": "#AE81FF",
1401
+ "terminal.ansiBrightCyan": "#66D9EF",
1402
+ "terminal.ansiBrightWhite": "#f8f8f2",
1403
+ "terminal.inactiveSelectionBackground": "#676b7140"
1404
+ },
1405
+ tokenColors: [
1406
+ { settings: { foreground: "#C5C8C6" } },
1407
+ {
1408
+ scope: [
1409
+ "meta.embedded",
1410
+ "source.groovy.embedded",
1411
+ "variable.legacy.builtin.python"
1412
+ ],
1413
+ settings: { foreground: "#C5C8C6" }
1414
+ },
1415
+ {
1416
+ name: "Comment",
1417
+ scope: "comment",
1418
+ settings: {
1419
+ fontStyle: "",
1420
+ foreground: "#9A9B99"
1421
+ }
1422
+ },
1423
+ {
1424
+ name: "String",
1425
+ scope: "string",
1426
+ settings: {
1427
+ fontStyle: "",
1428
+ foreground: "#9AA83A"
1429
+ }
1430
+ },
1431
+ {
1432
+ name: "String Embedded Source",
1433
+ scope: "string source",
1434
+ settings: {
1435
+ fontStyle: "",
1436
+ foreground: "#D08442"
1437
+ }
1438
+ },
1439
+ {
1440
+ name: "Number",
1441
+ scope: "constant.numeric",
1442
+ settings: {
1443
+ fontStyle: "",
1444
+ foreground: "#6089B4"
1445
+ }
1446
+ },
1447
+ {
1448
+ name: "Built-in constant",
1449
+ scope: "constant.language",
1450
+ settings: {
1451
+ fontStyle: "",
1452
+ foreground: "#408080"
1453
+ }
1454
+ },
1455
+ {
1456
+ name: "User-defined constant",
1457
+ scope: "constant.character, constant.other",
1458
+ settings: {
1459
+ fontStyle: "",
1460
+ foreground: "#8080FF"
1461
+ }
1462
+ },
1463
+ {
1464
+ name: "Keyword",
1465
+ scope: "keyword",
1466
+ settings: {
1467
+ fontStyle: "",
1468
+ foreground: "#6089B4"
1469
+ }
1470
+ },
1471
+ {
1472
+ name: "Support",
1473
+ scope: "support",
1474
+ settings: {
1475
+ fontStyle: "",
1476
+ foreground: "#C7444A"
1477
+ }
1478
+ },
1479
+ {
1480
+ name: "Storage",
1481
+ scope: "storage",
1482
+ settings: {
1483
+ fontStyle: "",
1484
+ foreground: "#9872A2"
1485
+ }
1486
+ },
1487
+ {
1488
+ name: "Class name",
1489
+ scope: "entity.name.class, entity.name.type, entity.name.namespace, entity.name.scope-resolution",
1490
+ settings: {
1491
+ fontStyle: "",
1492
+ foreground: "#9B0000"
1493
+ }
1494
+ },
1495
+ {
1496
+ name: "Inherited class",
1497
+ scope: "entity.other.inherited-class",
1498
+ settings: {
1499
+ fontStyle: "",
1500
+ foreground: "#C7444A"
1501
+ }
1502
+ },
1503
+ {
1504
+ name: "Function name",
1505
+ scope: "entity.name.function",
1506
+ settings: {
1507
+ fontStyle: "",
1508
+ foreground: "#CE6700"
1509
+ }
1510
+ },
1511
+ {
1512
+ name: "Function argument",
1513
+ scope: "variable.parameter",
1514
+ settings: {
1515
+ fontStyle: "",
1516
+ foreground: "#6089B4"
1517
+ }
1518
+ },
1519
+ {
1520
+ name: "Tag name",
1521
+ scope: "entity.name.tag",
1522
+ settings: {
1523
+ fontStyle: "",
1524
+ foreground: "#9872A2"
1525
+ }
1526
+ },
1527
+ {
1528
+ name: "Tag attribute",
1529
+ scope: "entity.other.attribute-name",
1530
+ settings: {
1531
+ fontStyle: "",
1532
+ foreground: "#9872A2"
1533
+ }
1534
+ },
1535
+ {
1536
+ name: "Library function",
1537
+ scope: "support.function",
1538
+ settings: {
1539
+ fontStyle: "",
1540
+ foreground: "#9872A2"
1541
+ }
1542
+ },
1543
+ {
1544
+ name: "Keyword",
1545
+ scope: "keyword",
1546
+ settings: {
1547
+ fontStyle: "",
1548
+ foreground: "#676867"
1549
+ }
1550
+ },
1551
+ {
1552
+ name: "Class Variable",
1553
+ scope: "variable.other, variable.js, punctuation.separator.variable",
1554
+ settings: {
1555
+ fontStyle: "",
1556
+ foreground: "#6089B4"
1557
+ }
1558
+ },
1559
+ {
1560
+ name: "Meta Brace",
1561
+ scope: "punctuation.section.embedded -(source string source punctuation.section.embedded), meta.brace.erb.html",
1562
+ settings: {
1563
+ fontStyle: "",
1564
+ foreground: "#008200"
1565
+ }
1566
+ },
1567
+ {
1568
+ name: "Invalid",
1569
+ scope: "invalid",
1570
+ settings: {
1571
+ fontStyle: "",
1572
+ foreground: "#FF0B00"
1573
+ }
1574
+ },
1575
+ {
1576
+ name: "Normal Variable",
1577
+ scope: "variable.other.php, variable.other.normal",
1578
+ settings: {
1579
+ fontStyle: "",
1580
+ foreground: "#6089B4"
1581
+ }
1582
+ },
1583
+ {
1584
+ name: "Function Object",
1585
+ scope: "meta.function-call.object",
1586
+ settings: {
1587
+ fontStyle: "",
1588
+ foreground: "#9872A2"
1589
+ }
1590
+ },
1591
+ {
1592
+ name: "Function Call Variable",
1593
+ scope: "variable.other.property",
1594
+ settings: {
1595
+ fontStyle: "",
1596
+ foreground: "#9872A2"
1597
+ }
1598
+ },
1599
+ {
1600
+ name: "Keyword Control / Special",
1601
+ scope: [
1602
+ "keyword.control",
1603
+ "keyword.operator.new.cpp",
1604
+ "keyword.operator.delete.cpp",
1605
+ "keyword.other.using",
1606
+ "keyword.other.directive.using",
1607
+ "keyword.other.operator"
1608
+ ],
1609
+ settings: {
1610
+ fontStyle: "",
1611
+ foreground: "#9872A2"
1612
+ }
1613
+ },
1614
+ {
1615
+ name: "Tag",
1616
+ scope: "meta.tag",
1617
+ settings: {
1618
+ fontStyle: "",
1619
+ foreground: "#D0B344"
1620
+ }
1621
+ },
1622
+ {
1623
+ name: "Tag Name",
1624
+ scope: "entity.name.tag",
1625
+ settings: {
1626
+ fontStyle: "",
1627
+ foreground: "#6089B4"
1628
+ }
1629
+ },
1630
+ {
1631
+ name: "Doctype",
1632
+ scope: "meta.doctype, meta.tag.sgml-declaration.doctype, meta.tag.sgml.doctype",
1633
+ settings: {
1634
+ fontStyle: "",
1635
+ foreground: "#9AA83A"
1636
+ }
1637
+ },
1638
+ {
1639
+ name: "Tag Inline Source",
1640
+ scope: "meta.tag.inline source, text.html.php.source",
1641
+ settings: {
1642
+ fontStyle: "",
1643
+ foreground: "#9AA83A"
1644
+ }
1645
+ },
1646
+ {
1647
+ name: "Tag Other",
1648
+ scope: "meta.tag.other, entity.name.tag.style, entity.name.tag.script, meta.tag.block.script, source.js.embedded punctuation.definition.tag.html, source.css.embedded punctuation.definition.tag.html",
1649
+ settings: {
1650
+ fontStyle: "",
1651
+ foreground: "#9872A2"
1652
+ }
1653
+ },
1654
+ {
1655
+ name: "Tag Attribute",
1656
+ scope: "entity.other.attribute-name, meta.tag punctuation.definition.string",
1657
+ settings: {
1658
+ fontStyle: "",
1659
+ foreground: "#D0B344"
1660
+ }
1661
+ },
1662
+ {
1663
+ name: "Tag Value",
1664
+ scope: "meta.tag string -source -punctuation, text source text meta.tag string -punctuation",
1665
+ settings: {
1666
+ fontStyle: "",
1667
+ foreground: "#6089B4"
1668
+ }
1669
+ },
1670
+ {
1671
+ name: "Meta Brace",
1672
+ scope: "punctuation.section.embedded -(source string source punctuation.section.embedded), meta.brace.erb.html",
1673
+ settings: {
1674
+ fontStyle: "",
1675
+ foreground: "#D0B344"
1676
+ }
1677
+ },
1678
+ {
1679
+ name: "HTML ID",
1680
+ scope: "meta.toc-list.id",
1681
+ settings: { foreground: "#9AA83A" }
1682
+ },
1683
+ {
1684
+ name: "HTML String",
1685
+ scope: "string.quoted.double.html, punctuation.definition.string.begin.html, punctuation.definition.string.end.html, punctuation.definition.string.end.html source, string.quoted.double.html source",
1686
+ settings: {
1687
+ fontStyle: "",
1688
+ foreground: "#9AA83A"
1689
+ }
1690
+ },
1691
+ {
1692
+ name: "HTML Tags",
1693
+ scope: "punctuation.definition.tag.html, punctuation.definition.tag.begin, punctuation.definition.tag.end",
1694
+ settings: {
1695
+ fontStyle: "",
1696
+ foreground: "#6089B4"
1697
+ }
1698
+ },
1699
+ {
1700
+ name: "CSS ID",
1701
+ scope: "meta.selector entity.other.attribute-name.id",
1702
+ settings: {
1703
+ fontStyle: "",
1704
+ foreground: "#9872A2"
1705
+ }
1706
+ },
1707
+ {
1708
+ name: "CSS Property Name",
1709
+ scope: "source.css support.type.property-name",
1710
+ settings: {
1711
+ fontStyle: "",
1712
+ foreground: "#676867"
1713
+ }
1714
+ },
1715
+ {
1716
+ name: "CSS Property Value",
1717
+ scope: "meta.property-group support.constant.property-value, meta.property-value support.constant.property-value",
1718
+ settings: {
1719
+ fontStyle: "",
1720
+ foreground: "#C7444A"
1721
+ }
1722
+ },
1723
+ {
1724
+ name: "JavaScript Variable",
1725
+ scope: "variable.language.js",
1726
+ settings: { foreground: "#CC555A" }
1727
+ },
1728
+ {
1729
+ name: "Template Definition",
1730
+ scope: ["punctuation.definition.template-expression", "punctuation.section.embedded.coffee"],
1731
+ settings: { foreground: "#D08442" }
1732
+ },
1733
+ {
1734
+ name: "Reset JavaScript string interpolation expression",
1735
+ scope: ["meta.template.expression"],
1736
+ settings: { foreground: "#C5C8C6" }
1737
+ },
1738
+ {
1739
+ name: "PHP Function Call",
1740
+ scope: "meta.function-call.object.php",
1741
+ settings: {
1742
+ fontStyle: "",
1743
+ foreground: "#D0B344"
1744
+ }
1745
+ },
1746
+ {
1747
+ name: "PHP Single Quote HMTL Fix",
1748
+ scope: "punctuation.definition.string.end.php, punctuation.definition.string.begin.php",
1749
+ settings: { foreground: "#9AA83A" }
1750
+ },
1751
+ {
1752
+ name: "PHP Parenthesis HMTL Fix",
1753
+ scope: "source.php.embedded.line.html",
1754
+ settings: { foreground: "#676867" }
1755
+ },
1756
+ {
1757
+ name: "PHP Punctuation Embedded",
1758
+ scope: "punctuation.section.embedded.begin.php, punctuation.section.embedded.end.php",
1759
+ settings: {
1760
+ fontStyle: "",
1761
+ foreground: "#D08442"
1762
+ }
1763
+ },
1764
+ {
1765
+ name: "Ruby Symbol",
1766
+ scope: "constant.other.symbol.ruby",
1767
+ settings: {
1768
+ fontStyle: "",
1769
+ foreground: "#9AA83A"
1770
+ }
1771
+ },
1772
+ {
1773
+ name: "Ruby Variable",
1774
+ scope: "variable.language.ruby",
1775
+ settings: {
1776
+ fontStyle: "",
1777
+ foreground: "#D0B344"
1778
+ }
1779
+ },
1780
+ {
1781
+ name: "Ruby Special Method",
1782
+ scope: "keyword.other.special-method.ruby",
1783
+ settings: {
1784
+ fontStyle: "",
1785
+ foreground: "#D9B700"
1786
+ }
1787
+ },
1788
+ {
1789
+ name: "Ruby Embedded Source",
1790
+ scope: ["punctuation.section.embedded.begin.ruby", "punctuation.section.embedded.end.ruby"],
1791
+ settings: { foreground: "#D08442" }
1792
+ },
1793
+ {
1794
+ name: "SQL",
1795
+ scope: "keyword.other.DML.sql",
1796
+ settings: {
1797
+ fontStyle: "",
1798
+ foreground: "#D0B344"
1799
+ }
1800
+ },
1801
+ {
1802
+ name: "diff: header",
1803
+ scope: "meta.diff, meta.diff.header",
1804
+ settings: {
1805
+ fontStyle: "italic",
1806
+ foreground: "#E0EDDD"
1807
+ }
1808
+ },
1809
+ {
1810
+ name: "diff: deleted",
1811
+ scope: "markup.deleted",
1812
+ settings: {
1813
+ fontStyle: "",
1814
+ foreground: "#dc322f"
1815
+ }
1816
+ },
1817
+ {
1818
+ name: "diff: changed",
1819
+ scope: "markup.changed",
1820
+ settings: {
1821
+ fontStyle: "",
1822
+ foreground: "#cb4b16"
1823
+ }
1824
+ },
1825
+ {
1826
+ name: "diff: inserted",
1827
+ scope: "markup.inserted",
1828
+ settings: { foreground: "#219186" }
1829
+ },
1830
+ {
1831
+ name: "Markup Quote",
1832
+ scope: "markup.quote",
1833
+ settings: { foreground: "#9872A2" }
1834
+ },
1835
+ {
1836
+ name: "Markup Lists",
1837
+ scope: "markup.list",
1838
+ settings: { foreground: "#9AA83A" }
1839
+ },
1840
+ {
1841
+ name: "Markup Styling",
1842
+ scope: "markup.bold, markup.italic",
1843
+ settings: { foreground: "#6089B4" }
1844
+ },
1845
+ {
1846
+ name: "Markup Inline",
1847
+ scope: "markup.inline.raw",
1848
+ settings: {
1849
+ fontStyle: "",
1850
+ foreground: "#FF0080"
1851
+ }
1852
+ },
1853
+ {
1854
+ name: "Markup Headings",
1855
+ scope: "markup.heading",
1856
+ settings: { foreground: "#D0B344" }
1857
+ },
1858
+ {
1859
+ name: "Markup Setext Header",
1860
+ scope: "markup.heading.setext",
1861
+ settings: {
1862
+ fontStyle: "",
1863
+ foreground: "#D0B344"
1864
+ }
1865
+ },
1866
+ {
1867
+ name: "Markdown Headings",
1868
+ scope: "markup.heading.markdown",
1869
+ settings: { fontStyle: "bold" }
1870
+ },
1871
+ {
1872
+ name: "Markdown Quote",
1873
+ scope: "markup.quote.markdown",
1874
+ settings: {
1875
+ fontStyle: "italic",
1876
+ foreground: ""
1877
+ }
1878
+ },
1879
+ {
1880
+ name: "Markdown Bold",
1881
+ scope: "markup.bold.markdown",
1882
+ settings: { fontStyle: "bold" }
1883
+ },
1884
+ {
1885
+ name: "Markdown Link Title/Description",
1886
+ scope: "string.other.link.title.markdown,string.other.link.description.markdown",
1887
+ settings: { foreground: "#AE81FF" }
1888
+ },
1889
+ {
1890
+ name: "Markdown Underline Link/Image",
1891
+ scope: "markup.underline.link.markdown,markup.underline.link.image.markdown",
1892
+ settings: { foreground: "" }
1893
+ },
1894
+ {
1895
+ name: "Markdown Emphasis",
1896
+ scope: "markup.italic.markdown",
1897
+ settings: { fontStyle: "italic" }
1898
+ },
1899
+ {
1900
+ scope: "markup.strikethrough",
1901
+ settings: { fontStyle: "strikethrough" }
1902
+ },
1903
+ {
1904
+ name: "Markdown Punctuation Definition Link",
1905
+ scope: "markup.list.unnumbered.markdown, markup.list.numbered.markdown",
1906
+ settings: { foreground: "" }
1907
+ },
1908
+ {
1909
+ name: "Markdown List Punctuation",
1910
+ scope: ["punctuation.definition.list.begin.markdown"],
1911
+ settings: { foreground: "" }
1912
+ },
1913
+ {
1914
+ scope: "token.info-token",
1915
+ settings: { foreground: "#6796e6" }
1916
+ },
1917
+ {
1918
+ scope: "token.warn-token",
1919
+ settings: { foreground: "#cd9731" }
1920
+ },
1921
+ {
1922
+ scope: "token.error-token",
1923
+ settings: { foreground: "#f44747" }
1924
+ },
1925
+ {
1926
+ scope: "token.debug-token",
1927
+ settings: { foreground: "#b267e6" }
1928
+ },
1929
+ {
1930
+ name: "this.self",
1931
+ scope: "variable.language",
1932
+ settings: { foreground: "#c7444a" }
1933
+ }
1934
+ ],
1935
+ semanticHighlighting: true
1936
+ };
1937
+ //#endregion
1938
+ //#region src/CodeHighlightProvider/adapters/shiki-adapter.ts
1939
+ function stripElement(openTag, data) {
1940
+ const openIndex = data.indexOf(`<${openTag}`);
1941
+ let closeIndex = openIndex + openTag.length;
1942
+ for (let i = openIndex; i < data.length; i += 1) if (data[i] === ">") {
1943
+ closeIndex = i;
1944
+ break;
1945
+ }
1946
+ return (data.slice(0, openIndex) + data.slice(closeIndex + 1)).replace(`</${openTag}>`, "");
1947
+ }
1948
+ function stripShikiCodeBlocks(data) {
1949
+ return stripElement("code", stripElement("pre", data));
1950
+ }
1951
+ var createShikiAdapter = (loadShiki, { forceColorScheme } = {}) => ({
1952
+ loadContext: loadShiki,
1953
+ getHighlighter: (ctx) => {
1954
+ if (!ctx) return ({ code }) => ({
1955
+ highlightedCode: code,
1956
+ isHighlighted: false
1957
+ });
1958
+ return ({ code, language, colorScheme }) => {
1959
+ let _colorScheme = colorScheme;
1960
+ if (colorScheme === "light") _colorScheme = light;
1961
+ else if (colorScheme === "dark") _colorScheme = dark;
1962
+ return {
1963
+ isHighlighted: true,
1964
+ highlightedCode: stripShikiCodeBlocks(ctx.codeToHtml(code, {
1965
+ lang: language,
1966
+ theme: forceColorScheme || _colorScheme
1967
+ }))
1968
+ };
1969
+ };
1970
+ }
1971
+ });
1972
+ //#endregion
1973
+ exports.CodeHighlight = CodeHighlight;
1974
+ exports.CodeHighlightAdapterProvider = CodeHighlightAdapterProvider;
1975
+ exports.CodeHighlightControl = CodeHighlightControl;
1976
+ exports.CodeHighlightTabs = CodeHighlightTabs;
1977
+ exports.InlineCodeHighlight = InlineCodeHighlight;
1978
+ exports.createHighlightJsAdapter = createHighlightJsAdapter;
1979
+ exports.createShikiAdapter = createShikiAdapter;
1980
+ exports.plainTextAdapter = plainTextAdapter;
1981
+ exports.stripShikiCodeBlocks = stripShikiCodeBlocks;
1982
+ exports.useCodeHighlightContext = useCodeHighlightContext;
1983
+ exports.useHighlight = useHighlight;
1984
+
1985
+ //# sourceMappingURL=index.cjs.map