@timardex/cluemart-shared 2.1.3 → 2.1.7

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.
@@ -2,12 +2,12 @@ import "../chunk-BTZIWVSF.mjs";
2
2
  import "../chunk-VA5YN2K3.mjs";
3
3
  import "../chunk-VPANTTZI.mjs";
4
4
  import "../chunk-DWO35OY4.mjs";
5
- import "../chunk-B22YRNRF.mjs";
5
+ import "../chunk-67HYWKEY.mjs";
6
6
  import {
7
7
  SCHOOL_MIN_STUDENT_COUNT,
8
8
  isValidIrdNumber,
9
9
  normalizeUrl
10
- } from "../chunk-HFN6KXX2.mjs";
10
+ } from "../chunk-CUZXB6J2.mjs";
11
11
  import "../chunk-RE4NZPYY.mjs";
12
12
  import {
13
13
  dateFormat,
@@ -24,7 +24,7 @@ import {
24
24
  } from "../chunk-PIEXGXTD.mjs";
25
25
  import "../chunk-RAYUJODN.mjs";
26
26
  import "../chunk-DQ7ZHIXW.mjs";
27
- import "../chunk-MX3L6DSE.mjs";
27
+ import "../chunk-GOWIY4NZ.mjs";
28
28
  import "../chunk-OSSBKFNH.mjs";
29
29
  import "../chunk-7DQBUZXY.mjs";
30
30
  import {
package/dist/index.cjs CHANGED
@@ -123,7 +123,6 @@ __export(index_exports, {
123
123
  INITIAL_BILLING_CATALOG: () => INITIAL_BILLING_CATALOG,
124
124
  IOS_URL: () => IOS_URL,
125
125
  ImageTypeEnum: () => ImageTypeEnum,
126
- KNOWN_EVENT_SCHEDULE_STATUSES: () => KNOWN_EVENT_SCHEDULE_STATUSES,
127
126
  LicenceExpiryDate: () => LicenceExpiryDate,
128
127
  MY_PENDING_VENDOR_CLAIM: () => MY_PENDING_VENDOR_CLAIM,
129
128
  NETWORK_USER_FACING_ERROR: () => NETWORK_USER_FACING_ERROR,
@@ -1859,11 +1858,6 @@ var SCHOOL_MAX_STUDENT_COUNT = 0;
1859
1858
 
1860
1859
  // src/calendar/eventCalendar.ts
1861
1860
  var import_dayjs2 = __toESM(require("dayjs"));
1862
- var KNOWN_EVENT_SCHEDULE_STATUSES = /* @__PURE__ */ new Set([
1863
- "Started" /* STARTED */,
1864
- "Starting_Soon" /* STARTING_SOON */,
1865
- "Ended" /* ENDED */
1866
- ]);
1867
1861
  function toCalendarIsoDate(startDate) {
1868
1862
  const formatted = (0, import_dayjs2.default)(startDate, dateFormat).format("YYYY-MM-DD");
1869
1863
  return (0, import_dayjs2.default)(formatted, "YYYY-MM-DD", true).isValid() ? formatted : null;
@@ -1896,8 +1890,20 @@ function getEventScheduleStatusTone(status) {
1896
1890
  return "started";
1897
1891
  case "Starting_Soon" /* STARTING_SOON */:
1898
1892
  return "startingSoon";
1893
+ case "Today" /* TODAY */:
1894
+ case "Tomorrow" /* TOMORROW */:
1895
+ case "This_Week" /* THIS_WEEK */:
1896
+ case "Next_Week" /* NEXT_WEEK */:
1897
+ case "Upcoming" /* UPCOMING */:
1898
+ return "upcoming";
1899
1899
  case "Ended" /* ENDED */:
1900
1900
  return "ended";
1901
+ case "Canceled" /* CANCELED */:
1902
+ return "canceled";
1903
+ case "Rescheduled" /* RE_SCHEDULED */:
1904
+ return "rescheduled";
1905
+ case "Invalid" /* INVALID */:
1906
+ return "invalid";
1901
1907
  default:
1902
1908
  return "default";
1903
1909
  }
@@ -1909,15 +1915,12 @@ function getEventScheduleStatusPresentation(dateTime) {
1909
1915
  tone: getEventScheduleStatusTone(dateTime.dateStatus)
1910
1916
  };
1911
1917
  }
1912
- function getEventScheduleStatusLabel(dateTime, onlyShowKnownStatuses) {
1918
+ function getEventScheduleStatusLabel(dateTime) {
1913
1919
  const { dateStatus: status } = dateTime;
1914
- const isKnownStatus = Boolean(
1915
- status && KNOWN_EVENT_SCHEDULE_STATUSES.has(status)
1916
- );
1917
- if (onlyShowKnownStatuses && !isKnownStatus) {
1920
+ if (!status) {
1918
1921
  return null;
1919
1922
  }
1920
- return isKnownStatus ? status.replaceAll("_", " ").toLowerCase() : `Next event date: ${formatDate(dateTime.startDate, "date")}`;
1923
+ return status.replaceAll("_", " ").toLowerCase();
1921
1924
  }
1922
1925
  function shouldShowEventActionsWithWeather(resourceType, dateTime, location) {
1923
1926
  return resourceType === "event" /* EVENT */ && Boolean(location) && Boolean(dateTime?.dateStatus) && !["Ended" /* ENDED */, "Canceled" /* CANCELED */].includes(
@@ -6275,7 +6278,11 @@ var useGetEvent = (_id) => {
6275
6278
  };
6276
6279
  var useGetOwnedEvent = (_id, options) => {
6277
6280
  const { loading, error, data, refetch } = (0, import_client25.useQuery)(GET_OWNED_EVENT, {
6278
- fetchPolicy: "network-only",
6281
+ // `ownedEvent(futureOnly)` is a projection-specific view of EventType.
6282
+ // If this writes into normalized EventType cache, other queries like
6283
+ // `getEvent` (which can include archived dates) can overwrite `dateTime`
6284
+ // for the same entity id and leak into edit screens. Keep it uncached.
6285
+ fetchPolicy: "no-cache",
6279
6286
  skip: !_id,
6280
6287
  variables: { _id, futureOnly: options?.futureOnly ?? false }
6281
6288
  });
@@ -10084,7 +10091,6 @@ function canAccessAdminPath(roles, pathname) {
10084
10091
  INITIAL_BILLING_CATALOG,
10085
10092
  IOS_URL,
10086
10093
  ImageTypeEnum,
10087
- KNOWN_EVENT_SCHEDULE_STATUSES,
10088
10094
  LicenceExpiryDate,
10089
10095
  MY_PENDING_VENDOR_CLAIM,
10090
10096
  NETWORK_USER_FACING_ERROR,