@blogmcp/community 0.1.0 → 0.3.0

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.
Files changed (114) hide show
  1. package/README.md +162 -13
  2. package/dist/blogmcp-community.global.js +8 -8
  3. package/dist/chunks/mount--2_V2q3M.js +10063 -0
  4. package/dist/core/attrs.d.ts +42 -1
  5. package/dist/core/badge.d.ts +30 -0
  6. package/dist/core/centre.d.ts +28 -0
  7. package/dist/core/digest-token.d.ts +2 -0
  8. package/dist/core/discussion.d.ts +120 -15
  9. package/dist/core/follow.d.ts +26 -0
  10. package/dist/core/format.d.ts +7 -0
  11. package/dist/core/forum-category.d.ts +85 -0
  12. package/dist/core/forum-search.d.ts +35 -0
  13. package/dist/core/forum-state.d.ts +30 -0
  14. package/dist/core/forum-words.d.ts +8 -0
  15. package/dist/core/forum.d.ts +21 -0
  16. package/dist/core/moderation.d.ts +80 -0
  17. package/dist/core/onboarding.d.ts +49 -2
  18. package/dist/core/outcomes.d.ts +2 -1
  19. package/dist/core/panel.d.ts +17 -1
  20. package/dist/core/profile.d.ts +45 -0
  21. package/dist/core/push.d.ts +63 -0
  22. package/dist/core/realtime.d.ts +46 -0
  23. package/dist/core/settings.d.ts +53 -0
  24. package/dist/core/text.d.ts +13 -0
  25. package/dist/core/topic.d.ts +47 -0
  26. package/dist/element.d.ts +47 -1
  27. package/dist/global.d.ts +8 -4
  28. package/dist/index.d.ts +20 -3
  29. package/dist/index.js +62 -12
  30. package/dist/mount.d.ts +89 -0
  31. package/dist/react.d.ts +27 -3
  32. package/dist/react.js +48 -4
  33. package/dist/ui/BadgeView.vue.d.ts +13 -0
  34. package/dist/ui/DiscussionView.vue.d.ts +11 -0
  35. package/dist/ui/FollowButtonView.vue.d.ts +17 -0
  36. package/dist/ui/FollowToggle.vue.d.ts +6 -0
  37. package/dist/ui/ForumCategoryView.vue.d.ts +13 -0
  38. package/dist/ui/ForumModerationView.vue.d.ts +12 -0
  39. package/dist/ui/ForumNotices.vue.d.ts +7 -0
  40. package/dist/ui/ForumSearchView.vue.d.ts +11 -0
  41. package/dist/ui/ForumView.vue.d.ts +12 -0
  42. package/dist/ui/LinkedText.vue.d.ts +1 -0
  43. package/dist/ui/MemberSettingsView.vue.d.ts +13 -0
  44. package/dist/ui/MembersOnly.vue.d.ts +15 -0
  45. package/dist/ui/MessageComposer.vue.d.ts +8 -2
  46. package/dist/ui/MessageMenu.vue.d.ts +2 -0
  47. package/dist/ui/ModeratorDialog.vue.d.ts +11 -0
  48. package/dist/ui/NotificationCentreView.vue.d.ts +12 -0
  49. package/dist/ui/OnboardingSteps.vue.d.ts +1 -1
  50. package/dist/ui/ProfileView.vue.d.ts +13 -0
  51. package/dist/ui/TopicRow.vue.d.ts +10 -0
  52. package/dist/ui/TopicView.vue.d.ts +32 -0
  53. package/dist/ui/WelcomeView.vue.d.ts +12 -0
  54. package/dist/ui/context.d.ts +7 -1
  55. package/dist/ui/discussion-context.d.ts +11 -3
  56. package/dist/vue.d.ts +273 -3
  57. package/dist/vue.js +235 -5
  58. package/package.json +3 -3
  59. package/src/core/attrs.ts +61 -2
  60. package/src/core/badge.ts +120 -0
  61. package/src/core/centre.ts +136 -0
  62. package/src/core/digest-token.ts +26 -0
  63. package/src/core/discussion.ts +497 -46
  64. package/src/core/follow.ts +139 -0
  65. package/src/core/format.ts +22 -0
  66. package/src/core/forum-category.ts +323 -0
  67. package/src/core/forum-search.ts +153 -0
  68. package/src/core/forum-state.ts +59 -0
  69. package/src/core/forum-words.ts +38 -0
  70. package/src/core/forum.ts +83 -0
  71. package/src/core/moderation.ts +414 -0
  72. package/src/core/onboarding.ts +177 -18
  73. package/src/core/outcomes.ts +23 -1
  74. package/src/core/panel.ts +39 -4
  75. package/src/core/profile.ts +155 -0
  76. package/src/core/push.ts +174 -0
  77. package/src/core/realtime.ts +52 -0
  78. package/src/core/settings.ts +363 -0
  79. package/src/core/text.ts +32 -0
  80. package/src/core/topic.ts +234 -0
  81. package/src/element.ts +124 -6
  82. package/src/global.ts +40 -4
  83. package/src/index.ts +84 -2
  84. package/src/mount.ts +250 -1
  85. package/src/react.ts +90 -3
  86. package/src/ui/BadgeView.vue +51 -0
  87. package/src/ui/DiscussionView.vue +43 -3
  88. package/src/ui/FollowButtonView.vue +85 -0
  89. package/src/ui/FollowToggle.vue +39 -0
  90. package/src/ui/ForumCategoryView.vue +243 -0
  91. package/src/ui/ForumModerationView.vue +309 -0
  92. package/src/ui/ForumNotices.vue +23 -0
  93. package/src/ui/ForumSearchView.vue +171 -0
  94. package/src/ui/ForumView.vue +128 -0
  95. package/src/ui/LinkedText.vue +11 -5
  96. package/src/ui/MemberSettingsView.vue +175 -0
  97. package/src/ui/MembersOnly.vue +59 -0
  98. package/src/ui/MessageComposer.vue +64 -11
  99. package/src/ui/MessageItem.vue +36 -7
  100. package/src/ui/MessageMenu.vue +3 -2
  101. package/src/ui/ModeratorDialog.vue +102 -0
  102. package/src/ui/MyCommunityView.vue +12 -0
  103. package/src/ui/NoticeStatusView.vue +15 -2
  104. package/src/ui/NotificationCentreView.vue +193 -0
  105. package/src/ui/OnboardingSteps.vue +17 -6
  106. package/src/ui/ProfileView.vue +102 -0
  107. package/src/ui/TopicRow.vue +70 -0
  108. package/src/ui/TopicView.vue +395 -0
  109. package/src/ui/WelcomeView.vue +72 -0
  110. package/src/ui/context.ts +8 -3
  111. package/src/ui/discussion-context.ts +11 -3
  112. package/src/ui/styles.css +30 -0
  113. package/src/vue.ts +271 -3
  114. package/dist/chunks/mount-DzjwnHyx.js +0 -4597
