@dreamboard-games/sdk 0.5.0-alpha.35 → 0.5.0-alpha.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -0
- package/dist/{board-element-Bdc0Kv6W.d.ts → board-element-yXrGm5eP.d.ts} +1 -1
- package/dist/{chunk-JWPWE5EI.js → chunk-54U3ZCFA.js} +15 -6
- package/dist/chunk-54U3ZCFA.js.map +1 -0
- package/dist/{chunk-UGWQKBR6.js → chunk-75QTSYRZ.js} +15 -9
- package/dist/chunk-75QTSYRZ.js.map +1 -0
- package/dist/{diagnostics-DNGfYfY8.d.ts → diagnostics-Bgu7w8LA.d.ts} +1 -1
- package/dist/{extract-BF6nUlze.d.ts → extract-_TyEXSCt.d.ts} +1 -0
- package/dist/index.d.ts +6 -6
- package/dist/index.js +2 -2
- package/dist/{model-C7ScBVY5.d.ts → model-U0F5B3cr.d.ts} +2 -2
- package/dist/react.d.ts +3 -3
- package/dist/react.js +1 -1
- package/dist/reducer.d.ts +6 -6
- package/dist/reducer.js +21 -10
- package/dist/reducer.js.map +1 -1
- package/dist/{shortcuts-BQEIVHSm.d.ts → shortcuts-DXkAlfNw.d.ts} +2 -2
- package/dist/testing.d.ts +2 -2
- package/dist/testing.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-JWPWE5EI.js.map +0 -1
- package/dist/chunk-UGWQKBR6.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { aN as ReducerContractVersion, s as BotStrategyMetadata, aC as PluginGameplayFrame, r as BotDecision, X as InitializeRequest, Y as InitializeResult, G as DispatchRequest, H as DispatchResult, aH as ProjectRequest, b9 as SeatProjectionBundle } from './extract-
|
|
1
|
+
import { aN as ReducerContractVersion, s as BotStrategyMetadata, aC as PluginGameplayFrame, r as BotDecision, X as InitializeRequest, Y as InitializeResult, G as DispatchRequest, H as DispatchResult, aH as ProjectRequest, b9 as SeatProjectionBundle } from './extract-_TyEXSCt.js';
|
|
2
2
|
|
|
3
3
|
/** Exact worker ABI version; hosts must reject mismatched bundles. */
|
|
4
4
|
declare const REDUCER_CONTRACT_VERSION: "0.11.0";
|
|
@@ -6424,6 +6424,7 @@ type GameStateOf<Source> = Source extends {
|
|
|
6424
6424
|
} ? Definitions extends PhaseMapOf<Contract> ? ResolvedGameStateOf<Contract, Definitions> : never : Source extends ReducerGameContract<any, any, any, any, any, any, any, any> ? BaseGameStateOfContract<Source> : never;
|
|
6425
6425
|
/** Structural contract used by the runtime; authored generics retain their exact schemas. */
|
|
6426
6426
|
type ReducerGameContractLike = {
|
|
6427
|
+
errors?: Readonly<Record<string, string>>;
|
|
6427
6428
|
manifest: ReducerManifestContractLike<RuntimeTableRecord>;
|
|
6428
6429
|
options: SchemaLike<RuntimeRecord>;
|
|
6429
6430
|
state: StateDefinition<SchemaLike<object>, SchemaLike<object>, SchemaLike<object>>;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { r as Features, J as InstanceOptions, n as CoreInstance, q as FeatureContext, G as GameInstance, C as Card, I as IdOf, ac as Zone, a4 as SeatCardId, d as BoardCollection, h as BoardSpaceCollection, c as BoardBase, Y as RuntimeBoard, a3 as RuntimeTargetOptions, A as ActionProps, e as BoardDataOf, g as BoardSpace, a7 as TargetOptions, p as DropTarget, ae as ZoneHostId } from './model-
|
|
2
|
-
export { a as AnyInput, b as AnyInteraction, B as Board, f as BoardDropTarget, i as BoardSpaceData, j as BoardSpaceId, k as BoardTarget, l as CardBase, m as CardDataOf, D as Drafts, o as DropAreaBinding, F as Feature, s as GameSnapshot, H as Hook, t as Input, u as InputBase, v as InputControl, w as InputDomainOf, x as InputKey, y as InputKind, z as InputTarget, E as InputTargetOption, K as Interaction, L as InteractionBase, M as InteractionDropTarget, N as InteractionKey, O as InteractionParams, P as LocalState, Q as NativeEvent, R as Phase, S as PhaseName, T as PlacedTileDataOf, U as Player, V as PositionDropTarget, W as ReadModel, X as ReadonlyData, Z as RuntimeBoardDropTarget, _ as RuntimeBoardTarget, $ as RuntimeDropTarget, a0 as RuntimeInteractionDropTarget, a1 as RuntimePositionDropTarget, a2 as RuntimeSelectionTarget, a5 as SelectionTarget, a6 as TableOfGame, a8 as Tile, a9 as TileDataOf, aa as Turn, ab as ViewOf, ad as ZoneBase } from './model-
|
|
3
|
-
import { a8 as InteractionDescriptor, V as GameplayBasis, aE as PluginSessionDescriptor, aC as PluginGameplayFrame, b0 as RuntimeJson, S as GameSource, be as SourceSnapshot, D as CommandSource, b8 as SeatBoardTopology, bb as SeatTileRef, ba as SeatSpaceRef, g as BoardEdge, o as BoardVertex, bL as ZoneInteractionRefs, az as PlayerId, aU as ReducerSeatProjectionBundle, b9 as SeatProjectionBundle, h as BoardEdgeId, p as BoardVertexId } from './extract-
|
|
4
|
-
export { A as ActionInteractionDescriptor, b as ApplySource, k as BoardSpaceHostId, aI as GameEvent, aJ as GameEventDetail, Q as GameOutcome, W as HiddenCardId, $ as InputDomain, a0 as InputDomainSchema, a1 as InputSelection, a3 as InteractionAvailability, a4 as InteractionAvailabilitySchema, a5 as InteractionChoiceOption, a6 as InteractionCommitPolicy, a7 as InteractionCommitPolicySchema, a9 as InteractionDescriptorSchema, aa as InteractionDiagnosticReason, ac as InteractionInputDescriptor, ad as InteractionInputDescriptorSchema, aq as OutcomeResult, ar as OutcomeScoreComponent, as as OutcomeStanding, at as OutcomeTieBreak, au as PerPlayerInstanceFamily, av as PerPlayerInstanceId, aD as PluginPlayerSummary, aK as ProjectedTile, b1 as RuntimeJsonSchema, bc as SimultaneousPhaseSnapshot, bd as SourceRequest, bf as SourceState, bj as SubmitResult, aI as SystemActionEvent, bB as ViewCard, bD as ViewCardSchema, bJ as ZoneHandlesSnapshot, bO as boardSpaceHostId, bQ as parseBoardSpaceHostId, bR as parsePerPlayerInstanceId, bT as perPlayerInstanceId } from './extract-
|
|
1
|
+
import { r as Features, J as InstanceOptions, n as CoreInstance, q as FeatureContext, G as GameInstance, C as Card, I as IdOf, ac as Zone, a4 as SeatCardId, d as BoardCollection, h as BoardSpaceCollection, c as BoardBase, Y as RuntimeBoard, a3 as RuntimeTargetOptions, A as ActionProps, e as BoardDataOf, g as BoardSpace, a7 as TargetOptions, p as DropTarget, ae as ZoneHostId } from './model-U0F5B3cr.js';
|
|
2
|
+
export { a as AnyInput, b as AnyInteraction, B as Board, f as BoardDropTarget, i as BoardSpaceData, j as BoardSpaceId, k as BoardTarget, l as CardBase, m as CardDataOf, D as Drafts, o as DropAreaBinding, F as Feature, s as GameSnapshot, H as Hook, t as Input, u as InputBase, v as InputControl, w as InputDomainOf, x as InputKey, y as InputKind, z as InputTarget, E as InputTargetOption, K as Interaction, L as InteractionBase, M as InteractionDropTarget, N as InteractionKey, O as InteractionParams, P as LocalState, Q as NativeEvent, R as Phase, S as PhaseName, T as PlacedTileDataOf, U as Player, V as PositionDropTarget, W as ReadModel, X as ReadonlyData, Z as RuntimeBoardDropTarget, _ as RuntimeBoardTarget, $ as RuntimeDropTarget, a0 as RuntimeInteractionDropTarget, a1 as RuntimePositionDropTarget, a2 as RuntimeSelectionTarget, a5 as SelectionTarget, a6 as TableOfGame, a8 as Tile, a9 as TileDataOf, aa as Turn, ab as ViewOf, ad as ZoneBase } from './model-U0F5B3cr.js';
|
|
3
|
+
import { a8 as InteractionDescriptor, V as GameplayBasis, aE as PluginSessionDescriptor, aC as PluginGameplayFrame, b0 as RuntimeJson, S as GameSource, be as SourceSnapshot, D as CommandSource, b8 as SeatBoardTopology, bb as SeatTileRef, ba as SeatSpaceRef, g as BoardEdge, o as BoardVertex, bL as ZoneInteractionRefs, az as PlayerId, aU as ReducerSeatProjectionBundle, b9 as SeatProjectionBundle, h as BoardEdgeId, p as BoardVertexId } from './extract-_TyEXSCt.js';
|
|
4
|
+
export { A as ActionInteractionDescriptor, b as ApplySource, k as BoardSpaceHostId, aI as GameEvent, aJ as GameEventDetail, Q as GameOutcome, W as HiddenCardId, $ as InputDomain, a0 as InputDomainSchema, a1 as InputSelection, a3 as InteractionAvailability, a4 as InteractionAvailabilitySchema, a5 as InteractionChoiceOption, a6 as InteractionCommitPolicy, a7 as InteractionCommitPolicySchema, a9 as InteractionDescriptorSchema, aa as InteractionDiagnosticReason, ac as InteractionInputDescriptor, ad as InteractionInputDescriptorSchema, aq as OutcomeResult, ar as OutcomeScoreComponent, as as OutcomeStanding, at as OutcomeTieBreak, au as PerPlayerInstanceFamily, av as PerPlayerInstanceId, aD as PluginPlayerSummary, aK as ProjectedTile, b1 as RuntimeJsonSchema, bc as SimultaneousPhaseSnapshot, bd as SourceRequest, bf as SourceState, bj as SubmitResult, aI as SystemActionEvent, bB as ViewCard, bD as ViewCardSchema, bJ as ZoneHandlesSnapshot, bO as boardSpaceHostId, bQ as parseBoardSpaceHostId, bR as parsePerPlayerInstanceId, bT as perPlayerInstanceId } from './extract-_TyEXSCt.js';
|
|
5
5
|
import * as z from 'zod';
|
|
6
|
-
export { I as InteractionShortcutBinding, L as LocalShortcutBinding, S as ShortcutActivity, a as ShortcutBinding, b as ShortcutHint, c as ShortcutOptions, d as ShortcutResult, e as ShortcutTarget, f as ShortcutZoneTarget, g as ShortcutsController, s as shortcutsFeature } from './shortcuts-
|
|
7
|
-
export { b as boardEdgeId, a as boardVertexId, p as parseBoardElementId } from './board-element-
|
|
6
|
+
export { I as InteractionShortcutBinding, L as LocalShortcutBinding, S as ShortcutActivity, a as ShortcutBinding, b as ShortcutHint, c as ShortcutOptions, d as ShortcutResult, e as ShortcutTarget, f as ShortcutZoneTarget, g as ShortcutsController, s as shortcutsFeature } from './shortcuts-DXkAlfNw.js';
|
|
7
|
+
export { b as boardEdgeId, a as boardVertexId, p as parseBoardElementId } from './board-element-yXrGm5eP.js';
|
|
8
8
|
import '@tanstack/store';
|
|
9
9
|
import 'honeycomb-grid';
|
|
10
10
|
|
package/dist/index.js
CHANGED
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
isSameDropTarget,
|
|
7
7
|
magneticDropPoint,
|
|
8
8
|
runtimeFeatures
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-54U3ZCFA.js";
|
|
10
10
|
import {
|
|
11
11
|
CancelInteractionCommandSchema,
|
|
12
12
|
CompactGameplayFrameSchema,
|
|
@@ -78,7 +78,7 @@ import {
|
|
|
78
78
|
} from "./chunk-7GX27XU6.js";
|
|
79
79
|
|
|
80
80
|
// src/package-set.ts
|
|
81
|
-
var DREAMBOARD_SDK_VERSION = true ? "0.5.0-alpha.
|
|
81
|
+
var DREAMBOARD_SDK_VERSION = true ? "0.5.0-alpha.36" : "0.0.0-development";
|
|
82
82
|
var DREAMBOARD_SDK_PACKAGES = {
|
|
83
83
|
"@dreamboard-games/sdk": DREAMBOARD_SDK_VERSION
|
|
84
84
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { l as BoardSpaceTarget, by as TopologyDefinitions, j as BoardIdOfTable, bs as TileSpaceId, ba as SeatSpaceRef, bg as SpaceIdOfTable, bv as TiledBoardIdOfTable, bw as TiledEdgeIdOfTable, bx as TiledVertexIdOfTable, m as BoardStateOfTable, aF as PositionTarget, bb as SeatTileRef, b0 as RuntimeJson, b8 as SeatBoardTopology, be as SourceSnapshot, bf as SourceState, bj as SubmitResult, ac as InteractionInputDescriptor, $ as InputDomain, S as GameSource, ay as PhaseNamesOfDefinition, ab as InteractionIdOfDefinitionPhase, w as ClientParamsOfInteractionOfDefinition, _ as InputCollectorOfDefinition, bH as ViewOfDefinition, a8 as InteractionDescriptor, aK as ProjectedTile, aM as ReadonlyRuntimeData, n as BoardTopologyOf, W as HiddenCardId, bB as ViewCard, bC as ViewCardOfTable, N as GameEvent } from './extract-
|
|
1
|
+
import { l as BoardSpaceTarget, by as TopologyDefinitions, j as BoardIdOfTable, bs as TileSpaceId, ba as SeatSpaceRef, bg as SpaceIdOfTable, bv as TiledBoardIdOfTable, bw as TiledEdgeIdOfTable, bx as TiledVertexIdOfTable, m as BoardStateOfTable, aF as PositionTarget, bb as SeatTileRef, b0 as RuntimeJson, b8 as SeatBoardTopology, be as SourceSnapshot, bf as SourceState, bj as SubmitResult, ac as InteractionInputDescriptor, $ as InputDomain, S as GameSource, ay as PhaseNamesOfDefinition, ab as InteractionIdOfDefinitionPhase, w as ClientParamsOfInteractionOfDefinition, _ as InputCollectorOfDefinition, bH as ViewOfDefinition, a8 as InteractionDescriptor, aK as ProjectedTile, aM as ReadonlyRuntimeData, n as BoardTopologyOf, W as HiddenCardId, bB as ViewCard, bC as ViewCardOfTable, N as GameEvent } from './extract-_TyEXSCt.js';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
import { Store } from '@tanstack/store';
|
|
4
4
|
|
|
@@ -527,7 +527,7 @@ interface InteractionBase<G, K extends InteractionKey<G>> {
|
|
|
527
527
|
readonly help?: string;
|
|
528
528
|
readonly kind: "inputs" | "steps";
|
|
529
529
|
readonly game: CoreInstance<G>;
|
|
530
|
-
getAvailability(): InteractionDescriptor["availability"];
|
|
530
|
+
getAvailability(params?: InteractionParams<G, K>): InteractionDescriptor["availability"];
|
|
531
531
|
getIsAvailable(params?: InteractionParams<G, K>): boolean;
|
|
532
532
|
getUnavailableReason(): string | null;
|
|
533
533
|
getStep(): InteractionDescriptor["step"] | null;
|
package/dist/react.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { PointerEvent, FocusEvent, MouseEvent, DragEvent, CSSProperties, ReactNode } from 'react';
|
|
3
|
-
import { aF as PositionTarget, bM as ZoneVisibility, S as GameSource } from './extract-
|
|
4
|
-
import { f as ShortcutZoneTarget, c as ShortcutOptions, e as ShortcutTarget, b as ShortcutHint } from './shortcuts-
|
|
5
|
-
import { a7 as TargetOptions, r as Features, C as Card, a4 as SeatCardId, p as DropTarget, I as IdOf, ae as ZoneHostId, J as InstanceOptions, n as CoreInstance, q as FeatureContext, G as GameInstance, s as GameSnapshot, o as DropAreaBinding } from './model-
|
|
3
|
+
import { aF as PositionTarget, bM as ZoneVisibility, S as GameSource } from './extract-_TyEXSCt.js';
|
|
4
|
+
import { f as ShortcutZoneTarget, c as ShortcutOptions, e as ShortcutTarget, b as ShortcutHint } from './shortcuts-DXkAlfNw.js';
|
|
5
|
+
import { a7 as TargetOptions, r as Features, C as Card, a4 as SeatCardId, p as DropTarget, I as IdOf, ae as ZoneHostId, J as InstanceOptions, n as CoreInstance, q as FeatureContext, G as GameInstance, s as GameSnapshot, o as DropAreaBinding } from './model-U0F5B3cr.js';
|
|
6
6
|
import '@tanstack/store';
|
|
7
7
|
import 'zod';
|
|
8
8
|
import 'honeycomb-grid';
|
package/dist/react.js
CHANGED
package/dist/reducer.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { al as ManifestIdSchema, b6 as SchemaLike, x as CollectorState, Z as InputCollector, aB as PlayerIdOfState, bn as TableQueriesOfState, aZ as ResourceMapDomainDescriptor, t as BoundedNumberDomainDescriptor, u as ChoiceDomainDescriptor, v as ChoiceListDomainDescriptor, by as TopologyDefinitions, z as CollectorValueWitness, y as CollectorValueOf, a2 as InputSelectionDescriptor, aT as ReducerManifestContractLike, b4 as RuntimeTableRecord, b3 as RuntimeRecord, bi as StateDefinition, aj as ManifestContractOf, B as BaseGameStateOfContract, I as ErrorCodeOfContract, bv as TiledBoardIdOfTable, bl as TableOfManifest, bx as TiledVertexIdOfTable, bw as TiledEdgeIdOfTable, j as BoardIdOfTable, bg as SpaceIdOfTable, l as BoardSpaceTarget, av as PerPlayerInstanceId, bK as ZoneIdOfTable, C as CardIdOfManifest, aG as PositionTargetSchema, aF as PositionTarget, bq as TileIdOfTable, ap as OptionsOfContract, aW as ReducerTransaction, bE as ViewData, bF as ViewDefinition, ax as PhaseMapOf, bG as ViewOfContract, aR as ReducerGameDefinitionInput, aQ as ReducerGameDefinition, ai as InteractionSteps, b7 as ScopedPhaseState, ag as InteractionSpec, af as InteractionRule, aw as PhaseDefinition, ae as InteractionMap, aS as ReducerManifestContract, aO as ReducerGameContract, F as CompiledManifestWitness, E as CompiledManifest, bk as SystemActionEvent, s as BotStrategyMetadata, aC as PluginGameplayFrame, bH as ViewOfDefinition, ay as PhaseNamesOfDefinition, ab as InteractionIdOfDefinitionPhase, w as ClientParamsOfInteractionOfDefinition, bY as validatedReducerDefinition, an as ManifestOf, ah as InteractionSpecByNameOfDefinitionPhase, _ as InputCollectorOfDefinition, aP as ReducerGameContractLike, b2 as RuntimeQueryTable, bI as ZoneDefinitions, bm as TableQueries, b5 as SchemaAuthoring, U as GameTopologyManifest$1, K as FieldsInput, e as AuthoredTileDisclosure, a$ as RuntimeIdsFromCount, bt as TileSpaceIds, i as BoardEdgeRef, q as BoardVertexRef, ak as ManifestCountValidation, bz as ValidatedManifest, c as AuthoredManifest, aM as ReadonlyRuntimeData, d as AuthoredOf } from './extract-
|
|
2
|
-
export { f as AuthoredTileFaceAudience, h as BoardEdgeId, k as BoardSpaceHostId, p as BoardVertexId, J as FieldSchema, L as FieldsOutput, M as FrameworkErrorCodes, N as GameEvent, O as GameEventDetail, Q as GameOutcome, am as ManifestIdsOf, ao as ManifestTable, aq as OutcomeResult, ar as OutcomeScoreComponent, as as OutcomeStanding, at as OutcomeTieBreak, au as PerPlayerInstanceFamily, aA as PlayerId, aL as PublicTileAppearance, aX as ReducerTransactionOutcome, aY as ReducerValidationResult, bW as ReducerWire, bV as ReducerWireZod, a_ as RotateZoneArgs, ba as SeatSpaceRef, bb as SeatTileRef, bh as SquareBoardSpec, bo as TileDisclosure, bp as TileFaceAudience, br as TileSeedSpec, bs as TileSpaceId, bu as TileTypeSpec, bA as ValidationIssue, bN as asPlayerId, bO as boardSpaceHostId, bP as isPlayerId, bQ as parseBoardSpaceHostId, bR as parsePerPlayerInstanceId, bS as parseTileSpaceId, bT as perPlayerInstanceId, bU as ref, bX as tileSpaceId } from './extract-
|
|
1
|
+
import { al as ManifestIdSchema, b6 as SchemaLike, x as CollectorState, Z as InputCollector, aB as PlayerIdOfState, bn as TableQueriesOfState, aZ as ResourceMapDomainDescriptor, t as BoundedNumberDomainDescriptor, u as ChoiceDomainDescriptor, v as ChoiceListDomainDescriptor, by as TopologyDefinitions, z as CollectorValueWitness, y as CollectorValueOf, a2 as InputSelectionDescriptor, aT as ReducerManifestContractLike, b4 as RuntimeTableRecord, b3 as RuntimeRecord, bi as StateDefinition, aj as ManifestContractOf, B as BaseGameStateOfContract, I as ErrorCodeOfContract, bv as TiledBoardIdOfTable, bl as TableOfManifest, bx as TiledVertexIdOfTable, bw as TiledEdgeIdOfTable, j as BoardIdOfTable, bg as SpaceIdOfTable, l as BoardSpaceTarget, av as PerPlayerInstanceId, bK as ZoneIdOfTable, C as CardIdOfManifest, aG as PositionTargetSchema, aF as PositionTarget, bq as TileIdOfTable, ap as OptionsOfContract, aW as ReducerTransaction, bE as ViewData, bF as ViewDefinition, ax as PhaseMapOf, bG as ViewOfContract, aR as ReducerGameDefinitionInput, aQ as ReducerGameDefinition, ai as InteractionSteps, b7 as ScopedPhaseState, ag as InteractionSpec, af as InteractionRule, aw as PhaseDefinition, ae as InteractionMap, aS as ReducerManifestContract, aO as ReducerGameContract, F as CompiledManifestWitness, E as CompiledManifest, bk as SystemActionEvent, s as BotStrategyMetadata, aC as PluginGameplayFrame, bH as ViewOfDefinition, ay as PhaseNamesOfDefinition, ab as InteractionIdOfDefinitionPhase, w as ClientParamsOfInteractionOfDefinition, bY as validatedReducerDefinition, an as ManifestOf, ah as InteractionSpecByNameOfDefinitionPhase, _ as InputCollectorOfDefinition, aP as ReducerGameContractLike, b2 as RuntimeQueryTable, bI as ZoneDefinitions, bm as TableQueries, b5 as SchemaAuthoring, U as GameTopologyManifest$1, K as FieldsInput, e as AuthoredTileDisclosure, a$ as RuntimeIdsFromCount, bt as TileSpaceIds, i as BoardEdgeRef, q as BoardVertexRef, ak as ManifestCountValidation, bz as ValidatedManifest, c as AuthoredManifest, aM as ReadonlyRuntimeData, d as AuthoredOf } from './extract-_TyEXSCt.js';
|
|
2
|
+
export { f as AuthoredTileFaceAudience, h as BoardEdgeId, k as BoardSpaceHostId, p as BoardVertexId, J as FieldSchema, L as FieldsOutput, M as FrameworkErrorCodes, N as GameEvent, O as GameEventDetail, Q as GameOutcome, am as ManifestIdsOf, ao as ManifestTable, aq as OutcomeResult, ar as OutcomeScoreComponent, as as OutcomeStanding, at as OutcomeTieBreak, au as PerPlayerInstanceFamily, aA as PlayerId, aL as PublicTileAppearance, aX as ReducerTransactionOutcome, aY as ReducerValidationResult, bW as ReducerWire, bV as ReducerWireZod, a_ as RotateZoneArgs, ba as SeatSpaceRef, bb as SeatTileRef, bh as SquareBoardSpec, bo as TileDisclosure, bp as TileFaceAudience, br as TileSeedSpec, bs as TileSpaceId, bu as TileTypeSpec, bA as ValidationIssue, bN as asPlayerId, bO as boardSpaceHostId, bP as isPlayerId, bQ as parseBoardSpaceHostId, bR as parsePerPlayerInstanceId, bS as parseTileSpaceId, bT as perPlayerInstanceId, bU as ref, bX as tileSpaceId } from './extract-_TyEXSCt.js';
|
|
3
3
|
import * as z from 'zod';
|
|
4
4
|
import { z as z$1 } from 'zod';
|
|
5
5
|
export { z };
|
|
6
|
-
import { N as InteractionKey } from './model-
|
|
7
|
-
import { a as ReducerBundleContract, c as ReducerDiagnosticsSink } from './diagnostics-
|
|
8
|
-
export { D as DispatchTraceSummaryEntry, M as MaybePromise, R as REDUCER_CONTRACT_VERSION, b as ReducerDiagnosticEvent, d as assertReducerBundleContract, n as noopDiagnosticsSink } from './diagnostics-
|
|
9
|
-
export { b as boardEdgeId, a as boardVertexId, p as parseBoardElementId } from './board-element-
|
|
6
|
+
import { N as InteractionKey } from './model-U0F5B3cr.js';
|
|
7
|
+
import { a as ReducerBundleContract, c as ReducerDiagnosticsSink } from './diagnostics-Bgu7w8LA.js';
|
|
8
|
+
export { D as DispatchTraceSummaryEntry, M as MaybePromise, R as REDUCER_CONTRACT_VERSION, b as ReducerDiagnosticEvent, d as assertReducerBundleContract, n as noopDiagnosticsSink } from './diagnostics-Bgu7w8LA.js';
|
|
9
|
+
export { b as boardEdgeId, a as boardVertexId, p as parseBoardElementId } from './board-element-yXrGm5eP.js';
|
|
10
10
|
import '@tanstack/store';
|
|
11
11
|
import 'honeycomb-grid';
|
|
12
12
|
|
package/dist/reducer.js
CHANGED
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
sparseMap,
|
|
29
29
|
unwrapWrappers,
|
|
30
30
|
validatedReducerDefinition
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-75QTSYRZ.js";
|
|
32
32
|
import {
|
|
33
33
|
CARD_REFERENCE_PREFIX,
|
|
34
34
|
boardSpaceHostId,
|
|
@@ -609,20 +609,31 @@ var DEFAULT_MISSING_CANDIDATE_ISSUE = {
|
|
|
609
609
|
function createTargetRule(candidates, predicates, options = {}) {
|
|
610
610
|
const missingCandidateIssue = options.missingCandidateIssue ?? DEFAULT_MISSING_CANDIDATE_ISSUE;
|
|
611
611
|
const equals = options.equals ?? Object.is;
|
|
612
|
-
const
|
|
613
|
-
for (const
|
|
614
|
-
if (!
|
|
615
|
-
|
|
616
|
-
if (!predicate.test({ ...ctx, targetId: candidate })) {
|
|
617
|
-
return { errorCode: predicate.errorCode, message: predicate.message };
|
|
618
|
-
}
|
|
612
|
+
const validateCandidate = (ctx, targetId) => {
|
|
613
|
+
for (const predicate of predicates) {
|
|
614
|
+
if (!predicate.test({ ...ctx, targetId })) {
|
|
615
|
+
return { errorCode: predicate.errorCode, message: predicate.message };
|
|
619
616
|
}
|
|
620
|
-
|
|
617
|
+
}
|
|
618
|
+
return null;
|
|
619
|
+
};
|
|
620
|
+
const validate = (ctx, target, resolved = candidates(ctx)) => {
|
|
621
|
+
for (const candidate of resolved) {
|
|
622
|
+
if (equals(candidate, target)) return validateCandidate(ctx, candidate);
|
|
621
623
|
}
|
|
622
624
|
return missingCandidateIssue;
|
|
623
625
|
};
|
|
624
626
|
const rule = {
|
|
625
|
-
eligible
|
|
627
|
+
eligible(ctx) {
|
|
628
|
+
const resolved = candidates(ctx);
|
|
629
|
+
if (equals === Object.is)
|
|
630
|
+
return resolved.filter(
|
|
631
|
+
(candidate) => validateCandidate(ctx, candidate) == null
|
|
632
|
+
);
|
|
633
|
+
return resolved.filter(
|
|
634
|
+
(target) => validate(ctx, target, resolved) == null
|
|
635
|
+
);
|
|
636
|
+
},
|
|
626
637
|
validate,
|
|
627
638
|
isEligible: (ctx, target) => validate(ctx, target) == null,
|
|
628
639
|
bind: (ctx) => ({
|