@dreamboard-games/sdk 0.4.0-alpha.3 → 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.
Files changed (39) hide show
  1. package/REFERENCE.md +6 -22
  2. package/dist/HandView-x8MhbhFl.d.ts +79 -0
  3. package/dist/{ResourceCounter-BuiNstXs.d.ts → ResourceCounter-BFxJknqp.d.ts} +1 -9
  4. package/dist/{ThemeProvider-B1sIoBlX.d.ts → ThemeProvider-DRalAWzY.d.ts} +1 -1
  5. package/dist/authoring/index.js +1 -1
  6. package/dist/{chunk-45FI6XII.js → chunk-E3X552YM.js} +3 -11
  7. package/dist/chunk-E3X552YM.js.map +1 -0
  8. package/dist/{chunk-BKD7XAWB.js → chunk-LKJLAGND.js} +2 -2
  9. package/dist/{chunk-WOWFONLZ.js → chunk-QOFFRHZR.js} +6 -6
  10. package/dist/chunk-QOFFRHZR.js.map +1 -0
  11. package/dist/{chunk-DQ7GCD6C.js → chunk-SUMZ5OEH.js} +2 -2
  12. package/dist/{chunk-DQ7GCD6C.js.map → chunk-SUMZ5OEH.js.map} +1 -1
  13. package/dist/{chunk-6JQFGSLD.js → chunk-TTISZQNI.js} +13 -15
  14. package/dist/{chunk-6JQFGSLD.js.map → chunk-TTISZQNI.js.map} +1 -1
  15. package/dist/{chunk-FWVV2X74.js → chunk-XZ667T4K.js} +2 -2
  16. package/dist/{components-BbWPnZCF.d.ts → components-B7hFaEn_.d.ts} +3 -3
  17. package/dist/{hex-board-view-Kz9Q_zsv.d.ts → hex-board-view-BFlWDb9k.d.ts} +116 -1
  18. package/dist/{index-BLwlj7mO.d.ts → index-gjxQichK.d.ts} +4 -3
  19. package/dist/index.js +2 -2
  20. package/dist/package-set.d.ts +2 -2
  21. package/dist/package-set.js +2 -2
  22. package/dist/runtime/primitives.d.ts +20 -23
  23. package/dist/runtime/primitives.js +3 -3
  24. package/dist/runtime/workspace-contract.d.ts +6 -6
  25. package/dist/runtime/workspace-contract.js +4 -4
  26. package/dist/runtime.d.ts +6 -6
  27. package/dist/runtime.js +4 -4
  28. package/dist/ui/components.d.ts +4 -4
  29. package/dist/ui/components.js +1 -3
  30. package/dist/ui/plugin-styles.css +1 -1
  31. package/dist/{ui-contract-CY7cxsCC.d.ts → ui-contract-B4NjRlvC.d.ts} +2 -2
  32. package/dist/ui.d.ts +7 -7
  33. package/dist/ui.js +2 -4
  34. package/package.json +1 -1
  35. package/dist/HandView-PYDmehVD.d.ts +0 -193
  36. package/dist/chunk-45FI6XII.js.map +0 -1
  37. package/dist/chunk-WOWFONLZ.js.map +0 -1
  38. /package/dist/{chunk-BKD7XAWB.js.map → chunk-LKJLAGND.js.map} +0 -0
  39. /package/dist/{chunk-FWVV2X74.js.map → chunk-XZ667T4K.js.map} +0 -0
package/REFERENCE.md CHANGED
@@ -47,7 +47,7 @@ _No JSDoc summary is available yet._
47
47
 
48
48
  ```ts
49
49
  const DREAMBOARD_SDK_PACKAGES: {
50
- readonly "@dreamboard-games/sdk": "0.4.0-alpha.3";
50
+ readonly "@dreamboard-games/sdk": "0.4.0-alpha.4";
51
51
  };
52
52
  ```
53
53
 
@@ -56,7 +56,7 @@ _No JSDoc summary is available yet._
56
56
  ### DREAMBOARD_SDK_VERSION
57
57
 
58
58
  ```ts
59
- const DREAMBOARD_SDK_VERSION: "0.4.0-alpha.3";
59
+ const DREAMBOARD_SDK_VERSION: "0.4.0-alpha.4";
60
60
  ```
61
61
 
62
62
  _No JSDoc summary is available yet._
@@ -95,7 +95,7 @@ _No JSDoc summary is available yet._
95
95
 
