docstring_tokens stringlengths 0 76.5k | code_tokens stringlengths 75 1.81M | label_window listlengths 4 2.12k | html_url stringlengths 74 116 | file_name stringlengths 3 311 |
|---|---|---|---|---|
shadow = computeShadowWithCSMPCSS64(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], depthSampler{X}, shadowSampler{X}, light{X}.shadowsInfo.y, light{X}.shadowsInfo.z, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w, lightSizeUVCorrection{X}[index{X}], depthCorrection{X}[index{X}], penumbraDarkness{X});
| <mask> nextShadow = computeShadowWithCSMPCSS16(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], depthSampler{X}, shadowSampler{X}, light{X}.shadowsInfo.y, light{X}.shadowsInfo.z, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w);
<mask> #elif defined(SHADOWMEDIUMQUALITY{X})
<mask> nextShadow = computeShadowWithCSMPCSS32(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], depthSampler{X}, shadowSampler{X}, light{X}.shadowsInfo.y, light{X}.shadowsInfo.z, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w);
<mask> #else
<mask> nextShadow = computeShadowWithCSMPCSS64(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], depthSampler{X}, shadowSampler{X}, light{X}.shadowsInfo.y, light{X}.shadowsInfo.z, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w);
<mask> #endif
<mask> #else
<mask> nextShadow = computeShadowCSM(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], shadowSampler{X}, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w);
<mask> #endif
<mask>
</s> More updates (notably PCSS support)
Former-commit-id: e1168673d1df8fc788645b9ad5674f10b466a479 </s> remove nextShadow = computeShadowWithCSMPCSS32(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], depthSampler{X}, shadowSampler{X}, light{X}.shadowsInfo.y, light{X}.shadowsInfo.z, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w);
</s> add shadow = computeShadowWithCSMPCSS32(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], depthSampler{X}, shadowSampler{X}, light{X}.shadowsInfo.y, light{X}.shadowsInfo.z, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w, lightSizeUVCorrection{X}[index{X}], depthCorrection{X}[index{X}], penumbraDarkness{X});
</s> remove nextShadow = computeShadowWithCSMPCSS16(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], depthSampler{X}, shadowSampler{X}, light{X}.shadowsInfo.y, light{X}.shadowsInfo.z, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w);
</s> add shadow = computeShadowWithCSMPCSS16(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], depthSampler{X}, shadowSampler{X}, light{X}.shadowsInfo.y, light{X}.shadowsInfo.z, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w, lightSizeUVCorrection{X}[index{X}], depthCorrection{X}[index{X}], penumbraDarkness{X});
</s> remove nextShadow = computeShadowWithCSMPCF5(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], shadowSampler{X}, light{X}.shadowsInfo.yz, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w);
</s> add shadow = computeShadowWithCSMPCF5(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], shadowSampler{X}, light{X}.shadowsInfo.yz, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w);
</s> remove #if defined(SHADOWPCF{X})
#if defined(SHADOWLOWQUALITY{X})
shadow = computeShadowWithCSMPCF1(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], shadowSampler{X}, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w);
#elif defined(SHADOWMEDIUMQUALITY{X})
shadow = computeShadowWithCSMPCF3(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], shadowSampler{X}, light{X}.shadowsInfo.yz, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w);
#else
shadow = computeShadowWithCSMPCF5(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], shadowSampler{X}, light{X}.shadowsInfo.yz, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w);
#endif
#elif defined(SHADOWPCSS{X})
#if defined(SHADOWLOWQUALITY{X})
shadow = computeShadowWithCSMPCSS16(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], depthSampler{X}, shadowSampler{X}, light{X}.shadowsInfo.y, light{X}.shadowsInfo.z, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w);
#elif defined(SHADOWMEDIUMQUALITY{X})
shadow = computeShadowWithCSMPCSS32(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], depthSampler{X}, shadowSampler{X}, light{X}.shadowsInfo.y, light{X}.shadowsInfo.z, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w);
#else
shadow = computeShadowWithCSMPCSS64(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], depthSampler{X}, shadowSampler{X}, light{X}.shadowsInfo.y, light{X}.shadowsInfo.z, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w);
#endif
#else
shadow = computeShadowCSM(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], shadowSampler{X}, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w);
#endif
#ifdef SHADOWCSMDEBUG{X}
shadowDebug{X} = vec3(shadow) * vCascadeColorsMultiplier{X}[index{X}];
#endif
float diffRatio{X} = clamp(diff{X} / frustrumLength{X}, 0., 1.) * splitBlendFactor{X};
if (index{X} < (SHADOWCSMNUM_CASCADES{X} - 1) && diffRatio{X} < 1.)
{
index{X} += 1;
float nextShadow = 0.;
</s> add if (index{X} >= 0) {
</s> remove nextShadow = computeShadowCSM(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], shadowSampler{X}, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w);
</s> add shadow = computeShadowCSM(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], shadowSampler{X}, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w);
| [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/BabylonJS/Babylon.js/commit/fe07b3491c0c7572d0b6df03541de8bc026cf59c | src/Shaders/ShadersInclude/lightFragment.fx |
shadow = computeShadowCSM(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], shadowSampler{X}, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w);
| <mask> #else
<mask> nextShadow = computeShadowWithCSMPCSS64(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], depthSampler{X}, shadowSampler{X}, light{X}.shadowsInfo.y, light{X}.shadowsInfo.z, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w);
<mask> #endif
<mask> #else
<mask> nextShadow = computeShadowCSM(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], shadowSampler{X}, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w);
<mask> #endif
<mask>
<mask> shadow = mix(nextShadow, shadow, diffRatio{X});
<mask> #ifdef SHADOWCSMDEBUG{X}
<mask> shadowDebug{X} = mix(vec3(nextShadow) * vCascadeColorsMultiplier{X}[index{X}], shadowDebug{X}, diffRatio{X});
</s> More updates (notably PCSS support)
Former-commit-id: e1168673d1df8fc788645b9ad5674f10b466a479 </s> remove shadow = mix(nextShadow, shadow, diffRatio{X});
</s> add </s> remove nextShadow = computeShadowWithCSMPCSS64(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], depthSampler{X}, shadowSampler{X}, light{X}.shadowsInfo.y, light{X}.shadowsInfo.z, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w);
</s> add shadow = computeShadowWithCSMPCSS64(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], depthSampler{X}, shadowSampler{X}, light{X}.shadowsInfo.y, light{X}.shadowsInfo.z, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w, lightSizeUVCorrection{X}[index{X}], depthCorrection{X}[index{X}], penumbraDarkness{X});
</s> remove nextShadow = computeShadowWithCSMPCSS32(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], depthSampler{X}, shadowSampler{X}, light{X}.shadowsInfo.y, light{X}.shadowsInfo.z, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w);
</s> add shadow = computeShadowWithCSMPCSS32(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], depthSampler{X}, shadowSampler{X}, light{X}.shadowsInfo.y, light{X}.shadowsInfo.z, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w, lightSizeUVCorrection{X}[index{X}], depthCorrection{X}[index{X}], penumbraDarkness{X});
</s> remove #if defined(SHADOWPCF{X})
#if defined(SHADOWLOWQUALITY{X})
shadow = computeShadowWithCSMPCF1(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], shadowSampler{X}, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w);
#elif defined(SHADOWMEDIUMQUALITY{X})
shadow = computeShadowWithCSMPCF3(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], shadowSampler{X}, light{X}.shadowsInfo.yz, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w);
#else
shadow = computeShadowWithCSMPCF5(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], shadowSampler{X}, light{X}.shadowsInfo.yz, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w);
#endif
#elif defined(SHADOWPCSS{X})
#if defined(SHADOWLOWQUALITY{X})
shadow = computeShadowWithCSMPCSS16(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], depthSampler{X}, shadowSampler{X}, light{X}.shadowsInfo.y, light{X}.shadowsInfo.z, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w);
#elif defined(SHADOWMEDIUMQUALITY{X})
shadow = computeShadowWithCSMPCSS32(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], depthSampler{X}, shadowSampler{X}, light{X}.shadowsInfo.y, light{X}.shadowsInfo.z, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w);
#else
shadow = computeShadowWithCSMPCSS64(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], depthSampler{X}, shadowSampler{X}, light{X}.shadowsInfo.y, light{X}.shadowsInfo.z, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w);
#endif
#else
shadow = computeShadowCSM(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], shadowSampler{X}, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w);
#endif
#ifdef SHADOWCSMDEBUG{X}
shadowDebug{X} = vec3(shadow) * vCascadeColorsMultiplier{X}[index{X}];
#endif
float diffRatio{X} = clamp(diff{X} / frustrumLength{X}, 0., 1.) * splitBlendFactor{X};
if (index{X} < (SHADOWCSMNUM_CASCADES{X} - 1) && diffRatio{X} < 1.)
{
index{X} += 1;
float nextShadow = 0.;
</s> add if (index{X} >= 0) {
</s> remove nextShadow = computeShadowWithCSMPCSS16(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], depthSampler{X}, shadowSampler{X}, light{X}.shadowsInfo.y, light{X}.shadowsInfo.z, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w);
</s> add shadow = computeShadowWithCSMPCSS16(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], depthSampler{X}, shadowSampler{X}, light{X}.shadowsInfo.y, light{X}.shadowsInfo.z, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w, lightSizeUVCorrection{X}[index{X}], depthCorrection{X}[index{X}], penumbraDarkness{X});
| [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/BabylonJS/Babylon.js/commit/fe07b3491c0c7572d0b6df03541de8bc026cf59c | src/Shaders/ShadersInclude/lightFragment.fx |
<mask> #else
<mask> nextShadow = computeShadowCSM(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], shadowSampler{X}, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w);
<mask> #endif
<mask>
<mask> shadow = mix(nextShadow, shadow, diffRatio{X});
<mask> #ifdef SHADOWCSMDEBUG{X}
<mask> shadowDebug{X} = mix(vec3(nextShadow) * vCascadeColorsMultiplier{X}[index{X}], shadowDebug{X}, diffRatio{X});
<mask> #endif
<mask> }
<mask> #elif SHADOWCLOSEESM{X}
</s> More updates (notably PCSS support)
Former-commit-id: e1168673d1df8fc788645b9ad5674f10b466a479 </s> remove nextShadow = computeShadowCSM(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], shadowSampler{X}, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w);
</s> add shadow = computeShadowCSM(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], shadowSampler{X}, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w);
</s> remove shadowDebug{X} = mix(vec3(nextShadow) * vCascadeColorsMultiplier{X}[index{X}], shadowDebug{X}, diffRatio{X});
</s> add shadowDebug{X} = vec3(shadow) * vCascadeColorsMultiplier{X}[index{X}];
</s> remove #if defined(SHADOWPCF{X})
#if defined(SHADOWLOWQUALITY{X})
shadow = computeShadowWithCSMPCF1(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], shadowSampler{X}, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w);
#elif defined(SHADOWMEDIUMQUALITY{X})
shadow = computeShadowWithCSMPCF3(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], shadowSampler{X}, light{X}.shadowsInfo.yz, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w);
#else
shadow = computeShadowWithCSMPCF5(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], shadowSampler{X}, light{X}.shadowsInfo.yz, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w);
#endif
#elif defined(SHADOWPCSS{X})
#if defined(SHADOWLOWQUALITY{X})
shadow = computeShadowWithCSMPCSS16(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], depthSampler{X}, shadowSampler{X}, light{X}.shadowsInfo.y, light{X}.shadowsInfo.z, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w);
#elif defined(SHADOWMEDIUMQUALITY{X})
shadow = computeShadowWithCSMPCSS32(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], depthSampler{X}, shadowSampler{X}, light{X}.shadowsInfo.y, light{X}.shadowsInfo.z, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w);
#else
shadow = computeShadowWithCSMPCSS64(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], depthSampler{X}, shadowSampler{X}, light{X}.shadowsInfo.y, light{X}.shadowsInfo.z, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w);
#endif
#else
shadow = computeShadowCSM(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], shadowSampler{X}, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w);
#endif
#ifdef SHADOWCSMDEBUG{X}
shadowDebug{X} = vec3(shadow) * vCascadeColorsMultiplier{X}[index{X}];
#endif
float diffRatio{X} = clamp(diff{X} / frustrumLength{X}, 0., 1.) * splitBlendFactor{X};
if (index{X} < (SHADOWCSMNUM_CASCADES{X} - 1) && diffRatio{X} < 1.)
{
index{X} += 1;
float nextShadow = 0.;
</s> add if (index{X} >= 0) {
</s> remove nextShadow = computeShadowWithCSMPCSS64(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], depthSampler{X}, shadowSampler{X}, light{X}.shadowsInfo.y, light{X}.shadowsInfo.z, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w);
</s> add shadow = computeShadowWithCSMPCSS64(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], depthSampler{X}, shadowSampler{X}, light{X}.shadowsInfo.y, light{X}.shadowsInfo.z, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w, lightSizeUVCorrection{X}[index{X}], depthCorrection{X}[index{X}], penumbraDarkness{X});
</s> remove nextShadow = computeShadowWithCSMPCSS32(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], depthSampler{X}, shadowSampler{X}, light{X}.shadowsInfo.y, light{X}.shadowsInfo.z, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w);
</s> add shadow = computeShadowWithCSMPCSS32(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], depthSampler{X}, shadowSampler{X}, light{X}.shadowsInfo.y, light{X}.shadowsInfo.z, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w, lightSizeUVCorrection{X}[index{X}], depthCorrection{X}[index{X}], penumbraDarkness{X});
| [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/BabylonJS/Babylon.js/commit/fe07b3491c0c7572d0b6df03541de8bc026cf59c | src/Shaders/ShadersInclude/lightFragment.fx | |
shadowDebug{X} = vec3(shadow) * vCascadeColorsMultiplier{X}[index{X}];
| <mask> #endif
<mask>
<mask> shadow = mix(nextShadow, shadow, diffRatio{X});
<mask> #ifdef SHADOWCSMDEBUG{X}
<mask> shadowDebug{X} = mix(vec3(nextShadow) * vCascadeColorsMultiplier{X}[index{X}], shadowDebug{X}, diffRatio{X});
<mask> #endif
<mask> }
<mask> #elif SHADOWCLOSEESM{X}
<mask> #if defined(SHADOWCUBE{X})
<mask> shadow = computeShadowWithCloseESMCube(light{X}.vLightData.xyz, shadowSampler{X}, light{X}.shadowsInfo.x, light{X}.shadowsInfo.z, light{X}.depthValues);
</s> More updates (notably PCSS support)
Former-commit-id: e1168673d1df8fc788645b9ad5674f10b466a479 </s> remove shadow = mix(nextShadow, shadow, diffRatio{X});
</s> add </s> remove nextShadow = computeShadowCSM(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], shadowSampler{X}, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w);
</s> add shadow = computeShadowCSM(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], shadowSampler{X}, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w);
</s> remove #if defined(SHADOWPCF{X})
#if defined(SHADOWLOWQUALITY{X})
shadow = computeShadowWithCSMPCF1(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], shadowSampler{X}, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w);
#elif defined(SHADOWMEDIUMQUALITY{X})
shadow = computeShadowWithCSMPCF3(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], shadowSampler{X}, light{X}.shadowsInfo.yz, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w);
#else
shadow = computeShadowWithCSMPCF5(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], shadowSampler{X}, light{X}.shadowsInfo.yz, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w);
#endif
#elif defined(SHADOWPCSS{X})
#if defined(SHADOWLOWQUALITY{X})
shadow = computeShadowWithCSMPCSS16(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], depthSampler{X}, shadowSampler{X}, light{X}.shadowsInfo.y, light{X}.shadowsInfo.z, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w);
#elif defined(SHADOWMEDIUMQUALITY{X})
shadow = computeShadowWithCSMPCSS32(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], depthSampler{X}, shadowSampler{X}, light{X}.shadowsInfo.y, light{X}.shadowsInfo.z, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w);
#else
shadow = computeShadowWithCSMPCSS64(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], depthSampler{X}, shadowSampler{X}, light{X}.shadowsInfo.y, light{X}.shadowsInfo.z, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w);
#endif
#else
shadow = computeShadowCSM(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], shadowSampler{X}, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w);
#endif
#ifdef SHADOWCSMDEBUG{X}
shadowDebug{X} = vec3(shadow) * vCascadeColorsMultiplier{X}[index{X}];
#endif
float diffRatio{X} = clamp(diff{X} / frustrumLength{X}, 0., 1.) * splitBlendFactor{X};
if (index{X} < (SHADOWCSMNUM_CASCADES{X} - 1) && diffRatio{X} < 1.)
{
index{X} += 1;
float nextShadow = 0.;
</s> add if (index{X} >= 0) {
</s> remove nextShadow = computeShadowWithCSMPCSS16(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], depthSampler{X}, shadowSampler{X}, light{X}.shadowsInfo.y, light{X}.shadowsInfo.z, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w);
</s> add shadow = computeShadowWithCSMPCSS16(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], depthSampler{X}, shadowSampler{X}, light{X}.shadowsInfo.y, light{X}.shadowsInfo.z, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w, lightSizeUVCorrection{X}[index{X}], depthCorrection{X}[index{X}], penumbraDarkness{X});
</s> remove nextShadow = computeShadowWithCSMPCSS32(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], depthSampler{X}, shadowSampler{X}, light{X}.shadowsInfo.y, light{X}.shadowsInfo.z, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w);
</s> add shadow = computeShadowWithCSMPCSS32(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], depthSampler{X}, shadowSampler{X}, light{X}.shadowsInfo.y, light{X}.shadowsInfo.z, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w, lightSizeUVCorrection{X}[index{X}], depthCorrection{X}[index{X}], penumbraDarkness{X});
| [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/BabylonJS/Babylon.js/commit/fe07b3491c0c7572d0b6df03541de8bc026cf59c | src/Shaders/ShadersInclude/lightFragment.fx |
uniform float cascadeBlendFactor{X};
| <mask> #ifdef SHADOWCSM{X}
<mask> uniform mat4 lightMatrix{X}[SHADOWCSMNUM_CASCADES{X}];
<mask> uniform mat4 camViewMatCSM{X};
<mask> uniform float viewFrustumZ{X}[SHADOWCSMNUM_CASCADES{X}];
<mask> uniform float splitBlendFactor{X};
<mask>
<mask> varying vec4 vPositionFromLight{X}[SHADOWCSMNUM_CASCADES{X}];
<mask> varying float vDepthMetric{X}[SHADOWCSMNUM_CASCADES{X}];
<mask> varying vec4 vPositionFromCamera{X};
<mask>
</s> More updates (notably PCSS support)
Former-commit-id: e1168673d1df8fc788645b9ad5674f10b466a479 </s> remove uniform float splitBlendFactor{X};
</s> add uniform float cascadeBlendFactor{X};
</s> remove float computeShadowWithCSMPCSS(float layer, vec4 vPositionFromLight, float depthMetric, highp sampler2DArray depthSampler, highp sampler2DArrayShadow shadowSampler, float shadowMapSizeInverse, float lightSizeUV, float darkness, float frustumEdgeFalloff, int searchTapCount, int pcfTapCount, vec3[64] poissonSamplers)
</s> add float computeShadowWithCSMPCSS(float layer, vec4 vPositionFromLight, float depthMetric, highp sampler2DArray depthSampler, highp sampler2DArrayShadow shadowSampler, float shadowMapSizeInverse, float lightSizeUV, float darkness, float frustumEdgeFalloff, int searchTapCount, int pcfTapCount, vec3[64] poissonSamplers, vec2 lightSizeUVCorrection, float depthCorrection, float penumbraDarkness)
</s> remove float penumbraRatio = ((depthMetric - avgBlockerDepth) + AAOffset);
float filterRadius = penumbraRatio * lightSizeUV * shadowMapSizeInverse;
</s> add float penumbraRatio = ((depthMetric - avgBlockerDepth) * depthCorrection + AAOffset);
vec4 filterRadius = vec4(penumbraRatio * lightSizeUV * lightSizeUVCorrection * shadowMapSizeInverse, 0., 0.);
| [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/BabylonJS/Babylon.js/commit/fe07b3491c0c7572d0b6df03541de8bc026cf59c | src/Shaders/ShadersInclude/lightFragmentDeclaration.fx |
uniform vec2 lightSizeUVCorrection{X}[SHADOWCSMNUM_CASCADES{X}];
uniform float depthCorrection{X}[SHADOWCSMNUM_CASCADES{X}];
uniform float penumbraDarkness{X};
| <mask> #if defined(SHADOWPCSS{X})
<mask> uniform highp sampler2DArrayShadow shadowSampler{X};
<mask> uniform highp sampler2DArray depthSampler{X};
<mask> #elif defined(SHADOWPCF{X})
<mask> uniform highp sampler2DArrayShadow shadowSampler{X};
<mask> #else
<mask> uniform highp sampler2DArray shadowSampler{X};
</s> More updates (notably PCSS support)
Former-commit-id: e1168673d1df8fc788645b9ad5674f10b466a479 </s> remove float computeShadowWithCSMPCSS(float layer, vec4 vPositionFromLight, float depthMetric, highp sampler2DArray depthSampler, highp sampler2DArrayShadow shadowSampler, float shadowMapSizeInverse, float lightSizeUV, float darkness, float frustumEdgeFalloff, int searchTapCount, int pcfTapCount, vec3[64] poissonSamplers)
</s> add float computeShadowWithCSMPCSS(float layer, vec4 vPositionFromLight, float depthMetric, highp sampler2DArray depthSampler, highp sampler2DArrayShadow shadowSampler, float shadowMapSizeInverse, float lightSizeUV, float darkness, float frustumEdgeFalloff, int searchTapCount, int pcfTapCount, vec3[64] poissonSamplers, vec2 lightSizeUVCorrection, float depthCorrection, float penumbraDarkness)
</s> remove uniform float splitBlendFactor{X};
</s> add uniform float cascadeBlendFactor{X};
</s> remove uniform float splitBlendFactor{X};
</s> add uniform float cascadeBlendFactor{X};
</s> remove nextShadow = computeShadowWithCSMPCF3(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], shadowSampler{X}, light{X}.shadowsInfo.yz, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w);
</s> add shadow = computeShadowWithCSMPCF3(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], shadowSampler{X}, light{X}.shadowsInfo.yz, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w);
| [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/BabylonJS/Babylon.js/commit/fe07b3491c0c7572d0b6df03541de8bc026cf59c | src/Shaders/ShadersInclude/lightFragmentDeclaration.fx |
uniform float cascadeBlendFactor{X};
| <mask> #ifdef SHADOW{X}
<mask> #ifdef SHADOWCSM{X}
<mask> uniform mat4 lightMatrix{X}[SHADOWCSMNUM_CASCADES{X}];
<mask> uniform float viewFrustumZ{X}[SHADOWCSMNUM_CASCADES{X}];
<mask> uniform float splitBlendFactor{X};
<mask>
<mask> varying vec4 vPositionFromLight{X}[SHADOWCSMNUM_CASCADES{X}];
<mask> varying float vDepthMetric{X}[SHADOWCSMNUM_CASCADES{X}];
<mask> varying vec4 vPositionFromCamera{X};
<mask>
</s> More updates (notably PCSS support)
Former-commit-id: e1168673d1df8fc788645b9ad5674f10b466a479 </s> remove uniform float splitBlendFactor{X};
</s> add uniform float cascadeBlendFactor{X};
</s> remove float computeShadowWithCSMPCSS(float layer, vec4 vPositionFromLight, float depthMetric, highp sampler2DArray depthSampler, highp sampler2DArrayShadow shadowSampler, float shadowMapSizeInverse, float lightSizeUV, float darkness, float frustumEdgeFalloff, int searchTapCount, int pcfTapCount, vec3[64] poissonSamplers)
</s> add float computeShadowWithCSMPCSS(float layer, vec4 vPositionFromLight, float depthMetric, highp sampler2DArray depthSampler, highp sampler2DArrayShadow shadowSampler, float shadowMapSizeInverse, float lightSizeUV, float darkness, float frustumEdgeFalloff, int searchTapCount, int pcfTapCount, vec3[64] poissonSamplers, vec2 lightSizeUVCorrection, float depthCorrection, float penumbraDarkness)
</s> remove float penumbraRatio = ((depthMetric - avgBlockerDepth) + AAOffset);
float filterRadius = penumbraRatio * lightSizeUV * shadowMapSizeInverse;
</s> add float penumbraRatio = ((depthMetric - avgBlockerDepth) * depthCorrection + AAOffset);
vec4 filterRadius = vec4(penumbraRatio * lightSizeUV * lightSizeUVCorrection * shadowMapSizeInverse, 0., 0.);
| [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/BabylonJS/Babylon.js/commit/fe07b3491c0c7572d0b6df03541de8bc026cf59c | src/Shaders/ShadersInclude/lightUboDeclaration.fx |
uniform vec2 lightSizeUVCorrection{X}[SHADOWCSMNUM_CASCADES{X}];
uniform float depthCorrection{X}[SHADOWCSMNUM_CASCADES{X}];
uniform float penumbraDarkness{X};
| <mask> #if defined(SHADOWPCSS{X})
<mask> uniform highp sampler2DArrayShadow shadowSampler{X};
<mask> uniform highp sampler2DArray depthSampler{X};
<mask> #elif defined(SHADOWPCF{X})
<mask> uniform highp sampler2DArrayShadow shadowSampler{X};
<mask> #else
<mask> uniform highp sampler2DArray shadowSampler{X};
<mask> #endif
</s> More updates (notably PCSS support)
Former-commit-id: e1168673d1df8fc788645b9ad5674f10b466a479 </s> remove float computeShadowWithCSMPCSS(float layer, vec4 vPositionFromLight, float depthMetric, highp sampler2DArray depthSampler, highp sampler2DArrayShadow shadowSampler, float shadowMapSizeInverse, float lightSizeUV, float darkness, float frustumEdgeFalloff, int searchTapCount, int pcfTapCount, vec3[64] poissonSamplers)
</s> add float computeShadowWithCSMPCSS(float layer, vec4 vPositionFromLight, float depthMetric, highp sampler2DArray depthSampler, highp sampler2DArrayShadow shadowSampler, float shadowMapSizeInverse, float lightSizeUV, float darkness, float frustumEdgeFalloff, int searchTapCount, int pcfTapCount, vec3[64] poissonSamplers, vec2 lightSizeUVCorrection, float depthCorrection, float penumbraDarkness)
</s> remove uniform float splitBlendFactor{X};
</s> add uniform float cascadeBlendFactor{X};
</s> remove uniform float splitBlendFactor{X};
</s> add uniform float cascadeBlendFactor{X};
</s> remove nextShadow = computeShadowWithCSMPCF3(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], shadowSampler{X}, light{X}.shadowsInfo.yz, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w);
</s> add shadow = computeShadowWithCSMPCF3(float(index{X}), vPositionFromLight{X}[index{X}], vDepthMetric{X}[index{X}], shadowSampler{X}, light{X}.shadowsInfo.yz, light{X}.shadowsInfo.x, light{X}.shadowsInfo.w);
| [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/BabylonJS/Babylon.js/commit/fe07b3491c0c7572d0b6df03541de8bc026cf59c | src/Shaders/ShadersInclude/lightUboDeclaration.fx |
float computeShadowWithCSMPCSS(float layer, vec4 vPositionFromLight, float depthMetric, highp sampler2DArray depthSampler, highp sampler2DArrayShadow shadowSampler, float shadowMapSizeInverse, float lightSizeUV, float darkness, float frustumEdgeFalloff, int searchTapCount, int pcfTapCount, vec3[64] poissonSamplers, vec2 lightSizeUVCorrection, float depthCorrection, float penumbraDarkness)
| <mask> // This helps to achieve a contact hardening effect on the shadow
<mask> // It uses 16 Taps for search and a 32 PCF taps in a randomly rotating poisson sampling disc.
<mask> // This is heavily inspired from http://developer.download.nvidia.com/shaderlibrary/docs/shadow_PCSS.pdf
<mask> // and http://developer.download.nvidia.com/whitepapers/2008/PCSS_Integration.pdf
<mask> float computeShadowWithCSMPCSS(float layer, vec4 vPositionFromLight, float depthMetric, highp sampler2DArray depthSampler, highp sampler2DArrayShadow shadowSampler, float shadowMapSizeInverse, float lightSizeUV, float darkness, float frustumEdgeFalloff, int searchTapCount, int pcfTapCount, vec3[64] poissonSamplers)
<mask> {
<mask> if (depthMetric > 1.0 || depthMetric < 0.0) {
<mask> return 1.0;
<mask> }
<mask>
</s> More updates (notably PCSS support)
Former-commit-id: e1168673d1df8fc788645b9ad5674f10b466a479 </s> remove float penumbraRatio = ((depthMetric - avgBlockerDepth) + AAOffset);
float filterRadius = penumbraRatio * lightSizeUV * shadowMapSizeInverse;
</s> add float penumbraRatio = ((depthMetric - avgBlockerDepth) * depthCorrection + AAOffset);
vec4 filterRadius = vec4(penumbraRatio * lightSizeUV * lightSizeUVCorrection * shadowMapSizeInverse, 0., 0.);
</s> remove int index{X} = SHADOWCSMNUM_CASCADES{X} - 1;
</s> add int index{X} = -1;
</s> remove this._frustumLength = this._scene.activeCamera?.maxZ ?? 10000;
</s> add this._shadowMaxZ = this._scene.activeCamera?.maxZ ?? 10000;
this._shadowCastersBoundingInfo = new BoundingInfo(new Vector3(0, 0, 0), new Vector3(0, 0, 0));
this.freezeShadowCastersBoundingInfo = false;
| [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/BabylonJS/Babylon.js/commit/fe07b3491c0c7572d0b6df03541de8bc026cf59c | src/Shaders/ShadersInclude/shadowsFragmentFunctions.fx |
blockerDepth = texture(depthSampler, vec3(uvDepth.xy + (lightSizeUV * lightSizeUVCorrection * shadowMapSizeInverse * PoissonSamplers32[i].xy), layer)).r;
| <mask> float blockerDepth = 0.0;
<mask> float sumBlockerDepth = 0.0;
<mask> float numBlocker = 0.0;
<mask> for (int i = 0; i < searchTapCount; i ++) {
<mask> blockerDepth = texture(depthSampler, vec3(uvDepth.xy + (lightSizeUV * shadowMapSizeInverse * PoissonSamplers32[i].xy), layer)).r;
<mask> if (blockerDepth < depthMetric) {
<mask> sumBlockerDepth += blockerDepth;
<mask> numBlocker++;
<mask> }
<mask> }
</s> More updates (notably PCSS support)
Former-commit-id: e1168673d1df8fc788645b9ad5674f10b466a479 </s> remove for (int i = 0; i < SHADOWCSMNUM_CASCADES{X} - 1; i++) {
</s> add for (int i = 0; i < SHADOWCSMNUM_CASCADES{X}; i++) {
</s> remove int index{X} = SHADOWCSMNUM_CASCADES{X} - 1;
</s> add int index{X} = -1;
</s> remove farx = this._frustumLength * Math.tan(camera.fov / 2);
fary = this._frustumLength * Math.tan(camera.fov / 2) * engine.getAspectRatio(camera);
</s> add farx = this._shadowMaxZ * Math.tan(camera.fov / 2);
fary = this._shadowMaxZ * Math.tan(camera.fov / 2) * engine.getAspectRatio(camera);
</s> remove r.push(0);
for (let i = 1; i < amount; i++) {
r.push(lambda * log[i - 1] + (1 - lambda) * uni[i - 1]);
</s> add r.push(minDistance);
for (let cascadeIndex = 0; cascadeIndex < this._cascades; ++cascadeIndex) {
const p = (cascadeIndex + 1) / this._cascades,
log = minZ * (ratio ** p),
uniform = minZ + range * p;
const d = this._lambda * (log - uniform) + uniform;
r.push((d - near) / cameraRange);
</s> remove r.push(1);
return r;
}
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/BabylonJS/Babylon.js/commit/fe07b3491c0c7572d0b6df03541de8bc026cf59c | src/Shaders/ShadersInclude/shadowsFragmentFunctions.fx |
float penumbraRatio = ((depthMetric - avgBlockerDepth) * depthCorrection + AAOffset);
vec4 filterRadius = vec4(penumbraRatio * lightSizeUV * lightSizeUVCorrection * shadowMapSizeInverse, 0., 0.);
| <mask> // Offset preventing aliasing on contact.
<mask> float AAOffset = shadowMapSizeInverse * 10.;
<mask> // Do not dividing by z despite being physically incorrect looks better due to the limited kernel size.
<mask> // float penumbraRatio = (depthMetric - avgBlockerDepth) / avgBlockerDepth;
<mask> float penumbraRatio = ((depthMetric - avgBlockerDepth) + AAOffset);
<mask> float filterRadius = penumbraRatio * lightSizeUV * shadowMapSizeInverse;
<mask>
<mask> float random = getRand(vPositionFromLight.xy);
<mask> float rotationAngle = random * 3.1415926;
<mask> vec2 rotationVector = vec2(cos(rotationAngle), sin(rotationAngle));
<mask>
</s> More updates (notably PCSS support)
Former-commit-id: e1168673d1df8fc788645b9ad5674f10b466a479 </s> remove blockerDepth = texture(depthSampler, vec3(uvDepth.xy + (lightSizeUV * shadowMapSizeInverse * PoissonSamplers32[i].xy), layer)).r;
</s> add blockerDepth = texture(depthSampler, vec3(uvDepth.xy + (lightSizeUV * lightSizeUVCorrection * shadowMapSizeInverse * PoissonSamplers32[i].xy), layer)).r;
</s> remove shadow = mix(shadow, 1., depthMetric - avgBlockerDepth);
</s> add shadow = mix(shadow, 1., min((depthMetric - avgBlockerDepth) * depthCorrection * penumbraDarkness, 1.));
</s> remove int index{X} = SHADOWCSMNUM_CASCADES{X} - 1;
</s> add int index{X} = -1;
</s> remove this._frustumLength = this._scene.activeCamera?.maxZ ?? 10000;
</s> add this._shadowMaxZ = this._scene.activeCamera?.maxZ ?? 10000;
this._shadowCastersBoundingInfo = new BoundingInfo(new Vector3(0, 0, 0), new Vector3(0, 0, 0));
this.freezeShadowCastersBoundingInfo = false;
</s> remove for (int i = 0; i < SHADOWCSMNUM_CASCADES{X} - 1; i++) {
</s> add for (int i = 0; i < SHADOWCSMNUM_CASCADES{X}; i++) {
| [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/BabylonJS/Babylon.js/commit/fe07b3491c0c7572d0b6df03541de8bc026cf59c | src/Shaders/ShadersInclude/shadowsFragmentFunctions.fx |
shadow = mix(shadow, 1., min((depthMetric - avgBlockerDepth) * depthCorrection * penumbraDarkness, 1.));
| <mask> }
<mask> shadow /= float(pcfTapCount);
<mask>
<mask> // Blocker distance falloff
<mask> shadow = mix(shadow, 1., depthMetric - avgBlockerDepth);
<mask>
<mask> // Apply darkness
<mask> shadow = mix(darkness, 1., shadow);
<mask>
<mask> // Apply light frustrum fallof
</s> More updates (notably PCSS support)
Former-commit-id: e1168673d1df8fc788645b9ad5674f10b466a479 </s> remove let OrthoMatrix = Matrix.OrthoLH(2.0 * bs.radius, 2.0 * bs.radius, 0, 2.0 * bs.radius);
</s> add let minx = -bs.radius, miny = -bs.radius, minz = 0;
let maxx = bs.radius, maxy = bs.radius, maxz = 2 * bs.radius;
// Try to tighten minZ and maxZ based on the bounding box of the shadow casters
const boundingInfo = this._shadowCastersBoundingInfo;
boundingInfo.update(this._viewMatrix[mapIndex]);
maxz = Math.min(maxz, boundingInfo.boundingBox.maximumWorld.z);
if (!this.depthClamp) {
// If we don't use depth clamping, we must set minZ so that all shadow casters are in the light frustum
minz = Math.min(minz, boundingInfo.boundingBox.minimumWorld.z);
} else {
// If using depth clamping, we can adjust minZ to reduce the [minZ, maxZ] range (and get some additional precision in the shadow map)
minz = Math.max(minz, boundingInfo.boundingBox.minimumWorld.z);
}
this._lightMinExtents[mapIndex].copyFromFloats(minx, miny, minz);
this._lightMaxExtents[mapIndex].copyFromFloats(maxx, maxy, maxz);
let OrthoMatrix;
if (this._scene.useRightHandedSystem) {
OrthoMatrix = Matrix.OrthoOffCenterRH(minx, maxx, miny, maxy, minz, maxz);
} else {
OrthoMatrix = Matrix.OrthoOffCenterLH(minx, maxx, miny, maxy, minz, maxz);
}
</s> remove float penumbraRatio = ((depthMetric - avgBlockerDepth) + AAOffset);
float filterRadius = penumbraRatio * lightSizeUV * shadowMapSizeInverse;
</s> add float penumbraRatio = ((depthMetric - avgBlockerDepth) * depthCorrection + AAOffset);
vec4 filterRadius = vec4(penumbraRatio * lightSizeUV * lightSizeUVCorrection * shadowMapSizeInverse, 0., 0.);
</s> remove float computeShadowWithCSMPCSS(float layer, vec4 vPositionFromLight, float depthMetric, highp sampler2DArray depthSampler, highp sampler2DArrayShadow shadowSampler, float shadowMapSizeInverse, float lightSizeUV, float darkness, float frustumEdgeFalloff, int searchTapCount, int pcfTapCount, vec3[64] poissonSamplers)
</s> add float computeShadowWithCSMPCSS(float layer, vec4 vPositionFromLight, float depthMetric, highp sampler2DArray depthSampler, highp sampler2DArrayShadow shadowSampler, float shadowMapSizeInverse, float lightSizeUV, float darkness, float frustumEdgeFalloff, int searchTapCount, int pcfTapCount, vec3[64] poissonSamplers, vec2 lightSizeUVCorrection, float depthCorrection, float penumbraDarkness)
| [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/BabylonJS/Babylon.js/commit/fe07b3491c0c7572d0b6df03541de8bc026cf59c | src/Shaders/ShadersInclude/shadowsFragmentFunctions.fx |
var hash = location.hash.substr(1);
currentSnippetToken = hash.split("#")[0];
showEditor();
| <mask> if (previousHash != location.hash) {
<mask> cleanHash();
<mask>
<mask> previousHash = location.hash;
<mask>
<mask> try {
<mask> var xmlHttp = new XMLHttpRequest();
<mask> xmlHttp.onreadystatechange = function () {
<mask> if (xmlHttp.readyState == 4) {
<mask> if (xmlHttp.status == 200) {
<mask>
<mask> //var snippet = JSON.parse(JSON.parse(xmlHttp.responseText).jsonPayload);
<mask> showEditor();
<mask> }
<mask> }
<mask> }
<mask>
<mask> var hash = location.hash.substr(1);
<mask> currentSnippetToken = hash.split("#")[0];
<mask> xmlHttp.open("GET", snippetUrl + "/" + hash.replace("#", "/"));
<mask> xmlHttp.send();
<mask> } catch (e) {
<mask>
<mask> }
<mask> }
<mask> }
<mask>
<mask> setTimeout(checkHash, 200);
<mask> }
</s> adding snippet server loading from url
Former-commit-id: 88ad8ca9714977be33b60ab0ebdfc0385c9e6e72 </s> remove
</s> add this.props.globalState.onErrorMessageDialogRequiredObservable.notifyObservers(`Please note: This editor is still a work in progress. You may submit feedback to msDestiny14 on GitHub.`);
| [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep"... | https://github.com/BabylonJS/Babylon.js/commit/fe3ad21b18c2c760aaf8159654964a5e0d12eed2 | guiEditor/public/index.js |
currentSnippetToken: currentSnippetToken,
| <mask> hostElement: hostElement,
<mask> customLoadObservable: customLoadObservable,
<mask> customSave: {
<mask> label: "Save as unique URL",
<mask> action: (data) => {
<mask> return new Promise((resolve, reject) => {
</s> adding snippet server loading from url
Former-commit-id: 88ad8ca9714977be33b60ab0ebdfc0385c9e6e72 </s> remove
try {
var xmlHttp = new XMLHttpRequest();
xmlHttp.onreadystatechange = function () {
if (xmlHttp.readyState == 4) {
if (xmlHttp.status == 200) {
//var snippet = JSON.parse(JSON.parse(xmlHttp.responseText).jsonPayload);
showEditor();
}
}
}
var hash = location.hash.substr(1);
currentSnippetToken = hash.split("#")[0];
xmlHttp.open("GET", snippetUrl + "/" + hash.replace("#", "/"));
xmlHttp.send();
} catch (e) {
}
</s> add var hash = location.hash.substr(1);
currentSnippetToken = hash.split("#")[0];
showEditor();
</s> remove
</s> add this.props.globalState.onErrorMessageDialogRequiredObservable.notifyObservers(`Please note: This editor is still a work in progress. You may submit feedback to msDestiny14 on GitHub.`);
| [
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/BabylonJS/Babylon.js/commit/fe3ad21b18c2c760aaf8159654964a5e0d12eed2 | guiEditor/public/index.js |
this.props.globalState.onErrorMessageDialogRequiredObservable.notifyObservers(`Please note: This editor is still a work in progress. You may submit feedback to msDestiny14 on GitHub.`);
| <mask> // Watch for browser/canvas resize events
<mask> window.addEventListener("resize", function () {
<mask> engine.resize();
<mask> });
<mask>
<mask> engine.runRenderLoop(() => {this.updateGUIs(); scene.render()});
<mask> }
<mask>
<mask> updateGUIs()
<mask> {
</s> adding snippet server loading from url
Former-commit-id: 88ad8ca9714977be33b60ab0ebdfc0385c9e6e72 </s> remove
try {
var xmlHttp = new XMLHttpRequest();
xmlHttp.onreadystatechange = function () {
if (xmlHttp.readyState == 4) {
if (xmlHttp.status == 200) {
//var snippet = JSON.parse(JSON.parse(xmlHttp.responseText).jsonPayload);
showEditor();
}
}
}
var hash = location.hash.substr(1);
currentSnippetToken = hash.split("#")[0];
xmlHttp.open("GET", snippetUrl + "/" + hash.replace("#", "/"));
xmlHttp.send();
} catch (e) {
}
</s> add var hash = location.hash.substr(1);
currentSnippetToken = hash.split("#")[0];
showEditor();
| [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/BabylonJS/Babylon.js/commit/fe3ad21b18c2c760aaf8159654964a5e0d12eed2 | guiEditor/src/diagram/workbench.tsx |
import { WorkbenchComponent } from "./diagram/workbench";
| <mask> import { WorkbenchEditor } from "./workbenchEditor";
<mask> import { Popup } from "./sharedUiComponents/lines/popup";
<mask> import { Observable } from "babylonjs/Misc/observable";
<mask> /**
<mask> * Interface used to specify creation options for the gui editor
<mask> */
<mask> export interface IGUIEditorOptions {
<mask> hostElement?: HTMLElement;
</s> adding snippet server loading from url
Former-commit-id: 88ad8ca9714977be33b60ab0ebdfc0385c9e6e72 </s> remove
try {
var xmlHttp = new XMLHttpRequest();
xmlHttp.onreadystatechange = function () {
if (xmlHttp.readyState == 4) {
if (xmlHttp.status == 200) {
//var snippet = JSON.parse(JSON.parse(xmlHttp.responseText).jsonPayload);
showEditor();
}
}
}
var hash = location.hash.substr(1);
currentSnippetToken = hash.split("#")[0];
xmlHttp.open("GET", snippetUrl + "/" + hash.replace("#", "/"));
xmlHttp.send();
} catch (e) {
}
</s> add var hash = location.hash.substr(1);
currentSnippetToken = hash.split("#")[0];
showEditor();
</s> remove
</s> add this.props.globalState.onErrorMessageDialogRequiredObservable.notifyObservers(`Please note: This editor is still a work in progress. You may submit feedback to msDestiny14 on GitHub.`);
| [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/BabylonJS/Babylon.js/commit/fe3ad21b18c2c760aaf8159654964a5e0d12eed2 | guiEditor/src/guiEditor.ts |
currentSnippetToken?: string;
| <mask> */
<mask> export interface IGUIEditorOptions {
<mask> hostElement?: HTMLElement;
<mask> customSave?: { label: string; action: (data: string) => Promise<void> };
<mask> customLoadObservable?: Observable<any>;
<mask> }
<mask>
<mask> /**
<mask> * Class used to create a gui editor
</s> adding snippet server loading from url
Former-commit-id: 88ad8ca9714977be33b60ab0ebdfc0385c9e6e72 </s> remove
</s> add this.props.globalState.onErrorMessageDialogRequiredObservable.notifyObservers(`Please note: This editor is still a work in progress. You may submit feedback to msDestiny14 on GitHub.`);
</s> remove
try {
var xmlHttp = new XMLHttpRequest();
xmlHttp.onreadystatechange = function () {
if (xmlHttp.readyState == 4) {
if (xmlHttp.status == 200) {
//var snippet = JSON.parse(JSON.parse(xmlHttp.responseText).jsonPayload);
showEditor();
}
}
}
var hash = location.hash.substr(1);
currentSnippetToken = hash.split("#")[0];
xmlHttp.open("GET", snippetUrl + "/" + hash.replace("#", "/"));
xmlHttp.send();
} catch (e) {
}
</s> add var hash = location.hash.substr(1);
currentSnippetToken = hash.split("#")[0];
showEditor();
| [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/BabylonJS/Babylon.js/commit/fe3ad21b18c2c760aaf8159654964a5e0d12eed2 | guiEditor/src/guiEditor.ts |
try {
if(options.currentSnippetToken) {
globalState.workbench.loadFromSnippet(options.currentSnippetToken);
}
} catch (error) {
console.log(error);
}
| <mask> ReactDOM.render(graphEditor, hostElement);
<mask> // create the middle workbench canvas
<mask> if (!globalState.guiTexture) {
<mask> globalState.workbench.createGUICanvas();
<mask> }
<mask>
<mask> if (options.customLoadObservable) {
<mask> options.customLoadObservable.add((data) => {
</s> adding snippet server loading from url
Former-commit-id: 88ad8ca9714977be33b60ab0ebdfc0385c9e6e72 </s> remove
try {
var xmlHttp = new XMLHttpRequest();
xmlHttp.onreadystatechange = function () {
if (xmlHttp.readyState == 4) {
if (xmlHttp.status == 200) {
//var snippet = JSON.parse(JSON.parse(xmlHttp.responseText).jsonPayload);
showEditor();
}
}
}
var hash = location.hash.substr(1);
currentSnippetToken = hash.split("#")[0];
xmlHttp.open("GET", snippetUrl + "/" + hash.replace("#", "/"));
xmlHttp.send();
} catch (e) {
}
</s> add var hash = location.hash.substr(1);
currentSnippetToken = hash.split("#")[0];
showEditor();
</s> remove
</s> add this.props.globalState.onErrorMessageDialogRequiredObservable.notifyObservers(`Please note: This editor is still a work in progress. You may submit feedback to msDestiny14 on GitHub.`);
| [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/BabylonJS/Babylon.js/commit/fe3ad21b18c2c760aaf8159654964a5e0d12eed2 | guiEditor/src/guiEditor.ts |
babylonTexture.updateURL(dataUrl, data); | <mask> if (!url) {
<mask> promises.push(this.loadImageAsync(`/images/${image.index}`, image).then((data) => {
<mask> const name = image.uri || `${this._fileName}#image${image.index}`;
<mask> const dataUrl = `data:${this._uniqueRootUrl}${name}`;
<mask> // TODO: The following line needs to replace the lines below in order to go back into master.
<mask> // babylonTexture.updateURL(dataUrl, new Blob([data], { type: image.mimeType }));
<mask> babylonTexture.updateURL(
<mask> dataUrl,
<mask> // TODO: Remove this hack once we can load from Blob objects.
<mask> data.buffer);
<mask> }));
<mask> }
<mask>
<mask> babylonTexture.wrapU = samplerData.wrapU;
<mask> babylonTexture.wrapV = samplerData.wrapV;
</s> Fixed blob hack.
Former-commit-id: f77aaf166a53cf4a4934fecfd9ae4001f458aefc </s> remove buffer: Nullable<string | ArrayBuffer | HTMLImageElement | Blob> = null, fallback: Nullable<InternalTexture> = null, format: Nullable<number> = null,
</s> add buffer: Nullable<string | ArrayBuffer | ArrayBufferView | HTMLImageElement | Blob> = null, fallback: Nullable<InternalTexture> = null, format: Nullable<number> = null,
</s> remove constructor(url: Nullable<string>, sceneOrEngine: Nullable<Scene | Engine>, noMipmap: boolean = false, invertY: boolean = true, samplingMode: number = Texture.TRILINEAR_SAMPLINGMODE, onLoad: Nullable<() => void> = null, onError: Nullable<(message?: string, exception?: any) => void> = null, buffer: Nullable<string | ArrayBuffer | HTMLImageElement | Blob> = null, deleteBuffer: boolean = false, format?: number) {
</s> add constructor(url: Nullable<string>, sceneOrEngine: Nullable<Scene | Engine>, noMipmap: boolean = false, invertY: boolean = true, samplingMode: number = Texture.TRILINEAR_SAMPLINGMODE, onLoad: Nullable<() => void> = null, onError: Nullable<(message?: string, exception?: any) => void> = null, buffer: Nullable<string | ArrayBuffer | ArrayBufferView | HTMLImageElement | Blob> = null, deleteBuffer: boolean = false, format?: number) {
</s> remove if (input instanceof ArrayBuffer) {
</s> add if (input instanceof ArrayBuffer || ArrayBuffer.isView(input)) {
</s> remove public updateURL(url: string, buffer: Nullable<string | ArrayBuffer | HTMLImageElement | Blob> = null, onLoad?: () => void): void {
</s> add public updateURL(url: string, buffer: Nullable<string | ArrayBuffer | ArrayBufferView | HTMLImageElement | Blob> = null, onLoad?: () => void): void {
</s> remove public static LoadImage(input: string | ArrayBuffer | Blob, onLoad: (img: HTMLImageElement) => void, onError: (message?: string, exception?: any) => void, offlineProvider: Nullable<IOfflineProvider>): HTMLImageElement {
</s> add public static LoadImage(input: string | ArrayBuffer | ArrayBufferView | Blob, onLoad: (img: HTMLImageElement) => void, onError: (message?: string, exception?: any) => void, offlineProvider: Nullable<IOfflineProvider>): HTMLImageElement {
| [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/BabylonJS/Babylon.js/commit/fee23471614ab013b89e5af0933255f3207e413b | loaders/src/glTF/2.0/glTFLoader.ts |
buffer: Nullable<string | ArrayBuffer | ArrayBufferView | HTMLImageElement | Blob> = null, fallback: Nullable<InternalTexture> = null, format: Nullable<number> = null,
| <mask> * @returns a InternalTexture for assignment back into BABYLON.Texture
<mask> */
<mask> public createTexture(urlArg: Nullable<string>, noMipmap: boolean, invertY: boolean, scene: Nullable<Scene>, samplingMode: number = Engine.TEXTURE_TRILINEAR_SAMPLINGMODE,
<mask> onLoad: Nullable<() => void> = null, onError: Nullable<(message: string, exception: any) => void> = null,
<mask> buffer: Nullable<string | ArrayBuffer | HTMLImageElement | Blob> = null, fallback: Nullable<InternalTexture> = null, format: Nullable<number> = null,
<mask> forcedExtension: Nullable<string> = null, excludeLoaders: Array<IInternalTextureLoader> = []): InternalTexture {
<mask> var url = String(urlArg); // assign a new string, so that the original is still available in case of fallback
<mask> var fromData = url.substr(0, 5) === "data:";
<mask> var fromBlob = url.substr(0, 5) === "blob:";
<mask> var isBase64 = fromData && url.indexOf(";base64,") !== -1;
</s> Fixed blob hack.
Former-commit-id: f77aaf166a53cf4a4934fecfd9ae4001f458aefc </s> remove constructor(url: Nullable<string>, sceneOrEngine: Nullable<Scene | Engine>, noMipmap: boolean = false, invertY: boolean = true, samplingMode: number = Texture.TRILINEAR_SAMPLINGMODE, onLoad: Nullable<() => void> = null, onError: Nullable<(message?: string, exception?: any) => void> = null, buffer: Nullable<string | ArrayBuffer | HTMLImageElement | Blob> = null, deleteBuffer: boolean = false, format?: number) {
</s> add constructor(url: Nullable<string>, sceneOrEngine: Nullable<Scene | Engine>, noMipmap: boolean = false, invertY: boolean = true, samplingMode: number = Texture.TRILINEAR_SAMPLINGMODE, onLoad: Nullable<() => void> = null, onError: Nullable<(message?: string, exception?: any) => void> = null, buffer: Nullable<string | ArrayBuffer | ArrayBufferView | HTMLImageElement | Blob> = null, deleteBuffer: boolean = false, format?: number) {
</s> remove public updateURL(url: string, buffer: Nullable<string | ArrayBuffer | HTMLImageElement | Blob> = null, onLoad?: () => void): void {
</s> add public updateURL(url: string, buffer: Nullable<string | ArrayBuffer | ArrayBufferView | HTMLImageElement | Blob> = null, onLoad?: () => void): void {
</s> remove public _buffer: Nullable<string | ArrayBuffer | HTMLImageElement | Blob> = null;
</s> add public _buffer: Nullable<string | ArrayBuffer | ArrayBufferView | HTMLImageElement | Blob> = null;
</s> remove public static LoadImage(input: string | ArrayBuffer | Blob, onLoad: (img: HTMLImageElement) => void, onError: (message?: string, exception?: any) => void, offlineProvider: Nullable<IOfflineProvider>): HTMLImageElement {
</s> add public static LoadImage(input: string | ArrayBuffer | ArrayBufferView | Blob, onLoad: (img: HTMLImageElement) => void, onError: (message?: string, exception?: any) => void, offlineProvider: Nullable<IOfflineProvider>): HTMLImageElement {
</s> remove // TODO: The following line needs to replace the lines below in order to go back into master.
// babylonTexture.updateURL(dataUrl, new Blob([data], { type: image.mimeType }));
babylonTexture.updateURL(
dataUrl,
// TODO: Remove this hack once we can load from Blob objects.
data.buffer);
</s> add babylonTexture.updateURL(dataUrl, data); | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/BabylonJS/Babylon.js/commit/fee23471614ab013b89e5af0933255f3207e413b | src/Engines/engine.ts |
else if (typeof buffer === "string" || buffer instanceof ArrayBuffer || ArrayBuffer.isView(buffer) || buffer instanceof Blob) {
| <mask> } else {
<mask> FileTools.LoadImage(url, onload, onInternalError, scene ? scene.offlineProvider : null);
<mask> }
<mask> }
<mask> else if (typeof buffer === "string" || buffer instanceof ArrayBuffer || buffer instanceof Blob) {
<mask> FileTools.LoadImage(buffer, onload, onInternalError, scene ? scene.offlineProvider : null);
<mask> }
<mask> else {
<mask> onload(<HTMLImageElement>buffer);
<mask> }
</s> Fixed blob hack.
Former-commit-id: f77aaf166a53cf4a4934fecfd9ae4001f458aefc </s> remove if (input instanceof ArrayBuffer) {
</s> add if (input instanceof ArrayBuffer || ArrayBuffer.isView(input)) {
</s> remove constructor(url: Nullable<string>, sceneOrEngine: Nullable<Scene | Engine>, noMipmap: boolean = false, invertY: boolean = true, samplingMode: number = Texture.TRILINEAR_SAMPLINGMODE, onLoad: Nullable<() => void> = null, onError: Nullable<(message?: string, exception?: any) => void> = null, buffer: Nullable<string | ArrayBuffer | HTMLImageElement | Blob> = null, deleteBuffer: boolean = false, format?: number) {
</s> add constructor(url: Nullable<string>, sceneOrEngine: Nullable<Scene | Engine>, noMipmap: boolean = false, invertY: boolean = true, samplingMode: number = Texture.TRILINEAR_SAMPLINGMODE, onLoad: Nullable<() => void> = null, onError: Nullable<(message?: string, exception?: any) => void> = null, buffer: Nullable<string | ArrayBuffer | ArrayBufferView | HTMLImageElement | Blob> = null, deleteBuffer: boolean = false, format?: number) {
</s> remove public updateURL(url: string, buffer: Nullable<string | ArrayBuffer | HTMLImageElement | Blob> = null, onLoad?: () => void): void {
</s> add public updateURL(url: string, buffer: Nullable<string | ArrayBuffer | ArrayBufferView | HTMLImageElement | Blob> = null, onLoad?: () => void): void {
</s> remove // TODO: The following line needs to replace the lines below in order to go back into master.
// babylonTexture.updateURL(dataUrl, new Blob([data], { type: image.mimeType }));
babylonTexture.updateURL(
dataUrl,
// TODO: Remove this hack once we can load from Blob objects.
data.buffer);
</s> add babylonTexture.updateURL(dataUrl, data); </s> remove public static LoadImage(input: string | ArrayBuffer | Blob, onLoad: (img: HTMLImageElement) => void, onError: (message?: string, exception?: any) => void, offlineProvider: Nullable<IOfflineProvider>): HTMLImageElement {
</s> add public static LoadImage(input: string | ArrayBuffer | ArrayBufferView | Blob, onLoad: (img: HTMLImageElement) => void, onError: (message?: string, exception?: any) => void, offlineProvider: Nullable<IOfflineProvider>): HTMLImageElement {
| [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/BabylonJS/Babylon.js/commit/fee23471614ab013b89e5af0933255f3207e413b | src/Engines/engine.ts |
public _buffer: Nullable<string | ArrayBuffer | ArrayBufferView | HTMLImageElement | Blob> = null;
| <mask> public _associatedChannel = -1;
<mask> /** @hidden */
<mask> public _dataSource = InternalTexture.DATASOURCE_UNKNOWN;
<mask> /** @hidden */
<mask> public _buffer: Nullable<string | ArrayBuffer | HTMLImageElement | Blob> = null;
<mask> /** @hidden */
<mask> public _bufferView: Nullable<ArrayBufferView> = null;
<mask> /** @hidden */
<mask> public _bufferViewArray: Nullable<ArrayBufferView[]> = null;
<mask> /** @hidden */
</s> Fixed blob hack.
Former-commit-id: f77aaf166a53cf4a4934fecfd9ae4001f458aefc </s> remove public _buffer: Nullable<string | ArrayBuffer | HTMLImageElement | Blob> = null;
</s> add public _buffer: Nullable<string | ArrayBuffer | ArrayBufferView | HTMLImageElement | Blob> = null;
</s> remove buffer: Nullable<string | ArrayBuffer | HTMLImageElement | Blob> = null, fallback: Nullable<InternalTexture> = null, format: Nullable<number> = null,
</s> add buffer: Nullable<string | ArrayBuffer | ArrayBufferView | HTMLImageElement | Blob> = null, fallback: Nullable<InternalTexture> = null, format: Nullable<number> = null,
</s> remove public updateURL(url: string, buffer: Nullable<string | ArrayBuffer | HTMLImageElement | Blob> = null, onLoad?: () => void): void {
</s> add public updateURL(url: string, buffer: Nullable<string | ArrayBuffer | ArrayBufferView | HTMLImageElement | Blob> = null, onLoad?: () => void): void {
</s> remove public static LoadImage(input: string | ArrayBuffer | Blob, onLoad: (img: HTMLImageElement) => void, onError: (message?: string, exception?: any) => void, offlineProvider: Nullable<IOfflineProvider>): HTMLImageElement {
</s> add public static LoadImage(input: string | ArrayBuffer | ArrayBufferView | Blob, onLoad: (img: HTMLImageElement) => void, onError: (message?: string, exception?: any) => void, offlineProvider: Nullable<IOfflineProvider>): HTMLImageElement {
</s> remove constructor(url: Nullable<string>, sceneOrEngine: Nullable<Scene | Engine>, noMipmap: boolean = false, invertY: boolean = true, samplingMode: number = Texture.TRILINEAR_SAMPLINGMODE, onLoad: Nullable<() => void> = null, onError: Nullable<(message?: string, exception?: any) => void> = null, buffer: Nullable<string | ArrayBuffer | HTMLImageElement | Blob> = null, deleteBuffer: boolean = false, format?: number) {
</s> add constructor(url: Nullable<string>, sceneOrEngine: Nullable<Scene | Engine>, noMipmap: boolean = false, invertY: boolean = true, samplingMode: number = Texture.TRILINEAR_SAMPLINGMODE, onLoad: Nullable<() => void> = null, onError: Nullable<(message?: string, exception?: any) => void> = null, buffer: Nullable<string | ArrayBuffer | ArrayBufferView | HTMLImageElement | Blob> = null, deleteBuffer: boolean = false, format?: number) {
| [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/BabylonJS/Babylon.js/commit/fee23471614ab013b89e5af0933255f3207e413b | src/Materials/Textures/internalTexture.ts |
public _buffer: Nullable<string | ArrayBuffer | ArrayBufferView | HTMLImageElement | Blob> = null;
| <mask> /** @hidden */
<mask> protected _initialSamplingMode = Texture.BILINEAR_SAMPLINGMODE;
<mask>
<mask> /** @hidden */
<mask> public _buffer: Nullable<string | ArrayBuffer | HTMLImageElement | Blob> = null;
<mask> private _deleteBuffer: boolean = false;
<mask> protected _format: Nullable<number> = null;
<mask> private _delayedOnLoad: Nullable<() => void> = null;
<mask> private _delayedOnError: Nullable<() => void> = null;
<mask>
</s> Fixed blob hack.
Former-commit-id: f77aaf166a53cf4a4934fecfd9ae4001f458aefc </s> remove public _buffer: Nullable<string | ArrayBuffer | HTMLImageElement | Blob> = null;
</s> add public _buffer: Nullable<string | ArrayBuffer | ArrayBufferView | HTMLImageElement | Blob> = null;
</s> remove constructor(url: Nullable<string>, sceneOrEngine: Nullable<Scene | Engine>, noMipmap: boolean = false, invertY: boolean = true, samplingMode: number = Texture.TRILINEAR_SAMPLINGMODE, onLoad: Nullable<() => void> = null, onError: Nullable<(message?: string, exception?: any) => void> = null, buffer: Nullable<string | ArrayBuffer | HTMLImageElement | Blob> = null, deleteBuffer: boolean = false, format?: number) {
</s> add constructor(url: Nullable<string>, sceneOrEngine: Nullable<Scene | Engine>, noMipmap: boolean = false, invertY: boolean = true, samplingMode: number = Texture.TRILINEAR_SAMPLINGMODE, onLoad: Nullable<() => void> = null, onError: Nullable<(message?: string, exception?: any) => void> = null, buffer: Nullable<string | ArrayBuffer | ArrayBufferView | HTMLImageElement | Blob> = null, deleteBuffer: boolean = false, format?: number) {
</s> remove buffer: Nullable<string | ArrayBuffer | HTMLImageElement | Blob> = null, fallback: Nullable<InternalTexture> = null, format: Nullable<number> = null,
</s> add buffer: Nullable<string | ArrayBuffer | ArrayBufferView | HTMLImageElement | Blob> = null, fallback: Nullable<InternalTexture> = null, format: Nullable<number> = null,
</s> remove public updateURL(url: string, buffer: Nullable<string | ArrayBuffer | HTMLImageElement | Blob> = null, onLoad?: () => void): void {
</s> add public updateURL(url: string, buffer: Nullable<string | ArrayBuffer | ArrayBufferView | HTMLImageElement | Blob> = null, onLoad?: () => void): void {
</s> remove public static LoadImage(input: string | ArrayBuffer | Blob, onLoad: (img: HTMLImageElement) => void, onError: (message?: string, exception?: any) => void, offlineProvider: Nullable<IOfflineProvider>): HTMLImageElement {
</s> add public static LoadImage(input: string | ArrayBuffer | ArrayBufferView | Blob, onLoad: (img: HTMLImageElement) => void, onError: (message?: string, exception?: any) => void, offlineProvider: Nullable<IOfflineProvider>): HTMLImageElement {
| [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/BabylonJS/Babylon.js/commit/fee23471614ab013b89e5af0933255f3207e413b | src/Materials/Textures/texture.ts |
constructor(url: Nullable<string>, sceneOrEngine: Nullable<Scene | Engine>, noMipmap: boolean = false, invertY: boolean = true, samplingMode: number = Texture.TRILINEAR_SAMPLINGMODE, onLoad: Nullable<() => void> = null, onError: Nullable<(message?: string, exception?: any) => void> = null, buffer: Nullable<string | ArrayBuffer | ArrayBufferView | HTMLImageElement | Blob> = null, deleteBuffer: boolean = false, format?: number) {
| <mask> * @param buffer define the buffer to load the texture from in case the texture is loaded from a buffer representation
<mask> * @param deleteBuffer define if the buffer we are loading the texture from should be deleted after load
<mask> * @param format define the format of the texture we are trying to load (Engine.TEXTUREFORMAT_RGBA...)
<mask> */
<mask> constructor(url: Nullable<string>, sceneOrEngine: Nullable<Scene | Engine>, noMipmap: boolean = false, invertY: boolean = true, samplingMode: number = Texture.TRILINEAR_SAMPLINGMODE, onLoad: Nullable<() => void> = null, onError: Nullable<(message?: string, exception?: any) => void> = null, buffer: Nullable<string | ArrayBuffer | HTMLImageElement | Blob> = null, deleteBuffer: boolean = false, format?: number) {
<mask> super((sceneOrEngine && sceneOrEngine.getClassName() === "Scene") ? (sceneOrEngine as Scene) : null);
<mask>
<mask> this.name = url || "";
<mask> this.url = url;
<mask> this._noMipmap = noMipmap;
</s> Fixed blob hack.
Former-commit-id: f77aaf166a53cf4a4934fecfd9ae4001f458aefc </s> remove public updateURL(url: string, buffer: Nullable<string | ArrayBuffer | HTMLImageElement | Blob> = null, onLoad?: () => void): void {
</s> add public updateURL(url: string, buffer: Nullable<string | ArrayBuffer | ArrayBufferView | HTMLImageElement | Blob> = null, onLoad?: () => void): void {
</s> remove buffer: Nullable<string | ArrayBuffer | HTMLImageElement | Blob> = null, fallback: Nullable<InternalTexture> = null, format: Nullable<number> = null,
</s> add buffer: Nullable<string | ArrayBuffer | ArrayBufferView | HTMLImageElement | Blob> = null, fallback: Nullable<InternalTexture> = null, format: Nullable<number> = null,
</s> remove public static LoadImage(input: string | ArrayBuffer | Blob, onLoad: (img: HTMLImageElement) => void, onError: (message?: string, exception?: any) => void, offlineProvider: Nullable<IOfflineProvider>): HTMLImageElement {
</s> add public static LoadImage(input: string | ArrayBuffer | ArrayBufferView | Blob, onLoad: (img: HTMLImageElement) => void, onError: (message?: string, exception?: any) => void, offlineProvider: Nullable<IOfflineProvider>): HTMLImageElement {
</s> remove public _buffer: Nullable<string | ArrayBuffer | HTMLImageElement | Blob> = null;
</s> add public _buffer: Nullable<string | ArrayBuffer | ArrayBufferView | HTMLImageElement | Blob> = null;
</s> remove // TODO: The following line needs to replace the lines below in order to go back into master.
// babylonTexture.updateURL(dataUrl, new Blob([data], { type: image.mimeType }));
babylonTexture.updateURL(
dataUrl,
// TODO: Remove this hack once we can load from Blob objects.
data.buffer);
</s> add babylonTexture.updateURL(dataUrl, data); | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/BabylonJS/Babylon.js/commit/fee23471614ab013b89e5af0933255f3207e413b | src/Materials/Textures/texture.ts |
public updateURL(url: string, buffer: Nullable<string | ArrayBuffer | ArrayBufferView | HTMLImageElement | Blob> = null, onLoad?: () => void): void {
| <mask> * @param url the url of the texture
<mask> * @param buffer the buffer of the texture (defaults to null)
<mask> * @param onLoad callback called when the texture is loaded (defaults to null)
<mask> */
<mask> public updateURL(url: string, buffer: Nullable<string | ArrayBuffer | HTMLImageElement | Blob> = null, onLoad?: () => void): void {
<mask> if (this.url) {
<mask> this.releaseInternalTexture();
<mask> this.getScene()!.markAllMaterialsAsDirty(Constants.MATERIAL_TextureDirtyFlag);
<mask> }
<mask>
</s> Fixed blob hack.
Former-commit-id: f77aaf166a53cf4a4934fecfd9ae4001f458aefc </s> remove constructor(url: Nullable<string>, sceneOrEngine: Nullable<Scene | Engine>, noMipmap: boolean = false, invertY: boolean = true, samplingMode: number = Texture.TRILINEAR_SAMPLINGMODE, onLoad: Nullable<() => void> = null, onError: Nullable<(message?: string, exception?: any) => void> = null, buffer: Nullable<string | ArrayBuffer | HTMLImageElement | Blob> = null, deleteBuffer: boolean = false, format?: number) {
</s> add constructor(url: Nullable<string>, sceneOrEngine: Nullable<Scene | Engine>, noMipmap: boolean = false, invertY: boolean = true, samplingMode: number = Texture.TRILINEAR_SAMPLINGMODE, onLoad: Nullable<() => void> = null, onError: Nullable<(message?: string, exception?: any) => void> = null, buffer: Nullable<string | ArrayBuffer | ArrayBufferView | HTMLImageElement | Blob> = null, deleteBuffer: boolean = false, format?: number) {
</s> remove public static LoadImage(input: string | ArrayBuffer | Blob, onLoad: (img: HTMLImageElement) => void, onError: (message?: string, exception?: any) => void, offlineProvider: Nullable<IOfflineProvider>): HTMLImageElement {
</s> add public static LoadImage(input: string | ArrayBuffer | ArrayBufferView | Blob, onLoad: (img: HTMLImageElement) => void, onError: (message?: string, exception?: any) => void, offlineProvider: Nullable<IOfflineProvider>): HTMLImageElement {
</s> remove buffer: Nullable<string | ArrayBuffer | HTMLImageElement | Blob> = null, fallback: Nullable<InternalTexture> = null, format: Nullable<number> = null,
</s> add buffer: Nullable<string | ArrayBuffer | ArrayBufferView | HTMLImageElement | Blob> = null, fallback: Nullable<InternalTexture> = null, format: Nullable<number> = null,
</s> remove if (input instanceof ArrayBuffer) {
</s> add if (input instanceof ArrayBuffer || ArrayBuffer.isView(input)) {
</s> remove public _buffer: Nullable<string | ArrayBuffer | HTMLImageElement | Blob> = null;
</s> add public _buffer: Nullable<string | ArrayBuffer | ArrayBufferView | HTMLImageElement | Blob> = null;
| [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/BabylonJS/Babylon.js/commit/fee23471614ab013b89e5af0933255f3207e413b | src/Materials/Textures/texture.ts |
public static LoadImage(input: string | ArrayBuffer | ArrayBufferView | Blob, onLoad: (img: HTMLImageElement) => void, onError: (message?: string, exception?: any) => void, offlineProvider: Nullable<IOfflineProvider>): HTMLImageElement {
| <mask> * @param onError callback called when the image fails to load
<mask> * @param offlineProvider offline provider for caching
<mask> * @returns the HTMLImageElement of the loaded image
<mask> */
<mask> public static LoadImage(input: string | ArrayBuffer | Blob, onLoad: (img: HTMLImageElement) => void, onError: (message?: string, exception?: any) => void, offlineProvider: Nullable<IOfflineProvider>): HTMLImageElement {
<mask> let url: string;
<mask> let usingObjectURL = false;
<mask>
<mask> if (input instanceof ArrayBuffer) {
<mask> url = URL.createObjectURL(new Blob([input]));
</s> Fixed blob hack.
Former-commit-id: f77aaf166a53cf4a4934fecfd9ae4001f458aefc </s> remove if (input instanceof ArrayBuffer) {
</s> add if (input instanceof ArrayBuffer || ArrayBuffer.isView(input)) {
</s> remove public updateURL(url: string, buffer: Nullable<string | ArrayBuffer | HTMLImageElement | Blob> = null, onLoad?: () => void): void {
</s> add public updateURL(url: string, buffer: Nullable<string | ArrayBuffer | ArrayBufferView | HTMLImageElement | Blob> = null, onLoad?: () => void): void {
</s> remove constructor(url: Nullable<string>, sceneOrEngine: Nullable<Scene | Engine>, noMipmap: boolean = false, invertY: boolean = true, samplingMode: number = Texture.TRILINEAR_SAMPLINGMODE, onLoad: Nullable<() => void> = null, onError: Nullable<(message?: string, exception?: any) => void> = null, buffer: Nullable<string | ArrayBuffer | HTMLImageElement | Blob> = null, deleteBuffer: boolean = false, format?: number) {
</s> add constructor(url: Nullable<string>, sceneOrEngine: Nullable<Scene | Engine>, noMipmap: boolean = false, invertY: boolean = true, samplingMode: number = Texture.TRILINEAR_SAMPLINGMODE, onLoad: Nullable<() => void> = null, onError: Nullable<(message?: string, exception?: any) => void> = null, buffer: Nullable<string | ArrayBuffer | ArrayBufferView | HTMLImageElement | Blob> = null, deleteBuffer: boolean = false, format?: number) {
</s> remove buffer: Nullable<string | ArrayBuffer | HTMLImageElement | Blob> = null, fallback: Nullable<InternalTexture> = null, format: Nullable<number> = null,
</s> add buffer: Nullable<string | ArrayBuffer | ArrayBufferView | HTMLImageElement | Blob> = null, fallback: Nullable<InternalTexture> = null, format: Nullable<number> = null,
</s> remove public _buffer: Nullable<string | ArrayBuffer | HTMLImageElement | Blob> = null;
</s> add public _buffer: Nullable<string | ArrayBuffer | ArrayBufferView | HTMLImageElement | Blob> = null;
| [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/BabylonJS/Babylon.js/commit/fee23471614ab013b89e5af0933255f3207e413b | src/Misc/fileTools.ts |
if (input instanceof ArrayBuffer || ArrayBuffer.isView(input)) {
| <mask> public static LoadImage(input: string | ArrayBuffer | Blob, onLoad: (img: HTMLImageElement) => void, onError: (message?: string, exception?: any) => void, offlineProvider: Nullable<IOfflineProvider>): HTMLImageElement {
<mask> let url: string;
<mask> let usingObjectURL = false;
<mask>
<mask> if (input instanceof ArrayBuffer) {
<mask> url = URL.createObjectURL(new Blob([input]));
<mask> usingObjectURL = true;
<mask> }
<mask> else if (input instanceof Blob) {
<mask> url = URL.createObjectURL(input);
</s> Fixed blob hack.
Former-commit-id: f77aaf166a53cf4a4934fecfd9ae4001f458aefc </s> remove public static LoadImage(input: string | ArrayBuffer | Blob, onLoad: (img: HTMLImageElement) => void, onError: (message?: string, exception?: any) => void, offlineProvider: Nullable<IOfflineProvider>): HTMLImageElement {
</s> add public static LoadImage(input: string | ArrayBuffer | ArrayBufferView | Blob, onLoad: (img: HTMLImageElement) => void, onError: (message?: string, exception?: any) => void, offlineProvider: Nullable<IOfflineProvider>): HTMLImageElement {
</s> remove else if (typeof buffer === "string" || buffer instanceof ArrayBuffer || buffer instanceof Blob) {
</s> add else if (typeof buffer === "string" || buffer instanceof ArrayBuffer || ArrayBuffer.isView(buffer) || buffer instanceof Blob) {
</s> remove public updateURL(url: string, buffer: Nullable<string | ArrayBuffer | HTMLImageElement | Blob> = null, onLoad?: () => void): void {
</s> add public updateURL(url: string, buffer: Nullable<string | ArrayBuffer | ArrayBufferView | HTMLImageElement | Blob> = null, onLoad?: () => void): void {
</s> remove constructor(url: Nullable<string>, sceneOrEngine: Nullable<Scene | Engine>, noMipmap: boolean = false, invertY: boolean = true, samplingMode: number = Texture.TRILINEAR_SAMPLINGMODE, onLoad: Nullable<() => void> = null, onError: Nullable<(message?: string, exception?: any) => void> = null, buffer: Nullable<string | ArrayBuffer | HTMLImageElement | Blob> = null, deleteBuffer: boolean = false, format?: number) {
</s> add constructor(url: Nullable<string>, sceneOrEngine: Nullable<Scene | Engine>, noMipmap: boolean = false, invertY: boolean = true, samplingMode: number = Texture.TRILINEAR_SAMPLINGMODE, onLoad: Nullable<() => void> = null, onError: Nullable<(message?: string, exception?: any) => void> = null, buffer: Nullable<string | ArrayBuffer | ArrayBufferView | HTMLImageElement | Blob> = null, deleteBuffer: boolean = false, format?: number) {
</s> remove buffer: Nullable<string | ArrayBuffer | HTMLImageElement | Blob> = null, fallback: Nullable<InternalTexture> = null, format: Nullable<number> = null,
</s> add buffer: Nullable<string | ArrayBuffer | ArrayBufferView | HTMLImageElement | Blob> = null, fallback: Nullable<InternalTexture> = null, format: Nullable<number> = null,
| [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/BabylonJS/Babylon.js/commit/fee23471614ab013b89e5af0933255f3207e413b | src/Misc/fileTools.ts |
- gulp tests-whatsnew
| <mask> - "sh -e /etc/init.d/xvfb start"
<mask> - sleep 3 # give xvfb some time to start
<mask> script:
<mask> - set -e
<mask> - gulp typescript-all
<mask> - gulp typedoc-all
<mask> - gulp tests-unit
<mask> - travis_retry gulp tests-validation-virtualscreen
</s> Add what's new check in the build Fixed #3592
Former-commit-id: 55f085ea0f6fb646b7a2df77f78d937e20f15f2d </s> remove var karmaServer = require('karma').Server;
</s> add | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/BabylonJS/Babylon.js/commit/ffbb574ac7736d4c7141d91bf0b661b856102bca | .travis.yml |
var request = require('request');
var fs = require("fs");
var karmaServer = require('karma').Server; | <mask> var typedoc = require("gulp-typedoc");
<mask> var validateTypedoc = require("./gulp-validateTypedoc");
<mask>
<mask> var config = require("./config.json");
<mask>
<mask> var del = require("del");
</s> Add what's new check in the build Fixed #3592
Former-commit-id: 55f085ea0f6fb646b7a2df77f78d937e20f15f2d </s> remove var karmaServer = require('karma').Server;
</s> add | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/BabylonJS/Babylon.js/commit/ffbb574ac7736d4c7141d91bf0b661b856102bca | Tools/Gulp/gulpfile.js |
<mask> var config = require("./config.json");
<mask>
<mask> var del = require("del");
<mask>
<mask> var karmaServer = require('karma').Server;
<mask>
<mask> var debug = require("gulp-debug");
<mask> var includeShadersStream;
<mask> var shadersStream;
<mask> var workersStream;
<mask>
</s> Add what's new check in the build Fixed #3592
Former-commit-id: 55f085ea0f6fb646b7a2df77f78d937e20f15f2d | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/BabylonJS/Babylon.js/commit/ffbb574ac7736d4c7141d91bf0b661b856102bca | Tools/Gulp/gulpfile.js | |
import variable from "../theme/variables/platform"; | <mask> import React, { Component } from "react";
<mask> import PropTypes from "prop-types";
<mask> import { KeyboardAwareScrollView } from "react-native-keyboard-aware-scroll-view";
<mask> import { connectStyle } from "native-base-shoutem-theme";
<mask> import mapPropsToStyleNames from "../Utils/mapPropsToStyleNames";
<mask>
<mask> class Content extends Component {
<mask> static contextTypes = {
<mask> theme: PropTypes.object
</s> Safearea implementation for Header, footer and Content </s> remove return <View ref={c => (this._root = c)} {...this.props} />;
</s> add const variables = this.context.theme
? this.context.theme["@@shoutem.theme/themeStyle"].variables
: variable;
return variable.isIphoneX ? (
<View
ref={c => (this._root = c)}
{...this.props}
onLayout={e => this.layoutChange(e.nativeEvent.layout)}
style={[
this.props.style,
{
height: this.calculateHeight(
this.state.orientation,
variables.Inset
),
paddingBottom: this.calculatePadder(
this.state.orientation,
variables.Inset
)
}
]}
/>
) : (
<View ref={c => (this._root = c)} {...this.props} />
); </s> remove render() {
return (
<KeyboardAwareScrollView
automaticallyAdjustContentInsets={false}
resetScrollToCoords={this.props.disableKBDismissScroll ? null : { x: 0, y: 0 }}
keyboardShouldPersistTaps={this.props.keyboardShouldPersistTaps ? this.props.keyboardShouldPersistTaps : 'handled'}
ref={c => {
this._scrollview = c;
this._root = c;
}}
{...this.props}
>
{this.props.children}
</KeyboardAwareScrollView>
);
}
</s> add static contextTypes = {
theme: PropTypes.object
};
constructor(props) {
super(props);
this.state = {
orientation: "portrait"
};
}
layoutChange(val) {
let maxComp = Math.max(variable.deviceWidth, variable.deviceHeight);
if (val.width >= maxComp) this.setState({ orientation: "landscape" });
else {
this.setState({ orientation: "portrait" });
}
}
calculateLeft(mode, inSet) {
let inset = null;
if (inSet !== undefined) {
inset = inSet;
} else {
inset = variable.Inset;
}
const InsetValues = mode === "portrait" ? inset.portrait : inset.landscape;
let leftPadder = null;
if (this.props.style[1] !== undefined) {
if (
this.props.style[1].padding !== undefined ||
this.props.style[1].paddingLeft !== undefined
) {
leftPadder =
(this.props.style[1].paddingLeft
? this.props.style[1].paddingLeft
: this.props.style[1].padding) + InsetValues.leftInset;
}
} else if (
this.props.style.padding !== undefined ||
this.props.style.paddingLeft !== undefined
) {
leftPadder =
(this.props.style.paddingLeft
? this.props.style.paddingLeft
: this.props.style.padding) + InsetValues.leftInset;
} else {
leftPadder = InsetValues.leftInset;
}
return leftPadder;
}
calculateRight(mode, inSet) {
let inset = null;
if (inSet !== undefined) {
inset = inSet;
} else {
inset = variable.Inset;
}
const InsetValues = mode === "portrait" ? inset.portrait : inset.landscape;
let rightPadder = null;
if (this.props.style[1] !== undefined) {
if (
this.props.style[1].padding !== undefined ||
this.props.style[1].paddingRight !== undefined
) {
rightPadder =
(this.props.style[1].paddingRight
? this.props.style[1].paddingRight
: this.props.style[1].padding) + InsetValues.rightInset;
}
} else if (
this.props.style.padding !== undefined ||
this.props.style.paddingRight !== undefined
) {
rightPadder =
(this.props.style.paddingRight
? this.props.style.paddingRight
: this.props.style.padding) + InsetValues.rightInset;
} else {
rightPadder = InsetValues.rightInset;
}
return rightPadder;
}
render() {
const variables = this.context.theme
? this.context.theme["@@shoutem.theme/themeStyle"].variables
: variable;
return variable.isIphoneX ? (
<KeyboardAwareScrollView
automaticallyAdjustContentInsets={false}
resetScrollToCoords={
this.props.disableKBDismissScroll ? null : { x: 0, y: 0 }
}
keyboardShouldPersistTaps={
this.props.keyboardShouldPersistTaps
? this.props.keyboardShouldPersistTaps
: "handled"
}
ref={c => {
this._scrollview = c;
this._root = c;
}}
{...this.props}
onLayout={e => this.layoutChange(e.nativeEvent.layout)}
style={[
this.props.style,
{
paddingLeft: this.calculateLeft(
this.state.orientation,
variables.Inset
)
}
]}
>
{this.props.children}
</KeyboardAwareScrollView>
) : (
<KeyboardAwareScrollView
automaticallyAdjustContentInsets={false}
resetScrollToCoords={
this.props.disableKBDismissScroll ? null : { x: 0, y: 0 }
}
keyboardShouldPersistTaps={
this.props.keyboardShouldPersistTaps
? this.props.keyboardShouldPersistTaps
: "handled"
}
ref={c => {
this._scrollview = c;
this._root = c;
}}
{...this.props}
>
{this.props.children}
</KeyboardAwareScrollView>
);
} </s> remove
</s> add constructor(props) {
super(props);
this.state = {
orientation: "portrait"
};
}
layoutChange(val) {
let maxComp = Math.max(variable.deviceWidth, variable.deviceHeight);
if (val.width >= maxComp) this.setState({ orientation: "landscape" });
else {
this.setState({ orientation: "portrait" });
}
}
calculateHeight(mode, inSet) {
let inset = null;
if (inSet != undefined) {
inset = inSet;
} else {
inset = variable.Inset;
}
const InsetValues = mode === "portrait" ? inset.portrait : inset.landscape;
let oldHeight = null;
if (this.props.style.height != undefined) {
oldHeight = this.props.style.height;
} else if (this.props.style[1].height) {
oldHeight = this.props.style[1].height;
} else {
oldHeight = this.props.style[0].height;
}
let height = oldHeight + InsetValues.topInset;
return height;
}
calculatePadder(mode, inSet) {
let inset = null;
if (inSet != undefined) {
inset = inSet;
} else {
inset = variable.Inset;
}
const InsetValues = mode === "portrait" ? inset.portrait : inset.landscape;
let topPadder = null;
if (this.props.style[1] !== undefined) {
if (
this.props.style[1].padding !== undefined ||
this.props.style[1].paddingTop !== undefined
) {
topPadder =
(this.props.style[1].paddingTop
? this.props.style[1].paddingTop
: this.props.style[1].padding) + InsetValues.topInset;
}
} else if (
this.props.style.padding !== undefined &&
this.props.style.paddingTop !== undefined
) {
topPadder =
(this.props.style.paddingTop
? this.props.style.paddingTop
: this.props.style.padding) + InsetValues.topInset;
} else {
topPadder = InsetValues.topInset;
}
return topPadder;
} </s> remove const StyledContent = connectStyle("NativeBase.Content", {}, mapPropsToStyleNames)(Content);
</s> add const StyledContent = connectStyle(
"NativeBase.Content",
{},
mapPropsToStyleNames
)(Content); | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/02488686876423d0d490d73e89587fac846ddfe3 | src/basic/Content.js |
static contextTypes = {
theme: PropTypes.object
};
constructor(props) {
super(props);
this.state = {
orientation: "portrait"
};
}
layoutChange(val) {
let maxComp = Math.max(variable.deviceWidth, variable.deviceHeight);
if (val.width >= maxComp) this.setState({ orientation: "landscape" });
else {
this.setState({ orientation: "portrait" });
}
}
calculateLeft(mode, inSet) {
let inset = null;
if (inSet !== undefined) {
inset = inSet;
} else {
inset = variable.Inset;
}
const InsetValues = mode === "portrait" ? inset.portrait : inset.landscape;
let leftPadder = null;
if (this.props.style[1] !== undefined) {
if (
this.props.style[1].padding !== undefined ||
this.props.style[1].paddingLeft !== undefined
) {
leftPadder =
(this.props.style[1].paddingLeft
? this.props.style[1].paddingLeft
: this.props.style[1].padding) + InsetValues.leftInset;
}
} else if (
this.props.style.padding !== undefined ||
this.props.style.paddingLeft !== undefined
) {
leftPadder =
(this.props.style.paddingLeft
? this.props.style.paddingLeft
: this.props.style.padding) + InsetValues.leftInset;
} else {
leftPadder = InsetValues.leftInset;
}
return leftPadder;
}
calculateRight(mode, inSet) {
let inset = null;
if (inSet !== undefined) {
inset = inSet;
} else {
inset = variable.Inset;
}
const InsetValues = mode === "portrait" ? inset.portrait : inset.landscape;
let rightPadder = null;
if (this.props.style[1] !== undefined) {
if (
this.props.style[1].padding !== undefined ||
this.props.style[1].paddingRight !== undefined
) {
rightPadder =
(this.props.style[1].paddingRight
? this.props.style[1].paddingRight
: this.props.style[1].padding) + InsetValues.rightInset;
}
} else if (
this.props.style.padding !== undefined ||
this.props.style.paddingRight !== undefined
) {
rightPadder =
(this.props.style.paddingRight
? this.props.style.paddingRight
: this.props.style.padding) + InsetValues.rightInset;
} else {
rightPadder = InsetValues.rightInset;
}
return rightPadder;
}
render() {
const variables = this.context.theme
? this.context.theme["@@shoutem.theme/themeStyle"].variables
: variable;
return variable.isIphoneX ? (
<KeyboardAwareScrollView
automaticallyAdjustContentInsets={false}
resetScrollToCoords={
this.props.disableKBDismissScroll ? null : { x: 0, y: 0 }
}
keyboardShouldPersistTaps={
this.props.keyboardShouldPersistTaps
? this.props.keyboardShouldPersistTaps
: "handled"
}
ref={c => {
this._scrollview = c;
this._root = c;
}}
{...this.props}
onLayout={e => this.layoutChange(e.nativeEvent.layout)}
style={[
this.props.style,
{
paddingLeft: this.calculateLeft(
this.state.orientation,
variables.Inset
)
}
]}
>
{this.props.children}
</KeyboardAwareScrollView>
) : (
<KeyboardAwareScrollView
automaticallyAdjustContentInsets={false}
resetScrollToCoords={
this.props.disableKBDismissScroll ? null : { x: 0, y: 0 }
}
keyboardShouldPersistTaps={
this.props.keyboardShouldPersistTaps
? this.props.keyboardShouldPersistTaps
: "handled"
}
ref={c => {
this._scrollview = c;
this._root = c;
}}
{...this.props}
>
{this.props.children}
</KeyboardAwareScrollView>
);
} | <mask> import { connectStyle } from "native-base-shoutem-theme";
<mask> import mapPropsToStyleNames from "../Utils/mapPropsToStyleNames";
<mask>
<mask> class Content extends Component {
<mask> render() {
<mask> return (
<mask> <KeyboardAwareScrollView
<mask> automaticallyAdjustContentInsets={false}
<mask> resetScrollToCoords={this.props.disableKBDismissScroll ? null : { x: 0, y: 0 }}
<mask> keyboardShouldPersistTaps={this.props.keyboardShouldPersistTaps ? this.props.keyboardShouldPersistTaps : 'handled'}
<mask> ref={c => {
<mask> this._scrollview = c;
<mask> this._root = c;
<mask> }}
<mask> {...this.props}
<mask> >
<mask> {this.props.children}
<mask> </KeyboardAwareScrollView>
<mask> );
<mask> }
<mask> }
<mask>
<mask> Content.propTypes = {
<mask> style: PropTypes.oneOfType([PropTypes.object, PropTypes.number, PropTypes.array]),
<mask> padder: PropTypes.bool,
</s> Safearea implementation for Header, footer and Content </s> remove return <View ref={c => (this._root = c)} {...this.props} />;
</s> add const variables = this.context.theme
? this.context.theme["@@shoutem.theme/themeStyle"].variables
: variable;
return variable.isIphoneX ? (
<View
ref={c => (this._root = c)}
{...this.props}
onLayout={e => this.layoutChange(e.nativeEvent.layout)}
style={[
this.props.style,
{
height: this.calculateHeight(
this.state.orientation,
variables.Inset
),
paddingBottom: this.calculatePadder(
this.state.orientation,
variables.Inset
)
}
]}
/>
) : (
<View ref={c => (this._root = c)} {...this.props} />
); </s> remove style: PropTypes.oneOfType([PropTypes.object, PropTypes.number, PropTypes.array]),
padder: PropTypes.bool,
disableKBDismissScroll: PropTypes.bool,
enableResetScrollToCoords: PropTypes.bool,
keyboardShouldPersistTaps: PropTypes.string
</s> add style: PropTypes.oneOfType([
PropTypes.object,
PropTypes.number,
PropTypes.array
]),
padder: PropTypes.bool,
disableKBDismissScroll: PropTypes.bool,
enableResetScrollToCoords: PropTypes.bool,
keyboardShouldPersistTaps: PropTypes.string </s> remove <View ref={c => (this._root = c)} {...this.props} />
</s> add {variable.isIphoneX ? (
<View
ref={c => (this._root = c)}
{...this.props}
style={[
this.props.style,
{
height: this.calculateHeight(
this.state.orientation,
variables.Inset
),
paddingTop: this.calculatePadder(
this.state.orientation,
variables.Inset
)
}
]}
/>
) : (
<View ref={c => (this._root = c)} {...this.props} />
)} | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/02488686876423d0d490d73e89587fac846ddfe3 | src/basic/Content.js |
style: PropTypes.oneOfType([
PropTypes.object,
PropTypes.number,
PropTypes.array
]),
padder: PropTypes.bool,
disableKBDismissScroll: PropTypes.bool,
enableResetScrollToCoords: PropTypes.bool,
keyboardShouldPersistTaps: PropTypes.string | <mask> }
<mask> }
<mask>
<mask> Content.propTypes = {
<mask> style: PropTypes.oneOfType([PropTypes.object, PropTypes.number, PropTypes.array]),
<mask> padder: PropTypes.bool,
<mask> disableKBDismissScroll: PropTypes.bool,
<mask> enableResetScrollToCoords: PropTypes.bool,
<mask> keyboardShouldPersistTaps: PropTypes.string
<mask> };
<mask>
<mask> const StyledContent = connectStyle("NativeBase.Content", {}, mapPropsToStyleNames)(Content);
<mask>
<mask> export { StyledContent as Content };
</s> Safearea implementation for Header, footer and Content </s> remove const StyledContent = connectStyle("NativeBase.Content", {}, mapPropsToStyleNames)(Content);
</s> add const StyledContent = connectStyle(
"NativeBase.Content",
{},
mapPropsToStyleNames
)(Content); </s> remove render() {
return (
<KeyboardAwareScrollView
automaticallyAdjustContentInsets={false}
resetScrollToCoords={this.props.disableKBDismissScroll ? null : { x: 0, y: 0 }}
keyboardShouldPersistTaps={this.props.keyboardShouldPersistTaps ? this.props.keyboardShouldPersistTaps : 'handled'}
ref={c => {
this._scrollview = c;
this._root = c;
}}
{...this.props}
>
{this.props.children}
</KeyboardAwareScrollView>
);
}
</s> add static contextTypes = {
theme: PropTypes.object
};
constructor(props) {
super(props);
this.state = {
orientation: "portrait"
};
}
layoutChange(val) {
let maxComp = Math.max(variable.deviceWidth, variable.deviceHeight);
if (val.width >= maxComp) this.setState({ orientation: "landscape" });
else {
this.setState({ orientation: "portrait" });
}
}
calculateLeft(mode, inSet) {
let inset = null;
if (inSet !== undefined) {
inset = inSet;
} else {
inset = variable.Inset;
}
const InsetValues = mode === "portrait" ? inset.portrait : inset.landscape;
let leftPadder = null;
if (this.props.style[1] !== undefined) {
if (
this.props.style[1].padding !== undefined ||
this.props.style[1].paddingLeft !== undefined
) {
leftPadder =
(this.props.style[1].paddingLeft
? this.props.style[1].paddingLeft
: this.props.style[1].padding) + InsetValues.leftInset;
}
} else if (
this.props.style.padding !== undefined ||
this.props.style.paddingLeft !== undefined
) {
leftPadder =
(this.props.style.paddingLeft
? this.props.style.paddingLeft
: this.props.style.padding) + InsetValues.leftInset;
} else {
leftPadder = InsetValues.leftInset;
}
return leftPadder;
}
calculateRight(mode, inSet) {
let inset = null;
if (inSet !== undefined) {
inset = inSet;
} else {
inset = variable.Inset;
}
const InsetValues = mode === "portrait" ? inset.portrait : inset.landscape;
let rightPadder = null;
if (this.props.style[1] !== undefined) {
if (
this.props.style[1].padding !== undefined ||
this.props.style[1].paddingRight !== undefined
) {
rightPadder =
(this.props.style[1].paddingRight
? this.props.style[1].paddingRight
: this.props.style[1].padding) + InsetValues.rightInset;
}
} else if (
this.props.style.padding !== undefined ||
this.props.style.paddingRight !== undefined
) {
rightPadder =
(this.props.style.paddingRight
? this.props.style.paddingRight
: this.props.style.padding) + InsetValues.rightInset;
} else {
rightPadder = InsetValues.rightInset;
}
return rightPadder;
}
render() {
const variables = this.context.theme
? this.context.theme["@@shoutem.theme/themeStyle"].variables
: variable;
return variable.isIphoneX ? (
<KeyboardAwareScrollView
automaticallyAdjustContentInsets={false}
resetScrollToCoords={
this.props.disableKBDismissScroll ? null : { x: 0, y: 0 }
}
keyboardShouldPersistTaps={
this.props.keyboardShouldPersistTaps
? this.props.keyboardShouldPersistTaps
: "handled"
}
ref={c => {
this._scrollview = c;
this._root = c;
}}
{...this.props}
onLayout={e => this.layoutChange(e.nativeEvent.layout)}
style={[
this.props.style,
{
paddingLeft: this.calculateLeft(
this.state.orientation,
variables.Inset
)
}
]}
>
{this.props.children}
</KeyboardAwareScrollView>
) : (
<KeyboardAwareScrollView
automaticallyAdjustContentInsets={false}
resetScrollToCoords={
this.props.disableKBDismissScroll ? null : { x: 0, y: 0 }
}
keyboardShouldPersistTaps={
this.props.keyboardShouldPersistTaps
? this.props.keyboardShouldPersistTaps
: "handled"
}
ref={c => {
this._scrollview = c;
this._root = c;
}}
{...this.props}
>
{this.props.children}
</KeyboardAwareScrollView>
);
} </s> remove
</s> add constructor(props) {
super(props);
this.state = {
orientation: "portrait"
};
}
layoutChange(val) {
let maxComp = Math.max(variable.deviceWidth, variable.deviceHeight);
if (val.width >= maxComp) this.setState({ orientation: "landscape" });
else {
this.setState({ orientation: "portrait" });
}
}
calculateHeight(mode, inSet) {
let inset = null;
if (inSet != undefined) {
inset = inSet;
} else {
inset = variable.Inset;
}
const InsetValues = mode === "portrait" ? inset.portrait : inset.landscape;
let oldHeight = null;
if (this.props.style.height != undefined) {
oldHeight = this.props.style.height;
} else if (this.props.style[1].height) {
oldHeight = this.props.style[1].height;
} else {
oldHeight = this.props.style[0].height;
}
let height = oldHeight + InsetValues.topInset;
return height;
}
calculatePadder(mode, inSet) {
let inset = null;
if (inSet != undefined) {
inset = inSet;
} else {
inset = variable.Inset;
}
const InsetValues = mode === "portrait" ? inset.portrait : inset.landscape;
let topPadder = null;
if (this.props.style[1] !== undefined) {
if (
this.props.style[1].padding !== undefined ||
this.props.style[1].paddingTop !== undefined
) {
topPadder =
(this.props.style[1].paddingTop
? this.props.style[1].paddingTop
: this.props.style[1].padding) + InsetValues.topInset;
}
} else if (
this.props.style.padding !== undefined &&
this.props.style.paddingTop !== undefined
) {
topPadder =
(this.props.style.paddingTop
? this.props.style.paddingTop
: this.props.style.padding) + InsetValues.topInset;
} else {
topPadder = InsetValues.topInset;
}
return topPadder;
} </s> remove return <View ref={c => (this._root = c)} {...this.props} />;
</s> add const variables = this.context.theme
? this.context.theme["@@shoutem.theme/themeStyle"].variables
: variable;
return variable.isIphoneX ? (
<View
ref={c => (this._root = c)}
{...this.props}
onLayout={e => this.layoutChange(e.nativeEvent.layout)}
style={[
this.props.style,
{
height: this.calculateHeight(
this.state.orientation,
variables.Inset
),
paddingBottom: this.calculatePadder(
this.state.orientation,
variables.Inset
)
}
]}
/>
) : (
<View ref={c => (this._root = c)} {...this.props} />
); | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/02488686876423d0d490d73e89587fac846ddfe3 | src/basic/Content.js |
const StyledContent = connectStyle(
"NativeBase.Content",
{},
mapPropsToStyleNames
)(Content); | <mask> enableResetScrollToCoords: PropTypes.bool,
<mask> keyboardShouldPersistTaps: PropTypes.string
<mask> };
<mask>
<mask> const StyledContent = connectStyle("NativeBase.Content", {}, mapPropsToStyleNames)(Content);
<mask>
<mask> export { StyledContent as Content };
</s> Safearea implementation for Header, footer and Content </s> remove style: PropTypes.oneOfType([PropTypes.object, PropTypes.number, PropTypes.array]),
padder: PropTypes.bool,
disableKBDismissScroll: PropTypes.bool,
enableResetScrollToCoords: PropTypes.bool,
keyboardShouldPersistTaps: PropTypes.string
</s> add style: PropTypes.oneOfType([
PropTypes.object,
PropTypes.number,
PropTypes.array
]),
padder: PropTypes.bool,
disableKBDismissScroll: PropTypes.bool,
enableResetScrollToCoords: PropTypes.bool,
keyboardShouldPersistTaps: PropTypes.string </s> remove
</s> add constructor(props) {
super(props);
this.state = {
orientation: "portrait"
};
}
layoutChange(val) {
let maxComp = Math.max(variable.deviceWidth, variable.deviceHeight);
if (val.width >= maxComp) this.setState({ orientation: "landscape" });
else {
this.setState({ orientation: "portrait" });
}
}
calculateHeight(mode, inSet) {
let inset = null;
if (inSet != undefined) {
inset = inSet;
} else {
inset = variable.Inset;
}
const InsetValues = mode === "portrait" ? inset.portrait : inset.landscape;
let oldHeight = null;
if (this.props.style.height != undefined) {
oldHeight = this.props.style.height;
} else if (this.props.style[1].height) {
oldHeight = this.props.style[1].height;
} else {
oldHeight = this.props.style[0].height;
}
let height = oldHeight + InsetValues.topInset;
return height;
}
calculatePadder(mode, inSet) {
let inset = null;
if (inSet != undefined) {
inset = inSet;
} else {
inset = variable.Inset;
}
const InsetValues = mode === "portrait" ? inset.portrait : inset.landscape;
let topPadder = null;
if (this.props.style[1] !== undefined) {
if (
this.props.style[1].padding !== undefined ||
this.props.style[1].paddingTop !== undefined
) {
topPadder =
(this.props.style[1].paddingTop
? this.props.style[1].paddingTop
: this.props.style[1].padding) + InsetValues.topInset;
}
} else if (
this.props.style.padding !== undefined &&
this.props.style.paddingTop !== undefined
) {
topPadder =
(this.props.style.paddingTop
? this.props.style.paddingTop
: this.props.style.padding) + InsetValues.topInset;
} else {
topPadder = InsetValues.topInset;
}
return topPadder;
} </s> remove render() {
return (
<KeyboardAwareScrollView
automaticallyAdjustContentInsets={false}
resetScrollToCoords={this.props.disableKBDismissScroll ? null : { x: 0, y: 0 }}
keyboardShouldPersistTaps={this.props.keyboardShouldPersistTaps ? this.props.keyboardShouldPersistTaps : 'handled'}
ref={c => {
this._scrollview = c;
this._root = c;
}}
{...this.props}
>
{this.props.children}
</KeyboardAwareScrollView>
);
}
</s> add static contextTypes = {
theme: PropTypes.object
};
constructor(props) {
super(props);
this.state = {
orientation: "portrait"
};
}
layoutChange(val) {
let maxComp = Math.max(variable.deviceWidth, variable.deviceHeight);
if (val.width >= maxComp) this.setState({ orientation: "landscape" });
else {
this.setState({ orientation: "portrait" });
}
}
calculateLeft(mode, inSet) {
let inset = null;
if (inSet !== undefined) {
inset = inSet;
} else {
inset = variable.Inset;
}
const InsetValues = mode === "portrait" ? inset.portrait : inset.landscape;
let leftPadder = null;
if (this.props.style[1] !== undefined) {
if (
this.props.style[1].padding !== undefined ||
this.props.style[1].paddingLeft !== undefined
) {
leftPadder =
(this.props.style[1].paddingLeft
? this.props.style[1].paddingLeft
: this.props.style[1].padding) + InsetValues.leftInset;
}
} else if (
this.props.style.padding !== undefined ||
this.props.style.paddingLeft !== undefined
) {
leftPadder =
(this.props.style.paddingLeft
? this.props.style.paddingLeft
: this.props.style.padding) + InsetValues.leftInset;
} else {
leftPadder = InsetValues.leftInset;
}
return leftPadder;
}
calculateRight(mode, inSet) {
let inset = null;
if (inSet !== undefined) {
inset = inSet;
} else {
inset = variable.Inset;
}
const InsetValues = mode === "portrait" ? inset.portrait : inset.landscape;
let rightPadder = null;
if (this.props.style[1] !== undefined) {
if (
this.props.style[1].padding !== undefined ||
this.props.style[1].paddingRight !== undefined
) {
rightPadder =
(this.props.style[1].paddingRight
? this.props.style[1].paddingRight
: this.props.style[1].padding) + InsetValues.rightInset;
}
} else if (
this.props.style.padding !== undefined ||
this.props.style.paddingRight !== undefined
) {
rightPadder =
(this.props.style.paddingRight
? this.props.style.paddingRight
: this.props.style.padding) + InsetValues.rightInset;
} else {
rightPadder = InsetValues.rightInset;
}
return rightPadder;
}
render() {
const variables = this.context.theme
? this.context.theme["@@shoutem.theme/themeStyle"].variables
: variable;
return variable.isIphoneX ? (
<KeyboardAwareScrollView
automaticallyAdjustContentInsets={false}
resetScrollToCoords={
this.props.disableKBDismissScroll ? null : { x: 0, y: 0 }
}
keyboardShouldPersistTaps={
this.props.keyboardShouldPersistTaps
? this.props.keyboardShouldPersistTaps
: "handled"
}
ref={c => {
this._scrollview = c;
this._root = c;
}}
{...this.props}
onLayout={e => this.layoutChange(e.nativeEvent.layout)}
style={[
this.props.style,
{
paddingLeft: this.calculateLeft(
this.state.orientation,
variables.Inset
)
}
]}
>
{this.props.children}
</KeyboardAwareScrollView>
) : (
<KeyboardAwareScrollView
automaticallyAdjustContentInsets={false}
resetScrollToCoords={
this.props.disableKBDismissScroll ? null : { x: 0, y: 0 }
}
keyboardShouldPersistTaps={
this.props.keyboardShouldPersistTaps
? this.props.keyboardShouldPersistTaps
: "handled"
}
ref={c => {
this._scrollview = c;
this._root = c;
}}
{...this.props}
>
{this.props.children}
</KeyboardAwareScrollView>
);
} </s> remove alignSelf: "flex-start",
</s> add alignSelf: "flex-start" | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/02488686876423d0d490d73e89587fac846ddfe3 | src/basic/Content.js |
import variable from "../theme/variables/platform"; | <mask> import PropTypes from "prop-types";
<mask> import { View, ViewPropTypes } from "react-native";
<mask> import _ from "lodash";
<mask> import { connectStyle } from "native-base-shoutem-theme";
<mask> import mapPropsToStyleNames from "../Utils/mapPropsToStyleNames";
<mask>
<mask> class Footer extends Component {
<mask> static contextTypes = {
</s> Safearea implementation for Header, footer and Content </s> remove return <View ref={c => (this._root = c)} {...this.props} />;
</s> add const variables = this.context.theme
? this.context.theme["@@shoutem.theme/themeStyle"].variables
: variable;
return variable.isIphoneX ? (
<View
ref={c => (this._root = c)}
{...this.props}
onLayout={e => this.layoutChange(e.nativeEvent.layout)}
style={[
this.props.style,
{
height: this.calculateHeight(
this.state.orientation,
variables.Inset
),
paddingBottom: this.calculatePadder(
this.state.orientation,
variables.Inset
)
}
]}
/>
) : (
<View ref={c => (this._root = c)} {...this.props} />
); </s> remove render() {
return (
<KeyboardAwareScrollView
automaticallyAdjustContentInsets={false}
resetScrollToCoords={this.props.disableKBDismissScroll ? null : { x: 0, y: 0 }}
keyboardShouldPersistTaps={this.props.keyboardShouldPersistTaps ? this.props.keyboardShouldPersistTaps : 'handled'}
ref={c => {
this._scrollview = c;
this._root = c;
}}
{...this.props}
>
{this.props.children}
</KeyboardAwareScrollView>
);
}
</s> add static contextTypes = {
theme: PropTypes.object
};
constructor(props) {
super(props);
this.state = {
orientation: "portrait"
};
}
layoutChange(val) {
let maxComp = Math.max(variable.deviceWidth, variable.deviceHeight);
if (val.width >= maxComp) this.setState({ orientation: "landscape" });
else {
this.setState({ orientation: "portrait" });
}
}
calculateLeft(mode, inSet) {
let inset = null;
if (inSet !== undefined) {
inset = inSet;
} else {
inset = variable.Inset;
}
const InsetValues = mode === "portrait" ? inset.portrait : inset.landscape;
let leftPadder = null;
if (this.props.style[1] !== undefined) {
if (
this.props.style[1].padding !== undefined ||
this.props.style[1].paddingLeft !== undefined
) {
leftPadder =
(this.props.style[1].paddingLeft
? this.props.style[1].paddingLeft
: this.props.style[1].padding) + InsetValues.leftInset;
}
} else if (
this.props.style.padding !== undefined ||
this.props.style.paddingLeft !== undefined
) {
leftPadder =
(this.props.style.paddingLeft
? this.props.style.paddingLeft
: this.props.style.padding) + InsetValues.leftInset;
} else {
leftPadder = InsetValues.leftInset;
}
return leftPadder;
}
calculateRight(mode, inSet) {
let inset = null;
if (inSet !== undefined) {
inset = inSet;
} else {
inset = variable.Inset;
}
const InsetValues = mode === "portrait" ? inset.portrait : inset.landscape;
let rightPadder = null;
if (this.props.style[1] !== undefined) {
if (
this.props.style[1].padding !== undefined ||
this.props.style[1].paddingRight !== undefined
) {
rightPadder =
(this.props.style[1].paddingRight
? this.props.style[1].paddingRight
: this.props.style[1].padding) + InsetValues.rightInset;
}
} else if (
this.props.style.padding !== undefined ||
this.props.style.paddingRight !== undefined
) {
rightPadder =
(this.props.style.paddingRight
? this.props.style.paddingRight
: this.props.style.padding) + InsetValues.rightInset;
} else {
rightPadder = InsetValues.rightInset;
}
return rightPadder;
}
render() {
const variables = this.context.theme
? this.context.theme["@@shoutem.theme/themeStyle"].variables
: variable;
return variable.isIphoneX ? (
<KeyboardAwareScrollView
automaticallyAdjustContentInsets={false}
resetScrollToCoords={
this.props.disableKBDismissScroll ? null : { x: 0, y: 0 }
}
keyboardShouldPersistTaps={
this.props.keyboardShouldPersistTaps
? this.props.keyboardShouldPersistTaps
: "handled"
}
ref={c => {
this._scrollview = c;
this._root = c;
}}
{...this.props}
onLayout={e => this.layoutChange(e.nativeEvent.layout)}
style={[
this.props.style,
{
paddingLeft: this.calculateLeft(
this.state.orientation,
variables.Inset
)
}
]}
>
{this.props.children}
</KeyboardAwareScrollView>
) : (
<KeyboardAwareScrollView
automaticallyAdjustContentInsets={false}
resetScrollToCoords={
this.props.disableKBDismissScroll ? null : { x: 0, y: 0 }
}
keyboardShouldPersistTaps={
this.props.keyboardShouldPersistTaps
? this.props.keyboardShouldPersistTaps
: "handled"
}
ref={c => {
this._scrollview = c;
this._root = c;
}}
{...this.props}
>
{this.props.children}
</KeyboardAwareScrollView>
);
} </s> remove
</s> add constructor(props) {
super(props);
this.state = {
orientation: "portrait"
};
}
layoutChange(val) {
let maxComp = Math.max(variable.deviceWidth, variable.deviceHeight);
if (val.width >= maxComp) this.setState({ orientation: "landscape" });
else {
this.setState({ orientation: "portrait" });
}
}
calculateHeight(mode, inSet) {
let inset = null;
if (inSet != undefined) {
inset = inSet;
} else {
inset = variable.Inset;
}
const InsetValues = mode === "portrait" ? inset.portrait : inset.landscape;
let oldHeight = null;
if (this.props.style.height != undefined) {
oldHeight = this.props.style.height;
} else if (this.props.style[1].height) {
oldHeight = this.props.style[1].height;
} else {
oldHeight = this.props.style[0].height;
}
let height = oldHeight + InsetValues.topInset;
return height;
}
calculatePadder(mode, inSet) {
let inset = null;
if (inSet != undefined) {
inset = inSet;
} else {
inset = variable.Inset;
}
const InsetValues = mode === "portrait" ? inset.portrait : inset.landscape;
let topPadder = null;
if (this.props.style[1] !== undefined) {
if (
this.props.style[1].padding !== undefined ||
this.props.style[1].paddingTop !== undefined
) {
topPadder =
(this.props.style[1].paddingTop
? this.props.style[1].paddingTop
: this.props.style[1].padding) + InsetValues.topInset;
}
} else if (
this.props.style.padding !== undefined &&
this.props.style.paddingTop !== undefined
) {
topPadder =
(this.props.style.paddingTop
? this.props.style.paddingTop
: this.props.style.padding) + InsetValues.topInset;
} else {
topPadder = InsetValues.topInset;
}
return topPadder;
} </s> remove const StyledContent = connectStyle("NativeBase.Content", {}, mapPropsToStyleNames)(Content);
</s> add const StyledContent = connectStyle(
"NativeBase.Content",
{},
mapPropsToStyleNames
)(Content); | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/02488686876423d0d490d73e89587fac846ddfe3 | src/basic/Footer.js |
const variables = this.context.theme
? this.context.theme["@@shoutem.theme/themeStyle"].variables
: variable;
return variable.isIphoneX ? (
<View
ref={c => (this._root = c)}
{...this.props}
onLayout={e => this.layoutChange(e.nativeEvent.layout)}
style={[
this.props.style,
{
height: this.calculateHeight(
this.state.orientation,
variables.Inset
),
paddingBottom: this.calculatePadder(
this.state.orientation,
variables.Inset
)
}
]}
/>
) : (
<View ref={c => (this._root = c)} {...this.props} />
); | <mask> import mapPropsToStyleNames from "../Utils/mapPropsToStyleNames";
<mask>
<mask> class Footer extends Component {
<mask> render() {
<mask> return <View ref={c => (this._root = c)} {...this.props} />;
<mask> }
<mask> }
<mask>
<mask> Footer.propTypes = {
<mask> ...ViewPropTypes,
</s> Safearea implementation for Header, footer and Content </s> remove <View ref={c => (this._root = c)} {...this.props} />
</s> add {variable.isIphoneX ? (
<View
ref={c => (this._root = c)}
{...this.props}
style={[
this.props.style,
{
height: this.calculateHeight(
this.state.orientation,
variables.Inset
),
paddingTop: this.calculatePadder(
this.state.orientation,
variables.Inset
)
}
]}
/>
) : (
<View ref={c => (this._root = c)} {...this.props} />
)} </s> remove render() {
return (
<KeyboardAwareScrollView
automaticallyAdjustContentInsets={false}
resetScrollToCoords={this.props.disableKBDismissScroll ? null : { x: 0, y: 0 }}
keyboardShouldPersistTaps={this.props.keyboardShouldPersistTaps ? this.props.keyboardShouldPersistTaps : 'handled'}
ref={c => {
this._scrollview = c;
this._root = c;
}}
{...this.props}
>
{this.props.children}
</KeyboardAwareScrollView>
);
}
</s> add static contextTypes = {
theme: PropTypes.object
};
constructor(props) {
super(props);
this.state = {
orientation: "portrait"
};
}
layoutChange(val) {
let maxComp = Math.max(variable.deviceWidth, variable.deviceHeight);
if (val.width >= maxComp) this.setState({ orientation: "landscape" });
else {
this.setState({ orientation: "portrait" });
}
}
calculateLeft(mode, inSet) {
let inset = null;
if (inSet !== undefined) {
inset = inSet;
} else {
inset = variable.Inset;
}
const InsetValues = mode === "portrait" ? inset.portrait : inset.landscape;
let leftPadder = null;
if (this.props.style[1] !== undefined) {
if (
this.props.style[1].padding !== undefined ||
this.props.style[1].paddingLeft !== undefined
) {
leftPadder =
(this.props.style[1].paddingLeft
? this.props.style[1].paddingLeft
: this.props.style[1].padding) + InsetValues.leftInset;
}
} else if (
this.props.style.padding !== undefined ||
this.props.style.paddingLeft !== undefined
) {
leftPadder =
(this.props.style.paddingLeft
? this.props.style.paddingLeft
: this.props.style.padding) + InsetValues.leftInset;
} else {
leftPadder = InsetValues.leftInset;
}
return leftPadder;
}
calculateRight(mode, inSet) {
let inset = null;
if (inSet !== undefined) {
inset = inSet;
} else {
inset = variable.Inset;
}
const InsetValues = mode === "portrait" ? inset.portrait : inset.landscape;
let rightPadder = null;
if (this.props.style[1] !== undefined) {
if (
this.props.style[1].padding !== undefined ||
this.props.style[1].paddingRight !== undefined
) {
rightPadder =
(this.props.style[1].paddingRight
? this.props.style[1].paddingRight
: this.props.style[1].padding) + InsetValues.rightInset;
}
} else if (
this.props.style.padding !== undefined ||
this.props.style.paddingRight !== undefined
) {
rightPadder =
(this.props.style.paddingRight
? this.props.style.paddingRight
: this.props.style.padding) + InsetValues.rightInset;
} else {
rightPadder = InsetValues.rightInset;
}
return rightPadder;
}
render() {
const variables = this.context.theme
? this.context.theme["@@shoutem.theme/themeStyle"].variables
: variable;
return variable.isIphoneX ? (
<KeyboardAwareScrollView
automaticallyAdjustContentInsets={false}
resetScrollToCoords={
this.props.disableKBDismissScroll ? null : { x: 0, y: 0 }
}
keyboardShouldPersistTaps={
this.props.keyboardShouldPersistTaps
? this.props.keyboardShouldPersistTaps
: "handled"
}
ref={c => {
this._scrollview = c;
this._root = c;
}}
{...this.props}
onLayout={e => this.layoutChange(e.nativeEvent.layout)}
style={[
this.props.style,
{
paddingLeft: this.calculateLeft(
this.state.orientation,
variables.Inset
)
}
]}
>
{this.props.children}
</KeyboardAwareScrollView>
) : (
<KeyboardAwareScrollView
automaticallyAdjustContentInsets={false}
resetScrollToCoords={
this.props.disableKBDismissScroll ? null : { x: 0, y: 0 }
}
keyboardShouldPersistTaps={
this.props.keyboardShouldPersistTaps
? this.props.keyboardShouldPersistTaps
: "handled"
}
ref={c => {
this._scrollview = c;
this._root = c;
}}
{...this.props}
>
{this.props.children}
</KeyboardAwareScrollView>
);
} </s> remove
</s> add constructor(props) {
super(props);
this.state = {
orientation: "portrait"
};
}
layoutChange(val) {
let maxComp = Math.max(variable.deviceWidth, variable.deviceHeight);
if (val.width >= maxComp) this.setState({ orientation: "landscape" });
else {
this.setState({ orientation: "portrait" });
}
}
calculateHeight(mode, inSet) {
let inset = null;
if (inSet != undefined) {
inset = inSet;
} else {
inset = variable.Inset;
}
const InsetValues = mode === "portrait" ? inset.portrait : inset.landscape;
let oldHeight = null;
if (this.props.style.height != undefined) {
oldHeight = this.props.style.height;
} else if (this.props.style[1].height) {
oldHeight = this.props.style[1].height;
} else {
oldHeight = this.props.style[0].height;
}
let height = oldHeight + InsetValues.topInset;
return height;
}
calculatePadder(mode, inSet) {
let inset = null;
if (inSet != undefined) {
inset = inSet;
} else {
inset = variable.Inset;
}
const InsetValues = mode === "portrait" ? inset.portrait : inset.landscape;
let topPadder = null;
if (this.props.style[1] !== undefined) {
if (
this.props.style[1].padding !== undefined ||
this.props.style[1].paddingTop !== undefined
) {
topPadder =
(this.props.style[1].paddingTop
? this.props.style[1].paddingTop
: this.props.style[1].padding) + InsetValues.topInset;
}
} else if (
this.props.style.padding !== undefined &&
this.props.style.paddingTop !== undefined
) {
topPadder =
(this.props.style.paddingTop
? this.props.style.paddingTop
: this.props.style.padding) + InsetValues.topInset;
} else {
topPadder = InsetValues.topInset;
}
return topPadder;
} | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/02488686876423d0d490d73e89587fac846ddfe3 | src/basic/Footer.js |
constructor(props) {
super(props);
this.state = {
orientation: "portrait"
};
}
layoutChange(val) {
let maxComp = Math.max(variable.deviceWidth, variable.deviceHeight);
if (val.width >= maxComp) this.setState({ orientation: "landscape" });
else {
this.setState({ orientation: "portrait" });
}
}
calculateHeight(mode, inSet) {
let inset = null;
if (inSet != undefined) {
inset = inSet;
} else {
inset = variable.Inset;
}
const InsetValues = mode === "portrait" ? inset.portrait : inset.landscape;
let oldHeight = null;
if (this.props.style.height != undefined) {
oldHeight = this.props.style.height;
} else if (this.props.style[1].height) {
oldHeight = this.props.style[1].height;
} else {
oldHeight = this.props.style[0].height;
}
let height = oldHeight + InsetValues.topInset;
return height;
}
calculatePadder(mode, inSet) {
let inset = null;
if (inSet != undefined) {
inset = inSet;
} else {
inset = variable.Inset;
}
const InsetValues = mode === "portrait" ? inset.portrait : inset.landscape;
let topPadder = null;
if (this.props.style[1] !== undefined) {
if (
this.props.style[1].padding !== undefined ||
this.props.style[1].paddingTop !== undefined
) {
topPadder =
(this.props.style[1].paddingTop
? this.props.style[1].paddingTop
: this.props.style[1].padding) + InsetValues.topInset;
}
} else if (
this.props.style.padding !== undefined &&
this.props.style.paddingTop !== undefined
) {
topPadder =
(this.props.style.paddingTop
? this.props.style.paddingTop
: this.props.style.padding) + InsetValues.topInset;
} else {
topPadder = InsetValues.topInset;
}
return topPadder;
} | <mask> class Header extends Component {
<mask> static contextTypes = {
<mask> theme: PropTypes.object
<mask> };
<mask>
<mask> render() {
<mask> const variables = this.context.theme
<mask> ? this.context.theme["@@shoutem.theme/themeStyle"].variables
<mask> : variable;
<mask> const platformStyle = variables.platformStyle;
</s> Safearea implementation for Header, footer and Content </s> remove return <View ref={c => (this._root = c)} {...this.props} />;
</s> add const variables = this.context.theme
? this.context.theme["@@shoutem.theme/themeStyle"].variables
: variable;
return variable.isIphoneX ? (
<View
ref={c => (this._root = c)}
{...this.props}
onLayout={e => this.layoutChange(e.nativeEvent.layout)}
style={[
this.props.style,
{
height: this.calculateHeight(
this.state.orientation,
variables.Inset
),
paddingBottom: this.calculatePadder(
this.state.orientation,
variables.Inset
)
}
]}
/>
) : (
<View ref={c => (this._root = c)} {...this.props} />
); </s> remove render() {
return (
<KeyboardAwareScrollView
automaticallyAdjustContentInsets={false}
resetScrollToCoords={this.props.disableKBDismissScroll ? null : { x: 0, y: 0 }}
keyboardShouldPersistTaps={this.props.keyboardShouldPersistTaps ? this.props.keyboardShouldPersistTaps : 'handled'}
ref={c => {
this._scrollview = c;
this._root = c;
}}
{...this.props}
>
{this.props.children}
</KeyboardAwareScrollView>
);
}
</s> add static contextTypes = {
theme: PropTypes.object
};
constructor(props) {
super(props);
this.state = {
orientation: "portrait"
};
}
layoutChange(val) {
let maxComp = Math.max(variable.deviceWidth, variable.deviceHeight);
if (val.width >= maxComp) this.setState({ orientation: "landscape" });
else {
this.setState({ orientation: "portrait" });
}
}
calculateLeft(mode, inSet) {
let inset = null;
if (inSet !== undefined) {
inset = inSet;
} else {
inset = variable.Inset;
}
const InsetValues = mode === "portrait" ? inset.portrait : inset.landscape;
let leftPadder = null;
if (this.props.style[1] !== undefined) {
if (
this.props.style[1].padding !== undefined ||
this.props.style[1].paddingLeft !== undefined
) {
leftPadder =
(this.props.style[1].paddingLeft
? this.props.style[1].paddingLeft
: this.props.style[1].padding) + InsetValues.leftInset;
}
} else if (
this.props.style.padding !== undefined ||
this.props.style.paddingLeft !== undefined
) {
leftPadder =
(this.props.style.paddingLeft
? this.props.style.paddingLeft
: this.props.style.padding) + InsetValues.leftInset;
} else {
leftPadder = InsetValues.leftInset;
}
return leftPadder;
}
calculateRight(mode, inSet) {
let inset = null;
if (inSet !== undefined) {
inset = inSet;
} else {
inset = variable.Inset;
}
const InsetValues = mode === "portrait" ? inset.portrait : inset.landscape;
let rightPadder = null;
if (this.props.style[1] !== undefined) {
if (
this.props.style[1].padding !== undefined ||
this.props.style[1].paddingRight !== undefined
) {
rightPadder =
(this.props.style[1].paddingRight
? this.props.style[1].paddingRight
: this.props.style[1].padding) + InsetValues.rightInset;
}
} else if (
this.props.style.padding !== undefined ||
this.props.style.paddingRight !== undefined
) {
rightPadder =
(this.props.style.paddingRight
? this.props.style.paddingRight
: this.props.style.padding) + InsetValues.rightInset;
} else {
rightPadder = InsetValues.rightInset;
}
return rightPadder;
}
render() {
const variables = this.context.theme
? this.context.theme["@@shoutem.theme/themeStyle"].variables
: variable;
return variable.isIphoneX ? (
<KeyboardAwareScrollView
automaticallyAdjustContentInsets={false}
resetScrollToCoords={
this.props.disableKBDismissScroll ? null : { x: 0, y: 0 }
}
keyboardShouldPersistTaps={
this.props.keyboardShouldPersistTaps
? this.props.keyboardShouldPersistTaps
: "handled"
}
ref={c => {
this._scrollview = c;
this._root = c;
}}
{...this.props}
onLayout={e => this.layoutChange(e.nativeEvent.layout)}
style={[
this.props.style,
{
paddingLeft: this.calculateLeft(
this.state.orientation,
variables.Inset
)
}
]}
>
{this.props.children}
</KeyboardAwareScrollView>
) : (
<KeyboardAwareScrollView
automaticallyAdjustContentInsets={false}
resetScrollToCoords={
this.props.disableKBDismissScroll ? null : { x: 0, y: 0 }
}
keyboardShouldPersistTaps={
this.props.keyboardShouldPersistTaps
? this.props.keyboardShouldPersistTaps
: "handled"
}
ref={c => {
this._scrollview = c;
this._root = c;
}}
{...this.props}
>
{this.props.children}
</KeyboardAwareScrollView>
);
} </s> remove <View>
</s> add <View onLayout={e => this.layoutChange(e.nativeEvent.layout)}> | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/02488686876423d0d490d73e89587fac846ddfe3 | src/basic/Header.js |
<View onLayout={e => this.layoutChange(e.nativeEvent.layout)}> | <mask> : variable;
<mask> const platformStyle = variables.platformStyle;
<mask>
<mask> return (
<mask> <View>
<mask> <StatusBar
<mask> backgroundColor={
<mask> this.props.androidStatusBarColor
<mask> ? this.props.androidStatusBarColor
<mask> : variables.statusBarColor
</s> Safearea implementation for Header, footer and Content </s> remove return <View ref={c => (this._root = c)} {...this.props} />;
</s> add const variables = this.context.theme
? this.context.theme["@@shoutem.theme/themeStyle"].variables
: variable;
return variable.isIphoneX ? (
<View
ref={c => (this._root = c)}
{...this.props}
onLayout={e => this.layoutChange(e.nativeEvent.layout)}
style={[
this.props.style,
{
height: this.calculateHeight(
this.state.orientation,
variables.Inset
),
paddingBottom: this.calculatePadder(
this.state.orientation,
variables.Inset
)
}
]}
/>
) : (
<View ref={c => (this._root = c)} {...this.props} />
); </s> remove
</s> add constructor(props) {
super(props);
this.state = {
orientation: "portrait"
};
}
layoutChange(val) {
let maxComp = Math.max(variable.deviceWidth, variable.deviceHeight);
if (val.width >= maxComp) this.setState({ orientation: "landscape" });
else {
this.setState({ orientation: "portrait" });
}
}
calculateHeight(mode, inSet) {
let inset = null;
if (inSet != undefined) {
inset = inSet;
} else {
inset = variable.Inset;
}
const InsetValues = mode === "portrait" ? inset.portrait : inset.landscape;
let oldHeight = null;
if (this.props.style.height != undefined) {
oldHeight = this.props.style.height;
} else if (this.props.style[1].height) {
oldHeight = this.props.style[1].height;
} else {
oldHeight = this.props.style[0].height;
}
let height = oldHeight + InsetValues.topInset;
return height;
}
calculatePadder(mode, inSet) {
let inset = null;
if (inSet != undefined) {
inset = inSet;
} else {
inset = variable.Inset;
}
const InsetValues = mode === "portrait" ? inset.portrait : inset.landscape;
let topPadder = null;
if (this.props.style[1] !== undefined) {
if (
this.props.style[1].padding !== undefined ||
this.props.style[1].paddingTop !== undefined
) {
topPadder =
(this.props.style[1].paddingTop
? this.props.style[1].paddingTop
: this.props.style[1].padding) + InsetValues.topInset;
}
} else if (
this.props.style.padding !== undefined &&
this.props.style.paddingTop !== undefined
) {
topPadder =
(this.props.style.paddingTop
? this.props.style.paddingTop
: this.props.style.padding) + InsetValues.topInset;
} else {
topPadder = InsetValues.topInset;
}
return topPadder;
} </s> remove render() {
return (
<KeyboardAwareScrollView
automaticallyAdjustContentInsets={false}
resetScrollToCoords={this.props.disableKBDismissScroll ? null : { x: 0, y: 0 }}
keyboardShouldPersistTaps={this.props.keyboardShouldPersistTaps ? this.props.keyboardShouldPersistTaps : 'handled'}
ref={c => {
this._scrollview = c;
this._root = c;
}}
{...this.props}
>
{this.props.children}
</KeyboardAwareScrollView>
);
}
</s> add static contextTypes = {
theme: PropTypes.object
};
constructor(props) {
super(props);
this.state = {
orientation: "portrait"
};
}
layoutChange(val) {
let maxComp = Math.max(variable.deviceWidth, variable.deviceHeight);
if (val.width >= maxComp) this.setState({ orientation: "landscape" });
else {
this.setState({ orientation: "portrait" });
}
}
calculateLeft(mode, inSet) {
let inset = null;
if (inSet !== undefined) {
inset = inSet;
} else {
inset = variable.Inset;
}
const InsetValues = mode === "portrait" ? inset.portrait : inset.landscape;
let leftPadder = null;
if (this.props.style[1] !== undefined) {
if (
this.props.style[1].padding !== undefined ||
this.props.style[1].paddingLeft !== undefined
) {
leftPadder =
(this.props.style[1].paddingLeft
? this.props.style[1].paddingLeft
: this.props.style[1].padding) + InsetValues.leftInset;
}
} else if (
this.props.style.padding !== undefined ||
this.props.style.paddingLeft !== undefined
) {
leftPadder =
(this.props.style.paddingLeft
? this.props.style.paddingLeft
: this.props.style.padding) + InsetValues.leftInset;
} else {
leftPadder = InsetValues.leftInset;
}
return leftPadder;
}
calculateRight(mode, inSet) {
let inset = null;
if (inSet !== undefined) {
inset = inSet;
} else {
inset = variable.Inset;
}
const InsetValues = mode === "portrait" ? inset.portrait : inset.landscape;
let rightPadder = null;
if (this.props.style[1] !== undefined) {
if (
this.props.style[1].padding !== undefined ||
this.props.style[1].paddingRight !== undefined
) {
rightPadder =
(this.props.style[1].paddingRight
? this.props.style[1].paddingRight
: this.props.style[1].padding) + InsetValues.rightInset;
}
} else if (
this.props.style.padding !== undefined ||
this.props.style.paddingRight !== undefined
) {
rightPadder =
(this.props.style.paddingRight
? this.props.style.paddingRight
: this.props.style.padding) + InsetValues.rightInset;
} else {
rightPadder = InsetValues.rightInset;
}
return rightPadder;
}
render() {
const variables = this.context.theme
? this.context.theme["@@shoutem.theme/themeStyle"].variables
: variable;
return variable.isIphoneX ? (
<KeyboardAwareScrollView
automaticallyAdjustContentInsets={false}
resetScrollToCoords={
this.props.disableKBDismissScroll ? null : { x: 0, y: 0 }
}
keyboardShouldPersistTaps={
this.props.keyboardShouldPersistTaps
? this.props.keyboardShouldPersistTaps
: "handled"
}
ref={c => {
this._scrollview = c;
this._root = c;
}}
{...this.props}
onLayout={e => this.layoutChange(e.nativeEvent.layout)}
style={[
this.props.style,
{
paddingLeft: this.calculateLeft(
this.state.orientation,
variables.Inset
)
}
]}
>
{this.props.children}
</KeyboardAwareScrollView>
) : (
<KeyboardAwareScrollView
automaticallyAdjustContentInsets={false}
resetScrollToCoords={
this.props.disableKBDismissScroll ? null : { x: 0, y: 0 }
}
keyboardShouldPersistTaps={
this.props.keyboardShouldPersistTaps
? this.props.keyboardShouldPersistTaps
: "handled"
}
ref={c => {
this._scrollview = c;
this._root = c;
}}
{...this.props}
>
{this.props.children}
</KeyboardAwareScrollView>
);
} </s> remove paddingTop: platform === "ios" ? (variables.isIphoneX ? 39 : 15) : 0,
borderBottomWidth: platform === "ios" ? 1 / PixelRatio.getPixelSizeForLayoutSize(1) : 0,
</s> add paddingTop: platform === "ios" ? 15 : 0,
borderBottomWidth:
platform === "ios" ? 1 / PixelRatio.getPixelSizeForLayoutSize(1) : 0, </s> remove <View ref={c => (this._root = c)} {...this.props} />
</s> add {variable.isIphoneX ? (
<View
ref={c => (this._root = c)}
{...this.props}
style={[
this.props.style,
{
height: this.calculateHeight(
this.state.orientation,
variables.Inset
),
paddingTop: this.calculatePadder(
this.state.orientation,
variables.Inset
)
}
]}
/>
) : (
<View ref={c => (this._root = c)} {...this.props} />
)} | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/02488686876423d0d490d73e89587fac846ddfe3 | src/basic/Header.js |
{variable.isIphoneX ? (
<View
ref={c => (this._root = c)}
{...this.props}
style={[
this.props.style,
{
height: this.calculateHeight(
this.state.orientation,
variables.Inset
),
paddingTop: this.calculatePadder(
this.state.orientation,
variables.Inset
)
}
]}
/>
) : (
<View ref={c => (this._root = c)} {...this.props} />
)} | <mask> ? "light-content"
<mask> : variables.iosStatusbar
<mask> }
<mask> />
<mask> <View ref={c => (this._root = c)} {...this.props} />
<mask> </View>
<mask> );
<mask> }
<mask> }
<mask>
</s> Safearea implementation for Header, footer and Content </s> remove return <View ref={c => (this._root = c)} {...this.props} />;
</s> add const variables = this.context.theme
? this.context.theme["@@shoutem.theme/themeStyle"].variables
: variable;
return variable.isIphoneX ? (
<View
ref={c => (this._root = c)}
{...this.props}
onLayout={e => this.layoutChange(e.nativeEvent.layout)}
style={[
this.props.style,
{
height: this.calculateHeight(
this.state.orientation,
variables.Inset
),
paddingBottom: this.calculatePadder(
this.state.orientation,
variables.Inset
)
}
]}
/>
) : (
<View ref={c => (this._root = c)} {...this.props} />
); </s> remove render() {
return (
<KeyboardAwareScrollView
automaticallyAdjustContentInsets={false}
resetScrollToCoords={this.props.disableKBDismissScroll ? null : { x: 0, y: 0 }}
keyboardShouldPersistTaps={this.props.keyboardShouldPersistTaps ? this.props.keyboardShouldPersistTaps : 'handled'}
ref={c => {
this._scrollview = c;
this._root = c;
}}
{...this.props}
>
{this.props.children}
</KeyboardAwareScrollView>
);
}
</s> add static contextTypes = {
theme: PropTypes.object
};
constructor(props) {
super(props);
this.state = {
orientation: "portrait"
};
}
layoutChange(val) {
let maxComp = Math.max(variable.deviceWidth, variable.deviceHeight);
if (val.width >= maxComp) this.setState({ orientation: "landscape" });
else {
this.setState({ orientation: "portrait" });
}
}
calculateLeft(mode, inSet) {
let inset = null;
if (inSet !== undefined) {
inset = inSet;
} else {
inset = variable.Inset;
}
const InsetValues = mode === "portrait" ? inset.portrait : inset.landscape;
let leftPadder = null;
if (this.props.style[1] !== undefined) {
if (
this.props.style[1].padding !== undefined ||
this.props.style[1].paddingLeft !== undefined
) {
leftPadder =
(this.props.style[1].paddingLeft
? this.props.style[1].paddingLeft
: this.props.style[1].padding) + InsetValues.leftInset;
}
} else if (
this.props.style.padding !== undefined ||
this.props.style.paddingLeft !== undefined
) {
leftPadder =
(this.props.style.paddingLeft
? this.props.style.paddingLeft
: this.props.style.padding) + InsetValues.leftInset;
} else {
leftPadder = InsetValues.leftInset;
}
return leftPadder;
}
calculateRight(mode, inSet) {
let inset = null;
if (inSet !== undefined) {
inset = inSet;
} else {
inset = variable.Inset;
}
const InsetValues = mode === "portrait" ? inset.portrait : inset.landscape;
let rightPadder = null;
if (this.props.style[1] !== undefined) {
if (
this.props.style[1].padding !== undefined ||
this.props.style[1].paddingRight !== undefined
) {
rightPadder =
(this.props.style[1].paddingRight
? this.props.style[1].paddingRight
: this.props.style[1].padding) + InsetValues.rightInset;
}
} else if (
this.props.style.padding !== undefined ||
this.props.style.paddingRight !== undefined
) {
rightPadder =
(this.props.style.paddingRight
? this.props.style.paddingRight
: this.props.style.padding) + InsetValues.rightInset;
} else {
rightPadder = InsetValues.rightInset;
}
return rightPadder;
}
render() {
const variables = this.context.theme
? this.context.theme["@@shoutem.theme/themeStyle"].variables
: variable;
return variable.isIphoneX ? (
<KeyboardAwareScrollView
automaticallyAdjustContentInsets={false}
resetScrollToCoords={
this.props.disableKBDismissScroll ? null : { x: 0, y: 0 }
}
keyboardShouldPersistTaps={
this.props.keyboardShouldPersistTaps
? this.props.keyboardShouldPersistTaps
: "handled"
}
ref={c => {
this._scrollview = c;
this._root = c;
}}
{...this.props}
onLayout={e => this.layoutChange(e.nativeEvent.layout)}
style={[
this.props.style,
{
paddingLeft: this.calculateLeft(
this.state.orientation,
variables.Inset
)
}
]}
>
{this.props.children}
</KeyboardAwareScrollView>
) : (
<KeyboardAwareScrollView
automaticallyAdjustContentInsets={false}
resetScrollToCoords={
this.props.disableKBDismissScroll ? null : { x: 0, y: 0 }
}
keyboardShouldPersistTaps={
this.props.keyboardShouldPersistTaps
? this.props.keyboardShouldPersistTaps
: "handled"
}
ref={c => {
this._scrollview = c;
this._root = c;
}}
{...this.props}
>
{this.props.children}
</KeyboardAwareScrollView>
);
} </s> remove <View>
</s> add <View onLayout={e => this.layoutChange(e.nativeEvent.layout)}> </s> remove
</s> add constructor(props) {
super(props);
this.state = {
orientation: "portrait"
};
}
layoutChange(val) {
let maxComp = Math.max(variable.deviceWidth, variable.deviceHeight);
if (val.width >= maxComp) this.setState({ orientation: "landscape" });
else {
this.setState({ orientation: "portrait" });
}
}
calculateHeight(mode, inSet) {
let inset = null;
if (inSet != undefined) {
inset = inSet;
} else {
inset = variable.Inset;
}
const InsetValues = mode === "portrait" ? inset.portrait : inset.landscape;
let oldHeight = null;
if (this.props.style.height != undefined) {
oldHeight = this.props.style.height;
} else if (this.props.style[1].height) {
oldHeight = this.props.style[1].height;
} else {
oldHeight = this.props.style[0].height;
}
let height = oldHeight + InsetValues.topInset;
return height;
}
calculatePadder(mode, inSet) {
let inset = null;
if (inSet != undefined) {
inset = inSet;
} else {
inset = variable.Inset;
}
const InsetValues = mode === "portrait" ? inset.portrait : inset.landscape;
let topPadder = null;
if (this.props.style[1] !== undefined) {
if (
this.props.style[1].padding !== undefined ||
this.props.style[1].paddingTop !== undefined
) {
topPadder =
(this.props.style[1].paddingTop
? this.props.style[1].paddingTop
: this.props.style[1].padding) + InsetValues.topInset;
}
} else if (
this.props.style.padding !== undefined &&
this.props.style.paddingTop !== undefined
) {
topPadder =
(this.props.style.paddingTop
? this.props.style.paddingTop
: this.props.style.padding) + InsetValues.topInset;
} else {
topPadder = InsetValues.topInset;
}
return topPadder;
} </s> remove backgroundColor: Platform.OS === "android"
? variables.tabActiveBgColor
: undefined,
</s> add backgroundColor:
Platform.OS === "android" ? variables.tabActiveBgColor : undefined, | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/02488686876423d0d490d73e89587fac846ddfe3 | src/basic/Header.js |
height: variables.footerHeight, | <mask> shadowRadius: null,
<mask> shadowOpacity: null,
<mask> alignSelf: "center",
<mask> flex: 1,
<mask> height: (variables.footerHeight - (variables.isIphoneX ? 34 : 0)),
<mask> justifyContent: "center",
<mask> ".badge": {
<mask> "NativeBase.Badge": {
<mask> "NativeBase.Text": {
<mask> fontSize: 11,
</s> Safearea implementation for Header, footer and Content </s> remove flex: 0.3,
</s> add flex: 0.3 </s> remove shadowOpacity: null,
</s> add shadowOpacity: null </s> remove borderBottomWidth: null,
</s> add borderBottomWidth: null </s> remove height: variables.searchBarInputHeight,
</s> add height: variables.searchBarInputHeight </s> remove alignSelf: "center",
</s> add alignSelf: "center" | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/02488686876423d0d490d73e89587fac846ddfe3 | src/theme/components/FooterTab.js |
backgroundColor:
Platform.OS === "android" ? variables.tabActiveBgColor : undefined, | <mask> fontSize: variables.tabBarTextSize,
<mask> lineHeight: 16
<mask> }
<mask> },
<mask> backgroundColor: Platform.OS === "android"
<mask> ? variables.tabActiveBgColor
<mask> : undefined,
<mask> flexDirection: "row",
<mask> justifyContent: "space-between",
<mask> flex: 1,
<mask> alignSelf: "stretch"
<mask> };
</s> Safearea implementation for Header, footer and Content </s> remove justifyContent: "flex-end",
</s> add justifyContent: "flex-end" </s> remove paddingTop: platform === "ios" ? (variables.isIphoneX ? 39 : 15) : 0,
borderBottomWidth: platform === "ios" ? 1 / PixelRatio.getPixelSizeForLayoutSize(1) : 0,
</s> add paddingTop: platform === "ios" ? 15 : 0,
borderBottomWidth:
platform === "ios" ? 1 / PixelRatio.getPixelSizeForLayoutSize(1) : 0, </s> remove alignItems: platform === "ios" && platformStyle !== "material" ? "center" : "flex-start",
</s> add alignItems:
platform === "ios" && platformStyle !== "material"
? "center"
: "flex-start", </s> remove height: variables.searchBarInputHeight,
</s> add height: variables.searchBarInputHeight </s> remove height: (variables.footerHeight - (variables.isIphoneX ? 34 : 0)),
</s> add height: variables.footerHeight, | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/02488686876423d0d490d73e89587fac846ddfe3 | src/theme/components/FooterTab.js |
alignSelf: "flex-start" | <mask> const headerTheme = {
<mask> ".span": {
<mask> height: 128,
<mask> "NativeBase.Left": {
<mask> alignSelf: "flex-start",
<mask> },
<mask> "NativeBase.Body": {
<mask> alignSelf: "flex-end",
<mask> alignItems: "flex-start",
<mask> justifyContent: "center",
</s> Safearea implementation for Header, footer and Content </s> remove paddingBottom: 26,
</s> add paddingBottom: 26 </s> remove height: variables.searchBarInputHeight,
</s> add height: variables.searchBarInputHeight </s> remove alignItems: platform === "ios" && platformStyle !== "material" ? "center" : "flex-start",
</s> add alignItems:
platform === "ios" && platformStyle !== "material"
? "center"
: "flex-start", </s> remove alignSelf: "flex-start",
},
</s> add alignSelf: "flex-start"
} </s> remove },
},
</s> add }
} | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/02488686876423d0d490d73e89587fac846ddfe3 | src/theme/components/Header.js |
paddingBottom: 26 | <mask> "NativeBase.Body": {
<mask> alignSelf: "flex-end",
<mask> alignItems: "flex-start",
<mask> justifyContent: "center",
<mask> paddingBottom: 26,
<mask> },
<mask> "NativeBase.Right": {
<mask> alignSelf: "flex-start",
<mask> },
<mask> },
</s> Safearea implementation for Header, footer and Content </s> remove alignSelf: "flex-start",
},
</s> add alignSelf: "flex-start"
} </s> remove alignSelf: "flex-start",
</s> add alignSelf: "flex-start" </s> remove alignItems: platform === "ios" && platformStyle !== "material" ? "center" : "flex-start",
</s> add alignItems:
platform === "ios" && platformStyle !== "material"
? "center"
: "flex-start", </s> remove height: variables.searchBarInputHeight,
</s> add height: variables.searchBarInputHeight </s> remove justifyContent: "flex-end",
</s> add justifyContent: "flex-end" | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/02488686876423d0d490d73e89587fac846ddfe3 | src/theme/components/Header.js |
alignSelf: "flex-start"
} | <mask> justifyContent: "center",
<mask> paddingBottom: 26,
<mask> },
<mask> "NativeBase.Right": {
<mask> alignSelf: "flex-start",
<mask> },
<mask> },
<mask> ".hasSubtitle": {
<mask> "NativeBase.Body": {
<mask> "NativeBase.Title": {
<mask> fontSize: variables.titleFontSize - 2,
</s> Safearea implementation for Header, footer and Content </s> remove paddingBottom: 26,
</s> add paddingBottom: 26 </s> remove textAlign: "center",
</s> add textAlign: "center" </s> remove alignSelf: "flex-start",
</s> add alignSelf: "flex-start" </s> remove marginLeft: 5,
},
</s> add marginLeft: 5
} </s> remove marginLeft: 5,
</s> add marginLeft: 5 | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/02488686876423d0d490d73e89587fac846ddfe3 | src/theme/components/Header.js |
textAlign: "center" | <mask> "NativeBase.Body": {
<mask> "NativeBase.Title": {
<mask> fontSize: variables.titleFontSize - 2,
<mask> fontFamily: variables.titleFontfamily,
<mask> textAlign: "center",
<mask> },
<mask> "NativeBase.Subtitle": {
<mask> fontSize: variables.subTitleFontSize,
<mask> fontFamily: variables.titleFontfamily,
<mask> color: variables.subtitleColor,
</s> Safearea implementation for Header, footer and Content </s> remove textAlign: "center",
},
},
</s> add textAlign: "center"
}
} </s> remove alignSelf: "flex-start",
},
</s> add alignSelf: "flex-start"
} </s> remove marginLeft: 5,
</s> add marginLeft: 5 </s> remove marginLeft: 5,
},
</s> add marginLeft: 5
} </s> remove paddingLeft: 10,
</s> add paddingLeft: 10 | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/02488686876423d0d490d73e89587fac846ddfe3 | src/theme/components/Header.js |
textAlign: "center"
}
} | <mask> "NativeBase.Subtitle": {
<mask> fontSize: variables.subTitleFontSize,
<mask> fontFamily: variables.titleFontfamily,
<mask> color: variables.subtitleColor,
<mask> textAlign: "center",
<mask> },
<mask> },
<mask> },
<mask> ".noShadow": {
<mask> elevation: 0,
<mask> shadowColor: null,
<mask> shadowOffset: null,
</s> Safearea implementation for Header, footer and Content </s> remove textAlign: "center",
</s> add textAlign: "center" </s> remove shadowOpacity: null,
</s> add shadowOpacity: null </s> remove borderBottomWidth: null,
</s> add borderBottomWidth: null </s> remove flex: 0.3,
</s> add flex: 0.3 </s> remove paddingLeft: 10,
</s> add paddingLeft: 10 | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/02488686876423d0d490d73e89587fac846ddfe3 | src/theme/components/Header.js |
shadowOpacity: null | <mask> elevation: 0,
<mask> shadowColor: null,
<mask> shadowOffset: null,
<mask> shadowRadius: null,
<mask> shadowOpacity: null,
<mask> },
<mask> ".hasTabs": {
<mask> elevation: 0,
<mask> shadowColor: null,
<mask> shadowOffset: null,
</s> Safearea implementation for Header, footer and Content </s> remove borderBottomWidth: null,
</s> add borderBottomWidth: null </s> remove textAlign: "center",
},
},
</s> add textAlign: "center"
}
} </s> remove flex: 0.3,
</s> add flex: 0.3 </s> remove height: (variables.footerHeight - (variables.isIphoneX ? 34 : 0)),
</s> add height: variables.footerHeight, </s> remove alignSelf: "center",
</s> add alignSelf: "center" | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/02488686876423d0d490d73e89587fac846ddfe3 | src/theme/components/Header.js |
borderBottomWidth: null | <mask> shadowColor: null,
<mask> shadowOffset: null,
<mask> shadowRadius: null,
<mask> shadowOpacity: null,
<mask> borderBottomWidth: null,
<mask> },
<mask> ".hasSegment": {
<mask> elevation: 0,
<mask> shadowColor: null,
<mask> shadowOffset: null,
</s> Safearea implementation for Header, footer and Content </s> remove shadowOpacity: null,
</s> add shadowOpacity: null </s> remove textAlign: "center",
},
},
</s> add textAlign: "center"
}
} </s> remove flex: 0.3,
</s> add flex: 0.3 </s> remove height: (variables.footerHeight - (variables.isIphoneX ? 34 : 0)),
</s> add height: variables.footerHeight, </s> remove alignSelf: "center",
</s> add alignSelf: "center" | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/02488686876423d0d490d73e89587fac846ddfe3 | src/theme/components/Header.js |
flex: 0.3 | <mask> shadowRadius: null,
<mask> shadowOpacity: null,
<mask> borderBottomWidth: null,
<mask> "NativeBase.Left": {
<mask> flex: 0.3,
<mask> },
<mask> "NativeBase.Right": {
<mask> flex: 0.3,
<mask> },
<mask> "NativeBase.Body": {
</s> Safearea implementation for Header, footer and Content </s> remove flex: 0.3,
</s> add flex: 0.3 </s> remove borderBottomWidth: null,
</s> add borderBottomWidth: null </s> remove shadowOpacity: null,
</s> add shadowOpacity: null </s> remove height: (variables.footerHeight - (variables.isIphoneX ? 34 : 0)),
</s> add height: variables.footerHeight, </s> remove textAlign: "center",
},
},
</s> add textAlign: "center"
}
} | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/02488686876423d0d490d73e89587fac846ddfe3 | src/theme/components/Header.js |
flex: 0.3 | <mask> "NativeBase.Left": {
<mask> flex: 0.3,
<mask> },
<mask> "NativeBase.Right": {
<mask> flex: 0.3,
<mask> },
<mask> "NativeBase.Body": {
<mask> flex: 1,
<mask> "NativeBase.Segment": {
<mask> marginRight: 0,
</s> Safearea implementation for Header, footer and Content </s> remove flex: 0.3,
</s> add flex: 0.3 </s> remove alignSelf: 'center',
</s> add alignSelf: "center", </s> remove alignItems: platform === "ios" && platformStyle !== "material" ? "center" : "flex-start",
</s> add alignItems:
platform === "ios" && platformStyle !== "material"
? "center"
: "flex-start", </s> remove height: variables.searchBarInputHeight,
</s> add height: variables.searchBarInputHeight </s> remove alignSelf: "flex-start",
},
</s> add alignSelf: "flex-start"
} | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/02488686876423d0d490d73e89587fac846ddfe3 | src/theme/components/Header.js |
alignSelf: "center", | <mask> "NativeBase.Body": {
<mask> flex: 1,
<mask> "NativeBase.Segment": {
<mask> marginRight: 0,
<mask> alignSelf: 'center',
<mask> "NativeBase.Button": {
<mask> paddingLeft: 0,
<mask> paddingRight: 0
<mask> }
<mask> },
</s> Safearea implementation for Header, footer and Content </s> remove },
},
</s> add }
} </s> remove flex: 0.3,
</s> add flex: 0.3 </s> remove alignItems: platform === "ios" && platformStyle !== "material" ? "center" : "flex-start",
</s> add alignItems:
platform === "ios" && platformStyle !== "material"
? "center"
: "flex-start", </s> remove paddingLeft: 10,
</s> add paddingLeft: 10 </s> remove flex: 0.3,
</s> add flex: 0.3 | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/02488686876423d0d490d73e89587fac846ddfe3 | src/theme/components/Header.js |
}
} | <mask> "NativeBase.Button": {
<mask> paddingLeft: 0,
<mask> paddingRight: 0
<mask> }
<mask> },
<mask> },
<mask> },
<mask> "NativeBase.Button": {
<mask> justifyContent: "center",
<mask> alignSelf: "center",
<mask> alignItems: "center",
</s> Safearea implementation for Header, footer and Content </s> remove alignSelf: 'center',
</s> add alignSelf: "center", </s> remove paddingLeft: 10,
</s> add paddingLeft: 10 </s> remove paddingBottom: 26,
</s> add paddingBottom: 26 </s> remove height: variables.searchBarInputHeight,
</s> add height: variables.searchBarInputHeight </s> remove alignSelf: "flex-start",
},
</s> add alignSelf: "flex-start"
} | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/02488686876423d0d490d73e89587fac846ddfe3 | src/theme/components/Header.js |
fontWeight: "600" | <mask> alignItems: "center",
<mask> ".transparent": {
<mask> "NativeBase.Text": {
<mask> color: variables.toolbarBtnTextColor,
<mask> fontWeight: "600",
<mask> },
<mask> "NativeBase.Icon": {
<mask> color: variables.toolbarBtnColor,
<mask> },
<mask> "NativeBase.IconNB": {
</s> Safearea implementation for Header, footer and Content </s> remove color: variables.toolbarBtnColor,
</s> add color: variables.toolbarBtnColor </s> remove color: variables.toolbarBtnColor,
</s> add color: variables.toolbarBtnColor </s> remove marginLeft: 5,
</s> add marginLeft: 5 </s> remove paddingHorizontal: 15,
</s> add paddingHorizontal: 15 </s> remove paddingHorizontal: variables.buttonPadding,
</s> add paddingHorizontal: variables.buttonPadding | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/02488686876423d0d490d73e89587fac846ddfe3 | src/theme/components/Header.js |
color: variables.toolbarBtnColor | <mask> color: variables.toolbarBtnTextColor,
<mask> fontWeight: "600",
<mask> },
<mask> "NativeBase.Icon": {
<mask> color: variables.toolbarBtnColor,
<mask> },
<mask> "NativeBase.IconNB": {
<mask> color: variables.toolbarBtnColor,
<mask> },
<mask> paddingHorizontal: variables.buttonPadding,
</s> Safearea implementation for Header, footer and Content </s> remove fontWeight: "600",
</s> add fontWeight: "600" </s> remove color: variables.toolbarBtnColor,
</s> add color: variables.toolbarBtnColor </s> remove paddingHorizontal: 15,
</s> add paddingHorizontal: 15 </s> remove paddingHorizontal: variables.buttonPadding,
</s> add paddingHorizontal: variables.buttonPadding </s> remove marginLeft: 5,
</s> add marginLeft: 5 | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/02488686876423d0d490d73e89587fac846ddfe3 | src/theme/components/Header.js |
color: variables.toolbarBtnColor | <mask> "NativeBase.Icon": {
<mask> color: variables.toolbarBtnColor,
<mask> },
<mask> "NativeBase.IconNB": {
<mask> color: variables.toolbarBtnColor,
<mask> },
<mask> paddingHorizontal: variables.buttonPadding,
<mask> },
<mask> paddingHorizontal: 15,
<mask> },
</s> Safearea implementation for Header, footer and Content </s> remove paddingHorizontal: 15,
</s> add paddingHorizontal: 15 </s> remove paddingHorizontal: variables.buttonPadding,
</s> add paddingHorizontal: variables.buttonPadding </s> remove color: variables.toolbarBtnColor,
</s> add color: variables.toolbarBtnColor </s> remove fontWeight: "600",
</s> add fontWeight: "600" </s> remove marginLeft: 5,
},
</s> add marginLeft: 5
} | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/02488686876423d0d490d73e89587fac846ddfe3 | src/theme/components/Header.js |
paddingHorizontal: variables.buttonPadding | <mask> },
<mask> "NativeBase.IconNB": {
<mask> color: variables.toolbarBtnColor,
<mask> },
<mask> paddingHorizontal: variables.buttonPadding,
<mask> },
<mask> paddingHorizontal: 15,
<mask> },
<mask> ".searchBar": {
<mask> "NativeBase.Item": {
</s> Safearea implementation for Header, footer and Content </s> remove paddingHorizontal: 15,
</s> add paddingHorizontal: 15 </s> remove color: variables.toolbarBtnColor,
</s> add color: variables.toolbarBtnColor </s> remove color: variables.toolbarBtnColor,
</s> add color: variables.toolbarBtnColor </s> remove marginLeft: 5,
},
</s> add marginLeft: 5
} </s> remove fontWeight: "600",
</s> add fontWeight: "600" | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/02488686876423d0d490d73e89587fac846ddfe3 | src/theme/components/Header.js |
paddingHorizontal: 15 | <mask> color: variables.toolbarBtnColor,
<mask> },
<mask> paddingHorizontal: variables.buttonPadding,
<mask> },
<mask> paddingHorizontal: 15,
<mask> },
<mask> ".searchBar": {
<mask> "NativeBase.Item": {
<mask> "NativeBase.Icon": {
<mask> backgroundColor: "transparent",
</s> Safearea implementation for Header, footer and Content </s> remove paddingHorizontal: variables.buttonPadding,
</s> add paddingHorizontal: variables.buttonPadding </s> remove color: variables.toolbarBtnColor,
</s> add color: variables.toolbarBtnColor </s> remove color: variables.toolbarBtnColor,
</s> add color: variables.toolbarBtnColor </s> remove marginLeft: 5,
},
</s> add marginLeft: 5
} </s> remove fontWeight: "600",
</s> add fontWeight: "600" | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/02488686876423d0d490d73e89587fac846ddfe3 | src/theme/components/Header.js |
paddingLeft: 10 | <mask> fontSize: variables.toolbarSearchIconSize,
<mask> alignItems: "center",
<mask> marginTop: 2,
<mask> paddingRight: 10,
<mask> paddingLeft: 10,
<mask> },
<mask> "NativeBase.IconNB": {
<mask> backgroundColor: "transparent",
<mask> color: null,
<mask> alignSelf: "center",
</s> Safearea implementation for Header, footer and Content </s> remove alignSelf: "center",
</s> add alignSelf: "center" </s> remove justifyContent: "flex-end",
</s> add justifyContent: "flex-end" </s> remove },
},
</s> add }
} </s> remove marginLeft: 5,
</s> add marginLeft: 5 </s> remove marginLeft: 5,
},
</s> add marginLeft: 5
} | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/02488686876423d0d490d73e89587fac846ddfe3 | src/theme/components/Header.js |
alignSelf: "center" | <mask> },
<mask> "NativeBase.IconNB": {
<mask> backgroundColor: "transparent",
<mask> color: null,
<mask> alignSelf: "center",
<mask> },
<mask> "NativeBase.Input": {
<mask> alignSelf: "center",
<mask> lineHeight: 24,
<mask> height: variables.searchBarInputHeight,
</s> Safearea implementation for Header, footer and Content </s> remove height: variables.searchBarInputHeight,
</s> add height: variables.searchBarInputHeight </s> remove paddingLeft: 10,
</s> add paddingLeft: 10 </s> remove paddingHorizontal: 15,
</s> add paddingHorizontal: 15 </s> remove height: (variables.footerHeight - (variables.isIphoneX ? 34 : 0)),
</s> add height: variables.footerHeight, </s> remove alignSelf: "flex-start",
</s> add alignSelf: "flex-start" | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/02488686876423d0d490d73e89587fac846ddfe3 | src/theme/components/Header.js |
height: variables.searchBarInputHeight | <mask> },
<mask> "NativeBase.Input": {
<mask> alignSelf: "center",
<mask> lineHeight: 24,
<mask> height: variables.searchBarInputHeight,
<mask> },
<mask> alignSelf: "center",
<mask> alignItems: "center",
<mask> justifyContent: "flex-start",
<mask> flex: 1,
</s> Safearea implementation for Header, footer and Content </s> remove alignSelf: "center",
</s> add alignSelf: "center" </s> remove alignSelf: "flex-start",
</s> add alignSelf: "flex-start" </s> remove paddingBottom: 26,
</s> add paddingBottom: 26 </s> remove alignItems: platform === "ios" && platformStyle !== "material" ? "center" : "flex-start",
</s> add alignItems:
platform === "ios" && platformStyle !== "material"
? "center"
: "flex-start", </s> remove justifyContent: "flex-end",
</s> add justifyContent: "flex-end" | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/02488686876423d0d490d73e89587fac846ddfe3 | src/theme/components/Header.js |
alignItems:
platform === "ios" && platformStyle !== "material"
? "center"
: "flex-start", | <mask> alignItems: "flex-start",
<mask> },
<mask> "NativeBase.Body": {
<mask> flex: 1,
<mask> alignItems: platform === "ios" && platformStyle !== "material" ? "center" : "flex-start",
<mask> alignSelf: "center",
<mask> "NativeBase.Segment": {
<mask> borderWidth: 0,
<mask> alignSelf: "flex-end",
<mask> marginRight: platform === "ios" ? -40 : -55,
</s> Safearea implementation for Header, footer and Content </s> remove paddingTop: platform === "ios" ? (variables.isIphoneX ? 39 : 15) : 0,
borderBottomWidth: platform === "ios" ? 1 / PixelRatio.getPixelSizeForLayoutSize(1) : 0,
</s> add paddingTop: platform === "ios" ? 15 : 0,
borderBottomWidth:
platform === "ios" ? 1 / PixelRatio.getPixelSizeForLayoutSize(1) : 0, </s> remove paddingBottom: 26,
</s> add paddingBottom: 26 </s> remove alignSelf: "flex-start",
</s> add alignSelf: "flex-start" </s> remove alignSelf: 'center',
</s> add alignSelf: "center", </s> remove height: variables.searchBarInputHeight,
</s> add height: variables.searchBarInputHeight | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/02488686876423d0d490d73e89587fac846ddfe3 | src/theme/components/Header.js |
marginLeft: 5 | <mask> color: variables.toolbarBtnColor,
<mask> fontSize: variables.iconHeaderSize - 2,
<mask> marginTop: 2,
<mask> marginRight: 2,
<mask> marginLeft: 5,
<mask> },
<mask> "NativeBase.Text": {
<mask> color: variables.toolbarBtnTextColor,
<mask> fontSize: 17,
<mask> lineHeight: 21,
</s> Safearea implementation for Header, footer and Content </s> remove marginLeft: 5,
},
</s> add marginLeft: 5
} </s> remove textAlign: "center",
</s> add textAlign: "center" </s> remove paddingLeft: 10,
</s> add paddingLeft: 10 </s> remove alignSelf: "flex-start",
},
</s> add alignSelf: "flex-start"
} </s> remove fontWeight: "600",
</s> add fontWeight: "600" | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/02488686876423d0d490d73e89587fac846ddfe3 | src/theme/components/Header.js |
marginLeft: 5
} | <mask> color: variables.toolbarBtnColor,
<mask> fontSize: variables.iconHeaderSize - 2,
<mask> marginTop: 2,
<mask> marginRight: 2,
<mask> marginLeft: 5,
<mask> },
<mask> },
<mask> ".transparent": {
<mask> marginRight: -8,
<mask> paddingHorizontal: 15,
<mask> borderRadius: 50,
</s> Safearea implementation for Header, footer and Content </s> remove marginLeft: 5,
</s> add marginLeft: 5 </s> remove paddingLeft: 10,
</s> add paddingLeft: 10 </s> remove textAlign: "center",
</s> add textAlign: "center" </s> remove alignSelf: "flex-start",
},
</s> add alignSelf: "flex-start"
} </s> remove color: variables.toolbarBtnColor,
</s> add color: variables.toolbarBtnColor | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/02488686876423d0d490d73e89587fac846ddfe3 | src/theme/components/Header.js |
justifyContent: "flex-end" | <mask> flex: 1,
<mask> alignSelf: "center",
<mask> alignItems: "flex-end",
<mask> flexDirection: "row",
<mask> justifyContent: "flex-end",
<mask> },
<mask> backgroundColor: variables.toolbarDefaultBg,
<mask> flexDirection: "row",
<mask> paddingHorizontal: 10,
<mask> justifyContent: "center",
</s> Safearea implementation for Header, footer and Content </s> remove backgroundColor: Platform.OS === "android"
? variables.tabActiveBgColor
: undefined,
</s> add backgroundColor:
Platform.OS === "android" ? variables.tabActiveBgColor : undefined, </s> remove paddingTop: platform === "ios" ? (variables.isIphoneX ? 39 : 15) : 0,
borderBottomWidth: platform === "ios" ? 1 / PixelRatio.getPixelSizeForLayoutSize(1) : 0,
</s> add paddingTop: platform === "ios" ? 15 : 0,
borderBottomWidth:
platform === "ios" ? 1 / PixelRatio.getPixelSizeForLayoutSize(1) : 0, </s> remove paddingBottom: 26,
</s> add paddingBottom: 26 </s> remove alignSelf: "flex-start",
</s> add alignSelf: "flex-start" </s> remove height: variables.searchBarInputHeight,
</s> add height: variables.searchBarInputHeight | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/02488686876423d0d490d73e89587fac846ddfe3 | src/theme/components/Header.js |
paddingTop: platform === "ios" ? 15 : 0,
borderBottomWidth:
platform === "ios" ? 1 / PixelRatio.getPixelSizeForLayoutSize(1) : 0, | <mask> backgroundColor: variables.toolbarDefaultBg,
<mask> flexDirection: "row",
<mask> paddingHorizontal: 10,
<mask> justifyContent: "center",
<mask> paddingTop: platform === "ios" ? (variables.isIphoneX ? 39 : 15) : 0,
<mask> borderBottomWidth: platform === "ios" ? 1 / PixelRatio.getPixelSizeForLayoutSize(1) : 0,
<mask> borderBottomColor: variables.toolbarDefaultBorder,
<mask> height: variables.platform === "ios" && variables.platformStyle === "material" ? (variables.toolbarHeight + StatusBar.height) : variables.toolbarHeight,
<mask> elevation: 3,
<mask> shadowColor: platformStyle === "material" ? "#000" : undefined,
<mask> shadowOffset: platformStyle === "material" ? { width: 0, height: 2 } : undefined,
</s> Safearea implementation for Header, footer and Content </s> remove alignItems: platform === "ios" && platformStyle !== "material" ? "center" : "flex-start",
</s> add alignItems:
platform === "ios" && platformStyle !== "material"
? "center"
: "flex-start", </s> remove backgroundColor: Platform.OS === "android"
? variables.tabActiveBgColor
: undefined,
</s> add backgroundColor:
Platform.OS === "android" ? variables.tabActiveBgColor : undefined, </s> remove render() {
return (
<KeyboardAwareScrollView
automaticallyAdjustContentInsets={false}
resetScrollToCoords={this.props.disableKBDismissScroll ? null : { x: 0, y: 0 }}
keyboardShouldPersistTaps={this.props.keyboardShouldPersistTaps ? this.props.keyboardShouldPersistTaps : 'handled'}
ref={c => {
this._scrollview = c;
this._root = c;
}}
{...this.props}
>
{this.props.children}
</KeyboardAwareScrollView>
);
}
</s> add static contextTypes = {
theme: PropTypes.object
};
constructor(props) {
super(props);
this.state = {
orientation: "portrait"
};
}
layoutChange(val) {
let maxComp = Math.max(variable.deviceWidth, variable.deviceHeight);
if (val.width >= maxComp) this.setState({ orientation: "landscape" });
else {
this.setState({ orientation: "portrait" });
}
}
calculateLeft(mode, inSet) {
let inset = null;
if (inSet !== undefined) {
inset = inSet;
} else {
inset = variable.Inset;
}
const InsetValues = mode === "portrait" ? inset.portrait : inset.landscape;
let leftPadder = null;
if (this.props.style[1] !== undefined) {
if (
this.props.style[1].padding !== undefined ||
this.props.style[1].paddingLeft !== undefined
) {
leftPadder =
(this.props.style[1].paddingLeft
? this.props.style[1].paddingLeft
: this.props.style[1].padding) + InsetValues.leftInset;
}
} else if (
this.props.style.padding !== undefined ||
this.props.style.paddingLeft !== undefined
) {
leftPadder =
(this.props.style.paddingLeft
? this.props.style.paddingLeft
: this.props.style.padding) + InsetValues.leftInset;
} else {
leftPadder = InsetValues.leftInset;
}
return leftPadder;
}
calculateRight(mode, inSet) {
let inset = null;
if (inSet !== undefined) {
inset = inSet;
} else {
inset = variable.Inset;
}
const InsetValues = mode === "portrait" ? inset.portrait : inset.landscape;
let rightPadder = null;
if (this.props.style[1] !== undefined) {
if (
this.props.style[1].padding !== undefined ||
this.props.style[1].paddingRight !== undefined
) {
rightPadder =
(this.props.style[1].paddingRight
? this.props.style[1].paddingRight
: this.props.style[1].padding) + InsetValues.rightInset;
}
} else if (
this.props.style.padding !== undefined ||
this.props.style.paddingRight !== undefined
) {
rightPadder =
(this.props.style.paddingRight
? this.props.style.paddingRight
: this.props.style.padding) + InsetValues.rightInset;
} else {
rightPadder = InsetValues.rightInset;
}
return rightPadder;
}
render() {
const variables = this.context.theme
? this.context.theme["@@shoutem.theme/themeStyle"].variables
: variable;
return variable.isIphoneX ? (
<KeyboardAwareScrollView
automaticallyAdjustContentInsets={false}
resetScrollToCoords={
this.props.disableKBDismissScroll ? null : { x: 0, y: 0 }
}
keyboardShouldPersistTaps={
this.props.keyboardShouldPersistTaps
? this.props.keyboardShouldPersistTaps
: "handled"
}
ref={c => {
this._scrollview = c;
this._root = c;
}}
{...this.props}
onLayout={e => this.layoutChange(e.nativeEvent.layout)}
style={[
this.props.style,
{
paddingLeft: this.calculateLeft(
this.state.orientation,
variables.Inset
)
}
]}
>
{this.props.children}
</KeyboardAwareScrollView>
) : (
<KeyboardAwareScrollView
automaticallyAdjustContentInsets={false}
resetScrollToCoords={
this.props.disableKBDismissScroll ? null : { x: 0, y: 0 }
}
keyboardShouldPersistTaps={
this.props.keyboardShouldPersistTaps
? this.props.keyboardShouldPersistTaps
: "handled"
}
ref={c => {
this._scrollview = c;
this._root = c;
}}
{...this.props}
>
{this.props.children}
</KeyboardAwareScrollView>
);
} </s> remove
</s> add constructor(props) {
super(props);
this.state = {
orientation: "portrait"
};
}
layoutChange(val) {
let maxComp = Math.max(variable.deviceWidth, variable.deviceHeight);
if (val.width >= maxComp) this.setState({ orientation: "landscape" });
else {
this.setState({ orientation: "portrait" });
}
}
calculateHeight(mode, inSet) {
let inset = null;
if (inSet != undefined) {
inset = inSet;
} else {
inset = variable.Inset;
}
const InsetValues = mode === "portrait" ? inset.portrait : inset.landscape;
let oldHeight = null;
if (this.props.style.height != undefined) {
oldHeight = this.props.style.height;
} else if (this.props.style[1].height) {
oldHeight = this.props.style[1].height;
} else {
oldHeight = this.props.style[0].height;
}
let height = oldHeight + InsetValues.topInset;
return height;
}
calculatePadder(mode, inSet) {
let inset = null;
if (inSet != undefined) {
inset = inSet;
} else {
inset = variable.Inset;
}
const InsetValues = mode === "portrait" ? inset.portrait : inset.landscape;
let topPadder = null;
if (this.props.style[1] !== undefined) {
if (
this.props.style[1].padding !== undefined ||
this.props.style[1].paddingTop !== undefined
) {
topPadder =
(this.props.style[1].paddingTop
? this.props.style[1].paddingTop
: this.props.style[1].padding) + InsetValues.topInset;
}
} else if (
this.props.style.padding !== undefined &&
this.props.style.paddingTop !== undefined
) {
topPadder =
(this.props.style.paddingTop
? this.props.style.paddingTop
: this.props.style.padding) + InsetValues.topInset;
} else {
topPadder = InsetValues.topInset;
}
return topPadder;
} </s> remove height: (variables.footerHeight - (variables.isIphoneX ? 34 : 0)),
</s> add height: variables.footerHeight, | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/02488686876423d0d490d73e89587fac846ddfe3 | src/theme/components/Header.js |
footerPaddingBottom: 0, | <mask>
<mask> // Footer
<mask> footerHeight: isIphoneX ? 89 : 55,
<mask> footerDefaultBg: "#3F51B5",
<mask> footerPaddingBottom: isIphoneX ? 34 : 0,
<mask>
<mask> // FooterTab
<mask> tabBarTextColor: "#fff",
<mask> tabBarTextSize: 11,
<mask> activeTab: "#fff",
</s> Safearea implementation for Header, footer and Content </s> remove height: (variables.footerHeight - (variables.isIphoneX ? 34 : 0)),
</s> add height: variables.footerHeight, </s> remove paddingTop: platform === "ios" ? (variables.isIphoneX ? 39 : 15) : 0,
borderBottomWidth: platform === "ios" ? 1 / PixelRatio.getPixelSizeForLayoutSize(1) : 0,
</s> add paddingTop: platform === "ios" ? 15 : 0,
borderBottomWidth:
platform === "ios" ? 1 / PixelRatio.getPixelSizeForLayoutSize(1) : 0, </s> remove alignItems: platform === "ios" && platformStyle !== "material" ? "center" : "flex-start",
</s> add alignItems:
platform === "ios" && platformStyle !== "material"
? "center"
: "flex-start", </s> remove return <View ref={c => (this._root = c)} {...this.props} />;
</s> add const variables = this.context.theme
? this.context.theme["@@shoutem.theme/themeStyle"].variables
: variable;
return variable.isIphoneX ? (
<View
ref={c => (this._root = c)}
{...this.props}
onLayout={e => this.layoutChange(e.nativeEvent.layout)}
style={[
this.props.style,
{
height: this.calculateHeight(
this.state.orientation,
variables.Inset
),
paddingBottom: this.calculatePadder(
this.state.orientation,
variables.Inset
)
}
]}
/>
) : (
<View ref={c => (this._root = c)} {...this.props} />
); </s> remove backgroundColor: Platform.OS === "android"
? variables.tabActiveBgColor
: undefined,
</s> add backgroundColor:
Platform.OS === "android" ? variables.tabActiveBgColor : undefined, | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/02488686876423d0d490d73e89587fac846ddfe3 | src/theme/variables/material.js |
"@react-native-aria/interactions": "0.2.1", | <mask> },
<mask> "dependencies": {
<mask> "babel-eslint": "^10.1.0",
<mask> "deepmerge": "^4.2.2",
<mask> "expo-constants": "^9.3.5",
<mask> "expo-font": "^8.3.0",
<mask> "hoist-non-react-statics": "^3.3.2",
<mask> "lodash": "^4.17.20",
</s> feat: replace Hoverable with useHover from rn-aria </s> remove {InputLeftElement ? (
<Flex justify="center" align="center" left={0}>
{InputLeftElement}
</Flex>
) : null}
{isFocused && label && (
<Flex position="absolute">
<Animated.View
style={{
transform: [{ translateY: slideAnim, translateX: 4 }],
}}
>
<Flex {...newProps} bg="transparent">
<Box
bg="transparent"
color={updatedBorderColor}
fontSize={fontSize}
>
{label}
<Box
w="120%"
p="1px"
bg="gray.50"
position="absolute"
right="-10%"
bottom={`${
Math.floor(fontSize / 2) +
(Platform.OS === 'ios' ? 1 : 0)
}px`}
zIndex={-1}
/>
</Box>
</Flex>
</Animated.View>
</Flex>
)}
<StyledInput
{...newProps}
fontSize={fontSize}
backgroundColor="transparent"
flex={1}
secureTextEntry={type === 'password'}
accessible
accessibilityLabel={ariaLabel || accessibilityLabel}
onKeyPress={(e: any) => {
e.persist();
}}
onFocus={() => {
slideOut();
handleFocus(true, onFocus ? onFocus : () => {});
}}
onBlur={(e) => {
// TODO: animation not happening because of component rerender
e.nativeEvent.text && slideIn();
handleFocus(false, onBlur ? onBlur : () => {});
}}
placeholder={isFocused && label ? '' : placeholder}
editable={isDisabled || isReadOnly ? false : true}
// borderRadius={50} //Remove variant props from StyledInput
borderWidth={undefined}
{...(Platform.OS === 'web'
? {
disabled: isDisabled,
cursor: isDisabled ? 'not-allowed' : 'auto',
}
: {})}
style={[
Platform.OS === 'web' && {
// @ts-ignore
outline: 'none',
},
]}
ref={ref}
/>
{InputRightElement ? (
<Flex justify="center" align="center" right={0}>
{InputRightElement}
</Flex>
) : null}
</Box>
);
}}
</Hoverable>
</s> add <Flex {...newProps} bg="transparent">
<Box
bg="transparent"
color={updatedBorderColor}
fontSize={fontSize}
>
{label}
<Box
w="120%"
p="1px"
bg="gray.50"
position="absolute"
right="-10%"
bottom={`${
Math.floor(fontSize / 2) + (Platform.OS === 'ios' ? 1 : 0)
}px`}
zIndex={-1}
/>
</Box>
</Flex>
</Animated.View>
</Flex>
)}
<StyledInput
{...newProps}
fontSize={fontSize}
backgroundColor="transparent"
flex={1}
secureTextEntry={type === 'password'}
accessible
accessibilityLabel={ariaLabel || accessibilityLabel}
onKeyPress={(e: any) => {
e.persist();
}}
onFocus={() => {
slideOut();
handleFocus(true, onFocus ? onFocus : () => {});
}}
onBlur={(e) => {
// TODO: animation not happening because of component rerender
e.nativeEvent.text && slideIn();
handleFocus(false, onBlur ? onBlur : () => {});
}}
placeholder={isFocused && label ? '' : placeholder}
editable={isDisabled || isReadOnly ? false : true}
// borderRadius={50} //Remove variant props from StyledInput
borderWidth={undefined}
{...(Platform.OS === 'web'
? {
disabled: isDisabled,
cursor: isDisabled ? 'not-allowed' : 'auto',
}
: {})}
style={[
Platform.OS === 'web' && {
// @ts-ignore
outline: 'none',
},
]}
ref={ref}
/>
{InputRightElement ? (
<Flex justify="center" align="center" right={0}>
{InputRightElement}
</Flex>
) : null}
</Box> </s> remove import { Hoverable } from './../../../utils';
</s> add import { mergeRefs } from './../../../utils';
import { useHover } from '@react-native-aria/interactions'; </s> remove import { Hoverable } from './../../../utils';
</s> add import { mergeRefs } from './../../../utils';
import { useHover } from '@react-native-aria/interactions'; </s> remove import { Hoverable } from './../../../utils';
</s> add import { mergeRefs } from './../../../utils'; | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/025f339d611ae3d72b4f00018d7cbd5c6761b593 | package.json |
import { mergeRefs } from './../../../utils';
import { useHover } from '@react-native-aria/interactions'; | <mask> IAccordionItemContextProps,
<mask> } from './types';
<mask> import { AccordionItemContext } from './Context';
<mask> import { useThemeProps } from '../../../hooks';
<mask> import { Hoverable } from './../../../utils';
<mask>
<mask> const AccordionButton = (
<mask> { children, ...props }: IAccordionButtonProps,
<mask> ref: any
<mask> ) => {
</s> feat: replace Hoverable with useHover from rn-aria </s> remove import { Hoverable } from './../../../utils';
</s> add import { mergeRefs } from './../../../utils';
import { useHover } from '@react-native-aria/interactions'; </s> remove import { Hoverable } from './../../../utils';
</s> add import { mergeRefs } from './../../../utils'; </s> remove import { Hoverable } from './../../../utils';
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/025f339d611ae3d72b4f00018d7cbd5c6761b593 | src/components/composites/Accordion/AccordionButton.tsx |
const _ref = React.useRef(null);
const { isHovered } = useHover({}, _ref);
| <mask> const pressHandler = () => {
<mask> isOpen ? onClose && onClose() : onOpen && onOpen();
<mask> };
<mask>
<mask> return (
<mask> <TouchableOpacity
<mask> activeOpacity={1}
<mask> disabled={isDisabled}
</s> feat: replace Hoverable with useHover from rn-aria </s> remove <TouchableOpacity activeOpacity={1} ref={ref} {...inputProps}>
<Hoverable>
{(isHovered: boolean) => {
const outlineColor =
isHovered && !isDisabled
? activeColor
: checked
? isDisabled
? borderColor
: activeColor
: borderColor;
return (
<Box
flexDirection="row"
justifyContent="center"
alignItems="center"
{...newProps}
opacity={isDisabled ? 0.4 : 1}
{...(Platform.OS === 'web'
? {
disabled: isDisabled,
cursor: isDisabled ? 'not-allowed' : 'auto',
}
: {})}
>
<Box
borderColor={outlineColor}
backgroundColor={isDisabled ? 'muted.200' : 'transparent'}
borderWidth={1}
display="flex"
justifyContent="center"
alignItems="center"
borderRadius={999}
p={'2px'}
>
{icon && checked ? (
sizedIcon()
) : (
<Icon
name="circle"
type="MaterialCommunityIcons"
size={size}
color={
checked
? isDisabled
? borderColor
: activeColor
: 'transparent'
}
opacity={checked ? 1 : 0}
/>
)}
</Box>
{children}
</Box>
);
}}
</Hoverable>
</s> add <TouchableOpacity
activeOpacity={1}
ref={mergeRefs([ref, _ref])}
{...inputProps}
>
<Box
flexDirection="row"
justifyContent="center"
alignItems="center"
{...newProps}
opacity={isDisabled ? 0.4 : 1}
{...(Platform.OS === 'web'
? {
disabled: isDisabled,
cursor: isDisabled ? 'not-allowed' : 'auto',
}
: {})}
>
<Box
borderColor={outlineColor}
backgroundColor={isDisabled ? 'muted.200' : 'transparent'}
borderWidth={1}
display="flex"
justifyContent="center"
alignItems="center"
borderRadius={999}
p={'2px'}
>
{icon && checked ? (
sizedIcon()
) : (
<Icon
name="circle"
type="MaterialCommunityIcons"
size={size}
color={
checked
? isDisabled
? borderColor
: activeColor
: 'transparent'
}
opacity={checked ? 1 : 0}
/>
)}
</Box>
{children}
</Box> </s> remove ref={ref}
</s> add ref={mergeRefs([ref, _ref])} </s> remove <TouchableOpacity activeOpacity={1} ref={ref} {...inputProps}>
<Hoverable>
{(isHovered: boolean) => {
const outlineColor =
isHovered && !isDisabled
? activeColor
: isChecked
? isDisabled
? borderColor
: activeColor
: borderColor;
return (
<Box
flexDirection="row"
alignItems="center"
{...newProps}
opacity={isDisabled ? 0.4 : 1}
{...(Platform.OS === 'web'
? {
disabled: isDisabled,
cursor: isDisabled ? 'not-allowed' : 'auto',
}
: {})}
>
<Center
backgroundColor={
isChecked
? isDisabled
? borderColor
: activeColor
: 'transparent'
}
borderColor={outlineColor}
borderWidth={1}
borderRadius={4}
p={1}
>
{icon && sizedIcon && isChecked ? (
sizedIcon()
) : (
<Icon
name="check-bold"
type="MaterialCommunityIcons"
size={size}
color={iconColor}
opacity={isChecked ? 1 : 0}
/>
)}
</Center>
{props.children}
</Box>
);
}}
</Hoverable>
</s> add <TouchableOpacity
activeOpacity={1}
ref={mergeRefs([ref, _ref])}
{...inputProps}
>
<Box
flexDirection="row"
alignItems="center"
{...newProps}
opacity={isDisabled ? 0.4 : 1}
{...(Platform.OS === 'web'
? {
disabled: isDisabled,
cursor: isDisabled ? 'not-allowed' : 'auto',
}
: {})}
>
<Center
backgroundColor={
isChecked ? (isDisabled ? borderColor : activeColor) : 'transparent'
}
borderColor={outlineColor}
borderWidth={1}
borderRadius={4}
p={1}
>
{icon && sizedIcon && isChecked ? (
sizedIcon()
) : (
<Icon
name="check-bold"
type="MaterialCommunityIcons"
size={size}
color={iconColor}
opacity={isChecked ? 1 : 0}
/>
)}
</Center>
{props.children}
</Box> | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/025f339d611ae3d72b4f00018d7cbd5c6761b593 | src/components/composites/Accordion/AccordionButton.tsx |
ref={mergeRefs([ref, _ref])} | <mask> disabled={isDisabled}
<mask> onPress={pressHandler}
<mask> accessible
<mask> accessibilityRole="checkbox"
<mask> ref={ref}
<mask> >
<mask> <Hoverable>
<mask> {(isHovered: boolean) => {
<mask> return (
<mask> <Box
</s> feat: replace Hoverable with useHover from rn-aria </s> remove <Hoverable>
{(isHovered: boolean) => {
return (
<Box
display="flex"
flexDirection="row"
justifyContent="space-between"
alignItems="center"
{...newProps}
{...(isHovered && _hover)}
{...(isOpen && _expanded)}
{...(isDisabled && _disabled)}
{...(!index && { borderTopColor: 'transparent' })}
{...(Platform.OS === 'web'
? {
disabled: isDisabled,
cursor: isDisabled ? 'not-allowed' : 'auto',
}
: {})}
>
{children}
</Box>
);
}}
</Hoverable>
</s> add <Box
display="flex"
flexDirection="row"
justifyContent="space-between"
alignItems="center"
{...newProps}
{...(isHovered && _hover)}
{...(isOpen && _expanded)}
{...(isDisabled && _disabled)}
{...(!index && { borderTopColor: 'transparent' })}
{...(Platform.OS === 'web'
? {
disabled: isDisabled,
cursor: isDisabled ? 'not-allowed' : 'auto',
}
: {})}
>
{children}
</Box> </s> remove <Hoverable>
{(isHovered: boolean) => {
let updatedBorderColor = borderColorFromProps;
if (isHovered) updatedBorderColor = hoverBorderColor;
else if (isFocused) updatedBorderColor = focusBorderColor;
else if (isInvalid) updatedBorderColor = errorBorderColor;
const focusStyle = {
shadow: 3,
shadowColor: '#2563EB',
};
return (
<Box
borderColor={updatedBorderColor}
borderWidth={borderWidth}
borderBottomWidth={borderBottomWidth}
{...rem}
{...(isDisabled && newProps._isDisabledProps)}
{...computedProps}
{...(isFocused && Platform.OS === 'web' && focusStyle)}
style={style}
</s> add <Box
ref={_ref}
borderColor={updatedBorderColor}
borderWidth={borderWidth}
borderBottomWidth={borderBottomWidth}
{...rem}
{...(isDisabled && newProps._isDisabledProps)}
{...computedProps}
{...(isFocused && Platform.OS === 'web' && focusStyle)}
style={style}
>
{InputLeftElement ? (
<Flex justify="center" align="center" left={0}>
{InputLeftElement}
</Flex>
) : null}
{isFocused && label && (
<Flex position="absolute">
<Animated.View
style={{
transform: [{ translateY: slideAnim, translateX: 4 }],
}} </s> remove <TouchableOpacity activeOpacity={1} ref={ref} {...inputProps}>
<Hoverable>
{(isHovered: boolean) => {
const outlineColor =
isHovered && !isDisabled
? activeColor
: checked
? isDisabled
? borderColor
: activeColor
: borderColor;
return (
<Box
flexDirection="row"
justifyContent="center"
alignItems="center"
{...newProps}
opacity={isDisabled ? 0.4 : 1}
{...(Platform.OS === 'web'
? {
disabled: isDisabled,
cursor: isDisabled ? 'not-allowed' : 'auto',
}
: {})}
>
<Box
borderColor={outlineColor}
backgroundColor={isDisabled ? 'muted.200' : 'transparent'}
borderWidth={1}
display="flex"
justifyContent="center"
alignItems="center"
borderRadius={999}
p={'2px'}
>
{icon && checked ? (
sizedIcon()
) : (
<Icon
name="circle"
type="MaterialCommunityIcons"
size={size}
color={
checked
? isDisabled
? borderColor
: activeColor
: 'transparent'
}
opacity={checked ? 1 : 0}
/>
)}
</Box>
{children}
</Box>
);
}}
</Hoverable>
</s> add <TouchableOpacity
activeOpacity={1}
ref={mergeRefs([ref, _ref])}
{...inputProps}
>
<Box
flexDirection="row"
justifyContent="center"
alignItems="center"
{...newProps}
opacity={isDisabled ? 0.4 : 1}
{...(Platform.OS === 'web'
? {
disabled: isDisabled,
cursor: isDisabled ? 'not-allowed' : 'auto',
}
: {})}
>
<Box
borderColor={outlineColor}
backgroundColor={isDisabled ? 'muted.200' : 'transparent'}
borderWidth={1}
display="flex"
justifyContent="center"
alignItems="center"
borderRadius={999}
p={'2px'}
>
{icon && checked ? (
sizedIcon()
) : (
<Icon
name="circle"
type="MaterialCommunityIcons"
size={size}
color={
checked
? isDisabled
? borderColor
: activeColor
: 'transparent'
}
opacity={checked ? 1 : 0}
/>
)}
</Box>
{children}
</Box> </s> remove <TouchableOpacity activeOpacity={1} ref={ref} {...inputProps}>
<Hoverable>
{(isHovered: boolean) => {
const outlineColor =
isHovered && !isDisabled
? activeColor
: isChecked
? isDisabled
? borderColor
: activeColor
: borderColor;
return (
<Box
flexDirection="row"
alignItems="center"
{...newProps}
opacity={isDisabled ? 0.4 : 1}
{...(Platform.OS === 'web'
? {
disabled: isDisabled,
cursor: isDisabled ? 'not-allowed' : 'auto',
}
: {})}
>
<Center
backgroundColor={
isChecked
? isDisabled
? borderColor
: activeColor
: 'transparent'
}
borderColor={outlineColor}
borderWidth={1}
borderRadius={4}
p={1}
>
{icon && sizedIcon && isChecked ? (
sizedIcon()
) : (
<Icon
name="check-bold"
type="MaterialCommunityIcons"
size={size}
color={iconColor}
opacity={isChecked ? 1 : 0}
/>
)}
</Center>
{props.children}
</Box>
);
}}
</Hoverable>
</s> add <TouchableOpacity
activeOpacity={1}
ref={mergeRefs([ref, _ref])}
{...inputProps}
>
<Box
flexDirection="row"
alignItems="center"
{...newProps}
opacity={isDisabled ? 0.4 : 1}
{...(Platform.OS === 'web'
? {
disabled: isDisabled,
cursor: isDisabled ? 'not-allowed' : 'auto',
}
: {})}
>
<Center
backgroundColor={
isChecked ? (isDisabled ? borderColor : activeColor) : 'transparent'
}
borderColor={outlineColor}
borderWidth={1}
borderRadius={4}
p={1}
>
{icon && sizedIcon && isChecked ? (
sizedIcon()
) : (
<Icon
name="check-bold"
type="MaterialCommunityIcons"
size={size}
color={iconColor}
opacity={isChecked ? 1 : 0}
/>
)}
</Center>
{props.children}
</Box> | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/025f339d611ae3d72b4f00018d7cbd5c6761b593 | src/components/composites/Accordion/AccordionButton.tsx |
<Box
display="flex"
flexDirection="row"
justifyContent="space-between"
alignItems="center"
{...newProps}
{...(isHovered && _hover)}
{...(isOpen && _expanded)}
{...(isDisabled && _disabled)}
{...(!index && { borderTopColor: 'transparent' })}
{...(Platform.OS === 'web'
? {
disabled: isDisabled,
cursor: isDisabled ? 'not-allowed' : 'auto',
}
: {})}
>
{children}
</Box> | <mask> accessible
<mask> accessibilityRole="checkbox"
<mask> ref={ref}
<mask> >
<mask> <Hoverable>
<mask> {(isHovered: boolean) => {
<mask> return (
<mask> <Box
<mask> display="flex"
<mask> flexDirection="row"
<mask> justifyContent="space-between"
<mask> alignItems="center"
<mask> {...newProps}
<mask> {...(isHovered && _hover)}
<mask> {...(isOpen && _expanded)}
<mask> {...(isDisabled && _disabled)}
<mask> {...(!index && { borderTopColor: 'transparent' })}
<mask> {...(Platform.OS === 'web'
<mask> ? {
<mask> disabled: isDisabled,
<mask> cursor: isDisabled ? 'not-allowed' : 'auto',
<mask> }
<mask> : {})}
<mask> >
<mask> {children}
<mask> </Box>
<mask> );
<mask> }}
<mask> </Hoverable>
<mask> </TouchableOpacity>
<mask> );
<mask> };
<mask>
<mask> export default React.memo(
</s> feat: replace Hoverable with useHover from rn-aria </s> remove <TouchableOpacity activeOpacity={1} ref={ref} {...inputProps}>
<Hoverable>
{(isHovered: boolean) => {
const outlineColor =
isHovered && !isDisabled
? activeColor
: checked
? isDisabled
? borderColor
: activeColor
: borderColor;
return (
<Box
flexDirection="row"
justifyContent="center"
alignItems="center"
{...newProps}
opacity={isDisabled ? 0.4 : 1}
{...(Platform.OS === 'web'
? {
disabled: isDisabled,
cursor: isDisabled ? 'not-allowed' : 'auto',
}
: {})}
>
<Box
borderColor={outlineColor}
backgroundColor={isDisabled ? 'muted.200' : 'transparent'}
borderWidth={1}
display="flex"
justifyContent="center"
alignItems="center"
borderRadius={999}
p={'2px'}
>
{icon && checked ? (
sizedIcon()
) : (
<Icon
name="circle"
type="MaterialCommunityIcons"
size={size}
color={
checked
? isDisabled
? borderColor
: activeColor
: 'transparent'
}
opacity={checked ? 1 : 0}
/>
)}
</Box>
{children}
</Box>
);
}}
</Hoverable>
</s> add <TouchableOpacity
activeOpacity={1}
ref={mergeRefs([ref, _ref])}
{...inputProps}
>
<Box
flexDirection="row"
justifyContent="center"
alignItems="center"
{...newProps}
opacity={isDisabled ? 0.4 : 1}
{...(Platform.OS === 'web'
? {
disabled: isDisabled,
cursor: isDisabled ? 'not-allowed' : 'auto',
}
: {})}
>
<Box
borderColor={outlineColor}
backgroundColor={isDisabled ? 'muted.200' : 'transparent'}
borderWidth={1}
display="flex"
justifyContent="center"
alignItems="center"
borderRadius={999}
p={'2px'}
>
{icon && checked ? (
sizedIcon()
) : (
<Icon
name="circle"
type="MaterialCommunityIcons"
size={size}
color={
checked
? isDisabled
? borderColor
: activeColor
: 'transparent'
}
opacity={checked ? 1 : 0}
/>
)}
</Box>
{children}
</Box> </s> remove <TouchableOpacity activeOpacity={1} ref={ref} {...inputProps}>
<Hoverable>
{(isHovered: boolean) => {
const outlineColor =
isHovered && !isDisabled
? activeColor
: isChecked
? isDisabled
? borderColor
: activeColor
: borderColor;
return (
<Box
flexDirection="row"
alignItems="center"
{...newProps}
opacity={isDisabled ? 0.4 : 1}
{...(Platform.OS === 'web'
? {
disabled: isDisabled,
cursor: isDisabled ? 'not-allowed' : 'auto',
}
: {})}
>
<Center
backgroundColor={
isChecked
? isDisabled
? borderColor
: activeColor
: 'transparent'
}
borderColor={outlineColor}
borderWidth={1}
borderRadius={4}
p={1}
>
{icon && sizedIcon && isChecked ? (
sizedIcon()
) : (
<Icon
name="check-bold"
type="MaterialCommunityIcons"
size={size}
color={iconColor}
opacity={isChecked ? 1 : 0}
/>
)}
</Center>
{props.children}
</Box>
);
}}
</Hoverable>
</s> add <TouchableOpacity
activeOpacity={1}
ref={mergeRefs([ref, _ref])}
{...inputProps}
>
<Box
flexDirection="row"
alignItems="center"
{...newProps}
opacity={isDisabled ? 0.4 : 1}
{...(Platform.OS === 'web'
? {
disabled: isDisabled,
cursor: isDisabled ? 'not-allowed' : 'auto',
}
: {})}
>
<Center
backgroundColor={
isChecked ? (isDisabled ? borderColor : activeColor) : 'transparent'
}
borderColor={outlineColor}
borderWidth={1}
borderRadius={4}
p={1}
>
{icon && sizedIcon && isChecked ? (
sizedIcon()
) : (
<Icon
name="check-bold"
type="MaterialCommunityIcons"
size={size}
color={iconColor}
opacity={isChecked ? 1 : 0}
/>
)}
</Center>
{props.children}
</Box> </s> remove {InputLeftElement ? (
<Flex justify="center" align="center" left={0}>
{InputLeftElement}
</Flex>
) : null}
{isFocused && label && (
<Flex position="absolute">
<Animated.View
style={{
transform: [{ translateY: slideAnim, translateX: 4 }],
}}
>
<Flex {...newProps} bg="transparent">
<Box
bg="transparent"
color={updatedBorderColor}
fontSize={fontSize}
>
{label}
<Box
w="120%"
p="1px"
bg="gray.50"
position="absolute"
right="-10%"
bottom={`${
Math.floor(fontSize / 2) +
(Platform.OS === 'ios' ? 1 : 0)
}px`}
zIndex={-1}
/>
</Box>
</Flex>
</Animated.View>
</Flex>
)}
<StyledInput
{...newProps}
fontSize={fontSize}
backgroundColor="transparent"
flex={1}
secureTextEntry={type === 'password'}
accessible
accessibilityLabel={ariaLabel || accessibilityLabel}
onKeyPress={(e: any) => {
e.persist();
}}
onFocus={() => {
slideOut();
handleFocus(true, onFocus ? onFocus : () => {});
}}
onBlur={(e) => {
// TODO: animation not happening because of component rerender
e.nativeEvent.text && slideIn();
handleFocus(false, onBlur ? onBlur : () => {});
}}
placeholder={isFocused && label ? '' : placeholder}
editable={isDisabled || isReadOnly ? false : true}
// borderRadius={50} //Remove variant props from StyledInput
borderWidth={undefined}
{...(Platform.OS === 'web'
? {
disabled: isDisabled,
cursor: isDisabled ? 'not-allowed' : 'auto',
}
: {})}
style={[
Platform.OS === 'web' && {
// @ts-ignore
outline: 'none',
},
]}
ref={ref}
/>
{InputRightElement ? (
<Flex justify="center" align="center" right={0}>
{InputRightElement}
</Flex>
) : null}
</Box>
);
}}
</Hoverable>
</s> add <Flex {...newProps} bg="transparent">
<Box
bg="transparent"
color={updatedBorderColor}
fontSize={fontSize}
>
{label}
<Box
w="120%"
p="1px"
bg="gray.50"
position="absolute"
right="-10%"
bottom={`${
Math.floor(fontSize / 2) + (Platform.OS === 'ios' ? 1 : 0)
}px`}
zIndex={-1}
/>
</Box>
</Flex>
</Animated.View>
</Flex>
)}
<StyledInput
{...newProps}
fontSize={fontSize}
backgroundColor="transparent"
flex={1}
secureTextEntry={type === 'password'}
accessible
accessibilityLabel={ariaLabel || accessibilityLabel}
onKeyPress={(e: any) => {
e.persist();
}}
onFocus={() => {
slideOut();
handleFocus(true, onFocus ? onFocus : () => {});
}}
onBlur={(e) => {
// TODO: animation not happening because of component rerender
e.nativeEvent.text && slideIn();
handleFocus(false, onBlur ? onBlur : () => {});
}}
placeholder={isFocused && label ? '' : placeholder}
editable={isDisabled || isReadOnly ? false : true}
// borderRadius={50} //Remove variant props from StyledInput
borderWidth={undefined}
{...(Platform.OS === 'web'
? {
disabled: isDisabled,
cursor: isDisabled ? 'not-allowed' : 'auto',
}
: {})}
style={[
Platform.OS === 'web' && {
// @ts-ignore
outline: 'none',
},
]}
ref={ref}
/>
{InputRightElement ? (
<Flex justify="center" align="center" right={0}>
{InputRightElement}
</Flex>
) : null}
</Box> </s> remove ref={ref}
</s> add ref={mergeRefs([ref, _ref])} </s> remove <Hoverable>
{(isHovered: boolean) => {
let updatedBorderColor = borderColorFromProps;
if (isHovered) updatedBorderColor = hoverBorderColor;
else if (isFocused) updatedBorderColor = focusBorderColor;
else if (isInvalid) updatedBorderColor = errorBorderColor;
const focusStyle = {
shadow: 3,
shadowColor: '#2563EB',
};
return (
<Box
borderColor={updatedBorderColor}
borderWidth={borderWidth}
borderBottomWidth={borderBottomWidth}
{...rem}
{...(isDisabled && newProps._isDisabledProps)}
{...computedProps}
{...(isFocused && Platform.OS === 'web' && focusStyle)}
style={style}
</s> add <Box
ref={_ref}
borderColor={updatedBorderColor}
borderWidth={borderWidth}
borderBottomWidth={borderBottomWidth}
{...rem}
{...(isDisabled && newProps._isDisabledProps)}
{...computedProps}
{...(isFocused && Platform.OS === 'web' && focusStyle)}
style={style}
>
{InputLeftElement ? (
<Flex justify="center" align="center" left={0}>
{InputLeftElement}
</Flex>
) : null}
{isFocused && label && (
<Flex position="absolute">
<Animated.View
style={{
transform: [{ translateY: slideAnim, translateX: 4 }],
}} | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"re... | https://github.com/GeekyAnts/NativeBase/commit/025f339d611ae3d72b4f00018d7cbd5c6761b593 | src/components/composites/Accordion/AccordionButton.tsx |
import { mergeRefs } from './../../../utils'; | <mask> import React from 'react';
<mask> import { TouchableOpacity, Platform } from 'react-native';
<mask> import { Hoverable } from './../../../utils';
<mask> import { useThemeProps } from '../../../hooks';
<mask> import { Center } from '../../composites/Center';
<mask> import {
<mask> FormControlContext,
<mask> IFormControlContext,
</s> feat: replace Hoverable with useHover from rn-aria </s> remove import { Hoverable } from './../../../utils';
</s> add </s> remove import { Hoverable } from './../../../utils';
</s> add import { mergeRefs } from './../../../utils';
import { useHover } from '@react-native-aria/interactions'; </s> remove import { Hoverable } from './../../../utils';
</s> add import { mergeRefs } from './../../../utils';
import { useHover } from '@react-native-aria/interactions'; | [
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/025f339d611ae3d72b4f00018d7cbd5c6761b593 | src/components/primitives/Checkbox/Checkbox.tsx |
import { useHover } from '@react-native-aria/interactions'; | <mask> import Icon from '../Icon';
<mask> import { CheckboxContext } from './CheckboxGroup';
<mask> import type { ICheckboxContext, ICheckboxProps } from './types';
<mask> import { useCheckbox } from './useCheckbox';
<mask>
<mask> const Checkbox = ({ icon, ...props }: ICheckboxProps, ref: any) => {
<mask> const formControlContext: IFormControlContext = React.useContext(
<mask> FormControlContext
<mask> );
</s> feat: replace Hoverable with useHover from rn-aria </s> remove import { Hoverable } from './../../../utils';
</s> add import { mergeRefs } from './../../../utils';
import { useHover } from '@react-native-aria/interactions'; </s> remove import { Hoverable } from './../../../utils';
</s> add import { mergeRefs } from './../../../utils';
import { useHover } from '@react-native-aria/interactions'; </s> remove import { Hoverable } from './../../../utils';
</s> add import { mergeRefs } from './../../../utils'; </s> remove import { Hoverable } from './../../../utils';
</s> add | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/025f339d611ae3d72b4f00018d7cbd5c6761b593 | src/components/primitives/Checkbox/Checkbox.tsx |
const _ref = React.useRef(null);
const { isHovered } = useHover({}, _ref);
const outlineColor =
isHovered && !isDisabled
? activeColor
: isChecked
? isDisabled
? borderColor
: activeColor
: borderColor;
| <mask> )
<mask> : null;
<mask>
<mask> return (
<mask> <TouchableOpacity
<mask> activeOpacity={1}
<mask> ref={mergeRefs([ref, _ref])}
<mask> {...inputProps}
<mask> >
</s> feat: replace Hoverable with useHover from rn-aria </s> remove <TouchableOpacity activeOpacity={1} ref={ref} {...inputProps}>
<Hoverable>
{(isHovered: boolean) => {
const outlineColor =
isHovered && !isDisabled
? activeColor
: isChecked
? isDisabled
? borderColor
: activeColor
: borderColor;
return (
<Box
flexDirection="row"
alignItems="center"
{...newProps}
opacity={isDisabled ? 0.4 : 1}
{...(Platform.OS === 'web'
? {
disabled: isDisabled,
cursor: isDisabled ? 'not-allowed' : 'auto',
}
: {})}
>
<Center
backgroundColor={
isChecked
? isDisabled
? borderColor
: activeColor
: 'transparent'
}
borderColor={outlineColor}
borderWidth={1}
borderRadius={4}
p={1}
>
{icon && sizedIcon && isChecked ? (
sizedIcon()
) : (
<Icon
name="check-bold"
type="MaterialCommunityIcons"
size={size}
color={iconColor}
opacity={isChecked ? 1 : 0}
/>
)}
</Center>
{props.children}
</Box>
);
}}
</Hoverable>
</s> add <TouchableOpacity
activeOpacity={1}
ref={mergeRefs([ref, _ref])}
{...inputProps}
>
<Box
flexDirection="row"
alignItems="center"
{...newProps}
opacity={isDisabled ? 0.4 : 1}
{...(Platform.OS === 'web'
? {
disabled: isDisabled,
cursor: isDisabled ? 'not-allowed' : 'auto',
}
: {})}
>
<Center
backgroundColor={
isChecked ? (isDisabled ? borderColor : activeColor) : 'transparent'
}
borderColor={outlineColor}
borderWidth={1}
borderRadius={4}
p={1}
>
{icon && sizedIcon && isChecked ? (
sizedIcon()
) : (
<Icon
name="check-bold"
type="MaterialCommunityIcons"
size={size}
color={iconColor}
opacity={isChecked ? 1 : 0}
/>
)}
</Center>
{props.children}
</Box> </s> remove <TouchableOpacity activeOpacity={1} ref={ref} {...inputProps}>
<Hoverable>
{(isHovered: boolean) => {
const outlineColor =
isHovered && !isDisabled
? activeColor
: checked
? isDisabled
? borderColor
: activeColor
: borderColor;
return (
<Box
flexDirection="row"
justifyContent="center"
alignItems="center"
{...newProps}
opacity={isDisabled ? 0.4 : 1}
{...(Platform.OS === 'web'
? {
disabled: isDisabled,
cursor: isDisabled ? 'not-allowed' : 'auto',
}
: {})}
>
<Box
borderColor={outlineColor}
backgroundColor={isDisabled ? 'muted.200' : 'transparent'}
borderWidth={1}
display="flex"
justifyContent="center"
alignItems="center"
borderRadius={999}
p={'2px'}
>
{icon && checked ? (
sizedIcon()
) : (
<Icon
name="circle"
type="MaterialCommunityIcons"
size={size}
color={
checked
? isDisabled
? borderColor
: activeColor
: 'transparent'
}
opacity={checked ? 1 : 0}
/>
)}
</Box>
{children}
</Box>
);
}}
</Hoverable>
</s> add <TouchableOpacity
activeOpacity={1}
ref={mergeRefs([ref, _ref])}
{...inputProps}
>
<Box
flexDirection="row"
justifyContent="center"
alignItems="center"
{...newProps}
opacity={isDisabled ? 0.4 : 1}
{...(Platform.OS === 'web'
? {
disabled: isDisabled,
cursor: isDisabled ? 'not-allowed' : 'auto',
}
: {})}
>
<Box
borderColor={outlineColor}
backgroundColor={isDisabled ? 'muted.200' : 'transparent'}
borderWidth={1}
display="flex"
justifyContent="center"
alignItems="center"
borderRadius={999}
p={'2px'}
>
{icon && checked ? (
sizedIcon()
) : (
<Icon
name="circle"
type="MaterialCommunityIcons"
size={size}
color={
checked
? isDisabled
? borderColor
: activeColor
: 'transparent'
}
opacity={checked ? 1 : 0}
/>
)}
</Box>
{children}
</Box> </s> remove ref={ref}
</s> add ref={mergeRefs([ref, _ref])} | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/025f339d611ae3d72b4f00018d7cbd5c6761b593 | src/components/primitives/Checkbox/Checkbox.tsx |
<TouchableOpacity
activeOpacity={1}
ref={mergeRefs([ref, _ref])}
{...inputProps}
>
<Box
flexDirection="row"
alignItems="center"
{...newProps}
opacity={isDisabled ? 0.4 : 1}
{...(Platform.OS === 'web'
? {
disabled: isDisabled,
cursor: isDisabled ? 'not-allowed' : 'auto',
}
: {})}
>
<Center
backgroundColor={
isChecked ? (isDisabled ? borderColor : activeColor) : 'transparent'
}
borderColor={outlineColor}
borderWidth={1}
borderRadius={4}
p={1}
>
{icon && sizedIcon && isChecked ? (
sizedIcon()
) : (
<Icon
name="check-bold"
type="MaterialCommunityIcons"
size={size}
color={iconColor}
opacity={isChecked ? 1 : 0}
/>
)}
</Center>
{props.children}
</Box> | <mask> )
<mask> : null;
<mask>
<mask> return (
<mask> <TouchableOpacity activeOpacity={1} ref={ref} {...inputProps}>
<mask> <Hoverable>
<mask> {(isHovered: boolean) => {
<mask> const outlineColor =
<mask> isHovered && !isDisabled
<mask> ? activeColor
<mask> : isChecked
<mask> ? isDisabled
<mask> ? borderColor
<mask> : activeColor
<mask> : borderColor;
<mask> return (
<mask> <Box
<mask> flexDirection="row"
<mask> alignItems="center"
<mask> {...newProps}
<mask> opacity={isDisabled ? 0.4 : 1}
<mask> {...(Platform.OS === 'web'
<mask> ? {
<mask> disabled: isDisabled,
<mask> cursor: isDisabled ? 'not-allowed' : 'auto',
<mask> }
<mask> : {})}
<mask> >
<mask> <Center
<mask> backgroundColor={
<mask> isChecked
<mask> ? isDisabled
<mask> ? borderColor
<mask> : activeColor
<mask> : 'transparent'
<mask> }
<mask> borderColor={outlineColor}
<mask> borderWidth={1}
<mask> borderRadius={4}
<mask> p={1}
<mask> >
<mask> {icon && sizedIcon && isChecked ? (
<mask> sizedIcon()
<mask> ) : (
<mask> <Icon
<mask> name="check-bold"
<mask> type="MaterialCommunityIcons"
<mask> size={size}
<mask> color={iconColor}
<mask> opacity={isChecked ? 1 : 0}
<mask> />
<mask> )}
<mask> </Center>
<mask> {props.children}
<mask> </Box>
<mask> );
<mask> }}
<mask> </Hoverable>
<mask> </TouchableOpacity>
<mask> );
<mask> };
<mask>
<mask> export default React.memo(
</s> feat: replace Hoverable with useHover from rn-aria </s> remove <TouchableOpacity activeOpacity={1} ref={ref} {...inputProps}>
<Hoverable>
{(isHovered: boolean) => {
const outlineColor =
isHovered && !isDisabled
? activeColor
: checked
? isDisabled
? borderColor
: activeColor
: borderColor;
return (
<Box
flexDirection="row"
justifyContent="center"
alignItems="center"
{...newProps}
opacity={isDisabled ? 0.4 : 1}
{...(Platform.OS === 'web'
? {
disabled: isDisabled,
cursor: isDisabled ? 'not-allowed' : 'auto',
}
: {})}
>
<Box
borderColor={outlineColor}
backgroundColor={isDisabled ? 'muted.200' : 'transparent'}
borderWidth={1}
display="flex"
justifyContent="center"
alignItems="center"
borderRadius={999}
p={'2px'}
>
{icon && checked ? (
sizedIcon()
) : (
<Icon
name="circle"
type="MaterialCommunityIcons"
size={size}
color={
checked
? isDisabled
? borderColor
: activeColor
: 'transparent'
}
opacity={checked ? 1 : 0}
/>
)}
</Box>
{children}
</Box>
);
}}
</Hoverable>
</s> add <TouchableOpacity
activeOpacity={1}
ref={mergeRefs([ref, _ref])}
{...inputProps}
>
<Box
flexDirection="row"
justifyContent="center"
alignItems="center"
{...newProps}
opacity={isDisabled ? 0.4 : 1}
{...(Platform.OS === 'web'
? {
disabled: isDisabled,
cursor: isDisabled ? 'not-allowed' : 'auto',
}
: {})}
>
<Box
borderColor={outlineColor}
backgroundColor={isDisabled ? 'muted.200' : 'transparent'}
borderWidth={1}
display="flex"
justifyContent="center"
alignItems="center"
borderRadius={999}
p={'2px'}
>
{icon && checked ? (
sizedIcon()
) : (
<Icon
name="circle"
type="MaterialCommunityIcons"
size={size}
color={
checked
? isDisabled
? borderColor
: activeColor
: 'transparent'
}
opacity={checked ? 1 : 0}
/>
)}
</Box>
{children}
</Box> </s> remove <Hoverable>
{(isHovered: boolean) => {
return (
<Box
display="flex"
flexDirection="row"
justifyContent="space-between"
alignItems="center"
{...newProps}
{...(isHovered && _hover)}
{...(isOpen && _expanded)}
{...(isDisabled && _disabled)}
{...(!index && { borderTopColor: 'transparent' })}
{...(Platform.OS === 'web'
? {
disabled: isDisabled,
cursor: isDisabled ? 'not-allowed' : 'auto',
}
: {})}
>
{children}
</Box>
);
}}
</Hoverable>
</s> add <Box
display="flex"
flexDirection="row"
justifyContent="space-between"
alignItems="center"
{...newProps}
{...(isHovered && _hover)}
{...(isOpen && _expanded)}
{...(isDisabled && _disabled)}
{...(!index && { borderTopColor: 'transparent' })}
{...(Platform.OS === 'web'
? {
disabled: isDisabled,
cursor: isDisabled ? 'not-allowed' : 'auto',
}
: {})}
>
{children}
</Box> </s> remove {InputLeftElement ? (
<Flex justify="center" align="center" left={0}>
{InputLeftElement}
</Flex>
) : null}
{isFocused && label && (
<Flex position="absolute">
<Animated.View
style={{
transform: [{ translateY: slideAnim, translateX: 4 }],
}}
>
<Flex {...newProps} bg="transparent">
<Box
bg="transparent"
color={updatedBorderColor}
fontSize={fontSize}
>
{label}
<Box
w="120%"
p="1px"
bg="gray.50"
position="absolute"
right="-10%"
bottom={`${
Math.floor(fontSize / 2) +
(Platform.OS === 'ios' ? 1 : 0)
}px`}
zIndex={-1}
/>
</Box>
</Flex>
</Animated.View>
</Flex>
)}
<StyledInput
{...newProps}
fontSize={fontSize}
backgroundColor="transparent"
flex={1}
secureTextEntry={type === 'password'}
accessible
accessibilityLabel={ariaLabel || accessibilityLabel}
onKeyPress={(e: any) => {
e.persist();
}}
onFocus={() => {
slideOut();
handleFocus(true, onFocus ? onFocus : () => {});
}}
onBlur={(e) => {
// TODO: animation not happening because of component rerender
e.nativeEvent.text && slideIn();
handleFocus(false, onBlur ? onBlur : () => {});
}}
placeholder={isFocused && label ? '' : placeholder}
editable={isDisabled || isReadOnly ? false : true}
// borderRadius={50} //Remove variant props from StyledInput
borderWidth={undefined}
{...(Platform.OS === 'web'
? {
disabled: isDisabled,
cursor: isDisabled ? 'not-allowed' : 'auto',
}
: {})}
style={[
Platform.OS === 'web' && {
// @ts-ignore
outline: 'none',
},
]}
ref={ref}
/>
{InputRightElement ? (
<Flex justify="center" align="center" right={0}>
{InputRightElement}
</Flex>
) : null}
</Box>
);
}}
</Hoverable>
</s> add <Flex {...newProps} bg="transparent">
<Box
bg="transparent"
color={updatedBorderColor}
fontSize={fontSize}
>
{label}
<Box
w="120%"
p="1px"
bg="gray.50"
position="absolute"
right="-10%"
bottom={`${
Math.floor(fontSize / 2) + (Platform.OS === 'ios' ? 1 : 0)
}px`}
zIndex={-1}
/>
</Box>
</Flex>
</Animated.View>
</Flex>
)}
<StyledInput
{...newProps}
fontSize={fontSize}
backgroundColor="transparent"
flex={1}
secureTextEntry={type === 'password'}
accessible
accessibilityLabel={ariaLabel || accessibilityLabel}
onKeyPress={(e: any) => {
e.persist();
}}
onFocus={() => {
slideOut();
handleFocus(true, onFocus ? onFocus : () => {});
}}
onBlur={(e) => {
// TODO: animation not happening because of component rerender
e.nativeEvent.text && slideIn();
handleFocus(false, onBlur ? onBlur : () => {});
}}
placeholder={isFocused && label ? '' : placeholder}
editable={isDisabled || isReadOnly ? false : true}
// borderRadius={50} //Remove variant props from StyledInput
borderWidth={undefined}
{...(Platform.OS === 'web'
? {
disabled: isDisabled,
cursor: isDisabled ? 'not-allowed' : 'auto',
}
: {})}
style={[
Platform.OS === 'web' && {
// @ts-ignore
outline: 'none',
},
]}
ref={ref}
/>
{InputRightElement ? (
<Flex justify="center" align="center" right={0}>
{InputRightElement}
</Flex>
) : null}
</Box> | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"re... | https://github.com/GeekyAnts/NativeBase/commit/025f339d611ae3d72b4f00018d7cbd5c6761b593 | src/components/primitives/Checkbox/Checkbox.tsx |
<mask> import React, { forwardRef, useState } from 'react';
<mask> import { TextInput, Animated, Platform } from 'react-native';
<mask> import { Hoverable } from './../../../utils';
<mask> import styled from 'styled-components/native';
<mask> import {
<mask> border,
<mask> flex,
<mask> space,
</s> feat: replace Hoverable with useHover from rn-aria </s> remove import { Hoverable } from './../../../utils';
</s> add import { mergeRefs } from './../../../utils'; </s> remove import { Hoverable } from './../../../utils';
</s> add import { mergeRefs } from './../../../utils';
import { useHover } from '@react-native-aria/interactions'; </s> remove import { Hoverable } from './../../../utils';
</s> add import { mergeRefs } from './../../../utils';
import { useHover } from '@react-native-aria/interactions'; | [
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/025f339d611ae3d72b4f00018d7cbd5c6761b593 | src/components/primitives/Input/index.tsx | |
import { useHover } from '@react-native-aria/interactions'; | <mask> import type { IInputProps } from './types';
<mask> import { InputRightAddon, InputGroup, InputLeftAddon } from './InputGroup';
<mask> import { useThemeProps } from '../../../hooks';
<mask> import { themeTools } from '../../../theme';
<mask>
<mask> const StyledInput = styled(TextInput)<IInputProps>(
<mask> flex,
<mask> color,
<mask> space,
<mask> layout,
</s> feat: replace Hoverable with useHover from rn-aria </s> remove import { Hoverable } from './../../../utils';
</s> add import { mergeRefs } from './../../../utils';
import { useHover } from '@react-native-aria/interactions'; </s> remove import { Hoverable } from './../../../utils';
</s> add import { mergeRefs } from './../../../utils';
import { useHover } from '@react-native-aria/interactions'; </s> remove import { Hoverable } from './../../../utils';
</s> add </s> remove import { Hoverable } from './../../../utils';
</s> add import { mergeRefs } from './../../../utils'; | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/025f339d611ae3d72b4f00018d7cbd5c6761b593 | src/components/primitives/Input/index.tsx |
const _ref = React.useRef(null);
const { isHovered } = useHover({}, _ref);
let updatedBorderColor = borderColorFromProps;
if (isHovered) updatedBorderColor = hoverBorderColor;
else if (isFocused) updatedBorderColor = focusBorderColor;
else if (isInvalid) updatedBorderColor = errorBorderColor;
const focusStyle = {
shadow: 3,
shadowColor: '#2563EB',
};
| <mask> }).start();
<mask> };
<mask>
<mask> return (
<mask> <Box w={isFullWidth ? '100%' : 'auto'} {...layoutProps}>
<mask> <Box
<mask> ref={_ref}
</s> feat: replace Hoverable with useHover from rn-aria </s> remove <Hoverable>
{(isHovered: boolean) => {
let updatedBorderColor = borderColorFromProps;
if (isHovered) updatedBorderColor = hoverBorderColor;
else if (isFocused) updatedBorderColor = focusBorderColor;
else if (isInvalid) updatedBorderColor = errorBorderColor;
const focusStyle = {
shadow: 3,
shadowColor: '#2563EB',
};
return (
<Box
borderColor={updatedBorderColor}
borderWidth={borderWidth}
borderBottomWidth={borderBottomWidth}
{...rem}
{...(isDisabled && newProps._isDisabledProps)}
{...computedProps}
{...(isFocused && Platform.OS === 'web' && focusStyle)}
style={style}
</s> add <Box
ref={_ref}
borderColor={updatedBorderColor}
borderWidth={borderWidth}
borderBottomWidth={borderBottomWidth}
{...rem}
{...(isDisabled && newProps._isDisabledProps)}
{...computedProps}
{...(isFocused && Platform.OS === 'web' && focusStyle)}
style={style}
>
{InputLeftElement ? (
<Flex justify="center" align="center" left={0}>
{InputLeftElement}
</Flex>
) : null}
{isFocused && label && (
<Flex position="absolute">
<Animated.View
style={{
transform: [{ translateY: slideAnim, translateX: 4 }],
}} </s> remove <TouchableOpacity activeOpacity={1} ref={ref} {...inputProps}>
<Hoverable>
{(isHovered: boolean) => {
const outlineColor =
isHovered && !isDisabled
? activeColor
: checked
? isDisabled
? borderColor
: activeColor
: borderColor;
return (
<Box
flexDirection="row"
justifyContent="center"
alignItems="center"
{...newProps}
opacity={isDisabled ? 0.4 : 1}
{...(Platform.OS === 'web'
? {
disabled: isDisabled,
cursor: isDisabled ? 'not-allowed' : 'auto',
}
: {})}
>
<Box
borderColor={outlineColor}
backgroundColor={isDisabled ? 'muted.200' : 'transparent'}
borderWidth={1}
display="flex"
justifyContent="center"
alignItems="center"
borderRadius={999}
p={'2px'}
>
{icon && checked ? (
sizedIcon()
) : (
<Icon
name="circle"
type="MaterialCommunityIcons"
size={size}
color={
checked
? isDisabled
? borderColor
: activeColor
: 'transparent'
}
opacity={checked ? 1 : 0}
/>
)}
</Box>
{children}
</Box>
);
}}
</Hoverable>
</s> add <TouchableOpacity
activeOpacity={1}
ref={mergeRefs([ref, _ref])}
{...inputProps}
>
<Box
flexDirection="row"
justifyContent="center"
alignItems="center"
{...newProps}
opacity={isDisabled ? 0.4 : 1}
{...(Platform.OS === 'web'
? {
disabled: isDisabled,
cursor: isDisabled ? 'not-allowed' : 'auto',
}
: {})}
>
<Box
borderColor={outlineColor}
backgroundColor={isDisabled ? 'muted.200' : 'transparent'}
borderWidth={1}
display="flex"
justifyContent="center"
alignItems="center"
borderRadius={999}
p={'2px'}
>
{icon && checked ? (
sizedIcon()
) : (
<Icon
name="circle"
type="MaterialCommunityIcons"
size={size}
color={
checked
? isDisabled
? borderColor
: activeColor
: 'transparent'
}
opacity={checked ? 1 : 0}
/>
)}
</Box>
{children}
</Box> </s> remove ref={ref}
</s> add ref={mergeRefs([ref, _ref])} </s> remove <Hoverable>
{(isHovered: boolean) => {
return (
<Box
display="flex"
flexDirection="row"
justifyContent="space-between"
alignItems="center"
{...newProps}
{...(isHovered && _hover)}
{...(isOpen && _expanded)}
{...(isDisabled && _disabled)}
{...(!index && { borderTopColor: 'transparent' })}
{...(Platform.OS === 'web'
? {
disabled: isDisabled,
cursor: isDisabled ? 'not-allowed' : 'auto',
}
: {})}
>
{children}
</Box>
);
}}
</Hoverable>
</s> add <Box
display="flex"
flexDirection="row"
justifyContent="space-between"
alignItems="center"
{...newProps}
{...(isHovered && _hover)}
{...(isOpen && _expanded)}
{...(isDisabled && _disabled)}
{...(!index && { borderTopColor: 'transparent' })}
{...(Platform.OS === 'web'
? {
disabled: isDisabled,
cursor: isDisabled ? 'not-allowed' : 'auto',
}
: {})}
>
{children}
</Box> </s> remove <TouchableOpacity activeOpacity={1} ref={ref} {...inputProps}>
<Hoverable>
{(isHovered: boolean) => {
const outlineColor =
isHovered && !isDisabled
? activeColor
: isChecked
? isDisabled
? borderColor
: activeColor
: borderColor;
return (
<Box
flexDirection="row"
alignItems="center"
{...newProps}
opacity={isDisabled ? 0.4 : 1}
{...(Platform.OS === 'web'
? {
disabled: isDisabled,
cursor: isDisabled ? 'not-allowed' : 'auto',
}
: {})}
>
<Center
backgroundColor={
isChecked
? isDisabled
? borderColor
: activeColor
: 'transparent'
}
borderColor={outlineColor}
borderWidth={1}
borderRadius={4}
p={1}
>
{icon && sizedIcon && isChecked ? (
sizedIcon()
) : (
<Icon
name="check-bold"
type="MaterialCommunityIcons"
size={size}
color={iconColor}
opacity={isChecked ? 1 : 0}
/>
)}
</Center>
{props.children}
</Box>
);
}}
</Hoverable>
</s> add <TouchableOpacity
activeOpacity={1}
ref={mergeRefs([ref, _ref])}
{...inputProps}
>
<Box
flexDirection="row"
alignItems="center"
{...newProps}
opacity={isDisabled ? 0.4 : 1}
{...(Platform.OS === 'web'
? {
disabled: isDisabled,
cursor: isDisabled ? 'not-allowed' : 'auto',
}
: {})}
>
<Center
backgroundColor={
isChecked ? (isDisabled ? borderColor : activeColor) : 'transparent'
}
borderColor={outlineColor}
borderWidth={1}
borderRadius={4}
p={1}
>
{icon && sizedIcon && isChecked ? (
sizedIcon()
) : (
<Icon
name="check-bold"
type="MaterialCommunityIcons"
size={size}
color={iconColor}
opacity={isChecked ? 1 : 0}
/>
)}
</Center>
{props.children}
</Box> | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/025f339d611ae3d72b4f00018d7cbd5c6761b593 | src/components/primitives/Input/index.tsx |
<Box
ref={_ref}
borderColor={updatedBorderColor}
borderWidth={borderWidth}
borderBottomWidth={borderBottomWidth}
{...rem}
{...(isDisabled && newProps._isDisabledProps)}
{...computedProps}
{...(isFocused && Platform.OS === 'web' && focusStyle)}
style={style}
>
{InputLeftElement ? (
<Flex justify="center" align="center" left={0}>
{InputLeftElement}
</Flex>
) : null}
{isFocused && label && (
<Flex position="absolute">
<Animated.View
style={{
transform: [{ translateY: slideAnim, translateX: 4 }],
}} | <mask> };
<mask>
<mask> return (
<mask> <Box w={isFullWidth ? '100%' : 'auto'} {...layoutProps}>
<mask> <Hoverable>
<mask> {(isHovered: boolean) => {
<mask> let updatedBorderColor = borderColorFromProps;
<mask> if (isHovered) updatedBorderColor = hoverBorderColor;
<mask> else if (isFocused) updatedBorderColor = focusBorderColor;
<mask> else if (isInvalid) updatedBorderColor = errorBorderColor;
<mask> const focusStyle = {
<mask> shadow: 3,
<mask> shadowColor: '#2563EB',
<mask> };
<mask>
<mask> return (
<mask> <Box
<mask> borderColor={updatedBorderColor}
<mask> borderWidth={borderWidth}
<mask> borderBottomWidth={borderBottomWidth}
<mask> {...rem}
<mask> {...(isDisabled && newProps._isDisabledProps)}
<mask> {...computedProps}
<mask> {...(isFocused && Platform.OS === 'web' && focusStyle)}
<mask> style={style}
<mask> >
<mask> {InputLeftElement ? (
<mask> <Flex justify="center" align="center" left={0}>
<mask> {InputLeftElement}
<mask> </Flex>
</s> feat: replace Hoverable with useHover from rn-aria </s> remove {InputLeftElement ? (
<Flex justify="center" align="center" left={0}>
{InputLeftElement}
</Flex>
) : null}
{isFocused && label && (
<Flex position="absolute">
<Animated.View
style={{
transform: [{ translateY: slideAnim, translateX: 4 }],
}}
>
<Flex {...newProps} bg="transparent">
<Box
bg="transparent"
color={updatedBorderColor}
fontSize={fontSize}
>
{label}
<Box
w="120%"
p="1px"
bg="gray.50"
position="absolute"
right="-10%"
bottom={`${
Math.floor(fontSize / 2) +
(Platform.OS === 'ios' ? 1 : 0)
}px`}
zIndex={-1}
/>
</Box>
</Flex>
</Animated.View>
</Flex>
)}
<StyledInput
{...newProps}
fontSize={fontSize}
backgroundColor="transparent"
flex={1}
secureTextEntry={type === 'password'}
accessible
accessibilityLabel={ariaLabel || accessibilityLabel}
onKeyPress={(e: any) => {
e.persist();
}}
onFocus={() => {
slideOut();
handleFocus(true, onFocus ? onFocus : () => {});
}}
onBlur={(e) => {
// TODO: animation not happening because of component rerender
e.nativeEvent.text && slideIn();
handleFocus(false, onBlur ? onBlur : () => {});
}}
placeholder={isFocused && label ? '' : placeholder}
editable={isDisabled || isReadOnly ? false : true}
// borderRadius={50} //Remove variant props from StyledInput
borderWidth={undefined}
{...(Platform.OS === 'web'
? {
disabled: isDisabled,
cursor: isDisabled ? 'not-allowed' : 'auto',
}
: {})}
style={[
Platform.OS === 'web' && {
// @ts-ignore
outline: 'none',
},
]}
ref={ref}
/>
{InputRightElement ? (
<Flex justify="center" align="center" right={0}>
{InputRightElement}
</Flex>
) : null}
</Box>
);
}}
</Hoverable>
</s> add <Flex {...newProps} bg="transparent">
<Box
bg="transparent"
color={updatedBorderColor}
fontSize={fontSize}
>
{label}
<Box
w="120%"
p="1px"
bg="gray.50"
position="absolute"
right="-10%"
bottom={`${
Math.floor(fontSize / 2) + (Platform.OS === 'ios' ? 1 : 0)
}px`}
zIndex={-1}
/>
</Box>
</Flex>
</Animated.View>
</Flex>
)}
<StyledInput
{...newProps}
fontSize={fontSize}
backgroundColor="transparent"
flex={1}
secureTextEntry={type === 'password'}
accessible
accessibilityLabel={ariaLabel || accessibilityLabel}
onKeyPress={(e: any) => {
e.persist();
}}
onFocus={() => {
slideOut();
handleFocus(true, onFocus ? onFocus : () => {});
}}
onBlur={(e) => {
// TODO: animation not happening because of component rerender
e.nativeEvent.text && slideIn();
handleFocus(false, onBlur ? onBlur : () => {});
}}
placeholder={isFocused && label ? '' : placeholder}
editable={isDisabled || isReadOnly ? false : true}
// borderRadius={50} //Remove variant props from StyledInput
borderWidth={undefined}
{...(Platform.OS === 'web'
? {
disabled: isDisabled,
cursor: isDisabled ? 'not-allowed' : 'auto',
}
: {})}
style={[
Platform.OS === 'web' && {
// @ts-ignore
outline: 'none',
},
]}
ref={ref}
/>
{InputRightElement ? (
<Flex justify="center" align="center" right={0}>
{InputRightElement}
</Flex>
) : null}
</Box> </s> remove <Hoverable>
{(isHovered: boolean) => {
return (
<Box
display="flex"
flexDirection="row"
justifyContent="space-between"
alignItems="center"
{...newProps}
{...(isHovered && _hover)}
{...(isOpen && _expanded)}
{...(isDisabled && _disabled)}
{...(!index && { borderTopColor: 'transparent' })}
{...(Platform.OS === 'web'
? {
disabled: isDisabled,
cursor: isDisabled ? 'not-allowed' : 'auto',
}
: {})}
>
{children}
</Box>
);
}}
</Hoverable>
</s> add <Box
display="flex"
flexDirection="row"
justifyContent="space-between"
alignItems="center"
{...newProps}
{...(isHovered && _hover)}
{...(isOpen && _expanded)}
{...(isDisabled && _disabled)}
{...(!index && { borderTopColor: 'transparent' })}
{...(Platform.OS === 'web'
? {
disabled: isDisabled,
cursor: isDisabled ? 'not-allowed' : 'auto',
}
: {})}
>
{children}
</Box> </s> remove <TouchableOpacity activeOpacity={1} ref={ref} {...inputProps}>
<Hoverable>
{(isHovered: boolean) => {
const outlineColor =
isHovered && !isDisabled
? activeColor
: checked
? isDisabled
? borderColor
: activeColor
: borderColor;
return (
<Box
flexDirection="row"
justifyContent="center"
alignItems="center"
{...newProps}
opacity={isDisabled ? 0.4 : 1}
{...(Platform.OS === 'web'
? {
disabled: isDisabled,
cursor: isDisabled ? 'not-allowed' : 'auto',
}
: {})}
>
<Box
borderColor={outlineColor}
backgroundColor={isDisabled ? 'muted.200' : 'transparent'}
borderWidth={1}
display="flex"
justifyContent="center"
alignItems="center"
borderRadius={999}
p={'2px'}
>
{icon && checked ? (
sizedIcon()
) : (
<Icon
name="circle"
type="MaterialCommunityIcons"
size={size}
color={
checked
? isDisabled
? borderColor
: activeColor
: 'transparent'
}
opacity={checked ? 1 : 0}
/>
)}
</Box>
{children}
</Box>
);
}}
</Hoverable>
</s> add <TouchableOpacity
activeOpacity={1}
ref={mergeRefs([ref, _ref])}
{...inputProps}
>
<Box
flexDirection="row"
justifyContent="center"
alignItems="center"
{...newProps}
opacity={isDisabled ? 0.4 : 1}
{...(Platform.OS === 'web'
? {
disabled: isDisabled,
cursor: isDisabled ? 'not-allowed' : 'auto',
}
: {})}
>
<Box
borderColor={outlineColor}
backgroundColor={isDisabled ? 'muted.200' : 'transparent'}
borderWidth={1}
display="flex"
justifyContent="center"
alignItems="center"
borderRadius={999}
p={'2px'}
>
{icon && checked ? (
sizedIcon()
) : (
<Icon
name="circle"
type="MaterialCommunityIcons"
size={size}
color={
checked
? isDisabled
? borderColor
: activeColor
: 'transparent'
}
opacity={checked ? 1 : 0}
/>
)}
</Box>
{children}
</Box> | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"ke... | https://github.com/GeekyAnts/NativeBase/commit/025f339d611ae3d72b4f00018d7cbd5c6761b593 | src/components/primitives/Input/index.tsx |
<Flex {...newProps} bg="transparent">
<Box
bg="transparent"
color={updatedBorderColor}
fontSize={fontSize}
>
{label}
<Box
w="120%"
p="1px"
bg="gray.50"
position="absolute"
right="-10%"
bottom={`${
Math.floor(fontSize / 2) + (Platform.OS === 'ios' ? 1 : 0)
}px`}
zIndex={-1}
/>
</Box>
</Flex>
</Animated.View>
</Flex>
)}
<StyledInput
{...newProps}
fontSize={fontSize}
backgroundColor="transparent"
flex={1}
secureTextEntry={type === 'password'}
accessible
accessibilityLabel={ariaLabel || accessibilityLabel}
onKeyPress={(e: any) => {
e.persist();
}}
onFocus={() => {
slideOut();
handleFocus(true, onFocus ? onFocus : () => {});
}}
onBlur={(e) => {
// TODO: animation not happening because of component rerender
e.nativeEvent.text && slideIn();
handleFocus(false, onBlur ? onBlur : () => {});
}}
placeholder={isFocused && label ? '' : placeholder}
editable={isDisabled || isReadOnly ? false : true}
// borderRadius={50} //Remove variant props from StyledInput
borderWidth={undefined}
{...(Platform.OS === 'web'
? {
disabled: isDisabled,
cursor: isDisabled ? 'not-allowed' : 'auto',
}
: {})}
style={[
Platform.OS === 'web' && {
// @ts-ignore
outline: 'none',
},
]}
ref={ref}
/>
{InputRightElement ? (
<Flex justify="center" align="center" right={0}>
{InputRightElement}
</Flex>
) : null}
</Box> | <mask> {...computedProps}
<mask> {...(isFocused && Platform.OS === 'web' && focusStyle)}
<mask> style={style}
<mask> >
<mask> {InputLeftElement ? (
<mask> <Flex justify="center" align="center" left={0}>
<mask> {InputLeftElement}
<mask> </Flex>
<mask> ) : null}
<mask> {isFocused && label && (
<mask> <Flex position="absolute">
<mask> <Animated.View
<mask> style={{
<mask> transform: [{ translateY: slideAnim, translateX: 4 }],
<mask> }}
<mask> >
<mask> <Flex {...newProps} bg="transparent">
<mask> <Box
<mask> bg="transparent"
<mask> color={updatedBorderColor}
<mask> fontSize={fontSize}
<mask> >
<mask> {label}
<mask> <Box
<mask> w="120%"
<mask> p="1px"
<mask> bg="gray.50"
<mask> position="absolute"
<mask> right="-10%"
<mask> bottom={`${
<mask> Math.floor(fontSize / 2) +
<mask> (Platform.OS === 'ios' ? 1 : 0)
<mask> }px`}
<mask> zIndex={-1}
<mask> />
<mask> </Box>
<mask> </Flex>
<mask> </Animated.View>
<mask> </Flex>
<mask> )}
<mask> <StyledInput
<mask> {...newProps}
<mask> fontSize={fontSize}
<mask> backgroundColor="transparent"
<mask> flex={1}
<mask> secureTextEntry={type === 'password'}
<mask> accessible
<mask> accessibilityLabel={ariaLabel || accessibilityLabel}
<mask> onKeyPress={(e: any) => {
<mask> e.persist();
<mask> }}
<mask> onFocus={() => {
<mask> slideOut();
<mask> handleFocus(true, onFocus ? onFocus : () => {});
<mask> }}
<mask> onBlur={(e) => {
<mask> // TODO: animation not happening because of component rerender
<mask> e.nativeEvent.text && slideIn();
<mask> handleFocus(false, onBlur ? onBlur : () => {});
<mask> }}
<mask> placeholder={isFocused && label ? '' : placeholder}
<mask> editable={isDisabled || isReadOnly ? false : true}
<mask> // borderRadius={50} //Remove variant props from StyledInput
<mask> borderWidth={undefined}
<mask> {...(Platform.OS === 'web'
<mask> ? {
<mask> disabled: isDisabled,
<mask> cursor: isDisabled ? 'not-allowed' : 'auto',
<mask> }
<mask> : {})}
<mask> style={[
<mask> Platform.OS === 'web' && {
<mask> // @ts-ignore
<mask> outline: 'none',
<mask> },
<mask> ]}
<mask> ref={ref}
<mask> />
<mask> {InputRightElement ? (
<mask> <Flex justify="center" align="center" right={0}>
<mask> {InputRightElement}
<mask> </Flex>
<mask> ) : null}
<mask> </Box>
<mask> );
<mask> }}
<mask> </Hoverable>
<mask>
<mask> {isInvalid && errorMessage ? (
<mask> <Text
<mask> ml={2}
<mask> color={errorMessageColor ? errorMessageColor : 'danger.600'}
</s> feat: replace Hoverable with useHover from rn-aria </s> remove <Hoverable>
{(isHovered: boolean) => {
let updatedBorderColor = borderColorFromProps;
if (isHovered) updatedBorderColor = hoverBorderColor;
else if (isFocused) updatedBorderColor = focusBorderColor;
else if (isInvalid) updatedBorderColor = errorBorderColor;
const focusStyle = {
shadow: 3,
shadowColor: '#2563EB',
};
return (
<Box
borderColor={updatedBorderColor}
borderWidth={borderWidth}
borderBottomWidth={borderBottomWidth}
{...rem}
{...(isDisabled && newProps._isDisabledProps)}
{...computedProps}
{...(isFocused && Platform.OS === 'web' && focusStyle)}
style={style}
</s> add <Box
ref={_ref}
borderColor={updatedBorderColor}
borderWidth={borderWidth}
borderBottomWidth={borderBottomWidth}
{...rem}
{...(isDisabled && newProps._isDisabledProps)}
{...computedProps}
{...(isFocused && Platform.OS === 'web' && focusStyle)}
style={style}
>
{InputLeftElement ? (
<Flex justify="center" align="center" left={0}>
{InputLeftElement}
</Flex>
) : null}
{isFocused && label && (
<Flex position="absolute">
<Animated.View
style={{
transform: [{ translateY: slideAnim, translateX: 4 }],
}} </s> remove <Hoverable>
{(isHovered: boolean) => {
return (
<Box
display="flex"
flexDirection="row"
justifyContent="space-between"
alignItems="center"
{...newProps}
{...(isHovered && _hover)}
{...(isOpen && _expanded)}
{...(isDisabled && _disabled)}
{...(!index && { borderTopColor: 'transparent' })}
{...(Platform.OS === 'web'
? {
disabled: isDisabled,
cursor: isDisabled ? 'not-allowed' : 'auto',
}
: {})}
>
{children}
</Box>
);
}}
</Hoverable>
</s> add <Box
display="flex"
flexDirection="row"
justifyContent="space-between"
alignItems="center"
{...newProps}
{...(isHovered && _hover)}
{...(isOpen && _expanded)}
{...(isDisabled && _disabled)}
{...(!index && { borderTopColor: 'transparent' })}
{...(Platform.OS === 'web'
? {
disabled: isDisabled,
cursor: isDisabled ? 'not-allowed' : 'auto',
}
: {})}
>
{children}
</Box> </s> remove <TouchableOpacity activeOpacity={1} ref={ref} {...inputProps}>
<Hoverable>
{(isHovered: boolean) => {
const outlineColor =
isHovered && !isDisabled
? activeColor
: isChecked
? isDisabled
? borderColor
: activeColor
: borderColor;
return (
<Box
flexDirection="row"
alignItems="center"
{...newProps}
opacity={isDisabled ? 0.4 : 1}
{...(Platform.OS === 'web'
? {
disabled: isDisabled,
cursor: isDisabled ? 'not-allowed' : 'auto',
}
: {})}
>
<Center
backgroundColor={
isChecked
? isDisabled
? borderColor
: activeColor
: 'transparent'
}
borderColor={outlineColor}
borderWidth={1}
borderRadius={4}
p={1}
>
{icon && sizedIcon && isChecked ? (
sizedIcon()
) : (
<Icon
name="check-bold"
type="MaterialCommunityIcons"
size={size}
color={iconColor}
opacity={isChecked ? 1 : 0}
/>
)}
</Center>
{props.children}
</Box>
);
}}
</Hoverable>
</s> add <TouchableOpacity
activeOpacity={1}
ref={mergeRefs([ref, _ref])}
{...inputProps}
>
<Box
flexDirection="row"
alignItems="center"
{...newProps}
opacity={isDisabled ? 0.4 : 1}
{...(Platform.OS === 'web'
? {
disabled: isDisabled,
cursor: isDisabled ? 'not-allowed' : 'auto',
}
: {})}
>
<Center
backgroundColor={
isChecked ? (isDisabled ? borderColor : activeColor) : 'transparent'
}
borderColor={outlineColor}
borderWidth={1}
borderRadius={4}
p={1}
>
{icon && sizedIcon && isChecked ? (
sizedIcon()
) : (
<Icon
name="check-bold"
type="MaterialCommunityIcons"
size={size}
color={iconColor}
opacity={isChecked ? 1 : 0}
/>
)}
</Center>
{props.children}
</Box> </s> remove <TouchableOpacity activeOpacity={1} ref={ref} {...inputProps}>
<Hoverable>
{(isHovered: boolean) => {
const outlineColor =
isHovered && !isDisabled
? activeColor
: checked
? isDisabled
? borderColor
: activeColor
: borderColor;
return (
<Box
flexDirection="row"
justifyContent="center"
alignItems="center"
{...newProps}
opacity={isDisabled ? 0.4 : 1}
{...(Platform.OS === 'web'
? {
disabled: isDisabled,
cursor: isDisabled ? 'not-allowed' : 'auto',
}
: {})}
>
<Box
borderColor={outlineColor}
backgroundColor={isDisabled ? 'muted.200' : 'transparent'}
borderWidth={1}
display="flex"
justifyContent="center"
alignItems="center"
borderRadius={999}
p={'2px'}
>
{icon && checked ? (
sizedIcon()
) : (
<Icon
name="circle"
type="MaterialCommunityIcons"
size={size}
color={
checked
? isDisabled
? borderColor
: activeColor
: 'transparent'
}
opacity={checked ? 1 : 0}
/>
)}
</Box>
{children}
</Box>
);
}}
</Hoverable>
</s> add <TouchableOpacity
activeOpacity={1}
ref={mergeRefs([ref, _ref])}
{...inputProps}
>
<Box
flexDirection="row"
justifyContent="center"
alignItems="center"
{...newProps}
opacity={isDisabled ? 0.4 : 1}
{...(Platform.OS === 'web'
? {
disabled: isDisabled,
cursor: isDisabled ? 'not-allowed' : 'auto',
}
: {})}
>
<Box
borderColor={outlineColor}
backgroundColor={isDisabled ? 'muted.200' : 'transparent'}
borderWidth={1}
display="flex"
justifyContent="center"
alignItems="center"
borderRadius={999}
p={'2px'}
>
{icon && checked ? (
sizedIcon()
) : (
<Icon
name="circle"
type="MaterialCommunityIcons"
size={size}
color={
checked
? isDisabled
? borderColor
: activeColor
: 'transparent'
}
opacity={checked ? 1 : 0}
/>
)}
</Box>
{children}
</Box> | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"re... | https://github.com/GeekyAnts/NativeBase/commit/025f339d611ae3d72b4f00018d7cbd5c6761b593 | src/components/primitives/Input/index.tsx |
import { mergeRefs } from './../../../utils';
import { useHover } from '@react-native-aria/interactions'; | <mask> import { useThemeProps } from '../../../hooks';
<mask> import { RadioContext } from './RadioGroup';
<mask> import type { IRadioProps } from './types';
<mask> import { useRadio } from './useRadio';
<mask> import { Hoverable } from './../../../utils';
<mask>
<mask> const Radio = ({ icon, children, ...props }: IRadioProps, ref: any) => {
<mask> const contextState = React.useContext(RadioContext);
<mask>
<mask> const {
</s> feat: replace Hoverable with useHover from rn-aria </s> remove import { Hoverable } from './../../../utils';
</s> add import { mergeRefs } from './../../../utils';
import { useHover } from '@react-native-aria/interactions'; </s> remove import { Hoverable } from './../../../utils';
</s> add import { mergeRefs } from './../../../utils'; </s> remove import { Hoverable } from './../../../utils';
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/025f339d611ae3d72b4f00018d7cbd5c6761b593 | src/components/primitives/Radio/Radio.tsx |
const _ref = React.useRef(null);
const { isHovered } = useHover({}, _ref);
const outlineColor =
isHovered && !isDisabled
? activeColor
: checked
? isDisabled
? borderColor
: activeColor
: borderColor;
| <mask>
<mask> const { inputProps } = useRadio(props, contextState, null);
<mask> const { checked, disabled: isDisabled } = inputProps;
<mask> return (
<mask> <TouchableOpacity
<mask> activeOpacity={1}
<mask> ref={mergeRefs([ref, _ref])}
<mask> {...inputProps}
</s> feat: replace Hoverable with useHover from rn-aria </s> remove <TouchableOpacity activeOpacity={1} ref={ref} {...inputProps}>
<Hoverable>
{(isHovered: boolean) => {
const outlineColor =
isHovered && !isDisabled
? activeColor
: checked
? isDisabled
? borderColor
: activeColor
: borderColor;
return (
<Box
flexDirection="row"
justifyContent="center"
alignItems="center"
{...newProps}
opacity={isDisabled ? 0.4 : 1}
{...(Platform.OS === 'web'
? {
disabled: isDisabled,
cursor: isDisabled ? 'not-allowed' : 'auto',
}
: {})}
>
<Box
borderColor={outlineColor}
backgroundColor={isDisabled ? 'muted.200' : 'transparent'}
borderWidth={1}
display="flex"
justifyContent="center"
alignItems="center"
borderRadius={999}
p={'2px'}
>
{icon && checked ? (
sizedIcon()
) : (
<Icon
name="circle"
type="MaterialCommunityIcons"
size={size}
color={
checked
? isDisabled
? borderColor
: activeColor
: 'transparent'
}
opacity={checked ? 1 : 0}
/>
)}
</Box>
{children}
</Box>
);
}}
</Hoverable>
</s> add <TouchableOpacity
activeOpacity={1}
ref={mergeRefs([ref, _ref])}
{...inputProps}
>
<Box
flexDirection="row"
justifyContent="center"
alignItems="center"
{...newProps}
opacity={isDisabled ? 0.4 : 1}
{...(Platform.OS === 'web'
? {
disabled: isDisabled,
cursor: isDisabled ? 'not-allowed' : 'auto',
}
: {})}
>
<Box
borderColor={outlineColor}
backgroundColor={isDisabled ? 'muted.200' : 'transparent'}
borderWidth={1}
display="flex"
justifyContent="center"
alignItems="center"
borderRadius={999}
p={'2px'}
>
{icon && checked ? (
sizedIcon()
) : (
<Icon
name="circle"
type="MaterialCommunityIcons"
size={size}
color={
checked
? isDisabled
? borderColor
: activeColor
: 'transparent'
}
opacity={checked ? 1 : 0}
/>
)}
</Box>
{children}
</Box> </s> remove <TouchableOpacity activeOpacity={1} ref={ref} {...inputProps}>
<Hoverable>
{(isHovered: boolean) => {
const outlineColor =
isHovered && !isDisabled
? activeColor
: isChecked
? isDisabled
? borderColor
: activeColor
: borderColor;
return (
<Box
flexDirection="row"
alignItems="center"
{...newProps}
opacity={isDisabled ? 0.4 : 1}
{...(Platform.OS === 'web'
? {
disabled: isDisabled,
cursor: isDisabled ? 'not-allowed' : 'auto',
}
: {})}
>
<Center
backgroundColor={
isChecked
? isDisabled
? borderColor
: activeColor
: 'transparent'
}
borderColor={outlineColor}
borderWidth={1}
borderRadius={4}
p={1}
>
{icon && sizedIcon && isChecked ? (
sizedIcon()
) : (
<Icon
name="check-bold"
type="MaterialCommunityIcons"
size={size}
color={iconColor}
opacity={isChecked ? 1 : 0}
/>
)}
</Center>
{props.children}
</Box>
);
}}
</Hoverable>
</s> add <TouchableOpacity
activeOpacity={1}
ref={mergeRefs([ref, _ref])}
{...inputProps}
>
<Box
flexDirection="row"
alignItems="center"
{...newProps}
opacity={isDisabled ? 0.4 : 1}
{...(Platform.OS === 'web'
? {
disabled: isDisabled,
cursor: isDisabled ? 'not-allowed' : 'auto',
}
: {})}
>
<Center
backgroundColor={
isChecked ? (isDisabled ? borderColor : activeColor) : 'transparent'
}
borderColor={outlineColor}
borderWidth={1}
borderRadius={4}
p={1}
>
{icon && sizedIcon && isChecked ? (
sizedIcon()
) : (
<Icon
name="check-bold"
type="MaterialCommunityIcons"
size={size}
color={iconColor}
opacity={isChecked ? 1 : 0}
/>
)}
</Center>
{props.children}
</Box> </s> remove import { Hoverable } from './../../../utils';
</s> add import { mergeRefs } from './../../../utils';
import { useHover } from '@react-native-aria/interactions'; | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/025f339d611ae3d72b4f00018d7cbd5c6761b593 | src/components/primitives/Radio/Radio.tsx |
<TouchableOpacity
activeOpacity={1}
ref={mergeRefs([ref, _ref])}
{...inputProps}
>
<Box
flexDirection="row"
justifyContent="center"
alignItems="center"
{...newProps}
opacity={isDisabled ? 0.4 : 1}
{...(Platform.OS === 'web'
? {
disabled: isDisabled,
cursor: isDisabled ? 'not-allowed' : 'auto',
}
: {})}
>
<Box
borderColor={outlineColor}
backgroundColor={isDisabled ? 'muted.200' : 'transparent'}
borderWidth={1}
display="flex"
justifyContent="center"
alignItems="center"
borderRadius={999}
p={'2px'}
>
{icon && checked ? (
sizedIcon()
) : (
<Icon
name="circle"
type="MaterialCommunityIcons"
size={size}
color={
checked
? isDisabled
? borderColor
: activeColor
: 'transparent'
}
opacity={checked ? 1 : 0}
/>
)}
</Box>
{children}
</Box> | <mask>
<mask> const { inputProps } = useRadio(props, contextState, null);
<mask> const { checked, disabled: isDisabled } = inputProps;
<mask> return (
<mask> <TouchableOpacity activeOpacity={1} ref={ref} {...inputProps}>
<mask> <Hoverable>
<mask> {(isHovered: boolean) => {
<mask> const outlineColor =
<mask> isHovered && !isDisabled
<mask> ? activeColor
<mask> : checked
<mask> ? isDisabled
<mask> ? borderColor
<mask> : activeColor
<mask> : borderColor;
<mask> return (
<mask> <Box
<mask> flexDirection="row"
<mask> justifyContent="center"
<mask> alignItems="center"
<mask> {...newProps}
<mask> opacity={isDisabled ? 0.4 : 1}
<mask> {...(Platform.OS === 'web'
<mask> ? {
<mask> disabled: isDisabled,
<mask> cursor: isDisabled ? 'not-allowed' : 'auto',
<mask> }
<mask> : {})}
<mask> >
<mask> <Box
<mask> borderColor={outlineColor}
<mask> backgroundColor={isDisabled ? 'muted.200' : 'transparent'}
<mask> borderWidth={1}
<mask> display="flex"
<mask> justifyContent="center"
<mask> alignItems="center"
<mask> borderRadius={999}
<mask> p={'2px'}
<mask> >
<mask> {icon && checked ? (
<mask> sizedIcon()
<mask> ) : (
<mask> <Icon
<mask> name="circle"
<mask> type="MaterialCommunityIcons"
<mask> size={size}
<mask> color={
<mask> checked
<mask> ? isDisabled
<mask> ? borderColor
<mask> : activeColor
<mask> : 'transparent'
<mask> }
<mask> opacity={checked ? 1 : 0}
<mask> />
<mask> )}
<mask> </Box>
<mask> {children}
<mask> </Box>
<mask> );
<mask> }}
<mask> </Hoverable>
<mask> </TouchableOpacity>
<mask> );
<mask> };
<mask>
<mask> export default React.memo(
</s> feat: replace Hoverable with useHover from rn-aria </s> remove <TouchableOpacity activeOpacity={1} ref={ref} {...inputProps}>
<Hoverable>
{(isHovered: boolean) => {
const outlineColor =
isHovered && !isDisabled
? activeColor
: isChecked
? isDisabled
? borderColor
: activeColor
: borderColor;
return (
<Box
flexDirection="row"
alignItems="center"
{...newProps}
opacity={isDisabled ? 0.4 : 1}
{...(Platform.OS === 'web'
? {
disabled: isDisabled,
cursor: isDisabled ? 'not-allowed' : 'auto',
}
: {})}
>
<Center
backgroundColor={
isChecked
? isDisabled
? borderColor
: activeColor
: 'transparent'
}
borderColor={outlineColor}
borderWidth={1}
borderRadius={4}
p={1}
>
{icon && sizedIcon && isChecked ? (
sizedIcon()
) : (
<Icon
name="check-bold"
type="MaterialCommunityIcons"
size={size}
color={iconColor}
opacity={isChecked ? 1 : 0}
/>
)}
</Center>
{props.children}
</Box>
);
}}
</Hoverable>
</s> add <TouchableOpacity
activeOpacity={1}
ref={mergeRefs([ref, _ref])}
{...inputProps}
>
<Box
flexDirection="row"
alignItems="center"
{...newProps}
opacity={isDisabled ? 0.4 : 1}
{...(Platform.OS === 'web'
? {
disabled: isDisabled,
cursor: isDisabled ? 'not-allowed' : 'auto',
}
: {})}
>
<Center
backgroundColor={
isChecked ? (isDisabled ? borderColor : activeColor) : 'transparent'
}
borderColor={outlineColor}
borderWidth={1}
borderRadius={4}
p={1}
>
{icon && sizedIcon && isChecked ? (
sizedIcon()
) : (
<Icon
name="check-bold"
type="MaterialCommunityIcons"
size={size}
color={iconColor}
opacity={isChecked ? 1 : 0}
/>
)}
</Center>
{props.children}
</Box> </s> remove <Hoverable>
{(isHovered: boolean) => {
return (
<Box
display="flex"
flexDirection="row"
justifyContent="space-between"
alignItems="center"
{...newProps}
{...(isHovered && _hover)}
{...(isOpen && _expanded)}
{...(isDisabled && _disabled)}
{...(!index && { borderTopColor: 'transparent' })}
{...(Platform.OS === 'web'
? {
disabled: isDisabled,
cursor: isDisabled ? 'not-allowed' : 'auto',
}
: {})}
>
{children}
</Box>
);
}}
</Hoverable>
</s> add <Box
display="flex"
flexDirection="row"
justifyContent="space-between"
alignItems="center"
{...newProps}
{...(isHovered && _hover)}
{...(isOpen && _expanded)}
{...(isDisabled && _disabled)}
{...(!index && { borderTopColor: 'transparent' })}
{...(Platform.OS === 'web'
? {
disabled: isDisabled,
cursor: isDisabled ? 'not-allowed' : 'auto',
}
: {})}
>
{children}
</Box> </s> remove {InputLeftElement ? (
<Flex justify="center" align="center" left={0}>
{InputLeftElement}
</Flex>
) : null}
{isFocused && label && (
<Flex position="absolute">
<Animated.View
style={{
transform: [{ translateY: slideAnim, translateX: 4 }],
}}
>
<Flex {...newProps} bg="transparent">
<Box
bg="transparent"
color={updatedBorderColor}
fontSize={fontSize}
>
{label}
<Box
w="120%"
p="1px"
bg="gray.50"
position="absolute"
right="-10%"
bottom={`${
Math.floor(fontSize / 2) +
(Platform.OS === 'ios' ? 1 : 0)
}px`}
zIndex={-1}
/>
</Box>
</Flex>
</Animated.View>
</Flex>
)}
<StyledInput
{...newProps}
fontSize={fontSize}
backgroundColor="transparent"
flex={1}
secureTextEntry={type === 'password'}
accessible
accessibilityLabel={ariaLabel || accessibilityLabel}
onKeyPress={(e: any) => {
e.persist();
}}
onFocus={() => {
slideOut();
handleFocus(true, onFocus ? onFocus : () => {});
}}
onBlur={(e) => {
// TODO: animation not happening because of component rerender
e.nativeEvent.text && slideIn();
handleFocus(false, onBlur ? onBlur : () => {});
}}
placeholder={isFocused && label ? '' : placeholder}
editable={isDisabled || isReadOnly ? false : true}
// borderRadius={50} //Remove variant props from StyledInput
borderWidth={undefined}
{...(Platform.OS === 'web'
? {
disabled: isDisabled,
cursor: isDisabled ? 'not-allowed' : 'auto',
}
: {})}
style={[
Platform.OS === 'web' && {
// @ts-ignore
outline: 'none',
},
]}
ref={ref}
/>
{InputRightElement ? (
<Flex justify="center" align="center" right={0}>
{InputRightElement}
</Flex>
) : null}
</Box>
);
}}
</Hoverable>
</s> add <Flex {...newProps} bg="transparent">
<Box
bg="transparent"
color={updatedBorderColor}
fontSize={fontSize}
>
{label}
<Box
w="120%"
p="1px"
bg="gray.50"
position="absolute"
right="-10%"
bottom={`${
Math.floor(fontSize / 2) + (Platform.OS === 'ios' ? 1 : 0)
}px`}
zIndex={-1}
/>
</Box>
</Flex>
</Animated.View>
</Flex>
)}
<StyledInput
{...newProps}
fontSize={fontSize}
backgroundColor="transparent"
flex={1}
secureTextEntry={type === 'password'}
accessible
accessibilityLabel={ariaLabel || accessibilityLabel}
onKeyPress={(e: any) => {
e.persist();
}}
onFocus={() => {
slideOut();
handleFocus(true, onFocus ? onFocus : () => {});
}}
onBlur={(e) => {
// TODO: animation not happening because of component rerender
e.nativeEvent.text && slideIn();
handleFocus(false, onBlur ? onBlur : () => {});
}}
placeholder={isFocused && label ? '' : placeholder}
editable={isDisabled || isReadOnly ? false : true}
// borderRadius={50} //Remove variant props from StyledInput
borderWidth={undefined}
{...(Platform.OS === 'web'
? {
disabled: isDisabled,
cursor: isDisabled ? 'not-allowed' : 'auto',
}
: {})}
style={[
Platform.OS === 'web' && {
// @ts-ignore
outline: 'none',
},
]}
ref={ref}
/>
{InputRightElement ? (
<Flex justify="center" align="center" right={0}>
{InputRightElement}
</Flex>
) : null}
</Box> | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"re... | https://github.com/GeekyAnts/NativeBase/commit/025f339d611ae3d72b4f00018d7cbd5c6761b593 | src/components/primitives/Radio/Radio.tsx |
export { mergeRefs } from './mergeRefs'; | <mask> };
<mask>
<mask> export type { IAccessibilityProps } from './accessibilityTypes';
<mask>
<mask> export { default as Hoverable } from './Hoverable';
<mask> export type { HoverableProps } from './Hoverable';
</s> feat: replace Hoverable with useHover from rn-aria </s> remove import { Hoverable } from './../../../utils';
</s> add import { mergeRefs } from './../../../utils';
import { useHover } from '@react-native-aria/interactions'; </s> remove <Hoverable>
{(isHovered: boolean) => {
return (
<Box
display="flex"
flexDirection="row"
justifyContent="space-between"
alignItems="center"
{...newProps}
{...(isHovered && _hover)}
{...(isOpen && _expanded)}
{...(isDisabled && _disabled)}
{...(!index && { borderTopColor: 'transparent' })}
{...(Platform.OS === 'web'
? {
disabled: isDisabled,
cursor: isDisabled ? 'not-allowed' : 'auto',
}
: {})}
>
{children}
</Box>
);
}}
</Hoverable>
</s> add <Box
display="flex"
flexDirection="row"
justifyContent="space-between"
alignItems="center"
{...newProps}
{...(isHovered && _hover)}
{...(isOpen && _expanded)}
{...(isDisabled && _disabled)}
{...(!index && { borderTopColor: 'transparent' })}
{...(Platform.OS === 'web'
? {
disabled: isDisabled,
cursor: isDisabled ? 'not-allowed' : 'auto',
}
: {})}
>
{children}
</Box> </s> remove import { Hoverable } from './../../../utils';
</s> add import { mergeRefs } from './../../../utils'; | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace"
] | https://github.com/GeekyAnts/NativeBase/commit/025f339d611ae3d72b4f00018d7cbd5c6761b593 | src/utils/index.ts |
import { useResolvedFontFamily } from '../../../hooks/useResolvedFontFamily'; | <mask> import { useHover } from '@react-native-aria/interactions';
<mask> import { mergeRefs } from '../../../utils';
<mask>
<mask> const StyledInput = styled(TextInput)<IInputProps>(
<mask> flex,
<mask> color,
<mask> space,
<mask> layout,
</s> fix: add tokenised font family support in input component </s> remove import { useTheme } from '../../../hooks';
</s> add </s> remove
type IUseResolvedFontFamily = {
fontFamily: string;
fontStyle: string;
fontWeight: string | number;
};
// Android doesn't support fontWeight or fontStyle properties. So, we pass fontFamily instead.
function useResolvedFontFamily(props: IUseResolvedFontFamily) {
const { fontFamily, fontStyle, fontWeight } = props;
const { fontConfig, fontWeights, fonts } = useTheme();
const fontToken = fonts[fontFamily];
if (fontConfig && fontConfig[fontToken]) {
// fontWeights are also specified using "400"
const parsedFontWeight = parseInt(fontWeight as any);
let fontWeightNumber = Number.isNaN(parsedFontWeight)
? fontWeights[fontWeight]
: fontWeight;
let fontVariants = fontConfig[fontToken][fontWeightNumber];
if (typeof fontVariants === 'object') {
if (fontVariants[fontStyle]) return fontVariants[fontStyle];
} else {
return fontVariants;
}
}
}
</s> add import { useResolvedFontFamily } from '../../../hooks/useResolvedFontFamily'; </s> remove if (resolvedFontFamily) {
fontFamily = resolvedFontFamily;
}
</s> add | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/029e7757b700811533e67346f29809aeab5fa52f | src/components/primitives/Input/InputBase.tsx |
fontFamily,
fontWeight,
fontStyle, | <mask> _disabled,
<mask> _invalid,
<mask> ...themedProps
<mask> } = usePropsResolution('Input', {
<mask> ...inputThemeProps,
<mask> ...props,
<mask> });
</s> fix: add tokenised font family support in input component </s> remove if (resolvedFontFamily) {
fontFamily = resolvedFontFamily;
}
</s> add </s> remove import { useTheme } from '../../../hooks';
</s> add </s> remove
type IUseResolvedFontFamily = {
fontFamily: string;
fontStyle: string;
fontWeight: string | number;
};
// Android doesn't support fontWeight or fontStyle properties. So, we pass fontFamily instead.
function useResolvedFontFamily(props: IUseResolvedFontFamily) {
const { fontFamily, fontStyle, fontWeight } = props;
const { fontConfig, fontWeights, fonts } = useTheme();
const fontToken = fonts[fontFamily];
if (fontConfig && fontConfig[fontToken]) {
// fontWeights are also specified using "400"
const parsedFontWeight = parseInt(fontWeight as any);
let fontWeightNumber = Number.isNaN(parsedFontWeight)
? fontWeights[fontWeight]
: fontWeight;
let fontVariants = fontConfig[fontToken][fontWeightNumber];
if (typeof fontVariants === 'object') {
if (fontVariants[fontStyle]) return fontVariants[fontStyle];
} else {
return fontVariants;
}
}
}
</s> add import { useResolvedFontFamily } from '../../../hooks/useResolvedFontFamily'; | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/029e7757b700811533e67346f29809aeab5fa52f | src/components/primitives/Input/InputBase.tsx |
const resolvedFontFamily = useResolvedFontFamily({
fontFamily,
fontWeight,
fontStyle,
});
| <mask> const { isHovered } = useHover({}, _ref);
<mask>
<mask> return (
<mask> <StyledInput
<mask> {...inputProps}
<mask> fontFamily={resolvedFontFamily}
</s> fix: add tokenised font family support in input component </s> remove
type IUseResolvedFontFamily = {
fontFamily: string;
fontStyle: string;
fontWeight: string | number;
};
// Android doesn't support fontWeight or fontStyle properties. So, we pass fontFamily instead.
function useResolvedFontFamily(props: IUseResolvedFontFamily) {
const { fontFamily, fontStyle, fontWeight } = props;
const { fontConfig, fontWeights, fonts } = useTheme();
const fontToken = fonts[fontFamily];
if (fontConfig && fontConfig[fontToken]) {
// fontWeights are also specified using "400"
const parsedFontWeight = parseInt(fontWeight as any);
let fontWeightNumber = Number.isNaN(parsedFontWeight)
? fontWeights[fontWeight]
: fontWeight;
let fontVariants = fontConfig[fontToken][fontWeightNumber];
if (typeof fontVariants === 'object') {
if (fontVariants[fontStyle]) return fontVariants[fontStyle];
} else {
return fontVariants;
}
}
}
</s> add import { useResolvedFontFamily } from '../../../hooks/useResolvedFontFamily'; </s> remove if (resolvedFontFamily) {
fontFamily = resolvedFontFamily;
}
</s> add </s> remove fontFamily={fontFamily}
</s> add fontFamily={resolvedFontFamily} | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/029e7757b700811533e67346f29809aeab5fa52f | src/components/primitives/Input/InputBase.tsx |
fontFamily={resolvedFontFamily}
fontWeight={fontWeight}
fontStyle={fontStyle} | <mask>
<mask> return (
<mask> <StyledInput
<mask> {...inputProps}
<mask> secureTextEntry={type === 'password'}
<mask> accessible
<mask> accessibilityLabel={ariaLabel || accessibilityLabel}
<mask> editable={isDisabled || isReadOnly ? false : true}
<mask> w={isFullWidth ? '100%' : undefined}
<mask> {...themedProps}
</s> fix: add tokenised font family support in input component </s> remove if (resolvedFontFamily) {
fontFamily = resolvedFontFamily;
}
</s> add </s> remove fontFamily={fontFamily}
</s> add fontFamily={resolvedFontFamily} </s> remove
type IUseResolvedFontFamily = {
fontFamily: string;
fontStyle: string;
fontWeight: string | number;
};
// Android doesn't support fontWeight or fontStyle properties. So, we pass fontFamily instead.
function useResolvedFontFamily(props: IUseResolvedFontFamily) {
const { fontFamily, fontStyle, fontWeight } = props;
const { fontConfig, fontWeights, fonts } = useTheme();
const fontToken = fonts[fontFamily];
if (fontConfig && fontConfig[fontToken]) {
// fontWeights are also specified using "400"
const parsedFontWeight = parseInt(fontWeight as any);
let fontWeightNumber = Number.isNaN(parsedFontWeight)
? fontWeights[fontWeight]
: fontWeight;
let fontVariants = fontConfig[fontToken][fontWeightNumber];
if (typeof fontVariants === 'object') {
if (fontVariants[fontStyle]) return fontVariants[fontStyle];
} else {
return fontVariants;
}
}
}
</s> add import { useResolvedFontFamily } from '../../../hooks/useResolvedFontFamily'; | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/029e7757b700811533e67346f29809aeab5fa52f | src/components/primitives/Input/InputBase.tsx |
<mask> import React, { memo, forwardRef, useRef } from 'react';
<mask> import { Text as NativeText } from 'react-native';
<mask> import { useTheme } from '../../../hooks';
<mask> import styled from 'styled-components/native';
<mask> import {
<mask> color,
<mask> position,
<mask> space,
</s> fix: add tokenised font family support in input component </s> remove
type IUseResolvedFontFamily = {
fontFamily: string;
fontStyle: string;
fontWeight: string | number;
};
// Android doesn't support fontWeight or fontStyle properties. So, we pass fontFamily instead.
function useResolvedFontFamily(props: IUseResolvedFontFamily) {
const { fontFamily, fontStyle, fontWeight } = props;
const { fontConfig, fontWeights, fonts } = useTheme();
const fontToken = fonts[fontFamily];
if (fontConfig && fontConfig[fontToken]) {
// fontWeights are also specified using "400"
const parsedFontWeight = parseInt(fontWeight as any);
let fontWeightNumber = Number.isNaN(parsedFontWeight)
? fontWeights[fontWeight]
: fontWeight;
let fontVariants = fontConfig[fontToken][fontWeightNumber];
if (typeof fontVariants === 'object') {
if (fontVariants[fontStyle]) return fontVariants[fontStyle];
} else {
return fontVariants;
}
}
}
</s> add import { useResolvedFontFamily } from '../../../hooks/useResolvedFontFamily'; </s> remove if (resolvedFontFamily) {
fontFamily = resolvedFontFamily;
}
</s> add | [
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/029e7757b700811533e67346f29809aeab5fa52f | src/components/primitives/Text/index.tsx | |
import { useResolvedFontFamily } from '../../../hooks/useResolvedFontFamily'; | <mask> } from '../../../utils/customProps';
<mask> import type { ITextProps } from './types';
<mask> import { useHover } from '@react-native-aria/interactions';
<mask> import { mergeRefs } from '../../../utils/mergeRefs';
<mask>
<mask> type IUseResolvedFontFamily = {
<mask> fontFamily: string;
<mask> fontStyle: string;
<mask> fontWeight: string | number;
<mask> };
<mask>
<mask> // Android doesn't support fontWeight or fontStyle properties. So, we pass fontFamily instead.
<mask> function useResolvedFontFamily(props: IUseResolvedFontFamily) {
<mask> const { fontFamily, fontStyle, fontWeight } = props;
<mask>
<mask> const { fontConfig, fontWeights, fonts } = useTheme();
<mask> const fontToken = fonts[fontFamily];
<mask>
<mask> if (fontConfig && fontConfig[fontToken]) {
<mask> // fontWeights are also specified using "400"
<mask> const parsedFontWeight = parseInt(fontWeight as any);
<mask> let fontWeightNumber = Number.isNaN(parsedFontWeight)
<mask> ? fontWeights[fontWeight]
<mask> : fontWeight;
<mask> let fontVariants = fontConfig[fontToken][fontWeightNumber];
<mask> if (typeof fontVariants === 'object') {
<mask> if (fontVariants[fontStyle]) return fontVariants[fontStyle];
<mask> } else {
<mask> return fontVariants;
<mask> }
<mask> }
<mask> }
<mask>
<mask> const StyledText = styled(NativeText)<ITextProps>(
<mask> color,
<mask> space,
<mask> position,
</s> fix: add tokenised font family support in input component </s> remove import { useTheme } from '../../../hooks';
</s> add </s> remove if (resolvedFontFamily) {
fontFamily = resolvedFontFamily;
}
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"re... | https://github.com/GeekyAnts/NativeBase/commit/029e7757b700811533e67346f29809aeab5fa52f | src/components/primitives/Text/index.tsx |
<mask> fontWeight,
<mask> fontStyle,
<mask> });
<mask>
<mask> if (resolvedFontFamily) {
<mask> fontFamily = resolvedFontFamily;
<mask> }
<mask>
<mask> return (
<mask> <StyledText
<mask> {...reslovedProps}
<mask> numberOfLines={noOfLines ? noOfLines : isTruncated ? 1 : undefined}
<mask> fontWeight={bold ? 'bold' : fontWeight}
</s> fix: add tokenised font family support in input component </s> remove
type IUseResolvedFontFamily = {
fontFamily: string;
fontStyle: string;
fontWeight: string | number;
};
// Android doesn't support fontWeight or fontStyle properties. So, we pass fontFamily instead.
function useResolvedFontFamily(props: IUseResolvedFontFamily) {
const { fontFamily, fontStyle, fontWeight } = props;
const { fontConfig, fontWeights, fonts } = useTheme();
const fontToken = fonts[fontFamily];
if (fontConfig && fontConfig[fontToken]) {
// fontWeights are also specified using "400"
const parsedFontWeight = parseInt(fontWeight as any);
let fontWeightNumber = Number.isNaN(parsedFontWeight)
? fontWeights[fontWeight]
: fontWeight;
let fontVariants = fontConfig[fontToken][fontWeightNumber];
if (typeof fontVariants === 'object') {
if (fontVariants[fontStyle]) return fontVariants[fontStyle];
} else {
return fontVariants;
}
}
}
</s> add import { useResolvedFontFamily } from '../../../hooks/useResolvedFontFamily'; </s> remove fontFamily={fontFamily}
</s> add fontFamily={resolvedFontFamily} | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/029e7757b700811533e67346f29809aeab5fa52f | src/components/primitives/Text/index.tsx | |
fontFamily={resolvedFontFamily} | <mask> : reslovedProps.textDecorationLine
<mask> }
<mask> fontSize={sub ? 10 : fontSize}
<mask> ref={mergeRefs([ref, _ref])}
<mask> fontFamily={fontFamily}
<mask> {...(isHovered && _hover)}
<mask> >
<mask> {children}
<mask> </StyledText>
<mask> );
</s> fix: add tokenised font family support in input component </s> remove if (resolvedFontFamily) {
fontFamily = resolvedFontFamily;
}
</s> add </s> remove
type IUseResolvedFontFamily = {
fontFamily: string;
fontStyle: string;
fontWeight: string | number;
};
// Android doesn't support fontWeight or fontStyle properties. So, we pass fontFamily instead.
function useResolvedFontFamily(props: IUseResolvedFontFamily) {
const { fontFamily, fontStyle, fontWeight } = props;
const { fontConfig, fontWeights, fonts } = useTheme();
const fontToken = fonts[fontFamily];
if (fontConfig && fontConfig[fontToken]) {
// fontWeights are also specified using "400"
const parsedFontWeight = parseInt(fontWeight as any);
let fontWeightNumber = Number.isNaN(parsedFontWeight)
? fontWeights[fontWeight]
: fontWeight;
let fontVariants = fontConfig[fontToken][fontWeightNumber];
if (typeof fontVariants === 'object') {
if (fontVariants[fontStyle]) return fontVariants[fontStyle];
} else {
return fontVariants;
}
}
}
</s> add import { useResolvedFontFamily } from '../../../hooks/useResolvedFontFamily'; </s> remove import { useTheme } from '../../../hooks';
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/029e7757b700811533e67346f29809aeab5fa52f | src/components/primitives/Text/index.tsx |
heading: undefined,
body: undefined,
mono: undefined, | <mask> extrabold: 800,
<mask> black: 900,
<mask> },
<mask> fonts: {
<mask> heading: '',
<mask> body: '',
<mask> mono: '',
<mask> },
<mask> fontSizes: {
<mask> 'xxs': 10,
<mask> 'xs': 12,
<mask> 'sm': 14,
</s> fix: add tokenised font family support in input component </s> remove import { useTheme } from '../../../hooks';
</s> add </s> remove
type IUseResolvedFontFamily = {
fontFamily: string;
fontStyle: string;
fontWeight: string | number;
};
// Android doesn't support fontWeight or fontStyle properties. So, we pass fontFamily instead.
function useResolvedFontFamily(props: IUseResolvedFontFamily) {
const { fontFamily, fontStyle, fontWeight } = props;
const { fontConfig, fontWeights, fonts } = useTheme();
const fontToken = fonts[fontFamily];
if (fontConfig && fontConfig[fontToken]) {
// fontWeights are also specified using "400"
const parsedFontWeight = parseInt(fontWeight as any);
let fontWeightNumber = Number.isNaN(parsedFontWeight)
? fontWeights[fontWeight]
: fontWeight;
let fontVariants = fontConfig[fontToken][fontWeightNumber];
if (typeof fontVariants === 'object') {
if (fontVariants[fontStyle]) return fontVariants[fontStyle];
} else {
return fontVariants;
}
}
}
</s> add import { useResolvedFontFamily } from '../../../hooks/useResolvedFontFamily'; | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/029e7757b700811533e67346f29809aeab5fa52f | src/theme/base/typography.ts |
fontFamily: 'body', | <mask> // boxShadow: `${useToken('colors', ['primary.400'])} 0px 0px 0px 1px`,
<mask> };
<mask>
<mask> return {
<mask> px: 4,
<mask> py: 2,
<mask> borderRadius: 'lg',
<mask> color: mode('black', 'white')(props),
<mask> placeholderTextColor: mode('muted.400', 'muted.500')(props),
<mask> background: 'transparent',
</s> fix: add tokenised font family support in input component </s> remove
type IUseResolvedFontFamily = {
fontFamily: string;
fontStyle: string;
fontWeight: string | number;
};
// Android doesn't support fontWeight or fontStyle properties. So, we pass fontFamily instead.
function useResolvedFontFamily(props: IUseResolvedFontFamily) {
const { fontFamily, fontStyle, fontWeight } = props;
const { fontConfig, fontWeights, fonts } = useTheme();
const fontToken = fonts[fontFamily];
if (fontConfig && fontConfig[fontToken]) {
// fontWeights are also specified using "400"
const parsedFontWeight = parseInt(fontWeight as any);
let fontWeightNumber = Number.isNaN(parsedFontWeight)
? fontWeights[fontWeight]
: fontWeight;
let fontVariants = fontConfig[fontToken][fontWeightNumber];
if (typeof fontVariants === 'object') {
if (fontVariants[fontStyle]) return fontVariants[fontStyle];
} else {
return fontVariants;
}
}
}
</s> add import { useResolvedFontFamily } from '../../../hooks/useResolvedFontFamily'; </s> remove import { useTheme } from '../../../hooks';
</s> add </s> remove heading: '',
body: '',
mono: '',
</s> add heading: undefined,
body: undefined,
mono: undefined, | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/029e7757b700811533e67346f29809aeab5fa52f | src/theme/components/input.ts |
<mask> import HStack from '../Stack/HStack';
<mask> import Pressable from '../Pressable';
<mask> import type { IButtonGroupProps, IButtonProps } from './types';
<mask> import { composeEventHandlers } from '../../../utils';
<mask> import { useTheme } from '../../../hooks';
<mask>
<mask> const useHover = () => {
<mask> const [isHovered, setHovered] = React.useState(false);
<mask> return {
<mask> pressableProps: {
</s> fix: use theme prop to support shadow in variants </s> remove // const shadowProps = useToken('shadows', themeProps.shadow);
const theme = useTheme();
const shadowProps = theme.shadows()[themeProps.shadow];
themeProps.shadow = undefined;
</s> add </s> remove style={{ ...shadowProps }}
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/030729978c5227a90a2fb702defa52dab8e4f6b7 | src/components/primitives/Button/index.tsx | |
<mask> ...(isHovered && _hover),
<mask> ...(isPressed && _pressed),
<mask> };
<mask>
<mask> // const shadowProps = useToken('shadows', themeProps.shadow);
<mask> const theme = useTheme();
<mask> const shadowProps = theme.shadows()[themeProps.shadow];
<mask> themeProps.shadow = undefined;
<mask>
<mask> return (
<mask> <Pressable
<mask> onPress={onPress}
<mask> onLongPress={onLongPress}
<mask> onPressIn={composeEventHandlers(onPressIn, isPressedProps.onPressIn)}
</s> fix: use theme prop to support shadow in variants </s> remove import { useTheme } from '../../../hooks';
</s> add </s> remove style={{ ...shadowProps }}
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/030729978c5227a90a2fb702defa52dab8e4f6b7 | src/components/primitives/Button/index.tsx | |
<mask> onHoverIn={composeEventHandlers(onHoverIn, pressableProps.onHoverIn)}
<mask> // @ts-ignore - web only
<mask> onHoverOut={composeEventHandlers(onHoverOut, pressableProps.onHoverOut)}
<mask> {...themeProps}
<mask> style={{ ...shadowProps }}
<mask> >
<mask> <HStack opacity={isDisabled ? 0.7 : undefined} space={2}>
<mask> {startIcon && !isLoading ? startIcon : null}
<mask> {isLoading ? (
<mask> spinner ? (
</s> fix: use theme prop to support shadow in variants </s> remove // const shadowProps = useToken('shadows', themeProps.shadow);
const theme = useTheme();
const shadowProps = theme.shadows()[themeProps.shadow];
themeProps.shadow = undefined;
</s> add </s> remove import { useTheme } from '../../../hooks';
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/030729978c5227a90a2fb702defa52dab8e4f6b7 | src/components/primitives/Button/index.tsx | |
variantProps = extractProps(
variantProps,
theme,
colorModeProps,
componentTheme,
currentBreakpoint
); | <mask> theme,
<mask> ...colorModeProps,
<mask> });
<mask> // added this to handle order of props
<mask> newProps = mergeWith(
<mask> newProps,
<mask> variantProps,
<mask> // @ts-ignore
<mask> (objValue, srcValue, key) => {
</s> fix: use theme prop to support shadow in variants </s> remove // const shadowProps = useToken('shadows', themeProps.shadow);
const theme = useTheme();
const shadowProps = theme.shadows()[themeProps.shadow];
themeProps.shadow = undefined;
</s> add </s> remove style={{ ...shadowProps }}
</s> add </s> remove import { useTheme } from '../../../hooks';
</s> add | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/030729978c5227a90a2fb702defa52dab8e4f6b7 | src/hooks/useThemeProps/utils.ts |
alignSelf: 'stretch' | <mask> footerTab: {
<mask> flexDirection: 'row',
<mask> justifyContent: 'space-between',
<mask> flex: 1,
<mask> alignSelf: 'stretch',
<mask> paddingHorizontal: 15
<mask> },
<mask> btnTextStyle: {
<mask> color: this.getTheme().tabBarTextColor,
<mask> fontSize: (Platform.OS=='ios') ? 12.5 : 10,
<mask> lineHeight: 15
</s> git push footerTab iOS fix </s> remove lineHeight: 15
</s> add lineHeight: 13 </s> remove alignSelf: 'center'
</s> add alignSelf: 'center',
flex: 1,
borderRadius: 0,
justifyContent: 'center',
height: this.getTheme().footerHeight </s> remove lineHeight: 15
</s> add lineHeight: 13 </s> remove style={this.getInitialStyle().btnStyle}
</s> add style={[this.getInitialStyle().btnStyle, {backgroundColor: (child.props.active) ? this.getTheme().tabActiveBgColor : undefined}]} </s> remove style: this.getInitialStyle().btnStyle,
</s> add style: [this.getInitialStyle().btnStyle, {backgroundColor: (child.props.active) ? this.getTheme().tabActiveBgColor : undefined }], | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/031bde76daaa8424134030ea31ab33497fe494d9 | Components/Widgets/FooterTab.js |
lineHeight: 13 | <mask> },
<mask> btnTextStyle: {
<mask> color: this.getTheme().tabBarTextColor,
<mask> fontSize: (Platform.OS=='ios') ? 12.5 : 10,
<mask> lineHeight: 15
<mask> },
<mask> btnActiveTextStyle: {
<mask> color: this.getTheme().tabBarActiveTextColor,
<mask> fontSize: (Platform.OS=='ios') ? 12.5 : 11,
<mask> lineHeight: 15
</s> git push footerTab iOS fix </s> remove lineHeight: 15
</s> add lineHeight: 13 </s> remove alignSelf: 'stretch',
paddingHorizontal: 15
</s> add alignSelf: 'stretch' </s> remove style={this.getInitialStyle().btnStyle}
</s> add style={[this.getInitialStyle().btnStyle, {backgroundColor: (child.props.active) ? this.getTheme().tabActiveBgColor : undefined}]} </s> remove alignSelf: 'center'
</s> add alignSelf: 'center',
flex: 1,
borderRadius: 0,
justifyContent: 'center',
height: this.getTheme().footerHeight </s> remove style: this.getInitialStyle().btnStyle,
</s> add style: [this.getInitialStyle().btnStyle, {backgroundColor: (child.props.active) ? this.getTheme().tabActiveBgColor : undefined }], | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/GeekyAnts/NativeBase/commit/031bde76daaa8424134030ea31ab33497fe494d9 | Components/Widgets/FooterTab.js |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.