kaafil-react-uikit 0.9.0 → 0.10.1

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 (62) hide show
  1. package/CHANGELOG.md +123 -0
  2. package/dist/admin/index.cjs +458 -360
  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 +117 -19
  7. package/dist/admin/index.js.map +1 -1
  8. package/dist/{chunk-TYBIAPPT.cjs → chunk-2OWH2KDY.cjs} +86 -86
  9. package/dist/chunk-2OWH2KDY.cjs.map +1 -0
  10. package/dist/{chunk-2WPNGUX5.cjs → chunk-3AF2M2JD.cjs} +17 -17
  11. package/dist/{chunk-2WPNGUX5.cjs.map → chunk-3AF2M2JD.cjs.map} +1 -1
  12. package/dist/{chunk-FO5VJJUO.cjs → chunk-64R4ZJTA.cjs} +12 -12
  13. package/dist/{chunk-FO5VJJUO.cjs.map → chunk-64R4ZJTA.cjs.map} +1 -1
  14. package/dist/{chunk-YWMDBY43.js → chunk-7752B4NM.js} +5 -5
  15. package/dist/{chunk-YWMDBY43.js.map → chunk-7752B4NM.js.map} +1 -1
  16. package/dist/{chunk-TESIDLJ6.js → chunk-7V2XJIXD.js} +11 -8
  17. package/dist/chunk-7V2XJIXD.js.map +1 -0
  18. package/dist/{chunk-SO4F5LTH.js → chunk-AFWZFFEM.js} +7 -6
  19. package/dist/chunk-AFWZFFEM.js.map +1 -0
  20. package/dist/{chunk-PFTWPEVV.cjs → chunk-AJE2RNOR.cjs} +4 -4
  21. package/dist/{chunk-PFTWPEVV.cjs.map → chunk-AJE2RNOR.cjs.map} +1 -1
  22. package/dist/{chunk-IAXVUR7H.cjs → chunk-F4GGHUMX.cjs} +57 -56
  23. package/dist/chunk-F4GGHUMX.cjs.map +1 -0
  24. package/dist/{chunk-6PQWLUBA.js → chunk-K5Z6N2FY.js} +5 -5
  25. package/dist/{chunk-6PQWLUBA.js.map → chunk-K5Z6N2FY.js.map} +1 -1
  26. package/dist/{chunk-CCK3WPMF.js → chunk-KV7ODN2X.js} +3 -3
  27. package/dist/{chunk-CCK3WPMF.js.map → chunk-KV7ODN2X.js.map} +1 -1
  28. package/dist/{chunk-ELJPQSXY.cjs → chunk-NCHZLGEE.cjs} +11 -11
  29. package/dist/{chunk-ELJPQSXY.cjs.map → chunk-NCHZLGEE.cjs.map} +1 -1
  30. package/dist/{chunk-SMGXVEN3.cjs → chunk-S53XNHRU.cjs} +11 -8
  31. package/dist/{chunk-TESIDLJ6.js.map → chunk-S53XNHRU.cjs.map} +1 -1
  32. package/dist/{chunk-FSSB6J3X.js → chunk-TGP4GTIY.js} +6 -6
  33. package/dist/chunk-TGP4GTIY.js.map +1 -0
  34. package/dist/{chunk-TJGE4ZSX.js → chunk-UUID3H4R.js} +3 -3
  35. package/dist/{chunk-TJGE4ZSX.js.map → chunk-UUID3H4R.js.map} +1 -1
  36. package/dist/{chunk-GOSSRXBN.js → chunk-VCROLPO3.js} +3 -3
  37. package/dist/{chunk-GOSSRXBN.js.map → chunk-VCROLPO3.js.map} +1 -1
  38. package/dist/chunk-ZZK7USFC.cjs +12 -0
  39. package/dist/{chunk-PG7HNBTO.cjs.map → chunk-ZZK7USFC.cjs.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 +375 -263
  43. package/dist/manager/index.cjs.map +1 -1
  44. package/dist/manager/index.d.cts +136 -17
  45. package/dist/manager/index.d.ts +136 -17
  46. package/dist/manager/index.js +142 -30
  47. package/dist/manager/index.js.map +1 -1
  48. package/dist/offline/index.cjs +12 -1
  49. package/dist/offline/index.cjs.map +1 -1
  50. package/dist/offline/index.d.cts +51 -3
  51. package/dist/offline/index.d.ts +51 -3
  52. package/dist/offline/index.js +12 -1
  53. package/dist/offline/index.js.map +1 -1
  54. package/dist/traveller/index.cjs +35 -35
  55. package/dist/traveller/index.js +5 -5
  56. package/package.json +1 -1
  57. package/dist/chunk-FSSB6J3X.js.map +0 -1
  58. package/dist/chunk-IAXVUR7H.cjs.map +0 -1
  59. package/dist/chunk-PG7HNBTO.cjs +0 -12
  60. package/dist/chunk-SMGXVEN3.cjs.map +0 -1
  61. package/dist/chunk-SO4F5LTH.js.map +0 -1
  62. package/dist/chunk-TYBIAPPT.cjs.map +0 -1
package/CHANGELOG.md CHANGED
@@ -6,6 +6,129 @@ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this package uses [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
  While on `0.x` a minor bump may carry a breaking change; the entry will say so.
8
8
 
9
+ ## [0.10.1] — 2026-09-15
10
+
11
+ Two long-standing bugs that only bite together, found when the traveller
12
+ surface of that same partner CRM went blank on a **production** build.
13
+
14
+ ### Fixed
15
+
16
+ - **`isDevelopment()` answered `true` in every production browser build.**
17
+ It read `(globalThis as {...}).process?.env?.NODE_ENV`, on the reasoning
18
+ that a bundler "sees this exact property-access shape and inlines it the
19
+ same way it would a bare reference". It does not — Vite, webpack, Turbopack
20
+ and esbuild all match the literal member expression `process.env.NODE_ENV`,
21
+ and route it through `globalThis` or an optional chain and nothing is
22
+ replaced. A browser has no `process`, so the expression was `undefined`,
23
+ `undefined !== 'production'` is `true`, and **every dev-only throw in this
24
+ package shipped to real users**. It now reads a bare `process.env.NODE_ENV`
25
+ (declared locally, so still no `@types/node`) and fails CLOSED: a value it
26
+ cannot read means production, because a false positive here does not
27
+ produce a stray console line — it turns a guard meant to degrade quietly
28
+ into a crash.
29
+
30
+ - **The session's open window no longer claims to be a manager.**
31
+ `SessionShell` populated `SessionContext` with `persona: 'manager'`
32
+ unconditionally while opening. On a share surface that is simply false: a
33
+ bare `shareToken` prop settles the persona synchronously, which is the whole
34
+ premise of the credential-shape model. It now derives `'share'` from the
35
+ prop and keeps the guess only for `credentialResolver`, which genuinely
36
+ cannot be known before it resolves.
37
+
38
+ Together these took out the entire traveller surface in production:
39
+ `BrandShell` rejects `headStrategy: 'own-page'` for any non-`share` persona,
40
+ that guard is written to warn and fall back outside development, and instead
41
+ it threw — so `/t/<token>`, the page a traveller opens from a WhatsApp
42
+ message, rendered nothing but an error boundary.
43
+
44
+ ## [0.10.0] — 2026-09-15
45
+
46
+ Both changes came out of integrating a real partner CRM against the live
47
+ engine; both are things a host hit before anybody here did.
48
+
49
+ ### Fixed
50
+
51
+ - **Every directly-exported composite now waits for the session.**
52
+ `SessionShell` renders its children throughout the async open window with
53
+ `SessionContext` populated but no client yet, so any client-backed hook
54
+ called in that window throws:
55
+
56
+ ```
57
+ useKaafilClient() was called outside a <SessionShell>
58
+ ```
59
+
60
+ — which is a misleading message for a timing problem. The shell is right
61
+ there; it has nothing to hand down yet.
62
+
63
+ `KaafilAgencyWorkspace`, `KaafilManagerApp`, `KaafilShareView` and two
64
+ Manager sections already guarded with a two-component split. Thirty-one
65
+ other exports did not, and were safe only because a gated Surface happened
66
+ to sit above them. `TripWorkspace` is the one a host actually mounts
67
+ directly — it is the right component when a CRM wants to keep its own
68
+ navigation — and it threw every time.
69
+
70
+ What made it expensive to diagnose: the child throws, `ErrorShell` catches
71
+ it, the subtree unmounts, and the effect that would have opened the session
72
+ never runs. The network tab shows **no request at all**, which reads like a
73
+ broken credential rather than a race.
74
+
75
+ `TripWorkspace` renders its own skeleton while opening; the rest render
76
+ `null`, matching the five that were already gated.
77
+
78
+ ### Added
79
+
80
+ - **`installKaafilOfflineShell` gained `isHostOwned`**, defaulting to
81
+ same-origin. The handler previously claimed every non-API GET including
82
+ cross-origin ones, so a third-party font or beacon went through a cache
83
+ lookup that could never hit — and, because the first `respondWith` wins, a
84
+ host's own `fetch` listener could never answer for it.
85
+
86
+ - **`installKaafilOfflineShell` gained `runtimeCache`**, default `false`.
87
+ When on, a successful same-origin miss is written to the cache so the next
88
+ offline load can serve it. Only `ok`, `basic` responses are stored: a
89
+ pinned 404 outlives the mistake, and an opaque response cannot be read back
90
+ usefully. Off by default so `cacheName` stays the only revalidation knob.
91
+
92
+ Turn it on when enumerating your build is impractical — content-hashed
93
+ chunks you cannot list at worker-build time being the usual case.
94
+
95
+ ### Changed
96
+
97
+ - **The offline shell's own documentation was wrong in two places**, which is
98
+ worth a changelog line because the fix is what the options above are for.
99
+ It claimed to call `respondWith` "only for requests it actually owns" — it
100
+ declines only non-GET, API and (now) cross-origin. And an inline comment
101
+ said a non-precached request was "left alone for the host's own handlers",
102
+ when it was in fact claimed, proxied, and returned without being cached.
103
+
104
+ The consequence the docs never stated: without `runtimeCache`, `precache`
105
+ is not a warm-up optimisation, it is the entire offline surface.
106
+
107
+ - First tests for `src/offline/serviceWorker.ts`, which had none: eleven
108
+ covering what the handler claims and what a miss does.
109
+
110
+ ## [0.9.0] — 2026-09-14
111
+
112
+ Backfilled — this version shipped without a changelog entry.
113
+
114
+ ### Added
115
+
116
+ - **`kaafil-react-uikit/offline`**, the seventh subpath: `withCachedCredential`,
117
+ `localStorageCredentialStore` and `installKaafilOfflineShell`. The host's half
118
+ of offline — a credential that survives a reload, and a service-worker fetch
119
+ policy — in a module that imports neither React nor the SDK, so it can be
120
+ pulled into a worker bundle.
121
+
122
+ ### Changed
123
+
124
+ - **`KaafilManagerApp`'s `onNavigateModule` is now optional.** The Surface
125
+ satisfies `ManagerNowSection`'s requirement itself; omit it and the
126
+ quick-link chips still work, you lose only the host-side hook.
127
+
128
+ - `ShareLinkDialog` no longer labels a bare token "the new share link", and
129
+ warns in development when `buildShareUrl` is unset — the desk was showing an
130
+ operator a UUID they could not send anyone.
131
+
9
132
  ## [0.8.0] — 2026-09-14
10
133
 
11
134
  ### Added