kaafil-react-uikit 0.7.0 → 0.8.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 (49) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/dist/admin/index.cjs +468 -446
  3. package/dist/admin/index.cjs.map +1 -1
  4. package/dist/admin/index.js +128 -106
  5. package/dist/admin/index.js.map +1 -1
  6. package/dist/{chunk-53ITV6GF.cjs → chunk-4R7QBTNL.cjs} +4 -4
  7. package/dist/{chunk-53ITV6GF.cjs.map → chunk-4R7QBTNL.cjs.map} +1 -1
  8. package/dist/{chunk-HNENKHHJ.js → chunk-57DYMIWS.js} +5 -5
  9. package/dist/{chunk-HNENKHHJ.js.map → chunk-57DYMIWS.js.map} +1 -1
  10. package/dist/{chunk-XPF737RG.cjs → chunk-7COMKJTM.cjs} +9 -9
  11. package/dist/{chunk-XPF737RG.cjs.map → chunk-7COMKJTM.cjs.map} +1 -1
  12. package/dist/{chunk-OOHU3ECL.cjs → chunk-7O3TPYK4.cjs} +17 -17
  13. package/dist/{chunk-OOHU3ECL.cjs.map → chunk-7O3TPYK4.cjs.map} +1 -1
  14. package/dist/{chunk-4QMYUKW4.cjs → chunk-ASFUY3IE.cjs} +5368 -5358
  15. package/dist/chunk-ASFUY3IE.cjs.map +1 -0
  16. package/dist/{chunk-CJMUPBZ7.js → chunk-DYOAKTGJ.js} +5 -5
  17. package/dist/{chunk-CJMUPBZ7.js.map → chunk-DYOAKTGJ.js.map} +1 -1
  18. package/dist/{chunk-JHLPO6LZ.js → chunk-E3KOQYY2.js} +3 -3
  19. package/dist/{chunk-JHLPO6LZ.js.map → chunk-E3KOQYY2.js.map} +1 -1
  20. package/dist/{chunk-F6B4CDUL.js → chunk-GKR52SVU.js} +3 -3
  21. package/dist/{chunk-F6B4CDUL.js.map → chunk-GKR52SVU.js.map} +1 -1
  22. package/dist/chunk-LBTAK5JA.cjs +12 -0
  23. package/dist/{chunk-V45VFRBI.cjs.map → chunk-LBTAK5JA.cjs.map} +1 -1
  24. package/dist/{chunk-77RKNRNH.cjs → chunk-MP4IMAPF.cjs} +55 -55
  25. package/dist/{chunk-77RKNRNH.cjs.map → chunk-MP4IMAPF.cjs.map} +1 -1
  26. package/dist/{chunk-AWOKWGTB.cjs → chunk-PQJGV3RE.cjs} +83 -83
  27. package/dist/{chunk-AWOKWGTB.cjs.map → chunk-PQJGV3RE.cjs.map} +1 -1
  28. package/dist/{chunk-F6YBM6EE.js → chunk-Q4B25EZO.js} +3 -3
  29. package/dist/{chunk-F6YBM6EE.js.map → chunk-Q4B25EZO.js.map} +1 -1
  30. package/dist/{chunk-XPCCR7OH.cjs → chunk-TDFM563X.cjs} +12 -12
  31. package/dist/{chunk-XPCCR7OH.cjs.map → chunk-TDFM563X.cjs.map} +1 -1
  32. package/dist/{chunk-PWZNUXKT.js → chunk-VU5BCK2P.js} +3 -3
  33. package/dist/{chunk-PWZNUXKT.js.map → chunk-VU5BCK2P.js.map} +1 -1
  34. package/dist/{chunk-4BPCKBLP.js → chunk-YHGAFRN6.js} +3 -3
  35. package/dist/{chunk-4BPCKBLP.js.map → chunk-YHGAFRN6.js.map} +1 -1
  36. package/dist/{chunk-SEPFCHBJ.js → chunk-ZURCZQQ7.js} +5368 -5358
  37. package/dist/chunk-ZURCZQQ7.js.map +1 -0
  38. package/dist/core/index.cjs +107 -107
  39. package/dist/core/index.js +10 -10
  40. package/dist/index.css +1 -1
  41. package/dist/manager/index.cjs +239 -239
  42. package/dist/manager/index.js +6 -6
  43. package/dist/tokens.json +7 -1
  44. package/dist/traveller/index.cjs +35 -35
  45. package/dist/traveller/index.js +5 -5
  46. package/package.json +1 -1
  47. package/dist/chunk-4QMYUKW4.cjs.map +0 -1
  48. package/dist/chunk-SEPFCHBJ.js.map +0 -1
  49. package/dist/chunk-V45VFRBI.cjs +0 -12
