@rydr/game-sdk 3.9.0 → 3.11.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 +64 -0
- package/dist/client/PlatformClient.d.ts +6 -0
- package/dist/client/PlatformClient.d.ts.map +1 -1
- package/dist/client/PlatformClient.js +18 -0
- package/dist/client/PlatformClient.js.map +1 -1
- package/dist/conversations/index.d.ts +76 -38
- package/dist/conversations/index.d.ts.map +1 -1
- package/dist/conversations/index.js +136 -58
- package/dist/conversations/index.js.map +1 -1
- package/dist/conversations/voice-samples.d.ts +45 -0
- package/dist/conversations/voice-samples.d.ts.map +1 -0
- package/dist/conversations/voice-samples.js +63 -0
- package/dist/conversations/voice-samples.js.map +1 -0
- package/dist/conversations/voices.d.ts +33 -5
- package/dist/conversations/voices.d.ts.map +1 -1
- package/dist/conversations/voices.js +59 -31
- package/dist/conversations/voices.js.map +1 -1
- package/dist/protocol/conversations.d.ts +12 -7
- package/dist/protocol/conversations.d.ts.map +1 -1
- package/dist/protocol/conversations.js.map +1 -1
- package/dist/protocol/version.d.ts +1 -1
- package/dist/protocol/version.d.ts.map +1 -1
- package/dist/protocol/version.js +1 -1
- package/dist/protocol/version.js.map +1 -1
- package/dist/ui/README.md +2 -0
- package/dist/ui/index.d.ts +2 -0
- package/dist/ui/index.d.ts.map +1 -1
- package/dist/ui/index.js +2 -0
- package/dist/ui/index.js.map +1 -1
- package/dist/ui/power-race.d.ts +125 -0
- package/dist/ui/power-race.d.ts.map +1 -0
- package/dist/ui/power-race.js +726 -0
- package/dist/ui/power-race.js.map +1 -0
- package/dist/ui/showcase/index.d.ts.map +1 -1
- package/dist/ui/showcase/index.js +45 -1
- package/dist/ui/showcase/index.js.map +1 -1
- package/dist/ui/styles.js +13 -0
- package/dist/ui/styles.js.map +1 -1
- package/dist/ui/subtitle.d.ts +27 -0
- package/dist/ui/subtitle.d.ts.map +1 -0
- package/dist/ui/subtitle.js +77 -0
- package/dist/ui/subtitle.js.map +1 -0
- package/dist/voice-gallery/index.d.ts +31 -0
- package/dist/voice-gallery/index.d.ts.map +1 -0
- package/dist/voice-gallery/index.js +276 -0
- package/dist/voice-gallery/index.js.map +1 -0
- package/dist/voiceover-editor/index.d.ts +8 -5
- package/dist/voiceover-editor/index.d.ts.map +1 -1
- package/dist/voiceover-editor/index.js +158 -76
- package/dist/voiceover-editor/index.js.map +1 -1
- package/package.json +5 -1
|
@@ -1,36 +1,64 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/**
|
|
2
|
+
* The 30 prebuilt voices (Gemini 2.5/3.1 flash TTS). `gender` is from Google's Chirp 3: HD /
|
|
3
|
+
* Gemini-TTS voice roster (docs.cloud.google.com/text-to-speech/docs/chirp3-hd), not inferred.
|
|
4
|
+
*/
|
|
2
5
|
export const GEMINI_VOICES = [
|
|
3
|
-
{ id: "Zephyr", label: "Zephyr
|
|
4
|
-
{ id: "Puck", label: "Puck
|
|
5
|
-
{ id: "Charon", label: "Charon
|
|
6
|
-
{ id: "Kore", label: "Kore
|
|
7
|
-
{ id: "Fenrir", label: "Fenrir
|
|
8
|
-
{ id: "Leda", label: "Leda
|
|
9
|
-
{ id: "Orus", label: "Orus
|
|
10
|
-
{ id: "Aoede", label: "Aoede
|
|
11
|
-
{ id: "Callirrhoe", label: "Callirrhoe
|
|
12
|
-
{ id: "Autonoe", label: "Autonoe
|
|
13
|
-
{ id: "Enceladus", label: "Enceladus
|
|
14
|
-
{ id: "Iapetus", label: "Iapetus
|
|
15
|
-
{ id: "Umbriel", label: "Umbriel
|
|
16
|
-
{ id: "Algieba", label: "Algieba
|
|
17
|
-
{ id: "Despina", label: "Despina
|
|
18
|
-
{ id: "Erinome", label: "Erinome
|
|
19
|
-
{ id: "Algenib", label: "Algenib
|
|
20
|
-
{ id: "Rasalgethi", label: "Rasalgethi
|
|
21
|
-
{ id: "Laomedeia", label: "Laomedeia
|
|
22
|
-
{ id: "Achernar", label: "Achernar
|
|
23
|
-
{ id: "Alnilam", label: "Alnilam
|
|
24
|
-
{ id: "Schedar", label: "Schedar
|
|
25
|
-
{ id: "Gacrux", label: "Gacrux
|
|
26
|
-
{ id: "Pulcherrima", label: "Pulcherrima
|
|
27
|
-
{ id: "Achird", label: "Achird
|
|
28
|
-
{ id: "Zubenelgenubi", label: "Zubenelgenubi
|
|
29
|
-
{ id: "Vindemiatrix", label: "Vindemiatrix
|
|
30
|
-
{ id: "Sadachbia", label: "Sadachbia
|
|
31
|
-
{ id: "Sadaltager", label: "Sadaltager
|
|
32
|
-
{ id: "Sulafat", label: "Sulafat
|
|
6
|
+
{ id: "Zephyr", label: "Zephyr · bright", gender: "female", persona: "Bright and airy; an upbeat guide" },
|
|
7
|
+
{ id: "Puck", label: "Puck · upbeat", gender: "male", persona: "Upbeat, playful; an energetic sidekick" },
|
|
8
|
+
{ id: "Charon", label: "Charon · informative", gender: "male", persona: "Informative, steady; a trustworthy narrator" },
|
|
9
|
+
{ id: "Kore", label: "Kore · firm", gender: "female", persona: "Firm, assured; a confident leader" },
|
|
10
|
+
{ id: "Fenrir", label: "Fenrir · excitable", gender: "male", persona: "Excitable, punchy; a hype coach" },
|
|
11
|
+
{ id: "Leda", label: "Leda · youthful", gender: "female", persona: "Youthful, spirited; a young hero" },
|
|
12
|
+
{ id: "Orus", label: "Orus · firm", gender: "male", persona: "Firm, grounded; a seasoned commander" },
|
|
13
|
+
{ id: "Aoede", label: "Aoede · breezy", gender: "female", persona: "Breezy, relaxed; an easygoing companion" },
|
|
14
|
+
{ id: "Callirrhoe", label: "Callirrhoe · easy-going", gender: "female", persona: "Easy-going, warm; a friendly host" },
|
|
15
|
+
{ id: "Autonoe", label: "Autonoe · bright", gender: "female", persona: "Bright, cheerful; a sunny presenter" },
|
|
16
|
+
{ id: "Enceladus", label: "Enceladus · breathy", gender: "male", persona: "Breathy, intimate; a close narrator" },
|
|
17
|
+
{ id: "Iapetus", label: "Iapetus · clear", gender: "male", persona: "Clear, crisp; a precise announcer" },
|
|
18
|
+
{ id: "Umbriel", label: "Umbriel · easy-going", gender: "male", persona: "Easy-going, mellow; a laid-back mentor" },
|
|
19
|
+
{ id: "Algieba", label: "Algieba · smooth", gender: "male", persona: "Smooth, mellow; a cool operator" },
|
|
20
|
+
{ id: "Despina", label: "Despina · smooth", gender: "female", persona: "Smooth, soft; a soothing guide" },
|
|
21
|
+
{ id: "Erinome", label: "Erinome · clear", gender: "female", persona: "Clear, articulate; a sharp presenter" },
|
|
22
|
+
{ id: "Algenib", label: "Algenib · gravelly", gender: "male", persona: "Gravelly, rugged; a grizzled veteran" },
|
|
23
|
+
{ id: "Rasalgethi", label: "Rasalgethi · informative", gender: "male", persona: "Informative, measured; an expert narrator" },
|
|
24
|
+
{ id: "Laomedeia", label: "Laomedeia · upbeat", gender: "female", persona: "Upbeat, lively; a cheerful cheerleader" },
|
|
25
|
+
{ id: "Achernar", label: "Achernar · soft", gender: "female", persona: "Soft, gentle; a tender voice" },
|
|
26
|
+
{ id: "Alnilam", label: "Alnilam · firm", gender: "male", persona: "Firm, commanding; a drill sergeant" },
|
|
27
|
+
{ id: "Schedar", label: "Schedar · even", gender: "male", persona: "Even, balanced; a calm anchor" },
|
|
28
|
+
{ id: "Gacrux", label: "Gacrux · mature", gender: "female", persona: "Mature, wise; an elder mentor" },
|
|
29
|
+
{ id: "Pulcherrima", label: "Pulcherrima · forward", gender: "female", persona: "Forward, bold; an assertive lead" },
|
|
30
|
+
{ id: "Achird", label: "Achird · friendly", gender: "male", persona: "Friendly, approachable; a loyal buddy" },
|
|
31
|
+
{ id: "Zubenelgenubi", label: "Zubenelgenubi · casual", gender: "male", persona: "Casual, conversational; an everyman" },
|
|
32
|
+
{ id: "Vindemiatrix", label: "Vindemiatrix · gentle", gender: "female", persona: "Gentle, calm; a reassuring guide" },
|
|
33
|
+
{ id: "Sadachbia", label: "Sadachbia · lively", gender: "male", persona: "Lively, animated; a spirited host" },
|
|
34
|
+
{ id: "Sadaltager", label: "Sadaltager · knowledgeable", gender: "male", persona: "Knowledgeable, authoritative; a mentor" },
|
|
35
|
+
{ id: "Sulafat", label: "Sulafat · warm", gender: "female", persona: "Warm, inviting; a comforting narrator" },
|
|
33
36
|
];
|
|
34
37
|
/** Default voice when a character has none set. */
|
|
35
38
|
export const DEFAULT_VOICE = "Charon";
|
|
39
|
+
export const VOICE_SAMPLE_LANGS = ["fr", "en"];
|
|
40
|
+
export const VOICE_SAMPLE_EMOTIONS = [
|
|
41
|
+
{ id: "dramatic", label: "Dramatic", style: "Dramatic, weighty, cinematic delivery" },
|
|
42
|
+
{ id: "excited", label: "Excited", style: "Excited, high energy, enthusiastic" },
|
|
43
|
+
{ id: "tense", label: "Tense", style: "Tense, urgent, on edge" },
|
|
44
|
+
];
|
|
45
|
+
/**
|
|
46
|
+
* The sentence each emotion is spoken with, per language. One line per emotion (the words carry the
|
|
47
|
+
* emotion) so a listener hears each voice's take on the same brief. French lines avoid first-person
|
|
48
|
+
* gendered agreement so they read correctly for both male and female voices.
|
|
49
|
+
*/
|
|
50
|
+
export const VOICE_SAMPLE_TEXT = {
|
|
51
|
+
dramatic: {
|
|
52
|
+
fr: "Soldat, le sort du monde repose sur tes épaules.",
|
|
53
|
+
en: "Soldier, the fate of the world rests on your shoulders.",
|
|
54
|
+
},
|
|
55
|
+
excited: {
|
|
56
|
+
fr: "Quel plaisir de te revoir, ça va être incroyable !",
|
|
57
|
+
en: "I'm so happy to see you again, this is going to be incredible!",
|
|
58
|
+
},
|
|
59
|
+
tense: {
|
|
60
|
+
fr: "On dirait que l'ennemi est tout près… fais attention !",
|
|
61
|
+
en: "It looks like the enemy is very close… watch out!",
|
|
62
|
+
},
|
|
63
|
+
};
|
|
36
64
|
//# sourceMappingURL=voices.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"voices.js","sourceRoot":"","sources":["../../src/conversations/voices.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"voices.js","sourceRoot":"","sources":["../../src/conversations/voices.ts"],"names":[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UAAU,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,uCAAuC,EAAE;IACrF,EAAE,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,oCAAoC,EAAE;IAChF,EAAE,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,wBAAwB,EAAE;CACjE,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAoD;IAChF,QAAQ,EAAE;QACR,EAAE,EAAE,kDAAkD;QACtD,EAAE,EAAE,yDAAyD;KAC9D;IACD,OAAO,EAAE;QACP,EAAE,EAAE,oDAAoD;QACxD,EAAE,EAAE,gEAAgE;KACrE;IACD,KAAK,EAAE;QACL,EAAE,EAAE,wDAAwD;QAC5D,EAAE,EAAE,mDAAmD;KACxD;CACF,CAAC"}
|
|
@@ -29,8 +29,8 @@ export interface VoiceCastEntry {
|
|
|
29
29
|
/** Default speaking-rate multiplier (see {@link DEFAULT_VOICEOVER_SPEED}). */
|
|
30
30
|
speed?: number;
|
|
31
31
|
}
|
|
32
|
-
/** Voice-over language. French
|
|
33
|
-
export type VoiceoverLang = "fr";
|
|
32
|
+
/** Voice-over language. French is the default; English is used by the voice-sample gallery. */
|
|
33
|
+
export type VoiceoverLang = "fr" | "en";
|
|
34
34
|
/**
|
|
35
35
|
* One spoken line. Authored fields: `id`/`characterId`/`text`/`style`/`lang`. Generated fields
|
|
36
36
|
* (`voice`/`audioHash`/`audioUrl`/`generatedAt`) are written by the voice-over editor after synthesis;
|
|
@@ -74,17 +74,22 @@ export interface Conversation {
|
|
|
74
74
|
/** ms timestamp of the last write. */
|
|
75
75
|
updatedAt?: number;
|
|
76
76
|
}
|
|
77
|
-
/**
|
|
77
|
+
/**
|
|
78
|
+
* A speaker + text as authored in game code (see `defineConversation`); `id`/`style`/`speed` optional.
|
|
79
|
+
* These are the code FALLBACK: at runtime the voice-over editor's stored (edited) values win, and `text`
|
|
80
|
+
* is what "eject to code" refreshes. Code still owns which line ids exist and their order.
|
|
81
|
+
*/
|
|
78
82
|
export interface ConversationSpecLine {
|
|
79
83
|
/** Speaker character id ({@link CatalogCharacter.id}) or an arbitrary casting key. */
|
|
80
84
|
speaker: string;
|
|
81
|
-
/** The spoken text (French)
|
|
85
|
+
/** The spoken text (French) — the code fallback; the editor's edited text wins at runtime, and "eject
|
|
86
|
+
* to code" ({@link ConversationLine} → source) refreshes this field. */
|
|
82
87
|
text: string;
|
|
83
|
-
/** Explicit stable line id; defaults to positional `"<conversationId>:<index>"`. */
|
|
88
|
+
/** Explicit stable line id; defaults to positional `"<conversationId>:<index>"`. Code owns line ids. */
|
|
84
89
|
id?: string;
|
|
85
|
-
/** Per-line extra delivery direction (merged after the character context). Code-
|
|
90
|
+
/** Per-line extra delivery direction (merged after the character context). Code fallback; editor-editable. */
|
|
86
91
|
style?: string;
|
|
87
|
-
/** Per-line speaking-rate multiplier. Code
|
|
92
|
+
/** Per-line speaking-rate multiplier. Code fallback; edited in the voice-over editor (which wins at runtime). */
|
|
88
93
|
speed?: number;
|
|
89
94
|
}
|
|
90
95
|
/** Resolve the effective voice for a line given its speaker character. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversations.d.ts","sourceRoot":"","sources":["../../src/protocol/conversations.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAExD,sEAAsE;AACtE,eAAO,MAAM,wBAAwB,kBAAkB,CAAC;AAExD;;8FAE8F;AAC9F,eAAO,MAAM,qBAAqB,eAAe,CAAC;AAElD;oFACoF;AACpF,eAAO,MAAM,uBAAuB,MAAM,CAAC;AAE3C;6FAC6F;AAC7F,MAAM,WAAW,cAAc;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,qFAAqF;IACrF,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,8EAA8E;IAC9E,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED
|
|
1
|
+
{"version":3,"file":"conversations.d.ts","sourceRoot":"","sources":["../../src/protocol/conversations.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAExD,sEAAsE;AACtE,eAAO,MAAM,wBAAwB,kBAAkB,CAAC;AAExD;;8FAE8F;AAC9F,eAAO,MAAM,qBAAqB,eAAe,CAAC;AAElD;oFACoF;AACpF,eAAO,MAAM,uBAAuB,MAAM,CAAC;AAE3C;6FAC6F;AAC7F,MAAM,WAAW,cAAc;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,qFAAqF;IACrF,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,8EAA8E;IAC9E,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,+FAA+F;AAC/F,MAAM,MAAM,aAAa,GAAG,IAAI,GAAG,IAAI,CAAC;AAExC;;;;GAIG;AACH,MAAM,WAAW,gBAAgB;IAC/B;0FACsF;IACtF,EAAE,EAAE,MAAM,CAAC;IACX,2FAA2F;IAC3F,WAAW,EAAE,MAAM,CAAC;IACpB,gCAAgC;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,mGAAmG;IACnG,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;mGAC+F;IAC/F,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,aAAa,CAAC;IACpB,8GAA8G;IAC9G,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,kFAAkF;IAClF,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,4EAA4E;IAC5E,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,qDAAqD;IACrD,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,iFAAiF;AACjF,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,sDAAsD;IACtD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,gBAAgB,EAAE,CAAC;IAC1B;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,sCAAsC;IACtC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;GAIG;AACH,MAAM,WAAW,oBAAoB;IACnC,sFAAsF;IACtF,OAAO,EAAE,MAAM,CAAC;IAChB;6EACyE;IACzE,IAAI,EAAE,MAAM,CAAC;IACb,wGAAwG;IACxG,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,8GAA8G;IAC9G,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,iHAAiH;IACjH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,0EAA0E;AAC1E,wBAAgB,QAAQ,CAAC,SAAS,EAAE,gBAAgB,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAE3F;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,EAAE,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAE7F"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversations.js","sourceRoot":"","sources":["../../src/protocol/conversations.ts"],"names":[],"mappings":"AAcA,sEAAsE;AACtE,MAAM,CAAC,MAAM,wBAAwB,GAAG,eAAe,CAAC;AAExD;;8FAE8F;AAC9F,MAAM,CAAC,MAAM,qBAAqB,GAAG,YAAY,CAAC;AAElD;oFACoF;AACpF,MAAM,CAAC,MAAM,uBAAuB,GAAG,GAAG,CAAC;
|
|
1
|
+
{"version":3,"file":"conversations.js","sourceRoot":"","sources":["../../src/protocol/conversations.ts"],"names":[],"mappings":"AAcA,sEAAsE;AACtE,MAAM,CAAC,MAAM,wBAAwB,GAAG,eAAe,CAAC;AAExD;;8FAE8F;AAC9F,MAAM,CAAC,MAAM,qBAAqB,GAAG,YAAY,CAAC;AAElD;oFACoF;AACpF,MAAM,CAAC,MAAM,uBAAuB,GAAG,GAAG,CAAC;AA+E3C,0EAA0E;AAC1E,MAAM,UAAU,QAAQ,CAAC,SAA8C;IACrE,OAAO,SAAS,EAAE,KAAK,CAAC;AAC1B,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,cAAc,CAAC,OAA2B,EAAE,KAAyB;IACnF,OAAO,CAAC,OAAO,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACrE,CAAC"}
|
|
@@ -9,5 +9,5 @@
|
|
|
9
9
|
export declare const RYDR_PROTOCOL_VERSION: 14;
|
|
10
10
|
/** Semver of this SDK build. Sent in the handshake for telemetry/debugging.
|
|
11
11
|
* (Bumped to 2.0.0 by `npm version major` on release — see CHANGELOG [Unreleased].) */
|
|
12
|
-
export declare const RYDR_SDK_VERSION = "3.
|
|
12
|
+
export declare const RYDR_SDK_VERSION = "3.11.0";
|
|
13
13
|
//# sourceMappingURL=version.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/protocol/version.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAmCH,eAAO,MAAM,qBAAqB,EAAG,EAAW,CAAC;AAEjD;wFACwF;AACxF,eAAO,MAAM,gBAAgB,
|
|
1
|
+
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/protocol/version.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAmCH,eAAO,MAAM,qBAAqB,EAAG,EAAW,CAAC;AAEjD;wFACwF;AACxF,eAAO,MAAM,gBAAgB,WAAW,CAAC"}
|
package/dist/protocol/version.js
CHANGED
|
@@ -43,5 +43,5 @@
|
|
|
43
43
|
export const RYDR_PROTOCOL_VERSION = 14;
|
|
44
44
|
/** Semver of this SDK build. Sent in the handshake for telemetry/debugging.
|
|
45
45
|
* (Bumped to 2.0.0 by `npm version major` on release — see CHANGELOG [Unreleased].) */
|
|
46
|
-
export const RYDR_SDK_VERSION = "3.
|
|
46
|
+
export const RYDR_SDK_VERSION = "3.11.0";
|
|
47
47
|
//# sourceMappingURL=version.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/protocol/version.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,8FAA8F;AAC9F,yDAAyD;AACzD,4FAA4F;AAC5F,oGAAoG;AACpG,kGAAkG;AAClG,6EAA6E;AAC7E,kGAAkG;AAClG,uGAAuG;AACvG,wFAAwF;AACxF,oGAAoG;AACpG,gGAAgG;AAChG,yFAAyF;AACzF,kHAAkH;AAClH,oGAAoG;AACpG,qGAAqG;AACrG,kGAAkG;AAClG,mGAAmG;AACnG,oGAAoG;AACpG,6FAA6F;AAC7F,gGAAgG;AAChG,uGAAuG;AACvG,mGAAmG;AACnG,kGAAkG;AAClG,+FAA+F;AAC/F,kGAAkG;AAClG,iGAAiG;AACjG,iGAAiG;AACjG,+FAA+F;AAC/F,qGAAqG;AACrG,uGAAuG;AACvG,+FAA+F;AAC/F,qGAAqG;AACrG,kGAAkG;AAClG,2BAA2B;AAC3B,MAAM,CAAC,MAAM,qBAAqB,GAAG,EAAW,CAAC;AAEjD;wFACwF;AACxF,MAAM,CAAC,MAAM,gBAAgB,GAAG,
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/protocol/version.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,8FAA8F;AAC9F,yDAAyD;AACzD,4FAA4F;AAC5F,oGAAoG;AACpG,kGAAkG;AAClG,6EAA6E;AAC7E,kGAAkG;AAClG,uGAAuG;AACvG,wFAAwF;AACxF,oGAAoG;AACpG,gGAAgG;AAChG,yFAAyF;AACzF,kHAAkH;AAClH,oGAAoG;AACpG,qGAAqG;AACrG,kGAAkG;AAClG,mGAAmG;AACnG,oGAAoG;AACpG,6FAA6F;AAC7F,gGAAgG;AAChG,uGAAuG;AACvG,mGAAmG;AACnG,kGAAkG;AAClG,+FAA+F;AAC/F,kGAAkG;AAClG,iGAAiG;AACjG,iGAAiG;AACjG,+FAA+F;AAC/F,qGAAqG;AACrG,uGAAuG;AACvG,+FAA+F;AAC/F,qGAAqG;AACrG,kGAAkG;AAClG,2BAA2B;AAC3B,MAAM,CAAC,MAAM,qBAAqB,GAAG,EAAW,CAAC;AAEjD;wFACwF;AACxF,MAAM,CAAC,MAAM,gBAAgB,GAAG,QAAQ,CAAC"}
|
package/dist/ui/README.md
CHANGED
|
@@ -44,8 +44,10 @@ feed its `{x, y, onScreen}` into `setScreenPos`/`setVisible` — don't compute p
|
|
|
44
44
|
| `mountActionDiamond(host, opts)` | fn | The full 4-button A/B/Y/Z diamond with per-button labels/actions. |
|
|
45
45
|
| `mountLabeledDiamond(host, opts)` | fn | A diamond floating over a point with labels around it (the "actions on offer" affordance). |
|
|
46
46
|
| `mountDialogueCard(host, opts)` | fn | An NPC dialogue box: speaker name, typed-out line, advance cue (A). |
|
|
47
|
+
| `mountSubtitle(host, opts)` | fn | A boxless, self-dismissing caption (the voice-over "auto" look): big centred line + speaker name, no frame. `anchor`/`offset` place it; `showName` toggles the name. |
|
|
47
48
|
| `mountChoiceCard(host, opts)` | fn | A player choice menu: prompt + highlighted option list (▲▼ move, A confirm). |
|
|
48
49
|
| `mountRarityCard(host, opts)` / `buildRarityCard(opts)` | fn | A generic rarity-tinted item/creature card. |
|
|
50
|
+
| `createPowerRace(opts)` | fn | A timed **power-vs-deadline race** overlay — the "push NOW or lose it" beat. A charge bar (∫power dt) races a clock; first to 100% wins. `start()` then `setPower(w)`+`tick(dt)` per frame; `won`/`lost` via `onResolve`. Recolour with `theme`, relabel with `text`. |
|
|
49
51
|
| `injectCss()` | fn | Force the `.rydr-ui-*` CSS into `<head>` early (components call it for you). |
|
|
50
52
|
|
|
51
53
|
Types: `ButtonLetter` (`"A"\|"B"\|"Y"\|"Z"`), `DirButton`, `KeycapVariant` (`"full"\|"solo"`),
|
package/dist/ui/index.d.ts
CHANGED
|
@@ -26,7 +26,9 @@ export * from "./card.js";
|
|
|
26
26
|
export * from "./action-card.js";
|
|
27
27
|
export * from "./action-diamond.js";
|
|
28
28
|
export * from "./dialogue-card.js";
|
|
29
|
+
export * from "./subtitle.js";
|
|
29
30
|
export * from "./choice-card.js";
|
|
30
31
|
export * from "./labeled-diamond.js";
|
|
31
32
|
export * from "./rarity-card.js";
|
|
33
|
+
export * from "./power-race.js";
|
|
32
34
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/ui/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ui/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ui/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC"}
|
package/dist/ui/index.js
CHANGED
|
@@ -26,7 +26,9 @@ export * from "./card.js";
|
|
|
26
26
|
export * from "./action-card.js";
|
|
27
27
|
export * from "./action-diamond.js";
|
|
28
28
|
export * from "./dialogue-card.js";
|
|
29
|
+
export * from "./subtitle.js";
|
|
29
30
|
export * from "./choice-card.js";
|
|
30
31
|
export * from "./labeled-diamond.js";
|
|
31
32
|
export * from "./rarity-card.js";
|
|
33
|
+
export * from "./power-race.js";
|
|
32
34
|
//# sourceMappingURL=index.js.map
|
package/dist/ui/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ui/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ui/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `createPowerRace` — a timed power-race HUD: two bars race each other.
|
|
3
|
+
*
|
|
4
|
+
* · deadline bar — fills at a constant rate over `durationS` (the clock closing in).
|
|
5
|
+
* · charge bar — fills from accumulated effort (∫ power dt) toward
|
|
6
|
+
* `requiredJoules = targetFtpPct × ftp × durationS`.
|
|
7
|
+
*
|
|
8
|
+
* If the charge bar reaches 100% before the deadline bar does, the rider **wins**; otherwise the
|
|
9
|
+
* clock **wins** (the rider loses). Pacing is free — only total work matters. This is the canonical
|
|
10
|
+
* "push NOW or lose it" beat: a surge you must out-pedal before a timer runs out. It began as
|
|
11
|
+
* Tower-Defense's nuke-intercept mini-game and VIVAX's Vivapierre charge; both are the same widget.
|
|
12
|
+
*
|
|
13
|
+
* Pass `mode: "charge"` for the **no-rival** variant — a solo "charge this up" with no deadline bar and
|
|
14
|
+
* no clock that can beat you (it only resolves `won`, on fill). Same visuals, calmer framing.
|
|
15
|
+
*
|
|
16
|
+
* Self-contained DOM/CSS (no three.js), like the rest of `@rydr/game-sdk/ui`: it injects its own
|
|
17
|
+
* scoped `.rpr-*` stylesheet once into `<head>`. It takes **power values**, not a `session` — the
|
|
18
|
+
* game owns its loop and feeds watts in. FTP-relative by construction (`ftp` sets the bar to clear),
|
|
19
|
+
* so a 150 W and a 350 W rider face the same challenge — never hard-code a raw-watt threshold.
|
|
20
|
+
*
|
|
21
|
+
* ── Sizing contract (same as the rest of the kit) ──────────────────────────────────────────────
|
|
22
|
+
* Tuned for a trainer screen viewed from a few feet away while pedaling. Don't restyle the `.rpr-*`
|
|
23
|
+
* type sizes / dimensions or wrap it in `transform: scale()`. Recolour it with the `theme` option and
|
|
24
|
+
* relabel it with `text` — those are the customization surface; the layout is fixed.
|
|
25
|
+
* ────────────────────────────────────────────────────────────────────────────────────────────────
|
|
26
|
+
*
|
|
27
|
+
* Driving it: `start()`, then pump `setPower(w)` + `tick(dt)` every frame. The HUD self-resolves to
|
|
28
|
+
* `won` / `lost` when either bar crosses 100%; poll `getPhase()` or pass `onResolve`. Drive external
|
|
29
|
+
* VFX (a glow, a light) off `getProgress().charge`.
|
|
30
|
+
*/
|
|
31
|
+
/** Layout of the two bars. All three drive the same class hooks. */
|
|
32
|
+
export type PowerRaceVariant = "twin-stacked" | "twin-towers" | "single-track";
|
|
33
|
+
/** Where the live precision % sits (or `null` to hide it). */
|
|
34
|
+
export type PowerRaceScoreVariant = "tip" | "impact" | "above" | "infill";
|
|
35
|
+
/** The internal phase machine; `won`/`lost` are the resolved outcomes. */
|
|
36
|
+
export type PowerRacePhase = "idle" | "priming-warning" | "priming-prompt" | "priming-bars" | "racing" | "won" | "lost";
|
|
37
|
+
/** The two terminal outcomes. */
|
|
38
|
+
export type PowerRaceOutcome = "won" | "lost";
|
|
39
|
+
/** Total intro duration in seconds. */
|
|
40
|
+
export declare const INTRO_TOTAL_S: number;
|
|
41
|
+
/**
|
|
42
|
+
* The six palette colours, driven into the component as CSS custom properties. Each bar is a
|
|
43
|
+
* `deep → bright` gradient; the win state recolours the charge bar green. The default is the original
|
|
44
|
+
* "alert" skin (red clock, cyan effort, green win); pass a `theme` (any subset) to recolour.
|
|
45
|
+
*/
|
|
46
|
+
export interface PowerRaceTheme {
|
|
47
|
+
/** Deadline (clock) bar bright end + all its labels/glows. */
|
|
48
|
+
deadline: string;
|
|
49
|
+
/** Deadline bar gradient dark end. */
|
|
50
|
+
deadlineDeep: string;
|
|
51
|
+
/** Charge (effort) bar bright end + its label/glow. */
|
|
52
|
+
charge: string;
|
|
53
|
+
/** Charge bar gradient dark end. */
|
|
54
|
+
chargeDeep: string;
|
|
55
|
+
/** Win state bright end (the charge bar on a win + the "won" stamp). */
|
|
56
|
+
win: string;
|
|
57
|
+
/** Win state gradient dark end. */
|
|
58
|
+
winDeep: string;
|
|
59
|
+
}
|
|
60
|
+
/** The built-in "alert" skin — the proven Tower-Defense look. Default when no `theme` is passed. */
|
|
61
|
+
export declare const DEFAULT_POWER_RACE_THEME: Required<PowerRaceTheme>;
|
|
62
|
+
/** Every user-facing string. Defaults reproduce the original alert copy; override per game. */
|
|
63
|
+
export interface PowerRaceText {
|
|
64
|
+
heading?: string;
|
|
65
|
+
prompt?: string;
|
|
66
|
+
deadlineLabel?: string;
|
|
67
|
+
chargeLabel?: string;
|
|
68
|
+
win?: string;
|
|
69
|
+
lose?: string;
|
|
70
|
+
}
|
|
71
|
+
export interface PowerRaceOpts {
|
|
72
|
+
/** Rider FTP — sets the effort target (`requiredJoules`). Always FTP-relative; never a raw threshold. */
|
|
73
|
+
ftp?: number;
|
|
74
|
+
/** How long the deadline bar takes to fill (seconds). Default 5. */
|
|
75
|
+
durationS?: number;
|
|
76
|
+
/** Effort target as a fraction of FTP: `requiredJoules = targetFtpPct × ftp × durationS`. Default 1.1. */
|
|
77
|
+
targetFtpPct?: number;
|
|
78
|
+
/**
|
|
79
|
+
* `"race"` (default) — a rival **deadline** bar races you; you lose if it fills first (the "push NOW
|
|
80
|
+
* or lose it" beat). `"charge"` — **no rival**: you just fill the charge bar (a solo "charge this
|
|
81
|
+
* up"). In charge mode the deadline bar is hidden, the alarm framing is calmed (no red klaxon
|
|
82
|
+
* strobe), and the widget only ever resolves `won` on its own (charge → 100%). There's no built-in
|
|
83
|
+
* clock, so a rider can charge at their own pace; a game that wants a *failure* (e.g. the rider was
|
|
84
|
+
* downed, or a scene timeout) drives it with `showResolution("lost")`. `durationS` still sets how
|
|
85
|
+
* much work fills the bar (`requiredJoules`); it just isn't a losing clock. Relabel the alarm copy
|
|
86
|
+
* for a charge with `text` (e.g. `heading: "CHARGING"`, `prompt: "PUSH TO CHARGE"`).
|
|
87
|
+
*/
|
|
88
|
+
mode?: "race" | "charge";
|
|
89
|
+
/** Bar layout. Default `twin-stacked`. */
|
|
90
|
+
variant?: PowerRaceVariant;
|
|
91
|
+
/** Live precision-% placement, or `null`/omitted to hide it. */
|
|
92
|
+
scoreVariant?: PowerRaceScoreVariant | null;
|
|
93
|
+
/** All user-facing strings (any subset). */
|
|
94
|
+
text?: PowerRaceText;
|
|
95
|
+
/** Palette override (any subset). Defaults to {@link DEFAULT_POWER_RACE_THEME}. */
|
|
96
|
+
theme?: Partial<PowerRaceTheme>;
|
|
97
|
+
/** Called once when the race resolves. Same signal as polling `getPhase()`. */
|
|
98
|
+
onResolve?: (outcome: PowerRaceOutcome) => void;
|
|
99
|
+
}
|
|
100
|
+
export interface PowerRaceHud {
|
|
101
|
+
/** The overlay root — append it to your HUD layer. */
|
|
102
|
+
element: HTMLElement;
|
|
103
|
+
/** Begin the priming intro, then the race. */
|
|
104
|
+
start(): void;
|
|
105
|
+
/** Feed the current power (watts) each frame. */
|
|
106
|
+
setPower(w: number): void;
|
|
107
|
+
/** Current phase; `won`/`lost` once resolved. */
|
|
108
|
+
getPhase(): PowerRacePhase;
|
|
109
|
+
/** Live bar fills 0..1 — drive external VFX (e.g. a glow) off `charge`. */
|
|
110
|
+
getProgress(): {
|
|
111
|
+
deadline: number;
|
|
112
|
+
charge: number;
|
|
113
|
+
};
|
|
114
|
+
/** Advance one frame; returns the (possibly new) phase. Self-resolves + fires `onResolve`. */
|
|
115
|
+
tick(dt: number): PowerRacePhase;
|
|
116
|
+
/** Force a resolution (e.g. an externally decided outcome), optionally auto-hiding after `durationS`. */
|
|
117
|
+
showResolution(outcome: PowerRaceOutcome, opts?: {
|
|
118
|
+
durationS?: number;
|
|
119
|
+
}): void;
|
|
120
|
+
/** Back to idle (hidden, bars cleared) for reuse. */
|
|
121
|
+
reset(): void;
|
|
122
|
+
dispose(): void;
|
|
123
|
+
}
|
|
124
|
+
export declare function createPowerRace(opts?: PowerRaceOpts): PowerRaceHud;
|
|
125
|
+
//# sourceMappingURL=power-race.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"power-race.d.ts","sourceRoot":"","sources":["../../src/ui/power-race.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAIH,oEAAoE;AACpE,MAAM,MAAM,gBAAgB,GAAG,cAAc,GAAG,aAAa,GAAG,cAAc,CAAC;AAC/E,8DAA8D;AAC9D,MAAM,MAAM,qBAAqB,GAAG,KAAK,GAAG,QAAQ,GAAG,OAAO,GAAG,QAAQ,CAAC;AAC1E,0EAA0E;AAC1E,MAAM,MAAM,cAAc,GACtB,MAAM,GACN,iBAAiB,GACjB,gBAAgB,GA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