@adaas/are-html 0.0.21 → 0.0.23

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.
Files changed (154) hide show
  1. package/.conf/tsconfig.base.json +1 -0
  2. package/.conf/tsconfig.browser.json +1 -0
  3. package/.conf/tsconfig.node.json +1 -0
  4. package/dist/browser/index.d.mts +214 -3
  5. package/dist/browser/index.mjs +787 -201
  6. package/dist/browser/index.mjs.map +1 -1
  7. package/dist/node/{AreBinding.attribute-doUvtOjc.d.mts → AreBinding.attribute-BWzEIw6H.d.mts} +45 -0
  8. package/dist/node/{AreBinding.attribute-Bm5LlOyE.d.ts → AreBinding.attribute-GpT-5Qmf.d.ts} +45 -0
  9. package/dist/node/attributes/AreBinding.attribute.d.mts +1 -1
  10. package/dist/node/attributes/AreBinding.attribute.d.ts +1 -1
  11. package/dist/node/attributes/AreDirective.attribute.d.mts +1 -1
  12. package/dist/node/attributes/AreDirective.attribute.d.ts +1 -1
  13. package/dist/node/attributes/AreEvent.attribute.d.mts +1 -1
  14. package/dist/node/attributes/AreEvent.attribute.d.ts +1 -1
  15. package/dist/node/attributes/AreStatic.attribute.d.mts +1 -1
  16. package/dist/node/attributes/AreStatic.attribute.d.ts +1 -1
  17. package/dist/node/directives/AreDirectiveFor.directive.d.mts +55 -2
  18. package/dist/node/directives/AreDirectiveFor.directive.d.ts +55 -2
  19. package/dist/node/directives/AreDirectiveFor.directive.js +141 -12
  20. package/dist/node/directives/AreDirectiveFor.directive.js.map +1 -1
  21. package/dist/node/directives/AreDirectiveFor.directive.mjs +141 -12
  22. package/dist/node/directives/AreDirectiveFor.directive.mjs.map +1 -1
  23. package/dist/node/directives/AreDirectiveIf.directive.d.mts +1 -1
  24. package/dist/node/directives/AreDirectiveIf.directive.d.ts +1 -1
  25. package/dist/node/directives/AreDirectiveShow.directive.d.mts +1 -1
  26. package/dist/node/directives/AreDirectiveShow.directive.d.ts +1 -1
  27. package/dist/node/engine/AreHTML.compiler.d.mts +1 -1
  28. package/dist/node/engine/AreHTML.compiler.d.ts +1 -1
  29. package/dist/node/engine/AreHTML.compiler.js +4 -0
  30. package/dist/node/engine/AreHTML.compiler.js.map +1 -1
  31. package/dist/node/engine/AreHTML.compiler.mjs +4 -0
  32. package/dist/node/engine/AreHTML.compiler.mjs.map +1 -1
  33. package/dist/node/engine/AreHTML.constants.d.mts +33 -1
  34. package/dist/node/engine/AreHTML.constants.d.ts +33 -1
  35. package/dist/node/engine/AreHTML.constants.js +166 -0
  36. package/dist/node/engine/AreHTML.constants.js.map +1 -1
  37. package/dist/node/engine/AreHTML.constants.mjs +165 -1
  38. package/dist/node/engine/AreHTML.constants.mjs.map +1 -1
  39. package/dist/node/engine/AreHTML.context.d.mts +66 -0
  40. package/dist/node/engine/AreHTML.context.d.ts +66 -0
  41. package/dist/node/engine/AreHTML.context.js +98 -0
  42. package/dist/node/engine/AreHTML.context.js.map +1 -1
  43. package/dist/node/engine/AreHTML.context.mjs +98 -0
  44. package/dist/node/engine/AreHTML.context.mjs.map +1 -1
  45. package/dist/node/engine/AreHTML.interpreter.d.mts +3 -0
  46. package/dist/node/engine/AreHTML.interpreter.d.ts +3 -0
  47. package/dist/node/engine/AreHTML.interpreter.js +66 -10
  48. package/dist/node/engine/AreHTML.interpreter.js.map +1 -1
  49. package/dist/node/engine/AreHTML.interpreter.mjs +66 -10
  50. package/dist/node/engine/AreHTML.interpreter.mjs.map +1 -1
  51. package/dist/node/engine/AreHTML.lifecycle.d.mts +2 -2
  52. package/dist/node/engine/AreHTML.lifecycle.d.ts +2 -2
  53. package/dist/node/engine/AreHTML.lifecycle.js +32 -4
  54. package/dist/node/engine/AreHTML.lifecycle.js.map +1 -1
  55. package/dist/node/engine/AreHTML.lifecycle.mjs +32 -4
  56. package/dist/node/engine/AreHTML.lifecycle.mjs.map +1 -1
  57. package/dist/node/engine/AreHTML.tokenizer.d.mts +1 -1
  58. package/dist/node/engine/AreHTML.tokenizer.d.ts +1 -1
  59. package/dist/node/engine/AreHTML.tokenizer.js +7 -1
  60. package/dist/node/engine/AreHTML.tokenizer.js.map +1 -1
  61. package/dist/node/engine/AreHTML.tokenizer.mjs +7 -1
  62. package/dist/node/engine/AreHTML.tokenizer.mjs.map +1 -1
  63. package/dist/node/engine/AreHTML.transformer.d.mts +1 -1
  64. package/dist/node/engine/AreHTML.transformer.d.ts +1 -1
  65. package/dist/node/helpers/AreScheduler.helper.d.mts +39 -0
  66. package/dist/node/helpers/AreScheduler.helper.d.ts +39 -0
  67. package/dist/node/helpers/AreScheduler.helper.js +40 -0
  68. package/dist/node/helpers/AreScheduler.helper.js.map +1 -0
  69. package/dist/node/helpers/AreScheduler.helper.mjs +40 -0
  70. package/dist/node/helpers/AreScheduler.helper.mjs.map +1 -0
  71. package/dist/node/index.d.mts +4 -3
  72. package/dist/node/index.d.ts +4 -3
  73. package/dist/node/index.js +7 -0
  74. package/dist/node/index.mjs +1 -0
  75. package/dist/node/instructions/AddStaticHTML.instruction.d.mts +8 -0
  76. package/dist/node/instructions/AddStaticHTML.instruction.d.ts +8 -0
  77. package/dist/node/instructions/AddStaticHTML.instruction.js +31 -0
  78. package/dist/node/instructions/AddStaticHTML.instruction.js.map +1 -0
  79. package/dist/node/instructions/AddStaticHTML.instruction.mjs +24 -0
  80. package/dist/node/instructions/AddStaticHTML.instruction.mjs.map +1 -0
  81. package/dist/node/instructions/AreHTML.instructions.constants.d.mts +1 -0
  82. package/dist/node/instructions/AreHTML.instructions.constants.d.ts +1 -0
  83. package/dist/node/instructions/AreHTML.instructions.constants.js +1 -0
  84. package/dist/node/instructions/AreHTML.instructions.constants.js.map +1 -1
  85. package/dist/node/instructions/AreHTML.instructions.constants.mjs +1 -0
  86. package/dist/node/instructions/AreHTML.instructions.constants.mjs.map +1 -1
  87. package/dist/node/instructions/AreHTML.instructions.types.d.mts +9 -1
  88. package/dist/node/instructions/AreHTML.instructions.types.d.ts +9 -1
  89. package/dist/node/lib/AreDirective/AreDirective.component.d.mts +1 -1
  90. package/dist/node/lib/AreDirective/AreDirective.component.d.ts +1 -1
  91. package/dist/node/lib/AreDirective/AreDirective.types.d.mts +1 -1
  92. package/dist/node/lib/AreDirective/AreDirective.types.d.ts +1 -1
  93. package/dist/node/lib/AreHTML/AreHTML.tokenizer.d.mts +1 -1
  94. package/dist/node/lib/AreHTML/AreHTML.tokenizer.d.ts +1 -1
  95. package/dist/node/lib/AreHTMLAttribute/AreHTML.attribute.d.mts +1 -1
  96. package/dist/node/lib/AreHTMLAttribute/AreHTML.attribute.d.ts +1 -1
  97. package/dist/node/lib/AreHTMLNode/AreHTMLNode.d.mts +1 -1
  98. package/dist/node/lib/AreHTMLNode/AreHTMLNode.d.ts +1 -1
  99. package/dist/node/lib/AreHTMLNode/AreHTMLNode.js +51 -0
  100. package/dist/node/lib/AreHTMLNode/AreHTMLNode.js.map +1 -1
  101. package/dist/node/lib/AreHTMLNode/AreHTMLNode.mjs +51 -0
  102. package/dist/node/lib/AreHTMLNode/AreHTMLNode.mjs.map +1 -1
  103. package/dist/node/lib/AreRoot/AreRoot.component.js +1 -1
  104. package/dist/node/lib/AreRoot/AreRoot.component.js.map +1 -1
  105. package/dist/node/lib/AreRoot/AreRoot.component.mjs +1 -1
  106. package/dist/node/lib/AreRoot/AreRoot.component.mjs.map +1 -1
  107. package/dist/node/nodes/AreComment.d.mts +1 -1
  108. package/dist/node/nodes/AreComment.d.ts +1 -1
  109. package/dist/node/nodes/AreComponent.d.mts +1 -1
  110. package/dist/node/nodes/AreComponent.d.ts +1 -1
  111. package/dist/node/nodes/AreInterpolation.d.mts +1 -1
  112. package/dist/node/nodes/AreInterpolation.d.ts +1 -1
  113. package/dist/node/nodes/AreRoot.d.mts +1 -1
  114. package/dist/node/nodes/AreRoot.d.ts +1 -1
  115. package/dist/node/nodes/AreText.d.mts +1 -1
  116. package/dist/node/nodes/AreText.d.ts +1 -1
  117. package/examples/dashboard/concept.ts +1 -1
  118. package/examples/dashboard/dist/index.html +1 -1
  119. package/examples/dashboard/dist/{mq19zxz4-mnlgmd.js → mqiw5sqa-ypckmj.js} +2275 -1323
  120. package/examples/dashboard/src/concept.ts +3 -2
  121. package/examples/for-perf/concept.ts +45 -0
  122. package/examples/for-perf/containers/UI.container.ts +161 -0
  123. package/examples/for-perf/dist/index.html +270 -0
  124. package/examples/for-perf/dist/mqj1mpf2-z4aokv.js +15664 -0
  125. package/examples/for-perf/dist/mqj1mpff-4fr7mw.js +15664 -0
  126. package/examples/for-perf/public/index.html +270 -0
  127. package/examples/for-perf/src/components/PerfApp.component.ts +37 -0
  128. package/examples/for-perf/src/components/PerfControls.component.ts +34 -0
  129. package/examples/for-perf/src/components/PerfGrid.component.ts +225 -0
  130. package/examples/for-perf/src/components/PerfHeader.component.ts +34 -0
  131. package/examples/for-perf/src/components/PerfStats.component.ts +43 -0
  132. package/examples/for-perf/src/concept.ts +94 -0
  133. package/examples/jumpstart/dist/index.html +1 -1
  134. package/examples/jumpstart/dist/{mq7hqrxy-4kus50.js → mq7mgf58-vbf07e.js} +269 -91
  135. package/examples/signal-routing/dist/index.html +1 -1
  136. package/examples/signal-routing/dist/{mq7k53th-qiwy4x.js → mqiwo23h-bhcolu.js} +2090 -1430
  137. package/jest.config.ts +1 -0
  138. package/package.json +10 -9
  139. package/src/directives/AreDirectiveFor.directive.ts +233 -19
  140. package/src/engine/AreHTML.compiler.ts +13 -0
  141. package/src/engine/AreHTML.constants.ts +142 -0
  142. package/src/engine/AreHTML.context.ts +112 -0
  143. package/src/engine/AreHTML.interpreter.ts +114 -13
  144. package/src/engine/AreHTML.lifecycle.ts +91 -7
  145. package/src/engine/AreHTML.tokenizer.ts +30 -1
  146. package/src/helpers/AreScheduler.helper.ts +61 -0
  147. package/src/index.ts +1 -0
  148. package/src/instructions/AddStaticHTML.instruction.ts +23 -0
  149. package/src/instructions/AreHTML.instructions.constants.ts +1 -0
  150. package/src/instructions/AreHTML.instructions.types.ts +9 -0
  151. package/src/lib/AreHTMLNode/AreHTMLNode.ts +74 -0
  152. package/src/lib/AreRoot/AreRoot.component.ts +4 -1
  153. package/tests/StaticIsland.test.ts +115 -0
  154. package/tsconfig.json +1 -0
