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

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 (150) hide show
  1. package/README.md +462 -53
  2. package/dist/board-element-CqtxU5VZ.d.ts +13 -0
  3. package/dist/chunk-3RFGPBES.js +1792 -0
  4. package/dist/chunk-3RFGPBES.js.map +1 -0
  5. package/dist/chunk-CZRPUWCT.js +1602 -0
  6. package/dist/chunk-CZRPUWCT.js.map +1 -0
  7. package/dist/chunk-DMSXVMYY.js +7199 -0
  8. package/dist/chunk-DMSXVMYY.js.map +1 -0
  9. package/dist/chunk-U6R7FAH4.js +630 -0
  10. package/dist/chunk-U6R7FAH4.js.map +1 -0
  11. package/dist/chunk-YT3RPO5J.js +635 -0
  12. package/dist/chunk-YT3RPO5J.js.map +1 -0
  13. package/dist/diagnostics-ZAPEBlJP.d.ts +64 -0
  14. package/dist/extract-CwJWDrSD.d.ts +6850 -0
  15. package/dist/index.d.ts +5177 -1
  16. package/dist/index.js +1990 -6
  17. package/dist/index.js.map +1 -1
  18. package/dist/react.d.ts +158 -0
  19. package/dist/react.js +1119 -0
  20. package/dist/react.js.map +1 -0
  21. package/dist/reducer.d.ts +1028 -97
  22. package/dist/reducer.js +4892 -125
  23. package/dist/reducer.js.map +1 -1
  24. package/dist/shortcuts-B_RrufOM.d.ts +822 -0
  25. package/dist/testing.d.ts +529 -569
  26. package/dist/testing.js +2588 -934
  27. package/dist/testing.js.map +1 -1
  28. package/dist/types-BxXRINRF.d.ts +118 -0
  29. package/package.json +39 -144
  30. package/dist/HandView-Bi2lxzQP.d.ts +0 -79
  31. package/dist/ResourceCounter-BFxJknqp.d.ts +0 -98
  32. package/dist/ThemeProvider-CElaL2ik.d.ts +0 -99
  33. package/dist/attributes-DbvyMbXw.d.ts +0 -68
  34. package/dist/browser-interaction.d.ts +0 -910
  35. package/dist/browser-interaction.js +0 -119
  36. package/dist/browser-interaction.js.map +0 -1
  37. package/dist/chunk-32PFKDV7.js +0 -11705
  38. package/dist/chunk-32PFKDV7.js.map +0 -1
  39. package/dist/chunk-3BAD4VC2.js +0 -263
  40. package/dist/chunk-3BAD4VC2.js.map +0 -1
  41. package/dist/chunk-3SKDNDPG.js +0 -104
  42. package/dist/chunk-3SKDNDPG.js.map +0 -1
  43. package/dist/chunk-5YV2WHJ4.js +0 -25
  44. package/dist/chunk-5YV2WHJ4.js.map +0 -1
  45. package/dist/chunk-ANRB4XKA.js +0 -90
  46. package/dist/chunk-ANRB4XKA.js.map +0 -1
  47. package/dist/chunk-BI4G3PM2.js +0 -1864
  48. package/dist/chunk-BI4G3PM2.js.map +0 -1
  49. package/dist/chunk-EVCLTY4Q.js +0 -935
  50. package/dist/chunk-EVCLTY4Q.js.map +0 -1
  51. package/dist/chunk-GDPKTBUR.js +0 -564
  52. package/dist/chunk-GDPKTBUR.js.map +0 -1
  53. package/dist/chunk-H6VDGFL5.js +0 -2903
  54. package/dist/chunk-H6VDGFL5.js.map +0 -1
  55. package/dist/chunk-LR3ZTWQF.js +0 -5960
  56. package/dist/chunk-LR3ZTWQF.js.map +0 -1
  57. package/dist/chunk-PF7L4BMG.js +0 -117
  58. package/dist/chunk-PF7L4BMG.js.map +0 -1
  59. package/dist/chunk-PN5O6GG2.js +0 -32
  60. package/dist/chunk-PN5O6GG2.js.map +0 -1
  61. package/dist/chunk-PZ5AY32C.js +0 -10
  62. package/dist/chunk-PZ5AY32C.js.map +0 -1
  63. package/dist/chunk-S2JEDVWH.js +0 -7165
  64. package/dist/chunk-S2JEDVWH.js.map +0 -1
  65. package/dist/chunk-T3ZKNUZ7.js +0 -1
  66. package/dist/chunk-T3ZKNUZ7.js.map +0 -1
  67. package/dist/chunk-UGH54WZ2.js +0 -223
  68. package/dist/chunk-UGH54WZ2.js.map +0 -1
  69. package/dist/chunk-VCDWP5VL.js +0 -746
  70. package/dist/chunk-VCDWP5VL.js.map +0 -1
  71. package/dist/chunk-VDXOF4FW.js +0 -69
  72. package/dist/chunk-VDXOF4FW.js.map +0 -1
  73. package/dist/chunk-WHR5UW3F.js +0 -1988
  74. package/dist/chunk-WHR5UW3F.js.map +0 -1
  75. package/dist/chunk-Y75CFE77.js +0 -17
  76. package/dist/chunk-Y75CFE77.js.map +0 -1
  77. package/dist/chunk-Z7QCREWI.js +0 -3435
  78. package/dist/chunk-Z7QCREWI.js.map +0 -1
  79. package/dist/chunk-ZZGN2ATS.js +0 -1941
  80. package/dist/chunk-ZZGN2ATS.js.map +0 -1
  81. package/dist/components-gAbIz7hK.d.ts +0 -1284
  82. package/dist/definitions-BgmV_GhC.d.ts +0 -300
  83. package/dist/diagnostics-DIi3ina7.d.ts +0 -50
  84. package/dist/digest.d.ts +0 -8
  85. package/dist/game-CsZScpcn.d.ts +0 -763
  86. package/dist/hex-board-view-aKkblDp6.d.ts +0 -1228
  87. package/dist/index-CcT9Q7N7.d.ts +0 -193
  88. package/dist/index.d-DjzoK7zn.d.ts +0 -2101
  89. package/dist/package-set.d.ts +0 -13
  90. package/dist/package-set.js +0 -12
  91. package/dist/package-set.js.map +0 -1
  92. package/dist/player-state-Cqpyeql0.d.ts +0 -371
  93. package/dist/plugin-runtime-contract.d.ts +0 -17
  94. package/dist/plugin-runtime-contract.js +0 -92
  95. package/dist/plugin-runtime-contract.js.map +0 -1
  96. package/dist/primitive-props-BNHDkgd7.d.ts +0 -16
  97. package/dist/protocol-dYgafTYY.d.ts +0 -314
  98. package/dist/reducer/advanced.d.ts +0 -82
  99. package/dist/reducer/advanced.js +0 -51
  100. package/dist/reducer/advanced.js.map +0 -1
  101. package/dist/reducer-contract.d.ts +0 -11
  102. package/dist/reducer-contract.js +0 -16
  103. package/dist/reducer-contract.js.map +0 -1
  104. package/dist/reference-games/index.d.ts +0 -31
  105. package/dist/reference-games/index.js +0 -48
  106. package/dist/reference-games/index.js.map +0 -1
  107. package/dist/runtime/primitives.d.ts +0 -250
  108. package/dist/runtime/primitives.js +0 -189
  109. package/dist/runtime/primitives.js.map +0 -1
  110. package/dist/runtime/runtime-api.d.ts +0 -2
  111. package/dist/runtime/runtime-api.js +0 -1
  112. package/dist/runtime/runtime-api.js.map +0 -1
  113. package/dist/runtime/workspace-contract.d.ts +0 -392
  114. package/dist/runtime/workspace-contract.js +0 -28
  115. package/dist/runtime/workspace-contract.js.map +0 -1
  116. package/dist/runtime-RJ5orDJU.d.ts +0 -1699
  117. package/dist/runtime-api-Bz5pwNU_.d.ts +0 -296
  118. package/dist/runtime-json-CQ9QbLZ5.d.ts +0 -5
  119. package/dist/runtime.d.ts +0 -83
  120. package/dist/runtime.js +0 -242
  121. package/dist/runtime.js.map +0 -1
  122. package/dist/schema.d.ts +0 -379
  123. package/dist/stale-contract-artifact-error-XLaweZtF.d.ts +0 -18
  124. package/dist/testing-compiler.d.ts +0 -37
  125. package/dist/testing-compiler.js +0 -272
  126. package/dist/testing-compiler.js.map +0 -1
  127. package/dist/testing-runtime.d.ts +0 -119
  128. package/dist/testing-runtime.js +0 -212
  129. package/dist/testing-runtime.js.map +0 -1
  130. package/dist/types-DJj5MJkl.d.ts +0 -256
  131. package/dist/types-DR7DoB1x.d.ts +0 -28
  132. package/dist/types-JWCYHmu7.d.ts +0 -122
  133. package/dist/types.d.ts +0 -1958
  134. package/dist/types.js +0 -14
  135. package/dist/types.js.map +0 -1
  136. package/dist/ui/components.d.ts +0 -17
  137. package/dist/ui/components.js +0 -216
  138. package/dist/ui/components.js.map +0 -1
  139. package/dist/ui/defaults.d.ts +0 -19
  140. package/dist/ui/defaults.js +0 -104
  141. package/dist/ui/defaults.js.map +0 -1
  142. package/dist/ui/player-state.d.ts +0 -2
  143. package/dist/ui/player-state.js +0 -1
  144. package/dist/ui/player-state.js.map +0 -1
  145. package/dist/ui/plugin-styles.css +0 -2
  146. package/dist/ui-contract-GTUPkf8z.d.ts +0 -1168
  147. package/dist/ui.d.ts +0 -317
  148. package/dist/ui.js +0 -277
  149. package/dist/ui.js.map +0 -1
  150. 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 };