@timardex/cluemart-shared 1.5.543 → 1.5.545

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 (39) hide show
  1. package/dist/{chunk-PB3J52JN.mjs → chunk-L47NQHZ6.mjs} +2 -2
  2. package/dist/{chunk-RWA5G6NG.mjs → chunk-LOABFNIJ.mjs} +15 -18
  3. package/dist/chunk-LOABFNIJ.mjs.map +1 -0
  4. package/dist/{chunk-UNLHXGT4.mjs → chunk-Z3JWNX2U.mjs} +16 -22
  5. package/dist/chunk-Z3JWNX2U.mjs.map +1 -0
  6. package/dist/formFields/index.cjs +96 -0
  7. package/dist/formFields/index.cjs.map +1 -1
  8. package/dist/formFields/index.mjs +3 -3
  9. package/dist/{game-DAQTH29H.d.ts → game-1CSiEjlf.d.ts} +8 -12
  10. package/dist/{game-CKJKoqrR.d.mts → game-BPtE3yaQ.d.mts} +8 -12
  11. package/dist/graphql/index.d.mts +2 -2
  12. package/dist/graphql/index.d.ts +2 -2
  13. package/dist/hooks/index.cjs +96 -0
  14. package/dist/hooks/index.cjs.map +1 -1
  15. package/dist/hooks/index.d.mts +2 -2
  16. package/dist/hooks/index.d.ts +2 -2
  17. package/dist/hooks/index.mjs +3 -3
  18. package/dist/index.cjs +28 -37
  19. package/dist/index.cjs.map +1 -1
  20. package/dist/index.d.mts +8 -12
  21. package/dist/index.d.ts +8 -12
  22. package/dist/index.mjs +28 -37
  23. package/dist/index.mjs.map +1 -1
  24. package/dist/{post-C22p1dDe.d.ts → post-C0CIWXwc.d.ts} +1 -1
  25. package/dist/{post-B65KQS6r.d.mts → post-DjuHzWo7.d.mts} +1 -1
  26. package/dist/types/index.cjs +14 -17
  27. package/dist/types/index.cjs.map +1 -1
  28. package/dist/types/index.d.mts +2 -2
  29. package/dist/types/index.d.ts +2 -2
  30. package/dist/types/index.mjs +1 -1
  31. package/dist/utils/index.cjs +28 -37
  32. package/dist/utils/index.cjs.map +1 -1
  33. package/dist/utils/index.d.mts +1 -1
  34. package/dist/utils/index.d.ts +1 -1
  35. package/dist/utils/index.mjs +2 -2
  36. package/package.json +1 -1
  37. package/dist/chunk-RWA5G6NG.mjs.map +0 -1
  38. package/dist/chunk-UNLHXGT4.mjs.map +0 -1
  39. /package/dist/{chunk-PB3J52JN.mjs.map → chunk-L47NQHZ6.mjs.map} +0 -0
@@ -1,10 +1,10 @@
1
1
  import { L as LocationType, i as VendorFormData, j as CreateVendorFormData, k as VendorInfoFormData, l as CreateVendorInfoFormData, m as EventFormData, n as CreateEventFormData, o as EventInfoFormData, p as CreateEventInfoFormData, q as UnregisteredVendorFormData, B as BaseResourceTypeFormData } from '../global-ClbRuePq.mjs';
2
- import { g as UserFormData, C as CreateUserFormData, h as PartnerFormData, i as AdFormData, j as CreateAdFormData, k as CreatePartnerFormData, l as PostFormData, m as CreatePostFormData, n as AppSettingsFormData, o as CreateAppSettingsFormData, p as SchoolFormData, q as CreateSchoolFormData } from '../post-B65KQS6r.mjs';
2
+ import { g as UserFormData, C as CreateUserFormData, h as PartnerFormData, i as AdFormData, j as CreateAdFormData, k as CreatePartnerFormData, l as PostFormData, m as CreatePostFormData, n as AppSettingsFormData, o as CreateAppSettingsFormData, p as SchoolFormData, q as CreateSchoolFormData } from '../post-DjuHzWo7.mjs';
3
3
  import { C as CreateLoginFormData, a as CreateRegisterFormData, b as CreateRequestPasswordResetFormData, c as CreateValidateVerificationTokenFormData, d as CreateResetPasswordFormData, e as ContactUsFormData, f as CreateContactUsFormData } from '../auth-Bxz2zKuN.mjs';
4
4
  import 'react-hook-form';
5
5
  import '../enums/index.mjs';
6
6
  import '../images/index.mjs';
7
- import '../game-CKJKoqrR.mjs';
7
+ import '../game-BPtE3yaQ.mjs';
8
8
 
