@wavemaker/app-rn-runtime 11.4.0-next.141708 → 11.4.0-next.24560
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.
- app-rn-runtime/actions/notification-action.js +5 -4
- app-rn-runtime/actions/notification-action.js.map +1 -1
- app-rn-runtime/components/advanced/carousel/carousel-content/carousel-content.component.js +1 -1
- app-rn-runtime/components/advanced/carousel/carousel-content/carousel-content.component.js.map +1 -1
- app-rn-runtime/components/advanced/carousel/carousel-template/carousel-template.component.js +1 -1
- app-rn-runtime/components/advanced/carousel/carousel-template/carousel-template.component.js.map +1 -1
- app-rn-runtime/components/advanced/carousel/carousel.component.js +1 -1
- app-rn-runtime/components/advanced/carousel/carousel.component.js.map +1 -1
- app-rn-runtime/components/advanced/login/login.component.js +1 -1
- app-rn-runtime/components/advanced/login/login.component.js.map +1 -1
- app-rn-runtime/components/advanced/network-info-toaster/network-info-toaster.component.js +5 -5
- app-rn-runtime/components/advanced/network-info-toaster/network-info-toaster.component.js.map +1 -1
- app-rn-runtime/components/advanced/webview/webview.component.js +1 -1
- app-rn-runtime/components/advanced/webview/webview.component.js.map +1 -1
- app-rn-runtime/components/basic/anchor/anchor.component.js +1 -1
- app-rn-runtime/components/basic/anchor/anchor.component.js.map +1 -1
- app-rn-runtime/components/basic/button/button.component.js +1 -1
- app-rn-runtime/components/basic/button/button.component.js.map +1 -1
- app-rn-runtime/components/basic/buttongroup/buttongroup.component.js +1 -1
- app-rn-runtime/components/basic/buttongroup/buttongroup.component.js.map +1 -1
- app-rn-runtime/components/basic/custom/custom.component.js +25 -0
- app-rn-runtime/components/basic/custom/custom.component.js.map +1 -0
- app-rn-runtime/components/basic/custom/custom.props.js +16 -0
- app-rn-runtime/components/basic/custom/custom.props.js.map +1 -0
- app-rn-runtime/components/basic/custom/custom.styles.js +18 -0
- app-rn-runtime/components/basic/custom/custom.styles.js.map +1 -0
- app-rn-runtime/components/basic/icon/icon.component.js +1 -1
- app-rn-runtime/components/basic/icon/icon.component.js.map +1 -1
- app-rn-runtime/components/basic/label/label.component.js +1 -1
- app-rn-runtime/components/basic/label/label.component.js.map +1 -1
- app-rn-runtime/components/basic/lottie/lottie.component.js +137 -0
- app-rn-runtime/components/basic/lottie/lottie.component.js.map +1 -0
- app-rn-runtime/components/basic/lottie/lottie.props.js +14 -0
- app-rn-runtime/components/basic/lottie/lottie.props.js.map +1 -0
- app-rn-runtime/components/basic/lottie/lottie.styles.js +11 -0
- app-rn-runtime/components/basic/lottie/lottie.styles.js.map +1 -0
- app-rn-runtime/components/basic/message/message.component.js +1 -1
- app-rn-runtime/components/basic/message/message.component.js.map +1 -1
- app-rn-runtime/components/basic/picture/picture.component.js +37 -26
- app-rn-runtime/components/basic/picture/picture.component.js.map +1 -1
- app-rn-runtime/components/basic/progress-bar/progress-bar.component.js +3 -2
- app-rn-runtime/components/basic/progress-bar/progress-bar.component.js.map +1 -1
- app-rn-runtime/components/basic/progress-circle/progress-circle.component.js +1 -1
- app-rn-runtime/components/basic/progress-circle/progress-circle.component.js.map +1 -1
- app-rn-runtime/components/basic/search/search.component.js +4 -1
- app-rn-runtime/components/basic/search/search.component.js.map +1 -1
- app-rn-runtime/components/basic/spinner/spinner.component.js +10 -10
- app-rn-runtime/components/basic/spinner/spinner.component.js.map +1 -1
- app-rn-runtime/components/basic/video/video.component.js +56 -0
- app-rn-runtime/components/basic/video/video.component.js.map +1 -0
- app-rn-runtime/components/basic/video/video.props.js +22 -0
- app-rn-runtime/components/basic/video/video.props.js.map +1 -0
- app-rn-runtime/components/basic/video/video.styles.js +11 -0
- app-rn-runtime/components/basic/video/video.styles.js.map +1 -0
- app-rn-runtime/components/container/accordion/accordion.component.js +1 -1
- app-rn-runtime/components/container/accordion/accordion.component.js.map +1 -1
- app-rn-runtime/components/container/accordion/accordionpane/accordionpane.component.js +1 -1
- app-rn-runtime/components/container/accordion/accordionpane/accordionpane.component.js.map +1 -1
- app-rn-runtime/components/container/container.component.js +1 -1
- app-rn-runtime/components/container/container.component.js.map +1 -1
- app-rn-runtime/components/container/layoutgrid/gridcolumn/gridcolumn.component.js +1 -1
- app-rn-runtime/components/container/layoutgrid/gridcolumn/gridcolumn.component.js.map +1 -1
- app-rn-runtime/components/container/layoutgrid/gridrow/gridrow.component.js +1 -1
- app-rn-runtime/components/container/layoutgrid/gridrow/gridrow.component.js.map +1 -1
- app-rn-runtime/components/container/layoutgrid/layoutgrid.component.js +1 -1
- app-rn-runtime/components/container/layoutgrid/layoutgrid.component.js.map +1 -1
- app-rn-runtime/components/container/linearlayout/linearlayout.component.js +1 -1
- app-rn-runtime/components/container/linearlayout/linearlayout.component.js.map +1 -1
- app-rn-runtime/components/container/linearlayout/linearlayoutitem/linearlayoutitem.component.js +1 -1
- app-rn-runtime/components/container/linearlayout/linearlayoutitem/linearlayoutitem.component.js.map +1 -1
- app-rn-runtime/components/container/panel/panel-content/panel-content.component.js +1 -1
- app-rn-runtime/components/container/panel/panel-content/panel-content.component.js.map +1 -1
- app-rn-runtime/components/container/panel/panel-footer/panel-footer.component.js +1 -1
- app-rn-runtime/components/container/panel/panel-footer/panel-footer.component.js.map +1 -1
- app-rn-runtime/components/container/panel/panel.component.js +1 -1
- app-rn-runtime/components/container/panel/panel.component.js.map +1 -1
- app-rn-runtime/components/container/tabs/tabheader/tabheader.component.js +12 -4
- app-rn-runtime/components/container/tabs/tabheader/tabheader.component.js.map +1 -1
- app-rn-runtime/components/container/tabs/tabheader/tabheader.styles.js +2 -1
- app-rn-runtime/components/container/tabs/tabheader/tabheader.styles.js.map +1 -1
- app-rn-runtime/components/container/tabs/tabpane/tabpane.component.js +5 -2
- app-rn-runtime/components/container/tabs/tabpane/tabpane.component.js.map +1 -1
- app-rn-runtime/components/container/tabs/tabs.component.js +80 -64
- app-rn-runtime/components/container/tabs/tabs.component.js.map +1 -1
- app-rn-runtime/components/container/tabs/tabs.props.js +1 -0
- app-rn-runtime/components/container/tabs/tabs.props.js.map +1 -1
- app-rn-runtime/components/container/tabs/tabs.styles.js +1 -1
- app-rn-runtime/components/container/tabs/tabs.styles.js.map +1 -1
- app-rn-runtime/components/container/tile/tile.component.js +1 -1
- app-rn-runtime/components/container/tile/tile.component.js.map +1 -1
- app-rn-runtime/components/container/wizard/wizard.component.js +1 -1
- app-rn-runtime/components/container/wizard/wizard.component.js.map +1 -1
- app-rn-runtime/components/container/wizard/wizardstep/wizardstep.component.js +1 -1
- app-rn-runtime/components/container/wizard/wizardstep/wizardstep.component.js.map +1 -1
- app-rn-runtime/components/data/card/card-content/card-content.component.js +1 -1
- app-rn-runtime/components/data/card/card-content/card-content.component.js.map +1 -1
- app-rn-runtime/components/data/card/card-footer/card-footer.component.js +1 -1
- app-rn-runtime/components/data/card/card-footer/card-footer.component.js.map +1 -1
- app-rn-runtime/components/data/card/card.component.js +1 -1
- app-rn-runtime/components/data/card/card.component.js.map +1 -1
- app-rn-runtime/components/data/form/form-action/form-action.component.js +0 -6
- app-rn-runtime/components/data/form/form-action/form-action.component.js.map +1 -1
- app-rn-runtime/components/data/form/form-body/form-body.component.js +1 -1
- app-rn-runtime/components/data/form/form-body/form-body.component.js.map +1 -1
- app-rn-runtime/components/data/form/form-field/form-field.component.js +1 -1
- app-rn-runtime/components/data/form/form-field/form-field.component.js.map +1 -1
- app-rn-runtime/components/data/form/form-footer/form-footer.component.js +1 -1
- app-rn-runtime/components/data/form/form-footer/form-footer.component.js.map +1 -1
- app-rn-runtime/components/data/form/form.component.js +2 -31
- app-rn-runtime/components/data/form/form.component.js.map +1 -1
- app-rn-runtime/components/data/list/list-template/list-template.component.js +1 -1
- app-rn-runtime/components/data/list/list-template/list-template.component.js.map +1 -1
- app-rn-runtime/components/data/list/list.component.js +17 -8
- app-rn-runtime/components/data/list/list.component.js.map +1 -1
- app-rn-runtime/components/device/barcodescanner/barcodescanner.component.js +3 -2
- app-rn-runtime/components/device/barcodescanner/barcodescanner.component.js.map +1 -1
- app-rn-runtime/components/device/camera/camera.component.js +9 -4
- app-rn-runtime/components/device/camera/camera.component.js.map +1 -1
- app-rn-runtime/components/device/camera/camera.props.js +0 -1
- app-rn-runtime/components/device/camera/camera.props.js.map +1 -1
- app-rn-runtime/components/dialogs/dialog/dialog.component.js +1 -1
- app-rn-runtime/components/dialogs/dialog/dialog.component.js.map +1 -1
- app-rn-runtime/components/dialogs/dialogactions/dialogactions.component.js +1 -1
- app-rn-runtime/components/dialogs/dialogactions/dialogactions.component.js.map +1 -1
- app-rn-runtime/components/dialogs/dialogcontent/dialogcontent.component.js +1 -1
- app-rn-runtime/components/dialogs/dialogcontent/dialogcontent.component.js.map +1 -1
- app-rn-runtime/components/input/baseinput/baseinput.component.js +7 -0
- app-rn-runtime/components/input/baseinput/baseinput.component.js.map +1 -1
- app-rn-runtime/components/input/calendar/calendar.component.js +1 -1
- app-rn-runtime/components/input/calendar/calendar.component.js.map +1 -1
- app-rn-runtime/components/input/checkbox/checkbox.component.js +1 -16
- app-rn-runtime/components/input/checkbox/checkbox.component.js.map +1 -1
- app-rn-runtime/components/input/checkboxset/checkboxset.component.js +0 -38
- app-rn-runtime/components/input/checkboxset/checkboxset.component.js.map +1 -1
- app-rn-runtime/components/input/composite/composite.component.js +1 -1
- app-rn-runtime/components/input/composite/composite.component.js.map +1 -1
- app-rn-runtime/components/input/epoch/base-datetime.component.js +1 -1
- app-rn-runtime/components/input/epoch/base-datetime.component.js.map +1 -1
- app-rn-runtime/components/input/fileupload/fileupload.component.js +1 -1
- app-rn-runtime/components/input/fileupload/fileupload.component.js.map +1 -1
- app-rn-runtime/components/input/number/number.component.js +0 -9
- app-rn-runtime/components/input/number/number.component.js.map +1 -1
- app-rn-runtime/components/input/radioset/radioset.component.js +0 -40
- app-rn-runtime/components/input/radioset/radioset.component.js.map +1 -1
- app-rn-runtime/components/input/rating/rating.component.js +1 -1
- app-rn-runtime/components/input/rating/rating.component.js.map +1 -1
- app-rn-runtime/components/input/slider/slider.component.js +1 -1
- app-rn-runtime/components/input/slider/slider.component.js.map +1 -1
- app-rn-runtime/components/input/switch/switch.component.js +19 -22
- app-rn-runtime/components/input/switch/switch.component.js.map +1 -1
- app-rn-runtime/components/input/switch/switch.styles.js +7 -7
- app-rn-runtime/components/input/switch/switch.styles.js.map +1 -1
- app-rn-runtime/components/input/text/text.component.js +1 -10
- app-rn-runtime/components/input/text/text.component.js.map +1 -1
- app-rn-runtime/components/input/textarea/textarea.component.js +0 -10
- app-rn-runtime/components/input/textarea/textarea.component.js.map +1 -1
- app-rn-runtime/components/input/toggle/toggle.component.js +1 -1
- app-rn-runtime/components/input/toggle/toggle.component.js.map +1 -1
- app-rn-runtime/components/navigation/appnavbar/appnavbar.component.js +1 -1
- app-rn-runtime/components/navigation/appnavbar/appnavbar.component.js.map +1 -1
- app-rn-runtime/components/navigation/basenav/basenav.props.js +1 -0
- app-rn-runtime/components/navigation/basenav/basenav.props.js.map +1 -1
- app-rn-runtime/components/navigation/menu/menu.component.js +2 -1
- app-rn-runtime/components/navigation/menu/menu.component.js.map +1 -1
- app-rn-runtime/components/navigation/navbar/navbar.component.js +2 -0
- app-rn-runtime/components/navigation/navbar/navbar.component.js.map +1 -1
- app-rn-runtime/components/navigation/navitem/navitem.component.js +4 -3
- app-rn-runtime/components/navigation/navitem/navitem.component.js.map +1 -1
- app-rn-runtime/components/navigation/navitem/navitem.props.js +1 -0
- app-rn-runtime/components/navigation/navitem/navitem.props.js.map +1 -1
- app-rn-runtime/components/navigation/popover/popover.component.js +1 -1
- app-rn-runtime/components/navigation/popover/popover.component.js.map +1 -1
- app-rn-runtime/components/page/content/content.component.js +1 -1
- app-rn-runtime/components/page/content/content.component.js.map +1 -1
- app-rn-runtime/components/page/left-panel/left-panel.component.js +1 -1
- app-rn-runtime/components/page/left-panel/left-panel.component.js.map +1 -1
- app-rn-runtime/components/page/page-content/page-content.component.js +2 -2
- app-rn-runtime/components/page/page-content/page-content.component.js.map +1 -1
- app-rn-runtime/components/page/page.component.js +1 -1
- app-rn-runtime/components/page/page.component.js.map +1 -1
- app-rn-runtime/components/page/partial/partial.component.js +1 -1
- app-rn-runtime/components/page/partial/partial.component.js.map +1 -1
- app-rn-runtime/components/page/partial-container/partial-container.component.js +1 -1
- app-rn-runtime/components/page/partial-container/partial-container.component.js.map +1 -1
- app-rn-runtime/components/page/partial-container/partial-container.styles.js +2 -1
- app-rn-runtime/components/page/partial-container/partial-container.styles.js.map +1 -1
- app-rn-runtime/components/page/tabbar/tabbar.component.js +2 -1
- app-rn-runtime/components/page/tabbar/tabbar.component.js.map +1 -1
- app-rn-runtime/components/prefab/prefab-container.component.js +1 -1
- app-rn-runtime/components/prefab/prefab-container.component.js.map +1 -1
- app-rn-runtime/core/asset.provider.js +5 -0
- app-rn-runtime/core/asset.provider.js.map +1 -0
- app-rn-runtime/core/base.component.js +113 -41
- app-rn-runtime/core/base.component.js.map +1 -1
- app-rn-runtime/core/imageSizeEstimator.js +1 -0
- app-rn-runtime/core/imageSizeEstimator.js.map +1 -1
- app-rn-runtime/core/injector.js +15 -1
- app-rn-runtime/core/injector.js.map +1 -1
- app-rn-runtime/core/tappable.component.js +9 -2
- app-rn-runtime/core/tappable.component.js.map +1 -1
- app-rn-runtime/core/utils.js +6 -0
- app-rn-runtime/core/utils.js.map +1 -1
- app-rn-runtime/gestures/swipe.animation.js +105 -0
- app-rn-runtime/gestures/swipe.animation.js.map +1 -0
- app-rn-runtime/package.json +33 -32
- app-rn-runtime/runtime/App.js +24 -16
- app-rn-runtime/runtime/App.js.map +1 -1
- app-rn-runtime/runtime/App.navigator.js +2 -12
- app-rn-runtime/runtime/App.navigator.js.map +1 -1
- app-rn-runtime/runtime/base-fragment.component.js +6 -4
- app-rn-runtime/runtime/base-fragment.component.js.map +1 -1
- app-rn-runtime/runtime/navigator/drawer.navigator.js +4 -0
- app-rn-runtime/runtime/navigator/drawer.navigator.js.map +1 -1
- app-rn-runtime/runtime/navigator/stack.navigator.js +5 -1
- app-rn-runtime/runtime/navigator/stack.navigator.js.map +1 -1
- app-rn-runtime/runtime/services/app-security.service.js.map +1 -1
- app-rn-runtime/runtime/services/app-spinner.service.js +5 -1
- app-rn-runtime/runtime/services/app-spinner.service.js.map +1 -1
- app-rn-runtime/runtime/services/app-toast.service.js +1 -1
- app-rn-runtime/runtime/services/app-toast.service.js.map +1 -1
- app-rn-runtime/runtime/services/device/camera-service.js +28 -6
- app-rn-runtime/runtime/services/device/camera-service.js.map +1 -1
- app-rn-runtime/runtime/services/device/scan-service.js +15 -14
- app-rn-runtime/runtime/services/device/scan-service.js.map +1 -1
- app-rn-runtime/styles/background.component.js +259 -0
- app-rn-runtime/styles/background.component.js.map +1 -0
- app-rn-runtime/styles/style-prop.validator.js +38 -8
- app-rn-runtime/styles/style-prop.validator.js.map +1 -1
- app-rn-runtime/styles/style-props.js +93 -0
- app-rn-runtime/styles/style-props.js.map +1 -0
- app-rn-runtime/styles/theme.js +6 -37
- app-rn-runtime/styles/theme.js.map +1 -1
- app-rn-runtime/variables/device/camera/capture-image.operation.js.map +1 -1
- app-rn-runtime/variables/device/camera/capture-video.operation.js.map +1 -1
- app-rn-runtime/variables/device/file/upload-file.operation.js +43 -21
- app-rn-runtime/variables/device/file/upload-file.operation.js.map +1 -1
- app-rn-runtime/variables/http.service.js +12 -14
- app-rn-runtime/variables/http.service.js.map +1 -1
- app-rn-runtime/variables/live-variable.js +96 -0
- app-rn-runtime/variables/live-variable.js.map +1 -0
- app-rn-runtime/variables/service-variable.js +19 -8
- app-rn-runtime/variables/service-variable.js.map +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","LinearGradient","ExpoLinearGradient","Image","StyleSheet","View","isEmpty","isNil","isNumber","isString","imageSizeEstimator","AssetConsumer","IMAGE_URL_REGEX","LINEAT_GRADIENT_REGEX","BACKGROUND_POSITION_REGEX","BACKGROUND_SIZE_REGEX","Component","constructor","props","state","parse","val","value","splits","split","map","v","trim","angle","locations","endsWith","parseInt","shift","delta","Math","round","tan","PI","abs","end","x","y","start","colors","s","p","matchAll","next","push","replace","componentDidUpdate","prevProps","prevState","snapshot","setState","render","borderWidth","overflow","absoluteFill","style","middle","flexDirection","justifyContent","alignItems","size","width","position","borderRadius","children","BackgroundComponent","caluculateSize","imageSrc","height","resolveAssetSource","naturalImageWidth","naturalImageHeight","getSize","uri","getPositionAndSize","result","resizeMode","top","left","getGradient","length","repeat","renderLinearGradient","data","psresult","image","setImage","componentDidMount","setTimeout","source","startsWith","loadAsset","renderImage","minWidth","minHeight","gradientData"],"sources":["background.component.tsx"],"sourcesContent":["import * as React from 'react';\nimport { LinearGradient as ExpoLinearGradient, LinearGradientPoint } from 'expo-linear-gradient';\nimport { Image, StyleSheet, View, ViewStyle } from 'react-native';\nimport { isEmpty, isNil, isNumber, isString } from 'lodash-es';\nimport imageSizeEstimator from '@wavemaker/app-rn-runtime/core/imageSizeEstimator';\nimport { AssetConsumer } from '@wavemaker/app-rn-runtime/core/asset.provider';\n\nexport interface LinearGradientProps {\n value: string;\n children: any;\n style?: ViewStyle;\n size?: ViewStyle;\n position?: ViewStyle;\n middle?: boolean;\n}\n\nexport interface LinearGradientState {\n colors: string[];\n locations: number[];\n start: LinearGradientPoint;\n end: LinearGradientPoint;\n}\n\nconst IMAGE_URL_REGEX = /url\\(['|\"]?(.+)['|\"]?\\)$/gi;\nconst LINEAT_GRADIENT_REGEX = /linear-gradient\\((.+)\\)$/gi;\nconst BACKGROUND_POSITION_REGEX = /([0-9%]+)[a-z]*\\s*([0-9%]+)[a-z]*/g;\nconst BACKGROUND_SIZE_REGEX = /([0-9%]+)[a-z]*\\s*([0-9%]+)[a-z]*/g;\n\nexport class LinearGradient extends React.Component<LinearGradientProps, LinearGradientState> {\n\n constructor(props: LinearGradientProps) {\n super(props);\n this.state = this.parse();\n }\n\n parse(val = this.props.value) {\n let state = {} as LinearGradientState;\n const splits = val.split(',').map(v => v.trim());\n let angle = 0;\n const locations: LinearGradientPoint[] = [];\n if (splits[0].endsWith('deg')) {\n angle = (parseInt(splits[0].split('deg')[0]))%360;\n angle = angle < 0 ? (360 + angle) : angle;\n splits.shift();\n }\n angle += 90;\n const delta = Math.round(Math.tan((angle * Math.PI) / 180) * 100)/100;\n if (Math.abs(delta) > 1) {\n state = {\n end: {\n x: -0.5 / delta + 0.5,\n y: 0\n },\n start: {\n x: 0.5 / delta + 0.5,\n y: 1\n }\n } as LinearGradientState;\n } else {\n state = {\n start: {\n x: 0,\n y: -0.5 * delta + 0.5\n },\n end: {\n x: 1,\n y: 0.5 * delta + 0.5\n }\n } as LinearGradientState;\n }\n if (angle >= 270 && angle <= 450) {\n state = {\n start : state.end,\n end: state.start\n } as LinearGradientState;\n }\n state.colors = [];\n state.locations = [];\n splits.map(s => {\n const p = s.matchAll(/\\s*([0-9]+)%/g).next()?.value;\n if (p) {\n state.locations.push(parseInt(p[1]) / 100);\n state.colors.push(s.replace(p[0], ''));\n } else {\n state.locations.push(null as any);\n state.colors.push(s);\n }\n });\n return state;\n }\n\n componentDidUpdate(prevProps: Readonly<LinearGradientProps>, prevState: Readonly<{}>, snapshot?: any): void {\n if (prevProps.value !== this.props.value) {\n this.setState(this.parse());\n }\n }\n \n\n public render() {\n return (\n <View style={[{borderWidth: 0, overflow: 'hidden'}, StyleSheet.absoluteFill, this.props.style]}>\n <View style={[\n StyleSheet.absoluteFill, this.props.middle ? {\n flexDirection: 'row',\n justifyContent: 'center',\n alignItems: 'center'\n } : null]}>\n <ExpoLinearGradient\n colors={this.state.colors}\n locations={this.state.locations}\n start={this.state.start}\n end={this.state.end}\n style={[\n this.props.size?.width ? this.props.size : StyleSheet.absoluteFill,\n this.props.position,\n {position: 'absolute', borderRadius: this.props.style?.borderRadius}\n ]}\n />\n </View>\n {this.props.children}\n </View>\n );\n }\n}\n\nexport interface BackgroundProps {\n image?: string;\n position?: string;\n children?: any;\n resizeMode?: string;\n repeat?: string;\n style?: ViewStyle;\n size: string;\n}\n\nexport interface BackgroundState {\n imageSrc: any;\n naturalImageWidth: number,\n naturalImageHeight: number\n}\n\nexport class BackgroundComponent extends React.Component<BackgroundProps, BackgroundState> {\n\n private loadAsset: (path: string) => number | string = null as any;\n\n constructor(props: BackgroundProps) {\n super(props);\n this.state = {} as BackgroundState;\n }\n\n public caluculateSize(imageSrc: any) {\n if (isNumber(imageSrc)) {\n const {width, height} = Image.resolveAssetSource(imageSrc);\n this.setState({\n naturalImageWidth: width,\n naturalImageHeight: height\n } as BackgroundState);\n } else if (!isNil(imageSrc)) {\n imageSizeEstimator.getSize(imageSrc.uri, (width: number, height: number) => {\n this.setState({\n naturalImageWidth: width,\n naturalImageHeight: height\n } as BackgroundState);\n });\n }\n }\n\n public getPositionAndSize() {\n const result: {\n resizeMode? : string,\n position?: {\n top?: string | number,\n left?: string | number,\n },\n size?: {\n width?: string | number,\n height? : string | number\n }\n } = {} as any;\n if (this.props.resizeMode) {\n result.resizeMode = this.props.resizeMode;\n return result;\n } else if (this.props.position === 'center') {\n result.resizeMode = 'center';\n } else if (this.props.size === 'contain' || this.props.size === 'cover') {\n result.resizeMode = this.props.size;\n return result;\n }\n const size = this.props.size?.matchAll(BACKGROUND_SIZE_REGEX).next().value;\n result.size = {};\n if (size) {\n result.size.width = size[1].endsWith('%') ? size[1] : parseInt(size[1]);\n result.size.height = size[2].endsWith('%') ? size[2] : parseInt(size[2]);\n }\n if (!result.resizeMode && this.props.position) {\n result.position = {};\n const position = this.props.position.matchAll(BACKGROUND_POSITION_REGEX).next().value;\n result.position.top = position[1].endsWith('%') ? position[1] : parseInt(position[1]);\n result.position.left = position[2].endsWith('%') ? position[2] : parseInt(position[2]);\n }\n if (!this.getGradient()?.value?.length) {\n if (this.props.repeat === 'no-repeat') {\n result.size.width = result.size.width || this.state.naturalImageWidth; \n result.size.height = result.size.height || this.state.naturalImageHeight; \n } else if (this.props.repeat === 'repeat-x') {\n result.resizeMode = 'repeat';\n result.size.width = result.size.width || '100%'; \n result.size.height = result.size.height || this.state.naturalImageHeight; \n } else if (this.props.repeat === 'repeat-y') {\n result.resizeMode = 'repeat';\n result.size.width = result.size.width || this.state.naturalImageWidth; \n result.size.height = result.size.height || '100%'; \n } else {\n result.resizeMode = 'repeat';\n }\n }\n return result;\n }\n\n public renderLinearGradient(data: string) {\n const psresult = this.getPositionAndSize();\n return (\n <LinearGradient\n value={data || ''}\n style={this.props.style}\n size={psresult.size}\n position={psresult.position}\n middle={psresult.resizeMode === 'center'}>\n </LinearGradient>\n );\n }\n\n componentDidUpdate(prevProps: Readonly<BackgroundProps>, prevState: Readonly<{}>, snapshot?: any): void {\n if (prevProps.image !== this.props.image) {\n this.setImage();\n }\n }\n\n componentDidMount(): void {\n setTimeout(() => this.setImage(), 100);\n }\n\n setImage() {\n let source = this.props.image?.trim() as any;\n if (source?.startsWith('url')) {\n source = this.props.image?.matchAll(IMAGE_URL_REGEX).next().value[1];\n }\n if (this.loadAsset) {\n source = this.loadAsset(source);\n }\n if (isString(source) && (\n source.startsWith('data:') ||\n source.startsWith('http') || \n source.startsWith('file:'))) {\n source = {\n uri: source\n };\n }\n this.caluculateSize(source);\n this.setState({\n imageSrc: source\n } as BackgroundState);\n }\n\n public getGradient() {\n return this.props.image?.trim().matchAll(LINEAT_GRADIENT_REGEX).next();\n }\n\n public renderImage() {\n const psresult = this.getPositionAndSize();\n return (\n <AssetConsumer>\n {(loadAsset) => {\n this.loadAsset = loadAsset;\n return (<View style={[{borderWidth: 0, overflow: 'hidden'}, StyleSheet.absoluteFill, this.props.style]}>\n <View style={[\n StyleSheet.absoluteFill, this.props.position === 'center' ? {\n flexDirection: 'row',\n justifyContent: 'center',\n alignItems: 'center'\n } : null]}>\n <View style={[\n { position: 'absolute', overflow: 'hidden' },\n psresult.position,\n isEmpty(psresult.size) ? StyleSheet.absoluteFill : psresult.size\n ]}>\n <Image\n source={this.state.imageSrc}\n resizeMode={psresult.resizeMode as any || 'cover'}\n style={[\n { \n width: '100%',\n height: '100%'\n }, \n isEmpty(psresult.size) ? {\n minWidth: this.state.naturalImageWidth,\n minHeight: this.state.naturalImageHeight\n } : null\n ]}/>\n </View>\n </View>\n </View>);\n }}\n </AssetConsumer>\n );\n }\n\n public render() {\n const gradientData = this.getGradient();\n if (gradientData?.value?.length) {\n return this.renderLinearGradient(gradientData.value[1]);\n } else if (this.props.image) {\n return this.renderImage();\n }\n return null;\n }\n}\n\n"],"mappings":";;;AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,cAAc,IAAIC,kBAAkB,QAA6B,sBAAsB;AAChG,SAASC,KAAK,EAAEC,UAAU,EAAEC,IAAI,QAAmB,cAAc;AACjE,SAASC,OAAO,EAAEC,KAAK,EAAEC,QAAQ,EAAEC,QAAQ,QAAQ,WAAW;AAC9D,OAAOC,kBAAkB,MAAM,mDAAmD;AAClF,SAASC,aAAa,QAAQ,+CAA+C;AAkB7E,MAAMC,eAAe,GAAG,4BAA4B;AACpD,MAAMC,qBAAqB,GAAG,4BAA4B;AAC1D,MAAMC,yBAAyB,GAAG,oCAAoC;AACtE,MAAMC,qBAAqB,GAAG,oCAAoC;AAElE,OAAO,MAAMd,cAAc,SAASD,KAAK,CAACgB,SAAS,CAA2C;EAE1FC,WAAW,CAACC,KAA0B,EAAE;IACpC,KAAK,CAACA,KAAK,CAAC;IACZ,IAAI,CAACC,KAAK,GAAG,IAAI,CAACC,KAAK,EAAE;EAC7B;EAEAA,KAAK,GAAyB;IAAA,IAAxBC,GAAG,uEAAG,IAAI,CAACH,KAAK,CAACI,KAAK;IACxB,IAAIH,KAAK,GAAG,CAAC,CAAwB;IACrC,MAAMI,MAAM,GAAGF,GAAG,CAACG,KAAK,CAAC,GAAG,CAAC,CAACC,GAAG,CAACC,CAAC,IAAIA,CAAC,CAACC,IAAI,EAAE,CAAC;IAChD,IAAIC,KAAK,GAAG,CAAC;IACb,MAAMC,SAAgC,GAAG,EAAE;IAC3C,IAAIN,MAAM,CAAC,CAAC,CAAC,CAACO,QAAQ,CAAC,KAAK,CAAC,EAAE;MAC3BF,KAAK,GAAIG,QAAQ,CAACR,MAAM,CAAC,CAAC,CAAC,C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AAO,IAAI,CAACO,WAAW,EAAE;IAC7B;IACA,OAAO,IAAI;EACf;AACJ"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { isNumber, isString } from 'lodash-es';
|
|
2
|
+
import * as Font from 'expo-font';
|
|
2
3
|
const isColor = c => true;
|
|
3
4
|
const isStringOrNumber = v => isNumber(v) || isString(v);
|
|
4
5
|
const isIn = function () {
|
|
@@ -36,6 +37,10 @@ const STYLE_PROP_TYPE_INFO = {
|
|
|
36
37
|
isValid: isColor,
|
|
37
38
|
ref: 'https://reactnative.dev/docs/image-style-props#backgroundcolor'
|
|
38
39
|
},
|
|
40
|
+
backgroundImage: {
|
|
41
|
+
isValid: isString,
|
|
42
|
+
ref: 'http://www.wavemakeronline.com/app-runtime/latest/rn/style-docs/widgets/view'
|
|
43
|
+
},
|
|
39
44
|
borderBottomColor: {
|
|
40
45
|
isValid: isColor,
|
|
41
46
|
ref: 'https://reactnative.dev/docs/view-style-props#borderbottomcolor'
|
|
@@ -48,6 +53,18 @@ const STYLE_PROP_TYPE_INFO = {
|
|
|
48
53
|
isValid: isNumber,
|
|
49
54
|
ref: 'https://reactnative.dev/docs/image-style-props#borderbottomleftradius'
|
|
50
55
|
},
|
|
56
|
+
backgroundPosition: {
|
|
57
|
+
isValid: isStringOrNumber,
|
|
58
|
+
ref: 'http://www.wavemakeronline.com/app-runtime/latest/rn/style-docs/widgets/view'
|
|
59
|
+
},
|
|
60
|
+
backgroundRepeat: {
|
|
61
|
+
isValid: isIn('repeat', 'repeat-x', 'repeat-y', 'no-repeat'),
|
|
62
|
+
ref: 'http://www.wavemakeronline.com/app-runtime/latest/rn/style-docs/widgets/view'
|
|
63
|
+
},
|
|
64
|
+
backgroundSize: {
|
|
65
|
+
isValid: isStringOrNumber,
|
|
66
|
+
ref: 'http://www.wavemakeronline.com/app-runtime/latest/rn/style-docs/widgets/view'
|
|
67
|
+
},
|
|
51
68
|
borderBottomRightRadius: {
|
|
52
69
|
isValid: isNumber,
|
|
53
70
|
ref: 'https://reactnative.dev/docs/image-style-props#borderbottomrightradius'
|
|
@@ -89,7 +106,7 @@ const STYLE_PROP_TYPE_INFO = {
|
|
|
89
106
|
ref: 'https://reactnative.dev/docs/image-style-props#borderradius'
|
|
90
107
|
},
|
|
91
108
|
borderRightColor: {
|
|
92
|
-
isValid:
|
|
109
|
+
isValid: isColor,
|
|
93
110
|
ref: 'https://reactnative.dev/docs/view-style-props#borderrightcolor'
|
|
94
111
|
},
|
|
95
112
|
borderRightWidth: {
|
|
@@ -108,12 +125,8 @@ const STYLE_PROP_TYPE_INFO = {
|
|
|
108
125
|
isValid: isIn('solid', 'dotted', 'dashed'),
|
|
109
126
|
ref: 'https://reactnative.dev/docs/view-style-props#borderstyle'
|
|
110
127
|
},
|
|
111
|
-
borderTopColor: {
|
|
112
|
-
isValid: isNumber,
|
|
113
|
-
ref: 'https://reactnative.dev/docs/view-style-props#bordertopcolor'
|
|
114
|
-
},
|
|
115
128
|
borderTopEndRadius: {
|
|
116
|
-
isValid:
|
|
129
|
+
isValid: isColor,
|
|
117
130
|
ref: 'https://reactnative.dev/docs/view-style-props#bordertopendradius'
|
|
118
131
|
},
|
|
119
132
|
borderTopLeftRadius: {
|
|
@@ -128,6 +141,10 @@ const STYLE_PROP_TYPE_INFO = {
|
|
|
128
141
|
isValid: isNumber,
|
|
129
142
|
ref: 'https://reactnative.dev/docs/view-style-props#bordertopstartradius'
|
|
130
143
|
},
|
|
144
|
+
borderTopColor: {
|
|
145
|
+
isValid: isColor,
|
|
146
|
+
ref: 'https://reactnative.dev/docs/layout-props#bordertopwidth'
|
|
147
|
+
},
|
|
131
148
|
borderTopWidth: {
|
|
132
149
|
isValid: isNumber,
|
|
133
150
|
ref: 'https://reactnative.dev/docs/layout-props#bordertopwidth'
|
|
@@ -189,7 +206,8 @@ const STYLE_PROP_TYPE_INFO = {
|
|
|
189
206
|
ref: 'https://reactnative.dev/docs/layout-props#flexwrap'
|
|
190
207
|
},
|
|
191
208
|
fontFamily: {
|
|
192
|
-
isValid:
|
|
209
|
+
isValid: v => Font.isLoaded(v),
|
|
210
|
+
errorMsg: v => `Font '${v}' is not loaded. Font family names are case-sensitive. Please add font either in theme or app.`,
|
|
193
211
|
ref: 'https://reactnative.dev/docs/text-style-props#fontfamily'
|
|
194
212
|
},
|
|
195
213
|
fontSize: {
|
|
@@ -431,6 +449,18 @@ export const getStyleReference = name => {
|
|
|
431
449
|
};
|
|
432
450
|
export const isValidStyleProp = (name, value) => {
|
|
433
451
|
const info = STYLE_PROP_TYPE_INFO[name];
|
|
434
|
-
return
|
|
452
|
+
return (name === null || name === void 0 ? void 0 : name.trim().startsWith('__')) || info && info.isValid(value);
|
|
453
|
+
};
|
|
454
|
+
export const getErrorMessage = (name, value) => {
|
|
455
|
+
const info = STYLE_PROP_TYPE_INFO[name];
|
|
456
|
+
name = name.replace(/([A-Z])/g, g => `-${g[0].toLowerCase()}`);
|
|
457
|
+
if (info) {
|
|
458
|
+
if (info.errorMsg) {
|
|
459
|
+
return info.errorMsg(value);
|
|
460
|
+
} else {
|
|
461
|
+
return `'${value}' is not a valid value to '${name}'.`;
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
return `'${name}' is not a supported style property in one or all Native Platforms.`;
|
|
435
465
|
};
|
|
436
466
|
//# sourceMappingURL=style-prop.validator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["isNumber","isString","isColor","c","isStringOrNumber","v","isIn","obj","arr","forEach","k","STYLE_PROP_TYPE_INFO","alignContent","isValid","ref","alignItems","alignSelf","aspectRatio","backfaceVisibility","backgroundColor","borderBottomColor","borderBottomEndRadius","borderBottomLeftRadius","borderBottomRightRadius","borderBottomStartRadius","borderBottomWidth","borderColor","borderCurve","borderEndColor","borderEndWidth","borderLeftColor","borderLeftWidth","borderRadius","borderRightColor","borderRightWidth","borderStartColor","borderStartWidth","borderStyle","borderTopColor","borderTopEndRadius","borderTopLeftRadius","borderTopRightRadius","borderTopStartRadius","borderTopWidth","borderWidth","bottom","color","columnGap","direction","display","elevation","end","flex","flexBasis","flexDirection","flexGrow","flexShrink","flexWrap","fontFamily","fontSize","fontStyle","fontVariant","fontWeight","gap","height","justifyContent","left","letterSpacing","lineHeight","margin","marginBottom","marginEnd","marginHorizontal","marginLeft","marginRight","marginStart","marginTop","marginVertical","maxHeight","maxWidth","minHeight","minWidth","opacity","overflow","overlayColor","padding","paddingBottom","paddingEnd","paddingHorizontal","paddingLeft","paddingRight","paddingStart","paddingTop","paddingVertical","pointerEvents","position","resizeMode","right","rowGap","shadowColor","shadowOpacity","shadowRadius","start","textAlign","textAlignVertical","textDecorationColor","textDecorationLine","textDecorationStyle","textShadowColor","textShadowRadius","textTransform","tintColor","top","verticalAlign","width","writingDirection","zIndex","getStyleReference","name","info","isValidStyleProp","value"],"sources":["style-prop.validator.ts"],"sourcesContent":["import {isNumber, isNil, isString } from 'lodash-es';\n\nconst isColor = (c: string) => true;\nconst isStringOrNumber = (v: any) => isNumber(v) || isString(v);\nconst isIn = (...arr: any) => {\n const obj = {};\n arr.forEach((v: any) => {\n (obj as any)[v] = true;\n })\n return (k: any) => (obj as any)[k] === true ;\n};\n\nconst STYLE_PROP_TYPE_INFO = {\n alignContent: {\n isValid: isIn('flex-start', 'flex-end', 'center', 'stretch', 'space-between', 'space-around'),\n ref: 'https://reactnative.dev/docs/layout-props#aligncontent'\n },\n alignItems: {\n isValid: isIn('flex-start', 'flex-end', 'center', 'stretch', 'baseline'),\n ref: 'https://reactnative.dev/docs/layout-props#alignitems'\n },\n alignSelf: {\n isValid: isIn('auto', 'flex-start', 'flex-end', 'center', 'stretch', 'baseline'),\n ref: 'https://reactnative.dev/docs/layout-props#alignself'\n },\n aspectRatio: {\n isValid: isStringOrNumber,\n ref: 'https://reactnative.dev/docs/layout-props#aspectratio'\n },\n backfaceVisibility: {\n isValid: isIn('visible', 'hidden'),\n ref: 'https://reactnative.dev/docs/image-style-props#backfacevisibility'\n },\n backgroundColor: {\n isValid: isColor,\n ref: 'https://reactnative.dev/docs/image-style-props#backgroundcolor'\n },\n borderBottomColor: {\n isValid: isColor,\n ref: 'https://reactnative.dev/docs/view-style-props#borderbottomcolor'\n },\n borderBottomEndRadius: {\n isValid: isNumber,\n ref: 'https://reactnative.dev/docs/view-style-props#borderbottomendradius'\n },\n borderBottomLeftRadius: {\n isValid: isNumber,\n ref: 'https://reactnative.dev/docs/image-style-props#borderbottomleftradius'\n },\n borderBottomRightRadius: {\n isValid: isNumber,\n ref: 'https://reactnative.dev/docs/image-style-props#borderbottomrightradius'\n },\n borderBottomStartRadius: {\n isValid: isNumber,\n ref: 'https://reactnative.dev/docs/view-style-props#borderbottomstartradius'\n },\n borderBottomWidth: {\n isValid: isNumber,\n ref: 'https://reactnative.dev/docs/layout-props#borderbottomwidth'\n },\n borderColor: {\n isValid: isColor,\n ref: 'https://reactnative.dev/docs/image-style-props#bordercolor'\n },\n borderCurve: {\n isValid: isIn('circular', 'continuous'),\n ref: 'https://reactnative.dev/docs/view-style-props#bordercurve-ios'\n },\n borderEndColor: {\n isValid: isColor,\n ref: 'https://reactnative.dev/docs/view-style-props#borderendcolor'\n },\n borderEndWidth: {\n isValid: isNumber,\n ref: 'https://reactnative.dev/docs/layout-props#borderendwidth'\n },\n borderLeftColor: {\n isValid: isColor,\n ref: 'https://reactnative.dev/docs/view-style-props#borderleftcolor'\n },\n borderLeftWidth: {\n isValid: isNumber,\n ref: 'https://reactnative.dev/docs/layout-props#borderleftwidth'\n },\n borderRadius: {\n isValid: isNumber,\n ref: 'https://reactnative.dev/docs/image-style-props#borderradius'\n },\n borderRightColor: {\n isValid: isNumber,\n ref: 'https://reactnative.dev/docs/view-style-props#borderrightcolor'\n },\n borderRightWidth: {\n isValid: isNumber,\n ref: 'https://reactnative.dev/docs/layout-props#borderrightwidth'\n },\n borderStartColor: {\n isValid: isColor,\n ref: 'https://reactnative.dev/docs/view-style-props#borderstartcolor'\n },\n borderStartWidth: {\n isValid: isNumber,\n ref: 'https://reactnative.dev/docs/layout-props#borderstartwidth'\n },\n borderStyle: {\n isValid: isIn('solid', 'dotted', 'dashed'),\n ref: 'https://reactnative.dev/docs/view-style-props#borderstyle'\n },\n borderTopColor: {\n isValid: isNumber,\n ref: 'https://reactnative.dev/docs/view-style-props#bordertopcolor'\n },\n borderTopEndRadius: {\n isValid: isNumber,\n ref: 'https://reactnative.dev/docs/view-style-props#bordertopendradius'\n },\n borderTopLeftRadius: {\n isValid: isNumber,\n ref: 'https://reactnative.dev/docs/image-style-props#bordertopleftradius'\n },\n borderTopRightRadius: {\n isValid: isNumber,\n ref: 'https://reactnative.dev/docs/image-style-props#bordertoprightradius'\n },\n borderTopStartRadius: {\n isValid: isNumber,\n ref: 'https://reactnative.dev/docs/view-style-props#bordertopstartradius'\n },\n borderTopWidth: {\n isValid: isNumber,\n ref: 'https://reactnative.dev/docs/layout-props#bordertopwidth'\n },\n borderWidth: {\n isValid: isNumber,\n ref: 'https://reactnative.dev/docs/image-style-props#borderwidth'\n },\n bottom: {\n isValid: isStringOrNumber,\n ref: 'https://reactnative.dev/docs/layout-props#bottom'\n },\n color: {\n isValid: isColor,\n ref: 'https://reactnative.dev/docs/text-style-props#color'\n },\n columnGap: {\n isValid: isNumber,\n ref: 'https://reactnative.dev/docs/layout-props#columngap'\n },\n direction: {\n isValid: isIn('inherit', 'LTR', 'RTL'),\n ref: 'https://reactnative.dev/docs/layout-props#direction'\n },\n display: {\n isValid: isIn('none', 'flex'),\n ref: 'https://reactnative.dev/docs/layout-props#display'\n },\n elevation: {\n isValid: isNumber,\n ref: 'https://reactnative.dev/docs/view-style-props#elevation-android'\n },\n end: {\n isValid: isStringOrNumber,\n ref: 'https://reactnative.dev/docs/layout-props#end'\n },\n flex: {\n isValid: isNumber,\n ref: 'https://reactnative.dev/docs/layout-props#flex'\n },\n flexBasis: {\n isValid: isStringOrNumber,\n ref: 'https://reactnative.dev/docs/layout-props#flexbasis'\n },\n flexDirection: {\n isValid: isIn('column', 'row', 'column-reverse', 'row-reverse'),\n ref: 'https://reactnative.dev/docs/layout-props#flexdirection'\n },\n flexGrow: {\n isValid: isNumber,\n ref: 'https://reactnative.dev/docs/layout-props#flexgrow'\n },\n flexShrink: {\n isValid: isNumber,\n ref: 'https://reactnative.dev/docs/layout-props#flexshrink'\n },\n flexWrap: {\n isValid: isIn('wrap', 'nowrap', 'wrap-reverse'),\n ref: 'https://reactnative.dev/docs/layout-props#flexwrap'\n },\n fontFamily: {\n isValid: isString,\n ref: 'https://reactnative.dev/docs/text-style-props#fontfamily'\n },\n fontSize: {\n isValid: isNumber,\n ref: 'https://reactnative.dev/docs/text-style-props#fontsize'\n },\n fontStyle: {\n isValid: isIn('normal', 'italic'),\n ref: 'https://reactnative.dev/docs/text-style-props#fontstyle'\n },\n fontVariant: {\n isValid: (v: any) => isIn('small-caps', 'oldstyle-nums', 'lining-nums', 'tabular-nums', 'proportional-nums') || isString(v),\n ref: 'https://reactnative.dev/docs/text-style-props#fontvariant'\n },\n fontWeight: {\n isValid: (v: any) => isIn('normal', 'bold', '100', '200', '300', '400', '500', '600', '700', '800', '900') || isNumber(v),\n ref: 'https://reactnative.dev/docs/text-style-props#fontweight'\n },\n gap: {\n isValid: isNumber,\n ref: 'https://reactnative.dev/docs/layout-props#gap'\n },\n height: {\n isValid: isStringOrNumber,\n ref: 'https://reactnative.dev/docs/layout-props#height'\n },\n justifyContent: {\n isValid: isIn('flex-start', 'flex-end', 'center', 'space-between', 'space-around', 'space-evenly'),\n ref: 'https://reactnative.dev/docs/layout-props#justifycontent'\n },\n left: {\n isValid: isStringOrNumber,\n ref: 'https://reactnative.dev/docs/layout-props#left'\n },\n letterSpacing: {\n isValid: isNumber,\n ref: 'https://reactnative.dev/docs/text-style-props#letterspacing'\n },\n lineHeight: {\n isValid: isNumber,\n ref: 'https://reactnative.dev/docs/text-style-props#lineheight'\n },\n margin: {\n isValid: isStringOrNumber,\n ref: 'https://reactnative.dev/docs/layout-props#margin'\n },\n marginBottom: {\n isValid: isStringOrNumber,\n ref: 'https://reactnative.dev/docs/layout-props#marginbottom'\n },\n marginEnd: {\n isValid: isStringOrNumber,\n ref: 'https://reactnative.dev/docs/layout-props#marginend'\n },\n marginHorizontal: {\n isValid: isStringOrNumber,\n ref: 'https://reactnative.dev/docs/layout-props#marginhorizontal'\n },\n marginLeft: {\n isValid: isStringOrNumber,\n ref: 'https://reactnative.dev/docs/layout-props#marginleft'\n },\n marginRight: {\n isValid: isStringOrNumber,\n ref: 'https://reactnative.dev/docs/layout-props#marginright'\n },\n marginStart: {\n isValid: isStringOrNumber,\n ref: 'https://reactnative.dev/docs/layout-props#marginstart'\n },\n marginTop: {\n isValid: isStringOrNumber,\n ref: 'https://reactnative.dev/docs/layout-props#margintop'\n },\n marginVertical: {\n isValid: isStringOrNumber,\n ref: 'https://reactnative.dev/docs/layout-props#marginvertical'\n },\n maxHeight: {\n isValid: isStringOrNumber,\n ref: 'https://reactnative.dev/docs/layout-props#maxheight'\n },\n maxWidth: {\n isValid: isStringOrNumber,\n ref: 'https://reactnative.dev/docs/layout-props#maxwidth'\n },\n minHeight: {\n isValid: isStringOrNumber,\n ref: 'https://reactnative.dev/docs/layout-props#minheight'\n },\n minWidth: {\n isValid: isStringOrNumber,\n ref: 'https://reactnative.dev/docs/layout-props#minwidth'\n },\n opacity: {\n isValid: isNumber,\n ref: 'https://reactnative.dev/docs/image-style-props#opacity'\n },\n overflow: {\n isValid: isIn('visible', 'hidden', 'scroll'),\n ref: 'https://reactnative.dev/docs/image-style-props#overflow'\n },\n overlayColor: {\n isValid: isColor,\n ref: 'https://reactnative.dev/docs/image-style-props#overlaycolor-android'\n },\n padding: {\n isValid: isStringOrNumber,\n ref: 'https://reactnative.dev/docs/layout-props#padding'\n },\n paddingBottom: {\n isValid: isStringOrNumber,\n ref: 'https://reactnative.dev/docs/layout-props#paddingbottom'\n },\n paddingEnd: {\n isValid: isStringOrNumber,\n ref: 'https://reactnative.dev/docs/layout-props#paddingend'\n },\n paddingHorizontal: {\n isValid: isStringOrNumber,\n ref: 'https://reactnative.dev/docs/layout-props#paddinghorizontal'\n },\n paddingLeft: {\n isValid: isStringOrNumber,\n ref: 'https://reactnative.dev/docs/layout-props#paddingleft'\n },\n paddingRight: {\n isValid: isStringOrNumber,\n ref: 'https://reactnative.dev/docs/layout-props#paddingright'\n },\n paddingStart: {\n isValid: isStringOrNumber,\n ref: 'https://reactnative.dev/docs/layout-props#paddingstart'\n },\n paddingTop: {\n isValid: isStringOrNumber,\n ref: 'https://reactnative.dev/docs/layout-props#paddingtop'\n },\n paddingVertical: {\n isValid: isStringOrNumber,\n ref: 'https://reactnative.dev/docs/layout-props#paddingvertical'\n },\n pointerEvents: {\n isValid: isIn('auto', 'box-none', 'box-only', 'none' ),\n ref: 'https://reactnative.dev/docs/view-style-props#pointerevents'\n },\n position: {\n isValid: isIn('absolute', 'relative', 'fixed'),\n ref: 'https://reactnative.dev/docs/layout-props#position'\n },\n resizeMode: {\n isValid: isIn('cover', 'contain', 'stretch', 'repeat', 'center'),\n ref: 'https://reactnative.dev/docs/image-style-props#resizemode'\n },\n right: {\n isValid: isStringOrNumber,\n ref: 'https://reactnative.dev/docs/layout-props#right'\n },\n rowGap: {\n isValid: isNumber,\n ref: 'https://reactnative.dev/docs/layout-props#rowgap'\n },\n shadowColor: {\n isValid: isColor,\n ref: 'https://reactnative.dev/docs/shadow-props#shadowcolor'\n },\n shadowOpacity: {\n isValid: isNumber,\n ref: 'https://reactnative.dev/docs/shadow-props#shadowopacity-ios'\n },\n shadowRadius: {\n isValid: isNumber,\n ref: 'https://reactnative.dev/docs/shadow-props#shadowradius-ios'\n },\n start: {\n isValid: isStringOrNumber,\n ref: 'https://reactnative.dev/docs/layout-props#start'\n },\n textAlign: {\n isValid: isIn('auto', 'left', 'right', 'center', 'justify'),\n ref: 'https://reactnative.dev/docs/text-style-props#textalign'\n },\n textAlignVertical: {\n isValid: isIn('auto', 'top', 'bottom', 'center'),\n ref: 'https://reactnative.dev/docs/text-style-props#textalignvertical-android'\n },\n textDecorationColor: {\n isValid: isColor,\n ref: 'https://reactnative.dev/docs/text-style-props#textdecorationcolor-ios'\n },\n textDecorationLine: {\n isValid: isIn('none', 'underline', 'line-through', 'underline line-through'),\n ref: 'https://reactnative.dev/docs/text-style-props#textdecorationline'\n },\n textDecorationStyle: {\n isValid: isIn('solid', 'double', 'dotted', 'dashed'),\n ref: 'https://reactnative.dev/docs/text-style-props#textdecorationstyle-ios'\n },\n textShadowColor: {\n isValid: isColor,\n ref: 'https://reactnative.dev/docs/text-style-props#textshadowcolor'\n },\n textShadowRadius: {\n isValid: isNumber,\n ref: 'https://reactnative.dev/docs/text-style-props#textshadowoffset'\n },\n textTransform: {\n isValid: isIn('none', 'uppercase', 'lowercase', 'capitalize'),\n ref: 'https://reactnative.dev/docs/text-style-props#texttransform'\n },\n tintColor: {\n isValid: isColor,\n ref: 'https://reactnative.dev/docs/image-style-props#tintcolor'\n },\n top: {\n isValid: isStringOrNumber,\n ref: 'https://reactnative.dev/docs/layout-props#top'\n },\n verticalAlign: {\n isValid: isIn('auto', 'top', 'bottom', 'middle'),\n ref: 'https://reactnative.dev/docs/text-style-props#verticalalign-android'\n },\n width: {\n isValid: isStringOrNumber,\n ref: 'https://reactnative.dev/docs/layout-props#width'\n },\n writingDirection: {\n isValid: isIn('auto', 'ltr', 'rtl'),\n ref: 'https://reactnative.dev/docs/text-style-props#writingdirection-ios'\n },\n zIndex: {\n isValid: isNumber,\n ref: 'https://reactnative.dev/docs/layout-props#zindex'\n },\n};\n\nexport const getStyleReference = (name: string) => {\n const info = (STYLE_PROP_TYPE_INFO as any)[name];\n return !info || info.ref;\n};\n\nexport const isValidStyleProp = (name: string, value: any) => {\n const info = (STYLE_PROP_TYPE_INFO as any)[name];\n return !info || info.isValid(value);\n};"],"mappings":"AAAA,SAAQA,QAAQ,EAASC,QAAQ,QAAQ,WAAW;AAEpD,MAAMC,OAAO,GAAIC,CAAS,IAAK,IAAI;AACnC,MAAMC,gBAAgB,G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Q;IACjBc,GAAG,EAAE;EACT;AACJ,CAAC;AAED,OAAO,MAAMuG,iBAAiB,GAAIC,IAAY,IAAK;EAC/C,MAAMC,IAAI,GAAI5G,oBAAoB,CAAS2G,IAAI,CAAC;EAChD,OAAO,CAACC,IAAI,IAAIA,IAAI,CAACzG,GAAG;AAC5B,CAAC;AAED,OAAO,MAAM0G,gBAAgB,GAAG,CAACF,IAAY,EAAEG,KAAU,KAAK;EAC1D,MAAMF,IAAI,GAAI5G,oBAAoB,CAAS2G,IAAI,CAAC;EAChD,OAAO,CAACC,IAAI,IAAIA,IAAI,CAAC1G,OAAO,CAAC4G,KAAK,CAAC;AACvC,CAAC"}
|
|
1
|
+
{"version":3,"names":["isNumber","isString","Font","isColor","c","isStringOrNumber","v","isIn","obj","arr","forEach","k","STYLE_PROP_TYPE_INFO","alignContent","isValid","ref","alignItems","alignSelf","aspectRatio","backfaceVisibility","backgroundColor","backgroundImage","borderBottomColor","borderBottomEndRadius","borderBottomLeftRadius","backgroundPosition","backgroundRepeat","backgroundSize","borderBottomRightRadius","borderBottomStartRadius","borderBottomWidth","borderColor","borderCurve","borderEndColor","borderEndWidth","borderLeftColor","borderLeftWidth","borderRadius","borderRightColor","borderRightWidth","borderStartColor","borderStartWidth","borderStyle","borderTopEndRadius","borderTopLeftRadius","borderTopRightRadius","borderTopStartRadius","borderTopColor","borderTopWidth","borderWidth","bottom","color","columnGap","direction","display","elevation","end","flex","flexBasis","flexDirection","flexGrow","flexShrink","flexWrap","fontFamily","isLoaded","errorMsg","fontSize","fontStyle","fontVariant","fontWeight","gap","height","justifyContent","left","letterSpacing","lineHeight","margin","marginBottom","marginEnd","marginHorizontal","marginLeft","marginRight","marginStart","marginTop","marginVertical","maxHeight","maxWidth","minHeight","minWidth","opacity","overflow","overlayColor","padding","paddingBottom","paddingEnd","paddingHorizontal","paddingLeft","paddingRight","paddingStart","paddingTop","paddingVertical","pointerEvents","position","resizeMode","right","rowGap","shadowColor","shadowOpacity","shadowRadius","start","textAlign","textAlignVertical","textDecorationColor","textDecorationLine","textDecorationStyle","textShadowColor","textShadowRadius","textTransform","tintColor","top","verticalAlign","width","writingDirection","zIndex","getStyleReference","name","info","isValidStyleProp","value","trim","startsWith","getErrorMessage","replace","g","toLowerCase"],"sources":["style-prop.validator.ts"],"sourcesContent":["import {isNumber, isNil, isString } from 'lodash-es';\nimport * as Font from 'expo-font';\n\nconst isColor = (c: string) => true;\nconst isStringOrNumber = (v: any) => isNumber(v) || isString(v);\nconst isIn = (...arr: any) => {\n const obj = {};\n arr.forEach((v: any) => {\n (obj as any)[v] = true;\n })\n return (k: any) => (obj as any)[k] === true ;\n};\n\nconst STYLE_PROP_TYPE_INFO = {\n alignContent: {\n isValid: isIn('flex-start', 'flex-end', 'center', 'stretch', 'space-between', 'space-around'),\n ref: 'https://reactnative.dev/docs/layout-props#aligncontent'\n },\n alignItems: {\n isValid: isIn('flex-start', 'flex-end', 'center', 'stretch', 'baseline'),\n ref: 'https://reactnative.dev/docs/layout-props#alignitems'\n },\n alignSelf: {\n isValid: isIn('auto', 'flex-start', 'flex-end', 'center', 'stretch', 'baseline'),\n ref: 'https://reactnative.dev/docs/layout-props#alignself'\n },\n aspectRatio: {\n isValid: isStringOrNumber,\n ref: 'https://reactnative.dev/docs/layout-props#aspectratio'\n },\n backfaceVisibility: {\n isValid: isIn('visible', 'hidden'),\n ref: 'https://reactnative.dev/docs/image-style-props#backfacevisibility'\n },\n backgroundColor: {\n isValid: isColor,\n ref: 'https://reactnative.dev/docs/image-style-props#backgroundcolor'\n },\n backgroundImage: {\n isValid: isString,\n ref: 'http://www.wavemakeronline.com/app-runtime/latest/rn/style-docs/widgets/view'\n },\n borderBottomColor: {\n isValid: isColor,\n ref: 'https://reactnative.dev/docs/view-style-props#borderbottomcolor'\n },\n borderBottomEndRadius: {\n isValid: isNumber,\n ref: 'https://reactnative.dev/docs/view-style-props#borderbottomendradius'\n },\n borderBottomLeftRadius: {\n isValid: isNumber,\n ref: 'https://reactnative.dev/docs/image-style-props#borderbottomleftradius'\n },\n backgroundPosition: {\n isValid: isStringOrNumber,\n ref: 'http://www.wavemakeronline.com/app-runtime/latest/rn/style-docs/widgets/view'\n },\n backgroundRepeat: {\n isValid: isIn('repeat', 'repeat-x', 'repeat-y', 'no-repeat'),\n ref: 'http://www.wavemakeronline.com/app-runtime/latest/rn/style-docs/widgets/view'\n },\n backgroundSize: {\n isValid: isStringOrNumber,\n ref: 'http://www.wavemakeronline.com/app-runtime/latest/rn/style-docs/widgets/view'\n },\n borderBottomRightRadius: {\n isValid: isNumber,\n ref: 'https://reactnative.dev/docs/image-style-props#borderbottomrightradius'\n },\n borderBottomStartRadius: {\n isValid: isNumber,\n ref: 'https://reactnative.dev/docs/view-style-props#borderbottomstartradius'\n },\n borderBottomWidth: {\n isValid: isNumber,\n ref: 'https://reactnative.dev/docs/layout-props#borderbottomwidth'\n },\n borderColor: {\n isValid: isColor,\n ref: 'https://reactnative.dev/docs/image-style-props#bordercolor'\n },\n borderCurve: {\n isValid: isIn('circular', 'continuous'),\n ref: 'https://reactnative.dev/docs/view-style-props#bordercurve-ios'\n },\n borderEndColor: {\n isValid: isColor,\n ref: 'https://reactnative.dev/docs/view-style-props#borderendcolor'\n },\n borderEndWidth: {\n isValid: isNumber,\n ref: 'https://reactnative.dev/docs/layout-props#borderendwidth'\n },\n borderLeftColor: {\n isValid: isColor,\n ref: 'https://reactnative.dev/docs/view-style-props#borderleftcolor'\n },\n borderLeftWidth: {\n isValid: isNumber,\n ref: 'https://reactnative.dev/docs/layout-props#borderleftwidth'\n },\n borderRadius: {\n isValid: isNumber,\n ref: 'https://reactnative.dev/docs/image-style-props#borderradius'\n },\n borderRightColor: {\n isValid: isColor,\n ref: 'https://reactnative.dev/docs/view-style-props#borderrightcolor'\n },\n borderRightWidth: {\n isValid: isNumber,\n ref: 'https://reactnative.dev/docs/layout-props#borderrightwidth'\n },\n borderStartColor: {\n isValid: isColor,\n ref: 'https://reactnative.dev/docs/view-style-props#borderstartcolor'\n },\n borderStartWidth: {\n isValid: isNumber,\n ref: 'https://reactnative.dev/docs/layout-props#borderstartwidth'\n },\n borderStyle: {\n isValid: isIn('solid', 'dotted', 'dashed'),\n ref: 'https://reactnative.dev/docs/view-style-props#borderstyle'\n },\n borderTopEndRadius: {\n isValid: isColor,\n ref: 'https://reactnative.dev/docs/view-style-props#bordertopendradius'\n },\n borderTopLeftRadius: {\n isValid: isNumber,\n ref: 'https://reactnative.dev/docs/image-style-props#bordertopleftradius'\n },\n borderTopRightRadius: {\n isValid: isNumber,\n ref: 'https://reactnative.dev/docs/image-style-props#bordertoprightradius'\n },\n borderTopStartRadius: {\n isValid: isNumber,\n ref: 'https://reactnative.dev/docs/view-style-props#bordertopstartradius'\n },\n borderTopColor: {\n isValid: isColor,\n ref: 'https://reactnative.dev/docs/layout-props#bordertopwidth'\n },\n borderTopWidth: {\n isValid: isNumber,\n ref: 'https://reactnative.dev/docs/layout-props#bordertopwidth'\n },\n borderWidth: {\n isValid: isNumber,\n ref: 'https://reactnative.dev/docs/image-style-props#borderwidth'\n },\n bottom: {\n isValid: isStringOrNumber,\n ref: 'https://reactnative.dev/docs/layout-props#bottom'\n },\n color: {\n isValid: isColor,\n ref: 'https://reactnative.dev/docs/text-style-props#color'\n },\n columnGap: {\n isValid: isNumber,\n ref: 'https://reactnative.dev/docs/layout-props#columngap'\n },\n direction: {\n isValid: isIn('inherit', 'LTR', 'RTL'),\n ref: 'https://reactnative.dev/docs/layout-props#direction'\n },\n display: {\n isValid: isIn('none', 'flex'),\n ref: 'https://reactnative.dev/docs/layout-props#display'\n },\n elevation: {\n isValid: isNumber,\n ref: 'https://reactnative.dev/docs/view-style-props#elevation-android'\n },\n end: {\n isValid: isStringOrNumber,\n ref: 'https://reactnative.dev/docs/layout-props#end'\n },\n flex: {\n isValid: isNumber,\n ref: 'https://reactnative.dev/docs/layout-props#flex'\n },\n flexBasis: {\n isValid: isStringOrNumber,\n ref: 'https://reactnative.dev/docs/layout-props#flexbasis'\n },\n flexDirection: {\n isValid: isIn('column', 'row', 'column-reverse', 'row-reverse'),\n ref: 'https://reactnative.dev/docs/layout-props#flexdirection'\n },\n flexGrow: {\n isValid: isNumber,\n ref: 'https://reactnative.dev/docs/layout-props#flexgrow'\n },\n flexShrink: {\n isValid: isNumber,\n ref: 'https://reactnative.dev/docs/layout-props#flexshrink'\n },\n flexWrap: {\n isValid: isIn('wrap', 'nowrap', 'wrap-reverse'),\n ref: 'https://reactnative.dev/docs/layout-props#flexwrap'\n },\n fontFamily: {\n isValid: (v: string) => Font.isLoaded(v),\n errorMsg: (v: string) => `Font '${v}' is not loaded. Font family names are case-sensitive. Please add font either in theme or app.`,\n ref: 'https://reactnative.dev/docs/text-style-props#fontfamily'\n },\n fontSize: {\n isValid: isNumber,\n ref: 'https://reactnative.dev/docs/text-style-props#fontsize'\n },\n fontStyle: {\n isValid: isIn('normal', 'italic'),\n ref: 'https://reactnative.dev/docs/text-style-props#fontstyle'\n },\n fontVariant: {\n isValid: (v: any) => isIn('small-caps', 'oldstyle-nums', 'lining-nums', 'tabular-nums', 'proportional-nums') || isString(v),\n ref: 'https://reactnative.dev/docs/text-style-props#fontvariant'\n },\n fontWeight: {\n isValid: (v: any) => isIn('normal', 'bold', '100', '200', '300', '400', '500', '600', '700', '800', '900') || isNumber(v),\n ref: 'https://reactnative.dev/docs/text-style-props#fontweight'\n },\n gap: {\n isValid: isNumber,\n ref: 'https://reactnative.dev/docs/layout-props#gap'\n },\n height: {\n isValid: isStringOrNumber,\n ref: 'https://reactnative.dev/docs/layout-props#height'\n },\n justifyContent: {\n isValid: isIn('flex-start', 'flex-end', 'center', 'space-between', 'space-around', 'space-evenly'),\n ref: 'https://reactnative.dev/docs/layout-props#justifycontent'\n },\n left: {\n isValid: isStringOrNumber,\n ref: 'https://reactnative.dev/docs/layout-props#left'\n },\n letterSpacing: {\n isValid: isNumber,\n ref: 'https://reactnative.dev/docs/text-style-props#letterspacing'\n },\n lineHeight: {\n isValid: isNumber,\n ref: 'https://reactnative.dev/docs/text-style-props#lineheight'\n },\n margin: {\n isValid: isStringOrNumber,\n ref: 'https://reactnative.dev/docs/layout-props#margin'\n },\n marginBottom: {\n isValid: isStringOrNumber,\n ref: 'https://reactnative.dev/docs/layout-props#marginbottom'\n },\n marginEnd: {\n isValid: isStringOrNumber,\n ref: 'https://reactnative.dev/docs/layout-props#marginend'\n },\n marginHorizontal: {\n isValid: isStringOrNumber,\n ref: 'https://reactnative.dev/docs/layout-props#marginhorizontal'\n },\n marginLeft: {\n isValid: isStringOrNumber,\n ref: 'https://reactnative.dev/docs/layout-props#marginleft'\n },\n marginRight: {\n isValid: isStringOrNumber,\n ref: 'https://reactnative.dev/docs/layout-props#marginright'\n },\n marginStart: {\n isValid: isStringOrNumber,\n ref: 'https://reactnative.dev/docs/layout-props#marginstart'\n },\n marginTop: {\n isValid: isStringOrNumber,\n ref: 'https://reactnative.dev/docs/layout-props#margintop'\n },\n marginVertical: {\n isValid: isStringOrNumber,\n ref: 'https://reactnative.dev/docs/layout-props#marginvertical'\n },\n maxHeight: {\n isValid: isStringOrNumber,\n ref: 'https://reactnative.dev/docs/layout-props#maxheight'\n },\n maxWidth: {\n isValid: isStringOrNumber,\n ref: 'https://reactnative.dev/docs/layout-props#maxwidth'\n },\n minHeight: {\n isValid: isStringOrNumber,\n ref: 'https://reactnative.dev/docs/layout-props#minheight'\n },\n minWidth: {\n isValid: isStringOrNumber,\n ref: 'https://reactnative.dev/docs/layout-props#minwidth'\n },\n opacity: {\n isValid: isNumber,\n ref: 'https://reactnative.dev/docs/image-style-props#opacity'\n },\n overflow: {\n isValid: isIn('visible', 'hidden', 'scroll'),\n ref: 'https://reactnative.dev/docs/image-style-props#overflow'\n },\n overlayColor: {\n isValid: isColor,\n ref: 'https://reactnative.dev/docs/image-style-props#overlaycolor-android'\n },\n padding: {\n isValid: isStringOrNumber,\n ref: 'https://reactnative.dev/docs/layout-props#padding'\n },\n paddingBottom: {\n isValid: isStringOrNumber,\n ref: 'https://reactnative.dev/docs/layout-props#paddingbottom'\n },\n paddingEnd: {\n isValid: isStringOrNumber,\n ref: 'https://reactnative.dev/docs/layout-props#paddingend'\n },\n paddingHorizontal: {\n isValid: isStringOrNumber,\n ref: 'https://reactnative.dev/docs/layout-props#paddinghorizontal'\n },\n paddingLeft: {\n isValid: isStringOrNumber,\n ref: 'https://reactnative.dev/docs/layout-props#paddingleft'\n },\n paddingRight: {\n isValid: isStringOrNumber,\n ref: 'https://reactnative.dev/docs/layout-props#paddingright'\n },\n paddingStart: {\n isValid: isStringOrNumber,\n ref: 'https://reactnative.dev/docs/layout-props#paddingstart'\n },\n paddingTop: {\n isValid: isStringOrNumber,\n ref: 'https://reactnative.dev/docs/layout-props#paddingtop'\n },\n paddingVertical: {\n isValid: isStringOrNumber,\n ref: 'https://reactnative.dev/docs/layout-props#paddingvertical'\n },\n pointerEvents: {\n isValid: isIn('auto', 'box-none', 'box-only', 'none' ),\n ref: 'https://reactnative.dev/docs/view-style-props#pointerevents'\n },\n position: {\n isValid: isIn('absolute', 'relative', 'fixed'),\n ref: 'https://reactnative.dev/docs/layout-props#position'\n },\n resizeMode: {\n isValid: isIn('cover', 'contain', 'stretch', 'repeat', 'center'),\n ref: 'https://reactnative.dev/docs/image-style-props#resizemode'\n },\n right: {\n isValid: isStringOrNumber,\n ref: 'https://reactnative.dev/docs/layout-props#right'\n },\n rowGap: {\n isValid: isNumber,\n ref: 'https://reactnative.dev/docs/layout-props#rowgap'\n },\n shadowColor: {\n isValid: isColor,\n ref: 'https://reactnative.dev/docs/shadow-props#shadowcolor'\n },\n shadowOpacity: {\n isValid: isNumber,\n ref: 'https://reactnative.dev/docs/shadow-props#shadowopacity-ios'\n },\n shadowRadius: {\n isValid: isNumber,\n ref: 'https://reactnative.dev/docs/shadow-props#shadowradius-ios'\n },\n start: {\n isValid: isStringOrNumber,\n ref: 'https://reactnative.dev/docs/layout-props#start'\n },\n textAlign: {\n isValid: isIn('auto', 'left', 'right', 'center', 'justify'),\n ref: 'https://reactnative.dev/docs/text-style-props#textalign'\n },\n textAlignVertical: {\n isValid: isIn('auto', 'top', 'bottom', 'center'),\n ref: 'https://reactnative.dev/docs/text-style-props#textalignvertical-android'\n },\n textDecorationColor: {\n isValid: isColor,\n ref: 'https://reactnative.dev/docs/text-style-props#textdecorationcolor-ios'\n },\n textDecorationLine: {\n isValid: isIn('none', 'underline', 'line-through', 'underline line-through'),\n ref: 'https://reactnative.dev/docs/text-style-props#textdecorationline'\n },\n textDecorationStyle: {\n isValid: isIn('solid', 'double', 'dotted', 'dashed'),\n ref: 'https://reactnative.dev/docs/text-style-props#textdecorationstyle-ios'\n },\n textShadowColor: {\n isValid: isColor,\n ref: 'https://reactnative.dev/docs/text-style-props#textshadowcolor'\n },\n textShadowRadius: {\n isValid: isNumber,\n ref: 'https://reactnative.dev/docs/text-style-props#textshadowoffset'\n },\n textTransform: {\n isValid: isIn('none', 'uppercase', 'lowercase', 'capitalize'),\n ref: 'https://reactnative.dev/docs/text-style-props#texttransform'\n },\n tintColor: {\n isValid: isColor,\n ref: 'https://reactnative.dev/docs/image-style-props#tintcolor'\n },\n top: {\n isValid: isStringOrNumber,\n ref: 'https://reactnative.dev/docs/layout-props#top'\n },\n verticalAlign: {\n isValid: isIn('auto', 'top', 'bottom', 'middle'),\n ref: 'https://reactnative.dev/docs/text-style-props#verticalalign-android'\n },\n width: {\n isValid: isStringOrNumber,\n ref: 'https://reactnative.dev/docs/layout-props#width'\n },\n writingDirection: {\n isValid: isIn('auto', 'ltr', 'rtl'),\n ref: 'https://reactnative.dev/docs/text-style-props#writingdirection-ios'\n },\n zIndex: {\n isValid: isNumber,\n ref: 'https://reactnative.dev/docs/layout-props#zindex'\n },\n};\n\nexport const getStyleReference = (name: string) => {\n const info = (STYLE_PROP_TYPE_INFO as any)[name];\n return !info || info.ref;\n};\n\nexport const isValidStyleProp = (name: string, value: any) => {\n const info = (STYLE_PROP_TYPE_INFO as any)[name];\n return name?.trim().startsWith('__') || (info && info.isValid(value));\n};\n\nexport const getErrorMessage = (name: string, value: any) => {\n const info = (STYLE_PROP_TYPE_INFO as any)[name];\n name = name.replace(/([A-Z])/g, (g) => `-${g[0].toLowerCase()}`);\n if (info) {\n if (info.errorMsg) {\n return info.errorMsg(value);\n } else {\n return `'${value}' is not a valid value to '${name}'.`;\n }\n }\n return `'${name}' is not a supported style property in one or all Native Platforms.`\n};"],"mappings":"AAAA,SAAQA,QAAQ,EAASC,QAAQ,QAAQ,WAAW;AACpD,OAAO,KAAKC,IAAI,MAAM,WAAW;AAEjC,MAAMC,OAAO,GAAIC,CAAS,IAAK,IAAI;AACnC,MAAMC,gBAAgB,GAAIC,CAAM,IAAKN,QAAQ,CAACM,CAAC,CAAC,IAAIL,QAAQ,CAACK,CAAC,CAAC;AAC/D,MAAMC,IAAI,GAAG,YAAiB;EAC1B,MAAMC,GAAG,GAAG,CAAC,CAAC;EAAC,kCADFC,GAAG;IAAHA,GAAG;EAAA;EAEhBA,GAAG,CAACC,OAAO,CAAEJ,CAAM,IAAK;IACnBE,GAAG,CAASF,CAAC,CAAC,GAAG,IAAI;EAC1B,CAAC,CAAC;EACF,OAAQK,CAAM,IAAMH,GAAG,CAASG,CAAC,CAAC,KAAK,IAAI;AAC/C,CAAC;AAED,MAAMC,oBAAoB,GAAG;EACzBC,YAAY,EAAE;IACVC,OAAO,EAAEP,IAAI,CAAC,YAAY,EAAE,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAE,eAAe,EAAE,cAAc,CAAC;IAC7FQ,GAAG,EAAE;EACT,CAAC;EACDC,UAAU,EAAE;IACRF,OAAO,EAAEP,IAAI,CAAC,YAAY,EAAE,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,CAAC;IACxEQ,GAAG,EAAE;EACT,CAAC;EACDE,SAAS,EAAE;IACPH,OAAO,EAAEP,IAAI,CAAC,MAAM,EAAE,YAAY,EAAE,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,CAAC;IA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AA,IAAI,aAAJA,IAAI,uBAAJA,IAAI,CAAEI,IAAI,EAAE,CAACC,UAAU,CAAC,IAAI,CAAC,KAAKJ,IAAI,IAAIA,IAAI,CAAChH,OAAO,CAACkH,KAAK,CAAE;AACzE,CAAC;AAED,OAAO,MAAMG,eAAe,GAAG,CAACN,IAAY,EAAEG,KAAU,KAAK;EACzD,MAAMF,IAAI,GAAIlH,oBAAoB,CAASiH,IAAI,CAAC;EAChDA,IAAI,GAAGA,IAAI,CAACO,OAAO,CAAC,UAAU,EAAGC,CAAC,IAAM,IAAGA,CAAC,CAAC,CAAC,CAAC,CAACC,WAAW,EAAG,EAAC,CAAC;EAChE,IAAIR,IAAI,EAAE;IACN,IAAIA,IAAI,CAAC7D,QAAQ,EAAE;MACf,OAAO6D,IAAI,CAAC7D,QAAQ,CAAC+D,KAAK,CAAC;IAC/B,CAAC,MAAM;MACH,OAAQ,IAAGA,KAAM,8BAA6BH,IAAK,IAAG;IAC1D;EACJ;EACA,OAAQ,IAAGA,IAAK,qEAAoE;AACxF,CAAC"}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
3
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
4
|
+
export class StyleProps {
|
|
5
|
+
constructor() {
|
|
6
|
+
_defineProperty(this, "backgroundimage", void 0);
|
|
7
|
+
_defineProperty(this, "backgroundsize", void 0);
|
|
8
|
+
_defineProperty(this, "backgroundrepeat", void 0);
|
|
9
|
+
_defineProperty(this, "backgroundresizemode", void 0);
|
|
10
|
+
_defineProperty(this, "backgroundposition", void 0);
|
|
11
|
+
_defineProperty(this, "backgroundcolor", void 0);
|
|
12
|
+
_defineProperty(this, "bordercolor", void 0);
|
|
13
|
+
_defineProperty(this, "borderradius", void 0);
|
|
14
|
+
_defineProperty(this, "borderstyle", void 0);
|
|
15
|
+
_defineProperty(this, "borderwidth", void 0);
|
|
16
|
+
_defineProperty(this, "borderbottomwidth", void 0);
|
|
17
|
+
_defineProperty(this, "borderleftwidth", void 0);
|
|
18
|
+
_defineProperty(this, "borderrightwidth", void 0);
|
|
19
|
+
_defineProperty(this, "bordertopwidth", void 0);
|
|
20
|
+
_defineProperty(this, "color", void 0);
|
|
21
|
+
_defineProperty(this, "display", void 0);
|
|
22
|
+
_defineProperty(this, "fontsize", void 0);
|
|
23
|
+
_defineProperty(this, "fontfamily", void 0);
|
|
24
|
+
_defineProperty(this, "fontstyle", void 0);
|
|
25
|
+
_defineProperty(this, "fontvariant", void 0);
|
|
26
|
+
_defineProperty(this, "fontweight", void 0);
|
|
27
|
+
_defineProperty(this, "height", void 0);
|
|
28
|
+
_defineProperty(this, "horizontalalign", void 0);
|
|
29
|
+
_defineProperty(this, "lineheight", void 0);
|
|
30
|
+
_defineProperty(this, "margin", void 0);
|
|
31
|
+
_defineProperty(this, "marginbottom", void 0);
|
|
32
|
+
_defineProperty(this, "marginleft", void 0);
|
|
33
|
+
_defineProperty(this, "marginright", void 0);
|
|
34
|
+
_defineProperty(this, "margintop", void 0);
|
|
35
|
+
_defineProperty(this, "opacity", void 0);
|
|
36
|
+
_defineProperty(this, "overflow", void 0);
|
|
37
|
+
_defineProperty(this, "padding", void 0);
|
|
38
|
+
_defineProperty(this, "paddingbottom", void 0);
|
|
39
|
+
_defineProperty(this, "paddingleft", void 0);
|
|
40
|
+
_defineProperty(this, "paddingright", void 0);
|
|
41
|
+
_defineProperty(this, "paddingtop", void 0);
|
|
42
|
+
_defineProperty(this, "textalign", void 0);
|
|
43
|
+
_defineProperty(this, "textdecoration", void 0);
|
|
44
|
+
_defineProperty(this, "verticalalign", void 0);
|
|
45
|
+
_defineProperty(this, "width", void 0);
|
|
46
|
+
_defineProperty(this, "zindex", void 0);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
const styleMapping = {
|
|
50
|
+
backgroundimage: 'backgroundImage',
|
|
51
|
+
backgroundsize: 'backgroundSize',
|
|
52
|
+
backgroundrepeat: 'backgroundRepeat',
|
|
53
|
+
backgroundresizemode: 'backgroundResizeMode',
|
|
54
|
+
backgroundposition: 'backgroundPosition',
|
|
55
|
+
backgroundcolor: 'backgroundColor',
|
|
56
|
+
bordercolor: 'borderColor',
|
|
57
|
+
borderradius: 'borderRadius',
|
|
58
|
+
borderstyle: 'borderStyle',
|
|
59
|
+
borderwidth: 'borderWidth',
|
|
60
|
+
borderbottomwidth: 'borderBottomWidth',
|
|
61
|
+
borderleftwidth: 'borderLeftWidth',
|
|
62
|
+
borderrightwidth: 'borderRightWidth',
|
|
63
|
+
bordertopwidth: 'borderTopWidth',
|
|
64
|
+
color: 'color',
|
|
65
|
+
display: 'display',
|
|
66
|
+
fontsize: 'fontSize',
|
|
67
|
+
fontfamily: 'fontFamily',
|
|
68
|
+
fontstyle: 'fontStyle',
|
|
69
|
+
fontvariant: 'fontVariant',
|
|
70
|
+
fontweight: 'fontWeight',
|
|
71
|
+
height: 'height',
|
|
72
|
+
//horizontalalign: any;
|
|
73
|
+
lineheight: 'lineHeight',
|
|
74
|
+
margin: 'margin',
|
|
75
|
+
marginbottom: 'marginBottom',
|
|
76
|
+
marginleft: 'marginLeft',
|
|
77
|
+
marginright: 'marginRight',
|
|
78
|
+
margintop: 'marginTop',
|
|
79
|
+
opacity: 'opacity',
|
|
80
|
+
overflow: 'overflow',
|
|
81
|
+
padding: 'padding',
|
|
82
|
+
paddingbottom: 'paddingBottom',
|
|
83
|
+
paddingleft: 'paddingLeft',
|
|
84
|
+
paddingright: 'paddingRight',
|
|
85
|
+
paddingtop: 'paddingTop',
|
|
86
|
+
textalign: 'textAlign',
|
|
87
|
+
textdecoration: 'textDecoration',
|
|
88
|
+
verticalalign: 'verticalAlign',
|
|
89
|
+
width: 'width',
|
|
90
|
+
zindex: 'zindex'
|
|
91
|
+
};
|
|
92
|
+
export const getStyleName = name => styleMapping[name];
|
|
93
|
+
//# sourceMappingURL=style-props.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["StyleProps","styleMapping","backgroundimage","backgroundsize","backgroundrepeat","backgroundresizemode","backgroundposition","backgroundcolor","bordercolor","borderradius","borderstyle","borderwidth","borderbottomwidth","borderleftwidth","borderrightwidth","bordertopwidth","color","display","fontsize","fontfamily","fontstyle","fontvariant","fontweight","height","lineheight","margin","marginbottom","marginleft","marginright","margintop","opacity","overflow","padding","paddingbottom","paddingleft","paddingright","paddingtop","textalign","textdecoration","verticalalign","width","zindex","getStyleName","name"],"sources":["style-props.ts"],"sourcesContent":["export class StyleProps {\n backgroundimage?: any;\n backgroundsize?: any;\n backgroundrepeat?: any;\n backgroundresizemode?: any;\n backgroundposition?: any;\n backgroundcolor?: any;\n bordercolor?: any;\n borderradius?: any;\n borderstyle?: any;\n borderwidth?: any;\n borderbottomwidth?: any;\n borderleftwidth?: any;\n borderrightwidth?: any;\n bordertopwidth?: any;\n color?: any;\n display?: any;\n fontsize?: any;\n fontfamily?: any;\n fontstyle?: any;\n fontvariant?: any;\n fontweight?: any;\n height?: any;\n horizontalalign?: any;\n lineheight?: any;\n margin?: any;\n marginbottom?: any;\n marginleft?: any;\n marginright?: any;\n margintop?: any;\n opacity?: any;\n overflow?: any;\n padding?: any;\n paddingbottom?: any;\n paddingleft?: any;\n paddingright?: any;\n paddingtop?: any;\n textalign?: any;\n textdecoration?: any;\n verticalalign?: any;\n width?: any;\n zindex?: any;\n}\n\nconst styleMapping = {\n backgroundimage: 'backgroundImage',\n backgroundsize: 'backgroundSize',\n backgroundrepeat: 'backgroundRepeat',\n backgroundresizemode: 'backgroundResizeMode',\n backgroundposition: 'backgroundPosition',\n backgroundcolor: 'backgroundColor',\n bordercolor: 'borderColor',\n borderradius: 'borderRadius',\n borderstyle: 'borderStyle',\n borderwidth: 'borderWidth',\n borderbottomwidth: 'borderBottomWidth',\n borderleftwidth: 'borderLeftWidth',\n borderrightwidth: 'borderRightWidth',\n bordertopwidth: 'borderTopWidth',\n color: 'color',\n display: 'display',\n fontsize: 'fontSize',\n fontfamily: 'fontFamily',\n fontstyle: 'fontStyle',\n fontvariant: 'fontVariant',\n fontweight: 'fontWeight',\n height: 'height',\n //horizontalalign: any;\n lineheight: 'lineHeight',\n margin: 'margin',\n marginbottom: 'marginBottom',\n marginleft: 'marginLeft',\n marginright: 'marginRight',\n margintop: 'marginTop',\n opacity: 'opacity',\n overflow: 'overflow',\n padding: 'padding',\n paddingbottom: 'paddingBottom',\n paddingleft: 'paddingLeft',\n paddingright: 'paddingRight',\n paddingtop: 'paddingTop',\n textalign: 'textAlign',\n textdecoration: 'textDecoration',\n verticalalign: 'verticalAlign',\n width: 'width',\n zindex: 'zindex'\n};\n\nexport const getStyleName = (name: string) => (styleMapping as any)[name];\n"],"mappings":";;;AAAA,OAAO,MAAMA,UAAU,CAAC;EAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;EAAA;AA0CxB;AAEA,MAAMC,YAAY,GAAG;EACjBC,eAAe,EAAE,iBAAiB;EAClCC,cAAc,EAAE,gBAAgB;EAChCC,gBAAgB,EAAE,kBAAkB;EACpCC,oBAAoB,EAAE,sBAAsB;EAC5CC,kBAAkB,EAAE,oBAAoB;EACxCC,eAAe,EAAE,iBAAiB;EAClCC,WAAW,EAAE,aAAa;EAC1BC,YAAY,EAAE,cAAc;EAC5BC,WAAW,EAAE,aAAa;EAC1BC,WAAW,EAAE,aAAa;EAC1BC,iBAAiB,EAAE,mBAAmB;EACtCC,eAAe,EAAE,iBAAiB;EAClCC,gBAAgB,EAAE,kBAAkB;EACpCC,cAAc,EAAE,gBAAgB;EAChCC,KAAK,EAAE,OAAO;EACdC,OAAO,EAAE,SAAS;EAClBC,QAAQ,EAAE,UAAU;EACpBC,UAAU,EAAE,YAAY;EACxBC,SAAS,EAAE,WAAW;EACtBC,WAAW,EAAE,aAAa;EAC1BC,UAAU,EAAE,YAAY;EACxBC,MAAM,EAAE,QAAQ;EAChB;EACAC,UAAU,EAAE,YAAY;EACxBC,MAAM,EAAE,QAAQ;EAChBC,YAAY,EAAE,cAAc;EAC5BC,UAAU,EAAE,YAAY;EACxBC,WAAW,EAAE,aAAa;EAC1BC,SAAS,EAAE,WAAW;EACtBC,OAAO,EAAE,SAAS;EAClBC,QAAQ,EAAE,UAAU;EACpBC,OAAO,EAAE,SAAS;EAClBC,aAAa,EAAE,eAAe;EAC9BC,WAAW,EAAE,aAAa;EAC1BC,YAAY,EAAE,cAAc;EAC5BC,UAAU,EAAE,YAAY;EACxBC,SAAS,EAAE,WAAW;EACtBC,cAAc,EAAE,gBAAgB;EAChCC,aAAa,EAAE,eAAe;EAC9BC,KAAK,EAAE,OAAO;EACdC,MAAM,EAAE;AACZ,CAAC;AAED,OAAO,MAAMC,YAAY,GAAIC,IAAY,IAAM1C,YAAY,CAAS0C,IAAI,CAAC"}
|
app-rn-runtime/styles/theme.js
CHANGED
|
@@ -3,13 +3,12 @@ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typ
|
|
|
3
3
|
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
4
4
|
import { cloneDeep, forEach, flatten, isArray, isEmpty, isObject, isString, get, reverse } from 'lodash';
|
|
5
5
|
import React from 'react';
|
|
6
|
-
import { ImageBackground } from 'react-native';
|
|
7
6
|
import { deepCopy, isWebPreviewMode } from '@wavemaker/app-rn-runtime/core/utils';
|
|
8
7
|
import EventNotifier from '@wavemaker/app-rn-runtime/core/event-notifier';
|
|
9
8
|
import ViewPort, { EVENTS as ViewPortEvents } from '@wavemaker/app-rn-runtime/core/viewport';
|
|
10
9
|
import MediaQueryList from './MediaQueryList';
|
|
11
10
|
import ThemeVariables from './theme.variables';
|
|
12
|
-
import { getStyleReference, isValidStyleProp } from './style-prop.validator';
|
|
11
|
+
import { getErrorMessage, getStyleReference, isValidStyleProp } from './style-prop.validator';
|
|
13
12
|
export const DEFAULT_CLASS = 'DEFAULT_CLASS';
|
|
14
13
|
if (typeof window !== "undefined") {
|
|
15
14
|
// @ts-ignore: does not properly extend MediaQueryList
|
|
@@ -64,15 +63,12 @@ export class Theme {
|
|
|
64
63
|
checkStyleProperties(name, value) {
|
|
65
64
|
if (isObject(value)) {
|
|
66
65
|
Object.keys(value).map(k => this.checkStyleProperties(k, value[k]));
|
|
67
|
-
} else if (!isValidStyleProp(name, value)) {
|
|
68
|
-
console.log(`%cInvalid Style property
|
|
66
|
+
} else if (name && !isValidStyleProp(name, value)) {
|
|
67
|
+
console.log(`%cInvalid Style property in ${this.name}: ${getErrorMessage(name, value)}`, 'background-color: #FF0000;font-weight: bold; color: #fff');
|
|
69
68
|
console.log(`Refer: ${getStyleReference(name)}`);
|
|
70
69
|
}
|
|
71
70
|
}
|
|
72
71
|
addStyle(name, extend, style) {
|
|
73
|
-
if (this !== Theme.BASE && isWebPreviewMode()) {
|
|
74
|
-
this.checkStyleProperties(name, style);
|
|
75
|
-
}
|
|
76
72
|
this.styles[name] = deepCopy(this.getStyle(extend), this.styles[name], style);
|
|
77
73
|
}
|
|
78
74
|
addTrace(styleName, mergedChildstyle, childStyle, parentStyle) {
|
|
@@ -147,6 +143,9 @@ export class Theme {
|
|
|
147
143
|
if (!mediaQuery || matchMedia(mediaQuery).matches) {
|
|
148
144
|
clonedStyle = cloneDeep(this.styles[name]);
|
|
149
145
|
}
|
|
146
|
+
if (this !== Theme.BASE && isWebPreviewMode()) {
|
|
147
|
+
this.checkStyleProperties('', clonedStyle);
|
|
148
|
+
}
|
|
150
149
|
style = deepCopy(parentStyle, clonedStyle);
|
|
151
150
|
this.addTrace(`@${this.name}:${name}`, style, clonedStyle, parentStyle);
|
|
152
151
|
}
|
|
@@ -187,36 +186,6 @@ ViewPort.subscribe(ViewPortEvents.SIZE_CHANGE, () => {
|
|
|
187
186
|
Theme.BASE.reset();
|
|
188
187
|
});
|
|
189
188
|
export default Theme.BASE;
|
|
190
|
-
export const attachBackground = (c, style) => {
|
|
191
|
-
const background = style._background;
|
|
192
|
-
if (background) {
|
|
193
|
-
const backgroundStyle = {
|
|
194
|
-
width: style.width || '100%',
|
|
195
|
-
height: style.height || '100%'
|
|
196
|
-
};
|
|
197
|
-
Object.keys(background).forEach(k => {
|
|
198
|
-
if (k !== 'imageStyle') {
|
|
199
|
-
backgroundStyle[k] = background[k];
|
|
200
|
-
}
|
|
201
|
-
});
|
|
202
|
-
const imgSrc = background.uri;
|
|
203
|
-
let source;
|
|
204
|
-
if (isString(imgSrc) && (imgSrc.startsWith('http') || imgSrc.startsWith('file:'))) {
|
|
205
|
-
source = {
|
|
206
|
-
uri: imgSrc
|
|
207
|
-
};
|
|
208
|
-
} else {
|
|
209
|
-
source = imgSrc;
|
|
210
|
-
}
|
|
211
|
-
return /*#__PURE__*/React.createElement(ImageBackground, {
|
|
212
|
-
source: source,
|
|
213
|
-
resizeMode: background.resizeMode || 'repeat',
|
|
214
|
-
imageStyle: background.imageStyle,
|
|
215
|
-
style: backgroundStyle
|
|
216
|
-
}, c);
|
|
217
|
-
}
|
|
218
|
-
return c;
|
|
219
|
-
};
|
|
220
189
|
const ThemeContext = /*#__PURE__*/React.createContext(null);
|
|
221
190
|
export const ThemeProvider = ThemeContext.Provider;
|
|
222
191
|
export const ThemeConsumer = ThemeContext.Consumer;
|