package/dist/vue.d.ts CHANGED
@@ -1,5 +1,7 @@
1
1
  /**
2
- * `<KbDiscussion>`, `<KbNoticeForm>`, `<KbMyCommunity>` for Vue / Nuxt: each mounts its element on the
2
+ * `<KbDiscussion>`, `<KbNoticeForm>`, `<KbMyCommunity>`, (M2) `<KbNotificationCentre>`, `<KbBadge>`,
3
+ * `<KbMemberSettings>`, `<KbProfile>`, `<KbWelcome>` and (M3) `<KbForum>`, `<KbForumCategory>`, `<KbTopic>`,
4
+ * `<KbForumSearch>`, `<KbFollowButton>`, `<KbForumModeration>` for Vue / Nuxt: each mounts its element on the
3
5
  * client, after hydration, and removes it on unmount. Each renders one empty `<div>` as the mount point —
4
6
  * nothing else, on the server or the client — so the element sits where the component does and the page's
5
7
  * markup is otherwise the site's alone.
@@ -12,7 +14,8 @@
12
14
  import { type PropType } from 'vue';
13
15
  import type { CommunityTransport } from '@blogmcp/sdk/community';
14
16
  import type { CommunityRoutes } from './core/attrs';
15
- import type { MountDiscussionOptions, MountMyCommunityOptions, MountNoticeFormOptions } from './mount';
17
+ import type { DiscussionRealtime, TopicRealtime } from './core/realtime';
18
+ import type { MountBadgeOptions, MountDiscussionOptions, MountFollowButtonOptions, MountForumCategoryOptions, MountForumModerationOptions, MountForumOptions, MountForumSearchOptions, MountMemberSettingsOptions, MountMyCommunityOptions, MountNoticeFormOptions, MountNotificationCentreOptions, MountProfileOptions, MountTopicOptions, MountWelcomeOptions } from './mount';
16
19
  export declare const KbDiscussion: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
17
20
  articleId: {
18
21
  type: StringConstructor;
@@ -26,6 +29,8 @@ export declare const KbDiscussion: import("vue").DefineComponent<import("vue").E
26
29
  pollMs: NumberConstructor;
27
30
  nonce: StringConstructor;
28
31
  transport: PropType<CommunityTransport>;
32
+ /** M2: `createRealtimeSession` of `@blogmcp/sdk/community/realtime`. */
33
+ realtime: PropType<DiscussionRealtime>;
29
34
  }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
