@commonpub/editor 0.6.0 → 0.6.1

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/editor",
3
- "version": "0.6.0",
3
+ "version": "0.6.1",
4
4
  "type": "module",
5
5
  "description": "TipTap block editor with 18+ maker-focused extensions for CommonPub",
6
6
  "license": "AGPL-3.0-or-later",
@@ -50,8 +50,8 @@
50
50
  "remark-rehype": "^11.1.2",
51
51
  "unified": "^11.0.5",
52
52
  "zod": "^4.3.6",
53
- "@commonpub/config": "0.8.0",
54
- "@commonpub/schema": "0.9.2"
53
+ "@commonpub/schema": "0.9.2",
54
+ "@commonpub/config": "0.8.0"
55
55
  },
56
56
  "peerDependencies": {
57
57
  "vue": "^3.4.0",
@@ -4,11 +4,11 @@ import { markdownToBlockTuples } from '@commonpub/editor';
4
4
  import type { BlockTuple } from '@commonpub/editor';
5
5
 
6
6
  const props = defineProps<{
7
- content: { source: string };
7
+ content: Record<string, unknown>;
8
8
  }>();
9
9
 
10
10
  const emit = defineEmits<{
11
- update: [content: { source: string }];
11
+ update: [content: Record<string, unknown>];
12
12
  }>();
13
13
 
14
14
  /** Type-safe block content accessors — cast content to record for dynamic key access */
@@ -20,10 +20,10 @@ function bNum(block: BlockTuple, key: string): number {
20
20
  }
21
21
 
22
22
  const viewMode = ref<'edit' | 'split' | 'preview'>('split');
23
- const source = ref(props.content.source || '');
23
+ const source = ref((props.content.source as string) || '');
24
24
 
25
- watch(() => props.content.source, (val) => {
26
- if (val !== source.value) source.value = val;
25
+ watch(() => props.content.source as string, (val) => {
26
+ if (val !== source.value) source.value = val ?? '';
27
27
  });
28
28
 
29
29
  const previewBlocks = computed(() => {