courthive-components 3.4.6 → 3.5.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.
@@ -0,0 +1,23 @@
1
+ import { PrivacyPolicyData } from '../types';
2
+ export interface PrivacyFieldMeta {
3
+ field: string;
4
+ group: 'participant' | 'person';
5
+ /** Humanised label, e.g. birthDate → "Birth date". */
6
+ label: string;
7
+ }
8
+ /**
9
+ * A complete privacy policy in the catalog's INNER shape (no `[policyType]`
10
+ * wrapper) — matching how `safePolicyData` unwraps fixtures for every editor:
11
+ * `{ policyName, participant: { ...attributeFilter } }`.
12
+ */
13
+ export declare function emptyPrivacyPolicy(): PrivacyPolicyData;
14
+ /** All boolean attributes from the template — participant-level, then person. */
15
+ export declare function privacyFields(): PrivacyFieldMeta[];
16
+ export declare function readField(policy: PrivacyPolicyData, group: 'participant' | 'person', field: string): boolean;
17
+ /**
18
+ * Set an attribute on both the direct participant/person and the doubles/team
19
+ * `individualParticipants` branch, so singles and pair members stay consistent.
20
+ */
21
+ export declare function writeField(policy: PrivacyPolicyData, group: 'participant' | 'person', field: string, value: boolean): void;
22
+ export declare function readPolicyName(policy: PrivacyPolicyData): string;
23
+ export declare function writePolicyName(policy: PrivacyPolicyData, value: string): void;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Participant Privacy Editor — Public API
3
+ */
4
+ export { PrivacyEditorControl, createPrivacyEditor } from './privacyEditorControl';
5
+ export { PrivacyEditorStore } from './privacyEditorStore';
6
+ export { buildPrivacyEditorPanel } from './privacyEditorPanel';
7
+ export { emptyPrivacyPolicy, privacyFields, readField, writeField, readPolicyName, writePolicyName, } from './domain/privacyProjections';
8
+ export type { PrivacyPolicyData, PrivacyEditorState, PrivacyEditorChangeListener, PrivacyEditorConfig } from './types';
9
+ export type { PrivacyFieldMeta } from './domain/privacyProjections';
@@ -0,0 +1,20 @@
1
+ import { PrivacyEditorStore } from './privacyEditorStore';
2
+ import { PrivacyEditorConfig, PrivacyPolicyData } from './types';
3
+ import { PolicyEditorInstance as CatalogEditorInstance } from '../../types';
4
+ export declare class PrivacyEditorControl {
5
+ private readonly store;
6
+ private readonly panel;
7
+ private readonly unsubscribe;
8
+ private container;
9
+ constructor(config: PrivacyEditorConfig);
10
+ render(container: HTMLElement): void;
11
+ destroy(): void;
12
+ getData(): PrivacyPolicyData;
13
+ setData(data: PrivacyPolicyData): void;
14
+ getStore(): PrivacyEditorStore;
15
+ static createEditorInstance(config: {
16
+ initialData: Record<string, unknown>;
17
+ onChange: (data: Record<string, unknown>) => void;
18
+ }): CatalogEditorInstance;
19
+ }
20
+ export declare function createPrivacyEditor(config: PrivacyEditorConfig, container: HTMLElement): PrivacyEditorControl;
@@ -0,0 +1,6 @@
1
+ import { PrivacyEditorStore } from './privacyEditorStore';
2
+ import { PrivacyEditorConfig, PrivacyEditorState } from './types';
3
+ export declare function buildPrivacyEditorPanel(store: PrivacyEditorStore, _config: PrivacyEditorConfig): {
4
+ element: HTMLElement;
5
+ update: (state: PrivacyEditorState) => void;
6
+ };
@@ -0,0 +1,15 @@
1
+ import { PrivacyEditorChangeListener, PrivacyEditorConfig, PrivacyEditorState, PrivacyPolicyData } from './types';
2
+ export declare class PrivacyEditorStore {
3
+ private state;
4
+ private readonly listeners;
5
+ private readonly config;
6
+ constructor(config: PrivacyEditorConfig);
7
+ getState(): PrivacyEditorState;
8
+ getData(): PrivacyPolicyData;
9
+ setData(data: PrivacyPolicyData): void;
10
+ setPolicyName(value: string): void;
11
+ setField(group: 'participant' | 'person', field: string, value: boolean): void;
12
+ subscribe(listener: PrivacyEditorChangeListener): () => void;
13
+ private commitDraft;
14
+ private emit;
15
+ }
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Participant Privacy Policy Editor — Type Definitions
3
+ *
4
+ * Edits a factory `POLICY_TYPE_PARTICIPANT` attribute-filter policy (see
5
+ * factory/src/fixtures/policies/POLICY_PRIVACY_DEFAULT.ts): each attribute is
6
+ * `true` (published to public payloads) or `false` (stripped). policyData is the
7
+ * full factory policy shape so it can be attached to a tournamentRecord and
8
+ * consumed by the factory directly.
9
+ */
10
+ export type PrivacyPolicyData = Record<string, any>;
11
+ export interface PrivacyEditorState {
12
+ draft: PrivacyPolicyData;
13
+ dirty: boolean;
14
+ }
15
+ export type PrivacyEditorChangeListener = (state: PrivacyEditorState) => void;
16
+ export interface PrivacyEditorConfig {
17
+ initialPolicy?: PrivacyPolicyData;
18
+ onChange?: (policy: PrivacyPolicyData) => void;
19
+ }
@@ -19,6 +19,8 @@ export { RankingPointsEditorControl, createRankingPointsEditor, RankingPointsEdi
19
19
  export { SeedingEditorControl, createSeedingEditor, SeedingEditorStore, buildSeedingEditorPanel, emptySeedingPolicy, POSITIONING_OPTIONS, DRAW_TYPE_OPTIONS } from './editors/seeding';
20
20
  export { ScoringEditorControl, createScoringEditor, MATCH_UP_FORMAT_REGISTRY_SORTED, lookupRegistryFormat, emptyScoringPolicy, FORMAT_STANDARD, } from './editors/scoring';
21
21
  export type { ScoringPolicyData, ScoringEditorConfig, MatchUpStatusKey, MatchUpFormatEntry, AllowedFormatEntry, } from './editors/scoring';
22
+ export { PrivacyEditorControl, createPrivacyEditor, PrivacyEditorStore, buildPrivacyEditorPanel, emptyPrivacyPolicy, privacyFields, } from './editors/privacy';
23
+ export type { PrivacyPolicyData, PrivacyEditorConfig, PrivacyFieldMeta } from './editors/privacy';
22
24
  export type { PolicyCatalogItem, PolicyCatalogState, PolicyCatalogChangeListener, PolicyCatalogConfig, PolicyEditorInstance, PolicyEditorPlugin, PolicySource, PolicyTypeGroup, PolicyTypeMeta, CatalogGroupBy, UIPanel } from './types';
23
25
  export type { SchedulingPolicyData, SchedulingEditorState, SchedulingEditorSection, SchedulingEditorChangeListener, SchedulingEditorConfig, SchedulingValidationResult, ValidationSeverity, MinutesEntry, AverageTimeEntry, RecoveryTimeEntry, MatchUpAverageTime, MatchUpRecoveryTime } from './editors/scheduling';
24
26
  export type { RankingPolicyData, RankingPointsEditorState, RankingEditorSection, RankingPointsEditorChangeListener, RankingPointsEditorConfig, AwardProfileData, QualityWinProfileData, AggregationRulesData, TableLayout } from './editors/ranking';