@diffenderfer-games/hub 2.0.0-next.1 → 2.0.0-next.3
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 +40 -6
- package/README.md +25 -10
- package/dist/auto.d.ts +7 -7
- package/dist/auto.js +3 -3
- package/dist/doctor/cli.mjs +14 -7
- package/dist/doctor/cli.mjs.map +1 -1
- package/dist/index.d.ts +7 -7
- 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/shared/bridge.js +9 -3
- package/dist/shared/bridge.js.map +1 -1
- package/dist/shared/client-version.gen.js +1 -1
- package/dist/shared/daily.d.ts +10 -4
- package/dist/shared/daily.d.ts.map +1 -1
- package/dist/shared/daily.js +12 -2
- package/dist/shared/daily.js.map +1 -1
- package/dist/shared/index.d.ts +315 -36
- package/dist/shared/index.d.ts.map +1 -1
- package/dist/shared/input.d.ts +47 -5
- package/dist/shared/input.d.ts.map +1 -1
- package/dist/shared/input.js +139 -23
- package/dist/shared/input.js.map +1 -1
- package/dist/shared/latest-state.js +1 -1
- 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/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 +10 -2
- package/dist/shared/rooms.js.map +1 -1
- package/dist/shared/runtime-opener.js +1 -1
- package/dist/shared/social.d.ts +23 -8
- 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 +1588 -388
- package/dist/shared/src.js.map +1 -1
- 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 +1 -1
- package/package.json +2 -2
- package/src/core/connection.ts +187 -92
- package/src/core/game-data.ts +11 -9
- package/src/core/hub-economy.ts +47 -10
- package/src/core/hub-progress.ts +13 -16
- package/src/core/hub.ts +4 -2
- 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 +35 -0
- package/src/core/offline/hub-kinds/legacy-ops.ts +37 -0
- package/src/core/offline/hub-kinds/progress-kinds.ts +148 -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 +20 -22
- 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 +4 -49
- package/src/core/offline/replay-lease.ts +87 -0
- package/src/core/offline/replay-policy.ts +52 -0
- package/src/core/rest/rest-client.ts +14 -3
- package/src/core/rest/routes.gen.ts +108 -87
- package/src/core/storage/json-guards.ts +6 -0
- package/src/core/version/client-version.gen.ts +1 -1
- package/src/daily/daily-system.ts +8 -1
- package/src/daily/types.ts +3 -2
- package/src/doctor/checks.ts +10 -2
- package/src/index.ts +6 -1
- package/src/input/focus-ring.ts +13 -0
- package/src/input/input-registry.ts +9 -2
- package/src/input/input-system.ts +4 -0
- package/src/input/modality.ts +122 -0
- package/src/input/nav-state.ts +13 -4
- package/src/input/zero-config.ts +1 -14
- package/src/input.ts +3 -0
- package/src/mp.ts +1 -1
- package/src/overlay/overlay.ts +5 -3
- package/src/overlay/styles.ts +4 -3
- package/src/realtime/bridge.ts +5 -0
- package/src/realtime/multiplayer-forwarder.ts +13 -1
- package/src/realtime/multiplayer-types.ts +15 -1
- package/src/realtime/room-types.ts +28 -2
- package/src/realtime/rooms-forwarder.ts +13 -1
- package/src/realtime/runtime-api.ts +19 -8
- package/src/realtime/social-forwarder.ts +5 -0
- package/src/realtime/social-types.ts +8 -0
- package/src/realtime/wire-types.ts +7 -0
- package/src/rooms.ts +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { d as RoomSeat$1, f as RoomSeatChange, l as RoomChatLine, u as RoomMessage } from "./wire-types.js";
|
|
2
2
|
import { Json, RoomInfo } from "@diffenderfer-games/hub-contract";
|
|
3
3
|
//#region src/realtime/room-types.d.ts
|
|
4
4
|
/** The shared room state (a JSON object, at most 32 KB). */
|
|
@@ -15,6 +15,13 @@ interface RoomCreateOptions {
|
|
|
15
15
|
maxPlayers?: number;
|
|
16
16
|
/** `host` (default): guests' unaddressed sends reach the host only. `relay`: everyone hears every send. */
|
|
17
17
|
model?: 'host' | 'relay';
|
|
18
|
+
/**
|
|
19
|
+
* When the host role moves on mid-game: `grace` (default) once the host's
|
|
20
|
+
* seat is freed (left, or 3 minutes away), so a host holding hidden state
|
|
21
|
+
* can come back; `drop` as soon as the host drops, for games whose truth is
|
|
22
|
+
* all in `setState`.
|
|
23
|
+
*/
|
|
24
|
+
hostMigration?: 'grace' | 'drop';
|
|
18
25
|
/** Seat this party in the room. */
|
|
19
26
|
partyId?: string;
|
|
20
27
|
}
|
|
@@ -55,6 +62,13 @@ interface RoomEvents {
|
|
|
55
62
|
userId: number;
|
|
56
63
|
reason?: string;
|
|
57
64
|
};
|
|
65
|
+
/**
|
|
66
|
+
* A seat changed: `away` (dropped; held until `graceEndsAt`, so hand it to
|
|
67
|
+
* your computer player), `back` (reclaimed: give control back) or `gone`
|
|
68
|
+
* (freed: left, kicked or the grace ran out). The game never ends on its
|
|
69
|
+
* own because of this; `info.hostId` may have moved to another player.
|
|
70
|
+
*/
|
|
71
|
+
seat: RoomSeatChange;
|
|
58
72
|
}
|
|
59
73
|
/** Who I am in a room. */
|
|
60
74
|
interface RoomSelf {
|
|
@@ -83,6 +97,8 @@ interface HubRoom {
|
|
|
83
97
|
readonly state: RoomState;
|
|
84
98
|
/** Who I am in this room. */
|
|
85
99
|
readonly me: RoomSelf;
|
|
100
|
+
/** The seats as last reported; `connected: false` while a seat is away. */
|
|
101
|
+
seats(): RoomSeat$1[];
|
|
86
102
|
/** Subscribe to a room event. Returns the unsubscribe function. */
|
|
87
103
|
on<Name extends keyof RoomEvents>(event: Name, listener: (payload: RoomEvents[Name]) => void): () => void;
|
|
88
104
|
/** Mark my seat ready (or not). */
|
|
@@ -111,8 +127,17 @@ interface RoomListOptions {
|
|
|
111
127
|
/** Only rooms in this mode. */
|
|
112
128
|
mode?: string;
|
|
113
129
|
}
|
|
130
|
+
/** What feature version 3 added to `hub.rooms`. */
|
|
131
|
+
interface RoomReclaimMethods {
|
|
132
|
+
/**
|
|
133
|
+
* Take back the seat I still hold in this game (after a reload, from
|
|
134
|
+
* another tab): the room, or `null` when I hold none. The hub also does
|
|
135
|
+
* this on its own at boot, as a `join` launch with `via: 'rejoin'`.
|
|
136
|
+
*/
|
|
137
|
+
reclaim(): Promise<HubRoom | null>;
|
|
138
|
+
}
|
|
114
139
|
/** `hub.rooms`: hub relay rooms (static games, no server). */
|
|
115
|
-
interface HubRoomsApi {
|
|
140
|
+
interface HubRoomsApi extends RoomReclaimMethods {
|
|
116
141
|
/** Create a room and take its first seat. */
|
|
117
142
|
create(options?: RoomCreateOptions): Promise<HubRoom>;
|
|
118
143
|
/** Join a room by its 5-character code or its id. */
|
|
@@ -121,5 +146,5 @@ interface HubRoomsApi {
|
|
|
121
146
|
list(options?: RoomListOptions): Promise<RoomInfo[]>;
|
|
122
147
|
}
|
|
123
148
|
//#endregion
|
|
124
|
-
export { RoomEvents as a,
|
|
149
|
+
export { RoomEvents as a, RoomSelf as c, RoomStateOptions as d, RoomCreateOptions as i, RoomSendOptions as l, HubRoomsApi as n, RoomListOptions as o, JoinOptions as r, RoomReclaimMethods as s, HubRoom as t, RoomState as u };
|
|
125
150
|
//# sourceMappingURL=room-types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"room-types.d.ts","names":[],"sources":["../../src/realtime/room-types.ts"],"mappings":";;;;KAQY,YAAY,eAAe;;UAGtB;;EAEf;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;;UAIe;;EAEf;;;UAIe;;EAEf,MAAM;;EAEN,KAAK;;EAEL,OAAO;;EAEP,MAAM;;EAEN;IAAU;;;;;;;EAMV;IAAU;;;EAEV;IAAS,MAAM;IAAU,UAAU;;;EAEnC;IAAa;IAAgB
|
|
1
|
+
{"version":3,"file":"room-types.d.ts","names":["RoomSeat"],"sources":["../../src/realtime/room-types.ts"],"mappings":";;;;KAQY,YAAY,eAAe;;UAGtB;;EAEf;;EAEA;;EAEA;;EAEA;;EAEA;;;;;;;EAOA;;EAEA;;;UAIe;;EAEf;;;UAIe;;EAEf,MAAM;;EAEN,KAAK;;EAEL,OAAO;;EAEP,MAAM;;EAEN;IAAU;;;;;;;EAMV;IAAU;;;EAEV;IAAS,MAAM;IAAU,UAAU;;;EAEnC;IAAa;IAAgB;;;;;;;;EAO7B,MAAM;;;UAIS;;EAEf;;EAEA;;EAEA;;;UAIe;;EAEf;;;UAIe;;EAEf;;;UAIe;;WAEN,MAAM;;WAEN,OAAO;;WAEP,IAAI;;EAEb,SAASA;;EAET,GAAG,mBAAmB,YAAY,OAAO,MAAM,WAAW,SAAS,WAAW;;EAE9E,MAAM,mBAAmB;;EAEzB,KAAK,UAAU,OAAO;;EAEtB,SAAS;;EAET,KAAK,SAAS,MAAM,UAAU,kBAAkB;;EAEhD,SAAS,OAAO,WAAW,UAAU,mBAAmB;;EAExD,KAAK,eAAe;;EAEpB,MAAM,mBAAmB;;EAEzB,KAAK,iBAAiB;;EAEtB,SAAS;;EAET,IAAI,UAAU,OAAO;;;UAIN;;EAEf;;;UAIe;;;;;;EAMf,WAAW,QAAQ;;;UAIJ,oBAAoB;;EAEnC,OAAO,UAAU,oBAAoB,QAAQ;;EAE7C,KAAK,kBAAkB,UAAU,cAAc,QAAQ;;EAEvD,KAAK,UAAU,kBAAkB,QAAQ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rooms.d.ts","names":[],"sources":["../../src/realtime/rooms-forwarder.ts"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"rooms.d.ts","names":[],"sources":["../../src/realtime/rooms-forwarder.ts"],"mappings":";;;;;cA+Ea,gBAAgB"}
|
package/dist/shared/rooms.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as _defineProperty } from "./globals.js";
|
|
2
|
-
import { n as rethrowAsHubError, t as
|
|
2
|
+
import { n as pageBridge, r as rethrowAsHubError, t as outdatedRuntime } from "./bridge.js";
|
|
3
3
|
//#region src/realtime/rooms-forwarder.ts
|
|
4
4
|
/** A runtime room whose rejections are re-created as the core client's errors. */
|
|
5
5
|
var ForwardedRoom = class {
|
|
@@ -16,6 +16,9 @@ var ForwardedRoom = class {
|
|
|
16
16
|
get me() {
|
|
17
17
|
return this.room.me;
|
|
18
18
|
}
|
|
19
|
+
seats() {
|
|
20
|
+
return this.room.info.seats;
|
|
21
|
+
}
|
|
19
22
|
on(event, listener) {
|
|
20
23
|
return this.room.on(event, listener);
|
|
21
24
|
}
|
|
@@ -54,7 +57,12 @@ var ForwardedRoom = class {
|
|
|
54
57
|
const roomsForwarder = {
|
|
55
58
|
create: (options) => pageBridge.call(async (realtime) => new ForwardedRoom(await realtime.rooms.create(options))),
|
|
56
59
|
join: (codeOrId, options) => pageBridge.call(async (realtime) => new ForwardedRoom(await realtime.rooms.join(codeOrId, options))),
|
|
57
|
-
list: (options) => pageBridge.call((realtime) => realtime.rooms.list(options))
|
|
60
|
+
list: (options) => pageBridge.call((realtime) => realtime.rooms.list(options)),
|
|
61
|
+
reclaim: () => pageBridge.call(async (realtime) => {
|
|
62
|
+
if (realtime.rooms.reclaim === void 0) throw outdatedRuntime("Taking back a seat");
|
|
63
|
+
const held = await realtime.rooms.reclaim();
|
|
64
|
+
return held === null ? null : new ForwardedRoom(held);
|
|
65
|
+
})
|
|
58
66
|
};
|
|
59
67
|
//#endregion
|
|
60
68
|
export { roomsForwarder as t };
|
package/dist/shared/rooms.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rooms.js","names":[],"sources":["../../src/realtime/rooms-forwarder.ts"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"rooms.js","names":[],"sources":["../../src/realtime/rooms-forwarder.ts"],"mappings":";;;;AAUA,IAAM,gBAAN,MAAuC;CAGrC,YAAY,MAAe;EAFV,gBAAA,MAAA,QAAA,KAAA,CAAA;EAGf,KAAK,OAAO;CACd;CAEA,IAAI,OAAiB;EACnB,OAAO,KAAK,KAAK;CACnB;CAEA,IAAI,QAAmB;EACrB,OAAO,KAAK,KAAK;CACnB;CAEA,IAAI,KAAe;EACjB,OAAO,KAAK,KAAK;CACnB;CAEA,QAAoB;EAClB,OAAO,KAAK,KAAK,KAAK;CACxB;CAEA,GAAkC,OAAa,UAA2D;EACxG,OAAO,KAAK,KAAK,GAAG,OAAO,QAAQ;CACrC;CAEA,MAAM,SAAiC;EACrC,OAAO,kBAAkB,KAAK,KAAK,MAAM,OAAO,CAAC;CACnD;CAEA,KAAK,UAA+B;EAClC,OAAO,kBAAkB,KAAK,KAAK,KAAK,QAAQ,CAAC;CACnD;CAEA,QAAuB;EACrB,OAAO,kBAAkB,KAAK,KAAK,MAAM,CAAC;CAC5C;CAEA,KAAK,SAAe,SAA0C;EAC5D,OAAO,kBAAkB,KAAK,KAAK,KAAK,SAAS,OAAO,CAAC;CAC3D;CAEA,SAAS,OAAkB,SAA2C;EACpE,OAAO,kBAAkB,KAAK,KAAK,SAAS,OAAO,OAAO,CAAC;CAC7D;CAEA,KAAK,MAA+B;EAClC,OAAO,kBAAkB,KAAK,KAAK,KAAK,IAAI,CAAC;CAC/C;CAEA,MAAM,UAAiC;EACrC,OAAO,kBAAkB,KAAK,KAAK,MAAM,QAAQ,CAAC;CACpD;CAEA,KAAK,QAA+B;EAClC,OAAO,kBAAkB,KAAK,KAAK,KAAK,MAAM,CAAC;CACjD;CAEA,QAAuB;EACrB,OAAO,kBAAkB,KAAK,KAAK,MAAM,CAAC;CAC5C;CAEA,IAAI,SAA+B;EACjC,OAAO,kBAAkB,KAAK,KAAK,IAAI,OAAO,CAAC;CACjD;AACF;;AAGA,MAAa,iBAA8B;CACzC,SAAS,YAAY,WAAW,KAAK,OAAO,aAAa,IAAI,cAAc,MAAM,SAAS,MAAM,OAAO,OAAO,CAAC,CAAC;CAChH,OAAO,UAAU,YAAY,WAAW,KAAK,OAAO,aAAa,IAAI,cAAc,MAAM,SAAS,MAAM,KAAK,UAAU,OAAO,CAAC,CAAC;CAChI,OAAO,YAAY,WAAW,MAAM,aAAa,SAAS,MAAM,KAAK,OAAO,CAAC;CAC7E,eAAe,WAAW,KAAK,OAAO,aAAa;EACjD,IAAI,SAAS,MAAM,YAAY,KAAA,GAC7B,MAAM,gBAAgB,oBAAoB;EAE5C,MAAM,OAAO,MAAM,SAAS,MAAM,QAAQ;EAC1C,OAAO,SAAS,OAAO,OAAO,IAAI,cAAc,IAAI;CACtD,CAAC;AACH"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as pageBody } from "./dom.js";
|
|
2
|
-
import {
|
|
2
|
+
import { o as readRuntimeFailure, s as REALTIME_FAILED_EVENT } from "./bridge.js";
|
|
3
3
|
//#region src/realtime/fallback-notice.ts
|
|
4
4
|
/**
|
|
5
5
|
* A minimal top-centre notice for when the social runtime (which owns the
|
package/dist/shared/social.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
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
5
|
import { Audience, ChatMode, ChatMode as ChatMode$1, Conversation, Counts, ErrorBody, FriendEntry, FriendEntry as FriendEntry$1, Invite, Invite as Invite$1, JoinInfo as JoinInfo$1, Launch as Launch$1, LaunchTicket, Message, MessagesPage, NotifyChange, NotifyPrefs, 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 } from "@diffenderfer-games/hub-contract";
|
|
6
6
|
//#region src/realtime/social-types.d.ts
|
|
@@ -65,6 +65,11 @@ interface HubSocialApi {
|
|
|
65
65
|
openNotify(options?: {
|
|
66
66
|
game?: string;
|
|
67
67
|
}): void;
|
|
68
|
+
/**
|
|
69
|
+
* Open "Play online": games waiting for a player, invites, tournaments and
|
|
70
|
+
* the quick 1v1 (feature version 4; a no-op on older runtimes).
|
|
71
|
+
*/
|
|
72
|
+
openPlayOnline(): void;
|
|
68
73
|
/** Friends with live presence. Rejects with `OfflineError` without the runtime. */
|
|
69
74
|
friends(): Promise<FriendEntry[]>;
|
|
70
75
|
/** Live counts; all zero until the runtime is up. */
|
|
@@ -74,6 +79,8 @@ interface HubSocialApi {
|
|
|
74
79
|
/** Subscribe to social events; works before the runtime loads. Returns the unsubscribe function. */
|
|
75
80
|
on<Name extends keyof SocialEvents>(event: Name, listener: (payload: SocialEvents[Name]) => void): () => void;
|
|
76
81
|
}
|
|
82
|
+
/** What feature version 4 added to `hub.social`. */
|
|
83
|
+
type PlayOnlineMethods = Pick<HubSocialApi, 'openPlayOnline'>;
|
|
77
84
|
/** `hub.notify`: toast behaviour during intense play. */
|
|
78
85
|
interface HubNotifyApi {
|
|
79
86
|
/** Quiet: toasts collapse into the menu badge; invites still show as a small pill. */
|
|
@@ -104,9 +111,17 @@ declare function linkRealtimeToHub(link: RealtimeHubLink): void;
|
|
|
104
111
|
//#region src/realtime/runtime-api.d.ts
|
|
105
112
|
/**
|
|
106
113
|
* The realtime feature version the runtime reports in {@link RealtimeApi.version}.
|
|
107
|
-
* 2 added races;
|
|
114
|
+
* 2 added races; 3 added invite links and taking back a held seat; 4 added
|
|
115
|
+
* "Play online" (tournaments). A client feature-detects newer additions with
|
|
116
|
+
* it (or by the optional method).
|
|
108
117
|
*/
|
|
109
|
-
declare const REALTIME_FEATURE_VERSION =
|
|
118
|
+
declare const REALTIME_FEATURE_VERSION = 4;
|
|
119
|
+
/** `hub.social` as a runtime installs it: version 4's `openPlayOnline` is missing on older runtimes. */
|
|
120
|
+
type RuntimeSocialApi = Omit<HubSocialApi, keyof PlayOnlineMethods> & Partial<PlayOnlineMethods>;
|
|
121
|
+
/** `hub.mp` as a runtime installs it: version 3's invite-link methods are missing on older runtimes. */
|
|
122
|
+
type RuntimeMpApi = Omit<HubMpApi, keyof InviteLinkMethods> & Partial<InviteLinkMethods>;
|
|
123
|
+
/** `hub.rooms` as a runtime installs it: version 3's `reclaim` is missing on older runtimes. */
|
|
124
|
+
type RuntimeRoomsApi = Omit<HubRoomsApi, keyof RoomReclaimMethods> & Partial<RoomReclaimMethods>;
|
|
110
125
|
/**
|
|
111
126
|
* The cross-bundle shape number of the `rt` page singleton (plan §4.4). The
|
|
112
127
|
* runtime registers with it through `claimSingleton`; bump it only when the
|
|
@@ -127,11 +142,11 @@ interface RealtimeApi {
|
|
|
127
142
|
/** Presence reporting. */
|
|
128
143
|
presence: HubPresenceApi;
|
|
129
144
|
/** Friends and the social dialogs. */
|
|
130
|
-
social:
|
|
145
|
+
social: RuntimeSocialApi;
|
|
131
146
|
/** Invites, launches, the leave guard and tickets. */
|
|
132
|
-
mp:
|
|
147
|
+
mp: RuntimeMpApi;
|
|
133
148
|
/** Hub relay rooms. */
|
|
134
|
-
rooms:
|
|
149
|
+
rooms: RuntimeRoomsApi;
|
|
135
150
|
/** Toast behaviour. */
|
|
136
151
|
notify: HubNotifyApi;
|
|
137
152
|
/** Races (feature version 2 and later). */
|
|
@@ -144,5 +159,5 @@ declare function isRealtimeApi(candidate: unknown): candidate is RealtimeApi;
|
|
|
144
159
|
/** The page's realtime API if the runtime has loaded, else `null`. */
|
|
145
160
|
declare function findRealtimeApi(): RealtimeApi | null;
|
|
146
161
|
//#endregion
|
|
147
|
-
export { HubNotifyApi 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, RealtimeHubLink as J, REALTIME_SINGLETON_API as K, SocialConfig as L, Relation as M, ReportInput as N, Racer as O, ReportKind as P, socialForwarder 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, notifyForwarder as X, linkRealtimeToHub as Y, presenceForwarder as Z, PlayerLite as _, ErrorBody as a,
|
|
162
|
+
export { HubNotifyApi 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, RealtimeHubLink as J, REALTIME_SINGLETON_API as K, SocialConfig as L, Relation as M, ReportInput as N, Racer as O, ReportKind as P, socialForwarder 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, notifyForwarder as X, linkRealtimeToHub as Y, presenceForwarder as Z, PlayerLite as _, ErrorBody as a, SocialCounts as at, PresenceKind as b, JoinInfo$1 as c, Message as d, HubPresenceApi as et, MessagesPage as f, PlayerCard as g, Party$1 as h, Counts as i, PlayerRef as it, RecentPlayer as j, RacerResult as k, Launch$1 as l, NotifyPrefs as m, ChatMode$1 as n, OpenInviteOptions as nt, FriendEntry$1 as o, SocialEvents as ot, NotifyChange as p, RealtimeApi as q, Conversation as r, PlayOnlineMethods as rt, Invite$1 as s, Audience as t, HubSocialApi as tt, LaunchTicket as u, Presence$1 as v, RaceResult$1 as w, RaceOutcome as x, PresenceInput$1 as y, Suggestion as z };
|
|
148
163
|
//# 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":";;;;;;;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
|
|
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":";;;;;;;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;;;;;;;;;cCzC3B;;KAGD,mBAAmB,KAAK,oBAAoB,qBAAqB,QAAQ;;KAGzE,eAAe,KAAK,gBAAgB,qBAAqB,QAAQ;;KAGjE,kBAAkB,KAAK,mBAAmB,sBAAsB,QAAQ;;;;;;cAOvE;;cAGA;;cAGA;;;;;UAMI;;WAEN;;EAET,UAAU;;EAEV,QAAQ;;EAER,IAAI;;EAEJ,OAAO;;EAEP,QAAQ;;EAER,OAAO;;;;;iBC9CO,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,EAAE,SAAS,IAAI,YAAY,QAAQ;CACzD;CACA,QAAQ;EACN,YAAY,WAAW,EAAE,MAAM,OAAO;EACtC,WAAW,QAAQ,CAAC,EAAE,SAAS,MAAM;CACvC;AACF;;AAGA,MAAa,kBAAgC,EAC3C,SAAS,SAAS;CAChB,YAAY,UAAU;CACtB,WAAW,QAAQ,CAAC,EAAE,OAAO,SAAS,OAAO;AAC/C,EACF;;AAGA,MAAa,kBAAgC;CAC3C,aAAa,QAAQ;EACnB,iBAAiB,aAAa;GAC5B,SAAS,OAAO,WAAW,GAAG;EAChC,CAAC;CACH;CACA,mBAAmB;EACjB,iBAAiB,aAAa;GAC5B,SAAS,OAAO,YAAY;EAC9B,CAAC;CACH;CACA,WAAW,WAAW;EACpB,iBAAiB,aAAa;GAC5B,SAAS,OAAO,SAAS,MAAM;EACjC,CAAC;CACH;CACA,aAAa,YAAY;EACvB,iBAAiB,aAAa;GAC5B,SAAS,OAAO,WAAW,OAAO;EACpC,CAAC;CACH;CACA,mBAAmB;EACjB,iBAAiB,aAAa;GAC5B,SAAS,OAAO,YAAY;EAC9B,CAAC;CACH;CACA,aAAa,YAAY;EACvB,iBAAiB,aAAa;GAC5B,SAAS,OAAO,WAAW,OAAO;EACpC,CAAC;CACH;CACA,eAAe,WAAW,MAAM,aAAa,SAAS,OAAO,QAAQ,CAAC;CACtE,cAAc,WAAW,QAAQ,CAAC,EAAE,OAAO,OAAO,KAAK,EAAE,GAAG,UAAU;CACtE,WAAW,YAAY,WAAW,QAAQ,CAAC,EAAE,OAAO,SAAS,OAAO,KAAK;CACzE,KAAK,OAAO,aAAa,WAAW,WAAW,aAAa,SAAS,OAAO,GAAG,OAAO,QAAQ,CAAC;AACjG"}
|
|
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,EAAE,SAAS,IAAI,YAAY,QAAQ;CACzD;CACA,QAAQ;EACN,YAAY,WAAW,EAAE,MAAM,OAAO;EACtC,WAAW,QAAQ,CAAC,EAAE,SAAS,MAAM;CACvC;AACF;;AAGA,MAAa,kBAAgC,EAC3C,SAAS,SAAS;CAChB,YAAY,UAAU;CACtB,WAAW,QAAQ,CAAC,EAAE,OAAO,SAAS,OAAO;AAC/C,EACF;;AAGA,MAAa,kBAAgC;CAC3C,aAAa,QAAQ;EACnB,iBAAiB,aAAa;GAC5B,SAAS,OAAO,WAAW,GAAG;EAChC,CAAC;CACH;CACA,mBAAmB;EACjB,iBAAiB,aAAa;GAC5B,SAAS,OAAO,YAAY;EAC9B,CAAC;CACH;CACA,WAAW,WAAW;EACpB,iBAAiB,aAAa;GAC5B,SAAS,OAAO,SAAS,MAAM;EACjC,CAAC;CACH;CACA,aAAa,YAAY;EACvB,iBAAiB,aAAa;GAC5B,SAAS,OAAO,WAAW,OAAO;EACpC,CAAC;CACH;CACA,mBAAmB;EACjB,iBAAiB,aAAa;GAC5B,SAAS,OAAO,YAAY;EAC9B,CAAC;CACH;CACA,aAAa,YAAY;EACvB,iBAAiB,aAAa;GAC5B,SAAS,OAAO,WAAW,OAAO;EACpC,CAAC;CACH;CACA,sBAAsB;EACpB,iBAAiB,aAAa;GAC5B,SAAS,OAAO,iBAAiB;EACnC,CAAC;CACH;CACA,eAAe,WAAW,MAAM,aAAa,SAAS,OAAO,QAAQ,CAAC;CACtE,cAAc,WAAW,QAAQ,CAAC,EAAE,OAAO,OAAO,KAAK,EAAE,GAAG,UAAU;CACtE,WAAW,YAAY,WAAW,QAAQ,CAAC,EAAE,OAAO,SAAS,OAAO,KAAK;CACzE,KAAK,OAAO,aAAa,WAAW,WAAW,aAAa,SAAS,OAAO,GAAG,OAAO,QAAQ,CAAC;AACjG"}
|