@xleddyl/nuxt-cms 0.1.49 → 0.1.50

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@xleddyl/nuxt-cms",
3
3
  "configKey": "cms",
4
- "version": "0.1.49",
4
+ "version": "0.1.50",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "unknown"
@@ -4,7 +4,7 @@
4
4
  <nav v-if="links?.length" class="cms-breadcrumb">
5
5
  <template v-for="link in links" :key="link.to">
6
6
  <NuxtLink :to="link.to" class="cms-breadcrumb-link">{{ link.label }}</NuxtLink>
7
- <CmsIcon name="chevron-right" class="cms-breadcrumb-separator size-3" />
7
+ <CmsIcon name="chevron-right" class="cms-breadcrumb-separator size-2.5" />
8
8
  </template>
9
9
  </nav>
10
10
  <div class="cms-actions">
@@ -228,8 +228,20 @@ function isList(value) {
228
228
  return !!value && Array.isArray(value.items);
229
229
  }
230
230
  const rows = computed(() => isList(data.value) ? data.value.items : []);
231
+ const mounted = ref(false);
232
+ onMounted(() => {
233
+ mounted.value = true;
234
+ });
231
235
  function lastEdit(value) {
232
- return typeof value === "string" && value ? value.slice(0, 10) : "never saved";
236
+ if (typeof value !== "string" || !value) return "Never saved";
237
+ const stamp = value.includes("T") ? value : value.replace(" ", "T") + "Z";
238
+ const date = new Date(stamp);
239
+ if (Number.isNaN(date.getTime())) return `Last edit ${value.slice(0, 10)}`;
240
+ if (!mounted.value) return `Last edit ${value.slice(0, 10)}`;
241
+ return `Last edit ${date.toLocaleDateString()} ${date.toLocaleTimeString([], {
242
+ hour: "2-digit",
243
+ minute: "2-digit"
244
+ })}`;
233
245
  }
234
246
  const pageTree = computed(() => {
235
247
  const byPath = new Set(rows.value.map((row) => String(row.path)));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xleddyl/nuxt-cms",
3
- "version": "0.1.49",
3
+ "version": "0.1.50",
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)",