react-native-persona 2.9.2 → 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 (47) hide show
  1. package/README.md +0 -42
  2. package/RNPersonaInquiry2.podspec +1 -1
  3. package/android/build.gradle +1 -1
  4. package/package.json +1 -12
  5. package/bin/persona-tool +0 -3
  6. package/lib/commonjs/persona-tool/AndroidResourcePrinter.js +0 -462
  7. package/lib/commonjs/persona-tool/AndroidResourcePrinter.js.map +0 -1
  8. package/lib/commonjs/persona-tool/Config.js +0 -78
  9. package/lib/commonjs/persona-tool/Config.js.map +0 -1
  10. package/lib/commonjs/persona-tool/Theme.js +0 -188
  11. package/lib/commonjs/persona-tool/Theme.js.map +0 -1
  12. package/lib/commonjs/persona-tool/index.js +0 -31
  13. package/lib/commonjs/persona-tool/index.js.map +0 -1
  14. package/lib/commonjs/persona-tool/prompts.js +0 -42
  15. package/lib/commonjs/persona-tool/prompts.js.map +0 -1
  16. package/lib/commonjs/persona-tool/tools/AndroidThemeGenerator.js +0 -74
  17. package/lib/commonjs/persona-tool/tools/AndroidThemeGenerator.js.map +0 -1
  18. package/lib/commonjs/persona-tool/tools/IosThemeInstructions.js +0 -40
  19. package/lib/commonjs/persona-tool/tools/IosThemeInstructions.js.map +0 -1
  20. package/lib/module/persona-tool/AndroidResourcePrinter.js +0 -455
  21. package/lib/module/persona-tool/AndroidResourcePrinter.js.map +0 -1
  22. package/lib/module/persona-tool/Config.js +0 -70
  23. package/lib/module/persona-tool/Config.js.map +0 -1
  24. package/lib/module/persona-tool/Theme.js +0 -178
  25. package/lib/module/persona-tool/Theme.js.map +0 -1
  26. package/lib/module/persona-tool/index.js +0 -28
  27. package/lib/module/persona-tool/index.js.map +0 -1
  28. package/lib/module/persona-tool/prompts.js +0 -31
  29. package/lib/module/persona-tool/prompts.js.map +0 -1
  30. package/lib/module/persona-tool/tools/AndroidThemeGenerator.js +0 -66
  31. package/lib/module/persona-tool/tools/AndroidThemeGenerator.js.map +0 -1
  32. package/lib/module/persona-tool/tools/IosThemeInstructions.js +0 -32
  33. package/lib/module/persona-tool/tools/IosThemeInstructions.js.map +0 -1
  34. package/lib/typescript/persona-tool/AndroidResourcePrinter.d.ts +0 -35
  35. package/lib/typescript/persona-tool/Config.d.ts +0 -15
  36. package/lib/typescript/persona-tool/Theme.d.ts +0 -108
  37. package/lib/typescript/persona-tool/index.d.ts +0 -1
  38. package/lib/typescript/persona-tool/prompts.d.ts +0 -8
  39. package/lib/typescript/persona-tool/tools/AndroidThemeGenerator.d.ts +0 -5
  40. package/lib/typescript/persona-tool/tools/IosThemeInstructions.d.ts +0 -5
  41. package/src/persona-tool/AndroidResourcePrinter.ts +0 -652
  42. package/src/persona-tool/Config.ts +0 -86
  43. package/src/persona-tool/Theme.ts +0 -243
  44. package/src/persona-tool/index.ts +0 -30
  45. package/src/persona-tool/prompts.ts +0 -36
  46. package/src/persona-tool/tools/AndroidThemeGenerator.ts +0 -100
  47. package/src/persona-tool/tools/IosThemeInstructions.ts +0 -41
