@blogmcp/community 0.4.0 → 0.5.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/blogmcp-community-private.global.js +4 -0
- package/dist/blogmcp-community.global.js +3 -3
- package/dist/chunks/{mount-Ts_r2fwt.js → mount-SKmc4NgD.js} +39 -9
- package/dist/chunks/private-mount-bhCQeScD.js +5397 -0
- package/dist/core/attrs.d.ts +15 -0
- package/dist/core/settings.d.ts +5 -0
- package/dist/index.js +2 -2
- package/dist/private/core/dock.d.ts +38 -0
- package/dist/private/core/push.d.ts +49 -0
- package/dist/private/core/realtime.d.ts +57 -0
- package/dist/private/core/setup.d.ts +43 -0
- package/dist/private/core/view.d.ts +179 -0
- package/dist/private/dm/composer.d.ts +34 -0
- package/dist/private/dm/controller.d.ts +162 -0
- package/dist/private/dm/index.d.ts +14 -0
- package/dist/private/dm/links.d.ts +33 -0
- package/dist/private/dm/muted.d.ts +37 -0
- package/dist/private/dm/search.d.ts +7 -0
- package/dist/private/dm/text.d.ts +27 -0
- package/dist/private/dm/ui/DmBlocks.vue.d.ts +8 -0
- package/dist/private/dm/ui/DmCases.vue.d.ts +8 -0
- package/dist/private/dm/ui/DmComposer.vue.d.ts +20 -0
- package/dist/private/dm/ui/DmInbox.vue.d.ts +12 -0
- package/dist/private/dm/ui/DmLinkWarning.vue.d.ts +8 -0
- package/dist/private/dm/ui/DmLocalAids.vue.d.ts +8 -0
- package/dist/private/dm/ui/DmMessageText.vue.d.ts +8 -0
- package/dist/private/dm/ui/DmNew.vue.d.ts +12 -0
- package/dist/private/dm/ui/DmReport.vue.d.ts +8 -0
- package/dist/private/dm/ui/DmRequests.vue.d.ts +12 -0
- package/dist/private/dm/ui/DmScreens.vue.d.ts +9 -0
- package/dist/private/dm/ui/DmThread.vue.d.ts +9 -0
- package/dist/private/element.d.ts +23 -0
- package/dist/private/global.d.ts +10 -0
- package/dist/private/i18n.d.ts +41 -0
- package/dist/private/index.d.ts +32 -0
- package/dist/private/index.js +57 -0
- package/dist/private/mount.d.ts +55 -0
- package/dist/private/pages/api.d.ts +44 -0
- package/dist/private/pages/element.d.ts +6 -0
- package/dist/private/pages/fragment.d.ts +43 -0
- package/dist/private/pages/i18n.d.ts +25 -0
- package/dist/private/pages/index.d.ts +1 -0
- package/dist/private/pages/pages.d.ts +276 -0
- package/dist/private/pages/proof.d.ts +36 -0
- package/dist/private/pages/provider-view.d.ts +33 -0
- package/dist/private/pages/setup.d.ts +42 -0
- package/dist/private/pages/ui/AccountPageRoot.vue.d.ts +9 -0
- package/dist/private/pages/ui/PageActivation.vue.d.ts +9 -0
- package/dist/private/pages/ui/PageAddress.vue.d.ts +8 -0
- package/dist/private/pages/ui/PageDeviceApprove.vue.d.ts +8 -0
- package/dist/private/pages/ui/PageDevices.vue.d.ts +8 -0
- package/dist/private/pages/ui/PageExport.vue.d.ts +8 -0
- package/dist/private/pages/ui/PageMessages.vue.d.ts +9 -0
- package/dist/private/react.d.ts +12 -0
- package/dist/private/react.js +36 -0
- package/dist/private/ui/ChatDockRoot.vue.d.ts +20 -0
- package/dist/private/ui/LegalText.vue.d.ts +13 -0
- package/dist/private/ui/PrivateScreens.vue.d.ts +14 -0
- package/dist/private/ui/PrivateViewRoot.vue.d.ts +23 -0
- package/dist/private/ui/PromiseBlock.vue.d.ts +9 -0
- package/dist/private/ui/ProviderLine.vue.d.ts +8 -0
- package/dist/private/ui/ScreenActivation.vue.d.ts +8 -0
- package/dist/private/ui/ScreenAddress.vue.d.ts +8 -0
- package/dist/private/ui/ScreenApproval.vue.d.ts +8 -0
- package/dist/private/ui/ScreenDevices.vue.d.ts +8 -0
- package/dist/private/ui/ScreenHome.vue.d.ts +12 -0
- package/dist/private/ui/ScreenNotifications.vue.d.ts +8 -0
- package/dist/private/ui/ScreenReads.vue.d.ts +8 -0
- package/dist/private/ui/ScreenSettings.vue.d.ts +8 -0
- package/dist/private/ui/root.d.ts +35 -0
- package/dist/private/ui/text.d.ts +22 -0
- package/dist/private/vue.d.ts +88 -0
- package/dist/private/vue.js +72 -0
- package/dist/react.js +14 -14
- package/dist/vue.js +14 -14
- package/package.json +23 -6
- package/src/core/attrs.ts +19 -0
- package/src/core/settings.ts +55 -12
- package/src/private/core/dock.ts +105 -0
- package/src/private/core/push.ts +166 -0
- package/src/private/core/realtime.ts +109 -0
- package/src/private/core/setup.ts +75 -0
- package/src/private/core/view.ts +920 -0
- package/src/private/dm/composer.ts +74 -0
- package/src/private/dm/controller.ts +636 -0
- package/src/private/dm/index.ts +14 -0
- package/src/private/dm/links.ts +55 -0
- package/src/private/dm/muted.ts +160 -0
- package/src/private/dm/search.ts +18 -0
- package/src/private/dm/text.ts +60 -0
- package/src/private/dm/ui/DmBlocks.vue +27 -0
- package/src/private/dm/ui/DmCases.vue +58 -0
- package/src/private/dm/ui/DmComposer.vue +68 -0
- package/src/private/dm/ui/DmInbox.vue +34 -0
- package/src/private/dm/ui/DmLinkWarning.vue +27 -0
- package/src/private/dm/ui/DmLocalAids.vue +43 -0
- package/src/private/dm/ui/DmMessageText.vue +16 -0
- package/src/private/dm/ui/DmNew.vue +46 -0
- package/src/private/dm/ui/DmReport.vue +93 -0
- package/src/private/dm/ui/DmRequests.vue +50 -0
- package/src/private/dm/ui/DmScreens.vue +66 -0
- package/src/private/dm/ui/DmThread.vue +235 -0
- package/src/private/element.ts +90 -0
- package/src/private/global.ts +14 -0
- package/src/private/i18n.ts +127 -0
- package/src/private/index.ts +68 -0
- package/src/private/messages/cs.json +311 -0
- package/src/private/messages/en.json +319 -0
- package/src/private/mount.ts +103 -0
- package/src/private/pages/api.ts +96 -0
- package/src/private/pages/build.d.mts +2 -0
- package/src/private/pages/build.mjs +72 -0
- package/src/private/pages/element.ts +49 -0
- package/src/private/pages/fragment.ts +63 -0
- package/src/private/pages/i18n.ts +82 -0
- package/src/private/pages/index.ts +10 -0
- package/src/private/pages/messages/cs.json +97 -0
- package/src/private/pages/messages/en.json +97 -0
- package/src/private/pages/pages.ts +410 -0
- package/src/private/pages/proof.ts +110 -0
- package/src/private/pages/provider-view.ts +121 -0
- package/src/private/pages/setup.ts +79 -0
- package/src/private/pages/ui/AccountPageRoot.vue +45 -0
- package/src/private/pages/ui/PageActivation.vue +42 -0
- package/src/private/pages/ui/PageAddress.vue +39 -0
- package/src/private/pages/ui/PageDeviceApprove.vue +62 -0
- package/src/private/pages/ui/PageDevices.vue +84 -0
- package/src/private/pages/ui/PageExport.vue +35 -0
- package/src/private/pages/ui/PageMessages.vue +39 -0
- package/src/private/pages/ui/account.css +6 -0
- package/src/private/react.ts +49 -0
- package/src/private/shims.d.ts +6 -0
- package/src/private/ui/ChatDockRoot.vue +119 -0
- package/src/private/ui/LegalText.vue +18 -0
- package/src/private/ui/PrivateScreens.vue +61 -0
- package/src/private/ui/PrivateViewRoot.vue +70 -0
- package/src/private/ui/PromiseBlock.vue +18 -0
- package/src/private/ui/ProviderLine.vue +20 -0
- package/src/private/ui/ScreenActivation.vue +82 -0
- package/src/private/ui/ScreenAddress.vue +37 -0
- package/src/private/ui/ScreenApproval.vue +71 -0
- package/src/private/ui/ScreenDevices.vue +42 -0
- package/src/private/ui/ScreenHome.vue +29 -0
- package/src/private/ui/ScreenNotifications.vue +44 -0
- package/src/private/ui/ScreenReads.vue +23 -0
- package/src/private/ui/ScreenSettings.vue +44 -0
- package/src/private/ui/private.css +81 -0
- package/src/private/ui/root.ts +89 -0
- package/src/private/ui/text.ts +40 -0
- package/src/private/vue.ts +87 -0
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What the composer says, and what a message still allows (m4-contracts.md §7.8 DM8b, §3.5, invariant 12).
|
|
3
|
+
*
|
|
4
|
+
* **The composer sentence** is read from the capability matrix (`privatePromise`'s `receivers` and `keys`, PU1), never
|
|
5
|
+
* worded on its own, and it says no more than the promise does: one short line under the text box per party that
|
|
6
|
+
* receives what the member is about to write — the other participant; the website's code, which puts it on the screen
|
|
7
|
+
* under tenant rendering (and, where the website and blogmcp are the same legal person, `same_entity`, the line that
|
|
8
|
+
* says this person writes that code and is barred by the law, not by a contract it would sign with itself); whoever
|
|
9
|
+
* handles a report, with the at most 10 preceding messages the matrix gives them; the court or police order, which is in
|
|
10
|
+
* every row, so the list never reads as complete without it; the delegated addendum where the website can sign in as the
|
|
11
|
+
* member (under both renderings); and that the messages are not end-to-end encrypted. test/private/dm/composer.spec.ts
|
|
12
|
+
* checks every space × identity × rendering × same-entity × host combination against the promise's own keys, and the
|
|
13
|
+
* tone test covers its words with the rest of the conversations' catalogue.
|
|
14
|
+
*
|
|
15
|
+
* **The windows.** An edit is taken within `private_edit_window_minutes` of the message (15) and a delete for everyone
|
|
16
|
+
* within `private_delete_for_all_hours` (48) — platform settings the browser is not told. The affordances follow those
|
|
17
|
+
* defaults; kb-api's `EDIT_WINDOW` / `DELETE_WINDOW` stays the authority, and the thread then offers „Smazat u mě“
|
|
18
|
+
* (hide), which has no window.
|
|
19
|
+
*/
|
|
20
|
+
import type { PrivateDmMessage, PrivatePromise } from '@blogmcp/sdk/community/private'
|
|
21
|
+
|
|
22
|
+
export const DM_COMPOSER_KEYS = Object.freeze([
|
|
23
|
+
'private.dm.composer.participants',
|
|
24
|
+
'private.dm.composer.display',
|
|
25
|
+
'private.dm.composer.sameEntity',
|
|
26
|
+
'private.dm.composer.reports',
|
|
27
|
+
'private.dm.composer.orders',
|
|
28
|
+
'private.dm.composer.delegated',
|
|
29
|
+
'private.dm.composer.notE2e',
|
|
30
|
+
] as const)
|
|
31
|
+
export type DmComposerKey = (typeof DM_COMPOSER_KEYS)[number]
|
|
32
|
+
|
|
33
|
+
/** The composer sentence's keys for this member, in the order they are shown (see the module doc). */
|
|
34
|
+
export function composerKeys(promise: Pick<PrivatePromise, 'receivers' | 'keys' | 'delegated'> | null): DmComposerKey[] {
|
|
35
|
+
if (!promise) return []
|
|
36
|
+
const r = promise.receivers
|
|
37
|
+
const said = new Set<string>(promise.keys)
|
|
38
|
+
const keys: DmComposerKey[] = []
|
|
39
|
+
if (r.participants === 'content') keys.push('private.dm.composer.participants')
|
|
40
|
+
if (r.websiteCode === 'content_for_display') {
|
|
41
|
+
// Under same_entity the promise drops its contract sentence for the one that names the operator: so does this line.
|
|
42
|
+
keys.push(said.has('private.promise.same_entity') ? 'private.dm.composer.sameEntity' : 'private.dm.composer.display')
|
|
43
|
+
}
|
|
44
|
+
if (r.authorisedPersons === 'reported_content' || r.trustAndSafety === 'reported_content') keys.push('private.dm.composer.reports')
|
|
45
|
+
if (said.has('private.promise.orders')) keys.push('private.dm.composer.orders')
|
|
46
|
+
if (promise.delegated) keys.push('private.dm.composer.delegated')
|
|
47
|
+
if (said.has('private.promise.not_e2e')) keys.push('private.dm.composer.notE2e')
|
|
48
|
+
return keys
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/** `private_edit_window_minutes`' default (§5.11's settings). */
|
|
52
|
+
export const DM_EDIT_WINDOW_MS = 15 * 60_000
|
|
53
|
+
/** `private_delete_for_all_hours`' default. */
|
|
54
|
+
export const DM_DELETE_FOR_ALL_MS = 48 * 3_600_000
|
|
55
|
+
|
|
56
|
+
const age = (m: Pick<PrivateDmMessage, 'createdAt'>, now: number): number => {
|
|
57
|
+
const t = Date.parse(m.createdAt)
|
|
58
|
+
return Number.isNaN(t) ? Number.POSITIVE_INFINITY : now - t
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/** The member's own visible message, still within the edit window. */
|
|
62
|
+
export function canEdit(m: PrivateDmMessage, now = Date.now()): boolean {
|
|
63
|
+
return m.mine && m.state === 'visible' && age(m, now) < DM_EDIT_WINDOW_MS
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/** The member's own visible message, still within the window of a delete for everyone. */
|
|
67
|
+
export function canDeleteForAll(m: PrivateDmMessage, now = Date.now()): boolean {
|
|
68
|
+
return m.mine && m.state === 'visible' && age(m, now) < DM_DELETE_FOR_ALL_MS
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/** A message the member can report: the other participant's, with its text (a tombstone or a removed one has none). */
|
|
72
|
+
export function canReport(m: PrivateDmMessage): boolean {
|
|
73
|
+
return !m.mine && m.state === 'visible'
|
|
74
|
+
}
|