@timardex/cluemart-shared 1.5.544 → 1.5.546
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-G2YFRN6A.mjs → chunk-EZO7FVLV.mjs} +6 -6
- package/dist/chunk-EZO7FVLV.mjs.map +1 -0
- package/dist/{chunk-7435FNA7.mjs → chunk-L47NQHZ6.mjs} +2 -2
- package/dist/{chunk-TERE6URA.mjs → chunk-Z3JWNX2U.mjs} +15 -21
- package/dist/chunk-Z3JWNX2U.mjs.map +1 -0
- package/dist/formFields/index.mjs +2 -2
- package/dist/graphql/index.cjs +5 -5
- package/dist/graphql/index.cjs.map +1 -1
- package/dist/graphql/index.d.mts +1 -1
- package/dist/graphql/index.d.ts +1 -1
- package/dist/graphql/index.mjs +1 -1
- package/dist/hooks/index.cjs +2 -2
- package/dist/hooks/index.cjs.map +1 -1
- package/dist/hooks/index.mjs +3 -3
- package/dist/index.cjs +19 -25
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +19 -25
- package/dist/index.mjs.map +1 -1
- package/dist/utils/index.cjs +14 -20
- package/dist/utils/index.cjs.map +1 -1
- package/dist/utils/index.mjs +1 -1
- package/package.json +1 -1
- package/dist/chunk-G2YFRN6A.mjs.map +0 -1
- package/dist/chunk-TERE6URA.mjs.map +0 -1
- /package/dist/{chunk-7435FNA7.mjs.map → chunk-L47NQHZ6.mjs.map} +0 -0
package/dist/hooks/index.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import "../chunk-
|
|
1
|
+
import "../chunk-L47NQHZ6.mjs";
|
|
2
2
|
import {
|
|
3
3
|
dateFormat,
|
|
4
4
|
normalizeUrl,
|
|
5
5
|
timeFormat
|
|
6
|
-
} from "../chunk-
|
|
7
|
-
import "../chunk-
|
|
6
|
+
} from "../chunk-Z3JWNX2U.mjs";
|
|
7
|
+
import "../chunk-EZO7FVLV.mjs";
|
|
8
8
|
import {
|
|
9
9
|
EnumEventDateStatus,
|
|
10
10
|
EnumEventType,
|
package/dist/index.cjs
CHANGED
|
@@ -982,13 +982,14 @@ function computeDailyClueState(dailyClue) {
|
|
|
982
982
|
const today = nzStartOfDay();
|
|
983
983
|
const start = nzStartOfDay(startDate);
|
|
984
984
|
const end = nzStartOfDay(endDate);
|
|
985
|
+
if (today.isBefore(start)) {
|
|
986
|
+
return null;
|
|
987
|
+
}
|
|
985
988
|
const shuffledPlacements = seededShuffle(
|
|
986
989
|
gameScreenIdentifierList,
|
|
987
990
|
start.toISOString()
|
|
988
991
|
);
|
|
989
|
-
|
|
990
|
-
return null;
|
|
991
|
-
}
|
|
992
|
+
const index = getDayIndex(start, today);
|
|
992
993
|
if (today.isAfter(end)) {
|
|
993
994
|
return {
|
|
994
995
|
todaysClue: null,
|
|
@@ -996,31 +997,24 @@ function computeDailyClueState(dailyClue) {
|
|
|
996
997
|
todaysPlacement: null
|
|
997
998
|
};
|
|
998
999
|
}
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
today: today.format()
|
|
1008
|
-
});
|
|
1009
|
-
if (index < 0 || index >= shuffled.length) return null;
|
|
1010
|
-
const collectedCount = (collected ?? []).length;
|
|
1011
|
-
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) {
|
|
1012
1008
|
return {
|
|
1013
1009
|
todaysClue: null,
|
|
1014
1010
|
todaysLetter: null,
|
|
1015
1011
|
todaysPlacement: null
|
|
1016
1012
|
};
|
|
1017
1013
|
}
|
|
1018
|
-
const letterToday = shuffled[index];
|
|
1019
|
-
if (!letterToday) return null;
|
|
1020
1014
|
return {
|
|
1021
|
-
todaysClue:
|
|
1015
|
+
todaysClue: placement.clue,
|
|
1022
1016
|
todaysLetter: letterToday,
|
|
1023
|
-
todaysPlacement:
|
|
1017
|
+
todaysPlacement: placement.id
|
|
1024
1018
|
};
|
|
1025
1019
|
}
|
|
1026
1020
|
|
|
@@ -3242,8 +3236,8 @@ var GET_EVENTS_BY_REGION = import_client3.gql`
|
|
|
3242
3236
|
${EVENT_LIST_ITEM}
|
|
3243
3237
|
`;
|
|
3244
3238
|
var SEARCH_EVENTS = import_client3.gql`
|
|
3245
|
-
query searchEvents($
|
|
3246
|
-
eventsSearch(search: $search,
|
|
3239
|
+
query searchEvents($region: String, $search: String,$tags: [String]) {
|
|
3240
|
+
eventsSearch(region: $region, search: $search, tags: $tags) {
|
|
3247
3241
|
...EventListItemFields
|
|
3248
3242
|
}
|
|
3249
3243
|
}
|
|
@@ -4356,11 +4350,11 @@ var useGetEventsByRegion = (region, options) => {
|
|
|
4356
4350
|
refetch
|
|
4357
4351
|
};
|
|
4358
4352
|
};
|
|
4359
|
-
var useSearchEvents = (search,
|
|
4353
|
+
var useSearchEvents = (region, search, tags) => {
|
|
4360
4354
|
const { loading, error, data, refetch } = (0, import_client19.useQuery)(SEARCH_EVENTS, {
|
|
4361
4355
|
fetchPolicy: "network-only",
|
|
4362
|
-
skip: search.length < 3 || !region || region === "",
|
|
4363
|
-
variables: { region, search }
|
|
4356
|
+
skip: !search || search.length < 3 || !region || region === "",
|
|
4357
|
+
variables: { region, search, tags }
|
|
4364
4358
|
});
|
|
4365
4359
|
const eventsSearch = data?.eventsSearch || [];
|
|
4366
4360
|
return { error, eventsSearch, loading, refetch };
|