@feugene/granularity 0.40.0 → 0.42.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.
- package/LICENSE +13 -162
- package/README.md +6 -5
- package/dist/chunks/{config-BRESvs9g.js → config-Ca8qr8Q3.js} +1 -1
- package/dist/chunks/{config-BRESvs9g.js.map → config-Ca8qr8Q3.js.map} +1 -1
- package/dist/chunks/{en-NpP9e7lC.js → en-B9E3jO6m.js} +5 -7
- package/dist/chunks/{en-NpP9e7lC.js.map → en-B9E3jO6m.js.map} +1 -1
- package/dist/chunks/{es-Do2CNrC2.js → es-DCkqHTlU.js} +3 -3
- package/dist/chunks/{es-Do2CNrC2.js.map → es-DCkqHTlU.js.map} +1 -1
- package/dist/chunks/{es-DaeA2Ql-.js → es-QpzdIEut.js} +5 -7
- package/dist/chunks/{es-DaeA2Ql-.js.map → es-QpzdIEut.js.map} +1 -1
- package/dist/chunks/{generated-BcfXQY4j.js → generated-B95IBXs6.js} +0 -56
- package/dist/chunks/{generated-BcfXQY4j.js.map → generated-B95IBXs6.js.map} +1 -1
- package/dist/chunks/{grKbdStyles-DENu8pUK.js → grKbdStyles-ByMsX-lQ.js} +17 -2
- package/dist/chunks/grKbdStyles-ByMsX-lQ.js.map +1 -0
- package/dist/chunks/{granular-provider-vVZ-76bP.js → granular-provider-BG_2XqkS.js} +1 -3
- package/dist/chunks/granular-provider-BG_2XqkS.js.map +1 -0
- package/dist/chunks/{ru-Bg9-DPmg.js → ru-D_1Ya489.js} +5 -7
- package/dist/chunks/{ru-Bg9-DPmg.js.map → ru-D_1Ya489.js.map} +1 -1
- package/dist/components/GrBreadcrumbs/chunks/{GrBreadcrumbs-DOpwY2EF.js → GrBreadcrumbs-D0qPry_R.js} +4 -1
- package/dist/components/GrBreadcrumbs/chunks/GrBreadcrumbs-D0qPry_R.js.map +1 -0
- package/dist/components/GrBreadcrumbs/index.js +1 -1
- package/dist/components/GrCommandPalette/chunks/{GrCommandPalette-CnzPuoIM.js → GrCommandPalette-Ha4s3DMT.js} +1 -1
- package/dist/components/GrCommandPalette/chunks/{GrCommandPalette-CnzPuoIM.js.map → GrCommandPalette-Ha4s3DMT.js.map} +1 -1
- package/dist/components/GrCommandPalette/index.js +1 -1
- package/dist/components/GrDataTable/chunks/{GrDataTable-BYYG_XZA.js → GrDataTable-BBe7-uUe.js} +6 -2
- package/dist/components/GrDataTable/chunks/GrDataTable-BBe7-uUe.js.map +1 -0
- package/dist/components/GrDataTable/index.js +1 -1
- package/dist/components/GrDelta/chunks/{GrDelta-BpfqebEV.js → GrDelta-CgTvfoIN.js} +0 -0
- package/dist/components/GrDelta/chunks/GrDelta-CgTvfoIN.js.map +1 -0
- package/dist/components/GrDelta/index.js +1 -1
- package/dist/components/GrDescriptionList/chunks/{GrDescriptionList-D8ANFpn_.js → GrDescriptionList-Dz2Jj1if.js} +26 -11
- package/dist/components/GrDescriptionList/chunks/GrDescriptionList-Dz2Jj1if.js.map +1 -0
- package/dist/components/GrDescriptionList/index.js +1 -1
- package/dist/components/GrFilePreview/chunks/{GrFilePreview-PabkLgYX.js → GrFilePreview-2kVOg1C7.js} +40 -5
- package/dist/components/GrFilePreview/chunks/GrFilePreview-2kVOg1C7.js.map +1 -0
- package/dist/components/GrFilePreview/index.js +1 -1
- package/dist/components/GrImageViewer/chunks/{GrImageViewer-BV38WM3x.js.map → GrImageViewer-Dd2gJ-j_.js.map} +1 -1
- package/dist/components/GrImageViewer/index.js +1 -1
- package/dist/components/GrInputTag/chunks/{GrInputTag-DhfUNOA5.js → GrInputTag-BKzm1PKw.js} +5 -2
- package/dist/components/GrInputTag/chunks/GrInputTag-BKzm1PKw.js.map +1 -0
- package/dist/components/GrInputTag/index.js +1 -1
- package/dist/components/GrJsonViewer/chunks/{GrJsonViewer-CdtmUpZ3.js → GrJsonViewer-BLCEWlwg.js} +62 -10
- package/dist/components/GrJsonViewer/chunks/GrJsonViewer-BLCEWlwg.js.map +1 -0
- package/dist/components/GrJsonViewer/index.js +1 -1
- package/dist/components/GrKbd/chunks/{GrKbd-D_a1mPLe.js → GrKbd-BNMeoaLV.js} +1 -1
- package/dist/components/GrKbd/chunks/{GrKbd-D_a1mPLe.js.map → GrKbd-BNMeoaLV.js.map} +1 -1
- package/dist/components/GrKbd/index.js +2 -2
- package/dist/components/GrNumberInput/chunks/{GrNumberInput-BqPydXpK.js → GrNumberInput-Bm-V59TG.js} +4 -1
- package/dist/components/GrNumberInput/chunks/GrNumberInput-Bm-V59TG.js.map +1 -0
- package/dist/components/GrNumberInput/index.js +1 -1
- package/dist/components/GrSegmented/chunks/{GrSegmented-NKTi9bMG.js → GrSegmented-CuDaKA6S.js} +5 -1
- package/dist/components/GrSegmented/chunks/GrSegmented-CuDaKA6S.js.map +1 -0
- package/dist/components/GrSegmented/index.js +1 -1
- package/dist/components/GrSortableList/chunks/{GrSortableList-CQCaWivn.js → GrSortableList-ce1psLL0.js} +4 -1
- package/dist/components/GrSortableList/chunks/GrSortableList-ce1psLL0.js.map +1 -0
- package/dist/components/GrSortableList/index.js +1 -1
- package/dist/components/GrSteps/chunks/{GrSteps-DXj7m-WO.js → GrSteps-Cng-Wrjk.js} +5 -1
- package/dist/components/GrSteps/chunks/GrSteps-Cng-Wrjk.js.map +1 -0
- package/dist/components/GrSteps/index.js +1 -1
- package/dist/components/GrTabs/chunks/{GrTabs-DHfv67cp.js → GrTabs-BArefUFv.js} +5 -1
- package/dist/components/GrTabs/chunks/GrTabs-BArefUFv.js.map +1 -0
- package/dist/components/GrTabs/index.js +1 -1
- package/dist/components/GrTree/chunks/{GrTree-CkELQwR8.js.map → GrTree-BFWFc0Bm.js.map} +1 -1
- package/dist/components/GrTree/index.js +1 -1
- package/dist/components/GrTreeSelect/chunks/{GrTreeSelect-BTb8e1az.js → GrTreeSelect-DJa2lYGe.js} +1 -1
- package/dist/components/GrTreeSelect/chunks/{GrTreeSelect-BTb8e1az.js.map → GrTreeSelect-DJa2lYGe.js.map} +1 -1
- package/dist/components/GrTreeSelect/index.js +1 -1
- package/dist/granular-provider-node.js +1 -1
- package/dist/granular-provider.js +1 -1
- package/dist/i18n/all.js +1 -1
- package/dist/i18n/index.js +1 -1
- package/dist/index.js +20 -22
- package/dist/theme.js +1 -1
- package/dist/tokens.js +1 -1
- package/dist/types/components/GrFilePreview/GrFilePreview.vue.d.ts +14 -0
- package/dist/types/components/GrJsonViewer/GrJsonViewer.vue.d.ts +1 -1
- package/dist/types/components/GrKbd/grKbdStyles.d.ts +17 -2
- package/dist/types/granular-provider/shared.d.ts +0 -1
- package/dist/types/i18n/messages/en.d.ts +12 -10
- package/dist/types/i18n/messages/es.d.ts +12 -10
- package/dist/types/i18n/messages/ru.d.ts +12 -10
- package/dist/types/index.d.ts +0 -1
- package/dist/web-types.json +55 -122
- package/package.json +3 -7
- package/dist/chunks/config-DolULhjJ.js +0 -92
- package/dist/chunks/config-DolULhjJ.js.map +0 -1
- package/dist/chunks/copy-DChChcq-.js +0 -29
- package/dist/chunks/copy-DChChcq-.js.map +0 -1
- package/dist/chunks/grKbdStyles-DENu8pUK.js.map +0 -1
- package/dist/chunks/granular-provider-vVZ-76bP.js.map +0 -1
- package/dist/components/GrBreadcrumbs/chunks/GrBreadcrumbs-DOpwY2EF.js.map +0 -1
- package/dist/components/GrCodeBlock/chunks/GrCodeBlock-BUOwKwQE.js +0 -315
- package/dist/components/GrCodeBlock/chunks/GrCodeBlock-BUOwKwQE.js.map +0 -1
- package/dist/components/GrCodeBlock/index.js +0 -3
- package/dist/components/GrCodeBlock/styles.css +0 -1
- package/dist/components/GrDataTable/chunks/GrDataTable-BYYG_XZA.js.map +0 -1
- package/dist/components/GrDelta/chunks/GrDelta-BpfqebEV.js.map +0 -1
- package/dist/components/GrDescriptionList/chunks/GrDescriptionList-D8ANFpn_.js.map +0 -1
- package/dist/components/GrFilePreview/chunks/GrFilePreview-PabkLgYX.js.map +0 -1
- package/dist/components/GrInputTag/chunks/GrInputTag-DhfUNOA5.js.map +0 -1
- package/dist/components/GrJsonViewer/chunks/GrJsonViewer-CdtmUpZ3.js.map +0 -1
- package/dist/components/GrNumberInput/chunks/GrNumberInput-BqPydXpK.js.map +0 -1
- package/dist/components/GrSegmented/chunks/GrSegmented-NKTi9bMG.js.map +0 -1
- package/dist/components/GrSortableList/chunks/GrSortableList-CQCaWivn.js.map +0 -1
- package/dist/components/GrSteps/chunks/GrSteps-DXj7m-WO.js.map +0 -1
- package/dist/components/GrTabs/chunks/GrTabs-DHfv67cp.js.map +0 -1
- package/dist/types/components/GrCodeBlock/GrCodeBlock.vue.d.ts +0 -79
- package/dist/types/components/GrCodeBlock/config.d.ts +0 -1
- package/dist/types/components/GrCodeBlock/defaults.d.ts +0 -21
- package/dist/types/components/GrCodeBlock/grCodeBlockStyles.d.ts +0 -53
- package/dist/types/components/GrCodeBlock/index.d.ts +0 -6
- package/dist/types/components/GrCodeBlock/safelist.d.ts +0 -1
- package/dist/types/components/GrCodeBlock/serializeCode.d.ts +0 -19
- package/dist/types/components/GrCodeBlock/tokenizeJson.d.ts +0 -22
- package/dist/components/GrImageViewer/chunks/{GrImageViewer-BV38WM3x.js → GrImageViewer-Dd2gJ-j_.js} +1 -1
- package/dist/components/GrTree/chunks/{GrTree-CkELQwR8.js → GrTree-BFWFc0Bm.js} +1 -1
|
@@ -26,6 +26,14 @@ export interface GrFilePreviewProps {
|
|
|
26
26
|
ratio?: GrFilePreviewRatio;
|
|
27
27
|
/** Ссылка на оригинал — для не-картинок и для перехода мимо просмотрщика. */
|
|
28
28
|
href?: string;
|
|
29
|
+
/**
|
|
30
|
+
* Куда открывать ссылку. Объявлен пропом, а не оставлен на fallthrough:
|
|
31
|
+
* иначе `_blank` уезжал бы на `<a>` мимо компонента, и защитный `rel`
|
|
32
|
+
* подставить было бы негде.
|
|
33
|
+
*/
|
|
34
|
+
target?: string;
|
|
35
|
+
/** Своё значение `rel`. Задано — отменяет автоподстановку. */
|
|
36
|
+
rel?: string;
|
|
29
37
|
/** Свой корневой тег (`RouterLink`, `Link` от Inertia). Сильнее `href`. */
|
|
30
38
|
as?: string | Component;
|
|
31
39
|
/** Плитка кликабельна и эмитит `click` — обычно чтобы открыть просмотрщик. */
|
|
@@ -47,6 +55,8 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
47
55
|
tileSize: undefined;
|
|
48
56
|
ratio: undefined;
|
|
49
57
|
href: undefined;
|
|
58
|
+
target: undefined;
|
|
59
|
+
rel: undefined;
|
|
50
60
|
as: undefined;
|
|
51
61
|
clickable: boolean;
|
|
52
62
|
loading: undefined;
|
|
@@ -60,6 +70,8 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
60
70
|
tileSize: undefined;
|
|
61
71
|
ratio: undefined;
|
|
62
72
|
href: undefined;
|
|
73
|
+
target: undefined;
|
|
74
|
+
rel: undefined;
|
|
63
75
|
as: undefined;
|
|
64
76
|
clickable: boolean;
|
|
65
77
|
loading: undefined;
|
|
@@ -72,10 +84,12 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
72
84
|
loading: "lazy" | "eager";
|
|
73
85
|
clickable: boolean;
|
|
74
86
|
name: string | null;
|
|
87
|
+
target: string;
|
|
75
88
|
href: string;
|
|
76
89
|
ariaLabel: string;
|
|
77
90
|
src: string | null;
|
|
78
91
|
as: string | Component;
|
|
92
|
+
rel: string;
|
|
79
93
|
mime: string | null;
|
|
80
94
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
81
95
|
declare const _default: typeof __VLS_export;
|
|
@@ -91,11 +91,11 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
91
91
|
}) => any) | undefined;
|
|
92
92
|
}>, {
|
|
93
93
|
size: GrComponentSize;
|
|
94
|
-
copyable: boolean;
|
|
95
94
|
defaultExpandDepth: number;
|
|
96
95
|
maxStringLength: number;
|
|
97
96
|
maxArrayItems: number;
|
|
98
97
|
searchable: boolean;
|
|
98
|
+
copyable: boolean;
|
|
99
99
|
maxHeight: string | number;
|
|
100
100
|
ariaLabel: string;
|
|
101
101
|
virtual: boolean;
|
|
@@ -11,7 +11,17 @@ export declare const GR_KBD_VARIANTS: readonly ["merged", "split", "sequence"];
|
|
|
11
11
|
* `split` — по плашке на клавишу; `sequence` — аккорд «G затем I».
|
|
12
12
|
*/
|
|
13
13
|
export type GrKbdVariant = typeof GR_KBD_VARIANTS[number];
|
|
14
|
-
|
|
14
|
+
/**
|
|
15
|
+
* Шрифт задаётся явно, и это не косметика.
|
|
16
|
+
*
|
|
17
|
+
* Своей типографики у клавиши не было вовсе: `<kbd>` красит моноширинным
|
|
18
|
+
* UA-стиль браузера (и ресеты вроде `tailwind-compat` поверх него), то есть вид
|
|
19
|
+
* компонента решал хост. А в моноширинных символы модификаторов нарисованы
|
|
20
|
+
* мелкими: замер в `JetBrains Mono` — `⌘` 73 % высоты буквы, `⇧` 76 %, `⌥` 66 %;
|
|
21
|
+
* рядом с `K` это читается как значок другого кегля, и на `xs` особенно. В
|
|
22
|
+
* `--gr-font-ui` те же глифы дают 103 %, 103 % и 100 % — вровень с буквой.
|
|
23
|
+
*/
|
|
24
|
+
export declare const keyBaseClass = "inline-flex items-center justify-center rounded-[var(--gr-radius-control)] border border-[var(--gr-brd)] bg-[var(--gr-muted)] font-[var(--gr-font-ui)] font-medium leading-none text-[var(--gr-muted-fg)] shadow-[var(--gr-shadow-1)] tabular-nums";
|
|
15
25
|
/**
|
|
16
26
|
* Межстрочный здесь не парный: у клавиши он задан осознанно (`leading-none` в
|
|
17
27
|
* `keyBaseClass`), и вторая декларация того же веса подралась бы с ним за
|
|
@@ -21,8 +31,13 @@ export declare const keySizes: Record<GrComponentSize, string>;
|
|
|
21
31
|
/**
|
|
22
32
|
* Клавиша внутри общей плашки: ни рамки, ни фона, ни собственной ширины —
|
|
23
33
|
* иначе `⌘K` разъехалось бы зазорами внутри одного чипа.
|
|
34
|
+
*
|
|
35
|
+
* Семейство шрифта повторяется здесь, хотя внешняя плашка его уже задала:
|
|
36
|
+
* внутренняя клавиша — тоже `<kbd>`, а ресет хоста красит их по имени тега, и
|
|
37
|
+
* правило на элементе бьёт наследование от родителя. Без этой строки глифы
|
|
38
|
+
* оставались бы моноширинными внутри плашки, набранной UI-шрифтом.
|
|
24
39
|
*/
|
|
25
|
-
export declare const mergedKeyClass = "inline-flex items-center justify-center";
|
|
40
|
+
export declare const mergedKeyClass = "inline-flex items-center justify-center font-[var(--gr-font-ui)]";
|
|
26
41
|
/** Обёртка `split`: сама рамки не имеет — её рисуют вложенные клавиши. */
|
|
27
42
|
export declare const comboBaseClass = "inline-flex items-center align-middle";
|
|
28
43
|
export declare const comboGaps: Record<GrComponentSize, string>;
|
|
@@ -25,7 +25,6 @@ export declare const granularityComponentConfigs: {
|
|
|
25
25
|
GrCheckboxGroup: GranularComponentDescriptor<"GrCheckboxGroup">;
|
|
26
26
|
GrChip: GranularComponentDescriptor<"GrChip">;
|
|
27
27
|
GrChipGroup: GranularComponentDescriptor<"GrChipGroup">;
|
|
28
|
-
GrCodeBlock: GranularComponentDescriptor<"GrCodeBlock">;
|
|
29
28
|
GrCollapse: GranularComponentDescriptor<"GrCollapse">;
|
|
30
29
|
GrColorPicker: GranularComponentDescriptor<"GrColorPicker">;
|
|
31
30
|
GrCommandPalette: GranularComponentDescriptor<"GrCommandPalette">;
|
|
@@ -276,6 +276,12 @@ export declare const en: {
|
|
|
276
276
|
recent: string;
|
|
277
277
|
loading: string;
|
|
278
278
|
};
|
|
279
|
+
delta: {
|
|
280
|
+
increase: string;
|
|
281
|
+
};
|
|
282
|
+
filePreview: {
|
|
283
|
+
label: string;
|
|
284
|
+
};
|
|
279
285
|
fileValidation: {
|
|
280
286
|
accept: string;
|
|
281
287
|
extension: string;
|
|
@@ -351,11 +357,6 @@ export declare const en: {
|
|
|
351
357
|
dropped: string;
|
|
352
358
|
cancelled: string;
|
|
353
359
|
};
|
|
354
|
-
codeBlock: {
|
|
355
|
-
copy: string;
|
|
356
|
-
copied: string;
|
|
357
|
-
copyFailed: string;
|
|
358
|
-
};
|
|
359
360
|
jsonViewer: {
|
|
360
361
|
search: string;
|
|
361
362
|
expandAll: string;
|
|
@@ -636,6 +637,12 @@ export declare const en: {
|
|
|
636
637
|
recent: string;
|
|
637
638
|
loading: string;
|
|
638
639
|
};
|
|
640
|
+
delta: {
|
|
641
|
+
increase: string;
|
|
642
|
+
};
|
|
643
|
+
filePreview: {
|
|
644
|
+
label: string;
|
|
645
|
+
};
|
|
639
646
|
fileValidation: {
|
|
640
647
|
accept: string;
|
|
641
648
|
extension: string;
|
|
@@ -711,11 +718,6 @@ export declare const en: {
|
|
|
711
718
|
dropped: string;
|
|
712
719
|
cancelled: string;
|
|
713
720
|
};
|
|
714
|
-
codeBlock: {
|
|
715
|
-
copy: string;
|
|
716
|
-
copied: string;
|
|
717
|
-
copyFailed: string;
|
|
718
|
-
};
|
|
719
721
|
jsonViewer: {
|
|
720
722
|
search: string;
|
|
721
723
|
expandAll: string;
|
|
@@ -271,6 +271,12 @@ export declare const es: {
|
|
|
271
271
|
recent: string;
|
|
272
272
|
loading: string;
|
|
273
273
|
};
|
|
274
|
+
delta: {
|
|
275
|
+
increase: string;
|
|
276
|
+
};
|
|
277
|
+
filePreview: {
|
|
278
|
+
label: string;
|
|
279
|
+
};
|
|
274
280
|
fileValidation: {
|
|
275
281
|
accept: string;
|
|
276
282
|
extension: string;
|
|
@@ -346,11 +352,6 @@ export declare const es: {
|
|
|
346
352
|
dropped: string;
|
|
347
353
|
cancelled: string;
|
|
348
354
|
};
|
|
349
|
-
codeBlock: {
|
|
350
|
-
copy: string;
|
|
351
|
-
copied: string;
|
|
352
|
-
copyFailed: string;
|
|
353
|
-
};
|
|
354
355
|
jsonViewer: {
|
|
355
356
|
search: string;
|
|
356
357
|
expandAll: string;
|
|
@@ -633,6 +634,12 @@ export declare const es: {
|
|
|
633
634
|
recent: string;
|
|
634
635
|
loading: string;
|
|
635
636
|
};
|
|
637
|
+
delta: {
|
|
638
|
+
increase: string;
|
|
639
|
+
};
|
|
640
|
+
filePreview: {
|
|
641
|
+
label: string;
|
|
642
|
+
};
|
|
636
643
|
fileValidation: {
|
|
637
644
|
accept: string;
|
|
638
645
|
extension: string;
|
|
@@ -708,11 +715,6 @@ export declare const es: {
|
|
|
708
715
|
dropped: string;
|
|
709
716
|
cancelled: string;
|
|
710
717
|
};
|
|
711
|
-
codeBlock: {
|
|
712
|
-
copy: string;
|
|
713
|
-
copied: string;
|
|
714
|
-
copyFailed: string;
|
|
715
|
-
};
|
|
716
718
|
jsonViewer: {
|
|
717
719
|
search: string;
|
|
718
720
|
expandAll: string;
|
|
@@ -273,6 +273,12 @@ export declare const ru: {
|
|
|
273
273
|
recent: string;
|
|
274
274
|
loading: string;
|
|
275
275
|
};
|
|
276
|
+
delta: {
|
|
277
|
+
increase: string;
|
|
278
|
+
};
|
|
279
|
+
filePreview: {
|
|
280
|
+
label: string;
|
|
281
|
+
};
|
|
276
282
|
fileValidation: {
|
|
277
283
|
accept: string;
|
|
278
284
|
extension: string;
|
|
@@ -348,11 +354,6 @@ export declare const ru: {
|
|
|
348
354
|
dropped: string;
|
|
349
355
|
cancelled: string;
|
|
350
356
|
};
|
|
351
|
-
codeBlock: {
|
|
352
|
-
copy: string;
|
|
353
|
-
copied: string;
|
|
354
|
-
copyFailed: string;
|
|
355
|
-
};
|
|
356
357
|
jsonViewer: {
|
|
357
358
|
search: string;
|
|
358
359
|
expandAll: string;
|
|
@@ -637,6 +638,12 @@ export declare const ru: {
|
|
|
637
638
|
recent: string;
|
|
638
639
|
loading: string;
|
|
639
640
|
};
|
|
641
|
+
delta: {
|
|
642
|
+
increase: string;
|
|
643
|
+
};
|
|
644
|
+
filePreview: {
|
|
645
|
+
label: string;
|
|
646
|
+
};
|
|
640
647
|
fileValidation: {
|
|
641
648
|
accept: string;
|
|
642
649
|
extension: string;
|
|
@@ -712,11 +719,6 @@ export declare const ru: {
|
|
|
712
719
|
dropped: string;
|
|
713
720
|
cancelled: string;
|
|
714
721
|
};
|
|
715
|
-
codeBlock: {
|
|
716
|
-
copy: string;
|
|
717
|
-
copied: string;
|
|
718
|
-
copyFailed: string;
|
|
719
|
-
};
|
|
720
722
|
jsonViewer: {
|
|
721
723
|
search: string;
|
|
722
724
|
expandAll: string;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -12,7 +12,6 @@ export * from './components/GrCheckbox';
|
|
|
12
12
|
export * from './components/GrCheckboxGroup';
|
|
13
13
|
export * from './components/GrChip';
|
|
14
14
|
export * from './components/GrChipGroup';
|
|
15
|
-
export * from './components/GrCodeBlock';
|
|
16
15
|
export * from './components/GrCollapse';
|
|
17
16
|
export * from './components/GrColorPicker';
|
|
18
17
|
export * from './components/GrCommandPalette';
|
package/dist/web-types.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://raw.githubusercontent.com/JetBrains/web-types/master/schema/web-types.json",
|
|
3
3
|
"name": "@feugene/granularity",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.42.0",
|
|
5
5
|
"framework": "vue",
|
|
6
6
|
"js-types-syntax": "typescript",
|
|
7
7
|
"description-markup": "markdown",
|
|
@@ -1798,91 +1798,6 @@
|
|
|
1798
1798
|
]
|
|
1799
1799
|
}
|
|
1800
1800
|
},
|
|
1801
|
-
{
|
|
1802
|
-
"name": "GrCodeBlock",
|
|
1803
|
-
"source": {
|
|
1804
|
-
"module": "@feugene/granularity/components/GrCodeBlock",
|
|
1805
|
-
"symbol": "GrCodeBlock"
|
|
1806
|
-
},
|
|
1807
|
-
"props": [
|
|
1808
|
-
{
|
|
1809
|
-
"name": "size",
|
|
1810
|
-
"default": "undefined",
|
|
1811
|
-
"value": {
|
|
1812
|
-
"kind": "expression",
|
|
1813
|
-
"type": "\"xs\" | \"sm\" | \"md\" | \"lg\" | undefined"
|
|
1814
|
-
}
|
|
1815
|
-
},
|
|
1816
|
-
{
|
|
1817
|
-
"name": "ariaLabel",
|
|
1818
|
-
"description": "Имя области прокрутки. Безымянную скринридер объявляет просто «регион».",
|
|
1819
|
-
"default": "undefined",
|
|
1820
|
-
"value": {
|
|
1821
|
-
"kind": "expression",
|
|
1822
|
-
"type": "string | undefined"
|
|
1823
|
-
}
|
|
1824
|
-
},
|
|
1825
|
-
{
|
|
1826
|
-
"name": "language",
|
|
1827
|
-
"default": "\"json\"",
|
|
1828
|
-
"value": {
|
|
1829
|
-
"kind": "expression",
|
|
1830
|
-
"type": "GrCodeBlockLanguage | undefined"
|
|
1831
|
-
}
|
|
1832
|
-
},
|
|
1833
|
-
{
|
|
1834
|
-
"name": "maxHeight",
|
|
1835
|
-
"description": "Высота, после которой включается вертикальный скролл.",
|
|
1836
|
-
"default": "undefined",
|
|
1837
|
-
"value": {
|
|
1838
|
-
"kind": "expression",
|
|
1839
|
-
"type": "string | number | undefined"
|
|
1840
|
-
}
|
|
1841
|
-
},
|
|
1842
|
-
{
|
|
1843
|
-
"name": "copyable",
|
|
1844
|
-
"description": "Кнопка копирования. Без защищённого контекста не рисуется вовсе.",
|
|
1845
|
-
"default": "undefined",
|
|
1846
|
-
"value": {
|
|
1847
|
-
"kind": "expression",
|
|
1848
|
-
"type": "boolean | undefined"
|
|
1849
|
-
}
|
|
1850
|
-
},
|
|
1851
|
-
{
|
|
1852
|
-
"name": "wrap",
|
|
1853
|
-
"description": "Переносить длинные строки вместо горизонтальной прокрутки.",
|
|
1854
|
-
"default": "undefined",
|
|
1855
|
-
"value": {
|
|
1856
|
-
"kind": "expression",
|
|
1857
|
-
"type": "boolean | undefined"
|
|
1858
|
-
}
|
|
1859
|
-
},
|
|
1860
|
-
{
|
|
1861
|
-
"name": "lineNumbers",
|
|
1862
|
-
"default": "undefined",
|
|
1863
|
-
"value": {
|
|
1864
|
-
"kind": "expression",
|
|
1865
|
-
"type": "boolean | undefined"
|
|
1866
|
-
}
|
|
1867
|
-
},
|
|
1868
|
-
{
|
|
1869
|
-
"name": "code",
|
|
1870
|
-
"required": true,
|
|
1871
|
-
"description": "Строка или значение: объект сериализуется с отступом.",
|
|
1872
|
-
"value": {
|
|
1873
|
-
"kind": "expression",
|
|
1874
|
-
"type": "unknown"
|
|
1875
|
-
}
|
|
1876
|
-
}
|
|
1877
|
-
],
|
|
1878
|
-
"js": {
|
|
1879
|
-
"events": [
|
|
1880
|
-
{
|
|
1881
|
-
"name": "copy"
|
|
1882
|
-
}
|
|
1883
|
-
]
|
|
1884
|
-
}
|
|
1885
|
-
},
|
|
1886
1801
|
{
|
|
1887
1802
|
"name": "GrCollapse",
|
|
1888
1803
|
"source": {
|
|
@@ -2221,15 +2136,6 @@
|
|
|
2221
2136
|
"type": "GrCommandItem[] | undefined"
|
|
2222
2137
|
}
|
|
2223
2138
|
},
|
|
2224
|
-
{
|
|
2225
|
-
"name": "maxHeight",
|
|
2226
|
-
"description": "Максимальная высота списка, px.",
|
|
2227
|
-
"default": "360",
|
|
2228
|
-
"value": {
|
|
2229
|
-
"kind": "expression",
|
|
2230
|
-
"type": "number | undefined"
|
|
2231
|
-
}
|
|
2232
|
-
},
|
|
2233
2139
|
{
|
|
2234
2140
|
"name": "emptyText",
|
|
2235
2141
|
"default": "undefined",
|
|
@@ -2256,6 +2162,15 @@
|
|
|
2256
2162
|
"type": "string | null | undefined"
|
|
2257
2163
|
}
|
|
2258
2164
|
},
|
|
2165
|
+
{
|
|
2166
|
+
"name": "maxHeight",
|
|
2167
|
+
"description": "Максимальная высота списка, px.",
|
|
2168
|
+
"default": "360",
|
|
2169
|
+
"value": {
|
|
2170
|
+
"kind": "expression",
|
|
2171
|
+
"type": "number | undefined"
|
|
2172
|
+
}
|
|
2173
|
+
},
|
|
2259
2174
|
{
|
|
2260
2175
|
"name": "showHotkeyHint",
|
|
2261
2176
|
"description": "Показывать подсказку сочетания в поле ввода.",
|
|
@@ -4135,6 +4050,24 @@
|
|
|
4135
4050
|
"type": "string | undefined"
|
|
4136
4051
|
}
|
|
4137
4052
|
},
|
|
4053
|
+
{
|
|
4054
|
+
"name": "target",
|
|
4055
|
+
"description": "Куда открывать ссылку. Объявлен пропом, а не оставлен на fallthrough: иначе `_blank` уезжал бы на `<a>` мимо компонента, и защитный `rel` подставить было бы негде.",
|
|
4056
|
+
"default": "undefined",
|
|
4057
|
+
"value": {
|
|
4058
|
+
"kind": "expression",
|
|
4059
|
+
"type": "string | undefined"
|
|
4060
|
+
}
|
|
4061
|
+
},
|
|
4062
|
+
{
|
|
4063
|
+
"name": "rel",
|
|
4064
|
+
"description": "Своё значение `rel`. Задано — отменяет автоподстановку.",
|
|
4065
|
+
"default": "undefined",
|
|
4066
|
+
"value": {
|
|
4067
|
+
"kind": "expression",
|
|
4068
|
+
"type": "string | undefined"
|
|
4069
|
+
}
|
|
4070
|
+
},
|
|
4138
4071
|
{
|
|
4139
4072
|
"name": "clickable",
|
|
4140
4073
|
"description": "Плитка кликабельна и эмитит `click` — обычно чтобы открыть просмотрщик.",
|
|
@@ -5942,15 +5875,6 @@
|
|
|
5942
5875
|
"type": "string | number | undefined"
|
|
5943
5876
|
}
|
|
5944
5877
|
},
|
|
5945
|
-
{
|
|
5946
|
-
"name": "copyable",
|
|
5947
|
-
"description": "Кнопка копирования узла в строке.",
|
|
5948
|
-
"default": "undefined",
|
|
5949
|
-
"value": {
|
|
5950
|
-
"kind": "expression",
|
|
5951
|
-
"type": "boolean | undefined"
|
|
5952
|
-
}
|
|
5953
|
-
},
|
|
5954
5878
|
{
|
|
5955
5879
|
"name": "rootLabel",
|
|
5956
5880
|
"description": "Подпись корня. По умолчанию `$` — так адресуют путь JSONPath и dev-tools.",
|
|
@@ -5996,6 +5920,15 @@
|
|
|
5996
5920
|
"type": "boolean | undefined"
|
|
5997
5921
|
}
|
|
5998
5922
|
},
|
|
5923
|
+
{
|
|
5924
|
+
"name": "copyable",
|
|
5925
|
+
"description": "Кнопка копирования узла в строке.",
|
|
5926
|
+
"default": "undefined",
|
|
5927
|
+
"value": {
|
|
5928
|
+
"kind": "expression",
|
|
5929
|
+
"type": "boolean | undefined"
|
|
5930
|
+
}
|
|
5931
|
+
},
|
|
5999
5932
|
{
|
|
6000
5933
|
"name": "value",
|
|
6001
5934
|
"required": true,
|
|
@@ -10201,15 +10134,6 @@
|
|
|
10201
10134
|
"type": "boolean | undefined"
|
|
10202
10135
|
}
|
|
10203
10136
|
},
|
|
10204
|
-
{
|
|
10205
|
-
"name": "maxHeight",
|
|
10206
|
-
"description": "Максимальная высота скролл-контейнера (включает вертикальный скролл). Число трактуется как пиксели. Нужен для работы `stickyHeader`.",
|
|
10207
|
-
"default": "undefined",
|
|
10208
|
-
"value": {
|
|
10209
|
-
"kind": "expression",
|
|
10210
|
-
"type": "string | number | undefined"
|
|
10211
|
-
}
|
|
10212
|
-
},
|
|
10213
10137
|
{
|
|
10214
10138
|
"name": "empty",
|
|
10215
10139
|
"description": "Таблица пуста. По умолчанию определяется по содержимому слота.",
|
|
@@ -10228,6 +10152,15 @@
|
|
|
10228
10152
|
"type": "string | undefined"
|
|
10229
10153
|
}
|
|
10230
10154
|
},
|
|
10155
|
+
{
|
|
10156
|
+
"name": "maxHeight",
|
|
10157
|
+
"description": "Максимальная высота скролл-контейнера (включает вертикальный скролл). Число трактуется как пиксели. Нужен для работы `stickyHeader`.",
|
|
10158
|
+
"default": "undefined",
|
|
10159
|
+
"value": {
|
|
10160
|
+
"kind": "expression",
|
|
10161
|
+
"type": "string | number | undefined"
|
|
10162
|
+
}
|
|
10163
|
+
},
|
|
10231
10164
|
{
|
|
10232
10165
|
"name": "caption",
|
|
10233
10166
|
"description": "Текст caption для screen reader'ов. Рендерится как `<caption class=\"sr-only\">`, если не передан слот `#caption`.",
|
|
@@ -10908,15 +10841,6 @@
|
|
|
10908
10841
|
"type": "Placement | undefined"
|
|
10909
10842
|
}
|
|
10910
10843
|
},
|
|
10911
|
-
{
|
|
10912
|
-
"name": "text",
|
|
10913
|
-
"description": "Текст подсказки. Разметка вместо текста — слот `#content`.",
|
|
10914
|
-
"default": "undefined",
|
|
10915
|
-
"value": {
|
|
10916
|
-
"kind": "expression",
|
|
10917
|
-
"type": "string | undefined"
|
|
10918
|
-
}
|
|
10919
|
-
},
|
|
10920
10844
|
{
|
|
10921
10845
|
"name": "offsetPx",
|
|
10922
10846
|
"description": "Зазор между триггером и панелью, px.",
|
|
@@ -10944,6 +10868,15 @@
|
|
|
10944
10868
|
"type": "number | undefined"
|
|
10945
10869
|
}
|
|
10946
10870
|
},
|
|
10871
|
+
{
|
|
10872
|
+
"name": "text",
|
|
10873
|
+
"description": "Текст подсказки. Разметка вместо текста — слот `#content`.",
|
|
10874
|
+
"default": "undefined",
|
|
10875
|
+
"value": {
|
|
10876
|
+
"kind": "expression",
|
|
10877
|
+
"type": "string | undefined"
|
|
10878
|
+
}
|
|
10879
|
+
},
|
|
10947
10880
|
{
|
|
10948
10881
|
"name": "iconColor",
|
|
10949
10882
|
"description": "Цвет триггер-иконки (CSS color). По умолчанию — `var(--gr-muted-fg)`.",
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@feugene/granularity",
|
|
3
3
|
"description": "Granularity design system package with Vue 3 components, consumed via the `@feugene/unocss-preset-granular` preset.",
|
|
4
|
-
"version": "0.
|
|
5
|
-
"license": "
|
|
4
|
+
"version": "0.42.0",
|
|
5
|
+
"license": "LicenseRef-Granularity-EUC-1.1",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Evgeniy Fureev",
|
|
8
8
|
"url": "https://github.com/efureev"
|
|
@@ -118,10 +118,6 @@
|
|
|
118
118
|
"types": "./dist/types/components/GrChipGroup/index.d.ts",
|
|
119
119
|
"import": "./dist/components/GrChipGroup/index.js"
|
|
120
120
|
},
|
|
121
|
-
"./components/GrCodeBlock": {
|
|
122
|
-
"types": "./dist/types/components/GrCodeBlock/index.d.ts",
|
|
123
|
-
"import": "./dist/components/GrCodeBlock/index.js"
|
|
124
|
-
},
|
|
125
121
|
"./components/GrCollapse": {
|
|
126
122
|
"types": "./dist/types/components/GrCollapse/index.d.ts",
|
|
127
123
|
"import": "./dist/components/GrCollapse/index.js"
|
|
@@ -607,7 +603,7 @@
|
|
|
607
603
|
"devDependencies": {
|
|
608
604
|
"@antfu/eslint-config": "^9.3.0",
|
|
609
605
|
"@feugene/fint-i18n": "^0.7.0",
|
|
610
|
-
"@feugene/granularity-test-kit": "^0.
|
|
606
|
+
"@feugene/granularity-test-kit": "^0.10.0",
|
|
611
607
|
"@feugene/unocss-preset-granular": "^0.16.0",
|
|
612
608
|
"@floating-ui/dom": "^1.8.0",
|
|
613
609
|
"@iconify-json/lucide": "^1.2.126",
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
import { n as splitClassTokens } from "./classTokens-8v2XC74x.js";
|
|
2
|
-
import { defineGranularComponent } from "@feugene/unocss-preset-granular/contract";
|
|
3
|
-
//#region src/components/GrCodeBlock/grCodeBlockStyles.ts
|
|
4
|
-
/**
|
|
5
|
-
* Классы `GrCodeBlock`.
|
|
6
|
-
*
|
|
7
|
-
* Роли подсветки перечислены целиком, по литералу на ветку: UnoCSS сканирует
|
|
8
|
-
* исходный текст файла, и собранное шаблонной строкой имя уехало бы в CSS как
|
|
9
|
-
* литерал.
|
|
10
|
-
*/
|
|
11
|
-
/**
|
|
12
|
-
* Зацепка собственного CSS компонента (номера строк). Не утилита: CSS она не
|
|
13
|
-
* порождает, поэтому в `safelist` не идёт — там гейт справедливо считает такую
|
|
14
|
-
* запись мёртвой.
|
|
15
|
-
*/
|
|
16
|
-
var codeBlockHookClass = "gr-code-block";
|
|
17
|
-
/** Включает колонку номеров. Тоже зацепка, не утилита. */
|
|
18
|
-
var codeBlockNumberedClass = "gr-code-block--numbered";
|
|
19
|
-
/**
|
|
20
|
-
* Поверхность держит корень, а не `<pre>`: кнопка копирования стоит рядом со
|
|
21
|
-
* скроллером, и жёлоб под неё обязан быть частью блока, а не полем страницы.
|
|
22
|
-
*/
|
|
23
|
-
var codeBlockRootClass = "relative rounded-[var(--gr-radius-md)] bg-[var(--gr-code-block-bg,var(--gr-muted))] text-[var(--gr-code-block-fg,var(--gr-fg))]";
|
|
24
|
-
/**
|
|
25
|
-
* Полоса под кнопку: 28 px самой кнопки плюс отбивка `right-1`.
|
|
26
|
-
*
|
|
27
|
-
* Кнопка не может висеть поверх `<pre>`: полосу прокрутки браузер рисует у
|
|
28
|
-
* правого края скроллера, в тех же 8–15 px, и накрытую кнопкой её не ухватить
|
|
29
|
-
* мышью. Отступами это не лечится — их пришлось бы взять больше ширины самой
|
|
30
|
-
* кнопки, и «угол» перестал бы быть углом. Витринный `doc/CodeBlock.vue` решает
|
|
31
|
-
* то же самое шапкой; у пакетного блока шапки нет, поэтому место отдаётся
|
|
32
|
-
* жёлобом.
|
|
33
|
-
*/
|
|
34
|
-
var codeBlockGutterClass = "pr-9";
|
|
35
|
-
/** Скроллер обязан показывать фокус: он стоит в таб-порядке. */
|
|
36
|
-
var codeBlockScrollClass = "overflow-auto focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--gr-ring)]";
|
|
37
|
-
var codeBlockWrapClass = "whitespace-pre-wrap break-words";
|
|
38
|
-
var codeBlockNowrapClass = "whitespace-pre";
|
|
39
|
-
/** Кнопка копирования: правый верхний угол, внутри жёлоба. */
|
|
40
|
-
var codeBlockCopyClass = "absolute right-1 top-1 z-[1]";
|
|
41
|
-
var codeBlockPaddings = {
|
|
42
|
-
xs: "p-2",
|
|
43
|
-
sm: "p-2.5",
|
|
44
|
-
md: "p-3",
|
|
45
|
-
lg: "p-4"
|
|
46
|
-
};
|
|
47
|
-
var codeBlockTextSizes = {
|
|
48
|
-
xs: "text-[length:var(--gr-control-text-3xs)] leading-[var(--gr-control-leading-3xs)]",
|
|
49
|
-
sm: "text-[length:var(--gr-control-text-2xs)] leading-[var(--gr-control-leading-2xs)]",
|
|
50
|
-
md: "text-[length:var(--gr-control-text-xs)] leading-[var(--gr-control-leading-xs)]",
|
|
51
|
-
lg: "text-[length:var(--gr-control-text-sm)] leading-[var(--gr-control-leading-sm)]"
|
|
52
|
-
};
|
|
53
|
-
/**
|
|
54
|
-
* Роли подсветки. Дефолты — ссылки на `-text`-роли темы: они переключаются
|
|
55
|
-
* вместе с ней, поэтому подсветка работает в обеих без своего theme-слоя.
|
|
56
|
-
*
|
|
57
|
-
* Число взято от `azure`, а не от `info`: `info` — синий в двух шагах от индиго
|
|
58
|
-
* `primary`, и пара «ключ ↔ число» давала ΔE 9.4 в светлой теме и 7.8 в тёмной.
|
|
59
|
-
* В `{"count": 42}` эти два цвета стоят через двоеточие и читались бы как один.
|
|
60
|
-
* С `azure` расстояние 53.8 и 16.6. Гейт — `grCodeBlockContrast.test.ts`.
|
|
61
|
-
*/
|
|
62
|
-
var codeTokenClass = {
|
|
63
|
-
key: "text-[var(--gr-code-block-key,var(--gr-primary-text))]",
|
|
64
|
-
string: "text-[var(--gr-code-block-string,var(--gr-success-text))]",
|
|
65
|
-
number: "text-[var(--gr-code-block-number,var(--gr-azure-text))]",
|
|
66
|
-
literal: "text-[var(--gr-code-block-literal,var(--gr-warning-text))]",
|
|
67
|
-
punctuation: "text-[var(--gr-code-block-fg,var(--gr-fg))]",
|
|
68
|
-
plain: ""
|
|
69
|
-
};
|
|
70
|
-
//#endregion
|
|
71
|
-
//#region src/components/GrCodeBlock/safelist.ts
|
|
72
|
-
var grCodeBlockSafelist = [.../* @__PURE__ */ new Set([
|
|
73
|
-
...splitClassTokens(codeBlockRootClass),
|
|
74
|
-
...splitClassTokens("m-0"),
|
|
75
|
-
...splitClassTokens(codeBlockScrollClass),
|
|
76
|
-
...splitClassTokens(codeBlockWrapClass),
|
|
77
|
-
...splitClassTokens(codeBlockNowrapClass),
|
|
78
|
-
...splitClassTokens(codeBlockCopyClass),
|
|
79
|
-
...splitClassTokens(codeBlockGutterClass),
|
|
80
|
-
...Object.values(codeBlockPaddings).flatMap(splitClassTokens),
|
|
81
|
-
...Object.values(codeBlockTextSizes).flatMap(splitClassTokens),
|
|
82
|
-
...Object.values(codeTokenClass).flatMap(splitClassTokens)
|
|
83
|
-
])];
|
|
84
|
-
//#endregion
|
|
85
|
-
//#region src/components/GrCodeBlock/config.ts
|
|
86
|
-
var grCodeBlockConfig = defineGranularComponent(import.meta.url, {
|
|
87
|
-
name: "GrCodeBlock",
|
|
88
|
-
dependencies: ["GrButton"],
|
|
89
|
-
safelist: grCodeBlockSafelist
|
|
90
|
-
});
|
|
91
|
-
//#endregion
|
|
92
|
-
export { codeBlockHookClass as a, codeBlockPaddings as c, codeBlockTextSizes as d, codeBlockWrapClass as f, codeBlockGutterClass as i, codeBlockRootClass as l, grCodeBlockSafelist as n, codeBlockNowrapClass as o, codeTokenClass as p, codeBlockCopyClass as r, codeBlockNumberedClass as s, grCodeBlockConfig as t, codeBlockScrollClass as u };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"config-DolULhjJ.js","names":[],"sources":["../../src/components/GrCodeBlock/grCodeBlockStyles.ts","../../src/components/GrCodeBlock/safelist.ts","../../src/components/GrCodeBlock/config.ts"],"sourcesContent":["import type { GrComponentSize } from '../shared/sizes'\n\nimport type { GrCodeTokenKind } from './tokenizeJson'\n\n/**\n * Классы `GrCodeBlock`.\n *\n * Роли подсветки перечислены целиком, по литералу на ветку: UnoCSS сканирует\n * исходный текст файла, и собранное шаблонной строкой имя уехало бы в CSS как\n * литерал.\n */\n\n/**\n * Зацепка собственного CSS компонента (номера строк). Не утилита: CSS она не\n * порождает, поэтому в `safelist` не идёт — там гейт справедливо считает такую\n * запись мёртвой.\n */\nexport const codeBlockHookClass = 'gr-code-block'\n\n/** Включает колонку номеров. Тоже зацепка, не утилита. */\nexport const codeBlockNumberedClass = 'gr-code-block--numbered'\n\n/**\n * Поверхность держит корень, а не `<pre>`: кнопка копирования стоит рядом со\n * скроллером, и жёлоб под неё обязан быть частью блока, а не полем страницы.\n */\nexport const codeBlockRootClass = 'relative rounded-[var(--gr-radius-md)] bg-[var(--gr-code-block-bg,var(--gr-muted))] text-[var(--gr-code-block-fg,var(--gr-fg))]'\n\n/**\n * Полоса под кнопку: 28 px самой кнопки плюс отбивка `right-1`.\n *\n * Кнопка не может висеть поверх `<pre>`: полосу прокрутки браузер рисует у\n * правого края скроллера, в тех же 8–15 px, и накрытую кнопкой её не ухватить\n * мышью. Отступами это не лечится — их пришлось бы взять больше ширины самой\n * кнопки, и «угол» перестал бы быть углом. Витринный `doc/CodeBlock.vue` решает\n * то же самое шапкой; у пакетного блока шапки нет, поэтому место отдаётся\n * жёлобом.\n */\nexport const codeBlockGutterClass = 'pr-9'\n\n/** Браузерный отступ `<pre>`: фон и радиус живут на корне, полю здесь не место. */\nexport const codeBlockSurfaceClass = 'm-0'\n\n/** Скроллер обязан показывать фокус: он стоит в таб-порядке. */\nexport const codeBlockScrollClass = 'overflow-auto focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--gr-ring)]'\n\nexport const codeBlockWrapClass = 'whitespace-pre-wrap break-words'\nexport const codeBlockNowrapClass = 'whitespace-pre'\n\n/** Кнопка копирования: правый верхний угол, внутри жёлоба. */\nexport const codeBlockCopyClass = 'absolute right-1 top-1 z-[1]'\n\nexport const codeBlockPaddings: Record<GrComponentSize, string> = {\n xs: 'p-2',\n sm: 'p-2.5',\n md: 'p-3',\n lg: 'p-4',\n}\n\nexport const codeBlockTextSizes: Record<GrComponentSize, string> = {\n xs: 'text-[length:var(--gr-control-text-3xs)] leading-[var(--gr-control-leading-3xs)]',\n sm: 'text-[length:var(--gr-control-text-2xs)] leading-[var(--gr-control-leading-2xs)]',\n md: 'text-[length:var(--gr-control-text-xs)] leading-[var(--gr-control-leading-xs)]',\n lg: 'text-[length:var(--gr-control-text-sm)] leading-[var(--gr-control-leading-sm)]',\n}\n\n/**\n * Роли подсветки. Дефолты — ссылки на `-text`-роли темы: они переключаются\n * вместе с ней, поэтому подсветка работает в обеих без своего theme-слоя.\n *\n * Число взято от `azure`, а не от `info`: `info` — синий в двух шагах от индиго\n * `primary`, и пара «ключ ↔ число» давала ΔE 9.4 в светлой теме и 7.8 в тёмной.\n * В `{\"count\": 42}` эти два цвета стоят через двоеточие и читались бы как один.\n * С `azure` расстояние 53.8 и 16.6. Гейт — `grCodeBlockContrast.test.ts`.\n */\nexport const codeTokenClass: Record<GrCodeTokenKind, string> = {\n key: 'text-[var(--gr-code-block-key,var(--gr-primary-text))]',\n string: 'text-[var(--gr-code-block-string,var(--gr-success-text))]',\n number: 'text-[var(--gr-code-block-number,var(--gr-azure-text))]',\n literal: 'text-[var(--gr-code-block-literal,var(--gr-warning-text))]',\n punctuation: 'text-[var(--gr-code-block-fg,var(--gr-fg))]',\n plain: '',\n}\n","import { splitClassTokens } from '../shared/classTokens'\n\nimport {\n codeBlockCopyClass,\n codeBlockGutterClass,\n codeBlockNowrapClass,\n codeBlockPaddings,\n codeBlockRootClass,\n codeBlockScrollClass,\n codeBlockSurfaceClass,\n codeBlockTextSizes,\n codeBlockWrapClass,\n codeTokenClass,\n} from './grCodeBlockStyles'\n\n// Классы из вычисляемых мап (роль токена, размер) UnoCSS сканом не находит —\n// только safelist. Литералы хелпера туда же: на сборке он уезжает в общий чанк.\n//\n// `codeBlockHookClass` и `codeBlockNumberedClass` сюда НЕ идут: это селекторы\n// собственного `<style>` компонента, CSS из них не порождается, и гейт\n// `documentedConfig` справедливо считал бы такую запись мёртвой.\nexport const grCodeBlockSafelist = [...new Set([\n ...splitClassTokens(codeBlockRootClass),\n ...splitClassTokens(codeBlockSurfaceClass),\n ...splitClassTokens(codeBlockScrollClass),\n ...splitClassTokens(codeBlockWrapClass),\n ...splitClassTokens(codeBlockNowrapClass),\n ...splitClassTokens(codeBlockCopyClass),\n ...splitClassTokens(codeBlockGutterClass),\n ...Object.values(codeBlockPaddings).flatMap(splitClassTokens),\n ...Object.values(codeBlockTextSizes).flatMap(splitClassTokens),\n ...Object.values(codeTokenClass).flatMap(splitClassTokens),\n])]\n","import { defineGranularComponent } from '@feugene/unocss-preset-granular/contract'\n\nimport { grCodeBlockSafelist } from './safelist'\n\nexport const grCodeBlockConfig = defineGranularComponent(import.meta.url, {\n name: 'GrCodeBlock',\n dependencies: ['GrButton'],\n safelist: grCodeBlockSafelist,\n})\n"],"mappings":";;;;;;;;;;;;;;;AAiBA,IAAa,qBAAqB;;AAGlC,IAAa,yBAAyB;;;;;AAMtC,IAAa,qBAAqB;;;;;;;;;;;AAYlC,IAAa,uBAAuB;;AAMpC,IAAa,uBAAuB;AAEpC,IAAa,qBAAqB;AAClC,IAAa,uBAAuB;;AAGpC,IAAa,qBAAqB;AAElC,IAAa,oBAAqD;CAChE,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;AACN;AAEA,IAAa,qBAAsD;CACjE,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;AACN;;;;;;;;;;AAWA,IAAa,iBAAkD;CAC7D,KAAK;CACL,QAAQ;CACR,QAAQ;CACR,SAAS;CACT,aAAa;CACb,OAAO;AACT;;;AC7DA,IAAa,sBAAsB,CAAC,mBAAG,IAAI,IAAI;CAC7C,GAAG,iBAAiB,kBAAkB;CACtC,GAAG,iBAAA,KAAsC;CACzC,GAAG,iBAAiB,oBAAoB;CACxC,GAAG,iBAAiB,kBAAkB;CACtC,GAAG,iBAAiB,oBAAoB;CACxC,GAAG,iBAAiB,kBAAkB;CACtC,GAAG,iBAAiB,oBAAoB;CACxC,GAAG,OAAO,OAAO,iBAAiB,CAAC,CAAC,QAAQ,gBAAgB;CAC5D,GAAG,OAAO,OAAO,kBAAkB,CAAC,CAAC,QAAQ,gBAAgB;CAC7D,GAAG,OAAO,OAAO,cAAc,CAAC,CAAC,QAAQ,gBAAgB;AAC3D,CAAC,CAAC;;;AC5BF,IAAa,oBAAoB,wBAAwB,YAAY,KAAK;CACxE,MAAM;CACN,cAAc,CAAC,UAAU;CACzB,UAAU;AACZ,CAAC"}
|