npm-pkg-hook 1.12.4 → 1.12.7

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 (316) hide show
  1. package/dist/index.cjs +20089 -0
  2. package/dist/index.js +19854 -0
  3. package/dist/index.mjs +19854 -0
  4. package/package.json +28 -6
  5. package/.babelrc +0 -0
  6. package/.env +0 -5
  7. package/.eslintrc.js +0 -38
  8. package/.eslintrc.json +0 -127
  9. package/.github/pull_request_template.md +0 -18
  10. package/.github/workflows/pepeline.yaml +0 -30
  11. package/expire.json +0 -1
  12. package/jsconfig.json +0 -28
  13. package/script.txt +0 -7
  14. package/src/config/client/errors.js +0 -26
  15. package/src/config/client/index.js +0 -1
  16. package/src/config/content/en.json +0 -5
  17. package/src/config/content/es.json +0 -5
  18. package/src/config/content/index.js +0 -16
  19. package/src/cookies/index.js +0 -3
  20. package/src/hooks/addTenMinutes/index.js +0 -14
  21. package/src/hooks/calculateLogLatHaversine/index.js +0 -30
  22. package/src/hooks/completeSchedules/index.js +0 -22
  23. package/src/hooks/convertToMilitaryTime/index.js +0 -14
  24. package/src/hooks/generateStoreURL/index.js +0 -38
  25. package/src/hooks/generateTemplate/index.js +0 -62
  26. package/src/hooks/getCardType/index.js +0 -24
  27. package/src/hooks/getCategoriesWithProduct/helpers/index.js +0 -7
  28. package/src/hooks/getCategoriesWithProduct/index.js +0 -62
  29. package/src/hooks/getGlobalSession/index.js +0 -49
  30. package/src/hooks/getSession/index.js +0 -18
  31. package/src/hooks/getTodayTimestamps/index.js +0 -64
  32. package/src/hooks/getTotalHours/index.js +0 -48
  33. package/src/hooks/handleLogin/index.js +0 -10
  34. package/src/hooks/index.ts +0 -147
  35. package/src/hooks/isTokenExpired/index.js +0 -17
  36. package/src/hooks/newMessageSubscription/index.js +0 -28
  37. package/src/hooks/newStoreOrderSubscription/index.js +0 -26
  38. package/src/hooks/statusOpenStores/helpers/index.js +0 -101
  39. package/src/hooks/statusOpenStores/index.js +0 -156
  40. package/src/hooks/updateExtProductFoodsOptional/index.js +0 -40
  41. package/src/hooks/useAcumulateDate/index.js +0 -16
  42. package/src/hooks/useAllStoresPendingToRegister/index.js +0 -34
  43. package/src/hooks/useAmountInput/index.ts +0 -117
  44. package/src/hooks/useAnimationFrame/index.js +0 -45
  45. package/src/hooks/useAnimationText/index.jsx +0 -31
  46. package/src/hooks/useAsideCart/helpers/index.js +0 -22
  47. package/src/hooks/useAsideCart/index.js +0 -214
  48. package/src/hooks/useAsideCart/queries.js +0 -10
  49. package/src/hooks/useBanner/index.js +0 -19
  50. package/src/hooks/useCart/index.js +0 -2
  51. package/src/hooks/useCart/queries.js +0 -174
  52. package/src/hooks/useCart/useCart/helpers/index.js +0 -75
  53. package/src/hooks/useCart/useCart/index.js +0 -412
  54. package/src/hooks/useCart/useGetCart/index.js +0 -33
  55. package/src/hooks/useCatWithProduct/index.js +0 -48
  56. package/src/hooks/useCatWithProduct/queries.js +0 -200
  57. package/src/hooks/useCatWithProductClient/index.js +0 -56
  58. package/src/hooks/useCatWithProductClient/queries.js +0 -56
  59. package/src/hooks/useCategoriesProduct/index.js +0 -13
  60. package/src/hooks/useCategoriesProduct/queries.js +0 -16
  61. package/src/hooks/useCategoryInStore/index.js +0 -100
  62. package/src/hooks/useCategoryInStore/queries.js +0 -78
  63. package/src/hooks/useCategoryStore/index.js +0 -7
  64. package/src/hooks/useCategoryStore/queries.js +0 -16
  65. package/src/hooks/useChartData/index.js +0 -170
  66. package/src/hooks/useChartData/useChartData/index.js +0 -199
  67. package/src/hooks/useChartData/useChartDataAllOrders/index.js +0 -94
  68. package/src/hooks/useChatRoomSubscription/index.js +0 -28
  69. package/src/hooks/useCheckbox/index.js +0 -115
  70. package/src/hooks/useCities/index.js +0 -13
  71. package/src/hooks/useCities/queries.js +0 -12
  72. package/src/hooks/useClients/index.js +0 -96
  73. package/src/hooks/useClients/queries.js +0 -212
  74. package/src/hooks/useColorByLetters/helpers/alea.js +0 -54
  75. package/src/hooks/useColorByLetters/helpers/colors.js +0 -45
  76. package/src/hooks/useColorByLetters/helpers/index.js +0 -18
  77. package/src/hooks/useColorByLetters/helpers/mersenne_twister.js +0 -118
  78. package/src/hooks/useColorByLetters/index.js +0 -27
  79. package/src/hooks/useConnection/index.js +0 -24
  80. package/src/hooks/useCountries/index.js +0 -19
  81. package/src/hooks/useCountries/queries.js +0 -12
  82. package/src/hooks/useCreateDeliveryTime/index.js +0 -51
  83. package/src/hooks/useCreateOrderStatusType/index.ts +0 -132
  84. package/src/hooks/useCreateProduct/helpers/index.js +0 -23
  85. package/src/hooks/useCreateProduct/helpers/manageCacheDataCatProduct/index.js +0 -52
  86. package/src/hooks/useCreateProduct/helpers/useEditImageProduct/index.js +0 -176
  87. package/src/hooks/useCreateProduct/index.js +0 -334
  88. package/src/hooks/useCreateStorePendingToRegister/index.js +0 -13
  89. package/src/hooks/useCreateStorePendingToRegister/queries.js +0 -10
  90. package/src/hooks/useDashboardComponents/index.js +0 -50
  91. package/src/hooks/useDeleteExtraProductFoods/index.js +0 -12
  92. package/src/hooks/useDeleteSubProductOptional/index.js +0 -30
  93. package/src/hooks/useDeleteSubProductOptional/queries.js +0 -10
  94. package/src/hooks/useDeliveryTime/index.js +0 -27
  95. package/src/hooks/useDepartments/index.js +0 -13
  96. package/src/hooks/useDepartments/queries.js +0 -13
  97. package/src/hooks/useDessert/helpers/index.js +0 -51
  98. package/src/hooks/useDessert/index.js +0 -525
  99. package/src/hooks/useDessertWithPrice/helpers/index.js +0 -76
  100. package/src/hooks/useDessertWithPrice/index.js +0 -373
  101. package/src/hooks/useDessertWithPrice/queries.js +0 -18
  102. package/src/hooks/useDevWS/index.ts +0 -53
  103. package/src/hooks/useDevices/index.js +0 -2
  104. package/src/hooks/useDevices/queries.js +0 -28
  105. package/src/hooks/useDevices/useGetDevices.js +0 -28
  106. package/src/hooks/useDevices/useRegisterDevices.js +0 -75
  107. package/src/hooks/useDownloadReports/helpers/downloadFileFromResponse.ts +0 -21
  108. package/src/hooks/useDownloadReports/index.ts +0 -2
  109. package/src/hooks/useDownloadReports/useDownloadReportByDay/index.ts +0 -103
  110. package/src/hooks/useDownloadReports/useGetReportByDateRange/index.ts +0 -115
  111. package/src/hooks/useDrag/index.js +0 -63
  112. package/src/hooks/useDropzone/index.js +0 -94
  113. package/src/hooks/useDynamicAuth/index.js +0 -13
  114. package/src/hooks/useDynamicAuth/queries.js +0 -24
  115. package/src/hooks/useEditCategory/index.js +0 -41
  116. package/src/hooks/useEditOneExtProductFoodOptional/index.js +0 -28
  117. package/src/hooks/useEditOneExtProductFoodOptional/queries.js +0 -16
  118. package/src/hooks/useEditSubProductOptional/index.js +0 -11
  119. package/src/hooks/useEditSubProductOptional/queries.js +0 -10
  120. package/src/hooks/useEmployee/index.js +0 -17
  121. package/src/hooks/useEmployee/queries.js +0 -85
  122. package/src/hooks/useEmployee/useCreateEmployee.js +0 -86
  123. package/src/hooks/useEvent/index.js +0 -34
  124. package/src/hooks/useFavoriteStores/index.js +0 -29
  125. package/src/hooks/useFavoriteStores/queries.js +0 -54
  126. package/src/hooks/useFetchJson/index.js +0 -25
  127. package/src/hooks/useFetchMoreInteractions/index.jsx +0 -39
  128. package/src/hooks/useFingerprintjs/index.js +0 -172
  129. package/src/hooks/useFormTools/index.js +0 -116
  130. package/src/hooks/useFormatDate/index.js +0 -86
  131. package/src/hooks/useFormatNumberPhone/index.js +0 -23
  132. package/src/hooks/useFullScreenMode/index.js +0 -65
  133. package/src/hooks/useGenerateNumberArray/index.js +0 -17
  134. package/src/hooks/useGetAllLocationUser/index.js +0 -12
  135. package/src/hooks/useGetAllLocationUser/queries.js +0 -44
  136. package/src/hooks/useGetCookies/index.js +0 -43
  137. package/src/hooks/useGetExtProductFoodsSubOptionalAll/index.js +0 -14
  138. package/src/hooks/useGetFoodRecomended/index.js +0 -32
  139. package/src/hooks/useGetFoodRecomended/queries.js +0 -47
  140. package/src/hooks/useGetMessagesToRoom/index.js +0 -23
  141. package/src/hooks/useGetMinPrice/index.js +0 -12
  142. package/src/hooks/useGetMinPrice/queries.js +0 -7
  143. package/src/hooks/useGetOneStoreRating/index.js +0 -40
  144. package/src/hooks/useGetOneStoreRating/queries.js +0 -18
  145. package/src/hooks/useGetSalesAmountToday/index.js +0 -31
  146. package/src/hooks/useGetStoreCookie/index.js +0 -21
  147. package/src/hooks/useGoogleLogin/index.js +0 -160
  148. package/src/hooks/useGoogleLogin/loadScript.js +0 -15
  149. package/src/hooks/useGoogleLogin/removeScript.js +0 -7
  150. package/src/hooks/useHover/index.js +0 -29
  151. package/src/hooks/useImageOptimization/index.js +0 -28
  152. package/src/hooks/useImageUploaderProduct/helper/canvasUtils.ts +0 -130
  153. package/src/hooks/useImageUploaderProduct/helper/getOrientation.ts +0 -53
  154. package/src/hooks/useImageUploaderProduct/helper/index.ts +0 -5
  155. package/src/hooks/useImageUploaderProduct/index.ts +0 -292
  156. package/src/hooks/useImageWeight/index.js +0 -51
  157. package/src/hooks/useImagesStore/index.js +0 -225
  158. package/src/hooks/useImagesStore/queries.js +0 -193
  159. package/src/hooks/useImagesStore/utils/index.js +0 -4
  160. package/src/hooks/useIncomingOrders/index.js +0 -10
  161. package/src/hooks/useIncomingOrders/queries.js +0 -87
  162. package/src/hooks/useInnerHtml/index.js +0 -39
  163. package/src/hooks/useIntersection/index.js +0 -84
  164. package/src/hooks/useInventory/index.js +0 -2
  165. package/src/hooks/useInventory/queries.js +0 -58
  166. package/src/hooks/useInventory/useGetProductsInStock.js +0 -15
  167. package/src/hooks/useInventory/useUpdateManageStock.js +0 -41
  168. package/src/hooks/useKeypress/index.js +0 -28
  169. package/src/hooks/useLazyScript/index.js +0 -71
  170. package/src/hooks/useLocalBackendIp/index.js +0 -34
  171. package/src/hooks/useLocalSorage/index.js +0 -36
  172. package/src/hooks/useLocationManager/index.js +0 -63
  173. package/src/hooks/useLocationNavigate/index.js +0 -54
  174. package/src/hooks/useLoginEmployeeInStore/index.js +0 -38
  175. package/src/hooks/useLogout/helpers/BroadcastChannel.js +0 -31
  176. package/src/hooks/useLogout/helpers/apiBaseUrl.js +0 -8
  177. package/src/hooks/useLogout/helpers/fetchData.js +0 -28
  178. package/src/hooks/useLogout/helpers/getCsrfToken.js +0 -30
  179. package/src/hooks/useLogout/helpers/index.js +0 -57
  180. package/src/hooks/useLogout/helpers/logger.js +0 -70
  181. package/src/hooks/useLogout/helpers/parseUrl.js +0 -36
  182. package/src/hooks/useLogout/index.js +0 -96
  183. package/src/hooks/useManageNewOrder/helpers/index.js +0 -45
  184. package/src/hooks/useManageNewOrder/helpers/mock.js +0 -0
  185. package/src/hooks/useManageNewOrder/index.js +0 -102
  186. package/src/hooks/useManageQueryParams/index.js +0 -40
  187. package/src/hooks/useMobile/index.js +0 -65
  188. package/src/hooks/useModules/helpers/index.js +0 -1
  189. package/src/hooks/useModules/helpers/validateModules.js +0 -29
  190. package/src/hooks/useModules/index.js +0 -58
  191. package/src/hooks/useMouse/index.ts +0 -50
  192. package/src/hooks/useMutateHeight/index.js +0 -36
  193. package/src/hooks/useOrderClient/index.js +0 -5
  194. package/src/hooks/useOrderStatusTypes/index.ts +0 -2
  195. package/src/hooks/useOrderStatusTypes/useOrderStatusTypes/index.ts +0 -133
  196. package/src/hooks/useOrderStatusTypes/useUpdateOrderStatusPriorities/index.ts +0 -97
  197. package/src/hooks/useOrders/index.js +0 -3
  198. package/src/hooks/useOrders/queries.js +0 -89
  199. package/src/hooks/useOrders/useChangeOrderState/index.ts +0 -125
  200. package/src/hooks/useOrders/useOrdersFromStore/index.ts +0 -77
  201. package/src/hooks/usePWAInstall/index.js +0 -38
  202. package/src/hooks/usePortFetcher/index.ts +0 -33
  203. package/src/hooks/usePrintSaleTicket/index.ts +0 -64
  204. package/src/hooks/useProductsFood/index.js +0 -253
  205. package/src/hooks/useProductsFood/queriesStore.js +0 -964
  206. package/src/hooks/useProductsFood/useEditProduct.js +0 -48
  207. package/src/hooks/useProductsFood/usetagsProducts.js +0 -98
  208. package/src/hooks/useProviders/index.js +0 -3
  209. package/src/hooks/useProviders/queries.js +0 -31
  210. package/src/hooks/useProviders/useProvidersCreateStore/index.js +0 -12
  211. package/src/hooks/useProviders/useProvidersDataStore/index.js +0 -24
  212. package/src/hooks/useProvidersStore/index.js +0 -24
  213. package/src/hooks/useProvidersStore/queries.js +0 -31
  214. package/src/hooks/usePushNotificationOrder/index.js +0 -52
  215. package/src/hooks/usePushNotifications/helpers/index.js +0 -114
  216. package/src/hooks/usePushNotifications/index.js +0 -149
  217. package/src/hooks/useQueryLocationsMap/index.js +0 -19
  218. package/src/hooks/useQueryLocationsMap/queries.js +0 -40
  219. package/src/hooks/useRatingArrayData/index.js +0 -54
  220. package/src/hooks/useRatingArrayData/queries.js +0 -19
  221. package/src/hooks/useReactToPrint/index.js +0 -1223
  222. package/src/hooks/useRemoveExtraProductFoodsOptional/index.js +0 -23
  223. package/src/hooks/useRemoveExtraProductFoodsOptional/queries.js +0 -48
  224. package/src/hooks/useReport/index.js +0 -47
  225. package/src/hooks/useReport/queries.js +0 -123
  226. package/src/hooks/useRestaurant/helpers/index.js +0 -24
  227. package/src/hooks/useRestaurant/helpers/manageStatusOpen.js +0 -26
  228. package/src/hooks/useRestaurant/index.js +0 -69
  229. package/src/hooks/useRestaurant/queries.js +0 -81
  230. package/src/hooks/useRoads/index.js +0 -19
  231. package/src/hooks/useRoads/queries.js +0 -13
  232. package/src/hooks/useRoles/index.js +0 -4
  233. package/src/hooks/useRoles/queries.js +0 -70
  234. package/src/hooks/useRoles/useCreateRole.js +0 -37
  235. package/src/hooks/useRoles/useGetRoles.js +0 -36
  236. package/src/hooks/useRoles/useRemoveRoles.js +0 -40
  237. package/src/hooks/useRoles/useUpdateRolesPriority.js +0 -44
  238. package/src/hooks/useSales/helpers/index.js +0 -55
  239. package/src/hooks/useSales/index.js +0 -1381
  240. package/src/hooks/useSales/queries.js +0 -424
  241. package/src/hooks/useSales/useGetAllSales/index.js +0 -25
  242. package/src/hooks/useSales/useGetSale.js +0 -13
  243. package/src/hooks/useSales/useTotalSales.js +0 -23
  244. package/src/hooks/useSaveAvailableProduct/helpers/index.js +0 -38
  245. package/src/hooks/useSaveAvailableProduct/index.js +0 -31
  246. package/src/hooks/useSaveAvailableProduct/queries.js +0 -10
  247. package/src/hooks/useSaveLocation/index.js +0 -16
  248. package/src/hooks/useSaveLocation/queries.js +0 -19
  249. package/src/hooks/useSchedule/index.js +0 -78
  250. package/src/hooks/useSchedule/index.jsx +0 -22
  251. package/src/hooks/useSchedule/queries.js +0 -43
  252. package/src/hooks/useScheduleData/index.js +0 -123
  253. package/src/hooks/useScroll/index.js +0 -56
  254. package/src/hooks/useScrollRotate/index.js +0 -16
  255. package/src/hooks/useSetImageProducts/index.js +0 -57
  256. package/src/hooks/useSetImageProducts/queries.js +0 -18
  257. package/src/hooks/useSetSession/index.js +0 -44
  258. package/src/hooks/useSetState/index.js +0 -24
  259. package/src/hooks/useSetupSchedule/helpers/index.js +0 -85
  260. package/src/hooks/useSetupSchedule/index.js +0 -272
  261. package/src/hooks/useStatusOpenStore/helpers/index.js +0 -101
  262. package/src/hooks/useStatusOpenStore/index.js +0 -179
  263. package/src/hooks/useStatusOrdersClient/helpers/index.js +0 -14
  264. package/src/hooks/useStatusOrdersClient/index.js +0 -17
  265. package/src/hooks/useStatusOrdersClient/queries.js +0 -80
  266. package/src/hooks/useStockMovements/helpers/index.js +0 -16
  267. package/src/hooks/useStockMovements/index.js +0 -38
  268. package/src/hooks/useStore/index.js +0 -80
  269. package/src/hooks/useStore/queries.js +0 -163
  270. package/src/hooks/useStoreCalendar/index.js +0 -5
  271. package/src/hooks/useStoreContacts/index.js +0 -47
  272. package/src/hooks/useStoreContacts/queries.js +0 -48
  273. package/src/hooks/useStoreTable/index.js +0 -2
  274. package/src/hooks/useStoreTable/queries.js +0 -47
  275. package/src/hooks/useStoreTable/useStoreTableCreate.js +0 -76
  276. package/src/hooks/useStoreTable/useStoreTables.js +0 -14
  277. package/src/hooks/useSubscriptionValidation/index.js +0 -41
  278. package/src/hooks/useTagProducts/index.ts +0 -3
  279. package/src/hooks/useTagProducts/useDeleteOneTag.ts +0 -106
  280. package/src/hooks/useTagProducts/useGetAllTags.ts +0 -68
  281. package/src/hooks/useTagProducts/useRegisterMultipleTags.ts +0 -156
  282. package/src/hooks/useTimeAgo/useTimeAgo.js +0 -39
  283. package/src/hooks/useTokenCards/index.js +0 -41
  284. package/src/hooks/useTopProductsMovements/index.js +0 -27
  285. package/src/hooks/useTotalAllSales/index.js +0 -25
  286. package/src/hooks/useTotalProductsInStock/index.js +0 -23
  287. package/src/hooks/useTotalProductsSold/index.js +0 -23
  288. package/src/hooks/useTotalProductsSolded/index.js +0 -20
  289. package/src/hooks/useUpdateCart/index.js +0 -130
  290. package/src/hooks/useUpdateCartCookie/index.js +0 -43
  291. package/src/hooks/useUpdateDashboardComponent/index.ts +0 -91
  292. package/src/hooks/useUpdateExistingOrders/index.js +0 -85
  293. package/src/hooks/useUpdateExtProductFoodsSubOptional/index.js +0 -60
  294. package/src/hooks/useUpdateModuleOrder/index.js +0 -37
  295. package/src/hooks/useUpdateMultipleExtProduct/index.js +0 -33
  296. package/src/hooks/useUpdateMultipleExtProduct/queries.js +0 -33
  297. package/src/hooks/useUpdateMultipleProducts/index.js +0 -80
  298. package/src/hooks/useUpdateMultipleProducts/queries.js +0 -51
  299. package/src/hooks/useUploadProducts/helpers/index.js +0 -1
  300. package/src/hooks/useUploadProducts/helpers/parseNumber.js +0 -37
  301. package/src/hooks/useUploadProducts/helpers/validateProductDataExcel.js +0 -73
  302. package/src/hooks/useUploadProducts/index.js +0 -422
  303. package/src/hooks/useUpsertGoal/index.js +0 -68
  304. package/src/hooks/useUser/index.js +0 -23
  305. package/src/hooks/useUser/queries.js +0 -131
  306. package/src/hooks/useWeeklyStockMovement/helpers/index.js +0 -32
  307. package/src/hooks/useWeeklyStockMovement/index.js +0 -51
  308. package/src/hooks/useWindowSize/index.js +0 -38
  309. package/src/index.jsx +0 -9
  310. package/src/mock/dessert/index.js +0 -16
  311. package/src/mock/index.js +0 -1
  312. package/src/security/index.js +0 -1
  313. package/src/services/index.js +0 -0
  314. package/src/utils/UtilDateRange.js +0 -31
  315. package/src/utils/index.js +0 -306
  316. package/tsconfig.json +0 -5
