@dreamboard-games/sdk 0.4.0-alpha.11 → 0.4.0-alpha.12

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 (41) hide show
  1. package/REFERENCE.md +230 -4
  2. package/dist/authoring/index.js +3 -3
  3. package/dist/authoring-compiler.js +4 -4
  4. package/dist/authoring-materialize-cli.js +4 -4
  5. package/dist/{chunk-3OY46H7D.js → chunk-64FUL7XN.js} +3 -3
  6. package/dist/{chunk-RP6QDQGI.js → chunk-7JBPOJOF.js} +46 -1
  7. package/dist/chunk-7JBPOJOF.js.map +1 -0
  8. package/dist/{chunk-THTFQZZ3.js → chunk-FYJRMV7A.js} +3 -3
  9. package/dist/{chunk-SACZWUA6.js → chunk-HIH6Y4FA.js} +86 -1224
  10. package/dist/{chunk-SACZWUA6.js.map → chunk-HIH6Y4FA.js.map} +1 -1
  11. package/dist/{chunk-RU3Z5J6V.js → chunk-KZFHTUI5.js} +4 -4
  12. package/dist/{chunk-HRWI2DIJ.js → chunk-PZEM2VOI.js} +2 -2
  13. package/dist/{chunk-CP3BF3B2.js → chunk-RYIRARLV.js} +2 -2
  14. package/dist/{chunk-CP3BF3B2.js.map → chunk-RYIRARLV.js.map} +1 -1
  15. package/dist/{chunk-4IIY742N.js → chunk-UTSBXZAM.js} +2 -2
  16. package/dist/chunk-VWTKGIYF.js +90 -0
  17. package/dist/chunk-VWTKGIYF.js.map +1 -0
  18. package/dist/codegen.js +1 -1
  19. package/dist/{index-CRfZ21dM.d.ts → index-CR69MyWr.d.ts} +1 -1
  20. package/dist/index.js +2 -2
  21. package/dist/package-set.d.ts +2 -2
  22. package/dist/package-set.js +2 -2
  23. package/dist/reducer/advanced.js +7 -82
  24. package/dist/reducer/advanced.js.map +1 -1
  25. package/dist/reducer-contract.js +1 -1
  26. package/dist/reference-game-compiler.js +2 -2
  27. package/dist/reference-game-source-manifest-cli.js +2 -2
  28. package/dist/runtime/workspace-contract.d.ts +342 -10
  29. package/dist/runtime/workspace-contract.js +7 -1
  30. package/dist/runtime.d.ts +1 -1
  31. package/dist/runtime.js +7 -3
  32. package/dist/runtime.js.map +1 -1
  33. package/dist/testing-runtime.js +2 -2
  34. package/dist/testing.js +2 -2
  35. package/package.json +1 -1
  36. package/dist/chunk-RP6QDQGI.js.map +0 -1
  37. /package/dist/{chunk-3OY46H7D.js.map → chunk-64FUL7XN.js.map} +0 -0
  38. /package/dist/{chunk-THTFQZZ3.js.map → chunk-FYJRMV7A.js.map} +0 -0
  39. /package/dist/{chunk-RU3Z5J6V.js.map → chunk-KZFHTUI5.js.map} +0 -0
  40. /package/dist/{chunk-HRWI2DIJ.js.map → chunk-PZEM2VOI.js.map} +0 -0
  41. /package/dist/{chunk-4IIY742N.js.map → chunk-UTSBXZAM.js.map} +0 -0
package/REFERENCE.md CHANGED
@@ -48,7 +48,7 @@ _No JSDoc summary is available yet._
48
48
 
49
49
  ```ts
50
50
  const DREAMBOARD_SDK_PACKAGES: {
51
- readonly "@dreamboard-games/sdk": "0.4.0-alpha.11";
51
+ readonly "@dreamboard-games/sdk": "0.4.0-alpha.12";
52
52
  };
53
53
  ```
54
54
 
