@dreamboard-games/sdk 0.4.0-alpha.0 → 0.4.0-alpha.1

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 (62) hide show
  1. package/README.md +8 -1
  2. package/REFERENCE.md +488 -108
  3. package/dist/attributes-BrZtP9az.d.ts +53 -0
  4. package/dist/browser-interaction.d.ts +44 -42
  5. package/dist/browser-interaction.js +2 -1
  6. package/dist/{chunk-4G7552LO.js → chunk-3K362ZKR.js} +17 -12
  7. package/dist/chunk-3K362ZKR.js.map +1 -0
  8. package/dist/{chunk-U5KBV2BA.js → chunk-7LZZEI25.js} +444 -223
  9. package/dist/chunk-7LZZEI25.js.map +1 -0
  10. package/dist/{chunk-Q5O7GPVY.js → chunk-7W6TQO3X.js} +18 -10
  11. package/dist/chunk-7W6TQO3X.js.map +1 -0
  12. package/dist/chunk-AEUXCFGM.js +124 -0
  13. package/dist/chunk-AEUXCFGM.js.map +1 -0
  14. package/dist/{chunk-P7F4L2FF.js → chunk-CZMFAS3E.js} +327 -248
  15. package/dist/chunk-CZMFAS3E.js.map +1 -0
  16. package/dist/{chunk-MNKDSGIA.js → chunk-IUGKW2GS.js} +2 -2
  17. package/dist/{chunk-MNKDSGIA.js.map → chunk-IUGKW2GS.js.map} +1 -1
  18. package/dist/{chunk-QLG6VEMW.js → chunk-MALRKLRR.js} +19 -11
  19. package/dist/chunk-MALRKLRR.js.map +1 -0
  20. package/dist/{chunk-2LDZ5C3T.js → chunk-XJYUSD5F.js} +2 -2
  21. package/dist/{chunk-NBAEEHAU.js → chunk-XXBSIPJX.js} +5952 -5364
  22. package/dist/chunk-XXBSIPJX.js.map +1 -0
  23. package/dist/codegen.d.ts +3 -1
  24. package/dist/codegen.js +1 -1
  25. package/dist/{components-DaIqi9QM.d.ts → components-Dqr_LuZJ.d.ts} +1 -65
  26. package/dist/index.js +1 -1
  27. package/dist/package-set.d.ts +2 -2
  28. package/dist/package-set.js +1 -1
  29. package/dist/reducer/advanced.d.ts +2 -2
  30. package/dist/reducer/advanced.js +1 -1
  31. package/dist/reducer-contract.js +1 -1
  32. package/dist/reducer.d.ts +7 -7
  33. package/dist/reducer.js +190 -183
  34. package/dist/reducer.js.map +1 -1
  35. package/dist/runtime/primitives.d.ts +4 -3
  36. package/dist/runtime/primitives.js +5 -4
  37. package/dist/runtime/workspace-contract.d.ts +10 -69
  38. package/dist/runtime/workspace-contract.js +6 -5
  39. package/dist/runtime-json-CQ9QbLZ5.d.ts +5 -0
  40. package/dist/runtime.d.ts +70 -5
  41. package/dist/runtime.js +483 -129
  42. package/dist/runtime.js.map +1 -1
  43. package/dist/testing.d.ts +509 -2
  44. package/dist/testing.js +481 -1
  45. package/dist/testing.js.map +1 -1
  46. package/dist/{attributes-BeRyboMS.d.ts → types-BqzHkNMA.d.ts} +1 -51
  47. package/dist/types.d.ts +4 -2
  48. package/dist/ui/components.d.ts +1 -1
  49. package/dist/ui/components.js +1 -1
  50. package/dist/ui/plugin-styles.css +1 -1
  51. package/dist/{ui-contract-BUC6iS3s.d.ts → ui-contract-W2-kxObe.d.ts} +2 -1
  52. package/dist/ui.d.ts +3 -7
  53. package/dist/ui.js +2 -2
  54. package/dist/{views-B0hlW6IT.d.ts → views-fn2RuXOx.d.ts} +59 -44
  55. package/package.json +31 -13
  56. package/dist/chunk-4G7552LO.js.map +0 -1
  57. package/dist/chunk-NBAEEHAU.js.map +0 -1
  58. package/dist/chunk-P7F4L2FF.js.map +0 -1
  59. package/dist/chunk-Q5O7GPVY.js.map +0 -1
  60. package/dist/chunk-QLG6VEMW.js.map +0 -1
  61. package/dist/chunk-U5KBV2BA.js.map +0 -1
  62. /package/dist/{chunk-2LDZ5C3T.js.map → chunk-XJYUSD5F.js.map} +0 -0
