@mantine-vue/code-highlight 3.0.0 → 3.1.0

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 (32) hide show
  1. package/cjs/index.cjs +511 -576
  2. package/cjs/index.cjs.map +1 -1
  3. package/esm/index.mjs +511 -576
  4. package/esm/index.mjs.map +1 -1
  5. package/lib/CodeHighlight/CodeHighlight.d.ts +46 -496
  6. package/lib/CodeHighlight/CodeHighlight.types.d.ts +80 -0
  7. package/lib/CodeHighlight/CodeHighlight.vue.d.ts +17 -0
  8. package/lib/CodeHighlight/CodeHighlightControl/CodeHighlightControl.d.ts +2 -68
  9. package/lib/CodeHighlight/CodeHighlightControl/CodeHighlightControl.types.d.ts +20 -0
  10. package/lib/CodeHighlight/CodeHighlightControl/CodeHighlightControl.vue.d.ts +15 -0
  11. package/lib/CodeHighlight/CopyCodeButton/CopyCodeButton.d.ts +1 -32
  12. package/lib/CodeHighlight/CopyCodeButton/CopyCodeButton.vue.d.ts +8 -0
  13. package/lib/CodeHighlight/CopyCodeButton/CopyIcon.d.ts +1 -13
  14. package/lib/CodeHighlight/CopyCodeButton/CopyIcon.vue.d.ts +6 -0
  15. package/lib/CodeHighlight/ExpandCodeButton/ExpandCodeButton.d.ts +1 -41
  16. package/lib/CodeHighlight/ExpandCodeButton/ExpandCodeButton.vue.d.ts +15 -0
  17. package/lib/CodeHighlight/ExpandCodeButton/ExpandIcon.d.ts +1 -13
  18. package/lib/CodeHighlight/ExpandCodeButton/ExpandIcon.vue.d.ts +6 -0
  19. package/lib/CodeHighlight/InlineCodeHighlight.d.ts +16 -107
  20. package/lib/CodeHighlight/InlineCodeHighlight.types.d.ts +30 -0
  21. package/lib/CodeHighlight/InlineCodeHighlight.vue.d.ts +5 -0
  22. package/lib/CodeHighlightProvider/CodeHighlightAdapterProvider.vue.d.ts +14 -0
  23. package/lib/CodeHighlightProvider/CodeHighlightProvider.d.ts +19 -32
  24. package/lib/CodeHighlightProvider/CodeHighlightProvider.types.d.ts +25 -0
  25. package/lib/CodeHighlightTabs/CodeHighlightTabs.d.ts +43 -262
  26. package/lib/CodeHighlightTabs/CodeHighlightTabs.types.d.ts +47 -0
  27. package/lib/CodeHighlightTabs/CodeHighlightTabs.vue.d.ts +21 -0
  28. package/lib/CodeHighlightTabs/FileIcon.d.ts +1 -40
  29. package/lib/CodeHighlightTabs/FileIcon.vue.d.ts +21 -0
  30. package/lib/index.d.mts +3 -3
  31. package/lib/index.d.ts +3 -3
  32. package/package.json +3 -3
