react-native-persona 2.2.15 → 2.2.18

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/CHANGELOG.md CHANGED
@@ -7,6 +7,28 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
8
  ## Unreleased
9
9
 
10
+ ## [v2.2.18] - 2022-07-27
11
+
12
+ ### Changed
13
+
14
+ - Upgrade to iOS Inquiry SDK 2.3.2
15
+
16
+ ## [v2.2.17] - 2022-07-19
17
+
18
+ ### Changed
19
+
20
+ - Upgrade to Android Inquiry SDK 2.2.28
21
+
22
+ ## [v2.2.16] - 2022-07-14
23
+
24
+ ### Added
25
+
26
+ - Added various iOS theming property wrappers to the persona-tool
27
+
28
+ ### Changed
29
+
30
+ - Upgrade to Android Inquiry SDK 2.2.26
31
+
10
32
  ## [v2.2.15] - 2022-07-01
11
33
 
12
34
  ### Fixed
@@ -22,7 +22,7 @@ Pod::Spec.new do |s|
22
22
  s.requires_arc = true
23
23
 
24
24
  s.dependency 'React-Core'
25
- s.dependency 'PersonaInquirySDK2', '2.3.1'
25
+ s.dependency 'PersonaInquirySDK2', '2.3.2'
26
26
 
27
27
  s.static_framework = true
28
28
  end
@@ -66,5 +66,5 @@ dependencies {
66
66
  //noinspection GradleDynamicVersion
67
67
  implementation 'com.facebook.react:react-native:+' // From node_modules
68
68
 
69
- implementation 'com.withpersona.sdk2:inquiry:2.2.25'
69
+ implementation 'com.withpersona.sdk2:inquiry:2.2.28'
70
70
  }
@@ -225,10 +225,40 @@ extension PersonaInquiry2 {
225
225
  theme.accentColor = color
226
226
  }
227
227
 
228
+ if let color = color(from: dictionary["errorColor"]) {
229
+ theme.errorColor = color
230
+ }
231
+
232
+ if let fontName = dictionary["errorTextFont"],
233
+ let font = UIFont(name: fontName, size: 16) {
234
+ theme.errorTextFont = font
235
+ }
236
+
228
237
  if let color = color(from: dictionary["overlayBackgroundColor"]) {
229
238
  theme.overlayBackgroundColor = color
230
239
  }
231
240
 
241
+ if let alignment = dictionary["titleTextAlignment"] {
242
+ var titleTextAlignment: NSTextAlignment {
243
+ switch alignment {
244
+ case "left":
245
+ return .left
246
+ case "center":
247
+ return .center
248
+ case "right":
249
+ return .right
250
+ case "justified":
251
+ return .justified
252
+ case "natural":
253
+ return .natural
254
+ default:
255
+ // Default to left on invalid input
256
+ return .left
257
+ }
258
+ }
259
+ theme.titleTextAlignment = titleTextAlignment
260
+ }
261
+
232
262
  if let color = color(from: dictionary["titleTextColor"]) {
233
263
  theme.titleTextColor = color
234
264
  }
@@ -243,6 +273,27 @@ extension PersonaInquiry2 {
243
273
  theme.cardTitleTextFont = font
244
274
  }
245
275
 
276
+ if let alignment = dictionary["bodyTextAlignment"] {
277
+ var bodyTextAlignment: NSTextAlignment {
278
+ switch alignment {
279
+ case "left":
280
+ return .left
281
+ case "center":
282
+ return .center
283
+ case "right":
284
+ return .right
285
+ case "justified":
286
+ return .justified
287
+ case "natural":
288
+ return .natural
289
+ default:
290
+ // Default to left on invalid input
291
+ return .left
292
+ }
293
+ }
294
+ theme.bodyTextAlignment = bodyTextAlignment
295
+ }
296
+
246
297
  if let color = color(from: dictionary["bodyTextColor"]) {
247
298
  theme.bodyTextColor = color
248
299
  }
@@ -358,11 +409,87 @@ extension PersonaInquiry2 {
358
409
  theme.buttonCornerRadius = radius
359
410
  }
360
411
 
412
+ if let widthString = dictionary["buttonBorderWidth"],
413
+ let widthNumber = NumberFormatter().number(from: widthString),
414
+ let width = CGFloat(exactly: widthNumber) {
415
+ theme.buttonBorderWidth = width
416
+ }
417
+
418
+ if let color = color(from: dictionary["buttonBorderColor"]) {
419
+ theme.buttonBorderColor = color
420
+ }
421
+
361
422
  if let fontName = dictionary["buttonFont"],
362
423
  let font = UIFont(name: fontName, size: 18) {
363
424
  theme.buttonFont = font
364
425
  }
365
426
 
427
+ if let color = color(from: dictionary["buttonSecondaryBackgroundColor"]) {
428
+ theme.buttonSecondaryBackgroundColor = color
429
+ }
430
+
431
+ if let color = color(from: dictionary["buttonSecondaryDisabledBackgroundColor"]) {
432
+ theme.buttonSecondaryDisabledBackgroundColor = color
433
+ }
434
+
435
+ if let color = color(from: dictionary["buttonSecondaryTouchedBackgroundColor"]) {
436
+ theme.buttonSecondaryTouchedBackgroundColor = color
437
+ }
438
+
439
+ if let color = color(from: dictionary["buttonSecondaryImageTintColor"]) {
440
+ theme.buttonSecondaryImageTintColor = color
441
+ }
442
+
443
+ if let color = color(from: dictionary["buttonSecondaryTextColor"]) {
444
+ theme.buttonSecondaryTextColor = color
445
+ }
446
+
447
+ if let color = color(from: dictionary["buttonSecondaryDisabledTextColor"]) {
448
+ theme.buttonSecondaryDisabledTextColor = color
449
+ }
450
+
451
+ if let alignment = dictionary["buttonSecondaryTextAlignment"] {
452
+ var buttonSecondaryTextAlignment: NSTextAlignment {
453
+ switch alignment {
454
+ case "left":
455
+ return .left
456
+ case "center":
457
+ return .center
458
+ case "right":
459
+ return .right
460
+ case "justified":
461
+ return .justified
462
+ case "natural":
463
+ return .natural
464
+ default:
465
+ // Default to left on invalid input
466
+ return .left
467
+ }
468
+ }
469
+ theme.buttonSecondaryTextAlignment = buttonSecondaryTextAlignment
470
+ }
471
+
472
+ if let radiusString = dictionary["buttonSecondaryCornerRadius"],
473
+ let radiusNumber = NumberFormatter().number(from: radiusString),
474
+ let radius = CGFloat(exactly: radiusNumber) {
475
+ theme.buttonSecondaryCornerRadius = radius
476
+ }
477
+
478
+ if let widthString = dictionary["buttonSecondaryBorderWidth"],
479
+ let widthNumber = NumberFormatter().number(from: widthString),
480
+ let width = CGFloat(exactly: widthNumber) {
481
+ theme.buttonSecondaryBorderWidth = width
482
+ }
483
+
484
+ if let color = color(from: dictionary["buttonSecondaryBorderColor"]) {
485
+ theme.buttonSecondaryBorderColor = color
486
+ }
487
+
488
+ if let fontName = dictionary["buttonSecondaryFont"],
489
+ let font = UIFont(name: fontName, size: 18) {
490
+ theme.buttonSecondaryFont = font
491
+ }
492
+
366
493
  if let color = color(from: dictionary["selectedCellBackgroundColor"]) {
367
494
  theme.selectedCellBackgroundColor = color
368
495
  }
@@ -375,48 +502,24 @@ extension PersonaInquiry2 {
375
502
  theme.cancelButtonBackgroundColor = color
376
503
  }
377
504
 
