@adaas/are-html 0.0.2 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/dist/browser/index.d.mts +88 -5
- package/dist/browser/index.mjs +542 -176
- package/dist/browser/index.mjs.map +1 -1
- package/dist/node/attributes/AreBinding.attribute.js +17 -4
- package/dist/node/attributes/AreBinding.attribute.js.map +1 -1
- package/dist/node/attributes/AreBinding.attribute.mjs +10 -3
- package/dist/node/attributes/AreBinding.attribute.mjs.map +1 -1
- package/dist/node/attributes/AreDirective.attribute.js +17 -4
- package/dist/node/attributes/AreDirective.attribute.js.map +1 -1
- package/dist/node/attributes/AreDirective.attribute.mjs +10 -3
- package/dist/node/attributes/AreDirective.attribute.mjs.map +1 -1
- package/dist/node/attributes/AreEvent.attribute.js +17 -4
- package/dist/node/attributes/AreEvent.attribute.js.map +1 -1
- package/dist/node/attributes/AreEvent.attribute.mjs +10 -3
- package/dist/node/attributes/AreEvent.attribute.mjs.map +1 -1
- package/dist/node/attributes/AreStatic.attribute.js +17 -4
- package/dist/node/attributes/AreStatic.attribute.js.map +1 -1
- package/dist/node/attributes/AreStatic.attribute.mjs +10 -3
- package/dist/node/attributes/AreStatic.attribute.mjs.map +1 -1
- package/dist/node/directives/AreDirectiveFor.directive.d.mts +8 -0
- package/dist/node/directives/AreDirectiveFor.directive.d.ts +8 -0
- package/dist/node/directives/AreDirectiveFor.directive.js +78 -33
- package/dist/node/directives/AreDirectiveFor.directive.js.map +1 -1
- package/dist/node/directives/AreDirectiveFor.directive.mjs +78 -33
- package/dist/node/directives/AreDirectiveFor.directive.mjs.map +1 -1
- package/dist/node/directives/AreDirectiveIf.directive.d.mts +18 -0
- package/dist/node/directives/AreDirectiveIf.directive.d.ts +18 -0
- package/dist/node/directives/AreDirectiveIf.directive.js +10 -3
- package/dist/node/directives/AreDirectiveIf.directive.js.map +1 -1
- package/dist/node/directives/AreDirectiveIf.directive.mjs +10 -3
- package/dist/node/directives/AreDirectiveIf.directive.mjs.map +1 -1
- package/dist/node/engine/AreHTML.compiler.d.mts +2 -2
- package/dist/node/engine/AreHTML.compiler.d.ts +2 -2
- package/dist/node/engine/AreHTML.compiler.js +57 -29
- package/dist/node/engine/AreHTML.compiler.js.map +1 -1
- package/dist/node/engine/AreHTML.compiler.mjs +58 -30
- package/dist/node/engine/AreHTML.compiler.mjs.map +1 -1
- package/dist/node/engine/AreHTML.constants.d.mts +53 -1
- package/dist/node/engine/AreHTML.constants.d.ts +53 -1
- package/dist/node/engine/AreHTML.constants.js +100 -0
- package/dist/node/engine/AreHTML.constants.js.map +1 -1
- package/dist/node/engine/AreHTML.constants.mjs +93 -0
- package/dist/node/engine/AreHTML.constants.mjs.map +1 -1
- package/dist/node/engine/AreHTML.context.d.mts +6 -2
- package/dist/node/engine/AreHTML.context.d.ts +6 -2
- package/dist/node/engine/AreHTML.context.js +42 -7
- package/dist/node/engine/AreHTML.context.js.map +1 -1
- package/dist/node/engine/AreHTML.context.mjs +35 -6
- package/dist/node/engine/AreHTML.context.mjs.map +1 -1
- package/dist/node/engine/AreHTML.engine.js +10 -7
- package/dist/node/engine/AreHTML.engine.js.map +1 -1
- package/dist/node/engine/AreHTML.engine.mjs +10 -7
- package/dist/node/engine/AreHTML.engine.mjs.map +1 -1
- package/dist/node/engine/AreHTML.interpreter.js +155 -43
- package/dist/node/engine/AreHTML.interpreter.js.map +1 -1
- package/dist/node/engine/AreHTML.interpreter.mjs +155 -43
- package/dist/node/engine/AreHTML.interpreter.mjs.map +1 -1
- package/dist/node/engine/AreHTML.lifecycle.js +17 -12
- package/dist/node/engine/AreHTML.lifecycle.js.map +1 -1
- package/dist/node/engine/AreHTML.lifecycle.mjs +9 -2
- package/dist/node/engine/AreHTML.lifecycle.mjs.map +1 -1
- package/dist/node/engine/AreHTML.tokenizer.js +14 -9
- package/dist/node/engine/AreHTML.tokenizer.js.map +1 -1
- package/dist/node/engine/AreHTML.tokenizer.mjs +10 -3
- package/dist/node/engine/AreHTML.tokenizer.mjs.map +1 -1
- package/dist/node/engine/AreHTML.transformer.js +13 -8
- package/dist/node/engine/AreHTML.transformer.js.map +1 -1
- package/dist/node/engine/AreHTML.transformer.mjs +9 -2
- package/dist/node/engine/AreHTML.transformer.mjs.map +1 -1
- package/dist/node/index.d.mts +2 -1
- package/dist/node/index.d.ts +2 -1
- package/dist/node/index.js +3 -3
- package/dist/node/index.mjs +1 -1
- package/dist/node/instructions/AddAttribute.instruction.js +3 -4
- package/dist/node/instructions/AddAttribute.instruction.js.map +1 -1
- package/dist/node/instructions/AddAttribute.instruction.mjs +3 -4
- package/dist/node/instructions/AddAttribute.instruction.mjs.map +1 -1
- package/dist/node/instructions/AddComment.instruction.js +3 -4
- package/dist/node/instructions/AddComment.instruction.js.map +1 -1
- package/dist/node/instructions/AddComment.instruction.mjs +3 -4
- package/dist/node/instructions/AddComment.instruction.mjs.map +1 -1
- package/dist/node/instructions/AddElement.instruction.js +3 -4
- package/dist/node/instructions/AddElement.instruction.js.map +1 -1
- package/dist/node/instructions/AddElement.instruction.mjs +3 -4
- package/dist/node/instructions/AddElement.instruction.mjs.map +1 -1
- package/dist/node/instructions/AddInterpolation.instruction.js +3 -4
- package/dist/node/instructions/AddInterpolation.instruction.js.map +1 -1
- package/dist/node/instructions/AddInterpolation.instruction.mjs +3 -4
- package/dist/node/instructions/AddInterpolation.instruction.mjs.map +1 -1
- package/dist/node/instructions/AddListener.instruction.js +3 -4
- package/dist/node/instructions/AddListener.instruction.js.map +1 -1
- package/dist/node/instructions/AddListener.instruction.mjs +3 -4
- package/dist/node/instructions/AddListener.instruction.mjs.map +1 -1
- package/dist/node/instructions/AddStyle.instruction.js +3 -4
- package/dist/node/instructions/AddStyle.instruction.js.map +1 -1
- package/dist/node/instructions/AddStyle.instruction.mjs +3 -4
- package/dist/node/instructions/AddStyle.instruction.mjs.map +1 -1
- package/dist/node/instructions/AddText.instruction.js +3 -4
- package/dist/node/instructions/AddText.instruction.js.map +1 -1
- package/dist/node/instructions/AddText.instruction.mjs +3 -4
- package/dist/node/instructions/AddText.instruction.mjs.map +1 -1
- package/dist/node/lib/AreDirective/AreDirective.component.js +5 -0
- package/dist/node/lib/AreDirective/AreDirective.component.js.map +1 -1
- package/dist/node/lib/AreDirective/AreDirective.component.mjs +5 -0
- package/dist/node/lib/AreDirective/AreDirective.component.mjs.map +1 -1
- package/dist/node/lib/AreHTMLAttribute/AreHTML.attribute.js +17 -4
- package/dist/node/lib/AreHTMLAttribute/AreHTML.attribute.js.map +1 -1
- package/dist/node/lib/AreHTMLAttribute/AreHTML.attribute.mjs +10 -3
- package/dist/node/lib/AreHTMLAttribute/AreHTML.attribute.mjs.map +1 -1
- package/dist/node/lib/AreHTMLNode/AreHTMLNode.js +3 -4
- package/dist/node/lib/AreHTMLNode/AreHTMLNode.js.map +1 -1
- package/dist/node/lib/AreHTMLNode/AreHTMLNode.mjs +3 -4
- package/dist/node/lib/AreHTMLNode/AreHTMLNode.mjs.map +1 -1
- package/dist/node/lib/AreRoot/AreRoot.component.js +3 -4
- package/dist/node/lib/AreRoot/AreRoot.component.js.map +1 -1
- package/dist/node/lib/AreRoot/AreRoot.component.mjs +3 -4
- package/dist/node/lib/AreRoot/AreRoot.component.mjs.map +1 -1
- package/dist/node/lib/{AreWatcher/AreWatcher.component.d.mts → AreRouteWatcher/AreRouteWatcher.component.d.mts} +2 -2
- package/dist/node/lib/{AreWatcher/AreWatcher.component.d.ts → AreRouteWatcher/AreRouteWatcher.component.d.ts} +2 -2
- package/dist/node/lib/{AreWatcher/AreWatcher.component.js → AreRouteWatcher/AreRouteWatcher.component.js} +9 -10
- package/dist/node/lib/AreRouteWatcher/AreRouteWatcher.component.js.map +1 -0
- package/dist/node/lib/{AreWatcher/AreWatcher.component.mjs → AreRouteWatcher/AreRouteWatcher.component.mjs} +10 -11
- package/dist/node/lib/AreRouteWatcher/AreRouteWatcher.component.mjs.map +1 -0
- package/dist/node/lib/AreStyle/AreStyle.context.js +17 -4
- package/dist/node/lib/AreStyle/AreStyle.context.js.map +1 -1
- package/dist/node/lib/AreStyle/AreStyle.context.mjs +10 -3
- package/dist/node/lib/AreStyle/AreStyle.context.mjs.map +1 -1
- package/dist/node/nodes/AreComment.js +17 -4
- package/dist/node/nodes/AreComment.js.map +1 -1
- package/dist/node/nodes/AreComment.mjs +10 -3
- package/dist/node/nodes/AreComment.mjs.map +1 -1
- package/dist/node/nodes/AreComponent.js +3 -4
- package/dist/node/nodes/AreComponent.js.map +1 -1
- package/dist/node/nodes/AreComponent.mjs +3 -4
- package/dist/node/nodes/AreComponent.mjs.map +1 -1
- package/dist/node/nodes/AreInterpolation.js +17 -4
- package/dist/node/nodes/AreInterpolation.js.map +1 -1
- package/dist/node/nodes/AreInterpolation.mjs +10 -3
- package/dist/node/nodes/AreInterpolation.mjs.map +1 -1
- package/dist/node/nodes/AreRoot.js +3 -4
- package/dist/node/nodes/AreRoot.js.map +1 -1
- package/dist/node/nodes/AreRoot.mjs +3 -4
- package/dist/node/nodes/AreRoot.mjs.map +1 -1
- package/dist/node/nodes/AreText.js +17 -4
- package/dist/node/nodes/AreText.js.map +1 -1
- package/dist/node/nodes/AreText.mjs +10 -3
- package/dist/node/nodes/AreText.mjs.map +1 -1
- package/dist/node/signals/AreRoute.signal.js +18 -5
- package/dist/node/signals/AreRoute.signal.js.map +1 -1
- package/dist/node/signals/AreRoute.signal.mjs +10 -3
- package/dist/node/signals/AreRoute.signal.mjs.map +1 -1
- package/docs/SYNTAX.md +714 -0
- package/docs/arehtml.monaco.json +235 -0
- package/docs/arehtml.monaco.ts +119 -0
- package/examples/dashboard/dist/index.html +1 -1
- package/examples/dashboard/dist/mpioi5ab-8c3oa9.js +13674 -0
- package/examples/jumpstart/dist/index.html +1 -1
- package/examples/{dashboard/dist/mnzfypsd-6zjt7w.js → jumpstart/dist/mor90p6y-0plg7g.js} +1869 -1926
- package/examples/jumpstart/dist/{mnpl1g4i-nobz9g.js → mor90p7p-1898bz.js} +2797 -2282
- package/examples/jumpstart/src/components/List.component.ts +14 -13
- package/examples/jumpstart/src/concept.ts +5 -4
- package/jest.config.ts +1 -1
- package/package.json +10 -6
- package/src/attributes/AreBinding.attribute.ts +5 -0
- package/src/attributes/AreDirective.attribute.ts +5 -0
- package/src/attributes/AreEvent.attribute.ts +5 -0
- package/src/attributes/AreStatic.attribute.ts +5 -0
- package/src/directives/AreDirectiveFor.directive.ts +97 -60
- package/src/directives/AreDirectiveIf.directive.ts +37 -15
- package/src/engine/AreHTML.compiler.ts +64 -36
- package/src/engine/AreHTML.constants.ts +144 -0
- package/src/engine/AreHTML.context.ts +33 -4
- package/src/engine/AreHTML.engine.ts +12 -7
- package/src/engine/AreHTML.interpreter.ts +195 -68
- package/src/engine/AreHTML.lifecycle.ts +5 -0
- package/src/engine/AreHTML.tokenizer.ts +6 -1
- package/src/engine/AreHTML.transformer.ts +5 -0
- package/src/index.ts +2 -2
- package/src/instructions/AddAttribute.instruction.ts +3 -4
- package/src/instructions/AddComment.instruction.ts +3 -4
- package/src/instructions/AddElement.instruction.ts +3 -4
- package/src/instructions/AddInterpolation.instruction.ts +3 -4
- package/src/instructions/AddListener.instruction.ts +3 -4
- package/src/instructions/AddStyle.instruction.ts +3 -4
- package/src/instructions/AddText.instruction.ts +3 -4
- package/src/lib/AreDirective/AreDirective.component.ts +5 -0
- package/src/lib/AreHTMLAttribute/AreHTML.attribute.ts +5 -0
- package/src/lib/AreHTMLNode/AreHTMLNode.ts +3 -4
- package/src/lib/AreRoot/AreRoot.component.ts +3 -4
- package/src/lib/{AreWatcher/AreWatcher.component.ts → AreRouteWatcher/AreRouteWatcher.component.ts} +5 -6
- package/src/lib/AreStyle/AreStyle.context.ts +5 -0
- package/src/nodes/AreComment.ts +5 -0
- package/src/nodes/AreComponent.ts +3 -4
- package/src/nodes/AreInterpolation.ts +5 -0
- package/src/nodes/AreRoot.ts +3 -4
- package/src/nodes/AreText.ts +5 -0
- package/src/signals/AreRoute.signal.ts +5 -0
- package/dist/node/lib/AreWatcher/AreWatcher.component.js.map +0 -1
- package/dist/node/lib/AreWatcher/AreWatcher.component.mjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/lib/AreDirective/AreDirective.component.ts"],"names":["AreDirective","A_Component","A_Context","A_Feature","AreDirectiveFeatures","A_Logger","A_Caller","A_Meta","AreDirectiveMeta"],"mappings":";;;;;;;;;;;;;;;;;;AAQaA,oBAAA,GAAN,2BAA2BC,oBAAA,CAAa;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAW3C,OAAO,SAAS,QAAA,EAAkB;AAC9B,IAAA,OAAO,SACH,MAAA,EACO;AAEP,MAAA,MAAM,IAAA,GAAOC,kBAAA,CAAU,IAAA,CAAuB,MAAM,CAAA;AAEpD,MAAA,IAAA,CAAK,QAAA,GAAW,QAAA;AAEhB,MAAA,OAAO,MAAA;AAAA,IACX,CAAA;AAAA,EACJ;AAAA;AAAA;AAAA;AAAA,EAKA,WAAW,SAAA,GAAY;AACnB,IAAA,OAAO,CAAC,MAAA,EAAa,WAAA,EAAqB,UAAA,KAAmC;AACzE,MAAA,OAAOC,mBAAU,MAAA,CAAO;AAAA,QACpB,MAAMC,2CAAA,CAAqB,SAAA;AAAA,QAC3B,KAAA,EAAO,CAAC,MAAA,CAAO,WAAW;AAAA,OAC7B,CAAA,CAAE,MAAA,EAAQ,WAAA,EAAa,UAAU,CAAA;AAAA,IACtC,CAAA;AAAA,EACJ;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,WAAW,OAAA,GAAU;AACjB,IAAA,OAAO,CAAC,MAAA,EAAa,WAAA,EAAqB,UAAA,KAAmC;AACzE,MAAA,OAAOD,mBAAU,MAAA,CAAO;AAAA,QACpB,MAAMC,2CAAA,CAAqB,OAAA;AAAA,QAC3B,KAAA,EAAO,CAAC,MAAA,CAAO,WAAW;AAAA,OAC7B,CAAA,CAAE,MAAA,EAAQ,WA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AAA,uCAAA,EAA0C,SAAA,CAAU,IAAI,CAAA,eAAA,EAAkB,SAAA,CAAU,OAAO,CAAA,CAAE,CAAA;AAAA,IAChH;AAAA,EACJ;AACJ;AA/CI,eAAA,CAAA;AAAA,EACK,qCAASC,iBAAQ,CAAA;AAAA,CAAA,EArEbN,oBAAA,CAoET,SAAA,EAAA,WAAA,EAAA,CAAA,CAAA;AAmBA,eAAA,CAAA;AAAA,EAJCG,mBAAU,MAAA,CAAO;AAAA,IACd,MAAMC,2CAAA,CAAqB,OAAA;AAAA,IAC3B,KAAA,EAAO,CAACJ,oBAAY;AAAA,GACvB,CAAA;AAAA,EAEI,qCAASM,iBAAQ,CAAA;AAAA,CAAA,EAxFbN,oBAAA,CAuFT,SAAA,EAAA,SAAA,EAAA,CAAA,CAAA;AAmBA,eAAA,CAAA;AAAA,EAJCG,mBAAU,MAAA,CAAO;AAAA,IACd,MAAMC,2CAAA,CAAqB,MAAA;AAAA,IAC3B,KAAA,EAAO,CAACJ,oBAAY;AAAA,GACvB,CAAA;AAAA,EAEI,qCAASM,iBAAQ,CAAA;AAAA,CAAA,EA3GbN,oBAAA,CA0GT,SAAA,EAAA,QAAA,EAAA,CAAA,CAAA;AA1GSA,oBAAA,GAAN,eAAA,CAAA;AAAA,EADNO,eAAA,CAAO,OAAOC,kCAAgB;AAAA,CAAA,EAClBR,oBAAA,CAAA","file":"AreDirective.component.js","sourcesContent":["import { A_Caller, A_Component, A_Context, A_Feature, A_Inject, A_Meta, A_TYPES__Ctor } from \"@adaas/a-concept\";\nimport { A_Logger } from \"@adaas/a-utils/a-logger\";\nimport type { AreDirectiveAttribute } from \"@adaas/are-html/attributes/AreDirective.attribute\";\nimport { AreDirectiveMeta } from \"./AreDirective.meta\";\nimport { AreDirectiveFeatures } from \"./AreDirective.constants\";\n\n\n@A_Meta.Define(AreDirectiveMeta)\nexport class AreDirective extends A_Component {\n\n //==================================================================================\n //======================== LIFECYCLE DECORATORS ====================================\n //==================================================================================\n /**\n * Allows to define a compilation order for directives, which is necessary when we have multiple directives on the same node and we want to control the order of their compilation and application. The directive with the highest priority will be compiled and applied first, and the directive with the lowest priority will be compiled and applied last. This is important because some directives may depend on the output of other directives, so we need to ensure that they are compiled and applied in the correct order to avoid errors and ensure the expected behavior.\n * \n * @param priority \n * @returns \n */\n static Priority(priority: number) {\n return function <TTarget extends A_TYPES__Ctor<AreDirective>>(\n target: TTarget\n ): TTarget {\n // Store meta info on the target class itself for the Meta decorator to pick up\n const meta = A_Context.meta<AreDirectiveMeta>(target);\n\n meta.priority = priority;\n\n return target;\n };\n }\n\n /**\n * Allows to define a custom method for transforming the AreNode tree based on the directive attribute. This method is called during the transformation phase of the ARE component and should perform any necessary transformations on the AreNode tree based on the directive's content and context. This can include tasks such as adding or removing nodes, modifying node properties, or restructuring the tree to ensure that the directive is applied correctly during rendering.\n */\n static get Transform() {\n return (target: any, propertyKey: string, descriptor: PropertyDescriptor) => {\n return A_Feature.Extend({\n name: AreDirectiveFeatures.Transform,\n scope: [target.constructor],\n })(target, propertyKey, descriptor);\n }\n }\n\n /**\n * Allows to define a custom method for compiling a directive attribute into a set of SceneInstructions. \n * Can be used at any component to extend this logic not only for a AreDirective inherited.\n */\n static get Compile() {\n return (target: any, propertyKey: string, descriptor: PropertyDescriptor) => {\n return A_Feature.Extend({\n name: AreDirectiveFeatures.Compile,\n scope: [target.constructor],\n })(target, propertyKey, descriptor);\n }\n }\n\n /**\n * Allows to define a custom method for updating a directive attribute based on changes in the store or other dependencies.\n * Can be used at any component to extend this logic not only for a AreDirective inherited.\n */\n static get Update() {\n return (target: any, propertyKey: string, descriptor: PropertyDescriptor) => {\n return A_Feature.Extend({\n name: AreDirectiveFeatures.Update,\n scope: [target.constructor],\n })(target, propertyKey, descriptor);\n }\n }\n\n /**\n * Default transform method for directives, which can be overridden by specific directive implementations. This method is called during the transformation phase of the ARE component and should perform any necessary transformations on the AreNode tree based on the directive's content and context. This can include tasks such as adding or removing nodes, modifying node properties, or restructuring the tree to ensure that the directive is applied correctly during rendering.\n * \n * @param attribute - The directive attribute to transform, which contains all the information about the directive as defined in the template (e.g. name, raw content, evaluated value, etc.)\n * @param args - Additional arguments that may be required for the transformation process.\n */\n transform(\n @A_Inject(A_Caller) attribute: AreDirectiveAttribute,\n ...args: any[]\n ) {\n const logger = A_Context.scope(this).resolve(A_Logger) as A_Logger | undefined\n if (logger) {\n logger.warning(`No transforming logic defined for directive: ${attribute.name} with content: ${attribute.content}`);\n }\n }\n /**\n * Default compile method for directives, which can be overridden by specific directive implementations.\n * \n * @param attribute - The directive attribute to compile, which contains all the information about the directive as defined in the template (e.g. name, raw content, evaluated value, etc.)\n * @param args - Additional arguments that may be required for the compilation process.\n */\n @A_Feature.Extend({\n name: AreDirectiveFeatures.Compile,\n scope: [AreDirective],\n })\n compile(\n @A_Inject(A_Caller) attribute: AreDirectiveAttribute,\n ...args: any[]\n ) {\n const logger = A_Context.scope(this).resolve(A_Logger) as A_Logger | undefined\n if (logger) {\n logger.warning(`No compiling logic defined for directive: ${attribute.name} with content: ${attribute.content}`);\n }\n }\n /**\n * Default update method for directives, which can be overridden by specific directive implementations. This method is called when there are changes in the store or other dependencies that may affect the directive's behavior or appearance. The method should contain logic to update the directive accordingly, such as re-evaluating its value, modifying the DOM, or triggering re-rendering of the affected nodes.\n * \n * @param attribute - The directive attribute to update, which contains all the information about the directive as defined in the template (e.g. name, raw content, evaluated value, etc.)\n * @param args - Additional arguments that may be required for the update process.\n */\n @A_Feature.Extend({\n name: AreDirectiveFeatures.Update,\n scope: [AreDirective],\n })\n update(\n @A_Inject(A_Caller) attribute: AreDirectiveAttribute,\n ...args: any[]\n ) {\n const logger = A_Context.scope(this).resolve(A_Logger) as A_Logger | undefined\n if (logger) {\n logger.warning(`No update logic defined for directive: ${attribute.name} with content: ${attribute.content}`);\n }\n }\n}"]}
|
|
1
|
+
{"version":3,"sources":["../../../../src/lib/AreDirective/AreDirective.component.ts"],"names":["AreDirective","A_Component","A_Context","A_Feature","AreD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BAAA,CAoET,SAAA,EAAA,WAAA,EAAA,CAAA,CAAA;AAmBA,eAAA,CAAA;AAAA,EAJCG,mBAAU,MAAA,CAAO;AAAA,IACd,MAAMC,2CAAA,CAAqB,OAAA;AAAA,IAC3B,KAAA,EAAO,CAACJ,oBAAY;AAAA,GACvB,CAAA;AAAA,EAEI,qCAASM,iBAAQ,CAAA;AAAA,CAAA,EAxFbN,oBAAA,CAuFT,SAAA,EAAA,SAAA,EAAA,CAAA,CAAA;AAmBA,eAAA,CAAA;AAAA,EAJCG,mBAAU,MAAA,CAAO;AAAA,IACd,MAAMC,2CAAA,CAAqB,MAAA;AAAA,IAC3B,KAAA,EAAO,CAACJ,oBAAY;AAAA,GACvB,CAAA;AAAA,EAEI,qCAASM,iBAAQ,CAAA;AAAA,CAAA,EA3GbN,oBAAA,CA0GT,SAAA,EAAA,QAAA,EAAA,CAAA,CAAA;AA1GSA,oBAAA,GAAN,eAAA,CAAA;AAAA,EALNO,aAAQ,MAAA,CAAO;AAAA,IACZ,SAAA,EAAW,YAAA;AAAA,IACX,WAAA,EAAa;AAAA,GAChB,CAAA;AAAA,EACAC,eAAA,CAAO,OAAOC,kCAAgB;AAAA,CAAA,EAClBT,oBAAA,CAAA","file":"AreDirective.component.js","sourcesContent":["import { A_Caller, A_Component, A_Context, A_Feature, A_Inject, A_Meta, A_TYPES__Ctor } from \"@adaas/a-concept\";\nimport { A_Logger } from \"@adaas/a-utils/a-logger\";\nimport type { AreDirectiveAttribute } from \"@adaas/are-html/attributes/AreDirective.attribute\";\nimport { AreDirectiveMeta } from \"./AreDirective.meta\";\nimport { AreDirectiveFeatures } from \"./AreDirective.constants\";\nimport { A_Frame } from \"@adaas/a-frame/core\";\n\n\n@A_Frame.Define({\n namespace: 'a-are-html',\n description: 'Abstract base component for all ARE directive types. Provides lifecycle decorators (Transform, Compile, Apply, Revert, Priority) that subclasses hook into at each pipeline stage. Subclasses implement Transform to rewrite the attribute or template node, Compile to emit scene instructions, Apply to activate them in the DOM, and Revert to undo them on removal.'\n})\n@A_Meta.Define(AreDirectiveMeta)\nexport class AreDirective extends A_Component {\n\n //==================================================================================\n //======================== LIFECYCLE DECORATORS ====================================\n //==================================================================================\n /**\n * Allows to define a compilation order for directives, which is necessary when we have multiple directives on the same node and we want to control the order of their compilation and application. The directive with the highest priority will be compiled and applied first, and the directive with the lowest priority will be compiled and applied last. This is important because some directives may depend on the output of other directives, so we need to ensure that they are compiled and applied in the correct order to avoid errors and ensure the expected behavior.\n * \n * @param priority \n * @returns \n */\n static Priority(priority: number) {\n return function <TTarget extends A_TYPES__Ctor<AreDirective>>(\n target: TTarget\n ): TTarget {\n // Store meta info on the target class itself for the Meta decorator to pick up\n const meta = A_Context.meta<AreDirectiveMeta>(target);\n\n meta.priority = priority;\n\n return target;\n };\n }\n\n /**\n * Allows to define a custom method for transforming the AreNode tree based on the directive attribute. This method is called during the transformation phase of the ARE component and should perform any necessary transformations on the AreNode tree based on the directive's content and context. This can include tasks such as adding or removing nodes, modifying node properties, or restructuring the tree to ensure that the directive is applied correctly during rendering.\n */\n static get Transform() {\n return (target: any, propertyKey: string, descriptor: PropertyDescriptor) => {\n return A_Feature.Extend({\n name: AreDirectiveFeatures.Transform,\n scope: [target.constructor],\n })(target, propertyKey, descriptor);\n }\n }\n\n /**\n * Allows to define a custom method for compiling a directive attribute into a set of SceneInstructions. \n * Can be used at any component to extend this logic not only for a AreDirective inherited.\n */\n static get Compile() {\n return (target: any, propertyKey: string, descriptor: PropertyDescriptor) => {\n return A_Feature.Extend({\n name: AreDirectiveFeatures.Compile,\n scope: [target.constructor],\n })(target, propertyKey, descriptor);\n }\n }\n\n /**\n * Allows to define a custom method for updating a directive attribute based on changes in the store or other dependencies.\n * Can be used at any component to extend this logic not only for a AreDirective inherited.\n */\n static get Update() {\n return (target: any, propertyKey: string, descriptor: PropertyDescriptor) => {\n return A_Feature.Extend({\n name: AreDirectiveFeatures.Update,\n scope: [target.constructor],\n })(target, propertyKey, descriptor);\n }\n }\n\n /**\n * Default transform method for directives, which can be overridden by specific directive implementations. This method is called during the transformation phase of the ARE component and should perform any necessary transformations on the AreNode tree based on the directive's content and context. This can include tasks such as adding or removing nodes, modifying node properties, or restructuring the tree to ensure that the directive is applied correctly during rendering.\n * \n * @param attribute - The directive attribute to transform, which contains all the information about the directive as defined in the template (e.g. name, raw content, evaluated value, etc.)\n * @param args - Additional arguments that may be required for the transformation process.\n */\n transform(\n @A_Inject(A_Caller) attribute: AreDirectiveAttribute,\n ...args: any[]\n ) {\n const logger = A_Context.scope(this).resolve(A_Logger) as A_Logger | undefined\n if (logger) {\n logger.warning(`No transforming logic defined for directive: ${attribute.name} with content: ${attribute.content}`);\n }\n }\n /**\n * Default compile method for directives, which can be overridden by specific directive implementations.\n * \n * @param attribute - The directive attribute to compile, which contains all the information about the directive as defined in the template (e.g. name, raw content, evaluated value, etc.)\n * @param args - Additional arguments that may be required for the compilation process.\n */\n @A_Feature.Extend({\n name: AreDirectiveFeatures.Compile,\n scope: [AreDirective],\n })\n compile(\n @A_Inject(A_Caller) attribute: AreDirectiveAttribute,\n ...args: any[]\n ) {\n const logger = A_Context.scope(this).resolve(A_Logger) as A_Logger | undefined\n if (logger) {\n logger.warning(`No compiling logic defined for directive: ${attribute.name} with content: ${attribute.content}`);\n }\n }\n /**\n * Default update method for directives, which can be overridden by specific directive implementations. This method is called when there are changes in the store or other dependencies that may affect the directive's behavior or appearance. The method should contain logic to update the directive accordingly, such as re-evaluating its value, modifying the DOM, or triggering re-rendering of the affected nodes.\n * \n * @param attribute - The directive attribute to update, which contains all the information about the directive as defined in the template (e.g. name, raw content, evaluated value, etc.)\n * @param args - Additional arguments that may be required for the update process.\n */\n @A_Feature.Extend({\n name: AreDirectiveFeatures.Update,\n scope: [AreDirective],\n })\n update(\n @A_Inject(A_Caller) attribute: AreDirectiveAttribute,\n ...args: any[]\n ) {\n const logger = A_Context.scope(this).resolve(A_Logger) as A_Logger | undefined\n if (logger) {\n logger.warning(`No update logic defined for directive: ${attribute.name} with content: ${attribute.content}`);\n }\n }\n}"]}
|
|
@@ -3,6 +3,7 @@ import { A_Inject, A_Caller, A_Feature, A_Meta, A_Component, A_Context } from '@
|
|
|
3
3
|
import { A_Logger } from '@adaas/a-utils/a-logger';
|
|
4
4
|
import { AreDirectiveMeta } from './AreDirective.meta';
|
|
5
5
|
import { AreDirectiveFeatures } from './AreDirective.constants';
|
|
6
|
+
import { A_Frame } from '@adaas/a-frame/core';
|
|
6
7
|
|
|
7
8
|
let AreDirective = class extends A_Component {
|
|
8
9
|
//==================================================================================
|
|
@@ -99,6 +100,10 @@ __decorateClass([
|
|
|
99
100
|
__decorateParam(0, A_Inject(A_Caller))
|
|
100
101
|
], AreDirective.prototype, "update", 1);
|
|
101
102
|
AreDirective = __decorateClass([
|
|
103
|
+
A_Frame.Define({
|
|
104
|
+
namespace: "a-are-html",
|
|
105
|
+
description: "Abstract base component for all ARE directive types. Provides lifecycle decorators (Transform, Compile, Apply, Revert, Priority) that subclasses hook into at each pipeline stage. Subclasses implement Transform to rewrite the attribute or template node, Compile to emit scene instructions, Apply to activate them in the DOM, and Revert to undo them on removal."
|
|
106
|
+
}),
|
|
102
107
|
A_Meta.Define(AreDirectiveMeta)
|
|
103
108
|
], AreDirective);
|
|
104
109
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/lib/AreDirective/AreDirective.component.ts"],"names":[],"mappings":";;;;;;AAQO,IAAM,YAAA,GAAN,cAA2B,WAAA,CAAa;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAW3C,OAAO,SAAS,QAAA,EAAkB;AAC9B,IAAA,OAAO,SACH,MAAA,EACO;AAEP,MAAA,MAAM,IAAA,GAAO,SAAA,CAAU,IAAA,CAAuB,MAAM,CAAA;AAEpD,MAAA,IAAA,CAAK,QAAA,GAAW,QAAA;AAEhB,MAAA,OAAO,MAAA;AAAA,IACX,CAAA;AAAA,EACJ;AAAA;AAA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QAAQ,CAAA;AAAA,CAAA,EA3Gb,YAAA,CA0GT,SAAA,EAAA,QAAA,EAAA,CAAA,CAAA;AA1GS,YAAA,GAAN,eAAA,CAAA;AAAA,EADN,MAAA,CAAO,OAAO,gBAAgB;AAAA,CAAA,EAClB,YAAA,CAAA","file":"AreDirective.component.mjs","sourcesContent":["import { A_Caller, A_Component, A_Context, A_Feature, A_Inject, A_Meta, A_TYPES__Ctor } from \"@adaas/a-concept\";\nimport { A_Logger } from \"@adaas/a-utils/a-logger\";\nimport type { AreDirectiveAttribute } from \"@adaas/are-html/attributes/AreDirective.attribute\";\nimport { AreDirectiveMeta } from \"./AreDirective.meta\";\nimport { AreDirectiveFeatures } from \"./AreDirective.constants\";\n\n\n@A_Meta.Define(AreDirectiveMeta)\nexport class AreDirective extends A_Component {\n\n //==================================================================================\n //======================== LIFECYCLE DECORATORS ====================================\n //==================================================================================\n /**\n * Allows to define a compilation order for directives, which is necessary when we have multiple directives on the same node and we want to control the order of their compilation and application. The directive with the highest priority will be compiled and applied first, and the directive with the lowest priority will be compiled and applied last. This is important because some directives may depend on the output of other directives, so we need to ensure that they are compiled and applied in the correct order to avoid errors and ensure the expected behavior.\n * \n * @param priority \n * @returns \n */\n static Priority(priority: number) {\n return function <TTarget extends A_TYPES__Ctor<AreDirective>>(\n target: TTarget\n ): TTarget {\n // Store meta info on the target class itself for the Meta decorator to pick up\n const meta = A_Context.meta<AreDirectiveMeta>(target);\n\n meta.priority = priority;\n\n return target;\n };\n }\n\n /**\n * Allows to define a custom method for transforming the AreNode tree based on the directive attribute. This method is called during the transformation phase of the ARE component and should perform any necessary transformations on the AreNode tree based on the directive's content and context. This can include tasks such as adding or removing nodes, modifying node properties, or restructuring the tree to ensure that the directive is applied correctly during rendering.\n */\n static get Transform() {\n return (target: any, propertyKey: string, descriptor: PropertyDescriptor) => {\n return A_Feature.Extend({\n name: AreDirectiveFeatures.Transform,\n scope: [target.constructor],\n })(target, propertyKey, descriptor);\n }\n }\n\n /**\n * Allows to define a custom method for compiling a directive attribute into a set of SceneInstructions. \n * Can be used at any component to extend this logic not only for a AreDirective inherited.\n */\n static get Compile() {\n return (target: any, propertyKey: string, descriptor: PropertyDescriptor) => {\n return A_Feature.Extend({\n name: AreDirectiveFeatures.Compile,\n scope: [target.constructor],\n })(target, propertyKey, descriptor);\n }\n }\n\n /**\n * Allows to define a custom method for updating a directive attribute based on changes in the store or other dependencies.\n * Can be used at any component to extend this logic not only for a AreDirective inherited.\n */\n static get Update() {\n return (target: any, propertyKey: string, descriptor: PropertyDescriptor) => {\n return A_Feature.Extend({\n name: AreDirectiveFeatures.Update,\n scope: [target.constructor],\n })(target, propertyKey, descriptor);\n }\n }\n\n /**\n * Default transform method for directives, which can be overridden by specific directive implementations. This method is called during the transformation phase of the ARE component and should perform any necessary transformations on the AreNode tree based on the directive's content and context. This can include tasks such as adding or removing nodes, modifying node properties, or restructuring the tree to ensure that the directive is applied correctly during rendering.\n * \n * @param attribute - The directive attribute to transform, which contains all the information about the directive as defined in the template (e.g. name, raw content, evaluated value, etc.)\n * @param args - Additional arguments that may be required for the transformation process.\n */\n transform(\n @A_Inject(A_Caller) attribute: AreDirectiveAttribute,\n ...args: any[]\n ) {\n const logger = A_Context.scope(this).resolve(A_Logger) as A_Logger | undefined\n if (logger) {\n logger.warning(`No transforming logic defined for directive: ${attribute.name} with content: ${attribute.content}`);\n }\n }\n /**\n * Default compile method for directives, which can be overridden by specific directive implementations.\n * \n * @param attribute - The directive attribute to compile, which contains all the information about the directive as defined in the template (e.g. name, raw content, evaluated value, etc.)\n * @param args - Additional arguments that may be required for the compilation process.\n */\n @A_Feature.Extend({\n name: AreDirectiveFeatures.Compile,\n scope: [AreDirective],\n })\n compile(\n @A_Inject(A_Caller) attribute: AreDirectiveAttribute,\n ...args: any[]\n ) {\n const logger = A_Context.scope(this).resolve(A_Logger) as A_Logger | undefined\n if (logger) {\n logger.warning(`No compiling logic defined for directive: ${attribute.name} with content: ${attribute.content}`);\n }\n }\n /**\n * Default update method for directives, which can be overridden by specific directive implementations. This method is called when there are changes in the store or other dependencies that may affect the directive's behavior or appearance. The method should contain logic to update the directive accordingly, such as re-evaluating its value, modifying the DOM, or triggering re-rendering of the affected nodes.\n * \n * @param attribute - The directive attribute to update, which contains all the information about the directive as defined in the template (e.g. name, raw content, evaluated value, etc.)\n * @param args - Additional arguments that may be required for the update process.\n */\n @A_Feature.Extend({\n name: AreDirectiveFeatures.Update,\n scope: [AreDirective],\n })\n update(\n @A_Inject(A_Caller) attribute: AreDirectiveAttribute,\n ...args: any[]\n ) {\n const logger = A_Context.scope(this).resolve(A_Logger) as A_Logger | undefined\n if (logger) {\n logger.warning(`No update logic defined for directive: ${attribute.name} with content: ${attribute.content}`);\n }\n }\n}"]}
|
|
1
|
+
{"version":3,"sources":["../../../../src/lib/AreDirective/AreDirective.component.ts"],"names":[],"mappings":";;;;;;;AAaO,IAAM,YAAA,GAAN,cAA2B,WAAA,CAAa;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAW3C,OAAO,SAAS,QAAA,EAAkB;AAC9B,IAAA,OAAO,SACH,MAAA,EACO;AAEP,MAAA,MAAM,IAAA,GAAO,SAAA,CAAU,IAAA,CAAuB,MAAM,CAAA;AAEpD,MAAA,IAAA,CAAK,QAAA,GAAW,QAAA;AAEhB,MAAA,OAAO,MAAA;AAAA,IACX,CAAA;AAAA,EACJ;AAAA;AAAA;AAAA;AAAA,EAKA,WAAW,SAAA,GAAY;AACnB,IAAA,OAAO,CAAC,MAAA,EAAa,WAAA,EAAqB,UAAA,KAAmC;AACzE,MAAA,OAAO,UAAU,MAAA,CAAO;AAAA,QACpB,MAAM,oBAAA,CAAqB,SAAA;AAAA,QAC3B,KAAA,EAAO,CAAC,MAAA,CAAO,WAAW;AAAA,OAC7B,CAAA,CAAE,MAAA,EAAQ,WAAA,EAAa,UAAU,CAAA;AAAA,IACtC,CAAA;AAAA,EACJ;AAAA;AAAA;AAAA;AAA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A_Inject, A_Meta, A_TYPES__Ctor } from \"@adaas/a-concept\";\nimport { A_Logger } from \"@adaas/a-utils/a-logger\";\nimport type { AreDirectiveAttribute } from \"@adaas/are-html/attributes/AreDirective.attribute\";\nimport { AreDirectiveMeta } from \"./AreDirective.meta\";\nimport { AreDirectiveFeatures } from \"./AreDirective.constants\";\nimport { A_Frame } from \"@adaas/a-frame/core\";\n\n\n@A_Frame.Define({\n namespace: 'a-are-html',\n description: 'Abstract base component for all ARE directive types. Provides lifecycle decorators (Transform, Compile, Apply, Revert, Priority) that subclasses hook into at each pipeline stage. Subclasses implement Transform to rewrite the attribute or template node, Compile to emit scene instructions, Apply to activate them in the DOM, and Revert to undo them on removal.'\n})\n@A_Meta.Define(AreDirectiveMeta)\nexport class AreDirective extends A_Component {\n\n //==================================================================================\n //======================== LIFECYCLE DECORATORS ====================================\n //==================================================================================\n /**\n * Allows to define a compilation order for directives, which is necessary when we have multiple directives on the same node and we want to control the order of their compilation and application. The directive with the highest priority will be compiled and applied first, and the directive with the lowest priority will be compiled and applied last. This is important because some directives may depend on the output of other directives, so we need to ensure that they are compiled and applied in the correct order to avoid errors and ensure the expected behavior.\n * \n * @param priority \n * @returns \n */\n static Priority(priority: number) {\n return function <TTarget extends A_TYPES__Ctor<AreDirective>>(\n target: TTarget\n ): TTarget {\n // Store meta info on the target class itself for the Meta decorator to pick up\n const meta = A_Context.meta<AreDirectiveMeta>(target);\n\n meta.priority = priority;\n\n return target;\n };\n }\n\n /**\n * Allows to define a custom method for transforming the AreNode tree based on the directive attribute. This method is called during the transformation phase of the ARE component and should perform any necessary transformations on the AreNode tree based on the directive's content and context. This can include tasks such as adding or removing nodes, modifying node properties, or restructuring the tree to ensure that the directive is applied correctly during rendering.\n */\n static get Transform() {\n return (target: any, propertyKey: string, descriptor: PropertyDescriptor) => {\n return A_Feature.Extend({\n name: AreDirectiveFeatures.Transform,\n scope: [target.constructor],\n })(target, propertyKey, descriptor);\n }\n }\n\n /**\n * Allows to define a custom method for compiling a directive attribute into a set of SceneInstructions. \n * Can be used at any component to extend this logic not only for a AreDirective inherited.\n */\n static get Compile() {\n return (target: any, propertyKey: string, descriptor: PropertyDescriptor) => {\n return A_Feature.Extend({\n name: AreDirectiveFeatures.Compile,\n scope: [target.constructor],\n })(target, propertyKey, descriptor);\n }\n }\n\n /**\n * Allows to define a custom method for updating a directive attribute based on changes in the store or other dependencies.\n * Can be used at any component to extend this logic not only for a AreDirective inherited.\n */\n static get Update() {\n return (target: any, propertyKey: string, descriptor: PropertyDescriptor) => {\n return A_Feature.Extend({\n name: AreDirectiveFeatures.Update,\n scope: [target.constructor],\n })(target, propertyKey, descriptor);\n }\n }\n\n /**\n * Default transform method for directives, which can be overridden by specific directive implementations. This method is called during the transformation phase of the ARE component and should perform any necessary transformations on the AreNode tree based on the directive's content and context. This can include tasks such as adding or removing nodes, modifying node properties, or restructuring the tree to ensure that the directive is applied correctly during rendering.\n * \n * @param attribute - The directive attribute to transform, which contains all the information about the directive as defined in the template (e.g. name, raw content, evaluated value, etc.)\n * @param args - Additional arguments that may be required for the transformation process.\n */\n transform(\n @A_Inject(A_Caller) attribute: AreDirectiveAttribute,\n ...args: any[]\n ) {\n const logger = A_Context.scope(this).resolve(A_Logger) as A_Logger | undefined\n if (logger) {\n logger.warning(`No transforming logic defined for directive: ${attribute.name} with content: ${attribute.content}`);\n }\n }\n /**\n * Default compile method for directives, which can be overridden by specific directive implementations.\n * \n * @param attribute - The directive attribute to compile, which contains all the information about the directive as defined in the template (e.g. name, raw content, evaluated value, etc.)\n * @param args - Additional arguments that may be required for the compilation process.\n */\n @A_Feature.Extend({\n name: AreDirectiveFeatures.Compile,\n scope: [AreDirective],\n })\n compile(\n @A_Inject(A_Caller) attribute: AreDirectiveAttribute,\n ...args: any[]\n ) {\n const logger = A_Context.scope(this).resolve(A_Logger) as A_Logger | undefined\n if (logger) {\n logger.warning(`No compiling logic defined for directive: ${attribute.name} with content: ${attribute.content}`);\n }\n }\n /**\n * Default update method for directives, which can be overridden by specific directive implementations. This method is called when there are changes in the store or other dependencies that may affect the directive's behavior or appearance. The method should contain logic to update the directive accordingly, such as re-evaluating its value, modifying the DOM, or triggering re-rendering of the affected nodes.\n * \n * @param attribute - The directive attribute to update, which contains all the information about the directive as defined in the template (e.g. name, raw content, evaluated value, etc.)\n * @param args - Additional arguments that may be required for the update process.\n */\n @A_Feature.Extend({\n name: AreDirectiveFeatures.Update,\n scope: [AreDirective],\n })\n update(\n @A_Inject(A_Caller) attribute: AreDirectiveAttribute,\n ...args: any[]\n ) {\n const logger = A_Context.scope(this).resolve(A_Logger) as A_Logger | undefined\n if (logger) {\n logger.warning(`No update logic defined for directive: ${attribute.name} with content: ${attribute.content}`);\n }\n }\n}"]}
|
|
@@ -1,13 +1,26 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var are = require('@adaas/are');
|
|
4
|
+
var core = require('@adaas/a-frame/core');
|
|
4
5
|
|
|
5
|
-
|
|
6
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
7
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
8
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
9
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
10
|
+
if (decorator = decorators[i])
|
|
11
|
+
result = (decorator(result)) || result;
|
|
12
|
+
return result;
|
|
13
|
+
};
|
|
14
|
+
exports.AreHTMLAttribute = class AreHTMLAttribute extends are.AreAttribute {
|
|
6
15
|
get owner() {
|
|
7
16
|
return this.scope.issuer();
|
|
8
17
|
}
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
|
|
18
|
+
};
|
|
19
|
+
exports.AreHTMLAttribute = __decorateClass([
|
|
20
|
+
core.A_Frame.Define({
|
|
21
|
+
namespace: "a-are-html",
|
|
22
|
+
description: "Base class for all typed HTML attributes in the ARE framework. Provides typed access to the owning AreHTMLNode via the scope injector so that attribute subclasses can inspect host-node properties and resolve store bindings during transformation, compilation, and lifecycle phases."
|
|
23
|
+
})
|
|
24
|
+
], exports.AreHTMLAttribute);
|
|
12
25
|
//# sourceMappingURL=AreHTML.attribute.js.map
|
|
13
26
|
//# sourceMappingURL=AreHTML.attribute.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/lib/AreHTMLAttribute/AreHTML.attribute.ts"],"names":["AreAttribute"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../../src/lib/AreHTMLAttribute/AreHTML.attribute.ts"],"names":["AreHTMLAttribute","AreAttribute","A_Frame"],"mappings":";;;;;;;;;;;;;AAWaA,wBAAA,GAAN,+BAA+BC,gBAAA,CAAa;AAAA,EAE/C,IAAI,KAAA,GAAqB;AACrB,IAAA,OAAO,IAAA,CAAK,MAAM,MAAA,EAAO;AAAA,EAC7B;AAEJ;AANaD,wBAAA,GAAN,eAAA,CAAA;AAAA,EAJNE,aAAQ,MAAA,CAAO;AAAA,IACZ,SAAA,EAAW,YAAA;AAAA,IACX,WAAA,EAAa;AAAA,GAChB;AAAA,CAAA,EACYF,wBAAA,CAAA","file":"AreHTML.attribute.js","sourcesContent":["import { AreAttribute } from \"@adaas/are\";\nimport { AreHTMLNode } from \"../AreHTMLNode/AreHTMLNode\";\nimport { A_Frame } from \"@adaas/a-frame/core\";\n\n\n\n\n@A_Frame.Define({\n namespace: 'a-are-html',\n description: 'Base class for all typed HTML attributes in the ARE framework. Provides typed access to the owning AreHTMLNode via the scope injector so that attribute subclasses can inspect host-node properties and resolve store bindings during transformation, compilation, and lifecycle phases.'\n})\nexport class AreHTMLAttribute extends AreAttribute {\n\n get owner(): AreHTMLNode {\n return this.scope.issuer() as AreHTMLNode;\n }\n\n}"]}
|
|
@@ -1,11 +1,18 @@
|
|
|
1
|
-
import '../../chunk-EQQGB2QZ.mjs';
|
|
1
|
+
import { __decorateClass } from '../../chunk-EQQGB2QZ.mjs';
|
|
2
2
|
import { AreAttribute } from '@adaas/are';
|
|
3
|
+
import { A_Frame } from '@adaas/a-frame/core';
|
|
3
4
|
|
|
4
|
-
|
|
5
|
+
let AreHTMLAttribute = class extends AreAttribute {
|
|
5
6
|
get owner() {
|
|
6
7
|
return this.scope.issuer();
|
|
7
8
|
}
|
|
8
|
-
}
|
|
9
|
+
};
|
|
10
|
+
AreHTMLAttribute = __decorateClass([
|
|
11
|
+
A_Frame.Define({
|
|
12
|
+
namespace: "a-are-html",
|
|
13
|
+
description: "Base class for all typed HTML attributes in the ARE framework. Provides typed access to the owning AreHTMLNode via the scope injector so that attribute subclasses can inspect host-node properties and resolve store bindings during transformation, compilation, and lifecycle phases."
|
|
14
|
+
})
|
|
15
|
+
], AreHTMLAttribute);
|
|
9
16
|
|
|
10
17
|
export { AreHTMLAttribute };
|
|
11
18
|
//# sourceMappingURL=AreHTML.attribute.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/lib/AreHTMLAttribute/AreHTML.attribute.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../../src/lib/AreHTMLAttribute/AreHTML.attribute.ts"],"names":[],"mappings":";;;;AAWO,IAAM,gBAAA,GAAN,cAA+B,YAAA,CAAa;AAAA,EAE/C,IAAI,KAAA,GAAqB;AACrB,IAAA,OAAO,IAAA,CAAK,MAAM,MAAA,EAAO;AAAA,EAC7B;AAEJ;AANa,gBAAA,GAAN,eAAA,CAAA;AAAA,EAJN,QAAQ,MAAA,CAAO;AAAA,IACZ,SAAA,EAAW,YAAA;AAAA,IACX,WAAA,EAAa;AAAA,GAChB;AAAA,CAAA,EACY,gBAAA,CAAA","file":"AreHTML.attribute.mjs","sourcesContent":["import { AreAttribute } from \"@adaas/are\";\nimport { AreHTMLNode } from \"../AreHTMLNode/AreHTMLNode\";\nimport { A_Frame } from \"@adaas/a-frame/core\";\n\n\n\n\n@A_Frame.Define({\n namespace: 'a-are-html',\n description: 'Base class for all typed HTML attributes in the ARE framework. Provides typed access to the owning AreHTMLNode via the scope injector so that attribute subclasses can inspect host-node properties and resolve store bindings during transformation, compilation, and lifecycle phases.'\n})\nexport class AreHTMLAttribute extends AreAttribute {\n\n get owner(): AreHTMLNode {\n return this.scope.issuer() as AreHTMLNode;\n }\n\n}"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var aConcept = require('@adaas/a-concept');
|
|
4
|
-
var
|
|
4
|
+
var core = require('@adaas/a-frame/core');
|
|
5
5
|
var are = require('@adaas/are');
|
|
6
6
|
var AreBinding_attribute = require('@adaas/are-html/attributes/AreBinding.attribute');
|
|
7
7
|
var AreDirective_attribute = require('@adaas/are-html/attributes/AreDirective.attribute');
|
|
@@ -72,9 +72,8 @@ exports.AreHTMLNode = class AreHTMLNode extends are.AreNode {
|
|
|
72
72
|
}
|
|
73
73
|
};
|
|
74
74
|
exports.AreHTMLNode = __decorateClass([
|
|
75
|
-
|
|
76
|
-
namespace: "
|
|
77
|
-
name: "AreHTMLNode",
|
|
75
|
+
core.A_Frame.Define({
|
|
76
|
+
namespace: "a-are-html",
|
|
78
77
|
description: "AreHTMLNode represents a node in the HTML structure. It extends the base AreNode and includes properties and methods specific to HTML nodes, such as handling attributes, directives, events, and styles."
|
|
79
78
|
})
|
|
80
79
|
], exports.AreHTMLNode);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/lib/AreHTMLNode/AreHTMLNode.ts"],"names":["AreHTMLNode","AreNode","AreStaticAttribute","AreBindingAttribute","AreDirectiveAttribute","A_Context","AreEventAttribute","AreStyle","A_Frame"],"mappings":";;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"sources":["../../../../src/lib/AreHTMLNode/AreHTMLNode.ts"],"names":["AreHTMLNode","AreNode","AreStaticAttribute","AreBindingAttribute","AreDirectiveAttribute","A_Context","AreEventAttribute","AreStyle","A_Frame"],"mappings":";;;;;;;;;;;;;;;;;;;AAiBaA,mBAAA,G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,GAAmB;AACnB,IAAA,OAAO,IAAA,CAAK,KAAA,CAAM,WAAA,CAAsBC,yBAAQ,CAAA;AAAA,EACpD;AAEJ;AAjEaP,mBAAA,GAAN,eAAA,CAAA;AAAA,EAJNQ,aAAQ,MAAA,CAAO;AAAA,IACZ,SAAA,EAAW,YAAA;AAAA,IACX,WAAA,EAAa;AAAA,GAChB;AAAA,CAAA,EACYR,mBAAA,CAAA","file":"AreHTMLNode.js","sourcesContent":["import { A_Context, } from \"@adaas/a-concept\";\nimport { A_Frame } from \"@adaas/a-frame/core\";\nimport { AreNode} from \"@adaas/are\";\nimport { AreBindingAttribute } from \"@adaas/are-html/attributes/AreBinding.attribute\";\nimport { AreDirectiveAttribute } from \"@adaas/are-html/attributes/AreDirective.attribute\";\nimport { AreEventAttribute } from \"@adaas/are-html/attributes/AreEvent.attribute\";\nimport { AreStaticAttribute } from \"@adaas/are-html/attributes/AreStatic.attribute\";\nimport { AreStyle } from \"@adaas/are-html/style/AreStyle.context\";\nimport { AreDirective } from \"@adaas/are-html/directive/AreDirective.component\";\nimport { AreDirectiveMeta } from \"@adaas/are-html/directive/AreDirective.meta\";\n\n\n\n@A_Frame.Define({\n namespace: 'a-are-html',\n description: 'AreHTMLNode represents a node in the HTML structure. It extends the base AreNode and includes properties and methods specific to HTML nodes, such as handling attributes, directives, events, and styles.'\n})\nexport class AreHTMLNode extends AreNode {\n /**\n * Actual node type. \n * By default it's a tag name\n */\n get tag(): string {\n return this.aseid.entity;\n }\n /**\n * The static attributes defined for the node, which are typically used to represent static properties or characteristics of the node that do not change based on the context or state. These attributes are usually defined in the template and are not reactive.\n * \n * Example: For a node defined as `<div class=\"static-class\">`, the static attribute would be `class=\"static-class\"`.\n */\n get staticAttributes(): AreStaticAttribute[] {\n return this.scope.resolveFlatAll<AreStaticAttribute>(AreStaticAttribute);\n }\n /**\n * The binding attributes defined for the node, which are typically used to represent dynamic properties or characteristics of the node that can change based on the context or state. These attributes are usually defined in the template with a specific syntax (e.g., `:prop=\"value\"` or `v-bind:prop=\"value\"`) and are reactive, meaning that they will update automatically when the underlying data changes.\n * \n * Example: For a node defined as `<div :class=\"dynamicClass\">`, the binding attribute would be `:class=\"dynamicClass\"`.\n */\n get bindings(): AreBindingAttribute[] {\n return this.scope.resolveFlatAll<AreBindingAttribute>(AreBindingAttribute);\n }\n /**\n * The directive attributes defined for the node, which are typically used to represent special instructions or behaviors that should be applied to the node. These attributes are usually defined in the template with a specific syntax (e.g., `v-if=\"condition\"` or `v-for=\"item in list\"`) and are processed by the rendering engine to apply the corresponding logic or behavior to the node.\n * \n * Example: For a node defined as `<div v-if=\"isVisible\">`, the directive attribute would be `v-if=\"isVisible\"`.\n */\n get directives(): AreDirectiveAttribute[] {\n /**\n * 1. get all registered directives for the node\n */\n const directives = this.scope.resolveFlatAll<AreDirectiveAttribute>(AreDirectiveAttribute)!;\n /**\n * 2. Order them in the way that defined in the meta\n * \n * Each meta has a prioprity of order that may impact the way how directives are compiled and rendered. For example, a directive with higher priority may need to be compiled before other directives to ensure that its logic is applied correctly before other directives are processed. By ordering the directives based on their defined priority in the meta, we can ensure that the compilation and rendering process follows the intended logic and behavior as defined by the directive implementations.\n */\n\n return directives.filter(d => d.component).sort((a, b) => {\n const aMeta = A_Context.meta<AreDirectiveMeta, AreDirective>(a.component!);\n const bMeta = A_Context.meta<AreDirectiveMeta, AreDirective>(b.component!);\n\n const aPriority = aMeta.priority ?? 0;\n const bPriority = bMeta.priority ?? 0;\n\n return bPriority - aPriority;\n });\n }\n /**\n * The event attributes defined for the node, which are typically used to represent event listeners or handlers that should be attached to the node. These attributes are usually defined in the template with a specific syntax (e.g., `@click=\"handleClick\"` or `v-on:click=\"handleClick\"`) and are processed by the rendering engine to attach the corresponding event listeners to the node.\n * \n * Example: For a node defined as `<button @click=\"handleClick\">`, the event attribute would be `@click=\"handleClick\"`.\n */\n get events(): AreEventAttribute[] {\n return this.scope.resolveFlatAll<AreEventAttribute>(AreEventAttribute)!;\n }\n /**\n * The styles defined for the node, which can include inline styles or styles defined in a separate stylesheet that are applied to the node. These styles can be used to control the visual appearance of the node and can be defined using standard CSS syntax.\n */\n get styles(): AreStyle {\n return this.scope.resolveFlat<AreStyle>(AreStyle)!;\n }\n\n}"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __decorateClass } from '../../chunk-EQQGB2QZ.mjs';
|
|
2
2
|
import { A_Context } from '@adaas/a-concept';
|
|
3
|
-
import { A_Frame } from '@adaas/a-frame';
|
|
3
|
+
import { A_Frame } from '@adaas/a-frame/core';
|
|
4
4
|
import { AreNode } from '@adaas/are';
|
|
5
5
|
import { AreBindingAttribute } from '@adaas/are-html/attributes/AreBinding.attribute';
|
|
6
6
|
import { AreDirectiveAttribute } from '@adaas/are-html/attributes/AreDirective.attribute';
|
|
@@ -63,9 +63,8 @@ let AreHTMLNode = class extends AreNode {
|
|
|
63
63
|
}
|
|
64
64
|
};
|
|
65
65
|
AreHTMLNode = __decorateClass([
|
|
66
|
-
A_Frame.
|
|
67
|
-
namespace: "
|
|
68
|
-
name: "AreHTMLNode",
|
|
66
|
+
A_Frame.Define({
|
|
67
|
+
namespace: "a-are-html",
|
|
69
68
|
description: "AreHTMLNode represents a node in the HTML structure. It extends the base AreNode and includes properties and methods specific to HTML nodes, such as handling attributes, directives, events, and styles."
|
|
70
69
|
})
|
|
71
70
|
], AreHTMLNode);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/lib/AreHTMLNode/AreHTMLNode.ts"],"names":[],"mappings":";;;;;;;;;;
|
|
1
|
+
{"version":3,"sources":["../../../../src/lib/AreHTMLNode/AreHTMLNode.ts"],"names":[],"mappings":";;;;;;;;;;AAiBO,IAAM,WAAA,GAAN,cAA0B,OAAA,CAAQ;AAAA;AAAA;AAAA;AAAA;AAAA,EAKrC,IAAI,GAAA,GAAc;AACd,IAAA,OAAO,KAAK,KAAA,CAAM,MAAA;AAAA,EACtB;AAAA;AAAA;AAAA;AAAA;AAA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SAAA,EAAW,YAAA;AAAA,IACX,WAAA,EAAa;AAAA,GAChB;AAAA,CAAA,EACY,WAAA,CAAA","file":"AreHTMLNode.mjs","sourcesContent":["import { A_Context, } from \"@adaas/a-concept\";\nimport { A_Frame } from \"@adaas/a-frame/core\";\nimport { AreNode} from \"@adaas/are\";\nimport { AreBindingAttribute } from \"@adaas/are-html/attributes/AreBinding.attribute\";\nimport { AreDirectiveAttribute } from \"@adaas/are-html/attributes/AreDirective.attribute\";\nimport { AreEventAttribute } from \"@adaas/are-html/attributes/AreEvent.attribute\";\nimport { AreStaticAttribute } from \"@adaas/are-html/attributes/AreStatic.attribute\";\nimport { AreStyle } from \"@adaas/are-html/style/AreStyle.context\";\nimport { AreDirective } from \"@adaas/are-html/directive/AreDirective.component\";\nimport { AreDirectiveMeta } from \"@adaas/are-html/directive/AreDirective.meta\";\n\n\n\n@A_Frame.Define({\n namespace: 'a-are-html',\n description: 'AreHTMLNode represents a node in the HTML structure. It extends the base AreNode and includes properties and methods specific to HTML nodes, such as handling attributes, directives, events, and styles.'\n})\nexport class AreHTMLNode extends AreNode {\n /**\n * Actual node type. \n * By default it's a tag name\n */\n get tag(): string {\n return this.aseid.entity;\n }\n /**\n * The static attributes defined for the node, which are typically used to represent static properties or characteristics of the node that do not change based on the context or state. These attributes are usually defined in the template and are not reactive.\n * \n * Example: For a node defined as `<div class=\"static-class\">`, the static attribute would be `class=\"static-class\"`.\n */\n get staticAttributes(): AreStaticAttribute[] {\n return this.scope.resolveFlatAll<AreStaticAttribute>(AreStaticAttribute);\n }\n /**\n * The binding attributes defined for the node, which are typically used to represent dynamic properties or characteristics of the node that can change based on the context or state. These attributes are usually defined in the template with a specific syntax (e.g., `:prop=\"value\"` or `v-bind:prop=\"value\"`) and are reactive, meaning that they will update automatically when the underlying data changes.\n * \n * Example: For a node defined as `<div :class=\"dynamicClass\">`, the binding attribute would be `:class=\"dynamicClass\"`.\n */\n get bindings(): AreBindingAttribute[] {\n return this.scope.resolveFlatAll<AreBindingAttribute>(AreBindingAttribute);\n }\n /**\n * The directive attributes defined for the node, which are typically used to represent special instructions or behaviors that should be applied to the node. These attributes are usually defined in the template with a specific syntax (e.g., `v-if=\"condition\"` or `v-for=\"item in list\"`) and are processed by the rendering engine to apply the corresponding logic or behavior to the node.\n * \n * Example: For a node defined as `<div v-if=\"isVisible\">`, the directive attribute would be `v-if=\"isVisible\"`.\n */\n get directives(): AreDirectiveAttribute[] {\n /**\n * 1. get all registered directives for the node\n */\n const directives = this.scope.resolveFlatAll<AreDirectiveAttribute>(AreDirectiveAttribute)!;\n /**\n * 2. Order them in the way that defined in the meta\n * \n * Each meta has a prioprity of order that may impact the way how directives are compiled and rendered. For example, a directive with higher priority may need to be compiled before other directives to ensure that its logic is applied correctly before other directives are processed. By ordering the directives based on their defined priority in the meta, we can ensure that the compilation and rendering process follows the intended logic and behavior as defined by the directive implementations.\n */\n\n return directives.filter(d => d.component).sort((a, b) => {\n const aMeta = A_Context.meta<AreDirectiveMeta, AreDirective>(a.component!);\n const bMeta = A_Context.meta<AreDirectiveMeta, AreDirective>(b.component!);\n\n const aPriority = aMeta.priority ?? 0;\n const bPriority = bMeta.priority ?? 0;\n\n return bPriority - aPriority;\n });\n }\n /**\n * The event attributes defined for the node, which are typically used to represent event listeners or handlers that should be attached to the node. These attributes are usually defined in the template with a specific syntax (e.g., `@click=\"handleClick\"` or `v-on:click=\"handleClick\"`) and are processed by the rendering engine to attach the corresponding event listeners to the node.\n * \n * Example: For a node defined as `<button @click=\"handleClick\">`, the event attribute would be `@click=\"handleClick\"`.\n */\n get events(): AreEventAttribute[] {\n return this.scope.resolveFlatAll<AreEventAttribute>(AreEventAttribute)!;\n }\n /**\n * The styles defined for the node, which can include inline styles or styles defined in a separate stylesheet that are applied to the node. These styles can be used to control the visual appearance of the node and can be defined using standard CSS syntax.\n */\n get styles(): AreStyle {\n return this.scope.resolveFlat<AreStyle>(AreStyle)!;\n }\n\n}"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var aConcept = require('@adaas/a-concept');
|
|
4
|
-
var
|
|
4
|
+
var core = require('@adaas/a-frame/core');
|
|
5
5
|
var aLogger = require('@adaas/a-utils/a-logger');
|
|
6
6
|
var aSignal = require('@adaas/a-utils/a-signal');
|
|
7
7
|
var are = require('@adaas/are');
|
|
@@ -107,9 +107,8 @@ __decorateClass([
|
|
|
107
107
|
__decorateParam(4, aConcept.A_Inject(are.AreSignalsContext))
|
|
108
108
|
], exports.AreRoot.prototype, "onSignal", 1);
|
|
109
109
|
exports.AreRoot = __decorateClass([
|
|
110
|
-
|
|
111
|
-
namespace: "
|
|
112
|
-
name: "AreRoot",
|
|
110
|
+
core.A_Frame.Define({
|
|
111
|
+
namespace: "a-are-html",
|
|
113
112
|
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."
|
|
114
113
|
})
|
|
115
114
|
], exports.AreRoot);
|
|
@@ -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"],"mappings":";;;;;;;;;;;;;;;;;;;
|
|
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,GAA2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AA,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,6 +1,6 @@
|
|
|
1
1
|
import { __decorateClass, __decorateParam } from '../../chunk-EQQGB2QZ.mjs';
|
|
2
2
|
import { A_Inject, A_Caller, A_Context, A_FormatterHelper } from '@adaas/a-concept';
|
|
3
|
-
import { A_Frame } from '@adaas/a-frame';
|
|
3
|
+
import { A_Frame } from '@adaas/a-frame/core';
|
|
4
4
|
import { A_Logger } from '@adaas/a-utils/a-logger';
|
|
5
5
|
import { A_SignalVector } from '@adaas/a-utils/a-signal';
|
|
6
6
|
import { Are, AreSignalsContext, AreStore, AreRoute, AreSignals } from '@adaas/are';
|
|
@@ -95,9 +95,8 @@ __decorateClass([
|
|
|
95
95
|
__decorateParam(4, A_Inject(AreSignalsContext))
|
|
96
96
|
], AreRoot.prototype, "onSignal", 1);
|
|
97
97
|
AreRoot = __decorateClass([
|
|
98
|
-
A_Frame.
|
|
99
|
-
namespace: "
|
|
100
|
-
name: "AreRoot",
|
|
98
|
+
A_Frame.Define({
|
|
99
|
+
namespace: "a-are-html",
|
|
101
100
|
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."
|
|
102
101
|
})
|
|
103
102
|
], AreRoot);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/lib/AreRoot/AreRoot.component.ts"],"names":[],"mappings":";;;;;;;
|
|
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,EA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AAK;AAC3C,MAAA,MAAM,KAAA,GAAQ,IAAA,CAAK,QAAA,CAAS,CAAC,CAAA;AAC7B,MAAA,KAAA,CAAM,IAAA,EAAK;AAEX,MAAA,MAAM,GAAA,GAAM,MAAM,IAAA,EAAK;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,6 +1,6 @@
|
|
|
1
1
|
import { A_Component } from '@adaas/a-concept';
|
|
2
2
|
|
|
3
|
-
declare class
|
|
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 {
|
|
18
|
+
export { AreRouteWatcher };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { A_Component } from '@adaas/a-concept';
|
|
2
2
|
|
|
3
|
-
declare class
|
|
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 {
|
|
18
|
+
export { AreRouteWatcher };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var aConcept = require('@adaas/a-concept');
|
|
4
|
-
var
|
|
4
|
+
var core = require('@adaas/a-frame/core');
|
|
5
5
|
|
|
6
6
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
7
7
|
var __decorateClass = (decorators, target, key, kind) => {
|
|
@@ -11,7 +11,7 @@ var __decorateClass = (decorators, target, key, kind) => {
|
|
|
11
11
|
result = (decorator(result)) || result;
|
|
12
12
|
return result;
|
|
13
13
|
};
|
|
14
|
-
exports.
|
|
14
|
+
exports.AreRouteWatcher = class AreRouteWatcher extends aConcept.A_Component {
|
|
15
15
|
constructor() {
|
|
16
16
|
super();
|
|
17
17
|
this.handlers = /* @__PURE__ */ new Set();
|
|
@@ -67,12 +67,11 @@ exports.AreWatcher = class AreWatcher extends aConcept.A_Component {
|
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
69
|
};
|
|
70
|
-
exports.
|
|
71
|
-
|
|
72
|
-
namespace: "
|
|
73
|
-
|
|
74
|
-
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."
|
|
70
|
+
exports.AreRouteWatcher = __decorateClass([
|
|
71
|
+
core.A_Frame.Define({
|
|
72
|
+
namespace: "a-are-html",
|
|
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."
|
|
75
74
|
})
|
|
76
|
-
], exports.
|
|
77
|
-
//# sourceMappingURL=
|
|
78
|
-
//# sourceMappingURL=
|
|
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,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,IAAI,GAAA,GAAW;AACX,IAAA,OAAO,IAAA,CAAK,OAAA;AAAA,EAChB;AAAA,EAEA,OAAA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AAW,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}"]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { __decorateClass } from '../../chunk-EQQGB2QZ.mjs';
|
|
2
2
|
import { A_Component } from '@adaas/a-concept';
|
|
3
|
-
import { A_Frame } from '@adaas/a-frame';
|
|
3
|
+
import { A_Frame } from '@adaas/a-frame/core';
|
|
4
4
|
|
|
5
|
-
let
|
|
5
|
+
let AreRouteWatcher = class extends A_Component {
|
|
6
6
|
constructor() {
|
|
7
7
|
super();
|
|
8
8
|
this.handlers = /* @__PURE__ */ new Set();
|
|
@@ -58,14 +58,13 @@ let AreWatcher = class extends A_Component {
|
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
60
|
};
|
|
61
|
-
|
|
62
|
-
A_Frame.
|
|
63
|
-
namespace: "
|
|
64
|
-
|
|
65
|
-
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."
|
|
61
|
+
AreRouteWatcher = __decorateClass([
|
|
62
|
+
A_Frame.Define({
|
|
63
|
+
namespace: "a-are-html",
|
|
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."
|
|
66
65
|
})
|
|
67
|
-
],
|
|
66
|
+
], AreRouteWatcher);
|
|
68
67
|
|
|
69
|
-
export {
|
|
70
|
-
//# sourceMappingURL=
|
|
71
|
-
//# sourceMappingURL=
|
|
68
|
+
export { AreRouteWatcher };
|
|
69
|
+
//# sourceMappingURL=AreRouteWatcher.component.mjs.map
|
|
70
|
+
//# s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,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}"]}
|