@dreamboard-games/sdk 0.2.0 → 0.2.1-alpha.1
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/dist/{ThemeProvider-fy0_QzgO.d.ts → ThemeProvider-BBMVT3KG.d.ts} +1 -1
- package/dist/attributes-BeRyboMS.d.ts +279 -0
- package/dist/browser-interaction.d.ts +708 -0
- package/dist/browser-interaction.js +106 -0
- package/dist/browser-interaction.js.map +1 -0
- package/dist/{bundle-TIZcw8LB.d.ts → bundle-CDd5FKeD.d.ts} +3 -1
- package/dist/{chunk-U5C6BONG.js → chunk-326PGVAA.js} +2 -2
- package/dist/{chunk-VFTAA4WO.js → chunk-MKXPVOUT.js} +4 -2
- package/dist/chunk-MKXPVOUT.js.map +1 -0
- package/dist/{chunk-GKKBPPSW.js → chunk-MZNVHMJ5.js} +4 -4
- package/dist/{chunk-KAELH4KC.js → chunk-NKCRKGR2.js} +2 -2
- package/dist/{chunk-WN74KVNY.js → chunk-PEI3FIL2.js} +2 -2
- package/dist/chunk-PEI3FIL2.js.map +1 -0
- package/dist/chunk-QLG6VEMW.js +1691 -0
- package/dist/chunk-QLG6VEMW.js.map +1 -0
- package/dist/{chunk-WYPQ3GG5.js → chunk-WG4JQL3S.js} +4 -1
- package/dist/{chunk-WYPQ3GG5.js.map → chunk-WG4JQL3S.js.map} +1 -1
- package/dist/{chunk-7YAHLYBR.js → chunk-XV6D3ET4.js} +8 -4
- package/dist/{chunk-7YAHLYBR.js.map → chunk-XV6D3ET4.js.map} +1 -1
- package/dist/{chunk-TDSWKVZ4.js → chunk-ZABVH7AO.js} +1236 -17
- package/dist/chunk-ZABVH7AO.js.map +1 -0
- package/dist/{components-D5ZRE2Hl.d.ts → components-BoiVSYqx.d.ts} +1 -1
- package/dist/generated/runtime/primitives.d.ts +5 -4
- package/dist/generated/runtime/primitives.js +4 -3
- package/dist/generated/runtime-api.d.ts +1 -1
- package/dist/generated/runtime.d.ts +5 -4
- package/dist/generated/runtime.js +7 -6
- package/dist/generated/workspace-contract.d.ts +5 -4
- package/dist/generated/workspace-contract.js +6 -5
- package/dist/{hex-board-view-D_07hO6O.d.ts → hex-board-view-1iAyJRFn.d.ts} +1 -0
- package/dist/index.js +1 -1
- package/dist/infrastructure/reducer-bundle-abi.d.ts +113 -113
- package/dist/infrastructure/reducer-bundle-abi.js +1 -1
- package/dist/package-set.d.ts +2 -2
- package/dist/package-set.js +1 -1
- package/dist/reducer.d.ts +1 -1
- package/dist/reducer.js +305 -12
- package/dist/reducer.js.map +1 -1
- package/dist/runtime/primitives.d.ts +6 -5
- package/dist/runtime/primitives.js +4 -3
- package/dist/runtime/workspace-contract.d.ts +6 -5
- package/dist/runtime/workspace-contract.js +6 -5
- package/dist/{runtime-api-DWxvTr-O.d.ts → runtime-api-CPLm_XDG.d.ts} +6 -0
- package/dist/runtime.d.ts +5 -4
- package/dist/runtime.js +6 -5
- package/dist/testing.d.ts +2 -2
- package/dist/ui/components.d.ts +2 -2
- package/dist/ui/components.js +1 -1
- package/dist/{ui-contract-iQfTtUSL.d.ts → ui-contract-rzKBwOLC.d.ts} +5 -3
- package/dist/ui.d.ts +5 -5
- package/dist/ui.js +2 -2
- package/package.json +15 -9
- package/src/browser-interaction/attributes.ts +211 -0
- package/src/browser-interaction/canonical.ts +77 -0
- package/src/browser-interaction/constants.ts +77 -0
- package/src/browser-interaction/effects.ts +176 -0
- package/src/browser-interaction/index.ts +111 -0
- package/src/browser-interaction/normalize.ts +997 -0
- package/src/browser-interaction/registry.ts +70 -0
- package/src/browser-interaction/resolve.ts +596 -0
- package/src/browser-interaction/schemas.ts +152 -0
- package/src/browser-interaction/types.ts +304 -0
- package/src/browser-interaction.ts +1 -0
- package/src/generated/reducer-contract/wire.ts +1 -1
- package/src/generated/reducer-contract/zod.ts +3 -1
- package/src/package-set.ts +1 -1
- package/src/reducer/bundle/ingress-bundle.ts +1 -1
- package/src/reducer/bundle/trusted/interaction-types.ts +3 -0
- package/src/reducer/bundle/trusted/projection-builder.ts +337 -13
- package/src/reducer/ingress/input-codec.ts +1 -1
- package/src/reducer/ingress/session-codec.ts +1 -1
- package/src/runtime-internal/components/InteractionForm.tsx +345 -7
- package/src/runtime-internal/components/PluginRuntime.tsx +2 -0
- package/src/runtime-internal/components/board/target-layer.ts +2 -0
- package/src/runtime-internal/context/PluginStateContext.tsx +41 -0
- package/src/runtime-internal/hooks/useBoardInteractions.ts +73 -11
- package/src/runtime-internal/primitives/board.tsx +71 -0
- package/src/runtime-internal/primitives/interaction.tsx +160 -1
- package/src/runtime-internal/types/plugin-state.ts +6 -0
- package/src/runtime-internal/utils/browser-interaction-effects.ts +240 -0
- package/src/runtime-internal/utils/interaction-draft-digest.ts +252 -0
- package/src/runtime-internal/utils/semantic-projection-digest.ts +407 -0
- package/src/ui/components/board/HexGrid.tsx +3 -0
- package/src/ui/components/board/target-layer.ts +1 -0
- package/dist/chunk-TDSWKVZ4.js.map +0 -1
- package/dist/chunk-VFTAA4WO.js.map +0 -1
- package/dist/chunk-WN74KVNY.js.map +0 -1
- /package/dist/{chunk-U5C6BONG.js.map → chunk-326PGVAA.js.map} +0 -0
- /package/dist/{chunk-GKKBPPSW.js.map → chunk-MZNVHMJ5.js.map} +0 -0
- /package/dist/{chunk-KAELH4KC.js.map → chunk-NKCRKGR2.js.map} +0 -0
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import { bf as ZoneCardRenderItem } from '../ui-contract-
|
|
2
|
-
export { B as Board, a as BoardEdgeTarget, b as BoardEdgeTargetProps, c as BoardHexGrid, d as BoardHexGridInteractionFilter, e as BoardHexGridInteractions, f as BoardHexGridProps, g as BoardHexView, h as BoardHexViewProps, i as BoardRoot, j as BoardRootProps, k as BoardSpaceTarget, l as BoardSpaceTargetProps, m as BoardState, n as BoardStateProps, o as BoardTarget, p as BoardTargetExtraInputs, q as BoardTargetProps, r as BoardVertexTarget, s as BoardVertexTargetProps, D as Dice, t as DiceComponents, u as DiceRoot, v as DiceRootProps, w as DiceState, x as DiceValue, y as DiceValues, z as DiceValuesProps, G as Game, C as GameActiveActionState, E as GameChrome, F as GameChromeProps, H as GameChromeState, I as GameMeState, J as GamePendingInputState, K as GamePlayer, L as GamePlayerEntry, M as GamePlayersState, N as GameRenderState, O as GameRoot, P as GameRootProps, Q as GameTurnState, R as Interaction, S as InteractionCardInput, T as InteractionCardInputProps, U as InteractionCardInputRenderState, V as InteractionDescription, W as InteractionDialog, X as InteractionDialogProps, Y as InteractionDialogRenderState, Z as InteractionDialogState, _ as InteractionFieldPrimitiveProps, $ as InteractionFormPrimitive, a0 as InteractionFormPrimitiveProps, a1 as InteractionInput, a2 as InteractionInputProps, a3 as InteractionLabel, a4 as InteractionPartProps, a5 as InteractionRoot, a6 as InteractionRootProps, a7 as InteractionRoute, a8 as InteractionRoutes, a9 as InteractionRoutesMap, aa as InteractionRoutesProps, ab as InteractionState, ac as InteractionStateProps, ad as InteractionStateSnapshot, ae as InteractionSubmit, af as InteractionSubmitProps, ag as InteractionSwitch, ah as InteractionSwitchProps, ai as InteractionSwitchRenderState, aj as InteractionSwitchRouteMap, ak as InteractionTrigger, al as InteractionTriggerProps, am as InteractionUnavailableMessage, an as InteractionValidationMessage, ao as Phase, ap as PhaseFallback, aq as PhaseRouteMap, ar as PhaseSwitch, as as PhaseSwitchProps, at as PlayerRoster, au as PlayerRosterBadge, av as PlayerRosterBadges, aw as PlayerRosterComponents, ax as PlayerRosterEmpty, ay as PlayerRosterEntry, az as PlayerRosterList, aA as PlayerRosterListProps, aB as PlayerRosterName, aC as PlayerRosterPartProps, aD as PlayerRosterRoot, aE as PlayerRosterRootProps, aF as PlayerRosterScore, aG as PlayerRosterSwitchButton, aH as PlayerRosterSwitchButtonProps, aI as PrimitiveCommonProps, aJ as PrimitiveDataAttributes, aK as Prompt, aL as PromptDialog, aM as PromptDialogProps, aN as PromptDialogRenderState, aO as PromptDialogState, aP as PromptInbox, aQ as PromptInboxEmpty, aR as PromptInboxItems, aS as PromptInboxItemsProps, aT as PromptInboxRoot, aU as PromptMessage, aV as PromptOption, aW as PromptOptionProps, aX as PromptOptionRenderItem, aY as PromptOptions, aZ as PromptOptionsProps, a_ as PromptRoot, a$ as PromptRootProps, b0 as PromptTitle, b2 as UI, b4 as UIRoot, b5 as UIRootProps, b6 as UseZoneCardsOptions, b7 as UseZoneCardsResult, b8 as Zone, b9 as ZoneCardAction, ba as ZoneCardActionExtraInputs, bb as ZoneCardActionProps, bc as ZoneCardActionResult, bd as ZoneCardAt, be as ZoneCardAtProps, bg as ZoneItem, bh as ZoneItemProps, bi as ZoneList, bj as ZoneListProps, bk as ZonePileCards, bl as ZonePileCardsProps, bm as ZonePileContextValue, bn as ZonePileCount, bo as ZonePileCountProps, bp as ZonePileDescription, bq as ZonePileDescriptionProps, br as ZonePileLabel, bs as ZonePileLabelProps, bt as ZonePileRoot, bu as ZonePileRootProps, bv as ZonePileTrigger, bw as ZonePileTriggerProps, bx as ZoneRoot, by as ZoneRootProps, bz as ZoneTopCard, bA as ZoneTopCardProps, bB as composeEventHandlers, bC as createZoneCardRenderItem, bD as normalizeDiceState, bE as renderPrimitive, bF as useBoardPrimitiveContext, bG as useDicePrimitiveContext, bH as useGameActionError, bI as useInteractionPrimitiveContext, bJ as useOptionalZonePrimitiveContext, bK as useResolvedCardTargetValue, bL as useZoneCardContext, bM as useZoneCards, bN as useZonePileContext, bO as useZonePrimitiveContext } from '../ui-contract-
|
|
1
|
+
import { bf as ZoneCardRenderItem } from '../ui-contract-rzKBwOLC.js';
|
|
2
|
+
export { B as Board, a as BoardEdgeTarget, b as BoardEdgeTargetProps, c as BoardHexGrid, d as BoardHexGridInteractionFilter, e as BoardHexGridInteractions, f as BoardHexGridProps, g as BoardHexView, h as BoardHexViewProps, i as BoardRoot, j as BoardRootProps, k as BoardSpaceTarget, l as BoardSpaceTargetProps, m as BoardState, n as BoardStateProps, o as BoardTarget, p as BoardTargetExtraInputs, q as BoardTargetProps, r as BoardVertexTarget, s as BoardVertexTargetProps, D as Dice, t as DiceComponents, u as DiceRoot, v as DiceRootProps, w as DiceState, x as DiceValue, y as DiceValues, z as DiceValuesProps, G as Game, C as GameActiveActionState, E as GameChrome, F as GameChromeProps, H as GameChromeState, I as GameMeState, J as GamePendingInputState, K as GamePlayer, L as GamePlayerEntry, M as GamePlayersState, N as GameRenderState, O as GameRoot, P as GameRootProps, Q as GameTurnState, R as Interaction, S as InteractionCardInput, T as InteractionCardInputProps, U as InteractionCardInputRenderState, V as InteractionDescription, W as InteractionDialog, X as InteractionDialogProps, Y as InteractionDialogRenderState, Z as InteractionDialogState, _ as InteractionFieldPrimitiveProps, $ as InteractionFormPrimitive, a0 as InteractionFormPrimitiveProps, a1 as InteractionInput, a2 as InteractionInputProps, a3 as InteractionLabel, a4 as InteractionPartProps, a5 as InteractionRoot, a6 as InteractionRootProps, a7 as InteractionRoute, a8 as InteractionRoutes, a9 as InteractionRoutesMap, aa as InteractionRoutesProps, ab as InteractionState, ac as InteractionStateProps, ad as InteractionStateSnapshot, ae as InteractionSubmit, af as InteractionSubmitProps, ag as InteractionSwitch, ah as InteractionSwitchProps, ai as InteractionSwitchRenderState, aj as InteractionSwitchRouteMap, ak as InteractionTrigger, al as InteractionTriggerProps, am as InteractionUnavailableMessage, an as InteractionValidationMessage, ao as Phase, ap as PhaseFallback, aq as PhaseRouteMap, ar as PhaseSwitch, as as PhaseSwitchProps, at as PlayerRoster, au as PlayerRosterBadge, av as PlayerRosterBadges, aw as PlayerRosterComponents, ax as PlayerRosterEmpty, ay as PlayerRosterEntry, az as PlayerRosterList, aA as PlayerRosterListProps, aB as PlayerRosterName, aC as PlayerRosterPartProps, aD as PlayerRosterRoot, aE as PlayerRosterRootProps, aF as PlayerRosterScore, aG as PlayerRosterSwitchButton, aH as PlayerRosterSwitchButtonProps, aI as PrimitiveCommonProps, aJ as PrimitiveDataAttributes, aK as Prompt, aL as PromptDialog, aM as PromptDialogProps, aN as PromptDialogRenderState, aO as PromptDialogState, aP as PromptInbox, aQ as PromptInboxEmpty, aR as PromptInboxItems, aS as PromptInboxItemsProps, aT as PromptInboxRoot, aU as PromptMessage, aV as PromptOption, aW as PromptOptionProps, aX as PromptOptionRenderItem, aY as PromptOptions, aZ as PromptOptionsProps, a_ as PromptRoot, a$ as PromptRootProps, b0 as PromptTitle, b2 as UI, b4 as UIRoot, b5 as UIRootProps, b6 as UseZoneCardsOptions, b7 as UseZoneCardsResult, b8 as Zone, b9 as ZoneCardAction, ba as ZoneCardActionExtraInputs, bb as ZoneCardActionProps, bc as ZoneCardActionResult, bd as ZoneCardAt, be as ZoneCardAtProps, bg as ZoneItem, bh as ZoneItemProps, bi as ZoneList, bj as ZoneListProps, bk as ZonePileCards, bl as ZonePileCardsProps, bm as ZonePileContextValue, bn as ZonePileCount, bo as ZonePileCountProps, bp as ZonePileDescription, bq as ZonePileDescriptionProps, br as ZonePileLabel, bs as ZonePileLabelProps, bt as ZonePileRoot, bu as ZonePileRootProps, bv as ZonePileTrigger, bw as ZonePileTriggerProps, bx as ZoneRoot, by as ZoneRootProps, bz as ZoneTopCard, bA as ZoneTopCardProps, bB as composeEventHandlers, bC as createZoneCardRenderItem, bD as normalizeDiceState, bE as renderPrimitive, bF as useBoardPrimitiveContext, bG as useDicePrimitiveContext, bH as useGameActionError, bI as useInteractionPrimitiveContext, bJ as useOptionalZonePrimitiveContext, bK as useResolvedCardTargetValue, bL as useZoneCardContext, bM as useZoneCards, bN as useZonePileContext, bO as useZonePrimitiveContext } from '../ui-contract-rzKBwOLC.js';
|
|
3
3
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
4
|
import { ReactNode } from 'react';
|
|
5
5
|
import { a as CardIntent, I as InteractionVisualState, b as HandLayoutKind, c as HandLayoutPolicy, H as HandInteractionPolicy, C as CardDropTargetVisualState } from '../HandView-ncJIVLhN.js';
|
|
6
|
-
import { a as InteractionDescriptor, P as PluginStateSnapshot } from '../runtime-api-
|
|
7
|
-
import '../hex-board-view-
|
|
6
|
+
import { a as InteractionDescriptor, P as PluginStateSnapshot } from '../runtime-api-CPLm_XDG.js';
|
|
7
|
+
import '../hex-board-view-1iAyJRFn.js';
|
|
8
8
|
import '../ui/types/player-state.js';
|
|
9
9
|
import '../cards-Sl3b40Mv.js';
|
|
10
10
|
import '../hex-color-MhOyuY-o.js';
|
|
11
|
-
import '../ThemeProvider-
|
|
11
|
+
import '../ThemeProvider-BBMVT3KG.js';
|
|
12
|
+
import '../attributes-BeRyboMS.js';
|
|
12
13
|
import '../runtime-api-3dshj6kK.js';
|
|
13
14
|
|
|
14
15
|
interface InteractionDraftReadiness {
|
|
@@ -85,9 +85,10 @@ import {
|
|
|
85
85
|
useZoneCards,
|
|
86
86
|
useZonePileContext,
|
|
87
87
|
useZonePrimitiveContext
|
|
88
|
-
} from "../chunk-
|
|
89
|
-
import "../chunk-
|
|
90
|
-
import "../chunk-
|
|
88
|
+
} from "../chunk-ZABVH7AO.js";
|
|
89
|
+
import "../chunk-QLG6VEMW.js";
|
|
90
|
+
import "../chunk-NKCRKGR2.js";
|
|
91
|
+
import "../chunk-WG4JQL3S.js";
|
|
91
92
|
import "../chunk-VDXOF4FW.js";
|
|
92
93
|
import "../chunk-PZ5AY32C.js";
|
|
93
94
|
export {
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
export { DreamboardUI, TypedGame, UIContract } from '../runtime.js';
|
|
2
|
-
import { l as BoardSpaceTargetProps, bj as ZoneListProps, b3 as UIContract } from '../ui-contract-
|
|
3
|
-
export { f as BoardHexGridProps, h as BoardHexViewProps, I as GameMeState, M as GamePlayersState, N as GameRenderState, Q as GameTurnState, b5 as UIRootProps, bf as ZoneCardRenderItem } from '../ui-contract-
|
|
2
|
+
import { l as BoardSpaceTargetProps, bj as ZoneListProps, b3 as UIContract } from '../ui-contract-rzKBwOLC.js';
|
|
3
|
+
export { f as BoardHexGridProps, h as BoardHexViewProps, I as GameMeState, M as GamePlayersState, N as GameRenderState, Q as GameTurnState, b5 as UIRootProps, bf as ZoneCardRenderItem } from '../ui-contract-rzKBwOLC.js';
|
|
4
4
|
import { H as HandRole } from '../ResourceCounter-CTREyF73.js';
|
|
5
5
|
export { b as ResourceCounterComponents } from '../ResourceCounter-CTREyF73.js';
|
|
6
|
-
import '../runtime-api-
|
|
6
|
+
import '../runtime-api-CPLm_XDG.js';
|
|
7
7
|
import { ReactNode, ReactElement, ButtonHTMLAttributes } from 'react';
|
|
8
8
|
import 'react/jsx-runtime';
|
|
9
|
-
import '../hex-board-view-
|
|
9
|
+
import '../hex-board-view-1iAyJRFn.js';
|
|
10
10
|
import '../ui/types/player-state.js';
|
|
11
11
|
import '../cards-Sl3b40Mv.js';
|
|
12
12
|
import '../hex-color-MhOyuY-o.js';
|
|
13
|
-
import '../ThemeProvider-
|
|
13
|
+
import '../ThemeProvider-BBMVT3KG.js';
|
|
14
|
+
import '../attributes-BeRyboMS.js';
|
|
14
15
|
import '../runtime-api-3dshj6kK.js';
|
|
15
16
|
import '../primitive-props-DpKs-GCr.js';
|
|
16
17
|
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createWorkspaceUIContract
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-MZNVHMJ5.js";
|
|
4
4
|
import "../chunk-T3ZKNUZ7.js";
|
|
5
|
-
import "../chunk-
|
|
6
|
-
import "../chunk-
|
|
7
|
-
import "../chunk-
|
|
8
|
-
import "../chunk-
|
|
5
|
+
import "../chunk-326PGVAA.js";
|
|
6
|
+
import "../chunk-ZABVH7AO.js";
|
|
7
|
+
import "../chunk-QLG6VEMW.js";
|
|
8
|
+
import "../chunk-NKCRKGR2.js";
|
|
9
|
+
import "../chunk-WG4JQL3S.js";
|
|
9
10
|
import "../chunk-VDXOF4FW.js";
|
|
10
11
|
import "../chunk-PZ5AY32C.js";
|
|
11
12
|
export {
|
|
@@ -303,6 +303,12 @@ interface InteractionDescriptorBase<Key extends string = string> {
|
|
|
303
303
|
interactionId: string;
|
|
304
304
|
/** Draft commit policy. Always materialized by the trusted reducer bundle. */
|
|
305
305
|
commit: InteractionCommitPolicy;
|
|
306
|
+
/** Canonical descriptor digest used by browser replay/protocol tooling when projected by the host. */
|
|
307
|
+
descriptorDigest?: string;
|
|
308
|
+
/** Explicit authoring/runtime actor seat used by browser replay draft digests. */
|
|
309
|
+
actorSeat?: number;
|
|
310
|
+
/** Canonical draft digest used by browser replay/protocol tooling when projected by the host. */
|
|
311
|
+
draftDigest?: string;
|
|
306
312
|
/** Source zone id for zone-scoped interactions (e.g., cardInput). */
|
|
307
313
|
zoneId?: string;
|
|
308
314
|
/** Source zone ids for zone-scoped interactions that span multiple zones. */
|
package/dist/runtime.d.ts
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { b3 as UIContract$1, A as DreamboardUI$1, b1 as TypedGame$1 } from './ui-contract-
|
|
2
|
-
export { a as InteractionDescriptor } from './runtime-api-
|
|
1
|
+
import { b3 as UIContract$1, A as DreamboardUI$1, b1 as TypedGame$1 } from './ui-contract-rzKBwOLC.js';
|
|
2
|
+
export { a as InteractionDescriptor } from './runtime-api-CPLm_XDG.js';
|
|
3
3
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
4
|
import react__default from 'react';
|
|
5
|
-
import './hex-board-view-
|
|
5
|
+
import './hex-board-view-1iAyJRFn.js';
|
|
6
6
|
import './ui/types/player-state.js';
|
|
7
7
|
import './cards-Sl3b40Mv.js';
|
|
8
8
|
import './hex-color-MhOyuY-o.js';
|
|
9
|
-
import './ThemeProvider-
|
|
9
|
+
import './ThemeProvider-BBMVT3KG.js';
|
|
10
|
+
import './attributes-BeRyboMS.js';
|
|
10
11
|
import './runtime-api-3dshj6kK.js';
|
|
11
12
|
|
|
12
13
|
interface PluginRuntimeProps {
|
package/dist/runtime.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
PluginRuntime
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-XV6D3ET4.js";
|
|
4
|
+
import "./chunk-326PGVAA.js";
|
|
5
|
+
import "./chunk-ZABVH7AO.js";
|
|
6
|
+
import "./chunk-QLG6VEMW.js";
|
|
7
|
+
import "./chunk-NKCRKGR2.js";
|
|
8
|
+
import "./chunk-WG4JQL3S.js";
|
|
8
9
|
import "./chunk-VDXOF4FW.js";
|
|
9
10
|
import "./chunk-PZ5AY32C.js";
|
|
10
11
|
export {
|
package/dist/testing.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as ReducerSessionState, R as ReducerBundleContract } from './bundle-
|
|
2
|
-
import { P as PluginStateSnapshot$1, G as GameplaySnapshot$1 } from './runtime-api-
|
|
1
|
+
import { a as ReducerSessionState, R as ReducerBundleContract } from './bundle-CDd5FKeD.js';
|
|
2
|
+
import { P as PluginStateSnapshot$1, G as GameplaySnapshot$1 } from './runtime-api-CPLm_XDG.js';
|
|
3
3
|
import { R as RuntimeAPI, a as PluginSessionState, V as ValidationResult } from './runtime-api-3dshj6kK.js';
|
|
4
4
|
import './hex-color-MhOyuY-o.js';
|
|
5
5
|
|
package/dist/ui/components.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { A as ActionButton, a as ActionButtonProps, b as ActionGroup, c as ActionGroupProps, d as ActionPanel, e as ActionPanelProps, C as CardDragSurface, g as CardDragSurfaceContextValue, h as CardDragSurfaceController, i as CardDragSurfaceProps, j as CardDropTargetView, k as CardDropTargetViewProps, l as CardFace, m as CardFaceProps, 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, 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 PhaseIndicator, aN as PhaseIndicatorProps, aO as PlayArea, aP as PlayAreaProps, aQ as PlayerScore, aR as PrimaryActionAttention, aS as PrimaryActionButton, aT as PrimaryActionButtonProps, aU as PrimaryButton, aV as PrimaryButtonProps, aW as ResourceDefinition, aX as Select, aY as SelectContent, aZ as SelectItem, a_ as SelectTrigger, a$ as SlotDefinition, b0 as SlotOccupant, b1 as SlotSystem, b2 as SlotSystemProps, b3 as SquareEdgePosition, b4 as SquareGrid, b5 as SquareGridBoardProps, b6 as SquareGridProps, b7 as SquareVertexPosition, b8 as StagingZone, b9 as StagingZoneProps, ba as ThemedButton, bb as ThemedButtonProps, bc as Toast, bd as ToastActions, be as ToastActionsProps, bf as ToastActionsValue, bg as ToastNotification, bh as ToastProvider, bi as ToastType, bj as TrackBoard, bk as TrackBoardProps, bl as TrackPiece, bm as TrackSpace, bp as ZoneDefinition, bq as ZoneHighlightType, br as ZoneMap, bs as ZoneMapProps, bt as ZonePiece, bu as ZoneShape, bB as toAlgebraic, bC as toNumeric, bD as useCardDragSurface, bE as useChromeSuppression } from '../components-
|
|
1
|
+
export { A as ActionButton, a as ActionButtonProps, b as ActionGroup, c as ActionGroupProps, d as ActionPanel, e as ActionPanelProps, C as CardDragSurface, g as CardDragSurfaceContextValue, h as CardDragSurfaceController, i as CardDragSurfaceProps, j as CardDropTargetView, k as CardDropTargetViewProps, l as CardFace, m as CardFaceProps, 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, 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 PhaseIndicator, aN as PhaseIndicatorProps, aO as PlayArea, aP as PlayAreaProps, aQ as PlayerScore, aR as PrimaryActionAttention, aS as PrimaryActionButton, aT as PrimaryActionButtonProps, aU as PrimaryButton, aV as PrimaryButtonProps, aW as ResourceDefinition, aX as Select, aY as SelectContent, aZ as SelectItem, a_ as SelectTrigger, a$ as SlotDefinition, b0 as SlotOccupant, b1 as SlotSystem, b2 as SlotSystemProps, b3 as SquareEdgePosition, b4 as SquareGrid, b5 as SquareGridBoardProps, b6 as SquareGridProps, b7 as SquareVertexPosition, b8 as StagingZone, b9 as StagingZoneProps, ba as ThemedButton, bb as ThemedButtonProps, bc as Toast, bd as ToastActions, be as ToastActionsProps, bf as ToastActionsValue, bg as ToastNotification, bh as ToastProvider, bi as ToastType, bj as TrackBoard, bk as TrackBoardProps, bl as TrackPiece, bm as TrackSpace, bp as ZoneDefinition, bq as ZoneHighlightType, br as ZoneMap, bs as ZoneMapProps, bt as ZonePiece, bu as ZoneShape, bB as toAlgebraic, bC as toNumeric, bD as useCardDragSurface, bE as useChromeSuppression } from '../components-BoiVSYqx.js';
|
|
2
2
|
export { H as HandInteractionPolicy, b as HandLayoutKind, c as HandLayoutPolicy, d as HandView, e as HandViewProps } from '../HandView-ncJIVLhN.js';
|
|
3
3
|
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-CTREyF73.js';
|
|
4
|
-
export { D as DefaultHexEdge, g as DefaultHexEdgeProps, h as DefaultHexTile, i as DefaultHexTileProps, j as DefaultHexVertex, k as DefaultHexVertexProps, E as EdgePosition, r as HexBoardView, s as HexBoardViewTile, t as HexGrid, u as HexGridBoardProps, v as HexGridProps, w as HexOrientation, x as HexTileGeometry, y as InteractiveHexEdge, z as InteractiveHexVertex, J as InteractiveTargetLayer, K as InteractiveTargetRenderState, a2 as createHexBoardView, a3 as hexUtils } from '../hex-board-view-
|
|
4
|
+
export { D as DefaultHexEdge, g as DefaultHexEdgeProps, h as DefaultHexTile, i as DefaultHexTileProps, j as DefaultHexVertex, k as DefaultHexVertexProps, E as EdgePosition, r as HexBoardView, s as HexBoardViewTile, t as HexGrid, u as HexGridBoardProps, v as HexGridProps, w as HexOrientation, x as HexTileGeometry, y as InteractiveHexEdge, z as InteractiveHexVertex, J as InteractiveTargetLayer, K as InteractiveTargetRenderState, a2 as createHexBoardView, a3 as hexUtils } from '../hex-board-view-1iAyJRFn.js';
|
|
5
5
|
export { HexEdgeState, HexTileState, HexVertexState, SquareCellState, SquareEdgeState, SquarePieceState, SquareVertexState } from './types/player-state.js';
|
|
6
6
|
export { C as CardCollection, V as ViewCard } from '../cards-Sl3b40Mv.js';
|
|
7
7
|
export { V as ViewSlotOccupant } from '../slots-1GPGihk8.js';
|
package/dist/ui/components.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { CSSProperties, ReactNode, AriaAttributes, HTMLAttributes, JSX, ReactElement, ButtonHTMLAttributes, InputHTMLAttributes } from 'react';
|
|
3
3
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
|
-
import { _ as Theme, a0 as ThemeOverride, 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, I as InputDomain, b as InteractionInputDescriptor } from './runtime-api-
|
|
4
|
+
import { _ as Theme, a0 as ThemeOverride, A as AnyHexBoardInput, d as BoardSpaceIdOf, u as HexGridBoardProps, r as HexBoardView } from './hex-board-view-1iAyJRFn.js';
|
|
5
|
+
import { a as ThemePresetId } from './ThemeProvider-BBMVT3KG.js';
|
|
6
|
+
import { a as InteractionDescriptor, Z as ZoneHandlesSnapshot, I as InputDomain, b as InteractionInputDescriptor } from './runtime-api-CPLm_XDG.js';
|
|
7
7
|
import { V as ViewCard } from './cards-Sl3b40Mv.js';
|
|
8
|
+
import { j as BrowserInteractionAttributeMap } from './attributes-BeRyboMS.js';
|
|
8
9
|
import { a as PluginSessionState, P as PlayerId } from './runtime-api-3dshj6kK.js';
|
|
9
10
|
import { Player } from './ui/types/player-state.js';
|
|
10
11
|
import { H as HexColor } from './hex-color-MhOyuY-o.js';
|
|
@@ -209,6 +210,7 @@ interface InteractiveTargetState {
|
|
|
209
210
|
conflict: boolean;
|
|
210
211
|
conflictInteractionKeys?: readonly string[];
|
|
211
212
|
unavailableReason?: string;
|
|
213
|
+
browserAttributes?: BrowserInteractionAttributeMap;
|
|
212
214
|
select?: () => unknown | Promise<unknown>;
|
|
213
215
|
}
|
|
214
216
|
interface InteractiveTargetLayer {
|
package/dist/ui.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { bm as TrackSpace, bl 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 PhaseIndicator, aN as PhaseIndicatorProps, aO as PlayArea, aP as PlayAreaProps, aQ as PlayerScore, aR as PrimaryActionAttention, aS as PrimaryActionButton, aT as PrimaryActionButtonProps, aU as PrimaryButton, aV as PrimaryButtonProps, aW as ResourceDefinition, aX as Select, aY as SelectContent, aZ as SelectItem, a_ as SelectTrigger, a$ as SlotDefinition, b0 as SlotOccupant, b1 as SlotSystem, b2 as SlotSystemProps, b3 as SquareEdgePosition, b4 as SquareGrid, b5 as SquareGridBoardProps, b6 as SquareGridProps, b7 as SquareVertexPosition, b8 as StagingZone, b9 as StagingZoneProps, ba as ThemedButton, bb as ThemedButtonProps, bc as Toast, bd as ToastActions, be as ToastActionsProps, bf as ToastActionsValue, bg as ToastNotification, bh as ToastProvider, bi as ToastType, bj as TrackBoard, bk as TrackBoardProps, bn as UseHandLayoutOptions, bo as UseHandLayoutReturn, bp as ZoneDefinition, bq as ZoneHighlightType, br as ZoneMap, bs as ZoneMapProps, bt as ZonePiece, bu as ZoneShape, bv as buttonStyle, bw as chipStyle, bx as intentForVariant, by as motionDuration, bz as playerColor, bA as surfaceStyle, bB as toAlgebraic, bC as toNumeric, bD as useCardDragSurface, bE as useChromeSuppression, bF as useHandLayout } from './components-
|
|
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, L as NormalizedHexEdgeOf, O as NormalizedHexTileOf, P as NormalizedHexVertexOf, Q as NormalizedSquareBoard, R as NormalizedSquareCellOf, S as NormalizedSquareEdgeOf, T as NormalizedSquarePieceOf, U as NormalizedSquareVertexOf, V as PlayerColor, W as Radius, X as SemanticColor, Y as Space, Z as SquareBoardInput, $ as ThemeMeta, a0 as ThemeOverride, a1 as Typography, a2 as createHexBoardView, a3 as hexUtils, a4 as mergeTheme, a5 as normalizeHexBoardInput, a6 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 { bm as TrackSpace, bl as TrackPiece } from './components-BoiVSYqx.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 PhaseIndicator, aN as PhaseIndicatorProps, aO as PlayArea, aP as PlayAreaProps, aQ as PlayerScore, aR as PrimaryActionAttention, aS as PrimaryActionButton, aT as PrimaryActionButtonProps, aU as PrimaryButton, aV as PrimaryButtonProps, aW as ResourceDefinition, aX as Select, aY as SelectContent, aZ as SelectItem, a_ as SelectTrigger, a$ as SlotDefinition, b0 as SlotOccupant, b1 as SlotSystem, b2 as SlotSystemProps, b3 as SquareEdgePosition, b4 as SquareGrid, b5 as SquareGridBoardProps, b6 as SquareGridProps, b7 as SquareVertexPosition, b8 as StagingZone, b9 as StagingZoneProps, ba as ThemedButton, bb as ThemedButtonProps, bc as Toast, bd as ToastActions, be as ToastActionsProps, bf as ToastActionsValue, bg as ToastNotification, bh as ToastProvider, bi as ToastType, bj as TrackBoard, bk as TrackBoardProps, bn as UseHandLayoutOptions, bo as UseHandLayoutReturn, bp as ZoneDefinition, bq as ZoneHighlightType, br as ZoneMap, bs as ZoneMapProps, bt as ZonePiece, bu as ZoneShape, bv as buttonStyle, bw as chipStyle, bx as intentForVariant, by as motionDuration, bz as playerColor, bA as surfaceStyle, bB as toAlgebraic, bC as toNumeric, bD as useCardDragSurface, bE as useChromeSuppression, bF as useHandLayout } from './components-BoiVSYqx.js';
|
|
3
|
+
import { _ as Theme } from './hex-board-view-1iAyJRFn.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, L as NormalizedHexEdgeOf, O as NormalizedHexTileOf, P as NormalizedHexVertexOf, Q as NormalizedSquareBoard, R as NormalizedSquareCellOf, S as NormalizedSquareEdgeOf, T as NormalizedSquarePieceOf, U as NormalizedSquareVertexOf, V as PlayerColor, W as Radius, X as SemanticColor, Y as Space, Z as SquareBoardInput, $ as ThemeMeta, a0 as ThemeOverride, a1 as Typography, a2 as createHexBoardView, a3 as hexUtils, a4 as mergeTheme, a5 as normalizeHexBoardInput, a6 as normalizeSquareBoardInput } from './hex-board-view-1iAyJRFn.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-BBMVT3KG.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-ncJIVLhN.js';
|
|
8
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-CTREyF73.js';
|
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-NKCRKGR2.js";
|
|
9
9
|
import {
|
|
10
10
|
ActionButton,
|
|
11
11
|
ActionGroup,
|
|
@@ -123,7 +123,7 @@ import {
|
|
|
123
123
|
useTheme,
|
|
124
124
|
useThemeCssVars,
|
|
125
125
|
visualStateDataAttributes
|
|
126
|
-
} from "./chunk-
|
|
126
|
+
} from "./chunk-WG4JQL3S.js";
|
|
127
127
|
import "./chunk-VDXOF4FW.js";
|
|
128
128
|
import "./chunk-PZ5AY32C.js";
|
|
129
129
|
export {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dreamboard-games/sdk",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1-alpha.1",
|
|
4
4
|
"description": "Dreamboard SDK package set metadata and public facade",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -123,6 +123,12 @@
|
|
|
123
123
|
"import": "./dist/testing.js",
|
|
124
124
|
"default": "./dist/testing.js"
|
|
125
125
|
},
|
|
126
|
+
"./browser-interaction": {
|
|
127
|
+
"bun": "./src/browser-interaction.ts",
|
|
128
|
+
"types": "./dist/browser-interaction.d.ts",
|
|
129
|
+
"import": "./dist/browser-interaction.js",
|
|
130
|
+
"default": "./dist/browser-interaction.js"
|
|
131
|
+
},
|
|
126
132
|
"./package.json": "./package.json"
|
|
127
133
|
},
|
|
128
134
|
"files": [
|
|
@@ -140,12 +146,6 @@
|
|
|
140
146
|
"!.turbo/**",
|
|
141
147
|
"!tsconfig.tsbuildinfo"
|
|
142
148
|
],
|
|
143
|
-
"scripts": {
|
|
144
|
-
"build": "tsup && mkdir -p dist/ui && cp src/ui/plugin-styles.css dist/ui/plugin-styles.css",
|
|
145
|
-
"typecheck": "tsc --noEmit",
|
|
146
|
-
"lint": "eslint 'src/**/*.ts'",
|
|
147
|
-
"test": "bun test"
|
|
148
|
-
},
|
|
149
149
|
"dependencies": {
|
|
150
150
|
"@radix-ui/react-dialog": "^1.1.14",
|
|
151
151
|
"@radix-ui/react-accordion": "^1.2.12",
|
|
@@ -195,5 +195,11 @@
|
|
|
195
195
|
"sdk",
|
|
196
196
|
"package-set"
|
|
197
197
|
],
|
|
198
|
-
"license": "SEE LICENSE IN LICENSE.md"
|
|
199
|
-
|
|
198
|
+
"license": "SEE LICENSE IN LICENSE.md",
|
|
199
|
+
"scripts": {
|
|
200
|
+
"build": "tsup && mkdir -p dist/ui && cp src/ui/plugin-styles.css dist/ui/plugin-styles.css",
|
|
201
|
+
"typecheck": "tsc --noEmit",
|
|
202
|
+
"lint": "eslint 'src/**/*.ts'",
|
|
203
|
+
"test": "bun test"
|
|
204
|
+
}
|
|
205
|
+
}
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
import {
|
|
2
|
+
BROWSER_INTERACTION_ATTRIBUTES,
|
|
3
|
+
DREAMBOARD_BROWSER_INTERACTION_PROTOCOL_VERSION,
|
|
4
|
+
GAMEPLAY_BROWSER_INTERACTION_SURFACE,
|
|
5
|
+
} from "./constants.js";
|
|
6
|
+
import { encodeCanonicalCandidateValue } from "./canonical.js";
|
|
7
|
+
import {
|
|
8
|
+
encodeBrowserInteractionEffect,
|
|
9
|
+
encodeBrowserInteractionEffectPattern,
|
|
10
|
+
} from "./effects.js";
|
|
11
|
+
import type {
|
|
12
|
+
BrowserInteractionActuatorKind,
|
|
13
|
+
BrowserInteractionCandidateState,
|
|
14
|
+
BrowserInteractionEffectPattern,
|
|
15
|
+
BrowserInteractionIntent,
|
|
16
|
+
BrowserInteractionPreparationTarget,
|
|
17
|
+
BrowserInteractionReadiness,
|
|
18
|
+
BrowserInteractionSurfaceEffect,
|
|
19
|
+
GameplayBrowserInteractionIntent,
|
|
20
|
+
GameplaySemanticEffect,
|
|
21
|
+
GameplaySemanticEffectPattern,
|
|
22
|
+
} from "./types.js";
|
|
23
|
+
|
|
24
|
+
export type BrowserInteractionAttributeMap = Record<string, string | boolean>;
|
|
25
|
+
|
|
26
|
+
export interface BrowserInteractionRootAttributesInput {
|
|
27
|
+
readonly surface: string;
|
|
28
|
+
readonly scopeId: string;
|
|
29
|
+
readonly interactionKey: string;
|
|
30
|
+
readonly interactionId: string;
|
|
31
|
+
readonly descriptorDigest?: string;
|
|
32
|
+
readonly draftDigest?: string;
|
|
33
|
+
readonly readiness: BrowserInteractionReadiness;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export interface BrowserInteractionActuatorAttributesInput {
|
|
37
|
+
readonly surface: string;
|
|
38
|
+
readonly scopeId: string;
|
|
39
|
+
readonly interactionKey: string;
|
|
40
|
+
readonly interactionId: string;
|
|
41
|
+
readonly descriptorDigest?: string;
|
|
42
|
+
readonly draftDigest?: string;
|
|
43
|
+
readonly intent: BrowserInteractionIntent;
|
|
44
|
+
readonly inputKey?: string;
|
|
45
|
+
readonly candidateValue?: unknown;
|
|
46
|
+
readonly candidateState?: BrowserInteractionCandidateState;
|
|
47
|
+
readonly enabled?: boolean;
|
|
48
|
+
readonly actuatorKind: BrowserInteractionActuatorKind;
|
|
49
|
+
readonly actuatorId?: string;
|
|
50
|
+
readonly semanticEffects?: readonly BrowserInteractionSurfaceEffect[];
|
|
51
|
+
readonly acceptedEffectPatterns?: readonly BrowserInteractionEffectPattern[];
|
|
52
|
+
readonly preparationPatterns?: readonly BrowserInteractionEffectPattern[];
|
|
53
|
+
readonly prepares?: BrowserInteractionPreparationTarget;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function baseGameplayAttributes(
|
|
57
|
+
input: Pick<
|
|
58
|
+
BrowserInteractionRootAttributesInput,
|
|
59
|
+
"surface" | "scopeId" | "interactionKey" | "interactionId"
|
|
60
|
+
>,
|
|
61
|
+
): BrowserInteractionAttributeMap {
|
|
62
|
+
return {
|
|
63
|
+
[BROWSER_INTERACTION_ATTRIBUTES.protocol]:
|
|
64
|
+
DREAMBOARD_BROWSER_INTERACTION_PROTOCOL_VERSION,
|
|
65
|
+
[BROWSER_INTERACTION_ATTRIBUTES.surface]: input.surface,
|
|
66
|
+
[BROWSER_INTERACTION_ATTRIBUTES.scope]: input.scopeId,
|
|
67
|
+
[BROWSER_INTERACTION_ATTRIBUTES.interactionKey]: input.interactionKey,
|
|
68
|
+
[BROWSER_INTERACTION_ATTRIBUTES.interactionId]: input.interactionId,
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export function createBrowserInteractionRootAttributes(
|
|
73
|
+
input: BrowserInteractionRootAttributesInput,
|
|
74
|
+
): BrowserInteractionAttributeMap {
|
|
75
|
+
return {
|
|
76
|
+
...baseGameplayAttributes(input),
|
|
77
|
+
[BROWSER_INTERACTION_ATTRIBUTES.role]: "interaction",
|
|
78
|
+
[BROWSER_INTERACTION_ATTRIBUTES.descriptorDigest]:
|
|
79
|
+
input.descriptorDigest ?? "",
|
|
80
|
+
[BROWSER_INTERACTION_ATTRIBUTES.draftDigest]: input.draftDigest ?? "",
|
|
81
|
+
[BROWSER_INTERACTION_ATTRIBUTES.readiness]: input.readiness,
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export function createBrowserInteractionActuatorAttributes(
|
|
86
|
+
input: BrowserInteractionActuatorAttributesInput,
|
|
87
|
+
): BrowserInteractionAttributeMap {
|
|
88
|
+
const attrs: BrowserInteractionAttributeMap = {
|
|
89
|
+
...baseGameplayAttributes(input),
|
|
90
|
+
[BROWSER_INTERACTION_ATTRIBUTES.role]: "actuator",
|
|
91
|
+
[BROWSER_INTERACTION_ATTRIBUTES.intent]: input.intent,
|
|
92
|
+
[BROWSER_INTERACTION_ATTRIBUTES.actuatorKind]: input.actuatorKind,
|
|
93
|
+
[BROWSER_INTERACTION_ATTRIBUTES.enabled]:
|
|
94
|
+
input.enabled === false ? "false" : "true",
|
|
95
|
+
};
|
|
96
|
+
if (input.descriptorDigest) {
|
|
97
|
+
attrs[BROWSER_INTERACTION_ATTRIBUTES.descriptorDigest] =
|
|
98
|
+
input.descriptorDigest;
|
|
99
|
+
}
|
|
100
|
+
if (input.draftDigest) {
|
|
101
|
+
attrs[BROWSER_INTERACTION_ATTRIBUTES.draftDigest] = input.draftDigest;
|
|
102
|
+
}
|
|
103
|
+
if (input.actuatorId) {
|
|
104
|
+
attrs[BROWSER_INTERACTION_ATTRIBUTES.actuatorId] = input.actuatorId;
|
|
105
|
+
}
|
|
106
|
+
if (input.inputKey) {
|
|
107
|
+
attrs[BROWSER_INTERACTION_ATTRIBUTES.inputKey] = input.inputKey;
|
|
108
|
+
}
|
|
109
|
+
if ("candidateValue" in input) {
|
|
110
|
+
attrs[BROWSER_INTERACTION_ATTRIBUTES.candidateValue] =
|
|
111
|
+
encodeCanonicalCandidateValue(input.candidateValue);
|
|
112
|
+
}
|
|
113
|
+
if (input.candidateState) {
|
|
114
|
+
attrs[BROWSER_INTERACTION_ATTRIBUTES.candidateState] = input.candidateState;
|
|
115
|
+
}
|
|
116
|
+
if (input.semanticEffects && input.semanticEffects.length > 0) {
|
|
117
|
+
attrs[BROWSER_INTERACTION_ATTRIBUTES.semanticEffects] = JSON.stringify(
|
|
118
|
+
input.semanticEffects.map(encodeBrowserInteractionEffect),
|
|
119
|
+
);
|
|
120
|
+
}
|
|
121
|
+
if (input.acceptedEffectPatterns && input.acceptedEffectPatterns.length > 0) {
|
|
122
|
+
attrs[BROWSER_INTERACTION_ATTRIBUTES.acceptedEffectPatterns] =
|
|
123
|
+
JSON.stringify(
|
|
124
|
+
input.acceptedEffectPatterns.map(encodeBrowserInteractionEffectPattern),
|
|
125
|
+
);
|
|
126
|
+
}
|
|
127
|
+
if (input.preparationPatterns && input.preparationPatterns.length > 0) {
|
|
128
|
+
attrs[BROWSER_INTERACTION_ATTRIBUTES.preparationPatterns] = JSON.stringify(
|
|
129
|
+
input.preparationPatterns.map(encodeBrowserInteractionEffectPattern),
|
|
130
|
+
);
|
|
131
|
+
}
|
|
132
|
+
if (input.prepares) {
|
|
133
|
+
attrs[BROWSER_INTERACTION_ATTRIBUTES.preparesIntent] =
|
|
134
|
+
input.prepares.intent;
|
|
135
|
+
if (input.prepares.inputKey) {
|
|
136
|
+
attrs[BROWSER_INTERACTION_ATTRIBUTES.preparesInputKey] =
|
|
137
|
+
input.prepares.inputKey;
|
|
138
|
+
}
|
|
139
|
+
if (input.prepares.candidateValueKey) {
|
|
140
|
+
attrs[BROWSER_INTERACTION_ATTRIBUTES.preparesCandidateValue] =
|
|
141
|
+
input.prepares.candidateValueKey;
|
|
142
|
+
} else if ("candidateValue" in input.prepares) {
|
|
143
|
+
attrs[BROWSER_INTERACTION_ATTRIBUTES.preparesCandidateValue] =
|
|
144
|
+
encodeCanonicalCandidateValue(input.prepares.candidateValue);
|
|
145
|
+
}
|
|
146
|
+
if (input.prepares.actuatorKind) {
|
|
147
|
+
attrs[BROWSER_INTERACTION_ATTRIBUTES.preparesActuatorKind] =
|
|
148
|
+
input.prepares.actuatorKind;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
return attrs;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
export type GameplayInteractionRootAttributesInput = Omit<
|
|
155
|
+
BrowserInteractionRootAttributesInput,
|
|
156
|
+
"surface"
|
|
157
|
+
>;
|
|
158
|
+
|
|
159
|
+
export type GameplayActuatorAttributesInput = Omit<
|
|
160
|
+
BrowserInteractionActuatorAttributesInput,
|
|
161
|
+
| "surface"
|
|
162
|
+
| "intent"
|
|
163
|
+
| "semanticEffects"
|
|
164
|
+
| "acceptedEffectPatterns"
|
|
165
|
+
| "preparationPatterns"
|
|
166
|
+
> & {
|
|
167
|
+
readonly intent: GameplayBrowserInteractionIntent;
|
|
168
|
+
readonly semanticEffects?: readonly GameplaySemanticEffect[];
|
|
169
|
+
readonly acceptedEffectPatterns?: readonly GameplaySemanticEffectPattern[];
|
|
170
|
+
readonly preparationPatterns?: readonly GameplaySemanticEffectPattern[];
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
export function createGameplayInteractionRootAttributes(
|
|
174
|
+
input: GameplayInteractionRootAttributesInput,
|
|
175
|
+
): BrowserInteractionAttributeMap {
|
|
176
|
+
return createBrowserInteractionRootAttributes({
|
|
177
|
+
...input,
|
|
178
|
+
surface: GAMEPLAY_BROWSER_INTERACTION_SURFACE,
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
export function createGameplayActuatorAttributes(
|
|
183
|
+
input: GameplayActuatorAttributesInput,
|
|
184
|
+
): BrowserInteractionAttributeMap {
|
|
185
|
+
return createBrowserInteractionActuatorAttributes({
|
|
186
|
+
...input,
|
|
187
|
+
surface: GAMEPLAY_BROWSER_INTERACTION_SURFACE,
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
export function createBrowserInteractionActuatorKey(input: {
|
|
192
|
+
readonly surface: string;
|
|
193
|
+
readonly scopeId: string;
|
|
194
|
+
readonly interactionKey: string;
|
|
195
|
+
readonly intent: BrowserInteractionIntent;
|
|
196
|
+
readonly inputKey?: string;
|
|
197
|
+
readonly candidateValueKey?: string;
|
|
198
|
+
readonly actuatorKind: BrowserInteractionActuatorKind;
|
|
199
|
+
}): string {
|
|
200
|
+
return [
|
|
201
|
+
input.surface,
|
|
202
|
+
input.scopeId,
|
|
203
|
+
input.interactionKey,
|
|
204
|
+
input.intent,
|
|
205
|
+
input.inputKey ?? "",
|
|
206
|
+
input.candidateValueKey ?? "",
|
|
207
|
+
input.actuatorKind,
|
|
208
|
+
]
|
|
209
|
+
.map((part) => encodeURIComponent(part))
|
|
210
|
+
.join("|");
|
|
211
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
export type CanonicalBrowserInteractionValue =
|
|
2
|
+
| null
|
|
3
|
+
| boolean
|
|
4
|
+
| number
|
|
5
|
+
| string
|
|
6
|
+
| readonly CanonicalBrowserInteractionValue[]
|
|
7
|
+
| { readonly [key: string]: CanonicalBrowserInteractionValue };
|
|
8
|
+
|
|
9
|
+
function assertCanonicalValue(
|
|
10
|
+
value: unknown,
|
|
11
|
+
): asserts value is CanonicalBrowserInteractionValue {
|
|
12
|
+
if (value === null) return;
|
|
13
|
+
switch (typeof value) {
|
|
14
|
+
case "boolean":
|
|
15
|
+
case "string":
|
|
16
|
+
return;
|
|
17
|
+
case "number":
|
|
18
|
+
if (Number.isFinite(value)) return;
|
|
19
|
+
break;
|
|
20
|
+
case "object":
|
|
21
|
+
if (Array.isArray(value)) {
|
|
22
|
+
value.forEach(assertCanonicalValue);
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
if (Object.getPrototypeOf(value) !== Object.prototype) break;
|
|
26
|
+
for (const [key, item] of Object.entries(value)) {
|
|
27
|
+
if (item === undefined) {
|
|
28
|
+
throw new Error(
|
|
29
|
+
`Browser interaction candidate '${key}' cannot be undefined.`,
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
assertCanonicalValue(item);
|
|
33
|
+
}
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
throw new Error(
|
|
37
|
+
`Browser interaction candidates must be JSON-serializable primitives, arrays or plain objects. Received ${typeof value}.`,
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function canonicalizeValue(
|
|
42
|
+
value: CanonicalBrowserInteractionValue,
|
|
43
|
+
): CanonicalBrowserInteractionValue {
|
|
44
|
+
if (Array.isArray(value)) {
|
|
45
|
+
return value.map(canonicalizeValue);
|
|
46
|
+
}
|
|
47
|
+
if (value && typeof value === "object") {
|
|
48
|
+
const objectValue = value as {
|
|
49
|
+
readonly [key: string]: CanonicalBrowserInteractionValue;
|
|
50
|
+
};
|
|
51
|
+
return Object.fromEntries(
|
|
52
|
+
Object.keys(objectValue)
|
|
53
|
+
.sort()
|
|
54
|
+
.map((key) => [key, canonicalizeValue(objectValue[key])]),
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
return value;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export function encodeCanonicalCandidateValue(value: unknown): string {
|
|
61
|
+
assertCanonicalValue(value);
|
|
62
|
+
return JSON.stringify(canonicalizeValue(value));
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export function decodeCanonicalCandidateValue(
|
|
66
|
+
encoded: string,
|
|
67
|
+
): CanonicalBrowserInteractionValue {
|
|
68
|
+
const parsed = JSON.parse(encoded) as unknown;
|
|
69
|
+
assertCanonicalValue(parsed);
|
|
70
|
+
return canonicalizeValue(parsed);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export function compareStableJson(a: unknown, b: unknown): number {
|
|
74
|
+
const encodedA = encodeCanonicalCandidateValue(a);
|
|
75
|
+
const encodedB = encodeCanonicalCandidateValue(b);
|
|
76
|
+
return encodedA.localeCompare(encodedB);
|
|
77
|
+
}
|