@dxtmisha/functional 1.11.10 → 1.11.12
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 +21 -0
- package/ai-description.txt +1 -5
- package/ai-doc.ru.txt +11 -0
- package/ai-doc.txt +11 -0
- package/ai-types.txt +260 -277
- package/dist/library.js +409 -390
- package/dist/src/classes/ref/ListDataRef.d.ts +7 -0
- package/dist/src/composables/ref/useApiAsyncRef.d.ts +64 -12
- package/dist/src/composables/ref/useApiDelete.d.ts +10 -2
- package/dist/src/composables/ref/useApiGet.d.ts +10 -2
- package/dist/src/composables/ref/useApiManagementAsyncRef.d.ts +11 -4
- package/dist/src/composables/ref/useApiManagementRef.d.ts +5 -3
- package/dist/src/composables/ref/useApiPost.d.ts +10 -2
- package/dist/src/composables/ref/useApiPut.d.ts +10 -2
- package/dist/src/composables/ref/useApiRef.d.ts +65 -12
- package/dist/src/composables/ref/useApiRequest.d.ts +9 -2
- package/dist/src/functions/ref/getApiErrorRef.d.ts +10 -0
- package/dist/src/library.d.ts +1 -0
- package/dist/src/types/apiTypes.d.ts +5 -1
- package/dist/src/types/listTypes.d.ts +2 -0
- package/package.json +2 -3
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,27 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
|
|
5
|
+
## [1.11.12] - 2026-05-17
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
- **getApiErrorRef**: Added a new helper function for reactive extraction of error objects (`ApiErrorItem`) from API response data, simplifying error handling in components.
|
|
9
|
+
|
|
10
|
+
### Changed / Improved
|
|
11
|
+
- **API Composables Refactoring**: Refactored `useApiRequest`, `useApiRef`, and all HTTP method-specific composables (`useApiGet`, `useApiPost`, `useApiPut`, `useApiDelete`) to support the new `ErrorCenter` and `ApiErrorStorage` contracts.
|
|
12
|
+
- **Documentation**: Substantially expanded bilingual (EN/RU) JSDoc documentation for all API composables. Added detailed examples for validating response contracts using `@effect/schema` (`validateResponseContract`) and managing potential request errors via `errorContract` (`ApiErrorStorageList`).
|
|
13
|
+
- **Tests**: Significantly expanded test coverage with new comprehensive unit tests for `useApiGet`, `useApiPost`, `useApiPut`, and `useApiDelete`.
|
|
14
|
+
|
|
15
|
+
## [1.11.11] - 2026-05-14
|
|
16
|
+
|
|
17
|
+
### Added
|
|
18
|
+
- **ListDataRef**: Introduced `getFocusItem()` method to retrieve the full data object of the currently focused list item, facilitating advanced keyboard navigation and interaction handling.
|
|
19
|
+
- **Types**: Added `disabled` property to the `ListDataItem` interface to support standardized state management for list items.
|
|
20
|
+
|
|
21
|
+
### Changed / Improved
|
|
22
|
+
- **Build System**: Refactored the distribution structure to standardize type definition paths and optimize the export map for better compatibility with modern bundlers.
|
|
23
|
+
- **Peer Dependencies**: Refined the `peerDependencies` configuration to ensure more robust integration with Vue and the core functional-basic package.
|
|
24
|
+
- **Maintenance**: Performed internal cleanup of the package configuration and updated build scripts to align with monorepo standards.
|
|
25
|
+
|
|
5
26
|
## [1.11.9] - 2026-05-12
|
|
6
27
|
|
|
7
28
|
### Added
|
package/ai-description.txt
CHANGED
|
@@ -1,5 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
An AI should study this library when implementing a design system requiring standardized class-based component logic or when building data-intensive interfaces that need integrated searching, filtering, and CRUD operations via useApiManagementRef. It is indispensable for scenarios involving multi-tab state synchronization, SEO management (useMeta), and reactive internationalization (useTranslateRef) where DOM synchronization must be automated.
|
|
4
|
-
|
|
5
|
-
The library integrates directly with Vue 3 and vue-router, acting as a reactive middleware layer over @dxtmisha/functional-basic. It utilizes a singleton management pattern (executeUse) for global service orchestration and relies heavily on Ref and ComputedRef to maintain its internal state machine and lifecycle hooks.
|
|
1
|
+
A foundational utility and abstraction framework for Vue 3 designed to bridge functional logic with reactive component architecture. It provides a standardized constructor pattern for component development, comprehensive API orchestration, and advanced internationalization capabilities. The library is indispensable for implementing structured component lifecycles using the DesignConstructorAbstract pattern to automate the generation of dynamic classes, styles, and VNodes. It should be studied when building data-heavy interfaces requiring complex API management (GET/POST/PUT/DELETE) with integrated client-side searching, list formatting, and skeleton states via useApiManagementRef. It is critical for applications requiring deep localization, providing reactive wrappers for Intl-based formatting of numbers, currencies, dates, and geographic flag management. Use cases include managing application-wide singletons via the executeUse pattern, reactive SEO meta-tag synchronization, and specialized reactive utilities for DOM events, cookies, and IntersectionObserver integration. Built specifically for Vue 3 environments, it extends the core reactivity system with specialized computed properties and handles VNode rendering within its abstraction classes. It maintains a direct dependency on @dxtmisha/functional-basic for underlying logic and integrates with vue-router for routing-aware state management.
|
package/ai-doc.ru.txt
CHANGED
|
@@ -32,3 +32,14 @@
|
|
|
32
32
|
});
|
|
33
33
|
```
|
|
34
34
|
5. В самом Vue-компоненте просто импортируйте и вызывайте созданный синглтон-хук: `const { list, loading, sendPost } = useUserManagement();`
|
|
35
|
+
|
|
36
|
+
ВЫБОР СТРАТЕГИИ executeUse:
|
|
37
|
+
1. `executeUseLocal` (ПРЕДПОЧТИТЕЛЬНО):
|
|
38
|
+
- Когда использовать: Для большинства API-запросов и сервисов.
|
|
39
|
+
- Особенности: Работает «лениво» (lazy) — инициализируется только в момент первого вызова. Экземпляр сохраняется до конца сессии. Это позволяет не перегружать старт приложения лишними запросами.
|
|
40
|
+
2. `executeUseGlobal`:
|
|
41
|
+
- Когда использовать: Когда данные или сервис должны быть загружены/инициализированы СРАЗУ при старте приложения (например: критические настройки, SDK).
|
|
42
|
+
- Особенности: Создает один экземпляр на всё приложение. Все глобальные синглтоны инициализируются принудительно через `executeUseGlobalInit()`.
|
|
43
|
+
3. `executeUseProvide`:
|
|
44
|
+
- Когда использовать: Для состояния, разделяемого между родителем и группой дочерних компонентов (например: табы, сложные формы с подкомпонентами).
|
|
45
|
+
- Особенности: Использует provide/inject. Первый компонент в дереве, вызвавший хук, становится «провайдером», остальные — потребителями.
|
package/ai-doc.txt
CHANGED
|
@@ -32,3 +32,14 @@ Strictly follow these rules for their application:
|
|
|
32
32
|
});
|
|
33
33
|
```
|
|
34
34
|
5. Within the Vue component itself, simply import and call your custom singleton composable: `const { list, loading, sendPost } = useUserManagement();`
|
|
35
|
+
|
|
36
|
+
CHOOSING THE executeUse STRATEGY:
|
|
37
|
+
1. `executeUseLocal` (PREFERRED):
|
|
38
|
+
- When to use: For most API requests and services.
|
|
39
|
+
- Key Features: Works "lazily" (lazy initialization) — initializes only when first called. The instance persists until the end of the session. This prevents overloading the application start with unnecessary requests.
|
|
40
|
+
2. `executeUseGlobal`:
|
|
41
|
+
- When to use: When data or a service must be loaded/initialized IMMEDIATELY at application start (e.g., critical settings, SDKs).
|
|
42
|
+
- Key Features: Creates a single instance for the entire application. All global singletons are forcibly initialized via `executeUseGlobalInit()`.
|
|
43
|
+
3. `executeUseProvide`:
|
|
44
|
+
- When to use: For state shared between a parent and a group of child components (e.g., tabs, complex forms with sub-components).
|
|
45
|
+
- Key Features: Uses provide/inject. The first component in the tree that calls the hook becomes the "provider", others become consumers.
|