@blogmcp/community 0.1.0 → 0.2.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.
- package/README.md +108 -11
- package/dist/blogmcp-community.global.js +8 -8
- package/dist/chunks/{mount-DzjwnHyx.js → mount-WadUnaTa.js} +3909 -2070
- package/dist/core/attrs.d.ts +27 -1
- package/dist/core/badge.d.ts +30 -0
- package/dist/core/centre.d.ts +28 -0
- package/dist/core/digest-token.d.ts +2 -0
- package/dist/core/discussion.d.ts +36 -5
- package/dist/core/format.d.ts +7 -0
- package/dist/core/onboarding.d.ts +42 -2
- package/dist/core/outcomes.d.ts +2 -1
- package/dist/core/panel.d.ts +17 -1
- package/dist/core/profile.d.ts +40 -0
- package/dist/core/push.d.ts +63 -0
- package/dist/core/realtime.d.ts +35 -0
- package/dist/core/settings.d.ts +53 -0
- package/dist/core/text.d.ts +13 -0
- package/dist/element.d.ts +22 -1
- package/dist/global.d.ts +7 -4
- package/dist/index.d.ts +10 -2
- package/dist/index.js +34 -11
- package/dist/mount.d.ts +40 -0
- package/dist/react.d.ts +14 -3
- package/dist/react.js +24 -4
- package/dist/ui/BadgeView.vue.d.ts +13 -0
- package/dist/ui/DiscussionView.vue.d.ts +11 -0
- package/dist/ui/LinkedText.vue.d.ts +1 -0
- package/dist/ui/MemberSettingsView.vue.d.ts +13 -0
- package/dist/ui/MessageComposer.vue.d.ts +2 -0
- package/dist/ui/NotificationCentreView.vue.d.ts +12 -0
- package/dist/ui/OnboardingSteps.vue.d.ts +1 -1
- package/dist/ui/ProfileView.vue.d.ts +13 -0
- package/dist/ui/WelcomeView.vue.d.ts +12 -0
- package/dist/vue.d.ts +114 -3
- package/dist/vue.js +109 -5
- package/package.json +3 -3
- package/src/core/attrs.ts +41 -2
- package/src/core/badge.ts +120 -0
- package/src/core/centre.ts +136 -0
- package/src/core/digest-token.ts +26 -0
- package/src/core/discussion.ts +203 -18
- package/src/core/format.ts +22 -0
- package/src/core/onboarding.ts +165 -18
- package/src/core/outcomes.ts +13 -1
- package/src/core/panel.ts +39 -4
- package/src/core/profile.ts +144 -0
- package/src/core/push.ts +174 -0
- package/src/core/realtime.ts +39 -0
- package/src/core/settings.ts +363 -0
- package/src/core/text.ts +32 -0
- package/src/element.ts +62 -6
- package/src/global.ts +18 -4
- package/src/index.ts +36 -1
- package/src/mount.ts +108 -1
- package/src/react.ts +47 -3
- package/src/ui/BadgeView.vue +51 -0
- package/src/ui/DiscussionView.vue +43 -3
- package/src/ui/LinkedText.vue +11 -5
- package/src/ui/MemberSettingsView.vue +175 -0
- package/src/ui/MessageComposer.vue +15 -4
- package/src/ui/MessageItem.vue +24 -6
- package/src/ui/MyCommunityView.vue +9 -0
- package/src/ui/NotificationCentreView.vue +159 -0
- package/src/ui/OnboardingSteps.vue +17 -6
- package/src/ui/ProfileView.vue +91 -0
- package/src/ui/WelcomeView.vue +72 -0
- package/src/ui/styles.css +16 -0
- package/src/vue.ts +129 -3
package/dist/index.js
CHANGED
|
@@ -1,22 +1,45 @@
|
|
|
1
|
-
import {
|
|
2
|
-
const VERSION = "0.
|
|
1
|
+
import { H, B, w, I, D, k, M, N, j, P, S, W, v, u, A, x, C, t, F, E, y, z, f, d, a, g, c, b, e, h, i, p, m, q, n, l, o, r, s, G } from "./chunks/mount-WadUnaTa.js";
|
|
2
|
+
const VERSION = "0.2.0";
|
|
3
3
|
export {
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
H as AVATAR_PRESETS,
|
|
5
|
+
B as BADGE_ELEMENT_TAG,
|
|
6
|
+
w as BADGE_INTERVAL_MS,
|
|
7
|
+
I as DEFAULT_API_BASE,
|
|
6
8
|
D as DISCUSSION_ELEMENT_TAG,
|
|
9
|
+
k as MEMBER_SETTINGS_ELEMENT_TAG,
|
|
7
10
|
M as MY_COMMUNITY_ELEMENT_TAG,
|
|
8
11
|
N as NOTICE_FORM_ELEMENT_TAG,
|
|
12
|
+
j as NOTIFICATION_CENTRE_ELEMENT_TAG,
|
|
13
|
+
P as PROFILE_ELEMENT_TAG,
|
|
14
|
+
S as SETTING_KEYS,
|
|
9
15
|
VERSION,
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
16
|
+
W as WELCOME_ELEMENT_TAG,
|
|
17
|
+
v as badgeText,
|
|
18
|
+
u as createBadge,
|
|
19
|
+
A as createDiscussionController,
|
|
20
|
+
x as createMemberSettings,
|
|
21
|
+
C as createNoticeForm,
|
|
22
|
+
t as createNotificationCentre,
|
|
23
|
+
F as createOnboarding,
|
|
24
|
+
E as createPanel,
|
|
25
|
+
y as createProfile,
|
|
26
|
+
z as createWelcome,
|
|
27
|
+
f as defineBadgeElement,
|
|
14
28
|
d as defineCommunityElements,
|
|
15
29
|
a as defineDiscussionElement,
|
|
30
|
+
g as defineMemberSettingsElement,
|
|
16
31
|
c as defineMyCommunityElement,
|
|
17
32
|
b as defineNoticeFormElement,
|
|
33
|
+
e as defineNotificationCentreElement,
|
|
34
|
+
h as defineProfileElement,
|
|
35
|
+
i as defineWelcomeElement,
|
|
36
|
+
p as mountBadge,
|
|
18
37
|
m as mountDiscussion,
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
38
|
+
q as mountMemberSettings,
|
|
39
|
+
n as mountMyCommunity,
|
|
40
|
+
l as mountNoticeForm,
|
|
41
|
+
o as mountNotificationCentre,
|
|
42
|
+
r as mountProfile,
|
|
43
|
+
s as mountWelcome,
|
|
44
|
+
G as pickLang
|
|
22
45
|
};
|
package/dist/mount.d.ts
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import type { CommunityTransport } from '@blogmcp/sdk/community';
|
|
9
9
|
import type { CommunityRoutes } from './core/attrs';
|
|
10
|
+
import type { DiscussionRealtime } from './core/realtime';
|
|
10
11
|
interface CommonMountOptions {
|
|
11
12
|
/** The host's relative base (default `/api/community` under `siteBase`): its proxy or BFF. Never kb-api's URL. */
|
|
12
13
|
apiBase?: string;
|
|
@@ -32,6 +33,11 @@ export interface MountDiscussionOptions extends CommonMountOptions {
|
|
|
32
33
|
signInHref?: string;
|
|
33
34
|
/** Head poll interval in ms (default 20 000; 0 = off). */
|
|
34
35
|
pollMs?: number;
|
|
36
|
+
/**
|
|
37
|
+
* M2: live updates — `createRealtimeSession` of `@blogmcp/sdk/community/realtime` (the host imports it; the element
|
|
38
|
+
* never does). Absent: the head poll.
|
|
39
|
+
*/
|
|
40
|
+
realtime?: DiscussionRealtime;
|
|
35
41
|
}
|
|
36
42
|
export interface MountNoticeFormOptions extends CommonMountOptions {
|
|
37
43
|
/** What is reported: a message, a member (by id or handle) or an article. */
|
|
@@ -56,10 +62,44 @@ export interface MountMyCommunityOptions extends CommonMountOptions {
|
|
|
56
62
|
/** The site's sign-in page. */
|
|
57
63
|
signInHref?: string;
|
|
58
64
|
}
|
|
65
|
+
export interface MountNotificationCentreOptions extends CommonMountOptions {
|
|
66
|
+
/** The site's sign-in page. */
|
|
67
|
+
signInHref?: string;
|
|
68
|
+
}
|
|
69
|
+
export interface MountBadgeOptions extends CommonMountOptions {
|
|
70
|
+
/** The unread count's poll in ms (default 60 000; 0 = once, and when the page is shown again). */
|
|
71
|
+
pollMs?: number;
|
|
72
|
+
}
|
|
73
|
+
export interface MountMemberSettingsOptions extends CommonMountOptions {
|
|
74
|
+
/** The host's service worker route (default `<site-base>/sw.js`, served from `@blogmcp/sdk/community/sw`). */
|
|
75
|
+
swPath?: string;
|
|
76
|
+
/** The site's sign-in page. */
|
|
77
|
+
signInHref?: string;
|
|
78
|
+
}
|
|
79
|
+
export interface MountProfileOptions extends CommonMountOptions {
|
|
80
|
+
/** The member's handle. */
|
|
81
|
+
handle: string;
|
|
82
|
+
/** The site's sign-in page. */
|
|
83
|
+
signInHref?: string;
|
|
84
|
+
}
|
|
85
|
+
export interface MountWelcomeOptions extends CommonMountOptions {
|
|
86
|
+
/** The site's sign-in page (a visitor's link in the profile's place). */
|
|
87
|
+
signInHref?: string;
|
|
88
|
+
}
|
|
59
89
|
/** Mount `<blogmcp-discussion>`; returns the function that removes it. */
|
|
60
90
|
export declare function mountDiscussion(o: MountDiscussionOptions): () => void;
|
|
61
91
|
/** Mount `<blogmcp-notice-form>`; returns the function that removes it. */
|
|
62
92
|
export declare function mountNoticeForm(o: MountNoticeFormOptions): () => void;
|
|
63
93
|
/** Mount `<blogmcp-my-community>`; returns the function that removes it. */
|
|
64
94
|
export declare function mountMyCommunity(o?: MountMyCommunityOptions): () => void;
|
|
95
|
+
/** Mount `<blogmcp-notification-centre>`; returns the function that removes it. */
|
|
96
|
+
export declare function mountNotificationCentre(o?: MountNotificationCentreOptions): () => void;
|
|
97
|
+
/** Mount `<blogmcp-badge>`; returns the function that removes it. */
|
|
98
|
+
export declare function mountBadge(o?: MountBadgeOptions): () => void;
|
|
99
|
+
/** Mount `<blogmcp-member-settings>`; returns the function that removes it. */
|
|
100
|
+
export declare function mountMemberSettings(o?: MountMemberSettingsOptions): () => void;
|
|
101
|
+
/** Mount `<blogmcp-profile>`; returns the function that removes it. */
|
|
102
|
+
export declare function mountProfile(o: MountProfileOptions): () => void;
|
|
103
|
+
/** Mount `<blogmcp-welcome>`; returns the function that removes it. */
|
|
104
|
+
export declare function mountWelcome(o?: MountWelcomeOptions): () => void;
|
|
65
105
|
export {};
|
package/dist/react.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* `<KbDiscussion>`, `<KbNoticeForm>`, `<KbMyCommunity>`
|
|
2
|
+
* `<KbDiscussion>`, `<KbNoticeForm>`, `<KbMyCommunity>` and (M2) `<KbNotificationCentre>`, `<KbBadge>`,
|
|
3
|
+
* `<KbMemberSettings>`, `<KbProfile>`, `<KbWelcome>` for React (18 and 19, Next.js App Router included — this
|
|
3
4
|
* module is a client component): each mounts its element after hydration and removes it on unmount. Each
|
|
4
5
|
* renders one empty `<div>` as the mount point — nothing else, on the server or the client — so the element
|
|
5
6
|
* sits where the component does and the page's markup is otherwise the site's alone.
|
|
@@ -7,11 +8,21 @@
|
|
|
7
8
|
* <KbDiscussion articleId={article.id} apiBase="/api/community" signInHref={`/sign-in#${pathname}`} />
|
|
8
9
|
*/
|
|
9
10
|
import { type ReactElement } from 'react';
|
|
10
|
-
import type { MountDiscussionOptions, MountMyCommunityOptions, MountNoticeFormOptions } from './mount';
|
|
11
|
+
import type { MountBadgeOptions, MountDiscussionOptions, MountMemberSettingsOptions, MountMyCommunityOptions, MountNoticeFormOptions, MountNotificationCentreOptions, MountProfileOptions, MountWelcomeOptions } from './mount';
|
|
11
12
|
export type KbDiscussionProps = Omit<MountDiscussionOptions, 'container'>;
|
|
12
13
|
export type KbNoticeFormProps = Omit<MountNoticeFormOptions, 'container'>;
|
|
13
14
|
export type KbMyCommunityProps = Omit<MountMyCommunityOptions, 'container'>;
|
|
15
|
+
export type KbNotificationCentreProps = Omit<MountNotificationCentreOptions, 'container'>;
|
|
16
|
+
export type KbBadgeProps = Omit<MountBadgeOptions, 'container'>;
|
|
17
|
+
export type KbMemberSettingsProps = Omit<MountMemberSettingsOptions, 'container'>;
|
|
18
|
+
export type KbProfileProps = Omit<MountProfileOptions, 'container'>;
|
|
19
|
+
export type KbWelcomeProps = Omit<MountWelcomeOptions, 'container'>;
|
|
14
20
|
export declare function KbDiscussion(props: KbDiscussionProps): ReactElement;
|
|
15
21
|
export declare function KbNoticeForm(props: KbNoticeFormProps): ReactElement;
|
|
16
22
|
export declare function KbMyCommunity(props: KbMyCommunityProps): ReactElement;
|
|
17
|
-
export
|
|
23
|
+
export declare function KbNotificationCentre(props: KbNotificationCentreProps): ReactElement;
|
|
24
|
+
export declare function KbBadge(props: KbBadgeProps): ReactElement;
|
|
25
|
+
export declare function KbMemberSettings(props: KbMemberSettingsProps): ReactElement;
|
|
26
|
+
export declare function KbProfile(props: KbProfileProps): ReactElement;
|
|
27
|
+
export declare function KbWelcome(props: KbWelcomeProps): ReactElement;
|
|
28
|
+
export type { MountDiscussionOptions, MountNoticeFormOptions, MountMyCommunityOptions, MountNotificationCentreOptions, MountBadgeOptions, MountMemberSettingsOptions, MountProfileOptions, MountWelcomeOptions, };
|
package/dist/react.js
CHANGED
|
@@ -20,16 +20,36 @@ function useMounted(kind, props, load) {
|
|
|
20
20
|
return createElement("div", { ref: host, "data-blogmcp-community": kind });
|
|
21
21
|
}
|
|
22
22
|
function KbDiscussion(props) {
|
|
23
|
-
return useMounted("discussion", props, async () => (await import("./chunks/mount-
|
|
23
|
+
return useMounted("discussion", props, async () => (await import("./chunks/mount-WadUnaTa.js").then((n) => n.J)).mountDiscussion);
|
|
24
24
|
}
|
|
25
25
|
function KbNoticeForm(props) {
|
|
26
|
-
return useMounted("notice-form", props, async () => (await import("./chunks/mount-
|
|
26
|
+
return useMounted("notice-form", props, async () => (await import("./chunks/mount-WadUnaTa.js").then((n) => n.J)).mountNoticeForm);
|
|
27
27
|
}
|
|
28
28
|
function KbMyCommunity(props) {
|
|
29
|
-
return useMounted("my-community", props, async () => (await import("./chunks/mount-
|
|
29
|
+
return useMounted("my-community", props, async () => (await import("./chunks/mount-WadUnaTa.js").then((n) => n.J)).mountMyCommunity);
|
|
30
|
+
}
|
|
31
|
+
function KbNotificationCentre(props) {
|
|
32
|
+
return useMounted("notification-centre", props, async () => (await import("./chunks/mount-WadUnaTa.js").then((n) => n.J)).mountNotificationCentre);
|
|
33
|
+
}
|
|
34
|
+
function KbBadge(props) {
|
|
35
|
+
return useMounted("badge", props, async () => (await import("./chunks/mount-WadUnaTa.js").then((n) => n.J)).mountBadge);
|
|
36
|
+
}
|
|
37
|
+
function KbMemberSettings(props) {
|
|
38
|
+
return useMounted("member-settings", props, async () => (await import("./chunks/mount-WadUnaTa.js").then((n) => n.J)).mountMemberSettings);
|
|
39
|
+
}
|
|
40
|
+
function KbProfile(props) {
|
|
41
|
+
return useMounted("profile", props, async () => (await import("./chunks/mount-WadUnaTa.js").then((n) => n.J)).mountProfile);
|
|
42
|
+
}
|
|
43
|
+
function KbWelcome(props) {
|
|
44
|
+
return useMounted("welcome", props, async () => (await import("./chunks/mount-WadUnaTa.js").then((n) => n.J)).mountWelcome);
|
|
30
45
|
}
|
|
31
46
|
export {
|
|
47
|
+
KbBadge,
|
|
32
48
|
KbDiscussion,
|
|
49
|
+
KbMemberSettings,
|
|
33
50
|
KbMyCommunity,
|
|
34
|
-
KbNoticeForm
|
|
51
|
+
KbNoticeForm,
|
|
52
|
+
KbNotificationCentre,
|
|
53
|
+
KbProfile,
|
|
54
|
+
KbWelcome
|
|
35
55
|
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { CommunityTransport } from '@blogmcp/sdk/community';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
apiBase?: string;
|
|
4
|
+
siteBase?: string;
|
|
5
|
+
lang?: string;
|
|
6
|
+
/** JSON (or an object): `notificationsPath` (where the badge links). */
|
|
7
|
+
routes?: string | Record<string, unknown>;
|
|
8
|
+
/** The poll in ms (default 60 000, never less; 0 = read once and when the page is shown again). */
|
|
9
|
+
pollMs?: number;
|
|
10
|
+
transport?: CommunityTransport;
|
|
11
|
+
};
|
|
12
|
+
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>;
|
|
13
|
+
export default _default;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type CommunityTransport } from '@blogmcp/sdk/community';
|
|
2
|
+
import type { DiscussionRealtime } from '../core/realtime';
|
|
2
3
|
declare const _default: import("vue").DefineComponent<{
|
|
3
4
|
articleId?: string;
|
|
4
5
|
/** The host's relative base (default `${siteBase}/api/community`). */
|
|
@@ -14,6 +15,11 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
14
15
|
pollMs?: number;
|
|
15
16
|
/** A replacement transport (a property, never an attribute): tests, a signing transport later. */
|
|
16
17
|
transport?: CommunityTransport;
|
|
18
|
+
/**
|
|
19
|
+
* M2: live updates — the host's session factory (`createRealtimeSession` of `@blogmcp/sdk/community/realtime`), a
|
|
20
|
+
* property, never an attribute. Absent: the head poll.
|
|
21
|
+
*/
|
|
22
|
+
realtime?: DiscussionRealtime;
|
|
17
23
|
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
|
|
18
24
|
articleId?: string;
|
|
19
25
|
/** The host's relative base (default `${siteBase}/api/community`). */
|
|
@@ -29,5 +35,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
29
35
|
pollMs?: number;
|
|
30
36
|
/** A replacement transport (a property, never an attribute): tests, a signing transport later. */
|
|
31
37
|
transport?: CommunityTransport;
|
|
38
|
+
/**
|
|
39
|
+
* M2: live updates — the host's session factory (`createRealtimeSession` of `@blogmcp/sdk/community/realtime`), a
|
|
40
|
+
* property, never an attribute. Absent: the head poll.
|
|
41
|
+
*/
|
|
42
|
+
realtime?: DiscussionRealtime;
|
|
32
43
|
}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
33
44
|
export default _default;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
type __VLS_Props = {
|
|
2
2
|
text: string | null;
|
|
3
|
+
profilePath?: string | null;
|
|
3
4
|
};
|
|
4
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>;
|
|
5
6
|
export default _default;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type CommunityTransport } from '@blogmcp/sdk/community';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
apiBase?: string;
|
|
4
|
+
siteBase?: string;
|
|
5
|
+
lang?: string;
|
|
6
|
+
/** The host's service worker script (default `<site-base>/sw.js`): served from @blogmcp/sdk/community/sw. */
|
|
7
|
+
swPath?: string;
|
|
8
|
+
routes?: string | Record<string, unknown>;
|
|
9
|
+
signInHref?: string;
|
|
10
|
+
transport?: CommunityTransport;
|
|
11
|
+
};
|
|
12
|
+
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>;
|
|
13
|
+
export default _default;
|
|
@@ -7,6 +7,8 @@ type __VLS_Props = {
|
|
|
7
7
|
replyingTo?: string | null;
|
|
8
8
|
/** The host's rules page. */
|
|
9
9
|
rulesHref?: string;
|
|
10
|
+
/** M2 T10: the distinct mentions one message may carry; null or absent: no limit known here. */
|
|
11
|
+
mentionsMax?: number | null;
|
|
10
12
|
};
|
|
11
13
|
declare const _default: import("vue").DefineComponent<__VLS_Props, {
|
|
12
14
|
focus: () => void | undefined;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type CommunityTransport } from '@blogmcp/sdk/community';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
apiBase?: string;
|
|
4
|
+
siteBase?: string;
|
|
5
|
+
lang?: string;
|
|
6
|
+
/** JSON (or an object): `statementPath`, `myCommunityPath`, `settingsPath`, `articlePath`, … */
|
|
7
|
+
routes?: string | Record<string, unknown>;
|
|
8
|
+
signInHref?: string;
|
|
9
|
+
transport?: CommunityTransport;
|
|
10
|
+
};
|
|
11
|
+
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>;
|
|
12
|
+
export default _default;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type CommunityTransport } from '@blogmcp/sdk/community';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
/** The member's handle (`jana_n`, an `@` in front is fine). */
|
|
4
|
+
handle?: string;
|
|
5
|
+
apiBase?: string;
|
|
6
|
+
siteBase?: string;
|
|
7
|
+
lang?: string;
|
|
8
|
+
routes?: string | Record<string, unknown>;
|
|
9
|
+
signInHref?: string;
|
|
10
|
+
transport?: CommunityTransport;
|
|
11
|
+
};
|
|
12
|
+
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>;
|
|
13
|
+
export default _default;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type CommunityTransport } from '@blogmcp/sdk/community';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
apiBase?: string;
|
|
4
|
+
siteBase?: string;
|
|
5
|
+
lang?: string;
|
|
6
|
+
/** JSON (or an object): `rulesPath`, `discussionsPath`, `settingsPath`, `profilePath`. */
|
|
7
|
+
routes?: string | Record<string, unknown>;
|
|
8
|
+
signInHref?: string;
|
|
9
|
+
transport?: CommunityTransport;
|
|
10
|
+
};
|
|
11
|
+
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>;
|
|
12
|
+
export default _default;
|
package/dist/vue.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* `<KbDiscussion>`, `<KbNoticeForm>`, `<KbMyCommunity>`
|
|
2
|
+
* `<KbDiscussion>`, `<KbNoticeForm>`, `<KbMyCommunity>` and (M2) `<KbNotificationCentre>`, `<KbBadge>`,
|
|
3
|
+
* `<KbMemberSettings>`, `<KbProfile>`, `<KbWelcome>` for Vue / Nuxt: each mounts its element on the
|
|
3
4
|
* client, after hydration, and removes it on unmount. Each renders one empty `<div>` as the mount point —
|
|
4
5
|
* nothing else, on the server or the client — so the element sits where the component does and the page's
|
|
5
6
|
* markup is otherwise the site's alone.
|
|
@@ -12,7 +13,8 @@
|
|
|
12
13
|
import { type PropType } from 'vue';
|
|
13
14
|
import type { CommunityTransport } from '@blogmcp/sdk/community';
|
|
14
15
|
import type { CommunityRoutes } from './core/attrs';
|
|
15
|
-
import type {
|
|
16
|
+
import type { DiscussionRealtime } from './core/realtime';
|
|
17
|
+
import type { MountBadgeOptions, MountDiscussionOptions, MountMemberSettingsOptions, MountMyCommunityOptions, MountNoticeFormOptions, MountNotificationCentreOptions, MountProfileOptions, MountWelcomeOptions } from './mount';
|
|
16
18
|
export declare const KbDiscussion: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
17
19
|
articleId: {
|
|
18
20
|
type: StringConstructor;
|
|
@@ -26,6 +28,8 @@ export declare const KbDiscussion: import("vue").DefineComponent<import("vue").E
|
|
|
26
28
|
pollMs: NumberConstructor;
|
|
27
29
|
nonce: StringConstructor;
|
|
28
30
|
transport: PropType<CommunityTransport>;
|
|
31
|
+
/** M2: `createRealtimeSession` of `@blogmcp/sdk/community/realtime`. */
|
|
32
|
+
realtime: PropType<DiscussionRealtime>;
|
|
29
33
|
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
30
34
|
[key: string]: any;
|
|
31
35
|
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
@@ -41,6 +45,8 @@ export declare const KbDiscussion: import("vue").DefineComponent<import("vue").E
|
|
|
41
45
|
pollMs: NumberConstructor;
|
|
42
46
|
nonce: StringConstructor;
|
|
43
47
|
transport: PropType<CommunityTransport>;
|
|
48
|
+
/** M2: `createRealtimeSession` of `@blogmcp/sdk/community/realtime`. */
|
|
49
|
+
realtime: PropType<DiscussionRealtime>;
|
|
44
50
|
}>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
45
51
|
export declare const KbNoticeForm: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
46
52
|
target: PropType<MountNoticeFormOptions["target"]>;
|
|
@@ -86,4 +92,109 @@ export declare const KbMyCommunity: import("vue").DefineComponent<import("vue").
|
|
|
86
92
|
nonce: StringConstructor;
|
|
87
93
|
transport: PropType<CommunityTransport>;
|
|
88
94
|
}>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
89
|
-
export
|
|
95
|
+
export declare const KbNotificationCentre: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
96
|
+
apiBase: StringConstructor;
|
|
97
|
+
siteBase: StringConstructor;
|
|
98
|
+
lang: StringConstructor;
|
|
99
|
+
signInHref: StringConstructor;
|
|
100
|
+
routes: PropType<CommunityRoutes>;
|
|
101
|
+
nonce: StringConstructor;
|
|
102
|
+
transport: PropType<CommunityTransport>;
|
|
103
|
+
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
104
|
+
[key: string]: any;
|
|
105
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
106
|
+
apiBase: StringConstructor;
|
|
107
|
+
siteBase: StringConstructor;
|
|
108
|
+
lang: StringConstructor;
|
|
109
|
+
signInHref: StringConstructor;
|
|
110
|
+
routes: PropType<CommunityRoutes>;
|
|
111
|
+
nonce: StringConstructor;
|
|
112
|
+
transport: PropType<CommunityTransport>;
|
|
113
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
114
|
+
export declare const KbBadge: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
115
|
+
apiBase: StringConstructor;
|
|
116
|
+
siteBase: StringConstructor;
|
|
117
|
+
lang: StringConstructor;
|
|
118
|
+
routes: PropType<CommunityRoutes>;
|
|
119
|
+
pollMs: NumberConstructor;
|
|
120
|
+
nonce: StringConstructor;
|
|
121
|
+
transport: PropType<CommunityTransport>;
|
|
122
|
+
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
123
|
+
[key: string]: any;
|
|
124
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
125
|
+
apiBase: StringConstructor;
|
|
126
|
+
siteBase: StringConstructor;
|
|
127
|
+
lang: StringConstructor;
|
|
128
|
+
routes: PropType<CommunityRoutes>;
|
|
129
|
+
pollMs: NumberConstructor;
|
|
130
|
+
nonce: StringConstructor;
|
|
131
|
+
transport: PropType<CommunityTransport>;
|
|
132
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
133
|
+
export declare const KbMemberSettings: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
134
|
+
apiBase: StringConstructor;
|
|
135
|
+
siteBase: StringConstructor;
|
|
136
|
+
lang: StringConstructor;
|
|
137
|
+
swPath: StringConstructor;
|
|
138
|
+
signInHref: StringConstructor;
|
|
139
|
+
routes: PropType<CommunityRoutes>;
|
|
140
|
+
nonce: StringConstructor;
|
|
141
|
+
transport: PropType<CommunityTransport>;
|
|
142
|
+
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
143
|
+
[key: string]: any;
|
|
144
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
145
|
+
apiBase: StringConstructor;
|
|
146
|
+
siteBase: StringConstructor;
|
|
147
|
+
lang: StringConstructor;
|
|
148
|
+
swPath: StringConstructor;
|
|
149
|
+
signInHref: StringConstructor;
|
|
150
|
+
routes: PropType<CommunityRoutes>;
|
|
151
|
+
nonce: StringConstructor;
|
|
152
|
+
transport: PropType<CommunityTransport>;
|
|
153
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
154
|
+
export declare const KbProfile: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
155
|
+
handle: {
|
|
156
|
+
type: StringConstructor;
|
|
157
|
+
required: true;
|
|
158
|
+
};
|
|
159
|
+
apiBase: StringConstructor;
|
|
160
|
+
siteBase: StringConstructor;
|
|
161
|
+
lang: StringConstructor;
|
|
162
|
+
signInHref: StringConstructor;
|
|
163
|
+
routes: PropType<CommunityRoutes>;
|
|
164
|
+
nonce: StringConstructor;
|
|
165
|
+
transport: PropType<CommunityTransport>;
|
|
166
|
+
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
167
|
+
[key: string]: any;
|
|
168
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
169
|
+
handle: {
|
|
170
|
+
type: StringConstructor;
|
|
171
|
+
required: true;
|
|
172
|
+
};
|
|
173
|
+
apiBase: StringConstructor;
|
|
174
|
+
siteBase: StringConstructor;
|
|
175
|
+
lang: StringConstructor;
|
|
176
|
+
signInHref: StringConstructor;
|
|
177
|
+
routes: PropType<CommunityRoutes>;
|
|
178
|
+
nonce: StringConstructor;
|
|
179
|
+
transport: PropType<CommunityTransport>;
|
|
180
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
181
|
+
export declare const KbWelcome: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
182
|
+
apiBase: StringConstructor;
|
|
183
|
+
siteBase: StringConstructor;
|
|
184
|
+
lang: StringConstructor;
|
|
185
|
+
signInHref: StringConstructor;
|
|
186
|
+
routes: PropType<CommunityRoutes>;
|
|
187
|
+
nonce: StringConstructor;
|
|
188
|
+
transport: PropType<CommunityTransport>;
|
|
189
|
+
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
190
|
+
[key: string]: any;
|
|
191
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
192
|
+
apiBase: StringConstructor;
|
|
193
|
+
siteBase: StringConstructor;
|
|
194
|
+
lang: StringConstructor;
|
|
195
|
+
signInHref: StringConstructor;
|
|
196
|
+
routes: PropType<CommunityRoutes>;
|
|
197
|
+
nonce: StringConstructor;
|
|
198
|
+
transport: PropType<CommunityTransport>;
|
|
199
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
200
|
+
export type { MountDiscussionOptions, MountNoticeFormOptions, MountMyCommunityOptions, MountNotificationCentreOptions, MountBadgeOptions, MountMemberSettingsOptions, MountProfileOptions, MountWelcomeOptions, CommunityRoutes, DiscussionRealtime, };
|
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-
|
|
50
|
+
async () => (await import("./chunks/mount-WadUnaTa.js").then((n) => n.J)).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-
|
|
71
|
+
async () => (await import("./chunks/mount-WadUnaTa.js").then((n) => n.J)).mountNoticeForm
|
|
70
72
|
);
|
|
71
73
|
}
|
|
72
74
|
});
|
|
@@ -86,12 +88,114 @@ const KbMyCommunity = defineComponent({
|
|
|
86
88
|
return useMount(
|
|
87
89
|
"my-community",
|
|
88
90
|
() => defined({ ...props }),
|
|
89
|
-
async () => (await import("./chunks/mount-
|
|
91
|
+
async () => (await import("./chunks/mount-WadUnaTa.js").then((n) => n.J)).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-WadUnaTa.js").then((n) => n.J)).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-WadUnaTa.js").then((n) => n.J)).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-WadUnaTa.js").then((n) => n.J)).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-WadUnaTa.js").then((n) => n.J)).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-WadUnaTa.js").then((n) => n.J)).mountWelcome
|
|
90
189
|
);
|
|
91
190
|
}
|
|
92
191
|
});
|
|
93
192
|
export {
|
|
193
|
+
KbBadge,
|
|
94
194
|
KbDiscussion,
|
|
195
|
+
KbMemberSettings,
|
|
95
196
|
KbMyCommunity,
|
|
96
|
-
KbNoticeForm
|
|
197
|
+
KbNoticeForm,
|
|
198
|
+
KbNotificationCentre,
|
|
199
|
+
KbProfile,
|
|
200
|
+
KbWelcome
|
|
97
201
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blogmcp/community",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.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.
|
|
46
|
-
"@blogmcp/sdk": "^0.
|
|
45
|
+
"@blogmcp/sanitize": "^0.10.0",
|
|
46
|
+
"@blogmcp/sdk": "^0.10.0",
|
|
47
47
|
"vue": "^3.5.0"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|