@prototyp/skeletor 1.0.18 → 1.0.20

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.
Files changed (387) hide show
  1. package/README.md +4 -0
  2. package/lib/commonjs/@types/Font.d.js +2 -0
  3. package/lib/commonjs/@types/Font.d.js.map +1 -0
  4. package/lib/commonjs/components/Block/Block.js +117 -0
  5. package/lib/commonjs/components/Block/Block.js.map +1 -0
  6. package/lib/commonjs/components/Block/index.js +17 -0
  7. package/lib/commonjs/components/Block/index.js.map +1 -0
  8. package/lib/commonjs/components/InputFocusScrollView/InputFocusScrollView.js +111 -0
  9. package/lib/commonjs/components/InputFocusScrollView/InputFocusScrollView.js.map +1 -0
  10. package/lib/commonjs/components/InputFocusScrollView/index.js +17 -0
  11. package/lib/commonjs/components/InputFocusScrollView/index.js.map +1 -0
  12. package/lib/commonjs/components/Screen/Screen.js +58 -0
  13. package/lib/commonjs/components/Screen/Screen.js.map +1 -0
  14. package/lib/commonjs/components/Screen/index.js +17 -0
  15. package/lib/commonjs/components/Screen/index.js.map +1 -0
  16. package/lib/commonjs/components/SkeletorProvider/SkeletorContext.js +17 -0
  17. package/lib/commonjs/components/SkeletorProvider/SkeletorContext.js.map +1 -0
  18. package/lib/commonjs/components/SkeletorProvider/SkeletorProvider.js +24 -0
  19. package/lib/commonjs/components/SkeletorProvider/SkeletorProvider.js.map +1 -0
  20. package/lib/commonjs/components/SkeletorProvider/index.js +28 -0
  21. package/lib/commonjs/components/SkeletorProvider/index.js.map +1 -0
  22. package/lib/commonjs/components/Text/Text.js +73 -0
  23. package/lib/commonjs/components/Text/Text.js.map +1 -0
  24. package/lib/commonjs/components/Text/index.js +17 -0
  25. package/lib/commonjs/components/Text/index.js.map +1 -0
  26. package/lib/commonjs/components/index.js +61 -0
  27. package/lib/commonjs/components/index.js.map +1 -0
  28. package/lib/commonjs/components/package.json +3 -0
  29. package/lib/commonjs/hooks/index.js +72 -0
  30. package/lib/commonjs/hooks/index.js.map +1 -0
  31. package/lib/commonjs/hooks/package.json +3 -0
  32. package/lib/commonjs/hooks/skeleform/README.md +100 -0
  33. package/lib/commonjs/hooks/skeleform/package.json +48 -0
  34. package/lib/commonjs/hooks/skeleform/src/index.js +209 -0
  35. package/lib/commonjs/hooks/skeleform/src/index.js.map +1 -0
  36. package/lib/commonjs/hooks/skeleform/tsconfig.json +14 -0
  37. package/lib/commonjs/hooks/skeleform/yarn.lock +2215 -0
  38. package/lib/commonjs/hooks/useAndroidBackHandler.js +30 -0
  39. package/lib/commonjs/hooks/useAndroidBackHandler.js.map +1 -0
  40. package/lib/commonjs/hooks/useAnimation.js +38 -0
  41. package/lib/commonjs/hooks/useAnimation.js.map +1 -0
  42. package/lib/commonjs/hooks/useAnimationTimeline.js +102 -0
  43. package/lib/commonjs/hooks/useAnimationTimeline.js.map +1 -0
  44. package/lib/commonjs/hooks/useAppState.js +26 -0
  45. package/lib/commonjs/hooks/useAppState.js.map +1 -0
  46. package/lib/commonjs/hooks/useSkeletor.js +12 -0
  47. package/lib/commonjs/hooks/useSkeletor.js.map +1 -0
  48. package/lib/commonjs/index.js +50 -0
  49. package/lib/commonjs/index.js.map +1 -0
  50. package/lib/commonjs/models/Alignment.js +6 -0
  51. package/lib/commonjs/models/Alignment.js.map +1 -0
  52. package/lib/commonjs/models/Animation.js +6 -0
  53. package/lib/commonjs/models/Animation.js.map +1 -0
  54. package/lib/commonjs/models/Border.js +6 -0
  55. package/lib/commonjs/models/Border.js.map +1 -0
  56. package/lib/commonjs/models/Flex.js +6 -0
  57. package/lib/commonjs/models/Flex.js.map +1 -0
  58. package/lib/commonjs/models/NonAnimatedDimensionValue.js +6 -0
  59. package/lib/commonjs/models/NonAnimatedDimensionValue.js.map +1 -0
  60. package/lib/commonjs/models/Position.js +6 -0
  61. package/lib/commonjs/models/Position.js.map +1 -0
  62. package/lib/commonjs/models/Size.js +6 -0
  63. package/lib/commonjs/models/Size.js.map +1 -0
  64. package/lib/commonjs/models/SkeletorConfig.js +6 -0
  65. package/lib/commonjs/models/SkeletorConfig.js.map +1 -0
  66. package/lib/commonjs/models/Spacing.js +6 -0
  67. package/lib/commonjs/models/Spacing.js.map +1 -0
  68. package/lib/commonjs/models/TupleTypes.js +2 -0
  69. package/lib/commonjs/models/TupleTypes.js.map +1 -0
  70. package/lib/commonjs/models/index.js +116 -0
  71. package/lib/commonjs/models/index.js.map +1 -0
  72. package/lib/commonjs/models/package.json +3 -0
  73. package/lib/commonjs/package.json +1 -0
  74. package/lib/commonjs/utils/animations.js +215 -0
  75. package/lib/commonjs/utils/animations.js.map +1 -0
  76. package/lib/commonjs/utils/extract-alignment-properties.js +15 -0
  77. package/lib/commonjs/utils/extract-alignment-properties.js.map +1 -0
  78. package/lib/commonjs/utils/extract-animation-properties.js +58 -0
  79. package/lib/commonjs/utils/extract-animation-properties.js.map +1 -0
  80. package/lib/commonjs/utils/extract-flex-properties.js +30 -0
  81. package/lib/commonjs/utils/extract-flex-properties.js.map +1 -0
  82. package/lib/commonjs/utils/extract-gap-properties.js +26 -0
  83. package/lib/commonjs/utils/extract-gap-properties.js.map +1 -0
  84. package/lib/commonjs/utils/extract-position-properties.js +25 -0
  85. package/lib/commonjs/utils/extract-position-properties.js.map +1 -0
  86. package/lib/commonjs/utils/extract-size-properties.js +17 -0
  87. package/lib/commonjs/utils/extract-size-properties.js.map +1 -0
  88. package/lib/commonjs/utils/index.js +94 -0
  89. package/lib/commonjs/utils/index.js.map +1 -0
  90. package/lib/commonjs/utils/normalize-spacing-values.js +104 -0
  91. package/lib/commonjs/utils/normalize-spacing-values.js.map +1 -0
  92. package/lib/commonjs/utils/package.json +3 -0
  93. package/lib/module/@types/Font.d.js +2 -0
  94. package/lib/module/@types/Font.d.js.map +1 -0
  95. package/lib/module/components/Block/Block.js +44 -33
  96. package/lib/module/components/Block/Block.js.map +1 -1
  97. package/lib/module/components/Block/index.js +3 -1
  98. package/lib/module/components/Block/index.js.map +1 -1
  99. package/lib/module/components/InputFocusScrollView/InputFocusScrollView.js +45 -40
  100. package/lib/module/components/InputFocusScrollView/InputFocusScrollView.js.map +1 -1
  101. package/lib/module/components/InputFocusScrollView/index.js +3 -1
  102. package/lib/module/components/InputFocusScrollView/index.js.map +1 -1
  103. package/lib/module/components/Screen/Screen.js +39 -32
  104. package/lib/module/components/Screen/Screen.js.map +1 -1
  105. package/lib/module/components/Screen/index.js +3 -1
  106. package/lib/module/components/Screen/index.js.map +1 -1
  107. package/lib/module/components/SkeletorProvider/SkeletorContext.js +4 -1
  108. package/lib/module/components/SkeletorProvider/SkeletorContext.js.map +1 -1
  109. package/lib/module/components/SkeletorProvider/SkeletorProvider.js +8 -5
  110. package/lib/module/components/SkeletorProvider/SkeletorProvider.js.map +1 -1
  111. package/lib/module/components/SkeletorProvider/index.js +4 -2
  112. package/lib/module/components/SkeletorProvider/index.js.map +1 -1
  113. package/lib/module/components/Text/Text.js +36 -35
  114. package/lib/module/components/Text/Text.js.map +1 -1
  115. package/lib/module/components/Text/index.js +3 -1
  116. package/lib/module/components/Text/index.js.map +1 -1
  117. package/lib/module/components/index.js +7 -5
  118. package/lib/module/components/index.js.map +1 -1
  119. package/lib/module/hooks/index.js +8 -6
  120. package/lib/module/hooks/index.js.map +1 -1
  121. package/lib/module/hooks/skeleform/src/index.js +5 -8
  122. package/lib/module/hooks/skeleform/src/index.js.map +1 -1
  123. package/lib/module/hooks/useAndroidBackHandler.js +2 -0
  124. package/lib/module/hooks/useAndroidBackHandler.js.map +1 -1
  125. package/lib/module/hooks/useAnimation.js +2 -0
  126. package/lib/module/hooks/useAnimation.js.map +1 -1
  127. package/lib/module/hooks/useAnimationTimeline.js +6 -4
  128. package/lib/module/hooks/useAnimationTimeline.js.map +1 -1
  129. package/lib/module/hooks/useAppState.js +4 -2
  130. package/lib/module/hooks/useAppState.js.map +1 -1
  131. package/lib/module/hooks/useSkeletor.js +3 -1
  132. package/lib/module/hooks/useSkeletor.js.map +1 -1
  133. package/lib/module/index.js +6 -4
  134. package/lib/module/index.js.map +1 -1
  135. package/lib/module/models/Alignment.js +2 -0
  136. package/lib/module/models/Alignment.js.map +1 -1
  137. package/lib/module/models/Animation.js +2 -0
  138. package/lib/module/models/Animation.js.map +1 -1
  139. package/lib/module/models/Border.js +2 -0
  140. package/lib/module/models/Border.js.map +1 -1
  141. package/lib/module/models/Flex.js +2 -0
  142. package/lib/module/models/Flex.js.map +1 -1
  143. package/lib/module/models/NonAnimatedDimensionValue.js +4 -0
  144. package/lib/module/models/NonAnimatedDimensionValue.js.map +1 -0
  145. package/lib/module/models/Position.js +2 -0
  146. package/lib/module/models/Position.js.map +1 -1
  147. package/lib/module/models/Size.js +2 -0
  148. package/lib/module/models/Size.js.map +1 -1
  149. package/lib/module/models/SkeletorConfig.js +2 -0
  150. package/lib/module/models/SkeletorConfig.js.map +1 -1
  151. package/lib/module/models/Spacing.js +2 -0
  152. package/lib/module/models/Spacing.js.map +1 -1
  153. package/lib/module/models/TupleTypes.js +2 -0
  154. package/lib/module/models/TupleTypes.js.map +1 -0
  155. package/lib/module/models/index.js +12 -8
  156. package/lib/module/models/index.js.map +1 -1
  157. package/lib/module/package.json +1 -0
  158. package/lib/module/utils/animations.js +11 -6
  159. package/lib/module/utils/animations.js.map +1 -1
  160. package/lib/module/utils/{extractAlignmentProperties.js → extract-alignment-properties.js} +3 -1
  161. package/lib/module/utils/extract-alignment-properties.js.map +1 -0
  162. package/lib/module/utils/{extractAnimationProperties.js → extract-animation-properties.js} +3 -1
  163. package/lib/module/utils/extract-animation-properties.js.map +1 -0
  164. package/lib/module/utils/{extractFlexProperties.js → extract-flex-properties.js} +3 -1
  165. package/lib/module/utils/extract-flex-properties.js.map +1 -0
  166. package/lib/module/utils/{extractGapProperties.js → extract-gap-properties.js} +3 -1
  167. package/lib/module/utils/extract-gap-properties.js.map +1 -0
  168. package/lib/module/utils/{extractPositionProperties.js → extract-position-properties.js} +4 -3
  169. package/lib/module/utils/extract-position-properties.js.map +1 -0
  170. package/lib/module/utils/{extractSizeProperties.js → extract-size-properties.js} +3 -1
  171. package/lib/module/utils/extract-size-properties.js.map +1 -0
  172. package/lib/module/utils/index.js +10 -7
  173. package/lib/module/utils/index.js.map +1 -1
  174. package/lib/module/utils/normalize-spacing-values.js +99 -0
  175. package/lib/module/utils/normalize-spacing-values.js.map +1 -0
  176. package/lib/typescript/commonjs/components/Block/Block.d.ts.map +1 -0
  177. package/lib/typescript/commonjs/components/Block/index.d.ts.map +1 -0
  178. package/lib/typescript/{components → commonjs/components}/InputFocusScrollView/InputFocusScrollView.d.ts +1 -1
  179. package/lib/typescript/commonjs/components/InputFocusScrollView/InputFocusScrollView.d.ts.map +1 -0
  180. package/lib/typescript/commonjs/components/InputFocusScrollView/index.d.ts.map +1 -0
  181. package/lib/typescript/commonjs/components/Screen/Screen.d.ts +19 -0
  182. package/lib/typescript/commonjs/components/Screen/Screen.d.ts.map +1 -0
  183. package/lib/typescript/commonjs/components/Screen/index.d.ts.map +1 -0
  184. package/lib/typescript/commonjs/components/SkeletorProvider/SkeletorContext.d.ts.map +1 -0
  185. package/lib/typescript/{components → commonjs/components}/SkeletorProvider/SkeletorProvider.d.ts +1 -1
  186. package/lib/typescript/commonjs/components/SkeletorProvider/SkeletorProvider.d.ts.map +1 -0
  187. package/lib/typescript/commonjs/components/SkeletorProvider/index.d.ts.map +1 -0
  188. package/lib/typescript/commonjs/components/Text/Text.d.ts.map +1 -0
  189. package/lib/typescript/commonjs/components/Text/index.d.ts.map +1 -0
  190. package/lib/typescript/commonjs/components/index.d.ts.map +1 -0
  191. package/lib/typescript/commonjs/hooks/index.d.ts.map +1 -0
  192. package/lib/typescript/commonjs/hooks/skeleform/src/index.d.ts.map +1 -0
  193. package/lib/typescript/commonjs/hooks/useAndroidBackHandler.d.ts.map +1 -0
  194. package/lib/typescript/commonjs/hooks/useAnimation.d.ts.map +1 -0
  195. package/lib/typescript/commonjs/hooks/useAnimationTimeline.d.ts.map +1 -0
  196. package/lib/typescript/commonjs/hooks/useAppState.d.ts.map +1 -0
  197. package/lib/typescript/commonjs/hooks/useSkeletor.d.ts.map +1 -0
  198. package/lib/typescript/commonjs/index.d.ts.map +1 -0
  199. package/lib/typescript/commonjs/models/Alignment.d.ts.map +1 -0
  200. package/lib/typescript/{models → commonjs/models}/Animation.d.ts +2 -0
  201. package/lib/typescript/commonjs/models/Animation.d.ts.map +1 -0
  202. package/lib/typescript/{models → commonjs/models}/Border.d.ts +1 -1
  203. package/lib/typescript/commonjs/models/Border.d.ts.map +1 -0
  204. package/lib/typescript/commonjs/models/Flex.d.ts.map +1 -0
  205. package/lib/typescript/commonjs/models/NonAnimatedDimensionValue.d.ts +4 -0
  206. package/lib/typescript/commonjs/models/NonAnimatedDimensionValue.d.ts.map +1 -0
  207. package/lib/typescript/commonjs/models/Position.d.ts.map +1 -0
  208. package/lib/typescript/{models → commonjs/models}/Size.d.ts +1 -1
  209. package/lib/typescript/commonjs/models/Size.d.ts.map +1 -0
  210. package/lib/typescript/commonjs/models/SkeletorConfig.d.ts +20 -0
  211. package/lib/typescript/commonjs/models/SkeletorConfig.d.ts.map +1 -0
  212. package/lib/typescript/commonjs/models/Spacing.d.ts +25 -0
  213. package/lib/typescript/commonjs/models/Spacing.d.ts.map +1 -0
  214. package/lib/typescript/commonjs/models/TupleTypes.d.ts +2 -0
  215. package/lib/typescript/commonjs/models/TupleTypes.d.ts.map +1 -0
  216. package/lib/typescript/{models → commonjs/models}/index.d.ts +2 -0
  217. package/lib/typescript/commonjs/models/index.d.ts.map +1 -0
  218. package/lib/typescript/commonjs/package.json +1 -0
  219. package/lib/typescript/commonjs/utils/animations.d.ts.map +1 -0
  220. package/lib/typescript/{utils/extractAlignmentProperties.d.ts → commonjs/utils/extract-alignment-properties.d.ts} +1 -1
  221. package/lib/typescript/commonjs/utils/extract-alignment-properties.d.ts.map +1 -0
  222. package/lib/typescript/{utils/extractAnimationProperties.d.ts → commonjs/utils/extract-animation-properties.d.ts} +1 -1
  223. package/lib/typescript/commonjs/utils/extract-animation-properties.d.ts.map +1 -0
  224. package/lib/typescript/{utils/extractFlexProperties.d.ts → commonjs/utils/extract-flex-properties.d.ts} +1 -1
  225. package/lib/typescript/commonjs/utils/extract-flex-properties.d.ts.map +1 -0
  226. package/lib/typescript/{utils/extractGapProperties.d.ts → commonjs/utils/extract-gap-properties.d.ts} +1 -1
  227. package/lib/typescript/commonjs/utils/extract-gap-properties.d.ts.map +1 -0
  228. package/lib/typescript/{utils/extractPositionProperties.d.ts → commonjs/utils/extract-position-properties.d.ts} +1 -1
  229. package/lib/typescript/commonjs/utils/extract-position-properties.d.ts.map +1 -0
  230. package/lib/typescript/{utils/extractSizeProperties.d.ts → commonjs/utils/extract-size-properties.d.ts} +1 -1
  231. package/lib/typescript/commonjs/utils/extract-size-properties.d.ts.map +1 -0
  232. package/lib/typescript/commonjs/utils/index.d.ts +9 -0
  233. package/lib/typescript/commonjs/utils/index.d.ts.map +1 -0
  234. package/lib/typescript/commonjs/utils/normalize-spacing-values.d.ts +5 -0
  235. package/lib/typescript/commonjs/utils/normalize-spacing-values.d.ts.map +1 -0
  236. package/lib/typescript/module/components/Block/Block.d.ts +25 -0
  237. package/lib/typescript/module/components/Block/Block.d.ts.map +1 -0
  238. package/lib/typescript/module/components/Block/index.d.ts +2 -0
  239. package/lib/typescript/module/components/Block/index.d.ts.map +1 -0
  240. package/lib/typescript/module/components/InputFocusScrollView/InputFocusScrollView.d.ts +26 -0
  241. package/lib/typescript/module/components/InputFocusScrollView/InputFocusScrollView.d.ts.map +1 -0
  242. package/lib/typescript/module/components/InputFocusScrollView/index.d.ts +2 -0
  243. package/lib/typescript/module/components/InputFocusScrollView/index.d.ts.map +1 -0
  244. package/lib/typescript/module/components/Screen/Screen.d.ts +19 -0
  245. package/lib/typescript/module/components/Screen/Screen.d.ts.map +1 -0
  246. package/lib/typescript/module/components/Screen/index.d.ts +2 -0
  247. package/lib/typescript/module/components/Screen/index.d.ts.map +1 -0
  248. package/lib/typescript/module/components/SkeletorProvider/SkeletorContext.d.ts +5 -0
  249. package/lib/typescript/module/components/SkeletorProvider/SkeletorContext.d.ts.map +1 -0
  250. package/lib/typescript/module/components/SkeletorProvider/SkeletorProvider.d.ts +8 -0
  251. package/lib/typescript/module/components/SkeletorProvider/SkeletorProvider.d.ts.map +1 -0
  252. package/lib/typescript/module/components/SkeletorProvider/index.d.ts +3 -0
  253. package/lib/typescript/module/components/SkeletorProvider/index.d.ts.map +1 -0
  254. package/lib/typescript/module/components/Text/Text.d.ts +21 -0
  255. package/lib/typescript/module/components/Text/Text.d.ts.map +1 -0
  256. package/lib/typescript/module/components/Text/index.d.ts +2 -0
  257. package/lib/typescript/module/components/Text/index.d.ts.map +1 -0
  258. package/lib/typescript/module/components/index.d.ts +6 -0
  259. package/lib/typescript/module/components/index.d.ts.map +1 -0
  260. package/lib/typescript/module/hooks/index.d.ts +7 -0
  261. package/lib/typescript/module/hooks/index.d.ts.map +1 -0
  262. package/lib/typescript/module/hooks/skeleform/src/index.d.ts +50 -0
  263. package/lib/typescript/module/hooks/skeleform/src/index.d.ts.map +1 -0
  264. package/lib/typescript/module/hooks/useAndroidBackHandler.d.ts +16 -0
  265. package/lib/typescript/module/hooks/useAndroidBackHandler.d.ts.map +1 -0
  266. package/lib/typescript/module/hooks/useAnimation.d.ts +20 -0
  267. package/lib/typescript/module/hooks/useAnimation.d.ts.map +1 -0
  268. package/lib/typescript/module/hooks/useAnimationTimeline.d.ts +30 -0
  269. package/lib/typescript/module/hooks/useAnimationTimeline.d.ts.map +1 -0
  270. package/lib/typescript/module/hooks/useAppState.d.ts +7 -0
  271. package/lib/typescript/module/hooks/useAppState.d.ts.map +1 -0
  272. package/lib/typescript/module/hooks/useSkeletor.d.ts +3 -0
  273. package/lib/typescript/module/hooks/useSkeletor.d.ts.map +1 -0
  274. package/lib/typescript/module/index.d.ts +5 -0
  275. package/lib/typescript/module/index.d.ts.map +1 -0
  276. package/lib/typescript/module/models/Alignment.d.ts +8 -0
  277. package/lib/typescript/module/models/Alignment.d.ts.map +1 -0
  278. package/lib/typescript/module/models/Animation.d.ts +47 -0
  279. package/lib/typescript/module/models/Animation.d.ts.map +1 -0
  280. package/lib/typescript/module/models/Border.d.ts +10 -0
  281. package/lib/typescript/module/models/Border.d.ts.map +1 -0
  282. package/lib/typescript/module/models/Flex.d.ts +15 -0
  283. package/lib/typescript/module/models/Flex.d.ts.map +1 -0
  284. package/lib/typescript/module/models/NonAnimatedDimensionValue.d.ts +4 -0
  285. package/lib/typescript/module/models/NonAnimatedDimensionValue.d.ts.map +1 -0
  286. package/lib/typescript/module/models/Position.d.ts +20 -0
  287. package/lib/typescript/module/models/Position.d.ts.map +1 -0
  288. package/lib/typescript/module/models/Size.d.ts +10 -0
  289. package/lib/typescript/module/models/Size.d.ts.map +1 -0
  290. package/lib/typescript/module/models/SkeletorConfig.d.ts +20 -0
  291. package/lib/typescript/module/models/SkeletorConfig.d.ts.map +1 -0
  292. package/lib/typescript/module/models/Spacing.d.ts +25 -0
  293. package/lib/typescript/module/models/Spacing.d.ts.map +1 -0
  294. package/lib/typescript/module/models/TupleTypes.d.ts +2 -0
  295. package/lib/typescript/module/models/TupleTypes.d.ts.map +1 -0
  296. package/lib/typescript/module/models/index.d.ts +11 -0
  297. package/lib/typescript/module/models/index.d.ts.map +1 -0
  298. package/lib/typescript/module/package.json +1 -0
  299. package/lib/typescript/module/utils/animations.d.ts +21 -0
  300. package/lib/typescript/module/utils/animations.d.ts.map +1 -0
  301. package/lib/typescript/module/utils/extract-alignment-properties.d.ts +11 -0
  302. package/lib/typescript/module/utils/extract-alignment-properties.d.ts.map +1 -0
  303. package/lib/typescript/module/utils/extract-animation-properties.d.ts +6 -0
  304. package/lib/typescript/module/utils/extract-animation-properties.d.ts.map +1 -0
  305. package/lib/typescript/module/utils/extract-flex-properties.d.ts +3 -0
  306. package/lib/typescript/module/utils/extract-flex-properties.d.ts.map +1 -0
  307. package/lib/typescript/module/utils/extract-gap-properties.d.ts +8 -0
  308. package/lib/typescript/module/utils/extract-gap-properties.d.ts.map +1 -0
  309. package/lib/typescript/module/utils/extract-position-properties.d.ts +13 -0
  310. package/lib/typescript/module/utils/extract-position-properties.d.ts.map +1 -0
  311. package/lib/typescript/module/utils/extract-size-properties.d.ts +3 -0
  312. package/lib/typescript/module/utils/extract-size-properties.d.ts.map +1 -0
  313. package/lib/typescript/module/utils/index.d.ts +9 -0
  314. package/lib/typescript/module/utils/index.d.ts.map +1 -0
  315. package/lib/typescript/module/utils/normalize-spacing-values.d.ts +5 -0
  316. package/lib/typescript/module/utils/normalize-spacing-values.d.ts.map +1 -0
  317. package/package.json +93 -61
  318. package/lib/module/types/Font.d.js +0 -2
  319. package/lib/module/types/Font.d.js.map +0 -1
  320. package/lib/module/utils/extractAlignmentProperties.js.map +0 -1
  321. package/lib/module/utils/extractAnimationProperties.js.map +0 -1
  322. package/lib/module/utils/extractFlexProperties.js.map +0 -1
  323. package/lib/module/utils/extractGapProperties.js.map +0 -1
  324. package/lib/module/utils/extractPositionProperties.js.map +0 -1
  325. package/lib/module/utils/extractSizeProperties.js.map +0 -1
  326. package/lib/typescript/components/Block/Block.d.ts.map +0 -1
  327. package/lib/typescript/components/Block/index.d.ts.map +0 -1
  328. package/lib/typescript/components/InputFocusScrollView/InputFocusScrollView.d.ts.map +0 -1
  329. package/lib/typescript/components/InputFocusScrollView/index.d.ts.map +0 -1
  330. package/lib/typescript/components/Screen/Screen.d.ts +0 -15
  331. package/lib/typescript/components/Screen/Screen.d.ts.map +0 -1
  332. package/lib/typescript/components/Screen/index.d.ts.map +0 -1
  333. package/lib/typescript/components/SkeletorProvider/SkeletorContext.d.ts.map +0 -1
  334. package/lib/typescript/components/SkeletorProvider/SkeletorProvider.d.ts.map +0 -1
  335. package/lib/typescript/components/SkeletorProvider/index.d.ts.map +0 -1
  336. package/lib/typescript/components/Text/Text.d.ts.map +0 -1
  337. package/lib/typescript/components/Text/index.d.ts.map +0 -1
  338. package/lib/typescript/components/index.d.ts.map +0 -1
  339. package/lib/typescript/hooks/index.d.ts.map +0 -1
  340. package/lib/typescript/hooks/skeleform/src/index.d.ts.map +0 -1
  341. package/lib/typescript/hooks/useAndroidBackHandler.d.ts.map +0 -1
  342. package/lib/typescript/hooks/useAnimation.d.ts.map +0 -1
  343. package/lib/typescript/hooks/useAnimationTimeline.d.ts.map +0 -1
  344. package/lib/typescript/hooks/useAppState.d.ts.map +0 -1
  345. package/lib/typescript/hooks/useSkeletor.d.ts.map +0 -1
  346. package/lib/typescript/index.d.ts.map +0 -1
  347. package/lib/typescript/models/Alignment.d.ts.map +0 -1
  348. package/lib/typescript/models/Animation.d.ts.map +0 -1
  349. package/lib/typescript/models/Border.d.ts.map +0 -1
  350. package/lib/typescript/models/Flex.d.ts.map +0 -1
  351. package/lib/typescript/models/Position.d.ts.map +0 -1
  352. package/lib/typescript/models/Size.d.ts.map +0 -1
  353. package/lib/typescript/models/SkeletorConfig.d.ts +0 -7
  354. package/lib/typescript/models/SkeletorConfig.d.ts.map +0 -1
  355. package/lib/typescript/models/Spacing.d.ts +0 -21
  356. package/lib/typescript/models/Spacing.d.ts.map +0 -1
  357. package/lib/typescript/models/index.d.ts.map +0 -1
  358. package/lib/typescript/utils/animations.d.ts.map +0 -1
  359. package/lib/typescript/utils/extractAlignmentProperties.d.ts.map +0 -1
  360. package/lib/typescript/utils/extractAnimationProperties.d.ts.map +0 -1
  361. package/lib/typescript/utils/extractFlexProperties.d.ts.map +0 -1
  362. package/lib/typescript/utils/extractGapProperties.d.ts.map +0 -1
  363. package/lib/typescript/utils/extractPositionProperties.d.ts.map +0 -1
  364. package/lib/typescript/utils/extractSizeProperties.d.ts.map +0 -1
  365. package/lib/typescript/utils/index.d.ts +0 -8
  366. package/lib/typescript/utils/index.d.ts.map +0 -1
  367. /package/lib/typescript/{components → commonjs/components}/Block/Block.d.ts +0 -0
  368. /package/lib/typescript/{components → commonjs/components}/Block/index.d.ts +0 -0
  369. /package/lib/typescript/{components → commonjs/components}/InputFocusScrollView/index.d.ts +0 -0
  370. /package/lib/typescript/{components → commonjs/components}/Screen/index.d.ts +0 -0
  371. /package/lib/typescript/{components → commonjs/components}/SkeletorProvider/SkeletorContext.d.ts +0 -0
  372. /package/lib/typescript/{components → commonjs/components}/SkeletorProvider/index.d.ts +0 -0
  373. /package/lib/typescript/{components → commonjs/components}/Text/Text.d.ts +0 -0
  374. /package/lib/typescript/{components → commonjs/components}/Text/index.d.ts +0 -0
  375. /package/lib/typescript/{components → commonjs/components}/index.d.ts +0 -0
  376. /package/lib/typescript/{hooks → commonjs/hooks}/index.d.ts +0 -0
  377. /package/lib/typescript/{hooks → commonjs/hooks}/skeleform/src/index.d.ts +0 -0
  378. /package/lib/typescript/{hooks → commonjs/hooks}/useAndroidBackHandler.d.ts +0 -0
  379. /package/lib/typescript/{hooks → commonjs/hooks}/useAnimation.d.ts +0 -0
  380. /package/lib/typescript/{hooks → commonjs/hooks}/useAnimationTimeline.d.ts +0 -0
  381. /package/lib/typescript/{hooks → commonjs/hooks}/useAppState.d.ts +0 -0
  382. /package/lib/typescript/{hooks → commonjs/hooks}/useSkeletor.d.ts +0 -0
  383. /package/lib/typescript/{index.d.ts → commonjs/index.d.ts} +0 -0
  384. /package/lib/typescript/{models → commonjs/models}/Alignment.d.ts +0 -0
  385. /package/lib/typescript/{models → commonjs/models}/Flex.d.ts +0 -0
  386. /package/lib/typescript/{models → commonjs/models}/Position.d.ts +0 -0
  387. /package/lib/typescript/{utils → commonjs/utils}/animations.d.ts +0 -0
