@dreamboard-games/sdk 0.4.0-alpha.5 → 0.4.0-alpha.6
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 +1085 -119
- package/dist/{HandView-x8MhbhFl.d.ts → HandView-Bi2lxzQP.d.ts} +3 -3
- package/dist/{ThemeProvider-DRalAWzY.d.ts → ThemeProvider-CElaL2ik.d.ts} +1 -1
- package/dist/authoring/index.js +2 -2
- package/dist/browser-interaction.js +1 -1
- package/dist/{chunk-E3X552YM.js → chunk-2TRZSZGD.js} +1061 -425
- package/dist/chunk-2TRZSZGD.js.map +1 -0
- package/dist/{chunk-KHY3RJLT.js → chunk-52DH7VQF.js} +62 -13
- package/dist/chunk-52DH7VQF.js.map +1 -0
- package/dist/{chunk-N6ZDIMRB.js → chunk-B2YBS3SG.js} +1 -1
- package/dist/chunk-B2YBS3SG.js.map +1 -0
- package/dist/{chunk-AQMEN3AT.js → chunk-DDST4U2P.js} +2 -2
- package/dist/{chunk-FXQPZZXC.js → chunk-HK3WN4U7.js} +2 -2
- package/dist/{chunk-FXQPZZXC.js.map → chunk-HK3WN4U7.js.map} +1 -1
- package/dist/{chunk-QOFFRHZR.js → chunk-OV6JC2BM.js} +64 -28
- package/dist/chunk-OV6JC2BM.js.map +1 -0
- package/dist/{chunk-K5ZRJTZZ.js → chunk-PAPIAMYX.js} +6 -3
- package/dist/chunk-PAPIAMYX.js.map +1 -0
- package/dist/{chunk-TTISZQNI.js → chunk-SOBNI363.js} +39 -28
- package/dist/chunk-SOBNI363.js.map +1 -0
- package/dist/{chunk-Y6Y2YABD.js → chunk-TGMXBRKY.js} +22 -6
- package/dist/chunk-TGMXBRKY.js.map +1 -0
- package/dist/{chunk-XZ667T4K.js → chunk-UC2UXAC6.js} +2 -2
- package/dist/{chunk-O6M6PN4E.js → chunk-UUQNOGZV.js} +94 -53
- package/dist/chunk-UUQNOGZV.js.map +1 -0
- package/dist/{chunk-WUIVY2KE.js → chunk-WHR5UW3F.js} +1 -1
- package/dist/chunk-WHR5UW3F.js.map +1 -0
- package/dist/codegen.d.ts +13 -0
- package/dist/codegen.js +1 -1
- package/dist/{components-B7hFaEn_.d.ts → components-BTwSIjXj.d.ts} +77 -206
- package/dist/{hex-board-view-BFlWDb9k.d.ts → hex-board-view-aKkblDp6.d.ts} +180 -1
- package/dist/{index-gjxQichK.d.ts → index-CFTjJIXd.d.ts} +5 -4
- package/dist/{index.d-BL3bT5lt.d.ts → index.d-DMASeF6M.d.ts} +294 -27
- package/dist/index.js +2 -2
- package/dist/package-set.d.ts +2 -2
- package/dist/package-set.js +2 -2
- package/dist/{runtime-api-BJharVaj.d.ts → plugin-state-BRH3UiUp.d.ts} +19 -3
- package/dist/{protocol-BP193lva.d.ts → protocol-835hEGne.d.ts} +42 -1
- package/dist/reducer/advanced.d.ts +4 -2
- package/dist/reducer/advanced.js +1 -1
- package/dist/reducer-contract.d.ts +1 -1
- package/dist/reducer-contract.js +2 -2
- package/dist/reducer.d.ts +10 -4
- package/dist/reducer.js +317 -15
- package/dist/reducer.js.map +1 -1
- package/dist/runtime/primitives.d.ts +32 -7
- package/dist/runtime/primitives.js +9 -5
- package/dist/runtime/runtime-api.d.ts +1 -1
- package/dist/runtime/workspace-contract.d.ts +7 -7
- package/dist/runtime/workspace-contract.js +6 -6
- package/dist/runtime-Dkfm1x2r.d.ts +1670 -0
- package/dist/runtime.d.ts +10 -9
- package/dist/runtime.js +240 -16
- package/dist/runtime.js.map +1 -1
- package/dist/testing.d.ts +78 -15
- package/dist/testing.js +69 -8
- package/dist/testing.js.map +1 -1
- package/dist/{types-CYeN0wLK.d.ts → types-aI4V9CWe.d.ts} +5 -5
- package/dist/types.d.ts +13 -0
- package/dist/ui/components.d.ts +6 -3
- package/dist/ui/components.js +15 -3
- package/dist/ui/plugin-styles.css +2 -2
- package/dist/{ui-contract-B4NjRlvC.d.ts → ui-contract-Ue6SywvO.d.ts} +24 -10
- package/dist/ui.d.ts +9 -6
- package/dist/ui.js +16 -4
- package/dist/views-32rSsfeU.d.ts +1559 -0
- package/package.json +21 -20
- package/dist/chunk-E3X552YM.js.map +0 -1
- package/dist/chunk-K5ZRJTZZ.js.map +0 -1
- package/dist/chunk-KHY3RJLT.js.map +0 -1
- package/dist/chunk-N6ZDIMRB.js.map +0 -1
- package/dist/chunk-O6M6PN4E.js.map +0 -1
- package/dist/chunk-QOFFRHZR.js.map +0 -1
- package/dist/chunk-TTISZQNI.js.map +0 -1
- package/dist/chunk-WUIVY2KE.js.map +0 -1
- package/dist/chunk-Y6Y2YABD.js.map +0 -1
- package/dist/views-fn2RuXOx.d.ts +0 -3168
- /package/dist/{chunk-AQMEN3AT.js.map → chunk-DDST4U2P.js.map} +0 -0
- /package/dist/{chunk-XZ667T4K.js.map → chunk-UC2UXAC6.js.map} +0 -0
|
@@ -1117,6 +1117,10 @@ function collectManifestRecordKeyIssues(manifest) {
|
|
|
1117
1117
|
value: profile.id,
|
|
1118
1118
|
path: `manifest.setupProfiles[${profileIndex}].id`
|
|
1119
1119
|
},
|
|
1120
|
+
...(profile.guidance?.steps ?? []).map((step, stepIndex) => ({
|
|
1121
|
+
value: step.id,
|
|
1122
|
+
path: `manifest.setupProfiles[${profileIndex}].guidance.steps[${stepIndex}].id`
|
|
1123
|
+
})),
|
|
1120
1124
|
...Object.entries(profile.optionValues ?? {}).flatMap(
|
|
1121
1125
|
([optionId, choiceId]) => [
|
|
1122
1126
|
{
|
|
@@ -1287,6 +1291,17 @@ function validateManifestAuthoring(manifest) {
|
|
|
1287
1291
|
label: "setup profile id"
|
|
1288
1292
|
})
|
|
1289
1293
|
);
|
|
1294
|
+
for (const [profileIndex, profile] of (manifest.setupProfiles ?? []).entries()) {
|
|
1295
|
+
errors.push(
|
|
1296
|
+
...collectDuplicateIdIssues({
|
|
1297
|
+
entries: (profile.guidance?.steps ?? []).map((step, stepIndex) => ({
|
|
1298
|
+
id: step.id,
|
|
1299
|
+
path: `manifest.setupProfiles[${profileIndex}].guidance.steps[${stepIndex}].id`
|
|
1300
|
+
})),
|
|
1301
|
+
label: `setup profile '${profile.id}' guidance step id`
|
|
1302
|
+
})
|
|
1303
|
+
);
|
|
1304
|
+
}
|
|
1290
1305
|
errors.push(...validateSlotHostsAndHomes(manifest));
|
|
1291
1306
|
errors.push(...validatePlayerScopedSeedHomes(manifest));
|
|
1292
1307
|
errors.push(...validateCardHomes(manifest));
|
|
@@ -2604,7 +2619,15 @@ function analyzeManifest(inputManifest) {
|
|
|
2604
2619
|
Object.entries(profile.optionValues).filter(
|
|
2605
2620
|
(entry) => typeof entry[1] === "string"
|
|
2606
2621
|
)
|
|
2607
|
-
) : null
|
|
2622
|
+
) : null,
|
|
2623
|
+
guidance: profile.guidance ? {
|
|
2624
|
+
summary: profile.guidance.summary ?? null,
|
|
2625
|
+
steps: (profile.guidance.steps ?? []).map((step) => ({
|
|
2626
|
+
id: step.id,
|
|
2627
|
+
label: step.label,
|
|
2628
|
+
description: step.description ?? null
|
|
2629
|
+
}))
|
|
2630
|
+
} : null
|
|
2608
2631
|
}
|
|
2609
2632
|
])
|
|
2610
2633
|
);
|
|
@@ -7075,11 +7098,15 @@ import {
|
|
|
7075
7098
|
type BoardSpaceIdOf,
|
|
7076
7099
|
type InteractionVisualState,
|
|
7077
7100
|
} from "@dreamboard-games/sdk/ui";
|
|
7078
|
-
import {
|
|
7101
|
+
import {
|
|
7102
|
+
type BoardGridInteractionFilter,
|
|
7103
|
+
type InteractionDescriptor,
|
|
7104
|
+
} from "@dreamboard-games/sdk/runtime";
|
|
7079
7105
|
import {
|
|
7080
7106
|
createWorkspaceUIContract,
|
|
7081
7107
|
type BoardHexGridProps as BoardHexGridPropsGeneric,
|
|
7082
7108
|
type BoardHexViewProps as BoardHexViewPropsGeneric,
|
|
7109
|
+
type BoardSquareGridProps as BoardSquareGridPropsGeneric,
|
|
7083
7110
|
type BoardSpaceTargetProps as BoardSpaceTargetPropsGeneric,
|
|
7084
7111
|
type ClientParamSchemaMap,
|
|
7085
7112
|
type DefineGameUIConfig,
|
|
@@ -7321,7 +7348,7 @@ export type RequiredInteractionInputKey<Key extends InteractionKey> =
|
|
|
7321
7348
|
RequiredInteractionInputKeysOf<Key>;
|
|
7322
7349
|
|
|
7323
7350
|
type InteractionSlotComponent<Props = object> = (
|
|
7324
|
-
props: Props extends { children
|
|
7351
|
+
props: Props extends { children?: unknown }
|
|
7325
7352
|
? Props
|
|
7326
7353
|
: Props & { children?: ReactNode },
|
|
7327
7354
|
) => ReactElement | null;
|
|
@@ -7867,12 +7894,7 @@ type HandComponent<
|
|
|
7867
7894
|
Vertex extends string,
|
|
7868
7895
|
> = InteractionSlotComponent<
|
|
7869
7896
|
Omit<HandSurfaceProps<Card, Space, Edge, Vertex>, "children"> & {
|
|
7870
|
-
children:
|
|
7871
|
-
| ReactNode
|
|
7872
|
-
| ((
|
|
7873
|
-
card: WorkspaceZoneCard,
|
|
7874
|
-
state: InteractionVisualState,
|
|
7875
|
-
) => ReactNode);
|
|
7897
|
+
children: ReactNode;
|
|
7876
7898
|
}
|
|
7877
7899
|
>;
|
|
7878
7900
|
|
|
@@ -8052,17 +8074,31 @@ declare module "@dreamboard-games/sdk/runtime" {
|
|
|
8052
8074
|
/** Generated hex-board topology source, keyed by hex-board id. */
|
|
8053
8075
|
const hexStaticBoards = staticBoards.hex;
|
|
8054
8076
|
|
|
8077
|
+
/** Generated square-board topology source, keyed by square-board id. */
|
|
8078
|
+
const squareStaticBoards = staticBoards.square;
|
|
8079
|
+
|
|
8055
8080
|
/** Union of authored hex-board ids in this workspace's manifest. */
|
|
8056
8081
|
export type HexBoardId = keyof typeof hexStaticBoards & string;
|
|
8057
8082
|
|
|
8083
|
+
/** Union of authored square-board ids in this workspace's manifest. */
|
|
8084
|
+
export type SquareBoardId = keyof typeof squareStaticBoards & string;
|
|
8085
|
+
|
|
8058
8086
|
/** Topology object for the named hex board, drawn from \`staticBoards.hex\`. */
|
|
8059
8087
|
export type HexBoardTopology<Id extends HexBoardId> = (typeof hexStaticBoards)[Id];
|
|
8060
8088
|
|
|
8089
|
+
/** Topology object for the named square board, drawn from \`staticBoards.square\`. */
|
|
8090
|
+
export type SquareBoardTopology<Id extends SquareBoardId> = (typeof squareStaticBoards)[Id];
|
|
8091
|
+
|
|
8061
8092
|
/** Space id type for the named hex board. */
|
|
8062
8093
|
export type HexBoardSpaceId<Id extends HexBoardId> = BoardSpaceIdOf<
|
|
8063
8094
|
HexBoardTopology<Id>
|
|
8064
8095
|
>;
|
|
8065
8096
|
|
|
8097
|
+
/** Space id type for the named square board. */
|
|
8098
|
+
export type SquareBoardSpaceId<Id extends SquareBoardId> = BoardSpaceIdOf<
|
|
8099
|
+
SquareBoardTopology<Id>
|
|
8100
|
+
>;
|
|
8101
|
+
|
|
8066
8102
|
export type HexBoardViewProps<
|
|
8067
8103
|
Id extends HexBoardId,
|
|
8068
8104
|
TSpaceView extends { id: HexBoardSpaceId<Id> },
|
|
@@ -8080,6 +8116,14 @@ export type HexBoardGridProps<
|
|
|
8080
8116
|
board: Id;
|
|
8081
8117
|
};
|
|
8082
8118
|
|
|
8119
|
+
export type SquareBoardGridProps<Id extends SquareBoardId> = Omit<
|
|
8120
|
+
BoardSquareGridPropsGeneric<SquareBoardTopology<Id>>,
|
|
8121
|
+
"board" | "interactions"
|
|
8122
|
+
> & {
|
|
8123
|
+
board: Id;
|
|
8124
|
+
interactions?: BoardGridInteractionFilter<InteractionKey>;
|
|
8125
|
+
};
|
|
8126
|
+
|
|
8083
8127
|
type WorkspaceBoard = {
|
|
8084
8128
|
surface<const Board extends BoardSurfaceBoardId>(
|
|
8085
8129
|
board: Board,
|
|
@@ -8097,6 +8141,9 @@ type WorkspaceBoard = {
|
|
|
8097
8141
|
const Id extends HexBoardId,
|
|
8098
8142
|
const TSpaceView extends { id: HexBoardSpaceId<Id> },
|
|
8099
8143
|
>(props: HexBoardGridProps<Id, TSpaceView>): ReactElement;
|
|
8144
|
+
SquareGrid<const Id extends SquareBoardId>(
|
|
8145
|
+
props: SquareBoardGridProps<Id>,
|
|
8146
|
+
): ReactElement;
|
|
8100
8147
|
};
|
|
8101
8148
|
|
|
8102
8149
|
type WorkspaceCardProperties = CardProperties extends Record<string, unknown>
|
|
@@ -8257,7 +8304,8 @@ export const UI = createWorkspaceUIContract<
|
|
|
8257
8304
|
typeof uiContract,
|
|
8258
8305
|
ResourceId,
|
|
8259
8306
|
WorkspaceZoneCard,
|
|
8260
|
-
typeof hexStaticBoards
|
|
8307
|
+
typeof hexStaticBoards,
|
|
8308
|
+
typeof squareStaticBoards
|
|
8261
8309
|
>({
|
|
8262
8310
|
uiContract,
|
|
8263
8311
|
clientParamSchemasByPhase: createClientParamSchemasByPhase(game) as ClientParamSchemaMap,
|
|
@@ -8267,6 +8315,7 @@ export const UI = createWorkspaceUIContract<
|
|
|
8267
8315
|
Record<string, { label?: string; icon?: string }>
|
|
8268
8316
|
>,
|
|
8269
8317
|
hexStaticBoards,
|
|
8318
|
+
squareStaticBoards,
|
|
8270
8319
|
cardIdFromZoneCard: (card) => card.id,
|
|
8271
8320
|
zoneIdFromZoneCard: (card) => card.zone,
|
|
8272
8321
|
});
|
|
@@ -8365,7 +8414,7 @@ function generateReducerDerivedSeed() {
|
|
|
8365
8414
|
//
|
|
8366
8415
|
// reduce({ state, derived, accept }) {
|
|
8367
8416
|
// const winner = derived(winnerOf);
|
|
8368
|
-
// return accept({ ...state, publicState: { ...state.publicState,
|
|
8417
|
+
// return accept({ ...state, publicState: { ...state.publicState, currentLeaderId: winner } });
|
|
8369
8418
|
// }
|
|
8370
8419
|
//
|
|
8371
8420
|
// Do NOT mirror derived values back into \`publicState\`. Keep the raw
|
|
@@ -8381,7 +8430,7 @@ function generateReducerDerivedSeed() {
|
|
|
8381
8430
|
// name: "winnerOf",
|
|
8382
8431
|
// compute: ({ state }) => {
|
|
8383
8432
|
// // Example: return the first player at or above the VP target.
|
|
8384
|
-
// return state.publicState.
|
|
8433
|
+
// return state.publicState.currentLeaderId ?? null;
|
|
8385
8434
|
// },
|
|
8386
8435
|
// });
|
|
8387
8436
|
|
|
@@ -8792,4 +8841,4 @@ export {
|
|
|
8792
8841
|
generateAuthoritativeFiles,
|
|
8793
8842
|
generateDynamicGeneratedFiles
|
|
8794
8843
|
};
|
|
8795
|
-
//# sourceMappingURL=chunk-
|
|
8844
|
+
//# sourceMappingURL=chunk-52DH7VQF.js.map
|