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.
- package/README.md +0 -42
- package/RNPersonaInquiry2.podspec +1 -1
- package/android/build.gradle +1 -1
- package/package.json +1 -12
- package/bin/persona-tool +0 -3
- package/lib/commonjs/persona-tool/AndroidResourcePrinter.js +0 -462
- package/lib/commonjs/persona-tool/AndroidResourcePrinter.js.map +0 -1
- package/lib/commonjs/persona-tool/Config.js +0 -78
- package/lib/commonjs/persona-tool/Config.js.map +0 -1
- package/lib/commonjs/persona-tool/Theme.js +0 -188
- package/lib/commonjs/persona-tool/Theme.js.map +0 -1
- package/lib/commonjs/persona-tool/index.js +0 -31
- package/lib/commonjs/persona-tool/index.js.map +0 -1
- package/lib/commonjs/persona-tool/prompts.js +0 -42
- package/lib/commonjs/persona-tool/prompts.js.map +0 -1
- package/lib/commonjs/persona-tool/tools/AndroidThemeGenerator.js +0 -74
- package/lib/commonjs/persona-tool/tools/AndroidThemeGenerator.js.map +0 -1
- package/lib/commonjs/persona-tool/tools/IosThemeInstructions.js +0 -40
- package/lib/commonjs/persona-tool/tools/IosThemeInstructions.js.map +0 -1
- package/lib/module/persona-tool/AndroidResourcePrinter.js +0 -455
- package/lib/module/persona-tool/AndroidResourcePrinter.js.map +0 -1
- package/lib/module/persona-tool/Config.js +0 -70
- package/lib/module/persona-tool/Config.js.map +0 -1
- package/lib/module/persona-tool/Theme.js +0 -178
- package/lib/module/persona-tool/Theme.js.map +0 -1
- package/lib/module/persona-tool/index.js +0 -28
- package/lib/module/persona-tool/index.js.map +0 -1
- package/lib/module/persona-tool/prompts.js +0 -31
- package/lib/module/persona-tool/prompts.js.map +0 -1
- package/lib/module/persona-tool/tools/AndroidThemeGenerator.js +0 -66
- package/lib/module/persona-tool/tools/AndroidThemeGenerator.js.map +0 -1
- package/lib/module/persona-tool/tools/IosThemeInstructions.js +0 -32
- package/lib/module/persona-tool/tools/IosThemeInstructions.js.map +0 -1
- package/lib/typescript/persona-tool/AndroidResourcePrinter.d.ts +0 -35
- package/lib/typescript/persona-tool/Config.d.ts +0 -15
- package/lib/typescript/persona-tool/Theme.d.ts +0 -108
- package/lib/typescript/persona-tool/index.d.ts +0 -1
- package/lib/typescript/persona-tool/prompts.d.ts +0 -8
- package/lib/typescript/persona-tool/tools/AndroidThemeGenerator.d.ts +0 -5
- package/lib/typescript/persona-tool/tools/IosThemeInstructions.d.ts +0 -5
- package/src/persona-tool/AndroidResourcePrinter.ts +0 -652
- package/src/persona-tool/Config.ts +0 -86
- package/src/persona-tool/Theme.ts +0 -243
- package/src/persona-tool/index.ts +0 -30
- package/src/persona-tool/prompts.ts +0 -36
- package/src/persona-tool/tools/AndroidThemeGenerator.ts +0 -100
- package/src/persona-tool/tools/IosThemeInstructions.ts +0 -41
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_xmlbuilder","require","_defineProperty","obj","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","arg","_toPrimitive","String","input","hint","prim","Symbol","toPrimitive","undefined","res","call","TypeError","Number","AndroidResourcePrinter","constructor","theme","root","createXml","version","ele","buttonDrawable","buttonColor","process","hasTheme","up","print","style","primaryColor","accentColor","darkPrimaryColor","backgroundColor","titleText","bodyText","footnoteText","textField","pickerText","button","progressColor","successAsset","failAsset","loadingAnimationAsset","selfieAnimationAsset","preprintQueue","forEach","fn","name","parent","printQueue","postPrintQueue","keys","length","values","filter","Boolean","push","txt","titleTextColor","titleTextFont","bodyTextColor","bodyTextFont","footnoteTextColor","footnoteTextFont","textFieldTextColor","textFieldTextFont","pickerTextColor","pickerTextFont","buttonBackgroundColor","buttonDisabledBackgroundColor","buttonTouchedBackgroundColor","buttonTextColor","buttonDisabledTextColor","buttonCornerRadius","buttonFont","loadingAnimationWidthPercent","selfieAnimationWidthPercent","_default","exports","default"],"sources":["AndroidResourcePrinter.ts"],"sourcesContent":["import { create as createXml } from 'xmlbuilder2';\nimport type { AndroidThemeObject } from './Theme';\nimport type { XMLBuilder } from 'xmlbuilder2/lib/interfaces';\n\nclass AndroidResourcePrinter {\n theme: AndroidThemeObject;\n root: XMLBuilder;\n buttonDrawable: XMLBuilder;\n buttonColor: XMLBuilder;\n preprintQueue: (() => void)[] = [];\n printQueue: (() => void)[] = [];\n postPrintQueue: (() => void)[] = [];\n\n constructor(theme: AndroidThemeObject) {\n this.theme = theme;\n this.root = createXml({ version: '1.0' }).ele('resources');\n this.buttonDrawable = createXml({ version: '1.0' }).ele('selector', {\n 'xmlns:android': 'http://schemas.android.com/apk/res/android',\n });\n this.buttonColor = createXml({ version: '1.0' }).ele('selector', {\n 'xmlns:android': 'http://schemas.android.com/apk/res/android',\n });\n }\n\n process() {\n if (!this.hasTheme()) {\n this.root = this.root.up();\n } else {\n this.print();\n }\n\n return {\n style: this.root,\n buttonDrawable: this.buttonDrawable,\n buttonColor: this.buttonColor,\n };\n }\n\n private print() {\n this.primaryColor();\n this.accentColor();\n this.darkPrimaryColor();\n this.backgroundColor();\n this.titleText();\n this.bodyText();\n this.footnoteText();\n // this.formLabelText();\n this.textField();\n this.pickerText();\n this.button();\n this.progressColor();\n this.successAsset();\n this.failAsset();\n this.loadingAnimationAsset();\n this.selfieAnimationAsset();\n\n this.preprintQueue.forEach((fn) => fn());\n\n // Precreate some style namespaces\n this.root = this.root\n .ele('style', {\n name: 'RN',\n })\n .up();\n this.root = this.root\n .ele('style', {\n name: 'RN.Persona',\n })\n .up();\n this.root = this.root\n .ele('style', {\n name: 'RN.Persona.Text',\n })\n .up();\n this.root = this.root.ele('style', {\n name: 'Persona.Inquiry2.Theme',\n parent: 'Base.Persona.Inquiry2.Theme',\n });\n this.printQueue.forEach((fn) => fn());\n this.root = this.root.up();\n this.postPrintQueue.forEach((fn) => fn());\n }\n\n private hasTheme(): boolean {\n return (\n Object.keys(this.theme).length > 0 &&\n Object.values(this.theme).filter(Boolean).length > 0\n );\n }\n\n private primaryColor() {\n if (!this.theme.primaryColor) return;\n\n this.printQueue.push(() => {\n this.root = this.root\n .ele('item', { name: 'colorPrimary' })\n .txt(this.theme.primaryColor as string)\n .up()\n .txt(' ');\n });\n }\n\n private accentColor() {\n if (!this.theme.accentColor) return;\n\n this.printQueue.push(() => {\n this.root = this.root\n .ele('item', { name: 'colorSecondary' })\n .txt(this.theme.accentColor as string)\n .up()\n .txt(' ');\n });\n }\n\n private darkPrimaryColor() {\n if (!this.theme.darkPrimaryColor) return;\n\n this.printQueue.push(() => {\n this.root = this.root\n .ele('item', { name: 'colorPrimaryVariant' })\n .txt(this.theme.darkPrimaryColor as string)\n .up()\n .txt(' ');\n });\n }\n\n private backgroundColor() {\n if (!this.theme.backgroundColor) return;\n\n this.preprintQueue.push(() => {\n this.root = this.root\n .ele('color', { name: 'customPersonaBackgroundColor' })\n .txt(this.theme.backgroundColor as string)\n .up()\n .txt(' ');\n });\n\n this.printQueue.push(() => {\n this.root = this.root\n .ele('item', { name: 'android:colorBackground' })\n .txt('@color/customPersonaBackgroundColor')\n .up()\n .txt(' ');\n });\n }\n\n private titleText() {\n if (this.theme.titleTextColor || this.theme.titleTextFont) {\n this.printQueue.push(() => {\n this.root = this.root\n .ele('item', { name: 'textAppearanceHeadline6' })\n .txt('@style/RN.Persona.Text.Title')\n .up();\n });\n\n // Create a text appearance\n this.postPrintQueue.push(() => {\n this.root = this.root.ele('style', {\n name: 'RN.Persona.Text.Title',\n parent: 'Persona.Inquiry2.Text.Body',\n });\n\n if (this.theme.titleTextColor) {\n this.root = this.root\n .ele('item', { name: 'android:textColor' })\n .txt(this.theme.titleTextColor as string)\n .up();\n }\n\n if (this.theme.titleTextFont) {\n // TODO: Add notice about how to add a custom font that can be\n // referenced here on Android\n this.root = this.root\n .ele('item', { name: 'android:fontFamily' })\n .txt(this.theme.titleTextFont as string)\n .up();\n }\n\n // Default values taken from `Persona.Text.Title`\n // in shared/src/main/res/values/styles.xml\n this.root = this.root\n .ele('item', { name: 'android:textSize' })\n .txt('26sp')\n .up()\n .ele('item', { name: 'android:textStyle' })\n .txt('bold')\n .up();\n\n this.root = this.root.up();\n });\n } else {\n this.printQueue.push(() => {\n this.root = this.root\n .ele('item', { name: 'textAppearanceHeadline6' })\n .txt('@style/Persona.Text.Title')\n .up();\n });\n }\n }\n\n private bodyText() {\n if (this.theme.bodyTextColor || this.theme.bodyTextFont) {\n this.printQueue.push(() => {\n this.root = this.root\n .ele('item', { name: 'textAppearanceSubtitle1' })\n .txt('@style/RN.Persona.Text.Body')\n .up();\n });\n\n // Create a text appearance\n this.postPrintQueue.push(() => {\n this.root = this.root.ele('style', {\n name: 'RN.Persona.Text.Body',\n parent: 'Persona.Inquiry2.Text.Body',\n });\n\n if (this.theme.bodyTextColor) {\n this.root = this.root\n .ele('item', { name: 'android:textColor' })\n .txt(this.theme.bodyTextColor as string)\n .up();\n }\n\n if (this.theme.bodyTextFont) {\n // TODO: Add notice about how to add a custom font that can be\n // referenced here on Android\n this.root = this.root\n .ele('item', { name: 'android:fontFamily' })\n .txt(this.theme.bodyTextFont as string)\n .up();\n }\n\n // Default values taken from `Persona.Text.Body`\n // in shared/src/main/res/values/styles.xml\n this.root = this.root\n .ele('item', { name: 'android:textSize' })\n .txt('18sp')\n .up();\n\n this.root = this.root.up();\n });\n } else {\n this.printQueue.push(() => {\n this.root = this.root\n .ele('item', { name: 'textAppearanceSubtitle1' })\n .txt('@style/Persona.Inquiry2.Text.Body')\n .up();\n });\n }\n }\n\n private footnoteText() {\n if (this.theme.footnoteTextColor || this.theme.footnoteTextFont) {\n this.postPrintQueue.push(() => {\n this.root = this.root\n .ele('style', { name: 'TextAppearance.AppCompat.Small' })\n .ele('item', { name: 'android:textSize' })\n // Used default value found in the Android SDK\n .txt('@dimen/abc_text_size_small_material')\n .up()\n .ele('item', { name: 'android:textColor' })\n .txt(\n // Used default value found in the Android SDK\n this.theme.footnoteTextColor ?? '?android:attr/textColorTertiary'\n )\n .up();\n\n if (this.theme.footnoteTextFont) {\n this.root = this.root\n .ele('item', { name: 'android:fontFamily' })\n .txt(\n // Used default value found in the Android SDK\n this.theme.footnoteTextFont ?? '?android:attr/textColorTertiary'\n )\n .up();\n }\n\n this.root = this.root.up();\n });\n }\n }\n private textField() {\n if (this.theme.textFieldTextColor || this.theme.textFieldTextFont) {\n this.printQueue.push(() => {\n this.root = this.root\n .ele('item', { name: 'editTextStyle' })\n .txt('@style/RN.Persona.EditText')\n .up();\n });\n\n this.postPrintQueue.push(() => {\n this.root = this.root\n .ele('style', {\n name: 'RN.Persona.EditText',\n parent: 'Persona.Inquiry2.EditText',\n })\n .ele('item', { name: 'android:textAppearance' })\n .txt('@style/RN.Persona.EditText.TextAppearance')\n .up()\n .ele('item', { name: 'android:textColor' })\n .txt(this.theme.textFieldTextColor as string)\n .up()\n .up();\n\n this.root = this.root.ele('style', {\n name: 'RN.Persona.EditText.TextAppearance',\n parent: 'Base.TextAppearance.TextAppearance.MaterialComponents.Body1',\n });\n\n if (this.theme.textFieldTextColor) {\n this.root = this.root\n .ele('item', { name: 'android:textSize' })\n .txt('18sp')\n .up();\n }\n\n if (this.theme.textFieldTextFont) {\n this.root = this.root\n .ele('item', { name: 'android:fontFamily' })\n .txt(this.theme.textFieldTextFont as string)\n .up();\n }\n\n this.root = this.root.up();\n });\n }\n }\n\n private pickerText() {\n if (this.theme.pickerTextColor || this.theme.pickerTextFont) {\n this.printQueue.push(() => {\n this.root = this.root\n .ele('item', { name: 'spinnerStyle' })\n .txt('@style/RN.Persona.Spinner')\n .up();\n\n this.root = this.root\n .ele('item', { name: 'spinnerDropDownItemStyle' })\n .txt('@style/RN.Persona.DropDownItem.Spinner')\n .up();\n });\n\n this.postPrintQueue.push(() => {\n // Build Rn.Persona.Spinner\n this.root = this.root\n .ele('style', {\n name: 'RN.Persona.Spinner',\n parent: 'Persona.Inquiry2.Spinner',\n })\n .ele('item', { name: 'android:textColor' })\n .txt(this.theme.pickerTextColor ?? '?android:attr/textColorPrimary')\n .up()\n .ele('item', { name: 'android:textAppearance' })\n .txt(\n this.theme.pickerTextFont\n ? '@style/RN.Persona.Text.Spinner'\n : '@style/Persona.Inquiry2.Text.Body'\n )\n .up()\n .up();\n\n // Build RN.Persona.DropDownItem.Spinner\n this.root = this.root\n .ele('style', {\n name: 'RN.Persona.DropDownItem.Spinner',\n parent: 'Persona.Inquiry2.Spinner',\n })\n .ele('item', { name: 'android:textColor' })\n .txt(this.theme.pickerTextColor ?? '?android:attr/textColorPrimary')\n .up()\n .ele('item', { name: 'android:textAppearance' })\n .txt(\n this.theme.pickerTextFont\n ? '@style/RN.Persona.Text.Spinner'\n : '@style/Persona.Inquiry2.Text.Body'\n )\n .up()\n .up();\n\n // Build RN.Persona.Text.Spinner\n this.root = this.root.ele('style', {\n name: 'RN.Persona.Text.Spinner',\n });\n\n if (this.theme.pickerTextColor) {\n this.root = this.root\n .ele('item', { name: 'android:textColor' })\n .txt(this.theme.pickerTextColor as string)\n .up();\n }\n\n if (this.theme.pickerTextFont) {\n // TODO: Add notice about how to add a custom font that can be\n // referenced here on Android\n this.root = this.root\n .ele('item', { name: 'android:fontFamily' })\n .txt(this.theme.pickerTextFont as string)\n .up();\n }\n\n this.root = this.root.up();\n });\n }\n }\n\n private button() {\n if (\n this.theme.buttonBackgroundColor ||\n this.theme.buttonDisabledBackgroundColor ||\n this.theme.buttonTouchedBackgroundColor ||\n this.theme.buttonTextColor ||\n this.theme.buttonDisabledTextColor ||\n this.theme.buttonCornerRadius ||\n this.theme.buttonFont\n ) {\n this.printQueue.push(() => {\n this.root = this.root\n .ele('item', { name: 'buttonStyle' })\n .txt('@style/RN.Persona.Button')\n .up();\n });\n\n this.postPrintQueue.push(() => {\n this.root = this.root\n .ele('style', {\n name: 'RN.Persona.Button',\n parent: 'Persona.Inquiry2.Button',\n })\n // Taken from\n // appcompat's res/values/values.xml\n .ele('item', {\n name: 'android:minHeight',\n })\n .txt('48dip')\n .up()\n // Taken from\n // appcompat's res/values/values.xml\n .ele('item', {\n name: 'android:minWidth',\n })\n .txt('88dip')\n .up()\n // Taken from\n // persona-android's shared/src/main/res/values/styles.xml\n .ele('item', {\n name: 'android:textSize',\n })\n .txt('18sp')\n .up()\n .ele('item', {\n name: 'android:background',\n })\n .txt('@drawable/rn_persona_button')\n .up()\n .ele('item', {\n name: 'android:textColor',\n })\n .txt('@color/rn_persona_button')\n .up()\n .up();\n\n // Disabled\n this.buttonDrawable = this.buttonDrawable\n .ele('item', {\n 'android:state_enabled': 'false',\n })\n .ele('shape', { 'android:shape': 'rectangle' })\n .ele('corners', {\n 'android:radius': this.theme.buttonCornerRadius\n ? `${this.theme.buttonCornerRadius}dp`\n : '@dimen/abc_control_corner_material',\n })\n .up()\n .ele('padding', {\n 'android:left': '@dimen/abc_button_padding_horizontal_material',\n 'android:top': '@dimen/abc_button_padding_vertical_material',\n 'android:right': '@dimen/abc_button_padding_horizontal_material',\n 'android:bottom': '@dimen/abc_button_padding_vertical_material',\n })\n .up()\n .ele('solid', {\n 'android:color': this.theme.buttonDisabledBackgroundColor\n ? this.theme.buttonDisabledBackgroundColor\n : '?attr/colorPrimaryVariant',\n })\n .up()\n .up()\n .up();\n\n // touched\n this.buttonDrawable = this.buttonDrawable\n .ele('item', {\n 'android:state_pressed': 'true',\n })\n .ele('shape', { 'android:shape': 'rectangle' })\n .ele('corners', {\n 'android:radius': this.theme.buttonCornerRadius\n ? `${this.theme.buttonCornerRadius}dp`\n : '@dimen/abc_control_corner_material',\n })\n .up()\n .ele('solid', {\n 'android:color':\n this.theme.buttonTouchedBackgroundColor ??\n '?attr/colorPrimaryVariant',\n })\n .up()\n .ele('padding', {\n 'android:left': '@dimen/abc_button_padding_horizontal_material',\n 'android:top': '@dimen/abc_button_padding_vertical_material',\n 'android:right': '@dimen/abc_button_padding_horizontal_material',\n 'android:bottom': '@dimen/abc_button_padding_vertical_material',\n })\n .up()\n .up()\n .up();\n\n this.buttonDrawable = this.buttonDrawable\n .ele('item')\n .ele('shape', { 'android:shape': 'rectangle' })\n .ele('corners', {\n 'android:radius': this.theme.buttonCornerRadius\n ? `${this.theme.buttonCornerRadius}dp`\n : '@dimen/abc_control_corner_material',\n })\n .up()\n .ele('solid', {\n 'android:color':\n this.theme.buttonBackgroundColor ?? '?attr/colorPrimary',\n })\n .up()\n .ele('padding', {\n 'android:left': '@dimen/abc_button_padding_horizontal_material',\n 'android:top': '@dimen/abc_button_padding_vertical_material',\n 'android:right': '@dimen/abc_button_padding_horizontal_material',\n 'android:bottom': '@dimen/abc_button_padding_vertical_material',\n })\n .up()\n .up()\n .up();\n\n // Finish button drawable\n this.buttonDrawable = this.buttonDrawable.up();\n\n this.buttonColor = this.buttonColor\n .ele('item', {\n 'android:state_enabled': 'false',\n 'android:color':\n this.theme.buttonDisabledTextColor ??\n '@android:color/darker_gray',\n })\n .up()\n .ele('item', {\n 'android:state_pressed': 'true',\n 'android:color':\n this.theme.buttonTextColor ?? '@android:color/white',\n })\n .up()\n .ele('item', {\n 'android:color':\n this.theme.buttonTextColor ?? '@android:color/white',\n })\n .up();\n\n this.buttonColor = this.buttonColor.up();\n\n this.root = this.root.up();\n });\n }\n }\n\n private progressColor() {\n if (this.theme.progressColor) {\n this.printQueue.push(() => {\n this.root = this.root\n .ele('item', { name: 'colorControlActivated' })\n .txt(this.theme.progressColor as string)\n .up();\n });\n }\n }\n\n private successAsset() {\n if (!this.theme.successAsset) return;\n\n this.printQueue.push(() => {\n this.root = this.root\n .ele('item', { name: 'personaInquiryCompleteImage' })\n .txt(this.theme.successAsset as string)\n .up()\n .txt(' ');\n });\n }\n\n private failAsset() {\n if (!this.theme.failAsset) return;\n\n this.printQueue.push(() => {\n this.root = this.root\n .ele('item', { name: 'personaInquiryFailImage' })\n .txt(this.theme.failAsset as string)\n .up()\n .txt(' ');\n });\n }\n\n private loadingAnimationAsset() {\n if (\n !this.theme.loadingAnimationAsset ||\n !this.theme.loadingAnimationWidthPercent\n )\n return;\n\n this.printQueue.push(() => {\n this.root = this.root\n .ele('item', { name: 'personaInquiryLoadingLottieRaw' })\n .txt(this.theme.loadingAnimationAsset as string)\n .up()\n .txt(' ');\n\n this.root = this.root\n .ele('item', { name: 'personaInquiryLoadingLottieWidthPercent' })\n .txt(this.theme.loadingAnimationWidthPercent as string)\n .up()\n .txt(' ');\n });\n }\n\n private selfieAnimationAsset() {\n if (\n !this.theme.selfieAnimationAsset ||\n !this.theme.selfieAnimationWidthPercent\n )\n return;\n\n this.printQueue.push(() => {\n this.root = this.root\n .ele('item', { name: 'personaInquirySelfieLottieRaw' })\n .txt(this.theme.selfieAnimationAsset as string)\n .up()\n .txt(' ');\n\n this.root = this.root\n .ele('item', { name: 'personaInquirySelfieLottieWidthPercent' })\n .txt(this.theme.selfieAnimationWidthPercent as string)\n .up()\n .txt(' ');\n });\n }\n}\n\nexport default AndroidResourcePrinter;\n"],"mappings":";;;;;;AAAA,IAAAA,WAAA,GAAAC,OAAA;AAAkD,SAAAC,gBAAAC,GAAA,EAAAC,GAAA,EAAAC,KAAA,IAAAD,GAAA,GAAAE,cAAA,CAAAF,GAAA,OAAAA,GAAA,IAAAD,GAAA,IAAAI,MAAA,CAAAC,cAAA,CAAAL,GAAA,EAAAC,GAAA,IAAAC,KAAA,EAAAA,KAAA,EAAAI,UAAA,QAAAC,YAAA,QAAAC,QAAA,oBAAAR,GAAA,CAAAC,GAAA,IAAAC,KAAA,WAAAF,GAAA;AAAA,SAAAG,eAAAM,GAAA,QAAAR,GAAA,GAAAS,YAAA,CAAAD,GAAA,2BAAAR,GAAA,gBAAAA,GAAA,GAAAU,MAAA,CAAAV,GAAA;AAAA,SAAAS,aAAAE,KAAA,EAAAC,IAAA,eAAAD,KAAA,iBAAAA,KAAA,kBAAAA,KAAA,MAAAE,IAAA,GAAAF,KAAA,CAAAG,MAAA,CAAAC,WAAA,OAAAF,IAAA,KAAAG,SAAA,QAAAC,GAAA,GAAAJ,IAAA,CAAAK,IAAA,CAAAP,KAAA,EAAAC,IAAA,2BAAAK,GAAA,sBAAAA,GAAA,YAAAE,SAAA,4DAA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,EAAE,CAAC,CAAC,CACJ+B,GAAG,CAAC,GAAG,CAAC;MAEX,IAAI,CAACvC,IAAI,GAAG,IAAI,CAACA,IAAI,CAClBG,GAAG,CAAC,MAAM,EAAE;QAAE0B,IAAI,EAAE;MAAyC,CAAC,CAAC,CAC/DU,GAAG,CAAC,IAAI,CAACxC,KAAK,CAAC2D,2BAAqC,CAAC,CACrDlD,EAAE,CAAC,CAAC,CACJ+B,GAAG,CAAC,GAAG,CAAC;IACb,CAAC,CAAC;EACJ;AACF;AAAC,IAAAoB,QAAA,GAEc9D,sBAAsB;AAAA+D,OAAA,CAAAC,OAAA,GAAAF,QAAA"}
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _cosmiconfig = require("cosmiconfig");
|
|
8
|
-
var _chalk = _interopRequireDefault(require("chalk"));
|
|
9
|
-
var _Theme = require("./Theme");
|
|
10
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
12
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
13
|
-
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
14
|
-
class Configuration {
|
|
15
|
-
constructor() {
|
|
16
|
-
_defineProperty(this, "config", void 0);
|
|
17
|
-
}
|
|
18
|
-
async loadConfig() {
|
|
19
|
-
if (this.config) return this.config;
|
|
20
|
-
try {
|
|
21
|
-
const explorer = (0, _cosmiconfig.cosmiconfig)('persona', {
|
|
22
|
-
packageProp: 'persona'
|
|
23
|
-
});
|
|
24
|
-
const result = await explorer.search();
|
|
25
|
-
if (result == null) {
|
|
26
|
-
return null;
|
|
27
|
-
}
|
|
28
|
-
this.config = result.config;
|
|
29
|
-
return this.config;
|
|
30
|
-
} catch (e) {
|
|
31
|
-
console.error(e);
|
|
32
|
-
process.exit(1);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
async get() {
|
|
36
|
-
let config = await this.loadConfig();
|
|
37
|
-
const androidThemeLines = [];
|
|
38
|
-
for (const key in _Theme.ANDROID_THEME_CONFIG_KEY) {
|
|
39
|
-
androidThemeLines.push(` "${key}": null`);
|
|
40
|
-
}
|
|
41
|
-
const iosThemeLines = [];
|
|
42
|
-
for (const key in _Theme.IOS_THEME_CONFIG_KEY) {
|
|
43
|
-
iosThemeLines.push(` "${key}": null`);
|
|
44
|
-
}
|
|
45
|
-
if (config == null) {
|
|
46
|
-
console.log(`
|
|
47
|
-
Missing configuration.
|
|
48
|
-
|
|
49
|
-
In order to use this tool, it must be configured using a ${_chalk.default.yellow('persona')} object within
|
|
50
|
-
your package.json.
|
|
51
|
-
|
|
52
|
-
To get started, paste the following configuration into your package.json
|
|
53
|
-
|
|
54
|
-
{
|
|
55
|
-
...
|
|
56
|
-
|
|
57
|
-
"persona": {
|
|
58
|
-
"androidTheme": {
|
|
59
|
-
` + androidThemeLines.join(',\n') + `
|
|
60
|
-
},
|
|
61
|
-
"iosTheme": {
|
|
62
|
-
` + iosThemeLines.join(',\n') + `
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
...
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
and re-run this tool :).
|
|
70
|
-
`);
|
|
71
|
-
process.exit(1);
|
|
72
|
-
}
|
|
73
|
-
return config;
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
var _default = new Configuration();
|
|
77
|
-
exports.default = _default;
|
|
78
|
-
//# sourceMappingURL=Config.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_cosmiconfig","require","_chalk","_interopRequireDefault","_Theme","obj","__esModule","default","_defineProperty","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","arg","_toPrimitive","String","input","hint","prim","Symbol","toPrimitive","undefined","res","call","TypeError","Number","Configuration","constructor","loadConfig","config","explorer","cosmiconfig","packageProp","result","search","e","console","error","process","exit","get","androidThemeLines","ANDROID_THEME_CONFIG_KEY","push","iosThemeLines","IOS_THEME_CONFIG_KEY","log","chalk","yellow","join","_default","exports"],"sources":["Config.ts"],"sourcesContent":["import { cosmiconfig } from 'cosmiconfig';\nimport chalk from 'chalk';\nimport { ANDROID_THEME_CONFIG_KEY, IOS_THEME_CONFIG_KEY } from './Theme';\n\nexport interface ConfigObject {\n androidTheme: { [key: string]: string | null | undefined };\n iosTheme: { [key: string]: string | null | undefined };\n}\n\nclass Configuration {\n config?: ConfigObject | null;\n\n async loadConfig(): Promise<ConfigObject | null | undefined> {\n if (this.config) return this.config;\n\n try {\n const explorer = cosmiconfig('persona', { packageProp: 'persona' });\n const result = await explorer.search();\n if (result == null) {\n return null;\n }\n\n this.config = result.config;\n\n return this.config;\n } catch (e) {\n console.error(e);\n process.exit(1);\n }\n }\n\n async get(): Promise<ConfigObject> {\n let config = await this.loadConfig();\n\n const androidThemeLines = [];\n for (const key in ANDROID_THEME_CONFIG_KEY) {\n androidThemeLines.push(` \"${key}\": null`);\n }\n\n const iosThemeLines = [];\n for (const key in IOS_THEME_CONFIG_KEY) {\n iosThemeLines.push(` \"${key}\": null`);\n }\n\n if (config == null) {\n console.log(\n `\nMissing configuration.\n\nIn order to use this tool, it must be configured using a ${chalk.yellow(\n 'persona'\n )} object within\nyour package.json.\n\nTo get started, paste the following configuration into your package.json\n\n{\n ...\n\n \"persona\": {\n \"androidTheme\": {\n` +\n androidThemeLines.join(',\\n') +\n `\n },\n \"iosTheme\": {\n` +\n iosThemeLines.join(',\\n') +\n `\n }\n }\n\n ...\n}\n\nand re-run this tool :).\n`\n );\n process.exit(1);\n }\n\n return config as ConfigObject;\n }\n}\n\nexport default new Configuration();\n"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AAAyE,SAAAE,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,SAAAG,gBAAAH,GAAA,EAAAI,GAAA,EAAAC,KAAA,IAAAD,GAAA,GAAAE,cAAA,CAAAF,GAAA,OAAAA,GAAA,IAAAJ,GAAA,IAAAO,MAAA,CAAAC,cAAA,CAAAR,GAAA,EAAAI,GAAA,IAAAC,KAAA,EAAAA,KAAA,EAAAI,UAAA,QAAAC,YAAA,QAAAC,QAAA,oBAAAX,GAAA,CAAAI,GAAA,IAAAC,KAAA,WAAAL,GAAA;AAAA,SAAAM,eAAAM,GAAA,QAAAR,GAAA,GAAAS,YAAA,CAAAD,GAAA,2BAAAR,GAAA,gBAAAA,GAAA,GAAAU,MAAA,CAAAV,GAAA;AAAA,SAAAS,aAAAE,KAAA,EAAAC,IAAA,eAAAD,KAAA,iBAAAA,KAAA,kBAAAA,KAAA,MAAAE,IAAA,GAAAF,KAAA,CAAAG,MAAA,CAAAC,WAAA,OAAAF,IAAA,KAAAG,SAAA,QAAAC,GAAA,GAAAJ,IAAA,CAAAK,IAAA,CAAAP,KAAA,EAAAC,IAAA,2BAAAK,GAAA,sBAAAA,GAAA,YAAAE,SAAA,4DAAAP,IAAA,gBAAAF,MAAA,GAAAU,MAAA,EAAAT,KAAA;AAOzE,MAAMU,aAAa,CAAC;EAAAC,YAAA;IAAAvB,eAAA;EAAA;EAGlB,MAAMwB,UAAUA,CAAA,EAA6C;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AACA;AACA;AACA,CACM,CAAC;MACDX,OAAO,CAACC,IAAI,CAAC,CAAC,CAAC;IACjB;IAEA,OAAOV,MAAM;EACf;AACF;AAAC,IAAAqB,QAAA,GAEc,IAAIxB,aAAa,CAAC,CAAC;AAAAyB,OAAA,CAAAhD,OAAA,GAAA+C,QAAA"}
|
|
@@ -1,188 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = exports.IOS_THEME_CONFIG_KEY = exports.ANDROID_THEME_CONFIG_KEY = void 0;
|
|
7
|
-
var _cliTable = _interopRequireDefault(require("cli-table"));
|
|
8
|
-
var _chalk = _interopRequireDefault(require("chalk"));
|
|
9
|
-
var _Config = _interopRequireDefault(require("./Config"));
|
|
10
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
-
const COLOR_REGEX = /^[a-zA-Z0-9]{6}$/;
|
|
12
|
-
let ANDROID_THEME_CONFIG_KEY = /*#__PURE__*/function (ANDROID_THEME_CONFIG_KEY) {
|
|
13
|
-
ANDROID_THEME_CONFIG_KEY["backgroundColor"] = "backgroundColor";
|
|
14
|
-
ANDROID_THEME_CONFIG_KEY["primaryColor"] = "primaryColor";
|
|
15
|
-
ANDROID_THEME_CONFIG_KEY["darkPrimaryColor"] = "darkPrimaryColor";
|
|
16
|
-
ANDROID_THEME_CONFIG_KEY["accentColor"] = "accentColor";
|
|
17
|
-
ANDROID_THEME_CONFIG_KEY["titleTextColor"] = "titleTextColor";
|
|
18
|
-
ANDROID_THEME_CONFIG_KEY["titleTextFont"] = "titleTextFont";
|
|
19
|
-
ANDROID_THEME_CONFIG_KEY["bodyTextColor"] = "bodyTextColor";
|
|
20
|
-
ANDROID_THEME_CONFIG_KEY["bodyTextFont"] = "bodyTextFont";
|
|
21
|
-
ANDROID_THEME_CONFIG_KEY["footnoteTextColor"] = "footnoteTextColor";
|
|
22
|
-
ANDROID_THEME_CONFIG_KEY["footnoteTextFont"] = "footnoteTextFont";
|
|
23
|
-
ANDROID_THEME_CONFIG_KEY["textFieldTextColor"] = "textFieldTextColor";
|
|
24
|
-
ANDROID_THEME_CONFIG_KEY["textFieldTextFont"] = "textFieldTextFont";
|
|
25
|
-
ANDROID_THEME_CONFIG_KEY["pickerTextColor"] = "pickerTextColor";
|
|
26
|
-
ANDROID_THEME_CONFIG_KEY["pickerTextFont"] = "pickerTextFont";
|
|
27
|
-
ANDROID_THEME_CONFIG_KEY["buttonBackgroundColor"] = "buttonBackgroundColor";
|
|
28
|
-
ANDROID_THEME_CONFIG_KEY["buttonDisabledBackgroundColor"] = "buttonDisabledBackgroundColor";
|
|
29
|
-
ANDROID_THEME_CONFIG_KEY["buttonTouchedBackgroundColor"] = "buttonTouchedBackgroundColor";
|
|
30
|
-
ANDROID_THEME_CONFIG_KEY["buttonTextColor"] = "buttonTextColor";
|
|
31
|
-
ANDROID_THEME_CONFIG_KEY["buttonDisabledTextColor"] = "buttonDisabledTextColor";
|
|
32
|
-
ANDROID_THEME_CONFIG_KEY["buttonCornerRadius"] = "buttonCornerRadius";
|
|
33
|
-
ANDROID_THEME_CONFIG_KEY["buttonFont"] = "buttonFont";
|
|
34
|
-
ANDROID_THEME_CONFIG_KEY["progressColor"] = "progressColor";
|
|
35
|
-
ANDROID_THEME_CONFIG_KEY["successAsset"] = "successAsset";
|
|
36
|
-
ANDROID_THEME_CONFIG_KEY["failAsset"] = "failAsset";
|
|
37
|
-
ANDROID_THEME_CONFIG_KEY["loadingAnimationAsset"] = "loadingAnimationAsset";
|
|
38
|
-
ANDROID_THEME_CONFIG_KEY["loadingAnimationWidthPercent"] = "loadingAnimationWidthPercent";
|
|
39
|
-
ANDROID_THEME_CONFIG_KEY["selfieAnimationAsset"] = "selfieAnimationAsset";
|
|
40
|
-
ANDROID_THEME_CONFIG_KEY["selfieAnimationWidthPercent"] = "selfieAnimationWidthPercent";
|
|
41
|
-
return ANDROID_THEME_CONFIG_KEY;
|
|
42
|
-
}({});
|
|
43
|
-
exports.ANDROID_THEME_CONFIG_KEY = ANDROID_THEME_CONFIG_KEY;
|
|
44
|
-
let IOS_THEME_CONFIG_KEY = /*#__PURE__*/function (IOS_THEME_CONFIG_KEY) {
|
|
45
|
-
IOS_THEME_CONFIG_KEY["backgroundColor"] = "backgroundColor";
|
|
46
|
-
IOS_THEME_CONFIG_KEY["primaryColor"] = "primaryColor";
|
|
47
|
-
IOS_THEME_CONFIG_KEY["darkPrimaryColor"] = "darkPrimaryColor";
|
|
48
|
-
IOS_THEME_CONFIG_KEY["accentColor"] = "accentColor";
|
|
49
|
-
IOS_THEME_CONFIG_KEY["errorColor"] = "errorColor";
|
|
50
|
-
IOS_THEME_CONFIG_KEY["errorTextFont"] = "errorTextFont";
|
|
51
|
-
IOS_THEME_CONFIG_KEY["overlayBackgroundColor"] = "overlayBackgroundColor";
|
|
52
|
-
IOS_THEME_CONFIG_KEY["titleTextAlignment"] = "titleTextAlignment";
|
|
53
|
-
IOS_THEME_CONFIG_KEY["titleTextColor"] = "titleTextColor";
|
|
54
|
-
IOS_THEME_CONFIG_KEY["titleTextFont"] = "titleTextFont";
|
|
55
|
-
IOS_THEME_CONFIG_KEY["cardTitleTextFont"] = "cardTitleTextFont";
|
|
56
|
-
IOS_THEME_CONFIG_KEY["bodyTextAlignment"] = "bodyTextAlignment";
|
|
57
|
-
IOS_THEME_CONFIG_KEY["bodyTextColor"] = "bodyTextColor";
|
|
58
|
-
IOS_THEME_CONFIG_KEY["bodyTextFont"] = "bodyTextFont";
|
|
59
|
-
IOS_THEME_CONFIG_KEY["footnoteTextColor"] = "footnoteTextColor";
|
|
60
|
-
IOS_THEME_CONFIG_KEY["footnoteTextFont"] = "footnoteTextFont";
|
|
61
|
-
IOS_THEME_CONFIG_KEY["formLabelTextColor"] = "formLabelTextColor";
|
|
62
|
-
IOS_THEME_CONFIG_KEY["formLabelTextFont"] = "formLabelTextFont";
|
|
63
|
-
IOS_THEME_CONFIG_KEY["textFieldTextColor"] = "textFieldTextColor";
|
|
64
|
-
IOS_THEME_CONFIG_KEY["textFieldBackgroundColor"] = "textFieldBackgroundColor";
|
|
65
|
-
IOS_THEME_CONFIG_KEY["textFieldBorderColor"] = "textFieldBorderColor";
|
|
66
|
-
IOS_THEME_CONFIG_KEY["textFieldCornerRadius"] = "textFieldCornerRadius";
|
|
67
|
-
IOS_THEME_CONFIG_KEY["textFieldFont"] = "textFieldFont";
|
|
68
|
-
IOS_THEME_CONFIG_KEY["textFieldPlaceholderFont"] = "textFieldPlaceholderFont";
|
|
69
|
-
IOS_THEME_CONFIG_KEY["pickerTextColor"] = "pickerTextColor";
|
|
70
|
-
IOS_THEME_CONFIG_KEY["pickerTextFont"] = "pickerTextFont";
|
|
71
|
-
IOS_THEME_CONFIG_KEY["buttonBackgroundColor"] = "buttonBackgroundColor";
|
|
72
|
-
IOS_THEME_CONFIG_KEY["buttonDisabledBackgroundColor"] = "buttonDisabledBackgroundColor";
|
|
73
|
-
IOS_THEME_CONFIG_KEY["buttonTouchedBackgroundColor"] = "buttonTouchedBackgroundColor";
|
|
74
|
-
IOS_THEME_CONFIG_KEY["buttonTextColor"] = "buttonTextColor";
|
|
75
|
-
IOS_THEME_CONFIG_KEY["buttonDisabledTextColor"] = "buttonDisabledTextColor";
|
|
76
|
-
IOS_THEME_CONFIG_KEY["buttonTextAlignment"] = "buttonTextAlignment";
|
|
77
|
-
IOS_THEME_CONFIG_KEY["buttonImageTintColor"] = "buttonImageTintColor";
|
|
78
|
-
IOS_THEME_CONFIG_KEY["buttonCornerRadius"] = "buttonCornerRadius";
|
|
79
|
-
IOS_THEME_CONFIG_KEY["buttonBorderWidth"] = "buttonBorderWidth";
|
|
80
|
-
IOS_THEME_CONFIG_KEY["buttonBorderColor"] = "buttonBorderColor";
|
|
81
|
-
IOS_THEME_CONFIG_KEY["buttonFont"] = "buttonFont";
|
|
82
|
-
IOS_THEME_CONFIG_KEY["buttonSecondaryBackgroundColor"] = "buttonSecondaryBackgroundColor";
|
|
83
|
-
IOS_THEME_CONFIG_KEY["buttonSecondaryDisabledBackgroundColor"] = "buttonSecondaryDisabledBackgroundColor";
|
|
84
|
-
IOS_THEME_CONFIG_KEY["buttonSecondaryTouchedBackgroundColor"] = "buttonSecondaryTouchedBackgroundColor";
|
|
85
|
-
IOS_THEME_CONFIG_KEY["buttonSecondaryTextColor"] = "buttonSecondaryTextColor";
|
|
86
|
-
IOS_THEME_CONFIG_KEY["buttonSecondaryDisabledTextColor"] = "buttonSecondaryDisabledTextColor";
|
|
87
|
-
IOS_THEME_CONFIG_KEY["buttonSecondaryTextAlignment"] = "buttonSecondaryTextAlignment";
|
|
88
|
-
IOS_THEME_CONFIG_KEY["buttonSecondaryImageTintColor"] = "buttonSecondaryImageTintColor";
|
|
89
|
-
IOS_THEME_CONFIG_KEY["buttonSecondaryCornerRadius"] = "buttonSecondaryCornerRadius";
|
|
90
|
-
IOS_THEME_CONFIG_KEY["buttonSecondaryBorderWidth"] = "buttonSecondaryBorderWidth";
|
|
91
|
-
IOS_THEME_CONFIG_KEY["buttonSecondaryBorderColor"] = "buttonSecondaryBorderColor";
|
|
92
|
-
IOS_THEME_CONFIG_KEY["buttonSecondaryFont"] = "buttonSecondaryFont";
|
|
93
|
-
IOS_THEME_CONFIG_KEY["selectedCellBackgroundColor"] = "selectedCellBackgroundColor";
|
|
94
|
-
IOS_THEME_CONFIG_KEY["closeButtonTintColor"] = "closeButtonTintColor";
|
|
95
|
-
IOS_THEME_CONFIG_KEY["cancelButtonBackgroundColor"] = "cancelButtonBackgroundColor";
|
|
96
|
-
IOS_THEME_CONFIG_KEY["cancelButtonTextColor"] = "cancelButtonTextColor";
|
|
97
|
-
IOS_THEME_CONFIG_KEY["cancelButtonAlternateBackgroundColor"] = "cancelButtonAlternateBackgroundColor";
|
|
98
|
-
IOS_THEME_CONFIG_KEY["cancelButtonAlternateTextColor"] = "cancelButtonAlternateTextColor";
|
|
99
|
-
IOS_THEME_CONFIG_KEY["processingLabelsTextAlignment"] = "processingLabelsTextAlignment";
|
|
100
|
-
IOS_THEME_CONFIG_KEY["loadingAnimationAssetName"] = "loadingAnimationAssetName";
|
|
101
|
-
IOS_THEME_CONFIG_KEY["loadingAnimationAssetWidth"] = "loadingAnimationAssetWidth";
|
|
102
|
-
IOS_THEME_CONFIG_KEY["loadingAnimationAssetHeight"] = "loadingAnimationAssetHeight";
|
|
103
|
-
IOS_THEME_CONFIG_KEY["processingAnimationAssetName"] = "processingAnimationAssetName";
|
|
104
|
-
IOS_THEME_CONFIG_KEY["processingAnimationAssetWidth"] = "processingAnimationAssetWidth";
|
|
105
|
-
IOS_THEME_CONFIG_KEY["processingAnimationAssetHeight"] = "processingAnimationAssetHeight";
|
|
106
|
-
IOS_THEME_CONFIG_KEY["selfieAnimationAssetName"] = "selfieAnimationAssetName";
|
|
107
|
-
IOS_THEME_CONFIG_KEY["selfieAnimationAssetWidth"] = "selfieAnimationAssetWidth";
|
|
108
|
-
IOS_THEME_CONFIG_KEY["selfieAnimationAssetHeight"] = "selfieAnimationAssetHeight";
|
|
109
|
-
return IOS_THEME_CONFIG_KEY;
|
|
110
|
-
}({});
|
|
111
|
-
exports.IOS_THEME_CONFIG_KEY = IOS_THEME_CONFIG_KEY;
|
|
112
|
-
class Theme {
|
|
113
|
-
async print() {
|
|
114
|
-
let platform = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'android';
|
|
115
|
-
const config = await _Config.default.get();
|
|
116
|
-
const themeConfig = platform === 'android' ? config.androidTheme : config.iosTheme;
|
|
117
|
-
let usesCustomFontAndroid = false;
|
|
118
|
-
let usesCustomFontIos = false;
|
|
119
|
-
const head = platform === 'android' ? ['Style Item', 'Value', 'Note'] : ['Style Item', 'Value', 'Note'];
|
|
120
|
-
const table = new _cliTable.default({
|
|
121
|
-
head,
|
|
122
|
-
// prettier-ignore
|
|
123
|
-
chars: {
|
|
124
|
-
'mid': '',
|
|
125
|
-
'left-mid': '',
|
|
126
|
-
'mid-mid': '',
|
|
127
|
-
'right-mid': ''
|
|
128
|
-
}
|
|
129
|
-
});
|
|
130
|
-
console.log('Specified theme values:');
|
|
131
|
-
const keyEnum = platform === 'android' ? ANDROID_THEME_CONFIG_KEY : IOS_THEME_CONFIG_KEY;
|
|
132
|
-
for (const key in keyEnum) {
|
|
133
|
-
let override = themeConfig[key];
|
|
134
|
-
let colorOverride = key.includes('Color') || key.includes('color');
|
|
135
|
-
if (override) {
|
|
136
|
-
if (colorOverride) {
|
|
137
|
-
override = normalizeColor(override, key);
|
|
138
|
-
} else {
|
|
139
|
-
override = override.toString();
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
if (key.includes('Font')) {
|
|
143
|
-
if (platform == 'android') {
|
|
144
|
-
usesCustomFontAndroid = true;
|
|
145
|
-
} else {
|
|
146
|
-
usesCustomFontIos = true;
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
let row;
|
|
150
|
-
row = [key, override ? valueColor(colorOverride, override) : _chalk.default.yellow('unspecified'), key.includes('Font') ? _chalk.default.cyan('Fonts that are not built-in need to be installed.') : ''];
|
|
151
|
-
table.push(row);
|
|
152
|
-
}
|
|
153
|
-
console.log(table.toString());
|
|
154
|
-
if (usesCustomFontAndroid) {
|
|
155
|
-
console.log(_chalk.default.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');
|
|
156
|
-
}
|
|
157
|
-
if (usesCustomFontIos) {
|
|
158
|
-
console.log(_chalk.default.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');
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
// Add newline for spacing
|
|
162
|
-
console.log('');
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
// set default print color for non-color overrides
|
|
167
|
-
function valueColor(isColorOverride, override) {
|
|
168
|
-
return isColorOverride ? _chalk.default.hex(override)(override) : _chalk.default.magentaBright(override);
|
|
169
|
-
}
|
|
170
|
-
function normalizeColor(colorHex, themeKey) {
|
|
171
|
-
let hex = colorHex;
|
|
172
|
-
if (colorHex[0] === '#') {
|
|
173
|
-
hex = colorHex.slice(1);
|
|
174
|
-
}
|
|
175
|
-
if (!COLOR_REGEX.test(hex)) {
|
|
176
|
-
if (themeKey) {
|
|
177
|
-
console.error(`Received a color value of ${_chalk.default.yellow(colorHex)} for ${_chalk.default.red(themeKey)}.\nFormat must follow standard 6 character hexadecimal color code. Eg. ${_chalk.default.bgHex('#FFFFFF').hex('#7E66B7')('#290087')}`);
|
|
178
|
-
} else {
|
|
179
|
-
console.error(`Received a color value of ${_chalk.default.yellow(colorHex)}.\nFormat must follow standard 6 character hexadecimal color code. Eg. ${_chalk.default.bgHex('#FFFFFF').hex('#7E66B7')('#290087')}`);
|
|
180
|
-
}
|
|
181
|
-
console.log('');
|
|
182
|
-
process.exit(1);
|
|
183
|
-
}
|
|
184
|
-
return colorHex;
|
|
185
|
-
}
|
|
186
|
-
var _default = new Theme();
|
|
187
|
-
exports.default = _default;
|
|
188
|
-
//# sourceMappingURL=Theme.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_cliTable","_interopRequireDefault","require","_chalk","_Config","obj","__esModule","default","COLOR_REGEX","ANDROID_THEME_CONFIG_KEY","exports","IOS_THEME_CONFIG_KEY","Theme","print","platform","arguments","length","undefined","config","Config","get","themeConfig","androidTheme","iosTheme","usesCustomFontAndroid","usesCustomFontIos","head","table","Table","chars","console","log","keyEnum","key","override","colorOverride","includes","normalizeColor","toString","row","valueColor","chalk","yellow","cyan","push","isColorOverride","hex","magentaBright","colorHex","themeKey","slice","test","error","red","bgHex","process","exit","_default"],"sources":["Theme.ts"],"sourcesContent":["import Table from 'cli-table';\nimport chalk from 'chalk';\n\nimport Config from './Config';\n\nconst COLOR_REGEX = /^[a-zA-Z0-9]{6}$/;\n\nexport enum ANDROID_THEME_CONFIG_KEY {\n backgroundColor = 'backgroundColor',\n primaryColor = 'primaryColor',\n darkPrimaryColor = 'darkPrimaryColor',\n accentColor = 'accentColor',\n\n titleTextColor = 'titleTextColor',\n titleTextFont = 'titleTextFont',\n\n bodyTextColor = 'bodyTextColor',\n bodyTextFont = 'bodyTextFont',\n\n footnoteTextColor = 'footnoteTextColor',\n footnoteTextFont = 'footnoteTextFont',\n\n // formLabelTextColor = \"formLabelTextColor\",\n // formLabelTextFont = \"formLabelTextFont\",\n\n textFieldTextColor = 'textFieldTextColor',\n textFieldTextFont = 'textFieldTextFont',\n\n pickerTextColor = 'pickerTextColor',\n pickerTextFont = 'pickerTextFont',\n\n buttonBackgroundColor = 'buttonBackgroundColor',\n buttonDisabledBackgroundColor = 'buttonDisabledBackgroundColor',\n buttonTouchedBackgroundColor = 'buttonTouchedBackgroundColor',\n buttonTextColor = 'buttonTextColor',\n buttonDisabledTextColor = 'buttonDisabledTextColor',\n // buttonTextAlignment = \"buttonTextAlignment\",\n buttonCornerRadius = 'buttonCornerRadius',\n buttonFont = 'buttonFont',\n progressColor = 'progressColor',\n successAsset = 'successAsset',\n failAsset = 'failAsset',\n loadingAnimationAsset = 'loadingAnimationAsset',\n loadingAnimationWidthPercent = 'loadingAnimationWidthPercent',\n selfieAnimationAsset = 'selfieAnimationAsset',\n selfieAnimationWidthPercent = 'selfieAnimationWidthPercent',\n}\n\nexport enum IOS_THEME_CONFIG_KEY {\n backgroundColor = 'backgroundColor',\n primaryColor = 'primaryColor',\n darkPrimaryColor = 'darkPrimaryColor',\n accentColor = 'accentColor',\n errorColor = 'errorColor',\n errorTextFont = 'errorTextFont',\n overlayBackgroundColor = 'overlayBackgroundColor',\n titleTextAlignment = 'titleTextAlignment',\n titleTextColor = 'titleTextColor',\n titleTextFont = 'titleTextFont',\n cardTitleTextFont = 'cardTitleTextFont',\n bodyTextAlignment = 'bodyTextAlignment',\n bodyTextColor = 'bodyTextColor',\n bodyTextFont = 'bodyTextFont',\n footnoteTextColor = 'footnoteTextColor',\n footnoteTextFont = 'footnoteTextFont',\n formLabelTextColor = 'formLabelTextColor',\n formLabelTextFont = 'formLabelTextFont',\n textFieldTextColor = 'textFieldTextColor',\n textFieldBackgroundColor = 'textFieldBackgroundColor',\n textFieldBorderColor = 'textFieldBorderColor',\n textFieldCornerRadius = 'textFieldCornerRadius',\n textFieldFont = 'textFieldFont',\n textFieldPlaceholderFont = 'textFieldPlaceholderFont',\n pickerTextColor = 'pickerTextColor',\n pickerTextFont = 'pickerTextFont',\n buttonBackgroundColor = 'buttonBackgroundColor',\n buttonDisabledBackgroundColor = 'buttonDisabledBackgroundColor',\n buttonTouchedBackgroundColor = 'buttonTouchedBackgroundColor',\n buttonTextColor = 'buttonTextColor',\n buttonDisabledTextColor = 'buttonDisabledTextColor',\n buttonTextAlignment = 'buttonTextAlignment',\n buttonImageTintColor = 'buttonImageTintColor',\n buttonCornerRadius = 'buttonCornerRadius',\n buttonBorderWidth = 'buttonBorderWidth',\n buttonBorderColor = 'buttonBorderColor',\n buttonFont = 'buttonFont',\n buttonSecondaryBackgroundColor = 'buttonSecondaryBackgroundColor',\n buttonSecondaryDisabledBackgroundColor = 'buttonSecondaryDisabledBackgroundColor',\n buttonSecondaryTouchedBackgroundColor = 'buttonSecondaryTouchedBackgroundColor',\n buttonSecondaryTextColor = 'buttonSecondaryTextColor',\n buttonSecondaryDisabledTextColor = 'buttonSecondaryDisabledTextColor',\n buttonSecondaryTextAlignment = 'buttonSecondaryTextAlignment',\n buttonSecondaryImageTintColor = 'buttonSecondaryImageTintColor',\n buttonSecondaryCornerRadius = 'buttonSecondaryCornerRadius',\n buttonSecondaryBorderWidth = 'buttonSecondaryBorderWidth',\n buttonSecondaryBorderColor = 'buttonSecondaryBorderColor',\n buttonSecondaryFont = 'buttonSecondaryFont',\n selectedCellBackgroundColor = 'selectedCellBackgroundColor',\n closeButtonTintColor = 'closeButtonTintColor',\n cancelButtonBackgroundColor = 'cancelButtonBackgroundColor',\n cancelButtonTextColor = 'cancelButtonTextColor',\n cancelButtonAlternateBackgroundColor = 'cancelButtonAlternateBackgroundColor',\n cancelButtonAlternateTextColor = 'cancelButtonAlternateTextColor',\n processingLabelsTextAlignment = 'processingLabelsTextAlignment',\n loadingAnimationAssetName = 'loadingAnimationAssetName',\n loadingAnimationAssetWidth = 'loadingAnimationAssetWidth',\n loadingAnimationAssetHeight = 'loadingAnimationAssetHeight',\n processingAnimationAssetName = 'processingAnimationAssetName',\n processingAnimationAssetWidth = 'processingAnimationAssetWidth',\n processingAnimationAssetHeight = 'processingAnimationAssetHeight',\n selfieAnimationAssetName = 'selfieAnimationAssetName',\n selfieAnimationAssetWidth = 'selfieAnimationAssetWidth',\n selfieAnimationAssetHeight = 'selfieAnimationAssetHeight',\n}\n\nexport type AndroidThemeObject = {\n [key in ANDROID_THEME_CONFIG_KEY]: string | null | undefined;\n};\n\nexport type IosThemeObject = {\n [key in IOS_THEME_CONFIG_KEY]: string | null | undefined;\n};\n\nexport type ThemeObject = AndroidThemeObject | IosThemeObject;\n\nclass Theme {\n async print(platform: string = 'android') {\n const config = await Config.get();\n const themeConfig =\n platform === 'android' ? config.androidTheme : config.iosTheme;\n let usesCustomFontAndroid = false;\n let usesCustomFontIos = false;\n\n const head =\n platform === 'android'\n ? ['Style Item', 'Value', 'Note']\n : ['Style Item', 'Value', 'Note'];\n\n const table = new Table({\n head,\n // prettier-ignore\n chars: { 'mid': '', 'left-mid': '', 'mid-mid': '', 'right-mid': '' },\n });\n\n console.log('Specified theme values:');\n const keyEnum =\n platform === 'android' ? ANDROID_THEME_CONFIG_KEY : IOS_THEME_CONFIG_KEY;\n for (const key in keyEnum) {\n let override =\n themeConfig[key as ANDROID_THEME_CONFIG_KEY | IOS_THEME_CONFIG_KEY];\n let colorOverride = key.includes('Color') || key.includes('color');\n\n if (override) {\n if (colorOverride) {\n override = normalizeColor(override, key);\n } else {\n override = override.toString();\n }\n }\n\n if (key.includes('Font')) {\n if (platform == 'android') {\n usesCustomFontAndroid = true;\n } else {\n usesCustomFontIos = true;\n }\n }\n\n let row;\n\n row = [\n key,\n override\n ? valueColor(colorOverride, override)\n : chalk.yellow('unspecified'),\n key.includes('Font')\n ? chalk.cyan('Fonts that are not built-in need to be installed.')\n : '',\n ];\n\n table.push(row);\n }\n\n console.log(table.toString());\n\n if (usesCustomFontAndroid) {\n console.log(\n chalk.yellow(' NOTE') +\n ': A font customization was made. If the font is not built-in to the Android platform (https://github.com/react-native-training/react-native-fonts#android), then the font(s) must first be installed. A guide to install a font can be found here: https://developer.android.com/guide/topics/ui/look-and-feel/fonts-in-xml'\n );\n }\n\n if (usesCustomFontIos) {\n console.log(\n chalk.yellow(' NOTE') +\n ': A font customization was made. If the font is not built-in iOS (https://github.com/react-native-training/react-native-ios), then the font(s) must first be installed. A guide to install a font can be found here: https://developer.apple.com/documentation/uikit/text_display_and_fonts/adding_a_custom_font_to_your_app'\n );\n }\n\n // Add newline for spacing\n console.log('');\n }\n}\n\n// set default print color for non-color overrides\nfunction valueColor(isColorOverride: boolean, override: string) {\n return isColorOverride\n ? chalk.hex(override)(override)\n : chalk.magentaBright(override);\n}\n\nfunction normalizeColor(colorHex: string, themeKey: string) {\n let hex = colorHex;\n if (colorHex[0] === '#') {\n hex = colorHex.slice(1);\n }\n\n if (!COLOR_REGEX.test(hex)) {\n if (themeKey) {\n console.error(\n `Received a color value of ${chalk.yellow(colorHex)} for ${chalk.red(\n themeKey\n )}.\\nFormat must follow standard 6 character hexadecimal color code. Eg. ${chalk\n .bgHex('#FFFFFF')\n .hex('#7E66B7')('#290087')}`\n );\n } else {\n console.error(\n `Received a color value of ${chalk.yellow(\n colorHex\n )}.\\nFormat must follow standard 6 character hexadecimal color code. Eg. ${chalk\n .b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,EAC/B,CAAC;IACH,CAAC,MAAM;MACLhB,OAAO,CAACsB,KAAK,CACV,6BAA4BX,cAAK,CAACC,MAAM,CACvCM,QACF,CAAE,0EAAyEP,cAAK,CAC7Ea,KAAK,CAAC,SAAS,CAAC,CAChBR,GAAG,CAAC,SAAS,CAAC,CAAC,SAAS,CAAE,EAC/B,CAAC;IACH;IACAhB,OAAO,CAACC,GAAG,CAAC,EAAE,CAAC;IACfwB,OAAO,CAACC,IAAI,CAAC,CAAC,CAAC;EACjB;EAEA,OAAOR,QAAQ;AACjB;AAAC,IAAAS,QAAA,GAEc,IAAI7C,KAAK,CAAC,CAAC;AAAAF,OAAA,CAAAH,OAAA,GAAAkD,QAAA"}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _Config = _interopRequireDefault(require("./Config"));
|
|
4
|
-
var _prompts = require("./prompts");
|
|
5
|
-
var _AndroidThemeGenerator = _interopRequireDefault(require("./tools/AndroidThemeGenerator"));
|
|
6
|
-
var _IosThemeInstructions = _interopRequireDefault(require("./tools/IosThemeInstructions"));
|
|
7
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
8
|
-
console.log('');
|
|
9
|
-
console.log('============================================');
|
|
10
|
-
console.log('Persona React Native SDK customization tool.');
|
|
11
|
-
console.log('============================================');
|
|
12
|
-
console.log('');
|
|
13
|
-
const run = async () => {
|
|
14
|
-
// Run this once to print warning messages if it's not configured.
|
|
15
|
-
await _Config.default.get();
|
|
16
|
-
const {
|
|
17
|
-
choice
|
|
18
|
-
} = await (0, _prompts.whatWouldYouLikePrompt)();
|
|
19
|
-
switch (choice) {
|
|
20
|
-
case _prompts.TOOL_CHOICE.AndroidTheme:
|
|
21
|
-
await _AndroidThemeGenerator.default.run();
|
|
22
|
-
break;
|
|
23
|
-
case _prompts.TOOL_CHOICE.iosTheme:
|
|
24
|
-
await _IosThemeInstructions.default.run();
|
|
25
|
-
break;
|
|
26
|
-
default:
|
|
27
|
-
return;
|
|
28
|
-
}
|
|
29
|
-
};
|
|
30
|
-
run();
|
|
31
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_Config","_interopRequireDefault","require","_prompts","_AndroidThemeGenerator","_IosThemeInstructions","obj","__esModule","default","console","log","run","Config","get","choice","whatWouldYouLikePrompt","TOOL_CHOICE","AndroidTheme","AndroidThemeGenerator","iosTheme","IosThemeInstructions"],"sources":["index.ts"],"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"],"mappings":";;AAAA,IAAAA,OAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,sBAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,qBAAA,GAAAJ,sBAAA,CAAAC,OAAA;AAAgE,SAAAD,uBAAAK,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAEhEG,OAAO,CAACC,GAAG,CAAC,EAAE,CAAC;AACfD,OAAO,CAACC,GAAG,CAAC,8CAA8C,CAAC;AAC3DD,OAAO,CAACC,GAAG,CAAC,8CAA8C,CAAC;AAC3DD,OAAO,CAACC,GAAG,CAAC,8CAA8C,CAAC;AAC3DD,OAAO,CAACC,GAAG,CAAC,EAAE,CAAC;AAEf,MAAMC,GAAG,GAAG,MAAAA,CAAA,KAAY;EACtB;EACA,MAAMC,eAAM,CAACC,GAAG,CAAC,CAAC;EAElB,MAAM;IAAEC;EAAO,CAAC,GAAG,MAAM,IAAAC,+BAAsB,EAAC,CAAC;EAEjD,QAAQD,MAAM;IACZ,KAAKE,oBAAW,CAACC,YAAY;MAC3B,MAAMC,8BAAqB,CAACP,GAAG,CAAC,CAAC;MACjC;IACF,KAAKK,oBAAW,CAACG,QAAQ;MACvB,MAAMC,6BAAoB,CAACT,GAAG,CAAC,CAAC;MAChC;IACF;MACE;EACJ;AACF,CAAC;AAEDA,GAAG,CAAC,CAAC"}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.TOOL_CHOICE = void 0;
|
|
7
|
-
exports.confirmResourceFiles = confirmResourceFiles;
|
|
8
|
-
exports.confirmThemeValues = confirmThemeValues;
|
|
9
|
-
exports.whatWouldYouLikePrompt = whatWouldYouLikePrompt;
|
|
10
|
-
var _inquirer = _interopRequireDefault(require("inquirer"));
|
|
11
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
|
-
const TOOL_CHOICE = {
|
|
13
|
-
AndroidTheme: 'Update Android theme',
|
|
14
|
-
iosTheme: 'Update iOS theme'
|
|
15
|
-
};
|
|
16
|
-
exports.TOOL_CHOICE = TOOL_CHOICE;
|
|
17
|
-
async function whatWouldYouLikePrompt() {
|
|
18
|
-
const questions = {
|
|
19
|
-
name: 'choice',
|
|
20
|
-
type: 'list',
|
|
21
|
-
choices: [TOOL_CHOICE.AndroidTheme, TOOL_CHOICE.iosTheme],
|
|
22
|
-
message: 'What would you like to do?'
|
|
23
|
-
};
|
|
24
|
-
return _inquirer.default.prompt(questions);
|
|
25
|
-
}
|
|
26
|
-
async function confirmThemeValues() {
|
|
27
|
-
const questions = {
|
|
28
|
-
name: 'isConfirmed',
|
|
29
|
-
type: 'confirm',
|
|
30
|
-
message: 'Do these values look right?'
|
|
31
|
-
};
|
|
32
|
-
return _inquirer.default.prompt(questions);
|
|
33
|
-
}
|
|
34
|
-
async function confirmResourceFiles() {
|
|
35
|
-
const questions = {
|
|
36
|
-
name: 'isConfirmed',
|
|
37
|
-
type: 'confirm',
|
|
38
|
-
message: `Continue?`
|
|
39
|
-
};
|
|
40
|
-
return _inquirer.default.prompt(questions);
|
|
41
|
-
}
|
|
42
|
-
//# sourceMappingURL=prompts.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_inquirer","_interopRequireDefault","require","obj","__esModule","default","TOOL_CHOICE","AndroidTheme","iosTheme","exports","whatWouldYouLikePrompt","questions","name","type","choices","message","inquirer","prompt","confirmThemeValues","confirmResourceFiles"],"sources":["prompts.ts"],"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"],"mappings":";;;;;;;;;AAAA,IAAAA,SAAA,GAAAC,sBAAA,CAAAC,OAAA;AAAwD,SAAAD,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAEjD,MAAMG,WAAW,GAAG;EACzBC,YAAY,EAAE,sBAAsB;EACpCC,QAAQ,EAAE;AACZ,CAAC;AAACC,OAAA,CAAAH,WAAA,GAAAA,WAAA;AACK,eAAeI,sBAAsBA,CAAA,EAAG;EAC7C,MAAMC,SAAS,GAAG;IAChBC,IAAI,EAAE,QAAQ;IACdC,IAAI,EAAE,MAAM;IACZC,OAAO,EAAE,CAACR,WAAW,CAACC,YAAY,EAAED,WAAW,CAACE,QAAQ,CAAC;IACzDO,OAAO,EAAE;EACX,CAAuB;EAEvB,OAAOC,iBAAQ,CAACC,MAAM,CAACN,SAAS,CAAC;AACnC;AAEO,eAAeO,kBAAkBA,CAAA,EAAG;EACzC,MAAMP,SAAS,GAAG;IAChBC,IAAI,EAAE,aAAa;IACnBC,IAAI,EAAE,SAAS;IACfE,OAAO,EAAE;EACX,CAAuB;EAEvB,OAAOC,iBAAQ,CAACC,MAAM,CAACN,SAAS,CAAC;AACnC;AAEO,eAAeQ,oBAAoBA,CAAA,EAAG;EAC3C,MAAMR,SAAS,GAAG;IAChBC,IAAI,EAAE,aAAa;IACnBC,IAAI,EAAE,SAAS;IACfE,OAAO,EAAG;EACZ,CAAuB;EAEvB,OAAOC,iBAAQ,CAACC,MAAM,CAACN,SAAS,CAAC;AACnC"}
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _fs = _interopRequireDefault(require("fs"));
|
|
8
|
-
var _chalk = _interopRequireDefault(require("chalk"));
|
|
9
|
-
var _path = _interopRequireDefault(require("path"));
|
|
10
|
-
var _Theme = _interopRequireDefault(require("../Theme"));
|
|
11
|
-
var _prompts = require("../prompts");
|
|
12
|
-
var _AndroidResourcePrinter = _interopRequireDefault(require("../AndroidResourcePrinter"));
|
|
13
|
-
var _Config = _interopRequireDefault(require("../Config"));
|
|
14
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
-
const ANDROID_STYLES_RESOURCE_PATH = './android/app/src/main/res/values/styles_persona.xml';
|
|
16
|
-
const ANDROID_BUTTON_DRAWABLE_RESOURCE_PATH = './android/app/src/main/res/drawable/rn_persona_button.xml';
|
|
17
|
-
const ANDROID_BUTTON_COLOR_RESOURCE_PATH = './android/app/src/main/res/color/rn_persona_button.xml';
|
|
18
|
-
class ThemeGenerator {
|
|
19
|
-
async run() {
|
|
20
|
-
await _Theme.default.print();
|
|
21
|
-
const {
|
|
22
|
-
isConfirmed: themeValuesConfirmed
|
|
23
|
-
} = await (0, _prompts.confirmThemeValues)();
|
|
24
|
-
if (!themeValuesConfirmed) {
|
|
25
|
-
console.log(_chalk.default.yellow('\nPlease adjust the values in package.json.\n'));
|
|
26
|
-
return;
|
|
27
|
-
}
|
|
28
|
-
console.log(`\n${_chalk.default.yellow('Creating an Android Resource files for your project at:')}\n
|
|
29
|
-
- ${ANDROID_STYLES_RESOURCE_PATH}
|
|
30
|
-
- ${ANDROID_BUTTON_DRAWABLE_RESOURCE_PATH}
|
|
31
|
-
- ${ANDROID_BUTTON_COLOR_RESOURCE_PATH}\n`);
|
|
32
|
-
console.log('Building your application with this resource file themes your Persona Inquiry flow.\n');
|
|
33
|
-
const config = await _Config.default.get();
|
|
34
|
-
const theme = config.androidTheme;
|
|
35
|
-
const {
|
|
36
|
-
style,
|
|
37
|
-
buttonDrawable,
|
|
38
|
-
buttonColor
|
|
39
|
-
} = new _AndroidResourcePrinter.default(theme).process();
|
|
40
|
-
let {
|
|
41
|
-
isConfirmed: confirmed
|
|
42
|
-
} = await (0, _prompts.confirmResourceFiles)();
|
|
43
|
-
if (!confirmed) {
|
|
44
|
-
process.exit(1);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
// Add a line after confirmation
|
|
48
|
-
console.log('');
|
|
49
|
-
_fs.default.mkdirSync(_path.default.dirname(ANDROID_STYLES_RESOURCE_PATH), {
|
|
50
|
-
recursive: true
|
|
51
|
-
});
|
|
52
|
-
_fs.default.writeFileSync(ANDROID_STYLES_RESOURCE_PATH, style.end({
|
|
53
|
-
prettyPrint: true
|
|
54
|
-
}));
|
|
55
|
-
console.log(`${_chalk.default.green('Saved an Android style file at path:')} ${ANDROID_STYLES_RESOURCE_PATH}.`);
|
|
56
|
-
_fs.default.mkdirSync(_path.default.dirname(ANDROID_BUTTON_DRAWABLE_RESOURCE_PATH), {
|
|
57
|
-
recursive: true
|
|
58
|
-
});
|
|
59
|
-
_fs.default.writeFileSync(ANDROID_BUTTON_DRAWABLE_RESOURCE_PATH, buttonDrawable.end({
|
|
60
|
-
prettyPrint: true
|
|
61
|
-
}));
|
|
62
|
-
console.log(`${_chalk.default.green('Saved an Android drawable file at path:')} ${ANDROID_BUTTON_DRAWABLE_RESOURCE_PATH}.`);
|
|
63
|
-
_fs.default.mkdirSync(_path.default.dirname(ANDROID_BUTTON_COLOR_RESOURCE_PATH), {
|
|
64
|
-
recursive: true
|
|
65
|
-
});
|
|
66
|
-
_fs.default.writeFileSync(ANDROID_BUTTON_COLOR_RESOURCE_PATH, buttonColor.end({
|
|
67
|
-
prettyPrint: true
|
|
68
|
-
}));
|
|
69
|
-
console.log(`${_chalk.default.green('Saved an Android color file at path:')} ${ANDROID_BUTTON_COLOR_RESOURCE_PATH}.`);
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
var _default = new ThemeGenerator();
|
|
73
|
-
exports.default = _default;
|
|
74
|
-
//# sourceMappingURL=AndroidThemeGenerator.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_fs","_interopRequireDefault","require","_chalk","_path","_Theme","_prompts","_AndroidResourcePrinter","_Config","obj","__esModule","default","ANDROID_STYLES_RESOURCE_PATH","ANDROID_BUTTON_DRAWABLE_RESOURCE_PATH","ANDROID_BUTTON_COLOR_RESOURCE_PATH","ThemeGenerator","run","Theme","print","isConfirmed","themeValuesConfirmed","confirmThemeValues","console","log","chalk","yellow","config","Configuration","get","theme","androidTheme","style","buttonDrawable","buttonColor","AndroidResourcePrinter","process","confirmed","confirmResourceFiles","exit","fs","mkdirSync","path","dirname","recursive","writeFileSync","end","prettyPrint","green","_default","exports"],"sources":["AndroidThemeGenerator.ts"],"sourcesContent":["import fs from 'fs';\nimport chalk from 'chalk';\nimport path from 'path';\n\nimport Theme, { AndroidThemeObject } from '../Theme';\nimport { confirmThemeValues, confirmResourceFiles } from '../prompts';\nimport AndroidResourcePrinter from '../AndroidResourcePrinter';\nimport Configuration from '../Config';\n\nconst ANDROID_STYLES_RESOURCE_PATH =\n './android/app/src/main/res/values/styles_persona.xml';\nconst ANDROID_BUTTON_DRAWABLE_RESOURCE_PATH =\n './android/app/src/main/res/drawable/rn_persona_button.xml';\nconst ANDROID_BUTTON_COLOR_RESOURCE_PATH =\n './android/app/src/main/res/color/rn_persona_button.xml';\n\nclass ThemeGenerator {\n async run() {\n await Theme.print();\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(\n 'Creating an Android Resource files for your project at:'\n )}\\n\n - ${ANDROID_STYLES_RESOURCE_PATH}\n - ${ANDROID_BUTTON_DRAWABLE_RESOURCE_PATH}\n - ${ANDROID_BUTTON_COLOR_RESOURCE_PATH}\\n`\n );\n console.log(\n 'Building your application with this resource file themes your Persona Inquiry flow.\\n'\n );\n\n const config = await Configuration.get();\n const theme = config.androidTheme as AndroidThemeObject;\n\n const { style, buttonDrawable, buttonColor } = new AndroidResourcePrinter(\n theme\n ).process();\n\n let { isConfirmed: confirmed } = await confirmResourceFiles();\n\n if (!confirmed) {\n process.exit(1);\n }\n\n // Add a line after confirmation\n console.log('');\n\n fs.mkdirSync(path.dirname(ANDROID_STYLES_RESOURCE_PATH), {\n recursive: true,\n });\n fs.writeFileSync(\n ANDROID_STYLES_RESOURCE_PATH,\n style.end({ prettyPrint: true })\n );\n\n console.log(\n `${chalk.green(\n 'Saved an Android style file at path:'\n )} ${ANDROID_STYLES_RESOURCE_PATH}.`\n );\n\n fs.mkdirSync(path.dirname(ANDROID_BUTTON_DRAWABLE_RESOURCE_PATH), {\n recursive: true,\n });\n fs.writeFileSync(\n ANDROID_BUTTON_DRAWABLE_RESOURCE_PATH,\n buttonDrawable.end({ prettyPrint: true })\n );\n console.log(\n `${chalk.green(\n 'Saved an Android drawable file at path:'\n )} ${ANDROID_BUTTON_DRAWABLE_RESOURCE_PATH}.`\n );\n\n fs.mkdirSync(path.dirname(ANDROID_BUTTON_COLOR_RESOURCE_PATH), {\n recursive: true,\n });\n fs.writeFileSync(\n ANDROID_BUTTON_COLOR_RESOURCE_PATH,\n buttonColor.end({ prettyPrint: true })\n );\n console.log(\n `${chalk.green(\n 'Saved an Android color file at path:'\n )} ${ANDROID_BUTTON_COLOR_RESOURCE_PATH}.`\n );\n }\n}\n\nexport default new ThemeGenerator();\n"],"mappings":";;;;;;AAAA,IAAAA,GAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,KAAA,GAAAH,sBAAA,CAAAC,OAAA;AAEA,IAAAG,MAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,uBAAA,GAAAN,sBAAA,CAAAC,OAAA;AACA,IAAAM,OAAA,GAAAP,sBAAA,CAAAC,OAAA;AAAsC,SAAAD,uBAAAQ,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAEtC,MAAMG,4BAA4B,GAChC,sDAAsD;AACxD,MAAMC,qCAAqC,GACzC,2D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