@@ -57,7 +57,7 @@ _No JSDoc summary is available yet._
57
57
  ### DREAMBOARD_SDK_VERSION
58
58
 
59
59
  ```ts
60
- const DREAMBOARD_SDK_VERSION: "0.4.0-alpha.11";
60
+ const DREAMBOARD_SDK_VERSION: "0.4.0-alpha.12";
61
61
  ```
62
62
 
63
63
  _No JSDoc summary is available yet._
@@ -96,7 +96,7 @@ _No JSDoc summary is available yet._
96
96
 
97
97
  ```ts
98
98
  const DREAMBOARD_SDK_PACKAGES: {
99
- readonly "@dreamboard-games/sdk": "0.4.0-alpha.11";
99
+ readonly "@dreamboard-games/sdk": "0.4.0-alpha.12";
100
100
  };
101
101
  ```
102
102
 
@@ -105,7 +105,7 @@ _No JSDoc summary is available yet._
105
105
  ### DREAMBOARD_SDK_VERSION
106
106
 
107
107
  ```ts
108
- const DREAMBOARD_SDK_VERSION: "0.4.0-alpha.11";
108
+ const DREAMBOARD_SDK_VERSION: "0.4.0-alpha.12";
109
109
  ```
110
110
 
111
111
  _No JSDoc summary is available yet._
@@ -20868,6 +20868,14 @@ type ClientParamSchemaMap = Readonly<
20868
20868
 
20869
20869
  _No JSDoc summary is available yet._
20870
20870
 
20871
+ ### createGameUiContract
20872
+
20873
+ ```ts
20874
+ function createGameUiContract(...args: never[]): unknown;
20875
+ ```
20876
+
20877
+ _No JSDoc summary is available yet._
20878
+
20871
20879
  ### createWorkspaceUIContract
20872
20880
 
