react-native-persona 1.2.10 → 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +25 -0
- package/RNPersonaInquiry.podspec +1 -1
- package/android/README.md +14 -0
- package/android/build.gradle +21 -100
- package/bin/persona-tool +1 -2
- package/lib/commonjs/index.js +477 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/persona-tools/AndroidResourcePrinter.js +694 -0
- package/lib/commonjs/persona-tools/AndroidResourcePrinter.js.map +1 -0
- package/lib/commonjs/persona-tools/Config.js +95 -0
- package/lib/commonjs/persona-tools/Config.js.map +1 -0
- package/lib/commonjs/persona-tools/Theme.js +228 -0
- package/lib/commonjs/persona-tools/Theme.js.map +1 -0
- package/lib/commonjs/persona-tools/index.js +41 -0
- package/lib/commonjs/persona-tools/index.js.map +1 -0
- package/lib/commonjs/persona-tools/prompts.js +48 -0
- package/lib/commonjs/persona-tools/prompts.js.map +1 -0
- package/lib/commonjs/persona-tools/tools/AndroidThemeGenerator.js +112 -0
- package/lib/commonjs/persona-tools/tools/AndroidThemeGenerator.js.map +1 -0
- package/lib/commonjs/persona-tools/tools/IosThemeInstructions.js +50 -0
- package/lib/commonjs/persona-tools/tools/IosThemeInstructions.js.map +1 -0
- package/lib/commonjs/util.js +36 -0
- package/lib/commonjs/util.js.map +1 -0
- package/lib/module/index.js +452 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/persona-tools/AndroidResourcePrinter.js +686 -0
- package/lib/module/persona-tools/AndroidResourcePrinter.js.map +1 -0
- package/lib/module/persona-tools/Config.js +82 -0
- package/lib/module/persona-tools/Config.js.map +1 -0
- package/lib/module/persona-tools/Theme.js +212 -0
- package/lib/module/persona-tools/Theme.js.map +1 -0
- package/lib/module/persona-tools/index.js +33 -0
- package/lib/module/persona-tools/index.js.map +1 -0
- package/lib/module/persona-tools/prompts.js +31 -0
- package/lib/module/persona-tools/prompts.js.map +1 -0
- package/lib/module/persona-tools/tools/AndroidThemeGenerator.js +82 -0
- package/lib/module/persona-tools/tools/AndroidThemeGenerator.js.map +1 -0
- package/lib/module/persona-tools/tools/IosThemeInstructions.js +37 -0
- package/lib/module/persona-tools/tools/IosThemeInstructions.js.map +1 -0
- package/lib/module/util.js +29 -0
- package/lib/module/util.js.map +1 -0
- package/{generatedTypes → lib/typescript}/index.d.ts +67 -3
- package/lib/typescript/persona-tools/AndroidResourcePrinter.d.ts +40 -0
- package/lib/typescript/persona-tools/Config.d.ts +15 -0
- package/lib/typescript/persona-tools/Theme.d.ts +124 -0
- package/lib/typescript/persona-tools/index.d.ts +1 -0
- package/lib/typescript/persona-tools/prompts.d.ts +8 -0
- package/lib/typescript/persona-tools/tools/AndroidThemeGenerator.d.ts +5 -0
- package/lib/typescript/persona-tools/tools/IosThemeInstructions.d.ts +5 -0
- package/lib/typescript/util.d.ts +3 -0
- package/package.json +79 -22
- package/src/index.ts +17 -18
- package/{persona-tools/lib → src/persona-tools}/AndroidResourcePrinter.ts +314 -278
- package/{persona-tools/config.ts → src/persona-tools/Config.ts} +7 -7
- package/src/persona-tools/Theme.ts +262 -0
- package/src/persona-tools/index.ts +30 -0
- package/{persona-tools/lib → src/persona-tools}/prompts.ts +11 -11
- package/{persona-tools → src/persona-tools}/tools/AndroidThemeGenerator.ts +31 -32
- package/{persona-tools → src/persona-tools}/tools/IosThemeInstructions.ts +8 -8
- package/src/util.ts +3 -3
- package/jest.config.js +0 -10
- package/persona-tools/Theme.js +0 -213
- package/persona-tools/Theme.ts +0 -260
- package/persona-tools/config.js +0 -72
- package/persona-tools/index.js +0 -30
- package/persona-tools/index.ts +0 -30
- package/persona-tools/lib/AndroidResourcePrinter.js +0 -832
- package/persona-tools/lib/AndroidResourcePrinter.spec.js +0 -1135
- package/persona-tools/lib/AndroidResourcePrinter.spec.ts +0 -1229
- package/persona-tools/lib/prompts.js +0 -39
- package/persona-tools/tools/AndroidThemeGenerator.js +0 -59
- package/persona-tools/tools/IosThemeInstructions.js +0 -34
- package/src/index.js +0 -307
- package/src/util.js +0 -29
- package/src/util.spec.js +0 -15
- package/src/util.spec.ts +0 -16
- package/tsconfig.json +0 -29
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["AndroidResourcePrinter.ts"],"names":["create","createXml","AndroidResourcePrinter","constructor","theme","root","version","ele","buttonDrawable","buttonSecondaryDrawable","buttonColor","process","hasTheme","up","print","style","primaryColor","accentColor","darkPrimaryColor","backgroundColor","titleText","bodyText","footnoteText","cameraInstructionsText","cameraHintText","cameraGuideHintText","textField","pickerText","button","progressColor","successAsset","failAsset","loadingAnimationAsset","selfieAnimationAsset","preprintQueue","forEach","fn","name","parent","printQueue","postPrintQueue","Object","keys","length","values","filter","Boolean","push","txt","titleTextColor","titleTextSize","titleTextFont","textSize","bodyTextColor","bodyTextSize","bodyTextFont","footnoteTextColor","footnoteTextFont","footnoteTextSize","cameraInstructionsTextColor","cameraInstructionsTextSize","cameraInstructionsTextFont","cameraHintTextColor","cameraHintTextSize","cameraHintTextFont","cameraGuideHintTextColor","cameraGuideHintTextSize","cameraGuideHintTextFont","textFieldTextColor","textFieldTextFont","pickerTextColor","pickerTextFont","buttonBackgroundColor","buttonDisabledBackgroundColor","buttonTouchedBackgroundColor","buttonTextColor","buttonDisabledTextColor","buttonCornerRadius","buttonFont","buttonTextSize","loadingAnimationWidthPercent","selfieAnimationWidthPercent"],"mappings":";;AAAA,SAASA,MAAM,IAAIC,SAAnB,QAAoC,aAApC;;AAIA,MAAMC,sBAAN,CAA6B;AAU3BC,EAAAA,WAAW,CAACC,KAAD,EAA4B;AAAA;;AAAA;;AAAA;;AAAA;;AAAA;;AAAA,2CAJP,EAIO;;AAAA,wCAHV,EAGU;;AAAA,4CAFN,EAEM;;AACrC,SAAKA,KAAL,GAAaA,KAAb;AACA,SAAKC,IAAL,GAAYJ,SAAS,CAAC;AAAEK,MAAAA,OAAO,EAAE;AAAX,KAAD,CAAT,CAA8BC,GAA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AaD;;AAEOf,EAAAA,oBAAoB,GAAG;AAC7B,QACE,CAAC,KAAK7B,KAAL,CAAW6B,oBAAZ,IACA,CAAC,KAAK7B,KAAL,CAAW6E,2BAFd,EAIE;AAEF,SAAK1C,UAAL,CAAgBQ,IAAhB,CAAqB,MAAM;AACzB,WAAK1C,IAAL,GAAY,KAAKA,IAAL,CACTE,GADS,CACL,MADK,EACG;AAAE8B,QAAAA,IAAI,EAAE;AAAR,OADH,EAETW,GAFS,CAEL,KAAK5C,KAAL,CAAW6B,oBAFN,EAGTpB,EAHS,GAITmC,GAJS,CAIL,GAJK,CAAZ;AAMA,WAAK3C,IAAL,GAAY,KAAKA,IAAL,CACTE,GADS,CACL,MADK,EACG;AAAE8B,QAAAA,IAAI,EAAE;AAAR,OADH,EAETW,GAFS,CAEL,KAAK5C,KAAL,CAAW6E,2BAFN,EAGTpE,EAHS,GAITmC,GAJS,CAIL,GAJK,CAAZ;AAKD,KAZD;AAaD;;AA56B0B;;AA+6B7B,eAAe9C,sBAAf","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 buttonSecondaryDrawable: 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.buttonSecondaryDrawable = createXml({ version: '1.0' }).ele(\n 'selector',\n {\n 'xmlns:android': 'http://schemas.android.com/apk/res/android',\n }\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 buttonSecondaryDrawable: this.buttonSecondaryDrawable,\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.cameraInstructionsText();\n this.cameraHintText();\n this.cameraGuideHintText();\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.Inquiry.Theme',\n parent: 'Base.Persona.Inquiry.Theme.Light',\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: 'colorAccent' })\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: 'colorPrimaryDark' })\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 (\n this.theme.titleTextColor ||\n this.theme.titleTextSize ||\n this.theme.titleTextFont\n ) {\n this.printQueue.push(() => {\n this.root = this.root\n .ele('item', { name: 'personaTitleTextAppearance' })\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.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 const textSize = this.theme.titleTextSize\n ? `${this.theme.titleTextSize}sp`\n : '26sp';\n this.root = this.root\n .ele('item', { name: 'android:textSize' })\n .txt(textSize)\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: 'personaTitleTextAppearance' })\n .txt('@style/Persona.Text.Title')\n .up();\n });\n }\n }\n\n private bodyText() {\n if (\n this.theme.bodyTextColor ||\n this.theme.bodyTextSize ||\n this.theme.bodyTextFont\n ) {\n this.printQueue.push(() => {\n this.root = this.root\n .ele('item', { name: 'personaBodyTextAppearance' })\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.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 const textSize = this.theme.bodyTextSize\n ? `${this.theme.bodyTextSize}sp`\n : '18sp';\n this.root = this.root\n .ele('item', { name: 'android:textSize' })\n .txt(textSize)\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: 'personaBodyTextAppearance' })\n .txt('@style/Persona.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: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 // Default value found in the Android SDK\n const textSize = this.theme.footnoteTextSize\n ? `${this.theme.footnoteTextSize}sp`\n : '@dimen/abc_text_size_small_material';\n this.root = this.root\n .ele('item', { name: 'android:textSize' })\n .txt(textSize)\n .up();\n\n this.root = this.root.up();\n });\n }\n }\n\n private cameraInstructionsText() {\n if (\n this.theme.cameraInstructionsTextColor ||\n this.theme.cameraInstructionsTextSize ||\n this.theme.cameraInstructionsTextFont\n ) {\n this.printQueue.push(() => {\n this.root = this.root\n .ele('item', { name: 'personaCameraTitleTextAppearance' })\n .txt('@style/RN.Persona.Text.CameraTitle')\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.CameraTitle',\n parent: 'Persona.Text.CameraTitle',\n });\n\n if (this.theme.cameraInstructionsTextColor) {\n this.root = this.root\n .ele('item', { name: 'android:textColor' })\n .txt(this.theme.cameraInstructionsTextColor as string)\n .up();\n }\n\n if (this.theme.cameraInstructionsTextFont) {\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.cameraInstructionsTextFont as string)\n .up();\n }\n\n const textSize = this.theme.cameraInstructionsTextSize\n ? `${this.theme.cameraInstructionsTextSize}sp`\n : '20sp';\n this.root = this.root\n .ele('item', { name: 'android:textSize' })\n .txt(textSize)\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: 'personaCameraTitleTextAppearance' })\n .txt('@style/Persona.Text.CameraTitle')\n .up();\n });\n }\n }\n\n private cameraHintText() {\n if (\n this.theme.cameraHintTextColor ||\n this.theme.cameraHintTextSize ||\n this.theme.cameraHintTextFont\n ) {\n this.printQueue.push(() => {\n this.root = this.root\n .ele('item', { name: 'personaCameraBodyTextAppearance' })\n .txt('@style/RN.Persona.Text.CameraBody')\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.CameraBody',\n parent: 'Persona.Text.CameraBody',\n });\n\n if (this.theme.cameraHintTextColor) {\n this.root = this.root\n .ele('item', { name: 'android:textColor' })\n .txt(this.theme.cameraHintTextColor as string)\n .up();\n }\n\n if (this.theme.cameraHintTextFont) {\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.cameraHintTextFont as string)\n .up();\n }\n\n const textSize = this.theme.cameraHintTextSize\n ? `${this.theme.cameraHintTextSize}sp`\n : '16sp';\n this.root = this.root\n .ele('item', { name: 'android:textSize' })\n .txt(textSize)\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: 'personaCameraBodyTextAppearance' })\n .txt('@style/Persona.Text.CameraBody')\n .up();\n });\n }\n }\n\n private cameraGuideHintText() {\n if (\n this.theme.cameraGuideHintTextColor ||\n this.theme.cameraGuideHintTextSize ||\n this.theme.cameraGuideHintTextFont\n ) {\n this.printQueue.push(() => {\n this.root = this.root\n .ele('item', { name: 'personaCameraHintTextAppearance' })\n .txt('@style/RN.Persona.Text.CameraHint')\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.CameraHint',\n parent: 'Persona.Text.CameraHint',\n });\n\n if (this.theme.cameraGuideHintTextColor) {\n this.root = this.root\n .ele('item', { name: 'android:textColor' })\n .txt(this.theme.cameraGuideHintTextColor as string)\n .up();\n }\n\n if (this.theme.cameraGuideHintTextFont) {\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.cameraGuideHintTextFont as string)\n .up();\n }\n\n const textSize = this.theme.cameraGuideHintTextSize\n ? `${this.theme.cameraGuideHintTextSize}sp`\n : '20sp';\n this.root = this.root\n .ele('item', { name: 'android:textSize' })\n .txt(textSize)\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: 'personaCameraHintTextAppearance' })\n .txt('@style/Persona.Text.CameraHint')\n .up();\n });\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: 'Widget.AppCompat.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.AppCompat.Medium',\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: 'Widget.AppCompat.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.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: 'Widget.AppCompat.DropDownItem.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.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 this.theme.buttonTextSize\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 this.root = this.root\n .ele('item', { name: 'buttonStyleSecondary' })\n .txt('@style/RN.Persona.Button.Secondary')\n .up();\n });\n\n const textSize = this.theme.buttonTextSize\n ? `${this.theme.buttonTextSize}sp`\n : '18sp';\n\n this.postPrintQueue.push(() => {\n this.root = this.root\n .ele('style', {\n name: 'RN.Persona.Button',\n parent: 'android:style/Widget.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(textSize)\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 // Build RN.Persona.Button.Secondary\n this.root = this.root\n .ele('style', {\n name: 'RN.Persona.Button.Secondary',\n parent: 'RN.Persona.Button',\n })\n .ele('item', {\n name: 'android:background',\n })\n .txt('@drawable/rn_persona_button_secondary')\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/colorPrimaryDark',\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/colorPrimaryDark',\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 // Disabled\n this.buttonSecondaryDrawable = this.buttonSecondaryDrawable\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': '@android:color/darker_gray',\n })\n .up()\n .up()\n .up();\n\n // touched\n this.buttonSecondaryDrawable = this.buttonSecondaryDrawable\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': '@color/grayButtonDark',\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.buttonSecondaryDrawable = this.buttonSecondaryDrawable\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': '@color/grayButton',\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.buttonSecondaryDrawable = this.buttonSecondaryDrawable.up();\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"]}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2
|
+
|
|
3
|
+
import { cosmiconfig } from 'cosmiconfig';
|
|
4
|
+
import chalk from 'chalk';
|
|
5
|
+
import { ANDROID_THEME_CONFIG_KEY, IOS_THEME_CONFIG_KEY } from './Theme';
|
|
6
|
+
|
|
7
|
+
class Configuration {
|
|
8
|
+
constructor() {
|
|
9
|
+
_defineProperty(this, "config", void 0);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
async loadConfig() {
|
|
13
|
+
if (this.config) return this.config;
|
|
14
|
+
|
|
15
|
+
try {
|
|
16
|
+
const explorer = cosmiconfig('persona', {
|
|
17
|
+
packageProp: 'persona'
|
|
18
|
+
});
|
|
19
|
+
const result = await explorer.search();
|
|
20
|
+
|
|
21
|
+
if (result == null) {
|
|
22
|
+
return null;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
this.config = result.config;
|
|
26
|
+
return this.config;
|
|
27
|
+
} catch (e) {
|
|
28
|
+
console.error(e);
|
|
29
|
+
process.exit(1);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
async get() {
|
|
34
|
+
let config = await this.loadConfig();
|
|
35
|
+
const androidThemeLines = [];
|
|
36
|
+
|
|
37
|
+
for (const key in ANDROID_THEME_CONFIG_KEY) {
|
|
38
|
+
androidThemeLines.push(` "${key}": null`);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const iosThemeLines = [];
|
|
42
|
+
|
|
43
|
+
for (const key in IOS_THEME_CONFIG_KEY) {
|
|
44
|
+
iosThemeLines.push(` "${key}": null`);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
if (config == null) {
|
|
48
|
+
console.log(`
|
|
49
|
+
Missing configuration.
|
|
50
|
+
|
|
51
|
+
In order to use this tool, it must be configured using a ${chalk.yellow('persona')} object within
|
|
52
|
+
your package.json.
|
|
53
|
+
|
|
54
|
+
To get started, paste the following configuration into your package.json
|
|
55
|
+
|
|
56
|
+
{
|
|
57
|
+
...
|
|
58
|
+
|
|
59
|
+
"persona": {
|
|
60
|
+
"androidTheme": {
|
|
61
|
+
` + androidThemeLines.join(',\n') + `
|
|
62
|
+
},
|
|
63
|
+
"iosTheme": {
|
|
64
|
+
` + iosThemeLines.join(',\n') + `
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
...
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
and re-run this tool :).
|
|
72
|
+
`);
|
|
73
|
+
process.exit(1);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
return config;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export default new Configuration();
|
|
82
|
+
//# sourceMappingURL=Config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["Config.ts"],"names":["cosmiconfig","chalk","ANDROID_THEME_CONFIG_KEY","IOS_THEME_CONFIG_KEY","Configuration","loadConfig","config","explorer","packageProp","result","search","e","console","error","process","exit","get","androidThemeLines","key","push","iosThemeLines","log","yellow","join"],"mappings":";;AAAA,SAASA,WAAT,QAA4B,aAA5B;AACA,OAAOC,KAAP,MAAkB,OAAlB;AACA,SAASC,wBAAT,EAAmCC,oBAAnC,QAA+D,SAA/D;;AAOA,MAAMC,aAAN,CAAoB;AAAA;AAAA;AAAA;;AAGF,QAAVC,UAAU,GAA6C;AAC3D,QAAI,KAAKC,MAAT,EAAiB,OAAO,KAAKA,MAAZ;;AAEjB,QAAI;AACF,YAAMC,QAAQ,GAAGP,WAAW,CAAC,SAAD,EAAY;AAAEQ,QAAAA,WAAW,EAAE;AAAf,OAAZ,CAA5B;AACA,YAAMC,MAAM,GAAG,MAAMF,QAAQ,CAACG,MAAT,EAArB;;AACA,UAAID,MAAM,IAAI,IAAd,EAAoB;AAClB,eAAO,IAAP;AACD;;AAED,WAAKH,MAAL,GAAcG,MAAM,CAACH,MAArB;AAEA,aAAO,KAAKA,MAAZ;AACD,KAVD,CAUE,OAAOK,CAAP,EAAU;AACVC,MAAAA,OAAO,CAACC,KAAR,CAAcF,CAAd;AACAG,MAAAA,OAAO,CAACC,IAAR,CAAa,CAAb;AACD;AACF;;AAEQ,QAAHC,GAAG,GAA0B;AACjC,QAAIV,MAAM,GAAG,MAAM,KAAKD,UAAL,EAAnB;AAEA,UAAMY,iBAAiB,GAAG,EAA1B;;AACA,SAAK,MAAMC,GAAX,IAAkBhB,wBAAlB,EAA4C;AAC1Ce,MAAAA,iBAAiB,CAACE,IAAlB,CAAwB,UAASD,GAAI,SAArC;AACD;;AAED,UAAME,aAAa,GAAG,EAAtB;;AACA,SAAK,MAAMF,GAAX,IAAkBf,oBAAlB,EAAwC;AACtCiB,MAAAA,aAAa,CAACD,IAAd,CAAoB,UAASD,GAAI,SAAjC;AACD;;AAED,QAAIZ,MAAM,IAAI,IAAd,EAAoB;AAClBM,MAAAA,OAAO,CAACS,GAAR,CACG;AACT;AACA;AACA,2DAA2DpB,KAAK,CAACqB,MAAN,CACjD,SADiD,CAEjD;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAfQ,GAgBEL,iBAAiB,CAACM,IAAlB,CAAuB,KAAvB,CAhBF,GAiBG;AACX;AACA;AACA,CApBQ,GAqBEH,aAAa,CAACG,IAAd,CAAmB,KAAnB,CArBF,GAsBG;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CA/BM;AAiCAT,MAAAA,OAAO,CAACC,IAAR,CAAa,CAAb;AACD;;AAED,WAAOT,MAAP;AACD;;AAzEiB;;AA4EpB,eAAe,IAAIF,aAAJ,EAAf","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"]}
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
import Table from 'cli-table';
|
|
2
|
+
import chalk from 'chalk';
|
|
3
|
+
import Config from './Config';
|
|
4
|
+
const COLOR_REGEX = /^[a-zA-Z0-9]{6}$/;
|
|
5
|
+
export let ANDROID_THEME_CONFIG_KEY;
|
|
6
|
+
|
|
7
|
+
(function (ANDROID_THEME_CONFIG_KEY) {
|
|
8
|
+
ANDROID_THEME_CONFIG_KEY["backgroundColor"] = "backgroundColor";
|
|
9
|
+
ANDROID_THEME_CONFIG_KEY["primaryColor"] = "primaryColor";
|
|
10
|
+
ANDROID_THEME_CONFIG_KEY["darkPrimaryColor"] = "darkPrimaryColor";
|
|
11
|
+
ANDROID_THEME_CONFIG_KEY["accentColor"] = "accentColor";
|
|
12
|
+
ANDROID_THEME_CONFIG_KEY["titleTextColor"] = "titleTextColor";
|
|
13
|
+
ANDROID_THEME_CONFIG_KEY["titleTextFont"] = "titleTextFont";
|
|
14
|
+
ANDROID_THEME_CONFIG_KEY["titleTextSize"] = "titleTextSize";
|
|
15
|
+
ANDROID_THEME_CONFIG_KEY["bodyTextColor"] = "bodyTextColor";
|
|
16
|
+
ANDROID_THEME_CONFIG_KEY["bodyTextFont"] = "bodyTextFont";
|
|
17
|
+
ANDROID_THEME_CONFIG_KEY["bodyTextSize"] = "bodyTextSize";
|
|
18
|
+
ANDROID_THEME_CONFIG_KEY["footnoteTextColor"] = "footnoteTextColor";
|
|
19
|
+
ANDROID_THEME_CONFIG_KEY["footnoteTextFont"] = "footnoteTextFont";
|
|
20
|
+
ANDROID_THEME_CONFIG_KEY["footnoteTextSize"] = "footnoteTextSize";
|
|
21
|
+
ANDROID_THEME_CONFIG_KEY["cameraInstructionsTextColor"] = "cameraInstructionsTextColor";
|
|
22
|
+
ANDROID_THEME_CONFIG_KEY["cameraInstructionsTextFont"] = "cameraInstructionsTextFont";
|
|
23
|
+
ANDROID_THEME_CONFIG_KEY["cameraInstructionsTextSize"] = "cameraInstructionsTextSize";
|
|
24
|
+
ANDROID_THEME_CONFIG_KEY["cameraHintTextColor"] = "cameraHintTextColor";
|
|
25
|
+
ANDROID_THEME_CONFIG_KEY["cameraHintTextFont"] = "cameraHintTextFont";
|
|
26
|
+
ANDROID_THEME_CONFIG_KEY["cameraHintTextSize"] = "cameraHintTextSize";
|
|
27
|
+
ANDROID_THEME_CONFIG_KEY["cameraGuideHintTextColor"] = "cameraGuideHintTextColor";
|
|
28
|
+
ANDROID_THEME_CONFIG_KEY["cameraGuideHintTextFont"] = "cameraGuideHintTextFont";
|
|
29
|
+
ANDROID_THEME_CONFIG_KEY["cameraGuideHintTextSize"] = "cameraGuideHintTextSize";
|
|
30
|
+
ANDROID_THEME_CONFIG_KEY["textFieldTextColor"] = "textFieldTextColor";
|
|
31
|
+
ANDROID_THEME_CONFIG_KEY["textFieldTextFont"] = "textFieldTextFont";
|
|
32
|
+
ANDROID_THEME_CONFIG_KEY["pickerTextColor"] = "pickerTextColor";
|
|
33
|
+
ANDROID_THEME_CONFIG_KEY["pickerTextFont"] = "pickerTextFont";
|
|
34
|
+
ANDROID_THEME_CONFIG_KEY["buttonBackgroundColor"] = "buttonBackgroundColor";
|
|
35
|
+
ANDROID_THEME_CONFIG_KEY["buttonDisabledBackgroundColor"] = "buttonDisabledBackgroundColor";
|
|
36
|
+
ANDROID_THEME_CONFIG_KEY["buttonTouchedBackgroundColor"] = "buttonTouchedBackgroundColor";
|
|
37
|
+
ANDROID_THEME_CONFIG_KEY["buttonTextColor"] = "buttonTextColor";
|
|
38
|
+
ANDROID_THEME_CONFIG_KEY["buttonDisabledTextColor"] = "buttonDisabledTextColor";
|
|
39
|
+
ANDROID_THEME_CONFIG_KEY["buttonCornerRadius"] = "buttonCornerRadius";
|
|
40
|
+
ANDROID_THEME_CONFIG_KEY["buttonFont"] = "buttonFont";
|
|
41
|
+
ANDROID_THEME_CONFIG_KEY["buttonTextSize"] = "buttonTextSize";
|
|
42
|
+
ANDROID_THEME_CONFIG_KEY["progressColor"] = "progressColor";
|
|
43
|
+
ANDROID_THEME_CONFIG_KEY["successAsset"] = "successAsset";
|
|
44
|
+
ANDROID_THEME_CONFIG_KEY["failAsset"] = "failAsset";
|
|
45
|
+
ANDROID_THEME_CONFIG_KEY["loadingAnimationAsset"] = "loadingAnimationAsset";
|
|
46
|
+
ANDROID_THEME_CONFIG_KEY["loadingAnimationWidthPercent"] = "loadingAnimationWidthPercent";
|
|
47
|
+
ANDROID_THEME_CONFIG_KEY["selfieAnimationAsset"] = "selfieAnimationAsset";
|
|
48
|
+
ANDROID_THEME_CONFIG_KEY["selfieAnimationWidthPercent"] = "selfieAnimationWidthPercent";
|
|
49
|
+
})(ANDROID_THEME_CONFIG_KEY || (ANDROID_THEME_CONFIG_KEY = {}));
|
|
50
|
+
|
|
51
|
+
export let IOS_THEME_CONFIG_KEY;
|
|
52
|
+
|
|
53
|
+
(function (IOS_THEME_CONFIG_KEY) {
|
|
54
|
+
IOS_THEME_CONFIG_KEY["backgroundColor"] = "backgroundColor";
|
|
55
|
+
IOS_THEME_CONFIG_KEY["primaryColor"] = "primaryColor";
|
|
56
|
+
IOS_THEME_CONFIG_KEY["darkPrimaryColor"] = "darkPrimaryColor";
|
|
57
|
+
IOS_THEME_CONFIG_KEY["accentColor"] = "accentColor";
|
|
58
|
+
IOS_THEME_CONFIG_KEY["progressColor"] = "progressColor";
|
|
59
|
+
IOS_THEME_CONFIG_KEY["overlayBackgroundColor"] = "overlayBackgroundColor";
|
|
60
|
+
IOS_THEME_CONFIG_KEY["titleTextColor"] = "titleTextColor";
|
|
61
|
+
IOS_THEME_CONFIG_KEY["titleTextFont"] = "titleTextFont";
|
|
62
|
+
IOS_THEME_CONFIG_KEY["titleTextSize"] = "titleTextSize";
|
|
63
|
+
IOS_THEME_CONFIG_KEY["titleTextAlignment"] = "titleTextAlignment";
|
|
64
|
+
IOS_THEME_CONFIG_KEY["bodyTextColor"] = "bodyTextColor";
|
|
65
|
+
IOS_THEME_CONFIG_KEY["bodyTextFont"] = "bodyTextFont";
|
|
66
|
+
IOS_THEME_CONFIG_KEY["bodyTextSize"] = "bodyTextSize";
|
|
67
|
+
IOS_THEME_CONFIG_KEY["bodyTextAlignment"] = "bodyTextAlignment";
|
|
68
|
+
IOS_THEME_CONFIG_KEY["footnoteTextColor"] = "footnoteTextColor";
|
|
69
|
+
IOS_THEME_CONFIG_KEY["footnoteTextFont"] = "footnoteTextFont";
|
|
70
|
+
IOS_THEME_CONFIG_KEY["footnoteTextSize"] = "footnoteTextSize";
|
|
71
|
+
IOS_THEME_CONFIG_KEY["formLabelTextColor"] = "formLabelTextColor";
|
|
72
|
+
IOS_THEME_CONFIG_KEY["formLabelTextFont"] = "formLabelTextFont";
|
|
73
|
+
IOS_THEME_CONFIG_KEY["textFieldTextColor"] = "textFieldTextColor";
|
|
74
|
+
IOS_THEME_CONFIG_KEY["textFieldBackgroundColor"] = "textFieldBackgroundColor";
|
|
75
|
+
IOS_THEME_CONFIG_KEY["textFieldBorderColor"] = "textFieldBorderColor";
|
|
76
|
+
IOS_THEME_CONFIG_KEY["pickerTextColor"] = "pickerTextColor";
|
|
77
|
+
IOS_THEME_CONFIG_KEY["pickerTextFont"] = "pickerTextFont";
|
|
78
|
+
IOS_THEME_CONFIG_KEY["cameraInstructionsTextColor"] = "cameraInstructionsTextColor";
|
|
79
|
+
IOS_THEME_CONFIG_KEY["cameraInstructionsTextFont"] = "cameraInstructionsTextFont";
|
|
80
|
+
IOS_THEME_CONFIG_KEY["cameraInstructionsTextSize"] = "cameraInstructionsTextFont";
|
|
81
|
+
IOS_THEME_CONFIG_KEY["cameraHintTextColor"] = "cameraHintTextColor";
|
|
82
|
+
IOS_THEME_CONFIG_KEY["cameraHintTextFont"] = "cameraHintTextFont";
|
|
83
|
+
IOS_THEME_CONFIG_KEY["cameraHintTextSize"] = "cameraHintTextSize";
|
|
84
|
+
IOS_THEME_CONFIG_KEY["cameraGuideHintTextColor"] = "cameraGuideHintTextColor";
|
|
85
|
+
IOS_THEME_CONFIG_KEY["cameraGuideHintTextFont"] = "cameraGuideHintTextFont";
|
|
86
|
+
IOS_THEME_CONFIG_KEY["cameraGuideHintTextSize"] = "cameraGuideHintTextSize";
|
|
87
|
+
IOS_THEME_CONFIG_KEY["buttonBackgroundColor"] = "buttonBackgroundColor";
|
|
88
|
+
IOS_THEME_CONFIG_KEY["buttonDisabledBackgroundColor"] = "buttonDisabledBackgroundColor";
|
|
89
|
+
IOS_THEME_CONFIG_KEY["buttonTouchedBackgroundColor"] = "buttonTouchedBackgroundColor";
|
|
90
|
+
IOS_THEME_CONFIG_KEY["buttonImageTintColor"] = "buttonImageTintColor";
|
|
91
|
+
IOS_THEME_CONFIG_KEY["buttonImageHidden"] = "buttonImageHidden";
|
|
92
|
+
IOS_THEME_CONFIG_KEY["buttonCornerRadius"] = "buttonCornerRadius";
|
|
93
|
+
IOS_THEME_CONFIG_KEY["buttonTextAlignment"] = "buttonTextAlignment";
|
|
94
|
+
IOS_THEME_CONFIG_KEY["buttonDisabledTextColor"] = "buttonDisabledTextColor";
|
|
95
|
+
IOS_THEME_CONFIG_KEY["buttonTextColor"] = "buttonTextColor";
|
|
96
|
+
IOS_THEME_CONFIG_KEY["buttonFont"] = "buttonFont";
|
|
97
|
+
IOS_THEME_CONFIG_KEY["buttonTextSize"] = "buttonTextSize";
|
|
98
|
+
IOS_THEME_CONFIG_KEY["selectedCellBackgroundColor"] = "selectedCellBackgroundColor";
|
|
99
|
+
IOS_THEME_CONFIG_KEY["closeButtonTintColor"] = "closeButtonTintColor";
|
|
100
|
+
IOS_THEME_CONFIG_KEY["cancelButtonBackgroundColor"] = "cancelButtonBackgroundColor";
|
|
101
|
+
IOS_THEME_CONFIG_KEY["cameraButtonBackgroundColor"] = "cameraButtonBackgroundColor";
|
|
102
|
+
IOS_THEME_CONFIG_KEY["cameraGuideCornersColor"] = "cameraGuideCornersColor";
|
|
103
|
+
IOS_THEME_CONFIG_KEY["successAssetName"] = "successAssetName";
|
|
104
|
+
IOS_THEME_CONFIG_KEY["successAssetWidth"] = "successAssetWidth";
|
|
105
|
+
IOS_THEME_CONFIG_KEY["successAssetHeight"] = "successAssetHeight";
|
|
106
|
+
IOS_THEME_CONFIG_KEY["verificationFailAssetName"] = "verificationFailAssetName";
|
|
107
|
+
IOS_THEME_CONFIG_KEY["verificationFailAssetWidth"] = "verificationFailAssetWidth";
|
|
108
|
+
IOS_THEME_CONFIG_KEY["verificationFailAssetHeight"] = "verificationFailAssetHeight";
|
|
109
|
+
IOS_THEME_CONFIG_KEY["failAssetName"] = "failAssetName";
|
|
110
|
+
IOS_THEME_CONFIG_KEY["failAssetWidth"] = "failAssetWidth";
|
|
111
|
+
IOS_THEME_CONFIG_KEY["failAssetHeight"] = "failAssetHeight";
|
|
112
|
+
IOS_THEME_CONFIG_KEY["loadingAnimationAssetName"] = "loadingAnimationAssetName";
|
|
113
|
+
IOS_THEME_CONFIG_KEY["loadingAnimationAssetWidth"] = "loadingAnimationAssetWidth";
|
|
114
|
+
IOS_THEME_CONFIG_KEY["loadingAnimationAssetHeight"] = "loadingAnimationAssetHeight";
|
|
115
|
+
IOS_THEME_CONFIG_KEY["processingAnimationAssetName"] = "processingAnimationAssetName";
|
|
116
|
+
IOS_THEME_CONFIG_KEY["processingAnimationAssetWidth"] = "processingAnimationAssetWidth";
|
|
117
|
+
IOS_THEME_CONFIG_KEY["processingAnimationAssetHeight"] = "processingAnimationAssetHeight";
|
|
118
|
+
IOS_THEME_CONFIG_KEY["selfieAnimationAssetName"] = "selfieAnimationAssetName";
|
|
119
|
+
IOS_THEME_CONFIG_KEY["selfieAnimationAssetWidth"] = "selfieAnimationAssetWidth";
|
|
120
|
+
IOS_THEME_CONFIG_KEY["selfieAnimationAssetHeight"] = "selfieAnimationAssetHeight";
|
|
121
|
+
})(IOS_THEME_CONFIG_KEY || (IOS_THEME_CONFIG_KEY = {}));
|
|
122
|
+
|
|
123
|
+
class Theme {
|
|
124
|
+
async print() {
|
|
125
|
+
let platform = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'android';
|
|
126
|
+
const config = await Config.get();
|
|
127
|
+
const themeConfig = platform === 'android' ? config.androidTheme : config.iosTheme;
|
|
128
|
+
let usesCustomFontAndroid = false;
|
|
129
|
+
let usesCustomFontIos = false;
|
|
130
|
+
const head = platform === 'android' ? ['Style Item', 'Value', 'Note'] : ['Style Item', 'Value', 'Note'];
|
|
131
|
+
const table = new Table({
|
|
132
|
+
head,
|
|
133
|
+
// prettier-ignore
|
|
134
|
+
chars: {
|
|
135
|
+
'mid': '',
|
|
136
|
+
'left-mid': '',
|
|
137
|
+
'mid-mid': '',
|
|
138
|
+
'right-mid': ''
|
|
139
|
+
}
|
|
140
|
+
});
|
|
141
|
+
console.log('Specified theme values:');
|
|
142
|
+
const keyEnum = platform === 'android' ? ANDROID_THEME_CONFIG_KEY : IOS_THEME_CONFIG_KEY;
|
|
143
|
+
|
|
144
|
+
for (const key in keyEnum) {
|
|
145
|
+
let override = themeConfig[key];
|
|
146
|
+
let colorOverride = key.includes('Color') || key.includes('color');
|
|
147
|
+
|
|
148
|
+
if (override) {
|
|
149
|
+
if (colorOverride) {
|
|
150
|
+
override = normalizeColor(override, key);
|
|
151
|
+
} else {
|
|
152
|
+
override = override.toString();
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
if (key.includes('Font')) {
|
|
157
|
+
if (platform == 'android') {
|
|
158
|
+
usesCustomFontAndroid = true;
|
|
159
|
+
} else {
|
|
160
|
+
usesCustomFontIos = true;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
let row;
|
|
165
|
+
row = [key, override ? valueColor(colorOverride, override) : chalk.yellow('unspecified'), key.includes('Font') ? chalk.cyan('Fonts that are not built-in need to be installed.') : ''];
|
|
166
|
+
table.push(row);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
console.log(table.toString());
|
|
170
|
+
|
|
171
|
+
if (usesCustomFontAndroid) {
|
|
172
|
+
console.log(chalk.yellow(' NOTE') + ': 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');
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
if (usesCustomFontIos) {
|
|
176
|
+
console.log(chalk.yellow(' NOTE') + ': 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');
|
|
177
|
+
} // Add newline for spacing
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
console.log('');
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
} // set default print color for non-color overrides
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
function valueColor(isColorOverride, override) {
|
|
187
|
+
return isColorOverride ? chalk.hex(override)(override) : chalk.magentaBright(override);
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
function normalizeColor(colorHex, themeKey) {
|
|
191
|
+
let hex = colorHex;
|
|
192
|
+
|
|
193
|
+
if (colorHex[0] === '#') {
|
|
194
|
+
hex = colorHex.slice(1);
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
if (!COLOR_REGEX.test(hex)) {
|
|
198
|
+
if (themeKey) {
|
|
199
|
+
console.error(`Received a color value of ${chalk.yellow(colorHex)} for ${chalk.red(themeKey)}.\nFormat must follow standard 6 character hexadecimal color code. Eg. ${chalk.bgHex('#FFFFFF').hex('#7E66B7')('#290087')}`);
|
|
200
|
+
} else {
|
|
201
|
+
console.error(`Received a color value of ${chalk.yellow(colorHex)}.\nFormat must follow standard 6 character hexadecimal color code. Eg. ${chalk.bgHex('#FFFFFF').hex('#7E66B7')('#290087')}`);
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
console.log('');
|
|
205
|
+
process.exit(1);
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
return colorHex;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
export default new Theme();
|
|
212
|
+
//# sourceMappingURL=Theme.js.map
|
|
@@ -0,0 +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;AAA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AACC,GAAR,CAAY,EAAZ;AACD;;AA5ES,C,CA+EZ;;;AACA,SAASS,UAAT,CAAoBI,eAApB,EAA8CV,QAA9C,EAAgE;AAC9D,SAAOU,eAAe,GAClBhC,KAAK,CAACiC,GAAN,CAAUX,QAAV,EAAoBA,QAApB,CADkB,GAElBtB,KAAK,CAACkC,aAAN,CAAoBZ,QAApB,CAFJ;AAGD;;AAED,SAASG,cAAT,CAAwBU,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,CAACnC,WAAW,CAACoC,IAAZ,CAAiBL,GAAjB,CAAL,EAA4B;AAC1B,QAAIG,QAAJ,EAAc;AACZlB,MAAAA,OAAO,CAACqB,KAAR,CACG,6BAA4BvC,KAAK,CAAC6B,MAAN,CAAaM,QAAb,CAAuB,QAAOnC,KAAK,CAACwC,GAAN,CACzDJ,QADyD,CAEzD,0EAAyEpC,KAAK,CAC7EyC,KADwE,CAClE,SADkE,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 titleTextSize = 'titleTextSize',\n\n bodyTextColor = 'bodyTextColor',\n bodyTextFont = 'bodyTextFont',\n bodyTextSize = 'bodyTextSize',\n\n footnoteTextColor = 'footnoteTextColor',\n footnoteTextFont = 'footnoteTextFont',\n footnoteTextSize = 'footnoteTextSize',\n\n cameraInstructionsTextColor = 'cameraInstructionsTextColor',\n cameraInstructionsTextFont = 'cameraInstructionsTextFont',\n cameraInstructionsTextSize = 'cameraInstructionsTextSize',\n\n cameraHintTextColor = 'cameraHintTextColor',\n cameraHintTextFont = 'cameraHintTextFont',\n cameraHintTextSize = 'cameraHintTextSize',\n\n cameraGuideHintTextColor = 'cameraGuideHintTextColor',\n cameraGuideHintTextFont = 'cameraGuideHintTextFont',\n cameraGuideHintTextSize = 'cameraGuideHintTextSize',\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 buttonTextSize = 'buttonTextSize',\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 progressColor = 'progressColor',\n overlayBackgroundColor = 'overlayBackgroundColor',\n titleTextColor = 'titleTextColor',\n titleTextFont = 'titleTextFont',\n titleTextSize = 'titleTextSize',\n titleTextAlignment = 'titleTextAlignment',\n bodyTextColor = 'bodyTextColor',\n bodyTextFont = 'bodyTextFont',\n bodyTextSize = 'bodyTextSize',\n bodyTextAlignment = 'bodyTextAlignment',\n footnoteTextColor = 'footnoteTextColor',\n footnoteTextFont = 'footnoteTextFont',\n footnoteTextSize = 'footnoteTextSize',\n formLabelTextColor = 'formLabelTextColor',\n formLabelTextFont = 'formLabelTextFont',\n textFieldTextColor = 'textFieldTextColor',\n textFieldBackgroundColor = 'textFieldBackgroundColor',\n textFieldBorderColor = 'textFieldBorderColor',\n pickerTextColor = 'pickerTextColor',\n pickerTextFont = 'pickerTextFont',\n cameraInstructionsTextColor = 'cameraInstructionsTextColor',\n cameraInstructionsTextFont = 'cameraInstructionsTextFont',\n cameraInstructionsTextSize = 'cameraInstructionsTextFont',\n cameraHintTextColor = 'cameraHintTextColor',\n cameraHintTextFont = 'cameraHintTextFont',\n cameraHintTextSize = 'cameraHintTextSize',\n cameraGuideHintTextColor = 'cameraGuideHintTextColor',\n cameraGuideHintTextFont = 'cameraGuideHintTextFont',\n cameraGuideHintTextSize = 'cameraGuideHintTextSize',\n buttonBackgroundColor = 'buttonBackgroundColor',\n buttonDisabledBackgroundColor = 'buttonDisabledBackgroundColor',\n buttonTouchedBackgroundColor = 'buttonTouchedBackgroundColor',\n buttonImageTintColor = 'buttonImageTintColor',\n buttonImageHidden = 'buttonImageHidden',\n buttonCornerRadius = 'buttonCornerRadius',\n buttonTextAlignment = 'buttonTextAlignment',\n buttonDisabledTextColor = 'buttonDisabledTextColor',\n buttonTextColor = 'buttonTextColor',\n buttonFont = 'buttonFont',\n buttonTextSize = 'buttonTextSize',\n selectedCellBackgroundColor = 'selectedCellBackgroundColor',\n closeButtonTintColor = 'closeButtonTintColor',\n cancelButtonBackgroundColor = 'cancelButtonBackgroundColor',\n cameraButtonBackgroundColor = 'cameraButtonBackgroundColor',\n cameraGuideCornersColor = 'cameraGuideCornersColor',\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"]}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import Config from './Config';
|
|
2
|
+
import { TOOL_CHOICE, whatWouldYouLikePrompt } from './prompts';
|
|
3
|
+
import AndroidThemeGenerator from './tools/AndroidThemeGenerator';
|
|
4
|
+
import IosThemeInstructions from './tools/IosThemeInstructions';
|
|
5
|
+
console.log('');
|
|
6
|
+
console.log('============================================');
|
|
7
|
+
console.log('Persona React Native SDK customization tool.');
|
|
8
|
+
console.log('============================================');
|
|
9
|
+
console.log('');
|
|
10
|
+
|
|
11
|
+
const run = async () => {
|
|
12
|
+
// Run this once to print warning messages if it's not configured.
|
|
13
|
+
await Config.get();
|
|
14
|
+
const {
|
|
15
|
+
choice
|
|
16
|
+
} = await whatWouldYouLikePrompt();
|
|
17
|
+
|
|
18
|
+
switch (choice) {
|
|
19
|
+
case TOOL_CHOICE.AndroidTheme:
|
|
20
|
+
await AndroidThemeGenerator.run();
|
|
21
|
+
break;
|
|
22
|
+
|
|
23
|
+
case TOOL_CHOICE.iosTheme:
|
|
24
|
+
await IosThemeInstructions.run();
|
|
25
|
+
break;
|
|
26
|
+
|
|
27
|
+
default:
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
run();
|
|
33
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["index.ts"],"names":["Config","TOOL_CHOICE","whatWouldYouLikePrompt","AndroidThemeGenerator","IosThemeInstructions","console","log","run","get","choice","AndroidTheme","iosTheme"],"mappings":"AAAA,OAAOA,MAAP,MAAmB,UAAnB;AACA,SAASC,WAAT,EAAsBC,sBAAtB,QAAoD,WAApD;AACA,OAAOC,qBAAP,MAAkC,+BAAlC;AACA,OAAOC,oBAAP,MAAiC,8BAAjC;AAEAC,OAAO,CAACC,GAAR,CAAY,EAAZ;AACAD,OAAO,CAACC,GAAR,CAAY,8CAAZ;AACAD,OAAO,CAACC,GAAR,CAAY,8CAAZ;AACAD,OAAO,CAACC,GAAR,CAAY,8CAAZ;AACAD,OAAO,CAACC,GAAR,CAAY,EAAZ;;AAEA,MAAMC,GAAG,GAAG,YAAY;AACtB;AACA,QAAMP,MAAM,CAACQ,GAAP,EAAN;AAEA,QAAM;AAAEC,IAAAA;AAAF,MAAa,MAAMP,sBAAsB,EAA/C;;AAEA,UAAQO,MAAR;AACE,SAAKR,WAAW,CAACS,YAAjB;AACE,YAAMP,qBAAqB,CAACI,GAAtB,EAAN;AACA;;AACF,SAAKN,WAAW,CAACU,QAAjB;AACE,YAAMP,oBAAoB,CAACG,GAArB,EAAN;AACA;;AACF;AACE;AARJ;AAUD,CAhBD;;AAkBAA,GAAG","sourcesContent":["import Config from './Config';\nimport { TOOL_CHOICE, whatWouldYouLikePrompt } from './prompts';\nimport AndroidThemeGenerator from './tools/AndroidThemeGenerator';\nimport IosThemeInstructions from './tools/IosThemeInstructions';\n\nconsole.log('');\nconsole.log('============================================');\nconsole.log('Persona React Native SDK customization tool.');\nconsole.log('============================================');\nconsole.log('');\n\nconst run = async () => {\n // Run this once to print warning messages if it's not configured.\n await Config.get();\n\n const { choice } = await whatWouldYouLikePrompt();\n\n switch (choice) {\n case TOOL_CHOICE.AndroidTheme:\n await AndroidThemeGenerator.run();\n break;\n case TOOL_CHOICE.iosTheme:\n await IosThemeInstructions.run();\n break;\n default:\n return;\n }\n};\n\nrun();\n"]}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import inquirer from 'inquirer';
|
|
2
|
+
export const TOOL_CHOICE = {
|
|
3
|
+
AndroidTheme: 'Update Android theme',
|
|
4
|
+
iosTheme: 'Update iOS theme'
|
|
5
|
+
};
|
|
6
|
+
export async function whatWouldYouLikePrompt() {
|
|
7
|
+
const questions = {
|
|
8
|
+
name: 'choice',
|
|
9
|
+
type: 'list',
|
|
10
|
+
choices: [TOOL_CHOICE.AndroidTheme, TOOL_CHOICE.iosTheme],
|
|
11
|
+
message: 'What would you like to do?'
|
|
12
|
+
};
|
|
13
|
+
return inquirer.prompt(questions);
|
|
14
|
+
}
|
|
15
|
+
export async function confirmThemeValues() {
|
|
16
|
+
const questions = {
|
|
17
|
+
name: 'isConfirmed',
|
|
18
|
+
type: 'confirm',
|
|
19
|
+
message: 'Do these values look right?'
|
|
20
|
+
};
|
|
21
|
+
return inquirer.prompt(questions);
|
|
22
|
+
}
|
|
23
|
+
export async function confirmResourceFiles() {
|
|
24
|
+
const questions = {
|
|
25
|
+
name: 'isConfirmed',
|
|
26
|
+
type: 'confirm',
|
|
27
|
+
message: `Continue?`
|
|
28
|
+
};
|
|
29
|
+
return inquirer.prompt(questions);
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=prompts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["prompts.ts"],"names":["inquirer","TOOL_CHOICE","AndroidTheme","iosTheme","whatWouldYouLikePrompt","questions","name","type","choices","message","prompt","confirmThemeValues","confirmResourceFiles"],"mappings":"AAAA,OAAOA,QAAP,MAA6C,UAA7C;AAEA,OAAO,MAAMC,WAAW,GAAG;AACzBC,EAAAA,YAAY,EAAE,sBADW;AAEzBC,EAAAA,QAAQ,EAAE;AAFe,CAApB;AAIP,OAAO,eAAeC,sBAAf,GAAwC;AAC7C,QAAMC,SAAS,GAAG;AAChBC,IAAAA,IAAI,EAAE,QADU;AAEhBC,IAAAA,IAAI,EAAE,MAFU;AAGhBC,IAAAA,OAAO,EAAE,CAACP,WAAW,CAACC,YAAb,EAA2BD,WAAW,CAACE,QAAvC,CAHO;AAIhBM,IAAAA,OAAO,EAAE;AAJO,GAAlB;AAOA,SAAOT,QAAQ,CAACU,MAAT,CAAgBL,SAAhB,CAAP;AACD;AAED,OAAO,eAAeM,kBAAf,GAAoC;AACzC,QAAMN,SAAS,GAAG;AAChBC,IAAAA,IAAI,EAAE,aADU;AAEhBC,IAAAA,IAAI,EAAE,SAFU;AAGhBE,IAAAA,OAAO,EAAE;AAHO,GAAlB;AAMA,SAAOT,QAAQ,CAACU,MAAT,CAAgBL,SAAhB,CAAP;AACD;AAED,OAAO,eAAeO,oBAAf,GAAsC;AAC3C,QAAMP,SAAS,GAAG;AAChBC,IAAAA,IAAI,EAAE,aADU;AAEhBC,IAAAA,IAAI,EAAE,SAFU;AAGhBE,IAAAA,OAAO,EAAG;AAHM,GAAlB;AAMA,SAAOT,QAAQ,CAACU,MAAT,CAAgBL,SAAhB,CAAP;AACD","sourcesContent":["import inquirer, { QuestionCollection } from 'inquirer';\n\nexport const TOOL_CHOICE = {\n AndroidTheme: 'Update Android theme',\n iosTheme: 'Update iOS theme',\n};\nexport async function whatWouldYouLikePrompt() {\n const questions = {\n name: 'choice',\n type: 'list',\n choices: [TOOL_CHOICE.AndroidTheme, TOOL_CHOICE.iosTheme],\n message: 'What would you like to do?',\n } as QuestionCollection;\n\n return inquirer.prompt(questions);\n}\n\nexport async function confirmThemeValues() {\n const questions = {\n name: 'isConfirmed',\n type: 'confirm',\n message: 'Do these values look right?',\n } as QuestionCollection;\n\n return inquirer.prompt(questions);\n}\n\nexport async function confirmResourceFiles() {\n const questions = {\n name: 'isConfirmed',\n type: 'confirm',\n message: `Continue?`,\n } as QuestionCollection;\n\n return inquirer.prompt(questions);\n}\n"]}
|