@dxtmisha/functional-basic 1.3.7 → 1.3.9

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,26 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
+ ## [1.3.9] - 2026-06-17
6
+
7
+ ### Changed / Improved
8
+ - **GeoInstance**: Extended `setValueDefault` to accept functional callbacks: `code?: string | (() => string)`. Dynamic resolution via `executeFunction` is performed when fallback to the default code occurs.
9
+ - **Geo**: Updated static `setValueDefault` signature to accept a function parameter `string | (() => string)`.
10
+
11
+ ## [1.3.8] - 2026-06-16
12
+
13
+ ### Added
14
+ - **UrlItem**: Introduced a new isomorphic utility class for parsing, inspecting, and modifying URLs. It provides read-only getters for standard URL parts (`href`, `protocol`, `pathname`, `hash`, etc.), a single `set()` method to update the URL value, and a static `getInstance()` method to retrieve a request-isolated instance from `ServerStorage`.
15
+ - **Tests**: Created a comprehensive test suite `UrlItem.test.ts` to verify parsing fallbacks in SSR/DOM environments, property values, and `getInstance` request-isolation behavior.
16
+
17
+ ## [1.3.7] - 2026-06-16
18
+
19
+ ### Added
20
+ - **Geo**: Added static `setValueDefault` method to configure the default country/language code.
21
+
22
+ ### Changed / Improved
23
+ - **GeoInstance**: Updated `setValueDefault` to dynamically re-evaluate and update the active location, item, and language properties when a new default code is assigned.
24
+
5
25
  ## [1.3.6] - 2026-06-16
6
26
 
7
27
  ### Added
@@ -1,23 +1,18 @@
1
- This library is a comprehensive, SSR-compatible utility collection for TypeScript/JavaScript web applications, providing a standardized interface for common web development tasks. It functions as a modular framework rather than a single-purpose library, offering unified management for data persistence, HTTP requests, UI state, and localization.
1
+ This library is a comprehensive, isomorphic utility toolkit for TypeScript applications, focusing on data management, HTTP communication, internationalization, and DOM manipulation.
2
2
 
3
- Core components include:
4
- 1. HTTP API Management: A centralized `ApiInstance` supporting request/response interception, auto-hydration for SSR, caching, and structured error handling via `ApiErrorStorage`.
5
- 2. Storage & State: Wrappers for `localStorage`, `sessionStorage` (`DataStorage`), `cookies` (`CookieStorage`), and a global data registry.
6
- 3. Localization: Extensive support for internationalization, including date/number/currency formatting (`GeoIntl`) and a translation system (`TranslateInstance`).
7
- 4. DOM/Utility Tools: Event listeners (`EventItem`) with SSR safety, scrollbar width detection, responsive image/file processing, and type-safe utilities for arrays, objects, and strings.
8
- 5. Meta Management: Structured handling of standard HTML, Open Graph, and Twitter meta tags.
3
+ 1. Core Purpose:
4
+ The library acts as a centralized foundation for common application tasks. It provides a robust HTTP client (Fetch wrapper with built-in retries, caching, and hydration support), state management (localized storage, cookie handling, URL hash synchronization), internationalization (translation management, date/time/currency formatting), and DOM utility functions (event listeners, scroll management, meta tag management).
9
5
 
10
- The library is indispensable for enterprise-scale applications requiring:
11
- - Seamless SSR hydration for API data and global states.
12
- - Standardized error reporting and centralized API/translation configuration.
13
- - Consistent formatting (dates, currency, units) across varied geographic locales.
14
- - Managed event lifecycle and DOM interaction in complex, dynamic interfaces.
6
+ 2. Usage Scenarios:
7
+ - API Orchestration: Use the Api/ApiInstance classes for unified fetch requests, centralized error handling (ErrorCenter), and automatic response caching.
8
+ - State Synchronization: Essential for SSR-compliant state management (ServerStorage) and syncing application state with URL hashes or Cookies.
9
+ - Localization: Indispensable for applications requiring multi-language support (Translate), dynamic date/time formatting (GeoIntl, Datetime), and locale-aware number/currency formatting.
10
+ - DOM & Event Management: Use EventItem for lifecycle-safe event listeners (with automatic cleanup) and scroll/resize optimizations; use Meta and its derivatives for SEO and social media metadata management.
11
+ - Data Processing: Highly useful for search-as-you-type implementations (SearchList) and complex data transformations (Formatters).
15
12
 
16
- An AI coding assistant should study this library when tasked with:
17
- - Implementing or refactoring data fetching and API communication layers.
18
- - Standardizing internationalization (i18n) and data formatting logic.
19
- - Managing persistent client-side storage with built-in SSR support.
20
- - Orchestrating complex DOM events or managing high-frequency UI synchronization (e.g., scroll/resize).
21
- - Implementing SEO metadata management across SSR pages.
13
+ 3. Integration Context:
14
+ - SSR & Hydration: The library includes specialized handlers (ApiHydration, ServerStorage, getHydrationData) designed to bridge the gap between server-rendered state and client-side execution, preventing hydration mismatches.
15
+ - Architecture: It follows a singleton-friendly patterns (e.g., Api.getItem(), Geo.getObject()) that facilitate global access to state and configurations across disparate modules without tight coupling.
16
+ - Type Safety: Extensively typed (TypeScript), providing full autocompletion and structural validation for search, API, translation, and formatting configurations.
22
17
 
23
- The library integrates primarily with native Web APIs (Fetch, localStorage, etc.) and provides a consistent high-level abstraction layer, making it suitable for any framework-agnostic or framework-specific project (e.g., Vue or React) that requires robust state and IO management.
18
+ An AI assistant should study this library when tasked with building enterprise-grade, localized web applications that require standardized API communication, cross-browser DOM event management, or robust SSR data state serialization.