30
35
  [key: string]: any;
31
36
  }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
@@ -41,6 +46,8 @@ export declare const KbDiscussion: import("vue").DefineComponent<import("vue").E
41
46
  pollMs: NumberConstructor;
42
47
  nonce: StringConstructor;
43
48
  transport: PropType<CommunityTransport>;
49
+ /** M2: `createRealtimeSession` of `@blogmcp/sdk/community/realtime`. */
50
+ realtime: PropType<DiscussionRealtime>;
44
51
  }>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
45
52
  export declare const KbNoticeForm: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
46
53
  target: PropType<MountNoticeFormOptions["target"]>;
@@ -86,4 +93,267 @@ export declare const KbMyCommunity: import("vue").DefineComponent<import("vue").
86
93
  nonce: StringConstructor;
87
94
  transport: PropType<CommunityTransport>;
88
95
  }>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
89
- export type { MountDiscussionOptions, MountNoticeFormOptions, MountMyCommunityOptions, CommunityRoutes };
96
+ export declare const KbNotificationCentre: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
97
+ apiBase: StringConstructor;
98
+ siteBase: StringConstructor;
99
+ lang: StringConstructor;
100
+ signInHref: StringConstructor;
101
+ routes: PropType<CommunityRoutes>;
102
+ nonce: StringConstructor;
103
+ transport: PropType<CommunityTransport>;
104
+ }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
105
+ [key: string]: any;
106
+ }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
107
+ apiBase: StringConstructor;
108
+ siteBase: StringConstructor;
109
+ lang: StringConstructor;
110
+ signInHref: StringConstructor;
111
+ routes: PropType<CommunityRoutes>;
112
+ nonce: StringConstructor;
113
+ transport: PropType<CommunityTransport>;
114
+ }>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
115
+ export declare const KbBadge: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
116
+ apiBase: StringConstructor;
117
+ siteBase: StringConstructor;
118
+ lang: StringConstructor;
119
+ routes: PropType<CommunityRoutes>;
120
+ pollMs: NumberConstructor;
121
+ nonce: StringConstructor;
122
+ transport: PropType<CommunityTransport>;
123
+ }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
124
+ [key: string]: any;
125
+ }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
126
+ apiBase: StringConstructor;
127
+ siteBase: StringConstructor;
128
+ lang: StringConstructor;
129
+ routes: PropType<CommunityRoutes>;
130
+ pollMs: NumberConstructor;
131
+ nonce: StringConstructor;
132
+ transport: PropType<CommunityTransport>;
133
+ }>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
134
+ export declare const KbMemberSettings: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
135
+ apiBase: StringConstructor;
136
+ siteBase: StringConstructor;
137
+ lang: StringConstructor;
138
+ swPath: StringConstructor;
139
+ signInHref: StringConstructor;
140
+ routes: PropType<CommunityRoutes>;
141
+ nonce: StringConstructor;
142
+ transport: PropType<CommunityTransport>;
143
+ }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
144
+ [key: string]: any;
145
+ }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
146
+ apiBase: StringConstructor;
147
+ siteBase: StringConstructor;
148
+ lang: StringConstructor;
149
+ swPath: StringConstructor;
150
+ signInHref: StringConstructor;
151
+ routes: PropType<CommunityRoutes>;
152
+ nonce: StringConstructor;
153
+ transport: PropType<CommunityTransport>;
154
+ }>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
155
+ export declare const KbProfile: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
156
+ handle: {
157
+ type: StringConstructor;
158
+ required: true;
159
+ };
160
+ apiBase: StringConstructor;
161
+ siteBase: StringConstructor;
162
+ lang: StringConstructor;
163
+ signInHref: StringConstructor;
164
+ routes: PropType<CommunityRoutes>;
165
+ nonce: StringConstructor;
166
+ transport: PropType<CommunityTransport>;
167
+ }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
168
+ [key: string]: any;
169
+ }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
170
+ handle: {
171
+ type: StringConstructor;
172
+ required: true;
173
+ };
174
+ apiBase: StringConstructor;
175
+ siteBase: StringConstructor;
176
+ lang: StringConstructor;
177
+ signInHref: StringConstructor;
178
+ routes: PropType<CommunityRoutes>;
179
+ nonce: StringConstructor;
180
+ transport: PropType<CommunityTransport>;
181
+ }>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
182
+ export declare const KbWelcome: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
183
+ apiBase: StringConstructor;
184
+ siteBase: StringConstructor;
185
+ lang: StringConstructor;
186
+ signInHref: StringConstructor;
187
+ routes: PropType<CommunityRoutes>;
188
+ nonce: StringConstructor;
189
+ transport: PropType<CommunityTransport>;
190
+ }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
191
+ [key: string]: any;
192
+ }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
193
+ apiBase: StringConstructor;
194
+ siteBase: StringConstructor;
195
+ lang: StringConstructor;
196
+ signInHref: StringConstructor;
197
+ routes: PropType<CommunityRoutes>;
198
+ nonce: StringConstructor;
199
+ transport: PropType<CommunityTransport>;
200
+ }>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
201
+ export declare const KbForum: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
202
+ apiBase: StringConstructor;
203
+ siteBase: StringConstructor;
204
+ lang: StringConstructor;
205
+ signInHref: StringConstructor;
206
+ routes: PropType<CommunityRoutes>;
207
+ nonce: StringConstructor;
208
+ transport: PropType<CommunityTransport>;
209
+ }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
210
+ [key: string]: any;
211
+ }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
212
+ apiBase: StringConstructor;
213
+ siteBase: StringConstructor;
214
+ lang: StringConstructor;
215
+ signInHref: StringConstructor;
216
+ routes: PropType<CommunityRoutes>;
217
+ nonce: StringConstructor;
218
+ transport: PropType<CommunityTransport>;
219
+ }>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
220
+ export declare const KbForumCategory: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
221
+ slug: {
222
+ type: StringConstructor;
223
+ required: true;
224
+ };
225
+ apiBase: StringConstructor;
226
+ siteBase: StringConstructor;
227
+ lang: StringConstructor;
228
+ signInHref: StringConstructor;
229
+ routes: PropType<CommunityRoutes>;
230
+ nonce: StringConstructor;
231
+ transport: PropType<CommunityTransport>;
232
+ }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
233
+ [key: string]: any;
234
+ }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
235
+ slug: {
236
+ type: StringConstructor;
237
+ required: true;
238
+ };
239
+ apiBase: StringConstructor;
240
+ siteBase: StringConstructor;
241
+ lang: StringConstructor;
242
+ signInHref: StringConstructor;
243
+ routes: PropType<CommunityRoutes>;
244
+ nonce: StringConstructor;
245
+ transport: PropType<CommunityTransport>;
246
+ }>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
247
+ export declare const KbTopic: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
248
+ conversationId: {
249
+ type: StringConstructor;
250
+ required: true;
251
+ };
252
+ apiBase: StringConstructor;
253
+ siteBase: StringConstructor;
254
+ lang: StringConstructor;
255
+ signInHref: StringConstructor;
256
+ routes: PropType<CommunityRoutes>;
257
+ pollMs: NumberConstructor;
258
+ nonce: StringConstructor;
259
+ transport: PropType<CommunityTransport>;
260
+ /** `createRealtimeSession` of `@blogmcp/sdk/community/realtime`. */
261
+ realtime: PropType<TopicRealtime>;
262
+ }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
263
+ [key: string]: any;
264
+ }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
265
+ conversationId: {
266
+ type: StringConstructor;
267
+ required: true;
268
+ };
269
+ apiBase: StringConstructor;
270
+ siteBase: StringConstructor;
271
+ lang: StringConstructor;
272
+ signInHref: StringConstructor;
273
+ routes: PropType<CommunityRoutes>;
274
+ pollMs: NumberConstructor;
275
+ nonce: StringConstructor;
276
+ transport: PropType<CommunityTransport>;
277
+ /** `createRealtimeSession` of `@blogmcp/sdk/community/realtime`. */
278
+ realtime: PropType<TopicRealtime>;
279
+ }>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
280
+ export declare const KbForumSearch: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
281
+ apiBase: StringConstructor;
282
+ siteBase: StringConstructor;
283
+ lang: StringConstructor;
284
+ signInHref: StringConstructor;
285
+ routes: PropType<CommunityRoutes>;
286
+ nonce: StringConstructor;
287
+ transport: PropType<CommunityTransport>;
288
+ }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
289
+ [key: string]: any;
290
+ }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
291
+ apiBase: StringConstructor;
292
+ siteBase: StringConstructor;
293
+ lang: StringConstructor;
294
+ signInHref: StringConstructor;
295
+ routes: PropType<CommunityRoutes>;
296
+ nonce: StringConstructor;
297
+ transport: PropType<CommunityTransport>;
298
+ }>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
299
+ export declare const KbFollowButton: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
300
+ targetKind: {
301
+ type: PropType<"conversation" | "category">;
302
+ required: true;
303
+ };
304
+ targetId: {
305
+ type: StringConstructor;
306
+ required: true;
307
+ };
308
+ following: {
309
+ type: BooleanConstructor;
310
+ default: undefined;
311
+ };
312
+ apiBase: StringConstructor;
313
+ siteBase: StringConstructor;
314
+ lang: StringConstructor;
315
+ nonce: StringConstructor;
316
+ transport: PropType<CommunityTransport>;
317
+ }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
318
+ [key: string]: any;
319
+ }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
320
+ targetKind: {
321
+ type: PropType<"conversation" | "category">;
322
+ required: true;
323
+ };
324
+ targetId: {
325
+ type: StringConstructor;
326
+ required: true;
327
+ };
328
+ following: {
329
+ type: BooleanConstructor;
330
+ default: undefined;
331
+ };
332
+ apiBase: StringConstructor;
333
+ siteBase: StringConstructor;
334
+ lang: StringConstructor;
335
+ nonce: StringConstructor;
336
+ transport: PropType<CommunityTransport>;
337
+ }>> & Readonly<{}>, {
338
+ following: boolean;
339
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
340
+ export declare const KbForumModeration: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
341
+ categoryId: StringConstructor;
342
+ apiBase: StringConstructor;
343
+ siteBase: StringConstructor;
344
+ lang: StringConstructor;
345
+ routes: PropType<CommunityRoutes>;
346
+ nonce: StringConstructor;
347
+ transport: PropType<CommunityTransport>;
348
+ }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
349
+ [key: string]: any;
350
+ }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
351
+ categoryId: StringConstructor;
352
+ apiBase: StringConstructor;
353
+ siteBase: StringConstructor;
354
+ lang: StringConstructor;
355
+ routes: PropType<CommunityRoutes>;
356
+ nonce: StringConstructor;
357
+ transport: PropType<CommunityTransport>;
358
+ }>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
359
+ export type { MountDiscussionOptions, MountNoticeFormOptions, MountMyCommunityOptions, MountNotificationCentreOptions, MountBadgeOptions, MountMemberSettingsOptions, MountProfileOptions, MountWelcomeOptions, MountForumOptions, MountForumCategoryOptions, MountTopicOptions, MountForumSearchOptions, MountFollowButtonOptions, MountForumModerationOptions, CommunityRoutes, DiscussionRealtime, TopicRealtime, };
package/dist/vue.js CHANGED
@@ -39,13 +39,15 @@ const KbDiscussion = defineComponent({
39
39
  routes: Object,
40
40
  pollMs: Number,
41
41
  nonce: String,
42
- transport: Function
42
+ transport: Function,
43
+ /** M2: `createRealtimeSession` of `@blogmcp/sdk/community/realtime`. */
44
+ realtime: Function
43
45
  },
44
46
  setup(props) {
45
47
  return useMount(
46
48
  "discussion",
47
49
  () => defined({ ...props }),
48
- async () => (await import("./chunks/mount-DzjwnHyx.js").then((n) => n.l)).mountDiscussion
50
+ async () => (await import("./chunks/mount--2_V2q3M.js").then((n) => n.ad)).mountDiscussion
49
51
  );
50
52
  }
51
53
  });
