@adaas/are-html 0.0.14 → 0.0.15
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/dist/browser/index.mjs +14 -2
- package/dist/browser/index.mjs.map +1 -1
- package/dist/node/lib/AreRoot/AreRoot.component.js +14 -2
- package/dist/node/lib/AreRoot/AreRoot.component.js.map +1 -1
- package/dist/node/lib/AreRoot/AreRoot.component.mjs +14 -2
- package/dist/node/lib/AreRoot/AreRoot.component.mjs.map +1 -1
- package/package.json +1 -1
- package/src/lib/AreRoot/AreRoot.component.ts +19 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/lib/AreHTMLAttribute/AreHTML.attribute.ts","../../src/attributes/AreBinding.attribute.ts","../../src/attributes/AreDirective.attribute.ts","../../src/attributes/AreEvent.attribute.ts","../../src/attributes/AreStatic.attribute.ts","../../src/lib/AreDirective/AreDirective.meta.ts","../../src/lib/AreDirective/AreDirective.constants.ts","../../src/lib/AreDirective/AreDirective.component.ts","../../src/instructions/AreHTML.instructions.constants.ts","../../src/instructions/AddComment.instruction.ts","../../src/lib/AreDirective/AreDirective.context.ts","../../src/directives/AreDirectiveFor.directive.ts","../../src/directives/AreDirectiveIf.directive.ts","../../src/instructions/AddAttribute.instruction.ts","../../src/instructions/AddElement.instruction.ts","../../src/instructions/AddInterpolation.instruction.ts","../../src/instructions/AddListener.instruction.ts","../../src/instructions/AddStyle.instruction.ts","../../src/instructions/AddText.instruction.ts","../../src/lib/AreStyle/AreStyle.context.ts","../../src/lib/AreHTMLNode/AreHTMLNode.ts","../../src/nodes/AreComment.ts","../../src/nodes/AreComponent.ts","../../src/nodes/AreInterpolation.ts","../../src/nodes/AreRoot.ts","../../src/nodes/AreText.ts","../../src/signals/AreRoute.signal.ts","../../src/engine/AreHTML.constants.ts","../../src/engine/AreHTML.context.ts","../../src/engine/AreHTML.compiler.ts","../../src/engine/AreHTML.interpreter.ts","../../src/engine/AreHTML.tokenizer.ts","../../src/engine/AreHTML.lifecycle.ts","../../src/engine/AreHTML.transformer.ts","../../src/engine/AreHTML.engine.ts","../../src/lib/AreRoot/AreRoot.component.ts","../../src/lib/AreRouteWatcher/AreRouteWatcher.component.ts"],"names":["A_Frame","A_Inject","A_Caller","A_Logger","A_Scope","AreStore","AreScene","AreDeclaration","AreMutation","A_Context","A_FormatterHelper","AreCompilerError","A_Feature","AreSyntax","AreContext","AreNodeFeatures","AreAttributeFeatures","AreSignalsContext","content","match","A_Component"],"mappings":";;;;;;;;;;;;;;;;;;;;AAWO,IAAM,gBAAA,GAAN,cAA+B,YAAA,CAAa;AAAA,EAE/C,IAAI,KAAA,GAAqB;AACrB,IAAA,OAAO,IAAA,CAAK,MAAM,MAAA,EAAO;AAAA,EAC7B;AAEJ;AANa,gBAAA,GAAN,eAAA,CAAA;AAAA,EAJN,QAAQ,MAAA,CAAO;AAAA,IACZ,SAAA,EAAW,YAAA;AAAA,IACX,WAAA,EAAa;AAAA,GAChB;AAAA,CAAA,EACY,gBAAA,CAAA;ACCN,IAAM,mBAAA,GAAN,cAAkC,gBAAA,CAAiB;AAAA;AAAA;AAAA;AAAA;AAAA;AAW1D;AAXa,mBAAA,GAAN,eAAA,CAAA;AAAA,EAJNA,QAAQ,MAAA,CAAO;AAAA,IACZ,SAAA,EAAW,YAAA;AAAA,IACX,WAAA,EAAa;AAAA,GAChB;AAAA,CAAA,EACY,mBAAA,CAAA;ACCN,IAAM,qBAAA,GAAN,cAAoC,gBAAA,CAAmD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAW1F,IAAI,SAAA,GAAsC;AACtC,IAAA,MAAM,SAAA,GAAY,IAAA,CAAK,KAAA,CAAM,OAAA,CAAsB,CAAA,YAAA,EAAe,kBAAkB,YAAA,CAAa,IAAA,CAAK,IAAI,CAAC,CAAA,CAAE,CAAA;AAE7G,IAAA,OAAO,SAAA;AAAA,EACX;AAEJ;AAjBa,qBAAA,GAAN,eAAA,CAAA;AAAA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";\nimport { A_Frame } from \"@adaas/a-frame/core\";\n\n\n\n\n@A_Frame.Define({\n namespace: 'a-are-html',\n description: 'Base class for all typed HTML attributes in the ARE framework. Provides typed access to the owning AreHTMLNode via the scope injector so that attribute subclasses can inspect host-node properties and resolve store bindings during transformation, compilation, and lifecycle phases.'\n})\nexport class AreHTMLAttribute extends AreAttribute {\n\n get owner(): AreHTMLNode {\n return this.scope.issuer() as AreHTMLNode;\n }\n\n}","import { AreHTMLAttribute } from \"@adaas/are-html/attribute\";\nimport { A_Frame } from \"@adaas/a-frame/core\";\n\n\n\n\n\n\n@A_Frame.Define({\n namespace: 'a-are-html',\n description: 'Attribute type for two-way value bindings (: prefix). Marks that the attribute value should be resolved dynamically from the node store rather than used verbatim, enabling reactive updates whenever the underlying store value changes during a rendering cycle.'\n})\nexport class AreBindingAttribute extends AreHTMLAttribute {\n\n // get value(): string {\n\n // const [firstPart, ...pathPart] = this.content.split('.');\n\n // const primaryObject = this.owner.store.get(firstPart);\n\n // return AreCommonHelper.extractPropertyByPath(primaryObject, pathPart.join('.')) as string;\n // }\n\n}\n","import { A_FormatterHelper } from \"@adaas/a-concept\";\nimport type { AreDirective } from \"@adaas/are-html/directive/AreDirective.component\";\nimport { AreHTMLAttribute } from \"@adaas/are-html/attribute\";\nimport { AreStoreWatchingEntity } from \"@adaas/are\";\nimport { AreHTMLNode } from \"@adaas/are-html/node\";\nimport { A_Frame } from \"@adaas/a-frame/core\";\n\n\n\n@A_Frame.Define({\n namespace: 'a-are-html',\n description: 'Attribute type for directive invocations ($ prefix). Carries the resolved directive component class and a cloned template node. The associated directive uses these during its Compile phase to emit conditional or repeated instruction groups and to manage per-item or per-condition subscopes.'\n})\nexport class AreDirectiveAttribute extends AreHTMLAttribute implements AreStoreWatchingEntity {\n\n cache?: any\n\n template?: AreHTMLNode\n\n /**\n * Returns a custom directive component associated with this attribute, if available.\n * \n * The method uses the attribute's name to resolve the corresponding directive component from the scope. It constructs the expected directive name by converting the attribute name to PascalCase and prefixing it with \"AreDirective\". If a matching directive component is found in the scope, it is returned; otherwise, the method returns undefined.\n */\n get component(): AreDirective | undefined {\n const component = this.scope.resolve<AreDirective>(`AreDirective${A_FormatterHelper.toPascalCase(this.name)}`) as AreDirective | undefined;\n\n return component as AreDirective;\n }\n\n}","import { AreHTMLAttribute } from \"@adaas/are-html/attribute\";\nimport { A_Frame } from \"@adaas/a-frame/core\";\n\n\n@A_Frame.Define({\n namespace: 'a-are-html',\n description: 'Attribute type for DOM event listeners (@ prefix). Marks the attribute as an event binding — the compiler emits an AddListener instruction that attaches a handler expression resolved from the store to the specified event name on the host element.'\n})\nexport class AreEventAttribute extends AreHTMLAttribute {\n}","import { AreHTMLAttribute } from \"@adaas/are-html/attribute\";\nimport { A_Frame } from \"@adaas/a-frame/core\";\n\n\n@A_Frame.Define({\n namespace: 'a-are-html',\n description: 'Attribute type for plain static HTML attributes with no dynamic prefix. Its value is emitted verbatim via an AddAttribute instruction at compile time and does not participate in reactive update cycles.'\n})\nexport class AreStaticAttribute extends AreHTMLAttribute {\n\n}","import { A_ComponentMeta } from \"@adaas/a-concept\";\n\n\n\nexport class AreDirectiveMeta extends A_ComponentMeta {\n\n priority: number = 0\n\n}","\n\nexport const AreDirectiveFeatures = {\n /**\n * Feature that should transform the tree based on the directive attribute. This method is called during the transformation phase of the ARE component and should perform any necessary transformations on the AreNode tree based on the directive's content and context. This can include tasks such as adding or removing nodes, modifying node properties, or restructuring the tree to ensure that the directive is applied correctly during rendering.\n */\n Transform: '_AreDirective_Transform',\n /**\n * Feature that should convert a directiveAttribute definition into a set of SceneInstructions to be rendered correctly\n */\n Compile: '_AreDirective_Compile',\n /**\n * Feature that should update the directiveAttribute based on the changes in the store or other dependencies. \n */\n Update: '_AreDirective_Update',\n} as const","import { A_Caller, A_Component, A_Context, A_Feature, A_Inject, A_Meta, A_TYPES__Ctor } from \"@adaas/a-concept\";\nimport { A_Logger } from \"@adaas/a-utils/a-logger\";\nimport type { AreDirectiveAttribute } from \"@adaas/are-html/attributes/AreDirective.attribute\";\nimport { AreDirectiveMeta } from \"./AreDirective.meta\";\nimport { AreDirectiveFeatures } from \"./AreDirective.constants\";\nimport { A_Frame } from \"@adaas/a-frame/core\";\n\n\n@A_Frame.Define({\n namespace: 'a-are-html',\n description: 'Abstract base component for all ARE directive types. Provides lifecycle decorators (Transform, Compile, Apply, Revert, Priority) that subclasses hook into at each pipeline stage. Subclasses implement Transform to rewrite the attribute or template node, Compile to emit scene instructions, Apply to activate them in the DOM, and Revert to undo them on removal.'\n})\n@A_Meta.Define(AreDirectiveMeta)\nexport class AreDirective extends A_Component {\n\n //==================================================================================\n //======================== LIFECYCLE DECORATORS ====================================\n //==================================================================================\n /**\n * Allows to define a compilation order for directives, which is necessary when we have multiple directives on the same node and we want to control the order of their compilation and application. The directive with the highest priority will be compiled and applied first, and the directive with the lowest priority will be compiled and applied last. This is important because some directives may depend on the output of other directives, so we need to ensure that they are compiled and applied in the correct order to avoid errors and ensure the expected behavior.\n * \n * @param priority \n * @returns \n */\n static Priority(priority: number) {\n return function <TTarget extends A_TYPES__Ctor<AreDirective>>(\n target: TTarget\n ): TTarget {\n // Store meta info on the target class itself for the Meta decorator to pick up\n const meta = A_Context.meta<AreDirectiveMeta>(target);\n\n meta.priority = priority;\n\n return target;\n };\n }\n\n /**\n * Allows to define a custom method for transforming the AreNode tree based on the directive attribute. This method is called during the transformation phase of the ARE component and should perform any necessary transformations on the AreNode tree based on the directive's content and context. This can include tasks such as adding or removing nodes, modifying node properties, or restructuring the tree to ensure that the directive is applied correctly during rendering.\n */\n static get Transform() {\n return (target: any, propertyKey: string, descriptor: PropertyDescriptor) => {\n return A_Feature.Extend({\n name: AreDirectiveFeatures.Transform,\n scope: [target.constructor],\n })(target, propertyKey, descriptor);\n }\n }\n\n /**\n * Allows to define a custom method for compiling a directive attribute into a set of SceneInstructions. \n * Can be used at any component to extend this logic not only for a AreDirective inherited.\n */\n static get Compile() {\n return (target: any, propertyKey: string, descriptor: PropertyDescriptor) => {\n return A_Feature.Extend({\n name: AreDirectiveFeatures.Compile,\n scope: [target.constructor],\n })(target, propertyKey, descriptor);\n }\n }\n\n /**\n * Allows to define a custom method for updating a directive attribute based on changes in the store or other dependencies.\n * Can be used at any component to extend this logic not only for a AreDirective inherited.\n */\n static get Update() {\n return (target: any, propertyKey: string, descriptor: PropertyDescriptor) => {\n return A_Feature.Extend({\n name: AreDirectiveFeatures.Update,\n scope: [target.constructor],\n })(target, propertyKey, descriptor);\n }\n }\n\n /**\n * Default transform method for directives, which can be overridden by specific directive implementations. This method is called during the transformation phase of the ARE component and should perform any necessary transformations on the AreNode tree based on the directive's content and context. This can include tasks such as adding or removing nodes, modifying node properties, or restructuring the tree to ensure that the directive is applied correctly during rendering.\n * \n * @param attribute - The directive attribute to transform, which contains all the information about the directive as defined in the template (e.g. name, raw content, evaluated value, etc.)\n * @param args - Additional arguments that may be required for the transformation process.\n */\n transform(\n @A_Inject(A_Caller) attribute: AreDirectiveAttribute,\n ...args: any[]\n ) {\n const logger = A_Context.scope(this).resolve(A_Logger) as A_Logger | undefined\n if (logger) {\n logger.warning(`No transforming logic defined for directive: ${attribute.name} with content: ${attribute.content}`);\n }\n }\n /**\n * Default compile method for directives, which can be overridden by specific directive implementations.\n * \n * @param attribute - The directive attribute to compile, which contains all the information about the directive as defined in the template (e.g. name, raw content, evaluated value, etc.)\n * @param args - Additional arguments that may be required for the compilation process.\n */\n @A_Feature.Extend({\n name: AreDirectiveFeatures.Compile,\n scope: [AreDirective],\n })\n compile(\n @A_Inject(A_Caller) attribute: AreDirectiveAttribute,\n ...args: any[]\n ) {\n const logger = A_Context.scope(this).resolve(A_Logger) as A_Logger | undefined\n if (logger) {\n logger.warning(`No compiling logic defined for directive: ${attribute.name} with content: ${attribute.content}`);\n }\n }\n /**\n * Default update method for directives, which can be overridden by specific directive implementations. This method is called when there are changes in the store or other dependencies that may affect the directive's behavior or appearance. The method should contain logic to update the directive accordingly, such as re-evaluating its value, modifying the DOM, or triggering re-rendering of the affected nodes.\n * \n * @param attribute - The directive attribute to update, which contains all the information about the directive as defined in the template (e.g. name, raw content, evaluated value, etc.)\n * @param args - Additional arguments that may be required for the update process.\n */\n @A_Feature.Extend({\n name: AreDirectiveFeatures.Update,\n scope: [AreDirective],\n })\n update(\n @A_Inject(A_Caller) attribute: AreDirectiveAttribute,\n ...args: any[]\n ) {\n const logger = A_Context.scope(this).resolve(A_Logger) as A_Logger | undefined\n if (logger) {\n logger.warning(`No update logic defined for directive: ${attribute.name} with content: ${attribute.content}`);\n }\n }\n}","\n\nexport const AreHTMLInstructions = {\n AddElement: '_AreHTML_AddElement',\n AddText: '_AreHTML_AddText',\n AddAttribute: '_AreHTML_AddAttribute',\n AddStyle: '_AreHTML_AddStyle',\n AddListener: '_AreHTML_AddListener',\n AddInterpolation: '_AreHTML_AddInterpolation',\n AddComment: '_AreHTML_AddComment',\n} as const","import { A_Frame } from \"@adaas/a-frame/core\"\nimport { AreDeclaration, AreInstructionSerialized } from \"@adaas/are\";\nimport { AreHtmlAddCommentInstructionPayload } from \"./AreHTML.instructions.types\";\nimport { AreHTMLInstructions } from \"./AreHTML.instructions.constants\";\n\n\n@A_Frame.Define({\n namespace: 'a-are-html',\n description: 'Appends a comment node to an element. Apply creates the comment node; revert removes it. Content can be a static string or a dynamic getter for interpolations.'\n})\nexport class AddCommentInstruction extends AreDeclaration<AreHtmlAddCommentInstructionPayload> {\n\n get content() {\n return this.payload.content;\n }\n\n constructor(\n props: AreHtmlAddCommentInstructionPayload | AreInstructionSerialized<AreHtmlAddCommentInstructionPayload>\n ) {\n if ('aseid' in props) {\n super(props as AreInstructionSerialized<AreHtmlAddCommentInstructionPayload>);\n } else {\n super(AreHTMLInstructions.AddComment, props);\n }\n }\n}\n","import { ASEID } from \"@adaas/a-concept\";\nimport { A_ExecutionContext } from \"@adaas/a-utils/a-execution\";\n\n\nexport class AreDirectiveContext extends A_ExecutionContext {\n\n scope:Record<string, any> = {}\n\n\n constructor(aseid: ASEID | string) {\n super(aseid.toString());\n }\n\n\n\n}\n","import { A_Caller, A_Inject, A_Scope } from \"@adaas/a-concept\";\nimport { A_Logger } from \"@adaas/a-utils/a-logger\";\nimport { AreDirectiveAttribute } from \"@adaas/are-html/attributes/AreDirective.attribute\";\nimport { AreCompilerError, AreScene, AreStore } from \"@adaas/are\";\nimport { AreDirective } from \"@adaas/are-html/directive/AreDirective.component\";\nimport { AddCommentInstruction } from \"@adaas/are-html/instructions/AddComment.instruction\";\nimport { AreHTMLNode } from \"@adaas/are-html/node\";\nimport { AreDirectiveContext } from \"@adaas/are-html/directive/AreDirective.context\";\nimport { A_Frame } from \"@adaas/a-frame/core\";\n\n\ntype AreForExpression = {\n key: string;\n index: string | undefined;\n arrayExpr: string;\n /** Optional `track <expr>` clause, e.g. `track row.id` */\n trackExpr: string | undefined;\n};\n\n\n@A_Frame.Define({\n namespace: 'a-are-html',\n description: 'Built-in $for directive. Iterates over an array expression resolved from the store and renders a cloned template fragment per item, managing per-item subscopes and comment-node anchors. Supports keyed diffing via an optional track clause to minimise DOM mutations on collection updates.'\n})\n@AreDirective.Priority(1)\nexport class AreDirectiveFor extends AreDirective {\n\n\n @AreDirective.Transform\n transform(\n @A_Inject(A_Caller) attribute: AreDirectiveAttribute,\n @A_Inject(A_Scope) scope: A_Scope,\n @A_Inject(AreStore) store: AreStore,\n @A_Inject(AreScene) scene: AreScene,\n @A_Inject(A_Logger) logger: A_Logger,\n ...args: any[]\n ) {\n\n logger.debug(`[Transform] directive $FOR for <${attribute.owner.aseid.toString()}>`)\n\n const node = attribute.owner;\n\n /**\n * Transfer the original node's scope (with all registered attributes and children)\n * to the template clone, and give the owner node a fresh empty scope.\n * This mirrors the $if directive's approach, making the owner a lightweight\n * group container whose sole visible presence is a comment placeholder.\n */\n const forTemplate = node.cloneWithScope();\n\n /**\n * Remove the $for attribute from the template so iterative clones do not\n * re-trigger this directive during their own transform phase.\n * Re-register it on the owner so the reactive compile/update pipeline keeps working.\n */\n const forAttr = forTemplate.attributes.find(d => d.name === attribute.name);\n\n if (forAttr) {\n forTemplate.scope.deregister(forAttr);\n node.scope.register(forAttr);\n }\n\n /**\n * Re-initialize the owner node with its fresh scope so it becomes a valid\n * group container that will own the generated item nodes as children.\n */\n node.init();\n\n /**\n * Store the template for use in compile and update.\n */\n attribute.template = forTemplate;\n\n\n /**\n * Parse the $for expression and evaluate the source array.\n */\n const { key, index, arrayExpr } = this.parseExpression(attribute.content);\n const array = this.resolveArray(store, arrayExpr, attribute.content);\n\n attribute.value = array;\n\n /**\n * For each item in the array, spawn a clone of the template with the\n * item's store values pre-set and its scene activated.\n *\n * The children are added to the owner node before the main compiler's\n * children iteration loop runs, so the main cycle will compile them —\n * no explicit child.compile() call is needed here.\n */\n for (let i = 0; i < array.length; i++) {\n this.spawnItemNode(attribute.template!, attribute.owner, key, index, array[i], i);\n }\n }\n\n\n @AreDirective.Compile\n compile(\n @A_Inject(A_Caller) attribute: AreDirectiveAttribute,\n @A_Inject(AreStore) store: AreStore,\n @A_Inject(AreScene) scene: AreScene,\n ...args: any[]\n ): void {\n /**\n * Replace the group node's default host declaration with a comment placeholder\n * so the owner element itself does not render as a DOM element — the item nodes\n * render as its children instead.\n */\n const hostInstruction = scene.host!;\n const commentIdentifier = ` --- for: ${attribute.template!.id} --- `;\n const declaration = new AddCommentInstruction({ content: commentIdentifier });\n\n scene.setHost(declaration);\n scene.planBefore(declaration, hostInstruction);\n scene.unPlan(hostInstruction);\n }\n\n\n @AreDirective.Update\n update(\n @A_Inject(A_Caller) attribute: AreDirectiveAttribute,\n @A_Inject(AreStore) store: AreStore,\n @A_Inject(AreScene) scene: AreScene,\n ...args: any[]\n ): void {\n /**\n * Re-evaluate the source array.\n */\n const { key, index, arrayExpr, trackExpr } = this.parseExpression(attribute.content);\n const newArray = this.resolveArray(store, arrayExpr, attribute.content);\n\n const owner = attribute.owner;\n const currentChildren = [...owner.children] as AreHTMLNode[];\n\n attribute.value = newArray;\n\n const computeKey = this.makeKeyFn(key, index, trackExpr);\n\n // ── 1. Index existing children by stable key ────────────────────────\n const childByKey = new Map<any, AreHTMLNode>();\n const remaining = new Set<AreHTMLNode>();\n\n for (let i = 0; i < currentChildren.length; i++) {\n const child = currentChildren[i];\n const ctx = child.scope.resolveFlat(AreDirectiveContext);\n const k = ctx ? computeKey(ctx.scope[key], ctx.scope[index || 'index']) : Symbol('orphan');\n childByKey.set(k, child);\n remaining.add(child);\n }\n\n // ── 2. Walk desired list; reuse existing or spawn new ───────────────\n const desired: AreHTMLNode[] = [];\n const newOnes: AreHTMLNode[] = [];\n\n for (let i = 0; i < newArray.length; i++) {\n const item = newArray[i];\n const k = computeKey(item, i);\n const existing = childByKey.get(k);\n\n if (existing) {\n remaining.delete(existing);\n\n let directiveContext = existing.scope.resolveFlat(AreDirectiveContext);\n if (!directiveContext) {\n directiveContext = new AreDirectiveContext(existing.aseid);\n existing.scope.register(directiveContext);\n }\n directiveContext.scope = {\n ...directiveContext.scope,\n [key]: item,\n [index || 'index']: i,\n };\n desired.push(existing);\n } else {\n const itemNode = this.spawnItemNode(attribute.template!, owner, key, index, item, i);\n desired.push(itemNode);\n newOnes.push(itemNode);\n }\n }\n\n // ── 3. Unmount + detach removed children ─────────────────────────────\n for (const child of remaining) {\n child.unmount();\n owner.removeChild(child);\n }\n\n // ── 4. Mount only the new ones (kept children stay where they are). ─\n for (const child of newOnes) {\n child.transform();\n child.compile();\n child.mount();\n }\n }\n\n\n // ─────────────────────────────────────────────────────────────────────────────\n // ── Helpers ──────────────────────────────────────────────────────────────────\n // ─────────────────────────────────────────────────────────────────────────────\n\n /**\n * Build a key-function that derives a stable identity from each item.\n * If the user provided a `track <expr>` clause, evaluate it as a path on\n * the item; otherwise fall back to the item identity (reference equality).\n */\n private makeKeyFn(key: string, index: string | undefined, trackExpr: string | undefined): (item: any, i: number) => any {\n if (!trackExpr) {\n return (item, i) => item ?? i;\n }\n\n // Strip any leading `key.` so users can write `track row.id`.\n const path = trackExpr.startsWith(key + '.') ? trackExpr.slice(key.length + 1) : trackExpr;\n\n return (item, i) => {\n if (item == null) return i;\n if (path === key || path === '$index') return path === '$index' ? i : item;\n\n // dotted path lookup\n const parts = path.split('.');\n let v: any = item;\n for (const p of parts) {\n if (v == null) return i;\n v = v[p];\n }\n return v ?? i;\n };\n }\n\n /**\n * Parses the $for expression string into its constituent parts.\n *\n * Supported formats:\n * item in items\n * item, index in items\n * (item, index) in items\n * item in filter(items)\n * item, index in filter(items, 'active')\n * item in items track item.id\n * (item, i) in items track item.id\n */\n private parseExpression(content: string): AreForExpression {\n // Strip optional `track <expr>` suffix first.\n let trackExpr: string | undefined;\n const trackIdx = content.search(/\\s+track\\s+/);\n let body = content;\n if (trackIdx !== -1) {\n const m = content.slice(trackIdx).match(/\\s+track\\s+(.+)$/);\n if (m) {\n trackExpr = m[1].trim();\n body = content.slice(0, trackIdx).trim();\n }\n }\n\n const inIndex = body.lastIndexOf(' in ');\n const keyAndIndex = body.slice(0, inIndex).trim().replace(/^\\(|\\)$/g, '');\n const arrayExpr = body.slice(inIndex + 4).trim();\n const keyParts = keyAndIndex.split(',').map(p => p.trim());\n\n return {\n key: keyParts[0],\n index: keyParts[1] || undefined,\n arrayExpr,\n trackExpr,\n };\n }\n\n /**\n * Resolves the array expression against the store.\n * Supports both plain key lookups and function-call expressions:\n * items → store.get('items')\n * filter(items) → store.get('filter')(store.get('items'))\n */\n private resolveArray(store: AreStore, arrayExpr: string, fullContent: string): any[] {\n let result: any;\n const callMatch = arrayExpr.match(/^([^(]+)\\((.+)\\)$/);\n\n if (callMatch) {\n const fnName = callMatch[1].trim();\n const fn = store.get(fnName as any);\n\n if (typeof fn !== 'function')\n throw new AreCompilerError({\n title: 'Invalid \"for\" Directive Function',\n description: `The expression \"${fnName}\" in the \"for\" directive does not resolve to a function in the store. Received: ${typeof fn}`,\n });\n\n const rawArgs = callMatch[2].split(',').map(a => a.trim());\n const resolvedArgs = rawArgs.map(arg => {\n if (arg.startsWith(\"'\") && arg.endsWith(\"'\")) return arg.slice(1, -1);\n if (arg.startsWith('\"') && arg.endsWith('\"')) return arg.slice(1, -1);\n if (!isNaN(Number(arg))) return Number(arg);\n // Dotted-path / optional-chain: e.g. `record?.embedding` or `record.data`\n const stripped = arg.replace(/\\?$/, '');\n if (stripped.includes('.')) {\n const parts = stripped.split('.').map(p => p.replace(/\\?$/, ''));\n let val: any = store.get(parts[0] as any);\n for (let j = 1; j < parts.length; j++) {\n if (val == null) return undefined;\n val = val[parts[j]];\n }\n return val ?? undefined;\n }\n return store.get(stripped as any);\n });\n\n result = (fn as Function)(...resolvedArgs);\n } else if (arrayExpr.includes('.')) {\n // dotted-path lookup: e.g. \"list.items\" or \"record?.keywords\"\n // Strip optional-chaining `?` suffix from each segment so that\n // `record?.keywords` resolves the same as `record.keywords`.\n const parts = arrayExpr.split('.').map(p => p.replace(/\\?$/, ''));\n result = store.get(parts[0] as any);\n for (let i = 1; i < parts.length; i++) {\n if (result == null) break;\n result = result[parts[i]];\n }\n } else {\n result = store.get(arrayExpr.replace(/\\?$/, '') as any);\n }\n\n // null / undefined from optional-chaining expressions (e.g. `record?.keywords`)\n // means the source object is not yet loaded — treat as empty array so the\n // directive initialises gracefully and fills in when the store updates.\n if (result == null) return [];\n\n if (!Array.isArray(result))\n throw new AreCompilerError({\n title: 'Invalid \"for\" Directive Value',\n description: `The \"for\" directive expects an array but got ${typeof result}. Expression: \"${fullContent}\". Received: ${JSON.stringify(result)}`,\n });\n\n return result;\n }\n\n /**\n * Creates a single item node from the template, registers it as a child of\n * the owner, initialises it, injects item-scoped store values, and activates\n * its scene so the mount/compile cycle will include it.\n *\n * NOTE: This method does NOT call compile() or mount() — the caller is\n * responsible for doing so when the main lifecycle cycle won't cover it\n * (i.e. during update, but not during the initial compile phase).\n */\n private spawnItemNode(\n template: AreHTMLNode,\n owner: AreHTMLNode,\n key: string,\n index: string | undefined,\n item: any,\n i: number,\n ): AreHTMLNode {\n const itemNode = template.clone() as AreHTMLNode;\n\n owner.addChild(itemNode);\n\n const queue = [itemNode];\n\n while (queue.length > 0) {\n const current = queue.shift()!\n\n current.init();\n\n queue.push(...current.children as AreHTMLNode[]);\n }\n\n /**\n * Resolve or create a directive context for the item node. This is needed to hold the item-specific store values (e.g. the \"item\" and \"index\" in a \"for\" loop) that the template's bindings will reference during compile and update. The context is shared among all clones of the same template, but that's fine because each clone gets its own scope values assigned here.\n */\n let directiveContext = itemNode.scope.resolveFlat(AreDirectiveContext);\n\n if (!directiveContext) {\n directiveContext = new AreDirectiveContext(itemNode.aseid);\n itemNode.scope.register(directiveContext);\n }\n\n directiveContext.scope = {\n ...directiveContext.scope,\n [key]: item,\n [index || 'index']: i,\n }\n\n itemNode.scene.activate();\n\n return itemNode;\n }\n}","import { A_Caller, A_Inject, A_Scope } from \"@adaas/a-concept\";\nimport { A_Logger } from \"@adaas/a-utils/a-logger\";\nimport { AreDirectiveAttribute } from \"@adaas/are-html/attributes/AreDirective.attribute\";\nimport { AreScene, AreStore, AreSyntax } from \"@adaas/are\";\nimport { AreDirective } from \"@adaas/are-html/directive/AreDirective.component\";\nimport { AddCommentInstruction } from \"@adaas/are-html/instructions/AddComment.instruction\";\nimport { AreDirectiveContext } from \"@adaas/are-html/directive/AreDirective.context\";\nimport { A_Frame } from \"@adaas/a-frame/core\";\n\n\n\n/**\n * `$if` directive — conditionally renders a node based on an expression.\n *\n * ⚠️ Known limitation: do NOT use `$if` and `$for` on the SAME element.\n * Doing so produces duplicated DOM on toggle because the two directives\n * share an owner node and clone its scope independently. Wrap one in a\n * parent element instead, e.g.:\n *\n * <div $if=\"visible\">\n * <li $for=\"item in items\">{{item.name}}</li>\n * </div>\n *\n * or\n *\n * <ul $for=\"item in items\">\n * <li $if=\"item.visible\">{{item.name}}</li>\n * </ul>\n */\n@A_Frame.Define({\n namespace: 'a-are-html',\n description: 'Built-in $if directive. Conditionally renders a subtree based on a store expression. Replaces the target element with a stable comment anchor when the condition is false and restores the fully rendered subtree when it becomes true, preventing any leaking of the host element between states.'\n})\n@AreDirective.Priority(2)\nexport class AreDirectiveIf extends AreDirective {\n\n\n @AreDirective.Transform\n transform(\n @A_Inject(A_Caller) attribute: AreDirectiveAttribute,\n @A_Inject(A_Scope) scope: A_Scope,\n\n @A_Inject(AreStore) store: AreStore,\n @A_Inject(AreScene) scene: AreScene,\n @A_Inject(A_Logger) logger: A_Logger,\n ...args: any[]\n ) {\n logger.debug(`[Transform] directive $IF for <${attribute.owner.aseid.toString()}>`)\n\n const node = attribute.owner;\n\n /**\n * We have to keep this node as a group node, and copy all data into the child node that would be actual node. \n */\n const ifTemplate = node.cloneWithScope();\n\n const ifAttr = ifTemplate.attributes.find(d => d.name === attribute.name);\n\n if (ifAttr) {\n ifTemplate.scope.deregister(ifAttr);\n node.scope.register(ifAttr);\n }\n\n node.init();\n\n node.addChild(ifTemplate);\n\n /**\n * Resolve or create a directive context for the item node. This is needed to hold the item-specific store values (e.g. the \"item\" and \"index\" in a \"for\" loop) that the template's bindings will reference during compile and update. The context is shared among all clones of the same template, but that's fine because each clone gets its own scope values assigned here.\n */\n // let directiveContext = ifTemplate.scope.resolveFlat(AreDirectiveContext);\n\n // if (!directiveContext) {\n // directiveContext = new AreDirectiveContext(ifTemplate.aseid);\n // ifTemplate.scope.register(directiveContext);\n // }\n\n ifTemplate.scene.deactivate();\n\n attribute.template = ifTemplate;\n\n }\n\n\n @AreDirective.Compile\n compile(\n @A_Inject(A_Caller) attribute: AreDirectiveAttribute,\n @A_Inject(AreStore) store: AreStore,\n @A_Inject(AreScene) scene: AreScene,\n @A_Inject(AreSyntax) syntax: AreSyntax,\n\n @A_Inject(AreDirectiveContext) directiveContext?: AreDirectiveContext,\n ...args: any[]\n ): void {\n /**\n * 1. Extract the value from the store based on the attribute content\n * (which is the path to the value in the store)\n */\n attribute.value = syntax.evaluate(attribute.content, store, {\n ...(directiveContext?.scope || {}),\n });\n\n /**\n * 2. If the value is falsy, remove the node from the scene by planning a RemoveElement instruction.\n * If the value is truthy, ensure the node is in the scene by planning an AddElement instruction if it's not already planned.\n */\n const hostInstruction = scene.host!;\n const commentIdentifier = ` --- if: ${attribute.template!.id} --- `;\n const declaration = new AddCommentInstruction({ content: commentIdentifier })\n\n scene.setHost(declaration);\n scene.planBefore(declaration, hostInstruction);\n scene.unPlan(hostInstruction);\n\n if (attribute.value)\n attribute.template!.scene.activate();\n else\n attribute.template!.scene.deactivate();\n }\n\n\n\n @AreDirective.Update\n update(\n @A_Inject(A_Caller) attribute: AreDirectiveAttribute,\n @A_Inject(AreStore) store: AreStore,\n @A_Inject(A_Scope) scope: A_Scope,\n @A_Inject(AreSyntax) syntax: AreSyntax,\n @A_Inject(AreScene) scene: AreScene,\n ...args: any[]\n ): void {\n /**\n * 1. Extract the value from the store based on the attribute content\n * (which is the path to the value in the store)\n */\n const previous = !!attribute.value;\n const next = !!syntax.evaluate(attribute.content, store);\n attribute.value = next;\n\n // Skip when truthiness has not changed — avoids redundant mount/unmount.\n if (previous === next) return;\n\n if (next) {\n attribute.template!.scene.activate();\n attribute.template!.mount();\n } else {\n attribute.template!.unmount();\n attribute.template!.scene.deactivate();\n }\n }\n\n}","import { A_Frame } from \"@adaas/a-frame/core\"\nimport { AreDeclaration, AreMutation, AreInstructionSerialized } from \"@adaas/are\";\nimport { AreHtmlAddAttributeInstructionPayload } from \"./AreHTML.instructions.types\";\nimport { AreHTMLInstructions } from \"./AreHTML.instructions.constants\";\n\n\n@A_Frame.Define({\n namespace: 'a-are-html',\n description: 'Sets an attribute on an HTML element. Apply calls setAttribute; revert calls removeAttribute.'\n})\nexport class AddAttributeInstruction extends AreMutation<AreHtmlAddAttributeInstructionPayload> {\n\n cache?: string;\n\n constructor(\n parent: AreDeclaration,\n props: AreHtmlAddAttributeInstructionPayload | AreInstructionSerialized<AreHtmlAddAttributeInstructionPayload>) {\n if ('aseid' in props) {\n super(props as AreInstructionSerialized<AreHtmlAddAttributeInstructionPayload>);\n } else {\n super(AreHTMLInstructions.AddAttribute, parent, props);\n }\n }\n}\n","import { A_Frame } from \"@adaas/a-frame/core\"\nimport { AreDeclaration, AreInstructionSerialized } from \"@adaas/are\";\nimport { AreHtmlAddElementInstructionPayload } from \"./AreHTML.instructions.types\";\nimport { AreHTMLInstructions } from \"./AreHTML.instructions.constants\";\n\n\n@A_Frame.Define({\n namespace: 'a-are-html',\n description: 'Creates a new HTML element in the DOM. Apply creates the element; revert removes it.'\n})\nexport class AddElementInstruction extends AreDeclaration<AreHtmlAddElementInstructionPayload> {\n constructor(\n props: AreHtmlAddElementInstructionPayload | AreInstructionSerialized<AreHtmlAddElementInstructionPayload>\n ) {\n if ('aseid' in props) {\n super(props);\n } else {\n super(AreHTMLInstructions.AddElement, props);\n }\n }\n}\n","import { A_Frame } from \"@adaas/a-frame/core\"\nimport { AreDeclaration, AreMutation, AreInstructionSerialized } from \"@adaas/are\";\nimport { AreHtmlAddInterpolationInstructionPayload } from \"./AreHTML.instructions.types\";\nimport { AreHTMLInstructions } from \"./AreHTML.instructions.constants\";\n\n\n@A_Frame.Define({\n namespace: 'a-are-html',\n description: 'Appends a reactive text node whose content is resolved dynamically from the store. Apply creates the text node with the getter; revert removes it.'\n})\nexport class AddInterpolationInstruction extends AreMutation<AreHtmlAddInterpolationInstructionPayload> {\n\n constructor(\n parent: AreDeclaration,\n props: AreHtmlAddInterpolationInstructionPayload | AreInstructionSerialized<AreHtmlAddInterpolationInstructionPayload>\n ) {\n if ('aseid' in props) {\n super(props as AreInstructionSerialized<AreHtmlAddInterpolationInstructionPayload>);\n } else {\n super(AreHTMLInstructions.AddInterpolation, parent, props);\n }\n }\n}\n","import { A_Frame } from \"@adaas/a-frame/core\"\nimport { AreDeclaration, AreMutation, AreInstructionSerialized } from \"@adaas/are\";\nimport { AreHtmlAddListenerInstructionPayload } from \"./AreHTML.instructions.types\";\nimport { AreHTMLInstructions } from \"./AreHTML.instructions.constants\";\n\n\n@A_Frame.Define({\n namespace: 'a-are-html',\n description: 'Attaches a DOM event listener to an element. Apply calls addEventListener; revert calls removeEventListener.'\n})\nexport class AddListenerInstruction extends AreMutation<AreHtmlAddListenerInstructionPayload> {\n\n constructor(\n parent: AreDeclaration,\n props: AreHtmlAddListenerInstructionPayload | AreInstructionSerialized<AreHtmlAddListenerInstructionPayload>\n ) {\n if ('aseid' in props) {\n super(props as AreInstructionSerialized<AreHtmlAddListenerInstructionPayload>);\n } else {\n super(AreHTMLInstructions.AddListener, parent, props);\n }\n }\n}\n","import { A_Frame } from \"@adaas/a-frame/core\"\nimport { AreDeclaration, AreMutation, AreInstructionSerialized } from \"@adaas/are\";\nimport { AreHtmlAddStyleInstructionPayload } from \"./AreHTML.instructions.types\";\nimport { AreHTMLInstructions } from \"./AreHTML.instructions.constants\";\n\n\n@A_Frame.Define({\n namespace: 'a-are-html',\n description: 'Sets an inline CSS style property on an element. Apply sets the property; revert removes it.'\n})\nexport class AddStyleInstruction extends AreMutation<AreHtmlAddStyleInstructionPayload> {\n\n constructor(\n parent: AreDeclaration,\n props: AreHtmlAddStyleInstructionPayload | AreInstructionSerialized<AreHtmlAddStyleInstructionPayload>\n ) {\n if ('aseid' in props) {\n super(props as AreInstructionSerialized<AreHtmlAddStyleInstructionPayload>);\n } else {\n super(AreHTMLInstructions.AddStyle, parent, props);\n }\n }\n}\n","import { A_Frame } from \"@adaas/a-frame/core\"\nimport { AreDeclaration, AreInstructionSerialized } from \"@adaas/are\";\nimport { AreHtmlAddTextInstructionPayload } from \"./AreHTML.instructions.types\";\nimport { AreHTMLInstructions } from \"./AreHTML.instructions.constants\";\n\n\n@A_Frame.Define({\n namespace: 'a-are-html',\n description: 'Appends a text node to an element. Apply creates the text node; revert removes it. Content can be a static string or a dynamic getter for interpolations.'\n})\nexport class AddTextInstruction extends AreDeclaration<AreHtmlAddTextInstructionPayload> {\n\n constructor(props: AreHtmlAddTextInstructionPayload | AreInstructionSerialized<AreHtmlAddTextInstructionPayload>) {\n if ('aseid' in props) {\n super(props as AreInstructionSerialized<AreHtmlAddTextInstructionPayload>);\n } else {\n super(AreHTMLInstructions.AddText, props);\n }\n }\n}\n","import { A_Fragment, ASEID } from \"@adaas/a-concept\";\nimport { A_Frame } from \"@adaas/a-frame/core\";\n\n\n@A_Frame.Define({\n namespace: 'a-are-html',\n description: 'Context fragment that holds the resolved CSS style rules string for a component scope. Populated during lifecycle initialisation and read by the compiler when emitting AddStyle instructions for inline styles declared on the component host element.'\n})\nexport class AreStyle extends A_Fragment {\n\n styles!: string;\n\n constructor(\n styles: string,\n aseid?: ASEID | string,\n\n ) {\n super({\n name: aseid ? aseid.toString() : 'default-style',\n });\n\n this.styles = styles;\n }\n\n}","import { A_Context, } from \"@adaas/a-concept\";\nimport { A_Frame } from \"@adaas/a-frame/core\";\nimport { AreNode} from \"@adaas/are\";\nimport { AreBindingAttribute } from \"@adaas/are-html/attributes/AreBinding.attribute\";\nimport { AreDirectiveAttribute } from \"@adaas/are-html/attributes/AreDirective.attribute\";\nimport { AreEventAttribute } from \"@adaas/are-html/attributes/AreEvent.attribute\";\nimport { AreStaticAttribute } from \"@adaas/are-html/attributes/AreStatic.attribute\";\nimport { AreStyle } from \"@adaas/are-html/style/AreStyle.context\";\nimport { AreDirective } from \"@adaas/are-html/directive/AreDirective.component\";\nimport { AreDirectiveMeta } from \"@adaas/are-html/directive/AreDirective.meta\";\n\n\n\n@A_Frame.Define({\n namespace: 'a-are-html',\n description: 'AreHTMLNode represents a node in the HTML structure. It extends the base AreNode and includes properties and methods specific to HTML nodes, such as handling attributes, directives, events, and styles.'\n})\nexport class AreHTMLNode extends AreNode {\n /**\n * Actual node type. \n * By default it's a tag name\n */\n get tag(): string {\n return this.aseid.entity;\n }\n /**\n * The static attributes defined for the node, which are typically used to represent static properties or characteristics of the node that do not change based on the context or state. These attributes are usually defined in the template and are not reactive.\n * \n * Example: For a node defined as `<div class=\"static-class\">`, the static attribute would be `class=\"static-class\"`.\n */\n get staticAttributes(): AreStaticAttribute[] {\n return this.scope.resolveFlatAll<AreStaticAttribute>(AreStaticAttribute);\n }\n /**\n * The binding attributes defined for the node, which are typically used to represent dynamic properties or characteristics of the node that can change based on the context or state. These attributes are usually defined in the template with a specific syntax (e.g., `:prop=\"value\"` or `v-bind:prop=\"value\"`) and are reactive, meaning that they will update automatically when the underlying data changes.\n * \n * Example: For a node defined as `<div :class=\"dynamicClass\">`, the binding attribute would be `:class=\"dynamicClass\"`.\n */\n get bindings(): AreBindingAttribute[] {\n return this.scope.resolveFlatAll<AreBindingAttribute>(AreBindingAttribute);\n }\n /**\n * The directive attributes defined for the node, which are typically used to represent special instructions or behaviors that should be applied to the node. These attributes are usually defined in the template with a specific syntax (e.g., `v-if=\"condition\"` or `v-for=\"item in list\"`) and are processed by the rendering engine to apply the corresponding logic or behavior to the node.\n * \n * Example: For a node defined as `<div v-if=\"isVisible\">`, the directive attribute would be `v-if=\"isVisible\"`.\n */\n get directives(): AreDirectiveAttribute[] {\n /**\n * 1. get all registered directives for the node\n */\n const directives = this.scope.resolveFlatAll<AreDirectiveAttribute>(AreDirectiveAttribute)!;\n /**\n * 2. Order them in the way that defined in the meta\n * \n * Each meta has a prioprity of order that may impact the way how directives are compiled and rendered. For example, a directive with higher priority may need to be compiled before other directives to ensure that its logic is applied correctly before other directives are processed. By ordering the directives based on their defined priority in the meta, we can ensure that the compilation and rendering process follows the intended logic and behavior as defined by the directive implementations.\n */\n\n return directives.filter(d => d.component).sort((a, b) => {\n const aMeta = A_Context.meta<AreDirectiveMeta, AreDirective>(a.component!);\n const bMeta = A_Context.meta<AreDirectiveMeta, AreDirective>(b.component!);\n\n const aPriority = aMeta.priority ?? 0;\n const bPriority = bMeta.priority ?? 0;\n\n return bPriority - aPriority;\n });\n }\n /**\n * The event attributes defined for the node, which are typically used to represent event listeners or handlers that should be attached to the node. These attributes are usually defined in the template with a specific syntax (e.g., `@click=\"handleClick\"` or `v-on:click=\"handleClick\"`) and are processed by the rendering engine to attach the corresponding event listeners to the node.\n * \n * Example: For a node defined as `<button @click=\"handleClick\">`, the event attribute would be `@click=\"handleClick\"`.\n */\n get events(): AreEventAttribute[] {\n return this.scope.resolveFlatAll<AreEventAttribute>(AreEventAttribute)!;\n }\n /**\n * The styles defined for the node, which can include inline styles or styles defined in a separate stylesheet that are applied to the node. These styles can be used to control the visual appearance of the node and can be defined using standard CSS syntax.\n */\n get styles(): AreStyle {\n return this.scope.resolveFlat<AreStyle>(AreStyle)!;\n }\n\n /**\n * Registers or updates the component-scoped CSS string for this node.\n * Called by the @Are.Styles-decorated method on the associated component.\n * A new AreStyle fragment is registered in scope on first call; subsequent\n * calls update the existing fragment in-place.\n */\n setStyles(css: string): void {\n const existing = this.scope.resolveFlat<AreStyle>(AreStyle);\n if (existing) {\n existing.styles = css;\n } else {\n this.scope.register(new AreStyle(css, this.aseid.toString()));\n }\n }\n\n}","import { AreNodeNewProps } from \"@adaas/are\";\nimport { AreHTMLNode } from \"@adaas/are-html/node\";\nimport { A_Frame } from \"@adaas/a-frame/core\";\n\n@A_Frame.Define({\n namespace: 'a-are-html',\n description: 'Node type representing a comment node in the AreHTMLNode tree. Used as a stable DOM anchor by structural directives such as $if and $for that swap rendered content in and out, ensuring the parent container always has a consistent insertion point.'\n})\nexport class AreComment extends AreHTMLNode {\n\n\n\n fromNew(newEntity: AreNodeNewProps): void {\n super.fromNew({\n ...newEntity,\n payload:{\n ...(newEntity.payload || {}),\n entity: 'are-comment',\n }\n });\n }\n}","import { A_FormatterHelper, } from \"@adaas/a-concept\";\nimport { A_Frame } from \"@adaas/a-frame/core\"\nimport { Are } from \"@adaas/are\";\nimport { AreHTMLNode } from \"@adaas/are-html/node\";\n\n\n@A_Frame.Define({\n namespace: 'a-are-html',\n description: 'AreComponentNode represents a node in the scene graph that corresponds to a component. It extends the base AreNode and includes additional properties and methods specific to component nodes, such as handling attributes, bindings, directives, events, styles, and interpolations associated with the component.'\n})\nexport class AreComponentNode extends AreHTMLNode {\n\n /**\n * A custom component associated with this node, which can be used to provide custom logic and behavior for the node. This component is typically defined in the context and can be resolved based on the node's type or other identifying information. The component can include its own template, markup, styles, and features that are specific to the functionality it provides.\n * \n * Example: If the node type is \"custom-component\", the corresponding component would be resolved from the context and can be used to provide custom rendering and behavior for nodes of that type.\n * \n * [!] Note: The component is optional and may not be defined for all nodes. If no component is associated with the node, it will be treated as a standard HTML element or a basic node without custom logic.\n */\n get component(): Are | undefined {\n return this.scope.resolve<Are>(A_FormatterHelper.toPascalCase(this.aseid.entity)) as Are | undefined;\n }\n\n}","import { AreNodeNewProps } from \"@adaas/are\";\nimport { AreHTMLNode } from \"@adaas/are-html/node\";\nimport { A_Frame } from \"@adaas/a-frame/core\";\n\n\n@A_Frame.Define({\n namespace: 'a-are-html',\n description: 'Node type representing a reactive inline expression in the AreHTMLNode tree. Its content expression is resolved from the store at render time and kept live via an AddInterpolation instruction that updates the corresponding text node on each reactive cycle.'\n})\nexport class AreInterpolation extends AreHTMLNode {\n\n fromNew(newEntity: AreNodeNewProps): void {\n super.fromNew({\n ...newEntity,\n payload:{\n ...(newEntity.payload || {}),\n entity: 'are-interpolation',\n }\n });\n }\n}","import { A_FormatterHelper, } from \"@adaas/a-concept\";\nimport { A_Frame } from \"@adaas/a-frame/core\"\nimport { Are } from \"@adaas/are\";\nimport { AreHTMLNode } from \"@adaas/are-html/node\";\n\n\n@A_Frame.Define({\n namespace: 'a-are-html',\n description: 'AreRootNode represents the root node in the scene graph. It extends the base AreHTMLNode and includes additional properties and methods specific to the root node, such as handling the root element and its associated component.'\n})\nexport class AreRootNode extends AreHTMLNode {\n /**\n * For the root node, we can default to a generic container element like <div> since it serves as the root of the component tree and does not correspond to a specific HTML tag defined in the markup. The actual content and structure of the root node will be determined by the child nodes and components that are rendered within it, allowing for flexibility in how the root node is used and what it contains.\n */\n get tag(): string {\n return 'div';\n }\n /**\n * A custom component associated with this node, which can be used to provide custom logic and behavior for the node. This component is typically defined in the context and can be resolved based on the node's type or other identifying information. The component can include its own template, markup, styles, and features that are specific to the functionality it provides.\n * \n * Example: If the node type is \"custom-component\", the corresponding component would be resolved from the context and can be used to provide custom rendering and behavior for nodes of that type.\n * \n * [!] Note: The component is optional and may not be defined for all nodes. If no component is associated with the node, it will be treated as a standard HTML element or a basic node without custom logic.\n */\n get component(): Are | undefined {\n return this.scope.resolve<Are>(A_FormatterHelper.toPascalCase(this.aseid.entity)) as Are | undefined;\n }\n}","import { AreNodeNewProps } from \"@adaas/are\";\nimport { AreHTMLNode } from \"@adaas/are-html/node\";\nimport { A_Frame } from \"@adaas/a-frame/core\";\n\n\n@A_Frame.Define({\n namespace: 'a-are-html',\n description: 'Node type representing a plain or partially-dynamic text segment in the AreHTMLNode tree. Emits an AddText instruction that sets or updates the corresponding DOM text node; the content may carry a store getter for any dynamic portion.'\n})\nexport class AreText extends AreHTMLNode {\n\n\n fromNew(newEntity: AreNodeNewProps): void {\n super.fromNew({\n ...newEntity,\n payload: {\n ...(newEntity.payload || {}),\n entity: 'are-text',\n }\n });\n }\n}","import { A_Route } from \"@adaas/a-utils/a-route\";\nimport { A_Signal } from \"@adaas/a-utils/a-signal\";\nimport { AreSignal } from \"@adaas/are\";\nimport { A_Frame } from \"@adaas/a-frame/core\";\n\n\n\n@A_Frame.Define({\n namespace: 'a-are-html',\n description: 'ARE signal that carries an A_Route value. Dispatched by AreRouteWatcher on client-side navigation events (pushState, replaceState, popstate). The signal bus delivers it to all subscribed root nodes, triggering route-based conditional rendering across the component tree.'\n})\nexport class AreRoute extends AreSignal<A_Route> {\n\n constructor(path: string | RegExp) {\n super({\n data: new A_Route(path)\n });\n }\n\n get route(): A_Route {\n return this.data;\n }\n\n static default(): AreRoute | undefined {\n return new AreRoute(document.location.pathname || '/');\n }\n\n\n compare(other: A_Signal<A_Route>): boolean {\n return this.route.toRegExp().test(other.data.toString());\n }\n}","// ─────────────────────────────────────────────────────────────────────────────\n// ── SVG ──────────────────────────────────────────────────────────────────────\n// ─────────────────────────────────────────────────────────────────────────────\n\n/** XML namespace URI for SVG elements. */\nexport const SVG_NAMESPACE = 'http://www.w3.org/2000/svg';\n\n/**\n * Maps namespace prefixes used in SVG/XML attributes to their canonical URIs.\n * Used by the interpreter when calling setAttributeNS / removeAttributeNS.\n */\nexport const SVG_ATTRIBUTE_NS: Record<string, string> = {\n xlink: 'http://www.w3.org/1999/xlink',\n xml: 'http://www.w3.org/XML/1998/namespace',\n xmlns: 'http://www.w3.org/2000/xmlns/',\n};\n\n// ─────────────────────────────────────────────────────────────────────────────\n// ── HTML void elements ────────────────────────────────────────────────────────\n// ─────────────────────────────────────────────────────────────────────────────\n\n/**\n * Void HTML elements that cannot have children and must not have a closing tag.\n * Per the HTML5 spec these are treated as self-closing even when written as\n * `<input>` (without the trailing slash `/>`).\n *\n * Reference: https://html.spec.whatwg.org/multipage/syntax.html#void-elements\n */\nexport const VOID_ELEMENTS = new Set<string>([\n 'area', 'base', 'br', 'col', 'embed', 'hr', 'img', 'input',\n 'link', 'meta', 'param', 'source', 'track', 'wbr',\n]);\n\nexport function isVoidElement(tagName: string): boolean {\n return VOID_ELEMENTS.has(tagName.toLowerCase());\n}\n\n/**\n * Boolean HTML attributes whose presence (regardless of value) implies \"true\",\n * and whose absence implies \"false\". Setting these via `setAttribute(name, value)`\n * always renders the attribute, which is wrong for reactive bindings.\n *\n * Reference: https://html.spec.whatwg.org/multipage/indices.html#attributes-3\n */\nexport const BOOLEAN_ATTRIBUTES = new Set<string>([\n 'allowfullscreen',\n 'async',\n 'autofocus',\n 'autoplay',\n 'checked',\n 'controls',\n 'default',\n 'defer',\n 'disabled',\n 'formnovalidate',\n 'hidden',\n 'inert',\n 'ismap',\n 'itemscope',\n 'loop',\n 'multiple',\n 'muted',\n 'nomodule',\n 'novalidate',\n 'open',\n 'playsinline',\n 'readonly',\n 'required',\n 'reversed',\n 'selected',\n]);\n\nexport function isBooleanAttribute(name: string): boolean {\n return BOOLEAN_ATTRIBUTES.has(name.toLowerCase());\n}\n\n/**\n * Form-control IDL properties that must be set as a JS property\n * (not just an attribute) so live user input is reflected.\n *\n * `<input value=\"foo\">` only sets the *default* value;\n * `input.value = \"foo\"` updates the live state.\n */\nexport const IDL_FORM_PROPERTIES: Record<string, Set<string>> = {\n INPUT: new Set(['value', 'checked', 'indeterminate']),\n TEXTAREA: new Set(['value']),\n SELECT: new Set(['value']),\n OPTION: new Set(['selected']),\n};\n\nexport function isIDLFormProperty(tagName: string, attrName: string): boolean {\n const set = IDL_FORM_PROPERTIES[tagName.toUpperCase()];\n return !!set && set.has(attrName);\n}\n\n/**\n * Normalize a `:class` binding value into a single space-separated string.\n * Supports the common shapes:\n * - string → \"a b\"\n * - array<string | object | falsy> → [\"a\", { b: true, c: cond }, null]\n * - object<string, boolean> → { a: true, b: false }\n */\nexport function normalizeClassValue(value: any): string {\n if (value === null || value === undefined || value === false) return '';\n if (typeof value === 'string') return value;\n if (typeof value === 'number') return String(value);\n\n if (Array.isArray(value)) {\n return value.map(normalizeClassValue).filter(Boolean).join(' ');\n }\n if (typeof value === 'object') {\n const parts: string[] = [];\n for (const key of Object.keys(value)) {\n if (value[key]) parts.push(key);\n }\n return parts.join(' ');\n }\n return '';\n}\n\n/**\n * Normalize a `:style` binding value into an inline-style string.\n * Supports:\n * - string → \"color: red; font-size: 12px\"\n * - object<string, string|number> → { color: 'red', fontSize: '12px' }\n * - array<string | object> → ['color: red', { fontSize: '12px' }]\n */\nexport function normalizeStyleValue(value: any): string {\n if (value === null || value === undefined || value === false) return '';\n if (typeof value === 'string') return value;\n if (typeof value === 'number') return String(value);\n\n if (Array.isArray(value)) {\n return value.map(normalizeStyleValue).filter(Boolean).join('; ');\n }\n if (typeof value === 'object') {\n const parts: string[] = [];\n for (const key of Object.keys(value)) {\n const v = value[key];\n if (v === null || v === undefined || v === false) continue;\n const kebab = key.replace(/[A-Z]/g, m => '-' + m.toLowerCase());\n parts.push(`${kebab}: ${v}`);\n }\n return parts.join('; ');\n }\n return '';\n}\n\n/**\n * Parse a DOM event name with modifiers, e.g. \"click.stop.prevent\" or \"keydown.enter\".\n * Returns the bare event name plus the modifier set.\n */\nexport interface ParsedEventName {\n event: string;\n modifiers: Set<string>;\n}\n\nexport function parseEventName(raw: string): ParsedEventName {\n const [event, ...modifiers] = raw.split('.');\n return { event, modifiers: new Set(modifiers) };\n}\n\n/**\n * Known event-listener modifiers that map directly to addEventListener options.\n */\nexport const LISTENER_OPTION_MODIFIERS = new Set(['capture', 'once', 'passive']);\n\n/**\n * Coerce a value into a string for DOM consumption.\n * Avoids \"undefined\"/\"null\"/\"[object Object]\" leaks into the DOM.\n */\nexport function toDOMString(value: any): string {\n if (value === null || value === undefined) return '';\n if (typeof value === 'string') return value;\n if (typeof value === 'number' || typeof value === 'boolean') return String(value);\n try {\n return JSON.stringify(value);\n } catch {\n return '';\n }\n}\n\n\n","import { AreContext, AreDeclaration, AreInstruction, AreNode } from \"@adaas/are\";\nimport { AreHTMLContextConstructor } from \"./AreHTML.types\";\nimport { A_Frame } from \"@adaas/a-frame/core\";\n\n\n@A_Frame.Define({\n namespace: 'a-are-html',\n description: 'Runtime index for the HTML rendering engine. Maps each AreNode and instruction ASEID to its corresponding DOM element so that apply and revert handlers on interpreter instructions can look up their DOM node in O(1). Tracks root-element mounts and maintains the group-level index used by structural directives.'\n})\nexport class AreHTMLEngineContext extends AreContext {\n\n /**\n * Index structure mapping:\n * \n * Node -> Group ID -> Element\n * -----------------------------------------------------------------------------------\n * | - Attribute | group: string | Node\n * | - Directive (e.g. for) | | Node\n */\n\n protected index = {\n /**\n * 1 AreNode = 1 Dom Node\n * \n * uses ASEID\n */\n nodeToHostElements: new Map<string, Node>(),\n /**\n * 1 Group Instruction = MANY Dom Nodes (e.g. for loop)\n * \n * uses ASEID\n */\n groupToElements: new Map<string, Set<Node>>(),\n /**\n * 1 Dom Node = 1 Instruction \n * \n * uses ASEID\n */\n elementToInstruction: new WeakMap<Node, string>(),\n /**\n * 1 Instruction = 1 Dom Node (for CreateElement instructions, for example)\n * \n * uses ASEID\n */\n instructionToElement: new Map<string, Node>(),\n /**\n * Event listeners attached to elements, used for proper cleanup when reverting instructions. Maps a DOM element to a map of event names and their corresponding listeners, allowing the engine to track which listeners are attached to which elements and remove them when necessary (e.g., when an instruction is reverted).\n */\n elementListeners: new WeakMap<Node, Map<string, Set<EventListenerOrEventListenerObject>>>()\n }\n\n /**\n * The root container for the HTML engine, which can be either a Document or a ShadowRoot. This is where the engine will mount the generated DOM elements. The context uses this container to manage the relationship between AreNodes, instructions, and their corresponding DOM elements, allowing for efficient updates and cleanups as the application state changes.\n */\n protected _container: Document;\n\n\n constructor(props: Partial<AreHTMLContextConstructor>) {\n super(props.container?.body.innerHTML || props.source || '');\n this._container = props.container!;\n }\n\n get container(): Document {\n return this._container;\n }\n\n\n /**\n * Retrieves the DOM element associated with a given AreNode. This method looks up the node's ASEID in the nodeToHostElements map to find the corresponding DOM element. If the node is not found, it returns undefined. This allows the engine to efficiently access and manipulate the DOM elements that correspond to specific nodes in the AreNode tree, enabling dynamic updates and interactions based on the application state.\n * \n * @param nodeASEID \n */\n getNodeElement(nodeASEID: string): Node | undefined\n getNodeElement(node: AreNode): Node | undefined\n getNodeElement(node: AreNode | string): Node | undefined {\n if (typeof node === 'string') {\n return this.index.nodeToHostElements.get(node);\n } else {\n return this.index.nodeToHostElements.get(node.aseid.toString());\n }\n }\n\n /**\n * Associates a DOM element with a given instruction and its owner node. This method updates the context's index to map the instruction's ASEID to the provided DOM element, and also maps the element back to the instruction's ASEID for reverse lookup. If the instruction has an owner node, it also maps the node's ASEID to the element. Additionally, if the instruction belongs to a group, it adds the element to the set of elements associated with that group. This indexing allows the engine to efficiently manage and update DOM elements based on instructions and their corresponding nodes, enabling dynamic rendering and interaction in response to application state changes.\n * \n * @param instruction \n * @param element \n */\n setInstructionElement(instruction: AreInstruction, element: Node): void {\n const node = instruction.owner;\n\n this.index.instructionToElement.set(instruction.aseid.toString(), element);\n this.index.elementToInstruction.set(element, instruction.aseid.toString());\n\n // Only update the host-element pointer for declaration instructions.\n // Mutations (attributes, styles, event listeners, …) produce auxiliary DOM\n // that must never overwrite the owning node's primary element in the index.\n if (node && instruction instanceof AreDeclaration) {\n this.index.nodeToHostElements.set(node.aseid.toString(), element);\n }\n\n if (instruction.group) {\n const groupId = instruction.group;\n if (!this.index.groupToElements.has(groupId)) {\n this.index.groupToElements.set(groupId, new Set());\n }\n this.index.groupToElements.get(groupId)!.add(element);\n }\n }\n\n /**\n * Retrieves the DOM element associated with a given instruction. This method looks up the instruction's ASEID in the instructionToElement map to find the corresponding DOM element. If the instruction is not found, it returns undefined. This allows the engine to efficiently access and manipulate the DOM elements that correspond to specific instructions, enabling dynamic updates and interactions based on the application state.\n * \n * @param instructionASEID \n */\n getElementByInstruction(instructionASEID: string): Node | undefined\n getElementByInstruction(instruction: AreInstruction): Node | undefined\n getElementByInstruction(instruction: AreInstruction | string): Node | undefined {\n if (typeof instruction === 'string') {\n return this.index.instructionToElement.get(instruction);\n } else {\n return this.index.instructionToElement.get(instruction.aseid.toString());\n }\n }\n\n\n /**\n * Removes the association between a given instruction and its corresponding DOM element. This method looks up the instruction's ASEID to find the associated DOM element, and if found, it deletes the mapping from both instructionToElement and elementToInstruction. If the instruction has an owner node, it also removes the mapping from nodeToHostElements. Additionally, if the instruction belongs to a group, it removes the element from the set of elements associated with that group, and if the group has no more elements, it deletes the group from the index. This cleanup is essential for maintaining an accurate and efficient mapping of instructions to DOM elements, especially when instructions are reverted or when nodes are removed from the DOM.\n * \n * @param instruction \n */\n removeInstructionElement(instruction: AreInstruction): void {\n const element = this.index.instructionToElement.get(instruction.aseid.toString());\n if (element) {\n this.index.instructionToElement.delete(instruction.aseid.toString());\n this.index.elementToInstruction.delete(element);\n\n const node = instruction.owner;\n if (node && instruction instanceof AreDeclaration) {\n this.index.nodeToHostElements.delete(node.aseid.toString());\n }\n\n if (instruction.group) {\n const groupId = instruction.group;\n const groupElements = this.index.groupToElements.get(groupId);\n if (groupElements) {\n groupElements.delete(element);\n if (groupElements.size === 0) {\n this.index.groupToElements.delete(groupId);\n }\n }\n }\n }\n }\n\n /**\n * Retrieves the set of DOM elements associated with a given group. This method looks up the group name or instruction's ASEID in the groupToElements map to find the corresponding set of DOM elements. If the group is not found, it returns undefined. This allows the engine to efficiently access and manipulate all DOM elements that belong to a specific group (e.g., all elements generated by a particular loop instruction), enabling dynamic updates and interactions based on the application state.\n * \n * @param groupName \n */\n getElementsByGroup(groupName: string): Set<Node> | undefined\n getElementsByGroup(instruction: AreInstruction): Set<Node> | undefined\n getElementsByGroup(instruction: AreInstruction | string): Set<Node> | undefined {\n if (typeof instruction === 'string') {\n return this.index.groupToElements.get(instruction);\n } else {\n return this.index.groupToElements.get(instruction.aseid.toString());\n }\n }\n\n /**\n * Adds an event listener to a specific DOM element and keeps track of it in the context's index for proper cleanup later. This method takes a DOM element, an event name, and a listener function or object, and stores this information in the elementListeners map. This allows the engine to efficiently manage event listeners attached to dynamically created elements, ensuring that they can be removed when the associated instructions are reverted or when nodes are removed from the DOM, preventing memory leaks and unintended behavior.\n * \n * @param element \n * @param eventName \n * @param listener \n */\n addListener(element: Node, eventName: string, listener: EventListenerOrEventListenerObject): void {\n if (!this.index.elementListeners.has(element)) {\n this.index.elementListeners.set(element, new Map());\n }\n const byEvent = this.index.elementListeners.get(element)!;\n if (!byEvent.has(eventName)) {\n byEvent.set(eventName, new Set());\n }\n byEvent.get(eventName)!.add(listener);\n }\n /**\n * Retrieves the event listener associated with a specific DOM element and event name from the context's index. This method looks up the element in the elementListeners map and then retrieves the listener for the specified event name. If no listener is found for the given element and event, it returns undefined. This allows the engine to efficiently access and manage event listeners that have been attached to dynamically created elements, enabling proper cleanup when instructions are reverted or when nodes are removed from the DOM.\n * \n * @param element \n * @param eventName \n * @returns \n */\n getListener(element: Node, eventName: string): EventListenerOrEventListenerObject | undefined {\n const set = this.index.elementListeners.get(element)?.get(eventName);\n if (!set || set.size === 0) return undefined;\n // Return the first listener for backwards compatibility.\n return set.values().next().value;\n }\n\n /**\n * Returns all listeners registered for a given element + event name.\n */\n getListeners(element: Node, eventName: string): Set<EventListenerOrEventListenerObject> | undefined {\n return this.index.elementListeners.get(element)?.get(eventName);\n }\n /**\n * Removes an event listener from a specific DOM element and updates the context's index accordingly. This method looks up the element in the elementListeners map and deletes the listener for the specified event name. This is typically called when an instruction is reverted or when a node is removed from the DOM, ensuring that any attached event listeners are properly cleaned up to prevent memory leaks and unintended behavior.\n * \n * @param element \n * @param eventName \n */\n removeListener(element: Node, eventName: string, listener?: EventListenerOrEventListenerObject): void {\n const byEvent = this.index.elementListeners.get(element);\n if (!byEvent) return;\n if (listener) {\n const set = byEvent.get(eventName);\n if (set) {\n set.delete(listener);\n if (set.size === 0) byEvent.delete(eventName);\n }\n } else {\n byEvent.delete(eventName);\n }\n }\n}\n","import { A_Caller, A_Dependency, A_Feature, A_FormatterHelper, A_Inject } from \"@adaas/a-concept\";\nimport { A_Logger } from \"@adaas/a-utils/a-logger\";\nimport { A_Frame } from \"@adaas/a-frame/core\";\nimport { AreCompiler, AreScene, AreCompilerError, AreStore, AreSyntax } from \"@adaas/are\";\nimport { AreDirectiveAttribute } from \"@adaas/are-html/attributes/AreDirective.attribute\";\nimport { AreStaticAttribute } from \"@adaas/are-html/attributes/AreStatic.attribute\";\nimport { AreDirectiveFeatures } from \"@adaas/are-html/directive/AreDirective.constants\";\nimport { AreEventAttribute } from \"@adaas/are-html/attributes/AreEvent.attribute\";\nimport { AreBindingAttribute } from \"@adaas/are-html/attributes/AreBinding.attribute\";\nimport { AreInterpolation } from \"@adaas/are-html/nodes/AreInterpolation\";\nimport { AreText } from \"@adaas/are-html/nodes/AreText\";\nimport { AddAttributeInstruction} from \"@adaas/are-html/instructions/AddAttribute.instruction\";\nimport { AddTextInstruction} from \"@adaas/are-html/instructions/AddText.instruction\";\nimport { AddListenerInstruction} from \"@adaas/are-html/instructions/AddListener.instruction\";\nimport { AddStyleInstruction } from \"@adaas/are-html/instructions/AddStyle.instruction\";\nimport { AreHTMLNode } from \"@adaas/are-html/node\";\n\n\n\n\n@A_Frame.Define({\n namespace: 'a-are-html',\n description: 'HTML-specific compiler for A-Concept Rendering Engine (ARE) components, extending the base AreCompiler to handle HTML templates, styles, and rendering logic tailored for web environments.'\n})\nexport class AreHTMLCompiler extends AreCompiler {\n\n /**\n * Extends the base compile for all AreHTMLNode instances (elements, components, root nodes).\n * After the standard element/attribute/children instructions are emitted, checks whether\n * the node has a registered AreStyle and plans an AddStyleInstruction so the interpreter\n * can inject the CSS into the document head during mount.\n */\n @AreCompiler.Compile(AreHTMLNode)\n compileHTMLNode(\n @A_Inject(A_Caller) node: AreHTMLNode,\n @A_Inject(AreScene) scene: AreScene,\n @A_Inject(A_Logger) logger?: A_Logger,\n ...args: any[]\n ): void {\n super.compile(node, scene, logger, ...args);\n\n if (node.styles?.styles) {\n const host = scene.host;\n if (host) {\n scene.plan(new AddStyleInstruction(host, { styles: node.styles.styles }));\n }\n }\n }\n\n // -----------------------------------------------------------------------------------------\n // -------------------------Are-Interpolation Compile Section-----------------------------------\n // -----------------------------------------------------------------------------------------\n /**\n * Default compile method for interpolations, which can be overridden by specific implementations if needed.\n * \n * @param interpolation \n * @param scope \n * @param scene \n * @param store \n * @param feature \n */\n @AreCompiler.Compile(AreInterpolation)\n compileInterpolation(\n @A_Inject(A_Caller) interpolation: AreInterpolation,\n @A_Inject(AreScene) scene: AreScene,\n\n @A_Inject(AreStore) store: AreStore,\n @A_Inject(A_Logger) logger?: A_Logger,\n ...args: any[]\n ) {\n // if (scene.host)\n // console.log('Scene Host: ', scene.host);\n\n // let content = '';\n\n // logger?.debug('green', `AreHTMLCompiler: compile interpolation <${interpolation.aseid.toString()}> with key: \"${interpolation.content}\"`, store.get(interpolation.content));\n\n // try {\n // content = AreCommonHelper.evaluate(interpolation.content, store);\n\n // } catch (error) {\n // content = ''\n // }\n\n scene.plan(new AddTextInstruction({ content: interpolation.content, evaluate: true }));\n }\n\n // -----------------------------------------------------------------------------------------\n // ------------------------------Are-Text Compile Section-----------------------------------\n // -----------------------------------------------------------------------------------------\n @AreCompiler.Compile(AreText)\n compileText(\n @A_Inject(A_Caller) text: AreText,\n @A_Inject(AreScene) scene: AreScene,\n @A_Inject(A_Logger) logger?: A_Logger,\n ...args: any[]\n ) {\n logger?.debug('cyan', `AreHTMLCompiler: compile text node <${text.aseid.toString()}> with content: \"${text.content}\"`);\n if (scene.host)\n scene.unPlan(scene.host);\n\n scene.plan(new AddTextInstruction({ content: text.content }));\n\n }\n\n // -----------------------------------------------------------------------------------------\n // -------------------------Are-Attribute Compile Section-----------------------------------\n // -----------------------------------------------------------------------------------------\n\n @AreCompiler.Compile(AreStaticAttribute)\n compileStaticAttribute(\n @A_Inject(A_Caller) attribute: AreStaticAttribute,\n @A_Inject(AreScene) scene: AreScene,\n ...args: any[]\n ) {\n if (!scene.host)\n throw new AreCompilerError({\n title: 'Scene Host Not Found',\n description: `No host found for the scene with id: ${scene.id}. Please ensure that the scene is properly initialized and has a host before compiling binding attributes.`\n });\n\n const content = attribute.content;\n\n /**\n * If the attribute value contains {{ }} interpolations, transform them into\n * a JS string-concatenation expression so the interpreter can evaluate them.\n * e.g. \"color:{{expr}}\" → '\"color:\"+(expr)+\"\"'\n */\n if (content.includes('{{')) {\n const transformed = '\"' + content.replace(/\\{\\{([^}]+)\\}\\}/g, '\"+($1)+\"') + '\"';\n scene.plan(new AddAttributeInstruction(scene.host, {\n name: attribute.name,\n content: transformed,\n evaluate: true,\n }));\n return;\n }\n\n /**\n * Default case: regular static attribute rendered as-is.\n */\n scene.plan(new AddAttributeInstruction(scene.host, {\n name: attribute.name,\n content: attribute.content\n }));\n }\n\n @AreCompiler.Compile(AreDirectiveAttribute)\n compileDirectiveAttribute(\n @A_Inject(A_Caller) directive: AreDirectiveAttribute,\n @A_Inject(AreStore) store: AreStore,\n @A_Inject(A_Feature) feature: A_Feature,\n @A_Inject(A_Logger) logger?: A_Logger,\n ...args: any[]\n ) {\n store.watch(directive);\n\n /**\n * 3. If the attribute is a directive, then we should find a component that is responsible for\n * the directive compiling logic, and call it. \n * In case component is not found we just want to log a warning, \n * since the directive may be handled by some parent component or simply is a mistake in the template.\n */\n if (directive.component) {\n feature.chain(directive.component, AreDirectiveFeatures.Compile, directive.owner.scope);\n } else {\n logger?.warning(`Directive handler component not found for directive: ${directive.name}. Make sure to create a component named \"AreDirective${A_FormatterHelper.toPascalCase(directive.name)}\" to handle this directive.`);\n }\n\n store.unwatch(directive);\n }\n\n\n @AreCompiler.Compile(AreEventAttribute)\n compileEventAttribute(\n @A_Inject(A_Caller) attribute: AreEventAttribute,\n @A_Inject(AreScene) scene: AreScene,\n ...args: any[]\n ) {\n\n if (!scene.host)\n throw new AreCompilerError({\n title: 'Scene Host Not Found',\n description: `No host found for the scene with id: ${scene.id}. Please ensure that the scene is properly initialized and has a host before compiling binding attributes.`\n });\n /**\n * 2. In case the attribute is an event listener, then \n * we should simply add a callback handler that will be used to proxy an event \n * into the ComponentNode component. \n *[!] In this case AreAttribute is AreEventAttribute that has prepared callback function to be used \n * in the event listener. It is important to store callback function once \n * to prevent duplicated functions in case of multiple compilations during development.\n */\n scene.plan(new AddListenerInstruction(scene.host, {\n name: attribute.name,\n handler: attribute.content\n }));\n }\n\n\n @AreCompiler.Compile(AreBindingAttribute)\n compileBindingAttribute(\n @A_Inject(A_Caller) attribute: AreBindingAttribute,\n @A_Inject(AreScene) scene: AreScene,\n @A_Dependency.Parent()\n @A_Inject(AreStore) parentStore: AreStore,\n @A_Inject(AreStore) store: AreStore,\n @A_Inject(AreSyntax) syntax: AreSyntax,\n ...args: any[]\n ) {\n if (!scene.host)\n throw new AreCompilerError({\n title: 'Scene Host Not Found',\n description: `No host found for the scene with id: ${scene.id}. Please ensure that the scene is properly initialized and has a host before compiling binding attributes.`\n });\n\n\n const node = attribute.owner;\n const props = node.component?.props;\n\n // Component prop names are typically declared in camelCase, while template\n // markup uses kebab-case. Try both forms when matching.\n let propName: string | undefined;\n if (props) {\n if (props[attribute.name]) {\n propName = attribute.name;\n } else {\n const camel = A_FormatterHelper.toCamelCase(attribute.name);\n if (props[camel]) propName = camel;\n }\n }\n\n /**\n * 1. Component prop binding — evaluate against the parent store and\n * keep the child store reactive to upstream changes.\n */\n if (propName && props) {\n const propDefinition = props[propName];\n\n const coerce = (raw: any): any => {\n let value = raw;\n if (propDefinition.type) {\n switch (propDefinition.type) {\n case 'string': value = value === undefined || value === null ? '' : String(value); break;\n case 'number': value = Number(value); break;\n case 'boolean': value = Boolean(value); break;\n }\n }\n return value;\n };\n\n // The watcher entity below is registered against parentStore so that\n // updates to the bound expression in the parent flow into the child store.\n const watcher = {\n update: () => {\n try {\n parentStore.watch(watcher);\n const next = coerce(syntax.evaluate(attribute.content, parentStore));\n parentStore.unwatch(watcher);\n store.set(propName!, next);\n } catch (e) {\n parentStore.unwatch(watcher);\n }\n }\n };\n\n // Initial read with watch active so dependencies are recorded.\n parentStore.watch(watcher);\n const initial = coerce(syntax.evaluate(attribute.content, parentStore));\n parentStore.unwatch(watcher);\n\n store.set(propName, initial);\n return;\n }\n\n /**\n * 2. Default attribute binding — evaluated reactively against the local store.\n */\n const instruction = new AddAttributeInstruction(scene.host, {\n name: attribute.name,\n content: attribute.content,\n evaluate: true\n })\n\n scene.plan(instruction);\n }\n\n\n}","import { A_Caller, A_Inject } from \"@adaas/a-concept\";\nimport { A_Frame } from \"@adaas/a-frame/core\"\nimport { A_Logger } from \"@adaas/a-utils/a-logger\";\nimport {\n AreSyntax, AreStore,\n AreEvent,\n AreInstructionDefaultNames,\n AreInterpreterError,\n AreInterpreter\n} from \"@adaas/are\";\nimport { AreHTMLInstructions } from \"@adaas/are-html/instructions/AreHTML.instructions.constants\";\nimport { AddAttributeInstruction } from \"@adaas/are-html/instructions/AddAttribute.instruction\";\nimport { AddCommentInstruction } from \"@adaas/are-html/instructions/AddComment.instruction\";\nimport { AddElementInstruction } from \"@adaas/are-html/instructions/AddElement.instruction\";\nimport { AddListenerInstruction } from \"@adaas/are-html/instructions/AddListener.instruction\";\nimport { AddTextInstruction } from \"@adaas/are-html/instructions/AddText.instruction\";\nimport { AddStyleInstruction } from \"@adaas/are-html/instructions/AddStyle.instruction\";\nimport { AreDirectiveContext } from \"@adaas/are-html/directive/AreDirective.context\";\nimport { AreHTMLNode } from \"../lib/AreHTMLNode/AreHTMLNode\";\nimport { AreHTMLEngineContext } from \"./AreHTML.context\";\nimport {\n isBooleanAttribute,\n isIDLFormProperty,\n normalizeClassValue,\n normalizeStyleValue,\n parseEventName,\n toDOMString,\n SVG_NAMESPACE,\n SVG_ATTRIBUTE_NS,\n} from \"./AreHTML.constants\";\n\n\n@A_Frame.Define({\n namespace: 'a-are-html',\n description: 'DOM interpreter for the HTML rendering pipeline. Extends AreInterpreter to apply and revert each ARE instruction type directly against the browser DOM — creating and removing elements, setting and removing attributes and event listeners, managing inline styles, and inserting text and comment nodes. Driven by the scene diff computed per render cycle.'\n})\nexport class AreHTMLInterpreter extends AreInterpreter {\n // ─────────────────────────────────────────────────────────────────────────────\n // ── CreateElement — Apply / Revert ───────────────────────────────────────────\n // ─────────────────────────────────────────────────────────────────────────────\n @A_Frame.Define({\n description: 'Create an HTML element based on the provided declaration instruction. Handles both root-level mounting and child element creation based on the structural parent hierarchy.'\n })\n @AreInterpreter.Apply(AreInstructionDefaultNames.Default)\n @AreInterpreter.Apply(AreHTMLInstructions.AddElement)\n addElement(\n @A_Inject(A_Caller) declaration: AddElementInstruction,\n @A_Inject(AreHTMLEngineContext) context: AreHTMLEngineContext,\n @A_Inject(A_Logger) logger?: A_Logger,\n ) {\n try {\n const node = declaration.owner as AreHTMLNode;\n\n let currentNode: AreHTMLNode | undefined = node;\n let parent: AreHTMLNode | undefined = node.parent as AreHTMLNode | undefined;\n\n while (parent) {\n if (context.getNodeElement(parent)) {\n break;\n }\n currentNode = parent;\n parent = parent.parent as AreHTMLNode | undefined;\n }\n\n\n // Determine the element tag — components render as a wrapper div\n const tag = node.tag;\n\n const isSVG = tag === 'svg' || this.isInSVGContext(node);\n\n if (parent) {\n\n const mountPoint = context.getNodeElement(parent)\n\n if (!mountPoint) {\n throw new AreInterpreterError({\n title: 'Mount Point Not Found',\n description: `Could not find a mount point for the node with id \"${node.id}\". Ensure that the parent node is rendered before its children, or that a valid root element with the corresponding id exists in the DOM.`\n });\n }\n\n const element = isSVG\n ? context.container.createElementNS(SVG_NAMESPACE, tag)\n : context.container.createElement(tag);\n\n if (mountPoint.nodeType === Node.ELEMENT_NODE) {\n // parent is a real element — just append\n mountPoint.appendChild(element);\n } else {\n // parent is an anchor (comment/text node) — insert before it\n // so content always appears before the anchor marker\n mountPoint.parentNode?.insertBefore(element, mountPoint);\n }\n\n context.setInstructionElement(declaration, element);\n\n } else {\n const mountPoint = context.container.getElementById(node.id);\n if (!mountPoint) {\n throw new AreInterpreterError({\n title: 'Mount Point Not Found',\n description: `Could not find a mount point for the node with id \"${node.id}\". Ensure that the parent node is rendered before its children, or that a valid root element with the corresponding id exists in the DOM.`\n });\n }\n\n const element = isSVG\n ? context.container.createElementNS(SVG_NAMESPACE, tag)\n : context.container.createElement(tag);\n\n mountPoint.parentNode?.replaceChild(element, mountPoint);\n\n context.setInstructionElement(declaration, element);\n }\n\n // Register the element in the context index\n\n logger?.debug('green', `Element ${node.aseid.toString()} added to Context:`);\n\n } catch (error) {\n logger?.error(error);\n throw error;\n }\n }\n\n\n @A_Frame.Define({\n description: 'Remove an HTML element that was created by a CreateElement declaration. Cleans up the DOM and the context index.'\n })\n @AreInterpreter.Revert(AreInstructionDefaultNames.Default)\n @AreInterpreter.Revert(AreHTMLInstructions.AddElement)\n removeElement(\n @A_Inject(A_Caller) declaration: AddElementInstruction,\n @A_Inject(AreHTMLEngineContext) context: AreHTMLEngineContext,\n ) {\n const element = context.getElementByInstruction(declaration);\n\n if (element && element.parentNode) {\n element.parentNode.removeChild(element);\n }\n\n context.removeInstructionElement(declaration);\n }\n\n\n // ─────────────────────────────────────────────────────────────────────────────\n // ── AddAttribute — Apply / Revert ────────────────────────────────────────────\n // ─────────────────────────────────────────────────────────────────────────────\n @A_Frame.Define({\n description: 'Add an attribute to an HTML element based on the provided mutation instruction.'\n })\n @AreInterpreter.Apply(AreHTMLInstructions.AddAttribute)\n @AreInterpreter.Update(AreHTMLInstructions.AddAttribute)\n addAttribute(\n @A_Inject(A_Caller) mutation: AddAttributeInstruction,\n @A_Inject(AreHTMLEngineContext) context: AreHTMLEngineContext,\n @A_Inject(AreStore) store: AreStore,\n @A_Inject(AreSyntax) syntax: AreSyntax,\n @A_Inject(AreDirectiveContext) directiveContext?: AreDirectiveContext,\n\n @A_Inject(A_Logger) logger?: A_Logger,\n ): void {\n const element = context.getElementByInstruction(mutation.parent!);\n\n\n if (!element) {\n throw new AreInterpreterError({\n title: 'Element Not Found',\n description: `Could not find a DOM element associated with the instruction ASEID \"${mutation.parent}\". Ensure that the parent instruction is properly rendered and associated with a DOM element before applying attribute mutations.`\n });\n }\n const { name, content, evaluate } = mutation.payload;\n\n const rawValue = evaluate ? syntax.evaluate(content, store, {\n ...(directiveContext?.scope || {})\n }) : content;\n\n const el = element as HTMLElement;\n const lowerName = name.toLowerCase();\n\n // ── 0. Namespace-prefixed attributes (xlink:href, xml:space, xmlns:*) ──\n const colonIdx = name.indexOf(':');\n if (colonIdx > 0) {\n const ns = SVG_ATTRIBUTE_NS[name.slice(0, colonIdx)];\n if (ns) {\n (el as Element).setAttributeNS(ns, name, toDOMString(rawValue));\n mutation.cache = toDOMString(rawValue);\n return;\n }\n }\n\n // ── 1. Boolean attributes ────────────────────────────────────────────\n if (isBooleanAttribute(lowerName)) {\n if (rawValue) {\n el.setAttribute(lowerName, '');\n // also reflect IDL property where supported (disabled, hidden, …)\n try { (el as any)[lowerName] = true; } catch { /* ignore */ }\n } else {\n el.removeAttribute(lowerName);\n try { (el as any)[lowerName] = false; } catch { /* ignore */ }\n }\n mutation.cache = rawValue ? 'true' : '';\n return;\n }\n\n // ── 2. Form-control IDL properties (value/checked/selected) ─────────\n if (isIDLFormProperty(el.tagName, name)) {\n const propName = name === 'value' ? 'value'\n : name === 'checked' ? 'checked'\n : name === 'selected' ? 'selected'\n : name === 'indeterminate' ? 'indeterminate'\n : name;\n try {\n if (propName === 'checked' || propName === 'selected' || propName === 'indeterminate') {\n (el as any)[propName] = !!rawValue;\n } else {\n (el as any)[propName] = toDOMString(rawValue);\n }\n } catch { /* ignore */ }\n // also keep the attribute in sync for SSR/CSS selectors\n if (propName !== 'value') {\n if (rawValue) el.setAttribute(name, ''); else el.removeAttribute(name);\n } else {\n el.setAttribute(name, toDOMString(rawValue));\n }\n mutation.cache = toDOMString(rawValue);\n return;\n }\n\n // ── 3. Class binding — supports object/array/string and merges ──────\n if (lowerName === 'class') {\n const newValue = normalizeClassValue(rawValue);\n\n if (mutation.cache === undefined) {\n const existingValue = el.getAttribute('class');\n const merged = existingValue ? `${existingValue} ${newValue}`.trim() : newValue;\n if (merged) el.setAttribute('class', merged); else el.removeAttribute('class');\n } else {\n const existingValue = el.getAttribute('class');\n const existingParts = existingValue ? existingValue.split(/\\s+/).filter(Boolean) : [];\n const oldParts = new Set((mutation.cache as string).split(/\\s+/).filter(Boolean));\n const newParts = newValue ? newValue.split(/\\s+/).filter(Boolean) : [];\n\n const merged = [...existingParts.filter(p => !oldParts.has(p)), ...newParts].join(' ');\n if (merged) el.setAttribute('class', merged); else el.removeAttribute('class');\n }\n mutation.cache = newValue;\n return;\n }\n\n // ── 4. Style binding — supports object/array/string ─────────────────\n if (lowerName === 'style') {\n const newValue = normalizeStyleValue(rawValue);\n if (newValue) el.setAttribute('style', newValue); else el.removeAttribute('style');\n mutation.cache = newValue;\n return;\n }\n\n // ── 5. Default: replace attribute (no whitespace merge) ─────────────\n const stringValue = toDOMString(rawValue);\n if (stringValue === '' && evaluate && (rawValue === false || rawValue === null || rawValue === undefined)) {\n el.removeAttribute(name);\n } else {\n el.setAttribute(name, stringValue);\n }\n mutation.cache = stringValue;\n\n\n }\n\n @A_Frame.Define({\n description: 'Remove an attribute from an HTML element based on the provided mutation instruction.'\n })\n @AreInterpreter.Revert(AreHTMLInstructions.AddAttribute)\n removeAttribute(\n @A_Inject(A_Caller) mutation: AddAttributeInstruction,\n @A_Inject(AreHTMLEngineContext) context: AreHTMLEngineContext,\n ): void {\n try {\n const element = context.getElementByInstruction(mutation.parent!);\n\n if (!element) return;\n\n const { name } = mutation.payload;\n\n if (name && element.nodeType === Node.ELEMENT_NODE) {\n const colonIdx = name.indexOf(':');\n if (colonIdx > 0) {\n const ns = SVG_ATTRIBUTE_NS[name.slice(0, colonIdx)];\n if (ns) {\n (element as Element).removeAttributeNS(ns, name.slice(colonIdx + 1));\n } else {\n (element as HTMLElement).removeAttribute(name);\n }\n } else {\n (element as HTMLElement).removeAttribute(name);\n }\n }\n } catch (error) {\n console.log('Error removing attribute:', error);\n }\n\n }\n\n\n // ─────────────────────────────────────────────────────────────────────────────\n // ── addEventListener — Apply / Revert ────────────────────────────────────────\n // ─────────────────────────────────────────────────────────────────────────────\n\n @A_Frame.Define({\n description: 'Add an event listener to an HTML element based on the provided mutation instruction.'\n })\n @AreInterpreter.Apply(AreHTMLInstructions.AddListener)\n addEventListener(\n @A_Inject(A_Caller) mutation: AddListenerInstruction,\n @A_Inject(AreHTMLEngineContext) context: AreHTMLEngineContext,\n @A_Inject(AreStore) store: AreStore,\n @A_Inject(AreSyntax) syntax: AreSyntax,\n @A_Inject(AreDirectiveContext) directiveContext?: AreDirectiveContext,\n @A_Inject(A_Logger) logger?: A_Logger,\n ) {\n\n const element = context.getElementByInstruction(mutation.parent);\n\n if (!element) {\n throw new AreInterpreterError({\n title: 'Element Not Found',\n description: `Could not find a DOM element associated with the instruction ASEID \"${mutation.parent}\". Ensure that the parent instruction is properly rendered and associated with a DOM element before adding event listeners.`\n });\n }\n\n /**\n * e.g. @click=\"handleClick\"\n * e.g. @click=\"handleClick($event, element)\"\n * e.g. @click.stop.prevent=\"handleClick\"\n * e.g. @keydown.enter=\"submit\"\n * e.g. @click=\"(e)=> user.name ? handleClick(e) : null\"\n */\n\n const { event: eventName, modifiers } = parseEventName(mutation.payload.name);\n\n const listenerOptions: AddEventListenerOptions = {};\n if (modifiers.has('capture')) listenerOptions.capture = true;\n if (modifiers.has('once')) listenerOptions.once = true;\n if (modifiers.has('passive')) listenerOptions.passive = true;\n\n const handlers = syntax.extractEmitHandlers(mutation.payload.handler);\n\n // Holds the live DOM event so handler invocations (with or without\n // template arguments) always have access to it.\n let liveEvent: Event | null = null;\n\n const handlerScope: Record<string, any> = {};\n\n for (const handler of handlers) {\n const handlerFn = (...args: any[]) => {\n const event = new AreEvent(handler);\n // If user passed only template args (e.g. $h('x')), append the DOM\n // event as the last arg. If they passed nothing, args[0] is the DOM event.\n const effectiveArgs = args.length === 0 && liveEvent\n ? [liveEvent]\n : liveEvent\n ? [...args, liveEvent]\n : args;\n event.set('args', effectiveArgs);\n event.set('element', element);\n event.set('instruction', mutation);\n // Expose the raw DOM event under the conventional 'native' key so that\n // event handlers can do: event.get('native')?.target as HTMLInputElement\n if (liveEvent) event.set('native', liveEvent as any);\n mutation.owner.emit(event);\n };\n handlerScope[`$${handler}`] = handlerFn;\n }\n\n const callback = (e: Event) => {\n try {\n liveEvent = e;\n\n if (modifiers.has('self') && e.target !== element) return;\n if (modifiers.has('stop')) e.stopPropagation();\n if (modifiers.has('prevent')) e.preventDefault();\n\n // key-name modifiers for keyboard events: @keydown.enter / .esc / .tab / .space / .up / .down / .left / .right / .delete\n if (e instanceof KeyboardEvent && modifiers.size > 0) {\n const key = (e.key || '').toLowerCase();\n const KEY_ALIASES: Record<string, string[]> = {\n enter: ['enter'],\n esc: ['escape'],\n escape: ['escape'],\n tab: ['tab'],\n space: [' ', 'spacebar'],\n up: ['arrowup'],\n down: ['arrowdown'],\n left: ['arrowleft'],\n right: ['arrowright'],\n delete: ['delete', 'backspace'],\n };\n const keyMods = [...modifiers].filter(m =>\n m in KEY_ALIASES ||\n m === 'ctrl' || m === 'alt' || m === 'shift' || m === 'meta');\n\n if (keyMods.length > 0) {\n const keyMatch = keyMods.some(m => {\n if (m === 'ctrl') return e.ctrlKey;\n if (m === 'alt') return e.altKey;\n if (m === 'shift') return e.shiftKey;\n if (m === 'meta') return e.metaKey;\n const aliases = KEY_ALIASES[m];\n return aliases && aliases.includes(key);\n });\n if (!keyMatch) return;\n }\n }\n\n context.startPerformance('event:' + eventName);\n\n const result = syntax.evaluate(mutation.payload.handler, store, {\n ...handlerScope,\n $event: e,\n ...(directiveContext?.scope || {})\n });\n if (typeof result === 'function') result(e);\n\n context.endPerformance('event:' + eventName);\n } catch (err) {\n logger?.error(err);\n } finally {\n liveEvent = null;\n }\n };\n\n const useOptions = listenerOptions.capture || listenerOptions.once || listenerOptions.passive;\n if (useOptions) {\n element.addEventListener(eventName, callback, listenerOptions);\n } else {\n element.addEventListener(eventName, callback);\n }\n // Track on both the context (for diagnostics) and the mutation itself\n // so the revert path can detach the exact same callback.\n (mutation.payload as any)._callback = callback;\n context.addListener(element, mutation.payload.name, callback);\n }\n\n\n @A_Frame.Define({\n description: 'Remove an event listener from an HTML element based on the provided mutation instruction.'\n })\n @AreInterpreter.Revert(AreHTMLInstructions.AddListener)\n removeEventListener(\n @A_Inject(A_Caller) mutation: AddListenerInstruction,\n @A_Inject(AreHTMLEngineContext) context: AreHTMLEngineContext,\n ) {\n const element = context.getElementByInstruction(mutation.parent);\n\n if (!element) return;\n\n const { name } = mutation.payload;\n const { event: eventName } = parseEventName(name);\n\n const listener = (mutation.payload as any)._callback as EventListenerOrEventListenerObject | undefined;\n\n if (listener) {\n element.removeEventListener(eventName, listener);\n context.removeListener(element, name, listener);\n (mutation.payload as any)._callback = undefined;\n }\n }\n\n\n // ─────────────────────────────────────────────────────────────────────────────\n // ── AddText — Apply / Revert ─────────────────────────────────────────────────\n // ─────────────────────────────────────────────────────────────────────────────\n\n @A_Frame.Define({\n description: 'Add text content to an HTML element based on the provided declaration instruction.'\n })\n @AreInterpreter.Apply(AreHTMLInstructions.AddText)\n @AreInterpreter.Update(AreHTMLInstructions.AddText)\n addText(\n @A_Inject(A_Caller) declaration: AddTextInstruction,\n @A_Inject(AreHTMLEngineContext) context: AreHTMLEngineContext,\n @A_Inject(AreStore) store: AreStore,\n @A_Inject(AreSyntax) syntax: AreSyntax,\n @A_Inject(AreDirectiveContext) directiveContext?: AreDirectiveContext,\n\n @A_Inject(A_Logger) logger?: A_Logger,\n ) {\n const node = declaration.owner.parent;\n const { content, evaluate } = declaration.payload;\n\n const rawValue = evaluate ? syntax.evaluate(content, store, {\n ...(directiveContext?.scope || {})\n }) : content;\n\n const value = toDOMString(rawValue);\n\n\n if (!node) {\n const textNode = context.container.createTextNode(value);\n context.container.body.appendChild(textNode);\n context.setInstructionElement(declaration, textNode);\n\n } else {\n const element = context.getNodeElement(node);\n\n if (!element) {\n throw new AreInterpreterError({\n title: 'Element Not Found',\n description: `Could not find a DOM element associated with the instruction ASEID \"${declaration.owner.parent.aseid}\". Ensure that the parent instruction is properly rendered and associated with a DOM element before applying attribute mutations.`\n });\n\n }\n\n const existingNode = context.getElementByInstruction(declaration);\n\n if (existingNode) {\n existingNode.textContent = value;\n } else {\n const textNode = context.container.createTextNode(value);\n element.appendChild(textNode);\n\n context.setInstructionElement(declaration, textNode);\n }\n }\n\n\n\n logger?.debug('green', `Text ${node?.aseid.toString()} added to Context:`);\n\n }\n\n\n @A_Frame.Define({\n description: 'Remove text content from an HTML element based on the provided declaration instruction.'\n })\n @AreInterpreter.Revert(AreHTMLInstructions.AddText)\n removeText(\n @A_Inject(A_Caller) declaration: AddTextInstruction,\n @A_Inject(AreHTMLEngineContext) context: AreHTMLEngineContext,\n ) {\n const element = context.getElementByInstruction(declaration);\n\n if (!element) return;\n\n element.parentNode?.removeChild(element);\n context.removeInstructionElement(declaration);\n }\n\n\n\n @A_Frame.Define({\n description: 'Add a comment node to the DOM based on the provided declaration instruction.'\n })\n @AreInterpreter.Apply(AreHTMLInstructions.AddComment)\n @AreInterpreter.Update(AreHTMLInstructions.AddComment)\n addComment(\n @A_Inject(A_Caller) declaration: AddCommentInstruction,\n @A_Inject(AreHTMLEngineContext) context: AreHTMLEngineContext,\n @A_Inject(AreStore) store: AreStore,\n @A_Inject(AreSyntax) syntax: AreSyntax,\n @A_Inject(AreDirectiveContext) directiveContext?: AreDirectiveContext,\n\n @A_Inject(A_Logger) logger?: A_Logger,\n ) {\n const node = declaration.owner.parent;\n const { content, evaluate } = declaration.payload;\n\n const rawValue = evaluate ? syntax.evaluate(content, store, {\n ...(directiveContext?.scope || {})\n }) : content;\n\n const value = toDOMString(rawValue);\n\n\n if (!node) {\n const commentNode = context.container.createComment(value);\n context.container.body.appendChild(commentNode);\n context.setInstructionElement(declaration, commentNode);\n\n } else {\n const element = context.getNodeElement(node);\n\n if (!element) {\n throw new AreInterpreterError({\n title: 'Element Not Found',\n description: `Could not find a DOM element associated with the instruction ASEID \"${declaration.owner.parent.aseid}\". Ensure that the parent instruction is properly rendered and associated with a DOM element before applying attribute mutations.`\n });\n }\n\n const existingNode = context.getElementByInstruction(declaration);\n\n if (existingNode) {\n existingNode.textContent = value;\n } else {\n const commentNode = context.container.createComment(value);\n element.appendChild(commentNode);\n\n context.setInstructionElement(declaration, commentNode);\n }\n }\n\n\n\n logger?.debug('green', `Comment ${node?.aseid.toString()} added to Context:`);\n }\n\n\n @A_Frame.Define({\n description: 'Remove a comment node from the DOM based on the provided declaration instruction.'\n })\n @AreInterpreter.Revert(AreHTMLInstructions.AddComment)\n removeComment(\n @A_Inject(A_Caller) declaration: AddCommentInstruction,\n @A_Inject(AreHTMLEngineContext) context: AreHTMLEngineContext,\n ) {\n const element = context.getElementByInstruction(declaration);\n\n if (!element) return;\n\n element.parentNode?.removeChild(element);\n context.removeInstructionElement(declaration);\n }\n\n // ─────────────────────────────────────────────────────────────────────────────\n // ── AddStyle — Apply / Update / Revert ───────────────────────────────────────\n // ─────────────────────────────────────────────────────────────────────────────\n\n @A_Frame.Define({\n description: 'Inject a <style> element into the document <head> carrying the component CSS. Keyed by instruction ASEID so multiple components with styles do not collide. Subsequent Update calls refresh the textContent in-place.'\n })\n @AreInterpreter.Apply(AreHTMLInstructions.AddStyle)\n @AreInterpreter.Update(AreHTMLInstructions.AddStyle)\n addStyle(\n @A_Inject(A_Caller) mutation: AddStyleInstruction,\n @A_Inject(AreHTMLEngineContext) context: AreHTMLEngineContext,\n @A_Inject(A_Logger) logger?: A_Logger,\n ): void {\n try {\n\n\n const { styles } = mutation.payload;\n const styleId = `are-style-${String(mutation.aseid)}`;\n\n const existing = context.getElementByInstruction(mutation) as HTMLStyleElement | undefined;\n if (existing) {\n existing.textContent = styles;\n } else {\n const styleEl = context.container.createElement('style') as HTMLStyleElement;\n styleEl.setAttribute('data-are-id', styleId);\n styleEl.textContent = styles;\n (context.container.head ?? context.container.body).appendChild(styleEl);\n\n context.setInstructionElement(mutation, styleEl);\n logger?.debug('green', `Style injected for ${String(mutation.aseid)}`);\n }\n } catch (error) {\n logger?.error(error);\n }\n\n }\n\n @A_Frame.Define({\n description: 'Remove the <style> element that was injected by addStyle, cleaning up the document head.'\n })\n @AreInterpreter.Revert(AreHTMLInstructions.AddStyle)\n removeStyle(\n @A_Inject(A_Caller) mutation: AddStyleInstruction,\n @A_Inject(AreHTMLEngineContext) context: AreHTMLEngineContext,\n ): void {\n const styleEl = context.getElementByInstruction(mutation);\n if (styleEl?.parentNode) {\n styleEl.parentNode.removeChild(styleEl);\n }\n context.removeInstructionElement(mutation);\n }\n\n // ─────────────────────────────────────────────────────────────────────────────\n // ── SVG helpers ───────────────────────────────────────────────────────────────\n // ─────────────────────────────────────────────────────────────────────────────\n\n /**\n * Returns true when any ancestor of the given node has the tag `svg`,\n * meaning the node lives inside an SVG subtree and its DOM element must be\n * created via createElementNS(SVG_NAMESPACE, tag).\n */\n private isInSVGContext(node: AreHTMLNode): boolean {\n let current: AreHTMLNode | undefined = node.parent as AreHTMLNode | undefined;\n while (current) {\n if (current.tag === 'svg') return true;\n // <foreignObject> resets the namespace back to HTML\n if (current.tag === 'foreignobject') return false;\n current = current.parent as AreHTMLNode | undefined;\n }\n return false;\n }\n}","import { A_Caller, A_Feature, A_Inject } from \"@adaas/a-concept\";\nimport { A_Logger } from \"@adaas/a-utils/a-logger\";\nimport { AreNodeFeatures, AreNode, AreTokenizer, AreAttribute_Init, AreContext } from \"@adaas/are\";\nimport { AreComponentNode } from \"@adaas/are-html/nodes/AreComponent\";\nimport { AreRootNode } from \"@adaas/are-html/nodes/AreRoot\";\nimport { AreDirectiveAttribute } from \"@adaas/are-html/attributes/AreDirective.attribute\";\nimport { AreEventAttribute } from \"@adaas/are-html/attributes/AreEvent.attribute\";\nimport { AreBindingAttribute } from \"@adaas/are-html/attributes/AreBinding.attribute\";\nimport { AreStaticAttribute } from \"@adaas/are-html/attributes/AreStatic.attribute\";\nimport { AreHTMLAttribute } from \"../lib/AreHTMLAttribute/AreHTML.attribute\";\nimport { A_Frame } from \"@adaas/a-frame/core\";\n\n\n@A_Frame.Define({\n namespace: 'a-are-html',\n description: 'HTML-specific tokenizer extending AreTokenizer. Parses raw HTML template strings into AreHTMLNode trees by scanning element tags and resolving directive ($), event (@), binding (:), and static attributes to their typed attribute classes, constructing AreComponentNode and AreRootNode instances where required.'\n})\nexport class AreHTMLTokenizer extends AreTokenizer {\n\n ATTR_PATTERN = /([$:@]?[\\w.-]+(?::[\\w.-]+)?)(?:\\s*=\\s*(?:\"([^\"]*)\"|'([^']*)'|([^\\s>/\"'=]+)))?/g\n\n\n @A_Feature.Extend({\n name: AreNodeFeatures.onTokenize,\n scope: [AreComponentNode, AreRootNode]\n })\n tokenize(\n @A_Inject(A_Caller) node: AreNode,\n @A_Inject(AreContext) context: AreContext,\n @A_Inject(A_Logger) logger?: A_Logger\n ): void {\n\n super.tokenize(node, context, logger);\n\n context.startPerformance('attributeExtraction');\n\n const attributes = this.extractAttributes(node.markup);\n\n for (const attr of attributes) {\n node.scope.register(attr);\n }\n\n context.endPerformance('attributeExtraction');\n }\n\n\n\n extractAttributes(markup: string): AreHTMLAttribute[] {\n // Strip the tag name, then remove the closing > that is NOT inside quotes\n const withoutTag = markup.replace(/^<[a-zA-Z][a-zA-Z0-9-]*\\s*/, '')\n\n // Walk the string to find the closing > that isn't inside a quoted value\n let inSingle = false\n let inDouble = false\n let endIdx = withoutTag.length\n\n for (let i = 0; i < withoutTag.length; i++) {\n const ch = withoutTag[i]\n if (ch === '\"' && !inSingle) inDouble = !inDouble\n else if (ch === \"'\" && !inDouble) inSingle = !inSingle\n else if (ch === '>' && !inSingle && !inDouble) {\n endIdx = i\n break\n }\n }\n\n const attrString = withoutTag.slice(0, endIdx).replace(/\\s*\\/?\\s*$/, '').trim()\n\n const results: AreHTMLAttribute[] = []\n\n for (const match of attrString.matchAll(this.ATTR_PATTERN)) {\n const raw = match[0]\n const full = match[1] // e.g. ':class', '@click', '$for', 'id'\n\n // skip zero-length or name-less regex matches\n if (!full) continue\n\n const value = match[2] ?? match[3] ?? match[4] ?? 'true'\n\n const prefix = full[0]\n const isSpecial = prefix === ':' || prefix === '@' || prefix === '$'\n const name = isSpecial ? full.slice(1) : full\n\n const meta: AreAttribute_Init = { name, content: value, raw, prefix: isSpecial ? prefix : '' }\n\n if (prefix === ':') results.push(new AreBindingAttribute(meta))\n else if (prefix === '@') results.push(new AreEventAttribute(meta))\n else if (prefix === '$') results.push(new AreDirectiveAttribute(meta))\n else results.push(new AreStaticAttribute(meta))\n }\n\n return results\n }\n\n}","import { A_Caller, A_Feature, A_FormatterHelper, A_Inject, A_Scope } from \"@adaas/a-concept\";\nimport { AreLifecycle, AreScene, AreAttributeFeatures, AreSignalsContext, AreNodeFeatures, AreFeatures } from \"@adaas/are\";\nimport { A_Logger } from \"@adaas/a-utils/a-logger\";\nimport { AreComponentNode } from \"@adaas/are-html/nodes/AreComponent\";\nimport { AreRootNode } from \"@adaas/are-html/nodes/AreRoot\";\nimport { AreInterpolation } from \"@adaas/are-html/nodes/AreInterpolation\";\nimport { AreText } from \"@adaas/are-html/nodes/AreText\";\nimport { AreDirectiveAttribute } from \"@adaas/are-html/attributes/AreDirective.attribute\";\nimport { AreDirectiveFeatures } from \"@adaas/are-html/directive/AreDirective.constants\";\nimport { AreHTMLEngineContext } from \"./AreHTML.context\";\nimport { AreHTMLNode } from \"../lib/AreHTMLNode/AreHTMLNode\";\nimport { A_Frame } from \"@adaas/a-frame/core\";\n\n\n@A_Frame.Define({\n namespace: 'a-are-html',\n description: 'HTML-specific lifecycle handler extending AreLifecycle. Wires DOM-aware init hooks for component nodes, root nodes, interpolations, text nodes, and directive attributes to the ARE rendering pipeline, connecting each entity to its HTML engine context and priming the scene for subsequent compilation and interpretation.'\n})\nexport class AreHTMLLifecycle extends AreLifecycle {\n\n @AreLifecycle.Init(AreComponentNode)\n initComponent(\n @A_Inject(A_Caller) node: AreHTMLNode,\n @A_Inject(A_Scope) scope: A_Scope,\n @A_Inject(AreHTMLEngineContext) context: AreHTMLEngineContext,\n @A_Inject(AreSignalsContext) signalsContext?: AreSignalsContext,\n @A_Inject(A_Logger) logger?: A_Logger,\n ...args: any[]\n ): void {\n\n if (node.component)\n signalsContext?.subscribe(node);\n\n super.init(node, scope, context, logger, ...args);\n }\n\n\n @AreLifecycle.Init(AreRootNode)\n initRoot(\n @A_Inject(A_Caller) node: AreHTMLNode,\n @A_Inject(A_Scope) scope: A_Scope,\n @A_Inject(AreHTMLEngineContext) context: AreHTMLEngineContext,\n @A_Inject(AreSignalsContext) signalsContext?: AreSignalsContext,\n @A_Inject(A_Logger) logger?: A_Logger,\n ...args: any[]\n ): void {\n signalsContext?.subscribe(node);\n super.init(node, scope, context, logger, ...args);\n }\n\n\n @AreLifecycle.Init(AreText)\n initText(\n @A_Inject(A_Caller) node: AreHTMLNode,\n @A_Inject(A_Scope) scope: A_Scope,\n @A_Inject(AreHTMLEngineContext) context: AreHTMLEngineContext,\n @A_Inject(A_Logger) logger?: A_Logger,\n ...args: any[]\n ): void {\n const scene = new AreScene(node.aseid);\n\n scope.register(scene);\n }\n\n\n @AreLifecycle.Init(AreInterpolation)\n initInterpolation(\n @A_Inject(A_Caller) node: AreHTMLNode,\n @A_Inject(A_Scope) scope: A_Scope,\n @A_Inject(AreHTMLEngineContext) context: AreHTMLEngineContext,\n @A_Inject(A_Logger) logger?: A_Logger,\n ...args: any[]\n ): void {\n const scene = new AreScene(node.aseid);\n\n scope.register(scene);\n }\n\n @A_Feature.Extend({\n name: AreNodeFeatures.onMount,\n scope: [AreHTMLNode]\n })\n mount(\n /**\n * Node to be mounted\n */\n @A_Inject(A_Caller) node: AreHTMLNode,\n /**\n * Node Content\n */\n @A_Inject(AreScene) scene: AreScene,\n\n @A_Inject(A_Logger) logger?: A_Logger,\n ...args: any[]\n ) {\n\n logger?.debug(`[Mount] Component Trigger for <${node.aseid.entity}> with aseid :{${node.aseid.toString()}}`);\n\n /**\n * Skip mounting nodes whose scene has been deactivated (e.g. $if template nodes\n * when the condition is false). Mirrors the guard in AreLifecycle.mount.\n */\n if (scene.isInactive) return;\n\n /**\n * 1. We should simply run and render node itself.\n */\n node.interpret();\n /**\n * 2. Then go through all children of the node and mount the.\n */\n for (let i = 0; i < node.children.length; i++) {\n const child = node.children[i];\n child.mount();\n }\n }\n\n @A_Feature.Extend({\n name: AreAttributeFeatures.Update,\n scope: [AreDirectiveAttribute],\n })\n updateDirectiveAttribute(\n @A_Inject(A_Caller) directive: AreDirectiveAttribute,\n @A_Inject(A_Scope) scope: A_Scope,\n @A_Inject(A_Feature) feature: A_Feature,\n @A_Inject(A_Logger) logger?: A_Logger,\n ...args: any[]\n ) {\n /**\n * 3. If the attribute is a directive, then we should find a component that is responsible for\n * the directive compiling logic, and call it. \n * In case component is not found we just want to log a warning, \n * since the directive may be handled by some parent component or simply is a mistake in the template.\n */\n if (directive.component) {\n feature.chain(directive.component, AreDirectiveFeatures.Update, directive.owner.scope);\n } else {\n logger?.warning(`Directive handler component not found for directive: ${directive.name}. Make sure to create a component named \"AreDirective${A_FormatterHelper.toPascalCase(directive.name)}\" to handle this directive.`);\n }\n }\n\n}","import { A_Caller, A_Feature, A_FormatterHelper, A_Inject, A_Scope } from \"@adaas/a-concept\";\nimport { A_Logger } from \"@adaas/a-utils/a-logger\";\nimport { AreAttributeFeatures, AreTransformer, AreStore } from \"@adaas/are\";\nimport { AreDirectiveAttribute } from \"@adaas/are-html/attributes/AreDirective.attribute\";\nimport { AreDirectiveFeatures } from \"@adaas/are-html/directive/AreDirective.constants\";\nimport { A_Frame } from \"@adaas/a-frame/core\";\n\n\n@A_Frame.Define({\n namespace: 'a-are-html',\n description: 'HTML-specific transformer extending AreTransformer. Handles directive-attribute structural rewrites before compilation — sorting directives by declared priority and expanding compound directive expressions — so the compiler receives a clean, ordered AreHTMLNode tree ready for instruction emission.'\n})\nexport class AreHTMLTransformer extends AreTransformer {\n\n @A_Feature.Extend({\n name: AreAttributeFeatures.Transform,\n scope: [AreDirectiveAttribute],\n })\n transformDirectiveAttribute(\n @A_Inject(A_Caller) directive: AreDirectiveAttribute,\n @A_Inject(AreStore) store: AreStore,\n @A_Inject(A_Feature) feature: A_Feature,\n @A_Inject(A_Logger) logger?: A_Logger,\n ...args: any[]\n ) {\n store.watch(directive);\n\n /**\n * 3. If the attribute is a directive, then we should find a component that is responsible for\n * the directive compiling logic, and call it. \n * In case component is not found we just want to log a warning, \n * since the directive may be handled by some parent component or simply is a mistake in the template.\n */\n if (directive.component) {\n feature.chain(directive.component, AreDirectiveFeatures.Transform, directive.owner.scope);\n } else {\n logger?.warning(`Directive handler component not found for directive: ${directive.name}. Make sure to create a component named \"AreDirective${A_FormatterHelper.toPascalCase(directive.name)}\" to handle this directive.`);\n }\n\n store.unwatch(directive);\n }\n}","import { A_Feature, A_Inject, A_Scope } from \"@adaas/a-concept\";\nimport { A_Frame } from \"@adaas/a-frame/core\"\nimport { A_ServiceFeatures } from \"@adaas/a-utils/a-service\";\nimport { AreEngine, AreSyntaxTokenMatch, AreSyntax, AreSignalsContext } from \"@adaas/are\";\nimport { AreHTMLInterpreter } from \"@adaas/are-html/interpreter\";\nimport { AreHTMLEngineContext } from \"./AreHTML.context\";\nimport { AreInterpolation } from \"@adaas/are-html/nodes/AreInterpolation\";\nimport { AreText } from \"@adaas/are-html/nodes/AreText\";\nimport { AreComment } from \"@adaas/are-html/nodes/AreComment\";\nimport { AreComponentNode } from \"@adaas/are-html/nodes/AreComponent\";\nimport { AreHTMLTokenizer } from \"@adaas/are-html/tokenizer\";\nimport { AreRootNode } from \"@adaas/are-html/nodes/AreRoot\";\nimport { AreHTMLLifecycle } from \"@adaas/are-html/lifecycle\";\nimport { AreHTMLTransformer } from \"@adaas/are-html/transformer\";\nimport { AreHTMLCompiler } from \"./AreHTML.compiler\";\nimport { isVoidElement } from \"./AreHTML.constants\";\n\n\n\n@A_Frame.Define({\n namespace: 'a-are-html',\n description: 'Concrete HTML rendering engine that assembles the full ARE pipeline for web environments. Bootstraps and wires AreHTMLTokenizer, AreHTMLTransformer, AreHTMLCompiler, AreHTMLInterpreter, and AreHTMLLifecycle; mounts root nodes from inline or fetched templates; and drives reactive re-renders via the AreSignals bus.'\n})\nexport class AreHTMLEngine extends AreEngine {\n\n\n\n get DefaultSyntax() {\n return new AreSyntax({\n trimWhitespace: true,\n strictMode: true,\n rules: [\n // HTML comments\n {\n opening: '<!--',\n closing: '-->',\n component: AreComment,\n priority: 10,\n nested: false,\n extract: (raw) => ({ content: raw.slice(4, -3).trim() }),\n },\n // interpolations\n {\n opening: '{{',\n closing: '}}',\n component: AreInterpolation,\n priority: 9,\n nested: false,\n extract: (_, match) => ({ key: match.content }),\n },\n // are-root — matched before generic elements, produces AreRootNode\n {\n matcher: this.rootElementMatcher.bind(this),\n component: AreRootNode,\n priority: 5,\n },\n // generic HTML elements\n {\n matcher: this.htmlElementMatcher.bind(this),\n component: AreComponentNode,\n priority: 4,\n },\n // plain text fallback\n {\n component: AreText,\n priority: 0,\n },\n ],\n })\n }\n\n\n /**\n * Inject AreHTMLSyntax into the container scope before loading\n * \n * @param container \n */\n @A_Feature.Extend({\n name: A_ServiceFeatures.onBeforeLoad,\n before: /.*/\n })\n async init(\n @A_Inject(A_Scope) scope: A_Scope,\n @A_Inject(AreSignalsContext) signalContext?: AreSignalsContext\n ) {\n this.package(scope, {\n context: new AreHTMLEngineContext({}),\n syntax: this.DefaultSyntax,\n compiler: AreHTMLCompiler,\n interpreter: AreHTMLInterpreter,\n tokenizer: AreHTMLTokenizer,\n lifecycle: AreHTMLLifecycle,\n transformer: AreHTMLTransformer,\n });\n\n if(!signalContext) {\n signalContext = new AreSignalsContext();\n scope.register(signalContext);\n }\n }\n\n\n protected rootElementMatcher(\n source: string,\n from: number,\n to: number,\n build: (raw: string, content: string, position: number, closing: string) => AreSyntaxTokenMatch\n ): AreSyntaxTokenMatch | null {\n\n // const rootTag = this.config.rootTag\n const rootTag = 'are-root';\n\n const tagStart = source.indexOf('<', from)\n if (tagStart === -1 || tagStart >= to) return null\n\n // only match if the tag name is exactly the configured root tag\n const tagNameMatch = source.slice(tagStart).match(/^<([a-zA-Z][a-zA-Z0-9-]*)/)\n if (!tagNameMatch || tagNameMatch[1].toLowerCase() !== rootTag) return null\n\n // delegate the actual matching to the shared HTML element logic\n return this.htmlElementMatcher(source, from, to, build)\n }\n\n protected htmlElementMatcher(\n source: string,\n from: number,\n to: number,\n build: (raw: string, content: string, position: number, closing: string) => AreSyntaxTokenMatch\n ): AreSyntaxTokenMatch | null {\n let index = from\n\n while (index < to) {\n const tagStart = source.indexOf('<', index)\n if (tagStart === -1 || tagStart >= to) return null\n\n // skip comments, closing tags, doctype, processing instructions\n if (source.startsWith('<!--', tagStart)) { index = tagStart + 1; continue }\n if (source[tagStart + 1] === '/') { index = tagStart + 1; continue }\n if (source[tagStart + 1] === '!' || source[tagStart + 1] === '?') { index = tagStart + 1; continue }\n\n const tagNameMatch = source.slice(tagStart).match(/^<([a-zA-Z][a-zA-Z0-9-]*)/)\n if (!tagNameMatch) { index = tagStart + 1; continue }\n\n const tagName = tagNameMatch[1]\n const openingTagEnd = AreHTMLEngine.findTagClose(source, tagStart)\n if (openingTagEnd === -1) return null\n\n // extract id attribute if present in the opening tag\n const openingTagStr = source.slice(tagStart, openingTagEnd + 1)\n const idMatch = openingTagStr.match(/\\bid=[\"']([^\"']*)[\"']/)\n const id = idMatch ? idMatch[1] : undefined\n\n // self-closing: <br/> or <input/>\n if (source[openingTagEnd - 1] === '/') {\n const raw = source.slice(tagStart, openingTagEnd + 1)\n const content = source.slice(tagStart + tagNameMatch[0].length, openingTagEnd - 1)\n const match = build(raw, content, tagStart, '/>')\n match.payload = { entity: tagName, selfClose: true, id }\n return match\n }\n\n // HTML5 void elements: <input>, <br>, <img>, etc. — treat as self-closing\n if (isVoidElement(tagName)) {\n const raw = source.slice(tagStart, openingTagEnd + 1)\n const content = source.slice(tagStart + tagNameMatch[0].length, openingTagEnd)\n const match = build(raw, content, tagStart, '>')\n match.payload = { entity: tagName, selfClose: true, id }\n return match\n }\n\n // find matching closing tag respecting nesting\n const closingTag = `</${tagName}>`\n let level = 0\n let searchIndex = openingTagEnd + 1\n let closingStart = -1\n\n while (searchIndex < to) {\n const nextOpen = source.indexOf(`<${tagName}`, searchIndex)\n const nextClose = source.indexOf(closingTag, searchIndex)\n if (nextClose === -1) break\n\n if (nextOpen !== -1 && nextOpen < nextClose) {\n const charAfter = source[nextOpen + tagName.length + 1]\n if (charAfter === ' ' || charAfter === '>' || charAfter === '/') {\n // Skip self-closing nested occurrences, e.g. <div/> inside <div>...</div>.\n const innerEnd = AreHTMLEngine.findTagClose(source, nextOpen)\n const isSelfClose = innerEnd !== -1 && source[innerEnd - 1] === '/'\n\n if (!isSelfClose) {\n level++\n }\n searchIndex = (innerEnd === -1 ? nextOpen + tagName.length + 1 : innerEnd + 1)\n continue\n }\n }\n\n if (level === 0) { closingStart = nextClose; break }\n level--\n searchIndex = nextClose + closingTag.length\n }\n\n if (closingStart === -1) return null\n\n const fullTag = source.slice(tagStart, closingStart + closingTag.length)\n const content = source.slice(openingTagEnd + 1, closingStart)\n const match = build(fullTag, content, tagStart, closingTag)\n match.payload = { entity: tagName, selfClose: false, id }\n return match\n }\n return null\n }\n\n /**\n * Find the index of the closing `>` of an opening tag, skipping over\n * `>` characters that appear inside quoted attribute values.\n */\n private static findTagClose(source: string, from: number): number {\n let inSingle = false\n let inDouble = false\n\n for (let i = from; i < source.length; i++) {\n const ch = source[i]\n if (ch === '\"' && !inSingle) inDouble = !inDouble\n else if (ch === \"'\" && !inDouble) inSingle = !inSingle\n else if (ch === '>' && !inSingle && !inDouble) return i\n }\n\n return -1\n }\n\n}","import { A_Caller, A_Context, A_FormatterHelper, A_Inject, } from \"@adaas/a-concept\";\nimport { A_Frame } from \"@adaas/a-frame/core\";\nimport { A_Logger } from \"@adaas/a-utils/a-logger\";\nimport { A_SignalVector } from \"@adaas/a-utils/a-signal\";\nimport { Are, ArePropDefinition, AreStore, AreNode, AreSignals, AreSignalsMeta, AreSignalsContext } from \"@adaas/are\";\nimport { AreRoute } from \"@adaas/are-html/signals/AreRoute.signal\";\n\n\n@A_Frame.Define({\n namespace: 'a-are-html',\n description: 'The AreRoot component serves as the foundational entry point for the A-Concept Rendering Engine (ARE). It is responsible for initializing the rendering process, managing the root node of the component tree, and handling signal-based rendering logic. The AreRoot component processes incoming signals to determine which child components to render, allowing for dynamic and responsive UI updates based on application state and user interactions.'\n})\nexport class AreRoot extends Are {\n\n props: Record<string, ArePropDefinition> = {\n default: {\n type: 'string',\n default: '',\n }\n }\n\n\n @Are.Template\n async template(\n @A_Inject(A_Caller) root: AreNode,\n @A_Inject(A_Logger) logger: A_Logger,\n @A_Inject(AreSignalsContext) signalsContext?: AreSignalsContext,\n ) {\n\n const rootId = root.id;\n\n // No routing config for this root — but still honour body content or\n // a 'default' attribute if one is present on the markup.\n if (signalsContext && !signalsContext.hasRoot(rootId)) {\n if (!root.content?.trim()) {\n // Fallback: legacy default= attribute\n const defaultMatch = root.markup?.match(/\\bdefault=[\"']([^\"']*)[\"']/);\n const defaultComponent = defaultMatch?.[1];\n if (defaultComponent) {\n root.setContent(`<${defaultComponent}></${defaultComponent}>`);\n }\n }\n // Body content (or none) — tokenizer picks it up without intervention\n return;\n }\n\n const currentRoute = AreRoute.default();\n\n let componentName: string | undefined;\n\n if (currentRoute) {\n const initialVector = new A_SignalVector([currentRoute]);\n\n // 1. Lookup via AreSignalsContext (per root-id conditions)\n let renderTarget = signalsContext?.findComponentByVector(rootId, initialVector);\n\n // 2. Fall back to global AreSignalsMeta\n if (!renderTarget) {\n const signalsMeta = A_Context.meta<AreSignalsMeta>(AreSignals);\n renderTarget = signalsMeta?.findComponentByVector(initialVector);\n }\n\n if (renderTarget?.name) {\n componentName = A_FormatterHelper.toKebabCase(renderTarget.name);\n }\n }\n\n // 3. Fall back to body content (the nodes already placed inside the\n // <are-root> tag act as the default). No setContent() call needed —\n // the tokenizer will process root.content as-is.\n if (!componentName) {\n if (root.content?.trim()) {\n return;\n }\n }\n // 3.5. Fall back to AreSignalsContext default component for this root.\n if (!componentName) {\n const defaultComp = signalsContext?.getDefault(rootId);\n if (defaultComp?.name) {\n componentName = A_FormatterHelper.toKebabCase(defaultComp.name);\n }\n }\n // 4. Last resort: legacy default= attribute on the markup.\n if (!componentName) {\n const defaultMatch = root.markup?.match(/\\bdefault=[\"']([^\"']*)[\"']/);\n componentName = defaultMatch?.[1];\n }\n\n if (!componentName) {\n logger.warning('AreRoot: No component found for initial render. Provide body content, a route condition, or a \"default\" attribute.');\n return;\n }\n\n root.setContent(`<${componentName}></${componentName}>`);\n }\n\n\n @Are.Signal\n async onSignal(\n @A_Inject(A_Caller) root: AreNode,\n @A_Inject(A_SignalVector) vector: A_SignalVector,\n @A_Inject(AreStore) store: AreStore<{ default: string }>,\n @A_Inject(A_Logger) logger: A_Logger,\n @A_Inject(AreSignalsContext) signalsContext?: AreSignalsContext,\n ) {\n const rootId = root.id;\n\n // No routing config for this root — signals do not affect its content\n if (signalsContext && !signalsContext.hasRoot(rootId)) {\n return;\n }\n\n // 1. Try root-specific lookup via AreSignalsContext (keyed by the are-root's id attribute)\n let renderTarget = signalsContext?.findComponentByVector(rootId, vector);\n\n // 2. Fall back to global AreSignalsMeta lookup\n if (!renderTarget) {\n const signalsMeta = A_Context.meta<AreSignalsMeta>(AreSignals);\n renderTarget = signalsMeta?.findComponentByVector(vector);\n }\n\n const componentName = renderTarget?.name\n ? A_FormatterHelper.toKebabCase(renderTarget.name)\n : store.get('default');\n\n // No matching condition for this signal vector (e.g. AreInit before any route).\n // Keep the current outlet content and do nothing.\n if (!componentName) {\n return;\n }\n\n // Guard: if the outlet already shows the same component, do nothing.\n // Prevents infinite remount loops when a non-routing signal carries a\n // stale routing signal in the accumulated A_SignalState vector.\n // node.type is the kebab-case tag name — the most direct and reliable\n // identifier (no constructor-name resolution, no proxy wrapping issues).\n const currentChild = root.children[0] as AreNode | undefined;\n if (currentChild?.type === componentName) {\n return;\n }\n\n root.setContent(`<${componentName}></${componentName}>`);\n\n // Unsubscribe old children BEFORE destroying them.\n // Without this, AreSignals.handleSignalVector keeps iterating stale\n // (scope-less) nodes on every subsequent signal and throws an error.\n for (let i = 0; i < root.children.length; i++) {\n const child = root.children[i];\n signalsContext?.unsubscribe(child);\n child.unmount();\n child.destroy();\n root.removeChild(child);\n }\n\n\n root.tokenize();\n\n for (let i = 0; i < root.children.length; i++) {\n const child = root.children[i];\n child.init();\n\n const res = child.load();\n if (res instanceof Promise) {\n await res;\n }\n child.transform();\n\n child.compile();\n child.mount();\n }\n }\n}\n","import { A_Component } from \"@adaas/a-concept\";\nimport { A_Frame } from \"@adaas/a-frame/core\";\n\n@A_Frame.Define({\n namespace: 'a-are-html',\n description: 'AreRouteWatcher is a component that observes browser navigation events (history pushState, replaceState, and popstate) and notifies registered handlers when the URL changes, enabling client-side routing and reactive route-based rendering within the ARE framework.'\n})\nexport class AreRouteWatcher extends A_Component {\n\n private readonly handlers: Set<(url: URL) => void> = new Set();\n private current: URL = new URL(window.location.href);\n\n constructor() {\n super();\n this.patchHistory();\n this.attachListeners();\n }\n\n // ── Public ────────────────────────────────────────────────────────────────\n\n onChange(handler: (url: URL) => void): () => void {\n this.handlers.add(handler);\n return () => this.handlers.delete(handler); // returns unsubscribe fn\n }\n\n get url(): URL {\n return this.current;\n }\n\n destroy(): void {\n window.removeEventListener('popstate', this.onPopState);\n window.removeEventListener('hashchange', this.onHashChange);\n window.removeEventListener('urlchange', this.onURLChange);\n this.handlers.clear();\n }\n\n // ── Listeners ─────────────────────────────────────────────────────────────\n\n private onPopState = (): void => {\n this.notify();\n }\n\n private onHashChange = (): void => {\n this.notify();\n }\n\n private onURLChange = (): void => {\n this.notify();\n }\n\n private attachListeners(): void {\n window.addEventListener('popstate', this.onPopState);\n window.addEventListener('hashchange', this.onHashChange);\n window.addEventListener('urlchange', this.onURLChange); // custom event from patch\n }\n\n // ── Patch pushState / replaceState ────────────────────────────────────────\n\n private patchHistory(): void {\n const patch = (original: typeof history.pushState) =>\n function (this: History, ...args: Parameters<typeof history.pushState>) {\n original.apply(this, args);\n window.dispatchEvent(new Event('urlchange'));\n };\n\n history.pushState = patch(history.pushState);\n history.replaceState = patch(history.replaceState);\n }\n\n // ── Notify ────────────────────────────────────────────────────────────────\n\n private notify(): void {\n const next = new URL(window.location.href);\n\n if (next.href === this.current.href) return; // no actual change\n\n this.current = next;\n\n for (const handler of this.handlers) {\n handler(this.current);\n }\n }\n}"]}
|
|
1
|
+
{"version":3,"sources":["../../src/lib/AreHTMLAttribute/AreHTML.attribute.ts","../../src/attributes/AreBinding.attribute.ts","../../src/attributes/AreDirective.attribute.ts","../../src/attributes/AreEvent.attribute.ts","../../src/attributes/AreStatic.attribute.ts","../../src/lib/AreDirective/AreDirective.meta.ts","../../src/lib/AreDirective/AreDirective.constants.ts","../../src/lib/AreDirective/AreDirective.component.ts","../../src/instructions/AreHTML.instructions.constants.ts","../../src/instructions/AddComment.instruction.ts","../../src/lib/AreDirective/AreDirective.context.ts","../../src/directives/AreDirectiveFor.directive.ts","../../src/directives/AreDirectiveIf.directive.ts","../../src/instructions/AddAttribute.instruction.ts","../../src/instructions/AddElement.instruction.ts","../../src/instructions/AddInterpolation.instruction.ts","../../src/instructions/AddListener.instruction.ts","../../src/instructions/AddStyle.instruction.ts","../../src/instructions/AddText.instruction.ts","../../src/lib/AreStyle/AreStyle.context.ts","../../src/lib/AreHTMLNode/AreHTMLNode.ts","../../src/nodes/AreComment.ts","../../src/nodes/AreComponent.ts","../../src/nodes/AreInterpolation.ts","../../src/nodes/AreRoot.ts","../../src/nodes/AreText.ts","../../src/signals/AreRoute.signal.ts","../../src/engine/AreHTML.constants.ts","../../src/engine/AreHTML.context.ts","../../src/engine/AreHTML.compiler.ts","../../src/engine/AreHTML.interpreter.ts","../../src/engine/AreHTML.tokenizer.ts","../../src/engine/AreHTML.lifecycle.ts","../../src/engine/AreHTML.transformer.ts","../../src/engine/AreHTML.engine.ts","../../src/lib/AreRoot/AreRoot.component.ts","../../src/lib/AreRouteWatcher/AreRouteWatcher.component.ts"],"names":["A_Frame","A_Inject","A_Caller","A_Logger","A_Scope","AreStore","AreScene","AreDeclaration","AreMutation","A_Context","A_FormatterHelper","AreCompilerError","A_Feature","AreSyntax","AreContext","AreNodeFeatures","AreAttributeFeatures","AreSignalsContext","content","match","A_Component"],"mappings":";;;;;;;;;;;;;;;;;;;;AAWO,IAAM,gBAAA,GAAN,cAA+B,YAAA,CAAa;AAAA,EAE/C,IAAI,KAAA,GAAqB;AACrB,IAAA,OAAO,IAAA,CAAK,MAAM,MAAA,EAAO;AAAA,EAC7B;AAEJ;AANa,gBAAA,GAAN,eAAA,CAAA;AAAA,EAJN,QAAQ,MAAA,CAAO;AAAA,IACZ,SAAA,EAAW,YAAA;AAAA,IACX,WAAA,EAAa;AAAA,GAChB;AAAA,CAAA,EACY,gBAAA,CAAA;ACCN,IAAM,mBAAA,GAAN,cAAkC,gBAAA,CAAiB;AAAA;AAAA;AAAA;AAAA;AAAA;AAW1D;AAXa,mBAAA,GAAN,eAAA,CAAA;AAAA,EAJNA,QAAQ,MAAA,CAAO;AAAA,IACZ,SAAA,EAAW,YAAA;AAAA,IACX,WAAA,EAAa;AAAA,GAChB;AAAA,CAAA,EACY,mBAAA,CAAA;ACCN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AAA,CAAO,aAAA,CAAc,IAAI,KAAA,CAAM,WAAW,CAAC,CAAA;AAAA,IAC/C,CAAA;AAEJ,IAAA,OAAA,CAAQ,SAAA,GAAY,KAAA,CAAM,OAAA,CAAQ,SAAS,CAAA;AAC3C,IAAA,OAAA,CAAQ,YAAA,GAAe,KAAA,CAAM,OAAA,CAAQ,YAAY,CAAA;AAAA,EACrD;AAAA;AAAA,EAIQ,MAAA,GAAe;AACnB,IAAA,MAAM,IAAA,GAAO,IAAI,GAAA,CAAI,MAAA,CAAO,SAAS,IAAI,CAAA;AAEzC,IAAA,IAAI,IAAA,CAAK,IAAA,KAAS,IAAA,CAAK,OAAA,CAAQ,IAAA,EAAM;AAErC,IAAA,IAAA,CAAK,OAAA,GAAU,IAAA;AAEf,IAAA,KAAA,MAAW,OAAA,IAAW,KAAK,QAAA,EAAU;AACjC,MAAA,OAAA,CAAQ,KAAK,OAAO,CAAA;AAAA,IACxB;AAAA,EACJ;AACJ;AA3Ea,eAAA,GAAN,eAAA,CAAA;AAAA,EAJNpB,QAAQ,MAAA,CAAO;AAAA,IACZ,SAAA,EAAW,YAAA;AAAA,IACX,WAAA,EAAa;AAAA,GAChB;AAAA,CAAA,EACY,eAAA,CAAA","file":"index.mjs","sourcesContent":["import { AreAttribute } from \"@adaas/are\";\nimport { AreHTMLNode } from \"../AreHTMLNode/AreHTMLNode\";\nimport { A_Frame } from \"@adaas/a-frame/core\";\n\n\n\n\n@A_Frame.Define({\n namespace: 'a-are-html',\n description: 'Base class for all typed HTML attributes in the ARE framework. Provides typed access to the owning AreHTMLNode via the scope injector so that attribute subclasses can inspect host-node properties and resolve store bindings during transformation, compilation, and lifecycle phases.'\n})\nexport class AreHTMLAttribute extends AreAttribute {\n\n get owner(): AreHTMLNode {\n return this.scope.issuer() as AreHTMLNode;\n }\n\n}","import { AreHTMLAttribute } from \"@adaas/are-html/attribute\";\nimport { A_Frame } from \"@adaas/a-frame/core\";\n\n\n\n\n\n\n@A_Frame.Define({\n namespace: 'a-are-html',\n description: 'Attribute type for two-way value bindings (: prefix). Marks that the attribute value should be resolved dynamically from the node store rather than used verbatim, enabling reactive updates whenever the underlying store value changes during a rendering cycle.'\n})\nexport class AreBindingAttribute extends AreHTMLAttribute {\n\n // get value(): string {\n\n // const [firstPart, ...pathPart] = this.content.split('.');\n\n // const primaryObject = this.owner.store.get(firstPart);\n\n // return AreCommonHelper.extractPropertyByPath(primaryObject, pathPart.join('.')) as string;\n // }\n\n}\n","import { A_FormatterHelper } from \"@adaas/a-concept\";\nimport type { AreDirective } from \"@adaas/are-html/directive/AreDirective.component\";\nimport { AreHTMLAttribute } from \"@adaas/are-html/attribute\";\nimport { AreStoreWatchingEntity } from \"@adaas/are\";\nimport { AreHTMLNode } from \"@adaas/are-html/node\";\nimport { A_Frame } from \"@adaas/a-frame/core\";\n\n\n\n@A_Frame.Define({\n namespace: 'a-are-html',\n description: 'Attribute type for directive invocations ($ prefix). Carries the resolved directive component class and a cloned template node. The associated directive uses these during its Compile phase to emit conditional or repeated instruction groups and to manage per-item or per-condition subscopes.'\n})\nexport class AreDirectiveAttribute extends AreHTMLAttribute implements AreStoreWatchingEntity {\n\n cache?: any\n\n template?: AreHTMLNode\n\n /**\n * Returns a custom directive component associated with this attribute, if available.\n * \n * The method uses the attribute's name to resolve the corresponding directive component from the scope. It constructs the expected directive name by converting the attribute name to PascalCase and prefixing it with \"AreDirective\". If a matching directive component is found in the scope, it is returned; otherwise, the method returns undefined.\n */\n get component(): AreDirective | undefined {\n const component = this.scope.resolve<AreDirective>(`AreDirective${A_FormatterHelper.toPascalCase(this.name)}`) as AreDirective | undefined;\n\n return component as AreDirective;\n }\n\n}","import { AreHTMLAttribute } from \"@adaas/are-html/attribute\";\nimport { A_Frame } from \"@adaas/a-frame/core\";\n\n\n@A_Frame.Define({\n namespace: 'a-are-html',\n description: 'Attribute type for DOM event listeners (@ prefix). Marks the attribute as an event binding — the compiler emits an AddListener instruction that attaches a handler expression resolved from the store to the specified event name on the host element.'\n})\nexport class AreEventAttribute extends AreHTMLAttribute {\n}","import { AreHTMLAttribute } from \"@adaas/are-html/attribute\";\nimport { A_Frame } from \"@adaas/a-frame/core\";\n\n\n@A_Frame.Define({\n namespace: 'a-are-html',\n description: 'Attribute type for plain static HTML attributes with no dynamic prefix. Its value is emitted verbatim via an AddAttribute instruction at compile time and does not participate in reactive update cycles.'\n})\nexport class AreStaticAttribute extends AreHTMLAttribute {\n\n}","import { A_ComponentMeta } from \"@adaas/a-concept\";\n\n\n\nexport class AreDirectiveMeta extends A_ComponentMeta {\n\n priority: number = 0\n\n}","\n\nexport const AreDirectiveFeatures = {\n /**\n * Feature that should transform the tree based on the directive attribute. This method is called during the transformation phase of the ARE component and should perform any necessary transformations on the AreNode tree based on the directive's content and context. This can include tasks such as adding or removing nodes, modifying node properties, or restructuring the tree to ensure that the directive is applied correctly during rendering.\n */\n Transform: '_AreDirective_Transform',\n /**\n * Feature that should convert a directiveAttribute definition into a set of SceneInstructions to be rendered correctly\n */\n Compile: '_AreDirective_Compile',\n /**\n * Feature that should update the directiveAttribute based on the changes in the store or other dependencies. \n */\n Update: '_AreDirective_Update',\n} as const","import { A_Caller, A_Component, A_Context, A_Feature, A_Inject, A_Meta, A_TYPES__Ctor } from \"@adaas/a-concept\";\nimport { A_Logger } from \"@adaas/a-utils/a-logger\";\nimport type { AreDirectiveAttribute } from \"@adaas/are-html/attributes/AreDirective.attribute\";\nimport { AreDirectiveMeta } from \"./AreDirective.meta\";\nimport { AreDirectiveFeatures } from \"./AreDirective.constants\";\nimport { A_Frame } from \"@adaas/a-frame/core\";\n\n\n@A_Frame.Define({\n namespace: 'a-are-html',\n description: 'Abstract base component for all ARE directive types. Provides lifecycle decorators (Transform, Compile, Apply, Revert, Priority) that subclasses hook into at each pipeline stage. Subclasses implement Transform to rewrite the attribute or template node, Compile to emit scene instructions, Apply to activate them in the DOM, and Revert to undo them on removal.'\n})\n@A_Meta.Define(AreDirectiveMeta)\nexport class AreDirective extends A_Component {\n\n //==================================================================================\n //======================== LIFECYCLE DECORATORS ====================================\n //==================================================================================\n /**\n * Allows to define a compilation order for directives, which is necessary when we have multiple directives on the same node and we want to control the order of their compilation and application. The directive with the highest priority will be compiled and applied first, and the directive with the lowest priority will be compiled and applied last. This is important because some directives may depend on the output of other directives, so we need to ensure that they are compiled and applied in the correct order to avoid errors and ensure the expected behavior.\n * \n * @param priority \n * @returns \n */\n static Priority(priority: number) {\n return function <TTarget extends A_TYPES__Ctor<AreDirective>>(\n target: TTarget\n ): TTarget {\n // Store meta info on the target class itself for the Meta decorator to pick up\n const meta = A_Context.meta<AreDirectiveMeta>(target);\n\n meta.priority = priority;\n\n return target;\n };\n }\n\n /**\n * Allows to define a custom method for transforming the AreNode tree based on the directive attribute. This method is called during the transformation phase of the ARE component and should perform any necessary transformations on the AreNode tree based on the directive's content and context. This can include tasks such as adding or removing nodes, modifying node properties, or restructuring the tree to ensure that the directive is applied correctly during rendering.\n */\n static get Transform() {\n return (target: any, propertyKey: string, descriptor: PropertyDescriptor) => {\n return A_Feature.Extend({\n name: AreDirectiveFeatures.Transform,\n scope: [target.constructor],\n })(target, propertyKey, descriptor);\n }\n }\n\n /**\n * Allows to define a custom method for compiling a directive attribute into a set of SceneInstructions. \n * Can be used at any component to extend this logic not only for a AreDirective inherited.\n */\n static get Compile() {\n return (target: any, propertyKey: string, descriptor: PropertyDescriptor) => {\n return A_Feature.Extend({\n name: AreDirectiveFeatures.Compile,\n scope: [target.constructor],\n })(target, propertyKey, descriptor);\n }\n }\n\n /**\n * Allows to define a custom method for updating a directive attribute based on changes in the store or other dependencies.\n * Can be used at any component to extend this logic not only for a AreDirective inherited.\n */\n static get Update() {\n return (target: any, propertyKey: string, descriptor: PropertyDescriptor) => {\n return A_Feature.Extend({\n name: AreDirectiveFeatures.Update,\n scope: [target.constructor],\n })(target, propertyKey, descriptor);\n }\n }\n\n /**\n * Default transform method for directives, which can be overridden by specific directive implementations. This method is called during the transformation phase of the ARE component and should perform any necessary transformations on the AreNode tree based on the directive's content and context. This can include tasks such as adding or removing nodes, modifying node properties, or restructuring the tree to ensure that the directive is applied correctly during rendering.\n * \n * @param attribute - The directive attribute to transform, which contains all the information about the directive as defined in the template (e.g. name, raw content, evaluated value, etc.)\n * @param args - Additional arguments that may be required for the transformation process.\n */\n transform(\n @A_Inject(A_Caller) attribute: AreDirectiveAttribute,\n ...args: any[]\n ) {\n const logger = A_Context.scope(this).resolve(A_Logger) as A_Logger | undefined\n if (logger) {\n logger.warning(`No transforming logic defined for directive: ${attribute.name} with content: ${attribute.content}`);\n }\n }\n /**\n * Default compile method for directives, which can be overridden by specific directive implementations.\n * \n * @param attribute - The directive attribute to compile, which contains all the information about the directive as defined in the template (e.g. name, raw content, evaluated value, etc.)\n * @param args - Additional arguments that may be required for the compilation process.\n */\n @A_Feature.Extend({\n name: AreDirectiveFeatures.Compile,\n scope: [AreDirective],\n })\n compile(\n @A_Inject(A_Caller) attribute: AreDirectiveAttribute,\n ...args: any[]\n ) {\n const logger = A_Context.scope(this).resolve(A_Logger) as A_Logger | undefined\n if (logger) {\n logger.warning(`No compiling logic defined for directive: ${attribute.name} with content: ${attribute.content}`);\n }\n }\n /**\n * Default update method for directives, which can be overridden by specific directive implementations. This method is called when there are changes in the store or other dependencies that may affect the directive's behavior or appearance. The method should contain logic to update the directive accordingly, such as re-evaluating its value, modifying the DOM, or triggering re-rendering of the affected nodes.\n * \n * @param attribute - The directive attribute to update, which contains all the information about the directive as defined in the template (e.g. name, raw content, evaluated value, etc.)\n * @param args - Additional arguments that may be required for the update process.\n */\n @A_Feature.Extend({\n name: AreDirectiveFeatures.Update,\n scope: [AreDirective],\n })\n update(\n @A_Inject(A_Caller) attribute: AreDirectiveAttribute,\n ...args: any[]\n ) {\n const logger = A_Context.scope(this).resolve(A_Logger) as A_Logger | undefined\n if (logger) {\n logger.warning(`No update logic defined for directive: ${attribute.name} with content: ${attribute.content}`);\n }\n }\n}","\n\nexport const AreHTMLInstructions = {\n AddElement: '_AreHTML_AddElement',\n AddText: '_AreHTML_AddText',\n AddAttribute: '_AreHTML_AddAttribute',\n AddStyle: '_AreHTML_AddStyle',\n AddListener: '_AreHTML_AddListener',\n AddInterpolation: '_AreHTML_AddInterpolation',\n AddComment: '_AreHTML_AddComment',\n} as const","import { A_Frame } from \"@adaas/a-frame/core\"\nimport { AreDeclaration, AreInstructionSerialized } from \"@adaas/are\";\nimport { AreHtmlAddCommentInstructionPayload } from \"./AreHTML.instructions.types\";\nimport { AreHTMLInstructions } from \"./AreHTML.instructions.constants\";\n\n\n@A_Frame.Define({\n namespace: 'a-are-html',\n description: 'Appends a comment node to an element. Apply creates the comment node; revert removes it. Content can be a static string or a dynamic getter for interpolations.'\n})\nexport class AddCommentInstruction extends AreDeclaration<AreHtmlAddCommentInstructionPayload> {\n\n get content() {\n return this.payload.content;\n }\n\n constructor(\n props: AreHtmlAddCommentInstructionPayload | AreInstructionSerialized<AreHtmlAddCommentInstructionPayload>\n ) {\n if ('aseid' in props) {\n super(props as AreInstructionSerialized<AreHtmlAddCommentInstructionPayload>);\n } else {\n super(AreHTMLInstructions.AddComment, props);\n }\n }\n}\n","import { ASEID } from \"@adaas/a-concept\";\nimport { A_ExecutionContext } from \"@adaas/a-utils/a-execution\";\n\n\nexport class AreDirectiveContext extends A_ExecutionContext {\n\n scope:Record<string, any> = {}\n\n\n constructor(aseid: ASEID | string) {\n super(aseid.toString());\n }\n\n\n\n}\n","import { A_Caller, A_Inject, A_Scope } from \"@adaas/a-concept\";\nimport { A_Logger } from \"@adaas/a-utils/a-logger\";\nimport { AreDirectiveAttribute } from \"@adaas/are-html/attributes/AreDirective.attribute\";\nimport { AreCompilerError, AreScene, AreStore } from \"@adaas/are\";\nimport { AreDirective } from \"@adaas/are-html/directive/AreDirective.component\";\nimport { AddCommentInstruction } from \"@adaas/are-html/instructions/AddComment.instruction\";\nimport { AreHTMLNode } from \"@adaas/are-html/node\";\nimport { AreDirectiveContext } from \"@adaas/are-html/directive/AreDirective.context\";\nimport { A_Frame } from \"@adaas/a-frame/core\";\n\n\ntype AreForExpression = {\n key: string;\n index: string | undefined;\n arrayExpr: string;\n /** Optional `track <expr>` clause, e.g. `track row.id` */\n trackExpr: string | undefined;\n};\n\n\n@A_Frame.Define({\n namespace: 'a-are-html',\n description: 'Built-in $for directive. Iterates over an array expression resolved from the store and renders a cloned template fragment per item, managing per-item subscopes and comment-node anchors. Supports keyed diffing via an optional track clause to minimise DOM mutations on collection updates.'\n})\n@AreDirective.Priority(1)\nexport class AreDirectiveFor extends AreDirective {\n\n\n @AreDirective.Transform\n transform(\n @A_Inject(A_Caller) attribute: AreDirectiveAttribute,\n @A_Inject(A_Scope) scope: A_Scope,\n @A_Inject(AreStore) store: AreStore,\n @A_Inject(AreScene) scene: AreScene,\n @A_Inject(A_Logger) logger: A_Logger,\n ...args: any[]\n ) {\n\n logger.debug(`[Transform] directive $FOR for <${attribute.owner.aseid.toString()}>`)\n\n const node = attribute.owner;\n\n /**\n * Transfer the original node's scope (with all registered attributes and children)\n * to the template clone, and give the owner node a fresh empty scope.\n * This mirrors the $if directive's approach, making the owner a lightweight\n * group container whose sole visible presence is a comment placeholder.\n */\n const forTemplate = node.cloneWithScope();\n\n /**\n * Remove the $for attribute from the template so iterative clones do not\n * re-trigger this directive during their own transform phase.\n * Re-register it on the owner so the reactive compile/update pipeline keeps working.\n */\n const forAttr = forTemplate.attributes.find(d => d.name === attribute.name);\n\n if (forAttr) {\n forTemplate.scope.deregister(forAttr);\n node.scope.register(forAttr);\n }\n\n /**\n * Re-initialize the owner node with its fresh scope so it becomes a valid\n * group container that will own the generated item nodes as children.\n */\n node.init();\n\n /**\n * Store the template for use in compile and update.\n */\n attribute.template = forTemplate;\n\n\n /**\n * Parse the $for expression and evaluate the source array.\n */\n const { key, index, arrayExpr } = this.parseExpression(attribute.content);\n const array = this.resolveArray(store, arrayExpr, attribute.content);\n\n attribute.value = array;\n\n /**\n * For each item in the array, spawn a clone of the template with the\n * item's store values pre-set and its scene activated.\n *\n * The children are added to the owner node before the main compiler's\n * children iteration loop runs, so the main cycle will compile them —\n * no explicit child.compile() call is needed here.\n */\n for (let i = 0; i < array.length; i++) {\n this.spawnItemNode(attribute.template!, attribute.owner, key, index, array[i], i);\n }\n }\n\n\n @AreDirective.Compile\n compile(\n @A_Inject(A_Caller) attribute: AreDirectiveAttribute,\n @A_Inject(AreStore) store: AreStore,\n @A_Inject(AreScene) scene: AreScene,\n ...args: any[]\n ): void {\n /**\n * Replace the group node's default host declaration with a comment placeholder\n * so the owner element itself does not render as a DOM element — the item nodes\n * render as its children instead.\n */\n const hostInstruction = scene.host!;\n const commentIdentifier = ` --- for: ${attribute.template!.id} --- `;\n const declaration = new AddCommentInstruction({ content: commentIdentifier });\n\n scene.setHost(declaration);\n scene.planBefore(declaration, hostInstruction);\n scene.unPlan(hostInstruction);\n }\n\n\n @AreDirective.Update\n update(\n @A_Inject(A_Caller) attribute: AreDirectiveAttribute,\n @A_Inject(AreStore) store: AreStore,\n @A_Inject(AreScene) scene: AreScene,\n ...args: any[]\n ): void {\n /**\n * Re-evaluate the source array.\n */\n const { key, index, arrayExpr, trackExpr } = this.parseExpression(attribute.content);\n const newArray = this.resolveArray(store, arrayExpr, attribute.content);\n\n const owner = attribute.owner;\n const currentChildren = [...owner.children] as AreHTMLNode[];\n\n attribute.value = newArray;\n\n const computeKey = this.makeKeyFn(key, index, trackExpr);\n\n // ── 1. Index existing children by stable key ────────────────────────\n const childByKey = new Map<any, AreHTMLNode>();\n const remaining = new Set<AreHTMLNode>();\n\n for (let i = 0; i < currentChildren.length; i++) {\n const child = currentChildren[i];\n const ctx = child.scope.resolveFlat(AreDirectiveContext);\n const k = ctx ? computeKey(ctx.scope[key], ctx.scope[index || 'index']) : Symbol('orphan');\n childByKey.set(k, child);\n remaining.add(child);\n }\n\n // ── 2. Walk desired list; reuse existing or spawn new ───────────────\n const desired: AreHTMLNode[] = [];\n const newOnes: AreHTMLNode[] = [];\n\n for (let i = 0; i < newArray.length; i++) {\n const item = newArray[i];\n const k = computeKey(item, i);\n const existing = childByKey.get(k);\n\n if (existing) {\n remaining.delete(existing);\n\n let directiveContext = existing.scope.resolveFlat(AreDirectiveContext);\n if (!directiveContext) {\n directiveContext = new AreDirectiveContext(existing.aseid);\n existing.scope.register(directiveContext);\n }\n directiveContext.scope = {\n ...directiveContext.scope,\n [key]: item,\n [index || 'index']: i,\n };\n desired.push(existing);\n } else {\n const itemNode = this.spawnItemNode(attribute.template!, owner, key, index, item, i);\n desired.push(itemNode);\n newOnes.push(itemNode);\n }\n }\n\n // ── 3. Unmount + detach removed children ─────────────────────────────\n for (const child of remaining) {\n child.unmount();\n owner.removeChild(child);\n }\n\n // ── 4. Mount only the new ones (kept children stay where they are). ─\n for (const child of newOnes) {\n child.transform();\n child.compile();\n child.mount();\n }\n }\n\n\n // ─────────────────────────────────────────────────────────────────────────────\n // ── Helpers ──────────────────────────────────────────────────────────────────\n // ─────────────────────────────────────────────────────────────────────────────\n\n /**\n * Build a key-function that derives a stable identity from each item.\n * If the user provided a `track <expr>` clause, evaluate it as a path on\n * the item; otherwise fall back to the item identity (reference equality).\n */\n private makeKeyFn(key: string, index: string | undefined, trackExpr: string | undefined): (item: any, i: number) => any {\n if (!trackExpr) {\n return (item, i) => item ?? i;\n }\n\n // Strip any leading `key.` so users can write `track row.id`.\n const path = trackExpr.startsWith(key + '.') ? trackExpr.slice(key.length + 1) : trackExpr;\n\n return (item, i) => {\n if (item == null) return i;\n if (path === key || path === '$index') return path === '$index' ? i : item;\n\n // dotted path lookup\n const parts = path.split('.');\n let v: any = item;\n for (const p of parts) {\n if (v == null) return i;\n v = v[p];\n }\n return v ?? i;\n };\n }\n\n /**\n * Parses the $for expression string into its constituent parts.\n *\n * Supported formats:\n * item in items\n * item, index in items\n * (item, index) in items\n * item in filter(items)\n * item, index in filter(items, 'active')\n * item in items track item.id\n * (item, i) in items track item.id\n */\n private parseExpression(content: string): AreForExpression {\n // Strip optional `track <expr>` suffix first.\n let trackExpr: string | undefined;\n const trackIdx = content.search(/\\s+track\\s+/);\n let body = content;\n if (trackIdx !== -1) {\n const m = content.slice(trackIdx).match(/\\s+track\\s+(.+)$/);\n if (m) {\n trackExpr = m[1].trim();\n body = content.slice(0, trackIdx).trim();\n }\n }\n\n const inIndex = body.lastIndexOf(' in ');\n const keyAndIndex = body.slice(0, inIndex).trim().replace(/^\\(|\\)$/g, '');\n const arrayExpr = body.slice(inIndex + 4).trim();\n const keyParts = keyAndIndex.split(',').map(p => p.trim());\n\n return {\n key: keyParts[0],\n index: keyParts[1] || undefined,\n arrayExpr,\n trackExpr,\n };\n }\n\n /**\n * Resolves the array expression against the store.\n * Supports both plain key lookups and function-call expressions:\n * items → store.get('items')\n * filter(items) → store.get('filter')(store.get('items'))\n */\n private resolveArray(store: AreStore, arrayExpr: string, fullContent: string): any[] {\n let result: any;\n const callMatch = arrayExpr.match(/^([^(]+)\\((.+)\\)$/);\n\n if (callMatch) {\n const fnName = callMatch[1].trim();\n const fn = store.get(fnName as any);\n\n if (typeof fn !== 'function')\n throw new AreCompilerError({\n title: 'Invalid \"for\" Directive Function',\n description: `The expression \"${fnName}\" in the \"for\" directive does not resolve to a function in the store. Received: ${typeof fn}`,\n });\n\n const rawArgs = callMatch[2].split(',').map(a => a.trim());\n const resolvedArgs = rawArgs.map(arg => {\n if (arg.startsWith(\"'\") && arg.endsWith(\"'\")) return arg.slice(1, -1);\n if (arg.startsWith('\"') && arg.endsWith('\"')) return arg.slice(1, -1);\n if (!isNaN(Number(arg))) return Number(arg);\n // Dotted-path / optional-chain: e.g. `record?.embedding` or `record.data`\n const stripped = arg.replace(/\\?$/, '');\n if (stripped.includes('.')) {\n const parts = stripped.split('.').map(p => p.replace(/\\?$/, ''));\n let val: any = store.get(parts[0] as any);\n for (let j = 1; j < parts.length; j++) {\n if (val == null) return undefined;\n val = val[parts[j]];\n }\n return val ?? undefined;\n }\n return store.get(stripped as any);\n });\n\n result = (fn as Function)(...resolvedArgs);\n } else if (arrayExpr.includes('.')) {\n // dotted-path lookup: e.g. \"list.items\" or \"record?.keywords\"\n // Strip optional-chaining `?` suffix from each segment so that\n // `record?.keywords` resolves the same as `record.keywords`.\n const parts = arrayExpr.split('.').map(p => p.replace(/\\?$/, ''));\n result = store.get(parts[0] as any);\n for (let i = 1; i < parts.length; i++) {\n if (result == null) break;\n result = result[parts[i]];\n }\n } else {\n result = store.get(arrayExpr.replace(/\\?$/, '') as any);\n }\n\n // null / undefined from optional-chaining expressions (e.g. `record?.keywords`)\n // means the source object is not yet loaded — treat as empty array so the\n // directive initialises gracefully and fills in when the store updates.\n if (result == null) return [];\n\n if (!Array.isArray(result))\n throw new AreCompilerError({\n title: 'Invalid \"for\" Directive Value',\n description: `The \"for\" directive expects an array but got ${typeof result}. Expression: \"${fullContent}\". Received: ${JSON.stringify(result)}`,\n });\n\n return result;\n }\n\n /**\n * Creates a single item node from the template, registers it as a child of\n * the owner, initialises it, injects item-scoped store values, and activates\n * its scene so the mount/compile cycle will include it.\n *\n * NOTE: This method does NOT call compile() or mount() — the caller is\n * responsible for doing so when the main lifecycle cycle won't cover it\n * (i.e. during update, but not during the initial compile phase).\n */\n private spawnItemNode(\n template: AreHTMLNode,\n owner: AreHTMLNode,\n key: string,\n index: string | undefined,\n item: any,\n i: number,\n ): AreHTMLNode {\n const itemNode = template.clone() as AreHTMLNode;\n\n owner.addChild(itemNode);\n\n const queue = [itemNode];\n\n while (queue.length > 0) {\n const current = queue.shift()!\n\n current.init();\n\n queue.push(...current.children as AreHTMLNode[]);\n }\n\n /**\n * Resolve or create a directive context for the item node. This is needed to hold the item-specific store values (e.g. the \"item\" and \"index\" in a \"for\" loop) that the template's bindings will reference during compile and update. The context is shared among all clones of the same template, but that's fine because each clone gets its own scope values assigned here.\n */\n let directiveContext = itemNode.scope.resolveFlat(AreDirectiveContext);\n\n if (!directiveContext) {\n directiveContext = new AreDirectiveContext(itemNode.aseid);\n itemNode.scope.register(directiveContext);\n }\n\n directiveContext.scope = {\n ...directiveContext.scope,\n [key]: item,\n [index || 'index']: i,\n }\n\n itemNode.scene.activate();\n\n return itemNode;\n }\n}","import { A_Caller, A_Inject, A_Scope } from \"@adaas/a-concept\";\nimport { A_Logger } from \"@adaas/a-utils/a-logger\";\nimport { AreDirectiveAttribute } from \"@adaas/are-html/attributes/AreDirective.attribute\";\nimport { AreScene, AreStore, AreSyntax } from \"@adaas/are\";\nimport { AreDirective } from \"@adaas/are-html/directive/AreDirective.component\";\nimport { AddCommentInstruction } from \"@adaas/are-html/instructions/AddComment.instruction\";\nimport { AreDirectiveContext } from \"@adaas/are-html/directive/AreDirective.context\";\nimport { A_Frame } from \"@adaas/a-frame/core\";\n\n\n\n/**\n * `$if` directive — conditionally renders a node based on an expression.\n *\n * ⚠️ Known limitation: do NOT use `$if` and `$for` on the SAME element.\n * Doing so produces duplicated DOM on toggle because the two directives\n * share an owner node and clone its scope independently. Wrap one in a\n * parent element instead, e.g.:\n *\n * <div $if=\"visible\">\n * <li $for=\"item in items\">{{item.name}}</li>\n * </div>\n *\n * or\n *\n * <ul $for=\"item in items\">\n * <li $if=\"item.visible\">{{item.name}}</li>\n * </ul>\n */\n@A_Frame.Define({\n namespace: 'a-are-html',\n description: 'Built-in $if directive. Conditionally renders a subtree based on a store expression. Replaces the target element with a stable comment anchor when the condition is false and restores the fully rendered subtree when it becomes true, preventing any leaking of the host element between states.'\n})\n@AreDirective.Priority(2)\nexport class AreDirectiveIf extends AreDirective {\n\n\n @AreDirective.Transform\n transform(\n @A_Inject(A_Caller) attribute: AreDirectiveAttribute,\n @A_Inject(A_Scope) scope: A_Scope,\n\n @A_Inject(AreStore) store: AreStore,\n @A_Inject(AreScene) scene: AreScene,\n @A_Inject(A_Logger) logger: A_Logger,\n ...args: any[]\n ) {\n logger.debug(`[Transform] directive $IF for <${attribute.owner.aseid.toString()}>`)\n\n const node = attribute.owner;\n\n /**\n * We have to keep this node as a group node, and copy all data into the child node that would be actual node. \n */\n const ifTemplate = node.cloneWithScope();\n\n const ifAttr = ifTemplate.attributes.find(d => d.name === attribute.name);\n\n if (ifAttr) {\n ifTemplate.scope.deregister(ifAttr);\n node.scope.register(ifAttr);\n }\n\n node.init();\n\n node.addChild(ifTemplate);\n\n /**\n * Resolve or create a directive context for the item node. This is needed to hold the item-specific store values (e.g. the \"item\" and \"index\" in a \"for\" loop) that the template's bindings will reference during compile and update. The context is shared among all clones of the same template, but that's fine because each clone gets its own scope values assigned here.\n */\n // let directiveContext = ifTemplate.scope.resolveFlat(AreDirectiveContext);\n\n // if (!directiveContext) {\n // directiveContext = new AreDirectiveContext(ifTemplate.aseid);\n // ifTemplate.scope.register(directiveContext);\n // }\n\n ifTemplate.scene.deactivate();\n\n attribute.template = ifTemplate;\n\n }\n\n\n @AreDirective.Compile\n compile(\n @A_Inject(A_Caller) attribute: AreDirectiveAttribute,\n @A_Inject(AreStore) store: AreStore,\n @A_Inject(AreScene) scene: AreScene,\n @A_Inject(AreSyntax) syntax: AreSyntax,\n\n @A_Inject(AreDirectiveContext) directiveContext?: AreDirectiveContext,\n ...args: any[]\n ): void {\n /**\n * 1. Extract the value from the store based on the attribute content\n * (which is the path to the value in the store)\n */\n attribute.value = syntax.evaluate(attribute.content, store, {\n ...(directiveContext?.scope || {}),\n });\n\n /**\n * 2. If the value is falsy, remove the node from the scene by planning a RemoveElement instruction.\n * If the value is truthy, ensure the node is in the scene by planning an AddElement instruction if it's not already planned.\n */\n const hostInstruction = scene.host!;\n const commentIdentifier = ` --- if: ${attribute.template!.id} --- `;\n const declaration = new AddCommentInstruction({ content: commentIdentifier })\n\n scene.setHost(declaration);\n scene.planBefore(declaration, hostInstruction);\n scene.unPlan(hostInstruction);\n\n if (attribute.value)\n attribute.template!.scene.activate();\n else\n attribute.template!.scene.deactivate();\n }\n\n\n\n @AreDirective.Update\n update(\n @A_Inject(A_Caller) attribute: AreDirectiveAttribute,\n @A_Inject(AreStore) store: AreStore,\n @A_Inject(A_Scope) scope: A_Scope,\n @A_Inject(AreSyntax) syntax: AreSyntax,\n @A_Inject(AreScene) scene: AreScene,\n ...args: any[]\n ): void {\n /**\n * 1. Extract the value from the store based on the attribute content\n * (which is the path to the value in the store)\n */\n const previous = !!attribute.value;\n const next = !!syntax.evaluate(attribute.content, store);\n attribute.value = next;\n\n // Skip when truthiness has not changed — avoids redundant mount/unmount.\n if (previous === next) return;\n\n if (next) {\n attribute.template!.scene.activate();\n attribute.template!.mount();\n } else {\n attribute.template!.unmount();\n attribute.template!.scene.deactivate();\n }\n }\n\n}","import { A_Frame } from \"@adaas/a-frame/core\"\nimport { AreDeclaration, AreMutation, AreInstructionSerialized } from \"@adaas/are\";\nimport { AreHtmlAddAttributeInstructionPayload } from \"./AreHTML.instructions.types\";\nimport { AreHTMLInstructions } from \"./AreHTML.instructions.constants\";\n\n\n@A_Frame.Define({\n namespace: 'a-are-html',\n description: 'Sets an attribute on an HTML element. Apply calls setAttribute; revert calls removeAttribute.'\n})\nexport class AddAttributeInstruction extends AreMutation<AreHtmlAddAttributeInstructionPayload> {\n\n cache?: string;\n\n constructor(\n parent: AreDeclaration,\n props: AreHtmlAddAttributeInstructionPayload | AreInstructionSerialized<AreHtmlAddAttributeInstructionPayload>) {\n if ('aseid' in props) {\n super(props as AreInstructionSerialized<AreHtmlAddAttributeInstructionPayload>);\n } else {\n super(AreHTMLInstructions.AddAttribute, parent, props);\n }\n }\n}\n","import { A_Frame } from \"@adaas/a-frame/core\"\nimport { AreDeclaration, AreInstructionSerialized } from \"@adaas/are\";\nimport { AreHtmlAddElementInstructionPayload } from \"./AreHTML.instructions.types\";\nimport { AreHTMLInstructions } from \"./AreHTML.instructions.constants\";\n\n\n@A_Frame.Define({\n namespace: 'a-are-html',\n description: 'Creates a new HTML element in the DOM. Apply creates the element; revert removes it.'\n})\nexport class AddElementInstruction extends AreDeclaration<AreHtmlAddElementInstructionPayload> {\n constructor(\n props: AreHtmlAddElementInstructionPayload | AreInstructionSerialized<AreHtmlAddElementInstructionPayload>\n ) {\n if ('aseid' in props) {\n super(props);\n } else {\n super(AreHTMLInstructions.AddElement, props);\n }\n }\n}\n","import { A_Frame } from \"@adaas/a-frame/core\"\nimport { AreDeclaration, AreMutation, AreInstructionSerialized } from \"@adaas/are\";\nimport { AreHtmlAddInterpolationInstructionPayload } from \"./AreHTML.instructions.types\";\nimport { AreHTMLInstructions } from \"./AreHTML.instructions.constants\";\n\n\n@A_Frame.Define({\n namespace: 'a-are-html',\n description: 'Appends a reactive text node whose content is resolved dynamically from the store. Apply creates the text node with the getter; revert removes it.'\n})\nexport class AddInterpolationInstruction extends AreMutation<AreHtmlAddInterpolationInstructionPayload> {\n\n constructor(\n parent: AreDeclaration,\n props: AreHtmlAddInterpolationInstructionPayload | AreInstructionSerialized<AreHtmlAddInterpolationInstructionPayload>\n ) {\n if ('aseid' in props) {\n super(props as AreInstructionSerialized<AreHtmlAddInterpolationInstructionPayload>);\n } else {\n super(AreHTMLInstructions.AddInterpolation, parent, props);\n }\n }\n}\n","import { A_Frame } from \"@adaas/a-frame/core\"\nimport { AreDeclaration, AreMutation, AreInstructionSerialized } from \"@adaas/are\";\nimport { AreHtmlAddListenerInstructionPayload } from \"./AreHTML.instructions.types\";\nimport { AreHTMLInstructions } from \"./AreHTML.instructions.constants\";\n\n\n@A_Frame.Define({\n namespace: 'a-are-html',\n description: 'Attaches a DOM event listener to an element. Apply calls addEventListener; revert calls removeEventListener.'\n})\nexport class AddListenerInstruction extends AreMutation<AreHtmlAddListenerInstructionPayload> {\n\n constructor(\n parent: AreDeclaration,\n props: AreHtmlAddListenerInstructionPayload | AreInstructionSerialized<AreHtmlAddListenerInstructionPayload>\n ) {\n if ('aseid' in props) {\n super(props as AreInstructionSerialized<AreHtmlAddListenerInstructionPayload>);\n } else {\n super(AreHTMLInstructions.AddListener, parent, props);\n }\n }\n}\n","import { A_Frame } from \"@adaas/a-frame/core\"\nimport { AreDeclaration, AreMutation, AreInstructionSerialized } from \"@adaas/are\";\nimport { AreHtmlAddStyleInstructionPayload } from \"./AreHTML.instructions.types\";\nimport { AreHTMLInstructions } from \"./AreHTML.instructions.constants\";\n\n\n@A_Frame.Define({\n namespace: 'a-are-html',\n description: 'Sets an inline CSS style property on an element. Apply sets the property; revert removes it.'\n})\nexport class AddStyleInstruction extends AreMutation<AreHtmlAddStyleInstructionPayload> {\n\n constructor(\n parent: AreDeclaration,\n props: AreHtmlAddStyleInstructionPayload | AreInstructionSerialized<AreHtmlAddStyleInstructionPayload>\n ) {\n if ('aseid' in props) {\n super(props as AreInstructionSerialized<AreHtmlAddStyleInstructionPayload>);\n } else {\n super(AreHTMLInstructions.AddStyle, parent, props);\n }\n }\n}\n","import { A_Frame } from \"@adaas/a-frame/core\"\nimport { AreDeclaration, AreInstructionSerialized } from \"@adaas/are\";\nimport { AreHtmlAddTextInstructionPayload } from \"./AreHTML.instructions.types\";\nimport { AreHTMLInstructions } from \"./AreHTML.instructions.constants\";\n\n\n@A_Frame.Define({\n namespace: 'a-are-html',\n description: 'Appends a text node to an element. Apply creates the text node; revert removes it. Content can be a static string or a dynamic getter for interpolations.'\n})\nexport class AddTextInstruction extends AreDeclaration<AreHtmlAddTextInstructionPayload> {\n\n constructor(props: AreHtmlAddTextInstructionPayload | AreInstructionSerialized<AreHtmlAddTextInstructionPayload>) {\n if ('aseid' in props) {\n super(props as AreInstructionSerialized<AreHtmlAddTextInstructionPayload>);\n } else {\n super(AreHTMLInstructions.AddText, props);\n }\n }\n}\n","import { A_Fragment, ASEID } from \"@adaas/a-concept\";\nimport { A_Frame } from \"@adaas/a-frame/core\";\n\n\n@A_Frame.Define({\n namespace: 'a-are-html',\n description: 'Context fragment that holds the resolved CSS style rules string for a component scope. Populated during lifecycle initialisation and read by the compiler when emitting AddStyle instructions for inline styles declared on the component host element.'\n})\nexport class AreStyle extends A_Fragment {\n\n styles!: string;\n\n constructor(\n styles: string,\n aseid?: ASEID | string,\n\n ) {\n super({\n name: aseid ? aseid.toString() : 'default-style',\n });\n\n this.styles = styles;\n }\n\n}","import { A_Context, } from \"@adaas/a-concept\";\nimport { A_Frame } from \"@adaas/a-frame/core\";\nimport { AreNode} from \"@adaas/are\";\nimport { AreBindingAttribute } from \"@adaas/are-html/attributes/AreBinding.attribute\";\nimport { AreDirectiveAttribute } from \"@adaas/are-html/attributes/AreDirective.attribute\";\nimport { AreEventAttribute } from \"@adaas/are-html/attributes/AreEvent.attribute\";\nimport { AreStaticAttribute } from \"@adaas/are-html/attributes/AreStatic.attribute\";\nimport { AreStyle } from \"@adaas/are-html/style/AreStyle.context\";\nimport { AreDirective } from \"@adaas/are-html/directive/AreDirective.component\";\nimport { AreDirectiveMeta } from \"@adaas/are-html/directive/AreDirective.meta\";\n\n\n\n@A_Frame.Define({\n namespace: 'a-are-html',\n description: 'AreHTMLNode represents a node in the HTML structure. It extends the base AreNode and includes properties and methods specific to HTML nodes, such as handling attributes, directives, events, and styles.'\n})\nexport class AreHTMLNode extends AreNode {\n /**\n * Actual node type. \n * By default it's a tag name\n */\n get tag(): string {\n return this.aseid.entity;\n }\n /**\n * The static attributes defined for the node, which are typically used to represent static properties or characteristics of the node that do not change based on the context or state. These attributes are usually defined in the template and are not reactive.\n * \n * Example: For a node defined as `<div class=\"static-class\">`, the static attribute would be `class=\"static-class\"`.\n */\n get staticAttributes(): AreStaticAttribute[] {\n return this.scope.resolveFlatAll<AreStaticAttribute>(AreStaticAttribute);\n }\n /**\n * The binding attributes defined for the node, which are typically used to represent dynamic properties or characteristics of the node that can change based on the context or state. These attributes are usually defined in the template with a specific syntax (e.g., `:prop=\"value\"` or `v-bind:prop=\"value\"`) and are reactive, meaning that they will update automatically when the underlying data changes.\n * \n * Example: For a node defined as `<div :class=\"dynamicClass\">`, the binding attribute would be `:class=\"dynamicClass\"`.\n */\n get bindings(): AreBindingAttribute[] {\n return this.scope.resolveFlatAll<AreBindingAttribute>(AreBindingAttribute);\n }\n /**\n * The directive attributes defined for the node, which are typically used to represent special instructions or behaviors that should be applied to the node. These attributes are usually defined in the template with a specific syntax (e.g., `v-if=\"condition\"` or `v-for=\"item in list\"`) and are processed by the rendering engine to apply the corresponding logic or behavior to the node.\n * \n * Example: For a node defined as `<div v-if=\"isVisible\">`, the directive attribute would be `v-if=\"isVisible\"`.\n */\n get directives(): AreDirectiveAttribute[] {\n /**\n * 1. get all registered directives for the node\n */\n const directives = this.scope.resolveFlatAll<AreDirectiveAttribute>(AreDirectiveAttribute)!;\n /**\n * 2. Order them in the way that defined in the meta\n * \n * Each meta has a prioprity of order that may impact the way how directives are compiled and rendered. For example, a directive with higher priority may need to be compiled before other directives to ensure that its logic is applied correctly before other directives are processed. By ordering the directives based on their defined priority in the meta, we can ensure that the compilation and rendering process follows the intended logic and behavior as defined by the directive implementations.\n */\n\n return directives.filter(d => d.component).sort((a, b) => {\n const aMeta = A_Context.meta<AreDirectiveMeta, AreDirective>(a.component!);\n const bMeta = A_Context.meta<AreDirectiveMeta, AreDirective>(b.component!);\n\n const aPriority = aMeta.priority ?? 0;\n const bPriority = bMeta.priority ?? 0;\n\n return bPriority - aPriority;\n });\n }\n /**\n * The event attributes defined for the node, which are typically used to represent event listeners or handlers that should be attached to the node. These attributes are usually defined in the template with a specific syntax (e.g., `@click=\"handleClick\"` or `v-on:click=\"handleClick\"`) and are processed by the rendering engine to attach the corresponding event listeners to the node.\n * \n * Example: For a node defined as `<button @click=\"handleClick\">`, the event attribute would be `@click=\"handleClick\"`.\n */\n get events(): AreEventAttribute[] {\n return this.scope.resolveFlatAll<AreEventAttribute>(AreEventAttribute)!;\n }\n /**\n * The styles defined for the node, which can include inline styles or styles defined in a separate stylesheet that are applied to the node. These styles can be used to control the visual appearance of the node and can be defined using standard CSS syntax.\n */\n get styles(): AreStyle {\n return this.scope.resolveFlat<AreStyle>(AreStyle)!;\n }\n\n /**\n * Registers or updates the component-scoped CSS string for this node.\n * Called by the @Are.Styles-decorated method on the associated component.\n * A new AreStyle fragment is registered in scope on first call; subsequent\n * calls update the existing fragment in-place.\n */\n setStyles(css: string): void {\n const existing = this.scope.resolveFlat<AreStyle>(AreStyle);\n if (existing) {\n existing.styles = css;\n } else {\n this.scope.register(new AreStyle(css, this.aseid.toString()));\n }\n }\n\n}","import { AreNodeNewProps } from \"@adaas/are\";\nimport { AreHTMLNode } from \"@adaas/are-html/node\";\nimport { A_Frame } from \"@adaas/a-frame/core\";\n\n@A_Frame.Define({\n namespace: 'a-are-html',\n description: 'Node type representing a comment node in the AreHTMLNode tree. Used as a stable DOM anchor by structural directives such as $if and $for that swap rendered content in and out, ensuring the parent container always has a consistent insertion point.'\n})\nexport class AreComment extends AreHTMLNode {\n\n\n\n fromNew(newEntity: AreNodeNewProps): void {\n super.fromNew({\n ...newEntity,\n payload:{\n ...(newEntity.payload || {}),\n entity: 'are-comment',\n }\n });\n }\n}","import { A_FormatterHelper, } from \"@adaas/a-concept\";\nimport { A_Frame } from \"@adaas/a-frame/core\"\nimport { Are } from \"@adaas/are\";\nimport { AreHTMLNode } from \"@adaas/are-html/node\";\n\n\n@A_Frame.Define({\n namespace: 'a-are-html',\n description: 'AreComponentNode represents a node in the scene graph that corresponds to a component. It extends the base AreNode and includes additional properties and methods specific to component nodes, such as handling attributes, bindings, directives, events, styles, and interpolations associated with the component.'\n})\nexport class AreComponentNode extends AreHTMLNode {\n\n /**\n * A custom component associated with this node, which can be used to provide custom logic and behavior for the node. This component is typically defined in the context and can be resolved based on the node's type or other identifying information. The component can include its own template, markup, styles, and features that are specific to the functionality it provides.\n * \n * Example: If the node type is \"custom-component\", the corresponding component would be resolved from the context and can be used to provide custom rendering and behavior for nodes of that type.\n * \n * [!] Note: The component is optional and may not be defined for all nodes. If no component is associated with the node, it will be treated as a standard HTML element or a basic node without custom logic.\n */\n get component(): Are | undefined {\n return this.scope.resolve<Are>(A_FormatterHelper.toPascalCase(this.aseid.entity)) as Are | undefined;\n }\n\n}","import { AreNodeNewProps } from \"@adaas/are\";\nimport { AreHTMLNode } from \"@adaas/are-html/node\";\nimport { A_Frame } from \"@adaas/a-frame/core\";\n\n\n@A_Frame.Define({\n namespace: 'a-are-html',\n description: 'Node type representing a reactive inline expression in the AreHTMLNode tree. Its content expression is resolved from the store at render time and kept live via an AddInterpolation instruction that updates the corresponding text node on each reactive cycle.'\n})\nexport class AreInterpolation extends AreHTMLNode {\n\n fromNew(newEntity: AreNodeNewProps): void {\n super.fromNew({\n ...newEntity,\n payload:{\n ...(newEntity.payload || {}),\n entity: 'are-interpolation',\n }\n });\n }\n}","import { A_FormatterHelper, } from \"@adaas/a-concept\";\nimport { A_Frame } from \"@adaas/a-frame/core\"\nimport { Are } from \"@adaas/are\";\nimport { AreHTMLNode } from \"@adaas/are-html/node\";\n\n\n@A_Frame.Define({\n namespace: 'a-are-html',\n description: 'AreRootNode represents the root node in the scene graph. It extends the base AreHTMLNode and includes additional properties and methods specific to the root node, such as handling the root element and its associated component.'\n})\nexport class AreRootNode extends AreHTMLNode {\n /**\n * For the root node, we can default to a generic container element like <div> since it serves as the root of the component tree and does not correspond to a specific HTML tag defined in the markup. The actual content and structure of the root node will be determined by the child nodes and components that are rendered within it, allowing for flexibility in how the root node is used and what it contains.\n */\n get tag(): string {\n return 'div';\n }\n /**\n * A custom component associated with this node, which can be used to provide custom logic and behavior for the node. This component is typically defined in the context and can be resolved based on the node's type or other identifying information. The component can include its own template, markup, styles, and features that are specific to the functionality it provides.\n * \n * Example: If the node type is \"custom-component\", the corresponding component would be resolved from the context and can be used to provide custom rendering and behavior for nodes of that type.\n * \n * [!] Note: The component is optional and may not be defined for all nodes. If no component is associated with the node, it will be treated as a standard HTML element or a basic node without custom logic.\n */\n get component(): Are | undefined {\n return this.scope.resolve<Are>(A_FormatterHelper.toPascalCase(this.aseid.entity)) as Are | undefined;\n }\n}","import { AreNodeNewProps } from \"@adaas/are\";\nimport { AreHTMLNode } from \"@adaas/are-html/node\";\nimport { A_Frame } from \"@adaas/a-frame/core\";\n\n\n@A_Frame.Define({\n namespace: 'a-are-html',\n description: 'Node type representing a plain or partially-dynamic text segment in the AreHTMLNode tree. Emits an AddText instruction that sets or updates the corresponding DOM text node; the content may carry a store getter for any dynamic portion.'\n})\nexport class AreText extends AreHTMLNode {\n\n\n fromNew(newEntity: AreNodeNewProps): void {\n super.fromNew({\n ...newEntity,\n payload: {\n ...(newEntity.payload || {}),\n entity: 'are-text',\n }\n });\n }\n}","import { A_Route } from \"@adaas/a-utils/a-route\";\nimport { A_Signal } from \"@adaas/a-utils/a-signal\";\nimport { AreSignal } from \"@adaas/are\";\nimport { A_Frame } from \"@adaas/a-frame/core\";\n\n\n\n@A_Frame.Define({\n namespace: 'a-are-html',\n description: 'ARE signal that carries an A_Route value. Dispatched by AreRouteWatcher on client-side navigation events (pushState, replaceState, popstate). The signal bus delivers it to all subscribed root nodes, triggering route-based conditional rendering across the component tree.'\n})\nexport class AreRoute extends AreSignal<A_Route> {\n\n constructor(path: string | RegExp) {\n super({\n data: new A_Route(path)\n });\n }\n\n get route(): A_Route {\n return this.data;\n }\n\n static default(): AreRoute | undefined {\n return new AreRoute(document.location.pathname || '/');\n }\n\n\n compare(other: A_Signal<A_Route>): boolean {\n return this.route.toRegExp().test(other.data.toString());\n }\n}","// ─────────────────────────────────────────────────────────────────────────────\n// ── SVG ──────────────────────────────────────────────────────────────────────\n// ─────────────────────────────────────────────────────────────────────────────\n\n/** XML namespace URI for SVG elements. */\nexport const SVG_NAMESPACE = 'http://www.w3.org/2000/svg';\n\n/**\n * Maps namespace prefixes used in SVG/XML attributes to their canonical URIs.\n * Used by the interpreter when calling setAttributeNS / removeAttributeNS.\n */\nexport const SVG_ATTRIBUTE_NS: Record<string, string> = {\n xlink: 'http://www.w3.org/1999/xlink',\n xml: 'http://www.w3.org/XML/1998/namespace',\n xmlns: 'http://www.w3.org/2000/xmlns/',\n};\n\n// ─────────────────────────────────────────────────────────────────────────────\n// ── HTML void elements ────────────────────────────────────────────────────────\n// ─────────────────────────────────────────────────────────────────────────────\n\n/**\n * Void HTML elements that cannot have children and must not have a closing tag.\n * Per the HTML5 spec these are treated as self-closing even when written as\n * `<input>` (without the trailing slash `/>`).\n *\n * Reference: https://html.spec.whatwg.org/multipage/syntax.html#void-elements\n */\nexport const VOID_ELEMENTS = new Set<string>([\n 'area', 'base', 'br', 'col', 'embed', 'hr', 'img', 'input',\n 'link', 'meta', 'param', 'source', 'track', 'wbr',\n]);\n\nexport function isVoidElement(tagName: string): boolean {\n return VOID_ELEMENTS.has(tagName.toLowerCase());\n}\n\n/**\n * Boolean HTML attributes whose presence (regardless of value) implies \"true\",\n * and whose absence implies \"false\". Setting these via `setAttribute(name, value)`\n * always renders the attribute, which is wrong for reactive bindings.\n *\n * Reference: https://html.spec.whatwg.org/multipage/indices.html#attributes-3\n */\nexport const BOOLEAN_ATTRIBUTES = new Set<string>([\n 'allowfullscreen',\n 'async',\n 'autofocus',\n 'autoplay',\n 'checked',\n 'controls',\n 'default',\n 'defer',\n 'disabled',\n 'formnovalidate',\n 'hidden',\n 'inert',\n 'ismap',\n 'itemscope',\n 'loop',\n 'multiple',\n 'muted',\n 'nomodule',\n 'novalidate',\n 'open',\n 'playsinline',\n 'readonly',\n 'required',\n 'reversed',\n 'selected',\n]);\n\nexport function isBooleanAttribute(name: string): boolean {\n return BOOLEAN_ATTRIBUTES.has(name.toLowerCase());\n}\n\n/**\n * Form-control IDL properties that must be set as a JS property\n * (not just an attribute) so live user input is reflected.\n *\n * `<input value=\"foo\">` only sets the *default* value;\n * `input.value = \"foo\"` updates the live state.\n */\nexport const IDL_FORM_PROPERTIES: Record<string, Set<string>> = {\n INPUT: new Set(['value', 'checked', 'indeterminate']),\n TEXTAREA: new Set(['value']),\n SELECT: new Set(['value']),\n OPTION: new Set(['selected']),\n};\n\nexport function isIDLFormProperty(tagName: string, attrName: string): boolean {\n const set = IDL_FORM_PROPERTIES[tagName.toUpperCase()];\n return !!set && set.has(attrName);\n}\n\n/**\n * Normalize a `:class` binding value into a single space-separated string.\n * Supports the common shapes:\n * - string → \"a b\"\n * - array<string | object | falsy> → [\"a\", { b: true, c: cond }, null]\n * - object<string, boolean> → { a: true, b: false }\n */\nexport function normalizeClassValue(value: any): string {\n if (value === null || value === undefined || value === false) return '';\n if (typeof value === 'string') return value;\n if (typeof value === 'number') return String(value);\n\n if (Array.isArray(value)) {\n return value.map(normalizeClassValue).filter(Boolean).join(' ');\n }\n if (typeof value === 'object') {\n const parts: string[] = [];\n for (const key of Object.keys(value)) {\n if (value[key]) parts.push(key);\n }\n return parts.join(' ');\n }\n return '';\n}\n\n/**\n * Normalize a `:style` binding value into an inline-style string.\n * Supports:\n * - string → \"color: red; font-size: 12px\"\n * - object<string, string|number> → { color: 'red', fontSize: '12px' }\n * - array<string | object> → ['color: red', { fontSize: '12px' }]\n */\nexport function normalizeStyleValue(value: any): string {\n if (value === null || value === undefined || value === false) return '';\n if (typeof value === 'string') return value;\n if (typeof value === 'number') return String(value);\n\n if (Array.isArray(value)) {\n return value.map(normalizeStyleValue).filter(Boolean).join('; ');\n }\n if (typeof value === 'object') {\n const parts: string[] = [];\n for (const key of Object.keys(value)) {\n const v = value[key];\n if (v === null || v === undefined || v === false) continue;\n const kebab = key.replace(/[A-Z]/g, m => '-' + m.toLowerCase());\n parts.push(`${kebab}: ${v}`);\n }\n return parts.join('; ');\n }\n return '';\n}\n\n/**\n * Parse a DOM event name with modifiers, e.g. \"click.stop.prevent\" or \"keydown.enter\".\n * Returns the bare event name plus the modifier set.\n */\nexport interface ParsedEventName {\n event: string;\n modifiers: Set<string>;\n}\n\nexport function parseEventName(raw: string): ParsedEventName {\n const [event, ...modifiers] = raw.split('.');\n return { event, modifiers: new Set(modifiers) };\n}\n\n/**\n * Known event-listener modifiers that map directly to addEventListener options.\n */\nexport const LISTENER_OPTION_MODIFIERS = new Set(['capture', 'once', 'passive']);\n\n/**\n * Coerce a value into a string for DOM consumption.\n * Avoids \"undefined\"/\"null\"/\"[object Object]\" leaks into the DOM.\n */\nexport function toDOMString(value: any): string {\n if (value === null || value === undefined) return '';\n if (typeof value === 'string') return value;\n if (typeof value === 'number' || typeof value === 'boolean') return String(value);\n try {\n return JSON.stringify(value);\n } catch {\n return '';\n }\n}\n\n\n","import { AreContext, AreDeclaration, AreInstruction, AreNode } from \"@adaas/are\";\nimport { AreHTMLContextConstructor } from \"./AreHTML.types\";\nimport { A_Frame } from \"@adaas/a-frame/core\";\n\n\n@A_Frame.Define({\n namespace: 'a-are-html',\n description: 'Runtime index for the HTML rendering engine. Maps each AreNode and instruction ASEID to its corresponding DOM element so that apply and revert handlers on interpreter instructions can look up their DOM node in O(1). Tracks root-element mounts and maintains the group-level index used by structural directives.'\n})\nexport class AreHTMLEngineContext extends AreContext {\n\n /**\n * Index structure mapping:\n * \n * Node -> Group ID -> Element\n * -----------------------------------------------------------------------------------\n * | - Attribute | group: string | Node\n * | - Directive (e.g. for) | | Node\n */\n\n protected index = {\n /**\n * 1 AreNode = 1 Dom Node\n * \n * uses ASEID\n */\n nodeToHostElements: new Map<string, Node>(),\n /**\n * 1 Group Instruction = MANY Dom Nodes (e.g. for loop)\n * \n * uses ASEID\n */\n groupToElements: new Map<string, Set<Node>>(),\n /**\n * 1 Dom Node = 1 Instruction \n * \n * uses ASEID\n */\n elementToInstruction: new WeakMap<Node, string>(),\n /**\n * 1 Instruction = 1 Dom Node (for CreateElement instructions, for example)\n * \n * uses ASEID\n */\n instructionToElement: new Map<string, Node>(),\n /**\n * Event listeners attached to elements, used for proper cleanup when reverting instructions. Maps a DOM element to a map of event names and their corresponding listeners, allowing the engine to track which listeners are attached to which elements and remove them when necessary (e.g., when an instruction is reverted).\n */\n elementListeners: new WeakMap<Node, Map<string, Set<EventListenerOrEventListenerObject>>>()\n }\n\n /**\n * The root container for the HTML engine, which can be either a Document or a ShadowRoot. This is where the engine will mount the generated DOM elements. The context uses this container to manage the relationship between AreNodes, instructions, and their corresponding DOM elements, allowing for efficient updates and cleanups as the application state changes.\n */\n protected _container: Document;\n\n\n constructor(props: Partial<AreHTMLContextConstructor>) {\n super(props.container?.body.innerHTML || props.source || '');\n this._container = props.container!;\n }\n\n get container(): Document {\n return this._container;\n }\n\n\n /**\n * Retrieves the DOM element associated with a given AreNode. This method looks up the node's ASEID in the nodeToHostElements map to find the corresponding DOM element. If the node is not found, it returns undefined. This allows the engine to efficiently access and manipulate the DOM elements that correspond to specific nodes in the AreNode tree, enabling dynamic updates and interactions based on the application state.\n * \n * @param nodeASEID \n */\n getNodeElement(nodeASEID: string): Node | undefined\n getNodeElement(node: AreNode): Node | undefined\n getNodeElement(node: AreNode | string): Node | undefined {\n if (typeof node === 'string') {\n return this.index.nodeToHostElements.get(node);\n } else {\n return this.index.nodeToHostElements.get(node.aseid.toString());\n }\n }\n\n /**\n * Associates a DOM element with a given instruction and its owner node. This method updates the context's index to map the instruction's ASEID to the provided DOM element, and also maps the element back to the instruction's ASEID for reverse lookup. If the instruction has an owner node, it also maps the node's ASEID to the element. Additionally, if the instruction belongs to a group, it adds the element to the set of elements associated with that group. This indexing allows the engine to efficiently manage and update DOM elements based on instructions and their corresponding nodes, enabling dynamic rendering and interaction in response to application state changes.\n * \n * @param instruction \n * @param element \n */\n setInstructionElement(instruction: AreInstruction, element: Node): void {\n const node = instruction.owner;\n\n this.index.instructionToElement.set(instruction.aseid.toString(), element);\n this.index.elementToInstruction.set(element, instruction.aseid.toString());\n\n // Only update the host-element pointer for declaration instructions.\n // Mutations (attributes, styles, event listeners, …) produce auxiliary DOM\n // that must never overwrite the owning node's primary element in the index.\n if (node && instruction instanceof AreDeclaration) {\n this.index.nodeToHostElements.set(node.aseid.toString(), element);\n }\n\n if (instruction.group) {\n const groupId = instruction.group;\n if (!this.index.groupToElements.has(groupId)) {\n this.index.groupToElements.set(groupId, new Set());\n }\n this.index.groupToElements.get(groupId)!.add(element);\n }\n }\n\n /**\n * Retrieves the DOM element associated with a given instruction. This method looks up the instruction's ASEID in the instructionToElement map to find the corresponding DOM element. If the instruction is not found, it returns undefined. This allows the engine to efficiently access and manipulate the DOM elements that correspond to specific instructions, enabling dynamic updates and interactions based on the application state.\n * \n * @param instructionASEID \n */\n getElementByInstruction(instructionASEID: string): Node | undefined\n getElementByInstruction(instruction: AreInstruction): Node | undefined\n getElementByInstruction(instruction: AreInstruction | string): Node | undefined {\n if (typeof instruction === 'string') {\n return this.index.instructionToElement.get(instruction);\n } else {\n return this.index.instructionToElement.get(instruction.aseid.toString());\n }\n }\n\n\n /**\n * Removes the association between a given instruction and its corresponding DOM element. This method looks up the instruction's ASEID to find the associated DOM element, and if found, it deletes the mapping from both instructionToElement and elementToInstruction. If the instruction has an owner node, it also removes the mapping from nodeToHostElements. Additionally, if the instruction belongs to a group, it removes the element from the set of elements associated with that group, and if the group has no more elements, it deletes the group from the index. This cleanup is essential for maintaining an accurate and efficient mapping of instructions to DOM elements, especially when instructions are reverted or when nodes are removed from the DOM.\n * \n * @param instruction \n */\n removeInstructionElement(instruction: AreInstruction): void {\n const element = this.index.instructionToElement.get(instruction.aseid.toString());\n if (element) {\n this.index.instructionToElement.delete(instruction.aseid.toString());\n this.index.elementToInstruction.delete(element);\n\n const node = instruction.owner;\n if (node && instruction instanceof AreDeclaration) {\n this.index.nodeToHostElements.delete(node.aseid.toString());\n }\n\n if (instruction.group) {\n const groupId = instruction.group;\n const groupElements = this.index.groupToElements.get(groupId);\n if (groupElements) {\n groupElements.delete(element);\n if (groupElements.size === 0) {\n this.index.groupToElements.delete(groupId);\n }\n }\n }\n }\n }\n\n /**\n * Retrieves the set of DOM elements associated with a given group. This method looks up the group name or instruction's ASEID in the groupToElements map to find the corresponding set of DOM elements. If the group is not found, it returns undefined. This allows the engine to efficiently access and manipulate all DOM elements that belong to a specific group (e.g., all elements generated by a particular loop instruction), enabling dynamic updates and interactions based on the application state.\n * \n * @param groupName \n */\n getElementsByGroup(groupName: string): Set<Node> | undefined\n getElementsByGroup(instruction: AreInstruction): Set<Node> | undefined\n getElementsByGroup(instruction: AreInstruction | string): Set<Node> | undefined {\n if (typeof instruction === 'string') {\n return this.index.groupToElements.get(instruction);\n } else {\n return this.index.groupToElements.get(instruction.aseid.toString());\n }\n }\n\n /**\n * Adds an event listener to a specific DOM element and keeps track of it in the context's index for proper cleanup later. This method takes a DOM element, an event name, and a listener function or object, and stores this information in the elementListeners map. This allows the engine to efficiently manage event listeners attached to dynamically created elements, ensuring that they can be removed when the associated instructions are reverted or when nodes are removed from the DOM, preventing memory leaks and unintended behavior.\n * \n * @param element \n * @param eventName \n * @param listener \n */\n addListener(element: Node, eventName: string, listener: EventListenerOrEventListenerObject): void {\n if (!this.index.elementListeners.has(element)) {\n this.index.elementListeners.set(element, new Map());\n }\n const byEvent = this.index.elementListeners.get(element)!;\n if (!byEvent.has(eventName)) {\n byEvent.set(eventName, new Set());\n }\n byEvent.get(eventName)!.add(listener);\n }\n /**\n * Retrieves the event listener associated with a specific DOM element and event name from the context's index. This method looks up the element in the elementListeners map and then retrieves the listener for the specified event name. If no listener is found for the given element and event, it returns undefined. This allows the engine to efficiently access and manage event listeners that have been attached to dynamically created elements, enabling proper cleanup when instructions are reverted or when nodes are removed from the DOM.\n * \n * @param element \n * @param eventName \n * @returns \n */\n getListener(element: Node, eventName: string): EventListenerOrEventListenerObject | undefined {\n const set = this.index.elementListeners.get(element)?.get(eventName);\n if (!set || set.size === 0) return undefined;\n // Return the first listener for backwards compatibility.\n return set.values().next().value;\n }\n\n /**\n * Returns all listeners registered for a given element + event name.\n */\n getListeners(element: Node, eventName: string): Set<EventListenerOrEventListenerObject> | undefined {\n return this.index.elementListeners.get(element)?.get(eventName);\n }\n /**\n * Removes an event listener from a specific DOM element and updates the context's index accordingly. This method looks up the element in the elementListeners map and deletes the listener for the specified event name. This is typically called when an instruction is reverted or when a node is removed from the DOM, ensuring that any attached event listeners are properly cleaned up to prevent memory leaks and unintended behavior.\n * \n * @param element \n * @param eventName \n */\n removeListener(element: Node, eventName: string, listener?: EventListenerOrEventListenerObject): void {\n const byEvent = this.index.elementListeners.get(element);\n if (!byEvent) return;\n if (listener) {\n const set = byEvent.get(eventName);\n if (set) {\n set.delete(listener);\n if (set.size === 0) byEvent.delete(eventName);\n }\n } else {\n byEvent.delete(eventName);\n }\n }\n}\n","import { A_Caller, A_Dependency, A_Feature, A_FormatterHelper, A_Inject } from \"@adaas/a-concept\";\nimport { A_Logger } from \"@adaas/a-utils/a-logger\";\nimport { A_Frame } from \"@adaas/a-frame/core\";\nimport { AreCompiler, AreScene, AreCompilerError, AreStore, AreSyntax } from \"@adaas/are\";\nimport { AreDirectiveAttribute } from \"@adaas/are-html/attributes/AreDirective.attribute\";\nimport { AreStaticAttribute } from \"@adaas/are-html/attributes/AreStatic.attribute\";\nimport { AreDirectiveFeatures } from \"@adaas/are-html/directive/AreDirective.constants\";\nimport { AreEventAttribute } from \"@adaas/are-html/attributes/AreEvent.attribute\";\nimport { AreBindingAttribute } from \"@adaas/are-html/attributes/AreBinding.attribute\";\nimport { AreInterpolation } from \"@adaas/are-html/nodes/AreInterpolation\";\nimport { AreText } from \"@adaas/are-html/nodes/AreText\";\nimport { AddAttributeInstruction} from \"@adaas/are-html/instructions/AddAttribute.instruction\";\nimport { AddTextInstruction} from \"@adaas/are-html/instructions/AddText.instruction\";\nimport { AddListenerInstruction} from \"@adaas/are-html/instructions/AddListener.instruction\";\nimport { AddStyleInstruction } from \"@adaas/are-html/instructions/AddStyle.instruction\";\nimport { AreHTMLNode } from \"@adaas/are-html/node\";\n\n\n\n\n@A_Frame.Define({\n namespace: 'a-are-html',\n description: 'HTML-specific compiler for A-Concept Rendering Engine (ARE) components, extending the base AreCompiler to handle HTML templates, styles, and rendering logic tailored for web environments.'\n})\nexport class AreHTMLCompiler extends AreCompiler {\n\n /**\n * Extends the base compile for all AreHTMLNode instances (elements, components, root nodes).\n * After the standard element/attribute/children instructions are emitted, checks whether\n * the node has a registered AreStyle and plans an AddStyleInstruction so the interpreter\n * can inject the CSS into the document head during mount.\n */\n @AreCompiler.Compile(AreHTMLNode)\n compileHTMLNode(\n @A_Inject(A_Caller) node: AreHTMLNode,\n @A_Inject(AreScene) scene: AreScene,\n @A_Inject(A_Logger) logger?: A_Logger,\n ...args: any[]\n ): void {\n super.compile(node, scene, logger, ...args);\n\n if (node.styles?.styles) {\n const host = scene.host;\n if (host) {\n scene.plan(new AddStyleInstruction(host, { styles: node.styles.styles }));\n }\n }\n }\n\n // -----------------------------------------------------------------------------------------\n // -------------------------Are-Interpolation Compile Section-----------------------------------\n // -----------------------------------------------------------------------------------------\n /**\n * Default compile method for interpolations, which can be overridden by specific implementations if needed.\n * \n * @param interpolation \n * @param scope \n * @param scene \n * @param store \n * @param feature \n */\n @AreCompiler.Compile(AreInterpolation)\n compileInterpolation(\n @A_Inject(A_Caller) interpolation: AreInterpolation,\n @A_Inject(AreScene) scene: AreScene,\n\n @A_Inject(AreStore) store: AreStore,\n @A_Inject(A_Logger) logger?: A_Logger,\n ...args: any[]\n ) {\n // if (scene.host)\n // console.log('Scene Host: ', scene.host);\n\n // let content = '';\n\n // logger?.debug('green', `AreHTMLCompiler: compile interpolation <${interpolation.aseid.toString()}> with key: \"${interpolation.content}\"`, store.get(interpolation.content));\n\n // try {\n // content = AreCommonHelper.evaluate(interpolation.content, store);\n\n // } catch (error) {\n // content = ''\n // }\n\n scene.plan(new AddTextInstruction({ content: interpolation.content, evaluate: true }));\n }\n\n // -----------------------------------------------------------------------------------------\n // ------------------------------Are-Text Compile Section-----------------------------------\n // -----------------------------------------------------------------------------------------\n @AreCompiler.Compile(AreText)\n compileText(\n @A_Inject(A_Caller) text: AreText,\n @A_Inject(AreScene) scene: AreScene,\n @A_Inject(A_Logger) logger?: A_Logger,\n ...args: any[]\n ) {\n logger?.debug('cyan', `AreHTMLCompiler: compile text node <${text.aseid.toString()}> with content: \"${text.content}\"`);\n if (scene.host)\n scene.unPlan(scene.host);\n\n scene.plan(new AddTextInstruction({ content: text.content }));\n\n }\n\n // -----------------------------------------------------------------------------------------\n // -------------------------Are-Attribute Compile Section-----------------------------------\n // -----------------------------------------------------------------------------------------\n\n @AreCompiler.Compile(AreStaticAttribute)\n compileStaticAttribute(\n @A_Inject(A_Caller) attribute: AreStaticAttribute,\n @A_Inject(AreScene) scene: AreScene,\n ...args: any[]\n ) {\n if (!scene.host)\n throw new AreCompilerError({\n title: 'Scene Host Not Found',\n description: `No host found for the scene with id: ${scene.id}. Please ensure that the scene is properly initialized and has a host before compiling binding attributes.`\n });\n\n const content = attribute.content;\n\n /**\n * If the attribute value contains {{ }} interpolations, transform them into\n * a JS string-concatenation expression so the interpreter can evaluate them.\n * e.g. \"color:{{expr}}\" → '\"color:\"+(expr)+\"\"'\n */\n if (content.includes('{{')) {\n const transformed = '\"' + content.replace(/\\{\\{([^}]+)\\}\\}/g, '\"+($1)+\"') + '\"';\n scene.plan(new AddAttributeInstruction(scene.host, {\n name: attribute.name,\n content: transformed,\n evaluate: true,\n }));\n return;\n }\n\n /**\n * Default case: regular static attribute rendered as-is.\n */\n scene.plan(new AddAttributeInstruction(scene.host, {\n name: attribute.name,\n content: attribute.content\n }));\n }\n\n @AreCompiler.Compile(AreDirectiveAttribute)\n compileDirectiveAttribute(\n @A_Inject(A_Caller) directive: AreDirectiveAttribute,\n @A_Inject(AreStore) store: AreStore,\n @A_Inject(A_Feature) feature: A_Feature,\n @A_Inject(A_Logger) logger?: A_Logger,\n ...args: any[]\n ) {\n store.watch(directive);\n\n /**\n * 3. If the attribute is a directive, then we should find a component that is responsible for\n * the directive compiling logic, and call it. \n * In case component is not found we just want to log a warning, \n * since the directive may be handled by some parent component or simply is a mistake in the template.\n */\n if (directive.component) {\n feature.chain(directive.component, AreDirectiveFeatures.Compile, directive.owner.scope);\n } else {\n logger?.warning(`Directive handler component not found for directive: ${directive.name}. Make sure to create a component named \"AreDirective${A_FormatterHelper.toPascalCase(directive.name)}\" to handle this directive.`);\n }\n\n store.unwatch(directive);\n }\n\n\n @AreCompiler.Compile(AreEventAttribute)\n compileEventAttribute(\n @A_Inject(A_Caller) attribute: AreEventAttribute,\n @A_Inject(AreScene) scene: AreScene,\n ...args: any[]\n ) {\n\n if (!scene.host)\n throw new AreCompilerError({\n title: 'Scene Host Not Found',\n description: `No host found for the scene with id: ${scene.id}. Please ensure that the scene is properly initialized and has a host before compiling binding attributes.`\n });\n /**\n * 2. In case the attribute is an event listener, then \n * we should simply add a callback handler that will be used to proxy an event \n * into the ComponentNode component. \n *[!] In this case AreAttribute is AreEventAttribute that has prepared callback function to be used \n * in the event listener. It is important to store callback function once \n * to prevent duplicated functions in case of multiple compilations during development.\n */\n scene.plan(new AddListenerInstruction(scene.host, {\n name: attribute.name,\n handler: attribute.content\n }));\n }\n\n\n @AreCompiler.Compile(AreBindingAttribute)\n compileBindingAttribute(\n @A_Inject(A_Caller) attribute: AreBindingAttribute,\n @A_Inject(AreScene) scene: AreScene,\n @A_Dependency.Parent()\n @A_Inject(AreStore) parentStore: AreStore,\n @A_Inject(AreStore) store: AreStore,\n @A_Inject(AreSyntax) syntax: AreSyntax,\n ...args: any[]\n ) {\n if (!scene.host)\n throw new AreCompilerError({\n title: 'Scene Host Not Found',\n description: `No host found for the scene with id: ${scene.id}. Please ensure that the scene is properly initialized and has a host before compiling binding attributes.`\n });\n\n\n const node = attribute.owner;\n const props = node.component?.props;\n\n // Component prop names are typically declared in camelCase, while template\n // markup uses kebab-case. Try both forms when matching.\n let propName: string | undefined;\n if (props) {\n if (props[attribute.name]) {\n propName = attribute.name;\n } else {\n const camel = A_FormatterHelper.toCamelCase(attribute.name);\n if (props[camel]) propName = camel;\n }\n }\n\n /**\n * 1. Component prop binding — evaluate against the parent store and\n * keep the child store reactive to upstream changes.\n */\n if (propName && props) {\n const propDefinition = props[propName];\n\n const coerce = (raw: any): any => {\n let value = raw;\n if (propDefinition.type) {\n switch (propDefinition.type) {\n case 'string': value = value === undefined || value === null ? '' : String(value); break;\n case 'number': value = Number(value); break;\n case 'boolean': value = Boolean(value); break;\n }\n }\n return value;\n };\n\n // The watcher entity below is registered against parentStore so that\n // updates to the bound expression in the parent flow into the child store.\n const watcher = {\n update: () => {\n try {\n parentStore.watch(watcher);\n const next = coerce(syntax.evaluate(attribute.content, parentStore));\n parentStore.unwatch(watcher);\n store.set(propName!, next);\n } catch (e) {\n parentStore.unwatch(watcher);\n }\n }\n };\n\n // Initial read with watch active so dependencies are recorded.\n parentStore.watch(watcher);\n const initial = coerce(syntax.evaluate(attribute.content, parentStore));\n parentStore.unwatch(watcher);\n\n store.set(propName, initial);\n return;\n }\n\n /**\n * 2. Default attribute binding — evaluated reactively against the local store.\n */\n const instruction = new AddAttributeInstruction(scene.host, {\n name: attribute.name,\n content: attribute.content,\n evaluate: true\n })\n\n scene.plan(instruction);\n }\n\n\n}","import { A_Caller, A_Inject } from \"@adaas/a-concept\";\nimport { A_Frame } from \"@adaas/a-frame/core\"\nimport { A_Logger } from \"@adaas/a-utils/a-logger\";\nimport {\n AreSyntax, AreStore,\n AreEvent,\n AreInstructionDefaultNames,\n AreInterpreterError,\n AreInterpreter\n} from \"@adaas/are\";\nimport { AreHTMLInstructions } from \"@adaas/are-html/instructions/AreHTML.instructions.constants\";\nimport { AddAttributeInstruction } from \"@adaas/are-html/instructions/AddAttribute.instruction\";\nimport { AddCommentInstruction } from \"@adaas/are-html/instructions/AddComment.instruction\";\nimport { AddElementInstruction } from \"@adaas/are-html/instructions/AddElement.instruction\";\nimport { AddListenerInstruction } from \"@adaas/are-html/instructions/AddListener.instruction\";\nimport { AddTextInstruction } from \"@adaas/are-html/instructions/AddText.instruction\";\nimport { AddStyleInstruction } from \"@adaas/are-html/instructions/AddStyle.instruction\";\nimport { AreDirectiveContext } from \"@adaas/are-html/directive/AreDirective.context\";\nimport { AreHTMLNode } from \"../lib/AreHTMLNode/AreHTMLNode\";\nimport { AreHTMLEngineContext } from \"./AreHTML.context\";\nimport {\n isBooleanAttribute,\n isIDLFormProperty,\n normalizeClassValue,\n normalizeStyleValue,\n parseEventName,\n toDOMString,\n SVG_NAMESPACE,\n SVG_ATTRIBUTE_NS,\n} from \"./AreHTML.constants\";\n\n\n@A_Frame.Define({\n namespace: 'a-are-html',\n description: 'DOM interpreter for the HTML rendering pipeline. Extends AreInterpreter to apply and revert each ARE instruction type directly against the browser DOM — creating and removing elements, setting and removing attributes and event listeners, managing inline styles, and inserting text and comment nodes. Driven by the scene diff computed per render cycle.'\n})\nexport class AreHTMLInterpreter extends AreInterpreter {\n // ─────────────────────────────────────────────────────────────────────────────\n // ── CreateElement — Apply / Revert ───────────────────────────────────────────\n // ─────────────────────────────────────────────────────────────────────────────\n @A_Frame.Define({\n description: 'Create an HTML element based on the provided declaration instruction. Handles both root-level mounting and child element creation based on the structural parent hierarchy.'\n })\n @AreInterpreter.Apply(AreInstructionDefaultNames.Default)\n @AreInterpreter.Apply(AreHTMLInstructions.AddElement)\n addElement(\n @A_Inject(A_Caller) declaration: AddElementInstruction,\n @A_Inject(AreHTMLEngineContext) context: AreHTMLEngineContext,\n @A_Inject(A_Logger) logger?: A_Logger,\n ) {\n try {\n const node = declaration.owner as AreHTMLNode;\n\n let currentNode: AreHTMLNode | undefined = node;\n let parent: AreHTMLNode | undefined = node.parent as AreHTMLNode | undefined;\n\n while (parent) {\n if (context.getNodeElement(parent)) {\n break;\n }\n currentNode = parent;\n parent = parent.parent as AreHTMLNode | undefined;\n }\n\n\n // Determine the element tag — components render as a wrapper div\n const tag = node.tag;\n\n const isSVG = tag === 'svg' || this.isInSVGContext(node);\n\n if (parent) {\n\n const mountPoint = context.getNodeElement(parent)\n\n if (!mountPoint) {\n throw new AreInterpreterError({\n title: 'Mount Point Not Found',\n description: `Could not find a mount point for the node with id \"${node.id}\". Ensure that the parent node is rendered before its children, or that a valid root element with the corresponding id exists in the DOM.`\n });\n }\n\n const element = isSVG\n ? context.container.createElementNS(SVG_NAMESPACE, tag)\n : context.container.createElement(tag);\n\n if (mountPoint.nodeType === Node.ELEMENT_NODE) {\n // parent is a real element — just append\n mountPoint.appendChild(element);\n } else {\n // parent is an anchor (comment/text node) — insert before it\n // so content always appears before the anchor marker\n mountPoint.parentNode?.insertBefore(element, mountPoint);\n }\n\n context.setInstructionElement(declaration, element);\n\n } else {\n const mountPoint = context.container.getElementById(node.id);\n if (!mountPoint) {\n throw new AreInterpreterError({\n title: 'Mount Point Not Found',\n description: `Could not find a mount point for the node with id \"${node.id}\". Ensure that the parent node is rendered before its children, or that a valid root element with the corresponding id exists in the DOM.`\n });\n }\n\n const element = isSVG\n ? context.container.createElementNS(SVG_NAMESPACE, tag)\n : context.container.createElement(tag);\n\n mountPoint.parentNode?.replaceChild(element, mountPoint);\n\n context.setInstructionElement(declaration, element);\n }\n\n // Register the element in the context index\n\n logger?.debug('green', `Element ${node.aseid.toString()} added to Context:`);\n\n } catch (error) {\n logger?.error(error);\n throw error;\n }\n }\n\n\n @A_Frame.Define({\n description: 'Remove an HTML element that was created by a CreateElement declaration. Cleans up the DOM and the context index.'\n })\n @AreInterpreter.Revert(AreInstructionDefaultNames.Default)\n @AreInterpreter.Revert(AreHTMLInstructions.AddElement)\n removeElement(\n @A_Inject(A_Caller) declaration: AddElementInstruction,\n @A_Inject(AreHTMLEngineContext) context: AreHTMLEngineContext,\n ) {\n const element = context.getElementByInstruction(declaration);\n\n if (element && element.parentNode) {\n element.parentNode.removeChild(element);\n }\n\n context.removeInstructionElement(declaration);\n }\n\n\n // ─────────────────────────────────────────────────────────────────────────────\n // ── AddAttribute — Apply / Revert ────────────────────────────────────────────\n // ─────────────────────────────────────────────────────────────────────────────\n @A_Frame.Define({\n description: 'Add an attribute to an HTML element based on the provided mutation instruction.'\n })\n @AreInterpreter.Apply(AreHTMLInstructions.AddAttribute)\n @AreInterpreter.Update(AreHTMLInstructions.AddAttribute)\n addAttribute(\n @A_Inject(A_Caller) mutation: AddAttributeInstruction,\n @A_Inject(AreHTMLEngineContext) context: AreHTMLEngineContext,\n @A_Inject(AreStore) store: AreStore,\n @A_Inject(AreSyntax) syntax: AreSyntax,\n @A_Inject(AreDirectiveContext) directiveContext?: AreDirectiveContext,\n\n @A_Inject(A_Logger) logger?: A_Logger,\n ): void {\n const element = context.getElementByInstruction(mutation.parent!);\n\n\n if (!element) {\n throw new AreInterpreterError({\n title: 'Element Not Found',\n description: `Could not find a DOM element associated with the instruction ASEID \"${mutation.parent}\". Ensure that the parent instruction is properly rendered and associated with a DOM element before applying attribute mutations.`\n });\n }\n const { name, content, evaluate } = mutation.payload;\n\n const rawValue = evaluate ? syntax.evaluate(content, store, {\n ...(directiveContext?.scope || {})\n }) : content;\n\n const el = element as HTMLElement;\n const lowerName = name.toLowerCase();\n\n // ── 0. Namespace-prefixed attributes (xlink:href, xml:space, xmlns:*) ──\n const colonIdx = name.indexOf(':');\n if (colonIdx > 0) {\n const ns = SVG_ATTRIBUTE_NS[name.slice(0, colonIdx)];\n if (ns) {\n (el as Element).setAttributeNS(ns, name, toDOMString(rawValue));\n mutation.cache = toDOMString(rawValue);\n return;\n }\n }\n\n // ── 1. Boolean attributes ────────────────────────────────────────────\n if (isBooleanAttribute(lowerName)) {\n if (rawValue) {\n el.setAttribute(lowerName, '');\n // also reflect IDL property where supported (disabled, hidden, …)\n try { (el as any)[lowerName] = true; } catch { /* ignore */ }\n } else {\n el.removeAttribute(lowerName);\n try { (el as any)[lowerName] = false; } catch { /* ignore */ }\n }\n mutation.cache = rawValue ? 'true' : '';\n return;\n }\n\n // ── 2. Form-control IDL properties (value/checked/selected) ─────────\n if (isIDLFormProperty(el.tagName, name)) {\n const propName = name === 'value' ? 'value'\n : name === 'checked' ? 'checked'\n : name === 'selected' ? 'selected'\n : name === 'indeterminate' ? 'indeterminate'\n : name;\n try {\n if (propName === 'checked' || propName === 'selected' || propName === 'indeterminate') {\n (el as any)[propName] = !!rawValue;\n } else {\n (el as any)[propName] = toDOMString(rawValue);\n }\n } catch { /* ignore */ }\n // also keep the attribute in sync for SSR/CSS selectors\n if (propName !== 'value') {\n if (rawValue) el.setAttribute(name, ''); else el.removeAttribute(name);\n } else {\n el.setAttribute(name, toDOMString(rawValue));\n }\n mutation.cache = toDOMString(rawValue);\n return;\n }\n\n // ── 3. Class binding — supports object/array/string and merges ──────\n if (lowerName === 'class') {\n const newValue = normalizeClassValue(rawValue);\n\n if (mutation.cache === undefined) {\n const existingValue = el.getAttribute('class');\n const merged = existingValue ? `${existingValue} ${newValue}`.trim() : newValue;\n if (merged) el.setAttribute('class', merged); else el.removeAttribute('class');\n } else {\n const existingValue = el.getAttribute('class');\n const existingParts = existingValue ? existingValue.split(/\\s+/).filter(Boolean) : [];\n const oldParts = new Set((mutation.cache as string).split(/\\s+/).filter(Boolean));\n const newParts = newValue ? newValue.split(/\\s+/).filter(Boolean) : [];\n\n const merged = [...existingParts.filter(p => !oldParts.has(p)), ...newParts].join(' ');\n if (merged) el.setAttribute('class', merged); else el.removeAttribute('class');\n }\n mutation.cache = newValue;\n return;\n }\n\n // ── 4. Style binding — supports object/array/string ─────────────────\n if (lowerName === 'style') {\n const newValue = normalizeStyleValue(rawValue);\n if (newValue) el.setAttribute('style', newValue); else el.removeAttribute('style');\n mutation.cache = newValue;\n return;\n }\n\n // ── 5. Default: replace attribute (no whitespace merge) ─────────────\n const stringValue = toDOMString(rawValue);\n if (stringValue === '' && evaluate && (rawValue === false || rawValue === null || rawValue === undefined)) {\n el.removeAttribute(name);\n } else {\n el.setAttribute(name, stringValue);\n }\n mutation.cache = stringValue;\n\n\n }\n\n @A_Frame.Define({\n description: 'Remove an attribute from an HTML element based on the provided mutation instruction.'\n })\n @AreInterpreter.Revert(AreHTMLInstructions.AddAttribute)\n removeAttribute(\n @A_Inject(A_Caller) mutation: AddAttributeInstruction,\n @A_Inject(AreHTMLEngineContext) context: AreHTMLEngineContext,\n ): void {\n try {\n const element = context.getElementByInstruction(mutation.parent!);\n\n if (!element) return;\n\n const { name } = mutation.payload;\n\n if (name && element.nodeType === Node.ELEMENT_NODE) {\n const colonIdx = name.indexOf(':');\n if (colonIdx > 0) {\n const ns = SVG_ATTRIBUTE_NS[name.slice(0, colonIdx)];\n if (ns) {\n (element as Element).removeAttributeNS(ns, name.slice(colonIdx + 1));\n } else {\n (element as HTMLElement).removeAttribute(name);\n }\n } else {\n (element as HTMLElement).removeAttribute(name);\n }\n }\n } catch (error) {\n console.log('Error removing attribute:', error);\n }\n\n }\n\n\n // ─────────────────────────────────────────────────────────────────────────────\n // ── addEventListener — Apply / Revert ────────────────────────────────────────\n // ─────────────────────────────────────────────────────────────────────────────\n\n @A_Frame.Define({\n description: 'Add an event listener to an HTML element based on the provided mutation instruction.'\n })\n @AreInterpreter.Apply(AreHTMLInstructions.AddListener)\n addEventListener(\n @A_Inject(A_Caller) mutation: AddListenerInstruction,\n @A_Inject(AreHTMLEngineContext) context: AreHTMLEngineContext,\n @A_Inject(AreStore) store: AreStore,\n @A_Inject(AreSyntax) syntax: AreSyntax,\n @A_Inject(AreDirectiveContext) directiveContext?: AreDirectiveContext,\n @A_Inject(A_Logger) logger?: A_Logger,\n ) {\n\n const element = context.getElementByInstruction(mutation.parent);\n\n if (!element) {\n throw new AreInterpreterError({\n title: 'Element Not Found',\n description: `Could not find a DOM element associated with the instruction ASEID \"${mutation.parent}\". Ensure that the parent instruction is properly rendered and associated with a DOM element before adding event listeners.`\n });\n }\n\n /**\n * e.g. @click=\"handleClick\"\n * e.g. @click=\"handleClick($event, element)\"\n * e.g. @click.stop.prevent=\"handleClick\"\n * e.g. @keydown.enter=\"submit\"\n * e.g. @click=\"(e)=> user.name ? handleClick(e) : null\"\n */\n\n const { event: eventName, modifiers } = parseEventName(mutation.payload.name);\n\n const listenerOptions: AddEventListenerOptions = {};\n if (modifiers.has('capture')) listenerOptions.capture = true;\n if (modifiers.has('once')) listenerOptions.once = true;\n if (modifiers.has('passive')) listenerOptions.passive = true;\n\n const handlers = syntax.extractEmitHandlers(mutation.payload.handler);\n\n // Holds the live DOM event so handler invocations (with or without\n // template arguments) always have access to it.\n let liveEvent: Event | null = null;\n\n const handlerScope: Record<string, any> = {};\n\n for (const handler of handlers) {\n const handlerFn = (...args: any[]) => {\n const event = new AreEvent(handler);\n // If user passed only template args (e.g. $h('x')), append the DOM\n // event as the last arg. If they passed nothing, args[0] is the DOM event.\n const effectiveArgs = args.length === 0 && liveEvent\n ? [liveEvent]\n : liveEvent\n ? [...args, liveEvent]\n : args;\n event.set('args', effectiveArgs);\n event.set('element', element);\n event.set('instruction', mutation);\n // Expose the raw DOM event under the conventional 'native' key so that\n // event handlers can do: event.get('native')?.target as HTMLInputElement\n if (liveEvent) event.set('native', liveEvent as any);\n mutation.owner.emit(event);\n };\n handlerScope[`$${handler}`] = handlerFn;\n }\n\n const callback = (e: Event) => {\n try {\n liveEvent = e;\n\n if (modifiers.has('self') && e.target !== element) return;\n if (modifiers.has('stop')) e.stopPropagation();\n if (modifiers.has('prevent')) e.preventDefault();\n\n // key-name modifiers for keyboard events: @keydown.enter / .esc / .tab / .space / .up / .down / .left / .right / .delete\n if (e instanceof KeyboardEvent && modifiers.size > 0) {\n const key = (e.key || '').toLowerCase();\n const KEY_ALIASES: Record<string, string[]> = {\n enter: ['enter'],\n esc: ['escape'],\n escape: ['escape'],\n tab: ['tab'],\n space: [' ', 'spacebar'],\n up: ['arrowup'],\n down: ['arrowdown'],\n left: ['arrowleft'],\n right: ['arrowright'],\n delete: ['delete', 'backspace'],\n };\n const keyMods = [...modifiers].filter(m =>\n m in KEY_ALIASES ||\n m === 'ctrl' || m === 'alt' || m === 'shift' || m === 'meta');\n\n if (keyMods.length > 0) {\n const keyMatch = keyMods.some(m => {\n if (m === 'ctrl') return e.ctrlKey;\n if (m === 'alt') return e.altKey;\n if (m === 'shift') return e.shiftKey;\n if (m === 'meta') return e.metaKey;\n const aliases = KEY_ALIASES[m];\n return aliases && aliases.includes(key);\n });\n if (!keyMatch) return;\n }\n }\n\n context.startPerformance('event:' + eventName);\n\n const result = syntax.evaluate(mutation.payload.handler, store, {\n ...handlerScope,\n $event: e,\n ...(directiveContext?.scope || {})\n });\n if (typeof result === 'function') result(e);\n\n context.endPerformance('event:' + eventName);\n } catch (err) {\n logger?.error(err);\n } finally {\n liveEvent = null;\n }\n };\n\n const useOptions = listenerOptions.capture || listenerOptions.once || listenerOptions.passive;\n if (useOptions) {\n element.addEventListener(eventName, callback, listenerOptions);\n } else {\n element.addEventListener(eventName, callback);\n }\n // Track on both the context (for diagnostics) and the mutation itself\n // so the revert path can detach the exact same callback.\n (mutation.payload as any)._callback = callback;\n context.addListener(element, mutation.payload.name, callback);\n }\n\n\n @A_Frame.Define({\n description: 'Remove an event listener from an HTML element based on the provided mutation instruction.'\n })\n @AreInterpreter.Revert(AreHTMLInstructions.AddListener)\n removeEventListener(\n @A_Inject(A_Caller) mutation: AddListenerInstruction,\n @A_Inject(AreHTMLEngineContext) context: AreHTMLEngineContext,\n ) {\n const element = context.getElementByInstruction(mutation.parent);\n\n if (!element) return;\n\n const { name } = mutation.payload;\n const { event: eventName } = parseEventName(name);\n\n const listener = (mutation.payload as any)._callback as EventListenerOrEventListenerObject | undefined;\n\n if (listener) {\n element.removeEventListener(eventName, listener);\n context.removeListener(element, name, listener);\n (mutation.payload as any)._callback = undefined;\n }\n }\n\n\n // ─────────────────────────────────────────────────────────────────────────────\n // ── AddText — Apply / Revert ─────────────────────────────────────────────────\n // ─────────────────────────────────────────────────────────────────────────────\n\n @A_Frame.Define({\n description: 'Add text content to an HTML element based on the provided declaration instruction.'\n })\n @AreInterpreter.Apply(AreHTMLInstructions.AddText)\n @AreInterpreter.Update(AreHTMLInstructions.AddText)\n addText(\n @A_Inject(A_Caller) declaration: AddTextInstruction,\n @A_Inject(AreHTMLEngineContext) context: AreHTMLEngineContext,\n @A_Inject(AreStore) store: AreStore,\n @A_Inject(AreSyntax) syntax: AreSyntax,\n @A_Inject(AreDirectiveContext) directiveContext?: AreDirectiveContext,\n\n @A_Inject(A_Logger) logger?: A_Logger,\n ) {\n const node = declaration.owner.parent;\n const { content, evaluate } = declaration.payload;\n\n const rawValue = evaluate ? syntax.evaluate(content, store, {\n ...(directiveContext?.scope || {})\n }) : content;\n\n const value = toDOMString(rawValue);\n\n\n if (!node) {\n const textNode = context.container.createTextNode(value);\n context.container.body.appendChild(textNode);\n context.setInstructionElement(declaration, textNode);\n\n } else {\n const element = context.getNodeElement(node);\n\n if (!element) {\n throw new AreInterpreterError({\n title: 'Element Not Found',\n description: `Could not find a DOM element associated with the instruction ASEID \"${declaration.owner.parent.aseid}\". Ensure that the parent instruction is properly rendered and associated with a DOM element before applying attribute mutations.`\n });\n\n }\n\n const existingNode = context.getElementByInstruction(declaration);\n\n if (existingNode) {\n existingNode.textContent = value;\n } else {\n const textNode = context.container.createTextNode(value);\n element.appendChild(textNode);\n\n context.setInstructionElement(declaration, textNode);\n }\n }\n\n\n\n logger?.debug('green', `Text ${node?.aseid.toString()} added to Context:`);\n\n }\n\n\n @A_Frame.Define({\n description: 'Remove text content from an HTML element based on the provided declaration instruction.'\n })\n @AreInterpreter.Revert(AreHTMLInstructions.AddText)\n removeText(\n @A_Inject(A_Caller) declaration: AddTextInstruction,\n @A_Inject(AreHTMLEngineContext) context: AreHTMLEngineContext,\n ) {\n const element = context.getElementByInstruction(declaration);\n\n if (!element) return;\n\n element.parentNode?.removeChild(element);\n context.removeInstructionElement(declaration);\n }\n\n\n\n @A_Frame.Define({\n description: 'Add a comment node to the DOM based on the provided declaration instruction.'\n })\n @AreInterpreter.Apply(AreHTMLInstructions.AddComment)\n @AreInterpreter.Update(AreHTMLInstructions.AddComment)\n addComment(\n @A_Inject(A_Caller) declaration: AddCommentInstruction,\n @A_Inject(AreHTMLEngineContext) context: AreHTMLEngineContext,\n @A_Inject(AreStore) store: AreStore,\n @A_Inject(AreSyntax) syntax: AreSyntax,\n @A_Inject(AreDirectiveContext) directiveContext?: AreDirectiveContext,\n\n @A_Inject(A_Logger) logger?: A_Logger,\n ) {\n const node = declaration.owner.parent;\n const { content, evaluate } = declaration.payload;\n\n const rawValue = evaluate ? syntax.evaluate(content, store, {\n ...(directiveContext?.scope || {})\n }) : content;\n\n const value = toDOMString(rawValue);\n\n\n if (!node) {\n const commentNode = context.container.createComment(value);\n context.container.body.appendChild(commentNode);\n context.setInstructionElement(declaration, commentNode);\n\n } else {\n const element = context.getNodeElement(node);\n\n if (!element) {\n throw new AreInterpreterError({\n title: 'Element Not Found',\n description: `Could not find a DOM element associated with the instruction ASEID \"${declaration.owner.parent.aseid}\". Ensure that the parent instruction is properly rendered and associated with a DOM element before applying attribute mutations.`\n });\n }\n\n const existingNode = context.getElementByInstruction(declaration);\n\n if (existingNode) {\n existingNode.textContent = value;\n } else {\n const commentNode = context.container.createComment(value);\n element.appendChild(commentNode);\n\n context.setInstructionElement(declaration, commentNode);\n }\n }\n\n\n\n logger?.debug('green', `Comment ${node?.aseid.toString()} added to Context:`);\n }\n\n\n @A_Frame.Define({\n description: 'Remove a comment node from the DOM based on the provided declaration instruction.'\n })\n @AreInterpreter.Revert(AreHTMLInstructions.AddComment)\n removeComment(\n @A_Inject(A_Caller) declaration: AddCommentInstruction,\n @A_Inject(AreHTMLEngineContext) context: AreHTMLEngineContext,\n ) {\n const element = context.getElementByInstruction(declaration);\n\n if (!element) return;\n\n element.parentNode?.removeChild(element);\n context.removeInstructionElement(declaration);\n }\n\n // ─────────────────────────────────────────────────────────────────────────────\n // ── AddStyle — Apply / Update / Revert ───────────────────────────────────────\n // ─────────────────────────────────────────────────────────────────────────────\n\n @A_Frame.Define({\n description: 'Inject a <style> element into the document <head> carrying the component CSS. Keyed by instruction ASEID so multiple components with styles do not collide. Subsequent Update calls refresh the textContent in-place.'\n })\n @AreInterpreter.Apply(AreHTMLInstructions.AddStyle)\n @AreInterpreter.Update(AreHTMLInstructions.AddStyle)\n addStyle(\n @A_Inject(A_Caller) mutation: AddStyleInstruction,\n @A_Inject(AreHTMLEngineContext) context: AreHTMLEngineContext,\n @A_Inject(A_Logger) logger?: A_Logger,\n ): void {\n try {\n\n\n const { styles } = mutation.payload;\n const styleId = `are-style-${String(mutation.aseid)}`;\n\n const existing = context.getElementByInstruction(mutation) as HTMLStyleElement | undefined;\n if (existing) {\n existing.textContent = styles;\n } else {\n const styleEl = context.container.createElement('style') as HTMLStyleElement;\n styleEl.setAttribute('data-are-id', styleId);\n styleEl.textContent = styles;\n (context.container.head ?? context.container.body).appendChild(styleEl);\n\n context.setInstructionElement(mutation, styleEl);\n logger?.debug('green', `Style injected for ${String(mutation.aseid)}`);\n }\n } catch (error) {\n logger?.error(error);\n }\n\n }\n\n @A_Frame.Define({\n description: 'Remove the <style> element that was injected by addStyle, cleaning up the document head.'\n })\n @AreInterpreter.Revert(AreHTMLInstructions.AddStyle)\n removeStyle(\n @A_Inject(A_Caller) mutation: AddStyleInstruction,\n @A_Inject(AreHTMLEngineContext) context: AreHTMLEngineContext,\n ): void {\n const styleEl = context.getElementByInstruction(mutation);\n if (styleEl?.parentNode) {\n styleEl.parentNode.removeChild(styleEl);\n }\n context.removeInstructionElement(mutation);\n }\n\n // ─────────────────────────────────────────────────────────────────────────────\n // ── SVG helpers ───────────────────────────────────────────────────────────────\n // ─────────────────────────────────────────────────────────────────────────────\n\n /**\n * Returns true when any ancestor of the given node has the tag `svg`,\n * meaning the node lives inside an SVG subtree and its DOM element must be\n * created via createElementNS(SVG_NAMESPACE, tag).\n */\n private isInSVGContext(node: AreHTMLNode): boolean {\n let current: AreHTMLNode | undefined = node.parent as AreHTMLNode | undefined;\n while (current) {\n if (current.tag === 'svg') return true;\n // <foreignObject> resets the namespace back to HTML\n if (current.tag === 'foreignobject') return false;\n current = current.parent as AreHTMLNode | undefined;\n }\n return false;\n }\n}","import { A_Caller, A_Feature, A_Inject } from \"@adaas/a-concept\";\nimport { A_Logger } from \"@adaas/a-utils/a-logger\";\nimport { AreNodeFeatures, AreNode, AreTokenizer, AreAttribute_Init, AreContext } from \"@adaas/are\";\nimport { AreComponentNode } from \"@adaas/are-html/nodes/AreComponent\";\nimport { AreRootNode } from \"@adaas/are-html/nodes/AreRoot\";\nimport { AreDirectiveAttribute } from \"@adaas/are-html/attributes/AreDirective.attribute\";\nimport { AreEventAttribute } from \"@adaas/are-html/attributes/AreEvent.attribute\";\nimport { AreBindingAttribute } from \"@adaas/are-html/attributes/AreBinding.attribute\";\nimport { AreStaticAttribute } from \"@adaas/are-html/attributes/AreStatic.attribute\";\nimport { AreHTMLAttribute } from \"../lib/AreHTMLAttribute/AreHTML.attribute\";\nimport { A_Frame } from \"@adaas/a-frame/core\";\n\n\n@A_Frame.Define({\n namespace: 'a-are-html',\n description: 'HTML-specific tokenizer extending AreTokenizer. Parses raw HTML template strings into AreHTMLNode trees by scanning element tags and resolving directive ($), event (@), binding (:), and static attributes to their typed attribute classes, constructing AreComponentNode and AreRootNode instances where required.'\n})\nexport class AreHTMLTokenizer extends AreTokenizer {\n\n ATTR_PATTERN = /([$:@]?[\\w.-]+(?::[\\w.-]+)?)(?:\\s*=\\s*(?:\"([^\"]*)\"|'([^']*)'|([^\\s>/\"'=]+)))?/g\n\n\n @A_Feature.Extend({\n name: AreNodeFeatures.onTokenize,\n scope: [AreComponentNode, AreRootNode]\n })\n tokenize(\n @A_Inject(A_Caller) node: AreNode,\n @A_Inject(AreContext) context: AreContext,\n @A_Inject(A_Logger) logger?: A_Logger\n ): void {\n\n super.tokenize(node, context, logger);\n\n context.startPerformance('attributeExtraction');\n\n const attributes = this.extractAttributes(node.markup);\n\n for (const attr of attributes) {\n node.scope.register(attr);\n }\n\n context.endPerformance('attributeExtraction');\n }\n\n\n\n extractAttributes(markup: string): AreHTMLAttribute[] {\n // Strip the tag name, then remove the closing > that is NOT inside quotes\n const withoutTag = markup.replace(/^<[a-zA-Z][a-zA-Z0-9-]*\\s*/, '')\n\n // Walk the string to find the closing > that isn't inside a quoted value\n let inSingle = false\n let inDouble = false\n let endIdx = withoutTag.length\n\n for (let i = 0; i < withoutTag.length; i++) {\n const ch = withoutTag[i]\n if (ch === '\"' && !inSingle) inDouble = !inDouble\n else if (ch === \"'\" && !inDouble) inSingle = !inSingle\n else if (ch === '>' && !inSingle && !inDouble) {\n endIdx = i\n break\n }\n }\n\n const attrString = withoutTag.slice(0, endIdx).replace(/\\s*\\/?\\s*$/, '').trim()\n\n const results: AreHTMLAttribute[] = []\n\n for (const match of attrString.matchAll(this.ATTR_PATTERN)) {\n const raw = match[0]\n const full = match[1] // e.g. ':class', '@click', '$for', 'id'\n\n // skip zero-length or name-less regex matches\n if (!full) continue\n\n const value = match[2] ?? match[3] ?? match[4] ?? 'true'\n\n const prefix = full[0]\n const isSpecial = prefix === ':' || prefix === '@' || prefix === '$'\n const name = isSpecial ? full.slice(1) : full\n\n const meta: AreAttribute_Init = { name, content: value, raw, prefix: isSpecial ? prefix : '' }\n\n if (prefix === ':') results.push(new AreBindingAttribute(meta))\n else if (prefix === '@') results.push(new AreEventAttribute(meta))\n else if (prefix === '$') results.push(new AreDirectiveAttribute(meta))\n else results.push(new AreStaticAttribute(meta))\n }\n\n return results\n }\n\n}","import { A_Caller, A_Feature, A_FormatterHelper, A_Inject, A_Scope } from \"@adaas/a-concept\";\nimport { AreLifecycle, AreScene, AreAttributeFeatures, AreSignalsContext, AreNodeFeatures, AreFeatures } from \"@adaas/are\";\nimport { A_Logger } from \"@adaas/a-utils/a-logger\";\nimport { AreComponentNode } from \"@adaas/are-html/nodes/AreComponent\";\nimport { AreRootNode } from \"@adaas/are-html/nodes/AreRoot\";\nimport { AreInterpolation } from \"@adaas/are-html/nodes/AreInterpolation\";\nimport { AreText } from \"@adaas/are-html/nodes/AreText\";\nimport { AreDirectiveAttribute } from \"@adaas/are-html/attributes/AreDirective.attribute\";\nimport { AreDirectiveFeatures } from \"@adaas/are-html/directive/AreDirective.constants\";\nimport { AreHTMLEngineContext } from \"./AreHTML.context\";\nimport { AreHTMLNode } from \"../lib/AreHTMLNode/AreHTMLNode\";\nimport { A_Frame } from \"@adaas/a-frame/core\";\n\n\n@A_Frame.Define({\n namespace: 'a-are-html',\n description: 'HTML-specific lifecycle handler extending AreLifecycle. Wires DOM-aware init hooks for component nodes, root nodes, interpolations, text nodes, and directive attributes to the ARE rendering pipeline, connecting each entity to its HTML engine context and priming the scene for subsequent compilation and interpretation.'\n})\nexport class AreHTMLLifecycle extends AreLifecycle {\n\n @AreLifecycle.Init(AreComponentNode)\n initComponent(\n @A_Inject(A_Caller) node: AreHTMLNode,\n @A_Inject(A_Scope) scope: A_Scope,\n @A_Inject(AreHTMLEngineContext) context: AreHTMLEngineContext,\n @A_Inject(AreSignalsContext) signalsContext?: AreSignalsContext,\n @A_Inject(A_Logger) logger?: A_Logger,\n ...args: any[]\n ): void {\n\n if (node.component)\n signalsContext?.subscribe(node);\n\n super.init(node, scope, context, logger, ...args);\n }\n\n\n @AreLifecycle.Init(AreRootNode)\n initRoot(\n @A_Inject(A_Caller) node: AreHTMLNode,\n @A_Inject(A_Scope) scope: A_Scope,\n @A_Inject(AreHTMLEngineContext) context: AreHTMLEngineContext,\n @A_Inject(AreSignalsContext) signalsContext?: AreSignalsContext,\n @A_Inject(A_Logger) logger?: A_Logger,\n ...args: any[]\n ): void {\n signalsContext?.subscribe(node);\n super.init(node, scope, context, logger, ...args);\n }\n\n\n @AreLifecycle.Init(AreText)\n initText(\n @A_Inject(A_Caller) node: AreHTMLNode,\n @A_Inject(A_Scope) scope: A_Scope,\n @A_Inject(AreHTMLEngineContext) context: AreHTMLEngineContext,\n @A_Inject(A_Logger) logger?: A_Logger,\n ...args: any[]\n ): void {\n const scene = new AreScene(node.aseid);\n\n scope.register(scene);\n }\n\n\n @AreLifecycle.Init(AreInterpolation)\n initInterpolation(\n @A_Inject(A_Caller) node: AreHTMLNode,\n @A_Inject(A_Scope) scope: A_Scope,\n @A_Inject(AreHTMLEngineContext) context: AreHTMLEngineContext,\n @A_Inject(A_Logger) logger?: A_Logger,\n ...args: any[]\n ): void {\n const scene = new AreScene(node.aseid);\n\n scope.register(scene);\n }\n\n @A_Feature.Extend({\n name: AreNodeFeatures.onMount,\n scope: [AreHTMLNode]\n })\n mount(\n /**\n * Node to be mounted\n */\n @A_Inject(A_Caller) node: AreHTMLNode,\n /**\n * Node Content\n */\n @A_Inject(AreScene) scene: AreScene,\n\n @A_Inject(A_Logger) logger?: A_Logger,\n ...args: any[]\n ) {\n\n logger?.debug(`[Mount] Component Trigger for <${node.aseid.entity}> with aseid :{${node.aseid.toString()}}`);\n\n /**\n * Skip mounting nodes whose scene has been deactivated (e.g. $if template nodes\n * when the condition is false). Mirrors the guard in AreLifecycle.mount.\n */\n if (scene.isInactive) return;\n\n /**\n * 1. We should simply run and render node itself.\n */\n node.interpret();\n /**\n * 2. Then go through all children of the node and mount the.\n */\n for (let i = 0; i < node.children.length; i++) {\n const child = node.children[i];\n child.mount();\n }\n }\n\n @A_Feature.Extend({\n name: AreAttributeFeatures.Update,\n scope: [AreDirectiveAttribute],\n })\n updateDirectiveAttribute(\n @A_Inject(A_Caller) directive: AreDirectiveAttribute,\n @A_Inject(A_Scope) scope: A_Scope,\n @A_Inject(A_Feature) feature: A_Feature,\n @A_Inject(A_Logger) logger?: A_Logger,\n ...args: any[]\n ) {\n /**\n * 3. If the attribute is a directive, then we should find a component that is responsible for\n * the directive compiling logic, and call it. \n * In case component is not found we just want to log a warning, \n * since the directive may be handled by some parent component or simply is a mistake in the template.\n */\n if (directive.component) {\n feature.chain(directive.component, AreDirectiveFeatures.Update, directive.owner.scope);\n } else {\n logger?.warning(`Directive handler component not found for directive: ${directive.name}. Make sure to create a component named \"AreDirective${A_FormatterHelper.toPascalCase(directive.name)}\" to handle this directive.`);\n }\n }\n\n}","import { A_Caller, A_Feature, A_FormatterHelper, A_Inject, A_Scope } from \"@adaas/a-concept\";\nimport { A_Logger } from \"@adaas/a-utils/a-logger\";\nimport { AreAttributeFeatures, AreTransformer, AreStore } from \"@adaas/are\";\nimport { AreDirectiveAttribute } from \"@adaas/are-html/attributes/AreDirective.attribute\";\nimport { AreDirectiveFeatures } from \"@adaas/are-html/directive/AreDirective.constants\";\nimport { A_Frame } from \"@adaas/a-frame/core\";\n\n\n@A_Frame.Define({\n namespace: 'a-are-html',\n description: 'HTML-specific transformer extending AreTransformer. Handles directive-attribute structural rewrites before compilation — sorting directives by declared priority and expanding compound directive expressions — so the compiler receives a clean, ordered AreHTMLNode tree ready for instruction emission.'\n})\nexport class AreHTMLTransformer extends AreTransformer {\n\n @A_Feature.Extend({\n name: AreAttributeFeatures.Transform,\n scope: [AreDirectiveAttribute],\n })\n transformDirectiveAttribute(\n @A_Inject(A_Caller) directive: AreDirectiveAttribute,\n @A_Inject(AreStore) store: AreStore,\n @A_Inject(A_Feature) feature: A_Feature,\n @A_Inject(A_Logger) logger?: A_Logger,\n ...args: any[]\n ) {\n store.watch(directive);\n\n /**\n * 3. If the attribute is a directive, then we should find a component that is responsible for\n * the directive compiling logic, and call it. \n * In case component is not found we just want to log a warning, \n * since the directive may be handled by some parent component or simply is a mistake in the template.\n */\n if (directive.component) {\n feature.chain(directive.component, AreDirectiveFeatures.Transform, directive.owner.scope);\n } else {\n logger?.warning(`Directive handler component not found for directive: ${directive.name}. Make sure to create a component named \"AreDirective${A_FormatterHelper.toPascalCase(directive.name)}\" to handle this directive.`);\n }\n\n store.unwatch(directive);\n }\n}","import { A_Feature, A_Inject, A_Scope } from \"@adaas/a-concept\";\nimport { A_Frame } from \"@adaas/a-frame/core\"\nimport { A_ServiceFeatures } from \"@adaas/a-utils/a-service\";\nimport { AreEngine, AreSyntaxTokenMatch, AreSyntax, AreSignalsContext } from \"@adaas/are\";\nimport { AreHTMLInterpreter } from \"@adaas/are-html/interpreter\";\nimport { AreHTMLEngineContext } from \"./AreHTML.context\";\nimport { AreInterpolation } from \"@adaas/are-html/nodes/AreInterpolation\";\nimport { AreText } from \"@adaas/are-html/nodes/AreText\";\nimport { AreComment } from \"@adaas/are-html/nodes/AreComment\";\nimport { AreComponentNode } from \"@adaas/are-html/nodes/AreComponent\";\nimport { AreHTMLTokenizer } from \"@adaas/are-html/tokenizer\";\nimport { AreRootNode } from \"@adaas/are-html/nodes/AreRoot\";\nimport { AreHTMLLifecycle } from \"@adaas/are-html/lifecycle\";\nimport { AreHTMLTransformer } from \"@adaas/are-html/transformer\";\nimport { AreHTMLCompiler } from \"./AreHTML.compiler\";\nimport { isVoidElement } from \"./AreHTML.constants\";\n\n\n\n@A_Frame.Define({\n namespace: 'a-are-html',\n description: 'Concrete HTML rendering engine that assembles the full ARE pipeline for web environments. Bootstraps and wires AreHTMLTokenizer, AreHTMLTransformer, AreHTMLCompiler, AreHTMLInterpreter, and AreHTMLLifecycle; mounts root nodes from inline or fetched templates; and drives reactive re-renders via the AreSignals bus.'\n})\nexport class AreHTMLEngine extends AreEngine {\n\n\n\n get DefaultSyntax() {\n return new AreSyntax({\n trimWhitespace: true,\n strictMode: true,\n rules: [\n // HTML comments\n {\n opening: '<!--',\n closing: '-->',\n component: AreComment,\n priority: 10,\n nested: false,\n extract: (raw) => ({ content: raw.slice(4, -3).trim() }),\n },\n // interpolations\n {\n opening: '{{',\n closing: '}}',\n component: AreInterpolation,\n priority: 9,\n nested: false,\n extract: (_, match) => ({ key: match.content }),\n },\n // are-root — matched before generic elements, produces AreRootNode\n {\n matcher: this.rootElementMatcher.bind(this),\n component: AreRootNode,\n priority: 5,\n },\n // generic HTML elements\n {\n matcher: this.htmlElementMatcher.bind(this),\n component: AreComponentNode,\n priority: 4,\n },\n // plain text fallback\n {\n component: AreText,\n priority: 0,\n },\n ],\n })\n }\n\n\n /**\n * Inject AreHTMLSyntax into the container scope before loading\n * \n * @param container \n */\n @A_Feature.Extend({\n name: A_ServiceFeatures.onBeforeLoad,\n before: /.*/\n })\n async init(\n @A_Inject(A_Scope) scope: A_Scope,\n @A_Inject(AreSignalsContext) signalContext?: AreSignalsContext\n ) {\n this.package(scope, {\n context: new AreHTMLEngineContext({}),\n syntax: this.DefaultSyntax,\n compiler: AreHTMLCompiler,\n interpreter: AreHTMLInterpreter,\n tokenizer: AreHTMLTokenizer,\n lifecycle: AreHTMLLifecycle,\n transformer: AreHTMLTransformer,\n });\n\n if(!signalContext) {\n signalContext = new AreSignalsContext();\n scope.register(signalContext);\n }\n }\n\n\n protected rootElementMatcher(\n source: string,\n from: number,\n to: number,\n build: (raw: string, content: string, position: number, closing: string) => AreSyntaxTokenMatch\n ): AreSyntaxTokenMatch | null {\n\n // const rootTag = this.config.rootTag\n const rootTag = 'are-root';\n\n const tagStart = source.indexOf('<', from)\n if (tagStart === -1 || tagStart >= to) return null\n\n // only match if the tag name is exactly the configured root tag\n const tagNameMatch = source.slice(tagStart).match(/^<([a-zA-Z][a-zA-Z0-9-]*)/)\n if (!tagNameMatch || tagNameMatch[1].toLowerCase() !== rootTag) return null\n\n // delegate the actual matching to the shared HTML element logic\n return this.htmlElementMatcher(source, from, to, build)\n }\n\n protected htmlElementMatcher(\n source: string,\n from: number,\n to: number,\n build: (raw: string, content: string, position: number, closing: string) => AreSyntaxTokenMatch\n ): AreSyntaxTokenMatch | null {\n let index = from\n\n while (index < to) {\n const tagStart = source.indexOf('<', index)\n if (tagStart === -1 || tagStart >= to) return null\n\n // skip comments, closing tags, doctype, processing instructions\n if (source.startsWith('<!--', tagStart)) { index = tagStart + 1; continue }\n if (source[tagStart + 1] === '/') { index = tagStart + 1; continue }\n if (source[tagStart + 1] === '!' || source[tagStart + 1] === '?') { index = tagStart + 1; continue }\n\n const tagNameMatch = source.slice(tagStart).match(/^<([a-zA-Z][a-zA-Z0-9-]*)/)\n if (!tagNameMatch) { index = tagStart + 1; continue }\n\n const tagName = tagNameMatch[1]\n const openingTagEnd = AreHTMLEngine.findTagClose(source, tagStart)\n if (openingTagEnd === -1) return null\n\n // extract id attribute if present in the opening tag\n const openingTagStr = source.slice(tagStart, openingTagEnd + 1)\n const idMatch = openingTagStr.match(/\\bid=[\"']([^\"']*)[\"']/)\n const id = idMatch ? idMatch[1] : undefined\n\n // self-closing: <br/> or <input/>\n if (source[openingTagEnd - 1] === '/') {\n const raw = source.slice(tagStart, openingTagEnd + 1)\n const content = source.slice(tagStart + tagNameMatch[0].length, openingTagEnd - 1)\n const match = build(raw, content, tagStart, '/>')\n match.payload = { entity: tagName, selfClose: true, id }\n return match\n }\n\n // HTML5 void elements: <input>, <br>, <img>, etc. — treat as self-closing\n if (isVoidElement(tagName)) {\n const raw = source.slice(tagStart, openingTagEnd + 1)\n const content = source.slice(tagStart + tagNameMatch[0].length, openingTagEnd)\n const match = build(raw, content, tagStart, '>')\n match.payload = { entity: tagName, selfClose: true, id }\n return match\n }\n\n // find matching closing tag respecting nesting\n const closingTag = `</${tagName}>`\n let level = 0\n let searchIndex = openingTagEnd + 1\n let closingStart = -1\n\n while (searchIndex < to) {\n const nextOpen = source.indexOf(`<${tagName}`, searchIndex)\n const nextClose = source.indexOf(closingTag, searchIndex)\n if (nextClose === -1) break\n\n if (nextOpen !== -1 && nextOpen < nextClose) {\n const charAfter = source[nextOpen + tagName.length + 1]\n if (charAfter === ' ' || charAfter === '>' || charAfter === '/') {\n // Skip self-closing nested occurrences, e.g. <div/> inside <div>...</div>.\n const innerEnd = AreHTMLEngine.findTagClose(source, nextOpen)\n const isSelfClose = innerEnd !== -1 && source[innerEnd - 1] === '/'\n\n if (!isSelfClose) {\n level++\n }\n searchIndex = (innerEnd === -1 ? nextOpen + tagName.length + 1 : innerEnd + 1)\n continue\n }\n }\n\n if (level === 0) { closingStart = nextClose; break }\n level--\n searchIndex = nextClose + closingTag.length\n }\n\n if (closingStart === -1) return null\n\n const fullTag = source.slice(tagStart, closingStart + closingTag.length)\n const content = source.slice(openingTagEnd + 1, closingStart)\n const match = build(fullTag, content, tagStart, closingTag)\n match.payload = { entity: tagName, selfClose: false, id }\n return match\n }\n return null\n }\n\n /**\n * Find the index of the closing `>` of an opening tag, skipping over\n * `>` characters that appear inside quoted attribute values.\n */\n private static findTagClose(source: string, from: number): number {\n let inSingle = false\n let inDouble = false\n\n for (let i = from; i < source.length; i++) {\n const ch = source[i]\n if (ch === '\"' && !inSingle) inDouble = !inDouble\n else if (ch === \"'\" && !inDouble) inSingle = !inSingle\n else if (ch === '>' && !inSingle && !inDouble) return i\n }\n\n return -1\n }\n\n}","import { A_Caller, A_Context, A_FormatterHelper, A_Inject, } from \"@adaas/a-concept\";\nimport { A_Frame } from \"@adaas/a-frame/core\";\nimport { A_Logger } from \"@adaas/a-utils/a-logger\";\nimport { A_SignalVector } from \"@adaas/a-utils/a-signal\";\nimport { Are, ArePropDefinition, AreStore, AreNode, AreSignals, AreSignalsMeta, AreSignalsContext } from \"@adaas/are\";\nimport { AreRoute } from \"@adaas/are-html/signals/AreRoute.signal\";\n\n\n@A_Frame.Define({\n namespace: 'a-are-html',\n description: 'The AreRoot component serves as the foundational entry point for the A-Concept Rendering Engine (ARE). It is responsible for initializing the rendering process, managing the root node of the component tree, and handling signal-based rendering logic. The AreRoot component processes incoming signals to determine which child components to render, allowing for dynamic and responsive UI updates based on application state and user interactions.'\n})\nexport class AreRoot extends Are {\n\n props: Record<string, ArePropDefinition> = {\n default: {\n type: 'string',\n default: '',\n }\n }\n\n\n @Are.Template\n async template(\n @A_Inject(A_Caller) root: AreNode,\n @A_Inject(A_Logger) logger: A_Logger,\n @A_Inject(AreSignalsContext) signalsContext?: AreSignalsContext,\n ) {\n\n const rootId = root.id;\n\n // No routing config for this root — but still honour body content or\n // a 'default' attribute if one is present on the markup.\n if (signalsContext && !signalsContext.hasRoot(rootId)) {\n if (!root.content?.trim()) {\n // Fallback: legacy default= attribute\n const defaultMatch = root.markup?.match(/\\bdefault=[\"']([^\"']*)[\"']/);\n const defaultComponent = defaultMatch?.[1];\n if (defaultComponent) {\n root.setContent(`<${defaultComponent}></${defaultComponent}>`);\n }\n }\n // Body content (or none) — tokenizer picks it up without intervention\n return;\n }\n\n const currentRoute = AreRoute.default();\n\n let componentName: string | undefined;\n\n if (currentRoute) {\n const initialVector = new A_SignalVector([currentRoute]);\n\n // 1. Lookup via AreSignalsContext (per root-id conditions)\n let renderTarget = signalsContext?.findComponentByVector(rootId, initialVector);\n\n // 2. Fall back to global AreSignalsMeta, pool-filtered\n if (!renderTarget) {\n const signalsMeta = A_Context.meta<AreSignalsMeta>(AreSignals);\n const metaTarget = signalsMeta?.findComponentByVector(initialVector);\n if (metaTarget) {\n const pool = signalsContext?.getComponentById(rootId);\n if (!pool?.length || pool.includes(metaTarget)) {\n renderTarget = metaTarget;\n }\n }\n }\n\n if (renderTarget?.name) {\n componentName = A_FormatterHelper.toKebabCase(renderTarget.name);\n }\n }\n\n // 3. Fall back to body content (the nodes already placed inside the\n // <are-root> tag act as the default). No setContent() call needed —\n // the tokenizer will process root.content as-is.\n if (!componentName) {\n if (root.content?.trim()) {\n return;\n }\n }\n // 3.5. Fall back to AreSignalsContext default component for this root.\n if (!componentName) {\n const defaultComp = signalsContext?.getDefault(rootId);\n if (defaultComp?.name) {\n componentName = A_FormatterHelper.toKebabCase(defaultComp.name);\n }\n }\n // 4. Last resort: legacy default= attribute on the markup.\n if (!componentName) {\n const defaultMatch = root.markup?.match(/\\bdefault=[\"']([^\"']*)[\"']/);\n componentName = defaultMatch?.[1];\n }\n\n if (!componentName) {\n logger.warning('AreRoot: No component found for initial render. Provide body content, a route condition, or a \"default\" attribute.');\n return;\n }\n\n root.setContent(`<${componentName}></${componentName}>`);\n }\n\n\n @Are.Signal\n async onSignal(\n @A_Inject(A_Caller) root: AreNode,\n @A_Inject(A_SignalVector) vector: A_SignalVector,\n @A_Inject(AreStore) store: AreStore<{ default: string }>,\n @A_Inject(A_Logger) logger: A_Logger,\n @A_Inject(AreSignalsContext) signalsContext?: AreSignalsContext,\n ) {\n const rootId = root.id;\n\n // No routing config for this root — signals do not affect its content\n if (signalsContext && !signalsContext.hasRoot(rootId)) {\n return;\n }\n\n // 1. Try root-specific lookup via AreSignalsContext (keyed by the are-root's id attribute)\n let renderTarget = signalsContext?.findComponentByVector(rootId, vector);\n\n // 2. Fall back to global AreSignalsMeta lookup, but only accept the\n // result if it belongs to this outlet's pool (when a pool is defined).\n // This prevents a meta-registered component for one outlet from being\n // accidentally rendered in a different outlet sharing the same signal.\n if (!renderTarget) {\n const signalsMeta = A_Context.meta<AreSignalsMeta>(AreSignals);\n const metaTarget = signalsMeta?.findComponentByVector(vector);\n if (metaTarget) {\n const pool = signalsContext?.getComponentById(rootId);\n if (!pool?.length || pool.includes(metaTarget)) {\n renderTarget = metaTarget;\n }\n }\n }\n\n const componentName = renderTarget?.name\n ? A_FormatterHelper.toKebabCase(renderTarget.name)\n : store.get('default');\n\n // No matching condition for this signal vector (e.g. AreInit before any route).\n // Keep the current outlet content and do nothing.\n if (!componentName) {\n return;\n }\n\n // Guard: if the outlet already shows the same component, do nothing.\n // Prevents infinite remount loops when a non-routing signal carries a\n // stale routing signal in the accumulated A_SignalState vector.\n // node.type is the kebab-case tag name — the most direct and reliable\n // identifier (no constructor-name resolution, no proxy wrapping issues).\n const currentChild = root.children[0] as AreNode | undefined;\n if (currentChild?.type === componentName) {\n return;\n }\n\n root.setContent(`<${componentName}></${componentName}>`);\n\n // Unsubscribe old children BEFORE destroying them.\n // Without this, AreSignals.handleSignalVector keeps iterating stale\n // (scope-less) nodes on every subsequent signal and throws an error.\n for (let i = 0; i < root.children.length; i++) {\n const child = root.children[i];\n signalsContext?.unsubscribe(child);\n child.unmount();\n child.destroy();\n root.removeChild(child);\n }\n\n\n root.tokenize();\n\n for (let i = 0; i < root.children.length; i++) {\n const child = root.children[i];\n child.init();\n\n const res = child.load();\n if (res instanceof Promise) {\n await res;\n }\n child.transform();\n\n child.compile();\n child.mount();\n }\n }\n}\n","import { A_Component } from \"@adaas/a-concept\";\nimport { A_Frame } from \"@adaas/a-frame/core\";\n\n@A_Frame.Define({\n namespace: 'a-are-html',\n description: 'AreRouteWatcher is a component that observes browser navigation events (history pushState, replaceState, and popstate) and notifies registered handlers when the URL changes, enabling client-side routing and reactive route-based rendering within the ARE framework.'\n})\nexport class AreRouteWatcher extends A_Component {\n\n private readonly handlers: Set<(url: URL) => void> = new Set();\n private current: URL = new URL(window.location.href);\n\n constructor() {\n super();\n this.patchHistory();\n this.attachListeners();\n }\n\n // ── Public ────────────────────────────────────────────────────────────────\n\n onChange(handler: (url: URL) => void): () => void {\n this.handlers.add(handler);\n return () => this.handlers.delete(handler); // returns unsubscribe fn\n }\n\n get url(): URL {\n return this.current;\n }\n\n destroy(): void {\n window.removeEventListener('popstate', this.onPopState);\n window.removeEventListener('hashchange', this.onHashChange);\n window.removeEventListener('urlchange', this.onURLChange);\n this.handlers.clear();\n }\n\n // ── Listeners ─────────────────────────────────────────────────────────────\n\n private onPopState = (): void => {\n this.notify();\n }\n\n private onHashChange = (): void => {\n this.notify();\n }\n\n private onURLChange = (): void => {\n this.notify();\n }\n\n private attachListeners(): void {\n window.addEventListener('popstate', this.onPopState);\n window.addEventListener('hashchange', this.onHashChange);\n window.addEventListener('urlchange', this.onURLChange); // custom event from patch\n }\n\n // ── Patch pushState / replaceState ────────────────────────────────────────\n\n private patchHistory(): void {\n const patch = (original: typeof history.pushState) =>\n function (this: History, ...args: Parameters<typeof history.pushState>) {\n original.apply(this, args);\n window.dispatchEvent(new Event('urlchange'));\n };\n\n history.pushState = patch(history.pushState);\n history.replaceState = patch(history.replaceState);\n }\n\n // ── Notify ────────────────────────────────────────────────────────────────\n\n private notify(): void {\n const next = new URL(window.location.href);\n\n if (next.href === this.current.href) return; // no actual change\n\n this.current = next;\n\n for (const handler of this.handlers) {\n handler(this.current);\n }\n }\n}"]}
|