@dreamboard-games/sdk 0.4.0-alpha.1 → 0.4.0-alpha.3
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/REFERENCE.md +1318 -201
- package/dist/{ResourceCounter-BTXklCEZ.d.ts → ResourceCounter-BuiNstXs.d.ts} +5 -1
- package/dist/{ThemeProvider-DvMl17Ny.d.ts → ThemeProvider-B1sIoBlX.d.ts} +1 -1
- package/dist/{attributes-BrZtP9az.d.ts → attributes-DbvyMbXw.d.ts} +17 -2
- package/dist/authoring/index.d.ts +66 -0
- package/dist/authoring/index.js +560 -0
- package/dist/authoring/index.js.map +1 -0
- package/dist/browser-interaction.d.ts +205 -5
- package/dist/browser-interaction.js +14 -2
- package/dist/{chunk-7W6TQO3X.js → chunk-45FI6XII.js} +613 -366
- package/dist/chunk-45FI6XII.js.map +1 -0
- package/dist/{chunk-3K362ZKR.js → chunk-6JQFGSLD.js} +202 -38
- package/dist/chunk-6JQFGSLD.js.map +1 -0
- package/dist/{chunk-IUGKW2GS.js → chunk-BKD7XAWB.js} +6 -2
- package/dist/chunk-BKD7XAWB.js.map +1 -0
- package/dist/{chunk-XXBSIPJX.js → chunk-CP35NPPY.js} +131 -59
- package/dist/chunk-CP35NPPY.js.map +1 -0
- package/dist/chunk-DQ7GCD6C.js +12 -0
- package/dist/chunk-DQ7GCD6C.js.map +1 -0
- package/dist/{chunk-XJYUSD5F.js → chunk-FWVV2X74.js} +2 -2
- package/dist/chunk-K5ZRJTZZ.js +328 -0
- package/dist/chunk-K5ZRJTZZ.js.map +1 -0
- package/dist/{chunk-7LZZEI25.js → chunk-N6ZDIMRB.js} +1 -1
- package/dist/chunk-N6ZDIMRB.js.map +1 -0
- package/dist/chunk-O6M6PN4E.js +1225 -0
- package/dist/chunk-O6M6PN4E.js.map +1 -0
- package/dist/{chunk-AEUXCFGM.js → chunk-PF7L4BMG.js} +1 -8
- package/dist/{chunk-AEUXCFGM.js.map → chunk-PF7L4BMG.js.map} +1 -1
- package/dist/{chunk-CZMFAS3E.js → chunk-WOWFONLZ.js} +517 -1274
- package/dist/chunk-WOWFONLZ.js.map +1 -0
- package/dist/{chunk-MALRKLRR.js → chunk-WUIVY2KE.js} +301 -12
- package/dist/chunk-WUIVY2KE.js.map +1 -0
- package/dist/codegen.d.ts +11 -3
- package/dist/codegen.js +1 -1
- package/dist/{components-Dqr_LuZJ.d.ts → components-BbWPnZCF.d.ts} +37 -6
- package/dist/{hex-board-view-UCUjMALd.d.ts → hex-board-view-Kz9Q_zsv.d.ts} +1 -1
- package/dist/index-BLwlj7mO.d.ts +191 -0
- package/dist/index.js +2 -1
- package/dist/package-set.d.ts +2 -2
- package/dist/package-set.js +2 -1
- package/dist/player-state-Cqpyeql0.d.ts +371 -0
- package/dist/protocol-BP193lva.d.ts +267 -0
- package/dist/reducer/advanced.js +1 -1
- package/dist/reducer-contract.js +1 -1
- package/dist/reducer.js +2 -2
- package/dist/reducer.js.map +1 -1
- package/dist/runtime/primitives.d.ts +10 -10
- package/dist/runtime/primitives.js +9 -7
- package/dist/runtime/runtime-api.d.ts +2 -2
- package/dist/runtime/workspace-contract.d.ts +21 -167
- package/dist/runtime/workspace-contract.js +7 -6
- package/dist/runtime-api-BJharVaj.d.ts +198 -0
- package/dist/runtime-api-C6aWo9c0.d.ts +95 -0
- package/dist/runtime.d.ts +36 -32
- package/dist/runtime.js +87 -797
- package/dist/runtime.js.map +1 -1
- package/dist/testing.d.ts +254 -140
- package/dist/testing.js +964 -149
- package/dist/testing.js.map +1 -1
- package/dist/types-CYeN0wLK.d.ts +29 -0
- package/dist/{types-BqzHkNMA.d.ts → types-DJj5MJkl.d.ts} +32 -5
- package/dist/types.d.ts +13 -8
- package/dist/ui/components.d.ts +4 -5
- package/dist/ui/components.js +19 -1
- package/dist/ui/player-state.d.ts +2 -365
- package/dist/{ui-contract-W2-kxObe.d.ts → ui-contract-CY7cxsCC.d.ts} +16 -26
- package/dist/ui.d.ts +7 -8
- package/dist/ui.js +20 -2
- package/package.json +25 -19
- package/dist/chunk-3K362ZKR.js.map +0 -1
- package/dist/chunk-7LZZEI25.js.map +0 -1
- package/dist/chunk-7W6TQO3X.js.map +0 -1
- package/dist/chunk-CZMFAS3E.js.map +0 -1
- package/dist/chunk-IUGKW2GS.js.map +0 -1
- package/dist/chunk-MALRKLRR.js.map +0 -1
- package/dist/chunk-XXBSIPJX.js.map +0 -1
- package/dist/hex-color-MhOyuY-o.d.ts +0 -8
- package/dist/runtime-api-BXd70c2e.d.ts +0 -490
- /package/dist/{chunk-XJYUSD5F.js.map → chunk-FWVV2X74.js.map} +0 -0
package/dist/runtime.d.ts
CHANGED
|
@@ -1,53 +1,43 @@
|
|
|
1
|
-
import { b1 as UIContract$1, A as DreamboardUI$1, a$ as TypedGame$1 } from './ui-contract-
|
|
2
|
-
export { f as BoardHexGridProps, h as BoardHexViewProps, l as BoardSpaceTargetProps, I as GameMeState, M as GamePlayersState, N as GameRenderState, Q as GameTurnState, b3 as UIRootProps, bd as ZoneCardRenderItem, bh as ZoneListProps } from './ui-contract-
|
|
3
|
-
export { a as
|
|
4
|
-
export { ClientParamSchemaMap, WorkspaceBoardSurface, WorkspaceBoardSurfaceDescriptor, WorkspaceBoardTargetInputSlot, WorkspaceCardCollectionSurface, WorkspaceCardCollectionSurfaceDescriptor, WorkspaceCardInputSlot, WorkspaceFormInputSlot, WorkspaceHandSurface, WorkspaceHandSurfaceDescriptor, WorkspaceInteractionFormDescriptor, WorkspaceInteractionFormsDescriptor, WorkspaceInteractionSlotComponent, WorkspacePileSurface, WorkspacePileSurfaceDescriptor, WorkspacePilesSurfaceDescriptor, WorkspaceSurfaceSpec, createWorkspaceUIContract } from './runtime/workspace-contract.js';
|
|
1
|
+
import { b1 as UIContract$1, A as DreamboardUI$1, a$ as TypedGame$1 } from './ui-contract-CY7cxsCC.js';
|
|
2
|
+
export { f as BoardHexGridProps, h as BoardHexViewProps, l as BoardSpaceTargetProps, I as GameMeState, M as GamePlayersState, N as GameRenderState, Q as GameTurnState, b3 as UIRootProps, bd as ZoneCardRenderItem, bh as ZoneListProps } from './ui-contract-CY7cxsCC.js';
|
|
3
|
+
export { C as ClientParamSchemaMap, W as WorkspaceBoardSurface, a as WorkspaceBoardSurfaceDescriptor, b as WorkspaceBoardTargetInputSlot, c as WorkspaceCardCollectionSurface, d as WorkspaceCardCollectionSurfaceDescriptor, e as WorkspaceCardInputSlot, f as WorkspaceFormInputSlot, g as WorkspaceHandSurface, h as WorkspaceHandSurfaceDescriptor, i as WorkspaceInteractionFormDescriptor, j as WorkspaceInteractionFormsDescriptor, k as WorkspaceInteractionSlotComponent, l as WorkspacePileSurface, m as WorkspacePileSurfaceDescriptor, n as WorkspacePilesSurfaceDescriptor, o as WorkspaceSurfaceSpec, p as createWorkspaceUIContract } from './index-BLwlj7mO.js';
|
|
5
4
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
6
5
|
import react__default from 'react';
|
|
7
|
-
|
|
8
|
-
import './
|
|
9
|
-
|
|
6
|
+
import { c as RuntimeDiagnosticHandler } from './runtime-api-C6aWo9c0.js';
|
|
7
|
+
import { P as PluginRuntimeClient, a as PluginRuntimeClientOptions, b as PluginTransport } from './types-CYeN0wLK.js';
|
|
8
|
+
export { R as RuntimeClock, c as RuntimeIdFactory } from './types-CYeN0wLK.js';
|
|
9
|
+
export { a as InteractionDescriptor } from './runtime-api-BJharVaj.js';
|
|
10
|
+
export { b as ResourceCounterComponents } from './ResourceCounter-BuiNstXs.js';
|
|
11
|
+
import './hex-board-view-Kz9Q_zsv.js';
|
|
12
|
+
import './player-state-Cqpyeql0.js';
|
|
10
13
|
import './types.js';
|
|
11
|
-
import './
|
|
12
|
-
import './ThemeProvider-DvMl17Ny.js';
|
|
14
|
+
import './ThemeProvider-B1sIoBlX.js';
|
|
13
15
|
import './primitive-props-BNHDkgd7.js';
|
|
14
|
-
import './attributes-
|
|
15
|
-
import './types-
|
|
16
|
-
|
|
17
|
-
type PluginRuntimeDiagnosticEvent = {
|
|
18
|
-
type: "runtimeLog";
|
|
19
|
-
level: "log" | "warn" | "error";
|
|
20
|
-
message: string;
|
|
21
|
-
details?: readonly unknown[];
|
|
22
|
-
} | {
|
|
23
|
-
type: "internalError";
|
|
24
|
-
code: string;
|
|
25
|
-
message: string;
|
|
26
|
-
stack?: string;
|
|
27
|
-
};
|
|
28
|
-
type PluginRuntimeDiagnosticHandler = (event: PluginRuntimeDiagnosticEvent) => void;
|
|
16
|
+
import './attributes-DbvyMbXw.js';
|
|
17
|
+
import './types-DJj5MJkl.js';
|
|
18
|
+
import './protocol-BP193lva.js';
|
|
29
19
|
|
|
30
20
|
interface PluginRuntimeProps {
|
|
31
|
-
/** Child components to render after
|
|
21
|
+
/** Child components to render after gameplay frame has started */
|
|
32
22
|
children: react__default.ReactNode;
|
|
33
23
|
/**
|
|
34
|
-
* Timeout in milliseconds to wait for the first
|
|
24
|
+
* Timeout in milliseconds to wait for the first gameplay-frame snapshot.
|
|
35
25
|
* @default 10000 (10 seconds)
|
|
36
26
|
*/
|
|
37
27
|
timeout?: number;
|
|
38
|
-
/** Custom loading component to show while waiting for
|
|
28
|
+
/** Custom loading component to show while waiting for gameplay frame */
|
|
39
29
|
loadingComponent?: react__default.ReactNode;
|
|
40
30
|
/** Custom error component to show when initialization fails */
|
|
41
31
|
errorComponent?: (error: string) => react__default.ReactNode;
|
|
42
|
-
onDiagnostic?:
|
|
32
|
+
onDiagnostic?: RuntimeDiagnosticHandler;
|
|
43
33
|
}
|
|
44
34
|
/**
|
|
45
35
|
* PluginRuntime provides the RuntimeContext for plugin components.
|
|
46
36
|
*
|
|
47
37
|
* This component:
|
|
48
|
-
* - Creates a
|
|
49
|
-
* - Waits for the first
|
|
50
|
-
* - Provides
|
|
38
|
+
* - Creates a transport-backed runtime client
|
|
39
|
+
* - Waits for the first projected gameplay frame before rendering children
|
|
40
|
+
* - Provides runtime commands plus session/frame state to all child components
|
|
51
41
|
*
|
|
52
42
|
* @example
|
|
53
43
|
* ```tsx
|
|
@@ -64,6 +54,20 @@ interface PluginRuntimeProps {
|
|
|
64
54
|
*/
|
|
65
55
|
declare function PluginRuntime({ children, timeout, loadingComponent, errorComponent, onDiagnostic, }: PluginRuntimeProps): react_jsx_runtime.JSX.Element;
|
|
66
56
|
|
|
57
|
+
declare function PluginRuntimeBoundary({ runtime, children, }: {
|
|
58
|
+
runtime: PluginRuntimeClient;
|
|
59
|
+
children: react__default.ReactNode;
|
|
60
|
+
}): react_jsx_runtime.JSX.Element;
|
|
61
|
+
|
|
62
|
+
declare function createPluginRuntimeClient(options: PluginRuntimeClientOptions): PluginRuntimeClient;
|
|
63
|
+
|
|
64
|
+
interface PostMessagePluginTransportOptions {
|
|
65
|
+
readonly targetWindow?: Window;
|
|
66
|
+
readonly parentWindow?: Window;
|
|
67
|
+
readonly onInvalidMessage?: (reason: string, value: unknown) => void;
|
|
68
|
+
}
|
|
69
|
+
declare function createPostMessagePluginTransport(options?: PostMessagePluginTransportOptions): PluginTransport;
|
|
70
|
+
|
|
67
71
|
interface DreamboardUIRegister {
|
|
68
72
|
readonly __dreamboardUIRegister?: never;
|
|
69
73
|
}
|
|
@@ -75,4 +79,4 @@ type RegisteredUI = RegisteredUIContract;
|
|
|
75
79
|
type DreamboardUI<Contract extends UIContract = RegisteredUI> = DreamboardUI$1<Contract>;
|
|
76
80
|
type TypedGame<Contract extends UIContract, View = unknown, Player extends string = string, Phase extends string = string> = TypedGame$1<Contract, View, Player, Phase>;
|
|
77
81
|
|
|
78
|
-
export { type DreamboardUI, type DreamboardUIRegister, PluginRuntime, type PluginRuntimeProps, type RegisteredUI, type TypedGame, type UIContract };
|
|
82
|
+
export { type DreamboardUI, type DreamboardUIRegister, PluginRuntime, PluginRuntimeBoundary, PluginRuntimeClient, PluginRuntimeClientOptions, type PluginRuntimeProps, PluginTransport, type PostMessagePluginTransportOptions, type RegisteredUI, type TypedGame, type UIContract, createPluginRuntimeClient, createPostMessagePluginTransport };
|