@timardex/cluemart-shared 1.5.498 → 1.5.500

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 (38) hide show
  1. package/dist/{chunk-AUTKJ6QP.mjs → chunk-IDDG4XZS.mjs} +2 -2
  2. package/dist/{chunk-O4ILKWFI.mjs → chunk-Q6CO7TFK.mjs} +49 -20
  3. package/dist/chunk-Q6CO7TFK.mjs.map +1 -0
  4. package/dist/{chunk-O5IIN45V.mjs → chunk-W4FADQMS.mjs} +2 -2
  5. package/dist/formFields/index.cjs +111 -0
  6. package/dist/formFields/index.cjs.map +1 -1
  7. package/dist/formFields/index.mjs +3 -3
  8. package/dist/{game-B-YC4Am7.d.ts → game-BzOJ4f7U.d.ts} +25 -6
  9. package/dist/{game-C6zLvmHU.d.mts → game-CoVv7iyf.d.mts} +25 -6
  10. package/dist/graphql/index.d.mts +2 -2
  11. package/dist/graphql/index.d.ts +2 -2
  12. package/dist/hooks/index.cjs +111 -0
  13. package/dist/hooks/index.cjs.map +1 -1
  14. package/dist/hooks/index.d.mts +2 -2
  15. package/dist/hooks/index.d.ts +2 -2
  16. package/dist/hooks/index.mjs +3 -3
  17. package/dist/index.cjs +48 -19
  18. package/dist/index.cjs.map +1 -1
  19. package/dist/index.d.mts +25 -6
  20. package/dist/index.d.ts +25 -6
  21. package/dist/index.mjs +48 -19
  22. package/dist/index.mjs.map +1 -1
  23. package/dist/{post-DFTmI0uz.d.mts → post-CcJowEi5.d.mts} +1 -1
  24. package/dist/{post-CNm_rxZm.d.ts → post-D9_1FbFI.d.ts} +1 -1
  25. package/dist/types/index.cjs +48 -19
  26. package/dist/types/index.cjs.map +1 -1
  27. package/dist/types/index.d.mts +2 -2
  28. package/dist/types/index.d.ts +2 -2
  29. package/dist/types/index.mjs +1 -1
  30. package/dist/utils/index.cjs +48 -19
  31. package/dist/utils/index.cjs.map +1 -1
  32. package/dist/utils/index.d.mts +1 -1
  33. package/dist/utils/index.d.ts +1 -1
  34. package/dist/utils/index.mjs +2 -2
  35. package/package.json +1 -1
  36. package/dist/chunk-O4ILKWFI.mjs.map +0 -1
  37. /package/dist/{chunk-AUTKJ6QP.mjs.map → chunk-IDDG4XZS.mjs.map} +0 -0
  38. /package/dist/{chunk-O5IIN45V.mjs.map → chunk-W4FADQMS.mjs.map} +0 -0
@@ -5,7 +5,7 @@ import {
5
5
  } from "./chunk-534WN2SR.mjs";
6
6
  import {
7
7
  gameScreenIdentifierList
8
- } from "./chunk-O4ILKWFI.mjs";
8
+ } from "./chunk-Q6CO7TFK.mjs";
9
9
 
10
10
  // src/utils/dailyClueGame.ts
11
11
  import dayjs from "dayjs";
@@ -256,4 +256,4 @@ export {
256
256
  IOS_URL,
257
257
  ANDROID_URL
258
258
  };
259
- //# sourceMappingURL=chunk-AUTKJ6QP.mjs.map
259
+ //# sourceMappingURL=chunk-IDDG4XZS.mjs.map
@@ -1,80 +1,109 @@
1
1
  // src/types/game.ts
