@adukiorg/anza 0.4.0 → 0.4.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/CHANGELOG.md +8 -0
- package/bin/anza/anza-linux-arm64 +0 -0
- package/bin/anza/anza-linux-x64 +0 -0
- package/bin/anza/anza-macos-arm64 +0 -0
- package/bin/anza/anza-macos-x64 +0 -0
- package/bin/anza/anza-windows-x64.exe +0 -0
- package/package.json +1 -1
- package/src/core/ui/define/element.js +6 -3
- package/src/core/ui/define/utils.js +13 -7
package/CHANGELOG.md
CHANGED
|
@@ -17,6 +17,14 @@ Versioning follows [Semantic Versioning](https://semver.org/).
|
|
|
17
17
|
|
|
18
18
|
---
|
|
19
19
|
|
|
20
|
+
## [0.4.1] — 2026-06-14
|
|
21
|
+
|
|
22
|
+
### Fixed
|
|
23
|
+
|
|
24
|
+
- **URL Detection Bug**: Fixed a critical bug in both the JS runtime (`utils.js`, `element.js`) and the Rust compiler (`parse.rs`) where inline CSS strings starting with `/*` or `<!--` were mistakenly identified as file URLs. This bug was bypassing inline CSS injection when providing CSS string arrays.
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
20
28
|
## [0.4.0] — 2026-06-14
|
|
21
29
|
|
|
22
30
|
### Added
|
|
Binary file
|
package/bin/anza/anza-linux-x64
CHANGED
|
Binary file
|
|
Binary file
|
package/bin/anza/anza-macos-x64
CHANGED
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -49,14 +49,17 @@ export function element(tag, spec, base) {
|
|
|
49
49
|
warnMissingBase(tag, 'style', spec.style, base);
|
|
50
50
|
warnMissingBase(tag, 'template', spec.template, base);
|
|
51
51
|
|
|
52
|
+
const isStyleUrl = s => typeof s === 'string' && (s.endsWith('.css') || ((s.startsWith('./') || s.startsWith('/')) && !s.startsWith('/*') && !s.includes('{')));
|
|
53
|
+
const isTemplateUrl = s => typeof s === 'string' && (s.endsWith('.html') || ((s.startsWith('./') || s.startsWith('/')) && !s.startsWith('<!--') && !s.includes('<')));
|
|
54
|
+
|
|
52
55
|
// Resolve absolute URLs relative to import.meta.url (base)
|
|
53
56
|
const styleUrls = Array.isArray(spec.style)
|
|
54
|
-
? spec.style.filter(s => s && base && (s
|
|
55
|
-
: (spec.style && base && (spec.style
|
|
57
|
+
? spec.style.filter(s => s && base && isStyleUrl(s)).map(s => new URL(s, base).href)
|
|
58
|
+
: (spec.style && base && isStyleUrl(spec.style)
|
|
56
59
|
? [new URL(spec.style, base).href]
|
|
57
60
|
: []);
|
|
58
61
|
|
|
59
|
-
const templateUrl = spec.template && base && (spec.template
|
|
62
|
+
const templateUrl = spec.template && base && isTemplateUrl(spec.template)
|
|
60
63
|
? new URL(spec.template, base).href
|
|
61
64
|
: null;
|
|
62
65
|
|
|
@@ -51,12 +51,18 @@ export async function preloadResources(tag, styleUrls, templateUrl, inlineTempla
|
|
|
51
51
|
}));
|
|
52
52
|
|
|
53
53
|
if (inlineStyle) {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
54
|
+
const inlineStyles = Array.isArray(inlineStyle) ? inlineStyle : [inlineStyle];
|
|
55
|
+
// Filter out ones that are likely URLs (they were fetched above)
|
|
56
|
+
const isUrl = s => typeof s === 'string' && (s.endsWith('.css') || ((s.startsWith('./') || s.startsWith('/')) && !s.startsWith('/*') && !s.includes('{')));
|
|
57
|
+
const inlines = inlineStyles.filter(s => !isUrl(s));
|
|
58
|
+
for (const style of inlines) {
|
|
59
|
+
if (supportsSheets) {
|
|
60
|
+
const sheet = new CSSStyleSheet();
|
|
61
|
+
sheet.replaceSync(style);
|
|
62
|
+
stylesheets.push(sheet);
|
|
63
|
+
} else {
|
|
64
|
+
cssTextAcc += style + '\n';
|
|
65
|
+
}
|
|
60
66
|
}
|
|
61
67
|
}
|
|
62
68
|
|
|
@@ -99,7 +105,7 @@ export async function preloadResources(tag, styleUrls, templateUrl, inlineTempla
|
|
|
99
105
|
templateNode = createTemplateFragment(inlineTemplate);
|
|
100
106
|
}
|
|
101
107
|
|
|
102
|
-
return { templateNode,
|
|
108
|
+
return { templateNode, stylesheets, cssText, tagsDescriptor };
|
|
103
109
|
}
|
|
104
110
|
|
|
105
111
|
/**
|