@alwatr/synapse 9.1.1 → 9.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/main.js +3 -3
- package/dist/main.js.map +3 -3
- package/package.json +4 -4
- package/src/directive-class.ts +1 -1
package/dist/main.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/* 📦 @alwatr/synapse v9.
|
|
2
|
-
import{createLogger as V}from"@alwatr/logger";var M=V("alwatr/synapse"),P=[];var U="synapse";function W(B=document.body){if(M.logMethod?.("bootstrapDirectives"),document.readyState==="loading"){M.incident?.("bootstrapDirectives","dom_not_ready","Delaying directive initialization until DOM is ready"),document.addEventListener("DOMContentLoaded",()=>{W(B)},{once:!0});return}for(let{selector:C,constructor:H}of P)try{let O=`${C}:not([${U}])`,F=B.querySelectorAll(O);if(F.length===0)continue;M.logOther?.(`Found ${F.length} new element(s) for directive "${C}"`),F.forEach((G)=>{G.setAttribute(U,""),new H(G,C)})}catch(O){M.error("bootstrapDirectives","directive_instantiation_error",O,{selector:C})}}function S(B){return M.logMethodArgs?.("@directive",B),function(C,H){if(H.kind!=="class")throw Error("@directive can only be used on classes");P.push({selector:B,constructor:C})}}import{delay as X}from"@alwatr/delay";import{createLogger as Y}from"@alwatr/logger";class Z{selector_;logger_;element_;cleanupTaskList__=[];constructor(B,C){this.logger_=Y(`directive:${C}`),this.logger_.logMethodArgs?.("new",{selector:C,element:B}),this.selector_=C,this.element_=B,(async()=>{await X.nextMicrotask(),await this.init_()})()}init_(){this.logger_.logMethod?.("init_"),this.update_?.()}dispatch_(B,C){this.logger_.logMethodArgs?.("dispatch_",{eventName:B,detail:C}),this.element_.dispatchEvent(new CustomEvent(B,{detail:C,bubbles:!0}))}onDestroy_(B){this.logger_.logMethod?.("onDestroy_"),this.cleanupTaskList__.push(B)}destroy_(){if(this.logger_.logMethod?.("destroy_"),this.cleanupTaskList__.length>0){for(let B of this.cleanupTaskList__)try{B.call(this)}catch(C){this.logger_.error("destroy_","error_in_destroy_callback",C)}this.cleanupTaskList__.length=0}this.element_
|
|
1
|
+
/* 📦 @alwatr/synapse v9.2.1 */
|
|
2
|
+
import{createLogger as V}from"@alwatr/logger";var M=V("alwatr/synapse"),P=[];var U="synapse";function W(B=document.body){if(M.logMethod?.("bootstrapDirectives"),document.readyState==="loading"){M.incident?.("bootstrapDirectives","dom_not_ready","Delaying directive initialization until DOM is ready"),document.addEventListener("DOMContentLoaded",()=>{W(B)},{once:!0});return}for(let{selector:C,constructor:H}of P)try{let O=`${C}:not([${U}])`,F=B.querySelectorAll(O);if(F.length===0)continue;M.logOther?.(`Found ${F.length} new element(s) for directive "${C}"`),F.forEach((G)=>{G.setAttribute(U,""),new H(G,C)})}catch(O){M.error("bootstrapDirectives","directive_instantiation_error",O,{selector:C})}}function S(B){return M.logMethodArgs?.("@directive",B),function(C,H){if(H.kind!=="class")throw Error("@directive can only be used on classes");P.push({selector:B,constructor:C})}}import{delay as X}from"@alwatr/delay";import{createLogger as Y}from"@alwatr/logger";class Z{selector_;logger_;element_;cleanupTaskList__=[];constructor(B,C){this.logger_=Y(`directive:${C}`),this.logger_.logMethodArgs?.("new",{selector:C,element:B}),this.selector_=C,this.element_=B,(async()=>{await X.nextMicrotask(),await this.init_()})()}init_(){this.logger_.logMethod?.("init_"),this.update_?.()}dispatch_(B,C){this.logger_.logMethodArgs?.("dispatch_",{eventName:B,detail:C}),this.element_.dispatchEvent(new CustomEvent(B,{detail:C,bubbles:!0}))}onDestroy_(B){this.logger_.logMethod?.("onDestroy_"),this.cleanupTaskList__.push(B)}destroy_(){if(this.logger_.logMethod?.("destroy_"),this.cleanupTaskList__.length>0){for(let B of this.cleanupTaskList__)try{B.call(this)}catch(C){this.logger_.error("destroy_","error_in_destroy_callback",C)}this.cleanupTaskList__.length=0}this.element_?.remove(),this.element_=null}}function k(B,C=!0,H){return function(O,F){if(F.kind!=="accessor")throw Error('@query can only be used with the "accessor" keyword');let G=Symbol(`${String(F.name)}__`);return{get(){let J=this[G];if(J===void 0||C===!1){let Q=H??this.element_;J=this[G]=Q.querySelector(B)}return J}}}}function z(B,C=!0,H){return function(O,F){if(F.kind!=="accessor")throw Error('@queryAll can only be used with the "accessor" keyword');let G=Symbol(`${String(F.name)}__`);return{get(){let J=this[G];if(J===void 0||C===!1){let Q=H??this.element_;J=this[G]=Q.querySelectorAll(B)}return J}}}}export{z as queryAll,k as query,S as directive,W as bootstrapDirectives,Z as DirectiveBase};
|
|
3
3
|
|
|
4
|
-
//# debugId=
|
|
4
|
+
//# debugId=04FDD9230163DBB064756E2164756E21
|
|
5
5
|
//# sourceMappingURL=main.js.map
|
package/dist/main.js.map
CHANGED
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
"import {createLogger} from '@alwatr/logger';\n\nimport type {DirectiveConstructor} from './directive-decorator.js';\n\n/**\n * Alwatr Synapse Logger.\n */\nexport const logger = createLogger('alwatr/synapse');\n\n/**\n * The registry for all directives.\n */\nexport const directiveRegistry_: {selector: string; constructor: DirectiveConstructor}[] = [];\n",
|
|
6
6
|
"import {directiveRegistry_, logger} from './lib.js';\n\nconst initializedAttribute = 'synapse';\n\n/**\n * Initializes all registered directives within a given root element.\n * If no root element is provided, it scans the entire body.\n *\n * This function is idempotent; it will not re-initialize a directive on an element\n * that has already been processed.\n *\n * @param rootElement The element to scan for directives. Defaults to `document.body`.\n *\n * @example\n * ```ts\n * // Initialize directives on the whole page after the DOM is loaded.\n * document.addEventListener('DOMContentLoaded', () => bootstrapDirectives());\n *\n * // Or, initialize directives on a dynamically added part of the page.\n * const newContent = document.createElement('div');\n * newContent.innerHTML = '<div class=\"my-button\">Click Me</div>';\n * document.body.appendChild(newContent);\n *\n * bootstrapDirectives(newContent);\n * ```\n */\nexport function bootstrapDirectives(rootElement: Element | Document = document.body): void {\n logger.logMethod?.('bootstrapDirectives');\n\n if (document.readyState === 'loading') {\n logger.incident?.('bootstrapDirectives', 'dom_not_ready', 'Delaying directive initialization until DOM is ready');\n document.addEventListener('DOMContentLoaded', () => {\n bootstrapDirectives(rootElement);\n }, {once: true});\n return;\n }\n\n for (const {selector, constructor} of directiveRegistry_) {\n try {\n const uninitializedSelector = `${selector}:not([${initializedAttribute}])`;\n const elements = rootElement.querySelectorAll<HTMLElement>(uninitializedSelector);\n if (elements.length === 0) continue;\n\n logger.logOther?.(`Found ${elements.length} new element(s) for directive \"${selector}\"`);\n elements.forEach((element) => {\n // Mark the element as processed before creating an instance\n element.setAttribute(initializedAttribute, '');\n // Instantiate the directive with the element.\n new constructor(element, selector);\n });\n }\n catch (err) {\n logger.error('bootstrapDirectives', 'directive_instantiation_error', err, {selector});\n }\n }\n}\n",
|
|
7
7
|
"import { directiveRegistry_, logger } from './lib.js';\n\nimport type { DirectiveBase } from './directive-class.js';\n\n/**\n * Type definition for a directive constructor.\n * A directive class must have a constructor that accepts an HTMLElement.\n */\nexport type DirectiveConstructor<T extends DirectiveBase = DirectiveBase> = new (element: HTMLElement, selector: string) => T;\n\n/**\n * A class decorator that registers a class as a directive.\n *\n * @param selector The CSS selector to which this directive will be attached.\n *\n * @example\n * ```ts\n * @directive('.my-button')\n * class MyButtonDirective extends DirectiveBase {\n * protected update_(): void {\n * this.element_.addEventListener('click', () => console.log('Button clicked!'));\n * }\n * }\n * ```\n */\nexport function directive(selector: string) {\n logger.logMethodArgs?.('@directive', selector);\n\n /**\n * The decorator function that receives the class constructor.\n * @param constructor The class to be registered as a directive.\n * @param context The decorator context.\n */\n return function (constructor: DirectiveConstructor, context: ClassDecoratorContext): void {\n if (context.kind !== 'class') {\n throw new Error('@directive can only be used on classes');\n }\n\n directiveRegistry_.push({\n selector,\n constructor\n });\n };\n}\n",
|
|
8
|
-
"/**\n * @package @alwatr/synapse\n *\n * This file defines the `DirectiveBase` class, which is the foundation for creating custom directives\n * in the Alwatr Synapse library. Directives are used to attach behavior and logic to DOM elements\n * declaratively.\n */\n\nimport {delay} from '@alwatr/delay';\nimport {createLogger} from '@alwatr/logger';\n\n/**\n * The abstract base class for all directives.\n *\n * Extend this class to create a new directive that can be registered with the `@directive` decorator.\n * It provides the core functionality for linking a TypeScript class to a DOM element and managing its lifecycle.\n *\n * @example\n * ```ts\n * import {DirectiveBase, directive} from '@alwatr/synapse';\n *\n * @directive('[my-directive]')\n * export class MyDirective extends DirectiveBase {\n * protected override init_(): void {\n * super.init_(); // فراخوانی متد والد برای حفظ سازگاری با نسخههای قبل ضروری است\n * this.element_.textContent = 'Hello from MyDirective!';\n * this.element_.addEventListener('click', () => this.log('Element clicked!'));\n * }\n * }\n * ```\n */\nexport abstract class DirectiveBase {\n /**\n * The CSS selector that this directive is associated with.\n * This is the selector string provided to the `@directive` decorator.\n */\n protected readonly selector_;\n\n /**\n * A dedicated logger instance for this directive, pre-configured with a context like `directive:[selector]`.\n * Use this for logging to provide clear, contextual messages.\n */\n protected readonly logger_;\n\n /**\n * The DOM element to which this directive instance is attached.\n * All directive logic operates on this element.\n */\n protected readonly element_: HTMLElement;\n\n /**\n * A list of callback functions to be executed when the directive is destroyed.\n */\n private readonly cleanupTaskList__: NoopFunc[] = [];\n\n /**\n * Initializes the directive. This constructor is called by the Synapse bootstrap process and should not be\n * overridden in subclasses.\n *\n * It sets up the logger, element, and selector, and then schedules the `init_` and `update_` lifecycle methods\n * to run in the next microtask.\n *\n * @param element The DOM element to which this directive is attached.\n * @param selector The CSS selector that matched this directive.\n */\n constructor(element: HTMLElement, selector: string) {\n this.logger_ = createLogger(`directive:${selector}`);\n this.logger_.logMethodArgs?.('new', {selector, element});\n\n this.selector_ = selector;\n this.element_ = element;\n\n (async () => {\n await delay.nextMicrotask();\n await this.init_();\n })();\n }\n\n /**\n * Called once automatically after the directive is initialized.\n *\n * This method serves as the main entry point for your directive's logic,\n * such as modifying the element or setting up event listeners.\n *\n * **Note:** Do not call this method directly. It is designed to be called only once by the framework.\n */\n protected init_(): Awaitable<void> {\n this.logger_.logMethod?.('init_');\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (this as any).update_?.(); // backward compatibility\n }\n\n /**\n * Dispatches a custom event from the target element.\n *\n * This is a convenience method for firing events that can be listened to by other parts of the application.\n * The event bubbles up through the DOM.\n *\n * @param eventName The name of the custom event.\n * @param detail Optional data to include in the event's `detail` property.\n *\n * @example\n * ```ts\n * this.dispatch_('user-action', {action: 'save', id: 123});\n * ```\n */\n protected dispatch_(eventName: string, detail?: unknown): void {\n this.logger_.logMethodArgs?.('dispatch_', {eventName, detail});\n this.element_.dispatchEvent(new CustomEvent(eventName, {detail, bubbles: true}));\n }\n\n /**\n * Registers a task to be executed when the directive is destroyed.\n * Follows the `on[Event]` pattern, similar to `onClick`.\n * Useful for cleaning up resources, such as unsubscribing from signals or removing global event listeners.\n *\n * @param task The cleanup task to register.\n *\n * @example\n * ```ts\n * this.onDestroy(\n * signal.subscribe(() => this.log('signal changed')).unsubscribe\n * );\n * ```\n */\n protected onDestroy_(task: NoopFunc): void {\n this.logger_.logMethod?.('onDestroy_');\n this.cleanupTaskList__.push(task);\n }\n\n /**\n * Cleans up the directive's resources.\n *\n * This method removes the element from the DOM and nullifies the internal reference to it,\n * helping with garbage collection. It can be extended by subclasses to perform additional cleanup,\n * such as removing event listeners.\n */\n protected destroy_(): Awaitable<void> {\n this.logger_.logMethod?.('destroy_');\n\n // Execute all registered cleanup tasks\n if (this.cleanupTaskList__.length > 0) {\n for (const task of this.cleanupTaskList__) {\n try {\n task.call(this);\n }\n catch (err) {\n this.logger_.error('destroy_', 'error_in_destroy_callback', err);\n }\n }\n\n this.cleanupTaskList__.length = 0; // clear the list after executing all tasks\n }\n\n this.element_
|
|
8
|
+
"/**\n * @package @alwatr/synapse\n *\n * This file defines the `DirectiveBase` class, which is the foundation for creating custom directives\n * in the Alwatr Synapse library. Directives are used to attach behavior and logic to DOM elements\n * declaratively.\n */\n\nimport {delay} from '@alwatr/delay';\nimport {createLogger} from '@alwatr/logger';\n\n/**\n * The abstract base class for all directives.\n *\n * Extend this class to create a new directive that can be registered with the `@directive` decorator.\n * It provides the core functionality for linking a TypeScript class to a DOM element and managing its lifecycle.\n *\n * @example\n * ```ts\n * import {DirectiveBase, directive} from '@alwatr/synapse';\n *\n * @directive('[my-directive]')\n * export class MyDirective extends DirectiveBase {\n * protected override init_(): void {\n * super.init_(); // فراخوانی متد والد برای حفظ سازگاری با نسخههای قبل ضروری است\n * this.element_.textContent = 'Hello from MyDirective!';\n * this.element_.addEventListener('click', () => this.log('Element clicked!'));\n * }\n * }\n * ```\n */\nexport abstract class DirectiveBase {\n /**\n * The CSS selector that this directive is associated with.\n * This is the selector string provided to the `@directive` decorator.\n */\n protected readonly selector_;\n\n /**\n * A dedicated logger instance for this directive, pre-configured with a context like `directive:[selector]`.\n * Use this for logging to provide clear, contextual messages.\n */\n protected readonly logger_;\n\n /**\n * The DOM element to which this directive instance is attached.\n * All directive logic operates on this element.\n */\n protected readonly element_: HTMLElement;\n\n /**\n * A list of callback functions to be executed when the directive is destroyed.\n */\n private readonly cleanupTaskList__: NoopFunc[] = [];\n\n /**\n * Initializes the directive. This constructor is called by the Synapse bootstrap process and should not be\n * overridden in subclasses.\n *\n * It sets up the logger, element, and selector, and then schedules the `init_` and `update_` lifecycle methods\n * to run in the next microtask.\n *\n * @param element The DOM element to which this directive is attached.\n * @param selector The CSS selector that matched this directive.\n */\n constructor(element: HTMLElement, selector: string) {\n this.logger_ = createLogger(`directive:${selector}`);\n this.logger_.logMethodArgs?.('new', {selector, element});\n\n this.selector_ = selector;\n this.element_ = element;\n\n (async () => {\n await delay.nextMicrotask();\n await this.init_();\n })();\n }\n\n /**\n * Called once automatically after the directive is initialized.\n *\n * This method serves as the main entry point for your directive's logic,\n * such as modifying the element or setting up event listeners.\n *\n * **Note:** Do not call this method directly. It is designed to be called only once by the framework.\n */\n protected init_(): Awaitable<void> {\n this.logger_.logMethod?.('init_');\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (this as any).update_?.(); // backward compatibility\n }\n\n /**\n * Dispatches a custom event from the target element.\n *\n * This is a convenience method for firing events that can be listened to by other parts of the application.\n * The event bubbles up through the DOM.\n *\n * @param eventName The name of the custom event.\n * @param detail Optional data to include in the event's `detail` property.\n *\n * @example\n * ```ts\n * this.dispatch_('user-action', {action: 'save', id: 123});\n * ```\n */\n protected dispatch_(eventName: string, detail?: unknown): void {\n this.logger_.logMethodArgs?.('dispatch_', {eventName, detail});\n this.element_.dispatchEvent(new CustomEvent(eventName, {detail, bubbles: true}));\n }\n\n /**\n * Registers a task to be executed when the directive is destroyed.\n * Follows the `on[Event]` pattern, similar to `onClick`.\n * Useful for cleaning up resources, such as unsubscribing from signals or removing global event listeners.\n *\n * @param task The cleanup task to register.\n *\n * @example\n * ```ts\n * this.onDestroy(\n * signal.subscribe(() => this.log('signal changed')).unsubscribe\n * );\n * ```\n */\n protected onDestroy_(task: NoopFunc): void {\n this.logger_.logMethod?.('onDestroy_');\n this.cleanupTaskList__.push(task);\n }\n\n /**\n * Cleans up the directive's resources.\n *\n * This method removes the element from the DOM and nullifies the internal reference to it,\n * helping with garbage collection. It can be extended by subclasses to perform additional cleanup,\n * such as removing event listeners.\n */\n protected destroy_(): Awaitable<void> {\n this.logger_.logMethod?.('destroy_');\n\n // Execute all registered cleanup tasks\n if (this.cleanupTaskList__.length > 0) {\n for (const task of this.cleanupTaskList__) {\n try {\n task.call(this);\n }\n catch (err) {\n this.logger_.error('destroy_', 'error_in_destroy_callback', err);\n }\n }\n\n this.cleanupTaskList__.length = 0; // clear the list after executing all tasks\n }\n\n this.element_?.remove();\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (this as any).element_ = null;\n }\n}\n",
|
|
9
9
|
"/* eslint-disable @typescript-eslint/no-explicit-any */\nimport type { DirectiveBase } from './directive-class.js';\n\n/**\n * A property decorator that queries the directive's element for a selector.\n * The query is performed once and the result is cached.\n *\n * @param selector The CSS selector to query for.\n * @param cache Whether to cache the result on first access. Defaults is true.\n * @param root Optional root element to perform the query on. Defaults to the directive's element.\n *\n * @example\n * ```ts\n * @directive('[my-directive]')\n * class MyDirective extends DirectiveBase {\n * @query('.my-element')\n * protected myElement!: HTMLDivElement | null;\n * }\n * ```\n */\nexport function query<T extends Element>(selector: string, cache = true, root?: ParentNode) {\n /**\n * The decorator function that receives the property accessor.\n * @param target The prototype of the class.\n * @param context The decorator context.\n * @return A property descriptor with a getter that performs the query and caches the result.\n */\n return function (\n _target: ClassAccessorDecoratorTarget<DirectiveBase, T | null>,\n context: ClassAccessorDecoratorContext<DirectiveBase, T | null>\n ): ClassAccessorDecoratorResult<DirectiveBase, T | null> {\n if (context.kind !== 'accessor') {\n throw new Error('@query can only be used with the \"accessor\" keyword');\n }\n\n const privateKey = Symbol(`${String(context.name)}__`);\n\n return {\n get() {\n let value = (this as any)[privateKey] as T | null | undefined;\n if (value === undefined || cache === false) {\n const parent = root ?? this.element_;\n value = (this as any)[privateKey] = parent.querySelector<T>(selector);\n }\n return value;\n }\n };\n };\n}\n\n/**\n * A property decorator that queries the directive's element for all selectors.\n * The queries are performed once and the result is cached.\n *\n * @param selector The CSS selector to query for.\n * @param cache Whether to cache the result on first access. Defaults is true.\n * @param root Optional root element to perform the query on. Defaults to the directive's element.\n *\n * @example\n * ```ts\n * @directive('[my-directive]')\n * class MyDirective extends DirectiveBase {\n * @queryAll('.my-elements')\n * protected myElements!: NodeListOf<HTMLDivElement>;\n * }\n * ```\n */\nexport function queryAll<T extends Element>(selector: string, cache = true, root?: ParentNode) {\n /**\n * The decorator function that receives the property accessor.\n * @param target The prototype of the class.\n * @param context The decorator context.\n * @return A property descriptor with a getter that performs the query and caches the result.\n */\n return function (\n _target: ClassAccessorDecoratorTarget<DirectiveBase, NodeListOf<T>>,\n context: ClassAccessorDecoratorContext<DirectiveBase, NodeListOf<T>>\n ): ClassAccessorDecoratorResult<DirectiveBase, NodeListOf<T>> {\n if (context.kind !== 'accessor') {\n throw new Error('@queryAll can only be used with the \"accessor\" keyword');\n }\n\n const privateKey = Symbol(`${String(context.name)}__`);\n\n return {\n get() {\n let value = (this as any)[privateKey] as NodeListOf<T> | undefined;\n if (value === undefined || cache === false) {\n const parent = root ?? this.element_;\n value = (this as any)[privateKey] = parent.querySelectorAll<T>(selector);\n }\n return value;\n }\n };\n };\n}\n"
|
|
10
10
|
],
|
|
11
|
-
"mappings": ";AAAA,uBAAQ,uBAOD,IAAM,EAAS,EAAa,gBAAgB,EAKtC,EAA8E,CAAC,ECV5F,IAAM,EAAuB,UAwBtB,SAAS,CAAmB,CAAC,EAAkC,SAAS,KAAY,CAGzF,GAFA,EAAO,YAAY,qBAAqB,EAEpC,SAAS,aAAe,UAAW,CACrC,EAAO,WAAW,sBAAuB,gBAAiB,sDAAsD,EAChH,SAAS,iBAAiB,mBAAoB,IAAM,CAClD,EAAoB,CAAW,GAC9B,CAAC,KAAM,EAAI,CAAC,EACf,OAGF,QAAY,WAAU,iBAAgB,EACpC,GAAI,CACF,IAAM,EAAwB,GAAG,UAAiB,MAC5C,EAAW,EAAY,iBAA8B,CAAqB,EAChF,GAAI,EAAS,SAAW,EAAG,SAE3B,EAAO,WAAW,SAAS,EAAS,wCAAwC,IAAW,EACvF,EAAS,QAAQ,CAAC,IAAY,CAE5B,EAAQ,aAAa,EAAsB,EAAE,EAE7C,IAAI,EAAY,EAAS,CAAQ,EAClC,EAEH,MAAO,EAAK,CACV,EAAO,MAAM,sBAAuB,gCAAiC,EAAK,CAAC,UAAQ,CAAC,GC3BnF,SAAS,CAAS,CAAC,EAAkB,CAQ1C,OAPA,EAAO,gBAAgB,aAAc,CAAQ,EAOtC,QAAS,CAAC,EAAmC,EAAsC,CACxF,GAAI,EAAQ,OAAS,QACnB,MAAU,MAAM,wCAAwC,EAG1D,EAAmB,KAAK,CACtB,WACA,aACF,CAAC,GCjCL,gBAAQ,sBACR,uBAAQ,uBAsBD,MAAe,CAAc,CAKf,UAMA,QAMA,SAKF,kBAAgC,CAAC,EAYlD,WAAW,CAAC,EAAsB,EAAkB,CAClD,KAAK,QAAU,EAAa,aAAa,GAAU,EACnD,KA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GAAI,CACF,EAAK,KAAK,IAAI,EAEhB,MAAO,EAAK,CACV,KAAK,QAAQ,MAAM,WAAY,4BAA6B,CAAG,EAInE,KAAK,kBAAkB,OAAS,EAGlC,KAAK,UAAU,OAAO,EAErB,KAAa,SAAW,KAE7B,CC3IO,SAAS,CAAwB,CAAC,EAAkB,EAAQ,GAAM,EAAmB,CAO1F,OAAO,QAAS,CACd,EACA,EACuD,CACvD,GAAI,EAAQ,OAAS,WACnB,MAAU,MAAM,qDAAqD,EAGvE,IAAM,EAAa,OAAO,GAAG,OAAO,EAAQ,IAAI,KAAK,EAErD,MAAO,CACL,GAAG,EAAG,CACJ,IAAI,EAAS,KAAa,GAC1B,GAAI,IAAU,QAAa,IAAU,GAAO,CAC1C,IAAM,EAAS,GAAQ,KAAK,SAC5B,EAAS,KAAa,GAAc,EAAO,cAAiB,CAAQ,EAEtE,OAAO,EAEX,GAqBG,SAAS,CAA2B,CAAC,EAAkB,EAAQ,GAAM,EAAmB,CAO7F,OAAO,QAAS,CACd,EACA,EAC4D,CAC5D,GAAI,EAAQ,OAAS,WACnB,MAAU,MAAM,wDAAwD,EAG1E,IAAM,EAAa,OAAO,GAAG,OAAO,EAAQ,IAAI,KAAK,EAErD,MAAO,CACL,GAAG,EAAG,CACJ,IAAI,EAAS,KAAa,GAC1B,GAAI,IAAU,QAAa,IAAU,GAAO,CAC1C,IAAM,EAAS,GAAQ,KAAK,SAC5B,EAAS,KAAa,GAAc,EAAO,iBAAoB,CAAQ,EAEzE,OAAO,EAEX",
|
|
12
|
+
"debugId": "04FDD9230163DBB064756E2164756E21",
|
|
13
13
|
"names": []
|
|
14
14
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alwatr/synapse",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.2.1",
|
|
4
4
|
"description": "Connect your TypeScript classes to the DOM, declaratively.",
|
|
5
5
|
"license": "MPL-2.0",
|
|
6
6
|
"author": "S. Ali Mihandoost <ali.mihandoost@gmail.com> (https://ali.mihandoost.com)",
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
},
|
|
22
22
|
"sideEffects": false,
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@alwatr/delay": "9.
|
|
25
|
-
"@alwatr/logger": "9.
|
|
24
|
+
"@alwatr/delay": "9.2.1",
|
|
25
|
+
"@alwatr/logger": "9.2.1"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@alwatr/nano-build": "9.1.1",
|
|
@@ -79,5 +79,5 @@
|
|
|
79
79
|
"web-components",
|
|
80
80
|
"web-development"
|
|
81
81
|
],
|
|
82
|
-
"gitHead": "
|
|
82
|
+
"gitHead": "b9dc0cb8b04b16216d44fbe9a9682f2a57926167"
|
|
83
83
|
}
|
package/src/directive-class.ts
CHANGED
|
@@ -153,7 +153,7 @@ export abstract class DirectiveBase {
|
|
|
153
153
|
this.cleanupTaskList__.length = 0; // clear the list after executing all tasks
|
|
154
154
|
}
|
|
155
155
|
|
|
156
|
-
this.element_
|
|
156
|
+
this.element_?.remove();
|
|
157
157
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
158
158
|
(this as any).element_ = null;
|
|
159
159
|
}
|