@kyro-cms/admin 0.3.1 → 0.3.4
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/EditorClient-XEUOVAAC.js +466 -0
- package/dist/EditorClient-XEUOVAAC.js.map +1 -0
- package/dist/EditorClient-YLCGVDXY.cjs +468 -0
- package/dist/EditorClient-YLCGVDXY.cjs.map +1 -0
- package/dist/chunk-7KPIUCGT.js +384 -0
- package/dist/chunk-7KPIUCGT.js.map +1 -0
- package/dist/chunk-GOACG6R7.cjs +473 -0
- package/dist/chunk-GOACG6R7.cjs.map +1 -0
- package/dist/index.cjs +14861 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.css +1661 -0
- package/dist/index.css.map +1 -0
- package/dist/index.d.ts +563 -0
- package/dist/index.js +14784 -0
- package/dist/index.js.map +1 -0
- package/package.json +19 -19
- package/src/components/ActionBar.tsx +7 -43
- package/src/components/Admin.tsx +138 -277
- package/src/components/ApiKeysManager.tsx +428 -419
- package/src/components/AuditLogsPage.tsx +35 -39
- package/src/components/AuthBridge.tsx +51 -0
- package/src/components/AutoForm.tsx +495 -1230
- package/src/components/BrandingHub.tsx +18 -19
- package/src/components/BulkActionsBar.tsx +1 -1
- package/src/components/CreateView.tsx +22 -36
- package/src/components/Dashboard.tsx +60 -84
- package/src/components/DetailView.tsx +113 -91
- package/src/components/DeveloperCenter.tsx +200 -198
- package/src/components/FieldRenderer.tsx +206 -0
- package/src/components/GraphQLPlayground.tsx +340 -480
- package/src/components/ListView.tsx +828 -254
- package/src/components/LoginPage.tsx +3 -4
- package/src/components/MarketplaceManager.tsx +254 -0
- package/src/components/MediaGallery.tsx +856 -1192
- package/src/components/PluginsManager.tsx +277 -0
- package/src/components/RestPlayground.tsx +398 -560
- package/src/components/SessionsManager.tsx +211 -0
- package/src/components/Sidebar.astro +179 -151
- package/src/components/ThemeProvider.tsx +7 -161
- package/src/components/UserManagement.tsx +162 -146
- package/src/components/UserMenu.tsx +110 -0
- package/src/components/WebhookManager.tsx +305 -367
- package/src/components/blocks/AccordionBlock.tsx +4 -4
- package/src/components/blocks/ArrayBlock.tsx +3 -3
- package/src/components/blocks/BlockEditModal.tsx +8 -8
- package/src/components/blocks/BlockWrapper.tsx +61 -0
- package/src/components/blocks/ButtonBlock.tsx +4 -4
- package/src/components/blocks/ChildBlocksTree.tsx +23 -25
- package/src/components/blocks/CodeBlock.tsx +15 -15
- package/src/components/blocks/ColumnsBlock.tsx +6 -44
- package/src/components/blocks/DividerBlock.tsx +3 -3
- package/src/components/blocks/FileBlock.tsx +4 -4
- package/src/components/blocks/HeadingBlock.tsx +6 -38
- package/src/components/blocks/HeroBlock.tsx +4 -4
- package/src/components/blocks/ImageBlock.tsx +4 -4
- package/src/components/blocks/LinkBlock.tsx +4 -4
- package/src/components/blocks/ListBlock.tsx +3 -3
- package/src/components/blocks/ParagraphBlock.tsx +12 -42
- package/src/components/blocks/RelationshipBlock.tsx +4 -4
- package/src/components/blocks/RichTextBlock.tsx +4 -4
- package/src/components/blocks/VStackBlock.tsx +5 -37
- package/src/components/blocks/VideoBlock.tsx +4 -4
- package/src/components/blocks/types.ts +11 -0
- package/src/components/fields/AccordionField.tsx +1 -1
- package/src/components/fields/ArrayField.tsx +2 -2
- package/src/components/fields/ArrayLayout.tsx +93 -0
- package/src/components/fields/BlocksField.tsx +122 -111
- package/src/components/fields/ButtonField.tsx +1 -1
- package/src/components/fields/CheckboxField.tsx +14 -15
- package/src/components/fields/ChildrenField.tsx +2 -2
- package/src/components/fields/CodeField.tsx +3 -3
- package/src/components/fields/ColumnsField.tsx +2 -2
- package/src/components/fields/DateField.tsx +13 -26
- package/src/components/fields/EditorClient.tsx +26 -28
- package/src/components/fields/FieldLayout.tsx +52 -0
- package/src/components/fields/GroupLayout.tsx +35 -0
- package/src/components/fields/JSONField.tsx +7 -7
- package/src/components/fields/LinkField.tsx +1 -1
- package/src/components/fields/MarkdownField.tsx +1 -1
- package/src/components/fields/NumberField.tsx +13 -26
- package/src/components/fields/PortableTextField.tsx +4 -4
- package/src/components/fields/PortableTextRenderer.tsx +1 -1
- package/src/components/fields/RelationshipBlockField.tsx +31 -23
- package/src/components/fields/RelationshipField.tsx +14 -14
- package/src/components/fields/SelectField.tsx +17 -26
- package/src/components/fields/TabsLayout.tsx +69 -0
- package/src/components/fields/TextField.tsx +85 -38
- package/src/components/fields/UploadField.tsx +71 -41
- package/src/components/fields/VideoField.tsx +1 -1
- package/src/components/fields/extensions/blockComponents.tsx +2 -2
- package/src/components/fields/extensions/blocksStore.ts +207 -193
- package/src/components/fields/types.ts +22 -0
- package/src/components/layout/Layout.tsx +1 -1
- package/src/components/ui/ActionMenu.tsx +63 -0
- package/src/components/ui/Badge.tsx +59 -5
- package/src/components/ui/BlockDrawer.tsx +4 -5
- package/src/components/ui/CommandPalette.tsx +58 -36
- package/src/components/ui/CommandPaletteWrapper.tsx +18 -17
- package/src/components/ui/Dropdown.tsx +18 -16
- package/src/components/ui/EmptyState.tsx +25 -0
- package/src/components/ui/GlobalModal.tsx +49 -0
- package/src/components/ui/IconButton.tsx +44 -0
- package/src/components/ui/Modal.tsx +19 -20
- package/src/components/ui/PageHeader.tsx +158 -0
- package/src/components/ui/Pagination.tsx +61 -0
- package/src/components/ui/PromptModal.tsx +1 -1
- package/src/components/ui/SearchInput.tsx +57 -0
- package/src/components/ui/SeoPreview.tsx +31 -0
- package/src/components/ui/SessionModal.tsx +0 -0
- package/src/components/ui/SlidePanel.tsx +2 -0
- package/src/components/ui/Toast.tsx +65 -122
- package/src/components/ui/Toaster.tsx +18 -0
- package/src/components/ui/icons.tsx +112 -0
- package/src/components/users/UserDetail.tsx +290 -0
- package/src/components/users/UserForm.tsx +242 -0
- package/src/components/users/UsersList.tsx +338 -0
- package/src/env.d.ts +13 -13
- package/src/fields/index.ts +2 -1
- package/src/global.d.ts +7 -0
- package/src/hooks/data.ts +2 -9
- package/src/hooks/useAsyncData.ts +36 -0
- package/src/hooks/useAutoFormState.ts +527 -0
- package/src/hooks/useSelection.ts +49 -0
- package/src/hooks/useSession.ts +0 -0
- package/src/index.ts +11 -1
- package/src/integration.ts +86 -11
- package/src/kyro-cms.d.ts +209 -0
- package/src/layouts/AdminLayout.astro +128 -11
- package/src/layouts/AuthLayout.astro +21 -5
- package/src/lib/api.ts +175 -55
- package/src/lib/autoform-store.ts +435 -0
- package/src/lib/config.ts +82 -34
- package/src/lib/createRegistry.ts +29 -0
- package/src/lib/default-kyro-config.ts +4 -0
- package/src/lib/globals.ts +50 -0
- package/src/lib/media-utils.ts +18 -0
- package/src/lib/object-utils.ts +77 -0
- package/src/lib/paths.ts +61 -0
- package/src/lib/stores/index.ts +370 -0
- package/src/lib/types.ts +43 -0
- package/src/lib/useResourceManager.ts +105 -0
- package/src/pages/403.astro +67 -0
- package/src/pages/[collection]/[id].astro +14 -180
- package/src/pages/[collection]/index.astro +11 -6
- package/src/pages/api-explorer.astro +173 -0
- package/src/pages/audit/index.astro +2 -0
- package/src/pages/auth/login.astro +122 -0
- package/src/pages/auth/register.astro +167 -0
- package/src/pages/graphql-explorer.astro +59 -0
- package/src/pages/{admin/graphql.astro → graphql.astro} +51 -17
- package/src/pages/index.astro +577 -0
- package/src/pages/index_ALT.astro +3 -0
- package/src/pages/keys.astro +11 -0
- package/src/pages/marketplace.astro +11 -0
- package/src/pages/media.astro +3 -0
- package/src/pages/plugins.astro +8 -0
- package/src/pages/preview/[collection]/[id].astro +188 -123
- package/src/pages/rest-playground.astro +62 -0
- package/src/pages/roles/index.astro +183 -76
- package/src/pages/sessions.astro +8 -0
- package/src/pages/settings/[slug].astro +92 -114
- package/src/pages/settings/index.astro +5 -3
- package/src/pages/users/[id].astro +25 -154
- package/src/pages/users/index.astro +19 -130
- package/src/pages/users/new.astro +9 -86
- package/src/pages/webhooks.astro +11 -0
- package/src/routes.ts +80 -0
- package/src/styles/main.css +119 -79
- package/src/theme/tokens.ts +1 -0
- package/src/vite-env.d.ts +14 -0
- package/src/collections/auth/index.ts +0 -155
- package/src/collections/portfolio/index.ts +0 -343
- package/src/components/ApiExplorer.tsx +0 -325
- package/src/components/EnhancedListView.tsx +0 -889
- package/src/components/GraphQLExplorer.tsx +0 -675
- package/src/components/Icons.tsx +0 -23
- package/src/components/StatusBadge.tsx +0 -76
- package/src/lib/MediaService.ts +0 -541
- package/src/lib/auth/sqlite-adapter.ts +0 -319
- package/src/lib/dataStore.ts +0 -226
- package/src/lib/db/adapter.ts +0 -54
- package/src/lib/db/drizzle-mysql-adapter.ts +0 -194
- package/src/lib/db/drizzle-mysql-auth-adapter.ts +0 -327
- package/src/lib/db/drizzle-postgres-adapter.ts +0 -202
- package/src/lib/db/drizzle-postgres-auth-adapter.ts +0 -304
- package/src/lib/db/drizzle-sqlite-adapter.ts +0 -227
- package/src/lib/db/drizzle-sqlite-auth-adapter.ts +0 -548
- package/src/lib/db/index.ts +0 -449
- package/src/lib/db/mongodb-adapter.ts +0 -207
- package/src/lib/db/mongodb-auth-adapter.ts +0 -305
- package/src/lib/db/schema/mysql-auth.ts +0 -113
- package/src/lib/db/schema/mysql-content.ts +0 -20
- package/src/lib/db/schema/postgres-auth.ts +0 -116
- package/src/lib/db/schema/postgres-content.ts +0 -35
- package/src/lib/db/schema/postgres-media.ts +0 -52
- package/src/lib/db/schema/postgres-settings.ts +0 -11
- package/src/lib/db/schema/sqlite-auth.ts +0 -112
- package/src/lib/db/schema/sqlite-content.ts +0 -20
- package/src/lib/db/version-adapter.ts +0 -248
- package/src/lib/graphql/index.ts +0 -1
- package/src/lib/graphql/schema.ts +0 -443
- package/src/lib/rate-limit.ts +0 -267
- package/src/lib/storage.ts +0 -374
- package/src/lib/store.ts +0 -85
- package/src/middleware.ts +0 -177
- package/src/pages/admin/api-explorer.astro +0 -98
- package/src/pages/admin/graphql-explorer.astro +0 -40
- package/src/pages/admin/index.astro +0 -286
- package/src/pages/admin/keys.astro +0 -8
- package/src/pages/admin/rest-playground.astro +0 -44
- package/src/pages/admin/webhooks.astro +0 -8
- package/src/pages/api/[collection]/[id]/publish.ts +0 -52
- package/src/pages/api/[collection]/[id]/unpublish.ts +0 -42
- package/src/pages/api/[collection]/[id]/versions.ts +0 -66
- package/src/pages/api/[collection]/[id].ts +0 -213
- package/src/pages/api/[collection]/index.ts +0 -209
- package/src/pages/api/auth/[id].ts +0 -121
- package/src/pages/api/auth/audit-logs.ts +0 -57
- package/src/pages/api/auth/login.ts +0 -211
- package/src/pages/api/auth/logout.ts +0 -66
- package/src/pages/api/auth/me.ts +0 -36
- package/src/pages/api/auth/refresh.ts +0 -119
- package/src/pages/api/auth/register.ts +0 -188
- package/src/pages/api/auth/users.ts +0 -97
- package/src/pages/api/collections.ts +0 -59
- package/src/pages/api/globals/[slug].ts +0 -42
- package/src/pages/api/graphql.ts +0 -90
- package/src/pages/api/health.ts +0 -426
- package/src/pages/api/keys/[id].ts +0 -26
- package/src/pages/api/keys/index.ts +0 -75
- package/src/pages/api/media/[id].ts +0 -309
- package/src/pages/api/media/folders.ts +0 -609
- package/src/pages/api/media/index.ts +0 -146
- package/src/pages/api/media/resize.ts +0 -267
- package/src/pages/api/search.ts +0 -82
- package/src/pages/api/slug-availability.ts +0 -70
- package/src/pages/api/storage-config.ts +0 -20
- package/src/pages/api/storage-status.ts +0 -206
- package/src/pages/api/upload.ts +0 -334
- package/src/pages/api/webhooks/index.ts +0 -71
- package/src/pages/login.astro +0 -82
- package/src/pages/register.astro +0 -102
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,563 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { CollectionConfig, GlobalConfig, KyroConfig } from '@kyro-cms/core/client';
|
|
3
|
+
import * as React$1 from 'react';
|
|
4
|
+
import React__default, { ReactNode, ButtonHTMLAttributes } from 'react';
|
|
5
|
+
import { CollectionConfig as CollectionConfig$1, Block, Field, FieldType } from '@kyro-cms/core';
|
|
6
|
+
import { IconType } from 'react-icons';
|
|
7
|
+
import { AstroIntegration } from 'astro';
|
|
8
|
+
|
|
9
|
+
interface ThemeColors {
|
|
10
|
+
primary?: string;
|
|
11
|
+
secondary?: string;
|
|
12
|
+
accent?: string;
|
|
13
|
+
background?: string;
|
|
14
|
+
surface?: string;
|
|
15
|
+
text?: string;
|
|
16
|
+
textMuted?: string;
|
|
17
|
+
border?: string;
|
|
18
|
+
success?: string;
|
|
19
|
+
error?: string;
|
|
20
|
+
warning?: string;
|
|
21
|
+
info?: string;
|
|
22
|
+
}
|
|
23
|
+
interface ThemeTypography {
|
|
24
|
+
fontFamily?: string;
|
|
25
|
+
fontFamilyMono?: string;
|
|
26
|
+
fontSize?: {
|
|
27
|
+
xs?: string;
|
|
28
|
+
sm?: string;
|
|
29
|
+
md?: string;
|
|
30
|
+
lg?: string;
|
|
31
|
+
xl?: string;
|
|
32
|
+
"2xl"?: string;
|
|
33
|
+
"3xl"?: string;
|
|
34
|
+
"4xl"?: string;
|
|
35
|
+
};
|
|
36
|
+
fontWeight?: {
|
|
37
|
+
normal?: number;
|
|
38
|
+
medium?: number;
|
|
39
|
+
semibold?: number;
|
|
40
|
+
bold?: number;
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
interface ThemeSpacing {
|
|
44
|
+
xs?: string;
|
|
45
|
+
sm?: string;
|
|
46
|
+
md?: string;
|
|
47
|
+
lg?: string;
|
|
48
|
+
xl?: string;
|
|
49
|
+
"2xl"?: string;
|
|
50
|
+
}
|
|
51
|
+
interface ThemeRadius {
|
|
52
|
+
sm?: string;
|
|
53
|
+
md?: string;
|
|
54
|
+
lg?: string;
|
|
55
|
+
full?: string;
|
|
56
|
+
}
|
|
57
|
+
interface ThemeShadows {
|
|
58
|
+
sm?: string;
|
|
59
|
+
md?: string;
|
|
60
|
+
lg?: string;
|
|
61
|
+
xl?: string;
|
|
62
|
+
}
|
|
63
|
+
interface BlockThemeOverrides {
|
|
64
|
+
card?: {
|
|
65
|
+
background?: string;
|
|
66
|
+
borderRadius?: string;
|
|
67
|
+
padding?: string;
|
|
68
|
+
shadow?: string;
|
|
69
|
+
};
|
|
70
|
+
hero?: {
|
|
71
|
+
background?: string;
|
|
72
|
+
textAlign?: "left" | "center" | "right";
|
|
73
|
+
};
|
|
74
|
+
gallery?: {
|
|
75
|
+
gridColumns?: number;
|
|
76
|
+
gap?: string;
|
|
77
|
+
};
|
|
78
|
+
code?: {
|
|
79
|
+
fontFamily?: string;
|
|
80
|
+
fontSize?: string;
|
|
81
|
+
background?: string;
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
interface FieldThemeOverrides {
|
|
85
|
+
input?: {
|
|
86
|
+
background?: string;
|
|
87
|
+
border?: string;
|
|
88
|
+
borderRadius?: string;
|
|
89
|
+
padding?: string;
|
|
90
|
+
focusRing?: string;
|
|
91
|
+
};
|
|
92
|
+
select?: {
|
|
93
|
+
background?: string;
|
|
94
|
+
border?: string;
|
|
95
|
+
};
|
|
96
|
+
textarea?: {
|
|
97
|
+
background?: string;
|
|
98
|
+
minHeight?: string;
|
|
99
|
+
};
|
|
100
|
+
richText?: {
|
|
101
|
+
toolbarBackground?: string;
|
|
102
|
+
buttonActive?: string;
|
|
103
|
+
};
|
|
104
|
+
upload?: {
|
|
105
|
+
dropzoneBackground?: string;
|
|
106
|
+
dropzoneActive?: string;
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
interface KyroTheme {
|
|
110
|
+
id?: string;
|
|
111
|
+
label?: string;
|
|
112
|
+
colors?: ThemeColors;
|
|
113
|
+
typography?: ThemeTypography;
|
|
114
|
+
spacing?: ThemeSpacing;
|
|
115
|
+
borderRadius?: ThemeRadius;
|
|
116
|
+
shadows?: ThemeShadows;
|
|
117
|
+
blocks?: BlockThemeOverrides;
|
|
118
|
+
fields?: FieldThemeOverrides;
|
|
119
|
+
}
|
|
120
|
+
declare const LIGHT_THEME: KyroTheme;
|
|
121
|
+
declare const DARK_THEME: KyroTheme;
|
|
122
|
+
declare function mergeThemes(base: KyroTheme, overrides: Partial<KyroTheme>): KyroTheme;
|
|
123
|
+
|
|
124
|
+
type ThemeMode = "light" | "dark" | "system";
|
|
125
|
+
interface ThemeContextValue {
|
|
126
|
+
mode: ThemeMode;
|
|
127
|
+
theme: KyroTheme;
|
|
128
|
+
lightTheme: KyroTheme;
|
|
129
|
+
darkTheme: KyroTheme;
|
|
130
|
+
setMode: (mode: ThemeMode) => void;
|
|
131
|
+
updateTheme: (overrides: Partial<KyroTheme>) => void;
|
|
132
|
+
getCssVar: (key: string) => string;
|
|
133
|
+
}
|
|
134
|
+
declare function useTheme(): ThemeContextValue;
|
|
135
|
+
interface ThemeProviderProps {
|
|
136
|
+
children: ReactNode;
|
|
137
|
+
defaultMode?: ThemeMode;
|
|
138
|
+
light?: Partial<KyroTheme>;
|
|
139
|
+
dark?: Partial<KyroTheme>;
|
|
140
|
+
}
|
|
141
|
+
declare function ThemeProvider({ children, defaultMode, light: lightOverrides, dark: darkOverrides, }: ThemeProviderProps): react_jsx_runtime.JSX.Element;
|
|
142
|
+
declare const LightThemeProvider: (props: Omit<ThemeProviderProps, "defaultMode">) => react_jsx_runtime.JSX.Element;
|
|
143
|
+
declare const DarkThemeProvider: (props: Omit<ThemeProviderProps, "defaultMode">) => react_jsx_runtime.JSX.Element;
|
|
144
|
+
|
|
145
|
+
interface KyroAdminConfig {
|
|
146
|
+
collections?: CollectionConfig[] | Record<string, CollectionConfig>;
|
|
147
|
+
globals?: GlobalConfig[] | Record<string, GlobalConfig>;
|
|
148
|
+
adapter?: unknown;
|
|
149
|
+
name?: string;
|
|
150
|
+
}
|
|
151
|
+
interface AdminProps {
|
|
152
|
+
config: KyroAdminConfig;
|
|
153
|
+
theme?: ThemeMode;
|
|
154
|
+
onThemeChange?: (mode: ThemeMode) => void;
|
|
155
|
+
}
|
|
156
|
+
declare function Admin({ config, theme, onThemeChange }: AdminProps): react_jsx_runtime.JSX.Element;
|
|
157
|
+
|
|
158
|
+
interface LoginPageProps {
|
|
159
|
+
onAuth: (token: string, user: Record<string, unknown>) => void;
|
|
160
|
+
theme?: ThemeMode;
|
|
161
|
+
}
|
|
162
|
+
declare function LoginPage({ onAuth, theme }: LoginPageProps): react_jsx_runtime.JSX.Element;
|
|
163
|
+
|
|
164
|
+
interface ListViewProps {
|
|
165
|
+
collection: CollectionConfig$1;
|
|
166
|
+
collectionSlug?: string;
|
|
167
|
+
initialDocs?: any[];
|
|
168
|
+
initialTotal?: number;
|
|
169
|
+
onCreate?: () => void;
|
|
170
|
+
onEdit?: (id: string) => void;
|
|
171
|
+
config?: any;
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Unified ListView component used across both SPA (Admin.tsx) and MPA (Astro pages) modes.
|
|
175
|
+
*/
|
|
176
|
+
declare function ListView({ collection, collectionSlug: providedSlug, initialDocs, initialTotal, onCreate: providedOnCreate, onEdit: providedOnEdit, config, }: ListViewProps): react_jsx_runtime.JSX.Element;
|
|
177
|
+
|
|
178
|
+
interface DetailViewProps {
|
|
179
|
+
config: KyroConfig;
|
|
180
|
+
collection?: CollectionConfig;
|
|
181
|
+
global?: GlobalConfig;
|
|
182
|
+
documentId?: string;
|
|
183
|
+
onBack: () => void;
|
|
184
|
+
onSave: () => void;
|
|
185
|
+
onDelete?: () => void;
|
|
186
|
+
onError: (message: string) => void;
|
|
187
|
+
mode?: "collection" | "global";
|
|
188
|
+
}
|
|
189
|
+
declare function DetailView({ config, collection, global, documentId, onBack, onSave, onDelete, onError, mode, }: DetailViewProps): react_jsx_runtime.JSX.Element;
|
|
190
|
+
|
|
191
|
+
interface CreateViewProps {
|
|
192
|
+
config: KyroConfig;
|
|
193
|
+
collection: CollectionConfig;
|
|
194
|
+
onCancel: () => void;
|
|
195
|
+
onSuccess: () => void;
|
|
196
|
+
onError: (message: string) => void;
|
|
197
|
+
}
|
|
198
|
+
declare function CreateView({ config, collection, onCancel, onSuccess, onError, }: CreateViewProps): react_jsx_runtime.JSX.Element;
|
|
199
|
+
|
|
200
|
+
interface AutoFormProps {
|
|
201
|
+
config: CollectionConfig | GlobalConfig;
|
|
202
|
+
data?: Record<string, unknown>;
|
|
203
|
+
errors?: Record<string, string>;
|
|
204
|
+
onChange?: (data: Record<string, unknown>) => void;
|
|
205
|
+
disabled?: boolean;
|
|
206
|
+
collectionSlug?: string;
|
|
207
|
+
globalSlug?: string;
|
|
208
|
+
documentName?: string;
|
|
209
|
+
layout?: "split" | "single";
|
|
210
|
+
onActionSuccess?: (message: string) => void;
|
|
211
|
+
onActionError?: (message: string) => void;
|
|
212
|
+
justSaved?: boolean;
|
|
213
|
+
documentStatus?: string;
|
|
214
|
+
}
|
|
215
|
+
declare function AutoForm({ config: propConfig, data: initialData, errors, onChange, disabled: propDisabled, collectionSlug, globalSlug, documentName, layout, onActionSuccess, onActionError, justSaved, }: AutoFormProps): react_jsx_runtime.JSX.Element;
|
|
216
|
+
|
|
217
|
+
type DocumentStatus = "draft" | "published" | "scheduled" | "archived";
|
|
218
|
+
type SaveStatus = "idle" | "saving" | "saved" | "error";
|
|
219
|
+
interface ActionBarProps {
|
|
220
|
+
status: DocumentStatus;
|
|
221
|
+
saveStatus: SaveStatus;
|
|
222
|
+
hasChanges: boolean;
|
|
223
|
+
onSave: () => void;
|
|
224
|
+
onPublish?: () => void;
|
|
225
|
+
onUnpublish?: () => void;
|
|
226
|
+
onDuplicate?: () => void;
|
|
227
|
+
onViewHistory?: () => void;
|
|
228
|
+
onPreview?: () => void;
|
|
229
|
+
onDelete?: () => void;
|
|
230
|
+
publishedAt?: string | null;
|
|
231
|
+
updatedAt?: string | null;
|
|
232
|
+
}
|
|
233
|
+
declare function ActionBar({ status, saveStatus, hasChanges, onSave, onPublish, onUnpublish, onDuplicate, onViewHistory, onPreview, onDelete, publishedAt, updatedAt, }: ActionBarProps): react_jsx_runtime.JSX.Element;
|
|
234
|
+
|
|
235
|
+
interface BulkAction {
|
|
236
|
+
label: string;
|
|
237
|
+
onClick: () => void;
|
|
238
|
+
icon?: React__default.ReactNode;
|
|
239
|
+
danger?: boolean;
|
|
240
|
+
}
|
|
241
|
+
interface BulkActionsBarProps {
|
|
242
|
+
selectedCount: number;
|
|
243
|
+
onClearSelection: () => void;
|
|
244
|
+
actions: BulkAction[];
|
|
245
|
+
onSelectAll?: () => void;
|
|
246
|
+
}
|
|
247
|
+
declare function BulkActionsBar({ selectedCount, onClearSelection, actions, onSelectAll, }: BulkActionsBarProps): react_jsx_runtime.JSX.Element | null;
|
|
248
|
+
|
|
249
|
+
type BadgeVariant = "default" | "success" | "warning" | "danger" | "info" | "outline" | "draft" | "published" | "scheduled" | "archived" | "active" | "inactive" | "pending" | "completed" | "cancelled";
|
|
250
|
+
interface BadgeProps {
|
|
251
|
+
variant?: BadgeVariant;
|
|
252
|
+
status?: BadgeVariant;
|
|
253
|
+
className?: string;
|
|
254
|
+
children?: ReactNode;
|
|
255
|
+
dot?: boolean;
|
|
256
|
+
}
|
|
257
|
+
declare function Badge({ variant, status, className, children, dot, }: BadgeProps): react_jsx_runtime.JSX.Element;
|
|
258
|
+
declare function CountBadge({ count, max }: {
|
|
259
|
+
count: number;
|
|
260
|
+
max?: number;
|
|
261
|
+
}): react_jsx_runtime.JSX.Element | null;
|
|
262
|
+
|
|
263
|
+
interface Breadcrumb {
|
|
264
|
+
label: string;
|
|
265
|
+
href?: string;
|
|
266
|
+
onClick?: () => void;
|
|
267
|
+
}
|
|
268
|
+
interface Action {
|
|
269
|
+
label: string;
|
|
270
|
+
onClick: () => void;
|
|
271
|
+
icon?: IconType;
|
|
272
|
+
variant?: "primary" | "outline" | "ghost";
|
|
273
|
+
className?: string;
|
|
274
|
+
}
|
|
275
|
+
interface PageHeaderProps {
|
|
276
|
+
title?: string;
|
|
277
|
+
description?: string;
|
|
278
|
+
icon?: IconType;
|
|
279
|
+
breadcrumbs?: Breadcrumb[];
|
|
280
|
+
metadata?: ReactNode[];
|
|
281
|
+
back?: {
|
|
282
|
+
label?: string;
|
|
283
|
+
href?: string;
|
|
284
|
+
onClick?: () => void;
|
|
285
|
+
};
|
|
286
|
+
action?: Action;
|
|
287
|
+
actions?: ReactNode | Action[];
|
|
288
|
+
children?: ReactNode;
|
|
289
|
+
}
|
|
290
|
+
declare function PageHeader({ title, description, icon: Icon, breadcrumbs, metadata, back, action, actions, children, }: PageHeaderProps): react_jsx_runtime.JSX.Element;
|
|
291
|
+
|
|
292
|
+
interface Version {
|
|
293
|
+
id: string;
|
|
294
|
+
version: number;
|
|
295
|
+
createdAt: string;
|
|
296
|
+
updatedAt: string;
|
|
297
|
+
createdBy?: {
|
|
298
|
+
id: string;
|
|
299
|
+
name: string;
|
|
300
|
+
email?: string;
|
|
301
|
+
};
|
|
302
|
+
status: "draft" | "published";
|
|
303
|
+
changelog?: string;
|
|
304
|
+
}
|
|
305
|
+
interface VersionHistoryPanelProps {
|
|
306
|
+
open: boolean;
|
|
307
|
+
onClose: () => void;
|
|
308
|
+
versions: Version[];
|
|
309
|
+
currentVersionId?: string;
|
|
310
|
+
onPreview: (version: Version) => void;
|
|
311
|
+
onRestore: (version: Version) => void;
|
|
312
|
+
onCompare?: (v1: Version, v2: Version) => void;
|
|
313
|
+
loading?: boolean;
|
|
314
|
+
}
|
|
315
|
+
declare function VersionHistoryPanel({ open, onClose, versions, currentVersionId, onPreview, onRestore, onCompare, loading, }: VersionHistoryPanelProps): react_jsx_runtime.JSX.Element;
|
|
316
|
+
|
|
317
|
+
interface HeaderProps {
|
|
318
|
+
title: string;
|
|
319
|
+
onMenuClick: () => void;
|
|
320
|
+
actions?: ReactNode;
|
|
321
|
+
}
|
|
322
|
+
declare function Header({ title, onMenuClick, actions }: HeaderProps): react_jsx_runtime.JSX.Element;
|
|
323
|
+
|
|
324
|
+
interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
325
|
+
variant?: 'primary' | 'secondary' | 'danger' | 'ghost';
|
|
326
|
+
size?: 'sm' | 'md' | 'lg';
|
|
327
|
+
loading?: boolean;
|
|
328
|
+
children: ReactNode;
|
|
329
|
+
}
|
|
330
|
+
declare function Button({ variant, size, loading, children, className, disabled, ...props }: ButtonProps): react_jsx_runtime.JSX.Element;
|
|
331
|
+
|
|
332
|
+
interface SpinnerProps {
|
|
333
|
+
size?: "sm" | "md" | "lg";
|
|
334
|
+
className?: string;
|
|
335
|
+
}
|
|
336
|
+
declare function Spinner({ size, className }: SpinnerProps): react_jsx_runtime.JSX.Element;
|
|
337
|
+
|
|
338
|
+
interface Toast$1 {
|
|
339
|
+
id: string;
|
|
340
|
+
type: "success" | "error" | "warning" | "info";
|
|
341
|
+
message: string;
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
type ToastType = "success" | "error" | "warning" | "info";
|
|
345
|
+
interface ToastProps {
|
|
346
|
+
type: ToastType;
|
|
347
|
+
message: string;
|
|
348
|
+
onClose: () => void;
|
|
349
|
+
}
|
|
350
|
+
declare function Toast({ type, message, onClose }: ToastProps): react_jsx_runtime.JSX.Element;
|
|
351
|
+
interface ToastProviderProps {
|
|
352
|
+
children: ReactNode;
|
|
353
|
+
}
|
|
354
|
+
declare function ToastProvider({ children }: ToastProviderProps): react_jsx_runtime.JSX.Element;
|
|
355
|
+
declare function useToast(): {
|
|
356
|
+
toasts: Toast$1[];
|
|
357
|
+
addToast: (type: Toast$1["type"], message: string) => void;
|
|
358
|
+
removeToast: (id: string) => void;
|
|
359
|
+
};
|
|
360
|
+
|
|
361
|
+
interface DropdownProps {
|
|
362
|
+
trigger: ReactNode;
|
|
363
|
+
children: ReactNode;
|
|
364
|
+
align?: "left" | "right";
|
|
365
|
+
}
|
|
366
|
+
declare function Dropdown({ trigger, children, align, }: DropdownProps): react_jsx_runtime.JSX.Element;
|
|
367
|
+
interface DropdownItemProps {
|
|
368
|
+
children: ReactNode;
|
|
369
|
+
onClick?: () => void;
|
|
370
|
+
icon?: ReactNode;
|
|
371
|
+
danger?: boolean;
|
|
372
|
+
disabled?: boolean;
|
|
373
|
+
className?: string;
|
|
374
|
+
}
|
|
375
|
+
declare function DropdownItem({ children, onClick, icon, danger, disabled, className, }: DropdownItemProps): react_jsx_runtime.JSX.Element;
|
|
376
|
+
declare function DropdownSeparator(): react_jsx_runtime.JSX.Element;
|
|
377
|
+
|
|
378
|
+
interface ModalProps {
|
|
379
|
+
open: boolean;
|
|
380
|
+
onClose: () => void;
|
|
381
|
+
title: string;
|
|
382
|
+
children: ReactNode;
|
|
383
|
+
footer?: ReactNode;
|
|
384
|
+
size?: "sm" | "md" | "lg";
|
|
385
|
+
variant?: "default" | "danger";
|
|
386
|
+
}
|
|
387
|
+
declare function Modal({ open, onClose, title, children, footer, size, variant, }: ModalProps): React__default.ReactPortal | null;
|
|
388
|
+
interface ConfirmModalProps {
|
|
389
|
+
open: boolean;
|
|
390
|
+
onClose: () => void;
|
|
391
|
+
onConfirm: () => void;
|
|
392
|
+
title: string;
|
|
393
|
+
message: string;
|
|
394
|
+
confirmLabel?: string;
|
|
395
|
+
cancelLabel?: string;
|
|
396
|
+
variant?: "default" | "danger";
|
|
397
|
+
loading?: boolean;
|
|
398
|
+
}
|
|
399
|
+
declare function ConfirmModal({ open, onClose, onConfirm, title, message, confirmLabel, cancelLabel, variant, loading, }: ConfirmModalProps): react_jsx_runtime.JSX.Element;
|
|
400
|
+
|
|
401
|
+
interface SlidePanelProps {
|
|
402
|
+
open: boolean;
|
|
403
|
+
onClose: () => void;
|
|
404
|
+
title: string;
|
|
405
|
+
subtitle?: string;
|
|
406
|
+
size?: "sm" | "md" | "lg" | "xl";
|
|
407
|
+
children: ReactNode;
|
|
408
|
+
width?: "sm" | "md" | "lg" | "xl";
|
|
409
|
+
showOverlay?: boolean;
|
|
410
|
+
}
|
|
411
|
+
declare function SlidePanel({ open, onClose, title, children, width, showOverlay, }: SlidePanelProps): React__default.ReactPortal | null;
|
|
412
|
+
|
|
413
|
+
interface AuthUser {
|
|
414
|
+
id: string;
|
|
415
|
+
email: string;
|
|
416
|
+
role: string;
|
|
417
|
+
tenantId?: string;
|
|
418
|
+
}
|
|
419
|
+
interface TenantInfo {
|
|
420
|
+
id: string;
|
|
421
|
+
slug: string;
|
|
422
|
+
name: string;
|
|
423
|
+
}
|
|
424
|
+
interface AdminContext {
|
|
425
|
+
user: AuthUser | null;
|
|
426
|
+
tenant: TenantInfo | null;
|
|
427
|
+
config: Record<string, unknown>;
|
|
428
|
+
api: {
|
|
429
|
+
baseUrl: string;
|
|
430
|
+
token: string | null;
|
|
431
|
+
};
|
|
432
|
+
}
|
|
433
|
+
interface HookResult {
|
|
434
|
+
success: boolean;
|
|
435
|
+
error?: string;
|
|
436
|
+
}
|
|
437
|
+
type LifecycleHook = (ctx: AdminContext) => void | HookResult | Promise<void | HookResult>;
|
|
438
|
+
|
|
439
|
+
declare function onAdminReady(hook: LifecycleHook): () => void;
|
|
440
|
+
declare function beforeDeploy(hook: LifecycleHook): () => void;
|
|
441
|
+
declare function afterDeploy(hook: (ctx: AdminContext, result: HookResult) => void): () => void;
|
|
442
|
+
declare function emitAdminReady(ctx: AdminContext): Promise<HookResult[]>;
|
|
443
|
+
declare function emitBeforeDeploy(ctx: AdminContext): Promise<HookResult[]>;
|
|
444
|
+
declare function emitAfterDeploy(ctx: AdminContext, result: HookResult): Promise<void>;
|
|
445
|
+
|
|
446
|
+
interface QueryOptions {
|
|
447
|
+
page?: number;
|
|
448
|
+
limit?: number;
|
|
449
|
+
filter?: Record<string, unknown>;
|
|
450
|
+
sort?: string;
|
|
451
|
+
order?: "asc" | "desc";
|
|
452
|
+
}
|
|
453
|
+
interface QueryResult<T> {
|
|
454
|
+
data: T | null;
|
|
455
|
+
loading: boolean;
|
|
456
|
+
error: string | null;
|
|
457
|
+
refetch: () => Promise<void>;
|
|
458
|
+
}
|
|
459
|
+
interface MutationResult {
|
|
460
|
+
mutate: (data?: Record<string, unknown>) => Promise<Record<string, unknown> | null>;
|
|
461
|
+
loading: boolean;
|
|
462
|
+
error: string | null;
|
|
463
|
+
}
|
|
464
|
+
declare function useKyroQuery<T = Record<string, unknown>>(slug: string, options?: QueryOptions): QueryResult<T>;
|
|
465
|
+
declare function useKyroMutation(slug: string, method?: "POST" | "PATCH" | "DELETE"): MutationResult;
|
|
466
|
+
|
|
467
|
+
interface KyroPlugin {
|
|
468
|
+
name: string;
|
|
469
|
+
version: string;
|
|
470
|
+
description?: string;
|
|
471
|
+
apply?: (config: Record<string, unknown>) => void;
|
|
472
|
+
hooks?: {
|
|
473
|
+
onAdminReady?: (ctx: AdminContext) => void | HookResult | Promise<void | HookResult>;
|
|
474
|
+
beforeDeploy?: (ctx: AdminContext) => void | HookResult | Promise<void | HookResult>;
|
|
475
|
+
afterDeploy?: (ctx: AdminContext, result: HookResult) => void | Promise<void>;
|
|
476
|
+
beforeRender?: (ctx: AdminContext) => void;
|
|
477
|
+
afterRender?: (ctx: AdminContext) => void;
|
|
478
|
+
};
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
declare function registerPlugin(plugin: KyroPlugin): void;
|
|
482
|
+
declare function unregisterPlugin(name: string): void;
|
|
483
|
+
declare function getPlugin(name: string): KyroPlugin | undefined;
|
|
484
|
+
declare function getPlugins(): KyroPlugin[];
|
|
485
|
+
declare function getPluginsWithHook<K extends keyof NonNullable<KyroPlugin["hooks"]>>(hookName: K): KyroPlugin[];
|
|
486
|
+
|
|
487
|
+
interface BlockRenderProps {
|
|
488
|
+
data: Record<string, unknown>;
|
|
489
|
+
context: {
|
|
490
|
+
theme: KyroTheme;
|
|
491
|
+
locale: string;
|
|
492
|
+
isPreview: boolean;
|
|
493
|
+
};
|
|
494
|
+
}
|
|
495
|
+
interface KyroBlock extends Omit<Block, "fields" | "slug"> {
|
|
496
|
+
id: string;
|
|
497
|
+
label: string;
|
|
498
|
+
category?: string;
|
|
499
|
+
icon?: ReactNode;
|
|
500
|
+
schema: Field[];
|
|
501
|
+
render: (props: BlockRenderProps) => ReactNode;
|
|
502
|
+
preview?: (props: BlockRenderProps) => ReactNode;
|
|
503
|
+
settings?: Record<string, unknown>;
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
declare function registerBlock(block: KyroBlock): void;
|
|
507
|
+
declare function unregisterBlock(id: string): void;
|
|
508
|
+
declare function getBlock(id: string): KyroBlock | undefined;
|
|
509
|
+
declare function getBlocks(): KyroBlock[];
|
|
510
|
+
declare function getBlocksByCategory(category: string): KyroBlock[];
|
|
511
|
+
declare function useBlockRenderer(id: string): ((props: BlockRenderProps) => React$1.ReactNode) | null;
|
|
512
|
+
|
|
513
|
+
interface FieldEditorProps {
|
|
514
|
+
name: string;
|
|
515
|
+
label: string;
|
|
516
|
+
value: unknown;
|
|
517
|
+
onChange: (value: unknown) => void;
|
|
518
|
+
onBlur?: () => void;
|
|
519
|
+
error?: string;
|
|
520
|
+
required?: boolean;
|
|
521
|
+
disabled?: boolean;
|
|
522
|
+
schema?: Record<string, unknown>;
|
|
523
|
+
}
|
|
524
|
+
interface KyroField {
|
|
525
|
+
id: string;
|
|
526
|
+
type: FieldType;
|
|
527
|
+
label?: string;
|
|
528
|
+
editor: React.ComponentType<FieldEditorProps>;
|
|
529
|
+
schema?: Record<string, unknown>;
|
|
530
|
+
defaultValue?: unknown;
|
|
531
|
+
validate?: (value: unknown) => string | null;
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
declare function registerField(field: KyroField): void;
|
|
535
|
+
declare function unregisterField(id: string): void;
|
|
536
|
+
declare function getField(id: string): KyroField | undefined;
|
|
537
|
+
declare function getFields(): KyroField[];
|
|
538
|
+
declare function getFieldByType(type: FieldType): KyroField | undefined;
|
|
539
|
+
declare function useFieldRenderer(fieldId: string, props: Omit<FieldEditorProps, "onChange"> & {
|
|
540
|
+
onChange?: (value: unknown) => void;
|
|
541
|
+
}): ReactNode | null;
|
|
542
|
+
|
|
543
|
+
interface KyroAdminOptions {
|
|
544
|
+
basePath?: string;
|
|
545
|
+
apiPath?: string;
|
|
546
|
+
configPath?: string;
|
|
547
|
+
}
|
|
548
|
+
declare function kyroAdmin(options?: KyroAdminOptions): AstroIntegration;
|
|
549
|
+
|
|
550
|
+
declare const adminPath: string;
|
|
551
|
+
declare const apiPath: string;
|
|
552
|
+
declare function resolveApi(url: string): string;
|
|
553
|
+
declare function resolveAdmin(url: string): string;
|
|
554
|
+
declare function resolveMedia(url: string): string;
|
|
555
|
+
declare const paths: {
|
|
556
|
+
readonly admin: string;
|
|
557
|
+
readonly api: string;
|
|
558
|
+
readonly resolveApi: typeof resolveApi;
|
|
559
|
+
readonly resolveAdmin: typeof resolveAdmin;
|
|
560
|
+
readonly resolveMedia: typeof resolveMedia;
|
|
561
|
+
};
|
|
562
|
+
|
|
563
|
+
export { ActionBar, ActionBarProps, Admin, AdminContext, AuthUser, AutoForm, Badge, BadgeVariant, BlockRenderProps, BlockThemeOverrides, BulkActionsBar, Button, ConfirmModal, CountBadge, CreateView, DARK_THEME, DarkThemeProvider, DetailView, DocumentStatus, Dropdown, DropdownItem, DropdownSeparator, DarkThemeProvider as ExtDarkThemeProvider, LightThemeProvider as ExtLightThemeProvider, ThemeMode as ExtThemeMode, ThemeProvider as ExtThemeProvider, FieldEditorProps, FieldThemeOverrides, Header, HookResult, KyroAdminOptions, KyroBlock, KyroField, KyroPlugin, KyroTheme, LIGHT_THEME, LifecycleHook, LightThemeProvider, ListView, LoginPage, Modal, MutationResult, PageHeader, QueryOptions, QueryResult, SaveStatus, SlidePanel, Spinner, TenantInfo, ThemeColors, ThemeMode, ThemeProvider, ThemeRadius, ThemeShadows, ThemeSpacing, ThemeTypography, Toast, ToastProvider, VersionHistoryPanel, adminPath, afterDeploy, apiPath, beforeDeploy, emitAdminReady, emitAfterDeploy, emitBeforeDeploy, getBlock, getBlocks, getBlocksByCategory, getField, getFieldByType, getFields, getPlugin, getPlugins, getPluginsWithHook, kyroAdmin, mergeThemes, onAdminReady, paths, registerBlock, registerField, registerPlugin, resolveAdmin, resolveApi, unregisterBlock, unregisterField, unregisterPlugin, useBlockRenderer, useTheme as useExtTheme, useFieldRenderer, useKyroMutation, useKyroQuery, useTheme, useToast };
|