@dreamboard-games/sdk 0.4.0-alpha.4 → 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.
Files changed (79) hide show
  1. package/REFERENCE.md +1089 -123
  2. package/dist/{HandView-x8MhbhFl.d.ts → HandView-Bi2lxzQP.d.ts} +3 -3
  3. package/dist/{ThemeProvider-DRalAWzY.d.ts → ThemeProvider-CElaL2ik.d.ts} +1 -1
  4. package/dist/authoring/index.js +2 -2
  5. package/dist/browser-interaction.js +1 -1
  6. package/dist/{chunk-E3X552YM.js → chunk-2TRZSZGD.js} +1061 -425
  7. package/dist/chunk-2TRZSZGD.js.map +1 -0
  8. package/dist/{chunk-CP35NPPY.js → chunk-52DH7VQF.js} +61 -7
  9. package/dist/chunk-52DH7VQF.js.map +1 -0
  10. package/dist/{chunk-N6ZDIMRB.js → chunk-B2YBS3SG.js} +1 -1
  11. package/dist/chunk-B2YBS3SG.js.map +1 -0
  12. package/dist/{chunk-LKJLAGND.js → chunk-DDST4U2P.js} +2 -2
  13. package/dist/{chunk-SUMZ5OEH.js → chunk-HK3WN4U7.js} +2 -2
  14. package/dist/{chunk-SUMZ5OEH.js.map → chunk-HK3WN4U7.js.map} +1 -1
  15. package/dist/{chunk-QOFFRHZR.js → chunk-OV6JC2BM.js} +64 -28
  16. package/dist/chunk-OV6JC2BM.js.map +1 -0
  17. package/dist/{chunk-K5ZRJTZZ.js → chunk-PAPIAMYX.js} +6 -3
  18. package/dist/chunk-PAPIAMYX.js.map +1 -0
  19. package/dist/{chunk-TTISZQNI.js → chunk-SOBNI363.js} +39 -28
  20. package/dist/chunk-SOBNI363.js.map +1 -0
  21. package/dist/{chunk-Y6Y2YABD.js → chunk-TGMXBRKY.js} +22 -6
  22. package/dist/chunk-TGMXBRKY.js.map +1 -0
  23. package/dist/{chunk-XZ667T4K.js → chunk-UC2UXAC6.js} +2 -2
  24. package/dist/{chunk-O6M6PN4E.js → chunk-UUQNOGZV.js} +94 -53
  25. package/dist/chunk-UUQNOGZV.js.map +1 -0
  26. package/dist/{chunk-WUIVY2KE.js → chunk-WHR5UW3F.js} +1 -1
  27. package/dist/chunk-WHR5UW3F.js.map +1 -0
  28. package/dist/codegen.d.ts +13 -0
  29. package/dist/codegen.js +1 -1
  30. package/dist/{components-B7hFaEn_.d.ts → components-BTwSIjXj.d.ts} +77 -206
  31. package/dist/{hex-board-view-BFlWDb9k.d.ts → hex-board-view-aKkblDp6.d.ts} +180 -1
  32. package/dist/{index-gjxQichK.d.ts → index-CFTjJIXd.d.ts} +5 -4
  33. package/dist/{index.d-BL3bT5lt.d.ts → index.d-DMASeF6M.d.ts} +294 -27
  34. package/dist/index.js +2 -2
  35. package/dist/package-set.d.ts +2 -2
  36. package/dist/package-set.js +2 -2
  37. package/dist/{runtime-api-BJharVaj.d.ts → plugin-state-BRH3UiUp.d.ts} +19 -3
  38. package/dist/{protocol-BP193lva.d.ts → protocol-835hEGne.d.ts} +42 -1
  39. package/dist/reducer/advanced.d.ts +4 -2
  40. package/dist/reducer/advanced.js +1 -1
  41. package/dist/reducer-contract.d.ts +1 -1
  42. package/dist/reducer-contract.js +2 -2
  43. package/dist/reducer.d.ts +10 -4
  44. package/dist/reducer.js +317 -15
  45. package/dist/reducer.js.map +1 -1
  46. package/dist/runtime/primitives.d.ts +32 -7
  47. package/dist/runtime/primitives.js +9 -5
  48. package/dist/runtime/runtime-api.d.ts +1 -1
  49. package/dist/runtime/workspace-contract.d.ts +7 -7
  50. package/dist/runtime/workspace-contract.js +6 -6
  51. package/dist/runtime-Dkfm1x2r.d.ts +1670 -0
  52. package/dist/runtime.d.ts +10 -9
  53. package/dist/runtime.js +240 -16
  54. package/dist/runtime.js.map +1 -1
  55. package/dist/testing.d.ts +78 -15
  56. package/dist/testing.js +69 -8
  57. package/dist/testing.js.map +1 -1
  58. package/dist/{types-CYeN0wLK.d.ts → types-aI4V9CWe.d.ts} +5 -5
  59. package/dist/types.d.ts +13 -0
  60. package/dist/ui/components.d.ts +6 -3
  61. package/dist/ui/components.js +15 -3
  62. package/dist/ui/plugin-styles.css +2 -2
  63. package/dist/{ui-contract-B4NjRlvC.d.ts → ui-contract-Ue6SywvO.d.ts} +24 -10
  64. package/dist/ui.d.ts +9 -6
  65. package/dist/ui.js +16 -4
  66. package/dist/views-32rSsfeU.d.ts +1559 -0
  67. package/package.json +21 -20
  68. package/dist/chunk-CP35NPPY.js.map +0 -1
  69. package/dist/chunk-E3X552YM.js.map +0 -1
  70. package/dist/chunk-K5ZRJTZZ.js.map +0 -1
  71. package/dist/chunk-N6ZDIMRB.js.map +0 -1
  72. package/dist/chunk-O6M6PN4E.js.map +0 -1
  73. package/dist/chunk-QOFFRHZR.js.map +0 -1
  74. package/dist/chunk-TTISZQNI.js.map +0 -1
  75. package/dist/chunk-WUIVY2KE.js.map +0 -1
  76. package/dist/chunk-Y6Y2YABD.js.map +0 -1
  77. package/dist/views-fn2RuXOx.d.ts +0 -3168
  78. /package/dist/{chunk-LKJLAGND.js.map → chunk-DDST4U2P.js.map} +0 -0
  79. /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 { type InteractionDescriptor } from "@dreamboard-games/sdk/runtime";
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: unknown }
7351
+ props: Props extends { children?: unknown }
7325
7352
  ? Props
