@dxtmisha/functional-basic 1.4.0 → 1.4.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/CHANGELOG.md CHANGED
@@ -2,6 +2,21 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
+ ## [1.4.2] - 2026-06-25
6
+
7
+ ### Added
8
+ - **Api**: Added request wrapper support via a custom `wrapper` callback configuration option in both `ApiConfig` and `ApiFetch`, enabling developer interception or custom wrapping of the fetch request lifecycle.
9
+ - **Tests**: Added comprehensive unit tests for request wrapping options on both instance-level and individual request-level.
10
+
11
+ ## [1.4.1] - 2026-06-23
12
+
13
+ ### Added
14
+ - **GeoFlag**: Added language-specific metadata lookup and filtering methods:
15
+ - `getLanguage(code)`: Looks up language details and its flag icon.
16
+ - `getListLanguage(codes)`: Retrieves a list of unique languages without country duplicates.
17
+ - `getNationalLanguage(codes)`: Retrieves localized (national) language names.
18
+ - **geoTypes**: Extended `GeoFlagItem` type definition with `languageCode` and `countryCode` properties.
19
+
5
20
  ## [1.4.0] - 2026-06-22
6
21
 
7
22
  ### Added
package/ai-description.md CHANGED
@@ -1,25 +1,22 @@
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.
1
+ ### 1. Core Purpose
2
+ This library provides a comprehensive, isomorphic (SSR/Client) utility framework for web applications. It centralizes cross-cutting concerns, including HTTP request management with middleware/hooks, reactive URL state synchronization (Query/Hash), global configuration, internationalization, metadata management, and data caching.
2
3
 
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.
4
+ ### 2. Key Expositions
5
+ * **Networking**: `Api`, `ApiInstance`, and `ApiCache` manage HTTP requests, caching layers, error handling (`ApiError`), and SSR hydration.
6
+ * **State & Sync**: `QueryInstance` and `HashInstance` provide reactive, syncable interfaces for URL-based states. `DataStorage` handles `localStorage`/`sessionStorage` with SSR isolation.
7
+ * **Localization (Geo/Intl)**: `Geo`, `GeoInstance`, and `GeoIntl` manage locale, timezone, and phone mask logic. `Translate` and `TranslateInstance` provide file-based and API-backed localization.
8
+ * **UI Helpers**: `EventItem` (DOM event wrapper with memory leak protection), `Loading` (global load state), `Icons` (asset management), and `Formatters` (data display utilities).
9
+ * **Meta Management**: `Meta` and its manager classes control document `<head>` elements, including Open Graph and Twitter Cards.
10
+ * **Core Utilities**: A suite of functions in `src/functions/` for type-safe data transformation, deep object cloning, DOM manipulation, and URL encoding.
5
11
 
6
- Key Expositions:
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`).
12
+ ### 3. Triggers for Studying ai-types.md
13
+ The `ai-types.md` file is **mandatory** if the AI is tasked with:
14
+ * Extending or implementing new `ApiFetch` or `ApiConfig` interfaces.
15
+ * Integrating custom error handling via `ErrorCenter` or `ApiErrorStorageItem`.
16
+ * Extending geographical data schemas (`GeoItem`, `GeoPhoneValue`).
17
+ * Implementing new meta-tag configurations or Open Graph properties.
18
+ * Implementing search functionality using `SearchList` and associated types.
19
+ * **Crucial**: Whenever the task involves modifying request/response schemas or adding global middleware via `ApiInstance` options, as the types define strict constraints on request lifecycle hooks (`ApiPreparation`, `ApiPreparationEnd`).
15
20
 
16
- Triggers for Studying ai-types.md:
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).
23
-
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.
21
+ ### 4. Integration Context
22
+ The library acts as a foundational "System Toolkit." It is designed to be injected into frontend frameworks (Vue/React) via lifecycle-aware wrappers (e.g., triggering `createElement` only on mount). It bridge the gap between server (SSR) and client states through `ServerStorage` and `ApiHydration`, ensuring that state generated on the server is correctly transferred to the client without hydration mismatches.