Initial Matrix component package
This commit is contained in:
commit
3848f867a2
5
.npmrc
Normal file
5
.npmrc
Normal file
@ -0,0 +1,5 @@
|
||||
registry=https://registry.npmjs.org/
|
||||
@open-matrix:registry=https://registry.hivecast.ai/api/packages/open-matrix/npm/
|
||||
@matrix:registry=https://registry.hivecast.ai/api/packages/open-matrix/npm/
|
||||
@omega:registry=https://registry.hivecast.ai/api/packages/open-matrix/npm/
|
||||
@hivecast-proof-example-test:registry=https://registry.hivecast.ai/api/packages/hivecast-proof-example-test/npm/
|
||||
23
index.js
Normal file
23
index.js
Normal file
@ -0,0 +1,23 @@
|
||||
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 };
|
||||
}
|
||||
}
|
||||
41
matrix.package.json
Normal file
41
matrix.package.json
Normal file
@ -0,0 +1,41 @@
|
||||
{
|
||||
"name": "@hivecast-proof-example-test/r3b-proof-component-20260707215243",
|
||||
"version": "1.0.0",
|
||||
"description": "Run 3 proof component package",
|
||||
"artifact": {
|
||||
"kind": "component",
|
||||
"lifecycle": "NAMES-PENDING(R-B): component package artifact"
|
||||
},
|
||||
"runtime": {
|
||||
"language": "javascript",
|
||||
"entry": "index.js"
|
||||
},
|
||||
"rendererProvider": {
|
||||
"kind": "matrix-actor-html-element",
|
||||
"entry": "index.js",
|
||||
"export": "Component"
|
||||
},
|
||||
"components": [
|
||||
{
|
||||
"type": "R3bProofComponent20260707215243Component",
|
||||
"export": "Component",
|
||||
"mount": "r3b-proof-component-20260707215243",
|
||||
"surface": "dom",
|
||||
"accepts": [
|
||||
"setText"
|
||||
],
|
||||
"emits": [],
|
||||
"tracks": [],
|
||||
"interfaces": [],
|
||||
"intents": [],
|
||||
"description": "Run 3 proof component package"
|
||||
}
|
||||
],
|
||||
"busAccess": {
|
||||
"imports": [],
|
||||
"exports": []
|
||||
},
|
||||
"permissions": {
|
||||
"fsPolicy": "none"
|
||||
}
|
||||
}
|
||||
11
package.json
Normal file
11
package.json
Normal file
@ -0,0 +1,11 @@
|
||||
{
|
||||
"name": "@hivecast-proof-example-test/r3b-proof-component-20260707215243",
|
||||
"version": "1.0.0",
|
||||
"type": "module",
|
||||
"main": "index.js",
|
||||
"files": [
|
||||
"index.js",
|
||||
"matrix.package.json"
|
||||
],
|
||||
"matrix": true
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user