@vertesia/ui 0.66.0 → 0.68.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/lib/esm/core/components/Badge.js +1 -1
- package/lib/esm/core/components/Badge.js.map +1 -1
- package/lib/esm/core/components/FormItem.js +2 -2
- package/lib/esm/core/components/FormItem.js.map +1 -1
- package/lib/esm/core/components/InputList.js +2 -2
- package/lib/esm/core/components/InputList.js.map +1 -1
- package/lib/esm/core/components/shadcn/checkbox.js +1 -1
- package/lib/esm/core/components/shadcn/checkbox.js.map +1 -1
- package/lib/esm/core/components/shadcn/command.js +1 -1
- package/lib/esm/core/components/shadcn/command.js.map +1 -1
- package/lib/esm/core/components/shadcn/dialog.js +6 -6
- package/lib/esm/core/components/shadcn/dialog.js.map +1 -1
- package/lib/esm/core/components/shadcn/filters/DynamicLabel.js.map +1 -1
- package/lib/esm/core/components/shadcn/filters/comboBox/DateCombobox.js +129 -0
- package/lib/esm/core/components/shadcn/filters/comboBox/DateCombobox.js.map +1 -0
- package/lib/esm/core/components/shadcn/filters/comboBox/SelectCombobox.js +46 -0
- package/lib/esm/core/components/shadcn/filters/comboBox/SelectCombobox.js.map +1 -0
- package/lib/esm/core/components/shadcn/filters/comboBox/StringListCombobox.js +23 -0
- package/lib/esm/core/components/shadcn/filters/comboBox/StringListCombobox.js.map +1 -0
- package/lib/esm/core/components/shadcn/filters/comboBox/TextCombobox.js +28 -0
- package/lib/esm/core/components/shadcn/filters/comboBox/TextCombobox.js.map +1 -0
- package/lib/esm/core/components/shadcn/filters/comboBox/comboBox.js +5 -0
- package/lib/esm/core/components/shadcn/filters/comboBox/comboBox.js.map +1 -0
- package/lib/esm/core/components/shadcn/filters/filter/SelectFilter.js +101 -0
- package/lib/esm/core/components/shadcn/filters/filter/SelectFilter.js.map +1 -0
- package/lib/esm/core/components/shadcn/filters/{stringListFilter.js → filter/StringListFilter.js} +3 -3
- package/lib/esm/core/components/shadcn/filters/filter/StringListFilter.js.map +1 -0
- package/lib/esm/core/components/shadcn/filters/{textFilter.js → filter/TextFilter.js} +4 -4
- package/lib/esm/core/components/shadcn/filters/filter/TextFilter.js.map +1 -0
- package/lib/esm/core/components/shadcn/filters/filter/dateFilter.js +161 -0
- package/lib/esm/core/components/shadcn/filters/filter/dateFilter.js.map +1 -0
- package/lib/esm/core/components/shadcn/filters/filter-styles.js +88 -0
- package/lib/esm/core/components/shadcn/filters/filter-styles.js.map +1 -0
- package/lib/esm/core/components/shadcn/filters/filterBar.js +128 -87
- package/lib/esm/core/components/shadcn/filters/filterBar.js.map +1 -1
- package/lib/esm/core/components/shadcn/filters/filters.js +7 -6
- package/lib/esm/core/components/shadcn/filters/filters.js.map +1 -1
- package/lib/esm/core/components/shadcn/filters/index.js +1 -1
- package/lib/esm/core/components/shadcn/filters/index.js.map +1 -1
- package/lib/esm/core/components/shadcn/filters/types.js.map +1 -1
- package/lib/esm/core/components/toast/NotificationPanel.js +24 -18
- package/lib/esm/core/components/toast/NotificationPanel.js.map +1 -1
- package/lib/esm/features/agent/PayloadBuilder.js +47 -27
- package/lib/esm/features/agent/PayloadBuilder.js.map +1 -1
- package/lib/esm/features/agent/chat/ModernAgentConversation.js +10 -4
- package/lib/esm/features/agent/chat/ModernAgentConversation.js.map +1 -1
- package/lib/esm/features/agent/chat/ModernAgentOutput/AllMessagesMixed.js +7 -6
- package/lib/esm/features/agent/chat/ModernAgentOutput/AllMessagesMixed.js.map +1 -1
- package/lib/esm/features/agent/chat/ModernAgentOutput/MessageItem.js +13 -2
- package/lib/esm/features/agent/chat/ModernAgentOutput/MessageItem.js.map +1 -1
- package/lib/esm/features/agent/chat/ModernAgentOutput/SlidingMessages.js +2 -1
- package/lib/esm/features/agent/chat/ModernAgentOutput/SlidingMessages.js.map +1 -1
- package/lib/esm/features/agent/chat/ModernAgentOutput/utils.js +10 -4
- package/lib/esm/features/agent/chat/ModernAgentOutput/utils.js.map +1 -1
- package/lib/esm/features/facets/DocumentsFacetsNav.js +133 -0
- package/lib/esm/features/facets/DocumentsFacetsNav.js.map +1 -0
- package/lib/esm/features/facets/RunsFacetsNav.js +125 -0
- package/lib/esm/features/facets/RunsFacetsNav.js.map +1 -0
- package/lib/esm/features/facets/VFacetsNav.js +4 -113
- package/lib/esm/features/facets/VFacetsNav.js.map +1 -1
- package/lib/esm/features/facets/VStringFacet.js +6 -4
- package/lib/esm/features/facets/VStringFacet.js.map +1 -1
- package/lib/esm/features/facets/VTypeFacet.js +4 -5
- package/lib/esm/features/facets/VTypeFacet.js.map +1 -1
- package/lib/esm/features/facets/VUserFacet.js +1 -1
- package/lib/esm/features/facets/VUserFacet.js.map +1 -1
- package/lib/esm/features/facets/WorkflowExecutionsFacetsNav.js +98 -0
- package/lib/esm/features/facets/WorkflowExecutionsFacetsNav.js.map +1 -0
- package/lib/esm/features/facets/index.js +3 -2
- package/lib/esm/features/facets/index.js.map +1 -1
- package/lib/esm/features/store/collections/CollectionsTable.js +1 -1
- package/lib/esm/features/store/collections/CollectionsTable.js.map +1 -1
- package/lib/esm/features/store/collections/CreateCollection.js +10 -9
- package/lib/esm/features/store/collections/CreateCollection.js.map +1 -1
- package/lib/esm/features/store/collections/EditCollectionView.js +10 -9
- package/lib/esm/features/store/collections/EditCollectionView.js.map +1 -1
- package/lib/esm/features/store/collections/SelectCollection.js +1 -1
- package/lib/esm/features/store/collections/SelectCollection.js.map +1 -1
- package/lib/esm/features/store/objects/DocumentPreviewPanel.js +0 -1
- package/lib/esm/features/store/objects/DocumentPreviewPanel.js.map +1 -1
- package/lib/esm/features/store/objects/DocumentSearchResults.js +37 -2
- package/lib/esm/features/store/objects/DocumentSearchResults.js.map +1 -1
- package/lib/esm/features/store/objects/components/ContentOverview.js +5 -6
- package/lib/esm/features/store/objects/components/ContentOverview.js.map +1 -1
- package/lib/esm/features/store/objects/components/SelectDocument.js +2 -2
- package/lib/esm/features/store/objects/components/SelectDocument.js.map +1 -1
- package/lib/esm/features/store/objects/components/VectorSearchWidget.js +1 -1
- package/lib/esm/features/store/objects/components/VectorSearchWidget.js.map +1 -1
- package/lib/esm/features/store/objects/selection/actions/AddToCollectionAction.js +16 -4
- package/lib/esm/features/store/objects/selection/actions/AddToCollectionAction.js.map +1 -1
- package/lib/esm/features/store/objects/upload/DocumentUploadModal.js +72 -37
- package/lib/esm/features/store/objects/upload/DocumentUploadModal.js.map +1 -1
- package/lib/esm/features/store/types/ObjectSchemaEditor.js +15 -0
- package/lib/esm/features/store/types/ObjectSchemaEditor.js.map +1 -1
- package/lib/esm/features/user/UserInfo.js +8 -8
- package/lib/esm/features/user/UserInfo.js.map +1 -1
- package/lib/esm/layout/FullHeightLayout.js +2 -4
- package/lib/esm/layout/FullHeightLayout.js.map +1 -1
- package/lib/esm/router/HistoryNavigator.js +2 -2
- package/lib/esm/router/HistoryNavigator.js.map +1 -1
- package/lib/esm/shell/SplashScreen.js +19 -0
- package/lib/esm/shell/SplashScreen.js.map +1 -0
- package/lib/esm/shell/VertesiaShell.js +10 -0
- package/lib/esm/shell/VertesiaShell.js.map +1 -0
- package/lib/esm/shell/index.js +7 -0
- package/lib/esm/shell/index.js.map +1 -0
- package/lib/esm/shell/login/EnterpriseSigninButton.js +81 -0
- package/lib/esm/shell/login/EnterpriseSigninButton.js.map +1 -0
- package/lib/esm/shell/login/GitHubSignInButton.js +24 -0
- package/lib/esm/shell/login/GitHubSignInButton.js.map +1 -0
- package/lib/esm/shell/login/GoogleSignInButton.js +25 -0
- package/lib/esm/shell/login/GoogleSignInButton.js.map +1 -0
- package/lib/esm/shell/login/InviteAcceptModal.js +45 -0
- package/lib/esm/shell/login/InviteAcceptModal.js.map +1 -0
- package/lib/esm/shell/login/MicrosoftSigninButton.js +19 -0
- package/lib/esm/shell/login/MicrosoftSigninButton.js.map +1 -0
- package/lib/esm/shell/login/PreviewIcon.js +23 -0
- package/lib/esm/shell/login/PreviewIcon.js.map +1 -0
- package/lib/esm/shell/login/SignInModal.js +9 -0
- package/lib/esm/shell/login/SignInModal.js.map +1 -0
- package/lib/esm/shell/login/SigninScreen.js +64 -0
- package/lib/esm/shell/login/SigninScreen.js.map +1 -0
- package/lib/esm/shell/login/SignupForm.js +91 -0
- package/lib/esm/shell/login/SignupForm.js.map +1 -0
- package/lib/esm/shell/login/TerminalLogin.js +179 -0
- package/lib/esm/shell/login/TerminalLogin.js.map +1 -0
- package/lib/esm/shell/login/UserInfo.js +40 -0
- package/lib/esm/shell/login/UserInfo.js.map +1 -0
- package/lib/esm/shell/login/UserSessionMenu.js +31 -0
- package/lib/esm/shell/login/UserSessionMenu.js.map +1 -0
- package/lib/esm/shell/utils.js +6 -0
- package/lib/esm/shell/utils.js.map +1 -0
- package/lib/esm/widgets/SvgIcon.js +36 -0
- package/lib/esm/widgets/SvgIcon.js.map +1 -0
- package/lib/esm/widgets/index.js +7 -6
- package/lib/esm/widgets/index.js.map +1 -1
- package/lib/esm/widgets/upload/UploadSummary.js +1 -1
- package/lib/esm/widgets/upload/UploadSummary.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/types/core/components/FormItem.d.ts +2 -1
- package/lib/types/core/components/shadcn/dialog.d.ts +2 -1
- package/lib/types/core/components/shadcn/filters/DynamicLabel.d.ts +1 -1
- package/lib/types/core/components/shadcn/filters/comboBox/DateCombobox.d.ts +5 -0
- package/lib/types/core/components/shadcn/filters/comboBox/SelectCombobox.d.ts +8 -0
- package/lib/types/core/components/shadcn/filters/comboBox/StringListCombobox.d.ts +5 -0
- package/lib/types/core/components/shadcn/filters/comboBox/TextCombobox.d.ts +5 -0
- package/lib/types/core/components/shadcn/filters/comboBox/comboBox.d.ts +4 -0
- package/lib/types/core/components/shadcn/filters/{selectFilter.d.ts → filter/SelectFilter.d.ts} +2 -2
- package/lib/types/core/components/shadcn/filters/{stringListFilter.d.ts → filter/StringListFilter.d.ts} +1 -1
- package/lib/types/core/components/shadcn/filters/{textFilter.d.ts → filter/TextFilter.d.ts} +1 -1
- package/lib/types/core/components/shadcn/filters/{dateFilter.d.ts → filter/dateFilter.d.ts} +1 -1
- package/lib/types/core/components/shadcn/filters/filter-styles.d.ts +1 -0
- package/lib/types/core/components/shadcn/filters/filterBar.d.ts +14 -4
- package/lib/types/core/components/shadcn/filters/index.d.ts +1 -1
- package/lib/types/core/components/shadcn/filters/types.d.ts +2 -0
- package/lib/types/features/agent/PayloadBuilder.d.ts +17 -8
- package/lib/types/features/agent/chat/ModernAgentOutput/utils.d.ts +2 -1
- package/lib/types/features/facets/DocumentsFacetsNav.d.ts +16 -0
- package/lib/types/features/facets/RunsFacetsNav.d.ts +18 -0
- package/lib/types/features/facets/VFacetsNav.d.ts +1 -1
- package/lib/types/features/facets/VStringFacet.d.ts +6 -2
- package/lib/types/features/facets/VTypeFacet.d.ts +3 -1
- package/lib/types/features/facets/WorkflowExecutionsFacetsNav.d.ts +13 -0
- package/lib/types/features/facets/index.d.ts +3 -2
- package/lib/types/shell/SplashScreen.d.ts +4 -0
- package/lib/types/shell/VertesiaShell.d.ts +7 -0
- package/lib/types/shell/index.d.ts +6 -0
- package/lib/types/shell/login/EnterpriseSigninButton.d.ts +5 -0
- package/lib/types/shell/login/GitHubSignInButton.d.ts +5 -0
- package/lib/types/shell/login/GoogleSignInButton.d.ts +5 -0
- package/lib/types/shell/login/InviteAcceptModal.d.ts +1 -0
- package/lib/types/shell/login/MicrosoftSigninButton.d.ts +5 -0
- package/lib/types/shell/login/PreviewIcon.d.ts +5 -0
- package/lib/types/shell/login/SignInModal.d.ts +6 -0
- package/lib/types/shell/login/SigninScreen.d.ts +8 -0
- package/lib/types/shell/login/SignupForm.d.ts +7 -0
- package/lib/types/shell/login/TerminalLogin.d.ts +1 -0
- package/lib/types/shell/login/UserInfo.d.ts +5 -0
- package/lib/types/shell/login/UserSessionMenu.d.ts +8 -0
- package/lib/types/shell/utils.d.ts +1 -0
- package/lib/types/widgets/SvgIcon.d.ts +6 -0
- package/lib/types/widgets/index.d.ts +7 -6
- package/lib/vertesia-ui-core.js +1 -1
- package/lib/vertesia-ui-core.js.map +1 -1
- package/lib/vertesia-ui-features.js +1 -1
- package/lib/vertesia-ui-features.js.map +1 -1
- package/lib/vertesia-ui-layout.js +1 -1
- package/lib/vertesia-ui-layout.js.map +1 -1
- package/lib/vertesia-ui-router.js +1 -1
- package/lib/vertesia-ui-router.js.map +1 -1
- package/lib/vertesia-ui-shell.js +2 -0
- package/lib/vertesia-ui-shell.js.map +1 -0
- package/lib/vertesia-ui-widgets.js +1 -1
- package/lib/vertesia-ui-widgets.js.map +1 -1
- package/package.json +14 -6
- package/src/core/components/Badge.tsx +12 -8
- package/src/core/components/FormItem.tsx +4 -3
- package/src/core/components/InputList.tsx +21 -17
- package/src/core/components/shadcn/checkbox.tsx +2 -2
- package/src/core/components/shadcn/command.tsx +1 -1
- package/src/core/components/shadcn/dialog.tsx +18 -9
- package/src/core/components/shadcn/filters/DynamicLabel.tsx +1 -2
- package/src/core/components/shadcn/filters/comboBox/DateCombobox.tsx +211 -0
- package/src/core/components/shadcn/filters/{comboBox.tsx → comboBox/SelectCombobox.tsx} +8 -192
- package/src/core/components/shadcn/filters/comboBox/StringListCombobox.tsx +76 -0
- package/src/core/components/shadcn/filters/comboBox/TextCombobox.tsx +81 -0
- package/src/core/components/shadcn/filters/comboBox/comboBox.tsx +4 -0
- package/src/core/components/shadcn/filters/filter/SelectFilter.tsx +161 -0
- package/src/core/components/shadcn/filters/{stringListFilter.tsx → filter/StringListFilter.tsx} +7 -7
- package/src/core/components/shadcn/filters/{textFilter.tsx → filter/TextFilter.tsx} +17 -11
- package/src/core/components/shadcn/filters/filter/dateFilter.tsx +256 -0
- package/src/core/components/shadcn/filters/filter-styles.ts +87 -0
- package/src/core/components/shadcn/filters/filterBar.tsx +208 -152
- package/src/core/components/shadcn/filters/filters.tsx +7 -5
- package/src/core/components/shadcn/filters/index.ts +1 -1
- package/src/core/components/shadcn/filters/types.ts +2 -0
- package/src/core/components/toast/NotificationPanel.tsx +38 -22
- package/src/features/agent/PayloadBuilder.tsx +56 -31
- package/src/features/agent/chat/ModernAgentConversation.tsx +645 -639
- package/src/features/agent/chat/ModernAgentOutput/AllMessagesMixed.tsx +7 -6
- package/src/features/agent/chat/ModernAgentOutput/MessageItem.tsx +13 -2
- package/src/features/agent/chat/ModernAgentOutput/SlidingMessages.tsx +2 -1
- package/src/features/agent/chat/ModernAgentOutput/utils.ts +12 -4
- package/src/features/facets/DocumentsFacetsNav.tsx +171 -0
- package/src/features/facets/RunsFacetsNav.tsx +166 -0
- package/src/features/facets/VFacetsNav.tsx +10 -126
- package/src/features/facets/VStringFacet.tsx +10 -4
- package/src/features/facets/VTypeFacet.tsx +6 -5
- package/src/features/facets/VUserFacet.tsx +5 -3
- package/src/features/facets/WorkflowExecutionsFacetsNav.tsx +132 -0
- package/src/features/facets/index.ts +5 -2
- package/src/features/store/collections/CollectionsTable.tsx +3 -2
- package/src/features/store/collections/CreateCollection.tsx +17 -15
- package/src/features/store/collections/EditCollectionView.tsx +19 -16
- package/src/features/store/collections/SelectCollection.tsx +1 -1
- package/src/features/store/objects/DocumentPreviewPanel.tsx +0 -1
- package/src/features/store/objects/DocumentSearchResults.tsx +80 -11
- package/src/features/store/objects/components/ContentOverview.tsx +7 -7
- package/src/features/store/objects/components/SelectDocument.tsx +2 -2
- package/src/features/store/objects/components/VectorSearchWidget.tsx +2 -2
- package/src/features/store/objects/selection/actions/AddToCollectionAction.tsx +40 -19
- package/src/features/store/objects/upload/DocumentUploadModal.tsx +160 -214
- package/src/features/store/types/ObjectSchemaEditor.tsx +15 -0
- package/src/features/user/UserInfo.tsx +17 -14
- package/src/layout/FullHeightLayout.tsx +2 -2
- package/src/router/HistoryNavigator.ts +2 -2
- package/src/shell/SplashScreen.tsx +41 -0
- package/src/shell/VertesiaShell.tsx +27 -0
- package/src/shell/index.tsx +6 -0
- package/src/shell/login/EnterpriseSigninButton.tsx +106 -0
- package/src/shell/login/GitHubSignInButton.tsx +40 -0
- package/src/shell/login/GoogleSignInButton.tsx +36 -0
- package/src/shell/login/InviteAcceptModal.tsx +78 -0
- package/src/shell/login/MicrosoftSigninButton.tsx +30 -0
- package/src/shell/login/PreviewIcon.tsx +29 -0
- package/src/shell/login/SignInModal.tsx +28 -0
- package/src/shell/login/SigninScreen.tsx +162 -0
- package/src/shell/login/SignupForm.tsx +178 -0
- package/src/shell/login/TerminalLogin.tsx +299 -0
- package/src/shell/login/UserInfo.tsx +76 -0
- package/src/shell/login/UserSessionMenu.tsx +81 -0
- package/src/shell/utils.tsx +7 -0
- package/src/widgets/SvgIcon.tsx +44 -0
- package/src/widgets/index.ts +7 -6
- package/src/widgets/upload/UploadSummary.tsx +3 -4
- package/lib/esm/core/components/shadcn/filters/comboBox.js +0 -101
- package/lib/esm/core/components/shadcn/filters/comboBox.js.map +0 -1
- package/lib/esm/core/components/shadcn/filters/dateFilter.js +0 -36
- package/lib/esm/core/components/shadcn/filters/dateFilter.js.map +0 -1
- package/lib/esm/core/components/shadcn/filters/selectFilter.js +0 -67
- package/lib/esm/core/components/shadcn/filters/selectFilter.js.map +0 -1
- package/lib/esm/core/components/shadcn/filters/stringListFilter.js.map +0 -1
- package/lib/esm/core/components/shadcn/filters/textFilter.js.map +0 -1
- package/lib/esm/features/facets/InteractionFacet.js +0 -39
- package/lib/esm/features/facets/InteractionFacet.js.map +0 -1
- package/lib/esm/features/facets/TypeOptions.js +0 -19
- package/lib/esm/features/facets/TypeOptions.js.map +0 -1
- package/lib/esm/features/facets/UserFacet.js +0 -33
- package/lib/esm/features/facets/UserFacet.js.map +0 -1
- package/lib/types/core/components/shadcn/filters/comboBox.d.ts +0 -22
- package/lib/types/features/facets/InteractionFacet.d.ts +0 -9
- package/lib/types/features/facets/TypeOptions.d.ts +0 -3
- package/lib/types/features/facets/UserFacet.d.ts +0 -11
- package/src/core/components/shadcn/filters/dateFilter.tsx +0 -82
- package/src/core/components/shadcn/filters/selectFilter.tsx +0 -110
- package/src/features/facets/InteractionFacet.tsx +0 -53
- package/src/features/facets/TypeOptions.tsx +0 -22
- package/src/features/facets/UserFacet.tsx +0 -61
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as e,jsxs as l,Fragment as r}from"react/jsx-runtime";import i from"clsx";import{Transition as t,Dialog as n,TransitionChild as a,DialogPanel as s}from"@headlessui/react";import{Menu as o,Search as c,Dot as d,X as h}from"lucide-react";import{createContext as m,useContext as u,useState as f,useEffect as x,Fragment as g}from"react";import{Button as p,TooltipProvider as v,Tooltip as N,TooltipTrigger as b,TooltipContent as w}from"@vertesia/ui/core";import{Nav as y}from"@vertesia/ui/router";function k({className:l,children:r}){return e("div",{className:i("flex flex-col","h-full","overflow-y-auto",l),children:r})}k.Fixed=function({heightClass:l,className:r,children:t}){return e("div",{className:i("w-full",l,r),children:t})},k.Body=function({className:l,children:r}){return e("div",{className:i("grow overflow-auto","min-h-0","
|
|
1
|
+
import{jsx as e,jsxs as l,Fragment as r}from"react/jsx-runtime";import i from"clsx";import{Transition as t,Dialog as n,TransitionChild as a,DialogPanel as s}from"@headlessui/react";import{Menu as o,Search as c,Dot as d,X as h}from"lucide-react";import{createContext as m,useContext as u,useState as f,useEffect as x,Fragment as g}from"react";import{Button as p,TooltipProvider as v,Tooltip as N,TooltipTrigger as b,TooltipContent as w}from"@vertesia/ui/core";import{Nav as y}from"@vertesia/ui/router";function k({className:l,children:r}){return e("div",{className:i("flex flex-col","h-full","overflow-y-auto","px-2",l),children:r})}k.Fixed=function({heightClass:l,className:r,children:t}){return e("div",{className:i("w-full",l,r),children:t})},k.Body=function({className:l,children:r}){return e("div",{className:i("grow overflow-auto","min-h-0","p-2",l),children:r})},k.VR=function({}){return e("div",{className:"w-[1px] border border-red-200"})},k.HR=function({}){return e("div",{className:"w-full h-1 border-b border-red-200"})};const C=m({isOpen:!1,toggleMobile:()=>{},toggleDesktop:()=>{}});function S(){return u(C)}function z({title:l}){return e("div",{className:"self-center text-lg font-semibold",children:l})}function O({children:r,logo:i,onSearch:t,title:n}){return l("div",{className:"sticky top-0 z-40 flex h-16 shrink-0 items-center gap-x-4 border-b px-4 shadow-2xs sm:gap-x-6 sm:px-6 lg:px-8",children:[e(T,{}),e("div",{className:"lg:hidden",children:i}),t&&e(D,{visible:"mobile"}),l("div",{className:"flex flex-1 gap-x-4 self-stretch lg:gap-x-6",children:[e(z,{title:n}),t&&e(F,{onSearch:t}),e("div",{className:"flex items-center gap-x-4 lg:gap-x-6 ml-auto",children:r})]})]})}function F({}){return l("form",{className:"relative flex flex-1",action:"#",method:"GET",children:[e("label",{htmlFor:"search-field",className:"sr-only",children:"Search"}),e(c,{className:"pointer-events-none absolute inset-y-0 left-0 h-full w-5 text-gray-400","aria-hidden":"true"}),e("input",{id:"search-field",className:"block h-full w-full border-0 py-0 pl-8 pr-0 text-gray-900 placeholder:text-gray-400 focus:ring-0 sm:text-sm",placeholder:"Search...",type:"search",name:"search"})]})}function T(){const{toggleDesktop:l,toggleMobile:i}=S();return e(r,{children:e(p,{variant:"ghost",size:"icon",onClick:()=>{window.innerWidth<1024?i():l()},className:"p-2 rounded-full transition-colors w-full text-center ",children:e(o,{"aria-hidden":"true",size:24})})})}function D({visible:l}){let r="";return l&&(r="mobile"===l?"lg:hidden":"hidden lg:block"),e("div",{className:`h-6 w-px bg-gray-900/10 dark:bg-slate-900/0.1 ${r}`,"aria-hidden":"true"})}function I({title:r,icon:i,onClick:t}){return l("button",{type:"button",className:"-m-2.5 p-2.5 text-gray-400 dark:text-slate-50 hover:text-gray-500",onClick:t,children:[e("span",{className:"sr-only",children:r}),e(i,{className:"size-6","aria-hidden":"true",title:r})]})}function M({children:l,onClick:r}){return e(p,{onClick:r,children:l})}function E({href:l,onClick:r,children:i}){return e("a",{className:"dark:text-slate-50",href:l,onClick:r,children:i})}function W({children:r,logo:t,className:n}){return l("div",{className:i(n||"bg-indigo-600 dark:bg-indigo-950","flex flex-col h-full"),children:[t&&e("div",{className:"-mx-2 flex h-auto my-4 shrink-0 self-start",children:t}),e("div",{className:"flex-1 min-h-0 overflow-hidden px-2",children:e("nav",{className:"h-full flex flex-col",children:e("ul",{role:"list",className:"flex flex-col gap-y-2 overflow-y-auto h-full",children:r})})})]})}function j({children:i,title:t,action:n,isFooter:a=!1}){const{isOpen:s}=S();let o=s?l(r,{children:[t||"",n]}):e(d,{className:"size-6"});return l("li",{className:a?"mt-auto":"",children:[t&&e("div",{className:"text-xs font-medium h-8 flex items-center gap-x-2 px-2 text-sidebar-foreground/70",children:o}),e("ul",{"data-sidebar":"menu",className:"flex w-full min-w-0 flex-col gap-1",children:i})]})}function L({children:i,text:t}){const{isOpen:n}=S();return n?e(r,{children:i}):e(v,{children:l(N,{children:[e(b,{asChild:!0,children:i}),e(w,{side:"right",children:t})]})})}function P({external:r,className:t,tools:n,children:a,icon:s,href:o,current:c,onClick:d}){const{toggleMobile:h}=S();return e("li",{children:e(y,{onClick:()=>{setTimeout((()=>{h(!1)}),100)},children:e(L,{text:a,children:l("a",{href:o,onClick:e=>{r?(window.open(o,"_blank"),e.preventDefault(),e.stopPropagation()):d&&d(e)},className:i(c?"bg-sidebar-accent text-sidebar-accent-foreground":"text-sidebar-foreground hover:text-sidebar-accent-foreground hover:bg-sidebar-accent","group flex gap-x-3 rounded-md px-2 py-1.5 text-sm items-center h-8",t),children:[s&&e(s,{className:i(c?"bg-sidebar-accent text-sidebar-accent-foreground":"text-sidebar-foreground hover:text-sidebar-accent-foreground hover:bg-sidebar-accent","size-4 shrink-0"),"aria-hidden":"true"}),a,n&&e("div",{className:"flex items-center ml-auto",children:n})]})})})})}function R({sidebarClassName:o,className:c,title:d,children:m,logo:u,navbar:p,sidebar:v,mainNav:N}){null===localStorage.getItem("desktopSidebarOpen")&&localStorage.setItem("desktopSidebarOpen","true");const[b,w]=f(!1),[y,k]=f("true"===localStorage.getItem("desktopSidebarOpen")),[S,z]=f(window.innerWidth>=1024);x((()=>{const e=()=>{z(window.innerWidth>=1024)};return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)}),[]);const F={isOpen:S?y:b,toggleDesktop:e=>{k(void 0===e?!y:e),localStorage.setItem("desktopSidebarOpen",JSON.stringify(!y))},toggleMobile:e=>{w(void 0===e?!b:e)}};return e(r,{children:e("div",{className:"flex flex-col h-screen overflow-y-hidden",children:l(C.Provider,{value:F,children:[e("div",{className:"w-full",children:N}),l("div",{className:"flex h-full overflow-y-auto w-full",children:[e(t,{show:b,as:g,children:l(n,{as:"div",className:"relative z-50 lg:hidden",onClose:w,children:[e(a,{as:g,enter:"transition-opacity ease-linear duration-300",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"transition-opacity ease-linear duration-300",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:e("div",{className:"fixed inset-0 bg-gray-900/80"})}),e("div",{className:"fixed inset-0 flex",children:e(a,{as:g,enter:"transition ease-in-out duration-300 transform",enterFrom:"-translate-x-full",enterTo:"translate-x-0",leave:"transition ease-in-out duration-300 transform",leaveFrom:"translate-x-0",leaveTo:"-translate-x-full",children:l(s,{className:"relative flex w-full max-w-xs flex-1",children:[e(W,{logo:u,className:o,children:v}),e("div",{className:"flex w-16 justify-center pt-5 items-start",children:l("button",{type:"button",className:"-m-2.5 p-2.5",onClick:()=>w(!1),children:[e("span",{className:"sr-only",children:"Close sidebar"}),e(h,{className:"size-6 text-white","aria-hidden":"true"})]})})]})})})]})}),e("div",{className:"hidden lg:block relative transition-all duration-300 "+(y?"w-72":"w-12"),children:e(W,{logo:u,className:o,children:v})}),l("div",{className:"w-full h-full overflow-y-hidden",children:[p?e(O,{title:d,logo:u,children:p}):null,e("main",{className:i("flex-1 h-full w-full relative flex flex-col",c),children:m})]})]})]})})})}export{R as AppLayout,k as FullHeightLayout,T as HamburgerButton,O as Navbar,M as NavbarButton,I as NavbarIconButton,E as NavbarLink,D as NavbarSeparator,W as Sidebar,C as SidebarContext,P as SidebarItem,j as SidebarSection,L as SidebarTooltip,z as TitleBar,S as useSidebarToggle};
|
|
2
2
|
//# sourceMappingURL=vertesia-ui-layout.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vertesia-ui-layout.js","sources":["esm/layout/FullHeightLayout.js","esm/layout/SidebarContext.js","esm/layout/TitleBar.js","esm/layout/Navbar.js","esm/layout/Sidebar.js","esm/layout/AppLayout.js"],"sourcesContent":["import { jsx as _jsx } from \"react/jsx-runtime\";\nimport clsx from 'clsx';\nexport function FullHeightLayout({ className, children }) {\n return (_jsx(\"div\", { className: clsx(\"flex flex-col\", \"h-full\", \"overflow-y-auto\", \n // \"dark:bg-slate-900 text-slate-950 dark:text-slate-200\",\n className), children: children }));\n}\nFullHeightLayout.Fixed = function Fixed({ heightClass, className, children }) {\n return (_jsx(\"div\", { className: clsx(\"w-full\", heightClass, className), children: children }));\n};\nFullHeightLayout.Body = function Body({ className, children }) {\n return (_jsx(\"div\", { className: clsx(\"grow overflow-auto\", \"min-h-0\", \"px-4 py-2\", className), children: children }));\n};\nFullHeightLayout.VR = function VDivider({}) {\n return (_jsx(\"div\", { className: \"w-[1px] border border-red-200\" }));\n};\nFullHeightLayout.HR = function HDivider({}) {\n return (_jsx(\"div\", { className: \"w-full h-1 border-b border-red-200\" }));\n};\n//# sourceMappingURL=FullHeightLayout.js.map","import { createContext, useContext } from \"react\";\nexport const SidebarContext = createContext({\n isOpen: false,\n toggleMobile: () => void 0,\n toggleDesktop: () => void 0,\n});\nexport function useSidebarToggle() {\n return useContext(SidebarContext);\n}\n//# sourceMappingURL=SidebarContext.js.map","import { jsx as _jsx } from \"react/jsx-runtime\";\nexport function TitleBar({ title }) {\n return _jsx(\"div\", { className: 'self-center text-lg font-semibold', children: title });\n}\n//# sourceMappingURL=TitleBar.js.map","import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from \"react/jsx-runtime\";\nimport { Menu, Search } from 'lucide-react';\nimport { Button } from '@vertesia/ui/core';\nimport { useSidebarToggle } from './SidebarContext.js';\nimport { TitleBar } from './TitleBar.js';\nexport function Navbar({ children, logo, onSearch, title }) {\n return (_jsxs(\"div\", { className: \"sticky top-0 z-40 flex h-16 shrink-0 items-center gap-x-4 border-b px-4 shadow-2xs sm:gap-x-6 sm:px-6 lg:px-8\", children: [_jsx(HamburgerButton, {}), _jsx(\"div\", { className: \"lg:hidden\", children: logo }), onSearch && _jsx(NavbarSeparator, { visible: 'mobile' }), _jsxs(\"div\", { className: \"flex flex-1 gap-x-4 self-stretch lg:gap-x-6\", children: [_jsx(TitleBar, { title: title }), onSearch && _jsx(SearchBox, { onSearch: onSearch }), _jsx(\"div\", { className: \"flex items-center gap-x-4 lg:gap-x-6 ml-auto\", children: children })] })] }));\n}\nfunction SearchBox({}) {\n return (_jsxs(\"form\", { className: \"relative flex flex-1\", action: \"#\", method: \"GET\", children: [_jsx(\"label\", { htmlFor: \"search-field\", className: \"sr-only\", children: \"Search\" }), _jsx(Search, { className: \"pointer-events-none absolute inset-y-0 left-0 h-full w-5 text-gray-400\", \"aria-hidden\": \"true\" }), _jsx(\"input\", { id: \"search-field\", className: \"block h-full w-full border-0 py-0 pl-8 pr-0 text-gray-900 placeholder:text-gray-400 focus:ring-0 sm:text-sm\", placeholder: \"Search...\", type: \"search\", name: \"search\" })] }));\n}\nexport function HamburgerButton() {\n const { toggleDesktop, toggleMobile } = useSidebarToggle();\n const toggle = () => {\n if (window.innerWidth < 1024) {\n toggleMobile();\n }\n else {\n toggleDesktop();\n }\n };\n return (_jsx(_Fragment, { children: _jsx(Button, { variant: 'ghost', size: 'icon', onClick: () => toggle(), className: \"p-2 rounded-full transition-colors w-full text-center \", children: _jsx(Menu, { \"aria-hidden\": \"true\", size: 24 }) }) }));\n}\nexport function NavbarSeparator({ visible }) {\n let visibility = \"\";\n if (visible) {\n visibility = visible === \"mobile\" ? \"lg:hidden\" : \"hidden lg:block\";\n }\n return (_jsx(\"div\", { className: `h-6 w-px bg-gray-900/10 dark:bg-slate-900/0.1 ${visibility}`, \"aria-hidden\": \"true\" }));\n}\nexport function NavbarIconButton({ title, icon: Icon, onClick }) {\n return (_jsxs(\"button\", { type: \"button\", className: \"-m-2.5 p-2.5 text-gray-400 dark:text-slate-50 hover:text-gray-500\", onClick: onClick, children: [_jsx(\"span\", { className: \"sr-only\", children: title }), _jsx(Icon, { className: \"size-6\", \"aria-hidden\": \"true\", title: title })] }));\n}\nexport function NavbarButton({ children, onClick }) {\n return (_jsx(Button, { onClick: onClick, children: children }));\n}\nexport function NavbarLink({ href, onClick, children }) {\n return (_jsx(\"a\", { className: \"dark:text-slate-50\", href: href, onClick: onClick, children: children }));\n}\n//# sourceMappingURL=Navbar.js.map","import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from \"react/jsx-runtime\";\nimport clsx from 'clsx';\nimport { useSidebarToggle } from './SidebarContext';\nimport { Dot } from 'lucide-react';\nimport { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider } from '@vertesia/ui/core';\nimport { Nav } from \"@vertesia/ui/router\";\nexport function Sidebar({ children, logo, className }) {\n return (_jsxs(\"div\", { className: clsx(className || \"bg-indigo-600 dark:bg-indigo-950\", \"flex flex-col h-full\"), children: [logo &&\n _jsx(\"div\", { className: \"-mx-2 flex h-auto my-4 shrink-0 self-start\", children: logo }), _jsx(\"div\", { className: \"flex-1 min-h-0 overflow-hidden px-2\", children: _jsx(\"nav\", { className: \"h-full flex flex-col\", children: _jsx(\"ul\", { role: \"list\", className: \"flex flex-col gap-y-2 overflow-y-auto h-full\", children: children }) }) })] }));\n}\nexport function SidebarSection({ children, title, action, isFooter = false }) {\n const { isOpen } = useSidebarToggle();\n let header = isOpen ? _jsxs(_Fragment, { children: [title || \"\", action] }) : _jsx(Dot, { className: 'size-6' });\n return (_jsxs(\"li\", { className: isFooter ? 'mt-auto' : '', children: [title && _jsx(\"div\", { className: \"text-xs font-medium h-8 flex items-center gap-x-2 px-2 text-sidebar-foreground/70\", children: header }), _jsx(\"ul\", { \"data-sidebar\": \"menu\", className: \"flex w-full min-w-0 flex-col gap-1\", children: children })] }));\n}\nexport function SidebarTooltip({ children, text }) {\n const { isOpen } = useSidebarToggle();\n return (isOpen ? _jsx(_Fragment, { children: children }) :\n _jsx(TooltipProvider, { children: _jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: children }), _jsx(TooltipContent, { side: 'right', children: text })] }) }));\n}\nexport function SidebarItem({ external, className, tools, children, icon: Icon, href, current, onClick }) {\n const { toggleMobile } = useSidebarToggle();\n const _closeSideBar = () => {\n setTimeout(() => {\n toggleMobile(false);\n }, 100);\n };\n const onClickWrapper = (event) => {\n if (external) {\n window.open(href, '_blank');\n event.preventDefault(); // Prevent default link behavior\n event.stopPropagation(); // Stop the event from propagating\n }\n else if (onClick) {\n onClick(event);\n }\n };\n return (_jsx(\"li\", { children: _jsx(Nav, { onClick: _closeSideBar, children: _jsx(SidebarTooltip, { text: children, children: _jsxs(\"a\", { href: href, onClick: onClickWrapper, className: clsx(current\n ? 'bg-sidebar-accent text-sidebar-accent-foreground'\n : 'text-sidebar-foreground hover:text-sidebar-accent-foreground hover:bg-sidebar-accent', 'group flex gap-x-3 rounded-md px-2 py-1.5 text-sm items-center h-8', className), children: [Icon &&\n _jsx(Icon, { className: clsx(current\n ? 'bg-sidebar-accent text-sidebar-accent-foreground'\n : 'text-sidebar-foreground hover:text-sidebar-accent-foreground hover:bg-sidebar-accent', 'size-4 shrink-0'), \"aria-hidden\": \"true\" }), children, tools && _jsx(\"div\", { className: 'flex items-center ml-auto', children: tools })] }) }) }) }));\n}\n//# sourceMappingURL=Sidebar.js.map","import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from \"react/jsx-runtime\";\nimport { Dialog, DialogPanel, Transition, TransitionChild } from '@headlessui/react';\nimport { X } from 'lucide-react';\nimport clsx from 'clsx';\nimport { Fragment, useEffect, useState } from 'react';\n// import { FullHeightLayout } from './FullHeightLayout.js'\nimport { Navbar } from './Navbar.js';\nimport { Sidebar } from './Sidebar.js';\nimport { SidebarContext } from './SidebarContext.js';\nexport function AppLayout({ sidebarClassName, className, title, children, logo, navbar, sidebar, mainNav }) {\n if (localStorage.getItem('desktopSidebarOpen') === null) {\n localStorage.setItem('desktopSidebarOpen', 'true');\n }\n const [sidebarOpen, setSidebarOpen] = useState(false);\n const [desktopSidebarOpen, setDesktopSidebarOpen] = useState(localStorage.getItem('desktopSidebarOpen') === 'true');\n const [isLargeScreen, setIsLargeScreen] = useState(window.innerWidth >= 1024);\n useEffect(() => {\n const handleResize = () => {\n setIsLargeScreen(window.innerWidth >= 1024);\n };\n window.addEventListener('resize', handleResize);\n return () => window.removeEventListener('resize', handleResize);\n }, []);\n const sidebarContextValue = {\n isOpen: isLargeScreen ? desktopSidebarOpen : sidebarOpen,\n toggleDesktop: (value) => {\n if (value === undefined) {\n setDesktopSidebarOpen(!desktopSidebarOpen);\n }\n else {\n setDesktopSidebarOpen(value);\n }\n localStorage.setItem('desktopSidebarOpen', JSON.stringify(!desktopSidebarOpen));\n },\n toggleMobile: (value) => {\n if (value === undefined) {\n setSidebarOpen(!sidebarOpen);\n }\n else {\n setSidebarOpen(value);\n }\n },\n };\n return (_jsx(_Fragment, { children: _jsx(\"div\", { className: 'flex flex-col h-screen overflow-y-hidden', children: _jsxs(SidebarContext.Provider, { value: sidebarContextValue, children: [_jsx(\"div\", { className: 'w-full', children: mainNav }), _jsxs(\"div\", { className: 'flex h-full overflow-y-auto w-full', children: [_jsx(Transition, { show: sidebarOpen, as: Fragment, children: _jsxs(Dialog, { as: \"div\", className: \"relative z-50 lg:hidden\", onClose: setSidebarOpen, children: [_jsx(TransitionChild, { as: Fragment, enter: \"transition-opacity ease-linear duration-300\", enterFrom: \"opacity-0\", enterTo: \"opacity-100\", leave: \"transition-opacity ease-linear duration-300\", leaveFrom: \"opacity-100\", leaveTo: \"opacity-0\", children: _jsx(\"div\", { className: \"fixed inset-0 bg-gray-900/80\" }) }), _jsx(\"div\", { className: \"fixed inset-0 flex\", children: _jsx(TransitionChild, { as: Fragment, enter: \"transition ease-in-out duration-300 transform\", enterFrom: \"-translate-x-full\", enterTo: \"translate-x-0\", leave: \"transition ease-in-out duration-300 transform\", leaveFrom: \"translate-x-0\", leaveTo: \"-translate-x-full\", children: _jsxs(DialogPanel, { className: \"relative flex w-full max-w-xs flex-1\", children: [_jsx(Sidebar, { logo: logo, className: sidebarClassName, children: sidebar }), _jsx(\"div\", { className: \"flex w-16 justify-center pt-5 items-start\", children: _jsxs(\"button\", { type: \"button\", className: \"-m-2.5 p-2.5\", onClick: () => setSidebarOpen(false), children: [_jsx(\"span\", { className: \"sr-only\", children: \"Close sidebar\" }), _jsx(X, { className: \"size-6 text-white\", \"aria-hidden\": \"true\" })] }) })] }) }) })] }) }), _jsx(\"div\", { className: `hidden lg:block relative transition-all duration-300 ${desktopSidebarOpen ? 'w-72' : 'w-12'}`, children: _jsx(Sidebar, { logo: logo, className: sidebarClassName, children: sidebar }) }), _jsxs(\"div\", { className: \"w-full h-full overflow-y-hidden\", children: [navbar ? (_jsx(Navbar, { title: title, logo: logo, children: navbar })) : null, _jsx(\"main\", { className: clsx(\"flex-1 h-full w-full relative flex flex-col\", className), children: children })] })] })] }) }) }));\n}\n//# sourceMappingURL=AppLayout.js.map"],"names":["FullHeightLayout","className","children","_jsx","clsx","Fixed","heightClass","Body","VR","HR","SidebarContext","createContext","isOpen","toggleMobile","toggleDesktop","useSidebarToggle","useContext","TitleBar","title","Navbar","logo","onSearch","_jsxs","HamburgerButton","NavbarSeparator","visible","SearchBox","action","method","htmlFor","Search","id","placeholder","type","name","_Fragment","Button","variant","size","onClick","window","innerWidth","Menu","visibility","NavbarIconButton","icon","Icon","NavbarButton","NavbarLink","href","Sidebar","role","SidebarSection","isFooter","header","Dot","SidebarTooltip","text","TooltipProvider","Tooltip","TooltipTrigger","asChild","TooltipContent","side","SidebarItem","external","tools","current","Nav","setTimeout","event","open","preventDefault","stopPropagation","AppLayout","sidebarClassName","navbar","sidebar","mainNav","localStorage","getItem","setItem","sidebarOpen","setSidebarOpen","useState","desktopSidebarOpen","setDesktopSidebarOpen","isLargeScreen","setIsLargeScreen","useEffect","handleResize","addEventListener","removeEventListener","sidebarContextValue","value","undefined","JSON","stringify","Provider","Transition","show","as","Fragment","Dialog","onClose","TransitionChild","enter","enterFrom","enterTo","leave","leaveFrom","leaveTo","DialogPanel","X"],"mappings":"qfAEO,SAASA,GAAiBC,UAAEA,EAASC,SAAEA,IAC1C,OAAQC,EAAK,MAAO,CAAEF,UAAWG,EAAK,gBAAiB,SAAU,kBAE7DH,GAAYC,SAAUA,GAC9B,CACAF,EAAiBK,MAAQ,UAAeC,YAAEA,EAAWL,UAAEA,EAASC,SAAEA,IAC9D,OAAQC,EAAK,MAAO,CAAEF,UAAWG,EAAK,SAAUE,EAAaL,GAAYC,SAAUA,GACvF,EACAF,EAAiBO,KAAO,UAAcN,UAAEA,EAASC,SAAEA,IAC/C,OAAQC,EAAK,MAAO,CAAEF,UAAWG,EAAK,qBAAsB,UAAW,YAAaH,GAAYC,SAAUA,GAC9G,EACAF,EAAiBQ,GAAK,aAClB,OAAQL,EAAK,MAAO,CAAEF,UAAW,iCACrC,EACAD,EAAiBS,GAAK,aAClB,OAAQN,EAAK,MAAO,CAAEF,UAAW,sCACrC,ECjBY,MAACS,EAAiBC,EAAc,CACxCC,QAAQ,EACRC,aAAc,OACdC,cAAe,SAEZ,SAASC,IACZ,OAAOC,EAAWN,EACtB,CCPO,SAASO,GAASC,MAAEA,IACvB,OAAOf,EAAK,MAAO,CAAEF,UAAW,oCAAqCC,SAAUgB,GACnF,CCEO,SAASC,GAAOjB,SAAEA,EAAQkB,KAAEA,EAAIC,SAAEA,EAAQH,MAAEA,IAC/C,OAAQI,EAAM,MAAO,CAAErB,UAAW,gHAAiHC,SAAU,CAACC,EAAKoB,EAAiB,IAAKpB,EAAK,MAAO,CAAEF,UAAW,YAAaC,SAAUkB,IAASC,GAAYlB,EAAKqB,EAAiB,CAAEC,QAAS,WAAaH,EAAM,MAAO,CAAErB,UAAW,8CAA+CC,SAAU,CAACC,EAAKc,EAAU,CAAEC,MAAOA,IAAUG,GAAYlB,EAAKuB,EAAW,C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AAqB,OAAS,QAAUnF,SAAUC,EAAK+C,EAAS,CAAE9B,KAAMA,EAAMnB,UAAW0E,EAAkBzE,SAAU2E,MAAevD,EAAM,MAAO,CAAErB,UAAW,kCAAmCC,SAAU,CAAC0E,EAAUzE,EAAKgB,EAAQ,CAAED,MAAOA,EAAOE,KAAMA,EAAMlB,SAAU0E,IAAa,KAAMzE,EAAK,OAAQ,CAAEF,UAAWG,EAAK,8CAA+CH,GAAYC,SAAUA,gBAC9jE"}
|
|
1
|
+
{"version":3,"file":"vertesia-ui-layout.js","sources":["esm/layout/FullHeightLayout.js","esm/layout/SidebarContext.js","esm/layout/TitleBar.js","esm/layout/Navbar.js","esm/layout/Sidebar.js","esm/layout/AppLayout.js"],"sourcesContent":["import { jsx as _jsx } from \"react/jsx-runtime\";\nimport clsx from 'clsx';\nexport function FullHeightLayout({ className, children }) {\n return (_jsx(\"div\", { className: clsx(\"flex flex-col\", \"h-full\", \"overflow-y-auto\", \"px-2\", className), children: children }));\n}\nFullHeightLayout.Fixed = function Fixed({ heightClass, className, children }) {\n return (_jsx(\"div\", { className: clsx(\"w-full\", heightClass, className), children: children }));\n};\nFullHeightLayout.Body = function Body({ className, children }) {\n return (_jsx(\"div\", { className: clsx(\"grow overflow-auto\", \"min-h-0\", \"p-2\", className), children: children }));\n};\nFullHeightLayout.VR = function VDivider({}) {\n return (_jsx(\"div\", { className: \"w-[1px] border border-red-200\" }));\n};\nFullHeightLayout.HR = function HDivider({}) {\n return (_jsx(\"div\", { className: \"w-full h-1 border-b border-red-200\" }));\n};\n//# sourceMappingURL=FullHeightLayout.js.map","import { createContext, useContext } from \"react\";\nexport const SidebarContext = createContext({\n isOpen: false,\n toggleMobile: () => void 0,\n toggleDesktop: () => void 0,\n});\nexport function useSidebarToggle() {\n return useContext(SidebarContext);\n}\n//# sourceMappingURL=SidebarContext.js.map","import { jsx as _jsx } from \"react/jsx-runtime\";\nexport function TitleBar({ title }) {\n return _jsx(\"div\", { className: 'self-center text-lg font-semibold', children: title });\n}\n//# sourceMappingURL=TitleBar.js.map","import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from \"react/jsx-runtime\";\nimport { Menu, Search } from 'lucide-react';\nimport { Button } from '@vertesia/ui/core';\nimport { useSidebarToggle } from './SidebarContext.js';\nimport { TitleBar } from './TitleBar.js';\nexport function Navbar({ children, logo, onSearch, title }) {\n return (_jsxs(\"div\", { className: \"sticky top-0 z-40 flex h-16 shrink-0 items-center gap-x-4 border-b px-4 shadow-2xs sm:gap-x-6 sm:px-6 lg:px-8\", children: [_jsx(HamburgerButton, {}), _jsx(\"div\", { className: \"lg:hidden\", children: logo }), onSearch && _jsx(NavbarSeparator, { visible: 'mobile' }), _jsxs(\"div\", { className: \"flex flex-1 gap-x-4 self-stretch lg:gap-x-6\", children: [_jsx(TitleBar, { title: title }), onSearch && _jsx(SearchBox, { onSearch: onSearch }), _jsx(\"div\", { className: \"flex items-center gap-x-4 lg:gap-x-6 ml-auto\", children: children })] })] }));\n}\nfunction SearchBox({}) {\n return (_jsxs(\"form\", { className: \"relative flex flex-1\", action: \"#\", method: \"GET\", children: [_jsx(\"label\", { htmlFor: \"search-field\", className: \"sr-only\", children: \"Search\" }), _jsx(Search, { className: \"pointer-events-none absolute inset-y-0 left-0 h-full w-5 text-gray-400\", \"aria-hidden\": \"true\" }), _jsx(\"input\", { id: \"search-field\", className: \"block h-full w-full border-0 py-0 pl-8 pr-0 text-gray-900 placeholder:text-gray-400 focus:ring-0 sm:text-sm\", placeholder: \"Search...\", type: \"search\", name: \"search\" })] }));\n}\nexport function HamburgerButton() {\n const { toggleDesktop, toggleMobile } = useSidebarToggle();\n const toggle = () => {\n if (window.innerWidth < 1024) {\n toggleMobile();\n }\n else {\n toggleDesktop();\n }\n };\n return (_jsx(_Fragment, { children: _jsx(Button, { variant: 'ghost', size: 'icon', onClick: () => toggle(), className: \"p-2 rounded-full transition-colors w-full text-center \", children: _jsx(Menu, { \"aria-hidden\": \"true\", size: 24 }) }) }));\n}\nexport function NavbarSeparator({ visible }) {\n let visibility = \"\";\n if (visible) {\n visibility = visible === \"mobile\" ? \"lg:hidden\" : \"hidden lg:block\";\n }\n return (_jsx(\"div\", { className: `h-6 w-px bg-gray-900/10 dark:bg-slate-900/0.1 ${visibility}`, \"aria-hidden\": \"true\" }));\n}\nexport function NavbarIconButton({ title, icon: Icon, onClick }) {\n return (_jsxs(\"button\", { type: \"button\", className: \"-m-2.5 p-2.5 text-gray-400 dark:text-slate-50 hover:text-gray-500\", onClick: onClick, children: [_jsx(\"span\", { className: \"sr-only\", children: title }), _jsx(Icon, { className: \"size-6\", \"aria-hidden\": \"true\", title: title })] }));\n}\nexport function NavbarButton({ children, onClick }) {\n return (_jsx(Button, { onClick: onClick, children: children }));\n}\nexport function NavbarLink({ href, onClick, children }) {\n return (_jsx(\"a\", { className: \"dark:text-slate-50\", href: href, onClick: onClick, children: children }));\n}\n//# sourceMappingURL=Navbar.js.map","import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from \"react/jsx-runtime\";\nimport clsx from 'clsx';\nimport { useSidebarToggle } from './SidebarContext';\nimport { Dot } from 'lucide-react';\nimport { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider } from '@vertesia/ui/core';\nimport { Nav } from \"@vertesia/ui/router\";\nexport function Sidebar({ children, logo, className }) {\n return (_jsxs(\"div\", { className: clsx(className || \"bg-indigo-600 dark:bg-indigo-950\", \"flex flex-col h-full\"), children: [logo &&\n _jsx(\"div\", { className: \"-mx-2 flex h-auto my-4 shrink-0 self-start\", children: logo }), _jsx(\"div\", { className: \"flex-1 min-h-0 overflow-hidden px-2\", children: _jsx(\"nav\", { className: \"h-full flex flex-col\", children: _jsx(\"ul\", { role: \"list\", className: \"flex flex-col gap-y-2 overflow-y-auto h-full\", children: children }) }) })] }));\n}\nexport function SidebarSection({ children, title, action, isFooter = false }) {\n const { isOpen } = useSidebarToggle();\n let header = isOpen ? _jsxs(_Fragment, { children: [title || \"\", action] }) : _jsx(Dot, { className: 'size-6' });\n return (_jsxs(\"li\", { className: isFooter ? 'mt-auto' : '', children: [title && _jsx(\"div\", { className: \"text-xs font-medium h-8 flex items-center gap-x-2 px-2 text-sidebar-foreground/70\", children: header }), _jsx(\"ul\", { \"data-sidebar\": \"menu\", className: \"flex w-full min-w-0 flex-col gap-1\", children: children })] }));\n}\nexport function SidebarTooltip({ children, text }) {\n const { isOpen } = useSidebarToggle();\n return (isOpen ? _jsx(_Fragment, { children: children }) :\n _jsx(TooltipProvider, { children: _jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: children }), _jsx(TooltipContent, { side: 'right', children: text })] }) }));\n}\nexport function SidebarItem({ external, className, tools, children, icon: Icon, href, current, onClick }) {\n const { toggleMobile } = useSidebarToggle();\n const _closeSideBar = () => {\n setTimeout(() => {\n toggleMobile(false);\n }, 100);\n };\n const onClickWrapper = (event) => {\n if (external) {\n window.open(href, '_blank');\n event.preventDefault(); // Prevent default link behavior\n event.stopPropagation(); // Stop the event from propagating\n }\n else if (onClick) {\n onClick(event);\n }\n };\n return (_jsx(\"li\", { children: _jsx(Nav, { onClick: _closeSideBar, children: _jsx(SidebarTooltip, { text: children, children: _jsxs(\"a\", { href: href, onClick: onClickWrapper, className: clsx(current\n ? 'bg-sidebar-accent text-sidebar-accent-foreground'\n : 'text-sidebar-foreground hover:text-sidebar-accent-foreground hover:bg-sidebar-accent', 'group flex gap-x-3 rounded-md px-2 py-1.5 text-sm items-center h-8', className), children: [Icon &&\n _jsx(Icon, { className: clsx(current\n ? 'bg-sidebar-accent text-sidebar-accent-foreground'\n : 'text-sidebar-foreground hover:text-sidebar-accent-foreground hover:bg-sidebar-accent', 'size-4 shrink-0'), \"aria-hidden\": \"true\" }), children, tools && _jsx(\"div\", { className: 'flex items-center ml-auto', children: tools })] }) }) }) }));\n}\n//# sourceMappingURL=Sidebar.js.map","import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from \"react/jsx-runtime\";\nimport { Dialog, DialogPanel, Transition, TransitionChild } from '@headlessui/react';\nimport { X } from 'lucide-react';\nimport clsx from 'clsx';\nimport { Fragment, useEffect, useState } from 'react';\n// import { FullHeightLayout } from './FullHeightLayout.js'\nimport { Navbar } from './Navbar.js';\nimport { Sidebar } from './Sidebar.js';\nimport { SidebarContext } from './SidebarContext.js';\nexport function AppLayout({ sidebarClassName, className, title, children, logo, navbar, sidebar, mainNav }) {\n if (localStorage.getItem('desktopSidebarOpen') === null) {\n localStorage.setItem('desktopSidebarOpen', 'true');\n }\n const [sidebarOpen, setSidebarOpen] = useState(false);\n const [desktopSidebarOpen, setDesktopSidebarOpen] = useState(localStorage.getItem('desktopSidebarOpen') === 'true');\n const [isLargeScreen, setIsLargeScreen] = useState(window.innerWidth >= 1024);\n useEffect(() => {\n const handleResize = () => {\n setIsLargeScreen(window.innerWidth >= 1024);\n };\n window.addEventListener('resize', handleResize);\n return () => window.removeEventListener('resize', handleResize);\n }, []);\n const sidebarContextValue = {\n isOpen: isLargeScreen ? desktopSidebarOpen : sidebarOpen,\n toggleDesktop: (value) => {\n if (value === undefined) {\n setDesktopSidebarOpen(!desktopSidebarOpen);\n }\n else {\n setDesktopSidebarOpen(value);\n }\n localStorage.setItem('desktopSidebarOpen', JSON.stringify(!desktopSidebarOpen));\n },\n toggleMobile: (value) => {\n if (value === undefined) {\n setSidebarOpen(!sidebarOpen);\n }\n else {\n setSidebarOpen(value);\n }\n },\n };\n return (_jsx(_Fragment, { children: _jsx(\"div\", { className: 'flex flex-col h-screen overflow-y-hidden', children: _jsxs(SidebarContext.Provider, { value: sidebarContextValue, children: [_jsx(\"div\", { className: 'w-full', children: mainNav }), _jsxs(\"div\", { className: 'flex h-full overflow-y-auto w-full', children: [_jsx(Transition, { show: sidebarOpen, as: Fragment, children: _jsxs(Dialog, { as: \"div\", className: \"relative z-50 lg:hidden\", onClose: setSidebarOpen, children: [_jsx(TransitionChild, { as: Fragment, enter: \"transition-opacity ease-linear duration-300\", enterFrom: \"opacity-0\", enterTo: \"opacity-100\", leave: \"transition-opacity ease-linear duration-300\", leaveFrom: \"opacity-100\", leaveTo: \"opacity-0\", children: _jsx(\"div\", { className: \"fixed inset-0 bg-gray-900/80\" }) }), _jsx(\"div\", { className: \"fixed inset-0 flex\", children: _jsx(TransitionChild, { as: Fragment, enter: \"transition ease-in-out duration-300 transform\", enterFrom: \"-translate-x-full\", enterTo: \"translate-x-0\", leave: \"transition ease-in-out duration-300 transform\", leaveFrom: \"translate-x-0\", leaveTo: \"-translate-x-full\", children: _jsxs(DialogPanel, { className: \"relative flex w-full max-w-xs flex-1\", children: [_jsx(Sidebar, { logo: logo, className: sidebarClassName, children: sidebar }), _jsx(\"div\", { className: \"flex w-16 justify-center pt-5 items-start\", children: _jsxs(\"button\", { type: \"button\", className: \"-m-2.5 p-2.5\", onClick: () => setSidebarOpen(false), children: [_jsx(\"span\", { className: \"sr-only\", children: \"Close sidebar\" }), _jsx(X, { className: \"size-6 text-white\", \"aria-hidden\": \"true\" })] }) })] }) }) })] }) }), _jsx(\"div\", { className: `hidden lg:block relative transition-all duration-300 ${desktopSidebarOpen ? 'w-72' : 'w-12'}`, children: _jsx(Sidebar, { logo: logo, className: sidebarClassName, children: sidebar }) }), _jsxs(\"div\", { className: \"w-full h-full overflow-y-hidden\", children: [navbar ? (_jsx(Navbar, { title: title, logo: logo, children: navbar })) : null, _jsx(\"main\", { className: clsx(\"flex-1 h-full w-full relative flex flex-col\", className), children: children })] })] })] }) }) }));\n}\n//# sourceMappingURL=AppLayout.js.map"],"names":["FullHeightLayout","className","children","_jsx","clsx","Fixed","heightClass","Body","VR","HR","SidebarContext","createContext","isOpen","toggleMobile","toggleDesktop","useSidebarToggle","useContext","TitleBar","title","Navbar","logo","onSearch","_jsxs","HamburgerButton","NavbarSeparator","visible","SearchBox","action","method","htmlFor","Search","id","placeholder","type","name","_Fragment","Button","variant","size","onClick","window","innerWidth","Menu","visibility","NavbarIconButton","icon","Icon","NavbarButton","NavbarLink","href","Sidebar","role","SidebarSection","isFooter","header","Dot","SidebarTooltip","text","TooltipProvider","Tooltip","TooltipTrigger","asChild","TooltipContent","side","SidebarItem","external","tools","current","Nav","setTimeout","event","open","preventDefault","stopPropagation","AppLayout","sidebarClassName","navbar","sidebar","mainNav","localStorage","getItem","setItem","sidebarOpen","setSidebarOpen","useState","desktopSidebarOpen","setDesktopSidebarOpen","isLargeScreen","setIsLargeScreen","useEffect","handleResize","addEventListener","removeEventListener","sidebarContextValue","value","undefined","JSON","stringify","Provider","Transition","show","as","Fragment","Dialog","onClose","TransitionChild","enter","enterFrom","enterTo","leave","leaveFrom","leaveTo","DialogPanel","X"],"mappings":"qfAEO,SAASA,GAAiBC,UAAEA,EAASC,SAAEA,IAC1C,OAAQC,EAAK,MAAO,CAAEF,UAAWG,EAAK,gBAAiB,SAAU,kBAAmB,OAAQH,GAAYC,SAAUA,GACtH,CACAF,EAAiBK,MAAQ,UAAeC,YAAEA,EAAWL,UAAEA,EAASC,SAAEA,IAC9D,OAAQC,EAAK,MAAO,CAAEF,UAAWG,EAAK,SAAUE,EAAaL,GAAYC,SAAUA,GACvF,EACAF,EAAiBO,KAAO,UAAcN,UAAEA,EAASC,SAAEA,IAC/C,OAAQC,EAAK,MAAO,CAAEF,UAAWG,EAAK,qBAAsB,UAAW,MAAOH,GAAYC,SAAUA,GACxG,EACAF,EAAiBQ,GAAK,aAClB,OAAQL,EAAK,MAAO,CAAEF,UAAW,iCACrC,EACAD,EAAiBS,GAAK,aAClB,OAAQN,EAAK,MAAO,CAAEF,UAAW,sCACrC,ECfY,MAACS,EAAiBC,EAAc,CACxCC,QAAQ,EACRC,aAAc,OACdC,cAAe,SAEZ,SAASC,IACZ,OAAOC,EAAWN,EACtB,CCPO,SAASO,GAASC,MAAEA,IACvB,OAAOf,EAAK,MAAO,CAAEF,UAAW,oCAAqCC,SAAUgB,GACnF,CCEO,SAASC,GAAOjB,SAAEA,EAAQkB,KAAEA,EAAIC,SAAEA,EAAQH,MAAEA,IAC/C,OA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EAAK,MAAO,CAAEF,UAAW,4CAA6CC,SAAUoB,EAAM,SAAU,CAAEW,KAAM,SAAUhC,UAAW,eAAgBsC,QAAS,IAAM4C,GAAe,GAAQjF,SAAU,CAACC,EAAK,OAAQ,CAAEF,UAAW,UAAWC,SAAU,kBAAoBC,EAAK8G,EAAG,CAAEhH,UAAW,oBAAqB,cAAe,0BAAmCE,EAAK,MAAO,CAAEF,UAAW,yDAAwDoF,EAAqB,OAAS,QAAUnF,SAAUC,EAAK+C,EAAS,CAAE9B,KAAMA,EAAMnB,UAAW0E,EAAkBzE,SAAU2E,MAAevD,EAAM,MAAO,CAAErB,UAAW,kCAAmCC,SAAU,CAAC0E,EAAUzE,EAAKgB,EAAQ,CAAED,MAAOA,EAAOE,KAAMA,EAAMlB,SAAU0E,IAAa,KAAMzE,EAAK,OAAQ,CAAEF,UAAWG,EAAK,8CAA+CH,GAAYC,SAAUA,gBAC9jE"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as t,jsxs as e}from"react/jsx-runtime";import{useRef as n,useEffect as a,createContext as r,useContext as i,useState as s,useMemo as o}from"react";import{useSafeLayoutEffect as h}from"@vertesia/ui/core";function c(t){return"/"===t||""===t}function l(t,e){return e=t.endsWith("/")&&e.startsWith("/")?t+e.substring(1):t.endsWith("/")||e.startsWith("/")?t+e:t+"/"+e}function u(t){if(""===t||"/"===t)return[];let e=0,n=t.length;return t.startsWith("./")?e=2:t.startsWith("/")&&(e=1),t.endsWith("/")&&(n=t.length-1),(e>0||n<t.length?t.substring(e,n):t).split("/")}function d(t){if("string"==typeof t)return u(t);if(Array.isArray(t))return t;throw new Error(`Unsupported path object: ${t}`)}var m=Object.freeze({__proto__:null,getPathSegments:u,isRootPath:c,joinPath:l,toSegments:d});class p{path;params;hash;constructor(t){let e=t.lastIndexOf("#");e>-1?(this.hash=t.substring(e),t=t.substring(0,e)):this.hash="",e=t.indexOf("?"),e>-1?(this.path=t.substring(0,e),this.params=new URLSearchParams(t.substring(e+1))):(this.path=t,this.params=new URLSearchParams)}add(t){for(const[e,n]of Object.entries(t))this.params.set(e,n);return this}toString(){return this.path+"?"+this.params.toString()+this.hash}}const f=Symbol("BASE_PATH");class g{name;type;location;state;_canceled=!1;constructor(t,e,n,a){this.name=t,this.type=e,this.location=n,this.state=a}get isPageLoad(){return"initial"===this.type}get isBackForward(){return"popState"===this.type}get isLinkClick(){return"linkClick"===this.type}get isNavigation(){return"navigate"===this.type}get isCancelable(){return"beforeChange"===this.name}cancel(){if("afterChange"===this.name)throw new Error("Cannot cancel afterChange event");this._canceled=!0}}class w extends g{constructor(t,e,n){super("beforeChange",t,e,n)}}class v extends g{constructor(t,e,n){super("afterChange",t,e,n)}}class P{stickyParams;_popStateListener;_linkNavListener;_listeners=[];constructor(){}addListener(t){this._listeners.push(t)}fireLocationChange(t){for(const e of this._listeners)e(t)}firePageLoad(){this.fireLocationChange(new v("initial",new URL(window.location.href)))}addStickyParams(t){return this.stickyParams?new p(t).add(this.stickyParams).toString():t}navigate(t,e={}){if(e.basePath){let n=e.basePath;n.startsWith("/")||(n="/"+n),t=l(n,t)}t=this.addStickyParams(t),this._navigate(new URL(t,window.location.href),"navigate",e)}_navigate(t,e,n){const a=new w(e,t,n.state);this.fireLocationChange(a),a._canceled||(window.history[n.replace?"replaceState":"pushState"]({from:window.location.href,data:n.state||void 0},"",t.href),this.fireLocationChange(new v(e,t,n.state)))}start(){if("undefined"==typeof window)return;const t=t=>{let e=t.state?"popState":"linkClick";const n=new URL(window.location.href);let a;t.state?(e="popState",a=t.state.data):e="linkClick",this.fireLocationChange(new v(e,n,a))};this._popStateListener=t,this._linkNavListener=t=>{const e=function(t){if(t&&"a"===t.tagName.toLowerCase()){const e=t.href;if(null!=e)return new URL(e)}return null}(t.target);if(e&&e.origin===window.location.origin){t.preventDefault();const n=new URL(this.addStickyParams(e.href)),a=t[f]||t.target[f];a&&(n.pathname=l(a,n.pathname)),this._navigate(n,"linkClick",{})}},window.addEventListener("popstate",t),document.body.addEventListener("click",this._linkNavListener)}stop(){this._popStateListener&&window.removeEventListener("popstate",this._popStateListener),this._linkNavListener&&document.body.removeEventListener("click",this._linkNavListener)}}function b({basePath:e,children:r}){const i=n(null);return a((()=>{if(i.current){const t=i.current,n=t=>{"a"===t.target.tagName.toLowerCase()&&(t[f]=e)};return t.addEventListener("click",n),()=>{t.removeEventListener("click",n)}}}),[i.current]),t("div",{ref:i,className:"h-full w-full",children:r})}class L{tree=new S;loadMapping(t){for(const[e,n]of Object.entries(t))this.addSegments(u(e),n)}addPath(t,e){this.addSegments(u(t),e)}addSegments(t,e){let n=this.tree;for(let a=0,r=t.length;a<r;a++){const i=t[a];if(":"===i[0]){let e=n.wildcard;if(e){if(!(e instanceof y))throw new Error(`Failed to index path segments: ${t.join("/")}. A wildcard ":" segment will overwrite an existing wildcard segment at path: ${"/"+t.slice(0,a).join("/")}`)}else e=new y(i),n.wildcard=e;n=e}else{if("*"===i){if(n.wildcard)throw new Error(`Failed to index path segments: ${t.join("/")}. A wildcard "*" segment already exists at path: ${"/"+t.slice(0,a).join("/")}`);if(n.wildcard=new _(i,e),a<r-1)throw new Error(`Failed to index path segments: ${t.join("/")}. A wildcard segment must be the last segment`);return}{let t=n.children[i];t||(t=new C(i),n.children[i]=t),n=t}}}if(void 0!==n.value)throw new Error(`Failed to index path segments: ${t.join("/")}. A value already exists at path: ${"/"+t.join("/")}`);n.value=e}match(t){const e=d(t);if(0===e.length)return null;const n={};let a,r,i=this.tree;for(const t of e){const e=i.match(t,n);if(!e)return null;i=e}if(!i.value){if(i instanceof k&&i.wildcard instanceof _&&(i=i.wildcard.match("",n),!i.value))throw new Error("Wildcard segment node `*` must have a value");if(!i.value)return null}return n._&&n._.length>0?(a=e.slice(0,-n._.length),r=n._):a=e,{params:n,matchedSegments:a,remainingSegments:r,value:i.value}}}class k{name;value;children={};wildcard;constructor(t,e){this.name=t,this.value=e}match(t,e){let n=this.children[t];if(n)return n;if(this.wildcard){if(this.wildcard instanceof _)return this.wildcard.match(t,e);if(this.wildcard instanceof y)return e[this.wildcard.paramName]=t,this.wildcard;throw new Error("Unknown wildcard segment node type: "+this.wildcard.constructor.name)}return null}}class S extends k{constructor(){super("#root")}}class C extends k{constructor(t,e){super(t,e)}}class y extends k{paramName;constructor(t,e){super(t,e),this.paramName=t.substring(1)}}class _{name;value;constructor(t,e){this.name=t,this.value=e}match(t,e){return e._?t&&e._.push(t):e._=t?[t]:[],this}}class x{index;matcher=new L;constructor(t,e){this.index=e;for(const e of t)this.matcher.addPath(e.path,e)}match(t){const e=c(t)&&this.index;return this.matcher.match(e?this.index:t)}}class R extends x{prompt;observer;navigator=new P;constructor(t,e){super(t),this.navigator.addListener((t=>{if((!(t.isCancelable&&this.prompt&&this.prompt.when)||window.confirm(this.prompt.message))&&(this.observer&&this.observer(t),"afterChange"===t.name)){const n=this.match(t.location.pathname);n&&n.value?e({...n,state:t.state}):e(null)}}))}getTopRouter(){return this}setStickyParams(t){this.navigator.stickyParams=null!=t?t:void 0}withObserver(t){return this.observer=t,this}start(){this.navigator.start(),this.navigator.firePageLoad()}stop(){this.navigator.stop()}navigate(t,e){this.navigator.navigate(t,e)}}class E extends x{parent;basePath;constructor(t,e,n){super(n),this.parent=t,this.basePath=e}getTopRouter(){return this.parent instanceof R?this.parent:this.parent.getTopRouter()}navigate(t,e){let n;if(e?.isBasePathNested??!0){const t=e?.basePath;n=t?l(this.basePath,t):this.basePath}else n=e?.basePath??this.basePath;this.parent.navigate(t,{...e,basePath:n})}}const j=r(void 0);function N(){const t=i(j);if(!t)throw new Error("useRouter must be used within a RouterProvider");return t}function $(){const{navigate:t}=N();return t}function U(t){const{params:e}=N();return t?e[t]:e}function W(){const{location:t}=N();return t}function A(t){const{router:e}=N();a((()=>(e.getTopRouter().prompt=t,()=>{e.getTopRouter().prompt=void 0})),[]),a((()=>{if(t.when){const e=t.when,n=function(t){e&&(t.preventDefault(),t.returnValue="")};return window.addEventListener("beforeunload",n),()=>{window.removeEventListener("beforeunload",n)}}}),[t.when])}function O({children:e,onClick:n}){const a=$();return t("span",{onClick:t=>{const e=t.target.closest("a");e&&e.href&&(t.stopPropagation(),t.preventDefault(),a(e.href),n?.(t))},children:e})}function T({children:e,href:n,className:a,topLevelNav:r}){const{router:i}=N();return t("a",{href:n,className:a,onClick:t=>{t.stopPropagation(),t.preventDefault();(r?i.getTopRouter():i).navigate(n)},children:e})}function z({spinner:e}){const n=N(),a=n.route;if(a.Component){const e=a.Component;return t(e,{...n.params})}if(a.LazyComponent)return t(F,{route:a,spinner:e});throw new Error(`Invalid route for ${a.path}. Either Component or LazyCOmponent must be specified.`)}function F({route:e,spinner:n}){const[r,i]=s(null);return a((()=>{e.LazyComponent().then((t=>{if(!t.default)throw new Error(`Lazy module for ${e.path} does not have a default export`);i((()=>t.default))}))}),[e]),r?t(r,{}):n||null}function D({basePath:e,fixLinks:n=!1,children:a}){const r=N(),i=n?e=>t(b,{basePath:r.matchedRoutePath,children:e}):t=>t;return t(j.Provider,{value:{...r,navigate:(t,n)=>{const a=n?.basePath?l(e,n.basePath):e;return r.navigate(t,{...n,basePath:a})}},children:i(a||t(z,{}))})}function B(){const t=N();return e("div",{children:["Route not found for path ",t.matchedRoutePath]})}function I(){return{params:{},matchedSegments:[],state:null,value:{path:"virtual:404",Component:()=>t(B,{})}}}function H({routes:e,index:n,children:r,fixLinks:i=!1}){const h=N(),[c,l]=s(void 0),u=o((()=>{if("undefined"==typeof window)return null;const t=h.matchedRoutePath,a=new E(h.router,t,e);return a.index=n,a}),[]);a((()=>{if(u){if(h.matchedRoutePath!==u.basePath)return;const t=u.match(h.remainingPath||"/")||I();l(t)}}),[u,h.remainingPath]);const d=i?e=>t(b,{basePath:h.matchedRoutePath,children:e}):t=>t;return c&&t(j.Provider,{value:{...h,router:u,route:c.value,params:c.params,matchedRoutePath:"/"+c.matchedSegments.join("/"),remainingPath:c.remainingSegments?"/"+c.remainingSegments.join("/"):void 0,navigate:(t,e)=>u.navigate(t,e)},children:d(r||t(z,{}))})}function M({routes:e,index:n,onChange:a,children:r}){const[i,c]=s(void 0),l=o((()=>{if("undefined"==typeof window)return null;const t=new R(e,(e=>{null===e&&(e=I()),c({location:window.location,route:e.value,params:e.params,state:e.state,router:t,matchedRoutePath:"/"+e.matchedSegments.join("/"),remainingPath:e.remainingSegments?"/"+e.remainingSegments.join("/"):void 0,navigate:(e,n)=>t.navigate(e,n)})})).withObserver(a);return t.index=n,t}),[]);return h((()=>(l&&l.start(),()=>{l&&l.stop()})),[]),i&&t(j.Provider,{value:i,children:r||t(z,{})})}export{v as AfterLocationChangeEvent,f as BASE_PATH,x as BaseRouter,w as BeforeLocationChangeEvent,b as FixLinks,P as HistoryNavigator,g as LocationChangeEvent,O as Nav,T as NavLink,D as NestedNavigationContext,E as NestedRouter,H as NestedRouterProvider,m as Path,L as PathMatcher,j as ReactRouterContext,z as RouteComponent,R as Router,M as RouterProvider,W as useLocation,$ as useNavigate,A as useNavigationPrompt,U as useParams,N as useRouterContext};
|
|
1
|
+
import{jsx as t,jsxs as e}from"react/jsx-runtime";import{useRef as n,useEffect as a,createContext as r,useContext as i,useState as s,useMemo as o}from"react";import{useSafeLayoutEffect as h}from"@vertesia/ui/core";function c(t){return"/"===t||""===t}function l(t,e){return e=t.endsWith("/")&&e.startsWith("/")?t+e.substring(1):t.endsWith("/")||e.startsWith("/")?t+e:t+"/"+e}function u(t){if(""===t||"/"===t)return[];let e=0,n=t.length;return t.startsWith("./")?e=2:t.startsWith("/")&&(e=1),t.endsWith("/")&&(n=t.length-1),(e>0||n<t.length?t.substring(e,n):t).split("/")}function d(t){if("string"==typeof t)return u(t);if(Array.isArray(t))return t;throw new Error(`Unsupported path object: ${t}`)}var m=Object.freeze({__proto__:null,getPathSegments:u,isRootPath:c,joinPath:l,toSegments:d});class p{path;params;hash;constructor(t){let e=t.lastIndexOf("#");e>-1?(this.hash=t.substring(e),t=t.substring(0,e)):this.hash="",e=t.indexOf("?"),e>-1?(this.path=t.substring(0,e),this.params=new URLSearchParams(t.substring(e+1))):(this.path=t,this.params=new URLSearchParams)}add(t){for(const[e,n]of Object.entries(t))this.params.set(e,n);return this}toString(){return this.path+"?"+this.params.toString()+this.hash}}const f=Symbol("BASE_PATH");class g{name;type;location;state;_canceled=!1;constructor(t,e,n,a){this.name=t,this.type=e,this.location=n,this.state=a}get isPageLoad(){return"initial"===this.type}get isBackForward(){return"popState"===this.type}get isLinkClick(){return"linkClick"===this.type}get isNavigation(){return"navigate"===this.type}get isCancelable(){return"beforeChange"===this.name}cancel(){if("afterChange"===this.name)throw new Error("Cannot cancel afterChange event");this._canceled=!0}}class w extends g{constructor(t,e,n){super("beforeChange",t,e,n)}}class v extends g{constructor(t,e,n){super("afterChange",t,e,n)}}class P{stickyParams;_popStateListener;_linkNavListener;_listeners=[];constructor(){}addListener(t){this._listeners.push(t)}fireLocationChange(t){for(const e of this._listeners)e(t)}firePageLoad(){this.fireLocationChange(new v("initial",new URL(window.location.href)))}addStickyParams(t){return this.stickyParams?new p(t).add(this.stickyParams).toString():t}navigate(t,e={}){if(e.basePath){let n=e.basePath;n.startsWith("/")||(n="/"+n),t=l(n,t)}t=this.addStickyParams(t),this._navigate(new URL(t,window.location.href),"navigate",e)}_navigate(t,e,n){const a=new w(e,t,n.state);this.fireLocationChange(a),a._canceled||(window.history[n.replace?"replaceState":"pushState"]({from:window.location.href,data:n.state||void 0},"",t.href),this.fireLocationChange(new v(e,t,n.state)))}start(){if("undefined"==typeof window)return;const t=t=>{let e=t.state?"popState":"linkClick";const n=new URL(window.location.href);let a;t.state?(e="popState",a=t.state.data):e="linkClick",this.fireLocationChange(new v(e,n,a))};this._popStateListener=t,this._linkNavListener=t=>{const e=function(t){if(t&&"a"===t.tagName.toLowerCase()){const e=t?.href.trim();if("string"==typeof e&&e.length>0)return new URL(e)}return null}(t.target);if(e&&e.origin===window.location.origin){t.preventDefault();const n=new URL(this.addStickyParams(e.href)),a=t[f]||t.target[f];a&&(n.pathname=l(a,n.pathname)),this._navigate(n,"linkClick",{})}},window.addEventListener("popstate",t),document.body.addEventListener("click",this._linkNavListener)}stop(){this._popStateListener&&window.removeEventListener("popstate",this._popStateListener),this._linkNavListener&&document.body.removeEventListener("click",this._linkNavListener)}}function b({basePath:e,children:r}){const i=n(null);return a((()=>{if(i.current){const t=i.current,n=t=>{"a"===t.target.tagName.toLowerCase()&&(t[f]=e)};return t.addEventListener("click",n),()=>{t.removeEventListener("click",n)}}}),[i.current]),t("div",{ref:i,className:"h-full w-full",children:r})}class L{tree=new S;loadMapping(t){for(const[e,n]of Object.entries(t))this.addSegments(u(e),n)}addPath(t,e){this.addSegments(u(t),e)}addSegments(t,e){let n=this.tree;for(let a=0,r=t.length;a<r;a++){const i=t[a];if(":"===i[0]){let e=n.wildcard;if(e){if(!(e instanceof C))throw new Error(`Failed to index path segments: ${t.join("/")}. A wildcard ":" segment will overwrite an existing wildcard segment at path: ${"/"+t.slice(0,a).join("/")}`)}else e=new C(i),n.wildcard=e;n=e}else{if("*"===i){if(n.wildcard)throw new Error(`Failed to index path segments: ${t.join("/")}. A wildcard "*" segment already exists at path: ${"/"+t.slice(0,a).join("/")}`);if(n.wildcard=new _(i,e),a<r-1)throw new Error(`Failed to index path segments: ${t.join("/")}. A wildcard segment must be the last segment`);return}{let t=n.children[i];t||(t=new y(i),n.children[i]=t),n=t}}}if(void 0!==n.value)throw new Error(`Failed to index path segments: ${t.join("/")}. A value already exists at path: ${"/"+t.join("/")}`);n.value=e}match(t){const e=d(t);if(0===e.length)return null;const n={};let a,r,i=this.tree;for(const t of e){const e=i.match(t,n);if(!e)return null;i=e}if(!i.value){if(i instanceof k&&i.wildcard instanceof _&&(i=i.wildcard.match("",n),!i.value))throw new Error("Wildcard segment node `*` must have a value");if(!i.value)return null}return n._&&n._.length>0?(a=e.slice(0,-n._.length),r=n._):a=e,{params:n,matchedSegments:a,remainingSegments:r,value:i.value}}}class k{name;value;children={};wildcard;constructor(t,e){this.name=t,this.value=e}match(t,e){let n=this.children[t];if(n)return n;if(this.wildcard){if(this.wildcard instanceof _)return this.wildcard.match(t,e);if(this.wildcard instanceof C)return e[this.wildcard.paramName]=t,this.wildcard;throw new Error("Unknown wildcard segment node type: "+this.wildcard.constructor.name)}return null}}class S extends k{constructor(){super("#root")}}class y extends k{constructor(t,e){super(t,e)}}class C extends k{paramName;constructor(t,e){super(t,e),this.paramName=t.substring(1)}}class _{name;value;constructor(t,e){this.name=t,this.value=e}match(t,e){return e._?t&&e._.push(t):e._=t?[t]:[],this}}class x{index;matcher=new L;constructor(t,e){this.index=e;for(const e of t)this.matcher.addPath(e.path,e)}match(t){const e=c(t)&&this.index;return this.matcher.match(e?this.index:t)}}class R extends x{prompt;observer;navigator=new P;constructor(t,e){super(t),this.navigator.addListener((t=>{if((!(t.isCancelable&&this.prompt&&this.prompt.when)||window.confirm(this.prompt.message))&&(this.observer&&this.observer(t),"afterChange"===t.name)){const n=this.match(t.location.pathname);n&&n.value?e({...n,state:t.state}):e(null)}}))}getTopRouter(){return this}setStickyParams(t){this.navigator.stickyParams=null!=t?t:void 0}withObserver(t){return this.observer=t,this}start(){this.navigator.start(),this.navigator.firePageLoad()}stop(){this.navigator.stop()}navigate(t,e){this.navigator.navigate(t,e)}}class E extends x{parent;basePath;constructor(t,e,n){super(n),this.parent=t,this.basePath=e}getTopRouter(){return this.parent instanceof R?this.parent:this.parent.getTopRouter()}navigate(t,e){let n;if(e?.isBasePathNested??!0){const t=e?.basePath;n=t?l(this.basePath,t):this.basePath}else n=e?.basePath??this.basePath;this.parent.navigate(t,{...e,basePath:n})}}const j=r(void 0);function N(){const t=i(j);if(!t)throw new Error("useRouter must be used within a RouterProvider");return t}function $(){const{navigate:t}=N();return t}function U(t){const{params:e}=N();return t?e[t]:e}function W(){const{location:t}=N();return t}function A(t){const{router:e}=N();a((()=>(e.getTopRouter().prompt=t,()=>{e.getTopRouter().prompt=void 0})),[]),a((()=>{if(t.when){const e=t.when,n=function(t){e&&(t.preventDefault(),t.returnValue="")};return window.addEventListener("beforeunload",n),()=>{window.removeEventListener("beforeunload",n)}}}),[t.when])}function O({children:e,onClick:n}){const a=$();return t("span",{onClick:t=>{const e=t.target.closest("a");e&&e.href&&(t.stopPropagation(),t.preventDefault(),a(e.href),n?.(t))},children:e})}function T({children:e,href:n,className:a,topLevelNav:r}){const{router:i}=N();return t("a",{href:n,className:a,onClick:t=>{t.stopPropagation(),t.preventDefault();(r?i.getTopRouter():i).navigate(n)},children:e})}function z({spinner:e}){const n=N(),a=n.route;if(a.Component){const e=a.Component;return t(e,{...n.params})}if(a.LazyComponent)return t(F,{route:a,spinner:e});throw new Error(`Invalid route for ${a.path}. Either Component or LazyCOmponent must be specified.`)}function F({route:e,spinner:n}){const[r,i]=s(null);return a((()=>{e.LazyComponent().then((t=>{if(!t.default)throw new Error(`Lazy module for ${e.path} does not have a default export`);i((()=>t.default))}))}),[e]),r?t(r,{}):n||null}function D({basePath:e,fixLinks:n=!1,children:a}){const r=N(),i=n?e=>t(b,{basePath:r.matchedRoutePath,children:e}):t=>t;return t(j.Provider,{value:{...r,navigate:(t,n)=>{const a=n?.basePath?l(e,n.basePath):e;return r.navigate(t,{...n,basePath:a})}},children:i(a||t(z,{}))})}function B(){const t=N();return e("div",{children:["Route not found for path ",t.matchedRoutePath]})}function I(){return{params:{},matchedSegments:[],state:null,value:{path:"virtual:404",Component:()=>t(B,{})}}}function H({routes:e,index:n,children:r,fixLinks:i=!1}){const h=N(),[c,l]=s(void 0),u=o((()=>{if("undefined"==typeof window)return null;const t=h.matchedRoutePath,a=new E(h.router,t,e);return a.index=n,a}),[]);a((()=>{if(u){if(h.matchedRoutePath!==u.basePath)return;const t=u.match(h.remainingPath||"/")||I();l(t)}}),[u,h.remainingPath]);const d=i?e=>t(b,{basePath:h.matchedRoutePath,children:e}):t=>t;return c&&t(j.Provider,{value:{...h,router:u,route:c.value,params:c.params,matchedRoutePath:"/"+c.matchedSegments.join("/"),remainingPath:c.remainingSegments?"/"+c.remainingSegments.join("/"):void 0,navigate:(t,e)=>u.navigate(t,e)},children:d(r||t(z,{}))})}function M({routes:e,index:n,onChange:a,children:r}){const[i,c]=s(void 0),l=o((()=>{if("undefined"==typeof window)return null;const t=new R(e,(e=>{null===e&&(e=I()),c({location:window.location,route:e.value,params:e.params,state:e.state,router:t,matchedRoutePath:"/"+e.matchedSegments.join("/"),remainingPath:e.remainingSegments?"/"+e.remainingSegments.join("/"):void 0,navigate:(e,n)=>t.navigate(e,n)})})).withObserver(a);return t.index=n,t}),[]);return h((()=>(l&&l.start(),()=>{l&&l.stop()})),[]),i&&t(j.Provider,{value:i,children:r||t(z,{})})}export{v as AfterLocationChangeEvent,f as BASE_PATH,x as BaseRouter,w as BeforeLocationChangeEvent,b as FixLinks,P as HistoryNavigator,g as LocationChangeEvent,O as Nav,T as NavLink,D as NestedNavigationContext,E as NestedRouter,H as NestedRouterProvider,m as Path,L as PathMatcher,j as ReactRouterContext,z as RouteComponent,R as Router,M as RouterProvider,W as useLocation,$ as useNavigate,A as useNavigationPrompt,U as useParams,N as useRouterContext};
|
|
2
2
|
//# sourceMappingURL=vertesia-ui-router.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vertesia-ui-router.js","sources":["esm/router/path.js","esm/router/PathWithParams.js","esm/router/HistoryNavigator.js","esm/router/FixLinks.js","esm/router/PathMatcher.js","esm/router/Router.js","esm/router/Nav.js","esm/router/RouteComponent.js","esm/router/NestedNavigationContext.js","esm/router/Route404.js","esm/router/NestedRouterProvider.js","esm/router/RouterProvider.js"],"sourcesContent":["export function isRootPath(path) {\n return path === '/' || path === '';\n}\nexport function joinPath(path1, path2) {\n if (path1.endsWith('/') && path2.startsWith('/')) {\n path2 = path1 + path2.substring(1);\n }\n else if (path1.endsWith('/')) {\n path2 = path1 + path2;\n }\n else if (path2.startsWith('/')) {\n path2 = path1 + path2;\n }\n else {\n path2 = path1 + '/' + path2;\n }\n return path2;\n}\nexport function getPathSegments(path) {\n if (path === '' || path === '/') {\n return [];\n }\n let s = 0, e = path.length;\n if (path.startsWith('./')) {\n s = 2;\n }\n else if (path.startsWith('/')) {\n s = 1;\n }\n if (path.endsWith('/')) {\n e = path.length - 1;\n }\n return (s > 0 || e < path.length ? path.substring(s, e) : path).split('/');\n}\nexport function toSegments(path) {\n if (typeof path === 'string') {\n return getPathSegments(path);\n }\n else if (Array.isArray(path)) {\n return path;\n }\n else {\n throw new Error(`Unsupported path object: ${path}`);\n }\n}\n// export class Path {\n// static parse(path: string, abs = false) {\n// if (abs !== undefined) {\n// abs = path.startsWith('/');\n// }\n// return new Path(getPathSegments(path), abs);\n// }\n// constructor(public segments: string[], public isAbsolute = false) {\n// }\n// getParameters() {\n// const out = [];\n// for (const segment of this.segments) {\n// if (segment[0] === ':') {\n// out.push(segment.substring(1));\n// }\n// }\n// if (this.segments[this.segments.length - 1] === '*') {\n// out.push('_');\n// }\n// return out;\n// }\n// resolveParameters(path: string) {\n// const params: PathMatchParams = {};\n// const resolvedSegments = getPathSegments(path);\n// if (resolvedSegments.length < this.segments.length) {\n// return null;\n// }\n// const segments = this.segments;\n// for (let i = 0, l = segments.length; i < l; i++) {\n// const seg = segments[i];\n// if (seg[0] === ':') {\n// params[seg.substring(1)] = resolvedSegments[i];\n// }\n// }\n// if (resolvedSegments.length - this.segments.length) {\n// params._ = resolvedSegments.slice(this.segments.length);\n// }\n// return params;\n// }\n// match(path: string | string[] | Path) {\n// const segments = toSegments(path);\n// if (segments.length < this.segments.length) {\n// return false;\n// }\n// let params: PathMatchParams | undefined;\n// const mySegments = this.segments;\n// for (let i = 0, l = mySegments.length; i < l; i++) {\n// const segment = mySegments[i];\n// if (segment === ':') {\n// if (!params) params = {};\n// params[segment.substring(1)] = segment;\n// } else if (segment !== segments[i]) {\n// if (i === l - 1 && segment === '*') {\n// if (!params) params = {};\n// params._ = segments.slice(i);\n// return params;\n// }\n// return false;\n// }\n// }\n// return params ? params : false;\n// }\n// join(path: Path | string | string[]) {\n// const segments = toSegments(path);\n// return new Path(this.segments.concat(segments), this.isAbsolute);\n// }\n// getRelativePath(path: Path | string | string[], asAbsolute: boolean = false) {\n// const segments = toSegments(path);\n// const extraSegmentsCount = segments.length - this.segments.length;\n// if (extraSegmentsCount <= 0) {\n// return null;\n// }\n// return new Path(segments.slice(this.segments.length), asAbsolute);\n// }\n// prependSegments(segments: string[]) {\n// this.segments = segments.concat(this.segments);\n// }\n// appendSegments(segments: string[]) {\n// this.segments = this.segments.concat(segments);\n// }\n// toAbsolutePath() {\n// return '/' + this.segments.join('/');\n// }\n// toRelativePath() {\n// return this.segments.join('/');\n// }\n// toString() {\n// const path = this.segments.join('/');\n// return this.isAbsolute ? '/' + path : path;\n// }\n// }\n//# sourceMappingURL=path.js.map","export class PathWithParams {\n path;\n params;\n hash;\n constructor(path) {\n let i = path.lastIndexOf('#');\n if (i > -1) {\n this.hash = path.substring(i);\n path = path.substring(0, i);\n }\n else {\n this.hash = '';\n }\n i = path.indexOf('?');\n if (i > -1) {\n this.path = path.substring(0, i);\n this.params = new URLSearchParams(path.substring(i + 1));\n }\n else {\n this.path = path;\n this.params = new URLSearchParams();\n }\n }\n add(params) {\n for (const [key, value] of Object.entries(params)) {\n this.params.set(key, value);\n }\n return this;\n }\n toString() {\n return this.path + '?' + this.params.toString() + this.hash;\n }\n}\n//# sourceMappingURL=PathWithParams.js.map","import { joinPath } from \"./path\";\nimport { PathWithParams } from \"./PathWithParams\";\nconst BASE_PATH = Symbol('BASE_PATH');\nexport { BASE_PATH };\nexport class LocationChangeEvent {\n name;\n type;\n location;\n state;\n _canceled = false;\n constructor(name, type, location, state) {\n this.name = name;\n this.type = type;\n this.location = location;\n this.state = state;\n }\n get isPageLoad() {\n return this.type === 'initial';\n }\n get isBackForward() {\n return this.type === 'popState';\n }\n get isLinkClick() {\n return this.type === 'linkClick';\n }\n get isNavigation() {\n return this.type === 'navigate';\n }\n get isCancelable() {\n return this.name === 'beforeChange';\n }\n cancel() {\n if (this.name === 'afterChange') {\n throw new Error('Cannot cancel afterChange event');\n }\n this._canceled = true;\n }\n}\nexport class BeforeLocationChangeEvent extends LocationChangeEvent {\n constructor(type, location, state) {\n super('beforeChange', type, location, state);\n }\n}\nexport class AfterLocationChangeEvent extends LocationChangeEvent {\n constructor(type, location, state) {\n super('afterChange', type, location, state);\n }\n}\nfunction getElementHrefAsUrl(elem) {\n if (elem && elem.tagName.toLowerCase() === 'a') {\n const href = elem.href;\n if (href != null) {\n return new URL(href);\n }\n }\n return null;\n}\nexport class HistoryNavigator {\n // params to preserve in the query string when navigating\n stickyParams;\n _popStateListener;\n _linkNavListener;\n _listeners = [];\n constructor() {\n }\n addListener(listener) {\n this._listeners.push(listener);\n }\n fireLocationChange(event) {\n for (const listener of this._listeners) {\n listener(event);\n }\n }\n /**\n * Should be called when the page is first loaded.\n * It will fire a location change event with type `initial` and the current window.location as the location\n */\n firePageLoad() {\n this.fireLocationChange(new AfterLocationChangeEvent('initial', new URL(window.location.href)));\n }\n addStickyParams(path) {\n if (this.stickyParams) {\n return new PathWithParams(path).add(this.stickyParams).toString();\n }\n return path;\n }\n navigate(to, options = {}) {\n if (options.basePath) {\n let basePath = options.basePath;\n if (!basePath.startsWith('/')) {\n basePath = '/' + basePath;\n }\n to = joinPath(basePath, to);\n }\n to = this.addStickyParams(to);\n this._navigate(new URL(to, window.location.href), 'navigate', options);\n }\n _navigate(to, type, options) {\n const beforeEvent = new BeforeLocationChangeEvent(type, to, options.state);\n this.fireLocationChange(beforeEvent);\n if (beforeEvent._canceled) {\n return;\n }\n window.history[options.replace ? 'replaceState' : 'pushState']({\n from: window.location.href,\n data: options.state || undefined\n }, '', to.href);\n this.fireLocationChange(new AfterLocationChangeEvent(type, to, options.state));\n }\n start() {\n if (typeof window === \"undefined\") {\n return;\n }\n const _popStateListener = (ev) => {\n let type = ev.state ? 'popState' : 'linkClick';\n const to = new URL(window.location.href);\n let state = undefined;\n if (ev.state) {\n type = 'popState';\n state = ev.state.data;\n }\n else {\n type = 'linkClick';\n }\n this.fireLocationChange(new AfterLocationChangeEvent(type, to, state));\n };\n const _linkNavListener = (ev) => {\n const url = getElementHrefAsUrl(ev.target);\n if (url && url.origin === window.location.origin) {\n ev.preventDefault();\n const to = new URL(this.addStickyParams(url.href));\n const basePath = ev[BASE_PATH] || ev.target[BASE_PATH];\n if (basePath) {\n to.pathname = joinPath(basePath, to.pathname);\n }\n this._navigate(to, 'linkClick', {});\n }\n };\n this._popStateListener = _popStateListener;\n this._linkNavListener = _linkNavListener;\n window.addEventListener('popstate', _popStateListener);\n document.body.addEventListener('click', this._linkNavListener);\n }\n stop() {\n this._popStateListener && window.removeEventListener('popstate', this._popStateListener);\n this._linkNavListener && document.body.removeEventListener('click', this._linkNavListener);\n }\n}\n//# sourceMappingURL=HistoryNavigator.js.map","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { useEffect, useRef } from \"react\";\nimport { BASE_PATH } from \"./HistoryNavigator\";\nexport function FixLinks({ basePath, children }) {\n const ref = useRef(null);\n useEffect(() => {\n if (ref.current) {\n const divElem = ref.current;\n const listener = (ev) => {\n const elem = ev.target;\n if (elem.tagName.toLowerCase() === 'a') {\n ev[BASE_PATH] = basePath;\n }\n };\n divElem.addEventListener('click', listener);\n return () => {\n divElem.removeEventListener('click', listener);\n };\n }\n }, [ref.current]);\n return (_jsx(\"div\", { ref: ref, className: \"h-full w-full\", children: children }));\n}\n//# sourceMappingURL=FixLinks.js.map","import { getPathSegments, toSegments } from \"./path\";\n/**\n * Path matcher which support :param and *wildcard segments.\n * The wildcard segment is only supported as the last segment\n */\nexport class PathMatcher {\n tree = new RootSegmentNode();\n loadMapping(mapping) {\n for (const [key, value] of Object.entries(mapping)) {\n this.addSegments(getPathSegments(key), value);\n }\n }\n addPath(path, value) {\n this.addSegments(getPathSegments(path), value);\n }\n addSegments(segments, value) {\n let node = this.tree;\n for (let i = 0, l = segments.length; i < l; i++) {\n const segment = segments[i];\n if (segment[0] === ':') {\n let childNode = node.wildcard;\n if (!childNode) {\n childNode = new VariableSegmentNode(segment);\n node.wildcard = childNode;\n }\n else if (!(childNode instanceof VariableSegmentNode)) {\n throw new Error(`Failed to index path segments: ${segments.join('/')}. A wildcard \":\" segment will overwrite an existing wildcard segment at path: ${'/' + segments.slice(0, i).join(\"/\")}`);\n }\n node = childNode;\n }\n else if (segment === '*') {\n if (node.wildcard) {\n throw new Error(`Failed to index path segments: ${segments.join('/')}. A wildcard \"*\" segment already exists at path: ${'/' + segments.slice(0, i).join(\"/\")}`);\n }\n node.wildcard = new WildcardSegmentNode(segment, value);\n if (i < l - 1) {\n throw new Error(`Failed to index path segments: ${segments.join('/')}. A wildcard segment must be the last segment`);\n }\n return;\n }\n else {\n let childNode = node.children[segment];\n if (!childNode) {\n childNode = new LiteralSegmentNode(segment);\n node.children[segment] = childNode;\n } // else // a literal segment already exists\n node = childNode;\n }\n }\n if (node.value !== undefined) {\n throw new Error(`Failed to index path segments: ${segments.join('/')}. A value already exists at path: ${'/' + segments.join(\"/\")}`);\n }\n node.value = value;\n }\n match(path) {\n const segments = toSegments(path);\n if (segments.length === 0) {\n return null;\n }\n const params = {};\n let node = this.tree;\n for (const segment of segments) {\n const match = node.match(segment, params);\n if (match) {\n node = match;\n }\n else {\n return null;\n }\n }\n if (!node.value) { // not a leaf node (partial match)\n if (node instanceof ParentSegmentNode) {\n if (node.wildcard instanceof WildcardSegmentNode) {\n node = node.wildcard.match('', params);\n if (!node.value) {\n throw new Error(\"Wildcard segment node `*` must have a value\");\n }\n }\n }\n if (!node.value)\n return null; // not a leaf node, neither a trailing wildcard (partial match)\n }\n let matchedSegments, remainingSegments;\n if (params._ && params._.length > 0) {\n matchedSegments = segments.slice(0, -params._.length);\n remainingSegments = params._;\n }\n else {\n matchedSegments = segments;\n }\n return { params, matchedSegments, remainingSegments, value: node.value };\n }\n}\nclass ParentSegmentNode {\n name;\n value;\n children = {};\n wildcard;\n constructor(name, value) {\n this.name = name;\n this.value = value;\n }\n match(segment, params) {\n let node = this.children[segment];\n if (node) {\n return node;\n }\n else if (this.wildcard) {\n if (this.wildcard instanceof WildcardSegmentNode) {\n return this.wildcard.match(segment, params);\n }\n else if (this.wildcard instanceof VariableSegmentNode) {\n params[this.wildcard.paramName] = segment;\n return this.wildcard;\n }\n else {\n throw new Error(\"Unknown wildcard segment node type: \" + this.wildcard.constructor.name);\n }\n }\n else {\n return null;\n }\n }\n}\nclass RootSegmentNode extends ParentSegmentNode {\n constructor() {\n super(\"#root\");\n }\n}\nclass LiteralSegmentNode extends ParentSegmentNode {\n constructor(name, value) {\n super(name, value);\n }\n}\nclass VariableSegmentNode extends ParentSegmentNode {\n paramName;\n constructor(name, value) {\n super(name, value);\n this.paramName = name.substring(1);\n }\n}\nclass WildcardSegmentNode {\n name;\n value;\n constructor(name, value) {\n this.name = name;\n this.value = value;\n }\n match(segment, params) {\n if (!params._) {\n params._ = segment ? [segment] : [];\n }\n else {\n segment && params._.push(segment);\n }\n return this;\n }\n}\n//# sourceMappingURL=PathMatcher.js.map","import { createContext, useContext, useEffect } from \"react\";\nimport { HistoryNavigator } from \"./HistoryNavigator\";\nimport { PathMatcher } from \"./PathMatcher\";\nimport { isRootPath, joinPath } from \"./path\";\nexport class BaseRouter {\n // the path to use when navigating to the root of the router\n index;\n matcher = new PathMatcher();\n constructor(routes, index) {\n this.index = index;\n for (const route of routes) {\n this.matcher.addPath(route.path, route);\n }\n }\n match(path) {\n const useIndex = isRootPath(path) && this.index;\n return this.matcher.match(useIndex ? this.index : path);\n }\n}\nexport class Router extends BaseRouter {\n prompt;\n observer;\n navigator = new HistoryNavigator();\n constructor(routes, updateState) {\n super(routes);\n this.navigator.addListener((event) => {\n if (event.isCancelable && this.prompt && !!this.prompt.when) {\n if (!window.confirm(this.prompt.message))\n return;\n }\n if (this.observer) {\n this.observer(event);\n }\n // only process afterChange events\n if (event.name === \"afterChange\") {\n const match = this.match(event.location.pathname);\n if (match && match.value) {\n updateState({\n ...match,\n state: event.state,\n });\n }\n else {\n updateState(null);\n }\n }\n });\n }\n getTopRouter() {\n return this;\n }\n /**\n * Subsequent navigations will preserve the given params in the query string.\n * Use null to clear the sticky params.\n * @param params\n */\n setStickyParams(params) {\n this.navigator.stickyParams = params != null ? params : undefined;\n }\n withObserver(observer) {\n this.observer = observer;\n return this;\n }\n start() {\n this.navigator.start();\n // initialize with the current location\n this.navigator.firePageLoad();\n }\n stop() {\n this.navigator.stop();\n }\n navigate(path, options) {\n this.navigator.navigate(path, options);\n }\n}\nexport class NestedRouter extends BaseRouter {\n parent;\n basePath;\n constructor(parent, basePath, routes) {\n super(routes);\n this.parent = parent;\n this.basePath = basePath;\n }\n getTopRouter() {\n if (this.parent instanceof Router) {\n return this.parent;\n }\n else {\n return this.parent.getTopRouter();\n }\n }\n navigate(path, options) {\n // base path is nested by default in a NestedRouter unless explicitly set to false by caller\n const isBasePathNested = options?.isBasePathNested ?? true;\n let basePath;\n if (isBasePathNested) {\n const childBasePath = options?.basePath;\n // e.g. \"/store\" + \"/objects/123\" => \"/store/objects/123\"\n basePath = childBasePath ? joinPath(this.basePath, childBasePath) : this.basePath;\n }\n else {\n // e.g. \"/store\" + \"/studio\" => \"/studio\"\n basePath = options?.basePath ?? this.basePath;\n }\n this.parent.navigate(path, {\n ...options,\n basePath,\n });\n }\n}\nconst ReactRouterContext = createContext(undefined);\nexport { ReactRouterContext };\nexport function useRouterContext() {\n const ctx = useContext(ReactRouterContext);\n if (!ctx) {\n throw new Error(\"useRouter must be used within a RouterProvider\");\n }\n return ctx;\n}\nexport function useNavigate() {\n const { navigate } = useRouterContext();\n return navigate;\n}\nexport function useParams(arg) {\n const { params } = useRouterContext();\n if (arg) {\n return params[arg];\n }\n else {\n return params;\n }\n}\nexport function useLocation() {\n const { location } = useRouterContext();\n return location;\n}\nexport function useNavigationPrompt(prompt) {\n const { router } = useRouterContext();\n useEffect(() => {\n router.getTopRouter().prompt = prompt;\n return () => {\n router.getTopRouter().prompt = undefined;\n };\n }, []);\n useEffect(() => {\n if (prompt.when) {\n const doBlock = prompt.when;\n const listener = function (ev) {\n if (doBlock) {\n ev.preventDefault();\n ev.returnValue = \"\";\n }\n };\n window.addEventListener(\"beforeunload\", listener);\n return () => {\n window.removeEventListener(\"beforeunload\", listener);\n };\n }\n }, [prompt.when]);\n}\n//# sourceMappingURL=Router.js.map","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { useNavigate, useRouterContext } from \"./Router\";\nexport function Nav({ children, onClick }) {\n const navigate = useNavigate();\n const _onClick = (ev) => {\n const link = ev.target.closest('a');\n if (link && link.href) {\n ev.stopPropagation();\n ev.preventDefault();\n navigate(link.href);\n onClick?.(ev);\n }\n };\n return (_jsx(\"span\", { onClick: _onClick, children: children }));\n}\nexport function NavLink({ children, href, className, topLevelNav }) {\n const { router } = useRouterContext();\n const _onClick = (ev) => {\n ev.stopPropagation();\n ev.preventDefault();\n const actualRouter = topLevelNav ? router.getTopRouter() : router;\n actualRouter.navigate(href);\n };\n return (_jsx(\"a\", { href: href, className: className, onClick: _onClick, children: children }));\n}\n//# sourceMappingURL=Nav.js.map","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { useEffect, useState } from \"react\";\nimport { useRouterContext } from \"./Router\";\nexport function RouteComponent({ spinner }) {\n const ctx = useRouterContext();\n const route = ctx.route;\n if (route.Component) {\n const Component = route.Component;\n return _jsx(Component, { ...ctx.params });\n }\n else if (route.LazyComponent) {\n return _jsx(LazyRouteComponent, { route: route, spinner: spinner });\n }\n else {\n throw new Error(`Invalid route for ${route.path}. Either Component or LazyCOmponent must be specified.`);\n }\n}\nfunction LazyRouteComponent({ route, spinner }) {\n const [Component, setComponent] = useState(null);\n useEffect(() => {\n route.LazyComponent().then(module => {\n if (!module.default) {\n throw new Error(`Lazy module for ${route.path} does not have a default export`);\n }\n // we need to wrap the component type in an arrow function\n // otherwise the setState function will execute the function as a state update function\n setComponent(() => module.default);\n });\n }, [route]);\n return Component ? (_jsx(Component, {})) : spinner || null;\n}\n//# sourceMappingURL=RouteComponent.js.map","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { FixLinks } from \"./FixLinks\";\nimport { RouteComponent } from \"./RouteComponent\";\nimport { ReactRouterContext, useRouterContext } from \"./Router\";\nimport { joinPath } from \"./path\";\nexport function NestedNavigationContext({ basePath, fixLinks = false, children }) {\n const ctx = useRouterContext();\n const wrapWithFixLinks = fixLinks ?\n (elem) => _jsx(FixLinks, { basePath: ctx.matchedRoutePath, children: elem })\n : (elem) => elem;\n return (_jsx(ReactRouterContext.Provider, { value: {\n ...ctx,\n navigate: (to, options) => {\n const actualBasePath = options?.basePath ? joinPath(basePath, options.basePath) : basePath;\n return ctx.navigate(to, { ...options, basePath: actualBasePath });\n }\n }, children: wrapWithFixLinks(children ? children : _jsx(RouteComponent, {})) }));\n}\n//# sourceMappingURL=NestedNavigationContext.js.map","import { jsxs as _jsxs, jsx as _jsx } from \"react/jsx-runtime\";\nimport { useRouterContext } from \"./Router\";\nexport function Route404Component() {\n const ctx = useRouterContext();\n return _jsxs(\"div\", { children: [\"Route not found for path \", ctx.matchedRoutePath] });\n}\nexport function createRoute404() {\n return {\n params: {},\n matchedSegments: [],\n state: null,\n value: {\n path: 'virtual:404',\n Component: () => _jsx(Route404Component, {})\n }\n };\n}\n//# sourceMappingURL=Route404.js.map","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { useEffect, useMemo, useState } from \"react\";\nimport { FixLinks } from \"./FixLinks\";\nimport { createRoute404 } from \"./Route404\";\nimport { RouteComponent } from \"./RouteComponent\";\nimport { NestedRouter, ReactRouterContext, useRouterContext } from \"./Router\";\nexport function NestedRouterProvider({ routes, index, children, fixLinks = false }) {\n const ctx = useRouterContext();\n const [nestedRouteMatch, setNestedRouteMatch] = useState(undefined);\n const nestedRouter = useMemo(() => {\n if (typeof window === 'undefined')\n return null;\n const basePath = ctx.matchedRoutePath;\n const nestedRouter = new NestedRouter(ctx.router, basePath, routes);\n nestedRouter.index = index;\n return nestedRouter;\n }, []);\n useEffect(() => {\n if (nestedRouter) {\n if (ctx.matchedRoutePath !== nestedRouter.basePath) {\n // the change doesn't belong to this nested router\n // it should be handled by the top level router which will change the page or the nested router\n return;\n }\n const route = nestedRouter.match(ctx.remainingPath || '/') || createRoute404();\n setNestedRouteMatch(route);\n }\n }, [nestedRouter, ctx.remainingPath]);\n const wrapWithFixLinks = fixLinks ?\n (elem) => _jsx(FixLinks, { basePath: ctx.matchedRoutePath, children: elem })\n : (elem) => elem;\n return nestedRouteMatch && (_jsx(ReactRouterContext.Provider, { value: {\n ...ctx,\n router: nestedRouter,\n route: nestedRouteMatch.value,\n params: nestedRouteMatch.params,\n matchedRoutePath: '/' + nestedRouteMatch.matchedSegments.join('/'),\n remainingPath: nestedRouteMatch.remainingSegments ? '/' + nestedRouteMatch.remainingSegments.join('/') : undefined,\n navigate: (to, options) => {\n return nestedRouter.navigate(to, options);\n }\n }, children: wrapWithFixLinks(children ? children : _jsx(RouteComponent, {})) }));\n}\n//# sourceMappingURL=NestedRouterProvider.js.map","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { useSafeLayoutEffect } from \"@vertesia/ui/core\";\n//import { useSafeLayoutEffect } from \"../core\";\nimport { useMemo, useState } from \"react\";\nimport { RouteComponent } from \"./RouteComponent\";\nimport { ReactRouterContext, Router } from \"./Router\";\nimport { createRoute404 } from \"./Route404\";\nexport function RouterProvider({ routes, index, onChange, children }) {\n const [state, setState] = useState(undefined);\n const router = useMemo(() => {\n if (typeof window === 'undefined')\n return null;\n const router = new Router(routes, (match) => {\n if (match === null) {\n match = createRoute404();\n }\n setState({\n location: window.location,\n route: match.value,\n params: match.params,\n state: match.state,\n router: router,\n matchedRoutePath: '/' + match.matchedSegments.join('/'),\n remainingPath: match.remainingSegments ? '/' + match.remainingSegments.join('/') : undefined,\n navigate: (to, options) => {\n return router.navigate(to, options);\n }\n });\n }).withObserver(onChange);\n router.index = index;\n return router;\n }, []);\n useSafeLayoutEffect(() => {\n router && router.start();\n return () => {\n router && router.stop();\n };\n }, []);\n return state && (_jsx(ReactRouterContext.Provider, { value: state, children: children ? children : _jsx(RouteComponent, {}) }));\n}\n//# sourceMappingURL=RouterProvider.js.map"],"names":["isRootPath","path","joinPath","path1","path2","endsWith","startsWith","substring","getPathSegments","s","e","length","split","toSegments","Array","isArray","Error","PathWithParams","params","hash","constructor","i","lastIndexOf","this","indexOf","URLSearchParams","add","key","value","Object","entries","set","toString","BASE_PATH","Symbol","LocationChangeEvent","name","type","location","state","_canceled","isPageLoad","isBackForward","isLinkClick","isNavigation","isCancelable","cancel","BeforeLocationChangeEvent","super","AfterLocationChangeEvent","HistoryNavigator","stickyParams","_popStateListener","_linkNavListener","_listeners","addListener","listener","push","fireLocationChange","event","firePageLoad","URL","window","href","addStickyParams","navigate","to","options","basePath","_navigate","beforeEvent","history","replace","from","data","undefined","start","ev","url","elem","tagName","toLowerCase","getElementHrefAsUrl","target","origin","preventDefault","pathname","addEventListener","document","body","stop","removeEventListener","FixLinks","children","ref","useRef","useEffect","current","divElem","_jsx","className","PathMatcher","tree","RootSegmentNode","loadMapping","mapping","addSegments","addPath","segments","node","l","segment","childNode","wildcard","VariableSegmentNode","join","slice","WildcardSegmentNode","LiteralSegmentNode","match","matchedSegments","remainingSegments","ParentSegmentNode","_","paramName","BaseRouter","index","matcher","routes","route","useIndex","Router","prompt","observer","navigator","updateState","when","confirm","message","getTopRouter","setStickyParams","withObserver","NestedRouter","parent","isBasePathNested","childBasePath","ReactRouterContext","createContext","useRouterContext","ctx","useContext","useNavigate","useParams","arg","useLocation","useNavigationPrompt","router","doBlock","returnValue","Nav","onClick","link","closest","stopPropagation","NavLink","topLevelNav","RouteComponent","spinner","Component","LazyComponent","LazyRouteComponent","setComponent","useState","then","module","default","NestedNavigationContext","fixLinks","wrapWithFixLinks","matchedRoutePath","Provider","actualBasePath","Route404Component","_jsxs","createRoute404","NestedRouterProvider","nestedRouteMatch","setNestedRouteMatch","nestedRouter","useMemo","remainingPath","RouterProvider","onChange","setState","useSafeLayoutEffect"],"mappings":"sNAAO,SAASA,EAAWC,GACvB,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SAAUA,GAAsBM,EAAKmE,EAAgB,CAAE,IAC9H"}
|
|
1
|
+
{"version":3,"file":"vertesia-ui-router.js","sources":["esm/router/path.js","esm/router/PathWithParams.js","esm/router/HistoryNavigator.js","esm/router/FixLinks.js","esm/router/PathMatcher.js","esm/router/Router.js","esm/router/Nav.js","esm/router/RouteComponent.js","esm/router/NestedNavigationContext.js","esm/router/Route404.js","esm/router/NestedRouterProvider.js","esm/router/RouterProvider.js"],"sourcesContent":["export function isRootPath(path) {\n return path === '/' || path === '';\n}\nexport function joinPath(path1, path2) {\n if (path1.endsWith('/') && path2.startsWith('/')) {\n path2 = path1 + path2.substring(1);\n }\n else if (path1.endsWith('/')) {\n path2 = path1 + path2;\n }\n else if (path2.startsWith('/')) {\n path2 = path1 + path2;\n }\n else {\n path2 = path1 + '/' + path2;\n }\n return path2;\n}\nexport function getPathSegments(path) {\n if (path === '' || path === '/') {\n return [];\n }\n let s = 0, e = path.length;\n if (path.startsWith('./')) {\n s = 2;\n }\n else if (path.startsWith('/')) {\n s = 1;\n }\n if (path.endsWith('/')) {\n e = path.length - 1;\n }\n return (s > 0 || e < path.length ? path.substring(s, e) : path).split('/');\n}\nexport function toSegments(path) {\n if (typeof path === 'string') {\n return getPathSegments(path);\n }\n else if (Array.isArray(path)) {\n return path;\n }\n else {\n throw new Error(`Unsupported path object: ${path}`);\n }\n}\n// export class Path {\n// static parse(path: string, abs = false) {\n// if (abs !== undefined) {\n// abs = path.startsWith('/');\n// }\n// return new Path(getPathSegments(path), abs);\n// }\n// constructor(public segments: string[], public isAbsolute = false) {\n// }\n// getParameters() {\n// const out = [];\n// for (const segment of this.segments) {\n// if (segment[0] === ':') {\n// out.push(segment.substring(1));\n// }\n// }\n// if (this.segments[this.segments.length - 1] === '*') {\n// out.push('_');\n// }\n// return out;\n// }\n// resolveParameters(path: string) {\n// const params: PathMatchParams = {};\n// const resolvedSegments = getPathSegments(path);\n// if (resolvedSegments.length < this.segments.length) {\n// return null;\n// }\n// const segments = this.segments;\n// for (let i = 0, l = segments.length; i < l; i++) {\n// const seg = segments[i];\n// if (seg[0] === ':') {\n// params[seg.substring(1)] = resolvedSegments[i];\n// }\n// }\n// if (resolvedSegments.length - this.segments.length) {\n// params._ = resolvedSegments.slice(this.segments.length);\n// }\n// return params;\n// }\n// match(path: string | string[] | Path) {\n// const segments = toSegments(path);\n// if (segments.length < this.segments.length) {\n// return false;\n// }\n// let params: PathMatchParams | undefined;\n// const mySegments = this.segments;\n// for (let i = 0, l = mySegments.length; i < l; i++) {\n// const segment = mySegments[i];\n// if (segment === ':') {\n// if (!params) params = {};\n// params[segment.substring(1)] = segment;\n// } else if (segment !== segments[i]) {\n// if (i === l - 1 && segment === '*') {\n// if (!params) params = {};\n// params._ = segments.slice(i);\n// return params;\n// }\n// return false;\n// }\n// }\n// return params ? params : false;\n// }\n// join(path: Path | string | string[]) {\n// const segments = toSegments(path);\n// return new Path(this.segments.concat(segments), this.isAbsolute);\n// }\n// getRelativePath(path: Path | string | string[], asAbsolute: boolean = false) {\n// const segments = toSegments(path);\n// const extraSegmentsCount = segments.length - this.segments.length;\n// if (extraSegmentsCount <= 0) {\n// return null;\n// }\n// return new Path(segments.slice(this.segments.length), asAbsolute);\n// }\n// prependSegments(segments: string[]) {\n// this.segments = segments.concat(this.segments);\n// }\n// appendSegments(segments: string[]) {\n// this.segments = this.segments.concat(segments);\n// }\n// toAbsolutePath() {\n// return '/' + this.segments.join('/');\n// }\n// toRelativePath() {\n// return this.segments.join('/');\n// }\n// toString() {\n// const path = this.segments.join('/');\n// return this.isAbsolute ? '/' + path : path;\n// }\n// }\n//# sourceMappingURL=path.js.map","export class PathWithParams {\n path;\n params;\n hash;\n constructor(path) {\n let i = path.lastIndexOf('#');\n if (i > -1) {\n this.hash = path.substring(i);\n path = path.substring(0, i);\n }\n else {\n this.hash = '';\n }\n i = path.indexOf('?');\n if (i > -1) {\n this.path = path.substring(0, i);\n this.params = new URLSearchParams(path.substring(i + 1));\n }\n else {\n this.path = path;\n this.params = new URLSearchParams();\n }\n }\n add(params) {\n for (const [key, value] of Object.entries(params)) {\n this.params.set(key, value);\n }\n return this;\n }\n toString() {\n return this.path + '?' + this.params.toString() + this.hash;\n }\n}\n//# sourceMappingURL=PathWithParams.js.map","import { joinPath } from \"./path\";\nimport { PathWithParams } from \"./PathWithParams\";\nconst BASE_PATH = Symbol('BASE_PATH');\nexport { BASE_PATH };\nexport class LocationChangeEvent {\n name;\n type;\n location;\n state;\n _canceled = false;\n constructor(name, type, location, state) {\n this.name = name;\n this.type = type;\n this.location = location;\n this.state = state;\n }\n get isPageLoad() {\n return this.type === 'initial';\n }\n get isBackForward() {\n return this.type === 'popState';\n }\n get isLinkClick() {\n return this.type === 'linkClick';\n }\n get isNavigation() {\n return this.type === 'navigate';\n }\n get isCancelable() {\n return this.name === 'beforeChange';\n }\n cancel() {\n if (this.name === 'afterChange') {\n throw new Error('Cannot cancel afterChange event');\n }\n this._canceled = true;\n }\n}\nexport class BeforeLocationChangeEvent extends LocationChangeEvent {\n constructor(type, location, state) {\n super('beforeChange', type, location, state);\n }\n}\nexport class AfterLocationChangeEvent extends LocationChangeEvent {\n constructor(type, location, state) {\n super('afterChange', type, location, state);\n }\n}\nfunction getElementHrefAsUrl(elem) {\n if (elem && elem.tagName.toLowerCase() === 'a') {\n const href = elem?.href.trim();\n if (typeof href === 'string' && href.length > 0) {\n return new URL(href);\n }\n }\n return null;\n}\nexport class HistoryNavigator {\n // params to preserve in the query string when navigating\n stickyParams;\n _popStateListener;\n _linkNavListener;\n _listeners = [];\n constructor() {\n }\n addListener(listener) {\n this._listeners.push(listener);\n }\n fireLocationChange(event) {\n for (const listener of this._listeners) {\n listener(event);\n }\n }\n /**\n * Should be called when the page is first loaded.\n * It will fire a location change event with type `initial` and the current window.location as the location\n */\n firePageLoad() {\n this.fireLocationChange(new AfterLocationChangeEvent('initial', new URL(window.location.href)));\n }\n addStickyParams(path) {\n if (this.stickyParams) {\n return new PathWithParams(path).add(this.stickyParams).toString();\n }\n return path;\n }\n navigate(to, options = {}) {\n if (options.basePath) {\n let basePath = options.basePath;\n if (!basePath.startsWith('/')) {\n basePath = '/' + basePath;\n }\n to = joinPath(basePath, to);\n }\n to = this.addStickyParams(to);\n this._navigate(new URL(to, window.location.href), 'navigate', options);\n }\n _navigate(to, type, options) {\n const beforeEvent = new BeforeLocationChangeEvent(type, to, options.state);\n this.fireLocationChange(beforeEvent);\n if (beforeEvent._canceled) {\n return;\n }\n window.history[options.replace ? 'replaceState' : 'pushState']({\n from: window.location.href,\n data: options.state || undefined\n }, '', to.href);\n this.fireLocationChange(new AfterLocationChangeEvent(type, to, options.state));\n }\n start() {\n if (typeof window === \"undefined\") {\n return;\n }\n const _popStateListener = (ev) => {\n let type = ev.state ? 'popState' : 'linkClick';\n const to = new URL(window.location.href);\n let state = undefined;\n if (ev.state) {\n type = 'popState';\n state = ev.state.data;\n }\n else {\n type = 'linkClick';\n }\n this.fireLocationChange(new AfterLocationChangeEvent(type, to, state));\n };\n const _linkNavListener = (ev) => {\n const url = getElementHrefAsUrl(ev.target);\n if (url && url.origin === window.location.origin) {\n ev.preventDefault();\n const to = new URL(this.addStickyParams(url.href));\n const basePath = ev[BASE_PATH] || ev.target[BASE_PATH];\n if (basePath) {\n to.pathname = joinPath(basePath, to.pathname);\n }\n this._navigate(to, 'linkClick', {});\n }\n };\n this._popStateListener = _popStateListener;\n this._linkNavListener = _linkNavListener;\n window.addEventListener('popstate', _popStateListener);\n document.body.addEventListener('click', this._linkNavListener);\n }\n stop() {\n this._popStateListener && window.removeEventListener('popstate', this._popStateListener);\n this._linkNavListener && document.body.removeEventListener('click', this._linkNavListener);\n }\n}\n//# sourceMappingURL=HistoryNavigator.js.map","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { useEffect, useRef } from \"react\";\nimport { BASE_PATH } from \"./HistoryNavigator\";\nexport function FixLinks({ basePath, children }) {\n const ref = useRef(null);\n useEffect(() => {\n if (ref.current) {\n const divElem = ref.current;\n const listener = (ev) => {\n const elem = ev.target;\n if (elem.tagName.toLowerCase() === 'a') {\n ev[BASE_PATH] = basePath;\n }\n };\n divElem.addEventListener('click', listener);\n return () => {\n divElem.removeEventListener('click', listener);\n };\n }\n }, [ref.current]);\n return (_jsx(\"div\", { ref: ref, className: \"h-full w-full\", children: children }));\n}\n//# sourceMappingURL=FixLinks.js.map","import { getPathSegments, toSegments } from \"./path\";\n/**\n * Path matcher which support :param and *wildcard segments.\n * The wildcard segment is only supported as the last segment\n */\nexport class PathMatcher {\n tree = new RootSegmentNode();\n loadMapping(mapping) {\n for (const [key, value] of Object.entries(mapping)) {\n this.addSegments(getPathSegments(key), value);\n }\n }\n addPath(path, value) {\n this.addSegments(getPathSegments(path), value);\n }\n addSegments(segments, value) {\n let node = this.tree;\n for (let i = 0, l = segments.length; i < l; i++) {\n const segment = segments[i];\n if (segment[0] === ':') {\n let childNode = node.wildcard;\n if (!childNode) {\n childNode = new VariableSegmentNode(segment);\n node.wildcard = childNode;\n }\n else if (!(childNode instanceof VariableSegmentNode)) {\n throw new Error(`Failed to index path segments: ${segments.join('/')}. A wildcard \":\" segment will overwrite an existing wildcard segment at path: ${'/' + segments.slice(0, i).join(\"/\")}`);\n }\n node = childNode;\n }\n else if (segment === '*') {\n if (node.wildcard) {\n throw new Error(`Failed to index path segments: ${segments.join('/')}. A wildcard \"*\" segment already exists at path: ${'/' + segments.slice(0, i).join(\"/\")}`);\n }\n node.wildcard = new WildcardSegmentNode(segment, value);\n if (i < l - 1) {\n throw new Error(`Failed to index path segments: ${segments.join('/')}. A wildcard segment must be the last segment`);\n }\n return;\n }\n else {\n let childNode = node.children[segment];\n if (!childNode) {\n childNode = new LiteralSegmentNode(segment);\n node.children[segment] = childNode;\n } // else // a literal segment already exists\n node = childNode;\n }\n }\n if (node.value !== undefined) {\n throw new Error(`Failed to index path segments: ${segments.join('/')}. A value already exists at path: ${'/' + segments.join(\"/\")}`);\n }\n node.value = value;\n }\n match(path) {\n const segments = toSegments(path);\n if (segments.length === 0) {\n return null;\n }\n const params = {};\n let node = this.tree;\n for (const segment of segments) {\n const match = node.match(segment, params);\n if (match) {\n node = match;\n }\n else {\n return null;\n }\n }\n if (!node.value) { // not a leaf node (partial match)\n if (node instanceof ParentSegmentNode) {\n if (node.wildcard instanceof WildcardSegmentNode) {\n node = node.wildcard.match('', params);\n if (!node.value) {\n throw new Error(\"Wildcard segment node `*` must have a value\");\n }\n }\n }\n if (!node.value)\n return null; // not a leaf node, neither a trailing wildcard (partial match)\n }\n let matchedSegments, remainingSegments;\n if (params._ && params._.length > 0) {\n matchedSegments = segments.slice(0, -params._.length);\n remainingSegments = params._;\n }\n else {\n matchedSegments = segments;\n }\n return { params, matchedSegments, remainingSegments, value: node.value };\n }\n}\nclass ParentSegmentNode {\n name;\n value;\n children = {};\n wildcard;\n constructor(name, value) {\n this.name = name;\n this.value = value;\n }\n match(segment, params) {\n let node = this.children[segment];\n if (node) {\n return node;\n }\n else if (this.wildcard) {\n if (this.wildcard instanceof WildcardSegmentNode) {\n return this.wildcard.match(segment, params);\n }\n else if (this.wildcard instanceof VariableSegmentNode) {\n params[this.wildcard.paramName] = segment;\n return this.wildcard;\n }\n else {\n throw new Error(\"Unknown wildcard segment node type: \" + this.wildcard.constructor.name);\n }\n }\n else {\n return null;\n }\n }\n}\nclass RootSegmentNode extends ParentSegmentNode {\n constructor() {\n super(\"#root\");\n }\n}\nclass LiteralSegmentNode extends ParentSegmentNode {\n constructor(name, value) {\n super(name, value);\n }\n}\nclass VariableSegmentNode extends ParentSegmentNode {\n paramName;\n constructor(name, value) {\n super(name, value);\n this.paramName = name.substring(1);\n }\n}\nclass WildcardSegmentNode {\n name;\n value;\n constructor(name, value) {\n this.name = name;\n this.value = value;\n }\n match(segment, params) {\n if (!params._) {\n params._ = segment ? [segment] : [];\n }\n else {\n segment && params._.push(segment);\n }\n return this;\n }\n}\n//# sourceMappingURL=PathMatcher.js.map","import { createContext, useContext, useEffect } from \"react\";\nimport { HistoryNavigator } from \"./HistoryNavigator\";\nimport { PathMatcher } from \"./PathMatcher\";\nimport { isRootPath, joinPath } from \"./path\";\nexport class BaseRouter {\n // the path to use when navigating to the root of the router\n index;\n matcher = new PathMatcher();\n constructor(routes, index) {\n this.index = index;\n for (const route of routes) {\n this.matcher.addPath(route.path, route);\n }\n }\n match(path) {\n const useIndex = isRootPath(path) && this.index;\n return this.matcher.match(useIndex ? this.index : path);\n }\n}\nexport class Router extends BaseRouter {\n prompt;\n observer;\n navigator = new HistoryNavigator();\n constructor(routes, updateState) {\n super(routes);\n this.navigator.addListener((event) => {\n if (event.isCancelable && this.prompt && !!this.prompt.when) {\n if (!window.confirm(this.prompt.message))\n return;\n }\n if (this.observer) {\n this.observer(event);\n }\n // only process afterChange events\n if (event.name === \"afterChange\") {\n const match = this.match(event.location.pathname);\n if (match && match.value) {\n updateState({\n ...match,\n state: event.state,\n });\n }\n else {\n updateState(null);\n }\n }\n });\n }\n getTopRouter() {\n return this;\n }\n /**\n * Subsequent navigations will preserve the given params in the query string.\n * Use null to clear the sticky params.\n * @param params\n */\n setStickyParams(params) {\n this.navigator.stickyParams = params != null ? params : undefined;\n }\n withObserver(observer) {\n this.observer = observer;\n return this;\n }\n start() {\n this.navigator.start();\n // initialize with the current location\n this.navigator.firePageLoad();\n }\n stop() {\n this.navigator.stop();\n }\n navigate(path, options) {\n this.navigator.navigate(path, options);\n }\n}\nexport class NestedRouter extends BaseRouter {\n parent;\n basePath;\n constructor(parent, basePath, routes) {\n super(routes);\n this.parent = parent;\n this.basePath = basePath;\n }\n getTopRouter() {\n if (this.parent instanceof Router) {\n return this.parent;\n }\n else {\n return this.parent.getTopRouter();\n }\n }\n navigate(path, options) {\n // base path is nested by default in a NestedRouter unless explicitly set to false by caller\n const isBasePathNested = options?.isBasePathNested ?? true;\n let basePath;\n if (isBasePathNested) {\n const childBasePath = options?.basePath;\n // e.g. \"/store\" + \"/objects/123\" => \"/store/objects/123\"\n basePath = childBasePath ? joinPath(this.basePath, childBasePath) : this.basePath;\n }\n else {\n // e.g. \"/store\" + \"/studio\" => \"/studio\"\n basePath = options?.basePath ?? this.basePath;\n }\n this.parent.navigate(path, {\n ...options,\n basePath,\n });\n }\n}\nconst ReactRouterContext = createContext(undefined);\nexport { ReactRouterContext };\nexport function useRouterContext() {\n const ctx = useContext(ReactRouterContext);\n if (!ctx) {\n throw new Error(\"useRouter must be used within a RouterProvider\");\n }\n return ctx;\n}\nexport function useNavigate() {\n const { navigate } = useRouterContext();\n return navigate;\n}\nexport function useParams(arg) {\n const { params } = useRouterContext();\n if (arg) {\n return params[arg];\n }\n else {\n return params;\n }\n}\nexport function useLocation() {\n const { location } = useRouterContext();\n return location;\n}\nexport function useNavigationPrompt(prompt) {\n const { router } = useRouterContext();\n useEffect(() => {\n router.getTopRouter().prompt = prompt;\n return () => {\n router.getTopRouter().prompt = undefined;\n };\n }, []);\n useEffect(() => {\n if (prompt.when) {\n const doBlock = prompt.when;\n const listener = function (ev) {\n if (doBlock) {\n ev.preventDefault();\n ev.returnValue = \"\";\n }\n };\n window.addEventListener(\"beforeunload\", listener);\n return () => {\n window.removeEventListener(\"beforeunload\", listener);\n };\n }\n }, [prompt.when]);\n}\n//# sourceMappingURL=Router.js.map","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { useNavigate, useRouterContext } from \"./Router\";\nexport function Nav({ children, onClick }) {\n const navigate = useNavigate();\n const _onClick = (ev) => {\n const link = ev.target.closest('a');\n if (link && link.href) {\n ev.stopPropagation();\n ev.preventDefault();\n navigate(link.href);\n onClick?.(ev);\n }\n };\n return (_jsx(\"span\", { onClick: _onClick, children: children }));\n}\nexport function NavLink({ children, href, className, topLevelNav }) {\n const { router } = useRouterContext();\n const _onClick = (ev) => {\n ev.stopPropagation();\n ev.preventDefault();\n const actualRouter = topLevelNav ? router.getTopRouter() : router;\n actualRouter.navigate(href);\n };\n return (_jsx(\"a\", { href: href, className: className, onClick: _onClick, children: children }));\n}\n//# sourceMappingURL=Nav.js.map","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { useEffect, useState } from \"react\";\nimport { useRouterContext } from \"./Router\";\nexport function RouteComponent({ spinner }) {\n const ctx = useRouterContext();\n const route = ctx.route;\n if (route.Component) {\n const Component = route.Component;\n return _jsx(Component, { ...ctx.params });\n }\n else if (route.LazyComponent) {\n return _jsx(LazyRouteComponent, { route: route, spinner: spinner });\n }\n else {\n throw new Error(`Invalid route for ${route.path}. Either Component or LazyCOmponent must be specified.`);\n }\n}\nfunction LazyRouteComponent({ route, spinner }) {\n const [Component, setComponent] = useState(null);\n useEffect(() => {\n route.LazyComponent().then(module => {\n if (!module.default) {\n throw new Error(`Lazy module for ${route.path} does not have a default export`);\n }\n // we need to wrap the component type in an arrow function\n // otherwise the setState function will execute the function as a state update function\n setComponent(() => module.default);\n });\n }, [route]);\n return Component ? (_jsx(Component, {})) : spinner || null;\n}\n//# sourceMappingURL=RouteComponent.js.map","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { FixLinks } from \"./FixLinks\";\nimport { RouteComponent } from \"./RouteComponent\";\nimport { ReactRouterContext, useRouterContext } from \"./Router\";\nimport { joinPath } from \"./path\";\nexport function NestedNavigationContext({ basePath, fixLinks = false, children }) {\n const ctx = useRouterContext();\n const wrapWithFixLinks = fixLinks ?\n (elem) => _jsx(FixLinks, { basePath: ctx.matchedRoutePath, children: elem })\n : (elem) => elem;\n return (_jsx(ReactRouterContext.Provider, { value: {\n ...ctx,\n navigate: (to, options) => {\n const actualBasePath = options?.basePath ? joinPath(basePath, options.basePath) : basePath;\n return ctx.navigate(to, { ...options, basePath: actualBasePath });\n }\n }, children: wrapWithFixLinks(children ? children : _jsx(RouteComponent, {})) }));\n}\n//# sourceMappingURL=NestedNavigationContext.js.map","import { jsxs as _jsxs, jsx as _jsx } from \"react/jsx-runtime\";\nimport { useRouterContext } from \"./Router\";\nexport function Route404Component() {\n const ctx = useRouterContext();\n return _jsxs(\"div\", { children: [\"Route not found for path \", ctx.matchedRoutePath] });\n}\nexport function createRoute404() {\n return {\n params: {},\n matchedSegments: [],\n state: null,\n value: {\n path: 'virtual:404',\n Component: () => _jsx(Route404Component, {})\n }\n };\n}\n//# sourceMappingURL=Route404.js.map","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { useEffect, useMemo, useState } from \"react\";\nimport { FixLinks } from \"./FixLinks\";\nimport { createRoute404 } from \"./Route404\";\nimport { RouteComponent } from \"./RouteComponent\";\nimport { NestedRouter, ReactRouterContext, useRouterContext } from \"./Router\";\nexport function NestedRouterProvider({ routes, index, children, fixLinks = false }) {\n const ctx = useRouterContext();\n const [nestedRouteMatch, setNestedRouteMatch] = useState(undefined);\n const nestedRouter = useMemo(() => {\n if (typeof window === 'undefined')\n return null;\n const basePath = ctx.matchedRoutePath;\n const nestedRouter = new NestedRouter(ctx.router, basePath, routes);\n nestedRouter.index = index;\n return nestedRouter;\n }, []);\n useEffect(() => {\n if (nestedRouter) {\n if (ctx.matchedRoutePath !== nestedRouter.basePath) {\n // the change doesn't belong to this nested router\n // it should be handled by the top level router which will change the page or the nested router\n return;\n }\n const route = nestedRouter.match(ctx.remainingPath || '/') || createRoute404();\n setNestedRouteMatch(route);\n }\n }, [nestedRouter, ctx.remainingPath]);\n const wrapWithFixLinks = fixLinks ?\n (elem) => _jsx(FixLinks, { basePath: ctx.matchedRoutePath, children: elem })\n : (elem) => elem;\n return nestedRouteMatch && (_jsx(ReactRouterContext.Provider, { value: {\n ...ctx,\n router: nestedRouter,\n route: nestedRouteMatch.value,\n params: nestedRouteMatch.params,\n matchedRoutePath: '/' + nestedRouteMatch.matchedSegments.join('/'),\n remainingPath: nestedRouteMatch.remainingSegments ? '/' + nestedRouteMatch.remainingSegments.join('/') : undefined,\n navigate: (to, options) => {\n return nestedRouter.navigate(to, options);\n }\n }, children: wrapWithFixLinks(children ? children : _jsx(RouteComponent, {})) }));\n}\n//# sourceMappingURL=NestedRouterProvider.js.map","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { useSafeLayoutEffect } from \"@vertesia/ui/core\";\n//import { useSafeLayoutEffect } from \"../core\";\nimport { useMemo, useState } from \"react\";\nimport { RouteComponent } from \"./RouteComponent\";\nimport { ReactRouterContext, Router } from \"./Router\";\nimport { createRoute404 } from \"./Route404\";\nexport function RouterProvider({ routes, index, onChange, children }) {\n const [state, setState] = useState(undefined);\n const router = useMemo(() => {\n if (typeof window === 'undefined')\n return null;\n const router = new Router(routes, (match) => {\n if (match === null) {\n match = createRoute404();\n }\n setState({\n location: window.location,\n route: match.value,\n params: match.params,\n state: match.state,\n router: router,\n matchedRoutePath: '/' + match.matchedSegments.join('/'),\n remainingPath: match.remainingSegments ? '/' + match.remainingSegments.join('/') : undefined,\n navigate: (to, options) => {\n return router.navigate(to, options);\n }\n });\n }).withObserver(onChange);\n router.index = index;\n return router;\n }, []);\n useSafeLayoutEffect(() => {\n router && router.start();\n return () => {\n router && router.stop();\n };\n }, []);\n return state && (_jsx(ReactRouterContext.Provider, { value: state, children: children ? children : _jsx(RouteComponent, {}) }));\n}\n//# sourceMappingURL=RouterProvider.js.map"],"names":["isRootPath","path","joinPath","path1","path2","endsWith","startsWith","substring","getPathSegments","s","e","length","split","toSegments","Array","isArray","Error","PathWithParams","params","hash","constructor","i","lastIndexOf","this","indexOf","URLSearchParams","add","key","value","Object","entries","set","toString","BASE_PATH","Symbol","LocationChangeEvent","name","type","location","state","_canceled","isPageLoad","isBackForward","isLinkClick","isNavigation","isCancelable","cancel","BeforeLocationChangeEvent","super","AfterLocationChangeEvent","HistoryNavigator","stickyParams","_popStateListener","_linkNavListener","_listeners","addListener","listener","push","fireLocationChange","event","firePageLoad","URL","window","href","addStickyParams","navigate","to","options","basePath","_navigate","beforeEvent","history","replace","from","data","undefined","start","ev","url","elem","tagName","toLowerCase","trim","getElementHrefAsUrl","target","origin","preventDefault","pathname","addEventListener","document","body","stop","removeEventListener","FixLinks","children","ref","useRef","useEffect","current","divElem","_jsx","className","PathMatcher","tree","RootSegmentNode","loadMapping","mapping","addSegments","addPath","segments","node","l","segment","childNode","wildcard","VariableSegmentNode","join","slice","WildcardSegmentNode","LiteralSegmentNode","match","matchedSegments","remainingSegments","ParentSegmentNode","_","paramName","BaseRouter","index","matcher","routes","route","useIndex","Router","prompt","observer","navigator","updateState","when","confirm","message","getTopRouter","setStickyParams","withObserver","NestedRouter","parent","isBasePathNested","childBasePath","ReactRouterContext","createContext","useRouterContext","ctx","useContext","useNavigate","useParams","arg","useLocation","useNavigationPrompt","router","doBlock","returnValue","Nav","onClick","link","closest","stopPropagation","NavLink","topLevelNav","RouteComponent","spinner","Component","LazyComponent","LazyRouteComponent","setComponent","useState","then","module","default","NestedNavigationContext","fixLinks","wrapWithFixLinks","matchedRoutePath","Provider","actualBasePath","Route404Component","_jsxs","createRoute404","NestedRouterProvider","nestedRouteMatch","setNestedRouteMatch","nestedRouter","useMemo","remainingPath","RouterProvider","onChange","setState","useSafeLayoutEffect"],"mappings":"sNAAO,SAASA,EAAWC,GACvB,MAAgB,MAATA,GAAyB,KAATA,CAC3B,CACO,SAASC,EAASC,EAAOC,GAa5B,OAXIA,EADAD,EAAME,SAAS,MAAQD,EAAME,WAAW,KAChCH,EAAQC,EAAMG,UAAU,GAE3BJ,EAAME,SAAS,MAGfD,EAAME,WAAW,KAFdH,EAAQC,EAMRD,EAAQ,IAAMC,CAG9B,CACO,SAASI,EAAgBP,GAC5B,GAAa,KAATA,GAAwB,MAATA,EACf,MAAO,GAEX,IAAIQ,EAAI,EAAGC,EAAIT,EAAKU,OAUpB,OATIV,EAAKK,WAAW,MAChBG,EAAI,EAECR,EAAKK,WAAW,OACrBG,EAAI,GAEJR,EAAKI,SAAS,OACdK,EAAIT,EAAKU,OAAS,IAEdF,EAAI,GAAKC,EAAIT,EAAKU,OAASV,EAAKM,UAAUE,EAAGC,GAAKT,GAAMW,MAAM,IAC1E,CACO,SAASC,EAAWZ,GACvB,GAAoB,iBAATA,EACP,OAAOO,EAAgBP,GAEtB,GAAIa,MAAMC,QAAQd,GACnB,OA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,EAAO2J,GAAYrB,OAASlG,GAC7BkF,EAASiC,GAAQ,KACnB,GAAsB,oBAAXhI,OACP,OAAO,KACX,MAAM+F,EAAS,IAAIzB,EAAOH,GAAST,IACjB,OAAVA,IACAA,EAAQiE,KAEZS,EAAS,CACL5J,SAAUwB,OAAOxB,SACjB4F,MAAOV,EAAM5F,MACbV,OAAQsG,EAAMtG,OACdqB,MAAOiF,EAAMjF,MACbsH,OAAQA,EACRuB,iBAAkB,IAAM5D,EAAMC,gBAAgBL,KAAK,KACnD2E,cAAevE,EAAME,kBAAoB,IAAMF,EAAME,kBAAkBN,KAAK,UAAOzC,EACnFV,SAAU,CAACC,EAAIC,IACJ0F,EAAO5F,SAASC,EAAIC,QAGpC2E,aAAamD,GAEhB,OADApC,EAAO9B,MAAQA,EACR8B,IACR,IAOH,OANAsC,GAAoB,KAChBtC,GAAUA,EAAOjF,QACV,KACHiF,GAAUA,EAAOlE,UAEtB,IACIpD,GAAU6D,EAAK+C,EAAmBkC,SAAU,CAAEzJ,MAAOW,EAAOuD,SAAUA,GAAsBM,EAAKmE,EAAgB,CAAE,IAC9H"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsxs as e,jsx as t,Fragment as i}from"react/jsx-runtime";import{Button as n,Modal as o,ModalTitle as a,ModalBody as l,useToast as r,Input as s,Spinner as c,SelectStack as d,VSelectBox as m,useSafeLayoutEffect as u,ErrorBox as h,Center as p,useFetch as f,SelectBox as g,ModalFooter as v,VTabs as x,VTabsBar as y,VTabsPanel as b,VTooltip as N,Avatar as w,ModeToggle as k,MenuList as C,ToastProvider as S,ThemeProvider as j}from"@vertesia/ui/core";import{useState as P,useEffect as z,Fragment as L}from"react";import{useUserSession as T,useUXTracking as I,setFirebaseTenant as _,getFirebaseAuth as A,UserNotFoundError as U,fetchComposableTokenFromFirebaseToken as O,UserSessionProvider as E}from"@vertesia/ui/session";import{Env as q}from"@vertesia/ui/env";import W from"clsx";import{signInWithRedirect as D,OAuthProvider as M,GoogleAuthProvider as R,GithubAuthProvider as F,getAuth as G}from"firebase/auth";import{useLocation as Y}from"@vertesia/ui/router";import{Popover as J}from"@vertesia/ui/widgets";import{getTenantIdFromProject as B}from"@vertesia/common";import{Check as V,CopyIcon as H}from"lucide-react";import{UserPermissionProvider as K}from"@vertesia/ui/features";import{Transition as $}from"@headlessui/react";function Q(){const i=T(),{client:r,account:s}=i,[c,d]=P(!1),[m,u]=P([]);z((()=>{r.account.listInvites().then((e=>{e.length>0&&(console.log("Got invites - showing modal"),u(e),d(!0))}))}),[s?.id]);const h=()=>d(!1),p=m.map((o=>e("div",{className:"flex flex-row w-full justify-between border rounded-sm px-2 py-2 ",children:[e("div",{className:"flex flex-col",children:[t("div",{className:"w-full font-semibold",children:o.data.account.name}),e("div",{className:"text-xs",children:["Role: ",o.data.role]}),e("div",{className:"text-xs",children:["by ",o.data.invitedBy.name]})]}),e("div",{className:"flex flex-col gap-4",children:[t(n,{size:"xs",onClick:()=>(async e=>{await r.account.acceptInvite(e.id),await i.fetchAccounts();const t=m.filter((t=>t.id!==e.id));u(t),0===t.length&&h()})(o),children:"Accept"})," ",t(n,{size:"xs",variant:"secondary",onClick:()=>(async e=>{await r.account.rejectInvite(e.id);const t=m.filter((t=>t.id!==e.id));u(t),0===t.length&&h()})(o),children:"Reject"})]})]},o.id)));return t("div",{children:e(o,{isOpen:c,onClose:h,children:[t(a,{children:"Review Invites"}),e(l,{children:[t("div",{className:"text-sm pb-4",children:"You have received the following invites to join other accounts. Please review and accept or declined them."}),p]})]})})}function X({redirectTo:o}){const[a,l]=P(!1),{trackEvent:d}=I(),[m,u]=P(""),h=r();return e(i,{children:[t(s,{value:m,onChange:u,placeholder:"Enter your enterprise email",type:"email"}),a?t("div",{className:"w-full flex justify-center",children:t(c,{})}):t(n,{variant:"outline",onClick:async()=>{if(!m)return;/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(m)?(l(!0),_(m).then((e=>{if(!e)return h({title:"Tenant not found",status:"error",duration:5e3}),void l(!1);localStorage.setItem("tenantName",e.name??"");const t=function(e){switch(q.firebase.providerType){case"oidc":default:return new M("oidc.main");case"google":{let t=e||window.location.pathname||"/";"/"!==t[0]&&(t="/"+t);const i=new R;return i.addScope("profile"),i.addScope("email"),i.setCustomParameters({prompt:"select_account",redirect_uri:window.location.origin+t}),i}case"microsoft":return new M("microsoft.com");case"github":return new M("github.com")}}(o);d("enterprise_signin",{firebaseTenantName:e.name}),q.logger.info("Enterprise single sign-in",{vertesia:{email:m,firebaseTenantName:e.name,firebaseTenantId:e.firebaseTenantId}}),D(A(),t),l(!1)}))):h({title:"Invalid email address",status:"error",duration:5e3})},className:"w-full mt-2 py-4 flex rounded-lg hover:shadow-sm transition duration-150 text-center",children:t("span",{className:"text-sm font-semibold",children:"Continue with Enterprise SSO"})})]})}function Z({}){return e(n,{variant:"outline",onClick:()=>{localStorage.removeItem("tenantName");let e="https://dengenlabs.firebaseapp.com/__/auth/handler"+window.location.pathname;"/"!==e[0]&&(e="/"+e);const t=new F;t.addScope("profile"),t.addScope("email"),D(A(),t)},className:"w-full py-5 flex rounded-lg hover:shadow-sm transition duration-150 text-center mb-2",children:[t("img",{className:"size-6 bg-white rounded-full",src:"https://www.svgrepo.com/show/503359/github.svg",loading:"lazy",alt:"github logo"}),t("span",{className:"text-sm font-semibold",children:"Continue with GitHub"})]})}function ee({redirectTo:i}){return e(n,{variant:"outline",onClick:()=>{localStorage.removeItem("tenantName");let e=i||window.location.pathname||"/";"/"!==e[0]&&(e="/"+e);const t=new R;t.addScope("profile"),t.addScope("email"),t.setCustomParameters({prompt:"select_account",redirect_uri:window.location.origin+e}),D(A(),t)},className:"w-full py-5 flex rounded-lg hover:shadow-sm transition duration-150 text-center mb-2",children:[t("img",{className:"size-6",src:"https://www.svgrepo.com/show/475656/google-color.svg",loading:"lazy",alt:"google logo"}),t("span",{className:"text-sm font-semibold",children:"Continue with Google"})]})}function te({redirectTo:i}){return e(n,{variant:"outline",onClick:()=>{localStorage.removeItem("tenantName");let e=i||window.location.pathname||"/";"/"!==e[0]&&(e="/"+e);const t=new M("microsoft.com");t.addScope("profile"),t.addScope("email"),D(A(),t)},className:"w-full py-5 flex rounded-lg hover:shadow-sm transition duration-150 text-center",children:[t("img",{className:"size-6",src:"https://learn.microsoft.com/en-us/entra/identity-platform/media/howto-add-branding-in-apps/ms-symbollockup_mssymbol_19.svg",loading:"lazy",alt:"microsoft logo"}),t("span",{className:"text-sm font-semibold",children:"Continue with Microsoft"})]})}const ie=[{id:1,label:"1-10 employees"},{id:11,label:"11-100 employees"},{id:101,label:"101-1000 employees"},{id:1001,label:"1001-5000 employees"},{id:5001,label:"5000+ employees"}],ne=[{id:"personal",label:"Personal",description:"For personal use, or for a small team."},{id:"company",label:"Company",description:"For a company or organization."}],oe=[{id:"testing",label:"Just Testing or Evaluating LLMs"},{id:"exploring",label:"Actively Exploring LLMs on a Project"},{id:"using",label:"Already Using LLMs in Production"},{id:"migrating",label:"Migrating to different LLMs"},{id:"other",label:"Other"}];function ae({onSignup:o,goBack:a}){const[l,r]=P(void 0),[c,u]=P(void 0),[h,p]=P(void 0),[f,g]=P(void 0),[v,x]=P(void 0),[y,b]=P(void 0),[N,w]=P(void 0),k="company"===l;z((()=>{const e=G().currentUser;e?b(e):console.error("No user found")}),[y]);return e("div",{className:"flex flex-col space-y-2",children:[e("div",{className:"prose",children:[e("p",{className:"prose text-sm text-muted pt-4",children:["Welcome to Vertesia, ",y?.displayName," (",y?.email,"). Please tell us a little bit about yourself and you'll be on your way. No credit card is required."]}),N&&t("div",{className:"text-destructive",children:N})]}),t(le,{label:"Account Type",children:t(d,{options:ne,selected:ne.find((e=>e.id===l)),onSelect:e=>r(e.id)})}),k&&e(i,{children:[t(le,{label:"Company Size",children:t(m,{className:"w-full border border-accent bg-muted",value:c,options:ie,onChange:u,optionLabel:e=>e?.label,placeholder:"Select Company Size"})}),t(le,{label:"Company Name",children:t(s,{value:h,onChange:p,type:"text",required:!0})}),t(le,{label:"Company Website",children:t(s,{value:f,onChange:g,type:"text"})})]}),t(le,{label:"Project Maturity",children:t(m,{className:"w-full border border-accent bg-muted",options:oe,value:oe.find((e=>e.id===v)),optionLabel:e=>e?.label,placeholder:"Select Project Maturity",onChange:e=>x(e?.id)})}),e("div",{className:"pt-8 flex flex-col",children:[t(n,{variant:"primary",onClick:async()=>{if(!(l?k&&!h?(w("Please enter an organization name"),0):!k||c||(w("Please select a company size"),0):(w("Please select an account type"),0)))return;if(!l)return;const e={accountType:l,companyName:h,companySize:c?.id,companyWebsite:f,maturity:v};window.localStorage.setItem("composableSignupData",JSON.stringify(e));const t=await(G().currentUser?.getIdToken());console.log("Got firebase token",G(),t),t?o(e,t):console.error("No firebase token found")},size:"xl",children:t("span",{className:"text-lg",children:"Sign Up"})}),t(n,{variant:"ghost",size:"xl",className:"mt-4",onClick:a,children:t("span",{className:"",children:"Wrong account, go back"})})]})]})}function le({label:i,children:n}){return e("div",{className:"flex flex-col space-y-2 pt-4",children:[t("div",{className:"text-sm text-muted",children:i}),n]})}function re({allowedPrefix:e,isNested:i=!1,lightLogo:n,darkLogo:o}){const[a,l]=P(!1);return u((()=>{e&&l(window.location.href.startsWith(e))}),[]),a?null:t(se,{isNested:i,lightLogo:n,darkLogo:o})}function se({isNested:i=!1,lightLogo:n,darkLogo:o}){const{isLoading:a,user:l,authError:r}=T();return a||l?null:t("div",{style:{zIndex:999998},className:(i?"absolute":"fixed")+"overflow-y-auto ",children:e("div",{className:W("flex flex-col items-center justify-center py-14 px-4"),children:[t(ce,{authError:r,lightLogo:n,darkLogo:o}),e("div",{className:"flex gap-x-6 mt-10 justify-center text-muted",children:[t("a",{href:"https://vertesiahq.com/privacy",className:"text-sm",children:"Privacy Policy"}),t("a",{href:"https://vertesiahq.com/terms",className:"text-sm",children:"Terms of Service"})]})]})})}function ce({authError:o,darkLogo:a,lightLogo:l}){const[r,s]=P(void 0),[c,d]=P(!1),{signOut:m}=T(),{trackEvent:u}=I();history.replaceState({},"","/");const h=()=>{s(void 0),d(!0)};z((()=>{o instanceof U&&(console.log("User not found, redirecting to signup"),h())}),[o]);return e(i,{children:[l&&t("img",{src:l,alt:"logo",className:"h-15 block dark:hidden"}),a&&t("img",{src:a,alt:"logo",className:"h-15 hidden dark:block"}),r&&e("div",{className:"my-6",children:["Need to make a change?"," ",t(n,{onClick:h,children:" Go back"})]}),t("div",{className:"flex flex-col space-y-2",children:c&&!localStorage.getItem("tenantName")?t(ae,{onSignup:(e,t)=>{console.log("Got Signup data",e),s(e);const i={signupData:e,firebaseToken:t};fetch(q.endpoints.studio+"/auth/signup",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)}).then((e=>{console.log("Signup successful",i,e),u("sign_up"),window.location.href="/"}))},goBack:()=>{console.log("Going back, signing out"),s(void 0),d(!1),m()}}):e("div",{className:"flex flex-col",children:[t("div",{className:"my-4",children:t("h2",{className:"text-2xl font-bold text-center",children:"Log in or Sign up"})}),e("div",{className:"max-w-2xl text-center my-2 px-2",children:["First time here? No problem, it's free to try!",t("br",{}),"We'll just ask you a couple of questions next and you'll be on your way."]}),e("div",{className:"flex items-center flex-col",children:[e("div",{className:"py-4 w-70",children:[t(ee,{}),t(Z,{}),t(te,{})]}),e("div",{className:"flex items-center flex-row w-70 text-muted",children:[t("hr",{className:"w-full"}),t("div",{className:"px-2 text-xs",children:"OR"}),t("hr",{className:"w-full"})]}),t("div",{className:"py-4 w-70",children:t(X,{})})]}),o&&t("div",{className:"text-center",children:e("div",{className:"",children:["Sorry, we have not been able to sign you in.",t("br",{}),"Please try again or contact",t("a",{className:"text-info mx-1",href:"mailto:support@vertesiahq.com",children:"support@vertesiahq.com"}),"if it persists.",e("pre",{className:"mt-2",children:["Error: ",o.message]})]})})]})})]})}function de(){const[e,i]=P(),[n,o]=P(),a=function(e){const t=new URLSearchParams(e.search);let i=t.get("redirect_uri");const n=t.get("code");return i&&n?(i=decodeURI(i),i.startsWith("http://127.0.0.1:")||i.startsWith("http://localhost:")?{redirect:i,code:n,profile:t.get("profile")??"default",project:t.get("project")??void 0,account:t.get("account")??void 0}:null):null}(Y()),l=r(),s=async e=>{if(!a)return;if(!e.profile)return void l({title:"Profile is required",description:"Please enter a profile name to save the client authorization",status:"error",duration:2e3});if(!e.account)return void l({title:"Account is required",description:"Please select an account to authorize the client to access the ComposablePrompts servers",status:"error",duration:2e3});if(!e.project)return void l({title:"Project is required",description:"Please select a project to authorize the client to access the ComposablePrompts servers",status:"error",duration:2e3});let t;try{const n=await O(e.account,e.project,86400);n?(t={...e,studio_server_url:q.endpoints.studio,zeno_server_url:q.endpoints.zeno,token:n},await fetch(a.redirect,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),i(t)):l({title:"Failed to get composable token",status:"error",duration:5e3})}catch(e){t?(o(e),i(t)):l({title:"Error authorizing client",description:e.message,status:"error",duration:5e3})}},c=a?e?t(ue,{payload:e,error:n}):t(me,{clientInfo:a,onAccept:s}):t(h,{title:"Invalid request",children:"This page should be called by a terminal client to authenticate against the ComposablePrompts servers"});return t("div",{className:"w-full flex flex-col items-center gap-4 mt-24",children:c})}function me({onAccept:n,clientInfo:o}){const{client:a,user:l}=T(),{data:r,error:s}=f((()=>l?a.projects.list():Promise.resolve([])),[l]);if(s)return t(h,{title:"Error loading projects",children:s.message});const d=q.isLocalDev?"Local Dev":q.isDev?"Staging":"Production";return l&&r?e(i,{children:[e("div",{className:"w-1/3",children:[e("div",{className:"mb-4 text-xl font-semibold text-gray-800",children:["Authorizing client on ",d," environment."]}),e("div",{className:"mb-2 text-md text-gray-800",children:[t("div",{children:"A client app wants authorization to access the composable prompt servers in your name."}),e("div",{children:["The client app code is ",t("b",{children:o.code}),". You can check if the code is correct in the terminal."]})]}),e("div",{className:"mb-2 text-sm text-gray-600",children:[t("div",{children:"You must choose the target account and project for the client to access."}),t("div",{children:"Also, enter a profile name that will be used to save the authorization in your client configuration."})]})]}),t(he,{onAccept:n,allProjects:r,data:o})]}):t(c,{size:"lg"})}function ue({payload:i,error:o}){const a=r();return e("div",{children:[o?e("div",{children:[e(h,{title:"Failed to send the authorization token to the cli tool",children:['This can happen due to security checks on Safari. The error is "',o.message,'"']}),t("div",{children:"Don't worry, you can still authenticate the cli tool by pasting the authentication token in the terminal. You can close this page."})]}):t("div",{children:"The client is authenticated. You can close this page."}),t(p,{className:"mt-4",children:t(n,{variant:"secondary",onClick:()=>{i&&(navigator.clipboard.writeText(JSON.stringify(i)),a({title:"Authentication Payload copied",description:o?"You can paste the authentication payload in the terminal to authenticate the client.":"You can close the page now.",status:"success",duration:5e3}))},children:"Copy the Authentication Payload"})})]})}function he({allProjects:i,data:o,onAccept:a}){const{accounts:l,account:r,project:c}=T(),[d,m]=P((()=>({profile:o.profile,account:o.account??r?.id,project:o.project??c?.id}))),u=i.filter((e=>e.account===d.account));return e("div",{className:"w-1/3",children:[e("div",{className:"mb-4 flex flex-col gap-2",children:[t("span",{className:"font-semibold text-gray-600",children:"Profile Name"}),t(s,{type:"text",value:d.profile,onChange:e=>{m({...d,profile:e})}})]}),e("div",{className:"mb-4 flex flex-col gap-2",children:[t("span",{className:"font-semibold text-gray-600",children:"Account"}),t(pe,{value:d.account,onChange:e=>{m({...d,account:e.id,project:void 0})},accounts:l||[]})]}),e("div",{className:"mb-4 flex flex-col gap-2",children:[t("span",{className:"font-semibold text-gray-600",children:"Project"}),t(fe,{value:d.project,onChange:e=>{m({...d,project:e.id})},projects:u})]}),t("div",{className:"pt-2",children:t(n,{size:"xl",onClick:()=>a(d),children:"Authorize Client"})})]})}function pe({value:e,accounts:i,onChange:n}){return t(g,{options:i,value:i?.find((t=>t.id===e)),onChange:e=>{n(e)},by:"id",optionLabel:e=>e.name,placeholder:"Select Account"})}function fe({value:e,projects:i,onChange:n}){return t(g,{by:"id",value:i.find((t=>t.id===e)),options:i,optionLabel:e=>e.name,placeholder:"Select Project",onChange:e=>{n(e)}})}function ge({isOpen:i,onClose:r}){return e(o,{isOpen:i,onClose:r,children:[t(a,{children:"Sign In"}),e(l,{className:"flex justify-center",children:[t(ee,{}),t(Z,{}),t(te,{})]}),t(v,{justify:"end",children:t(n,{variant:"ghost",onClick:r,children:"Cancel"})})]})}function ve({title:i,value:n}){const[o,a]=P(!1);return e("div",{className:"w-full flex justify-between items-center mb-1",children:[e("div",{className:"flex flex-col w-[calc(100%-3rem)]",children:[t("div",{className:"text-sm px-2 dark:text-slate-200",children:i}),t(N,{description:n,size:"xs",placement:"left",children:e("div",{className:"text-xs truncate text-muted w-full text-left px-2",children:[n," "]})})]}),o?t(V,{className:"size-4 cursor-pointer text-success"}):t(H,{className:"size-4 cursor-pointer text-gray-400 dark:text-slate-400",onClick:()=>function(e){navigator.clipboard.writeText(e),a(!0),setTimeout((()=>a(!1)),2e3)}(n)})]})}function xe(){const i=T(),{account:n,project:o,client:a,authToken:l}=i,r=new URL(a.baseUrl).hostname,s=new URL(a.store.baseUrl).hostname,c=o?B(o):"",d=[{name:"user",label:"User",content:e("div",{className:"space-y-1 p-2",children:[t(ve,{title:"Organization ID",value:n?.id??"Unknown"}),t(ve,{title:"Project ID",value:o?.id??"Unknown"}),t(ve,{title:"User ID",value:l?.sub??"Unknown"}),t(ve,{title:"Organization Roles",value:l?.account_roles?.join(",")??"Unknown"}),t(ve,{title:"Project Roles",value:l?.project_roles?.join(",")??"Unknown"})]})},{name:"environment",label:"Environment",content:e("div",{className:"space-y-1 p-2",children:[t(ve,{title:"Tenant ID",value:c}),t(ve,{title:"Environment",value:q.type}),t(ve,{title:"Server",value:r}),t(ve,{title:"Store",value:s}),t(ve,{title:"App Version",value:q.version})]})}];return t("div",{className:"w-full",children:e(x,{defaultValue:"user",tabs:d,fullWidth:!0,children:[t(y,{}),t(b,{})]})})}function ye({}){const{user:o,isLoading:a}=T(),[l,r]=P(!1);return a?t(c,{}):o?t("div",{className:"px-3",children:t(be,{asMenuTrigger:!0})}):e(i,{children:[t(n,{onClick:()=>r(!0),children:"Sign In"}),t(ge,{isOpen:l,onClose:()=>r(!1)})]})}function be({className:i,asMenuTrigger:n=!1}){const o=T(),{user:a}=o;return o&&a?e(J,{strategy:"fixed",placement:"bottom-start",zIndex:100,children:[t(J.Trigger,{click:!0,children:t("div",{className:W(i,"flex items-center justify-start",n&&"cursor-pointer"),children:t(w,{size:"sm",color:"bg-amber-500",shape:"circle",name:a?.name})})}),t(J.Content,{className:"w-[280px] mx-2 my-1",children:t("div",{className:"bg-white dark:bg-slate-900 shadow-lg rounded-md ring-1 ring-gray-200 dark:ring-slate-700",children:e("div",{className:"divide-y divide-gray-200 dark:divide-slate-700",children:[e("div",{className:"py-2 pl-2",children:[t("p",{className:"px-4 dark:text-white mb-1",children:a?.name??"Unknown"}),t("p",{className:"px-4 text-xs text-gray-500",children:a?.email??""})]}),t("div",{className:"w-full p-1",children:t(xe,{})}),t("div",{className:"py-2 pl-2",children:t(k,{})}),t("div",{className:"py-2",children:t(C,{children:t(C.Item,{className:"px-2",onClick:()=>o.logout(),children:"Sign out"})})})]})})})]}):null}function Ne(e){return!!e&&(e.endsWith("@vertesiahq.com")||e.endsWith("@becomposable.com")||e.endsWith("@composableprompts.com"))}function we({}){const{isLoading:e}=T(),[i,n]=P(!0);return z((()=>{e||n(!1)}),[e]),t($,{appear:!0,show:i,as:L,unmount:!0,leave:"transition ease-in duration-500",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:t("div",{style:{zIndex:999999},className:"fixed inset-x-0 inset-y-0",children:t("div",{className:"flex w-full h-full items-center justify-center",children:t("div",{className:"animate-[spin_4s_linear_infinite]",children:t("img",{src:"/icon.svg",className:"w-10 h-auto animate-pulse rounded-full"})})})})})}function ke({children:i,lightLogo:n,darkLogo:o}){return t(S,{children:t(E,{children:e(j,{defaultTheme:"system",storageKey:"vite-ui-theme",children:[t(we,{}),t(re,{allowedPrefix:"/shared/",lightLogo:n,darkLogo:o}),t(K,{children:i})]})})})}export{Q as InviteAcceptModal,re as SigninScreen,de as TerminalLogin,ye as UserSessionMenu,ke as VertesiaShell,Ne as isVertesiaEmail};
|
|
2
|
+
//# sourceMappingURL=vertesia-ui-shell.js.map
|