@vmz/core 0.2.3 → 0.2.5
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/browser/dom-core.js +5 -0
- package/dist/host/serve-host.mjs +17 -0
- package/dist/ssr/dom-ssr.js +15 -1
- package/package.json +7 -7
package/dist/browser/dom-core.js
CHANGED
|
@@ -798,6 +798,11 @@ export function applyDomAttr(el, name, value) {
|
|
|
798
798
|
return;
|
|
799
799
|
}
|
|
800
800
|
if (BOOLEAN_HTML_ATTRS.has(String(key).toLowerCase())) {
|
|
801
|
+
const on = value === true || value === '';
|
|
802
|
+
if (key === 'checked' && el && el.tagName === 'INPUT' && String(el.type || '').toLowerCase() === 'checkbox') {
|
|
803
|
+
if (el.checked !== on)
|
|
804
|
+
el.checked = on;
|
|
805
|
+
}
|
|
801
806
|
if (value === false || value == null || value === '') {
|
|
802
807
|
el.removeAttribute(key);
|
|
803
808
|
}
|
package/dist/host/serve-host.mjs
CHANGED
|
@@ -72,6 +72,23 @@ function installAppModuleResolveHooks() {
|
|
|
72
72
|
specifier.startsWith('#')) {
|
|
73
73
|
return nextResolve(specifier, context);
|
|
74
74
|
}
|
|
75
|
+
if (context.parentURL?.startsWith('file:')) {
|
|
76
|
+
try {
|
|
77
|
+
const parentPath = fileURLToPath(context.parentURL);
|
|
78
|
+
if (!parentPath.startsWith(distDir + path.sep))
|
|
79
|
+
return nextResolve(specifier, context);
|
|
80
|
+
}
|
|
81
|
+
catch {
|
|
82
|
+
return nextResolve(specifier, context);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
try {
|
|
86
|
+
const appParent = pathToFileURL(path.join(projectRootForResolve(), 'package.json')).href;
|
|
87
|
+
return nextResolve(specifier, { ...context, parentURL: appParent });
|
|
88
|
+
}
|
|
89
|
+
catch {
|
|
90
|
+
// Some legacy packages expose only a CommonJS entry.
|
|
91
|
+
}
|
|
75
92
|
try {
|
|
76
93
|
const resolved = appPackageRequireResolve().resolve(specifier);
|
|
77
94
|
return { url: pathToFileURL(resolved).href, shortCircuit: true };
|
package/dist/ssr/dom-ssr.js
CHANGED
|
@@ -512,12 +512,13 @@ function virtualRemove(node) {
|
|
|
512
512
|
node.parentNode = null;
|
|
513
513
|
}
|
|
514
514
|
function makeVirtualEl(tag) {
|
|
515
|
-
|
|
515
|
+
const node = {
|
|
516
516
|
__kind: 'el',
|
|
517
517
|
tag: tag || 'div',
|
|
518
518
|
attrs: {},
|
|
519
519
|
children: [],
|
|
520
520
|
style: {},
|
|
521
|
+
__rawHtml: null,
|
|
521
522
|
parentNode: null,
|
|
522
523
|
setAttribute(name, value) {
|
|
523
524
|
applySerializeAttr(this, name, value);
|
|
@@ -529,6 +530,19 @@ function makeVirtualEl(tag) {
|
|
|
529
530
|
virtualInsertBefore(this, node, ref);
|
|
530
531
|
},
|
|
531
532
|
};
|
|
533
|
+
// Direct emit writes `el.innerHTML` for v-html. Mirror that DOM property
|
|
534
|
+
// on the SSR virtual element so the serializer receives the same payload.
|
|
535
|
+
Object.defineProperty(node, 'innerHTML', {
|
|
536
|
+
configurable: true,
|
|
537
|
+
get() {
|
|
538
|
+
return this.__rawHtml ?? '';
|
|
539
|
+
},
|
|
540
|
+
set(value) {
|
|
541
|
+
this.__rawHtml = value == null ? '' : String(value);
|
|
542
|
+
this.children = [];
|
|
543
|
+
},
|
|
544
|
+
});
|
|
545
|
+
return node;
|
|
532
546
|
}
|
|
533
547
|
const serializeApi = {
|
|
534
548
|
_inst: null,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vmz/core",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.5",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "VMZ production runtime core — DOM / SSR / HTTP / WriteBarrier (no compiler)",
|
|
6
6
|
"exports": {
|
|
@@ -70,12 +70,12 @@
|
|
|
70
70
|
"linkedom": "^0.18.13"
|
|
71
71
|
},
|
|
72
72
|
"optionalDependencies": {
|
|
73
|
-
"@vmz/vmz-win32-x64": "0.2.
|
|
74
|
-
"@vmz/vmz-win32-arm64": "0.2.
|
|
75
|
-
"@vmz/vmz-darwin-x64": "0.2.
|
|
76
|
-
"@vmz/vmz-darwin-arm64": "0.2.
|
|
77
|
-
"@vmz/vmz-linux-x64": "0.2.
|
|
78
|
-
"@vmz/vmz-linux-arm64": "0.2.
|
|
73
|
+
"@vmz/vmz-win32-x64": "0.2.5",
|
|
74
|
+
"@vmz/vmz-win32-arm64": "0.2.5",
|
|
75
|
+
"@vmz/vmz-darwin-x64": "0.2.5",
|
|
76
|
+
"@vmz/vmz-darwin-arm64": "0.2.5",
|
|
77
|
+
"@vmz/vmz-linux-x64": "0.2.5",
|
|
78
|
+
"@vmz/vmz-linux-arm64": "0.2.5"
|
|
79
79
|
},
|
|
80
80
|
"publishConfig": {
|
|
81
81
|
"access": "public"
|