@crystaltech/hsms-shared-ui 0.7.16 → 0.7.17

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.
@@ -8,6 +8,9 @@ export interface UserInfo {
8
8
  family_name?: string;
9
9
  organization_id?: string;
10
10
  hospital_id?: string;
11
+ /** Avatar path as stored in user_info; resolved via getImageFullUrl */
12
+ photoUrl?: string;
13
+ /** @deprecated use photoUrl */
11
14
  image?: string;
12
15
  realm_access?: {
13
16
  roles?: string[];
package/dist/sw.js CHANGED
@@ -1 +1 @@
1
- if(!self.define){let e,s={};const i=(i,r)=>(i=new URL(i+".js",r).href,s[i]||new Promise(s=>{if("document"in self){const e=document.createElement("script");e.src=i,e.onload=s,document.head.appendChild(e)}else e=i,importScripts(i),s()}).then(()=>{let e=s[i];if(!e)throw new Error(`Module ${i} didn’t register its module`);return e}));self.define=(r,n)=>{const d=e||("document"in self?document.currentScript.src:"")||location.href;if(s[d])return;let o={};const t=e=>i(e,d),f={module:{uri:d},exports:o,require:t};s[d]=Promise.all(r.map(e=>f[e]||t(e))).then(e=>(n(...e),o))}}define(["./workbox-3105ea8d"],function(e){"use strict";self.skipWaiting(),e.clientsClaim(),e.precacheAndRoute([{url:"registerSW.js",revision:"1872c500de691dce40960bb85481de07"},{url:"preMountSplash.js",revision:"69595cf5be048dac028ec824df963467"},{url:"preMountSplash.es.js",revision:"f5716f806d7370efa61388e339a5f93a"},{url:"index.js",revision:"30186aa06f2d37f6fa1a69660900e543"},{url:"index.es.js",revision:"e1429894f46d92b6cd56d13d9fa01bbb"},{url:"hsms-shared-ui.css",revision:"7f5aef0a9303b4cde437120fbb05ea5b"},{url:"Loader--w3bdiMN.js",revision:"8594dc4a141208a55fd87494664f9002"},{url:"manifest.webmanifest",revision:"e6d4972ea70a2ecb105e17f18dad67f9"}],{}),e.cleanupOutdatedCaches(),e.registerRoute(new e.NavigationRoute(e.createHandlerBoundToURL("index.html")))});
1
+ if(!self.define){let e,s={};const i=(i,r)=>(i=new URL(i+".js",r).href,s[i]||new Promise(s=>{if("document"in self){const e=document.createElement("script");e.src=i,e.onload=s,document.head.appendChild(e)}else e=i,importScripts(i),s()}).then(()=>{let e=s[i];if(!e)throw new Error(`Module ${i} didn’t register its module`);return e}));self.define=(r,n)=>{const f=e||("document"in self?document.currentScript.src:"")||location.href;if(s[f])return;let o={};const t=e=>i(e,f),d={module:{uri:f},exports:o,require:t};s[f]=Promise.all(r.map(e=>d[e]||t(e))).then(e=>(n(...e),o))}}define(["./workbox-3105ea8d"],function(e){"use strict";self.skipWaiting(),e.clientsClaim(),e.precacheAndRoute([{url:"registerSW.js",revision:"1872c500de691dce40960bb85481de07"},{url:"preMountSplash.js",revision:"46986fe18311b1852bd4ebf684726bab"},{url:"preMountSplash.es.js",revision:"f363010fb7eaab98ab53522f58febacb"},{url:"index.js",revision:"d30146a78a6dff12212457746dce9d3a"},{url:"index.es.js",revision:"3ef68093b32ff4afa41318ab52f93aa2"},{url:"hsms-shared-ui.css",revision:"7f5aef0a9303b4cde437120fbb05ea5b"},{url:"Loader-D1FpX_bV.js",revision:"c37d04f117789f8752c3fc903951c281"},{url:"manifest.webmanifest",revision:"e6d4972ea70a2ecb105e17f18dad67f9"}],{}),e.cleanupOutdatedCaches(),e.registerRoute(new e.NavigationRoute(e.createHandlerBoundToURL("index.html")))});
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Safe helpers for reading/writing JSON in localStorage.
3
+ *
4
+ * The library reads a number of app-provided keys (organization_info,
5
+ * user_info, hospital_info, theme, ...). A single corrupted value used to
6
+ * throw from `JSON.parse` — sometimes at module-import time — and take down
7
+ * the whole consuming app. These helpers never throw.
8
+ */
9
+ /** Parse an arbitrary JSON string, returning `fallback` on any error. */
10
+ export declare function safeParse<T>(raw: string | null | undefined, fallback: T): T;
11
+ /** Read a JSON value from localStorage, returning `fallback` on any error. */
12
+ export declare function readJSON<T>(key: string, fallback: T): T;
13
+ /** Write a JSON value to localStorage, swallowing quota/security errors. */
14
+ export declare function writeJSON(key: string, value: unknown): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crystaltech/hsms-shared-ui",
3
- "version": "0.7.16",
3
+ "version": "0.7.17",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",
@@ -51,11 +51,11 @@
51
51
  },
52
52
  "dependencies": {
53
53
  "react-color": "^2.19.3",
54
- "simplebar-react": "^3.3.0",
55
- "vite-plugin-pwa": "^0.21.1"
54
+ "simplebar-react": "^3.3.0"
56
55
  },
57
56
  "devDependencies": {
58
57
  "react": "^19.0.0",
58
+ "vite-plugin-pwa": "^0.21.1",
59
59
  "react-dom": "^19.0.0",
60
60
  "typescript": "^5.8.2",
61
61
  "@types/react": "^19.0.10",