20873
20881
  ```ts
@@ -20971,6 +20979,224 @@ interface GameTurnState<
20971
20979
 
20972
20980
  _No JSDoc summary is available yet._
20973
20981
 
20982
+ ### GameUiBoardSurface
20983
+
20984
+ ```ts
20985
+ type GameUiBoardSurface<
20986
+ Manifest extends GameUiManifestTypes,
20987
+ _Board extends Manifest["BoardBaseId"] = Manifest["BoardBaseId"],
20988
+ > = WorkspaceBoardSurface<
20989
+ Manifest["SpaceId"],
20990
+ Manifest["EdgeId"],
20991
+ Manifest["VertexId"],
20992
+ Manifest["SpaceId"]
20993
+ > & {
20994
+ readonly __board?: _Board;
20995
+ };
20996
+ ```
20997
+
20998
+ _No JSDoc summary is available yet._
20999
+
21000
+ ### GameUiCardCollectionSurface
21001
+
21002
+ ```ts
21003
+ type GameUiCardCollectionSurface<
21004
+ Manifest extends GameUiManifestTypes,
21005
+ Zones extends readonly Manifest["ZoneId"][] = readonly Manifest["ZoneId"][],
21006
+ > = {
21007
+ readonly Collection: ZoneCardsComponent<Manifest>;
21008
+ readonly Card: ZoneCardComponent<Manifest>;
21009
+ readonly slot: {
21010
+ readonly card: GameUiInteractionSlot & {
21011
+ readonly __zones?: Zones;
21012
+ };
21013
+ };
21014
+ };
21015
+ ```
21016
+
21017
+ _No JSDoc summary is available yet._
21018
+
21019
+ ### GameUiContract
21020
+
21021
+ ```ts
21022
+ type GameUiContract<Game, Manifest extends GameUiManifestTypes> = UiRegistry<
21023
+ Game,
21024
+ Manifest
21025
+ >;
21026
+ ```
21027
+
21028
+ _No JSDoc summary is available yet._
21029
+
21030
+ ### GameUiGameRootState
21031
+
21032
+ ```ts
21033
+ type GameUiGameRootState<
21034
+ Game,
21035
+ Manifest extends GameUiManifestTypes,
21036
+ > = GameRenderState<
21037
+ GameUiView<Game>,
21038
+ Manifest["PlayerId"],
21039
+ GameUiPhaseName<Game>
21040
+ >;
21041
+ ```
21042
+
21043
+ _No JSDoc summary is available yet._
21044
+
21045
+ ### GameUiHandSurface
21046
+
21047
+ ```ts
21048
+ type GameUiHandSurface = ...;
21049
+ ```
21050
+
21051
+ _No JSDoc summary is available yet._
21052
+
21053
+ ### GameUiInteractionDescriptor
21054
+
21055
+ ```ts
21056
+ type GameUiInteractionDescriptor<
21057
+ Game,
21058
+ Key extends GameUiInteractionKey<Game>,
21059
+ > = InteractionDescriptor<Key>;
21060
+ ```
21061
+
21062
+ _No JSDoc summary is available yet._
21063
+
21064
+ ### GameUiInteractionFormSurface
21065
+
21066
+ ```ts
21067
+ type GameUiInteractionFormSurface = ...;
21068
+ ```
21069
+
21070
+ _No JSDoc summary is available yet._
21071
+
21072
+ ### GameUiInteractionKey
21073
+
21074
+ ```ts
21075
+ type GameUiInteractionKey<Game> = {
21076
+ [Phase in GameUiPhaseName<Game>]: `${Phase}.${GameUiInteractionIdForPhase<Game, Phase>}`;
21077
+ }[GameUiPhaseName<Game>];
21078
+ ```
21079
+
21080
+ _No JSDoc summary is available yet._
21081
+
21082
+ ### GameUiInteractionParamsOf
21083
+
21084
+ ```ts
21085
+ type GameUiInteractionParamsOf<
21086
+ Game,
21087
+ Key extends GameUiInteractionKey<Game>,
21088
+ > = ClientParamsOfInteractionOfDefinition<
21089
+ Game,
21090
+ PhaseOfInteractionKey<Game, Key>,
21091
+ IdOfInteractionKey<Game, Key>
21092
+ >;
21093
+ ```
21094
+
21095
+ _No JSDoc summary is available yet._
21096
+
21097
+ ### GameUiInteractionRoutes
21098
+
21099
+ ```ts
21100
+ type GameUiInteractionRoutes<Game> = Partial<{
21101
+ [Key in GameUiInteractionKey<Game>]: {
21102
+ readonly collect: {
21103
+ [Input in GameUiInteractionInputKeys<Game, Key>]: GameUiCollectorSlot<
21104
+ Game,
21105
+ Key,
21106
+ Input
21107
+ >;
21108
+ };
21109
+ };
21110
+ }>;
21111
+ ```
21112
+
21113
+ _No JSDoc summary is available yet._
21114
+
21115
+ ### GameUiManifestTypes
21116
+
21117
+ ```ts
21118
+ interface GameUiManifestTypes { ... }
21119
+ ```
21120
+
21121
+ _No JSDoc summary is available yet._
21122
+
21123
+ ### GameUiMe
21124
+
21125
+ ```ts
21126
+ type GameUiMe<Manifest extends GameUiManifestTypes> = GameMeState<
21127
+ Manifest["PlayerId"]
21128
+ >;
21129
+ ```
21130
+
21131
+ _No JSDoc summary is available yet._
21132
+
21133
+ ### GameUiPhaseName
21134
+
21135
+ ```ts
21136
+ type GameUiPhaseName<Game> = PhaseNamesOfDefinition<Game>;
21137
+ ```
21138
+
21139
+ _No JSDoc summary is available yet._
21140
+
21141
+ ### GameUiPileSurface
21142
+
21143
+ ```ts
21144
+ type GameUiPileSurface<Manifest extends GameUiManifestTypes> = {
21145
+ readonly Pile: ZoneCardsComponent<Manifest>;
21146
+ readonly Card: ZoneCardComponent<Manifest>;
21147
+ };
21148
+ ```
21149
+
21150
+ _No JSDoc summary is available yet._
21151
+
21152
+ ### GameUiPlayers
21153
+
21154
+ ```ts
21155
+ type GameUiPlayers<Manifest extends GameUiManifestTypes> = GamePlayersState<
21156
+ Manifest["PlayerId"]
21157
+ >;
21158
+ ```
21159
+
21160
+ _No JSDoc summary is available yet._
21161
+
21162
+ ### GameUiTurn
21163
+
21164
+ ```ts
21165
+ type GameUiTurn<Game, Manifest extends GameUiManifestTypes> = GameTurnState<
21166
+ Manifest["PlayerId"],
21167
+ GameUiPhaseName<Game>
21168
+ >;
21169
+ ```
21170
+
21171
+ _No JSDoc summary is available yet._
21172
+
21173
+ ### GameUiView
21174
+
21175
+ ```ts
21176
+ type GameUiView<Game> =
21177
+ Extract<"player", GameUiViewName<Game>> extends never
21178
+ ? never
21179
+ : ViewOfDefinition<Game, Extract<"player", GameUiViewName<Game>>>;
21180
+ ```
21181
+
21182
+ _No JSDoc summary is available yet._
21183
+
21184
+ ### GameUiViewName
21185
+
21186
+ ```ts
21187
+ type GameUiViewName<Game> = ViewNamesOfDefinition<Game>;
21188
+ ```
21189
+
21190
+ _No JSDoc summary is available yet._
21191
+
21192
+ ### GameWorkspaceUI
21193
+
21194
+ ```ts
21195
+ type GameWorkspaceUI = ...;
21196
+ ```
21197
+
21198
+ _No JSDoc summary is available yet._
21199
+
20974
21200
  ### ResourceCounterComponents
20975
21201
 
20976
21202
  ```ts
