first commit

This commit is contained in:
2026-03-24 23:24:36 +01:00
commit a69394a05b
1638 changed files with 891299 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
import Node from './shared/Node.js';
import EventHandler from './EventHandler.js';
import Action from './Action.js';
/** @extends Node<'Body'> */
export default class Body extends Node {
/** @type {import('./EventHandler.js').default[]} */
handlers = [];
/** @type {import('./Action.js').default[]} */
actions = [];
/**
* @param {import('../Component.js').default} component
* @param {import('./shared/Node.js').default} parent
* @param {import('./shared/TemplateScope.js').default} scope
* @param {import('../../interfaces.js').Element} info
*/
constructor(component, parent, scope, info) {
super(component, parent, scope, info);
info.attributes.forEach((node) => {
if (node.type === 'EventHandler') {
this.handlers.push(new EventHandler(component, this, scope, node));
} else if (node.type === 'Action') {
this.actions.push(new Action(component, this, scope, node));
} else {
// TODO there shouldn't be anything else here...
}
});
}
}