@indiegems/gem-web-sdk 7.7.0 → 7.8.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.
@@ -328,11 +328,11 @@ orientations:
328
328
  landscape: partial
329
329
  ```
330
330
 
331
- | Value | What the player gets |
332
- | --- | --- |
333
- | `full` | nothing — the game plays this way round |
334
- | `partial` | a dismissible hint, once, if the other way is `full` |
335
- | `none` | a panel over the paused game asking them to rotate, with "play anyway" |
331
+ | Value | What the player gets |
332
+ | --------- | ---------------------------------------------------------------------- |
333
+ | `full` | nothing — the game plays this way round |
334
+ | `partial` | a dismissible hint, once, if the other way is `full` |
335
+ | `none` | a panel over the paused game asking them to rotate, with "play anyway" |
336
336
 
337
337
  Three consequences worth knowing before you hit them:
338
338
 
@@ -508,10 +508,14 @@ them**, so the whole migration for a stylesheet is one declaration per edge:
508
508
 
509
509
  ```css
510
510
  /* before */
511
- #hud { top: env(safe-area-inset-top, 0px); }
511
+ #hud {
512
+ top: env(safe-area-inset-top, 0px);
513
+ }
512
514
 
513
515
  /* after — right in the arcade, and unchanged everywhere else */
514
- #hud { top: var(--gem-safe-top, env(safe-area-inset-top, 0px)); }
516
+ #hud {
517
+ top: var(--gem-safe-top, env(safe-area-inset-top, 0px));
518
+ }
515
519
  ```
516
520
 
517
521
  The `env()` fallback is not decoration. Under a parent that has not sent the message — an older
@@ -805,6 +809,25 @@ pauseMenu.onOpen = () => gem.setWalletVisible(true);
805
809
  - **`false` means nobody is listening** — no connection yet, or an embedder that draws no wallet.
806
810
  Do nothing in its place.
807
811
 
812
+ ## No accidental text selection
813
+
814
+ **You write nothing for this.** A long press on a phone, a double-click on a button, a drag across
815
+ your HUD: on an ordinary page each selects text, raises the copy menu or flashes a tap highlight,
816
+ and in a game none of them is something the player meant. So at start-up the SDK turns all three
817
+ off across your document.
818
+
819
+ - **Your CSS always wins.** The SDK's rule has zero specificity, so any rule you write overrides it.
820
+ To make one element copyable — a room code, a share link — give it
821
+ `-webkit-user-select: text; user-select: text;`.
822
+ - **Inputs, text areas and editable content are untouched.** They still take typing, still select
823
+ and still paste.
824
+ - **It is a stylesheet the SDK adopts, not a `<style>` element**, so a strict `style-src` in your
825
+ own CSP does not block it. On iOS before 16.4, which lacks that API, the SDK sets the same
826
+ properties on `<html>` itself instead, all but the copy menu, which has no safe way to be handed
827
+ back to your inputs there.
828
+ - **To keep the browser's default instead** — a game that is mostly text the player should be able
829
+ to copy — pass `createGem({ selectableText: true })`.
830
+
808
831
  ## The Arcade's FPS overlay
809
832
 
810
833
  The Arcade has a frame-rate toggle beside your game, and **you do not have to write anything for it
@@ -876,15 +899,15 @@ player (`gem.player`), room members, leaderboard rows, friends, profiles, showca
876
899
  async opponent you read through the raw client, once you pass the row through `mapIdentity`. One
877
900
  renderer serves all of them.
878
901
 
879
- | Field | What it is | Type |
880
- | ----- | ---------- | ---- |
881
- | `playerId` | The player's id. **Absent on an anonymous row** | `string` |
882
- | `displayName` | The name the player chose | `PlayerText` |
883
- | `discriminator` | The digits that tell two same-named players apart — `0001`, no `#` | `string` |
884
- | `displayTag` | The precomposed `Name#0001` | `PlayerText` |
885
- | `avatarIconId` | The portrait item's id | `string` |
886
- | `avatarIconUrl` | The portrait's thumbnail | `string` |
887
- | `badges` | Equipped badges in display order, each `{ itemId, iconUrl }` — always a list, empty for now | array |
902
+ | Field | What it is | Type |
903
+ | --------------- | ------------------------------------------------------------------------------------------- | ------------ |
904
+ | `playerId` | The player's id. **Absent on an anonymous row** | `string` |
905
+ | `displayName` | The name the player chose | `PlayerText` |
906
+ | `discriminator` | The digits that tell two same-named players apart — `0001`, no `#` | `string` |
907
+ | `displayTag` | The precomposed `Name#0001` | `PlayerText` |
908
+ | `avatarIconId` | The portrait item's id | `string` |
909
+ | `avatarIconUrl` | The portrait's thumbnail | `string` |
910
+ | `badges` | Equipped badges in display order, each `{ itemId, iconUrl }` — always a list, empty for now | array |
888
911
 
889
912
  **The name and the tag are player-authored, so both are `PlayerText`** on every surface, not only
890
913
  some. Convert with `text.toPlain()` where you render, never before.
@@ -937,11 +960,11 @@ While it lasts the player earns Gems and Tickets faster (never achievement point
937
960
  platform raises their earning limits to match. The platform does all of that on its own side when
938
961
  it pays; your game does nothing to make a boost work.
939
962
 
940
- | Field | What it is | Type |
941
- | ----- | ---------- | ---- |
942
- | `boost.active` | Whether any currency earns faster than 1× right now | `boolean` |
943
- | `boost.multipliers` | One `{ currencyId, currencySlug, multiplier }` per boostable currency — `multiplier` is `2` for 2×, `1` when not boosted; a currency not listed is 1× | array |
944
- | `boost.expiresInDays` | Whole days until the soonest boosted currency drops back, rounded up and **capped at 7** — `7` means "7 or more"; absent when nothing is boosted | `number` |
963
+ | Field | What it is | Type |
964
+ | --------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | --------- |
965
+ | `boost.active` | Whether any currency earns faster than 1× right now | `boolean` |
966
+ | `boost.multipliers` | One `{ currencyId, currencySlug, multiplier }` per boostable currency — `multiplier` is `2` for 2×, `1` when not boosted; a currency not listed is 1× | array |
967
+ | `boost.expiresInDays` | Whole days until the soonest boosted currency drops back, rounded up and **capped at 7** — `7` means "7 or more"; absent when nothing is boosted | `number` |
945
968
 
946
969
  `boost` is always present on `gem.player`. When the Arcade has not said — an older Arcade, a
947
970
  backend without boosts, a read that has not landed yet — it reads as **not boosted**, exactly like a
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@indiegems/gem-web-sdk",
3
- "version": "7.7.0",
3
+ "version": "7.8.0",
4
4
  "description": "postMessage bridge contract between gem-web and browser-playable games",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",