@solidxai/core-ui 0.1.8-beta.1 → 0.1.8-beta.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Svg/FileSvg.js +1 -1
- package/dist/components/Svg/FileSvg.js.map +1 -1
- package/dist/components/Svg/FileSvg.tsx +1 -1
- package/dist/components/auth/AuthLayout.d.ts.map +1 -1
- package/dist/components/auth/AuthLayout.js +94 -38
- package/dist/components/auth/AuthLayout.js.map +1 -1
- package/dist/components/auth/AuthLayout.tsx +49 -39
- package/dist/components/auth/AuthSettingsContext.d.ts +10 -0
- package/dist/components/auth/AuthSettingsContext.d.ts.map +1 -0
- package/dist/components/auth/AuthSettingsContext.js +49 -0
- package/dist/components/auth/AuthSettingsContext.js.map +1 -0
- package/dist/components/auth/AuthSettingsContext.tsx +19 -0
- package/dist/components/auth/AuthTabs.d.ts.map +1 -1
- package/dist/components/auth/AuthTabs.js +9 -9
- package/dist/components/auth/AuthTabs.js.map +1 -1
- package/dist/components/auth/AuthTabs.tsx +14 -15
- package/dist/components/auth/ForgotPasswordThankYou.d.ts.map +1 -1
- package/dist/components/auth/ForgotPasswordThankYou.js +2 -6
- package/dist/components/auth/ForgotPasswordThankYou.js.map +1 -1
- package/dist/components/auth/ForgotPasswordThankYou.tsx +2 -7
- package/dist/components/auth/SolidForgotPassword.d.ts.map +1 -1
- package/dist/components/auth/SolidForgotPassword.js +3 -7
- package/dist/components/auth/SolidForgotPassword.js.map +1 -1
- package/dist/components/auth/SolidForgotPassword.tsx +3 -7
- package/dist/components/auth/SolidInitialLoginOtp.d.ts.map +1 -1
- package/dist/components/auth/SolidInitialLoginOtp.js +4 -7
- package/dist/components/auth/SolidInitialLoginOtp.js.map +1 -1
- package/dist/components/auth/SolidInitialLoginOtp.tsx +2 -5
- package/dist/components/auth/SolidInitiateRegisterOtp.d.ts.map +1 -1
- package/dist/components/auth/SolidInitiateRegisterOtp.js +4 -7
- package/dist/components/auth/SolidInitiateRegisterOtp.js.map +1 -1
- package/dist/components/auth/SolidInitiateRegisterOtp.tsx +2 -5
- package/dist/components/auth/SolidLogin.d.ts.map +1 -1
- package/dist/components/auth/SolidLogin.js +5 -8
- package/dist/components/auth/SolidLogin.js.map +1 -1
- package/dist/components/auth/SolidLogin.tsx +5 -6
- package/dist/components/auth/SolidRegister.d.ts.map +1 -1
- package/dist/components/auth/SolidRegister.js +9 -12
- package/dist/components/auth/SolidRegister.js.map +1 -1
- package/dist/components/auth/SolidRegister.tsx +21 -11
- package/dist/components/auth/SolidResetPassword.d.ts.map +1 -1
- package/dist/components/auth/SolidResetPassword.js +2 -6
- package/dist/components/auth/SolidResetPassword.js.map +1 -1
- package/dist/components/auth/SolidResetPassword.tsx +2 -6
- package/dist/components/common/GeneralSettings.d.ts.map +1 -1
- package/dist/components/common/GeneralSettings.js +48 -51
- package/dist/components/common/GeneralSettings.js.map +1 -1
- package/dist/components/common/GeneralSettings.tsx +8 -25
- package/dist/components/common/SolidAdmin.js +1 -1
- package/dist/components/common/SolidAdmin.js.map +1 -1
- package/dist/components/common/SolidAdmin.tsx +1 -1
- package/dist/components/common/SolidFormStepper.js +1 -1
- package/dist/components/common/SolidFormStepper.js.map +1 -1
- package/dist/components/common/SolidFormStepper.tsx +1 -1
- package/dist/components/common/SolidThemeProvider.d.ts.map +1 -1
- package/dist/components/common/SolidThemeProvider.js +5 -21
- package/dist/components/common/SolidThemeProvider.js.map +1 -1
- package/dist/components/common/SolidThemeProvider.tsx +6 -24
- package/dist/components/common/solidModuleHome.module.css +1 -2
- package/dist/components/core/card/SolidCardView.js +1 -1
- package/dist/components/core/card/SolidCardView.js.map +1 -1
- package/dist/components/core/card/SolidCardView.tsx +1 -1
- package/dist/components/core/chatter/chatter.module.css +7 -7
- package/dist/components/core/common/PDFViewer.js +1 -1
- package/dist/components/core/common/PDFViewer.js.map +1 -1
- package/dist/components/core/common/PDFViewer.tsx +2 -2
- package/dist/components/core/common/SolidAccountSettings/SolidAccountSettings.module.css +1 -1
- package/dist/components/core/common/SolidGenericImport/SolidImport.module.css +3 -4
- package/dist/components/core/common/SolidGlobalSearchElement.js +3 -3
- package/dist/components/core/common/SolidGlobalSearchElement.js.map +1 -1
- package/dist/components/core/common/SolidGlobalSearchElement.tsx +3 -3
- package/dist/components/core/common/dndCompat.d.ts +8 -0
- package/dist/components/core/common/dndCompat.d.ts.map +1 -0
- package/dist/components/core/common/dndCompat.js +5 -0
- package/dist/components/core/common/dndCompat.js.map +1 -0
- package/dist/components/core/common/dndCompat.ts +9 -0
- package/dist/components/core/dashboard/SolidDashboardFilterRequired.js +2 -2
- package/dist/components/core/dashboard/SolidDashboardFilterRequired.js.map +1 -1
- package/dist/components/core/dashboard/SolidDashboardFilterRequired.tsx +2 -2
- package/dist/components/core/dashboard/SolidDashboardNotAvailable.js +2 -2
- package/dist/components/core/dashboard/SolidDashboardNotAvailable.js.map +1 -1
- package/dist/components/core/dashboard/SolidDashboardNotAvailable.tsx +2 -2
- package/dist/components/core/extension/solid-core/chatterMessage/form/SolidChatterMessageCoModelEntityIdFormViewWidget.js +1 -1
- package/dist/components/core/extension/solid-core/chatterMessage/form/SolidChatterMessageCoModelEntityIdFormViewWidget.js.map +1 -1
- package/dist/components/core/extension/solid-core/chatterMessage/form/SolidChatterMessageCoModelEntityIdFormViewWidget.tsx +1 -1
- package/dist/components/core/extension/solid-core/chatterMessage/list/SolidChatterMessageCoModelEntityIdListViewWidget.js +1 -1
- package/dist/components/core/extension/solid-core/chatterMessage/list/SolidChatterMessageCoModelEntityIdListViewWidget.js.map +1 -1
- package/dist/components/core/extension/solid-core/chatterMessage/list/SolidChatterMessageCoModelEntityIdListViewWidget.tsx +1 -1
- package/dist/components/core/extension/solid-core/mqMessage/list/SolidMqMessagesSummarizeListHeaderAction.js +1 -1
- package/dist/components/core/extension/solid-core/mqMessage/list/SolidMqMessagesSummarizeListHeaderAction.js.map +1 -1
- package/dist/components/core/extension/solid-core/mqMessage/list/SolidMqMessagesSummarizeListHeaderAction.tsx +1 -1
- package/dist/components/core/extension/solid-core/mqMessage/ui/MqMessageStageBadge.js +1 -1
- package/dist/components/core/extension/solid-core/mqMessage/ui/MqMessageStageBadge.js.map +1 -1
- package/dist/components/core/extension/solid-core/mqMessage/ui/MqMessageStageBadge.tsx +1 -1
- package/dist/components/core/extension/solid-core/scheduled-job/scheduleFrequencyOnFieldChangeHandler.d.ts +7 -0
- package/dist/components/core/extension/solid-core/scheduled-job/scheduleFrequencyOnFieldChangeHandler.d.ts.map +1 -0
- package/dist/components/core/extension/solid-core/scheduled-job/scheduleFrequencyOnFieldChangeHandler.js +75 -0
- package/dist/components/core/extension/solid-core/scheduled-job/scheduleFrequencyOnFieldChangeHandler.js.map +1 -0
- package/dist/components/core/extension/solid-core/scheduled-job/scheduleFrequencyOnFieldChangeHandler.ts +45 -0
- package/dist/components/core/form/SolidFormActionHeader.d.ts.map +1 -1
- package/dist/components/core/form/SolidFormActionHeader.js +4 -0
- package/dist/components/core/form/SolidFormActionHeader.js.map +1 -1
- package/dist/components/core/form/SolidFormActionHeader.tsx +12 -0
- package/dist/components/core/form/SolidFormView.js +42 -41
- package/dist/components/core/form/SolidFormView.js.map +1 -1
- package/dist/components/core/form/SolidFormView.tsx +16 -16
- package/dist/components/core/form/fields/SolidDateTimeField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidDateTimeField.js +8 -2
- package/dist/components/core/form/fields/SolidDateTimeField.js.map +1 -1
- package/dist/components/core/form/fields/SolidDateTimeField.tsx +8 -2
- package/dist/components/core/form/fields/SolidEmailField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidEmailField.js +5 -4
- package/dist/components/core/form/fields/SolidEmailField.js.map +1 -1
- package/dist/components/core/form/fields/SolidEmailField.tsx +17 -15
- package/dist/components/core/form/fields/SolidIntegerField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidIntegerField.js +5 -4
- package/dist/components/core/form/fields/SolidIntegerField.js.map +1 -1
- package/dist/components/core/form/fields/SolidIntegerField.tsx +3 -1
- package/dist/components/core/form/fields/SolidSelectionDynamicField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidSelectionDynamicField.js +23 -17
- package/dist/components/core/form/fields/SolidSelectionDynamicField.js.map +1 -1
- package/dist/components/core/form/fields/SolidSelectionDynamicField.tsx +11 -6
- package/dist/components/core/form/fields/SolidSelectionStaticField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidSelectionStaticField.js +29 -24
- package/dist/components/core/form/fields/SolidSelectionStaticField.js.map +1 -1
- package/dist/components/core/form/fields/SolidSelectionStaticField.tsx +13 -8
- package/dist/components/core/form/fields/SolidShortTextField.d.ts.map +1 -1
- package/dist/components/core/form/fields/SolidShortTextField.js +8 -6
- package/dist/components/core/form/fields/SolidShortTextField.js.map +1 -1
- package/dist/components/core/form/fields/SolidShortTextField.tsx +7 -1
- package/dist/components/core/form/fields/SolidTimeField.js +1 -1
- package/dist/components/core/form/fields/SolidTimeField.js.map +1 -1
- package/dist/components/core/form/fields/SolidTimeField.tsx +1 -1
- package/dist/components/core/form/fields/relations/widgets/helpers/InlineRelationEntityDialog.d.ts.map +1 -1
- package/dist/components/core/form/fields/relations/widgets/helpers/InlineRelationEntityDialog.js +3 -3
- package/dist/components/core/form/fields/relations/widgets/helpers/InlineRelationEntityDialog.js.map +1 -1
- package/dist/components/core/form/fields/relations/widgets/helpers/InlineRelationEntityDialog.tsx +0 -5
- package/dist/components/core/form/fields/solidFields.module.css +0 -3
- package/dist/components/core/form/fields/widgets/SolidS3FileViewerWidget.d.ts +1 -1
- package/dist/components/core/form/fields/widgets/SolidS3FileViewerWidget.js +1 -1
- package/dist/components/core/form/fields/widgets/SolidS3FileViewerWidget.js.map +1 -1
- package/dist/components/core/form/fields/widgets/SolidS3FileViewerWidget.tsx +1 -1
- package/dist/components/core/kanban/KanbanCard.d.ts.map +1 -1
- package/dist/components/core/kanban/KanbanCard.js +2 -2
- package/dist/components/core/kanban/KanbanCard.js.map +1 -1
- package/dist/components/core/kanban/KanbanCard.tsx +4 -3
- package/dist/components/core/kanban/KanbanColumn.d.ts.map +1 -1
- package/dist/components/core/kanban/KanbanColumn.js +3 -3
- package/dist/components/core/kanban/KanbanColumn.js.map +1 -1
- package/dist/components/core/kanban/KanbanColumn.tsx +5 -4
- package/dist/components/core/kanban/SolidKanbanView.d.ts.map +1 -1
- package/dist/components/core/kanban/SolidKanbanView.js +42 -45
- package/dist/components/core/kanban/SolidKanbanView.js.map +1 -1
- package/dist/components/core/kanban/SolidKanbanView.tsx +17 -26
- package/dist/components/core/list/SolidColumnSelector/SolidListColumnSelector.d.ts.map +1 -1
- package/dist/components/core/list/SolidColumnSelector/SolidListColumnSelector.js +4 -3
- package/dist/components/core/list/SolidColumnSelector/SolidListColumnSelector.js.map +1 -1
- package/dist/components/core/list/SolidColumnSelector/SolidListColumnSelector.tsx +13 -12
- package/dist/components/core/list/SolidEmptyListViewPlaceholder.d.ts.map +1 -1
- package/dist/components/core/list/SolidEmptyListViewPlaceholder.js +1 -1
- package/dist/components/core/list/SolidEmptyListViewPlaceholder.js.map +1 -1
- package/dist/components/core/list/SolidEmptyListViewPlaceholder.tsx +6 -4
- package/dist/components/core/list/SolidListView.d.ts.map +1 -1
- package/dist/components/core/list/SolidListView.js +5 -12
- package/dist/components/core/list/SolidListView.js.map +1 -1
- package/dist/components/core/list/SolidListView.tsx +29 -49
- package/dist/components/core/list/SolidListViewRowActionsMenu.js +2 -2
- package/dist/components/core/list/SolidListViewRowActionsMenu.js.map +1 -1
- package/dist/components/core/list/SolidListViewRowActionsMenu.tsx +2 -2
- package/dist/components/core/module/CreateModule.js +1 -1
- package/dist/components/core/module/CreateModule.js.map +1 -1
- package/dist/components/core/module/CreateModule.tsx +1 -1
- package/dist/components/core/solid-ai/SolidAiChat.module.css +3 -3
- package/dist/components/core/tree/SolidTreeView.js +1 -1
- package/dist/components/core/tree/SolidTreeView.js.map +1 -1
- package/dist/components/core/tree/SolidTreeView.tsx +1 -1
- package/dist/components/core/users/ApiKeysTab/ApiKeysTab.css +283 -9
- package/dist/components/core/users/ApiKeysTab/ApiKeysTab.d.ts.map +1 -1
- package/dist/components/core/users/ApiKeysTab/ApiKeysTab.js +35 -28
- package/dist/components/core/users/ApiKeysTab/ApiKeysTab.js.map +1 -1
- package/dist/components/core/users/ApiKeysTab/ApiKeysTab.tsx +64 -62
- package/dist/components/core/users/ApiKeysTab/GenerateApiKeyModal.d.ts +2 -1
- package/dist/components/core/users/ApiKeysTab/GenerateApiKeyModal.d.ts.map +1 -1
- package/dist/components/core/users/ApiKeysTab/GenerateApiKeyModal.js +4 -4
- package/dist/components/core/users/ApiKeysTab/GenerateApiKeyModal.js.map +1 -1
- package/dist/components/core/users/ApiKeysTab/GenerateApiKeyModal.tsx +17 -10
- package/dist/components/core/users/ApiKeysTab/RevealApiKeyModal.d.ts.map +1 -1
- package/dist/components/core/users/ApiKeysTab/RevealApiKeyModal.js +2 -19
- package/dist/components/core/users/ApiKeysTab/RevealApiKeyModal.js.map +1 -1
- package/dist/components/core/users/ApiKeysTab/RevealApiKeyModal.tsx +24 -43
- package/dist/components/core/users/CreateUser.css +114 -0
- package/dist/components/core/users/CreateUser.d.ts +1 -0
- package/dist/components/core/users/CreateUser.d.ts.map +1 -1
- package/dist/components/core/users/CreateUser.js +4 -3
- package/dist/components/core/users/CreateUser.js.map +1 -1
- package/dist/components/core/users/CreateUser.tsx +32 -26
- package/dist/components/layout/AdminTopHeader.d.ts.map +1 -1
- package/dist/components/layout/AdminTopHeader.js +25 -1
- package/dist/components/layout/AdminTopHeader.js.map +1 -1
- package/dist/components/layout/AdminTopHeader.tsx +38 -1
- package/dist/components/layout/context/layoutcontext.js +2 -2
- package/dist/components/layout/context/layoutcontext.js.map +1 -1
- package/dist/components/layout/context/layoutcontext.tsx +2 -2
- package/dist/components/shad-cn-ui/SolidAutocomplete.d.ts.map +1 -1
- package/dist/components/shad-cn-ui/SolidAutocomplete.js +9 -1
- package/dist/components/shad-cn-ui/SolidAutocomplete.js.map +1 -1
- package/dist/components/shad-cn-ui/SolidAutocomplete.tsx +10 -1
- package/dist/components/shad-cn-ui/SolidConfirmDialog.d.ts +6 -1
- package/dist/components/shad-cn-ui/SolidConfirmDialog.d.ts.map +1 -1
- package/dist/components/shad-cn-ui/SolidConfirmDialog.js +3 -3
- package/dist/components/shad-cn-ui/SolidConfirmDialog.js.map +1 -1
- package/dist/components/shad-cn-ui/SolidConfirmDialog.tsx +15 -3
- package/dist/components/shad-cn-ui/SolidDatePicker.d.ts.map +1 -1
- package/dist/components/shad-cn-ui/SolidDatePicker.js +12 -2
- package/dist/components/shad-cn-ui/SolidDatePicker.js.map +1 -1
- package/dist/components/shad-cn-ui/SolidDatePicker.tsx +13 -2
- package/dist/components/shad-cn-ui/SolidTabs.d.ts.map +1 -1
- package/dist/components/shad-cn-ui/SolidTabs.js +5 -2
- package/dist/components/shad-cn-ui/SolidTabs.js.map +1 -1
- package/dist/components/shad-cn-ui/SolidTabs.tsx +51 -25
- package/dist/helpers/registry.d.ts.map +1 -1
- package/dist/helpers/registry.js +2 -0
- package/dist/helpers/registry.js.map +1 -1
- package/dist/helpers/registry.ts +5 -0
- package/dist/resources/globals.css +104 -84
- package/dist/resources/images/Background.svg +5 -1
- package/dist/resources/images/Navigation/SolidSettinsIcon.svg +7 -1
- package/dist/resources/images/errors/error.svg +14 -10
- package/dist/resources/shadcn-base.css +120 -354
- package/dist/resources/themes/solid-dark-purple/theme.css +26 -36
- package/dist/resources/themes/solid-light-purple/theme.css +129 -129
- package/dist/routes/SolidLayoutRegistry.d.ts.map +1 -1
- package/dist/routes/SolidLayoutRegistry.js +3 -1
- package/dist/routes/SolidLayoutRegistry.js.map +1 -1
- package/dist/routes/SolidLayoutRegistry.tsx +3 -1
- package/dist/routes/guards/AuthGuard.d.ts.map +1 -1
- package/dist/routes/guards/AuthGuard.js +4 -1
- package/dist/routes/guards/AuthGuard.js.map +1 -1
- package/dist/routes/guards/AuthGuard.tsx +6 -1
- package/dist/types/solid-core.d.ts +1 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SolidLayoutRegistry.d.ts","sourceRoot":"","sources":["../../src/routes/SolidLayoutRegistry.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAsC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAC3E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAIpD,MAAM,WAAW,gBAAgB;IAC/B,qDAAqD;IACrD,IAAI,EAAE,MAAM,CAAC;IACb,kEAAkE;IAClE,KAAK,EAAE,MAAM,CAAC;IACd,2CAA2C;IAC3C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,0EAA0E;IAC1E,EAAE,EAAE,MAAM,CAAC;CACZ;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,iBAAiB;IAChC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAOD;;;GAGG;AACH,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,WAAW,EAAE,GAAG,IAAI,CAErE;
|
|
1
|
+
{"version":3,"file":"SolidLayoutRegistry.d.ts","sourceRoot":"","sources":["../../src/routes/SolidLayoutRegistry.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAsC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAC3E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAIpD,MAAM,WAAW,gBAAgB;IAC/B,qDAAqD;IACrD,IAAI,EAAE,MAAM,CAAC;IACb,kEAAkE;IAClE,KAAK,EAAE,MAAM,CAAC;IACd,2CAA2C;IAC3C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,0EAA0E;IAC1E,EAAE,EAAE,MAAM,CAAC;CACZ;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,iBAAiB;IAChC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAOD;;;GAGG;AACH,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,WAAW,EAAE,GAAG,IAAI,CAErE;AAsHD;;;GAGG;AACH,wBAAgB,2BAA2B,CAAC,EAC1C,MAAM,EACN,QAAQ,GACT,EAAE;IACD,MAAM,EAAE,WAAW,EAAE,CAAC;IACtB,QAAQ,EAAE,SAAS,CAAC;CACrB,2CAOA;AAMD;;;;;;GAMG;AACH,wBAAgB,sBAAsB,IAAI,gBAAgB,EAAE,CAI3D"}
|
|
@@ -71,7 +71,9 @@ function inferPathFromChildren(children) {
|
|
|
71
71
|
// Absolute path → use root
|
|
72
72
|
if ((_a = child.path) === null || _a === void 0 ? void 0 : _a.startsWith("/")) {
|
|
73
73
|
var root = child.path.split("/").filter(Boolean)[0];
|
|
74
|
-
return root ?
|
|
74
|
+
// return root ? `/${root}` : undefined;
|
|
75
|
+
// treat absolute path with no segments as home..
|
|
76
|
+
return root ? "/".concat(root) : 'home';
|
|
75
77
|
}
|
|
76
78
|
// Relative path → use first segment
|
|
77
79
|
if (child.path) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SolidLayoutRegistry.js","sourceRoot":"","sources":["../../src/routes/SolidLayoutRegistry.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,OAAO,EAAkB,MAAM,OAAO,CAAC;AAkC3E,iFAAiF;AACjF,gFAAgF;AAEhF,IAAI,WAAW,GAAkB,EAAE,CAAC;AAEpC;;;GAGG;AACH,MAAM,UAAU,yBAAyB,CAAC,MAAqB;IAC7D,WAAW,GAAG,MAAM,CAAC;AACvB,CAAC;AAED,iFAAiF;AACjF,wEAAwE;AACxE,wEAAwE;AAExE,IAAM,0BAA0B,GAAG,aAAa,CAA4B,IAAI,CAAC,CAAC;AAElF,iFAAiF;AAEjF,SAAS,WAAW,CAAC,IAAY;IAC/B,OAAO,CACL,IAAI;SACD,OAAO,CAAC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AC,MAAM,CAAC,EAAtB,CAAsB,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;IAChE,OAAO,CACL,KAAC,0BAA0B,CAAC,QAAQ,IAAC,KAAK,EAAE,OAAO,YAChD,QAAQ,GAC2B,CACvC,CAAC;AACJ,CAAC;AAID,iFAAiF;AAEjF;;;;;;GAMG;AACH,MAAM,UAAU,sBAAsB;IACpC,IAAM,cAAc,GAAG,UAAU,CAAC,0BAA0B,CAAC,CAAC;IAC9D,IAAI,cAAc,KAAK,IAAI;QAAE,OAAO,cAAc,CAAC;IACnD,OAAO,cAAc,CAAC,WAAW,CAAC,CAAC;AACrC,CAAC","sourcesContent":["import { createContext, useContext, useMemo, type ReactNode } from \"react\";\nimport type { RouteObject } from \"react-router-dom\";\n\n// ── Types ─────────────────────────────────────────────────────────────────────\n\nexport interface SolidLayoutEntry {\n /** The root path of this layout, e.g. \"/jenendar\" */\n path: string;\n /** Display title. Falls back to title-casing the path segment. */\n title: string;\n /** Optional subtitle shown on the card. */\n description?: string;\n /** Resolved URL to navigate to when the card is clicked (first child). */\n to: string;\n}\n\n/**\n * Optionally attach this to a route's `handle` to customise the card.\n *\n * @example\n * ```tsx\n * {\n * path: \"/my-layout\",\n * handle: { title: \"My Layout\", description: \"Custom layout\" } satisfies SolidLayoutHandle,\n * element: <MyLayout />,\n * children: [...],\n * }\n * ```\n */\nexport interface SolidLayoutHandle {\n title?: string;\n description?: string;\n}\n\n// ── Module-level store ────────────────────────────────────────────────────────\n// Populated automatically inside getSolidRoutes() — no consumer changes needed.\n\nlet _autoRoutes: RouteObject[] = [];\n\n/**\n * Called by getSolidRoutes() whenever extraRoutes are provided.\n * @internal — not part of the public API.\n */\nexport function _solidRegisterExtraRoutes(routes: RouteObject[]): void {\n _autoRoutes = routes;\n}\n\n// ── Context (optional override) ───────────────────────────────────────────────\n// Mount SolidLayoutRegistryProvider anywhere above StudioLandingPage to\n// override the auto-registered list (e.g. async / runtime route lists).\n\nconst SolidLayoutRegistryContext = createContext<SolidLayoutEntry[] | null>(null);\n\n// ── Helpers ───────────────────────────────────────────────────────────────────\n\nfunction pathToTitle(path: string): string {\n return (\n path\n .replace(/^\\//, \"\")\n .split(/[-_/]/)\n .filter(Boolean)\n .map((w) => w.charAt(0).toUpperCase() + w.slice(1))\n .join(\" \") || path\n );\n}\n\n/**\n * Walk a route tree and return the first concrete relative or absolute path found.\n * Skips index routes (they render at the parent path) and pathless wrappers\n * (guards, layout wrappers) by looking inside their children recursively.\n */\nfunction findFirstConcretePath(children: RouteObject[]): string | undefined {\n // 1. FIRST PASS → prioritize index (including inside pathless wrappers)\n for (const child of children) {\n if ((child as any).index || child.path === \"\") {\n return \"\";\n }\n // Deep check for pathless wrappers in the first pass too\n if (!child.path && child.children?.length) {\n const nested = findFirstConcretePath(child.children);\n if (nested === \"\") return \"\";\n }\n }\n\n // 2. SECOND PASS → find first path\n for (const child of children) {\n if (child.path) return child.path;\n\n if (child.children?.length) {\n const nested = findFirstConcretePath(child.children);\n if (nested !== undefined) return nested;\n }\n }\n\n return undefined;\n}\nfunction resolveFirstChildTo(basePath: string, children: RouteObject[]): string {\n const concretePath = findFirstConcretePath(children);\n if (concretePath === undefined || concretePath === \"\") return basePath;\n if (concretePath.startsWith(\"/\")) return concretePath;\n return `${basePath.replace(/\\/$/, \"\")}/${concretePath}`;\n}\n\nfunction inferPathFromChildren(children: RouteObject[]): string | undefined {\n for (const child of children) {\n // Absolute path → use root\n if (child.path?.startsWith(\"/\")) {\n const root = child.path.split(\"/\").filter(Boolean)[0];\n return root ? `/${root}` : undefined;\n }\n\n // Relative path → use first segment\n if (child.path) {\n const root = child.path.split(\"/\")[0];\n return root ? `/${root}` : undefined;\n }\n\n // Nested\n if (child.children?.length) {\n const nested = inferPathFromChildren(child.children);\n if (nested) return nested;\n }\n }\n\n return undefined;\n}\n\nfunction extractLayouts(routes: RouteObject[]): SolidLayoutEntry[] {\n const layouts: SolidLayoutEntry[] = [];\n const seen = new Set<string>();\n\n for (const route of routes) {\n // ✅ Use explicit path OR infer from children\n const basePath =\n route.path ??\n (route.children?.length\n ? inferPathFromChildren(route.children)\n : undefined);\n\n if (!basePath || seen.has(basePath)) continue;\n\n const handle = route.handle as SolidLayoutHandle | undefined;\n\n const to = route.children?.length\n ? resolveFirstChildTo(basePath, route.children)\n : basePath;\n\n layouts.push({\n path: basePath,\n title: handle?.title ?? pathToTitle(basePath),\n description: handle?.description,\n to,\n });\n\n seen.add(basePath);\n }\n\n return layouts;\n}\n// ── Provider (optional override) ──────────────────────────────────────────────\n\n/**\n * Optional — most apps do NOT need this.\n * Use only when you need to override the auto-registered list at runtime.\n */\nexport function SolidLayoutRegistryProvider({\n routes,\n children,\n}: {\n routes: RouteObject[];\n children: ReactNode;\n}) {\n const layouts = useMemo(() => extractLayouts(routes), [routes]);\n return (\n <SolidLayoutRegistryContext.Provider value={layouts}>\n {children}\n </SolidLayoutRegistryContext.Provider>\n );\n}\n\n\n\n// ── Hook ──────────────────────────────────────────────────────────────────────\n\n/**\n * Returns the registered layout entries.\n *\n * Priority order:\n * 1. SolidLayoutRegistryProvider context (if mounted)\n * 2. Routes auto-registered when getSolidRoutes({ extraRoutes }) was called\n */\nexport function useSolidLayoutRegistry(): SolidLayoutEntry[] {\n const contextLayouts = useContext(SolidLayoutRegistryContext);\n if (contextLayouts !== null) return contextLayouts;\n return extractLayouts(_autoRoutes);\n}\n"]}
|
|
1
|
+
{"version":3,"file":"SolidLayoutRegistry.js","sourceRoot":"","sources":["../../src/routes/SolidLayoutRegistry.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,OAAO,EAAkB,MAAM,OAAO,CAAC;AAkC3E,iFAAiF;AACjF,gFAAgF;AAEhF,IAAI,WAAW,GAAkB,EAAE,CAAC;AAEpC;;;GAGG;AACH,MAAM,UAAU,yBAAyB,CAAC,MAAqB;IAC7D,WAAW,GAAG,MAAM,CAAC;AACvB,CAAC;AAED,iFAAiF;AACjF,wEAAwE;AAC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,OAAO,CAAC;AACjB,CAAC;AACD,iFAAiF;AAEjF;;;GAGG;AACH,MAAM,UAAU,2BAA2B,CAAC,EAM3C;QALC,MAAM,YAAA,EACN,QAAQ,cAAA;IAKR,IAAM,OAAO,GAAG,OAAO,CAAC,cAAM,OAAA,cAAc,CAAC,MAAM,CAAC,EAAtB,CAAsB,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;IAChE,OAAO,CACL,KAAC,0BAA0B,CAAC,QAAQ,IAAC,KAAK,EAAE,OAAO,YAChD,QAAQ,GAC2B,CACvC,CAAC;AACJ,CAAC;AAID,iFAAiF;AAEjF;;;;;;GAMG;AACH,MAAM,UAAU,sBAAsB;IACpC,IAAM,cAAc,GAAG,UAAU,CAAC,0BAA0B,CAAC,CAAC;IAC9D,IAAI,cAAc,KAAK,IAAI;QAAE,OAAO,cAAc,CAAC;IACnD,OAAO,cAAc,CAAC,WAAW,CAAC,CAAC;AACrC,CAAC","sourcesContent":["import { createContext, useContext, useMemo, type ReactNode } from \"react\";\nimport type { RouteObject } from \"react-router-dom\";\n\n// ── Types ─────────────────────────────────────────────────────────────────────\n\nexport interface SolidLayoutEntry {\n /** The root path of this layout, e.g. \"/jenendar\" */\n path: string;\n /** Display title. Falls back to title-casing the path segment. */\n title: string;\n /** Optional subtitle shown on the card. */\n description?: string;\n /** Resolved URL to navigate to when the card is clicked (first child). */\n to: string;\n}\n\n/**\n * Optionally attach this to a route's `handle` to customise the card.\n *\n * @example\n * ```tsx\n * {\n * path: \"/my-layout\",\n * handle: { title: \"My Layout\", description: \"Custom layout\" } satisfies SolidLayoutHandle,\n * element: <MyLayout />,\n * children: [...],\n * }\n * ```\n */\nexport interface SolidLayoutHandle {\n title?: string;\n description?: string;\n}\n\n// ── Module-level store ────────────────────────────────────────────────────────\n// Populated automatically inside getSolidRoutes() — no consumer changes needed.\n\nlet _autoRoutes: RouteObject[] = [];\n\n/**\n * Called by getSolidRoutes() whenever extraRoutes are provided.\n * @internal — not part of the public API.\n */\nexport function _solidRegisterExtraRoutes(routes: RouteObject[]): void {\n _autoRoutes = routes;\n}\n\n// ── Context (optional override) ───────────────────────────────────────────────\n// Mount SolidLayoutRegistryProvider anywhere above StudioLandingPage to\n// override the auto-registered list (e.g. async / runtime route lists).\n\nconst SolidLayoutRegistryContext = createContext<SolidLayoutEntry[] | null>(null);\n\n// ── Helpers ───────────────────────────────────────────────────────────────────\n\nfunction pathToTitle(path: string): string {\n return (\n path\n .replace(/^\\//, \"\")\n .split(/[-_/]/)\n .filter(Boolean)\n .map((w) => w.charAt(0).toUpperCase() + w.slice(1))\n .join(\" \") || path\n );\n}\n\n/**\n * Walk a route tree and return the first concrete relative or absolute path found.\n * Skips index routes (they render at the parent path) and pathless wrappers\n * (guards, layout wrappers) by looking inside their children recursively.\n */\nfunction findFirstConcretePath(children: RouteObject[]): string | undefined {\n // 1. FIRST PASS → prioritize index (including inside pathless wrappers)\n for (const child of children) {\n if ((child as any).index || child.path === \"\") {\n return \"\";\n }\n // Deep check for pathless wrappers in the first pass too\n if (!child.path && child.children?.length) {\n const nested = findFirstConcretePath(child.children);\n if (nested === \"\") return \"\";\n }\n }\n\n // 2. SECOND PASS → find first path\n for (const child of children) {\n if (child.path) return child.path;\n\n if (child.children?.length) {\n const nested = findFirstConcretePath(child.children);\n if (nested !== undefined) return nested;\n }\n }\n\n return undefined;\n}\nfunction resolveFirstChildTo(basePath: string, children: RouteObject[]): string {\n const concretePath = findFirstConcretePath(children);\n if (concretePath === undefined || concretePath === \"\") return basePath;\n if (concretePath.startsWith(\"/\")) return concretePath;\n return `${basePath.replace(/\\/$/, \"\")}/${concretePath}`;\n}\n\nfunction inferPathFromChildren(children: RouteObject[]): string | undefined {\n for (const child of children) {\n // Absolute path → use root\n if (child.path?.startsWith(\"/\")) {\n const root = child.path.split(\"/\").filter(Boolean)[0];\n // return root ? `/${root}` : undefined;\n // treat absolute path with no segments as home..\n return root ? `/${root}` : 'home'; \n }\n\n // Relative path → use first segment\n if (child.path) {\n const root = child.path.split(\"/\")[0];\n return root ? `/${root}` : undefined;\n }\n\n // Nested\n if (child.children?.length) {\n const nested = inferPathFromChildren(child.children);\n if (nested) return nested;\n }\n }\n\n return undefined;\n}\n\nfunction extractLayouts(routes: RouteObject[]): SolidLayoutEntry[] {\n const layouts: SolidLayoutEntry[] = [];\n const seen = new Set<string>();\n\n for (const route of routes) {\n // ✅ Use explicit path OR infer from children\n const basePath =\n route.path ??\n (route.children?.length\n ? inferPathFromChildren(route.children)\n : undefined);\n\n if (!basePath || seen.has(basePath)) continue;\n\n const handle = route.handle as SolidLayoutHandle | undefined;\n\n const to = route.children?.length\n ? resolveFirstChildTo(basePath, route.children)\n : basePath;\n\n layouts.push({\n path: basePath,\n title: handle?.title ?? pathToTitle(basePath),\n description: handle?.description,\n to,\n });\n\n seen.add(basePath);\n }\n\n return layouts;\n}\n// ── Provider (optional override) ──────────────────────────────────────────────\n\n/**\n * Optional — most apps do NOT need this.\n * Use only when you need to override the auto-registered list at runtime.\n */\nexport function SolidLayoutRegistryProvider({\n routes,\n children,\n}: {\n routes: RouteObject[];\n children: ReactNode;\n}) {\n const layouts = useMemo(() => extractLayouts(routes), [routes]);\n return (\n <SolidLayoutRegistryContext.Provider value={layouts}>\n {children}\n </SolidLayoutRegistryContext.Provider>\n );\n}\n\n\n\n// ── Hook ──────────────────────────────────────────────────────────────────────\n\n/**\n * Returns the registered layout entries.\n *\n * Priority order:\n * 1. SolidLayoutRegistryProvider context (if mounted)\n * 2. Routes auto-registered when getSolidRoutes({ extraRoutes }) was called\n */\nexport function useSolidLayoutRegistry(): SolidLayoutEntry[] {\n const contextLayouts = useContext(SolidLayoutRegistryContext);\n if (contextLayouts !== null) return contextLayouts;\n return extractLayouts(_autoRoutes);\n}\n"]}
|
|
@@ -106,7 +106,9 @@ function inferPathFromChildren(children: RouteObject[]): string | undefined {
|
|
|
106
106
|
// Absolute path → use root
|
|
107
107
|
if (child.path?.startsWith("/")) {
|
|
108
108
|
const root = child.path.split("/").filter(Boolean)[0];
|
|
109
|
-
return root ? `/${root}` : undefined;
|
|
109
|
+
// return root ? `/${root}` : undefined;
|
|
110
|
+
// treat absolute path with no segments as home..
|
|
111
|
+
return root ? `/${root}` : 'home';
|
|
110
112
|
}
|
|
111
113
|
|
|
112
114
|
// Relative path → use first segment
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AuthGuard.d.ts","sourceRoot":"","sources":["../../../src/routes/guards/AuthGuard.tsx"],"names":[],"mappings":"AAGA,KAAK,cAAc,GAAG;IACpB,aAAa,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,MAAM,CAAC;CAC9C,CAAC;AAEF,wBAAgB,SAAS,CAAC,EAAE,aAAa,EAAE,EAAE,cAAc,
|
|
1
|
+
{"version":3,"file":"AuthGuard.d.ts","sourceRoot":"","sources":["../../../src/routes/guards/AuthGuard.tsx"],"names":[],"mappings":"AAGA,KAAK,cAAc,GAAG;IACpB,aAAa,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,MAAM,CAAC;CAC9C,CAAC;AAEF,wBAAgB,SAAS,CAAC,EAAE,aAAa,EAAE,EAAE,cAAc,2CAsC1D"}
|
|
@@ -10,8 +10,11 @@ export function AuthGuard(_a) {
|
|
|
10
10
|
if (segments.length === 0)
|
|
11
11
|
return "/auth/login";
|
|
12
12
|
var base = segments[0];
|
|
13
|
-
|
|
13
|
+
// routes that should NOT be treated as tenant
|
|
14
|
+
var systemRoutes = ["admin", "auth"];
|
|
15
|
+
if (systemRoutes.includes(base)) {
|
|
14
16
|
return "/auth/login";
|
|
17
|
+
}
|
|
15
18
|
return "/".concat(base, "/auth/login");
|
|
16
19
|
};
|
|
17
20
|
var resolveLoginRoute = getLoginRoute || defaultGetLoginRoute;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AuthGuard.js","sourceRoot":"","sources":["../../../src/routes/guards/AuthGuard.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAA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AAE,MAAM,CAAC,CAAC;QAEvC,IAAI,YAAY,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE;YAC/B,OAAO,aAAa,CAAC;SACtB;QAED,OAAO,WAAI,IAAI,gBAAa,CAAC;IAC/B,CAAC,CAAC;IAEF,IAAM,iBAAiB,GAAG,aAAa,IAAI,oBAAoB,CAAC;IAEhE,IAAI,MAAM,KAAK,SAAS,EAAE;QACxB,OAAO,uCAAqB,CAAC;KAC9B;IAED,IAAI,MAAM,KAAK,iBAAiB,EAAE;QAChC,OAAO,CACL,KAAC,QAAQ,IACP,EAAE,EAAE,iBAAiB,CAAC,QAAQ,CAAC,QAAQ,CAAC,EACxC,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EACzB,OAAO,SACP,CACH,CAAC;KACH;IAED,OAAO,KAAC,MAAM,KAAG,CAAC;AACpB,CAAC","sourcesContent":["import { Navigate, Outlet, useLocation } from \"react-router-dom\";\nimport { useSession } from \"../../hooks/useSession\";\n\ntype AuthGuardProps = {\n getLoginRoute?: (pathname: string) => string;\n};\n\nexport function AuthGuard({ getLoginRoute }: AuthGuardProps) {\n const location = useLocation();\n const { status } = useSession();\n\n const defaultGetLoginRoute = (pathname: string) => {\n const segments = pathname.split(\"/\").filter(Boolean);\n\n if (segments.length === 0) return \"/auth/login\";\n\n const base = segments[0];\n\n // routes that should NOT be treated as tenant\n const systemRoutes = [\"admin\", \"auth\"];\n\n if (systemRoutes.includes(base)) {\n return \"/auth/login\";\n }\n\n return `/${base}/auth/login`;\n };\n\n const resolveLoginRoute = getLoginRoute || defaultGetLoginRoute;\n\n if (status === \"loading\") {\n return <div>Loading...</div>;\n }\n\n if (status === \"unauthenticated\") {\n return (\n <Navigate\n to={resolveLoginRoute(location.pathname)}\n state={{ from: location }}\n replace\n />\n );\n }\n\n return <Outlet />;\n}"]}
|
|
@@ -16,7 +16,12 @@ export function AuthGuard({ getLoginRoute }: AuthGuardProps) {
|
|
|
16
16
|
|
|
17
17
|
const base = segments[0];
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
// routes that should NOT be treated as tenant
|
|
20
|
+
const systemRoutes = ["admin", "auth"];
|
|
21
|
+
|
|
22
|
+
if (systemRoutes.includes(base)) {
|
|
23
|
+
return "/auth/login";
|
|
24
|
+
}
|
|
20
25
|
|
|
21
26
|
return `/${base}/auth/login`;
|
|
22
27
|
};
|