@@ -1,7 +1,7 @@
1
1
  import { A_Feature } from '@adaas/a-concept';
2
2
  import { A_Logger } from '@adaas/a-utils/a-logger';
3
3
  import { AreCompiler, AreScene, AreStore, AreSyntax } from '@adaas/are';
4
- import { e as AreHTMLNode, f as AreStaticAttribute, b as AreDirectiveAttribute, c as AreEventAttribute, A as AreBindingAttribute } from '../AreBinding.attribute-doUvtOjc.mjs';
4
+ import { e as AreHTMLNode, f as AreStaticAttribute, b as AreDirectiveAttribute, c as AreEventAttribute, A as AreBindingAttribute } from '../AreBinding.attribute-BWzEIw6H.mjs';
5
5
  import { AreInterpolation } from '../nodes/AreInterpolation.mjs';
6
6
  import { AreText } from '../nodes/AreText.mjs';
7
7
  import '../lib/AreStyle/AreStyle.context.mjs';
@@ -1,7 +1,7 @@
1
1
  import { A_Feature } from '@adaas/a-concept';
2
2
  import { A_Logger } from '@adaas/a-utils/a-logger';
3
3
  import { AreCompiler, AreScene, AreStore, AreSyntax } from '@adaas/are';
4
- import { e as AreHTMLNode, f as AreStaticAttribute, b as AreDirectiveAttribute, c as AreEventAttribute, A as AreBindingAttribute } from '../AreBinding.attribute-Bm5LlOyE.js';
4
+ import { e as AreHTMLNode, f as AreStaticAttribute, b as AreDirectiveAttribute, c as AreEventAttribute, A as AreBindingAttribute } from '../AreBinding.attribute-GpT-5Qmf.js';
5
5
  import { AreInterpolation } from '../nodes/AreInterpolation.js';
