@dreamboard-games/sdk 0.5.0-alpha.2 → 0.5.0-alpha.4

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 (151) hide show
  1. package/README.md +186 -45
  2. package/dist/board-target-B0QG6OYx.d.ts +8 -0
  3. package/dist/chunk-3JXUL4VN.js +139 -0
  4. package/dist/chunk-3JXUL4VN.js.map +1 -0
  5. package/dist/{chunk-S2JEDVWH.js → chunk-C77SYIVT.js} +6102 -6505
  6. package/dist/chunk-C77SYIVT.js.map +1 -0
  7. package/dist/chunk-DMFVAZI2.js +16 -0
  8. package/dist/chunk-DMFVAZI2.js.map +1 -0
  9. package/dist/chunk-OOFMBCFF.js +1338 -0
  10. package/dist/chunk-OOFMBCFF.js.map +1 -0
  11. package/dist/chunk-UG2Q4NLG.js +590 -0
  12. package/dist/chunk-UG2Q4NLG.js.map +1 -0
  13. package/dist/chunk-XU6WJW6K.js +847 -0
  14. package/dist/chunk-XU6WJW6K.js.map +1 -0
  15. package/dist/diagnostics-B8d5aLad.d.ts +65 -0
  16. package/dist/extract-gVKcB8Og.d.ts +4736 -0
  17. package/dist/index.d.ts +3782 -1
  18. package/dist/index.js +1096 -6
  19. package/dist/index.js.map +1 -1
  20. package/dist/model-vdpLHrxh.d.ts +432 -0
  21. package/dist/react.d.ts +60 -0
  22. package/dist/react.js +208 -0
  23. package/dist/react.js.map +1 -0
  24. package/dist/reducer.d.ts +1244 -78
  25. package/dist/reducer.js +4204 -121
  26. package/dist/reducer.js.map +1 -1
  27. package/dist/testing.d.ts +520 -564
  28. package/dist/testing.js +2451 -915
  29. package/dist/testing.js.map +1 -1
  30. package/dist/types-Bj5ZLTUV.d.ts +114 -0
  31. package/package.json +40 -142
  32. package/dist/HandView-Bi2lxzQP.d.ts +0 -79
  33. package/dist/ResourceCounter-BFxJknqp.d.ts +0 -98
  34. package/dist/ThemeProvider-CElaL2ik.d.ts +0 -99
  35. package/dist/attributes-DbvyMbXw.d.ts +0 -68
  36. package/dist/browser-interaction.d.ts +0 -910
  37. package/dist/browser-interaction.js +0 -119
  38. package/dist/browser-interaction.js.map +0 -1
  39. package/dist/chunk-32PFKDV7.js +0 -11705
  40. package/dist/chunk-32PFKDV7.js.map +0 -1
  41. package/dist/chunk-3BAD4VC2.js +0 -263
  42. package/dist/chunk-3BAD4VC2.js.map +0 -1
  43. package/dist/chunk-3SKDNDPG.js +0 -104
  44. package/dist/chunk-3SKDNDPG.js.map +0 -1
  45. package/dist/chunk-5YV2WHJ4.js +0 -25
  46. package/dist/chunk-5YV2WHJ4.js.map +0 -1
  47. package/dist/chunk-ANRB4XKA.js +0 -90
  48. package/dist/chunk-ANRB4XKA.js.map +0 -1
  49. package/dist/chunk-BI4G3PM2.js +0 -1864
  50. package/dist/chunk-BI4G3PM2.js.map +0 -1
  51. package/dist/chunk-EVCLTY4Q.js +0 -935
  52. package/dist/chunk-EVCLTY4Q.js.map +0 -1
  53. package/dist/chunk-GDPKTBUR.js +0 -564
  54. package/dist/chunk-GDPKTBUR.js.map +0 -1
  55. package/dist/chunk-H6VDGFL5.js +0 -2903
  56. package/dist/chunk-H6VDGFL5.js.map +0 -1
  57. package/dist/chunk-LR3ZTWQF.js +0 -5960
  58. package/dist/chunk-LR3ZTWQF.js.map +0 -1
  59. package/dist/chunk-PF7L4BMG.js +0 -117
  60. package/dist/chunk-PF7L4BMG.js.map +0 -1
  61. package/dist/chunk-PN5O6GG2.js +0 -32
  62. package/dist/chunk-PN5O6GG2.js.map +0 -1
  63. package/dist/chunk-PZ5AY32C.js +0 -10
  64. package/dist/chunk-PZ5AY32C.js.map +0 -1
  65. package/dist/chunk-S2JEDVWH.js.map +0 -1
  66. package/dist/chunk-T3ZKNUZ7.js +0 -1
  67. package/dist/chunk-T3ZKNUZ7.js.map +0 -1
  68. package/dist/chunk-UGH54WZ2.js +0 -223
  69. package/dist/chunk-UGH54WZ2.js.map +0 -1
  70. package/dist/chunk-VCDWP5VL.js +0 -746
  71. package/dist/chunk-VCDWP5VL.js.map +0 -1
  72. package/dist/chunk-VDXOF4FW.js +0 -69
  73. package/dist/chunk-VDXOF4FW.js.map +0 -1
  74. package/dist/chunk-WHR5UW3F.js +0 -1988
  75. package/dist/chunk-WHR5UW3F.js.map +0 -1
  76. package/dist/chunk-Y75CFE77.js +0 -17
  77. package/dist/chunk-Y75CFE77.js.map +0 -1
  78. package/dist/chunk-Z7QCREWI.js +0 -3435
  79. package/dist/chunk-Z7QCREWI.js.map +0 -1
  80. package/dist/chunk-ZZGN2ATS.js +0 -1941
  81. package/dist/chunk-ZZGN2ATS.js.map +0 -1
  82. package/dist/components-gAbIz7hK.d.ts +0 -1284
  83. package/dist/definitions-BgmV_GhC.d.ts +0 -300
  84. package/dist/diagnostics-DIi3ina7.d.ts +0 -50
  85. package/dist/digest.d.ts +0 -8
  86. package/dist/game-CsZScpcn.d.ts +0 -763
  87. package/dist/hex-board-view-aKkblDp6.d.ts +0 -1228
  88. package/dist/index-CcT9Q7N7.d.ts +0 -193
  89. package/dist/index.d-DjzoK7zn.d.ts +0 -2101
  90. package/dist/package-set.d.ts +0 -13
  91. package/dist/package-set.js +0 -12
  92. package/dist/package-set.js.map +0 -1
  93. package/dist/player-state-Cqpyeql0.d.ts +0 -371
  94. package/dist/plugin-runtime-contract.d.ts +0 -17
  95. package/dist/plugin-runtime-contract.js +0 -92
  96. package/dist/plugin-runtime-contract.js.map +0 -1
  97. package/dist/primitive-props-BNHDkgd7.d.ts +0 -16
  98. package/dist/protocol-dYgafTYY.d.ts +0 -314
  99. package/dist/reducer/advanced.d.ts +0 -82
  100. package/dist/reducer/advanced.js +0 -51
  101. package/dist/reducer/advanced.js.map +0 -1
  102. package/dist/reducer-contract.d.ts +0 -11
  103. package/dist/reducer-contract.js +0 -16
  104. package/dist/reducer-contract.js.map +0 -1
  105. package/dist/reference-games/index.d.ts +0 -31
  106. package/dist/reference-games/index.js +0 -48
  107. package/dist/reference-games/index.js.map +0 -1
  108. package/dist/runtime/primitives.d.ts +0 -250
  109. package/dist/runtime/primitives.js +0 -189
  110. package/dist/runtime/primitives.js.map +0 -1
  111. package/dist/runtime/runtime-api.d.ts +0 -2
  112. package/dist/runtime/runtime-api.js +0 -1
  113. package/dist/runtime/runtime-api.js.map +0 -1
  114. package/dist/runtime/workspace-contract.d.ts +0 -392
  115. package/dist/runtime/workspace-contract.js +0 -28
  116. package/dist/runtime/workspace-contract.js.map +0 -1
  117. package/dist/runtime-RJ5orDJU.d.ts +0 -1699
  118. package/dist/runtime-api-Bz5pwNU_.d.ts +0 -296
  119. package/dist/runtime-json-CQ9QbLZ5.d.ts +0 -5
  120. package/dist/runtime.d.ts +0 -83
  121. package/dist/runtime.js +0 -242
  122. package/dist/runtime.js.map +0 -1
  123. package/dist/schema.d.ts +0 -379
  124. package/dist/stale-contract-artifact-error-XLaweZtF.d.ts +0 -18
  125. package/dist/testing-compiler.d.ts +0 -37
  126. package/dist/testing-compiler.js +0 -272
  127. package/dist/testing-compiler.js.map +0 -1
  128. package/dist/testing-runtime.d.ts +0 -119
  129. package/dist/testing-runtime.js +0 -212
  130. package/dist/testing-runtime.js.map +0 -1
  131. package/dist/types-DJj5MJkl.d.ts +0 -256
  132. package/dist/types-DR7DoB1x.d.ts +0 -28
  133. package/dist/types-JWCYHmu7.d.ts +0 -122
  134. package/dist/types.d.ts +0 -1958
  135. package/dist/types.js +0 -14
  136. package/dist/types.js.map +0 -1
  137. package/dist/ui/components.d.ts +0 -17
  138. package/dist/ui/components.js +0 -216
  139. package/dist/ui/components.js.map +0 -1
  140. package/dist/ui/defaults.d.ts +0 -19
  141. package/dist/ui/defaults.js +0 -104
  142. package/dist/ui/defaults.js.map +0 -1
  143. package/dist/ui/player-state.d.ts +0 -2
  144. package/dist/ui/player-state.js +0 -1
  145. package/dist/ui/player-state.js.map +0 -1
  146. package/dist/ui/plugin-styles.css +0 -2
  147. package/dist/ui-contract-GTUPkf8z.d.ts +0 -1168
  148. package/dist/ui.d.ts +0 -317
  149. package/dist/ui.js +0 -277
  150. package/dist/ui.js.map +0 -1
  151. package/dist/views-BpuWcOyN.d.ts +0 -1641
