courthive-components 6.8.2 → 6.9.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/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # courthive-components
2
2
 
3
- Vanilla JavaScript UI components for tennis tournament management and competition displays.
3
+ Framework-independent TypeScript UI components for tournament management and competition displays.
4
4
 
5
5
  [![Storybook](https://img.shields.io/badge/Storybook-Documentation-ff4785?logo=storybook)](https://courthive.github.io/courthive-components/)
6
6
  [![npm version](https://img.shields.io/npm/v/courthive-components.svg)](https://www.npmjs.com/package/courthive-components)
@@ -25,6 +25,16 @@ pnpm add courthive-components
25
25
  `yarn add courthive-components`. Inside the CourtHive monorepo,
26
26
  pnpm is the only supported manager.)
27
27
 
28
+ ## Feature imports
29
+
30
+ SVG-only consumers such as a marketing hero can import from `courthive-components/courts`.
31
+ The segmented bar is also available from `courthive-components/segmented-bar`.
32
+ These additive ESM entries avoid loading the root editor, scoring and engine dependencies.
33
+ Import `courthive-components/features.css` for their styles; it contains the small court/bar stylesheets.
34
+ The existing root export and `dist/courthive-components.css` remain supported with their existing cascade.
35
+ Run `pnpm build && pnpm verify:consumer-bundle` to check consumer JS and feature CSS budgets.
36
+ Update a budget deliberately with `pnpm verify:consumer-bundle --update-baseline` after reviewing the measurements.
37
+
28
38
  ## Quick Start
29
39
 
30
40
  ```javascript
@@ -69,11 +79,11 @@ const element = renderMatchUp({
69
79
  Display a complete draw structure (bracket, round robin, etc.).
70
80
 
71
81
  ```javascript
72
- import { renderStructure } from 'courthive-components';
82
+ import { renderStructure, compositions } from 'courthive-components';
73
83
 
74
84
  const element = renderStructure({
75
- structure: drawStructure,
76
- config: { showSeeds: true }
85
+ matchUps: drawMatchUps,
86
+ composition: compositions.Basic
77
87
  });
78
88
  ```
79
89
 
@@ -85,7 +95,7 @@ Display a single round of matches within a structure.
85
95
  import { renderRound } from 'courthive-components';
86
96
 
87
97
  const element = renderRound({
88
- round: roundData,
98
+ matchUps: roundMatchUps,
89
99
  roundNumber: 1
90
100
  });
91
101
  ```
@@ -98,8 +108,7 @@ Display participant information (name, rating, country, etc.).
98
108
  import { renderParticipant } from 'courthive-components';
99
109
 
100
110
  const element = renderParticipant({
101
- participant: participantData,
102
- showRating: true
111
+ participant: participantData
103
112
  });
104
113
  ```
105
114
 
@@ -130,8 +139,10 @@ Autocomplete input for participant selection.
130
139
  import { renderParticipantInput } from 'courthive-components';
131
140
 
132
141
  const input = renderParticipantInput({
133
- participants: participantsList,
134
- onSelect: (participant) => console.log('Selected:', participant)
142
+ matchUp: matchUpData,
143
+ side: matchUpData.sides[0],
144
+ composition: { configuration: { participantProvider: () => participantsList } },
145
+ eventHandlers: { assignParticipant: ({ participant }) => console.log('Selected:', participant) }
135
146
  });
136
147
  ```
137
148
 
@@ -156,6 +167,11 @@ cModal.open({
156
167
 
157
168
  #### **scoringModal**
158
169
 
170
+ Two scoring APIs remain supported. New integrations should use `openScoreEntryDialog`
171
+ (the shared model/store-based card dialog); see `src/components/scoring/TMX_INTEGRATION.md`
172
+ for its engine-outcome handoff. TMX chooses between it and `scoringModal` through a feature flag.
173
+ `scoringModal` below is the existing configurable modal API. Their callback contracts differ.
174
+
159
175
  Interactive score entry with multiple input approaches.
160
176
 
161
177
  ```javascript
@@ -272,7 +288,7 @@ import { compositions } from 'courthive-components';
272
288
  compositions.Australian; // Australian Open colors
273
289
  compositions.French; // Roland Garros colors
274
290
  compositions.Wimbledon; // Wimbledon colors
275
- compositions.US; // US Open colors
291
+ compositions['US Open']; // US Open colors
276
292
  ```
277
293
 
278
294
  ### Constants
@@ -284,7 +300,7 @@ Pre-defined match format codes.
284
300
  ```javascript
285
301
  import { MATCH_FORMATS } from 'courthive-components';
286
302
 
287
- console.log(MATCH_FORMATS.BEST_OF_3_TB7);
303
+ console.log(MATCH_FORMATS.SET3_S6_TB7);
288
304
  // 'SET3-S:6/TB7'
289
305
  ```
290
306
 
@@ -1,8 +1,8 @@
1
1
  import { availability, AvailabilityEngine } from 'tods-competition-factory';
2
- import { AvailabilityViewState } from '../engine/viewState';
3
- import { DEFAULT_COLOR_SCHEME, ResourceGroupingMode } from './viewProjections';
4
2
  import { BlockPopoverManager } from '../ui/blockPopover';
3
+ import { AvailabilityViewState } from '../engine/viewState';
5
4
  import { CourtTimeline } from '../timeline/CourtTimeline';
5
+ import { DEFAULT_COLOR_SCHEME, ResourceGroupingMode } from './viewProjections';
6
6
  type BlockType = availability.BlockType;
7
7
  type CourtRef = availability.CourtRef;
8
8
  type DayId = availability.DayId;
@@ -61,6 +61,9 @@ export interface AvailabilityGridControlConfig {
61
61
  export declare class AvailabilityGridControl {
62
62
  private readonly engine;
63
63
  private timeline;
64
+ private disposed;
65
+ private mountTimer;
66
+ private popoverTimer;
64
67
  private readonly config;
65
68
  private unsubscribe;
66
69
  private currentItems;
@@ -86,6 +86,7 @@ export declare class AvailabilityGrid {
86
86
  private statsBarInstance;
87
87
  private viewToolbarResult;
88
88
  private datepicker;
89
+ private courtVisibilityCustomized;
89
90
  private visibleCourts;
90
91
  private initialSnapshot;
91
92
  private isDirty;
@@ -55,4 +55,5 @@ export declare function getAgeCategoryModal({ existingAgeCategoryCode, existingC
55
55
  disabled?: boolean;
56
56
  label?: string;
57
57
  }) => void;
58
+ close: () => void;
58
59
  };
@@ -129,4 +129,5 @@ export declare function getMatchUpFormatModal({ existingMatchUpFormat, callback,
129
129
  disabled?: boolean;
130
130
  label?: string;
131
131
  }) => void;
132
+ close: () => void;
132
133
  };
@@ -6,7 +6,7 @@ export declare function isArray(item: any): item is any[];
6
6
  export declare function isObject(item: any): item is object;
7
7
  export declare function removeAllChildNodes(parent: HTMLElement | null): void;
8
8
  export declare const cModal: {
9
- close: (conditional?: boolean) => void;
9
+ close: (conditional?: boolean, ownedId?: number, cascade?: boolean) => void;
10
10
  open: ({ title, content, buttons, footer, config, onClose }?: ModalParams) => {
11
11
  setContent: ({ content: newContent, config }: {
12
12
  content?: ModalContent;
@@ -29,6 +29,7 @@ export declare const cModal: {
29
29
  disabled?: boolean;
30
30
  label?: string;
31
31
  }) => void;
32
+ close: () => void;
32
33
  };
33
34
  };
34
35
  export {};
@@ -45,4 +45,5 @@ export declare function openScheduleCellConfigModal(options?: ScheduleCellConfig
45
45
  disabled?: boolean;
46
46
  label?: string;
47
47
  }) => void;
48
+ close: () => void;
48
49
  };
@@ -174,6 +174,8 @@ export type ScoreEntryCard = {
174
174
  * Escape calls it first, wherever focus is, so one Escape closes the menu and a second one cancels.
175
175
  */
176
176
  closeMenus: () => boolean;
177
+ /** Release resources before removing an inline card or its modal. Safe to repeat. */
178
+ destroy: () => void;
177
179
  /** Re-render the band and the submit gate. Call when the score region's value changes. */
178
180
  refresh: () => void;
179
181
  /** Rebuild everything, including the region's cells. Call when the region's COLUMNS change. */