@fuzo/soccer-board 0.2.0-alpha.2 → 0.2.0-alpha.3
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/.claude/settings.local.json +6 -0
- package/CHANGELOG.md +98 -0
- package/package.json +8 -15
- package/scripts/link.sh +33 -0
- package/scripts/unlink.sh +15 -0
- package/fesm2022/fuzo-soccer-board.mjs +0 -1191
- package/fesm2022/fuzo-soccer-board.mjs.map +0 -1
- package/types/fuzo-soccer-board.d.ts +0 -317
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [0.2.0-alpha.3] - 2026-01-18
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
- Control for `maxPlayersPerSide` in demo application
|
|
12
|
+
|
|
13
|
+
### Fixed
|
|
14
|
+
- **Consistent Coordinate System**: Fixed critical issue where player positions were lost when switching between Landscape and Portrait orientations
|
|
15
|
+
- Made `fieldX` always represent length (0-100%) regardless of orientation
|
|
16
|
+
- Made `fieldY` always represent width (0-100%) regardless of orientation
|
|
17
|
+
- Coordinates now represent the same physical position regardless of orientation
|
|
18
|
+
- Transform coordinates only during rendering in `fieldToHalfCoordinates()`
|
|
19
|
+
|
|
20
|
+
### Changed
|
|
21
|
+
- **CSS-Based Responsive Sizing**: Implemented pure CSS responsive sizing using `aspect-ratio`
|
|
22
|
+
- Landscape: `width: 100%`, `height: auto` (calculated by aspect-ratio)
|
|
23
|
+
- Portrait: `height: 100%`, `width: auto` (calculated by aspect-ratio)
|
|
24
|
+
- Removed fixed widths from players sidebar (300px) for full responsiveness
|
|
25
|
+
- Container centered horizontally in Portrait, vertically in Landscape
|
|
26
|
+
- Removed `ngAfterViewInit()` that was calling `updateFieldSize()` unnecessarily
|
|
27
|
+
- Only use JavaScript size calculations when `fit="contain"` is explicitly set
|
|
28
|
+
- Removed `updateFieldSizeFromCSS()` call from `updateFieldSize()` fallback
|
|
29
|
+
- Updated players grid gap to 1.5rem for better spacing
|
|
30
|
+
|
|
31
|
+
## [0.2.0-alpha.2] - 2026-01-10
|
|
32
|
+
|
|
33
|
+
### Fixed
|
|
34
|
+
- **Drag and Drop Positioning Fix**: Fixed critical issue where players would not position correctly when dropped, especially when multiple players were on the field
|
|
35
|
+
- Improved calculation of drop position to use cursor coordinates more accurately
|
|
36
|
+
- Fixed timing issue where styles were cleaned before new position bindings were applied
|
|
37
|
+
- Optimized `playerPositions` computed signal to prevent unnecessary re-renders during drag
|
|
38
|
+
- Players now correctly stay where the mouse is dropped on the field
|
|
39
|
+
- Other players no longer "twitch" or move unexpectedly during drag operations
|
|
40
|
+
|
|
41
|
+
### Improved
|
|
42
|
+
- Better synchronization between drag end event and position update
|
|
43
|
+
- More stable rendering during drag operations with multiple players on field
|
|
44
|
+
|
|
45
|
+
## [0.2.0-alpha.1] - 2026-01-09
|
|
46
|
+
|
|
47
|
+
### Fixed
|
|
48
|
+
- **Drag and Drop Fix**: Fixed issue where player card would "jump" or move away from mouse cursor when starting to drag
|
|
49
|
+
- Now applies `position: fixed` immediately at drag start to maintain visual position
|
|
50
|
+
- Correctly calculates offset relative to click point before applying fixed positioning
|
|
51
|
+
- Player card now smoothly follows cursor during drag without jumping
|
|
52
|
+
|
|
53
|
+
### Changed
|
|
54
|
+
- Improved drag offset calculation to prevent visual jumps when initiating drag operation
|
|
55
|
+
- Better handling of element positioning during drag state transitions
|
|
56
|
+
|
|
57
|
+
## [0.1.0-alpha.2] - 2025-01-XX
|
|
58
|
+
|
|
59
|
+
### Changed
|
|
60
|
+
- **BREAKING**: Renamed all types and interfaces with `SoccerBoard` prefix to prevent naming conflicts
|
|
61
|
+
- `Player` → `SoccerBoardPlayer`
|
|
62
|
+
- `FieldOrientation` → `SoccerBoardOrientation`
|
|
63
|
+
- `TeamSide` → `SoccerBoardTeamSide`
|
|
64
|
+
- `FitMode` → `SoccerBoardFitMode`
|
|
65
|
+
- `PlayerSize` → `SoccerBoardPlayerSize`
|
|
66
|
+
- `FIELD_CONSTANTS` → `SoccerBoardFieldConstants`
|
|
67
|
+
- `PositionZone` → `SoccerBoardPositionZone` (internal)
|
|
68
|
+
- All type aliases updated (e.g., `FieldOrientationType` → `SoccerBoardOrientationType`)
|
|
69
|
+
|
|
70
|
+
### Fixed
|
|
71
|
+
- Improved type safety and namespace isolation
|
|
72
|
+
- Better IDE autocomplete grouping
|
|
73
|
+
|
|
74
|
+
## [0.1.0-alpha.1] - 2025-01-XX
|
|
75
|
+
|
|
76
|
+
### Added
|
|
77
|
+
- Initial alpha release
|
|
78
|
+
- FIFA-compliant soccer field component with accurate dimensions and markings
|
|
79
|
+
- Support for portrait and landscape orientations
|
|
80
|
+
- Drag and drop functionality for positioning players on the field
|
|
81
|
+
- Tactical position detection (GK, CB, RB, LB, CDM, CM, CAM, LW, RW, ST, etc.)
|
|
82
|
+
- Beautiful player cards with photos, numbers, and positions
|
|
83
|
+
- Export to PNG functionality with high-quality images
|
|
84
|
+
- Responsive design with `fit="contain"` mode
|
|
85
|
+
- Integrated layout with player sidebar and field
|
|
86
|
+
- Player click events for interaction
|
|
87
|
+
- Maximum players per side configuration
|
|
88
|
+
- Player removal from field functionality
|
|
89
|
+
- 100% reactive implementation using Angular signals
|
|
90
|
+
- Tailwind CSS styling support
|
|
91
|
+
- Server-side rendering (SSR) compatibility
|
|
92
|
+
|
|
93
|
+
### Technical Details
|
|
94
|
+
- Built with Angular 21+ (standalone components)
|
|
95
|
+
- Uses Angular signals for reactive state management
|
|
96
|
+
- Supports modern CSS color functions (oklab/oklch) via html2canvas-pro
|
|
97
|
+
- Fully typed with TypeScript
|
|
98
|
+
- Zero dependencies (except Angular peer dependencies)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fuzo/soccer-board",
|
|
3
|
-
"version": "0.2.0-alpha.
|
|
3
|
+
"version": "0.2.0-alpha.3",
|
|
4
4
|
"description": "A beautiful, interactive soccer field component for Angular applications. Create tactical formations, manage player positions, and export your field as PNG images.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"angular",
|
|
@@ -25,9 +25,13 @@
|
|
|
25
25
|
"url": ""
|
|
26
26
|
},
|
|
27
27
|
"homepage": "",
|
|
28
|
+
"scripts": {
|
|
29
|
+
"build": "ng-packagr -p ng-package.json",
|
|
30
|
+
"link": "npm run build && ./scripts/link.sh",
|
|
31
|
+
"unlink": "./scripts/unlink.sh"
|
|
32
|
+
},
|
|
28
33
|
"dependencies": {
|
|
29
|
-
"html2canvas-pro": "^1.6.0"
|
|
30
|
-
"tslib": "^2.3.0"
|
|
34
|
+
"html2canvas-pro": "^1.6.0"
|
|
31
35
|
},
|
|
32
36
|
"peerDependencies": {
|
|
33
37
|
"@angular/common": "^21.0.0",
|
|
@@ -36,16 +40,5 @@
|
|
|
36
40
|
"sideEffects": false,
|
|
37
41
|
"publishConfig": {
|
|
38
42
|
"access": "public"
|
|
39
|
-
},
|
|
40
|
-
"module": "fesm2022/fuzo-soccer-board.mjs",
|
|
41
|
-
"typings": "types/fuzo-soccer-board.d.ts",
|
|
42
|
-
"exports": {
|
|
43
|
-
"./package.json": {
|
|
44
|
-
"default": "./package.json"
|
|
45
|
-
},
|
|
46
|
-
".": {
|
|
47
|
-
"types": "./types/fuzo-soccer-board.d.ts",
|
|
48
|
-
"default": "./fesm2022/fuzo-soccer-board.mjs"
|
|
49
|
-
}
|
|
50
43
|
}
|
|
51
|
-
}
|
|
44
|
+
}
|
package/scripts/link.sh
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
# Script para crear el npm link correctamente para @fuzo/soccer-board
|
|
4
|
+
# Uso: npm run link (desde soccer-board-angular/)
|
|
5
|
+
|
|
6
|
+
set -e
|
|
7
|
+
|
|
8
|
+
# Obtener el directorio de node_modules global
|
|
9
|
+
NPM_ROOT=$(npm root -g)
|
|
10
|
+
|
|
11
|
+
# Ruta absoluta al dist
|
|
12
|
+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
13
|
+
DIST_PATH="$(cd "$SCRIPT_DIR/../../dist/soccer-board-angular" && pwd)"
|
|
14
|
+
|
|
15
|
+
# Crear directorio @fuzo si no existe
|
|
16
|
+
mkdir -p "$NPM_ROOT/@fuzo"
|
|
17
|
+
|
|
18
|
+
# Crear o actualizar el symlink
|
|
19
|
+
LINK_PATH="$NPM_ROOT/@fuzo/soccer-board"
|
|
20
|
+
|
|
21
|
+
if [ -L "$LINK_PATH" ]; then
|
|
22
|
+
echo "Removing existing link..."
|
|
23
|
+
rm "$LINK_PATH"
|
|
24
|
+
fi
|
|
25
|
+
|
|
26
|
+
echo "Creating link: $LINK_PATH -> $DIST_PATH"
|
|
27
|
+
ln -s "$DIST_PATH" "$LINK_PATH"
|
|
28
|
+
|
|
29
|
+
echo "✅ Link creado correctamente!"
|
|
30
|
+
echo " $LINK_PATH -> $DIST_PATH"
|
|
31
|
+
echo ""
|
|
32
|
+
echo "Ahora desde tu proyecto ejecuta:"
|
|
33
|
+
echo " npm link @fuzo/soccer-board"
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
# Script para remover el npm link de @fuzo/soccer-board
|
|
4
|
+
# Uso: npm run unlink (desde soccer-board-angular/)
|
|
5
|
+
|
|
6
|
+
NPM_ROOT=$(npm root -g)
|
|
7
|
+
LINK_PATH="$NPM_ROOT/@fuzo/soccer-board"
|
|
8
|
+
|
|
9
|
+
if [ -L "$LINK_PATH" ]; then
|
|
10
|
+
echo "Removing link: $LINK_PATH"
|
|
11
|
+
rm "$LINK_PATH"
|
|
12
|
+
echo "✅ Link removido correctamente!"
|
|
13
|
+
else
|
|
14
|
+
echo "⚠️ Link no encontrado o ya fue removido"
|
|
15
|
+
fi
|