package/dist/ui.d.ts DELETED
@@ -1,317 +0,0 @@
1
- import { bw as TrackSpace, bv as TrackPiece } from './components-gAbIz7hK.js';
2
- export { A as ActionButton, a as ActionButtonProps, b as ActionGroup, c as ActionGroupProps, d as ActionHelp, e as ActionHelpProps, f as ActionPanel, g as ActionPanelProps, B as ButtonSize, h as ButtonVariant, C as CardDragSurface, i as CardDragSurfaceContextValue, j as CardDragSurfaceController, k as CardDragSurfaceProps, l as CardDropTargetView, m as CardDropTargetViewProps, n as CardFace, o as CardFaceProps, p as CardPositionProps, q as CardSize, r as ChromeSuppressionProvider, s as CostDisplay, t as CostDisplayProps, D as DefaultEmptySlot, u as DefaultEmptySlotProps, v as DefaultNetworkEdge, w as DefaultNetworkEdgeProps, x as DefaultNetworkNode, y as DefaultNetworkNodeProps, z as DefaultNetworkPiece, E as DefaultNetworkPieceProps, F as DefaultSlotItem, G as DefaultSlotItemProps, H as DefaultSlotOccupant, I as DefaultSlotOccupantProps, J as DefaultTrackConnection, K as DefaultTrackConnectionProps, L as DefaultTrackJump, M as DefaultTrackJumpProps, N as DefaultTrackPiece, O as DefaultTrackPieceProps, P as DefaultTrackSpace, Q as DefaultTrackSpaceProps, R as DefaultZone, S as DefaultZonePiece, T as DefaultZonePieceProps, U as DefaultZonePieces, V as DefaultZonePiecesProps, W as DefaultZoneProps, X as Dialog, Y as DialogClose, Z as DialogContent, _ as DialogDescription, $ as DialogFooter, a0 as DialogHeader, a1 as DialogOverlay, a2 as DialogPortal, a3 as DialogTitle, a4 as DialogTrigger, a5 as DiceRoller, a6 as DiceRollerProps, a7 as DragPhase, a8 as Drawer, a9 as DrawerClose, aa as DrawerContent, ab as DrawerDescription, ac as DrawerFooter, ad as DrawerHeader, ae as DrawerOverlay, af as DrawerPortal, ag as DrawerTitle, ah as DrawerTrigger, ai as ErrorBoundary, aj as ErrorBoundaryProps, ak as GameSkeleton, al as GameSkeletonProps, am as GuidanceAction, an as GuidancePanel, ao as GuidancePanelProps, ap as GuidancePhase, aq as GuidanceSetupStep, ar as Hand, as as HandDock, at as HandDockMode, au as HandDockPlacement, av as HandDockPresentation, aw as HandDockProps, ax as HandDockToggleContext, ay as HandLayout, az as HandProps, aA as Input, aB as Label, aC as MoreActions, aD as MoreActionsProps, aE as NetworkEdge, aF as NetworkGraph, aG as NetworkGraphProps, aH as NetworkNode, aI as NetworkPiece, aJ as OutcomeDialog, aK as OutcomeDialogProps, aL as Panel, aM as PanelActions, aN as PanelBody, aO as PanelDescription, aP as PanelDescriptionProps, aQ as PanelHeader, aR as PanelPartProps, aS as PanelRoot, aT as PanelRootProps, aU as PanelTitle, aV as PanelTitleProps, aW as PanelTone, aX as PhaseIndicator, aY as PhaseIndicatorProps, aZ as PlayArea, a_ as PlayAreaProps, a$ as PrimaryActionAttention, b0 as PrimaryActionButton, b1 as PrimaryActionButtonProps, b2 as PrimaryButton, b3 as PrimaryButtonProps, b4 as ResourceDefinition, b5 as Select, b6 as SelectContent, b7 as SelectItem, b8 as SelectTrigger, b9 as SetupChecklist, ba as SetupChecklistProps, bb as SetupGuidance, bc as SlotDefinition, bd as SlotOccupant, be as SlotSystem, bf as SlotSystemProps, bg as StagingZone, bh as StagingZoneProps, bi as StandingsTable, bj as StandingsTableProps, bk as ThemedButton, bl as ThemedButtonProps, bm as Toast, bn as ToastActions, bo as ToastActionsProps, bp as ToastActionsValue, bq as ToastNotification, br as ToastProvider, bs as ToastType, bt as TrackBoard, bu as TrackBoardProps, bx as UseHandLayoutOptions, by as UseHandLayoutReturn, bz as ZoneDefinition, bA as ZoneHighlightType, bB as ZoneMap, bC as ZoneMapProps, bD as ZonePiece, bE as ZoneShape, bF as buttonStyle, bG as chipStyle, bH as intentForVariant, bI as motionDuration, bJ as playerColor, bK as surfaceStyle, bL as useCardDragSurface, bM as useChromeSuppression } from './components-gAbIz7hK.js';
3
- import { ag as Theme } from './hex-board-view-aKkblDp6.js';
4
- export { A as AnyHexBoardInput, a as AnySquareBoardInput, b as AuthoredHexBoardInput, c as AuthoredSquareBoardInput, B as BoardEdgeIdOf, d as BoardSpaceIdOf, e as BoardVertexIdOf, C as CardDropTargetVisualState, f as CardIntent, g as ColorRamp, h as ComponentTokens, D as DefaultChessPiece, i as DefaultChessPieceProps, j as DefaultGridCell, k as DefaultGridCellProps, l as DefaultGridPiece, m as DefaultGridPieceProps, n as DefaultHexEdge, o as DefaultHexEdgeProps, p as DefaultHexTile, q as DefaultHexTileProps, r as DefaultHexVertex, s as DefaultHexVertexProps, E as EdgePosition, t as Elevation, F as FoundationColor, G as GeneratedHexBoardInput, u as GeneratedHexSpaceStateLike, v as GeneratedSquareBoardInput, w as GeneratedSquareSpaceStateLike, x as GeneratedTiledEdgeStateLike, y as GeneratedTiledVertexStateLike, H as HexBoardInput, z as HexBoardView, I as HexBoardViewTile, J as HexGrid, K as HexGridBoardProps, L as HexGridProps, M as HexOrientation, N as HexTileGeometry, O as IntentColor, P as InteractionVisualState, Q as InteractiveHexEdge, R as InteractiveHexVertex, S as InteractiveSquareEdge, T as InteractiveSquareVertex, U as InteractiveTargetLayer, V as InteractiveTargetRenderState, X as Motion, Y as NormalizedHexBoard, Z as NormalizedHexEdgeOf, _ as NormalizedHexTileOf, $ as NormalizedHexVertexOf, a0 as NormalizedSquareBoard, a1 as NormalizedSquareCellOf, a2 as NormalizedSquareEdgeOf, a3 as NormalizedSquarePieceOf, a4 as NormalizedSquareVertexOf, a5 as PlayerColor, a6 as Radius, a7 as SemanticColor, a8 as Space, a9 as SquareBoardInput, aa as SquareEdgePosition, ab as SquareGrid, ac as SquareGridBoardProps, ad as SquareGridProps, ae as SquareVertexPosition, af as TargetIntent, ah as ThemeMeta, ai as ThemeOverride, aj as Typography, ak as createHexBoardView, al as dropTargetVisualStateDataAttributes, am as hexUtils, an as mergeTheme, ao as normalizeHexBoardInput, ap as normalizeSquareBoardInput, aq as toAlgebraic, ar as toNumeric, as as visualStateDataAttributes } from './hex-board-view-aKkblDp6.js';
5
- export { T as ThemeContextValue, a as ThemePresetId, b as ThemeProvider, c as ThemeProviderProps, g as getThemePreset, r as resolveTheme, u as useTheme, d as useThemeCssVars } from './ThemeProvider-CElaL2ik.js';
6
- import { CSSProperties } from 'react';
7
- export { H as HandInteractionPolicy, a as HandLayoutKind, b as HandLayoutPolicy, c as HandView, d as HandViewProps } from './HandView-Bi2lxzQP.js';
8
- export { B as BoundResourceCounterRootProps, H as HandRole, M as MobileHandRegistration, a as MobileHandTrayProvider, R as ResourceCounter, b as ResourceCounterComponents, c as ResourceCounterCount, d as ResourceCounterIcon, e as ResourceCounterItem, f as ResourceCounterItemState, g as ResourceCounterLabel, h as ResourceCounterPartProps, i as ResourceCounterProps, j as ResourceCounterRoot, k as ResourceCounterRootProps, l as ResourceDisplayConfig, m as ResourceIconProps, n as createResourceCounter, u as useOverlayInsets, o as useRegisterBottomOverlayInset, p as useRegisterMobileHand } from './ResourceCounter-BFxJknqp.js';
9
- export { B as BoardBaseId, a as BoardId, b as BoardKindStates, c as BoardRef, d as BoardStates, C as CardId, e as CardIdsByDeckId, f as CardProperties, D as DeckId, g as DiceStates, h as DieId, i as DieState, E as EdgeTypeId, G as GameState, H as HexBoardState, j as HexColor, k as HexEdgeState, l as HexTileState, m as HexVertexState, N as NetworkBoardState, n as NetworkEdgeState, o as NetworkNodeState, p as NetworkPieceState, P as PerPlayer, q as PerPlayerBoardRef, r as PieceId, s as PieceTypeId, t as Player, u as PlayerId, S as SharedBoardRef, v as SpaceId, w as SpaceTypeId, x as SquareBoardState, y as SquareCellState, z as SquareEdgeState, A as SquarePieceState, F as SquareVertexState, T as TrackBoardState, I as TrackPieceState, J as TrackSpaceState, V as VertexTypeId, K as hexColor, L as isHexColor, M as parseHexColor } from './player-state-Cqpyeql0.js';
10
- export { CardCollection, ViewCard, ViewSlotOccupant } from './types.js';
11
- import 'react/jsx-runtime';
12
- import 'framer-motion';
13
- import 'vaul';
14
- import '@radix-ui/react-dialog';
15
- import '@radix-ui/react-label';
16
- import '@radix-ui/react-select';
17
- import './runtime-RJ5orDJU.js';
18
- import 'zod';
19
- import './protocol-dYgafTYY.js';
20
- import './primitive-props-BNHDkgd7.js';
21
-
22
- /**
23
- * usePanZoom hook - Unified pan and zoom gestures using @use-gesture/react
24
- *
25
- * Provides a declarative API for pan and zoom interactions on board components.
26
- * Works with both SVG (via viewBox) and HTML (via CSS transforms) elements.
27
- *
28
- * Features:
29
- * - Single finger/mouse drag for panning
30
- * - Pinch-to-zoom on touch devices
31
- * - Mouse wheel zoom on desktop
32
- * - Configurable zoom limits
33
- * - Optional momentum/inertia
34
- *
35
- * @example SVG usage (NetworkGraph, HexGrid, etc.)
36
- * ```tsx
37
- * const { transform, bind, resetTransform } = usePanZoom({
38
- * enabled: enablePanZoom,
39
- * minZoom: 0.5,
40
- * maxZoom: 3,
41
- * });
42
- *
43
- * // Apply to viewBox calculation
44
- * const viewBoxWidth = contentWidth / transform.zoom;
45
- * const viewBoxX = baseX - transform.pan.x;
46
- *
47
- * <svg {...bind()} style={{ touchAction: 'none' }}>
48
- * ...
49
- * </svg>
50
- * ```
51
- *
52
- * @example HTML usage (SlotSystem, etc.)
53
- * ```tsx
54
- * const { transform, bind, style } = usePanZoom({
55
- * enabled: enablePanZoom,
56
- * mode: 'css',
57
- * });
58
- *
59
- * <div {...bind()} style={{ ...style, touchAction: 'none' }}>
60
- * ...
61
- * </div>
62
- * ```
63
- */
64
- interface PanZoomTransform {
65
- /** Current zoom level (1 = 100%) */
66
- zoom: number;
67
- /** Current pan offset */
68
- pan: {
69
- x: number;
70
- y: number;
71
- };
72
- }
73
- interface UsePanZoomOptions {
74
- /** Whether pan/zoom is enabled */
75
- enabled?: boolean;
76
- /** Initial zoom level */
77
- initialZoom?: number;
78
- /** Minimum zoom level */
79
- minZoom?: number;
80
- /** Maximum zoom level */
81
- maxZoom?: number;
82
- /** Initial pan offset */
83
- initialPan?: {
84
- x: number;
85
- y: number;
86
- };
87
- /** Transform mode: 'viewbox' for SVG, 'css' for HTML elements */
88
- mode?: "viewbox" | "css";
89
- /** Zoom sensitivity for wheel events (default: 0.002) */
90
- wheelSensitivity?: number;
91
- /** Called when transform changes */
92
- onTransformChange?: (transform: PanZoomTransform) => void;
93
- }
94
- /** Type for gesture bind function that returns props to spread on element
95
- * Note: We omit ref from the return type to avoid conflicts with explicit refs on elements.
96
- * The gesture library handles its own internal ref binding.
97
- */
98
- type GestureBindFunction = () => Omit<React.HTMLAttributes<Element>, "ref">;
99
- interface UsePanZoomReturn {
100
- /** Current transform state */
101
- transform: PanZoomTransform;
102
- /** Gesture handlers to spread on the target element - always returns spreadable props */
103
- bind: GestureBindFunction;
104
- /** Reset transform to initial values */
105
- resetTransform: () => void;
106
- /** Set zoom programmatically */
107
- setZoom: (zoom: number) => void;
108
- /** Set pan programmatically */
109
- setPan: (pan: {
110
- x: number;
111
- y: number;
112
- }) => void;
113
- /** CSS transform style (for mode: 'css') */
114
- style: React.CSSProperties;
115
- /** Whether currently dragging/panning */
116
- isDragging: boolean;
117
- /** Whether currently pinching */
118
- isPinching: boolean;
119
- }
120
- /**
121
- * Helper to calculate SVG viewBox with pan/zoom applied
122
- */
123
- declare function calculateViewBox(bounds: {
124
- minX: number;
125
- minY: number;
126
- width: number;
127
- height: number;
128
- }, transform: PanZoomTransform): string;
129
-
130
- interface GenericBoardSpaceLike<SpaceIdValue extends string = string, Fields = Record<string, unknown>> {
131
- id: SpaceIdValue;
132
- name?: string | null;
133
- typeId?: string | null;
134
- fields: Fields;
135
- }
136
- interface GenericBoardRelationLike<SpaceIdValue extends string = string> {
137
- fromSpaceId: SpaceIdValue;
138
- toSpaceId: SpaceIdValue;
139
- directed: boolean;
140
- }
141
- interface GenericBoardLike<BoardIdValue extends string = string, SpaceIdValue extends string = string, SpaceFields = Record<string, unknown>> {
142
- id: BoardIdValue;
143
- spaces: Readonly<Record<SpaceIdValue, GenericBoardSpaceLike<SpaceIdValue, SpaceFields>>>;
144
- relations?: ReadonlyArray<GenericBoardRelationLike<SpaceIdValue>>;
145
- }
146
- interface TrackBoardPieceLike<PieceIdValue extends string = string, SpaceIdValue extends string = string, OwnerIdValue extends string = string, Fields = unknown> {
147
- id: PieceIdValue;
148
- spaceId: SpaceIdValue;
149
- owner: OwnerIdValue;
150
- typeId?: string | null;
151
- fields?: Fields;
152
- }
153
- type BoardSpaceOf<TBoard extends GenericBoardLike> = TBoard["spaces"][keyof TBoard["spaces"]];
154
- type SpaceIdOf<TBoard extends GenericBoardLike> = BoardSpaceOf<TBoard> extends {
155
- id: infer Id extends string;
156
- } ? Id : never;
157
- type SpaceFieldsOf<TBoard extends GenericBoardLike> = BoardSpaceOf<TBoard> extends {
158
- fields: infer Fields;
159
- } ? Fields : never;
160
- type PieceIdOf<TPiece extends TrackBoardPieceLike> = TPiece extends {
161
- id: infer Id extends string;
162
- } ? Id : never;
163
- type PieceOwnerOf<TPiece extends TrackBoardPieceLike> = TPiece extends {
164
- owner: infer Owner extends string;
165
- } ? Owner : never;
166
- type PieceFieldsOf<TPiece extends TrackBoardPieceLike> = TPiece extends {
167
- fields?: infer Fields;
168
- } ? Fields : never;
169
- type TrackLayout = {
170
- type: "linear";
171
- axis?: "x" | "y";
172
- spacing?: number;
173
- origin?: {
174
- x: number;
175
- y: number;
176
- };
177
- } | {
178
- type: "circular";
179
- center: {
180
- x: number;
181
- y: number;
182
- };
183
- radius: number;
184
- startAngleDeg?: number;
185
- clockwise?: boolean;
186
- };
187
- type PositionOptions<TBoard extends GenericBoardLike> = {
188
- getPosition: (space: BoardSpaceOf<TBoard>, index: number, spaces: ReadonlyArray<BoardSpaceOf<TBoard>>) => {
189
- x: number;
190
- y: number;
191
- };
192
- layout?: never;
193
- } | {
194
- getPosition?: never;
195
- layout: TrackLayout;
196
- };
197
- type ToTrackBoardDataOptions<TBoard extends GenericBoardLike, TPiece extends TrackBoardPieceLike<string, SpaceIdOf<TBoard>, string, unknown>> = PositionOptions<TBoard> & {
198
- pieces?: readonly TPiece[];
199
- getNextSpaces?: (space: BoardSpaceOf<TBoard>, board: TBoard) => ReadonlyArray<SpaceIdOf<TBoard>> | undefined;
200
- getJumpTo?: (space: BoardSpaceOf<TBoard>, board: TBoard) => SpaceIdOf<TBoard> | undefined;
201
- };
202
- declare function toTrackBoardData<TBoard extends GenericBoardLike, TPiece extends TrackBoardPieceLike<string, SpaceIdOf<TBoard>, string, unknown>>(board: TBoard, options: ToTrackBoardDataOptions<TBoard, TPiece>): {
203
- spaces: Array<TrackSpace<SpaceIdOf<TBoard>, SpaceFieldsOf<TBoard>>>;
204
- pieces: Array<TrackPiece<PieceIdOf<TPiece>, SpaceIdOf<TBoard>, PieceOwnerOf<TPiece>, PieceFieldsOf<TPiece>>>;
205
- };
206
-
207
- /**
208
- * Hook to detect if the user is on a mobile/small screen device
209
- * @param breakpoint - The width threshold in pixels (default: 768)
210
- * @returns boolean indicating if the screen is mobile-sized
211
- */
212
- declare function useIsMobile(breakpoint?: number): boolean;
213
-
214
- /**
215
- * `tabletop` — the default Dreamboard theme.
216
- *
217
- * Visual identity: warm paper backgrounds, deep ink-blue brand,
218
- * confident type, rounded but disciplined corners. Designed to feel
219
- * like a polished hobby-game client (Splendor digital, modern Catan
220
- * apps) without leaning into a specific game's IP.
221
- *
222
- * Picked deliberately for the default: a board game UI sitting on
223
- * cool grey or pure white reads as "spreadsheet"; warm parchment
224
- * cues "play" without sliding into kitsch.
225
- */
226
- declare const tabletopTheme: Theme;
227
-
228
- /**
229
- * `arcade` — high-contrast neon theme for fast/competitive games.
230
- *
231
- * Visual identity: deep slate background, electric cyan/magenta
232
- * intents, square-ish corners, sharp drop shadows. Designed to evoke
233
- * action games and to keep critical CTAs popping at a glance.
234
- */
235
- declare const arcadeTheme: Theme;
236
-
237
- /**
238
- * `studio` — clean monochrome theme for prototypes and design reviews.
239
- *
240
- * Visual identity: pure white surfaces, near-black text, single brand
241
- * accent, generous whitespace. Designed for screenshot-friendly demos
242
- * and games where the board art does the storytelling.
243
- */
244
- declare const studioTheme: Theme;
245
-
246
- /**
247
- * Walk the theme tree and produce a flat `{ "--db-...": value }` map.
248
- * Arrays are walked positionally with a 1-based index (so
249
- * `theme.player[0]` → `--db-player-1-...`).
250
- */
251
- declare function themeToCssVars(theme: Theme): CSSProperties;
252
- /**
253
- * Build a `var(--db-...)` reference for a token path.
254
- *
255
- * @example
256
- * ```ts
257
- * cssVar("semantic", "intent", "primary", "solid")
258
- * // => "var(--db-semantic-intent-primary-solid)"
259
- * cssVar("player", 1, "solid")
260
- * // => "var(--db-player-1-solid)"
261
- * ```
262
- */
263
- declare function cssVar(...path: Array<string | number>): string;
264
- /**
265
- * Convenience for declaring a `var(--db-...)` with an inline fallback.
266
- *
267
- * @example
268
- * ```ts
269
- * cssVarOr("transparent", "semantic", "border", "default")
270
- * // => "var(--db-semantic-border-default, transparent)"
271
- * ```
272
- */
273
- declare function cssVarOr(fallback: string, ...path: Array<string | number>): string;
274
-
275
- /**
276
- * Board theming helpers.
277
- *
278
- * The SDK's board renderers (`<HexGrid>`, `<SquareGrid>`,
279
- * `<NetworkGraph>`, `<ZoneMap>`, `<TrackBoard>`, `<SlotSystem>`) need a
280
- * tiny but consistent set of visual tokens — frame border, frame fill,
281
- * eligible-target hint, and active hover ring — so authors don't have
282
- * to re-pick colours per board. {@link useBoardTheme} exposes those
283
- * tokens, derived from the active {@link Theme}.
284
- */
285
-
286
- /**
287
- * Resolved board tokens consumed by board renderers and per-tile
288
- * default renderers. All values are CSS-ready strings.
289
- */
290
- interface BoardTheme {
291
- /** Border drawn around the board's outer frame. */
292
- readonly frameBorder: string;
293
- /** Background painted under the tile renderer (visible at tile gaps). */
294
- readonly frameBackground: string;
295
- /** Hover-state ring drawn over an interactive target. */
296
- readonly hoverRing: string;
297
- /** Idle hint colour for an eligible-but-unhovered target. */
298
- readonly eligibleHint: string;
299
- /** Border drawn on inactive tiles (matches semantic.border.default). */
300
- readonly tileBorder: string;
301
- /** Subtle dotted border for non-interactive scaffolding (e.g. ports). */
302
- readonly tileBorderSubtle: string;
303
- /** Foreground used for board labels (numbers, port ratios). */
304
- readonly tileText: string;
305
- /** Recommended ring stroke width in px for hover/eligible markers. */
306
- readonly ringWidth: number;
307
- }
308
- /**
309
- * Derive a {@link BoardTheme} from the active theme. Memoised on the
310
- * theme reference so consumers can pass it straight to a board's
311
- * `defaultTileProps` / `defaultEdgeProps` slots.
312
- */
313
- declare function useBoardTheme(): BoardTheme;
314
- /** Standalone derivation for renderers that already hold a {@link Theme}. */
315
- declare function deriveBoardTheme(theme: Theme): BoardTheme;
316
-
317
- export { type BoardTheme, type PanZoomTransform, Theme, TrackPiece, TrackSpace, type UsePanZoomOptions, type UsePanZoomReturn, arcadeTheme, calculateViewBox, cssVar, cssVarOr, deriveBoardTheme, studioTheme, tabletopTheme, themeToCssVars, toTrackBoardData, useBoardTheme, useIsMobile };
package/dist/ui.js DELETED
@@ -1,277 +0,0 @@
1
- import {
2
- deriveBoardTheme,
3
- hexColor,
4
- isHexColor,
5
- parseHexColor,
6
- toTrackBoardData,
7
- useBoardTheme
8
- } from "./chunk-3SKDNDPG.js";
9
- import {
10
- ActionButton,
11
- ActionGroup,
12
- ActionHelp,
13
- ActionPanel,
14
- CardDragSurface,
15
- CardDropTargetView,
16
- CardFace,
17
- ChromeSuppressionProvider,
18
- CostDisplay,
19
- DefaultChessPiece,
20
- DefaultEmptySlot,
21
- DefaultGridCell,
22
- DefaultGridPiece,
23
- DefaultHexEdge,
24
- DefaultHexTile,
25
- DefaultHexVertex,
26
- DefaultNetworkEdge,
27
- DefaultNetworkNode,
28
- DefaultNetworkPiece,
29
- DefaultSlotItem,
30
- DefaultSlotOccupant,
31
- DefaultTrackConnection,
32
- DefaultTrackJump,
33
- DefaultTrackPiece,
34
- DefaultTrackSpace,
35
- DefaultZone,
36
- DefaultZonePiece,
37
- DefaultZonePieces,
38
- Dialog,
39
- DialogClose,
40
- DialogContent,
41
- DialogDescription,
42
- DialogFooter,
43
- DialogHeader,
44
- DialogOverlay,
45
- DialogPortal,
46
- DialogTitle,
47
- DialogTrigger,
48
- DiceRoller,
49
- Drawer,
50
- DrawerClose,
51
- DrawerContent,
52
- DrawerDescription,
53
- DrawerFooter,
54
- DrawerHeader,
55
- DrawerOverlay,
56
- DrawerPortal,
57
- DrawerTitle,
58
- DrawerTrigger,
59
- ErrorBoundary,
60
- GameSkeleton,
61
- GuidancePanel,
62
- Hand,
63
- HandDock,
64
- HandView,
65
- HexGrid,
66
- Input,
67
- Label,
68
- MobileHandTrayProvider,
69
- MoreActions,
70
- NetworkGraph,
71
- OutcomeDialog,
72
- Panel,
73
- PanelActions,
74
- PanelBody,
75
- PanelDescription,
76
- PanelHeader,
77
- PanelRoot,
78
- PanelTitle,
79
- PhaseIndicator,
80
- PlayArea,
81
- PrimaryActionButton,
82
- PrimaryButton,
83
- ResourceCounter,
84
- ResourceCounterCount,
85
- ResourceCounterIcon,
86
- ResourceCounterItem,
87
- ResourceCounterLabel,
88
- ResourceCounterRoot,
89
- Select,
90
- SelectContent,
91
- SelectItem,
92
- SelectTrigger,
93
- SetupChecklist,
94
- SlotSystem,
95
- SquareGrid,
96
- StagingZone,
97
- StandingsTable,
98
- ThemeProvider,
99
- ThemedButton,
100
- Toast,
101
- ToastActions,
102
- ToastProvider,
103
- TrackBoard,
104
- ZoneMap,
105
- arcadeTheme,
106
- buttonStyle,
107
- calculateViewBox,
108
- chipStyle,
109
- createHexBoardView,
110
- createResourceCounter,
111
- cssVar,
112
- cssVarOr,
113
- dropTargetVisualStateDataAttributes,
114
- getThemePreset,
115
- hexUtils,
116
- intentForVariant,
117
- mergeTheme,
118
- motionDuration,
119
- normalizeHexBoardInput,
120
- normalizeSquareBoardInput,
121
- playerColor,
122
- resolveTheme,
123
- studioTheme,
124
- surfaceStyle,
125
- tabletopTheme,
126
- themeToCssVars,
127
- toAlgebraic,
128
- toNumeric,
129
- useCardDragSurface,
130
- useChromeSuppression,
131
- useIsMobile,
132
- useOverlayInsets,
133
- useRegisterBottomOverlayInset,
134
- useRegisterMobileHand,
135
- useTheme,
136
- useThemeCssVars,
137
- visualStateDataAttributes
138
- } from "./chunk-32PFKDV7.js";
139
- import "./chunk-VDXOF4FW.js";
140
- import "./chunk-PZ5AY32C.js";
141
- export {
142
- ActionButton,
143
- ActionGroup,
144
- ActionHelp,
145
- ActionPanel,
146
- CardDragSurface,
147
- CardDropTargetView,
148
- CardFace,
149
- ChromeSuppressionProvider,
150
- CostDisplay,
151
- DefaultChessPiece,
152
- DefaultEmptySlot,
153
- DefaultGridCell,
154
- DefaultGridPiece,
155
- DefaultHexEdge,
156
- DefaultHexTile,
157
- DefaultHexVertex,
158
- DefaultNetworkEdge,
159
- DefaultNetworkNode,
160
- DefaultNetworkPiece,
161
- DefaultSlotItem,
162
- DefaultSlotOccupant,
163
- DefaultTrackConnection,
164
- DefaultTrackJump,
165
- DefaultTrackPiece,
166
- DefaultTrackSpace,
167
- DefaultZone,
168
- DefaultZonePiece,
169
- DefaultZonePieces,
170
- Dialog,
171
- DialogClose,
172
- DialogContent,
173
- DialogDescription,
174
- DialogFooter,
175
- DialogHeader,
176
- DialogOverlay,
177
- DialogPortal,
178
- DialogTitle,
179
- DialogTrigger,
180
- DiceRoller,
181
- Drawer,
182
- DrawerClose,
183
- DrawerContent,
184
- DrawerDescription,
185
- DrawerFooter,
186
- DrawerHeader,
187
- DrawerOverlay,
188
- DrawerPortal,
189
- DrawerTitle,
190
- DrawerTrigger,
191
- ErrorBoundary,
192
- GameSkeleton,
193
- GuidancePanel,
194
- Hand,
195
- HandDock,
196
- HandView,
197
- HexGrid,
198
- Input,
199
- Label,
200
- MobileHandTrayProvider,
201
- MoreActions,
202
- NetworkGraph,
203
- OutcomeDialog,
204
- Panel,
205
- PanelActions,
206
- PanelBody,
207
- PanelDescription,
208
- PanelHeader,
209
- PanelRoot,
210
- PanelTitle,
211
- PhaseIndicator,
212
- PlayArea,
213
- PrimaryActionButton,
214
- PrimaryButton,
215
- ResourceCounter,
216
- ResourceCounterCount,
217
- ResourceCounterIcon,
218
- ResourceCounterItem,
219
- ResourceCounterLabel,
220
- ResourceCounterRoot,
221
- Select,
222
- SelectContent,
223
- SelectItem,
224
- SelectTrigger,
225
- SetupChecklist,
226
- SlotSystem,
227
- SquareGrid,
228
- StagingZone,
229
- StandingsTable,
230
- ThemeProvider,
231
- ThemedButton,
232
- Toast,
233
- ToastActions,
234
- ToastProvider,
235
- TrackBoard,
236
- ZoneMap,
237
- arcadeTheme,
238
- buttonStyle,
239
- calculateViewBox,
240
- chipStyle,
241
- createHexBoardView,
242
- createResourceCounter,
243
- cssVar,
244
- cssVarOr,
245
- deriveBoardTheme,
246
- dropTargetVisualStateDataAttributes,
247
- getThemePreset,
248
- hexColor,
249
- hexUtils,
250
- intentForVariant,
251
- isHexColor,
252
- mergeTheme,
253
- motionDuration,
254
- normalizeHexBoardInput,
255
- normalizeSquareBoardInput,
256
- parseHexColor,
257
- playerColor,
258
- resolveTheme,
259
- studioTheme,
260
- surfaceStyle,
261
- tabletopTheme,
262
- themeToCssVars,
263
- toAlgebraic,
264
- toNumeric,
265
- toTrackBoardData,
266
- useBoardTheme,
267
- useCardDragSurface,
268
- useChromeSuppression,
269
- useIsMobile,
270
- useOverlayInsets,
271
- useRegisterBottomOverlayInset,
272
- useRegisterMobileHand,
273
- useTheme,
274
- useThemeCssVars,
275
- visualStateDataAttributes
276
- };
277
- //# sourceMappingURL=ui.js.map
package/dist/ui.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}