@cyberskill/shared 3.10.0 → 3.12.0

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 (215) hide show
  1. package/dist/config/commitlint/index.d.ts +1 -5
  2. package/dist/config/env/env.util.js.map +1 -1
  3. package/dist/config/env/index.d.ts +1 -3
  4. package/dist/config/eslint/index.d.ts +1 -1198
  5. package/dist/config/graphql-codegen/index.d.ts +1 -2
  6. package/dist/config/index.d.ts +1 -2
  7. package/dist/config/lint-staged/index.d.ts +1 -5
  8. package/dist/config/storybook/index.d.ts +1 -2
  9. package/dist/config/vitest/index.d.ts +1 -3
  10. package/dist/config/vitest/vitest.e2e.d.ts +1 -20
  11. package/dist/config/vitest/vitest.e2e.js +1 -1
  12. package/dist/config/vitest/vitest.unit.d.ts +1 -22
  13. package/dist/config/vitest/vitest.unit.js +1 -1
  14. package/dist/constant/index.d.ts +1 -5
  15. package/dist/constant/response-status.js.map +1 -1
  16. package/dist/node/apollo-server/index.d.ts +1 -2
  17. package/dist/node/cli/index.d.ts +1 -2
  18. package/dist/node/command/index.d.ts +1 -2
  19. package/dist/node/express/express.util.js.map +1 -1
  20. package/dist/node/express/index.d.ts +1 -2
  21. package/dist/node/fs/index.d.ts +1 -2
  22. package/dist/node/log/index.d.ts +1 -2
  23. package/dist/node/mongo/index.d.ts +1 -6
  24. package/dist/node/mongo/mongo.controller.helpers.js +20 -0
  25. package/dist/node/mongo/mongo.controller.helpers.js.map +1 -0
  26. package/dist/node/mongo/mongo.controller.native.js +65 -93
  27. package/dist/node/mongo/mongo.controller.native.js.map +1 -1
  28. package/dist/node/mongo/mongo.util.js.map +1 -1
  29. package/dist/node/package/index.d.ts +1 -2
  30. package/dist/node/path/index.d.ts +1 -2
  31. package/dist/node/storage/index.d.ts +1 -3
  32. package/dist/node/storage/index.js +3 -3
  33. package/dist/node/storage/storage.constant.js +2 -2
  34. package/dist/node/storage/storage.constant.js.map +1 -1
  35. package/dist/node/storage/storage.util.js +60 -68
  36. package/dist/node/storage/storage.util.js.map +1 -1
  37. package/dist/node/upload/index.d.ts +1 -3
  38. package/dist/node/upload/upload.type.js.map +1 -1
  39. package/dist/node/upload/upload.util.js +10 -2
  40. package/dist/node/upload/upload.util.js.map +1 -1
  41. package/dist/node/ws/index.d.ts +1 -2
  42. package/dist/node_modules/.pnpm/vitest@4.1.2_@types_node@25.5.0_jsdom@29.0.1_@noble_hashes@1.8.0__vite@8.0.3_@types_nod_0827261ede788764a5d99ac6bdf44bde/node_modules/vitest/dist/config.js +8 -0
  43. package/dist/node_modules/.pnpm/{vitest@4.1.0_@types_node@25.5.0_jsdom@29.0.0_@noble_hashes@1.8.0__vite@8.0.1_@types_nod_36acd00c2670b611b011192023dc5bd9 → vitest@4.1.2_@types_node@25.5.0_jsdom@29.0.1_@noble_hashes@1.8.0__vite@8.0.3_@types_nod_0827261ede788764a5d99ac6bdf44bde}/node_modules/vitest/dist/config.js.map +1 -1
  44. package/dist/react/apollo-client/index.d.ts +1 -9
  45. package/dist/react/apollo-client/links/index.d.ts +1 -1
  46. package/dist/react/apollo-client-nextjs/apollo-client-nextjs.rsc.d.ts +1 -16
  47. package/dist/react/apollo-client-nextjs/index.d.ts +1 -2
  48. package/dist/react/apollo-error/apollo-error.component.js +6 -2
  49. package/dist/react/apollo-error/apollo-error.component.js.map +1 -1
  50. package/dist/react/apollo-error/index.d.ts +1 -6
  51. package/dist/react/i18next/index.d.ts +1 -2
  52. package/dist/react/loading/index.d.ts +1 -5
  53. package/dist/react/log/index.d.ts +1 -2
  54. package/dist/react/next-intl/index.d.ts +1 -6
  55. package/dist/react/storage/index.d.ts +1 -2
  56. package/dist/react/storage/storage.hook.js.map +1 -1
  57. package/dist/react/storage/storage.util.js +15 -10
  58. package/dist/react/storage/storage.util.js.map +1 -1
  59. package/dist/react/toast/index.d.ts +1 -1
  60. package/dist/react/userback/index.d.ts +1 -2
  61. package/dist/src/config/commitlint/index.d.ts +5 -0
  62. package/dist/{config → src/config}/config.type.d.ts +1 -1
  63. package/dist/{config → src/config}/config.util.d.ts +1 -1
  64. package/dist/src/config/env/index.d.ts +3 -0
  65. package/dist/src/config/eslint/index.d.ts +1198 -0
  66. package/dist/src/config/graphql-codegen/index.d.ts +2 -0
  67. package/dist/src/config/index.d.ts +2 -0
  68. package/dist/src/config/lint-staged/index.d.ts +5 -0
  69. package/dist/src/config/storybook/index.d.ts +2 -0
  70. package/dist/src/config/vitest/index.d.ts +3 -0
  71. package/dist/src/config/vitest/vitest.e2e.d.ts +20 -0
  72. package/dist/src/config/vitest/vitest.unit.d.ts +22 -0
  73. package/dist/src/constant/index.d.ts +5 -0
  74. package/dist/{constant → src/constant}/response-status.d.ts +4 -0
  75. package/dist/src/node/apollo-server/index.d.ts +2 -0
  76. package/dist/src/node/cli/index.d.ts +2 -0
  77. package/dist/src/node/command/index.d.ts +2 -0
  78. package/dist/{node → src/node}/express/express.util.d.ts +6 -0
  79. package/dist/src/node/express/index.d.ts +2 -0
  80. package/dist/src/node/fs/index.d.ts +2 -0
  81. package/dist/src/node/log/index.d.ts +2 -0
  82. package/dist/{node → src/node}/log/log.type.d.ts +2 -2
  83. package/dist/{node → src/node}/log/log.util.d.ts +1 -1
  84. package/dist/src/node/mongo/index.d.ts +6 -0
  85. package/dist/src/node/mongo/mongo.controller.helpers.d.ts +43 -0
  86. package/dist/{node → src/node}/mongo/mongo.controller.mongoose.d.ts +1 -1
  87. package/dist/{node → src/node}/mongo/mongo.controller.native.d.ts +1 -1
  88. package/dist/{node → src/node}/mongo/mongo.controller.type.d.ts +1 -1
  89. package/dist/src/node/package/index.d.ts +2 -0
  90. package/dist/{node → src/node}/package/package.util.d.ts +1 -1
  91. package/dist/src/node/path/index.d.ts +2 -0
  92. package/dist/src/node/storage/index.d.ts +3 -0
  93. package/dist/src/node/storage/storage.constant.d.ts +1 -0
  94. package/dist/src/node/storage/storage.type.d.ts +3 -0
  95. package/dist/{node → src/node}/storage/storage.util.d.ts +1 -1
  96. package/dist/src/node/upload/index.d.ts +3 -0
  97. package/dist/{node → src/node}/upload/upload.type.d.ts +2 -0
  98. package/dist/{node → src/node}/upload/upload.util.d.ts +1 -1
  99. package/dist/src/node/ws/index.d.ts +2 -0
  100. package/dist/{react → src/react}/apollo-client/apollo-client.type.d.ts +1 -1
  101. package/dist/src/react/apollo-client/index.d.ts +9 -0
  102. package/dist/src/react/apollo-client/links/index.d.ts +1 -0
  103. package/dist/src/react/apollo-client-nextjs/apollo-client-nextjs.rsc.d.ts +16 -0
  104. package/dist/src/react/apollo-client-nextjs/index.d.ts +2 -0
  105. package/dist/src/react/apollo-error/index.d.ts +6 -0
  106. package/dist/src/react/i18next/index.d.ts +2 -0
  107. package/dist/src/react/loading/index.d.ts +5 -0
  108. package/dist/{react → src/react}/loading/loading.provider.d.ts +1 -1
  109. package/dist/src/react/log/index.d.ts +2 -0
  110. package/dist/src/react/log/log.type.d.ts +1 -0
  111. package/dist/{react → src/react}/log/log.util.d.ts +1 -1
  112. package/dist/src/react/next-intl/index.d.ts +6 -0
  113. package/dist/{react → src/react}/next-intl/next-intl.hoc.d.ts +1 -1
  114. package/dist/{react → src/react}/next-intl/next-intl.type.d.ts +1 -1
  115. package/dist/src/react/storage/index.d.ts +2 -0
  116. package/dist/{react → src/react}/storage/storage.hook.d.ts +2 -2
  117. package/dist/{react → src/react}/storage/storage.util.d.ts +6 -7
  118. package/dist/src/react/toast/index.d.ts +1 -0
  119. package/dist/src/react/userback/index.d.ts +2 -0
  120. package/dist/src/typescript/index.d.ts +5 -0
  121. package/dist/{util → src/util}/common/common.util.d.ts +15 -2
  122. package/dist/src/util/common/index.d.ts +5 -0
  123. package/dist/src/util/index.d.ts +9 -0
  124. package/dist/src/util/log/index.d.ts +2 -0
  125. package/dist/{util → src/util}/log/log.util.d.ts +1 -1
  126. package/dist/src/util/object/index.d.ts +4 -0
  127. package/dist/{util → src/util}/object/object.util.d.ts +7 -3
  128. package/dist/src/util/serializer/index.d.ts +2 -0
  129. package/dist/src/util/string/index.d.ts +5 -0
  130. package/dist/src/util/validate/index.d.ts +4 -0
  131. package/dist/typescript/index.d.ts +1 -5
  132. package/dist/util/common/common.util.js +22 -9
  133. package/dist/util/common/common.util.js.map +1 -1
  134. package/dist/util/common/index.d.ts +1 -5
  135. package/dist/util/common/index.js +2 -2
  136. package/dist/util/index.d.ts +1 -9
  137. package/dist/util/index.js +7 -7
  138. package/dist/util/log/index.d.ts +1 -2
  139. package/dist/util/object/index.d.ts +1 -4
  140. package/dist/util/object/object.util.js +5 -3
  141. package/dist/util/object/object.util.js.map +1 -1
  142. package/dist/util/serializer/index.d.ts +1 -2
  143. package/dist/util/serializer/serializer.util.js +10 -10
  144. package/dist/util/serializer/serializer.util.js.map +1 -1
  145. package/dist/util/string/index.d.ts +1 -5
  146. package/dist/util/validate/index.d.ts +1 -4
  147. package/package.json +23 -24
  148. package/dist/node/storage/storage.constant.d.ts +0 -4
  149. package/dist/node/storage/storage.type.d.ts +0 -14
  150. package/dist/node_modules/.pnpm/vitest@4.1.0_@types_node@25.5.0_jsdom@29.0.0_@noble_hashes@1.8.0__vite@8.0.1_@types_nod_36acd00c2670b611b011192023dc5bd9/node_modules/vitest/dist/config.js +0 -8
  151. package/dist/react/log/log.type.d.ts +0 -1
  152. /package/dist/{config → src/config}/env/env.constant.d.ts +0 -0
  153. /package/dist/{config → src/config}/env/env.type.d.ts +0 -0
  154. /package/dist/{config → src/config}/env/env.util.d.ts +0 -0
  155. /package/dist/{config → src/config}/graphql-codegen/graphql-codegen.type.d.ts +0 -0
  156. /package/dist/{config → src/config}/graphql-codegen/graphql-codegen.util.d.ts +0 -0
  157. /package/dist/{config → src/config}/storybook/storybook.main.d.ts +0 -0
  158. /package/dist/{config → src/config}/storybook/storybook.preview.d.ts +0 -0
  159. /package/dist/{config → src/config}/vitest/vitest.unit.setup.d.ts +0 -0
  160. /package/dist/{constant → src/constant}/common.d.ts +0 -0
  161. /package/dist/{node → src/node}/apollo-server/apollo-server.type.d.ts +0 -0
  162. /package/dist/{node → src/node}/apollo-server/apollo-server.util.d.ts +0 -0
  163. /package/dist/{node → src/node}/command/command.type.d.ts +0 -0
  164. /package/dist/{node → src/node}/command/command.util.d.ts +0 -0
  165. /package/dist/{node → src/node}/express/express.type.d.ts +0 -0
  166. /package/dist/{node → src/node}/fs/fs.type.d.ts +0 -0
  167. /package/dist/{node → src/node}/fs/fs.util.d.ts +0 -0
  168. /package/dist/{node → src/node}/mongo/mongo.constant.d.ts +0 -0
  169. /package/dist/{node → src/node}/mongo/mongo.controller.d.ts +0 -0
  170. /package/dist/{node → src/node}/mongo/mongo.dynamic-populate.d.ts +0 -0
  171. /package/dist/{node → src/node}/mongo/mongo.internal-types.d.ts +0 -0
  172. /package/dist/{node → src/node}/mongo/mongo.populate.d.ts +0 -0
  173. /package/dist/{node → src/node}/mongo/mongo.type.d.ts +0 -0
  174. /package/dist/{node → src/node}/mongo/mongo.util.d.ts +0 -0
  175. /package/dist/{node → src/node}/package/package.type.d.ts +0 -0
  176. /package/dist/{node → src/node}/path/path.constant.d.ts +0 -0
  177. /package/dist/{node → src/node}/path/path.util.d.ts +0 -0
  178. /package/dist/{node → src/node}/upload/upload.constant.d.ts +0 -0
  179. /package/dist/{node → src/node}/ws/ws.type.d.ts +0 -0
  180. /package/dist/{node → src/node}/ws/ws.util.d.ts +0 -0
  181. /package/dist/{react → src/react}/apollo-client/apollo-client.component.d.ts +0 -0
  182. /package/dist/{react → src/react}/apollo-client/apollo-client.constant.d.ts +0 -0
  183. /package/dist/{react → src/react}/apollo-client/apollo-client.context.d.ts +0 -0
  184. /package/dist/{react → src/react}/apollo-client/apollo-client.hook.d.ts +0 -0
  185. /package/dist/{react → src/react}/apollo-client/apollo-client.util.d.ts +0 -0
  186. /package/dist/{react → src/react}/apollo-client/links/upload.d.ts +0 -0
  187. /package/dist/{react → src/react}/apollo-client-nextjs/apollo-client-nextjs.component.d.ts +0 -0
  188. /package/dist/{react → src/react}/apollo-client-nextjs/apollo-client-nextjs.util.d.ts +0 -0
  189. /package/dist/{react → src/react}/apollo-error/apollo-error.component.d.ts +0 -0
  190. /package/dist/{react → src/react}/apollo-error/apollo-error.context.d.ts +0 -0
  191. /package/dist/{react → src/react}/apollo-error/apollo-error.hook.d.ts +0 -0
  192. /package/dist/{react → src/react}/apollo-error/apollo-error.provider.d.ts +0 -0
  193. /package/dist/{react → src/react}/apollo-error/apollo-error.type.d.ts +0 -0
  194. /package/dist/{react → src/react}/apollo-error/apollo-error.util.d.ts +0 -0
  195. /package/dist/{react → src/react}/i18next/i18next.hook.d.ts +0 -0
  196. /package/dist/{react → src/react}/i18next/i18next.util.d.ts +0 -0
  197. /package/dist/{react → src/react}/loading/loading.component.d.ts +0 -0
  198. /package/dist/{react → src/react}/loading/loading.context.d.ts +0 -0
  199. /package/dist/{react → src/react}/loading/loading.hook.d.ts +0 -0
  200. /package/dist/{react → src/react}/loading/loading.type.d.ts +0 -0
  201. /package/dist/{react → src/react}/next-intl/next-intl.constant.d.ts +0 -0
  202. /package/dist/{react → src/react}/next-intl/next-intl.context.d.ts +0 -0
  203. /package/dist/{react → src/react}/next-intl/next-intl.hook.d.ts +0 -0
  204. /package/dist/{react → src/react}/next-intl/next-intl.provider.d.ts +0 -0
  205. /package/dist/{react → src/react}/userback/userback.component.d.ts +0 -0
  206. /package/dist/{react → src/react}/userback/userback.type.d.ts +0 -0
  207. /package/dist/{typescript → src/typescript}/common.type.d.ts +0 -0
  208. /package/dist/{typescript → src/typescript}/react.type.d.ts +0 -0
  209. /package/dist/{util → src/util}/common/common.type.d.ts +0 -0
  210. /package/dist/{util → src/util}/log/log.type.d.ts +0 -0
  211. /package/dist/{util → src/util}/serializer/serializer.type.d.ts +0 -0
  212. /package/dist/{util → src/util}/serializer/serializer.util.d.ts +0 -0
  213. /package/dist/{util → src/util}/string/string.type.d.ts +0 -0
  214. /package/dist/{util → src/util}/string/string.util.d.ts +0 -0
  215. /package/dist/{util → src/util}/validate/validate.util.d.ts +0 -0
