@cedros/login-react 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +142 -2
- package/dist/AuthenticationSettings-CMQhep61.js +9 -0
- package/dist/AuthenticationSettings-CMQhep61.js.map +1 -0
- package/dist/AuthenticationSettings-Cro76kIC.cjs +1 -0
- package/dist/AuthenticationSettings-Cro76kIC.cjs.map +1 -0
- package/dist/CreditSystemSettings-AM7qDk1E.js +9 -0
- package/dist/CreditSystemSettings-AM7qDk1E.js.map +1 -0
- package/dist/CreditSystemSettings-CGR-uzuh.cjs +1 -0
- package/dist/CreditSystemSettings-CGR-uzuh.cjs.map +1 -0
- package/dist/DepositsSection-BVNd63B7.js +47 -0
- package/dist/DepositsSection-BVNd63B7.js.map +1 -0
- package/dist/DepositsSection-Ct1gjgIg.cjs +1 -0
- package/dist/DepositsSection-Ct1gjgIg.cjs.map +1 -0
- package/dist/EmailRegisterForm-B-ys4E3C.cjs +1 -0
- package/dist/EmailRegisterForm-B-ys4E3C.cjs.map +1 -0
- package/dist/EmailRegisterForm-BChCiZ5B.js +961 -0
- package/dist/EmailRegisterForm-BChCiZ5B.js.map +1 -0
- package/dist/EmailSettings-DFZ13JbX.cjs +1 -0
- package/dist/EmailSettings-DFZ13JbX.cjs.map +1 -0
- package/dist/EmailSettings-Di4GSWgb.js +9 -0
- package/dist/EmailSettings-Di4GSWgb.js.map +1 -0
- package/dist/EmbeddedWalletSettings-Cmn_aVL7.js +9 -0
- package/dist/EmbeddedWalletSettings-Cmn_aVL7.js.map +1 -0
- package/dist/EmbeddedWalletSettings-DRWeIJKb.cjs +1 -0
- package/dist/EmbeddedWalletSettings-DRWeIJKb.cjs.map +1 -0
- package/dist/{ErrorMessage-Bm1j5mBT.js → ErrorMessage-C8vKB0JG.js} +9 -9
- package/dist/ErrorMessage-C8vKB0JG.js.map +1 -0
- package/dist/ErrorMessage-CntMyn93.cjs.map +1 -1
- package/dist/{GoogleLoginButton-CvDoOc-0.js → GoogleLoginButton-Ceo2sYvX.js} +1 -1
- package/dist/{GoogleLoginButton-CvDoOc-0.js.map → GoogleLoginButton-Ceo2sYvX.js.map} +1 -1
- package/dist/ServerSettings-D8w8EpoE.cjs +1 -0
- package/dist/ServerSettings-D8w8EpoE.cjs.map +1 -0
- package/dist/ServerSettings-Wg_odW46.js +9 -0
- package/dist/ServerSettings-Wg_odW46.js.map +1 -0
- package/dist/{SolanaLoginButton-h32xN2PQ.js → SolanaLoginButton-CqVOcPa7.js} +1 -1
- package/dist/{SolanaLoginButton-h32xN2PQ.js.map → SolanaLoginButton-CqVOcPa7.js.map} +1 -1
- package/dist/TeamSection-Bj89WSC0.js +128 -0
- package/dist/TeamSection-Bj89WSC0.js.map +1 -0
- package/dist/TeamSection-DQ4nfUHN.cjs +1 -0
- package/dist/TeamSection-DQ4nfUHN.cjs.map +1 -0
- package/dist/UsersSection-BiZceDV3.cjs +1 -0
- package/dist/UsersSection-BiZceDV3.cjs.map +1 -0
- package/dist/UsersSection-W19ddPsw.js +81 -0
- package/dist/UsersSection-W19ddPsw.js.map +1 -0
- package/dist/WebhookSettings-a1c4iMvr.js +9 -0
- package/dist/WebhookSettings-a1c4iMvr.js.map +1 -0
- package/dist/WebhookSettings-onJWLytD.cjs +1 -0
- package/dist/WebhookSettings-onJWLytD.cjs.map +1 -0
- package/dist/WithdrawalsSection-BBw9gWMR.js +20 -0
- package/dist/WithdrawalsSection-BBw9gWMR.js.map +1 -0
- package/dist/WithdrawalsSection-Cws8inf6.cjs +1 -0
- package/dist/WithdrawalsSection-Cws8inf6.cjs.map +1 -0
- package/dist/admin/AdminShell.d.ts +38 -0
- package/dist/admin/icons.d.ts +2 -0
- package/dist/admin/index.d.ts +10 -0
- package/dist/admin/plugin.d.ts +3 -0
- package/dist/admin/sections/AuthenticationSettings.d.ts +3 -0
- package/dist/admin/sections/CreditSystemSettings.d.ts +3 -0
- package/dist/admin/sections/DepositsSection.d.ts +3 -0
- package/dist/admin/sections/EmailSettings.d.ts +3 -0
- package/dist/admin/sections/EmbeddedWalletSettings.d.ts +3 -0
- package/dist/admin/sections/FeatureSettings.d.ts +3 -0
- package/dist/admin/sections/InvitesSection.d.ts +3 -0
- package/dist/admin/sections/MembersSection.d.ts +3 -0
- package/dist/admin/sections/ServerSettings.d.ts +3 -0
- package/dist/admin/sections/SettingsSections.d.ts +7 -0
- package/dist/admin/sections/TeamSection.d.ts +3 -0
- package/dist/admin/sections/UsersSection.d.ts +3 -0
- package/dist/admin/sections/WebhookSettings.d.ts +3 -0
- package/dist/admin/sections/WithdrawalsSection.d.ts +3 -0
- package/dist/admin/types.d.ts +167 -0
- package/dist/components/admin/AdminUserDetail.d.ts +3 -1
- package/dist/components/admin/AdminUserList.d.ts +3 -7
- package/dist/components/admin/CedrosAdminDashboard.d.ts +7 -3
- package/dist/components/admin/PermissionsSection.d.ts +7 -0
- package/dist/components/admin/ProfileDropdown.d.ts +34 -0
- package/dist/components/admin/SetupWizard.d.ts +30 -0
- package/dist/components/admin/StatsBar.d.ts +17 -0
- package/dist/components/admin/settings/AuthenticationSettings.d.ts +4 -0
- package/dist/components/admin/settings/AutosaveStatus.d.ts +6 -0
- package/dist/components/admin/settings/CreditSystemSettings.d.ts +6 -0
- package/dist/components/admin/settings/EmailSettings.d.ts +4 -0
- package/dist/components/admin/settings/EmbeddedWalletSettings.d.ts +4 -0
- package/dist/components/admin/settings/FeatureSettings.d.ts +4 -0
- package/dist/components/admin/settings/MessagingSettings.d.ts +4 -0
- package/dist/components/admin/settings/SecuritySettings.d.ts +4 -0
- package/dist/components/admin/settings/ServerSettings.d.ts +4 -0
- package/dist/components/admin/settings/SettingsPageLayout.d.ts +16 -0
- package/dist/components/admin/settings/SsoProvidersSettings.d.ts +4 -0
- package/dist/components/admin/settings/WebhookSettings.d.ts +4 -0
- package/dist/components/admin/settings/index.d.ts +31 -0
- package/dist/components/admin/settings/settingsInputs.d.ts +79 -0
- package/dist/components/admin/settings/settingsMetadata.d.ts +18 -0
- package/dist/components/deposit/admin/AdminWithdrawalStats.d.ts +10 -0
- package/dist/components/deposit/admin/FeatureDisabledMessage.d.ts +15 -0
- package/dist/components/deposit/admin/featureDisabled.d.ts +9 -0
- package/dist/components/deposit/admin/index.d.ts +5 -0
- package/dist/components/invites/InviteForm.d.ts +1 -1
- package/dist/components/org/OrgSelector.d.ts +2 -1
- package/dist/components/profile/UserProfileSettings.d.ts +35 -0
- package/dist/components/profile/index.d.ts +2 -0
- package/dist/crypto/secureWipe.d.ts +0 -19
- package/dist/crypto/webauthnPrf.d.ts +0 -10
- package/dist/email-only.cjs +1 -1
- package/dist/email-only.js +2 -2
- package/dist/google-only.js +2 -2
- package/dist/hooks/useDashboardPermissions.d.ts +45 -0
- package/dist/hooks/useProfile.d.ts +35 -0
- package/dist/hooks/useServerFeatures.d.ts +55 -0
- package/dist/hooks/useSettingsAutosave.d.ts +29 -0
- package/dist/hooks/useSetup.d.ts +25 -0
- package/dist/hooks/useSsoProviders.d.ts +52 -0
- package/dist/index-BHR_WTP2.js +19636 -0
- package/dist/index-BHR_WTP2.js.map +1 -0
- package/dist/index-JsIJkPin.cjs +2061 -0
- package/dist/index-JsIJkPin.cjs.map +1 -0
- package/dist/index.cjs +1 -2061
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +21 -3
- package/dist/index.js +117 -14908
- package/dist/index.js.map +1 -1
- package/dist/login-react.css +1 -1
- package/dist/silentWalletEnroll-CQK5i65l.js +42 -0
- package/dist/silentWalletEnroll-CQK5i65l.js.map +1 -0
- package/dist/silentWalletEnroll-DBfS2sLe.cjs +1 -0
- package/dist/silentWalletEnroll-DBfS2sLe.cjs.map +1 -0
- package/dist/solana-only.js +2 -2
- package/dist/solanaKeypair-BD7Kq1Mw.js +1932 -0
- package/dist/solanaKeypair-BD7Kq1Mw.js.map +1 -0
- package/dist/solanaKeypair-CBQxm2hw.cjs +1 -0
- package/dist/solanaKeypair-CBQxm2hw.cjs.map +1 -0
- package/dist/types/adminUser.d.ts +56 -0
- package/dist/types/deposit.d.ts +2 -0
- package/dist/types/index.d.ts +4 -2
- package/dist/types/org.d.ts +34 -2
- package/dist/types/profile.d.ts +56 -0
- package/dist/types/setup.d.ts +45 -0
- package/dist/types/systemSettings.d.ts +5 -1
- package/dist/utils/adminUserApi.d.ts +10 -1
- package/dist/utils/profileApi.d.ts +26 -0
- package/dist/utils/setupApi.d.ts +21 -0
- package/package.json +1 -1
- package/dist/EmailRegisterForm-D_uCEdX9.cjs +0 -1
- package/dist/EmailRegisterForm-D_uCEdX9.cjs.map +0 -1
- package/dist/EmailRegisterForm-m3rX3A6X.js +0 -2923
- package/dist/EmailRegisterForm-m3rX3A6X.js.map +0 -1
- package/dist/ErrorMessage-Bm1j5mBT.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WebhookSettings-a1c4iMvr.js","sources":["../src/admin/sections/WebhookSettings.tsx"],"sourcesContent":["/**\n * Webhook Settings Section - Plugin wrapper\n */\n\nimport React from 'react';\nimport type { AdminSectionProps } from '../types';\nimport { WebhookSettings as Settings } from '../../components/admin/settings';\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport default function WebhookSettings(_props: AdminSectionProps): React.JSX.Element {\n return (\n <div className=\"cedros-dashboard__section\">\n <Settings />\n </div>\n );\n}\n"],"names":["WebhookSettings","_props","jsx","Settings"],"mappings":";;;AASA,SAAwBA,EAAgBC,GAA8C;AACpF,2BACG,OAAA,EAAI,WAAU,6BACb,UAAA,gBAAAC,EAACC,KAAS,GACZ;AAEJ;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime");require("react");const t=require("./index-JsIJkPin.cjs");function r(o){return e.jsx("div",{className:"cedros-dashboard__section",children:e.jsx(t.WebhookSettings,{})})}exports.default=r;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WebhookSettings-onJWLytD.cjs","sources":["../src/admin/sections/WebhookSettings.tsx"],"sourcesContent":["/**\n * Webhook Settings Section - Plugin wrapper\n */\n\nimport React from 'react';\nimport type { AdminSectionProps } from '../types';\nimport { WebhookSettings as Settings } from '../../components/admin/settings';\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport default function WebhookSettings(_props: AdminSectionProps): React.JSX.Element {\n return (\n <div className=\"cedros-dashboard__section\">\n <Settings />\n </div>\n );\n}\n"],"names":["WebhookSettings","_props","jsx","Settings"],"mappings":"8KASA,SAAwBA,EAAgBC,EAA8C,CACpF,aACG,MAAA,CAAI,UAAU,4BACb,SAAAC,MAACC,EAAAA,kBAAS,EACZ,CAEJ"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsxs as s, jsx as d } from "react/jsx-runtime";
|
|
2
|
+
import "react";
|
|
3
|
+
import { i as r, j as o, k as t, l as e } from "./index-BHR_WTP2.js";
|
|
4
|
+
function p({
|
|
5
|
+
pageSize: i = 20,
|
|
6
|
+
refreshInterval: a = 0
|
|
7
|
+
}) {
|
|
8
|
+
return /* @__PURE__ */ s("div", { className: "cedros-dashboard__withdrawals", children: [
|
|
9
|
+
/* @__PURE__ */ d(r, { refreshInterval: a }),
|
|
10
|
+
/* @__PURE__ */ d("p", { className: "cedros-dashboard__text-muted", children: "Track deposits through the withdrawal pipeline: privacy period, ready for processing, and completed." }),
|
|
11
|
+
/* @__PURE__ */ s("div", { className: "cedros-dashboard__pipeline", children: [
|
|
12
|
+
/* @__PURE__ */ d(o, { pageSize: i, refreshInterval: a }),
|
|
13
|
+
/* @__PURE__ */ d(t, { pageSize: i, refreshInterval: a }),
|
|
14
|
+
/* @__PURE__ */ d(e, { pageSize: i, refreshInterval: a })
|
|
15
|
+
] })
|
|
16
|
+
] });
|
|
17
|
+
}
|
|
18
|
+
export {
|
|
19
|
+
p as default
|
|
20
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WithdrawalsSection-BBw9gWMR.js","sources":["../src/admin/sections/WithdrawalsSection.tsx"],"sourcesContent":["/**\n * Withdrawals Section - Plugin wrapper\n *\n * Admin withdrawal pipeline: privacy period, queue, and history.\n */\n\nimport React from 'react';\nimport type { AdminSectionProps } from '../types';\nimport {\n AdminPrivacyPeriodDeposits,\n AdminWithdrawalQueue,\n AdminWithdrawalHistory,\n AdminWithdrawalStats,\n} from '../../components/deposit/admin';\n\nexport default function WithdrawalsSection({\n pageSize = 20,\n refreshInterval = 0,\n}: AdminSectionProps): React.JSX.Element {\n return (\n <div className=\"cedros-dashboard__withdrawals\">\n <AdminWithdrawalStats refreshInterval={refreshInterval} />\n <p className=\"cedros-dashboard__text-muted\">\n Track deposits through the withdrawal pipeline: privacy period, ready for processing, and\n completed.\n </p>\n\n {/* Pipeline view: Privacy Period -> Ready -> Completed */}\n <div className=\"cedros-dashboard__pipeline\">\n <AdminPrivacyPeriodDeposits pageSize={pageSize} refreshInterval={refreshInterval} />\n <AdminWithdrawalQueue pageSize={pageSize} refreshInterval={refreshInterval} />\n <AdminWithdrawalHistory pageSize={pageSize} refreshInterval={refreshInterval} />\n </div>\n </div>\n );\n}\n"],"names":["WithdrawalsSection","pageSize","refreshInterval","jsxs","jsx","AdminWithdrawalStats","AdminPrivacyPeriodDeposits","AdminWithdrawalQueue","AdminWithdrawalHistory"],"mappings":";;;AAeA,SAAwBA,EAAmB;AAAA,EACzC,UAAAC,IAAW;AAAA,EACX,iBAAAC,IAAkB;AACpB,GAAyC;AACvC,SACE,gBAAAC,EAAC,OAAA,EAAI,WAAU,iCACb,UAAA;AAAA,IAAA,gBAAAC,EAACC,KAAqB,iBAAAH,GAAkC;AAAA,IACxD,gBAAAE,EAAC,KAAA,EAAE,WAAU,gCAA+B,UAAA,wGAG5C;AAAA,IAGA,gBAAAD,EAAC,OAAA,EAAI,WAAU,8BACb,UAAA;AAAA,MAAA,gBAAAC,EAACE,GAAA,EAA2B,UAAAL,GAAoB,iBAAAC,EAAA,CAAkC;AAAA,MAClF,gBAAAE,EAACG,GAAA,EAAqB,UAAAN,GAAoB,iBAAAC,EAAA,CAAkC;AAAA,MAC5E,gBAAAE,EAACI,GAAA,EAAuB,UAAAP,GAAoB,iBAAAC,EAAA,CAAkC;AAAA,IAAA,EAAA,CAChF;AAAA,EAAA,GACF;AAEJ;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("react/jsx-runtime");require("react");const s=require("./index-JsIJkPin.cjs");function a({pageSize:e=20,refreshInterval:i=0}){return d.jsxs("div",{className:"cedros-dashboard__withdrawals",children:[d.jsx(s.AdminWithdrawalStats,{refreshInterval:i}),d.jsx("p",{className:"cedros-dashboard__text-muted",children:"Track deposits through the withdrawal pipeline: privacy period, ready for processing, and completed."}),d.jsxs("div",{className:"cedros-dashboard__pipeline",children:[d.jsx(s.AdminPrivacyPeriodDeposits,{pageSize:e,refreshInterval:i}),d.jsx(s.AdminWithdrawalQueue,{pageSize:e,refreshInterval:i}),d.jsx(s.AdminWithdrawalHistory,{pageSize:e,refreshInterval:i})]})]})}exports.default=a;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WithdrawalsSection-Cws8inf6.cjs","sources":["../src/admin/sections/WithdrawalsSection.tsx"],"sourcesContent":["/**\n * Withdrawals Section - Plugin wrapper\n *\n * Admin withdrawal pipeline: privacy period, queue, and history.\n */\n\nimport React from 'react';\nimport type { AdminSectionProps } from '../types';\nimport {\n AdminPrivacyPeriodDeposits,\n AdminWithdrawalQueue,\n AdminWithdrawalHistory,\n AdminWithdrawalStats,\n} from '../../components/deposit/admin';\n\nexport default function WithdrawalsSection({\n pageSize = 20,\n refreshInterval = 0,\n}: AdminSectionProps): React.JSX.Element {\n return (\n <div className=\"cedros-dashboard__withdrawals\">\n <AdminWithdrawalStats refreshInterval={refreshInterval} />\n <p className=\"cedros-dashboard__text-muted\">\n Track deposits through the withdrawal pipeline: privacy period, ready for processing, and\n completed.\n </p>\n\n {/* Pipeline view: Privacy Period -> Ready -> Completed */}\n <div className=\"cedros-dashboard__pipeline\">\n <AdminPrivacyPeriodDeposits pageSize={pageSize} refreshInterval={refreshInterval} />\n <AdminWithdrawalQueue pageSize={pageSize} refreshInterval={refreshInterval} />\n <AdminWithdrawalHistory pageSize={pageSize} refreshInterval={refreshInterval} />\n </div>\n </div>\n );\n}\n"],"names":["WithdrawalsSection","pageSize","refreshInterval","jsxs","jsx","AdminWithdrawalStats","AdminPrivacyPeriodDeposits","AdminWithdrawalQueue","AdminWithdrawalHistory"],"mappings":"8KAeA,SAAwBA,EAAmB,CACzC,SAAAC,EAAW,GACX,gBAAAC,EAAkB,CACpB,EAAyC,CACvC,OACEC,EAAAA,KAAC,MAAA,CAAI,UAAU,gCACb,SAAA,CAAAC,MAACC,EAAAA,sBAAqB,gBAAAH,EAAkC,EACxDE,EAAAA,IAAC,IAAA,CAAE,UAAU,+BAA+B,SAAA,uGAG5C,EAGAD,EAAAA,KAAC,MAAA,CAAI,UAAU,6BACb,SAAA,CAAAC,EAAAA,IAACE,EAAAA,2BAAA,CAA2B,SAAAL,EAAoB,gBAAAC,CAAA,CAAkC,EAClFE,EAAAA,IAACG,EAAAA,qBAAA,CAAqB,SAAAN,EAAoB,gBAAAC,CAAA,CAAkC,EAC5EE,EAAAA,IAACI,EAAAA,uBAAA,CAAuB,SAAAP,EAAoB,gBAAAC,CAAA,CAAkC,CAAA,CAAA,CAChF,CAAA,EACF,CAEJ"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { default as React, ReactNode } from 'react';
|
|
2
|
+
import { AdminPlugin, PluginRegistry, HostContext, QualifiedSectionId, PluginContext } from './types';
|
|
3
|
+
interface AdminShellContextValue {
|
|
4
|
+
registry: PluginRegistry;
|
|
5
|
+
hostContext: HostContext;
|
|
6
|
+
activeSection: QualifiedSectionId | null;
|
|
7
|
+
setActiveSection: (section: QualifiedSectionId) => void;
|
|
8
|
+
getPluginContext: (pluginId: string) => PluginContext | null;
|
|
9
|
+
}
|
|
10
|
+
export declare function useAdminShell(): AdminShellContextValue;
|
|
11
|
+
export interface AdminShellProps {
|
|
12
|
+
/** Dashboard title */
|
|
13
|
+
title?: string;
|
|
14
|
+
/** Plugins to load */
|
|
15
|
+
plugins?: AdminPlugin[];
|
|
16
|
+
/** Host context from parent providers */
|
|
17
|
+
hostContext: HostContext;
|
|
18
|
+
/** Default active section (qualified ID) */
|
|
19
|
+
defaultSection?: QualifiedSectionId;
|
|
20
|
+
/** Page size for lists */
|
|
21
|
+
pageSize?: number;
|
|
22
|
+
/** Refresh interval in ms (0 to disable) */
|
|
23
|
+
refreshInterval?: number;
|
|
24
|
+
/** Callback when section changes */
|
|
25
|
+
onSectionChange?: (section: QualifiedSectionId) => void;
|
|
26
|
+
/** Custom logo/header content */
|
|
27
|
+
logo?: ReactNode;
|
|
28
|
+
/** Additional sidebar footer content */
|
|
29
|
+
sidebarFooter?: ReactNode;
|
|
30
|
+
/** Callback when user clicks Settings in profile dropdown */
|
|
31
|
+
onSettingsClick?: () => void;
|
|
32
|
+
/** Callback when user clicks Logout in profile dropdown */
|
|
33
|
+
onLogoutClick?: () => void;
|
|
34
|
+
/** Additional CSS class */
|
|
35
|
+
className?: string;
|
|
36
|
+
}
|
|
37
|
+
export declare function AdminShell({ title, plugins: initialPlugins, hostContext, defaultSection, pageSize, refreshInterval, onSectionChange, logo, sidebarFooter, onSettingsClick, onLogoutClick, className, }: AdminShellProps): React.JSX.Element;
|
|
38
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Admin Plugin Module
|
|
3
|
+
*
|
|
4
|
+
* Exports for the unified admin dashboard plugin system.
|
|
5
|
+
*/
|
|
6
|
+
export { AdminShell, useAdminShell } from './AdminShell';
|
|
7
|
+
export type { AdminShellProps } from './AdminShell';
|
|
8
|
+
export type { AdminPlugin, AdminSectionConfig, AdminGroupConfig, AdminSectionProps, PluginContext, HostContext, PluginRegistry, PluginId, SectionId, QualifiedSectionId, PluginPermission, ResolvedSection, } from './types';
|
|
9
|
+
export { cedrosLoginPlugin, loginPlugin } from './plugin';
|
|
10
|
+
export { Icons } from './icons';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { AdminSectionProps } from '../types';
|
|
3
|
+
export declare function SettingsAuthSection(_: AdminSectionProps): React.JSX.Element;
|
|
4
|
+
export declare function SettingsWalletSection(_: AdminSectionProps): React.JSX.Element;
|
|
5
|
+
export declare function SettingsMessagingSection(_: AdminSectionProps): React.JSX.Element;
|
|
6
|
+
export declare function SettingsCreditsSection(_: AdminSectionProps): React.JSX.Element;
|
|
7
|
+
export declare function SettingsServerSection(_: AdminSectionProps): React.JSX.Element;
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import { ReactNode, ComponentType } from 'react';
|
|
2
|
+
/** Unique identifier for a plugin */
|
|
3
|
+
export type PluginId = string;
|
|
4
|
+
/** Section identifier, unique within a plugin */
|
|
5
|
+
export type SectionId = string;
|
|
6
|
+
/** Fully qualified section ID: `pluginId:sectionId` */
|
|
7
|
+
export type QualifiedSectionId = `${PluginId}:${SectionId}`;
|
|
8
|
+
/** Permission identifier for capability checking */
|
|
9
|
+
export type PluginPermission = string;
|
|
10
|
+
/**
|
|
11
|
+
* Section configuration for sidebar navigation.
|
|
12
|
+
*/
|
|
13
|
+
export interface AdminSectionConfig {
|
|
14
|
+
/** Section ID unique within the plugin */
|
|
15
|
+
id: SectionId;
|
|
16
|
+
/** Display label for sidebar */
|
|
17
|
+
label: string;
|
|
18
|
+
/** React node for the icon (SVG or component) */
|
|
19
|
+
icon: ReactNode;
|
|
20
|
+
/** Sidebar group name for visual organization */
|
|
21
|
+
group?: string;
|
|
22
|
+
/** Sort order within group (lower = higher) */
|
|
23
|
+
order?: number;
|
|
24
|
+
/** Permission required to see this section */
|
|
25
|
+
requiredPermission?: PluginPermission;
|
|
26
|
+
/** Badge content (e.g., notification count) */
|
|
27
|
+
badge?: ReactNode;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Group configuration for sidebar organization.
|
|
31
|
+
*/
|
|
32
|
+
export interface AdminGroupConfig {
|
|
33
|
+
/** Group identifier */
|
|
34
|
+
id: string;
|
|
35
|
+
/** Display label */
|
|
36
|
+
label: string;
|
|
37
|
+
/** Sort order (lower = higher in sidebar) */
|
|
38
|
+
order: number;
|
|
39
|
+
/** Icon for the group header */
|
|
40
|
+
icon?: ReactNode;
|
|
41
|
+
/** Whether group starts collapsed */
|
|
42
|
+
defaultCollapsed?: boolean;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Props passed to section components by AdminShell.
|
|
46
|
+
*/
|
|
47
|
+
export interface AdminSectionProps {
|
|
48
|
+
/** Plugin context with auth and API access */
|
|
49
|
+
pluginContext: PluginContext;
|
|
50
|
+
/** Page size for lists */
|
|
51
|
+
pageSize: number;
|
|
52
|
+
/** Refresh interval for auto-updating data (0 = disabled) */
|
|
53
|
+
refreshInterval: number;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Context provided to each plugin's section components.
|
|
57
|
+
*/
|
|
58
|
+
export interface PluginContext {
|
|
59
|
+
/** Server URL for API calls */
|
|
60
|
+
serverUrl: string;
|
|
61
|
+
/** Current authenticated user ID (if any) */
|
|
62
|
+
userId?: string;
|
|
63
|
+
/** Function to get current access token */
|
|
64
|
+
getAccessToken: () => string | null;
|
|
65
|
+
/** Permission check function */
|
|
66
|
+
hasPermission: (permission: PluginPermission) => boolean;
|
|
67
|
+
/** Current organization ID (if applicable) */
|
|
68
|
+
orgId?: string;
|
|
69
|
+
/** Plugin-specific context data */
|
|
70
|
+
pluginData?: Record<string, unknown>;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Host context provided by AdminShell to plugins.
|
|
74
|
+
* Aggregates auth/context from all available sources.
|
|
75
|
+
*/
|
|
76
|
+
export interface HostContext {
|
|
77
|
+
/** cedros-login context */
|
|
78
|
+
cedrosLogin?: {
|
|
79
|
+
user: {
|
|
80
|
+
id: string;
|
|
81
|
+
email?: string;
|
|
82
|
+
name?: string;
|
|
83
|
+
picture?: string;
|
|
84
|
+
} | null;
|
|
85
|
+
getAccessToken: () => string | null;
|
|
86
|
+
serverUrl: string;
|
|
87
|
+
};
|
|
88
|
+
/** cedros-pay context */
|
|
89
|
+
cedrosPay?: {
|
|
90
|
+
walletAddress?: string;
|
|
91
|
+
jwtToken?: string;
|
|
92
|
+
serverUrl: string;
|
|
93
|
+
};
|
|
94
|
+
/** Organization context */
|
|
95
|
+
org?: {
|
|
96
|
+
orgId: string;
|
|
97
|
+
role: string;
|
|
98
|
+
permissions: string[];
|
|
99
|
+
};
|
|
100
|
+
/**
|
|
101
|
+
* Dashboard section permissions (configured by org owner).
|
|
102
|
+
* Provides role-based access control for individual dashboard sections.
|
|
103
|
+
*/
|
|
104
|
+
dashboardPermissions?: {
|
|
105
|
+
/** Check if current user can access a section by ID */
|
|
106
|
+
canAccess: (sectionId: string) => boolean;
|
|
107
|
+
};
|
|
108
|
+
/** Generic extension point */
|
|
109
|
+
custom?: Record<string, unknown>;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Plugin definition - the main export from each admin module.
|
|
113
|
+
*/
|
|
114
|
+
export interface AdminPlugin {
|
|
115
|
+
/** Unique plugin identifier */
|
|
116
|
+
id: PluginId;
|
|
117
|
+
/** Display name for the plugin */
|
|
118
|
+
name: string;
|
|
119
|
+
/** Plugin version (semver) */
|
|
120
|
+
version: string;
|
|
121
|
+
/** Sections this plugin contributes */
|
|
122
|
+
sections: AdminSectionConfig[];
|
|
123
|
+
/** Sidebar groups with display order */
|
|
124
|
+
groups?: AdminGroupConfig[];
|
|
125
|
+
/** Map of section ID to component */
|
|
126
|
+
components: Record<SectionId, ComponentType<AdminSectionProps>>;
|
|
127
|
+
/**
|
|
128
|
+
* Context bridge - converts host context to plugin-specific context.
|
|
129
|
+
*/
|
|
130
|
+
createPluginContext: (hostContext: HostContext) => PluginContext;
|
|
131
|
+
/**
|
|
132
|
+
* Permission resolver - maps plugin permissions to host permission checks.
|
|
133
|
+
*/
|
|
134
|
+
checkPermission: (permission: PluginPermission, hostContext: HostContext) => boolean;
|
|
135
|
+
/** CSS class prefix for all plugin styles */
|
|
136
|
+
cssNamespace: string;
|
|
137
|
+
/** Called when plugin is registered */
|
|
138
|
+
onRegister?: (registry: PluginRegistry) => void;
|
|
139
|
+
/** Called when plugin is unregistered */
|
|
140
|
+
onUnregister?: () => void;
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Plugin registry for runtime management.
|
|
144
|
+
*/
|
|
145
|
+
export interface PluginRegistry {
|
|
146
|
+
/** Register a plugin */
|
|
147
|
+
register(plugin: AdminPlugin): void;
|
|
148
|
+
/** Unregister a plugin by ID */
|
|
149
|
+
unregister(pluginId: PluginId): void;
|
|
150
|
+
/** Get registered plugin by ID */
|
|
151
|
+
get(pluginId: PluginId): AdminPlugin | undefined;
|
|
152
|
+
/** Get all registered plugins */
|
|
153
|
+
getAll(): AdminPlugin[];
|
|
154
|
+
/** Listen for registration changes */
|
|
155
|
+
subscribe(listener: (plugins: AdminPlugin[]) => void): () => void;
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Extended section config with plugin metadata (internal use).
|
|
159
|
+
*/
|
|
160
|
+
export interface ResolvedSection extends AdminSectionConfig {
|
|
161
|
+
/** Fully qualified section ID */
|
|
162
|
+
qualifiedId: QualifiedSectionId;
|
|
163
|
+
/** Source plugin ID */
|
|
164
|
+
pluginId: PluginId;
|
|
165
|
+
/** CSS namespace from plugin */
|
|
166
|
+
cssNamespace: string;
|
|
167
|
+
}
|
|
@@ -10,6 +10,8 @@ export interface AdminUserDetailProps {
|
|
|
10
10
|
onEditUser?: (user: AdminUser) => void;
|
|
11
11
|
/** Callback when credits adjustment is clicked (parent handles modal) */
|
|
12
12
|
onAdjustCredits?: (user: AdminUser) => void;
|
|
13
|
+
/** Whether cedros-pay is enabled (shows Chats tab) */
|
|
14
|
+
cedrosPayEnabled?: boolean;
|
|
13
15
|
/** Additional CSS classes */
|
|
14
16
|
className?: string;
|
|
15
17
|
}
|
|
@@ -18,4 +20,4 @@ export interface AdminUserDetailProps {
|
|
|
18
20
|
*
|
|
19
21
|
* Shows comprehensive user information with deposit and credit history.
|
|
20
22
|
*/
|
|
21
|
-
export declare function AdminUserDetail({ userId, onBack, currentUserId, onEditUser, onAdjustCredits, className, }: AdminUserDetailProps): import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
export declare function AdminUserDetail({ userId, onBack, currentUserId, onEditUser, onAdjustCredits, cedrosPayEnabled, className, }: AdminUserDetailProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -4,7 +4,7 @@ export interface AdminUserListProps {
|
|
|
4
4
|
pageSize?: number;
|
|
5
5
|
/** Auto-refresh interval in milliseconds (0 to disable) */
|
|
6
6
|
refreshInterval?: number;
|
|
7
|
-
/** Current user's ID (to
|
|
7
|
+
/** Current user's ID (to highlight current user) */
|
|
8
8
|
currentUserId?: string;
|
|
9
9
|
/** Additional CSS classes */
|
|
10
10
|
className?: string;
|
|
@@ -12,14 +12,10 @@ export interface AdminUserListProps {
|
|
|
12
12
|
onLoad?: (response: ListAdminUsersResponse) => void;
|
|
13
13
|
/** Callback when a user is clicked */
|
|
14
14
|
onUserClick?: (user: AdminUser) => void;
|
|
15
|
-
/** Callback when edit is clicked (parent handles modal) */
|
|
16
|
-
onEditUser?: (user: AdminUser) => void;
|
|
17
|
-
/** Callback when credits adjustment is clicked (parent handles modal) */
|
|
18
|
-
onAdjustCredits?: (user: AdminUser) => void;
|
|
19
15
|
}
|
|
20
16
|
/**
|
|
21
17
|
* Admin user list display
|
|
22
18
|
*
|
|
23
|
-
* Shows all registered users
|
|
19
|
+
* Shows all registered users.
|
|
24
20
|
*/
|
|
25
|
-
export declare function AdminUserList({ pageSize, refreshInterval, currentUserId, className, onLoad, onUserClick,
|
|
21
|
+
export declare function AdminUserList({ pageSize, refreshInterval, currentUserId, className, onLoad, onUserClick, }: AdminUserListProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* function AdminPage() {
|
|
15
15
|
* return (
|
|
16
16
|
* <CedrosAdminDashboard
|
|
17
|
-
* sections={['
|
|
17
|
+
* sections={['users', 'team', 'deposits', 'settings-auth']}
|
|
18
18
|
* title="My App Admin"
|
|
19
19
|
* />
|
|
20
20
|
* );
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
* ```
|
|
23
23
|
*/
|
|
24
24
|
/** Available dashboard sections */
|
|
25
|
-
export type DashboardSection = '
|
|
25
|
+
export type DashboardSection = 'users' | 'team' | 'deposits' | 'withdrawals' | 'settings-wallet' | 'settings-auth' | 'settings-messaging' | 'settings-credits' | 'settings-server';
|
|
26
26
|
export interface CedrosAdminDashboardProps {
|
|
27
27
|
/** Dashboard title */
|
|
28
28
|
title?: string;
|
|
@@ -36,6 +36,10 @@ export interface CedrosAdminDashboardProps {
|
|
|
36
36
|
pageSize?: number;
|
|
37
37
|
/** Callback when section changes */
|
|
38
38
|
onSectionChange?: (section: DashboardSection) => void;
|
|
39
|
+
/** Callback when user clicks Settings in profile dropdown */
|
|
40
|
+
onSettingsClick?: () => void;
|
|
41
|
+
/** Callback when user clicks Logout in profile dropdown (defaults to context logout) */
|
|
42
|
+
onLogoutClick?: () => void;
|
|
39
43
|
/** Additional CSS class */
|
|
40
44
|
className?: string;
|
|
41
45
|
}
|
|
@@ -45,4 +49,4 @@ export interface CedrosAdminDashboardProps {
|
|
|
45
49
|
* Provides a complete admin interface with sidebar navigation.
|
|
46
50
|
* Follows shadcn/ui dashboard patterns.
|
|
47
51
|
*/
|
|
48
|
-
export declare function CedrosAdminDashboard({ title, sections, defaultSection, refreshInterval, pageSize, onSectionChange, className, }: CedrosAdminDashboardProps): import("react/jsx-runtime").JSX.Element;
|
|
52
|
+
export declare function CedrosAdminDashboard({ title, sections, defaultSection, refreshInterval, pageSize, onSectionChange, onSettingsClick, onLogoutClick, className, }: CedrosAdminDashboardProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { OrgRole } from '../../types/org';
|
|
3
|
+
export interface PermissionsSectionProps {
|
|
4
|
+
/** Current user's role in the org */
|
|
5
|
+
userRole?: OrgRole | null;
|
|
6
|
+
}
|
|
7
|
+
export declare function PermissionsSection({ userRole }: PermissionsSectionProps): React.JSX.Element;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Profile Dropdown Component
|
|
3
|
+
*
|
|
4
|
+
* Displays user avatar/name with a dropdown menu for settings and logout.
|
|
5
|
+
*/
|
|
6
|
+
export interface ProfileDropdownProps {
|
|
7
|
+
/** User's display name */
|
|
8
|
+
name?: string;
|
|
9
|
+
/** User's email */
|
|
10
|
+
email?: string;
|
|
11
|
+
/** User's profile picture URL */
|
|
12
|
+
picture?: string;
|
|
13
|
+
/** Callback when Settings is clicked */
|
|
14
|
+
onSettings?: () => void;
|
|
15
|
+
/** Callback when Logout is clicked */
|
|
16
|
+
onLogout?: () => void;
|
|
17
|
+
/** Additional CSS class */
|
|
18
|
+
className?: string;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Profile dropdown button with settings and logout options.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```tsx
|
|
25
|
+
* <ProfileDropdown
|
|
26
|
+
* name={user.name}
|
|
27
|
+
* email={user.email}
|
|
28
|
+
* picture={user.picture}
|
|
29
|
+
* onSettings={() => navigate('/settings')}
|
|
30
|
+
* onLogout={logout}
|
|
31
|
+
* />
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
export declare function ProfileDropdown({ name, email, picture, onSettings, onLogout, className, }: ProfileDropdownProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Setup Wizard Component
|
|
3
|
+
*
|
|
4
|
+
* Displayed during first-run when no admin user exists.
|
|
5
|
+
* Allows creating the first admin account.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```tsx
|
|
9
|
+
* function AdminApp() {
|
|
10
|
+
* const { status, isLoading, checkStatus, createAdmin } = useSetup();
|
|
11
|
+
*
|
|
12
|
+
* useEffect(() => {
|
|
13
|
+
* checkStatus();
|
|
14
|
+
* }, [checkStatus]);
|
|
15
|
+
*
|
|
16
|
+
* if (isLoading) return <LoadingSpinner />;
|
|
17
|
+
* if (status?.needsSetup) {
|
|
18
|
+
* return <SetupWizard onComplete={() => window.location.reload()} />;
|
|
19
|
+
* }
|
|
20
|
+
* return <CedrosAdminDashboard />;
|
|
21
|
+
* }
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
export interface SetupWizardProps {
|
|
25
|
+
/** Callback when setup is complete */
|
|
26
|
+
onComplete?: () => void;
|
|
27
|
+
/** Additional CSS class */
|
|
28
|
+
className?: string;
|
|
29
|
+
}
|
|
30
|
+
export declare function SetupWizard({ onComplete, className }: SetupWizardProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* StatsBar Component
|
|
3
|
+
*
|
|
4
|
+
* A reusable horizontal stats display for admin sections.
|
|
5
|
+
*/
|
|
6
|
+
export interface StatItem {
|
|
7
|
+
label: string;
|
|
8
|
+
value: string | number;
|
|
9
|
+
description?: string;
|
|
10
|
+
variant?: 'default' | 'success' | 'warning' | 'muted';
|
|
11
|
+
}
|
|
12
|
+
export interface StatsBarProps {
|
|
13
|
+
stats: StatItem[];
|
|
14
|
+
isLoading?: boolean;
|
|
15
|
+
onRefresh?: () => void;
|
|
16
|
+
}
|
|
17
|
+
export declare function StatsBar({ stats, isLoading, onRefresh }: StatsBarProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { AutosaveStatus as Status } from '../../../hooks/useSettingsAutosave';
|
|
2
|
+
export interface AutosaveStatusProps {
|
|
3
|
+
status: Status;
|
|
4
|
+
error?: string | null;
|
|
5
|
+
}
|
|
6
|
+
export declare function AutosaveStatus({ status, error }: AutosaveStatusProps): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export interface CreditSystemSettingsProps {
|
|
2
|
+
className?: string;
|
|
3
|
+
}
|
|
4
|
+
export declare function CreditSystemSettings({ className }: CreditSystemSettingsProps): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export { CreditSystemSettings as PrivacyCashSettings };
|
|
6
|
+
export type { CreditSystemSettingsProps as PrivacyCashSettingsProps };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface SettingsPageLayoutProps {
|
|
2
|
+
/** Page title */
|
|
3
|
+
title: string;
|
|
4
|
+
/** Page description */
|
|
5
|
+
description: string;
|
|
6
|
+
/** Categories to display on this page */
|
|
7
|
+
categories: string[];
|
|
8
|
+
/** Additional CSS class */
|
|
9
|
+
className?: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Shared layout component for settings pages.
|
|
13
|
+
* Handles loading and displaying settings for specified categories.
|
|
14
|
+
* Changes are automatically saved after a brief debounce.
|
|
15
|
+
*/
|
|
16
|
+
export declare function SettingsPageLayout({ title, description, categories, className, }: SettingsPageLayoutProps): import("react/jsx-runtime").JSX.Element;
|