@@ -1,7 +1,9 @@
1
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
1
+ "use strict";
2
+
2
3
  import React, { useMemo } from "react";
3
4
  import { Animated, ScrollView, StyleSheet } from "react-native";
4
- import { extractAlignmentProperties, extractAnimationProperties, extractFlexProperties, extractGapProperties, extractPositionProperties, extractSizeProperties } from "../../utils";
5
+ import { extractAlignmentProperties, extractAnimationProperties, extractFlexProperties, extractGapProperties, extractPositionProperties, extractSizeProperties, normalizeMarginValues, normalizePaddingValues } from "../../utils/index.js";
6
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
5
7
  const BlockElement = ({
6
8
  children,
7
9
  ...props
@@ -19,24 +21,28 @@ const BlockElement = ({
19
21
  gap,
20
22
  ...view
21
23
  } = props;
22
- const animationProps = useMemo(() => extractAnimationProperties(animations), [animations]);
24
+ const sizeProps = extractSizeProperties(props);
25
+ const positionProps = extractPositionProperties(props);
26
+ const alignmentProps = extractAlignmentProperties(props);
23
27
  const flexProps = useMemo(() => extractFlexProperties({
24
28
  flex
25
29
  }), [flex]);
26
30
  const gapProps = useMemo(() => extractGapProperties({
27
31
  gap
28
32
  }), [gap]);
29
- const sizeProps = extractSizeProperties(props);
30
- const positionProps = extractPositionProperties(props);
31
- const alignmentProps = extractAlignmentProperties(props);
32
- const styles = useMemo(() => StyleSheet.flatten([{
33
+ const animationProps = useMemo(() => extractAnimationProperties(animations), [animations]);
34
+ const normalizedMargins = useMemo(() => normalizeMarginValues(margins), [margins]);
35
+ const normalizedPaddings = useMemo(() => normalizePaddingValues(paddings), [paddings]);
36
+ const styles = StyleSheet.flatten([{
33
37
  backgroundColor: typeof background === "string" ? background : undefined,
34
38
  overflow,
35
39
  opacity
36
- }, alignmentProps, margins, paddings, border, flexProps, sizeProps, positionProps, gapProps, style]), [alignmentProps, sizeProps, background, style, overflow, margins, paddings, positionProps, flexProps, gapProps, border, opacity]);
37
- return /*#__PURE__*/React.createElement(Animated.View, _extends({}, view, {
38
- style: [styles, animationProps]
39
- }), children);
40
+ }, alignmentProps, normalizedMargins, normalizedPaddings, border, flexProps, sizeProps, positionProps, gapProps, style]);
41
+ return /*#__PURE__*/_jsx(Animated.View, {
42
+ ...view,
43
+ style: [styles, animationProps],
44
+ children: children
45
+ });
40
46
  };
41
47
  function isScrollable(props) {
42
48
  return !!props.scrollable;
@@ -53,16 +59,20 @@ export const Block = ({
53
59
  ...props
54
60
  }) => {
55
61
  if (!isScrollable(props)) {
56
- return /*#__PURE__*/React.createElement(BlockElement, props, props.background && typeof props.background !== "string" && /*#__PURE__*/React.createElement(BlockElement, {
57
- absolute: true,
58
- zIndex: -1,
59
- offsets: {
60
- top: 0,
61
- bottom: 0,
62
- left: 0,
63
- right: 0
64
- }
65
- }, props.background), children);
62
+ return /*#__PURE__*/_jsxs(BlockElement, {
63
+ ...props,
64
+ children: [props.background && typeof props.background !== "string" && /*#__PURE__*/_jsx(BlockElement, {
65
+ absolute: true,
66
+ zIndex: -1,
67
+ offsets: {
68
+ top: 0,
69
+ bottom: 0,
70
+ left: 0,
71
+ right: 0
72
+ },
73
+ children: props.background
74
+ }), children]
75
+ });
66
76
  }
67
77
  const {
68
78
  scrollProps,
@@ -76,7 +86,7 @@ export const Block = ({
76
86
  bounces = false,
77
87
  contentContainerStyle
78
88
  } = scrollProps || {};
79
- return /*#__PURE__*/React.createElement(ScrollView, _extends({
89
+ return /*#__PURE__*/_jsx(ScrollView, {
80
90
  horizontal: horizontal,
81
91
  keyboardShouldPersistTaps: keyboardShouldPersistTaps,
82
92
  showsHorizontalScrollIndicator: showsHorizontalScrollIndicator,
@@ -85,16 +95,17 @@ export const Block = ({
85
95
  contentContainerStyle: [{
86
96
  flexGrow: 1,
87
97
  backgroundColor: typeof rest.background === "string" ? rest.background : undefined
88
- }, contentContainerStyle]
89
- }, scrollProps), /*#__PURE__*/React.createElement(BlockElement, rest, rest.background && typeof rest.background !== "string" && /*#__PURE__*/React.createElement(BlockElement, {
90
- absolute: true,
91
- zIndex: -1,
92
- offsets: {
93
- top: 0,
94
- bottom: 0,
95
- left: 0,
96
- right: 0
97
- }
98
- }, rest.background), children));
98
+ }, contentContainerStyle],
99
+ ...scrollProps,
100
+ children: /*#__PURE__*/_jsxs(BlockElement, {
101
+ ...rest,
102
+ children: [rest.background && typeof rest.background !== "string" && /*#__PURE__*/_jsx(BlockElement, {
103
+ absolute: true,
104
+ zIndex: -1,
105
+ offsets: [0, 0, 0, 0],
106
+ children: rest.background
107
+ }), children]
108
+ })
109
+ });
99
110
  };
100
111
  //# sourceMappingURL=Block.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["React","useMemo","Animated","ScrollView","StyleSheet","extractAlignmentProperties","extractAnimationProperties","extractFlexProperties","extractGapProperties","extractPositionProperties","extractSizeProperties","BlockElement","children","props","border","paddings","margins","background","style","overflow","animations","opacity","flex","gap","view","animationProps","flexProps","gapProps","sizeProps","positionProps","alignmentProps","styles","flatten","backgroundColor","undefined","createElement","View","_extends","isScrollable","scrollable","Block","absolute","zIndex","offsets","top","bottom","left","right","scrollProps","rest","horizontal","keyboardShouldPersistTaps","showsVerticalScrollIndicator","showsHorizontalScrollIndicator","bounces","contentContainerStyle","flexGrow"],"sourceRoot":"../../src","sources":["Block.tsx"],"mappings":";AAAA,OAAOA,KAAK,IAAIC,OAAO,QAAgC,OAAO;AAC9D,SACEC,QAAQ,EACRC,UAAU,EACVC,UAAU,QAIL,cAAc;AAWrB,SACEC,0BAA0B,EAC1BC,0BAA0B,EAC1BC,qBAAqB,EACrBC,oBAAoB,EACpBC,yBAAyB,EACzBC,qBAAqB,QAChB,aAAa;AA8BpB,MAAMC,YAA4D,GAAGA,CAAC;EACpEC,QAAQ;EACR,GAAGC;AACL,CAAC,KAAK;EACJ,MAAM;IACJC,MAAM;IACNC,QAAQ;IACRC,OAAO;IACPC,UAAU;IACVC,KAAK;IACLC,QAAQ;IACRC,UAAU;IACVC,OAAO;IACPC,IAAI;IACJC,GAAG;IACH,GAAGC;EACL,CAAC,GAAGX,KAAK;EAET,MAAMY,cAAc,GAAGxB,OAAO,CAC5B,MAAMK,0BAA0B,CAACc,UAAU,CAAC,EAC5C,CAACA,UAAU,CACb,CAAC;EACD,MAAMM,SAAS,GAAGzB,OAAO,CAAC,MAAMM,qBAAqB,CAAC;IAAEe;EAAK,CAAC,CAAC,E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M,EAAE,CAAC,CAAE;IACXC,OAAO,EAAE;MAAEC,GAAG,EAAE,CAAC;MAAEC,MAAM,EAAE,CAAC;MAAEC,IAAI,EAAE,CAAC;MAAEC,KAAK,EAAE;IAAE;EAAE,GAEjDE,IAAI,CAAChC,UACM,CACf,EACAL,QACW,CACJ,CAAC;AAEjB,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["React","useMemo","Animated","ScrollView","StyleSheet","extractAlignmentProperties","extractAnimationProperties","extractFlexProperties","extractGapProperties","extractPositionProperties","extractSizeProperties","normalizeMarginValues","normalizePaddingValues","jsx","_jsx","jsxs","_jsxs","BlockElement","children","props","border","paddings","margins","background","style","overflow","animations","opacity","flex","gap","view","sizeProps","positionProps","alignmentProps","flexProps","gapProps","animationProps","normalizedMargins","normalizedPaddings","styles","flatten","backgroundColor","undefined","View","isScrollable","scrollable","Block","absolute","zIndex","offsets","top","bottom","left","right","scrollProps","rest","horizontal","keyboardShouldPersistTaps","showsVerticalScrollIndicator","showsHorizontalScrollIndicator","bounces","contentContainerStyle","flexGrow"],"sourceRoot":"../../../../src","sources":["components/Block/Block.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAA4BC,OAAO,QAAQ,OAAO;AAC9D,SACEC,QAAQ,EACRC,UAAU,EAEVC,UAAU,QAGL,cAAc;AAWrB,SACEC,0BAA0B,EAC1BC,0BAA0B,EAC1BC,qBAAqB,EACrBC,oBAAoB,EACpBC,yBAAyB,EACzBC,qBAAqB,EACrBC,qBAAqB,EACrBC,sBAAsB,QACjB,sBAAa;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AA8BrB,MAAMC,YAA4D,GAAGA,CAAC;EACpEC,QAAQ;EACR,GAAGC;AACL,CAAC,KAAK;EACJ,MAAM;IACJC,MAAM;IACNC,QAAQ;IACRC,OAAO;IACPC,UAAU;IACVC,KAAK;IACLC,QAAQ;IACRC,UAAU;IACVC,OAAO;IACPC,IAAI;IACJC,GAAG;IAC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mB;IAC5D,CAAC,EACDmB,qBAAqB,CACrB;IAAA,GACEP,WAAW;IAAApC,QAAA,eAEfF,KAAA,CAACC,YAAY;MAAA,GAAKsC,IAAI;MAAArC,QAAA,GACnBqC,IAAI,CAAChC,UAAU,IAAI,OAAOgC,IAAI,CAAChC,UAAU,KAAK,QAAQ,iBACrDT,IAAA,CAACG,YAAY;QAAC8B,QAAQ;QAACC,MAAM,EAAE,CAAC,CAAE;QAACC,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAE;QAAA/B,QAAA,EACtDqC,IAAI,CAAChC;MAAU,CACJ,CACf,EACAL,QAAQ;IAAA,CACG;EAAC,CACL,CAAC;AAEjB,CAAC","ignoreList":[]}
@@ -1,2 +1,4 @@
1
- export * from "./Block";
1
+ "use strict";
2
+
3
+ export * from "./Block.js";
2
4
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":[],"sourceRoot":"../../src","sources":["index.ts"],"mappings":"AAAA,cAAc,SAAS","ignoreList":[]}
1
+ {"version":3,"names":[],"sourceRoot":"../../../../src","sources":["components/Block/index.ts"],"mappings":";;AAAA,cAAc,YAAS","ignoreList":[]}
@@ -1,7 +1,9 @@
1
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
- import React, { useMemo, useRef, useState } from "react";
3
- import { Dimensions, Platform, ScrollView, StyleSheet } from "react-native";
4
- import { extractGapProperties } from "../../utils";
1
+ "use strict";
2
+
3
+ import { useEffect, useMemo, useRef } from "react";
4
+ import { Dimensions, Keyboard, Platform, ScrollView, StyleSheet } from "react-native";
5
+ import { extractGapProperties, normalizeMarginValues, normalizePaddingValues } from "../../utils/index.js";
6
+ import { jsx as _jsx } from "react/jsx-runtime";
5
7
  /**
6
8
  * This scroll view will automatically scroll to an active input field rendered within it, provided you attach the `onInputFocus` callback to the input onFocus prop.
7
9
  *
@@ -31,60 +33,64 @@ export const InputFocusScrollView = ({
31
33
  bounces = false,
32
34
  ...rest
33
35
  }) => {
34
- const screenHeight = useRef(Dimensions.get("screen").height).current;
35
36
  const ref = useRef(null);
37
+ const scrollTarget = useRef();
38
+ const elementOffset = useRef(0);
39
+ const contentHeight = useRef(0);
36
40
  /** Cached scroll position to keep focus on input if layout shifts. */
37
- const [scrollPosition, setScrollPosition] = useState(null);
38
- const [scrollTarget, setScrollTarget] = useState(null);
41
+ const scrollPosition = useRef(0);
42
+ const focusOffset = useRef(0);
39
43
  function onInputFocus(e) {
40
- if (Platform.OS !== "ios" || !scrollTarget) {
44
+ if (Platform.OS !== "ios" || !scrollTarget.current) {
41
45
  return;
42
46
  }
43
- e.currentTarget.measureLayout(scrollTarget, (nope, top, nuuh, elementHeight) => {
44
- var _ref$current;
45
- let scrollY = top - elementHeight;
46
- if (focusPositionOffset !== undefined) {
47
- scrollY = scrollY - screenHeight * focusPositionOffset;
48
- }
49
-
50
- // Cache scroll position for layout shift cases
51
- setScrollPosition(scrollY);
52
- // Scroll to input position
53
- (_ref$current = ref.current) === null || _ref$current === void 0 || _ref$current.scrollTo({
47
+ e.currentTarget.measureLayout(scrollTarget.current, (_nope, top, _nuuh, elementHeight) => {
48
+ focusOffset.current = focusPositionOffset !== undefined ? Dimensions.get("screen").height * focusPositionOffset : 0;
49
+ // bottom of element
50
+ elementOffset.current = top + elementHeight;
51
+ const scrollY = elementOffset.current - focusOffset.current;
52
+ scrollPosition.current = scrollY;
53
+ ref.current?.scrollTo({
54
54
  y: scrollY
55
55
  });
56
56
  }, () => console.error("failed to measure layout"));
57
57
  }
58
-
59
- /** Handle layout shifts by programmatically scrolling to the same input position without animation. */
60
- function onContentSizeChange() {
61
- var _ref$current2;
62
- if (Platform.OS !== "ios" || !scrollPosition) {
63
- return;
64
- }
65
- (_ref$current2 = ref.current) === null || _ref$current2 === void 0 || _ref$current2.scrollTo({
66
- y: scrollPosition,
67
- animated: false
58
+ useEffect(() => {
59
+ const listener = Keyboard.addListener("keyboardWillHide", () => {
60
+ const keyboardHeight = Keyboard.metrics()?.height || 0;
61
+ const leftoverSpace = contentHeight.current - elementOffset.current;
62
+ // If we haven't reached scroll view overflow yet, do nothing
63
+ if (leftoverSpace < keyboardHeight) ref.current?.scrollToEnd();
68
64
  });
69
- setScrollPosition(null);
70
- }
65
+ return listener.remove;
66
+ });
71
67
  const gapProps = useMemo(() => extractGapProperties({
72
68
  gap
73
69
  }), [gap]);
74
- const containerStyles = StyleSheet.flatten([styles[height], margins, style]);
75
- const contentStyles = StyleSheet.flatten([styles.content, paddings, gapProps, contentContainerStyle]);
76
- return /*#__PURE__*/React.createElement(ScrollView, _extends({
70
+ const normalizedMargins = useMemo(() => normalizeMarginValues(margins), [margins]);
71
+ const normalizedPaddings = useMemo(() => normalizePaddingValues(paddings), [paddings]);
72
+ const containerStyles = StyleSheet.flatten([styles[height], normalizedMargins, style]);
73
+ const contentStyles = StyleSheet.flatten([styles.content, normalizedPaddings, gapProps, contentContainerStyle]);
74
+ return /*#__PURE__*/_jsx(ScrollView, {
77
75
  ref: ref,
78
76
  scrollToOverflowEnabled: true,
79
77
  scrollEventThrottle: 33,
80
- onLayout: e => setScrollTarget(e.currentTarget),
81
- onContentSizeChange: onContentSizeChange,
78
+ onLayout: ({
79
+ currentTarget
80
+ }) => {
81
+ scrollTarget.current = currentTarget;
82
+ },
83
+ onContentSizeChange: (_, height) => {
84
+ contentHeight.current = height;
85
+ },
82
86
  showsVerticalScrollIndicator: showsVerticalScrollIndicator,
83
87
  showsHorizontalScrollIndicator: showsHorizontalScrollIndicator,
84
88
  bounces: bounces,
85
89
  style: containerStyles,
86
- contentContainerStyle: contentStyles
87
- }, rest), children(onInputFocus));
90
+ contentContainerStyle: contentStyles,
91
+ ...rest,
92
+ children: children(onInputFocus)
93
+ });
88
94
  };
89
95
  const styles = StyleSheet.create({
90
96
  full: {
@@ -94,8 +100,7 @@ const styles = StyleSheet.create({
94
100
  height: "auto"
95
101
  },
96
102
  content: {
97
- flexGrow: 1,
98
- paddingBottom: 30
103
+ flexGrow: 1
99
104
  }
100
105
  });
101
106
  //# sourceMappingURL=InputFocusScrollView.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["React","useMemo","useRef","useState","Dimensions","Platform","ScrollView","StyleSheet","extractGapProperties","InputFocusScrollView","children","style","contentContainerStyle","height","focusPositionOffset","margins","paddings","gap","showsVerticalScrollIndicator","showsHorizontalScrollIndicator","bounces","rest","screenHeight","get","current","ref","scrollPosition","setScrollPosition","scrollTarget","setScrollTarget","onInputFocus","e","OS","currentTarget","measureLayout","nope","top","nuuh","elementHeight","_ref$current","scrollY","undefined","scrollTo","y","console","error","onContentSizeChange","_ref$current2","animated","gapProps","containerStyles","flatten","styles","contentStyles","content","createElement","_extends","scrollToOverflowEnabled","scrollEventThrottle","onLayout","create","full","auto","flexGrow","paddingBottom"],"sourceRoot":"../../src","sources":["InputFocusScrollView.tsx"],"mappings":";AAAA,OAAOA,KAAK,IAAIC,OAAO,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,OAAO;AACxD,SACEC,UAAU,EACVC,QAAQ,EACRC,UAAU,EACVC,UAAU,QAKL,cAAc;AAGrB,SAASC,oBAAoB,QAAQ,aAAa;AAalD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,oBAAyD,GAAGA,CAAC;EACxEC,QAAQ;EACRC,KAAK;EACLC,qBAAqB;EACrBC,MAAM,GAAG,MAAM;EACfC,mBAAmB,GAAG,GAAG;EACzBC,OAAO;EACPC,QAAQ;EACRC,GAAG;EACHC,4BAA4B,GAAG,KAAK;EACpCC,8BAA8B,GAAG,KAAK;EACtCC,OAAO,GAAG,KAAK;EACf,GAAGC;AACL,CAAC,KAAK;EACJ,MAAMC,YAAY,GAAGpB,MAAM,CAACE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ractGapProperties","normalizeMarginValues","normalizePaddingValues","jsx","_jsx","InputFocusScrollView","children","style","contentContainerStyle","height","focusPositionOffset","margins","paddings","gap","showsVerticalScrollIndicator","showsHorizontalScrollIndicator","bounces","rest","ref","scrollTarget","elementOffset","contentHeight","scrollPosition","focusOffset","onInputFocus","e","OS","current","currentTarget","measureLayout","_nope","top","_nuuh","elementHeight","undefined","get","scrollY","scrollTo","y","console","error","listener","addListener","keyboardHeight","metrics","leftoverSpace","scrollToEnd","remove","gapProps","normalizedMargins","normalizedPaddings","containerStyles","flatten","styles","contentStyles","content","scrollToOverflowEnabled","scrollEventThrottle","onLayout","onContentSizeChange","_","create","full","auto","flexGrow"],"sourceRoot":"../../../../src","sources":["components/InputFocusScrollView/InputFocusScrollView.tsx"],"mappings":";;AAAA,SAASA,SAAS,EAAEC,OAAO,EAAEC,MAAM,QAAQ,OAAO;AAClD,SACEC,UAAU,EACVC,QAAQ,EAERC,QAAQ,EACRC,UAAU,EAEVC,UAAU,QAGL,cAAc;AAGrB,SACEC,oBAAoB,EACpBC,qBAAqB,EACrBC,sBAAsB,QACjB,sBAAa;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAcrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,oBAAyD,GAAGA,CAAC;EACxEC,QAAQ;EACRC,KAAK;EACLC,qBAAqB;EACrBC,MAAM,GAAG,MAAM;EACfC,mBAAmB,GAAG,GAAG;EACzBC,OAAO;EACPC,QAAQ;EACRC,GAAG;EACHC,4BAA4B,GAAG,KAAK;EACpCC,8BAA8B,GAAG,KAAK;EACtCC,OAAO,GAAG,KAAK;EACf,GAAGC;AACL,CAAC,KAAK;EACJ,MAAMC,GAAG,GAAGxB,MAAM,CAAa,IAAI,CAAC;EACpC,MAAMyB,YAAY,GAAGzB,MAAM,CAAqB,CAAC;EACjD,MAAM0B,aAAa,GAAG1B,MAAM,CAAC,CAAC,CAAC;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b,CAAC;AAEjB,CAAC;AAED,MAAM6B,MAAM,GAAGtD,UAAU,CAAC8D,MAAM,CAAC;EAC/BC,IAAI,EAAE;IAAErD,MAAM,EAAE;EAAO,CAAC;EACxBsD,IAAI,EAAE;IAAEtD,MAAM,EAAE;EAAO,CAAC;EACxB8C,OAAO,EAAE;IAAES,QAAQ,EAAE;EAAE;AACzB,CAAC,CAAC","ignoreList":[]}
@@ -1,2 +1,4 @@
1
- export * from "./InputFocusScrollView";
1
+ "use strict";
2
+
3
+ export * from "./InputFocusScrollView.js";
2
4
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":[],"sourceRoot":"../../src","sources":["index.ts"],"mappings":"AAAA,cAAc,wBAAwB","ignoreList":[]}
1
+ {"version":3,"names":[],"sourceRoot":"../../../../src","sources":["components/InputFocusScrollView/index.ts"],"mappings":";;AAAA,cAAc,2BAAwB","ignoreList":[]}
@@ -1,8 +1,9 @@
1
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
- import React from "react";
3
- import { Platform, SafeAreaView, StatusBar, StyleSheet, View } from "react-native";
4
- import { useSkeletor } from "../../hooks";
5
- import { Block } from "../Block";
1
+ "use strict";
2
+
3
+ import { SafeAreaView, StatusBar, StyleSheet } from "react-native";
4
+ import { useSkeletor } from "../../hooks/index.js";
5
+ import { Block } from "../Block/index.js";
6
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
6
7
  export const Screen = ({
7
8
  background,
8
9
  children,
@@ -11,36 +12,42 @@ export const Screen = ({
11
12
  bottomSafeAreaColor,
12
13
  topSafeAreaColor,
13
14
  statusBarType,
14
- paddings = {
15
- paddingTop: Platform.OS === "android" ? StatusBar.currentHeight : 0
16
- },
17
- flex = 1,
15
+ statusBarBackground,
16
+ statusBarTranslucent,
17
+ paddings,
18
18
  ...blockProps
19
19
  }) => {
20
20
  const {
21
- defaultStatusBarType
21
+ defaultStatusBarType,
22
+ defaultStatusBarBackground,
23
+ defaultStatusBarTranslucent
22
24
  } = useSkeletor();
23
- return /*#__PURE__*/React.createElement(React.Fragment, null, background && (typeof background === "string" ? /*#__PURE__*/React.createElement(View, {
24
- style: [StyleSheet.absoluteFill, {
25
- backgroundColor: background
26
- }]
27
- }) : /*#__PURE__*/React.createElement(View, {
28
- style: StyleSheet.absoluteFill
29
- }, background)), !hideTopSafeArea && /*#__PURE__*/React.createElement(SafeAreaView, {
30
- style: {
31
- backgroundColor: topSafeAreaColor
32
- }
33
- }), /*#__PURE__*/React.createElement(StatusBar, {
34
- translucent: true,
35
- backgroundColor: "transparent",
36
- barStyle: statusBarType || defaultStatusBarType
37
- }), /*#__PURE__*/React.createElement(Block, _extends({
38
- flex: flex,
39
- paddings: paddings
40
- }, blockProps), children), !hideBottomSafeArea && /*#__PURE__*/React.createElement(SafeAreaView, {
41
- style: {
42
- backgroundColor: bottomSafeAreaColor
43
- }
44
- }));
25
+ return /*#__PURE__*/_jsxs(_Fragment, {
26
+ children: [background && (typeof background === "string" ? /*#__PURE__*/_jsx(Block, {
27
+ style: [StyleSheet.absoluteFill, {
28
+ backgroundColor: background
29
+ }]
30
+ }) : /*#__PURE__*/_jsx(Block, {
31
+ style: StyleSheet.absoluteFill,
32
+ children: background
33
+ })), /*#__PURE__*/_jsx(StatusBar, {
34
+ translucent: statusBarTranslucent || defaultStatusBarTranslucent || false,
35
+ barStyle: statusBarType || defaultStatusBarType,
36
+ backgroundColor: statusBarBackground || defaultStatusBarBackground || "transparent"
37
+ }), !hideTopSafeArea && /*#__PURE__*/_jsx(SafeAreaView, {
38
+ style: {
39
+ backgroundColor: topSafeAreaColor
40
+ }
41
+ }), /*#__PURE__*/_jsx(Block, {
42
+ flex: 1,
43
+ paddings: paddings,
44
+ ...blockProps,
45
+ children: children
46
+ }), !hideBottomSafeArea && /*#__PURE__*/_jsx(SafeAreaView, {
47
+ style: {
48
+ backgroundColor: bottomSafeAreaColor
49
+ }
50
+ })]
51
+ });
45
52
  };
46
53
  //# sourceMappingURL=Screen.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["React","Platform","SafeAreaView","StatusBar","StyleSheet","View","useSkeletor","Block","Screen","background","children","hideBottomSafeArea","hideTopSafeArea","bottomSafeAreaColor","topSafeAreaColor","statusBarType","paddings","paddingTop","OS","currentHeight","flex","blockProps","defaultStatusBarType","createElement","Fragment","style","absoluteFill","backgroundColor","translucent","barStyle","_extends"],"sourceRoot":"../../src","sources":["Screen.tsx"],"mappings":";AAAA,OAAOA,KAAK,MAAkC,OAAO;AACrD,SACEC,QAAQ,EACRC,YAAY,EACZC,SAAS,EACTC,UAAU,EACVC,IAAI,QACC,cAAc;AAErB,SAASC,WAAW,QAAQ,aAAa;AACzC,SACEC,KAAK,QAGA,UAAU;AAcjB,OAAO,MAAMC,MAAgD,GAAGA,CAAC;EAC/DC,UAAU;EACVC,QAAQ;EACRC,kBAAkB;EAClBC,eAAe;EACfC,mBAAmB;EACnBC,gBAAgB;EAChBC,aAAa;EACbC,QAAQ,GAAG;IACTC,UAAU,EAAEhB,QAAQ,CAACiB,EAAE,KAAK,SAAS,GAAGf,SAAS,CAACgB,aAAa,GAAG;EACpE,CAAC;EACDC,IAAI,GAAG,CAAC;EACR,GAAGC;AACL,CAAC,KAAK;EACJ,MAAM;IAAEC;EAAqB,CAAC,GAAGhB,WAAW,CAAC,CAAC;EAE9C,oBACEN,KAAA,CAAAuB,aAAA,CAAAvB,KAAA,CAAAwB,QAAA,QACGf,UAAU,KACR,OAAOA,UAAU,KAAK,QAAQ,gBAC7BT,KAAA,CAAAuB,aAAA,CAAClB,IAAI;IACHoB,KAAK,EAAE,CAACrB,UAAU,CAACsB,YAAY,EAAE;MAAEC,eAAe,EAAElB;IAAW,CAAC;EAAE,CACnE,CAAC,gBAEFT,KAAA,CAAAuB,aAAA,CAAClB,IAAI;IAACoB,KAAK,EAAErB,UAAU,CAACsB;EAAa,GAAEjB,UAAiB,CACzD,CAAC,EAEH,CAACG,eAAe,iBACfZ,KAAA,CAAAuB,aAAA,CAACrB,YAAY;IAACuB,KAAK,EAAE;MAAEE,eAAe,EAAEb;IAAiB;EAAE,CAAE,CAC9D,eAEDd,KAAA,CAAAuB,aAAA,CAACpB,SAAS;IACRyB,WAAW;IACXD,eAAe,EAAC,aAAa;IAC7BE,QAAQ,EAAEd,aAAa,IAAIO;EAAqB,CACjD,CAAC,eAEFtB,KAAA,CAAAuB,aAAA,CAAChB,KAAK,EAAAuB,QAAA;IAACV,IAAI,EAAEA,IAAK;IAACJ,QAAQ,EAAEA;EAAS,GAAKK,UAAU,GAClDX,QACI,CAAC,EAEP,CAACC,kBAAkB,iBAClBX,KAAA,CAAAuB,aAAA,CAACrB,YAAY;IACXuB,KAAK,EAAE;MACLE,eAAe,EAAEd;IACnB;EAAE,CACH,CAEH,CAAC;AAEP,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["SafeAreaView","StatusBar","StyleSheet","useSkeletor","Block","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","Screen","background","children","hideBottomSafeArea","hideTopSafeArea","bottomSafeAreaColor","topSafeAreaColor","statusBarType","statusBarBackground","statusBarTranslucent","paddings","blockProps","defaultStatusBarType","defaultStatusBarBackground","defaultStatusBarTranslucent","style","absoluteFill","backgroundColor","translucent","barStyle","flex"],"sourceRoot":"../../../../src","sources":["components/Screen/Screen.tsx"],"mappings":";;AACA,SAEEA,YAAY,EACZC,SAAS,EAGTC,UAAU,QACL,cAAc;AAErB,SAASC,WAAW,QAAQ,sBAAa;AACzC,SAASC,KAAK,QAAyB,mBAAU;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,QAAA,IAAAC,SAAA,EAAAC,IAAA,IAAAC,KAAA;AAiBlD,OAAO,MAAMC,MAAgD,GAAGA,CAAC;EAC/DC,UAAU;EACVC,Q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4
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":[],"sourceRoot":"../../src","sources":["index.ts"],"mappings":"AAAA,cAAc,UAAU","ignoreList":[]}
1
+ {"version":3,"names":[],"sourceRoot":"../../../../src","sources":["components/Screen/index.ts"],"mappings":";;AAAA,cAAc,aAAU","ignoreList":[]}
@@ -1,9 +1,12 @@
1
+ "use strict";
2
+
1
3
  import React from "react";
2
4
  export const SkeletorDefaults = {
3
5
  defaultFont: undefined,
4
6
  defaultFontSize: [12, 16],
5
7
  defaultStatusBarType: "dark-content",
6
- defaultTextColor: "black"
8
+ defaultTextColor: "black",
9
+ allowFontScaling: false
7
10
  };
8
11
  export const SkeletorContext = /*#__PURE__*/React.createContext(SkeletorDefaults);
9
12
  //# sourceMappingURL=SkeletorContext.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["React","SkeletorDefaults","defaultFont","undefined","defaultFontSize","defaultStatusBarType","defaultTextColor","SkeletorContext","createContext"],"sourceRoot":"../../src","sources":["SkeletorContext.ts"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AAIzB,OAAO,MAAMC,gBAAgC,GAAG;EAC/CC,WAAW,EAAEC,SAAS;EACtBC,eAAe,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC;EACzBC,oBAAoB,EAAE,cAAc;EACpCC,gBAAgB,EAAE;AACnB,CAAC;AAED,OAAO,MAAMC,eAAe,gBAC3BP,KAAK,CAACQ,aAAa,CAAiBP,gBAAgB,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["React","SkeletorDefaults","defaultFont","undefined","defaultFontSize","defaultStatusBarType","defaultTextColor","allowFontScaling","SkeletorContext","createContext"],"sourceRoot":"../../../../src","sources":["components/SkeletorProvider/SkeletorContext.ts"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AAGzB,OAAO,MAAMC,gBAAgC,GAAG;EAC/CC,WAAW,EAAEC,SAAS;EACtBC,eAAe,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC;EACzBC,oBAAoB,EAAE,cAAc;EACpCC,gBAAgB,EAAE,OAAO;EACzBC,gBAAgB,EAAE;AACnB,CAAC;AAED,OAAO,MAAMC,eAAe,gBAC3BR,KAAK,CAACS,aAAa,CAAiBR,gBAAgB,CAAC","ignoreList":[]}
@@ -1,16 +1,19 @@
1
- import React from "react";
2
- import { SkeletorContext, SkeletorDefaults } from "./SkeletorContext";
1
+ "use strict";
2
+
3
+ import { SkeletorContext, SkeletorDefaults } from "./SkeletorContext.js";
4
+ import { jsx as _jsx } from "react/jsx-runtime";
3
5
  /** Create a Font.d.ts type in your typescript types directory and define fonts as follows:
4
6
  * @example type Font = "Helvetica" | "Montserrat" ... */
5
7
  export const SkeletorProvider = ({
6
8
  children,
7
9
  ...config
8
10
  }) => {
9
- return /*#__PURE__*/React.createElement(SkeletorContext.Provider, {
11
+ return /*#__PURE__*/_jsx(SkeletorContext.Provider, {
10
12
  value: {
11
13
  ...SkeletorDefaults,
12
14
  ...config
13
- }
14
- }, children);
15
+ },
16
+ children: children
17
+ });
15
18
  };
16
19
  //# sourceMappingURL=SkeletorProvider.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["React","SkeletorContext","SkeletorDefaults","SkeletorProvider","children","config","createElement","Provider","value"],"sourceRoot":"../../src","sources":["SkeletorProvider.tsx"],"mappings":"AAAA,OAAOA,KAAK,MAAkC,OAAO;AAGrD,SAASC,eAAe,EAAEC,gBAAgB,QAAQ,mBAAmB;AAIrE;AACA;AACA,OAAO,MAAMC,gBAAoD,GAAGA,CAAC;EACnEC,QAAQ;EACR,GAAGC;AACL,CAAC,KAAK;EACJ,oBACEL,KAAA,CAAAM,aAAA,CAACL,eAAe,CAACM,QAAQ;IAACC,KAAK,EAAE;MAAE,GAAGN,gBAAgB;MAAE,GAAGG;IAAO;EAAE,GACjED,QACuB,CAAC;AAE/B,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["SkeletorContext","SkeletorDefaults","jsx","_jsx","SkeletorProvider","children","config","Provider","value"],"sourceRoot":"../../../../src","sources":["components/SkeletorProvider/SkeletorProvider.tsx"],"mappings":";;AAEA,SAASA,eAAe,EAAEC,gBAAgB,QAAQ,sBAAmB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAItE;AACA;AACA,OAAO,MAAMC,gBAAoD,GAAGA,CAAC;EACnEC,QAAQ;EACR,GAAGC;AACL,CAAC,KAAK;EACJ,oBACEH,IAAA,CAACH,eAAe,CAACO,QAAQ;IAACC,KAAK,EAAE;MAAE,GAAGP,gBAAgB;MAAE,GAAGK;IAAO,CAAE;IAAAD,QAAA,EACjEA;EAAQ,CACe,CAAC;AAE/B,CAAC","ignoreList":[]}
@@ -1,3 +1,5 @@
1
- export * from "./SkeletorContext";
2
- export * from "./SkeletorProvider";
1
+ "use strict";
2
+
3
+ export * from "./SkeletorContext.js";
4
+ export * from "./SkeletorProvider.js";
3
5
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":[],"sourceRoot":"../../src","sources":["index.ts"],"mappings":"AAAA,cAAc,mBAAmB;AACjC,cAAc,oBAAoB","ignoreList":[]}
1
+ {"version":3,"names":[],"sourceRoot":"../../../../src","sources":["components/SkeletorProvider/index.ts"],"mappings":";;AAAA,cAAc,sBAAmB;AACjC,cAAc,uBAAoB","ignoreList":[]}
@@ -1,8 +1,10 @@
1
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
1
+ "use strict";
2
+
2
3
  import React, { useMemo } from "react";
3
4
  import { Animated, StyleSheet } from "react-native";
4
- import { useSkeletor } from "../../hooks";
5
- import { extractAnimationProperties, extractFlexProperties, extractGapProperties, extractPositionProperties, extractSizeProperties } from "../../utils";
5
+ import { useSkeletor } from "../../hooks/index.js";
6
+ import { extractAnimationProperties, extractFlexProperties, extractGapProperties, extractPositionProperties, extractSizeProperties, normalizeMarginValues, normalizePaddingValues } from "../../utils/index.js";
7
+ import { jsx as _jsx } from "react/jsx-runtime";
6
8
  /** Create a Font.d.ts type in your typescript types directory and define fonts as follows:
7
9
  * @example type Font = "Helvetica" | "Montserrat" ... */
8
10
  export const Text = ({
@@ -19,48 +21,47 @@ export const Text = ({
19
21
  paddings,
20
22
  animations,
21
23
  gap,
24
+ allowFontScaling,
25
+ maxFontSizeMultiplier,
22
26
  ...props
23
27
  }) => {
24
- const {
25
- defaultFont,
26
- defaultFontSize,
27
- defaultTextColor
28
- } = useSkeletor();
28
+ const skeletor = useSkeletor();
29
29
  const animationProps = useMemo(() => extractAnimationProperties(animations), [animations]);
30
- const positionProps = extractPositionProperties(props);
31
- const flexProps = extractFlexProperties(props);
32
- const sizeProps = extractSizeProperties(props);
30
+ const positionProps = useMemo(() => extractPositionProperties(props), [props]);
31
+ const flexProps = useMemo(() => extractFlexProperties(props), [props]);
32
+ const sizeProps = useMemo(() => extractSizeProperties(props), [props]);
33
33
  const gapProps = useMemo(() => extractGapProperties({
34
34
  gap
35
35
  }), [gap]);
36
- const textSize = useMemo(() => {
37
- function mapper(value) {
38
- if (Array.isArray(value)) {
39
- const [fontSize, lineHeight] = value;
40
- return {
41
- fontSize,
42
- lineHeight
43
- };
44
- }
45
- return {
46
- fontSize: value,
47
- lineHeight: value
48
- };
49
- }
50
- return mapper(size || defaultFontSize);
51
- }, [size, defaultFontSize]);
52
- const styles = useMemo(() => StyleSheet.flatten([{
53
- color: color || defaultTextColor,
54
- fontFamily: font || defaultFont,
36
+ const normalizedPaddings = useMemo(() => normalizePaddingValues(paddings), [paddings]);
37
+ const normalizedMargins = useMemo(() => normalizeMarginValues(margins), [margins]);
38
+ const textSize = size ?? skeletor.defaultFontSize;
39
+ const {
40
+ fontSize,
41
+ lineHeight
42
+ } = Array.isArray(textSize) ? {
43
+ fontSize: textSize[0],
44
+ lineHeight: textSize[1]
45
+ } : {
46
+ fontSize: textSize,
47
+ lineHeight: textSize
48
+ };
49
+ const styles = StyleSheet.flatten([{
50
+ color: color || skeletor.defaultTextColor,
51
+ fontFamily: font || skeletor.defaultFont,
52
+ fontSize,
53
+ lineHeight,
55
54
  opacity,
56
55
  textAlign,
57
56
  textTransform,
58
57
  letterSpacing
59
- }, textSize, margins, paddings, sizeProps, flexProps, positionProps, gapProps, style]), [color, font, opacity, textAlign, textTransform, textSize, margins, paddings, style, positionProps, sizeProps, flexProps, gapProps, defaultTextColor, defaultFont, letterSpacing]);
60
- return /*#__PURE__*/React.createElement(Animated.Text, _extends({
58
+ }, normalizedMargins, normalizedPaddings, sizeProps, flexProps, positionProps, gapProps, style]);
59
+ return /*#__PURE__*/_jsx(Animated.Text, {
61
60
  style: [styles, animationProps],
62
- allowFontScaling: false,
63
- maxFontSizeMultiplier: 1
64
- }, props), children);
61
+ allowFontScaling: allowFontScaling || skeletor.allowFontScaling,
62
+ maxFontSizeMultiplier: maxFontSizeMultiplier || skeletor.defaultMaxFontSizeMultiplier,
63
+ ...props,
64
+ children: children
65
+ });
65
66
  };
66
67
  //# sourceMappingURL=Text.js.map