@ethlete/components 1.0.0-next.119 → 1.0.0-next.120
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 +8 -0
- package/fesm2022/ethlete-components-bracket.mjs +37 -8
- package/fesm2022/ethlete-components-bracket.mjs.map +1 -1
- package/fesm2022/ethlete-components.mjs +35 -15
- package/fesm2022/ethlete-components.mjs.map +1 -1
- package/package.json +1 -1
- package/src/lib/bracket/bracket.component.css +32 -14
- package/src/lib/button/button.component.css +1 -1
- package/src/lib/button/fab.component.css +1 -1
- package/src/lib/button/icon-button.component.css +1 -1
- package/src/lib/button/text-button.component.css +1 -1
- package/src/lib/button/window-control-button.component.css +1 -1
- package/types/ethlete-components-bracket.d.ts +7 -0
- package/types/ethlete-components.d.ts +4 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.0.0-next.120
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Buttons, icon buttons, FABs, text buttons and window-control buttons swap their colours instantly on a theme change instead of fading through an unreadable mix; hover and press still transition.
|
|
8
|
+
- The line into a bracket match fed by two matches is drawn once, so it no longer looks brighter or flickers on journey highlight.
|
|
9
|
+
- `et-bracket` now draws its first render and a new `source` in place; only a relayout of the same source animates.
|
|
10
|
+
|
|
3
11
|
## 1.0.0-next.119
|
|
4
12
|
|
|
5
13
|
### Minor Changes
|
|
@@ -336,7 +336,7 @@ const path = (d, options) => {
|
|
|
336
336
|
stroke: options.stroke ?? "currentColor"
|
|
337
337
|
};
|
|
338
338
|
};
|
|
339
|
-
const
|
|
339
|
+
const curveGeometry = (from, to, options) => {
|
|
340
340
|
const inverted = options.inverted ?? false;
|
|
341
341
|
const fromInline = inverted ? from.inline.start : from.inline.end;
|
|
342
342
|
const toInline = inverted ? to.inline.end : to.inline.start;
|
|
@@ -352,8 +352,21 @@ const curvePath = (from, to, direction, options) => {
|
|
|
352
352
|
const turnOffset = options.turnOffset ?? null;
|
|
353
353
|
const leadingStraight = turnOffset === null ? straightTotal / 2 : Math.max(0, Math.min(turnOffset - startCurve, straightTotal));
|
|
354
354
|
const trailingStraight = straightTotal - leadingStraight;
|
|
355
|
-
|
|
356
|
-
|
|
355
|
+
return {
|
|
356
|
+
inverted,
|
|
357
|
+
fromInline,
|
|
358
|
+
toInline,
|
|
359
|
+
fromBlock,
|
|
360
|
+
toBlock,
|
|
361
|
+
startCurve,
|
|
362
|
+
endCurve,
|
|
363
|
+
straightEnd: inverted ? fromInline - leadingStraight : fromInline + leadingStraight,
|
|
364
|
+
straightStart: inverted ? toInline + trailingStraight : toInline - trailingStraight
|
|
365
|
+
};
|
|
366
|
+
};
|
|
367
|
+
const curveStraightStart = (from, to, options) => curveGeometry(from, to, options).straightStart;
|
|
368
|
+
const curvePath = (from, to, direction, options) => {
|
|
369
|
+
const { inverted, fromInline, toInline, fromBlock, toBlock, startCurve, endCurve, straightEnd, straightStart } = curveGeometry(from, to, options);
|
|
357
370
|
const firstCurveEndX = inverted ? straightEnd - startCurve : straightEnd + startCurve;
|
|
358
371
|
const firstCurveEndY = direction === "down" ? fromBlock + startCurve : fromBlock - startCurve;
|
|
359
372
|
const secondCurveStartY = direction === "down" ? toBlock - endCurve : toBlock + endCurve;
|
|
@@ -366,7 +379,7 @@ const curvePath = (from, to, direction, options) => {
|
|
|
366
379
|
`Q ${firstCurveEndX} ${fromBlock}, ${firstCurveEndX} ${firstCurveEndY}`,
|
|
367
380
|
`V ${secondCurveStartY}`,
|
|
368
381
|
`Q ${secondCurveBezierX} ${toBlock}, ${secondCurveEndX} ${secondCurveEndY}`,
|
|
369
|
-
`H ${toInline}`
|
|
382
|
+
`H ${options.endInline ?? toInline}`
|
|
370
383
|
].join(" ");
|
|
371
384
|
return path(d, options.path);
|
|
372
385
|
};
|
|
@@ -901,7 +914,7 @@ const drawMan = (dimensions) => {
|
|
|
901
914
|
const lowerId = edgeId(el.match.relation.previousLowerMatch.id, el.match.id);
|
|
902
915
|
const isLowerUpperMerger = el.match.relation.previousLowerRound.id !== el.match.relation.previousUpperRound.id;
|
|
903
916
|
const invertCurve = el.round.mirrorRoundType === BRACKET_ROUND_MIRROR_TYPE.RIGHT;
|
|
904
|
-
const
|
|
917
|
+
const baseCurveOptions = {
|
|
905
918
|
...dimensions.curve,
|
|
906
919
|
inverted: invertCurve,
|
|
907
920
|
path: {
|
|
@@ -910,7 +923,14 @@ const drawMan = (dimensions) => {
|
|
|
910
923
|
className: ""
|
|
911
924
|
}
|
|
912
925
|
};
|
|
913
|
-
|
|
926
|
+
const isUpperStraight = isLowerUpperMerger && dimensions.bracketGrid.finalAlignment !== BRACKET_FINAL_ALIGNMENT.CENTER;
|
|
927
|
+
const isBlockToBlock = isSameColumn(prevLowerPos, currentPos) && prevLowerPos.block.start > currentPos.block.end;
|
|
928
|
+
const sharedEndInline = !isUpperStraight && !isBlockToBlock && !isSameColumn(prevUpperPos, currentPos) && !isSameColumn(prevLowerPos, currentPos) ? (invertCurve ? Math.min : Math.max)(curveStraightStart(prevUpperPos, currentPos, baseCurveOptions), curveStraightStart(prevLowerPos, currentPos, baseCurveOptions)) : void 0;
|
|
929
|
+
const curveOptions = {
|
|
930
|
+
...baseCurveOptions,
|
|
931
|
+
endInline: sharedEndInline
|
|
932
|
+
};
|
|
933
|
+
if (isUpperStraight) pushEdge(straightPath(prevUpperPos, currentPos, {
|
|
914
934
|
path: {
|
|
915
935
|
...dimensions.path,
|
|
916
936
|
id: upperId,
|
|
@@ -930,7 +950,7 @@ const drawMan = (dimensions) => {
|
|
|
930
950
|
id: lowerId,
|
|
931
951
|
className: el.match.relation.previousLowerMatch.winner?.shortId || ""
|
|
932
952
|
};
|
|
933
|
-
pushEdge(
|
|
953
|
+
pushEdge(isBlockToBlock ? gutterPath(prevLowerPos, currentPos, {
|
|
934
954
|
path: {
|
|
935
955
|
...dimensions.continuePath ?? dimensions.path,
|
|
936
956
|
id: lowerId,
|
|
@@ -942,6 +962,15 @@ const drawMan = (dimensions) => {
|
|
|
942
962
|
...curveOptions,
|
|
943
963
|
path: lowerPathOptions
|
|
944
964
|
}));
|
|
965
|
+
if (sharedEndInline !== void 0) {
|
|
966
|
+
const winners = [el.match.relation.previousUpperMatch.winner?.shortId, el.match.relation.previousLowerMatch.winner?.shortId].filter((shortId) => !!shortId);
|
|
967
|
+
const toInline = invertCurve ? currentPos.inline.end : currentPos.inline.start;
|
|
968
|
+
pushEdge(path(`M ${sharedEndInline} ${currentPos.block.center} H ${toInline}`, {
|
|
969
|
+
...dimensions.path,
|
|
970
|
+
id: edgeId(el.match.id, "in"),
|
|
971
|
+
className: winners.join(" ")
|
|
972
|
+
}));
|
|
973
|
+
}
|
|
945
974
|
break;
|
|
946
975
|
}
|
|
947
976
|
}
|
|
@@ -3522,6 +3551,6 @@ const swapStandingRank = (options) => {
|
|
|
3522
3551
|
[next[from], next[to]] = [next[to], participantId];
|
|
3523
3552
|
return next;
|
|
3524
3553
|
};
|
|
3525
|
-
export { BRACKET_DATA_LAYOUT, BRACKET_ERROR_CODES, BRACKET_FINAL_ALIGNMENT, BRACKET_ROUND_MIRROR_TYPE, BRACKET_SECTION_DEFAULT_NAMES, BRACKET_SECTION_KEY, BRACKET_SWISS_GROUP_COLOR_TYPE, BracketMap, BracketRuntimeError, COMMON_BRACKET_ROUND_TYPE, DOUBLE_ELIMINATION_BRACKET_ROUND_TYPE, GROUP_BRACKET_ROUND_TYPE, SINGLE_ELIMINATION_BRACKET_ROUND_TYPE, STANDING_PICK_OUTCOME, SWISS_ADVANCE_WINS, SWISS_BRACKET_ROUND_TYPE, SWISS_ELIMINATE_LOSSES, TERMINAL_ROUND_SORT_PRIORITY, TOURNAMENT_MODE, bracketGridNaturalWidth, bracketSlot, calculateColumnSplitFactor, calculateLowerRoundIndex, calculateUpperLowerRatio, calculateUpperRoundIndex, createBracket, createBracketBase, createBracketContinueMasterColumn, createBracketElement, createBracketElementPart, createBracketGapMasterColumn, createBracketGrid, createBracketGridSections, createBracketMasterColumn, createBracketMasterColumnSection, createBracketSlotResolver, createBracketSubColumn, createDoubleEliminationGrid, createFoldedThirdPlaceSection, createMatchesMapBase, createNewMatchParticipantBase, createParticipantsMapBase, createPlaceholderBracketSource, createRoundBracketSubColumnRelativeToFirstRound, createRoundsMapBase, createSingleEliminationGrid, createSwissGrid, curvePath, doubleEliminationRoundSection, drawMan, drawSwissMan, finalizeBracketGrid, generateBracketRoundSwissGroupMaps, generateMatchPosition, generateMatchRelationPositions, generateMatchRelationsNew, generateRoundRelationsNew, getAvailableSwissGroupsForRound, getBracketContinueMatches, getSwissGroupColorType, gutterPath, isBracketContinueMatch, isBracketSlotPredictable, isSwissMode, linePath, migrateBracketPicks, path, resolveBracketGridRowSpan, resolveBracketLayout, resolveBracketSlot, standingPickOutcome, standingPickStartOrder, standingRankSides, swapStandingRank, validateBracketSource, verticalPath, createStackedDoubleEliminationGrid as ɵcreateStackedDoubleEliminationGrid };
|
|
3554
|
+
export { BRACKET_DATA_LAYOUT, BRACKET_ERROR_CODES, BRACKET_FINAL_ALIGNMENT, BRACKET_ROUND_MIRROR_TYPE, BRACKET_SECTION_DEFAULT_NAMES, BRACKET_SECTION_KEY, BRACKET_SWISS_GROUP_COLOR_TYPE, BracketMap, BracketRuntimeError, COMMON_BRACKET_ROUND_TYPE, DOUBLE_ELIMINATION_BRACKET_ROUND_TYPE, GROUP_BRACKET_ROUND_TYPE, SINGLE_ELIMINATION_BRACKET_ROUND_TYPE, STANDING_PICK_OUTCOME, SWISS_ADVANCE_WINS, SWISS_BRACKET_ROUND_TYPE, SWISS_ELIMINATE_LOSSES, TERMINAL_ROUND_SORT_PRIORITY, TOURNAMENT_MODE, bracketGridNaturalWidth, bracketSlot, calculateColumnSplitFactor, calculateLowerRoundIndex, calculateUpperLowerRatio, calculateUpperRoundIndex, createBracket, createBracketBase, createBracketContinueMasterColumn, createBracketElement, createBracketElementPart, createBracketGapMasterColumn, createBracketGrid, createBracketGridSections, createBracketMasterColumn, createBracketMasterColumnSection, createBracketSlotResolver, createBracketSubColumn, createDoubleEliminationGrid, createFoldedThirdPlaceSection, createMatchesMapBase, createNewMatchParticipantBase, createParticipantsMapBase, createPlaceholderBracketSource, createRoundBracketSubColumnRelativeToFirstRound, createRoundsMapBase, createSingleEliminationGrid, createSwissGrid, curvePath, curveStraightStart, doubleEliminationRoundSection, drawMan, drawSwissMan, finalizeBracketGrid, generateBracketRoundSwissGroupMaps, generateMatchPosition, generateMatchRelationPositions, generateMatchRelationsNew, generateRoundRelationsNew, getAvailableSwissGroupsForRound, getBracketContinueMatches, getSwissGroupColorType, gutterPath, isBracketContinueMatch, isBracketSlotPredictable, isSwissMode, linePath, migrateBracketPicks, path, resolveBracketGridRowSpan, resolveBracketLayout, resolveBracketSlot, standingPickOutcome, standingPickStartOrder, standingRankSides, swapStandingRank, validateBracketSource, verticalPath, createStackedDoubleEliminationGrid as ɵcreateStackedDoubleEliminationGrid };
|
|
3526
3555
|
|
|
3527
3556
|
//# sourceMappingURL=ethlete-components-bracket.mjs.map
|