@xleddyl/nuxt-cms 0.1.56 → 0.1.58
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/module.json +1 -1
- package/dist/module.mjs +57 -5
- package/dist/runtime/app/components/cms/BlocksField.vue +19 -1
- package/dist/runtime/app/components/cms/MediaField.vue +14 -1
- package/dist/runtime/app/composables/cms-media-keys.d.ts +4 -0
- package/dist/runtime/app/composables/cms-media-keys.js +21 -0
- package/dist/runtime/app/composables/cms-query.js +57 -4
- package/dist/runtime/assets/main.css +1 -1
- package/dist/runtime/seed.js +9 -2
- package/dist/runtime/server/api/collection.get.js +2 -1
- package/dist/runtime/server/api/item.get.js +6 -4
- package/dist/runtime/server/api/item.put.js +5 -4
- package/dist/runtime/server/plugins/migrate-libsql.js +2 -2
- package/dist/runtime/server/routes/graphql.js +2 -0
- package/dist/runtime/server/utils/db-d1.d.ts +2 -0
- package/dist/runtime/server/utils/db-d1.js +5 -0
- package/dist/runtime/server/utils/db-libsql.d.ts +2 -0
- package/dist/runtime/server/utils/db-libsql.js +5 -0
- package/dist/runtime/server/utils/db-postgres.d.ts +2 -0
- package/dist/runtime/server/utils/db-postgres.js +8 -0
- package/dist/runtime/server/utils/db-sqlite.d.ts +2 -0
- package/dist/runtime/server/utils/db-sqlite.js +8 -0
- package/dist/runtime/server/utils/graphql.js +3 -4
- package/dist/runtime/server/utils/libsql-migrations.d.ts +16 -0
- package/dist/runtime/server/utils/libsql-migrations.js +35 -0
- package/dist/runtime/server/utils/media-check.d.ts +2 -0
- package/dist/runtime/server/utils/media-check.js +20 -0
- package/dist/runtime/server/utils/media-references.d.ts +10 -0
- package/dist/runtime/server/utils/media-references.js +50 -0
- package/dist/runtime/server/utils/migrate.d.ts +1 -0
- package/dist/runtime/server/utils/migrate.js +7 -0
- package/dist/runtime/server/utils/page-rows.d.ts +51 -0
- package/dist/runtime/server/utils/page-rows.js +223 -0
- package/dist/runtime/server/utils/page-storage.d.ts +11 -0
- package/dist/runtime/server/utils/page-storage.js +42 -0
- package/dist/runtime/shared/index.d.ts +7 -0
- package/dist/runtime/shared/index.js +21 -0
- package/package.json +1 -1
|
@@ -191,6 +191,7 @@ export function localizeBlocks(field, value, locale, defaultLocale) {
|
|
|
191
191
|
if (!Array.isArray(value)) return value;
|
|
192
192
|
return value.map((item) => localizeBlock(field, item, locale, defaultLocale));
|
|
193
193
|
}
|
|
194
|
+
export const CMS_GRAPHQL_BATCH_LIMIT = 20;
|
|
194
195
|
export function entryTabs(entry) {
|
|
195
196
|
return entry.tabs?.length ? entry.tabs : [];
|
|
196
197
|
}
|
|
@@ -258,6 +259,26 @@ export function pageAllFields(entry) {
|
|
|
258
259
|
}
|
|
259
260
|
return fields;
|
|
260
261
|
}
|
|
262
|
+
export function pageColumnFields(entry) {
|
|
263
|
+
const fields = {};
|
|
264
|
+
for (const key of entry.columns ?? []) {
|
|
265
|
+
const field = entry.fields[key];
|
|
266
|
+
if (field) fields[key] = field;
|
|
267
|
+
}
|
|
268
|
+
return fields;
|
|
269
|
+
}
|
|
270
|
+
export function pageRowFields(entry) {
|
|
271
|
+
const columns = new Set(entry.columns ?? []);
|
|
272
|
+
return Object.fromEntries(
|
|
273
|
+
Object.entries(pageAllFields(entry)).filter(([key]) => !columns.has(key))
|
|
274
|
+
);
|
|
275
|
+
}
|
|
276
|
+
export function pageFieldsTableName(name) {
|
|
277
|
+
return `${name}_fields`;
|
|
278
|
+
}
|
|
279
|
+
export function pageMediaTableName(name) {
|
|
280
|
+
return `${name}_media`;
|
|
281
|
+
}
|
|
261
282
|
export function entryFieldsFor(entry, path) {
|
|
262
283
|
if (entry.kind !== "page") return entry.fields;
|
|
263
284
|
return path ? pageFields(entry, path) : pageAllFields(entry);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xleddyl/nuxt-cms",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.58",
|
|
4
4
|
"description": "Lightweight CMS that ships with your Nuxt app: runs on the Nitro server, content types defined in code, /cms admin panel, GraphQL API, SQLite or Postgres. No external CMS needed!",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Edoardo Alberti (https://github.com/xleddyl)",
|