@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
@@ -9,6 +9,7 @@ import {
9
9
  SelectContent,
10
10
  SelectItem,
11
11
  SelectTrigger,
12
+ SquareGrid,
12
13
  StagingZone,
13
14
  ThemeProvider,
14
15
  ThemedButton,
@@ -18,7 +19,7 @@ import {
18
19
  useOverlayInsets,
19
20
  useTheme,
20
21
  useThemeCssVars
21
- } from "./chunk-E3X552YM.js";
22
+ } from "./chunk-2TRZSZGD.js";
22
23
  import {
23
24
  composeEventHandlers,
24
25
  renderPrimitive
@@ -36,7 +37,7 @@ import {
36
37
  usePluginSession,
37
38
  usePluginSessionDescriptor,
38
39
  useRuntimeContext
39
- } from "./chunk-O6M6PN4E.js";
40
+ } from "./chunk-UUQNOGZV.js";
40
41
  import {
41
42
  createGameplayActuatorAttributes,
42
43
  createGameplayInteractionRootAttributes,
@@ -46,7 +47,7 @@ import {
46
47
  gameplayInvokeEffect,
47
48
  gameplaySetCandidateEffect,
48
49
  gameplaySetScalarEffect
49
- } from "./chunk-WUIVY2KE.js";
50
+ } from "./chunk-WHR5UW3F.js";
50
51
 
51
52
  // src/runtime/primitives/ui.tsx
52
53
  import { Fragment, jsx } from "react/jsx-runtime";