@@ -1,509 +1,59 @@
1
- import { type PropType, type SlotsType, type VNodeChild } from 'vue';
2
- import { type CodeHighlightAdapter } from '../CodeHighlightProvider/CodeHighlightProvider';
3
- import { type CodeHighlightContextValue } from './CodeHighlight.context';
4
- import { type CodeHighlightControlProps } from './CodeHighlightControl/CodeHighlightControl';
5
- export type CodeHighlightStylesNames = 'codeHighlight' | 'pre' | 'code' | 'control' | 'controlTooltip' | 'controls' | 'scrollarea' | 'showCodeButton' | 'lineNumbers' | 'codeWrapper';
6
- export type CodeHighlightCssVariables = {
7
- codeHighlight: '--ch-max-height' | '--ch-background' | '--ch-radius';
8
- };
9
- export interface CodeHighlightSettings {
10
- copyLabel?: string;
11
- copiedLabel?: string;
12
- defaultExpanded?: boolean;
13
- expanded?: boolean;
14
- onExpandedChange?: (expanded: boolean) => void;
15
- maxCollapsedHeight?: number | string;
16
- withCopyButton?: boolean;
17
- withExpandButton?: boolean;
18
- expandCodeLabel?: string;
19
- collapseCodeLabel?: string;
20
- background?: string;
21
- radius?: string | number;
22
- withBorder?: boolean;
23
- withLineNumbers?: boolean;
24
- controls?: VNodeChild[] | (() => VNodeChild);
25
- codeColorScheme?: 'dark' | 'light' | (string & {});
26
- }
27
- export interface CodeHighlightProps extends CodeHighlightSettings {
28
- __withOffset?: boolean;
29
- __staticSelector?: string;
30
- __inline?: boolean;
31
- code: string;
32
- language?: string;
33
- classNames?: any;
34
- styles?: any;
35
- vars?: any;
36
- unstyled?: boolean;
37
- class?: any;
38
- style?: any;
39
- [key: string]: any;
40
- }
41
- export interface CodeHighlightFactory {
42
- props: CodeHighlightProps;
43
- stylesNames: CodeHighlightStylesNames;
44
- vars: CodeHighlightCssVariables;
45
- }
46
- export interface CodeHighlightSlots {
47
- controls?: () => VNodeChild;
48
- }
49
1
  export declare const CodeHighlight: {
50
- new (...args: any[]): import("vue").CreateComponentPublicInstanceWithMixins<Readonly<import("vue").ExtractPropTypes<{
51
- code: {
52
- type: StringConstructor;
53
- required: true;
54
- };
55
- language: {
56
- type: StringConstructor;
57
- default: undefined;
58
- };
59
- copyLabel: {
60
- type: StringConstructor;
61
- default: undefined;
62
- };
63
- copiedLabel: {
64
- type: StringConstructor;
65
- default: undefined;
66
- };
67
- defaultExpanded: {
68
- type: BooleanConstructor;
69
- default: undefined;
70
- };
71
- expanded: {
72
- type: BooleanConstructor;
73
- default: undefined;
74
- };
75
- onExpandedChange: {
76
- type: PropType<(expanded: boolean) => void>;
77
- default: undefined;
78
- };
79
- maxCollapsedHeight: {
80
- type: PropType<string | number>;
81
- default: undefined;
82
- };
83
- withCopyButton: {
84
- type: BooleanConstructor;
85
- default: undefined;
86
- };
87
- withExpandButton: {
88
- type: BooleanConstructor;
89
- default: boolean;
90
- };
91
- expandCodeLabel: {
92
- type: StringConstructor;
93
- default: undefined;
94
- };
95
- collapseCodeLabel: {
96
- type: StringConstructor;
97
- default: undefined;
98
- };
99
- background: {
100
- type: StringConstructor;
101
- default: undefined;
102
- };
103
- radius: {
104
- type: PropType<string | number>;
105
- default: undefined;
106
- };
107
- withBorder: {
108
- type: BooleanConstructor;
109
- default: boolean;
110
- };
111
- withLineNumbers: {
112
- type: BooleanConstructor;
113
- default: boolean;
114
- };
115
- controls: {
116
- type: PropType<CodeHighlightSettings["controls"]>;
117
- default: undefined;
118
- };
119
- codeColorScheme: {
120
- type: PropType<CodeHighlightSettings["codeColorScheme"]>;
121
- default: undefined;
122
- };
123
- __withOffset: {
124
- type: BooleanConstructor;
125
- default: boolean;
126
- };
127
- __staticSelector: {
128
- type: StringConstructor;
129
- default: undefined;
130
- };
131
- __inline: {
132
- type: BooleanConstructor;
133
- default: boolean;
134
- };
135
- classNames: {
136
- type: (ObjectConstructor | FunctionConstructor)[];
137
- default: undefined;
138
- };
139
- styles: {
140
- type: (ObjectConstructor | FunctionConstructor)[];
141
- default: undefined;
142
- };
143
- vars: {
144
- type: (ObjectConstructor | FunctionConstructor)[];
145
- default: undefined;
146
- };
147
- unstyled: {
148
- type: BooleanConstructor;
149
- default: boolean;
150
- };
151
- }>> & Readonly<{}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
152
- [key: string]: any;
153
- }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, import("vue").PublicProps, {
154
- radius: string | number;
155
- classNames: Function | Record<string, any>;
156
- styles: Function | Record<string, any>;
157
- expanded: boolean;
158
- background: string;
159
- vars: Function | Record<string, any>;
160
- unstyled: boolean;
161
- __staticSelector: string;
162
- withBorder: boolean;
163
- defaultExpanded: boolean;
164
- onExpandedChange: (expanded: boolean) => void;
165
- controls: VNodeChild[] | (() => VNodeChild) | undefined;
166
- copiedLabel: string;
167
- copyLabel: string;
168
- collapseCodeLabel: string;
169
- expandCodeLabel: string;
170
- __withOffset: boolean;
171
- __inline: boolean;
172
- language: string;
173
- maxCollapsedHeight: string | number;
174
- withCopyButton: boolean;
175
- withExpandButton: boolean;
176
- withLineNumbers: boolean;
177
- codeColorScheme: "light" | "dark" | (string & {}) | undefined;
178
- }, true, {}, SlotsType<CodeHighlightSlots>, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
2
+ new (...args: any[]): import("vue").CreateComponentPublicInstanceWithMixins<Readonly<{}> & Readonly<{
3
+ "onUpdate:expanded"?: ((expanded: boolean) => any) | undefined;
4
+ "onExpanded-change"?: ((expanded: boolean) => any) | undefined;
5
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
6
+ "update:expanded": (expanded: boolean) => any;
7
+ "expanded-change": (expanded: boolean) => any;
8
+ }, import("vue").PublicProps, {}, false, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
179
9
  P: {};
