@viceme-ai/sdk 0.6.2 → 0.7.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 +18 -6
- package/dist/capability-mount.d.ts +2 -0
- package/dist/capability-mount.d.ts.map +1 -1
- package/dist/chunks/{client-DEg6YouY.js → client-C1Sw400H.js} +386 -300
- package/dist/chunks/client-C1Sw400H.js.map +1 -0
- package/dist/chunks/integration-CTsnJ8mN.js +38 -0
- package/dist/chunks/integration-CTsnJ8mN.js.map +1 -0
- package/dist/chunks/version-CAPPYmfK.js +6 -0
- package/dist/chunks/{version-BJiUVcir.js.map → version-CAPPYmfK.js.map} +1 -1
- package/dist/core/capabilities.d.ts.map +1 -1
- package/dist/core/presentation.d.ts +5 -0
- package/dist/core/presentation.d.ts.map +1 -1
- package/dist/danmaku/mount.d.ts.map +1 -1
- package/dist/danmaku.js +117 -91
- package/dist/danmaku.js.map +1 -1
- package/dist/engagement/integration.d.ts +15 -0
- package/dist/engagement/integration.d.ts.map +1 -0
- package/dist/generated/public-contract.d.ts +15 -1
- package/dist/generated/public-contract.d.ts.map +1 -1
- package/dist/index.js +7 -6
- package/dist/index.js.map +1 -1
- package/dist/loader/auto-loader.d.ts.map +1 -1
- package/dist/manifest.json +36 -27
- package/dist/session/session.d.ts +12 -0
- package/dist/session/session.d.ts.map +1 -1
- package/dist/testing.js +1 -1
- package/dist/tip/index.d.ts +2 -0
- package/dist/tip/index.d.ts.map +1 -1
- package/dist/tip/mount.d.ts.map +1 -1
- package/dist/tip.js +211 -194
- package/dist/tip.js.map +1 -1
- package/dist/transport/transport.d.ts.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/viceme.min.js +46 -4
- package/dist/viceme.min.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunks/client-DEg6YouY.js.map +0 -1
- package/dist/chunks/version-BJiUVcir.js +0 -6
package/README.md
CHANGED
|
@@ -58,7 +58,7 @@ if (!target) throw new Error('ViceMe target missing');
|
|
|
58
58
|
|
|
59
59
|
const results = await Promise.allSettled([
|
|
60
60
|
mountDanmaku(client, { target, theme: 'auto' }),
|
|
61
|
-
mountTip(client, { target, theme: 'auto' }),
|
|
61
|
+
mountTip(client, { target, theme: 'auto', presentation: 'integrated' }),
|
|
62
62
|
]);
|
|
63
63
|
const mounted = results.flatMap((result) => (result.status === 'fulfilled' ? [result.value] : []));
|
|
64
64
|
|
|
@@ -68,6 +68,9 @@ client.destroy();
|
|
|
68
68
|
|
|
69
69
|
Run those cleanup calls from the owning component's unmount path or another
|
|
70
70
|
explicit lifecycle boundary, not from `pagehide` (which also covers bfcache).
|
|
71
|
+
The integrated presentation uses the danmaku bar as its only visible launcher
|
|
72
|
+
and opens the official Tip dialog. Standalone `mountTip()` remains inline by
|
|
73
|
+
default.
|
|
71
74
|
|
|
72
75
|
`createViceMe` and `ready()` are purely local and never contact Shop. A live client reports
|
|
73
76
|
build support for `danmaku` and `tip`; Shop remains authoritative for whether a
|
|
@@ -89,6 +92,11 @@ deterministic transport and presenter through `@viceme-ai/sdk/testing`.
|
|
|
89
92
|
Calling `client.destroy()` cancels in-flight access requests, closes the active
|
|
90
93
|
SDK-owned sign-in or checkout layer, and rejects the interrupted call with
|
|
91
94
|
`CLIENT_DESTROYED`; late responses cannot restore the in-memory Work token.
|
|
95
|
+
Request cancellation and timeouts remain effective until the parsed response is
|
|
96
|
+
delivered. Cancelling the client's optional `signal` preserves the caller's
|
|
97
|
+
`Error` reason; a request timeout rejects with retryable `NETWORK_TIMEOUT`.
|
|
98
|
+
A cancelled response cannot establish a Work session even if its body has
|
|
99
|
+
already finished parsing.
|
|
92
100
|
|
|
93
101
|
The current Website Access release accepts any valid HTTP(S) host Origin and
|
|
94
102
|
does not require DNS TXT verification. Session tokens remain bound to the
|
|
@@ -101,7 +109,9 @@ Website access login renders the work-bound WeChat QR code directly in the SDK
|
|
|
101
109
|
layer. Paid access keeps desktop QR payment and WeChat JSAPI in that layer;
|
|
102
110
|
mobile H5/WAP payment may open a provider page or app. The original page polls
|
|
103
111
|
the server-authoritative access decision and closes the layer after entitlement
|
|
104
|
-
is active.
|
|
112
|
+
is active. Before login, the consent layer shows only the creator avatar,
|
|
113
|
+
display name, published Work count, and the current Work title, summary, and
|
|
114
|
+
cover. This behavior does not change the separate Tip Widget flow.
|
|
105
115
|
|
|
106
116
|
```ts
|
|
107
117
|
const decisions = await client.access.checkMany(['members', 'pro-tools']);
|
|
@@ -120,10 +130,12 @@ scroll bucket, and sends only the opaque anchor to the hosted iframe. Destroying
|
|
|
120
130
|
the mount removes its nodes, listeners, debounce timer, and location poll.
|
|
121
131
|
|
|
122
132
|
The Tip mount sends no amount, provider, token, or application ID. It enables
|
|
123
|
-
interaction only after a trusted resize handshake.
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
133
|
+
interaction only after a trusted resize handshake. In integrated mode it also
|
|
134
|
+
accepts open requests only from the matching trusted danmaku controls, then
|
|
135
|
+
restores focus there after close. Shop resets its hosted payment surface on
|
|
136
|
+
Escape before sending close; the SDK forwards sanitized close and paid
|
|
137
|
+
notifications, and removes its iframe, timer, media listener, and message
|
|
138
|
+
listener on destroy.
|
|
127
139
|
|
|
128
140
|
## Headless Tip
|
|
129
141
|
|
|
@@ -3,6 +3,8 @@ export interface CapabilityMountOptions {
|
|
|
3
3
|
/** Mount host element; the capability owns its Shadow DOM subtree. */
|
|
4
4
|
target: Element;
|
|
5
5
|
theme: 'light' | 'dark' | 'auto';
|
|
6
|
+
/** Use the shared danmaku controls as the visible Tip launcher. */
|
|
7
|
+
presentation?: 'inline' | 'integrated';
|
|
6
8
|
/** Abort a mount that has not completed and destroy it after completion. */
|
|
7
9
|
signal?: AbortSignal;
|
|
8
10
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"capability-mount.d.ts","sourceRoot":"","sources":["../src/capability-mount.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAErD,MAAM,WAAW,sBAAsB;IACrC,sEAAsE;IACtE,MAAM,EAAE,OAAO,CAAC;IAChB,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC;IACjC,4EAA4E;IAC5E,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB;AAED,+EAA+E;AAC/E,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,OAAO,IAAI,IAAI,CAAC;CACjB;AAED,MAAM,MAAM,uBAAuB,GAAG,CACpC,MAAM,EAAE,YAAY,EACpB,OAAO,EAAE,sBAAsB,KAC5B,OAAO,CAAC,qBAAqB,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"capability-mount.d.ts","sourceRoot":"","sources":["../src/capability-mount.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAErD,MAAM,WAAW,sBAAsB;IACrC,sEAAsE;IACtE,MAAM,EAAE,OAAO,CAAC;IAChB,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC;IACjC,mEAAmE;IACnE,YAAY,CAAC,EAAE,QAAQ,GAAG,YAAY,CAAC;IACvC,4EAA4E;IAC5E,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB;AAED,+EAA+E;AAC/E,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,OAAO,IAAI,IAAI,CAAC;CACjB;AAED,MAAM,MAAM,uBAAuB,GAAG,CACpC,MAAM,EAAE,YAAY,EACpB,OAAO,EAAE,sBAAsB,KAC5B,OAAO,CAAC,qBAAqB,CAAC,CAAC"}
|