react-native-persona 2.9.1 → 2.9.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/README.md +0 -42
  2. package/RNPersonaInquiry2.podspec +1 -1
  3. package/android/build.gradle +1 -1
  4. package/lib/commonjs/index.js +1 -0
  5. package/lib/commonjs/index.js.map +1 -1
  6. package/lib/module/index.js +1 -0
  7. package/lib/module/index.js.map +1 -1
  8. package/package.json +1 -12
  9. package/bin/persona-tool +0 -3
  10. package/lib/commonjs/persona-tool/AndroidResourcePrinter.js +0 -462
  11. package/lib/commonjs/persona-tool/AndroidResourcePrinter.js.map +0 -1
  12. package/lib/commonjs/persona-tool/Config.js +0 -78
  13. package/lib/commonjs/persona-tool/Config.js.map +0 -1
  14. package/lib/commonjs/persona-tool/Theme.js +0 -188
  15. package/lib/commonjs/persona-tool/Theme.js.map +0 -1
  16. package/lib/commonjs/persona-tool/index.js +0 -31
  17. package/lib/commonjs/persona-tool/index.js.map +0 -1
  18. package/lib/commonjs/persona-tool/prompts.js +0 -42
  19. package/lib/commonjs/persona-tool/prompts.js.map +0 -1
  20. package/lib/commonjs/persona-tool/tools/AndroidThemeGenerator.js +0 -74
  21. package/lib/commonjs/persona-tool/tools/AndroidThemeGenerator.js.map +0 -1
  22. package/lib/commonjs/persona-tool/tools/IosThemeInstructions.js +0 -40
  23. package/lib/commonjs/persona-tool/tools/IosThemeInstructions.js.map +0 -1
  24. package/lib/module/persona-tool/AndroidResourcePrinter.js +0 -455
  25. package/lib/module/persona-tool/AndroidResourcePrinter.js.map +0 -1
  26. package/lib/module/persona-tool/Config.js +0 -70
  27. package/lib/module/persona-tool/Config.js.map +0 -1
  28. package/lib/module/persona-tool/Theme.js +0 -178
  29. package/lib/module/persona-tool/Theme.js.map +0 -1
  30. package/lib/module/persona-tool/index.js +0 -28
  31. package/lib/module/persona-tool/index.js.map +0 -1
  32. package/lib/module/persona-tool/prompts.js +0 -31
  33. package/lib/module/persona-tool/prompts.js.map +0 -1
  34. package/lib/module/persona-tool/tools/AndroidThemeGenerator.js +0 -66
  35. package/lib/module/persona-tool/tools/AndroidThemeGenerator.js.map +0 -1
  36. package/lib/module/persona-tool/tools/IosThemeInstructions.js +0 -32
  37. package/lib/module/persona-tool/tools/IosThemeInstructions.js.map +0 -1
  38. package/lib/typescript/persona-tool/AndroidResourcePrinter.d.ts +0 -35
  39. package/lib/typescript/persona-tool/Config.d.ts +0 -15
  40. package/lib/typescript/persona-tool/Theme.d.ts +0 -108
  41. package/lib/typescript/persona-tool/index.d.ts +0 -1
  42. package/lib/typescript/persona-tool/prompts.d.ts +0 -8
  43. package/lib/typescript/persona-tool/tools/AndroidThemeGenerator.d.ts +0 -5
  44. package/lib/typescript/persona-tool/tools/IosThemeInstructions.d.ts +0 -5
  45. package/src/persona-tool/AndroidResourcePrinter.ts +0 -652
  46. package/src/persona-tool/Config.ts +0 -86
  47. package/src/persona-tool/Theme.ts +0 -243
  48. package/src/persona-tool/index.ts +0 -30
  49. package/src/persona-tool/prompts.ts +0 -36
  50. package/src/persona-tool/tools/AndroidThemeGenerator.ts +0 -100
  51. package/src/persona-tool/tools/IosThemeInstructions.ts +0 -41
