@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 +20 -0
- package/ai-description.txt +14 -19
- package/ai-types.txt +181 -531
- package/dist/library.js +605 -550
- package/dist/src/classes/Geo.d.ts +1 -1
- package/dist/src/classes/GeoInstance.d.ts +1 -1
- package/dist/src/classes/UrlItem.d.ts +71 -0
- package/dist/src/library.d.ts +1 -0
- package/package.json +1 -1
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
|
package/ai-description.txt
CHANGED
|
@@ -1,23 +1,18 @@
|
|
|
1
|
-
This library is a comprehensive,
|
|
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
|
|
4
|
-
|
|
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
|
-
|
|
11
|
-
-
|
|
12
|
-
-
|
|
13
|
-
-
|
|
14
|
-
-
|
|
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
|
-
|
|
17
|
-
-
|
|
18
|
-
-
|
|
19
|
-
-
|
|
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
|
-
|
|
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.
|