@@ -7,9 +7,9 @@ import {
7
7
  materializeManifest,
8
8
  projectAuthoringAdapter,
9
9
  validateManifest
10
- } from "../chunk-3OY46H7D.js";
11
- import "../chunk-CP3BF3B2.js";
12
- import "../chunk-SACZWUA6.js";
10
+ } from "../chunk-64FUL7XN.js";
11
+ import "../chunk-RYIRARLV.js";
12
+ import "../chunk-HIH6Y4FA.js";
13
13
  import "../chunk-PZ5AY32C.js";
14
14
  export {
15
15
  GENERATED_WORKSPACE_PATHS,
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  materializeWorkspace
3
- } from "./chunk-THTFQZZ3.js";
4
- import "./chunk-3OY46H7D.js";
3
+ } from "./chunk-FYJRMV7A.js";
4
+ import "./chunk-64FUL7XN.js";
5
5
  import "./chunk-UNVCT5Z7.js";
6
- import "./chunk-CP3BF3B2.js";
7
- import "./chunk-SACZWUA6.js";
6
+ import "./chunk-RYIRARLV.js";
7
+ import "./chunk-HIH6Y4FA.js";
8
8
  import "./chunk-PZ5AY32C.js";
9
9
  export {
10
10
  materializeWorkspace
@@ -1,11 +1,11 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  materializeWorkspace
4
- } from "./chunk-THTFQZZ3.js";
5
- import "./chunk-3OY46H7D.js";
4
+ } from "./chunk-FYJRMV7A.js";
5
+ import "./chunk-64FUL7XN.js";
6
6
  import "./chunk-UNVCT5Z7.js";
7
- import "./chunk-CP3BF3B2.js";
8
- import "./chunk-SACZWUA6.js";
7
+ import "./chunk-RYIRARLV.js";
8
+ import "./chunk-HIH6Y4FA.js";
9
9
  import "./chunk-PZ5AY32C.js";
10
10
 
