@focus8/settings-registry 0.7.0 → 0.8.1
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/dist/index.d.ts +49 -22
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +152 -30
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +193 -46
package/dist/index.d.ts
CHANGED
|
@@ -152,6 +152,10 @@ export type SettingDef<T = unknown> = {
|
|
|
152
152
|
options?: readonly SettingOption<T>[];
|
|
153
153
|
/** Slider configuration for SLIDER-type settings */
|
|
154
154
|
sliderConfig?: SliderConfig;
|
|
155
|
+
/** Only show this setting for enrolled/kiosk devices (undefined = always) */
|
|
156
|
+
appMode?: 'ENROLLED';
|
|
157
|
+
/** Only show this setting for a specific calendar type (undefined = always) */
|
|
158
|
+
calendarType?: CalendarType;
|
|
155
159
|
};
|
|
156
160
|
export type RegistryConfig = {
|
|
157
161
|
/** Whether the device is in enrolled/kiosk mode */
|
|
@@ -180,10 +184,10 @@ declare function buildEntries(config: RegistryConfig): {
|
|
|
180
184
|
readonly 'calendarView.showWeatherOnTimeline': SettingDef<boolean>;
|
|
181
185
|
readonly 'calendarView.weatherLocation': SettingDef<WeatherLocation | null>;
|
|
182
186
|
readonly 'eventForm.recurrence': SettingDef<boolean>;
|
|
183
|
-
readonly 'eventForm.reminders': SettingDef<boolean>;
|
|
184
|
-
readonly 'eventForm.emailReminders': SettingDef<boolean>;
|
|
185
187
|
readonly 'eventForm.location': SettingDef<boolean>;
|
|
186
188
|
readonly 'eventForm.travelTime': SettingDef<boolean>;
|
|
189
|
+
readonly 'eventForm.reminders': SettingDef<boolean>;
|
|
190
|
+
readonly 'eventForm.emailReminders': SettingDef<boolean>;
|
|
187
191
|
readonly 'eventForm.description': SettingDef<boolean>;
|
|
188
192
|
readonly 'eventForm.checklist': SettingDef<boolean>;
|
|
189
193
|
readonly 'eventForm.images': SettingDef<boolean>;
|
|
@@ -205,16 +209,16 @@ declare function buildEntries(config: RegistryConfig): {
|
|
|
205
209
|
readonly 'timer.showEndTime': SettingDef<boolean>;
|
|
206
210
|
readonly 'timer.showRestartButton': SettingDef<boolean>;
|
|
207
211
|
readonly 'timer.showPauseButton': SettingDef<boolean>;
|
|
208
|
-
readonly 'lockScreen.pin': SettingDef<string>;
|
|
209
212
|
readonly 'lockScreen.inactivityLockEnabled': SettingDef<boolean>;
|
|
210
213
|
readonly 'lockScreen.inactivityTimeoutMinutes': SettingDef<InactivityTimeoutMinutes>;
|
|
214
|
+
readonly 'lockScreen.pin': SettingDef<string>;
|
|
211
215
|
readonly 'lockScreen.clockDisplay': SettingDef<LockScreenClockDisplay>;
|
|
212
|
-
readonly 'lockScreen.showDate': SettingDef<boolean>;
|
|
213
216
|
readonly 'lockScreen.showHourNumbers': SettingDef<boolean>;
|
|
217
|
+
readonly 'lockScreen.showDate': SettingDef<boolean>;
|
|
214
218
|
readonly 'lockScreen.imageMode': SettingDef<LockScreenImageMode>;
|
|
215
219
|
readonly 'lockScreen.backgroundImage': SettingDef<string | null>;
|
|
216
|
-
readonly 'lockScreen.photoFrameImages': SettingDef<LockScreenImage[]>;
|
|
217
220
|
readonly 'lockScreen.photoFrameIntervalSeconds': SettingDef<PhotoFrameIntervalSeconds>;
|
|
221
|
+
readonly 'lockScreen.photoFrameImages': SettingDef<LockScreenImage[]>;
|
|
218
222
|
readonly 'touch.enableTapToCreate': SettingDef<boolean>;
|
|
219
223
|
readonly 'touch.enableDragDrop': SettingDef<boolean>;
|
|
220
224
|
readonly 'device.id': SettingDef<string>;
|
|
@@ -227,8 +231,8 @@ declare function buildEntries(config: RegistryConfig): {
|
|
|
227
231
|
readonly 'notification.enabledCalendarIds': SettingDef<string[]>;
|
|
228
232
|
readonly 'notification.hasBeenPrompted': SettingDef<boolean>;
|
|
229
233
|
readonly 'chronological.header.showNavigationArrows': SettingDef<boolean>;
|
|
230
|
-
readonly 'chronological.header.showClock': SettingDef<boolean>;
|
|
231
234
|
readonly 'chronological.header.showCurrentYearInDate': SettingDef<boolean>;
|
|
235
|
+
readonly 'chronological.header.showClock': SettingDef<boolean>;
|
|
232
236
|
readonly 'chronological.header.showTimeOfDay': SettingDef<boolean>;
|
|
233
237
|
readonly 'chronological.footer.showMenuButton': SettingDef<boolean>;
|
|
234
238
|
readonly 'chronological.footer.showViewSwitcherDay': SettingDef<boolean>;
|
|
@@ -236,12 +240,13 @@ declare function buildEntries(config: RegistryConfig): {
|
|
|
236
240
|
readonly 'chronological.footer.showViewSwitcherMonth': SettingDef<boolean>;
|
|
237
241
|
readonly 'chronological.footer.showTimerButton': SettingDef<boolean>;
|
|
238
242
|
readonly 'chronological.footer.showNewEventButton': SettingDef<boolean>;
|
|
243
|
+
readonly 'chronological.footer.showNowButton': SettingDef<boolean>;
|
|
239
244
|
readonly 'chronological.footer.showSettingsButton': SettingDef<boolean>;
|
|
240
245
|
readonly 'chronological.timer.showNewCountdown': SettingDef<boolean>;
|
|
241
246
|
readonly 'chronological.timer.showFromTemplate': SettingDef<boolean>;
|
|
247
|
+
readonly 'chronological.timer.showAddTemplate': SettingDef<boolean>;
|
|
242
248
|
readonly 'chronological.timer.showEditTemplate': SettingDef<boolean>;
|
|
243
249
|
readonly 'chronological.timer.showDeleteTemplate': SettingDef<boolean>;
|
|
244
|
-
readonly 'chronological.timer.showAddTemplate': SettingDef<boolean>;
|
|
245
250
|
readonly 'chronological.menu.showSettingsButton': SettingDef<boolean>;
|
|
246
251
|
readonly 'chronological.quickSettings.showTimerVolume': SettingDef<boolean>;
|
|
247
252
|
readonly 'chronological.quickSettings.showReminderVolume': SettingDef<boolean>;
|
|
@@ -253,16 +258,16 @@ declare function buildEntries(config: RegistryConfig): {
|
|
|
253
258
|
readonly 'chronological.timeOfDay.afternoonStart': SettingDef<number>;
|
|
254
259
|
readonly 'chronological.timeOfDay.eveningStart': SettingDef<number>;
|
|
255
260
|
readonly 'chronological.timeOfDay.nightStart': SettingDef<number>;
|
|
261
|
+
readonly 'chronologicalEventForm.fixedField.allDay': SettingDef<boolean>;
|
|
262
|
+
readonly 'chronologicalEventForm.fixedField.endTime': SettingDef<boolean>;
|
|
263
|
+
readonly 'chronologicalEventForm.fixedField.visibility': SettingDef<boolean>;
|
|
264
|
+
readonly 'chronologicalEventForm.field.acknowledge': SettingDef<boolean>;
|
|
256
265
|
readonly 'chronologicalEventForm.field.description': SettingDef<boolean>;
|
|
257
266
|
readonly 'chronologicalEventForm.field.recurrence': SettingDef<boolean>;
|
|
258
|
-
readonly 'chronologicalEventForm.field.acknowledge': SettingDef<boolean>;
|
|
259
267
|
readonly 'chronologicalEventForm.field.checklist': SettingDef<boolean>;
|
|
260
268
|
readonly 'chronologicalEventForm.field.extraImages': SettingDef<boolean>;
|
|
261
269
|
readonly 'chronologicalEventForm.field.reminders': SettingDef<boolean>;
|
|
262
270
|
readonly 'chronologicalEventForm.field.audioClips': SettingDef<boolean>;
|
|
263
|
-
readonly 'chronologicalEventForm.fixedField.allDay': SettingDef<boolean>;
|
|
264
|
-
readonly 'chronologicalEventForm.fixedField.endTime': SettingDef<boolean>;
|
|
265
|
-
readonly 'chronologicalEventForm.fixedField.visibility': SettingDef<boolean>;
|
|
266
271
|
readonly 'chronologicalEventForm.suggestEndTime.enabled': SettingDef<boolean>;
|
|
267
272
|
readonly 'chronologicalEventForm.suggestEndTime.value': SettingDef<number>;
|
|
268
273
|
readonly 'chronologicalEventForm.suggestEndTime.unit': SettingDef<SuggestEndTimeUnit>;
|
|
@@ -330,6 +335,10 @@ export type ParsedSettingEntry = {
|
|
|
330
335
|
options?: readonly SettingOption[];
|
|
331
336
|
/** Slider configuration for SLIDER-type settings */
|
|
332
337
|
sliderConfig?: SliderConfig;
|
|
338
|
+
/** Only show this setting for enrolled/kiosk devices (undefined = always) */
|
|
339
|
+
appMode?: 'ENROLLED';
|
|
340
|
+
/** Only show this setting for a specific calendar type (undefined = always) */
|
|
341
|
+
calendarType?: CalendarType;
|
|
333
342
|
};
|
|
334
343
|
export type ParsedSettingsGroup = {
|
|
335
344
|
/** The category key */
|
|
@@ -354,6 +363,23 @@ export declare function parseSettingsSnapshot(json: string | Record<string, unkn
|
|
|
354
363
|
* Handles booleans, numbers, strings, arrays, objects, and null/undefined.
|
|
355
364
|
*/
|
|
356
365
|
export declare function formatSettingValue(value: unknown): string;
|
|
366
|
+
/**
|
|
367
|
+
* Serialize a settings object (with mixed native types) into a
|
|
368
|
+
* string-values-only snapshot suitable for pushing to a mobile device.
|
|
369
|
+
*
|
|
370
|
+
* Uses the registry's `serialize()` method for known keys so that
|
|
371
|
+
* booleans become "true"/"false", numbers become digit strings, etc.
|
|
372
|
+
* Unknown keys are converted with `String(value)`.
|
|
373
|
+
*/
|
|
374
|
+
export declare function serializeSettingsSnapshot(settings: Record<string, unknown>, registry: SettingsRegistry): Record<string, string>;
|
|
375
|
+
/**
|
|
376
|
+
* Deserialize a settings snapshot (string values from the server/DB) into
|
|
377
|
+
* native-typed values using the registry.
|
|
378
|
+
*
|
|
379
|
+
* This ensures local state always contains native types (boolean, number, etc.)
|
|
380
|
+
* so that subsequent `serializeSettingsSnapshot` calls produce correct results.
|
|
381
|
+
*/
|
|
382
|
+
export declare function deserializeSettingsSnapshot(snapshot: Record<string, unknown>, registry?: SettingsRegistry): Record<string, unknown>;
|
|
357
383
|
export declare const defaultRegistry: SettingsRegistry;
|
|
358
384
|
export declare function createSettingsRegistry(config?: Partial<RegistryConfig>): {
|
|
359
385
|
readonly 'appearance.theme': SettingDef<ThemeSetting>;
|
|
@@ -372,10 +398,10 @@ export declare function createSettingsRegistry(config?: Partial<RegistryConfig>)
|
|
|
372
398
|
readonly 'calendarView.showWeatherOnTimeline': SettingDef<boolean>;
|
|
373
399
|
readonly 'calendarView.weatherLocation': SettingDef<WeatherLocation | null>;
|
|
374
400
|
readonly 'eventForm.recurrence': SettingDef<boolean>;
|
|
375
|
-
readonly 'eventForm.reminders': SettingDef<boolean>;
|
|
376
|
-
readonly 'eventForm.emailReminders': SettingDef<boolean>;
|
|
377
401
|
readonly 'eventForm.location': SettingDef<boolean>;
|
|
378
402
|
readonly 'eventForm.travelTime': SettingDef<boolean>;
|
|
403
|
+
readonly 'eventForm.reminders': SettingDef<boolean>;
|
|
404
|
+
readonly 'eventForm.emailReminders': SettingDef<boolean>;
|
|
379
405
|
readonly 'eventForm.description': SettingDef<boolean>;
|
|
380
406
|
readonly 'eventForm.checklist': SettingDef<boolean>;
|
|
381
407
|
readonly 'eventForm.images': SettingDef<boolean>;
|
|
@@ -397,16 +423,16 @@ export declare function createSettingsRegistry(config?: Partial<RegistryConfig>)
|
|
|
397
423
|
readonly 'timer.showEndTime': SettingDef<boolean>;
|
|
398
424
|
readonly 'timer.showRestartButton': SettingDef<boolean>;
|
|
399
425
|
readonly 'timer.showPauseButton': SettingDef<boolean>;
|
|
400
|
-
readonly 'lockScreen.pin': SettingDef<string>;
|
|
401
426
|
readonly 'lockScreen.inactivityLockEnabled': SettingDef<boolean>;
|
|
402
427
|
readonly 'lockScreen.inactivityTimeoutMinutes': SettingDef<InactivityTimeoutMinutes>;
|
|
428
|
+
readonly 'lockScreen.pin': SettingDef<string>;
|
|
403
429
|
readonly 'lockScreen.clockDisplay': SettingDef<LockScreenClockDisplay>;
|
|
404
|
-
readonly 'lockScreen.showDate': SettingDef<boolean>;
|
|
405
430
|
readonly 'lockScreen.showHourNumbers': SettingDef<boolean>;
|
|
431
|
+
readonly 'lockScreen.showDate': SettingDef<boolean>;
|
|
406
432
|
readonly 'lockScreen.imageMode': SettingDef<LockScreenImageMode>;
|
|
407
433
|
readonly 'lockScreen.backgroundImage': SettingDef<string | null>;
|
|
408
|
-
readonly 'lockScreen.photoFrameImages': SettingDef<LockScreenImage[]>;
|
|
409
434
|
readonly 'lockScreen.photoFrameIntervalSeconds': SettingDef<PhotoFrameIntervalSeconds>;
|
|
435
|
+
readonly 'lockScreen.photoFrameImages': SettingDef<LockScreenImage[]>;
|
|
410
436
|
readonly 'touch.enableTapToCreate': SettingDef<boolean>;
|
|
411
437
|
readonly 'touch.enableDragDrop': SettingDef<boolean>;
|
|
412
438
|
readonly 'device.id': SettingDef<string>;
|
|
@@ -419,8 +445,8 @@ export declare function createSettingsRegistry(config?: Partial<RegistryConfig>)
|
|
|
419
445
|
readonly 'notification.enabledCalendarIds': SettingDef<string[]>;
|
|
420
446
|
readonly 'notification.hasBeenPrompted': SettingDef<boolean>;
|
|
421
447
|
readonly 'chronological.header.showNavigationArrows': SettingDef<boolean>;
|
|
422
|
-
readonly 'chronological.header.showClock': SettingDef<boolean>;
|
|
423
448
|
readonly 'chronological.header.showCurrentYearInDate': SettingDef<boolean>;
|
|
449
|
+
readonly 'chronological.header.showClock': SettingDef<boolean>;
|
|
424
450
|
readonly 'chronological.header.showTimeOfDay': SettingDef<boolean>;
|
|
425
451
|
readonly 'chronological.footer.showMenuButton': SettingDef<boolean>;
|
|
426
452
|
readonly 'chronological.footer.showViewSwitcherDay': SettingDef<boolean>;
|
|
@@ -428,12 +454,13 @@ export declare function createSettingsRegistry(config?: Partial<RegistryConfig>)
|
|
|
428
454
|
readonly 'chronological.footer.showViewSwitcherMonth': SettingDef<boolean>;
|
|
429
455
|
readonly 'chronological.footer.showTimerButton': SettingDef<boolean>;
|
|
430
456
|
readonly 'chronological.footer.showNewEventButton': SettingDef<boolean>;
|
|
457
|
+
readonly 'chronological.footer.showNowButton': SettingDef<boolean>;
|
|
431
458
|
readonly 'chronological.footer.showSettingsButton': SettingDef<boolean>;
|
|
432
459
|
readonly 'chronological.timer.showNewCountdown': SettingDef<boolean>;
|
|
433
460
|
readonly 'chronological.timer.showFromTemplate': SettingDef<boolean>;
|
|
461
|
+
readonly 'chronological.timer.showAddTemplate': SettingDef<boolean>;
|
|
434
462
|
readonly 'chronological.timer.showEditTemplate': SettingDef<boolean>;
|
|
435
463
|
readonly 'chronological.timer.showDeleteTemplate': SettingDef<boolean>;
|
|
436
|
-
readonly 'chronological.timer.showAddTemplate': SettingDef<boolean>;
|
|
437
464
|
readonly 'chronological.menu.showSettingsButton': SettingDef<boolean>;
|
|
438
465
|
readonly 'chronological.quickSettings.showTimerVolume': SettingDef<boolean>;
|
|
439
466
|
readonly 'chronological.quickSettings.showReminderVolume': SettingDef<boolean>;
|
|
@@ -445,16 +472,16 @@ export declare function createSettingsRegistry(config?: Partial<RegistryConfig>)
|
|
|
445
472
|
readonly 'chronological.timeOfDay.afternoonStart': SettingDef<number>;
|
|
446
473
|
readonly 'chronological.timeOfDay.eveningStart': SettingDef<number>;
|
|
447
474
|
readonly 'chronological.timeOfDay.nightStart': SettingDef<number>;
|
|
475
|
+
readonly 'chronologicalEventForm.fixedField.allDay': SettingDef<boolean>;
|
|
476
|
+
readonly 'chronologicalEventForm.fixedField.endTime': SettingDef<boolean>;
|
|
477
|
+
readonly 'chronologicalEventForm.fixedField.visibility': SettingDef<boolean>;
|
|
478
|
+
readonly 'chronologicalEventForm.field.acknowledge': SettingDef<boolean>;
|
|
448
479
|
readonly 'chronologicalEventForm.field.description': SettingDef<boolean>;
|
|
449
480
|
readonly 'chronologicalEventForm.field.recurrence': SettingDef<boolean>;
|
|
450
|
-
readonly 'chronologicalEventForm.field.acknowledge': SettingDef<boolean>;
|
|
451
481
|
readonly 'chronologicalEventForm.field.checklist': SettingDef<boolean>;
|
|
452
482
|
readonly 'chronologicalEventForm.field.extraImages': SettingDef<boolean>;
|
|
453
483
|
readonly 'chronologicalEventForm.field.reminders': SettingDef<boolean>;
|
|
454
484
|
readonly 'chronologicalEventForm.field.audioClips': SettingDef<boolean>;
|
|
455
|
-
readonly 'chronologicalEventForm.fixedField.allDay': SettingDef<boolean>;
|
|
456
|
-
readonly 'chronologicalEventForm.fixedField.endTime': SettingDef<boolean>;
|
|
457
|
-
readonly 'chronologicalEventForm.fixedField.visibility': SettingDef<boolean>;
|
|
458
485
|
readonly 'chronologicalEventForm.suggestEndTime.enabled': SettingDef<boolean>;
|
|
459
486
|
readonly 'chronologicalEventForm.suggestEndTime.value': SettingDef<number>;
|
|
460
487
|
readonly 'chronologicalEventForm.suggestEndTime.unit': SettingDef<SuggestEndTimeUnit>;
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAMH,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,MAAM,GAAG,QAAQ,CAAC;AACvD,MAAM,MAAM,UAAU,GAClB,MAAM,GACN,QAAQ,GACR,QAAQ,GACR,QAAQ,GACR,QAAQ,GACR,QAAQ,GACR,QAAQ,GACR,QAAQ,GACR,QAAQ,GACR,QAAQ,CAAC;AACb,MAAM,MAAM,UAAU,GAAG,IAAI,GAAG,IAAI,CAAC;AAErC,MAAM,MAAM,YAAY,GAAG,eAAe,GAAG,YAAY,CAAC;AAC1D,MAAM,MAAM,SAAS,GAAG,SAAS,GAAG,QAAQ,CAAC;AAC7C,MAAM,MAAM,cAAc,GAAG,OAAO,GAAG,QAAQ,CAAC;AAChD,MAAM,MAAM,YAAY,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC;AAC9C,eAAO,MAAM,cAAc,EAAE,YAAY,EAAqB,CAAC;AAC/D,MAAM,MAAM,gBAAgB,GACxB,KAAK,GACL,QAAQ,GACR,QAAQ,GACR,QAAQ,GACR,MAAM,GACN,OAAO,GACP,UAAU,CAAC;AACf,MAAM,MAAM,uBAAuB,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;AACnD,MAAM,MAAM,wBAAwB,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;AACjE,MAAM,MAAM,sBAAsB,GAAG,MAAM,GAAG,SAAS,GAAG,QAAQ,CAAC;AACnE,MAAM,MAAM,mBAAmB,GAAG,MAAM,GAAG,YAAY,GAAG,YAAY,CAAC;AACvE,MAAM,MAAM,yBAAyB,GAAG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E,OAAO,CAAC,EACtC,YAAY,CAAC,EAAE,YAAY,EAC3B,QAAQ,GAAE,gBAAkC,GAC3C,mBAAmB,EAAE,CAgEvB;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAoBzD;AAED;;;;;;;GAOG;AACH,wBAAgB,yBAAyB,CACvC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACjC,QAAQ,EAAE,gBAAgB,GACzB,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAUxB;AAED;;;;;;GAMG;AACH,wBAAgB,2BAA2B,CACzC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACjC,QAAQ,GAAE,gBAAkC,GAC3C,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAUzB;AAMD,eAAO,MAAM,eAAe,kBAAyB,CAAC;AAQtD,wBAAgB,sBAAsB,CAAC,MAAM,GAAE,OAAO,CAAC,cAAc,CAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAE1E"}
|
package/dist/index.js
CHANGED
|
@@ -138,7 +138,7 @@ export const SETTINGS_GROUPS = [
|
|
|
138
138
|
id: 'calendarType',
|
|
139
139
|
labelKey: 'Settings.CalendarType',
|
|
140
140
|
icon: 'ArrowLeftRight',
|
|
141
|
-
keys: ['calendarView.type'
|
|
141
|
+
keys: ['calendarView.type'],
|
|
142
142
|
},
|
|
143
143
|
{
|
|
144
144
|
id: 'calendarView',
|
|
@@ -147,9 +147,9 @@ export const SETTINGS_GROUPS = [
|
|
|
147
147
|
keys: [
|
|
148
148
|
'calendarView.showCalendarNames',
|
|
149
149
|
'calendarView.splitView',
|
|
150
|
-
'calendarView.calendarColumns',
|
|
151
150
|
'calendarView.dayViewZoom',
|
|
152
151
|
'calendarView.weekViewZoom',
|
|
152
|
+
'calendarView.calendarColumns',
|
|
153
153
|
],
|
|
154
154
|
},
|
|
155
155
|
{
|
|
@@ -163,9 +163,9 @@ export const SETTINGS_GROUPS = [
|
|
|
163
163
|
labelKey: 'Settings.DateWeather',
|
|
164
164
|
icon: 'CloudSun',
|
|
165
165
|
keys: [
|
|
166
|
-
'calendarView.showWeatherOnEvents',
|
|
167
166
|
'calendarView.showWeatherOnTimeline',
|
|
168
167
|
'calendarView.weatherLocation',
|
|
168
|
+
'calendarView.showWeatherOnEvents',
|
|
169
169
|
],
|
|
170
170
|
},
|
|
171
171
|
{
|
|
@@ -175,13 +175,13 @@ export const SETTINGS_GROUPS = [
|
|
|
175
175
|
keys: [
|
|
176
176
|
'sound.reminderVolume',
|
|
177
177
|
'sound.mediaVolume',
|
|
178
|
-
'sound.alarmSound',
|
|
179
178
|
'sound.reminderAlarmSound',
|
|
180
179
|
'sound.reminderAlarmTimeout',
|
|
181
180
|
'sound.allowCustomReminderSounds',
|
|
181
|
+
'notification.',
|
|
182
182
|
'sound.ttsEnabled',
|
|
183
183
|
'sound.ttsRate',
|
|
184
|
-
'
|
|
184
|
+
'sound.alarmSound',
|
|
185
185
|
],
|
|
186
186
|
},
|
|
187
187
|
{
|
|
@@ -189,10 +189,11 @@ export const SETTINGS_GROUPS = [
|
|
|
189
189
|
labelKey: 'Settings.TimerTitle',
|
|
190
190
|
icon: 'Timer',
|
|
191
191
|
keys: [
|
|
192
|
-
'
|
|
192
|
+
'chronological.timer.',
|
|
193
|
+
'timer.',
|
|
193
194
|
'sound.timerAlarmSound',
|
|
194
195
|
'sound.timerAlarmTimeout',
|
|
195
|
-
'
|
|
196
|
+
'sound.timerVolume',
|
|
196
197
|
],
|
|
197
198
|
appMode: 'ENROLLED',
|
|
198
199
|
},
|
|
@@ -241,6 +242,9 @@ export const EXCLUDED_DEVICE_SETTINGS = new Set([
|
|
|
241
242
|
'device.id',
|
|
242
243
|
'device.devMenuEnabled',
|
|
243
244
|
'device.authWarningDismissTtlDays',
|
|
245
|
+
'notification.enabled',
|
|
246
|
+
'notification.notifyAllCalendars',
|
|
247
|
+
'notification.enabledCalendarIds',
|
|
244
248
|
'notification.hasBeenPrompted',
|
|
245
249
|
]);
|
|
246
250
|
/**
|
|
@@ -466,6 +470,31 @@ export const SETTINGS_LABELS = {
|
|
|
466
470
|
function matchesGroup(key, group) {
|
|
467
471
|
return group.keys.some((matcher) => key === matcher || (matcher.endsWith('.') && key.startsWith(matcher)));
|
|
468
472
|
}
|
|
473
|
+
/** Return the index of the first matching key pattern in the group, for sorting. */
|
|
474
|
+
function groupKeyIndex(key, keys) {
|
|
475
|
+
for (let i = 0; i < keys.length; i++) {
|
|
476
|
+
const matcher = keys[i];
|
|
477
|
+
if (key === matcher || (matcher.endsWith('.') && key.startsWith(matcher))) {
|
|
478
|
+
return i;
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
return keys.length;
|
|
482
|
+
}
|
|
483
|
+
/**
|
|
484
|
+
* Lazy-initialized map from setting key → declaration index in buildEntries.
|
|
485
|
+
* Used as a tiebreaker when multiple keys share the same prefix group index.
|
|
486
|
+
*/
|
|
487
|
+
let _registryKeyOrder;
|
|
488
|
+
function registryKeyOrder() {
|
|
489
|
+
if (!_registryKeyOrder) {
|
|
490
|
+
_registryKeyOrder = new Map();
|
|
491
|
+
const keys = Object.keys(buildEntries(DEFAULT_REGISTRY_CONFIG));
|
|
492
|
+
for (let i = 0; i < keys.length; i++) {
|
|
493
|
+
_registryKeyOrder.set(keys[i], i);
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
return _registryKeyOrder;
|
|
497
|
+
}
|
|
469
498
|
/**
|
|
470
499
|
* Group parsed setting entries into user-facing groups matching the mobile
|
|
471
500
|
* app's settings menu structure.
|
|
@@ -486,6 +515,14 @@ export function groupSettingsForDevice(allSettings, calendarType, appMode) {
|
|
|
486
515
|
if (!isChronological && s.key.startsWith('chronologicalEventForm.')) {
|
|
487
516
|
return false;
|
|
488
517
|
}
|
|
518
|
+
// Per-setting calendar type restriction
|
|
519
|
+
if (s.calendarType && s.calendarType !== calendarType) {
|
|
520
|
+
return false;
|
|
521
|
+
}
|
|
522
|
+
// Per-setting app mode restriction
|
|
523
|
+
if (s.appMode && s.appMode !== appMode) {
|
|
524
|
+
return false;
|
|
525
|
+
}
|
|
489
526
|
return true;
|
|
490
527
|
});
|
|
491
528
|
const claimed = new Set();
|
|
@@ -503,6 +540,17 @@ export function groupSettingsForDevice(allSettings, calendarType, appMode) {
|
|
|
503
540
|
if (matched.length === 0) {
|
|
504
541
|
continue;
|
|
505
542
|
}
|
|
543
|
+
// Sort matched settings by the order defined in group.keys,
|
|
544
|
+
// with registry declaration order as tiebreaker for prefix matches
|
|
545
|
+
const order = registryKeyOrder();
|
|
546
|
+
matched.sort((a, b) => {
|
|
547
|
+
const aIdx = groupKeyIndex(a.key, group.keys);
|
|
548
|
+
const bIdx = groupKeyIndex(b.key, group.keys);
|
|
549
|
+
if (aIdx !== bIdx) {
|
|
550
|
+
return aIdx - bIdx;
|
|
551
|
+
}
|
|
552
|
+
return (order.get(a.key) ?? Infinity) - (order.get(b.key) ?? Infinity);
|
|
553
|
+
});
|
|
506
554
|
for (const s of matched) {
|
|
507
555
|
claimed.add(s.key);
|
|
508
556
|
}
|
|
@@ -546,7 +594,7 @@ const ALARM_TIMEOUT_OPTIONS = [
|
|
|
546
594
|
const DAY_VIEW_ZOOM_OPTIONS = [
|
|
547
595
|
{ value: 15, labelKey: 'Settings.Option.DayViewZoom.15min' },
|
|
548
596
|
{ value: 30, labelKey: 'Settings.Option.DayViewZoom.30min' },
|
|
549
|
-
{ value: 60, labelKey: 'Settings.Option.DayViewZoom.
|
|
597
|
+
{ value: 60, labelKey: 'Settings.Option.DayViewZoom.1hour' },
|
|
550
598
|
];
|
|
551
599
|
const TIME_OF_DAY_SLIDER = { min: 0, max: 23, step: 1 };
|
|
552
600
|
// ---------------------------------------------------------------------------
|
|
@@ -566,6 +614,12 @@ function def(category, type, defaultValue, uiType, extra) {
|
|
|
566
614
|
if (extra?.sliderConfig) {
|
|
567
615
|
result.sliderConfig = extra.sliderConfig;
|
|
568
616
|
}
|
|
617
|
+
if (extra?.appMode) {
|
|
618
|
+
result.appMode = extra.appMode;
|
|
619
|
+
}
|
|
620
|
+
if (extra?.calendarType) {
|
|
621
|
+
result.calendarType = extra.calendarType;
|
|
622
|
+
}
|
|
569
623
|
return result;
|
|
570
624
|
}
|
|
571
625
|
// ---------------------------------------------------------------------------
|
|
@@ -588,8 +642,9 @@ function buildEntries(config) {
|
|
|
588
642
|
{ value: 'digital', labelKey: 'Settings.Option.ClockType.Digital' },
|
|
589
643
|
{ value: 'analog', labelKey: 'Settings.Option.ClockType.Analog' },
|
|
590
644
|
],
|
|
645
|
+
appMode: 'ENROLLED',
|
|
591
646
|
}),
|
|
592
|
-
'appearance.enableDayColors': def('appearance', 'boolean', false, 'TOGGLE'),
|
|
647
|
+
'appearance.enableDayColors': def('appearance', 'boolean', false, 'TOGGLE', { calendarType: 'chronological' }),
|
|
593
648
|
// ═══════════════════════════════════════════════════════════════════════
|
|
594
649
|
// Calendar view
|
|
595
650
|
// ═══════════════════════════════════════════════════════════════════════
|
|
@@ -631,8 +686,8 @@ function buildEntries(config) {
|
|
|
631
686
|
},
|
|
632
687
|
],
|
|
633
688
|
}),
|
|
634
|
-
'calendarView.dayViewZoom': def('calendarView', 'number', 60, 'SELECT', { options: DAY_VIEW_ZOOM_OPTIONS }),
|
|
635
|
-
'calendarView.weekViewZoom': def('calendarView', 'number', 60, 'SELECT', { options: DAY_VIEW_ZOOM_OPTIONS }),
|
|
689
|
+
'calendarView.dayViewZoom': def('calendarView', 'number', 60, 'SELECT', { options: DAY_VIEW_ZOOM_OPTIONS, calendarType: 'time-based' }),
|
|
690
|
+
'calendarView.weekViewZoom': def('calendarView', 'number', 60, 'SELECT', { options: DAY_VIEW_ZOOM_OPTIONS, calendarType: 'time-based' }),
|
|
636
691
|
'calendarView.splitView': def('calendarView', 'boolean', false, 'TOGGLE'),
|
|
637
692
|
'calendarView.showCalendarNames': def('calendarView', 'boolean', true, 'TOGGLE'),
|
|
638
693
|
'calendarView.calendarColumns': def('calendarView', 'json', [], 'CUSTOM_SPLIT_VIEW_CONFIG'),
|
|
@@ -645,10 +700,10 @@ function buildEntries(config) {
|
|
|
645
700
|
// Event form field visibility (time-based)
|
|
646
701
|
// ═══════════════════════════════════════════════════════════════════════
|
|
647
702
|
'eventForm.recurrence': def('eventForm', 'boolean', true, 'TOGGLE'),
|
|
648
|
-
'eventForm.reminders': def('eventForm', 'boolean', true, 'TOGGLE'),
|
|
649
|
-
'eventForm.emailReminders': def('eventForm', 'boolean', false, 'TOGGLE'),
|
|
650
703
|
'eventForm.location': def('eventForm', 'boolean', true, 'TOGGLE'),
|
|
651
704
|
'eventForm.travelTime': def('eventForm', 'boolean', false, 'TOGGLE'),
|
|
705
|
+
'eventForm.reminders': def('eventForm', 'boolean', true, 'TOGGLE'),
|
|
706
|
+
'eventForm.emailReminders': def('eventForm', 'boolean', false, 'TOGGLE'),
|
|
652
707
|
'eventForm.description': def('eventForm', 'boolean', true, 'TOGGLE'),
|
|
653
708
|
'eventForm.checklist': def('eventForm', 'boolean', true, 'TOGGLE'),
|
|
654
709
|
'eventForm.images': def('eventForm', 'boolean', false, 'TOGGLE'),
|
|
@@ -659,27 +714,26 @@ function buildEntries(config) {
|
|
|
659
714
|
// Sound & alerts
|
|
660
715
|
// ═══════════════════════════════════════════════════════════════════════
|
|
661
716
|
'sound.timerVolume': def('sound', 'number', 0.5, 'VOLUME_SLIDER'),
|
|
662
|
-
'sound.reminderVolume': def('sound', 'number', 0.5, 'VOLUME_SLIDER'),
|
|
663
|
-
'sound.mediaVolume': def('sound', 'number', 0.5, 'VOLUME_SLIDER'),
|
|
717
|
+
'sound.reminderVolume': def('sound', 'number', 0.5, 'VOLUME_SLIDER', { appMode: 'ENROLLED' }),
|
|
718
|
+
'sound.mediaVolume': def('sound', 'number', 0.5, 'VOLUME_SLIDER', { appMode: 'ENROLLED' }),
|
|
664
719
|
'sound.alarmSound': def('sound', 'string', 'alarm1', 'SELECT', { options: ALARM_SOUND_OPTIONS }),
|
|
665
720
|
'sound.reminderAlarmSound': def('sound', 'string', 'alarm1', 'SELECT', { options: ALARM_SOUND_OPTIONS }),
|
|
666
721
|
'sound.timerAlarmSound': def('sound', 'string', 'alarm1', 'SELECT', { options: ALARM_SOUND_OPTIONS }),
|
|
667
722
|
'sound.timerAlarmTimeout': def('sound', 'number', 3, 'SELECT', { options: ALARM_TIMEOUT_OPTIONS }),
|
|
668
723
|
'sound.reminderAlarmTimeout': def('sound', 'number', 3, 'SELECT', { options: ALARM_TIMEOUT_OPTIONS }),
|
|
669
724
|
'sound.allowCustomReminderSounds': def('sound', 'boolean', false, 'TOGGLE'),
|
|
670
|
-
'sound.ttsEnabled': def('sound', 'boolean', config.isEnrolled, 'TOGGLE'),
|
|
671
|
-
'sound.ttsRate': def('sound', 'number', 1.0, 'SLIDER', { sliderConfig: { min: 0.5, max: 2, step: 0.1 } }),
|
|
725
|
+
'sound.ttsEnabled': def('sound', 'boolean', config.isEnrolled, 'TOGGLE', { appMode: 'ENROLLED' }),
|
|
726
|
+
'sound.ttsRate': def('sound', 'number', 1.0, 'SLIDER', { sliderConfig: { min: 0.5, max: 2, step: 0.1 }, appMode: 'ENROLLED' }),
|
|
672
727
|
// ═══════════════════════════════════════════════════════════════════════
|
|
673
728
|
// Timer
|
|
674
729
|
// ═══════════════════════════════════════════════════════════════════════
|
|
675
730
|
'timer.showTimeRemaining': def('timer', 'boolean', true, 'TOGGLE'),
|
|
676
|
-
'timer.showEndTime': def('timer', 'boolean', true, 'TOGGLE'),
|
|
731
|
+
'timer.showEndTime': def('timer', 'boolean', true, 'TOGGLE', { calendarType: 'time-based' }),
|
|
677
732
|
'timer.showRestartButton': def('timer', 'boolean', true, 'TOGGLE'),
|
|
678
|
-
'timer.showPauseButton': def('timer', 'boolean', true, 'TOGGLE'),
|
|
733
|
+
'timer.showPauseButton': def('timer', 'boolean', true, 'TOGGLE', { calendarType: 'time-based' }),
|
|
679
734
|
// ═══════════════════════════════════════════════════════════════════════
|
|
680
735
|
// Lock screen
|
|
681
736
|
// ═══════════════════════════════════════════════════════════════════════
|
|
682
|
-
'lockScreen.pin': def('lockScreen', 'string', '', 'PIN_INPUT'),
|
|
683
737
|
'lockScreen.inactivityLockEnabled': def('lockScreen', 'boolean', false, 'TOGGLE'),
|
|
684
738
|
'lockScreen.inactivityTimeoutMinutes': def('lockScreen', 'number', 5, 'SELECT', {
|
|
685
739
|
options: [
|
|
@@ -691,6 +745,7 @@ function buildEntries(config) {
|
|
|
691
745
|
{ value: 45, labelKey: 'Settings.Option.InactivityTimeout.45min' },
|
|
692
746
|
],
|
|
693
747
|
}),
|
|
748
|
+
'lockScreen.pin': def('lockScreen', 'string', '', 'PIN_INPUT'),
|
|
694
749
|
'lockScreen.clockDisplay': def('lockScreen', 'string', 'digital', 'SELECT', {
|
|
695
750
|
options: [
|
|
696
751
|
{ value: 'none', labelKey: 'Settings.Option.ClockDisplay.None' },
|
|
@@ -704,8 +759,8 @@ function buildEntries(config) {
|
|
|
704
759
|
},
|
|
705
760
|
],
|
|
706
761
|
}),
|
|
707
|
-
'lockScreen.showDate': def('lockScreen', 'boolean', true, 'TOGGLE'),
|
|
708
762
|
'lockScreen.showHourNumbers': def('lockScreen', 'boolean', true, 'TOGGLE'),
|
|
763
|
+
'lockScreen.showDate': def('lockScreen', 'boolean', true, 'TOGGLE'),
|
|
709
764
|
'lockScreen.imageMode': def('lockScreen', 'string', 'none', 'SELECT', {
|
|
710
765
|
options: [
|
|
711
766
|
{ value: 'none', labelKey: 'Settings.Option.ImageMode.None' },
|
|
@@ -720,7 +775,6 @@ function buildEntries(config) {
|
|
|
720
775
|
],
|
|
721
776
|
}),
|
|
722
777
|
'lockScreen.backgroundImage': def('lockScreen', 'json', null, 'CUSTOM_IMAGE'),
|
|
723
|
-
'lockScreen.photoFrameImages': def('lockScreen', 'json', [], 'CUSTOM_IMAGE_ARRAY'),
|
|
724
778
|
'lockScreen.photoFrameIntervalSeconds': def('lockScreen', 'number', 60, 'SELECT', {
|
|
725
779
|
options: [
|
|
726
780
|
{ value: 30, labelKey: 'Settings.Option.PhotoFrameInterval.30sec' },
|
|
@@ -729,6 +783,7 @@ function buildEntries(config) {
|
|
|
729
783
|
{ value: 300, labelKey: 'Settings.Option.PhotoFrameInterval.5min' },
|
|
730
784
|
],
|
|
731
785
|
}),
|
|
786
|
+
'lockScreen.photoFrameImages': def('lockScreen', 'json', [], 'CUSTOM_IMAGE_ARRAY'),
|
|
732
787
|
// ═══════════════════════════════════════════════════════════════════════
|
|
733
788
|
// Touch / gestures
|
|
734
789
|
// ═══════════════════════════════════════════════════════════════════════
|
|
@@ -770,8 +825,8 @@ function buildEntries(config) {
|
|
|
770
825
|
// ═══════════════════════════════════════════════════════════════════════
|
|
771
826
|
// Header
|
|
772
827
|
'chronological.header.showNavigationArrows': def('chronological', 'boolean', true, 'TOGGLE'),
|
|
773
|
-
'chronological.header.showClock': def('chronological', 'boolean', true, 'TOGGLE'),
|
|
774
828
|
'chronological.header.showCurrentYearInDate': def('chronological', 'boolean', false, 'TOGGLE'),
|
|
829
|
+
'chronological.header.showClock': def('chronological', 'boolean', true, 'TOGGLE'),
|
|
775
830
|
'chronological.header.showTimeOfDay': def('chronological', 'boolean', false, 'TOGGLE'),
|
|
776
831
|
// Footer
|
|
777
832
|
'chronological.footer.showMenuButton': def('chronological', 'boolean', true, 'TOGGLE'),
|
|
@@ -780,13 +835,14 @@ function buildEntries(config) {
|
|
|
780
835
|
'chronological.footer.showViewSwitcherMonth': def('chronological', 'boolean', true, 'TOGGLE'),
|
|
781
836
|
'chronological.footer.showTimerButton': def('chronological', 'boolean', true, 'TOGGLE'),
|
|
782
837
|
'chronological.footer.showNewEventButton': def('chronological', 'boolean', true, 'TOGGLE'),
|
|
838
|
+
'chronological.footer.showNowButton': def('chronological', 'boolean', true, 'TOGGLE'),
|
|
783
839
|
'chronological.footer.showSettingsButton': def('chronological', 'boolean', true, 'TOGGLE'),
|
|
784
840
|
// Timer features
|
|
785
841
|
'chronological.timer.showNewCountdown': def('chronological', 'boolean', true, 'TOGGLE'),
|
|
786
842
|
'chronological.timer.showFromTemplate': def('chronological', 'boolean', true, 'TOGGLE'),
|
|
843
|
+
'chronological.timer.showAddTemplate': def('chronological', 'boolean', true, 'TOGGLE'),
|
|
787
844
|
'chronological.timer.showEditTemplate': def('chronological', 'boolean', true, 'TOGGLE'),
|
|
788
845
|
'chronological.timer.showDeleteTemplate': def('chronological', 'boolean', true, 'TOGGLE'),
|
|
789
|
-
'chronological.timer.showAddTemplate': def('chronological', 'boolean', true, 'TOGGLE'),
|
|
790
846
|
// Menu
|
|
791
847
|
'chronological.menu.showSettingsButton': def('chronological', 'boolean', true, 'TOGGLE'),
|
|
792
848
|
// Quick settings
|
|
@@ -804,18 +860,18 @@ function buildEntries(config) {
|
|
|
804
860
|
// ═══════════════════════════════════════════════════════════════════════
|
|
805
861
|
// Chronological event form
|
|
806
862
|
// ═══════════════════════════════════════════════════════════════════════
|
|
863
|
+
// Fixed fields
|
|
864
|
+
'chronologicalEventForm.fixedField.allDay': def('chronologicalEventForm', 'boolean', true, 'TOGGLE'),
|
|
865
|
+
'chronologicalEventForm.fixedField.endTime': def('chronologicalEventForm', 'boolean', true, 'TOGGLE'),
|
|
866
|
+
'chronologicalEventForm.fixedField.visibility': def('chronologicalEventForm', 'boolean', true, 'TOGGLE'),
|
|
807
867
|
// Toggleable fields
|
|
868
|
+
'chronologicalEventForm.field.acknowledge': def('chronologicalEventForm', 'boolean', true, 'TOGGLE'),
|
|
808
869
|
'chronologicalEventForm.field.description': def('chronologicalEventForm', 'boolean', true, 'TOGGLE'),
|
|
809
870
|
'chronologicalEventForm.field.recurrence': def('chronologicalEventForm', 'boolean', true, 'TOGGLE'),
|
|
810
|
-
'chronologicalEventForm.field.acknowledge': def('chronologicalEventForm', 'boolean', true, 'TOGGLE'),
|
|
811
871
|
'chronologicalEventForm.field.checklist': def('chronologicalEventForm', 'boolean', true, 'TOGGLE'),
|
|
812
872
|
'chronologicalEventForm.field.extraImages': def('chronologicalEventForm', 'boolean', true, 'TOGGLE'),
|
|
813
873
|
'chronologicalEventForm.field.reminders': def('chronologicalEventForm', 'boolean', true, 'TOGGLE'),
|
|
814
874
|
'chronologicalEventForm.field.audioClips': def('chronologicalEventForm', 'boolean', true, 'TOGGLE'),
|
|
815
|
-
// Fixed fields
|
|
816
|
-
'chronologicalEventForm.fixedField.allDay': def('chronologicalEventForm', 'boolean', true, 'TOGGLE'),
|
|
817
|
-
'chronologicalEventForm.fixedField.endTime': def('chronologicalEventForm', 'boolean', true, 'TOGGLE'),
|
|
818
|
-
'chronologicalEventForm.fixedField.visibility': def('chronologicalEventForm', 'boolean', true, 'TOGGLE'),
|
|
819
875
|
// Suggest end time
|
|
820
876
|
'chronologicalEventForm.suggestEndTime.enabled': def('chronologicalEventForm', 'boolean', false, 'TOGGLE'),
|
|
821
877
|
'chronologicalEventForm.suggestEndTime.value': def('chronologicalEventForm', 'number', 30, 'SLIDER', { sliderConfig: { min: 5, max: 480, step: 5 } }),
|
|
@@ -890,8 +946,22 @@ export class SettingsRegistry {
|
|
|
890
946
|
case 'number':
|
|
891
947
|
return String(value ?? 0);
|
|
892
948
|
case 'boolean':
|
|
949
|
+
if (typeof value === 'string') {
|
|
950
|
+
return value === 'true' ? 'true' : 'false';
|
|
951
|
+
}
|
|
893
952
|
return value ? 'true' : 'false';
|
|
894
953
|
case 'json':
|
|
954
|
+
// If already a serialized JSON string, return as-is to avoid
|
|
955
|
+
// double-wrapping (e.g. JSON.stringify("[]") → "\"[]\"")
|
|
956
|
+
if (typeof value === 'string') {
|
|
957
|
+
try {
|
|
958
|
+
JSON.parse(value);
|
|
959
|
+
return value;
|
|
960
|
+
}
|
|
961
|
+
catch {
|
|
962
|
+
return JSON.stringify(value);
|
|
963
|
+
}
|
|
964
|
+
}
|
|
895
965
|
return JSON.stringify(value);
|
|
896
966
|
}
|
|
897
967
|
}
|
|
@@ -910,7 +980,18 @@ export class SettingsRegistry {
|
|
|
910
980
|
return (raw === 'true');
|
|
911
981
|
case 'json':
|
|
912
982
|
try {
|
|
913
|
-
|
|
983
|
+
let result = JSON.parse(raw);
|
|
984
|
+
// Unwrap multiply-escaped JSON strings caused by repeated
|
|
985
|
+
// double-serialization (each push/pull cycle added a layer)
|
|
986
|
+
while (typeof result === 'string') {
|
|
987
|
+
try {
|
|
988
|
+
result = JSON.parse(result);
|
|
989
|
+
}
|
|
990
|
+
catch {
|
|
991
|
+
break;
|
|
992
|
+
}
|
|
993
|
+
}
|
|
994
|
+
return result;
|
|
914
995
|
}
|
|
915
996
|
catch {
|
|
916
997
|
return this.getDefault(key);
|
|
@@ -1002,6 +1083,8 @@ export function parseSettingsSnapshot(json, calendarType, registry = defaultRegi
|
|
|
1002
1083
|
uiType: entryDef?.uiType ?? 'TEXT_INPUT',
|
|
1003
1084
|
...(entryDef?.options && { options: entryDef.options }),
|
|
1004
1085
|
...(entryDef?.sliderConfig && { sliderConfig: entryDef.sliderConfig }),
|
|
1086
|
+
...(entryDef?.appMode && { appMode: entryDef.appMode }),
|
|
1087
|
+
...(entryDef?.calendarType && { calendarType: entryDef.calendarType }),
|
|
1005
1088
|
});
|
|
1006
1089
|
}
|
|
1007
1090
|
// Determine which categories to show
|
|
@@ -1041,6 +1124,45 @@ export function formatSettingValue(value) {
|
|
|
1041
1124
|
}
|
|
1042
1125
|
return String(value);
|
|
1043
1126
|
}
|
|
1127
|
+
/**
|
|
1128
|
+
* Serialize a settings object (with mixed native types) into a
|
|
1129
|
+
* string-values-only snapshot suitable for pushing to a mobile device.
|
|
1130
|
+
*
|
|
1131
|
+
* Uses the registry's `serialize()` method for known keys so that
|
|
1132
|
+
* booleans become "true"/"false", numbers become digit strings, etc.
|
|
1133
|
+
* Unknown keys are converted with `String(value)`.
|
|
1134
|
+
*/
|
|
1135
|
+
export function serializeSettingsSnapshot(settings, registry) {
|
|
1136
|
+
const result = {};
|
|
1137
|
+
for (const [key, value] of Object.entries(settings)) {
|
|
1138
|
+
if (key in registry.entries) {
|
|
1139
|
+
result[key] = registry.serialize(key, value);
|
|
1140
|
+
}
|
|
1141
|
+
else {
|
|
1142
|
+
result[key] = String(value ?? '');
|
|
1143
|
+
}
|
|
1144
|
+
}
|
|
1145
|
+
return result;
|
|
1146
|
+
}
|
|
1147
|
+
/**
|
|
1148
|
+
* Deserialize a settings snapshot (string values from the server/DB) into
|
|
1149
|
+
* native-typed values using the registry.
|
|
1150
|
+
*
|
|
1151
|
+
* This ensures local state always contains native types (boolean, number, etc.)
|
|
1152
|
+
* so that subsequent `serializeSettingsSnapshot` calls produce correct results.
|
|
1153
|
+
*/
|
|
1154
|
+
export function deserializeSettingsSnapshot(snapshot, registry = defaultRegistry) {
|
|
1155
|
+
const result = {};
|
|
1156
|
+
for (const [key, value] of Object.entries(snapshot)) {
|
|
1157
|
+
if (typeof value === 'string' && key in registry.entries) {
|
|
1158
|
+
result[key] = registry.deserialize(key, value);
|
|
1159
|
+
}
|
|
1160
|
+
else {
|
|
1161
|
+
result[key] = value;
|
|
1162
|
+
}
|
|
1163
|
+
}
|
|
1164
|
+
return result;
|
|
1165
|
+
}
|
|
1044
1166
|
// ---------------------------------------------------------------------------
|
|
1045
1167
|
// Default registry instance (non-enrolled, system theme, nb locale)
|
|
1046
1168
|
// ---------------------------------------------------------------------------
|