@timardex/cluemart-shared 1.5.509 → 1.5.510
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.
- package/dist/{chunk-EFNSI75F.mjs → chunk-3SFKWCTZ.mjs} +2 -2
- package/dist/{chunk-UOPC7KMU.mjs → chunk-RY7AILFK.mjs} +10 -19
- package/dist/chunk-RY7AILFK.mjs.map +1 -0
- package/dist/{chunk-7GWVTPXL.mjs → chunk-WYYQSPAX.mjs} +3 -2
- package/dist/{chunk-7GWVTPXL.mjs.map → chunk-WYYQSPAX.mjs.map} +1 -1
- package/dist/formFields/index.mjs +3 -3
- package/dist/{game-CoVv7iyf.d.mts → game-DuJpk6t2.d.mts} +2 -1
- package/dist/{game-BzOJ4f7U.d.ts → game-MJqjbMLC.d.ts} +2 -1
- package/dist/graphql/index.d.mts +2 -2
- package/dist/graphql/index.d.ts +2 -2
- package/dist/hooks/index.d.mts +2 -2
- package/dist/hooks/index.d.ts +2 -2
- package/dist/hooks/index.mjs +3 -3
- package/dist/index.cjs +14 -22
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.mjs +14 -22
- package/dist/index.mjs.map +1 -1
- package/dist/{post-D9_1FbFI.d.ts → post-CZ1sHnKx.d.ts} +1 -1
- package/dist/{post-CcJowEi5.d.mts → post-D3uHp75N.d.mts} +1 -1
- package/dist/types/index.cjs +2 -1
- package/dist/types/index.cjs.map +1 -1
- package/dist/types/index.d.mts +2 -2
- package/dist/types/index.d.ts +2 -2
- package/dist/types/index.mjs +1 -1
- package/dist/utils/index.cjs +8 -17
- package/dist/utils/index.cjs.map +1 -1
- package/dist/utils/index.d.mts +1 -2
- package/dist/utils/index.d.ts +1 -2
- package/dist/utils/index.mjs +2 -2
- package/package.json +1 -1
- package/dist/chunk-UOPC7KMU.mjs.map +0 -1
- /package/dist/{chunk-EFNSI75F.mjs.map → chunk-3SFKWCTZ.mjs.map} +0 -0
package/dist/index.d.mts
CHANGED
|
@@ -1073,8 +1073,9 @@ type GameData = {
|
|
|
1073
1073
|
};
|
|
1074
1074
|
declare enum EnumGameStatus {
|
|
1075
1075
|
GAME_COMPLETED = "GAME_COMPLETED",
|
|
1076
|
+
GAME_IN_PROGRESS = "GAME_IN_PROGRESS",
|
|
1076
1077
|
GAME_LEFT = "GAME_LEFT",
|
|
1077
|
-
|
|
1078
|
+
GAME_STARTED = "GAME_STARTED"
|
|
1078
1079
|
}
|
|
1079
1080
|
type GameHistory = {
|
|
1080
1081
|
gameDate: GameDate;
|
|
@@ -2437,7 +2438,6 @@ declare const fonts: {
|
|
|
2437
2438
|
/** Seeded shuffle so all players see the same letter order / placements for a game. */
|
|
2438
2439
|
declare function seededShuffle<T>(array: readonly T[], seed: string): T[];
|
|
2439
2440
|
declare function computeDailyClueState(dailyClue: DailyClueGameData): {
|
|
2440
|
-
gameHistory: GameHistory | null;
|
|
2441
2441
|
todaysClue: GamePlacementClue | null;
|
|
2442
2442
|
todaysLetter: string | null;
|
|
2443
2443
|
todaysPlacement: GamePlacement | null;
|
package/dist/index.d.ts
CHANGED
|
@@ -1073,8 +1073,9 @@ type GameData = {
|
|
|
1073
1073
|
};
|
|
1074
1074
|
declare enum EnumGameStatus {
|
|
1075
1075
|
GAME_COMPLETED = "GAME_COMPLETED",
|
|
1076
|
+
GAME_IN_PROGRESS = "GAME_IN_PROGRESS",
|
|
1076
1077
|
GAME_LEFT = "GAME_LEFT",
|
|
1077
|
-
|
|
1078
|
+
GAME_STARTED = "GAME_STARTED"
|
|
1078
1079
|
}
|
|
1079
1080
|
type GameHistory = {
|
|
1080
1081
|
gameDate: GameDate;
|
|
@@ -2437,7 +2438,6 @@ declare const fonts: {
|
|
|
2437
2438
|
/** Seeded shuffle so all players see the same letter order / placements for a game. */
|
|
2438
2439
|
declare function seededShuffle<T>(array: readonly T[], seed: string): T[];
|
|
2439
2440
|
declare function computeDailyClueState(dailyClue: DailyClueGameData): {
|
|
2440
|
-
gameHistory: GameHistory | null;
|
|
2441
2441
|
todaysClue: GamePlacementClue | null;
|
|
2442
2442
|
todaysLetter: string | null;
|
|
2443
2443
|
todaysPlacement: GamePlacement | null;
|
package/dist/index.mjs
CHANGED
|
@@ -538,11 +538,12 @@ var EnumGameType = /* @__PURE__ */ ((EnumGameType2) => {
|
|
|
538
538
|
var gameTypeToDisplayName = {
|
|
539
539
|
["dailyClue" /* DAILY_CLUE */]: "Daily Clue"
|
|
540
540
|
};
|
|
541
|
-
var EnumGameStatus = /* @__PURE__ */ ((
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
541
|
+
var EnumGameStatus = /* @__PURE__ */ ((EnumGameStatus3) => {
|
|
542
|
+
EnumGameStatus3["GAME_COMPLETED"] = "GAME_COMPLETED";
|
|
543
|
+
EnumGameStatus3["GAME_IN_PROGRESS"] = "GAME_IN_PROGRESS";
|
|
544
|
+
EnumGameStatus3["GAME_LEFT"] = "GAME_LEFT";
|
|
545
|
+
EnumGameStatus3["GAME_STARTED"] = "GAME_STARTED";
|
|
546
|
+
return EnumGameStatus3;
|
|
546
547
|
})(EnumGameStatus || {});
|
|
547
548
|
|
|
548
549
|
// src/utils/date.ts
|
|
@@ -666,12 +667,6 @@ function computeDailyClueState(dailyClue) {
|
|
|
666
667
|
}
|
|
667
668
|
if (today.isAfter(end)) {
|
|
668
669
|
return {
|
|
669
|
-
gameHistory: {
|
|
670
|
-
gameDate: dailyClue.gameFields.gameDate,
|
|
671
|
-
gameStatus: "GAME_COMPLETED" /* GAME_COMPLETED */,
|
|
672
|
-
gameType: dailyClue.gameFields.gameType,
|
|
673
|
-
pointsEarned: dailyClue.points
|
|
674
|
-
},
|
|
675
670
|
todaysClue: null,
|
|
676
671
|
todaysLetter: null,
|
|
677
672
|
todaysPlacement: null
|
|
@@ -679,31 +674,28 @@ function computeDailyClueState(dailyClue) {
|
|
|
679
674
|
}
|
|
680
675
|
const index = getDayIndex(start, today);
|
|
681
676
|
console.log("DEBUG", {
|
|
677
|
+
collected,
|
|
682
678
|
end: end.format(),
|
|
683
679
|
index,
|
|
684
|
-
|
|
685
|
-
|
|
680
|
+
shuffled,
|
|
681
|
+
shuffledPlacements,
|
|
686
682
|
start: start.format(),
|
|
687
683
|
today: today.format()
|
|
688
684
|
});
|
|
689
685
|
if (index < 0 || index >= shuffled.length) return null;
|
|
690
|
-
const
|
|
691
|
-
if (
|
|
692
|
-
const alreadyHaveTodaysSlot = (collected ?? []).some(
|
|
693
|
-
(l) => l.trim().toLowerCase() === letterToday
|
|
694
|
-
);
|
|
695
|
-
if (alreadyHaveTodaysSlot) {
|
|
686
|
+
const collectedCount = (collected ?? []).length;
|
|
687
|
+
if (collectedCount > index) {
|
|
696
688
|
return {
|
|
697
|
-
gameHistory: null,
|
|
698
689
|
todaysClue: null,
|
|
699
690
|
todaysLetter: null,
|
|
700
691
|
todaysPlacement: null
|
|
701
692
|
};
|
|
702
693
|
}
|
|
694
|
+
const letterToday = shuffled[index];
|
|
695
|
+
if (!letterToday) return null;
|
|
703
696
|
return {
|
|
704
|
-
gameHistory: null,
|
|
705
697
|
todaysClue: shuffledPlacements[index].clue,
|
|
706
|
-
todaysLetter:
|
|
698
|
+
todaysLetter: letterToday,
|
|
707
699
|
todaysPlacement: shuffledPlacements[index].id
|
|
708
700
|
};
|
|
709
701
|
}
|