@@ -1,14 +0,0 @@
1
- import { GET_EXTRAS_PRODUCT_FOOD_OPTIONAL } from '../useProductsFood/queriesStore'
2
- import { useLazyQuery } from '@apollo/client'
3
-
4
- export const useGetExtProductFoodsSubOptionalAll = ({ setDataOptional = () => { } } = {}) => {
5
- const [ExtProductFoodsSubOptionalAll] = useLazyQuery(
6
- GET_EXTRAS_PRODUCT_FOOD_OPTIONAL,
7
- {
8
- onError: () => {
9
- setDataOptional([])
10
- }
11
- }
12
- )
13
- return [ExtProductFoodsSubOptionalAll]
14
- }
@@ -1,32 +0,0 @@
1
- import { useQuery } from '@apollo/client'
2
- import { GET_ALL_PRODUCT_STORE_RECOMENDED } from './queries'
3
-
4
- export const useGetFoodRecomended = ({
5
- name = ''
6
- }) => {
7
- const {
8
- data,
9
- called,
10
- fetchMore,
11
- loading,
12
- error
13
- } = useQuery(GET_ALL_PRODUCT_STORE_RECOMENDED, {
14
- fetchPolicy: 'cache-and-network',
15
- skip: !name,
16
- notifyOnNetworkStatusChange: true,
17
- nextFetchPolicy: 'cache-first',
18
- refetchWritePolicy: 'merge',
19
- variables:
20
- {
21
- max: 6,
22
- search: name
23
- }
24
- })
25
-
26
- return [data?.productFoodsAllRecommended, {
27
- called,
28
- fetchMore,
29
- loading,
30
- error
31
- }]
32
- }
@@ -1,47 +0,0 @@
1
- import { gql } from '@apollo/client'
2
-
3
- export const GET_ALL_PRODUCT_STORE_RECOMENDED = gql`
4
- query productFoodsAllRecommended($search: String, $min: Int, $max: Int, $gender: [String], $desc: [String], $categories: [ID], ) {
5
- productFoodsAllRecommended(search: $search, min: $min, max: $max, gender: $gender, desc: $desc, categories: $categories,) {
6
- pId
7
- sizeId #Talla
8
- colorId #Color
9
- cId #Country
10
- dId #Department
11
- ctId #Cuidad
12
- fId #Características
13
- pName
14
- ProPrice
15
- ProDescuento
16
- ProUniDisponibles
17
- ProDescription
18
- ProProtegido
19
- ProAssurance
20
- ProStar
21
- sTateLogistic
22
- ProImage
23
- ProWidth
24
- ProHeight
25
- ProLength
26
- ProWeight
27
- ProQuantity
28
- ProOutstanding
29
- pDatCre
30
- pDatMod
31
- ProDelivery
32
- ProVoltaje
33
- pState
34
- feat {
35
- fId
36
- thpId
37
- hpqrQuestion
38
- }
39
- area {
40
- aId
41
- aName
42
- }
43
-
44
- }
45
- }
46
-
47
- `
@@ -1,23 +0,0 @@
1
- import { useQuery, gql } from '@apollo/client'
2
-
3
- // Define la consulta GraphQL
4
- const GET_MESSAGES = gql`
5
- query getMessages($codeRoom: String!, $id: String!) {
6
- getMessages(codeRoom: $codeRoom, id: $id) {
7
- uuid
8
- content
9
- from
10
- to
11
- aDatCre
12
- }
13
- }
14
- `
15
-
16
- export const useGetMessagesToRoom = (codeRoom, id) => {
17
- const { loading, error, data } = useQuery(GET_MESSAGES, {
18
- context: { clientName: 'web-socket-chat' },
19
- variables: { codeRoom, id }
20
- })
21
-
22
- return [data?.getMessages ?? [], { loading, error }]
23
- }
@@ -1,12 +0,0 @@
1
- import { useQuery } from '@apollo/client'
2
- import { GET_MIN_PEDIDO } from './queries'
3
-
4
- export const useGetMinPrice = ({ idStore = '' } = {}) => {
5
- const { data, loading, error } = useQuery(GET_MIN_PEDIDO, {
6
- variables: {
7
- idStore
8
- }
9
- })
10
-
11
- return [data, { loading, error }]
12
- }
@@ -1,7 +0,0 @@
1
- import { gql } from '@apollo/client'
2
-
3
- export const GET_MIN_PEDIDO = gql`
4
- query getMinPrice($idStore: ID){
5
- getMinPrice(idStore: $idStore)
6
- }
7
- `
@@ -1,40 +0,0 @@
1
- import { useState } from 'react'
2
- import { useLazyQuery } from '@apollo/client'
3
- import { GET_ONE_RATING_STORE } from './queries'
4
-
5
- export const useGetOneStoreRating = () => {
6
- const [ratings, setRatings] = useState({
7
- rGoodTemperature: 0,
8
- rGoodCondition: 0,
9
- rTasty: 0,
10
- appearance: 0
11
- })
12
-
13
- const [getOneRating] = useLazyQuery(GET_ONE_RATING_STORE, {
14
- onCompleted: res => {
15
- if (res) {
16
- setRatings((prevState) => {
17
- const {
18
- rGoodTemperature,
19
- rGoodCondition,
20
- rTasty,
21
- rAppearance
22
- } = res.getOneRating || {}
23
- return {
24
- ...prevState,
25
- rGoodTemperature: rGoodTemperature || 0,
26
- rGoodCondition: rGoodCondition || 0,
27
- rTasty: rTasty || 0,
28
- appearance: rAppearance || 0
29
- }
30
- })
31
- }
32
- }
33
- })
34
-
35
- return {
36
- ratings,
37
- setRatings,
38
- getOneRating
39
- }
40
- }
@@ -1,18 +0,0 @@
1
- import { gql } from '@apollo/client'
2
-
3
- export const GET_ONE_RATING_STORE = gql`
4
- query getOneRating($idStore: ID){
5
- getOneRating(idStore: $idStore){
6
- idStore
7
- rId
8
- id
9
- rAppearance
10
- rTasty
11
- rGoodTemperature
12
- rGoodCondition
13
- rState
14
- createAt
15
- updateAt
16
- }
17
- }
18
- `
@@ -1,31 +0,0 @@
1
- import { gql, useQuery } from '@apollo/client'
2
-
3
- /**
4
- * GraphQL query to get today's total sales amount.
5
- */
6
- const GET_SALES_AMOUNT_TODAY = gql`
7
- query GetSalesAmountToday {
8
- getSalesAmountToday {
9
- success
10
- message
11
- total
12
- }
13
- }
14
- `
15
-
16
- /**
17
- * Custom hook to fetch today's sales amount.
18
- * @returns {{
19
- * data: { success: boolean, message: string, total: number } | undefined,
20
- * loading: boolean,
21
- * error: any,
22
- * refetch: () => void
23
- * }}
24
- */
25
- export const useGetSalesAmountToday = () => {
26
- const { data, loading, error, refetch } = useQuery(GET_SALES_AMOUNT_TODAY, {
27
- fetchPolicy: 'network-only'
28
- })
29
-
30
- return [data?.getSalesAmountToday, { loading, error, refetch }]
31
- }
@@ -1,21 +0,0 @@
1
- import { useState, useEffect } from 'react'
2
- import Cookies from 'js-cookie'
3
-
4
- export const useGetStoreCookie = () => {
5
- const [vpStoreCookie, setVpStoreCookie] = useState(null)
6
-
7
- useEffect(() => {
8
- const getCookieValue = () => {
9
- const cookieValue = Cookies.get(process.env.NEXT_PUBLIC_SESSION_NAME)
10
- console.log('Cookie Value:', cookieValue)
11
-
12
- if (cookieValue) {
13
- setVpStoreCookie(cookieValue)
14
- }
15
- }
16
-
17
- getCookieValue()
18
- }, []) // Empty dependency array, so this effect runs once
19
-
20
- return vpStoreCookie
21
- }
@@ -1,160 +0,0 @@
1
- import { useState, useEffect } from 'react'
2
- import loadScript from './loadScript'
3
- import removeScript from './removeScript'
4
-
5
- export const useGoogleLogin = ({
6
- onSuccess = () => {},
7
- onAutoLoadFinished = () => {},
8
- onFailure = () => {},
9
- onRequest = () => {},
10
- onScriptLoadFailure,
11
- clientId,
12
- cookiePolicy,
13
- loginHint,
14
- hostedDomain,
15
- autoLoad,
16
- isSignedIn,
17
- fetchBasicProfile,
18
- redirectUri,
19
- discoveryDocs,
20
- uxMode,
21
- scope,
22
- accessType,
23
- responseType,
24
- jsSrc = 'https://apis.google.com/js/api.js',
25
- prompt
26
- }) => {
27
- const [loaded, setLoaded] = useState(false)
28
-
29
- function handleSigninSuccess (res) {
30
- /*
31
- offer renamed response keys to names that match use
32
- */
33
- const basicProfile = res.getBasicProfile()
34
- const authResponse = res.getAuthResponse(true)
35
- res.googleId = basicProfile.getId()
36
- res.tokenObj = authResponse
37
- res.tokenId = authResponse.id_token
38
- res.accessToken = authResponse.access_token
39
- res.profileObj = {
40
- googleId: basicProfile.getId(),
41
- imageUrl: basicProfile.getImageUrl(),
42
- email: basicProfile.getEmail(),
43
- name: basicProfile.getName(),
44
- givenName: basicProfile.getGivenName(),
45
- familyName: basicProfile.getFamilyName()
46
- }
47
- onSuccess(res)
48
- }
49
-
50
- function signIn (e) {
51
- if (e) {
52
- e.preventDefault() // to prevent submit if used within form
53
- }
54
- if (loaded) {
55
- const GoogleAuth = window.gapi.auth2.getAuthInstance()
56
- const options = {
57
- prompt
58
- }
59
- onRequest()
60
- if (responseType === 'code') {
61
- GoogleAuth.grantOfflineAccess(options).then(
62
- res => onSuccess(res),
63
- err => onFailure(err)
64
- )
65
- } else {
66
- GoogleAuth.signIn(options).then(
67
- res => handleSigninSuccess(res),
68
- err => onFailure(err)
69
- )
70
- }
71
- }
72
- }
73
-
74
- useEffect(() => {
75
- let unmounted = false
76
- const onLoadFailure = onScriptLoadFailure || onFailure
77
- loadScript(
78
- document,
79
- 'script',
80
- 'google-login',
81
- jsSrc,
82
- () => {
83
- const params = {
84
- client_id: clientId,
85
- cookie_policy: cookiePolicy,
86
- login_hint: loginHint,
87
- hosted_domain: hostedDomain,
88
- fetch_basic_profile: fetchBasicProfile,
89
- discoveryDocs,
90
- ux_mode: uxMode,
91
- redirect_uri: redirectUri,
92
- scope,
93
- access_type: accessType
94
- }
95
-
96
- if (responseType === 'code') {
97
- params.access_type = 'offline'
98
- }
99
-
100
- window.gapi.load('auth2', () => {
101
- const GoogleAuth = window.gapi.auth2.getAuthInstance()
102
- if (!GoogleAuth) {
103
- window.gapi.auth2.init(params).then(
104
- res => {
105
- if (!unmounted) {
106
- setLoaded(true)
107
- const signedIn = isSignedIn && res.isSignedIn.get()
108
- onAutoLoadFinished(signedIn)
109
- if (signedIn) {
110
- handleSigninSuccess(res.currentUser.get())
111
- }
112
- }
113
- },
114
- err => {
115
- setLoaded(true)
116
- onAutoLoadFinished(false)
117
- onLoadFailure(err)
118
- }
119
- )
120
- } else {
121
- GoogleAuth.then(
122
- () => {
123
- if (unmounted) {
124
- return
125
- }
126
- if (isSignedIn && GoogleAuth.isSignedIn.get()) {
127
- setLoaded(true)
128
- onAutoLoadFinished(true)
129
- handleSigninSuccess(GoogleAuth.currentUser.get())
130
- } else {
131
- setLoaded(true)
132
- onAutoLoadFinished(false)
133
- }
134
- },
135
- err => {
136
- onFailure(err)
137
- }
138
- )
139
- }
140
- })
141
- },
142
- err => {
143
- onLoadFailure(err)
144
- }
145
- )
146
-
147
- return () => {
148
- unmounted = true
149
- removeScript(document, 'google-login')
150
- }
151
- }, [])
152
-
153
- useEffect(() => {
154
- if (autoLoad) {
155
- signIn()
156
- }
157
- }, [loaded])
158
-
159
- return { signIn, loaded }
160
- }
@@ -1,15 +0,0 @@
1
- export default (d, s, id, jsSrc, cb, onError) => {
2
- const element = d.getElementsByTagName(s)[0]
3
- const fjs = element
4
- let js = element
5
- js = d.createElement(s)
6
- js.id = id
7
- js.src = jsSrc
8
- if (fjs && fjs.parentNode) {
9
- fjs.parentNode.insertBefore(js, fjs)
10
- } else {
11
- d.head.appendChild(js)
12
- }
13
- js.onerror = onError
14
- js.onload = cb
15
- }
@@ -1,7 +0,0 @@
1
- export default (d, id) => {
2
- const element = d.getElementById(id)
3
-
4
- if (element) {
5
- element.parentNode.removeChild(element)
6
- }
7
- }
@@ -1,29 +0,0 @@
1
- import { useRef, useState, useEffect } from 'react'
2
-
3
- export function useHover () {
4
- const [value, setValue] = useState(false)
5
-
6
- const ref = useRef(null)
7
-
8
- const handleMouseOver = () => { return setValue(true) }
9
- const handleMouseOut = () => { return setValue(false) }
10
-
11
- useEffect(
12
- () => {
13
- const node = ref.current
14
- if (node) {
15
- node.addEventListener('mouseover', handleMouseOver)
16
- node.addEventListener('mouseout', handleMouseOut)
17
-
18
- return () => {
19
- node.removeEventListener('mouseover', handleMouseOver)
20
- node.removeEventListener('mouseout', handleMouseOut)
21
- }
22
- }
23
- return {}
24
- },
25
- [] // Recall only if ref changes
26
- )
27
-
28
- return [ref, value]
29
- }
@@ -1,28 +0,0 @@
1
- import { useEffect, useState } from 'react'
2
- // use it
3
- // const imageUrl = 'https://example.com/image.jpg';
4
- // const optimizedUrl = useImageOptimization(imageUrl);
5
-
6
- export function useImageOptimization (imageUrl) {
7
- const [optimizedUrl, setOptimizedUrl] = useState(null)
8
-
9
- useEffect(() => {
10
- const image = new Image()
11
- image.src = imageUrl
12
-
13
- image.onload = () => {
14
- const canvas = document.createElement('canvas')
15
- const ctx = canvas.getContext('2d')
16
-
17
- canvas.width = image.width
18
- canvas.height = image.height
19
-
20
- ctx.drawImage(image, 0, 0, image.width, image.height)
21
-
22
- const optimizedUrl = canvas.toDataURL('image/jpeg', 0.8)
23
- setOptimizedUrl(optimizedUrl)
24
- }
25
- }, [imageUrl])
26
-
27
- return optimizedUrl
28
- }
@@ -1,130 +0,0 @@
1
- export const createImage = (url) =>
2
- new Promise((resolve, reject) => {
3
- const image = new Image()
4
- image.addEventListener('load', () => resolve(image))
5
- image.addEventListener('error', (error) => reject(error))
6
- image.setAttribute('crossOrigin', 'anonymous') // needed to avoid cross-origin issues on CodeSandbox
7
- image.src = url
8
- })
9
-
10
- export function getRadianAngle(degreeValue) {
11
- return (degreeValue * Math.PI) / 180
12
- }
13
-
14
- /**
15
- * Returns the new bounding area of a rotated rectangle.
16
- */
17
- export function rotateSize(width, height, rotation) {
18
- const rotRad = getRadianAngle(rotation)
19
-
20
- return {
21
- width:
22
- Math.abs(Math.cos(rotRad) * width) + Math.abs(Math.sin(rotRad) * height),
23
- height:
24
- Math.abs(Math.sin(rotRad) * width) + Math.abs(Math.cos(rotRad) * height),
25
- }
26
- }
27
-
28
- /**
29
- * This function was adapted from the one in the ReadMe of https://github.com/DominicTobias/react-image-crop
30
- */
31
- /**
32
- * This function was adapted from the one in the ReadMe of https://github.com/DominicTobias/react-image-crop
33
- */
34
- export async function getCroppedImg(
35
- imageSrc,
36
- pixelCrop,
37
- rotation = 0,
38
- flip = { horizontal: false, vertical: false }
39
- ) {
40
- const image = await createImage(imageSrc)
41
- const canvas = document.createElement('canvas')
42
- const ctx = canvas.getContext('2d')
43
-
44
- if (!ctx) {
45
- return null
46
- }
47
-
48
- const rotRad = getRadianAngle(rotation)
49
-
50
- // calculate bounding box of the rotated image
51
- const { width: bBoxWidth, height: bBoxHeight } = rotateSize(
52
- image.width,
53
- image.height,
54
- rotation
55
- )
56
-
57
- // set canvas size to match the bounding box
58
- canvas.width = bBoxWidth
59
- canvas.height = bBoxHeight
60
-
61
- // translate canvas context to a central location to allow rotating and flipping around the center
62
- ctx.translate(bBoxWidth / 2, bBoxHeight / 2)
63
- ctx.rotate(rotRad)
64
- ctx.scale(flip.horizontal ? -1 : 1, flip.vertical ? -1 : 1)
65
- ctx.translate(-image.width / 2, -image.height / 2)
66
-
67
- // draw rotated image
68
- ctx.drawImage(image, 0, 0)
69
-
70
- const croppedCanvas = document.createElement('canvas')
71
-
72
- const croppedCtx = croppedCanvas.getContext('2d')
73
-
74
- if (!croppedCtx) {
75
- return null
76
- }
77
-
78
- // Set the size of the cropped canvas
79
- croppedCanvas.width = pixelCrop.width
80
- croppedCanvas.height = pixelCrop.height
81
-
82
- // Draw the cropped image onto the new canvas
83
- croppedCtx.drawImage(
84
- canvas,
85
- pixelCrop.x,
86
- pixelCrop.y,
87
- pixelCrop.width,
88
- pixelCrop.height,
89
- 0,
90
- 0,
91
- pixelCrop.width,
92
- pixelCrop.height
93
- )
94
-
95
- // As Base64 string
96
- // return croppedCanvas.toDataURL('image/jpeg');
97
-
98
- // As a blob
99
- return new Promise((resolve, reject) => {
100
- croppedCanvas.toBlob((file) => {
101
- resolve(URL.createObjectURL(file))
102
- }, 'image/png')
103
- })
104
- }
105
-
106
- export async function getRotatedImage(imageSrc, rotation = 0) {
107
- const image = await createImage(imageSrc)
108
- const canvas = document.createElement('canvas')
109
- const ctx = canvas.getContext('2d')
110
-
111
- const orientationChanged =
112
- rotation === 90 || rotation === -90 || rotation === 270 || rotation === -270
113
- if (orientationChanged) {
114
- canvas.width = image.height
115
- canvas.height = image.width
116
- } else {
117
- canvas.width = image.width
118
- canvas.height = image.height
119
- }
120
-
121
- ctx.translate(canvas.width / 2, canvas.height / 2)
122
- ctx.rotate((rotation * Math.PI) / 180)
123
- ctx.drawImage(image, -image.width / 2, -image.height / 2)
124
-
125
- return new Promise((resolve) => {
126
- canvas.toBlob((file) => {
127
- resolve(URL.createObjectURL(file))
128
- }, 'image/png')
129
- })
130
- }
@@ -1,53 +0,0 @@
1
- /**
2
- * Reads EXIF orientation from a JPEG file (native, no dependencies)
3
- * @param {File} file
4
- * @returns {Promise<number>} Orientation value from 1 to 8
5
- */
6
- export const getOrientation = (file: File, validTypes: string[]): Promise<number> => {
7
- return new Promise((resolve, reject) => {
8
- const reader = new FileReader()
9
- reader.onload = (event) => {
10
- const view = new DataView(event.target?.result as ArrayBuffer)
11
-
12
- if (!validTypes.includes(file.type)) {
13
- return reject(new Error(`Archivo no soportado: ${file.type}`))
14
- }
15
-
16
- let offset = 2
17
- const length = view.byteLength
18
-
19
- while (offset < length) {
20
- if (view.getUint16(offset + 2, false) <= 8) return resolve(1)
21
-
22
- const marker = view.getUint16(offset, false)
23
- offset += 2
24
-
25
- if (marker === 0xFFE1) {
26
- const little = view.getUint16(offset + 8, false) === 0x4949
27
- offset += 10
28
-
29
- const tags = view.getUint16(offset, little)
30
- offset += 2
31
-
32
- for (let i = 0; i < tags; i++) {
33
- const tagOffset = offset + i * 12
34
- const tag = view.getUint16(tagOffset, little)
35
- if (tag === 0x0112) {
36
- const orientation = view.getUint16(tagOffset + 8, little)
37
- return resolve(orientation)
38
- }
39
- }
40
- } else if ((marker & 0xFF00) !== 0xFF00) {
41
- break
42
- } else {
43
- offset += view.getUint16(offset, false)
44
- }
45
- }
46
-
47
- resolve(1) // por defecto
48
- }
49
-
50
- reader.onerror = () => reject(new Error('Error leyendo archivo'))
51
- reader.readAsArrayBuffer(file)
52
- })
53
- }
@@ -1,5 +0,0 @@
1
- export const ORIENTATION_TO_ANGLE = {
2
- 3: 180,
3
- 6: 90,
4
- 8: -90
5
- }