6
6
  import { AreText } from '../nodes/AreText.js';
7
7
  import '../lib/AreStyle/AreStyle.context.js';
@@ -15,6 +15,7 @@ var AddAttribute_instruction = require('@adaas/are-html/instructions/AddAttribut
15
15
  var AddText_instruction = require('@adaas/are-html/instructions/AddText.instruction');
16
16
  var AddListener_instruction = require('@adaas/are-html/instructions/AddListener.instruction');
17
17
  var AddStyle_instruction = require('@adaas/are-html/instructions/AddStyle.instruction');
18
+ var AddStaticHTML_instruction = require('@adaas/are-html/instructions/AddStaticHTML.instruction');
18
19
  var node = require('@adaas/are-html/node');
19
20
 
20
21
  var __defProp = Object.defineProperty;
@@ -31,6 +32,9 @@ var __decorateParam = (index, decorator) => (target, key) => decorator(target, k
31
32
  exports.AreHTMLCompiler = class AreHTMLCompiler extends are.AreCompiler {
32
33
  compileHTMLNode(node, scene, logger, ...args) {
33
34
  super.compile(node, scene, logger, ...args);
35
+ if (node.isStaticIsland && scene.host) {
36
+ scene.plan(new AddStaticHTML_instruction.AddStaticHTMLInstruction(scene.host, { html: node.staticInnerHTML }));
37
+ }
34
38
  if (node.styles?.styles) {
35
39
  const host = scene.host;
36
40
  if (host) {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/engine/AreHTML.compiler.ts"],"names":["AreHTMLCompiler","AreCompiler","AddStyleInstruction","AddTextInstruction","AreCompilerError","AddAttributeInstruction","AreDirectiveFeatures","A_FormatterHelper","AddListenerInstruction","AreHTMLNode","A_Caller","AreScene","A_Logger","AreInterpolation","AreStore","AreText","AreStaticAttribute","AreDirectiveAttribute","A_Feature","AreEventAttribute","AreBindingAttribute","AreSyntax","A_Frame"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwBaA,uBAAA,GAAN,8BAA8BC,eAAA,CAAY;AAAA,EAS7C,eAAA,CACwB,IAAA,EACA,KAAA,EACA,MAAA,EAAA,GACjB,IAAA,EACC;AACJ,IAAA,KAAA,CAAM,OAAA,CAAQ,IAAA,EAAM,KAAA,EAAO,MAAA,EAAQ,GAAG,IAAI,CAAA;AAE1C,IAAA,IAAI,IAAA,CAAK,QAAQ,MAAA,EAAQ;AACrB,MAAA,MAAM,OAAO,KAAA,CAAM,IAAA;AACnB,MAAA,IAAI,IAAA,EAAM;AACN,QAAA,KAAA,CAAM,IAAA,CAAK,IAAIC,wCAAA,CAAoB,IAAA,EAAM,EAAE,QAAQ,IAAA,CAAK,MAAA,CAAO,MAAA,EAAQ,CAAC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CAAiB,CAAA;AAAA,EAEjC,qCAAST,iBAAQ,CAAA,CAAA;AAAA,EACjB,qCAASC,YAAQ,CAAA;AAAA,CAAA,EAxJbX,uBAAA,CAsJT,SAAA,EAAA,uBAAA,EAAA,CAAA,CAAA;AA2BA,eAAA,CAAA;AAAA,EADCC,eAAA,CAAY,QAAQmB,wCAAmB,CAAA;AAAA,EAEnC,qCAASV,iBAAQ,CAAA,CAAA;AAAA,EACjB,qCAASC,YAAQ,CAAA,CAAA;AAAA,EACjB,yCAAa,MAAA,EAAO,CAAA;AAAA,EACpB,qCAASG,YAAQ,CAAA,CAAA;AAAA,EACjB,qCAASA,YAAQ,CAAA,CAAA;AAAA,EACjB,qCAASO,aAAS,CAAA;AAAA,CAAA,EAvLdrB,uBAAA,CAiLT,SAAA,EAAA,yBAAA,EAAA,CAAA,CAAA;AAjLSA,uBAAA,GAAN,eAAA,CAAA;AAAA,EAJNsB,aAAQ,MAAA,CAAO;AAAA,IACZ,SAAA,EAAW,YAAA;AAAA,IACX,WAAA,EAAa;AAAA,GAChB;AAAA,CAAA,EACYtB,uBAAA,CAAA","file":"AreHTML.compiler.js","sourcesContent":["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}"]}
1
+ {"version":3,"sources":["../../../src/engine/AreHTML.compiler.ts"],"names":["AreHTMLCompiler","AreCompiler","AddStaticHTMLInstruction","AddStyleInstruction","AddTextInstruction","AreCompilerError","AddAttributeInstruction","AreDirectiveFeatures","A_FormatterHelper","AddListenerInstruction","AreHTMLNode","A_Caller","AreScene","A_Logger","AreInterpolation","AreStore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,aAAS,CAAA;AAAA,CAAA,EAnMdtB,uBAAA,CA6LT,SAAA,EAAA,yBAAA,EAAA,CAAA,CAAA;AA7LSA,uBAAA,GAAN,eAAA,CAAA;AAAA,EAJNuB,aAAQ,MAAA,CAAO;AAAA,IACZ,SAAA,EAAW,YAAA;AAAA,IACX,WAAA,EAAa;AAAA,GAChB;AAAA,CAAA,EACYvB,uBAAA,CAAA","file":"AreHTML.compiler.js","sourcesContent":["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 { AddStaticHTMLInstruction } from \"@adaas/are-html/instructions/AddStaticHTML.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 /**\n * Static-island materialisation. When the tokenizer flagged this node as\n * a static island its inner subtree was never exploded into child nodes,\n * so there is nothing for the base compiler to walk. Emit a single\n * AddStaticHTML instruction carrying the captured inner markup; the\n * interpreter injects it onto the host element in one pass (and decodes\n * HTML entities for free).\n */\n if (node.isStaticIsland && scene.host) {\n scene.plan(new AddStaticHTMLInstruction(scene.host, { html: node.staticInnerHTML! }));\n }\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}"]}
@@ -14,11 +14,15 @@ import { AddAttributeInstruction } from '@adaas/are-html/instructions/AddAttribu
14
14
  import { AddTextInstruction } from '@adaas/are-html/instructions/AddText.instruction';
15
15
  import { AddListenerInstruction } from '@adaas/are-html/instructions/AddListener.instruction';
16
16
  import { AddStyleInstruction } from '@adaas/are-html/instructions/AddStyle.instruction';
17
+ import { AddStaticHTMLInstruction } from '@adaas/are-html/instructions/AddStaticHTML.instruction';
17
18
  import { AreHTMLNode } from '@adaas/are-html/node';
18
19
 
19
20
  let AreHTMLCompiler = class extends AreCompiler {
20
21
  compileHTMLNode(node, scene, logger, ...args) {
21
22
  super.compile(node, scene, logger, ...args);
23
+ if (node.isStaticIsland && scene.host) {
24
+ scene.plan(new AddStaticHTMLInstruction(scene.host, { html: node.staticInnerHTML }));
25
+ }
22
26
  if (node.styles?.styles) {
23
27
  const host = scene.host;
24
28
  if (host) {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/engine/AreHTML.compiler.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAwBO,IAAM,eAAA,GAAN,cAA8B,WAAA,CAAY;AAAA,EAS7C,eAAA,CACwB,IAAA,EACA,KAAA,EACA,MAAA,EAAA,GACjB,IAAA,EACC;AACJ,IAAA,KAAA,CAAM,OAAA,CAAQ,IAAA,EAAM,KAAA,EAAO,MAAA,EAAQ,GAAG,IAAI,CAAA;AAE1C,IAAA,IAAI,IAAA,CAAK,QAAQ,MAAA,EAAQ;AACrB,MAAA,MAAM,OAAO,KAAA,CAAM,IAAA;AACnB,MAAA,IAAI,IAAA,EAAM;AACN,QAAA,KAAA,CAAM,IAAA,CAAK,IAAI,mBAAA,CAAoB,IAAA,EAAM,EAAE,QAAQ,IAAA,CAAK,MAAA,CAAO,MAAA,EAAQ,CAAC,CAAA;AAAA,MAC5E;AAAA,IACJ;AAAA,EACJ;AAAA,EAeA,oBAAA,CACwB,aAAA,EACA,KAAA,EAEA,KAAA,EACA,WACjB,IAAA,EACL;AAeE,IAAA,KAAA,CAAM,IAAA,CAAK,IAAI,kBAAA,CAAmB,EAAE,OAAA,EAAS,cAAc,OAAA,EAAS,QAAA,EAAU,IAAA,EAAM,CAAC,CAAA;AAAA,EACzF;AAAA,EAMA,WAAA,CACwB,IAAA,EACA,KAAA,EACA,MAAA,EAAA,GACjB,IAAA,EACL;AACE,IAAA,MAAA,EAAQ,KAAA,CAAM,MAAA,EAAQ,CAAA,oCAAA,EAAuC,IAAA,CAAK,KAAA,CAAM,UAAU,CAAA,iBAAA,EAAoB,IAAA,CAAK,OAAO,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AN,eAAA,CAAA;AAAA,EAJN,QAAQ,MAAA,CAAO;AAAA,IACZ,SAAA,EAAW,YAAA;AAAA,IACX,WAAA,EAAa;AAAA,GAChB;AAAA,CAAA,EACY,eAAA,CAAA","file":"AreHTML.compiler.mjs","sourcesContent":["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}"]}
1
+ {"version":3,"sources":["../../../src/engine/AreHTML.compiler.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAyBO,IAAM,eAAA,GAAN,cAA8B,WAAA,CAAY;AAAA,EAS7C,eAAA,CACwB,IAAA,EACA,KAAA,EACA,MAAA,EAAA,GACjB,IAAA,EACC;AACJ,IAAA,KAAA,CAAM,OAAA,CAAQ,IAAA,EAAM,KAAA,EAAO,MAAA,EAAQ,GAAG,IAAI,CAAA;AAU1C,IAAA,IAAI,IAAA,CAAK,cAAA,IAAkB,KAAA,CAAM,IAAA,EAAM;AACnC,MAAA,KAAA,CAAM,IAAA,CAAK,IAAI,wBAAA,CAAyB,KAAA,CAAM,IAAA,EAAM,EAAE,IAAA,EAAM,IAAA,CAAK,eAAA,EAAkB,CAAC,CAAA;AAAA,IACxF;AAEA,IAAA,IAAI,IAAA,CAAK,QAAQ,MAAA,EAAQ;AACrB,MAAA,MAAM,OAAO,KAAA,CAAM,IAAA;AACnB,MAAA,IAAI,IAAA,EAAM;AACN,QAAA,KAAA,CAAM,IAAA,CAAK,IAAI,mBAAA,CAAoB,IAAA,EAAM,EAAE,QAAQ,IAAA,CAAK,MAAA,CAAO,MAAA,EAAQ,CAAC,CAAA;A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B,4BAAS,QAAQ,CAAA;AAAA,CAAA,EApKb,eAAA,CAkKT,SAAA,EAAA,uBAAA,EAAA,CAAA,CAAA;AA2BA,eAAA,CAAA;AAAA,EADC,WAAA,CAAY,QAAQ,mBAAmB,CAAA;AAAA,EAEnC,4BAAS,QAAQ,CAAA,CAAA;AAAA,EACjB,4BAAS,QAAQ,CAAA,CAAA;AAAA,EACjB,gCAAa,MAAA,EAAO,CAAA;AAAA,EACpB,4BAAS,QAAQ,CAAA,CAAA;AAAA,EACjB,4BAAS,QAAQ,CAAA,CAAA;AAAA,EACjB,4BAAS,SAAS,CAAA;AAAA,CAAA,EAnMd,eAAA,CA6LT,SAAA,EAAA,yBAAA,EAAA,CAAA,CAAA;AA7LS,eAAA,GAAN,eAAA,CAAA;AAAA,EAJN,QAAQ,MAAA,CAAO;AAAA,IACZ,SAAA,EAAW,YAAA;AAAA,IACX,WAAA,EAAa;AAAA,GAChB;AAAA,CAAA,EACY,eAAA,CAAA","file":"AreHTML.compiler.mjs","sourcesContent":["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 { AddStaticHTMLInstruction } from \"@adaas/are-html/instructions/AddStaticHTML.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 /**\n * Static-island materialisation. When the tokenizer flagged this node as\n * a static island its inner subtree was never exploded into child nodes,\n * so there is nothing for the base compiler to walk. Emit a single\n * AddStaticHTML instruction carrying the captured inner markup; the\n * interpreter injects it onto the host element in one pass (and decodes\n * HTML entities for free).\n */\n if (node.isStaticIsland && scene.host) {\n scene.plan(new AddStaticHTMLInstruction(scene.host, { html: node.staticInnerHTML! }));\n }\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}"]}
@@ -66,5 +66,37 @@ declare const LISTENER_OPTION_MODIFIERS: Set<string>;
66
66
  * Avoids "undefined"/"null"/"[object Object]" leaks into the DOM.
67
67
  */
68
68
  declare function toDOMString(value: any): string;
69
+ /**
70
+ * Standard HTML element names that are safe to materialise wholesale via
71
+ * `innerHTML` / a cached `<template>` clone.
72
+ *
73
+ * The set is intentionally an allow-list of plain HTML flow/phrasing/table/list
74
+ * /form-display tags. Anything NOT in this set — custom elements, registered
75
+ * ARE components (resolved by PascalCase tag), and SVG/MathML elements — is
76
+ * excluded so those subtrees keep flowing through the normal per-node pipeline
77
+ * (SVG needs createElementNS; components need their own lifecycle).
78
+ */
79
+ declare const STANDARD_HTML_TAGS: Set<string>;
80
+ /**
81
+ * Detects whether an inner-markup string is a fully *static island* — i.e. it
82
+ * contains no ARE-reactive constructs and therefore can be rendered in one shot
83
+ * (browser-parsed `innerHTML` / cached `<template>` clone) instead of being
84
+ * exploded into one AreNode per element/text/interpolation.
85
+ *
86
+ * A subtree is static iff it contains:
87
+ * 1. no `{{ }}` interpolations, and
88
+ * 2. no dynamic attributes (`$`-directive / `:`-binding / `@`-event), and
89
+ * 3. only standard HTML tags (no custom elements, ARE components or SVG).
90
+ *
91
+ * The scanner is quote-aware so a `:` / `@` / `$` inside an attribute *value*
92
+ * (e.g. `href="http://…"`, `style="color:red"`) is never mistaken for a
93
+ * dynamic-attribute prefix. The detector is deliberately conservative: any
94
+ * ambiguity resolves to `false` (skip the optimisation, keep the safe path).
95
+ *
96
+ * NOTE: pure-text content (no tags at all) is also considered static — this is
97
+ * what lets `&nbsp;`, `&amp;`, `&#160;` and friends decode correctly, since the
98
+ * browser HTML parser handles entities that hand-built text nodes do not.
99
+ */
100
+ declare function isStaticMarkup(inner: string): boolean;
69
101
 
70
- export { BOOLEAN_ATTRIBUTES, IDL_FORM_PROPERTIES, LISTENER_OPTION_MODIFIERS, type ParsedEventName, SVG_ATTRIBUTE_NS, SVG_NAMESPACE, VOID_ELEMENTS, isBooleanAttribute, isIDLFormProperty, isVoidElement, normalizeClassValue, normalizeStyleValue, parseEventName, toDOMString };
102
+ export { BOOLEAN_ATTRIBUTES, IDL_FORM_PROPERTIES, LISTENER_OPTION_MODIFIERS, type ParsedEventName, STANDARD_HTML_TAGS, SVG_ATTRIBUTE_NS, SVG_NAMESPACE, VOID_ELEMENTS, isBooleanAttribute, isIDLFormProperty, isStaticMarkup, isVoidElement, normalizeClassValue, normalizeStyleValue, parseEventName, toDOMString };
@@ -66,5 +66,37 @@ declare const LISTENER_OPTION_MODIFIERS: Set<string>;
66
66
  * Avoids "undefined"/"null"/"[object Object]" leaks into the DOM.
67
67
  */
68
68
  declare function toDOMString(value: any): string;
69
+ /**
70
+ * Standard HTML element names that are safe to materialise wholesale via
71
+ * `innerHTML` / a cached `<template>` clone.
72
+ *
73
+ * The set is intentionally an allow-list of plain HTML flow/phrasing/table/list
74
+ * /form-display tags. Anything NOT in this set — custom elements, registered
75
+ * ARE components (resolved by PascalCase tag), and SVG/MathML elements — is
76
+ * excluded so those subtrees keep flowing through the normal per-node pipeline
77
+ * (SVG needs createElementNS; components need their own lifecycle).
78
+ */
79
+ declare const STANDARD_HTML_TAGS: Set<string>;
80
+ /**
81
+ * Detects whether an inner-markup string is a fully *static island* — i.e. it
82
+ * contains no ARE-reactive constructs and therefore can be rendered in one shot
83
+ * (browser-parsed `innerHTML` / cached `<template>` clone) instead of being
84
+ * exploded into one AreNode per element/text/interpolation.
85
+ *
86
+ * A subtree is static iff it contains:
87
+ * 1. no `{{ }}` interpolations, and
88
+ * 2. no dynamic attributes (`$`-directive / `:`-binding / `@`-event), and
89
+ * 3. only standard HTML tags (no custom elements, ARE components or SVG).
90
+ *
91
+ * The scanner is quote-aware so a `:` / `@` / `$` inside an attribute *value*
92
+ * (e.g. `href="http://…"`, `style="color:red"`) is never mistaken for a
93
+ * dynamic-attribute prefix. The detector is deliberately conservative: any
94
+ * ambiguity resolves to `false` (skip the optimisation, keep the safe path).
95
+ *
96
+ * NOTE: pure-text content (no tags at all) is also considered static — this is
97
+ * what lets `&nbsp;`, `&amp;`, `&#160;` and friends decode correctly, since the
98
+ * browser HTML parser handles entities that hand-built text nodes do not.
99
+ */
100
+ declare function isStaticMarkup(inner: string): boolean;
69
101
 
70
- export { BOOLEAN_ATTRIBUTES, IDL_FORM_PROPERTIES, LISTENER_OPTION_MODIFIERS, type ParsedEventName, SVG_ATTRIBUTE_NS, SVG_NAMESPACE, VOID_ELEMENTS, isBooleanAttribute, isIDLFormProperty, isVoidElement, normalizeClassValue, normalizeStyleValue, parseEventName, toDOMString };
102
+ export { BOOLEAN_ATTRIBUTES, IDL_FORM_PROPERTIES, LISTENER_OPTION_MODIFIERS, type ParsedEventName, STANDARD_HTML_TAGS, SVG_ATTRIBUTE_NS, SVG_NAMESPACE, VOID_ELEMENTS, isBooleanAttribute, isIDLFormProperty, isStaticMarkup, isVoidElement, normalizeClassValue, normalizeStyleValue, parseEventName, toDOMString };
@@ -115,15 +115,181 @@ function toDOMString(value) {
115
115
  return "";
116
116
  }
117
117
  }
118
+ const STANDARD_HTML_TAGS = /* @__PURE__ */ new Set([
119
+ // root / sections
120
+ "html",
121
+ "body",
122
+ "header",
123
+ "footer",
124
+ "main",
125
+ "nav",
126
+ "section",
127
+ "article",
128
+ "aside",
129
+ "address",
130
+ "hgroup",
131
+ // headings
132
+ "h1",
133
+ "h2",
134
+ "h3",
135
+ "h4",
136
+ "h5",
137
+ "h6",
138
+ // grouping
139
+ "div",
140
+ "p",
141
+ "span",
142
+ "pre",
143
+ "blockquote",
144
+ "figure",
145
+ "figcaption",
146
+ "hr",
147
+ "br",
148
+ "wbr",
149
+ // lists
150
+ "ul",
151
+ "ol",
152
+ "li",
153
+ "dl",
154
+ "dt",
155
+ "dd",
156
+ "menu",
157
+ // text-level / phrasing
158
+ "a",
159
+ "b",
160
+ "i",
161
+ "u",
162
+ "s",
163
+ "em",
164
+ "strong",
165
+ "small",
166
+ "mark",
167
+ "abbr",
168
+ "cite",
169
+ "q",
170
+ "code",
171
+ "kbd",
172
+ "samp",
173
+ "var",
174
+ "sub",
175
+ "sup",
176
+ "time",
177
+ "data",
178
+ "dfn",
179
+ "bdi",
180
+ "bdo",
181
+ "ruby",
182
+ "rt",
183
+ "rp",
184
+ "del",
185
+ "ins",
186
+ // media / embedded (no special namespace handling needed)
187
+ "img",
188
+ "picture",
189
+ "source",
190
+ "figure",
191
+ "audio",
192
+ "video",
193
+ "track",
194
+ // tables
195
+ "table",
196
+ "caption",
197
+ "colgroup",
198
+ "col",
199
+ "thead",
200
+ "tbody",
201
+ "tfoot",
202
+ "tr",
203
+ "th",
204
+ "td",
205
+ // forms (display only — these still render fine from innerHTML)
206
+ "label",
207
+ "fieldset",
208
+ "legend",
209
+ "datalist",
210
+ "option",
211
+ "optgroup",
212
+ "output",
213
+ "progress",
214
+ "meter",
215
+ // interactive
216
+ "details",
217
+ "summary",
218
+ "dialog"
219
+ ]);
220
+ function isStaticMarkup(inner) {
221
+ if (!inner) return false;
222
+ if (inner.indexOf("{{") !== -1) return false;
223
+ const n = inner.length;
224
+ let i = 0;
225
+ while (i < n) {
226
+ const lt = inner.indexOf("<", i);
227
+ if (lt === -1) break;
228
+ if (inner.startsWith("<!--", lt)) {
229
+ const end = inner.indexOf("-->", lt + 4);
230
+ if (end === -1) return false;
231
+ i = end + 3;
232
+ continue;
233
+ }
234
+ if (inner[lt + 1] === "/" || inner[lt + 1] === "!" || inner[lt + 1] === "?") {
235
+ const gt = inner.indexOf(">", lt);
236
+ if (gt === -1) return false;
237
+ i = gt + 1;
238
+ continue;
239
+ }
240
+ const nameMatch = /^<([a-zA-Z][a-zA-Z0-9-]*)/.exec(inner.slice(lt));
241
+ if (!nameMatch) {
242
+ i = lt + 1;
243
+ continue;
244
+ }
245
+ const tag = nameMatch[1].toLowerCase();
246
+ if (tag.indexOf("-") !== -1 || !STANDARD_HTML_TAGS.has(tag)) return false;
247
+ let j = lt + nameMatch[0].length;
248
+ let inSingle = false;
249
+ let inDouble = false;
250
+ let atNameBoundary = true;
251
+ let tagEnd = -1;
252
+ while (j < n) {
253
+ const ch = inner[j];
254
+ if (inDouble) {
255
+ if (ch === '"') inDouble = false;
256
+ } else if (inSingle) {
257
+ if (ch === "'") inSingle = false;
258
+ } else if (ch === '"') {
259
+ inDouble = true;
260
+ atNameBoundary = false;
261
+ } else if (ch === "'") {
262
+ inSingle = true;
263
+ atNameBoundary = false;
264
+ } else if (ch === ">") {
265
+ tagEnd = j;
266
+ break;
267
+ } else if (ch === " " || ch === " " || ch === "\n" || ch === "\r" || ch === "/") {
268
+ atNameBoundary = true;
269
+ } else {
270
+ if (atNameBoundary && (ch === "$" || ch === ":" || ch === "@")) {
271
+ return false;
272
+ }
273
+ atNameBoundary = false;
274
+ }
275
+ j++;
276
+ }
277
+ if (tagEnd === -1) return false;
278
+ i = tagEnd + 1;
279
+ }
280
+ return true;
281
+ }
118
282
 
119
283
  exports.BOOLEAN_ATTRIBUTES = BOOLEAN_ATTRIBUTES;
120
284
  exports.IDL_FORM_PROPERTIES = IDL_FORM_PROPERTIES;
121
285
  exports.LISTENER_OPTION_MODIFIERS = LISTENER_OPTION_MODIFIERS;
286
+ exports.STANDARD_HTML_TAGS = STANDARD_HTML_TAGS;
122
287
  exports.SVG_ATTRIBUTE_NS = SVG_ATTRIBUTE_NS;
123
288
  exports.SVG_NAMESPACE = SVG_NAMESPACE;
124
289
  exports.VOID_ELEMENTS = VOID_ELEMENTS;
125
290
  exports.isBooleanAttribute = isBooleanAttribute;
126
291
  exports.isIDLFormProperty = isIDLFormProperty;
292
+ exports.isStaticMarkup = isStaticMarkup;
127
293
  exports.isVoidElement = isVoidElement;
128
294
  exports.normalizeClassValue = normalizeClassValue;
129
295
  exports.normalizeStyleValue = normalizeStyleValue;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/engine/AreHTML.constants.ts"],"names":[],"mappings":";;AAKO,MAAM,aAAA,GAAgB;AAMtB,MAAM,gBAAA,GAA2C;AA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A,EAAoB;AAC5C,EAAA,IAAI,KAAA,KAAU,IAAA,IAAQ,KAAA,KAAU,MAAA,EAAW,OAAO,EAAA;AAClD,EAAA,IAAI,OAAO,KAAA,KAAU,QAAA,EAAU,OAAO,KAAA;AACtC,EAAA,IAAI,OAAO,UAAU,QAAA,IAAY,OAAO,UAAU,SAAA,EAAW,OAAO,OAAO,KAAK,CAAA;AAChF,EAAA,IAAI;AACA,IAAA,OAAO,IAAA,CAAK,UAAU,KAAK,CAAA;AAAA,EAC/B,CAAA,CAAA,MAAQ;AACJ,IAAA,OAAO,EAAA;AAAA,EACX;AACJ","file":"AreHTML.constants.js","sourcesContent":["// ─────────────────────────────────────────────────────────────────────────────\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"]}
1
+ {"version":3,"sources":["../../../src/engine/AreHTML.constants.ts"],"names":[],"mappings":";;AAKO,MAAM,aAAA,GAAgB;AAMtB,MAAM,gBAAA,GAA2C;AAAA,EACpD,KAAA,EAAO,8BAAA;AAAA,EACP,GAAA,EAAK,sCAAA;AAAA,EACL,KAAA,EAAO;AACX;AAaO,MAAM,aAAA,uBAAoB,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AO,IAAI,CAAA,EAAG;AACV,MAAA,MAAM,EAAA,GAAK,MAAM,CAAC,CAAA;AAElB,MAAA,IAAI,QAAA,EAAU;AACV,QAAA,IAAI,EAAA,KAAO,KAAK,QAAA,GAAW,KAAA;AAAA,MAC/B,WAAW,QAAA,EAAU;AACjB,QAAA,IAAI,EAAA,KAAO,KAAK,QAAA,GAAW,KAAA;AAAA,MAC/B,CAAA,MAAA,IAAW,OAAO,GAAA,EAAK;AACnB,QAAA,QAAA,GAAW,IAAA;AACX,QAAA,cAAA,GAAiB,KAAA;AAAA,MACrB,CAAA,MAAA,IAAW,OAAO,GAAA,EAAK;AACnB,QAAA,QAAA,GAAW,IAAA;AACX,QAAA,cAAA,GAAiB,KAAA;AAAA,MACrB,CAAA,MAAA,IAAW,OAAO,GAAA,EAAK;AACnB,QAAA,MAAA,GAAS,CAAA;AACT,QAAA;AAAA,MACJ,CAAA,MAAA,IAAW,EAAA,KAAO,GAAA,IAAO,EAAA,KAAO,GAAA,IAAQ,OAAO,IAAA,IAAQ,EAAA,KAAO,IAAA,IAAQ,EAAA,KAAO,GAAA,EAAK;AAC9E,QAAA,cAAA,GAAiB,IAAA;AAAA,MACrB,CAAA,MAAO;AAGH,QAAA,IAAI,mBAAmB,EAAA,KAAO,GAAA,IAAO,EAAA,KAAO,GAAA,IAAO,OAAO,GAAA,CAAA,EAAM;AAC5D,UAAA,OAAO,KAAA;AAAA,QACX;AACA,QAAA,cAAA,GAAiB,KAAA;AAAA,MACrB;AACA,MAAA,CAAA,EAAA;AAAA,IACJ;AAEA,IAAA,IAAI,MAAA,KAAW,IAAI,OAAO,KAAA;AAC1B,IAAA,CAAA,GAAI,MAAA,GAAS,CAAA;AAAA,EACjB;AAEA,EAAA,OAAO,IAAA;AACX","file":"AreHTML.constants.js","sourcesContent":["// ─────────────────────────────────────────────────────────────────────────────\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// ─────────────────────────────────────────────────────────────────────────────\n// ── Static-island detection ──────────────────────────────────────────────────\n// ─────────────────────────────────────────────────────────────────────────────\n\n/**\n * Standard HTML element names that are safe to materialise wholesale via\n * `innerHTML` / a cached `<template>` clone.\n *\n * The set is intentionally an allow-list of plain HTML flow/phrasing/table/list\n * /form-display tags. Anything NOT in this set — custom elements, registered\n * ARE components (resolved by PascalCase tag), and SVG/MathML elements — is\n * excluded so those subtrees keep flowing through the normal per-node pipeline\n * (SVG needs createElementNS; components need their own lifecycle).\n */\nexport const STANDARD_HTML_TAGS = new Set<string>([\n // root / sections\n 'html', 'body', 'header', 'footer', 'main', 'nav', 'section', 'article',\n 'aside', 'address', 'hgroup',\n // headings\n 'h1', 'h2', 'h3', 'h4', 'h5', 'h6',\n // grouping\n 'div', 'p', 'span', 'pre', 'blockquote', 'figure', 'figcaption',\n 'hr', 'br', 'wbr',\n // lists\n 'ul', 'ol', 'li', 'dl', 'dt', 'dd', 'menu',\n // text-level / phrasing\n 'a', 'b', 'i', 'u', 's', 'em', 'strong', 'small', 'mark', 'abbr', 'cite',\n 'q', 'code', 'kbd', 'samp', 'var', 'sub', 'sup', 'time', 'data', 'dfn',\n 'bdi', 'bdo', 'ruby', 'rt', 'rp', 'del', 'ins',\n // media / embedded (no special namespace handling needed)\n 'img', 'picture', 'source', 'figure', 'audio', 'video', 'track',\n // tables\n 'table', 'caption', 'colgroup', 'col', 'thead', 'tbody', 'tfoot',\n 'tr', 'th', 'td',\n // forms (display only — these still render fine from innerHTML)\n 'label', 'fieldset', 'legend', 'datalist', 'option', 'optgroup', 'output',\n 'progress', 'meter',\n // interactive\n 'details', 'summary', 'dialog',\n]);\n\n/**\n * Detects whether an inner-markup string is a fully *static island* — i.e. it\n * contains no ARE-reactive constructs and therefore can be rendered in one shot\n * (browser-parsed `innerHTML` / cached `<template>` clone) instead of being\n * exploded into one AreNode per element/text/interpolation.\n *\n * A subtree is static iff it contains:\n * 1. no `{{ }}` interpolations, and\n * 2. no dynamic attributes (`$`-directive / `:`-binding / `@`-event), and\n * 3. only standard HTML tags (no custom elements, ARE components or SVG).\n *\n * The scanner is quote-aware so a `:` / `@` / `$` inside an attribute *value*\n * (e.g. `href=\"http://…\"`, `style=\"color:red\"`) is never mistaken for a\n * dynamic-attribute prefix. The detector is deliberately conservative: any\n * ambiguity resolves to `false` (skip the optimisation, keep the safe path).\n *\n * NOTE: pure-text content (no tags at all) is also considered static — this is\n * what lets `&nbsp;`, `&amp;`, `&#160;` and friends decode correctly, since the\n * browser HTML parser handles entities that hand-built text nodes do not.\n */\nexport function isStaticMarkup(inner: string): boolean {\n if (!inner) return false;\n // 1. interpolations make the subtree dynamic\n if (inner.indexOf('{{') !== -1) return false;\n\n const n = inner.length;\n let i = 0;\n\n while (i < n) {\n const lt = inner.indexOf('<', i);\n if (lt === -1) break; // remaining content is plain text — safe\n\n // HTML comment — inert, skip over it\n if (inner.startsWith('<!--', lt)) {\n const end = inner.indexOf('-->', lt + 4);\n if (end === -1) return false; // malformed\n i = end + 3;\n continue;\n }\n\n // closing tag, doctype or processing instruction — skip to its '>'\n if (inner[lt + 1] === '/' || inner[lt + 1] === '!' || inner[lt + 1] === '?') {\n const gt = inner.indexOf('>', lt);\n if (gt === -1) return false;\n i = gt + 1;\n continue;\n }\n\n // opening tag — extract the tag name\n const nameMatch = /^<([a-zA-Z][a-zA-Z0-9-]*)/.exec(inner.slice(lt));\n if (!nameMatch) { i = lt + 1; continue; }\n\n const tag = nameMatch[1].toLowerCase();\n // custom element / ARE component / non-standard (incl. SVG) → not static\n if (tag.indexOf('-') !== -1 || !STANDARD_HTML_TAGS.has(tag)) return false;\n\n // walk the opening tag (quote-aware) to find its closing '>' and inspect\n // attribute-name boundaries for dynamic prefixes\n let j = lt + nameMatch[0].length;\n let inSingle = false;\n let inDouble = false;\n let atNameBoundary = true; // true right after whitespace / '/' inside a tag\n let tagEnd = -1;\n\n while (j < n) {\n const ch = inner[j];\n\n if (inDouble) {\n if (ch === '\"') inDouble = false;\n } else if (inSingle) {\n if (ch === \"'\") inSingle = false;\n } else if (ch === '\"') {\n inDouble = true;\n atNameBoundary = false;\n } else if (ch === \"'\") {\n inSingle = true;\n atNameBoundary = false;\n } else if (ch === '>') {\n tagEnd = j;\n break;\n } else if (ch === ' ' || ch === '\\t' || ch === '\\n' || ch === '\\r' || ch === '/') {\n atNameBoundary = true;\n } else {\n // a dynamic-attribute prefix only counts when it STARTS an\n // attribute name (i.e. sits at a name boundary, outside quotes)\n if (atNameBoundary && (ch === '$' || ch === ':' || ch === '@')) {\n return false;\n }\n atNameBoundary = false;\n }\n j++;\n }\n\n if (tagEnd === -1) return false; // unterminated tag — bail to safe path\n i = tagEnd + 1;\n }\n\n return true;\n}\n\n\n"]}