@commonpub/layer 0.21.8 → 0.21.9

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@commonpub/layer",
3
- "version": "0.21.8",
3
+ "version": "0.21.9",
4
4
  "type": "module",
5
5
  "main": "./nuxt.config.ts",
6
6
  "files": [
@@ -50,16 +50,16 @@
50
50
  "vue": "^3.4.0",
51
51
  "vue-router": "^4.3.0",
52
52
  "zod": "^4.3.6",
53
- "@commonpub/auth": "0.6.0",
53
+ "@commonpub/config": "0.13.0",
54
54
  "@commonpub/docs": "0.6.3",
55
+ "@commonpub/explainer": "0.7.13",
56
+ "@commonpub/auth": "0.6.0",
55
57
  "@commonpub/learning": "0.5.2",
56
58
  "@commonpub/schema": "0.16.0",
57
- "@commonpub/editor": "0.7.9",
58
59
  "@commonpub/protocol": "0.10.0",
59
- "@commonpub/ui": "0.8.5",
60
- "@commonpub/explainer": "0.7.13",
60
+ "@commonpub/editor": "0.7.9",
61
61
  "@commonpub/server": "2.54.0",
62
- "@commonpub/config": "0.13.0"
62
+ "@commonpub/ui": "0.8.5"
63
63
  },
64
64
  "devDependencies": {
65
65
  "@testing-library/jest-dom": "^6.9.1",
@@ -40,10 +40,15 @@ const isOwner = computed(() => user.value?.id === content.value?.author?.id);
40
40
 
41
41
  // Estimate reading time (~200 words per minute)
42
42
  const readTime = computed(() => {
43
- if (!content.value?.content) return undefined;
44
- const blocks = content.value.content as BlockTuple[];
43
+ // Explainer document-format content is an object ({hero,sections,…}),
44
+ // not a BlockTuple[] — only blog/project store an array. Guard the
45
+ // for…of: iterating the object threw "not iterable" and 500'd SSR for
46
+ // every document-format explainer.
47
+ const raw = content.value?.content;
48
+ if (!Array.isArray(raw)) return undefined;
49
+ const blocks = raw as BlockTuple[];
45
50
  let words = 0;
46
- for (const [type, data] of blocks) {
51
+ for (const [, data] of blocks) {
47
52
  // Extract text from any string field in the block data
48
53
  for (const val of Object.values(data)) {
49
54
  if (typeof val === 'string' && val.trim()) {