@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.
- package/README.md +186 -45
- package/dist/board-target-B0QG6OYx.d.ts +8 -0
- package/dist/chunk-3JXUL4VN.js +139 -0
- package/dist/chunk-3JXUL4VN.js.map +1 -0
- package/dist/{chunk-S2JEDVWH.js → chunk-C77SYIVT.js} +6102 -6505
- package/dist/chunk-C77SYIVT.js.map +1 -0
- package/dist/chunk-DMFVAZI2.js +16 -0
- package/dist/chunk-DMFVAZI2.js.map +1 -0
- package/dist/chunk-OOFMBCFF.js +1338 -0
- package/dist/chunk-OOFMBCFF.js.map +1 -0
- package/dist/chunk-UG2Q4NLG.js +590 -0
- package/dist/chunk-UG2Q4NLG.js.map +1 -0
- package/dist/chunk-XU6WJW6K.js +847 -0
- package/dist/chunk-XU6WJW6K.js.map +1 -0
- package/dist/diagnostics-B8d5aLad.d.ts +65 -0
- package/dist/extract-gVKcB8Og.d.ts +4736 -0
- package/dist/index.d.ts +3782 -1
- package/dist/index.js +1096 -6
- package/dist/index.js.map +1 -1
- package/dist/model-vdpLHrxh.d.ts +432 -0
- package/dist/react.d.ts +60 -0
- package/dist/react.js +208 -0
- package/dist/react.js.map +1 -0
- package/dist/reducer.d.ts +1244 -78
- package/dist/reducer.js +4204 -121
- package/dist/reducer.js.map +1 -1
- package/dist/testing.d.ts +520 -564
- package/dist/testing.js +2451 -915
- package/dist/testing.js.map +1 -1
- package/dist/types-Bj5ZLTUV.d.ts +114 -0
- package/package.json +40 -142
- package/dist/HandView-Bi2lxzQP.d.ts +0 -79
- package/dist/ResourceCounter-BFxJknqp.d.ts +0 -98
- package/dist/ThemeProvider-CElaL2ik.d.ts +0 -99
- package/dist/attributes-DbvyMbXw.d.ts +0 -68
- package/dist/browser-interaction.d.ts +0 -910
- package/dist/browser-interaction.js +0 -119
- package/dist/browser-interaction.js.map +0 -1
- package/dist/chunk-32PFKDV7.js +0 -11705
- package/dist/chunk-32PFKDV7.js.map +0 -1
- package/dist/chunk-3BAD4VC2.js +0 -263
- package/dist/chunk-3BAD4VC2.js.map +0 -1
- package/dist/chunk-3SKDNDPG.js +0 -104
- package/dist/chunk-3SKDNDPG.js.map +0 -1
- package/dist/chunk-5YV2WHJ4.js +0 -25
- package/dist/chunk-5YV2WHJ4.js.map +0 -1
- package/dist/chunk-ANRB4XKA.js +0 -90
- package/dist/chunk-ANRB4XKA.js.map +0 -1
- package/dist/chunk-BI4G3PM2.js +0 -1864
- package/dist/chunk-BI4G3PM2.js.map +0 -1
- package/dist/chunk-EVCLTY4Q.js +0 -935
- package/dist/chunk-EVCLTY4Q.js.map +0 -1
- package/dist/chunk-GDPKTBUR.js +0 -564
- package/dist/chunk-GDPKTBUR.js.map +0 -1
- package/dist/chunk-H6VDGFL5.js +0 -2903
- package/dist/chunk-H6VDGFL5.js.map +0 -1
- package/dist/chunk-LR3ZTWQF.js +0 -5960
- package/dist/chunk-LR3ZTWQF.js.map +0 -1
- package/dist/chunk-PF7L4BMG.js +0 -117
- package/dist/chunk-PF7L4BMG.js.map +0 -1
- package/dist/chunk-PN5O6GG2.js +0 -32
- package/dist/chunk-PN5O6GG2.js.map +0 -1
- package/dist/chunk-PZ5AY32C.js +0 -10
- package/dist/chunk-PZ5AY32C.js.map +0 -1
- package/dist/chunk-S2JEDVWH.js.map +0 -1
- package/dist/chunk-T3ZKNUZ7.js +0 -1
- package/dist/chunk-T3ZKNUZ7.js.map +0 -1
- package/dist/chunk-UGH54WZ2.js +0 -223
- package/dist/chunk-UGH54WZ2.js.map +0 -1
- package/dist/chunk-VCDWP5VL.js +0 -746
- package/dist/chunk-VCDWP5VL.js.map +0 -1
- package/dist/chunk-VDXOF4FW.js +0 -69
- package/dist/chunk-VDXOF4FW.js.map +0 -1
- package/dist/chunk-WHR5UW3F.js +0 -1988
- package/dist/chunk-WHR5UW3F.js.map +0 -1
- package/dist/chunk-Y75CFE77.js +0 -17
- package/dist/chunk-Y75CFE77.js.map +0 -1
- package/dist/chunk-Z7QCREWI.js +0 -3435
- package/dist/chunk-Z7QCREWI.js.map +0 -1
- package/dist/chunk-ZZGN2ATS.js +0 -1941
- package/dist/chunk-ZZGN2ATS.js.map +0 -1
- package/dist/components-gAbIz7hK.d.ts +0 -1284
- package/dist/definitions-BgmV_GhC.d.ts +0 -300
- package/dist/diagnostics-DIi3ina7.d.ts +0 -50
- package/dist/digest.d.ts +0 -8
- package/dist/game-CsZScpcn.d.ts +0 -763
- package/dist/hex-board-view-aKkblDp6.d.ts +0 -1228
- package/dist/index-CcT9Q7N7.d.ts +0 -193
- package/dist/index.d-DjzoK7zn.d.ts +0 -2101
- package/dist/package-set.d.ts +0 -13
- package/dist/package-set.js +0 -12
- package/dist/package-set.js.map +0 -1
- package/dist/player-state-Cqpyeql0.d.ts +0 -371
- package/dist/plugin-runtime-contract.d.ts +0 -17
- package/dist/plugin-runtime-contract.js +0 -92
- package/dist/plugin-runtime-contract.js.map +0 -1
- package/dist/primitive-props-BNHDkgd7.d.ts +0 -16
- package/dist/protocol-dYgafTYY.d.ts +0 -314
- package/dist/reducer/advanced.d.ts +0 -82
- package/dist/reducer/advanced.js +0 -51
- package/dist/reducer/advanced.js.map +0 -1
- package/dist/reducer-contract.d.ts +0 -11
- package/dist/reducer-contract.js +0 -16
- package/dist/reducer-contract.js.map +0 -1
- package/dist/reference-games/index.d.ts +0 -31
- package/dist/reference-games/index.js +0 -48
- package/dist/reference-games/index.js.map +0 -1
- package/dist/runtime/primitives.d.ts +0 -250
- package/dist/runtime/primitives.js +0 -189
- package/dist/runtime/primitives.js.map +0 -1
- package/dist/runtime/runtime-api.d.ts +0 -2
- package/dist/runtime/runtime-api.js +0 -1
- package/dist/runtime/runtime-api.js.map +0 -1
- package/dist/runtime/workspace-contract.d.ts +0 -392
- package/dist/runtime/workspace-contract.js +0 -28
- package/dist/runtime/workspace-contract.js.map +0 -1
- package/dist/runtime-RJ5orDJU.d.ts +0 -1699
- package/dist/runtime-api-Bz5pwNU_.d.ts +0 -296
- package/dist/runtime-json-CQ9QbLZ5.d.ts +0 -5
- package/dist/runtime.d.ts +0 -83
- package/dist/runtime.js +0 -242
- package/dist/runtime.js.map +0 -1
- package/dist/schema.d.ts +0 -379
- package/dist/stale-contract-artifact-error-XLaweZtF.d.ts +0 -18
- package/dist/testing-compiler.d.ts +0 -37
- package/dist/testing-compiler.js +0 -272
- package/dist/testing-compiler.js.map +0 -1
- package/dist/testing-runtime.d.ts +0 -119
- package/dist/testing-runtime.js +0 -212
- package/dist/testing-runtime.js.map +0 -1
- package/dist/types-DJj5MJkl.d.ts +0 -256
- package/dist/types-DR7DoB1x.d.ts +0 -28
- package/dist/types-JWCYHmu7.d.ts +0 -122
- package/dist/types.d.ts +0 -1958
- package/dist/types.js +0 -14
- package/dist/types.js.map +0 -1
- package/dist/ui/components.d.ts +0 -17
- package/dist/ui/components.js +0 -216
- package/dist/ui/components.js.map +0 -1
- package/dist/ui/defaults.d.ts +0 -19
- package/dist/ui/defaults.js +0 -104
- package/dist/ui/defaults.js.map +0 -1
- package/dist/ui/player-state.d.ts +0 -2
- package/dist/ui/player-state.js +0 -1
- package/dist/ui/player-state.js.map +0 -1
- package/dist/ui/plugin-styles.css +0 -2
- package/dist/ui-contract-GTUPkf8z.d.ts +0 -1168
- package/dist/ui.d.ts +0 -317
- package/dist/ui.js +0 -277
- package/dist/ui.js.map +0 -1
- package/dist/views-BpuWcOyN.d.ts +0 -1641
package/dist/index-CcT9Q7N7.d.ts
DELETED
|
@@ -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 };
|