@adaas/are-html 0.0.3 → 0.0.5

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 (63) hide show
  1. package/README.md +4 -4
  2. package/dist/browser/index.d.mts +12 -4
  3. package/dist/browser/index.mjs +47 -20
  4. package/dist/browser/index.mjs.map +1 -1
  5. package/dist/node/engine/AreHTML.compiler.js +10 -0
  6. package/dist/node/engine/AreHTML.compiler.js.map +1 -1
  7. package/dist/node/engine/AreHTML.compiler.mjs +10 -0
  8. package/dist/node/engine/AreHTML.compiler.mjs.map +1 -1
  9. package/dist/node/engine/AreHTML.constants.d.mts +10 -1
  10. package/dist/node/engine/AreHTML.constants.d.ts +10 -1
  11. package/dist/node/engine/AreHTML.constants.js +21 -0
  12. package/dist/node/engine/AreHTML.constants.js.map +1 -1
  13. package/dist/node/engine/AreHTML.constants.mjs +20 -1
  14. package/dist/node/engine/AreHTML.constants.mjs.map +1 -1
  15. package/dist/node/engine/AreHTML.engine.js +8 -0
  16. package/dist/node/engine/AreHTML.engine.js.map +1 -1
  17. package/dist/node/engine/AreHTML.engine.mjs +8 -0
  18. package/dist/node/engine/AreHTML.engine.mjs.map +1 -1
  19. package/dist/node/engine/AreHTML.interpreter.js +1 -0
  20. package/dist/node/engine/AreHTML.interpreter.js.map +1 -1
  21. package/dist/node/engine/AreHTML.interpreter.mjs +1 -0
  22. package/dist/node/engine/AreHTML.interpreter.mjs.map +1 -1
  23. package/dist/node/engine/AreHTML.lifecycle.d.mts +1 -2
  24. package/dist/node/engine/AreHTML.lifecycle.d.ts +1 -2
  25. package/dist/node/engine/AreHTML.lifecycle.js +2 -11
  26. package/dist/node/engine/AreHTML.lifecycle.js.map +1 -1
  27. package/dist/node/engine/AreHTML.lifecycle.mjs +2 -11
  28. package/dist/node/engine/AreHTML.lifecycle.mjs.map +1 -1
  29. package/dist/node/index.d.mts +2 -2
  30. package/dist/node/index.d.ts +2 -2
  31. package/dist/node/index.js +3 -3
  32. package/dist/node/index.mjs +1 -1
  33. package/dist/node/lib/AreRoot/AreRoot.component.js +2 -3
  34. package/dist/node/lib/AreRoot/AreRoot.component.js.map +1 -1
  35. package/dist/node/lib/AreRoot/AreRoot.component.mjs +2 -3
  36. package/dist/node/lib/AreRoot/AreRoot.component.mjs.map +1 -1
  37. package/dist/node/lib/{AreWatcher/AreWatcher.component.d.mts → AreRouteWatcher/AreRouteWatcher.component.d.mts} +2 -2
  38. package/dist/node/lib/{AreWatcher/AreWatcher.component.d.ts → AreRouteWatcher/AreRouteWatcher.component.d.ts} +2 -2
  39. package/dist/node/lib/{AreWatcher/AreWatcher.component.js → AreRouteWatcher/AreRouteWatcher.component.js} +6 -6
  40. package/dist/node/lib/AreRouteWatcher/AreRouteWatcher.component.js.map +1 -0
  41. package/dist/node/lib/{AreWatcher/AreWatcher.component.mjs → AreRouteWatcher/AreRouteWatcher.component.mjs} +7 -7
  42. package/dist/node/lib/AreRouteWatcher/AreRouteWatcher.component.mjs.map +1 -0
  43. package/dist/node/signals/AreRoute.signal.js +1 -1
  44. package/dist/node/signals/AreRoute.signal.js.map +1 -1
  45. package/dist/node/signals/AreRoute.signal.mjs +1 -1
  46. package/dist/node/signals/AreRoute.signal.mjs.map +1 -1
  47. package/examples/dashboard/dist/index.html +1 -1
  48. package/examples/dashboard/dist/{mpioi5ab-8c3oa9.js → mpm5e2oi-ghokyu.js} +2 -2
  49. package/examples/jumpstart/dist/mor90p6y-0plg7g.js +8 -8
  50. package/examples/jumpstart/dist/mor90p7p-1898bz.js +8 -8
  51. package/jest.config.ts +1 -1
  52. package/package.json +1 -1
  53. package/src/engine/AreHTML.compiler.ts +19 -1
  54. package/src/engine/AreHTML.constants.ts +16 -0
  55. package/src/engine/AreHTML.engine.ts +10 -0
  56. package/src/engine/AreHTML.interpreter.ts +3 -0
  57. package/src/engine/AreHTML.lifecycle.ts +13 -12
  58. package/src/index.ts +2 -2
  59. package/src/lib/AreRoot/AreRoot.component.ts +5 -6
  60. package/src/lib/{AreWatcher/AreWatcher.component.ts → AreRouteWatcher/AreRouteWatcher.component.ts} +2 -2
  61. package/src/signals/AreRoute.signal.ts +1 -1
  62. package/dist/node/lib/AreWatcher/AreWatcher.component.js.map +0 -1
  63. package/dist/node/lib/AreWatcher/AreWatcher.component.mjs.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/engine/AreHTML.lifecycle.ts"],"names":["AreHTMLLifecycle","AreLifecycle","AreScene","AreDirectiveFeatures","A_FormatterHelper","AreComponentNode","A_Caller","A_Scope","AreHTMLEngineContext","A_Logger","AreRootNode","AreSignalsContext","AreText","AreInterpolation","A_Feature","AreAttributeFeatures","AreDirectiveAttribute","A_Frame"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAkBaA,wBAAA,GAAN,+BAA+BC,gBAAA,CAAa;AAAA,EAG/C,aAAA,CACwB,IAAA,EACD,KAAA,EACa,OAAA,EACZ,WACjB,IAAA,EACC;AACJ,IAAA,KAAA,CAAM,KAAK,IAAA,EAAM,KAAA,EAAO,OAAA,EAAS,MAAA,EAAQ,GAAG,IAAI,CAAA;AAAA,EACpD;AAAA,EAIA,SACwB,IAAA,EACD,KAAA,EACa,OAAA,EACH,cAAA,EACT,WACjB,IAAA,EACC;AACJ,IAAA,cAAA,EAAgB,UAAU,IAAI,CAAA;AAC9B,IAAA,KAAA,CAAM,KAAK,IAAA,EAAM,KAAA,EAAO,OAAA,EAAS,MAAA,EAAQ,GAAG,IAAI,CAAA;AAAA,EACpD;AAAA,EAIA,QAAA,CACwB,IAAA,EACD,KAAA,EACa,OAAA,EACZ,WACjB,IAAA,EACC;AACJ,IAAA,MAAM,KAAA,GAAQ,IAAIC,YAAA,CAAS,IAAA,CAAK,KAAK,CAAA;AAErC,IAAA,KAAA,CAAM,SAAS,KAAK,CAAA;AAAA,EACxB;AAAA,EAIA,iBAAA,CACwB,IAAA,EACD,KAAA,EACa,OAAA,EACZ,WACjB,IAAA,EACC;AACJ,IAAA,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,CAAA;AAAA,EAErB,qCAASN,iBAAQ,CAAA,CAAA;AAAA,EACjB,qCAASC,gBAAO,CAAA,CAAA;AAAA,EAChB,qCAASC,oCAAoB,CAAA,CAAA;AAAA,EAC7B,qCAASC,gBAAQ,CAAA;AAAA,CAAA,EAjCbT,wBAAA,CA6BT,SAAA,EAAA,UAAA,EAAA,CAAA,CAAA;AAcA,eAAA,CAAA;AAAA,EADCC,gBAAA,CAAa,KAAKY,iCAAgB,CAAA;AAAA,EAE9B,qCAASP,iBAAQ,CAAA,CAAA;AAAA,EACjB,qCAASC,gBAAO,CAAA,CAAA;AAAA,EAChB,qCAASC,oCAAoB,CAAA,CAAA;AAAA,EAC7B,qCAASC,gBAAQ,CAAA;AAAA,CAAA,EA/CbT,wBAAA,CA2CT,SAAA,EAAA,mBAAA,EAAA,CAAA,CAAA;AAmBA,eAAA,CAAA;AAAA,EAJCc,mBAAU,MAAA,CAAO;AAAA,IACd,MAAMC,wBAAA,CAAqB,MAAA;AAAA,IAC3B,KAAA,EAAO,CAACC,4CAAqB;AAAA,GAChC,CAAA;AAAA,EAEI,qCAASV,iBAAQ,CAAA,CAAA;AAAA,EACjB,qCAASC,gBAAO,CAAA,CAAA;AAAA,EAChB,qCAASO,kBAAS,CAAA,CAAA;AAAA,EAClB,qCAASL,gBAAQ,CAAA;AAAA,CAAA,EAlEbT,wBAAA,CA8DT,SAAA,EAAA,0BAAA,EAAA,CAAA,CAAA;AA9DSA,wBAAA,GAAN,eAAA,CAAA;AAAA,EAJNiB,aAAQ,MAAA,CAAO;AAAA,IACZ,SAAA,EAAW,YAAA;AAAA,IACX,WAAA,EAAa;AAAA,GAChB;AAAA,CAAA,EACYjB,wBAAA,CAAA","file":"AreHTML.lifecycle.js","sourcesContent":["import { A_Caller, A_Feature, A_FormatterHelper, A_Inject, A_Scope } from \"@adaas/a-concept\";\nimport { AreLifecycle, AreScene, AreAttributeFeatures, AreSignalsContext } 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(A_Logger) logger?: A_Logger,\n ...args: any[]\n ): void {\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\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}"]}
