@sency/react-native-smkit-ui 2.2.1 → 2.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/README.md +218 -65
- package/android/build.gradle +3 -1
- package/android/src/main/java/com/smkituilibrary/SmkitUiLibraryModule.kt +237 -3
- package/android/src/main/java/com/smkituilibrary/mapper/SMMapper.kt +70 -10
- package/android/src/main/java/com/smkituilibrary/model/SMKitExercise.kt +40 -0
- package/android/src/main/java/com/smkituilibrary/model/SMKitWorkout.kt +8 -0
- package/android/src/main/java/com/smkituilibrary/model/SMKitWorkoutConfig.kt +2 -0
- package/android/src/main/java/com/smkituilibrary/model/SMUserData.kt +5 -1
- package/ios/SMKitUIManager.mm +33 -11
- package/ios/SMKitUIManager.swift +237 -36
- package/lib/commonjs/SMWorkout.js +239 -177
- package/lib/commonjs/SMWorkout.js.map +1 -1
- package/lib/commonjs/index.js +187 -5
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/SMWorkout.js +232 -181
- package/lib/module/SMWorkout.js.map +1 -1
- package/lib/module/index.js +165 -5
- package/lib/module/index.js.map +1 -1
- package/package.json +2 -2
- package/react-native-smkit-ui.podspec +2 -2
- package/src/SMWorkout.tsx +353 -176
- package/src/index.tsx +167 -8
- package/android/build/intermediates/compile_r_class_jar/debug/generateDebugRFile/R.jar +0 -0
- package/android/build/intermediates/compile_symbol_list/debug/generateDebugRFile/R.txt +0 -0
- package/android/build/intermediates/incremental/debug/packageDebugResources/compile-file-map.properties +0 -1
- package/android/build/intermediates/incremental/debug/packageDebugResources/merger.xml +0 -2
- package/android/build/intermediates/incremental/mergeDebugJniLibFolders/merger.xml +0 -2
- package/android/build/intermediates/local_only_symbol_list/debug/parseDebugLocalResources/R-def.txt +0 -2
- package/android/build/intermediates/nested_resources_validation_report/debug/generateDebugResources/nestedResourcesValidationReport.txt +0 -1
- package/android/build/intermediates/symbol_list_with_package_name/debug/generateDebugRFile/package-aware-r.txt +0 -1
package/src/index.tsx
CHANGED
|
@@ -134,8 +134,8 @@ export function startWorkoutProgram(
|
|
|
134
134
|
* Sets a text language for the current workout session
|
|
135
135
|
* @param {SMWorkoutLibrary} language - The language that you would like to set.
|
|
136
136
|
*/
|
|
137
|
-
export function setSessionLanguage(language: SMWorkoutLibrary.Language) {
|
|
138
|
-
SMKitUIManager.setSessionLanguage(language);
|
|
137
|
+
export function setSessionLanguage(language: SMWorkoutLibrary.Language): Promise<void> {
|
|
138
|
+
return SMKitUIManager.setSessionLanguage(language);
|
|
139
139
|
}
|
|
140
140
|
|
|
141
141
|
/**
|
|
@@ -153,8 +153,8 @@ export function setPhoneCalibrationLanguage(language: SMWorkoutLibrary.Language)
|
|
|
153
153
|
*/
|
|
154
154
|
export function setEndExercisePreferences(
|
|
155
155
|
endExercisePreferences: SMWorkoutLibrary.EndExercisePreferences
|
|
156
|
-
) {
|
|
157
|
-
SMKitUIManager.setEndExercisePreferences(endExercisePreferences);
|
|
156
|
+
): Promise<void> {
|
|
157
|
+
return SMKitUIManager.setEndExercisePreferences(endExercisePreferences);
|
|
158
158
|
}
|
|
159
159
|
|
|
160
160
|
/**
|
|
@@ -163,8 +163,8 @@ export function setEndExercisePreferences(
|
|
|
163
163
|
*/
|
|
164
164
|
export function setCounterPreferences(
|
|
165
165
|
counterPreferences: SMWorkoutLibrary.CounterPreferences
|
|
166
|
-
) {
|
|
167
|
-
SMKitUIManager.setCounterPreferences(counterPreferences);
|
|
166
|
+
): Promise<void> {
|
|
167
|
+
return SMKitUIManager.setCounterPreferences(counterPreferences);
|
|
168
168
|
}
|
|
169
169
|
|
|
170
170
|
/**
|
|
@@ -210,7 +210,8 @@ export function setPauseTypes(types: SMWorkoutLibrary.PauseType[]): Promise<void
|
|
|
210
210
|
}
|
|
211
211
|
|
|
212
212
|
/**
|
|
213
|
-
* Allows the SDK audio to mix with external app audio
|
|
213
|
+
* Allows the SDK audio to mix with external app audio.
|
|
214
|
+
* Android support depends on the native SMKit UI version and resolves as a no-op when unavailable.
|
|
214
215
|
* @param {boolean} enabled
|
|
215
216
|
*/
|
|
216
217
|
export function setAllowAudioMixing(enabled: boolean): Promise<void> {
|
|
@@ -218,7 +219,8 @@ export function setAllowAudioMixing(enabled: boolean): Promise<void> {
|
|
|
218
219
|
}
|
|
219
220
|
|
|
220
221
|
/**
|
|
221
|
-
* Shows an in-session button to switch audio source
|
|
222
|
+
* Shows an in-session button to switch audio source.
|
|
223
|
+
* Android support depends on the native SMKit UI version and resolves as a no-op when unavailable.
|
|
222
224
|
* @param {boolean} enabled
|
|
223
225
|
*/
|
|
224
226
|
export function setShowExternalAudioControl(enabled: boolean): Promise<void> {
|
|
@@ -233,3 +235,160 @@ export function setAccuratePoseEstimation(enabled: boolean): Promise<void> {
|
|
|
233
235
|
return SMKitUIManager.setAccuratePoseEstimation(enabled);
|
|
234
236
|
}
|
|
235
237
|
|
|
238
|
+
/**
|
|
239
|
+
* Sets the SDK color theme for gauge, counters, skeleton accents, and related UI.
|
|
240
|
+
*/
|
|
241
|
+
export function setColorTheme(theme: SMWorkoutLibrary.ColorTheme | string): Promise<void> {
|
|
242
|
+
return SMKitUIManager.setColorTheme(theme);
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
/**
|
|
246
|
+
* Plays phone calibration instructions when phone calibration is shown.
|
|
247
|
+
*/
|
|
248
|
+
export function setPlayPhoneCalibrationAudio(enabled: boolean): Promise<void> {
|
|
249
|
+
return SMKitUIManager.setPlayPhoneCalibrationAudio(enabled);
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
/**
|
|
253
|
+
* Plays body calibration local assets during body calibration.
|
|
254
|
+
*/
|
|
255
|
+
export function setPlayBodyCalibrationAudio(enabled: boolean): Promise<void> {
|
|
256
|
+
return SMKitUIManager.setPlayBodyCalibrationAudio(enabled);
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
/**
|
|
260
|
+
* Controls whether exercise timers wait for first activity before starting.
|
|
261
|
+
*/
|
|
262
|
+
export function setStartTimerOnFirstActivity(enabled: boolean): Promise<void> {
|
|
263
|
+
return SMKitUIManager.setStartTimerOnFirstActivity(enabled);
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
/**
|
|
267
|
+
* Sets the continuation prompt countdown duration in seconds.
|
|
268
|
+
*/
|
|
269
|
+
export function setWorkoutContinuationTimerDuration(seconds: number): Promise<void> {
|
|
270
|
+
return SMKitUIManager.setWorkoutContinuationTimerDuration(seconds);
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
/**
|
|
274
|
+
* Blocks rep counting and in-position updates while phone movement is detected.
|
|
275
|
+
*/
|
|
276
|
+
export function setPhoneMovementCountPreventionEnabled(enabled: boolean): Promise<void> {
|
|
277
|
+
return SMKitUIManager.setPhoneMovementCountPreventionEnabled(enabled);
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
/**
|
|
281
|
+
* Plays variation mismatch feedback for supported hold/dynamic exercise mismatches.
|
|
282
|
+
*/
|
|
283
|
+
export function setVariationMismatchFeedbackEnabled(enabled: boolean): Promise<void> {
|
|
284
|
+
return SMKitUIManager.setVariationMismatchFeedbackEnabled(enabled);
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
/**
|
|
288
|
+
* Uses the native SDK's default guidance mode for supported exercises when per-exercise guidanceMode is not set.
|
|
289
|
+
*/
|
|
290
|
+
export function setUseDefaultGuidanceMode(enabled: boolean): Promise<void> {
|
|
291
|
+
return SMKitUIManager.setUseDefaultGuidanceMode(enabled);
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
/**
|
|
295
|
+
* Enables native guidance debug logging where supported.
|
|
296
|
+
*/
|
|
297
|
+
export function setGuidanceDebugLogging(enabled: boolean): Promise<void> {
|
|
298
|
+
return SMKitUIManager.setGuidanceDebugLogging(enabled);
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
/**
|
|
302
|
+
* Shows a one-time hover/button tutorial overlay after calibration.
|
|
303
|
+
*/
|
|
304
|
+
export function setEnableButtonTutorial(enabled: boolean): Promise<void> {
|
|
305
|
+
return SMKitUIManager.setEnableButtonTutorial(enabled);
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
/**
|
|
309
|
+
* Sets an optional local/remote audio URI for button tutorial completion.
|
|
310
|
+
*/
|
|
311
|
+
export function setButtonTutorialCompletionAudioUri(uri: string | null): Promise<void> {
|
|
312
|
+
return SMKitUIManager.setButtonTutorialCompletionAudioUri(uri);
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
/**
|
|
316
|
+
* iOS-only: controls whether rowing workouts show phone calibration.
|
|
317
|
+
* Android resolves as a no-op for API parity.
|
|
318
|
+
*/
|
|
319
|
+
export function setShowRowingPhoneCalibration(enabled: boolean): Promise<void> {
|
|
320
|
+
return SMKitUIManager.setShowRowingPhoneCalibration(enabled);
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
/**
|
|
324
|
+
* Excludes feedback types from UI display only. Values must be native feedback enum raw names.
|
|
325
|
+
*/
|
|
326
|
+
export function setFeedbacksUIToExclude(feedbacksToExclude: string[]): Promise<void> {
|
|
327
|
+
return SMKitUIManager.setFeedbacksUIToExclude(JSON.stringify(feedbacksToExclude));
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
/**
|
|
331
|
+
* Excludes feedback types from data and UI when supported. Unsupported platforms resolve as a no-op.
|
|
332
|
+
*/
|
|
333
|
+
export function setExcludedFeedbacks(excludedFeedbacks: string[]): Promise<void> {
|
|
334
|
+
return SMKitUIManager.setExcludedFeedbacks(JSON.stringify(excludedFeedbacks));
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
/**
|
|
338
|
+
* Android-only: sets the flat native config string. iOS resolves as a no-op for API parity.
|
|
339
|
+
*/
|
|
340
|
+
export function setConfigString(configString: string | null): Promise<void> {
|
|
341
|
+
return SMKitUIManager.setConfigString(configString);
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
/**
|
|
345
|
+
* Clears the SDK adaptive ROM cache where supported.
|
|
346
|
+
*/
|
|
347
|
+
export function clearAdaptiveRomCache(): Promise<void> {
|
|
348
|
+
return SMKitUIManager.clearAdaptiveRomCache();
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
/**
|
|
352
|
+
* Quits the active workout where supported.
|
|
353
|
+
*/
|
|
354
|
+
export function quitWorkout(): Promise<void> {
|
|
355
|
+
return SMKitUIManager.quitWorkout();
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
/**
|
|
359
|
+
* iOS-only: pauses the active SDK workout. Android resolves as a no-op for API parity.
|
|
360
|
+
*/
|
|
361
|
+
export function pauseSDK(): Promise<void> {
|
|
362
|
+
return SMKitUIManager.pauseSDK();
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
/**
|
|
366
|
+
* iOS-only: resumes a paused SDK workout. Android resolves as a no-op for API parity.
|
|
367
|
+
*/
|
|
368
|
+
export function resumeSDK(): Promise<void> {
|
|
369
|
+
return SMKitUIManager.resumeSDK();
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
/**
|
|
373
|
+
* iOS-only in current native SDKs: returns supported movement detector names.
|
|
374
|
+
* Android resolves with an empty array for API parity.
|
|
375
|
+
*/
|
|
376
|
+
export function getSupportedMovements(): Promise<string[]> {
|
|
377
|
+
return SMKitUIManager.getSupportedMovements();
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
/**
|
|
381
|
+
* iOS-only in current native SDKs: returns the native exercise type name for a detector.
|
|
382
|
+
* Android resolves with an empty string for API parity.
|
|
383
|
+
*/
|
|
384
|
+
export function getExerciseType(detector: string): Promise<string> {
|
|
385
|
+
return SMKitUIManager.getExerciseType(detector);
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
/**
|
|
389
|
+
* Android-only: chooses the pose model used during configure.
|
|
390
|
+
* Call before configure for it to affect the current native SDK instance.
|
|
391
|
+
*/
|
|
392
|
+
export function setPoseModelChoice(choice: SMWorkoutLibrary.PoseModelChoice): Promise<void> {
|
|
393
|
+
return SMKitUIManager.setPoseModelChoice(choice);
|
|
394
|
+
}
|
|
Binary file
|
|
File without changes
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
#Tue Mar 17 23:21:45 IST 2026
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
-
<merger version="3"><dataSet aapt-namespace="http://schemas.android.com/apk/res-auto" config="main$Generated" generated="true" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/offryhayon/PycharmProjects/smkit_ui_library/react-native-smkit-ui/android/src/main/res"/></dataSet><dataSet aapt-namespace="http://schemas.android.com/apk/res-auto" config="main" generated-set="main$Generated" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/offryhayon/PycharmProjects/smkit_ui_library/react-native-smkit-ui/android/src/main/res"/></dataSet><dataSet aapt-namespace="http://schemas.android.com/apk/res-auto" config="debug$Generated" generated="true" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/offryhayon/PycharmProjects/smkit_ui_library/react-native-smkit-ui/android/src/debug/res"/></dataSet><dataSet aapt-namespace="http://schemas.android.com/apk/res-auto" config="debug" generated-set="debug$Generated" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/offryhayon/PycharmProjects/smkit_ui_library/react-native-smkit-ui/android/src/debug/res"/></dataSet><dataSet aapt-namespace="http://schemas.android.com/apk/res-auto" config="generated$Generated" generated="true" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/offryhayon/PycharmProjects/smkit_ui_library/react-native-smkit-ui/android/build/generated/res/resValues/debug"/></dataSet><dataSet aapt-namespace="http://schemas.android.com/apk/res-auto" config="generated" generated-set="generated$Generated" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/offryhayon/PycharmProjects/smkit_ui_library/react-native-smkit-ui/android/build/generated/res/resValues/debug"/></dataSet><mergedItems/></merger>
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
-
<merger version="3"><dataSet config="main" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/offryhayon/PycharmProjects/smkit_ui_library/react-native-smkit-ui/android/src/main/jniLibs"/></dataSet><dataSet config="debug" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/offryhayon/PycharmProjects/smkit_ui_library/react-native-smkit-ui/android/src/debug/jniLibs"/></dataSet></merger>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
0 Warning/Error
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
com.smkituilibrary
|