@@ -1,40 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _Theme = _interopRequireDefault(require("../Theme"));
8
- var _prompts = require("../prompts");
9
- var _chalk = _interopRequireDefault(require("chalk"));
10
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
- class IosThemeInstructions {
12
- async run() {
13
- await _Theme.default.print('ios');
14
- const {
15
- isConfirmed: themeValuesConfirmed
16
- } = await (0, _prompts.confirmThemeValues)();
17
- if (!themeValuesConfirmed) {
18
- console.log(_chalk.default.yellow('\nPlease adjust the values in package.json.\n'));
19
- return;
20
- }
21
- console.log(`\n${_chalk.default.yellow('To theme the Persona Inquiry flow for iOS:')}`);
22
- console.log('Add the theme values to the Persona Inquiry SDK client by using the `.iosTheme` builder function');
23
- console.log(`
24
- ${_chalk.default.green(`+ import { persona } from '../package.json'`)}
25
- ...
26
- Inquiry.fromTemplate(selectedTemplateId)
27
- .onSuccess(handleSuccess)
28
- .onCanceled(handleCanceled)
29
- .onFailed(handleFailed)
30
- .onError(handleError)
31
- ${_chalk.default.green('+ .iosTheme(persona.iosTheme)')}
32
- .build()
33
- .start();
34
- ...
35
- `);
36
- }
37
- }
38
- var _default = new IosThemeInstructions();
39
- exports.default = _default;
40
- //# sourceMappingURL=IosThemeInstructions.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_Theme","_interopRequireDefault","require","_prompts","_chalk","obj","__esModule","default","IosThemeInstructions","run","Theme","print","isConfirmed","themeValuesConfirmed","confirmThemeValues","console","log","chalk","yellow","green","_default","exports"],"sources":["IosThemeInstructions.ts"],"sourcesContent":["import Theme from '../Theme';\nimport { confirmThemeValues } from '../prompts';\nimport chalk from 'chalk';\n\nclass IosThemeInstructions {\n async run() {\n await Theme.print('ios');\n\n const { isConfirmed: themeValuesConfirmed } = await confirmThemeValues();\n\n if (!themeValuesConfirmed) {\n console.log(\n chalk.yellow('\\nPlease adjust the values in package.json.\\n')\n );\n return;\n }\n\n console.log(\n `\\n${chalk.yellow('To theme the Persona Inquiry flow for iOS:')}`\n );\n console.log(\n 'Add the theme values to the Persona Inquiry SDK client by using the `.iosTheme` builder function'\n );\n\n console.log(`\n ${chalk.green(`+ import { persona } from '../package.json'`)}\n ...\n Inquiry.fromTemplate(selectedTemplateId)\n .onSuccess(handleSuccess)\n .onCanceled(handleCanceled)\n .onFailed(handleFailed)\n .onError(handleError)\n ${chalk.green('+ .iosTheme(persona.iosTheme)')}\n .build()\n .start();\n ...\n `);\n }\n}\n\nexport default new IosThemeInstructions();\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAH,sBAAA,CAAAC,OAAA;AAA0B,SAAAD,uBAAAI,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAE1B,MAAMG,oBAAoB,CAAC;EACzB,MAAMC,GAAGA,CAAA,EAAG;IACV,MAAMC,cAAK,CAACC,KAAK,CAAC,KAAK,CAAC;IAExB,MAAM;MAAEC,WAAW,EAAEC;IAAqB,CAAC,GAAG,MAAM,IAAAC,2BAAkB,EAAC,CAAC;IAExE,IAAI,CAACD,oBAAoB,EAAE;MACzBE,OAAO,CAACC,GAAG,CACTC,cAAK,CAACC,MAAM,CAAC,+CAA+C,CAC9D,CAAC;MACD;IACF;IAEAH,OAAO,CAACC,GAAG,CACR,KAAIC,cAAK,CAACC,MAAM,CAAC,4CAA4C,CAAE,EAClE,CAAC;IACDH,OAAO,CAACC,GAAG,CACT,kGACF,CAAC;IAEDD,OAAO,CAACC,GAAG,CAAE;AACjB,MAAMC,cAAK,CAACE,KAAK,CAAE,6CAA4C,CAAE;AACjE;AACA;AACA;AACA;AACA;AACA;AACA,MAAMF,cAAK,CAACE,KAAK,CAAC,iCAAiC,CAAE;AACrD;AACA;AACA;AACA,KAAK,CAAC;EACJ;AACF;AAAC,IAAAC,QAAA,GAEc,IAAIZ,oBAAoB,CAAC,CAAC;AAAAa,OAAA,CAAAd,OAAA,GAAAa,QAAA"}
@@ -1,455 +0,0 @@
1
- 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; }
2
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
3
- 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); }
4
- import { create as createXml } from 'xmlbuilder2';
5
- class AndroidResourcePrinter {
6
- constructor(theme) {
7
- _defineProperty(this, "theme", void 0);
8
- _defineProperty(this, "root", void 0);
9
- _defineProperty(this, "buttonDrawable", void 0);
10
- _defineProperty(this, "buttonColor", void 0);
11
- _defineProperty(this, "preprintQueue", []);
12
- _defineProperty(this, "printQueue", []);
13
- _defineProperty(this, "postPrintQueue", []);
14
- this.theme = theme;
15
- this.root = createXml({
16
- version: '1.0'
17
- }).ele('resources');
18
- this.buttonDrawable = createXml({
19
- version: '1.0'
20
- }).ele('selector', {
21
- 'xmlns:android': 'http://schemas.android.com/apk/res/android'
22
- });
23
- this.buttonColor = createXml({
24
- version: '1.0'
25
- }).ele('selector', {
26
- 'xmlns:android': 'http://schemas.android.com/apk/res/android'
27
- });
28
- }
29
- process() {
30
- if (!this.hasTheme()) {
31
- this.root = this.root.up();
32
- } else {
33
- this.print();
34
- }
35
- return {
36
- style: this.root,
37
- buttonDrawable: this.buttonDrawable,
38
- buttonColor: this.buttonColor
39
- };
40
- }
41
- print() {
42
- this.primaryColor();
43
- this.accentColor();
44
- this.darkPrimaryColor();
45
- this.backgroundColor();
46
- this.titleText();
47
- this.bodyText();
48
- this.footnoteText();
49
- // this.formLabelText();
50
- this.textField();
51
- this.pickerText();
52
- this.button();
53
- this.progressColor();
54
- this.successAsset();
55
- this.failAsset();
56
- this.loadingAnimationAsset();
57
- this.selfieAnimationAsset();
58
- this.preprintQueue.forEach(fn => fn());
59
-
60
- // Precreate some style namespaces
61
- this.root = this.root.ele('style', {
62
- name: 'RN'
63
- }).up();
64
- this.root = this.root.ele('style', {
65
- name: 'RN.Persona'
66
- }).up();
67
- this.root = this.root.ele('style', {
68
- name: 'RN.Persona.Text'
69
- }).up();
70
- this.root = this.root.ele('style', {
71
- name: 'Persona.Inquiry2.Theme',
72
- parent: 'Base.Persona.Inquiry2.Theme'
73
- });
74
- this.printQueue.forEach(fn => fn());
75
- this.root = this.root.up();
76
- this.postPrintQueue.forEach(fn => fn());
77
- }
78
- hasTheme() {
79
- return Object.keys(this.theme).length > 0 && Object.values(this.theme).filter(Boolean).length > 0;
80
- }
81
- primaryColor() {
82
- if (!this.theme.primaryColor) return;
83
- this.printQueue.push(() => {
84
- this.root = this.root.ele('item', {
85
- name: 'colorPrimary'
86
- }).txt(this.theme.primaryColor).up().txt(' ');
87
- });
88
- }
89
- accentColor() {
90
- if (!this.theme.accentColor) return;
91
- this.printQueue.push(() => {
92
- this.root = this.root.ele('item', {
93
- name: 'colorSecondary'
94
- }).txt(this.theme.accentColor).up().txt(' ');
95
- });
96
- }
97
- darkPrimaryColor() {
98
- if (!this.theme.darkPrimaryColor) return;
99
- this.printQueue.push(() => {
100
- this.root = this.root.ele('item', {
101
- name: 'colorPrimaryVariant'
102
- }).txt(this.theme.darkPrimaryColor).up().txt(' ');
103
- });
104
- }
105
- backgroundColor() {
106
- if (!this.theme.backgroundColor) return;
107
- this.preprintQueue.push(() => {
108
- this.root = this.root.ele('color', {
109
- name: 'customPersonaBackgroundColor'
110
- }).txt(this.theme.backgroundColor).up().txt(' ');
111
- });
112
- this.printQueue.push(() => {
113
- this.root = this.root.ele('item', {
114
- name: 'android:colorBackground'
115
- }).txt('@color/customPersonaBackgroundColor').up().txt(' ');
116
- });
117
- }
118
- titleText() {
119
- if (this.theme.titleTextColor || this.theme.titleTextFont) {
120
- this.printQueue.push(() => {
121
- this.root = this.root.ele('item', {
122
- name: 'textAppearanceHeadline6'
123
- }).txt('@style/RN.Persona.Text.Title').up();
124
- });
125
-
126
- // Create a text appearance
127
- this.postPrintQueue.push(() => {
128
- this.root = this.root.ele('style', {
129
- name: 'RN.Persona.Text.Title',
130
- parent: 'Persona.Inquiry2.Text.Body'
131
- });
132
- if (this.theme.titleTextColor) {
133
- this.root = this.root.ele('item', {
134
- name: 'android:textColor'
135
- }).txt(this.theme.titleTextColor).up();
136
- }
137
- if (this.theme.titleTextFont) {
138
- // TODO: Add notice about how to add a custom font that can be
139
- // referenced here on Android
140
- this.root = this.root.ele('item', {
141
- name: 'android:fontFamily'
142
- }).txt(this.theme.titleTextFont).up();
143
- }
144
-
145
- // Default values taken from `Persona.Text.Title`
146
- // in shared/src/main/res/values/styles.xml
147
- this.root = this.root.ele('item', {
148
- name: 'android:textSize'
149
- }).txt('26sp').up().ele('item', {
150
- name: 'android:textStyle'
151
- }).txt('bold').up();
152
- this.root = this.root.up();
153
- });
154
- } else {
155
- this.printQueue.push(() => {
156
- this.root = this.root.ele('item', {
157
- name: 'textAppearanceHeadline6'
158
- }).txt('@style/Persona.Text.Title').up();
159
- });
160
- }
161
- }
162
- bodyText() {
163
- if (this.theme.bodyTextColor || this.theme.bodyTextFont) {
164
- this.printQueue.push(() => {
165
- this.root = this.root.ele('item', {
166
- name: 'textAppearanceSubtitle1'
167
- }).txt('@style/RN.Persona.Text.Body').up();
168
- });
169
-
170
- // Create a text appearance
171
- this.postPrintQueue.push(() => {
172
- this.root = this.root.ele('style', {
173
- name: 'RN.Persona.Text.Body',
174
- parent: 'Persona.Inquiry2.Text.Body'
175
- });
176
- if (this.theme.bodyTextColor) {
177
- this.root = this.root.ele('item', {
178
- name: 'android:textColor'
179
- }).txt(this.theme.bodyTextColor).up();
180
- }
181
- if (this.theme.bodyTextFont) {
182
- // TODO: Add notice about how to add a custom font that can be
183
- // referenced here on Android
184
- this.root = this.root.ele('item', {
185
- name: 'android:fontFamily'
186
- }).txt(this.theme.bodyTextFont).up();
187
- }
188
-
189
- // Default values taken from `Persona.Text.Body`
190
- // in shared/src/main/res/values/styles.xml
191
- this.root = this.root.ele('item', {
192
- name: 'android:textSize'
193
- }).txt('18sp').up();
194
- this.root = this.root.up();
195
- });
196
- } else {
197
- this.printQueue.push(() => {
198
- this.root = this.root.ele('item', {
199
- name: 'textAppearanceSubtitle1'
200
- }).txt('@style/Persona.Inquiry2.Text.Body').up();
201
- });
202
- }
203
- }
204
- footnoteText() {
205
- if (this.theme.footnoteTextColor || this.theme.footnoteTextFont) {
206
- this.postPrintQueue.push(() => {
207
- this.root = this.root.ele('style', {
208
- name: 'TextAppearance.AppCompat.Small'
209
- }).ele('item', {
210
- name: 'android:textSize'
211
- })
212
- // Used default value found in the Android SDK
213
- .txt('@dimen/abc_text_size_small_material').up().ele('item', {
214
- name: 'android:textColor'
215
- }).txt(
216
- // Used default value found in the Android SDK
217
- this.theme.footnoteTextColor ?? '?android:attr/textColorTertiary').up();
218
- if (this.theme.footnoteTextFont) {
219
- this.root = this.root.ele('item', {
220
- name: 'android:fontFamily'
221
- }).txt(
222
- // Used default value found in the Android SDK
223
- this.theme.footnoteTextFont ?? '?android:attr/textColorTertiary').up();
224
- }
225
- this.root = this.root.up();
226
- });
227
- }
228
- }
229
- textField() {
230
- if (this.theme.textFieldTextColor || this.theme.textFieldTextFont) {
231
- this.printQueue.push(() => {
232
- this.root = this.root.ele('item', {
233
- name: 'editTextStyle'
234
- }).txt('@style/RN.Persona.EditText').up();
235
- });
236
- this.postPrintQueue.push(() => {
237
- this.root = this.root.ele('style', {
238
- name: 'RN.Persona.EditText',
239
- parent: 'Persona.Inquiry2.EditText'
240
- }).ele('item', {
241
- name: 'android:textAppearance'
242
- }).txt('@style/RN.Persona.EditText.TextAppearance').up().ele('item', {
243
- name: 'android:textColor'
244
- }).txt(this.theme.textFieldTextColor).up().up();
245
- this.root = this.root.ele('style', {
246
- name: 'RN.Persona.EditText.TextAppearance',
247
- parent: 'Base.TextAppearance.TextAppearance.MaterialComponents.Body1'
248
- });
249
- if (this.theme.textFieldTextColor) {
250
- this.root = this.root.ele('item', {
251
- name: 'android:textSize'
252
- }).txt('18sp').up();
253
- }
254
- if (this.theme.textFieldTextFont) {
255
- this.root = this.root.ele('item', {
256
- name: 'android:fontFamily'
257
- }).txt(this.theme.textFieldTextFont).up();
258
- }
259
- this.root = this.root.up();
260
- });
261
- }
262
- }
263
- pickerText() {
264
- if (this.theme.pickerTextColor || this.theme.pickerTextFont) {
265
- this.printQueue.push(() => {
266
- this.root = this.root.ele('item', {
267
- name: 'spinnerStyle'
268
- }).txt('@style/RN.Persona.Spinner').up();
269
- this.root = this.root.ele('item', {
270
- name: 'spinnerDropDownItemStyle'
271
- }).txt('@style/RN.Persona.DropDownItem.Spinner').up();
272
- });
273
- this.postPrintQueue.push(() => {
274
- // Build Rn.Persona.Spinner
275
- this.root = this.root.ele('style', {
276
- name: 'RN.Persona.Spinner',
277
- parent: 'Persona.Inquiry2.Spinner'
278
- }).ele('item', {
279
- name: 'android:textColor'
280
- }).txt(this.theme.pickerTextColor ?? '?android:attr/textColorPrimary').up().ele('item', {
281
- name: 'android:textAppearance'
282
- }).txt(this.theme.pickerTextFont ? '@style/RN.Persona.Text.Spinner' : '@style/Persona.Inquiry2.Text.Body').up().up();
283
-
284
- // Build RN.Persona.DropDownItem.Spinner
285
- this.root = this.root.ele('style', {
286
- name: 'RN.Persona.DropDownItem.Spinner',
287
- parent: 'Persona.Inquiry2.Spinner'
288
- }).ele('item', {
289
- name: 'android:textColor'
290
- }).txt(this.theme.pickerTextColor ?? '?android:attr/textColorPrimary').up().ele('item', {
291
- name: 'android:textAppearance'
292
- }).txt(this.theme.pickerTextFont ? '@style/RN.Persona.Text.Spinner' : '@style/Persona.Inquiry2.Text.Body').up().up();
293
-
294
- // Build RN.Persona.Text.Spinner
295
- this.root = this.root.ele('style', {
296
- name: 'RN.Persona.Text.Spinner'
297
- });
298
- if (this.theme.pickerTextColor) {
299
- this.root = this.root.ele('item', {
300
- name: 'android:textColor'
301
- }).txt(this.theme.pickerTextColor).up();
302
- }
303
- if (this.theme.pickerTextFont) {
304
- // TODO: Add notice about how to add a custom font that can be
305
- // referenced here on Android
306
- this.root = this.root.ele('item', {
307
- name: 'android:fontFamily'
308
- }).txt(this.theme.pickerTextFont).up();
309
- }
310
- this.root = this.root.up();
311
- });
312
- }
313
- }
314
- button() {
315
- if (this.theme.buttonBackgroundColor || this.theme.buttonDisabledBackgroundColor || this.theme.buttonTouchedBackgroundColor || this.theme.buttonTextColor || this.theme.buttonDisabledTextColor || this.theme.buttonCornerRadius || this.theme.buttonFont) {
316
- this.printQueue.push(() => {
317
- this.root = this.root.ele('item', {
318
- name: 'buttonStyle'
319
- }).txt('@style/RN.Persona.Button').up();
320
- });
321
- this.postPrintQueue.push(() => {
322
- this.root = this.root.ele('style', {
323
- name: 'RN.Persona.Button',
324
- parent: 'Persona.Inquiry2.Button'
325
- })
326
- // Taken from
327
- // appcompat's res/values/values.xml
328
- .ele('item', {
329
- name: 'android:minHeight'
330
- }).txt('48dip').up()
331
- // Taken from
332
- // appcompat's res/values/values.xml
333
- .ele('item', {
334
- name: 'android:minWidth'
335
- }).txt('88dip').up()
336
- // Taken from
337
- // persona-android's shared/src/main/res/values/styles.xml
338
- .ele('item', {
339
- name: 'android:textSize'
340
- }).txt('18sp').up().ele('item', {
341
- name: 'android:background'
342
- }).txt('@drawable/rn_persona_button').up().ele('item', {
343
- name: 'android:textColor'
344
- }).txt('@color/rn_persona_button').up().up();
345
-
346
- // Disabled
347
- this.buttonDrawable = this.buttonDrawable.ele('item', {
348
- 'android:state_enabled': 'false'
349
- }).ele('shape', {
350
- 'android:shape': 'rectangle'
351
- }).ele('corners', {
352
- 'android:radius': this.theme.buttonCornerRadius ? `${this.theme.buttonCornerRadius}dp` : '@dimen/abc_control_corner_material'
353
- }).up().ele('padding', {
354
- 'android:left': '@dimen/abc_button_padding_horizontal_material',
355
- 'android:top': '@dimen/abc_button_padding_vertical_material',
356
- 'android:right': '@dimen/abc_button_padding_horizontal_material',
357
- 'android:bottom': '@dimen/abc_button_padding_vertical_material'
358
- }).up().ele('solid', {
359
- 'android:color': this.theme.buttonDisabledBackgroundColor ? this.theme.buttonDisabledBackgroundColor : '?attr/colorPrimaryVariant'
360
- }).up().up().up();
361
-
362
- // touched
363
- this.buttonDrawable = this.buttonDrawable.ele('item', {
364
- 'android:state_pressed': 'true'
365
- }).ele('shape', {
366
- 'android:shape': 'rectangle'
367
- }).ele('corners', {
368
- 'android:radius': this.theme.buttonCornerRadius ? `${this.theme.buttonCornerRadius}dp` : '@dimen/abc_control_corner_material'
369
- }).up().ele('solid', {
370
- 'android:color': this.theme.buttonTouchedBackgroundColor ?? '?attr/colorPrimaryVariant'
371
- }).up().ele('padding', {
372
- 'android:left': '@dimen/abc_button_padding_horizontal_material',
373
- 'android:top': '@dimen/abc_button_padding_vertical_material',
374
- 'android:right': '@dimen/abc_button_padding_horizontal_material',
375
- 'android:bottom': '@dimen/abc_button_padding_vertical_material'
376
- }).up().up().up();
377
- this.buttonDrawable = this.buttonDrawable.ele('item').ele('shape', {
378
- 'android:shape': 'rectangle'
379
- }).ele('corners', {
380
- 'android:radius': this.theme.buttonCornerRadius ? `${this.theme.buttonCornerRadius}dp` : '@dimen/abc_control_corner_material'
381
- }).up().ele('solid', {
382
- 'android:color': this.theme.buttonBackgroundColor ?? '?attr/colorPrimary'
383
- }).up().ele('padding', {
384
- 'android:left': '@dimen/abc_button_padding_horizontal_material',
385
- 'android:top': '@dimen/abc_button_padding_vertical_material',
386
- 'android:right': '@dimen/abc_button_padding_horizontal_material',
387
- 'android:bottom': '@dimen/abc_button_padding_vertical_material'
388
- }).up().up().up();
389
-
390
- // Finish button drawable
391
- this.buttonDrawable = this.buttonDrawable.up();
392
- this.buttonColor = this.buttonColor.ele('item', {
393
- 'android:state_enabled': 'false',
394
- 'android:color': this.theme.buttonDisabledTextColor ?? '@android:color/darker_gray'
395
- }).up().ele('item', {
396
- 'android:state_pressed': 'true',
397
- 'android:color': this.theme.buttonTextColor ?? '@android:color/white'
398
- }).up().ele('item', {
399
- 'android:color': this.theme.buttonTextColor ?? '@android:color/white'
400
- }).up();
401
- this.buttonColor = this.buttonColor.up();
402
- this.root = this.root.up();
403
- });
404
- }
405
- }
406
- progressColor() {
407
- if (this.theme.progressColor) {
408
- this.printQueue.push(() => {
409
- this.root = this.root.ele('item', {
410
- name: 'colorControlActivated'
411
- }).txt(this.theme.progressColor).up();
412
- });
413
- }
414
- }
415
- successAsset() {
416
- if (!this.theme.successAsset) return;
417
- this.printQueue.push(() => {
418
- this.root = this.root.ele('item', {
419
- name: 'personaInquiryCompleteImage'
420
- }).txt(this.theme.successAsset).up().txt(' ');
421
- });
422
- }
423
- failAsset() {
424
- if (!this.theme.failAsset) return;
425
- this.printQueue.push(() => {
426
- this.root = this.root.ele('item', {
427
- name: 'personaInquiryFailImage'
428
- }).txt(this.theme.failAsset).up().txt(' ');
429
- });
430
- }
431
- loadingAnimationAsset() {
432
- if (!this.theme.loadingAnimationAsset || !this.theme.loadingAnimationWidthPercent) return;
433
- this.printQueue.push(() => {
434
- this.root = this.root.ele('item', {
435
- name: 'personaInquiryLoadingLottieRaw'
436
- }).txt(this.theme.loadingAnimationAsset).up().txt(' ');
437
- this.root = this.root.ele('item', {
438
- name: 'personaInquiryLoadingLottieWidthPercent'
439
- }).txt(this.theme.loadingAnimationWidthPercent).up().txt(' ');
440
- });
441
- }
442
- selfieAnimationAsset() {
443
- if (!this.theme.selfieAnimationAsset || !this.theme.selfieAnimationWidthPercent) return;
444
- this.printQueue.push(() => {
445
- this.root = this.root.ele('item', {
446
- name: 'personaInquirySelfieLottieRaw'
447
- }).txt(this.theme.selfieAnimationAsset).up().txt(' ');
448
- this.root = this.root.ele('item', {
449
- name: 'personaInquirySelfieLottieWidthPercent'
450
- }).txt(this.theme.selfieAnimationWidthPercent).up().txt(' ');
451
- });
452
- }
453
- }
454
- export default AndroidResourcePrinter;
455
- //# sourceMappingURL=AndroidResourcePrinter.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["create","createXml","AndroidResourcePrinter","constructor","theme","_defineProperty","root","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","Object","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"],"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,SAASA,MAAM,IAAIC,SAAS,QAAQ,aAAa;AAIjD,MAAMC,sBAAsB,CAAC;EAS3BC,WAAWA,CAACC,KAAyB,EAAE;IAAAC,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA,wBAJP,EAAE;IAAAA,eAAA,qBACL,EAAE;IAAAA,eAAA,yBACE,EAAE;IAGjC,IAAI,CAACD,KAAK,GAAGA,KAAK;IAClB,IAAI,CAACE,IAAI,GAAGL,SAAS,CAAC;MAAEM,OAAO,EAAE;IAAM,CAAC,CAAC,CAACC,GAAG,CAAC,WAAW,CAAC;IAC1D,IAAI,CAACC,cAAc,GAAGR,SAAS,CAAC;MAAEM,OAAO,EAAE;IAAM,CAAC,CAAC,CAACC,GAAG,CAAC,UAAU,EAAE;MAClE,eAAe,EAAE;IACnB,CAAC,CAAC;IAC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AAG,CAAC;MAEX,IAAI,CAACvC,IAAI,GAAG,IAAI,CAACA,IAAI,CAClBE,GAAG,CAAC,MAAM,EAAE;QAAE0B,IAAI,EAAE;MAA0C,CAAC,CAAC,CAChEW,GAAG,CAAC,IAAI,CAACzC,KAAK,CAAC2D,4BAAsC,CAAC,CACtDlD,EAAE,CAAC,CAAC,CACJgC,GAAG,CAAC,GAAG,CAAC;IACb,CAAC,CAAC;EACJ;EAEQf,oBAAoBA,CAAA,EAAG;IAC7B,IACE,CAAC,IAAI,CAAC1B,KAAK,CAAC0B,oBAAoB,IAChC,CAAC,IAAI,CAAC1B,KAAK,CAAC4D,2BAA2B,EAEvC;IAEF,IAAI,CAAC5B,UAAU,CAACQ,IAAI,CAAC,MAAM;MACzB,IAAI,CAACtC,IAAI,GAAG,IAAI,CAACA,IAAI,CAClBE,GAAG,CAAC,MAAM,EAAE;QAAE0B,IAAI,EAAE;MAAgC,CAAC,CAAC,CACtDW,GAAG,CAAC,IAAI,CAACzC,KAAK,CAAC0B,oBAA8B,CAAC,CAC9CjB,EAAE,CAAC,CAAC,CACJgC,GAAG,CAAC,GAAG,CAAC;MAEX,IAAI,CAACvC,IAAI,GAAG,IAAI,CAACA,IAAI,CAClBE,GAAG,CAAC,MAAM,EAAE;QAAE0B,IAAI,EAAE;MAAyC,CAAC,CAAC,CAC/DW,GAAG,CAAC,IAAI,CAACzC,KAAK,CAAC4D,2BAAqC,CAAC,CACrDnD,EAAE,CAAC,CAAC,CACJgC,GAAG,CAAC,GAAG,CAAC;IACb,CAAC,CAAC;EACJ;AACF;AAEA,eAAe3C,sBAAsB"}
@@ -1,70 +0,0 @@
1
- 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; }
2
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
3
- 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); }
4
- import { cosmiconfig } from 'cosmiconfig';
5
- import chalk from 'chalk';
6
- import { ANDROID_THEME_CONFIG_KEY, IOS_THEME_CONFIG_KEY } from './Theme';
7
- class Configuration {
8
- constructor() {
9
- _defineProperty(this, "config", void 0);
10
- }
11
- async loadConfig() {
12
- if (this.config) return this.config;
13
- try {
14
- const explorer = cosmiconfig('persona', {
15
- packageProp: 'persona'
16
- });
17
- const result = await explorer.search();
18
- if (result == null) {
19
- return null;
20
- }
21
- this.config = result.config;
22
- return this.config;
23
- } catch (e) {
24
- console.error(e);
25
- process.exit(1);
26
- }
27
- }
28
- async get() {
29
- let config = await this.loadConfig();
30
- const androidThemeLines = [];
31
- for (const key in ANDROID_THEME_CONFIG_KEY) {
32
- androidThemeLines.push(` "${key}": null`);
33
- }
34
- const iosThemeLines = [];
35
- for (const key in IOS_THEME_CONFIG_KEY) {
36
- iosThemeLines.push(` "${key}": null`);
37
- }
38
- if (config == null) {
39
- console.log(`
40
- Missing configuration.
41
-
42
- In order to use this tool, it must be configured using a ${chalk.yellow('persona')} object within
43
- your package.json.
44
-
45
- To get started, paste the following configuration into your package.json
46
-
47
- {
48
- ...
49
-
50
- "persona": {
51
- "androidTheme": {
52
- ` + androidThemeLines.join(',\n') + `
53
- },
54
- "iosTheme": {
55
- ` + iosThemeLines.join(',\n') + `
56
- }
57
- }
58
-
59
- ...
60
- }
61
-
62
- and re-run this tool :).
63
- `);
64
- process.exit(1);
65
- }
66
- return config;
67
- }
68
- }
69
- export default new Configuration();
70
- //# sourceMappingURL=Config.js.map