1
+ {"version":3,"sources":["../../../src/engine/AreHTML.lifecycle.ts"],"names":["AreHTMLLifecycle","AreLifecycle","AreScene","AreDirectiveFeatures","A_FormatterHelper","AreComponentNode","AreRootNode","A_Caller","A_Scope","AreHTMLEngineContext","AreSignalsContext","A_Logger","AreText","AreInterpolation","A_Feature","AreAttributeFeatures","AreDirectiveAttribute","A_Frame"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAkBaA,wBAAA,GAAN,+BAA+BC,gBAAA,CAAa;AAAA,EAI/C,cACwB,IAAA,EACD,KAAA,EACa,OAAA,EACH,cAAA,EACT,WACjB,IA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AA,GAChB;AAAA,CAAA,EACYjB,wBAAA,CAAA","file":"AreHTML.lifecycle.js","sourcesContent":["import { A_Caller, A_Feature, A_FormatterHelper, A_Inject, A_Scope } from \"@adaas/a-concept\";\nimport { AreLifecycle, AreScene, AreAttributeFeatures, AreSignalsContext } 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 @AreLifecycle.Init(AreRootNode)\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 signalsContext?.subscribe(node);\n super.init(node, scope, context, logger, ...args);\n }\n\n\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 // 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\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}"]}
@@ -12,10 +12,7 @@ import { AreHTMLEngineContext } from './AreHTML.context';
12
12
  import { A_Frame } from '@adaas/a-frame/core';
13
13
 
