@dreamboard-games/sdk 0.5.0-alpha.26 → 0.5.0-alpha.28
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 +5 -5
- package/dist/{chunk-3RFGPBES.js → chunk-3KBMAFNW.js} +5 -5
- package/dist/{chunk-3RFGPBES.js.map → chunk-3KBMAFNW.js.map} +1 -1
- package/dist/index.d.ts +20 -5
- package/dist/index.js +7 -3
- package/dist/index.js.map +1 -1
- package/dist/react.js +11 -7
- package/dist/react.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -113,6 +113,9 @@ declare const GameplayCloseCode: {
|
|
|
113
113
|
readonly TooManyRequests: 4301;
|
|
114
114
|
};
|
|
115
115
|
declare const GameplayCredentialSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
116
|
+
kind: z.ZodLiteral<"room-guest">;
|
|
117
|
+
token: z.ZodString;
|
|
118
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
116
119
|
kind: z.ZodLiteral<"user">;
|
|
117
120
|
token: z.ZodString;
|
|
118
121
|
}, z.core.$strict>, z.ZodObject<{
|
|
@@ -122,6 +125,9 @@ declare const GameplayCredentialSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
122
125
|
declare const AuthConnectFrameSchema: z.ZodObject<{
|
|
123
126
|
type: z.ZodLiteral<"auth.connect">;
|
|
124
127
|
credential: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
128
|
+
kind: z.ZodLiteral<"room-guest">;
|
|
129
|
+
token: z.ZodString;
|
|
130
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
125
131
|
kind: z.ZodLiteral<"user">;
|
|
126
132
|
token: z.ZodString;
|
|
127
133
|
}, z.core.$strict>, z.ZodObject<{
|
|
@@ -134,6 +140,9 @@ declare const AuthConnectFrameSchema: z.ZodObject<{
|
|
|
134
140
|
declare const AuthRefreshFrameSchema: z.ZodObject<{
|
|
135
141
|
type: z.ZodLiteral<"auth.refresh">;
|
|
136
142
|
credential: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
143
|
+
kind: z.ZodLiteral<"room-guest">;
|
|
144
|
+
token: z.ZodString;
|
|
145
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
137
146
|
kind: z.ZodLiteral<"user">;
|
|
138
147
|
token: z.ZodString;
|
|
139
148
|
}, z.core.$strict>, z.ZodObject<{
|
|
@@ -663,6 +672,9 @@ declare const SessionSnapshotFrameSchema: z.ZodObject<{
|
|
|
663
672
|
declare const ClientGameplayFrameSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
664
673
|
type: z.ZodLiteral<"auth.connect">;
|
|
665
674
|
credential: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
675
|
+
kind: z.ZodLiteral<"room-guest">;
|
|
676
|
+
token: z.ZodString;
|
|
677
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
666
678
|
kind: z.ZodLiteral<"user">;
|
|
667
679
|
token: z.ZodString;
|
|
668
680
|
}, z.core.$strict>, z.ZodObject<{
|
|
@@ -674,6 +686,9 @@ declare const ClientGameplayFrameSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
674
686
|
}, z.core.$strict>, z.ZodObject<{
|
|
675
687
|
type: z.ZodLiteral<"auth.refresh">;
|
|
676
688
|
credential: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
689
|
+
kind: z.ZodLiteral<"room-guest">;
|
|
690
|
+
token: z.ZodString;
|
|
691
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
677
692
|
kind: z.ZodLiteral<"user">;
|
|
678
693
|
token: z.ZodString;
|
|
679
694
|
}, z.core.$strict>, z.ZodObject<{
|
|
@@ -1516,7 +1531,7 @@ declare const GESTURE_THRESHOLDS: Readonly<{
|
|
|
1516
1531
|
holdMs: 350;
|
|
1517
1532
|
/** A mouse resting on a card this long inspects it. */
|
|
1518
1533
|
hoverMs: 250;
|
|
1519
|
-
/** A finger drags when
|
|
1534
|
+
/** A finger drags when vertical travel exceeds this multiple of sideways travel. */
|
|
1520
1535
|
axisBias: 1.25;
|
|
1521
1536
|
}>;
|
|
1522
1537
|
interface GesturePointer {
|
|
@@ -1550,17 +1565,17 @@ interface GestureRecognizer {
|
|
|
1550
1565
|
cancel(event?: Pick<GesturePointer, "pointerId">): void;
|
|
1551
1566
|
}
|
|
1552
1567
|
interface GestureOptions {
|
|
1553
|
-
/** Cards drag
|
|
1554
|
-
readonly dragDirection?: "
|
|
1568
|
+
/** Cards drag up or down on touch; piles can be dragged toward any destination. */
|
|
1569
|
+
readonly dragDirection?: "vertical" | "any";
|
|
1555
1570
|
/**
|
|
1556
1571
|
* A browsing finger scrubs along its row instead of scrolling it: `browse`
|
|
1557
|
-
* reports every move, and turning
|
|
1572
|
+
* reports every move, and turning up or down still drags.
|
|
1558
1573
|
*/
|
|
1559
1574
|
readonly scrub?: boolean;
|
|
1560
1575
|
}
|
|
1561
1576
|
/**
|
|
1562
1577
|
* Classifies one press. A mouse drags in any direction and never holds. A
|
|
1563
|
-
* finger drags
|
|
1578
|
+
* finger drags up or down, browses sideways and holds when still, so cards can use
|
|
1564
1579
|
* `touch-action: pan-x` and keep native sideways scrolling, or
|
|
1565
1580
|
* `touch-action: none` and scrub.
|
|
1566
1581
|
*/
|
package/dist/index.js
CHANGED
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
isSameDropTarget,
|
|
7
7
|
magneticDropPoint,
|
|
8
8
|
runtimeFeatures
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-3KBMAFNW.js";
|
|
10
10
|
import {
|
|
11
11
|
CancelInteractionCommandSchema,
|
|
12
12
|
DREAMBOARD_PLUGIN_PROTOCOL,
|
|
@@ -73,7 +73,7 @@ import {
|
|
|
73
73
|
} from "./chunk-CZRPUWCT.js";
|
|
74
74
|
|
|
75
75
|
// src/package-set.ts
|
|
76
|
-
var DREAMBOARD_SDK_VERSION = true ? "0.5.0-alpha.
|
|
76
|
+
var DREAMBOARD_SDK_VERSION = true ? "0.5.0-alpha.28" : "0.0.0-development";
|
|
77
77
|
var DREAMBOARD_SDK_PACKAGES = {
|
|
78
78
|
"@dreamboard-games/sdk": DREAMBOARD_SDK_VERSION
|
|
79
79
|
};
|
|
@@ -167,6 +167,10 @@ var GameplayCloseCode = {
|
|
|
167
167
|
TooManyRequests: 4301
|
|
168
168
|
};
|
|
169
169
|
var GameplayCredentialSchema = z.discriminatedUnion("kind", [
|
|
170
|
+
z.object({
|
|
171
|
+
kind: z.literal("room-guest"),
|
|
172
|
+
token: z.string().min(1).max(1024)
|
|
173
|
+
}).strict(),
|
|
170
174
|
z.object({ kind: z.literal("user"), token: z.string().min(1).max(16384) }).strict(),
|
|
171
175
|
z.object({ kind: z.literal("demo"), secret: z.string().min(1).max(1024) }).strict()
|
|
172
176
|
]);
|
|
@@ -344,7 +348,7 @@ function hostSource(options) {
|
|
|
344
348
|
}
|
|
345
349
|
}
|
|
346
350
|
clearTimeout(refreshTimer);
|
|
347
|
-
if (credential.kind
|
|
351
|
+
if (credential.kind !== "demo") {
|
|
348
352
|
const ttl = Date.parse(frame.expiresAt) - Date.now();
|
|
349
353
|
if (ttl <= 0)
|
|
350
354
|
throw new Error("Gameplay credential is already expired.");
|