@commonpub/layer 0.3.9 → 0.3.10

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.
@@ -61,7 +61,7 @@ export function useMirrorContent(fedContent: Ref<Record<string, unknown> | null>
61
61
  previewToken: null,
62
62
  parts: Array.isArray(meta?.parts) ? meta.parts as ContentViewData['parts'] : null,
63
63
  sections: null,
64
- viewCount: 0,
64
+ viewCount: (fc.localViewCount as number) ?? 0,
65
65
  likeCount: (fc.localLikeCount as number) ?? 0,
66
66
  commentCount: (fc.localCommentCount as number) ?? 0,
67
67
  forkCount: 0,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@commonpub/layer",
3
- "version": "0.3.9",
3
+ "version": "0.3.10",
4
4
  "type": "module",
5
5
  "main": "./nuxt.config.ts",
6
6
  "files": [
@@ -44,15 +44,15 @@
44
44
  "vue": "^3.4.0",
45
45
  "vue-router": "^4.3.0",
46
46
  "zod": "^4.3.6",
47
- "@commonpub/config": "0.7.0",
48
47
  "@commonpub/auth": "0.5.0",
49
- "@commonpub/docs": "0.5.2",
50
48
  "@commonpub/editor": "0.5.0",
51
- "@commonpub/server": "2.9.0",
49
+ "@commonpub/learning": "0.5.0",
52
50
  "@commonpub/schema": "0.8.10",
53
- "@commonpub/protocol": "0.9.4",
54
51
  "@commonpub/ui": "0.7.1",
55
- "@commonpub/learning": "0.5.0"
52
+ "@commonpub/config": "0.7.0",
53
+ "@commonpub/protocol": "0.9.4",
54
+ "@commonpub/server": "2.9.0",
55
+ "@commonpub/docs": "0.5.2"
56
56
  },
57
57
  "scripts": {}
58
58
  }
@@ -202,7 +202,7 @@ async function handleDiscPost(): Promise<void> {
202
202
  // --- Instance mirror status (not user-level follow) ---
203
203
  const mirrorStatus = computed(() => hub.value?.followStatus ?? 'pending');
204
204
 
205
- const remoteFollowRef = ref<InstanceType<typeof RemoteFollowDialog> | null>(null);
205
+ const remoteFollowRef = ref<{ show: () => void } | null>(null);
206
206
 
207
207
  // --- Like state tracking ---
208
208
  const likedPostIds = ref<Set<string>>(new Set());
@@ -18,7 +18,7 @@ const {
18
18
  const { user } = useAuth();
19
19
  const following = ref(false);
20
20
  const followState = ref<'idle' | 'sent' | 'error'>('idle');
21
- const remoteFollowRef = ref<InstanceType<typeof RemoteFollowDialog> | null>(null);
21
+ const remoteFollowRef = ref<{ show: () => void } | null>(null);
22
22
 
23
23
  async function followAuthor(): Promise<void> {
24
24
  const uri = actor.value?.actorUri as string | undefined;
@@ -43,6 +43,11 @@ if (originUrl.value) {
43
43
  });
44
44
  }
45
45
 
46
+ /** Strip HTML tags from remote actor bio (unsanitized — XSS risk with v-html) */
47
+ function stripHtml(html: string): string {
48
+ return html.replace(/<[^>]*>/g, '').trim();
49
+ }
50
+
46
51
  // Track view
47
52
  onMounted(() => {
48
53
  $fetch(`/api/federation/content/${id}/view`, { method: 'POST' }).catch(() => {});
@@ -109,7 +114,7 @@ useSeoMeta({
109
114
  <strong>{{ transformedContent.author.displayName }}</strong>
110
115
  <span v-if="authorHandle" class="cpub-mirror-handle">{{ authorHandle }}</span>
111
116
  <span v-if="transformedContent.author.followerCount" class="cpub-mirror-handle">&middot; {{ transformedContent.author.followerCount }} followers</span>
112
- <p v-if="transformedContent.author.bio" class="cpub-mirror-bio" v-html="transformedContent.author.bio" />
117
+ <p v-if="transformedContent.author.bio" class="cpub-mirror-bio">{{ stripHtml(transformedContent.author.bio) }}</p>
113
118
  </div>
114
119
  </div>
115
120
  <div v-if="typeof transformedContent.content === 'string'" class="cpub-mirror-body prose" v-html="transformedContent.content" />