14
14
  let AreHTMLLifecycle = class extends AreLifecycle {
15
- initComponent(node, scope, context, logger, ...args) {
16
- super.init(node, scope, context, logger, ...args);
17
- }
18
- initRoot(node, scope, context, signalsContext, logger, ...args) {
15
+ initComponent(node, scope, context, signalsContext, logger, ...args) {
19
16
  signalsContext?.subscribe(node);
20
17
  super.init(node, scope, context, logger, ...args);
21
18
  }
@@ -37,19 +34,13 @@ let AreHTMLLifecycle = class extends AreLifecycle {
37
34
  };
38
35
  __decorateClass([
39
36
  AreLifecycle.Init(AreComponentNode),
40
- __decorateParam(0, A_Inject(A_Caller)),
41
- __decorateParam(1, A_Inject(A_Scope)),
42
- __decorateParam(2, A_Inject(AreHTMLEngineContext)),
43
- __decorateParam(3, A_Inject(A_Logger))
44
- ], AreHTMLLifecycle.prototype, "initComponent", 1);
45
- __decorateClass([
46
37
  AreLifecycle.Init(AreRootNode),
47
38
  __decorateParam(0, A_Inject(A_Caller)),
48
39
  __decorateParam(1, A_Inject(A_Scope)),
49
40
  __decorateParam(2, A_Inject(AreHTMLEngineContext)),
50
41
  __decorateParam(3, A_Inject(AreSignalsContext)),
51
42
  __decorateParam(4, A_Inject(A_Logger))
52
- ], AreHTMLLifecycle.prototype, "initRoot", 1);
43
+ ], AreHTMLLifecycle.prototype, "initComponent", 1);
53
44
  __decorateClass([
54
45
  AreLifecycle.Init(AreText),
55
46
  __decorateParam(0, A_Inject(A_Caller)),
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/engine/AreHTML.lifecycle.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAkBO,IAAM,gBAAA,GAAN,cAA+B,YAAA,CAAa;AAAA,EAG/C,aAAA,CACwB,IAAA,EACD,KAAA,EACa,OAAA,EACZ,WACjB,IAAA,EACC;AACJ,IAAA,KAAA,CAAM,KAAK,IAAA,EAAM,KAAA,EAAO,OAAA,EAAS,MAAA,EAAQ,GAAG,IAAI,CAAA;AAAA,EACpD;AAAA,EAIA,SACwB,IAAA,EACD,KAAA,EACa,OAAA,EACH,cAAA,EACT,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A;AAAA,CAAA,EAlEb,gBAAA,CA8DT,SAAA,EAAA,0BAAA,EAAA,CAAA,CAAA;AA9DS,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","file":"AreHTML.lifecycle.mjs","sourcesContent":["import { A_Caller, A_Feature, A_FormatterHelper, A_Inject, A_Scope } from \"@adaas/a-concept\";\nimport { AreLifecycle, AreScene, AreAttributeFeatures, AreSignalsContext } 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(A_Logger) logger?: A_Logger,\n ...args: any[]\n ): void {\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\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 hand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AAA,CA+DT,SAAA,EAAA,0BAAA,EAAA,CAAA,CAAA;AA/DS,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","file":"AreHTML.lifecycle.mjs","sourcesContent":["import { A_Caller, A_Feature, A_FormatterHelper, A_Inject, A_Scope } from \"@adaas/a-concept\";\nimport { AreLifecycle, AreScene, AreAttributeFeatures, AreSignalsContext } 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 @AreLifecycle.Init(AreRootNode)\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 signalsContext?.subscribe(node);\n super.init(node, scope, context, logger, ...args);\n }\n\n\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 // 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\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}"]}
@@ -15,7 +15,7 @@ export { AreInterpolation } from './nodes/AreInterpolation.mjs';
15
15
  export { AreRootNode } from './nodes/AreRoot.mjs';
16
16
  export { AreText } from './nodes/AreText.mjs';
17
17
  export { AreRoute } from './signals/AreRoute.signal.mjs';
18
- export { BOOLEAN_ATTRIBUTES, IDL_FORM_PROPERTIES, LISTENER_OPTION_MODIFIERS, ParsedEventName, isBooleanAttribute, isIDLFormProperty, normalizeClassValue, normalizeStyleValue, parseEventName, toDOMString } from './engine/AreHTML.constants.mjs';
18
+ export { BOOLEAN_ATTRIBUTES, IDL_FORM_PROPERTIES, LISTENER_OPTION_MODIFIERS, ParsedEventName, VOID_ELEMENTS, isBooleanAttribute, isIDLFormProperty, isVoidElement, normalizeClassValue, normalizeStyleValue, parseEventName, toDOMString } from './engine/AreHTML.constants.mjs';
19
19
  export { AreHTMLEngineContext } from './engine/AreHTML.context.mjs';
20
20
  export { AreHTMLContextConstructor } from './engine/AreHTML.types.mjs';
21
21
  export { AreHTMLCompiler } from './engine/AreHTML.compiler.mjs';
@@ -30,7 +30,7 @@ export { AreDirectiveMeta } from './lib/AreDirective/AreDirective.meta.mjs';
30
30
  export { AreDirectiveOrderDecoratorParameters } from './lib/AreDirective/AreDirective.types.mjs';
31
31
  export { AreRoot } from './lib/AreRoot/AreRoot.component.mjs';
32
32
  export { AreStyle } from './lib/AreStyle/AreStyle.context.mjs';
33
- export { AreWatcher } from './lib/AreWatcher/AreWatcher.component.mjs';
33
+ export { AreRouteWatcher } from './lib/AreRouteWatcher/AreRouteWatcher.component.mjs';
34
34
  import '@adaas/are';
35
35
  import '@adaas/a-concept';
36
36
  import '@adaas/a-utils/a-logger';
@@ -15,7 +15,7 @@ export { AreInterpolation } from './nodes/AreInterpolation.js';
15
15
  export { AreRootNode } from './nodes/AreRoot.js';
16
16
  export { AreText } from './nodes/AreText.js';
17
17
  export { AreRoute } from './signals/AreRoute.signal.js';
18
- export { BOOLEAN_ATTRIBUTES, IDL_FORM_PROPERTIES, LISTENER_OPTION_MODIFIERS, ParsedEventName, isBooleanAttribute, isIDLFormProperty, normalizeClassValue, normalizeStyleValue, parseEventName, toDOMString } from './engine/AreHTML.constants.js';
18
+ export { BOOLEAN_ATTRIBUTES, IDL_FORM_PROPERTIES, LISTENER_OPTION_MODIFIERS, ParsedEventName, VOID_ELEMENTS, isBooleanAttribute, isIDLFormProperty, isVoidElement, normalizeClassValue, normalizeStyleValue, parseEventName, toDOMString } from './engine/AreHTML.constants.js';
19
19
  export { AreHTMLEngineContext } from './engine/AreHTML.context.js';
20
20
  export { AreHTMLContextConstructor } from './engine/AreHTML.types.js';
21
21
  export { AreHTMLCompiler } from './engine/AreHTML.compiler.js';
@@ -30,7 +30,7 @@ export { AreDirectiveMeta } from './lib/AreDirective/AreDirective.meta.js';
30
30
  export { AreDirectiveOrderDecoratorParameters } from './lib/AreDirective/AreDirective.types.js';
31
31
  export { AreRoot } from './lib/AreRoot/AreRoot.component.js';
32
32
  export { AreStyle } from './lib/AreStyle/AreStyle.context.js';
33
- export { AreWatcher } from './lib/AreWatcher/AreWatcher.component.js';
33
+ export { AreRouteWatcher } from './lib/AreRouteWatcher/AreRouteWatcher.component.js';
34
34
  import '@adaas/are';
35
35
  import '@adaas/a-concept';
36
36
  import '@adaas/a-utils/a-logger';
@@ -40,7 +40,7 @@ var AreDirective_types = require('./lib/AreDirective/AreDirective.types');
40
40
  var AreRoot_component = require('./lib/AreRoot/AreRoot.component');
41
41
  var AreStyle_context = require('./lib/AreStyle/AreStyle.context');
42
42
  var AreStyle_types = require('./lib/AreStyle/AreStyle.types');
43
- var AreWatcher_component = require('./lib/AreWatcher/AreWatcher.component');
43
+ var AreRouteWatcher_component = require('./lib/AreRouteWatcher/AreRouteWatcher.component');
44
44
 
45
45
 
46
46
 
@@ -284,10 +284,10 @@ Object.keys(AreStyle_types).forEach(function (k) {
284
284
  get: function () { return AreStyle_types[k]; }
285
285
  });
286
286
  });
287
- Object.keys(AreWatcher_component).forEach(function (k) {
287
+ Object.keys(AreRouteWatcher_component).forEach(function (k) {
288
288
  if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
289
289
  enumerable: true,
290
- get: function () { return AreWatcher_component[k]; }
290
+ get: function () { return AreRouteWatcher_component[k]; }
291
291
  });
292
292
  });
293
293
  //# sourceMappingURL=index.js.map
@@ -38,6 +38,6 @@ export * from './lib/AreDirective/AreDirective.types';
38
38
  export * from './lib/AreRoot/AreRoot.component';
39
39
  export * from './lib/AreStyle/AreStyle.context';
40
40
  export * from './lib/AreStyle/AreStyle.types';
41
- export * from './lib/AreWatcher/AreWatcher.component';
41
+ export * from './lib/AreRouteWatcher/AreRouteWatcher.component';
42
42
  //# sourceMappingURL=index.mjs.map
43
43
  //# sourceMappingURL=index.mjs.map
@@ -46,8 +46,8 @@ exports.AreRoot = class AreRoot extends are.Are {
46
46
  }
47
47
  }
48
48
  if (!componentName) {
49
- const defaultAttr = root.attributes.find((attr) => attr.name === "default");
50
- componentName = defaultAttr?.content;
49
+ const defaultMatch = root.markup?.match(/\bdefault=["']([^"']*)["']/);
50
+ componentName = defaultMatch?.[1];
51
51
  }