@@ -92,7 +92,7 @@ function usePanZoom(options = {}) {
92
92
  }, [initialZoom, initialPan, updateTransform]);
93
93
  useEffect(() => {
94
94
  updateTransform(initialZoom, initialPan);
95
- }, [initialZoom, initialPan.x, initialPan.y, updateTransform]);
95
+ }, [initialZoom, initialPan, updateTransform]);
96
96
  const setZoom = useCallback(
97
97
  (newZoom) => {
98
98
  updateTransform(clampZoom(newZoom), pan);
@@ -118,7 +118,11 @@ function usePanZoom(options = {}) {
118
118
  );
119
119
  const safeBind = useCallback(() => {
120
120
  const result = bind();
121
- const { ref: _ref, ...propsWithoutRef } = result ?? {};
121
+ const resultWithMaybeRef = result ?? {};
122
+ const propsWithoutRef = {
123
+ ...resultWithMaybeRef
124
+ };
125
+ delete propsWithoutRef.ref;
122
126
  return propsWithoutRef;
123
127
  }, [bind]);
124
128
  return {
@@ -6085,11 +6089,7 @@ function renderResourceIcon(icon, props = {}) {
6085
6089
  ...props
6086
6090
  });
6087
6091
  }
6088
- const {
6089
- strokeWidth: _strokeWidth,
6090
- "aria-hidden": ariaHidden,
6091
- ...spanProps
6092
- } = props;
6092
+ const { "aria-hidden": ariaHidden, ...spanProps } = props;
6093
6093
  return /* @__PURE__ */ jsx24(
6094
6094
  "span",
6095
6095
  {
@@ -10474,6 +10474,14 @@ function DefaultInteractiveEdge({
10474
10474
  }
10475
10475
  );
10476
10476
  }
10477
+ var SVG_POINT_PRECISION = 12;
10478
+ function formatSvgNumber(value) {
10479
+ const rounded = Math.round(value * 10 ** SVG_POINT_PRECISION) / 10 ** SVG_POINT_PRECISION;
10480
+ return `${Object.is(rounded, -0) ? 0 : rounded}`;
10481
+ }
10482
+ function formatSvgPoint(point) {
10483
+ return `${formatSvgNumber(point.x)},${formatSvgNumber(point.y)}`;
10484
+ }
10477
10485
  var hexUtils = {
10478
10486
  /** Convert axial coordinates to pixel position. */
10479
10487
  axialToPixel(q, r, size, orientation) {
@@ -10515,7 +10523,7 @@ var hexUtils = {
10515
10523
  },
10516
10524
  getHexPoints(centerX, centerY, size, orientation) {
10517
10525
  const corners = this.getHexCorners(centerX, centerY, size, orientation);
10518
- return corners.map((c) => `${c.x},${c.y}`).join(" ");
10526
+ return corners.map(formatSvgPoint).join(" ");
10519
10527
  },
10520
10528
  getEdgePosition(hex1Pos, hex2Pos, size) {
10521
10529
  const midX = (hex1Pos.x + hex2Pos.x) / 2;
@@ -10612,7 +10620,7 @@ function HexGridImpl(props) {
10612
10620
  const radius = Math.max(0, hexSize - inset);
10613
10621
  return hexUtils.getHexCorners(0, 0, radius, resolvedOrientation);
10614
10622
  };
10615
- const points = (options) => corners(options).map((corner) => `${corner.x},${corner.y}`).join(" ");
10623
+ const points = (options) => corners(options).map(formatSvgPoint).join(" ");
10616
10624
  const outer = corners();
10617
10625
  const xs = outer.map((corner) => corner.x);
10618
10626
  const ys = outer.map((corner) => corner.y);
@@ -11058,4 +11066,4 @@ export {
11058
11066
  HexGrid,
11059
11067
  createHexBoardView
11060
11068
  };
11061
- //# sourceMappingURL=chunk-Q5O7GPVY.js.map
11069
+ //# sourceMappingURL=chunk-7W6TQO3X.js.map