@dreamboard-games/sdk 0.4.0-alpha.0 → 0.4.0-alpha.2
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.
- package/README.md +8 -1
- package/REFERENCE.md +1849 -379
- package/dist/{ResourceCounter-BTXklCEZ.d.ts → ResourceCounter-BuiNstXs.d.ts} +5 -1
- package/dist/{ThemeProvider-DvMl17Ny.d.ts → ThemeProvider-B1sIoBlX.d.ts} +1 -1
- package/dist/attributes-DbvyMbXw.d.ts +68 -0
- package/dist/authoring/index.d.ts +66 -0
- package/dist/authoring/index.js +560 -0
- package/dist/authoring/index.js.map +1 -0
- package/dist/browser-interaction.d.ts +246 -44
- package/dist/browser-interaction.js +14 -1
- package/dist/{chunk-Q5O7GPVY.js → chunk-45FI6XII.js} +630 -375
- package/dist/chunk-45FI6XII.js.map +1 -0
- package/dist/{chunk-4G7552LO.js → chunk-6JQFGSLD.js} +216 -47
- package/dist/chunk-6JQFGSLD.js.map +1 -0
- package/dist/{chunk-NBAEEHAU.js → chunk-CP35NPPY.js} +5926 -5266
- package/dist/chunk-CP35NPPY.js.map +1 -0
- package/dist/{chunk-2LDZ5C3T.js → chunk-FWVV2X74.js} +2 -2
- package/dist/{chunk-MNKDSGIA.js → chunk-HWJS3VOJ.js} +6 -2
- package/dist/chunk-HWJS3VOJ.js.map +1 -0
- package/dist/chunk-K5ZRJTZZ.js +328 -0
- package/dist/chunk-K5ZRJTZZ.js.map +1 -0
- package/dist/{chunk-U5KBV2BA.js → chunk-N6ZDIMRB.js} +444 -223
- package/dist/chunk-N6ZDIMRB.js.map +1 -0
- package/dist/chunk-O6M6PN4E.js +1225 -0
- package/dist/chunk-O6M6PN4E.js.map +1 -0
- package/dist/chunk-PF7L4BMG.js +117 -0
- package/dist/chunk-PF7L4BMG.js.map +1 -0
- package/dist/{chunk-P7F4L2FF.js → chunk-WOWFONLZ.js} +609 -1287
- package/dist/chunk-WOWFONLZ.js.map +1 -0
- package/dist/{chunk-QLG6VEMW.js → chunk-WUIVY2KE.js} +318 -21
- package/dist/chunk-WUIVY2KE.js.map +1 -0
- package/dist/chunk-ZAS2SENW.js +12 -0
- package/dist/chunk-ZAS2SENW.js.map +1 -0
- package/dist/codegen.d.ts +11 -1
- package/dist/codegen.js +1 -1
- package/dist/{components-DaIqi9QM.d.ts → components-BbWPnZCF.d.ts} +37 -70
- package/dist/{hex-board-view-UCUjMALd.d.ts → hex-board-view-Kz9Q_zsv.d.ts} +1 -1
- package/dist/index.js +2 -1
- package/dist/package-set.d.ts +2 -2
- package/dist/package-set.js +2 -1
- package/dist/player-state-Cqpyeql0.d.ts +371 -0
- package/dist/protocol-BP193lva.d.ts +267 -0
- package/dist/reducer/advanced.d.ts +2 -2
- package/dist/reducer/advanced.js +1 -1
- package/dist/reducer-contract.js +1 -1
- package/dist/reducer.d.ts +7 -7
- package/dist/reducer.js +190 -183
- package/dist/reducer.js.map +1 -1
- package/dist/runtime/primitives.d.ts +10 -9
- package/dist/runtime/primitives.js +9 -6
- package/dist/runtime/runtime-api.d.ts +2 -2
- package/dist/runtime/workspace-contract.d.ts +28 -76
- package/dist/runtime/workspace-contract.js +7 -5
- package/dist/runtime-api-BJharVaj.d.ts +198 -0
- package/dist/runtime-api-C6aWo9c0.d.ts +95 -0
- package/dist/runtime-json-CQ9QbLZ5.d.ts +5 -0
- package/dist/runtime.d.ts +80 -11
- package/dist/runtime.js +89 -445
- package/dist/runtime.js.map +1 -1
- package/dist/testing.d.ts +643 -22
- package/dist/testing.js +1371 -76
- package/dist/testing.js.map +1 -1
- package/dist/types-CYeN0wLK.d.ts +29 -0
- package/dist/{attributes-BeRyboMS.d.ts → types-DJj5MJkl.d.ts} +32 -55
- package/dist/types.d.ts +14 -7
- package/dist/ui/components.d.ts +4 -5
- package/dist/ui/components.js +19 -1
- package/dist/ui/player-state.d.ts +2 -365
- package/dist/ui/plugin-styles.css +1 -1
- package/dist/{ui-contract-BUC6iS3s.d.ts → ui-contract-CY7cxsCC.d.ts} +17 -26
- package/dist/ui.d.ts +8 -13
- package/dist/ui.js +20 -2
- package/dist/{views-B0hlW6IT.d.ts → views-fn2RuXOx.d.ts} +59 -44
- package/package.json +28 -4
- package/dist/chunk-4G7552LO.js.map +0 -1
- package/dist/chunk-MNKDSGIA.js.map +0 -1
- package/dist/chunk-NBAEEHAU.js.map +0 -1
- package/dist/chunk-P7F4L2FF.js.map +0 -1
- package/dist/chunk-Q5O7GPVY.js.map +0 -1
- package/dist/chunk-QLG6VEMW.js.map +0 -1
- package/dist/chunk-U5KBV2BA.js.map +0 -1
- package/dist/hex-color-MhOyuY-o.d.ts +0 -8
- package/dist/runtime-api-BXd70c2e.d.ts +0 -490
- /package/dist/{chunk-2LDZ5C3T.js.map → chunk-FWVV2X74.js.map} +0 -0
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { CSSProperties, ReactNode, HTMLAttributes, ButtonHTMLAttributes, InputHTMLAttributes, ReactElement } from 'react';
|
|
3
3
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
|
-
import { $ as Theme, a1 as ThemeOverride, L as InteractiveTargetState$1, A as AnyHexBoardInput, d as BoardSpaceIdOf, u as HexGridBoardProps, r as HexBoardView } from './hex-board-view-
|
|
5
|
-
import { a as ThemePresetId } from './ThemeProvider-
|
|
6
|
-
import { a as InteractionDescriptor, Z as ZoneHandlesSnapshot,
|
|
4
|
+
import { $ as Theme, a1 as ThemeOverride, L as InteractiveTargetState$1, A as AnyHexBoardInput, d as BoardSpaceIdOf, u as HexGridBoardProps, r as HexBoardView } from './hex-board-view-Kz9Q_zsv.js';
|
|
5
|
+
import { a as ThemePresetId } from './ThemeProvider-B1sIoBlX.js';
|
|
6
|
+
import { a as InteractionDescriptor, Z as ZoneHandlesSnapshot, I as InputDomain, b as InteractionInputDescriptor } from './runtime-api-BJharVaj.js';
|
|
7
7
|
import { ViewCard } from './types.js';
|
|
8
8
|
import { P as PrimitiveCommonProps } from './primitive-props-BNHDkgd7.js';
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
9
|
+
import { a as BrowserInteractionAttributeMap } from './attributes-DbvyMbXw.js';
|
|
10
|
+
import { a as PluginSessionState, P as PlayerId } from './runtime-api-C6aWo9c0.js';
|
|
11
|
+
import { t as Player, j as HexColor } from './player-state-Cqpyeql0.js';
|
|
12
12
|
|
|
13
13
|
interface UIRootProps {
|
|
14
14
|
/**
|
|
@@ -361,12 +361,12 @@ declare const Board: {
|
|
|
361
361
|
* Hook to access plugin session metadata.
|
|
362
362
|
* Returns session initialization status and IDs.
|
|
363
363
|
*
|
|
364
|
-
* @returns Plugin session state with status, sessionId,
|
|
364
|
+
* @returns Plugin session state with status, sessionId, and controllingPlayerId
|
|
365
365
|
*
|
|
366
366
|
* @example
|
|
367
367
|
* ```tsx
|
|
368
368
|
* function MyPluginComponent() {
|
|
369
|
-
* const { status, sessionId,
|
|
369
|
+
* const { status, sessionId, controllingPlayerId } = usePluginSession();
|
|
370
370
|
*
|
|
371
371
|
* if (status === "loading") {
|
|
372
372
|
* return <div>Initializing...</div>;
|
|
@@ -375,8 +375,7 @@ declare const Board: {
|
|
|
375
375
|
* return (
|
|
376
376
|
* <div>
|
|
377
377
|
* <p>Session: {sessionId}</p>
|
|
378
|
-
* <p>
|
|
379
|
-
* <p>Currently controlling: {controllingPlayerId}</p>
|
|
378
|
+
* <p>Current perspective: {controllingPlayerId}</p>
|
|
380
379
|
* </div>
|
|
381
380
|
* );
|
|
382
381
|
* }
|
|
@@ -391,7 +390,6 @@ type GamePlayerEntry<PlayerIdValue extends string = PlayerId> = GamePlayer<Playe
|
|
|
391
390
|
index: number;
|
|
392
391
|
isActive: boolean;
|
|
393
392
|
isCurrentPlayer: boolean;
|
|
394
|
-
isControllable: boolean;
|
|
395
393
|
};
|
|
396
394
|
interface GamePlayersState<PlayerIdValue extends string = PlayerId> {
|
|
397
395
|
byId: ReadonlyMap<PlayerIdValue, GamePlayer<PlayerIdValue>>;
|
|
@@ -403,7 +401,6 @@ interface GamePlayersState<PlayerIdValue extends string = PlayerId> {
|
|
|
403
401
|
interface GameMeState<PlayerIdValue extends string = PlayerId> {
|
|
404
402
|
playerId: PlayerIdValue | null;
|
|
405
403
|
player: GamePlayer<PlayerIdValue> | null;
|
|
406
|
-
controllablePlayerIds: readonly PlayerIdValue[];
|
|
407
404
|
canAct: boolean;
|
|
408
405
|
}
|
|
409
406
|
interface GameTurnState<PlayerIdValue extends string = PlayerId, PhaseValue extends string = string> {
|
|
@@ -452,13 +449,18 @@ interface GameRootProps<ViewValue = unknown, PlayerIdValue extends string = Play
|
|
|
452
449
|
interface GameChromeProps<ViewValue = unknown, PlayerIdValue extends string = PlayerId, PhaseValue extends string = string, Interaction extends string = string> {
|
|
453
450
|
children: (state: GameChromeState<ViewValue, PlayerIdValue, PhaseValue, Interaction>) => ReactNode;
|
|
454
451
|
}
|
|
452
|
+
interface GameViewportProps extends HTMLAttributes<HTMLDivElement> {
|
|
453
|
+
children?: ReactNode;
|
|
454
|
+
}
|
|
455
455
|
type GameActionErrorHandler = (error: unknown) => void;
|
|
456
456
|
declare function useGameActionError(): GameActionErrorHandler | null;
|
|
457
457
|
declare function GameRoot<ViewValue = unknown, PlayerIdValue extends string = PlayerId, PhaseValue extends string = string>({ children, onActionError, }: GameRootProps<ViewValue, PlayerIdValue, PhaseValue>): react_jsx_runtime.JSX.Element;
|
|
458
458
|
declare function GameChrome<ViewValue = unknown, PlayerIdValue extends string = PlayerId, PhaseValue extends string = string, Interaction extends string = string>({ children, }: GameChromeProps<ViewValue, PlayerIdValue, PhaseValue, Interaction>): react_jsx_runtime.JSX.Element;
|
|
459
|
+
declare function GameViewport({ children, style, ...props }: GameViewportProps): react_jsx_runtime.JSX.Element;
|
|
459
460
|
declare const Game: {
|
|
460
461
|
Root: typeof GameRoot;
|
|
461
462
|
Chrome: typeof GameChrome;
|
|
463
|
+
Viewport: typeof GameViewport;
|
|
462
464
|
};
|
|
463
465
|
|
|
464
466
|
/**
|
|
@@ -844,8 +846,6 @@ interface PlayerRosterEntry {
|
|
|
844
846
|
index: number;
|
|
845
847
|
isActive: boolean;
|
|
846
848
|
isCurrentPlayer: boolean;
|
|
847
|
-
isControllable: boolean;
|
|
848
|
-
canSwitchToPlayer: boolean;
|
|
849
849
|
score?: number;
|
|
850
850
|
scoreLabel?: string;
|
|
851
851
|
badges: readonly PlayerRosterBadge[];
|
|
@@ -868,11 +868,6 @@ declare function PlayerRosterList({ children, ...props }: PlayerRosterListProps)
|
|
|
868
868
|
declare function PlayerRosterEmpty({ children }: {
|
|
869
869
|
children?: ReactNode;
|
|
870
870
|
}): react_jsx_runtime.JSX.Element | null;
|
|
871
|
-
type PlayerRosterSwitchButtonProps = Omit<PrimitiveCommonProps, "children"> & ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
872
|
-
player: PlayerRosterEntry;
|
|
873
|
-
children?: ReactNode;
|
|
874
|
-
};
|
|
875
|
-
declare function PlayerRosterSwitchButton({ player, disabled, onClick, ...props }: PlayerRosterSwitchButtonProps): ReactElement<unknown, string | react.JSXElementConstructor<any>>;
|
|
876
871
|
type PlayerRosterPartProps = PrimitiveCommonProps & HTMLAttributes<HTMLElement> & {
|
|
877
872
|
player: PlayerRosterEntry;
|
|
878
873
|
};
|
|
@@ -882,7 +877,6 @@ interface PlayerRosterComponents {
|
|
|
882
877
|
Empty(props: {
|
|
883
878
|
children?: ReactNode;
|
|
884
879
|
}): ReactElement | null;
|
|
885
|
-
SwitchButton(props: PlayerRosterSwitchButtonProps): ReactElement;
|
|
886
880
|
Name(props: PlayerRosterPartProps): ReactElement;
|
|
887
881
|
Score(props: PlayerRosterPartProps): ReactElement | null;
|
|
888
882
|
Badges(props: PlayerRosterPartProps): ReactElement | null;
|
|
@@ -992,6 +986,7 @@ declare const Dice: DiceComponents;
|
|
|
992
986
|
* package-local tests and generic consumers can still import ui-sdk directly.
|
|
993
987
|
*/
|
|
994
988
|
interface DreamboardUIRegister {
|
|
989
|
+
readonly __dreamboardUIRegister?: never;
|
|
995
990
|
}
|
|
996
991
|
type UIContractBucket = Record<string, unknown>;
|
|
997
992
|
interface UIContract {
|
|
@@ -1082,13 +1077,9 @@ type TypedPlayerRosterListProps<Player extends string> = Omit<PlayerRosterListPr
|
|
|
1082
1077
|
type TypedPlayerRosterPartProps<Player extends string> = Omit<PlayerRosterPartProps, "player"> & {
|
|
1083
1078
|
player: TypedPlayerRosterEntry<Player>;
|
|
1084
1079
|
};
|
|
1085
|
-
type
|
|
1086
|
-
player: TypedPlayerRosterEntry<Player>;
|
|
1087
|
-
};
|
|
1088
|
-
type TypedPlayerRoster<Contract extends UIContract> = Omit<PlayerRosterComponents, "Root" | "List" | "SwitchButton" | "Name" | "Score" | "Badges"> & {
|
|
1080
|
+
type TypedPlayerRoster<Contract extends UIContract> = Omit<PlayerRosterComponents, "Root" | "List" | "Name" | "Score" | "Badges"> & {
|
|
1089
1081
|
Root(props: TypedPlayerRosterRootProps<PlayerKey<Contract>>): ReactElement | null;
|
|
1090
1082
|
List(props: TypedPlayerRosterListProps<PlayerKey<Contract>>): ReactElement;
|
|
1091
|
-
SwitchButton(props: TypedPlayerRosterSwitchButtonProps<PlayerKey<Contract>>): ReactElement;
|
|
1092
1083
|
Name(props: TypedPlayerRosterPartProps<PlayerKey<Contract>>): ReactElement;
|
|
1093
1084
|
Score(props: TypedPlayerRosterPartProps<PlayerKey<Contract>>): ReactElement | null;
|
|
1094
1085
|
Badges(props: TypedPlayerRosterPartProps<PlayerKey<Contract>>): ReactElement | null;
|
|
@@ -1165,4 +1156,4 @@ interface DreamboardUI<Contract extends UIContract = RegisteredUI> {
|
|
|
1165
1156
|
readonly Board: TypedBoard<Contract>;
|
|
1166
1157
|
}
|
|
1167
1158
|
|
|
1168
|
-
export {
|
|
1159
|
+
export { type InteractionDialogState as $, type DreamboardUI as A, Board as B, type GameActiveActionState as C, Dice as D, GameChrome as E, type GameChromeProps as F, Game as G, type GameChromeState as H, type GameMeState as I, type GamePendingInputState as J, type GamePlayer as K, type GamePlayerEntry as L, type GamePlayersState as M, type GameRenderState as N, GameRoot as O, type GameRootProps as P, type GameTurnState as Q, GameViewport as R, type GameViewportProps as S, Interaction as T, InteractionCardInput as U, type InteractionCardInputProps as V, type InteractionCardInputRenderState as W, InteractionDescription as X, InteractionDialog as Y, type InteractionDialogProps as Z, type InteractionDialogRenderState as _, BoardEdgeTarget as a, type TypedGame as a$, type InteractionFieldPrimitiveProps as a0, InteractionFormPrimitive as a1, type InteractionFormPrimitiveProps as a2, InteractionInput as a3, type InteractionInputProps as a4, InteractionLabel as a5, type InteractionPartProps as a6, InteractionRoot as a7, type InteractionRootProps as a8, type InteractionRoute as a9, type PlayerRosterEntry as aA, PlayerRosterList as aB, type PlayerRosterListProps as aC, PlayerRosterName as aD, type PlayerRosterPartProps as aE, PlayerRosterRoot as aF, type PlayerRosterRootProps as aG, PlayerRosterScore as aH, Prompt as aI, PromptDialog as aJ, type PromptDialogProps as aK, type PromptDialogRenderState as aL, type PromptDialogState as aM, PromptInbox as aN, PromptInboxEmpty as aO, PromptInboxItems as aP, type PromptInboxItemsProps as aQ, PromptInboxRoot as aR, PromptMessage as aS, PromptOption as aT, type PromptOptionProps as aU, type PromptOptionRenderItem as aV, PromptOptions as aW, type PromptOptionsProps as aX, PromptRoot as aY, type PromptRootProps as aZ, PromptTitle as a_, InteractionRoutes as aa, type InteractionRoutesMap as ab, type InteractionRoutesProps as ac, InteractionState as ad, type InteractionStateProps as ae, type InteractionStateSnapshot as af, InteractionSubmit as ag, type InteractionSubmitProps as ah, InteractionSwitch as ai, type InteractionSwitchProps as aj, type InteractionSwitchRenderState as ak, type InteractionSwitchRouteMap as al, InteractionTrigger as am, type InteractionTriggerProps as an, InteractionUnavailableMessage as ao, InteractionValidationMessage as ap, Phase as aq, type PhaseFallback as ar, type PhaseRouteMap as as, PhaseSwitch as at, type PhaseSwitchProps as au, PlayerRoster as av, type PlayerRosterBadge as aw, PlayerRosterBadges as ax, type PlayerRosterComponents as ay, PlayerRosterEmpty as az, type BoardEdgeTargetProps as b, UI as b0, type UIContract as b1, UIRoot as b2, type UIRootProps as b3, type UseZoneCardsOptions as b4, type UseZoneCardsResult as b5, Zone as b6, ZoneCardAction as b7, type ZoneCardActionExtraInputs as b8, type ZoneCardActionProps as b9, normalizeDiceState as bA, useBoardPrimitiveContext as bB, useDicePrimitiveContext as bC, useGameActionError as bD, useInteractionPrimitiveContext as bE, useOptionalZonePrimitiveContext as bF, useResolvedCardTargetValue as bG, useZoneCardContext as bH, useZoneCards as bI, useZonePileContext as bJ, useZonePrimitiveContext as bK, type ZoneCardActionResult as ba, ZoneCardAt as bb, type ZoneCardAtProps as bc, type ZoneCardRenderItem as bd, ZoneItem as be, type ZoneItemProps as bf, ZoneList as bg, type ZoneListProps as bh, ZonePileCards as bi, type ZonePileCardsProps as bj, type ZonePileContextValue as bk, ZonePileCount as bl, type ZonePileCountProps as bm, ZonePileDescription as bn, type ZonePileDescriptionProps as bo, ZonePileLabel as bp, type ZonePileLabelProps as bq, ZonePileRoot as br, type ZonePileRootProps as bs, ZonePileTrigger as bt, type ZonePileTriggerProps as bu, ZoneRoot as bv, type ZoneRootProps as bw, ZoneTopCard as bx, type ZoneTopCardProps as by, createZoneCardRenderItem as bz, BoardHexGrid as c, type BoardHexGridInteractionFilter as d, type BoardHexGridInteractions as e, type BoardHexGridProps as f, BoardHexView as g, type BoardHexViewProps as h, BoardRoot as i, type BoardRootProps as j, BoardSpaceTarget as k, type BoardSpaceTargetProps as l, BoardState as m, type BoardStateProps as n, BoardTarget as o, type BoardTargetExtraInputs as p, type BoardTargetProps as q, BoardVertexTarget as r, type BoardVertexTargetProps as s, type DiceComponents as t, DiceRoot as u, type DiceRootProps as v, type DiceState as w, type DiceValue as x, DiceValues as y, type DiceValuesProps as z };
|
package/dist/ui.d.ts
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { A as ActionButton, a as ActionButtonProps, b as ActionGroup, c as ActionGroupProps, d as ActionPanel, e as ActionPanelProps, B as ButtonSize, f as ButtonVariant, C as CardDragSurface, g as CardDragSurfaceContextValue, h as CardDragSurfaceController, i as CardDragSurfaceProps, j as CardDropTargetView, k as CardDropTargetViewProps, l as CardFace, m as CardFaceProps, n as CardPositionProps, o as CardSize, p as ChromeSuppressionProvider, q as CostDisplay, r as CostDisplayProps, D as DefaultChessPiece, s as DefaultChessPieceProps, t as DefaultEmptySlot, u as DefaultEmptySlotProps, v as DefaultGridCell, w as DefaultGridCellProps, x as DefaultGridPiece, y as DefaultGridPieceProps, z as DefaultNetworkEdge, E as DefaultNetworkEdgeProps, F as DefaultNetworkNode, G as DefaultNetworkNodeProps, H as DefaultNetworkPiece, I as DefaultNetworkPieceProps, J as DefaultSlotItem, K as DefaultSlotItemProps, L as DefaultSlotOccupant, M as DefaultSlotOccupantProps, N as DefaultTrackConnection, O as DefaultTrackConnectionProps, P as DefaultTrackJump, Q as DefaultTrackJumpProps, R as DefaultTrackPiece, S as DefaultTrackPieceProps, T as DefaultTrackSpace, U as DefaultTrackSpaceProps, V as DefaultZone, W as DefaultZonePiece, X as DefaultZonePieceProps, Y as DefaultZonePieces, Z as DefaultZonePiecesProps, _ as DefaultZoneProps, $ as Dialog, a0 as DialogClose, a1 as DialogContent, a2 as DialogDescription, a3 as DialogFooter, a4 as DialogHeader, a5 as DialogOverlay, a6 as DialogPortal, a7 as DialogTitle, a8 as DialogTrigger, a9 as DiceRoller, aa as DiceRollerProps, ab as DragPhase, ac as Drawer, ad as DrawerClose, ae as DrawerContent, af as DrawerDescription, ag as DrawerFooter, ah as DrawerHeader, ai as DrawerOverlay, aj as DrawerPortal, ak as DrawerTitle, al as DrawerTrigger, am as ErrorBoundary, an as ErrorBoundaryProps, ao as GameEndDisplay, ap as GameEndDisplayProps, aq as GameSkeleton, ar as GameSkeletonProps, as as Hand, at as HandDock, au as HandDockMode, av as HandDockPlacement, aw as HandDockPresentation, ax as HandDockProps, ay as HandDockToggleContext, az as HandLayout, aA as HandProps, aB as Input, aC as InteractiveSquareEdge, aD as InteractiveSquareVertex, aE as Label, aF as MoreActions, aG as MoreActionsProps, aH as NetworkEdge, aI as NetworkGraph, aJ as NetworkGraphProps, aK as NetworkNode, aL as NetworkPiece, aM as
|
|
3
|
-
import { $ as Theme } from './hex-board-view-
|
|
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 ColorRamp, f as ComponentTokens, D as DefaultHexEdge, g as DefaultHexEdgeProps, h as DefaultHexTile, i as DefaultHexTileProps, j as DefaultHexVertex, k as DefaultHexVertexProps, E as EdgePosition, l as Elevation, F as FoundationColor, G as GeneratedHexBoardInput, m as GeneratedHexSpaceStateLike, n as GeneratedSquareBoardInput, o as GeneratedSquareSpaceStateLike, p as GeneratedTiledEdgeStateLike, q as GeneratedTiledVertexStateLike, H as HexBoardInput, r as HexBoardView, s as HexBoardViewTile, t as HexGrid, u as HexGridBoardProps, v as HexGridProps, w as HexOrientation, x as HexTileGeometry, I as IntentColor, y as InteractiveHexEdge, z as InteractiveHexVertex, J as InteractiveTargetLayer, K as InteractiveTargetRenderState, M as Motion, N as NormalizedHexBoard, O as NormalizedHexEdgeOf, P as NormalizedHexTileOf, Q as NormalizedHexVertexOf, R as NormalizedSquareBoard, S as NormalizedSquareCellOf, T as NormalizedSquareEdgeOf, U as NormalizedSquarePieceOf, V as NormalizedSquareVertexOf, W as PlayerColor, X as Radius, Y as SemanticColor, Z as Space, _ as SquareBoardInput, a0 as ThemeMeta, a1 as ThemeOverride, a2 as Typography, a3 as createHexBoardView, a4 as hexUtils, a5 as mergeTheme, a6 as normalizeHexBoardInput, a7 as normalizeSquareBoardInput } from './hex-board-view-
|
|
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-
|
|
1
|
+
import { by as TrackSpace, bx as TrackPiece } from './components-BbWPnZCF.js';
|
|
2
|
+
export { A as ActionButton, a as ActionButtonProps, b as ActionGroup, c as ActionGroupProps, d as ActionPanel, e as ActionPanelProps, B as ButtonSize, f as ButtonVariant, C as CardDragSurface, g as CardDragSurfaceContextValue, h as CardDragSurfaceController, i as CardDragSurfaceProps, j as CardDropTargetView, k as CardDropTargetViewProps, l as CardFace, m as CardFaceProps, n as CardPositionProps, o as CardSize, p as ChromeSuppressionProvider, q as CostDisplay, r as CostDisplayProps, D as DefaultChessPiece, s as DefaultChessPieceProps, t as DefaultEmptySlot, u as DefaultEmptySlotProps, v as DefaultGridCell, w as DefaultGridCellProps, x as DefaultGridPiece, y as DefaultGridPieceProps, z as DefaultNetworkEdge, E as DefaultNetworkEdgeProps, F as DefaultNetworkNode, G as DefaultNetworkNodeProps, H as DefaultNetworkPiece, I as DefaultNetworkPieceProps, J as DefaultSlotItem, K as DefaultSlotItemProps, L as DefaultSlotOccupant, M as DefaultSlotOccupantProps, N as DefaultTrackConnection, O as DefaultTrackConnectionProps, P as DefaultTrackJump, Q as DefaultTrackJumpProps, R as DefaultTrackPiece, S as DefaultTrackPieceProps, T as DefaultTrackSpace, U as DefaultTrackSpaceProps, V as DefaultZone, W as DefaultZonePiece, X as DefaultZonePieceProps, Y as DefaultZonePieces, Z as DefaultZonePiecesProps, _ as DefaultZoneProps, $ as Dialog, a0 as DialogClose, a1 as DialogContent, a2 as DialogDescription, a3 as DialogFooter, a4 as DialogHeader, a5 as DialogOverlay, a6 as DialogPortal, a7 as DialogTitle, a8 as DialogTrigger, a9 as DiceRoller, aa as DiceRollerProps, ab as DragPhase, ac as Drawer, ad as DrawerClose, ae as DrawerContent, af as DrawerDescription, ag as DrawerFooter, ah as DrawerHeader, ai as DrawerOverlay, aj as DrawerPortal, ak as DrawerTitle, al as DrawerTrigger, am as ErrorBoundary, an as ErrorBoundaryProps, ao as GameEndDisplay, ap as GameEndDisplayProps, aq as GameSkeleton, ar as GameSkeletonProps, as as Hand, at as HandDock, au as HandDockMode, av as HandDockPlacement, aw as HandDockPresentation, ax as HandDockProps, ay as HandDockToggleContext, az as HandLayout, aA as HandProps, aB as Input, aC as InteractiveSquareEdge, aD as InteractiveSquareVertex, aE as Label, aF as MoreActions, aG as MoreActionsProps, aH as NetworkEdge, aI as NetworkGraph, aJ as NetworkGraphProps, aK as NetworkNode, aL as NetworkPiece, aM as Panel, aN as PanelActions, aO as PanelBody, aP as PanelDescription, aQ as PanelDescriptionProps, aR as PanelHeader, aS as PanelPartProps, aT as PanelRoot, aU as PanelRootProps, aV as PanelTitle, aW as PanelTitleProps, aX as PanelTone, aY as PhaseIndicator, aZ as PhaseIndicatorProps, a_ as PlayArea, a$ as PlayAreaProps, b0 as PlayerScore, b1 as PrimaryActionAttention, b2 as PrimaryActionButton, b3 as PrimaryActionButtonProps, b4 as PrimaryButton, b5 as PrimaryButtonProps, b6 as ResourceDefinition, b7 as Select, b8 as SelectContent, b9 as SelectItem, ba as SelectTrigger, bb as SlotDefinition, bc as SlotOccupant, bd as SlotSystem, be as SlotSystemProps, bf as SquareEdgePosition, bg as SquareGrid, bh as SquareGridBoardProps, bi as SquareGridProps, bj as SquareVertexPosition, bk as StagingZone, bl as StagingZoneProps, bm as ThemedButton, bn as ThemedButtonProps, bo as Toast, bp as ToastActions, bq as ToastActionsProps, br as ToastActionsValue, bs as ToastNotification, bt as ToastProvider, bu as ToastType, bv as TrackBoard, bw as TrackBoardProps, bz as UseHandLayoutOptions, bA as UseHandLayoutReturn, bB as ZoneDefinition, bC as ZoneHighlightType, bD as ZoneMap, bE as ZoneMapProps, bF as ZonePiece, bG as ZoneShape, bH as buttonStyle, bI as chipStyle, bJ as intentForVariant, bK as motionDuration, bL as playerColor, bM as surfaceStyle, bN as toAlgebraic, bO as toNumeric, bP as useCardDragSurface, bQ as useChromeSuppression } from './components-BbWPnZCF.js';
|
|
3
|
+
import { $ as Theme } from './hex-board-view-Kz9Q_zsv.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 ColorRamp, f as ComponentTokens, D as DefaultHexEdge, g as DefaultHexEdgeProps, h as DefaultHexTile, i as DefaultHexTileProps, j as DefaultHexVertex, k as DefaultHexVertexProps, E as EdgePosition, l as Elevation, F as FoundationColor, G as GeneratedHexBoardInput, m as GeneratedHexSpaceStateLike, n as GeneratedSquareBoardInput, o as GeneratedSquareSpaceStateLike, p as GeneratedTiledEdgeStateLike, q as GeneratedTiledVertexStateLike, H as HexBoardInput, r as HexBoardView, s as HexBoardViewTile, t as HexGrid, u as HexGridBoardProps, v as HexGridProps, w as HexOrientation, x as HexTileGeometry, I as IntentColor, y as InteractiveHexEdge, z as InteractiveHexVertex, J as InteractiveTargetLayer, K as InteractiveTargetRenderState, M as Motion, N as NormalizedHexBoard, O as NormalizedHexEdgeOf, P as NormalizedHexTileOf, Q as NormalizedHexVertexOf, R as NormalizedSquareBoard, S as NormalizedSquareCellOf, T as NormalizedSquareEdgeOf, U as NormalizedSquarePieceOf, V as NormalizedSquareVertexOf, W as PlayerColor, X as Radius, Y as SemanticColor, Z as Space, _ as SquareBoardInput, a0 as ThemeMeta, a1 as ThemeOverride, a2 as Typography, a3 as createHexBoardView, a4 as hexUtils, a5 as mergeTheme, a6 as normalizeHexBoardInput, a7 as normalizeSquareBoardInput } from './hex-board-view-Kz9Q_zsv.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-B1sIoBlX.js';
|
|
6
6
|
import { CSSProperties } from 'react';
|
|
7
7
|
export { C as CardDropTargetVisualState, a as CardIntent, H as HandInteractionPolicy, b as HandLayoutKind, c as HandLayoutPolicy, d as HandView, e as HandViewProps, I as InteractionVisualState, T as TargetIntent, f as dropTargetVisualStateDataAttributes, v as visualStateDataAttributes } from './HandView-PYDmehVD.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 useMobileHandTrayActive, o as useRegisterMobileHand } from './ResourceCounter-
|
|
9
|
-
export { BoardBaseId, BoardId, BoardKindStates, BoardRef, BoardStates, CardId, CardIdsByDeckId, CardProperties, DeckId, DiceStates, DieId, DieState, EdgeTypeId, GameState, HexBoardState, HexEdgeState, HexTileState, HexVertexState, NetworkBoardState, NetworkEdgeState, NetworkNodeState, NetworkPieceState, PerPlayer, PerPlayerBoardRef, PieceId, PieceTypeId, Player, PlayerId, SharedBoardRef, SpaceId, SpaceTypeId, SquareBoardState, SquareCellState, SquareEdgeState, SquarePieceState, SquareVertexState, TrackBoardState, TrackPieceState, TrackSpaceState, VertexTypeId } from './
|
|
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 useMobileHandTrayActive, o as useOverlayInsets, p as useRegisterBottomOverlayInset, q as useRegisterMobileHand } from './ResourceCounter-BuiNstXs.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
10
|
export { CardCollection, ViewCard, ViewSlotOccupant } from './types.js';
|
|
11
|
-
export { H as HexColor, h as hexColor, i as isHexColor, p as parseHexColor } from './hex-color-MhOyuY-o.js';
|
|
12
11
|
import 'react/jsx-runtime';
|
|
13
12
|
import 'framer-motion';
|
|
14
13
|
import 'vaul';
|
|
@@ -115,10 +114,6 @@ interface UsePanZoomReturn {
|
|
|
115
114
|
/** Whether currently pinching */
|
|
116
115
|
isPinching: boolean;
|
|
117
116
|
}
|
|
118
|
-
/**
|
|
119
|
-
* Hook for pan and zoom gestures on board components
|
|
120
|
-
*/
|
|
121
|
-
declare function usePanZoom(options?: UsePanZoomOptions): UsePanZoomReturn;
|
|
122
117
|
/**
|
|
123
118
|
* Helper to calculate SVG viewBox with pan/zoom applied
|
|
124
119
|
*/
|
|
@@ -316,4 +311,4 @@ declare function useBoardTheme(): BoardTheme;
|
|
|
316
311
|
/** Standalone derivation for renderers that already hold a {@link Theme}. */
|
|
317
312
|
declare function deriveBoardTheme(theme: Theme): BoardTheme;
|
|
318
313
|
|
|
319
|
-
export { type BoardTheme, type PanZoomTransform, Theme, TrackPiece, TrackSpace, type UsePanZoomOptions, type UsePanZoomReturn, arcadeTheme, calculateViewBox, cssVar, cssVarOr, deriveBoardTheme, studioTheme, tabletopTheme, themeToCssVars, toTrackBoardData, useBoardTheme, useIsMobile
|
|
314
|
+
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
CHANGED
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
parseHexColor,
|
|
6
6
|
toTrackBoardData,
|
|
7
7
|
useBoardTheme
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-FWVV2X74.js";
|
|
9
9
|
import {
|
|
10
10
|
ActionButton,
|
|
11
11
|
ActionGroup,
|
|
@@ -67,6 +67,13 @@ import {
|
|
|
67
67
|
MobileHandTrayProvider,
|
|
68
68
|
MoreActions,
|
|
69
69
|
NetworkGraph,
|
|
70
|
+
Panel,
|
|
71
|
+
PanelActions,
|
|
72
|
+
PanelBody,
|
|
73
|
+
PanelDescription,
|
|
74
|
+
PanelHeader,
|
|
75
|
+
PanelRoot,
|
|
76
|
+
PanelTitle,
|
|
70
77
|
PhaseIndicator,
|
|
71
78
|
PlayArea,
|
|
72
79
|
PrimaryActionButton,
|
|
@@ -119,11 +126,13 @@ import {
|
|
|
119
126
|
useChromeSuppression,
|
|
120
127
|
useIsMobile,
|
|
121
128
|
useMobileHandTrayActive,
|
|
129
|
+
useOverlayInsets,
|
|
130
|
+
useRegisterBottomOverlayInset,
|
|
122
131
|
useRegisterMobileHand,
|
|
123
132
|
useTheme,
|
|
124
133
|
useThemeCssVars,
|
|
125
134
|
visualStateDataAttributes
|
|
126
|
-
} from "./chunk-
|
|
135
|
+
} from "./chunk-45FI6XII.js";
|
|
127
136
|
import "./chunk-VDXOF4FW.js";
|
|
128
137
|
import "./chunk-PZ5AY32C.js";
|
|
129
138
|
export {
|
|
@@ -187,6 +196,13 @@ export {
|
|
|
187
196
|
MobileHandTrayProvider,
|
|
188
197
|
MoreActions,
|
|
189
198
|
NetworkGraph,
|
|
199
|
+
Panel,
|
|
200
|
+
PanelActions,
|
|
201
|
+
PanelBody,
|
|
202
|
+
PanelDescription,
|
|
203
|
+
PanelHeader,
|
|
204
|
+
PanelRoot,
|
|
205
|
+
PanelTitle,
|
|
190
206
|
PhaseIndicator,
|
|
191
207
|
PlayArea,
|
|
192
208
|
PrimaryActionButton,
|
|
@@ -245,6 +261,8 @@ export {
|
|
|
245
261
|
useChromeSuppression,
|
|
246
262
|
useIsMobile,
|
|
247
263
|
useMobileHandTrayActive,
|
|
264
|
+
useOverlayInsets,
|
|
265
|
+
useRegisterBottomOverlayInset,
|
|
248
266
|
useRegisterMobileHand,
|
|
249
267
|
useTheme,
|
|
250
268
|
useThemeCssVars,
|
|
@@ -177,7 +177,7 @@ declare function isPerPlayerBoardRef<BaseId extends string, Id extends PlayerId>
|
|
|
177
177
|
|
|
178
178
|
type RuntimeScalar = boolean | number | string | null;
|
|
179
179
|
interface RuntimeRecord {
|
|
180
|
-
[key: string]: RuntimePayload
|
|
180
|
+
[key: string]: RuntimePayload;
|
|
181
181
|
}
|
|
182
182
|
type RuntimePayload = RuntimeScalar | RuntimePayload[] | RuntimeRecord;
|
|
183
183
|
type RuntimeParams = RuntimeRecord;
|
|
@@ -833,9 +833,9 @@ type PhaseSchemasOfContract<Contract> = Contract extends {
|
|
|
833
833
|
type PhaseStateMapOfContract<Contract> = {
|
|
834
834
|
[Name in keyof PhaseSchemasOfContract<Contract> & string]: z.infer<PhaseSchemasOfContract<Contract>[Name]>;
|
|
835
835
|
};
|
|
836
|
-
type PublicSchemaOfContract<Contract> = StateDefinitionOfContract<Contract> extends StateDefinition<infer PublicSchema,
|
|
837
|
-
type PrivateSchemaOfContract<Contract> = StateDefinitionOfContract<Contract> extends StateDefinition<
|
|
838
|
-
type HiddenSchemaOfContract<Contract> = StateDefinitionOfContract<Contract> extends StateDefinition<
|
|
836
|
+
type PublicSchemaOfContract<Contract> = StateDefinitionOfContract<Contract> extends StateDefinition<infer PublicSchema, SchemaLike<object>, SchemaLike<object>> ? PublicSchema : never;
|
|
837
|
+
type PrivateSchemaOfContract<Contract> = StateDefinitionOfContract<Contract> extends StateDefinition<SchemaLike<object>, infer PrivateSchema, SchemaLike<object>> ? PrivateSchema : never;
|
|
838
|
+
type HiddenSchemaOfContract<Contract> = StateDefinitionOfContract<Contract> extends StateDefinition<SchemaLike<object>, SchemaLike<object>, infer HiddenSchema> ? HiddenSchema : never;
|
|
839
839
|
type PhaseNameOfContract<Contract> = keyof PhaseSchemasOfContract<Contract> extends string ? keyof PhaseSchemasOfContract<Contract> & string : PhaseNameOfManifest<ManifestOf<Contract>>;
|
|
840
840
|
type ManifestContractOf<Contract> = ManifestContract<TableOfManifest<ManifestOf<Contract>>>;
|
|
841
841
|
type ExactManifestContractOf<Contract> = ManifestOf<Contract> & GeneratedManifestContractLike<TableOfManifest<ManifestOf<Contract>>>;
|
|
@@ -1458,7 +1458,7 @@ type ContinuationToken<Data = RuntimePayload, ContinuationId extends string = st
|
|
|
1458
1458
|
data: Data;
|
|
1459
1459
|
readonly __responseType?: Response;
|
|
1460
1460
|
};
|
|
1461
|
-
type ContinuationResponseOf<Token> = Token extends ContinuationToken<
|
|
1461
|
+
type ContinuationResponseOf<Token> = Token extends ContinuationToken<unknown, string, infer Response> ? Response : never;
|
|
1462
1462
|
type AnyContinuationToken = ContinuationToken<RuntimePayload, string, RuntimePayload>;
|
|
1463
1463
|
/**
|
|
1464
1464
|
* Declarative choice option. Retained as the shape used by prompt-kind
|
|
@@ -1997,13 +1997,19 @@ type AnyPhaseDefinitionForContract<Contract> = PhaseMapOf<Contract>[PhaseNameOfC
|
|
|
1997
1997
|
* check below can infer `PhaseStateSchema`.
|
|
1998
1998
|
*/
|
|
1999
1999
|
type PhaseStateMapOfDefinitions<Definitions extends Record<string, PhaseDefinition<SchemaLike<object>, any, any, Record<string, InputCollector>, EffectMap<any, any>, InteractionMap<any, any>, StageMap<any, any>, PhaseZoneList<any>, CardActionMap<any, any>>>> = Partial<{
|
|
2000
|
-
[Name in keyof Definitions & string]: Definitions[Name] extends
|
|
2000
|
+
[Name in keyof Definitions & string]: Definitions[Name] extends {
|
|
2001
|
+
state: infer PhaseStateSchema extends SchemaLike<object>;
|
|
2002
|
+
} ? z.infer<PhaseStateSchema> : never;
|
|
2001
2003
|
}>;
|
|
2002
2004
|
type PhaseStateOfDefinitions<Definitions extends Record<string, PhaseDefinition<SchemaLike<object>, any, any, Record<string, InputCollector>, EffectMap<any, any>, InteractionMap<any, any>, StageMap<any, any>, PhaseZoneList<any>, CardActionMap<any, any>>>> = {
|
|
2003
|
-
[Name in keyof Definitions & string]: Definitions[Name] extends
|
|
2005
|
+
[Name in keyof Definitions & string]: Definitions[Name] extends {
|
|
2006
|
+
state: infer PhaseStateSchema extends SchemaLike<object>;
|
|
2007
|
+
} ? z.infer<PhaseStateSchema> : never;
|
|
2004
2008
|
}[keyof Definitions & string];
|
|
2005
2009
|
type ResolvedGameStateOf<Contract, Definitions extends PhaseMapOf<Contract>> = {
|
|
2006
|
-
[Name in keyof Definitions & string]: ReducerGameState<TableOfManifest<ManifestContractOf<Contract>>, z.infer<PublicSchemaOfContract<Contract>>, z.infer<PrivateSchemaOfContract<Contract>>, z.infer<HiddenSchemaOfContract<Contract>>, Definitions[Name] extends
|
|
2010
|
+
[Name in keyof Definitions & string]: ReducerGameState<TableOfManifest<ManifestContractOf<Contract>>, z.infer<PublicSchemaOfContract<Contract>>, z.infer<PrivateSchemaOfContract<Contract>>, z.infer<HiddenSchemaOfContract<Contract>>, Definitions[Name] extends {
|
|
2011
|
+
state: infer PhaseStateSchema extends SchemaLike<object>;
|
|
2012
|
+
} ? z.infer<PhaseStateSchema> : never, PhaseNameOfContract<Contract>> & {
|
|
2007
2013
|
flow: ReducerGameState<TableOfManifest<ManifestContractOf<Contract>>, z.infer<PublicSchemaOfContract<Contract>>, z.infer<PrivateSchemaOfContract<Contract>>, z.infer<HiddenSchemaOfContract<Contract>>, PhaseStateOfDefinitions<Definitions>, PhaseNameOfContract<Contract>>["flow"] & {
|
|
2008
2014
|
currentPhase: Name;
|
|
2009
2015
|
};
|
|
@@ -2022,7 +2028,9 @@ type NonNeverKeys<Registry> = {
|
|
|
2022
2028
|
}[keyof Registry];
|
|
2023
2029
|
type ViewNamesOfDefinition<Definition> = NonNeverKeys<ViewsOfDefinition<Definition>> & string;
|
|
2024
2030
|
type ViewDefinitionByName<Definition, ViewName extends ViewNamesOfDefinition<Definition>> = ViewsOfDefinition<Definition>[ViewName];
|
|
2025
|
-
type ViewOfDefinition<Definition, ViewName extends ViewNamesOfDefinition<Definition>> = ViewDefinitionByName<Definition, ViewName> extends
|
|
2031
|
+
type ViewOfDefinition<Definition, ViewName extends ViewNamesOfDefinition<Definition>> = ViewDefinitionByName<Definition, ViewName> extends {
|
|
2032
|
+
project: (...args: never[]) => infer Projection;
|
|
2033
|
+
} ? Projection : never;
|
|
2026
2034
|
type PhaseNamesOfDefinition<Definition> = keyof PhasesOfDefinition<Definition> & string;
|
|
2027
2035
|
type PhaseDefinitionByName<Definition, PhaseName extends PhaseNamesOfDefinition<Definition>> = PhaseName extends keyof PhasesOfDefinition<Definition> & string ? PhasesOfDefinition<Definition>[PhaseName] : never;
|
|
2028
2036
|
type EffectsOfDefinition<Definition> = PhasesOfDefinition<Definition>[keyof PhasesOfDefinition<Definition> & string] extends {
|
|
@@ -2031,7 +2039,10 @@ type EffectsOfDefinition<Definition> = PhasesOfDefinition<Definition>[keyof Phas
|
|
|
2031
2039
|
type EffectIdsOfDefinition<Definition> = EffectsOfDefinition<Definition> extends infer Effect ? Effect extends {
|
|
2032
2040
|
id: infer Id;
|
|
2033
2041
|
} ? Extract<Id, string> : never : never;
|
|
2034
|
-
type GameStateOf<Source> = Source extends
|
|
2042
|
+
type GameStateOf<Source> = Source extends {
|
|
2043
|
+
contract: infer Contract extends ReducerGameContractLike;
|
|
2044
|
+
phases: infer Definitions;
|
|
2045
|
+
} ? Definitions extends PhaseMapOf<Contract> ? ResolvedGameStateOf<Contract, Definitions> : never : Source extends ReducerGameContract<any, any, any, any, any, any, any> ? BaseGameStateOfContract<Source> : never;
|
|
2035
2046
|
/**
|
|
2036
2047
|
* Public structural upper bound for a reducer game contract.
|
|
2037
2048
|
*
|
|
@@ -2113,8 +2124,30 @@ type CardCollectorZoneIds<Collector> = Collector extends {
|
|
|
2113
2124
|
readonly zoneId: infer ZoneId extends string;
|
|
2114
2125
|
} ? ZoneId : never : never;
|
|
2115
2126
|
type CollectorCardZoneIds<Collectors, Input extends string> = Collectors extends Record<string, InputCollector> ? Input extends keyof Collectors ? CardCollectorZoneIds<Collectors[Input]> : never : never;
|
|
2127
|
+
type CollectorsOfInteractionDefinition<Spec> = Spec extends {
|
|
2128
|
+
readonly inputs?: infer Collectors;
|
|
2129
|
+
} ? NonNullable<Collectors> extends Record<string, InputCollector> ? NonNullable<Collectors> : Record<string, never> : Record<string, never>;
|
|
2130
|
+
type CollectorKindsOfInteractionDefinition<Spec> = (Spec extends {
|
|
2131
|
+
readonly cardType: unknown;
|
|
2132
|
+
readonly playFrom: unknown;
|
|
2133
|
+
} ? "card" : never) | CollectorKindsOf<CollectorsOfInteractionDefinition<Spec>>;
|
|
2134
|
+
type InputKeysWithCollectorKindOfInteractionDefinition<Spec, Kind extends string> = (Spec extends {
|
|
2135
|
+
readonly cardType: unknown;
|
|
2136
|
+
readonly playFrom: unknown;
|
|
2137
|
+
} ? Extract<"card", Kind> extends never ? never : "cardId" : never) | (CollectorKeysWithKind<CollectorsOfInteractionDefinition<Spec>, Kind> & string);
|
|
2138
|
+
type CardInputZoneIdsOfInteractionDefinition<Spec, Input extends string> = Input extends "cardId" ? Spec extends {
|
|
2139
|
+
readonly playFrom: infer PlayFrom extends string;
|
|
2140
|
+
} ? PlayFrom : CollectorCardZoneIds<CollectorsOfInteractionDefinition<Spec>, Input> : CollectorCardZoneIds<CollectorsOfInteractionDefinition<Spec>, Input>;
|
|
2141
|
+
type ParamsOfCollectors<Collectors> = Collectors extends Record<string, InputCollector> ? {
|
|
2142
|
+
[K in keyof Collectors]: Collectors[K] extends InputCollector<infer S> ? S extends SchemaLike<infer V> ? V : never : never;
|
|
2143
|
+
} : never;
|
|
2144
|
+
type ClientParamsOfCollectors<Collectors> = Collectors extends Record<string, InputCollector> ? {
|
|
2145
|
+
[K in keyof Collectors as Collectors[K] extends {
|
|
2146
|
+
readonly kind: "rng";
|
|
2147
|
+
} ? never : K]: Collectors[K] extends InputCollector<infer S> ? S extends SchemaLike<infer V> ? V : never : never;
|
|
2148
|
+
} : never;
|
|
2116
2149
|
type InteractionIdsWithCollectorKindOfDefinitionPhase<Definition, PhaseName extends PhaseNamesOfDefinition<Definition>, Kind extends string> = {
|
|
2117
|
-
[InteractionId in InteractionIdOfDefinitionPhase<Definition, PhaseName>]: InteractionSpecByNameOfDefinitionPhase<Definition, PhaseName, InteractionId> extends
|
|
2150
|
+
[InteractionId in InteractionIdOfDefinitionPhase<Definition, PhaseName>]: InteractionSpecByNameOfDefinitionPhase<Definition, PhaseName, InteractionId> extends infer Spec ? Extract<CollectorKindsOfInteractionDefinition<Spec>, Kind> extends never ? never : InteractionId : never;
|
|
2118
2151
|
}[InteractionIdOfDefinitionPhase<Definition, PhaseName>];
|
|
2119
2152
|
type QualifiedInteractionIdsWithCollectorKindOfDefinitionPhase<Definition, PhaseName extends PhaseNamesOfDefinition<Definition>, Kind extends string> = InteractionIdsWithCollectorKindOfDefinitionPhase<Definition, PhaseName, Kind> extends infer InteractionId extends string ? `${PhaseName}.${InteractionId}` : never;
|
|
2120
2153
|
type PromptInteractionKeyOfDefinition<Definition> = {
|
|
@@ -2126,21 +2159,14 @@ type BoardInteractionKeyOfDefinition<Definition> = {
|
|
|
2126
2159
|
type CardInteractionKeyOfDefinition<Definition> = {
|
|
2127
2160
|
[PhaseName in PhaseNamesOfDefinition<Definition>]: QualifiedInteractionIdsWithCollectorKindOfDefinitionPhase<Definition, PhaseName, "card">;
|
|
2128
2161
|
}[PhaseNamesOfDefinition<Definition>];
|
|
2129
|
-
type InputKeysWithCollectorKindOfDefinition<Definition, PhaseName extends PhaseNamesOfDefinition<Definition>, InteractionId extends InteractionIdOfDefinitionPhase<Definition, PhaseName>, Kind extends string> = InteractionSpecByNameOfDefinitionPhase<Definition, PhaseName, InteractionId> extends
|
|
2130
|
-
type CardInputZoneIdsOfDefinition<Definition, PhaseName extends PhaseNamesOfDefinition<Definition>, InteractionId extends InteractionIdOfDefinitionPhase<Definition, PhaseName>, Input extends string> = InteractionSpecByNameOfDefinitionPhase<Definition, PhaseName, InteractionId> extends
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
} : never : InteractionSpecByNameOfDefinitionPhase<Definition, PhaseName, InteractionId> extends CardActionSpec<infer Collectors, infer _State, infer _Manifest> ? Collectors extends Record<string, InputCollector> ? {
|
|
2136
|
-
cardId: string;
|
|
2137
|
-
} & {
|
|
2138
|
-
[K in keyof Collectors]: Collectors[K] extends InputCollector<infer S, infer _S2> ? S extends SchemaLike<infer V> ? V : never : never;
|
|
2139
|
-
} : {
|
|
2162
|
+
type InputKeysWithCollectorKindOfDefinition<Definition, PhaseName extends PhaseNamesOfDefinition<Definition>, InteractionId extends InteractionIdOfDefinitionPhase<Definition, PhaseName>, Kind extends string> = InteractionSpecByNameOfDefinitionPhase<Definition, PhaseName, InteractionId> extends infer Spec ? InputKeysWithCollectorKindOfInteractionDefinition<Spec, Kind> : never;
|
|
2163
|
+
type CardInputZoneIdsOfDefinition<Definition, PhaseName extends PhaseNamesOfDefinition<Definition>, InteractionId extends InteractionIdOfDefinitionPhase<Definition, PhaseName>, Input extends string> = InteractionSpecByNameOfDefinitionPhase<Definition, PhaseName, InteractionId> extends infer Spec ? CardInputZoneIdsOfInteractionDefinition<Spec, Input> : never;
|
|
2164
|
+
type ParamsOfInteractionOfDefinition<Definition, PhaseName extends PhaseNamesOfDefinition<Definition>, InteractionId extends InteractionIdOfDefinitionPhase<Definition, PhaseName>> = InteractionSpecByNameOfDefinitionPhase<Definition, PhaseName, InteractionId> extends infer Spec ? Spec extends {
|
|
2165
|
+
readonly cardType: unknown;
|
|
2166
|
+
readonly playFrom: unknown;
|
|
2167
|
+
} ? {
|
|
2140
2168
|
cardId: string;
|
|
2141
|
-
}
|
|
2142
|
-
[K in keyof Collectors]: Collectors[K] extends InputCollector<infer S, infer _S2> ? S extends SchemaLike<infer V> ? V : never : never;
|
|
2143
|
-
} : never : never;
|
|
2169
|
+
} & ParamsOfCollectors<CollectorsOfInteractionDefinition<Spec>> : ParamsOfCollectors<CollectorsOfInteractionDefinition<Spec>> : never;
|
|
2144
2170
|
/**
|
|
2145
2171
|
* Client-facing params shape for an interaction. Omits engine-sampled
|
|
2146
2172
|
* collectors (`rngInput.*`) — clients never supply those fields; the
|
|
@@ -2152,31 +2178,20 @@ type ParamsOfInteractionOfDefinition<Definition, PhaseName extends PhaseNamesOfD
|
|
|
2152
2178
|
* {@link ParamsOfInteractionOfDefinition}, which includes every field
|
|
2153
2179
|
* because the engine has already filled the sampled ones by then.
|
|
2154
2180
|
*/
|
|
2155
|
-
type ClientParamsOfInteractionOfDefinition<Definition, PhaseName extends PhaseNamesOfDefinition<Definition>, InteractionId extends InteractionIdOfDefinitionPhase<Definition, PhaseName>> = InteractionSpecByNameOfDefinitionPhase<Definition, PhaseName, InteractionId> extends
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
} : never : InteractionSpecByNameOfDefinitionPhase<Definition, PhaseName, InteractionId> extends CardActionSpec<infer Collectors, infer _State, infer _Manifest> ? Collectors extends Record<string, InputCollector> ? {
|
|
2160
|
-
cardId: string;
|
|
2161
|
-
} & {
|
|
2162
|
-
[K in keyof Collectors as Collectors[K] extends InputCollector<infer _S, infer _S2> & {
|
|
2163
|
-
kind: "rng";
|
|
2164
|
-
} ? never : K]: Collectors[K] extends InputCollector<infer S, infer _S2> ? S extends SchemaLike<infer V> ? V : never : never;
|
|
2165
|
-
} : {
|
|
2181
|
+
type ClientParamsOfInteractionOfDefinition<Definition, PhaseName extends PhaseNamesOfDefinition<Definition>, InteractionId extends InteractionIdOfDefinitionPhase<Definition, PhaseName>> = InteractionSpecByNameOfDefinitionPhase<Definition, PhaseName, InteractionId> extends infer Spec ? Spec extends {
|
|
2182
|
+
readonly cardType: unknown;
|
|
2183
|
+
readonly playFrom: unknown;
|
|
2184
|
+
} ? {
|
|
2166
2185
|
cardId: string;
|
|
2167
|
-
}
|
|
2168
|
-
[K in keyof Collectors as Collectors[K] extends InputCollector<infer _S, infer _S2> & {
|
|
2169
|
-
kind: "rng";
|
|
2170
|
-
} ? never : K]: Collectors[K] extends InputCollector<infer S, infer _S2> ? S extends SchemaLike<infer V> ? V : never : never;
|
|
2171
|
-
} : never : never;
|
|
2186
|
+
} & ClientParamsOfCollectors<CollectorsOfInteractionDefinition<Spec>> : ClientParamsOfCollectors<CollectorsOfInteractionDefinition<Spec>> : never;
|
|
2172
2187
|
type DefaultedClientCollectorKeys<Collectors extends Record<string, InputCollector>> = {
|
|
2173
|
-
[K in keyof Collectors]: Collectors[K] extends
|
|
2174
|
-
kind: "rng";
|
|
2188
|
+
[K in keyof Collectors]: Collectors[K] extends {
|
|
2189
|
+
readonly kind: "rng";
|
|
2175
2190
|
} ? never : Collectors[K] extends {
|
|
2176
2191
|
readonly defaultValue: unknown;
|
|
2177
2192
|
} ? K : never;
|
|
2178
2193
|
}[keyof Collectors];
|
|
2179
|
-
type DefaultedClientParamKeysOfInteractionOfDefinition<Definition, PhaseName extends PhaseNamesOfDefinition<Definition>, InteractionId extends InteractionIdOfDefinitionPhase<Definition, PhaseName>> = InteractionSpecByNameOfDefinitionPhase<Definition, PhaseName, InteractionId> extends
|
|
2194
|
+
type DefaultedClientParamKeysOfInteractionOfDefinition<Definition, PhaseName extends PhaseNamesOfDefinition<Definition>, InteractionId extends InteractionIdOfDefinitionPhase<Definition, PhaseName>> = InteractionSpecByNameOfDefinitionPhase<Definition, PhaseName, InteractionId> extends infer Spec ? DefaultedClientCollectorKeys<CollectorsOfInteractionDefinition<Spec>> & string : never;
|
|
2180
2195
|
type StageRegistryOfDefinitionPhase<Definition, PhaseName extends PhaseNamesOfDefinition<Definition>> = PhaseDefinitionByName<Definition, PhaseName> extends {
|
|
2181
2196
|
stages?: infer Stages;
|
|
2182
2197
|
} ? NonNullable<Stages> : Record<string, never>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dreamboard-games/sdk",
|
|
3
|
-
"version": "0.4.0-alpha.
|
|
3
|
+
"version": "0.4.0-alpha.2",
|
|
4
4
|
"description": "Dreamboard SDK package set metadata and public facade",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -79,6 +79,11 @@
|
|
|
79
79
|
"import": "./dist/codegen.js",
|
|
80
80
|
"default": "./dist/codegen.js"
|
|
81
81
|
},
|
|
82
|
+
"./authoring": {
|
|
83
|
+
"types": "./dist/authoring/index.d.ts",
|
|
84
|
+
"import": "./dist/authoring/index.js",
|
|
85
|
+
"default": "./dist/authoring/index.js"
|
|
86
|
+
},
|
|
82
87
|
"./reducer-contract": {
|
|
83
88
|
"types": "./dist/reducer-contract.d.ts",
|
|
84
89
|
"import": "./dist/reducer-contract.js",
|
|
@@ -90,6 +95,7 @@
|
|
|
90
95
|
"default": "./dist/testing.js"
|
|
91
96
|
},
|
|
92
97
|
"./browser-interaction": {
|
|
98
|
+
"bun": "./src/browser-interaction.ts",
|
|
93
99
|
"types": "./dist/browser-interaction.d.ts",
|
|
94
100
|
"import": "./dist/browser-interaction.js",
|
|
95
101
|
"default": "./dist/browser-interaction.js"
|
|
@@ -105,10 +111,15 @@
|
|
|
105
111
|
"!tsconfig.tsbuildinfo"
|
|
106
112
|
],
|
|
107
113
|
"scripts": {
|
|
108
|
-
"build": "tsup && mkdir -p dist/ui && tailwindcss -i src/ui/plugin-styles.css -o dist/ui/plugin-styles.css --minify",
|
|
114
|
+
"build": "pnpm --dir ../.. --filter @dreamboard-games/plugin-runtime-contract build && pnpm --dir ../.. authoring-metadata:generate && tsup && node ../../scripts/copy-sdk-private-dts.mjs && mkdir -p dist/ui && tailwindcss -i src/ui/plugin-styles.css -o dist/ui/plugin-styles.css --minify",
|
|
109
115
|
"typecheck": "tsc --noEmit",
|
|
110
|
-
"lint": "eslint 'src/**/*.ts'",
|
|
111
|
-
"
|
|
116
|
+
"lint": "eslint 'src/**/*.{ts,tsx}'",
|
|
117
|
+
"storybook": "storybook dev -p 6006 --host 127.0.0.1 --no-open",
|
|
118
|
+
"storybook:build": "storybook build -o storybook-static",
|
|
119
|
+
"storybook:test": "concurrently -k -s first -n storybook,test \"http-server storybook-static -p 6006 -s --silent\" \"wait-on tcp:6006 && test-storybook --url http://127.0.0.1:6006\"",
|
|
120
|
+
"storybook:test:visual": "playwright test --config .storybook/visual-runner.config.ts",
|
|
121
|
+
"storybook:test:visual:update": "playwright test --config .storybook/visual-runner.config.ts --update-snapshots",
|
|
122
|
+
"test": "bun test src"
|
|
112
123
|
},
|
|
113
124
|
"dependencies": {
|
|
114
125
|
"@radix-ui/react-accordion": "^1.2.12",
|
|
@@ -125,20 +136,33 @@
|
|
|
125
136
|
},
|
|
126
137
|
"devDependencies": {
|
|
127
138
|
"@dreamboard-games/reducer-contract": "workspace:*",
|
|
139
|
+
"@dreamboard-games/plugin-runtime-contract": "workspace:*",
|
|
128
140
|
"@dreamboard-games/sdk-types": "workspace:*",
|
|
129
141
|
"@dreamboard-games/workspace-codegen": "workspace:*",
|
|
130
142
|
"@happy-dom/global-registrator": "^20.9.0",
|
|
143
|
+
"@playwright/test": "1.60.0",
|
|
144
|
+
"@storybook/addon-a11y": "^10.4.1",
|
|
145
|
+
"@storybook/addon-themes": "^10.4.1",
|
|
146
|
+
"@storybook/react-vite": "^10.4.1",
|
|
147
|
+
"@storybook/test-runner": "^0.24.4",
|
|
131
148
|
"@tailwindcss/cli": "^4.1.5",
|
|
149
|
+
"@tailwindcss/vite": "^4.1.5",
|
|
132
150
|
"@types/node": "^24.5.2",
|
|
133
151
|
"@types/react": "^19.0.0",
|
|
134
152
|
"@types/react-dom": "^19.0.0",
|
|
153
|
+
"axe-playwright": "^2.0.3",
|
|
154
|
+
"concurrently": "^9.1.0",
|
|
135
155
|
"eslint": "^9.39.0",
|
|
136
156
|
"framer-motion": "^11.15.0",
|
|
157
|
+
"http-server": "^14.1.1",
|
|
137
158
|
"react": "^19.2.0",
|
|
138
159
|
"react-dom": "^19.2.0",
|
|
160
|
+
"storybook": "^10.4.1",
|
|
139
161
|
"tailwindcss": "^4.1.5",
|
|
140
162
|
"tsup": "^8.5.0",
|
|
141
163
|
"typescript": "^5.9.2",
|
|
164
|
+
"vite": "^5.4.10",
|
|
165
|
+
"wait-on": "^8.0.1",
|
|
142
166
|
"zod": "4.4.3"
|
|
143
167
|
},
|
|
144
168
|
"peerDependencies": {
|