kaafil-react-uikit 0.8.0 → 0.10.0

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 (61) hide show
  1. package/CHANGELOG.md +88 -0
  2. package/dist/admin/index.cjs +476 -362
  3. package/dist/admin/index.cjs.map +1 -1
  4. package/dist/admin/index.d.cts +112 -14
  5. package/dist/admin/index.d.ts +112 -14
  6. package/dist/admin/index.js +136 -22
  7. package/dist/admin/index.js.map +1 -1
  8. package/dist/{chunk-Q4B25EZO.js → chunk-2HGOHUFU.js} +3 -3
  9. package/dist/{chunk-Q4B25EZO.js.map → chunk-2HGOHUFU.js.map} +1 -1
  10. package/dist/{chunk-TDFM563X.cjs → chunk-AJEZMD64.cjs} +12 -12
  11. package/dist/{chunk-TDFM563X.cjs.map → chunk-AJEZMD64.cjs.map} +1 -1
  12. package/dist/{chunk-PQJGV3RE.cjs → chunk-APE4R2GB.cjs} +86 -86
  13. package/dist/chunk-APE4R2GB.cjs.map +1 -0
  14. package/dist/{chunk-7COMKJTM.cjs → chunk-BKDKXM3L.cjs} +11 -11
  15. package/dist/{chunk-7COMKJTM.cjs.map → chunk-BKDKXM3L.cjs.map} +1 -1
  16. package/dist/{chunk-7O3TPYK4.cjs → chunk-E6SI2S3L.cjs} +17 -17
  17. package/dist/{chunk-7O3TPYK4.cjs.map → chunk-E6SI2S3L.cjs.map} +1 -1
  18. package/dist/{chunk-YHGAFRN6.js → chunk-IDKRXLMY.js} +3 -3
  19. package/dist/{chunk-YHGAFRN6.js.map → chunk-IDKRXLMY.js.map} +1 -1
  20. package/dist/{chunk-4R7QBTNL.cjs → chunk-LYCN2BOH.cjs} +4 -4
  21. package/dist/{chunk-4R7QBTNL.cjs.map → chunk-LYCN2BOH.cjs.map} +1 -1
  22. package/dist/{chunk-57DYMIWS.js → chunk-OXCVTVBY.js} +5 -5
  23. package/dist/{chunk-57DYMIWS.js.map → chunk-OXCVTVBY.js.map} +1 -1
  24. package/dist/{chunk-ASFUY3IE.cjs → chunk-P5HF55MO.cjs} +12 -8
  25. package/dist/chunk-P5HF55MO.cjs.map +1 -0
  26. package/dist/chunk-PHVQIIOI.cjs +12 -0
  27. package/dist/{chunk-LBTAK5JA.cjs.map → chunk-PHVQIIOI.cjs.map} +1 -1
  28. package/dist/{chunk-VU5BCK2P.js → chunk-U2443I5Q.js} +6 -6
  29. package/dist/chunk-U2443I5Q.js.map +1 -0
  30. package/dist/{chunk-DYOAKTGJ.js → chunk-UMLJEBQV.js} +5 -5
  31. package/dist/{chunk-DYOAKTGJ.js.map → chunk-UMLJEBQV.js.map} +1 -1
  32. package/dist/{chunk-GKR52SVU.js → chunk-VAUGZOY6.js} +3 -3
  33. package/dist/{chunk-GKR52SVU.js.map → chunk-VAUGZOY6.js.map} +1 -1
  34. package/dist/{chunk-ZURCZQQ7.js → chunk-WMBFBZ7Q.js} +12 -8
  35. package/dist/chunk-WMBFBZ7Q.js.map +1 -0
  36. package/dist/{chunk-MP4IMAPF.cjs → chunk-X5EFVCYF.cjs} +55 -55
  37. package/dist/{chunk-MP4IMAPF.cjs.map → chunk-X5EFVCYF.cjs.map} +1 -1
  38. package/dist/{chunk-E3KOQYY2.js → chunk-ZVADVALQ.js} +5 -5
  39. package/dist/{chunk-E3KOQYY2.js.map → chunk-ZVADVALQ.js.map} +1 -1
  40. package/dist/core/index.cjs +107 -107
  41. package/dist/core/index.js +10 -10
  42. package/dist/manager/index.cjs +376 -264
  43. package/dist/manager/index.cjs.map +1 -1
  44. package/dist/manager/index.d.cts +152 -20
  45. package/dist/manager/index.d.ts +152 -20
  46. package/dist/manager/index.js +143 -31
  47. package/dist/manager/index.js.map +1 -1
  48. package/dist/offline/index.cjs +123 -0
  49. package/dist/offline/index.cjs.map +1 -0
  50. package/dist/offline/index.d.cts +177 -0
  51. package/dist/offline/index.d.ts +177 -0
  52. package/dist/offline/index.js +119 -0
  53. package/dist/offline/index.js.map +1 -0
  54. package/dist/traveller/index.cjs +35 -35
  55. package/dist/traveller/index.js +5 -5
  56. package/package.json +6 -1
  57. package/dist/chunk-ASFUY3IE.cjs.map +0 -1
  58. package/dist/chunk-LBTAK5JA.cjs +0 -12
  59. package/dist/chunk-PQJGV3RE.cjs.map +0 -1
  60. package/dist/chunk-VU5BCK2P.js.map +0 -1
  61. package/dist/chunk-ZURCZQQ7.js.map +0 -1
