@react-pakistan/util-functions 1.25.90 → 2.0.2

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 (417) hide show
  1. package/README.md +74 -315
  2. package/constants/api-methods.d.ts +3 -1
  3. package/constants/api-methods.js +1 -15
  4. package/constants/cache-time.d.ts +7 -5
  5. package/constants/cache-time.js +1 -8
  6. package/constants/countries-timezones.d.ts +4 -2
  7. package/constants/countries-timezones.js +1 -1411
  8. package/constants/currencies.d.ts +4 -2
  9. package/constants/currencies.js +1 -1076
  10. package/constants/dial-codes.d.ts +5 -3
  11. package/constants/dial-codes.js +1 -1216
  12. package/constants/layout-direction.d.ts +3 -1
  13. package/constants/layout-direction.js +1 -8
  14. package/constants/react-pakistan-meta.d.ts +4 -2
  15. package/constants/react-pakistan-meta.js +1 -35
  16. package/constants/react-pakistan.d.ts +5 -3
  17. package/constants/react-pakistan.js +12 -104
  18. package/constants/select-value-delimiter.d.ts +3 -1
  19. package/constants/select-value-delimiter.js +1 -13
  20. package/constants/social-media-colors.d.ts +3 -1
  21. package/constants/social-media-colors.js +1 -42
  22. package/constants/social-media-sizes.d.ts +6 -4
  23. package/constants/social-media-sizes.js +1 -327
  24. package/constants/user-roles.d.ts +3 -1
  25. package/constants/user-roles.js +1 -9
  26. package/edu-pilot-pro/types/academics.d.ts +2 -266
  27. package/edu-pilot-pro/types/academics.js +1 -9
  28. package/edu-pilot-pro/types/admission.d.ts +803 -10
  29. package/edu-pilot-pro/types/admission.js +1 -7
  30. package/edu-pilot-pro/types/communication.d.ts +2 -165
  31. package/edu-pilot-pro/types/communication.js +1 -8
  32. package/edu-pilot-pro/types/enums.d.ts +30 -28
  33. package/edu-pilot-pro/types/enums.js +1 -445
  34. package/edu-pilot-pro/types/finance.d.ts +2 -128
  35. package/edu-pilot-pro/types/finance.js +1 -8
  36. package/edu-pilot-pro/types/index.d.ts +2 -12
  37. package/edu-pilot-pro/types/index.js +1 -28
  38. package/edu-pilot-pro/types/user-management.d.ts +2 -236
  39. package/edu-pilot-pro/types/user-management.js +1 -8
  40. package/factory/generic-component-factory.d.ts +12 -9
  41. package/factory/generic-component-factory.js +1 -131
  42. package/factory/generic-module-factory.d.ts +14 -10
  43. package/factory/generic-module-factory.js +1 -190
  44. package/general/basic-get.d.ts +8 -1
  45. package/general/basic-get.js +1 -83
  46. package/general/basic-post.d.ts +8 -1
  47. package/general/basic-post.js +1 -70
  48. package/general/calculate-pages.d.ts +9 -1
  49. package/general/calculate-pages.js +1 -7
  50. package/general/camel-to-sentence-case.d.ts +3 -1
  51. package/general/camel-to-sentence-case.js +1 -20
  52. package/general/check-even-odd-length.d.ts +3 -1
  53. package/general/check-even-odd-length.js +1 -17
  54. package/general/clear-cache.d.ts +7 -2
  55. package/general/clear-cache.js +1 -12
  56. package/general/cnic-formatter.d.ts +16 -3
  57. package/general/cnic-formatter.js +1 -53
  58. package/general/convert-url-to-base64.d.ts +8 -6
  59. package/general/convert-url-to-base64.js +1 -231
  60. package/general/countries.d.ts +5 -3
  61. package/general/countries.js +1 -514
  62. package/general/create-date.d.ts +3 -1
  63. package/general/create-date.js +1 -22
  64. package/general/crypto.d.ts +4 -2
  65. package/general/crypto.js +1 -45
  66. package/general/currencies.d.ts +2 -0
  67. package/general/currencies.js +0 -1077
  68. package/general/delete-image-from-private-supabase.d.ts +10 -2
  69. package/general/delete-image-from-private-supabase.js +1 -66
  70. package/general/delete-image-from-public-supabase.d.ts +10 -2
  71. package/general/delete-image-from-public-supabase.js +1 -66
  72. package/general/download-from-url.d.ts +8 -1
  73. package/general/download-from-url.js +1 -82
  74. package/general/dynamic-page-limit.d.ts +9 -3
  75. package/general/dynamic-page-limit.js +1 -7
  76. package/general/enum-to-text.d.ts +8 -1
  77. package/general/enum-to-text.js +1 -11
  78. package/general/fetch-data.d.ts +16 -4
  79. package/general/fetch-data.js +1 -95
  80. package/general/fetch-supabase-image.d.ts +11 -2
  81. package/general/fetch-supabase-image.js +1 -67
  82. package/general/fetch-supabase-private-assets.d.ts +11 -2
  83. package/general/fetch-supabase-private-assets.js +1 -69
  84. package/general/format-date.d.ts +10 -2
  85. package/general/format-date.js +1 -49
  86. package/general/format-number.d.ts +12 -2
  87. package/general/format-number.js +1 -35
  88. package/general/format-phone-display.d.ts +9 -1
  89. package/general/format-phone-display.js +1 -32
  90. package/general/format-phone.d.ts +10 -2
  91. package/general/format-phone.js +1 -20
  92. package/general/format-pricing.d.ts +8 -1
  93. package/general/format-pricing.js +1 -23
  94. package/general/format-secs.d.ts +8 -1
  95. package/general/format-secs.js +1 -21
  96. package/general/format-time.d.ts +8 -2
  97. package/general/format-time.js +1 -38
  98. package/general/format-value.d.ts +8 -1
  99. package/general/format-value.js +1 -7
  100. package/general/full-month-range.d.ts +3 -2
  101. package/general/full-month-range.js +1 -24
  102. package/general/full-year-range.d.ts +3 -2
  103. package/general/full-year-range.js +1 -20
  104. package/general/generate-article-schema.d.ts +3 -2
  105. package/general/generate-article-schema.js +1 -100
  106. package/general/generate-blog-schema.d.ts +3 -2
  107. package/general/generate-blog-schema.js +1 -32
  108. package/general/generate-book-schema.d.ts +3 -2
  109. package/general/generate-book-schema.js +1 -109
  110. package/general/generate-breadcrumb-schema.d.ts +3 -2
  111. package/general/generate-breadcrumb-schema.js +1 -34
  112. package/general/generate-carousel-schema.d.ts +3 -2
  113. package/general/generate-carousel-schema.js +1 -172
  114. package/general/generate-course-schema.d.ts +3 -2
  115. package/general/generate-course-schema.js +1 -124
  116. package/general/generate-dataset-schema.d.ts +3 -2
  117. package/general/generate-dataset-schema.js +1 -156
  118. package/general/generate-discussion-forum-schema.d.ts +3 -2
  119. package/general/generate-discussion-forum-schema.js +1 -67
  120. package/general/generate-education-schema.d.ts +3 -2
  121. package/general/generate-education-schema.js +1 -137
  122. package/general/generate-employer-aggregate-rating-schema.d.ts +3 -2
  123. package/general/generate-employer-aggregate-rating-schema.js +1 -64
  124. package/general/generate-event-schema.d.ts +3 -2
  125. package/general/generate-event-schema.js +1 -214
  126. package/general/generate-faq-schema.d.ts +3 -2
  127. package/general/generate-faq-schema.js +1 -43
  128. package/general/generate-grid.d.ts +3 -2
  129. package/general/generate-grid.js +1 -55
  130. package/general/generate-image-metadata-schema.d.ts +3 -2
  131. package/general/generate-image-metadata-schema.js +1 -73
  132. package/general/generate-job-posting-schema.d.ts +3 -2
  133. package/general/generate-job-posting-schema.js +1 -120
  134. package/general/generate-local-business-schema.d.ts +3 -2
  135. package/general/generate-local-business-schema.js +1 -75
  136. package/general/generate-math-solver-schema.d.ts +3 -2
  137. package/general/generate-math-solver-schema.js +1 -83
  138. package/general/generate-movie-carousel-schema.d.ts +3 -2
  139. package/general/generate-movie-carousel-schema.js +1 -160
  140. package/general/generate-organization-schema.d.ts +3 -2
  141. package/general/generate-organization-schema.js +1 -39
  142. package/general/generate-profile-page-schema.d.ts +3 -2
  143. package/general/generate-profile-page-schema.js +1 -82
  144. package/general/generate-qa-page-schema.d.ts +3 -2
  145. package/general/generate-qa-page-schema.js +1 -67
  146. package/general/generate-recipe-schema.d.ts +3 -2
  147. package/general/generate-recipe-schema.js +1 -104
  148. package/general/generate-ref.d.ts +8 -2
  149. package/general/generate-ref.js +1 -12
  150. package/general/generate-review-snippet-schema.d.ts +3 -2
  151. package/general/generate-review-snippet-schema.js +1 -137
  152. package/general/generate-shopping-loyalty-program-schema.d.ts +3 -2
  153. package/general/generate-shopping-loyalty-program-schema.js +1 -59
  154. package/general/generate-shopping-merchant-listing-schema.d.ts +3 -2
  155. package/general/generate-shopping-merchant-listing-schema.js +1 -153
  156. package/general/generate-shopping-merchant-return-policy-schema.d.ts +3 -2
  157. package/general/generate-shopping-merchant-return-policy-schema.js +1 -68
  158. package/general/generate-shopping-merchant-shipping-policy-schema.d.ts +3 -2
  159. package/general/generate-shopping-merchant-shipping-policy-schema.js +1 -74
  160. package/general/generate-shopping-overview-schema.d.ts +3 -2
  161. package/general/generate-shopping-overview-schema.js +1 -157
  162. package/general/generate-shopping-product-snippet-schema.d.ts +3 -2
  163. package/general/generate-shopping-product-snippet-schema.js +1 -167
  164. package/general/generate-shopping-variants-schema.d.ts +3 -2
  165. package/general/generate-shopping-variants-schema.js +1 -143
  166. package/general/generate-software-app-schema.d.ts +3 -2
  167. package/general/generate-software-app-schema.js +1 -143
  168. package/general/generate-speakable-schema.d.ts +3 -2
  169. package/general/generate-speakable-schema.js +1 -139
  170. package/general/generate-subscription-schema.d.ts +3 -2
  171. package/general/generate-subscription-schema.js +1 -133
  172. package/general/generate-vacation-rental-schema.d.ts +3 -2
  173. package/general/generate-vacation-rental-schema.js +1 -135
  174. package/general/generate-video-schema.d.ts +3 -2
  175. package/general/generate-video-schema.js +1 -163
  176. package/general/generic-cache.d.ts +17 -15
  177. package/general/generic-cache.js +1 -659
  178. package/general/get-available-page-limit.d.ts +8 -2
  179. package/general/get-available-page-limit.js +1 -31
  180. package/general/get-calendar-current-month.d.ts +11 -3
  181. package/general/get-calendar-current-month.js +1 -31
  182. package/general/get-calendar-dates.d.ts +11 -3
  183. package/general/get-calendar-dates.js +1 -42
  184. package/general/get-calendar-next-month.d.ts +12 -3
  185. package/general/get-calendar-next-month.js +1 -32
  186. package/general/get-calendar-previous-month.d.ts +12 -3
  187. package/general/get-calendar-previous-month.js +1 -36
  188. package/general/get-current-year.d.ts +7 -1
  189. package/general/get-current-year.js +1 -5
  190. package/general/get-day-name.d.ts +5 -3
  191. package/general/get-day-name.js +1 -14
  192. package/general/get-dial-code.d.ts +8 -1
  193. package/general/get-dial-code.js +1 -8
  194. package/general/get-full-name.d.ts +9 -2
  195. package/general/get-full-name.js +1 -8
  196. package/general/get-href.d.ts +3 -1
  197. package/general/get-href.js +1 -13
  198. package/general/get-month-name.d.ts +5 -3
  199. package/general/get-month-name.js +1 -19
  200. package/general/get-month-number.d.ts +5 -3
  201. package/general/get-month-number.js +1 -29
  202. package/general/get-number-of-days-in-month.d.ts +9 -2
  203. package/general/get-number-of-days-in-month.js +1 -12
  204. package/general/get-pathname.d.ts +3 -1
  205. package/general/get-pathname.js +1 -16
  206. package/general/get-week-day.d.ts +8 -1
  207. package/general/get-week-day.js +1 -9
  208. package/general/image-url-to-base64.d.ts +3 -1
  209. package/general/image-url-to-base64.js +1 -80
  210. package/general/is-created-or-updated.d.ts +3 -1
  211. package/general/is-created-or-updated.js +1 -26
  212. package/general/is-next-button-disabled.d.ts +9 -1
  213. package/general/is-next-button-disabled.js +1 -5
  214. package/general/is-odd.d.ts +3 -1
  215. package/general/is-odd.js +1 -13
  216. package/general/is-previous-button-disabled.d.ts +8 -1
  217. package/general/is-previous-button-disabled.js +1 -7
  218. package/general/linear-gradients.d.ts +4 -2
  219. package/general/linear-gradients.js +1 -52
  220. package/general/multi-part-search.d.ts +10 -2
  221. package/general/multi-part-search.js +1 -16
  222. package/general/normalize-phone.d.ts +15 -2
  223. package/general/normalize-phone.js +1 -40
  224. package/general/parse-frontmatter.d.ts +11 -4
  225. package/general/parse-frontmatter.js +2 -35
  226. package/general/remove-data-image-prefix.d.ts +8 -1
  227. package/general/remove-data-image-prefix.js +1 -7
  228. package/general/repeat-times.d.ts +3 -1
  229. package/general/repeat-times.js +1 -21
  230. package/general/resolve-anchor-link.d.ts +3 -1
  231. package/general/resolve-anchor-link.js +1 -26
  232. package/general/resolve-current-date.d.ts +3 -1
  233. package/general/resolve-current-date.js +1 -22
  234. package/general/resolve-grid.d.ts +3 -1
  235. package/general/resolve-grid.js +1 -18
  236. package/general/resolve-initials.d.ts +3 -1
  237. package/general/resolve-initials.js +1 -17
  238. package/general/set-timezone.d.ts +11 -1
  239. package/general/set-timezone.js +1 -12
  240. package/general/slugify.d.ts +3 -1
  241. package/general/slugify.js +1 -24
  242. package/general/text-to-enum.d.ts +8 -1
  243. package/general/text-to-enum.js +1 -10
  244. package/general/text-to-sentence-case.d.ts +3 -1
  245. package/general/text-to-sentence-case.js +1 -16
  246. package/general/time-out.d.ts +3 -1
  247. package/general/time-out.js +1 -16
  248. package/general/time-zones.d.ts +3 -1
  249. package/general/time-zones.js +1 -437
  250. package/general/truncate-text.d.ts +3 -1
  251. package/general/truncate-text.js +1 -18
  252. package/general/type.d.ts +3 -1
  253. package/general/type.js +1 -2
  254. package/general/upload-blob-to-private-supabase.d.ts +14 -2
  255. package/general/upload-blob-to-private-supabase.js +1 -62
  256. package/general/upload-blob-to-public-supabase.d.ts +14 -2
  257. package/general/upload-blob-to-public-supabase.js +1 -62
  258. package/general/upload-image-to-private-supabase.d.ts +15 -3
  259. package/general/upload-image-to-private-supabase.js +1 -66
  260. package/general/upload-image-to-public-supabase.d.ts +15 -3
  261. package/general/upload-image-to-public-supabase.js +1 -66
  262. package/general/url-to-sentence-case.d.ts +3 -1
  263. package/general/url-to-sentence-case.js +1 -19
  264. package/general/validate-comment.d.ts +3 -1
  265. package/general/validate-comment.js +1 -21
  266. package/general/validate-email.d.ts +3 -1
  267. package/general/validate-email.js +1 -24
  268. package/general/validate-form.d.ts +12 -3
  269. package/general/validate-form.js +1 -29
  270. package/general/validate-name.d.ts +3 -1
  271. package/general/validate-name.js +1 -21
  272. package/hooks/use-change.d.ts +11 -2
  273. package/hooks/use-change.js +1 -23
  274. package/hooks/use-debounce.d.ts +10 -1
  275. package/hooks/use-debounce.js +1 -14
  276. package/hooks/use-fetch.d.ts +7 -5
  277. package/hooks/use-fetch.js +1 -239
  278. package/hooks/use-force-render.d.ts +6 -2
  279. package/hooks/use-force-render.js +1 -17
  280. package/hooks/use-ip-geo-location.d.ts +8 -1
  281. package/hooks/use-ip-geo-location.js +1 -79
  282. package/hooks/use-is-mobile.d.ts +8 -1
  283. package/hooks/use-is-mobile.js +1 -22
  284. package/hooks/use-module-entity-v2.d.ts +7 -4
  285. package/hooks/use-module-entity-v2.js +1 -188
  286. package/hooks/use-module-entity.d.ts +7 -4
  287. package/hooks/use-module-entity.js +1 -177
  288. package/hooks/use-phone-formatter.d.ts +10 -2
  289. package/hooks/use-phone-formatter.js +1 -23
  290. package/hooks/use-position.d.ts +6 -3
  291. package/hooks/use-position.js +1 -43
  292. package/hooks/use-rtl.d.ts +4 -2
  293. package/hooks/use-rtl.js +1 -84
  294. package/hooks/use-sticky.d.ts +3 -1
  295. package/hooks/use-sticky.js +1 -39
  296. package/hooks/use-toggle-state.d.ts +3 -2
  297. package/hooks/use-toggle-state.js +1 -26
  298. package/hooks/use-window-event-listener.d.ts +9 -1
  299. package/hooks/use-window-event-listener.js +1 -11
  300. package/hooks/with-seo.d.ts +11 -2
  301. package/hooks/with-seo.js +1 -37
  302. package/local-storage/get-storage-value.d.ts +5 -2
  303. package/local-storage/get-storage-value.js +1 -20
  304. package/local-storage/remove-storage-value.d.ts +3 -1
  305. package/local-storage/remove-storage-value.js +1 -14
  306. package/local-storage/set-storage-value.d.ts +3 -1
  307. package/local-storage/set-storage-value.js +1 -14
  308. package/local-storage/type.d.ts +3 -1
  309. package/local-storage/type.js +1 -2
  310. package/npm.d.d.ts +2 -0
  311. package/npm.d.js +0 -0
  312. package/package.json +21 -19
  313. package/{api/stellar-solutions → stellar-solution}/types/common.d.ts +4 -2
  314. package/stellar-solution/types/common.js +1 -0
  315. package/{api/stellar-solutions → stellar-solution}/types/erp.d.ts +36 -33
  316. package/stellar-solution/types/erp.js +1 -0
  317. package/stellar-solution/types/index.d.ts +3 -0
  318. package/stellar-solution/types/index.js +1 -0
  319. package/{api/stellar-solutions → stellar-solution}/types/pos.d.ts +27 -24
  320. package/stellar-solution/types/pos.js +1 -0
  321. package/storybook/generate-sitemap.d.ts +3 -1
  322. package/storybook/generate-sitemap.js +17 -26
  323. package/storybook/preview.d.ts +4 -2
  324. package/storybook/preview.js +1 -62
  325. package/storybook/react-design-story-script.d.ts +3 -1
  326. package/storybook/react-design-story-script.js +5 -27
  327. package/storybook/react-emoji-collection.d.ts +3 -1
  328. package/storybook/react-emoji-collection.js +10 -55
  329. package/storybook/react-emoji-story-script.d.ts +3 -1
  330. package/storybook/react-emoji-story-script.js +5 -31
  331. package/storybook/react-emoji-story-template.d.ts +3 -1
  332. package/storybook/react-emoji-story-template.js +45 -15
  333. package/storybook/react-icon-collection.d.ts +3 -1
  334. package/storybook/react-icon-collection.js +10 -42
  335. package/storybook/react-icon-story-script.d.ts +3 -1
  336. package/storybook/react-icon-story-script.js +5 -27
  337. package/storybook/react-icon-story-template.d.ts +3 -1
  338. package/storybook/react-icon-story-template.js +45 -14
  339. package/storybook/react-logo-collection.d.ts +3 -1
  340. package/storybook/react-logo-collection.js +10 -42
  341. package/storybook/react-logo-story-script.d.ts +3 -1
  342. package/storybook/react-logo-story-script.js +5 -27
  343. package/storybook/react-logo-story-template.d.ts +3 -1
  344. package/storybook/react-logo-story-template.js +45 -14
  345. package/storybook/react-pakistan-theme.d.ts +3 -1
  346. package/storybook/react-pakistan-theme.js +1 -31
  347. package/storybook/responsive-args.d.ts +11 -10
  348. package/storybook/responsive-args.js +1 -19
  349. package/storybook/responsive-component.d.ts +4 -2
  350. package/storybook/responsive-component.js +37 -23
  351. package/storybook/responsive-screens.d.ts +3 -1
  352. package/storybook/responsive-screens.js +1 -109
  353. package/storybook/theme.d.ts +17 -15
  354. package/storybook/theme.js +1 -1022
  355. package/api/stellar-solutions/app-user/index.d.ts +0 -51
  356. package/api/stellar-solutions/app-user/index.js +0 -210
  357. package/api/stellar-solutions/bank/index.d.ts +0 -59
  358. package/api/stellar-solutions/bank/index.js +0 -210
  359. package/api/stellar-solutions/branch/index.d.ts +0 -58
  360. package/api/stellar-solutions/branch/index.js +0 -220
  361. package/api/stellar-solutions/company/index.d.ts +0 -57
  362. package/api/stellar-solutions/company/index.js +0 -218
  363. package/api/stellar-solutions/company-report/index.d.ts +0 -15
  364. package/api/stellar-solutions/company-report/index.js +0 -74
  365. package/api/stellar-solutions/constants.d.ts +0 -19
  366. package/api/stellar-solutions/constants.js +0 -22
  367. package/api/stellar-solutions/contact/index.d.ts +0 -56
  368. package/api/stellar-solutions/contact/index.js +0 -217
  369. package/api/stellar-solutions/currency/index.d.ts +0 -55
  370. package/api/stellar-solutions/currency/index.js +0 -212
  371. package/api/stellar-solutions/customer/index.d.ts +0 -68
  372. package/api/stellar-solutions/customer/index.js +0 -249
  373. package/api/stellar-solutions/expense/index.d.ts +0 -58
  374. package/api/stellar-solutions/expense/index.js +0 -229
  375. package/api/stellar-solutions/expense-category/index.d.ts +0 -53
  376. package/api/stellar-solutions/expense-category/index.js +0 -214
  377. package/api/stellar-solutions/lead/index.d.ts +0 -51
  378. package/api/stellar-solutions/lead/index.js +0 -206
  379. package/api/stellar-solutions/menu-order/index.d.ts +0 -53
  380. package/api/stellar-solutions/menu-order/index.js +0 -202
  381. package/api/stellar-solutions/payment/index.d.ts +0 -65
  382. package/api/stellar-solutions/payment/index.js +0 -230
  383. package/api/stellar-solutions/payment-mode/index.d.ts +0 -53
  384. package/api/stellar-solutions/payment-mode/index.js +0 -191
  385. package/api/stellar-solutions/preference/index.d.ts +0 -25
  386. package/api/stellar-solutions/preference/index.js +0 -114
  387. package/api/stellar-solutions/product/index.d.ts +0 -64
  388. package/api/stellar-solutions/product/index.js +0 -235
  389. package/api/stellar-solutions/product-category/index.d.ts +0 -51
  390. package/api/stellar-solutions/product-category/index.js +0 -212
  391. package/api/stellar-solutions/profile/index.d.ts +0 -78
  392. package/api/stellar-solutions/profile/index.js +0 -234
  393. package/api/stellar-solutions/quote-invoice/index.d.ts +0 -97
  394. package/api/stellar-solutions/quote-invoice/index.js +0 -369
  395. package/api/stellar-solutions/quote-invoice-report/index.d.ts +0 -15
  396. package/api/stellar-solutions/quote-invoice-report/index.js +0 -74
  397. package/api/stellar-solutions/tax/index.d.ts +0 -55
  398. package/api/stellar-solutions/tax/index.js +0 -224
  399. package/api/stellar-solutions/types/common.js +0 -22
  400. package/api/stellar-solutions/types/erp.js +0 -73
  401. package/api/stellar-solutions/types/index.d.ts +0 -3
  402. package/api/stellar-solutions/types/index.js +0 -19
  403. package/api/stellar-solutions/types/pos.js +0 -61
  404. package/constants/index.d.ts +0 -12
  405. package/constants/index.js +0 -28
  406. package/factory/index.d.ts +0 -2
  407. package/factory/index.js +0 -18
  408. package/general/index.d.ts +0 -95
  409. package/general/index.js +0 -111
  410. package/index.d.ts +0 -28
  411. package/index.js +0 -44
  412. package/local-storage/index.d.ts +0 -4
  413. package/local-storage/index.js +0 -20
  414. package/setupTests.d.ts +0 -1
  415. package/setupTests.js +0 -52
  416. package/storybook/index.d.ts +0 -17
  417. package/storybook/index.js +0 -33
