@kidecms/core 0.1.10 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/admin/components/AssetsGrid.tsx +366 -173
- package/admin/components/BlockEditor.tsx +260 -679
- package/admin/components/CheckboxField.tsx +2 -2
- package/admin/components/CollaborationReviewBar.tsx +384 -0
- package/admin/components/ColorField.tsx +87 -0
- package/admin/components/CommandPalette.tsx +169 -0
- package/admin/components/ContentEditor.tsx +687 -0
- package/admin/components/DocumentActions.tsx +4 -2
- package/admin/components/DocumentsDataTable.tsx +91 -10
- package/admin/components/FieldControl.astro +151 -26
- package/admin/components/FocalPointSelector.tsx +27 -1
- package/admin/components/InternalLinkPicker.tsx +4 -3
- package/admin/components/LinkField.tsx +126 -0
- package/admin/components/RelationField.tsx +105 -26
- package/admin/components/RepeaterInput.tsx +46 -0
- package/admin/components/RichTextEditor.tsx +44 -9
- package/admin/components/SharedSectionBlockField.tsx +93 -0
- package/admin/components/SidebarUserMenu.tsx +1 -1
- package/admin/components/Toast.astro +1 -1
- package/admin/components/TreeItemsEditor.tsx +20 -19
- package/admin/components/TreeSelect.tsx +2 -2
- package/admin/components/YoutubeField.tsx +48 -0
- package/admin/components/block-fields.tsx +777 -0
- package/admin/components/content-block-spec.ts +114 -0
- package/admin/components/slash-command.tsx +242 -0
- package/admin/components/tree-utils.ts +14 -2
- package/admin/components/ui/badge.tsx +2 -3
- package/admin/components/ui/button.tsx +5 -4
- package/admin/components/ui/checkbox.tsx +1 -1
- package/admin/components/ui/input.tsx +1 -1
- package/admin/components/ui/select.tsx +1 -1
- package/admin/components/ui/table.tsx +1 -1
- package/admin/components/ui/textarea.tsx +1 -1
- package/admin/layouts/AdminLayout.astro +323 -123
- package/admin/lib/access.ts +54 -0
- package/admin/lib/collaboration.ts +178 -0
- package/admin/lib/edit-data.ts +448 -0
- package/admin/views/AccessDeniedView.astro +8 -0
- package/admin/views/EditView.astro +706 -0
- package/admin/views/ListView.astro +202 -0
- package/admin/views/RecentView.astro +76 -0
- package/admin/views/SinglesView.astro +65 -0
- package/admin/views/edit/EditScripts.astro +145 -0
- package/admin/views/edit/ReverseReferencesList.astro +68 -0
- package/core/admin.ts +193 -0
- package/core/ai.ts +87 -0
- package/core/api.ts +1392 -0
- package/core/assets.ts +336 -0
- package/core/audit.ts +84 -0
- package/core/auth-config.ts +44 -0
- package/core/auth.ts +303 -0
- package/core/collaboration.ts +276 -0
- package/core/content.ts +27 -0
- package/core/create-admin.ts +28 -0
- package/core/define.ts +625 -0
- package/core/field-model.ts +172 -0
- package/core/generator.ts +519 -0
- package/core/http.ts +42 -0
- package/core/image.ts +219 -0
- package/core/index.ts +211 -0
- package/core/locks.ts +52 -0
- package/core/log.ts +37 -0
- package/core/migrate.ts +278 -0
- package/core/rate-limit.ts +110 -0
- package/core/request-scope.ts +33 -0
- package/core/richtext.ts +1 -0
- package/core/runtime.ts +63 -0
- package/core/schema.ts +32 -0
- package/core/search.ts +489 -0
- package/core/seed.ts +101 -0
- package/core/shared-sections.ts +96 -0
- package/core/tasks.ts +176 -0
- package/core/values.ts +433 -0
- package/core/webhooks.ts +85 -0
- package/core/youtube.ts +39 -0
- package/internals/cli.mjs +34 -0
- package/internals/context.ts +67 -0
- package/internals/create-admin.ts +40 -0
- package/internals/describe.ts +25 -0
- package/internals/eject.ts +144 -0
- package/internals/generator.ts +11 -0
- package/internals/integration.ts +481 -0
- package/internals/mcp.ts +397 -0
- package/internals/project.ts +26 -0
- package/internals/push.ts +160 -0
- package/internals/reindex.ts +11 -0
- package/internals/restore.ts +257 -0
- package/internals/seed.data.ts +7 -0
- package/internals/seed.ts +11 -0
- package/internals/upgrade.ts +776 -0
- package/{virtual.d.ts → internals/virtual.d.ts} +39 -5
- package/middleware/auth.ts +130 -17
- package/middleware/push.ts +121 -0
- package/package.json +55 -67
- package/platform/cloudflare/cf-env.ts +60 -0
- package/platform/cloudflare/database.ts +28 -0
- package/platform/cloudflare/globals.d.ts +5 -0
- package/platform/cloudflare/storage.ts +33 -0
- package/platform/cloudflare/uploads-route.ts +37 -0
- package/platform/node/database.ts +39 -0
- package/platform/node/storage.ts +52 -0
- package/routes/admin/[...path].astro +71 -0
- package/routes/{pages/admin → admin}/assets/[id].astro +25 -19
- package/routes/admin/assets/index.astro +90 -0
- package/routes/admin/forgot-password.astro +60 -0
- package/routes/{pages/admin → admin}/invite.astro +7 -6
- package/routes/admin/login.astro +103 -0
- package/routes/admin/reset-password.astro +73 -0
- package/routes/{pages/admin → admin}/setup.astro +32 -8
- package/routes/api/{cms/[collection] → [collection]}/[...path].ts +66 -14
- package/routes/api/admin/search.ts +89 -0
- package/routes/api/{cms/assets → assets}/[id].ts +24 -14
- package/routes/api/{cms/assets → assets}/index.ts +4 -2
- package/routes/api/assets/upload.ts +147 -0
- package/routes/api/auth/forgot-password.ts +77 -0
- package/routes/api/{cms/auth → auth}/invite.ts +41 -9
- package/routes/api/auth/login.ts +167 -0
- package/routes/api/{cms/auth → auth}/logout.ts +11 -2
- package/routes/api/auth/reset-password.ts +85 -0
- package/routes/api/auth/setup.ts +110 -0
- package/routes/api/auth/sso/[provider]/start.ts +34 -0
- package/routes/api/collaboration/index.ts +106 -0
- package/routes/api/cron/_authorize.ts +25 -0
- package/routes/api/{cms/cron → cron}/publish.ts +3 -9
- package/routes/api/cron/tasks.ts +33 -0
- package/routes/api/forms/submit/[slug].ts +143 -0
- package/routes/api/img/[...path].ts +65 -0
- package/routes/api/{cms/preview → preview}/render.ts +8 -3
- package/routes/api/{cms/references → references}/[collection]/[id].ts +31 -1
- package/routes/api/webhooks/[provider].ts +54 -0
- package/README.md +0 -28
- package/dist/admin.d.ts +0 -33
- package/dist/admin.js +0 -92
- package/dist/ai.d.ts +0 -15
- package/dist/ai.js +0 -70
- package/dist/api.d.ts +0 -14
- package/dist/api.js +0 -833
- package/dist/assets.d.ts +0 -51
- package/dist/assets.js +0 -163
- package/dist/auth.d.ts +0 -30
- package/dist/auth.js +0 -132
- package/dist/content.d.ts +0 -3
- package/dist/content.js +0 -29
- package/dist/create-admin.d.ts +0 -5
- package/dist/create-admin.js +0 -23
- package/dist/define.d.ts +0 -254
- package/dist/define.js +0 -36
- package/dist/generator.d.ts +0 -9
- package/dist/generator.js +0 -370
- package/dist/image.d.ts +0 -9
- package/dist/image.js +0 -69
- package/dist/index.d.ts +0 -28
- package/dist/index.js +0 -16
- package/dist/integration.d.ts +0 -14
- package/dist/integration.js +0 -327
- package/dist/locks.d.ts +0 -7
- package/dist/locks.js +0 -37
- package/dist/richtext.d.ts +0 -1
- package/dist/richtext.js +0 -1
- package/dist/runtime.d.ts +0 -24
- package/dist/runtime.js +0 -26
- package/dist/schema.d.ts +0 -17
- package/dist/schema.js +0 -13
- package/dist/seed.d.ts +0 -2
- package/dist/seed.js +0 -84
- package/dist/values.d.ts +0 -8
- package/dist/values.js +0 -102
- package/dist/webhooks.d.ts +0 -2
- package/dist/webhooks.js +0 -73
- package/routes/api/cms/assets/upload.ts +0 -112
- package/routes/api/cms/auth/login.ts +0 -124
- package/routes/api/cms/auth/setup.ts +0 -77
- package/routes/api/cms/img/[...path].ts +0 -24
- package/routes/pages/admin/[...path].astro +0 -1107
- package/routes/pages/admin/assets/index.astro +0 -63
- package/routes/pages/admin/login.astro +0 -57
- /package/routes/api/{cms/ai → ai}/alt-text.ts +0 -0
- /package/routes/api/{cms/ai → ai}/seo.ts +0 -0
- /package/routes/api/{cms/ai → ai}/translate.ts +0 -0
- /package/routes/api/{cms/assets → assets}/folders.ts +0 -0
- /package/routes/api/{cms/locks → locks}/[...path].ts +0 -0
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
import AssetsGrid from "@kidecms/core/admin/components/AssetsGrid";
|
|
3
|
-
import config from "virtual:kide/config";
|
|
4
|
-
import { assets, folders } from "virtual:kide/runtime";
|
|
5
|
-
import AdminLayout from "@kidecms/core/admin/layouts/AdminLayout.astro";
|
|
6
|
-
|
|
7
|
-
export const prerender = false;
|
|
8
|
-
|
|
9
|
-
const user = Astro.locals.user;
|
|
10
|
-
const accessibleCollections = config.collections.filter((c) => {
|
|
11
|
-
const rule = c.access?.read;
|
|
12
|
-
if (!rule) return true;
|
|
13
|
-
return rule({ user: user ?? null, doc: null, operation: "read", collection: c.slug });
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
const currentFolderId = Astro.url.searchParams.get("folder") || null;
|
|
17
|
-
|
|
18
|
-
// Get current folder details if we're inside one
|
|
19
|
-
const currentFolder = currentFolderId ? await folders.findById(currentFolderId) : null;
|
|
20
|
-
if (currentFolderId && !currentFolder) return Astro.redirect("/admin/assets");
|
|
21
|
-
|
|
22
|
-
// Get subfolders and assets for current location
|
|
23
|
-
const subfolders = await folders.findByParent(currentFolderId);
|
|
24
|
-
const folderAssets = await assets.find({ limit: 100, folder: currentFolderId });
|
|
25
|
-
|
|
26
|
-
// Build breadcrumb trail
|
|
27
|
-
const breadcrumbs: Array<{ label: string; href: string; id: string }> = [];
|
|
28
|
-
if (currentFolder) {
|
|
29
|
-
let folder: typeof currentFolder | null = currentFolder;
|
|
30
|
-
const chain: typeof breadcrumbs = [];
|
|
31
|
-
while (folder) {
|
|
32
|
-
chain.unshift({ label: folder.name, href: `/admin/assets?folder=${folder._id}`, id: folder._id });
|
|
33
|
-
folder = folder.parent ? await folders.findById(folder.parent) : null;
|
|
34
|
-
}
|
|
35
|
-
breadcrumbs.push(...chain);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
// Serialize data for the React island
|
|
39
|
-
const folderData = subfolders.map((f) => ({ _id: f._id, name: f.name }));
|
|
40
|
-
const assetData = folderAssets.map((a) => ({
|
|
41
|
-
_id: a._id,
|
|
42
|
-
filename: a.filename,
|
|
43
|
-
mimeType: a.mimeType,
|
|
44
|
-
url: a.url,
|
|
45
|
-
alt: a.alt,
|
|
46
|
-
_createdAt: a._createdAt,
|
|
47
|
-
}));
|
|
48
|
-
---
|
|
49
|
-
|
|
50
|
-
<AdminLayout
|
|
51
|
-
title="Assets | Kide CMS"
|
|
52
|
-
collections={accessibleCollections}
|
|
53
|
-
activeCollection="assets"
|
|
54
|
-
customNav={config.admin?.nav}
|
|
55
|
-
>
|
|
56
|
-
<AssetsGrid
|
|
57
|
-
client:load
|
|
58
|
-
folders={folderData}
|
|
59
|
-
assets={assetData}
|
|
60
|
-
breadcrumbs={breadcrumbs}
|
|
61
|
-
currentFolderId={currentFolderId}
|
|
62
|
-
/>
|
|
63
|
-
</AdminLayout>
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
import "virtual:kide/admin-css";
|
|
3
|
-
|
|
4
|
-
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@kidecms/core/admin/components/ui/card";
|
|
5
|
-
import { Input } from "@kidecms/core/admin/components/ui/input";
|
|
6
|
-
import { Label } from "@kidecms/core/admin/components/ui/label";
|
|
7
|
-
import { buttonVariants } from "@kidecms/core/admin/components/ui/button";
|
|
8
|
-
|
|
9
|
-
export const prerender = false;
|
|
10
|
-
|
|
11
|
-
const error = Astro.url.searchParams.get("error");
|
|
12
|
-
const errorMessage =
|
|
13
|
-
error === "invalid" ? "Invalid email or password." : error === "missing" ? "Email and password are required." : null;
|
|
14
|
-
---
|
|
15
|
-
|
|
16
|
-
<!doctype html>
|
|
17
|
-
<html lang="en">
|
|
18
|
-
<head>
|
|
19
|
-
<meta charset="utf-8" />
|
|
20
|
-
<meta name="viewport" content="width=device-width" />
|
|
21
|
-
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
|
22
|
-
<link rel="icon" href="/favicon.ico" />
|
|
23
|
-
<title>Sign in | Kide CMS</title>
|
|
24
|
-
</head>
|
|
25
|
-
<body class="bg-background text-foreground min-h-screen antialiased">
|
|
26
|
-
<div class="flex min-h-screen items-center justify-center px-4">
|
|
27
|
-
<div class="w-full max-w-sm space-y-6">
|
|
28
|
-
<Card>
|
|
29
|
-
<CardHeader>
|
|
30
|
-
<CardTitle>Sign in</CardTitle>
|
|
31
|
-
<CardDescription>Enter your credentials to continue</CardDescription>
|
|
32
|
-
</CardHeader>
|
|
33
|
-
<CardContent>
|
|
34
|
-
{
|
|
35
|
-
errorMessage && (
|
|
36
|
-
<div class="border-destructive/50 bg-destructive/10 text-destructive mb-4 rounded-lg border px-3 py-2 text-sm">
|
|
37
|
-
{errorMessage}
|
|
38
|
-
</div>
|
|
39
|
-
)
|
|
40
|
-
}
|
|
41
|
-
<form method="post" action="/api/cms/auth/login" class="grid gap-4">
|
|
42
|
-
<div class="grid gap-2">
|
|
43
|
-
<Label htmlFor="email">Email</Label>
|
|
44
|
-
<Input id="email" name="email" type="email" placeholder="admin@example.com" required autoFocus />
|
|
45
|
-
</div>
|
|
46
|
-
<div class="grid gap-2">
|
|
47
|
-
<Label htmlFor="password">Password</Label>
|
|
48
|
-
<Input id="password" name="password" type="password" placeholder="Enter password" required />
|
|
49
|
-
</div>
|
|
50
|
-
<button class={buttonVariants({ size: "lg", className: "w-full" })} type="submit"> Sign in </button>
|
|
51
|
-
</form>
|
|
52
|
-
</CardContent>
|
|
53
|
-
</Card>
|
|
54
|
-
</div>
|
|
55
|
-
</div>
|
|
56
|
-
</body>
|
|
57
|
-
</html>
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|