@@ -66,7 +68,7 @@ const KbNoticeForm = defineComponent({
66
68
  return useMount(
67
69
  "notice-form",
68
70
  () => defined({ ...props }),
69
- async () => (await import("./chunks/mount-DzjwnHyx.js").then((n) => n.l)).mountNoticeForm
71
+ async () => (await import("./chunks/mount--2_V2q3M.js").then((n) => n.ad)).mountNoticeForm
70
72
  );
71
73
  }
72
74
  });
@@ -86,12 +88,240 @@ const KbMyCommunity = defineComponent({
86
88
  return useMount(
87
89
  "my-community",
88
90
  () => defined({ ...props }),
89
- async () => (await import("./chunks/mount-DzjwnHyx.js").then((n) => n.l)).mountMyCommunity
91
+ async () => (await import("./chunks/mount--2_V2q3M.js").then((n) => n.ad)).mountMyCommunity
92
+ );
93
+ }
94
+ });
95
+ const KbNotificationCentre = defineComponent({
96
+ name: "KbNotificationCentre",
97
+ props: {
98
+ apiBase: String,
99
+ siteBase: String,
100
+ lang: String,
101
+ signInHref: String,
102
+ routes: Object,
103
+ nonce: String,
104
+ transport: Function
105
+ },
106
+ setup(props) {
107
+ return useMount(
108
+ "notification-centre",
109
+ () => defined({ ...props }),
110
+ async () => (await import("./chunks/mount--2_V2q3M.js").then((n) => n.ad)).mountNotificationCentre
111
+ );
112
+ }
113
+ });
114
+ const KbBadge = defineComponent({
115
+ name: "KbBadge",
116
+ props: {
117
+ apiBase: String,
118
+ siteBase: String,
119
+ lang: String,
120
+ routes: Object,
121
+ pollMs: Number,
122
+ nonce: String,
123
+ transport: Function
124
+ },
125
+ setup(props) {
126
+ return useMount(
127
+ "badge",
128
+ () => defined({ ...props }),
129
+ async () => (await import("./chunks/mount--2_V2q3M.js").then((n) => n.ad)).mountBadge
130
+ );
131
+ }
132
+ });
133
+ const KbMemberSettings = defineComponent({
134
+ name: "KbMemberSettings",
135
+ props: {
136
+ apiBase: String,
137
+ siteBase: String,
138
+ lang: String,
139
+ swPath: String,
140
+ signInHref: String,
141
+ routes: Object,
142
+ nonce: String,
143
+ transport: Function
144
+ },
145
+ setup(props) {
146
+ return useMount(
147
+ "member-settings",
148
+ () => defined({ ...props }),
149
+ async () => (await import("./chunks/mount--2_V2q3M.js").then((n) => n.ad)).mountMemberSettings
150
+ );
151
+ }
152
+ });
153
+ const KbProfile = defineComponent({
154
+ name: "KbProfile",
155
+ props: {
156
+ handle: { type: String, required: true },
157
+ apiBase: String,
158
+ siteBase: String,
159
+ lang: String,
160
+ signInHref: String,
161
+ routes: Object,
162
+ nonce: String,
163
+ transport: Function
164
+ },
165
+ setup(props) {
166
+ return useMount(
167
+ "profile",
168
+ () => defined({ ...props }),
169
+ async () => (await import("./chunks/mount--2_V2q3M.js").then((n) => n.ad)).mountProfile
170
+ );
171
+ }
172
+ });
173
+ const KbWelcome = defineComponent({
174
+ name: "KbWelcome",
175
+ props: {
176
+ apiBase: String,
177
+ siteBase: String,
178
+ lang: String,
179
+ signInHref: String,
180
+ routes: Object,
181
+ nonce: String,
182
+ transport: Function
183
+ },
184
+ setup(props) {
185
+ return useMount(
186
+ "welcome",
187
+ () => defined({ ...props }),
188
+ async () => (await import("./chunks/mount--2_V2q3M.js").then((n) => n.ad)).mountWelcome
189
+ );
190
+ }
191
+ });
192
+ const KbForum = defineComponent({
193
+ name: "KbForum",
194
+ props: {
195
+ apiBase: String,
196
+ siteBase: String,
197
+ lang: String,
198
+ signInHref: String,
199
+ routes: Object,
200
+ nonce: String,
201
+ transport: Function
202
+ },
203
+ setup(props) {
204
+ return useMount(
205
+ "forum",
206
+ () => defined({ ...props }),
207
+ async () => (await import("./chunks/mount--2_V2q3M.js").then((n) => n.ad)).mountForum
208
+ );
209
+ }
210
+ });
211
+ const KbForumCategory = defineComponent({
212
+ name: "KbForumCategory",
213
+ props: {
214
+ slug: { type: String, required: true },
215
+ apiBase: String,
216
+ siteBase: String,
217
+ lang: String,
218
+ signInHref: String,
219
+ routes: Object,
220
+ nonce: String,
221
+ transport: Function
222
+ },
223
+ setup(props) {
224
+ return useMount(
225
+ "forum-category",
226
+ () => defined({ ...props }),
227
+ async () => (await import("./chunks/mount--2_V2q3M.js").then((n) => n.ad)).mountForumCategory
228
+ );
229
+ }
230
+ });
231
+ const KbTopic = defineComponent({
232
+ name: "KbTopic",
233
+ props: {
234
+ conversationId: { type: String, required: true },
235
+ apiBase: String,
236
+ siteBase: String,
237
+ lang: String,
238
+ signInHref: String,
239
+ routes: Object,
240
+ pollMs: Number,
241
+ nonce: String,
242
+ transport: Function,
243
+ /** `createRealtimeSession` of `@blogmcp/sdk/community/realtime`. */
244
+ realtime: Function
245
+ },
246
+ setup(props) {
247
+ return useMount(
248
+ "topic",
249
+ () => defined({ ...props }),
250
+ async () => (await import("./chunks/mount--2_V2q3M.js").then((n) => n.ad)).mountTopic
251
+ );
252
+ }
253
+ });
254
+ const KbForumSearch = defineComponent({
255
+ name: "KbForumSearch",
256
+ props: {
257
+ apiBase: String,
258
+ siteBase: String,
259
+ lang: String,
260
+ signInHref: String,
261
+ routes: Object,
262
+ nonce: String,
263
+ transport: Function
264
+ },
265
+ setup(props) {
266
+ return useMount(
267
+ "forum-search",
268
+ () => defined({ ...props }),
269
+ async () => (await import("./chunks/mount--2_V2q3M.js").then((n) => n.ad)).mountForumSearch
270
+ );
271
+ }
272
+ });
273
+ const KbFollowButton = defineComponent({
274
+ name: "KbFollowButton",
275
+ props: {
276
+ targetKind: { type: String, required: true },
277
+ targetId: { type: String, required: true },
278
+ following: { type: Boolean, default: void 0 },
279
+ apiBase: String,
280
+ siteBase: String,
281
+ lang: String,
282
+ nonce: String,
283
+ transport: Function
284
+ },
285
+ setup(props) {
286
+ return useMount(
287
+ "follow-button",
288
+ () => defined({ ...props }),
289
+ async () => (await import("./chunks/mount--2_V2q3M.js").then((n) => n.ad)).mountFollowButton
290
+ );
291
+ }
292
+ });
293
+ const KbForumModeration = defineComponent({
294
+ name: "KbForumModeration",
295
+ props: {
296
+ categoryId: String,
297
+ apiBase: String,
298
+ siteBase: String,
299
+ lang: String,
300
+ routes: Object,
301
+ nonce: String,
302
+ transport: Function
303
+ },
304
+ setup(props) {
305
+ return useMount(
306
+ "forum-moderation",
307
+ () => defined({ ...props }),
308
+ async () => (await import("./chunks/mount--2_V2q3M.js").then((n) => n.ad)).mountForumModeration
90
309
  );
91
310
  }
92
311
  });
