@dreamboard-games/sdk 0.4.0-alpha.2 → 0.4.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.
- package/REFERENCE.md +33 -22
- package/dist/HandView-x8MhbhFl.d.ts +79 -0
- package/dist/{ResourceCounter-BuiNstXs.d.ts → ResourceCounter-BFxJknqp.d.ts} +1 -9
- package/dist/{ThemeProvider-B1sIoBlX.d.ts → ThemeProvider-DRalAWzY.d.ts} +1 -1
- package/dist/authoring/index.js +1 -1
- package/dist/{chunk-45FI6XII.js → chunk-E3X552YM.js} +3 -11
- package/dist/chunk-E3X552YM.js.map +1 -0
- package/dist/{chunk-HWJS3VOJ.js → chunk-LKJLAGND.js} +2 -2
- package/dist/{chunk-WOWFONLZ.js → chunk-QOFFRHZR.js} +6 -6
- package/dist/chunk-QOFFRHZR.js.map +1 -0
- package/dist/{chunk-ZAS2SENW.js → chunk-SUMZ5OEH.js} +2 -2
- package/dist/{chunk-ZAS2SENW.js.map → chunk-SUMZ5OEH.js.map} +1 -1
- package/dist/{chunk-6JQFGSLD.js → chunk-TTISZQNI.js} +13 -15
- package/dist/{chunk-6JQFGSLD.js.map → chunk-TTISZQNI.js.map} +1 -1
- package/dist/{chunk-FWVV2X74.js → chunk-XZ667T4K.js} +2 -2
- package/dist/{components-BbWPnZCF.d.ts → components-B7hFaEn_.d.ts} +3 -3
- package/dist/{hex-board-view-Kz9Q_zsv.d.ts → hex-board-view-BFlWDb9k.d.ts} +116 -1
- package/dist/index-gjxQichK.d.ts +192 -0
- package/dist/index.js +2 -2
- package/dist/package-set.d.ts +2 -2
- package/dist/package-set.js +2 -2
- package/dist/runtime/primitives.d.ts +20 -23
- package/dist/runtime/primitives.js +3 -3
- package/dist/runtime/workspace-contract.d.ts +16 -173
- package/dist/runtime/workspace-contract.js +4 -4
- package/dist/runtime.d.ts +6 -6
- package/dist/runtime.js +4 -4
- package/dist/ui/components.d.ts +4 -4
- package/dist/ui/components.js +1 -3
- package/dist/ui/plugin-styles.css +1 -1
- package/dist/{ui-contract-CY7cxsCC.d.ts → ui-contract-B4NjRlvC.d.ts} +2 -2
- package/dist/ui.d.ts +7 -7
- package/dist/ui.js +2 -4
- package/package.json +1 -1
- package/dist/HandView-PYDmehVD.d.ts +0 -193
- package/dist/chunk-45FI6XII.js.map +0 -1
- package/dist/chunk-WOWFONLZ.js.map +0 -1
- /package/dist/{chunk-HWJS3VOJ.js.map → chunk-LKJLAGND.js.map} +0 -0
- /package/dist/{chunk-FWVV2X74.js.map → chunk-XZ667T4K.js.map} +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
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 {
|
|
5
|
-
import { a as ThemePresetId } from './ThemeProvider-
|
|
4
|
+
import { a3 as Theme, a5 as ThemeOverride, O as InteractiveTargetState$1, A as AnyHexBoardInput, d as BoardSpaceIdOf, w as HexGridBoardProps, t as HexBoardView } from './hex-board-view-BFlWDb9k.js';
|
|
5
|
+
import { a as ThemePresetId } from './ThemeProvider-DRalAWzY.js';
|
|
6
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';
|
package/dist/ui.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { by as TrackSpace, bx as TrackPiece } from './components-
|
|
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-
|
|
3
|
-
import {
|
|
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
|
|
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-B7hFaEn_.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-B7hFaEn_.js';
|
|
3
|
+
import { a3 as Theme } from './hex-board-view-BFlWDb9k.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 DefaultHexEdge, i as DefaultHexEdgeProps, j as DefaultHexTile, k as DefaultHexTileProps, l as DefaultHexVertex, m as DefaultHexVertexProps, E as EdgePosition, n as Elevation, F as FoundationColor, G as GeneratedHexBoardInput, o as GeneratedHexSpaceStateLike, p as GeneratedSquareBoardInput, q as GeneratedSquareSpaceStateLike, r as GeneratedTiledEdgeStateLike, s as GeneratedTiledVertexStateLike, H as HexBoardInput, t as HexBoardView, u as HexBoardViewTile, v as HexGrid, w as HexGridBoardProps, x as HexGridProps, y as HexOrientation, z as HexTileGeometry, I as IntentColor, J as InteractionVisualState, K as InteractiveHexEdge, L as InteractiveHexVertex, M as InteractiveTargetLayer, N as InteractiveTargetRenderState, P as Motion, Q as NormalizedHexBoard, R as NormalizedHexEdgeOf, S as NormalizedHexTileOf, T as NormalizedHexVertexOf, U as NormalizedSquareBoard, V as NormalizedSquareCellOf, W as NormalizedSquareEdgeOf, X as NormalizedSquarePieceOf, Y as NormalizedSquareVertexOf, Z as PlayerColor, _ as Radius, $ as SemanticColor, a0 as Space, a1 as SquareBoardInput, a2 as TargetIntent, a4 as ThemeMeta, a5 as ThemeOverride, a6 as Typography, a7 as createHexBoardView, a8 as dropTargetVisualStateDataAttributes, a9 as hexUtils, aa as mergeTheme, ab as normalizeHexBoardInput, ac as normalizeSquareBoardInput, ad as visualStateDataAttributes } from './hex-board-view-BFlWDb9k.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-DRalAWzY.js';
|
|
6
6
|
import { CSSProperties } from 'react';
|
|
7
|
-
export {
|
|
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
|
|
7
|
+
export { H as HandInteractionPolicy, a as HandLayoutKind, b as HandLayoutPolicy, c as HandView, d as HandViewProps } from './HandView-x8MhbhFl.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
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
11
|
import 'react/jsx-runtime';
|
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-XZ667T4K.js";
|
|
9
9
|
import {
|
|
10
10
|
ActionButton,
|
|
11
11
|
ActionGroup,
|
|
@@ -125,14 +125,13 @@ import {
|
|
|
125
125
|
useCardDragSurface,
|
|
126
126
|
useChromeSuppression,
|
|
127
127
|
useIsMobile,
|
|
128
|
-
useMobileHandTrayActive,
|
|
129
128
|
useOverlayInsets,
|
|
130
129
|
useRegisterBottomOverlayInset,
|
|
131
130
|
useRegisterMobileHand,
|
|
132
131
|
useTheme,
|
|
133
132
|
useThemeCssVars,
|
|
134
133
|
visualStateDataAttributes
|
|
135
|
-
} from "./chunk-
|
|
134
|
+
} from "./chunk-E3X552YM.js";
|
|
136
135
|
import "./chunk-VDXOF4FW.js";
|
|
137
136
|
import "./chunk-PZ5AY32C.js";
|
|
138
137
|
export {
|
|
@@ -260,7 +259,6 @@ export {
|
|
|
260
259
|
useCardDragSurface,
|
|
261
260
|
useChromeSuppression,
|
|
262
261
|
useIsMobile,
|
|
263
|
-
useMobileHandTrayActive,
|
|
264
262
|
useOverlayInsets,
|
|
265
263
|
useRegisterBottomOverlayInset,
|
|
266
264
|
useRegisterMobileHand,
|
package/package.json
CHANGED
|
@@ -1,193 +0,0 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { ReactNode, CSSProperties } from 'react';
|
|
3
|
-
import { ViewCard } from './types.js';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Controlled visual state contract for `@dreamboard-games/sdk/ui` components.
|
|
7
|
-
*
|
|
8
|
-
* The SDK is Dreamboard-interaction unaware: components consume `display data`
|
|
9
|
-
* and `controlled semantic states`. Runtime adapters compute these states from
|
|
10
|
-
* descriptors/drafts and pass them in as plain props.
|
|
11
|
-
*/
|
|
12
|
-
/**
|
|
13
|
-
* Generic semantic state attached to a presentational component.
|
|
14
|
-
*
|
|
15
|
-
* Every flag is optional and renders as a stable `data-*` attribute on the
|
|
16
|
-
* underlying element so that selectors, snapshot diffs and accessibility
|
|
17
|
-
* announcements can react to state without inspecting class strings.
|
|
18
|
-
*/
|
|
19
|
-
interface InteractionVisualState {
|
|
20
|
-
/** Caller may activate this surface right now. */
|
|
21
|
-
eligible?: boolean;
|
|
22
|
-
/**
|
|
23
|
-
* Eligible *and* a meaningful subset — i.e. at least one peer surface is not
|
|
24
|
-
* eligible. Use this (rather than `eligible`) to drive a "highlight the
|
|
25
|
-
* playable cards" affordance: when every card in a hand is a legal target
|
|
26
|
-
* (e.g. a pass where any card may be chosen, or a turn where you may play
|
|
27
|
-
* anything) the highlight carries no information, so `distinctlyEligible` is
|
|
28
|
-
* `false` for all of them and the ring naturally disappears. `eligible`
|
|
29
|
-
* keeps its literal meaning ("is a legal target") for dimming/logic.
|
|
30
|
-
*/
|
|
31
|
-
distinctlyEligible?: boolean;
|
|
32
|
-
/** Currently chosen as part of a draft selection or focus state. */
|
|
33
|
-
selected?: boolean;
|
|
34
|
-
/** Surface is non-interactive and visually muted. */
|
|
35
|
-
disabled?: boolean;
|
|
36
|
-
/** Caller's draft is invalid — render an error tint without removing the surface. */
|
|
37
|
-
invalid?: boolean;
|
|
38
|
-
/** Action has been submitted; render a settled/locked feedback state. */
|
|
39
|
-
submitted?: boolean;
|
|
40
|
-
/** Surface is being previewed (long-press, hover hold) without commitment. */
|
|
41
|
-
previewing?: boolean;
|
|
42
|
-
/**
|
|
43
|
-
* Optional 0..1 progress reading for an in-flight UI intent (swipe, hold,
|
|
44
|
-
* etc.). Components may render this as a fill, scale or halo without owning
|
|
45
|
-
* the gesture pipeline themselves.
|
|
46
|
-
*/
|
|
47
|
-
intentProgress?: number;
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* Generic UI intent emitted by SDK components.
|
|
51
|
-
*
|
|
52
|
-
* Components do not know what `activate`/`drop` mean in Dreamboard terms —
|
|
53
|
-
* that mapping belongs to a runtime adapter. They only emit when a generic
|
|
54
|
-
* pointer/keyboard gesture completes.
|
|
55
|
-
*
|
|
56
|
-
* - `activate` is a single-target commit produced by a desktop click or a
|
|
57
|
-
* keyboard activation in `direct-activate` mode.
|
|
58
|
-
* - `drop` is a card→target commit produced by mobile drag or keyboard drop
|
|
59
|
-
* in `drag-to-target` mode. The opaque `targetId` is registered by a
|
|
60
|
-
* `CardDropTargetView` and resolved against pointer geometry inside the
|
|
61
|
-
* `CardDragSurface`.
|
|
62
|
-
* - `previewStart`/`previewEnd` bracket a long-press inspection that does
|
|
63
|
-
* not commit.
|
|
64
|
-
*/
|
|
65
|
-
type CardIntent<CardId extends string = string, TargetId extends string = string> = {
|
|
66
|
-
type: "activate";
|
|
67
|
-
cardId: CardId;
|
|
68
|
-
source: "tap" | "keyboard";
|
|
69
|
-
} | {
|
|
70
|
-
type: "previewStart";
|
|
71
|
-
cardId: CardId;
|
|
72
|
-
} | {
|
|
73
|
-
type: "previewEnd";
|
|
74
|
-
cardId: CardId;
|
|
75
|
-
} | {
|
|
76
|
-
type: "drop";
|
|
77
|
-
cardId: CardId;
|
|
78
|
-
targetId: TargetId;
|
|
79
|
-
source: "pointer" | "keyboard";
|
|
80
|
-
};
|
|
81
|
-
/**
|
|
82
|
-
* Generic UI intent emitted for a board target (space/edge/vertex).
|
|
83
|
-
*/
|
|
84
|
-
type TargetIntent<TargetId extends string = string> = {
|
|
85
|
-
type: "activate";
|
|
86
|
-
targetId: TargetId;
|
|
87
|
-
source: "tap" | "keyboard";
|
|
88
|
-
} | {
|
|
89
|
-
type: "previewStart";
|
|
90
|
-
targetId: TargetId;
|
|
91
|
-
} | {
|
|
92
|
-
type: "previewEnd";
|
|
93
|
-
targetId: TargetId;
|
|
94
|
-
};
|
|
95
|
-
/**
|
|
96
|
-
* Controlled visual state for a card drop target rendered through
|
|
97
|
-
* `CardDropTargetView`.
|
|
98
|
-
*
|
|
99
|
-
* `active` is `true` when any card is currently being dragged anywhere on
|
|
100
|
-
* the surface (eligible target should advertise itself). `over` is `true`
|
|
101
|
-
* only for the target that the lifted pointer would currently drop on.
|
|
102
|
-
*/
|
|
103
|
-
interface CardDropTargetVisualState extends InteractionVisualState {
|
|
104
|
-
active?: boolean;
|
|
105
|
-
over?: boolean;
|
|
106
|
-
}
|
|
107
|
-
/**
|
|
108
|
-
* Build the `data-*` attribute bag for an {@link InteractionVisualState} so
|
|
109
|
-
* that components apply a single consistent attribute surface.
|
|
110
|
-
*
|
|
111
|
-
* `undefined` values are emitted (rather than `false`) so that CSS
|
|
112
|
-
* `[data-…="true"]` selectors do not match by mistake.
|
|
113
|
-
*/
|
|
114
|
-
declare function visualStateDataAttributes(state: InteractionVisualState | undefined): Readonly<Record<string, string | undefined>>;
|
|
115
|
-
/**
|
|
116
|
-
* Build the `data-*` attribute bag for a {@link CardDropTargetVisualState}.
|
|
117
|
-
*/
|
|
118
|
-
declare function dropTargetVisualStateDataAttributes(state: CardDropTargetVisualState | undefined): Readonly<Record<string, string | undefined>>;
|
|
119
|
-
|
|
120
|
-
/**
|
|
121
|
-
* Pure layout math for the controlled `HandView`.
|
|
122
|
-
*
|
|
123
|
-
* The functions here are independent of React and DOM measurement so they can
|
|
124
|
-
* be unit-tested directly. {@link computeFanLayout} matches the algorithm
|
|
125
|
-
* documented in `docs/references/ui-sdk-mobile-hand-and-card-interactions.md`,
|
|
126
|
-
* and {@link chooseHandLayoutMode} translates a measured container width and a
|
|
127
|
-
* caller policy into the actual presentation mode the hand should render.
|
|
128
|
-
*/
|
|
129
|
-
type HandPresentationMode = "fan" | "compressed-fan" | "strip" | "tray";
|
|
130
|
-
|
|
131
|
-
/**
|
|
132
|
-
* Deterministic pointer recognizer for the controlled hand view.
|
|
133
|
-
*
|
|
134
|
-
* The engine is independent from React: it consumes pointer events and a
|
|
135
|
-
* caller-supplied callbacks bag, and produces semantic gesture events. It
|
|
136
|
-
* owns no DOM, emits no `CardIntent`, and does not track the drag-lifecycle
|
|
137
|
-
* `phase` — that responsibility lives in `CardDragSurface`. The engine only
|
|
138
|
-
* recognizes `tap`, `previewStart`/`previewEnd`, `liftStart`/`liftMove`/
|
|
139
|
-
* `liftEnd`/`liftCancel`, and a `horizontalBrowse` informational signal.
|
|
140
|
-
*
|
|
141
|
-
* The thresholds match
|
|
142
|
-
* `docs/references/ui-sdk-mobile-hand-and-card-interactions.md`:
|
|
143
|
-
*
|
|
144
|
-
* | Threshold | Default |
|
|
145
|
-
* | ------------------------- | ----------- |
|
|
146
|
-
* | Press preview delay | `220ms` |
|
|
147
|
-
* | Movement slop | `8px` |
|
|
148
|
-
* | Axis bias | `1.25` |
|
|
149
|
-
* | Drag lift distance | `28px` |
|
|
150
|
-
*
|
|
151
|
-
* Callers wire the engine's `handlePointerDown` / `handlePointerMove` /
|
|
152
|
-
* `handlePointerUp` / `handlePointerCancel` to the matching DOM events on
|
|
153
|
-
* each interactive card.
|
|
154
|
-
*/
|
|
155
|
-
type HandInteractionPolicy = "direct-activate" | "drag-to-target";
|
|
156
|
-
|
|
157
|
-
type HandLayoutKind = HandPresentationMode | "stack";
|
|
158
|
-
interface HandLayoutPolicy {
|
|
159
|
-
desktop?: HandLayoutKind;
|
|
160
|
-
mobile?: HandLayoutKind;
|
|
161
|
-
}
|
|
162
|
-
interface HandViewProps<CardData extends ViewCard = ViewCard> {
|
|
163
|
-
cards: readonly CardData[];
|
|
164
|
-
/**
|
|
165
|
-
* Layout policy. Pass a single layout kind to use the same layout in every
|
|
166
|
-
* viewport, or pass `{ desktop, mobile }` for a measured-width decision.
|
|
167
|
-
* Defaults to `{ desktop: "fan", mobile: "tray" }`.
|
|
168
|
-
*/
|
|
169
|
-
layout?: HandLayoutKind | HandLayoutPolicy;
|
|
170
|
-
/**
|
|
171
|
-
* Mobile interaction policy. Defaults to `direct-activate`. Use
|
|
172
|
-
* `drag-to-target` together with a surrounding `CardDragSurface` and one
|
|
173
|
-
* or more `CardDropTargetView` children.
|
|
174
|
-
*/
|
|
175
|
-
mobileInteraction?: HandInteractionPolicy;
|
|
176
|
-
/** Returns the controlled visual state for a card. */
|
|
177
|
-
stateForCard?: (card: CardData, index: number) => InteractionVisualState | undefined;
|
|
178
|
-
/** Visual surface renderer. */
|
|
179
|
-
renderCard: (card: CardData, state: InteractionVisualState, index: number) => ReactNode;
|
|
180
|
-
/** Generic UI intent callback. */
|
|
181
|
-
onCardIntent?: (intent: CardIntent<CardData["id"] & string>) => void;
|
|
182
|
-
/** Card width hint for fan geometry. */
|
|
183
|
-
cardSize?: "sm" | "md" | "lg";
|
|
184
|
-
/** Slot for the empty state. Defaults to nothing rendered. */
|
|
185
|
-
renderEmpty?: () => ReactNode;
|
|
186
|
-
/** ARIA label for the hand region. */
|
|
187
|
-
"aria-label"?: string;
|
|
188
|
-
className?: string;
|
|
189
|
-
style?: CSSProperties;
|
|
190
|
-
}
|
|
191
|
-
declare function HandView<CardData extends ViewCard = ViewCard>({ cards, layout, mobileInteraction, stateForCard, renderCard, onCardIntent, cardSize, renderEmpty, "aria-label": ariaLabel, className, style, }: HandViewProps<CardData>): react_jsx_runtime.JSX.Element;
|
|
192
|
-
|
|
193
|
-
export { type CardDropTargetVisualState as C, type HandInteractionPolicy as H, type InteractionVisualState as I, type TargetIntent as T, type CardIntent as a, type HandLayoutKind as b, type HandLayoutPolicy as c, HandView as d, type HandViewProps as e, dropTargetVisualStateDataAttributes as f, visualStateDataAttributes as v };
|