@kidecms/core 0.25.1 → 0.26.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/admin/admin-base.css +5 -0
- package/admin/components/ContentEditor.tsx +36 -11
- package/admin/components/DocumentCombobox.tsx +53 -11
- package/admin/components/DocumentsDataTable.tsx +5 -6
- package/admin/components/EditorImage.tsx +134 -0
- package/admin/components/RelationField.tsx +2 -1
- package/admin/components/RichTextEditor.tsx +23 -13
- package/admin/components/block-fields.tsx +2 -1
- package/admin/components/slash-command.tsx +29 -5
- package/admin/lib/edit-data.ts +12 -8
- package/admin/lib/editor-commands.ts +23 -0
- package/admin/lib/use-document-search.ts +17 -8
- package/admin/views/EditView.astro +63 -24
- package/admin/views/ListView.astro +1 -6
- package/admin/views/RecentView.astro +1 -6
- package/admin/views/SinglesView.astro +3 -6
- package/core/api.ts +67 -4
- package/core/generator.ts +12 -2
- package/core/migrate.ts +24 -5
- package/core/values.ts +3 -1
- package/internals/mcp-worker.ts +5 -5
- package/internals/mcp.ts +3 -1
- package/package.json +1 -1
- package/routes/api/[collection]/[...path].ts +1 -1
- package/routes/api/admin/search.ts +11 -3
|
@@ -90,7 +90,7 @@ const extractDataFromForm = async (request: Request) => {
|
|
|
90
90
|
data: Object.fromEntries(
|
|
91
91
|
entries.filter(
|
|
92
92
|
([key]) =>
|
|
93
|
-
(!key.startsWith("_") || key === "_publishAt" || key === "_unpublishAt") &&
|
|
93
|
+
(!key.startsWith("_") || key === "_publishAt" || key === "_unpublishAt" || key === "_sourceLocale") &&
|
|
94
94
|
key !== "redirectTo" &&
|
|
95
95
|
key !== "locale" &&
|
|
96
96
|
key !== "version",
|
|
@@ -74,6 +74,9 @@ export const GET: APIRoute = async ({ url, locals }) => {
|
|
|
74
74
|
(c) => requested.includes(c.slug) && !HIDDEN_FROM_SEARCH.has(c.slug),
|
|
75
75
|
);
|
|
76
76
|
const results: SearchResult[] = [];
|
|
77
|
+
// Pickers say so when the list is cut off, so 20 rows don't read as "all
|
|
78
|
+
// there is" — one extra row tells us without a count query.
|
|
79
|
+
let hasMore = false;
|
|
77
80
|
|
|
78
81
|
for (const collection of collections) {
|
|
79
82
|
const api = cmsAny[collection.slug];
|
|
@@ -92,15 +95,20 @@ export const GET: APIRoute = async ({ url, locals }) => {
|
|
|
92
95
|
// Recently-updated first in both modes — without a sort, LIMIT keeps an
|
|
93
96
|
// arbitrary subset of the matches.
|
|
94
97
|
const sort = { field: "_updatedAt", direction: "desc" } as const;
|
|
95
|
-
|
|
96
|
-
|
|
98
|
+
const probe = limit + 1;
|
|
99
|
+
const found =
|
|
100
|
+
q.length >= MIN_QUERY_LENGTH
|
|
101
|
+
? await api.find({ search: q, status: "any", sort, limit: probe }, context)
|
|
102
|
+
: await api.find({ status: "any", sort, limit: probe }, context);
|
|
103
|
+
if (found.length > limit) hasMore = true;
|
|
104
|
+
return found.slice(0, limit);
|
|
97
105
|
})().catch(() => null);
|
|
98
106
|
|
|
99
107
|
if (!docs) continue;
|
|
100
108
|
for (const doc of docs) results.push(toResult(collection, doc));
|
|
101
109
|
}
|
|
102
110
|
|
|
103
|
-
return Response.json({ results });
|
|
111
|
+
return Response.json({ results, hasMore });
|
|
104
112
|
}
|
|
105
113
|
|
|
106
114
|
// Palette mode: everything, a few hits per collection.
|