@timardex/cluemart-shared 2.2.30 → 2.2.41
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/{ad-C4L_-r-4.d.ts → ad-CdehhMyb.d.ts} +2 -2
- package/dist/{ad-XtBAH4rD.d.mts → ad-Drhn_Azy.d.mts} +2 -2
- package/dist/{affiliate-CxZHVZb2.d.ts → affiliate-Cd78p2Fz.d.mts} +3 -3
- package/dist/{affiliate-D-L_UtL8.d.mts → affiliate-CdIL0r2o.d.ts} +3 -3
- package/dist/auth/index.cjs +10 -1
- package/dist/auth/index.cjs.map +1 -1
- package/dist/auth/index.d.mts +3 -3
- package/dist/auth/index.d.ts +3 -3
- package/dist/auth/index.mjs +2 -2
- package/dist/{chunk-J5N3IEGR.mjs → chunk-2GUAD63W.mjs} +3 -3
- package/dist/{chunk-IKRXLKJ3.mjs → chunk-5AAYX364.mjs} +1 -1
- package/dist/{chunk-IKRXLKJ3.mjs.map → chunk-5AAYX364.mjs.map} +1 -1
- package/dist/{chunk-LLP7OWX5.mjs → chunk-MKHXXZWF.mjs} +2 -2
- package/dist/{chunk-YFFCHTJS.mjs → chunk-PJY7OAQ2.mjs} +18 -23
- package/dist/{chunk-YFFCHTJS.mjs.map → chunk-PJY7OAQ2.mjs.map} +1 -1
- package/dist/{chunk-MQHX5BD6.mjs → chunk-QIF4ZGMY.mjs} +2 -2
- package/dist/{chunk-BR4XNXE7.mjs → chunk-TKSBCN3N.mjs} +11 -2
- package/dist/chunk-TKSBCN3N.mjs.map +1 -0
- package/dist/{chunk-NRNLARYC.mjs → chunk-VHNCSCQU.mjs} +37 -35
- package/dist/chunk-VHNCSCQU.mjs.map +1 -0
- package/dist/{chunk-U3KUTQ43.mjs → chunk-XGGFB7HY.mjs} +11 -2
- package/dist/{chunk-U3KUTQ43.mjs.map → chunk-XGGFB7HY.mjs.map} +1 -1
- package/dist/{contactUs-CwHKoGEt.d.mts → contactUs-BJPQ5nKc.d.mts} +1 -1
- package/dist/{contactUs-CR-nghbk.d.ts → contactUs-ITiB1XV4.d.ts} +1 -1
- package/dist/enums/index.cjs +10 -0
- package/dist/enums/index.cjs.map +1 -1
- package/dist/enums/index.d.mts +8 -1
- package/dist/enums/index.d.ts +8 -1
- package/dist/enums/index.mjs +3 -1
- package/dist/formFields/index.cjs +4 -4
- package/dist/formFields/index.cjs.map +1 -1
- package/dist/formFields/index.d.mts +1 -1
- package/dist/formFields/index.d.ts +1 -1
- package/dist/formFields/index.mjs +5 -5
- package/dist/{global-B4mmQo6R.d.ts → global-DlC7W4p7.d.ts} +9 -0
- package/dist/{global-D1r5ZuQO.d.mts → global-XUBcgjNc.d.mts} +9 -0
- package/dist/graphql/index.cjs +10 -1
- package/dist/graphql/index.cjs.map +1 -1
- package/dist/graphql/index.d.mts +5 -5
- package/dist/graphql/index.d.ts +5 -5
- package/dist/graphql/index.mjs +3 -3
- package/dist/hooks/index.cjs +14 -5
- package/dist/hooks/index.cjs.map +1 -1
- package/dist/hooks/index.d.mts +5 -5
- package/dist/hooks/index.d.ts +5 -5
- package/dist/hooks/index.mjs +8 -8
- package/dist/index.cjs +73 -58
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +65 -25
- package/dist/index.d.ts +65 -25
- package/dist/index.mjs +68 -53
- package/dist/index.mjs.map +1 -1
- package/dist/map/index.d.mts +1 -1
- package/dist/map/index.d.ts +1 -1
- package/dist/region/index.cjs.map +1 -1
- package/dist/region/index.d.mts +1 -1
- package/dist/region/index.d.ts +1 -1
- package/dist/region/index.mjs +1 -1
- package/dist/{resourceActivities-Uz9uavhK.d.ts → resourceActivities-C8eIfpKl.d.ts} +1 -1
- package/dist/{resourceActivities-DUReu_jD.d.mts → resourceActivities-Ci12UkJU.d.mts} +1 -1
- package/dist/sharing/index.cjs +4 -25
- package/dist/sharing/index.cjs.map +1 -1
- package/dist/sharing/index.d.mts +3 -22
- package/dist/sharing/index.d.ts +3 -22
- package/dist/sharing/index.mjs +3 -9
- package/dist/types/index.cjs.map +1 -1
- package/dist/types/index.d.mts +7 -7
- package/dist/types/index.d.ts +7 -7
- package/dist/types/index.mjs +2 -2
- package/dist/{user-BpR-FTW2.d.mts → user-BSFExFvl.d.ts} +18 -4
- package/dist/{user-IR0bHKFb.d.ts → user-D31zAVuz.d.mts} +18 -4
- package/dist/utils/index.cjs +53 -36
- package/dist/utils/index.cjs.map +1 -1
- package/dist/utils/index.d.mts +36 -7
- package/dist/utils/index.d.ts +36 -7
- package/dist/utils/index.mjs +12 -8
- package/package.json +1 -1
- package/dist/chunk-BR4XNXE7.mjs.map +0 -1
- package/dist/chunk-NRNLARYC.mjs.map +0 -1
- /package/dist/{chunk-J5N3IEGR.mjs.map → chunk-2GUAD63W.mjs.map} +0 -0
- /package/dist/{chunk-LLP7OWX5.mjs.map → chunk-MKHXXZWF.mjs.map} +0 -0
- /package/dist/{chunk-MQHX5BD6.mjs.map → chunk-QIF4ZGMY.mjs.map} +0 -0
package/dist/utils/index.cjs
CHANGED
|
@@ -62,7 +62,7 @@ __export(utils_exports, {
|
|
|
62
62
|
buildRelationEligibleEventSchedule: () => buildRelationEligibleEventSchedule,
|
|
63
63
|
capitalizeFirstLetter: () => capitalizeFirstLetter,
|
|
64
64
|
cluemartSocialMedia: () => cluemartSocialMedia,
|
|
65
|
-
|
|
65
|
+
collectStallholderDateTimes: () => collectStallholderDateTimes,
|
|
66
66
|
collectVendorEventRelationDateTimes: () => collectVendorEventRelationDateTimes,
|
|
67
67
|
computeDailyClueState: () => computeDailyClueState,
|
|
68
68
|
computeHasMore: () => computeHasMore,
|
|
@@ -97,7 +97,6 @@ __export(utils_exports, {
|
|
|
97
97
|
getDistanceInMeters: () => getDistanceInMeters,
|
|
98
98
|
getErrorMessage: () => getErrorMessage,
|
|
99
99
|
getEventCalendarIsoDates: () => getEventCalendarIsoDates,
|
|
100
|
-
getEventDatesWithStallholders: () => getEventDatesWithStallholders,
|
|
101
100
|
getEventScheduleStatusLabel: () => getEventScheduleStatusLabel,
|
|
102
101
|
getEventScheduleStatusPresentation: () => getEventScheduleStatusPresentation,
|
|
103
102
|
getEventScheduleStatusTone: () => getEventScheduleStatusTone,
|
|
@@ -108,6 +107,8 @@ __export(utils_exports, {
|
|
|
108
107
|
getRegisteredVendorStartDates: () => getRegisteredVendorStartDates,
|
|
109
108
|
getStallholderCategoryNames: () => getStallholderCategoryNames,
|
|
110
109
|
getStallholderCategoryOptions: () => getStallholderCategoryOptions,
|
|
110
|
+
getUniqueStallholderStartDates: () => getUniqueStallholderStartDates,
|
|
111
|
+
getUniqueStartDates: () => getUniqueStartDates,
|
|
111
112
|
getUnregisteredVendorCategoryNames: () => getUnregisteredVendorCategoryNames,
|
|
112
113
|
getUnregisteredVendorStartDates: () => getUnregisteredVendorStartDates,
|
|
113
114
|
getVendorEventRelationDateOptions: () => getVendorEventRelationDateOptions,
|
|
@@ -139,6 +140,7 @@ __export(utils_exports, {
|
|
|
139
140
|
shouldShowEventActionsWithWeather: () => shouldShowEventActionsWithWeather,
|
|
140
141
|
sortDatesChronologically: () => sortDatesChronologically,
|
|
141
142
|
statusOptions: () => statusOptions,
|
|
143
|
+
sumUserOverallPoints: () => sumUserOverallPoints,
|
|
142
144
|
timeFormat: () => timeFormat,
|
|
143
145
|
toCalendarIsoDate: () => toCalendarIsoDate,
|
|
144
146
|
toNZTime: () => toNZTime,
|
|
@@ -520,6 +522,18 @@ function sortDatesChronologically(dates) {
|
|
|
520
522
|
return 0;
|
|
521
523
|
});
|
|
522
524
|
}
|
|
525
|
+
function getUniqueStartDates(dates) {
|
|
526
|
+
const seenStartDates = /* @__PURE__ */ new Set();
|
|
527
|
+
const uniqueStartDates = [];
|
|
528
|
+
for (const { startDate } of sortDatesChronologically(dates ?? [])) {
|
|
529
|
+
if (!startDate || seenStartDates.has(startDate)) {
|
|
530
|
+
continue;
|
|
531
|
+
}
|
|
532
|
+
seenStartDates.add(startDate);
|
|
533
|
+
uniqueStartDates.push(startDate);
|
|
534
|
+
}
|
|
535
|
+
return uniqueStartDates;
|
|
536
|
+
}
|
|
523
537
|
var futureTimePeriods = FUTURE_EVENT_DATE_STATUSES.filter(
|
|
524
538
|
(status) => status !== "Starting_Soon" /* STARTING_SOON */
|
|
525
539
|
).map((status) => ({
|
|
@@ -728,14 +742,14 @@ var DEFAULT_SHARE_OG_IMAGE = `${SHARE_SITE_URL}/assets/logo.webp`;
|
|
|
728
742
|
var SHARE_RESOURCE_LABEL = {
|
|
729
743
|
[RELATION_SHARE_APPLICATION]: "Application",
|
|
730
744
|
[RELATION_SHARE_INVITATION]: "Invitation",
|
|
745
|
+
affiliate: "Affiliate",
|
|
731
746
|
clue_bites: "Clue Bites",
|
|
732
747
|
market_faces: "Market Faces",
|
|
733
|
-
play_and_win: "Play & Win",
|
|
734
748
|
market: "Market",
|
|
735
749
|
partner: "Partner",
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
750
|
+
play_and_win: "Play & Win",
|
|
751
|
+
school: "School",
|
|
752
|
+
stallholder: "Stallholder"
|
|
739
753
|
};
|
|
740
754
|
|
|
741
755
|
// src/sharing/normalizeShareDescription.ts
|
|
@@ -901,6 +915,14 @@ function isResourceImageActive(image) {
|
|
|
901
915
|
var SCHOOL_MIN_STUDENT_COUNT = 300;
|
|
902
916
|
var SCHOOL_MAX_STUDENT_COUNT = 0;
|
|
903
917
|
|
|
918
|
+
// src/utils/userPoints.ts
|
|
919
|
+
function sumUserOverallPoints(points) {
|
|
920
|
+
return (points ?? []).reduce(
|
|
921
|
+
(total, entry) => total + (entry?.points ?? 0),
|
|
922
|
+
0
|
|
923
|
+
);
|
|
924
|
+
}
|
|
925
|
+
|
|
904
926
|
// src/calendar/eventCalendar.ts
|
|
905
927
|
var import_dayjs3 = __toESM(require("dayjs"));
|
|
906
928
|
function toCalendarIsoDate(startDate) {
|
|
@@ -2080,21 +2102,23 @@ function filterUnregisteredVendorsByEventDatesOnly(vendors, eventStartDates) {
|
|
|
2080
2102
|
)
|
|
2081
2103
|
);
|
|
2082
2104
|
}
|
|
2083
|
-
function
|
|
2105
|
+
function collectStallholderDateTimes(registeredVendors, unregisteredVendors = []) {
|
|
2084
2106
|
return [
|
|
2085
|
-
...registeredVendors.flatMap(
|
|
2086
|
-
|
|
2107
|
+
...registeredVendors.flatMap(
|
|
2108
|
+
(vendor) => (vendor.relations ?? []).flatMap(
|
|
2109
|
+
(relation) => (relation.relationDates ?? []).map(
|
|
2110
|
+
(relationDate) => relationDate.dateTime
|
|
2111
|
+
)
|
|
2112
|
+
)
|
|
2113
|
+
),
|
|
2114
|
+
...unregisteredVendors.flatMap(
|
|
2115
|
+
(vendor) => (vendor.invitations ?? []).flatMap((invitation) => invitation.dateTime)
|
|
2116
|
+
)
|
|
2087
2117
|
];
|
|
2088
2118
|
}
|
|
2089
|
-
function
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
}
|
|
2093
|
-
const startDates = new Set(stallholderStartDates);
|
|
2094
|
-
return sortDatesChronologically(
|
|
2095
|
-
eventDateTime.filter(
|
|
2096
|
-
(date) => Boolean(date.startDate) && startDates.has(date.startDate)
|
|
2097
|
-
)
|
|
2119
|
+
function getUniqueStallholderStartDates(registeredVendors, unregisteredVendors = []) {
|
|
2120
|
+
return getUniqueStartDates(
|
|
2121
|
+
collectStallholderDateTimes(registeredVendors, unregisteredVendors)
|
|
2098
2122
|
);
|
|
2099
2123
|
}
|
|
2100
2124
|
function getStallholderCategoryNames(registeredVendors, unregisteredVendors = []) {
|
|
@@ -2150,16 +2174,7 @@ function collectVendorEventRelationDateTimes(events) {
|
|
|
2150
2174
|
);
|
|
2151
2175
|
}
|
|
2152
2176
|
function getVendorEventRelationStartDates(events) {
|
|
2153
|
-
|
|
2154
|
-
collectVendorEventRelationDateTimes(events)
|
|
2155
|
-
);
|
|
2156
|
-
const uniqueStartDates = [];
|
|
2157
|
-
for (const dateTime of sortedDates) {
|
|
2158
|
-
if (dateTime.startDate && !uniqueStartDates.includes(dateTime.startDate)) {
|
|
2159
|
-
uniqueStartDates.push(dateTime.startDate);
|
|
2160
|
-
}
|
|
2161
|
-
}
|
|
2162
|
-
return uniqueStartDates;
|
|
2177
|
+
return getUniqueStartDates(collectVendorEventRelationDateTimes(events));
|
|
2163
2178
|
}
|
|
2164
2179
|
function getVendorEventRelationDateOptions(events) {
|
|
2165
2180
|
return getVendorEventRelationStartDates(events).map((startDate) => ({
|
|
@@ -2424,12 +2439,12 @@ function getEventStallholdersData({
|
|
|
2424
2439
|
registeredForSelectedDate,
|
|
2425
2440
|
unregisteredForSelectedDate
|
|
2426
2441
|
);
|
|
2427
|
-
const futureEventStartDates =
|
|
2428
|
-
|
|
2429
|
-
|
|
2430
|
-
).map((
|
|
2431
|
-
label: formatDate(
|
|
2432
|
-
value:
|
|
2442
|
+
const futureEventStartDates = getUniqueStallholderStartDates(
|
|
2443
|
+
registeredForEvent,
|
|
2444
|
+
unregisteredForEvent
|
|
2445
|
+
).map((startDate) => ({
|
|
2446
|
+
label: formatDate(startDate, "date"),
|
|
2447
|
+
value: startDate
|
|
2433
2448
|
}));
|
|
2434
2449
|
const hasDatePills = futureEventStartDates.length > 0;
|
|
2435
2450
|
const hasStallholders = vendorList.length > 0 || unregisteredVendorList.length > 0;
|
|
@@ -2546,7 +2561,7 @@ function getErrorMessage(error, fallback = DEFAULT_USER_FACING_ERROR) {
|
|
|
2546
2561
|
buildRelationEligibleEventSchedule,
|
|
2547
2562
|
capitalizeFirstLetter,
|
|
2548
2563
|
cluemartSocialMedia,
|
|
2549
|
-
|
|
2564
|
+
collectStallholderDateTimes,
|
|
2550
2565
|
collectVendorEventRelationDateTimes,
|
|
2551
2566
|
computeDailyClueState,
|
|
2552
2567
|
computeHasMore,
|
|
@@ -2581,7 +2596,6 @@ function getErrorMessage(error, fallback = DEFAULT_USER_FACING_ERROR) {
|
|
|
2581
2596
|
getDistanceInMeters,
|
|
2582
2597
|
getErrorMessage,
|
|
2583
2598
|
getEventCalendarIsoDates,
|
|
2584
|
-
getEventDatesWithStallholders,
|
|
2585
2599
|
getEventScheduleStatusLabel,
|
|
2586
2600
|
getEventScheduleStatusPresentation,
|
|
2587
2601
|
getEventScheduleStatusTone,
|
|
@@ -2592,6 +2606,8 @@ function getErrorMessage(error, fallback = DEFAULT_USER_FACING_ERROR) {
|
|
|
2592
2606
|
getRegisteredVendorStartDates,
|
|
2593
2607
|
getStallholderCategoryNames,
|
|
2594
2608
|
getStallholderCategoryOptions,
|
|
2609
|
+
getUniqueStallholderStartDates,
|
|
2610
|
+
getUniqueStartDates,
|
|
2595
2611
|
getUnregisteredVendorCategoryNames,
|
|
2596
2612
|
getUnregisteredVendorStartDates,
|
|
2597
2613
|
getVendorEventRelationDateOptions,
|
|
@@ -2623,6 +2639,7 @@ function getErrorMessage(error, fallback = DEFAULT_USER_FACING_ERROR) {
|
|
|
2623
2639
|
shouldShowEventActionsWithWeather,
|
|
2624
2640
|
sortDatesChronologically,
|
|
2625
2641
|
statusOptions,
|
|
2642
|
+
sumUserOverallPoints,
|
|
2626
2643
|
timeFormat,
|
|
2627
2644
|
toCalendarIsoDate,
|
|
2628
2645
|
toNZTime,
|