@dreamboard-games/ui-sdk 0.0.43 → 0.0.46

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 (172) hide show
  1. package/dist/components/ActionButton.d.ts.map +1 -1
  2. package/dist/components/ActionButton.js +2 -1
  3. package/dist/components/Card.d.ts +1 -1
  4. package/dist/components/Card.d.ts.map +1 -1
  5. package/dist/components/DiceRoller.d.ts +3 -2
  6. package/dist/components/DiceRoller.d.ts.map +1 -1
  7. package/dist/components/DiceRoller.js +4 -13
  8. package/dist/components/ErrorBoundary.d.ts.map +1 -1
  9. package/dist/components/ErrorBoundary.js +94 -2
  10. package/dist/components/InteractionForm.d.ts +1 -1
  11. package/dist/components/InteractionForm.d.ts.map +1 -1
  12. package/dist/components/InteractionForm.js +29 -15
  13. package/dist/components/PrimaryActionButton.d.ts.map +1 -1
  14. package/dist/components/PrimaryActionButton.js +7 -6
  15. package/dist/components/ResourceCounter.d.ts +59 -25
  16. package/dist/components/ResourceCounter.d.ts.map +1 -1
  17. package/dist/components/ResourceCounter.js +106 -115
  18. package/dist/components/Toast.d.ts +13 -6
  19. package/dist/components/Toast.d.ts.map +1 -1
  20. package/dist/components/Toast.js +10 -5
  21. package/dist/components/board/HexGrid.js +6 -6
  22. package/dist/components/board/target-layer.d.ts +18 -2
  23. package/dist/components/board/target-layer.d.ts.map +1 -1
  24. package/dist/components/board/target-layer.js +20 -3
  25. package/dist/components/index.d.ts +3 -4
  26. package/dist/components/index.d.ts.map +1 -1
  27. package/dist/components/index.js +3 -4
  28. package/dist/components/surfaces/InboxSurface.d.ts.map +1 -1
  29. package/dist/components/surfaces/InboxSurface.js +2 -6
  30. package/dist/components/surfaces/PlayerCardsSurface.js +2 -2
  31. package/dist/components/surfaces/internal/CardZoneRoutedForm.d.ts +7 -0
  32. package/dist/components/surfaces/internal/CardZoneRoutedForm.d.ts.map +1 -0
  33. package/dist/components/surfaces/internal/CardZoneRoutedForm.js +9 -0
  34. package/dist/components/surfaces/internal/DefaultInteractionButton.d.ts.map +1 -1
  35. package/dist/components/surfaces/internal/DefaultInteractionButton.js +5 -8
  36. package/dist/components/surfaces/internal/useCardZoneInteractions.d.ts +2 -2
  37. package/dist/components/surfaces/internal/useCardZoneInteractions.d.ts.map +1 -1
  38. package/dist/components/surfaces/internal/useCardZoneInteractions.js +19 -43
  39. package/dist/context/InteractionDraftContext.d.ts +11 -2
  40. package/dist/context/InteractionDraftContext.d.ts.map +1 -1
  41. package/dist/context/InteractionDraftContext.js +41 -4
  42. package/dist/defaults/components.d.ts +0 -5
  43. package/dist/defaults/components.d.ts.map +1 -1
  44. package/dist/defaults/components.js +7 -11
  45. package/dist/hooks/useBoardInteractions.d.ts +35 -12
  46. package/dist/hooks/useBoardInteractions.d.ts.map +1 -1
  47. package/dist/hooks/useBoardInteractions.js +186 -82
  48. package/dist/hooks/useInteractionHandle.d.ts +1 -1
  49. package/dist/hooks/useInteractionHandle.d.ts.map +1 -1
  50. package/dist/hooks/useInteractionHandle.js +12 -27
  51. package/dist/index.d.ts +11 -17
  52. package/dist/index.d.ts.map +1 -1
  53. package/dist/index.js +5 -14
  54. package/dist/primitives/board.d.ts +53 -3
  55. package/dist/primitives/board.d.ts.map +1 -1
  56. package/dist/primitives/board.js +65 -41
  57. package/dist/primitives/dialog-lifecycle.d.ts +17 -0
  58. package/dist/primitives/dialog-lifecycle.d.ts.map +1 -0
  59. package/dist/primitives/dialog-lifecycle.js +24 -0
  60. package/dist/primitives/dice.d.ts +31 -0
  61. package/dist/primitives/dice.d.ts.map +1 -0
  62. package/dist/primitives/dice.js +33 -0
  63. package/dist/primitives/game.d.ts +55 -0
  64. package/dist/primitives/game.d.ts.map +1 -0
  65. package/dist/primitives/game.js +101 -0
  66. package/dist/primitives/index.d.ts +7 -4
  67. package/dist/primitives/index.d.ts.map +1 -1
  68. package/dist/primitives/index.js +7 -4
  69. package/dist/primitives/interaction-form-binding.d.ts +12 -0
  70. package/dist/primitives/interaction-form-binding.d.ts.map +1 -0
  71. package/dist/primitives/interaction-form-binding.js +14 -0
  72. package/dist/primitives/interaction-submit.d.ts +23 -0
  73. package/dist/primitives/interaction-submit.d.ts.map +1 -0
  74. package/dist/primitives/interaction-submit.js +41 -0
  75. package/dist/primitives/interaction.d.ts +76 -6
  76. package/dist/primitives/interaction.d.ts.map +1 -1
  77. package/dist/primitives/interaction.js +210 -26
  78. package/dist/primitives/player-roster.d.ts +2 -1
  79. package/dist/primitives/player-roster.d.ts.map +1 -1
  80. package/dist/primitives/prompt.d.ts +36 -11
  81. package/dist/primitives/prompt.d.ts.map +1 -1
  82. package/dist/primitives/prompt.js +29 -17
  83. package/dist/primitives/ui.d.ts +9 -0
  84. package/dist/primitives/ui.d.ts.map +1 -0
  85. package/dist/primitives/ui.js +7 -0
  86. package/dist/primitives/zone.d.ts +111 -5
  87. package/dist/primitives/zone.d.ts.map +1 -1
  88. package/dist/primitives/zone.js +349 -9
  89. package/dist/reducer.d.ts +2 -14
  90. package/dist/reducer.d.ts.map +1 -1
  91. package/dist/reducer.js +1 -14
  92. package/dist/runtime/createPluginRuntimeAPI.js +1 -1
  93. package/dist/types/hex-color.d.ts +7 -0
  94. package/dist/types/hex-color.d.ts.map +1 -0
  95. package/dist/types/hex-color.js +13 -0
  96. package/dist/types/player-state.d.ts +28 -14
  97. package/dist/types/player-state.d.ts.map +1 -1
  98. package/dist/types/plugin-state.d.ts +9 -3
  99. package/dist/types/plugin-state.d.ts.map +1 -1
  100. package/dist/ui-contract.d.ts +119 -14
  101. package/dist/ui-contract.d.ts.map +1 -1
  102. package/dist/ui-contract.js +4 -3
  103. package/dist/ui-sdk.d.ts +1637 -1245
  104. package/dist/utils/interaction-inputs.d.ts +8 -5
  105. package/dist/utils/interaction-inputs.d.ts.map +1 -1
  106. package/dist/utils/interaction-inputs.js +82 -14
  107. package/dist/utils/interaction-router.d.ts +31 -0
  108. package/dist/utils/interaction-router.d.ts.map +1 -0
  109. package/dist/utils/interaction-router.js +114 -0
  110. package/package.json +2 -1
  111. package/src/components/ActionButton.tsx +2 -1
  112. package/src/components/Card.tsx +1 -1
  113. package/src/components/DiceRoller.tsx +13 -22
  114. package/src/components/ErrorBoundary.test.tsx +19 -0
  115. package/src/components/ErrorBoundary.tsx +113 -24
  116. package/src/components/InteractionForm.test.tsx +24 -0
  117. package/src/components/InteractionForm.tsx +48 -23
  118. package/src/components/PrimaryActionButton.tsx +19 -5
  119. package/src/components/ResourceCounter.test.tsx +13 -13
  120. package/src/components/ResourceCounter.tsx +238 -244
  121. package/src/components/Toast.tsx +23 -10
  122. package/src/components/__fixtures__/ResourceCounter.fixture.tsx +70 -169
  123. package/src/components/board/HexGrid.tsx +6 -6
  124. package/src/components/board/target-layer.ts +44 -5
  125. package/src/components/index.ts +17 -10
  126. package/src/components/surfaces/InboxSurface.tsx +7 -5
  127. package/src/components/surfaces/PlayerCardsSurface.tsx +6 -6
  128. package/src/components/surfaces/internal/CardZoneRoutedForm.tsx +35 -0
  129. package/src/components/surfaces/internal/DefaultInteractionButton.tsx +17 -7
  130. package/src/components/surfaces/internal/useCardZoneInteractions.ts +25 -67
  131. package/src/context/InteractionDraftContext.tsx +51 -5
  132. package/src/defaults/components.tsx +12 -50
  133. package/src/defaults/defaults.test.tsx +1 -50
  134. package/src/hooks/useBoardInteractions.test.tsx +240 -17
  135. package/src/hooks/useBoardInteractions.ts +330 -105
  136. package/src/hooks/useInteractionHandle.ts +23 -28
  137. package/src/index.test.ts +60 -40
  138. package/src/index.ts +30 -36
  139. package/src/primitives/board.test.tsx +73 -0
  140. package/src/primitives/board.tsx +191 -40
  141. package/src/primitives/dialog-lifecycle.ts +58 -0
  142. package/src/primitives/dice.test.tsx +47 -0
  143. package/src/primitives/dice.tsx +79 -0
  144. package/src/primitives/game.test.tsx +98 -0
  145. package/src/primitives/game.tsx +213 -0
  146. package/src/primitives/index.ts +84 -0
  147. package/src/primitives/interaction-form-binding.tsx +56 -0
  148. package/src/primitives/interaction-submit.ts +90 -0
  149. package/src/primitives/interaction.test.tsx +396 -0
  150. package/src/primitives/interaction.tsx +451 -31
  151. package/src/primitives/player-roster.tsx +2 -1
  152. package/src/primitives/prompt.test.tsx +94 -3
  153. package/src/primitives/prompt.tsx +87 -48
  154. package/src/primitives/ui.test.tsx +131 -0
  155. package/src/primitives/ui.tsx +13 -0
  156. package/src/primitives/zone.test.tsx +305 -0
  157. package/src/primitives/zone.tsx +660 -12
  158. package/src/reducer.ts +7 -20
  159. package/src/runtime/createPluginRuntimeAPI.ts +1 -1
  160. package/src/types/hex-color.ts +20 -0
  161. package/src/types/player-state.ts +36 -18
  162. package/src/types/plugin-state.ts +10 -3
  163. package/src/ui-contract.ts +253 -21
  164. package/src/utils/interaction-inputs.test.ts +400 -0
  165. package/src/utils/interaction-inputs.ts +113 -11
  166. package/src/utils/interaction-router.ts +200 -0
  167. package/type-stubs/manifest-contract.d.ts +42 -0
  168. package/type-stubs/manifest-contract.d.ts.map +1 -0
  169. package/type-stubs/manifest-contract.js +72 -0
  170. package/type-stubs/ui-contract.d.ts +5 -0
  171. package/type-stubs/ui-contract.d.ts.map +1 -0
  172. package/type-stubs/ui-contract.js +1 -0
