@timardex/cluemart-shared 2.3.20 → 2.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/dist/{ad-8hhGHx6J.d.mts → ad-BSyVGv8q.d.mts} +16 -23
  2. package/dist/{ad-6lcjOj3X.d.ts → ad-DRI2CIzV.d.ts} +16 -23
  3. package/dist/{chunk-ZZXSAQM6.mjs → chunk-2RHUGVV3.mjs} +114 -122
  4. package/dist/chunk-2RHUGVV3.mjs.map +1 -0
  5. package/dist/{chunk-HKTBJOB7.mjs → chunk-J72IMZ6E.mjs} +13 -1
  6. package/dist/chunk-J72IMZ6E.mjs.map +1 -0
  7. package/dist/{chunk-PBW5K54C.mjs → chunk-LEAXY4DI.mjs} +2 -2
  8. package/dist/{chunk-KMS64DE2.mjs → chunk-LHKJJ7SO.mjs} +2 -2
  9. package/dist/{chunk-5AAYX364.mjs → chunk-WWAHS5R2.mjs} +1 -10
  10. package/dist/chunk-WWAHS5R2.mjs.map +1 -0
  11. package/dist/{chunk-DV3K3JDE.mjs → chunk-ZECVZFK3.mjs} +7 -6
  12. package/dist/chunk-ZECVZFK3.mjs.map +1 -0
  13. package/dist/formFields/index.cjs.map +1 -1
  14. package/dist/formFields/index.mjs +4 -4
  15. package/dist/graphql/index.cjs +122 -129
  16. package/dist/graphql/index.cjs.map +1 -1
  17. package/dist/graphql/index.d.mts +21 -4
  18. package/dist/graphql/index.d.ts +21 -4
  19. package/dist/graphql/index.mjs +7 -5
  20. package/dist/hooks/index.cjs +25 -51
  21. package/dist/hooks/index.cjs.map +1 -1
  22. package/dist/hooks/index.d.mts +1 -1
  23. package/dist/hooks/index.d.ts +1 -1
  24. package/dist/hooks/index.mjs +6 -6
  25. package/dist/index.cjs +141 -142
  26. package/dist/index.cjs.map +1 -1
  27. package/dist/index.d.mts +50 -25
  28. package/dist/index.d.ts +50 -25
  29. package/dist/index.mjs +122 -127
  30. package/dist/index.mjs.map +1 -1
  31. package/dist/sharing/index.cjs.map +1 -1
  32. package/dist/sharing/index.mjs +2 -2
  33. package/dist/types/index.cjs +0 -10
  34. package/dist/types/index.cjs.map +1 -1
  35. package/dist/types/index.d.mts +1 -1
  36. package/dist/types/index.d.ts +1 -1
  37. package/dist/types/index.mjs +1 -3
  38. package/dist/utils/index.cjs +19 -3
  39. package/dist/utils/index.cjs.map +1 -1
  40. package/dist/utils/index.d.mts +16 -1
  41. package/dist/utils/index.d.ts +16 -1
  42. package/dist/utils/index.mjs +11 -3
  43. package/package.json +1 -1
  44. package/dist/chunk-5AAYX364.mjs.map +0 -1
  45. package/dist/chunk-DV3K3JDE.mjs.map +0 -1
  46. package/dist/chunk-HKTBJOB7.mjs.map +0 -1
  47. package/dist/chunk-ZZXSAQM6.mjs.map +0 -1
  48. /package/dist/{chunk-PBW5K54C.mjs.map → chunk-LEAXY4DI.mjs.map} +0 -0
  49. /package/dist/{chunk-KMS64DE2.mjs.map → chunk-LHKJJ7SO.mjs.map} +0 -0
