@wger-project/react-components 25.10.24 → 25.11.22

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.
Files changed (39) hide show
  1. package/build/chunks/{browser-ponyfill-DL_vVusK.js → browser-ponyfill-CyEkMYuR.js} +3 -3
  2. package/build/chunks/{browser-ponyfill-DL_vVusK.js.map → browser-ponyfill-CyEkMYuR.js.map} +1 -1
  3. package/build/locales/fil/translation.json +3 -0
  4. package/build/locales/sk/translation.json +26 -1
  5. package/build/main.js +137 -235
  6. package/build/main.js.map +1 -1
  7. package/package.json +14 -14
  8. package/src/components/BodyWeight/Form/WeightForm.tsx +3 -4
  9. package/src/components/BodyWeight/WeightChart/index.tsx +26 -29
  10. package/src/components/Exercises/Add/Step1Basics.test.tsx +4 -1
  11. package/src/components/Exercises/Detail/ExerciseDetailEdit.tsx +43 -27
  12. package/src/components/Exercises/Detail/ExerciseDetailView.tsx +57 -17
  13. package/src/components/Exercises/Detail/Head/ExerciseDeleteDialog.tsx +3 -4
  14. package/src/components/Exercises/Detail/OverviewCard.test.tsx +7 -11
  15. package/src/components/Exercises/ExerciseOverview.tsx +8 -8
  16. package/src/components/Exercises/Filter/NameAutcompleter.tsx +41 -39
  17. package/src/components/Exercises/Filter/NameAutocompleter.test.tsx +2 -1
  18. package/src/components/Exercises/Overview/ExerciseGrid.tsx +1 -2
  19. package/src/components/Exercises/forms/ExerciseAliases.tsx +78 -21
  20. package/src/components/Exercises/forms/yupValidators.ts +7 -4
  21. package/src/components/Exercises/models/exercise.ts +55 -43
  22. package/src/components/Measurements/Screens/MeasurementCategoryDetail.test.tsx +4 -2
  23. package/src/components/Measurements/widgets/MeasurementChart.tsx +27 -30
  24. package/src/components/Nutrition/components/BmiCalculator.tsx +40 -42
  25. package/src/components/Nutrition/widgets/charts/MacrosPieChart.tsx +17 -19
  26. package/src/components/Nutrition/widgets/charts/NutritionDiaryChart.tsx +39 -38
  27. package/src/components/Nutrition/widgets/charts/NutritionalValuesDashboardChart.tsx +27 -29
  28. package/src/components/Nutrition/widgets/charts/NutritionalValuesPlannedLoggedChart.tsx +20 -19
  29. package/src/components/WorkoutRoutines/Detail/WorkoutStats.tsx +17 -19
  30. package/src/components/WorkoutRoutines/widgets/DayDetails.tsx +3 -3
  31. package/src/components/WorkoutRoutines/widgets/LogWidgets.tsx +35 -38
  32. package/src/components/WorkoutRoutines/widgets/SlotDetails.tsx +4 -4
  33. package/src/components/WorkoutRoutines/widgets/forms/SessionLogsForm.tsx +4 -4
  34. package/src/services/exerciseTranslation.ts +24 -9
  35. package/src/services/measurements.ts +15 -2
  36. package/src/services/responseType.ts +3 -29
  37. package/src/tests/exerciseTestdata.ts +61 -55
  38. package/src/tests/exercises/searchResponse.ts +49 -22
  39. package/src/tests/responseApi.ts +25 -14
@@ -46,16 +46,16 @@ export const testEquipment = [
46
46
  testEquipmentRocks,
47
47
  ];
48
48
 