378
- if let color = color(from: dictionary["cameraGuideCornersColor"]) {
379
- theme.cameraGuideCornersColor = color
505
+ if let color = color(from: dictionary["cancelButtonTextColor"]) {
506
+ theme.cancelButtonTextColor = color
380
507
  }
381
508
 
382
- if let color = color(from: dictionary["cameraButtonBackgroundColor"]) {
383
- theme.cameraButtonBackgroundColor = color
509
+ if let color = color(from: dictionary["cancelButtonAlternateBackgroundColor"]) {
510
+ theme.cancelButtonAlternateBackgroundColor = color
384
511
  }
385
512
 
386
- if let successAssetName = dictionary["successAssetName"],
387
- let successAssetWidth = int(from: dictionary["successAssetWidth"]),
388
- let successAssetHeight = int(from: dictionary["successAssetHeight"]),
389
- let successAssetPath = Bundle(for: PersonaInquiry2.self).path(forResource: successAssetName, ofType: "svg") {
390
- let customSuccessAsset = InquiryTheme.SVGAsset(
391
- path: successAssetPath,
392
- size: CGSize(width: successAssetWidth, height: successAssetHeight)
393
- )
394
-
395
- theme.successAsset = customSuccessAsset
513
+ if let color = color(from: dictionary["cancelButtonAlternateTextColor"]) {
514
+ theme.cancelButtonAlternateTextColor = color
396
515
  }
397
516
 
398
- if let verificationFailAssetName = dictionary["verificationFailAssetName"],
399
- let verificationFailAssetWidth = int(from: dictionary["verificationFailAssetWidth"]),
400
- let verificationFailAssetHeight = int(from: dictionary["verificationFailAssetHeight"]),
401
- let verificationFailAssetPath = Bundle(for: PersonaInquiry2.self).path(forResource: verificationFailAssetName, ofType: "svg") {
402
- let customVerificationFailAsset = InquiryTheme.SVGAsset(
403
- path: verificationFailAssetPath,
404
- size: CGSize(width: verificationFailAssetWidth, height: verificationFailAssetHeight)
405
- )
406
-
407
- theme.verificationFailedAsset = customVerificationFailAsset
517
+ if let color = color(from: dictionary["cameraGuideCornersColor"]) {
518
+ theme.cameraGuideCornersColor = color
408
519
  }
409
520
 
410
- if let failAssetName = dictionary["failAssetName"],
411
- let failAssetWidth = int(from: dictionary["failAssetWidth"]),
412
- let failAssetHeight = int(from: dictionary["failAssetHeight"]),
413
- let failAssetPath = Bundle(for: PersonaInquiry2.self).path(forResource: failAssetName, ofType: "svg") {
414
- let customFailAsset = InquiryTheme.SVGAsset(
415
- path: failAssetPath,
416
- size: CGSize(width: failAssetWidth, height: failAssetHeight)
417
- )
418
-
419
- theme.failedAsset = customFailAsset
521
+ if let color = color(from: dictionary["cameraButtonBackgroundColor"]) {
522
+ theme.cameraButtonBackgroundColor = color
420
523
  }
421
524
 
422
525
  if let loadingAnimationAssetName = dictionary["loadingAnimationAssetName"],
@@ -442,6 +545,19 @@ extension PersonaInquiry2 {
442
545
 
443
546
  theme.processingAnimation = customProcessingAnimationAsset
444
547
  }
548
+
549
+ if let assetName = dictionary["selfieAnimationAssetName"],
550
+ let width = int(from: dictionary["selfieAnimationAssetWidth"]),
551
+ let height = int(from: dictionary["selfieAnimationAssetHeight"]),
552
+ let path = Bundle(for: PersonaInquiry2.self).path(forResource: assetName, ofType: "json") {
553
+ let customAsset = InquiryTheme.AnimationAsset(
554
+ path: path,
555
+ size: CGSize(width: width, height: height)
556
+ )
557
+
558
+ theme.selfieAsset = customAsset
559
+ }
560
+
445
561
  return theme
446
562
  }
447
563
 
@@ -56,9 +56,14 @@ exports.IOS_THEME_CONFIG_KEY = IOS_THEME_CONFIG_KEY;
56
56
  IOS_THEME_CONFIG_KEY["primaryColor"] = "primaryColor";
57
57
  IOS_THEME_CONFIG_KEY["darkPrimaryColor"] = "darkPrimaryColor";
58
58
  IOS_THEME_CONFIG_KEY["accentColor"] = "accentColor";
59
+ IOS_THEME_CONFIG_KEY["errorColor"] = "errorColor";
60
+ IOS_THEME_CONFIG_KEY["errorTextFont"] = "errorTextFont";
59
61
  IOS_THEME_CONFIG_KEY["overlayBackgroundColor"] = "overlayBackgroundColor";
62
+ IOS_THEME_CONFIG_KEY["titleTextAlignment"] = "titleTextAlignment";
60
63
  IOS_THEME_CONFIG_KEY["titleTextColor"] = "titleTextColor";
61
64
  IOS_THEME_CONFIG_KEY["titleTextFont"] = "titleTextFont";
65
+ IOS_THEME_CONFIG_KEY["cardTitleTextFont"] = "cardTitleTextFont";
66
+ IOS_THEME_CONFIG_KEY["bodyTextAlignment"] = "bodyTextAlignment";
62
67
  IOS_THEME_CONFIG_KEY["bodyTextColor"] = "bodyTextColor";
63
68
  IOS_THEME_CONFIG_KEY["bodyTextFont"] = "bodyTextFont";
64
69
  IOS_THEME_CONFIG_KEY["footnoteTextColor"] = "footnoteTextColor";
@@ -68,32 +73,40 @@ exports.IOS_THEME_CONFIG_KEY = IOS_THEME_CONFIG_KEY;
68
73
  IOS_THEME_CONFIG_KEY["textFieldTextColor"] = "textFieldTextColor";
69
74
  IOS_THEME_CONFIG_KEY["textFieldBackgroundColor"] = "textFieldBackgroundColor";
70
75
  IOS_THEME_CONFIG_KEY["textFieldBorderColor"] = "textFieldBorderColor";
76
+ IOS_THEME_CONFIG_KEY["textFieldCornerRadius"] = "textFieldCornerRadius";
77
+ IOS_THEME_CONFIG_KEY["textFieldFont"] = "textFieldFont";
78
+ IOS_THEME_CONFIG_KEY["textFieldPlaceholderFont"] = "textFieldPlaceholderFont";
71
79
  IOS_THEME_CONFIG_KEY["pickerTextColor"] = "pickerTextColor";
72
80
  IOS_THEME_CONFIG_KEY["pickerTextFont"] = "pickerTextFont";
73
81
  IOS_THEME_CONFIG_KEY["buttonBackgroundColor"] = "buttonBackgroundColor";
74
82
  IOS_THEME_CONFIG_KEY["buttonDisabledBackgroundColor"] = "buttonDisabledBackgroundColor";
75
83
  IOS_THEME_CONFIG_KEY["buttonTouchedBackgroundColor"] = "buttonTouchedBackgroundColor";
76
- IOS_THEME_CONFIG_KEY["buttonImageTintColor"] = "buttonImageTintColor";
77
84
  IOS_THEME_CONFIG_KEY["buttonTextColor"] = "buttonTextColor";
78
85
  IOS_THEME_CONFIG_KEY["buttonDisabledTextColor"] = "buttonDisabledTextColor";
79
86
  IOS_THEME_CONFIG_KEY["buttonTextAlignment"] = "buttonTextAlignment";
87
+ IOS_THEME_CONFIG_KEY["buttonImageTintColor"] = "buttonImageTintColor";
80
88
  IOS_THEME_CONFIG_KEY["buttonCornerRadius"] = "buttonCornerRadius";
89
+ IOS_THEME_CONFIG_KEY["buttonBorderWidth"] = "buttonBorderWidth";
90
+ IOS_THEME_CONFIG_KEY["buttonBorderColor"] = "buttonBorderColor";
81
91
  IOS_THEME_CONFIG_KEY["buttonFont"] = "buttonFont";
92
+ IOS_THEME_CONFIG_KEY["buttonSecondaryBackgroundColor"] = "buttonSecondaryBackgroundColor";
93
+ IOS_THEME_CONFIG_KEY["buttonSecondaryDisabledBackgroundColor"] = "buttonSecondaryDisabledBackgroundColor";
94
+ IOS_THEME_CONFIG_KEY["buttonSecondaryTouchedBackgroundColor"] = "buttonSecondaryTouchedBackgroundColor";
95
+ IOS_THEME_CONFIG_KEY["buttonSecondaryTextColor"] = "buttonSecondaryTextColor";
96
+ IOS_THEME_CONFIG_KEY["buttonSecondaryDisabledTextColor"] = "buttonSecondaryDisabledTextColor";
97
+ IOS_THEME_CONFIG_KEY["buttonSecondaryTextAlignment"] = "buttonSecondaryTextAlignment";
98
+ IOS_THEME_CONFIG_KEY["buttonSecondaryImageTintColor"] = "buttonSecondaryImageTintColor";
99
+ IOS_THEME_CONFIG_KEY["buttonSecondaryCornerRadius"] = "buttonSecondaryCornerRadius";
100
+ IOS_THEME_CONFIG_KEY["buttonSecondaryBorderWidth"] = "buttonSecondaryBorderWidth";
101
+ IOS_THEME_CONFIG_KEY["buttonSecondaryBorderColor"] = "buttonSecondaryBorderColor";
102
+ IOS_THEME_CONFIG_KEY["buttonSecondaryFont"] = "buttonSecondaryFont";
82
103
  IOS_THEME_CONFIG_KEY["selectedCellBackgroundColor"] = "selectedCellBackgroundColor";
83
104
  IOS_THEME_CONFIG_KEY["closeButtonTintColor"] = "closeButtonTintColor";
84
105
  IOS_THEME_CONFIG_KEY["cancelButtonBackgroundColor"] = "cancelButtonBackgroundColor";
85
- IOS_THEME_CONFIG_KEY["progressColor"] = "progressColor";
86
- IOS_THEME_CONFIG_KEY["cameraGuideCornersColor"] = "cameraGuideCornersColor";
87
- IOS_THEME_CONFIG_KEY["cameraButtonBackgroundColor"] = "cameraButtonBackgroundColor";
88
- IOS_THEME_CONFIG_KEY["successAssetName"] = "successAssetName";
89
- IOS_THEME_CONFIG_KEY["successAssetWidth"] = "successAssetWidth";
90
- IOS_THEME_CONFIG_KEY["successAssetHeight"] = "successAssetHeight";
91
- IOS_THEME_CONFIG_KEY["verificationFailAssetName"] = "verificationFailAssetName";
92
- IOS_THEME_CONFIG_KEY["verificationFailAssetWidth"] = "verificationFailAssetWidth";
93
- IOS_THEME_CONFIG_KEY["verificationFailAssetHeight"] = "verificationFailAssetHeight";
94
- IOS_THEME_CONFIG_KEY["failAssetName"] = "failAssetName";
95
- IOS_THEME_CONFIG_KEY["failAssetWidth"] = "failAssetWidth";
96
- IOS_THEME_CONFIG_KEY["failAssetHeight"] = "failAssetHeight";
106
+ IOS_THEME_CONFIG_KEY["cancelButtonTextColor"] = "cancelButtonTextColor";
107
+ IOS_THEME_CONFIG_KEY["cancelButtonAlternateBackgroundColor"] = "cancelButtonAlternateBackgroundColor";
108
+ IOS_THEME_CONFIG_KEY["cancelButtonAlternateTextColor"] = "cancelButtonAlternateTextColor";
109
+ IOS_THEME_CONFIG_KEY["processingLabelsTextAlignment"] = "processingLabelsTextAlignment";
97
110
  IOS_THEME_CONFIG_KEY["loadingAnimationAssetName"] = "loadingAnimationAssetName";
98
111
  IOS_THEME_CONFIG_KEY["loadingAnimationAssetWidth"] = "loadingAnimationAssetWidth";
99
112
  IOS_THEME_CONFIG_KEY["loadingAnimationAssetHeight"] = "loadingAnimationAssetHeight";
@@ -1 +1 @@
1
- {"version":3,"sources":["Theme.ts"],"names":["COLOR_REGEX","ANDROID_THEME_CONFIG_KEY","IOS_THEME_CONFIG_KEY","Theme","print","platform","config","Config","get","themeConfig","androidTheme","iosTheme","usesCustomFontAndroid","usesCustomFontIos","head","table","Table","chars","console","log","keyEnum","key","override","colorOverride","includes","normalizeColor","toString","row","valueColor","chalk","yellow","cyan","push","isColorOverride","hex","magentaBright","colorHex","themeKey","slice","test","error","red","bgHex","process","exit"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;;;AAEA,MAAMA,WAAW,GAAG,kBAApB;IAEYC,wB;;;WAAAA,wB;AAAAA,EAAAA,wB;AAAAA,EAAAA,wB;AAAAA,EAAAA,wB;AAAAA,EAAAA,wB;AAAAA,EAAAA,wB;AAAAA,EAAAA,wB;AAAAA,EAAAA,wB;AAAAA,EAAAA,wB;AAAAA,EAAAA,wB;AAAAA,EAAAA,wB;AAAAA,EAAAA,wB;AAAAA,EAAAA,wB;AAAAA,EAAAA,wB;AAAAA,EAAAA,wB;AAAAA,EAAAA,wB;AAAAA,EAAAA,wB;AAAAA,EAAAA,wB;AAAAA,EAAAA,wB;AAAAA,EAAAA,wB;AAAAA,EAAAA,wB;AAAAA,EAAAA,wB;AAAAA,EAAAA,wB;AAAAA,EAAAA,wB;AAAAA,EAAAA,wB;AAAAA,EAAAA,wB;AAAAA,EAAAA,wB;AAAAA,EAAAA,wB;AAAAA,EAAAA,wB;GAAAA,wB,wCAAAA,wB;;IAyCAC,oB;;;WAAAA,oB;AAAAA,EAAAA,oB;AAAAA,EAAAA,oB;AAAAA,EAAAA,oB;AAAAA,EAAAA,oB;AAAAA,EAAAA,oB;AAAAA,EAAAA,oB;AAAAA,EAAAA,oB;AAAAA,EAAAA,oB;AAAAA,EAAAA,oB;AAAAA,EAAAA,oB;AAAAA,EAAAA,oB;AAAAA,EAAAA,oB;AAAAA,EAAAA,oB;AAAAA,EAAAA,oB;AAAAA,EAAAA,oB;AAAAA,EAAAA,oB;AAAAA,EAAAA,oB;AAAAA,EAAAA,oB;AAAAA,EAAAA,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AEc,IAAIjC,KAAJ,E","sourcesContent":["import Table from 'cli-table';\nimport chalk from 'chalk';\n\nimport Config from './Config';\n\nconst COLOR_REGEX = /^[a-zA-Z0-9]{6}$/;\n\nexport enum ANDROID_THEME_CONFIG_KEY {\n backgroundColor = 'backgroundColor',\n primaryColor = 'primaryColor',\n darkPrimaryColor = 'darkPrimaryColor',\n accentColor = 'accentColor',\n\n titleTextColor = 'titleTextColor',\n titleTextFont = 'titleTextFont',\n\n bodyTextColor = 'bodyTextColor',\n bodyTextFont = 'bodyTextFont',\n\n footnoteTextColor = 'footnoteTextColor',\n footnoteTextFont = 'footnoteTextFont',\n\n // formLabelTextColor = \"formLabelTextColor\",\n // formLabelTextFont = \"formLabelTextFont\",\n\n textFieldTextColor = 'textFieldTextColor',\n textFieldTextFont = 'textFieldTextFont',\n\n pickerTextColor = 'pickerTextColor',\n pickerTextFont = 'pickerTextFont',\n\n buttonBackgroundColor = 'buttonBackgroundColor',\n buttonDisabledBackgroundColor = 'buttonDisabledBackgroundColor',\n buttonTouchedBackgroundColor = 'buttonTouchedBackgroundColor',\n buttonTextColor = 'buttonTextColor',\n buttonDisabledTextColor = 'buttonDisabledTextColor',\n // buttonTextAlignment = \"buttonTextAlignment\",\n buttonCornerRadius = 'buttonCornerRadius',\n buttonFont = 'buttonFont',\n progressColor = 'progressColor',\n successAsset = 'successAsset',\n failAsset = 'failAsset',\n loadingAnimationAsset = 'loadingAnimationAsset',\n loadingAnimationWidthPercent = 'loadingAnimationWidthPercent',\n selfieAnimationAsset = 'selfieAnimationAsset',\n selfieAnimationWidthPercent = 'selfieAnimationWidthPercent',\n}\n\nexport enum IOS_THEME_CONFIG_KEY {\n backgroundColor = 'backgroundColor',\n primaryColor = 'primaryColor',\n darkPrimaryColor = 'darkPrimaryColor',\n accentColor = 'accentColor',\n overlayBackgroundColor = 'overlayBackgroundColor',\n titleTextColor = 'titleTextColor',\n titleTextFont = 'titleTextFont',\n bodyTextColor = 'bodyTextColor',\n bodyTextFont = 'bodyTextFont',\n footnoteTextColor = 'footnoteTextColor',\n footnoteTextFont = 'footnoteTextFont',\n formLabelTextColor = 'formLabelTextColor',\n formLabelTextFont = 'formLabelTextFont',\n textFieldTextColor = 'textFieldTextColor',\n textFieldBackgroundColor = 'textFieldBackgroundColor',\n textFieldBorderColor = 'textFieldBorderColor',\n pickerTextColor = 'pickerTextColor',\n pickerTextFont = 'pickerTextFont',\n buttonBackgroundColor = 'buttonBackgroundColor',\n buttonDisabledBackgroundColor = 'buttonDisabledBackgroundColor',\n buttonTouchedBackgroundColor = 'buttonTouchedBackgroundColor',\n buttonImageTintColor = 'buttonImageTintColor',\n buttonTextColor = 'buttonTextColor',\n buttonDisabledTextColor = 'buttonDisabledTextColor',\n buttonTextAlignment = 'buttonTextAlignment',\n buttonCornerRadius = 'buttonCornerRadius',\n buttonFont = 'buttonFont',\n selectedCellBackgroundColor = 'selectedCellBackgroundColor',\n closeButtonTintColor = 'closeButtonTintColor',\n cancelButtonBackgroundColor = 'cancelButtonBackgroundColor',\n progressColor = 'progressColor',\n cameraGuideCornersColor = 'cameraGuideCornersColor',\n cameraButtonBackgroundColor = 'cameraButtonBackgroundColor',\n successAssetName = 'successAssetName',\n successAssetWidth = 'successAssetWidth',\n successAssetHeight = 'successAssetHeight',\n verificationFailAssetName = 'verificationFailAssetName',\n verificationFailAssetWidth = 'verificationFailAssetWidth',\n verificationFailAssetHeight = 'verificationFailAssetHeight',\n failAssetName = 'failAssetName',\n failAssetWidth = 'failAssetWidth',\n failAssetHeight = 'failAssetHeight',\n loadingAnimationAssetName = 'loadingAnimationAssetName',\n loadingAnimationAssetWidth = 'loadingAnimationAssetWidth',\n loadingAnimationAssetHeight = 'loadingAnimationAssetHeight',\n processingAnimationAssetName = 'processingAnimationAssetName',\n processingAnimationAssetWidth = 'processingAnimationAssetWidth',\n processingAnimationAssetHeight = 'processingAnimationAssetHeight',\n selfieAnimationAssetName = 'selfieAnimationAssetName',\n selfieAnimationAssetWidth = 'selfieAnimationAssetWidth',\n selfieAnimationAssetHeight = 'selfieAnimationAssetHeight',\n}\n\nexport type AndroidThemeObject = {\n [key in ANDROID_THEME_CONFIG_KEY]: string | null | undefined;\n};\n\nexport type IosThemeObject = {\n [key in IOS_THEME_CONFIG_KEY]: string | null | undefined;\n};\n\nexport type ThemeObject = AndroidThemeObject | IosThemeObject;\n\nclass Theme {\n async print(platform: string = 'android') {\n const config = await Config.get();\n const themeConfig =\n platform === 'android' ? config.androidTheme : config.iosTheme;\n let usesCustomFontAndroid = false;\n let usesCustomFontIos = false;\n\n const head =\n platform === 'android'\n ? ['Style Item', 'Value', 'Note']\n : ['Style Item', 'Value', 'Note'];\n\n const table = new Table({\n head,\n // prettier-ignore\n chars: { 'mid': '', 'left-mid': '', 'mid-mid': '', 'right-mid': '' },\n });\n\n console.log('Specified theme values:');\n const keyEnum =\n platform === 'android' ? ANDROID_THEME_CONFIG_KEY : IOS_THEME_CONFIG_KEY;\n for (const key in keyEnum) {\n let override =\n themeConfig[key as ANDROID_THEME_CONFIG_KEY | IOS_THEME_CONFIG_KEY];\n let colorOverride = key.includes('Color') || key.includes('color');\n\n if (override) {\n if (colorOverride) {\n override = normalizeColor(override, key);\n } else {\n override = override.toString();\n }\n }\n\n if (key.includes('Font')) {\n if (platform == 'android') {\n usesCustomFontAndroid = true;\n } else {\n usesCustomFontIos = true;\n }\n }\n\n let row;\n\n row = [\n key,\n override\n ? valueColor(colorOverride, override)\n : chalk.yellow('unspecified'),\n key.includes('Font')\n ? chalk.cyan('Fonts that are not built-in need to be installed.')\n : '',\n ];\n\n table.push(row);\n }\n\n console.log(table.toString());\n\n if (usesCustomFontAndroid) {\n console.log(\n chalk.yellow(' NOTE') +\n ': A font customization was made. If the font is not built-in to the Android platform (https://github.com/react-native-training/react-native-fonts#android), then the font(s) must first be installed. A guide to install a font can be found here: https://developer.android.com/guide/topics/ui/look-and-feel/fonts-in-xml'\n );\n }\n\n if (usesCustomFontIos) {\n console.log(\n chalk.yellow(' NOTE') +\n ': A font customization was made. If the font is not built-in iOS (https://github.com/react-native-training/react-native-ios), then the font(s) must first be installed. A guide to install a font can be found here: https://developer.apple.com/documentation/uikit/text_display_and_fonts/adding_a_custom_font_to_your_app'\n );\n }\n\n // Add newline for spacing\n console.log('');\n }\n}\n\n// set default print color for non-color overrides\nfunction valueColor(isColorOverride: boolean, override: string) {\n return isColorOverride\n ? chalk.hex(override)(override)\n : chalk.magentaBright(override);\n}\n\nfunction normalizeColor(colorHex: string, themeKey: string) {\n let hex = colorHex;\n if (colorHex[0] === '#') {\n hex = colorHex.slice(1);\n }\n\n if (!COLOR_REGEX.test(hex)) {\n if (themeKey) {\n console.error(\n `Received a color value of ${chalk.yellow(colorHex)} for ${chalk.red(\n themeKey\n )}.\\nFormat must follow standard 6 character hexadecimal color code. Eg. ${chalk\n .bgHex('#FFFFFF')\n .hex('#7E66B7')('#290087')}`\n );\n } else {\n console.error(\n `Received a color value of ${chalk.yellow(\n colorHex\n )}.\\nFormat must follow standard 6 character hexadecimal color code. Eg. ${chalk\n .bgHex('#FFFFFF')\n .hex('#7E66B7')('#290087')}`\n );\n }\n console.log('');\n process.exit(1);\n }\n\n return colorHex;\n}\n\nexport default new Theme();\n"]}
1
+ {"version":3,"sources":["Theme.ts"],"names":["COLOR_REGEX","ANDROID_THEME_CONFIG_KEY","IOS_THEME_CONFIG_KEY","Theme","print","platform","config","Config","get","themeConfig","androidTheme","iosTheme","usesCustomFontAndroid","usesCustomFontIos","head","table","Table","chars","console","log","keyEnum","key","override","colorOverride","includes","normalizeColor","toString","row","valueColor","chalk","yellow","cyan","push","isColorOverride","hex","magentaBright","colorHex","themeKey","slice","test","error","red","bgHex","process","exit"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;;;AAEA,MAAMA,WAAW,GAAG,kBAApB;IAEYC,wB;;;WAAAA,wB;AAAAA,EAAAA,wB;AAAAA,EAAAA,wB;AAAAA,EAAAA,wB;AAAAA,EAAAA,wB;AAAAA,EAAAA,wB;AA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Z;;;AACA,SAASS,UAAT,CAAoBK,eAApB,EAA8CX,QAA9C,EAAgE;AAC9D,SAAOW,eAAe,GAClBJ,eAAMK,GAAN,CAAUZ,QAAV,EAAoBA,QAApB,CADkB,GAElBO,eAAMM,aAAN,CAAoBb,QAApB,CAFJ;AAGD;;AAED,SAASG,cAAT,CAAwBW,QAAxB,EAA0CC,QAA1C,EAA4D;AAC1D,MAAIH,GAAG,GAAGE,QAAV;;AACA,MAAIA,QAAQ,CAAC,CAAD,CAAR,KAAgB,GAApB,EAAyB;AACvBF,IAAAA,GAAG,GAAGE,QAAQ,CAACE,KAAT,CAAe,CAAf,CAAN;AACD;;AAED,MAAI,CAACtC,WAAW,CAACuC,IAAZ,CAAiBL,GAAjB,CAAL,EAA4B;AAC1B,QAAIG,QAAJ,EAAc;AACZnB,MAAAA,OAAO,CAACsB,KAAR,CACG,6BAA4BX,eAAMC,MAAN,CAAaM,QAAb,CAAuB,QAAOP,eAAMY,GAAN,CACzDJ,QADyD,CAEzD,0EAAyER,eACxEa,KADwE,CAClE,SADkE,EAExER,GAFwE,CAEpE,SAFoE,EAEzD,SAFyD,CAE9C,EAL/B;AAOD,KARD,MAQO;AACLhB,MAAAA,OAAO,CAACsB,KAAR,CACG,6BAA4BX,eAAMC,MAAN,CAC3BM,QAD2B,CAE3B,0EAAyEP,eACxEa,KADwE,CAClE,SADkE,EAExER,GAFwE,CAEpE,SAFoE,EAEzD,SAFyD,CAE9C,EAL/B;AAOD;;AACDhB,IAAAA,OAAO,CAACC,GAAR,CAAY,EAAZ;AACAwB,IAAAA,OAAO,CAACC,IAAR,CAAa,CAAb;AACD;;AAED,SAAOR,QAAP;AACD;;eAEc,IAAIjC,KAAJ,E","sourcesContent":["import Table from 'cli-table';\nimport chalk from 'chalk';\n\nimport Config from './Config';\n\nconst COLOR_REGEX = /^[a-zA-Z0-9]{6}$/;\n\nexport enum ANDROID_THEME_CONFIG_KEY {\n backgroundColor = 'backgroundColor',\n primaryColor = 'primaryColor',\n darkPrimaryColor = 'darkPrimaryColor',\n accentColor = 'accentColor',\n\n titleTextColor = 'titleTextColor',\n titleTextFont = 'titleTextFont',\n\n bodyTextColor = 'bodyTextColor',\n bodyTextFont = 'bodyTextFont',\n\n footnoteTextColor = 'footnoteTextColor',\n footnoteTextFont = 'footnoteTextFont',\n\n // formLabelTextColor = \"formLabelTextColor\",\n // formLabelTextFont = \"formLabelTextFont\",\n\n textFieldTextColor = 'textFieldTextColor',\n textFieldTextFont = 'textFieldTextFont',\n\n pickerTextColor = 'pickerTextColor',\n pickerTextFont = 'pickerTextFont',\n\n buttonBackgroundColor = 'buttonBackgroundColor',\n buttonDisabledBackgroundColor = 'buttonDisabledBackgroundColor',\n buttonTouchedBackgroundColor = 'buttonTouchedBackgroundColor',\n buttonTextColor = 'buttonTextColor',\n buttonDisabledTextColor = 'buttonDisabledTextColor',\n // buttonTextAlignment = \"buttonTextAlignment\",\n buttonCornerRadius = 'buttonCornerRadius',\n buttonFont = 'buttonFont',\n progressColor = 'progressColor',\n successAsset = 'successAsset',\n failAsset = 'failAsset',\n loadingAnimationAsset = 'loadingAnimationAsset',\n loadingAnimationWidthPercent = 'loadingAnimationWidthPercent',\n selfieAnimationAsset = 'selfieAnimationAsset',\n selfieAnimationWidthPercent = 'selfieAnimationWidthPercent',\n}\n\nexport enum IOS_THEME_CONFIG_KEY {\n backgroundColor = 'backgroundColor',\n primaryColor = 'primaryColor',\n darkPrimaryColor = 'darkPrimaryColor',\n accentColor = 'accentColor',\n errorColor = 'errorColor',\n errorTextFont = 'errorTextFont',\n overlayBackgroundColor = 'overlayBackgroundColor',\n titleTextAlignment = 'titleTextAlignment',\n titleTextColor = 'titleTextColor',\n titleTextFont = 'titleTextFont',\n cardTitleTextFont = 'cardTitleTextFont',\n bodyTextAlignment = 'bodyTextAlignment',\n bodyTextColor = 'bodyTextColor',\n bodyTextFont = 'bodyTextFont',\n footnoteTextColor = 'footnoteTextColor',\n footnoteTextFont = 'footnoteTextFont',\n formLabelTextColor = 'formLabelTextColor',\n formLabelTextFont = 'formLabelTextFont',\n textFieldTextColor = 'textFieldTextColor',\n textFieldBackgroundColor = 'textFieldBackgroundColor',\n textFieldBorderColor = 'textFieldBorderColor',\n textFieldCornerRadius = 'textFieldCornerRadius',\n textFieldFont = 'textFieldFont',\n textFieldPlaceholderFont = 'textFieldPlaceholderFont',\n pickerTextColor = 'pickerTextColor',\n pickerTextFont = 'pickerTextFont',\n buttonBackgroundColor = 'buttonBackgroundColor',\n buttonDisabledBackgroundColor = 'buttonDisabledBackgroundColor',\n buttonTouchedBackgroundColor = 'buttonTouchedBackgroundColor',\n buttonTextColor = 'buttonTextColor',\n buttonDisabledTextColor = 'buttonDisabledTextColor',\n buttonTextAlignment = 'buttonTextAlignment',\n buttonImageTintColor = 'buttonImageTintColor',\n buttonCornerRadius = 'buttonCornerRadius',\n buttonBorderWidth = 'buttonBorderWidth',\n buttonBorderColor = 'buttonBorderColor',\n buttonFont = 'buttonFont',\n buttonSecondaryBackgroundColor = 'buttonSecondaryBackgroundColor',\n buttonSecondaryDisabledBackgroundColor = 'buttonSecondaryDisabledBackgroundColor',\n buttonSecondaryTouchedBackgroundColor = 'buttonSecondaryTouchedBackgroundColor',\n buttonSecondaryTextColor = 'buttonSecondaryTextColor',\n buttonSecondaryDisabledTextColor = 'buttonSecondaryDisabledTextColor',\n buttonSecondaryTextAlignment = 'buttonSecondaryTextAlignment',\n buttonSecondaryImageTintColor = 'buttonSecondaryImageTintColor',\n buttonSecondaryCornerRadius = 'buttonSecondaryCornerRadius',\n buttonSecondaryBorderWidth = 'buttonSecondaryBorderWidth',\n buttonSecondaryBorderColor = 'buttonSecondaryBorderColor',\n buttonSecondaryFont = 'buttonSecondaryFont',\n selectedCellBackgroundColor = 'selectedCellBackgroundColor',\n closeButtonTintColor = 'closeButtonTintColor',\n cancelButtonBackgroundColor = 'cancelButtonBackgroundColor',\n cancelButtonTextColor = 'cancelButtonTextColor',\n cancelButtonAlternateBackgroundColor = 'cancelButtonAlternateBackgroundColor',\n cancelButtonAlternateTextColor = 'cancelButtonAlternateTextColor',\n processingLabelsTextAlignment = 'processingLabelsTextAlignment',\n loadingAnimationAssetName = 'loadingAnimationAssetName',\n loadingAnimationAssetWidth = 'loadingAnimationAssetWidth',\n loadingAnimationAssetHeight = 'loadingAnimationAssetHeight',\n processingAnimationAssetName = 'processingAnimationAssetName',\n processingAnimationAssetWidth = 'processingAnimationAssetWidth',\n processingAnimationAssetHeight = 'processingAnimationAssetHeight',\n selfieAnimationAssetName = 'selfieAnimationAssetName',\n selfieAnimationAssetWidth = 'selfieAnimationAssetWidth',\n selfieAnimationAssetHeight = 'selfieAnimationAssetHeight',\n}\n\nexport type AndroidThemeObject = {\n [key in ANDROID_THEME_CONFIG_KEY]: string | null | undefined;\n};\n\nexport type IosThemeObject = {\n [key in IOS_THEME_CONFIG_KEY]: string | null | undefined;\n};\n\nexport type ThemeObject = AndroidThemeObject | IosThemeObject;\n\nclass Theme {\n async print(platform: string = 'android') {\n const config = await Config.get();\n const themeConfig =\n platform === 'android' ? config.androidTheme : config.iosTheme;\n let usesCustomFontAndroid = false;\n let usesCustomFontIos = false;\n\n const head =\n platform === 'android'\n ? ['Style Item', 'Value', 'Note']\n : ['Style Item', 'Value', 'Note'];\n\n const table = new Table({\n head,\n // prettier-ignore\n chars: { 'mid': '', 'left-mid': '', 'mid-mid': '', 'right-mid': '' },\n });\n\n console.log('Specified theme values:');\n const keyEnum =\n platform === 'android' ? ANDROID_THEME_CONFIG_KEY : IOS_THEME_CONFIG_KEY;\n for (const key in keyEnum) {\n let override =\n themeConfig[key as ANDROID_THEME_CONFIG_KEY | IOS_THEME_CONFIG_KEY];\n let colorOverride = key.includes('Color') || key.includes('color');\n\n if (override) {\n if (colorOverride) {\n override = normalizeColor(override, key);\n } else {\n override = override.toString();\n }\n }\n\n if (key.includes('Font')) {\n if (platform == 'android') {\n usesCustomFontAndroid = true;\n } else {\n usesCustomFontIos = true;\n }\n }\n\n let row;\n\n row = [\n key,\n override\n ? valueColor(colorOverride, override)\n : chalk.yellow('unspecified'),\n key.includes('Font')\n ? chalk.cyan('Fonts that are not built-in need to be installed.')\n : '',\n ];\n\n table.push(row);\n }\n\n console.log(table.toString());\n\n if (usesCustomFontAndroid) {\n console.log(\n chalk.yellow(' NOTE') +\n ': A font customization was made. If the font is not built-in to the Android platform (https://github.com/react-native-training/react-native-fonts#android), then the font(s) must first be installed. A guide to install a font can be found here: https://developer.android.com/guide/topics/ui/look-and-feel/fonts-in-xml'\n );\n }\n\n if (usesCustomFontIos) {\n console.log(\n chalk.yellow(' NOTE') +\n ': A font customization was made. If the font is not built-in iOS (https://github.com/react-native-training/react-native-ios), then the font(s) must first be installed. A guide to install a font can be found here: https://developer.apple.com/documentation/uikit/text_display_and_fonts/adding_a_custom_font_to_your_app'\n );\n }\n\n // Add newline for spacing\n console.log('');\n }\n}\n\n// set default print color for non-color overrides\nfunction valueColor(isColorOverride: boolean, override: string) {\n return isColorOverride\n ? chalk.hex(override)(override)\n : chalk.magentaBright(override);\n}\n\nfunction normalizeColor(colorHex: string, themeKey: string) {\n let hex = colorHex;\n if (colorHex[0] === '#') {\n hex = colorHex.slice(1);\n }\n\n if (!COLOR_REGEX.test(hex)) {\n if (themeKey) {\n console.error(\n `Received a color value of ${chalk.yellow(colorHex)} for ${chalk.red(\n themeKey\n )}.\\nFormat must follow standard 6 character hexadecimal color code. Eg. ${chalk\n .bgHex('#FFFFFF')\n .hex('#7E66B7')('#290087')}`\n );\n } else {\n console.error(\n `Received a color value of ${chalk.yellow(\n colorHex\n )}.\\nFormat must follow standard 6 character hexadecimal color code. Eg. ${chalk\n .bgHex('#FFFFFF')\n .hex('#7E66B7')('#290087')}`\n );\n }\n console.log('');\n process.exit(1);\n }\n\n return colorHex;\n}\n\nexport default new Theme();\n"]}
@@ -42,9 +42,14 @@ export let IOS_THEME_CONFIG_KEY;
42
42
  IOS_THEME_CONFIG_KEY["primaryColor"] = "primaryColor";
43
43
  IOS_THEME_CONFIG_KEY["darkPrimaryColor"] = "darkPrimaryColor";
44
44
  IOS_THEME_CONFIG_KEY["accentColor"] = "accentColor";
45
+ IOS_THEME_CONFIG_KEY["errorColor"] = "errorColor";
46
+ IOS_THEME_CONFIG_KEY["errorTextFont"] = "errorTextFont";
45
47
  IOS_THEME_CONFIG_KEY["overlayBackgroundColor"] = "overlayBackgroundColor";
48
+ IOS_THEME_CONFIG_KEY["titleTextAlignment"] = "titleTextAlignment";
46
49
  IOS_THEME_CONFIG_KEY["titleTextColor"] = "titleTextColor";
47
50
  IOS_THEME_CONFIG_KEY["titleTextFont"] = "titleTextFont";
51
+ IOS_THEME_CONFIG_KEY["cardTitleTextFont"] = "cardTitleTextFont";
52
+ IOS_THEME_CONFIG_KEY["bodyTextAlignment"] = "bodyTextAlignment";
48
53
  IOS_THEME_CONFIG_KEY["bodyTextColor"] = "bodyTextColor";
49
54
  IOS_THEME_CONFIG_KEY["bodyTextFont"] = "bodyTextFont";
50
55
  IOS_THEME_CONFIG_KEY["footnoteTextColor"] = "footnoteTextColor";
@@ -54,32 +59,40 @@ export let IOS_THEME_CONFIG_KEY;
54
59
  IOS_THEME_CONFIG_KEY["textFieldTextColor"] = "textFieldTextColor";
55
60
  IOS_THEME_CONFIG_KEY["textFieldBackgroundColor"] = "textFieldBackgroundColor";
56
61
  IOS_THEME_CONFIG_KEY["textFieldBorderColor"] = "textFieldBorderColor";
62
+ IOS_THEME_CONFIG_KEY["textFieldCornerRadius"] = "textFieldCornerRadius";
63
+ IOS_THEME_CONFIG_KEY["textFieldFont"] = "textFieldFont";
64
+ IOS_THEME_CONFIG_KEY["textFieldPlaceholderFont"] = "textFieldPlaceholderFont";
57
65
  IOS_THEME_CONFIG_KEY["pickerTextColor"] = "pickerTextColor";
58
66
  IOS_THEME_CONFIG_KEY["pickerTextFont"] = "pickerTextFont";
59
67
  IOS_THEME_CONFIG_KEY["buttonBackgroundColor"] = "buttonBackgroundColor";
60
68
  IOS_THEME_CONFIG_KEY["buttonDisabledBackgroundColor"] = "buttonDisabledBackgroundColor";
61
69
  IOS_THEME_CONFIG_KEY["buttonTouchedBackgroundColor"] = "buttonTouchedBackgroundColor";
62
- IOS_THEME_CONFIG_KEY["buttonImageTintColor"] = "buttonImageTintColor";
63
70
  IOS_THEME_CONFIG_KEY["buttonTextColor"] = "buttonTextColor";
64
71
  IOS_THEME_CONFIG_KEY["buttonDisabledTextColor"] = "buttonDisabledTextColor";
65
72
  IOS_THEME_CONFIG_KEY["buttonTextAlignment"] = "buttonTextAlignment";
73
+ IOS_THEME_CONFIG_KEY["buttonImageTintColor"] = "buttonImageTintColor";
66
74
  IOS_THEME_CONFIG_KEY["buttonCornerRadius"] = "buttonCornerRadius";
75
+ IOS_THEME_CONFIG_KEY["buttonBorderWidth"] = "buttonBorderWidth";
76
+ IOS_THEME_CONFIG_KEY["buttonBorderColor"] = "buttonBorderColor";
67
77
  IOS_THEME_CONFIG_KEY["buttonFont"] = "buttonFont";
78
+ IOS_THEME_CONFIG_KEY["buttonSecondaryBackgroundColor"] = "buttonSecondaryBackgroundColor";
79
+ IOS_THEME_CONFIG_KEY["buttonSecondaryDisabledBackgroundColor"] = "buttonSecondaryDisabledBackgroundColor";
80
+ IOS_THEME_CONFIG_KEY["buttonSecondaryTouchedBackgroundColor"] = "buttonSecondaryTouchedBackgroundColor";
81
+ IOS_THEME_CONFIG_KEY["buttonSecondaryTextColor"] = "buttonSecondaryTextColor";
82
+ IOS_THEME_CONFIG_KEY["buttonSecondaryDisabledTextColor"] = "buttonSecondaryDisabledTextColor";
83
+ IOS_THEME_CONFIG_KEY["buttonSecondaryTextAlignment"] = "buttonSecondaryTextAlignment";
84
+ IOS_THEME_CONFIG_KEY["buttonSecondaryImageTintColor"] = "buttonSecondaryImageTintColor";
85
+ IOS_THEME_CONFIG_KEY["buttonSecondaryCornerRadius"] = "buttonSecondaryCornerRadius";
86
+ IOS_THEME_CONFIG_KEY["buttonSecondaryBorderWidth"] = "buttonSecondaryBorderWidth";
87
+ IOS_THEME_CONFIG_KEY["buttonSecondaryBorderColor"] = "buttonSecondaryBorderColor";
88
+ IOS_THEME_CONFIG_KEY["buttonSecondaryFont"] = "buttonSecondaryFont";
68
89
  IOS_THEME_CONFIG_KEY["selectedCellBackgroundColor"] = "selectedCellBackgroundColor";
69
90
  IOS_THEME_CONFIG_KEY["closeButtonTintColor"] = "closeButtonTintColor";
70
91
  IOS_THEME_CONFIG_KEY["cancelButtonBackgroundColor"] = "cancelButtonBackgroundColor";
71
- IOS_THEME_CONFIG_KEY["progressColor"] = "progressColor";
72
- IOS_THEME_CONFIG_KEY["cameraGuideCornersColor"] = "cameraGuideCornersColor";
73
- IOS_THEME_CONFIG_KEY["cameraButtonBackgroundColor"] = "cameraButtonBackgroundColor";
74
- IOS_THEME_CONFIG_KEY["successAssetName"] = "successAssetName";
75
- IOS_THEME_CONFIG_KEY["successAssetWidth"] = "successAssetWidth";
76
- IOS_THEME_CONFIG_KEY["successAssetHeight"] = "successAssetHeight";
77
- IOS_THEME_CONFIG_KEY["verificationFailAssetName"] = "verificationFailAssetName";
78
- IOS_THEME_CONFIG_KEY["verificationFailAssetWidth"] = "verificationFailAssetWidth";
79
- IOS_THEME_CONFIG_KEY["verificationFailAssetHeight"] = "verificationFailAssetHeight";
80
- IOS_THEME_CONFIG_KEY["failAssetName"] = "failAssetName";
81
- IOS_THEME_CONFIG_KEY["failAssetWidth"] = "failAssetWidth";
82
- IOS_THEME_CONFIG_KEY["failAssetHeight"] = "failAssetHeight";
92
+ IOS_THEME_CONFIG_KEY["cancelButtonTextColor"] = "cancelButtonTextColor";
93
+ IOS_THEME_CONFIG_KEY["cancelButtonAlternateBackgroundColor"] = "cancelButtonAlternateBackgroundColor";
94
+ IOS_THEME_CONFIG_KEY["cancelButtonAlternateTextColor"] = "cancelButtonAlternateTextColor";
95
+ IOS_THEME_CONFIG_KEY["processingLabelsTextAlignment"] = "processingLabelsTextAlignment";
83
96
  IOS_THEME_CONFIG_KEY["loadingAnimationAssetName"] = "loadingAnimationAssetName";
84
97
  IOS_THEME_CONFIG_KEY["loadingAnimationAssetWidth"] = "loadingAnimationAssetWidth";
85
98
  IOS_THEME_CONFIG_KEY["loadingAnimationAssetHeight"] = "loadingAnimationAssetHeight";
@@ -1 +1 @@
1
- {"version":3,"sources":["Theme.ts"],"names":["Table","chalk","Config","COLOR_REGEX","ANDROID_THEME_CONFIG_KEY","IOS_THEME_CONFIG_KEY","Theme","print","platform","config","get","themeConfig","androidTheme","iosTheme","usesCustomFontAndroid","usesCustomFontIos","head","table","chars","console","log","keyEnum","key","override","colorOverride","includes","normalizeColor","toString","row","valueColor","yellow","cyan","push","isColorOverride","hex","magentaBright","colorHex","themeKey","slice","test","error","red","bgHex","process","exit"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,WAAlB;AACA,OAAOC,KAAP,MAAkB,OAAlB;AAEA,OAAOC,MAAP,MAAmB,UAAnB;AAEA,MAAMC,WAAW,GAAG,kBAApB;AAEA,WAAYC,wBAAZ;;WAAYA,wB;AAAAA,EAAAA,wB;AAAAA,EAAAA,wB;AAAAA,EAAAA,wB;AAAAA,EAAAA,wB;AAAAA,EAAAA,wB;AAAAA,EAAAA,wB;AAAAA,EAAAA,wB;AAAAA,EAAAA,wB;AAAAA,EAAAA,wB;AAAAA,EAAAA,wB;AAAAA,EAAAA,wB;AAAAA,EAAAA,wB;AAAAA,EAAAA,wB;AAAAA,EAAAA,wB;AAAAA,EAAAA,wB;AAAAA,EAAAA,wB;AAAAA,EAAAA,wB;AAAAA,EAAAA,wB;AAAAA,EAAAA,wB;AAAAA,EAAAA,wB;AAAAA,EAAAA,wB;AAAAA,EAAAA,wB;AAAAA,EAAAA,wB;AAAAA,EAAAA,wB;AAAAA,EAAAA,wB;AAAAA,EAAAA,wB;AAAAA,EAAAA,wB;AAAAA,EAAAA,wB;GAAAA,wB,KAAAA,wB;;AAyCZ,WAAYC,oBAAZ;;WAAYA,oB;AAAAA,EAAAA,oB;AAAAA,EAAAA,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ADkE,EAExER,GAFwE,CAEpE,SAFoE,EAEzD,SAFyD,CAE9C,EAL/B;AAOD,KARD,MAQO;AACLf,MAAAA,OAAO,CAACqB,KAAR,CACG,6BAA4BvC,KAAK,CAAC6B,MAAN,CAC3BM,QAD2B,CAE3B,0EAAyEnC,KAAK,CAC7EyC,KADwE,CAClE,SADkE,EAExER,GAFwE,CAEpE,SAFoE,EAEzD,SAFyD,CAE9C,EAL/B;AAOD;;AACDf,IAAAA,OAAO,CAACC,GAAR,CAAY,EAAZ;AACAuB,IAAAA,OAAO,CAACC,IAAR,CAAa,CAAb;AACD;;AAED,SAAOR,QAAP;AACD;;AAED,eAAe,IAAI9B,KAAJ,EAAf","sourcesContent":["import Table from 'cli-table';\nimport chalk from 'chalk';\n\nimport Config from './Config';\n\nconst COLOR_REGEX = /^[a-zA-Z0-9]{6}$/;\n\nexport enum ANDROID_THEME_CONFIG_KEY {\n backgroundColor = 'backgroundColor',\n primaryColor = 'primaryColor',\n darkPrimaryColor = 'darkPrimaryColor',\n accentColor = 'accentColor',\n\n titleTextColor = 'titleTextColor',\n titleTextFont = 'titleTextFont',\n\n bodyTextColor = 'bodyTextColor',\n bodyTextFont = 'bodyTextFont',\n\n footnoteTextColor = 'footnoteTextColor',\n footnoteTextFont = 'footnoteTextFont',\n\n // formLabelTextColor = \"formLabelTextColor\",\n // formLabelTextFont = \"formLabelTextFont\",\n\n textFieldTextColor = 'textFieldTextColor',\n textFieldTextFont = 'textFieldTextFont',\n\n pickerTextColor = 'pickerTextColor',\n pickerTextFont = 'pickerTextFont',\n\n buttonBackgroundColor = 'buttonBackgroundColor',\n buttonDisabledBackgroundColor = 'buttonDisabledBackgroundColor',\n buttonTouchedBackgroundColor = 'buttonTouchedBackgroundColor',\n buttonTextColor = 'buttonTextColor',\n buttonDisabledTextColor = 'buttonDisabledTextColor',\n // buttonTextAlignment = \"buttonTextAlignment\",\n buttonCornerRadius = 'buttonCornerRadius',\n buttonFont = 'buttonFont',\n progressColor = 'progressColor',\n successAsset = 'successAsset',\n failAsset = 'failAsset',\n loadingAnimationAsset = 'loadingAnimationAsset',\n loadingAnimationWidthPercent = 'loadingAnimationWidthPercent',\n selfieAnimationAsset = 'selfieAnimationAsset',\n selfieAnimationWidthPercent = 'selfieAnimationWidthPercent',\n}\n\nexport enum IOS_THEME_CONFIG_KEY {\n backgroundColor = 'backgroundColor',\n primaryColor = 'primaryColor',\n darkPrimaryColor = 'darkPrimaryColor',\n accentColor = 'accentColor',\n overlayBackgroundColor = 'overlayBackgroundColor',\n titleTextColor = 'titleTextColor',\n titleTextFont = 'titleTextFont',\n bodyTextColor = 'bodyTextColor',\n bodyTextFont = 'bodyTextFont',\n footnoteTextColor = 'footnoteTextColor',\n footnoteTextFont = 'footnoteTextFont',\n formLabelTextColor = 'formLabelTextColor',\n formLabelTextFont = 'formLabelTextFont',\n textFieldTextColor = 'textFieldTextColor',\n textFieldBackgroundColor = 'textFieldBackgroundColor',\n textFieldBorderColor = 'textFieldBorderColor',\n pickerTextColor = 'pickerTextColor',\n pickerTextFont = 'pickerTextFont',\n buttonBackgroundColor = 'buttonBackgroundColor',\n buttonDisabledBackgroundColor = 'buttonDisabledBackgroundColor',\n buttonTouchedBackgroundColor = 'buttonTouchedBackgroundColor',\n buttonImageTintColor = 'buttonImageTintColor',\n buttonTextColor = 'buttonTextColor',\n buttonDisabledTextColor = 'buttonDisabledTextColor',\n buttonTextAlignment = 'buttonTextAlignment',\n buttonCornerRadius = 'buttonCornerRadius',\n buttonFont = 'buttonFont',\n selectedCellBackgroundColor = 'selectedCellBackgroundColor',\n closeButtonTintColor = 'closeButtonTintColor',\n cancelButtonBackgroundColor = 'cancelButtonBackgroundColor',\n progressColor = 'progressColor',\n cameraGuideCornersColor = 'cameraGuideCornersColor',\n cameraButtonBackgroundColor = 'cameraButtonBackgroundColor',\n successAssetName = 'successAssetName',\n successAssetWidth = 'successAssetWidth',\n successAssetHeight = 'successAssetHeight',\n verificationFailAssetName = 'verificationFailAssetName',\n verificationFailAssetWidth = 'verificationFailAssetWidth',\n verificationFailAssetHeight = 'verificationFailAssetHeight',\n failAssetName = 'failAssetName',\n failAssetWidth = 'failAssetWidth',\n failAssetHeight = 'failAssetHeight',\n loadingAnimationAssetName = 'loadingAnimationAssetName',\n loadingAnimationAssetWidth = 'loadingAnimationAssetWidth',\n loadingAnimationAssetHeight = 'loadingAnimationAssetHeight',\n processingAnimationAssetName = 'processingAnimationAssetName',\n processingAnimationAssetWidth = 'processingAnimationAssetWidth',\n processingAnimationAssetHeight = 'processingAnimationAssetHeight',\n selfieAnimationAssetName = 'selfieAnimationAssetName',\n selfieAnimationAssetWidth = 'selfieAnimationAssetWidth',\n selfieAnimationAssetHeight = 'selfieAnimationAssetHeight',\n}\n\nexport type AndroidThemeObject = {\n [key in ANDROID_THEME_CONFIG_KEY]: string | null | undefined;\n};\n\nexport type IosThemeObject = {\n [key in IOS_THEME_CONFIG_KEY]: string | null | undefined;\n};\n\nexport type ThemeObject = AndroidThemeObject | IosThemeObject;\n\nclass Theme {\n async print(platform: string = 'android') {\n const config = await Config.get();\n const themeConfig =\n platform === 'android' ? config.androidTheme : config.iosTheme;\n let usesCustomFontAndroid = false;\n let usesCustomFontIos = false;\n\n const head =\n platform === 'android'\n ? ['Style Item', 'Value', 'Note']\n : ['Style Item', 'Value', 'Note'];\n\n const table = new Table({\n head,\n // prettier-ignore\n chars: { 'mid': '', 'left-mid': '', 'mid-mid': '', 'right-mid': '' },\n });\n\n console.log('Specified theme values:');\n const keyEnum =\n platform === 'android' ? ANDROID_THEME_CONFIG_KEY : IOS_THEME_CONFIG_KEY;\n for (const key in keyEnum) {\n let override =\n themeConfig[key as ANDROID_THEME_CONFIG_KEY | IOS_THEME_CONFIG_KEY];\n let colorOverride = key.includes('Color') || key.includes('color');\n\n if (override) {\n if (colorOverride) {\n override = normalizeColor(override, key);\n } else {\n override = override.toString();\n }\n }\n\n if (key.includes('Font')) {\n if (platform == 'android') {\n usesCustomFontAndroid = true;\n } else {\n usesCustomFontIos = true;\n }\n }\n\n let row;\n\n row = [\n key,\n override\n ? valueColor(colorOverride, override)\n : chalk.yellow('unspecified'),\n key.includes('Font')\n ? chalk.cyan('Fonts that are not built-in need to be installed.')\n : '',\n ];\n\n table.push(row);\n }\n\n console.log(table.toString());\n\n if (usesCustomFontAndroid) {\n console.log(\n chalk.yellow(' NOTE') +\n ': A font customization was made. If the font is not built-in to the Android platform (https://github.com/react-native-training/react-native-fonts#android), then the font(s) must first be installed. A guide to install a font can be found here: https://developer.android.com/guide/topics/ui/look-and-feel/fonts-in-xml'\n );\n }\n\n if (usesCustomFontIos) {\n console.log(\n chalk.yellow(' NOTE') +\n ': A font customization was made. If the font is not built-in iOS (https://github.com/react-native-training/react-native-ios), then the font(s) must first be installed. A guide to install a font can be found here: https://developer.apple.com/documentation/uikit/text_display_and_fonts/adding_a_custom_font_to_your_app'\n );\n }\n\n // Add newline for spacing\n console.log('');\n }\n}\n\n// set default print color for non-color overrides\nfunction valueColor(isColorOverride: boolean, override: string) {\n return isColorOverride\n ? chalk.hex(override)(override)\n : chalk.magentaBright(override);\n}\n\nfunction normalizeColor(colorHex: string, themeKey: string) {\n let hex = colorHex;\n if (colorHex[0] === '#') {\n hex = colorHex.slice(1);\n }\n\n if (!COLOR_REGEX.test(hex)) {\n if (themeKey) {\n console.error(\n `Received a color value of ${chalk.yellow(colorHex)} for ${chalk.red(\n themeKey\n )}.\\nFormat must follow standard 6 character hexadecimal color code. Eg. ${chalk\n .bgHex('#FFFFFF')\n .hex('#7E66B7')('#290087')}`\n );\n } else {\n console.error(\n `Received a color value of ${chalk.yellow(\n colorHex\n )}.\\nFormat must follow standard 6 character hexadecimal color code. Eg. ${chalk\n .bgHex('#FFFFFF')\n .hex('#7E66B7')('#290087')}`\n );\n }\n console.log('');\n process.exit(1);\n }\n\n return colorHex;\n}\n\nexport default new Theme();\n"]}
1
+ {"version":3,"sources":["Theme.ts"],"names":["Table","chalk","Config","COLOR_REGEX","ANDROID_THEME_CONFIG_KEY","IOS_THEME_CONFIG_KEY","Theme","print","platform","config","get","themeConfig","androidTheme","iosTheme","usesCustomFontAndroid","usesCustomFontIos","head","table","chars","console","log","keyEnum","key","override","colorOverride","includes","normalizeColor","toString","row","valueColor","yellow","cyan","push","isColorOverride","hex","magentaBright","colorHex","themeKey","slice","test","error","red","bgHex","process","exit"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,WAAlB;AACA,OAAOC,KAAP,MAAkB,OAAlB;AAEA,OAAOC,MAAP,MAAmB,UAAnB;AAEA,MAAMC,WAAW,GAAG,kBAApB;AAEA,WAAYC,wBAAZ;;WAAYA,wB;AAAAA,EAAAA,wB;AAAAA,EAAAA,wB;AAAAA,EAAAA,wB;AAAAA,EAAAA,wB;AAAAA,EAAAA,wB;AAAAA,EAAAA,wB;AAAAA,EAAAA,wB;AAAAA,EAAAA,wB;AAAAA,EAAAA,wB;AAAAA,EAAAA,wB;AAAAA,EAAAA,wB;AAAAA,EAAAA,wB;AAAAA,EAAAA,wB;AAAAA,EAAAA,wB;AAAAA,EAAAA,wB;AAAAA,EAAAA,wB;AAAAA,EAAAA,wB;AAAAA,EAAAA,wB;AAAAA,EAAAA,wB;AAAAA,EAAAA,wB;AAAAA,EAAAA,wB;AAAAA,EAAAA,wB;AAAAA,EAAAA,wB;AAAAA,EAAAA,wB;AAAAA,EAAAA,wB;AAAAA,EAAAA,wB;AAAAA,EAAAA,wB;AAAAA,EAAAA,wB;GAAAA,wB,KAAAA,wB;;AAyCZ,WAAYC,oBAAZ;;WAAYA,oB;AAAAA,EAAAA,oB;AAAAA,EAAAA,oB;AAAAA,EAAAA,oB;AAAAA,EAAAA,oB;AAAAA,EAAAA,oB;AAAAA,EAAAA,oB;AAAAA,EAAAA,oB;AAAAA,EAAAA,oB;AAAAA,EAAAA,oB;AAAAA,EAAAA,oB;AAAAA,EAAAA,oB;AAAAA,EAAAA,oB;AAAAA,EAAAA,oB;AAAAA,EAAAA,oB;AAAAA,EAAAA,oB;AAA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ExER,GAFwE,CAEpE,SAFoE,EAEzD,SAFyD,CAE9C,EAL/B;AAOD,KARD,MAQO;AACLf,MAAAA,OAAO,CAACqB,KAAR,CACG,6BAA4BvC,KAAK,CAAC6B,MAAN,CAC3BM,QAD2B,CAE3B,0EAAyEnC,KAAK,CAC7EyC,KADwE,CAClE,SADkE,EAExER,GAFwE,CAEpE,SAFoE,EAEzD,SAFyD,CAE9C,EAL/B;AAOD;;AACDf,IAAAA,OAAO,CAACC,GAAR,CAAY,EAAZ;AACAuB,IAAAA,OAAO,CAACC,IAAR,CAAa,CAAb;AACD;;AAED,SAAOR,QAAP;AACD;;AAED,eAAe,IAAI9B,KAAJ,EAAf","sourcesContent":["import Table from 'cli-table';\nimport chalk from 'chalk';\n\nimport Config from './Config';\n\nconst COLOR_REGEX = /^[a-zA-Z0-9]{6}$/;\n\nexport enum ANDROID_THEME_CONFIG_KEY {\n backgroundColor = 'backgroundColor',\n primaryColor = 'primaryColor',\n darkPrimaryColor = 'darkPrimaryColor',\n accentColor = 'accentColor',\n\n titleTextColor = 'titleTextColor',\n titleTextFont = 'titleTextFont',\n\n bodyTextColor = 'bodyTextColor',\n bodyTextFont = 'bodyTextFont',\n\n footnoteTextColor = 'footnoteTextColor',\n footnoteTextFont = 'footnoteTextFont',\n\n // formLabelTextColor = \"formLabelTextColor\",\n // formLabelTextFont = \"formLabelTextFont\",\n\n textFieldTextColor = 'textFieldTextColor',\n textFieldTextFont = 'textFieldTextFont',\n\n pickerTextColor = 'pickerTextColor',\n pickerTextFont = 'pickerTextFont',\n\n buttonBackgroundColor = 'buttonBackgroundColor',\n buttonDisabledBackgroundColor = 'buttonDisabledBackgroundColor',\n buttonTouchedBackgroundColor = 'buttonTouchedBackgroundColor',\n buttonTextColor = 'buttonTextColor',\n buttonDisabledTextColor = 'buttonDisabledTextColor',\n // buttonTextAlignment = \"buttonTextAlignment\",\n buttonCornerRadius = 'buttonCornerRadius',\n buttonFont = 'buttonFont',\n progressColor = 'progressColor',\n successAsset = 'successAsset',\n failAsset = 'failAsset',\n loadingAnimationAsset = 'loadingAnimationAsset',\n loadingAnimationWidthPercent = 'loadingAnimationWidthPercent',\n selfieAnimationAsset = 'selfieAnimationAsset',\n selfieAnimationWidthPercent = 'selfieAnimationWidthPercent',\n}\n\nexport enum IOS_THEME_CONFIG_KEY {\n backgroundColor = 'backgroundColor',\n primaryColor = 'primaryColor',\n darkPrimaryColor = 'darkPrimaryColor',\n accentColor = 'accentColor',\n errorColor = 'errorColor',\n errorTextFont = 'errorTextFont',\n overlayBackgroundColor = 'overlayBackgroundColor',\n titleTextAlignment = 'titleTextAlignment',\n titleTextColor = 'titleTextColor',\n titleTextFont = 'titleTextFont',\n cardTitleTextFont = 'cardTitleTextFont',\n bodyTextAlignment = 'bodyTextAlignment',\n bodyTextColor = 'bodyTextColor',\n bodyTextFont = 'bodyTextFont',\n footnoteTextColor = 'footnoteTextColor',\n footnoteTextFont = 'footnoteTextFont',\n formLabelTextColor = 'formLabelTextColor',\n formLabelTextFont = 'formLabelTextFont',\n textFieldTextColor = 'textFieldTextColor',\n textFieldBackgroundColor = 'textFieldBackgroundColor',\n textFieldBorderColor = 'textFieldBorderColor',\n textFieldCornerRadius = 'textFieldCornerRadius',\n textFieldFont = 'textFieldFont',\n textFieldPlaceholderFont = 'textFieldPlaceholderFont',\n pickerTextColor = 'pickerTextColor',\n pickerTextFont = 'pickerTextFont',\n buttonBackgroundColor = 'buttonBackgroundColor',\n buttonDisabledBackgroundColor = 'buttonDisabledBackgroundColor',\n buttonTouchedBackgroundColor = 'buttonTouchedBackgroundColor',\n buttonTextColor = 'buttonTextColor',\n buttonDisabledTextColor = 'buttonDisabledTextColor',\n buttonTextAlignment = 'buttonTextAlignment',\n buttonImageTintColor = 'buttonImageTintColor',\n buttonCornerRadius = 'buttonCornerRadius',\n buttonBorderWidth = 'buttonBorderWidth',\n buttonBorderColor = 'buttonBorderColor',\n buttonFont = 'buttonFont',\n buttonSecondaryBackgroundColor = 'buttonSecondaryBackgroundColor',\n buttonSecondaryDisabledBackgroundColor = 'buttonSecondaryDisabledBackgroundColor',\n buttonSecondaryTouchedBackgroundColor = 'buttonSecondaryTouchedBackgroundColor',\n buttonSecondaryTextColor = 'buttonSecondaryTextColor',\n buttonSecondaryDisabledTextColor = 'buttonSecondaryDisabledTextColor',\n buttonSecondaryTextAlignment = 'buttonSecondaryTextAlignment',\n buttonSecondaryImageTintColor = 'buttonSecondaryImageTintColor',\n buttonSecondaryCornerRadius = 'buttonSecondaryCornerRadius',\n buttonSecondaryBorderWidth = 'buttonSecondaryBorderWidth',\n buttonSecondaryBorderColor = 'buttonSecondaryBorderColor',\n buttonSecondaryFont = 'buttonSecondaryFont',\n selectedCellBackgroundColor = 'selectedCellBackgroundColor',\n closeButtonTintColor = 'closeButtonTintColor',\n cancelButtonBackgroundColor = 'cancelButtonBackgroundColor',\n cancelButtonTextColor = 'cancelButtonTextColor',\n cancelButtonAlternateBackgroundColor = 'cancelButtonAlternateBackgroundColor',\n cancelButtonAlternateTextColor = 'cancelButtonAlternateTextColor',\n processingLabelsTextAlignment = 'processingLabelsTextAlignment',\n loadingAnimationAssetName = 'loadingAnimationAssetName',\n loadingAnimationAssetWidth = 'loadingAnimationAssetWidth',\n loadingAnimationAssetHeight = 'loadingAnimationAssetHeight',\n processingAnimationAssetName = 'processingAnimationAssetName',\n processingAnimationAssetWidth = 'processingAnimationAssetWidth',\n processingAnimationAssetHeight = 'processingAnimationAssetHeight',\n selfieAnimationAssetName = 'selfieAnimationAssetName',\n selfieAnimationAssetWidth = 'selfieAnimationAssetWidth',\n selfieAnimationAssetHeight = 'selfieAnimationAssetHeight',\n}\n\nexport type AndroidThemeObject = {\n [key in ANDROID_THEME_CONFIG_KEY]: string | null | undefined;\n};\n\nexport type IosThemeObject = {\n [key in IOS_THEME_CONFIG_KEY]: string | null | undefined;\n};\n\nexport type ThemeObject = AndroidThemeObject | IosThemeObject;\n\nclass Theme {\n async print(platform: string = 'android') {\n const config = await Config.get();\n const themeConfig =\n platform === 'android' ? config.androidTheme : config.iosTheme;\n let usesCustomFontAndroid = false;\n let usesCustomFontIos = false;\n\n const head =\n platform === 'android'\n ? ['Style Item', 'Value', 'Note']\n : ['Style Item', 'Value', 'Note'];\n\n const table = new Table({\n head,\n // prettier-ignore\n chars: { 'mid': '', 'left-mid': '', 'mid-mid': '', 'right-mid': '' },\n });\n\n console.log('Specified theme values:');\n const keyEnum =\n platform === 'android' ? ANDROID_THEME_CONFIG_KEY : IOS_THEME_CONFIG_KEY;\n for (const key in keyEnum) {\n let override =\n themeConfig[key as ANDROID_THEME_CONFIG_KEY | IOS_THEME_CONFIG_KEY];\n let colorOverride = key.includes('Color') || key.includes('color');\n\n if (override) {\n if (colorOverride) {\n override = normalizeColor(override, key);\n } else {\n override = override.toString();\n }\n }\n\n if (key.includes('Font')) {\n if (platform == 'android') {\n usesCustomFontAndroid = true;\n } else {\n usesCustomFontIos = true;\n }\n }\n\n let row;\n\n row = [\n key,\n override\n ? valueColor(colorOverride, override)\n : chalk.yellow('unspecified'),\n key.includes('Font')\n ? chalk.cyan('Fonts that are not built-in need to be installed.')\n : '',\n ];\n\n table.push(row);\n }\n\n console.log(table.toString());\n\n if (usesCustomFontAndroid) {\n console.log(\n chalk.yellow(' NOTE') +\n ': A font customization was made. If the font is not built-in to the Android platform (https://github.com/react-native-training/react-native-fonts#android), then the font(s) must first be installed. A guide to install a font can be found here: https://developer.android.com/guide/topics/ui/look-and-feel/fonts-in-xml'\n );\n }\n\n if (usesCustomFontIos) {\n console.log(\n chalk.yellow(' NOTE') +\n ': A font customization was made. If the font is not built-in iOS (https://github.com/react-native-training/react-native-ios), then the font(s) must first be installed. A guide to install a font can be found here: https://developer.apple.com/documentation/uikit/text_display_and_fonts/adding_a_custom_font_to_your_app'\n );\n }\n\n // Add newline for spacing\n console.log('');\n }\n}\n\n// set default print color for non-color overrides\nfunction valueColor(isColorOverride: boolean, override: string) {\n return isColorOverride\n ? chalk.hex(override)(override)\n : chalk.magentaBright(override);\n}\n\nfunction normalizeColor(colorHex: string, themeKey: string) {\n let hex = colorHex;\n if (colorHex[0] === '#') {\n hex = colorHex.slice(1);\n }\n\n if (!COLOR_REGEX.test(hex)) {\n if (themeKey) {\n console.error(\n `Received a color value of ${chalk.yellow(colorHex)} for ${chalk.red(\n themeKey\n )}.\\nFormat must follow standard 6 character hexadecimal color code. Eg. ${chalk\n .bgHex('#FFFFFF')\n .hex('#7E66B7')('#290087')}`\n );\n } else {\n console.error(\n `Received a color value of ${chalk.yellow(\n colorHex\n )}.\\nFormat must follow standard 6 character hexadecimal color code. Eg. ${chalk\n .bgHex('#FFFFFF')\n .hex('#7E66B7')('#290087')}`\n );\n }\n console.log('');\n process.exit(1);\n }\n\n return colorHex;\n}\n\nexport default new Theme();\n"]}
@@ -33,9 +33,14 @@ export declare enum IOS_THEME_CONFIG_KEY {
33
33
  primaryColor = "primaryColor",
34
34
  darkPrimaryColor = "darkPrimaryColor",
35
35
  accentColor = "accentColor",
36
+ errorColor = "errorColor",
37
+ errorTextFont = "errorTextFont",
36
38
  overlayBackgroundColor = "overlayBackgroundColor",
39
+ titleTextAlignment = "titleTextAlignment",
37
40
  titleTextColor = "titleTextColor",
38
41
  titleTextFont = "titleTextFont",
42
+ cardTitleTextFont = "cardTitleTextFont",
43
+ bodyTextAlignment = "bodyTextAlignment",
39
44
  bodyTextColor = "bodyTextColor",
40
45
  bodyTextFont = "bodyTextFont",
41
46
  footnoteTextColor = "footnoteTextColor",
@@ -45,32 +50,40 @@ export declare enum IOS_THEME_CONFIG_KEY {
45
50
  textFieldTextColor = "textFieldTextColor",
46
51
  textFieldBackgroundColor = "textFieldBackgroundColor",
47
52
  textFieldBorderColor = "textFieldBorderColor",
53
+ textFieldCornerRadius = "textFieldCornerRadius",
54
+ textFieldFont = "textFieldFont",
55
+ textFieldPlaceholderFont = "textFieldPlaceholderFont",
48
56
  pickerTextColor = "pickerTextColor",
49
57
  pickerTextFont = "pickerTextFont",
50
58
  buttonBackgroundColor = "buttonBackgroundColor",
51
59
  buttonDisabledBackgroundColor = "buttonDisabledBackgroundColor",
52
60
  buttonTouchedBackgroundColor = "buttonTouchedBackgroundColor",
53
- buttonImageTintColor = "buttonImageTintColor",
54
61
  buttonTextColor = "buttonTextColor",
55
62
  buttonDisabledTextColor = "buttonDisabledTextColor",
56
63
  buttonTextAlignment = "buttonTextAlignment",
64
+ buttonImageTintColor = "buttonImageTintColor",
57
65
  buttonCornerRadius = "buttonCornerRadius",
66
+ buttonBorderWidth = "buttonBorderWidth",
67
+ buttonBorderColor = "buttonBorderColor",
58
68
  buttonFont = "buttonFont",
69
+ buttonSecondaryBackgroundColor = "buttonSecondaryBackgroundColor",
70
+ buttonSecondaryDisabledBackgroundColor = "buttonSecondaryDisabledBackgroundColor",
71
+ buttonSecondaryTouchedBackgroundColor = "buttonSecondaryTouchedBackgroundColor",
72
+ buttonSecondaryTextColor = "buttonSecondaryTextColor",
73
+ buttonSecondaryDisabledTextColor = "buttonSecondaryDisabledTextColor",
74
+ buttonSecondaryTextAlignment = "buttonSecondaryTextAlignment",
75
+ buttonSecondaryImageTintColor = "buttonSecondaryImageTintColor",
76
+ buttonSecondaryCornerRadius = "buttonSecondaryCornerRadius",
77
+ buttonSecondaryBorderWidth = "buttonSecondaryBorderWidth",
78
+ buttonSecondaryBorderColor = "buttonSecondaryBorderColor",
79
+ buttonSecondaryFont = "buttonSecondaryFont",
59
80
  selectedCellBackgroundColor = "selectedCellBackgroundColor",
60
81
  closeButtonTintColor = "closeButtonTintColor",
61
82
  cancelButtonBackgroundColor = "cancelButtonBackgroundColor",
62
- progressColor = "progressColor",
63
- cameraGuideCornersColor = "cameraGuideCornersColor",
64
- cameraButtonBackgroundColor = "cameraButtonBackgroundColor",
65
- successAssetName = "successAssetName",
66
- successAssetWidth = "successAssetWidth",
67
- successAssetHeight = "successAssetHeight",
68
- verificationFailAssetName = "verificationFailAssetName",
69
- verificationFailAssetWidth = "verificationFailAssetWidth",
70
- verificationFailAssetHeight = "verificationFailAssetHeight",
71
- failAssetName = "failAssetName",
72
- failAssetWidth = "failAssetWidth",
73
- failAssetHeight = "failAssetHeight",
83
+ cancelButtonTextColor = "cancelButtonTextColor",
84
+ cancelButtonAlternateBackgroundColor = "cancelButtonAlternateBackgroundColor",
85
+ cancelButtonAlternateTextColor = "cancelButtonAlternateTextColor",
86
+ processingLabelsTextAlignment = "processingLabelsTextAlignment",
74
87
  loadingAnimationAssetName = "loadingAnimationAssetName",
75
88
  loadingAnimationAssetWidth = "loadingAnimationAssetWidth",
76
89
  loadingAnimationAssetHeight = "loadingAnimationAssetHeight",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "react-native-persona",
3
3
  "title": "React Native Persona",
4
- "version": "2.2.15",
4
+ "version": "2.2.18",
5
5
  "description": "Launch a mobile native implementation of the Persona inquiry flow from React Native.",
6
6
  "main": "lib/commonjs/index",
7
7
  "module": "lib/module/index",
@@ -51,9 +51,14 @@ export enum IOS_THEME_CONFIG_KEY {
51
51
  primaryColor = 'primaryColor',
52
52
  darkPrimaryColor = 'darkPrimaryColor',
53
53
  accentColor = 'accentColor',
54
+ errorColor = 'errorColor',
55
+ errorTextFont = 'errorTextFont',
54
56
  overlayBackgroundColor = 'overlayBackgroundColor',
57
+ titleTextAlignment = 'titleTextAlignment',
55
58
  titleTextColor = 'titleTextColor',
56
59
  titleTextFont = 'titleTextFont',
60
+ cardTitleTextFont = 'cardTitleTextFont',
61
+ bodyTextAlignment = 'bodyTextAlignment',
57
62
  bodyTextColor = 'bodyTextColor',
58
63
  bodyTextFont = 'bodyTextFont',
59
64
  footnoteTextColor = 'footnoteTextColor',
@@ -63,32 +68,40 @@ export enum IOS_THEME_CONFIG_KEY {
63
68
  textFieldTextColor = 'textFieldTextColor',
64
69
  textFieldBackgroundColor = 'textFieldBackgroundColor',
65
70
  textFieldBorderColor = 'textFieldBorderColor',
71
+ textFieldCornerRadius = 'textFieldCornerRadius',
72
+ textFieldFont = 'textFieldFont',
73
+ textFieldPlaceholderFont = 'textFieldPlaceholderFont',
66
74
  pickerTextColor = 'pickerTextColor',
67
75
  pickerTextFont = 'pickerTextFont',
68
76
  buttonBackgroundColor = 'buttonBackgroundColor',
69
77
  buttonDisabledBackgroundColor = 'buttonDisabledBackgroundColor',
70
78
  buttonTouchedBackgroundColor = 'buttonTouchedBackgroundColor',
71
- buttonImageTintColor = 'buttonImageTintColor',
72
79
  buttonTextColor = 'buttonTextColor',
73
80
  buttonDisabledTextColor = 'buttonDisabledTextColor',
74
81
  buttonTextAlignment = 'buttonTextAlignment',
82
+ buttonImageTintColor = 'buttonImageTintColor',
75
83
  buttonCornerRadius = 'buttonCornerRadius',
84
+ buttonBorderWidth = 'buttonBorderWidth',
85
+ buttonBorderColor = 'buttonBorderColor',
76
86
  buttonFont = 'buttonFont',
87
+ buttonSecondaryBackgroundColor = 'buttonSecondaryBackgroundColor',
88
+ buttonSecondaryDisabledBackgroundColor = 'buttonSecondaryDisabledBackgroundColor',
89
+ buttonSecondaryTouchedBackgroundColor = 'buttonSecondaryTouchedBackgroundColor',
90
+ buttonSecondaryTextColor = 'buttonSecondaryTextColor',
91
+ buttonSecondaryDisabledTextColor = 'buttonSecondaryDisabledTextColor',
92
+ buttonSecondaryTextAlignment = 'buttonSecondaryTextAlignment',
93
+ buttonSecondaryImageTintColor = 'buttonSecondaryImageTintColor',
94
+ buttonSecondaryCornerRadius = 'buttonSecondaryCornerRadius',
95
+ buttonSecondaryBorderWidth = 'buttonSecondaryBorderWidth',
96
+ buttonSecondaryBorderColor = 'buttonSecondaryBorderColor',
97
+ buttonSecondaryFont = 'buttonSecondaryFont',
77
98
  selectedCellBackgroundColor = 'selectedCellBackgroundColor',
78
99
  closeButtonTintColor = 'closeButtonTintColor',
79
100
  cancelButtonBackgroundColor = 'cancelButtonBackgroundColor',
80
- progressColor = 'progressColor',
81
- cameraGuideCornersColor = 'cameraGuideCornersColor',
82
- cameraButtonBackgroundColor = 'cameraButtonBackgroundColor',
83
- successAssetName = 'successAssetName',
84
- successAssetWidth = 'successAssetWidth',
85
- successAssetHeight = 'successAssetHeight',
86
- verificationFailAssetName = 'verificationFailAssetName',
87
- verificationFailAssetWidth = 'verificationFailAssetWidth',
88
- verificationFailAssetHeight = 'verificationFailAssetHeight',
89
- failAssetName = 'failAssetName',
90
- failAssetWidth = 'failAssetWidth',
91
- failAssetHeight = 'failAssetHeight',
101
+ cancelButtonTextColor = 'cancelButtonTextColor',
102
+ cancelButtonAlternateBackgroundColor = 'cancelButtonAlternateBackgroundColor',
103
+ cancelButtonAlternateTextColor = 'cancelButtonAlternateTextColor',
104
+ processingLabelsTextAlignment = 'processingLabelsTextAlignment',
92
105
  loadingAnimationAssetName = 'loadingAnimationAssetName',
93
106
  loadingAnimationAssetWidth = 'loadingAnimationAssetWidth',
94
107
  loadingAnimationAssetHeight = 'loadingAnimationAssetHeight',