96
96
  ```ts
97
97
  const DREAMBOARD_SDK_PACKAGES: {
98
- readonly "@dreamboard-games/sdk": "0.4.0-alpha.3";
98
+ readonly "@dreamboard-games/sdk": "0.4.0-alpha.4";
99
99
  };
100
100
  ```
101
101
 
@@ -104,7 +104,7 @@ _No JSDoc summary is available yet._
104
104
  ### DREAMBOARD_SDK_VERSION
105
105
 
106
106
  ```ts
107
- const DREAMBOARD_SDK_VERSION: "0.4.0-alpha.3";
107
+ const DREAMBOARD_SDK_VERSION: "0.4.0-alpha.4";
108
108
  ```
109
109
 
110
110
  _No JSDoc summary is available yet._
@@ -11981,14 +11981,6 @@ function useIsMobile(breakpoint?: number): boolean;
11981
11981
 
11982
11982
  Hook to detect if the user is on a mobile/small screen device
11983
11983
 
11984
- ### useMobileHandTrayActive
11985
-
11986
- ```ts
11987
- function useMobileHandTrayActive(): boolean;
11988
- ```
11989
-
11990
- Whether the mobile hand tray is currently presenting hands — i.e. the viewport is below the mobile breakpoint and at least one primary/auxiliary hand has registered. Authors can use this to drop redundant inline hand chrome (labels, framing) that the tray already provides, instead of guessing the breakpoint with a CSS media query. Returns `false` outside `<UI.Root>`.
11991
-
11992
11984
  ### useOverlayInsets
11993
11985
 
11994
11986
  ```ts
@@ -14910,14 +14902,6 @@ function useChromeSuppression(id: string, suppressed: boolean): void;
14910
14902
 
14911
14903
  _No JSDoc summary is available yet._
14912
14904
 
14913
- ### useMobileHandTrayActive
14914
-
14915
- ```ts
14916
- function useMobileHandTrayActive(): boolean;
14917
- ```
14918
-
14919
- Whether the mobile hand tray is currently presenting hands — i.e. the viewport is below the mobile breakpoint and at least one primary/auxiliary hand has registered. Authors can use this to drop redundant inline hand chrome (labels, framing) that the tray already provides, instead of guessing the breakpoint with a CSS media query. Returns `false` outside `<UI.Root>`.
14920
-
14921
14905
  ### useOverlayInsets
14922
14906
 
14923
14907
  ```ts
@@ -16797,8 +16781,8 @@ function HandSurfaceView<Card extends ZoneCardRenderItem>({
16797
16781
  ariaLabel,
16798
16782
  onIntentRouted,
16799
16783
  onSelectionSummary,
16800
- renderSummary,
16801
- renderActions,
16784
+ summarySlot,
16785
+ actionsSlot,
16802
16786
  className,
16803
16787
  }: HandSurfaceViewProps<Card>): react_jsx_runtime.JSX.Element;
