courthive-components 3.9.0 → 3.11.0
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/components/burstChart/matchUpTransform.d.ts +9 -0
- package/dist/components/forms/renderForm.d.ts +16 -1
- package/dist/components/hive-id-login/buildHiveIDLogin.d.ts +20 -1
- package/dist/components/hive-id-login/types.d.ts +71 -0
- package/dist/components/schedule-page/types.d.ts +13 -0
- package/dist/courthive-components.css +1 -1
- package/dist/courthive-components.es.js +5325 -5187
- package/dist/courthive-components.umd.js +33 -33
- package/dist/index.d.ts +2 -1
- package/package.json +8 -8
|
@@ -1,4 +1,13 @@
|
|
|
1
1
|
import { SunburstDrawData } from './burstChart';
|
|
2
|
+
/**
|
|
3
|
+
* Pick the structure the progression sunburst should render from a draw's
|
|
4
|
+
* `getEventData().drawsData[i].structures`. A composite draw (round-robin
|
|
5
|
+
* qualifying → single-elimination main, or round-robin main → elimination
|
|
6
|
+
* playoff) must render its ELIMINATION structure, never the round-robin one.
|
|
7
|
+
* Returns the elimination structure (MAIN preferred, else the first), or
|
|
8
|
+
* `undefined` when the draw has no bracket (pure round-robin).
|
|
9
|
+
*/
|
|
10
|
+
export declare function pickProgressionStructure(structures?: any[]): any | undefined;
|
|
2
11
|
/**
|
|
3
12
|
* Convert a tods-competition-factory `getEventData().drawsData[i].structures[0]`
|
|
4
13
|
* object into the TODS-aligned SunburstDrawData that the sunburst consumes.
|
|
@@ -1 +1,16 @@
|
|
|
1
|
-
export
|
|
1
|
+
export interface RenderFormOptions {
|
|
2
|
+
/**
|
|
3
|
+
* Wrap the fields in a real `<form>` so password managers and native
|
|
4
|
+
* Enter-to-submit have an unambiguous target. `true` uses defaults; pass an
|
|
5
|
+
* object to wire an `onSubmit` handler. Omitted (the default) keeps the
|
|
6
|
+
* historical `<div>` container, so existing callers are unaffected.
|
|
7
|
+
*/
|
|
8
|
+
form?: boolean | {
|
|
9
|
+
onSubmit?: (args: {
|
|
10
|
+
e: Event;
|
|
11
|
+
inputs: any;
|
|
12
|
+
fields: any;
|
|
13
|
+
}) => void;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
export declare function renderForm(elem: HTMLElement, items: any[], relationships?: any[], options?: RenderFormOptions): any;
|
|
@@ -1,4 +1,23 @@
|
|
|
1
|
-
import { HiveIDAuthenticatedDetail, HiveIDLoginConfig, HiveIDLoginShell } from './types';
|
|
1
|
+
import { HiveIDAuthenticatedDetail, HiveIDFederationId, HiveIDLoginConfig, HiveIDLoginShell } from './types';
|
|
2
2
|
export declare function buildHiveIDLogin(config: HiveIDLoginConfig): HiveIDLoginShell;
|
|
3
3
|
/** Magic-link consume helper for the courthive-public landing route. */
|
|
4
4
|
export declare function completeMagicLink(cfsBaseUrl: string, code: string, fetchImpl?: typeof fetch): Promise<HiveIDAuthenticatedDetail>;
|
|
5
|
+
/**
|
|
6
|
+
* Merge a user-entered federation id (from the signup capture field) with any
|
|
7
|
+
* consumer-supplied `config.federationIds`, de-duped by `provider::externalId`.
|
|
8
|
+
* Returns undefined when there is nothing to send (so the signup fragment stays
|
|
9
|
+
* name-only, matching prior behavior).
|
|
10
|
+
*/
|
|
11
|
+
export declare function mergeFederationIds(entered: HiveIDFederationId | null, configIds?: HiveIDFederationId[]): HiveIDFederationId[] | undefined;
|
|
12
|
+
/**
|
|
13
|
+
* Normalize the raw DOB + sex captured on the signup form: trim, and drop empty
|
|
14
|
+
* values (so an untouched field stays `undefined` and the signup fragment omits
|
|
15
|
+
* it rather than sending an empty string). Pure — unit-tested without the DOM.
|
|
16
|
+
*/
|
|
17
|
+
export declare function normalizeSignupPii(raw: {
|
|
18
|
+
birthDate?: string;
|
|
19
|
+
sex?: string;
|
|
20
|
+
}): {
|
|
21
|
+
birthDate?: string;
|
|
22
|
+
sex?: string;
|
|
23
|
+
};
|
|
@@ -30,6 +30,12 @@ export interface SignupRequest {
|
|
|
30
30
|
firstName: string;
|
|
31
31
|
lastName: string;
|
|
32
32
|
federationIds?: HiveIDFederationId[];
|
|
33
|
+
/** Date of birth (YYYY-MM-DD), collected behind a consent gate. */
|
|
34
|
+
birthDate?: string;
|
|
35
|
+
/** Sex ('M' | 'F'), collected behind a consent gate. */
|
|
36
|
+
sex?: string;
|
|
37
|
+
/** Provider context — anchors a fresh mint to the registering tournament's tenant. */
|
|
38
|
+
provider?: string;
|
|
33
39
|
}
|
|
34
40
|
export interface VerifyExistingRequest {
|
|
35
41
|
email: string;
|
|
@@ -76,6 +82,54 @@ export interface MagicLinkConsumeResponse {
|
|
|
76
82
|
personRevision: number | null;
|
|
77
83
|
cached: CachedPersonFields;
|
|
78
84
|
}
|
|
85
|
+
export interface FederationIdCaptureProvider {
|
|
86
|
+
/** Provider key sent to the registry, e.g. 'BOBOCA'. */
|
|
87
|
+
value: string;
|
|
88
|
+
/** Display label, e.g. 'BOBOCA'. */
|
|
89
|
+
label: string;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Opt-in federation-id capture on the signup form. When present, the signup
|
|
93
|
+
* form shows an optional "player id" field (+ a provider select when more than
|
|
94
|
+
* one provider is offered). A person who quotes an id that matches a
|
|
95
|
+
* `(provider, externalId)` alias in courthive-persons is strong-match RESOLVED
|
|
96
|
+
* at signup — the only way the name-only signup fragment can acquire a
|
|
97
|
+
* `personId` today. This is the "claim your existing (e.g. BOBOCA) identity" path.
|
|
98
|
+
*/
|
|
99
|
+
export interface FederationIdCaptureConfig {
|
|
100
|
+
/** One or more providers to offer. A single entry renders no select (fixed provider). */
|
|
101
|
+
providers: FederationIdCaptureProvider[];
|
|
102
|
+
/** Label for the id input. Default: 'Player ID'. */
|
|
103
|
+
idLabel?: string;
|
|
104
|
+
/** Optional helper text shown above the field. */
|
|
105
|
+
note?: string;
|
|
106
|
+
}
|
|
107
|
+
export interface SignupSexOption {
|
|
108
|
+
/** Value sent verbatim to courthive-persons — 'M' / 'F' (the backfill encoding). */
|
|
109
|
+
value: string;
|
|
110
|
+
/** Display label, e.g. 'Male'. */
|
|
111
|
+
label: string;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Opt-in date-of-birth + sex capture on the signup form. When present (and the
|
|
115
|
+
* consumer has already gated collection behind a consent notice — decision #4 of
|
|
116
|
+
* PUBLIC_REGISTRATION_AND_ONBOARDING), the signup form shows a DOB field and a sex
|
|
117
|
+
* select. Together with a `provider` context these let courthive-persons dedupe on
|
|
118
|
+
* name+DOB+sex, or MINT a canonical person when no match exists (the only path a
|
|
119
|
+
* brand-new public person can acquire a personId without a pre-existing provider id).
|
|
120
|
+
*/
|
|
121
|
+
export interface DobSexCaptureConfig {
|
|
122
|
+
/** Sex options offered. Defaults to Male→'M' / Female→'F' (persons encoding). */
|
|
123
|
+
sexOptions?: SignupSexOption[];
|
|
124
|
+
/** Label for the DOB input. Default: 'Date of birth'. */
|
|
125
|
+
dobLabel?: string;
|
|
126
|
+
/** Label for the sex select. Default: 'Sex'. */
|
|
127
|
+
sexLabel?: string;
|
|
128
|
+
/** Optional helper text shown above the fields. */
|
|
129
|
+
note?: string;
|
|
130
|
+
/** Require both DOB and sex before signup can proceed. Default: true. */
|
|
131
|
+
required?: boolean;
|
|
132
|
+
}
|
|
79
133
|
export interface HiveIDLoginConfig {
|
|
80
134
|
/** Which CFS instance to talk to (no trailing slash). */
|
|
81
135
|
cfsBaseUrl: string;
|
|
@@ -89,6 +143,23 @@ export interface HiveIDLoginConfig {
|
|
|
89
143
|
* strong-match likelihood. Most callers leave this empty.
|
|
90
144
|
*/
|
|
91
145
|
federationIds?: HiveIDFederationId[];
|
|
146
|
+
/**
|
|
147
|
+
* Opt-in: show an optional federation-id field on the signup form so a person
|
|
148
|
+
* can quote an existing provider id and be RESOLVED to their canonical
|
|
149
|
+
* person. Merged with `federationIds`. See FederationIdCaptureConfig.
|
|
150
|
+
*/
|
|
151
|
+
federationIdCapture?: FederationIdCaptureConfig;
|
|
152
|
+
/**
|
|
153
|
+
* Opt-in: show DOB + sex fields on the signup form so a brand-new person can be
|
|
154
|
+
* deduped-or-MINTED. The consumer is responsible for the consent gate that must
|
|
155
|
+
* precede collection (decision #4). See DobSexCaptureConfig.
|
|
156
|
+
*/
|
|
157
|
+
dobSexCapture?: DobSexCaptureConfig;
|
|
158
|
+
/**
|
|
159
|
+
* Provider context forwarded on signup (e.g. the registering tournament's
|
|
160
|
+
* provider). Anchors a fresh mint to that tenant. Paired with `dobSexCapture`.
|
|
161
|
+
*/
|
|
162
|
+
provider?: string;
|
|
92
163
|
/** Optional fetch implementation (tests stub this). */
|
|
93
164
|
fetchImpl?: typeof fetch;
|
|
94
165
|
}
|
|
@@ -272,4 +272,17 @@ export interface ScheduleCellData {
|
|
|
272
272
|
*/
|
|
273
273
|
registrations?: string[];
|
|
274
274
|
};
|
|
275
|
+
/**
|
|
276
|
+
* Reserved cell (alternative to matchUp) — a court slot occupied by ANOTHER, facility-sharing
|
|
277
|
+
* tournament that the viewer does not author. Read-only and opaque: it carries no matchUp/participant
|
|
278
|
+
* detail, only the slim information the consumer chooses to surface from a schedule projection. The
|
|
279
|
+
* consumer renders it non-interactive (no drag/move) — the widget only handles its appearance.
|
|
280
|
+
*/
|
|
281
|
+
isReserved?: boolean;
|
|
282
|
+
reservation?: {
|
|
283
|
+
/** Display label for the occupying tournament (e.g. its name), pre-formatted by the consumer. */
|
|
284
|
+
tournamentName?: string;
|
|
285
|
+
/** Optional scheduled time to show on the cell. */
|
|
286
|
+
scheduledTime?: string;
|
|
287
|
+
};
|
|
275
288
|
}
|