@@ -1,8 +1,8 @@
1
- import { useAgencySettings, useAgencyChecklistTemplates, useAgencyForms, useAgencyManagerProfile, useAgencyJourneyTriggers, useBookings, useDirectories, useCapabilityStatuses, useAgencyTrip, useAgencyAdminMe, useTravellerFormResponses, useBuildShareUrl, familySafeSections, useShareLinks, usePaginatedList, useAgencyTrips, useAgencyTripManifest, resolveBlockerDeepLink } from '../chunk-57DYMIWS.js';
2
- import { useChecklists, useFiles, useExpenses, useVendors, useFloat, useManagers, useForms, useItinerary, useCollections, useParties, usePickups, useRooming, useSeating, classifyError, useTravellerProfile, roomingHeuristicSeverity, useManagerToday, useCloseout, parseRoomingTone, TONE_FAMILIES, SHADES_PER_FAMILY, FALLBACK_GLYPH } from '../chunk-VU5BCK2P.js';
3
- import '../chunk-GKR52SVU.js';
4
- export { BootErrorScreen, LockedTripScreen, NotFoundScreen, OfflineFallbackScreen, PlanLockedScreen, SessionExpiredScreen } from '../chunk-YHGAFRN6.js';
5
- import { createRegistry, useKaafilChrome, tokenStyle, useSession, useKaafilClient } from '../chunk-ZURCZQQ7.js';
1
+ import { useAgencySettings, useAgencyChecklistTemplates, useAgencyForms, useAgencyManagerProfile, useAgencyJourneyTriggers, useBookings, useDirectories, useCapabilityStatuses, useAgencyTrip, useAgencyAdminMe, useTravellerFormResponses, useBuildShareUrl, familySafeSections, useShareLinks, usePaginatedList, useAgencyTrips, useAgencyTripManifest, resolveBlockerDeepLink } from '../chunk-OXCVTVBY.js';
2
+ import { useChecklists, useFiles, useExpenses, useVendors, useFloat, useManagers, useForms, useItinerary, useCollections, useParties, usePickups, useRooming, useSeating, classifyError, useTravellerProfile, roomingHeuristicSeverity, useManagerToday, useCloseout, parseRoomingTone, TONE_FAMILIES, SHADES_PER_FAMILY, FALLBACK_GLYPH } from '../chunk-U2443I5Q.js';
3
+ import '../chunk-VAUGZOY6.js';
4
+ export { BootErrorScreen, LockedTripScreen, NotFoundScreen, OfflineFallbackScreen, PlanLockedScreen, SessionExpiredScreen } from '../chunk-IDKRXLMY.js';
5
+ import { createRegistry, useSession, useKaafilChrome, tokenStyle, useKaafilClient, isDevelopment } from '../chunk-WMBFBZ7Q.js';
6
6
  import { useState, useEffect, useCallback, useMemo, useId, useRef, Children } from 'react';
