@dreamboard-games/sdk 0.5.0-alpha.2 → 0.5.0-alpha.4

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 (151) hide show
  1. package/README.md +186 -45
  2. package/dist/board-target-B0QG6OYx.d.ts +8 -0
  3. package/dist/chunk-3JXUL4VN.js +139 -0
  4. package/dist/chunk-3JXUL4VN.js.map +1 -0
  5. package/dist/{chunk-S2JEDVWH.js → chunk-C77SYIVT.js} +6102 -6505
  6. package/dist/chunk-C77SYIVT.js.map +1 -0
  7. package/dist/chunk-DMFVAZI2.js +16 -0
  8. package/dist/chunk-DMFVAZI2.js.map +1 -0
  9. package/dist/chunk-OOFMBCFF.js +1338 -0
  10. package/dist/chunk-OOFMBCFF.js.map +1 -0
  11. package/dist/chunk-UG2Q4NLG.js +590 -0
  12. package/dist/chunk-UG2Q4NLG.js.map +1 -0
  13. package/dist/chunk-XU6WJW6K.js +847 -0
  14. package/dist/chunk-XU6WJW6K.js.map +1 -0
  15. package/dist/diagnostics-B8d5aLad.d.ts +65 -0
  16. package/dist/extract-gVKcB8Og.d.ts +4736 -0
  17. package/dist/index.d.ts +3782 -1
  18. package/dist/index.js +1096 -6
  19. package/dist/index.js.map +1 -1
  20. package/dist/model-vdpLHrxh.d.ts +432 -0
  21. package/dist/react.d.ts +60 -0
  22. package/dist/react.js +208 -0
  23. package/dist/react.js.map +1 -0
  24. package/dist/reducer.d.ts +1244 -78
  25. package/dist/reducer.js +4204 -121
  26. package/dist/reducer.js.map +1 -1
  27. package/dist/testing.d.ts +520 -564
  28. package/dist/testing.js +2451 -915
  29. package/dist/testing.js.map +1 -1
  30. package/dist/types-Bj5ZLTUV.d.ts +114 -0
  31. package/package.json +40 -142
  32. package/dist/HandView-Bi2lxzQP.d.ts +0 -79
  33. package/dist/ResourceCounter-BFxJknqp.d.ts +0 -98
  34. package/dist/ThemeProvider-CElaL2ik.d.ts +0 -99
  35. package/dist/attributes-DbvyMbXw.d.ts +0 -68
  36. package/dist/browser-interaction.d.ts +0 -910
  37. package/dist/browser-interaction.js +0 -119
  38. package/dist/browser-interaction.js.map +0 -1
  39. package/dist/chunk-32PFKDV7.js +0 -11705
  40. package/dist/chunk-32PFKDV7.js.map +0 -1
  41. package/dist/chunk-3BAD4VC2.js +0 -263
  42. package/dist/chunk-3BAD4VC2.js.map +0 -1
  43. package/dist/chunk-3SKDNDPG.js +0 -104
  44. package/dist/chunk-3SKDNDPG.js.map +0 -1
  45. package/dist/chunk-5YV2WHJ4.js +0 -25
  46. package/dist/chunk-5YV2WHJ4.js.map +0 -1
  47. package/dist/chunk-ANRB4XKA.js +0 -90
  48. package/dist/chunk-ANRB4XKA.js.map +0 -1
  49. package/dist/chunk-BI4G3PM2.js +0 -1864
  50. package/dist/chunk-BI4G3PM2.js.map +0 -1
  51. package/dist/chunk-EVCLTY4Q.js +0 -935
  52. package/dist/chunk-EVCLTY4Q.js.map +0 -1
  53. package/dist/chunk-GDPKTBUR.js +0 -564
  54. package/dist/chunk-GDPKTBUR.js.map +0 -1
  55. package/dist/chunk-H6VDGFL5.js +0 -2903
  56. package/dist/chunk-H6VDGFL5.js.map +0 -1
  57. package/dist/chunk-LR3ZTWQF.js +0 -5960
  58. package/dist/chunk-LR3ZTWQF.js.map +0 -1
  59. package/dist/chunk-PF7L4BMG.js +0 -117
  60. package/dist/chunk-PF7L4BMG.js.map +0 -1
  61. package/dist/chunk-PN5O6GG2.js +0 -32
  62. package/dist/chunk-PN5O6GG2.js.map +0 -1
  63. package/dist/chunk-PZ5AY32C.js +0 -10
  64. package/dist/chunk-PZ5AY32C.js.map +0 -1
  65. package/dist/chunk-S2JEDVWH.js.map +0 -1
  66. package/dist/chunk-T3ZKNUZ7.js +0 -1
  67. package/dist/chunk-T3ZKNUZ7.js.map +0 -1
  68. package/dist/chunk-UGH54WZ2.js +0 -223
  69. package/dist/chunk-UGH54WZ2.js.map +0 -1
  70. package/dist/chunk-VCDWP5VL.js +0 -746
  71. package/dist/chunk-VCDWP5VL.js.map +0 -1
  72. package/dist/chunk-VDXOF4FW.js +0 -69
  73. package/dist/chunk-VDXOF4FW.js.map +0 -1
  74. package/dist/chunk-WHR5UW3F.js +0 -1988
  75. package/dist/chunk-WHR5UW3F.js.map +0 -1
  76. package/dist/chunk-Y75CFE77.js +0 -17
  77. package/dist/chunk-Y75CFE77.js.map +0 -1
  78. package/dist/chunk-Z7QCREWI.js +0 -3435
  79. package/dist/chunk-Z7QCREWI.js.map +0 -1
  80. package/dist/chunk-ZZGN2ATS.js +0 -1941
  81. package/dist/chunk-ZZGN2ATS.js.map +0 -1
  82. package/dist/components-gAbIz7hK.d.ts +0 -1284
  83. package/dist/definitions-BgmV_GhC.d.ts +0 -300
  84. package/dist/diagnostics-DIi3ina7.d.ts +0 -50
  85. package/dist/digest.d.ts +0 -8
  86. package/dist/game-CsZScpcn.d.ts +0 -763
  87. package/dist/hex-board-view-aKkblDp6.d.ts +0 -1228
  88. package/dist/index-CcT9Q7N7.d.ts +0 -193
  89. package/dist/index.d-DjzoK7zn.d.ts +0 -2101
  90. package/dist/package-set.d.ts +0 -13
  91. package/dist/package-set.js +0 -12
  92. package/dist/package-set.js.map +0 -1
  93. package/dist/player-state-Cqpyeql0.d.ts +0 -371
  94. package/dist/plugin-runtime-contract.d.ts +0 -17
  95. package/dist/plugin-runtime-contract.js +0 -92
  96. package/dist/plugin-runtime-contract.js.map +0 -1
  97. package/dist/primitive-props-BNHDkgd7.d.ts +0 -16
  98. package/dist/protocol-dYgafTYY.d.ts +0 -314
  99. package/dist/reducer/advanced.d.ts +0 -82
  100. package/dist/reducer/advanced.js +0 -51
  101. package/dist/reducer/advanced.js.map +0 -1
  102. package/dist/reducer-contract.d.ts +0 -11
  103. package/dist/reducer-contract.js +0 -16
  104. package/dist/reducer-contract.js.map +0 -1
  105. package/dist/reference-games/index.d.ts +0 -31
  106. package/dist/reference-games/index.js +0 -48
  107. package/dist/reference-games/index.js.map +0 -1
  108. package/dist/runtime/primitives.d.ts +0 -250
  109. package/dist/runtime/primitives.js +0 -189
  110. package/dist/runtime/primitives.js.map +0 -1
  111. package/dist/runtime/runtime-api.d.ts +0 -2
  112. package/dist/runtime/runtime-api.js +0 -1
  113. package/dist/runtime/runtime-api.js.map +0 -1
  114. package/dist/runtime/workspace-contract.d.ts +0 -392
  115. package/dist/runtime/workspace-contract.js +0 -28
  116. package/dist/runtime/workspace-contract.js.map +0 -1
  117. package/dist/runtime-RJ5orDJU.d.ts +0 -1699
  118. package/dist/runtime-api-Bz5pwNU_.d.ts +0 -296
  119. package/dist/runtime-json-CQ9QbLZ5.d.ts +0 -5
  120. package/dist/runtime.d.ts +0 -83
  121. package/dist/runtime.js +0 -242
  122. package/dist/runtime.js.map +0 -1
  123. package/dist/schema.d.ts +0 -379
  124. package/dist/stale-contract-artifact-error-XLaweZtF.d.ts +0 -18
  125. package/dist/testing-compiler.d.ts +0 -37
  126. package/dist/testing-compiler.js +0 -272
  127. package/dist/testing-compiler.js.map +0 -1
  128. package/dist/testing-runtime.d.ts +0 -119
  129. package/dist/testing-runtime.js +0 -212
  130. package/dist/testing-runtime.js.map +0 -1
  131. package/dist/types-DJj5MJkl.d.ts +0 -256
  132. package/dist/types-DR7DoB1x.d.ts +0 -28
  133. package/dist/types-JWCYHmu7.d.ts +0 -122
  134. package/dist/types.d.ts +0 -1958
  135. package/dist/types.js +0 -14
  136. package/dist/types.js.map +0 -1
  137. package/dist/ui/components.d.ts +0 -17
  138. package/dist/ui/components.js +0 -216
  139. package/dist/ui/components.js.map +0 -1
  140. package/dist/ui/defaults.d.ts +0 -19
  141. package/dist/ui/defaults.js +0 -104
  142. package/dist/ui/defaults.js.map +0 -1
  143. package/dist/ui/player-state.d.ts +0 -2
  144. package/dist/ui/player-state.js +0 -1
  145. package/dist/ui/player-state.js.map +0 -1
  146. package/dist/ui/plugin-styles.css +0 -2
  147. package/dist/ui-contract-GTUPkf8z.d.ts +0 -1168
  148. package/dist/ui.d.ts +0 -317
  149. package/dist/ui.js +0 -277
  150. package/dist/ui.js.map +0 -1
  151. package/dist/views-BpuWcOyN.d.ts +0 -1641