180
10
  B: {};
181
11
  D: {};
182
12
  C: {};
183
13
  M: {};
184
14
  Defaults: {};
185
- }, Readonly<import("vue").ExtractPropTypes<{
186
- code: {
187
- type: StringConstructor;
188
- required: true;
189
- };
190
- language: {
191
- type: StringConstructor;
192
- default: undefined;
193
- };
194
- copyLabel: {
195
- type: StringConstructor;
196
- default: undefined;
197
- };
198
- copiedLabel: {
199
- type: StringConstructor;
200
- default: undefined;
201
- };
202
- defaultExpanded: {
203
- type: BooleanConstructor;
204
- default: undefined;
205
- };
206
- expanded: {
207
- type: BooleanConstructor;
208
- default: undefined;
209
- };
210
- onExpandedChange: {
211
- type: PropType<(expanded: boolean) => void>;
212
- default: undefined;
213
- };
214
- maxCollapsedHeight: {
215
- type: PropType<string | number>;
216
- default: undefined;
217
- };
218
- withCopyButton: {
219
- type: BooleanConstructor;
220
- default: undefined;
221
- };
222
- withExpandButton: {
223
- type: BooleanConstructor;
224
- default: boolean;
225
- };
226
- expandCodeLabel: {
227
- type: StringConstructor;
228
- default: undefined;
229
- };
230
- collapseCodeLabel: {
231
- type: StringConstructor;
232
- default: undefined;
233
- };
234
- background: {
235
- type: StringConstructor;
236
- default: undefined;
237
- };
238
- radius: {
239
- type: PropType<string | number>;
240
- default: undefined;
241
- };
242
- withBorder: {
243
- type: BooleanConstructor;
244
- default: boolean;
245
- };
246
- withLineNumbers: {
247
- type: BooleanConstructor;
248
- default: boolean;
249
- };
250
- controls: {
251
- type: PropType<CodeHighlightSettings["controls"]>;
252
- default: undefined;
253
- };
254
- codeColorScheme: {
255
- type: PropType<CodeHighlightSettings["codeColorScheme"]>;
256
- default: undefined;
257
- };
258
- __withOffset: {
259
- type: BooleanConstructor;
260
- default: boolean;
261
- };
262
- __staticSelector: {
263
- type: StringConstructor;
264
- default: undefined;
265
- };
266
- __inline: {
267
- type: BooleanConstructor;
268
- default: boolean;
269
- };
270
- classNames: {
271
- type: (ObjectConstructor | FunctionConstructor)[];
272
- default: undefined;
273
- };
274
- styles: {
275
- type: (ObjectConstructor | FunctionConstructor)[];
276
- default: undefined;
277
- };
278
- vars: {
279
- type: (ObjectConstructor | FunctionConstructor)[];
280
- default: undefined;
281
- };
282
- unstyled: {
283
- type: BooleanConstructor;
284
- default: boolean;
285
- };
286
- }>> & Readonly<{}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
287
- [key: string]: any;
288
- }>, {}, {}, {}, {
289
- radius: string | number;
290
- classNames: Function | Record<string, any>;
291
- styles: Function | Record<string, any>;
292
- expanded: boolean;
293
- background: string;
294
- vars: Function | Record<string, any>;
295
- unstyled: boolean;
296
- __staticSelector: string;
297
- withBorder: boolean;
298
- defaultExpanded: boolean;
299
- onExpandedChange: (expanded: boolean) => void;
300
- controls: VNodeChild[] | (() => VNodeChild) | undefined;
301
- copiedLabel: string;
302
- copyLabel: string;
303
- collapseCodeLabel: string;
304
- expandCodeLabel: string;
305
- __withOffset: boolean;
306
- __inline: boolean;
307
- language: string;
308
- maxCollapsedHeight: string | number;
309
- withCopyButton: boolean;
310
- withExpandButton: boolean;
311
- withLineNumbers: boolean;
312
- codeColorScheme: "light" | "dark" | (string & {}) | undefined;
313
- }>;
15
+ }, Readonly<{}> & Readonly<{
16
+ "onUpdate:expanded"?: ((expanded: boolean) => any) | undefined;
17
+ "onExpanded-change"?: ((expanded: boolean) => any) | undefined;
18
+ }>, {}, {}, {}, {}, {}>;
314
19
  __isFragment?: never;