@@ -1,11 +1,11 @@
1
1
  'use strict';
2
2
 
3
- var chunk4QMYUKW4_cjs = require('./chunk-4QMYUKW4.cjs');
3
+ var chunkASFUY3IE_cjs = require('./chunk-ASFUY3IE.cjs');
4
4
  var react = require('react');
5
5
 
6
6
  var TICK_INTERVAL_MS = 1e3;
7
7
  function useServerTime() {
8
- const engine = react.useContext(chunk4QMYUKW4_cjs.OfflineEngineContext);
8
+ const engine = react.useContext(chunkASFUY3IE_cjs.OfflineEngineContext);
9
9
  const [lastServerTime, setLastServerTime] = react.useState(void 0);
10
10
  const observedAtPerfRef = react.useRef(void 0);
11
11
  const [, forceTick] = react.useState(0);
@@ -39,5 +39,5 @@ function useServerTime() {
39
39
  }
40
40
 
41
41
  exports.useServerTime = useServerTime;
42
- //# sourceMappingURL=chunk-53ITV6GF.cjs.map
43
- //# sourceMappingURL=chunk-53ITV6GF.cjs.map
42
+ //# sourceMappingURL=chunk-4R7QBTNL.cjs.map
43
+ //# sourceMappingURL=chunk-4R7QBTNL.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/core/hooks/useServerTime.ts"],"names":["useContext","OfflineEngineContext","useState","useRef","useEffect"],"mappings":";;;;;AA8BA,IAAM,gBAAA,GAAmB,GAAA;AAElB,SAAS,aAAA,GAA+B;AAC7C,EAAA,MAAM,MAAA,GAASA,iBAAWC,sCAAoB,CAAA;AAC9C,EAAA,MAAM,CAAC,cAAA,EAAgB,iBAAiB,CAAA,GAAIC,eAA6B,MAAS,CAAA;AAClF,EAAA,MAAM,iBAAA,GAAoBC,aAA2B,MAAS,CAAA;AAC9D,EAAA,MAAM,GAAG,SAAS,CAAA,GAAID,eAAS,CAAC,CAAA;AAEhC,EAAAE,eAAA,CAAU,MAAM;AACd,IAAA,IAAI,WAAW,IAAA,EAAM;AACnB,MAAA;AAAA,IACF;AAKA,IAAA,MAAM,cAAc,MAAA,CAAO,MAAA,CAAO,EAAA,CAAG,kBAAA,EAAoB,CAAC,KAAA,KAAU;AASlE,MAAA,IAAI,KAAA,CAAM,eAAe,MAAA,EAAW;AAClC,QAAA;AAAA,MACF;AACA,MAAA,iBAAA,CAAkB,OAAA,GAAU,YAAY,GAAA,EAAI;AAC5C,MAAA,iBAAA,CAAkB,MAAM,UAAU,CAAA;AAAA,IACpC,CAAC,CAAA;AACD,IAAA,OAAO,WAAA;AAAA,EACT,CAAA,EAAG,CAAC,MAAM,CAAC,CAAA;AAEX,EAAAA,eAAA,CAAU,MAAM;AACd,IAAA,MAAM,EAAA,GAAK,YAAY,MAAM,SAAA,CAAU,CAAC,IAAA,KAAS,IAAA,GAAO,CAAC,CAAA,EAAG,gBAAgB,CAAA;AAC5E,IAAA,OAAO,MAAM,cAAc,EAAE,CAAA;AAAA,EAC/B,CAAA,EAAG,EAAE,CAAA;AAEL,EAAA,SAAS,GAAA,GAAc;AACrB,IAAA,IAAI,cAAA,KAAmB,MAAA,IAAa,iBAAA,CAAkB,OAAA,KAAY,MAAA,EAAW;AAY3E,MAAA,MAAM,IAAI,KAAA;AAAA,QACR;AAAA,OAEF;AAAA,IACF;AACA,IAAA,MAAM,SAAA,GAAY,WAAA,CAAY,GAAA,EAAI,GAAI,iBAAA,CAAkB,OAAA;AACxD,IAAA,OAAO,IAAI,KAAK,IAAA,CAAK,KAAA,CAAM,cAAc,CAAA,GAAI,SAAS,EAAE,WAAA,EAAY;AAAA,EACtE;AAEA,EAAA,OAAO,EAAE,GAAA,EAAK,aAAA,EAAe,cAAA,EAAe;AAC9C","file":"chunk-53ITV6GF.cjs","sourcesContent":["'use client';\n\n// `08-core-hooks.md §1.6`. The single place that turns the stream of\n// `meta.serverTime` stamps into a usable clock, so no composite reads\n// `meta.serverTime` off an individual response by hand.\n//\n// Hard rule #6 (\"Zero `Date.now()`/`new Date()` local getters in\n// `src/core`\") bans exactly the two calls that fabricate \"now\" from the\n// local wall clock: `Date.now()` and no-argument `new Date()`. This file\n// never calls either. Advancing a SERVER-supplied timestamp by an elapsed\n// delta necessarily needs SOME measure of \"how much local time passed\" —\n// this file measures that with `performance.now()`, a monotonic clock with\n// no relationship to wall-clock \"now\" (it cannot be read as a date, only as\n// a duration), and applies the delta with `new Date(<epoch-ms>)` /\n// `Date.parse(<iso-string>)` — both single-argument forms that operate on a\n// value already anchored to `meta.serverTime`, never on the local clock.\n\nimport { useContext, useEffect, useRef, useState } from 'react';\nimport { OfflineEngineContext } from '../internal/contexts';\n\nexport interface ServerTimeApi {\n now: () => string;\n sinceLastSync: string | undefined;\n}\n\n/** Re-renders any hook consumer often enough for a mounted countdown to look\n * live, without pretending the underlying value moved forward on its own\n * merits (`08-core-hooks.md §1.6`'s sandbox time-travel caveat: this timer\n * forces a re-render, it never advances the stamp past what the last real\n * response justified). */\nconst TICK_INTERVAL_MS = 1000;\n\nexport function useServerTime(): ServerTimeApi {\n const engine = useContext(OfflineEngineContext);\n const [lastServerTime, setLastServerTime] = useState<string | undefined>(undefined);\n const observedAtPerfRef = useRef<number | undefined>(undefined);\n const [, forceTick] = useState(0);\n\n useEffect(() => {\n if (engine === null) {\n return;\n }\n // `snapshot.updated` is the one event in `OfflineEventMap` that carries\n // `serverTime` (`kaafil-js/src/offline/events.ts`, verified this\n // session) — the engine's other five events do not, so this is the only\n // subscription this hook can build without inventing a stamp.\n const unsubscribe = engine.events.on('snapshot.updated', (event) => {\n // `serverTime` is ABSENT on a change that never involved the server —\n // an optimistic create painted while offline, or an op the host\n // discarded (`kaafil-js/src/offline/events.ts`). Those are real snapshot\n // changes and a list must repaint for them, but they carry no reading,\n // and taking `undefined` here would erase the last real one this\n // session had: `now()` would start throwing again mid-session, on a\n // device that HAS heard from the server, because the manager ticked\n // something off out of signal.\n if (event.serverTime === undefined) {\n return;\n }\n observedAtPerfRef.current = performance.now();\n setLastServerTime(event.serverTime);\n });\n return unsubscribe;\n }, [engine]);\n\n useEffect(() => {\n const id = setInterval(() => forceTick((tick) => tick + 1), TICK_INTERVAL_MS);\n return () => clearInterval(id);\n }, []);\n\n function now(): string {\n if (lastServerTime === undefined || observedAtPerfRef.current === undefined) {\n // No response has ever landed in this session yet. Fabricating a\n // value from the local wall clock is exactly what hard rule #6\n // forbids — this is the one case this hook cannot silently satisfy\n // its own non-optional return type, so it says so loudly instead.\n // CALLERS: this is a real, expected window — React runs an effect\n // (which is how this hook's own subscription above starts) strictly\n // AFTER the render that needs `now()`'s result has already committed,\n // so a component's very FIRST render can hit this throw even when\n // wired up correctly. Guard the call site, matching\n // `useStaleness.ts`'s own precedent, rather than reaching for a\n // device-clock fallback here (hard rule #6 forbids exactly that).\n throw new Error(\n 'useServerTime().now() was called before any response carrying meta.serverTime ' +\n 'had been observed — there is no server timestamp yet to advance from.',\n );\n }\n const elapsedMs = performance.now() - observedAtPerfRef.current;\n return new Date(Date.parse(lastServerTime) + elapsedMs).toISOString();\n }\n\n return { now, sinceLastSync: lastServerTime };\n}\n"]}
1
+ {"version":3,"sources":["../src/core/hooks/useServerTime.ts"],"names":["useContext","OfflineEngineContext","useState","useRef","useEffect"],"mappings":";;;;;AA8BA,IAAM,gBAAA,GAAmB,GAAA;AAElB,SAAS,aAAA,GAA+B;AAC7C,EAAA,MAAM,MAAA,GAASA,iBAAWC,sCAAoB,CAAA;AAC9C,EAAA,MAAM,CAAC,cAAA,EAAgB,iBAAiB,CAAA,GAAIC,eAA6B,MAAS,CAAA;AAClF,EAAA,MAAM,iBAAA,GAAoBC,aAA2B,MAAS,CAAA;AAC9D,EAAA,MAAM,GAAG,SAAS,CAAA,GAAID,eAAS,CAAC,CAAA;AAEhC,EAAAE,eAAA,CAAU,MAAM;AACd,IAAA,IAAI,WAAW,IAAA,EAAM;AACnB,MAAA;AAAA,IACF;AAKA,IAAA,MAAM,cAAc,MAAA,CAAO,MAAA,CAAO,EAAA,CAAG,kBAAA,EAAoB,CAAC,KAAA,KAAU;AASlE,MAAA,IAAI,KAAA,CAAM,eAAe,MAAA,EAAW;AAClC,QAAA;AAAA,MACF;AACA,MAAA,iBAAA,CAAkB,OAAA,GAAU,YAAY,GAAA,EAAI;AAC5C,MAAA,iBAAA,CAAkB,MAAM,UAAU,CAAA;AAAA,IACpC,CAAC,CAAA;AACD,IAAA,OAAO,WAAA;AAAA,EACT,CAAA,EAAG,CAAC,MAAM,CAAC,CAAA;AAEX,EAAAA,eAAA,CAAU,MAAM;AACd,IAAA,MAAM,EAAA,GAAK,YAAY,MAAM,SAAA,CAAU,CAAC,IAAA,KAAS,IAAA,GAAO,CAAC,CAAA,EAAG,gBAAgB,CAAA;AAC5E,IAAA,OAAO,MAAM,cAAc,EAAE,CAAA;AAAA,EAC/B,CAAA,EAAG,EAAE,CAAA;AAEL,EAAA,SAAS,GAAA,GAAc;AACrB,IAAA,IAAI,cAAA,KAAmB,MAAA,IAAa,iBAAA,CAAkB,OAAA,KAAY,MAAA,EAAW;AAY3E,MAAA,MAAM,IAAI,KAAA;AAAA,QACR;AAAA,OAEF;AAAA,IACF;AACA,IAAA,MAAM,SAAA,GAAY,WAAA,CAAY,GAAA,EAAI,GAAI,iBAAA,CAAkB,OAAA;AACxD,IAAA,OAAO,IAAI,KAAK,IAAA,CAAK,KAAA,CAAM,cAAc,CAAA,GAAI,SAAS,EAAE,WAAA,EAAY;AAAA,EACtE;AAEA,EAAA,OAAO,EAAE,GAAA,EAAK,aAAA,EAAe,cAAA,EAAe;AAC9C","file":"chunk-4R7QBTNL.cjs","sourcesContent":["'use client';\n\n// `08-core-hooks.md §1.6`. The single place that turns the stream of\n// `meta.serverTime` stamps into a usable clock, so no composite reads\n// `meta.serverTime` off an individual response by hand.\n//\n// Hard rule #6 (\"Zero `Date.now()`/`new Date()` local getters in\n// `src/core`\") bans exactly the two calls that fabricate \"now\" from the\n// local wall clock: `Date.now()` and no-argument `new Date()`. This file\n// never calls either. Advancing a SERVER-supplied timestamp by an elapsed\n// delta necessarily needs SOME measure of \"how much local time passed\" —\n// this file measures that with `performance.now()`, a monotonic clock with\n// no relationship to wall-clock \"now\" (it cannot be read as a date, only as\n// a duration), and applies the delta with `new Date(<epoch-ms>)` /\n// `Date.parse(<iso-string>)` — both single-argument forms that operate on a\n// value already anchored to `meta.serverTime`, never on the local clock.\n\nimport { useContext, useEffect, useRef, useState } from 'react';\nimport { OfflineEngineContext } from '../internal/contexts';\n\nexport interface ServerTimeApi {\n now: () => string;\n sinceLastSync: string | undefined;\n}\n\n/** Re-renders any hook consumer often enough for a mounted countdown to look\n * live, without pretending the underlying value moved forward on its own\n * merits (`08-core-hooks.md §1.6`'s sandbox time-travel caveat: this timer\n * forces a re-render, it never advances the stamp past what the last real\n * response justified). */\nconst TICK_INTERVAL_MS = 1000;\n\nexport function useServerTime(): ServerTimeApi {\n const engine = useContext(OfflineEngineContext);\n const [lastServerTime, setLastServerTime] = useState<string | undefined>(undefined);\n const observedAtPerfRef = useRef<number | undefined>(undefined);\n const [, forceTick] = useState(0);\n\n useEffect(() => {\n if (engine === null) {\n return;\n }\n // `snapshot.updated` is the one event in `OfflineEventMap` that carries\n // `serverTime` (`kaafil-js/src/offline/events.ts`, verified this\n // session) — the engine's other five events do not, so this is the only\n // subscription this hook can build without inventing a stamp.\n const unsubscribe = engine.events.on('snapshot.updated', (event) => {\n // `serverTime` is ABSENT on a change that never involved the server —\n // an optimistic create painted while offline, or an op the host\n // discarded (`kaafil-js/src/offline/events.ts`). Those are real snapshot\n // changes and a list must repaint for them, but they carry no reading,\n // and taking `undefined` here would erase the last real one this\n // session had: `now()` would start throwing again mid-session, on a\n // device that HAS heard from the server, because the manager ticked\n // something off out of signal.\n if (event.serverTime === undefined) {\n return;\n }\n observedAtPerfRef.current = performance.now();\n setLastServerTime(event.serverTime);\n });\n return unsubscribe;\n }, [engine]);\n\n useEffect(() => {\n const id = setInterval(() => forceTick((tick) => tick + 1), TICK_INTERVAL_MS);\n return () => clearInterval(id);\n }, []);\n\n function now(): string {\n if (lastServerTime === undefined || observedAtPerfRef.current === undefined) {\n // No response has ever landed in this session yet. Fabricating a\n // value from the local wall clock is exactly what hard rule #6\n // forbids — this is the one case this hook cannot silently satisfy\n // its own non-optional return type, so it says so loudly instead.\n // CALLERS: this is a real, expected window — React runs an effect\n // (which is how this hook's own subscription above starts) strictly\n // AFTER the render that needs `now()`'s result has already committed,\n // so a component's very FIRST render can hit this throw even when\n // wired up correctly. Guard the call site, matching\n // `useStaleness.ts`'s own precedent, rather than reaching for a\n // device-clock fallback here (hard rule #6 forbids exactly that).\n throw new Error(\n 'useServerTime().now() was called before any response carrying meta.serverTime ' +\n 'had been observed — there is no server timestamp yet to advance from.',\n );\n }\n const elapsedMs = performance.now() - observedAtPerfRef.current;\n return new Date(Date.parse(lastServerTime) + elapsedMs).toISOString();\n }\n\n return { now, sinceLastSync: lastServerTime };\n}\n"]}
@@ -1,6 +1,6 @@
1
- import { createDomainHook, useSnapshotList, classifyError } from './chunk-PWZNUXKT.js';
2
- import { useServerTime } from './chunk-F6B4CDUL.js';
3
- import { useOfflineMutation, useKaafilClient, useCapabilityRows, deriveCapabilityTriple, tokenStyle, ConfigContext, KaafilClientContext, usePersona, useSession, OfflineEngineContext, SessionContext, BrandShell, I18nShell, isDevelopment } from './chunk-SEPFCHBJ.js';
1
+ import { createDomainHook, useSnapshotList, classifyError } from './chunk-VU5BCK2P.js';
2
+ import { useServerTime } from './chunk-GKR52SVU.js';
3
+ import { useOfflineMutation, useKaafilClient, useCapabilityRows, deriveCapabilityTriple, tokenStyle, ConfigContext, KaafilClientContext, usePersona, useSession, OfflineEngineContext, SessionContext, BrandShell, I18nShell, isDevelopment } from './chunk-ZURCZQQ7.js';
4
4
  import { useCallback, createContext, useState, useEffect, useRef, useMemo, useContext, Component, Fragment } from 'react';
5
5
  import { SyncOpMethod, KaafilClient } from 'kaafil-js/client';
6
6
  import { createPortal } from 'react-dom';
@@ -1464,5 +1464,5 @@ var TRIP_TAB_KEY_SET = {
1464
1464
  };
1465
1465
 
1466
1466
  export { AppShell, CLOSEOUT_ACTION_TAB, ConfigShell, ErrorShell, KaafilUIKitProvider, OfflineShell, SessionShell, TelemetryShell, ThemeShell, familySafeSections, fromSearchParams, isTripTabKey, resolveBlockerDeepLink, toSearchParams, useAgencyAdminMe, useAgencyChecklistTemplates, useAgencyForms, useAgencyJourneyTriggers, useAgencyManagerProfile, useAgencySettings, useAgencyTrip, useAgencyTripManifest, useAgencyTrips, useBookings, useBuildShareUrl, useCapabilityStatuses, useDefaultCapabilityViews, useDirectories, usePaginatedList, useShareLinks, useTravellerFormResponses };
1467
- //# sourceMappingURL=chunk-HNENKHHJ.js.map
1468
- //# sourceMappingURL=chunk-HNENKHHJ.js.map
1467
+ //# sourceMappingURL=chunk-57DYMIWS.js.map
1468
+ //# sourceMappingURL=chunk-57DYMIWS.js.map