@blogmcp/sdk 0.11.0 → 0.12.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/dist/community/client.d.ts +1 -1
- package/dist/community/client.js +2 -1
- package/dist/community/messages.cs.d.ts +5 -3
- package/dist/community/messages.cs.js +7 -3
- package/dist/community/messages.en.d.ts +5 -3
- package/dist/community/messages.en.js +7 -3
- package/dist/community/shapes.d.ts +15 -0
- package/dist/community/store.d.ts +12 -0
- package/dist/community/store.js +27 -27
- package/dist/nuxt/composables/useAsyncKb.d.ts +10 -4
- package/dist/packages/mdx-render-vue/dist/render/gallery/GalleryLightbox.vue.js +2 -2
- package/dist/packages/mdx-render-vue/dist/render/tripmap/TripMapDefault.vue.js +36 -36
- package/package.json +3 -3
- package/src/community/client.ts +3 -2
- package/src/community/messages.cs.ts +7 -3
- package/src/community/messages.en.ts +7 -3
- package/src/community/shapes.ts +15 -0
- package/src/community/store.ts +14 -2
- package/src/core/markdown.ts +1 -1
- package/src/nuxt/composables/useAsyncKb.ts +11 -4
- package/src/nuxt/nuxt-imports.d.ts +2 -2
|
@@ -116,7 +116,7 @@ export interface CommunityClient {
|
|
|
116
116
|
me: {
|
|
117
117
|
/** Anonymous: `{ member: null, needs: ['sign_in'] }`. */
|
|
118
118
|
get: CallNoInput<MyState>;
|
|
119
|
-
/** The light onboarding: the age band, the rules (and the consent when asked), the profile. */
|
|
119
|
+
/** The light onboarding: the age band, the rules (and the terms on a first join, and the consent when asked), the profile. */
|
|
120
120
|
onboard: Call<OnboardInput, MyState>;
|
|
121
121
|
updateProfile: Call<ProfileUpdateInput, {
|
|
122
122
|
profile: OwnProfile;
|
package/dist/community/client.js
CHANGED
|
@@ -199,7 +199,8 @@ function ie(e) {
|
|
|
199
199
|
},
|
|
200
200
|
me: {
|
|
201
201
|
get: c("me.get"),
|
|
202
|
-
|
|
202
|
+
// O-16 / F-51: `termsTextId` goes only when the caller sets it (pick drops an absent key, so an older kb-api never sees it).
|
|
203
|
+
onboard: r("me.onboard", ["ageBand", "rulesTextId", "termsTextId", "art9TextId", "art9Refused", "displayName", "handle", "avatarPreset"]),
|
|
203
204
|
updateProfile: r("me.updateProfile", ["displayName", "handle", "avatarPreset", "bio"]),
|
|
204
205
|
notifications: {
|
|
205
206
|
list: r("me.notifications.list", ["cursor", "unreadOnly", "codes"]),
|
|
@@ -44,7 +44,7 @@ export declare const COMMUNITY_MESSAGES_CS: {
|
|
|
44
44
|
readonly 'error.followLimit': "Sledujete toho už hodně. Něco prosím přestaňte sledovat a zkuste to znovu.";
|
|
45
45
|
readonly 'error.submit': "Nepovedlo se to. Obnovte prosím stránku a zkuste to znovu.";
|
|
46
46
|
readonly 'need.sign_in': "Do diskuse můžete psát po přihlášení.";
|
|
47
|
-
readonly 'need.onboarding': "Před prvním komentářem si nastavte jméno a potvrďte pravidla diskuse.";
|
|
47
|
+
readonly 'need.onboarding': "Před prvním komentářem si nastavte jméno a potvrďte pravidla diskuse a podmínky.";
|
|
48
48
|
readonly 'need.reconsent_rules': "Pravidla diskuse se změnila. Potvrďte prosím novou verzi.";
|
|
49
49
|
readonly 'need.art9_consent': "Pro psaní do diskuse potřebujeme váš souhlas se zpracováním.";
|
|
50
50
|
readonly 'state.visible': "Zveřejněno";
|
|
@@ -169,6 +169,8 @@ export declare const COMMUNITY_MESSAGES_CS: {
|
|
|
169
169
|
readonly 'onboarding.rulesLede': "Přečtěte si prosím, jak to v diskusi chodí.";
|
|
170
170
|
readonly 'onboarding.rulesLink': "Celá pravidla";
|
|
171
171
|
readonly 'onboarding.rulesAccept': "Souhlasím s pravidly diskuse.";
|
|
172
|
+
readonly 'onboarding.rulesTermsAccept': "Souhlasím s pravidly diskuse a s podmínkami.";
|
|
173
|
+
readonly 'onboarding.termsLink': "Podmínky diskuse";
|
|
172
174
|
readonly 'onboarding.rulesChanged': "Pravidla diskuse se od vaší poslední návštěvy změnila. Přečtěte si prosím novou verzi a potvrďte ji.";
|
|
173
175
|
readonly 'onboarding.art9Title': "Souhlas se zpracováním";
|
|
174
176
|
readonly 'onboarding.art9Lede': "Pro psaní do diskuse potřebujeme váš souhlas podle textu níže.";
|
|
@@ -225,7 +227,7 @@ export declare const COMMUNITY_MESSAGES_CS: {
|
|
|
225
227
|
readonly 'panel.art9Refused': "Souhlas se zpracováním jste odmítli.";
|
|
226
228
|
readonly 'panel.art9Withdraw': "Odvolat souhlas";
|
|
227
229
|
readonly 'panel.art9WithdrawTitle': "Odvolat souhlas se zpracováním?";
|
|
228
|
-
readonly 'panel.art9WithdrawExplain': "Diskusi můžete dál číst.
|
|
230
|
+
readonly 'panel.art9WithdrawExplain': "Diskusi můžete dál číst. Příspěvky ve fóru, které jste napsali se souhlasem, smažeme za 7 dní — když souhlas do té doby znovu udělíte, zůstanou. Jestli půjde psát i bez souhlasu, záleží na nastavení webu; řekne vám to před dalším komentářem.";
|
|
229
231
|
readonly 'panel.art9WithdrawConfirm': "Ano, odvolat souhlas";
|
|
230
232
|
readonly 'panel.art9WithdrawCancel': "Ponechat souhlas";
|
|
231
233
|
readonly 'panel.art9Withdrawn': "Souhlas jste odvolali.";
|
|
@@ -448,7 +450,7 @@ export declare const COMMUNITY_MESSAGES_CS: {
|
|
|
448
450
|
readonly 'forumText.confirm.other': "Rozumím upozornění a chci příspěvek odeslat.";
|
|
449
451
|
readonly 'forumText.warning.identifier': "V příspěvku je nejspíš e-mail, telefon nebo číslo účtu. Pokud tam být nemá, příspěvek upravte.";
|
|
450
452
|
readonly 'forumText.warning.other': "Příspěvek je zveřejněný, ale pravidla diskuse u něj na něco upozorňují. Projděte si ho prosím.";
|
|
451
|
-
readonly 'forumText.need.onboarding': "Před prvním příspěvkem si nastavte jméno a potvrďte pravidla diskuse.";
|
|
453
|
+
readonly 'forumText.need.onboarding': "Před prvním příspěvkem si nastavte jméno a potvrďte pravidla diskuse a podmínky.";
|
|
452
454
|
readonly 'forumText.need.art9_consent': "Pro psaní ve fóru potřebujeme váš souhlas se zpracováním.";
|
|
453
455
|
readonly 'search.title': "Hledání ve fóru";
|
|
454
456
|
readonly 'search.label': "Co hledáte?";
|
|
@@ -36,7 +36,8 @@ const e = {
|
|
|
36
36
|
"error.submit": "Nepovedlo se to. Obnovte prosím stránku a zkuste to znovu.",
|
|
37
37
|
// ── what the composer waits for (need.<Need>) ──
|
|
38
38
|
"need.sign_in": "Do diskuse můžete psát po přihlášení.",
|
|
39
|
-
|
|
39
|
+
// O-16 / F-51: the first join confirms the rules and the terms in one go (the terms once, never again).
|
|
40
|
+
"need.onboarding": "Před prvním komentářem si nastavte jméno a potvrďte pravidla diskuse a podmínky.",
|
|
40
41
|
"need.reconsent_rules": "Pravidla diskuse se změnila. Potvrďte prosím novou verzi.",
|
|
41
42
|
"need.art9_consent": "Pro psaní do diskuse potřebujeme váš souhlas se zpracováním.",
|
|
42
43
|
// ── a message's state (state.<MessageState>) ──
|
|
@@ -172,6 +173,9 @@ const e = {
|
|
|
172
173
|
"onboarding.rulesLede": "Přečtěte si prosím, jak to v diskusi chodí.",
|
|
173
174
|
"onboarding.rulesLink": "Celá pravidla",
|
|
174
175
|
"onboarding.rulesAccept": "Souhlasím s pravidly diskuse.",
|
|
176
|
+
// O-16 / F-51: the one consent of a first join where the tenant has terms (the rules and the terms, each linked).
|
|
177
|
+
"onboarding.rulesTermsAccept": "Souhlasím s pravidly diskuse a s podmínkami.",
|
|
178
|
+
"onboarding.termsLink": "Podmínky diskuse",
|
|
175
179
|
"onboarding.rulesChanged": "Pravidla diskuse se od vaší poslední návštěvy změnila. Přečtěte si prosím novou verzi a potvrďte ji.",
|
|
176
180
|
"onboarding.art9Title": "Souhlas se zpracováním",
|
|
177
181
|
"onboarding.art9Lede": "Pro psaní do diskuse potřebujeme váš souhlas podle textu níže.",
|
|
@@ -231,7 +235,7 @@ const e = {
|
|
|
231
235
|
"panel.art9Refused": "Souhlas se zpracováním jste odmítli.",
|
|
232
236
|
"panel.art9Withdraw": "Odvolat souhlas",
|
|
233
237
|
"panel.art9WithdrawTitle": "Odvolat souhlas se zpracováním?",
|
|
234
|
-
"panel.art9WithdrawExplain": "Diskusi můžete dál číst.
|
|
238
|
+
"panel.art9WithdrawExplain": "Diskusi můžete dál číst. Příspěvky ve fóru, které jste napsali se souhlasem, smažeme za 7 dní — když souhlas do té doby znovu udělíte, zůstanou. Jestli půjde psát i bez souhlasu, záleží na nastavení webu; řekne vám to před dalším komentářem.",
|
|
235
239
|
"panel.art9WithdrawConfirm": "Ano, odvolat souhlas",
|
|
236
240
|
"panel.art9WithdrawCancel": "Ponechat souhlas",
|
|
237
241
|
"panel.art9Withdrawn": "Souhlas jste odvolali.",
|
|
@@ -477,7 +481,7 @@ const e = {
|
|
|
477
481
|
"forumText.confirm.other": "Rozumím upozornění a chci příspěvek odeslat.",
|
|
478
482
|
"forumText.warning.identifier": "V příspěvku je nejspíš e-mail, telefon nebo číslo účtu. Pokud tam být nemá, příspěvek upravte.",
|
|
479
483
|
"forumText.warning.other": "Příspěvek je zveřejněný, ale pravidla diskuse u něj na něco upozorňují. Projděte si ho prosím.",
|
|
480
|
-
"forumText.need.onboarding": "Před prvním příspěvkem si nastavte jméno a potvrďte pravidla diskuse.",
|
|
484
|
+
"forumText.need.onboarding": "Před prvním příspěvkem si nastavte jméno a potvrďte pravidla diskuse a podmínky.",
|
|
481
485
|
"forumText.need.art9_consent": "Pro psaní ve fóru potřebujeme váš souhlas se zpracováním.",
|
|
482
486
|
"search.title": "Hledání ve fóru",
|
|
483
487
|
"search.label": "Co hledáte?",
|
|
@@ -38,7 +38,7 @@ export declare const COMMUNITY_MESSAGES_EN: {
|
|
|
38
38
|
readonly 'error.followLimit': "You're already following a lot. Please unfollow something and try again.";
|
|
39
39
|
readonly 'error.submit': "That didn't work. Please reload the page and try again.";
|
|
40
40
|
readonly 'need.sign_in': "Sign in to write in the discussion.";
|
|
41
|
-
readonly 'need.onboarding': "Before your first comment, choose a name and confirm the discussion rules.";
|
|
41
|
+
readonly 'need.onboarding': "Before your first comment, choose a name and confirm the discussion rules and terms.";
|
|
42
42
|
readonly 'need.reconsent_rules': "The discussion rules have changed. Please confirm the new version.";
|
|
43
43
|
readonly 'need.art9_consent': "To write in the discussion, we need your consent to the processing.";
|
|
44
44
|
readonly 'state.visible': "Published";
|
|
@@ -155,6 +155,8 @@ export declare const COMMUNITY_MESSAGES_EN: {
|
|
|
155
155
|
readonly 'onboarding.rulesLede': "Please read how the discussion works.";
|
|
156
156
|
readonly 'onboarding.rulesLink': "The full rules";
|
|
157
157
|
readonly 'onboarding.rulesAccept': "I agree to the discussion rules.";
|
|
158
|
+
readonly 'onboarding.rulesTermsAccept': "I agree to the discussion rules and the terms.";
|
|
159
|
+
readonly 'onboarding.termsLink': "The discussion terms";
|
|
158
160
|
readonly 'onboarding.rulesChanged': "The discussion rules have changed since your last visit. Please read the new version and confirm it.";
|
|
159
161
|
readonly 'onboarding.art9Title': "Consent to processing";
|
|
160
162
|
readonly 'onboarding.art9Lede': "To write in the discussion, we need your consent as described below.";
|
|
@@ -209,7 +211,7 @@ export declare const COMMUNITY_MESSAGES_EN: {
|
|
|
209
211
|
readonly 'panel.art9Refused': "You declined the consent to the processing.";
|
|
210
212
|
readonly 'panel.art9Withdraw': "Withdraw consent";
|
|
211
213
|
readonly 'panel.art9WithdrawTitle': "Withdraw your consent to the processing?";
|
|
212
|
-
readonly 'panel.art9WithdrawExplain': "You can keep reading the discussion.
|
|
214
|
+
readonly 'panel.art9WithdrawExplain': "You can keep reading the discussion. The forum posts you wrote under the consent are erased after 7 days — give the consent again before then and they stay. Whether you can write without the consent depends on the website's settings; it tells you before your next comment.";
|
|
213
215
|
readonly 'panel.art9WithdrawConfirm': "Yes, withdraw consent";
|
|
214
216
|
readonly 'panel.art9WithdrawCancel': "Keep the consent";
|
|
215
217
|
readonly 'panel.art9Withdrawn': "You've withdrawn your consent.";
|
|
@@ -420,7 +422,7 @@ export declare const COMMUNITY_MESSAGES_EN: {
|
|
|
420
422
|
readonly 'forumText.confirm.other': "I understand the notice and want to send the post.";
|
|
421
423
|
readonly 'forumText.warning.identifier': "The post seems to contain an e-mail address, a phone number or an account number. If it shouldn't be there, edit the post.";
|
|
422
424
|
readonly 'forumText.warning.other': "The post is published, but the discussion rules flag something in it. Please look it over.";
|
|
423
|
-
readonly 'forumText.need.onboarding': "Before your first post, choose a name and confirm the discussion rules.";
|
|
425
|
+
readonly 'forumText.need.onboarding': "Before your first post, choose a name and confirm the discussion rules and terms.";
|
|
424
426
|
readonly 'forumText.need.art9_consent': "To write in the forum, we need your consent to the processing.";
|
|
425
427
|
readonly 'search.title': "Search the forum";
|
|
426
428
|
readonly 'search.label': "What are you looking for?";
|
|
@@ -33,7 +33,8 @@ const e = {
|
|
|
33
33
|
"error.followLimit": "You're already following a lot. Please unfollow something and try again.",
|
|
34
34
|
"error.submit": "That didn't work. Please reload the page and try again.",
|
|
35
35
|
"need.sign_in": "Sign in to write in the discussion.",
|
|
36
|
-
|
|
36
|
+
// O-16 / F-51: the first join confirms the rules and the terms in one go (the terms once, never again).
|
|
37
|
+
"need.onboarding": "Before your first comment, choose a name and confirm the discussion rules and terms.",
|
|
37
38
|
"need.reconsent_rules": "The discussion rules have changed. Please confirm the new version.",
|
|
38
39
|
"need.art9_consent": "To write in the discussion, we need your consent to the processing.",
|
|
39
40
|
"state.visible": "Published",
|
|
@@ -150,6 +151,9 @@ const e = {
|
|
|
150
151
|
"onboarding.rulesLede": "Please read how the discussion works.",
|
|
151
152
|
"onboarding.rulesLink": "The full rules",
|
|
152
153
|
"onboarding.rulesAccept": "I agree to the discussion rules.",
|
|
154
|
+
// O-16 / F-51: the one consent of a first join where the tenant has terms (the rules and the terms, each linked).
|
|
155
|
+
"onboarding.rulesTermsAccept": "I agree to the discussion rules and the terms.",
|
|
156
|
+
"onboarding.termsLink": "The discussion terms",
|
|
153
157
|
"onboarding.rulesChanged": "The discussion rules have changed since your last visit. Please read the new version and confirm it.",
|
|
154
158
|
"onboarding.art9Title": "Consent to processing",
|
|
155
159
|
"onboarding.art9Lede": "To write in the discussion, we need your consent as described below.",
|
|
@@ -205,7 +209,7 @@ const e = {
|
|
|
205
209
|
"panel.art9Refused": "You declined the consent to the processing.",
|
|
206
210
|
"panel.art9Withdraw": "Withdraw consent",
|
|
207
211
|
"panel.art9WithdrawTitle": "Withdraw your consent to the processing?",
|
|
208
|
-
"panel.art9WithdrawExplain": "You can keep reading the discussion.
|
|
212
|
+
"panel.art9WithdrawExplain": "You can keep reading the discussion. The forum posts you wrote under the consent are erased after 7 days — give the consent again before then and they stay. Whether you can write without the consent depends on the website's settings; it tells you before your next comment.",
|
|
209
213
|
"panel.art9WithdrawConfirm": "Yes, withdraw consent",
|
|
210
214
|
"panel.art9WithdrawCancel": "Keep the consent",
|
|
211
215
|
"panel.art9Withdrawn": "You've withdrawn your consent.",
|
|
@@ -425,7 +429,7 @@ const e = {
|
|
|
425
429
|
"forumText.confirm.other": "I understand the notice and want to send the post.",
|
|
426
430
|
"forumText.warning.identifier": "The post seems to contain an e-mail address, a phone number or an account number. If it shouldn't be there, edit the post.",
|
|
427
431
|
"forumText.warning.other": "The post is published, but the discussion rules flag something in it. Please look it over.",
|
|
428
|
-
"forumText.need.onboarding": "Before your first post, choose a name and confirm the discussion rules.",
|
|
432
|
+
"forumText.need.onboarding": "Before your first post, choose a name and confirm the discussion rules and terms.",
|
|
429
433
|
"forumText.need.art9_consent": "To write in the forum, we need your consent to the processing.",
|
|
430
434
|
"search.title": "Search the forum",
|
|
431
435
|
"search.label": "What are you looking for?",
|
|
@@ -360,6 +360,14 @@ export interface MyState {
|
|
|
360
360
|
readonly profile: OwnProfile | null;
|
|
361
361
|
readonly acceptances: {
|
|
362
362
|
readonly rules: AcceptanceState;
|
|
363
|
+
/**
|
|
364
|
+
* O-16 / F-51 (the owner, 9. 11. 2026: the terms are accepted once, at onboarding, and never asked again): null when
|
|
365
|
+
* the tenant publishes no terms text, `accepted` once the member accepted any terms text (for good — never
|
|
366
|
+
* `reconsent_required`), `never` otherwise. No `need` ever asks for the terms; a first onboarding sends
|
|
367
|
+
* `termsTextId` (viewerNeeds(me).terms). Absent from a kb-api older than O-16 — that kb-api does not take
|
|
368
|
+
* `termsTextId` either (its strict schema refuses the key), so nothing is sent then.
|
|
369
|
+
*/
|
|
370
|
+
readonly terms?: AcceptanceState | null;
|
|
363
371
|
readonly art9Consent: AcceptanceState | null;
|
|
364
372
|
/**
|
|
365
373
|
* M2 T9 (§3.8): the member refused the art. 9 consent under `art9Refusal = public_write` and has not given it
|
|
@@ -779,6 +787,13 @@ export interface OnboardInput {
|
|
|
779
787
|
ageBand: AgeBand;
|
|
780
788
|
/** The current `rules` text's id (`legal/current`). */
|
|
781
789
|
rulesTextId: string;
|
|
790
|
+
/**
|
|
791
|
+
* O-16 / F-51: the current `terms` text's id (`legal/current { kind: 'terms' }`) — required on a member's first
|
|
792
|
+
* onboarding while the tenant has a terms text (MyState.acceptances.terms `never`): the key absent, null or another
|
|
793
|
+
* id is VALIDATION on `termsTextId` then. Recorded once and never asked again. Send it only to a kb-api whose me/get
|
|
794
|
+
* answers `acceptances.terms` (viewerNeeds(me).terms): an older one refuses the key.
|
|
795
|
+
*/
|
|
796
|
+
termsTextId?: string | null;
|
|
782
797
|
/** The current `art9_consent` text's id, when the tenant asks for the consent. */
|
|
783
798
|
art9TextId?: string | null;
|
|
784
799
|
/**
|
|
@@ -167,11 +167,23 @@ export interface ViewerNeeds {
|
|
|
167
167
|
readonly rules: boolean;
|
|
168
168
|
/** The consent the tenant asks for before writing. */
|
|
169
169
|
readonly art9: boolean;
|
|
170
|
+
/**
|
|
171
|
+
* O-16 / F-51 (the owner, 9. 11. 2026: the terms once, never again): the first join also accepts the tenant's terms,
|
|
172
|
+
* so its me/onboard sends `termsTextId` — read from a MyState: a first join (`onboarding`) whose `acceptances.terms`
|
|
173
|
+
* is `never` (the tenant has a terms text, none accepted). Presence of the field is the rollout guard: a kb-api
|
|
174
|
+
* older than O-16 answers no `terms` and refuses the key, so nothing is sent to it. Never true for a member already
|
|
175
|
+
* onboarded (they are never asked) nor from a discussion state (no acceptances there), and not a need of its own:
|
|
176
|
+
* `any` does not count it — it rides on the onboarding.
|
|
177
|
+
*/
|
|
178
|
+
readonly terms: boolean;
|
|
170
179
|
/** Any of these. */
|
|
171
180
|
readonly any: boolean;
|
|
172
181
|
}
|
|
173
182
|
export declare function viewerNeeds(state: Pick<DiscussionState, 'viewer'> | {
|
|
174
183
|
needs: readonly unknown[];
|
|
184
|
+
acceptances?: {
|
|
185
|
+
readonly terms?: unknown;
|
|
186
|
+
} | null;
|
|
175
187
|
}): ViewerNeeds;
|
|
176
188
|
/** A loaded message (top-level or reply) by its seq, or null. */
|
|
177
189
|
export declare function findMessage(state: Pick<DiscussionState, 'messages'>, seq: number): DiscussionMessage | null;
|
package/dist/community/store.js
CHANGED
|
@@ -40,7 +40,7 @@ function N(e, s) {
|
|
|
40
40
|
const M = N(y, !1);
|
|
41
41
|
M && g.push(M);
|
|
42
42
|
}
|
|
43
|
-
const
|
|
43
|
+
const O = Z(e.notes);
|
|
44
44
|
return Object.freeze({
|
|
45
45
|
conversationId: r,
|
|
46
46
|
seq: e.seq,
|
|
@@ -60,7 +60,7 @@ function N(e, s) {
|
|
|
60
60
|
collapsed: e.collapsed === !0,
|
|
61
61
|
reactions: L(e.reactions),
|
|
62
62
|
translationVersionId: f(e.translationVersionId),
|
|
63
|
-
...
|
|
63
|
+
...O && O.length > 0 ? { notes: O } : {},
|
|
64
64
|
// Only as kb-api sends it: true, on a `held` message (the author's own, held back by the art. 9 policy).
|
|
65
65
|
...e.hiddenUntilConsent === !0 && e.state === "held" ? { hiddenUntilConsent: !0 } : {},
|
|
66
66
|
// M3 (§4.2): the author's own message waiting in pre-moderation — true on a `held` row only, as kb-api sends it.
|
|
@@ -134,7 +134,7 @@ function Ce() {
|
|
|
134
134
|
let e = V;
|
|
135
135
|
const s = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Set();
|
|
136
136
|
let c = 0, m = -1;
|
|
137
|
-
const g = /* @__PURE__ */ new Set(),
|
|
137
|
+
const g = /* @__PURE__ */ new Set(), O = () => {
|
|
138
138
|
c += 1, g.clear();
|
|
139
139
|
for (const t of n.keys())
|
|
140
140
|
r.delete(t), r.add(t);
|
|
@@ -156,7 +156,7 @@ function Ce() {
|
|
|
156
156
|
function M(t, o = {}) {
|
|
157
157
|
if (!C(t)) return;
|
|
158
158
|
const u = f(t.articleId)?.toLowerCase() ?? null, l = e.articleId !== null && u !== null && u !== e.articleId, i = l ? V : e;
|
|
159
|
-
l &&
|
|
159
|
+
l && O();
|
|
160
160
|
const b = typeof o.cursor == "number" && Number.isFinite(o.cursor) ? o.cursor : null, I = b ?? 0, q = typeof t.nextCursor == "number" && Number.isFinite(t.nextCursor) ? t.nextCursor : null, h = q ?? Number.POSITIVE_INFINITY, j = /* @__PURE__ */ new Map();
|
|
161
161
|
for (const d of Array.isArray(t.messages) ? t.messages : []) {
|
|
162
162
|
const a = N(d, !0);
|
|
@@ -172,18 +172,18 @@ function Ce() {
|
|
|
172
172
|
const a = [d, ...d.replies];
|
|
173
173
|
for (const S of a) S.pending && S.pending !== "post" && S.clientMsgId && p.set(S.seq, S);
|
|
174
174
|
}
|
|
175
|
-
const
|
|
175
|
+
const v = (d) => {
|
|
176
176
|
const a = p.get(d.seq);
|
|
177
177
|
if (!a) return d;
|
|
178
178
|
const S = a.clientMsgId ? n.get(a.clientMsgId) : void 0;
|
|
179
179
|
return S && (S.before = d), a.replyToSeq === null ? Object.freeze({ ...a, replies: d.replies }) : a;
|
|
180
|
-
},
|
|
180
|
+
}, z = i.messages.filter((d) => d.seq < 0 || d.seq <= I || d.seq > h), R = /* @__PURE__ */ new Map();
|
|
181
181
|
for (const d of i.messages)
|
|
182
182
|
for (const a of d.replies)
|
|
183
183
|
a.seq < 0 && a.replyToSeq !== null && R.set(a.replyToSeq, [...R.get(a.replyToSeq) ?? [], a]);
|
|
184
|
-
const A = [...
|
|
184
|
+
const A = [...z.filter((d) => !j.has(d.seq)), ...j.values()].map((d) => {
|
|
185
185
|
if (!j.has(d.seq)) return d;
|
|
186
|
-
const a =
|
|
186
|
+
const a = v(d), S = a.replies.map(v), H = R.get(d.seq) ?? [];
|
|
187
187
|
return S.some((fe, pe) => fe !== a.replies[pe]) || H.length > 0 ? Object.freeze({ ...a, replies: x([...S, ...H]) }) : a;
|
|
188
188
|
}), _ = i.loaded ? i.nextCursor : 0, de = _ === null ? null : I > _ ? _ : q === null ? null : Math.max(_, q);
|
|
189
189
|
y({
|
|
@@ -266,11 +266,11 @@ function Ce() {
|
|
|
266
266
|
const b = t.warnings ? Z(t.warnings) : void 0, I = b && b.length > 0 ? Object.freeze({ ...l, warnings: b }) : l, q = k(i, (p) => p.seq === I.seq);
|
|
267
267
|
let h, j = e.count;
|
|
268
268
|
if (I.state === "deleted" || o?.type === "delete") {
|
|
269
|
-
const p = q ?? null,
|
|
269
|
+
const p = q ?? null, v = p?.state === "visible" && p.body !== null;
|
|
270
270
|
h = T(
|
|
271
271
|
i,
|
|
272
|
-
(
|
|
273
|
-
),
|
|
272
|
+
(z) => z.seq !== I.seq ? z : Y(z) ? Object.freeze({ ...I, replies: z.replies }) : null
|
|
273
|
+
), v && (j = Math.max(0, j - 1));
|
|
274
274
|
} else
|
|
275
275
|
h = U(i, I), !q && I.state === "visible" && (j += 1);
|
|
276
276
|
y({
|
|
@@ -364,11 +364,11 @@ function Ce() {
|
|
|
364
364
|
return y({ ...e, articleReactions: Object.freeze({ counts: A.counts, mine: e.articleReactions.mine }) }), "applied";
|
|
365
365
|
}
|
|
366
366
|
if (!P(t.seq)) return "dropped";
|
|
367
|
-
const p = t.seq,
|
|
368
|
-
if (!
|
|
369
|
-
if (o >
|
|
370
|
-
const
|
|
371
|
-
return y({ ...e, messages: T(e.messages, (A) => A ===
|
|
367
|
+
const p = t.seq, v = k(e.messages, (A) => A.seq === p);
|
|
368
|
+
if (!v || v.pending || o < v.rev) return "dropped";
|
|
369
|
+
if (o > v.rev) return "resync";
|
|
370
|
+
const z = L(t.reactions), R = Object.freeze({ counts: z.counts, mine: v.reactions.mine });
|
|
371
|
+
return y({ ...e, messages: T(e.messages, (A) => A === v ? Object.freeze({ ...A, reactions: R }) : A) }), "applied";
|
|
372
372
|
}
|
|
373
373
|
if (t.kind !== "message" && t.kind !== "edit" && t.kind !== "delete") return "dropped";
|
|
374
374
|
const u = t.message, l = N(u, u?.replyToSeq === null || u?.replyToSeq === void 0);
|
|
@@ -378,11 +378,11 @@ function Ce() {
|
|
|
378
378
|
const b = i?.rev ?? 0;
|
|
379
379
|
if (t.kind === "delete") {
|
|
380
380
|
if (!i || o <= b) return "dropped";
|
|
381
|
-
const p = i.state === "visible" && i.body !== null,
|
|
381
|
+
const p = i.state === "visible" && i.body !== null, v = T(
|
|
382
382
|
e.messages,
|
|
383
|
-
(
|
|
383
|
+
(z) => z.seq !== l.seq ? z : Y(z) ? Object.freeze({ ...l, replies: z.replies }) : null
|
|
384
384
|
);
|
|
385
|
-
return y({ ...e, messages:
|
|
385
|
+
return y({ ...e, messages: v, count: p ? Math.max(0, e.count - 1) : e.count, lastSeq: Math.max(e.lastSeq, l.seq) }), "applied";
|
|
386
386
|
}
|
|
387
387
|
const I = l.author.kind === "member" && l.author.memberId !== null && l.author.memberId === e.viewer.memberId;
|
|
388
388
|
if (!i && I && [...n.values()].some((p) => p.type === "post") || o <= b) return "dropped";
|
|
@@ -404,7 +404,7 @@ function Ce() {
|
|
|
404
404
|
collapse: ce,
|
|
405
405
|
applyEvent: ae,
|
|
406
406
|
reset() {
|
|
407
|
-
|
|
407
|
+
O(), y(V);
|
|
408
408
|
}
|
|
409
409
|
};
|
|
410
410
|
return w.set(B, () => c), B;
|
|
@@ -414,8 +414,8 @@ function X(e) {
|
|
|
414
414
|
return Object.freeze(r);
|
|
415
415
|
}
|
|
416
416
|
function Te(e) {
|
|
417
|
-
const s = "viewer" in e ? e.viewer.needs : e.needs, n = new Set(s.filter($)), r = n.has("sign_in"), c = n.has("onboarding"), m = c || n.has("reconsent_rules"), g = n.has("art9_consent");
|
|
418
|
-
return Object.freeze({ signIn: r, onboarding: c, rules: m, art9: g, any: r || c || m || g });
|
|
417
|
+
const s = "viewer" in e ? e.viewer.needs : e.needs, n = new Set(s.filter($)), r = n.has("sign_in"), c = n.has("onboarding"), m = c || n.has("reconsent_rules"), g = n.has("art9_consent"), O = c && !("viewer" in e) && e.acceptances?.terms === "never";
|
|
418
|
+
return Object.freeze({ signIn: r, onboarding: c, rules: m, art9: g, terms: O, any: r || c || m || g });
|
|
419
419
|
}
|
|
420
420
|
function Me(e, s) {
|
|
421
421
|
return k(e.messages, (n) => n.seq === s);
|
|
@@ -450,15 +450,15 @@ function ee(e) {
|
|
|
450
450
|
const ze = (e) => typeof e == "number" && Number.isFinite(e) ? e : null;
|
|
451
451
|
async function xe(e, s, n, r) {
|
|
452
452
|
const c = e.getState(), m = c.loaded ? c.nextCursor : 0, g = ee(e);
|
|
453
|
-
let
|
|
453
|
+
let O = null;
|
|
454
454
|
for (let y = 0; y < ve; y++) {
|
|
455
|
-
const M = await s.discussions.list({ articleId: n.articleId, languageCode: n.languageCode ?? null, cursor:
|
|
455
|
+
const M = await s.discussions.list({ articleId: n.articleId, languageCode: n.languageCode ?? null, cursor: O }, r);
|
|
456
456
|
if (!M.ok) return M;
|
|
457
457
|
if (g.moved()) break;
|
|
458
|
-
e.applyPage(M.value, { cursor:
|
|
458
|
+
e.applyPage(M.value, { cursor: O }), g.mark();
|
|
459
459
|
const E = ze(M.value.nextCursor);
|
|
460
|
-
if (E === null || m !== null && E >= m ||
|
|
461
|
-
|
|
460
|
+
if (E === null || m !== null && E >= m || O !== null && E <= O) break;
|
|
461
|
+
O = E;
|
|
462
462
|
}
|
|
463
463
|
return { ok: !0, value: e.getState() };
|
|
464
464
|
}
|
|
@@ -7,20 +7,26 @@
|
|
|
7
7
|
* Usage in Nuxt pages:
|
|
8
8
|
* const { articles, totalCount } = await useAsyncArticleList('home', { status: 'published' })
|
|
9
9
|
*/
|
|
10
|
-
import type { Ref } from 'vue';
|
|
10
|
+
import type { Ref, WatchSource } from 'vue';
|
|
11
11
|
import type { ArticleListParams } from '../../vue/composables/useArticles.js';
|
|
12
|
+
/**
|
|
13
|
+
* What `useAsyncData`'s `watch` takes (Vue's `MultiWatchSources`, spelled out because Vue exports that
|
|
14
|
+
* name only from 3.5): refs, getters and reactive objects. The adapters used to type it `unknown[]`,
|
|
15
|
+
* which Nuxt's own `useAsyncData` types refuse (a Nuxt app's typecheck failed in all three).
|
|
16
|
+
*/
|
|
17
|
+
export type AsyncWatchDeps = (WatchSource<unknown> | object)[];
|
|
12
18
|
/**
|
|
13
19
|
* SSR-hydrated article list.
|
|
14
20
|
*
|
|
15
21
|
* Wraps useArticleList with Nuxt's useAsyncData.
|
|
16
22
|
*/
|
|
17
|
-
export declare function useAsyncArticleList(key: string, params?: ArticleListParams, watchDeps?:
|
|
23
|
+
export declare function useAsyncArticleList(key: string, params?: ArticleListParams, watchDeps?: AsyncWatchDeps): Promise<import("../../vue/index.js").UseArticleListReturn>;
|
|
18
24
|
/**
|
|
19
25
|
* SSR-hydrated single article.
|
|
20
26
|
*
|
|
21
27
|
* Wraps useArticle with Nuxt's useAsyncData.
|
|
22
28
|
*/
|
|
23
|
-
export declare function useAsyncArticle(key: string, filename: Ref<string> | string, languageCode: Ref<string> | string, watchDeps?:
|
|
29
|
+
export declare function useAsyncArticle(key: string, filename: Ref<string> | string, languageCode: Ref<string> | string, watchDeps?: AsyncWatchDeps): Promise<import("../../vue/index.js").UseArticleReturn>;
|
|
24
30
|
/**
|
|
25
31
|
* SSR-hydrated navigation menu.
|
|
26
32
|
*
|
|
@@ -29,4 +35,4 @@ export declare function useAsyncArticle(key: string, filename: Ref<string> | str
|
|
|
29
35
|
export declare function useAsyncNavigation(key: string, params?: {
|
|
30
36
|
scope?: string;
|
|
31
37
|
locale?: string;
|
|
32
|
-
}, watchDeps?:
|
|
38
|
+
}, watchDeps?: AsyncWatchDeps): Promise<import("../../vue/index.js").UseNavigationReturn>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import o from "./GalleryLightbox.vue2.js";
|
|
2
2
|
import t from "../../_virtual/_plugin-vue_export-helper.js";
|
|
3
|
-
const
|
|
3
|
+
const _ = /* @__PURE__ */ t(o, [["__scopeId", "data-v-458c8685"]]);
|
|
4
4
|
export {
|
|
5
|
-
|
|
5
|
+
_ as default
|
|
6
6
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as H, ref as f, onMounted as L, onBeforeUnmount as P, createElementBlock as
|
|
1
|
+
import { defineComponent as H, ref as f, onMounted as L, onBeforeUnmount as P, createElementBlock as s, openBlock as u, normalizeClass as i, unref as e, createCommentVNode as d, createElementVNode as p, toDisplayString as v, Fragment as B, renderList as F, normalizeStyle as j } from "vue";
|
|
2
2
|
import { tripMapStyles as r } from "@blogmcp/mdx-schema/styles";
|
|
3
3
|
import { useTripMap as D } from "../../composables/useTripMap.js";
|
|
4
4
|
import { tripMapFormatTime as G } from "@blogmcp/mdx-schema/tripmap";
|
|
@@ -21,7 +21,7 @@ const W = ["aria-label"], $ = ["src", "alt"], R = /* @__PURE__ */ H({
|
|
|
21
21
|
title: {}
|
|
22
22
|
},
|
|
23
23
|
setup(y) {
|
|
24
|
-
const l = y, { handNodes: S, facadeThumbs: w, facadeStops: U, heightStyle: _, geoUrl: z, isConfigOnly: I, labels: A, texts: g } = D(l), N = f(null), h = f(null), x = f(null),
|
|
24
|
+
const l = y, { handNodes: S, facadeThumbs: w, facadeStops: U, heightStyle: _, geoUrl: z, isConfigOnly: I, labels: A, texts: g } = D(l), N = f(null), h = f(null), x = f(null), c = f("facade"), C = f(0);
|
|
25
25
|
let T = null, m = null, k = !1;
|
|
26
26
|
async function O() {
|
|
27
27
|
try {
|
|
@@ -35,26 +35,26 @@ const W = ["aria-label"], $ = ["src", "alt"], R = /* @__PURE__ */ H({
|
|
|
35
35
|
}
|
|
36
36
|
async function E() {
|
|
37
37
|
if (!k) {
|
|
38
|
-
k = !0,
|
|
38
|
+
k = !0, c.value = "loading";
|
|
39
39
|
try {
|
|
40
|
-
const [t,
|
|
41
|
-
id:
|
|
42
|
-
lat:
|
|
43
|
-
lng:
|
|
44
|
-
capturedAt:
|
|
45
|
-
thumbnailUrl:
|
|
46
|
-
imageUrl:
|
|
47
|
-
largeImageUrl:
|
|
48
|
-
altText:
|
|
49
|
-
title:
|
|
40
|
+
const [t, o] = await Promise.all([import("../../../../tripmap-core/dist/index.js"), O()]), a = (o.nodes ?? []).filter((n) => typeof n.latitude == "number" && typeof n.longitude == "number").map((n) => ({
|
|
41
|
+
id: n.slug,
|
|
42
|
+
lat: n.latitude,
|
|
43
|
+
lng: n.longitude,
|
|
44
|
+
capturedAt: n.capturedAt ?? void 0,
|
|
45
|
+
thumbnailUrl: n.thumbnailUrl ?? void 0,
|
|
46
|
+
imageUrl: n.url ?? void 0,
|
|
47
|
+
largeImageUrl: n.largeUrl ?? void 0,
|
|
48
|
+
altText: n.altText ?? void 0,
|
|
49
|
+
title: n.placeName ?? void 0
|
|
50
50
|
})), M = t.buildTripNodes(a, S.value);
|
|
51
|
-
if (C.value =
|
|
52
|
-
|
|
51
|
+
if (C.value = o.skipped ?? 0, M.length === 0 || !h.value) {
|
|
52
|
+
c.value = "empty";
|
|
53
53
|
return;
|
|
54
54
|
}
|
|
55
55
|
const b = new t.TripMap(h.value, {
|
|
56
|
-
styleUrl: l.styleUrl ||
|
|
57
|
-
darkStyleUrl:
|
|
56
|
+
styleUrl: l.styleUrl || o.config?.styleUrl || "",
|
|
57
|
+
darkStyleUrl: o.config?.darkStyleUrl,
|
|
58
58
|
theme: l.theme,
|
|
59
59
|
cluster: l.cluster,
|
|
60
60
|
showLine: l.line,
|
|
@@ -63,22 +63,22 @@ const W = ["aria-label"], $ = ["src", "alt"], R = /* @__PURE__ */ H({
|
|
|
63
63
|
title: l.title,
|
|
64
64
|
detail: l.detail,
|
|
65
65
|
detailHost: l.detail === "panel" ? x.value ?? void 0 : void 0,
|
|
66
|
-
extraAttribution:
|
|
66
|
+
extraAttribution: o.config?.attribution,
|
|
67
67
|
labels: A.value,
|
|
68
68
|
initialView: V(),
|
|
69
69
|
events: {}
|
|
70
70
|
});
|
|
71
|
-
b.setNodes(M), await b.init(), T = () => b.destroy(),
|
|
71
|
+
b.setNodes(M), await b.init(), T = () => b.destroy(), c.value = "live";
|
|
72
72
|
} catch {
|
|
73
|
-
|
|
73
|
+
c.value = k && c.value === "loading" ? "facade" : c.value;
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
76
|
}
|
|
77
77
|
function V() {
|
|
78
78
|
if (!l.center) return;
|
|
79
|
-
const [t,
|
|
80
|
-
if (!(!Number.isFinite(t) || !Number.isFinite(
|
|
81
|
-
return { center: [
|
|
79
|
+
const [t, o] = l.center.split(",").map((a) => Number.parseFloat(a.trim()));
|
|
80
|
+
if (!(t === void 0 || o === void 0 || !Number.isFinite(t) || !Number.isFinite(o)))
|
|
81
|
+
return { center: [o, t], zoom: l.zoom };
|
|
82
82
|
}
|
|
83
83
|
return L(() => {
|
|
84
84
|
const t = N.value;
|
|
@@ -88,30 +88,30 @@ const W = ["aria-label"], $ = ["src", "alt"], R = /* @__PURE__ */ H({
|
|
|
88
88
|
return;
|
|
89
89
|
}
|
|
90
90
|
m = new IntersectionObserver(
|
|
91
|
-
(
|
|
92
|
-
|
|
91
|
+
(o) => {
|
|
92
|
+
o.some((a) => a.isIntersecting) && (m?.disconnect(), m = null, E());
|
|
93
93
|
},
|
|
94
94
|
{ rootMargin: "300px" }
|
|
95
95
|
), m.observe(t);
|
|
96
96
|
}
|
|
97
97
|
}), P(() => {
|
|
98
98
|
m?.disconnect(), T?.();
|
|
99
|
-
}), (t,
|
|
99
|
+
}), (t, o) => (u(), s("div", {
|
|
100
100
|
ref_key: "rootEl",
|
|
101
101
|
ref: N,
|
|
102
102
|
class: i(e(r).container),
|
|
103
103
|
"data-mdx-component": "TripMap",
|
|
104
104
|
"aria-label": y.title
|
|
105
105
|
}, [
|
|
106
|
-
y.title ? (
|
|
106
|
+
y.title ? (u(), s("p", {
|
|
107
107
|
key: 0,
|
|
108
108
|
class: i(e(r).head)
|
|
109
109
|
}, v(y.title), 3)) : d("", !0),
|
|
110
|
-
e(w).length &&
|
|
110
|
+
e(w).length && c.value !== "live" ? (u(), s("ol", {
|
|
111
111
|
key: 1,
|
|
112
112
|
class: i(e(r).strip)
|
|
113
113
|
}, [
|
|
114
|
-
(
|
|
114
|
+
(u(!0), s(B, null, F(e(w), (a) => (u(), s("li", {
|
|
115
115
|
key: a.slug,
|
|
116
116
|
class: i(e(r).stripItem)
|
|
117
117
|
}, [
|
|
@@ -135,7 +135,7 @@ const W = ["aria-label"], $ = ["src", "alt"], R = /* @__PURE__ */ H({
|
|
|
135
135
|
ref: h,
|
|
136
136
|
class: "absolute inset-0"
|
|
137
137
|
}, null, 512),
|
|
138
|
-
|
|
138
|
+
c.value !== "live" ? (u(), s("div", {
|
|
139
139
|
key: 0,
|
|
140
140
|
class: i([e(r).mapOverlay])
|
|
141
141
|
}, [
|
|
@@ -144,31 +144,31 @@ const W = ["aria-label"], $ = ["src", "alt"], R = /* @__PURE__ */ H({
|
|
|
144
144
|
}, [
|
|
145
145
|
p("span", {
|
|
146
146
|
class: i(e(r).mapHint)
|
|
147
|
-
}, v(
|
|
147
|
+
}, v(c.value === "empty" ? e(g).empty : e(g).hint), 3)
|
|
148
148
|
], 2)
|
|
149
149
|
], 2)) : d("", !0)
|
|
150
150
|
], 6),
|
|
151
|
-
l.detail === "panel" ? (
|
|
151
|
+
l.detail === "panel" ? (u(), s("div", {
|
|
152
152
|
key: 2,
|
|
153
153
|
ref_key: "detailEl",
|
|
154
154
|
ref: x,
|
|
155
155
|
class: i(e(r).detailHost)
|
|
156
156
|
}, null, 2)) : d("", !0),
|
|
157
|
-
e(U).length &&
|
|
157
|
+
e(U).length && c.value !== "live" ? (u(), s("ol", {
|
|
158
158
|
key: 3,
|
|
159
159
|
class: i(e(r).stopList)
|
|
160
160
|
}, [
|
|
161
|
-
(
|
|
161
|
+
(u(!0), s(B, null, F(e(U), (a) => (u(), s("li", {
|
|
162
162
|
key: a.key
|
|
163
163
|
}, [
|
|
164
|
-
a.capturedAt ? (
|
|
164
|
+
a.capturedAt ? (u(), s("span", {
|
|
165
165
|
key: 0,
|
|
166
166
|
class: i(e(r).stopTime)
|
|
167
167
|
}, v(e(G)(a.capturedAt)), 3)) : d("", !0),
|
|
168
168
|
p("span", null, v(a.title), 1)
|
|
169
169
|
]))), 128))
|
|
170
170
|
], 2)) : d("", !0),
|
|
171
|
-
|
|
171
|
+
c.value !== "live" ? (u(), s("p", {
|
|
172
172
|
key: 4,
|
|
173
173
|
class: i(e(r).note)
|
|
174
174
|
}, v(e(g).unavailable), 3)) : d("", !0)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blogmcp/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.0",
|
|
4
4
|
"description": "Headless SDK for Knowledge Base blog — core client, Vue composables, Nuxt adapter",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -98,8 +98,8 @@
|
|
|
98
98
|
}
|
|
99
99
|
},
|
|
100
100
|
"dependencies": {
|
|
101
|
-
"@blogmcp/mdx-schema": "^0.
|
|
102
|
-
"@blogmcp/sanitize": "^0.
|
|
101
|
+
"@blogmcp/mdx-schema": "^0.12.0",
|
|
102
|
+
"@blogmcp/sanitize": "^0.12.0",
|
|
103
103
|
"marked": "^15.0.7"
|
|
104
104
|
},
|
|
105
105
|
"optionalDependencies": {
|
package/src/community/client.ts
CHANGED
|
@@ -168,7 +168,7 @@ export interface CommunityClient {
|
|
|
168
168
|
me: {
|
|
169
169
|
/** Anonymous: `{ member: null, needs: ['sign_in'] }`. */
|
|
170
170
|
get: CallNoInput<MyState>
|
|
171
|
-
/** The light onboarding: the age band, the rules (and the consent when asked), the profile. */
|
|
171
|
+
/** The light onboarding: the age band, the rules (and the terms on a first join, and the consent when asked), the profile. */
|
|
172
172
|
onboard: Call<OnboardInput, MyState>
|
|
173
173
|
updateProfile: Call<ProfileUpdateInput, { profile: OwnProfile }>
|
|
174
174
|
notifications: {
|
|
@@ -639,7 +639,8 @@ export function createCommunityClient(config: CommunityClientConfig): CommunityC
|
|
|
639
639
|
},
|
|
640
640
|
me: {
|
|
641
641
|
get: empty('me.get'),
|
|
642
|
-
|
|
642
|
+
// O-16 / F-51: `termsTextId` goes only when the caller sets it (pick drops an absent key, so an older kb-api never sees it).
|
|
643
|
+
onboard: fields('me.onboard', ['ageBand', 'rulesTextId', 'termsTextId', 'art9TextId', 'art9Refused', 'displayName', 'handle', 'avatarPreset']),
|
|
643
644
|
updateProfile: fields('me.updateProfile', ['displayName', 'handle', 'avatarPreset', 'bio']),
|
|
644
645
|
notifications: {
|
|
645
646
|
list: fields('me.notifications.list', ['cursor', 'unreadOnly', 'codes']),
|
|
@@ -48,7 +48,8 @@ export const COMMUNITY_MESSAGES_CS = {
|
|
|
48
48
|
|
|
49
49
|
// ── what the composer waits for (need.<Need>) ──
|
|
50
50
|
'need.sign_in': 'Do diskuse můžete psát po přihlášení.',
|
|
51
|
-
|
|
51
|
+
// O-16 / F-51: the first join confirms the rules and the terms in one go (the terms once, never again).
|
|
52
|
+
'need.onboarding': 'Před prvním komentářem si nastavte jméno a potvrďte pravidla diskuse a podmínky.',
|
|
52
53
|
'need.reconsent_rules': 'Pravidla diskuse se změnila. Potvrďte prosím novou verzi.',
|
|
53
54
|
'need.art9_consent': 'Pro psaní do diskuse potřebujeme váš souhlas se zpracováním.',
|
|
54
55
|
|
|
@@ -196,6 +197,9 @@ export const COMMUNITY_MESSAGES_CS = {
|
|
|
196
197
|
'onboarding.rulesLede': 'Přečtěte si prosím, jak to v diskusi chodí.',
|
|
197
198
|
'onboarding.rulesLink': 'Celá pravidla',
|
|
198
199
|
'onboarding.rulesAccept': 'Souhlasím s pravidly diskuse.',
|
|
200
|
+
// O-16 / F-51: the one consent of a first join where the tenant has terms (the rules and the terms, each linked).
|
|
201
|
+
'onboarding.rulesTermsAccept': 'Souhlasím s pravidly diskuse a s podmínkami.',
|
|
202
|
+
'onboarding.termsLink': 'Podmínky diskuse',
|
|
199
203
|
'onboarding.rulesChanged': 'Pravidla diskuse se od vaší poslední návštěvy změnila. Přečtěte si prosím novou verzi a potvrďte ji.',
|
|
200
204
|
'onboarding.art9Title': 'Souhlas se zpracováním',
|
|
201
205
|
'onboarding.art9Lede': 'Pro psaní do diskuse potřebujeme váš souhlas podle textu níže.',
|
|
@@ -257,7 +261,7 @@ export const COMMUNITY_MESSAGES_CS = {
|
|
|
257
261
|
'panel.art9Refused': 'Souhlas se zpracováním jste odmítli.',
|
|
258
262
|
'panel.art9Withdraw': 'Odvolat souhlas',
|
|
259
263
|
'panel.art9WithdrawTitle': 'Odvolat souhlas se zpracováním?',
|
|
260
|
-
'panel.art9WithdrawExplain': 'Diskusi můžete dál číst.
|
|
264
|
+
'panel.art9WithdrawExplain': 'Diskusi můžete dál číst. Příspěvky ve fóru, které jste napsali se souhlasem, smažeme za 7 dní — když souhlas do té doby znovu udělíte, zůstanou. Jestli půjde psát i bez souhlasu, záleží na nastavení webu; řekne vám to před dalším komentářem.',
|
|
261
265
|
'panel.art9WithdrawConfirm': 'Ano, odvolat souhlas',
|
|
262
266
|
'panel.art9WithdrawCancel': 'Ponechat souhlas',
|
|
263
267
|
'panel.art9Withdrawn': 'Souhlas jste odvolali.',
|
|
@@ -513,7 +517,7 @@ export const COMMUNITY_MESSAGES_CS = {
|
|
|
513
517
|
'forumText.confirm.other': 'Rozumím upozornění a chci příspěvek odeslat.',
|
|
514
518
|
'forumText.warning.identifier': 'V příspěvku je nejspíš e-mail, telefon nebo číslo účtu. Pokud tam být nemá, příspěvek upravte.',
|
|
515
519
|
'forumText.warning.other': 'Příspěvek je zveřejněný, ale pravidla diskuse u něj na něco upozorňují. Projděte si ho prosím.',
|
|
516
|
-
'forumText.need.onboarding': 'Před prvním příspěvkem si nastavte jméno a potvrďte pravidla diskuse.',
|
|
520
|
+
'forumText.need.onboarding': 'Před prvním příspěvkem si nastavte jméno a potvrďte pravidla diskuse a podmínky.',
|
|
517
521
|
'forumText.need.art9_consent': 'Pro psaní ve fóru potřebujeme váš souhlas se zpracováním.',
|
|
518
522
|
'search.title': 'Hledání ve fóru',
|
|
519
523
|
'search.label': 'Co hledáte?',
|
|
@@ -44,7 +44,8 @@ export const COMMUNITY_MESSAGES_EN = {
|
|
|
44
44
|
'error.submit': "That didn't work. Please reload the page and try again.",
|
|
45
45
|
|
|
46
46
|
'need.sign_in': 'Sign in to write in the discussion.',
|
|
47
|
-
|
|
47
|
+
// O-16 / F-51: the first join confirms the rules and the terms in one go (the terms once, never again).
|
|
48
|
+
'need.onboarding': 'Before your first comment, choose a name and confirm the discussion rules and terms.',
|
|
48
49
|
'need.reconsent_rules': 'The discussion rules have changed. Please confirm the new version.',
|
|
49
50
|
'need.art9_consent': 'To write in the discussion, we need your consent to the processing.',
|
|
50
51
|
|
|
@@ -173,6 +174,9 @@ export const COMMUNITY_MESSAGES_EN = {
|
|
|
173
174
|
'onboarding.rulesLede': 'Please read how the discussion works.',
|
|
174
175
|
'onboarding.rulesLink': 'The full rules',
|
|
175
176
|
'onboarding.rulesAccept': 'I agree to the discussion rules.',
|
|
177
|
+
// O-16 / F-51: the one consent of a first join where the tenant has terms (the rules and the terms, each linked).
|
|
178
|
+
'onboarding.rulesTermsAccept': 'I agree to the discussion rules and the terms.',
|
|
179
|
+
'onboarding.termsLink': 'The discussion terms',
|
|
176
180
|
'onboarding.rulesChanged': 'The discussion rules have changed since your last visit. Please read the new version and confirm it.',
|
|
177
181
|
'onboarding.art9Title': 'Consent to processing',
|
|
178
182
|
'onboarding.art9Lede': 'To write in the discussion, we need your consent as described below.',
|
|
@@ -230,7 +234,7 @@ export const COMMUNITY_MESSAGES_EN = {
|
|
|
230
234
|
'panel.art9Refused': 'You declined the consent to the processing.',
|
|
231
235
|
'panel.art9Withdraw': 'Withdraw consent',
|
|
232
236
|
'panel.art9WithdrawTitle': 'Withdraw your consent to the processing?',
|
|
233
|
-
'panel.art9WithdrawExplain': "You can keep reading the discussion.
|
|
237
|
+
'panel.art9WithdrawExplain': "You can keep reading the discussion. The forum posts you wrote under the consent are erased after 7 days — give the consent again before then and they stay. Whether you can write without the consent depends on the website's settings; it tells you before your next comment.",
|
|
234
238
|
'panel.art9WithdrawConfirm': 'Yes, withdraw consent',
|
|
235
239
|
'panel.art9WithdrawCancel': 'Keep the consent',
|
|
236
240
|
'panel.art9Withdrawn': "You've withdrawn your consent.",
|
|
@@ -460,7 +464,7 @@ export const COMMUNITY_MESSAGES_EN = {
|
|
|
460
464
|
'forumText.confirm.other': 'I understand the notice and want to send the post.',
|
|
461
465
|
'forumText.warning.identifier': "The post seems to contain an e-mail address, a phone number or an account number. If it shouldn't be there, edit the post.",
|
|
462
466
|
'forumText.warning.other': 'The post is published, but the discussion rules flag something in it. Please look it over.',
|
|
463
|
-
'forumText.need.onboarding': 'Before your first post, choose a name and confirm the discussion rules.',
|
|
467
|
+
'forumText.need.onboarding': 'Before your first post, choose a name and confirm the discussion rules and terms.',
|
|
464
468
|
'forumText.need.art9_consent': 'To write in the forum, we need your consent to the processing.',
|
|
465
469
|
'search.title': 'Search the forum',
|
|
466
470
|
'search.label': 'What are you looking for?',
|
package/src/community/shapes.ts
CHANGED
|
@@ -432,6 +432,14 @@ export interface MyState {
|
|
|
432
432
|
readonly profile: OwnProfile | null
|
|
433
433
|
readonly acceptances: {
|
|
434
434
|
readonly rules: AcceptanceState
|
|
435
|
+
/**
|
|
436
|
+
* O-16 / F-51 (the owner, 9. 11. 2026: the terms are accepted once, at onboarding, and never asked again): null when
|
|
437
|
+
* the tenant publishes no terms text, `accepted` once the member accepted any terms text (for good — never
|
|
438
|
+
* `reconsent_required`), `never` otherwise. No `need` ever asks for the terms; a first onboarding sends
|
|
439
|
+
* `termsTextId` (viewerNeeds(me).terms). Absent from a kb-api older than O-16 — that kb-api does not take
|
|
440
|
+
* `termsTextId` either (its strict schema refuses the key), so nothing is sent then.
|
|
441
|
+
*/
|
|
442
|
+
readonly terms?: AcceptanceState | null
|
|
435
443
|
readonly art9Consent: AcceptanceState | null
|
|
436
444
|
/**
|
|
437
445
|
* M2 T9 (§3.8): the member refused the art. 9 consent under `art9Refusal = public_write` and has not given it
|
|
@@ -909,6 +917,13 @@ export interface OnboardInput {
|
|
|
909
917
|
ageBand: AgeBand
|
|
910
918
|
/** The current `rules` text's id (`legal/current`). */
|
|
911
919
|
rulesTextId: string
|
|
920
|
+
/**
|
|
921
|
+
* O-16 / F-51: the current `terms` text's id (`legal/current { kind: 'terms' }`) — required on a member's first
|
|
922
|
+
* onboarding while the tenant has a terms text (MyState.acceptances.terms `never`): the key absent, null or another
|
|
923
|
+
* id is VALIDATION on `termsTextId` then. Recorded once and never asked again. Send it only to a kb-api whose me/get
|
|
924
|
+
* answers `acceptances.terms` (viewerNeeds(me).terms): an older one refuses the key.
|
|
925
|
+
*/
|
|
926
|
+
termsTextId?: string | null
|
|
912
927
|
/** The current `art9_consent` text's id, when the tenant asks for the consent. */
|
|
913
928
|
art9TextId?: string | null
|
|
914
929
|
/**
|
package/src/community/store.ts
CHANGED
|
@@ -780,18 +780,30 @@ export interface ViewerNeeds {
|
|
|
780
780
|
readonly rules: boolean
|
|
781
781
|
/** The consent the tenant asks for before writing. */
|
|
782
782
|
readonly art9: boolean
|
|
783
|
+
/**
|
|
784
|
+
* O-16 / F-51 (the owner, 9. 11. 2026: the terms once, never again): the first join also accepts the tenant's terms,
|
|
785
|
+
* so its me/onboard sends `termsTextId` — read from a MyState: a first join (`onboarding`) whose `acceptances.terms`
|
|
786
|
+
* is `never` (the tenant has a terms text, none accepted). Presence of the field is the rollout guard: a kb-api
|
|
787
|
+
* older than O-16 answers no `terms` and refuses the key, so nothing is sent to it. Never true for a member already
|
|
788
|
+
* onboarded (they are never asked) nor from a discussion state (no acceptances there), and not a need of its own:
|
|
789
|
+
* `any` does not count it — it rides on the onboarding.
|
|
790
|
+
*/
|
|
791
|
+
readonly terms: boolean
|
|
783
792
|
/** Any of these. */
|
|
784
793
|
readonly any: boolean
|
|
785
794
|
}
|
|
786
795
|
|
|
787
|
-
export function viewerNeeds(
|
|
796
|
+
export function viewerNeeds(
|
|
797
|
+
state: Pick<DiscussionState, 'viewer'> | { needs: readonly unknown[]; acceptances?: { readonly terms?: unknown } | null },
|
|
798
|
+
): ViewerNeeds {
|
|
788
799
|
const raw = 'viewer' in state ? state.viewer.needs : state.needs
|
|
789
800
|
const needs = new Set(raw.filter(isKnownNeed))
|
|
790
801
|
const signIn = needs.has('sign_in')
|
|
791
802
|
const onboarding = needs.has('onboarding')
|
|
792
803
|
const rules = onboarding || needs.has('reconsent_rules')
|
|
793
804
|
const art9 = needs.has('art9_consent')
|
|
794
|
-
|
|
805
|
+
const terms = onboarding && !('viewer' in state) && state.acceptances?.terms === 'never'
|
|
806
|
+
return Object.freeze({ signIn, onboarding, rules, art9, terms, any: signIn || onboarding || rules || art9 })
|
|
795
807
|
}
|
|
796
808
|
|
|
797
809
|
/** A loaded message (top-level or reply) by its seq, or null. */
|
package/src/core/markdown.ts
CHANGED
|
@@ -52,7 +52,7 @@ function safeUrl(url: string | undefined | null): string {
|
|
|
52
52
|
// Scheme check — allow only the explicit safe list
|
|
53
53
|
const schemeMatch = normalized.match(/^([a-z][a-z0-9+.-]*):/i)
|
|
54
54
|
if (!schemeMatch) return url // schemeless = safe (relative-by-default)
|
|
55
|
-
const scheme = schemeMatch[1]
|
|
55
|
+
const scheme = schemeMatch[1]!.toLowerCase() // group 1 is not optional: it is there whenever the match is
|
|
56
56
|
const ALLOWED_SCHEMES = ['http', 'https', 'mailto', 'tel', 'ftp', 'sms']
|
|
57
57
|
return ALLOWED_SCHEMES.includes(scheme) ? url : 'about:blank'
|
|
58
58
|
}
|
|
@@ -18,11 +18,18 @@
|
|
|
18
18
|
// this package's own build; in a Nuxt app the app's own `#imports` types apply.
|
|
19
19
|
|
|
20
20
|
import { useAsyncData } from '#imports'
|
|
21
|
-
import type { Ref } from 'vue'
|
|
21
|
+
import type { Ref, WatchSource } from 'vue'
|
|
22
22
|
import { useArticleList, useArticle } from '../../vue/composables/useArticles'
|
|
23
23
|
import type { ArticleListParams } from '../../vue/composables/useArticles'
|
|
24
24
|
import { useNavigation } from '../../vue/composables/useNavigation'
|
|
25
25
|
|
|
26
|
+
/**
|
|
27
|
+
* What `useAsyncData`'s `watch` takes (Vue's `MultiWatchSources`, spelled out because Vue exports that
|
|
28
|
+
* name only from 3.5): refs, getters and reactive objects. The adapters used to type it `unknown[]`,
|
|
29
|
+
* which Nuxt's own `useAsyncData` types refuse (a Nuxt app's typecheck failed in all three).
|
|
30
|
+
*/
|
|
31
|
+
export type AsyncWatchDeps = (WatchSource<unknown> | object)[]
|
|
32
|
+
|
|
26
33
|
/**
|
|
27
34
|
* SSR-hydrated article list.
|
|
28
35
|
*
|
|
@@ -31,7 +38,7 @@ import { useNavigation } from '../../vue/composables/useNavigation'
|
|
|
31
38
|
export async function useAsyncArticleList(
|
|
32
39
|
key: string,
|
|
33
40
|
params?: ArticleListParams,
|
|
34
|
-
watchDeps?:
|
|
41
|
+
watchDeps?: AsyncWatchDeps,
|
|
35
42
|
) {
|
|
36
43
|
const composable = useArticleList(params)
|
|
37
44
|
|
|
@@ -65,7 +72,7 @@ export async function useAsyncArticle(
|
|
|
65
72
|
key: string,
|
|
66
73
|
filename: Ref<string> | string,
|
|
67
74
|
languageCode: Ref<string> | string,
|
|
68
|
-
watchDeps?:
|
|
75
|
+
watchDeps?: AsyncWatchDeps,
|
|
69
76
|
) {
|
|
70
77
|
const composable = useArticle()
|
|
71
78
|
|
|
@@ -96,7 +103,7 @@ export async function useAsyncArticle(
|
|
|
96
103
|
export async function useAsyncNavigation(
|
|
97
104
|
key: string,
|
|
98
105
|
params?: { scope?: string; locale?: string },
|
|
99
|
-
watchDeps?:
|
|
106
|
+
watchDeps?: AsyncWatchDeps,
|
|
100
107
|
) {
|
|
101
108
|
const composable = useNavigation()
|
|
102
109
|
|
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
* only), and the app's own `.nuxt/imports.d.ts` types the alias there.
|
|
6
6
|
*/
|
|
7
7
|
declare module '#imports' {
|
|
8
|
-
import type { Ref } from 'vue'
|
|
8
|
+
import type { Ref, WatchSource } from 'vue'
|
|
9
9
|
export function useAsyncData<T>(
|
|
10
10
|
key: string,
|
|
11
11
|
handler: () => Promise<T>,
|
|
12
|
-
opts?: { watch?: unknown[] },
|
|
12
|
+
opts?: { watch?: (WatchSource<unknown> | object)[] },
|
|
13
13
|
): Promise<{ data: Ref<T | null>; pending: Ref<boolean>; error: Ref<Error | null> }>
|
|
14
14
|
}
|