@@ -1,462 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _xmlbuilder = require("xmlbuilder2");
8
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
9
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
10
- function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
11
- class AndroidResourcePrinter {
12
- constructor(theme) {
13
- _defineProperty(this, "theme", void 0);
14
- _defineProperty(this, "root", void 0);
15
- _defineProperty(this, "buttonDrawable", void 0);
16
- _defineProperty(this, "buttonColor", void 0);
17
- _defineProperty(this, "preprintQueue", []);
18
- _defineProperty(this, "printQueue", []);
19
- _defineProperty(this, "postPrintQueue", []);
20
- this.theme = theme;
21
- this.root = (0, _xmlbuilder.create)({
22
- version: '1.0'
23
- }).ele('resources');
24
- this.buttonDrawable = (0, _xmlbuilder.create)({
25
- version: '1.0'
26
- }).ele('selector', {
27
- 'xmlns:android': 'http://schemas.android.com/apk/res/android'
28
- });
29
- this.buttonColor = (0, _xmlbuilder.create)({
30
- version: '1.0'
31
- }).ele('selector', {
32
- 'xmlns:android': 'http://schemas.android.com/apk/res/android'
33
- });
34
- }
35
- process() {
36
- if (!this.hasTheme()) {
37
- this.root = this.root.up();
38
- } else {
39
- this.print();
40
- }
41
- return {
42
- style: this.root,
43
- buttonDrawable: this.buttonDrawable,
44
- buttonColor: this.buttonColor
45
- };
46
- }
47
- print() {
48
- this.primaryColor();
49
- this.accentColor();
50
- this.darkPrimaryColor();
51
- this.backgroundColor();
52
- this.titleText();
53
- this.bodyText();
54
- this.footnoteText();
55
- // this.formLabelText();
56
- this.textField();
57
- this.pickerText();
58
- this.button();
59
- this.progressColor();
60
- this.successAsset();
61
- this.failAsset();
62
- this.loadingAnimationAsset();
63
- this.selfieAnimationAsset();
64
- this.preprintQueue.forEach(fn => fn());
65
-
66
- // Precreate some style namespaces
67
- this.root = this.root.ele('style', {
68
- name: 'RN'
69
- }).up();
70
- this.root = this.root.ele('style', {
71
- name: 'RN.Persona'
72
- }).up();
73
- this.root = this.root.ele('style', {
74
- name: 'RN.Persona.Text'
75
- }).up();
76
- this.root = this.root.ele('style', {
77
- name: 'Persona.Inquiry2.Theme',
78
- parent: 'Base.Persona.Inquiry2.Theme'
79
- });
80
- this.printQueue.forEach(fn => fn());
81
- this.root = this.root.up();
82
- this.postPrintQueue.forEach(fn => fn());
83
- }
84
- hasTheme() {
85
- return Object.keys(this.theme).length > 0 && Object.values(this.theme).filter(Boolean).length > 0;
86
- }
87
- primaryColor() {
88
- if (!this.theme.primaryColor) return;
89
- this.printQueue.push(() => {
90
- this.root = this.root.ele('item', {
91
- name: 'colorPrimary'
92
- }).txt(this.theme.primaryColor).up().txt(' ');
93
- });
94
- }
95
- accentColor() {
96
- if (!this.theme.accentColor) return;
97
- this.printQueue.push(() => {
98
- this.root = this.root.ele('item', {
99
- name: 'colorSecondary'
100
- }).txt(this.theme.accentColor).up().txt(' ');
101
- });
102
- }
103
- darkPrimaryColor() {
104
- if (!this.theme.darkPrimaryColor) return;
105
- this.printQueue.push(() => {
106
- this.root = this.root.ele('item', {
107
- name: 'colorPrimaryVariant'
108
- }).txt(this.theme.darkPrimaryColor).up().txt(' ');
109
- });
110
- }
111
- backgroundColor() {
112
- if (!this.theme.backgroundColor) return;
113
- this.preprintQueue.push(() => {
114
- this.root = this.root.ele('color', {
115
- name: 'customPersonaBackgroundColor'
116
- }).txt(this.theme.backgroundColor).up().txt(' ');
117
- });
118
- this.printQueue.push(() => {
119
- this.root = this.root.ele('item', {
120
- name: 'android:colorBackground'
121
- }).txt('@color/customPersonaBackgroundColor').up().txt(' ');
122
- });
123
- }
124
- titleText() {
125
- if (this.theme.titleTextColor || this.theme.titleTextFont) {
126
- this.printQueue.push(() => {
127
- this.root = this.root.ele('item', {
128
- name: 'textAppearanceHeadline6'
129
- }).txt('@style/RN.Persona.Text.Title').up();
130
- });
131
-
132
- // Create a text appearance
133
- this.postPrintQueue.push(() => {
134
- this.root = this.root.ele('style', {
135
- name: 'RN.Persona.Text.Title',
136
- parent: 'Persona.Inquiry2.Text.Body'
137
- });
138
- if (this.theme.titleTextColor) {
139
- this.root = this.root.ele('item', {
140
- name: 'android:textColor'
141
- }).txt(this.theme.titleTextColor).up();
142
- }
143
- if (this.theme.titleTextFont) {
144
- // TODO: Add notice about how to add a custom font that can be
145
- // referenced here on Android
146
- this.root = this.root.ele('item', {
147
- name: 'android:fontFamily'
148
- }).txt(this.theme.titleTextFont).up();
149
- }
150
-
151
- // Default values taken from `Persona.Text.Title`
152
- // in shared/src/main/res/values/styles.xml
153
- this.root = this.root.ele('item', {
154
- name: 'android:textSize'
155
- }).txt('26sp').up().ele('item', {
156
- name: 'android:textStyle'
157
- }).txt('bold').up();
158
- this.root = this.root.up();
159
- });
160
- } else {
161
- this.printQueue.push(() => {
162
- this.root = this.root.ele('item', {
163
- name: 'textAppearanceHeadline6'
164
- }).txt('@style/Persona.Text.Title').up();
165
- });
166
- }
167
- }
168
- bodyText() {
169
- if (this.theme.bodyTextColor || this.theme.bodyTextFont) {
170
- this.printQueue.push(() => {
171
- this.root = this.root.ele('item', {
172
- name: 'textAppearanceSubtitle1'
173
- }).txt('@style/RN.Persona.Text.Body').up();
174
- });
175
-
176
- // Create a text appearance
177
- this.postPrintQueue.push(() => {
178
- this.root = this.root.ele('style', {
179
- name: 'RN.Persona.Text.Body',
180
- parent: 'Persona.Inquiry2.Text.Body'
181
- });
182
- if (this.theme.bodyTextColor) {
183
- this.root = this.root.ele('item', {
184
- name: 'android:textColor'
185
- }).txt(this.theme.bodyTextColor).up();
186
- }
187
- if (this.theme.bodyTextFont) {
188
- // TODO: Add notice about how to add a custom font that can be
189
- // referenced here on Android
190
- this.root = this.root.ele('item', {
191
- name: 'android:fontFamily'
192
- }).txt(this.theme.bodyTextFont).up();
193
- }
194
-
195
- // Default values taken from `Persona.Text.Body`
196
- // in shared/src/main/res/values/styles.xml
197
- this.root = this.root.ele('item', {
198
- name: 'android:textSize'
199
- }).txt('18sp').up();
200
- this.root = this.root.up();
201
- });
202
- } else {
203
- this.printQueue.push(() => {
204
- this.root = this.root.ele('item', {
205
- name: 'textAppearanceSubtitle1'
206
- }).txt('@style/Persona.Inquiry2.Text.Body').up();
207
- });
208
- }
209
- }
210
- footnoteText() {
211
- if (this.theme.footnoteTextColor || this.theme.footnoteTextFont) {
212
- this.postPrintQueue.push(() => {
213
- this.root = this.root.ele('style', {
214
- name: 'TextAppearance.AppCompat.Small'
215
- }).ele('item', {
216
- name: 'android:textSize'
217
- })
218
- // Used default value found in the Android SDK
219
- .txt('@dimen/abc_text_size_small_material').up().ele('item', {
220
- name: 'android:textColor'
221
- }).txt(
222
- // Used default value found in the Android SDK
223
- this.theme.footnoteTextColor ?? '?android:attr/textColorTertiary').up();
224
- if (this.theme.footnoteTextFont) {
225
- this.root = this.root.ele('item', {
226
- name: 'android:fontFamily'
227
- }).txt(
228
- // Used default value found in the Android SDK
229
- this.theme.footnoteTextFont ?? '?android:attr/textColorTertiary').up();
230
- }
231
- this.root = this.root.up();
232
- });
233
- }
234
- }
235
- textField() {
236
- if (this.theme.textFieldTextColor || this.theme.textFieldTextFont) {
237
- this.printQueue.push(() => {
238
- this.root = this.root.ele('item', {
239
- name: 'editTextStyle'
240
- }).txt('@style/RN.Persona.EditText').up();
241
- });
242
- this.postPrintQueue.push(() => {
243
- this.root = this.root.ele('style', {
244
- name: 'RN.Persona.EditText',
245
- parent: 'Persona.Inquiry2.EditText'
246
- }).ele('item', {
247
- name: 'android:textAppearance'
248
- }).txt('@style/RN.Persona.EditText.TextAppearance').up().ele('item', {
249
- name: 'android:textColor'
250
- }).txt(this.theme.textFieldTextColor).up().up();
251
- this.root = this.root.ele('style', {
252
- name: 'RN.Persona.EditText.TextAppearance',
253
- parent: 'Base.TextAppearance.TextAppearance.MaterialComponents.Body1'
254
- });
255
- if (this.theme.textFieldTextColor) {
256
- this.root = this.root.ele('item', {
257
- name: 'android:textSize'
258
- }).txt('18sp').up();
259
- }
260
- if (this.theme.textFieldTextFont) {
261
- this.root = this.root.ele('item', {
262
- name: 'android:fontFamily'
263
- }).txt(this.theme.textFieldTextFont).up();
264
- }
265
- this.root = this.root.up();
266
- });
267
- }
268
- }
269
- pickerText() {
270
- if (this.theme.pickerTextColor || this.theme.pickerTextFont) {
271
- this.printQueue.push(() => {
272
- this.root = this.root.ele('item', {
273
- name: 'spinnerStyle'
274
- }).txt('@style/RN.Persona.Spinner').up();
275
- this.root = this.root.ele('item', {
276
- name: 'spinnerDropDownItemStyle'
277
- }).txt('@style/RN.Persona.DropDownItem.Spinner').up();
278
- });
279
- this.postPrintQueue.push(() => {
280
- // Build Rn.Persona.Spinner
281
- this.root = this.root.ele('style', {
282
- name: 'RN.Persona.Spinner',
283
- parent: 'Persona.Inquiry2.Spinner'
284
- }).ele('item', {
285
- name: 'android:textColor'
286
- }).txt(this.theme.pickerTextColor ?? '?android:attr/textColorPrimary').up().ele('item', {
287
- name: 'android:textAppearance'
288
- }).txt(this.theme.pickerTextFont ? '@style/RN.Persona.Text.Spinner' : '@style/Persona.Inquiry2.Text.Body').up().up();
289
-
290
- // Build RN.Persona.DropDownItem.Spinner
291
- this.root = this.root.ele('style', {
292
- name: 'RN.Persona.DropDownItem.Spinner',
293
- parent: 'Persona.Inquiry2.Spinner'
294
- }).ele('item', {
295
- name: 'android:textColor'
296
- }).txt(this.theme.pickerTextColor ?? '?android:attr/textColorPrimary').up().ele('item', {
297
- name: 'android:textAppearance'
298
- }).txt(this.theme.pickerTextFont ? '@style/RN.Persona.Text.Spinner' : '@style/Persona.Inquiry2.Text.Body').up().up();
299
-
300
- // Build RN.Persona.Text.Spinner
301
- this.root = this.root.ele('style', {
302
- name: 'RN.Persona.Text.Spinner'
303
- });
304
- if (this.theme.pickerTextColor) {
305
- this.root = this.root.ele('item', {
306
- name: 'android:textColor'
307
- }).txt(this.theme.pickerTextColor).up();
308
- }
309
- if (this.theme.pickerTextFont) {
310
- // TODO: Add notice about how to add a custom font that can be
311
- // referenced here on Android
312
- this.root = this.root.ele('item', {
313
- name: 'android:fontFamily'
314
- }).txt(this.theme.pickerTextFont).up();
315
- }
316
- this.root = this.root.up();
317
- });
318
- }
319
- }
320
- button() {
321
- if (this.theme.buttonBackgroundColor || this.theme.buttonDisabledBackgroundColor || this.theme.buttonTouchedBackgroundColor || this.theme.buttonTextColor || this.theme.buttonDisabledTextColor || this.theme.buttonCornerRadius || this.theme.buttonFont) {
322
- this.printQueue.push(() => {
323
- this.root = this.root.ele('item', {
324
- name: 'buttonStyle'
325
- }).txt('@style/RN.Persona.Button').up();
326
- });
327
- this.postPrintQueue.push(() => {
328
- this.root = this.root.ele('style', {
329
- name: 'RN.Persona.Button',
330
- parent: 'Persona.Inquiry2.Button'
331
- })
332
- // Taken from
333
- // appcompat's res/values/values.xml
334
- .ele('item', {
335
- name: 'android:minHeight'
336
- }).txt('48dip').up()
337
- // Taken from
338
- // appcompat's res/values/values.xml
339
- .ele('item', {
340
- name: 'android:minWidth'
341
- }).txt('88dip').up()
342
- // Taken from
343
- // persona-android's shared/src/main/res/values/styles.xml
344
- .ele('item', {
345
- name: 'android:textSize'
346
- }).txt('18sp').up().ele('item', {
347
- name: 'android:background'
348
- }).txt('@drawable/rn_persona_button').up().ele('item', {
349
- name: 'android:textColor'
350
- }).txt('@color/rn_persona_button').up().up();
351
-
352
- // Disabled
353
- this.buttonDrawable = this.buttonDrawable.ele('item', {
354
- 'android:state_enabled': 'false'
355
- }).ele('shape', {
356
- 'android:shape': 'rectangle'
357
- }).ele('corners', {
358
- 'android:radius': this.theme.buttonCornerRadius ? `${this.theme.buttonCornerRadius}dp` : '@dimen/abc_control_corner_material'
359
- }).up().ele('padding', {
360
- 'android:left': '@dimen/abc_button_padding_horizontal_material',
361
- 'android:top': '@dimen/abc_button_padding_vertical_material',
362
- 'android:right': '@dimen/abc_button_padding_horizontal_material',
363
- 'android:bottom': '@dimen/abc_button_padding_vertical_material'
364
- }).up().ele('solid', {
365
- 'android:color': this.theme.buttonDisabledBackgroundColor ? this.theme.buttonDisabledBackgroundColor : '?attr/colorPrimaryVariant'
366
- }).up().up().up();
367
-
368
- // touched
369
- this.buttonDrawable = this.buttonDrawable.ele('item', {
370
- 'android:state_pressed': 'true'
371
- }).ele('shape', {
372
- 'android:shape': 'rectangle'
373
- }).ele('corners', {
374
- 'android:radius': this.theme.buttonCornerRadius ? `${this.theme.buttonCornerRadius}dp` : '@dimen/abc_control_corner_material'
375
- }).up().ele('solid', {
376
- 'android:color': this.theme.buttonTouchedBackgroundColor ?? '?attr/colorPrimaryVariant'
377
- }).up().ele('padding', {
378
- 'android:left': '@dimen/abc_button_padding_horizontal_material',
379
- 'android:top': '@dimen/abc_button_padding_vertical_material',
380
- 'android:right': '@dimen/abc_button_padding_horizontal_material',
381
- 'android:bottom': '@dimen/abc_button_padding_vertical_material'
382
- }).up().up().up();
383
- this.buttonDrawable = this.buttonDrawable.ele('item').ele('shape', {
384
- 'android:shape': 'rectangle'
385
- }).ele('corners', {
386
- 'android:radius': this.theme.buttonCornerRadius ? `${this.theme.buttonCornerRadius}dp` : '@dimen/abc_control_corner_material'
387
- }).up().ele('solid', {
388
- 'android:color': this.theme.buttonBackgroundColor ?? '?attr/colorPrimary'
389
- }).up().ele('padding', {
390
- 'android:left': '@dimen/abc_button_padding_horizontal_material',
391
- 'android:top': '@dimen/abc_button_padding_vertical_material',
392
- 'android:right': '@dimen/abc_button_padding_horizontal_material',
393
- 'android:bottom': '@dimen/abc_button_padding_vertical_material'
394
- }).up().up().up();
395
-
396
- // Finish button drawable
397
- this.buttonDrawable = this.buttonDrawable.up();
398
- this.buttonColor = this.buttonColor.ele('item', {
399
- 'android:state_enabled': 'false',
400
- 'android:color': this.theme.buttonDisabledTextColor ?? '@android:color/darker_gray'
401
- }).up().ele('item', {
402
- 'android:state_pressed': 'true',
403
- 'android:color': this.theme.buttonTextColor ?? '@android:color/white'
404
- }).up().ele('item', {
405
- 'android:color': this.theme.buttonTextColor ?? '@android:color/white'
406
- }).up();
407
- this.buttonColor = this.buttonColor.up();
408
- this.root = this.root.up();
409
- });
410
- }
411
- }
412
- progressColor() {
413
- if (this.theme.progressColor) {
414
- this.printQueue.push(() => {
415
- this.root = this.root.ele('item', {
416
- name: 'colorControlActivated'
417
- }).txt(this.theme.progressColor).up();
418
- });
419
- }
420
- }
421
- successAsset() {
422
- if (!this.theme.successAsset) return;
423
- this.printQueue.push(() => {
424
- this.root = this.root.ele('item', {
425
- name: 'personaInquiryCompleteImage'
426
- }).txt(this.theme.successAsset).up().txt(' ');
427
- });
428
- }
429
- failAsset() {
430
- if (!this.theme.failAsset) return;
431
- this.printQueue.push(() => {
432
- this.root = this.root.ele('item', {
433
- name: 'personaInquiryFailImage'
434
- }).txt(this.theme.failAsset).up().txt(' ');
435
- });
436
- }
437
- loadingAnimationAsset() {
438
- if (!this.theme.loadingAnimationAsset || !this.theme.loadingAnimationWidthPercent) return;
439
- this.printQueue.push(() => {
440
- this.root = this.root.ele('item', {
441
- name: 'personaInquiryLoadingLottieRaw'
442
- }).txt(this.theme.loadingAnimationAsset).up().txt(' ');
443
- this.root = this.root.ele('item', {
444
- name: 'personaInquiryLoadingLottieWidthPercent'
445
- }).txt(this.theme.loadingAnimationWidthPercent).up().txt(' ');
446
- });
447
- }
448
- selfieAnimationAsset() {
449
- if (!this.theme.selfieAnimationAsset || !this.theme.selfieAnimationWidthPercent) return;
450
- this.printQueue.push(() => {
451
- this.root = this.root.ele('item', {
452
- name: 'personaInquirySelfieLottieRaw'
453
- }).txt(this.theme.selfieAnimationAsset).up().txt(' ');
454
- this.root = this.root.ele('item', {
455
- name: 'personaInquirySelfieLottieWidthPercent'
456
- }).txt(this.theme.selfieAnimationWidthPercent).up().txt(' ');
457
- });
458
- }
459
- }
460
- var _default = AndroidResourcePrinter;
461
- exports.default = _default;
462
- //# sourceMappingURL=AndroidResourcePrinter.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_xmlbuilder","require","_defineProperty","obj","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","arg","_toPrimitive","String","input","hint","prim","Symbol","toPrimitive","undefined","res","call","TypeError","Number","AndroidResourcePrinter","constructor","theme","root","createXml","version","ele","buttonDrawable","buttonColor","process","hasTheme","up","print","style","primaryColor","accentColor","darkPrimaryColor","backgroundColor","titleText","bodyText","footnoteText","textField","pickerText","button","progressColor","successAsset","failAsset","loadingAnimationAsset","selfieAnimationAsset","preprintQueue","forEach","fn","name","parent","printQueue","postPrintQueue","keys","length","values","filter","Boolean","push","txt","titleTextColor","titleTextFont","bodyTextColor","bodyTextFont","footnoteTextColor","footnoteTextFont","textFieldTextColor","textFieldTextFont","pickerTextColor","pickerTextFont","buttonBackgroundColor","buttonDisabledBackgroundColor","buttonTouchedBackgroundColor","buttonTextColor","buttonDisabledTextColor","buttonCornerRadius","buttonFont","loadingAnimationWidthPercent","selfieAnimationWidthPercent","_default","exports","default"],"sources":["AndroidResourcePrinter.ts"],"sourcesContent":["import { create as createXml } from 'xmlbuilder2';\nimport type { AndroidThemeObject } from './Theme';\nimport type { XMLBuilder } from 'xmlbuilder2/lib/interfaces';\n\nclass AndroidResourcePrinter {\n theme: AndroidThemeObject;\n root: XMLBuilder;\n buttonDrawable: XMLBuilder;\n buttonColor: XMLBuilder;\n preprintQueue: (() => void)[] = [];\n printQueue: (() => void)[] = [];\n postPrintQueue: (() => void)[] = [];\n\n constructor(theme: AndroidThemeObject) {\n this.theme = theme;\n this.root = createXml({ version: '1.0' }).ele('resources');\n this.buttonDrawable = createXml({ version: '1.0' }).ele('selector', {\n 'xmlns:android': 'http://schemas.android.com/apk/res/android',\n });\n this.buttonColor = createXml({ version: '1.0' }).ele('selector', {\n 'xmlns:android': 'http://schemas.android.com/apk/res/android',\n });\n }\n\n process() {\n if (!this.hasTheme()) {\n this.root = this.root.up();\n } else {\n this.print();\n }\n\n return {\n style: this.root,\n buttonDrawable: this.buttonDrawable,\n buttonColor: this.buttonColor,\n };\n }\n\n private print() {\n this.primaryColor();\n this.accentColor();\n this.darkPrimaryColor();\n this.backgroundColor();\n this.titleText();\n this.bodyText();\n this.footnoteText();\n // this.formLabelText();\n this.textField();\n this.pickerText();\n this.button();\n this.progressColor();\n this.successAsset();\n this.failAsset();\n this.loadingAnimationAsset();\n this.selfieAnimationAsset();\n\n this.preprintQueue.forEach((fn) => fn());\n\n // Precreate some style namespaces\n this.root = this.root\n .ele('style', {\n name: 'RN',\n })\n .up();\n this.root = this.root\n .ele('style', {\n name: 'RN.Persona',\n })\n .up();\n this.root = this.root\n .ele('style', {\n name: 'RN.Persona.Text',\n })\n .up();\n this.root = this.root.ele('style', {\n name: 'Persona.Inquiry2.Theme',\n parent: 'Base.Persona.Inquiry2.Theme',\n });\n this.printQueue.forEach((fn) => fn());\n this.root = this.root.up();\n this.postPrintQueue.forEach((fn) => fn());\n }\n\n private hasTheme(): boolean {\n return (\n Object.keys(this.theme).length > 0 &&\n Object.values(this.theme).filter(Boolean).length > 0\n );\n }\n\n private primaryColor() {\n if (!this.theme.primaryColor) return;\n\n this.printQueue.push(() => {\n this.root = this.root\n .ele('item', { name: 'colorPrimary' })\n .txt(this.theme.primaryColor as string)\n .up()\n .txt(' ');\n });\n }\n\n private accentColor() {\n if (!this.theme.accentColor) return;\n\n this.printQueue.push(() => {\n this.root = this.root\n .ele('item', { name: 'colorSecondary' })\n .txt(this.theme.accentColor as string)\n .up()\n .txt(' ');\n });\n }\n\n private darkPrimaryColor() {\n if (!this.theme.darkPrimaryColor) return;\n\n this.printQueue.push(() => {\n this.root = this.root\n .ele('item', { name: 'colorPrimaryVariant' })\n .txt(this.theme.darkPrimaryColor as string)\n .up()\n .txt(' ');\n });\n }\n\n private backgroundColor() {\n if (!this.theme.backgroundColor) return;\n\n this.preprintQueue.push(() => {\n this.root = this.root\n .ele('color', { name: 'customPersonaBackgroundColor' })\n .txt(this.theme.backgroundColor as string)\n .up()\n .txt(' ');\n });\n\n this.printQueue.push(() => {\n this.root = this.root\n .ele('item', { name: 'android:colorBackground' })\n .txt('@color/customPersonaBackgroundColor')\n .up()\n .txt(' ');\n });\n }\n\n private titleText() {\n if (this.theme.titleTextColor || this.theme.titleTextFont) {\n this.printQueue.push(() => {\n this.root = this.root\n .ele('item', { name: 'textAppearanceHeadline6' })\n .txt('@style/RN.Persona.Text.Title')\n .up();\n });\n\n // Create a text appearance\n this.postPrintQueue.push(() => {\n this.root = this.root.ele('style', {\n name: 'RN.Persona.Text.Title',\n parent: 'Persona.Inquiry2.Text.Body',\n });\n\n if (this.theme.titleTextColor) {\n this.root = this.root\n .ele('item', { name: 'android:textColor' })\n .txt(this.theme.titleTextColor as string)\n .up();\n }\n\n if (this.theme.titleTextFont) {\n // TODO: Add notice about how to add a custom font that can be\n // referenced here on Android\n this.root = this.root\n .ele('item', { name: 'android:fontFamily' })\n .txt(this.theme.titleTextFont as string)\n .up();\n }\n\n // Default values taken from `Persona.Text.Title`\n // in shared/src/main/res/values/styles.xml\n this.root = this.root\n .ele('item', { name: 'android:textSize' })\n .txt('26sp')\n .up()\n .ele('item', { name: 'android:textStyle' })\n .txt('bold')\n .up();\n\n this.root = this.root.up();\n });\n } else {\n this.printQueue.push(() => {\n this.root = this.root\n .ele('item', { name: 'textAppearanceHeadline6' })\n .txt('@style/Persona.Text.Title')\n .up();\n });\n }\n }\n\n private bodyText() {\n if (this.theme.bodyTextColor || this.theme.bodyTextFont) {\n this.printQueue.push(() => {\n this.root = this.root\n .ele('item', { name: 'textAppearanceSubtitle1' })\n .txt('@style/RN.Persona.Text.Body')\n .up();\n });\n\n // Create a text appearance\n this.postPrintQueue.push(() => {\n this.root = this.root.ele('style', {\n name: 'RN.Persona.Text.Body',\n parent: 'Persona.Inquiry2.Text.Body',\n });\n\n if (this.theme.bodyTextColor) {\n this.root = this.root\n .ele('item', { name: 'android:textColor' })\n .txt(this.theme.bodyTextColor as string)\n .up();\n }\n\n if (this.theme.bodyTextFont) {\n // TODO: Add notice about how to add a custom font that can be\n // referenced here on Android\n this.root = this.root\n .ele('item', { name: 'android:fontFamily' })\n .txt(this.theme.bodyTextFont as string)\n .up();\n }\n\n // Default values taken from `Persona.Text.Body`\n // in shared/src/main/res/values/styles.xml\n this.root = this.root\n .ele('item', { name: 'android:textSize' })\n .txt('18sp')\n .up();\n\n this.root = this.root.up();\n });\n } else {\n this.printQueue.push(() => {\n this.root = this.root\n .ele('item', { name: 'textAppearanceSubtitle1' })\n .txt('@style/Persona.Inquiry2.Text.Body')\n .up();\n });\n }\n }\n\n private footnoteText() {\n if (this.theme.footnoteTextColor || this.theme.footnoteTextFont) {\n this.postPrintQueue.push(() => {\n this.root = this.root\n .ele('style', { name: 'TextAppearance.AppCompat.Small' })\n .ele('item', { name: 'android:textSize' })\n // Used default value found in the Android SDK\n .txt('@dimen/abc_text_size_small_material')\n .up()\n .ele('item', { name: 'android:textColor' })\n .txt(\n // Used default value found in the Android SDK\n this.theme.footnoteTextColor ?? '?android:attr/textColorTertiary'\n )\n .up();\n\n if (this.theme.footnoteTextFont) {\n this.root = this.root\n .ele('item', { name: 'android:fontFamily' })\n .txt(\n // Used default value found in the Android SDK\n this.theme.footnoteTextFont ?? '?android:attr/textColorTertiary'\n )\n .up();\n }\n\n this.root = this.root.up();\n });\n }\n }\n private textField() {\n if (this.theme.textFieldTextColor || this.theme.textFieldTextFont) {\n this.printQueue.push(() => {\n this.root = this.root\n .ele('item', { name: 'editTextStyle' })\n .txt('@style/RN.Persona.EditText')\n .up();\n });\n\n this.postPrintQueue.push(() => {\n this.root = this.root\n .ele('style', {\n name: 'RN.Persona.EditText',\n parent: 'Persona.Inquiry2.EditText',\n })\n .ele('item', { name: 'android:textAppearance' })\n .txt('@style/RN.Persona.EditText.TextAppearance')\n .up()\n .ele('item', { name: 'android:textColor' })\n .txt(this.theme.textFieldTextColor as string)\n .up()\n .up();\n\n this.root = this.root.ele('style', {\n name: 'RN.Persona.EditText.TextAppearance',\n parent: 'Base.TextAppearance.TextAppearance.MaterialComponents.Body1',\n });\n\n if (this.theme.textFieldTextColor) {\n this.root = this.root\n .ele('item', { name: 'android:textSize' })\n .txt('18sp')\n .up();\n }\n\n if (this.theme.textFieldTextFont) {\n this.root = this.root\n .ele('item', { name: 'android:fontFamily' })\n .txt(this.theme.textFieldTextFont as string)\n .up();\n }\n\n this.root = this.root.up();\n });\n }\n }\n\n private pickerText() {\n if (this.theme.pickerTextColor || this.theme.pickerTextFont) {\n this.printQueue.push(() => {\n this.root = this.root\n .ele('item', { name: 'spinnerStyle' })\n .txt('@style/RN.Persona.Spinner')\n .up();\n\n this.root = this.root\n .ele('item', { name: 'spinnerDropDownItemStyle' })\n .txt('@style/RN.Persona.DropDownItem.Spinner')\n .up();\n });\n\n this.postPrintQueue.push(() => {\n // Build Rn.Persona.Spinner\n this.root = this.root\n .ele('style', {\n name: 'RN.Persona.Spinner',\n parent: 'Persona.Inquiry2.Spinner',\n })\n .ele('item', { name: 'android:textColor' })\n .txt(this.theme.pickerTextColor ?? '?android:attr/textColorPrimary')\n .up()\n .ele('item', { name: 'android:textAppearance' })\n .txt(\n this.theme.pickerTextFont\n ? '@style/RN.Persona.Text.Spinner'\n : '@style/Persona.Inquiry2.Text.Body'\n )\n .up()\n .up();\n\n // Build RN.Persona.DropDownItem.Spinner\n this.root = this.root\n .ele('style', {\n name: 'RN.Persona.DropDownItem.Spinner',\n parent: 'Persona.Inquiry2.Spinner',\n })\n .ele('item', { name: 'android:textColor' })\n .txt(this.theme.pickerTextColor ?? '?android:attr/textColorPrimary')\n .up()\n .ele('item', { name: 'android:textAppearance' })\n .txt(\n this.theme.pickerTextFont\n ? '@style/RN.Persona.Text.Spinner'\n : '@style/Persona.Inquiry2.Text.Body'\n )\n .up()\n .up();\n\n // Build RN.Persona.Text.Spinner\n this.root = this.root.ele('style', {\n name: 'RN.Persona.Text.Spinner',\n });\n\n if (this.theme.pickerTextColor) {\n this.root = this.root\n .ele('item', { name: 'android:textColor' })\n .txt(this.theme.pickerTextColor as string)\n .up();\n }\n\n if (this.theme.pickerTextFont) {\n // TODO: Add notice about how to add a custom font that can be\n // referenced here on Android\n this.root = this.root\n .ele('item', { name: 'android:fontFamily' })\n .txt(this.theme.pickerTextFont as string)\n .up();\n }\n\n this.root = this.root.up();\n });\n }\n }\n\n private button() {\n if (\n this.theme.buttonBackgroundColor ||\n this.theme.buttonDisabledBackgroundColor ||\n this.theme.buttonTouchedBackgroundColor ||\n this.theme.buttonTextColor ||\n this.theme.buttonDisabledTextColor ||\n this.theme.buttonCornerRadius ||\n this.theme.buttonFont\n ) {\n this.printQueue.push(() => {\n this.root = this.root\n .ele('item', { name: 'buttonStyle' })\n .txt('@style/RN.Persona.Button')\n .up();\n });\n\n this.postPrintQueue.push(() => {\n this.root = this.root\n .ele('style', {\n name: 'RN.Persona.Button',\n parent: 'Persona.Inquiry2.Button',\n })\n // Taken from\n // appcompat's res/values/values.xml\n .ele('item', {\n name: 'android:minHeight',\n })\n .txt('48dip')\n .up()\n // Taken from\n // appcompat's res/values/values.xml\n .ele('item', {\n name: 'android:minWidth',\n })\n .txt('88dip')\n .up()\n // Taken from\n // persona-android's shared/src/main/res/values/styles.xml\n .ele('item', {\n name: 'android:textSize',\n })\n .txt('18sp')\n .up()\n .ele('item', {\n name: 'android:background',\n })\n .txt('@drawable/rn_persona_button')\n .up()\n .ele('item', {\n name: 'android:textColor',\n })\n .txt('@color/rn_persona_button')\n .up()\n .up();\n\n // Disabled\n this.buttonDrawable = this.buttonDrawable\n .ele('item', {\n 'android:state_enabled': 'false',\n })\n .ele('shape', { 'android:shape': 'rectangle' })\n .ele('corners', {\n 'android:radius': this.theme.buttonCornerRadius\n ? `${this.theme.buttonCornerRadius}dp`\n : '@dimen/abc_control_corner_material',\n })\n .up()\n .ele('padding', {\n 'android:left': '@dimen/abc_button_padding_horizontal_material',\n 'android:top': '@dimen/abc_button_padding_vertical_material',\n 'android:right': '@dimen/abc_button_padding_horizontal_material',\n 'android:bottom': '@dimen/abc_button_padding_vertical_material',\n })\n .up()\n .ele('solid', {\n 'android:color': this.theme.buttonDisabledBackgroundColor\n ? this.theme.buttonDisabledBackgroundColor\n : '?attr/colorPrimaryVariant',\n })\n .up()\n .up()\n .up();\n\n // touched\n this.buttonDrawable = this.buttonDrawable\n .ele('item', {\n 'android:state_pressed': 'true',\n })\n .ele('shape', { 'android:shape': 'rectangle' })\n .ele('corners', {\n 'android:radius': this.theme.buttonCornerRadius\n ? `${this.theme.buttonCornerRadius}dp`\n : '@dimen/abc_control_corner_material',\n })\n .up()\n .ele('solid', {\n 'android:color':\n this.theme.buttonTouchedBackgroundColor ??\n '?attr/colorPrimaryVariant',\n })\n .up()\n .ele('padding', {\n 'android:left': '@dimen/abc_button_padding_horizontal_material',\n 'android:top': '@dimen/abc_button_padding_vertical_material',\n 'android:right': '@dimen/abc_button_padding_horizontal_material',\n 'android:bottom': '@dimen/abc_button_padding_vertical_material',\n })\n .up()\n .up()\n .up();\n\n this.buttonDrawable = this.buttonDrawable\n .ele('item')\n .ele('shape', { 'android:shape': 'rectangle' })\n .ele('corners', {\n 'android:radius': this.theme.buttonCornerRadius\n ? `${this.theme.buttonCornerRadius}dp`\n : '@dimen/abc_control_corner_material',\n })\n .up()\n .ele('solid', {\n 'android:color':\n this.theme.buttonBackgroundColor ?? '?attr/colorPrimary',\n })\n .up()\n .ele('padding', {\n 'android:left': '@dimen/abc_button_padding_horizontal_material',\n 'android:top': '@dimen/abc_button_padding_vertical_material',\n 'android:right': '@dimen/abc_button_padding_horizontal_material',\n 'android:bottom': '@dimen/abc_button_padding_vertical_material',\n })\n .up()\n .up()\n .up();\n\n // Finish button drawable\n this.buttonDrawable = this.buttonDrawable.up();\n\n this.buttonColor = this.buttonColor\n .ele('item', {\n 'android:state_enabled': 'false',\n 'android:color':\n this.theme.buttonDisabledTextColor ??\n '@android:color/darker_gray',\n })\n .up()\n .ele('item', {\n 'android:state_pressed': 'true',\n 'android:color':\n this.theme.buttonTextColor ?? '@android:color/white',\n })\n .up()\n .ele('item', {\n 'android:color':\n this.theme.buttonTextColor ?? '@android:color/white',\n })\n .up();\n\n this.buttonColor = this.buttonColor.up();\n\n this.root = this.root.up();\n });\n }\n }\n\n private progressColor() {\n if (this.theme.progressColor) {\n this.printQueue.push(() => {\n this.root = this.root\n .ele('item', { name: 'colorControlActivated' })\n .txt(this.theme.progressColor as string)\n .up();\n });\n }\n }\n\n private successAsset() {\n if (!this.theme.successAsset) return;\n\n this.printQueue.push(() => {\n this.root = this.root\n .ele('item', { name: 'personaInquiryCompleteImage' })\n .txt(this.theme.successAsset as string)\n .up()\n .txt(' ');\n });\n }\n\n private failAsset() {\n if (!this.theme.failAsset) return;\n\n this.printQueue.push(() => {\n this.root = this.root\n .ele('item', { name: 'personaInquiryFailImage' })\n .txt(this.theme.failAsset as string)\n .up()\n .txt(' ');\n });\n }\n\n private loadingAnimationAsset() {\n if (\n !this.theme.loadingAnimationAsset ||\n !this.theme.loadingAnimationWidthPercent\n )\n return;\n\n this.printQueue.push(() => {\n this.root = this.root\n .ele('item', { name: 'personaInquiryLoadingLottieRaw' })\n .txt(this.theme.loadingAnimationAsset as string)\n .up()\n .txt(' ');\n\n this.root = this.root\n .ele('item', { name: 'personaInquiryLoadingLottieWidthPercent' })\n .txt(this.theme.loadingAnimationWidthPercent as string)\n .up()\n .txt(' ');\n });\n }\n\n private selfieAnimationAsset() {\n if (\n !this.theme.selfieAnimationAsset ||\n !this.theme.selfieAnimationWidthPercent\n )\n return;\n\n this.printQueue.push(() => {\n this.root = this.root\n .ele('item', { name: 'personaInquirySelfieLottieRaw' })\n .txt(this.theme.selfieAnimationAsset as string)\n .up()\n .txt(' ');\n\n this.root = this.root\n .ele('item', { name: 'personaInquirySelfieLottieWidthPercent' })\n .txt(this.theme.selfieAnimationWidthPercent as string)\n .up()\n .txt(' ');\n });\n }\n}\n\nexport default AndroidResourcePrinter;\n"],"mappings":";;;;;;AAAA,IAAAA,WAAA,GAAAC,OAAA;AAAkD,SAAAC,gBAAAC,GAAA,EAAAC,GAAA,EAAAC,KAAA,IAAAD,GAAA,GAAAE,cAAA,CAAAF,GAAA,OAAAA,GAAA,IAAAD,GAAA,IAAAI,MAAA,CAAAC,cAAA,CAAAL,GAAA,EAAAC,GAAA,IAAAC,KAAA,EAAAA,KAAA,EAAAI,UAAA,QAAAC,YAAA,QAAAC,QAAA,oBAAAR,GAAA,CAAAC,GAAA,IAAAC,KAAA,WAAA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;IACb,CAAC,CAAC;EACJ;EAEQd,oBAAoBA,CAAA,EAAG;IAC7B,IACE,CAAC,IAAI,CAAC1B,KAAK,CAAC0B,oBAAoB,IAChC,CAAC,IAAI,CAAC1B,KAAK,CAAC2D,2BAA2B,EAEvC;IAEF,IAAI,CAAC3B,UAAU,CAACO,IAAI,CAAC,MAAM;MACzB,IAAI,CAACtC,IAAI,GAAG,IAAI,CAACA,IAAI,CAClBG,GAAG,CAAC,MAAM,EAAE;QAAE0B,IAAI,EAAE;MAAgC,CAAC,CAAC,CACtDU,GAAG,CAAC,IAAI,CAACxC,KAAK,CAAC0B,oBAA8B,CAAC,CAC9CjB,EAAE,CAAC,CAAC,CACJ+B,GAAG,CAAC,GAAG,CAAC;MAEX,IAAI,CAACvC,IAAI,GAAG,IAAI,CAACA,IAAI,CAClBG,GAAG,CAAC,MAAM,EAAE;QAAE0B,IAAI,EAAE;MAAyC,CAAC,CAAC,CAC/DU,GAAG,CAAC,IAAI,CAACxC,KAAK,CAAC2D,2BAAqC,CAAC,CACrDlD,EAAE,CAAC,CAAC,CACJ+B,GAAG,CAAC,GAAG,CAAC;IACb,CAAC,CAAC;EACJ;AACF;AAAC,IAAAoB,QAAA,GAEc9D,sBAAsB;AAAA+D,OAAA,CAAAC,OAAA,GAAAF,QAAA"}
@@ -1,78 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _cosmiconfig = require("cosmiconfig");
8
- var _chalk = _interopRequireDefault(require("chalk"));
9
- var _Theme = require("./Theme");
10
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
12
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
13
- function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
14
- class Configuration {
15
- constructor() {
16
- _defineProperty(this, "config", void 0);
17
- }
18
- async loadConfig() {
19
- if (this.config) return this.config;
20
- try {
21
- const explorer = (0, _cosmiconfig.cosmiconfig)('persona', {
22
- packageProp: 'persona'
23
- });
24
- const result = await explorer.search();
25
- if (result == null) {
26
- return null;
27
- }
28
- this.config = result.config;
29
- return this.config;
30
- } catch (e) {
31
- console.error(e);
32
- process.exit(1);
33
- }
34
- }
35
- async get() {
36
- let config = await this.loadConfig();
37
- const androidThemeLines = [];
38
- for (const key in _Theme.ANDROID_THEME_CONFIG_KEY) {
39
- androidThemeLines.push(` "${key}": null`);
40
- }
41
- const iosThemeLines = [];
42
- for (const key in _Theme.IOS_THEME_CONFIG_KEY) {
43
- iosThemeLines.push(` "${key}": null`);
44
- }
45
- if (config == null) {
46
- console.log(`
47
- Missing configuration.
48
-
49
- In order to use this tool, it must be configured using a ${_chalk.default.yellow('persona')} object within
50
- your package.json.
51
-
52
- To get started, paste the following configuration into your package.json
53
-
54
- {
55
- ...
56
-
57
- "persona": {
58
- "androidTheme": {
59
- ` + androidThemeLines.join(',\n') + `
60
- },
61
- "iosTheme": {
62
- ` + iosThemeLines.join(',\n') + `
63
- }
64
- }
65
-
66
- ...
67
- }
68
-
69
- and re-run this tool :).
70
- `);
71
- process.exit(1);
72
- }
73
- return config;
74
- }
75
- }
76
- var _default = new Configuration();
77
- exports.default = _default;
78
- //# sourceMappingURL=Config.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_cosmiconfig","require","_chalk","_interopRequireDefault","_Theme","obj","__esModule","default","_defineProperty","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","arg","_toPrimitive","String","input","hint","prim","Symbol","toPrimitive","undefined","res","call","TypeError","Number","Configuration","constructor","loadConfig","config","explorer","cosmiconfig","packageProp","result","search","e","console","error","process","exit","get","androidThemeLines","ANDROID_THEME_CONFIG_KEY","push","iosThemeLines","IOS_THEME_CONFIG_KEY","log","chalk","yellow","join","_default","exports"],"sources":["Config.ts"],"sourcesContent":["import { cosmiconfig } from 'cosmiconfig';\nimport chalk from 'chalk';\nimport { ANDROID_THEME_CONFIG_KEY, IOS_THEME_CONFIG_KEY } from './Theme';\n\nexport interface ConfigObject {\n androidTheme: { [key: string]: string | null | undefined };\n iosTheme: { [key: string]: string | null | undefined };\n}\n\nclass Configuration {\n config?: ConfigObject | null;\n\n async loadConfig(): Promise<ConfigObject | null | undefined> {\n if (this.config) return this.config;\n\n try {\n const explorer = cosmiconfig('persona', { packageProp: 'persona' });\n const result = await explorer.search();\n if (result == null) {\n return null;\n }\n\n this.config = result.config;\n\n return this.config;\n } catch (e) {\n console.error(e);\n process.exit(1);\n }\n }\n\n async get(): Promise<ConfigObject> {\n let config = await this.loadConfig();\n\n const androidThemeLines = [];\n for (const key in ANDROID_THEME_CONFIG_KEY) {\n androidThemeLines.push(` \"${key}\": null`);\n }\n\n const iosThemeLines = [];\n for (const key in IOS_THEME_CONFIG_KEY) {\n iosThemeLines.push(` \"${key}\": null`);\n }\n\n if (config == null) {\n console.log(\n `\nMissing configuration.\n\nIn order to use this tool, it must be configured using a ${chalk.yellow(\n 'persona'\n )} object within\nyour package.json.\n\nTo get started, paste the following configuration into your package.json\n\n{\n ...\n\n \"persona\": {\n \"androidTheme\": {\n` +\n androidThemeLines.join(',\\n') +\n `\n },\n \"iosTheme\": {\n` +\n iosThemeLines.join(',\\n') +\n `\n }\n }\n\n ...\n}\n\nand re-run this tool :).\n`\n );\n process.exit(1);\n }\n\n return config as ConfigObject;\n }\n}\n\nexport default new Configuration();\n"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IA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