@radishland/runtime 0.5.0 → 0.6.0
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/client/index.js +9 -7
- package/package.json +1 -1
package/client/index.js
CHANGED
|
@@ -248,7 +248,7 @@ var HandlerRegistry = class extends HTMLElement {
|
|
|
248
248
|
}
|
|
249
249
|
}
|
|
250
250
|
}
|
|
251
|
-
#
|
|
251
|
+
#handleTextContent(e) {
|
|
252
252
|
if (e instanceof DirectiveEvent) {
|
|
253
253
|
const { identifier, target } = e.detail;
|
|
254
254
|
if (identifier in this && target instanceof HTMLElement) {
|
|
@@ -256,7 +256,7 @@ var HandlerRegistry = class extends HTMLElement {
|
|
|
256
256
|
this.effect(() => {
|
|
257
257
|
target.textContent = `${ref}`;
|
|
258
258
|
});
|
|
259
|
-
target.removeAttribute("
|
|
259
|
+
target.removeAttribute("textContent");
|
|
260
260
|
e.stopPropagation();
|
|
261
261
|
}
|
|
262
262
|
}
|
|
@@ -373,10 +373,10 @@ var HandlerRegistry = class extends HTMLElement {
|
|
|
373
373
|
});
|
|
374
374
|
element.dispatchEvent(propRequest);
|
|
375
375
|
}
|
|
376
|
-
const
|
|
377
|
-
if (
|
|
378
|
-
const textRequest = new DirectiveEvent("rad::
|
|
379
|
-
identifier:
|
|
376
|
+
const textContent = element.getAttribute("textContent");
|
|
377
|
+
if (textContent) {
|
|
378
|
+
const textRequest = new DirectiveEvent("rad::textContent", {
|
|
379
|
+
identifier: textContent,
|
|
380
380
|
key: "textContent",
|
|
381
381
|
target: element
|
|
382
382
|
});
|
|
@@ -420,7 +420,9 @@ var HandlerRegistry = class extends HTMLElement {
|
|
|
420
420
|
this.addEventListener("rad::html", this.#handleHTML, { signal: signal2 });
|
|
421
421
|
this.addEventListener("rad::on", this.#handleOn, { signal: signal2 });
|
|
422
422
|
this.addEventListener("rad::prop", this.#handleProp, { signal: signal2 });
|
|
423
|
-
this.addEventListener("rad::
|
|
423
|
+
this.addEventListener("rad::textContent", this.#handleTextContent, {
|
|
424
|
+
signal: signal2
|
|
425
|
+
});
|
|
424
426
|
this.addEventListener("rad::use", this.#handleUse, { signal: signal2 });
|
|
425
427
|
}
|
|
426
428
|
disconnectedCallback() {
|