2
+ var createRouteMatcher = (base, type) => {
3
+ switch (type) {
4
+ case "mongoId":
5
+ return new RegExp(`^\\/${base}\\/([a-f0-9]{24})$`);
6
+ case "slug":
7
+ return new RegExp(`^\\/${base}\\/[^/]+$`);
8
+ default:
9
+ return new RegExp(`^\\/${base}$`);
10
+ }
11
+ };
2
12
  var gameScreenIdentifierList = [
3
13
  {
4
14
  clue: "Where your actions turn into a timeline.",
5
- id: "activities"
15
+ id: "activities",
16
+ match: "/profile/activities"
6
17
  },
7
18
  {
8
19
  clue: "Where conversations happen without speaking.",
9
- id: "chat"
20
+ id: "chat",
21
+ match: "/profile/chat"
10
22
  },
11
23
  {
12
24
  clue: "The place to redefine who you are.",
13
- id: "edit-profile"
25
+ id: "edit-profile",
26
+ match: "/profile/edit-profile"
14
27
  },
15
28
  {
16
29
  clue: "A single moment worth showing up for.",
17
- id: "event"
30
+ id: "single-event",
31
+ match: createRouteMatcher("events", "mongoId")
18
32
  },
19
33
  {
20
34
  clue: "What\u2019s happening around you, right now.",
21
- id: "events-near-me"
35
+ id: "events-near-me",
36
+ match: "/events/events-near-me"
22
37
  },
23
38
  {
24
39
  clue: "A collection of things worth attending.",
25
- id: "events"
40
+ id: "events",
41
+ match: "/events"
26
42
  },
27
43
  {
28
44
  clue: "What\u2019s happening in a wider area\u2014not just nearby.",
29
- id: "events/region"
45
+ id: "events-region",
46
+ match: createRouteMatcher("events/region", "slug")
30
47
  },
31
48
  {
32
49
  clue: "Where you go to find something specific.",
33
- id: "events/search"
50
+ id: "events-search",
51
+ match: "/events/search"
34
52
  },
35
53
  {
36
54
  clue: "Where fun becomes a challenge.",
37
- id: "games"
55
+ id: "games",
56
+ match: "/games"
38
57
  },
39
58
  {
40
59
  clue: "Your starting point for everything.",
41
- id: "home"
60
+ id: "home",
61
+ match: "/"
42
62
  },
43
63
  {
44
64
  clue: "Where the app taps you on the shoulder.",
45
- id: "notifications"
65
+ id: "notifications",
66
+ match: "/notifications"
46
67
  },
47
68
  {
48
69
  clue: "Where you fine-tune your experience.",
49
- id: "options"
70
+ id: "options",
71
+ match: "/options"
50
72
  },
51
73
  {
52
74
  clue: "A single collaborator in the ecosystem.",
53
- id: "partner"
75
+ id: "single-partner",
76
+ match: createRouteMatcher("partners", "mongoId")
54
77
  },
55
78
  {
56
79
  clue: "The network behind the scenes.",
57
- id: "partners"
80
+ id: "partners",
81
+ match: "/partners"
58
82
  },
59
83
  {
60
84
  clue: "Where you share something with everyone.",
61
- id: "post"
85
+ id: "single-visitor-post",
86
+ match: createRouteMatcher("visitors/posts", "mongoId")
62
87
  },
63
88
  {
64
89
  clue: "Your identity, on display.",
65
- id: "profile"
90
+ id: "profile",
91
+ match: "/profile"
66
92
  },
67
93
  {
68
94
  clue: "One provider offering something valuable.",
69
- id: "vendor"
95
+ id: "single-vendor",
96
+ match: createRouteMatcher("vendors", "mongoId")
70
97
  },
71
98
  {
72
99
  clue: "A marketplace of providers.",
73
- id: "vendors"
100
+ id: "vendors",
101
+ match: "/vendors"
74
102
  },
75
103
  {
76
104
  clue: "People who stopped by to see you.",
77
- id: "visitors"
105
+ id: "visitors",
106
+ match: "/visitors"
78
107
  }
79
108
  ];
