@adaas/are-html 0.0.2
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/.conf/tsconfig.base.json +87 -0
- package/.conf/tsconfig.browser.json +34 -0
- package/.conf/tsconfig.node.json +35 -0
- package/.nvmrc +1 -0
- package/LICENSE +13 -0
- package/README.md +678 -0
- package/dist/browser/index.d.mts +521 -0
- package/dist/browser/index.mjs +1782 -0
- package/dist/browser/index.mjs.map +1 -0
- package/dist/node/AreBinding.attribute-C6JasbJL.d.ts +110 -0
- package/dist/node/AreBinding.attribute-C6qrxN8K.d.mts +110 -0
- package/dist/node/attributes/AreBinding.attribute.d.mts +4 -0
- package/dist/node/attributes/AreBinding.attribute.d.ts +4 -0
- package/dist/node/attributes/AreBinding.attribute.js +15 -0
- package/dist/node/attributes/AreBinding.attribute.js.map +1 -0
- package/dist/node/attributes/AreBinding.attribute.mjs +14 -0
- package/dist/node/attributes/AreBinding.attribute.mjs.map +1 -0
- package/dist/node/attributes/AreDirective.attribute.d.mts +4 -0
- package/dist/node/attributes/AreDirective.attribute.d.ts +4 -0
- package/dist/node/attributes/AreDirective.attribute.js +20 -0
- package/dist/node/attributes/AreDirective.attribute.js.map +1 -0
- package/dist/node/attributes/AreDirective.attribute.mjs +19 -0
- package/dist/node/attributes/AreDirective.attribute.mjs.map +1 -0
- package/dist/node/attributes/AreEvent.attribute.d.mts +4 -0
- package/dist/node/attributes/AreEvent.attribute.d.ts +4 -0
- package/dist/node/attributes/AreEvent.attribute.js +10 -0
- package/dist/node/attributes/AreEvent.attribute.js.map +1 -0
- package/dist/node/attributes/AreEvent.attribute.mjs +9 -0
- package/dist/node/attributes/AreEvent.attribute.mjs.map +1 -0
- package/dist/node/attributes/AreStatic.attribute.d.mts +4 -0
- package/dist/node/attributes/AreStatic.attribute.d.ts +4 -0
- package/dist/node/attributes/AreStatic.attribute.js +10 -0
- package/dist/node/attributes/AreStatic.attribute.js.map +1 -0
- package/dist/node/attributes/AreStatic.attribute.mjs +9 -0
- package/dist/node/attributes/AreStatic.attribute.mjs.map +1 -0
- package/dist/node/chunk-EQQGB2QZ.mjs +15 -0
- package/dist/node/chunk-EQQGB2QZ.mjs.map +1 -0
- package/dist/node/directives/AreComponent.directive.d.mts +2 -0
- package/dist/node/directives/AreComponent.directive.d.ts +2 -0
- package/dist/node/directives/AreComponent.directive.js +4 -0
- package/dist/node/directives/AreComponent.directive.js.map +1 -0
- package/dist/node/directives/AreComponent.directive.mjs +3 -0
- package/dist/node/directives/AreComponent.directive.mjs.map +1 -0
- package/dist/node/directives/AreDirectiveFor.directive.d.mts +41 -0
- package/dist/node/directives/AreDirectiveFor.directive.d.ts +41 -0
- package/dist/node/directives/AreDirectiveFor.directive.js +206 -0
- package/dist/node/directives/AreDirectiveFor.directive.js.map +1 -0
- package/dist/node/directives/AreDirectiveFor.directive.mjs +196 -0
- package/dist/node/directives/AreDirectiveFor.directive.mjs.map +1 -0
- package/dist/node/directives/AreDirectiveIf.directive.d.mts +15 -0
- package/dist/node/directives/AreDirectiveIf.directive.d.ts +15 -0
- package/dist/node/directives/AreDirectiveIf.directive.js +91 -0
- package/dist/node/directives/AreDirectiveIf.directive.js.map +1 -0
- package/dist/node/directives/AreDirectiveIf.directive.mjs +81 -0
- package/dist/node/directives/AreDirectiveIf.directive.mjs.map +1 -0
- package/dist/node/engine/AreHTML.compiler.d.mts +27 -0
- package/dist/node/engine/AreHTML.compiler.d.ts +27 -0
- package/dist/node/engine/AreHTML.compiler.js +150 -0
- package/dist/node/engine/AreHTML.compiler.js.map +1 -0
- package/dist/node/engine/AreHTML.compiler.mjs +140 -0
- package/dist/node/engine/AreHTML.compiler.mjs.map +1 -0
- package/dist/node/engine/AreHTML.constants.d.mts +2 -0
- package/dist/node/engine/AreHTML.constants.d.ts +2 -0
- package/dist/node/engine/AreHTML.constants.js +4 -0
- package/dist/node/engine/AreHTML.constants.js.map +1 -0
- package/dist/node/engine/AreHTML.constants.mjs +3 -0
- package/dist/node/engine/AreHTML.constants.mjs.map +1 -0
- package/dist/node/engine/AreHTML.context.d.mts +108 -0
- package/dist/node/engine/AreHTML.context.d.ts +108 -0
- package/dist/node/engine/AreHTML.context.js +155 -0
- package/dist/node/engine/AreHTML.context.js.map +1 -0
- package/dist/node/engine/AreHTML.context.mjs +154 -0
- package/dist/node/engine/AreHTML.context.mjs.map +1 -0
- package/dist/node/engine/AreHTML.engine.d.mts +21 -0
- package/dist/node/engine/AreHTML.engine.d.ts +21 -0
- package/dist/node/engine/AreHTML.engine.js +191 -0
- package/dist/node/engine/AreHTML.engine.js.map +1 -0
- package/dist/node/engine/AreHTML.engine.mjs +181 -0
- package/dist/node/engine/AreHTML.engine.mjs.map +1 -0
- package/dist/node/engine/AreHTML.interpreter.d.mts +28 -0
- package/dist/node/engine/AreHTML.interpreter.d.ts +28 -0
- package/dist/node/engine/AreHTML.interpreter.js +340 -0
- package/dist/node/engine/AreHTML.interpreter.js.map +1 -0
- package/dist/node/engine/AreHTML.interpreter.mjs +330 -0
- package/dist/node/engine/AreHTML.interpreter.mjs.map +1 -0
- package/dist/node/engine/AreHTML.lifecycle.d.mts +17 -0
- package/dist/node/engine/AreHTML.lifecycle.d.ts +17 -0
- package/dist/node/engine/AreHTML.lifecycle.js +91 -0
- package/dist/node/engine/AreHTML.lifecycle.js.map +1 -0
- package/dist/node/engine/AreHTML.lifecycle.mjs +79 -0
- package/dist/node/engine/AreHTML.lifecycle.mjs.map +1 -0
- package/dist/node/engine/AreHTML.tokenizer.d.mts +13 -0
- package/dist/node/engine/AreHTML.tokenizer.d.ts +13 -0
- package/dist/node/engine/AreHTML.tokenizer.js +83 -0
- package/dist/node/engine/AreHTML.tokenizer.js.map +1 -0
- package/dist/node/engine/AreHTML.tokenizer.mjs +71 -0
- package/dist/node/engine/AreHTML.tokenizer.mjs.map +1 -0
- package/dist/node/engine/AreHTML.transformer.d.mts +11 -0
- package/dist/node/engine/AreHTML.transformer.d.ts +11 -0
- package/dist/node/engine/AreHTML.transformer.js +44 -0
- package/dist/node/engine/AreHTML.transformer.js.map +1 -0
- package/dist/node/engine/AreHTML.transformer.mjs +32 -0
- package/dist/node/engine/AreHTML.transformer.mjs.map +1 -0
- package/dist/node/engine/AreHTML.types.d.mts +6 -0
- package/dist/node/engine/AreHTML.types.d.ts +6 -0
- package/dist/node/engine/AreHTML.types.js +4 -0
- package/dist/node/engine/AreHTML.types.js.map +1 -0
- package/dist/node/engine/AreHTML.types.mjs +3 -0
- package/dist/node/engine/AreHTML.types.mjs.map +1 -0
- package/dist/node/index.d.mts +39 -0
- package/dist/node/index.d.ts +39 -0
- package/dist/node/index.js +294 -0
- package/dist/node/index.js.map +1 -0
- package/dist/node/index.mjs +43 -0
- package/dist/node/index.mjs.map +1 -0
- package/dist/node/instructions/AddAttribute.instruction.d.mts +9 -0
- package/dist/node/instructions/AddAttribute.instruction.d.ts +9 -0
- package/dist/node/instructions/AddAttribute.instruction.js +32 -0
- package/dist/node/instructions/AddAttribute.instruction.js.map +1 -0
- package/dist/node/instructions/AddAttribute.instruction.mjs +25 -0
- package/dist/node/instructions/AddAttribute.instruction.mjs.map +1 -0
- package/dist/node/instructions/AddComment.instruction.d.mts +9 -0
- package/dist/node/instructions/AddComment.instruction.d.ts +9 -0
- package/dist/node/instructions/AddComment.instruction.js +35 -0
- package/dist/node/instructions/AddComment.instruction.js.map +1 -0
- package/dist/node/instructions/AddComment.instruction.mjs +28 -0
- package/dist/node/instructions/AddComment.instruction.mjs.map +1 -0
- package/dist/node/instructions/AddElement.instruction.d.mts +8 -0
- package/dist/node/instructions/AddElement.instruction.d.ts +8 -0
- package/dist/node/instructions/AddElement.instruction.js +32 -0
- package/dist/node/instructions/AddElement.instruction.js.map +1 -0
- package/dist/node/instructions/AddElement.instruction.mjs +25 -0
- package/dist/node/instructions/AddElement.instruction.mjs.map +1 -0
- package/dist/node/instructions/AddInterpolation.instruction.d.mts +8 -0
- package/dist/node/instructions/AddInterpolation.instruction.d.ts +8 -0
- package/dist/node/instructions/AddInterpolation.instruction.js +32 -0
- package/dist/node/instructions/AddInterpolation.instruction.js.map +1 -0
- package/dist/node/instructions/AddInterpolation.instruction.mjs +25 -0
- package/dist/node/instructions/AddInterpolation.instruction.mjs.map +1 -0
- package/dist/node/instructions/AddListener.instruction.d.mts +8 -0
- package/dist/node/instructions/AddListener.instruction.d.ts +8 -0
- package/dist/node/instructions/AddListener.instruction.js +32 -0
- package/dist/node/instructions/AddListener.instruction.js.map +1 -0
- package/dist/node/instructions/AddListener.instruction.mjs +25 -0
- package/dist/node/instructions/AddListener.instruction.mjs.map +1 -0
- package/dist/node/instructions/AddStyle.instruction.d.mts +8 -0
- package/dist/node/instructions/AddStyle.instruction.d.ts +8 -0
- package/dist/node/instructions/AddStyle.instruction.js +32 -0
- package/dist/node/instructions/AddStyle.instruction.js.map +1 -0
- package/dist/node/instructions/AddStyle.instruction.mjs +25 -0
- package/dist/node/instructions/AddStyle.instruction.mjs.map +1 -0
- package/dist/node/instructions/AddText.instruction.d.mts +8 -0
- package/dist/node/instructions/AddText.instruction.d.ts +8 -0
- package/dist/node/instructions/AddText.instruction.js +32 -0
- package/dist/node/instructions/AddText.instruction.js.map +1 -0
- package/dist/node/instructions/AddText.instruction.mjs +25 -0
- package/dist/node/instructions/AddText.instruction.mjs.map +1 -0
- package/dist/node/instructions/AreHTML.instructions.constants.d.mts +11 -0
- package/dist/node/instructions/AreHTML.instructions.constants.d.ts +11 -0
- package/dist/node/instructions/AreHTML.instructions.constants.js +15 -0
- package/dist/node/instructions/AreHTML.instructions.constants.js.map +1 -0
- package/dist/node/instructions/AreHTML.instructions.constants.mjs +15 -0
- package/dist/node/instructions/AreHTML.instructions.constants.mjs.map +1 -0
- package/dist/node/instructions/AreHTML.instructions.types.d.mts +46 -0
- package/dist/node/instructions/AreHTML.instructions.types.d.ts +46 -0
- package/dist/node/instructions/AreHTML.instructions.types.js +4 -0
- package/dist/node/instructions/AreHTML.instructions.types.js.map +1 -0
- package/dist/node/instructions/AreHTML.instructions.types.mjs +3 -0
- package/dist/node/instructions/AreHTML.instructions.types.mjs.map +1 -0
- package/dist/node/lib/AreDirective/AreDirective.component.d.mts +4 -0
- package/dist/node/lib/AreDirective/AreDirective.component.d.ts +4 -0
- package/dist/node/lib/AreDirective/AreDirective.component.js +117 -0
- package/dist/node/lib/AreDirective/AreDirective.component.js.map +1 -0
- package/dist/node/lib/AreDirective/AreDirective.component.mjs +107 -0
- package/dist/node/lib/AreDirective/AreDirective.component.mjs.map +1 -0
- package/dist/node/lib/AreDirective/AreDirective.constants.d.mts +16 -0
- package/dist/node/lib/AreDirective/AreDirective.constants.d.ts +16 -0
- package/dist/node/lib/AreDirective/AreDirective.constants.js +20 -0
- package/dist/node/lib/AreDirective/AreDirective.constants.js.map +1 -0
- package/dist/node/lib/AreDirective/AreDirective.constants.mjs +20 -0
- package/dist/node/lib/AreDirective/AreDirective.constants.mjs.map +1 -0
- package/dist/node/lib/AreDirective/AreDirective.context.d.mts +9 -0
- package/dist/node/lib/AreDirective/AreDirective.context.d.ts +9 -0
- package/dist/node/lib/AreDirective/AreDirective.context.js +14 -0
- package/dist/node/lib/AreDirective/AreDirective.context.js.map +1 -0
- package/dist/node/lib/AreDirective/AreDirective.context.mjs +13 -0
- package/dist/node/lib/AreDirective/AreDirective.context.mjs.map +1 -0
- package/dist/node/lib/AreDirective/AreDirective.meta.d.mts +7 -0
- package/dist/node/lib/AreDirective/AreDirective.meta.d.ts +7 -0
- package/dist/node/lib/AreDirective/AreDirective.meta.js +14 -0
- package/dist/node/lib/AreDirective/AreDirective.meta.js.map +1 -0
- package/dist/node/lib/AreDirective/AreDirective.meta.mjs +13 -0
- package/dist/node/lib/AreDirective/AreDirective.meta.mjs.map +1 -0
- package/dist/node/lib/AreDirective/AreDirective.types.d.mts +17 -0
- package/dist/node/lib/AreDirective/AreDirective.types.d.ts +17 -0
- package/dist/node/lib/AreDirective/AreDirective.types.js +4 -0
- package/dist/node/lib/AreDirective/AreDirective.types.js.map +1 -0
- package/dist/node/lib/AreDirective/AreDirective.types.mjs +3 -0
- package/dist/node/lib/AreDirective/AreDirective.types.mjs.map +1 -0
- package/dist/node/lib/AreHTML/AreHTML.tokenizer.d.mts +13 -0
- package/dist/node/lib/AreHTML/AreHTML.tokenizer.d.ts +13 -0
- package/dist/node/lib/AreHTML/AreHTML.tokenizer.js +82 -0
- package/dist/node/lib/AreHTML/AreHTML.tokenizer.js.map +1 -0
- package/dist/node/lib/AreHTML/AreHTML.tokenizer.mjs +70 -0
- package/dist/node/lib/AreHTML/AreHTML.tokenizer.mjs.map +1 -0
- package/dist/node/lib/AreHTMLAttribute/AreHTML.attribute.d.mts +4 -0
- package/dist/node/lib/AreHTMLAttribute/AreHTML.attribute.d.ts +4 -0
- package/dist/node/lib/AreHTMLAttribute/AreHTML.attribute.js +13 -0
- package/dist/node/lib/AreHTMLAttribute/AreHTML.attribute.js.map +1 -0
- package/dist/node/lib/AreHTMLAttribute/AreHTML.attribute.mjs +12 -0
- package/dist/node/lib/AreHTMLAttribute/AreHTML.attribute.mjs.map +1 -0
- package/dist/node/lib/AreHTMLNode/AreHTMLNode.d.mts +4 -0
- package/dist/node/lib/AreHTMLNode/AreHTMLNode.d.ts +4 -0
- package/dist/node/lib/AreHTMLNode/AreHTMLNode.js +82 -0
- package/dist/node/lib/AreHTMLNode/AreHTMLNode.js.map +1 -0
- package/dist/node/lib/AreHTMLNode/AreHTMLNode.mjs +75 -0
- package/dist/node/lib/AreHTMLNode/AreHTMLNode.mjs.map +1 -0
- package/dist/node/lib/AreRoot/AreRoot.component.d.mts +13 -0
- package/dist/node/lib/AreRoot/AreRoot.component.d.ts +13 -0
- package/dist/node/lib/AreRoot/AreRoot.component.js +117 -0
- package/dist/node/lib/AreRoot/AreRoot.component.js.map +1 -0
- package/dist/node/lib/AreRoot/AreRoot.component.mjs +107 -0
- package/dist/node/lib/AreRoot/AreRoot.component.mjs.map +1 -0
- package/dist/node/lib/AreStyle/AreStyle.context.d.mts +8 -0
- package/dist/node/lib/AreStyle/AreStyle.context.d.ts +8 -0
- package/dist/node/lib/AreStyle/AreStyle.context.js +16 -0
- package/dist/node/lib/AreStyle/AreStyle.context.js.map +1 -0
- package/dist/node/lib/AreStyle/AreStyle.context.mjs +15 -0
- package/dist/node/lib/AreStyle/AreStyle.context.mjs.map +1 -0
- package/dist/node/lib/AreStyle/AreStyle.types.d.mts +2 -0
- package/dist/node/lib/AreStyle/AreStyle.types.d.ts +2 -0
- package/dist/node/lib/AreStyle/AreStyle.types.js +4 -0
- package/dist/node/lib/AreStyle/AreStyle.types.js.map +1 -0
- package/dist/node/lib/AreStyle/AreStyle.types.mjs +3 -0
- package/dist/node/lib/AreStyle/AreStyle.types.mjs.map +1 -0
- package/dist/node/lib/AreWatcher/AreWatcher.component.d.mts +18 -0
- package/dist/node/lib/AreWatcher/AreWatcher.component.d.ts +18 -0
- package/dist/node/lib/AreWatcher/AreWatcher.component.js +78 -0
- package/dist/node/lib/AreWatcher/AreWatcher.component.js.map +1 -0
- package/dist/node/lib/AreWatcher/AreWatcher.component.mjs +71 -0
- package/dist/node/lib/AreWatcher/AreWatcher.component.mjs.map +1 -0
- package/dist/node/nodes/AreComment.d.mts +10 -0
- package/dist/node/nodes/AreComment.d.ts +10 -0
- package/dist/node/nodes/AreComment.js +19 -0
- package/dist/node/nodes/AreComment.js.map +1 -0
- package/dist/node/nodes/AreComment.mjs +18 -0
- package/dist/node/nodes/AreComment.mjs.map +1 -0
- package/dist/node/nodes/AreComponent.d.mts +17 -0
- package/dist/node/nodes/AreComponent.d.ts +17 -0
- package/dist/node/nodes/AreComponent.js +35 -0
- package/dist/node/nodes/AreComponent.js.map +1 -0
- package/dist/node/nodes/AreComponent.mjs +28 -0
- package/dist/node/nodes/AreComponent.mjs.map +1 -0
- package/dist/node/nodes/AreInterpolation.d.mts +10 -0
- package/dist/node/nodes/AreInterpolation.d.ts +10 -0
- package/dist/node/nodes/AreInterpolation.js +19 -0
- package/dist/node/nodes/AreInterpolation.js.map +1 -0
- package/dist/node/nodes/AreInterpolation.mjs +18 -0
- package/dist/node/nodes/AreInterpolation.mjs.map +1 -0
- package/dist/node/nodes/AreRoot.d.mts +21 -0
- package/dist/node/nodes/AreRoot.d.ts +21 -0
- package/dist/node/nodes/AreRoot.js +41 -0
- package/dist/node/nodes/AreRoot.js.map +1 -0
- package/dist/node/nodes/AreRoot.mjs +34 -0
- package/dist/node/nodes/AreRoot.mjs.map +1 -0
- package/dist/node/nodes/AreText.d.mts +10 -0
- package/dist/node/nodes/AreText.d.ts +10 -0
- package/dist/node/nodes/AreText.js +19 -0
- package/dist/node/nodes/AreText.js.map +1 -0
- package/dist/node/nodes/AreText.mjs +18 -0
- package/dist/node/nodes/AreText.mjs.map +1 -0
- package/dist/node/signals/AreRoute.signal.d.mts +12 -0
- package/dist/node/signals/AreRoute.signal.d.ts +12 -0
- package/dist/node/signals/AreRoute.signal.js +25 -0
- package/dist/node/signals/AreRoute.signal.js.map +1 -0
- package/dist/node/signals/AreRoute.signal.mjs +24 -0
- package/dist/node/signals/AreRoute.signal.mjs.map +1 -0
- package/docs/a-logo-docs.png +0 -0
- package/examples/dashboard/concept.ts +60 -0
- package/examples/dashboard/containers/UI.container.ts +233 -0
- package/examples/dashboard/dist/index.html +22 -0
- package/examples/dashboard/dist/mnzfypsd-6zjt7w.js +11454 -0
- package/examples/dashboard/dist/styles.css +792 -0
- package/examples/dashboard/public/index.html +22 -0
- package/examples/dashboard/public/styles.css +792 -0
- package/examples/dashboard/src/components/DashboardApp.component.ts +31 -0
- package/examples/dashboard/src/components/DashboardHeader.component.ts +40 -0
- package/examples/dashboard/src/components/DashboardLogo.component.ts +29 -0
- package/examples/dashboard/src/components/DashboardMain.component.ts +57 -0
- package/examples/dashboard/src/components/DashboardMenu.component.ts +94 -0
- package/examples/dashboard/src/components/DashboardNav.component.ts +28 -0
- package/examples/dashboard/src/components/DashboardNavItem.component.ts +32 -0
- package/examples/dashboard/src/components/DashboardSidebar.component.ts +43 -0
- package/examples/dashboard/src/components/DashboardStatCard.component.ts +71 -0
- package/examples/dashboard/src/components/DashboardStats.component.ts +28 -0
- package/examples/dashboard/src/components/DashboardTable.component.ts +138 -0
- package/examples/dashboard/src/components/DashboardUserCard.component.ts +39 -0
- package/examples/dashboard/src/concept.ts +93 -0
- package/examples/jumpstart/concept.ts +60 -0
- package/examples/jumpstart/containers/UI.container.ts +233 -0
- package/examples/jumpstart/dist/index.html +104 -0
- package/examples/jumpstart/dist/mnpl1g4i-nobz9g.js +10882 -0
- package/examples/jumpstart/dist/static/css/main.css +40 -0
- package/examples/jumpstart/dist/static/img/test.png +0 -0
- package/examples/jumpstart/public/index.html +104 -0
- package/examples/jumpstart/public/static/css/main.css +40 -0
- package/examples/jumpstart/public/static/img/test.png +0 -0
- package/examples/jumpstart/src/components/A-Btn.component.ts +150 -0
- package/examples/jumpstart/src/components/A-Input.component.ts +78 -0
- package/examples/jumpstart/src/components/A-Navigation.component.ts +167 -0
- package/examples/jumpstart/src/components/List.component.ts +138 -0
- package/examples/jumpstart/src/components/PromptTextArea.component.ts +359 -0
- package/examples/jumpstart/src/components/SignInComponent.component.ts +127 -0
- package/examples/jumpstart/src/concept.ts +105 -0
- package/jest.config.ts +61 -0
- package/package.json +110 -0
- package/src/attributes/AreBinding.attribute.ts +19 -0
- package/src/attributes/AreDirective.attribute.ts +26 -0
- package/src/attributes/AreEvent.attribute.ts +5 -0
- package/src/attributes/AreStatic.attribute.ts +6 -0
- package/src/directives/AreComponent.directive.ts +0 -0
- package/src/directives/AreDirectiveFor.directive.ts +322 -0
- package/src/directives/AreDirectiveIf.directive.ts +130 -0
- package/src/engine/AreHTML.compiler.ts +226 -0
- package/src/engine/AreHTML.constants.ts +2 -0
- package/src/engine/AreHTML.context.ts +196 -0
- package/src/engine/AreHTML.engine.ts +210 -0
- package/src/engine/AreHTML.interpreter.ts +466 -0
- package/src/engine/AreHTML.lifecycle.ts +96 -0
- package/src/engine/AreHTML.tokenizer.ts +90 -0
- package/src/engine/AreHTML.transformer.ts +37 -0
- package/src/engine/AreHTML.types.ts +6 -0
- package/src/index.ts +80 -0
- package/src/instructions/AddAttribute.instruction.ts +25 -0
- package/src/instructions/AddComment.instruction.ts +27 -0
- package/src/instructions/AddElement.instruction.ts +22 -0
- package/src/instructions/AddInterpolation.instruction.ts +24 -0
- package/src/instructions/AddListener.instruction.ts +24 -0
- package/src/instructions/AddStyle.instruction.ts +24 -0
- package/src/instructions/AddText.instruction.ts +21 -0
- package/src/instructions/AreHTML.instructions.constants.ts +11 -0
- package/src/instructions/AreHTML.instructions.types.ts +51 -0
- package/src/lib/AreDirective/AreDirective.component.ts +124 -0
- package/src/lib/AreDirective/AreDirective.constants.ts +16 -0
- package/src/lib/AreDirective/AreDirective.context.ts +16 -0
- package/src/lib/AreDirective/AreDirective.meta.ts +9 -0
- package/src/lib/AreDirective/AreDirective.types.ts +14 -0
- package/src/lib/AreHTML/AreHTML.tokenizer.ts +86 -0
- package/src/lib/AreHTMLAttribute/AreHTML.attribute.ts +13 -0
- package/src/lib/AreHTMLNode/AreHTMLNode.ts +84 -0
- package/src/lib/AreRoot/AreRoot.component.ts +134 -0
- package/src/lib/AreStyle/AreStyle.context.ts +20 -0
- package/src/lib/AreStyle/AreStyle.types.ts +0 -0
- package/src/lib/AreWatcher/AreWatcher.component.ts +84 -0
- package/src/nodes/AreComment.ts +17 -0
- package/src/nodes/AreComponent.ts +25 -0
- package/src/nodes/AreInterpolation.ts +16 -0
- package/src/nodes/AreRoot.ts +29 -0
- package/src/nodes/AreText.ts +17 -0
- package/src/signals/AreRoute.signal.ts +27 -0
- package/tests/AreTokenizer.test.ts +260 -0
- package/tests/jest.setup.ts +30 -0
- package/tsconfig.json +60 -0
- package/tslint.json +98 -0
- package/tsup.config.ts +108 -0
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { A_Caller, A_Feature, A_FormatterHelper, A_Inject, A_Scope } from "@adaas/a-concept";
|
|
2
|
+
import { AreLifecycle, AreScene, AreAttributeFeatures, AreSignalsContext } from "@adaas/are";
|
|
3
|
+
import { A_Logger } from "@adaas/a-utils/a-logger";
|
|
4
|
+
import { AreComponentNode } from "@adaas/are-html/nodes/AreComponent";
|
|
5
|
+
import { AreRootNode } from "@adaas/are-html/nodes/AreRoot";
|
|
6
|
+
import { AreInterpolation } from "@adaas/are-html/nodes/AreInterpolation";
|
|
7
|
+
import { AreText } from "@adaas/are-html/nodes/AreText";
|
|
8
|
+
import { AreDirectiveAttribute } from "@adaas/are-html/attributes/AreDirective.attribute";
|
|
9
|
+
import { AreDirectiveFeatures } from "@adaas/are-html/directive/AreDirective.constants";
|
|
10
|
+
import { AreHTMLEngineContext } from "./AreHTML.context";
|
|
11
|
+
import { AreHTMLNode } from "../lib/AreHTMLNode/AreHTMLNode";
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
export class AreHTMLLifecycle extends AreLifecycle {
|
|
15
|
+
|
|
16
|
+
@AreLifecycle.Init(AreComponentNode)
|
|
17
|
+
initComponent(
|
|
18
|
+
@A_Inject(A_Caller) node: AreHTMLNode,
|
|
19
|
+
@A_Inject(A_Scope) scope: A_Scope,
|
|
20
|
+
@A_Inject(AreHTMLEngineContext) context: AreHTMLEngineContext,
|
|
21
|
+
@A_Inject(A_Logger) logger?: A_Logger,
|
|
22
|
+
...args: any[]
|
|
23
|
+
): void {
|
|
24
|
+
super.init(node, scope, context, logger, ...args);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
@AreLifecycle.Init(AreRootNode)
|
|
29
|
+
initRoot(
|
|
30
|
+
@A_Inject(A_Caller) node: AreHTMLNode,
|
|
31
|
+
@A_Inject(A_Scope) scope: A_Scope,
|
|
32
|
+
@A_Inject(AreHTMLEngineContext) context: AreHTMLEngineContext,
|
|
33
|
+
@A_Inject(AreSignalsContext) signalsContext?: AreSignalsContext,
|
|
34
|
+
@A_Inject(A_Logger) logger?: A_Logger,
|
|
35
|
+
...args: any[]
|
|
36
|
+
): void {
|
|
37
|
+
signalsContext?.subscribe(node);
|
|
38
|
+
super.init(node, scope, context, logger, ...args);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
@AreLifecycle.Init(AreText)
|
|
43
|
+
initText(
|
|
44
|
+
@A_Inject(A_Caller) node: AreHTMLNode,
|
|
45
|
+
@A_Inject(A_Scope) scope: A_Scope,
|
|
46
|
+
@A_Inject(AreHTMLEngineContext) context: AreHTMLEngineContext,
|
|
47
|
+
@A_Inject(A_Logger) logger?: A_Logger,
|
|
48
|
+
...args: any[]
|
|
49
|
+
): void {
|
|
50
|
+
const scene = new AreScene(node.aseid);
|
|
51
|
+
|
|
52
|
+
scope.register(scene);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
@AreLifecycle.Init(AreInterpolation)
|
|
57
|
+
initInterpolation(
|
|
58
|
+
@A_Inject(A_Caller) node: AreHTMLNode,
|
|
59
|
+
@A_Inject(A_Scope) scope: A_Scope,
|
|
60
|
+
@A_Inject(AreHTMLEngineContext) context: AreHTMLEngineContext,
|
|
61
|
+
@A_Inject(A_Logger) logger?: A_Logger,
|
|
62
|
+
...args: any[]
|
|
63
|
+
): void {
|
|
64
|
+
const scene = new AreScene(node.aseid);
|
|
65
|
+
|
|
66
|
+
scope.register(scene);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
@A_Feature.Extend({
|
|
73
|
+
name: AreAttributeFeatures.Update,
|
|
74
|
+
scope: [AreDirectiveAttribute],
|
|
75
|
+
})
|
|
76
|
+
updateDirectiveAttribute(
|
|
77
|
+
@A_Inject(A_Caller) directive: AreDirectiveAttribute,
|
|
78
|
+
@A_Inject(A_Scope) scope: A_Scope,
|
|
79
|
+
@A_Inject(A_Feature) feature: A_Feature,
|
|
80
|
+
@A_Inject(A_Logger) logger?: A_Logger,
|
|
81
|
+
...args: any[]
|
|
82
|
+
) {
|
|
83
|
+
/**
|
|
84
|
+
* 3. If the attribute is a directive, then we should find a component that is responsible for
|
|
85
|
+
* the directive compiling logic, and call it.
|
|
86
|
+
* In case component is not found we just want to log a warning,
|
|
87
|
+
* since the directive may be handled by some parent component or simply is a mistake in the template.
|
|
88
|
+
*/
|
|
89
|
+
if (directive.component) {
|
|
90
|
+
feature.chain(directive.component, AreDirectiveFeatures.Update, directive.owner.scope);
|
|
91
|
+
} else {
|
|
92
|
+
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.`);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { A_Caller, A_Feature, A_Inject } from "@adaas/a-concept";
|
|
2
|
+
import { A_Logger } from "@adaas/a-utils/a-logger";
|
|
3
|
+
import { AreNodeFeatures, AreNode, AreTokenizer, AreAttribute_Init, AreContext } from "@adaas/are";
|
|
4
|
+
import { AreComponentNode } from "@adaas/are-html/nodes/AreComponent";
|
|
5
|
+
import { AreRootNode } from "@adaas/are-html/nodes/AreRoot";
|
|
6
|
+
import { AreDirectiveAttribute } from "@adaas/are-html/attributes/AreDirective.attribute";
|
|
7
|
+
import { AreEventAttribute } from "@adaas/are-html/attributes/AreEvent.attribute";
|
|
8
|
+
import { AreBindingAttribute } from "@adaas/are-html/attributes/AreBinding.attribute";
|
|
9
|
+
import { AreStaticAttribute } from "@adaas/are-html/attributes/AreStatic.attribute";
|
|
10
|
+
import { AreHTMLAttribute } from "../lib/AreHTMLAttribute/AreHTML.attribute";
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
export class AreHTMLTokenizer extends AreTokenizer {
|
|
14
|
+
|
|
15
|
+
ATTR_PATTERN = /([$:@]?[\w-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s>/"'=]+)))?/g
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
@A_Feature.Extend({
|
|
19
|
+
name: AreNodeFeatures.onTokenize,
|
|
20
|
+
scope: [AreComponentNode, AreRootNode]
|
|
21
|
+
})
|
|
22
|
+
tokenize(
|
|
23
|
+
@A_Inject(A_Caller) node: AreNode,
|
|
24
|
+
@A_Inject(AreContext) context: AreContext,
|
|
25
|
+
@A_Inject(A_Logger) logger?: A_Logger
|
|
26
|
+
): void {
|
|
27
|
+
|
|
28
|
+
super.tokenize(node, context, logger);
|
|
29
|
+
|
|
30
|
+
context.startPerformance('attributeExtraction');
|
|
31
|
+
|
|
32
|
+
const attributes = this.extractAttributes(node.markup);
|
|
33
|
+
|
|
34
|
+
for (const attr of attributes) {
|
|
35
|
+
node.scope.register(attr);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
context.endPerformance('attributeExtraction');
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
extractAttributes(markup: string): AreHTMLAttribute[] {
|
|
44
|
+
// Strip the tag name, then remove the closing > that is NOT inside quotes
|
|
45
|
+
const withoutTag = markup.replace(/^<[a-zA-Z][a-zA-Z0-9-]*\s*/, '')
|
|
46
|
+
|
|
47
|
+
// Walk the string to find the closing > that isn't inside a quoted value
|
|
48
|
+
let inSingle = false
|
|
49
|
+
let inDouble = false
|
|
50
|
+
let endIdx = withoutTag.length
|
|
51
|
+
|
|
52
|
+
for (let i = 0; i < withoutTag.length; i++) {
|
|
53
|
+
const ch = withoutTag[i]
|
|
54
|
+
if (ch === '"' && !inSingle) inDouble = !inDouble
|
|
55
|
+
else if (ch === "'" && !inDouble) inSingle = !inSingle
|
|
56
|
+
else if (ch === '>' && !inSingle && !inDouble) {
|
|
57
|
+
endIdx = i
|
|
58
|
+
break
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
const attrString = withoutTag.slice(0, endIdx).replace(/\s*\/?\s*$/, '').trim()
|
|
63
|
+
|
|
64
|
+
const results: AreHTMLAttribute[] = []
|
|
65
|
+
|
|
66
|
+
for (const match of attrString.matchAll(this.ATTR_PATTERN)) {
|
|
67
|
+
const raw = match[0]
|
|
68
|
+
const full = match[1] // e.g. ':class', '@click', '$for', 'id'
|
|
69
|
+
|
|
70
|
+
// skip zero-length or name-less regex matches
|
|
71
|
+
if (!full) continue
|
|
72
|
+
|
|
73
|
+
const value = match[2] ?? match[3] ?? match[4] ?? 'true'
|
|
74
|
+
|
|
75
|
+
const prefix = full[0]
|
|
76
|
+
const isSpecial = prefix === ':' || prefix === '@' || prefix === '$'
|
|
77
|
+
const name = isSpecial ? full.slice(1) : full
|
|
78
|
+
|
|
79
|
+
const meta: AreAttribute_Init = { name, content: value, raw, prefix: isSpecial ? prefix : '' }
|
|
80
|
+
|
|
81
|
+
if (prefix === ':') results.push(new AreBindingAttribute(meta))
|
|
82
|
+
else if (prefix === '@') results.push(new AreEventAttribute(meta))
|
|
83
|
+
else if (prefix === '$') results.push(new AreDirectiveAttribute(meta))
|
|
84
|
+
else results.push(new AreStaticAttribute(meta))
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
return results
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { A_Caller, A_Feature, A_FormatterHelper, A_Inject, A_Scope } from "@adaas/a-concept";
|
|
2
|
+
import { A_Logger } from "@adaas/a-utils/a-logger";
|
|
3
|
+
import { AreAttributeFeatures, AreTransformer, AreStore } from "@adaas/are";
|
|
4
|
+
import { AreDirectiveAttribute } from "@adaas/are-html/attributes/AreDirective.attribute";
|
|
5
|
+
import { AreDirectiveFeatures } from "@adaas/are-html/directive/AreDirective.constants";
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
export class AreHTMLTransformer extends AreTransformer {
|
|
9
|
+
|
|
10
|
+
@A_Feature.Extend({
|
|
11
|
+
name: AreAttributeFeatures.Transform,
|
|
12
|
+
scope: [AreDirectiveAttribute],
|
|
13
|
+
})
|
|
14
|
+
transformDirectiveAttribute(
|
|
15
|
+
@A_Inject(A_Caller) directive: AreDirectiveAttribute,
|
|
16
|
+
@A_Inject(AreStore) store: AreStore,
|
|
17
|
+
@A_Inject(A_Feature) feature: A_Feature,
|
|
18
|
+
@A_Inject(A_Logger) logger?: A_Logger,
|
|
19
|
+
...args: any[]
|
|
20
|
+
) {
|
|
21
|
+
store.watch(directive);
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* 3. If the attribute is a directive, then we should find a component that is responsible for
|
|
25
|
+
* the directive compiling logic, and call it.
|
|
26
|
+
* In case component is not found we just want to log a warning,
|
|
27
|
+
* since the directive may be handled by some parent component or simply is a mistake in the template.
|
|
28
|
+
*/
|
|
29
|
+
if (directive.component) {
|
|
30
|
+
feature.chain(directive.component, AreDirectiveFeatures.Transform, directive.owner.scope);
|
|
31
|
+
} else {
|
|
32
|
+
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.`);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
store.unwatch(directive);
|
|
36
|
+
}
|
|
37
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
2
|
+
// ── Attributes ───────────────────────────────────────────────────────────────
|
|
3
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
4
|
+
export * from './attributes/AreBinding.attribute';
|
|
5
|
+
export * from './attributes/AreDirective.attribute';
|
|
6
|
+
export * from './attributes/AreEvent.attribute';
|
|
7
|
+
export * from './attributes/AreStatic.attribute';
|
|
8
|
+
|
|
9
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
10
|
+
// ── Directives ───────────────────────────────────────────────────────────────
|
|
11
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
12
|
+
export * from './directives/AreComponent.directive';
|
|
13
|
+
export * from './directives/AreDirectiveFor.directive';
|
|
14
|
+
export * from './directives/AreDirectiveIf.directive';
|
|
15
|
+
|
|
16
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
17
|
+
// ── Instructions ─────────────────────────────────────────────────────────────
|
|
18
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
19
|
+
export * from './instructions/AddAttribute.instruction';
|
|
20
|
+
export * from './instructions/AddElement.instruction';
|
|
21
|
+
export * from './instructions/AddInterpolation.instruction';
|
|
22
|
+
export * from './instructions/AddListener.instruction';
|
|
23
|
+
export * from './instructions/AddStyle.instruction';
|
|
24
|
+
export * from './instructions/AddText.instruction';
|
|
25
|
+
export * from './instructions/AreHTML.instructions.constants';
|
|
26
|
+
export * from './instructions/AreHTML.instructions.types';
|
|
27
|
+
|
|
28
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
29
|
+
// ── Nodes ────────────────────────────────────────────────────────────────────
|
|
30
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
31
|
+
export * from './nodes/AreComment';
|
|
32
|
+
export * from './nodes/AreComponent';
|
|
33
|
+
export * from './nodes/AreInterpolation';
|
|
34
|
+
export * from './nodes/AreRoot';
|
|
35
|
+
export * from './nodes/AreText';
|
|
36
|
+
|
|
37
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
38
|
+
// ── Signals ──────────────────────────────────────────────────────────────────
|
|
39
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
40
|
+
export * from './signals/AreRoute.signal';
|
|
41
|
+
|
|
42
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
43
|
+
// ── Lib / AreHTML ────────────────────────────────────────────────────────────
|
|
44
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
45
|
+
export * from './lib/AreHTMLNode/AreHTMLNode';
|
|
46
|
+
export * from './lib/AreHTMLAttribute/AreHTML.attribute';
|
|
47
|
+
export * from './engine/AreHTML.constants';
|
|
48
|
+
export * from './engine/AreHTML.context';
|
|
49
|
+
export * from './engine/AreHTML.types';
|
|
50
|
+
export * from './engine/AreHTML.compiler';
|
|
51
|
+
export * from './engine/AreHTML.engine';
|
|
52
|
+
export * from './engine/AreHTML.interpreter';
|
|
53
|
+
export * from './engine/AreHTML.lifecycle';
|
|
54
|
+
export * from './engine/AreHTML.tokenizer';
|
|
55
|
+
export * from './engine/AreHTML.transformer';
|
|
56
|
+
|
|
57
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
58
|
+
// ── Lib / AreDirective ───────────────────────────────────────────────────────
|
|
59
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
60
|
+
export * from './lib/AreDirective/AreDirective.component';
|
|
61
|
+
export * from './lib/AreDirective/AreDirective.constants';
|
|
62
|
+
export * from './lib/AreDirective/AreDirective.context';
|
|
63
|
+
export * from './lib/AreDirective/AreDirective.meta';
|
|
64
|
+
export * from './lib/AreDirective/AreDirective.types';
|
|
65
|
+
|
|
66
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
67
|
+
// ── Lib / AreRoot ────────────────────────────────────────────────────────────
|
|
68
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
69
|
+
export * from './lib/AreRoot/AreRoot.component';
|
|
70
|
+
|
|
71
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
72
|
+
// ── Lib / AreStyle ───────────────────────────────────────────────────────────
|
|
73
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
74
|
+
export * from './lib/AreStyle/AreStyle.context';
|
|
75
|
+
export * from './lib/AreStyle/AreStyle.types';
|
|
76
|
+
|
|
77
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
78
|
+
// ── Lib / AreWatcher ─────────────────────────────────────────────────────────
|
|
79
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
80
|
+
export * from './lib/AreWatcher/AreWatcher.component';
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { A_Frame } from "@adaas/a-frame";
|
|
2
|
+
import { AreDeclaration, AreMutation, AreInstructionSerialized } from "@adaas/are";
|
|
3
|
+
import { AreHtmlAddAttributeInstructionPayload } from "./AreHTML.instructions.types";
|
|
4
|
+
import { AreHTMLInstructions } from "./AreHTML.instructions.constants";
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
@A_Frame.Component({
|
|
8
|
+
namespace: 'A-ARE',
|
|
9
|
+
name: 'AddAttributeInstruction',
|
|
10
|
+
description: 'Sets an attribute on an HTML element. Apply calls setAttribute; revert calls removeAttribute.'
|
|
11
|
+
})
|
|
12
|
+
export class AddAttributeInstruction extends AreMutation<AreHtmlAddAttributeInstructionPayload> {
|
|
13
|
+
|
|
14
|
+
cache?: string;
|
|
15
|
+
|
|
16
|
+
constructor(
|
|
17
|
+
parent: AreDeclaration,
|
|
18
|
+
props: AreHtmlAddAttributeInstructionPayload | AreInstructionSerialized<AreHtmlAddAttributeInstructionPayload>) {
|
|
19
|
+
if ('aseid' in props) {
|
|
20
|
+
super(props as AreInstructionSerialized<AreHtmlAddAttributeInstructionPayload>);
|
|
21
|
+
} else {
|
|
22
|
+
super(AreHTMLInstructions.AddAttribute, parent, props);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { A_Frame } from "@adaas/a-frame";
|
|
2
|
+
import { AreDeclaration, AreInstructionSerialized } from "@adaas/are";
|
|
3
|
+
import { AreHtmlAddCommentInstructionPayload } from "./AreHTML.instructions.types";
|
|
4
|
+
import { AreHTMLInstructions } from "./AreHTML.instructions.constants";
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
@A_Frame.Component({
|
|
8
|
+
namespace: 'A-ARE',
|
|
9
|
+
name: 'AddCommentInstruction',
|
|
10
|
+
description: 'Appends a comment node to an element. Apply creates the comment node; revert removes it. Content can be a static string or a dynamic getter for interpolations.'
|
|
11
|
+
})
|
|
12
|
+
export class AddCommentInstruction extends AreDeclaration<AreHtmlAddCommentInstructionPayload> {
|
|
13
|
+
|
|
14
|
+
get content() {
|
|
15
|
+
return this.payload.content;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
constructor(
|
|
19
|
+
props: AreHtmlAddCommentInstructionPayload | AreInstructionSerialized<AreHtmlAddCommentInstructionPayload>
|
|
20
|
+
) {
|
|
21
|
+
if ('aseid' in props) {
|
|
22
|
+
super(props as AreInstructionSerialized<AreHtmlAddCommentInstructionPayload>);
|
|
23
|
+
} else {
|
|
24
|
+
super(AreHTMLInstructions.AddComment, props);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { A_Frame } from "@adaas/a-frame";
|
|
2
|
+
import { AreDeclaration, AreInstructionSerialized } from "@adaas/are";
|
|
3
|
+
import { AreHtmlAddElementInstructionPayload } from "./AreHTML.instructions.types";
|
|
4
|
+
import { AreHTMLInstructions } from "./AreHTML.instructions.constants";
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
@A_Frame.Component({
|
|
8
|
+
namespace: 'A-ARE',
|
|
9
|
+
name: 'AddElementInstruction',
|
|
10
|
+
description: 'Creates a new HTML element in the DOM. Apply creates the element; revert removes it.'
|
|
11
|
+
})
|
|
12
|
+
export class AddElementInstruction extends AreDeclaration<AreHtmlAddElementInstructionPayload> {
|
|
13
|
+
constructor(
|
|
14
|
+
props: AreHtmlAddElementInstructionPayload | AreInstructionSerialized<AreHtmlAddElementInstructionPayload>
|
|
15
|
+
) {
|
|
16
|
+
if ('aseid' in props) {
|
|
17
|
+
super(props);
|
|
18
|
+
} else {
|
|
19
|
+
super(AreHTMLInstructions.AddElement, props);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { A_Frame } from "@adaas/a-frame";
|
|
2
|
+
import { AreDeclaration, AreMutation, AreInstructionSerialized } from "@adaas/are";
|
|
3
|
+
import { AreHtmlAddInterpolationInstructionPayload } from "./AreHTML.instructions.types";
|
|
4
|
+
import { AreHTMLInstructions } from "./AreHTML.instructions.constants";
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
@A_Frame.Component({
|
|
8
|
+
namespace: 'A-ARE',
|
|
9
|
+
name: 'AddInterpolationInstruction',
|
|
10
|
+
description: 'Appends a reactive text node whose content is resolved dynamically from the store. Apply creates the text node with the getter; revert removes it.'
|
|
11
|
+
})
|
|
12
|
+
export class AddInterpolationInstruction extends AreMutation<AreHtmlAddInterpolationInstructionPayload> {
|
|
13
|
+
|
|
14
|
+
constructor(
|
|
15
|
+
parent: AreDeclaration,
|
|
16
|
+
props: AreHtmlAddInterpolationInstructionPayload | AreInstructionSerialized<AreHtmlAddInterpolationInstructionPayload>
|
|
17
|
+
) {
|
|
18
|
+
if ('aseid' in props) {
|
|
19
|
+
super(props as AreInstructionSerialized<AreHtmlAddInterpolationInstructionPayload>);
|
|
20
|
+
} else {
|
|
21
|
+
super(AreHTMLInstructions.AddInterpolation, parent, props);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { A_Frame } from "@adaas/a-frame";
|
|
2
|
+
import { AreDeclaration, AreMutation, AreInstructionSerialized } from "@adaas/are";
|
|
3
|
+
import { AreHtmlAddListenerInstructionPayload } from "./AreHTML.instructions.types";
|
|
4
|
+
import { AreHTMLInstructions } from "./AreHTML.instructions.constants";
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
@A_Frame.Component({
|
|
8
|
+
namespace: 'A-ARE',
|
|
9
|
+
name: 'AddListenerInstruction',
|
|
10
|
+
description: 'Attaches a DOM event listener to an element. Apply calls addEventListener; revert calls removeEventListener.'
|
|
11
|
+
})
|
|
12
|
+
export class AddListenerInstruction extends AreMutation<AreHtmlAddListenerInstructionPayload> {
|
|
13
|
+
|
|
14
|
+
constructor(
|
|
15
|
+
parent: AreDeclaration,
|
|
16
|
+
props: AreHtmlAddListenerInstructionPayload | AreInstructionSerialized<AreHtmlAddListenerInstructionPayload>
|
|
17
|
+
) {
|
|
18
|
+
if ('aseid' in props) {
|
|
19
|
+
super(props as AreInstructionSerialized<AreHtmlAddListenerInstructionPayload>);
|
|
20
|
+
} else {
|
|
21
|
+
super(AreHTMLInstructions.AddListener, parent, props);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { A_Frame } from "@adaas/a-frame";
|
|
2
|
+
import { AreDeclaration, AreMutation, AreInstructionSerialized } from "@adaas/are";
|
|
3
|
+
import { AreHtmlAddStyleInstructionPayload } from "./AreHTML.instructions.types";
|
|
4
|
+
import { AreHTMLInstructions } from "./AreHTML.instructions.constants";
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
@A_Frame.Component({
|
|
8
|
+
namespace: 'A-ARE',
|
|
9
|
+
name: 'AddStyleInstruction',
|
|
10
|
+
description: 'Sets an inline CSS style property on an element. Apply sets the property; revert removes it.'
|
|
11
|
+
})
|
|
12
|
+
export class AddStyleInstruction extends AreMutation<AreHtmlAddStyleInstructionPayload> {
|
|
13
|
+
|
|
14
|
+
constructor(
|
|
15
|
+
parent: AreDeclaration,
|
|
16
|
+
props: AreHtmlAddStyleInstructionPayload | AreInstructionSerialized<AreHtmlAddStyleInstructionPayload>
|
|
17
|
+
) {
|
|
18
|
+
if ('aseid' in props) {
|
|
19
|
+
super(props as AreInstructionSerialized<AreHtmlAddStyleInstructionPayload>);
|
|
20
|
+
} else {
|
|
21
|
+
super(AreHTMLInstructions.AddStyle, parent, props);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { A_Frame } from "@adaas/a-frame";
|
|
2
|
+
import { AreDeclaration, AreInstructionSerialized } from "@adaas/are";
|
|
3
|
+
import { AreHtmlAddTextInstructionPayload } from "./AreHTML.instructions.types";
|
|
4
|
+
import { AreHTMLInstructions } from "./AreHTML.instructions.constants";
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
@A_Frame.Component({
|
|
8
|
+
namespace: 'A-ARE',
|
|
9
|
+
name: 'AddTextInstruction',
|
|
10
|
+
description: 'Appends a text node to an element. Apply creates the text node; revert removes it. Content can be a static string or a dynamic getter for interpolations.'
|
|
11
|
+
})
|
|
12
|
+
export class AddTextInstruction extends AreDeclaration<AreHtmlAddTextInstructionPayload> {
|
|
13
|
+
|
|
14
|
+
constructor(props: AreHtmlAddTextInstructionPayload | AreInstructionSerialized<AreHtmlAddTextInstructionPayload>) {
|
|
15
|
+
if ('aseid' in props) {
|
|
16
|
+
super(props as AreInstructionSerialized<AreHtmlAddTextInstructionPayload>);
|
|
17
|
+
} else {
|
|
18
|
+
super(AreHTMLInstructions.AddText, props);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
export const AreHTMLInstructions = {
|
|
4
|
+
AddElement: '_AreHTML_AddElement',
|
|
5
|
+
AddText: '_AreHTML_AddText',
|
|
6
|
+
AddAttribute: '_AreHTML_AddAttribute',
|
|
7
|
+
AddStyle: '_AreHTML_AddStyle',
|
|
8
|
+
AddListener: '_AreHTML_AddListener',
|
|
9
|
+
AddInterpolation: '_AreHTML_AddInterpolation',
|
|
10
|
+
AddComment: '_AreHTML_AddComment',
|
|
11
|
+
} as const
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
export type AreHtmlAddAttributeInstructionPayload = {
|
|
2
|
+
name: string;
|
|
3
|
+
content: string;
|
|
4
|
+
evaluate?: boolean; // Optional flag to indicate if content should be evaluated as an expression
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export type AreHtmlAddElementInstructionPayload = {
|
|
8
|
+
tag: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export type AreHtmlAddTextInstructionPayload = {
|
|
12
|
+
/**
|
|
13
|
+
* Static string content or a dynamic getter function.
|
|
14
|
+
* When a function is provided, it receives the instruction instance
|
|
15
|
+
* and should return the current text value (used for interpolations).
|
|
16
|
+
*/
|
|
17
|
+
content: string ;
|
|
18
|
+
evaluate?: boolean; // Optional flag to indicate if content should be evaluated as an expression
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export type AreHtmlAddCommentInstructionPayload = {
|
|
22
|
+
/**
|
|
23
|
+
* Static string content or a dynamic getter function.
|
|
24
|
+
* When a function is provided, it receives the instruction instance
|
|
25
|
+
* and should return the current text value (used for interpolations).
|
|
26
|
+
*/
|
|
27
|
+
content: string ;
|
|
28
|
+
evaluate?: boolean; // Optional flag to indicate if content should be evaluated as an expression
|
|
29
|
+
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export type AreHtmlAddStyleInstructionPayload = {
|
|
33
|
+
/** CSS property name in camelCase (e.g. "backgroundColor") or kebab-case (e.g. "background-color") */
|
|
34
|
+
property: string;
|
|
35
|
+
/** CSS property value */
|
|
36
|
+
value: string;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export type AreHtmlAddListenerInstructionPayload = {
|
|
40
|
+
/** DOM event name (e.g. "click", "input", "submit") */
|
|
41
|
+
name: string;
|
|
42
|
+
/** Event handler callback */
|
|
43
|
+
handler: string;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export type AreHtmlAddInterpolationInstructionPayload = {
|
|
47
|
+
/** The interpolation key used to look up the value in the store */
|
|
48
|
+
key: string;
|
|
49
|
+
/** Dynamic getter function that resolves the current interpolation value */
|
|
50
|
+
content: (...args: any[]) => string;
|
|
51
|
+
}
|