react-os-shell 0.2.62 → 0.2.64
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.
- package/dist/{Browser-46QICOBV.js → Browser-OL4SV34L.js} +4 -3
- package/dist/Browser-OL4SV34L.js.map +1 -0
- package/dist/{Calculator-2454MDQH.js → Calculator-VALSEOQD.js} +5 -4
- package/dist/Calculator-VALSEOQD.js.map +1 -0
- package/dist/{Calendar-NOVX5TSS.js → Calendar-I4OLRGNW.js} +4 -3
- package/dist/Calendar-I4OLRGNW.js.map +1 -0
- package/dist/{CurrencyConverter-LVUXSR57.js → CurrencyConverter-3DLJRL24.js} +5 -4
- package/dist/CurrencyConverter-3DLJRL24.js.map +1 -0
- package/dist/{Documents-QJDM3JQZ.js → Documents-JLIRD3ML.js} +4 -3
- package/dist/Documents-JLIRD3ML.js.map +1 -0
- package/dist/{Email-N27XXAW3.js → Email-PN2CNRLE.js} +5 -4
- package/dist/Email-PN2CNRLE.js.map +1 -0
- package/dist/Files-VQCZUKNU.js +12 -0
- package/dist/{Files-W3PU2D6S.js.map → Files-VQCZUKNU.js.map} +1 -1
- package/dist/{Minesweeper-Q4UYGWYG.js → Minesweeper-IGIPALMP.js} +4 -3
- package/dist/Minesweeper-IGIPALMP.js.map +1 -0
- package/dist/{Notepad-XU7VIXYV.js → Notepad-Q5SSDZNW.js} +4 -3
- package/dist/Notepad-Q5SSDZNW.js.map +1 -0
- package/dist/{PomodoroTimer-4UXR4OLK.js → PomodoroTimer-PD2HIZMT.js} +5 -4
- package/dist/PomodoroTimer-PD2HIZMT.js.map +1 -0
- package/dist/Preview-WFIQOE3T.js +8 -0
- package/dist/{Preview-EOZK5EBA.js.map → Preview-WFIQOE3T.js.map} +1 -1
- package/dist/Sidebar-4V6NQROQ.js +234 -0
- package/dist/Sidebar-4V6NQROQ.js.map +1 -0
- package/dist/Spreadsheet-Y5LACQRY.js +7 -0
- package/dist/{Spreadsheet-2GWD45U4.js.map → Spreadsheet-Y5LACQRY.js.map} +1 -1
- package/dist/{Weather-6GOXYALT.js → Weather-GEA3GBQQ.js} +5 -4
- package/dist/Weather-GEA3GBQQ.js.map +1 -0
- package/dist/{WorldClock-35S3SRPP.js → WorldClock-W2ENBGFS.js} +5 -4
- package/dist/WorldClock-W2ENBGFS.js.map +1 -0
- package/dist/apps/index.js +21 -19
- package/dist/apps/index.js.map +1 -1
- package/dist/chunk-2RIRISNW.js +46 -0
- package/dist/chunk-2RIRISNW.js.map +1 -0
- package/dist/{chunk-RGAFGLUW.js → chunk-4CFEJ4CC.js} +5 -72
- package/dist/chunk-4CFEJ4CC.js.map +1 -0
- package/dist/chunk-ADJ3CERD.js +31 -0
- package/dist/chunk-ADJ3CERD.js.map +1 -0
- package/dist/{chunk-ST7KKB2W.js → chunk-BUJKR34D.js} +3 -3
- package/dist/{chunk-ST7KKB2W.js.map → chunk-BUJKR34D.js.map} +1 -1
- package/dist/{chunk-NGGVYK5F.js → chunk-JDRZX27J.js} +11 -19
- package/dist/chunk-JDRZX27J.js.map +1 -0
- package/dist/{chunk-BZQALPHC.js → chunk-MY5PL6MK.js} +3 -3
- package/dist/{chunk-BZQALPHC.js.map → chunk-MY5PL6MK.js.map} +1 -1
- package/dist/chunk-SSA762W5.js +71 -0
- package/dist/chunk-SSA762W5.js.map +1 -0
- package/dist/{chunk-VH7LZ3JT.js → chunk-VDNTGVGH.js} +3 -3
- package/dist/{chunk-VH7LZ3JT.js.map → chunk-VDNTGVGH.js.map} +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.js +134 -303
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/Browser-46QICOBV.js.map +0 -1
- package/dist/Calculator-2454MDQH.js.map +0 -1
- package/dist/Calendar-NOVX5TSS.js.map +0 -1
- package/dist/CurrencyConverter-LVUXSR57.js.map +0 -1
- package/dist/Documents-QJDM3JQZ.js.map +0 -1
- package/dist/Email-N27XXAW3.js.map +0 -1
- package/dist/Files-W3PU2D6S.js +0 -8
- package/dist/Minesweeper-Q4UYGWYG.js.map +0 -1
- package/dist/Notepad-XU7VIXYV.js.map +0 -1
- package/dist/PomodoroTimer-4UXR4OLK.js.map +0 -1
- package/dist/Preview-EOZK5EBA.js +0 -7
- package/dist/Spreadsheet-2GWD45U4.js +0 -6
- package/dist/Weather-6GOXYALT.js.map +0 -1
- package/dist/WorldClock-35S3SRPP.js.map +0 -1
- package/dist/chunk-NGGVYK5F.js.map +0 -1
- package/dist/chunk-RGAFGLUW.js.map +0 -1
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { createContext, useContext } from 'react';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
|
|
4
|
+
// src/shell/ShellAuth.tsx
|
|
5
|
+
var DEFAULT = { hasAnyPerm: () => true };
|
|
6
|
+
var ShellAuthContext = createContext(DEFAULT);
|
|
7
|
+
function ShellAuthProvider({ value, children }) {
|
|
8
|
+
return /* @__PURE__ */ jsx(ShellAuthContext.Provider, { value, children });
|
|
9
|
+
}
|
|
10
|
+
function useShellAuth() {
|
|
11
|
+
return useContext(ShellAuthContext);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
// src/contexts/AuthContext.tsx
|
|
15
|
+
var _authBridge = {};
|
|
16
|
+
function setShellAuthBridge(bridge) {
|
|
17
|
+
_authBridge = bridge;
|
|
18
|
+
}
|
|
19
|
+
function useAuth() {
|
|
20
|
+
const { hasAnyPerm } = useShellAuth();
|
|
21
|
+
return {
|
|
22
|
+
user: _authBridge.user,
|
|
23
|
+
logout: _authBridge.logout ?? (() => {
|
|
24
|
+
}),
|
|
25
|
+
hasAnyPerm
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export { ShellAuthProvider, setShellAuthBridge, useAuth, useShellAuth };
|
|
30
|
+
//# sourceMappingURL=chunk-ADJ3CERD.js.map
|
|
31
|
+
//# sourceMappingURL=chunk-ADJ3CERD.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/shell/ShellAuth.tsx","../src/contexts/AuthContext.tsx"],"names":[],"mappings":";;;;AAqBA,IAAM,OAAA,GAAqB,EAAE,UAAA,EAAY,MAAM,IAAA,EAAK;AAEpD,IAAM,gBAAA,GAAmB,cAAyB,OAAO,CAAA;AAElD,SAAS,iBAAA,CAAkB,EAAE,KAAA,EAAO,QAAA,EAAS,EAA8C;AAChG,EAAA,uBAAO,GAAA,CAAC,gBAAA,CAAiB,QAAA,EAAjB,EAA0B,OAAe,QAAA,EAAS,CAAA;AAC5D;AAEO,SAAS,YAAA,GAA0B;AACxC,EAAA,OAAO,WAAW,gBAAgB,CAAA;AACpC;;;ACXA,IAAI,cAAyD,EAAC;AAGvD,SAAS,mBAAmB,MAAA,EAAmD;AACpF,EAAA,WAAA,GAAc,MAAA;AAChB;AAEO,SAAS,OAAA,GAAU;AACxB,EAAA,MAAM,EAAE,UAAA,EAAW,GAAI,YAAA,EAAa;AACpC,EAAA,OAAO;AAAA,IACL,MAAM,WAAA,CAAY,IAAA;AAAA,IAClB,MAAA,EAAQ,WAAA,CAAY,MAAA,KAAW,MAAM;AAAA,IAAC,CAAA,CAAA;AAAA,IACtC;AAAA,GACF;AACF","file":"chunk-ADJ3CERD.js","sourcesContent":["/**\n * Shell-side auth surface — JUST permission checking. The shell never\n * authenticates anyone or holds tokens; it only asks \"is the current user\n * allowed to see this nav item?\".\n *\n * Consumer wraps the app:\n *\n * <ShellAuthProvider value={{ hasAnyPerm: (perms) => myAuth.has(...perms) }}>\n * <Layout ... />\n * </ShellAuthProvider>\n *\n * When no provider is mounted, every permission check returns true — useful\n * for demos and consumers that don't gate their UI.\n */\nimport { createContext, useContext, type ReactNode } from 'react';\n\nexport interface ShellAuth {\n /** Returns true if the current user has any of the listed permission codes. */\n hasAnyPerm: (perms: string[]) => boolean;\n}\n\nconst DEFAULT: ShellAuth = { hasAnyPerm: () => true };\n\nconst ShellAuthContext = createContext<ShellAuth>(DEFAULT);\n\nexport function ShellAuthProvider({ value, children }: { value: ShellAuth; children: ReactNode }) {\n return <ShellAuthContext.Provider value={value}>{children}</ShellAuthContext.Provider>;\n}\n\nexport function useShellAuth(): ShellAuth {\n return useContext(ShellAuthContext);\n}\n","/**\n * INTERNAL stub — bridges legacy `useAuth()` calls inside the shell to the\n * new <ShellAuthProvider> contract.\n *\n * The shell only ever uses `hasAnyPerm` for nav-item visibility plus `user`\n * + `logout` for the profile menu. Consumers pass these in via\n * <ShellAuthProvider value={{...}}> at the App root.\n *\n * Long-term this file is removed when call sites migrate to `useShellAuth()`\n * + Layout's `user` / `onLogout` props directly.\n */\nimport { useShellAuth } from '../shell/ShellAuth';\n\ninterface ShellUser {\n email?: string;\n first_name?: string;\n last_name?: string;\n avatar_url?: string;\n}\n\nlet _authBridge: { user?: ShellUser; logout?: () => void } = {};\n\n/** Consumer registers user-identity + logout handler once at app startup. */\nexport function setShellAuthBridge(bridge: { user?: ShellUser; logout?: () => void }) {\n _authBridge = bridge;\n}\n\nexport function useAuth() {\n const { hasAnyPerm } = useShellAuth();\n return {\n user: _authBridge.user,\n logout: _authBridge.logout ?? (() => {}),\n hasAnyPerm,\n };\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ImageAnnotator_default } from './chunk-KUIPWCTJ.js';
|
|
2
2
|
import { toast_default } from './chunk-WIJ45SYD.js';
|
|
3
|
-
import { WindowTitle, getActiveModalId } from './chunk-
|
|
3
|
+
import { WindowTitle, getActiveModalId } from './chunk-4CFEJ4CC.js';
|
|
4
4
|
import { createContext, useState, useEffect, useRef, useContext } from 'react';
|
|
5
5
|
import { createPortal } from 'react-dom';
|
|
6
6
|
import * as pdfjsLib from 'pdfjs-dist';
|
|
@@ -2396,5 +2396,5 @@ function ImagePanel({ url, filename, onDownload, onEmail }) {
|
|
|
2396
2396
|
}
|
|
2397
2397
|
|
|
2398
2398
|
export { Preview, setPdfPreview };
|
|
2399
|
-
//# sourceMappingURL=chunk-
|
|
2400
|
-
//# sourceMappingURL=chunk-
|
|
2399
|
+
//# sourceMappingURL=chunk-BUJKR34D.js.map
|
|
2400
|
+
//# sourceMappingURL=chunk-BUJKR34D.js.map
|