315
20
  __isTeleport?: never;
316
21
  __isSuspense?: never;
317
- } & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
318
- code: {
319
- type: StringConstructor;
320
- required: true;
321
- };
322
- language: {
323
- type: StringConstructor;
324
- default: undefined;
325
- };
326
- copyLabel: {
327
- type: StringConstructor;
328
- default: undefined;
329
- };
330
- copiedLabel: {
331
- type: StringConstructor;
332
- default: undefined;
333
- };
334
- defaultExpanded: {
335
- type: BooleanConstructor;
336
- default: undefined;
337
- };
338
- expanded: {
339
- type: BooleanConstructor;
340
- default: undefined;
341
- };
342
- onExpandedChange: {
343
- type: PropType<(expanded: boolean) => void>;
344
- default: undefined;
345
- };
346
- maxCollapsedHeight: {
347
- type: PropType<string | number>;
348
- default: undefined;
349
- };
350
- withCopyButton: {
351
- type: BooleanConstructor;
352
- default: undefined;
353
- };
354
- withExpandButton: {
355
- type: BooleanConstructor;
356
- default: boolean;
357
- };
358
- expandCodeLabel: {
359
- type: StringConstructor;
360
- default: undefined;
361
- };
362
- collapseCodeLabel: {
363
- type: StringConstructor;
364
- default: undefined;
365
- };
366
- background: {
367
- type: StringConstructor;
368
- default: undefined;
369
- };
370
- radius: {
371
- type: PropType<string | number>;
372
- default: undefined;
373
- };
374
- withBorder: {
375
- type: BooleanConstructor;
376
- default: boolean;
377
- };
378
- withLineNumbers: {
379
- type: BooleanConstructor;
380
- default: boolean;
381
- };
382
- controls: {
383
- type: PropType<CodeHighlightSettings["controls"]>;
384
- default: undefined;
385
- };
386
- codeColorScheme: {
387
- type: PropType<CodeHighlightSettings["codeColorScheme"]>;
388
- default: undefined;
389
- };
390
- __withOffset: {
391
- type: BooleanConstructor;
392
- default: boolean;
393
- };
394
- __staticSelector: {
395
- type: StringConstructor;
396
- default: undefined;
397
- };
398
- __inline: {
399
- type: BooleanConstructor;
400
- default: boolean;
401
- };
402
- classNames: {
403
- type: (ObjectConstructor | FunctionConstructor)[];
404
- default: undefined;
405
- };
406
- styles: {
407
- type: (ObjectConstructor | FunctionConstructor)[];
408
- default: undefined;
409
- };
410
- vars: {
411
- type: (ObjectConstructor | FunctionConstructor)[];
412
- default: undefined;
413
- };
414
- unstyled: {
415
- type: BooleanConstructor;
416
- default: boolean;
417
- };
418
- }>> & Readonly<{}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
419
- [key: string]: any;
420
- }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {
421
- radius: string | number;
422
- classNames: Function | Record<string, any>;
423
- styles: Function | Record<string, any>;
424
- expanded: boolean;
425
- background: string;
426
- vars: Function | Record<string, any>;
427
- unstyled: boolean;
428
- __staticSelector: string;
429
- withBorder: boolean;
430
- defaultExpanded: boolean;
431
- onExpandedChange: (expanded: boolean) => void;
432
- controls: VNodeChild[] | (() => VNodeChild) | undefined;
433
- copiedLabel: string;
434
- copyLabel: string;
435
- collapseCodeLabel: string;
436
- expandCodeLabel: string;
437
- __withOffset: boolean;
438
- __inline: boolean;
439
- language: string;
440
- maxCollapsedHeight: string | number;
441
- withCopyButton: boolean;
442
- withExpandButton: boolean;
443
- withLineNumbers: boolean;
444
- codeColorScheme: "light" | "dark" | (string & {}) | undefined;
445
- }, {}, string, SlotsType<CodeHighlightSlots>, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & {
22
+ } & import("vue").ComponentOptionsBase<Readonly<{}> & Readonly<{
23
+ "onUpdate:expanded"?: ((expanded: boolean) => any) | undefined;
24
+ "onExpanded-change"?: ((expanded: boolean) => any) | undefined;
25
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
26
+ "update:expanded": (expanded: boolean) => any;
27
+ "expanded-change": (expanded: boolean) => any;
28
+ }, string, {}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
29
+ $slots: import("./CodeHighlight.types").CodeHighlightSlots;
30
+ }) & {
446
31
  classes: Record<string, string>;
447
32
  varsResolver: (theme: import("@mantine-vue/core").MantineTheme, props: any, ctx: Record<string, any>) => Record<string, Record<string, string | undefined>>;
448
- Control: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
449
- tooltipLabel: {
450
- type: StringConstructor;
451
- default: undefined;
452
- };
453
- classNames: {
454
- type: (ObjectConstructor | FunctionConstructor)[];
455
- default: undefined;
456
- };
457
- styles: {
458
- type: (ObjectConstructor | FunctionConstructor)[];
459
- default: undefined;
460
- };
461
- vars: {
462
- type: (ObjectConstructor | FunctionConstructor)[];
463
- default: undefined;
464
- };
465
- component: {
466
- type: StringConstructor;
467
- default: string;
468
- };
469
- onClick: {
470
- type: PropType<(event: MouseEvent) => void>;
471
- default: undefined;
472
- };
473
- }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
474
- [key: string]: any;
475
- }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
476
- tooltipLabel: {
477
- type: StringConstructor;
478
- default: undefined;
479
- };
480
- classNames: {
481
- type: (ObjectConstructor | FunctionConstructor)[];
482
- default: undefined;
483
- };
484
- styles: {
485
- type: (ObjectConstructor | FunctionConstructor)[];
486
- default: undefined;
487
- };
488
- vars: {
489
- type: (ObjectConstructor | FunctionConstructor)[];
490
- default: undefined;
491
- };
492
- component: {
493
- type: StringConstructor;
494
- default: string;
495
- };
496
- onClick: {
497
- type: PropType<(event: MouseEvent) => void>;
498
- default: undefined;
499
- };
500
- }>> & Readonly<{}>, {
501
- onClick: (event: MouseEvent) => void;
502
- classNames: Function | Record<string, any>;
503
- styles: Function | Record<string, any>;
504
- component: string;
505
- vars: Function | Record<string, any>;
506
- tooltipLabel: string;
507
- }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
33
+ Control: {
34
+ new (...args: any[]): import("vue").CreateComponentPublicInstanceWithMixins<Readonly<{}> & Readonly<{
35
+ onClick?: ((event: MouseEvent) => any) | undefined;
36
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
37
+ click: (event: MouseEvent) => any;
38
+ }, import("vue").PublicProps, {}, false, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
39
+ P: {};
40
+ B: {};
41
+ D: {};
42
+ C: {};
43
+ M: {};
44
+ Defaults: {};
45
+ }, Readonly<{}> & Readonly<{
46
+ onClick?: ((event: MouseEvent) => any) | undefined;
47
+ }>, {}, {}, {}, {}, {}>;
48
+ __isFragment?: never;
49
+ __isTeleport?: never;
50
+ __isSuspense?: never;
51
+ } & import("vue").ComponentOptionsBase<Readonly<{}> & Readonly<{
52
+ onClick?: ((event: MouseEvent) => any) | undefined;
53
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
54
+ click: (event: MouseEvent) => any;
55
+ }, string, {}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
56
+ $slots: import("./CodeHighlightControl/CodeHighlightControl.types.js").CodeHighlightControlSlots;
57
+ });
508
58
  };
