pythonnative 0.40.0__cp314-cp314-win_amd64.whl

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 (418) hide show
  1. pythonnative/__init__.py +411 -0
  2. pythonnative/_ios_log.py +92 -0
  3. pythonnative/_yoga.cp314-win_amd64.pyd +0 -0
  4. pythonnative/alerts.py +236 -0
  5. pythonnative/animated.py +1687 -0
  6. pythonnative/animation_graph.py +78 -0
  7. pythonnative/appearance.py +124 -0
  8. pythonnative/bootstrap.py +100 -0
  9. pythonnative/bridge/__init__.py +302 -0
  10. pythonnative/bridge/android.py +78 -0
  11. pythonnative/bridge/codec.py +170 -0
  12. pythonnative/bridge/commits.py +114 -0
  13. pythonnative/bridge/fake.py +243 -0
  14. pythonnative/bridge/ios.py +138 -0
  15. pythonnative/bridge/web.py +489 -0
  16. pythonnative/cli/__init__.py +7 -0
  17. pythonnative/cli/pn.py +1214 -0
  18. pythonnative/component.py +271 -0
  19. pythonnative/components/__init__.py +111 -0
  20. pythonnative/components/_base.py +166 -0
  21. pythonnative/components/controls.py +521 -0
  22. pythonnative/components/layout.py +518 -0
  23. pythonnative/components/lists.py +785 -0
  24. pythonnative/components/media.py +204 -0
  25. pythonnative/components/overlays.py +107 -0
  26. pythonnative/components/pressable.py +252 -0
  27. pythonnative/components/structural.py +167 -0
  28. pythonnative/components/text.py +291 -0
  29. pythonnative/devclient.py +824 -0
  30. pythonnative/devserver/__init__.py +34 -0
  31. pythonnative/devserver/server.py +718 -0
  32. pythonnative/devserver/static/animation_graph.js +82 -0
  33. pythonnative/devserver/static/bridge.js +147 -0
  34. pythonnative/devserver/static/colors.js +70 -0
  35. pythonnative/devserver/static/host.js +552 -0
  36. pythonnative/devserver/static/index.html +60 -0
  37. pythonnative/devserver/static/layout.js +85 -0
  38. pythonnative/devserver/static/preview.css +415 -0
  39. pythonnative/devserver/static/renderer.js +1994 -0
  40. pythonnative/devserver/static/shell.js +345 -0
  41. pythonnative/devserver/static/yoga/LICENSE +21 -0
  42. pythonnative/devserver/static/yoga/binaries/yoga-wasm-base64-esm.js +75 -0
  43. pythonnative/devserver/static/yoga/src/generated/YGEnums.d.ts +189 -0
  44. pythonnative/devserver/static/yoga/src/generated/YGEnums.js +211 -0
  45. pythonnative/devserver/static/yoga/src/generated/YGEnums.js.map +1 -0
  46. pythonnative/devserver/static/yoga/src/index.d.ts +12 -0
  47. pythonnative/devserver/static/yoga/src/index.js +16 -0
  48. pythonnative/devserver/static/yoga/src/index.js.map +1 -0
  49. pythonnative/devserver/static/yoga/src/load.d.ts +11 -0
  50. pythonnative/devserver/static/yoga/src/load.js +17 -0
  51. pythonnative/devserver/static/yoga/src/load.js.map +1 -0
  52. pythonnative/devserver/static/yoga/src/wrapAssembly.d.ts +155 -0
  53. pythonnative/devserver/static/yoga/src/wrapAssembly.js +125 -0
  54. pythonnative/devserver/static/yoga/src/wrapAssembly.js.map +1 -0
  55. pythonnative/devserver/watcher.py +267 -0
  56. pythonnative/devserver/ws.py +421 -0
  57. pythonnative/diagnostics.py +241 -0
  58. pythonnative/element.py +159 -0
  59. pythonnative/equality.py +19 -0
  60. pythonnative/events.py +231 -0
  61. pythonnative/gestures.py +1333 -0
  62. pythonnative/hooks.py +1621 -0
  63. pythonnative/hosts/__init__.py +63 -0
  64. pythonnative/hosts/base.py +596 -0
  65. pythonnative/hosts/native.py +302 -0
  66. pythonnative/hot_reload.py +585 -0
  67. pythonnative/layout.py +328 -0
  68. pythonnative/mutations.py +142 -0
  69. pythonnative/native/android/build.gradle +52 -0
  70. pythonnative/native/android/gradle.properties +3 -0
  71. pythonnative/native/android/settings.gradle +12 -0
  72. pythonnative/native/android/src/main/AndroidManifest.xml +11 -0
  73. pythonnative/native/android/src/main/cpp/CMakeLists.txt +9 -0
  74. pythonnative/native/android/src/main/cpp/yoga_jni.cpp +52 -0
  75. pythonnative/native/android/src/main/java/com/pythonnative/generated/NativeModules.kt +5 -0
  76. pythonnative/native/android/src/main/java/com/pythonnative/generated/NativeProps.kt +3705 -0
  77. pythonnative/native/android/src/main/java/com/pythonnative/generated/PNContracts.kt +129 -0
  78. pythonnative/native/android/src/main/java/com/pythonnative/runtime/PNBridge.kt +261 -0
  79. pythonnative/native/android/src/main/java/com/pythonnative/runtime/PythonHost.kt +20 -0
  80. pythonnative/native/android/src/main/java/com/pythonnative/runtime/animation/AnimationGraph.kt +108 -0
  81. pythonnative/native/android/src/main/java/com/pythonnative/runtime/animation/AnimationSpecs.kt +141 -0
  82. pythonnative/native/android/src/main/java/com/pythonnative/runtime/animation/PNAnimator.kt +257 -0
  83. pythonnative/native/android/src/main/java/com/pythonnative/runtime/bridge/CommitState.kt +106 -0
  84. pythonnative/native/android/src/main/java/com/pythonnative/runtime/bridge/JsonUtil.kt +175 -0
  85. pythonnative/native/android/src/main/java/com/pythonnative/runtime/bridge/MainThread.kt +40 -0
  86. pythonnative/native/android/src/main/java/com/pythonnative/runtime/bridge/PNLog.kt +33 -0
  87. pythonnative/native/android/src/main/java/com/pythonnative/runtime/bridge/PNRegistry.kt +82 -0
  88. pythonnative/native/android/src/main/java/com/pythonnative/runtime/bridge/PNTransaction.kt +80 -0
  89. pythonnative/native/android/src/main/java/com/pythonnative/runtime/bridge/TransactionApplier.kt +117 -0
  90. pythonnative/native/android/src/main/java/com/pythonnative/runtime/bridge/ViewRegistry.kt +74 -0
  91. pythonnative/native/android/src/main/java/com/pythonnative/runtime/components/BuiltinComponents.kt +37 -0
  92. pythonnative/native/android/src/main/java/com/pythonnative/runtime/components/ButtonManager.kt +32 -0
  93. pythonnative/native/android/src/main/java/com/pythonnative/runtime/components/ComponentManager.kt +213 -0
  94. pythonnative/native/android/src/main/java/com/pythonnative/runtime/components/ContainerManagers.kt +69 -0
  95. pythonnative/native/android/src/main/java/com/pythonnative/runtime/components/ControlManagers.kt +186 -0
  96. pythonnative/native/android/src/main/java/com/pythonnative/runtime/components/DatePickerManager.kt +123 -0
  97. pythonnative/native/android/src/main/java/com/pythonnative/runtime/components/ImageLoader.kt +141 -0
  98. pythonnative/native/android/src/main/java/com/pythonnative/runtime/components/ImageManager.kt +162 -0
  99. pythonnative/native/android/src/main/java/com/pythonnative/runtime/components/ModalManager.kt +134 -0
  100. pythonnative/native/android/src/main/java/com/pythonnative/runtime/components/PNColor.kt +201 -0
  101. pythonnative/native/android/src/main/java/com/pythonnative/runtime/components/PickerManager.kt +86 -0
  102. pythonnative/native/android/src/main/java/com/pythonnative/runtime/components/PortalManager.kt +55 -0
  103. pythonnative/native/android/src/main/java/com/pythonnative/runtime/components/PressableManager.kt +122 -0
  104. pythonnative/native/android/src/main/java/com/pythonnative/runtime/components/ScreenStackManager.kt +110 -0
  105. pythonnative/native/android/src/main/java/com/pythonnative/runtime/components/ScrollViewManager.kt +214 -0
  106. pythonnative/native/android/src/main/java/com/pythonnative/runtime/components/SegmentedControlManager.kt +113 -0
  107. pythonnative/native/android/src/main/java/com/pythonnative/runtime/components/StatusBarManager.kt +52 -0
  108. pythonnative/native/android/src/main/java/com/pythonnative/runtime/components/TabBarManager.kt +131 -0
  109. pythonnative/native/android/src/main/java/com/pythonnative/runtime/components/TextInputManager.kt +250 -0
  110. pythonnative/native/android/src/main/java/com/pythonnative/runtime/components/TextManager.kt +233 -0
  111. pythonnative/native/android/src/main/java/com/pythonnative/runtime/components/ViewStyler.kt +355 -0
  112. pythonnative/native/android/src/main/java/com/pythonnative/runtime/components/VirtualListManager.kt +159 -0
  113. pythonnative/native/android/src/main/java/com/pythonnative/runtime/components/WebViewManager.kt +149 -0
  114. pythonnative/native/android/src/main/java/com/pythonnative/runtime/gestures/GestureArbiter.kt +233 -0
  115. pythonnative/native/android/src/main/java/com/pythonnative/runtime/gestures/GestureCoordinator.kt +127 -0
  116. pythonnative/native/android/src/main/java/com/pythonnative/runtime/gestures/GestureRecognizers.kt +527 -0
  117. pythonnative/native/android/src/main/java/com/pythonnative/runtime/layout/NativeLayout.kt +145 -0
  118. pythonnative/native/android/src/main/java/com/pythonnative/runtime/layout/YogaNode.kt +29 -0
  119. pythonnative/native/android/src/main/java/com/pythonnative/runtime/modules/BuiltinModules.kt +73 -0
  120. pythonnative/native/android/src/main/java/com/pythonnative/runtime/modules/DeviceModules.kt +316 -0
  121. pythonnative/native/android/src/main/java/com/pythonnative/runtime/modules/HostModule.kt +61 -0
  122. pythonnative/native/android/src/main/java/com/pythonnative/runtime/modules/MediaModules.kt +200 -0
  123. pythonnative/native/android/src/main/java/com/pythonnative/runtime/modules/NativeModule.kt +158 -0
  124. pythonnative/native/android/src/main/java/com/pythonnative/runtime/modules/NotificationsModule.kt +100 -0
  125. pythonnative/native/android/src/main/java/com/pythonnative/runtime/modules/PermissionsModule.kt +99 -0
  126. pythonnative/native/android/src/main/java/com/pythonnative/runtime/modules/StorageModules.kt +89 -0
  127. pythonnative/native/android/src/main/java/com/pythonnative/runtime/modules/SystemModules.kt +178 -0
  128. pythonnative/native/android/src/main/java/com/pythonnative/runtime/plugins/GeneratedPlugins.kt +16 -0
  129. pythonnative/native/android/src/main/java/com/pythonnative/runtime/screens/PNScreenFragment.kt +188 -0
  130. pythonnative/native/android/src/main/java/com/pythonnative/runtime/screens/ScreenRegistry.kt +80 -0
  131. pythonnative/native/android/src/main/java/com/pythonnative/runtime/views/PNAccessibilityDelegate.kt +48 -0
  132. pythonnative/native/android/src/main/java/com/pythonnative/runtime/views/PNBorderDrawable.kt +76 -0
  133. pythonnative/native/android/src/main/java/com/pythonnative/runtime/views/PNEditText.kt +18 -0
  134. pythonnative/native/android/src/main/java/com/pythonnative/runtime/views/PNFrameLayout.kt +49 -0
  135. pythonnative/native/android/src/test/java/com/pythonnative/runtime/AnimationSpecsTest.kt +75 -0
  136. pythonnative/native/android/src/test/java/com/pythonnative/runtime/GestureArbiterTest.kt +197 -0
  137. pythonnative/native/android/src/test/java/com/pythonnative/runtime/PNColorTest.kt +47 -0
  138. pythonnative/native/android/src/test/java/com/pythonnative/runtime/PNTransactionTest.kt +78 -0
  139. pythonnative/native/android/src/test/java/com/pythonnative/runtime/PromiseTest.kt +89 -0
  140. pythonnative/native/ios/Package.swift +23 -0
  141. pythonnative/native/ios/Sources/PythonNativeKit/Animation/PNAnimationGraph.swift +199 -0
  142. pythonnative/native/ios/Sources/PythonNativeKit/Animation/PNAnimator.swift +312 -0
  143. pythonnative/native/ios/Sources/PythonNativeKit/Bridge/PNBridge.swift +255 -0
  144. pythonnative/native/ios/Sources/PythonNativeKit/Bridge/PNCommit.swift +104 -0
  145. pythonnative/native/ios/Sources/PythonNativeKit/Bridge/PNRegistry.swift +142 -0
  146. pythonnative/native/ios/Sources/PythonNativeKit/Bridge/PNTransaction.swift +166 -0
  147. pythonnative/native/ios/Sources/PythonNativeKit/Bridge/PNViewRegistry.swift +53 -0
  148. pythonnative/native/ios/Sources/PythonNativeKit/Components/PNButtonManagers.swift +207 -0
  149. pythonnative/native/ios/Sources/PythonNativeKit/Components/PNColor.swift +173 -0
  150. pythonnative/native/ios/Sources/PythonNativeKit/Components/PNComponentManager.swift +183 -0
  151. pythonnative/native/ios/Sources/PythonNativeKit/Components/PNContainerView.swift +56 -0
  152. pythonnative/native/ios/Sources/PythonNativeKit/Components/PNControlManagers.swift +281 -0
  153. pythonnative/native/ios/Sources/PythonNativeKit/Components/PNImageManager.swift +222 -0
  154. pythonnative/native/ios/Sources/PythonNativeKit/Components/PNOverlayManagers.swift +243 -0
  155. pythonnative/native/ios/Sources/PythonNativeKit/Components/PNPressableManager.swift +114 -0
  156. pythonnative/native/ios/Sources/PythonNativeKit/Components/PNScreenStackManager.swift +107 -0
  157. pythonnative/native/ios/Sources/PythonNativeKit/Components/PNScrollViewManager.swift +197 -0
  158. pythonnative/native/ios/Sources/PythonNativeKit/Components/PNTabBarManager.swift +106 -0
  159. pythonnative/native/ios/Sources/PythonNativeKit/Components/PNTextInputManager.swift +297 -0
  160. pythonnative/native/ios/Sources/PythonNativeKit/Components/PNTextManager.swift +230 -0
  161. pythonnative/native/ios/Sources/PythonNativeKit/Components/PNTransform.swift +82 -0
  162. pythonnative/native/ios/Sources/PythonNativeKit/Components/PNViewManager.swift +86 -0
  163. pythonnative/native/ios/Sources/PythonNativeKit/Components/PNViewState.swift +87 -0
  164. pythonnative/native/ios/Sources/PythonNativeKit/Components/PNViewStyler.swift +340 -0
  165. pythonnative/native/ios/Sources/PythonNativeKit/Components/PNVirtualListManager.swift +155 -0
  166. pythonnative/native/ios/Sources/PythonNativeKit/Components/PNWebViewManager.swift +124 -0
  167. pythonnative/native/ios/Sources/PythonNativeKit/Generated/NativeModules.swift +1 -0
  168. pythonnative/native/ios/Sources/PythonNativeKit/Generated/NativeProps.swift +3775 -0
  169. pythonnative/native/ios/Sources/PythonNativeKit/Generated/PNContracts.swift +46 -0
  170. pythonnative/native/ios/Sources/PythonNativeKit/Gestures/PNGestureCoordinator.swift +260 -0
  171. pythonnative/native/ios/Sources/PythonNativeKit/Layout/PNLayout.swift +173 -0
  172. pythonnative/native/ios/Sources/PythonNativeKit/Modules/AlertModule.swift +92 -0
  173. pythonnative/native/ios/Sources/PythonNativeKit/Modules/HostModule.swift +80 -0
  174. pythonnative/native/ios/Sources/PythonNativeKit/Modules/LifecycleModules.swift +174 -0
  175. pythonnative/native/ios/Sources/PythonNativeKit/Modules/MediaModules.swift +177 -0
  176. pythonnative/native/ios/Sources/PythonNativeKit/Modules/PNNativeModule.swift +168 -0
  177. pythonnative/native/ios/Sources/PythonNativeKit/Modules/PermissionModules.swift +266 -0
  178. pythonnative/native/ios/Sources/PythonNativeKit/Modules/SystemModules.swift +251 -0
  179. pythonnative/native/ios/Sources/PythonNativeKit/Plugins/PNPluginRegistration.swift +8 -0
  180. pythonnative/native/ios/Sources/PythonNativeKit/Screens/PNScreenRegistry.swift +46 -0
  181. pythonnative/native/ios/Sources/PythonNativeKit/Screens/PNViewController.swift +237 -0
  182. pythonnative/native/ios/Sources/PythonNativeKit/Support/PNCompat.swift +46 -0
  183. pythonnative/native/ios/Sources/PythonNativeKit/Support/PNJSON.swift +173 -0
  184. pythonnative/native/ios/Sources/PythonNativeKit/Support/PNLog.swift +47 -0
  185. pythonnative/native/ios/Sources/PythonNativeKit/Support/PNWindow.swift +51 -0
  186. pythonnative/native/ios/Tests/PythonNativeKitTests/PNAnimationGraphTests.swift +26 -0
  187. pythonnative/native/ios/Tests/PythonNativeKitTests/PNColorTests.swift +50 -0
  188. pythonnative/native/ios/Tests/PythonNativeKitTests/PNCommitTests.swift +86 -0
  189. pythonnative/native/ios/Tests/PythonNativeKitTests/PNGestureTests.swift +101 -0
  190. pythonnative/native/ios/Tests/PythonNativeKitTests/PNManagerTests.swift +126 -0
  191. pythonnative/native/ios/Tests/PythonNativeKitTests/PNModuleTests.swift +111 -0
  192. pythonnative/native/ios/Tests/PythonNativeKitTests/PNTransactionTests.swift +91 -0
  193. pythonnative/native/yoga/LICENSE +21 -0
  194. pythonnative/native/yoga/Package.swift +9 -0
  195. pythonnative/native/yoga/VENDORED.md +2 -0
  196. pythonnative/native/yoga/include/PNStyle.h +10 -0
  197. pythonnative/native/yoga/include/module.modulemap +5 -0
  198. pythonnative/native/yoga/include/yoga/YGConfig.h +158 -0
  199. pythonnative/native/yoga/include/yoga/YGEnums.h +142 -0
  200. pythonnative/native/yoga/include/yoga/YGMacros.h +99 -0
  201. pythonnative/native/yoga/include/yoga/YGNode.h +304 -0
  202. pythonnative/native/yoga/include/yoga/YGNodeLayout.h +35 -0
  203. pythonnative/native/yoga/include/yoga/YGNodeStyle.h +130 -0
  204. pythonnative/native/yoga/include/yoga/YGPixelGrid.h +29 -0
  205. pythonnative/native/yoga/include/yoga/YGValue.h +84 -0
  206. pythonnative/native/yoga/include/yoga/Yoga.h +21 -0
  207. pythonnative/native/yoga/python.cpp +16 -0
  208. pythonnative/native/yoga/style.cpp +272 -0
  209. pythonnative/native/yoga/yoga/CMakeLists.txt +41 -0
  210. pythonnative/native/yoga/yoga/YGConfig.cpp +92 -0
  211. pythonnative/native/yoga/yoga/YGConfig.h +158 -0
  212. pythonnative/native/yoga/yoga/YGEnums.cpp +262 -0
  213. pythonnative/native/yoga/yoga/YGEnums.h +142 -0
  214. pythonnative/native/yoga/yoga/YGMacros.h +99 -0
  215. pythonnative/native/yoga/yoga/YGNode.cpp +366 -0
  216. pythonnative/native/yoga/yoga/YGNode.h +304 -0
  217. pythonnative/native/yoga/yoga/YGNodeLayout.cpp +92 -0
  218. pythonnative/native/yoga/yoga/YGNodeLayout.h +35 -0
  219. pythonnative/native/yoga/yoga/YGNodeStyle.cpp +405 -0
  220. pythonnative/native/yoga/yoga/YGNodeStyle.h +130 -0
  221. pythonnative/native/yoga/yoga/YGPixelGrid.cpp +22 -0
  222. pythonnative/native/yoga/yoga/YGPixelGrid.h +29 -0
  223. pythonnative/native/yoga/yoga/YGValue.cpp +20 -0
  224. pythonnative/native/yoga/yoga/YGValue.h +84 -0
  225. pythonnative/native/yoga/yoga/Yoga.h +21 -0
  226. pythonnative/native/yoga/yoga/algorithm/AbsoluteLayout.cpp +563 -0
  227. pythonnative/native/yoga/yoga/algorithm/AbsoluteLayout.h +41 -0
  228. pythonnative/native/yoga/yoga/algorithm/Align.h +72 -0
  229. pythonnative/native/yoga/yoga/algorithm/Baseline.cpp +78 -0
  230. pythonnative/native/yoga/yoga/algorithm/Baseline.h +21 -0
  231. pythonnative/native/yoga/yoga/algorithm/BoundAxis.h +79 -0
  232. pythonnative/native/yoga/yoga/algorithm/Cache.cpp +121 -0
  233. pythonnative/native/yoga/yoga/algorithm/Cache.h +30 -0
  234. pythonnative/native/yoga/yoga/algorithm/CalculateLayout.cpp +2428 -0
  235. pythonnative/native/yoga/yoga/algorithm/CalculateLayout.h +38 -0
  236. pythonnative/native/yoga/yoga/algorithm/FlexDirection.h +120 -0
  237. pythonnative/native/yoga/yoga/algorithm/FlexLine.cpp +124 -0
  238. pythonnative/native/yoga/yoga/algorithm/FlexLine.h +75 -0
  239. pythonnative/native/yoga/yoga/algorithm/PixelGrid.cpp +132 -0
  240. pythonnative/native/yoga/yoga/algorithm/PixelGrid.h +29 -0
  241. pythonnative/native/yoga/yoga/algorithm/SizingMode.h +73 -0
  242. pythonnative/native/yoga/yoga/algorithm/TrailingPosition.h +44 -0
  243. pythonnative/native/yoga/yoga/config/Config.cpp +135 -0
  244. pythonnative/native/yoga/yoga/config/Config.h +92 -0
  245. pythonnative/native/yoga/yoga/debug/AssertFatal.cpp +53 -0
  246. pythonnative/native/yoga/yoga/debug/AssertFatal.h +29 -0
  247. pythonnative/native/yoga/yoga/debug/Log.cpp +107 -0
  248. pythonnative/native/yoga/yoga/debug/Log.h +34 -0
  249. pythonnative/native/yoga/yoga/enums/Align.h +47 -0
  250. pythonnative/native/yoga/yoga/enums/BoxSizing.h +40 -0
  251. pythonnative/native/yoga/yoga/enums/Dimension.h +40 -0
  252. pythonnative/native/yoga/yoga/enums/Direction.h +41 -0
  253. pythonnative/native/yoga/yoga/enums/Display.h +41 -0
  254. pythonnative/native/yoga/yoga/enums/Edge.h +47 -0
  255. pythonnative/native/yoga/yoga/enums/Errata.h +41 -0
  256. pythonnative/native/yoga/yoga/enums/ExperimentalFeature.h +39 -0
  257. pythonnative/native/yoga/yoga/enums/FlexDirection.h +42 -0
  258. pythonnative/native/yoga/yoga/enums/Gutter.h +41 -0
  259. pythonnative/native/yoga/yoga/enums/Justify.h +44 -0
  260. pythonnative/native/yoga/yoga/enums/LogLevel.h +44 -0
  261. pythonnative/native/yoga/yoga/enums/MeasureMode.h +41 -0
  262. pythonnative/native/yoga/yoga/enums/NodeType.h +40 -0
  263. pythonnative/native/yoga/yoga/enums/Overflow.h +41 -0
  264. pythonnative/native/yoga/yoga/enums/PhysicalEdge.h +21 -0
  265. pythonnative/native/yoga/yoga/enums/PositionType.h +41 -0
  266. pythonnative/native/yoga/yoga/enums/Unit.h +42 -0
  267. pythonnative/native/yoga/yoga/enums/Wrap.h +41 -0
  268. pythonnative/native/yoga/yoga/enums/YogaEnums.h +85 -0
  269. pythonnative/native/yoga/yoga/event/event.cpp +87 -0
  270. pythonnative/native/yoga/yoga/event/event.h +130 -0
  271. pythonnative/native/yoga/yoga/module.modulemap +21 -0
  272. pythonnative/native/yoga/yoga/node/CachedMeasurement.h +53 -0
  273. pythonnative/native/yoga/yoga/node/LayoutResults.cpp +48 -0
  274. pythonnative/native/yoga/yoga/node/LayoutResults.h +122 -0
  275. pythonnative/native/yoga/yoga/node/LayoutableChildren.h +148 -0
  276. pythonnative/native/yoga/yoga/node/Node.cpp +443 -0
  277. pythonnative/native/yoga/yoga/node/Node.h +337 -0
  278. pythonnative/native/yoga/yoga/numeric/Comparison.h +81 -0
  279. pythonnative/native/yoga/yoga/numeric/FloatOptional.h +93 -0
  280. pythonnative/native/yoga/yoga/style/SmallValueBuffer.h +133 -0
  281. pythonnative/native/yoga/yoga/style/Style.h +757 -0
  282. pythonnative/native/yoga/yoga/style/StyleLength.h +107 -0
  283. pythonnative/native/yoga/yoga/style/StyleValueHandle.h +98 -0
  284. pythonnative/native/yoga/yoga/style/StyleValuePool.h +127 -0
  285. pythonnative/native_modules/__init__.py +124 -0
  286. pythonnative/native_modules/app_state.py +99 -0
  287. pythonnative/native_modules/battery.py +75 -0
  288. pythonnative/native_modules/biometrics.py +42 -0
  289. pythonnative/native_modules/camera.py +65 -0
  290. pythonnative/native_modules/clipboard.py +46 -0
  291. pythonnative/native_modules/fallback.py +324 -0
  292. pythonnative/native_modules/file_system.py +145 -0
  293. pythonnative/native_modules/haptics.py +75 -0
  294. pythonnative/native_modules/linking.py +123 -0
  295. pythonnative/native_modules/location.py +75 -0
  296. pythonnative/native_modules/net_info.py +112 -0
  297. pythonnative/native_modules/notifications.py +129 -0
  298. pythonnative/native_modules/permissions.py +108 -0
  299. pythonnative/native_modules/registry.py +526 -0
  300. pythonnative/native_modules/secure_store.py +52 -0
  301. pythonnative/native_modules/share.py +51 -0
  302. pythonnative/native_views/__init__.py +375 -0
  303. pythonnative/native_views/base.py +316 -0
  304. pythonnative/native_views/bridge_backend.py +277 -0
  305. pythonnative/navigation/__init__.py +103 -0
  306. pythonnative/navigation/container.py +154 -0
  307. pythonnative/navigation/handle.py +540 -0
  308. pythonnative/navigation/hooks.py +133 -0
  309. pythonnative/navigation/host.py +58 -0
  310. pythonnative/navigation/linking.py +200 -0
  311. pythonnative/navigation/navigators.py +659 -0
  312. pythonnative/navigation/screen.py +149 -0
  313. pythonnative/navigation/state.py +269 -0
  314. pythonnative/net.py +248 -0
  315. pythonnative/platform.py +166 -0
  316. pythonnative/platform_metrics.py +252 -0
  317. pythonnative/preview.py +287 -0
  318. pythonnative/profiling.py +101 -0
  319. pythonnative/project/__init__.py +68 -0
  320. pythonnative/project/android.py +557 -0
  321. pythonnative/project/builder.py +817 -0
  322. pythonnative/project/config.py +773 -0
  323. pythonnative/project/deps.py +719 -0
  324. pythonnative/project/devices.py +304 -0
  325. pythonnative/project/doctor.py +283 -0
  326. pythonnative/project/fingerprint.py +171 -0
  327. pythonnative/project/icons.py +247 -0
  328. pythonnative/project/ios.py +325 -0
  329. pythonnative/project/lockfile.py +100 -0
  330. pythonnative/project/permissions.py +361 -0
  331. pythonnative/project/plugins.py +519 -0
  332. pythonnative/project/runtime_assets.py +183 -0
  333. pythonnative/py.typed +0 -0
  334. pythonnative/query.py +153 -0
  335. pythonnative/reconciler/__init__.py +29 -0
  336. pythonnative/reconciler/boundaries.py +375 -0
  337. pythonnative/reconciler/children.py +88 -0
  338. pythonnative/reconciler/core.py +1165 -0
  339. pythonnative/reconciler/layout_pass.py +393 -0
  340. pythonnative/reconciler/vnode.py +266 -0
  341. pythonnative/refresh.py +55 -0
  342. pythonnative/runtime.py +306 -0
  343. pythonnative/scheduler.py +159 -0
  344. pythonnative/sdk/__init__.py +153 -0
  345. pythonnative/sdk/_components.py +427 -0
  346. pythonnative/sdk/builtins.py +91 -0
  347. pythonnative/sdk/codegen.py +149 -0
  348. pythonnative/sdk/module_codegen.py +184 -0
  349. pythonnative/sdk/schema.py +224 -0
  350. pythonnative/sdk/templates/contracts.kt +46 -0
  351. pythonnative/sdk/templates/contracts.swift +46 -0
  352. pythonnative/storage.py +184 -0
  353. pythonnative/style.py +841 -0
  354. pythonnative/suspense.py +183 -0
  355. pythonnative/templates/android_template/app/build.gradle +75 -0
  356. pythonnative/templates/android_template/app/proguard-rules.pro +21 -0
  357. pythonnative/templates/android_template/app/src/androidTest/java/com/pythonnative/android_template/ExampleInstrumentedTest.kt +24 -0
  358. pythonnative/templates/android_template/app/src/debug/AndroidManifest.xml +7 -0
  359. pythonnative/templates/android_template/app/src/main/AndroidManifest.xml +32 -0
  360. pythonnative/templates/android_template/app/src/main/java/com/pythonnative/android_template/MainActivity.kt +130 -0
  361. pythonnative/templates/android_template/app/src/main/java/com/pythonnative/android_template/ScreenFragment.kt +13 -0
  362. pythonnative/templates/android_template/app/src/main/res/drawable/ic_launcher_background.xml +170 -0
  363. pythonnative/templates/android_template/app/src/main/res/drawable-v24/ic_launcher_foreground.xml +30 -0
  364. pythonnative/templates/android_template/app/src/main/res/layout/activity_main.xml +10 -0
  365. pythonnative/templates/android_template/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml +6 -0
  366. pythonnative/templates/android_template/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml +6 -0
  367. pythonnative/templates/android_template/app/src/main/res/mipmap-hdpi/ic_launcher.webp +0 -0
  368. pythonnative/templates/android_template/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp +0 -0
  369. pythonnative/templates/android_template/app/src/main/res/mipmap-mdpi/ic_launcher.webp +0 -0
  370. pythonnative/templates/android_template/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp +0 -0
  371. pythonnative/templates/android_template/app/src/main/res/mipmap-xhdpi/ic_launcher.webp +0 -0
  372. pythonnative/templates/android_template/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp +0 -0
  373. pythonnative/templates/android_template/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp +0 -0
  374. pythonnative/templates/android_template/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp +0 -0
  375. pythonnative/templates/android_template/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp +0 -0
  376. pythonnative/templates/android_template/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp +0 -0
  377. pythonnative/templates/android_template/app/src/main/res/navigation/nav_graph.xml +22 -0
  378. pythonnative/templates/android_template/app/src/main/res/values/colors.xml +5 -0
  379. pythonnative/templates/android_template/app/src/main/res/values/strings.xml +5 -0
  380. pythonnative/templates/android_template/app/src/main/res/values/themes.xml +9 -0
  381. pythonnative/templates/android_template/app/src/main/res/values-night/themes.xml +7 -0
  382. pythonnative/templates/android_template/app/src/main/res/xml/backup_rules.xml +13 -0
  383. pythonnative/templates/android_template/app/src/main/res/xml/data_extraction_rules.xml +19 -0
  384. pythonnative/templates/android_template/app/src/test/java/com/pythonnative/android_template/ExampleUnitTest.kt +17 -0
  385. pythonnative/templates/android_template/build.gradle +10 -0
  386. pythonnative/templates/android_template/gradle/wrapper/gradle-wrapper.jar +0 -0
  387. pythonnative/templates/android_template/gradle/wrapper/gradle-wrapper.properties +6 -0
  388. pythonnative/templates/android_template/gradle.properties +23 -0
  389. pythonnative/templates/android_template/gradlew +185 -0
  390. pythonnative/templates/android_template/gradlew.bat +89 -0
  391. pythonnative/templates/android_template/settings.gradle +17 -0
  392. pythonnative/templates/ios_template/ios_template/AppDelegate.swift +51 -0
  393. pythonnative/templates/ios_template/ios_template/Assets.xcassets/AccentColor.colorset/Contents.json +11 -0
  394. pythonnative/templates/ios_template/ios_template/Assets.xcassets/AppIcon.appiconset/Contents.json +13 -0
  395. pythonnative/templates/ios_template/ios_template/Assets.xcassets/Contents.json +6 -0
  396. pythonnative/templates/ios_template/ios_template/Base.lproj/LaunchScreen.storyboard +25 -0
  397. pythonnative/templates/ios_template/ios_template/BridgingHeader.h +14 -0
  398. pythonnative/templates/ios_template/ios_template/Info.plist +28 -0
  399. pythonnative/templates/ios_template/ios_template/PythonRuntime.swift +390 -0
  400. pythonnative/templates/ios_template/ios_template/SceneDelegate.swift +61 -0
  401. pythonnative/templates/ios_template/ios_template/ViewController.swift +23 -0
  402. pythonnative/templates/ios_template/ios_template.xcodeproj/project.pbxproj +745 -0
  403. pythonnative/templates/ios_template/ios_template.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  404. pythonnative/templates/ios_template/ios_templateTests/ios_templateTests.swift +36 -0
  405. pythonnative/templates/ios_template/ios_templateUITests/ios_templateUITests.swift +41 -0
  406. pythonnative/templates/ios_template/ios_templateUITests/ios_templateUITestsLaunchTests.swift +32 -0
  407. pythonnative/testing/__init__.py +53 -0
  408. pythonnative/testing/backend.py +276 -0
  409. pythonnative/testing/harness.py +369 -0
  410. pythonnative/utils.py +145 -0
  411. pythonnative-0.40.0.dist-info/DELVEWHEEL +2 -0
  412. pythonnative-0.40.0.dist-info/METADATA +150 -0
  413. pythonnative-0.40.0.dist-info/RECORD +418 -0
  414. pythonnative-0.40.0.dist-info/WHEEL +5 -0
  415. pythonnative-0.40.0.dist-info/entry_points.txt +2 -0
  416. pythonnative-0.40.0.dist-info/licenses/LICENSE +21 -0
  417. pythonnative-0.40.0.dist-info/top_level.txt +1 -0
  418. pythonnative.libs/msvcp140-a4c2229bdc2a2a630acdc095b4d86008.dll +0 -0