@@ -50,6 +50,7 @@ __export(utils_exports, {
50
50
  IOS_URL: () => IOS_URL,
51
51
  MANUAL_DATE_STATUSES: () => MANUAL_DATE_STATUSES,
52
52
  NETWORK_USER_FACING_ERROR: () => NETWORK_USER_FACING_ERROR,
53
+ NZ_TZ: () => NZ_TZ,
53
54
  PRESERVED_RELATION_DATE_STATUSES: () => PRESERVED_RELATION_DATE_STATUSES,
54
55
  PostTypeLabels: () => PostTypeLabels,
55
56
  SCHOOL_MAX_STUDENT_COUNT: () => SCHOOL_MAX_STUDENT_COUNT,
@@ -123,7 +124,9 @@ __export(utils_exports, {
123
124
  isIsoDateString: () => isIsoDateString,
124
125
  isResourceImageActive: () => isResourceImageActive,
125
126
  isTransientNetworkError: () => isTransientNetworkError,
127
+ isUtcMidnight: () => isUtcMidnight,
126
128
  isValidIrdNumber: () => isValidIrdNumber,
129
+ isoDateFormat: () => isoDateFormat,
127
130
  licenseNiceNames: () => licenseNiceNames,
128
131
  mapArrayToOptions: () => mapArrayToOptions,
129
132
  matchesCategory: () => matchesCategory,
@@ -131,6 +134,7 @@ __export(utils_exports, {
131
134
  normalizeIrdNumber: () => normalizeIrdNumber,
132
135
  normalizeResourceImage: () => normalizeResourceImage,
133
136
  normalizeUrl: () => normalizeUrl,
137
+ nzDayKey: () => nzDayKey,
134
138
  nzStartOfDay: () => nzStartOfDay,
135
139
  paymentMethodOptions: () => paymentMethodOptions,
136
140
  relationHasSelectedDate: () => relationHasSelectedDate,
@@ -309,6 +313,7 @@ var EnumRegions = /* @__PURE__ */ ((EnumRegions2) => {
309
313
  // src/utils/dateFormats.ts
310
314
  var dateFormat = "DD-MM-YYYY";
311
315
  var timeFormat = "HH:mm";
316
+ var isoDateFormat = "YYYY-MM-DD";
312
317
 
313
318
  // src/utils/eventDateStatus.ts
314
319
  var import_dayjs = __toESM(require("dayjs"));
@@ -456,6 +461,13 @@ function nzStartOfDay(input) {
456
461
  }
457
462
  return import_dayjs2.default.tz(input, NZ_TZ).startOf("day");
458
463
  }
464
+ function nzDayKey(input) {
465
+ const day = input == null ? (0, import_dayjs2.default)().tz(NZ_TZ).format(isoDateFormat) : import_dayjs2.default.tz(input, NZ_TZ).format(isoDateFormat);
466
+ return /* @__PURE__ */ new Date(`${day}T00:00:00Z`);
467
+ }
468
+ function isUtcMidnight(value) {
469
+ return value instanceof Date && !Number.isNaN(value.getTime()) && value.getUTCHours() === 0 && value.getUTCMinutes() === 0 && value.getUTCSeconds() === 0 && value.getUTCMilliseconds() === 0;
470
+ }
459
471
  var formatDate = (dateStr, display = "datetime", timeStr) => {
460
472
  const dateTimeStr = timeStr ? `${dateStr} ${timeStr}` : dateStr;
461
473
  const dateTime = timeStr ? (0, import_dayjs2.default)(dateTimeStr, `${dateFormat} ${timeFormat}`) : (0, import_dayjs2.default)(dateStr, dateFormat);
@@ -942,11 +954,11 @@ function sumUserOverallPoints(points) {
942
954
  // src/calendar/eventCalendar.ts
943
955
  var import_dayjs3 = __toESM(require("dayjs"));
944
956
  function toCalendarIsoDate(startDate) {
945
- const formatted = (0, import_dayjs3.default)(startDate, dateFormat).format("YYYY-MM-DD");
946
- return (0, import_dayjs3.default)(formatted, "YYYY-MM-DD", true).isValid() ? formatted : null;
957
+ const formatted = (0, import_dayjs3.default)(startDate, dateFormat).format(isoDateFormat);
958
+ return (0, import_dayjs3.default)(formatted, isoDateFormat, true).isValid() ? formatted : null;
947
959
  }
948
960
  function fromCalendarIsoDate(isoDate) {
949
- return (0, import_dayjs3.default)(isoDate, "YYYY-MM-DD").format(dateFormat);
961
+ return (0, import_dayjs3.default)(isoDate, isoDateFormat).format(dateFormat);
950
962
  }
951
963
  function getEventCalendarIsoDates(dateTimes) {
952
964
  return dateTimes?.map(
@@ -2565,6 +2577,7 @@ function getErrorMessage(error, fallback = DEFAULT_USER_FACING_ERROR) {
2565
2577
  IOS_URL,
2566
2578
  MANUAL_DATE_STATUSES,
2567
2579
  NETWORK_USER_FACING_ERROR,
2580
+ NZ_TZ,
2568
2581
  PRESERVED_RELATION_DATE_STATUSES,
2569
2582
  PostTypeLabels,
2570
2583
  SCHOOL_MAX_STUDENT_COUNT,
@@ -2638,7 +2651,9 @@ function getErrorMessage(error, fallback = DEFAULT_USER_FACING_ERROR) {
2638
2651
  isIsoDateString,
2639
2652
  isResourceImageActive,
2640
2653
  isTransientNetworkError,
2654
+ isUtcMidnight,
2641
2655
  isValidIrdNumber,
2656
+ isoDateFormat,
2642
2657
  licenseNiceNames,
2643
2658
  mapArrayToOptions,
2644
2659
  matchesCategory,
@@ -2646,6 +2661,7 @@ function getErrorMessage(error, fallback = DEFAULT_USER_FACING_ERROR) {
2646
2661
  normalizeIrdNumber,
2647
2662
  normalizeResourceImage,
2648
2663
  normalizeUrl,
2664
+ nzDayKey,
2649
2665
  nzStartOfDay,
2650
2666
  paymentMethodOptions,
2651
2667
  relationHasSelectedDate,