@threenine/nuxstr-comments 1.5.1 → 1.5.2
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/README.md +22 -24
- package/dist/module.json +1 -1
- package/dist/runtime/components/CommentView.d.vue.ts +1 -1
- package/dist/runtime/components/CommentView.vue +11 -7
- package/dist/runtime/components/CommentView.vue.d.ts +1 -1
- package/dist/runtime/components/ReplyView.vue +3 -1
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -38,27 +38,13 @@ npx nuxi module add @threenine/nuxstr-comments
|
|
|
38
38
|
That's it! You can now use Nuxstr Comments in your Nuxt app ✨
|
|
39
39
|
|
|
40
40
|
### Usage
|
|
41
|
-
|
|
42
|
-
1. Ensure @nuxt/content is enabled and your blog post pages use ContentDoc or render content files.
|
|
43
|
-
2. Add the comments component where you want comments to appear (usually below a ContentDoc):
|
|
44
|
-
|
|
45
|
-
```vue
|
|
46
|
-
<template>
|
|
47
|
-
<div>
|
|
48
|
-
<ContentDoc />
|
|
49
|
-
<NuxstrComments />
|
|
50
|
-
</div>
|
|
51
|
-
</template>
|
|
52
|
-
```
|
|
53
|
-
|
|
54
41
|
By default, the component tags comments by the current route path (e.g., content:/blog/my-post) and fetches them from configured relays.
|
|
55
42
|
|
|
56
|
-
|
|
43
|
+
1. Configuration (nuxt.config.ts):
|
|
57
44
|
|
|
58
45
|
```ts
|
|
59
46
|
export default defineNuxtConfig({
|
|
60
47
|
modules: [
|
|
61
|
-
'@nuxt/content',
|
|
62
48
|
'@threenine/nuxstr-comments',
|
|
63
49
|
],
|
|
64
50
|
nuxstrComments: {
|
|
@@ -68,6 +54,18 @@ export default defineNuxtConfig({
|
|
|
68
54
|
},
|
|
69
55
|
})
|
|
70
56
|
```
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
2. Add the comments component where you want comments to appear (usually below a ContentDoc):
|
|
60
|
+
|
|
61
|
+
```vue
|
|
62
|
+
<template>
|
|
63
|
+
<div>
|
|
64
|
+
<NuxstrComments />
|
|
65
|
+
</div>
|
|
66
|
+
</template>
|
|
67
|
+
```
|
|
68
|
+
|
|
71
69
|
Select your preferred relays from the list of [relays](https://nostrwat.ch/) and configure the tag strategy and tag prefix.
|
|
72
70
|
|
|
73
71
|
When a user attempts to post, they will be prompted to log in with their Nostr browser extension [NIP-07](https://github.com/nostr-protocol/nips/blob/master/07.md).
|
|
@@ -75,7 +73,7 @@ When a user attempts to post, they will be prompted to log in with their Nostr b
|
|
|
75
73
|
Comments are published as kind: 1111 as defined in [NIP-22](https://github.com/nostr-protocol/nips/blob/master/22.md)
|
|
76
74
|
notes tagged with a `t` tag containing the content tag (e.g., `comment:/blog/my-post`).
|
|
77
75
|
|
|
78
|
-
Replys to comments are
|
|
76
|
+
Replys to comments are enabled, and are also published as kind: 1111, as defined in [NIP-22](https://github.com/nostr-protocol/nips/blob/master/22.md)
|
|
79
77
|
|
|
80
78
|
|
|
81
79
|
|
|
@@ -86,26 +84,26 @@ Replys to comments are enable, and are also published as kind: 1111, as defined
|
|
|
86
84
|
|
|
87
85
|
```bash
|
|
88
86
|
# Install dependencies
|
|
89
|
-
|
|
87
|
+
pnpm install
|
|
90
88
|
|
|
91
89
|
# Generate type stubs
|
|
92
|
-
|
|
90
|
+
pnpm run dev:prepare
|
|
93
91
|
|
|
94
92
|
# Develop with the playground
|
|
95
|
-
|
|
93
|
+
pnpm run dev
|
|
96
94
|
|
|
97
95
|
# Build the playground
|
|
98
|
-
|
|
96
|
+
pnpm run dev:build
|
|
99
97
|
|
|
100
98
|
# Run ESLint
|
|
101
|
-
|
|
99
|
+
pnpm run lint
|
|
102
100
|
|
|
103
101
|
# Run Vitest
|
|
104
|
-
|
|
105
|
-
|
|
102
|
+
pnpm run test
|
|
103
|
+
pnpm run test:watch
|
|
106
104
|
|
|
107
105
|
# Release new version
|
|
108
|
-
|
|
106
|
+
pnpm run release
|
|
109
107
|
```
|
|
110
108
|
|
|
111
109
|
</details>
|
package/dist/module.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
type __VLS_Props = {
|
|
2
2
|
content: string;
|
|
3
|
-
id
|
|
3
|
+
id: string;
|
|
4
4
|
};
|
|
5
5
|
declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
6
6
|
export default _default;
|
|
@@ -1,19 +1,23 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
+
import { onMounted } from "vue";
|
|
2
3
|
import { marked } from "marked";
|
|
3
4
|
const props = defineProps({
|
|
4
5
|
content: { type: String, required: true },
|
|
5
|
-
id: { type: String, required:
|
|
6
|
+
id: { type: String, required: true }
|
|
7
|
+
});
|
|
8
|
+
async function renderMarkdown(md) {
|
|
9
|
+
return marked.parse(md);
|
|
10
|
+
}
|
|
11
|
+
onMounted(async () => {
|
|
12
|
+
const targetEl = document.getElementById("comment-content");
|
|
13
|
+
if (!targetEl) return;
|
|
14
|
+
targetEl.innerHTML = await renderMarkdown(props.content);
|
|
6
15
|
});
|
|
7
16
|
</script>
|
|
8
17
|
|
|
9
18
|
<template>
|
|
10
19
|
<div class="mt-2 mb-2">
|
|
11
|
-
|
|
12
|
-
<div
|
|
13
|
-
class="mb-1"
|
|
14
|
-
v-html="marked.parse(props.content)"
|
|
15
|
-
/>
|
|
16
|
-
<!-- eslint-disable-next-line vue/no-v-html -->
|
|
20
|
+
<div id="comment-content" />
|
|
17
21
|
<ReplyButton :content-id="props.id" />
|
|
18
22
|
</div>
|
|
19
23
|
</template>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
type __VLS_Props = {
|
|
2
2
|
content: string;
|
|
3
|
-
id
|
|
3
|
+
id: string;
|
|
4
4
|
};
|
|
5
5
|
declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
6
6
|
export default _default;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@threenine/nuxstr-comments",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.2",
|
|
4
4
|
"description": "Nuxt module to enable Nostr Comments on Nuxt 4 based websites",
|
|
5
5
|
"repository": "threenine/nuxstr-comments",
|
|
6
6
|
"license": "MIT",
|
|
@@ -24,7 +24,6 @@
|
|
|
24
24
|
],
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@nostr-dev-kit/ndk": "^2.14.33",
|
|
27
|
-
"@nuxt/kit": "^4.0.3",
|
|
28
27
|
"defu": "^6.1.4",
|
|
29
28
|
"marked": "^16.2.1"
|
|
30
29
|
},
|
|
@@ -32,13 +31,15 @@
|
|
|
32
31
|
"@nuxt/devtools": "^2.6.2",
|
|
33
32
|
"@nuxt/eslint": "1.9.0",
|
|
34
33
|
"@nuxt/eslint-config": "^1.9.0",
|
|
34
|
+
"@nuxt/kit": "^4.1.2",
|
|
35
35
|
"@nuxt/module-builder": "^1.0.2",
|
|
36
|
-
"@nuxt/schema": "^4.1.
|
|
36
|
+
"@nuxt/schema": "^4.1.2",
|
|
37
37
|
"@nuxt/scripts": "0.11.10",
|
|
38
38
|
"@nuxt/test-utils": "^3.19.2",
|
|
39
39
|
"@nuxt/ui": "^3.3.3",
|
|
40
40
|
"@testing-library/jest-dom": "^6.8.0",
|
|
41
41
|
"@testing-library/vue": "^8.1.0",
|
|
42
|
+
"@types/node": "latest",
|
|
42
43
|
"@unhead/vue": "^2.0.14",
|
|
43
44
|
"changelogen": "^0.6.2",
|
|
44
45
|
"eslint": "^9.35.0",
|
|
@@ -46,8 +47,7 @@
|
|
|
46
47
|
"nuxt": "^4.1.2",
|
|
47
48
|
"typescript": "~5.9.2",
|
|
48
49
|
"vitest": "^3.2.4",
|
|
49
|
-
"vue-tsc": "^3.0.6"
|
|
50
|
-
"@types/node": "latest"
|
|
50
|
+
"vue-tsc": "^3.0.6"
|
|
51
51
|
},
|
|
52
52
|
"scripts": {
|
|
53
53
|
"dev": "pnpm run dev:prepare && nuxi dev playground",
|