52
52
  if (!componentName) {
53
53
  logger.warning('AreRoot: No component found for initial render. Please ensure a route condition or "default" attribute is set.');
@@ -56,7 +56,6 @@ exports.AreRoot = class AreRoot extends are.Are {
56
56
  root.setContent(`<${componentName}></${componentName}>`);
57
57
  }
58
58
  async onSignal(root, vector, store, logger, signalsContext) {
59
- console.log("Received signal vector in AreRoot:", root, vector);
60
59
  const rootId = root.id;
61
60
  if (signalsContext && !signalsContext.hasRoot(rootId)) {
62
61
  return;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/lib/AreRoot/AreRoot.component.ts"],"names":["AreRoot","Are","AreRoute","A_SignalVector","A_Context","AreSignals","A_FormatterHelper","A_Caller","A_Logger","AreSignalsContext","AreStore","A_Frame"],"m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;AAAA,CAAA,EAnEtBT,eAAA,CA8DH,SAAA,EAAA,UAAA,EAAA,CAAA,CAAA;AA9DGA,eAAA,GAAN,eAAA,CAAA;AAAA,EAJNW,aAAQ,MAAA,CAAO;AAAA,IACZ,SAAA,EAAW,YAAA;AAAA,IACX,WAAA,EAAa;AAAA,GAChB;AAAA,CAAA,EACYX,eAAA,CAAA","file":"AreRoot.component.js","sourcesContent":["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, AreRoute } from \"@adaas/are\";\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 — leave the existing template content intact\n if (signalsContext && !signalsContext.hasRoot(rootId)) {\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 the 'default' attribute on the node directly\n // (store props are not yet compiled at template phase)\n if (!componentName) {\n const defaultAttr = root.attributes.find(attr => attr.name === 'default');\n componentName = defaultAttr?.content;\n }\n\n if (!componentName) {\n logger.warning('AreRoot: No component found for initial render. Please ensure a route condition or \"default\" attribute is set.');\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 console.log('Received signal vector in AreRoot:', root, vector);\n\n const rootId = root.id;\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 if (!componentName) {\n logger.warning('No component found for rendering in AreRoot. Please ensure that the signal vector matches at least one component or that a default component name is provided in the store.');\n return;\n }\n\n root.setContent(`<${componentName}></${componentName}>`);\n\n for (let i = 0; i < root.children.length; i++) {\n const child = root.children[i];\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"]}
1
+ {"version":3,"sources":["../../../../src/lib/AreRoot/AreRoot.component.ts"],"names":["AreRoot","Are","AreRoute","A_SignalVector","A_Context","AreSignals","A_FormatterHelper","A_Caller","A_Logger","AreSignalsContext","AreStore","A_Frame"],"mappings":";;;;;;;;;;;;;;;;;;;AAWaA,eAAA,GAAN,sBAAsBC,OAAA,CAAI;AAAA,EAA1B,WAAA,GAAA;AAAA,IAAA,KAAA,CAAA,GAAA,SAAA,CAAA;AAEH,IAAA,IAAA,CAAA,KAAA,GAA2C;AAAA,MACvC,OAAA,EAAS;AAAA,QACL,IAAA,EAAM,QAAA;AAAA,QACN,OAAA,EAAS;AAAA;AACb,KACJ;AAAA,EAAA;AAAA,EAIA,MAAM,QAAA,CACkB,IAAA,EACA,MAAA,EACS,cAAA,EAC/B;AAEE,IAAA,MAAM,SAAS,IAAA,CAAK,EAAA;AAGpB,IAAA,IAAI,cAAA,IAAkB,CAAC,cAAA,CAAe,OAAA,CAAQ,MAAM,CAAA,EAAG;AACnD,MAAA;AAAA,IACJ;AAEA,IAAA,MAAM,YAAA,GAAeC,aAAS,OAAA,EAAQ;AAEtC,IAAA,IAAI,aAAA;AAEJ,IAAA,IAAI,YAAA,EAAc;AACd,MAAA,MAAM,aAAA,GAAgB,IAAIC,sBAAA,CAAe,CAAC,YAAY,CAAC,CAAA;AAGvD,MAAA,IAAI,YAAA,GAAe,cAAA,EAAgB,qBAAA,CAAsB,MAAA,EAAQ,aAAa,CAAA;AAG9E,MAAA,IAAI,CAAC,YAAA,EAAc;AACf,QAAA,MAAM,WAAA,GAAcC,kBAAA,CAAU,IAAA,CAAqBC,cAAU,CAAA;AAC7D,QAAA,YAAA,GAAe,WAAA,EAAa,sBAAsB,aAAa,CAAA;AAAA,MACnE;AAEA,MAAA,IAAI,cAAc,IAAA,EAAM;AACpB,QAAA,aAAA,GAAgBC,0BAAA,CAAkB,WAAA,CAAY,YAAA,CAAa,IAAI,CAAA;AAAA,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AA,CAAA;AAAA,EACjB,qCAASF,gBAAQ,CAAA,CAAA;AAAA,EACjB,qCAASC,qBAAiB,CAAA;AAAA,CAAA,EApEtBT,eAAA,CA+DH,SAAA,EAAA,UAAA,EAAA,CAAA,CAAA;AA/DGA,eAAA,GAAN,eAAA,CAAA;AAAA,EAJNW,aAAQ,MAAA,CAAO;AAAA,IACZ,SAAA,EAAW,YAAA;AAAA,IACX,WAAA,EAAa;AAAA,GAChB;AAAA,CAAA,EACYX,eAAA,CAAA","file":"AreRoot.component.js","sourcesContent":["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, AreRoute } from \"@adaas/are\";\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 — leave the existing template content intact\n if (signalsContext && !signalsContext.hasRoot(rootId)) {\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 the 'default' attribute on the node directly.\n // Note: root.attributes is NOT populated at this stage because tokenize()\n // runs after template() in the lifecycle. Read from raw markup instead.\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. Please ensure a route condition or \"default\" attribute is set.');\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 // 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 if (!componentName) {\n logger.warning('No component found for rendering in AreRoot. Please ensure that the signal vector matches at least one component or that a default component name is provided in the store.');\n return;\n }\n\n root.setContent(`<${componentName}></${componentName}>`);\n\n for (let i = 0; i < root.children.length; i++) {\n const child = root.children[i];\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"]}
@@ -34,8 +34,8 @@ let AreRoot = class extends Are {
34
34
  }
35
35
  }
36
36
  if (!componentName) {
37
- const defaultAttr = root.attributes.find((attr) => attr.name === "default");
38
- componentName = defaultAttr?.content;
37
+ const defaultMatch = root.markup?.match(/\bdefault=["']([^"']*)["']/);
38
+ componentName = defaultMatch?.[1];
39
39
  }
