@sybilion/uilib 1.1.0 → 1.2.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 +8 -8
- package/assets/{mini-app-global.css → standalone-global.css} +1 -1
- package/dist/esm/components/ui/Sidebar/Sidebar.styl.js +2 -2
- package/dist/esm/components/widgets/SidebarDatasetsItemsGrouped/SidebarDatasetsItemsGrouped.js +48 -0
- package/dist/esm/components/widgets/SidebarDatasetsItemsGrouped/SidebarDatasetsItemsGrouped.styl.js +7 -0
- package/dist/esm/components/widgets/SidebarDatasetsItemsGrouped/groupSidebarDatasets.js +38 -0
- package/dist/esm/index.js +5 -5
- package/dist/esm/sybilion-auth/SybilionAuthProvider.js +185 -0
- package/dist/esm/sybilion-auth/authPaths.js +7 -0
- package/dist/esm/sybilion-auth/exchangeSybilionToken.js +40 -0
- package/dist/esm/types/src/components/ui/Input/Input.d.ts +1 -1
- package/dist/esm/types/src/components/widgets/SidebarDatasetsItemsGrouped/SidebarDatasetsItemsGrouped.d.ts +11 -0
- package/dist/esm/types/src/components/widgets/SidebarDatasetsItemsGrouped/groupSidebarDatasets.d.ts +8 -0
- package/dist/esm/types/src/components/widgets/SidebarDatasetsItemsGrouped/index.d.ts +3 -0
- package/dist/esm/types/src/docs/pages/SidebarDatasetsItemsGroupedPage.d.ts +1 -0
- package/dist/esm/types/src/docs/pages/SybilionAuthProviderPage.d.ts +1 -0
- package/dist/esm/types/src/index.d.ts +3 -1
- package/dist/esm/types/src/sybilion-auth/SybilionAuthProvider.d.ts +39 -0
- package/dist/esm/types/src/sybilion-auth/authPaths.d.ts +3 -0
- package/dist/esm/types/src/sybilion-auth/exchangeSybilionToken.d.ts +2 -0
- package/dist/esm/types/src/sybilion-auth/index.d.ts +4 -0
- package/dist/esm/types/src/{mini-app/miniAppDataTypes.d.ts → types/sybilionDatasetSnapshots.d.ts} +5 -8
- package/docs/standalone-apps.md +65 -0
- package/package.json +10 -3
- package/src/components/ui/Sidebar/Sidebar.styl +0 -25
- package/src/components/ui/Sidebar/Sidebar.styl.d.ts +0 -1
- package/src/components/widgets/SidebarDatasetsItemsGrouped/SidebarDatasetsItemsGrouped.styl +29 -0
- package/src/{mini-app/MiniAppRoot.styl.d.ts → components/widgets/SidebarDatasetsItemsGrouped/SidebarDatasetsItemsGrouped.styl.d.ts} +4 -2
- package/src/components/widgets/SidebarDatasetsItemsGrouped/SidebarDatasetsItemsGrouped.tsx +128 -0
- package/src/components/widgets/SidebarDatasetsItemsGrouped/groupSidebarDatasets.ts +51 -0
- package/src/components/widgets/SidebarDatasetsItemsGrouped/index.ts +10 -0
- package/src/docs/pages/SidebarDatasetsItemsGroupedPage.tsx +136 -0
- package/src/docs/pages/SybilionAuthProviderPage.tsx +37 -0
- package/src/docs/registry.ts +9 -3
- package/src/index.ts +3 -1
- package/src/sybilion-auth/SybilionAuthProvider.tsx +322 -0
- package/src/sybilion-auth/authPaths.ts +6 -0
- package/src/sybilion-auth/exchangeSybilionToken.ts +47 -0
- package/src/sybilion-auth/index.ts +16 -0
- package/src/{mini-app/miniAppDataTypes.ts → types/sybilionDatasetSnapshots.ts} +5 -8
- package/dist/esm/mini-app/MiniAppRoot.js +0 -82
- package/dist/esm/mini-app/MiniAppRoot.styl.js +0 -7
- package/dist/esm/mini-app/miniAppChatBridge.js +0 -45
- package/dist/esm/mini-app/miniAppDataClient.js +0 -98
- package/dist/esm/mini-app/miniAppProtocol.js +0 -153
- package/dist/esm/mini-app/miniAppThemeConfig.js +0 -40
- package/dist/esm/types/src/docs/pages/MiniAppRootPage.d.ts +0 -1
- package/dist/esm/types/src/mini-app/MiniAppRoot.d.ts +0 -18
- package/dist/esm/types/src/mini-app/index.d.ts +0 -10
- package/dist/esm/types/src/mini-app/miniAppChatBridge.d.ts +0 -6
- package/dist/esm/types/src/mini-app/miniAppDataClient.d.ts +0 -16
- package/dist/esm/types/src/mini-app/miniAppProtocol.d.ts +0 -89
- package/dist/esm/types/src/mini-app/miniAppThemeConfig.d.ts +0 -3
- package/docs/workspace-mini-apps.md +0 -51
- package/src/docs/pages/MiniAppRootPage.tsx +0 -58
- package/src/mini-app/MiniAppRoot.styl +0 -24
- package/src/mini-app/MiniAppRoot.tsx +0 -150
- package/src/mini-app/index.ts +0 -43
- package/src/mini-app/miniAppChatBridge.ts +0 -55
- package/src/mini-app/miniAppDataClient.ts +0 -165
- package/src/mini-app/miniAppProtocol.ts +0 -247
- package/src/mini-app/miniAppThemeConfig.ts +0 -45
package/README.md
CHANGED
|
@@ -69,9 +69,9 @@ import { Button } from '@sybilion/uilib/src';
|
|
|
69
69
|
|
|
70
70
|
Deep imports use `@sybilion/uilib/src/...` (maps to files under `[src/](./src)`). Internal `#uilib/...` imports resolve through this package’s `[imports](./package.json)` field when bundling source.
|
|
71
71
|
|
|
72
|
-
###
|
|
72
|
+
### Standalone Sybilion apps
|
|
73
73
|
|
|
74
|
-
See `
|
|
74
|
+
See [`docs/standalone-apps.md`](./docs/standalone-apps.md) — greenfield `yarn add` lists `react`, `react-dom`, `react-router-dom`, `@auth0/auth0-react`, `@sybilion/uilib`. **`@homecode/ui` is a dependency of `@sybilion/uilib`** and installs with it; declare React/router in your app so deduplication keeps one React instance (see peers below).
|
|
75
75
|
|
|
76
76
|
## Bundling from source (`uilib/src`)
|
|
77
77
|
|
|
@@ -90,15 +90,15 @@ If you only use the **default** entry (`import from '@sybilion/uilib'` or aliase
|
|
|
90
90
|
|
|
91
91
|
## Peer dependencies
|
|
92
92
|
|
|
93
|
-
|
|
93
|
+
Declare these in **your** app (`package.json`):
|
|
94
94
|
|
|
95
|
-
- `react` and `react-dom` (>= 18)
|
|
96
|
-
- `react-router-dom` (>= 6) —
|
|
97
|
-
- `@
|
|
95
|
+
- `react` and `react-dom` (>= 18) — required so the app and `@homecode/ui` resolve the **same** React (avoid invalid hook call / duplicate trees).
|
|
96
|
+
- `react-router-dom` (>= 6) — layout components that use routing-aware UI.
|
|
97
|
+
- `@auth0/auth0-react` (^2.3, **optional peer**) — install when you import `SybilionAuthProvider` / Sybilion auth hooks (see `peerDependenciesMeta`). Standalone docs include it in the `yarn add` line.
|
|
98
98
|
|
|
99
|
-
|
|
99
|
+
**Included with `@sybilion/uilib`** (normal `dependencies`): `@homecode/ui` (^4.17), Radix, Recharts, `@vimeo/player`, `motion`, etc. You import `Theme` / primitives from `@homecode/ui` without adding it separately unless you want an explicit top-level version pin.
|
|
100
100
|
|
|
101
|
-
Runtime dependencies
|
|
101
|
+
Runtime dependencies are listed in [`package.json`](./package.json).
|
|
102
102
|
|
|
103
103
|
## Maintainers
|
|
104
104
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Standalone Sybilion app token sheet token sheet — keep in sync with assets/globals.css (:root, breakpoints, .dark).
|
|
3
3
|
* Omits @theme inline and @layer base (Tailwind/@apply). For full parity use globals.css from this repo.
|
|
4
4
|
*/
|
|
5
5
|
@import './fonts/fonts.css';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import styleInject from 'style-inject';
|
|
2
2
|
|
|
3
|
-
var css_248z = "@media (max-width:768px){:root{--page-x-padding:var(--p-6);--page-y-padding:var(--p-6)}}.Sidebar_sidebarWrapper__DGm4P{align-items:stretch;display:flex;flex-direction:row;--welcome-alert-height:44px;height:calc(100% - 44px);height:calc(100% - var(--welcome-alert-height));min-height:0;width:100%}.Sidebar_sidebarWrapper__DGm4P #page-sidebar-actions{min-height:100%}@media (max-width:768px){.Sidebar_sidebarWrapper__DGm4P{flex-direction:column;height:100dvh;max-height:100dvh}}.Sidebar_sidebarMainShell__pSWDC{display:flex;flex:1;flex-direction:column;min-height:0;min-width:0}.Sidebar_chatPanelMount__1Zctx{background:var(--background);border-left:1px solid var(--border);flex:0 0 0px;flex:0 0 var(--chat-panel-width,0px);min-height:0;min-width:0;overflow:hidden;width:0;width:var(--chat-panel-width,0)}@media (max-width:768px){.Sidebar_chatPanelMount__1Zctx{border-left:none;border-top:1px solid var(--border);flex:0 0 0px;flex:0 0 var(--chat-panel-height,0px);height:0;height:var(--chat-panel-height,0);transition:flex-basis .2s ease,height .2s ease;width:100%}}.Sidebar_sidebar__0vqNZ{height:0;position:fixed;--top-offset:-10px;--gap-top:calc(var(--header-height) + var(--top-offset));align-self:flex-start;color:var(--sidebar-foreground);display:none;flex-direction:column;top:var(--gap-top);width:var(--sidebar-width)}@media (min-width:768px){.Sidebar_sidebar__0vqNZ[data-state=expanded]{display:flex;height:calc(100vh - var(--gap-top));min-height:0}}.Sidebar_sidebar__0vqNZ[data-collapsible=offcanvas]{overflow:hidden;padding:0;width:0}.Sidebar_sidebarTrigger__ipx2C{cursor:pointer;height:var(--p-5);width:var(--p-5)}.Sidebar_sidebarTrigger__ipx2C svg{height:20px;width:20px}.Sidebar_sidebarRail__uvSpl{position:absolute;inset-y:0;display:hidden;transition:all ease-out;width:1rem;z-index:20}.Sidebar_sidebarRail__uvSpl:hover:after{background-color:var(--sidebar-border)}.Sidebar_sidebarRail__uvSpl[data-side=left]{right:-1rem}.Sidebar_sidebarRail__uvSpl[data-side=right]{left:0}.Sidebar_sidebarRail__uvSpl:after{content:\"\";position:absolute;inset-y:0;left:50%;width:2px}@media (min-width:640px){.Sidebar_sidebarRail__uvSpl{display:flex}}.Sidebar_sidebarRail__uvSpl[data-side=left]{cursor:w-resize}.Sidebar_sidebarRail__uvSpl[data-side=left][data-state=collapsed],.Sidebar_sidebarRail__uvSpl[data-side=right]{cursor:e-resize}.Sidebar_sidebarRail__uvSpl[data-side=right][data-state=collapsed]{cursor:w-resize}.Sidebar_sidebarRail__uvSpl[data-collapsible=offcanvas]{transform:translateX(0)}.Sidebar_sidebarRail__uvSpl[data-collapsible=offcanvas]:hover{background-color:var(--sidebar)}.Sidebar_sidebarRail__uvSpl[data-collapsible=offcanvas]:after{left:100%}.Sidebar_sidebarRail__uvSpl[data-side=left][data-collapsible=offcanvas]{right:-.5rem}.Sidebar_sidebarRail__uvSpl[data-side=right][data-collapsible=offcanvas]{left:-.5rem}.Sidebar_sidebarResizeHandle__kuD6t{background-color:transparent;background-color:var(--page-color);border-radius:2.5px;height:calc(100vh + 200px);opacity:0;position:absolute;top:-200px;touch-action:none;transition:opacity .15s ease-out;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:5px;z-index:30}.Sidebar_sidebarResizeHandle__kuD6t:before{content:\"\";cursor:col-resize;height:100%;position:absolute;right:0;width:30px}.Sidebar_sidebarResizeHandle__kuD6t[data-side=left]{right:2px}.Sidebar_sidebarResizeHandle__kuD6t[data-side=right]{left:0}.Sidebar_sidebarResizeHandle__kuD6t:hover{opacity:1}.Sidebar_sidebarResizeHandle__kuD6t:active{opacity:0}.Sidebar_fullHeightResizer__jZXnw .Sidebar_sidebarResizeHandle__kuD6t{height:calc(100vh - var(--gap-top)*-1);top:-80px}.Sidebar_sidebarInput__ujQLX{background-color:var(--background);box-shadow:none;height:2rem;width:100%}.Sidebar_sidebarFooter__V3O-l,.Sidebar_sidebarHeader__X33ii{display:flex;flex-direction:column;gap:0;padding:0}.Sidebar_sidebarSeparator__oUkYG{background-color:var(--sidebar-border);margin-left:0;margin-right:0;width:auto}.Sidebar_sidebarContent__Ywe1o{display:flex;flex:1;flex-direction:column;gap:var(--p-16);height:100vh;max-height:100vh;min-height:0;overflow:auto;position:absolute;width:100%}@media (min-width:768px){.Sidebar_sidebarContent__Ywe1o{height:calc(100vh - var(--gap-top))}}.Sidebar_sidebarContent__Ywe1o[data-collapsible=icon]{overflow:hidden}.Sidebar_sidebarGroup__7Mhg2{display:flex;flex-direction:column;min-width:0;padding:40px 0 0;position:relative;width:100%}.Sidebar_sidebarGroupLabel__5VJ-b{align-items:center;border-radius:.375rem;color:var(--sidebar-foreground);display:flex;flex-shrink:0;font-size:.75rem;font-weight:500;height:2rem;opacity:.7;outline:none;padding-left:.5rem;padding-right:.5rem;transition:margin ease-linear .2s,opacity ease-linear .2s}.Sidebar_sidebarGroupLabel__5VJ-b:focus-visible{box-shadow:0 0 0 2px var(--sidebar-ring)}.Sidebar_sidebarGroupLabel__5VJ-b>svg{flex-shrink:0;height:1rem;width:1rem}.Sidebar_sidebarGroupLabel__5VJ-b[data-collapsible=icon]{margin-top:-2rem;opacity:0}.Sidebar_sidebarGroupAction__OhVZq{align-items:center;aspect-ratio:1;border-radius:.375rem;color:var(--sidebar-foreground);display:flex;justify-content:center;outline:none;padding:0;position:absolute;right:.75rem;top:.875rem;transition:transform;width:1.25rem}.Sidebar_sidebarGroupAction__OhVZq:hover{background-color:var(--sidebar-accent);color:var(--sidebar-accent-foreground)}.Sidebar_sidebarGroupAction__OhVZq:focus-visible{box-shadow:0 0 0 2px var(--sidebar-ring)}.Sidebar_sidebarGroupAction__OhVZq>svg{flex-shrink:0;height:1rem;width:1rem}.Sidebar_sidebarGroupAction__OhVZq:after{content:\"\";inset:-.5rem;position:absolute}@media (min-width:768px){.Sidebar_sidebarGroupAction__OhVZq:after{display:none}}.Sidebar_sidebarGroupAction__OhVZq[data-collapsible=icon]{display:none}.Sidebar_sidebarMenu__hYXIo{display:flex;flex-direction:column;gap:var(--p-4);list-style:none;min-width:0;padding:0 var(--p-11) var(--p-10) var(--p-8);width:100%}@media (max-width:768px){.Sidebar_sidebarMenu__hYXIo{padding-right:var(--p-8)}}.Sidebar_sidebarMenuItem__CRhM8{cursor:pointer;position:relative}.Sidebar_sidebarMenuBadge__ttvCR{align-items:center;border-radius:.375rem;color:var(--sidebar-foreground);display:flex;font-size:.75rem;font-weight:500;height:1.25rem;justify-content:center;min-width:1.25rem;padding-left:.25rem;padding-right:.25rem;pointer-events:none;position:absolute;right:.25rem;-webkit-user-select:none;-moz-user-select:none;user-select:none}.Sidebar_sidebarMenuBadge__ttvCR[data-size=sm]{top:.25rem}.Sidebar_sidebarMenuBadge__ttvCR[data-size=md]{top:.375rem}.Sidebar_sidebarMenuBadge__ttvCR[data-size=lg]{top:.625rem}.Sidebar_sidebarMenuBadge__ttvCR[data-collapsible=icon]{display:none}.Sidebar_sidebarMenuSkeleton__u2KoI{align-items:center;border-radius:.375rem;display:flex;gap:.5rem;height:2rem;padding-left:.5rem;padding-right:.5rem}.Sidebar_sidebarMenuSkeletonIcon__-1tvv{border-radius:.375rem;height:1rem;width:1rem}.Sidebar_sidebarMenuSkeletonText__dWzWo{flex:1;height:1rem;max-width:var(--skeleton-width)}.Sidebar_sidebarMenuSub__gh8Rn{border-color:var(--sidebar-border);border-left:none;display:flex;flex-direction:column;gap:var(--p-2);list-style:none;margin-left:0;margin-right:0;min-width:0;padding:0;padding-top:var(--p-1);position:relative;transform:translateX(1px)}.Sidebar_sidebarMenuSub__gh8Rn:before{background:var(--sidebar-border);bottom:26px;content:\"\";left:var(--p-5);pointer-events:none;position:absolute;top:0;width:1px}.Sidebar_sidebarMenuSub__gh8Rn[data-collapsible=icon]{display:none}.Sidebar_sidebarMenuSubItem__fTHJa{margin-left:var(--p-6);position:relative}.Sidebar_sidebarMenuSubItem__fTHJa:before{border-bottom:1px solid var(--sidebar-border);border-bottom-left-radius:var(--p-2);border-left:1px solid var(--sidebar-border);bottom:0;content:\"\";height:var(--p-3);left:calc(var(--p-1)*-1);position:absolute;top:var(--p-2);width:var(--p-3)}.Sidebar_sidebarMenuSubItem__fTHJa a:hover{text-decoration:none}.Sidebar_sheetContentSidebar__cM2h2{color:var(--sidebar-foreground);padding:0;width:var(--sidebar-width)}.Sidebar_sheetContentSidebar__cM2h2>button{display:none}@media (max-width:768px){.Sidebar_sheetContentSidebar__cM2h2{z-index:100}}.Sidebar_sheetSidebarInner__U-SMQ{background-color:var(--sidebar);display:flex;flex-direction:column;height:100%;width:100%}.Sidebar_sidebarNone__crRsF{color:var(--sidebar-foreground);display:flex;flex-direction:column;height:100%;width:var(--sidebar-width)}.Sidebar_variant-floating__-qvkJ{padding:.5rem}.Sidebar_variant-floating__-qvkJ[data-collapsible=icon],.Sidebar_variant-inset__oTfrV[data-collapsible=icon]{width:calc(var(--sidebar-width-icon) + 1rem + 2px)}.Sidebar_variant-sidebar__fAe77[data-collapsible=icon]{width:var(--sidebar-width-icon)}.Sidebar_variant-sidebar__fAe77[data-side=left]{border-right:1px solid #e5e7eb}.Sidebar_variant-sidebar__fAe77[data-side=right]{border-left:1px solid #e5e7eb}.Sidebar_sidebarMenuButton__vIEh->span,.Sidebar_sidebarMenuSubButton__c9flh>span{min-width:0;text-transform:capitalize}.Sidebar_sidebarMenuButton__vIEh->span:first-child,.Sidebar_sidebarMenuSubButton__c9flh>span:first-child{flex-grow:1}.Sidebar_sidebarMenuButton__vIEh-{align-items:center;border-radius:var(--p-3);color:var(--sidebar-foreground);cursor:pointer;display:flex;font-size:.875rem;gap:var(--p-2);justify-content:flex-start;outline:none;overflow:hidden;padding:var(--p-6) var(--p-3);text-align:left;text-decoration:none;transition:all;width:100%}.Sidebar_sidebarMenuButton__vIEh-:visited{color:var(--sidebar-foreground)}.Sidebar_sidebarMenuButton__vIEh-:hover{text-decoration:none}.Sidebar_sidebarMenuSubItem__fTHJa:active .Sidebar_sidebarMenuButton__vIEh-,.Sidebar_sidebarMenuSubItem__fTHJa:hover .Sidebar_sidebarMenuButton__vIEh-,.Sidebar_sidebarMenuSubItem__fTHJa[data-state=open] .Sidebar_sidebarMenuButton__vIEh-{background-color:var(--sidebar-accent);color:var(--sidebar-accent-foreground)}.Sidebar_sidebarMenuButton__vIEh-:focus-visible{box-shadow:0 0 0 2px var(--sidebar-ring)}.Sidebar_sidebarMenuButton__vIEh-:disabled,.Sidebar_sidebarMenuButton__vIEh-[aria-disabled=true]{opacity:.5;pointer-events:none}.Sidebar_sidebarMenuButton__vIEh-[data-active=true]{background-color:var(--sidebar-accent);color:var(--sidebar-accent-foreground);font-weight:500}.Sidebar_sidebarMenuButton__vIEh-[data-collapsible=icon]{height:2rem!important;padding:.5rem!important;width:2rem!important}.Sidebar_sidebarMenuButton__vIEh->span{flex-grow:1;line-height:20px;overflow:hidden;white-space:nowrap}.Sidebar_sidebarMenuButton__vIEh->svg{flex-shrink:0;height:var(--p-5);width:var(--p-5)}.Sidebar_sidebarMenuButton__vIEh-.Sidebar_size-sm__7aIbu{font-size:.75rem;height:1.75rem}.Sidebar_sidebarMenuButton__vIEh-.Sidebar_size-md__rcjmO{font-size:.875rem;height:var(--p-12)}.Sidebar_sidebarMenuButton__vIEh-.Sidebar_size-lg__1k76S{font-size:.875rem;height:3rem}.Sidebar_sidebarMenuButton__vIEh-.Sidebar_size-lg__1k76S[data-collapsible=icon]{padding:0!important}.Sidebar_sidebarMenuButton__vIEh-.Sidebar_variant-outline__UmtAz{background-color:var(--background);box-shadow:0 0 0 1px var(--sidebar-border)}.Sidebar_sidebarMenuButton__vIEh-.Sidebar_variant-outline__UmtAz:hover{background-color:var(--sidebar-accent);box-shadow:0 0 0 1px var(--sidebar-accent);color:var(--sidebar-accent-foreground)}.Sidebar_sidebarMenuButtonCta__dQAhv{display:flex;justify-content:flex-start;text-align:left;width:100%}.Sidebar_sidebarMenuButtonCta__dQAhv>svg{flex-shrink:0;height:var(--p-5);width:var(--p-5)}.Sidebar_sidebarMenuAction__mFZa1{align-items:center;aspect-ratio:1;border-radius:.375rem;color:var(--sidebar-foreground);cursor:pointer;display:flex;justify-content:center;opacity:0;outline:none;padding:0;position:absolute;right:var(--p-2);top:var(--p-2);transition:transform;width:1.25rem}.Sidebar_sidebarMenuAction__mFZa1:before{background-image:linear-gradient(to left,var(--sidebar-accent) 70%,transparent 100%);content:\"\";height:100%;pointer-events:none;position:absolute;right:0;transition:opacity .2s ease-in-out;width:calc(100% + var(--p-4))}.Sidebar_sidebarMenuSubItem__fTHJa:hover .Sidebar_sidebarMenuAction__mFZa1{opacity:1}.Sidebar_sidebarMenuAction__mFZa1:focus-visible{box-shadow:0 0 0 2px var(--sidebar-ring)}.Sidebar_sidebarMenuAction__mFZa1>svg{flex-shrink:0;height:1rem;opacity:.5;pointer-events:none;transition:opacity .2s ease-in-out;width:1rem;z-index:1}.Sidebar_sidebarMenuAction__mFZa1:hover>svg{opacity:1}.Sidebar_sidebarMenuAction__mFZa1:after{content:\"\";inset:-.5rem;position:absolute}@media (min-width:768px){.Sidebar_sidebarMenuAction__mFZa1:after{display:none}}.Sidebar_sidebarMenuAction__mFZa1[data-size=sm]{top:.25rem}.Sidebar_sidebarMenuAction__mFZa1[data-size=md]{top:.375rem}.Sidebar_sidebarMenuAction__mFZa1[data-size=lg]{top:.625rem}.Sidebar_sidebarMenuAction__mFZa1[data-collapsible=icon]{display:none}.Sidebar_sidebarMenuAction__mFZa1.Sidebar_showOnHover__itXsA[data-active=true]{color:var(--sidebar-accent-foreground)}.Sidebar_sidebarMenuAction__mFZa1.Sidebar_showOnHover__itXsA[data-state=open]{opacity:1}@media (min-width:768px){.Sidebar_sidebarMenuAction__mFZa1.Sidebar_showOnHover__itXsA{opacity:0}.Sidebar_sidebarMenuAction__mFZa1.Sidebar_showOnHover__itXsA:focus-within,.Sidebar_sidebarMenuAction__mFZa1.Sidebar_showOnHover__itXsA:hover{opacity:1}}.Sidebar_sidebarMenuSubButton__c9flh{align-items:center;border-radius:var(--p-3);color:var(--sidebar-foreground);cursor:pointer;display:flex;gap:var(--p-1);height:var(--p-9);margin-left:var(--p-3);min-width:0;outline:none;overflow:hidden;padding:var(--p-1) var(--p-2);text-decoration:none;transform:translateX(-1px)}.Sidebar_sidebarMenuSubButton__c9flh:visited{color:var(--sidebar-foreground)}.Sidebar_sidebarMenuSubButton__c9flh:hover{text-decoration:none}.Sidebar_sidebarMenuSubItem__fTHJa:active .Sidebar_sidebarMenuSubButton__c9flh,.Sidebar_sidebarMenuSubItem__fTHJa:hover .Sidebar_sidebarMenuSubButton__c9flh{background-color:var(--sidebar-accent);color:var(--sidebar-accent-foreground)}.Sidebar_sidebarMenuSubButton__c9flh:focus-visible{box-shadow:0 0 0 2px var(--sidebar-ring)}.Sidebar_sidebarMenuSubButton__c9flh:disabled,.Sidebar_sidebarMenuSubButton__c9flh[aria-disabled=true]{opacity:.5;pointer-events:none}.Sidebar_sidebarMenuSubButton__c9flh[data-active=true]{background-color:var(--sidebar-accent);color:var(--sidebar-accent-foreground)}.Sidebar_sidebarMenuSubButton__c9flh[data-active=true]:visited{color:var(--sidebar-accent-foreground)}.Sidebar_sidebarMenuSubButton__c9flh[data-collapsible=icon]{display:none}.Sidebar_sidebarMenuSubButton__c9flh>span:first-child{overflow:hidden;white-space:nowrap}.Sidebar_sidebarMenuSubButton__c9flh>svg{color:var(--sidebar-accent-foreground);flex-shrink:0;height:1rem;width:1rem}.Sidebar_sidebarMenuSubButton__c9flh.Sidebar_size-sm__7aIbu{font-size:.75rem}.Sidebar_sidebarMenuSubButton__c9flh.Sidebar_size-md__rcjmO{font-size:.875rem}.Sidebar_sidebarMenuSubButton__c9flh.Sidebar_size-lg__1k76S{font-size:1rem}::view-transition-old(sidebar-container),::view-transition-old(sidebar-gap){animation-duration:.2s;animation-name:Sidebar_sidebarVtOld__hlKqn;animation-timing-function:ease-out;transform:translateZ(0)}::view-transition-new(sidebar-container),::view-transition-new(sidebar-gap){animation-duration:.2s;animation-name:Sidebar_sidebarVtNew__FFhYU;animation-timing-function:ease-out;transform:translateZ(0)}@keyframes Sidebar_sidebarVtOld__hlKqn{0%{opacity:1}to{opacity:0}}@keyframes Sidebar_sidebarVtNew__FFhYU{0%{opacity:0}to{opacity:1}}";
|
|
4
|
-
var SidebarStem = {"sidebarWrapper":"Sidebar_sidebarWrapper__DGm4P","sidebarMainShell":"Sidebar_sidebarMainShell__pSWDC","chatPanelMount":"Sidebar_chatPanelMount__1Zctx","sidebar":"Sidebar_sidebar__0vqNZ","sidebarTrigger":"Sidebar_sidebarTrigger__ipx2C","sidebarRail":"Sidebar_sidebarRail__uvSpl","sidebarResizeHandle":"Sidebar_sidebarResizeHandle__kuD6t","fullHeightResizer":"Sidebar_fullHeightResizer__jZXnw","sidebarInput":"Sidebar_sidebarInput__ujQLX","sidebarHeader":"Sidebar_sidebarHeader__X33ii","sidebarFooter":"Sidebar_sidebarFooter__V3O-l","sidebarSeparator":"Sidebar_sidebarSeparator__oUkYG","sidebarContent":"Sidebar_sidebarContent__Ywe1o","sidebarGroup":"Sidebar_sidebarGroup__7Mhg2","
|
|
3
|
+
var css_248z = "@media (max-width:768px){:root{--page-x-padding:var(--p-6);--page-y-padding:var(--p-6)}}.Sidebar_sidebarWrapper__DGm4P{align-items:stretch;display:flex;flex-direction:row;--welcome-alert-height:44px;height:calc(100% - 44px);height:calc(100% - var(--welcome-alert-height));min-height:0;width:100%}.Sidebar_sidebarWrapper__DGm4P #page-sidebar-actions{min-height:100%}@media (max-width:768px){.Sidebar_sidebarWrapper__DGm4P{flex-direction:column;height:100dvh;max-height:100dvh}}.Sidebar_sidebarMainShell__pSWDC{display:flex;flex:1;flex-direction:column;min-height:0;min-width:0}.Sidebar_chatPanelMount__1Zctx{background:var(--background);border-left:1px solid var(--border);flex:0 0 0px;flex:0 0 var(--chat-panel-width,0px);min-height:0;min-width:0;overflow:hidden;width:0;width:var(--chat-panel-width,0)}@media (max-width:768px){.Sidebar_chatPanelMount__1Zctx{border-left:none;border-top:1px solid var(--border);flex:0 0 0px;flex:0 0 var(--chat-panel-height,0px);height:0;height:var(--chat-panel-height,0);transition:flex-basis .2s ease,height .2s ease;width:100%}}.Sidebar_sidebar__0vqNZ{height:0;position:fixed;--top-offset:-10px;--gap-top:calc(var(--header-height) + var(--top-offset));align-self:flex-start;color:var(--sidebar-foreground);display:none;flex-direction:column;top:var(--gap-top);width:var(--sidebar-width)}@media (min-width:768px){.Sidebar_sidebar__0vqNZ[data-state=expanded]{display:flex;height:calc(100vh - var(--gap-top));min-height:0}}.Sidebar_sidebar__0vqNZ[data-collapsible=offcanvas]{overflow:hidden;padding:0;width:0}.Sidebar_sidebarTrigger__ipx2C{cursor:pointer;height:var(--p-5);width:var(--p-5)}.Sidebar_sidebarTrigger__ipx2C svg{height:20px;width:20px}.Sidebar_sidebarRail__uvSpl{position:absolute;inset-y:0;display:hidden;transition:all ease-out;width:1rem;z-index:20}.Sidebar_sidebarRail__uvSpl:hover:after{background-color:var(--sidebar-border)}.Sidebar_sidebarRail__uvSpl[data-side=left]{right:-1rem}.Sidebar_sidebarRail__uvSpl[data-side=right]{left:0}.Sidebar_sidebarRail__uvSpl:after{content:\"\";position:absolute;inset-y:0;left:50%;width:2px}@media (min-width:640px){.Sidebar_sidebarRail__uvSpl{display:flex}}.Sidebar_sidebarRail__uvSpl[data-side=left]{cursor:w-resize}.Sidebar_sidebarRail__uvSpl[data-side=left][data-state=collapsed],.Sidebar_sidebarRail__uvSpl[data-side=right]{cursor:e-resize}.Sidebar_sidebarRail__uvSpl[data-side=right][data-state=collapsed]{cursor:w-resize}.Sidebar_sidebarRail__uvSpl[data-collapsible=offcanvas]{transform:translateX(0)}.Sidebar_sidebarRail__uvSpl[data-collapsible=offcanvas]:hover{background-color:var(--sidebar)}.Sidebar_sidebarRail__uvSpl[data-collapsible=offcanvas]:after{left:100%}.Sidebar_sidebarRail__uvSpl[data-side=left][data-collapsible=offcanvas]{right:-.5rem}.Sidebar_sidebarRail__uvSpl[data-side=right][data-collapsible=offcanvas]{left:-.5rem}.Sidebar_sidebarResizeHandle__kuD6t{background-color:transparent;background-color:var(--page-color);border-radius:2.5px;height:calc(100vh + 200px);opacity:0;position:absolute;top:-200px;touch-action:none;transition:opacity .15s ease-out;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:5px;z-index:30}.Sidebar_sidebarResizeHandle__kuD6t:before{content:\"\";cursor:col-resize;height:100%;position:absolute;right:0;width:30px}.Sidebar_sidebarResizeHandle__kuD6t[data-side=left]{right:2px}.Sidebar_sidebarResizeHandle__kuD6t[data-side=right]{left:0}.Sidebar_sidebarResizeHandle__kuD6t:hover{opacity:1}.Sidebar_sidebarResizeHandle__kuD6t:active{opacity:0}.Sidebar_fullHeightResizer__jZXnw .Sidebar_sidebarResizeHandle__kuD6t{height:calc(100vh - var(--gap-top)*-1);top:-80px}.Sidebar_sidebarInput__ujQLX{background-color:var(--background);box-shadow:none;height:2rem;width:100%}.Sidebar_sidebarFooter__V3O-l,.Sidebar_sidebarHeader__X33ii{display:flex;flex-direction:column;gap:0;padding:0}.Sidebar_sidebarSeparator__oUkYG{background-color:var(--sidebar-border);margin-left:0;margin-right:0;width:auto}.Sidebar_sidebarContent__Ywe1o{display:flex;flex:1;flex-direction:column;gap:var(--p-16);height:100vh;max-height:100vh;min-height:0;overflow:auto;position:absolute;width:100%}@media (min-width:768px){.Sidebar_sidebarContent__Ywe1o{height:calc(100vh - var(--gap-top))}}.Sidebar_sidebarContent__Ywe1o[data-collapsible=icon]{overflow:hidden}.Sidebar_sidebarGroup__7Mhg2{display:flex;flex-direction:column;min-width:0;padding:40px 0 0;position:relative;width:100%}.Sidebar_sidebarGroupAction__OhVZq{align-items:center;aspect-ratio:1;border-radius:.375rem;color:var(--sidebar-foreground);display:flex;justify-content:center;outline:none;padding:0;position:absolute;right:.75rem;top:.875rem;transition:transform;width:1.25rem}.Sidebar_sidebarGroupAction__OhVZq:hover{background-color:var(--sidebar-accent);color:var(--sidebar-accent-foreground)}.Sidebar_sidebarGroupAction__OhVZq:focus-visible{box-shadow:0 0 0 2px var(--sidebar-ring)}.Sidebar_sidebarGroupAction__OhVZq>svg{flex-shrink:0;height:1rem;width:1rem}.Sidebar_sidebarGroupAction__OhVZq:after{content:\"\";inset:-.5rem;position:absolute}@media (min-width:768px){.Sidebar_sidebarGroupAction__OhVZq:after{display:none}}.Sidebar_sidebarGroupAction__OhVZq[data-collapsible=icon]{display:none}.Sidebar_sidebarMenu__hYXIo{display:flex;flex-direction:column;gap:var(--p-4);list-style:none;min-width:0;padding:0 var(--p-11) var(--p-10) var(--p-8);width:100%}@media (max-width:768px){.Sidebar_sidebarMenu__hYXIo{padding-right:var(--p-8)}}.Sidebar_sidebarMenuItem__CRhM8{cursor:pointer;position:relative}.Sidebar_sidebarMenuBadge__ttvCR{align-items:center;border-radius:.375rem;color:var(--sidebar-foreground);display:flex;font-size:.75rem;font-weight:500;height:1.25rem;justify-content:center;min-width:1.25rem;padding-left:.25rem;padding-right:.25rem;pointer-events:none;position:absolute;right:.25rem;-webkit-user-select:none;-moz-user-select:none;user-select:none}.Sidebar_sidebarMenuBadge__ttvCR[data-size=sm]{top:.25rem}.Sidebar_sidebarMenuBadge__ttvCR[data-size=md]{top:.375rem}.Sidebar_sidebarMenuBadge__ttvCR[data-size=lg]{top:.625rem}.Sidebar_sidebarMenuBadge__ttvCR[data-collapsible=icon]{display:none}.Sidebar_sidebarMenuSkeleton__u2KoI{align-items:center;border-radius:.375rem;display:flex;gap:.5rem;height:2rem;padding-left:.5rem;padding-right:.5rem}.Sidebar_sidebarMenuSkeletonIcon__-1tvv{border-radius:.375rem;height:1rem;width:1rem}.Sidebar_sidebarMenuSkeletonText__dWzWo{flex:1;height:1rem;max-width:var(--skeleton-width)}.Sidebar_sidebarMenuSub__gh8Rn{border-color:var(--sidebar-border);border-left:none;display:flex;flex-direction:column;gap:var(--p-2);list-style:none;margin-left:0;margin-right:0;min-width:0;padding:0;padding-top:var(--p-1);position:relative;transform:translateX(1px)}.Sidebar_sidebarMenuSub__gh8Rn:before{background:var(--sidebar-border);bottom:26px;content:\"\";left:var(--p-5);pointer-events:none;position:absolute;top:0;width:1px}.Sidebar_sidebarMenuSub__gh8Rn[data-collapsible=icon]{display:none}.Sidebar_sidebarMenuSubItem__fTHJa{margin-left:var(--p-6);position:relative}.Sidebar_sidebarMenuSubItem__fTHJa:before{border-bottom:1px solid var(--sidebar-border);border-bottom-left-radius:var(--p-2);border-left:1px solid var(--sidebar-border);bottom:0;content:\"\";height:var(--p-3);left:calc(var(--p-1)*-1);position:absolute;top:var(--p-2);width:var(--p-3)}.Sidebar_sidebarMenuSubItem__fTHJa a:hover{text-decoration:none}.Sidebar_sheetContentSidebar__cM2h2{color:var(--sidebar-foreground);padding:0;width:var(--sidebar-width)}.Sidebar_sheetContentSidebar__cM2h2>button{display:none}@media (max-width:768px){.Sidebar_sheetContentSidebar__cM2h2{z-index:100}}.Sidebar_sheetSidebarInner__U-SMQ{background-color:var(--sidebar);display:flex;flex-direction:column;height:100%;width:100%}.Sidebar_sidebarNone__crRsF{color:var(--sidebar-foreground);display:flex;flex-direction:column;height:100%;width:var(--sidebar-width)}.Sidebar_variant-floating__-qvkJ{padding:.5rem}.Sidebar_variant-floating__-qvkJ[data-collapsible=icon],.Sidebar_variant-inset__oTfrV[data-collapsible=icon]{width:calc(var(--sidebar-width-icon) + 1rem + 2px)}.Sidebar_variant-sidebar__fAe77[data-collapsible=icon]{width:var(--sidebar-width-icon)}.Sidebar_variant-sidebar__fAe77[data-side=left]{border-right:1px solid #e5e7eb}.Sidebar_variant-sidebar__fAe77[data-side=right]{border-left:1px solid #e5e7eb}.Sidebar_sidebarMenuButton__vIEh->span,.Sidebar_sidebarMenuSubButton__c9flh>span{min-width:0;text-transform:capitalize}.Sidebar_sidebarMenuButton__vIEh->span:first-child,.Sidebar_sidebarMenuSubButton__c9flh>span:first-child{flex-grow:1}.Sidebar_sidebarMenuButton__vIEh-{align-items:center;border-radius:var(--p-3);color:var(--sidebar-foreground);cursor:pointer;display:flex;font-size:.875rem;gap:var(--p-2);justify-content:flex-start;outline:none;overflow:hidden;padding:var(--p-6) var(--p-3);text-align:left;text-decoration:none;transition:all;width:100%}.Sidebar_sidebarMenuButton__vIEh-:visited{color:var(--sidebar-foreground)}.Sidebar_sidebarMenuButton__vIEh-:hover{text-decoration:none}.Sidebar_sidebarMenuSubItem__fTHJa:active .Sidebar_sidebarMenuButton__vIEh-,.Sidebar_sidebarMenuSubItem__fTHJa:hover .Sidebar_sidebarMenuButton__vIEh-,.Sidebar_sidebarMenuSubItem__fTHJa[data-state=open] .Sidebar_sidebarMenuButton__vIEh-{background-color:var(--sidebar-accent);color:var(--sidebar-accent-foreground)}.Sidebar_sidebarMenuButton__vIEh-:focus-visible{box-shadow:0 0 0 2px var(--sidebar-ring)}.Sidebar_sidebarMenuButton__vIEh-:disabled,.Sidebar_sidebarMenuButton__vIEh-[aria-disabled=true]{opacity:.5;pointer-events:none}.Sidebar_sidebarMenuButton__vIEh-[data-active=true]{background-color:var(--sidebar-accent);color:var(--sidebar-accent-foreground);font-weight:500}.Sidebar_sidebarMenuButton__vIEh-[data-collapsible=icon]{height:2rem!important;padding:.5rem!important;width:2rem!important}.Sidebar_sidebarMenuButton__vIEh->span{flex-grow:1;line-height:20px;overflow:hidden;white-space:nowrap}.Sidebar_sidebarMenuButton__vIEh->svg{flex-shrink:0;height:var(--p-5);width:var(--p-5)}.Sidebar_sidebarMenuButton__vIEh-.Sidebar_size-sm__7aIbu{font-size:.75rem;height:1.75rem}.Sidebar_sidebarMenuButton__vIEh-.Sidebar_size-md__rcjmO{font-size:.875rem;height:var(--p-12)}.Sidebar_sidebarMenuButton__vIEh-.Sidebar_size-lg__1k76S{font-size:.875rem;height:3rem}.Sidebar_sidebarMenuButton__vIEh-.Sidebar_size-lg__1k76S[data-collapsible=icon]{padding:0!important}.Sidebar_sidebarMenuButton__vIEh-.Sidebar_variant-outline__UmtAz{background-color:var(--background);box-shadow:0 0 0 1px var(--sidebar-border)}.Sidebar_sidebarMenuButton__vIEh-.Sidebar_variant-outline__UmtAz:hover{background-color:var(--sidebar-accent);box-shadow:0 0 0 1px var(--sidebar-accent);color:var(--sidebar-accent-foreground)}.Sidebar_sidebarMenuButtonCta__dQAhv{display:flex;justify-content:flex-start;text-align:left;width:100%}.Sidebar_sidebarMenuButtonCta__dQAhv>svg{flex-shrink:0;height:var(--p-5);width:var(--p-5)}.Sidebar_sidebarMenuAction__mFZa1{align-items:center;aspect-ratio:1;border-radius:.375rem;color:var(--sidebar-foreground);cursor:pointer;display:flex;justify-content:center;opacity:0;outline:none;padding:0;position:absolute;right:var(--p-2);top:var(--p-2);transition:transform;width:1.25rem}.Sidebar_sidebarMenuAction__mFZa1:before{background-image:linear-gradient(to left,var(--sidebar-accent) 70%,transparent 100%);content:\"\";height:100%;pointer-events:none;position:absolute;right:0;transition:opacity .2s ease-in-out;width:calc(100% + var(--p-4))}.Sidebar_sidebarMenuSubItem__fTHJa:hover .Sidebar_sidebarMenuAction__mFZa1{opacity:1}.Sidebar_sidebarMenuAction__mFZa1:focus-visible{box-shadow:0 0 0 2px var(--sidebar-ring)}.Sidebar_sidebarMenuAction__mFZa1>svg{flex-shrink:0;height:1rem;opacity:.5;pointer-events:none;transition:opacity .2s ease-in-out;width:1rem;z-index:1}.Sidebar_sidebarMenuAction__mFZa1:hover>svg{opacity:1}.Sidebar_sidebarMenuAction__mFZa1:after{content:\"\";inset:-.5rem;position:absolute}@media (min-width:768px){.Sidebar_sidebarMenuAction__mFZa1:after{display:none}}.Sidebar_sidebarMenuAction__mFZa1[data-size=sm]{top:.25rem}.Sidebar_sidebarMenuAction__mFZa1[data-size=md]{top:.375rem}.Sidebar_sidebarMenuAction__mFZa1[data-size=lg]{top:.625rem}.Sidebar_sidebarMenuAction__mFZa1[data-collapsible=icon]{display:none}.Sidebar_sidebarMenuAction__mFZa1.Sidebar_showOnHover__itXsA[data-active=true]{color:var(--sidebar-accent-foreground)}.Sidebar_sidebarMenuAction__mFZa1.Sidebar_showOnHover__itXsA[data-state=open]{opacity:1}@media (min-width:768px){.Sidebar_sidebarMenuAction__mFZa1.Sidebar_showOnHover__itXsA{opacity:0}.Sidebar_sidebarMenuAction__mFZa1.Sidebar_showOnHover__itXsA:focus-within,.Sidebar_sidebarMenuAction__mFZa1.Sidebar_showOnHover__itXsA:hover{opacity:1}}.Sidebar_sidebarMenuSubButton__c9flh{align-items:center;border-radius:var(--p-3);color:var(--sidebar-foreground);cursor:pointer;display:flex;gap:var(--p-1);height:var(--p-9);margin-left:var(--p-3);min-width:0;outline:none;overflow:hidden;padding:var(--p-1) var(--p-2);text-decoration:none;transform:translateX(-1px)}.Sidebar_sidebarMenuSubButton__c9flh:visited{color:var(--sidebar-foreground)}.Sidebar_sidebarMenuSubButton__c9flh:hover{text-decoration:none}.Sidebar_sidebarMenuSubItem__fTHJa:active .Sidebar_sidebarMenuSubButton__c9flh,.Sidebar_sidebarMenuSubItem__fTHJa:hover .Sidebar_sidebarMenuSubButton__c9flh{background-color:var(--sidebar-accent);color:var(--sidebar-accent-foreground)}.Sidebar_sidebarMenuSubButton__c9flh:focus-visible{box-shadow:0 0 0 2px var(--sidebar-ring)}.Sidebar_sidebarMenuSubButton__c9flh:disabled,.Sidebar_sidebarMenuSubButton__c9flh[aria-disabled=true]{opacity:.5;pointer-events:none}.Sidebar_sidebarMenuSubButton__c9flh[data-active=true]{background-color:var(--sidebar-accent);color:var(--sidebar-accent-foreground)}.Sidebar_sidebarMenuSubButton__c9flh[data-active=true]:visited{color:var(--sidebar-accent-foreground)}.Sidebar_sidebarMenuSubButton__c9flh[data-collapsible=icon]{display:none}.Sidebar_sidebarMenuSubButton__c9flh>span:first-child{overflow:hidden;white-space:nowrap}.Sidebar_sidebarMenuSubButton__c9flh>svg{color:var(--sidebar-accent-foreground);flex-shrink:0;height:1rem;width:1rem}.Sidebar_sidebarMenuSubButton__c9flh.Sidebar_size-sm__7aIbu{font-size:.75rem}.Sidebar_sidebarMenuSubButton__c9flh.Sidebar_size-md__rcjmO{font-size:.875rem}.Sidebar_sidebarMenuSubButton__c9flh.Sidebar_size-lg__1k76S{font-size:1rem}::view-transition-old(sidebar-container),::view-transition-old(sidebar-gap){animation-duration:.2s;animation-name:Sidebar_sidebarVtOld__hlKqn;animation-timing-function:ease-out;transform:translateZ(0)}::view-transition-new(sidebar-container),::view-transition-new(sidebar-gap){animation-duration:.2s;animation-name:Sidebar_sidebarVtNew__FFhYU;animation-timing-function:ease-out;transform:translateZ(0)}@keyframes Sidebar_sidebarVtOld__hlKqn{0%{opacity:1}to{opacity:0}}@keyframes Sidebar_sidebarVtNew__FFhYU{0%{opacity:0}to{opacity:1}}";
|
|
4
|
+
var SidebarStem = {"sidebarWrapper":"Sidebar_sidebarWrapper__DGm4P","sidebarMainShell":"Sidebar_sidebarMainShell__pSWDC","chatPanelMount":"Sidebar_chatPanelMount__1Zctx","sidebar":"Sidebar_sidebar__0vqNZ","sidebarTrigger":"Sidebar_sidebarTrigger__ipx2C","sidebarRail":"Sidebar_sidebarRail__uvSpl","sidebarResizeHandle":"Sidebar_sidebarResizeHandle__kuD6t","fullHeightResizer":"Sidebar_fullHeightResizer__jZXnw","sidebarInput":"Sidebar_sidebarInput__ujQLX","sidebarHeader":"Sidebar_sidebarHeader__X33ii","sidebarFooter":"Sidebar_sidebarFooter__V3O-l","sidebarSeparator":"Sidebar_sidebarSeparator__oUkYG","sidebarContent":"Sidebar_sidebarContent__Ywe1o","sidebarGroup":"Sidebar_sidebarGroup__7Mhg2","sidebarGroupAction":"Sidebar_sidebarGroupAction__OhVZq","sidebarMenu":"Sidebar_sidebarMenu__hYXIo","sidebarMenuItem":"Sidebar_sidebarMenuItem__CRhM8","sidebarMenuBadge":"Sidebar_sidebarMenuBadge__ttvCR","sidebarMenuSkeleton":"Sidebar_sidebarMenuSkeleton__u2KoI","sidebarMenuSkeletonIcon":"Sidebar_sidebarMenuSkeletonIcon__-1tvv","sidebarMenuSkeletonText":"Sidebar_sidebarMenuSkeletonText__dWzWo","sidebarMenuSub":"Sidebar_sidebarMenuSub__gh8Rn","sidebarMenuSubItem":"Sidebar_sidebarMenuSubItem__fTHJa","sheetContentSidebar":"Sidebar_sheetContentSidebar__cM2h2","sheetSidebarInner":"Sidebar_sheetSidebarInner__U-SMQ","sidebarNone":"Sidebar_sidebarNone__crRsF","variant-floating":"Sidebar_variant-floating__-qvkJ","variant-inset":"Sidebar_variant-inset__oTfrV","variant-sidebar":"Sidebar_variant-sidebar__fAe77","sidebarMenuButton":"Sidebar_sidebarMenuButton__vIEh-","sidebarMenuSubButton":"Sidebar_sidebarMenuSubButton__c9flh","size-sm":"Sidebar_size-sm__7aIbu","size-md":"Sidebar_size-md__rcjmO","size-lg":"Sidebar_size-lg__1k76S","variant-outline":"Sidebar_variant-outline__UmtAz","sidebarMenuButtonCta":"Sidebar_sidebarMenuButtonCta__dQAhv","sidebarMenuAction":"Sidebar_sidebarMenuAction__mFZa1","showOnHover":"Sidebar_showOnHover__itXsA","sidebarVtOld":"Sidebar_sidebarVtOld__hlKqn","sidebarVtNew":"Sidebar_sidebarVtNew__FFhYU"};
|
|
5
5
|
styleInject(css_248z);
|
|
6
6
|
|
|
7
7
|
export { SidebarStem as default };
|
package/dist/esm/components/widgets/SidebarDatasetsItemsGrouped/SidebarDatasetsItemsGrouped.js
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import { useMemo, useState, useEffect } from 'react';
|
|
3
|
+
import { SidebarGroup, SidebarMenu, SidebarMenuItem, SidebarMenuButton, SidebarMenuSub, SidebarMenuSubItem, SidebarMenuSubButton } from '../../ui/Sidebar/Sidebar.js';
|
|
4
|
+
import { SmartTextTruncate } from '../../ui/SmartTextTruncate/SmartTextTruncate.js';
|
|
5
|
+
import { PackageOpen, ChevronDown, ChevronRight } from 'lucide-react';
|
|
6
|
+
import S from './SidebarDatasetsItemsGrouped.styl.js';
|
|
7
|
+
import { groupSidebarDatasets } from './groupSidebarDatasets.js';
|
|
8
|
+
|
|
9
|
+
function SidebarDatasetsItemsGrouped({ groupBy, datasets, selectedDatasetId, onDatasetClick, defaultExpandedGroupNames, className, }) {
|
|
10
|
+
const grouped = useMemo(() => groupSidebarDatasets(datasets, groupBy), [datasets, groupBy]);
|
|
11
|
+
const [expanded, setExpanded] = useState(new Set());
|
|
12
|
+
useEffect(() => {
|
|
13
|
+
if (defaultExpandedGroupNames !== undefined) {
|
|
14
|
+
setExpanded(new Set(defaultExpandedGroupNames));
|
|
15
|
+
}
|
|
16
|
+
else {
|
|
17
|
+
setExpanded(new Set(grouped.map(([name]) => name)));
|
|
18
|
+
}
|
|
19
|
+
}, [grouped, defaultExpandedGroupNames]);
|
|
20
|
+
useEffect(() => {
|
|
21
|
+
if (selectedDatasetId == null)
|
|
22
|
+
return;
|
|
23
|
+
const groupName = grouped.find(([, ds]) => ds.some(d => d.id === selectedDatasetId))?.[0];
|
|
24
|
+
if (groupName) {
|
|
25
|
+
setExpanded(prev => new Set(prev).add(groupName));
|
|
26
|
+
}
|
|
27
|
+
}, [selectedDatasetId, grouped]);
|
|
28
|
+
const toggleGroup = (name) => {
|
|
29
|
+
setExpanded(prev => {
|
|
30
|
+
const next = new Set(prev);
|
|
31
|
+
if (next.has(name))
|
|
32
|
+
next.delete(name);
|
|
33
|
+
else
|
|
34
|
+
next.add(name);
|
|
35
|
+
return next;
|
|
36
|
+
});
|
|
37
|
+
};
|
|
38
|
+
return (jsx(SidebarGroup, { className: className, children: jsx(SidebarMenu, { children: grouped.map(([groupName, groupDatasets]) => {
|
|
39
|
+
const isExpanded = expanded.has(groupName);
|
|
40
|
+
const parentActive = groupDatasets.some(d => d.id === selectedDatasetId);
|
|
41
|
+
return (jsxs(SidebarMenuItem, { children: [jsxs(SidebarMenuButton, { type: "button", isActive: parentActive, onClick: () => toggleGroup(groupName), children: [jsx(PackageOpen, { strokeWidth: 1.5, size: 16 }), jsx(SmartTextTruncate, { children: groupName }), jsx("div", { className: S.chevronContainer, children: isExpanded ? (jsx(ChevronDown, { size: 12 })) : (jsx(ChevronRight, { size: 12 })) })] }), isExpanded && (jsxs(SidebarMenuSub, { className: S.subMenuContainer, children: [jsx("div", { className: S.subMenuBorder }), groupDatasets.map(dataset => (jsx(SidebarMenuSubItem, { className: S.subMenuItem, children: jsx(SidebarMenuSubButton, { href: `#dataset-${dataset.id}`, isActive: dataset.id === selectedDatasetId, onClick: e => {
|
|
42
|
+
e.preventDefault();
|
|
43
|
+
onDatasetClick?.(dataset.id);
|
|
44
|
+
}, children: jsx(SmartTextTruncate, { children: dataset.name }) }) }, dataset.id)))] }))] }, groupName));
|
|
45
|
+
}) }) }));
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export { SidebarDatasetsItemsGrouped };
|
package/dist/esm/components/widgets/SidebarDatasetsItemsGrouped/SidebarDatasetsItemsGrouped.styl.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import styleInject from 'style-inject';
|
|
2
|
+
|
|
3
|
+
var css_248z = ".SidebarDatasetsItemsGrouped_chevronContainer__CoQnn{margin-left:auto}.SidebarDatasetsItemsGrouped_subMenuContainer__utcha{position:relative}.SidebarDatasetsItemsGrouped_subMenuBorder__LN-Fq{background:var(--sidebar-border);bottom:26px;left:var(--p-5);position:absolute;top:0;width:1px}.SidebarDatasetsItemsGrouped_subMenuItem__9gFCe{margin-left:var(--p-6);position:relative}.SidebarDatasetsItemsGrouped_subMenuItem__9gFCe:before{border-bottom:1px solid var(--sidebar-border);border-bottom-left-radius:var(--p-2);border-left:1px solid var(--sidebar-border);bottom:0;content:\"\";height:var(--p-3);left:calc(var(--p-1)*-1);position:absolute;top:var(--p-2);width:var(--p-3)}";
|
|
4
|
+
var S = {"chevronContainer":"SidebarDatasetsItemsGrouped_chevronContainer__CoQnn","subMenuContainer":"SidebarDatasetsItemsGrouped_subMenuContainer__utcha","subMenuBorder":"SidebarDatasetsItemsGrouped_subMenuBorder__LN-Fq","subMenuItem":"SidebarDatasetsItemsGrouped_subMenuItem__9gFCe"};
|
|
5
|
+
styleInject(css_248z);
|
|
6
|
+
|
|
7
|
+
export { S as default };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
function groupSidebarDatasets(datasets, groupBy) {
|
|
2
|
+
const grouped = {};
|
|
3
|
+
datasets.forEach(dataset => {
|
|
4
|
+
if (groupBy === 'target_type') {
|
|
5
|
+
const key = dataset.target_type?.name || 'Unknown';
|
|
6
|
+
if (!grouped[key])
|
|
7
|
+
grouped[key] = [];
|
|
8
|
+
grouped[key].push(dataset);
|
|
9
|
+
}
|
|
10
|
+
else if (groupBy === 'regions') {
|
|
11
|
+
if (dataset.regions && dataset.regions.length > 0) {
|
|
12
|
+
const mostSpecificRegion = dataset.regions[dataset.regions.length - 1];
|
|
13
|
+
const key = mostSpecificRegion.name || 'Unknown';
|
|
14
|
+
if (!grouped[key])
|
|
15
|
+
grouped[key] = [];
|
|
16
|
+
grouped[key].push(dataset);
|
|
17
|
+
}
|
|
18
|
+
else {
|
|
19
|
+
const key = 'No Region';
|
|
20
|
+
if (!grouped[key])
|
|
21
|
+
grouped[key] = [];
|
|
22
|
+
grouped[key].push(dataset);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
const key = dataset.category?.name || 'Unknown';
|
|
27
|
+
if (!grouped[key])
|
|
28
|
+
grouped[key] = [];
|
|
29
|
+
grouped[key].push(dataset);
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
return Object.entries(grouped)
|
|
33
|
+
.map(([name, ds]) => [name, [...ds].sort((a, b) => a.name.localeCompare(b.name))])
|
|
34
|
+
.filter(([, ds]) => ds.length > 0)
|
|
35
|
+
.sort((a, b) => a[0].localeCompare(b[0]));
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export { groupSidebarDatasets };
|
package/dist/esm/index.js
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
4
|
-
export { sendChatMessage } from './mini-app/miniAppChatBridge.js';
|
|
5
|
-
export { MiniAppRoot, useMiniAppShellTheme } from './mini-app/MiniAppRoot.js';
|
|
1
|
+
export { SybilionAuthProvider, createSybilionApiFetch, sybilionApiFetch, useSybilionApiFetch, useSybilionAuth } from './sybilion-auth/SybilionAuthProvider.js';
|
|
2
|
+
export { SYBILION_AUTH_LOGIN_PATH, normalizeApiBaseUrl } from './sybilion-auth/authPaths.js';
|
|
3
|
+
export { exchangeAuth0AccessTokenForSybilionJwt } from './sybilion-auth/exchangeSybilionToken.js';
|
|
6
4
|
export { ChatContext, ChatProvider, useChat, useChats, useChatsForDataset, useChatsForScopeId, useCurrentChat } from './contexts/chat-context.js';
|
|
7
5
|
export { AnalysesSelector } from './components/ui/AnalysesSelector/AnalysesSelector.js';
|
|
8
6
|
export { AnalysisLineIcon } from './components/ui/AnalysisLineIcon/AnalysisLineIcon.js';
|
|
@@ -78,6 +76,8 @@ export { Toggle } from './components/ui/Toggle/Toggle.js';
|
|
|
78
76
|
export { ToggleGroup, ToggleGroupItem } from './components/ui/ToggleGroup/ToggleGroup.js';
|
|
79
77
|
export { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from './components/ui/Tooltip/Tooltip.js';
|
|
80
78
|
export { VimeoEmbed } from './components/ui/VimeoEmbed/VimeoEmbed.js';
|
|
79
|
+
export { SidebarDatasetsItemsGrouped } from './components/widgets/SidebarDatasetsItemsGrouped/SidebarDatasetsItemsGrouped.js';
|
|
80
|
+
export { groupSidebarDatasets } from './components/widgets/SidebarDatasetsItemsGrouped/groupSidebarDatasets.js';
|
|
81
81
|
export { ChartTooltipItem } from './components/ui/Chart/components/ChartTooltipItem.js';
|
|
82
82
|
export { ChartLegendItem } from './components/ui/Chart/components/ChartLegendItem.js';
|
|
83
83
|
export { CustomChartLegend } from './components/ui/Chart/components/CustomChartLegend/CustomChartLegend.js';
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { Auth0Provider, useAuth0 } from '@auth0/auth0-react';
|
|
3
|
+
import { createContext, useContext, useMemo, useRef, useState, useCallback, useEffect } from 'react';
|
|
4
|
+
import { normalizeApiBaseUrl } from './authPaths.js';
|
|
5
|
+
import { exchangeAuth0AccessTokenForSybilionJwt } from './exchangeSybilionToken.js';
|
|
6
|
+
|
|
7
|
+
const DEFAULT_TOKEN_KEY = 'sybilion.standalone.jwt';
|
|
8
|
+
const SybilionAuthContext = createContext(null);
|
|
9
|
+
function useSybilionAuth() {
|
|
10
|
+
const v = useContext(SybilionAuthContext);
|
|
11
|
+
if (!v) {
|
|
12
|
+
throw new Error('useSybilionAuth must be used within SybilionAuthProvider');
|
|
13
|
+
}
|
|
14
|
+
return v;
|
|
15
|
+
}
|
|
16
|
+
/** fetch() relative to Sybilion API base with Bearer Sybilion JWT. */
|
|
17
|
+
async function sybilionApiFetch(apiBaseUrl, bearerToken, path, init = {}) {
|
|
18
|
+
const base = normalizeApiBaseUrl(apiBaseUrl);
|
|
19
|
+
const url = path.startsWith('http')
|
|
20
|
+
? path
|
|
21
|
+
: `${base}${path.startsWith('/') ? path : `/${path}`}`;
|
|
22
|
+
const headers = new Headers(init.headers);
|
|
23
|
+
headers.set('Authorization', `Bearer ${bearerToken}`);
|
|
24
|
+
if (!headers.has('Accept'))
|
|
25
|
+
headers.set('Accept', 'application/json');
|
|
26
|
+
return fetch(url, { ...init, headers });
|
|
27
|
+
}
|
|
28
|
+
function createSybilionApiFetch(apiBaseUrl, getSybilionAccessToken) {
|
|
29
|
+
return async function sybilionFetch(path, init) {
|
|
30
|
+
const token = await getSybilionAccessToken();
|
|
31
|
+
if (!token)
|
|
32
|
+
throw new Error('Sybilion API: missing token — user not signed in.');
|
|
33
|
+
return sybilionApiFetch(apiBaseUrl, token, path, init);
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
/** Authenticated fetch using {@link useSybilionAuth} context. */
|
|
37
|
+
function useSybilionApiFetch() {
|
|
38
|
+
const { apiBaseUrl, getSybilionAccessToken } = useSybilionAuth();
|
|
39
|
+
return useMemo(() => createSybilionApiFetch(apiBaseUrl, getSybilionAccessToken), [apiBaseUrl, getSybilionAccessToken]);
|
|
40
|
+
}
|
|
41
|
+
function writeLs(key, value) {
|
|
42
|
+
if (typeof localStorage === 'undefined')
|
|
43
|
+
return;
|
|
44
|
+
try {
|
|
45
|
+
if (value === null)
|
|
46
|
+
localStorage.removeItem(key);
|
|
47
|
+
else
|
|
48
|
+
localStorage.setItem(key, value);
|
|
49
|
+
}
|
|
50
|
+
catch {
|
|
51
|
+
/* quota / blocked */
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
function InnerSybilionSession({ children, apiBaseUrl, storageKey, logoutReturnTo, }) {
|
|
55
|
+
const auth0 = useAuth0();
|
|
56
|
+
const auth0Ref = useRef(auth0);
|
|
57
|
+
auth0Ref.current = auth0;
|
|
58
|
+
const [sybilionToken, setSybilionToken] = useState(null);
|
|
59
|
+
const [exchangeLoading, setExchangeLoading] = useState(false);
|
|
60
|
+
const [exchangeError, setExchangeError] = useState(null);
|
|
61
|
+
const persistToken = useCallback((t) => {
|
|
62
|
+
setSybilionToken(t);
|
|
63
|
+
writeLs(storageKey, t);
|
|
64
|
+
}, [storageKey]);
|
|
65
|
+
const doLogout = useCallback(() => {
|
|
66
|
+
persistToken(null);
|
|
67
|
+
setExchangeError(null);
|
|
68
|
+
const returnTo = logoutReturnTo ??
|
|
69
|
+
(typeof window !== 'undefined' ? window.location.origin : undefined);
|
|
70
|
+
auth0Ref.current.logout({
|
|
71
|
+
logoutParams: returnTo ? { returnTo } : undefined,
|
|
72
|
+
});
|
|
73
|
+
}, [persistToken, logoutReturnTo]);
|
|
74
|
+
useEffect(() => {
|
|
75
|
+
if (!auth0.isAuthenticated || !auth0.user?.sub) {
|
|
76
|
+
persistToken(null);
|
|
77
|
+
}
|
|
78
|
+
}, [auth0.isAuthenticated, auth0.user?.sub, persistToken]);
|
|
79
|
+
useEffect(() => {
|
|
80
|
+
if (!auth0.isAuthenticated || !auth0.user?.sub) {
|
|
81
|
+
setExchangeLoading(false);
|
|
82
|
+
setExchangeError(null);
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
let cancelled = false;
|
|
86
|
+
const runExchange = async () => {
|
|
87
|
+
setExchangeLoading(true);
|
|
88
|
+
setExchangeError(null);
|
|
89
|
+
try {
|
|
90
|
+
const access = await auth0Ref.current.getAccessTokenSilently();
|
|
91
|
+
const jwt = await exchangeAuth0AccessTokenForSybilionJwt(apiBaseUrl, access);
|
|
92
|
+
if (cancelled)
|
|
93
|
+
return;
|
|
94
|
+
persistToken(jwt);
|
|
95
|
+
}
|
|
96
|
+
catch (e) {
|
|
97
|
+
if (cancelled)
|
|
98
|
+
return;
|
|
99
|
+
persistToken(null);
|
|
100
|
+
const msg = e instanceof Error ? e.message : 'Sybilion auth exchange failed';
|
|
101
|
+
setExchangeError(msg);
|
|
102
|
+
doLogout();
|
|
103
|
+
}
|
|
104
|
+
finally {
|
|
105
|
+
if (!cancelled)
|
|
106
|
+
setExchangeLoading(false);
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
runExchange();
|
|
110
|
+
return () => {
|
|
111
|
+
cancelled = true;
|
|
112
|
+
};
|
|
113
|
+
}, [
|
|
114
|
+
apiBaseUrl,
|
|
115
|
+
auth0.isAuthenticated,
|
|
116
|
+
auth0.user?.sub,
|
|
117
|
+
persistToken,
|
|
118
|
+
doLogout,
|
|
119
|
+
]);
|
|
120
|
+
const getAuth0AccessToken = useCallback(async () => {
|
|
121
|
+
if (!auth0.isAuthenticated)
|
|
122
|
+
return undefined;
|
|
123
|
+
try {
|
|
124
|
+
return await auth0.getAccessTokenSilently();
|
|
125
|
+
}
|
|
126
|
+
catch {
|
|
127
|
+
return undefined;
|
|
128
|
+
}
|
|
129
|
+
}, [auth0]);
|
|
130
|
+
const getSybilionAccessToken = useCallback(async () => {
|
|
131
|
+
return sybilionToken;
|
|
132
|
+
}, [sybilionToken]);
|
|
133
|
+
const logout = useCallback(() => {
|
|
134
|
+
doLogout();
|
|
135
|
+
}, [doLogout]);
|
|
136
|
+
const isAuthenticated = Boolean(auth0.isAuthenticated && sybilionToken && !exchangeError);
|
|
137
|
+
const isLoading = auth0.isLoading ||
|
|
138
|
+
exchangeLoading ||
|
|
139
|
+
(Boolean(auth0.isAuthenticated && auth0.user) &&
|
|
140
|
+
sybilionToken === null &&
|
|
141
|
+
exchangeError === null);
|
|
142
|
+
const value = useMemo(() => ({
|
|
143
|
+
apiBaseUrl,
|
|
144
|
+
isLoading,
|
|
145
|
+
isAuthenticated,
|
|
146
|
+
sybilionAccessToken: sybilionToken,
|
|
147
|
+
error: exchangeError ?? auth0.error?.message ?? null,
|
|
148
|
+
loginWithRedirect: auth0.loginWithRedirect,
|
|
149
|
+
logout,
|
|
150
|
+
getAuth0AccessToken,
|
|
151
|
+
getSybilionAccessToken,
|
|
152
|
+
}), [
|
|
153
|
+
apiBaseUrl,
|
|
154
|
+
isLoading,
|
|
155
|
+
isAuthenticated,
|
|
156
|
+
sybilionToken,
|
|
157
|
+
exchangeError,
|
|
158
|
+
auth0.error?.message,
|
|
159
|
+
auth0.loginWithRedirect,
|
|
160
|
+
logout,
|
|
161
|
+
getAuth0AccessToken,
|
|
162
|
+
getSybilionAccessToken,
|
|
163
|
+
]);
|
|
164
|
+
return (jsx(SybilionAuthContext.Provider, { value: value, children: children }));
|
|
165
|
+
}
|
|
166
|
+
function SybilionAuthProvider({ children, apiBaseUrl, auth0Domain, auth0ClientId, redirectUri, authorizationParams, sybilionTokenStorageKey = DEFAULT_TOKEN_KEY, logoutReturnTo, }) {
|
|
167
|
+
const mergedAuthParams = useMemo(() => ({
|
|
168
|
+
redirect_uri: authorizationParams?.redirect_uri ?? redirectUri,
|
|
169
|
+
audience: authorizationParams?.audience ?? `https://${auth0Domain}/api/v2/`,
|
|
170
|
+
scope: authorizationParams?.scope ??
|
|
171
|
+
'openid profile email offline_access update:current_user_metadata',
|
|
172
|
+
}), [
|
|
173
|
+
authorizationParams?.audience,
|
|
174
|
+
authorizationParams?.scope,
|
|
175
|
+
authorizationParams?.redirect_uri,
|
|
176
|
+
redirectUri,
|
|
177
|
+
auth0Domain,
|
|
178
|
+
]);
|
|
179
|
+
const cookieOpts = typeof window !== 'undefined'
|
|
180
|
+
? { cookieDomain: window.location.hostname }
|
|
181
|
+
: {};
|
|
182
|
+
return (jsx(Auth0Provider, { domain: auth0Domain, clientId: auth0ClientId, authorizationParams: mergedAuthParams, cacheLocation: "localstorage", useRefreshTokens: true, ...cookieOpts, children: jsx(InnerSybilionSession, { apiBaseUrl: apiBaseUrl, storageKey: sybilionTokenStorageKey, logoutReturnTo: logoutReturnTo, children: children }) }));
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
export { SybilionAuthProvider, createSybilionApiFetch, sybilionApiFetch, useSybilionApiFetch, useSybilionAuth };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** Sybilion platform auth exchange route (joined with trimmed API base URL). */
|
|
2
|
+
const SYBILION_AUTH_LOGIN_PATH = '/v1/auth/login';
|
|
3
|
+
function normalizeApiBaseUrl(url) {
|
|
4
|
+
return url.replace(/\/$/, '');
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export { SYBILION_AUTH_LOGIN_PATH, normalizeApiBaseUrl };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { normalizeApiBaseUrl, SYBILION_AUTH_LOGIN_PATH } from './authPaths.js';
|
|
2
|
+
|
|
3
|
+
/** POST `{ identity: auth0AccessToken, type: 'auth0' }` → Sybilion API JWT string. */
|
|
4
|
+
async function exchangeAuth0AccessTokenForSybilionJwt(apiBaseUrl, auth0AccessToken) {
|
|
5
|
+
const base = normalizeApiBaseUrl(apiBaseUrl);
|
|
6
|
+
const res = await fetch(`${base}${SYBILION_AUTH_LOGIN_PATH}`, {
|
|
7
|
+
method: 'POST',
|
|
8
|
+
headers: {
|
|
9
|
+
Accept: 'application/json',
|
|
10
|
+
'Content-Type': 'application/json',
|
|
11
|
+
},
|
|
12
|
+
body: JSON.stringify({ identity: auth0AccessToken, type: 'auth0' }),
|
|
13
|
+
});
|
|
14
|
+
const json = await res.json().catch(() => ({}));
|
|
15
|
+
const pickToken = () => {
|
|
16
|
+
if (!json || typeof json !== 'object')
|
|
17
|
+
return undefined;
|
|
18
|
+
const o = json;
|
|
19
|
+
const nested = o.data;
|
|
20
|
+
if (nested && typeof nested === 'object' && 'token' in nested) {
|
|
21
|
+
const t = nested.token;
|
|
22
|
+
return typeof t === 'string' ? t : undefined;
|
|
23
|
+
}
|
|
24
|
+
const t = o.token;
|
|
25
|
+
return typeof t === 'string' ? t : undefined;
|
|
26
|
+
};
|
|
27
|
+
const token = pickToken();
|
|
28
|
+
if (!res.ok || token === undefined) {
|
|
29
|
+
const msg = json &&
|
|
30
|
+
typeof json === 'object' &&
|
|
31
|
+
'message' in json &&
|
|
32
|
+
typeof json.message === 'string'
|
|
33
|
+
? json.message
|
|
34
|
+
: `Sybilion auth failed (${res.status})`;
|
|
35
|
+
throw new Error(msg);
|
|
36
|
+
}
|
|
37
|
+
return token;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export { exchangeAuth0AccessTokenForSybilionJwt };
|
|
@@ -3,7 +3,7 @@ declare const Input: React.ForwardRefExoticComponent<(Omit<Omit<React.DetailedHT
|
|
|
3
3
|
type?: React.ComponentProps<"input">["type"];
|
|
4
4
|
size?: "sm" | "md" | "lg";
|
|
5
5
|
variant?: "default" | "clean";
|
|
6
|
-
}, "ref"> | Omit<Omit<React.DetailedHTMLProps<React.TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, "
|
|
6
|
+
}, "ref"> | Omit<Omit<React.DetailedHTMLProps<React.TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, "size" | "type"> & {
|
|
7
7
|
type: "textarea";
|
|
8
8
|
size?: "sm" | "md" | "lg";
|
|
9
9
|
variant?: "default" | "clean";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type SidebarDatasetsItemsGroupBy, type SidebarDatasetsItemsGroupedDataset } from './groupSidebarDatasets';
|
|
2
|
+
export type SidebarDatasetsItemsGroupedProps = {
|
|
3
|
+
groupBy: SidebarDatasetsItemsGroupBy;
|
|
4
|
+
datasets: SidebarDatasetsItemsGroupedDataset[];
|
|
5
|
+
selectedDatasetId?: number;
|
|
6
|
+
onDatasetClick?: (datasetId: number) => void;
|
|
7
|
+
/** When omitted, all groups start expanded. */
|
|
8
|
+
defaultExpandedGroupNames?: string[];
|
|
9
|
+
className?: string;
|
|
10
|
+
};
|
|
11
|
+
export declare function SidebarDatasetsItemsGrouped({ groupBy, datasets, selectedDatasetId, onDatasetClick, defaultExpandedGroupNames, className, }: SidebarDatasetsItemsGroupedProps): import("react/jsx-runtime").JSX.Element;
|
package/dist/esm/types/src/components/widgets/SidebarDatasetsItemsGrouped/groupSidebarDatasets.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { SybilionDatasetSnapshot } from '#uilib/types/sybilionDatasetSnapshots';
|
|
2
|
+
export type SidebarDatasetsItemsGroupedDataset = SybilionDatasetSnapshot;
|
|
3
|
+
export type SidebarDatasetsItemsGroupBy = 'target_type' | 'regions' | 'categories';
|
|
4
|
+
export type GroupedSidebarDatasetsEntry = readonly [
|
|
5
|
+
groupName: string,
|
|
6
|
+
datasets: SidebarDatasetsItemsGroupedDataset[]
|
|
7
|
+
];
|
|
8
|
+
export declare function groupSidebarDatasets(datasets: SidebarDatasetsItemsGroupedDataset[], groupBy: SidebarDatasetsItemsGroupBy): GroupedSidebarDatasetsEntry[];
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { SidebarDatasetsItemsGrouped, type SidebarDatasetsItemsGroupedProps, } from './SidebarDatasetsItemsGrouped';
|
|
2
|
+
export type { GroupedSidebarDatasetsEntry, SidebarDatasetsItemsGroupBy, SidebarDatasetsItemsGroupedDataset, } from './groupSidebarDatasets';
|
|
3
|
+
export { groupSidebarDatasets } from './groupSidebarDatasets';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function SidebarDatasetsItemsGroupedPage(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function SybilionAuthProviderPage(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
export * from './
|
|
1
|
+
export * from './sybilion-auth';
|
|
2
|
+
export * from './types/sybilionDatasetSnapshots';
|
|
2
3
|
export * from './contexts/chat-context';
|
|
3
4
|
export * from './types/chat-api.types';
|
|
4
5
|
export * from './components/ui/AnalysesSelector';
|
|
@@ -53,3 +54,4 @@ export * from './components/ui/Toggle';
|
|
|
53
54
|
export * from './components/ui/ToggleGroup';
|
|
54
55
|
export * from './components/ui/Tooltip';
|
|
55
56
|
export * from './components/ui/VimeoEmbed';
|
|
57
|
+
export * from './components/widgets/SidebarDatasetsItemsGrouped';
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { type RedirectLoginOptions } from '@auth0/auth0-react';
|
|
2
|
+
import type { JSX, ReactNode } from 'react';
|
|
3
|
+
export type SybilionAuthProviderProps = {
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
apiBaseUrl: string;
|
|
6
|
+
auth0Domain: string;
|
|
7
|
+
auth0ClientId: string;
|
|
8
|
+
redirectUri: string;
|
|
9
|
+
/**
|
|
10
|
+
* Defaults match sybilion-client AuthProvider (Management API audience + metadata scope).
|
|
11
|
+
* Override if your Auth0 SPA app uses a Resource Server audience for `/v1/auth/login`.
|
|
12
|
+
*/
|
|
13
|
+
authorizationParams?: {
|
|
14
|
+
audience?: string;
|
|
15
|
+
scope?: string;
|
|
16
|
+
redirect_uri?: string;
|
|
17
|
+
};
|
|
18
|
+
sybilionTokenStorageKey?: string;
|
|
19
|
+
logoutReturnTo?: string;
|
|
20
|
+
};
|
|
21
|
+
export type SybilionAuthContextValue = {
|
|
22
|
+
apiBaseUrl: string;
|
|
23
|
+
isLoading: boolean;
|
|
24
|
+
/** Auth0 authenticated and Sybilion JWT present. */
|
|
25
|
+
isAuthenticated: boolean;
|
|
26
|
+
sybilionAccessToken: string | null;
|
|
27
|
+
error: string | null;
|
|
28
|
+
loginWithRedirect: (options?: RedirectLoginOptions) => Promise<void>;
|
|
29
|
+
logout: () => void;
|
|
30
|
+
getAuth0AccessToken: () => Promise<string | undefined>;
|
|
31
|
+
getSybilionAccessToken: () => Promise<string | null>;
|
|
32
|
+
};
|
|
33
|
+
export declare function useSybilionAuth(): SybilionAuthContextValue;
|
|
34
|
+
/** fetch() relative to Sybilion API base with Bearer Sybilion JWT. */
|
|
35
|
+
export declare function sybilionApiFetch(apiBaseUrl: string, bearerToken: string, path: string, init?: RequestInit): Promise<Response>;
|
|
36
|
+
export declare function createSybilionApiFetch(apiBaseUrl: string, getSybilionAccessToken: () => Promise<string | null>): (path: string, init?: RequestInit) => Promise<Response>;
|
|
37
|
+
/** Authenticated fetch using {@link useSybilionAuth} context. */
|
|
38
|
+
export declare function useSybilionApiFetch(): (path: string, init?: RequestInit) => Promise<Response>;
|
|
39
|
+
export declare function SybilionAuthProvider({ children, apiBaseUrl, auth0Domain, auth0ClientId, redirectUri, authorizationParams, sybilionTokenStorageKey, logoutReturnTo, }: SybilionAuthProviderProps): JSX.Element;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export type { SybilionAuthProviderProps, SybilionAuthContextValue, } from '#uilib/sybilion-auth/SybilionAuthProvider';
|
|
2
|
+
export { SybilionAuthProvider, useSybilionAuth, sybilionApiFetch, createSybilionApiFetch, useSybilionApiFetch, } from '#uilib/sybilion-auth/SybilionAuthProvider';
|
|
3
|
+
export { SYBILION_AUTH_LOGIN_PATH, normalizeApiBaseUrl, } from '#uilib/sybilion-auth/authPaths';
|
|
4
|
+
export { exchangeAuth0AccessTokenForSybilionJwt } from '#uilib/sybilion-auth/exchangeSybilionToken';
|
package/dist/esm/types/src/{mini-app/miniAppDataTypes.d.ts → types/sybilionDatasetSnapshots.d.ts}
RENAMED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
* Subset of Sybilion `Dataset` / API types — use `unknown` where payloads are large or evolving.
|
|
2
|
+
* Loose JSON shapes aligned with Sybilion dataset payloads (standalone apps / widgets).
|
|
4
3
|
*/
|
|
5
|
-
export type
|
|
4
|
+
export type SybilionDatasetSnapshot = {
|
|
6
5
|
id: number;
|
|
7
6
|
user_id?: number;
|
|
8
7
|
name: string;
|
|
@@ -34,14 +33,12 @@ export type MiniAppDataset = {
|
|
|
34
33
|
version?: number;
|
|
35
34
|
};
|
|
36
35
|
/** `forecastData` slice: analysis id (string) → forecast series blob. */
|
|
37
|
-
export type
|
|
38
|
-
export type
|
|
39
|
-
/** Cached Performance-tab API payload, or null if user never opened Performance / cache empty. */
|
|
36
|
+
export type SybilionForecastMap = Record<string, unknown>;
|
|
37
|
+
export type SybilionPerformanceSnapshot = {
|
|
40
38
|
table: unknown;
|
|
41
|
-
/** In-memory spaghetti lines from shell context, or null. */
|
|
42
39
|
spaghetti: unknown;
|
|
43
40
|
};
|
|
44
|
-
export type
|
|
41
|
+
export type SybilionDriversComparisonSnapshot = {
|
|
45
42
|
byRegion: unknown;
|
|
46
43
|
byCountry: unknown;
|
|
47
44
|
byCategory: unknown;
|