49
- export const testExerciseSquats = new Exercise(
50
- 345,
51
- "c788d643-150a-4ac7-97ef-84643c6419bf",
52
- testCategoryLegs,
53
- [testEquipmentBarbell, testEquipmentRocks],
54
- [testMuscleBiggus, testMuscleRectusAbdominis],
55
- [],
56
- [],
57
- null,
58
- [
49
+ export const testExerciseSquats = new Exercise({
50
+ id: 345,
51
+ uuid: "c788d643-150a-4ac7-97ef-84643c6419bf",
52
+ category: testCategoryLegs,
53
+ equipment: [testEquipmentBarbell, testEquipmentRocks],
54
+ muscles: [testMuscleBiggus, testMuscleRectusAbdominis],
55
+ musclesSecondary: [],
56
+ images: [],
57
+ variationId: null,
58
+ translations: [
59
59
  new Translation(111,
60
60
  '583281c7-2362-48e7-95d5-8fd6c455e0fb',
61
61
  'Squats',
@@ -74,18 +74,18 @@ export const testExerciseSquats = new Exercise(
74
74
  ]
75
75
  )
76
76
  ]
77
- );
77
+ });
78
78
 
79
- export const testExerciseBenchPress = new Exercise(
80
- 2,
81
- "abcdef-150a-4ac7-97ef-84643c6419bf",
82
- testCategoryLegs,
83
- [testEquipmentBarbell, testEquipmentRocks],
84
- [testMuscleDacttilaris, testMuscleDeltoid],
85
- [],
86
- [],
87
- 1,
88
- [
79
+ export const testExerciseBenchPress = new Exercise({
80
+ id: 2,
81
+ uuid: "abcdef-150a-4ac7-97ef-84643c6419bf",
82
+ category: testCategoryLegs,
83
+ equipment: [testEquipmentBarbell, testEquipmentRocks],
84
+ muscles: [testMuscleDacttilaris, testMuscleDeltoid],
85
+ musclesSecondary: [],
86
+ images: [],
87
+ variationId: 1,
88
+ translations: [
89
89
  new Translation(111,
90
90
  '583281c7-2362-48e7-95d5-8fd6c455e0fb',
91
91
  'Benchpress',
@@ -93,17 +93,19 @@ export const testExerciseBenchPress = new Exercise(
93
93
  2
94
94
  ),
95
95
  ]
96
- );
97
- export const testExerciseCurls = new Exercise(
98
- 3,
99
- "abcdef-150a-4ac7-97ef-84643c6419bf",
100
- testCategoryArms,
101
- [testEquipmentDumbbell],
102
- [testMuscleBiggus, testMuscleDacttilaris],
103
- [],
104
- [],
105
- 1,
106
- [
96
+ });
97
+
98
+ export const testExerciseCurls = new Exercise({
99
+ id: 3,
100
+ uuid: "abcdef-150a-4ac7-97ef-84643c6419bf",
101
+ lastUpdateGlobal: new Date(),
102
+ category: testCategoryArms,
103
+ equipment: [testEquipmentDumbbell],
104
+ muscles: [testMuscleBiggus, testMuscleDacttilaris],
105
+ musclesSecondary: [],
106
+ images: [],
107
+ variationId: 1,
108
+ translations: [
107
109
  new Translation(111,
108
110
  '583281c7-2362-48e7-95d5-8fd6c455e0fb',
109
111
  'Curls',
@@ -111,17 +113,19 @@ export const testExerciseCurls = new Exercise(
111
113
  2
112
114
  ),
113
115
  ]
114
- );
115
- export const testExerciseCrunches = new Exercise(
116
- 4,
117
- "abcdef-150a-4ac7-97ef-84643c6419bf",
118
- testCategoryChest,
119
- [testEquipmentRocks],
120
- [testMuscleDeltoid],
121
- [],
122
- [],
123
- null,
124
- [
116
+ });
117
+
118
+ export const testExerciseCrunches = new Exercise({
119
+ id: 4,
120
+ uuid: "abcdef-150a-4ac7-97ef-84643c6419bf",
121
+ lastUpdateGlobal: new Date(),
122
+ category: testCategoryChest,
123
+ equipment: [testEquipmentRocks],
124
+ muscles: [testMuscleDeltoid],
125
+ musclesSecondary: [],
126
+ images: [],
127
+ variationId: null,
128
+ translations: [
125
129
  new Translation(111,
126
130
  '583281c7-2362-48e7-95d5-8fd6c455e0fb',
127
131
  'Crunches',
@@ -129,17 +133,19 @@ export const testExerciseCrunches = new Exercise(
129
133
  2
130
134
  ),
131
135
  ]
132
- );
133
- export const testExerciseSkullCrusher = new Exercise(
134
- 5,
135
- "abcdef-150a-4ac7-97ef-84643c6419bf",
136
- testCategoryArms,
137
- [testEquipmentBarbell],
138
- [testMuscleRectusAbdominis],
139
- [],
140
- [],
141
- 2,
142
- [
136
+ });
137
+
138
+ export const testExerciseSkullCrusher = new Exercise({
139
+ id: 5,
140
+ uuid: "abcdef-150a-4ac7-97ef-84643c6419bf",
141
+ lastUpdateGlobal: new Date(),
142
+ category: testCategoryArms,
143
+ equipment: [testEquipmentBarbell],
144
+ muscles: [testMuscleRectusAbdominis],
145
+ musclesSecondary: [],
146
+ images: [],
147
+ variationId: 2,
148
+ translations: [
143
149
  new Translation(111,
144
150
  '583281c7-2362-48e7-95d5-8fd6c455e0fb',
145
151
  'Skull crusher',
@@ -147,7 +153,7 @@ export const testExerciseSkullCrusher = new Exercise(
147
153
  2
148
154
  ),
149
155
  ]
150
- );
156
+ });
151
157
 
152
158
  export const testExercises = [
153
159
  testExerciseSquats,
@@ -1,23 +1,50 @@
1
- export const searchResponse = [
2
- {
3
- "value": "Crunches an Negativbank",
4
- "data": {
5
- "id": 1149,
6
- "base_id": 998,
7
- "name": "Crunches an Negativbank",
8
- "category": "Bauch",
9
- "image": null,
10
- "image_thumbnail": null
11
- }
12
- }, {
13
- "value": "Crunches am Seil",
14
- "data": {
15
- "id": 1213,
16
- "base_id": 979,
17
- "name": "Crunches am Seil",
18
- "category": "Brust",
19
- "image": null,
20
- "image_thumbnail": null
21
- }
22
- }
1
+ import { Category } from "components/Exercises/models/category";
2
+ import { Exercise } from "components/Exercises/models/exercise";
3
+ import { Translation } from "components/Exercises/models/translation";
4
+
5
+ export const searchResponse: Exercise[] = [
6
+ new Exercise({
7
+ id: 998,
8
+ uuid: "uuid-998",
9
+ lastUpdateGlobal: new Date(),
10
+ category: new Category(8, "Bauch"),
11
+ equipment: [],
12
+ muscles: [],
13
+ musclesSecondary: [],
14
+ images: [],
15
+ variationId: null,
16
+ translations: [
17
+ new Translation(
18
+ 1149, // id
19
+ "uuid-1149", // uuid
20
+ "Crunches an Negativbank", // name
21
+ "", // description
22
+ 1 // language (German)
23
+ )
24
+ ],
25
+ videos: [],
26
+ authors: []
27
+ }),
28
+ new Exercise({
29
+ id: 979,
30
+ uuid: "uuid-979",
31
+ lastUpdateGlobal: new Date(),
32
+ category: new Category(11, "Brust"),
33
+ equipment: [],
34
+ muscles: [],
35
+ musclesSecondary: [],
36
+ images: [],
37
+ variationId: null,
38
+ translations: [
39
+ new Translation(
40
+ 1213, // id
41
+ "uuid-1213", // uuid
42
+ "Crunches am Seil", // name
43
+ "", // description
44
+ 1 // language (German)
45
+ )
46
+ ],
47
+ videos: [],
48
+ authors: []
49
+ })
23
50
  ];
@@ -41,20 +41,21 @@ const image = new ExerciseImage(
41
41
  true
42
42
  );
43
43
 
44
- export const testApiExercise1 = new Exercise(
45
- 345,
46
- "c788d643-150a-4ac7-97ef-84643c6419bf",
47
- category,
48
- [equipment1, equipment2],
49
- [muscle1],
50
- [muscle2],
51
- [image],
52
- 228,
53
- [
44
+ export const testApiExercise1 = new Exercise({
45
+ id: 345,
46
+ uuid: "c788d643-150a-4ac7-97ef-84643c6419bf",
47
+ lastUpdateGlobal: new Date("2025-11-22T19:32:02.590941+01:00"),
48
+ category: category,
49
+ equipment: [equipment1, equipment2],
50
+ muscles: [muscle1],
51
+ musclesSecondary: [muscle2],
52
+ images: [image],
53
+ variationId: 228,
54
+ translations: [
54
55
  testExerciseTranslation1,
55
56
  testExerciseTranslation2
56
57
  ],
57
- [
58
+ videos: [
58
59
  new ExerciseVideo(
59
60
  1,
60
61
  "b1c934fa-c4f8-4d84-8cb4-7802be0d284c",
@@ -62,12 +63,13 @@ export const testApiExercise1 = new Exercise(
62
63
  false
63
64
  )
64
65
  ],
65
- [
66
+ authors: [
66
67
  "wger.de",
67
68
  "author 1",
68
- "somebody else"
69
+ "somebody else",
70
+ "Mr. T"
69
71
  ]
70
- );
72
+ });
71
73
 
72
74
 
73
75
  export const responseApiExerciseInfo = {
@@ -77,6 +79,9 @@ export const responseApiExerciseInfo = {
77
79
  "results": [{
78
80
  "id": 345,
79
81
  "uuid": "c788d643-150a-4ac7-97ef-84643c6419bf",
82
+ "created": "2023-08-06T10:17:17.422900+02:00",
83
+ "last_update": "2025-11-22T14:17:20.119332+01:00",
84
+ "last_update_global": "2025-11-22T19:32:02.590941+01:00",
80
85
  "category": {
81
86
  "id": 10,
82
87
  "name": "Abs"
@@ -192,6 +197,12 @@ export const responseApiExerciseInfo = {
192
197
  "wger.de",
193
198
  "author 1",
194
199
  "somebody else"
200
+ ],
201
+ "total_authors_history": [
202
+ "wger.de",
203
+ "author 1",
204
+ "somebody else",
205
+ "Mr. T"
195
206
  ]
196
207
  }]
197
208
  };