@dxtmisha/functional-basic 1.3.15 → 1.4.0

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/CHANGELOG.md CHANGED
@@ -2,6 +2,20 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
+ ## [1.4.0] - 2026-06-22
6
+
7
+ ### Added
8
+ - **UrlInstanceAbstract**: Created base abstract class managing shared reactive state properties and methods (`data`, `watch`, `block`, `time`, `get()`, `set()`, `addWatch()`, `removeWatch()`, `reload()`, `initData()`, `makeWatch()`) for URL-based state instances.
9
+ - **UrlItem**: Added `getParams()` to parse URL parameters into an object with type transformations, and `setParams(params)` to replace and filter empty, null, or undefined parameters.
10
+ - **UrlItem**: Added comprehensive unit tests in `UrlItem.test.ts` for verifying parameter retrieval and mutation logic.
11
+
12
+ ### Changed
13
+ - **HashInstance**: Refactored to extend `UrlInstanceAbstract`, inheriting all core state management properties and handlers.
14
+ - **QueryInstance**: Refactored to extend `UrlInstanceAbstract` and delegate query parameter reading/writing to `UrlItem.getParams()` and `UrlItem.setParams()`, ensuring SSR compatibility.
15
+
16
+ ### Fixed
17
+ - **QueryInstance**: Updated `QueryInstance.test.ts` to run under the `jsdom` test environment, fixing `window is not defined` execution errors, and enhanced mocking setup.
18
+
5
19
  ## [1.3.15] - 2026-06-19
6
20
 
7
21
  ### Added
package/ai-description.md CHANGED
@@ -1,18 +1,25 @@
1
- Core Purpose: This library provides a comprehensive, isomorphic toolkit for web applications, specifically focusing on SSR-ready API interaction, state-consistent storage (Cookies, Local/SessionStorage, ServerStorage), internationalization (i18n), and robust DOM event/UI management.
1
+ The provided library is a comprehensive isomorphic toolkit for managing frontend and SSR-compatible application states, including API requests, internationalization, data persistence, and UI utilities.
2
+
3
+ Core Purpose:
4
+ Facilitates full-stack state management and utility-based data handling, providing standardized interfaces for HTTP requests (with caching and error handling), localization (Geo/Translation), storage (Cookie/Storage/Hash/Query), and DOM event synchronization.
2
5
 
3
6
  Key Expositions:
4
- - Api: Centralized HTTP client managing requests, hydration, caching (ApiCache), and centralized error handling (ApiErrorStorage).
5
- - Storage: Persistent utilities including DataStorage (local/session), CookieStorage, and ServerStorage (SSR-aware).
6
- - Geo & Locale: GeoInstance, GeoIntl, and GeoFlag provide location-aware formatting (currencies, dates, numbers, units, phone masks).
7
- - UI/Utility: Meta management (Meta, MetaOg, MetaTwitter), event handling (EventItem), icon management (Icons), and search utilities (SearchList).
8
- - Formatting: Formatters class for templated data manipulation (currency, date, pluralization, unit conversion).
7
+ - Api: Singleton-based HTTP client (supports fetch, caching, hydration, and error normalization via ApiErrorStorage).
8
+ - Geo & GeoIntl: Internationalization framework for locale-aware number, date, currency, and phone number formatting.
9
+ - Meta, MetaOg, MetaTwitter: Declarative meta-tag management for SEO and social sharing.
10
+ - DataStorage & CookieStorage: Persistent storage wrappers (LocalStorage/SessionStorage/Cookie) with SSR context isolation.
11
+ - EventItem: Reactive DOM event wrapper supporting ResizeObserver and scroll synchronization.
12
+ - Translate & TranslateFile: Asynchronous translation engine with support for dynamic loading and key replacement.
13
+ - SearchList: Logic for client-side search indexing, matching, and highlighting within data lists.
14
+ - Utils: A broad collection of pure functional utilities (e.g., `copyObject`, `toNumber`, `isFilled`, `sleep`, `frame`).
9
15
 
10
16
  Triggers for Studying ai-types.md:
11
- - When implementing API integration (Api, ApiFetch, ApiMethod).
12
- - When configuring global error handling (ErrorCenter, ApiError).
13
- - When managing SSR state or hydration (ServerStorage, ApiHydration).
14
- - When handling localization (Geo, GeoIntl, Translate, Formatters).
15
- - When configuring complex data search logic (SearchList, SearchColumns).
16
- - When defining custom meta-tags or Twitter/Open Graph cards (Meta, MetaOg, MetaTwitter).
17
+ - When implementing or debugging API integration (Api, ApiInstance, ApiResponse).
18
+ - When configuring global error handling (ErrorCenter).
19
+ - When standardizing data localization or date/time formatting (Geo, GeoIntl, Datetime).
20
+ - When managing complex SSR hydration patterns (ServerStorage, ApiHydration).
21
+ - When integrating deep-search components (SearchList).
22
+ - When developing custom UI components requiring lifecycle-safe event binding (EventItem).
17
23
 
18
- Integration Context: This library acts as a foundational service layer. It is designed to be injected or used as a singleton across the application stack, bridging client-side DOM operations with server-side context in SSR frameworks. It manages the lifecycle of data, authentication headers, and global configuration, serving as an abstraction layer over native Browser/Node.js APIs like fetch, Cookies, and BroadcastChannel.
24
+ Integration Context:
25
+ Operates as a foundational layer in the stack, compatible with both browser and Node.js (SSR) environments. It acts as a dependency for managing global application state, handling data-driven side effects, and normalizing communication with backend services. It is designed to be injected into frameworks (Vue/React) via lifecycle hooks or custom configuration providers.