@puzzmo/sdk 1.0.71 → 1.0.73
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 +20 -6
- package/dist/{createSimulator-uk8H5md8.cjs → createSimulator-Bb1LTB5P.cjs} +44 -44
- package/dist/createSimulator-Bb1LTB5P.cjs.map +1 -0
- package/dist/{createSimulator-treFHkmV.js → createSimulator-CYo2KWWM.js} +480 -440
- package/dist/createSimulator-CYo2KWWM.js.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.global.js +1 -1
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +154 -91
- package/dist/index.js.map +1 -1
- package/dist/sdk.d.ts +66 -4
- package/dist/sdk.d.ts.map +1 -1
- package/dist/sdk.gameReady.spec.d.ts +2 -0
- package/dist/sdk.gameReady.spec.d.ts.map +1 -0
- package/dist/simulator/createSimulator.d.ts.map +1 -1
- package/dist/simulator/index.cjs +1 -1
- package/dist/simulator/index.js +1 -1
- package/dist/simulator/standalone.cjs +1 -1
- package/dist/simulator/standalone.js +1 -1
- package/dist/simulator/state.d.ts.map +1 -1
- package/dist/simulator/types.d.ts +5 -0
- package/dist/simulator/types.d.ts.map +1 -1
- package/dist/simulator/views/ThumbView.d.ts.map +1 -1
- package/dist/thumbnailMotion.cjs +5 -0
- package/dist/thumbnailMotion.cjs.map +1 -0
- package/dist/thumbnailMotion.d.ts +119 -0
- package/dist/thumbnailMotion.d.ts.map +1 -0
- package/dist/thumbnailMotion.js +453 -0
- package/dist/thumbnailMotion.js.map +1 -0
- package/dist/thumbnailMotion.spec.d.ts +2 -0
- package/dist/thumbnailMotion.spec.d.ts.map +1 -0
- package/dist/types.d.ts +55 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +6 -1
- package/dist/createSimulator-treFHkmV.js.map +0 -1
- package/dist/createSimulator-uk8H5md8.cjs.map +0 -1
package/README.md
CHANGED
|
@@ -64,11 +64,25 @@ Creates an SDK instance. Options:
|
|
|
64
64
|
|
|
65
65
|
| Method | Description |
|
|
66
66
|
| ------------------------- | ------------------------------------------------------------------------- |
|
|
67
|
-
| `sdk.gameReady()` | Async. Signals readiness, returns puzzle data and theme.
|
|
67
|
+
| `sdk.gameReady()` | Async. Signals readiness, returns the boot mode, puzzle data and theme. |
|
|
68
68
|
| `sdk.gameLoaded(state?)` | Signals game UI is ready. Host will send `start`. |
|
|
69
69
|
| `sdk.on(event, handler)` | Listen for events: `start`, `pause`, `resume`, `retry`, `settingsUpdate`. |
|
|
70
70
|
| `sdk.off(event, handler)` | Remove an event listener. |
|
|
71
71
|
|
|
72
|
+
### Repeat play
|
|
73
|
+
|
|
74
|
+
A game opted into repeat play is booted with no puzzle session. `gameReady()` then resolves with
|
|
75
|
+
`mode: "repeatable"`. A game that makes its own boards gets an empty `puzzleString`; a game whose puzzles come
|
|
76
|
+
from a pool gets the first one, with its `puzzleKey`, and asks the host for more. Games never fetch puzzles
|
|
77
|
+
themselves.
|
|
78
|
+
|
|
79
|
+
| Method | Description |
|
|
80
|
+
| ----------------------------------------- | ------------------------------------------------------------------------------------- |
|
|
81
|
+
| `sdk.storage.get()` | The game's own per-player payload from boot, or null. Repeat play only for now. |
|
|
82
|
+
| `sdk.storage.set(state, stateVersion?)` | Replace that payload (64 KB, whole document, last write wins). |
|
|
83
|
+
| `sdk.completeRepeatableRun(run, config?)` | Report a finished run; the timer keeps going for the next one. |
|
|
84
|
+
| `sdk.requestPuzzle({ buckets, exclude })` | Another puzzle from the pool, or from `buckets`; `exclude` is the game's recent keys. |
|
|
85
|
+
|
|
72
86
|
### Game State
|
|
73
87
|
|
|
74
88
|
| Method | Description |
|
|
@@ -102,11 +116,11 @@ Names are the iOS feedback generators: `selection`, `light`, `medium`, `heavy`,
|
|
|
102
116
|
|
|
103
117
|
Fire-and-forget — it never reports back, and it is a no-op wherever the host can't deliver one, so never make gameplay depend on a haptic landing:
|
|
104
118
|
|
|
105
|
-
| Where
|
|
106
|
-
|
|
|
107
|
-
| Puzzmo's iOS app
|
|
108
|
-
| puzzmo.com on Android/desktop | Approximated with `navigator.vibrate`
|
|
109
|
-
| Partner embeds
|
|
119
|
+
| Where | What happens |
|
|
120
|
+
| ----------------------------- | ---------------------------------------- |
|
|
121
|
+
| Puzzmo's iOS app | Real UIKit haptics via the native bridge |
|
|
122
|
+
| puzzmo.com on Android/desktop | Approximated with `navigator.vibrate` |
|
|
123
|
+
| Partner embeds | No haptic — see below |
|
|
110
124
|
|
|
111
125
|
The call goes to the host rather than vibrating from your game because Chrome has blocked `navigator.vibrate` in cross-origin iframes since Chrome 55, and games run in one. There is no Permissions-Policy opt-in, so calling it yourself is silently ignored. Partner embeds fire no haptic for the same reason: our frame is cross-origin to the partner's page, so the host is blocked too and there is no native bridge to fall back on. The cue is still forwarded to the partner page on the private message stream, so a partner can action it themselves.
|
|
112
126
|
|