@unocss/inspector 66.6.6 → 66.6.8
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/dist/client/assets/_id_-BIxHUFw_.js +1 -0
- package/dist/client/assets/index-BwsN_9lk.js +3 -0
- package/dist/client/assets/index-W3Dm2a6P.css +1 -0
- package/dist/client/assets/repl-xrRs26oL.js +3 -0
- package/dist/client/assets/splitpanes.es-CPPTnJAX.js +251 -0
- package/dist/client/assets/useScrollStyle-BOmGgPVV.js +34 -0
- package/dist/client/assets/useScrollStyle-ClynxqzU.css +1 -0
- package/dist/client/index.html +5 -2
- package/dist/index.mjs +24 -86
- package/package.json +4 -3
- package/dist/client/assets/_id_-DEOrAJwO.js +0 -1
- package/dist/client/assets/index-BYGoiv1F.js +0 -276
- package/dist/client/assets/index-BejX0p-D.css +0 -1
- package/dist/client/assets/repl-DKGHtYvd.js +0 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
#gtx-trans,grammarly-extension,deepl-inline-translate,grammarly-popups,deepl-inline-popup,grammarly-desktop-integration{display:none!important}.cm-editor{font-family:inherit;width:100%!important;height:100%!important}.cm-content{cursor:text!important}:root:not(.dark) .cm-search .cm-button{background-image:linear-gradient(#f5f6f7,#eee)}:root:not(.dark) .cm-search .cm-button:active{background-image:linear-gradient(#eee,#f5f6f7)}:root{--cm-font-family:"Fira Code", monospace;--cm-foreground:#393a3480;--cm-background:#fdfdfd;--cm-comment:#a0ada0;--cm-string:#b56959;--cm-number:#296aa3;--cm-variable:#59873a;--cm-keyword:#1c6b48;--cm-property:#b58451;--cm-definition-keyword:#ab5959;--cm-punctuation:#8e8f8b;--cm-decorator:#b07d48;--cm-line-highlight-background:#c9c9c910;--cm-line-highlight-border:#b0b0b030;--cm-tooltip-background:#fdfdfd;--cm-selection-background:#eee;--cm-border:#9ca3af1a;--cm-ttc-c-thumb:#eee;--cm-ttc-c-track:white}html.dark{--cm-scheme:dark;--cm-foreground:#d4cfbf80;--cm-background:#121212;--cm-comment:#758575;--cm-string:#d48372;--cm-keyword:#4d9375;--cm-number:#6394bf;--cm-variable:#c2b36e;--cm-property:#dd8e6e;--cm-definition-keyword:#cb7676;--cm-punctuation:#858585;--cm-decorator:#bd976a;--cm-line-number:#dedcd530;--cm-line-number-gutter:#eee;--cm-line-highlight-background:#4d4d4d29;--cm-line-highlight-border:#3a3a3a80;--cm-tooltip-background:#121212;--cm-selection-background:#242424;--cm-ttc-c-thumb:#222;--cm-ttc-c-track:#111}.highlighted,.highlighted>span{border-bottom:1px dashed}.cm-scroller::-webkit-scrollbar{width:8px;height:8px}.full-scrolls .cm-scroller,.scrolls{scrollbar-width:thin;scrollbar-color:var(--cm-ttc-c-thumb) var(--cm-ttc-c-track);height:calc(100vh - 2px)!important;overflow:auto!important}.scrolls-sidebar{height:calc(100vh - 92px - 2.5rem)!important}.overview-scrolls .cm-scroller{--use-overview-scrolls:var(--overview-scrolls,calc(100vh - 116px - 1rem - 61px - 1rem - 2px));height:var(--use-overview-scrolls)!important}.module-scrolls .cm-scroller{--use-module-scrolls:var(--module-scrolls,calc(100vh - 41px - 2.5rem));height:var(--use-module-scrolls)!important}.repl-scrolls .cm-scroller{--use-repl-scrolls:var(--repl-scrolls,calc(100vh - 41px - 2.5rem));height:var(--use-repl-scrolls)!important}.cm-scroller::-webkit-scrollbar-track{background:var(--cm-ttc-c-track)}.cm-scroller::-webkit-scrollbar-thumb{background-color:var(--cm-ttc-c-thumb);border:2px solid var(--cm-ttc-c-thumb);border-radius:3px}.cm-scroller::-webkit-scrollbar-corner{background-color:var(--cm-ttc-c-track)}
|
package/dist/client/index.html
CHANGED
|
@@ -11,8 +11,11 @@
|
|
|
11
11
|
href="https://fonts.googleapis.com/css2?family=Inter:wght@100;200;400&family=Fira+Code&display=swap"
|
|
12
12
|
rel="stylesheet"
|
|
13
13
|
/>
|
|
14
|
-
<script type="module" crossorigin src="/__unocss/assets/index-
|
|
15
|
-
<link rel="
|
|
14
|
+
<script type="module" crossorigin src="/__unocss/assets/index-BwsN_9lk.js"></script>
|
|
15
|
+
<link rel="modulepreload" crossorigin href="/__unocss/assets/useScrollStyle-BOmGgPVV.js">
|
|
16
|
+
<link rel="modulepreload" crossorigin href="/__unocss/assets/splitpanes.es-CPPTnJAX.js">
|
|
17
|
+
<link rel="stylesheet" crossorigin href="/__unocss/assets/useScrollStyle-ClynxqzU.css">
|
|
18
|
+
<link rel="stylesheet" crossorigin href="/__unocss/assets/index-W3Dm2a6P.css">
|
|
16
19
|
</head>
|
|
17
20
|
<body>
|
|
18
21
|
<div id="app"></div>
|
package/dist/index.mjs
CHANGED
|
@@ -1,65 +1,25 @@
|
|
|
1
1
|
import { dirname, resolve } from "node:path";
|
|
2
2
|
import { fileURLToPath } from "node:url";
|
|
3
3
|
import { BetterMap, CountableSet, escapeSelector } from "@unocss/core";
|
|
4
|
-
import { bold, cyan, green } from "colorette";
|
|
5
4
|
import gzipSize from "gzip-size";
|
|
6
5
|
import sirv from "sirv";
|
|
7
6
|
import { createValueHandler, getStringComponent, parseCssColor } from "@unocss/rule-utils";
|
|
8
|
-
|
|
9
|
-
//#region rolldown:runtime
|
|
7
|
+
//#region \0rolldown/runtime.js
|
|
10
8
|
var __defProp = Object.defineProperty;
|
|
11
|
-
var __exportAll = (all,
|
|
9
|
+
var __exportAll = (all, no_symbols) => {
|
|
12
10
|
let target = {};
|
|
13
|
-
for (var name in all) {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
19
|
-
if (symbols) {
|
|
20
|
-
__defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
21
|
-
}
|
|
11
|
+
for (var name in all) __defProp(target, name, {
|
|
12
|
+
get: all[name],
|
|
13
|
+
enumerable: true
|
|
14
|
+
});
|
|
15
|
+
if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
22
16
|
return target;
|
|
23
17
|
};
|
|
24
|
-
|
|
25
18
|
//#endregion
|
|
26
19
|
//#region ../../virtual-shared/integration/src/constants.ts
|
|
27
20
|
const SKIP_START_COMMENT = "@unocss-skip-start";
|
|
28
21
|
const SKIP_END_COMMENT = "@unocss-skip-end";
|
|
29
22
|
const SKIP_COMMENT_RE = new RegExp(`(\/\/\\s*?${SKIP_START_COMMENT}\\s*?|\\/\\*\\s*?${SKIP_START_COMMENT}\\s*?\\*\\/|<!--\\s*?${SKIP_START_COMMENT}\\s*?-->)[\\s\\S]*?(\/\/\\s*?${SKIP_END_COMMENT}\\s*?|\\/\\*\\s*?${SKIP_END_COMMENT}\\s*?\\*\\/|<!--\\s*?${SKIP_END_COMMENT}\\s*?-->)`, "g");
|
|
30
|
-
|
|
31
|
-
//#endregion
|
|
32
|
-
//#region ../../packages-presets/preset-mini/src/_utils/mappings.ts
|
|
33
|
-
const directionMap = {
|
|
34
|
-
"l": ["-left"],
|
|
35
|
-
"r": ["-right"],
|
|
36
|
-
"t": ["-top"],
|
|
37
|
-
"b": ["-bottom"],
|
|
38
|
-
"s": ["-inline-start"],
|
|
39
|
-
"e": ["-inline-end"],
|
|
40
|
-
"x": ["-left", "-right"],
|
|
41
|
-
"y": ["-top", "-bottom"],
|
|
42
|
-
"": [""],
|
|
43
|
-
"bs": ["-block-start"],
|
|
44
|
-
"be": ["-block-end"],
|
|
45
|
-
"is": ["-inline-start"],
|
|
46
|
-
"ie": ["-inline-end"],
|
|
47
|
-
"block": ["-block-start", "-block-end"],
|
|
48
|
-
"inline": ["-inline-start", "-inline-end"]
|
|
49
|
-
};
|
|
50
|
-
const insetMap = {
|
|
51
|
-
...directionMap,
|
|
52
|
-
s: ["-inset-inline-start"],
|
|
53
|
-
start: ["-inset-inline-start"],
|
|
54
|
-
e: ["-inset-inline-end"],
|
|
55
|
-
end: ["-inset-inline-end"],
|
|
56
|
-
bs: ["-inset-block-start"],
|
|
57
|
-
be: ["-inset-block-end"],
|
|
58
|
-
is: ["-inset-inline-start"],
|
|
59
|
-
ie: ["-inset-inline-end"],
|
|
60
|
-
block: ["-inset-block-start", "-inset-block-end"],
|
|
61
|
-
inline: ["-inset-inline-start", "-inset-inline-end"]
|
|
62
|
-
};
|
|
63
23
|
const basePositionMap = [
|
|
64
24
|
"top",
|
|
65
25
|
"top center",
|
|
@@ -84,7 +44,7 @@ const basePositionMap = [
|
|
|
84
44
|
"center right",
|
|
85
45
|
"center center"
|
|
86
46
|
];
|
|
87
|
-
|
|
47
|
+
Object.assign({}, ...basePositionMap.map((p) => ({ [p.replace(/ /, "-")]: p })), ...basePositionMap.map((p) => ({ [p.replace(/\b(\w)\w+/g, "$1").replace(/ /, "")]: p })));
|
|
88
48
|
const globalKeywords = [
|
|
89
49
|
"inherit",
|
|
90
50
|
"initial",
|
|
@@ -92,7 +52,6 @@ const globalKeywords = [
|
|
|
92
52
|
"revert-layer",
|
|
93
53
|
"unset"
|
|
94
54
|
];
|
|
95
|
-
|
|
96
55
|
//#endregion
|
|
97
56
|
//#region ../../packages-presets/preset-mini/src/_utils/handlers/regex.ts
|
|
98
57
|
const numberWithUnitRE = /^(-?\d*(?:\.\d+)?)(px|pt|pc|%|r?(?:em|ex|lh|cap|ch|ic)|(?:[sld]?v|cq)(?:[whib]|min|max)|in|cm|mm|rpx)?$/i;
|
|
@@ -110,7 +69,6 @@ const unitOnlyMap = {
|
|
|
110
69
|
lvw: 100
|
|
111
70
|
};
|
|
112
71
|
const bracketTypeRe = /^\[(color|image|length|size|position|quoted|string):/i;
|
|
113
|
-
|
|
114
72
|
//#endregion
|
|
115
73
|
//#region ../../packages-presets/preset-mini/src/_utils/handlers/handlers.ts
|
|
116
74
|
var handlers_exports = /* @__PURE__ */ __exportAll({
|
|
@@ -269,11 +227,11 @@ function bracketWithType(str, requiredType) {
|
|
|
269
227
|
case "string": return base.replace(/(^|[^\\])_/g, "$1 ").replace(/\\_/g, "_");
|
|
270
228
|
case "quoted": return base.replace(/(^|[^\\])_/g, "$1 ").replace(/\\_/g, "_").replace(/(["\\])/g, "\\$1").replace(/^(.+)$/, "\"$1\"");
|
|
271
229
|
}
|
|
272
|
-
return base.replace(/(url\(.*?\))/g, (v) => v.replace(/_/g, "\\_")).replace(/(^|[^\\])_/g, "$1 ").replace(/\\_/g, "_").replace(/(?:calc|clamp|max|min)\((.*)/g, (match
|
|
230
|
+
return base.replace(/(url\(.*?\))/g, (v) => v.replace(/_/g, "\\_")).replace(/(^|[^\\])_/g, "$1 ").replace(/\\_/g, "_").replace(/(?:calc|clamp|max|min)\((.*)/g, (match) => {
|
|
273
231
|
const vars = [];
|
|
274
|
-
return match
|
|
232
|
+
return match.replace(/var\((--.+?)[,)]/g, (match, g1) => {
|
|
275
233
|
vars.push(g1);
|
|
276
|
-
return match
|
|
234
|
+
return match.replace(g1, "--un-calc");
|
|
277
235
|
}).replace(/(-?\d*\.?\d(?!-\d.+[,)](?![^+\-/*])\D)(?:%|[a-z]+)?|\))([+\-/*])/g, "$1 $2 ").replace(/--un-calc/g, () => vars.shift());
|
|
278
236
|
});
|
|
279
237
|
}
|
|
@@ -331,12 +289,7 @@ function position(str) {
|
|
|
331
289
|
"center"
|
|
332
290
|
].includes(str)) return str;
|
|
333
291
|
}
|
|
334
|
-
|
|
335
|
-
//#endregion
|
|
336
|
-
//#region ../../packages-presets/preset-mini/src/_utils/handlers/index.ts
|
|
337
|
-
const handler = createValueHandler(handlers_exports);
|
|
338
|
-
const h = handler;
|
|
339
|
-
|
|
292
|
+
const h = createValueHandler(handlers_exports);
|
|
340
293
|
//#endregion
|
|
341
294
|
//#region ../../packages-presets/preset-mini/src/_utils/utilities.ts
|
|
342
295
|
function getThemeColorForKey(theme, colors, key = "colors") {
|
|
@@ -393,13 +346,13 @@ function parseColor(body, theme, key) {
|
|
|
393
346
|
const [name] = colors;
|
|
394
347
|
if (!name) return;
|
|
395
348
|
let color;
|
|
396
|
-
const bracket
|
|
397
|
-
const bracketOrMain = bracket
|
|
349
|
+
const bracket = h.bracketOfColor(main);
|
|
350
|
+
const bracketOrMain = bracket || main;
|
|
398
351
|
if (h.numberWithUnit(bracketOrMain)) return;
|
|
399
352
|
if (/^#[\da-f]+$/i.test(bracketOrMain)) color = bracketOrMain;
|
|
400
353
|
else if (/^hex-[\da-fA-F]+$/.test(bracketOrMain)) color = `#${bracketOrMain.slice(4)}`;
|
|
401
354
|
else if (main.startsWith("$")) color = h.cssvar(main);
|
|
402
|
-
color = color || bracket
|
|
355
|
+
color = color || bracket;
|
|
403
356
|
if (!color) {
|
|
404
357
|
const colorData = getThemeColor(theme, [main], key);
|
|
405
358
|
if (typeof colorData === "string") color = colorData;
|
|
@@ -426,7 +379,6 @@ function parseColor(body, theme, key) {
|
|
|
426
379
|
alpha: h.bracket.cssvar.percent(opacity ?? "")
|
|
427
380
|
};
|
|
428
381
|
}
|
|
429
|
-
|
|
430
382
|
//#endregion
|
|
431
383
|
//#region src/categories.ts
|
|
432
384
|
const staticUtilities = {
|
|
@@ -733,13 +685,11 @@ const dynamicUtilities = {
|
|
|
733
685
|
backdrop: "filter",
|
|
734
686
|
invert: "filter"
|
|
735
687
|
};
|
|
736
|
-
|
|
737
688
|
//#endregion
|
|
738
689
|
//#region src/utils.ts
|
|
739
690
|
function getSelectorCategory(selector) {
|
|
740
|
-
return staticUtilities[selector] || Object.entries(dynamicUtilities).find(([name]) =>
|
|
691
|
+
return staticUtilities[selector] || Object.entries(dynamicUtilities).find(([name]) => new RegExp(`^${name}+(-.+|[0-9]+)$`).test(selector))?.[1];
|
|
741
692
|
}
|
|
742
|
-
|
|
743
693
|
//#endregion
|
|
744
694
|
//#region src/analyzer.ts
|
|
745
695
|
const ignoredColors = [
|
|
@@ -783,7 +733,7 @@ async function analyzer(modules, ctx) {
|
|
|
783
733
|
const layer = ruleMeta?.layer || "default";
|
|
784
734
|
if (baseSelector) {
|
|
785
735
|
const category = layer !== "default" ? layer : getSelectorCategory(baseSelector);
|
|
786
|
-
const body
|
|
736
|
+
const body = baseSelector.replace(/^ring-offset|outline-solid|outline-dotted/, "head").replace(/^\w+-/, "");
|
|
787
737
|
if (category === "icons") {
|
|
788
738
|
const existing = icons.find((i) => i.baseSelector === baseSelector);
|
|
789
739
|
if (existing) {
|
|
@@ -798,11 +748,11 @@ async function analyzer(modules, ctx) {
|
|
|
798
748
|
count,
|
|
799
749
|
ruleMeta,
|
|
800
750
|
modules: _modules,
|
|
801
|
-
body
|
|
751
|
+
body
|
|
802
752
|
});
|
|
803
753
|
continue;
|
|
804
754
|
}
|
|
805
|
-
const parsedColor = parseColor(body
|
|
755
|
+
const parsedColor = parseColor(body, ctx.uno.config.theme, "colors");
|
|
806
756
|
if (parsedColor?.color && !ignoredColors.includes(parsedColor?.color)) {
|
|
807
757
|
const existing = colors.find((c) => c.name === parsedColor.name && c.no === parsedColor.no);
|
|
808
758
|
if (existing) {
|
|
@@ -817,7 +767,7 @@ async function analyzer(modules, ctx) {
|
|
|
817
767
|
rawSelector,
|
|
818
768
|
category: category || "",
|
|
819
769
|
variants,
|
|
820
|
-
body
|
|
770
|
+
body
|
|
821
771
|
});
|
|
822
772
|
}
|
|
823
773
|
if (category) {
|
|
@@ -830,7 +780,7 @@ async function analyzer(modules, ctx) {
|
|
|
830
780
|
count,
|
|
831
781
|
ruleMeta,
|
|
832
782
|
modules: _modules,
|
|
833
|
-
body
|
|
783
|
+
body
|
|
834
784
|
});
|
|
835
785
|
continue;
|
|
836
786
|
}
|
|
@@ -850,7 +800,6 @@ async function analyzer(modules, ctx) {
|
|
|
850
800
|
icons
|
|
851
801
|
};
|
|
852
802
|
}
|
|
853
|
-
|
|
854
803
|
//#endregion
|
|
855
804
|
//#region src/index.ts
|
|
856
805
|
const _dirname = typeof __dirname !== "undefined" ? __dirname : dirname(fileURLToPath(import.meta.url));
|
|
@@ -945,23 +894,13 @@ function UnocssInspector(ctx) {
|
|
|
945
894
|
}
|
|
946
895
|
next();
|
|
947
896
|
});
|
|
948
|
-
const _printUrls = server.printUrls;
|
|
949
|
-
const colorUrl = (url) => cyan(url.replace(/:(\d+)\//, (_, port) => `:${bold(port)}/`));
|
|
950
|
-
server.printUrls = () => {
|
|
951
|
-
_printUrls();
|
|
952
|
-
for (const localUrl of server.resolvedUrls?.local ?? []) {
|
|
953
|
-
const appUrl = localUrl.endsWith("/") ? localUrl : `${localUrl}/`;
|
|
954
|
-
const inspectorUrl = `${server.config.base && appUrl.endsWith(server.config.base) ? appUrl.slice(0, -server.config.base.length) : appUrl.slice(0, -1)}/${baseUrl}/`;
|
|
955
|
-
console.log(` ${green("➜")} ${bold("UnoCSS Inspector")}: ${colorUrl(`${inspectorUrl}`)}`);
|
|
956
|
-
}
|
|
957
|
-
};
|
|
958
897
|
}
|
|
959
898
|
return {
|
|
960
899
|
name: "unocss:inspector",
|
|
961
900
|
apply: "serve",
|
|
962
901
|
configureServer,
|
|
963
|
-
devtools: { setup(ctx
|
|
964
|
-
ctx
|
|
902
|
+
devtools: { setup(ctx) {
|
|
903
|
+
ctx.docks.register({
|
|
965
904
|
id: "unocss",
|
|
966
905
|
title: "UnoCSS",
|
|
967
906
|
icon: "https://unocss.dev/logo.svg",
|
|
@@ -981,6 +920,5 @@ function getCircularReplacer() {
|
|
|
981
920
|
return value;
|
|
982
921
|
};
|
|
983
922
|
}
|
|
984
|
-
|
|
985
923
|
//#endregion
|
|
986
|
-
export { UnocssInspector as default };
|
|
924
|
+
export { UnocssInspector as default };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unocss/inspector",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "66.6.
|
|
4
|
+
"version": "66.6.8",
|
|
5
5
|
"description": "The inspector UI for UnoCSS",
|
|
6
6
|
"author": "Anthony Fu <anthonyfu117@hotmail.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -33,8 +33,8 @@
|
|
|
33
33
|
"colorette": "^2.0.20",
|
|
34
34
|
"gzip-size": "^6.0.0",
|
|
35
35
|
"sirv": "^3.0.2",
|
|
36
|
-
"@unocss/core": "66.6.
|
|
37
|
-
"@unocss/rule-utils": "66.6.
|
|
36
|
+
"@unocss/core": "66.6.8",
|
|
37
|
+
"@unocss/rule-utils": "66.6.8"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@vitejs/devtools-kit": "^0.0.0-alpha.10",
|
|
@@ -44,6 +44,7 @@
|
|
|
44
44
|
"build": "tsdown --config-loader unrun",
|
|
45
45
|
"build-post": "vite build",
|
|
46
46
|
"dev": "tsdown --config-loader unrun --watch",
|
|
47
|
+
"dev:client": "vite",
|
|
47
48
|
"update-post": "vite build"
|
|
48
49
|
}
|
|
49
50
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{s as q,t as B,x as G,d as W,y as H,u as J,z as K,j as l,o as k,c as w,g as _,w as V,e as p,A as L,k as R,B as E,C as F,D as Q,i as M,_ as X,E as z,m as Y,n as O,l as Z,h as tt,v as et,P as rt,q as j,F as st,r as C,G as lt,H as nt,I as at,J as ot}from"./index-BYGoiv1F.js";const D=/^(?!.*\[[^:]+:.+\]$)((?:.+:)?!?)(.*)$/;function it(e={}){const h=e.prefix??"un-",s=e.prefixedOnly??!1,g=e.trueToNonValued??!1;let i;return{name:"attributify",match(n,{generator:b}){const a=G(n);if(!a)return;let r=a[1];if(r.startsWith(h))r=r.slice(h.length);else if(s)return;const u=a[2],[,d="",f=u]=u.match(D)||[];if(f==="~"||g&&f==="true"||!f)return`${d}${r}`;if(i==null){const c=b?.config?.separators?.join("|");c?i=new RegExp(`^(.*\\](?:${c}))(\\[[^\\]]+?\\])$`):i=!1}if(i){const[,c,t]=u.match(i)||[];if(t)return`${c}${d}${r}-${t}`}if(d&&f.match(/^[\d.]+$/)){const c=d.split(/([^:]*:)/g).filter(Boolean),t=c.pop()+f,o=c.join("");return[{matcher:`${d}${r}-${f}`},{matcher:`${o}${r}-${t}`}]}return`${d}${r}-${f}`}}}const ct=/(<\w[\w:.$-]*\s)((?:'[^>']*'|"[^>"]*"|`[^>`]*`|\{[^>}]*\}|[^>]*?)*)/g,ut=/(\?|(?!\d|-{2}|-\d)[\w\u00A0-\uFFFF-:%]+)(?:=("[^"]*|'[^']*))?/g,I=/[\s'"`;>]+/;function dt(e){return{name:"attributify",extract:({content:h,cursor:s})=>{const g=h.matchAll(ct);let i,n=0;for(const m of g){const[,x,v]=m,A=m.index+x.length;if(s>A&&s<=A+v.length){n=A,i=v;break}}if(!i)return null;const b=i.matchAll(ut);let a=0,r,u;for(const m of b){const[x,v,A]=m,P=n+m.index;if(s>P&&s<=P+x.length){a=P,r=v,u=A?.slice(1);break}}if(!r||r==="class"||r==="className"||r===":class")return null;const d=!!e?.prefix&&r.startsWith(e.prefix);if(e?.prefixedOnly&&!d)return null;const f=d?r.slice(e.prefix.length):r;if(u===void 0)return{extracted:f,resolveReplacement(m){const x=d?e.prefix.length:0;return{start:a+x,end:a+r.length,replacement:m}}};const c=a+r.length+2;let t=I.exec(u),o=0,$;for(;t;){const[m]=t;if(s>c+o&&s<=c+o+t.index){$=u.slice(o,o+t.index);break}o+=t.index+m.length,t=I.exec(u.slice(o))}$===void 0&&($=u.slice(o));const[,y="",S]=$.match(D)||[];return{extracted:`${y}${f}-${S}`,transformSuggestions(m){return m.filter(x=>x.startsWith(`${y}${f}-`)).map(x=>y+x.slice(y.length+f.length+1))},resolveReplacement(m){return{start:o+c,end:o+c+$.length,replacement:y+m.slice(y.length+f.length+1)}}}}}}const ft=["v-bind:",":"],T=/[\s'"`;]+/g,N=/<[^>\s]*\s((?:'[^']*'|"[^"]*"|`[^`]*`|\{[^}]*\}|=>|[^>]*?)*)/g,mt=/(\?|(?!\d|-{2}|-\d)[\w\u00A0-\uFFFF:!%.~<-]+)=?(?:"([^"]*)"|'([^']*)'|\{([^}]*)\})?/g,U=["placeholder","fill","opacity","stroke-opacity"];function pt(e){const h=e?.ignoreAttributes??U,s=e?.nonValuedAttribute??!0,g=e?.trueToNonValued??!1;return{name:"@unocss/preset-attributify/extractor",extract({code:i}){return Array.from(i.matchAll(N)).flatMap(n=>Array.from((n[1]||"").matchAll(mt))).flatMap(([,n,...b])=>{const a=b.filter(Boolean).join("");if(h.includes(n))return[];for(const r of ft)if(n.startsWith(r)){n=n.slice(r.length);break}if(!a){if(B(n)&&s!==!1){const r=[`[${n}=""]`];return g&&r.push(`[${n}="true"]`),r}return[]}return["class","className"].includes(n)?a.split(T).filter(B):N.test(a)?(N.lastIndex=0,this.extract({code:a})):e?.prefixedOnly&&e.prefix&&!n.startsWith(e.prefix)?[]:a.split(T).filter(r=>!!r&&r!==":").map(r=>`[${n}~="${r}"]`)})}}}const ht=q((e={})=>(e.strict=e.strict??!1,e.prefix=e.prefix??"un-",e.prefixedOnly=e.prefixedOnly??!1,e.nonValuedAttribute=e.nonValuedAttribute??!0,e.ignoreAttributes=e.ignoreAttributes??U,{name:"@unocss/preset-attributify",enforce:"post",variants:[it(e)],extractors:[pt(e)],options:e,autocomplete:{extractors:[dt(e)]},extractorDefault:e.strict?!1:void 0}));var xt=ht;const yt={key:0,"h-full":"","of-hidden":"",flex:"","flex-col":""},vt={p:"4",grid:"~ cols-4 gap-4"},_t={key:0,"row-span-3":""},gt={key:0,"h-full":"","of-hidden":""},$t=W({__name:"ModuleInfo",props:{id:{}},setup(e){const h=e,{data:s}=H(at(h,"id")),g=h.id.split(/\./g).pop(),i=C(null),n=J(i,"module-scrolls");function b(){fetch(`/__open-in-editor?file=${encodeURIComponent(h.id)}`)}const{extractors:a}=xt({strict:!0}),r=K(async()=>{const c=new Set;if(a){const t={code:s.value?.code||""};for(const o of a)(await o.extract(t))?.forEach(y=>c.add(y))}return Array.from(c).filter(t=>!t.startsWith("[")).filter(t=>!s.value?.matched?.some(({rawSelector:o})=>o===t))},[]),u=C(!1),d=C("source"),f=lt(nt(()=>s.value?.css),u);return(c,t)=>{const o=L,$=Q,y=X,S=Y,m=Z,x=st;return l(s)?(k(),w("div",yt,[_(y,{ref_key:"status",ref:i,p0:""},{default:V(()=>[p("div",vt,[p("div",null,[t[3]||(t[3]=p("div",{op50:""}," Module ",-1)),p("a",{"cursor-pointer":"",op80:"","hover:op100":"",onClick:b},[_(o,{id:l(s).id,"mr-1":""},null,8,["id"]),t[2]||(t[2]=p("div",{"i-carbon-launch":""},null,-1))])]),p("div",null,[t[4]||(t[4]=p("div",{op50:""}," Matched Rules ",-1)),R(" "+E(l(s).matched.length),1)]),p("div",null,[t[5]||(t[5]=p("div",{op50:""}," CSS Size ",-1)),R(" "+E(((l(s)?.gzipSize||0)/1024).toFixed(2))+" KiB ",1),t[6]||(t[6]=p("span",{op50:""},"gzipped",-1))]),l(r).length?(k(),w("div",_t,[t[7]||(t[7]=p("div",{op50:""}," Potentially Unmatched ",-1)),p("code",null,E(l(r).join(", ")),1)])):F("",!0)]),_($,{modelValue:l(d),"onUpdate:modelValue":t[0]||(t[0]=v=>M(d)?d.value=v:null)},null,8,["modelValue"])]),_:1},512),l(d)==="source"?(k(),w("div",gt,[_(l(rt),null,{default:V(()=>[_(l(z),{size:"50"},{default:V(()=>[_(S,{"h-full":"","model-value":l(s).code,"read-only":!0,mode:l(g),matched:l(s).matched?.map(({rawSelector:v})=>v),class:"scrolls module-scrolls",style:O(l(n))},null,8,["model-value","mode","matched","style"])]),_:1}),_(l(z),{size:"50"},{default:V(()=>[p("div",null,[_(m,{border:"l b gray-400/20",title:"Output CSS"},{default:V(()=>[p("label",null,[tt(p("input",{"onUpdate:modelValue":t[1]||(t[1]=v=>M(u)?u.value=v:null),type:"checkbox"},null,512),[[et,l(u)]]),t[8]||(t[8]=R(" Prettify ",-1))])]),_:1}),_(S,{"h-full":"",border:"l main","model-value":l(f),"read-only":!0,mode:"css",class:"scrolls module-scrolls",style:O(l(n))},null,8,["model-value","style"])])]),_:1})]),_:1})])):(k(),j(x,{key:1,"flex-grow":"","overflow-y-auto":"",selectors:l(s).matched,icons:l(s).icons,colors:l(s).colors},null,8,["selectors","icons","colors"]))])):F("",!0)}}}),At=W({__name:"[id]",setup(e){const h=ot();return(s,g)=>{const i=$t;return k(),j(i,{id:l(h).params.id},null,8,["id"])}}});export{At as default};
|