40
40
  if (!componentName) {
41
41
  logger.warning('AreRoot: No component found for initial render. Please ensure a route condition or "default" attribute is set.');
@@ -44,7 +44,6 @@ let AreRoot = class extends Are {
44
44
  root.setContent(`<${componentName}></${componentName}>`);
45
45
  }
46
46
  async onSignal(root, vector, store, logger, signalsContext) {
47
- console.log("Received signal vector in AreRoot:", root, vector);
48
47
  const rootId = root.id;
49
48
  if (signalsContext && !signalsContext.hasRoot(rootId)) {
50
49
  return;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/lib/AreRoot/AreRoot.component.ts"],"names":[],"mappings":";;;;;;;AAWO,IAAM,OAAA,GAAN,cAAsB,GAAA,CAAI;AAAA,EAA1B,WAAA,GAAA;AAAA,IAAA,KAAA,CAAA,GAAA,SAAA,CAAA;AAEH,IAAA,IAAA,CAAA,KAAA,GAA2C;AAAA,MACvC,OAAA,EAAS;AAAA,QACL,IAAA,EAAM,QAAA;AAAA,QACN,OAAA,EAAS;AAAA;AACb,KACJ;AAAA,EAAA;AAAA,EAIA,MAAM,QAAA,CACkB,IAAA,EACA,MAAA,EACS,cAAA,EAC/B;AAEE,IAAA,MAAM,SAAS,IAAA,CAAK,EAAA;AAGpB,IAAA,IAAI,cAAA,IAAkB,CAAC,cAAA,CAAe,OAAA,CAAQ,MAAM,CAAA,EAAG;AACnD,MAAA;AAAA,IACJ;AAEA,IAAA,MAAM,YAAA,GAAe,SAAS,OAAA,EAAQ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;AACvB,MAAA,IAAI,eAAe,OAAA,EAAS;AACxB,QAAA,MAAM,GAAA;AAAA,MACV;AACA,MAAA,KAAA,CAAM,SAAA,EAAU;AAEhB,MAAA,KAAA,CAAM,OAAA,EAAQ;AACd,MAAA,KAAA,CAAM,KAAA,EAAM;AAAA,IAChB;AAAA,EACJ;AACJ;AA9GU,eAAA,CAAA;AAAA,EADL,GAAA,CAAI,QAAA;AAAA,EAEA,4BAAS,QAAQ,CAAA,CAAA;AAAA,EACjB,4BAAS,QAAQ,CAAA,CAAA;AAAA,EACjB,4BAAS,iBAAiB,CAAA;AAAA,CAAA,EAdtB,OAAA,CAWH,SAAA,EAAA,UAAA,EAAA,CAAA,CAAA;AAmDA,eAAA,CAAA;AAAA,EADL,GAAA,CAAI,MAAA;AAAA,EAEA,4BAAS,QAAQ,CAAA,CAAA;AAAA,EACjB,4BAAS,cAAc,CAAA,CAAA;AAAA,EACvB,4BAAS,QAAQ,CAAA,CAAA;AAAA,EACjB,4BAAS,QAAQ,CAAA,CAAA;AAAA,EACjB,4BAAS,iBAAiB,CAAA;AAAA,CAAA,EAnEtB,OAAA,CA8DH,SAAA,EAAA,UAAA,EAAA,CAAA,CAAA;AA9DG,OAAA,GAAN,eAAA,CAAA;AAAA,EAJN,QAAQ,MAAA,CAAO;AAAA,IACZ,SAAA,EAAW,YAAA;AAAA,IACX,WAAA,EAAa;AAAA,GAChB;AAAA,CAAA,EACY,OAAA,CAAA","file":"AreRoot.component.mjs","sourcesContent":["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, AreRoute } from \"@adaas/are\";\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 — leave the existing template content intact\n if (signalsContext && !signalsContext.hasRoot(rootId)) {\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 the 'default' attribute on the node directly\n // (store props are not yet compiled at template phase)\n if (!componentName) {\n const defaultAttr = root.attributes.find(attr => attr.name === 'default');\n componentName = defaultAttr?.content;\n }\n\n if (!componentName) {\n logger.warning('AreRoot: No component found for initial render. Please ensure a route condition or \"default\" attribute is set.');\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 console.log('Received signal vector in AreRoot:', root, vector);\n\n const rootId = root.id;\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 if (!componentName) {\n logger.warning('No component found for rendering in AreRoot. Please ensure that the signal vector matches at least one component or that a default component name is provided in the store.');\n return;\n }\n\n root.setContent(`<${componentName}></${componentName}>`);\n\n for (let i = 0; i < root.children.length; i++) {\n const child = root.children[i];\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"]}
1
+ {"version":3,"sources":["../../../../src/lib/AreRoot/AreRoot.component.ts"],"names":[],"mappings":";;;;;;;AAWO,IAAM,OAAA,GAAN,cAAsB,GAAA,CAAI;AAAA,EAA1B,WAAA,GAAA;AAAA,IAAA,KAAA,CAAA,GAAA,SAAA,CAAA;AAEH,IAAA,IAAA,CAAA,KAAA,GAA2C;AAAA,MACvC,OAAA,EAAS;AAAA,QACL,IAAA,EAAM,QAAA;AAAA,QACN,OAAA,EAAS;AAAA;AACb,KACJ;AAAA,EAAA;AAAA,EAIA,MAAM,QAAA,CACkB,IAAA,EACA,MAAA,EACS,cAAA,EAC/B;AAEE,IAAA,MAAM,SAAS,IAAA,CAAK,EAAA;AAGpB,IAAA,IAAI,cAAA,IAAkB,CAAC,cAAA,CAAe,OAAA,CAAQ,MAAM,CAAA,EAAG;AACnD,MAAA;AAAA,IACJ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,MAAM,GAAA;AAAA,MACV;AACA,MAAA,KAAA,CAAM,SAAA,EAAU;AAEhB,MAAA,KAAA,CAAM,OAAA,EAAQ;AACd,MAAA,KAAA,CAAM,KAAA,EAAM;AAAA,IAChB;AAAA,EACJ;AACJ;AA7GU,eAAA,CAAA;AAAA,EADL,GAAA,CAAI,QAAA;AAAA,EAEA,4BAAS,QAAQ,CAAA,CAAA;AAAA,EACjB,4BAAS,QAAQ,CAAA,CAAA;AAAA,EACjB,4BAAS,iBAAiB,CAAA;AAAA,CAAA,EAdtB,OAAA,CAWH,SAAA,EAAA,UAAA,EAAA,CAAA,CAAA;AAoDA,eAAA,CAAA;AAAA,EADL,GAAA,CAAI,MAAA;AAAA,EAEA,4BAAS,QAAQ,CAAA,CAAA;AAAA,EACjB,4BAAS,cAAc,CAAA,CAAA;AAAA,EACvB,4BAAS,QAAQ,CAAA,CAAA;AAAA,EACjB,4BAAS,QAAQ,CAAA,CAAA;AAAA,EACjB,4BAAS,iBAAiB,CAAA;AAAA,CAAA,EApEtB,OAAA,CA+DH,SAAA,EAAA,UAAA,EAAA,CAAA,CAAA;AA/DG,OAAA,GAAN,eAAA,CAAA;AAAA,EAJN,QAAQ,MAAA,CAAO;AAAA,IACZ,SAAA,EAAW,YAAA;AAAA,IACX,WAAA,EAAa;AAAA,GAChB;AAAA,CAAA,EACY,OAAA,CAAA","file":"AreRoot.component.mjs","sourcesContent":["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, AreRoute } from \"@adaas/are\";\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 — leave the existing template content intact\n if (signalsContext && !signalsContext.hasRoot(rootId)) {\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 the 'default' attribute on the node directly.\n // Note: root.attributes is NOT populated at this stage because tokenize()\n // runs after template() in the lifecycle. Read from raw markup instead.\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. Please ensure a route condition or \"default\" attribute is set.');\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 // 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 if (!componentName) {\n logger.warning('No component found for rendering in AreRoot. Please ensure that the signal vector matches at least one component or that a default component name is provided in the store.');\n return;\n }\n\n root.setContent(`<${componentName}></${componentName}>`);\n\n for (let i = 0; i < root.children.length; i++) {\n const child = root.children[i];\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"]}
@@ -1,6 +1,6 @@
1
1
  import { A_Component } from '@adaas/a-concept';
