@dxtmisha/functional-basic 1.4.3 → 1.6.1

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.
Files changed (191) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/ai-description.md +18 -19
  3. package/ai-types.md +102 -142
  4. package/dist/{src/classes → classes}/ErrorCenter.d.ts +7 -0
  5. package/dist/{src/classes → classes}/ErrorCenterHandler.d.ts +10 -0
  6. package/dist/{src/classes → classes}/ErrorCenterInstance.d.ts +8 -0
  7. package/dist/classes/GeoUnit.d.ts +207 -0
  8. package/dist/functions/isMetaKey.d.ts +8 -0
  9. package/dist/{src/library.d.ts → library.d.ts} +2 -0
  10. package/dist/library.js +595 -474
  11. package/dist/types/geoTypes.d.ts +142 -0
  12. package/package.json +4 -4
  13. package/dist/src/types/geoTypes.d.ts +0 -98
  14. /package/dist/{src/classes → classes}/Api.d.ts +0 -0
  15. /package/dist/{src/classes → classes}/ApiCache.d.ts +0 -0
  16. /package/dist/{src/classes → classes}/ApiDataReturn.d.ts +0 -0
  17. /package/dist/{src/classes → classes}/ApiDefault.d.ts +0 -0
  18. /package/dist/{src/classes → classes}/ApiError.d.ts +0 -0
  19. /package/dist/{src/classes → classes}/ApiErrorItem.d.ts +0 -0
  20. /package/dist/{src/classes → classes}/ApiErrorStorage.d.ts +0 -0
  21. /package/dist/{src/classes → classes}/ApiHeaders.d.ts +0 -0
  22. /package/dist/{src/classes → classes}/ApiHydration.d.ts +0 -0
  23. /package/dist/{src/classes → classes}/ApiInstance.d.ts +0 -0
  24. /package/dist/{src/classes → classes}/ApiPreparation.d.ts +0 -0
  25. /package/dist/{src/classes → classes}/ApiResponse.d.ts +0 -0
  26. /package/dist/{src/classes → classes}/ApiStatus.d.ts +0 -0
  27. /package/dist/{src/classes → classes}/BroadcastMessage.d.ts +0 -0
  28. /package/dist/{src/classes → classes}/Cache.d.ts +0 -0
  29. /package/dist/{src/classes → classes}/CacheItem.d.ts +0 -0
  30. /package/dist/{src/classes → classes}/CacheStatic.d.ts +0 -0
  31. /package/dist/{src/classes → classes}/Cookie.d.ts +0 -0
  32. /package/dist/{src/classes → classes}/CookieBlock.d.ts +0 -0
  33. /package/dist/{src/classes → classes}/CookieBlockInstance.d.ts +0 -0
  34. /package/dist/{src/classes → classes}/CookieStorage.d.ts +0 -0
  35. /package/dist/{src/classes → classes}/DataStorage.d.ts +0 -0
  36. /package/dist/{src/classes → classes}/Datetime.d.ts +0 -0
  37. /package/dist/{src/classes → classes}/EventItem.d.ts +0 -0
  38. /package/dist/{src/classes → classes}/Formatters.d.ts +0 -0
  39. /package/dist/{src/classes → classes}/Geo.d.ts +0 -0
  40. /package/dist/{src/classes → classes}/GeoFlag.d.ts +0 -0
  41. /package/dist/{src/classes → classes}/GeoInstance.d.ts +0 -0
  42. /package/dist/{src/classes → classes}/GeoIntl.d.ts +0 -0
  43. /package/dist/{src/classes → classes}/GeoPhone.d.ts +0 -0
  44. /package/dist/{src/classes → classes}/Global.d.ts +0 -0
  45. /package/dist/{src/classes → classes}/Hash.d.ts +0 -0
  46. /package/dist/{src/classes → classes}/HashInstance.d.ts +0 -0
  47. /package/dist/{src/classes → classes}/Icons.d.ts +0 -0
  48. /package/dist/{src/classes → classes}/Loading.d.ts +0 -0
  49. /package/dist/{src/classes → classes}/LoadingInstance.d.ts +0 -0
  50. /package/dist/{src/classes → classes}/Meta.d.ts +0 -0
  51. /package/dist/{src/classes → classes}/MetaManager.d.ts +0 -0
  52. /package/dist/{src/classes → classes}/MetaOg.d.ts +0 -0
  53. /package/dist/{src/classes → classes}/MetaStatic.d.ts +0 -0
  54. /package/dist/{src/classes → classes}/MetaTwitter.d.ts +0 -0
  55. /package/dist/{src/classes → classes}/Query.d.ts +0 -0
  56. /package/dist/{src/classes → classes}/QueryInstance.d.ts +0 -0
  57. /package/dist/{src/classes → classes}/ResumableTimer.d.ts +0 -0
  58. /package/dist/{src/classes → classes}/ScrollbarWidth.d.ts +0 -0
  59. /package/dist/{src/classes → classes}/SearchList.d.ts +0 -0
  60. /package/dist/{src/classes → classes}/SearchListData.d.ts +0 -0
  61. /package/dist/{src/classes → classes}/SearchListItem.d.ts +0 -0
  62. /package/dist/{src/classes → classes}/SearchListMatcher.d.ts +0 -0
  63. /package/dist/{src/classes → classes}/SearchListOptions.d.ts +0 -0
  64. /package/dist/{src/classes → classes}/ServerStorage.d.ts +0 -0
  65. /package/dist/{src/classes → classes}/StorageCallback.d.ts +0 -0
  66. /package/dist/{src/classes → classes}/Translate.d.ts +0 -0
  67. /package/dist/{src/classes → classes}/TranslateFile.d.ts +0 -0
  68. /package/dist/{src/classes → classes}/TranslateInstance.d.ts +0 -0
  69. /package/dist/{src/classes → classes}/UrlInstanceAbstract.d.ts +0 -0
  70. /package/dist/{src/classes → classes}/UrlItem.d.ts +0 -0
  71. /package/dist/{src/functions → functions}/addTagHighlightMatch.d.ts +0 -0
  72. /package/dist/{src/functions → functions}/anyToString.d.ts +0 -0
  73. /package/dist/{src/functions → functions}/applyTemplate.d.ts +0 -0
  74. /package/dist/{src/functions → functions}/arrFill.d.ts +0 -0
  75. /package/dist/{src/functions → functions}/blobToBase64.d.ts +0 -0
  76. /package/dist/{src/functions → functions}/capitalize.d.ts +0 -0
  77. /package/dist/{src/functions → functions}/copyObject.d.ts +0 -0
  78. /package/dist/{src/functions → functions}/copyObjectLite.d.ts +0 -0
  79. /package/dist/{src/functions → functions}/createElement.d.ts +0 -0
  80. /package/dist/{src/functions → functions}/domQuerySelector.d.ts +0 -0
  81. /package/dist/{src/functions → functions}/domQuerySelectorAll.d.ts +0 -0
  82. /package/dist/{src/functions → functions}/encodeAttribute.d.ts +0 -0
  83. /package/dist/{src/functions → functions}/encodeLiteAttribute.d.ts +0 -0
  84. /package/dist/{src/functions → functions}/ensureMaxSize.d.ts +0 -0
  85. /package/dist/{src/functions → functions}/escapeExp.d.ts +0 -0
  86. /package/dist/{src/functions → functions}/eventStopPropagation.d.ts +0 -0
  87. /package/dist/{src/functions → functions}/executeFunction.d.ts +0 -0
  88. /package/dist/{src/functions → functions}/executePromise.d.ts +0 -0
  89. /package/dist/{src/functions → functions}/forEach.d.ts +0 -0
  90. /package/dist/{src/functions → functions}/frame.d.ts +0 -0
  91. /package/dist/{src/functions → functions}/getArrayHighlightMatch.d.ts +0 -0
  92. /package/dist/{src/functions → functions}/getAttributes.d.ts +0 -0
  93. /package/dist/{src/functions → functions}/getClipboardData.d.ts +0 -0
  94. /package/dist/{src/functions → functions}/getColumn.d.ts +0 -0
  95. /package/dist/{src/functions → functions}/getCurrentDate.d.ts +0 -0
  96. /package/dist/{src/functions → functions}/getCurrentTime.d.ts +0 -0
  97. /package/dist/{src/functions → functions}/getElement.d.ts +0 -0
  98. /package/dist/{src/functions → functions}/getElementId.d.ts +0 -0
  99. /package/dist/{src/functions → functions}/getElementImage.d.ts +0 -0
  100. /package/dist/{src/functions → functions}/getElementItem.d.ts +0 -0
  101. /package/dist/{src/functions → functions}/getElementOrWindow.d.ts +0 -0
  102. /package/dist/{src/functions → functions}/getElementSafeScript.d.ts +0 -0
  103. /package/dist/{src/functions → functions}/getExactSearchExp.d.ts +0 -0
  104. /package/dist/{src/functions → functions}/getExp.d.ts +0 -0
  105. /package/dist/{src/functions → functions}/getFirst.d.ts +0 -0
  106. /package/dist/{src/functions → functions}/getHydrationData.d.ts +0 -0
  107. /package/dist/{src/functions → functions}/getItemByPath.d.ts +0 -0
  108. /package/dist/{src/functions → functions}/getKey.d.ts +0 -0
  109. /package/dist/{src/functions → functions}/getLength.d.ts +0 -0
  110. /package/dist/{src/functions → functions}/getLengthOfAllArray.d.ts +0 -0
  111. /package/dist/{src/functions → functions}/getMaxLengthAllArray.d.ts +0 -0
  112. /package/dist/{src/functions → functions}/getMinLengthAllArray.d.ts +0 -0
  113. /package/dist/{src/functions → functions}/getMouseClient.d.ts +0 -0
  114. /package/dist/{src/functions → functions}/getMouseClientX.d.ts +0 -0
  115. /package/dist/{src/functions → functions}/getMouseClientY.d.ts +0 -0
  116. /package/dist/{src/functions → functions}/getObjectByKeys.d.ts +0 -0
  117. /package/dist/{src/functions → functions}/getObjectNoUndefined.d.ts +0 -0
  118. /package/dist/{src/functions → functions}/getObjectOrNone.d.ts +0 -0
  119. /package/dist/{src/functions → functions}/getOnlyText.d.ts +0 -0
  120. /package/dist/{src/functions → functions}/getRandomText.d.ts +0 -0
  121. /package/dist/{src/functions → functions}/getRequestString.d.ts +0 -0
  122. /package/dist/{src/functions → functions}/getSearchExp.d.ts +0 -0
  123. /package/dist/{src/functions → functions}/getSeparatingSearchExp.d.ts +0 -0
  124. /package/dist/{src/functions → functions}/getStepPercent.d.ts +0 -0
  125. /package/dist/{src/functions → functions}/getStepValue.d.ts +0 -0
  126. /package/dist/{src/functions → functions}/goScroll.d.ts +0 -0
  127. /package/dist/{src/functions → functions}/goScrollSmooth.d.ts +0 -0
  128. /package/dist/{src/functions → functions}/goScrollTo.d.ts +0 -0
  129. /package/dist/{src/functions → functions}/handleShare.d.ts +0 -0
  130. /package/dist/{src/functions → functions}/inArray.d.ts +0 -0
  131. /package/dist/{src/functions → functions}/initScrollbarOffset.d.ts +0 -0
  132. /package/dist/{src/functions → functions}/intersectKey.d.ts +0 -0
  133. /package/dist/{src/functions → functions}/isApiSuccess.d.ts +0 -0
  134. /package/dist/{src/functions → functions}/isArray.d.ts +0 -0
  135. /package/dist/{src/functions → functions}/isDifferent.d.ts +0 -0
  136. /package/dist/{src/functions → functions}/isDomData.d.ts +0 -0
  137. /package/dist/{src/functions → functions}/isDomRuntime.d.ts +0 -0
  138. /package/dist/{src/functions → functions}/isElementVisible.d.ts +0 -0
  139. /package/dist/{src/functions → functions}/isEnter.d.ts +0 -0
  140. /package/dist/{src/functions → functions}/isFilled.d.ts +0 -0
  141. /package/dist/{src/functions → functions}/isFloat.d.ts +0 -0
  142. /package/dist/{src/functions → functions}/isFunction.d.ts +0 -0
  143. /package/dist/{src/functions → functions}/isInDom.d.ts +0 -0
  144. /package/dist/{src/functions → functions}/isInput.d.ts +0 -0
  145. /package/dist/{src/functions → functions}/isIntegerBetween.d.ts +0 -0
  146. /package/dist/{src/functions → functions}/isNull.d.ts +0 -0
  147. /package/dist/{src/functions → functions}/isNumber.d.ts +0 -0
  148. /package/dist/{src/functions → functions}/isObject.d.ts +0 -0
  149. /package/dist/{src/functions → functions}/isObjectNotArray.d.ts +0 -0
  150. /package/dist/{src/functions → functions}/isOnLine.d.ts +0 -0
  151. /package/dist/{src/functions → functions}/isSelected.d.ts +0 -0
  152. /package/dist/{src/functions → functions}/isSelectedByList.d.ts +0 -0
  153. /package/dist/{src/functions → functions}/isShare.d.ts +0 -0
  154. /package/dist/{src/functions → functions}/isString.d.ts +0 -0
  155. /package/dist/{src/functions → functions}/isTab.d.ts +0 -0
  156. /package/dist/{src/functions → functions}/isWindow.d.ts +0 -0
  157. /package/dist/{src/functions → functions}/random.d.ts +0 -0
  158. /package/dist/{src/functions → functions}/removeCommonPrefix.d.ts +0 -0
  159. /package/dist/{src/functions → functions}/replaceComponentName.d.ts +0 -0
  160. /package/dist/{src/functions → functions}/replaceRecursive.d.ts +0 -0
  161. /package/dist/{src/functions → functions}/replaceTemplate.d.ts +0 -0
  162. /package/dist/{src/functions → functions}/resizeImageByMax.d.ts +0 -0
  163. /package/dist/{src/functions → functions}/secondToTime.d.ts +0 -0
  164. /package/dist/{src/functions → functions}/setElementItem.d.ts +0 -0
  165. /package/dist/{src/functions → functions}/setValues.d.ts +0 -0
  166. /package/dist/{src/functions → functions}/sleep.d.ts +0 -0
  167. /package/dist/{src/functions → functions}/splice.d.ts +0 -0
  168. /package/dist/{src/functions → functions}/strFill.d.ts +0 -0
  169. /package/dist/{src/functions → functions}/strSplit.d.ts +0 -0
  170. /package/dist/{src/functions → functions}/toArray.d.ts +0 -0
  171. /package/dist/{src/functions → functions}/toCamelCase.d.ts +0 -0
  172. /package/dist/{src/functions → functions}/toCamelCaseFirst.d.ts +0 -0
  173. /package/dist/{src/functions → functions}/toDate.d.ts +0 -0
  174. /package/dist/{src/functions → functions}/toKebabCase.d.ts +0 -0
  175. /package/dist/{src/functions → functions}/toNumber.d.ts +0 -0
  176. /package/dist/{src/functions → functions}/toNumberByMax.d.ts +0 -0
  177. /package/dist/{src/functions → functions}/toPercent.d.ts +0 -0
  178. /package/dist/{src/functions → functions}/toPercentBy100.d.ts +0 -0
  179. /package/dist/{src/functions → functions}/toString.d.ts +0 -0
  180. /package/dist/{src/functions → functions}/transformation.d.ts +0 -0
  181. /package/dist/{src/functions → functions}/uint8ArrayToBase64.d.ts +0 -0
  182. /package/dist/{src/functions → functions}/uniqueArray.d.ts +0 -0
  183. /package/dist/{src/functions → functions}/writeClipboardData.d.ts +0 -0
  184. /package/dist/{src/media → media}/errorCauseList.d.ts +0 -0
  185. /package/dist/{src/types → types}/apiTypes.d.ts +0 -0
  186. /package/dist/{src/types → types}/basicTypes.d.ts +0 -0
  187. /package/dist/{src/types → types}/errorCenter.d.ts +0 -0
  188. /package/dist/{src/types → types}/formattersTypes.d.ts +0 -0
  189. /package/dist/{src/types → types}/metaTypes.d.ts +0 -0
  190. /package/dist/{src/types → types}/searchTypes.d.ts +0 -0
  191. /package/dist/{src/types → types}/translateTypes.d.ts +0 -0