@@ -27,7 +27,10 @@ function c() {
27
27
  };
28
28
  if (!c) return null;
29
29
  let p = "locations" in c || "path" in c || "extensions" in c, m = "message" in c ? c.message : "Unknown error occurred";
30
- return /* @__PURE__ */ r.createElement("div", { className: n["modal-backdrop"] }, /* @__PURE__ */ r.createElement("div", {
30
+ return /* @__PURE__ */ r.createElement("div", {
31
+ className: n["modal-backdrop"],
32
+ onClick: l
33
+ }, /* @__PURE__ */ r.createElement("div", {
31
34
  ref: u,
32
35
  className: n["modal-content"],
33
36
  role: "dialog",
@@ -35,7 +38,8 @@ function c() {
35
38
  "aria-labelledby": "apollo-error-title",
36
39
  "aria-describedby": "apollo-error-details",
37
40
  tabIndex: -1,
38
- onKeyDown: f
41
+ onKeyDown: f,
42
+ onClick: (e) => e.stopPropagation()
39
43
  }, /* @__PURE__ */ r.createElement("button", {
40
44
  type: "button",
41
45
  className: n["btn-close"],
@@ -1 +1 @@
1
- {"version":3,"file":"apollo-error.component.js","names":[],"sources":["../../../src/react/apollo-error/apollo-error.component.tsx"],"sourcesContent":["import * as React from 'react';\nimport { use, useEffect, useRef } from 'react';\n\nimport { validate } from '#util/validate/validate.util.js';\n\nimport { ApolloErrorContext } from './apollo-error.context.js';\nimport style from './apollo-error.module.scss';\n\nconst FOCUSABLE_SELECTORS = 'button, [href], input, select, textarea, [tabindex]:not([tabindex=\"-1\"])';\n\n/**\n * Apollo Error Component that displays detailed error information in a modal.\n * This component provides a comprehensive error display interface that shows\n * GraphQL errors and other error types with detailed information for debugging purposes.\n *\n * Features:\n * - Modal overlay with backdrop for focus\n * - Detailed error categorization and display\n * - Reload functionality for error recovery\n * - Close button to dismiss the error modal\n * - Structured display of different error types\n * - Extra information display for debugging\n *\n * @returns A modal component displaying Apollo error details, or null if no error is present.\n */\nexport function ApolloErrorComponent() {\n const context = use(ApolloErrorContext);\n const { error, hideError } = context ?? {};\n const dialogRef = useRef<HTMLDivElement>(null);\n const previousFocusRef = useRef<HTMLElement | null>(null);\n\n useEffect(() => {\n if (!error || !hideError)\n return;\n\n const handleKeyDown = (event: KeyboardEvent) => {\n if (event.key === 'Escape') {\n hideError();\n }\n };\n\n window.addEventListener('keydown', handleKeyDown);\n\n return () => {\n window.removeEventListener('keydown', handleKeyDown);\n };\n }, [error, hideError]);\n\n useEffect(() => {\n if (error && dialogRef.current) {\n previousFocusRef.current = document.activeElement as HTMLElement;\n dialogRef.current.focus();\n }\n else if (!error && previousFocusRef.current) {\n previousFocusRef.current.focus();\n previousFocusRef.current = null;\n }\n }, [error]);\n\n const handleFocusTrap = (event: React.KeyboardEvent<HTMLDivElement>) => {\n if (event.key !== 'Tab' || !dialogRef.current)\n return;\n\n const focusableElements = [...dialogRef.current.querySelectorAll<HTMLElement>(FOCUSABLE_SELECTORS)].filter(el => !el.hasAttribute('disabled'));\n\n if (focusableElements.length === 0)\n return;\n\n const firstElement = focusableElements[0];\n const lastElement = focusableElements.at(-1);\n\n if (!firstElement || !lastElement)\n return;\n\n if (event.shiftKey) {\n if (document.activeElement === firstElement) {\n event.preventDefault();\n lastElement.focus();\n }\n }\n else if (document.activeElement === lastElement) {\n event.preventDefault();\n firstElement.focus();\n }\n };\n\n if (!error) {\n return null;\n }\n\n const isGraphQLError = 'locations' in error || 'path' in error || 'extensions' in error;\n const errorMessage = 'message' in error ? error.message : 'Unknown error occurred';\n\n return (\n <div className={style['modal-backdrop']}>\n <div\n ref={dialogRef}\n className={style['modal-content']}\n role=\"dialog\"\n aria-modal=\"true\"\n aria-labelledby=\"apollo-error-title\"\n aria-describedby=\"apollo-error-details\"\n tabIndex={-1}\n onKeyDown={handleFocusTrap}\n >\n <button\n type=\"button\"\n className={style['btn-close']}\n onClick={hideError}\n aria-label=\"Close error details (Esc)\"\n aria-keyshortcuts=\"Escape\"\n title=\"Close error details (Esc)\"\n >\n ✕\n </button>\n <div className={style['error-title']}>\n <button\n type=\"button\"\n className={style['btn-retry']}\n onClick={() => window.location.reload()}\n aria-label=\"Reload page\"\n >\n Reload\n </button>\n {' '}\n <span id=\"apollo-error-title\">\n {errorMessage || 'Error details'}\n </span>\n </div>\n <div id=\"apollo-error-details\" className={style['error-details']}>\n {isGraphQLError && 'locations' in error && error.locations && (\n <pre className=\"locations\">\n <strong>Locations:</strong>\n {' '}\n {JSON.stringify(error.locations, null, 4)}\n </pre>\n )}\n {isGraphQLError && 'path' in error && error.path && (\n <pre className=\"path\">\n <strong>Path:</strong>\n {' '}\n {JSON.stringify(error.path, null, 4)}\n </pre>\n )}\n {isGraphQLError && 'extensions' in error && error.extensions && (\n <pre className=\"extensions\">\n <strong>Extensions:</strong>\n {' '}\n {JSON.stringify(error.extensions, null, 4)}\n </pre>\n )}\n {!isGraphQLError && (\n <pre className=\"error-details\">\n <strong>Error Details:</strong>\n {' '}\n {validate.isEmpty(error) ? errorMessage : JSON.stringify(error, null, 4)}\n </pre>\n )}\n </div>\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;AAQA,IAAM,IAAsB;AAiB5B,SAAgB,IAAuB;CAEnC,IAAM,EAAE,UAAO,iBADC,EAAI,EAAmB,IACC,EAAE,EACpC,IAAY,EAAuB,KAAK,EACxC,IAAmB,EAA2B,KAAK;AAmBzD,CAjBA,QAAgB;AACZ,MAAI,CAAC,KAAS,CAAC,EACX;EAEJ,IAAM,KAAiB,MAAyB;AAC5C,GAAI,EAAM,QAAQ,YACd,GAAW;;AAMnB,SAFA,OAAO,iBAAiB,WAAW,EAAc,QAEpC;AACT,UAAO,oBAAoB,WAAW,EAAc;;IAEzD,CAAC,GAAO,EAAU,CAAC,EAEtB,QAAgB;AACZ,EAAI,KAAS,EAAU,WACnB,EAAiB,UAAU,SAAS,eACpC,EAAU,QAAQ,OAAO,IAEpB,CAAC,KAAS,EAAiB,YAChC,EAAiB,QAAQ,OAAO,EAChC,EAAiB,UAAU;IAEhC,CAAC,EAAM,CAAC;CAEX,IAAM,KAAmB,MAA+C;AACpE,MAAI,EAAM,QAAQ,SAAS,CAAC,EAAU,QAClC;EAEJ,IAAM,IAAoB,CAAC,GAAG,EAAU,QAAQ,iBAA8B,EAAoB,CAAC,CAAC,QAAO,MAAM,CAAC,EAAG,aAAa,WAAW,CAAC;AAE9I,MAAI,EAAkB,WAAW,EAC7B;EAEJ,IAAM,IAAe,EAAkB,IACjC,IAAc,EAAkB,GAAG,GAAG;AAExC,GAAC,KAAgB,CAAC,MAGlB,EAAM,WACF,SAAS,kBAAkB,MAC3B,EAAM,gBAAgB,EACtB,EAAY,OAAO,IAGlB,SAAS,kBAAkB,MAChC,EAAM,gBAAgB,EACtB,EAAa,OAAO;;AAI5B,KAAI,CAAC,EACD,QAAO;CAGX,IAAM,IAAiB,eAAe,KAAS,UAAU,KAAS,gBAAgB,GAC5E,IAAe,aAAa,IAAQ,EAAM,UAAU;AAE1D,QACI,kBAAA,cAAC,OAAD,EAAK,WAAW,EAAM,mBAkEhB,EAjEF,kBAAA,cAAC,OAAD;EACI,KAAK;EACL,WAAW,EAAM;EACjB,MAAK;EACL,cAAW;EACX,mBAAgB;EAChB,oBAAiB;EACjB,UAAU;EACV,WAAW;EAwDT,EAtDF,kBAAA,cAAC,UAAD;EACI,MAAK;EACL,WAAW,EAAM;EACjB,SAAS;EACT,cAAW;EACX,qBAAkB;EAClB,OAAM;EAGD,EAFR,IAEQ,EACT,kBAAA,cAAC,OAAD,EAAK,WAAW,EAAM,gBAahB,EAZF,kBAAA,cAAC,UAAD;EACI,MAAK;EACL,WAAW,EAAM;EACjB,eAAe,OAAO,SAAS,QAAQ;EACvC,cAAW;EAGN,EAFR,SAEQ,EACR,KACD,kBAAA,cAAC,QAAD,EAAM,IAAG,sBAEF,EADF,KAAgB,gBACd,CACL,EACN,kBAAA,cAAC,OAAD;EAAK,IAAG;EAAuB,WAAW,EAAM;EA6B1C,EA5BD,KAAkB,eAAe,KAAS,EAAM,aAC7C,kBAAA,cAAC,OAAD,EAAK,WAAU,aAIT,EAHF,kBAAA,cAAC,UAAA,MAAO,aAAmB,EAC1B,KACA,KAAK,UAAU,EAAM,WAAW,MAAM,EAAE,CACvC,EAET,KAAkB,UAAU,KAAS,EAAM,QACxC,kBAAA,cAAC,OAAD,EAAK,WAAU,QAIT,EAHF,kBAAA,cAAC,UAAA,MAAO,QAAc,EACrB,KACA,KAAK,UAAU,EAAM,MAAM,MAAM,EAAE,CAClC,EAET,KAAkB,gBAAgB,KAAS,EAAM,cAC9C,kBAAA,cAAC,OAAD,EAAK,WAAU,cAIT,EAHF,kBAAA,cAAC,UAAA,MAAO,cAAoB,EAC3B,KACA,KAAK,UAAU,EAAM,YAAY,MAAM,EAAE,CACxC,EAET,CAAC,KACE,kBAAA,cAAC,OAAD,EAAK,WAAU,iBAIT,EAHF,kBAAA,cAAC,UAAA,MAAO,iBAAuB,EAC9B,KACA,EAAS,QAAQ,EAAM,GAAG,IAAe,KAAK,UAAU,GAAO,MAAM,EAAE,CACtE,CAER,CACJ,CACJ"}
1
+ {"version":3,"file":"apollo-error.component.js","names":[],"sources":["../../../src/react/apollo-error/apollo-error.component.tsx"],"sourcesContent":["import * as React from 'react';\nimport { use, useEffect, useRef } from 'react';\n\nimport { validate } from '#util/validate/validate.util.js';\n\nimport { ApolloErrorContext } from './apollo-error.context.js';\nimport style from './apollo-error.module.scss';\n\nconst FOCUSABLE_SELECTORS = 'button, [href], input, select, textarea, [tabindex]:not([tabindex=\"-1\"])';\n\n/**\n * Apollo Error Component that displays detailed error information in a modal.\n * This component provides a comprehensive error display interface that shows\n * GraphQL errors and other error types with detailed information for debugging purposes.\n *\n * Features:\n * - Modal overlay with backdrop for focus\n * - Detailed error categorization and display\n * - Reload functionality for error recovery\n * - Close button to dismiss the error modal\n * - Structured display of different error types\n * - Extra information display for debugging\n *\n * @returns A modal component displaying Apollo error details, or null if no error is present.\n */\nexport function ApolloErrorComponent() {\n const context = use(ApolloErrorContext);\n const { error, hideError } = context ?? {};\n const dialogRef = useRef<HTMLDivElement>(null);\n const previousFocusRef = useRef<HTMLElement | null>(null);\n\n useEffect(() => {\n if (!error || !hideError)\n return;\n\n const handleKeyDown = (event: KeyboardEvent) => {\n if (event.key === 'Escape') {\n hideError();\n }\n };\n\n window.addEventListener('keydown', handleKeyDown);\n\n return () => {\n window.removeEventListener('keydown', handleKeyDown);\n };\n }, [error, hideError]);\n\n useEffect(() => {\n if (error && dialogRef.current) {\n previousFocusRef.current = document.activeElement as HTMLElement;\n dialogRef.current.focus();\n }\n else if (!error && previousFocusRef.current) {\n previousFocusRef.current.focus();\n previousFocusRef.current = null;\n }\n }, [error]);\n\n const handleFocusTrap = (event: React.KeyboardEvent<HTMLDivElement>) => {\n if (event.key !== 'Tab' || !dialogRef.current)\n return;\n\n const focusableElements = [...dialogRef.current.querySelectorAll<HTMLElement>(FOCUSABLE_SELECTORS)].filter(el => !el.hasAttribute('disabled'));\n\n if (focusableElements.length === 0)\n return;\n\n const firstElement = focusableElements[0];\n const lastElement = focusableElements.at(-1);\n\n if (!firstElement || !lastElement)\n return;\n\n if (event.shiftKey) {\n if (document.activeElement === firstElement) {\n event.preventDefault();\n lastElement.focus();\n }\n }\n else if (document.activeElement === lastElement) {\n event.preventDefault();\n firstElement.focus();\n }\n };\n\n if (!error) {\n return null;\n }\n\n const isGraphQLError = 'locations' in error || 'path' in error || 'extensions' in error;\n const errorMessage = 'message' in error ? error.message : 'Unknown error occurred';\n\n return (\n <div className={style['modal-backdrop']} onClick={hideError}>\n <div\n ref={dialogRef}\n className={style['modal-content']}\n role=\"dialog\"\n aria-modal=\"true\"\n aria-labelledby=\"apollo-error-title\"\n aria-describedby=\"apollo-error-details\"\n tabIndex={-1}\n onKeyDown={handleFocusTrap}\n onClick={e => e.stopPropagation()}\n >\n <button\n type=\"button\"\n className={style['btn-close']}\n onClick={hideError}\n aria-label=\"Close error details (Esc)\"\n aria-keyshortcuts=\"Escape\"\n title=\"Close error details (Esc)\"\n >\n ✕\n </button>\n <div className={style['error-title']}>\n <button\n type=\"button\"\n className={style['btn-retry']}\n onClick={() => window.location.reload()}\n aria-label=\"Reload page\"\n >\n Reload\n </button>\n {' '}\n <span id=\"apollo-error-title\">\n {errorMessage || 'Error details'}\n </span>\n </div>\n <div id=\"apollo-error-details\" className={style['error-details']}>\n {isGraphQLError && 'locations' in error && error.locations && (\n <pre className=\"locations\">\n <strong>Locations:</strong>\n {' '}\n {JSON.stringify(error.locations, null, 4)}\n </pre>\n )}\n {isGraphQLError && 'path' in error && error.path && (\n <pre className=\"path\">\n <strong>Path:</strong>\n {' '}\n {JSON.stringify(error.path, null, 4)}\n </pre>\n )}\n {isGraphQLError && 'extensions' in error && error.extensions && (\n <pre className=\"extensions\">\n <strong>Extensions:</strong>\n {' '}\n {JSON.stringify(error.extensions, null, 4)}\n </pre>\n )}\n {!isGraphQLError && (\n <pre className=\"error-details\">\n <strong>Error Details:</strong>\n {' '}\n {validate.isEmpty(error) ? errorMessage : JSON.stringify(error, null, 4)}\n </pre>\n )}\n </div>\n </div>\n </div>\n );\n}\n"],"mappings":"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"}
@@ -1,6 +1 @@
1
- export * from './apollo-error.component.js';
2
- export * from './apollo-error.context.js';
3
- export * from './apollo-error.hook.js';
4
- export * from './apollo-error.provider.js';
5
- export * from './apollo-error.type.js';
6
- export * from './apollo-error.util.js';
1
+ export {}
@@ -1,2 +1 @@
1
- export * from './i18next.hook.js';
2
- export * from './i18next.util.js';
1
+ export {}
@@ -1,5 +1 @@
1
- export * from './loading.component.js';
2
- export * from './loading.context.js';
3
- export * from './loading.hook.js';
4
- export * from './loading.provider.js';
5
- export * from './loading.type.js';
1
+ export {}
@@ -1,2 +1 @@
1
- export * from './log.type.js';
2
- export * from './log.util.js';
1
+ export {}
@@ -1,6 +1 @@
1
- export * from './next-intl.constant.js';
2
- export * from './next-intl.context.js';
3
- export * from './next-intl.hoc.js';
4
- export * from './next-intl.hook.js';
5
- export * from './next-intl.provider.js';
6
- export * from './next-intl.type.js';
1
+ export {}
@@ -1,2 +1 @@
1
- export * from './storage.hook.js';
2
- export * from './storage.util.js';
1
+ export {}
@@ -1 +1 @@
1
- {"version":3,"file":"storage.hook.js","names":[],"sources":["../../../src/react/storage/storage.hook.tsx"],"sourcesContent":["import { useCallback, useEffect, useState } from 'react';\n\nimport type { I_Serializer } from '#util/serializer/index.js';\n\nimport { serializer as defaultSerializer } from '#util/serializer/index.js';\n\nimport { catchError } from '../log/index.js';\nimport { storage } from './storage.util.js';\n\n/**\n * React hook that provides persistent storage functionality with automatic serialization.\n * This hook manages state that persists across browser sessions using localForage,\n * with automatic serialization/deserialization of complex data types. It provides\n * a React-friendly interface for storage operations with proper error handling.\n *\n * Features:\n * - Automatic data serialization and deserialization\n * - Persistent storage across browser sessions\n * - Initial value handling and fallback\n * - Error handling with graceful degradation\n * - Automatic storage synchronization\n * - Support for complex data types via custom serializers\n *\n * @param key - The unique storage key for the data.\n * @param initialValue - Optional initial value to use if no stored value exists.\n * @param serializer - Optional custom serializer for complex data types (defaults to JSON serializer).\n * @returns An object containing the current value, set function, and remove function.\n */\nexport function useStorage<T>(\n key: string,\n initialValue?: T,\n serializer: I_Serializer<T> = defaultSerializer as I_Serializer<T>,\n) {\n const [value, setValue] = useState<T | undefined>(initialValue);\n const [isLoaded, setIsLoaded] = useState(false);\n\n useEffect(() => {\n let isMounted = true;\n\n const loadValue = async () => {\n try {\n const valueFound = await storage.get<string>(key);\n\n if (isMounted) {\n if (valueFound !== null) {\n const parsedValue = serializer.deserialize(valueFound);\n setValue(parsedValue);\n }\n else if (initialValue !== undefined) {\n const serialized = serializer.serialize(initialValue);\n await storage.set(key, serialized);\n setValue(initialValue);\n }\n else {\n setValue(undefined);\n }\n }\n }\n catch (error) {\n catchError(error);\n\n if (isMounted) {\n setValue(initialValue);\n }\n }\n finally {\n if (isMounted)\n setIsLoaded(true);\n }\n };\n\n loadValue();\n\n return () => {\n isMounted = false;\n setIsLoaded(false);\n };\n }, [key, initialValue, serializer]);\n\n useEffect(() => {\n if (!isLoaded)\n return;\n\n const saveValue = async () => {\n try {\n if (value !== undefined) {\n const serialized = serializer.serialize(value);\n await storage.set(key, serialized);\n }\n }\n catch (error) {\n catchError(error);\n }\n };\n\n saveValue();\n }, [value, key, serializer, isLoaded]);\n\n const set = useCallback(\n (newValue: T | ((val: T | undefined) => T)) => {\n setValue((prev) => {\n if (typeof newValue === 'function') {\n return (newValue as (val: T | undefined) => T)(prev);\n }\n return newValue;\n });\n },\n [],\n );\n\n const remove = useCallback(async () => {\n try {\n await storage.remove(key);\n setValue(undefined);\n }\n catch (error) {\n catchError(error);\n }\n }, [key]);\n\n return { value, set, remove };\n}\n"],"mappings":";;;;;AA4BA,SAAgB,EACZ,GACA,GACA,IAA8B,GAChC;CACE,IAAM,CAAC,GAAO,KAAY,EAAwB,EAAa,EACzD,CAAC,GAAU,KAAe,EAAS,GAAM;AAsF/C,QApFA,QAAgB;EACZ,IAAI,IAAY;AAoChB,UAlCkB,YAAY;AAC1B,OAAI;IACA,IAAM,IAAa,MAAM,EAAQ,IAAY,EAAI;AAEjD,QAAI,EACA,KAAI,MAAe,KAEf,GADoB,EAAW,YAAY,EAAW,CACjC;aAEhB,MAAiB,KAAA,GAAW;KACjC,IAAM,IAAa,EAAW,UAAU,EAAa;AAErD,KADA,MAAM,EAAQ,IAAI,GAAK,EAAW,EAClC,EAAS,EAAa;UAGtB,GAAS,KAAA,EAAU;YAIxB,GAAO;AAGV,IAFA,EAAW,EAAM,EAEb,KACA,EAAS,EAAa;aAGtB;AACJ,IAAI,KACA,EAAY,GAAK;;MAIlB,QAEE;AAET,GADA,IAAY,IACZ,EAAY,GAAM;;IAEvB;EAAC;EAAK;EAAc;EAAW,CAAC,EAEnC,QAAgB;AACP,QAGa,YAAY;AAC1B,OAAI;AACA,QAAI,MAAU,KAAA,GAAW;KACrB,IAAM,IAAa,EAAW,UAAU,EAAM;AAC9C,WAAM,EAAQ,IAAI,GAAK,EAAW;;YAGnC,GAAO;AACV,MAAW,EAAM;;MAId;IACZ;EAAC;EAAO;EAAK;EAAY;EAAS,CAAC,EAwB/B;EAAE;EAAO,KAtBJ,GACP,MAA8C;AAC3C,MAAU,MACF,OAAO,KAAa,aACZ,EAAuC,EAAK,GAEjD,EACT;KAEN,EAAE,CACL;EAYoB,QAVN,EAAY,YAAY;AACnC,OAAI;AAEA,IADA,MAAM,EAAQ,OAAO,EAAI,EACzB,EAAS,KAAA,EAAU;YAEhB,GAAO;AACV,MAAW,EAAM;;KAEtB,CAAC,EAAI,CAAC;EAEoB"}
1
+ {"version":3,"file":"storage.hook.js","names":[],"sources":["../../../src/react/storage/storage.hook.tsx"],"sourcesContent":["import { useCallback, useEffect, useState } from 'react';\n\nimport type { I_Serializer } from '#util/serializer/index.js';\n\nimport { serializer as defaultSerializer } from '#util/serializer/index.js';\n\nimport { catchError } from '../log/index.js';\nimport { storage } from './storage.util.js';\n\n/**\n * React hook that provides persistent storage functionality with automatic serialization.\n * This hook manages state that persists across browser sessions using localStorage,\n * with automatic serialization/deserialization of complex data types. It provides\n * a React-friendly interface for storage operations with proper error handling.\n *\n * Features:\n * - Automatic data serialization and deserialization\n * - Persistent storage across browser sessions\n * - Initial value handling and fallback\n * - Error handling with graceful degradation\n * - Automatic storage synchronization\n * - Support for complex data types via custom serializers\n *\n * @param key - The unique storage key for the data.\n * @param initialValue - Optional initial value to use if no stored value exists.\n * @param serializer - Optional custom serializer for complex data types (defaults to JSON serializer).\n * @returns An object containing the current value, set function, and remove function.\n */\nexport function useStorage<T>(\n key: string,\n initialValue?: T,\n serializer: I_Serializer<T> = defaultSerializer as I_Serializer<T>,\n) {\n const [value, setValue] = useState<T | undefined>(initialValue);\n const [isLoaded, setIsLoaded] = useState(false);\n\n useEffect(() => {\n let isMounted = true;\n\n const loadValue = async () => {\n try {\n const valueFound = await storage.get<string>(key);\n\n if (isMounted) {\n if (valueFound !== null) {\n const parsedValue = serializer.deserialize(valueFound);\n setValue(parsedValue);\n }\n else if (initialValue !== undefined) {\n const serialized = serializer.serialize(initialValue);\n await storage.set(key, serialized);\n setValue(initialValue);\n }\n else {\n setValue(undefined);\n }\n }\n }\n catch (error) {\n catchError(error);\n\n if (isMounted) {\n setValue(initialValue);\n }\n }\n finally {\n if (isMounted)\n setIsLoaded(true);\n }\n };\n\n loadValue();\n\n return () => {\n isMounted = false;\n setIsLoaded(false);\n };\n }, [key, initialValue, serializer]);\n\n useEffect(() => {\n if (!isLoaded)\n return;\n\n const saveValue = async () => {\n try {\n if (value !== undefined) {\n const serialized = serializer.serialize(value);\n await storage.set(key, serialized);\n }\n }\n catch (error) {\n catchError(error);\n }\n };\n\n saveValue();\n }, [value, key, serializer, isLoaded]);\n\n const set = useCallback(\n (newValue: T | ((val: T | undefined) => T)) => {\n setValue((prev) => {\n if (typeof newValue === 'function') {\n return (newValue as (val: T | undefined) => T)(prev);\n }\n return newValue;\n });\n },\n [],\n );\n\n const remove = useCallback(async () => {\n try {\n await storage.remove(key);\n setValue(undefined);\n }\n catch (error) {\n catchError(error);\n }\n }, [key]);\n\n return { value, set, remove };\n}\n"],"mappings":";;;;;AA4BA,SAAgB,EACZ,GACA,GACA,IAA8B,GAChC;CACE,IAAM,CAAC,GAAO,KAAY,EAAwB,EAAa,EACzD,CAAC,GAAU,KAAe,EAAS,GAAM;AAsF/C,QApFA,QAAgB;EACZ,IAAI,IAAY;AAoChB,UAlCkB,YAAY;AAC1B,OAAI;IACA,IAAM,IAAa,MAAM,EAAQ,IAAY,EAAI;AAEjD,QAAI,EACA,KAAI,MAAe,KAEf,GADoB,EAAW,YAAY,EAAW,CACjC;aAEhB,MAAiB,KAAA,GAAW;KACjC,IAAM,IAAa,EAAW,UAAU,EAAa;AAErD,KADA,MAAM,EAAQ,IAAI,GAAK,EAAW,EAClC,EAAS,EAAa;UAGtB,GAAS,KAAA,EAAU;YAIxB,GAAO;AAGV,IAFA,EAAW,EAAM,EAEb,KACA,EAAS,EAAa;aAGtB;AACJ,IAAI,KACA,EAAY,GAAK;;MAIlB,QAEE;AAET,GADA,IAAY,IACZ,EAAY,GAAM;;IAEvB;EAAC;EAAK;EAAc;EAAW,CAAC,EAEnC,QAAgB;AACP,QAGa,YAAY;AAC1B,OAAI;AACA,QAAI,MAAU,KAAA,GAAW;KACrB,IAAM,IAAa,EAAW,UAAU,EAAM;AAC9C,WAAM,EAAQ,IAAI,GAAK,EAAW;;YAGnC,GAAO;AACV,MAAW,EAAM;;MAId;IACZ;EAAC;EAAO;EAAK;EAAY;EAAS,CAAC,EAwB/B;EAAE;EAAO,KAtBJ,GACP,MAA8C;AAC3C,MAAU,MACF,OAAO,KAAa,aACZ,EAAuC,EAAK,GAEjD,EACT;KAEN,EAAE,CACL;EAYoB,QAVN,EAAY,YAAY;AACnC,OAAI;AAEA,IADA,MAAM,EAAQ,OAAO,EAAI,EACzB,EAAS,KAAA,EAAU;YAEhB,GAAO;AACV,MAAW,EAAM;;KAEtB,CAAC,EAAI,CAAC;EAEoB"}
@@ -1,37 +1,42 @@
1
1
  import { catchError as e } from "../log/log.util.js";
2
- import t from "localforage";
3
2
  //#region src/react/storage/storage.util.ts
4
- var n = {
5
- async get(n) {
3
+ var t = {
4
+ async get(t) {
6
5
  try {
7
- return await t.getItem(n);
6
+ let e = localStorage.getItem(t);
7
+ return e === null ? null : JSON.parse(e);
8
8
  } catch (t) {
9
9
  return e(t, { returnValue: null });
10
10
  }
11
11
  },
12
- async set(n, r) {
12
+ async set(t, n) {
13
13
  try {
14
- await t.setItem(n, r);
14
+ localStorage.setItem(t, JSON.stringify(n));
15
15
  } catch (t) {
16
16
  e(t);
17
17
  }
18
18
  },
19
- async remove(n) {
19
+ async remove(t) {
20
20
  try {
21
- await t.removeItem(n);
21
+ localStorage.removeItem(t);
22
22
  } catch (t) {
23
23
  e(t);
24
24
  }
25
25
  },
26
26
  async keys() {
27
27
  try {
28
- return await t.keys() ?? [];
28
+ let e = [];
29
+ for (let t = 0; t < localStorage.length; t++) {
30
+ let n = localStorage.key(t);
31
+ n !== null && e.push(n);
32
+ }
33
+ return e;
29
34
  } catch (t) {
30
35
  return e(t, { returnValue: [] });
31
36
  }
32
37
  }
33
38
  };
34
39
  //#endregion
35
- export { n as storage };
40
+ export { t as storage };
36
41
 
37
42
  //# sourceMappingURL=storage.util.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"storage.util.js","names":[],"sources":["../../../src/react/storage/storage.util.ts"],"sourcesContent":["import localForage from 'localforage';\n\nimport { catchError } from '../log/index.js';\n\n/**\n * Browser storage utility object using localForage for cross-browser compatibility.\n * This object provides a unified interface for browser storage operations using localForage,\n * which automatically chooses the best available storage method (IndexedDB, WebSQL, or localStorage)\n * based on browser capabilities. It includes comprehensive error handling and type safety.\n */\nexport const storage = {\n /**\n * Retrieves a value from browser storage by key.\n * This method fetches data that was previously stored using the set method.\n * Returns null if the key doesn't exist or if an error occurs during retrieval.\n *\n * @param key - The unique identifier for the stored value.\n * @returns A promise that resolves to the stored value or null if not found.\n */\n async get<T = unknown>(key: string): Promise<T | null> {\n try {\n return await localForage.getItem<T>(key);\n }\n catch (error) {\n return catchError(error, { returnValue: null });\n }\n },\n /**\n * Stores a value in browser storage with a unique key.\n * This method saves data that can be retrieved later using the get method.\n * The data is automatically handled by localForage which chooses the optimal\n * storage method for the browser environment.\n *\n * @param key - The unique identifier for the value to store.\n * @param value - The data to store (will be automatically handled by localForage).\n * @returns A promise that resolves when the storage operation is complete.\n */\n async set<T = unknown>(key: string, value: T): Promise<void> {\n try {\n await localForage.setItem(key, value);\n }\n catch (error) {\n catchError(error);\n }\n },\n /**\n * Removes a value from browser storage by key.\n * This method permanently deletes the stored data associated with the specified key.\n * If the key doesn't exist, the operation completes successfully without error.\n *\n * @param key - The unique identifier of the value to remove.\n * @returns A promise that resolves when the removal operation is complete.\n */\n async remove(key: string): Promise<void> {\n try {\n await localForage.removeItem(key);\n }\n catch (error) {\n catchError(error);\n }\n },\n /**\n * Retrieves all storage keys.\n * This method returns an array of all keys that currently have stored values.\n * Returns an empty array if no keys exist or if an error occurs during retrieval.\n *\n * @returns A promise that resolves to an array of storage keys.\n */\n async keys(): Promise<string[]> {\n try {\n const keys = await localForage.keys();\n\n return keys ?? [];\n }\n catch (error) {\n return catchError(error, { returnValue: [] });\n }\n },\n};\n"],"mappings":";;;AAUA,IAAa,IAAU;CASnB,MAAM,IAAiB,GAAgC;AACnD,MAAI;AACA,UAAO,MAAM,EAAY,QAAW,EAAI;WAErC,GAAO;AACV,UAAO,EAAW,GAAO,EAAE,aAAa,MAAM,CAAC;;;CAavD,MAAM,IAAiB,GAAa,GAAyB;AACzD,MAAI;AACA,SAAM,EAAY,QAAQ,GAAK,EAAM;WAElC,GAAO;AACV,KAAW,EAAM;;;CAWzB,MAAM,OAAO,GAA4B;AACrC,MAAI;AACA,SAAM,EAAY,WAAW,EAAI;WAE9B,GAAO;AACV,KAAW,EAAM;;;CAUzB,MAAM,OAA0B;AAC5B,MAAI;AAGA,UAFa,MAAM,EAAY,MAAM,IAEtB,EAAE;WAEd,GAAO;AACV,UAAO,EAAW,GAAO,EAAE,aAAa,EAAE,EAAE,CAAC;;;CAGxD"}
1
+ {"version":3,"file":"storage.util.js","names":[],"sources":["../../../src/react/storage/storage.util.ts"],"sourcesContent":["import { catchError } from '../log/index.js';\n\n/**\n * Browser storage utility object using native localStorage.\n * This object provides a unified interface for browser storage operations\n * with comprehensive error handling and type safety.\n * Values are stored as JSON strings for consistent serialization.\n */\nexport const storage = {\n /**\n * Retrieves a value from browser storage by key.\n * This method fetches data that was previously stored using the set method.\n * Returns null if the key doesn't exist or if an error occurs during retrieval.\n *\n * @param key - The unique identifier for the stored value.\n * @returns A promise that resolves to the stored value or null if not found.\n */\n async get<T = unknown>(key: string): Promise<T | null> {\n try {\n const raw = localStorage.getItem(key);\n\n if (raw === null) {\n return null;\n }\n\n return JSON.parse(raw) as T;\n }\n catch (error) {\n return catchError(error, { returnValue: null });\n }\n },\n /**\n * Stores a value in browser storage with a unique key.\n * This method saves data that can be retrieved later using the get method.\n * The data is automatically serialized to JSON.\n *\n * @param key - The unique identifier for the value to store.\n * @param value - The data to store (will be automatically serialized to JSON).\n * @returns A promise that resolves when the storage operation is complete.\n */\n async set<T = unknown>(key: string, value: T): Promise<void> {\n try {\n localStorage.setItem(key, JSON.stringify(value));\n }\n catch (error) {\n catchError(error);\n }\n },\n /**\n * Removes a value from browser storage by key.\n * This method permanently deletes the stored data associated with the specified key.\n * If the key doesn't exist, the operation completes successfully without error.\n *\n * @param key - The unique identifier of the value to remove.\n * @returns A promise that resolves when the removal operation is complete.\n */\n async remove(key: string): Promise<void> {\n try {\n localStorage.removeItem(key);\n }\n catch (error) {\n catchError(error);\n }\n },\n /**\n * Retrieves all storage keys.\n * This method returns an array of all keys that currently have stored values.\n * Returns an empty array if no keys exist or if an error occurs during retrieval.\n *\n * @returns A promise that resolves to an array of storage keys.\n */\n async keys(): Promise<string[]> {\n try {\n const keys: string[] = [];\n\n for (let i = 0; i < localStorage.length; i++) {\n const key = localStorage.key(i);\n\n if (key !== null) {\n keys.push(key);\n }\n }\n\n return keys;\n }\n catch (error) {\n return catchError(error, { returnValue: [] });\n }\n },\n};\n"],"mappings":";;AAQA,IAAa,IAAU;CASnB,MAAM,IAAiB,GAAgC;AACnD,MAAI;GACA,IAAM,IAAM,aAAa,QAAQ,EAAI;AAMrC,UAJI,MAAQ,OACD,OAGJ,KAAK,MAAM,EAAI;WAEnB,GAAO;AACV,UAAO,EAAW,GAAO,EAAE,aAAa,MAAM,CAAC;;;CAYvD,MAAM,IAAiB,GAAa,GAAyB;AACzD,MAAI;AACA,gBAAa,QAAQ,GAAK,KAAK,UAAU,EAAM,CAAC;WAE7C,GAAO;AACV,KAAW,EAAM;;;CAWzB,MAAM,OAAO,GAA4B;AACrC,MAAI;AACA,gBAAa,WAAW,EAAI;WAEzB,GAAO;AACV,KAAW,EAAM;;;CAUzB,MAAM,OAA0B;AAC5B,MAAI;GACA,IAAM,IAAiB,EAAE;AAEzB,QAAK,IAAI,IAAI,GAAG,IAAI,aAAa,QAAQ,KAAK;IAC1C,IAAM,IAAM,aAAa,IAAI,EAAE;AAE/B,IAAI,MAAQ,QACR,EAAK,KAAK,EAAI;;AAItB,UAAO;WAEJ,GAAO;AACV,UAAO,EAAW,GAAO,EAAE,aAAa,EAAE,EAAE,CAAC;;;CAGxD"}
@@ -1 +1 @@
1
- export { toast, Toaster } from 'react-hot-toast';
1
+ export {}
@@ -1,2 +1 @@
1
- export * from './userback.component.js';
2
- export * from './userback.type.js';
1
+ export {}
@@ -0,0 +1,5 @@
1
+ declare const _default: {
2
+ extends: string[];
3
+ ignores: ((message: string) => boolean)[];
4
+ };
5
+ export default _default;
@@ -1,4 +1,4 @@
1
- import { T_Object } from '../typescript/index.js';
1
+ import { T_Object } from '../../typescript/index.js';
2
2
  export declare enum E_ConfigType {
3
3
  ESLINT = "eslint",
4
4
  COMMITLINT = "commitlint",
@@ -1,4 +1,4 @@
1
- import { T_Object } from '../typescript/index.js';
1
+ import { T_Object } from '../../typescript/index.js';
2
2
  import { T_ConfigType } from './config.type.js';
3
3
  /**
4
4
  * Merges configurations based on the specified type.
@@ -0,0 +1,3 @@
1
+ export * from './env.constant.js';
2
+ export * from './env.type.js';
3
+ export * from './env.util.js';