7326
7353
  : Props & { children?: ReactNode },
7327
7354
  ) => ReactElement | null;
@@ -8047,17 +8074,31 @@ declare module "@dreamboard-games/sdk/runtime" {
8047
8074
  /** Generated hex-board topology source, keyed by hex-board id. */
8048
8075
  const hexStaticBoards = staticBoards.hex;
8049
8076
 
8077
+ /** Generated square-board topology source, keyed by square-board id. */
8078
+ const squareStaticBoards = staticBoards.square;
8079
+
8050
8080
  /** Union of authored hex-board ids in this workspace's manifest. */
8051
8081
  export type HexBoardId = keyof typeof hexStaticBoards & string;
8052
8082
 
8083
+ /** Union of authored square-board ids in this workspace's manifest. */
8084
+ export type SquareBoardId = keyof typeof squareStaticBoards & string;
8085
+
8053
8086
  /** Topology object for the named hex board, drawn from \`staticBoards.hex\`. */
8054
8087
  export type HexBoardTopology<Id extends HexBoardId> = (typeof hexStaticBoards)[Id];
8055
8088
 
8089
+ /** Topology object for the named square board, drawn from \`staticBoards.square\`. */
8090
+ export type SquareBoardTopology<Id extends SquareBoardId> = (typeof squareStaticBoards)[Id];
8091
+
8056
8092
  /** Space id type for the named hex board. */
8057
8093
  export type HexBoardSpaceId<Id extends HexBoardId> = BoardSpaceIdOf<
8058
8094
  HexBoardTopology<Id>
8059
8095
  >;
8060
8096
 
8097
+ /** Space id type for the named square board. */
8098
+ export type SquareBoardSpaceId<Id extends SquareBoardId> = BoardSpaceIdOf<
8099
+ SquareBoardTopology<Id>
8100
+ >;
8101
+
8061
8102
  export type HexBoardViewProps<
8062
8103
  Id extends HexBoardId,
8063
8104
  TSpaceView extends { id: HexBoardSpaceId<Id> },
@@ -8075,6 +8116,14 @@ export type HexBoardGridProps<
8075
8116
  board: Id;
8076
8117
  };
