@dxtmisha/functional-basic 1.6.1 → 1.6.3

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,22 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
+ ## [1.6.2] - 2026-07-06
6
+
7
+ ### Changed
8
+ - **Documentation**: Updated AI documentation and developer guides (`ai-doc.md`, `ai-doc.ru.md`) with explicit rules for structuring, exporting, and managing types, interfaces, enums, and API schemas (specifically mandating the use of `@effect/schema` when available in project dependencies).
9
+
10
+ ## [1.6.1] - 2026-07-04
11
+
12
+ ### Changed
13
+ - **Build System**: Corrected the `types` and `exports` mapping paths in `package.json` from `dist/src/library.d.ts` to `dist/library.d.ts`.
14
+
15
+ ## [1.6.0] - 2026-07-03
16
+
17
+ ### Added
18
+ - **isMetaKey**: Introduced `isMetaKey` utility function to detect active modifier key presses (`metaKey`, `altKey`, `ctrlKey`) in KeyboardEvent objects.
19
+ - **Tests**: Created a comprehensive test suite `isMetaKey.test.ts` to verify modifier key detection.
20
+
5
21
  ## [1.5.0] - 2026-07-02
6
22
 
7
23
  ### Added
package/ai-description.md CHANGED
@@ -1,21 +1,19 @@
1
- Core Purpose: This library is a comprehensive isomorphic toolkit for web application development, providing high-level abstractions for API communication (fetch/caching/hydration), internationalization (translations/formatting), localized date/time manipulation, persistent data storage (Cookie/LocalStorage), reactive URL state management (Hash/Query), and DOM event handling.
1
+ ### Core Purpose
2
+ The library provides an isomorphic utility framework for managing high-level application concerns in JavaScript/TypeScript environments (SSR and DOM). It includes robust abstractions for API communication (REST/Fetch), structured state management, DOM-safe event handling, internationalization, and reactive data storage.
2
3
 
3
- Key Expositions:
4
- 1. Api & ApiInstance: Orchestrates HTTP requests with support for middleware (preparation/end), automatic hydration for SSR, request caching, and centralized error handling.
5
- 2. Geo, GeoIntl, GeoFlag, GeoPhone, GeoUnit: A suite for locale-sensitive data handling including currency, date, numeric, and unit conversions (metric/imperial based on region).
6
- 3. Meta, MetaOg, MetaTwitter: Declarative management of HTML head tags, Open Graph, and Twitter Cards.
7
- 4. DataStorage, CookieStorage, ServerStorage: Unified persistent storage interfaces with built-in SSR data isolation and hydration support.
8
- 5. SearchList: A specialized state machine for filtering, matching, and highlighting item collections based on column definitions and regex search.
9
- 6. EventItem: A robust wrapper for DOM listeners that includes auto-cleanup, lifecycle control, and specialized optimizations (e.g., resize/scroll-sync).
10
- 7. Translation System: Asynchronous/Synchronous multi-locale translation manager with fallback logic and file-based loading.
4
+ ### Key Expositions
5
+ * **API & Networking**: `Api` (singleton interface), `ApiInstance` (core requester), `ApiCache` (request memoization), `ApiError` (centralized error handling), `ApiHydration` (SSR data serialization), and `ApiHeaders`.
6
+ * **State & Storage**: `DataStorage` (persistent storage with prefixes/expiration), `ServerStorage` (SSR-safe context isolation), `CookieStorage` (isomorphic cookie management), `Query`/`Hash` (URL-state management), and `Global` (app-wide data).
7
+ * **UI & Events**: `EventItem` (DOM-safe, optimized event management with `ResizeObserver` and `scroll-sync`), `LoadingInstance` (global loading state), and `ScrollbarWidth` (layout utility).
8
+ * **Localization & Formatting**: `Geo` (locale/timezone management), `GeoIntl` (Intl API wrapper), `GeoUnit` (metric/imperial conversion), `Translate` (i18n), and `Formatters` (currency, number, date, and pluralization utility).
9
+ * **Utilities & Data**: `Formatters`, `SearchList` (search matching/caching), `ResumableTimer`, and a suite of functional utilities for object cloning, string/date manipulation, and DOM operations.
11
10
 
12
- Triggers for Studying ai-types.md:
13
- It is mandatory to analyze ai-types.md when:
14
- - You need to extend or define custom configurations for the API layer (ApiConfig, ApiFetch).
15
- - You are implementing custom Error/Exception handling logic using the ErrorCenter structures.
16
- - You are adding new locale definitions, phone mask structures, or unit conversion mappings.
17
- - You need to debug hydration mismatches between SSR and client-side data state.
18
- - You are extending search logic or defining new search list result types.
11
+ ### Triggers for Studying ai-types.md
12
+ Review `ai-types.md` whenever the following requirements arise:
13
+ 1. **API Integration**: You need to implement new request methods, custom error handling for specific HTTP status codes, or configure global API middleware (`wrapper`/`preparation`).
14
+ 2. **I18n/Formatting**: You are dealing with complex localization rules, unit conversions (Geo/Units), or pluralization requirements.
15
+ 3. **SSR Consistency**: You are implementing features that must function identically on both the server and client (Hydration, `ServerStorage`, or `Datetime` formatting).
16
+ 4. **Complex State**: You need to map or query data structures in memory using `SearchList` or utilize `BroadcastChannel` for cross-context messaging.
19
17
 
20
- Integration Context:
21
- This library serves as the foundation layer for application state and external communication. It is designed to be used in conjunction with modern reactive frameworks (Vue/React) by leveraging the provided hydration hooks to synchronize state between the server environment and the browser client. It relies on the global DOM environment where available, but degrades to neutral behaviors or errors in non-browser environments to ensure compatibility with SSR processes.
18
+ ### Integration Context
19
+ The library acts as a foundational service layer between the application logic and the runtime environment. It is designed to be framework-agnostic but is particularly optimized for SSR-heavy environments (like Vue/React) where hydration of state (via `ServerStorage`) and safe access to global browser objects (via `isDomRuntime`) are critical. It wraps native `fetch`, `localStorage`, `sessionStorage`, `BroadcastChannel`, and `Intl` APIs into structured, type-safe, and singleton-accessible services.
package/ai-doc.md CHANGED
@@ -53,6 +53,12 @@ Members in every class MUST be ordered in the following sequence:
53
53
  * Use `ServerStorage.get('key', () => new Instance())` for request-isolated singletons.
54
54
  * Use `isDomRuntime()` checks before accessing browser-only APIs like `window`, `document`, or `location`.
55
55
 
56
+ 3. TYPES, INTERFACES, AND ENUMS
57
+ - Location: All types, interfaces, and enums must be located in the `src/types` directory if it exists in the project. If the `src/types` directory does not exist, they must be defined in the same file where they are used.
58
+ - Naming: All files containing types must have the suffix `Types` in their name (e.g., `*Types.ts` or `*Types.d.ts`).
59
+ - Export: All types, interfaces, and enums must be explicitly exported.
60
+ - API Types/Schemas: All types and interfaces for working with APIs must be defined/generated using the `@effect/schema` library if it is present in the project's dependencies (if the project is a monorepo, also check root dependencies).
61
+
56
62
  =============================================================================
57
63
  DEVELOPER GUIDE: USING `@dxtmisha/functional-basic` AS A LIBRARY
58
64
  =============================================================================