93
312
  export {
313
+ KbBadge,
94
314
  KbDiscussion,
315
+ KbFollowButton,
316
+ KbForum,
317
+ KbForumCategory,
318
+ KbForumModeration,
319
+ KbForumSearch,
320
+ KbMemberSettings,
95
321
  KbMyCommunity,
96
- KbNoticeForm
322
+ KbNoticeForm,
323
+ KbNotificationCentre,
324
+ KbProfile,
325
+ KbTopic,
326
+ KbWelcome
97
327
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blogmcp/community",
3
- "version": "0.1.0",
3
+ "version": "0.3.0",
4
4
  "description": "Community elements for your own site: the discussion under an article, the DSA notice form and the reader's „My community” panel. Custom elements + Vue/React wrappers + a script build, over @blogmcp/sdk/community.",
5
5
  "type": "module",
6
6
  "publishConfig": {
@@ -42,8 +42,8 @@
42
42
  "postpack": "node ../../scripts/pack-dist-types.mjs postpack"
43
43
  },
44
44
  "dependencies": {
45
- "@blogmcp/sanitize": "^0.9.0",
46
- "@blogmcp/sdk": "^0.9.0",
45
+ "@blogmcp/sanitize": "^0.11.0",
46
+ "@blogmcp/sdk": "^0.11.0",
47
47
  "vue": "^3.5.0"
48
48
  },
49
49
  "peerDependencies": {
package/src/core/attrs.ts CHANGED
@@ -31,9 +31,56 @@ export interface CommunityRoutes {
31
31
  * becomes a link to it (m1-contracts.md §7.6). No default — without it the note stays text.
32
32
  */
33
33
  consultationPath?: string
34
+ /**
35
+ * M2 (m2-contracts.md §3.10): a member's public profile; `{handle}` is the handle (`/komunita/u/{handle}`) — a
36
+ * template, as statementPath is. A mention in a message links to it.
37
+ */
38
+ profilePath?: string
39
+ /** M2: the member's notification settings (where the digest's unsubscribe link lands with `#u=`). */
40
+ settingsPath?: string
41
+ /** M2: the notification centre (the badge links to it). */
42
+ notificationsPath?: string
43
+ /** M2: the welcome page after joining. */
44
+ welcomePath?: string
45
+ /** M2: the discussions overview. */
46
+ discussionsPath?: string
47
+ /**
48
+ * M2 T10: an article's page; `{slug}` is the article's slug (`/blog/articles/{slug}`, the storefront `/blog/{slug}`)
49
+ * — a template, as profilePath is. The notification centre links a reply's or a mention's message on it (the
50
+ * message's anchor in the fragment). No default: without it those rows stay unlinked.
51
+ */
52
+ articlePath?: string
53
+ /** M3 (m3-contracts.md §5.1, D-M3-12): the forum — its categories, their latest topics, the search box. */
54
+ forumPath?: string
55
+ /** M3: a category's page; `{slug}` is the category's slug (`/komunita/c/{slug}`) — a template, as profilePath is. */
56
+ categoryPath?: string
57
+ /**
58
+ * M3: a topic's page; `{id}` is its conversation id (`/komunita/t/{id}`) — a template; a message's anchor goes in the
59
+ * fragment (`#bcm-msg-<seq>`, topicMessageLink).
60
+ */
61
+ topicPath?: string
62
+ /** M3: the forum's search (the forum's search box goes there with the query in the fragment, `#q=…`). */
63
+ searchPath?: string
34
64
  }
35
65
 
36
- const ROUTE_KEYS = ['statementPath', 'myCommunityPath', 'rulesPath', 'reportPath', 'noticesPath', 'consultationPath'] as const
66
+ const ROUTE_KEYS = [
67
+ 'statementPath',
68
+ 'myCommunityPath',
69
+ 'rulesPath',
70
+ 'reportPath',
71
+ 'noticesPath',
72
+ 'consultationPath',
73
+ 'profilePath',
74
+ 'settingsPath',
75
+ 'notificationsPath',
76
+ 'welcomePath',
77
+ 'discussionsPath',
78
+ 'articlePath',
79
+ 'forumPath',
80
+ 'categoryPath',
81
+ 'topicPath',
82
+ 'searchPath',
83
+ ] as const
37
84
 
38
85
  /** A path on the host's own site (the SDK's links.ts rule). */
39
86
  export function isSitePath(path: unknown): path is string {
@@ -77,7 +124,8 @@ export function siteBaseOf(value: unknown): string | null {
77
124
  }
78
125
 
79
126
  /**
80
- * The pages with the managed blog's defaults filled in under the site's base (statementPath stays a template).
127
+ * The pages with the managed blog's defaults filled in under the site's base (statementPath, profilePath, M3's
128
+ * categoryPath and topicPath stay templates; articlePath, a template too, has no default).
81
129
  * A page the host or the tenant names is its own full path.
82
130
  */
83
131
  export function routesWithDefaults(
@@ -93,6 +141,17 @@ export function routesWithDefaults(
93
141
  reportPath: routes.reportPath ?? `${siteBase}${COMMUNITY_ROUTES.report}`,
94
142
  noticesPath: routes.noticesPath ?? `${siteBase}${COMMUNITY_ROUTES.notices}`,
95
143
  consultationPath: routes.consultationPath ?? null,
144
+ profilePath: routes.profilePath ?? `${siteBase}${COMMUNITY_ROUTES.profile}`,
145
+ settingsPath: routes.settingsPath ?? `${siteBase}${COMMUNITY_ROUTES.settings}`,
146
+ notificationsPath: routes.notificationsPath ?? `${siteBase}${COMMUNITY_ROUTES.notifications}`,
147
+ welcomePath: routes.welcomePath ?? `${siteBase}${COMMUNITY_ROUTES.welcome}`,
148
+ discussionsPath: routes.discussionsPath ?? `${siteBase}${COMMUNITY_ROUTES.discussions}`,
149
+ articlePath: routes.articlePath ?? null,
150
+ // M3 (§5.1): the forum's pages — categoryPath and topicPath are templates (`{slug}`, `{id}`).
151
+ forumPath: routes.forumPath ?? `${siteBase}${COMMUNITY_ROUTES.forum}`,
152
+ categoryPath: routes.categoryPath ?? `${siteBase}${COMMUNITY_ROUTES.category}`,
153
+ topicPath: routes.topicPath ?? `${siteBase}${COMMUNITY_ROUTES.topic}`,
154
+ searchPath: routes.searchPath ?? `${siteBase}${COMMUNITY_ROUTES.search}`,
96
155
  }
97
156
  }
98
157