@@ -1,4 +1,4 @@
1
- export interface UploadBlobToPrivateSupabaseArgs {
1
+ interface UploadBlobToPrivateSupabaseArgs {
2
2
  blob: Blob;
3
3
  cacheControl?: string;
4
4
  contentType: string;
@@ -6,7 +6,19 @@ export interface UploadBlobToPrivateSupabaseArgs {
6
6
  supabase: any;
7
7
  upsert: boolean;
8
8
  }
9
- export declare const uploadBlobToPrivateSupabase: ({ blob, cacheControl, contentType, fileRef, supabase, upsert, }: UploadBlobToPrivateSupabaseArgs) => Promise<{
9
+ /**
10
+ * Uploads a Blob to the private Supabase storage bucket.
11
+ * @param params.blob - The Blob to upload.
12
+ * @param params.cacheControl - Cache control header value.
13
+ * @param params.contentType - MIME type of the blob.
14
+ * @param params.fileRef - File reference/path in storage.
15
+ * @param params.supabase - Supabase client instance.
16
+ * @param params.upsert - Whether to overwrite existing file.
17
+ * @returns Object containing `data` and `error` from Supabase.
18
+ */
19
+ declare const uploadBlobToPrivateSupabase: ({ blob, cacheControl, contentType, fileRef, supabase, upsert, }: UploadBlobToPrivateSupabaseArgs) => Promise<{
10
20
  data: any;
11
21
  error: any;
12
22
  }>;
23
+
24
+ export { type UploadBlobToPrivateSupabaseArgs, uploadBlobToPrivateSupabase };
@@ -1,62 +1 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- var __generator = (this && this.__generator) || function (thisArg, body) {
12
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
13
- return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
- function verb(n) { return function (v) { return step([n, v]); }; }
15
- function step(op) {
16
- if (f) throw new TypeError("Generator is already executing.");
17
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
- if (y = 0, t) op = [op[0] & 2, t.value];
20
- switch (op[0]) {
21
- case 0: case 1: t = op; break;
22
- case 4: _.label++; return { value: op[1], done: false };
23
- case 5: _.label++; y = op[1]; op = [0]; continue;
24
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
- default:
26
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
- if (t[2]) _.ops.pop();
31
- _.trys.pop(); continue;
32
- }
33
- op = body.call(thisArg, _);
34
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
- }
37
- };
38
- Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.uploadBlobToPrivateSupabase = void 0;
40
- var uploadBlobToPrivateSupabase = function (_a) { return __awaiter(void 0, [_a], void 0, function (_b) {
41
- var _c, data, error;
42
- var blob = _b.blob, cacheControl = _b.cacheControl, contentType = _b.contentType, fileRef = _b.fileRef, supabase = _b.supabase, upsert = _b.upsert;
43
- return __generator(this, function (_d) {
44
- switch (_d.label) {
45
- case 0: return [4 /*yield*/, supabase.storage
46
- .from(process.env.NEXT_PUBLIC_SUPABASE_PRIVATE_BUCKET)
47
- .upload(fileRef, blob, {
48
- cacheControl: cacheControl ||
49
- process.env.NEXT_PUBLIC_SUPABASE_CACHE_CONTROL,
50
- contentType: contentType,
51
- upsert: upsert,
52
- })];
53
- case 1:
54
- _c = _d.sent(), data = _c.data, error = _c.error;
55
- return [2 /*return*/, {
56
- data: data,
57
- error: error,
58
- }];
59
- }
60
- });
61
- }); };
62
- exports.uploadBlobToPrivateSupabase = uploadBlobToPrivateSupabase;
1
+ var t=Object.defineProperty;var i=Object.getOwnPropertyDescriptor;var b=Object.getOwnPropertyNames;var c=Object.prototype.hasOwnProperty;var B=(o,a)=>{for(var e in a)t(o,e,{get:a[e],enumerable:!0})},P=(o,a,e,s)=>{if(a&&typeof a=="object"||typeof a=="function")for(let r of b(a))!c.call(o,r)&&r!==e&&t(o,r,{get:()=>a[r],enumerable:!(s=i(a,r))||s.enumerable});return o};var T=o=>P(t({},"__esModule",{value:!0}),o);var u={};B(u,{uploadBlobToPrivateSupabase:()=>g});module.exports=T(u);const g=async({blob:o,cacheControl:a,contentType:e,fileRef:s,supabase:r,upsert:n})=>{const{data:p,error:l}=await r.storage.from(process.env.NEXT_PUBLIC_SUPABASE_PRIVATE_BUCKET).upload(s,o,{cacheControl:a||process.env.NEXT_PUBLIC_SUPABASE_CACHE_CONTROL,contentType:e,upsert:n});return{data:p,error:l}};0&&(module.exports={uploadBlobToPrivateSupabase});
@@ -1,4 +1,4 @@
1
- export interface UploadBlobToPublicSupabaseArgs {
1
+ interface UploadBlobToPublicSupabaseArgs {
2
2
  blob: Blob;
3
3
  cacheControl?: string;
4
4
  contentType: string;
@@ -6,7 +6,19 @@ export interface UploadBlobToPublicSupabaseArgs {
6
6
  supabase: any;
7
7
  upsert: boolean;
8
8
  }
9
- export declare const uploadBlobToPublicSupabase: ({ blob, cacheControl, contentType, fileRef, supabase, upsert, }: UploadBlobToPublicSupabaseArgs) => Promise<{
9
+ /**
10
+ * Uploads a Blob to the public Supabase storage bucket.
11
+ * @param params.blob - The Blob to upload.
12
+ * @param params.cacheControl - Cache control header value.
13
+ * @param params.contentType - MIME type of the blob.
14
+ * @param params.fileRef - File reference/path in storage.
15
+ * @param params.supabase - Supabase client instance.
16
+ * @param params.upsert - Whether to overwrite existing file.
17
+ * @returns Object containing `data` and `error` from Supabase.
18
+ */
19
+ declare const uploadBlobToPublicSupabase: ({ blob, cacheControl, contentType, fileRef, supabase, upsert, }: UploadBlobToPublicSupabaseArgs) => Promise<{
10
20
  data: any;
11
21
  error: any;
12
22
  }>;
23
+
24
+ export { type UploadBlobToPublicSupabaseArgs, uploadBlobToPublicSupabase };
@@ -1,62 +1 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- var __generator = (this && this.__generator) || function (thisArg, body) {
12
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
13
- return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
- function verb(n) { return function (v) { return step([n, v]); }; }
15
- function step(op) {
16
- if (f) throw new TypeError("Generator is already executing.");
17
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
- if (y = 0, t) op = [op[0] & 2, t.value];
20
- switch (op[0]) {
21
- case 0: case 1: t = op; break;
22
- case 4: _.label++; return { value: op[1], done: false };
23
- case 5: _.label++; y = op[1]; op = [0]; continue;
24
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
- default:
26
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
- if (t[2]) _.ops.pop();
31
- _.trys.pop(); continue;
32
- }
33
- op = body.call(thisArg, _);
34
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
- }
37
- };
38
- Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.uploadBlobToPublicSupabase = void 0;
40
- var uploadBlobToPublicSupabase = function (_a) { return __awaiter(void 0, [_a], void 0, function (_b) {
41
- var _c, data, error;
42
- var blob = _b.blob, cacheControl = _b.cacheControl, contentType = _b.contentType, fileRef = _b.fileRef, supabase = _b.supabase, upsert = _b.upsert;
43
- return __generator(this, function (_d) {
44
- switch (_d.label) {
45
- case 0: return [4 /*yield*/, supabase.storage
46
- .from(process.env.NEXT_PUBLIC_SUPABASE_PUBLIC_BUCKET)
47
- .upload(fileRef, blob, {
48
- cacheControl: cacheControl ||
49
- process.env.NEXT_PUBLIC_SUPABASE_CACHE_CONTROL,
50
- contentType: contentType,
51
- upsert: upsert,
52
- })];
53
- case 1:
54
- _c = _d.sent(), data = _c.data, error = _c.error;
55
- return [2 /*return*/, {
56
- data: data,
57
- error: error,
58
- }];
59
- }
60
- });
61
- }); };
62
- exports.uploadBlobToPublicSupabase = uploadBlobToPublicSupabase;
1
+ var n=Object.defineProperty;var c=Object.getOwnPropertyDescriptor;var p=Object.getOwnPropertyNames;var i=Object.prototype.hasOwnProperty;var u=(a,o)=>{for(var e in o)n(a,e,{get:o[e],enumerable:!0})},B=(a,o,e,s)=>{if(o&&typeof o=="object"||typeof o=="function")for(let r of p(o))!i.call(a,r)&&r!==e&&n(a,r,{get:()=>o[r],enumerable:!(s=c(o,r))||s.enumerable});return a};var C=a=>B(n({},"__esModule",{value:!0}),a);var g={};u(g,{uploadBlobToPublicSupabase:()=>P});module.exports=C(g);const P=async({blob:a,cacheControl:o,contentType:e,fileRef:s,supabase:r,upsert:t})=>{const{data:l,error:b}=await r.storage.from(process.env.NEXT_PUBLIC_SUPABASE_PUBLIC_BUCKET).upload(s,a,{cacheControl:o||process.env.NEXT_PUBLIC_SUPABASE_CACHE_CONTROL,contentType:e,upsert:t});return{data:l,error:b}};0&&(module.exports={uploadBlobToPublicSupabase});
@@ -1,4 +1,4 @@
1
- export interface UploadImageToPrivateSupabaseArgs {
1
+ interface UploadImageToPrivateSupabaseArgs {
2
2
  cacheControl?: string;
3
3
  blob: string;
4
4
  contentType: string;
@@ -6,9 +6,21 @@ export interface UploadImageToPrivateSupabaseArgs {
6
6
  supabase: any;
7
7
  upsert: boolean;
8
8
  }
9
- export interface PrivateReturn {
9
+ interface PrivateReturn {
10
10
  fullPath: string;
11
11
  id: string;
12
12
  path: string;
13
13
  }
14
- export declare const uploadImageToPrivateSupabase: ({ blob, cacheControl, contentType, fileRef, supabase, upsert, }: UploadImageToPrivateSupabaseArgs) => Promise<PrivateReturn>;
14
+ /**
15
+ * Uploads a base64 image to the private Supabase storage bucket.
16
+ * @param params.blob - Base64 image string.
17
+ * @param params.cacheControl - Cache control header value.
18
+ * @param params.contentType - MIME type of the image.
19
+ * @param params.fileRef - File reference/path in storage.
20
+ * @param params.supabase - Supabase client instance.
21
+ * @param params.upsert - Whether to overwrite existing file.
22
+ * @returns The upload result data or error.
23
+ */
24
+ declare const uploadImageToPrivateSupabase: ({ blob, cacheControl, contentType, fileRef, supabase, upsert, }: UploadImageToPrivateSupabaseArgs) => Promise<PrivateReturn>;
25
+
26
+ export { type PrivateReturn, type UploadImageToPrivateSupabaseArgs, uploadImageToPrivateSupabase };
@@ -1,66 +1 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- var __generator = (this && this.__generator) || function (thisArg, body) {
12
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
13
- return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
- function verb(n) { return function (v) { return step([n, v]); }; }
15
- function step(op) {
16
- if (f) throw new TypeError("Generator is already executing.");
17
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
- if (y = 0, t) op = [op[0] & 2, t.value];
20
- switch (op[0]) {
21
- case 0: case 1: t = op; break;
22
- case 4: _.label++; return { value: op[1], done: false };
23
- case 5: _.label++; y = op[1]; op = [0]; continue;
24
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
- default:
26
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
- if (t[2]) _.ops.pop();
31
- _.trys.pop(); continue;
32
- }
33
- op = body.call(thisArg, _);
34
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
- }
37
- };
38
- Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.uploadImageToPrivateSupabase = void 0;
40
- var remove_data_image_prefix_1 = require("./remove-data-image-prefix");
41
- var uploadImageToPrivateSupabase = function (_a) { return __awaiter(void 0, [_a], void 0, function (_b) {
42
- var base64StringWithoutPrefix, buffer, _c, data, error;
43
- var blob = _b.blob, cacheControl = _b.cacheControl, contentType = _b.contentType, fileRef = _b.fileRef, supabase = _b.supabase, upsert = _b.upsert;
44
- return __generator(this, function (_d) {
45
- switch (_d.label) {
46
- case 0:
47
- base64StringWithoutPrefix = (0, remove_data_image_prefix_1.removeDataImagePrefix)(blob);
48
- buffer = Buffer.from(base64StringWithoutPrefix, 'base64');
49
- return [4 /*yield*/, supabase.storage
50
- .from(process.env.NEXT_PUBLIC_SUPABASE_PRIVATE_BUCKET)
51
- .upload(fileRef, buffer, {
52
- cacheControl: cacheControl ||
53
- process.env.NEXT_PUBLIC_SUPABASE_CACHE_CONTROL,
54
- contentType: contentType,
55
- upsert: upsert,
56
- })];
57
- case 1:
58
- _c = _d.sent(), data = _c.data, error = _c.error;
59
- if (error) {
60
- return [2 /*return*/, error];
61
- }
62
- return [2 /*return*/, data];
63
- }
64
- });
65
- }); };
66
- exports.uploadImageToPrivateSupabase = uploadImageToPrivateSupabase;
1
+ var s=Object.defineProperty;var c=Object.getOwnPropertyDescriptor;var P=Object.getOwnPropertyNames;var l=Object.prototype.hasOwnProperty;var b=(r,e)=>{for(var a in e)s(r,a,{get:e[a],enumerable:!0})},m=(r,e,a,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of P(e))!l.call(r,t)&&t!==a&&s(r,t,{get:()=>e[t],enumerable:!(o=c(e,t))||o.enumerable});return r};var T=r=>m(s({},"__esModule",{value:!0}),r);var A={};b(A,{uploadImageToPrivateSupabase:()=>v});module.exports=T(A);var i=require("./remove-data-image-prefix");const v=async({blob:r,cacheControl:e,contentType:a,fileRef:o,supabase:t,upsert:g})=>{const p=(0,i.removeDataImagePrefix)(r),f=Buffer.from(p,"base64"),{data:u,error:n}=await t.storage.from(process.env.NEXT_PUBLIC_SUPABASE_PRIVATE_BUCKET).upload(o,f,{cacheControl:e||process.env.NEXT_PUBLIC_SUPABASE_CACHE_CONTROL,contentType:a,upsert:g});return n||u};0&&(module.exports={uploadImageToPrivateSupabase});
@@ -1,4 +1,4 @@
1
- export interface UploadImageToPublicSupabaseArgs {
1
+ interface UploadImageToPublicSupabaseArgs {
2
2
  blob: string;
3
3
  cacheControl?: string;
4
4
  contentType: string;
@@ -6,9 +6,21 @@ export interface UploadImageToPublicSupabaseArgs {
6
6
  supabase: any;
7
7
  upsert: boolean;
8
8
  }
9
- export interface PublicReturn {
9
+ interface PublicReturn {
10
10
  fullPath: string;
11
11
  id: string;
12
12
  path: string;
13
13
  }
14
- export declare const uploadImageToPublicSupabase: ({ blob, cacheControl, contentType, fileRef, supabase, upsert, }: UploadImageToPublicSupabaseArgs) => Promise<PublicReturn>;
14
+ /**
15
+ * Uploads a base64 image to the public Supabase storage bucket.
16
+ * @param params.blob - Base64 image string.
17
+ * @param params.cacheControl - Cache control header value.
18
+ * @param params.contentType - MIME type of the image.
19
+ * @param params.fileRef - File reference/path in storage.
20
+ * @param params.supabase - Supabase client instance.
21
+ * @param params.upsert - Whether to overwrite existing file.
22
+ * @returns The upload result data or error.
23
+ */
24
+ declare const uploadImageToPublicSupabase: ({ blob, cacheControl, contentType, fileRef, supabase, upsert, }: UploadImageToPublicSupabaseArgs) => Promise<PublicReturn>;
25
+
26
+ export { type PublicReturn, type UploadImageToPublicSupabaseArgs, uploadImageToPublicSupabase };
@@ -1,66 +1 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- var __generator = (this && this.__generator) || function (thisArg, body) {
12
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
13
- return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
- function verb(n) { return function (v) { return step([n, v]); }; }
15
- function step(op) {
16
- if (f) throw new TypeError("Generator is already executing.");
17
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
- if (y = 0, t) op = [op[0] & 2, t.value];
20
- switch (op[0]) {
21
- case 0: case 1: t = op; break;
22
- case 4: _.label++; return { value: op[1], done: false };
23
- case 5: _.label++; y = op[1]; op = [0]; continue;
24
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
- default:
26
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
- if (t[2]) _.ops.pop();
31
- _.trys.pop(); continue;
32
- }
33
- op = body.call(thisArg, _);
34
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
- }
37
- };
38
- Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.uploadImageToPublicSupabase = void 0;
40
- var remove_data_image_prefix_1 = require("./remove-data-image-prefix");
41
- var uploadImageToPublicSupabase = function (_a) { return __awaiter(void 0, [_a], void 0, function (_b) {
42
- var base64StringWithoutPrefix, buffer, _c, data, error;
43
- var blob = _b.blob, cacheControl = _b.cacheControl, contentType = _b.contentType, fileRef = _b.fileRef, supabase = _b.supabase, upsert = _b.upsert;
44
- return __generator(this, function (_d) {
45
- switch (_d.label) {
46
- case 0:
47
- base64StringWithoutPrefix = (0, remove_data_image_prefix_1.removeDataImagePrefix)(blob);
48
- buffer = Buffer.from(base64StringWithoutPrefix, 'base64');
49
- return [4 /*yield*/, supabase.storage
50
- .from(process.env.NEXT_PUBLIC_SUPABASE_PUBLIC_BUCKET)
51
- .upload(fileRef, buffer, {
52
- cacheControl: cacheControl ||
53
- process.env.NEXT_PUBLIC_SUPABASE_CACHE_CONTROL,
54
- contentType: contentType,
55
- upsert: upsert,
56
- })];
57
- case 1:
58
- _c = _d.sent(), data = _c.data, error = _c.error;
59
- if (error) {
60
- return [2 /*return*/, error];
61
- }
62
- return [2 /*return*/, data];
63
- }
64
- });
65
- }); };
66
- exports.uploadImageToPublicSupabase = uploadImageToPublicSupabase;
1
+ var s=Object.defineProperty;var l=Object.getOwnPropertyDescriptor;var b=Object.getOwnPropertyNames;var f=Object.prototype.hasOwnProperty;var P=(r,e)=>{for(var a in e)s(r,a,{get:e[a],enumerable:!0})},m=(r,e,a,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of b(e))!f.call(r,t)&&t!==a&&s(r,t,{get:()=>e[t],enumerable:!(o=l(e,t))||o.enumerable});return r};var C=r=>m(s({},"__esModule",{value:!0}),r);var T={};P(T,{uploadImageToPublicSupabase:()=>S});module.exports=C(T);var i=require("./remove-data-image-prefix");const S=async({blob:r,cacheControl:e,contentType:a,fileRef:o,supabase:t,upsert:u})=>{const c=(0,i.removeDataImagePrefix)(r),g=Buffer.from(c,"base64"),{data:p,error:n}=await t.storage.from(process.env.NEXT_PUBLIC_SUPABASE_PUBLIC_BUCKET).upload(o,g,{cacheControl:e||process.env.NEXT_PUBLIC_SUPABASE_CACHE_CONTROL,contentType:a,upsert:u});return n||p};0&&(module.exports={uploadImageToPublicSupabase});
@@ -7,4 +7,6 @@
7
7
  * @remarks
8
8
  */
9
9
  /** End file docs */
10
- export declare const urlToSentenceCase: (url: string) => string;
10
+ declare const urlToSentenceCase: (url: string) => string;
11
+
12
+ export { urlToSentenceCase };
@@ -1,19 +1 @@
1
- "use strict";
2
- /**
3
- * A util function to convert url into sentence case
4
- *
5
- * @param str - string provided to convert url into sentence case - taimoorKhan
6
- * @returns string in sentence case - Taimoor Khan
7
- * @author Taimoor Khan
8
- * @remarks
9
- */
10
- /** End file docs */
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.urlToSentenceCase = void 0;
13
- var urlToSentenceCase = function (url) {
14
- var _a, _b;
15
- var chunks = url === null || url === void 0 ? void 0 : url.split('/');
16
- var pageName = chunks[chunks.length - 1];
17
- return (_b = (_a = pageName === null || pageName === void 0 ? void 0 : pageName.split('-')) === null || _a === void 0 ? void 0 : _a.map(function (_str) { return _str.charAt(0).toUpperCase() + _str.slice(1); })) === null || _b === void 0 ? void 0 : _b.join(' ');
18
- };
19
- exports.urlToSentenceCase = urlToSentenceCase;
1
+ var a=Object.defineProperty;var i=Object.getOwnPropertyDescriptor;var p=Object.getOwnPropertyNames;var c=Object.prototype.hasOwnProperty;var g=(t,e)=>{for(var n in e)a(t,n,{get:e[n],enumerable:!0})},o=(t,e,n,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of p(e))!c.call(t,r)&&r!==n&&a(t,r,{get:()=>e[r],enumerable:!(s=i(e,r))||s.enumerable});return t};var l=t=>o(a({},"__esModule",{value:!0}),t);var m={};g(m,{urlToSentenceCase:()=>h});module.exports=l(m);const h=t=>{const e=t?.split("/");return e[e.length-1]?.split("-")?.map(s=>s.charAt(0).toUpperCase()+s.slice(1))?.join(" ")};0&&(module.exports={urlToSentenceCase});
@@ -9,4 +9,6 @@
9
9
  * @remarks Taimoor Khan Resume 2 & Taimoor Khan Resume 4
10
10
  */
11
11
  /** End file docs */
12
- export declare const validateComment: (comment: string) => boolean;
12
+ declare const validateComment: (comment: string) => boolean;
13
+
14
+ export { validateComment };
@@ -1,21 +1 @@
1
- "use strict";
2
- /**
3
- * A util function to validate the length
4
- * of the given comment string
5
- * Acceptable range is from 200 - 1500 chars
6
- *
7
- * @param string - string to validate
8
- * @returns boolean - true or false
9
- * @author Taimoor Khan
10
- * @remarks Taimoor Khan Resume 2 & Taimoor Khan Resume 4
11
- */
12
- /** End file docs */
13
- Object.defineProperty(exports, "__esModule", { value: true });
14
- exports.validateComment = void 0;
15
- var validateComment = function (comment) {
16
- if (comment.length >= 200 && comment.length < 1500) {
17
- return true;
18
- }
19
- return false;
20
- };
21
- exports.validateComment = validateComment;
1
+ var l=Object.defineProperty;var o=Object.getOwnPropertyDescriptor;var g=Object.getOwnPropertyNames;var i=Object.prototype.hasOwnProperty;var s=(e,t)=>{for(var r in t)l(e,r,{get:t[r],enumerable:!0})},u=(e,t,r,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of g(t))!i.call(e,n)&&n!==r&&l(e,n,{get:()=>t[n],enumerable:!(a=o(t,n))||a.enumerable});return e};var f=e=>u(l({},"__esModule",{value:!0}),e);var b={};s(b,{validateComment:()=>h});module.exports=f(b);const h=e=>e.length>=200&&e.length<1500;0&&(module.exports={validateComment});
@@ -10,4 +10,6 @@
10
10
  * @remarks Taimoor Khan Resume 2 & Taimoor Khan Resume 4
11
11
  */
12
12
  /** End file docs */
13
- export declare const validateEmail: (email: string) => boolean;
13
+ declare const validateEmail: (email: string) => boolean;
14
+
15
+ export { validateEmail };
@@ -1,24 +1 @@
1
- "use strict";
2
- /**
3
- * A util function to validate the length
4
- * of the given name email string
5
- * It should't be an empty string
6
- * Also it passed the emailRegex
7
- *
8
- * @param string - string to validate
9
- * @returns boolean - true or false
10
- * @author Taimoor Khan
11
- * @remarks Taimoor Khan Resume 2 & Taimoor Khan Resume 4
12
- */
13
- /** End file docs */
14
- Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.validateEmail = void 0;
16
- /* eslint-disable no-useless-escape */
17
- var emailRegex = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/gi;
18
- var validateEmail = function (email) {
19
- if (email.match(emailRegex)) {
20
- return true;
21
- }
22
- return false;
23
- };
24
- exports.validateEmail = validateEmail;
1
+ var i=Object.defineProperty;var s=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var o=Object.prototype.hasOwnProperty;var c=(e,a)=>{for(var r in a)i(e,r,{get:a[r],enumerable:!0})},g=(e,a,r,n)=>{if(a&&typeof a=="object"||typeof a=="function")for(let t of l(a))!o.call(e,t)&&t!==r&&i(e,t,{get:()=>a[t],enumerable:!(n=s(a,t))||n.enumerable});return e};var m=e=>g(i({},"__esModule",{value:!0}),e);var x={};c(x,{validateEmail:()=>f});module.exports=m(x);const u=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/gi,f=e=>!!e.match(u);0&&(module.exports={validateEmail});
@@ -1,9 +1,18 @@
1
- import { ZodDiscriminatedUnion, ZodObject } from 'zod';
1
+ import { ZodObject, ZodDiscriminatedUnion } from 'zod';
2
+
2
3
  interface Params {
3
4
  errorCallback: (e: Record<string, string>) => void;
4
5
  params: object;
5
6
  schema: ZodObject | ZodDiscriminatedUnion;
6
7
  successCallback: () => void;
7
8
  }
8
- export declare const validateForm: ({ errorCallback, params, schema, successCallback, }: Params) => void;
9
- export {};
9
+ /**
10
+ * Validates form data against a Zod schema and calls the appropriate callback.
11
+ * @param params.schema - The Zod schema to validate against.
12
+ * @param params.params - The form data object to validate.
13
+ * @param params.errorCallback - Callback with validation errors map.
14
+ * @param params.successCallback - Callback on successful validation.
15
+ */
16
+ declare const validateForm: ({ errorCallback, params, schema, successCallback, }: Params) => void;
17
+
18
+ export { validateForm };
@@ -1,29 +1 @@
1
- "use strict";
2
- var __assign = (this && this.__assign) || function () {
3
- __assign = Object.assign || function(t) {
4
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5
- s = arguments[i];
6
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
- t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
- Object.defineProperty(exports, "__esModule", { value: true });
14
- exports.validateForm = void 0;
15
- var validateForm = function (_a) {
16
- var errorCallback = _a.errorCallback, params = _a.params, schema = _a.schema, successCallback = _a.successCallback;
17
- var validationResult = schema === null || schema === void 0 ? void 0 : schema.safeParse(__assign({}, params));
18
- if (validationResult === null || validationResult === void 0 ? void 0 : validationResult.error) {
19
- var validationErrors_1 = {};
20
- validationResult === null || validationResult === void 0 ? void 0 : validationResult.error.issues.forEach(function (err) {
21
- validationErrors_1[err.path.join('-')] = err.message;
22
- });
23
- errorCallback(validationErrors_1);
24
- }
25
- if (validationResult === null || validationResult === void 0 ? void 0 : validationResult.success) {
26
- successCallback();
27
- }
28
- };
29
- exports.validateForm = validateForm;
1
+ var e=Object.defineProperty;var n=Object.getOwnPropertyDescriptor;var d=Object.getOwnPropertyNames;var m=Object.prototype.hasOwnProperty;var l=(o,r)=>{for(var a in r)e(o,a,{get:r[a],enumerable:!0})},f=(o,r,a,i)=>{if(r&&typeof r=="object"||typeof r=="function")for(let s of d(r))!m.call(o,s)&&s!==a&&e(o,s,{get:()=>r[s],enumerable:!(i=n(r,s))||i.enumerable});return o};var v=o=>f(e({},"__esModule",{value:!0}),o);var b={};l(b,{validateForm:()=>Z});module.exports=v(b);const Z=({errorCallback:o,params:r,schema:a,successCallback:i})=>{const s=a?.safeParse({...r});if(s?.error){const t={};s?.error.issues.forEach(c=>{t[c.path.join("-")]=c.message}),o(t)}s?.success&&i()};0&&(module.exports={validateForm});
@@ -9,4 +9,6 @@
9
9
  * @remarks Taimoor Khan Resume 2 & Taimoor Khan Resume 4
10
10
  */
11
11
  /** End file docs */
12
- export declare const validateName: (str: string) => boolean;
12
+ declare const validateName: (str: string) => boolean;
13
+
14
+ export { validateName };
@@ -1,21 +1 @@
1
- "use strict";
2
- /**
3
- * A util function to validate the length
4
- * of the given name string
5
- * Acceptable range is from 3 - 30 chars
6
- *
7
- * @param string - string to validate
8
- * @returns boolean - true or false
9
- * @author Taimoor Khan
10
- * @remarks Taimoor Khan Resume 2 & Taimoor Khan Resume 4
11
- */
12
- /** End file docs */
13
- Object.defineProperty(exports, "__esModule", { value: true });
14
- exports.validateName = void 0;
15
- var validateName = function (str) {
16
- if (str.length >= 3 && str.length < 30) {
17
- return true;
18
- }
19
- return false;
20
- };
21
- exports.validateName = validateName;
1
+ var a=Object.defineProperty;var o=Object.getOwnPropertyDescriptor;var g=Object.getOwnPropertyNames;var i=Object.prototype.hasOwnProperty;var u=(e,t)=>{for(var r in t)a(e,r,{get:t[r],enumerable:!0})},f=(e,t,r,l)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of g(t))!i.call(e,n)&&n!==r&&a(e,n,{get:()=>t[n],enumerable:!(l=o(t,n))||l.enumerable});return e};var h=e=>f(a({},"__esModule",{value:!0}),e);var b={};u(b,{validateName:()=>s});module.exports=h(b);const s=e=>e.length>=3&&e.length<30;0&&(module.exports={validateName});
@@ -1,2 +1,11 @@
1
- import { DependencyList, EffectCallback } from 'react';
2
- export declare const useChange: (callback: EffectCallback, deps: DependencyList) => void;
1
+ import { EffectCallback, DependencyList } from 'react';
2
+
3
+ /**
4
+ * Runs a callback only when dependencies change, skipping the initial mount.
5
+ *
6
+ * @param callback - The effect callback to run on dependency changes.
7
+ * @param deps - The dependency list that triggers the callback.
8
+ */
9
+ declare const useChange: (callback: EffectCallback, deps: DependencyList) => void;
10
+
11
+ export { useChange };
@@ -1,23 +1 @@
1
- "use strict";
2
- var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
3
- if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
4
- if (ar || !(i in from)) {
5
- if (!ar) ar = Array.prototype.slice.call(from, 0, i);
6
- ar[i] = from[i];
7
- }
8
- }
9
- return to.concat(ar || Array.prototype.slice.call(from));
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.useChange = void 0;
13
- var react_1 = require("react");
14
- var useChange = function (callback, deps) {
15
- var init = (0, react_1.useRef)(false);
16
- (0, react_1.useEffect)(function () {
17
- if (init.current) {
18
- callback();
19
- }
20
- init.current = true;
21
- }, __spreadArray([init], deps, true));
22
- };
23
- exports.useChange = useChange;
1
+ var o=Object.defineProperty;var r=Object.getOwnPropertyDescriptor;var s=Object.getOwnPropertyNames;var a=Object.prototype.hasOwnProperty;var l=(t,e)=>{for(var c in e)o(t,c,{get:e[c],enumerable:!0})},u=(t,e,c,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of s(e))!a.call(t,n)&&n!==c&&o(t,n,{get:()=>e[n],enumerable:!(i=r(e,n))||i.enumerable});return t};var d=t=>u(o({},"__esModule",{value:!0}),t);var b={};l(b,{useChange:()=>p});module.exports=d(b);var f=require("react");const p=(t,e)=>{const c=(0,f.useRef)(!1);(0,f.useEffect)(()=>{c.current&&t(),c.current=!0},[c,...e])};0&&(module.exports={useChange});
@@ -1 +1,10 @@
1
- export declare const useDebounce: (value: string, timeout?: number) => string;
1
+ /**
2
+ * Debounces a string value by the specified delay.
3
+ *
4
+ * @param value - The value to debounce.
5
+ * @param timeout - The debounce delay in milliseconds (default 500).
6
+ * @returns The debounced value after the delay has elapsed without change.
7
+ */
8
+ declare const useDebounce: (value: string, timeout?: number) => string;
9
+
10
+ export { useDebounce };