24 lines
619 B
JavaScript
24 lines
619 B
JavaScript
class R3bProofComponent20260707215243Component extends MatrixActorHtmlElement {
|
|
static accepts = {
|
|
setText: {},
|
|
};
|
|
|
|
static emits = { changed: {} };
|
|
|
|
constructor() {
|
|
super();
|
|
this.state = { text: "R3b Proof Component 20260707215243" };
|
|
}
|
|
|
|
render(state = this.state) {
|
|
return `<section class="component-shell"><strong>${state.text}</strong></section>`;
|
|
}
|
|
|
|
onSetText(payload = {}) {
|
|
this.state = { ...this.state, text: String(payload.text ?? "") };
|
|
this.requestRender?.();
|
|
this.emit?.("changed", { text: this.state.text });
|
|
return { ok: true, text: this.state.text };
|
|
}
|
|
}
|