@diffenderfer-games/hub 2.0.0-next.0 → 2.0.0-next.10
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/CHANGELOG.md +163 -0
- package/LICENSE +21 -21
- package/README.md +203 -139
- package/dist/auto.d.ts +8 -8
- package/dist/auto.js +3 -3
- package/dist/avatar-pixi.d.ts +165 -0
- package/dist/avatar-pixi.d.ts.map +1 -0
- package/dist/avatar-pixi.js +299 -0
- package/dist/avatar-pixi.js.map +1 -0
- package/dist/avatar-svg.d.ts +4 -0
- package/dist/avatar-svg.js +5 -0
- package/dist/avatar-three.d.ts +69 -0
- package/dist/avatar-three.d.ts.map +1 -0
- package/dist/avatar-three.js +49 -0
- package/dist/avatar-three.js.map +1 -0
- package/dist/avatar.d.ts +7 -0
- package/dist/avatar.js +500 -0
- package/dist/avatar.js.map +1 -0
- package/dist/daily.d.ts +2 -2
- package/dist/doctor/cli.mjs +119 -28
- package/dist/doctor/cli.mjs.map +1 -1
- package/dist/index.d.ts +8 -8
- package/dist/index.js +3 -3
- package/dist/input.d.ts +2 -2
- package/dist/input.js +2 -2
- package/dist/mp.d.ts +3 -3
- package/dist/race.d.ts +1 -1
- package/dist/rooms.d.ts +3 -3
- package/dist/rooms.js +1 -1
- package/dist/shared/animator.d.ts +104 -0
- package/dist/shared/animator.d.ts.map +1 -0
- package/dist/shared/art.js +1946 -0
- package/dist/shared/art.js.map +1 -0
- package/dist/shared/atlas.d.ts +138 -0
- package/dist/shared/atlas.d.ts.map +1 -0
- package/dist/shared/avatar.d.ts +123 -0
- package/dist/shared/avatar.d.ts.map +1 -0
- package/dist/shared/bridge.js +18 -4
- package/dist/shared/bridge.js.map +1 -1
- package/dist/shared/client-version.gen.js +1 -1
- package/dist/shared/daily.d.ts +145 -19
- package/dist/shared/daily.d.ts.map +1 -1
- package/dist/shared/daily.js +138 -25
- package/dist/shared/daily.js.map +1 -1
- package/dist/shared/defineProperty.js +39 -0
- package/dist/shared/describe.d.ts +32 -0
- package/dist/shared/describe.d.ts.map +1 -0
- package/dist/shared/describe.js +109 -0
- package/dist/shared/describe.js.map +1 -0
- package/dist/shared/globals.js +9 -42
- package/dist/shared/globals.js.map +1 -1
- package/dist/shared/index.d.ts +1122 -46
- package/dist/shared/index.d.ts.map +1 -1
- package/dist/shared/input.d.ts +74 -14
- package/dist/shared/input.d.ts.map +1 -1
- package/dist/shared/input.js +179 -25
- package/dist/shared/input.js.map +1 -1
- package/dist/shared/json-guards.js +48 -0
- package/dist/shared/json-guards.js.map +1 -0
- package/dist/shared/latest-state.js +1 -1
- package/dist/shared/live-canvas.js +62 -0
- package/dist/shared/live-canvas.js.map +1 -0
- package/dist/shared/mp.js +10 -2
- package/dist/shared/mp.js.map +1 -1
- package/dist/shared/multiplayer-types.d.ts +15 -2
- package/dist/shared/multiplayer-types.d.ts.map +1 -1
- package/dist/shared/overlays.js +800 -0
- package/dist/shared/overlays.js.map +1 -0
- package/dist/shared/page-stack.js +2 -1
- package/dist/shared/page-stack.js.map +1 -1
- package/dist/shared/pose-key.js +249 -0
- package/dist/shared/pose-key.js.map +1 -0
- package/dist/shared/race-types.d.ts +1 -1
- package/dist/shared/race.js +1 -1
- package/dist/shared/room-types.d.ts +28 -3
- package/dist/shared/room-types.d.ts.map +1 -1
- package/dist/shared/rooms.d.ts.map +1 -1
- package/dist/shared/rooms.js +23 -4
- package/dist/shared/rooms.js.map +1 -1
- package/dist/shared/runtime-opener.js +1 -1
- package/dist/shared/scene.d.ts +90 -0
- package/dist/shared/scene.d.ts.map +1 -0
- package/dist/shared/social.d.ts +90 -9
- package/dist/shared/social.d.ts.map +1 -1
- package/dist/shared/social.js +6 -1
- package/dist/shared/social.js.map +1 -1
- package/dist/shared/src.js +4563 -667
- package/dist/shared/src.js.map +1 -1
- package/dist/shared/svg-markup.js +2354 -0
- package/dist/shared/svg-markup.js.map +1 -0
- package/dist/shared/svg.js +27 -0
- package/dist/shared/svg.js.map +1 -0
- package/dist/shared/types.d.ts +174 -0
- package/dist/shared/types.d.ts.map +1 -0
- package/dist/shared/wire-types.d.ts +6 -2
- package/dist/shared/wire-types.d.ts.map +1 -1
- package/dist/social.d.ts +5 -5
- package/dist/social.js +2 -2
- package/dist/turns-rules.d.ts +2 -0
- package/dist/turns-rules.js +1 -0
- package/dist/turns.d.ts +61 -0
- package/dist/turns.d.ts.map +1 -0
- package/dist/turns.js +183 -0
- package/dist/turns.js.map +1 -0
- package/package.json +125 -89
- package/src/auto.ts +39 -39
- package/src/avatar/adapters/pixi-avatar.ts +73 -0
- package/src/avatar/adapters/pixi-crowd.ts +329 -0
- package/src/avatar/adapters/pixi-types.ts +84 -0
- package/src/avatar/adapters/three.ts +126 -0
- package/src/avatar/animator/animator.ts +285 -0
- package/src/avatar/animator/reactions.ts +44 -0
- package/src/avatar/animator/schedule.ts +73 -0
- package/src/avatar/art/beard.ts +49 -0
- package/src/avatar/art/glasses.ts +67 -0
- package/src/avatar/art/hair.ts +254 -0
- package/src/avatar/art/headwear.ts +75 -0
- package/src/avatar/art/index.ts +21 -0
- package/src/avatar/art/shape.ts +87 -0
- package/src/avatar/art-store.ts +36 -0
- package/src/avatar/atlas.ts +246 -0
- package/src/avatar/catalog-view.ts +14 -0
- package/src/avatar/colour.ts +109 -0
- package/src/avatar/describe.ts +79 -0
- package/src/avatar/face.ts +187 -0
- package/src/avatar/geom.ts +173 -0
- package/src/avatar/layout.ts +47 -0
- package/src/avatar/look-like.ts +52 -0
- package/src/avatar/outputs/bitmap.ts +75 -0
- package/src/avatar/outputs/canvas-paint.ts +177 -0
- package/src/avatar/outputs/canvas.ts +62 -0
- package/src/avatar/outputs/custom-element.ts +140 -0
- package/src/avatar/outputs/element.ts +58 -0
- package/src/avatar/outputs/live-canvas.ts +57 -0
- package/src/avatar/outputs/overlay-svg.ts +22 -0
- package/src/avatar/outputs/pose-key.ts +30 -0
- package/src/avatar/outputs/svg-markup.ts +113 -0
- package/src/avatar/outputs/svg.ts +41 -0
- package/src/avatar/overlays.ts +128 -0
- package/src/avatar/render/body.ts +116 -0
- package/src/avatar/render/colours.ts +81 -0
- package/src/avatar/render/compose.ts +320 -0
- package/src/avatar/render/context.ts +117 -0
- package/src/avatar/render/eyes.ts +78 -0
- package/src/avatar/render/eyewear.ts +118 -0
- package/src/avatar/render/frame.ts +73 -0
- package/src/avatar/render/head.ts +81 -0
- package/src/avatar/render/mouth.ts +86 -0
- package/src/avatar/render/props.ts +91 -0
- package/src/avatar/render/types.ts +93 -0
- package/src/avatar/render/walker-parts.ts +121 -0
- package/src/avatar/render/walker.ts +199 -0
- package/src/avatar/scene.ts +119 -0
- package/src/avatar-pixi.ts +20 -0
- package/src/avatar-svg.ts +21 -0
- package/src/avatar-three.ts +18 -0
- package/src/avatar.ts +63 -0
- package/src/core/avatar/avatar-cache.ts +95 -0
- package/src/core/avatar/avatar-ref.ts +34 -0
- package/src/core/avatar/avatar-types.ts +43 -0
- package/src/core/avatar/hub-avatar.ts +308 -0
- package/src/core/connection.ts +408 -299
- package/src/core/errors.ts +160 -147
- package/src/core/game-data.ts +40 -38
- package/src/core/hub-economy.ts +216 -179
- package/src/core/hub-progress.ts +269 -205
- package/src/core/hub.ts +352 -131
- package/src/core/menu-control.ts +61 -61
- package/src/core/offline/cloud-saves.ts +62 -0
- package/src/core/offline/events.ts +50 -50
- package/src/core/offline/favorites.ts +21 -21
- package/src/core/offline/hub-kinds/avatar-kind.ts +42 -0
- package/src/core/offline/hub-kinds/daily-kind.ts +68 -0
- package/src/core/offline/hub-kinds/economy-kinds.ts +86 -0
- package/src/core/offline/hub-kinds/game-fields.ts +2 -0
- package/src/core/offline/hub-kinds/index.ts +52 -0
- package/src/core/offline/hub-kinds/legacy-ops.ts +37 -0
- package/src/core/offline/hub-kinds/progress-kinds.ts +165 -0
- package/src/core/offline/hub-kinds/resume-kind.ts +108 -0
- package/src/core/offline/hub-kinds/saved-kind.ts +93 -0
- package/src/core/offline/kind-adapters.ts +48 -0
- package/src/core/offline/local-inventory.ts +64 -0
- package/src/core/offline/local-store.ts +304 -261
- package/src/core/offline/offline-api.ts +65 -0
- package/src/core/offline/outbox-entry.ts +59 -0
- package/src/core/offline/outbox-kinds.ts +78 -0
- package/src/core/offline/outbox-merge.ts +39 -0
- package/src/core/offline/outbox-replayer.ts +141 -0
- package/src/core/offline/outbox-store.ts +85 -0
- package/src/core/offline/outbox.ts +232 -0
- package/src/core/offline/queue.ts +126 -171
- package/src/core/offline/replay-lease.ts +87 -0
- package/src/core/offline/replay-policy.ts +52 -0
- package/src/core/page-account.ts +121 -0
- package/src/core/page.ts +87 -74
- package/src/core/rest/endpoint-types.ts +22 -22
- package/src/core/rest/rest-client.ts +163 -152
- package/src/core/rest/routes.gen.ts +144 -88
- package/src/core/resume/hub-resume.ts +286 -0
- package/src/core/resume/local-resume.ts +130 -0
- package/src/core/resume/resume-list.ts +65 -0
- package/src/core/resume/resume-request.ts +52 -0
- package/src/core/resume/resume-types.ts +64 -0
- package/src/core/saved/daily-saves.ts +196 -0
- package/src/core/saved/daily-seed.ts +16 -0
- package/src/core/saved/hub-saved.ts +221 -0
- package/src/core/saved/local-saved.ts +122 -0
- package/src/core/saved/saved-list.ts +129 -0
- package/src/core/saved/saved-open.ts +104 -0
- package/src/core/saved/saved-order.ts +49 -0
- package/src/core/saved/saved-types.ts +24 -0
- package/src/core/storage/json-guards.ts +80 -74
- package/src/core/storage/key-value.ts +66 -66
- package/src/core/ticket.ts +43 -43
- package/src/core/turns/hub-turns.ts +161 -0
- package/src/core/turns/turn-game.ts +510 -0
- package/src/core/turns/your-turn-buzz.ts +69 -0
- package/src/core/types.ts +134 -134
- package/src/core/version/client-version.gen.ts +2 -2
- package/src/core/version/hub-version.ts +62 -62
- package/src/core/version/semver.ts +97 -97
- package/src/daily/daily-system.ts +276 -161
- package/src/daily/page-daily.ts +36 -36
- package/src/daily/types.ts +105 -67
- package/src/daily.ts +10 -10
- package/src/doctor/checks.ts +86 -76
- package/src/doctor/cli.ts +101 -106
- package/src/doctor/hub-version-fetch.ts +43 -0
- package/src/doctor/tsconfig.json +12 -12
- package/src/doctor/world-check.ts +61 -0
- package/src/globals.ts +115 -110
- package/src/index.ts +68 -50
- package/src/input/device-state.ts +146 -146
- package/src/input/edges.ts +55 -55
- package/src/input/focus-ring.ts +13 -0
- package/src/input/gamepad.ts +61 -61
- package/src/input/input-events.ts +32 -32
- package/src/input/input-registry.ts +171 -164
- package/src/input/input-system.ts +406 -393
- package/src/input/legacy-controls.ts +64 -64
- package/src/input/modality.ts +122 -0
- package/src/input/nav-state.ts +200 -191
- package/src/input/navigator.ts +182 -171
- package/src/input/on-screen-controls.ts +101 -101
- package/src/input/page-control.ts +43 -43
- package/src/input/page-input.ts +193 -193
- package/src/input/player-remaps.ts +77 -77
- package/src/input/source-values.ts +116 -116
- package/src/input/spatial.ts +47 -47
- package/src/input/types.ts +331 -331
- package/src/input/zero-config.ts +164 -177
- package/src/input.ts +26 -22
- package/src/mp.ts +10 -10
- package/src/overlay/controls-panel.ts +163 -163
- package/src/overlay/dom.ts +46 -46
- package/src/overlay/layout-clusters.ts +162 -162
- package/src/overlay/layout-geometry.ts +136 -136
- package/src/overlay/layout.ts +203 -203
- package/src/overlay/listener-scope.ts +23 -23
- package/src/overlay/on-screen-keyboard.ts +137 -137
- package/src/overlay/overlay.ts +234 -208
- package/src/overlay/styles.ts +13 -12
- package/src/overlay/virtual-controls.ts +262 -262
- package/src/race.ts +10 -10
- package/src/realtime/bridge.ts +126 -121
- package/src/realtime/cross-bundle.ts +29 -29
- package/src/realtime/fallback-notice.ts +48 -48
- package/src/realtime/hub-link.ts +65 -65
- package/src/realtime/latest-state.ts +33 -33
- package/src/realtime/multiplayer-forwarder.ts +40 -28
- package/src/realtime/multiplayer-types.ts +66 -52
- package/src/realtime/page-runtime.ts +60 -60
- package/src/realtime/race-forwarder.ts +59 -59
- package/src/realtime/race-types.ts +132 -132
- package/src/realtime/room-types.ts +151 -125
- package/src/realtime/rooms-forwarder.ts +104 -79
- package/src/realtime/runtime-api.ts +74 -49
- package/src/realtime/runtime-opener.ts +61 -61
- package/src/realtime/social-forwarder.ts +77 -72
- package/src/realtime/social-types.ts +86 -78
- package/src/realtime/types.ts +54 -53
- package/src/realtime/wire-types.ts +79 -72
- package/src/realtime/world-types.ts +20 -0
- package/src/rooms.ts +10 -10
- package/src/social.ts +19 -18
- package/src/turns-kit/check-rules.ts +281 -0
- package/src/turns-rules.ts +12 -0
- package/src/turns.ts +14 -0
- package/src/types.ts +13 -13
- package/src/uistack/page-stack.ts +45 -45
- package/src/uistack/play-suspension.ts +82 -82
- package/src/uistack/types.ts +76 -76
- package/src/uistack/ui-stack.ts +144 -144
package/dist/shared/social.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import "./wire-types.js";
|
|
2
|
-
import { n as HubMpApi } from "./multiplayer-types.js";
|
|
3
|
-
import { n as HubRoomsApi } from "./room-types.js";
|
|
2
|
+
import { n as HubMpApi, r as InviteLinkMethods } from "./multiplayer-types.js";
|
|
3
|
+
import { n as HubRoomsApi, s as RoomReclaimMethods } from "./room-types.js";
|
|
4
4
|
import { t as HubRaceApi } from "./race-types.js";
|
|
5
|
-
import {
|
|
5
|
+
import { AvatarLook } from "@diffenderfer-games/hub-contract/avatar";
|
|
6
|
+
import { Audience, ChatMode, ChatMode as ChatMode$1, Conversation, Counts, ErrorBody, EventData, EventName, FriendEntry, FriendEntry as FriendEntry$1, Invite, Invite as Invite$1, JoinInfo as JoinInfo$1, Launch as Launch$1, LaunchTicket, Message, MessagesPage, NotifyChange, NotifyPrefs, OpAck, OpInput, OpName, Party, Party as Party$1, PlayerCard, PlayerLite, Presence, Presence as Presence$1, PresenceInput, PresenceInput as PresenceInput$1, PresenceKind, RaceOutcome, RaceParams as RaceParams$1, RaceRecord, RaceResult as RaceResult$1, RaceStatValue, RaceState, RaceStats as RaceStats$1, Racer, RacerResult, RacerState, RecentPlayer, Relation, ReportInput, ReportKind, ReportReason, RoomInfo as RoomInfo$1, SocialConfig, SocialMe, Suggestion, SuggestionStatus, events, ops } from "@diffenderfer-games/hub-contract";
|
|
6
7
|
//#region src/realtime/social-types.d.ts
|
|
7
8
|
/** Online counts as a game sees them. */
|
|
8
9
|
interface SocialCounts {
|
|
@@ -65,6 +66,11 @@ interface HubSocialApi {
|
|
|
65
66
|
openNotify(options?: {
|
|
66
67
|
game?: string;
|
|
67
68
|
}): void;
|
|
69
|
+
/**
|
|
70
|
+
* Open "Play online": games waiting for a player, invites, tournaments and
|
|
71
|
+
* the quick 1v1 (feature version 4; a no-op on older runtimes).
|
|
72
|
+
*/
|
|
73
|
+
openPlayOnline(): void;
|
|
68
74
|
/** Friends with live presence. Rejects with `OfflineError` without the runtime. */
|
|
69
75
|
friends(): Promise<FriendEntry[]>;
|
|
70
76
|
/** Live counts; all zero until the runtime is up. */
|
|
@@ -74,6 +80,8 @@ interface HubSocialApi {
|
|
|
74
80
|
/** Subscribe to social events; works before the runtime loads. Returns the unsubscribe function. */
|
|
75
81
|
on<Name extends keyof SocialEvents>(event: Name, listener: (payload: SocialEvents[Name]) => void): () => void;
|
|
76
82
|
}
|
|
83
|
+
/** What feature version 4 added to `hub.social`. */
|
|
84
|
+
type PlayOnlineMethods = Pick<HubSocialApi, 'openPlayOnline'>;
|
|
77
85
|
/** `hub.notify`: toast behaviour during intense play. */
|
|
78
86
|
interface HubNotifyApi {
|
|
79
87
|
/** Quiet: toasts collapse into the menu badge; invites still show as a small pill. */
|
|
@@ -101,12 +109,74 @@ interface RealtimeHubLink {
|
|
|
101
109
|
/** Called once by the core client so forwarder errors use its classes and tickets use its REST client. */
|
|
102
110
|
declare function linkRealtimeToHub(link: RealtimeHubLink): void;
|
|
103
111
|
//#endregion
|
|
112
|
+
//#region src/core/avatar/avatar-types.d.ts
|
|
113
|
+
/**
|
|
114
|
+
* A player's avatar as games hold it: the code (pass it to any renderer),
|
|
115
|
+
* the decoded look, whether it is their generated default, and whether the
|
|
116
|
+
* player is hidden from you (draw the silhouette).
|
|
117
|
+
*/
|
|
118
|
+
interface AvatarRef {
|
|
119
|
+
readonly code: string;
|
|
120
|
+
/** `null` when hidden or the code is malformed (renderers draw the silhouette). */
|
|
121
|
+
readonly look: AvatarLook | null;
|
|
122
|
+
/** They never designed one: this is their generated default. */
|
|
123
|
+
readonly isDefault: boolean;
|
|
124
|
+
/** Hidden where the username is hidden (§2.8). */
|
|
125
|
+
readonly hidden: boolean;
|
|
126
|
+
}
|
|
127
|
+
/** A player's avatar changed (`hub.avatar.on('change')`). */
|
|
128
|
+
interface AvatarChange {
|
|
129
|
+
readonly userId: number;
|
|
130
|
+
readonly ref: AvatarRef;
|
|
131
|
+
}
|
|
132
|
+
/** Options for the designer. */
|
|
133
|
+
interface OpenDesignerOptions {
|
|
134
|
+
/** Why it opened (`'game'`, `'world'`, …), for metrics only. */
|
|
135
|
+
readonly reason?: string;
|
|
136
|
+
}
|
|
137
|
+
/** What the designer reports when it closes. */
|
|
138
|
+
interface DesignerResult {
|
|
139
|
+
/** The player saved a new look. */
|
|
140
|
+
readonly saved: boolean;
|
|
141
|
+
}
|
|
142
|
+
/** What the social runtime adds for avatars (feature version 5). */
|
|
143
|
+
interface RuntimeAvatarApi {
|
|
144
|
+
/** Open "Make your avatar" over the page; resolves when it closes. */
|
|
145
|
+
openDesigner(options?: OpenDesignerOptions): Promise<DesignerResult>;
|
|
146
|
+
/** Live `ev:avatar` changes (yours, friends', your room's). */
|
|
147
|
+
on(event: 'change', listener: (change: {
|
|
148
|
+
readonly userId: number;
|
|
149
|
+
readonly code: string;
|
|
150
|
+
}) => void): () => void;
|
|
151
|
+
}
|
|
152
|
+
//#endregion
|
|
153
|
+
//#region src/realtime/world-types.d.ts
|
|
154
|
+
/** A `world.*` op name. */
|
|
155
|
+
type WorldOpName = Extract<OpName, `world.${string}`>;
|
|
156
|
+
/** A `world.*` event name. */
|
|
157
|
+
type WorldEventName = Extract<EventName, `world.${string}`>;
|
|
158
|
+
/** `rt.world` (realtime feature version 6 and later). */
|
|
159
|
+
interface RuntimeWorldApi {
|
|
160
|
+
/** Send a world op on the page's socket; rejects with the hub's refusal. */
|
|
161
|
+
op<Name extends WorldOpName>(name: Name, input: OpInput<(typeof ops)[Name]>): Promise<OpAck<(typeof ops)[Name]>>;
|
|
162
|
+
/** Hear a world event; returns the unsubscribe. */
|
|
163
|
+
on<Name extends WorldEventName>(name: Name, listener: (payload: EventData<(typeof events)[Name]>) => void): () => void;
|
|
164
|
+
}
|
|
165
|
+
//#endregion
|
|
104
166
|
//#region src/realtime/runtime-api.d.ts
|
|
105
167
|
/**
|
|
106
168
|
* The realtime feature version the runtime reports in {@link RealtimeApi.version}.
|
|
107
|
-
* 2 added races;
|
|
169
|
+
* 2 added races; 3 added invite links and taking back a held seat; 4 added
|
|
170
|
+
* "Play online" (tournaments); 5 added avatars (the designer and `ev:avatar`); 6 added the world (`world`).
|
|
171
|
+
* A client feature-detects newer additions with it (or by the optional method).
|
|
108
172
|
*/
|
|
109
|
-
declare const REALTIME_FEATURE_VERSION =
|
|
173
|
+
declare const REALTIME_FEATURE_VERSION = 6;
|
|
174
|
+
/** `hub.social` as a runtime installs it: version 4's `openPlayOnline` is missing on older runtimes. */
|
|
175
|
+
type RuntimeSocialApi = Omit<HubSocialApi, keyof PlayOnlineMethods> & Partial<PlayOnlineMethods>;
|
|
176
|
+
/** `hub.mp` as a runtime installs it: version 3's invite-link methods are missing on older runtimes. */
|
|
177
|
+
type RuntimeMpApi = Omit<HubMpApi, keyof InviteLinkMethods> & Partial<InviteLinkMethods>;
|
|
178
|
+
/** `hub.rooms` as a runtime installs it: version 3's `reclaim` is missing on older runtimes. */
|
|
179
|
+
type RuntimeRoomsApi = Omit<HubRoomsApi, keyof RoomReclaimMethods> & Partial<RoomReclaimMethods>;
|
|
110
180
|
/**
|
|
111
181
|
* The cross-bundle shape number of the `rt` page singleton (plan §4.4). The
|
|
112
182
|
* runtime registers with it through `claimSingleton`; bump it only when the
|
|
@@ -115,6 +185,13 @@ declare const REALTIME_FEATURE_VERSION = 2;
|
|
|
115
185
|
declare const REALTIME_SINGLETON_API = 1;
|
|
116
186
|
/** The window event the runtime fires once it has installed itself. */
|
|
117
187
|
declare const REALTIME_READY_EVENT = "hub:rt-ready";
|
|
188
|
+
/**
|
|
189
|
+
* The window event the runtime fires each time its socket says hello (it
|
|
190
|
+
* connected, or connected again after a drop), with `{ user: { id, look } }`
|
|
191
|
+
* from the hello snapshot. `hub.avatar` and `hub.userId()` follow it; changes
|
|
192
|
+
* sent while the socket was down are fetched again.
|
|
193
|
+
*/
|
|
194
|
+
declare const SESSION_EVENT = "hub:session";
|
|
118
195
|
/** The window event the menu fires when the runtime failed to load (its reason is on `window.__HUB_RT_ERROR__`). */
|
|
119
196
|
declare const REALTIME_FAILED_EVENT = "hub:rt-failed";
|
|
120
197
|
/**
|
|
@@ -127,15 +204,19 @@ interface RealtimeApi {
|
|
|
127
204
|
/** Presence reporting. */
|
|
128
205
|
presence: HubPresenceApi;
|
|
129
206
|
/** Friends and the social dialogs. */
|
|
130
|
-
social:
|
|
207
|
+
social: RuntimeSocialApi;
|
|
131
208
|
/** Invites, launches, the leave guard and tickets. */
|
|
132
|
-
mp:
|
|
209
|
+
mp: RuntimeMpApi;
|
|
133
210
|
/** Hub relay rooms. */
|
|
134
|
-
rooms:
|
|
211
|
+
rooms: RuntimeRoomsApi;
|
|
135
212
|
/** Toast behaviour. */
|
|
136
213
|
notify: HubNotifyApi;
|
|
137
214
|
/** Races (feature version 2 and later). */
|
|
138
215
|
race?: HubRaceApi;
|
|
216
|
+
/** Avatars: the designer and live changes (feature version 5 and later). */
|
|
217
|
+
avatar?: RuntimeAvatarApi;
|
|
218
|
+
/** The world's ops and events (feature version 6 and later). */
|
|
219
|
+
world?: RuntimeWorldApi;
|
|
139
220
|
}
|
|
140
221
|
//#endregion
|
|
141
222
|
//#region src/realtime/page-runtime.d.ts
|
|
@@ -144,5 +225,5 @@ declare function isRealtimeApi(candidate: unknown): candidate is RealtimeApi;
|
|
|
144
225
|
/** The page's realtime API if the runtime has loaded, else `null`. */
|
|
145
226
|
declare function findRealtimeApi(): RealtimeApi | null;
|
|
146
227
|
//#endregion
|
|
147
|
-
export {
|
|
228
|
+
export { AvatarRef as $, RacerState as A, SuggestionStatus as B, RaceRecord as C, RaceStats$1 as D, RaceState as E, ReportReason as F, REALTIME_READY_EVENT as G, isRealtimeApi as H, RoomInfo$1 as I, SESSION_EVENT as J, REALTIME_SINGLETON_API as K, SocialConfig as L, Relation as M, ReportInput as N, Racer as O, ReportKind as P, AvatarChange as Q, SocialMe as R, RaceParams$1 as S, RaceStatValue as T, REALTIME_FAILED_EVENT as U, findRealtimeApi as V, REALTIME_FEATURE_VERSION as W, WorldEventName as X, RuntimeWorldApi as Y, WorldOpName as Z, PlayerLite as _, ErrorBody as a, notifyForwarder as at, PresenceKind as b, JoinInfo$1 as c, HubNotifyApi as ct, Message as d, OpenInviteOptions as dt, DesignerResult as et, MessagesPage as f, PlayOnlineMethods as ft, PlayerCard as g, Party$1 as h, SocialEvents as ht, Counts as i, linkRealtimeToHub as it, RecentPlayer as j, RacerResult as k, Launch$1 as l, HubPresenceApi as lt, NotifyPrefs as m, SocialCounts as mt, ChatMode$1 as n, RuntimeAvatarApi as nt, FriendEntry$1 as o, presenceForwarder as ot, NotifyChange as p, PlayerRef as pt, RealtimeApi as q, Conversation as r, RealtimeHubLink as rt, Invite$1 as s, socialForwarder as st, Audience as t, OpenDesignerOptions as tt, LaunchTicket as u, HubSocialApi as ut, Presence$1 as v, RaceResult$1 as w, RaceOutcome as x, PresenceInput$1 as y, Suggestion as z };
|
|
148
229
|
//# sourceMappingURL=social.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"social.d.ts","names":[],"sources":["../../src/realtime/social-types.ts","../../src/realtime/social-forwarder.ts","../../src/realtime/hub-link.ts","../../src/realtime/runtime-api.ts","../../src/realtime/page-runtime.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"social.d.ts","names":[],"sources":["../../src/realtime/social-types.ts","../../src/realtime/social-forwarder.ts","../../src/realtime/hub-link.ts","../../src/core/avatar/avatar-types.ts","../../src/realtime/world-types.ts","../../src/realtime/runtime-api.ts","../../src/realtime/page-runtime.ts"],"mappings":";;;;;;;;UAOiB;;EAEf;;EAEA;;EAEA;;;UAIe;;EAEf,SAAS;;EAET;IAAY;IAAgB,GAAG;;;EAE/B,QAAQ;;EAER,QAAQ;;EAER,OAAO;;;KAIG;EAAc;;EAAqB;;;UAG9B;;EAEf;;EAEA;;;UAIe;;EAEf,IAAI,UAAU;;EAEd;;;UAIe;;EAEf,WAAW,KAAK;;EAEhB;;EAEA,SAAS;;EAET,WAAW,UAAU;;EAErB;;EAEA,WAAW;IAAY;;;;;;EAKvB;;EAEA,WAAW,QAAQ;;EAEnB,UAAU;;EAEV,SAAS,qBAAqB;;EAE9B,GAAG,mBAAmB,cAAc,OAAO,MAAM,WAAW,SAAS,aAAa;;;KAIxE,oBAAoB,KAAK;;UAGpB;;EAEf,SAAS;;;;;cCpEE,mBAAmB;;cAYnB,iBAAiB;;cAQjB,iBAAiB;;;;UCzBb;;EAGf,WAAW,iBAAiB;;EAE5B,mBAAmB,kBAAkB;;EAErC,uBAAuB;;;iBAuCT,kBAAkB,MAAM;;;;;;;;UCjDvB;WACN;;WAEA,MAAM;;WAEN;;WAEA;;;UAIM;WACN;WACA,KAAK;;;UAIC;;WAEN;;;UAIM;;WAEN;;;UAIM;;EAEf,aAAa,UAAU,sBAAsB,QAAQ;;EAErD,GAAG,iBAAiB,WAAW;aAAmB;aAAyB;;;;;;KCjCjE,cAAc,QAAQ;;KAGtB,iBAAiB,QAAQ;;UAGpB;;EAEf,GAAG,aAAa,aAAa,MAAM,MAAM,OAAO,gBAAgB,KAAK,SAAS,QAAQ,cAAc,KAAK;;EAEzG,GAAG,aAAa,gBAAgB,MAAM,MAAM,WAAW,SAAS,kBAAkB,QAAQ;;;;;;;;;;cCA/E;;KAGD,mBAAmB,KAAK,oBAAoB,qBAAqB,QAAQ;;KAGzE,eAAe,KAAK,gBAAgB,qBAAqB,QAAQ;;KAGjE,kBAAkB,KAAK,mBAAmB,sBAAsB,QAAQ;;;;;;cAOvE;;cAGA;;;;;;;cAQA;;cAGA;;;;;UAMI;;WAEN;;EAET,UAAU;;EAEV,QAAQ;;EAER,IAAI;;EAEJ,OAAO;;EAEP,QAAQ;;EAER,OAAO;;EAEP,SAAS;;EAET,QAAQ;;;;;iBC5DM,cAAc,qBAAqB,aAAa;;iBAsBhD,mBAAmB"}
|
package/dist/shared/social.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as pageBridge } from "./bridge.js";
|
|
2
2
|
import { t as latestState } from "./latest-state.js";
|
|
3
3
|
import { t as createRuntimeOpener } from "./runtime-opener.js";
|
|
4
4
|
//#region src/realtime/social-forwarder.ts
|
|
@@ -62,6 +62,11 @@ const socialForwarder = {
|
|
|
62
62
|
realtime.social.openNotify(options);
|
|
63
63
|
});
|
|
64
64
|
},
|
|
65
|
+
openPlayOnline: () => {
|
|
66
|
+
openWithRuntime((realtime) => {
|
|
67
|
+
realtime.social.openPlayOnline?.();
|
|
68
|
+
});
|
|
69
|
+
},
|
|
65
70
|
friends: () => pageBridge.call((realtime) => realtime.social.friends()),
|
|
66
71
|
counts: () => pageBridge.current()?.social.counts() ?? { ...NO_COUNTS },
|
|
67
72
|
chatMode: (userIds) => pageBridge.current()?.social.chatMode(userIds) ?? "off",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"social.js","names":[],"sources":["../../src/realtime/social-forwarder.ts"],"mappings":";;;;;;;;;AAUA,MAAM,kBAAkB,oBAAoB,UAAU;;AAGtD,MAAM,YAA0B;CAAE,QAAQ;CAAG,QAAQ;CAAG,eAAe;AAAE;;AAGzE,MAAa,oBAAoC;CAC/C,IAAI,UAAU;EACZ,YAAY,WAAW,EAAE,GAAG,SAAS;EACrC,WAAW,QAAQ,CAAC,EA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