2
2
 
3
- declare class AreWatcher extends A_Component {
3
+ declare class AreRouteWatcher extends A_Component {
4
4
  private readonly handlers;
5
5
  private current;
6
6
  constructor();
@@ -15,4 +15,4 @@ declare class AreWatcher extends A_Component {
15
15
  private notify;
16
16
  }
17
17
 
18
- export { AreWatcher };
18
+ export { AreRouteWatcher };
@@ -1,6 +1,6 @@
1
1
  import { A_Component } from '@adaas/a-concept';
2
2
 
3
- declare class AreWatcher extends A_Component {
3
+ declare class AreRouteWatcher extends A_Component {
4
4
  private readonly handlers;
5
5
  private current;
6
6
  constructor();
@@ -15,4 +15,4 @@ declare class AreWatcher extends A_Component {
15
15
  private notify;
16
16
  }
17
17
 
18
- export { AreWatcher };
18
+ export { AreRouteWatcher };
@@ -11,7 +11,7 @@ var __decorateClass = (decorators, target, key, kind) => {
11
11
  result = (decorator(result)) || result;
12
12
  return result;
13
13
  };
14
- exports.AreWatcher = class AreWatcher extends aConcept.A_Component {
14
+ exports.AreRouteWatcher = class AreRouteWatcher extends aConcept.A_Component {
15
15
  constructor() {
16
16
  super();
17
17
  this.handlers = /* @__PURE__ */ new Set();
@@ -67,11 +67,11 @@ exports.AreWatcher = class AreWatcher extends aConcept.A_Component {
67
67
  }
68
68
  }
69
69
  };
70
- exports.AreWatcher = __decorateClass([
70
+ exports.AreRouteWatcher = __decorateClass([
71
71
  core.A_Frame.Define({
72
72
  namespace: "a-are-html",
73
- description: "AreWatcher 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."
73
+ 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."
74
74
  })
75
- ], exports.AreWatcher);
76
- //# sourceMappingURL=AreWatcher.component.js.map
77
- //# sourceMappingURL=AreWatcher.component.js.map
75
+ ], exports.AreRouteWatcher);
76
+ //# sourceMappingURL=AreRouteWatcher.component.js.map
77
+ //# sourceMappingURL=AreRouteWatcher.component.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/lib/AreRouteWatcher/AreRouteWatcher.component.ts"],"names":["AreRouteWatcher","A_Component","A_Frame"],"mappings":";;;;;;;;;;;;;AAOaA,uBAAA,GAAN,8BAA8BC,oBAAA,CAAY;AAAA,EAK7C,WAAA,GAAc;AACV,IAAA,KAAA,EAAM;AAJV,IAAA,IAAA,CAAiB,QAAA,uBAAwC,GAAA,EAAI;AAC7D,IAAA,IAAA,CAAQ,OAAA,GAAe,IAAI,GAAA,CAAI,MAAA,CAAO,SAAS,IAAI,CAAA;AA4BnD;AAAA,IAAA,IAAA,CAAQ,aAAa,MAAY;AAC7B,MAAA,IAAA,CAAK,MAAA,EAAO;AAAA,IAChB,CAAA;AAEA,IAAA,IAAA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I,CAAA;AACzB,MAAA,MAAA,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;AA3EaD,uBAAA,GAAN,eAAA,CAAA;AAAA,EAJNE,aAAQ,MAAA,CAAO;AAAA,IACZ,SAAA,EAAW,YAAA;AAAA,IACX,WAAA,EAAa;AAAA,GAChB;AAAA,CAAA,EACYF,uBAAA,CAAA","file":"AreRouteWatcher.component.js","sourcesContent":["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}"]}
@@ -2,7 +2,7 @@ import { __decorateClass } from '../../chunk-EQQGB2QZ.mjs';
2
2
  import { A_Component } from '@adaas/a-concept';
3
3
  import { A_Frame } from '@adaas/a-frame/core';
4
4
 
5
- let AreWatcher = class extends A_Component {
5
+ let AreRouteWatcher = class extends A_Component {
6
6
  constructor() {
7
7
  super();
8
8
  this.handlers = /* @__PURE__ */ new Set();
@@ -58,13 +58,13 @@ let AreWatcher = class extends A_Component {
58
58
  }
59
59
  }
60
60
  };
61
- AreWatcher = __decorateClass([
61
+ AreRouteWatcher = __decorateClass([
62
62
  A_Frame.Define({
63
63
  namespace: "a-are-html",
64
- description: "AreWatcher 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."
64
+ 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."
65
65
  })
66
- ], AreWatcher);
66
+ ], AreRouteWatcher);
67
67
 
68
- export { AreWatcher };
69
- //# sourceMappingURL=AreWatcher.component.mjs.map
70
- //# sourceMappingURL=AreWatcher.component.mjs.map
68
+ export { AreRouteWatcher };
69
+ //# sourceMappingURL=AreRouteWatcher.component.mjs.map
70
+ //# sourceMappingURL=AreRouteWatcher.component.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/lib/AreRouteWatcher/AreRouteWatcher.component.ts"],"names":[],"mappings":";;;;AAOO,IAAM,eAAA,GAAN,cAA8B,WAAA,CAAY;AAAA,EAK7C,WAAA,GAAc;AACV,IAAA,KAAA,EAAM;AAJV,IAAA,IAAA,CAAiB,QAAA,uBAAwC,GAAA,EAAI;AAC7D,IAAA,IAAA,CAAQ,OAAA,GAAe,IAAI,GAAA,CAAI,MAAA,CAAO,SAAS,IAAI,CAAA;AA4BnD;AAAA,IAAA,IAAA,CAAQ,aAAa,MAAY;AAC7B,MAAA,IAAA,CAAK,MAAA,EAAO;AAAA,IAChB,CAAA;AAEA,IAAA,IAAA,CAAQ,eAAe,MAAY;AAC/B,MAAA,IAAA,CAAK,MAAA,EAAO;AAAA,IAChB,CAAA;AAEA,IAAA,IAAA,CAAQ,cAAc,MAAY;AAC9B,MAAA,IAAA,CAAK,MAAA,EAAO;AAAA,IAChB,CAAA;AAlCI,IAAA,IAAA,CAAK,YAAA,EAAa;AAClB,IAAA,IAAA,CAAK,eAAA,EAAgB;AAAA,EACzB;AAAA;AAAA,EAIA,SAAS,OAAA,EAAyC;AAC9C,IAAA,IAAA,CAAK,QAAA,CAAS,IAAI,OAAO,CAAA;AACzB,IAAA,OAAO,MAAM,IAAA,CAAK,QAAA,CAAS,MAAA,CAAO,OAAO,CAAA;AAAA,EAC7C;AAAA,EAEA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AA,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,EAJN,QAAQ,MAAA,CAAO;AAAA,IACZ,SAAA,EAAW,YAAA;AAAA,IACX,WAAA,EAAa;AAAA,GAChB;AAAA,CAAA,EACY,eAAA,CAAA","file":"AreRouteWatcher.component.mjs","sourcesContent":["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}"]}
@@ -31,7 +31,7 @@ exports.AreRoute = class AreRoute extends are.AreSignal {
31
31
  exports.AreRoute = __decorateClass([
32
32
  core.A_Frame.Define({
33
33
  namespace: "a-are-html",
34
- description: "ARE signal that carries an A_Route value. Dispatched by AreWatcher 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."
34
+ 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."
35
35
  })
36
36
  ], exports.AreRoute);
37
37
  //# sourceMappingURL=AreRoute.signal.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/signals/AreRoute.signal.ts"],"names":["AreRoute","AreSignal","A_Route","A_Frame"],"mappings":";;;;;;;;;;;;;;AAWaA,gBAAA,GAAN,uBAAuBC,aAAA,CAAmB;AAAA,EAE7C,YAAY,IAAA,EAAuB;AAC/B,IAAA,KAAA,CAAM;AAAA,MACF,IAAA,EAAM,IAAIC,cAAA,CAAQ,IAAI;AAAA,KACzB,CAAA;AAAA,EACL;AAAA,EAEA,IAAI,KAAA,GAAiB;AACjB,IAAA,OAAO,IAAA,CAAK,IAAA;AAAA,EAChB;AAAA,EAEA,OAAO,OAAA,GAAgC;AACnC,IAAA,OAAO,IAAIF,gBAAA,CAAS,QAAA,CAAS,QAAA,CAAS,YAAY,GAAG,CAAA;AAAA,EACzD;AAAA,EAGA,QAAQ,KAAA,EAAmC;AACvC,IAAA,OAAO,IAAA,CAAK,MAAM,QAAA,EAAS,CAAE,KAAK,KAAA,CAAM,IAAA,CAAK,UAAU,CAAA;AAAA,EAC3D;AACJ;AApBaA,gBAAA,GAAN,eAAA,CAAA;AAAA,EAJNG,aAAQ,MAAA,CAAO;AAAA,IACZ,SAAA,EAAW,YAAA;AAAA,IACX,WAAA,EAAa;AAAA,GAChB;AAAA,CAAA,EACYH,gBAAA,CAAA","file":"AreRoute.signal.js","sourcesContent":["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 AreWatcher 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}"]}
1
+ {"version":3,"sources":["../../../src/signals/AreRoute.signal.ts"],"names":["AreRoute","AreSignal","A_Route","A_Frame"],"mappings":";;;;;;;;;;;;;;AAWaA,gBAAA,GAAN,uBAAuBC,aAAA,CAAmB;AAAA,EAE7C,YAAY,IAAA,EAAuB;AAC/B,IAAA,KAAA,CAAM;AAAA,MACF,IAAA,EAAM,IAAIC,cAAA,CAAQ,IAAI;AAAA,KACzB,CAAA;AAAA,EACL;AAAA,EAEA,IAAI,KAAA,GAAiB;AACjB,IAAA,OAAO,IAAA,CAAK,IAAA;AAAA,EAChB;AAAA,EAEA,OAAO,OAAA,GAAgC;AACnC,IAAA,OAAO,IAAIF,gBAAA,CAAS,QAAA,CAAS,QAAA,CAAS,YAAY,GAAG,CAAA;AAAA,EACzD;AAAA,EAGA,QAAQ,KAAA,EAAmC;AACvC,IAAA,OAAO,IAAA,CAAK,MAAM,QAAA,EAAS,CAAE,KAAK,KAAA,CAAM,IAAA,CAAK,UAAU,CAAA;AAAA,EAC3D;AACJ;AApBaA,gBAAA,GAAN,eAAA,CAAA;AAAA,EAJNG,aAAQ,MAAA,CAAO;AAAA,IACZ,SAAA,EAAW,YAAA;AAAA,IACX,WAAA,EAAa;AAAA,GAChB;AAAA,CAAA,EACYH,gBAAA,CAAA","file":"AreRoute.signal.js","sourcesContent":["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}"]}
@@ -22,7 +22,7 @@ let AreRoute = class extends AreSignal {
22
22
  AreRoute = __decorateClass([
23
23
  A_Frame.Define({
24
24
  namespace: "a-are-html",
25
- description: "ARE signal that carries an A_Route value. Dispatched by AreWatcher 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."
25
+ 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."
26
26
  })
27
27
  ], AreRoute);
28
28
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/signals/AreRoute.signal.ts"],"names":[],"mappings":";;;;;AAWO,IAAM,QAAA,GAAN,cAAuB,SAAA,CAAmB;AAAA,EAE7C,YAAY,IAAA,EAAuB;AAC/B,IAAA,KAAA,CAAM;AAAA,MACF,IAAA,EAAM,IAAI,OAAA,CAAQ,IAAI;AAAA,KACzB,CAAA;AAAA,EACL;AAAA,EAEA,IAAI,KAAA,GAAiB;AACjB,IAAA,OAAO,IAAA,CAAK,IAAA;AAAA,EAChB;AAAA,EAEA,OAAO,OAAA,GAAgC;AACnC,IAAA,OAAO,IAAI,QAAA,CAAS,QAAA,CAAS,QAAA,CAAS,YAAY,GAAG,CAAA;AAAA,EACzD;AAAA,EAGA,QAAQ,KAAA,EAAmC;AACvC,IAAA,OAAO,IAAA,CAAK,MAAM,QAAA,EAAS,CAAE,KAAK,KAAA,CAAM,IAAA,CAAK,UAAU,CAAA;AAAA,EAC3D;AACJ;AApBa,QAAA,GAAN,eAAA,CAAA;AAAA,EAJN,QAAQ,MAAA,CAAO;AAAA,IACZ,SAAA,EAAW,YAAA;AAAA,IACX,WAAA,EAAa;AAAA,GAChB;AAAA,CAAA,EACY,QAAA,CAAA","file":"AreRoute.signal.mjs","sourcesContent":["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 AreWatcher 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}"]}
1
+ {"version":3,"sources":["../../../src/signals/AreRoute.signal.ts"],"names":[],"mappings":";;;;;AAWO,IAAM,QAAA,GAAN,cAAuB,SAAA,CAAmB;AAAA,EAE7C,YAAY,IAAA,EAAuB;AAC/B,IAAA,KAAA,CAAM;AAAA,MACF,IAAA,EAAM,IAAI,OAAA,CAAQ,IAAI;AAAA,KACzB,CAAA;AAAA,EACL;AAAA,EAEA,IAAI,KAAA,GAAiB;AACjB,IAAA,OAAO,IAAA,CAAK,IAAA;AAAA,EAChB;AAAA,EAEA,OAAO,OAAA,GAAgC;AACnC,IAAA,OAAO,IAAI,QAAA,CAAS,QAAA,CAAS,QAAA,CAAS,YAAY,GAAG,CAAA;AAAA,EACzD;AAAA,EAGA,QAAQ,KAAA,EAAmC;AACvC,IAAA,OAAO,IAAA,CAAK,MAAM,QAAA,EAAS,CAAE,KAAK,KAAA,CAAM,IAAA,CAAK,UAAU,CAAA;AAAA,EAC3D;AACJ;AApBa,QAAA,GAAN,eAAA,CAAA;AAAA,EAJN,QAAQ,MAAA,CAAO;AAAA,IACZ,SAAA,EAAW,YAAA;AAAA,IACX,WAAA,EAAa;AAAA,GAChB;AAAA,CAAA,EACY,QAAA,CAAA","file":"AreRoute.signal.mjs","sourcesContent":["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}"]}
@@ -16,7 +16,7 @@
16
16
  <dashboard-app></dashboard-app>
17
17
  </are-root>
18
18
 
19
- <script type="module" src="./mpioi5ab-8c3oa9.js"></script>
19
+ <script type="module" src="./mpm5e2oi-ghokyu.js"></script>
20
20
  </body>
21
21
 
22
22
  </html>
@@ -13537,8 +13537,8 @@ var AreRoot = class extends Are {
13537
13537
  }
13538
13538
  }
13539
13539
  if (!componentName) {
13540
- const defaultAttr = root.attributes.find((attr) => attr.name === "default");
13541
- componentName = defaultAttr?.content;
13540
+ const defaultMatch = root.markup?.match(/\bdefault=["']([^"']*)["']/);
13541
+ componentName = defaultMatch?.[1];
13542
13542
  }
13543
13543
  if (!componentName) {
13544
13544
  logger.warning('AreRoot: No component found for initial render. Please ensure a route condition or "default" attribute is set.');
@@ -8998,7 +8998,7 @@ AreEngine = __decorateClass3([
8998
8998
  })
8999
8999
  ], AreEngine);
9000
9000
  var _a109;
9001
- var AreWatcher = (_a109 = class extends v {
9001
+ var AreRouteWatcher = (_a109 = class extends v {
9002
9002
  /**
9003
9003
  * Initialize the watcher. This method is called once when the watcher is first created. Use this to set up any necessary state or start observing changes.
9004
9004
  */
@@ -9011,17 +9011,17 @@ var AreWatcher = (_a109 = class extends v {
9011
9011
  }
9012
9012
  destroy() {
9013
9013
  }
9014
- }, __name(_a109, "AreWatcher"), _a109);
9014
+ }, __name(_a109, "AreRouteWatcher"), _a109);
9015
9015
  __decorateClass3([
9016
9016
  Ce.Stop()
9017
- ], AreWatcher.prototype, "destroy", 1);
9018
- AreWatcher = __decorateClass3([
9017
+ ], AreRouteWatcher.prototype, "destroy", 1);
9018
+ AreRouteWatcher = __decorateClass3([
9019
9019
  c2.Component({
9020
9020
  namespace: "A-ARE",
9021
- name: "AreWatcher",
9022
- description: "AreWatcher is a component that observes changes and produces A_Signals Depending on the actual handlers"
9021
+ name: "AreRouteWatcher",
9022
+ description: "AreRouteWatcher is a component that observes changes and produces A_Signals Depending on the actual handlers"
9023
9023
  })
9024
- ], AreWatcher);
9024
+ ], AreRouteWatcher);
9025
9025
  var _a110;
9026
9026
  var _a111;
9027
9027
  var AreContainer = (_a111 = class extends A_Service {
@@ -9060,7 +9060,7 @@ __decorateClass3([
9060
9060
  __decorateParam3(1, ke(AreContext)),
9061
9061
  __decorateParam3(2, F.All()),
9062
9062
  __decorateParam3(2, F.Flat()),
9063
- __decorateParam3(2, ke(AreWatcher)),
9063
+ __decorateParam3(2, ke(AreRouteWatcher)),
9064
9064
  __decorateParam3(3, ke(A_Logger))
9065
9065
  ], AreContainer.prototype, _a110, 1);
9066
9066
  var _a112;
@@ -8998,7 +8998,7 @@ AreEngine = __decorateClass3([
8998
8998
  })
8999
8999
  ], AreEngine);
9000
9000
  var _a109;
9001
- var AreWatcher = (_a109 = class extends v {
9001
+ var AreRouteWatcher = (_a109 = class extends v {
9002
9002
  /**
9003
9003
  * Initialize the watcher. This method is called once when the watcher is first created. Use this to set up any necessary state or start observing changes.
9004
9004
  */
@@ -9011,17 +9011,17 @@ var AreWatcher = (_a109 = class extends v {
9011
9011
  }
9012
9012
  destroy() {
9013
9013
  }
9014
- }, __name(_a109, "AreWatcher"), _a109);
9014
+ }, __name(_a109, "AreRouteWatcher"), _a109);
9015
9015
  __decorateClass3([
9016
9016
  Ce.Stop()
9017
- ], AreWatcher.prototype, "destroy", 1);
9018
- AreWatcher = __decorateClass3([
9017
+ ], AreRouteWatcher.prototype, "destroy", 1);
9018
+ AreRouteWatcher = __decorateClass3([
9019
9019
  c2.Component({
9020
9020
  namespace: "A-ARE",
9021
- name: "AreWatcher",
9022
- description: "AreWatcher is a component that observes changes and produces A_Signals Depending on the actual handlers"
9021
+ name: "AreRouteWatcher",
9022
+ description: "AreRouteWatcher is a component that observes changes and produces A_Signals Depending on the actual handlers"
9023
9023
  })
9024
- ], AreWatcher);
9024
+ ], AreRouteWatcher);
9025
9025
  var _a110;
9026
9026
  var _a111;
9027
9027
  var AreContainer = (_a111 = class extends A_Service {
@@ -9060,7 +9060,7 @@ __decorateClass3([
9060
9060
  __decorateParam3(1, ke(AreContext)),
9061
9061
  __decorateParam3(2, F.All()),
9062
9062
  __decorateParam3(2, F.Flat()),
9063
- __decorateParam3(2, ke(AreWatcher)),
9063
+ __decorateParam3(2, ke(AreRouteWatcher)),
9064
9064
  __decorateParam3(3, ke(A_Logger))
9065
9065
  ], AreContainer.prototype, _a110, 1);
9066
9066
  var _a112;
package/jest.config.ts CHANGED
@@ -29,7 +29,7 @@ const config: Config.InitialOptions = {
29
29
  "^@adaas/are/syntax/(.*)": "<rootDir>/node_modules/@adaas/are/dist/node/lib/AreSyntax/$1.js",
30
30
  "^@adaas/are/tokenizer/(.*)": "<rootDir>/node_modules/@adaas/are/dist/node/lib/AreTokenizer/$1.js",
31
31
  "^@adaas/are/transformer/(.*)": "<rootDir>/node_modules/@adaas/are/dist/node/lib/AreTransformer/$1.js",
32
- "^@adaas/are/watcher/(.*)": "<rootDir>/node_modules/@adaas/are/dist/node/lib/AreWatcher/$1.js",
32
+ "^@adaas/are/watcher/(.*)": "<rootDir>/node_modules/@adaas/are/dist/node/lib/AreRouteWatcher/$1.js",
33
33
 
34
34
  // ── @adaas/are-html internal path aliases (mirrors tsconfig.json paths) ──
35
35
  // Base ARE-HTML entities
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adaas/are-html",
3
- "version": "0.0.3",
3
+ "version": "0.0.5",
4
4
  "description": "A-Concept Rendering Engine (ARE) is a powerful rendering engine designed to work seamlessly with the A-Concept framework. This library provides an HTML engine implementation of ARE, enabling developers to create dynamic and interactive user interfaces for web applications using standard HTML syntax.",
5
5
  "keywords": [
6
6
  "a-concept",