7
7
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
8
8
 
@@ -997,7 +997,14 @@ function orderSectionsByCustomized(sections, isCustomized) {
997
997
  ...sections.filter((section) => !isCustomized(section))
998
998
  ];
999
999
  }
1000
- function AgencySettingsScreen({
1000
+ function AgencySettingsScreen(props) {
1001
+ const session = useSession();
1002
+ if (session.status !== "authenticated") {
1003
+ return null;
1004
+ }
1005
+ return /* @__PURE__ */ jsx(ReadyAgencySettingsScreen, { ...props });
1006
+ }
1007
+ function ReadyAgencySettingsScreen({
1001
1008
  title,
1002
1009
  subtitle,
1003
1010
  components,
@@ -7657,7 +7664,14 @@ function voucherCount(row) {
7657
7664
  return row.voucherFileKeys?.length ?? 0;
7658
7665
  }
7659
7666
  var DAY = { day: "numeric", month: "short", year: "numeric" };
7660
- function TripBookingsSection({
7667
+ function TripBookingsSection(props) {
7668
+ const session = useSession();
7669
+ if (session.status !== "authenticated") {
7670
+ return null;
7671
+ }
7672
+ return /* @__PURE__ */ jsx(ReadyTripBookingsSection, { ...props });
7673
+ }
7674
+ function ReadyTripBookingsSection({
7661
7675
  tripRef,
7662
7676
  onOpenDocuments,
7663
7677
  style
@@ -8459,7 +8473,14 @@ function codeOf(error) {
8459
8473
  const classification = error !== null && typeof error === "object" && "classification" in error ? error.classification : void 0;
8460
8474
  return classification?.code ?? "unknown";
8461
8475
  }
8462
- function TripChecklistSection({
8476
+ function TripChecklistSection(props) {
8477
+ const session = useSession();
8478
+ if (session.status !== "authenticated") {
8479
+ return null;
8480
+ }
8481
+ return /* @__PURE__ */ jsx(ReadyTripChecklistSection, { ...props });
8482
+ }
8483
+ function ReadyTripChecklistSection({
8463
8484
  tripRef,
8464
8485
  readOnly = false,
8465
8486
  initialPhase,
@@ -10036,7 +10057,14 @@ function UploadDialog({
10036
10057
  }
10037
10058
  );
10038
10059
  }
10039
- function TripDocumentsSection({ tripRef, style }) {
10060
+ function TripDocumentsSection(props) {
10061
+ const session = useSession();
10062
+ if (session.status !== "authenticated") {
10063
+ return null;
10064
+ }
10065
+ return /* @__PURE__ */ jsx(ReadyTripDocumentsSection, { ...props });
10066
+ }
10067
+ function ReadyTripDocumentsSection({ tripRef, style }) {
10040
10068
  const { t } = useKaafilChrome();
10041
10069
  const files = useFiles({ tripRef });
10042
10070
  const expenses = useExpenses(tripRef);
@@ -10888,7 +10916,14 @@ function isCloseoutLocked2(error) {
10888
10916
  const classification = error.classification;
10889
10917
  return classification?.status === 423 || classification?.code === "TRIP_CLOSED_OUT";
10890
10918
  }
10891
- function TripExpensesSection({ tripRef, style }) {
10919
+ function TripExpensesSection(props) {
10920
+ const session = useSession();
10921
+ if (session.status !== "authenticated") {
10922
+ return null;
10923
+ }
10924
+ return /* @__PURE__ */ jsx(ReadyTripExpensesSection, { ...props });
10925
+ }
10926
+ function ReadyTripExpensesSection({ tripRef, style }) {
10892
10927
  const { t } = useKaafilChrome();
10893
10928
  const expenses = useExpenses(tripRef);
10894
10929
  const vendors = useVendors(tripRef, "");
@@ -11718,7 +11753,14 @@ function refusedBalanceOf(error) {
11718
11753
  const details = error.details;
11719
11754
  return details?.currentBalanceMinor;
11720
11755
  }
11721
- function TripFloatSection({ tripRef, style }) {
11756
+ function TripFloatSection(props) {
11757
+ const session = useSession();
11758
+ if (session.status !== "authenticated") {
11759
+ return null;
11760
+ }
11761
+ return /* @__PURE__ */ jsx(ReadyTripFloatSection, { ...props });
11762
+ }
11763
+ function ReadyTripFloatSection({ tripRef, style }) {
11722
11764
  const { t } = useKaafilChrome();
11723
11765
  const float = useFloat(tripRef);
11724
11766
  const managers = useManagers(tripRef);
@@ -12444,7 +12486,14 @@ function codeOf4(error) {
12444
12486
  const classification = error !== null && typeof error === "object" && "classification" in error ? error.classification : void 0;
12445
12487
  return classification?.code ?? "unknown";
12446
12488
  }
12447
- function TripFormsSection({
12489
+ function TripFormsSection(props) {
12490
+ const session = useSession();
12491
+ if (session.status !== "authenticated") {
12492
+ return null;
12493
+ }
12494
+ return /* @__PURE__ */ jsx(ReadyTripFormsSection, { ...props });
12495
+ }
12496
+ function ReadyTripFormsSection({
12448
12497
  tripRef,
12449
12498
  readOnly = false,
12450
12499
  components,
@@ -13843,7 +13892,14 @@ function codeOf5(error) {
13843
13892
  const classification = error !== null && typeof error === "object" && "classification" in error ? error.classification : void 0;
13844
13893
  return classification?.code ?? "unknown";
13845
13894
  }
13846
- function TripItinerarySection({
13895
+ function TripItinerarySection(props) {
13896
+ const session = useSession();
13897
+ if (session.status !== "authenticated") {
13898
+ return null;
13899
+ }
13900
+ return /* @__PURE__ */ jsx(ReadyTripItinerarySection, { ...props });
13901
+ }
13902
+ function ReadyTripItinerarySection({
13847
13903
  tripRef,
13848
13904
  onOpenVendor,
13849
13905
  style
@@ -15524,6 +15580,14 @@ function shareAddress(build, token) {
15524
15580
  return token;
15525
15581
  }
15526
15582
  }
15583
+ var warnedNoShareUrl = false;
15584
+ function warnMissingShareUrl() {
15585
+ if (warnedNoShareUrl || !isDevelopment()) return;
15586
+ warnedNoShareUrl = true;
15587
+ console.warn(
15588
+ "[kaafil-react-uikit] No `buildShareUrl` on <KaafilUIKitProvider>, so the share dialog is showing operators a bare token instead of a sendable address. Kaafil returns a token, never a URL \u2014 the traveller page is on your domain. Fix: buildShareUrl={(token) => `${window.location.origin}/share/${token}`}"
15589
+ );
15590
+ }
15527
15591
  function ShareLinkDialog({
15528
15592
  tripRef,
15529
15593
  travellerRef,
@@ -15533,6 +15597,8 @@ function ShareLinkDialog({
15533
15597
  const { t } = useKaafilChrome();
15534
15598
  const titleId = useId();
15535
15599
  const buildShareUrl = useBuildShareUrl();
15600
+ const showsBareToken = buildShareUrl === null;
15601
+ if (showsBareToken) warnMissingShareUrl();
15536
15602
  const isFamily = travellerRef === null;
15537
15603
  const offerable = familySafeSections(isFamily);
15538
15604
  const { links, readFailed, mint, revoke, regenerate, reveal } = useShareLinks(
@@ -15644,7 +15710,9 @@ function ShareLinkDialog({
15644
15710
  readOnly: true,
15645
15711
  className: "kf-trip-manifest-section__minted-token",
15646
15712
  value: shareAddress(buildShareUrl, minted.token),
15647
- "aria-label": t("chrome.tripManifest.mintedTokenLabel"),
15713
+ "aria-label": t(
15714
+ showsBareToken ? "chrome.tripManifest.mintedTokenLabelCode" : "chrome.tripManifest.mintedTokenLabel"
15715
+ ),
15648
15716
  onFocus: (event) => event.currentTarget.select()
15649
15717
  }
15650
15718
  ),
@@ -15657,6 +15725,7 @@ function ShareLinkDialog({
15657
15725
  children: copied ? t("chrome.tripManifest.copied") : t("chrome.tripManifest.copy")
15658
15726
  }
15659
15727
  ),
15728
+ showsBareToken ? /* @__PURE__ */ jsx("p", { className: "kf-trip-manifest-section__dialog-note", children: t("chrome.tripManifest.noShareUrlHint") }) : null,
15660
15729
  minted.expiresAt === null ? null : /* @__PURE__ */ jsx("p", { className: "kf-trip-manifest-section__dialog-note", children: t("chrome.tripManifest.mintedExpiresAt").replace(
15661
15730
  "{date}",
15662
15731
  formatDay(minted.expiresAt, FULL_DATE_OPTS)
@@ -15804,7 +15873,9 @@ function ShareLinkDialog({
15804
15873
  readOnly: true,
15805
15874
  className: "kf-trip-manifest-section__minted-token",
15806
15875
  value: shareAddress(buildShareUrl, String(revealed[link.id])),
15807
- "aria-label": t("chrome.tripManifest.mintedTokenLabel"),
15876
+ "aria-label": t(
15877
+ showsBareToken ? "chrome.tripManifest.mintedTokenLabelCode" : "chrome.tripManifest.mintedTokenLabel"
15878
+ ),
15808
15879
  onFocus: (event) => event.currentTarget.select()
15809
15880
  }
15810
15881
  ),
@@ -15816,7 +15887,8 @@ function ShareLinkDialog({
15816
15887
  onClick: () => void copy(shareAddress(buildShareUrl, String(revealed[link.id]))),
15817
15888
  children: copied ? t("chrome.tripManifest.copied") : t("chrome.tripManifest.copy")
15818
15889
  }
15819
- )
15890
+ ),
15891
+ showsBareToken ? /* @__PURE__ */ jsx("span", { className: "kf-trip-manifest-section__dialog-note", children: t("chrome.tripManifest.noShareUrlHint") }) : null
15820
15892
  ] }) })
15821
15893
  ] }, link.id)) })
15822
15894
  ] })
@@ -16785,7 +16857,14 @@ function isCloseoutLocked4(error) {
16785
16857
  const classification = error.classification;
16786
16858
  return classification?.status === 423 || classification?.code === "TRIP_CLOSED_OUT";
16787
16859
  }
16788
- function TripPaymentsSection({
16860
+ function TripPaymentsSection(props) {
16861
+ const session = useSession();
16862
+ if (session.status !== "authenticated") {
16863
+ return null;
16864
+ }
16865
+ return /* @__PURE__ */ jsx(ReadyTripPaymentsSection, { ...props });
16866
+ }
16867
+ function ReadyTripPaymentsSection({
16789
16868
  tripRef,
16790
16869
  balance,
16791
16870
  style
@@ -17916,7 +17995,14 @@ function codeOf7(error) {
17916
17995
  const classification = error !== null && typeof error === "object" && "classification" in error ? error.classification : void 0;
17917
17996
  return classification?.code ?? "unknown";
17918
17997
  }
17919
- function TripPickupsSection({
17998
+ function TripPickupsSection(props) {
17999
+ const session = useSession();
18000
+ if (session.status !== "authenticated") {
18001
+ return null;
18002
+ }
18003
+ return /* @__PURE__ */ jsx(ReadyTripPickupsSection, { ...props });
18004
+ }
18005
+ function ReadyTripPickupsSection({
17920
18006
  tripRef,
17921
18007
  timeZone,
17922
18008
  tripStartIso,
@@ -19391,7 +19477,14 @@ function codeOf8(error) {
19391
19477
  const classification = error !== null && typeof error === "object" && "classification" in error ? error.classification : void 0;
19392
19478
  return classification?.code ?? "unknown";
19393
19479
  }
19394
- function TripRoomingSection({
19480
+ function TripRoomingSection(props) {
19481
+ const session = useSession();
19482
+ if (session.status !== "authenticated") {
19483
+ return null;
19484
+ }
19485
+ return /* @__PURE__ */ jsx(ReadyTripRoomingSection, { ...props });
19486
+ }
19487
+ function ReadyTripRoomingSection({
19395
19488
  tripRef,
19396
19489
  timeZone,
19397
19490
  tripStartIso,
@@ -20307,7 +20400,14 @@ function serverBlockOf(error) {
20307
20400
  if (details?.rule !== "vendor.deleteBlockedByReferences") return void 0;
20308
20401
  return { vehicles: details.vehicleCount ?? 0, expenses: details.expenseCount ?? 0 };
20309
20402
  }
20310
- function TripSuppliersSection({ tripRef, style }) {
20403
+ function TripSuppliersSection(props) {
20404
+ const session = useSession();
20405
+ if (session.status !== "authenticated") {
20406
+ return null;
20407
+ }
20408
+ return /* @__PURE__ */ jsx(ReadyTripSuppliersSection, { ...props });
20409
+ }
20410
+ function ReadyTripSuppliersSection({ tripRef, style }) {
20311
20411
  const { t } = useKaafilChrome();
20312
20412
  const vendors = useVendors(tripRef, "");
20313
20413
  const seating = useSeating(tripRef);
@@ -21831,7 +21931,14 @@ function codeOf10(error) {
21831
21931
  const classification = error !== null && typeof error === "object" && "classification" in error ? error.classification : void 0;
21832
21932
  return classification?.code ?? "unknown";
21833
21933
  }
21834
- function TripVehiclesSection({
21934
+ function TripVehiclesSection(props) {
21935
+ const session = useSession();
21936
+ if (session.status !== "authenticated") {
21937
+ return null;
21938
+ }
21939
+ return /* @__PURE__ */ jsx(ReadyTripVehiclesSection, { ...props });
21940
+ }
21941
+ function ReadyTripVehiclesSection({
21835
21942
  tripRef,
21836
21943
  durationDays,
21837
21944
  style
@@ -23234,7 +23341,14 @@ function TripWorkspaceHead({ trip, onBack, style }) {
23234
23341
  ] })
23235
23342
  ] }) });
23236
23343
  }
23237
- function TripWorkspace({
23344
+ function TripWorkspace(props) {
23345
+ const session = useSession();
23346
+ if (session.status !== "authenticated") {
23347
+ return /* @__PURE__ */ jsx(TripWorkspaceSkeleton, {});
23348
+ }
23349
+ return /* @__PURE__ */ jsx(ReadyTripWorkspace, { ...props });
23350
+ }
23351
+ function ReadyTripWorkspace({
23238
23352
  tripRef,
23239
23353
  initialTab,
23240
23354
  onBack,