@unocss/inspector 66.5.12 → 66.6.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/_id_-CiHreCiF.js +1 -0
- package/dist/client/assets/{index-BkmnCE1Z.css → index-BejX0p-D.css} +1 -1
- package/dist/client/assets/index-JjKgwI2w.js +276 -0
- package/dist/client/assets/{repl-BIt4bgB9.js → repl-CNmsOEK1.js} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/index.mjs +2 -257
- package/package.json +3 -3
- package/dist/client/assets/_id_-CsSushaL.js +0 -1
- package/dist/client/assets/index-DinBrh4X.js +0 -276
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{d as g,r as h,u as x,a as S,b,f as k,c as V,o as _,e as s,g as a,w as i,_ as B,h as w,i as C,j as m,v as R,k as l,l as P,n as p,m as E,p as N,q as U}from"./index-
|
|
1
|
+
import{d as g,r as h,u as x,a as S,b,f as k,c as V,o as _,e as s,g as a,w as i,_ as B,h as w,i as C,j as m,v as R,k as l,l as P,n as p,m as E,p as N,q as U}from"./index-JjKgwI2w.js";const $={"h-full":"",grid:"~ rows-[max-content_1fr]","of-hidden":""},I={"h-full":"","of-hidden":"",grid:"","grid-cols-2":""},L=g({__name:"ReplPlayground",setup(f){const r=h(null),t=x(r,"repl-scrolls"),o=S("unocss:inspector:repl",`<div class="text-sm hover:text-red">
|
|
2
2
|
Hello World
|
|
3
3
|
</div>`),n=b("unocss-inspector-safelist",!1),{data:c}=k(o,n);return(j,e)=>{const y=B,v=P,u=E;return _(),V("div",$,[s("div",{ref_key:"status",ref:r},[a(y,null,{default:i(()=>[...e[2]||(e[2]=[s("div",null," REPL Playground ",-1),s("div",{op60:""}," Edit your code below to test and play UnoCSS's matching and generating. ",-1)])]),_:1}),a(v,{border:"b gray-400/20",title:""},{default:i(()=>[s("label",null,[w(s("input",{"onUpdate:modelValue":e[0]||(e[0]=d=>m(n)?n.value=d:null),type:"checkbox"},null,512),[[R,l(n)]]),e[3]||(e[3]=C(" Include safelist ",-1))])]),_:1})],512),s("div",I,[a(u,{modelValue:l(o),"onUpdate:modelValue":e[1]||(e[1]=d=>m(o)?o.value=d:null),mode:"html",matched:l(c)?.matched||[],class:"scrolls repl-scrolls",style:p(l(t))},null,8,["modelValue","matched","style"]),a(u,{border:"l main","model-value":l(c)?.css||"/* empty */","read-only":!0,mode:"css",class:"scrolls repl-scrolls",style:p(l(t))},null,8,["model-value","style"])])])}}}),M={};function T(f,r){const t=L;return _(),U(t)}const z=N(M,[["render",T]]);export{z as default};
|
package/dist/client/index.html
CHANGED
|
@@ -11,8 +11,8 @@
|
|
|
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="stylesheet" crossorigin href="/__unocss/assets/index-
|
|
14
|
+
<script type="module" crossorigin src="/__unocss/assets/index-JjKgwI2w.js"></script>
|
|
15
|
+
<link rel="stylesheet" crossorigin href="/__unocss/assets/index-BejX0p-D.css">
|
|
16
16
|
</head>
|
|
17
17
|
<body>
|
|
18
18
|
<div id="app"></div>
|
package/dist/index.mjs
CHANGED
|
@@ -1,16 +1,13 @@
|
|
|
1
1
|
import { dirname, resolve } from "node:path";
|
|
2
2
|
import { fileURLToPath } from "node:url";
|
|
3
|
-
import { BetterMap, CountableSet, escapeSelector
|
|
3
|
+
import { BetterMap, CountableSet, escapeSelector } from "@unocss/core";
|
|
4
4
|
import { bold, cyan, green } from "colorette";
|
|
5
5
|
import gzipSize from "gzip-size";
|
|
6
6
|
import sirv from "sirv";
|
|
7
|
-
import {
|
|
7
|
+
import { createValueHandler, getStringComponent, parseCssColor } from "@unocss/rule-utils";
|
|
8
8
|
|
|
9
9
|
//#region rolldown:runtime
|
|
10
10
|
var __defProp = Object.defineProperty;
|
|
11
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
12
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
13
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
14
11
|
var __exportAll = (all, symbols) => {
|
|
15
12
|
let target = {};
|
|
16
13
|
for (var name in all) {
|
|
@@ -24,21 +21,6 @@ var __exportAll = (all, symbols) => {
|
|
|
24
21
|
}
|
|
25
22
|
return target;
|
|
26
23
|
};
|
|
27
|
-
var __copyProps = (to, from, except, desc) => {
|
|
28
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
29
|
-
for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
30
|
-
key = keys[i];
|
|
31
|
-
if (!__hasOwnProp.call(to, key) && key !== except) {
|
|
32
|
-
__defProp(to, key, {
|
|
33
|
-
get: ((k) => from[k]).bind(null, key),
|
|
34
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
return to;
|
|
40
|
-
};
|
|
41
|
-
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
42
24
|
|
|
43
25
|
//#endregion
|
|
44
26
|
//#region ../../virtual-shared/integration/src/constants.ts
|
|
@@ -78,50 +60,6 @@ const insetMap = {
|
|
|
78
60
|
block: ["-inset-block-start", "-inset-block-end"],
|
|
79
61
|
inline: ["-inset-inline-start", "-inset-inline-end"]
|
|
80
62
|
};
|
|
81
|
-
const cornerMap = {
|
|
82
|
-
"l": ["-top-left", "-bottom-left"],
|
|
83
|
-
"r": ["-top-right", "-bottom-right"],
|
|
84
|
-
"t": ["-top-left", "-top-right"],
|
|
85
|
-
"b": ["-bottom-left", "-bottom-right"],
|
|
86
|
-
"tl": ["-top-left"],
|
|
87
|
-
"lt": ["-top-left"],
|
|
88
|
-
"tr": ["-top-right"],
|
|
89
|
-
"rt": ["-top-right"],
|
|
90
|
-
"bl": ["-bottom-left"],
|
|
91
|
-
"lb": ["-bottom-left"],
|
|
92
|
-
"br": ["-bottom-right"],
|
|
93
|
-
"rb": ["-bottom-right"],
|
|
94
|
-
"": [""],
|
|
95
|
-
"bs": ["-start-start", "-start-end"],
|
|
96
|
-
"be": ["-end-start", "-end-end"],
|
|
97
|
-
"s": ["-end-start", "-start-start"],
|
|
98
|
-
"is": ["-end-start", "-start-start"],
|
|
99
|
-
"e": ["-start-end", "-end-end"],
|
|
100
|
-
"ie": ["-start-end", "-end-end"],
|
|
101
|
-
"ss": ["-start-start"],
|
|
102
|
-
"bs-is": ["-start-start"],
|
|
103
|
-
"is-bs": ["-start-start"],
|
|
104
|
-
"se": ["-start-end"],
|
|
105
|
-
"bs-ie": ["-start-end"],
|
|
106
|
-
"ie-bs": ["-start-end"],
|
|
107
|
-
"es": ["-end-start"],
|
|
108
|
-
"be-is": ["-end-start"],
|
|
109
|
-
"is-be": ["-end-start"],
|
|
110
|
-
"ee": ["-end-end"],
|
|
111
|
-
"be-ie": ["-end-end"],
|
|
112
|
-
"ie-be": ["-end-end"]
|
|
113
|
-
};
|
|
114
|
-
const xyzMap = {
|
|
115
|
-
"x": ["-x"],
|
|
116
|
-
"y": ["-y"],
|
|
117
|
-
"z": ["-z"],
|
|
118
|
-
"": ["-x", "-y"]
|
|
119
|
-
};
|
|
120
|
-
const xyzArray = [
|
|
121
|
-
"x",
|
|
122
|
-
"y",
|
|
123
|
-
"z"
|
|
124
|
-
];
|
|
125
63
|
const basePositionMap = [
|
|
126
64
|
"top",
|
|
127
65
|
"top center",
|
|
@@ -154,8 +92,6 @@ const globalKeywords = [
|
|
|
154
92
|
"revert-layer",
|
|
155
93
|
"unset"
|
|
156
94
|
];
|
|
157
|
-
const cssMathFnRE = /^(calc|clamp|min|max)\s*\((.+)\)(.*)/;
|
|
158
|
-
const cssVarFnRE = /^(var)\s*\((.+)\)(.*)/;
|
|
159
95
|
|
|
160
96
|
//#endregion
|
|
161
97
|
//#region ../../packages-presets/preset-mini/src/_utils/handlers/regex.ts
|
|
@@ -174,7 +110,6 @@ const unitOnlyMap = {
|
|
|
174
110
|
lvw: 100
|
|
175
111
|
};
|
|
176
112
|
const bracketTypeRe = /^\[(color|image|length|size|position|quoted|string):/i;
|
|
177
|
-
const splitComma = /,(?![^()]*\))/g;
|
|
178
113
|
|
|
179
114
|
//#endregion
|
|
180
115
|
//#region ../../packages-presets/preset-mini/src/_utils/handlers/handlers.ts
|
|
@@ -401,23 +336,6 @@ const h = handler;
|
|
|
401
336
|
|
|
402
337
|
//#endregion
|
|
403
338
|
//#region ../../packages-presets/preset-mini/src/_utils/utilities.ts
|
|
404
|
-
const CONTROL_MINI_NO_NEGATIVE = "$$mini-no-negative";
|
|
405
|
-
/**
|
|
406
|
-
* Provide {@link DynamicMatcher} function returning spacing definition. See spacing rules.
|
|
407
|
-
*
|
|
408
|
-
* @param propertyPrefix - Property for the css value to be created. Postfix will be appended according to direction matched.
|
|
409
|
-
* @see {@link directionMap}
|
|
410
|
-
*/
|
|
411
|
-
function directionSize(propertyPrefix) {
|
|
412
|
-
return ([_, direction, size], { theme }) => {
|
|
413
|
-
const v = theme.spacing?.[size || "DEFAULT"] ?? h.bracket.cssvar.global.auto.fraction.rem(size);
|
|
414
|
-
if (v != null) return directionMap[direction].map((i) => [`${propertyPrefix}${i}`, v]);
|
|
415
|
-
else if (size?.startsWith("-")) {
|
|
416
|
-
const v$1 = theme.spacing?.[size.slice(1)];
|
|
417
|
-
if (v$1 != null) return directionMap[direction].map((i) => [`${propertyPrefix}${i}`, `calc(${v$1} * -1)`]);
|
|
418
|
-
}
|
|
419
|
-
};
|
|
420
|
-
}
|
|
421
339
|
function getThemeColorForKey(theme, colors, key = "colors") {
|
|
422
340
|
const obj = theme[key];
|
|
423
341
|
function deepGet(current, path) {
|
|
@@ -505,179 +423,6 @@ function parseColor(body, theme, key) {
|
|
|
505
423
|
alpha: h.bracket.cssvar.percent(opacity ?? "")
|
|
506
424
|
};
|
|
507
425
|
}
|
|
508
|
-
/**
|
|
509
|
-
* Provide {@link DynamicMatcher} function to produce color value matched from rule.
|
|
510
|
-
*
|
|
511
|
-
* @see {@link parseColor}
|
|
512
|
-
*
|
|
513
|
-
* @example Resolving 'red' from theme:
|
|
514
|
-
* colorResolver('background-color', 'background')('', 'red')
|
|
515
|
-
* return { 'background-color': '#f12' }
|
|
516
|
-
*
|
|
517
|
-
* @example Resolving 'red-100' from theme:
|
|
518
|
-
* colorResolver('background-color', 'background')('', 'red-100')
|
|
519
|
-
* return { '--un-background-opacity': '1', 'background-color': 'rgb(254 226 226 / var(--un-background-opacity))' }
|
|
520
|
-
*
|
|
521
|
-
* @example Resolving 'red-100/20' from theme:
|
|
522
|
-
* colorResolver('background-color', 'background')('', 'red-100/20')
|
|
523
|
-
* return { 'background-color': 'rgb(204 251 241 / 0.22)' }
|
|
524
|
-
*
|
|
525
|
-
* @example Resolving 'hex-124':
|
|
526
|
-
* colorResolver('color', 'text')('', 'hex-124')
|
|
527
|
-
* return { '--un-text-opacity': '1', 'color': 'rgb(17 34 68 / var(--un-text-opacity))' }
|
|
528
|
-
*
|
|
529
|
-
* @param property - Property for the css value to be created.
|
|
530
|
-
* @param varName - Base name for the opacity variable.
|
|
531
|
-
* @param [key] - Theme key to select the color from.
|
|
532
|
-
* @param [shouldPass] - Function to decide whether to pass the css.
|
|
533
|
-
* @return object.
|
|
534
|
-
*/
|
|
535
|
-
function colorResolver(property, varName, key, shouldPass) {
|
|
536
|
-
return ([, body], { theme, generator }) => {
|
|
537
|
-
const data = parseColor(body ?? "", theme, key);
|
|
538
|
-
if (!data) return;
|
|
539
|
-
const { alpha, color, cssColor } = data;
|
|
540
|
-
const rawColorComment = generator.config.envMode === "dev" && color ? ` /* ${color} */` : "";
|
|
541
|
-
const css = {};
|
|
542
|
-
if (cssColor) if (alpha != null) css[property] = colorToString(cssColor, alpha) + rawColorComment;
|
|
543
|
-
else {
|
|
544
|
-
const opacityVar = `--un-${varName}-opacity`;
|
|
545
|
-
const result = colorToString(cssColor, `var(${opacityVar})`);
|
|
546
|
-
if (result.includes(opacityVar)) css[opacityVar] = colorOpacityToString(cssColor);
|
|
547
|
-
css[property] = result + rawColorComment;
|
|
548
|
-
}
|
|
549
|
-
else if (color) if (alpha != null) css[property] = colorToString(color, alpha) + rawColorComment;
|
|
550
|
-
else {
|
|
551
|
-
const opacityVar = `--un-${varName}-opacity`;
|
|
552
|
-
const result = colorToString(color, `var(${opacityVar})`);
|
|
553
|
-
if (result.includes(opacityVar)) css[opacityVar] = 1;
|
|
554
|
-
css[property] = result + rawColorComment;
|
|
555
|
-
}
|
|
556
|
-
if (shouldPass?.(css) !== false) return css;
|
|
557
|
-
};
|
|
558
|
-
}
|
|
559
|
-
function colorableShadows(shadows, colorVar) {
|
|
560
|
-
const colored = [];
|
|
561
|
-
shadows = toArray(shadows);
|
|
562
|
-
for (let i = 0; i < shadows.length; i++) {
|
|
563
|
-
const components = getStringComponents(shadows[i], " ", 6);
|
|
564
|
-
if (!components || components.length < 3) return shadows;
|
|
565
|
-
let isInset = false;
|
|
566
|
-
const pos = components.indexOf("inset");
|
|
567
|
-
if (pos !== -1) {
|
|
568
|
-
components.splice(pos, 1);
|
|
569
|
-
isInset = true;
|
|
570
|
-
}
|
|
571
|
-
let colorVarValue = "";
|
|
572
|
-
const lastComp = components.at(-1);
|
|
573
|
-
if (parseCssColor(components.at(0))) {
|
|
574
|
-
const color = parseCssColor(components.shift());
|
|
575
|
-
if (color) colorVarValue = `, ${colorToString(color)}`;
|
|
576
|
-
} else if (parseCssColor(lastComp)) {
|
|
577
|
-
const color = parseCssColor(components.pop());
|
|
578
|
-
if (color) colorVarValue = `, ${colorToString(color)}`;
|
|
579
|
-
} else if (lastComp && lastComp.startsWith("var(")) colorVarValue = `, ${components.pop()}`;
|
|
580
|
-
colored.push(`${isInset ? "inset " : ""}${components.join(" ")} var(${colorVar}${colorVarValue})`);
|
|
581
|
-
}
|
|
582
|
-
return colored;
|
|
583
|
-
}
|
|
584
|
-
function hasParseableColor(color, theme, key) {
|
|
585
|
-
return color != null && !!parseColor(color, theme, key)?.color;
|
|
586
|
-
}
|
|
587
|
-
const reLetters = /[a-z]+/gi;
|
|
588
|
-
const resolvedBreakpoints = /* @__PURE__ */ new WeakMap();
|
|
589
|
-
function resolveBreakpoints({ theme, generator }, key = "breakpoints") {
|
|
590
|
-
const breakpoints = (generator?.userConfig?.theme)?.[key] || theme[key];
|
|
591
|
-
if (!breakpoints) return void 0;
|
|
592
|
-
if (resolvedBreakpoints.has(theme)) return resolvedBreakpoints.get(theme);
|
|
593
|
-
const resolved = Object.entries(breakpoints).sort((a, b) => Number.parseInt(a[1].replace(reLetters, "")) - Number.parseInt(b[1].replace(reLetters, ""))).map(([point, size]) => ({
|
|
594
|
-
point,
|
|
595
|
-
size
|
|
596
|
-
}));
|
|
597
|
-
resolvedBreakpoints.set(theme, resolved);
|
|
598
|
-
return resolved;
|
|
599
|
-
}
|
|
600
|
-
function resolveVerticalBreakpoints(context) {
|
|
601
|
-
return resolveBreakpoints(context, "verticalBreakpoints");
|
|
602
|
-
}
|
|
603
|
-
function makeGlobalStaticRules(prefix, property) {
|
|
604
|
-
return globalKeywords.map((keyword) => [`${prefix}-${keyword}`, { [property ?? prefix]: keyword }]);
|
|
605
|
-
}
|
|
606
|
-
function isCSSMathFn(value) {
|
|
607
|
-
return value != null && cssMathFnRE.test(value);
|
|
608
|
-
}
|
|
609
|
-
function isSize(str) {
|
|
610
|
-
if (str[0] === "[" && str.slice(-1) === "]") str = str.slice(1, -1);
|
|
611
|
-
return cssMathFnRE.test(str) || numberWithUnitRE.test(str);
|
|
612
|
-
}
|
|
613
|
-
function transformXYZ(d, v, name) {
|
|
614
|
-
const values = v.split(splitComma);
|
|
615
|
-
if (d || !d && values.length === 1) return xyzMap[d].map((i) => [`--un-${name}${i}`, v]);
|
|
616
|
-
return values.map((v$1, i) => [`--un-${name}-${xyzArray[i]}`, v$1]);
|
|
617
|
-
}
|
|
618
|
-
|
|
619
|
-
//#endregion
|
|
620
|
-
//#region ../../packages-presets/preset-mini/src/_utils/index.ts
|
|
621
|
-
var _utils_exports = /* @__PURE__ */ __exportAll({
|
|
622
|
-
CONTROL_MINI_NO_NEGATIVE: () => CONTROL_MINI_NO_NEGATIVE,
|
|
623
|
-
colorResolver: () => colorResolver,
|
|
624
|
-
colorableShadows: () => colorableShadows,
|
|
625
|
-
cornerMap: () => cornerMap,
|
|
626
|
-
cssMathFnRE: () => cssMathFnRE,
|
|
627
|
-
cssVarFnRE: () => cssVarFnRE,
|
|
628
|
-
directionMap: () => directionMap,
|
|
629
|
-
directionSize: () => directionSize,
|
|
630
|
-
globalKeywords: () => globalKeywords,
|
|
631
|
-
h: () => h,
|
|
632
|
-
handler: () => handler,
|
|
633
|
-
hasParseableColor: () => hasParseableColor,
|
|
634
|
-
insetMap: () => insetMap,
|
|
635
|
-
isCSSMathFn: () => isCSSMathFn,
|
|
636
|
-
isSize: () => isSize,
|
|
637
|
-
makeGlobalStaticRules: () => makeGlobalStaticRules,
|
|
638
|
-
parseColor: () => parseColor,
|
|
639
|
-
positionMap: () => positionMap,
|
|
640
|
-
resolveBreakpoints: () => resolveBreakpoints,
|
|
641
|
-
resolveVerticalBreakpoints: () => resolveVerticalBreakpoints,
|
|
642
|
-
splitShorthand: () => splitShorthand,
|
|
643
|
-
transformXYZ: () => transformXYZ,
|
|
644
|
-
valueHandlers: () => handlers_exports,
|
|
645
|
-
xyzArray: () => xyzArray,
|
|
646
|
-
xyzMap: () => xyzMap
|
|
647
|
-
});
|
|
648
|
-
import * as import__unocss_rule_utils from "@unocss/rule-utils";
|
|
649
|
-
__reExport(_utils_exports, import__unocss_rule_utils);
|
|
650
|
-
|
|
651
|
-
//#endregion
|
|
652
|
-
//#region ../../packages-presets/preset-mini/src/utils.ts
|
|
653
|
-
var utils_exports = /* @__PURE__ */ __exportAll({
|
|
654
|
-
CONTROL_MINI_NO_NEGATIVE: () => CONTROL_MINI_NO_NEGATIVE,
|
|
655
|
-
colorResolver: () => colorResolver,
|
|
656
|
-
colorableShadows: () => colorableShadows,
|
|
657
|
-
cornerMap: () => cornerMap,
|
|
658
|
-
cssMathFnRE: () => cssMathFnRE,
|
|
659
|
-
cssVarFnRE: () => cssVarFnRE,
|
|
660
|
-
directionMap: () => directionMap,
|
|
661
|
-
directionSize: () => directionSize,
|
|
662
|
-
globalKeywords: () => globalKeywords,
|
|
663
|
-
h: () => h,
|
|
664
|
-
handler: () => handler,
|
|
665
|
-
hasParseableColor: () => hasParseableColor,
|
|
666
|
-
insetMap: () => insetMap,
|
|
667
|
-
isCSSMathFn: () => isCSSMathFn,
|
|
668
|
-
isSize: () => isSize,
|
|
669
|
-
makeGlobalStaticRules: () => makeGlobalStaticRules,
|
|
670
|
-
parseColor: () => parseColor,
|
|
671
|
-
positionMap: () => positionMap,
|
|
672
|
-
resolveBreakpoints: () => resolveBreakpoints,
|
|
673
|
-
resolveVerticalBreakpoints: () => resolveVerticalBreakpoints,
|
|
674
|
-
splitShorthand: () => splitShorthand,
|
|
675
|
-
transformXYZ: () => transformXYZ,
|
|
676
|
-
valueHandlers: () => handlers_exports,
|
|
677
|
-
xyzArray: () => xyzArray,
|
|
678
|
-
xyzMap: () => xyzMap
|
|
679
|
-
});
|
|
680
|
-
__reExport(utils_exports, _utils_exports);
|
|
681
426
|
|
|
682
427
|
//#endregion
|
|
683
428
|
//#region src/categories.ts
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unocss/inspector",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "66.
|
|
4
|
+
"version": "66.6.0-beta.1",
|
|
5
5
|
"description": "The inspector UI for UnoCSS",
|
|
6
6
|
"author": "Anthony Fu <anthonyfu117@hotmail.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -38,8 +38,8 @@
|
|
|
38
38
|
"gzip-size": "^6.0.0",
|
|
39
39
|
"sirv": "^3.0.2",
|
|
40
40
|
"vue-flow-layout": "^0.2.0",
|
|
41
|
-
"@unocss/
|
|
42
|
-
"@unocss/
|
|
41
|
+
"@unocss/core": "66.6.0-beta.1",
|
|
42
|
+
"@unocss/rule-utils": "66.6.0-beta.1"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@vitejs/devtools-kit": "^0.0.0-alpha.10"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{s as q,t as B,d as W,x as G,y as H,r as w,u as K,z as J,A as L,B as Q,c as E,C as F,k as l,o as k,g as _,q as j,w as V,e as p,D as X,i as R,E as C,F as Y,j as M,_ as Z,G as z,m as tt,n as O,l as et,h as rt,v as st,P as lt,H as nt,I as ot}from"./index-DinBrh4X.js";const D=/^(?!.*\[[^:]+:.+\]$)((?:.+:)?!?)(.*)$/;function at(e={}){const h=e.prefix??"un-",s=e.prefixedOnly??!1,y=e.trueToNonValued??!1;let i;return{name:"attributify",match(n,{generator:b}){const o=q(n);if(!o)return;let r=o[1];if(r.startsWith(h))r=r.slice(h.length);else if(s)return;const u=o[2],[,d="",f=u]=u.match(D)||[];if(f==="~"||y&&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,a=c.join("");return[{matcher:`${d}${r}-${f}`},{matcher:`${a}${r}-${t}`}]}return`${d}${r}-${f}`}}}const it=/(<\w[\w:.$-]*\s)((?:'[^>']*'|"[^>"]*"|`[^>`]*`|\{[^>}]*\}|[^>]*?)*)/g,ct=/(\?|(?!\d|-{2}|-\d)[\w\u00A0-\uFFFF-:%]+)(?:=("[^"]*|'[^']*))?/g,I=/[\s'"`;>]+/;function ut(e){return{name:"attributify",extract:({content:h,cursor:s})=>{const y=h.matchAll(it);let i,n=0;for(const m of y){const[,x,g]=m,A=m.index+x.length;if(s>A&&s<=A+g.length){n=A,i=g;break}}if(!i)return null;const b=i.matchAll(ct);let o=0,r,u;for(const m of b){const[x,g,A]=m,P=n+m.index;if(s>P&&s<=P+x.length){o=P,r=g,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:o+x,end:o+r.length,replacement:m}}};const c=o+r.length+2;let t=I.exec(u),a=0,$;for(;t;){const[m]=t;if(s>c+a&&s<=c+a+t.index){$=u.slice(a,a+t.index);break}a+=t.index+m.length,t=I.exec(u.slice(a))}$===void 0&&($=u.slice(a));const[,v="",S]=$.match(D)||[];return{extracted:`${v}${f}-${S}`,transformSuggestions(m){return m.filter(x=>x.startsWith(`${v}${f}-`)).map(x=>v+x.slice(v.length+f.length+1))},resolveReplacement(m){return{start:a+c,end:a+c+$.length,replacement:v+m.slice(v.length+f.length+1)}}}}}}const dt=["v-bind:",":"],T=/[\s'"`;]+/g,N=/<[^>\s]*\s((?:'[^']*'|"[^"]*"|`[^`]*`|\{[^}]*\}|=>|[^>]*?)*)/g,ft=/(\?|(?!\d|-{2}|-\d)[\w\u00A0-\uFFFF:!%.~<-]+)=?(?:"([^"]*)"|'([^']*)'|\{([^}]*)\})?/g,U=["placeholder","fill","opacity","stroke-opacity"];function mt(e){const h=e?.ignoreAttributes??U,s=e?.nonValuedAttribute??!0,y=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(ft))).flatMap(([,n,...b])=>{const o=b.filter(Boolean).join("");if(h.includes(n))return[];for(const r of dt)if(n.startsWith(r)){n=n.slice(r.length);break}if(!o){if(B(n)&&s!==!1){const r=[`[${n}=""]`];return y&&r.push(`[${n}="true"]`),r}return[]}return["class","className"].includes(n)?o.split(T).filter(B):N.test(o)?(N.lastIndex=0,this.extract({code:o})):e?.prefixedOnly&&e.prefix&&!n.startsWith(e.prefix)?[]:o.split(T).filter(r=>!!r&&r!==":").map(r=>`[${n}~="${r}"]`)})}}}const pt=(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;const h=[at(e)],s=[mt(e)],y=[ut(e)];return{name:"@unocss/preset-attributify",enforce:"post",variants:h,extractors:s,options:e,autocomplete:{extractors:y},extractorDefault:e.strict?!1:void 0}},ht={key:0,"h-full":"","of-hidden":"",flex:"","flex-col":""},xt={p:"4",grid:"~ cols-4 gap-4"},yt={key:0,"row-span-3":""},vt={key:0,"h-full":"","of-hidden":""},gt=W({__name:"ModuleInfo",props:{id:{}},setup(e){const h=e,{data:s}=G(H(h,"id")),y=h.id.split(/\./g).pop(),i=w(null),n=K(i,"module-scrolls");function b(){fetch(`/__open-in-editor?file=${encodeURIComponent(h.id)}`)}const{extractors:o}=pt({strict:!0}),r=J(async()=>{const c=new Set;if(o){const t={code:s.value?.code||""};for(const a of o)(await a.extract(t))?.forEach(v=>c.add(v))}return Array.from(c).filter(t=>!t.startsWith("[")).filter(t=>!s.value?.matched?.some(({rawSelector:a})=>a===t))},[]),u=w(!1),d=w("source"),f=L(Q(()=>s.value?.css),u);return(c,t)=>{const a=X,$=Y,v=Z,S=tt,m=et,x=nt;return l(s)?(k(),E("div",ht,[_(v,{ref_key:"status",ref:i,p0:""},{default:V(()=>[p("div",xt,[p("div",null,[t[3]||(t[3]=p("div",{op50:""}," Module ",-1)),p("a",{"cursor-pointer":"",op80:"","hover:op100":"",onClick:b},[_(a,{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(" "+C(l(s).matched.length),1)]),p("div",null,[t[5]||(t[5]=p("div",{op50:""}," CSS Size ",-1)),R(" "+C(((l(s)?.gzipSize||0)/1024).toFixed(2))+" KiB ",1),t[6]||(t[6]=p("span",{op50:""},"gzipped",-1))]),l(r).length?(k(),E("div",yt,[t[7]||(t[7]=p("div",{op50:""}," Potentially Unmatched ",-1)),p("code",null,C(l(r).join(", ")),1)])):F("",!0)]),_($,{modelValue:l(d),"onUpdate:modelValue":t[0]||(t[0]=g=>M(d)?d.value=g:null)},null,8,["modelValue"])]),_:1},512),l(d)==="source"?(k(),E("div",vt,[_(l(lt),null,{default:V(()=>[_(l(z),{size:"50"},{default:V(()=>[_(S,{"h-full":"","model-value":l(s).code,"read-only":!0,mode:l(y),matched:l(s).matched?.map(({rawSelector:g})=>g),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,[rt(p("input",{"onUpdate:modelValue":t[1]||(t[1]=g=>M(u)?u.value=g:null),type:"checkbox"},null,512),[[st,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)}}}),$t=W({__name:"[id]",setup(e){const h=ot();return(s,y)=>{const i=gt;return k(),j(i,{id:l(h).params.id},null,8,["id"])}}});export{$t as default};
|