633009661e6dd03053ed8c9b182332ff.json
13 KB
{"ast":null,"code":"var _interopRequireDefault=require(\"@babel/runtime/helpers/interopRequireDefault\");Object.defineProperty(exports,\"__esModule\",{value:true});exports.default=void 0;var _I18nManager=_interopRequireDefault(require(\"../I18nManager\"));var _multiplyStyleLengthValue=_interopRequireDefault(require(\"../../modules/multiplyStyleLengthValue\"));var emptyObject={};var borderTopLeftRadius='borderTopLeftRadius';var borderTopRightRadius='borderTopRightRadius';var borderBottomLeftRadius='borderBottomLeftRadius';var borderBottomRightRadius='borderBottomRightRadius';var borderLeftColor='borderLeftColor';var borderLeftStyle='borderLeftStyle';var borderLeftWidth='borderLeftWidth';var borderRightColor='borderRightColor';var borderRightStyle='borderRightStyle';var borderRightWidth='borderRightWidth';var right='right';var marginLeft='marginLeft';var marginRight='marginRight';var paddingLeft='paddingLeft';var paddingRight='paddingRight';var left='left';var PROPERTIES_FLIP={borderTopLeftRadius:borderTopRightRadius,borderTopRightRadius:borderTopLeftRadius,borderBottomLeftRadius:borderBottomRightRadius,borderBottomRightRadius:borderBottomLeftRadius,borderLeftColor:borderRightColor,borderLeftStyle:borderRightStyle,borderLeftWidth:borderRightWidth,borderRightColor:borderLeftColor,borderRightStyle:borderLeftStyle,borderRightWidth:borderLeftWidth,left:right,marginLeft:marginRight,marginRight:marginLeft,paddingLeft:paddingRight,paddingRight:paddingLeft,right:left};var PROPERTIES_I18N={borderTopStartRadius:borderTopLeftRadius,borderTopEndRadius:borderTopRightRadius,borderBottomStartRadius:borderBottomLeftRadius,borderBottomEndRadius:borderBottomRightRadius,borderStartColor:borderLeftColor,borderStartStyle:borderLeftStyle,borderStartWidth:borderLeftWidth,borderEndColor:borderRightColor,borderEndStyle:borderRightStyle,borderEndWidth:borderRightWidth,end:right,marginStart:marginLeft,marginEnd:marginRight,paddingStart:paddingLeft,paddingEnd:paddingRight,start:left};var PROPERTIES_VALUE={clear:true,float:true,textAlign:true};var additiveInverse=function additiveInverse(value){return(0,_multiplyStyleLengthValue.default)(value,-1);};var i18nStyle=function i18nStyle(originalStyle){var doLeftAndRightSwapInRTL=_I18nManager.default.doLeftAndRightSwapInRTL,isRTL=_I18nManager.default.isRTL;var style=originalStyle||emptyObject;var frozenProps={};var nextStyle={};for(var originalProp in style){if(!Object.prototype.hasOwnProperty.call(style,originalProp)){continue;}var originalValue=style[originalProp];var prop=originalProp;var value=originalValue;if(PROPERTIES_I18N.hasOwnProperty(originalProp)){var convertedProp=PROPERTIES_I18N[originalProp];prop=isRTL?PROPERTIES_FLIP[convertedProp]:convertedProp;}else if(isRTL&&doLeftAndRightSwapInRTL&&PROPERTIES_FLIP[originalProp]){prop=PROPERTIES_FLIP[originalProp];}if(PROPERTIES_VALUE.hasOwnProperty(originalProp)){if(originalValue==='start'){value=isRTL?'right':'left';}else if(originalValue==='end'){value=isRTL?'left':'right';}else if(isRTL&&doLeftAndRightSwapInRTL){if(originalValue==='left'){value='right';}else if(originalValue==='right'){value='left';}}}if(prop==='transitionProperty'){if(PROPERTIES_I18N.hasOwnProperty(value)){var convertedValue=PROPERTIES_I18N[originalValue];value=isRTL?PROPERTIES_FLIP[convertedValue]:convertedValue;}else if(isRTL&&doLeftAndRightSwapInRTL&&PROPERTIES_FLIP[originalValue]){value=PROPERTIES_FLIP[originalValue];}}if(isRTL&&prop==='textShadowOffset'){nextStyle[prop]=value;nextStyle[prop].width=additiveInverse(value.width);}else if(!frozenProps[prop]){nextStyle[prop]=value;}if(PROPERTIES_I18N[originalProp]){frozenProps[prop]=true;}}return nextStyle;};var _default=i18nStyle;exports.default=_default;","map":{"version":3,"sources":["C:/Users/bluej/Desktop/2_2/searchGuide/searchGuide/node_modules/react-native-web/dist/exports/StyleSheet/i18nStyle.js"],"names":["emptyObject","borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius","borderLeftColor","borderLeftStyle","borderLeftWidth","borderRightColor","borderRightStyle","borderRightWidth","right","marginLeft","marginRight","paddingLeft","paddingRight","left","PROPERTIES_FLIP","PROPERTIES_I18N","borderTopStartRadius","borderTopEndRadius","borderBottomStartRadius","borderBottomEndRadius","borderStartColor","borderStartStyle","borderStartWidth","borderEndColor","borderEndStyle","borderEndWidth","end","marginStart","marginEnd","paddingStart","paddingEnd","start","PROPERTIES_VALUE","clear","float","textAlign","additiveInverse","value","i18nStyle","originalStyle","doLeftAndRightSwapInRTL","I18nManager","isRTL","style","frozenProps","nextStyle","originalProp","Object","prototype","hasOwnProperty","call","originalValue","prop","convertedProp","convertedValue","width"],"mappings":"mKAQA,mEACA,wGACA,GAAIA,CAAAA,WAAW,CAAG,EAAlB,CACA,GAAIC,CAAAA,mBAAmB,CAAG,qBAA1B,CACA,GAAIC,CAAAA,oBAAoB,CAAG,sBAA3B,CACA,GAAIC,CAAAA,sBAAsB,CAAG,wBAA7B,CACA,GAAIC,CAAAA,uBAAuB,CAAG,yBAA9B,CACA,GAAIC,CAAAA,eAAe,CAAG,iBAAtB,CACA,GAAIC,CAAAA,eAAe,CAAG,iBAAtB,CACA,GAAIC,CAAAA,eAAe,CAAG,iBAAtB,CACA,GAAIC,CAAAA,gBAAgB,CAAG,kBAAvB,CACA,GAAIC,CAAAA,gBAAgB,CAAG,kBAAvB,CACA,GAAIC,CAAAA,gBAAgB,CAAG,kBAAvB,CACA,GAAIC,CAAAA,KAAK,CAAG,OAAZ,CACA,GAAIC,CAAAA,UAAU,CAAG,YAAjB,CACA,GAAIC,CAAAA,WAAW,CAAG,aAAlB,CACA,GAAIC,CAAAA,WAAW,CAAG,aAAlB,CACA,GAAIC,CAAAA,YAAY,CAAG,cAAnB,CACA,GAAIC,CAAAA,IAAI,CAAG,MAAX,CAEA,GAAIC,CAAAA,eAAe,CAAG,CACpBhB,mBAAmB,CAAEC,oBADD,CAEpBA,oBAAoB,CAAED,mBAFF,CAGpBE,sBAAsB,CAAEC,uBAHJ,CAIpBA,uBAAuB,CAAED,sBAJL,CAKpBE,eAAe,CAAEG,gBALG,CAMpBF,eAAe,CAAEG,gBANG,C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ACpCd,KAAK,CAAG,MAAR,CACD,CACF,CACF,CAGD,GAAIe,IAAI,GAAK,oBAAb,CAAmC,CAEjC,GAAIrC,eAAe,CAACkC,cAAhB,CAA+BZ,KAA/B,CAAJ,CAA2C,CAEzC,GAAIiB,CAAAA,cAAc,CAAGvC,eAAe,CAACoC,aAAD,CAApC,CACAd,KAAK,CAAGK,KAAK,CAAG5B,eAAe,CAACwC,cAAD,CAAlB,CAAqCA,cAAlD,CACD,CAJD,IAIO,IAAIZ,KAAK,EAAIF,uBAAT,EAAoC1B,eAAe,CAACqC,aAAD,CAAvD,CAAwE,CAC7Ed,KAAK,CAAGvB,eAAe,CAACqC,aAAD,CAAvB,CACD,CACF,CAGD,GAAIT,KAAK,EAAIU,IAAI,GAAK,kBAAtB,CAA0C,CACxCP,SAAS,CAACO,IAAD,CAAT,CAAkBf,KAAlB,CACAQ,SAAS,CAACO,IAAD,CAAT,CAAgBG,KAAhB,CAAwBnB,eAAe,CAACC,KAAK,CAACkB,KAAP,CAAvC,CACD,CAHD,IAGO,IAAI,CAACX,WAAW,CAACQ,IAAD,CAAhB,CAAwB,CAC7BP,SAAS,CAACO,IAAD,CAAT,CAAkBf,KAAlB,CACD,CAED,GAAItB,eAAe,CAAC+B,YAAD,CAAnB,CAAmC,CACjCF,WAAW,CAACQ,IAAD,CAAX,CAAoB,IAApB,CACD,CACF,CAED,MAAOP,CAAAA,SAAP,CACD,CAjED,C,aAmEeP,S","sourcesContent":["/**\n * Copyright (c) Nicolas Gallagher.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\nimport I18nManager from '../I18nManager';\nimport multiplyStyleLengthValue from '../../modules/multiplyStyleLengthValue';\nvar emptyObject = {};\nvar borderTopLeftRadius = 'borderTopLeftRadius';\nvar borderTopRightRadius = 'borderTopRightRadius';\nvar borderBottomLeftRadius = 'borderBottomLeftRadius';\nvar borderBottomRightRadius = 'borderBottomRightRadius';\nvar borderLeftColor = 'borderLeftColor';\nvar borderLeftStyle = 'borderLeftStyle';\nvar borderLeftWidth = 'borderLeftWidth';\nvar borderRightColor = 'borderRightColor';\nvar borderRightStyle = 'borderRightStyle';\nvar borderRightWidth = 'borderRightWidth';\nvar right = 'right';\nvar marginLeft = 'marginLeft';\nvar marginRight = 'marginRight';\nvar paddingLeft = 'paddingLeft';\nvar paddingRight = 'paddingRight';\nvar left = 'left'; // Map of LTR property names to their BiDi equivalent.\n\nvar PROPERTIES_FLIP = {\n borderTopLeftRadius: borderTopRightRadius,\n borderTopRightRadius: borderTopLeftRadius,\n borderBottomLeftRadius: borderBottomRightRadius,\n borderBottomRightRadius: borderBottomLeftRadius,\n borderLeftColor: borderRightColor,\n borderLeftStyle: borderRightStyle,\n borderLeftWidth: borderRightWidth,\n borderRightColor: borderLeftColor,\n borderRightStyle: borderLeftStyle,\n borderRightWidth: borderLeftWidth,\n left: right,\n marginLeft: marginRight,\n marginRight: marginLeft,\n paddingLeft: paddingRight,\n paddingRight: paddingLeft,\n right: left\n}; // Map of I18N property names to their LTR equivalent.\n\nvar PROPERTIES_I18N = {\n borderTopStartRadius: borderTopLeftRadius,\n borderTopEndRadius: borderTopRightRadius,\n borderBottomStartRadius: borderBottomLeftRadius,\n borderBottomEndRadius: borderBottomRightRadius,\n borderStartColor: borderLeftColor,\n borderStartStyle: borderLeftStyle,\n borderStartWidth: borderLeftWidth,\n borderEndColor: borderRightColor,\n borderEndStyle: borderRightStyle,\n borderEndWidth: borderRightWidth,\n end: right,\n marginStart: marginLeft,\n marginEnd: marginRight,\n paddingStart: paddingLeft,\n paddingEnd: paddingRight,\n start: left\n};\nvar PROPERTIES_VALUE = {\n clear: true,\n float: true,\n textAlign: true\n}; // Invert the sign of a numeric-like value\n\nvar additiveInverse = function additiveInverse(value) {\n return multiplyStyleLengthValue(value, -1);\n};\n\nvar i18nStyle = function i18nStyle(originalStyle) {\n var doLeftAndRightSwapInRTL = I18nManager.doLeftAndRightSwapInRTL,\n isRTL = I18nManager.isRTL;\n var style = originalStyle || emptyObject;\n var frozenProps = {};\n var nextStyle = {};\n\n for (var originalProp in style) {\n if (!Object.prototype.hasOwnProperty.call(style, originalProp)) {\n continue;\n }\n\n var originalValue = style[originalProp];\n var prop = originalProp;\n var value = originalValue; // BiDi flip properties\n\n if (PROPERTIES_I18N.hasOwnProperty(originalProp)) {\n // convert start/end\n var convertedProp = PROPERTIES_I18N[originalProp];\n prop = isRTL ? PROPERTIES_FLIP[convertedProp] : convertedProp;\n } else if (isRTL && doLeftAndRightSwapInRTL && PROPERTIES_FLIP[originalProp]) {\n prop = PROPERTIES_FLIP[originalProp];\n } // BiDi flip values\n\n\n if (PROPERTIES_VALUE.hasOwnProperty(originalProp)) {\n if (originalValue === 'start') {\n value = isRTL ? 'right' : 'left';\n } else if (originalValue === 'end') {\n value = isRTL ? 'left' : 'right';\n } else if (isRTL && doLeftAndRightSwapInRTL) {\n if (originalValue === 'left') {\n value = 'right';\n } else if (originalValue === 'right') {\n value = 'left';\n }\n }\n } // BiDi flip transitionProperty value\n\n\n if (prop === 'transitionProperty') {\n // BiDi flip properties\n if (PROPERTIES_I18N.hasOwnProperty(value)) {\n // convert start/end\n var convertedValue = PROPERTIES_I18N[originalValue];\n value = isRTL ? PROPERTIES_FLIP[convertedValue] : convertedValue;\n } else if (isRTL && doLeftAndRightSwapInRTL && PROPERTIES_FLIP[originalValue]) {\n value = PROPERTIES_FLIP[originalValue];\n }\n } // Create finalized style\n\n\n if (isRTL && prop === 'textShadowOffset') {\n nextStyle[prop] = value;\n nextStyle[prop].width = additiveInverse(value.width);\n } else if (!frozenProps[prop]) {\n nextStyle[prop] = value;\n }\n\n if (PROPERTIES_I18N[originalProp]) {\n frozenProps[prop] = true;\n }\n }\n\n return nextStyle;\n};\n\nexport default i18nStyle;"]},"metadata":{},"sourceType":"script"}