@draftbit/core 49.4.6 → 49.4.8-21b409.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@draftbit/core",
3
- "version": "49.4.6",
3
+ "version": "49.4.8-21b409.2+21b4097",
4
4
  "description": "Core (non-native) Components",
5
5
  "main": "lib/commonjs/index.js",
6
6
  "types": "lib/typescript/src/index.d.ts",
@@ -41,7 +41,7 @@
41
41
  "dependencies": {
42
42
  "@date-io/date-fns": "^1.3.13",
43
43
  "@draftbit/react-theme-provider": "^2.1.1",
44
- "@draftbit/types": "49.2.6",
44
+ "@draftbit/types": "^49.4.8-21b409.2+21b4097",
45
45
  "@expo/vector-icons": "^13.0.0",
46
46
  "@gorhom/bottom-sheet": "5.0.0-alpha.7",
47
47
  "@material-ui/core": "^4.11.0",
@@ -72,11 +72,11 @@
72
72
  "react-native-tab-view": "^3.4.0",
73
73
  "react-native-typography": "^1.4.1",
74
74
  "react-native-web-swiper": "^2.2.3",
75
+ "react-native-youtube-iframe": "^2.2.2",
75
76
  "react-youtube": "^10.1.0"
76
77
  },
77
78
  "peerDependencies": {
78
- "react-native-avoid-softinput": "^4.0.1",
79
- "react-native-youtube-iframe": "^2.2.2"
79
+ "react-native-avoid-softinput": "^4.0.1"
80
80
  },
81
81
  "peerDependenciesMeta": {
82
82
  "react-native-avoid-softinput": {
@@ -113,5 +113,5 @@
113
113
  ],
114
114
  "testEnvironment": "node"
115
115
  },
116
- "gitHead": "54ab870a68793bfb043b045ad6d2d1242b2424a5"
116
+ "gitHead": "21b4097a2f1aae5a4c609eac00cfe1af2efed8cc"
117
117
  }
@@ -19,14 +19,22 @@ export const contentContainerStyleNames = [
19
19
  ];
20
20
  export default function useSplitContentContainerStyles(originalStyle, measuredWidth, measuredHeight) {
21
21
  return useDeepCompareMemo(() => {
22
+ var _a, _b, _c, _d, _e, _f, _g, _h;
22
23
  const flattenedStyle = StyleSheet.flatten(originalStyle);
23
24
  let contentContainerStyle = pick(flattenedStyle, contentContainerStyleNames);
24
- // contentContainerStyle should always at least fill the parent to ensure sizing changes reflects properly on component and children
25
+ const leftBorderWidth = (_b = (_a = flattenedStyle.borderLeftWidth) !== null && _a !== void 0 ? _a : flattenedStyle.borderWidth) !== null && _b !== void 0 ? _b : 0;
26
+ const rightBorderWidth = (_d = (_c = flattenedStyle.borderRightWidth) !== null && _c !== void 0 ? _c : flattenedStyle.borderWidth) !== null && _d !== void 0 ? _d : 0;
27
+ const topBorderWidth = (_f = (_e = flattenedStyle.borderTopWidth) !== null && _e !== void 0 ? _e : flattenedStyle.borderWidth) !== null && _f !== void 0 ? _f : 0;
28
+ const bottomBorderWidth = (_h = (_g = flattenedStyle.borderBottomWidth) !== null && _g !== void 0 ? _g : flattenedStyle.borderWidth) !== null && _h !== void 0 ? _h : 0;
29
+ // contentContainerStyle should always at least fill the parent to ensure sizing changes reflects properly on component and children.
30
+ // The measured sizes include borders, so we need to subtract those before applying
25
31
  if (measuredWidth) {
26
- contentContainerStyle.minWidth = measuredWidth;
32
+ contentContainerStyle.minWidth =
33
+ measuredWidth - leftBorderWidth - rightBorderWidth;
27
34
  }
28
35
  if (measuredHeight) {
29
- contentContainerStyle.minHeight = measuredHeight;
36
+ contentContainerStyle.minHeight =
37
+ measuredHeight - topBorderWidth - bottomBorderWidth;
30
38
  }
31
39
  let style = omit(flattenedStyle, contentContainerStyleNames);
32
40
  // ScrollView's implementation defaults flexGrow to 1, which prevents the ability to set a static size or use a flex larger than 1
@@ -1 +1 @@
1
- {"version":3,"file":"useSplitContentContainerStyles.js","sourceRoot":"","sources":["useSplitContentContainerStyles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwB,UAAU,EAAE,MAAM,cAAc,CAAC;AAChE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AACpC,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB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;gBAC7B,cAAc,GAAG,cAAc,GAAG,iBAAiB,CAAC;SACvD;QAED,IAAI,KAAK,GAAG,IAAI,CAAC,cAAc,EAAE,0BAA0B,CAAC,CAAC;QAE7D,kIAAkI;QAClI,4DAA4D;QAC5D,IAAI,KAAK,CAAC,IAAI,KAAK,SAAS,EAAE;YAC5B,KAAK,GAAG,EAAE,QAAQ,EAAE,CAAC,EAAE,GAAG,KAAK,EAAE,CAAC;SACnC;aAAM,IAAI,KAAK,CAAC,QAAQ,KAAK,SAAS,EAAE;YACvC,KAAK,GAAG,EAAE,QAAQ,EAAE,KAAK,CAAC,IAAI,EAAE,GAAG,KAAK,EAAE,CAAC;SAC5C;QAED,OAAO,EAAE,KAAK,EAAE,qBAAqB,EAAE,CAAC;IAC1C,CAAC,EAAE,CAAC,aAAa,EAAE,aAAa,EAAE,cAAc,CAAC,CAAC,CAAC;AACrD,CAAC"}
@@ -37,12 +37,24 @@ export default function useSplitContentContainerStyles(
37
37
  contentContainerStyleNames
38
38
  );
39
39
 
40
- // contentContainerStyle should always at least fill the parent to ensure sizing changes reflects properly on component and children
40
+ const leftBorderWidth =
41
+ flattenedStyle.borderLeftWidth ?? flattenedStyle.borderWidth ?? 0;
42
+ const rightBorderWidth =
43
+ flattenedStyle.borderRightWidth ?? flattenedStyle.borderWidth ?? 0;
44
+ const topBorderWidth =
45
+ flattenedStyle.borderTopWidth ?? flattenedStyle.borderWidth ?? 0;
46
+ const bottomBorderWidth =
47
+ flattenedStyle.borderBottomWidth ?? flattenedStyle.borderWidth ?? 0;
48
+
49
+ // contentContainerStyle should always at least fill the parent to ensure sizing changes reflects properly on component and children.
50
+ // The measured sizes include borders, so we need to subtract those before applying
41
51
  if (measuredWidth) {
42
- contentContainerStyle.minWidth = measuredWidth;
52
+ contentContainerStyle.minWidth =
53
+ measuredWidth - leftBorderWidth - rightBorderWidth;
43
54
  }
44
55
  if (measuredHeight) {
45
- contentContainerStyle.minHeight = measuredHeight;
56
+ contentContainerStyle.minHeight =
57
+ measuredHeight - topBorderWidth - bottomBorderWidth;
46
58
  }
47
59
 
48
60
  let style = omit(flattenedStyle, contentContainerStyleNames);