@indiegems/gem-web-sdk 15.1.2 → 15.3.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/CHANGELOG.md +18 -0
- package/dist/conformance.d.ts +50 -0
- package/dist/game.d.ts +2 -0
- package/dist/gem-web-sdk.bridge.js +1 -1
- package/dist/gem-web-sdk.conformance.js +4 -0
- package/dist/gem-web-sdk.esm.js +1 -1
- package/dist/gem-web-sdk.function.js +1 -1
- package/dist/gem-web-sdk.game.js +3 -3
- package/dist/gem-web-sdk.min.js +2 -2
- package/dist/gem-web-sdk.sdk.js +2 -2
- package/dist/gem-web-sdk.server.js +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/sdk.d.ts +2 -0
- package/docs/api/api-reference-function.md +1 -1
- package/docs/api/api-reference-game.md +26 -7
- package/docs/api/api-reference-server.md +1 -1
- package/docs/api/reference.json +20 -4
- package/docs/changelog.md +18 -0
- package/docs/getting-started.md +3 -3
- package/docs/manifest.json +8 -8
- package/docs/server-bundles.md +2 -2
- package/docs/what-a-game-must-do.md +28 -16
- package/package.json +5 -1
- package/schema/bridge.v1.json +28 -4
|
@@ -53,8 +53,10 @@ No `baseUrl`. The Arcade names the backend on every token and the SDK routes the
|
|
|
53
53
|
tokens only if its origin is allowed, and the pages that matter are always allowed without a word
|
|
54
54
|
from you:
|
|
55
55
|
|
|
56
|
-
- **the Gem Arcade website and app** — the SDK carries their origins as
|
|
57
|
-
platform the app runs on
|
|
56
|
+
- **the Gem Arcade website, developer site and app** — the SDK carries their origins as
|
|
57
|
+
`ARCADE_EMBEDDERS`, on every platform the app runs on. The developer site,
|
|
58
|
+
`https://developer.gemarcade.com`, is where you play your own dev and test builds; a build accepts
|
|
59
|
+
it once it is built with an SDK that lists it;
|
|
58
60
|
- **a dev host on your own machine** — `gemctl serve` and the Gem Editor frame a locally-served game
|
|
59
61
|
from a loopback origin whose port changes every run, and the SDK admits that shape by rule, only
|
|
60
62
|
while your game itself is served from loopback. Once published, nothing about the rule applies.
|
|
@@ -1074,19 +1076,20 @@ The player sets their defaults once, in the Arcade's Settings, separately for ea
|
|
|
1074
1076
|
and a television can say different things. They reach your game as `gem.prefs.recommended`, in the
|
|
1075
1077
|
same push as `muted` and `reducedMotion`, and again whenever the player changes one:
|
|
1076
1078
|
|
|
1077
|
-
| Field | Values | What it suggests
|
|
1078
|
-
| ------------------------ | ------------------------------- |
|
|
1079
|
-
| `volume` | `0` to `100` | Your master volume's starting level, as a percentage — divide by 100 for a gain. A level, never a mute.
|
|
1080
|
-
| `batterySaver` | `true` / `false` | Spend less power: a lower frame rate, fewer effects, a lower resolution.
|
|
1081
|
-
| `keyboardLayout` | `'wasd'` / `'arrows'` | Which keys move by default.
|
|
1082
|
-
| `gamepadConfirm` | `'south'` / `'east'` | Which face button confirms, by position: the bottom one (A on an Xbox controller) or the right one (B). The other one goes back.
|
|
1083
|
-
| `vibration` | `true` / `false` | Your vibration toggle's starting state ([if your game vibrates](#if-your-game-vibrates)).
|
|
1084
|
-
| `lookSensitivity` | `20` to `400` | Look speed for touch, mouse and pen, as a percentage of the base speeds: `100` is 1×.
|
|
1085
|
-
| `gamepadLookSensitivity` | `20` to `400` | Look speed for a gamepad stick, as a percentage: `100` is 1×.
|
|
1086
|
-
| `invertLookY` | `true` / `false` | Up/down look inverted: pushing up or dragging up looks down. Pitch only, never yaw.
|
|
1087
|
-
| `touchMovement` | `'floating'` / `'fixed'` | On a touch screen, a movement stick that appears where the thumb lands, or one fixed in place.
|
|
1088
|
-
| `graphicsQuality` | `'low'` / `'medium'` / `'high'` | The graphics quality to start at on this device.
|
|
1089
|
-
| `graphicsQualityAuto` | `true` / `false` | `true`: the Arcade picked that tier for this device, so you may adapt from it. `false`: the player picked it, so hold it.
|
|
1079
|
+
| Field | Values | What it suggests |
|
|
1080
|
+
| ------------------------ | ------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ |
|
|
1081
|
+
| `volume` | `0` to `100` | Your master volume's starting level, as a percentage — divide by 100 for a gain. A level, never a mute. |
|
|
1082
|
+
| `batterySaver` | `true` / `false` | Spend less power: a lower frame rate, fewer effects, a lower resolution. |
|
|
1083
|
+
| `keyboardLayout` | `'wasd'` / `'arrows'` | Which keys move by default. |
|
|
1084
|
+
| `gamepadConfirm` | `'south'` / `'east'` | Which face button confirms, by position: the bottom one (A on an Xbox controller) or the right one (B). The other one goes back. |
|
|
1085
|
+
| `vibration` | `true` / `false` | Your vibration toggle's starting state ([if your game vibrates](#if-your-game-vibrates)). |
|
|
1086
|
+
| `lookSensitivity` | `20` to `400` | Look speed for touch, mouse and pen, as a percentage of the base speeds: `100` is 1×. |
|
|
1087
|
+
| `gamepadLookSensitivity` | `20` to `400` | Look speed for a gamepad stick, as a percentage: `100` is 1×. |
|
|
1088
|
+
| `invertLookY` | `true` / `false` | Up/down look inverted: pushing up or dragging up looks down. Pitch only, never yaw. |
|
|
1089
|
+
| `touchMovement` | `'floating'` / `'fixed'` | On a touch screen, a movement stick that appears where the thumb lands, or one fixed in place. |
|
|
1090
|
+
| `graphicsQuality` | `'low'` / `'medium'` / `'high'` | The graphics quality to start at on this device. |
|
|
1091
|
+
| `graphicsQualityAuto` | `true` / `false` | `true`: the Arcade picked that tier for this device, so you may adapt from it. `false`: the player picked it, so hold it. |
|
|
1092
|
+
| `colorHelp` | `true` / `false` / `null` | Color help: start your colour-blind aids (patterns or symbols beside colours, a colour-blind palette) on, or off. `null`: no advice. |
|
|
1090
1093
|
|
|
1091
1094
|
`lookSensitivity` to `touchMovement` are the camera and controls settings: see
|
|
1092
1095
|
[camera and look controls](#camera-and-look-controls) for `gem.controls.look()`, which applies the
|
|
@@ -1096,7 +1099,15 @@ older Arcade sends `recommended` without them; the SDK then fills each with its
|
|
|
1096
1099
|
[graphics quality](#graphics-quality-the-arcade-picks-the-start-your-game-adapts). An older Arcade
|
|
1097
1100
|
sends neither; the SDK then fills `graphicsQuality` from `batterySaver` (`'low'` when it is on,
|
|
1098
1101
|
`'medium'` otherwise) and `graphicsQualityAuto` with `true`, and reads a tier it does not know as
|
|
1099
|
-
`'medium'`. So whenever `recommended` is not `null`,
|
|
1102
|
+
`'medium'`. So whenever `recommended` is not `null`, those eleven fields are there.
|
|
1103
|
+
|
|
1104
|
+
`colorHelp` is the player's **Color help** default, and the one field the SDK does not fill: an
|
|
1105
|
+
older Arcade omits it and you read `null`, which means the Arcade made **no recommendation** — not
|
|
1106
|
+
`false`. Keep your own default then. A game that offers colour-blind aids starts them from it, on
|
|
1107
|
+
first run or while the player has not chosen in your game, and never lets it override the player's
|
|
1108
|
+
own choice; it is the natural start for the `toggle` you declare with `icon: 'eye'`
|
|
1109
|
+
([the Arcade's quick row](#mirror-your-settings-into-the-arcades-menu-gemsettings)). A game with
|
|
1110
|
+
no such aids ignores it.
|
|
1100
1111
|
|
|
1101
1112
|
**They are recommendations, and the player's own choice in your game always wins:**
|
|
1102
1113
|
|
|
@@ -1124,6 +1135,7 @@ const DEFAULTS = {
|
|
|
1124
1135
|
invertLookY: false,
|
|
1125
1136
|
touchMovement: 'floating',
|
|
1126
1137
|
graphicsQuality: 'medium',
|
|
1138
|
+
colorHelp: false, // your own default; `recommended.colorHelp` is null when the Arcade said nothing
|
|
1127
1139
|
};
|
|
1128
1140
|
let chosen = {}; // ONLY what the player picked in your settings screen
|
|
1129
1141
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@indiegems/gem-web-sdk",
|
|
3
|
-
"version": "15.
|
|
3
|
+
"version": "15.3.0",
|
|
4
4
|
"description": "postMessage bridge contract between gem-web and browser-playable games",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"type": "module",
|
|
@@ -39,6 +39,10 @@
|
|
|
39
39
|
"types": "./dist/quality.d.ts",
|
|
40
40
|
"import": "./dist/gem-web-sdk.quality.js"
|
|
41
41
|
},
|
|
42
|
+
"./conformance": {
|
|
43
|
+
"types": "./dist/conformance.d.ts",
|
|
44
|
+
"import": "./dist/gem-web-sdk.conformance.js"
|
|
45
|
+
},
|
|
42
46
|
"./schema": "./schema/bridge.v1.json",
|
|
43
47
|
"./schema/moment-log-line.json": "./schema/moment-log-line.json",
|
|
44
48
|
"./brand/*": "./brand/*",
|
package/schema/bridge.v1.json
CHANGED
|
@@ -972,10 +972,11 @@
|
|
|
972
972
|
"The player's ARCADE-WIDE DEFAULTS for this device, which the Arcade",
|
|
973
973
|
"keeps in its own Settings: a starting volume, battery saver, a keyboard",
|
|
974
974
|
"layout, the gamepad's confirm button, vibration, the camera and",
|
|
975
|
-
"controls settings
|
|
976
|
-
"ONLY. The game's own saved settings win: a game starts
|
|
977
|
-
"here only while the player has made no choice of their
|
|
978
|
-
"game, and never overwrites one the player made because
|
|
975
|
+
"controls settings, a starting graphics quality and Color help.",
|
|
976
|
+
"RECOMMENDATIONS ONLY. The game's own saved settings win: a game starts",
|
|
977
|
+
"a setting from here only while the player has made no choice of their",
|
|
978
|
+
"own in that game, and never overwrites one the player made because",
|
|
979
|
+
"this changed.",
|
|
979
980
|
"A game may ignore it entirely.",
|
|
980
981
|
"",
|
|
981
982
|
"OPTIONAL because it is additive: a parent that predates it sends the",
|
|
@@ -1002,6 +1003,10 @@
|
|
|
1002
1003
|
"(`low` when it is on, `medium` otherwise) and `graphicsQualityAuto`",
|
|
1003
1004
|
"with true, so on the game side both are present whenever the object is.",
|
|
1004
1005
|
"",
|
|
1006
|
+
"`colorHelp` IS OPTIONAL INSIDE IT AND STAYS ABSENT (owner decision",
|
|
1007
|
+
"2026-10-23): the SDK does NOT fill it. An older parent omits it and the",
|
|
1008
|
+
"game reads `null`, \"no recommendation\", never false.",
|
|
1009
|
+
"",
|
|
1005
1010
|
"`muted`, `reducedMotion` and `showFrameStats` stay where they are, at",
|
|
1006
1011
|
"the top of this message, and keep their meaning: they are the Arcade's",
|
|
1007
1012
|
"own state the frame acts on, not a recommendation. The Arcade starts",
|
|
@@ -1103,6 +1108,25 @@
|
|
|
1103
1108
|
"kind": "boolean",
|
|
1104
1109
|
"optional": true,
|
|
1105
1110
|
"$comment": "True when the Arcade detected `graphicsQuality` for this device (the player left Graphics on Auto), so the game may step its quality up or down from there as it measures frames; false when the player picked it by hand, so the game holds it and changes it only when the player does (in the Arcade or in the game's own settings). Default true when absent."
|
|
1111
|
+
},
|
|
1112
|
+
"colorHelp": {
|
|
1113
|
+
"kind": "boolean",
|
|
1114
|
+
"optional": true,
|
|
1115
|
+
"$comment": [
|
|
1116
|
+
"The player's Arcade-wide Color help default for this device (owner",
|
|
1117
|
+
"decision 2026-10-23): true asks a game that offers colour-blind aids",
|
|
1118
|
+
"-- patterns or symbols beside colours, a colour-blind palette -- to",
|
|
1119
|
+
"start with them ON; false asks it to start with them off. A DEFAULT",
|
|
1120
|
+
"ONLY, like every field here: a game applies it on first run, or",
|
|
1121
|
+
"while the player has made no choice of their own in that game, and",
|
|
1122
|
+
"never overrides the player's in-game choice. A game with no such",
|
|
1123
|
+
"aids ignores it.",
|
|
1124
|
+
"",
|
|
1125
|
+
"ABSENT IS NOT FALSE. A parent built against an older SDK omits it,",
|
|
1126
|
+
"and that absence means the Arcade made no recommendation: the SDK",
|
|
1127
|
+
"reports `null` and the game keeps its own default. Unlike the",
|
|
1128
|
+
"camera and controls fields there is no neutral value to invent."
|
|
1129
|
+
]
|
|
1106
1130
|
}
|
|
1107
1131
|
}
|
|
1108
1132
|
}
|