package/CHANGELOG.md CHANGED
@@ -2,6 +2,23 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
+ ## [1.5.0] - 2026-07-02
6
+
7
+ ### Added
8
+ - **GeoUnit**: Introduced a new isomorphic class `GeoUnit` for localized unit formatting and automatic conversions (e.g. converting and formatting Celsius to Fahrenheit, grams to ounces, meters to feet) for customary unit systems (US, Myanmar, Liberia, UK).
9
+ - **Tests**: Created a comprehensive test suite `GeoUnit.test.ts` to verify unit translation and formatting across multiple locales.
10
+
11
+ ### Changed
12
+ - **geoTypes**: Standardized `GeoItem['unit']` property types in `geoTypes.ts` to use exact Unicode CLDR unit names.
13
+
14
+ ## [1.4.4] - 2026-06-27
15
+
16
+ ### Added
17
+ - **ErrorCenterHandler**: Introduced `callbacks` list and `addCallback(callback)` method to register callback functions that are executed on every triggered error.
18
+ - **ErrorCenterInstance**: Added `addCallback(callback)` instance method to register global error callbacks.
19
+ - **ErrorCenter**: Added static `addCallback(callback)` helper to simplify the registration of global error callbacks.
20
+ - **Tests**: Added comprehensive unit tests in `ErrorCenterHandler.test.ts`, `ErrorCenterInstance.test.ts`, and `ErrorCenter.test.ts` to verify the execution of global callbacks.
21
+
5
22
  ## [1.4.3] - 2026-06-25
6
23
 
7
24
  ### Changed
package/ai-description.md CHANGED
@@ -1,22 +1,21 @@
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.
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.
3
2
 
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.
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.
11
11
 
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`).
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.
20
19
 
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.
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.