@ethlete/components 1.0.0-next.117 → 1.0.0-next.119

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/CHANGELOG.md CHANGED
@@ -1,5 +1,27 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.0.0-next.119
4
+
5
+ ### Minor Changes
6
+
7
+ - Bracket skeletons now draw placeholders for enabled section titles and support custom placeholders for matches, finals, and section titles through bracket configuration.
8
+
9
+ ### Patch Changes
10
+
11
+ - Prevent overlay page and header flicker on iOS browser back and forward swipes.
12
+
13
+ ## 1.0.0-next.118
14
+
15
+ ### Minor Changes
16
+
17
+ - `et-bracket-skeleton` can now draw a Swiss stage with a placeholder header for each record group.
18
+ - Add `et-scrollable-placeholder` for static skeleton tracks and document its use in the CDK migration map.
19
+
20
+ ### Patch Changes
21
+
22
+ - The `et-italic` icon draws its glyph as a path, so it looks the same on every system instead of using the system serif font.
23
+ - A left or right sheet that fills the viewport width now has square corners instead of rounded ones.
24
+
3
25
  ## 1.0.0-next.117
4
26
 
5
27
  ### Patch Changes
@@ -3376,8 +3376,15 @@ const MIN_PARTICIPANTS = {
3376
3376
  "single-elimination": 2,
3377
3377
  "double-elimination": 4
3378
3378
  };
3379
- const assertParticipantCount = (shape) => {
3379
+ const MAX_SWISS_ROUNDS = 171;
3380
+ const assertPlaceholderShape = (shape) => {
3380
3381
  const { participantCount, mode } = shape;
3382
+ if (mode === TOURNAMENT_MODE.SWISS) {
3383
+ if (!Number.isSafeInteger(participantCount) || participantCount < 4 || participantCount % 2 !== 0) throw new BracketRuntimeError(BRACKET_ERROR_CODES.PLACEHOLDER_SHAPE_INVALID, `A Swiss placeholder bracket needs an even participantCount of at least 4, got ${participantCount}.`);
3384
+ const { roundCount } = shape;
3385
+ if (!Number.isInteger(roundCount) || roundCount < 1 || roundCount > MAX_SWISS_ROUNDS) throw new BracketRuntimeError(BRACKET_ERROR_CODES.PLACEHOLDER_SHAPE_INVALID, `A Swiss placeholder bracket needs an integer roundCount from 1 through ${MAX_SWISS_ROUNDS}, got ${roundCount}.`);
3386
+ return;
3387
+ }
3381
3388
  const min = MIN_PARTICIPANTS[mode];
3382
3389
  const isPowerOfTwo = Number.isInteger(participantCount) && (participantCount & participantCount - 1) === 0;
3383
3390
  if (participantCount < min || !isPowerOfTwo) throw new BracketRuntimeError(BRACKET_ERROR_CODES.PLACEHOLDER_SHAPE_INVALID, `A ${mode} placeholder bracket needs a power-of-two participantCount of at least ${min}, got ${participantCount}.`);
@@ -3388,7 +3395,7 @@ const halvingCounts = (from) => {
3388
3395
  return counts;
3389
3396
  };
3390
3397
  const createPlaceholderBracketSource = (shape) => {
3391
- assertParticipantCount(shape);
3398
+ assertPlaceholderShape(shape);
3392
3399
  const rounds = [];
3393
3400
  const matches = [];
3394
3401
  const addRound = (round) => {
@@ -3410,6 +3417,18 @@ const createPlaceholderBracketSource = (shape) => {
3410
3417
  });
3411
3418
  };
3412
3419
  const { participantCount } = shape;
3420
+ if (shape.mode === TOURNAMENT_MODE.SWISS) {
3421
+ for (let index = 0; index < shape.roundCount; index++) addRound({
3422
+ id: `r${index}`,
3423
+ type: SWISS_BRACKET_ROUND_TYPE.SWISS,
3424
+ matchCount: participantCount / 2
3425
+ });
3426
+ return {
3427
+ mode: shape.mode,
3428
+ rounds,
3429
+ matches
3430
+ };
3431
+ }
3413
3432
  if (shape.mode === TOURNAMENT_MODE.SINGLE_ELIMINATION) {
3414
3433
  const counts = halvingCounts(participantCount / 2);
3415
3434
  counts.forEach((matchCount, index) => {