11
11
  // src/authoring-materialize-cli.ts
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  GENERATED_AUTHORING_METADATA
3
- } from "./chunk-CP3BF3B2.js";
3
+ } from "./chunk-RYIRARLV.js";
4
4
  import {
5
5
  AUTHORITATIVE_GENERATED_FILES,
6
6
  SEED_FILES,
@@ -9,7 +9,7 @@ import {
9
9
  generateSeedFiles,
10
10
  materializeManifestTable,
11
11
  validateManifestAuthoring
12
- } from "./chunk-SACZWUA6.js";
12
+ } from "./chunk-HIH6Y4FA.js";
13
13
 
14
14
  // src/authoring/manifest-conformance-cases.ts
15
15
  function baseManifest(cardSet, overrides = {}) {
@@ -529,4 +529,4 @@ export {
529
529
  MANIFEST_CONFORMANCE_CASES,
530
530
  projectAuthoringAdapter
531
531
  };
532
- //# sourceMappingURL=chunk-3OY46H7D.js.map
532
+ //# sourceMappingURL=chunk-64FUL7XN.js.map
@@ -34,6 +34,9 @@ import {
34
34
  import {
35
35
  useAuthoredPluginGameplayFrameSelector
36
36
  } from "./chunk-B33RRZ4O.js";
37
+ import {
38
+ createClientParamSchemasByPhase
39
+ } from "./chunk-5XTAQ4EQ.js";
37
40
 
38
41
  // src/runtime/workspace-contract/index.ts
39
42
  import { Fragment, createElement as createElement6 } from "react";
@@ -769,6 +772,47 @@ function createZoneNamespace(ctx) {
769
772
  };
770
773
  }
771
774
 
775
+ // src/runtime/workspace-contract/game-ui-contract.ts
776
+ function createGameUiContract(options) {
777
+ const uiContract = {
778
+ interactions: {},
779
+ inputs: {},
780
+ prompts: {},
781
+ promptOptions: {},
782
+ players: {},
783
+ zones: {},
784
+ cards: {},
785
+ phases: {},
786
+ boardTargets: {}
787
+ };
788
+ const clientParamSchemasByPhase = createClientParamSchemasByPhase(
789
+ options.game
790
+ );
791
+ const formInputKeysForInteraction = (interaction) => {
792
+ const [phase, id] = interaction.split(".", 2);
793
+ const phaseSpec = phase ? options.game.phases?.[phase] : void 0;
794
+ const phaseRecord = phaseSpec;
795
+ const spec = (id ? phaseRecord?.interactions?.[id] : void 0) ?? (id ? phaseRecord?.cardActions?.[id] : void 0) ?? (id === "submit" ? phaseRecord?.submit : void 0);
796
+ return new Set(
797
+ Object.entries(spec?.inputs ?? {}).filter(
798
+ ([, collector]) => collector.kind === "form" || collector.kind === "prompt"
799
+ ).map(([input]) => input)
800
+ );
801
+ };
802
+ const UI2 = createWorkspaceUIContract({
803
+ uiContract,
804
+ clientParamSchemasByPhase,
805
+ formInputKeysForInteraction,
806
+ resourceIds: options.resourceIds,
807
+ resourcePresentationById: options.resourcePresentationById,
808
+ hexStaticBoards: options.hexStaticBoards,
809
+ squareStaticBoards: options.squareStaticBoards,
810
+ cardIdFromZoneCard: (card) => card.id,
811
+ zoneIdFromZoneCard: (card) => card.zone
812
+ });
813
+ return { uiContract, UI: UI2, clientParamSchemasByPhase };
814
+ }
815
+
772
816
  // src/runtime/workspace-contract/index.ts
773
817
  function createWorkspaceUIContract(options) {
774
818
  const baseUI = createDreamboardUI(options.uiContract);
@@ -872,6 +916,7 @@ function createWorkspaceUIContract(options) {
872
916
  }
873
917
 
874
918
  export {
919
+ createGameUiContract,
875
920
  createWorkspaceUIContract
876
921
  };
877
- //# sourceMappingURL=chunk-RP6QDQGI.js.map
922
+ //# sourceMappingURL=chunk-7JBPOJOF.js.map