@@ -1,193 +0,0 @@
1
- import { ReactNode, ReactElement, ButtonHTMLAttributes } from 'react';
2
- import { m as BoardSpaceTargetProps, bl as ZoneListProps, b5 as UIContract } from './ui-contract-GTUPkf8z.js';
3
- import { P as InteractionVisualState } from './hex-board-view-aKkblDp6.js';
4
- import { H as HandRole } from './ResourceCounter-BFxJknqp.js';
5
-
6
- interface ClientParamSchema {
7
- safeParse: (value: unknown) => {
8
- success: true;
9
- data: Record<string, unknown>;
10
- } | {
11
- success: false;
12
- error: {
13
- issues: ReadonlyArray<{
14
- path: readonly PropertyKey[];
15
- message: string;
16
- }>;
17
- };
18
- };
19
- }
20
- type ClientParamSchemaMap = Readonly<Record<string, Readonly<Record<string, ClientParamSchema>>>>;
21
-
22
- type WorkspaceInteractionSlotComponent<Props = object> = (props: Props extends {
23
- children: unknown;
24
- } ? Props : Props & {
25
- children?: ReactNode;
26
- }) => ReactElement | null;
27
- interface WorkspaceFormInputSlot<Input extends string = string> {
28
- readonly Field: WorkspaceInteractionSlotComponent;
29
- readonly Options: WorkspaceInteractionSlotComponent<{
30
- children?: (option: {
31
- value: unknown;
32
- label: string;
33
- }) => ReactNode;
34
- }>;
35
- readonly Value: WorkspaceInteractionSlotComponent<{
36
- children: (value: unknown | undefined) => ReactNode;
37
- }>;
38
- readonly Default: WorkspaceInteractionSlotComponent;
39
- readonly __input?: Input;
40
- }
41
- interface WorkspaceCardInputSlot<Card extends string = string> {
42
- readonly Card: WorkspaceInteractionSlotComponent<{
43
- value: Card;
44
- } & Omit<ButtonHTMLAttributes<HTMLButtonElement>, "children" | "disabled" | "aria-disabled" | "aria-pressed" | "onClick" | "type" | "value">>;
45
- readonly Cards: WorkspaceInteractionSlotComponent<{
46
- children: (card: {
47
- id: Card;
48
- }) => ReactNode;
49
- }>;
50
- readonly Value: WorkspaceInteractionSlotComponent<{
51
- children: (value: unknown | undefined) => ReactNode;
52
- }>;
53
- readonly Default: WorkspaceInteractionSlotComponent;
54
- }
55
- interface WorkspaceBoardTargetInputSlot<Kind extends "space" | "edge" | "vertex" | "tile", Target extends string = string> {
56
- readonly Target: WorkspaceInteractionSlotComponent<{
57
- value: Target;
58
- } & Omit<ButtonHTMLAttributes<HTMLButtonElement>, "children" | "disabled" | "aria-disabled" | "aria-pressed" | "onClick" | "type" | "value">>;
59
- readonly Value: WorkspaceInteractionSlotComponent<{
60
- children: (value: unknown | undefined) => ReactNode;
61
- }>;
62
- readonly Default: WorkspaceInteractionSlotComponent;
63
- readonly __kind?: Kind;
64
- }
65
- interface WorkspaceBoardSurface<Space extends string = string, Edge extends string = string, Vertex extends string = string, Tile extends string = string> {
66
- readonly Root: WorkspaceInteractionSlotComponent;
67
- readonly Space: <Target extends Space>(props: BoardSpaceTargetProps<Target>) => ReactElement | null;
68
- readonly slot: {
69
- readonly space: WorkspaceBoardTargetInputSlot<"space", Space>;
70
- readonly playerSpace: WorkspaceBoardTargetInputSlot<"space", Space>;
71
- readonly edge: WorkspaceBoardTargetInputSlot<"edge", Edge>;
72
- readonly vertex: WorkspaceBoardTargetInputSlot<"vertex", Vertex>;
73
- readonly tile: WorkspaceBoardTargetInputSlot<"tile", Tile>;
74
- };
75
- }
76
- type WorkspaceZoneCardsComponent<Card> = WorkspaceInteractionSlotComponent<Omit<ZoneListProps, "children" | "empty"> & {
77
- empty?: ReactNode;
78
- children: (card: Card) => ReactNode;
79
- }>;
80
- type WorkspaceZoneCardComponent<Card> = WorkspaceInteractionSlotComponent<Omit<ButtonHTMLAttributes<HTMLButtonElement>, "type" | "value"> & {
81
- card: Card;
82
- }>;
83
- type WorkspaceZoneStagingComponent<Card> = WorkspaceInteractionSlotComponent<{
84
- children: (card: Card) => ReactNode;
85
- label?: ReactNode;
86
- renderEmptySlot?: (index: number) => ReactNode;
87
- cardSize?: "sm" | "md" | "lg";
88
- ariaLabel?: string;
89
- className?: string;
90
- }>;
91
- type WorkspaceHandCardsComponent<Card> = WorkspaceInteractionSlotComponent<{
92
- children: (card: Card, state: unknown) => ReactNode;
93
- }>;
94
- type WorkspaceHandSummaryComponent = WorkspaceInteractionSlotComponent<{
95
- children?: ReactNode | ((summary: unknown) => ReactNode);
96
- }>;
97
- interface WorkspaceHandSurface<Zone extends string, Card> {
98
- readonly Hand: WorkspaceInteractionSlotComponent<{
99
- children: ReactNode | ((card: Card, state: InteractionVisualState) => ReactNode);
100
- }>;
101
- readonly Cards: WorkspaceHandCardsComponent<Card>;
102
- readonly Summary: WorkspaceHandSummaryComponent;
103
- readonly Actions: WorkspaceHandSummaryComponent;
104
- readonly Card: WorkspaceZoneCardComponent<Card>;
105
- readonly Staging: WorkspaceZoneStagingComponent<Card>;
106
- readonly slot: {
107
- readonly card: WorkspaceCardInputSlot<Zone>;
108
- };
109
- }
110
- interface WorkspacePileSurface<Card> {
111
- readonly Pile: WorkspaceZoneCardsComponent<Card>;
112
- readonly Card: WorkspaceZoneCardComponent<Card>;
113
- }
114
- interface WorkspaceCardCollectionSurface<Zone extends string, Card> {
115
- readonly Collection: WorkspaceZoneCardsComponent<Card>;
116
- readonly Card: WorkspaceZoneCardComponent<Card>;
117
- readonly slot: {
118
- readonly card: WorkspaceCardInputSlot<Zone>;
119
- };
120
- }
121
- interface WorkspaceBoardSurfaceDescriptor<Board extends string = string> {
122
- readonly kind: "board";
123
- readonly board: Board;
124
- }
125
- interface WorkspaceHandSurfaceDescriptor<Zone extends string = string> {
126
- readonly kind: "hand";
127
- readonly zone: Zone;
128
- readonly role: HandRole;
129
- readonly label: string;
130
- readonly order?: number;
131
- }
132
- interface WorkspacePileSurfaceDescriptor<Zone extends string = string> {
133
- readonly kind: "pile";
134
- readonly zone: Zone;
135
- }
136
- interface WorkspacePilesSurfaceDescriptor<Zones extends readonly string[] = readonly string[]> {
137
- readonly kind: "piles";
138
- readonly zones: Zones;
139
- }
140
- interface WorkspaceCardCollectionSurfaceDescriptor<Zones extends readonly string[] = readonly string[]> {
141
- readonly kind: "cardCollection";
142
- readonly zones: Zones;
143
- readonly mode?: "all" | "top-card";
144
- }
145
- interface WorkspaceInteractionFormsDescriptor<Interactions extends Readonly<Record<string, string>> = Readonly<Record<string, string>>> {
146
- readonly kind: "forms";
147
- readonly interactions: Interactions;
148
- }
149
- interface WorkspaceInteractionFormDescriptor<Interaction extends string = string> {
150
- readonly kind: "form";
151
- readonly interaction: Interaction;
152
- }
153
- type WorkspaceSurfaceDescriptor = WorkspaceBoardSurfaceDescriptor | WorkspaceHandSurfaceDescriptor | WorkspacePileSurfaceDescriptor | WorkspacePilesSurfaceDescriptor | WorkspaceCardCollectionSurfaceDescriptor | WorkspaceInteractionFormDescriptor | WorkspaceInteractionFormsDescriptor;
154
- interface WorkspaceSurfaceSpec {
155
- readonly [key: string]: WorkspaceSurfaceDescriptor | WorkspaceSurfaceSpec;
156
- }
157
- interface WorkspaceContractOptions<Contract extends UIContract, Resource extends string, Card, HexBoards extends Record<string, unknown>, SquareBoards extends Record<string, unknown> = Record<string, unknown>> {
158
- readonly uiContract: Contract;
159
- readonly clientParamSchemasByPhase?: ClientParamSchemaMap;
160
- readonly formInputKeysForInteraction: (interaction: string) => ReadonlySet<string>;
161
- readonly resourceIds: readonly Resource[];
162
- readonly resourcePresentationById?: Partial<Record<string, {
163
- label?: string;
164
- icon?: string;
165
- }>>;
166
- readonly hexStaticBoards: HexBoards;
167
- readonly squareStaticBoards?: SquareBoards;
168
- readonly cardIdFromZoneCard: (card: Card) => string;
169
- readonly zoneIdFromZoneCard: (card: Card) => string;
170
- }
171
-
172
- interface DefineGameUIConfig<GameState, Surfaces> {
173
- useSurfaces: () => Surfaces;
174
- interactionRoutes?: (context: {
175
- game: GameState;
176
- surfaces: Surfaces;
177
- }) => Record<string, {
178
- collect: Record<string, unknown>;
179
- }>;
180
- phases: Record<string, (context: {
181
- game: GameState;
182
- surfaces: Surfaces;
183
- }) => ReactNode>;
184
- renderInteractions?: (context: {
185
- game: GameState;
186
- surfaces: Surfaces;
187
- }) => ReactNode;
188
- fallback?: ReactNode | ((phase: string | null) => ReactNode);
189
- includeUnavailableInteractions?: boolean | null;
190
- }
191
- declare function createWorkspaceUIContract<WorkspaceUI, Contract extends UIContract, Resource extends string, Card, HexBoards extends Record<string, unknown>, SquareBoards extends Record<string, unknown> = Record<string, unknown>>(options: WorkspaceContractOptions<Contract, Resource, Card, HexBoards, SquareBoards>): WorkspaceUI;
192
-
193
- export { type ClientParamSchema as C, type DefineGameUIConfig as D, type WorkspaceBoardSurface as W, type ClientParamSchemaMap as a, type WorkspaceBoardSurfaceDescriptor as b, type WorkspaceBoardTargetInputSlot as c, type WorkspaceCardCollectionSurface as d, type WorkspaceCardCollectionSurfaceDescriptor as e, type WorkspaceCardInputSlot as f, type WorkspaceFormInputSlot as g, type WorkspaceHandSurface as h, type WorkspaceHandSurfaceDescriptor as i, type WorkspaceInteractionFormDescriptor as j, type WorkspaceInteractionFormsDescriptor as k, type WorkspaceInteractionSlotComponent as l, type WorkspacePileSurface as m, type WorkspacePileSurfaceDescriptor as n, type WorkspacePilesSurfaceDescriptor as o, type WorkspaceSurfaceSpec as p, createWorkspaceUIContract as q };