@adia-ai/web-components 0.0.8 → 0.0.10
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/core/element.js +12 -2
- package/core/icons.js +12 -0
- package/package.json +1 -1
package/core/element.js
CHANGED
|
@@ -17,7 +17,7 @@ export { signal, computed, effect, batch, untracked, isSignal } from './signals.
|
|
|
17
17
|
export { html, css, repeat } from './template.js';
|
|
18
18
|
|
|
19
19
|
// Internal imports for AdiaElement
|
|
20
|
-
import { signal, computed, effect } from './signals.js';
|
|
20
|
+
import { signal, computed, effect, untracked } from './signals.js';
|
|
21
21
|
import { stamp, disposeParts, KEY_MAP } from './template.js';
|
|
22
22
|
|
|
23
23
|
// ═══════════════════════════════════════════════════════════════
|
|
@@ -105,7 +105,17 @@ export class AdiaElement extends HTMLElement {
|
|
|
105
105
|
if (!ctor._tag) ctor._tag = this.localName;
|
|
106
106
|
adoptStyles(ctor);
|
|
107
107
|
prepareParts(ctor);
|
|
108
|
-
|
|
108
|
+
// connected() commonly reads this element's reactive properties via
|
|
109
|
+
// template-literal interpolation (`${this.label}` etc.) to stamp its
|
|
110
|
+
// inner DOM. If the outer call path is inside another effect (e.g.
|
|
111
|
+
// a parent's render loop appendChild'ing this node), those reads
|
|
112
|
+
// would subscribe the outer effect to THIS element's signals —
|
|
113
|
+
// invisible cross-element coupling that looks like spooky re-runs
|
|
114
|
+
// on unrelated state changes. Wrap in untracked so element setup
|
|
115
|
+
// never leaks subscriptions upward. The element's OWN effect
|
|
116
|
+
// (below) re-reads the same signals in its own tracking context,
|
|
117
|
+
// so reactivity within the element is unaffected.
|
|
118
|
+
untracked(() => this.connected());
|
|
109
119
|
this.#fx.push(effect(() => {
|
|
110
120
|
for (const sig of this[SIG].values()) sig.value;
|
|
111
121
|
this.#notify.value;
|
package/core/icons.js
CHANGED
|
@@ -102,6 +102,18 @@ if (!hasViteGlob) {
|
|
|
102
102
|
});
|
|
103
103
|
return [weight, Object.fromEntries(entries)];
|
|
104
104
|
}));
|
|
105
|
+
// icon-ui elements that asked for an icon before the manifest loaded
|
|
106
|
+
// gave up silently (resolveLoader returned null on EMPTY_WEIGHTS).
|
|
107
|
+
// Re-request every <icon-ui name> now that a real loader map is in
|
|
108
|
+
// place. Idempotent — already-loaded icons short-circuit on
|
|
109
|
+
// registry.has() inside loadIcon.
|
|
110
|
+
if (typeof document !== 'undefined') {
|
|
111
|
+
for (const el of document.querySelectorAll('icon-ui[name]')) {
|
|
112
|
+
const name = el.getAttribute('name');
|
|
113
|
+
const weight = el.getAttribute('weight') || DEFAULT_WEIGHT;
|
|
114
|
+
if (name) loadIcon(name, weight);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
105
117
|
}).catch(() => { /* keep EMPTY_WEIGHTS */ });
|
|
106
118
|
}
|
|
107
119
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adia-ai/web-components",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.10",
|
|
4
4
|
"description": "AdiaUI web components — vanilla custom elements. A2UI runtime (renderer, registry, streams, wiring) lives in @adia-ai/a2ui-utils.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|