8077
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
+
8078
8127
  type WorkspaceBoard = {
8079
8128
  surface<const Board extends BoardSurfaceBoardId>(
8080
8129
  board: Board,
@@ -8092,6 +8141,9 @@ type WorkspaceBoard = {
8092
8141
  const Id extends HexBoardId,
8093
8142
  const TSpaceView extends { id: HexBoardSpaceId<Id> },
8094
8143
  >(props: HexBoardGridProps<Id, TSpaceView>): ReactElement;
8144
+ SquareGrid<const Id extends SquareBoardId>(
8145
+ props: SquareBoardGridProps<Id>,
8146
+ ): ReactElement;
8095
8147
  };
8096
8148
 
8097
8149
  type WorkspaceCardProperties = CardProperties extends Record<string, unknown>
@@ -8252,7 +8304,8 @@ export const UI = createWorkspaceUIContract<
8252
8304
  typeof uiContract,
8253
8305
  ResourceId,
8254
8306
  WorkspaceZoneCard,
8255
- typeof hexStaticBoards
8307
+ typeof hexStaticBoards,
8308
+ typeof squareStaticBoards
8256
8309
  >({
8257
8310
  uiContract,
8258
8311
  clientParamSchemasByPhase: createClientParamSchemasByPhase(game) as ClientParamSchemaMap,
@@ -8262,6 +8315,7 @@ export const UI = createWorkspaceUIContract<
8262
8315
  Record<string, { label?: string; icon?: string }>
8263
8316
  >,
8264
8317
  hexStaticBoards,
8318
+ squareStaticBoards,
8265
8319
  cardIdFromZoneCard: (card) => card.id,
8266
8320
  zoneIdFromZoneCard: (card) => card.zone,
8267
8321
  });
@@ -8360,7 +8414,7 @@ function generateReducerDerivedSeed() {
8360
8414
  //
8361
8415
  // reduce({ state, derived, accept }) {
8362
8416
  // const winner = derived(winnerOf);
8363
- // return accept({ ...state, publicState: { ...state.publicState, winnerPlayerId: winner } });
8417
+ // return accept({ ...state, publicState: { ...state.publicState, currentLeaderId: winner } });
8364
8418
  // }
8365
8419
  //
8366
8420
  // Do NOT mirror derived values back into \`publicState\`. Keep the raw
@@ -8376,7 +8430,7 @@ function generateReducerDerivedSeed() {
8376
8430
  // name: "winnerOf",
8377
8431
  // compute: ({ state }) => {
8378
8432
  // // Example: return the first player at or above the VP target.
8379
- // return state.publicState.winnerPlayerId ?? null;
8433
+ // return state.publicState.currentLeaderId ?? null;
8380
8434
  // },
8381
8435
  // });
8382
8436
 
@@ -8787,4 +8841,4 @@ export {
8787
8841
  generateAuthoritativeFiles,
8788
8842
  generateDynamicGeneratedFiles
8789
8843
  };
8790
- //# sourceMappingURL=chunk-CP35NPPY.js.map
8844
+ //# sourceMappingURL=chunk-52DH7VQF.js.map