@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.
Files changed (79) hide show
  1. package/REFERENCE.md +1318 -201
  2. package/dist/{ResourceCounter-BTXklCEZ.d.ts → ResourceCounter-BuiNstXs.d.ts} +5 -1
  3. package/dist/{ThemeProvider-DvMl17Ny.d.ts → ThemeProvider-B1sIoBlX.d.ts} +1 -1
  4. package/dist/{attributes-BrZtP9az.d.ts → attributes-DbvyMbXw.d.ts} +17 -2
  5. package/dist/authoring/index.d.ts +66 -0
  6. package/dist/authoring/index.js +560 -0
  7. package/dist/authoring/index.js.map +1 -0
  8. package/dist/browser-interaction.d.ts +205 -5
  9. package/dist/browser-interaction.js +14 -2
  10. package/dist/{chunk-7W6TQO3X.js → chunk-45FI6XII.js} +613 -366
  11. package/dist/chunk-45FI6XII.js.map +1 -0
  12. package/dist/{chunk-3K362ZKR.js → chunk-6JQFGSLD.js} +202 -38
  13. package/dist/chunk-6JQFGSLD.js.map +1 -0
  14. package/dist/{chunk-IUGKW2GS.js → chunk-BKD7XAWB.js} +6 -2
  15. package/dist/chunk-BKD7XAWB.js.map +1 -0
  16. package/dist/{chunk-XXBSIPJX.js → chunk-CP35NPPY.js} +131 -59
  17. package/dist/chunk-CP35NPPY.js.map +1 -0
  18. package/dist/chunk-DQ7GCD6C.js +12 -0
  19. package/dist/chunk-DQ7GCD6C.js.map +1 -0
  20. package/dist/{chunk-XJYUSD5F.js → chunk-FWVV2X74.js} +2 -2
  21. package/dist/chunk-K5ZRJTZZ.js +328 -0
  22. package/dist/chunk-K5ZRJTZZ.js.map +1 -0
  23. package/dist/{chunk-7LZZEI25.js → chunk-N6ZDIMRB.js} +1 -1
  24. package/dist/chunk-N6ZDIMRB.js.map +1 -0
  25. package/dist/chunk-O6M6PN4E.js +1225 -0
  26. package/dist/chunk-O6M6PN4E.js.map +1 -0
  27. package/dist/{chunk-AEUXCFGM.js → chunk-PF7L4BMG.js} +1 -8
  28. package/dist/{chunk-AEUXCFGM.js.map → chunk-PF7L4BMG.js.map} +1 -1
  29. package/dist/{chunk-CZMFAS3E.js → chunk-WOWFONLZ.js} +517 -1274
  30. package/dist/chunk-WOWFONLZ.js.map +1 -0
  31. package/dist/{chunk-MALRKLRR.js → chunk-WUIVY2KE.js} +301 -12
  32. package/dist/chunk-WUIVY2KE.js.map +1 -0
  33. package/dist/codegen.d.ts +11 -3
  34. package/dist/codegen.js +1 -1
  35. package/dist/{components-Dqr_LuZJ.d.ts → components-BbWPnZCF.d.ts} +37 -6
  36. package/dist/{hex-board-view-UCUjMALd.d.ts → hex-board-view-Kz9Q_zsv.d.ts} +1 -1
  37. package/dist/index-BLwlj7mO.d.ts +191 -0
  38. package/dist/index.js +2 -1
  39. package/dist/package-set.d.ts +2 -2
  40. package/dist/package-set.js +2 -1
  41. package/dist/player-state-Cqpyeql0.d.ts +371 -0
  42. package/dist/protocol-BP193lva.d.ts +267 -0
  43. package/dist/reducer/advanced.js +1 -1
  44. package/dist/reducer-contract.js +1 -1
  45. package/dist/reducer.js +2 -2
  46. package/dist/reducer.js.map +1 -1
  47. package/dist/runtime/primitives.d.ts +10 -10
  48. package/dist/runtime/primitives.js +9 -7
  49. package/dist/runtime/runtime-api.d.ts +2 -2
  50. package/dist/runtime/workspace-contract.d.ts +21 -167
  51. package/dist/runtime/workspace-contract.js +7 -6
  52. package/dist/runtime-api-BJharVaj.d.ts +198 -0
  53. package/dist/runtime-api-C6aWo9c0.d.ts +95 -0
  54. package/dist/runtime.d.ts +36 -32
  55. package/dist/runtime.js +87 -797
  56. package/dist/runtime.js.map +1 -1
  57. package/dist/testing.d.ts +254 -140
  58. package/dist/testing.js +964 -149
  59. package/dist/testing.js.map +1 -1
  60. package/dist/types-CYeN0wLK.d.ts +29 -0
  61. package/dist/{types-BqzHkNMA.d.ts → types-DJj5MJkl.d.ts} +32 -5
  62. package/dist/types.d.ts +13 -8
  63. package/dist/ui/components.d.ts +4 -5
  64. package/dist/ui/components.js +19 -1
  65. package/dist/ui/player-state.d.ts +2 -365
  66. package/dist/{ui-contract-W2-kxObe.d.ts → ui-contract-CY7cxsCC.d.ts} +16 -26
  67. package/dist/ui.d.ts +7 -8
  68. package/dist/ui.js +20 -2
  69. package/package.json +25 -19
  70. package/dist/chunk-3K362ZKR.js.map +0 -1
  71. package/dist/chunk-7LZZEI25.js.map +0 -1
  72. package/dist/chunk-7W6TQO3X.js.map +0 -1
  73. package/dist/chunk-CZMFAS3E.js.map +0 -1
  74. package/dist/chunk-IUGKW2GS.js.map +0 -1
  75. package/dist/chunk-MALRKLRR.js.map +0 -1
  76. package/dist/chunk-XXBSIPJX.js.map +0 -1
  77. package/dist/hex-color-MhOyuY-o.d.ts +0 -8
  78. package/dist/runtime-api-BXd70c2e.d.ts +0 -490
  79. /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-W2-kxObe.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-W2-kxObe.js';
3
- export { a as InteractionDescriptor } from './runtime-api-BXd70c2e.js';
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
- export { b as ResourceCounterComponents } from './ResourceCounter-BTXklCEZ.js';
8
- import './hex-board-view-UCUjMALd.js';
9
- import './ui/player-state.js';
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 './hex-color-MhOyuY-o.js';
12
- import './ThemeProvider-DvMl17Ny.js';
14
+ import './ThemeProvider-B1sIoBlX.js';
13
15
  import './primitive-props-BNHDkgd7.js';
14
- import './attributes-BrZtP9az.js';
15
- import './types-BqzHkNMA.js';
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 state sync has started */
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 state-sync snapshot.
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 state sync */
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?: PluginRuntimeDiagnosticHandler;
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 RuntimeAPI instance using the SDK-provided implementation
49
- * - Waits for the first reducer-native state-sync snapshot before rendering children
50
- * - Provides RuntimeAPI and session state to all child components
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 };