16804
16788
  ```
@@ -0,0 +1,79 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { ReactNode, CSSProperties } from 'react';
3
+ import { ViewCard } from './types.js';
4
+ import { J as InteractionVisualState, f as CardIntent } from './hex-board-view-BFlWDb9k.js';
5
+
6
+ /**
7
+ * Pure layout math for the controlled `HandView`.
8
+ *
9
+ * The functions here are independent of React and DOM measurement so they can
10
+ * be unit-tested directly. {@link computeFanLayout} matches the algorithm
11
+ * documented in `docs/references/ui-sdk-mobile-hand-and-card-interactions.md`,
12
+ * and {@link chooseHandLayoutMode} translates a measured container width and a
13
+ * caller policy into the actual presentation mode the hand should render.
14
+ */
15
+ type HandPresentationMode = "fan" | "compressed-fan" | "strip" | "tray";
16
+
17
+ /**
18
+ * Deterministic pointer recognizer for the controlled hand view.
19
+ *
20
+ * The engine is independent from React: it consumes pointer events and a
21
+ * caller-supplied callbacks bag, and produces semantic gesture events. It
22
+ * owns no DOM, emits no `CardIntent`, and does not track the drag-lifecycle
23
+ * `phase` — that responsibility lives in `CardDragSurface`. The engine only
24
+ * recognizes `tap`, `previewStart`/`previewEnd`, `liftStart`/`liftMove`/
25
+ * `liftEnd`/`liftCancel`, and a `horizontalBrowse` informational signal.
26
+ *
27
+ * The thresholds match
28
+ * `docs/references/ui-sdk-mobile-hand-and-card-interactions.md`:
29
+ *
30
+ * | Threshold | Default |
31
+ * | ------------------------- | ----------- |
32
+ * | Press preview delay | `220ms` |
33
+ * | Movement slop | `8px` |
34
+ * | Axis bias | `1.25` |
35
+ * | Drag lift distance | `28px` |
36
+ *
37
+ * Callers wire the engine's `handlePointerDown` / `handlePointerMove` /
38
+ * `handlePointerUp` / `handlePointerCancel` to the matching DOM events on
39
+ * each interactive card.
40
+ */
41
+ type HandInteractionPolicy = "direct-activate" | "drag-to-target";
42
+
43
+ type HandLayoutKind = HandPresentationMode | "stack";
44
+ interface HandLayoutPolicy {
45
+ desktop?: HandLayoutKind;
46
+ mobile?: HandLayoutKind;
47
+ }
48
+ interface HandViewProps<CardData extends ViewCard = ViewCard> {
49
+ cards: readonly CardData[];
50
+ /**
51
+ * Layout policy. Pass a single layout kind to use the same layout in every
52
+ * viewport, or pass `{ desktop, mobile }` for a measured-width decision.
53
+ * Defaults to `{ desktop: "fan", mobile: "tray" }`.
54
+ */
55
+ layout?: HandLayoutKind | HandLayoutPolicy;
56
+ /**
57
+ * Mobile interaction policy. Defaults to `direct-activate`. Use
58
+ * `drag-to-target` together with a surrounding `CardDragSurface` and one
59
+ * or more `CardDropTargetView` children.
60
+ */
61
+ mobileInteraction?: HandInteractionPolicy;
62
+ /** Returns the controlled visual state for a card. */
63
+ stateForCard?: (card: CardData, index: number) => InteractionVisualState | undefined;
64
+ /** Visual surface renderer. */
65
+ renderCard: (card: CardData, state: InteractionVisualState, index: number) => ReactNode;
66
+ /** Generic UI intent callback. */
67
+ onCardIntent?: (intent: CardIntent<CardData["id"] & string>) => void;
68
+ /** Card width hint for fan geometry. */
69
+ cardSize?: "sm" | "md" | "lg";
70
+ /** Slot for the empty state. Defaults to nothing rendered. */
71
+ renderEmpty?: () => ReactNode;
72
+ /** ARIA label for the hand region. */
73
+ "aria-label"?: string;
74
+ className?: string;
75
+ style?: CSSProperties;
76
+ }
77
+ 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;
78
+
79
+ export { type HandInteractionPolicy as H, type HandLayoutKind as a, type HandLayoutPolicy as b, HandView as c, type HandViewProps as d };
@@ -20,14 +20,6 @@ declare function MobileHandTrayProvider({ children }: {
20
20
  children: ReactNode;
21
21
  }): react_jsx_runtime.JSX.Element;
22
22
  declare function useRegisterMobileHand(hand: MobileHandRegistration): void;
23
- /**
24
- * Whether the mobile hand tray is currently presenting hands — i.e. the
25
- * viewport is below the mobile breakpoint and at least one primary/auxiliary
26
- * hand has registered. Authors can use this to drop redundant inline hand
27
- * chrome (labels, framing) that the tray already provides, instead of guessing
28
- * the breakpoint with a CSS media query. Returns `false` outside `<UI.Root>`.
29
- */
30
- declare function useMobileHandTrayActive(): boolean;
31
23
  declare function useOverlayInsets(): {
32
24
  bottom: number;
33
25
  };
@@ -103,4 +95,4 @@ declare const ResourceCounter: {
103
95
  Label: typeof ResourceCounterLabel;
104
96
  };
105
97
 
106
- export { type BoundResourceCounterRootProps as B, type HandRole as H, type MobileHandRegistration as M, ResourceCounter as R, MobileHandTrayProvider as a, type ResourceCounterComponents as b, ResourceCounterCount as c, ResourceCounterIcon as d, ResourceCounterItem as e, type ResourceCounterItemState as f, ResourceCounterLabel as g, type ResourceCounterPartProps as h, type ResourceCounterProps as i, ResourceCounterRoot as j, type ResourceCounterRootProps as k, type ResourceDisplayConfig as l, type ResourceIconProps as m, createResourceCounter as n, useOverlayInsets as o, useRegisterBottomOverlayInset as p, useRegisterMobileHand as q, useMobileHandTrayActive as u };
98
+ export { type BoundResourceCounterRootProps as B, type HandRole as H, type MobileHandRegistration as M, ResourceCounter as R, MobileHandTrayProvider as a, type ResourceCounterComponents as b, ResourceCounterCount as c, ResourceCounterIcon as d, ResourceCounterItem as e, type ResourceCounterItemState as f, ResourceCounterLabel as g, type ResourceCounterPartProps as h, type ResourceCounterProps as i, ResourceCounterRoot as j, type ResourceCounterRootProps as k, type ResourceDisplayConfig as l, type ResourceIconProps as m, createResourceCounter as n, useRegisterBottomOverlayInset as o, useRegisterMobileHand as p, useOverlayInsets as u };
@@ -1,6 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { CSSProperties, ReactNode } from 'react';
3
- import { $ as Theme, a1 as ThemeOverride } from './hex-board-view-Kz9Q_zsv.js';
3
+ import { a3 as Theme, a5 as ThemeOverride } from './hex-board-view-BFlWDb9k.js';
4
4
 
5
5
  /**
6
6
  * The set of preset theme ids ships in `@dreamboard-games/sdk/ui`. Authors
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  GENERATED_AUTHORING_METADATA
3
- } from "../chunk-DQ7GCD6C.js";
3
+ } from "../chunk-SUMZ5OEH.js";
4
4
  import {
5
5
  AUTHORITATIVE_GENERATED_FILES,
6
6
  SEED_FILES,
@@ -4716,9 +4716,6 @@ var MobileHandTrayContext = createContext4(
4716
4716
  var OverlayInsetContext = createContext4(
4717
4717
  null
4718
4718
  );
4719
- var MobileHandTrayStateContext = createContext4({
4720
- active: false
4721
- });
4722
4719
  var ROLE_PRIORITY = {
4723
4720
  task: 0,
4724
4721
  primary: 1,
@@ -4797,8 +4794,7 @@ function MobileHandTrayProvider({ children }) {
4797
4794
  [handsById]
4798
4795
  );
4799
4796
  const trayActive = isMobile && hands.length > 0;
4800
- const stateValue = useMemo9(() => ({ active: trayActive }), [trayActive]);
4801
- return /* @__PURE__ */ jsx14(MobileHandTrayContext.Provider, { value, children: /* @__PURE__ */ jsx14(OverlayInsetContext.Provider, { value: overlayValue, children: /* @__PURE__ */ jsxs6(MobileHandTrayStateContext.Provider, { value: stateValue, children: [
4797
+ return /* @__PURE__ */ jsx14(MobileHandTrayContext.Provider, { value, children: /* @__PURE__ */ jsxs6(OverlayInsetContext.Provider, { value: overlayValue, children: [
4802
4798
  /* @__PURE__ */ jsx14(
4803
4799
  "div",
4804
4800
  {
@@ -4810,7 +4806,7 @@ function MobileHandTrayProvider({ children }) {
4810
4806
  }
4811
4807
  ),
4812
4808
  trayActive ? /* @__PURE__ */ jsx14(MobileHandTray, { hands }) : null
4813
- ] }) }) });
4809
+ ] }) });
4814
4810
  }
4815
4811
  function useRegisterMobileHand(hand) {
4816
4812
  const context = useContext4(MobileHandTrayContext);
@@ -4821,9 +4817,6 @@ function useRegisterMobileHand(hand) {
4821
4817
  }
4822
4818
  useEffect10(() => context.registerHand(hand), [context, hand]);
4823
4819
  }
4824
- function useMobileHandTrayActive() {
4825
- return useContext4(MobileHandTrayStateContext).active;
4826
- }
4827
4820
  function useOverlayInsets() {
4828
4821
  const context = useContext4(OverlayInsetContext);
4829
4822
  return { bottom: context?.bottomInset ?? 0 };
@@ -11234,7 +11227,6 @@ export {
11234
11227
  HandView,
11235
11228
  MobileHandTrayProvider,
11236
11229
  useRegisterMobileHand,
11237
- useMobileHandTrayActive,
11238
11230
  useOverlayInsets,
11239
11231
  useRegisterBottomOverlayInset,
11240
11232
  PlayArea,
@@ -11313,4 +11305,4 @@ export {
11313
11305
  HexGrid,
11314
11306
  createHexBoardView
11315
11307
  };
11316
- //# sourceMappingURL=chunk-45FI6XII.js.map
11308
+ //# sourceMappingURL=chunk-E3X552YM.js.map