react-os-shell 4.79.3 → 4.82.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.
- package/README.md +18 -0
- package/dist/{Browser-2DFSZ3RP.js → Browser-5FNVWP3Q.js} +7 -7
- package/dist/{Browser-2DFSZ3RP.js.map → Browser-5FNVWP3Q.js.map} +1 -1
- package/dist/{Calculator-PAPSDNSJ.js → Calculator-2FCNKTPN.js} +6 -6
- package/dist/{Calculator-PAPSDNSJ.js.map → Calculator-2FCNKTPN.js.map} +1 -1
- package/dist/{CurrencyConverter-VJQI2XVV.js → CurrencyConverter-KZU7MTWE.js} +6 -6
- package/dist/{CurrencyConverter-VJQI2XVV.js.map → CurrencyConverter-KZU7MTWE.js.map} +1 -1
- package/dist/{Documents-GIP67CHC.js → Documents-ZTK6SSDK.js} +7 -7
- package/dist/{Documents-GIP67CHC.js.map → Documents-ZTK6SSDK.js.map} +1 -1
- package/dist/{Files-JAE2LL65.js → Files-4PNE3MBV.js} +12 -12
- package/dist/{Files-JAE2LL65.js.map → Files-4PNE3MBV.js.map} +1 -1
- package/dist/{Notepad-SXHXJ6PC.js → Notepad-63JJ2WB5.js} +7 -7
- package/dist/{Notepad-SXHXJ6PC.js.map → Notepad-63JJ2WB5.js.map} +1 -1
- package/dist/{PomodoroTimer-GFL4L3XS.js → PomodoroTimer-SL372V3I.js} +7 -7
- package/dist/{PomodoroTimer-GFL4L3XS.js.map → PomodoroTimer-SL372V3I.js.map} +1 -1
- package/dist/{Preview-5HFE6MCG.js → Preview-QZL2BXLP.js} +9 -9
- package/dist/Preview-QZL2BXLP.js.map +1 -0
- package/dist/{Sidebar-B3LY5T2U.js → Sidebar-GFDPPC4X.js} +24 -6
- package/dist/Sidebar-GFDPPC4X.js.map +1 -0
- package/dist/{Spreadsheet-KZLORYAA.js → Spreadsheet-RCKDHL66.js} +8 -8
- package/dist/{Spreadsheet-KZLORYAA.js.map → Spreadsheet-RCKDHL66.js.map} +1 -1
- package/dist/{Stock-WZXVQX3G.js → Stock-YDCHLKSV.js} +6 -6
- package/dist/{Stock-WZXVQX3G.js.map → Stock-YDCHLKSV.js.map} +1 -1
- package/dist/{Weather-FQ7ZVXVR.js → Weather-HM3Y5LMI.js} +6 -6
- package/dist/{Weather-FQ7ZVXVR.js.map → Weather-HM3Y5LMI.js.map} +1 -1
- package/dist/{WorldClock-XAFQ5ZQF.js → WorldClock-RXKMY3YJ.js} +6 -6
- package/dist/{WorldClock-XAFQ5ZQF.js.map → WorldClock-RXKMY3YJ.js.map} +1 -1
- package/dist/apps/index.js +19 -19
- package/dist/{chunk-GO2LCDHS.js → chunk-26S2Q6GA.js} +3 -3
- package/dist/{chunk-GO2LCDHS.js.map → chunk-26S2Q6GA.js.map} +1 -1
- package/dist/{chunk-EWDYCO65.js → chunk-35RG2LD2.js} +3 -3
- package/dist/{chunk-EWDYCO65.js.map → chunk-35RG2LD2.js.map} +1 -1
- package/dist/{chunk-ZO4XGUZQ.js → chunk-3TSIRZUW.js} +3 -3
- package/dist/{chunk-ZO4XGUZQ.js.map → chunk-3TSIRZUW.js.map} +1 -1
- package/dist/{chunk-BLLINYDD.js → chunk-5TLIIDRZ.js} +186 -5
- package/dist/chunk-5TLIIDRZ.js.map +1 -0
- package/dist/chunk-6XQHH7D2.js +105 -0
- package/dist/chunk-6XQHH7D2.js.map +1 -0
- package/dist/{chunk-OQ7GRU7G.js → chunk-7RUYFI6O.js} +3 -3
- package/dist/{chunk-OQ7GRU7G.js.map → chunk-7RUYFI6O.js.map} +1 -1
- package/dist/{chunk-A42MTWLI.js → chunk-F54RMKRL.js} +5 -5
- package/dist/{chunk-A42MTWLI.js.map → chunk-F54RMKRL.js.map} +1 -1
- package/dist/{chunk-TT2WNTDS.js → chunk-IZ2FABWU.js} +3 -3
- package/dist/{chunk-TT2WNTDS.js.map → chunk-IZ2FABWU.js.map} +1 -1
- package/dist/chunk-KLSUJ46L.js +7 -0
- package/dist/{chunk-M2IJT4OA.js.map → chunk-KLSUJ46L.js.map} +1 -1
- package/dist/{chunk-YZVJCHXV.js → chunk-LEMEFL6U.js} +300 -194
- package/dist/chunk-LEMEFL6U.js.map +1 -0
- package/dist/{chunk-EXSEW5F3.js → chunk-MHUVU7ZX.js} +102 -16
- package/dist/chunk-MHUVU7ZX.js.map +1 -0
- package/dist/{chunk-QJS6RBH4.js → chunk-XWLEA4B7.js} +3 -3
- package/dist/{chunk-QJS6RBH4.js.map → chunk-XWLEA4B7.js.map} +1 -1
- package/dist/{chunk-WNLPTLT6.js → chunk-ZESNO4TZ.js} +2 -2
- package/dist/chunk-ZESNO4TZ.js.map +1 -0
- package/dist/{index-BjEcKEsJ.d.ts → index-D9ZuIsBe.d.ts} +130 -1
- package/dist/index.d.ts +53 -3
- package/dist/index.js +157 -56
- package/dist/index.js.map +1 -1
- package/dist/ui/index.d.ts +1 -1
- package/dist/ui/index.js +4 -3
- package/package.json +1 -1
- package/dist/Preview-5HFE6MCG.js.map +0 -1
- package/dist/Sidebar-B3LY5T2U.js.map +0 -1
- package/dist/chunk-BLLINYDD.js.map +0 -1
- package/dist/chunk-EXSEW5F3.js.map +0 -1
- package/dist/chunk-M2IJT4OA.js +0 -7
- package/dist/chunk-WNLPTLT6.js.map +0 -1
- package/dist/chunk-YZVJCHXV.js.map +0 -1
package/dist/chunk-M2IJT4OA.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/shell/nav-types.ts","../src/shell-config/nav.tsx","../src/shell/ShellAuth.tsx"],"names":[],"mappings":";;;;AAgEO,SAAS,UAAU,IAAA,EAAgD;AACxE,EAAA,OAAO,OAAA,IAAW,IAAA;AACpB;AAoBO,SAAS,UAAA,CACd,OACA,UAAA,EACS;AACT,EAAA,IAAI,KAAA,CAAM,OAAO,MAAA,IAAU,CAAC,WAAW,KAAA,CAAM,KAAK,GAAG,OAAO,KAAA;AAC5D,EAAA,IAAI,KAAA,CAAM,QAAA,EAAU,MAAA,IAAU,CAAC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AA,CAAK,SAAS,CAAA,EAAG,OAAO,UAAU,CAAC,CAAA;AAC1D,EAAA,MAAA,CAAO,MAAA,CAAO,WAAW,KAAK,CAAA;AAChC;AAEO,IAAM,eAA0C;AAChD,IAAM,cAAwC;AAC9C,IAAM,mBAAA,GAA2C,EAAE,GAAA,EAAK,EAAC,EAAG,MAAA,EAAQ,EAAC,EAAG,OAAA,EAAS,EAAC,EAAG,MAAA,EAAQ,EAAC;ACZrG,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","file":"chunk-WNLPTLT6.js","sourcesContent":["/**\n * Nav data types used by <Layout> + <StartMenu>. The actual sections, icons,\n * and categories are consumer-supplied via Layout props — the package never\n * ships nav DATA, only the shape it expects.\n */\nimport type { ReactNode } from 'react';\n\nexport interface NavItem {\n to: string;\n label: string;\n perms?: string[];\n /** Permissions the user must hold EVERY one of, unlike `perms` which needs\n * only one. For an entry whose page is gated on a narrower permission than\n * the one that puts it in the menu: listing both in `perms` would widen the\n * audience (it's an OR), so the extra one goes here instead. */\n allPerms?: string[];\n dividerAfter?: boolean;\n /** Optional sub-items, to any depth — a child may have children of its own.\n * Hovering the parent in <StartMenu> opens a nested flyout; in <Sidebar>\n * the parent becomes an inline sub-accordion. */\n children?: NavItem[];\n}\n\nexport interface NavSection {\n label: string;\n items: NavItem[];\n perms?: string[];\n /** Same all-of rule as `NavItem.allPerms`, for a whole section. */\n allPerms?: string[];\n /** Optional landing route for clicks on the section title itself\n * (e.g. R&D's `/rd` dashboard). */\n to?: string;\n /** Draw a divider under this section's row, so a consumer can split one\n * flat group into visual bands (e.g. an operator console pinned above the\n * ERP sections). Same knob as `NavItem.dividerAfter`, and drawn INSIDE the\n * section's wrapper so it stays below the row in the `flex-col-reverse`\n * Start menu a side/top taskbar renders. */\n dividerAfter?: boolean;\n}\n\nexport interface VirtualSection {\n label: string;\n items: NavItem[];\n icon?: ReactNode;\n}\n\nexport interface StartMenuCategories {\n /** Section labels rendered in the \"ERP\" group (bold, with section icon). */\n erp: string[];\n /** Section labels rendered in the \"system\" group. */\n system: string[];\n /** Optional virtual flyouts (e.g. a \"Utilities\" tray). */\n virtual?: VirtualSection[];\n /** Optional section labels pinned to the bottom of the menu, next to the user\n * profile, separated from the ERP group by a divider. */\n footer?: string[];\n /** Optional flat top-level items pinned to the bottom of the menu, next to\n * the user profile, separated from the ERP group by a divider. Unlike\n * `footer` (section labels rendered as flyouts), these render as direct\n * clickable rows — use for standalone destinations like System Preferences\n * or a bug-report link. */\n footerItems?: NavItem[];\n}\n\nexport function isSection(item: NavSection | NavItem): item is NavSection {\n return 'items' in item;\n}\n\n/** The host app's permission predicate — `useAuth().hasAnyPerm`. */\ntype HasAnyPerm = (perms: string[]) => boolean;\n\n/**\n * Whether this user may see a nav entry, honouring BOTH permission rules.\n *\n * Every visibility test in the shell goes through here. It used to be an inline\n * `!x.perms || hasAnyPerm(x.perms)` repeated at nine call sites, which made the\n * all-of rule impossible to add without missing one — and a missed site shows a\n * row that refuses on click (SG#00214: a price-blind supplier role kept the\n * Price Sheets entry, because the entry is gated on the permission that lists\n * price sheets while the page is gated on the narrower one that reveals prices).\n *\n * `perms` keeps its any-of meaning, so existing nav data is untouched.\n * `allPerms` requires every entry, and is tested one permission at a time\n * because `hasAnyPerm` is the only predicate a host supplies — asking for all\n * of them in one call would be an OR and quietly grant the row.\n */\nexport function navVisible(\n entry: { perms?: string[]; allPerms?: string[] },\n hasAnyPerm: HasAnyPerm,\n): boolean {\n if (entry.perms?.length && !hasAnyPerm(entry.perms)) return false;\n if (entry.allPerms?.length && !entry.allPerms.every(p => hasAnyPerm([p]))) return false;\n return true;\n}\n\n/**\n * The sub-items of `item` this user may actually see.\n *\n * Every affordance for a nested group has to be derived from THIS list — the\n * chevron that advertises it, the hover handler that opens it, and the flyout\n * itself. Reading the raw `item.children` for the chevron while filtering only\n * for the flyout put an arrow on groups whose children were all\n * permission-hidden: hovering one highlighted the row and opened nothing.\n */\nexport function visibleChildren(item: NavItem, hasAnyPerm: HasAnyPerm): NavItem[] {\n return (item.children ?? []).filter(c => navVisible(c, hasAnyPerm));\n}\n\n/**\n * Whether a nav row leads anywhere for this user: either it's a plain\n * destination, or it's a group with at least one child that itself leads\n * somewhere. A group whose children are all hidden has nothing to open — and\n * by convention a group's `to` is a synthetic key that never navigates, so\n * there is nothing to fall back to either. Such a row is dropped rather than\n * rendered inert.\n *\n * The test recurses because nesting does: a group holding one sub-group whose\n * own children are all permission-hidden is just as inert as a group holding\n * nothing, and at four levels deep that shape is easy to build by accident.\n */\nexport function isReachable(item: NavItem, hasAnyPerm: HasAnyPerm): boolean {\n if (!item.children?.length) return true;\n return visibleChildren(item, hasAnyPerm).some(child => isReachable(child, hasAnyPerm));\n}\n","/**\n * INTERNAL stub — package-side compatibility for files that legacy-imported\n * default nav data from `shell-config/nav`. The package never ships nav\n * DATA; consumers always supply `navSections` / `navIcons` / `sectionIcons` /\n * `categories` as Layout props.\n *\n * Empty defaults exported here so the copied files compile during the\n * extraction transition. Each consumer-facing field is also re-exported as\n * a TYPE alias for code that only needed the shape.\n */\nimport type { ReactNode } from 'react';\nimport type { NavItem, NavSection, StartMenuCategories, VirtualSection } from '../shell/nav-types';\n\n// Live proxy: WindowManager reads window-title icons from this module-level\n// map. Consumers register their full icon set once at app startup so the\n// title bars show the same glyphs as the start menu.\nconst _navIcons: Record<string, ReactNode> = {};\nexport const navIcons: Record<string, ReactNode> = new Proxy(_navIcons, {\n get(_t, k: string) { return _navIcons[k]; },\n has(_t, k: string) { return k in _navIcons; },\n ownKeys() { return Object.keys(_navIcons); },\n getOwnPropertyDescriptor(_t, k: string) {\n if (k in _navIcons) return { configurable: true, enumerable: true, value: _navIcons[k] };\n return undefined;\n },\n});\nexport function setShellNavIcons(icons: Record<string, ReactNode>): void {\n for (const k of Object.keys(_navIcons)) delete _navIcons[k];\n Object.assign(_navIcons, icons);\n}\n\nexport const sectionIcons: Record<string, ReactNode> = {};\nexport const navSections: (NavSection | NavItem)[] = [];\nexport const startMenuCategories: StartMenuCategories = { erp: [], system: [], virtual: [], footer: [] };\n\nexport { isSection } from '../shell/nav-types';\nexport type { NavItem, NavSection, StartMenuCategories, VirtualSection };\n","/**\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"]}
|