@dreamboard-games/sdk 0.4.0-alpha.2 → 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 +31 -4
- package/dist/authoring/index.js +1 -1
- package/dist/{chunk-HWJS3VOJ.js → chunk-BKD7XAWB.js} +2 -2
- package/dist/{chunk-ZAS2SENW.js → chunk-DQ7GCD6C.js} +2 -2
- package/dist/{chunk-ZAS2SENW.js.map → chunk-DQ7GCD6C.js.map} +1 -1
- package/dist/index-BLwlj7mO.d.ts +191 -0
- package/dist/index.js +2 -2
- package/dist/package-set.d.ts +2 -2
- package/dist/package-set.js +2 -2
- package/dist/runtime/workspace-contract.d.ts +13 -170
- package/dist/runtime.d.ts +1 -1
- package/package.json +1 -1
- /package/dist/{chunk-HWJS3VOJ.js.map → chunk-BKD7XAWB.js.map} +0 -0
package/REFERENCE.md
CHANGED
|
@@ -47,7 +47,7 @@ _No JSDoc summary is available yet._
|
|
|
47
47
|
|
|
48
48
|
```ts
|
|
49
49
|
const DREAMBOARD_SDK_PACKAGES: {
|
|
50
|
-
readonly "@dreamboard-games/sdk": "0.4.0-alpha.
|
|
50
|
+
readonly "@dreamboard-games/sdk": "0.4.0-alpha.3";
|
|
51
51
|
};
|
|
52
52
|
```
|
|
53
53
|
|
|
@@ -56,7 +56,7 @@ _No JSDoc summary is available yet._
|
|
|
56
56
|
### DREAMBOARD_SDK_VERSION
|
|
57
57
|
|
|
58
58
|
```ts
|
|
59
|
-
const DREAMBOARD_SDK_VERSION: "0.4.0-alpha.
|
|
59
|
+
const DREAMBOARD_SDK_VERSION: "0.4.0-alpha.3";
|
|
60
60
|
```
|
|
61
61
|
|
|
62
62
|
_No JSDoc summary is available yet._
|
|
@@ -95,7 +95,7 @@ _No JSDoc summary is available yet._
|
|
|
95
95
|
|
|
96
96
|
```ts
|
|
97
97
|
const DREAMBOARD_SDK_PACKAGES: {
|
|
98
|
-
readonly "@dreamboard-games/sdk": "0.4.0-alpha.
|
|
98
|
+
readonly "@dreamboard-games/sdk": "0.4.0-alpha.3";
|
|
99
99
|
};
|
|
100
100
|
```
|
|
101
101
|
|
|
@@ -104,7 +104,7 @@ _No JSDoc summary is available yet._
|
|
|
104
104
|
### DREAMBOARD_SDK_VERSION
|
|
105
105
|
|
|
106
106
|
```ts
|
|
107
|
-
const DREAMBOARD_SDK_VERSION: "0.4.0-alpha.
|
|
107
|
+
const DREAMBOARD_SDK_VERSION: "0.4.0-alpha.3";
|
|
108
108
|
```
|
|
109
109
|
|
|
110
110
|
_No JSDoc summary is available yet._
|
|
@@ -18395,6 +18395,14 @@ function createWorkspaceUIContract<
|
|
|
18395
18395
|
|
|
18396
18396
|
_No JSDoc summary is available yet._
|
|
18397
18397
|
|
|
18398
|
+
### DefineGameUIConfig
|
|
18399
|
+
|
|
18400
|
+
```ts
|
|
18401
|
+
interface DefineGameUIConfig { ... }
|
|
18402
|
+
```
|
|
18403
|
+
|
|
18404
|
+
_No JSDoc summary is available yet._
|
|
18405
|
+
|
|
18398
18406
|
### DreamboardUI
|
|
18399
18407
|
|
|
18400
18408
|
```ts
|
|
@@ -18631,6 +18639,25 @@ interface WorkspaceInteractionFormDescriptor<
|
|
|
18631
18639
|
|
|
18632
18640
|
_No JSDoc summary is available yet._
|
|
18633
18641
|
|
|
18642
|
+
### WorkspaceInteractionFormDialogProps
|
|
18643
|
+
|
|
18644
|
+
```ts
|
|
18645
|
+
interface WorkspaceInteractionFormDialogProps extends Omit<
|
|
18646
|
+
InteractionDialogProps,
|
|
18647
|
+
"children"
|
|
18648
|
+
> {
|
|
18649
|
+
title: ReactNode;
|
|
18650
|
+
description?: ReactNode;
|
|
18651
|
+
trigger?: ReactNode;
|
|
18652
|
+
children: ReactNode;
|
|
18653
|
+
contentClassName?: string;
|
|
18654
|
+
overlayClassName?: string;
|
|
18655
|
+
showCloseButton?: boolean;
|
|
18656
|
+
}
|
|
18657
|
+
```
|
|
18658
|
+
|
|
18659
|
+
_No JSDoc summary is available yet._
|
|
18660
|
+
|
|
18634
18661
|
### WorkspaceInteractionFormsDescriptor
|
|
18635
18662
|
|
|
18636
18663
|
```ts
|
package/dist/authoring/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
GENERATED_AUTHORING_METADATA
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-DQ7GCD6C.js";
|
|
4
4
|
|
|
5
5
|
// src/package-set.ts
|
|
6
6
|
var DREAMBOARD_SDK_VERSION = GENERATED_AUTHORING_METADATA.sdkVersion;
|
|
@@ -18,4 +18,4 @@ export {
|
|
|
18
18
|
DREAMBOARD_SDK_PACKAGES,
|
|
19
19
|
DREAMBOARD_SDK_PACKAGE_SET
|
|
20
20
|
};
|
|
21
|
-
//# sourceMappingURL=chunk-
|
|
21
|
+
//# sourceMappingURL=chunk-BKD7XAWB.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// src/authoring/generated-metadata.ts
|
|
2
2
|
var GENERATED_AUTHORING_METADATA = {
|
|
3
|
-
sdkVersion: "0.4.0-alpha.
|
|
3
|
+
sdkVersion: "0.4.0-alpha.3",
|
|
4
4
|
codegenVersion: "0.3.0-alpha.0",
|
|
5
5
|
manifestSchemaVersion: 2,
|
|
6
6
|
generatedArtifactSchemaVersion: 1
|
|
@@ -9,4 +9,4 @@ var GENERATED_AUTHORING_METADATA = {
|
|
|
9
9
|
export {
|
|
10
10
|
GENERATED_AUTHORING_METADATA
|
|
11
11
|
};
|
|
12
|
-
//# sourceMappingURL=chunk-
|
|
12
|
+
//# sourceMappingURL=chunk-DQ7GCD6C.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/authoring/generated-metadata.ts"],"sourcesContent":["// Generated by scripts/generate-authoring-metadata.mjs. Do not edit by hand.\nimport type { GeneratedAuthoringMetadataV1 } from \"./types.js\";\n\nexport const GENERATED_AUTHORING_METADATA = {\n sdkVersion: \"0.4.0-alpha.
|
|
1
|
+
{"version":3,"sources":["../src/authoring/generated-metadata.ts"],"sourcesContent":["// Generated by scripts/generate-authoring-metadata.mjs. Do not edit by hand.\nimport type { GeneratedAuthoringMetadataV1 } from \"./types.js\";\n\nexport const GENERATED_AUTHORING_METADATA = {\n sdkVersion: \"0.4.0-alpha.3\",\n codegenVersion: \"0.3.0-alpha.0\",\n manifestSchemaVersion: 2,\n generatedArtifactSchemaVersion: 1,\n} as const satisfies GeneratedAuthoringMetadataV1;\n"],"mappings":";AAGO,IAAM,+BAA+B;AAAA,EAC1C,YAAY;AAAA,EACZ,gBAAgB;AAAA,EAChB,uBAAuB;AAAA,EACvB,gCAAgC;AAClC;","names":[]}
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
import { ReactNode, ReactElement, ButtonHTMLAttributes } from 'react';
|
|
2
|
+
import { l as BoardSpaceTargetProps, bh as ZoneListProps, b1 as UIContract } from './ui-contract-CY7cxsCC.js';
|
|
3
|
+
import { H as HandRole } from './ResourceCounter-BuiNstXs.js';
|
|
4
|
+
|
|
5
|
+
interface ClientParamSchema {
|
|
6
|
+
safeParse: (value: unknown) => {
|
|
7
|
+
success: true;
|
|
8
|
+
data: Record<string, unknown>;
|
|
9
|
+
} | {
|
|
10
|
+
success: false;
|
|
11
|
+
error: {
|
|
12
|
+
issues: ReadonlyArray<{
|
|
13
|
+
path: readonly PropertyKey[];
|
|
14
|
+
message: string;
|
|
15
|
+
}>;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
type ClientParamSchemaMap = Readonly<Record<string, Readonly<Record<string, ClientParamSchema>>>>;
|
|
20
|
+
|
|
21
|
+
type WorkspaceInteractionSlotComponent<Props = object> = (props: Props extends {
|
|
22
|
+
children: unknown;
|
|
23
|
+
} ? Props : Props & {
|
|
24
|
+
children?: ReactNode;
|
|
25
|
+
}) => ReactElement | null;
|
|
26
|
+
interface WorkspaceFormInputSlot<Input extends string = string> {
|
|
27
|
+
readonly Field: WorkspaceInteractionSlotComponent;
|
|
28
|
+
readonly Options: WorkspaceInteractionSlotComponent<{
|
|
29
|
+
children?: (option: {
|
|
30
|
+
value: unknown;
|
|
31
|
+
label: string;
|
|
32
|
+
}) => ReactNode;
|
|
33
|
+
}>;
|
|
34
|
+
readonly Value: WorkspaceInteractionSlotComponent<{
|
|
35
|
+
children: (value: unknown | undefined) => ReactNode;
|
|
36
|
+
}>;
|
|
37
|
+
readonly Default: WorkspaceInteractionSlotComponent;
|
|
38
|
+
readonly __input?: Input;
|
|
39
|
+
}
|
|
40
|
+
interface WorkspaceCardInputSlot<Card extends string = string> {
|
|
41
|
+
readonly Card: WorkspaceInteractionSlotComponent<{
|
|
42
|
+
value: Card;
|
|
43
|
+
} & Omit<ButtonHTMLAttributes<HTMLButtonElement>, "children" | "disabled" | "aria-disabled" | "aria-pressed" | "onClick" | "type" | "value">>;
|
|
44
|
+
readonly Cards: WorkspaceInteractionSlotComponent<{
|
|
45
|
+
children: (card: {
|
|
46
|
+
id: Card;
|
|
47
|
+
}) => ReactNode;
|
|
48
|
+
}>;
|
|
49
|
+
readonly Value: WorkspaceInteractionSlotComponent<{
|
|
50
|
+
children: (value: unknown | undefined) => ReactNode;
|
|
51
|
+
}>;
|
|
52
|
+
readonly Default: WorkspaceInteractionSlotComponent;
|
|
53
|
+
}
|
|
54
|
+
interface WorkspaceBoardTargetInputSlot<Kind extends "space" | "edge" | "vertex" | "tile", Target extends string = string> {
|
|
55
|
+
readonly Target: WorkspaceInteractionSlotComponent<{
|
|
56
|
+
value: Target;
|
|
57
|
+
} & Omit<ButtonHTMLAttributes<HTMLButtonElement>, "children" | "disabled" | "aria-disabled" | "aria-pressed" | "onClick" | "type" | "value">>;
|
|
58
|
+
readonly Value: WorkspaceInteractionSlotComponent<{
|
|
59
|
+
children: (value: unknown | undefined) => ReactNode;
|
|
60
|
+
}>;
|
|
61
|
+
readonly Default: WorkspaceInteractionSlotComponent;
|
|
62
|
+
readonly __kind?: Kind;
|
|
63
|
+
}
|
|
64
|
+
interface WorkspaceBoardSurface<Space extends string = string, Edge extends string = string, Vertex extends string = string, Tile extends string = string> {
|
|
65
|
+
readonly Root: WorkspaceInteractionSlotComponent;
|
|
66
|
+
readonly Space: <Target extends Space>(props: BoardSpaceTargetProps<Target>) => ReactElement | null;
|
|
67
|
+
readonly slot: {
|
|
68
|
+
readonly space: WorkspaceBoardTargetInputSlot<"space", Space>;
|
|
69
|
+
readonly playerSpace: WorkspaceBoardTargetInputSlot<"space", Space>;
|
|
70
|
+
readonly edge: WorkspaceBoardTargetInputSlot<"edge", Edge>;
|
|
71
|
+
readonly vertex: WorkspaceBoardTargetInputSlot<"vertex", Vertex>;
|
|
72
|
+
readonly tile: WorkspaceBoardTargetInputSlot<"tile", Tile>;
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
type WorkspaceZoneCardsComponent<Card> = WorkspaceInteractionSlotComponent<Omit<ZoneListProps, "children" | "empty"> & {
|
|
76
|
+
empty?: ReactNode;
|
|
77
|
+
children: (card: Card) => ReactNode;
|
|
78
|
+
}>;
|
|
79
|
+
type WorkspaceZoneCardComponent<Card> = WorkspaceInteractionSlotComponent<Omit<ButtonHTMLAttributes<HTMLButtonElement>, "type" | "value"> & {
|
|
80
|
+
card: Card;
|
|
81
|
+
}>;
|
|
82
|
+
type WorkspaceZoneStagingComponent<Card> = WorkspaceInteractionSlotComponent<{
|
|
83
|
+
children: (card: Card) => ReactNode;
|
|
84
|
+
label?: ReactNode;
|
|
85
|
+
renderEmptySlot?: (index: number) => ReactNode;
|
|
86
|
+
cardSize?: "sm" | "md" | "lg";
|
|
87
|
+
ariaLabel?: string;
|
|
88
|
+
className?: string;
|
|
89
|
+
}>;
|
|
90
|
+
type WorkspaceHandCardsComponent<Card> = WorkspaceInteractionSlotComponent<{
|
|
91
|
+
children: (card: Card, state: unknown) => ReactNode;
|
|
92
|
+
}>;
|
|
93
|
+
type WorkspaceHandSummaryComponent = WorkspaceInteractionSlotComponent<{
|
|
94
|
+
children?: ReactNode | ((summary: unknown) => ReactNode);
|
|
95
|
+
}>;
|
|
96
|
+
interface WorkspaceHandSurface<Zone extends string, Card> {
|
|
97
|
+
readonly Hand: WorkspaceInteractionSlotComponent<{
|
|
98
|
+
children: ReactNode;
|
|
99
|
+
}>;
|
|
100
|
+
readonly Cards: WorkspaceHandCardsComponent<Card>;
|
|
101
|
+
readonly Summary: WorkspaceHandSummaryComponent;
|
|
102
|
+
readonly Actions: WorkspaceHandSummaryComponent;
|
|
103
|
+
readonly Card: WorkspaceZoneCardComponent<Card>;
|
|
104
|
+
readonly Staging: WorkspaceZoneStagingComponent<Card>;
|
|
105
|
+
readonly slot: {
|
|
106
|
+
readonly card: WorkspaceCardInputSlot<Zone>;
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
interface WorkspacePileSurface<Card> {
|
|
110
|
+
readonly Pile: WorkspaceZoneCardsComponent<Card>;
|
|
111
|
+
readonly Card: WorkspaceZoneCardComponent<Card>;
|
|
112
|
+
}
|
|
113
|
+
interface WorkspaceCardCollectionSurface<Zone extends string, Card> {
|
|
114
|
+
readonly Collection: WorkspaceZoneCardsComponent<Card>;
|
|
115
|
+
readonly Card: WorkspaceZoneCardComponent<Card>;
|
|
116
|
+
readonly slot: {
|
|
117
|
+
readonly card: WorkspaceCardInputSlot<Zone>;
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
interface WorkspaceBoardSurfaceDescriptor<Board extends string = string> {
|
|
121
|
+
readonly kind: "board";
|
|
122
|
+
readonly board: Board;
|
|
123
|
+
}
|
|
124
|
+
interface WorkspaceHandSurfaceDescriptor<Zone extends string = string> {
|
|
125
|
+
readonly kind: "hand";
|
|
126
|
+
readonly zone: Zone;
|
|
127
|
+
readonly role: HandRole;
|
|
128
|
+
readonly label: string;
|
|
129
|
+
readonly order?: number;
|
|
130
|
+
}
|
|
131
|
+
interface WorkspacePileSurfaceDescriptor<Zone extends string = string> {
|
|
132
|
+
readonly kind: "pile";
|
|
133
|
+
readonly zone: Zone;
|
|
134
|
+
}
|
|
135
|
+
interface WorkspacePilesSurfaceDescriptor<Zones extends readonly string[] = readonly string[]> {
|
|
136
|
+
readonly kind: "piles";
|
|
137
|
+
readonly zones: Zones;
|
|
138
|
+
}
|
|
139
|
+
interface WorkspaceCardCollectionSurfaceDescriptor<Zones extends readonly string[] = readonly string[]> {
|
|
140
|
+
readonly kind: "cardCollection";
|
|
141
|
+
readonly zones: Zones;
|
|
142
|
+
readonly mode?: "all" | "top-card";
|
|
143
|
+
}
|
|
144
|
+
interface WorkspaceInteractionFormsDescriptor<Interactions extends Readonly<Record<string, string>> = Readonly<Record<string, string>>> {
|
|
145
|
+
readonly kind: "forms";
|
|
146
|
+
readonly interactions: Interactions;
|
|
147
|
+
}
|
|
148
|
+
interface WorkspaceInteractionFormDescriptor<Interaction extends string = string> {
|
|
149
|
+
readonly kind: "form";
|
|
150
|
+
readonly interaction: Interaction;
|
|
151
|
+
}
|
|
152
|
+
type WorkspaceSurfaceDescriptor = WorkspaceBoardSurfaceDescriptor | WorkspaceHandSurfaceDescriptor | WorkspacePileSurfaceDescriptor | WorkspacePilesSurfaceDescriptor | WorkspaceCardCollectionSurfaceDescriptor | WorkspaceInteractionFormDescriptor | WorkspaceInteractionFormsDescriptor;
|
|
153
|
+
interface WorkspaceSurfaceSpec {
|
|
154
|
+
readonly [key: string]: WorkspaceSurfaceDescriptor | WorkspaceSurfaceSpec;
|
|
155
|
+
}
|
|
156
|
+
interface WorkspaceContractOptions<Contract extends UIContract, Resource extends string, Card, HexBoards extends Record<string, unknown>> {
|
|
157
|
+
readonly uiContract: Contract;
|
|
158
|
+
readonly clientParamSchemasByPhase?: ClientParamSchemaMap;
|
|
159
|
+
readonly formInputKeysForInteraction: (interaction: string) => ReadonlySet<string>;
|
|
160
|
+
readonly resourceIds: readonly Resource[];
|
|
161
|
+
readonly resourcePresentationById?: Partial<Record<string, {
|
|
162
|
+
label?: string;
|
|
163
|
+
icon?: string;
|
|
164
|
+
}>>;
|
|
165
|
+
readonly hexStaticBoards: HexBoards;
|
|
166
|
+
readonly cardIdFromZoneCard: (card: Card) => string;
|
|
167
|
+
readonly zoneIdFromZoneCard: (card: Card) => string;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
interface DefineGameUIConfig<GameState, Surfaces> {
|
|
171
|
+
useSurfaces: () => Surfaces;
|
|
172
|
+
interactionRoutes?: (context: {
|
|
173
|
+
game: GameState;
|
|
174
|
+
surfaces: Surfaces;
|
|
175
|
+
}) => Record<string, {
|
|
176
|
+
collect: Record<string, unknown>;
|
|
177
|
+
}>;
|
|
178
|
+
phases: Record<string, (context: {
|
|
179
|
+
game: GameState;
|
|
180
|
+
surfaces: Surfaces;
|
|
181
|
+
}) => ReactNode>;
|
|
182
|
+
renderInteractions?: (context: {
|
|
183
|
+
game: GameState;
|
|
184
|
+
surfaces: Surfaces;
|
|
185
|
+
}) => ReactNode;
|
|
186
|
+
fallback?: ReactNode | ((phase: string | null) => ReactNode);
|
|
187
|
+
includeUnavailableInteractions?: boolean | null;
|
|
188
|
+
}
|
|
189
|
+
declare function createWorkspaceUIContract<WorkspaceUI, Contract extends UIContract, Resource extends string, Card, HexBoards extends Record<string, unknown>>(options: WorkspaceContractOptions<Contract, Resource, Card, HexBoards>): WorkspaceUI;
|
|
190
|
+
|
|
191
|
+
export { type ClientParamSchemaMap as C, type DefineGameUIConfig as D, type WorkspaceBoardSurface as W, type WorkspaceBoardSurfaceDescriptor as a, type WorkspaceBoardTargetInputSlot as b, type WorkspaceCardCollectionSurface as c, type WorkspaceCardCollectionSurfaceDescriptor as d, type WorkspaceCardInputSlot as e, type WorkspaceFormInputSlot as f, type WorkspaceHandSurface as g, type WorkspaceHandSurfaceDescriptor as h, type WorkspaceInteractionFormDescriptor as i, type WorkspaceInteractionFormsDescriptor as j, type WorkspaceInteractionSlotComponent as k, type WorkspacePileSurface as l, type WorkspacePileSurfaceDescriptor as m, type WorkspacePilesSurfaceDescriptor as n, type WorkspaceSurfaceSpec as o, createWorkspaceUIContract as p };
|
package/dist/index.js
CHANGED
|
@@ -2,8 +2,8 @@ import {
|
|
|
2
2
|
DREAMBOARD_SDK_PACKAGES,
|
|
3
3
|
DREAMBOARD_SDK_PACKAGE_SET,
|
|
4
4
|
DREAMBOARD_SDK_VERSION
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-BKD7XAWB.js";
|
|
6
|
+
import "./chunk-DQ7GCD6C.js";
|
|
7
7
|
import "./chunk-PZ5AY32C.js";
|
|
8
8
|
export {
|
|
9
9
|
DREAMBOARD_SDK_PACKAGES,
|
package/dist/package-set.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
declare const DREAMBOARD_SDK_VERSION: "0.4.0-alpha.
|
|
1
|
+
declare const DREAMBOARD_SDK_VERSION: "0.4.0-alpha.3";
|
|
2
2
|
declare const DREAMBOARD_SDK_PACKAGES: {
|
|
3
|
-
readonly "@dreamboard-games/sdk": "0.4.0-alpha.
|
|
3
|
+
readonly "@dreamboard-games/sdk": "0.4.0-alpha.3";
|
|
4
4
|
};
|
|
5
5
|
type DreamboardSdkPackageName = keyof typeof DREAMBOARD_SDK_PACKAGES;
|
|
6
6
|
type DreamboardSdkPackageSet = {
|
package/dist/package-set.js
CHANGED
|
@@ -2,8 +2,8 @@ import {
|
|
|
2
2
|
DREAMBOARD_SDK_PACKAGES,
|
|
3
3
|
DREAMBOARD_SDK_PACKAGE_SET,
|
|
4
4
|
DREAMBOARD_SDK_VERSION
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-BKD7XAWB.js";
|
|
6
|
+
import "./chunk-DQ7GCD6C.js";
|
|
7
7
|
import "./chunk-PZ5AY32C.js";
|
|
8
8
|
export {
|
|
9
9
|
DREAMBOARD_SDK_PACKAGES,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import { H as HandRole } from '../ResourceCounter-BuiNstXs.js';
|
|
1
|
+
export { C as ClientParamSchemaMap, D as DefineGameUIConfig, 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';
|
|
2
|
+
import { Z as InteractionDialogProps } from '../ui-contract-CY7cxsCC.js';
|
|
3
|
+
export { f as BoardHexGridProps, h as BoardHexViewProps, l as BoardSpaceTargetProps, A as DreamboardUI, I as GameMeState, M as GamePlayersState, N as GameRenderState, Q as GameTurnState, a$ as TypedGame, b1 as UIContract, b3 as UIRootProps, bd as ZoneCardRenderItem, bh as ZoneListProps } from '../ui-contract-CY7cxsCC.js';
|
|
5
4
|
export { b as ResourceCounterComponents } from '../ResourceCounter-BuiNstXs.js';
|
|
5
|
+
import { ReactNode } from 'react';
|
|
6
6
|
import 'react/jsx-runtime';
|
|
7
7
|
import '../hex-board-view-Kz9Q_zsv.js';
|
|
8
8
|
import '../player-state-Cqpyeql0.js';
|
|
@@ -14,171 +14,14 @@ import '../primitive-props-BNHDkgd7.js';
|
|
|
14
14
|
import '../attributes-DbvyMbXw.js';
|
|
15
15
|
import '../types-DJj5MJkl.js';
|
|
16
16
|
|
|
17
|
-
interface
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
path: readonly PropertyKey[];
|
|
26
|
-
message: string;
|
|
27
|
-
}>;
|
|
28
|
-
};
|
|
29
|
-
};
|
|
17
|
+
interface WorkspaceInteractionFormDialogProps extends Omit<InteractionDialogProps, "children"> {
|
|
18
|
+
title: ReactNode;
|
|
19
|
+
description?: ReactNode;
|
|
20
|
+
trigger?: ReactNode;
|
|
21
|
+
children: ReactNode;
|
|
22
|
+
contentClassName?: string;
|
|
23
|
+
overlayClassName?: string;
|
|
24
|
+
showCloseButton?: boolean;
|
|
30
25
|
}
|
|
31
|
-
type ClientParamSchemaMap = Readonly<Record<string, Readonly<Record<string, ClientParamSchema>>>>;
|
|
32
26
|
|
|
33
|
-
type
|
|
34
|
-
children: unknown;
|
|
35
|
-
} ? Props : Props & {
|
|
36
|
-
children?: ReactNode;
|
|
37
|
-
}) => ReactElement | null;
|
|
38
|
-
interface WorkspaceFormInputSlot<Input extends string = string> {
|
|
39
|
-
readonly Field: WorkspaceInteractionSlotComponent;
|
|
40
|
-
readonly Options: WorkspaceInteractionSlotComponent<{
|
|
41
|
-
children?: (option: {
|
|
42
|
-
value: unknown;
|
|
43
|
-
label: string;
|
|
44
|
-
}) => ReactNode;
|
|
45
|
-
}>;
|
|
46
|
-
readonly Value: WorkspaceInteractionSlotComponent<{
|
|
47
|
-
children: (value: unknown | undefined) => ReactNode;
|
|
48
|
-
}>;
|
|
49
|
-
readonly Default: WorkspaceInteractionSlotComponent;
|
|
50
|
-
readonly __input?: Input;
|
|
51
|
-
}
|
|
52
|
-
interface WorkspaceCardInputSlot<Card extends string = string> {
|
|
53
|
-
readonly Card: WorkspaceInteractionSlotComponent<{
|
|
54
|
-
value: Card;
|
|
55
|
-
} & Omit<ButtonHTMLAttributes<HTMLButtonElement>, "children" | "disabled" | "aria-disabled" | "aria-pressed" | "onClick" | "type" | "value">>;
|
|
56
|
-
readonly Cards: WorkspaceInteractionSlotComponent<{
|
|
57
|
-
children: (card: {
|
|
58
|
-
id: Card;
|
|
59
|
-
}) => ReactNode;
|
|
60
|
-
}>;
|
|
61
|
-
readonly Value: WorkspaceInteractionSlotComponent<{
|
|
62
|
-
children: (value: unknown | undefined) => ReactNode;
|
|
63
|
-
}>;
|
|
64
|
-
readonly Default: WorkspaceInteractionSlotComponent;
|
|
65
|
-
}
|
|
66
|
-
interface WorkspaceBoardTargetInputSlot<Kind extends "space" | "edge" | "vertex" | "tile", Target extends string = string> {
|
|
67
|
-
readonly Target: WorkspaceInteractionSlotComponent<{
|
|
68
|
-
value: Target;
|
|
69
|
-
} & Omit<ButtonHTMLAttributes<HTMLButtonElement>, "children" | "disabled" | "aria-disabled" | "aria-pressed" | "onClick" | "type" | "value">>;
|
|
70
|
-
readonly Value: WorkspaceInteractionSlotComponent<{
|
|
71
|
-
children: (value: unknown | undefined) => ReactNode;
|
|
72
|
-
}>;
|
|
73
|
-
readonly Default: WorkspaceInteractionSlotComponent;
|
|
74
|
-
readonly __kind?: Kind;
|
|
75
|
-
}
|
|
76
|
-
interface WorkspaceBoardSurface<Space extends string = string, Edge extends string = string, Vertex extends string = string, Tile extends string = string> {
|
|
77
|
-
readonly Root: WorkspaceInteractionSlotComponent;
|
|
78
|
-
readonly Space: <Target extends Space>(props: BoardSpaceTargetProps<Target>) => ReactElement | null;
|
|
79
|
-
readonly slot: {
|
|
80
|
-
readonly space: WorkspaceBoardTargetInputSlot<"space", Space>;
|
|
81
|
-
readonly playerSpace: WorkspaceBoardTargetInputSlot<"space", Space>;
|
|
82
|
-
readonly edge: WorkspaceBoardTargetInputSlot<"edge", Edge>;
|
|
83
|
-
readonly vertex: WorkspaceBoardTargetInputSlot<"vertex", Vertex>;
|
|
84
|
-
readonly tile: WorkspaceBoardTargetInputSlot<"tile", Tile>;
|
|
85
|
-
};
|
|
86
|
-
}
|
|
87
|
-
type WorkspaceZoneCardsComponent<Card> = WorkspaceInteractionSlotComponent<Omit<ZoneListProps, "children" | "empty"> & {
|
|
88
|
-
empty?: ReactNode;
|
|
89
|
-
children: (card: Card) => ReactNode;
|
|
90
|
-
}>;
|
|
91
|
-
type WorkspaceZoneCardComponent<Card> = WorkspaceInteractionSlotComponent<Omit<ButtonHTMLAttributes<HTMLButtonElement>, "type" | "value"> & {
|
|
92
|
-
card: Card;
|
|
93
|
-
}>;
|
|
94
|
-
type WorkspaceZoneStagingComponent<Card> = WorkspaceInteractionSlotComponent<{
|
|
95
|
-
children: (card: Card) => ReactNode;
|
|
96
|
-
label?: ReactNode;
|
|
97
|
-
renderEmptySlot?: (index: number) => ReactNode;
|
|
98
|
-
cardSize?: "sm" | "md" | "lg";
|
|
99
|
-
ariaLabel?: string;
|
|
100
|
-
className?: string;
|
|
101
|
-
}>;
|
|
102
|
-
type WorkspaceHandCardsComponent<Card> = WorkspaceInteractionSlotComponent<{
|
|
103
|
-
children: (card: Card, state: unknown) => ReactNode;
|
|
104
|
-
}>;
|
|
105
|
-
type WorkspaceHandSummaryComponent = WorkspaceInteractionSlotComponent<{
|
|
106
|
-
children?: ReactNode | ((summary: unknown) => ReactNode);
|
|
107
|
-
}>;
|
|
108
|
-
interface WorkspaceHandSurface<Zone extends string, Card> {
|
|
109
|
-
readonly Hand: WorkspaceInteractionSlotComponent<{
|
|
110
|
-
children: ReactNode;
|
|
111
|
-
}>;
|
|
112
|
-
readonly Cards: WorkspaceHandCardsComponent<Card>;
|
|
113
|
-
readonly Summary: WorkspaceHandSummaryComponent;
|
|
114
|
-
readonly Actions: WorkspaceHandSummaryComponent;
|
|
115
|
-
readonly Card: WorkspaceZoneCardComponent<Card>;
|
|
116
|
-
readonly Staging: WorkspaceZoneStagingComponent<Card>;
|
|
117
|
-
readonly slot: {
|
|
118
|
-
readonly card: WorkspaceCardInputSlot<Zone>;
|
|
119
|
-
};
|
|
120
|
-
}
|
|
121
|
-
interface WorkspacePileSurface<Card> {
|
|
122
|
-
readonly Pile: WorkspaceZoneCardsComponent<Card>;
|
|
123
|
-
readonly Card: WorkspaceZoneCardComponent<Card>;
|
|
124
|
-
}
|
|
125
|
-
interface WorkspaceCardCollectionSurface<Zone extends string, Card> {
|
|
126
|
-
readonly Collection: WorkspaceZoneCardsComponent<Card>;
|
|
127
|
-
readonly Card: WorkspaceZoneCardComponent<Card>;
|
|
128
|
-
readonly slot: {
|
|
129
|
-
readonly card: WorkspaceCardInputSlot<Zone>;
|
|
130
|
-
};
|
|
131
|
-
}
|
|
132
|
-
interface WorkspaceBoardSurfaceDescriptor<Board extends string = string> {
|
|
133
|
-
readonly kind: "board";
|
|
134
|
-
readonly board: Board;
|
|
135
|
-
}
|
|
136
|
-
interface WorkspaceHandSurfaceDescriptor<Zone extends string = string> {
|
|
137
|
-
readonly kind: "hand";
|
|
138
|
-
readonly zone: Zone;
|
|
139
|
-
readonly role: HandRole;
|
|
140
|
-
readonly label: string;
|
|
141
|
-
readonly order?: number;
|
|
142
|
-
}
|
|
143
|
-
interface WorkspacePileSurfaceDescriptor<Zone extends string = string> {
|
|
144
|
-
readonly kind: "pile";
|
|
145
|
-
readonly zone: Zone;
|
|
146
|
-
}
|
|
147
|
-
interface WorkspacePilesSurfaceDescriptor<Zones extends readonly string[] = readonly string[]> {
|
|
148
|
-
readonly kind: "piles";
|
|
149
|
-
readonly zones: Zones;
|
|
150
|
-
}
|
|
151
|
-
interface WorkspaceCardCollectionSurfaceDescriptor<Zones extends readonly string[] = readonly string[]> {
|
|
152
|
-
readonly kind: "cardCollection";
|
|
153
|
-
readonly zones: Zones;
|
|
154
|
-
readonly mode?: "all" | "top-card";
|
|
155
|
-
}
|
|
156
|
-
interface WorkspaceInteractionFormsDescriptor<Interactions extends Readonly<Record<string, string>> = Readonly<Record<string, string>>> {
|
|
157
|
-
readonly kind: "forms";
|
|
158
|
-
readonly interactions: Interactions;
|
|
159
|
-
}
|
|
160
|
-
interface WorkspaceInteractionFormDescriptor<Interaction extends string = string> {
|
|
161
|
-
readonly kind: "form";
|
|
162
|
-
readonly interaction: Interaction;
|
|
163
|
-
}
|
|
164
|
-
type WorkspaceSurfaceDescriptor = WorkspaceBoardSurfaceDescriptor | WorkspaceHandSurfaceDescriptor | WorkspacePileSurfaceDescriptor | WorkspacePilesSurfaceDescriptor | WorkspaceCardCollectionSurfaceDescriptor | WorkspaceInteractionFormDescriptor | WorkspaceInteractionFormsDescriptor;
|
|
165
|
-
interface WorkspaceSurfaceSpec {
|
|
166
|
-
readonly [key: string]: WorkspaceSurfaceDescriptor | WorkspaceSurfaceSpec;
|
|
167
|
-
}
|
|
168
|
-
interface WorkspaceContractOptions<Contract extends UIContract, Resource extends string, Card, HexBoards extends Record<string, unknown>> {
|
|
169
|
-
readonly uiContract: Contract;
|
|
170
|
-
readonly clientParamSchemasByPhase?: ClientParamSchemaMap;
|
|
171
|
-
readonly formInputKeysForInteraction: (interaction: string) => ReadonlySet<string>;
|
|
172
|
-
readonly resourceIds: readonly Resource[];
|
|
173
|
-
readonly resourcePresentationById?: Partial<Record<string, {
|
|
174
|
-
label?: string;
|
|
175
|
-
icon?: string;
|
|
176
|
-
}>>;
|
|
177
|
-
readonly hexStaticBoards: HexBoards;
|
|
178
|
-
readonly cardIdFromZoneCard: (card: Card) => string;
|
|
179
|
-
readonly zoneIdFromZoneCard: (card: Card) => string;
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
declare function createWorkspaceUIContract<WorkspaceUI, Contract extends UIContract, Resource extends string, Card, HexBoards extends Record<string, unknown>>(options: WorkspaceContractOptions<Contract, Resource, Card, HexBoards>): WorkspaceUI;
|
|
183
|
-
|
|
184
|
-
export { BoardSpaceTargetProps, type ClientParamSchemaMap, UIContract, type WorkspaceBoardSurface, type WorkspaceBoardSurfaceDescriptor, type WorkspaceBoardTargetInputSlot, type WorkspaceCardCollectionSurface, type WorkspaceCardCollectionSurfaceDescriptor, type WorkspaceCardInputSlot, type WorkspaceFormInputSlot, type WorkspaceHandSurface, type WorkspaceHandSurfaceDescriptor, type WorkspaceInteractionFormDescriptor, type WorkspaceInteractionFormsDescriptor, type WorkspaceInteractionSlotComponent, type WorkspacePileSurface, type WorkspacePileSurfaceDescriptor, type WorkspacePilesSurfaceDescriptor, type WorkspaceSurfaceSpec, ZoneListProps, createWorkspaceUIContract };
|
|
27
|
+
export type { WorkspaceInteractionFormDialogProps };
|
package/dist/runtime.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { b1 as UIContract$1, A as DreamboardUI$1, a$ as TypedGame$1 } from './ui-contract-CY7cxsCC.js';
|
|
2
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 { ClientParamSchemaMap, WorkspaceBoardSurface, WorkspaceBoardSurfaceDescriptor, WorkspaceBoardTargetInputSlot, WorkspaceCardCollectionSurface, WorkspaceCardCollectionSurfaceDescriptor, WorkspaceCardInputSlot, WorkspaceFormInputSlot, WorkspaceHandSurface, WorkspaceHandSurfaceDescriptor, WorkspaceInteractionFormDescriptor, WorkspaceInteractionFormsDescriptor, WorkspaceInteractionSlotComponent, WorkspacePileSurface, WorkspacePileSurfaceDescriptor, WorkspacePilesSurfaceDescriptor, WorkspaceSurfaceSpec, createWorkspaceUIContract } from './
|
|
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';
|
|
4
4
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
5
5
|
import react__default from 'react';
|
|
6
6
|
import { c as RuntimeDiagnosticHandler } from './runtime-api-C6aWo9c0.js';
|
package/package.json
CHANGED
|
File without changes
|