@sency/react-native-smkit-ui 0.2.0 → 0.2.2
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/android/build.gradle +1 -1
- package/android/src/main/java/com/smkituilibrary/SmkitUiLibraryModule.kt +22 -3
- package/android/src/main/java/com/smkituilibrary/mapper/SMMapper.kt +3 -1
- package/android/src/main/java/com/smkituilibrary/model/SMUserData.kt +17 -0
- package/ios/SMKitUIManager.mm +2 -2
- package/ios/SMKitUIManager.swift +63 -7
- package/lib/commonjs/SMWorkout.js +143 -1
- package/lib/commonjs/SMWorkout.js.map +1 -1
- package/lib/commonjs/index.js +44 -4
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/SMWorkout.js +147 -0
- package/lib/module/SMWorkout.js.map +1 -1
- package/lib/module/index.js +44 -4
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/example/src/App.d.ts +4 -0
- package/lib/typescript/example/src/App.d.ts.map +1 -0
- package/lib/typescript/src/SMWorkout.d.ts +117 -0
- package/lib/typescript/src/SMWorkout.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +37 -2
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/react-native-smkit-ui.podspec +1 -1
- package/src/SMWorkout.tsx +163 -0
- package/src/index.tsx +63 -6
package/lib/module/SMWorkout.js
CHANGED
|
@@ -1,39 +1,94 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Enum representing assessment types.
|
|
3
|
+
* @enum {string}
|
|
4
|
+
*/
|
|
1
5
|
export let AssessmentTypes = /*#__PURE__*/function (AssessmentTypes) {
|
|
2
6
|
AssessmentTypes["Fitness"] = "fitness";
|
|
3
7
|
AssessmentTypes["Custom"] = "custom";
|
|
4
8
|
AssessmentTypes["Body360"] = "body360";
|
|
5
9
|
return AssessmentTypes;
|
|
6
10
|
}({});
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Enum representing UI elements that can be displayed during workouts.
|
|
14
|
+
* @enum {string}
|
|
15
|
+
*/
|
|
7
16
|
export let UIElement = /*#__PURE__*/function (UIElement) {
|
|
8
17
|
UIElement["RepsCounter"] = "repsCounter";
|
|
9
18
|
UIElement["Timer"] = "timer";
|
|
10
19
|
UIElement["GaugeOfMotion"] = "gaugeOfMotion";
|
|
11
20
|
return UIElement;
|
|
12
21
|
}({});
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Enum representing body zones targeted in workouts.
|
|
25
|
+
* @enum {string}
|
|
26
|
+
*/
|
|
13
27
|
export let BodyZone = /*#__PURE__*/function (BodyZone) {
|
|
14
28
|
BodyZone["UpperBody"] = "UpperBody";
|
|
15
29
|
BodyZone["LowerBody"] = "LowerBody";
|
|
16
30
|
BodyZone["FullBody"] = "FullBody";
|
|
17
31
|
return BodyZone;
|
|
18
32
|
}({});
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Enum representing workout difficulty levels.
|
|
36
|
+
* @enum {string}
|
|
37
|
+
*/
|
|
19
38
|
export let WorkoutDifficulty = /*#__PURE__*/function (WorkoutDifficulty) {
|
|
20
39
|
WorkoutDifficulty["LowDifficulty"] = "LowDifficulty";
|
|
21
40
|
WorkoutDifficulty["MidDifficulty"] = "MidDifficulty";
|
|
22
41
|
WorkoutDifficulty["HighDifficulty"] = "HighDifficulty";
|
|
23
42
|
return WorkoutDifficulty;
|
|
24
43
|
}({});
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Enum representing workout durations.
|
|
47
|
+
* @enum {string}
|
|
48
|
+
*/
|
|
25
49
|
export let WorkoutDuration = /*#__PURE__*/function (WorkoutDuration) {
|
|
26
50
|
WorkoutDuration["Short"] = "Short";
|
|
27
51
|
WorkoutDuration["Long"] = "Long";
|
|
28
52
|
return WorkoutDuration;
|
|
29
53
|
}({});
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Enum representing different types of scoring methods.
|
|
57
|
+
* @enum {string}
|
|
58
|
+
*/
|
|
30
59
|
export let ScoringType = /*#__PURE__*/function (ScoringType) {
|
|
31
60
|
ScoringType["Rom"] = "rom";
|
|
32
61
|
ScoringType["Time"] = "time";
|
|
33
62
|
ScoringType["Reps"] = "reps";
|
|
34
63
|
return ScoringType;
|
|
35
64
|
}({});
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Enum representing gender options for user data.
|
|
68
|
+
* @enum {string}
|
|
69
|
+
*/
|
|
70
|
+
export let Gender = /*#__PURE__*/function (Gender) {
|
|
71
|
+
Gender["Female"] = "Female";
|
|
72
|
+
Gender["Male"] = "Male";
|
|
73
|
+
Gender["Other"] = "Rather not say";
|
|
74
|
+
return Gender;
|
|
75
|
+
}({});
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Class representing a workout.
|
|
79
|
+
*/
|
|
36
80
|
export class SMWorkout {
|
|
81
|
+
/**
|
|
82
|
+
* @param {string | null} id - Unique identifier for the workout.
|
|
83
|
+
* @param {string | null} name - Name of the workout.
|
|
84
|
+
* @param {string | null} workoutIntro - URL for workout intro sound.
|
|
85
|
+
* @param {string | null} soundtrack - URL for soundtrack.
|
|
86
|
+
* @param {SMExercise[]} exercises - List of exercises included in the workout.
|
|
87
|
+
* @param {string | null} getInFrame - URL for body cal get in frame sound.
|
|
88
|
+
* @param {string | null} bodycalFinished - URL for body cal finished sound.
|
|
89
|
+
* @param {string | null} workoutClosure - URL for workout closure sound.
|
|
90
|
+
*/
|
|
91
|
+
|
|
37
92
|
constructor(id, name, workoutIntro, soundtrack, exercises, getInFrame, bodycalFinished, workoutClosure) {
|
|
38
93
|
this.id = id || null;
|
|
39
94
|
this.name = name || null;
|
|
@@ -57,7 +112,22 @@ export class SMWorkout {
|
|
|
57
112
|
});
|
|
58
113
|
}
|
|
59
114
|
}
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Class representing an exercise in a workout.
|
|
118
|
+
*/
|
|
60
119
|
export class SMExercise {
|
|
120
|
+
/**
|
|
121
|
+
* @param {string | null} prettyName - Name of the exercise.
|
|
122
|
+
* @param {number | null} totalSeconds - Duration of the exercise in seconds.
|
|
123
|
+
* @param {string | null} videoInstruction - Video instruction URL.
|
|
124
|
+
* @param {string | null} exerciseIntro - URL for exercise intro sound.
|
|
125
|
+
* @param {UIElement[] | null} uiElements - List of UI elements for this exercise.
|
|
126
|
+
* @param {string} detector - Name of the detector for tracking exercise movement.
|
|
127
|
+
* @param {string | null} exerciseClosure - URL for exercise closer sound.
|
|
128
|
+
* @param {SMScoringParams | null} scoringParams - Parameters for exercise scoring.
|
|
129
|
+
*/
|
|
130
|
+
|
|
61
131
|
constructor(prettyName, totalSeconds, videoInstruction, exerciseIntro, uiElements, detector, exerciseClosure, scoringParams) {
|
|
62
132
|
this.prettyName = prettyName || null;
|
|
63
133
|
this.totalSeconds = totalSeconds || null;
|
|
@@ -69,7 +139,51 @@ export class SMExercise {
|
|
|
69
139
|
this.scoringParams = scoringParams || null;
|
|
70
140
|
}
|
|
71
141
|
}
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* Class representing an exercise in an assessment.
|
|
145
|
+
*/
|
|
146
|
+
export class SMAssessmentExercise extends SMExercise {
|
|
147
|
+
/**
|
|
148
|
+
* @param {string | null} prettyName - Name of the exercise.
|
|
149
|
+
* @param {number | null} totalSeconds - Duration of the exercise in seconds.
|
|
150
|
+
* @param {string | null} videoInstruction - Video instruction URL.
|
|
151
|
+
* @param {string | null} exerciseIntro - URL for exercise intro sound.
|
|
152
|
+
* @param {UIElement[] | null} uiElements - List of UI elements for this exercise.
|
|
153
|
+
* @param {string} detector - Name of the detector for tracking exercise movement.
|
|
154
|
+
* @param {string | null} exerciseClosure - URL for exercise closer sound.
|
|
155
|
+
* @param {SMScoringParams | null} scoringParams - Parameters for exercise scoring.
|
|
156
|
+
* @param {string | null} summaryTitle - Title for the exercise summary.
|
|
157
|
+
* @param {string | null} summarySubTitle - Subtitle for the exercise summary.
|
|
158
|
+
* @param {string | null} summaryMainMetricTitle - Main metric title in the summary.
|
|
159
|
+
* @param {string | null} summaryMainMetricSubTitle - Main metric subtitle in the summary.
|
|
160
|
+
*/
|
|
161
|
+
|
|
162
|
+
constructor(prettyName, totalSeconds, videoInstruction, exerciseIntro, uiElements, detector, exerciseClosure, scoringParams, summaryTitle, summarySubTitle, summaryMainMetricTitle, summaryMainMetricSubTitle) {
|
|
163
|
+
// Call the constructor of the parent class (SMExercise)
|
|
164
|
+
super(prettyName, totalSeconds, videoInstruction, exerciseIntro, uiElements, detector, exerciseClosure, scoringParams);
|
|
165
|
+
|
|
166
|
+
// Set additional properties specific to SMAssessmentExercise
|
|
167
|
+
this.summaryTitle = summaryTitle || null;
|
|
168
|
+
this.summarySubTitle = summarySubTitle || null;
|
|
169
|
+
this.summaryMainMetricTitle = summaryMainMetricTitle || null;
|
|
170
|
+
this.summaryMainMetricSubTitle = summaryMainMetricSubTitle || null;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* Class representing scoring parameters for an exercise.
|
|
176
|
+
*/
|
|
72
177
|
export class SMScoringParams {
|
|
178
|
+
/**
|
|
179
|
+
* @param {ScoringType | null} type - Type of scoring (e.g., ROM, time, reps).
|
|
180
|
+
* @param {number | null} scoreFactor - Factor to adjust the score.
|
|
181
|
+
* @param {number | null} targetTime - Target time for time-based scoring.
|
|
182
|
+
* @param {number | null} targetReps - Target reps for rep-based scoring.
|
|
183
|
+
* @param {string | null} targetRom - Range of motion target for ROM-based scoring.
|
|
184
|
+
* @param {string[] | null} passCriteria - List of criteria required to pass.
|
|
185
|
+
*/
|
|
186
|
+
|
|
73
187
|
constructor(type, scoreFactor, targetTime, targetReps, targetRom, passCriteria) {
|
|
74
188
|
this.type = type || null;
|
|
75
189
|
this.scoreFactor = scoreFactor || null;
|
|
@@ -79,7 +193,19 @@ export class SMScoringParams {
|
|
|
79
193
|
this.passCriteria = passCriteria || null;
|
|
80
194
|
}
|
|
81
195
|
}
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
* Class representing the configuration for a workout program.
|
|
199
|
+
*/
|
|
82
200
|
export class WorkoutConfig {
|
|
201
|
+
/**
|
|
202
|
+
* @param {number} week - Week number in the program.
|
|
203
|
+
* @param {BodyZone} bodyZone - Targeted body zone for the workout.
|
|
204
|
+
* @param {WorkoutDifficulty} difficultyLevel - Difficulty level of the workout.
|
|
205
|
+
* @param {WorkoutDuration} workoutDuration - Duration of the workout.
|
|
206
|
+
* @param {string} programID - Unique identifier for the workout program.
|
|
207
|
+
*/
|
|
208
|
+
|
|
83
209
|
constructor(week, bodyZone, difficultyLevel, workoutDuration, programID) {
|
|
84
210
|
this.week = week;
|
|
85
211
|
this.bodyZone = bodyZone;
|
|
@@ -97,4 +223,25 @@ export class WorkoutConfig {
|
|
|
97
223
|
});
|
|
98
224
|
}
|
|
99
225
|
}
|
|
226
|
+
|
|
227
|
+
/**
|
|
228
|
+
* Class representing user data.
|
|
229
|
+
*/
|
|
230
|
+
export class UserData {
|
|
231
|
+
/**
|
|
232
|
+
* @param {Gender} gender - User's gender.
|
|
233
|
+
* @param {number} age - User's age.
|
|
234
|
+
*/
|
|
235
|
+
|
|
236
|
+
constructor(gender, age) {
|
|
237
|
+
this.gender = gender;
|
|
238
|
+
this.age = age;
|
|
239
|
+
}
|
|
240
|
+
toJson() {
|
|
241
|
+
return JSON.stringify({
|
|
242
|
+
gender: this.gender,
|
|
243
|
+
age: this.age
|
|
244
|
+
});
|
|
245
|
+
}
|
|
246
|
+
}
|
|
100
247
|
//# sourceMappingURL=SMWorkout.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["AssessmentTypes","UIElement","BodyZone","WorkoutDifficulty","WorkoutDuration","ScoringType","SMWorkout","constructor","id","name","workoutIntro","soundtrack","exercises","getInFrame","bodycalFinished","workoutClosure","toJson","JSON","stringify","SMExercise","prettyName","totalSeconds","videoInstruction","exerciseIntro","uiElements","detector","exerciseClosure","scoringParams","SMScoringParams","type","scoreFactor","targetTime","targetReps","targetRom","passCriteria","WorkoutConfig","week","bodyZone","difficultyLevel","workoutDuration","programID"],"sourceRoot":"../../src","sources":["SMWorkout.tsx"],"mappings":"AAAA,WAAYA,eAAe,0BAAfA,eAAe;EAAfA,eAAe;EAAfA,eAAe;EAAfA,eAAe;EAAA,OAAfA,eAAe;AAAA;
|
|
1
|
+
{"version":3,"names":["AssessmentTypes","UIElement","BodyZone","WorkoutDifficulty","WorkoutDuration","ScoringType","Gender","SMWorkout","constructor","id","name","workoutIntro","soundtrack","exercises","getInFrame","bodycalFinished","workoutClosure","toJson","JSON","stringify","SMExercise","prettyName","totalSeconds","videoInstruction","exerciseIntro","uiElements","detector","exerciseClosure","scoringParams","SMAssessmentExercise","summaryTitle","summarySubTitle","summaryMainMetricTitle","summaryMainMetricSubTitle","SMScoringParams","type","scoreFactor","targetTime","targetReps","targetRom","passCriteria","WorkoutConfig","week","bodyZone","difficultyLevel","workoutDuration","programID","UserData","gender","age"],"sourceRoot":"../../src","sources":["SMWorkout.tsx"],"mappings":"AAAA;AACA;AACA;AACA;AACA,WAAYA,eAAe,0BAAfA,eAAe;EAAfA,eAAe;EAAfA,eAAe;EAAfA,eAAe;EAAA,OAAfA,eAAe;AAAA;;AAM3B;AACA;AACA;AACA;AACA,WAAYC,SAAS,0BAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAAA,OAATA,SAAS;AAAA;;AAMrB;AACA;AACA;AACA;AACA,WAAYC,QAAQ,0BAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAAA,OAARA,QAAQ;AAAA;;AAMpB;AACA;AACA;AACA;AACA,WAAYC,iBAAiB,0BAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAA,OAAjBA,iBAAiB;AAAA;;AAM7B;AACA;AACA;AACA;AACA,WAAYC,eAAe,0BAAfA,eAAe;EAAfA,eAAe;EAAfA,eAAe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ACrCC,SAAS,EAAE,IAAI,CAACA;IAClB,CAAC,CAAC;EACJ;AACF;;AAEA;AACA;AACA;AACA,OAAO,MAAMC,QAAQ,CAAC;EACpB;AACF;AACA;AACA;;EAIEvC,WAAWA,CAACwC,MAAc,EAAEC,GAAW,EAAE;IACvC,IAAI,CAACD,MAAM,GAAGA,MAAM;IACpB,IAAI,CAACC,GAAG,GAAGA,GAAG;EAChB;EAEAhC,MAAMA,CAAA,EAAW;IACf,OAAOC,IAAI,CAACC,SAAS,CAAC;MACpB6B,MAAM,EAAE,IAAI,CAACA,MAAM;MACnBC,GAAG,EAAE,IAAI,CAACA;IACZ,CAAC,CAAC;EACJ;AACF","ignoreList":[]}
|
package/lib/module/index.js
CHANGED
|
@@ -8,18 +8,58 @@ const SMKitUIManager = NativeModules.SMKitUIManager ? NativeModules.SMKitUIManag
|
|
|
8
8
|
throw new Error(LINKING_ERROR);
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* This function will configure the sdk
|
|
14
|
+
* @param {string} key - your auth key
|
|
15
|
+
*/
|
|
11
16
|
export function configure(key) {
|
|
12
17
|
return SMKitUIManager.configure(key);
|
|
13
18
|
}
|
|
14
|
-
|
|
15
|
-
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* start an assessment session.
|
|
22
|
+
*
|
|
23
|
+
* @param {SMWorkoutLibrary.AssessmentTypes} type - The type of assessment to start.
|
|
24
|
+
* @param {boolean} [showSummary=true] - Determines if the summary should be shown after assessment completion.
|
|
25
|
+
* @param {SMWorkoutLibrary.UserData | null} userData - User data for the assessment session, or `null` if no user data is provided.
|
|
26
|
+
* @param {boolean} [forceShowUserDataScreen=false] - Forces the display of the user data screen even if user data is provided.
|
|
27
|
+
* @param {string} customAssessmentID - A unique identifier for a custom assessment session.
|
|
28
|
+
* @returns {Promise<{ summary: string; didFinish: boolean }>} - A promise that resolves with an object containing the summary and a flag indicating whether the assessment finished.
|
|
29
|
+
*/
|
|
30
|
+
export function startAssessment(type, showSummary = true, userData, forceShowUserDataScreen = false, customAssessmentID) {
|
|
31
|
+
return SMKitUIManager.startAssessment(type, showSummary, userData?.toJson(), forceShowUserDataScreen, customAssessmentID);
|
|
16
32
|
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Starts a custom workout session.
|
|
36
|
+
*
|
|
37
|
+
* @param {SMWorkoutLibrary.SMWorkout} workout - The custom workout configuration.
|
|
38
|
+
* @returns {Promise<{ summary: string; didFinish: boolean }>} - A promise that resolves with an object containing the summary and a flag indicating if the workout session finished.
|
|
39
|
+
*/
|
|
17
40
|
export function startCustomWorkout(workout) {
|
|
18
41
|
return SMKitUIManager.startCustomWorkout(workout.toJson());
|
|
19
42
|
}
|
|
20
|
-
|
|
21
|
-
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Initiates a custom assessment session.
|
|
46
|
+
*
|
|
47
|
+
* @param {SMWorkoutLibrary.SMWorkout} assessment - The assessment configuration for the session.
|
|
48
|
+
* @param {SMWorkoutLibrary.UserData | null} userData - User data for the assessment, or `null` if no user data is provided.
|
|
49
|
+
* @param {boolean} [forceShowUserDataScreen=false] - Forces the display of the user data screen even if user data is provided.
|
|
50
|
+
* @param {boolean} [showSummary=true] - Determines if the summary should be shown after assessment completion.
|
|
51
|
+
* @returns {Promise<{ summary: string; didFinish: boolean }>} - A promise that resolves with an object containing the summary and a flag indicating if the assessment finished.
|
|
52
|
+
*/
|
|
53
|
+
export function startCustomAssessment(assessment, userData, forceShowUserDataScreen = false, showSummary = true) {
|
|
54
|
+
return SMKitUIManager.startCustomAssessment(assessment.toJson(), userData?.toJson(), forceShowUserDataScreen, showSummary);
|
|
22
55
|
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Starts a workout program using the provided workout configuration.
|
|
59
|
+
*
|
|
60
|
+
* @param {SMWorkoutLibrary.WorkoutConfig} workoutConfig - The configuration for the workout program.
|
|
61
|
+
* @returns {Promise<{ summary: string; didFinish: boolean }>} - A promise that resolves with an object containing the summary and a flag indicating if the workout program finished.
|
|
62
|
+
*/
|
|
23
63
|
export function startWorkoutProgram(workoutConfig) {
|
|
24
64
|
return SMKitUIManager.startWorkoutProgram(workoutConfig.toJson());
|
|
25
65
|
}
|
package/lib/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["NativeModules","Platform","LINKING_ERROR","select","ios","default","SMKitUIManager","Proxy","get","Error","configure","key","startAssessment","type","showSummary","
|
|
1
|
+
{"version":3,"names":["NativeModules","Platform","LINKING_ERROR","select","ios","default","SMKitUIManager","Proxy","get","Error","configure","key","startAssessment","type","showSummary","userData","forceShowUserDataScreen","customAssessmentID","toJson","startCustomWorkout","workout","startCustomAssessment","assessment","startWorkoutProgram","workoutConfig"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":"AAAA,SAASA,aAAa,EAAEC,QAAQ,QAAQ,cAAc;AAGtD,MAAMC,aAAa,GACjB,gFAAgF,GAChFD,QAAQ,CAACE,MAAM,CAAC;EAAEC,GAAG,EAAE,gCAAgC;EAAEC,OAAO,EAAE;AAAG,CAAC,CAAC,GACvE,sDAAsD,GACtD,+BAA+B;AAEjC,MAAMC,cAAc,GAAGN,aAAa,CAACM,cAAc,GAC/CN,aAAa,CAACM,cAAc,GAC5B,IAAIC,KAAK,CACP,CAAC,CAAC,EACF;EACEC,GAAGA,CAAA,EAAG;IACJ,MAAM,IAAIC,KAAK,CAACP,aAAa,CAAC;EAChC;AACF,CACF,CAAC;;AAEL;AACA;AACA;AACA;AACA,OAAO,SAASQ,SAASA,CAACC,GAAW,EAAmB;EACtD,OAAOL,cAAc,CAACI,SAAS,CAACC,GAAG,CAAC;AACtC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,eAAeA,CAC7BC,IAAsC,EACtCC,WAAoB,GAAG,IAAI,EAC3BC,QAA0C,EAC1CC,uBAAgC,GAAG,KAAK,EACxCC,kBAA0B,EACwB;EAClD,OAAOX,cAAc,CAACM,eAAe,CACnCC,IAAI,EACJC,WAAW,EACXC,QAAQ,EAAEG,MAAM,CAAC,CAAC,EAClBF,uBAAuB,EACvBC,kBACF,CAAC;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASE,kBAAkBA,CAChCC,OAAmC,EACe;EAClD,OAAOd,cAAc,CAACa,kBAAkB,CAACC,OAAO,CAACF,MAAM,CAAC,CAAC,CAAC;AAC5D;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASG,qBAAqBA,CACnCC,UAAsC,EACtCP,QAA0C,EAC1CC,uBAAgC,GAAG,KAAK,EACxCF,WAAoB,GAAG,IAAI,EACuB;EAClD,OAAOR,cAAc,CAACe,qBAAqB,CACzCC,UAAU,CAACJ,MAAM,CAAC,CAAC,EACnBH,QAAQ,EAAEG,MAAM,CAAC,CAAC,EAClBF,uBAAuB,EACvBF,WACF,CAAC;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASS,mBAAmBA,CACjCC,aAA6C,EACK;EAClD,OAAOlB,cAAc,CAACiB,mBAAmB,CAACC,aAAa,CAACN,MAAM,CAAC,CAAC,CAAC;AACnE","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"App.d.ts","sourceRoot":"","sources":["../../../../example/src/App.tsx"],"names":[],"mappings":"AAIM,OAAO,KAA8B,MAAM,OAAO,CAAC;AAkBzD,QAAA,MAAM,GAAG,yBAmPR,CAAA;AA4BD,eAAe,GAAG,CAAC"}
|
|
@@ -1,33 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Enum representing assessment types.
|
|
3
|
+
* @enum {string}
|
|
4
|
+
*/
|
|
1
5
|
export declare enum AssessmentTypes {
|
|
2
6
|
Fitness = "fitness",
|
|
3
7
|
Custom = "custom",
|
|
4
8
|
Body360 = "body360"
|
|
5
9
|
}
|
|
10
|
+
/**
|
|
11
|
+
* Enum representing UI elements that can be displayed during workouts.
|
|
12
|
+
* @enum {string}
|
|
13
|
+
*/
|
|
6
14
|
export declare enum UIElement {
|
|
7
15
|
RepsCounter = "repsCounter",
|
|
8
16
|
Timer = "timer",
|
|
9
17
|
GaugeOfMotion = "gaugeOfMotion"
|
|
10
18
|
}
|
|
19
|
+
/**
|
|
20
|
+
* Enum representing body zones targeted in workouts.
|
|
21
|
+
* @enum {string}
|
|
22
|
+
*/
|
|
11
23
|
export declare enum BodyZone {
|
|
12
24
|
UpperBody = "UpperBody",
|
|
13
25
|
LowerBody = "LowerBody",
|
|
14
26
|
FullBody = "FullBody"
|
|
15
27
|
}
|
|
28
|
+
/**
|
|
29
|
+
* Enum representing workout difficulty levels.
|
|
30
|
+
* @enum {string}
|
|
31
|
+
*/
|
|
16
32
|
export declare enum WorkoutDifficulty {
|
|
17
33
|
LowDifficulty = "LowDifficulty",
|
|
18
34
|
MidDifficulty = "MidDifficulty",
|
|
19
35
|
HighDifficulty = "HighDifficulty"
|
|
20
36
|
}
|
|
37
|
+
/**
|
|
38
|
+
* Enum representing workout durations.
|
|
39
|
+
* @enum {string}
|
|
40
|
+
*/
|
|
21
41
|
export declare enum WorkoutDuration {
|
|
22
42
|
Short = "Short",
|
|
23
43
|
Long = "Long"
|
|
24
44
|
}
|
|
45
|
+
/**
|
|
46
|
+
* Enum representing different types of scoring methods.
|
|
47
|
+
* @enum {string}
|
|
48
|
+
*/
|
|
25
49
|
export declare enum ScoringType {
|
|
26
50
|
Rom = "rom",
|
|
27
51
|
Time = "time",
|
|
28
52
|
Reps = "reps"
|
|
29
53
|
}
|
|
54
|
+
/**
|
|
55
|
+
* Enum representing gender options for user data.
|
|
56
|
+
* @enum {string}
|
|
57
|
+
*/
|
|
58
|
+
export declare enum Gender {
|
|
59
|
+
Female = "Female",
|
|
60
|
+
Male = "Male",
|
|
61
|
+
Other = "Rather not say"
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Class representing a workout.
|
|
65
|
+
*/
|
|
30
66
|
export declare class SMWorkout {
|
|
67
|
+
/**
|
|
68
|
+
* @param {string | null} id - Unique identifier for the workout.
|
|
69
|
+
* @param {string | null} name - Name of the workout.
|
|
70
|
+
* @param {string | null} workoutIntro - URL for workout intro sound.
|
|
71
|
+
* @param {string | null} soundtrack - URL for soundtrack.
|
|
72
|
+
* @param {SMExercise[]} exercises - List of exercises included in the workout.
|
|
73
|
+
* @param {string | null} getInFrame - URL for body cal get in frame sound.
|
|
74
|
+
* @param {string | null} bodycalFinished - URL for body cal finished sound.
|
|
75
|
+
* @param {string | null} workoutClosure - URL for workout closure sound.
|
|
76
|
+
*/
|
|
31
77
|
id: string | null;
|
|
32
78
|
name: string | null;
|
|
33
79
|
workoutIntro: string | null;
|
|
@@ -39,7 +85,20 @@ export declare class SMWorkout {
|
|
|
39
85
|
constructor(id: string | null, name: string | null, workoutIntro: string | null, soundtrack: string | null, exercises: SMExercise[], getInFrame: string | null, bodycalFinished: string | null, workoutClosure: string | null);
|
|
40
86
|
toJson(): string;
|
|
41
87
|
}
|
|
88
|
+
/**
|
|
89
|
+
* Class representing an exercise in a workout.
|
|
90
|
+
*/
|
|
42
91
|
export declare class SMExercise {
|
|
92
|
+
/**
|
|
93
|
+
* @param {string | null} prettyName - Name of the exercise.
|
|
94
|
+
* @param {number | null} totalSeconds - Duration of the exercise in seconds.
|
|
95
|
+
* @param {string | null} videoInstruction - Video instruction URL.
|
|
96
|
+
* @param {string | null} exerciseIntro - URL for exercise intro sound.
|
|
97
|
+
* @param {UIElement[] | null} uiElements - List of UI elements for this exercise.
|
|
98
|
+
* @param {string} detector - Name of the detector for tracking exercise movement.
|
|
99
|
+
* @param {string | null} exerciseClosure - URL for exercise closer sound.
|
|
100
|
+
* @param {SMScoringParams | null} scoringParams - Parameters for exercise scoring.
|
|
101
|
+
*/
|
|
43
102
|
detector: string;
|
|
44
103
|
uiElements: UIElement[] | null;
|
|
45
104
|
videoInstruction: string | null;
|
|
@@ -50,7 +109,42 @@ export declare class SMExercise {
|
|
|
50
109
|
scoringParams: SMScoringParams | null;
|
|
51
110
|
constructor(prettyName: string | null, totalSeconds: number | null, videoInstruction: string | null, exerciseIntro: string | null, uiElements: UIElement[] | null, detector: string, exerciseClosure: string | null, scoringParams: SMScoringParams | null);
|
|
52
111
|
}
|
|
112
|
+
/**
|
|
113
|
+
* Class representing an exercise in an assessment.
|
|
114
|
+
*/
|
|
115
|
+
export declare class SMAssessmentExercise extends SMExercise {
|
|
116
|
+
/**
|
|
117
|
+
* @param {string | null} prettyName - Name of the exercise.
|
|
118
|
+
* @param {number | null} totalSeconds - Duration of the exercise in seconds.
|
|
119
|
+
* @param {string | null} videoInstruction - Video instruction URL.
|
|
120
|
+
* @param {string | null} exerciseIntro - URL for exercise intro sound.
|
|
121
|
+
* @param {UIElement[] | null} uiElements - List of UI elements for this exercise.
|
|
122
|
+
* @param {string} detector - Name of the detector for tracking exercise movement.
|
|
123
|
+
* @param {string | null} exerciseClosure - URL for exercise closer sound.
|
|
124
|
+
* @param {SMScoringParams | null} scoringParams - Parameters for exercise scoring.
|
|
125
|
+
* @param {string | null} summaryTitle - Title for the exercise summary.
|
|
126
|
+
* @param {string | null} summarySubTitle - Subtitle for the exercise summary.
|
|
127
|
+
* @param {string | null} summaryMainMetricTitle - Main metric title in the summary.
|
|
128
|
+
* @param {string | null} summaryMainMetricSubTitle - Main metric subtitle in the summary.
|
|
129
|
+
*/
|
|
130
|
+
summaryTitle: string | null;
|
|
131
|
+
summarySubTitle: string | null;
|
|
132
|
+
summaryMainMetricTitle: string | null;
|
|
133
|
+
summaryMainMetricSubTitle: string | null;
|
|
134
|
+
constructor(prettyName: string | null, totalSeconds: number | null, videoInstruction: string | null, exerciseIntro: string | null, uiElements: UIElement[] | null, detector: string, exerciseClosure: string | null, scoringParams: SMScoringParams | null, summaryTitle: string | null, summarySubTitle: string | null, summaryMainMetricTitle: string | null, summaryMainMetricSubTitle: string | null);
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Class representing scoring parameters for an exercise.
|
|
138
|
+
*/
|
|
53
139
|
export declare class SMScoringParams {
|
|
140
|
+
/**
|
|
141
|
+
* @param {ScoringType | null} type - Type of scoring (e.g., ROM, time, reps).
|
|
142
|
+
* @param {number | null} scoreFactor - Factor to adjust the score.
|
|
143
|
+
* @param {number | null} targetTime - Target time for time-based scoring.
|
|
144
|
+
* @param {number | null} targetReps - Target reps for rep-based scoring.
|
|
145
|
+
* @param {string | null} targetRom - Range of motion target for ROM-based scoring.
|
|
146
|
+
* @param {string[] | null} passCriteria - List of criteria required to pass.
|
|
147
|
+
*/
|
|
54
148
|
type: ScoringType | null;
|
|
55
149
|
scoreFactor: number | null;
|
|
56
150
|
targetTime: number | null;
|
|
@@ -59,7 +153,17 @@ export declare class SMScoringParams {
|
|
|
59
153
|
passCriteria: string[] | null;
|
|
60
154
|
constructor(type: ScoringType | null, scoreFactor: number | null, targetTime: number | null, targetReps: number | null, targetRom: string | null, passCriteria: string[] | null);
|
|
61
155
|
}
|
|
156
|
+
/**
|
|
157
|
+
* Class representing the configuration for a workout program.
|
|
158
|
+
*/
|
|
62
159
|
export declare class WorkoutConfig {
|
|
160
|
+
/**
|
|
161
|
+
* @param {number} week - Week number in the program.
|
|
162
|
+
* @param {BodyZone} bodyZone - Targeted body zone for the workout.
|
|
163
|
+
* @param {WorkoutDifficulty} difficultyLevel - Difficulty level of the workout.
|
|
164
|
+
* @param {WorkoutDuration} workoutDuration - Duration of the workout.
|
|
165
|
+
* @param {string} programID - Unique identifier for the workout program.
|
|
166
|
+
*/
|
|
63
167
|
week: number;
|
|
64
168
|
bodyZone: BodyZone;
|
|
65
169
|
difficultyLevel: WorkoutDifficulty;
|
|
@@ -68,4 +172,17 @@ export declare class WorkoutConfig {
|
|
|
68
172
|
constructor(week: number, bodyZone: BodyZone, difficultyLevel: WorkoutDifficulty, workoutDuration: WorkoutDuration, programID: string);
|
|
69
173
|
toJson(): string;
|
|
70
174
|
}
|
|
175
|
+
/**
|
|
176
|
+
* Class representing user data.
|
|
177
|
+
*/
|
|
178
|
+
export declare class UserData {
|
|
179
|
+
/**
|
|
180
|
+
* @param {Gender} gender - User's gender.
|
|
181
|
+
* @param {number} age - User's age.
|
|
182
|
+
*/
|
|
183
|
+
gender: Gender;
|
|
184
|
+
age: number;
|
|
185
|
+
constructor(gender: Gender, age: number);
|
|
186
|
+
toJson(): string;
|
|
187
|
+
}
|
|
71
188
|
//# sourceMappingURL=SMWorkout.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SMWorkout.d.ts","sourceRoot":"","sources":["../../../src/SMWorkout.tsx"],"names":[],"mappings":"AAAA,oBAAY,eAAe;IACzB,OAAO,YAAY;IACnB,MAAM,WAAW;IACjB,OAAO,YAAY;CACpB;AAED,oBAAY,SAAS;IACnB,WAAW,gBAAgB;IAC3B,KAAK,UAAU;IACf,aAAa,kBAAkB;CAChC;AAED,oBAAY,QAAQ;IAClB,SAAS,cAAc;IACvB,SAAS,cAAc;IACvB,QAAQ,aAAa;CACtB;AAED,oBAAY,iBAAiB;IAC3B,aAAa,kBAAkB;IAC/B,aAAa,kBAAkB;IAC/B,cAAc,mBAAmB;CAClC;AAED,oBAAY,eAAe;IACzB,KAAK,UAAU;IACf,IAAI,SAAS;CACd;AAED,oBAAY,WAAW;IACrB,GAAG,QAAQ;IACX,IAAI,SAAS;IACb,IAAI,SAAS;CACd;AAED,qBAAa,SAAS;IACpB,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;IAClB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,SAAS,EAAE,UAAU,EAAE,CAAC;IACxB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,eAAe,EAAE,MAAM,GAAG,IAAI,CAA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,qBAAa,aAAa;IACxB;;;;;;OAMG;IACH,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,QAAQ,CAAC;IACnB,eAAe,EAAE,iBAAiB,CAAC;IACnC,eAAe,EAAE,eAAe,CAAC;IACjC,SAAS,EAAE,MAAM,CAAC;gBAGhB,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,QAAQ,EAClB,eAAe,EAAE,iBAAiB,EAClC,eAAe,EAAE,eAAe,EAChC,SAAS,EAAE,MAAM;IASnB,MAAM,IAAI,MAAM;CASjB;AAED;;GAEG;AACH,qBAAa,QAAQ;IACnB;;;OAGG;IACH,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;gBAEA,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM;IAKvC,MAAM,IAAI,MAAM;CAMjB"}
|
|
@@ -1,17 +1,52 @@
|
|
|
1
1
|
import * as SMWorkoutLibrary from '../src/SMWorkout';
|
|
2
|
+
/**
|
|
3
|
+
* This function will configure the sdk
|
|
4
|
+
* @param {string} key - your auth key
|
|
5
|
+
*/
|
|
2
6
|
export declare function configure(key: string): Promise<string>;
|
|
3
|
-
|
|
7
|
+
/**
|
|
8
|
+
* start an assessment session.
|
|
9
|
+
*
|
|
10
|
+
* @param {SMWorkoutLibrary.AssessmentTypes} type - The type of assessment to start.
|
|
11
|
+
* @param {boolean} [showSummary=true] - Determines if the summary should be shown after assessment completion.
|
|
12
|
+
* @param {SMWorkoutLibrary.UserData | null} userData - User data for the assessment session, or `null` if no user data is provided.
|
|
13
|
+
* @param {boolean} [forceShowUserDataScreen=false] - Forces the display of the user data screen even if user data is provided.
|
|
14
|
+
* @param {string} customAssessmentID - A unique identifier for a custom assessment session.
|
|
15
|
+
* @returns {Promise<{ summary: string; didFinish: boolean }>} - A promise that resolves with an object containing the summary and a flag indicating whether the assessment finished.
|
|
16
|
+
*/
|
|
17
|
+
export declare function startAssessment(type: SMWorkoutLibrary.AssessmentTypes, showSummary: boolean | undefined, userData: SMWorkoutLibrary.UserData | null, forceShowUserDataScreen: boolean | undefined, customAssessmentID: string): Promise<{
|
|
4
18
|
summary: string;
|
|
5
19
|
didFinish: boolean;
|
|
6
20
|
}>;
|
|
21
|
+
/**
|
|
22
|
+
* Starts a custom workout session.
|
|
23
|
+
*
|
|
24
|
+
* @param {SMWorkoutLibrary.SMWorkout} workout - The custom workout configuration.
|
|
25
|
+
* @returns {Promise<{ summary: string; didFinish: boolean }>} - A promise that resolves with an object containing the summary and a flag indicating if the workout session finished.
|
|
26
|
+
*/
|
|
7
27
|
export declare function startCustomWorkout(workout: SMWorkoutLibrary.SMWorkout): Promise<{
|
|
8
28
|
summary: string;
|
|
9
29
|
didFinish: boolean;
|
|
10
30
|
}>;
|
|
11
|
-
|
|
31
|
+
/**
|
|
32
|
+
* Initiates a custom assessment session.
|
|
33
|
+
*
|
|
34
|
+
* @param {SMWorkoutLibrary.SMWorkout} assessment - The assessment configuration for the session.
|
|
35
|
+
* @param {SMWorkoutLibrary.UserData | null} userData - User data for the assessment, or `null` if no user data is provided.
|
|
36
|
+
* @param {boolean} [forceShowUserDataScreen=false] - Forces the display of the user data screen even if user data is provided.
|
|
37
|
+
* @param {boolean} [showSummary=true] - Determines if the summary should be shown after assessment completion.
|
|
38
|
+
* @returns {Promise<{ summary: string; didFinish: boolean }>} - A promise that resolves with an object containing the summary and a flag indicating if the assessment finished.
|
|
39
|
+
*/
|
|
40
|
+
export declare function startCustomAssessment(assessment: SMWorkoutLibrary.SMWorkout, userData: SMWorkoutLibrary.UserData | null, forceShowUserDataScreen?: boolean, showSummary?: boolean): Promise<{
|
|
12
41
|
summary: string;
|
|
13
42
|
didFinish: boolean;
|
|
14
43
|
}>;
|
|
44
|
+
/**
|
|
45
|
+
* Starts a workout program using the provided workout configuration.
|
|
46
|
+
*
|
|
47
|
+
* @param {SMWorkoutLibrary.WorkoutConfig} workoutConfig - The configuration for the workout program.
|
|
48
|
+
* @returns {Promise<{ summary: string; didFinish: boolean }>} - A promise that resolves with an object containing the summary and a flag indicating if the workout program finished.
|
|
49
|
+
*/
|
|
15
50
|
export declare function startWorkoutProgram(workoutConfig: SMWorkoutLibrary.WorkoutConfig): Promise<{
|
|
16
51
|
summary: string;
|
|
17
52
|
didFinish: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,gBAAgB,MAAM,kBAAkB,CAAC;AAmBrD,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAEtD;AAED,wBAAgB,eAAe,CAC7B,IAAI,EAAE,gBAAgB,CAAC,eAAe,EACtC,WAAW,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,gBAAgB,MAAM,kBAAkB,CAAC;AAmBrD;;;GAGG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAEtD;AAED;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAC7B,IAAI,EAAE,gBAAgB,CAAC,eAAe,EACtC,WAAW,EAAE,OAAO,YAAO,EAC3B,QAAQ,EAAE,gBAAgB,CAAC,QAAQ,GAAG,IAAI,EAC1C,uBAAuB,EAAE,OAAO,YAAQ,EACxC,kBAAkB,EAAE,MAAM,GACzB,OAAO,CAAC;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,OAAO,CAAA;CAAE,CAAC,CAQlD;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,gBAAgB,CAAC,SAAS,GAClC,OAAO,CAAC;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,OAAO,CAAA;CAAE,CAAC,CAElD;AAED;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,CACnC,UAAU,EAAE,gBAAgB,CAAC,SAAS,EACtC,QAAQ,EAAE,gBAAgB,CAAC,QAAQ,GAAG,IAAI,EAC1C,uBAAuB,GAAE,OAAe,EACxC,WAAW,GAAE,OAAc,GAC1B,OAAO,CAAC;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,OAAO,CAAA;CAAE,CAAC,CAOlD;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CACjC,aAAa,EAAE,gBAAgB,CAAC,aAAa,GAC5C,OAAO,CAAC;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,OAAO,CAAA;CAAE,CAAC,CAElD"}
|
package/package.json
CHANGED
|
@@ -15,7 +15,7 @@ Pod::Spec.new do |s|
|
|
|
15
15
|
s.source = { :git => "https://github.com/sency-ai/smkit-ui-react-native-demo.git", :tag => "#{s.version}" }
|
|
16
16
|
|
|
17
17
|
s.source_files = "ios/**/*.{h,m,mm,swift}"
|
|
18
|
-
s.dependency "SMKitUI" ,'0.2.
|
|
18
|
+
s.dependency "SMKitUI" ,'0.2.6'
|
|
19
19
|
|
|
20
20
|
# Use install_modules_dependencies helper to install the dependencies if React Native version >=0.71.0.
|
|
21
21
|
# See https://github.com/facebook/react-native/blob/febf6b7f33fdb4904669f99d795eba4c0f95d7bf/scripts/cocoapods/new_architecture.rb#L79.
|