@@ -0,0 +1,211 @@
1
+ /**
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+
8
+ // @generated by enums.py
9
+
10
+ export let Align = /*#__PURE__*/function (Align) {
11
+ Align[Align["Auto"] = 0] = "Auto";
12
+ Align[Align["FlexStart"] = 1] = "FlexStart";
13
+ Align[Align["Center"] = 2] = "Center";
14
+ Align[Align["FlexEnd"] = 3] = "FlexEnd";
15
+ Align[Align["Stretch"] = 4] = "Stretch";
16
+ Align[Align["Baseline"] = 5] = "Baseline";
17
+ Align[Align["SpaceBetween"] = 6] = "SpaceBetween";
18
+ Align[Align["SpaceAround"] = 7] = "SpaceAround";
19
+ Align[Align["SpaceEvenly"] = 8] = "SpaceEvenly";
20
+ return Align;
21
+ }({});
22
+ export let BoxSizing = /*#__PURE__*/function (BoxSizing) {
23
+ BoxSizing[BoxSizing["BorderBox"] = 0] = "BorderBox";
24
+ BoxSizing[BoxSizing["ContentBox"] = 1] = "ContentBox";
25
+ return BoxSizing;
26
+ }({});
27
+ export let Dimension = /*#__PURE__*/function (Dimension) {
28
+ Dimension[Dimension["Width"] = 0] = "Width";
29
+ Dimension[Dimension["Height"] = 1] = "Height";
30
+ return Dimension;
31
+ }({});
32
+ export let Direction = /*#__PURE__*/function (Direction) {
33
+ Direction[Direction["Inherit"] = 0] = "Inherit";
34
+ Direction[Direction["LTR"] = 1] = "LTR";
35
+ Direction[Direction["RTL"] = 2] = "RTL";
36
+ return Direction;
37
+ }({});
38
+ export let Display = /*#__PURE__*/function (Display) {
39
+ Display[Display["Flex"] = 0] = "Flex";
40
+ Display[Display["None"] = 1] = "None";
41
+ Display[Display["Contents"] = 2] = "Contents";
42
+ return Display;
43
+ }({});
44
+ export let Edge = /*#__PURE__*/function (Edge) {
45
+ Edge[Edge["Left"] = 0] = "Left";
46
+ Edge[Edge["Top"] = 1] = "Top";
47
+ Edge[Edge["Right"] = 2] = "Right";
48
+ Edge[Edge["Bottom"] = 3] = "Bottom";
49
+ Edge[Edge["Start"] = 4] = "Start";
50
+ Edge[Edge["End"] = 5] = "End";
51
+ Edge[Edge["Horizontal"] = 6] = "Horizontal";
52
+ Edge[Edge["Vertical"] = 7] = "Vertical";
53
+ Edge[Edge["All"] = 8] = "All";
54
+ return Edge;
55
+ }({});
56
+ export let Errata = /*#__PURE__*/function (Errata) {
57
+ Errata[Errata["None"] = 0] = "None";
58
+ Errata[Errata["StretchFlexBasis"] = 1] = "StretchFlexBasis";
59
+ Errata[Errata["AbsolutePositionWithoutInsetsExcludesPadding"] = 2] = "AbsolutePositionWithoutInsetsExcludesPadding";
60
+ Errata[Errata["AbsolutePercentAgainstInnerSize"] = 4] = "AbsolutePercentAgainstInnerSize";
61
+ Errata[Errata["All"] = 2147483647] = "All";
62
+ Errata[Errata["Classic"] = 2147483646] = "Classic";
63
+ return Errata;
64
+ }({});
65
+ export let ExperimentalFeature = /*#__PURE__*/function (ExperimentalFeature) {
66
+ ExperimentalFeature[ExperimentalFeature["WebFlexBasis"] = 0] = "WebFlexBasis";
67
+ return ExperimentalFeature;
68
+ }({});
69
+ export let FlexDirection = /*#__PURE__*/function (FlexDirection) {
70
+ FlexDirection[FlexDirection["Column"] = 0] = "Column";
71
+ FlexDirection[FlexDirection["ColumnReverse"] = 1] = "ColumnReverse";
72
+ FlexDirection[FlexDirection["Row"] = 2] = "Row";
73
+ FlexDirection[FlexDirection["RowReverse"] = 3] = "RowReverse";
74
+ return FlexDirection;
75
+ }({});
76
+ export let Gutter = /*#__PURE__*/function (Gutter) {
77
+ Gutter[Gutter["Column"] = 0] = "Column";
78
+ Gutter[Gutter["Row"] = 1] = "Row";
79
+ Gutter[Gutter["All"] = 2] = "All";
80
+ return Gutter;
81
+ }({});
82
+ export let Justify = /*#__PURE__*/function (Justify) {
83
+ Justify[Justify["FlexStart"] = 0] = "FlexStart";
84
+ Justify[Justify["Center"] = 1] = "Center";
85
+ Justify[Justify["FlexEnd"] = 2] = "FlexEnd";
86
+ Justify[Justify["SpaceBetween"] = 3] = "SpaceBetween";
87
+ Justify[Justify["SpaceAround"] = 4] = "SpaceAround";
88
+ Justify[Justify["SpaceEvenly"] = 5] = "SpaceEvenly";
89
+ return Justify;
90
+ }({});
91
+ export let LogLevel = /*#__PURE__*/function (LogLevel) {
92
+ LogLevel[LogLevel["Error"] = 0] = "Error";
93
+ LogLevel[LogLevel["Warn"] = 1] = "Warn";
94
+ LogLevel[LogLevel["Info"] = 2] = "Info";
95
+ LogLevel[LogLevel["Debug"] = 3] = "Debug";
96
+ LogLevel[LogLevel["Verbose"] = 4] = "Verbose";
97
+ LogLevel[LogLevel["Fatal"] = 5] = "Fatal";
98
+ return LogLevel;
99
+ }({});
100
+ export let MeasureMode = /*#__PURE__*/function (MeasureMode) {
101
+ MeasureMode[MeasureMode["Undefined"] = 0] = "Undefined";
102
+ MeasureMode[MeasureMode["Exactly"] = 1] = "Exactly";
103
+ MeasureMode[MeasureMode["AtMost"] = 2] = "AtMost";
104
+ return MeasureMode;
105
+ }({});
106
+ export let NodeType = /*#__PURE__*/function (NodeType) {
107
+ NodeType[NodeType["Default"] = 0] = "Default";
108
+ NodeType[NodeType["Text"] = 1] = "Text";
109
+ return NodeType;
110
+ }({});
111
+ export let Overflow = /*#__PURE__*/function (Overflow) {
112
+ Overflow[Overflow["Visible"] = 0] = "Visible";
113
+ Overflow[Overflow["Hidden"] = 1] = "Hidden";
114
+ Overflow[Overflow["Scroll"] = 2] = "Scroll";
115
+ return Overflow;
116
+ }({});
117
+ export let PositionType = /*#__PURE__*/function (PositionType) {
118
+ PositionType[PositionType["Static"] = 0] = "Static";
119
+ PositionType[PositionType["Relative"] = 1] = "Relative";
120
+ PositionType[PositionType["Absolute"] = 2] = "Absolute";
121
+ return PositionType;
122
+ }({});
123
+ export let Unit = /*#__PURE__*/function (Unit) {
124
+ Unit[Unit["Undefined"] = 0] = "Undefined";
125
+ Unit[Unit["Point"] = 1] = "Point";
126
+ Unit[Unit["Percent"] = 2] = "Percent";
127
+ Unit[Unit["Auto"] = 3] = "Auto";
128
+ return Unit;
129
+ }({});
130
+ export let Wrap = /*#__PURE__*/function (Wrap) {
131
+ Wrap[Wrap["NoWrap"] = 0] = "NoWrap";
132
+ Wrap[Wrap["Wrap"] = 1] = "Wrap";
133
+ Wrap[Wrap["WrapReverse"] = 2] = "WrapReverse";
134
+ return Wrap;
135
+ }({});
136
+ const constants = {
137
+ ALIGN_AUTO: Align.Auto,
138
+ ALIGN_FLEX_START: Align.FlexStart,
139
+ ALIGN_CENTER: Align.Center,
140
+ ALIGN_FLEX_END: Align.FlexEnd,
141
+ ALIGN_STRETCH: Align.Stretch,
142
+ ALIGN_BASELINE: Align.Baseline,
143
+ ALIGN_SPACE_BETWEEN: Align.SpaceBetween,
144
+ ALIGN_SPACE_AROUND: Align.SpaceAround,
145
+ ALIGN_SPACE_EVENLY: Align.SpaceEvenly,
146
+ BOX_SIZING_BORDER_BOX: BoxSizing.BorderBox,
147
+ BOX_SIZING_CONTENT_BOX: BoxSizing.ContentBox,
148
+ DIMENSION_WIDTH: Dimension.Width,
149
+ DIMENSION_HEIGHT: Dimension.Height,
150
+ DIRECTION_INHERIT: Direction.Inherit,
151
+ DIRECTION_LTR: Direction.LTR,
152
+ DIRECTION_RTL: Direction.RTL,
153
+ DISPLAY_FLEX: Display.Flex,
154
+ DISPLAY_NONE: Display.None,
155
+ DISPLAY_CONTENTS: Display.Contents,
156
+ EDGE_LEFT: Edge.Left,
157
+ EDGE_TOP: Edge.Top,
158
+ EDGE_RIGHT: Edge.Right,
159
+ EDGE_BOTTOM: Edge.Bottom,
160
+ EDGE_START: Edge.Start,
161
+ EDGE_END: Edge.End,
162
+ EDGE_HORIZONTAL: Edge.Horizontal,
163
+ EDGE_VERTICAL: Edge.Vertical,
164
+ EDGE_ALL: Edge.All,
165
+ ERRATA_NONE: Errata.None,
166
+ ERRATA_STRETCH_FLEX_BASIS: Errata.StretchFlexBasis,
167
+ ERRATA_ABSOLUTE_POSITION_WITHOUT_INSETS_EXCLUDES_PADDING: Errata.AbsolutePositionWithoutInsetsExcludesPadding,
168
+ ERRATA_ABSOLUTE_PERCENT_AGAINST_INNER_SIZE: Errata.AbsolutePercentAgainstInnerSize,
169
+ ERRATA_ALL: Errata.All,
170
+ ERRATA_CLASSIC: Errata.Classic,
171
+ EXPERIMENTAL_FEATURE_WEB_FLEX_BASIS: ExperimentalFeature.WebFlexBasis,
172
+ FLEX_DIRECTION_COLUMN: FlexDirection.Column,
173
+ FLEX_DIRECTION_COLUMN_REVERSE: FlexDirection.ColumnReverse,
174
+ FLEX_DIRECTION_ROW: FlexDirection.Row,
175
+ FLEX_DIRECTION_ROW_REVERSE: FlexDirection.RowReverse,
176
+ GUTTER_COLUMN: Gutter.Column,
177
+ GUTTER_ROW: Gutter.Row,
178
+ GUTTER_ALL: Gutter.All,
179
+ JUSTIFY_FLEX_START: Justify.FlexStart,
180
+ JUSTIFY_CENTER: Justify.Center,
181
+ JUSTIFY_FLEX_END: Justify.FlexEnd,
182
+ JUSTIFY_SPACE_BETWEEN: Justify.SpaceBetween,
183
+ JUSTIFY_SPACE_AROUND: Justify.SpaceAround,
184
+ JUSTIFY_SPACE_EVENLY: Justify.SpaceEvenly,
185
+ LOG_LEVEL_ERROR: LogLevel.Error,
186
+ LOG_LEVEL_WARN: LogLevel.Warn,
187
+ LOG_LEVEL_INFO: LogLevel.Info,
188
+ LOG_LEVEL_DEBUG: LogLevel.Debug,
189
+ LOG_LEVEL_VERBOSE: LogLevel.Verbose,
190
+ LOG_LEVEL_FATAL: LogLevel.Fatal,
191
+ MEASURE_MODE_UNDEFINED: MeasureMode.Undefined,
192
+ MEASURE_MODE_EXACTLY: MeasureMode.Exactly,
193
+ MEASURE_MODE_AT_MOST: MeasureMode.AtMost,
194
+ NODE_TYPE_DEFAULT: NodeType.Default,
195
+ NODE_TYPE_TEXT: NodeType.Text,
196
+ OVERFLOW_VISIBLE: Overflow.Visible,
197
+ OVERFLOW_HIDDEN: Overflow.Hidden,
198
+ OVERFLOW_SCROLL: Overflow.Scroll,
199
+ POSITION_TYPE_STATIC: PositionType.Static,
200
+ POSITION_TYPE_RELATIVE: PositionType.Relative,
201
+ POSITION_TYPE_ABSOLUTE: PositionType.Absolute,
202
+ UNIT_UNDEFINED: Unit.Undefined,
203
+ UNIT_POINT: Unit.Point,
204
+ UNIT_PERCENT: Unit.Percent,
205
+ UNIT_AUTO: Unit.Auto,
206
+ WRAP_NO_WRAP: Wrap.NoWrap,
207
+ WRAP_WRAP: Wrap.Wrap,
208
+ WRAP_WRAP_REVERSE: Wrap.WrapReverse
209
+ };
210
+ export default constants;
211
+ //# sourceMappingURL=YGEnums.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"YGEnums.js","names":["Align","BoxSizing","Dimension","Direction","Display","Edge","Errata","ExperimentalFeature","FlexDirection","Gutter","Justify","LogLevel","MeasureMode","NodeType","Overflow","PositionType","Unit","Wrap","constants","ALIGN_AUTO","Auto","ALIGN_FLEX_START","FlexStart","ALIGN_CENTER","Center","ALIGN_FLEX_END","FlexEnd","ALIGN_STRETCH","Stretch","ALIGN_BASELINE","Baseline","ALIGN_SPACE_BETWEEN","SpaceBetween","ALIGN_SPACE_AROUND","SpaceAround","ALIGN_SPACE_EVENLY","SpaceEvenly","BOX_SIZING_BORDER_BOX","BorderBox","BOX_SIZING_CONTENT_BOX","ContentBox","DIMENSION_WIDTH","Width","DIMENSION_HEIGHT","Height","DIRECTION_INHERIT","Inherit","DIRECTION_LTR","LTR","DIRECTION_RTL","RTL","DISPLAY_FLEX","Flex","DISPLAY_NONE","None","DISPLAY_CONTENTS","Contents","EDGE_LEFT","Left","EDGE_TOP","Top","EDGE_RIGHT","Right","EDGE_BOTTOM","Bottom","EDGE_START","Start","EDGE_END","End","EDGE_HORIZONTAL","Horizontal","EDGE_VERTICAL","Vertical","EDGE_ALL","All","ERRATA_NONE","ERRATA_STRETCH_FLEX_BASIS","StretchFlexBasis","ERRATA_ABSOLUTE_POSITION_WITHOUT_INSETS_EXCLUDES_PADDING","AbsolutePositionWithoutInsetsExcludesPadding","ERRATA_ABSOLUTE_PERCENT_AGAINST_INNER_SIZE","AbsolutePercentAgainstInnerSize","ERRATA_ALL","ERRATA_CLASSIC","Classic","EXPERIMENTAL_FEATURE_WEB_FLEX_BASIS","WebFlexBasis","FLEX_DIRECTION_COLUMN","Column","FLEX_DIRECTION_COLUMN_REVERSE","ColumnReverse","FLEX_DIRECTION_ROW","Row","FLEX_DIRECTION_ROW_REVERSE","RowReverse","GUTTER_COLUMN","GUTTER_ROW","GUTTER_ALL","JUSTIFY_FLEX_START","JUSTIFY_CENTER","JUSTIFY_FLEX_END","JUSTIFY_SPACE_BETWEEN","JUSTIFY_SPACE_AROUND","JUSTIFY_SPACE_EVENLY","LOG_LEVEL_ERROR","Error","LOG_LEVEL_WARN","Warn","LOG_LEVEL_INFO","Info","LOG_LEVEL_DEBUG","Debug","LOG_LEVEL_VERBOSE","Verbose","LOG_LEVEL_FATAL","Fatal","MEASURE_MODE_UNDEFINED","Undefined","MEASURE_MODE_EXACTLY","Exactly","MEASURE_MODE_AT_MOST","AtMost","NODE_TYPE_DEFAULT","Default","NODE_TYPE_TEXT","Text","OVERFLOW_VISIBLE","Visible","OVERFLOW_HIDDEN","Hidden","OVERFLOW_SCROLL","Scroll","POSITION_TYPE_STATIC","Static","POSITION_TYPE_RELATIVE","Relative","POSITION_TYPE_ABSOLUTE","Absolute","UNIT_UNDEFINED","UNIT_POINT","Point","UNIT_PERCENT","Percent","UNIT_AUTO","WRAP_NO_WRAP","NoWrap","WRAP_WRAP","WRAP_WRAP_REVERSE","WrapReverse"],"sources":["../../../src/generated/YGEnums.ts"],"sourcesContent":["/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n// @generated by enums.py\n\nexport enum Align {\n Auto = 0,\n FlexStart = 1,\n Center = 2,\n FlexEnd = 3,\n Stretch = 4,\n Baseline = 5,\n SpaceBetween = 6,\n SpaceAround = 7,\n SpaceEvenly = 8,\n}\n\nexport enum BoxSizing {\n BorderBox = 0,\n ContentBox = 1,\n}\n\nexport enum Dimension {\n Width = 0,\n Height = 1,\n}\n\nexport enum Direction {\n Inherit = 0,\n LTR = 1,\n RTL = 2,\n}\n\nexport enum Display {\n Flex = 0,\n None = 1,\n Contents = 2,\n}\n\nexport enum Edge {\n Left = 0,\n Top = 1,\n Right = 2,\n Bottom = 3,\n Start = 4,\n End = 5,\n Horizontal = 6,\n Vertical = 7,\n All = 8,\n}\n\nexport enum Errata {\n None = 0,\n StretchFlexBasis = 1,\n AbsolutePositionWithoutInsetsExcludesPadding = 2,\n AbsolutePercentAgainstInnerSize = 4,\n All = 2147483647,\n Classic = 2147483646,\n}\n\nexport enum ExperimentalFeature {\n WebFlexBasis = 0,\n}\n\nexport enum FlexDirection {\n Column = 0,\n ColumnReverse = 1,\n Row = 2,\n RowReverse = 3,\n}\n\nexport enum Gutter {\n Column = 0,\n Row = 1,\n All = 2,\n}\n\nexport enum Justify {\n FlexStart = 0,\n Center = 1,\n FlexEnd = 2,\n SpaceBetween = 3,\n SpaceAround = 4,\n SpaceEvenly = 5,\n}\n\nexport enum LogLevel {\n Error = 0,\n Warn = 1,\n Info = 2,\n Debug = 3,\n Verbose = 4,\n Fatal = 5,\n}\n\nexport enum MeasureMode {\n Undefined = 0,\n Exactly = 1,\n AtMost = 2,\n}\n\nexport enum NodeType {\n Default = 0,\n Text = 1,\n}\n\nexport enum Overflow {\n Visible = 0,\n Hidden = 1,\n Scroll = 2,\n}\n\nexport enum PositionType {\n Static = 0,\n Relative = 1,\n Absolute = 2,\n}\n\nexport enum Unit {\n Undefined = 0,\n Point = 1,\n Percent = 2,\n Auto = 3,\n}\n\nexport enum Wrap {\n NoWrap = 0,\n Wrap = 1,\n WrapReverse = 2,\n}\n\nconst constants = {\n ALIGN_AUTO: Align.Auto,\n ALIGN_FLEX_START: Align.FlexStart,\n ALIGN_CENTER: Align.Center,\n ALIGN_FLEX_END: Align.FlexEnd,\n ALIGN_STRETCH: Align.Stretch,\n ALIGN_BASELINE: Align.Baseline,\n ALIGN_SPACE_BETWEEN: Align.SpaceBetween,\n ALIGN_SPACE_AROUND: Align.SpaceAround,\n ALIGN_SPACE_EVENLY: Align.SpaceEvenly,\n BOX_SIZING_BORDER_BOX: BoxSizing.BorderBox,\n BOX_SIZING_CONTENT_BOX: BoxSizing.ContentBox,\n DIMENSION_WIDTH: Dimension.Width,\n DIMENSION_HEIGHT: Dimension.Height,\n DIRECTION_INHERIT: Direction.Inherit,\n DIRECTION_LTR: Direction.LTR,\n DIRECTION_RTL: Direction.RTL,\n DISPLAY_FLEX: Display.Flex,\n DISPLAY_NONE: Display.None,\n DISPLAY_CONTENTS: Display.Contents,\n EDGE_LEFT: Edge.Left,\n EDGE_TOP: Edge.Top,\n EDGE_RIGHT: Edge.Right,\n EDGE_BOTTOM: Edge.Bottom,\n EDGE_START: Edge.Start,\n EDGE_END: Edge.End,\n EDGE_HORIZONTAL: Edge.Horizontal,\n EDGE_VERTICAL: Edge.Vertical,\n EDGE_ALL: Edge.All,\n ERRATA_NONE: Errata.None,\n ERRATA_STRETCH_FLEX_BASIS: Errata.StretchFlexBasis,\n ERRATA_ABSOLUTE_POSITION_WITHOUT_INSETS_EXCLUDES_PADDING: Errata.AbsolutePositionWithoutInsetsExcludesPadding,\n ERRATA_ABSOLUTE_PERCENT_AGAINST_INNER_SIZE: Errata.AbsolutePercentAgainstInnerSize,\n ERRATA_ALL: Errata.All,\n ERRATA_CLASSIC: Errata.Classic,\n EXPERIMENTAL_FEATURE_WEB_FLEX_BASIS: ExperimentalFeature.WebFlexBasis,\n FLEX_DIRECTION_COLUMN: FlexDirection.Column,\n FLEX_DIRECTION_COLUMN_REVERSE: FlexDirection.ColumnReverse,\n FLEX_DIRECTION_ROW: FlexDirection.Row,\n FLEX_DIRECTION_ROW_REVERSE: FlexDirection.RowReverse,\n GUTTER_COLUMN: Gutter.Column,\n GUTTER_ROW: Gutter.Row,\n GUTTER_ALL: Gutter.All,\n JUSTIFY_FLEX_START: Justify.FlexStart,\n JUSTIFY_CENTER: Justify.Center,\n JUSTIFY_FLEX_END: Justify.FlexEnd,\n JUSTIFY_SPACE_BETWEEN: Justify.SpaceBetween,\n JUSTIFY_SPACE_AROUND: Justify.SpaceAround,\n JUSTIFY_SPACE_EVENLY: Justify.SpaceEvenly,\n LOG_LEVEL_ERROR: LogLevel.Error,\n LOG_LEVEL_WARN: LogLevel.Warn,\n LOG_LEVEL_INFO: LogLevel.Info,\n LOG_LEVEL_DEBUG: LogLevel.Debug,\n LOG_LEVEL_VERBOSE: LogLevel.Verbose,\n LOG_LEVEL_FATAL: LogLevel.Fatal,\n MEASURE_MODE_UNDEFINED: MeasureMode.Undefined,\n MEASURE_MODE_EXACTLY: MeasureMode.Exactly,\n MEASURE_MODE_AT_MOST: MeasureMode.AtMost,\n NODE_TYPE_DEFAULT: NodeType.Default,\n NODE_TYPE_TEXT: NodeType.Text,\n OVERFLOW_VISIBLE: Overflow.Visible,\n OVERFLOW_HIDDEN: Overflow.Hidden,\n OVERFLOW_SCROLL: Overflow.Scroll,\n POSITION_TYPE_STATIC: PositionType.Static,\n POSITION_TYPE_RELATIVE: PositionType.Relative,\n POSITION_TYPE_ABSOLUTE: PositionType.Absolute,\n UNIT_UNDEFINED: Unit.Undefined,\n UNIT_POINT: Unit.Point,\n UNIT_PERCENT: Unit.Percent,\n UNIT_AUTO: Unit.Auto,\n WRAP_NO_WRAP: Wrap.NoWrap,\n WRAP_WRAP: Wrap.Wrap,\n WRAP_WRAP_REVERSE: Wrap.WrapReverse,\n}\nexport default constants"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA,WAAYA,KAAK,0BAALA,KAAK;EAALA,KAAK,CAALA,KAAK;EAALA,KAAK,CAALA,KAAK;EAALA,KAAK,CAALA,KAAK;EAALA,KAAK,CAALA,KAAK;EAALA,KAAK,CAALA,KAAK;EAALA,KAAK,CAALA,KAAK;EAALA,KAAK,CAALA,KAAK;EAALA,KAAK,CAALA,KAAK;EAALA,KAAK,CAALA,KAAK;EAAA,OAALA,KAAK;AAAA;AAYjB,WAAYC,SAAS,0BAATA,SAAS;EAATA,SAAS,CAATA,SAAS;EAATA,SAAS,CAATA,SAAS;EAAA,OAATA,SAAS;AAAA;AAKrB,WAAYC,SAAS,0BAATA,SAAS;EAATA,SAAS,CAATA,SAAS;EAATA,SAAS,CAATA,SAAS;EAAA,OAATA,SAAS;AAAA;AAKrB,WAAYC,SAAS,0BAATA,SAAS;EAATA,SAAS,CAATA,SAAS;EAATA,SAAS,CAATA,SAAS;EAATA,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H,IAAI;EAC7BC,gBAAgB,EAAEhH,QAAQ,CAACiH,OAAO;EAClCC,eAAe,EAAElH,QAAQ,CAACmH,MAAM;EAChCC,eAAe,EAAEpH,QAAQ,CAACqH,MAAM;EAChCC,oBAAoB,EAAErH,YAAY,CAACsH,MAAM;EACzCC,sBAAsB,EAAEvH,YAAY,CAACwH,QAAQ;EAC7CC,sBAAsB,EAAEzH,YAAY,CAAC0H,QAAQ;EAC7CC,cAAc,EAAE1H,IAAI,CAACqG,SAAS;EAC9BsB,UAAU,EAAE3H,IAAI,CAAC4H,KAAK;EACtBC,YAAY,EAAE7H,IAAI,CAAC8H,OAAO;EAC1BC,SAAS,EAAE/H,IAAI,CAACI,IAAI;EACpB4H,YAAY,EAAE/H,IAAI,CAACgI,MAAM;EACzBC,SAAS,EAAEjI,IAAI,CAACA,IAAI;EACpBkI,iBAAiB,EAAElI,IAAI,CAACmI;AAC1B,CAAC;AACD,eAAelI,SAAS","ignoreList":[]}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ * @format
8
+ */
9
+ export type { Config, DirtiedFunction, MeasureFunction, Node, } from './wrapAssembly.ts';
10
+ declare const Yoga: import("./wrapAssembly.ts").Yoga;
11
+ export default Yoga;
12
+ export * from './generated/YGEnums.ts';
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ * @format
8
+ */
9
+
10
+ // @ts-ignore untyped from Emscripten
11
+ import loadYoga from '../binaries/yoga-wasm-base64-esm.js';
12
+ import wrapAssembly from "./wrapAssembly.js";
13
+ const Yoga = wrapAssembly(await loadYoga());
14
+ export default Yoga;
15
+ export * from "./generated/YGEnums.js";
16
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["loadYoga","wrapAssembly","Yoga"],"sources":["../../src/index.ts"],"sourcesContent":["/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @format\n */\n\n// @ts-ignore untyped from Emscripten\nimport loadYoga from '../binaries/yoga-wasm-base64-esm.js';\nimport wrapAssembly from './wrapAssembly.ts';\n\nexport type {\n Config,\n DirtiedFunction,\n MeasureFunction,\n Node,\n} from './wrapAssembly.ts';\n\nconst Yoga = wrapAssembly(await loadYoga());\nexport default Yoga;\nexport * from './generated/YGEnums.ts';\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,OAAOA,QAAQ,MAAM,qCAAqC;AAC1D,OAAOC,YAAY,MAAM,mBAAmB;AAS5C,MAAMC,IAAI,GAAGD,YAAY,CAAC,MAAMD,QAAQ,CAAC,CAAC,CAAC;AAC3C,eAAeE,IAAI;AACnB,cAAc,wBAAwB","ignoreList":[]}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ * @format
8
+ */
9
+ export type { Config, DirtiedFunction, MeasureFunction, Node, Yoga, } from './wrapAssembly.ts';
10
+ export declare function loadYoga(): Promise<import("./wrapAssembly.ts").Yoga>;
11
+ export * from './generated/YGEnums.ts';
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ * @format
8
+ */
9
+
10
+ // @ts-ignore untyped from Emscripten
11
+ import loadYogaImpl from '../binaries/yoga-wasm-base64-esm.js';
12
+ import wrapAssembly from "./wrapAssembly.js";
13
+ export async function loadYoga() {
14
+ return wrapAssembly(await loadYogaImpl());
15
+ }
16
+ export * from "./generated/YGEnums.js";
17
+ //# sourceMappingURL=load.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"load.js","names":["loadYogaImpl","wrapAssembly","loadYoga"],"sources":["../../src/load.ts"],"sourcesContent":["/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @format\n */\n\n// @ts-ignore untyped from Emscripten\nimport loadYogaImpl from '../binaries/yoga-wasm-base64-esm.js';\nimport wrapAssembly from './wrapAssembly.ts';\n\nexport type {\n Config,\n DirtiedFunction,\n MeasureFunction,\n Node,\n Yoga,\n} from './wrapAssembly.ts';\n\nexport async function loadYoga() {\n return wrapAssembly(await loadYogaImpl());\n}\nexport * from './generated/YGEnums.ts';\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,OAAOA,YAAY,MAAM,qCAAqC;AAC9D,OAAOC,YAAY,MAAM,mBAAmB;AAU5C,OAAO,eAAeC,QAAQA,CAAA,EAAG;EAC/B,OAAOD,YAAY,CAAC,MAAMD,YAAY,CAAC,CAAC,CAAC;AAC3C;AACA,cAAc,wBAAwB","ignoreList":[]}
@@ -0,0 +1,155 @@
1
+ /**
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ * @format
8
+ */
9
+ import { Unit, Direction } from './generated/YGEnums.ts';
10
+ import YGEnums from './generated/YGEnums.ts';
11
+ import type { Align, BoxSizing, Display, Edge, Errata, ExperimentalFeature, FlexDirection, Gutter, Justify, MeasureMode, Overflow, PositionType, Wrap } from './generated/YGEnums.ts';
12
+ type Layout = {
13
+ left: number;
14
+ right: number;
15
+ top: number;
16
+ bottom: number;
17
+ width: number;
18
+ height: number;
19
+ };
20
+ type Size = {
21
+ width: number;
22
+ height: number;
23
+ };
24
+ type Value = {
25
+ unit: Unit;
26
+ value: number;
27
+ };
28
+ export type Config = {
29
+ free(): void;
30
+ isExperimentalFeatureEnabled(feature: ExperimentalFeature): boolean;
31
+ setExperimentalFeatureEnabled(feature: ExperimentalFeature, enabled: boolean): void;
32
+ setPointScaleFactor(factor: number): void;
33
+ getErrata(): Errata;
34
+ setErrata(errata: Errata): void;
35
+ useWebDefaults(): boolean;
36
+ setUseWebDefaults(useWebDefaults: boolean): void;
37
+ };
38
+ export type DirtiedFunction = (node: Node) => void;
39
+ export type MeasureFunction = (width: number, widthMode: MeasureMode, height: number, heightMode: MeasureMode) => Size;
40
+ export type Node = {
41
+ calculateLayout(width: number | 'auto' | undefined, height: number | 'auto' | undefined, direction?: Direction): void;
42
+ copyStyle(node: Node): void;
43
+ free(): void;
44
+ freeRecursive(): void;
45
+ getAlignContent(): Align;
46
+ getAlignItems(): Align;
47
+ getAlignSelf(): Align;
48
+ getAspectRatio(): number;
49
+ getBorder(edge: Edge): number;
50
+ getChild(index: number): Node;
51
+ getChildCount(): number;
52
+ getComputedBorder(edge: Edge): number;
53
+ getComputedBottom(): number;
54
+ getComputedHeight(): number;
55
+ getComputedLayout(): Layout;
56
+ getComputedLeft(): number;
57
+ getComputedMargin(edge: Edge): number;
58
+ getComputedPadding(edge: Edge): number;
59
+ getComputedRight(): number;
60
+ getComputedTop(): number;
61
+ getComputedWidth(): number;
62
+ getDirection(): Direction;
63
+ getDisplay(): Display;
64
+ getFlexBasis(): Value;
65
+ getFlexDirection(): FlexDirection;
66
+ getFlexGrow(): number;
67
+ getFlexShrink(): number;
68
+ getFlexWrap(): Wrap;
69
+ getHeight(): Value;
70
+ getJustifyContent(): Justify;
71
+ getGap(gutter: Gutter): Value;
72
+ getMargin(edge: Edge): Value;
73
+ getMaxHeight(): Value;
74
+ getMaxWidth(): Value;
75
+ getMinHeight(): Value;
76
+ getMinWidth(): Value;
77
+ getOverflow(): Overflow;
78
+ getPadding(edge: Edge): Value;
79
+ getParent(): Node | null;
80
+ getPosition(edge: Edge): Value;
81
+ getPositionType(): PositionType;
82
+ getBoxSizing(): BoxSizing;
83
+ getWidth(): Value;
84
+ insertChild(child: Node, index: number): void;
85
+ isDirty(): boolean;
86
+ isReferenceBaseline(): boolean;
87
+ markDirty(): void;
88
+ hasNewLayout(): boolean;
89
+ markLayoutSeen(): void;
90
+ removeChild(child: Node): void;
91
+ reset(): void;
92
+ setAlignContent(alignContent: Align): void;
93
+ setAlignItems(alignItems: Align): void;
94
+ setAlignSelf(alignSelf: Align): void;
95
+ setAspectRatio(aspectRatio: number | undefined): void;
96
+ setBorder(edge: Edge, borderWidth: number | undefined): void;
97
+ setDirection(direction: Direction): void;
98
+ setDisplay(display: Display): void;
99
+ setFlex(flex: number | undefined): void;
100
+ setFlexBasis(flexBasis: number | 'auto' | `${number}%` | undefined): void;
101
+ setFlexBasisPercent(flexBasis: number | undefined): void;
102
+ setFlexBasisAuto(): void;
103
+ setFlexDirection(flexDirection: FlexDirection): void;
104
+ setFlexGrow(flexGrow: number | undefined): void;
105
+ setFlexShrink(flexShrink: number | undefined): void;
106
+ setFlexWrap(flexWrap: Wrap): void;
107
+ setHeight(height: number | 'auto' | `${number}%` | undefined): void;
108
+ setIsReferenceBaseline(isReferenceBaseline: boolean): void;
109
+ setHeightAuto(): void;
110
+ setHeightPercent(height: number | undefined): void;
111
+ setJustifyContent(justifyContent: Justify): void;
112
+ setGap(gutter: Gutter, gapLength: number | `${number}%` | undefined): Value;
113
+ setGapPercent(gutter: Gutter, gapLength: number | undefined): Value;
114
+ setMargin(edge: Edge, margin: number | 'auto' | `${number}%` | undefined): void;
115
+ setMarginAuto(edge: Edge): void;
116
+ setMarginPercent(edge: Edge, margin: number | undefined): void;
117
+ setMaxHeight(maxHeight: number | `${number}%` | undefined): void;
118
+ setMaxHeightPercent(maxHeight: number | undefined): void;
119
+ setMaxWidth(maxWidth: number | `${number}%` | undefined): void;
120
+ setMaxWidthPercent(maxWidth: number | undefined): void;
121
+ setDirtiedFunc(dirtiedFunc: DirtiedFunction | null): void;
122
+ setMeasureFunc(measureFunc: MeasureFunction | null): void;
123
+ setMinHeight(minHeight: number | `${number}%` | undefined): void;
124
+ setMinHeightPercent(minHeight: number | undefined): void;
125
+ setMinWidth(minWidth: number | `${number}%` | undefined): void;
126
+ setMinWidthPercent(minWidth: number | undefined): void;
127
+ setOverflow(overflow: Overflow): void;
128
+ setPadding(edge: Edge, padding: number | `${number}%` | undefined): void;
129
+ setPaddingPercent(edge: Edge, padding: number | undefined): void;
130
+ setPosition(edge: Edge, position: number | `${number}%` | undefined): void;
131
+ setPositionPercent(edge: Edge, position: number | undefined): void;
132
+ setPositionType(positionType: PositionType): void;
133
+ setPositionAuto(edge: Edge): void;
134
+ setBoxSizing(boxSizing: BoxSizing): void;
135
+ setWidth(width: number | 'auto' | `${number}%` | undefined): void;
136
+ setWidthAuto(): void;
137
+ setWidthPercent(width: number | undefined): void;
138
+ unsetDirtiedFunc(): void;
139
+ unsetMeasureFunc(): void;
140
+ setAlwaysFormsContainingBlock(alwaysFormsContainingBlock: boolean): void;
141
+ };
142
+ export type Yoga = {
143
+ Config: {
144
+ create(): Config;
145
+ destroy(config: Config): void;
146
+ };
147
+ Node: {
148
+ create(config?: Config): Node;
149
+ createDefault(): Node;
150
+ createWithConfig(config: Config): Node;
151
+ destroy(node: Node): void;
152
+ };
153
+ } & typeof YGEnums;
154
+ export default function wrapAssembly(lib: any): Yoga;
155
+ export {};
@@ -0,0 +1,125 @@
1
+ /**
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ * @format
8
+ */
9
+
10
+ // @ts-nocheck
11
+
12
+ import { Unit, Direction } from "./generated/YGEnums.js";
13
+ import YGEnums from "./generated/YGEnums.js";
14
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
15
+ export default function wrapAssembly(lib) {
16
+ function patch(prototype, name, fn) {
17
+ const original = prototype[name];
18
+ prototype[name] = function () {
19
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
20
+ args[_key] = arguments[_key];
21
+ }
22
+ return fn.call(this, original, ...args);
23
+ };
24
+ }
25
+ for (const fnName of ['setPosition', 'setMargin', 'setFlexBasis', 'setWidth', 'setHeight', 'setMinWidth', 'setMinHeight', 'setMaxWidth', 'setMaxHeight', 'setPadding', 'setGap']) {
26
+ const methods = {
27
+ [Unit.Point]: lib.Node.prototype[fnName],
28
+ [Unit.Percent]: lib.Node.prototype[`${fnName}Percent`],
29
+ [Unit.Auto]: lib.Node.prototype[`${fnName}Auto`]
30
+ };
31
+ patch(lib.Node.prototype, fnName, function (original) {
32
+ for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
33
+ args[_key2 - 1] = arguments[_key2];
34
+ }
35
+ // We patch all these functions to add support for the following calls:
36
+ // .setWidth(100) / .setWidth("100%") / .setWidth(.getWidth()) / .setWidth("auto")
37
+
38
+ const value = args.pop();
39
+ let unit, asNumber;
40
+ if (value === 'auto') {
41
+ unit = Unit.Auto;
42
+ asNumber = undefined;
43
+ } else if (typeof value === 'object') {
44
+ unit = value.unit;
45
+ asNumber = value.valueOf();
46
+ } else {
47
+ unit = typeof value === 'string' && value.endsWith('%') ? Unit.Percent : Unit.Point;
48
+ asNumber = parseFloat(value);
49
+ if (value !== undefined && !Number.isNaN(value) && Number.isNaN(asNumber)) {
50
+ throw new Error(`Invalid value ${value} for ${fnName}`);
51
+ }
52
+ }
53
+ if (!methods[unit]) throw new Error(`Failed to execute "${fnName}": Unsupported unit '${value}'`);
54
+ if (asNumber !== undefined) {
55
+ return methods[unit].call(this, ...args, asNumber);
56
+ } else {
57
+ return methods[unit].call(this, ...args);
58
+ }
59
+ });
60
+ }
61
+ function wrapMeasureFunction(measureFunction) {
62
+ return lib.MeasureCallback.implement({
63
+ measure: function () {
64
+ const {
65
+ width,
66
+ height
67
+ } = measureFunction(...arguments);
68
+ return {
69
+ width: width ?? NaN,
70
+ height: height ?? NaN
71
+ };
72
+ }
73
+ });
74
+ }
75
+ patch(lib.Node.prototype, 'setMeasureFunc', function (original, measureFunc) {
76
+ // This patch is just a convenience patch, since it helps write more
77
+ // idiomatic source code (such as .setMeasureFunc(null))
78
+ if (measureFunc) {
79
+ return original.call(this, wrapMeasureFunction(measureFunc));
80
+ } else {
81
+ return this.unsetMeasureFunc();
82
+ }
83
+ });
84
+ function wrapDirtiedFunc(dirtiedFunction) {
85
+ return lib.DirtiedCallback.implement({
86
+ dirtied: dirtiedFunction
87
+ });
88
+ }
89
+ patch(lib.Node.prototype, 'setDirtiedFunc', function (original, dirtiedFunc) {
90
+ original.call(this, wrapDirtiedFunc(dirtiedFunc));
91
+ });
92
+ patch(lib.Config.prototype, 'free', function () {
93
+ // Since we handle the memory allocation ourselves (via lib.Config.create),
94
+ // we also need to handle the deallocation
95
+ lib.Config.destroy(this);
96
+ });
97
+ patch(lib.Node, 'create', (_, config) => {
98
+ // We decide the constructor we want to call depending on the parameters
99
+ return config ? lib.Node.createWithConfig(config) : lib.Node.createDefault();
100
+ });
101
+ patch(lib.Node.prototype, 'free', function () {
102
+ // Since we handle the memory allocation ourselves (via lib.Node.create),
103
+ // we also need to handle the deallocation
104
+ lib.Node.destroy(this);
105
+ });
106
+ patch(lib.Node.prototype, 'freeRecursive', function () {
107
+ for (let t = 0, T = this.getChildCount(); t < T; ++t) {
108
+ this.getChild(0).freeRecursive();
109
+ }
110
+ this.free();
111
+ });
112
+ patch(lib.Node.prototype, 'calculateLayout', function (original) {
113
+ let width = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : NaN;
114
+ let height = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : NaN;
115
+ let direction = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : Direction.LTR;
116
+ // Just a small patch to add support for the function default parameters
117
+ return original.call(this, width, height, direction);
118
+ });
119
+ return {
120
+ Config: lib.Config,
121
+ Node: lib.Node,
122
+ ...YGEnums
123
+ };
124
+ }
125
+ //# sourceMappingURL=wrapAssembly.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wrapAssembly.js","names":["Unit","Direction","YGEnums","wrapAssembly","lib","patch","prototype","name","fn","original","_len","arguments","length","args","Array","_key","call","fnName","methods","Point","Node","Percent","Auto","_len2","_key2","value","pop","unit","asNumber","undefined","valueOf","endsWith","parseFloat","Number","isNaN","Error","wrapMeasureFunction","measureFunction","MeasureCallback","implement","measure","width","height","NaN","measureFunc","unsetMeasureFunc","wrapDirtiedFunc","dirtiedFunction","DirtiedCallback","dirtied","dirtiedFunc","Config","destroy","_","config","createWithConfig","createDefault","t","T","getChildCount","getChild","freeRecursive","free","direction","LTR"],"sources":["../../src/wrapAssembly.ts"],"sourcesContent":["/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @format\n */\n\n// @ts-nocheck\n\nimport {Unit, Direction} from './generated/YGEnums.ts';\nimport YGEnums from './generated/YGEnums.ts';\n\nimport type {\n Align,\n BoxSizing,\n Display,\n Edge,\n Errata,\n ExperimentalFeature,\n FlexDirection,\n Gutter,\n Justify,\n MeasureMode,\n Overflow,\n PositionType,\n Wrap,\n} from './generated/YGEnums.ts';\n\ntype Layout = {\n left: number;\n right: number;\n top: number;\n bottom: number;\n width: number;\n height: number;\n};\n\ntype Size = {\n width: number;\n height: number;\n};\n\ntype Value = {\n unit: Unit;\n value: number;\n};\n\nexport type Config = {\n free(): void;\n isExperimentalFeatureEnabled(feature: ExperimentalFeature): boolean;\n setExperimentalFeatureEnabled(\n feature: ExperimentalFeature,\n enabled: boolean,\n ): void;\n setPointScaleFactor(factor: number): void;\n getErrata(): Errata;\n setErrata(errata: Errata): void;\n useWebDefaults(): boolean;\n setUseWebDefaults(useWebDefaults: boolean): void;\n};\n\nexport type DirtiedFunction = (node: Node) => void;\n\nexport type MeasureFunction = (\n width: number,\n widthMode: MeasureMode,\n height: number,\n heightMode: MeasureMode,\n) => Size;\n\nexport type Node = {\n calculateLayout(\n width: number | 'auto' | undefined,\n height: number | 'auto' | undefined,\n direction?: Direction,\n ): void;\n copyStyle(node: Node): void;\n free(): void;\n freeRecursive(): void;\n getAlignContent(): Align;\n getAlignItems(): Align;\n getAlignSelf(): Align;\n getAspectRatio(): number;\n getBorder(edge: Edge): number;\n getChild(index: number): Node;\n getChildCount(): number;\n getComputedBorder(edge: Edge): number;\n getComputedBottom(): number;\n getComputedHeight(): number;\n getComputedLayout(): Layout;\n getComputedLeft(): number;\n getComputedMargin(edge: Edge): number;\n getComputedPadding(edge: Edge): number;\n getComputedRight(): number;\n getComputedTop(): number;\n getComputedWidth(): number;\n getDirection(): Direction;\n getDisplay(): Display;\n getFlexBasis(): Value;\n getFlexDirection(): FlexDirection;\n getFlexGrow(): number;\n getFlexShrink(): number;\n getFlexWrap(): Wrap;\n getHeight(): Value;\n getJustifyContent(): Justify;\n getGap(gutter: Gutter): Value;\n getMargin(edge: Edge): Value;\n getMaxHeight(): Value;\n getMaxWidth(): Value;\n getMinHeight(): Value;\n getMinWidth(): Value;\n getOverflow(): Overflow;\n getPadding(edge: Edge): Value;\n getParent(): Node | null;\n getPosition(edge: Edge): Value;\n getPositionType(): PositionType;\n getBoxSizing(): BoxSizing;\n getWidth(): Value;\n insertChild(child: Node, index: number): void;\n isDirty(): boolean;\n isReferenceBaseline(): boolean;\n markDirty(): void;\n hasNewLayout(): boolean;\n markLayoutSeen(): void;\n removeChild(child: Node): void;\n reset(): void;\n setAlignContent(alignContent: Align): void;\n setAlignItems(alignItems: Align): void;\n setAlignSelf(alignSelf: Align): void;\n setAspectRatio(aspectRatio: number | undefined): void;\n setBorder(edge: Edge, borderWidth: number | undefined): void;\n setDirection(direction: Direction): void;\n setDisplay(display: Display): void;\n setFlex(flex: number | undefined): void;\n setFlexBasis(flexBasis: number | 'auto' | `${number}%` | undefined): void;\n setFlexBasisPercent(flexBasis: number | undefined): void;\n setFlexBasisAuto(): void;\n setFlexDirection(flexDirection: FlexDirection): void;\n setFlexGrow(flexGrow: number | undefined): void;\n setFlexShrink(flexShrink: number | undefined): void;\n setFlexWrap(flexWrap: Wrap): void;\n setHeight(height: number | 'auto' | `${number}%` | undefined): void;\n setIsReferenceBaseline(isReferenceBaseline: boolean): void;\n setHeightAuto(): void;\n setHeightPercent(height: number | undefined): void;\n setJustifyContent(justifyContent: Justify): void;\n setGap(gutter: Gutter, gapLength: number | `${number}%` | undefined): Value;\n setGapPercent(gutter: Gutter, gapLength: number | undefined): Value;\n setMargin(\n edge: Edge,\n margin: number | 'auto' | `${number}%` | undefined,\n ): void;\n setMarginAuto(edge: Edge): void;\n setMarginPercent(edge: Edge, margin: number | undefined): void;\n setMaxHeight(maxHeight: number | `${number}%` | undefined): void;\n setMaxHeightPercent(maxHeight: number | undefined): void;\n setMaxWidth(maxWidth: number | `${number}%` | undefined): void;\n setMaxWidthPercent(maxWidth: number | undefined): void;\n setDirtiedFunc(dirtiedFunc: DirtiedFunction | null): void;\n setMeasureFunc(measureFunc: MeasureFunction | null): void;\n setMinHeight(minHeight: number | `${number}%` | undefined): void;\n setMinHeightPercent(minHeight: number | undefined): void;\n setMinWidth(minWidth: number | `${number}%` | undefined): void;\n setMinWidthPercent(minWidth: number | undefined): void;\n setOverflow(overflow: Overflow): void;\n setPadding(edge: Edge, padding: number | `${number}%` | undefined): void;\n setPaddingPercent(edge: Edge, padding: number | undefined): void;\n setPosition(edge: Edge, position: number | `${number}%` | undefined): void;\n setPositionPercent(edge: Edge, position: number | undefined): void;\n setPositionType(positionType: PositionType): void;\n setPositionAuto(edge: Edge): void;\n setBoxSizing(boxSizing: BoxSizing): void;\n setWidth(width: number | 'auto' | `${number}%` | undefined): void;\n setWidthAuto(): void;\n setWidthPercent(width: number | undefined): void;\n unsetDirtiedFunc(): void;\n unsetMeasureFunc(): void;\n setAlwaysFormsContainingBlock(alwaysFormsContainingBlock: boolean): void;\n};\n\nexport type Yoga = {\n Config: {\n create(): Config;\n destroy(config: Config): void;\n };\n Node: {\n create(config?: Config): Node;\n createDefault(): Node;\n createWithConfig(config: Config): Node;\n destroy(node: Node): void;\n };\n} & typeof YGEnums;\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport default function wrapAssembly(lib: any): Yoga {\n function patch(prototype, name, fn) {\n const original = prototype[name];\n\n prototype[name] = function (...args) {\n return fn.call(this, original, ...args);\n };\n }\n\n for (const fnName of [\n 'setPosition',\n 'setMargin',\n 'setFlexBasis',\n 'setWidth',\n 'setHeight',\n 'setMinWidth',\n 'setMinHeight',\n 'setMaxWidth',\n 'setMaxHeight',\n 'setPadding',\n 'setGap',\n ]) {\n const methods = {\n [Unit.Point]: lib.Node.prototype[fnName],\n [Unit.Percent]: lib.Node.prototype[`${fnName}Percent`],\n [Unit.Auto]: lib.Node.prototype[`${fnName}Auto`],\n };\n\n patch(lib.Node.prototype, fnName, function (original, ...args) {\n // We patch all these functions to add support for the following calls:\n // .setWidth(100) / .setWidth(\"100%\") / .setWidth(.getWidth()) / .setWidth(\"auto\")\n\n const value = args.pop();\n let unit, asNumber;\n\n if (value === 'auto') {\n unit = Unit.Auto;\n asNumber = undefined;\n } else if (typeof value === 'object') {\n unit = value.unit;\n asNumber = value.valueOf();\n } else {\n unit =\n typeof value === 'string' && value.endsWith('%')\n ? Unit.Percent\n : Unit.Point;\n asNumber = parseFloat(value);\n if (\n value !== undefined &&\n !Number.isNaN(value) &&\n Number.isNaN(asNumber)\n ) {\n throw new Error(`Invalid value ${value} for ${fnName}`);\n }\n }\n\n if (!methods[unit])\n throw new Error(\n `Failed to execute \"${fnName}\": Unsupported unit '${value}'`,\n );\n\n if (asNumber !== undefined) {\n return methods[unit].call(this, ...args, asNumber);\n } else {\n return methods[unit].call(this, ...args);\n }\n });\n }\n\n function wrapMeasureFunction(measureFunction) {\n return lib.MeasureCallback.implement({\n measure: (...args) => {\n const {width, height} = measureFunction(...args);\n return {\n width: width ?? NaN,\n height: height ?? NaN,\n };\n },\n });\n }\n\n patch(lib.Node.prototype, 'setMeasureFunc', function (original, measureFunc) {\n // This patch is just a convenience patch, since it helps write more\n // idiomatic source code (such as .setMeasureFunc(null))\n if (measureFunc) {\n return original.call(this, wrapMeasureFunction(measureFunc));\n } else {\n return this.unsetMeasureFunc();\n }\n });\n\n function wrapDirtiedFunc(dirtiedFunction) {\n return lib.DirtiedCallback.implement({dirtied: dirtiedFunction});\n }\n\n patch(lib.Node.prototype, 'setDirtiedFunc', function (original, dirtiedFunc) {\n original.call(this, wrapDirtiedFunc(dirtiedFunc));\n });\n\n patch(lib.Config.prototype, 'free', function () {\n // Since we handle the memory allocation ourselves (via lib.Config.create),\n // we also need to handle the deallocation\n lib.Config.destroy(this);\n });\n\n patch(lib.Node, 'create', (_, config) => {\n // We decide the constructor we want to call depending on the parameters\n return config\n ? lib.Node.createWithConfig(config)\n : lib.Node.createDefault();\n });\n\n patch(lib.Node.prototype, 'free', function () {\n // Since we handle the memory allocation ourselves (via lib.Node.create),\n // we also need to handle the deallocation\n lib.Node.destroy(this);\n });\n\n patch(lib.Node.prototype, 'freeRecursive', function () {\n for (let t = 0, T = this.getChildCount(); t < T; ++t) {\n this.getChild(0).freeRecursive();\n }\n this.free();\n });\n\n patch(\n lib.Node.prototype,\n 'calculateLayout',\n function (original, width = NaN, height = NaN, direction = Direction.LTR) {\n // Just a small patch to add support for the function default parameters\n return original.call(this, width, height, direction);\n },\n );\n\n return {\n Config: lib.Config,\n Node: lib.Node,\n ...YGEnums,\n };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA,SAAQA,IAAI,EAAEC,SAAS,QAAO,wBAAwB;AACtD,OAAOC,OAAO,MAAM,wBAAwB;AAuL5C;AACA,eAAe,SAASC,YAAYA,CAACC,GAAQ,EAAQ;EACnD,SAASC,KAAKA,CAACC,SAAS,E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