courthive-components 6.9.1 → 6.10.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.
@@ -27,6 +27,10 @@ export declare class InlineScoringManager {
27
27
  addGame(matchUpId: string, winner: 0 | 1, baseMatchUp: MatchUp): MatchUp | undefined;
28
28
  /**
29
29
  * Add a set score. Used in 'entry' mode.
30
+ *
31
+ * The factory judges the total by its segment's rule and refuses a total that is not a fact (a negative
32
+ * or non-integer score): that refusal records nothing and returns undefined, as input on a completed
33
+ * match does. An input the engine ignores (`recorded: false`) returns undefined too.
30
34
  */
31
35
  addSet(matchUpId: string, side1Score: number, side2Score: number, baseMatchUp: MatchUp): MatchUp | undefined;
32
36
  undo(matchUpId: string, baseMatchUp: MatchUp): MatchUp | undefined;
@@ -43,6 +47,11 @@ export declare class InlineScoringManager {
43
47
  canUndo(matchUpId: string): boolean;
44
48
  canRedo(matchUpId: string): boolean;
45
49
  isComplete(matchUpId: string): boolean;
50
+ /**
51
+ * Whether the set in play takes this input. The factory reports what each segment can be scored with
52
+ * (`getInputLevels`): a segment of outs takes set totals only, a combined-point total has no games.
53
+ */
54
+ accepts(matchUpId: string, level: 'point' | 'game'): boolean;
46
55
  remove(matchUpId: string): void;
47
56
  clear(): void;
48
57
  private notifyAndReturn;
@@ -39,5 +39,6 @@ export interface InlineScoringCallbacks {
39
39
  export interface InlineScoringEngineState {
40
40
  engine: any;
41
41
  matchUpFormat: string;
42
+ /** Points added in this session. Not a server: the engine derives who served. */
42
43
  pointCount: number;
43
44
  }
@@ -1,4 +1,11 @@
1
- import { Capabilities, CombinedPointsConfig, Codec, Edit, EditorState } from './types';
1
+ import { Capabilities, CombinedPointsConfig, Codec, Edit, EditorState, FormatState } from './types';
2
+ /**
3
+ * Whether the format may be scored as an aggregate. The factory refuses an aggregate of standard sets for
4
+ * a new format (CA 2026-10-18, scoring engine spec § 9.3 rule 5): an aggregate sums segments whose scores
5
+ * are units — timed, tiebreak-only and outs segments — and a standard set's games are not. Every segment
6
+ * is summed except an "Exactly" aggregate's final set, which is the decider played after the N.
7
+ */
8
+ export declare function aggregateAllowed(format: FormatState): boolean;
2
9
  /** A final set's tiebreak targets outside "Exactly" mode; "Exactly" also offers 1 and 3. */
3
10
  export declare const DEFAULT_TIEBREAK_TO_OPTIONS: number[];
4
11
  export interface EditContext {
@@ -1,5 +1,5 @@
1
1
  import { SchedulePageStore } from '../engine/schedulePageStore';
2
- import { SchedulePageConfig, CatalogMatchUpItem, ScheduleDate, ScheduleIssue, PendingScheduleAction } from '../types';
2
+ import { CatalogPlacement, InspectorPlacement, SchedulePageConfig, CatalogMatchUpItem, ScheduleDate, ScheduleIssue, PendingScheduleAction } from '../types';
3
3
  export declare class SchedulePageControl {
4
4
  private readonly store;
5
5
  private readonly layout;
@@ -8,6 +8,11 @@ export declare class SchedulePageControl {
8
8
  constructor(config: SchedulePageConfig);
9
9
  render(container: HTMLElement): void;
10
10
  destroy(): void;
11
+ /** Presentation-only changes retain the store and all pending scheduling work. */
12
+ setCatalogPlacement(placement: CatalogPlacement): void;
13
+ setCatalogVisible(visible: boolean): void;
14
+ setInspectorPlacement(placement: InspectorPlacement): void;
15
+ getCatalogRegion(): HTMLElement;
11
16
  setMatchUpCatalog(catalog: CatalogMatchUpItem[]): void;
12
17
  setScheduleDates(dates: ScheduleDate[]): void;
13
18
  setIssues(issues: ScheduleIssue[]): void;
@@ -1,5 +1,5 @@
1
- import { SchedulePageConfig } from './types';
2
1
  import { SchedulePageControl } from './controller/schedulePageControl';
2
+ import { SchedulePageConfig } from './types';
3
3
  /**
4
4
  * Schedule Page — Public API
5
5
  *
@@ -27,5 +27,5 @@ export type { ActiveStripPanel, ActiveStripPanelCallbacks, ActiveStripPanelData,
27
27
  export { buildScheduleGridCell, mapMatchUpToCellData, DEFAULT_SCHEDULE_CELL_CONFIG } from './ui/scheduleGridCell';
28
28
  export { activateScheduleCellTypeAhead } from './ui/scheduleCellTypeAhead';
29
29
  export type { ScheduleCellTypeAheadOptions } from './ui/scheduleCellTypeAhead';
30
- export type { CatalogMatchUpItem, CatalogFilters, MatchUpSide, ScheduleDate, ScheduleIssue, ScheduleIssueSeverity, ScheduleIssueIndex, ScheduleIssueCounts, MatchUpCatalogGroupBy, ScheduledBehavior, SchedulingMode, PendingScheduleAction, CatalogMatchUpDragPayload, GridMatchUpDragPayload, SchedulePageDragPayload, SchedulePageConfig, SchedulePageCatalogState, SchedulePageState, SchedulePageChangeListener, UIPanel, ScheduleCellConfig, ScheduleCellField, ParticipantDisplayConfig, ScheduleCellData, ScheduleCellSide } from './types';
30
+ export type { CatalogPlacement, InspectorPlacement, InspectorGeometry, CatalogMatchUpItem, CatalogFilters, MatchUpSide, ScheduleDate, ScheduleIssue, ScheduleIssueSeverity, ScheduleIssueIndex, ScheduleIssueCounts, MatchUpCatalogGroupBy, ScheduledBehavior, SchedulingMode, PendingScheduleAction, CatalogMatchUpDragPayload, GridMatchUpDragPayload, SchedulePageDragPayload, SchedulePageConfig, SchedulePageCatalogState, SchedulePageState, SchedulePageChangeListener, UIPanel, ScheduleCellConfig, ScheduleCellField, ParticipantDisplayConfig, ScheduleCellData, ScheduleCellSide } from './types';
31
31
  export declare function createSchedulePage(config: SchedulePageConfig, container: HTMLElement): SchedulePageControl;
@@ -120,6 +120,14 @@ export interface SchedulePageCatalogState {
120
120
  showCompleted?: boolean;
121
121
  showScheduled?: boolean;
122
122
  }
123
+ export type CatalogPlacement = 'left' | 'right' | 'bottom';
124
+ export type InspectorPlacement = 'docked' | 'floating';
125
+ export interface InspectorGeometry {
126
+ left: number;
127
+ top: number;
128
+ width: number;
129
+ height: number;
130
+ }
123
131
  export interface SchedulePageConfig {
124
132
  matchUpCatalog: CatalogMatchUpItem[];
125
133
  scheduleDates: ScheduleDate[];
@@ -134,6 +142,12 @@ export interface SchedulePageConfig {
134
142
  hideLeft?: boolean;
135
143
  /** Which side to place the matchUp catalog. Defaults to 'right'. */
136
144
  catalogSide?: 'left' | 'right';
145
+ /** Overrides catalogSide; changing presentation does not change scheduling state. */
146
+ catalogPlacement?: CatalogPlacement;
147
+ inspectorPlacement?: InspectorPlacement;
148
+ onInspectorPlacementChange?: (placement: InspectorPlacement) => void;
149
+ inspectorGeometry?: InspectorGeometry;
150
+ onInspectorGeometryChange?: (geometry: InspectorGeometry) => void;
137
151
  scheduledBehavior?: ScheduledBehavior;
138
152
  schedulingMode?: SchedulingMode;
139
153
  /** Initial visibility of the active strip (one-row court summary above the grid). Defaults to true. */
@@ -0,0 +1,17 @@
1
+ import { InspectorGeometry } from '../types';
2
+ export declare function clampInspectorGeometry(value: Partial<InspectorGeometry>, width: number, height: number): InspectorGeometry;
3
+ interface FloatingInspectorOptions {
4
+ geometry?: InspectorGeometry;
5
+ onGeometryChange?: (geometry: InspectorGeometry) => void;
6
+ onClose: () => void;
7
+ onDock: () => void;
8
+ }
9
+ /** A non-modal host. The caller owns selection, content, visibility and persistence. */
10
+ export declare function buildFloatingInspector(panel: HTMLElement, options: FloatingInspectorOptions): {
11
+ element: HTMLElement;
12
+ content: HTMLDivElement;
13
+ setVisible: (visible: boolean) => void;
14
+ rememberFocus: () => void;
15
+ destroy: () => void;
16
+ };
17
+ export {};
@@ -1,4 +1,4 @@
1
- import { SchedulePageState, UIPanel } from '../types';
1
+ import { SchedulePageConfig, CatalogPlacement, InspectorPlacement, SchedulePageState, UIPanel } from '../types';
2
2
  export interface SchedulePageLayoutPanels {
3
3
  dateStrip: UIPanel<SchedulePageState>;
4
4
  issuesPanel: UIPanel<SchedulePageState>;
@@ -8,11 +8,14 @@ export interface SchedulePageLayoutPanels {
8
8
  }
9
9
  export interface SchedulePageLayoutCallbacks {
10
10
  onToggleLeft: () => void;
11
+ onInspectorClose?: () => void;
11
12
  }
12
- export declare function buildSchedulePageLayout(panels: SchedulePageLayoutPanels, callbacks: SchedulePageLayoutCallbacks, options?: {
13
- hideLeft?: boolean;
14
- catalogSide?: 'left' | 'right';
15
- }): {
13
+ export declare function buildSchedulePageLayout(panels: SchedulePageLayoutPanels, callbacks: SchedulePageLayoutCallbacks, options?: Pick<SchedulePageConfig, 'hideLeft' | 'catalogSide' | 'catalogPlacement' | 'inspectorPlacement' | 'inspectorGeometry' | 'onInspectorGeometryChange' | 'onInspectorPlacementChange'>): {
16
14
  element: HTMLElement;
17
15
  update: (state: SchedulePageState) => void;
16
+ setCatalogPlacement: (placement: CatalogPlacement) => void;
17
+ setCatalogVisible: (visible: boolean) => void;
18
+ setInspectorPlacement: (placement: InspectorPlacement) => void;
19
+ catalogRegion: HTMLElement;
20
+ destroy: () => void;
18
21
  };
@@ -8,3 +8,12 @@ import { SetScore } from '../types';
8
8
  * deciding-point or win-by format (`P32DP`, `P32WB2`) never ends level, so it is never a completed tie.
9
9
  */
10
10
  export declare function isCompletedCombinedPointTie(sets: SetScore[], matchUpFormat?: string): boolean;
11
+ /**
12
+ * A match the factory completes with no winner: the combined-point tie above, and (factory 7.16, #5612)
13
+ * an exactly or aggregate count that closes level with no declared decider, such as `HAL2X-S:TB11` at one
14
+ * half each or `SET2XA-S:T10` level on games. The score dialogs judge completion by a winner, so they ask
15
+ * the factory: the entered sets are played through its ScoringEngine as set totals, and the result is a
16
+ * tie when the engine completes the match and names no winner. A set the engine refuses or ignores (one
17
+ * past the close) is not a completed tie.
18
+ */
19
+ export declare function isCompletedLevelClose(sets: SetScore[], matchUpFormat?: string): boolean;