509
- export type { CodeHighlightAdapter, CodeHighlightContextValue, CodeHighlightControlProps };
59
+ export type * from './CodeHighlight.types';
@@ -0,0 +1,80 @@
1
+ import type { VNodeChild } from 'vue';
2
+ import type { CodeHighlightAdapter } from '../CodeHighlightProvider/CodeHighlightProvider';
3
+ import type { CodeHighlightContextValue } from './CodeHighlight.context';
4
+ import type { CodeHighlightControlProps } from './CodeHighlightControl/CodeHighlightControl.types';
5
+ export type CodeHighlightStylesNames = 'codeHighlight' | 'pre' | 'code' | 'control' | 'controlTooltip' | 'controls' | 'scrollarea' | 'showCodeButton' | 'lineNumbers' | 'codeWrapper';
6
+ export type CodeHighlightCssVariables = {
7
+ codeHighlight: '--ch-max-height' | '--ch-background' | '--ch-radius';
8
+ };
9
+ export interface CodeHighlightSettings {
10
+ /** Label for copy button in default state. @default 'Copy' */
11
+ copyLabel?: string;
12
+ /** Label for copy button in copied state. @default 'Copied' */
13
+ copiedLabel?: string;
14
+ /** Uncontrolled expanded default state. */
15
+ defaultExpanded?: boolean;
16
+ /** Controlled expanded state. */
17
+ expanded?: boolean;
18
+ /** Max height of collapsed state. @default 180px */
19
+ maxCollapsedHeight?: number | string;
20
+ /** Determines whether the copy button should be displayed. @default true */
21
+ withCopyButton?: boolean;
22
+ /** Determines whether the expand/collapse button should be displayed. @default false */
23
+ withExpandButton?: boolean;
24
+ /** Label for expand button. @default 'Expand code' */
25
+ expandCodeLabel?: string;
26
+ /** Label for collapse button. @default 'Collapse code' */
27
+ collapseCodeLabel?: string;
28
+ /** Controls background color of the code. By default, the value depends on color scheme. */
29
+ background?: string;
30
+ /** Key of `theme.radius` or any valid CSS value to set border-radius. @default 0 */
31
+ radius?: string | number;
32
+ /** Adds border to the root element. @default false */
33
+ withBorder?: boolean;
34
+ /** Determines whether line numbers should be displayed. @default false */
35
+ withLineNumbers?: boolean;
36
+ /** Extra controls to display in the controls list. */
37
+ controls?: VNodeChild[] | (() => VNodeChild);
38
+ /** Set to use dark or light color scheme. When using shiki adapter, you can use loaded themes here. */
39
+ codeColorScheme?: 'dark' | 'light' | (string & {});
40
+ }
41
+ export interface CodeHighlightProps extends CodeHighlightSettings {
42
+ __withOffset?: boolean;
43
+ __staticSelector?: string;
44
+ /** If set, the code will be rendered as inline element without `<pre>`. @default false */
45
+ __inline?: boolean;
46
+ /** Code to highlight. */
47
+ code: string;
48
+ /** Language of the code, used for syntax highlighting. */
49
+ language?: string;
50
+ /** CSS classes applied to component elements. */
51
+ classNames?: any;
52
+ /** Inline styles applied to component elements. */
53
+ styles?: any;
54
+ /** CSS variables applied to component elements. */
55
+ vars?: any;
56
+ /** If set, all Mantine classes are removed from component elements. @default false */
57
+ unstyled?: boolean;
58
+ class?: any;
59
+ style?: any;
60
+ [key: string]: any;
61
+ }
62
+ export interface CodeHighlightFactory {
63
+ props: CodeHighlightProps;
64
+ stylesNames: CodeHighlightStylesNames;
65
+ vars: CodeHighlightCssVariables;
66
+ }
67
+ /** Events emitted when the expanded state changes. */
68
+ export interface CodeHighlightExpandEmits {
69
+ /** Emitted when the expanded state changes. */
70
+ 'update:expanded': [expanded: boolean];
71
+ /** Emitted when the expanded state changes. */
72
+ 'expanded-change': [expanded: boolean];
73
+ }
74
+ /** Events emitted by `CodeHighlight`. */
75
+ export type CodeHighlightEmits = CodeHighlightExpandEmits;
76
+ export interface CodeHighlightSlots {
77
+ /** Custom controls rendered before built-in controls. */
78
+ controls?: () => VNodeChild;
79
+ }
80
+ export type { CodeHighlightAdapter, CodeHighlightContextValue, CodeHighlightControlProps };
@@ -0,0 +1,17 @@
1
+ import type { CodeHighlightSlots } from './CodeHighlight.types';
2
+ declare const varsResolver: (theme: import("@mantine-vue/core").MantineTheme, props: any, ctx: Record<string, any>) => Record<string, Record<string, string | undefined>>;
3
+ export { varsResolver };
4
+ declare const _default: typeof __VLS_export;
5
+ export default _default;
6
+ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
7
+ "update:expanded": (expanded: boolean) => any;
8
+ "expanded-change": (expanded: boolean) => any;
9
+ }, string, import("vue").PublicProps, Readonly<{}> & Readonly<{
10
+ "onUpdate:expanded"?: ((expanded: boolean) => any) | undefined;
11
+ "onExpanded-change"?: ((expanded: boolean) => any) | undefined;
12
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, CodeHighlightSlots>;
13
+ type __VLS_WithSlots<T, S> = T & {
14
+ new (): {
15
+ $slots: S;
16
+ };
17
+ };