80
109
  var EnumGameType = /* @__PURE__ */ ((EnumGameType2) => {
@@ -97,4 +126,4 @@ export {
97
126
  gameTypeToDisplayName,
98
127
  EnumGameStatus
99
128
  };
100
- //# sourceMappingURL=chunk-O4ILKWFI.mjs.map
129
+ //# sourceMappingURL=chunk-Q6CO7TFK.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/types/game.ts"],"sourcesContent":["import { OwnerType } from \"./global\";\n\ntype MatcherType = \"mongoId\" | \"slug\";\n\nconst createRouteMatcher = (base: string, type: MatcherType) => {\n switch (type) {\n case \"mongoId\":\n return new RegExp(`^\\\\/${base}\\\\/([a-f0-9]{24})$`);\n\n case \"slug\":\n return new RegExp(`^\\\\/${base}\\\\/[^/]+$`);\n\n default:\n return new RegExp(`^\\\\/${base}$`);\n }\n};\n\nexport const gameScreenIdentifierList = [\n {\n clue: \"Where your actions turn into a timeline.\",\n id: \"activities\",\n match: \"/profile/activities\",\n },\n {\n clue: \"Where conversations happen without speaking.\",\n id: \"chat\",\n match: \"/profile/chat\",\n },\n {\n clue: \"The place to redefine who you are.\",\n id: \"edit-profile\",\n match: \"/profile/edit-profile\",\n },\n {\n clue: \"A single moment worth showing up for.\",\n id: \"single-event\",\n match: createRouteMatcher(\"events\", \"mongoId\"),\n },\n {\n clue: \"What’s happening around you, right now.\",\n id: \"events-near-me\",\n match: \"/events/events-near-me\",\n },\n {\n clue: \"A collection of things worth attending.\",\n id: \"events\",\n match: \"/events\",\n },\n {\n clue: \"What’s happening in a wider area—not just nearby.\",\n id: \"events-region\",\n match: createRouteMatcher(\"events/region\", \"slug\"),\n },\n {\n clue: \"Where you go to find something specific.\",\n id: \"events-search\",\n match: \"/events/search\",\n },\n {\n clue: \"Where fun becomes a challenge.\",\n id: \"games\",\n match: \"/games\",\n },\n {\n clue: \"Your starting point for everything.\",\n id: \"home\",\n match: \"/\",\n },\n {\n clue: \"Where the app taps you on the shoulder.\",\n id: \"notifications\",\n match: \"/notifications\",\n },\n {\n clue: \"Where you fine-tune your experience.\",\n id: \"options\",\n match: \"/options\",\n },\n {\n clue: \"A single collaborator in the ecosystem.\",\n id: \"single-partner\",\n match: createRouteMatcher(\"partners\", \"mongoId\"),\n },\n {\n clue: \"The network behind the scenes.\",\n id: \"partners\",\n match: \"/partners\",\n },\n {\n clue: \"Where you share something with everyone.\",\n id: \"single-visitor-post\",\n match: createRouteMatcher(\"visitors/posts\", \"mongoId\"),\n },\n {\n clue: \"Your identity, on display.\",\n id: \"profile\",\n match: \"/profile\",\n },\n {\n clue: \"One provider offering something valuable.\",\n id: \"single-vendor\",\n match: createRouteMatcher(\"vendors\", \"mongoId\"),\n },\n {\n clue: \"A marketplace of providers.\",\n id: \"vendors\",\n match: \"/vendors\",\n },\n {\n clue: \"People who stopped by to see you.\",\n id: \"visitors\",\n match: \"/visitors\",\n },\n] as const;\n\nexport type GamePlacement = (typeof gameScreenIdentifierList)[number][\"id\"];\nexport type GamePlacementClue =\n (typeof gameScreenIdentifierList)[number][\"clue\"];\n\nexport enum EnumGameType {\n DAILY_CLUE = \"dailyClue\",\n}\n\nexport const gameTypeToDisplayName: Record<EnumGameType, string> = {\n [EnumGameType.DAILY_CLUE]: \"Daily Clue\",\n};\n\nexport type GameDate = {\n startDate: Date;\n endDate: Date;\n};\n\nexport type BaseGame = {\n gameDate: GameDate;\n gameSolution: string;\n gameType: EnumGameType;\n};\n\nexport type DailyClueGameData = {\n gameFields: BaseGame;\n lastFoundDate: Date | null;\n points: number;\n letterInfo: {\n collected: string[] | null; // The letters the user has found, e.g. [\"C\", \"L\", \"U\"]\n shuffled: string[]; // The letters of the solution, but shuffled, e.g. [\"L\", \"C\", \"U\"]\n todaysLetter: string | null; // The letter the user has to find today, e.g. \"C\"\n todaysClue: GamePlacementClue | null; // The clue for user to find the letter, e.g. related to {todaysPlacement}\n todaysPlacement: GamePlacement | null; // The screen where the user has to find the clue, e.g. \"HomeScreen\"\n };\n // User has found the clue 3 days in a row, this is incrementing if the user finds the clue and decrements if user misses a day\n streak: number;\n};\n\ntype GameDataMap = {\n [EnumGameType.DAILY_CLUE]: DailyClueGameData;\n};\nexport type GameData = {\n [K in keyof GameDataMap]?: GameDataMap[K] | null;\n};\n\nexport enum EnumGameStatus {\n GAME_COMPLETED = \"GAME_COMPLETED\",\n GAME_LEFT = \"GAME_LEFT\",\n GAME_IN_PROGRESS = \"GAME_IN_PROGRESS\",\n}\n\nexport type GameHistory = {\n gameDate: GameDate;\n gameStatus: EnumGameStatus;\n gameType: EnumGameType;\n pointsEarned: number;\n};\n\nexport type GameType = {\n _id: string;\n active: boolean;\n createdAt: Date;\n deletedAt: Date | null;\n gameData: GameData | null;\n gameHistory: GameHistory[] | null;\n owner: OwnerType;\n points: number;\n updatedAt: Date | null;\n};\n\nexport type GameLeaderboard = {\n gameHistory: GameHistory[] | null;\n overallPoints: number;\n owner: OwnerType;\n};\n"],"mappings":";AAIA,IAAM,qBAAqB,CAAC,MAAc,SAAsB;AAC9D,UAAQ,MAAM;AAAA,IACZ,KAAK;AACH,aAAO,IAAI,OAAO,OAAO,IAAI,oBAAoB;AAAA,IAEnD,KAAK;AACH,aAAO,IAAI,OAAO,OAAO,IAAI,WAAW;AAAA,IAE1C;AACE,aAAO,IAAI,OAAO,OAAO,IAAI,GAAG;AAAA,EACpC;AACF;AAEO,IAAM,2BAA2B;AAAA,EACtC;AAAA,IACE,MAAM;AAAA,IACN,IAAI;AAAA,IACJ,OAAO;AAAA,EACT;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,IAAI;AAAA,IACJ,OAAO;AAAA,EACT;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,IAAI;AAAA,IACJ,OAAO;AAAA,EACT;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,IAAI;AAAA,IACJ,OAAO,mBAAmB,UAAU,SAAS;AAAA,EA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AL;AACL,EAAAA,cAAA,gBAAa;AADH,SAAAA;AAAA,GAAA;AAIL,IAAM,wBAAsD;AAAA,EACjE,CAAC,4BAAuB,GAAG;AAC7B;AAmCO,IAAK,iBAAL,kBAAKC,oBAAL;AACL,EAAAA,gBAAA,oBAAiB;AACjB,EAAAA,gBAAA,eAAY;AACZ,EAAAA,gBAAA,sBAAmB;AAHT,SAAAA;AAAA,GAAA;","names":["EnumGameType","EnumGameStatus"]}
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  mapArrayToOptions
3
- } from "./chunk-AUTKJ6QP.mjs";
3
+ } from "./chunk-IDDG4XZS.mjs";
4
4
  import {
5
5
  EnumFoodFlavor
6
6
  } from "./chunk-534WN2SR.mjs";