@@ -3,6 +3,8 @@ import type { PromptKey, PromptOptionKey } from "../ui-contract.js";
3
3
  import type { InteractionDescriptor } from "../types/plugin-state.js";
4
4
  import { type InteractionPartProps, type InteractionRootProps } from "./interaction.js";
5
5
  import { type PrimitiveCommonProps } from "./primitive-props.js";
6
+ import { type InteractionSubmitCallbacks } from "./interaction-submit.js";
7
+ import { type DialogLifecycleState } from "./dialog-lifecycle.js";
6
8
  export type PromptRootProps<Prompt extends string = PromptKey> = InteractionRootProps<Prompt>;
7
9
  export declare function PromptRoot<Prompt extends string = PromptKey>(props: PromptRootProps<Prompt>): import("react/jsx-runtime").JSX.Element;
8
10
  export declare function PromptTitle(props: InteractionPartProps): import("react/jsx-runtime").JSX.Element;
@@ -10,31 +12,54 @@ export declare function PromptMessage(props: InteractionPartProps): import("reac
10
12
  export type PromptOptionProps<Option extends string = PromptOptionKey> = PrimitiveCommonProps & ButtonHTMLAttributes<HTMLButtonElement> & {
11
13
  value: Option;
12
14
  disableWhenUnavailable?: boolean;
13
- onSubmitError?: (error: unknown) => void;
14
- onSubmitSuccess?: () => void;
15
+ onSubmitError?: InteractionSubmitCallbacks["onSubmitError"];
16
+ onSubmitSuccess?: InteractionSubmitCallbacks["onSubmitSuccess"];
15
17
  };
16
18
  export declare function PromptOption<Option extends string = PromptOptionKey>({ value, disabled, disableWhenUnavailable, onClick, onSubmitError, onSubmitSuccess, children, ...props }: PromptOptionProps<Option>): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
17
- export declare function PromptOptions({ children, }: {
18
- children?: (option: {
19
- id: string;
20
- label?: string;
21
- }) => ReactNode;
22
- }): import("react/jsx-runtime").JSX.Element;
19
+ export interface PromptOptionRenderItem {
20
+ id: string;
21
+ label?: string;
22
+ }
23
+ export interface PromptOptionsProps {
24
+ children: (option: PromptOptionRenderItem) => ReactNode;
25
+ }
26
+ export declare function PromptOptions({ children }: PromptOptionsProps): import("react/jsx-runtime").JSX.Element;
27
+ export type PromptDialogState = DialogLifecycleState;
28
+ export interface PromptDialogRenderState<Prompt extends string = PromptKey> {
29
+ prompt: Prompt;
30
+ state: PromptDialogState;
31
+ open: boolean;
32
+ minimized: boolean;
33
+ dismissed: boolean;
34
+ setOpen: (open: boolean) => void;
35
+ restore: () => void;
36
+ minimize: () => void;
37
+ dismiss: () => void;
38
+ }
39
+ export interface PromptDialogProps<Prompt extends string = PromptKey> {
40
+ prompt: Prompt;
41
+ defaultOpen?: boolean;
42
+ onStateChange?: (state: PromptDialogState) => void;
43
+ children: (state: PromptDialogRenderState<Prompt>) => ReactNode;
44
+ }
45
+ export declare function PromptDialog<Prompt extends string = PromptKey>({ prompt, defaultOpen, onStateChange, children, }: PromptDialogProps<Prompt>): import("react/jsx-runtime").JSX.Element;
23
46
  export declare function PromptInboxRoot({ children }: {
24
47
  children: ReactNode;
25
48
  }): import("react/jsx-runtime").JSX.Element;
26
49
  export declare function PromptInboxEmpty({ children }: {
27
50
  children?: ReactNode;
28
51
  }): import("react/jsx-runtime").JSX.Element | null;
29
- export declare function PromptInboxItems({ children, }: {
30
- children?: (prompt: InteractionDescriptor) => ReactNode;
31
- }): import("react/jsx-runtime").JSX.Element;
52
+ export interface PromptInboxItemsProps {
53
+ children: (prompt: InteractionDescriptor) => ReactNode;
54
+ }
55
+ export declare function PromptInboxItems({ children }: PromptInboxItemsProps): import("react/jsx-runtime").JSX.Element;
32
56
  export declare const Prompt: {
33
57
  Root: typeof PromptRoot;
34
58
  Title: typeof PromptTitle;
35
59
  Message: typeof PromptMessage;
36
60
  Option: typeof PromptOption;
37
61
  Options: typeof PromptOptions;
62
+ Dialog: typeof PromptDialog;
38
63
  };
39
64
  export declare const PromptInbox: {
40
65
  Root: typeof PromptInboxRoot;
@@ -1 +1 @@
1
- {"version":3,"file":"prompt.d.ts","sourceRoot":"","sources":["../../src/primitives/prompt.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,oBAAoB,EACzB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAGtE,OAAO,EAKL,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EAC1B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAGL,KAAK,oBAAoB,EAC1B,MAAM,sBAAsB,CAAC;AAE9B,MAAM,MAAM,eAAe,CAAC,MAAM,SAAS,MAAM,GAAG,SAAS,IAC3D,oBAAoB,CAAC,MAAM,CAAC,CAAC;AAE/B,wBAAgB,UAAU,CAAC,MAAM,SAAS,MAAM,GAAG,SAAS,EAC1D,KAAK,EAAE,eAAe,CAAC,MAAM,CAAC,2CAG/B;AAED,wBAAgB,WAAW,CAAC,KAAK,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,CAAC,MAAM,CAAC,2CAU3B;AAkBD,wBAAgB,eAAe,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,2CAOpE;AAED,wBAAgB,gBAAgB,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,CAAC,EAAE,SAAS,CAAA;CAAE,kDAItE;AAED,MAAM,WAAW,qBAAqB;IACpC,QAAQ,EAAE,CAAC,MAAM,EAAE,qBAAqB,KAAK,SAAS,CAAC;CACxD;AAED,wBAAgB,gBAAgB,CAAC,EAAE,QAAQ,EAAE,EAAE,qBAAqB,2CAGnE;AAED,eAAO,MAAM,MAAM;;;;;;;CAOlB,CAAC;AAEF,eAAO,MAAM,WAAW;;;;CAIvB,CAAC"}
@@ -1,10 +1,13 @@
1
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { createContext, useContext, } from "react";
1
+ import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { Fragment, createContext, useContext, useMemo, } from "react";
3
3
  import { useSeatInbox } from "../hooks/useSeatInbox.js";
4
4
  import { interactionInputKeys } from "../utils/interaction-inputs.js";
5
5
  import { interactionLabel } from "../utils/interaction-labels.js";
6
6
  import { InteractionDescription, InteractionLabel, InteractionRoot, useInteractionPrimitiveContext, } from "./interaction.js";
7
7
  import { composeEventHandlers, renderPrimitive, } from "./primitive-props.js";
8
+ import { submitInteractionParams, } from "./interaction-submit.js";
9
+ import { useDialogLifecycle, } from "./dialog-lifecycle.js";
10
+ import { useGameActionError } from "./game.js";
8
11
  export function PromptRoot(props) {
9
12
  return _jsx(InteractionRoot, { ...props });
10
13
  }
@@ -26,13 +29,17 @@ export function PromptMessage(props) {
26
29
  }
27
30
  export function PromptOption({ value, disabled, disableWhenUnavailable = false, onClick, onSubmitError, onSubmitSuccess, children, ...props }) {
28
31
  const { descriptor, handle } = useInteractionPrimitiveContext();
32
+ const gameActionError = useGameActionError();
29
33
  const option = descriptor?.context?.options?.find((candidate) => candidate.id === value);
30
34
  const inputKey = descriptor ? interactionInputKeys(descriptor)[0] : undefined;
35
+ const choice = descriptor?.inputs
36
+ .find((input) => input.key === inputKey)
37
+ ?.domain.choices?.find((candidate) => candidate.value === value);
31
38
  const isDisabled = disabled ??
32
39
  (!handle ||
33
40
  !inputKey ||
34
41
  handle.status !== "open" ||
35
- option?.data === false ||
42
+ choice?.disabled === true ||
36
43
  (disableWhenUnavailable && !descriptor?.available));
37
44
  return renderPrimitive("button", {
38
45
  type: "button",
@@ -43,27 +50,31 @@ export function PromptOption({ value, disabled, disableWhenUnavailable = false,
43
50
  "data-option-value": value,
44
51
  "data-disabled": isDisabled || undefined,
45
52
  "data-available": descriptor?.available ?? false,
53
+ "data-disabled-reason": choice?.disabledReason,
54
+ title: props.title ?? choice?.disabledReason,
46
55
  onClick: composeEventHandlers(onClick, () => {
47
56
  if (!handle || !inputKey || isDisabled)
48
57
  return;
49
- void handle
50
- .submit({ [inputKey]: value })
51
- .then(() => onSubmitSuccess?.())
52
- .catch((error) => {
53
- if (onSubmitError) {
54
- onSubmitError(error);
55
- return;
56
- }
57
- console.error(error);
58
- });
58
+ void submitInteractionParams(handle, { [inputKey]: value }, {
59
+ onSubmitSuccess,
60
+ onSubmitError: onSubmitError ?? gameActionError ?? undefined,
61
+ }, { unhandledError: "log" });
59
62
  }),
60
63
  children: children ?? option?.label ?? value,
61
64
  });
62
65
  }
63
- export function PromptOptions({ children, }) {
66
+ export function PromptOptions({ children }) {
64
67
  const { descriptor } = useInteractionPrimitiveContext();
65
68
  const options = descriptor?.context?.options ?? [];
66
- return (_jsx(_Fragment, { children: options.map((option) => children ? (children(option)) : (_jsx(PromptOption, { value: option.id }, option.id))) }));
69
+ return (_jsx(_Fragment, { children: options.map((option) => (_jsx(Fragment, { children: children(option) }, option.id))) }));
70
+ }
71
+ export function PromptDialog({ prompt, defaultOpen = true, onStateChange, children, }) {
72
+ const lifecycle = useDialogLifecycle({ defaultOpen, onStateChange });
73
+ const renderState = useMemo(() => ({
74
+ prompt,
75
+ ...lifecycle,
76
+ }), [lifecycle, prompt]);
77
+ return _jsx(_Fragment, { children: children(renderState) });
67
78
  }
68
79
  const PromptInboxContext = createContext(null);
69
80
  function usePromptInboxContext() {
@@ -83,9 +94,9 @@ export function PromptInboxEmpty({ children }) {
83
94
  return null;
84
95
  return _jsx(_Fragment, { children: children });
85
96
  }
86
- export function PromptInboxItems({ children, }) {
97
+ export function PromptInboxItems({ children }) {
87
98
  const { prompts } = usePromptInboxContext();
88
- return (_jsx(_Fragment, { children: prompts.map((prompt) => children ? (children(prompt)) : (_jsxs(PromptRoot, { interaction: prompt.interactionKey, children: [_jsx(PromptTitle, {}), _jsx(PromptMessage, {}), _jsx(PromptOptions, {})] }, prompt.interactionKey))) }));
99
+ return _jsx(_Fragment, { children: prompts.map((prompt) => children(prompt)) });
89
100
  }
90
101
  export const Prompt = {
91
102
  Root: PromptRoot,
@@ -93,6 +104,7 @@ export const Prompt = {
93
104
  Message: PromptMessage,
94
105
  Option: PromptOption,
95
106
  Options: PromptOptions,
107
+ Dialog: PromptDialog,
96
108
  };
97
109
  export const PromptInbox = {
98
110
  Root: PromptInboxRoot,
@@ -0,0 +1,9 @@
1
+ import type { ReactNode } from "react";
2
+ export interface UIRootProps {
3
+ children: ReactNode;
4
+ }
5
+ export declare function UIRoot({ children }: UIRootProps): import("react/jsx-runtime").JSX.Element;
6
+ export declare const UI: {
7
+ Root: typeof UIRoot;
8
+ };
9
+ //# sourceMappingURL=ui.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ui.d.ts","sourceRoot":"","sources":["../../src/primitives/ui.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,MAAM,WAAW,WAAW;IAC1B,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,wBAAgB,MAAM,CAAC,EAAE,QAAQ,EAAE,EAAE,WAAW,2CAE/C;AAED,eAAO,MAAM,EAAE;;CAEd,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
2
+ export function UIRoot({ children }) {
3
+ return _jsx(_Fragment, { children: children });
4
+ }
5
+ export const UI = {
6
+ Root: UIRoot,
7
+ };
@@ -1,5 +1,6 @@
1
- import { type HTMLAttributes } from "react";
2
- import type { ZoneHandlesSnapshot } from "../types/plugin-state.js";
1
+ import { type ButtonHTMLAttributes, type HTMLAttributes, type ReactNode } from "react";
2
+ import type { ViewCard } from "@dreamboard/sdk-types";
3
+ import type { InteractionDescriptor, ZoneHandlesSnapshot } from "../types/plugin-state.js";
3
4
  import type { ZoneKey } from "../ui-contract.js";
4
5
  import { type PrimitiveCommonProps } from "./primitive-props.js";
5
6
  interface ZoneContextValue {
@@ -10,22 +11,127 @@ interface ZoneCardContextValue {
10
11
  zone: string;
11
12
  cardId: string;
12
13
  }
14
+ /**
15
+ * An item rendered by a zone primitive. Discriminated by `hidden`:
16
+ *
17
+ * - `hidden: false` — fully hydrated from the zone projection. Carries the
18
+ * authored card type, properties, and reducer-projected interaction state.
19
+ * - `hidden: true` — the zone snapshot exposes the card id but withholds its
20
+ * contents (e.g. opponent zones, or a zone that is projected count-only).
21
+ * The render contract is honest about not knowing the type; authors must
22
+ * narrow on `hidden` before reading `cardType` / `properties`.
23
+ *
24
+ * Replaces the previous silent fallback that widened `cardType` to the
25
+ * untyped string `"unknown"` — see SDK Design Principles §2 (strong contracts
26
+ * over comments).
27
+ */
28
+ export type ZoneCardRenderItem<CardIdValue extends string = string, CardTypeValue extends string = string, Properties extends Record<string, unknown> = Record<string, unknown>> = HydratedZoneCardRenderItem<CardIdValue, CardTypeValue, Properties> | HiddenZoneCardRenderItem<CardIdValue>;
29
+ export interface HydratedZoneCardRenderItem<CardIdValue extends string = string, CardTypeValue extends string = string, Properties extends Record<string, unknown> = Record<string, unknown>> extends ViewCard<CardIdValue, CardTypeValue, Properties> {
30
+ zone: string;
31
+ index: number;
32
+ hidden: false;
33
+ playable: boolean;
34
+ interactions: readonly InteractionDescriptor[];
35
+ }
36
+ export interface HiddenZoneCardRenderItem<CardIdValue extends string = string> {
37
+ id: CardIdValue;
38
+ zone: string;
39
+ index: number;
40
+ hidden: true;
41
+ }
42
+ export interface ZonePileContextValue {
43
+ zone: string;
44
+ label: string;
45
+ count: number;
46
+ cards: readonly string[];
47
+ items: readonly ZoneCardRenderItem[];
48
+ hasVisibleCards: boolean;
49
+ isHidden: boolean;
50
+ description: string | null;
51
+ }
13
52
  export declare function useZonePrimitiveContext(): ZoneContextValue;
53
+ export declare function useOptionalZonePrimitiveContext(): ZoneContextValue | null;
14
54
  export declare function useZoneCardContext(): ZoneCardContextValue | null;
55
+ export declare function useZonePileContext(): ZonePileContextValue;
15
56
  export interface ZoneRootProps<Zone extends string = ZoneKey> extends PrimitiveCommonProps, HTMLAttributes<HTMLElement> {
16
57
  zone: Zone;
17
58
  }
18
59
  export declare function ZoneRoot<Zone extends string = ZoneKey>({ zone, children, ...props }: ZoneRootProps<Zone>): import("react/jsx-runtime").JSX.Element;
19
- export type ZoneListProps = PrimitiveCommonProps & HTMLAttributes<HTMLElement>;
20
- export declare function ZoneList({ children, ...props }: ZoneListProps): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
60
+ export interface ZoneListProps extends Omit<PrimitiveCommonProps, "children">, Omit<HTMLAttributes<HTMLElement>, "children"> {
61
+ children?: ReactNode | ((card: ZoneCardRenderItem) => ReactNode);
62
+ empty?: ReactNode;
63
+ sort?: (a: ZoneCardRenderItem, b: ZoneCardRenderItem) => number;
64
+ }
65
+ export declare function ZoneList({ children, empty, sort, ...props }: ZoneListProps): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
21
66
  export interface ZoneItemProps extends PrimitiveCommonProps, HTMLAttributes<HTMLElement> {
22
- card: string;
67
+ card: string | ZoneCardRenderItem;
23
68
  }
24
69
  export declare function ZoneItem({ card, children, ...props }: ZoneItemProps): import("react/jsx-runtime").JSX.Element;
70
+ export interface ZoneCardAtProps<Zone extends string = ZoneKey> extends Omit<ZoneItemProps, "card" | "children"> {
71
+ zone?: Zone;
72
+ index: number;
73
+ children?: ReactNode | ((card: ZoneCardRenderItem) => ReactNode);
74
+ empty?: ReactNode;
75
+ }
76
+ export declare function ZoneCardAt<Zone extends string = ZoneKey>({ zone, ...props }: ZoneCardAtProps<Zone>): import("react/jsx-runtime").JSX.Element;
77
+ export type ZoneTopCardProps<Zone extends string = ZoneKey> = Omit<ZoneCardAtProps<Zone>, "index">;
78
+ export declare function ZoneTopCard<Zone extends string = ZoneKey>(props: ZoneTopCardProps<Zone>): import("react/jsx-runtime").JSX.Element;
79
+ export type ZoneCardActionExtraInputs = Record<string, unknown> | ((cardId: string) => Record<string, unknown>);
80
+ export interface ZoneCardActionProps<Card extends string = string> extends PrimitiveCommonProps, Omit<ButtonHTMLAttributes<HTMLButtonElement>, "onSelect"> {
81
+ card?: Card;
82
+ interaction?: string;
83
+ input?: string;
84
+ extraInputs?: ZoneCardActionExtraInputs;
85
+ onSelect?: (result: ZoneCardActionResult) => void;
86
+ onSelectError?: (error: unknown) => void;
87
+ }
88
+ export type ZoneCardActionResult = {
89
+ status: "none";
90
+ } | {
91
+ status: "pending";
92
+ interactionKey: string;
93
+ descriptor: InteractionDescriptor;
94
+ missingInputs: readonly string[];
95
+ } | {
96
+ status: "submitted";
97
+ interactionKey: string;
98
+ descriptor: InteractionDescriptor;
99
+ };
100
+ export declare function ZoneCardAction<Card extends string = string>({ card, interaction, input, extraInputs, onSelect, onSelectError, disabled, onClick, children, ...props }: ZoneCardActionProps<Card>): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
101
+ export interface ZonePileRootProps<Zone extends string = ZoneKey> extends Omit<ZoneRootProps<Zone>, "children"> {
102
+ label: string;
103
+ children?: ReactNode;
104
+ hiddenDescription?: string | null;
105
+ emptyDescription?: string | null;
106
+ visibleDescription?: ((count: number) => string) | null;
107
+ }
108
+ export declare function ZonePileRoot<Zone extends string = ZoneKey>({ zone, label, hiddenDescription, emptyDescription, visibleDescription, children, ...props }: ZonePileRootProps<Zone>): import("react/jsx-runtime").JSX.Element;
109
+ export interface ZonePileTriggerProps extends PrimitiveCommonProps, ButtonHTMLAttributes<HTMLButtonElement> {
110
+ }
111
+ export declare function ZonePileTrigger({ children, ...props }: ZonePileTriggerProps): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
112
+ export type ZonePileLabelProps = PrimitiveCommonProps & HTMLAttributes<HTMLElement>;
113
+ export declare function ZonePileLabel({ children, ...props }: ZonePileLabelProps): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
114
+ export type ZonePileCountProps = PrimitiveCommonProps & HTMLAttributes<HTMLElement>;
115
+ export declare function ZonePileCount({ children, ...props }: ZonePileCountProps): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
116
+ export type ZonePileDescriptionProps = PrimitiveCommonProps & HTMLAttributes<HTMLElement>;
117
+ export declare function ZonePileDescription({ children, ...props }: ZonePileDescriptionProps): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | null;
118
+ export interface ZonePileCardsProps extends Omit<ZoneListProps, "children"> {
119
+ renderCard: (card: ZoneCardRenderItem) => ReactNode;
120
+ }
121
+ export declare function ZonePileCards({ renderCard, ...props }: ZonePileCardsProps): import("react/jsx-runtime").JSX.Element | null;
25
122
  export declare const Zone: {
26
123
  Root: typeof ZoneRoot;
27
124
  List: typeof ZoneList;
28
125
  Item: typeof ZoneItem;
126
+ CardAt: typeof ZoneCardAt;
127
+ TopCard: typeof ZoneTopCard;
128
+ CardAction: typeof ZoneCardAction;
129
+ PileRoot: typeof ZonePileRoot;
130
+ PileTrigger: typeof ZonePileTrigger;
131
+ PileLabel: typeof ZonePileLabel;
132
+ PileCount: typeof ZonePileCount;
133
+ PileDescription: typeof ZonePileDescription;
134
+ PileCards: typeof ZonePileCards;
29
135
  };
30
136
  export {};
31
137
  //# sourceMappingURL=zone.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"zone.d.ts","sourceRoot":"","sources":["../../src/primitives/zone.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAsC,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AAEhF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AACpE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAEL,KAAK,oBAAoB,EAC1B,MAAM,sBAAsB,CAAC;AAE9B,UAAU,gBAAgB;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,mBAAmB,GAAG,IAAI,CAAC;CACtC;AAED,UAAU,oBAAoB;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB;AAKD,wBAAgB,uBAAuB,IAAI,gBAAgB,CAM1D;AAED,wBAAgB,kBAAkB,IAAI,oBAAoB,GAAG,IAAI,CAEhE;AAED,MAAM,WAAW,aAAa,CAAC,IAAI,SAAS,MAAM,GAAG,OAAO,CAC1D,SAAQ,oBAAoB,EAC1B,cAAc,CAAC,WAAW,CAAC;IAC7B,IAAI,EAAE,IAAI,CAAC;CACZ;AAED,wBAAgB,QAAQ,CAAC,IAAI,SAAS,MAAM,GAAG,OAAO,EAAE,EACtD,IAAI,EACJ,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,aAAa,CAAC,IAAI,CAAC,2CAkBrB;AAED,MAAM,MAAM,aAAa,GAAG,oBAAoB,GAAG,cAAc,CAAC,WAAW,CAAC,CAAC;AAE/E,wBAAgB,QAAQ,CAAC,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,aAAa,8FAW7D;AAED,MAAM,WAAW,aACf,SAAQ,oBAAoB,EAC1B,cAAc,CAAC,WAAW,CAAC;IAC7B,IAAI,EAAE,MAAM,CAAC;CACd;AAED,wBAAg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