@asor-studio/asor-core 1.0.8 → 1.0.10

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/index.d.ts CHANGED
@@ -592,6 +592,13 @@ interface DataElement {
592
592
  interface RegistryEntry<T = any> {
593
593
  propsIsUpdated: (props: T) => void;
594
594
  }
595
+ /**
596
+ * Registry element structure for component registrations
597
+ */
598
+ interface RegistryElement {
599
+ componentName: string;
600
+ destroy: () => void;
601
+ }
595
602
 
596
603
  /**
597
604
  * Base abstract class for Page/Component-level components following the Atomic Design pattern.
@@ -1980,6 +1987,7 @@ type Constructor<T = {}> = abstract new (...args: any[]) => T;
1980
1987
  */
1981
1988
  interface IStorageHandler<T = any> {
1982
1989
  propsStore: T;
1990
+ registryElement?: RegistryElement;
1983
1991
  storageHandlerDataChanges(prev: any, curr: any): void;
1984
1992
  }
1985
1993
  /**
@@ -2014,11 +2022,28 @@ interface IStorageHandler<T = any> {
2014
2022
  */
2015
2023
  declare function BaseHandlerMixin<T extends object = any, TBase extends Constructor = Constructor>(Base: TBase): Constructor<IStorageHandler<T> & {
2016
2024
  propsStore: T;
2025
+ registryElement: RegistryElement;
2017
2026
  storageHandlerDataChanges(prev: T, curr: T): void;
2018
2027
  }> & TBase;
2028
+ /**
2029
+ * Creates a flattened reactive proxy over a nested propsStore structure.
2030
+ *
2031
+ * The propsStore has shape: { rootKey1: { prop1: val, prop2: val }, rootKey2: { ... } }
2032
+ * This proxy flattens it so that accessing `proxy.prop1` reads from the correct rootKey,
2033
+ * and — critically — setting `proxy.prop1 = newValue` writes through the reactive proxy
2034
+ * on propsStore, triggering onChange and state updates.
2035
+ *
2036
+ * Without this proxy, `this.props.x = value` would write to a throwaway plain object
2037
+ * and the reactive set trap would never fire.
2038
+ *
2039
+ * @param propsStore - The reactive proxy wrapping the nested props structure
2040
+ * @returns A flattened proxy typed as T
2041
+ */
2042
+ declare function createFlattenedReactiveProxy<T>(propsStore: Record<string, any>): T;
2019
2043
 
2020
2044
  declare const BaseStorageComponent_base: _asor_studio_asor_core.Constructor<IStorageHandler<any> & {
2021
2045
  propsStore: any;
2046
+ registryElement: _asor_studio_asor_core.RegistryElement;
2022
2047
  storageHandlerDataChanges(prev: any, curr: any): void;
2023
2048
  }> & typeof BaseComponent;
2024
2049
  /**
@@ -2033,6 +2058,7 @@ declare const BaseStorageComponent_base: _asor_studio_asor_core.Constructor<ISto
2033
2058
  * - Reactive connection to state store
2034
2059
  * - Proxy-based prop-to-store synchronization
2035
2060
  * - Support for nested object updates
2061
+ * - Full object/array assignment reactivity (e.g. this.props.list = [...])
2036
2062
  *
2037
2063
  * @Directive - Can be extended by Angular components
2038
2064
  * @abstract - Must be extended, cannot be instantiated directly
@@ -2080,11 +2106,15 @@ declare const BaseStorageComponent_base: _asor_studio_asor_core.Constructor<ISto
2080
2106
  declare abstract class BaseStorageComponent<T extends object = Record<string, any>> extends BaseStorageComponent_base implements IStorageHandler<T> {
2081
2107
  /**
2082
2108
  * Typed props object for type-safe state management.
2083
- * This provides strongly-typed access to the propsStore from the mixin.
2084
- * The propsStore is flattened from a nested structure grouped by dataset root
2085
- * to a flat structure with direct property access while maintaining proxy reactivity.
2109
+ * Returns a flattened reactive proxy over propsStore so that both
2110
+ * read and write operations (including full object/array assignment)
2111
+ * are forwarded through the reactive proxy, triggering state updates.
2086
2112
  */
2087
2113
  get props(): T;
2114
+ /**
2115
+ * Override baseCompViewLeave to unregister from store
2116
+ */
2117
+ baseCompViewLeave(): void;
2088
2118
  constructor();
2089
2119
  static ɵfac: i0.ɵɵFactoryDeclaration<BaseStorageComponent<any>, never>;
2090
2120
  static ɵdir: i0.ɵɵDirectiveDeclaration<BaseStorageComponent<any>, never, never, {}, {}, never, never, true, never>;
@@ -2092,6 +2122,7 @@ declare abstract class BaseStorageComponent<T extends object = Record<string, an
2092
2122
 
2093
2123
  declare const BaseStorageMolecule_base: _asor_studio_asor_core.Constructor<IStorageHandler<any> & {
2094
2124
  propsStore: any;
2125
+ registryElement: _asor_studio_asor_core.RegistryElement;
2095
2126
  storageHandlerDataChanges(prev: any, curr: any): void;
2096
2127
  }> & typeof BaseMolecule;
2097
2128
  /**
@@ -2106,6 +2137,7 @@ declare const BaseStorageMolecule_base: _asor_studio_asor_core.Constructor<IStor
2106
2137
  * - Reactive connection to state store
2107
2138
  * - Proxy-based prop-to-store synchronization
2108
2139
  * - Support for nested object updates
2140
+ * - Full object/array assignment reactivity (e.g. this.props.list = [...])
2109
2141
  *
2110
2142
  * @Directive - Can be extended by Angular components
2111
2143
  * @abstract - Must be extended, cannot be instantiated directly
@@ -2167,11 +2199,15 @@ declare const BaseStorageMolecule_base: _asor_studio_asor_core.Constructor<IStor
2167
2199
  declare abstract class BaseStorageMolecule<T extends object = Record<string, any>> extends BaseStorageMolecule_base implements IStorageHandler<T> {
2168
2200
  /**
2169
2201
  * Typed props object for type-safe state management.
2170
- * This provides strongly-typed access to the propsStore from the mixin.
2171
- * The propsStore is flattened from a nested structure grouped by dataset root
2172
- * to a flat structure with direct property access while maintaining proxy reactivity.
2202
+ * Returns a flattened reactive proxy over propsStore so that both
2203
+ * read and write operations (including full object/array assignment)
2204
+ * are forwarded through the reactive proxy, triggering state updates.
2173
2205
  */
2174
2206
  get props(): T;
2207
+ /**
2208
+ * Override baseCompViewLeave to unregister from store
2209
+ */
2210
+ baseCompViewLeave(): void;
2175
2211
  constructor();
2176
2212
  static ɵfac: i0.ɵɵFactoryDeclaration<BaseStorageMolecule<any>, never>;
2177
2213
  static ɵdir: i0.ɵɵDirectiveDeclaration<BaseStorageMolecule<any>, never, never, {}, {}, never, never, true, never>;
@@ -2433,7 +2469,7 @@ declare class StateService implements IConsoleLoggable {
2433
2469
  */
2434
2470
  registry<T = any>(componentName: string, propStructure: {
2435
2471
  [key: string]: string;
2436
- }, callback: (props: T) => void): void;
2472
+ }, callback: (props: T) => void): RegistryElement;
2437
2473
  /**
2438
2474
  * Resolve properties from state based on mapping structure
2439
2475
  * @param propStructure Object mapping property names to state paths
@@ -2532,5 +2568,5 @@ declare class AsorWidgetComponent {
2532
2568
  static ɵcmp: i0.ɵɵComponentDeclaration<AsorWidgetComponent, "asor-core-widget", never, { "mode": { "alias": "mode"; "required": false; }; }, {}, never, never, true, never>;
2533
2569
  }
2534
2570
 
2535
- export { GlobalEnum_d as AsorGlobalEnum, StateConstants_d as AsorStorage, AsorWidgetComponent, AuthGuard, AuthUtility, BaseComponent, BaseHandlerMixin, BaseMolecule, BaseStorageComponent, BaseStorageMolecule, CacheInterceptor, CachePathUtility, CacheUtility, CollectionUtils, ConfigCache, ConfigConst, ConsoleLogsConfig, ConsoleLogsUtility, CookieUtils, ErrorInterceptor, HttpRequestHandler, NotifyErrorService, ObjectUtils, RandomUtils, RoutingUtility, StateConst, StateService, StringUtils, TranslatePipe, TranslateUtility };
2536
- export type { AsorWidgetMode, Constructor, CreateDataSetOption, DataElement, DataMethod, EncryptType, GenerateType, IAsorRoute, IAuth, IComp, ICompStatic, IComponent, IConnectDataSet, IConsoleLoggable, ICreateDataSet, IHttpAuthSubscribe, IHttpFormError, IHttpRequest, IHttpRequestHandlerConfig, IHttpResponseError, IHttpSubscribe, IMolecule, IPath, IStorageHandler, LogClassConfig, LogEntry, LogLevel, RegistryEntry, StateHandlerConfig, StoreType, UpdateDataSetOption };
2571
+ export { GlobalEnum_d as AsorGlobalEnum, StateConstants_d as AsorStorage, AsorWidgetComponent, AuthGuard, AuthUtility, BaseComponent, BaseHandlerMixin, BaseMolecule, BaseStorageComponent, BaseStorageMolecule, CacheInterceptor, CachePathUtility, CacheUtility, CollectionUtils, ConfigCache, ConfigConst, ConsoleLogsConfig, ConsoleLogsUtility, CookieUtils, ErrorInterceptor, HttpRequestHandler, NotifyErrorService, ObjectUtils, RandomUtils, RoutingUtility, StateConst, StateService, StringUtils, TranslatePipe, TranslateUtility, createFlattenedReactiveProxy };
2572
+ export type { AsorWidgetMode, Constructor, CreateDataSetOption, DataElement, DataMethod, EncryptType, GenerateType, IAsorRoute, IAuth, IComp, ICompStatic, IComponent, IConnectDataSet, IConsoleLoggable, ICreateDataSet, IHttpAuthSubscribe, IHttpFormError, IHttpRequest, IHttpRequestHandlerConfig, IHttpResponseError, IHttpSubscribe, IMolecule, IPath, IStorageHandler, LogClassConfig, LogEntry, LogLevel, RegistryElement, RegistryEntry, StateHandlerConfig, StoreType, UpdateDataSetOption };
package/package.json CHANGED
@@ -1,9 +1,10 @@
1
1
  {
2
2
  "name": "@asor-studio/asor-core",
3
- "version": "1.0.8",
3
+ "version": "1.0.10",
4
4
  "peerDependencies": {
5
- "@angular/common": "^20.3.0",
6
- "@angular/core": "^20.3.0"
5
+ "@angular/common": "^20.3.0 || ^21.0.0",
6
+ "@angular/core": "^20.3.0 || ^21.0.0",
7
+ "crypto-js": "^4.2.0"
7
8
  },
8
9
  "dependencies": {
9
10
  "tslib": "^2.3.0"