@@ -1952,4 +1952,4 @@ export {
1952
1952
  contactUsFields,
1953
1953
  partnerBasicInfoFields
1954
1954
  };
1955
- //# sourceMappingURL=chunk-O5IIN45V.mjs.map
1955
+ //# sourceMappingURL=chunk-W4FADQMS.mjs.map
@@ -327,6 +327,117 @@ var EnumRegions = /* @__PURE__ */ ((EnumRegions2) => {
327
327
  // src/utils/dailyClueGame.ts
328
328
  var import_dayjs = __toESM(require("dayjs"));
329
329
  var import_utc = __toESM(require("dayjs/plugin/utc"));
330
+
331
+ // src/types/game.ts
332
+ var createRouteMatcher = (base, type) => {
333
+ switch (type) {
334
+ case "mongoId":
335
+ return new RegExp(`^\\/${base}\\/([a-f0-9]{24})$`);
336
+ case "slug":
337
+ return new RegExp(`^\\/${base}\\/[^/]+$`);
338
+ default:
339
+ return new RegExp(`^\\/${base}$`);
340
+ }
341
+ };
342
+ var gameScreenIdentifierList = [
343
+ {
344
+ clue: "Where your actions turn into a timeline.",
345
+ id: "activities",
346
+ match: "/profile/activities"
347
+ },
348
+ {
349
+ clue: "Where conversations happen without speaking.",
350
+ id: "chat",
351
+ match: "/profile/chat"
352
+ },
353
+ {
354
+ clue: "The place to redefine who you are.",
355
+ id: "edit-profile",
356
+ match: "/profile/edit-profile"
357
+ },
358
+ {
359
+ clue: "A single moment worth showing up for.",
360
+ id: "single-event",
361
+ match: createRouteMatcher("events", "mongoId")
362
+ },
363
+ {
364
+ clue: "What\u2019s happening around you, right now.",
365
+ id: "events-near-me",
366
+ match: "/events/events-near-me"
367
+ },
368
+ {
369
+ clue: "A collection of things worth attending.",
370
+ id: "events",
371
+ match: "/events"
372
+ },
373
+ {
374
+ clue: "What\u2019s happening in a wider area\u2014not just nearby.",
375
+ id: "events-region",
376
+ match: createRouteMatcher("events/region", "slug")
377
+ },
378
+ {
379
+ clue: "Where you go to find something specific.",
380
+ id: "events-search",
381
+ match: "/events/search"
382
+ },
383
+ {
384
+ clue: "Where fun becomes a challenge.",
385
+ id: "games",
386
+ match: "/games"
387
+ },
388
+ {
389
+ clue: "Your starting point for everything.",
390
+ id: "home",
391
+ match: "/"
392
+ },
393
+ {
394
+ clue: "Where the app taps you on the shoulder.",
395
+ id: "notifications",
396
+ match: "/notifications"
397
+ },
398
+ {
399
+ clue: "Where you fine-tune your experience.",
400
+ id: "options",
401
+ match: "/options"
402
+ },
403
+ {
404
+ clue: "A single collaborator in the ecosystem.",
405
+ id: "single-partner",
406
+ match: createRouteMatcher("partners", "mongoId")
407
+ },
408
+ {
409
+ clue: "The network behind the scenes.",
410
+ id: "partners",
411
+ match: "/partners"
412
+ },
413
+ {
414
+ clue: "Where you share something with everyone.",
415
+ id: "single-visitor-post",
416
+ match: createRouteMatcher("visitors/posts", "mongoId")
417
+ },
418
+ {
419
+ clue: "Your identity, on display.",
420
+ id: "profile",
421
+ match: "/profile"
422
+ },
423
+ {
424
+ clue: "One provider offering something valuable.",
425
+ id: "single-vendor",
426
+ match: createRouteMatcher("vendors", "mongoId")
427
+ },
428
+ {
429
+ clue: "A marketplace of providers.",
430
+ id: "vendors",
431
+ match: "/vendors"
432
+ },
433
+ {
434
+ clue: "People who stopped by to see you.",
435
+ id: "visitors",
436
+ match: "/visitors"
437
+ }
438
+ ];
439
+
440
+ // src/utils/dailyClueGame.ts
330
441
  import_dayjs.default.extend(import_utc.default);
331
442
 
332
443
  // src/utils/index.ts