9
9
  interface PlacePrediction {
10
10
  place_id: string;
@@ -1,10 +1,10 @@
1
1
  import { L as LocationType, i as VendorFormData, j as CreateVendorFormData, k as VendorInfoFormData, l as CreateVendorInfoFormData, m as EventFormData, n as CreateEventFormData, o as EventInfoFormData, p as CreateEventInfoFormData, q as UnregisteredVendorFormData, B as BaseResourceTypeFormData } from '../global-CDqmjLH1.js';
2
- import { g as UserFormData, C as CreateUserFormData, h as PartnerFormData, i as AdFormData, j as CreateAdFormData, k as CreatePartnerFormData, l as PostFormData, m as CreatePostFormData, n as AppSettingsFormData, o as CreateAppSettingsFormData, p as SchoolFormData, q as CreateSchoolFormData } from '../post-C22p1dDe.js';
2
+ import { g as UserFormData, C as CreateUserFormData, h as PartnerFormData, i as AdFormData, j as CreateAdFormData, k as CreatePartnerFormData, l as PostFormData, m as CreatePostFormData, n as AppSettingsFormData, o as CreateAppSettingsFormData, p as SchoolFormData, q as CreateSchoolFormData } from '../post-C0CIWXwc.js';
3
3
  import { C as CreateLoginFormData, a as CreateRegisterFormData, b as CreateRequestPasswordResetFormData, c as CreateValidateVerificationTokenFormData, d as CreateResetPasswordFormData, e as ContactUsFormData, f as CreateContactUsFormData } from '../auth-BiybdWuP.js';
4
4
  import 'react-hook-form';
5
5
  import '../enums/index.js';
6
6
  import '../images/index.js';
7
- import '../game-DAQTH29H.js';
7
+ import '../game-1CSiEjlf.js';
8
8
 
9
9
  interface PlacePrediction {
10
10
  place_id: string;
@@ -1,9 +1,9 @@
1
- import "../chunk-PB3J52JN.mjs";
1
+ import "../chunk-L47NQHZ6.mjs";
2
2
  import {
3
3
  dateFormat,
4
4
  normalizeUrl,
5
5
  timeFormat
6
- } from "../chunk-UNLHXGT4.mjs";
6
+ } from "../chunk-Z3JWNX2U.mjs";
7
7
  import "../chunk-G2YFRN6A.mjs";
8
8
  import {
9
9
  EnumEventDateStatus,
@@ -28,7 +28,7 @@ import {
28
28
  EnumPostContentType,
29
29
  EnumPostType
30
30
  } from "../chunk-HYU4YHHL.mjs";
31
- import "../chunk-RWA5G6NG.mjs";
31
+ import "../chunk-LOABFNIJ.mjs";
32
32
 
33
33
  // src/hooks/useLocationSearch.ts
34
34
  var handleApiError = (error, message) => {
package/dist/index.cjs CHANGED
@@ -761,6 +761,8 @@ var priceUnits = [
761
761
  ];
762
762
 
763
763
  // src/types/game.ts
764
+ var OBJECT_ID_PATH_SEGMENT = "[a-f0-9]{24}";
765
+ var OBJECT_ID_PATH_SEGMENT_END = `${OBJECT_ID_PATH_SEGMENT}$`;
764
766
  var gameScreenIdentifierList = [
765
767
  {
766
768
  clue: "Where your actions turn into a timeline.",
@@ -780,7 +782,7 @@ var gameScreenIdentifierList = [
780
782
  {
781
783
  clue: "A single moment worth showing up for.",
782
784
  id: "single-event",
783
- match: /^\/events\/[a-f0-9]{24}$/
785
+ match: new RegExp(`^/events/${OBJECT_ID_PATH_SEGMENT_END}`)
784
786
  },
785
787
  {
786
788
  clue: "What\u2019s happening around you, right now.",
@@ -793,15 +795,10 @@ var gameScreenIdentifierList = [
793
795
  match: "/events"
794
796
  },
795
797
  {
796
- clue: "What\u2019s happening in a wider area\u2014not just nearby.",
798
+ clue: "What\u2019s happening in a wider area \u2014 not just nearby.",
797
799
  id: "events-region",
798
800
  match: /^\/events\/region\/[^/]+$/
799
801
  },
800
- {
801
- clue: "Where you go to find something specific.",
802
- id: "events-search",
803
- match: "/events/search"
804
- },
805
802
  {
806
803
  clue: "Where fun becomes a challenge.",
807
804
  id: "games",
@@ -813,7 +810,7 @@ var gameScreenIdentifierList = [
813
810
  match: "/"
814
811
  },
815
812
  {
816
- clue: "Where the app taps you on the shoulder.",
813
+ clue: "Where the app whispers what you shouldn\u2019t miss.",
817
814
  id: "notifications",
818
815
  match: "/notifications"
819
816
  },
@@ -823,19 +820,19 @@ var gameScreenIdentifierList = [
823
820
  match: "/options"
824
821
  },
825
822
  {
826
- clue: "A single collaborator in the ecosystem.",
823
+ clue: "An organisation or creator supporting the community.",
827
824
  id: "single-partner",
828
- match: /^\/partners\/[a-f0-9]{24}$/
825
+ match: new RegExp(`^/partners/${OBJECT_ID_PATH_SEGMENT_END}`)
829
826
  },
830
827
  {
831
- clue: "The network behind the scenes.",
828
+ clue: "Organisations and creators supporting the community.",
832
829
  id: "partners",
833
830
  match: "/partners"
834
831
  },
835
832
  {
836
- clue: "Where you share something with everyone.",
833
+ clue: "A single published post in full view.",
837
834
  id: "single-visitor-post",
838
- match: /^\/visitors\/posts\/[a-f0-9]{24}$/
835
+ match: new RegExp(`^/visitors/post/${OBJECT_ID_PATH_SEGMENT_END}`)
839
836
  },
840
837
  {
841
838
  clue: "Your identity, on display.",
@@ -843,17 +840,17 @@ var gameScreenIdentifierList = [
843
840
  match: "/profile"
844
841
  },
845
842
  {
846
- clue: "One provider offering something valuable.",
843
+ clue: "One stallholder offering something valuable.",
847
844
  id: "single-vendor",
848
- match: /^\/vendors\/[a-f0-9]{24}$/
845
+ match: new RegExp(`^/vendors/${OBJECT_ID_PATH_SEGMENT_END}`)
849
846
  },
850
847
  {
851
- clue: "A marketplace of providers.",
848
+ clue: "Where every stallholder waits under the right category.",
852
849
  id: "vendors",
853
850
  match: "/vendors"
854
851
  },
855
852
  {
856
- clue: "People who stopped by to see you.",
853
+ clue: "Where you browse articles and posts from around the platform.",
857
854
  id: "visitors",
858
855
  match: "/visitors"
859
856
  }
@@ -985,13 +982,14 @@ function computeDailyClueState(dailyClue) {
985
982
  const today = nzStartOfDay();
986
983
  const start = nzStartOfDay(startDate);
987
984
  const end = nzStartOfDay(endDate);
985
+ if (today.isBefore(start)) {
986
+ return null;
987
+ }
988
988
  const shuffledPlacements = seededShuffle(
989
989
  gameScreenIdentifierList,
990
990
  start.toISOString()
991
991
  );
992
- if (today.isBefore(start)) {
993
- return null;
994
- }
992
+ const index = getDayIndex(start, today);
995
993
  if (today.isAfter(end)) {
996
994
  return {
997
995
  todaysClue: null,
@@ -999,31 +997,24 @@ function computeDailyClueState(dailyClue) {
999
997
  todaysPlacement: null
1000
998
  };
1001
999
  }
1002
- const index = getDayIndex(start, today);
1003
- console.log("DEBUG", {
1004
- collected,
1005
- end: end.format(),
1006
- index,
1007
- shuffled,
1008
- shuffledPlacements,
1009
- start: start.format(),
1010
- today: today.format()
1011
- });
1012
- if (index < 0 || index >= shuffled.length) return null;
1013
- const collectedCount = (collected ?? []).length;
1014
- if (collectedCount > index) {
1000
+ if (index < 0 || index >= shuffled.length || index >= shuffledPlacements.length) {
1001
+ return null;
1002
+ }
1003
+ const letterToday = shuffled[index];
1004
+ const placement = shuffledPlacements[index];
1005
+ if (!letterToday || !placement) return null;
1006
+ const alreadyCollectedToday = (collected ?? []).includes(letterToday);
1007
+ if (alreadyCollectedToday) {
1015
1008
  return {
1016
1009
  todaysClue: null,
1017
1010
  todaysLetter: null,
1018
1011
  todaysPlacement: null
1019
1012
  };
1020
1013
  }
1021
- const letterToday = shuffled[index];
1022
- if (!letterToday) return null;
1023
1014
  return {
1024
- todaysClue: shuffledPlacements[index].clue,
1015
+ todaysClue: placement.clue,
1025
1016
  todaysLetter: letterToday,
1026
- todaysPlacement: shuffledPlacements[index].id
1017
+ todaysPlacement: placement.id
1027
1018
  };
1028
1019
  }
1029
1020