@@ -847,10 +848,7 @@ function useCardIntentAdapter({
847
848
  availableInteractions,
848
849
  zoneSnapshot,
849
850
  submit: async (descriptor, params) => {
850
- await runtime.submitInteraction(
851
- descriptor.interactionId,
852
- params
853
- );
851
+ await runtime.submitInteraction(descriptor.interactionId, params);
854
852
  }
855
853
  },
856
854
  intent.type === "drop" ? {
@@ -937,9 +935,7 @@ import { useMemo as useMemo2 } from "react";
937
935
  function usePlayerTurnOrder() {
938
936
  const sessionDescriptor = usePluginSessionDescriptor();
939
937
  return useMemo2(
940
- () => sessionDescriptor.players.map(
941
- (player) => player.playerId
942
- ),
938
+ () => sessionDescriptor.players.map((player) => player.playerId),
943
939
  [sessionDescriptor]
944
940
  );
945
941
  }
@@ -1389,10 +1385,7 @@ function ZoneCardAction({
1389
1385
  };
1390
1386
  }
1391
1387
  try {
1392
- await runtime.submitInteraction(
1393
- descriptor.interactionId,
1394
- params
1395
- );
1388
+ await runtime.submitInteraction(descriptor.interactionId, params);
1396
1389
  clearInteractionRoute(store, descriptor);
1397
1390
  return {
1398
1391
  status: "submitted",
@@ -2874,19 +2867,9 @@ function BoardHexGrid({
2874
2867
  }) {
2875
2868
  const boardInteractions = useBoardPrimitiveContext();
2876
2869
  const gameActionError = useGameActionError();
2877
- const edgeLayer = interactions === false ? void 0 : boardInteractions.targetLayers.edge({
2878
- enabled: boardInteractions.eligible.edge.size > 0,
2879
- interactionKeys: interactions === "auto" ? void 0 : interactions.edge,
2880
- onError: gameActionError ?? void 0
2881
- });
2882
- const vertexLayer = interactions === false ? void 0 : boardInteractions.targetLayers.vertex({
2883
- enabled: boardInteractions.eligible.vertex.size > 0,
2884
- interactionKeys: interactions === "auto" ? void 0 : interactions.vertex,
2885
- onError: gameActionError ?? void 0
2886
- });
2887
- const spaceLayer = interactions === false ? void 0 : boardInteractions.targetLayers.space({
2888
- enabled: boardInteractions.eligible.space.size > 0,
2889
- interactionKeys: interactions === "auto" ? void 0 : interactions.space,
2870
+ const { edgeLayer, vertexLayer, spaceLayer } = useBoardGridTargetLayers({
2871
+ boardInteractions,
2872
+ interactions,
2890
2873
  onError: gameActionError ?? void 0
2891
2874
  });
2892
2875
  return /* @__PURE__ */ jsx5(BoardHexView, { board, spaces, children: (view) => /* @__PURE__ */ jsx5(
@@ -2900,6 +2883,52 @@ function BoardHexGrid({
2900
2883
  }
2901
2884
  ) });
2902
2885
  }
2886
+ function BoardSquareGrid({
2887
+ board,
2888
+ interactions = "auto",
2889
+ ...props
2890
+ }) {
2891
+ const boardInteractions = useBoardPrimitiveContext();
2892
+ const gameActionError = useGameActionError();
2893
+ const { edgeLayer, vertexLayer, spaceLayer } = useBoardGridTargetLayers({
2894
+ boardInteractions,
2895
+ interactions,
2896
+ onError: gameActionError ?? void 0
2897
+ });
2898
+ return /* @__PURE__ */ jsx5(
2899
+ SquareGrid,
2900
+ {
2901
+ ...props,
2902
+ board,
2903
+ interactiveEdges: edgeLayer,
2904
+ interactiveVertices: vertexLayer,
2905
+ interactiveSpaces: spaceLayer
2906
+ }
2907
+ );
2908
+ }
2909
+ function useBoardGridTargetLayers({
2910
+ boardInteractions,
2911
+ interactions,
2912
+ onError
2913
+ }) {
2914
+ return {
2915
+ edgeLayer: interactions === false ? void 0 : boardInteractions.targetLayers.edge({
2916
+ enabled: boardInteractions.eligible.edge.size > 0,
2917
+ interactionKeys: interactions === "auto" ? void 0 : interactions.edge,
2918
+ onError
2919
+ }),
2920
+ vertexLayer: interactions === false ? void 0 : boardInteractions.targetLayers.vertex({
2921
+ enabled: boardInteractions.eligible.vertex.size > 0,
2922
+ interactionKeys: interactions === "auto" ? void 0 : interactions.vertex,
2923
+ onError
2924
+ }),
2925
+ spaceLayer: interactions === false ? void 0 : boardInteractions.targetLayers.space({
2926
+ enabled: boardInteractions.eligible.space.size > 0,
2927
+ interactionKeys: interactions === "auto" ? void 0 : interactions.space,
2928
+ onError
2929
+ })
2930
+ };
2931
+ }
2903
2932
  function BoardTarget({
2904
2933
  interaction,
2905
2934
  input,
@@ -3124,6 +3153,7 @@ var Board = {
3124
3153
  State: BoardState,
3125
3154
  HexGrid: BoardHexGrid,
3126
3155
  HexView: BoardHexView,
3156
+ SquareGrid: BoardSquareGrid,
3127
3157
  Target: BoardTarget,
3128
3158
  SpaceTarget: BoardSpaceTarget,
3129
3159
  EdgeTarget: BoardEdgeTarget,
@@ -5099,6 +5129,7 @@ function InteractionSubmit({
5099
5129
  params,
5100
5130
  onSubmitSuccess,
5101
5131
  onSubmitError,
5132
+ style,
5102
5133
  ...props
5103
5134
  }) {
5104
5135
  const { descriptor, handle } = useInteractionPrimitiveContext();
@@ -5132,6 +5163,10 @@ function InteractionSubmit({
5132
5163
  "data-input-count": descriptor?.inputs.length,
5133
5164
  "data-submitting": isSubmitting || void 0,
5134
5165
  "data-state": handle?.status ?? "unavailable",
5166
+ style: {
5167
+ minHeight: 44,
5168
+ ...style
5169
+ },
5135
5170
  onClick: composeEventHandlers(onClick, () => {
5136
5171
  if (isDisabled || !handle) return;
5137
5172
  const resolvedParams = typeof params === "function" ? params() : params;
@@ -5887,6 +5922,7 @@ export {
5887
5922
  BoardState,
5888
5923
  BoardHexView,
5889
5924
  BoardHexGrid,
5925
+ BoardSquareGrid,
5890
5926
  BoardTarget,
5891
5927
  BoardSpaceTarget,
5892
5928
  BoardEdgeTarget,
@@ -5936,4 +5972,4 @@ export {
5936
5972
  DiceValues,
5937
5973
  Dice
5938
5974
  };
5939
- //# sourceMappingURL=chunk-QOFFRHZR.js.map
5975
+ //# sourceMappingURL=chunk-OV6JC2BM.js.map