@vesk/vesk-cli 0.2.95 → 0.2.96
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/cli.js +24 -1
- package/package.json +5 -5
package/dist/cli.js
CHANGED
|
@@ -3964,6 +3964,7 @@ function flattenLayoutChain(tree, pathParts, result = []) {
|
|
|
3964
3964
|
const remaining = pathParts.slice(consumeCount);
|
|
3965
3965
|
const isLeaf2 = remaining.length === 0 || remaining.every((p) => p === "");
|
|
3966
3966
|
if (node.standalone) result.length = 0;
|
|
3967
|
+
const marker = result.length;
|
|
3967
3968
|
result.push(node);
|
|
3968
3969
|
if (isLeaf2) {
|
|
3969
3970
|
if (!node.page && (node.children || []).length > 0) {
|
|
@@ -3973,8 +3974,17 @@ function flattenLayoutChain(tree, pathParts, result = []) {
|
|
|
3973
3974
|
}
|
|
3974
3975
|
break;
|
|
3975
3976
|
} else if ((node.children || []).length > 0) {
|
|
3977
|
+
const before = result.length;
|
|
3976
3978
|
flattenLayoutChain(node.children || [], remaining, result);
|
|
3979
|
+
if (result.length > before) break;
|
|
3980
|
+
if (node.isDynamic) {
|
|
3981
|
+
result.length = marker;
|
|
3982
|
+
continue;
|
|
3983
|
+
}
|
|
3977
3984
|
break;
|
|
3985
|
+
} else if (node.isDynamic) {
|
|
3986
|
+
result.length = marker;
|
|
3987
|
+
continue;
|
|
3978
3988
|
}
|
|
3979
3989
|
}
|
|
3980
3990
|
}
|
|
@@ -4523,7 +4533,8 @@ function Link(props, registry, hydrate) {
|
|
|
4523
4533
|
props.class ? `class="${String(props.class).replace(/"/g, """)}"` : "",
|
|
4524
4534
|
props.style ? `style="${String(props.style).replace(/"/g, """)}"` : "",
|
|
4525
4535
|
props.target ? `target="${String(props.target).replace(/"/g, """)}"` : "",
|
|
4526
|
-
props.rel ? `rel="${String(props.rel).replace(/"/g, """)}"` : ""
|
|
4536
|
+
props.rel ? `rel="${String(props.rel).replace(/"/g, """)}"` : "",
|
|
4537
|
+
...passThroughAttrs(props).map(([key, value]) => `${key}="${value.replace(/"/g, """)}"`)
|
|
4527
4538
|
].filter(Boolean).join(" ");
|
|
4528
4539
|
let childStr = "";
|
|
4529
4540
|
if (props.children != null) {
|
|
@@ -4554,6 +4565,17 @@ function Link(props, registry, hydrate) {
|
|
|
4554
4565
|
});
|
|
4555
4566
|
return a;
|
|
4556
4567
|
}
|
|
4568
|
+
function passThroughAttrs(props) {
|
|
4569
|
+
const out = [];
|
|
4570
|
+
for (const [key, value] of Object.entries(props)) {
|
|
4571
|
+
if (value == null || value === false) continue;
|
|
4572
|
+
const lower2 = key.toLowerCase();
|
|
4573
|
+
const allowed = lower2.startsWith("data-") || lower2.startsWith("aria-") || lower2 === "role" || lower2 === "id" || lower2 === "title" || lower2 === "tabindex" || lower2 === "download" || lower2 === "hreflang" || lower2 === "referrerpolicy";
|
|
4574
|
+
if (!allowed) continue;
|
|
4575
|
+
out.push([key, value === true ? "" : String(value)]);
|
|
4576
|
+
}
|
|
4577
|
+
return out;
|
|
4578
|
+
}
|
|
4557
4579
|
function applyLinkDom(a, props, href) {
|
|
4558
4580
|
const displayHref = routerMode() && !href.startsWith("#") ? "#" + href : href;
|
|
4559
4581
|
a.href = displayHref;
|
|
@@ -4561,6 +4583,7 @@ function applyLinkDom(a, props, href) {
|
|
|
4561
4583
|
if (props.style) a.setAttribute("style", props.style);
|
|
4562
4584
|
if (props.target) a.target = props.target;
|
|
4563
4585
|
if (props.rel) a.rel = props.rel;
|
|
4586
|
+
for (const [key, value] of passThroughAttrs(props)) a.setAttribute(key, value);
|
|
4564
4587
|
}
|
|
4565
4588
|
function NavLink(props, registry, hydrate) {
|
|
4566
4589
|
if (typeof document === "undefined") {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vesk/vesk-cli",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.96",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Vesk — compiler-first framework for the post-VDOM web. vesk dev, vesk build.",
|
|
6
6
|
"bin": {
|
|
@@ -8,10 +8,10 @@
|
|
|
8
8
|
},
|
|
9
9
|
"main": "./dist/cli.js",
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@vesk/adapter": "^0.2.
|
|
12
|
-
"@vesk/compiler": "^0.2.
|
|
13
|
-
"@vesk/plugin-tailwind": "^0.2.
|
|
14
|
-
"@vesk/runtime": "^0.2.
|
|
11
|
+
"@vesk/adapter": "^0.2.96",
|
|
12
|
+
"@vesk/compiler": "^0.2.96",
|
|
13
|
+
"@vesk/plugin-tailwind": "^0.2.96",
|
|
14
|
+
"@vesk/runtime": "^0.2.96",
|
|
15
15
|
"esrap": "^2.3.0",
|
|
16
16
|
"typescript": "^5.8.0",
|
|
17
17
|
"ws": "^8.18.0",
|