@octane-xplat/ui 0.7.2 → 0.9.0

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 (219) hide show
  1. package/README.md +4 -3
  2. package/dist/native/Button.tsrx.js +1 -1
  3. package/dist/native/CommandPalette.tsrx.js +7 -1
  4. package/dist/native/Grid.tsrx.js +31 -2
  5. package/dist/native/KeyboardAvoiding.mobile.tsrx.js +2 -2
  6. package/dist/native/Markdown.tsrx.js +233 -0
  7. package/dist/native/Overlay.tsrx.js +15 -26
  8. package/dist/native/Pagination.tsrx.js +15 -12
  9. package/dist/native/PinInput.tsrx.js +25 -7
  10. package/dist/native/Popover.tsrx.js +33 -23
  11. package/dist/native/Pressable.tsrx.js +4 -1
  12. package/dist/native/Screen.tsrx.js +1 -1
  13. package/dist/native/SearchInput.tsrx.js +6 -3
  14. package/dist/native/Sheet.tsrx.js +23 -38
  15. package/dist/native/Slider.tsrx.js +23 -14
  16. package/dist/native/Text.tsrx.js +16 -0
  17. package/dist/native/TextArea.tsrx.js +6 -3
  18. package/dist/native/TextInput.tsrx.js +6 -3
  19. package/dist/native/VirtualList.tsrx.js +305 -121
  20. package/dist/native/WebView.tsrx.js +17 -2
  21. package/dist/native/_virtual/_@oxc-project_runtime@0.150.0/helpers/esm/decorate.js +9 -0
  22. package/dist/native/escape-props.js +2 -0
  23. package/dist/native/grid-auto-placement.js +83 -0
  24. package/dist/native/grid-placement.js +20 -0
  25. package/dist/native/index.shared.js +7 -5
  26. package/dist/native/keyboard-inset.mobile.js +5 -5
  27. package/dist/native/navigation-request.js +26 -0
  28. package/dist/native/octane-client-build.json +1 -1
  29. package/dist/native/overlay-lifetime.mobile.js +65 -0
  30. package/dist/native/pan.tsrx.js +16 -2
  31. package/dist/native/route-table.js +90 -10
  32. package/dist/native/route.js +26 -16
  33. package/dist/native/shared.js +7 -5
  34. package/dist/native/sheet-service.js +2 -2
  35. package/dist/native/svg.mobile.js +1 -1
  36. package/dist/native/{tap-to-blur.mobile.js → tap-to-blur.ios.js} +20 -32
  37. package/dist/native/text-focus.js +10 -0
  38. package/dist/native/text-write.js +18 -11
  39. package/dist/native/toast-anchor.tsrx.js +1 -1
  40. package/dist/native/ui.js +7 -6
  41. package/dist/native/useMeasure.tsrx.js +17 -18
  42. package/dist/native/vendor/ui-svg/index.android.js +2 -2
  43. package/dist/native/vendor/ui-svg/index.ios.js +2 -2
  44. package/dist/native/vendor/ui-svg/{index.common.js → src/index.common.js} +1 -1
  45. package/dist/native/virtual-list-cell-pool.js +63 -0
  46. package/dist/web/Button.web.tsrx.js +1 -1
  47. package/dist/web/KeyboardAvoiding.web.tsrx.js +78 -0
  48. package/dist/web/Markdown.tsrx.js +98 -0
  49. package/dist/web/Overlay.web.tsrx.js +81 -32
  50. package/dist/web/PinInput.web.tsrx.js +24 -10
  51. package/dist/web/Pressable.web.tsrx.js +169 -53
  52. package/dist/web/SearchInput.web.tsrx.js +2 -2
  53. package/dist/web/Sheet.web.tsrx.js +20 -7
  54. package/dist/web/TextArea.web.tsrx.js +22 -17
  55. package/dist/web/TextInput.web.tsrx.js +2 -2
  56. package/dist/web/VirtualList.web.tsrx.js +220 -109
  57. package/dist/web/WebView.web.tsrx.js +3 -3
  58. package/dist/web/{index.shared.js → index.shared.web.js} +7 -5
  59. package/dist/web/modal-focus.web.js +95 -0
  60. package/dist/web/navigation-request.js +26 -0
  61. package/dist/web/octane-client-build.json +1 -1
  62. package/dist/web/pan.web.tsrx.js +27 -10
  63. package/dist/web/route-table.js +90 -10
  64. package/dist/web/route.web.js +88 -22
  65. package/dist/web/sheet-service.web.js +8 -0
  66. package/dist/web/theme/colorScheme.web.js +31 -4
  67. package/dist/web/ui.js +8 -6
  68. package/dist/web/virtual-list-cell-pool.js +63 -0
  69. package/package.json +21 -19
  70. package/platforms/android/native-api-usage.json +7 -7
  71. package/src/CommandPalette.tsrx +8 -1
  72. package/src/Grid.tsrx +32 -1
  73. package/src/Icon.macos.tsrx +1 -0
  74. package/src/KeyboardAvoiding.macos.tsrx +7 -1
  75. package/src/KeyboardAvoiding.mobile.tsrx +2 -2
  76. package/src/KeyboardAvoiding.tsrx +15 -0
  77. package/src/KeyboardAvoiding.web.tsrx +15 -0
  78. package/src/Markdown.tsrx +121 -0
  79. package/src/Meter.tsrx +1 -0
  80. package/src/Overlay.tsrx +15 -30
  81. package/src/Overlay.web.tsrx +12 -3
  82. package/src/Pagination.tsrx +6 -4
  83. package/src/PinInput.macos.tsrx +20 -6
  84. package/src/PinInput.mobile.test.ts +107 -0
  85. package/src/PinInput.tsrx +20 -6
  86. package/src/PinInput.web.test.tsrx +42 -0
  87. package/src/PinInput.web.tsrx +20 -6
  88. package/src/Popover.tsrx +36 -22
  89. package/src/Pressable.tsrx +1 -1
  90. package/src/Pressable.web.test.tsrx +36 -0
  91. package/src/Pressable.web.tsrx +37 -6
  92. package/src/RouteHost.macos.tsrx +1 -0
  93. package/src/Screen.tsrx +1 -1
  94. package/src/SearchInput.tsrx +4 -3
  95. package/src/SearchInput.web.tsrx +1 -1
  96. package/src/Sheet.tsrx +21 -42
  97. package/src/Sheet.web.tsrx +9 -1
  98. package/src/Slider.tsrx +13 -11
  99. package/src/Text.tsrx +36 -0
  100. package/src/TextArea.tsrx +6 -5
  101. package/src/TextArea.web.test.tsrx +39 -0
  102. package/src/TextArea.web.tsrx +7 -5
  103. package/src/TextInput.tsrx +6 -6
  104. package/src/TextInput.web.tsrx +1 -1
  105. package/src/VirtualList.macos.tsrx +93 -6
  106. package/src/VirtualList.mobile.test.tsrx +232 -0
  107. package/src/VirtualList.tsrx +285 -81
  108. package/src/VirtualList.web.tsrx +131 -25
  109. package/src/WebView.tsrx +20 -10
  110. package/src/WebView.web.tsrx +3 -0
  111. package/src/android/BottomNavigationView.android.tsrx +1 -0
  112. package/src/android/MaterialDialog.android.tsrx +1 -0
  113. package/src/anim.macos.tsrx +1 -0
  114. package/src/apply-native-modifiers.native.ts +4 -1
  115. package/src/child-array.ts +12 -7
  116. package/src/colorScheme.macos.ts +1 -0
  117. package/src/controls.macos.tsrx +4 -1
  118. package/src/data-driver.mobile.test.ts +120 -0
  119. package/src/data-lifecycle.mobile.test.ts +251 -0
  120. package/src/escape-props.ts +13 -1
  121. package/src/grid-auto-placement.ts +163 -0
  122. package/src/grid-placement.ts +29 -0
  123. package/src/hosted-unsupported.macos.tsrx +1 -0
  124. package/src/index.macos.ts +23 -3
  125. package/src/index.mobile.ts +0 -1
  126. package/src/index.shared.ts +22 -1
  127. package/src/index.shared.web.ts +291 -0
  128. package/src/index.web.ts +1 -1
  129. package/src/input-readiness.web.test.tsrx +82 -0
  130. package/src/ios/UITabBar.ios.tsrx +1 -0
  131. package/src/keyboard-inset.mobile.test.ts +62 -0
  132. package/src/keyboard-inset.mobile.ts +63 -43
  133. package/src/layout-shells.macos.tsrx +1 -5
  134. package/src/macos-extras.macos.tsrx +2 -0
  135. package/src/modal-focus.web.test.tsrx +63 -0
  136. package/src/modal-focus.web.ts +162 -0
  137. package/src/navigation-request.ts +37 -0
  138. package/src/overlay-lifecycle.mobile.test.ts +316 -0
  139. package/src/overlay-lifetime.mobile.ts +107 -0
  140. package/src/pan.mobile.test.tsrx +116 -0
  141. package/src/pan.tsrx +20 -2
  142. package/src/pan.web.tsrx +35 -7
  143. package/src/platformProps.ts +1 -0
  144. package/src/popover.mobile.test.ts +9 -1
  145. package/src/pressable-accessibility.mobile.test.ts +30 -0
  146. package/src/props.ts +163 -3
  147. package/src/refresh.ts +6 -1
  148. package/src/refresh.web.test.ts +77 -77
  149. package/src/route-android.test.ts +162 -0
  150. package/src/route-history.web.test.ts +80 -0
  151. package/src/route-navigation.web.test.ts +173 -0
  152. package/src/route-table.test.ts +188 -9
  153. package/src/route-table.ts +138 -10
  154. package/src/route.macos.ts +56 -13
  155. package/src/route.ts +54 -24
  156. package/src/route.web.ts +141 -24
  157. package/src/sheet-detents.ts +5 -3
  158. package/src/sheet-service.macos.ts +5 -1
  159. package/src/sheet-service.ts +1 -1
  160. package/src/sheet-service.web.ts +8 -0
  161. package/src/sheet-snap.test.ts +23 -23
  162. package/src/sheet-snap.ts +6 -1
  163. package/src/svg.mobile.ts +9 -3
  164. package/src/tap-to-blur.ios.ts +106 -0
  165. package/src/tap-to-blur.mobile.ts +21 -95
  166. package/src/text-focus.ts +12 -0
  167. package/src/text-input.mobile.test.ts +89 -0
  168. package/src/text-write.ts +21 -11
  169. package/src/theme/colorScheme.linux.ts +2 -4
  170. package/src/theme/colorScheme.web.ts +51 -4
  171. package/src/theme/theme-scheme.macos.ts +8 -2
  172. package/src/theme/tokens.css +1740 -1718
  173. package/src/translate.macos.ts +4 -1
  174. package/src/useMeasure.tsrx +20 -21
  175. package/src/virtual-list-cell-pool.test.ts +53 -0
  176. package/src/virtual-list-cell-pool.ts +81 -0
  177. package/src/virtual-list-layout.test.ts +11 -8
  178. package/src/virtual-list-layout.ts +4 -8
  179. package/src/windows.linux.ts +7 -2
  180. package/src/windows.macos.ts +1 -0
  181. package/types/generated/.tsrx-typegen-manifest.json +16 -3
  182. package/types/generated/Grid.d.ts +0 -1
  183. package/types/generated/KeyboardAvoiding.d.ts +3 -0
  184. package/types/generated/KeyboardAvoiding.web.d.ts +2 -0
  185. package/types/generated/Markdown.d.ts +59 -0
  186. package/types/generated/TextArea.d.ts +2 -2
  187. package/types/generated/TextArea.web.d.ts +1 -1
  188. package/types/generated/TextInput.d.ts +2 -3
  189. package/types/generated/VirtualList.d.ts +3 -3
  190. package/types/generated/escape-props.d.ts +4 -0
  191. package/types/generated/grid-auto-placement.d.ts +13 -0
  192. package/types/generated/grid-placement.d.ts +5 -0
  193. package/types/generated/index.mobile.d.ts +0 -1
  194. package/types/generated/index.shared.d.ts +6 -3
  195. package/types/generated/index.shared.web.d.ts +114 -0
  196. package/types/generated/index.web.d.ts +1 -1
  197. package/types/generated/modal-focus.web.d.ts +3 -0
  198. package/types/generated/navigation-request.d.ts +10 -0
  199. package/types/generated/overlay-lifetime.mobile.d.ts +10 -0
  200. package/types/generated/props.d.ts +111 -3
  201. package/types/generated/route-table.d.ts +14 -3
  202. package/types/generated/svg.mobile.d.ts +2 -2
  203. package/types/generated/tap-to-blur.ios.d.ts +13 -0
  204. package/types/generated/tap-to-blur.mobile.d.ts +1 -15
  205. package/types/generated/text-focus.d.ts +3 -0
  206. package/types/generated/text-write.d.ts +3 -1
  207. package/types/generated/theme/colorScheme.web.d.ts +5 -0
  208. package/types/generated/virtual-list-cell-pool.d.ts +18 -0
  209. package/types/index.macos.d.ts +15 -3
  210. /package/src/vendor/ui-svg/{index.android.ts → src/index.android.ts} +0 -0
  211. /package/src/vendor/ui-svg/{index.common.ts → src/index.common.ts} +0 -0
  212. /package/src/vendor/ui-svg/{index.ios.ts → src/index.ios.ts} +0 -0
  213. /package/src/vendor/ui-svg/{index.ts → src/index.ts} +0 -0
  214. /package/src/vendor/ui-svg/{typings → src/typings}/SVGKit.d.ts +0 -0
  215. /package/src/vendor/ui-svg/{typings → src/typings}/android.d.ts +0 -0
  216. /package/src/vendor/ui-svg/{typings → src/typings}/ios.d.ts +0 -0
  217. /package/types/generated/vendor/ui-svg/{index.common.d.ts → src/index.common.d.ts} +0 -0
  218. /package/types/generated/vendor/ui-svg/{index.d.ts → src/index.d.ts} +0 -0
  219. /package/types/generated/vendor/ui-svg/{index.ios.d.ts → src/index.ios.d.ts} +0 -0
@@ -6,9 +6,12 @@ import { Absolute } from "./Absolute.tsrx.js";
6
6
  import { setTranslate } from "./translate.js";
7
7
  import { Spacer } from "./Spacer.tsrx.js";
8
8
  import { Text } from "./Text.tsrx.js";
9
+ import { Screen } from "./Screen.tsrx.js";
10
+ import { ActivityIndicator } from "./ActivityIndicator.tsrx.js";
11
+ import { ScrollView } from "./ScrollView.tsrx.js";
12
+ import { Markdown, MarkdownScreen } from "./Markdown.tsrx.js";
9
13
  import { RichText, RichTextSpan } from "./RichText.tsrx.js";
10
14
  import { Pressable } from "./Pressable.tsrx.js";
11
- import { ActivityIndicator } from "./ActivityIndicator.tsrx.js";
12
15
  import { Button } from "./Button.tsrx.js";
13
16
  import { Collapsible } from "./Collapsible.tsrx.js";
14
17
  import { Accordion } from "./Accordion.tsrx.js";
@@ -58,14 +61,13 @@ import { Meter } from "./Meter.tsrx.js";
58
61
  import { ProgressGroup } from "./ProgressGroup.tsrx.js";
59
62
  import { Link } from "./Link.tsrx.js";
60
63
  import { getStack, registerStack, stackEntries } from "./stacks.js";
61
- import { defineRoutes, deriveRouteManifest, mergeRouteManifests } from "./route-table.js";
64
+ import { defineRoutes, deriveRouteManifest, manifestToJson, mergeRouteManifests } from "./route-table.js";
62
65
  import { addBackInterceptor, addRoutes, canGoBack, currentModalRoute, currentRoute, hrefFor, layoutsForRoute, popRoute, pushDeepLink, pushRoute, redirect, registerRoutes, registerScreens, routeFor, routeStacks, screenFor, useCanGoBack, useModalRoute, useRoute } from "./route.js";
63
66
  import { NavLink } from "./NavLink.tsrx.js";
64
67
  import { TextArea } from "./TextArea.tsrx.js";
65
68
  import { SearchInput } from "./SearchInput.tsrx.js";
66
69
  import { SegmentedControl } from "./SegmentedControl.tsrx.js";
67
70
  import { ScrollBox } from "./ScrollBox.tsrx.js";
68
- import { ScrollView } from "./ScrollView.tsrx.js";
69
71
  import { VirtualList } from "./VirtualList.tsrx.js";
70
72
  import { WebView } from "./WebView.tsrx.js";
71
73
  import { Hoverable } from "./Hoverable.mobile.tsrx.js";
@@ -74,11 +76,11 @@ import { showToast } from "./toast-anchor.tsrx.js";
74
76
  import { useAnimation } from "./anim.tsrx.js";
75
77
  import { styled } from "./styled.tsrx.js";
76
78
  import { openWindow } from "./windows.js";
77
- import { Screen } from "./Screen.tsrx.js";
78
79
  import { Tabs } from "./Tabs.tsrx.js";
79
80
  import { Switch } from "./Switch.tsrx.js";
80
81
  import { useSafeAreaInsets } from "./safeAreaInsets.tsrx.js";
81
82
  import { SafeArea } from "./SafeArea.tsrx.js";
83
+ import { KeyboardAvoiding } from "./KeyboardAvoiding.mobile.tsrx.js";
82
84
  import { Drawer } from "./Drawer.tsrx.js";
83
85
  import { useMeasure } from "./useMeasure.tsrx.js";
84
86
  import { Slider } from "./Slider.tsrx.js";
@@ -90,4 +92,4 @@ import { useStore } from "./use-store.tsrx.js";
90
92
  import { Sheet } from "./Sheet.tsrx.js";
91
93
  import { closeSheet, openSheet } from "./sheet-service.js";
92
94
  import "./index.shared.js";
93
- export { Absolute, Accordion, ActivityIndicator, Alert, Avatar, AvatarGroup, Badge, Banner, Breadcrumb, Button, Card, Checkbox, CheckboxGroup, Chip, Collapsible, View as Column, Combobox, CommandPalette, ContextMenu, Drawer, DropdownMenu, Empty, FieldGroup, FormField, Grid, Heading, Hoverable, Icon, Image, InputMenu, InputNumber, InputRating, InputTags, Kbd, Link, ListItem, Meter, NavLink, NavigationMenu, Overlay, Pagination, PinInput, Popover, Pressable, ProgressGroup, RadioGroup, RichText, RichTextSpan, Row, SafeArea, Screen, ScrollBox, ScrollView, SearchInput, SegmentedControl, Select, SelectMenu, Separator, Sheet, Skeleton, Slider, Spacer, Stack, Stepper, Switch, Table, Tabs, Text, TextArea, TextInput, Timeline, Tooltip, Tree, User, View, VirtualList, WebView, addBackInterceptor, addRoutes, applyThemeClasses, canGoBack, closeSheet, createStore, currentModalRoute, currentRoute, defineRoutes, deriveRouteManifest, getColorScheme, getStack, getThemePreference, getThemeScheme, hrefFor, isNative, layoutsForRoute, mergeRouteManifests, onThemeSchemeChange, openSheet, openWindow, popRoute, pushDeepLink, pushRoute, redirect, registerIcon, registerIcons, registerRoutes, registerScreens, registerStack, routeFor, routeStacks, screenFor, setThemePreference, setTranslate, showToast, stackEntries, styled, themeSchemeClasses, useAnimation, useBackInterceptor, useCanGoBack, useColorScheme, useMeasure, useModalRoute, useRoute, useSafeAreaInsets, useStore, useThemeScheme };
95
+ export { Absolute, Accordion, ActivityIndicator, Alert, Avatar, AvatarGroup, Badge, Banner, Breadcrumb, Button, Card, Checkbox, CheckboxGroup, Chip, Collapsible, View as Column, Combobox, CommandPalette, ContextMenu, Drawer, DropdownMenu, Empty, FieldGroup, FormField, Grid, Heading, Hoverable, Icon, Image, InputMenu, InputNumber, InputRating, InputTags, Kbd, KeyboardAvoiding, Link, ListItem, Markdown, MarkdownScreen, Meter, NavLink, NavigationMenu, Overlay, Pagination, PinInput, Popover, Pressable, ProgressGroup, RadioGroup, RichText, RichTextSpan, Row, SafeArea, Screen, ScrollBox, ScrollView, SearchInput, SegmentedControl, Select, SelectMenu, Separator, Sheet, Skeleton, Slider, Spacer, Stack, Stepper, Switch, Table, Tabs, Text, TextArea, TextInput, Timeline, Tooltip, Tree, User, View, VirtualList, WebView, addBackInterceptor, addRoutes, applyThemeClasses, canGoBack, closeSheet, createStore, currentModalRoute, currentRoute, defineRoutes, deriveRouteManifest, getColorScheme, getStack, getThemePreference, getThemeScheme, hrefFor, isNative, layoutsForRoute, manifestToJson, mergeRouteManifests, onThemeSchemeChange, openSheet, openWindow, popRoute, pushDeepLink, pushRoute, redirect, registerIcon, registerIcons, registerRoutes, registerScreens, registerStack, routeFor, routeStacks, screenFor, setThemePreference, setTranslate, showToast, stackEntries, styled, themeSchemeClasses, useAnimation, useBackInterceptor, useCanGoBack, useColorScheme, useMeasure, useModalRoute, useRoute, useSafeAreaInsets, useStore, useThemeScheme };
@@ -1,6 +1,6 @@
1
- import { applyThemeClasses } from "./theme/theme-scheme.js";
2
1
  import { topRootLayout } from "./root-layout.mobile.js";
3
- import { attachTapToBlur } from "./tap-to-blur.mobile.js";
2
+ import { attachTapToBlur } from "./tap-to-blur.ios.js";
3
+ import { applyThemeClasses } from "./theme/theme-scheme.js";
4
4
  import { attachSheetDetents } from "./sheet-detents.js";
5
5
  import { bindBottomInsetToKeyboard } from "./keyboard-inset.mobile.js";
6
6
  import { createNativeScriptRoot } from "@nativescript-community/octane";
@@ -1,5 +1,5 @@
1
1
  import { registerElement } from "@nativescript-community/octane";
2
- import { SVGView } from "./src/vendor/ui-svg";
2
+ import { SVGView } from "./vendor/ui-svg";
3
3
  //#region src/svg.mobile.ts
4
4
  registerElement("svgview", SVGView);
5
5
  var SVG_DATA_URI = /^data:image\/svg\+xml[;,]/i;
@@ -1,5 +1,5 @@
1
- import { Application } from "@nativescript/core";
2
- //#region src/tap-to-blur.mobile.ts
1
+ import __decorate from "./_virtual/_@oxc-project_runtime@0.150.0/helpers/esm/decorate.js";
2
+ //#region src/tap-to-blur.ios.ts
3
3
  /** Tap-outside-to-blur: iOS keeps a focused UITextField/UITextView as first
4
4
  * responder until something else takes it, so a tap on blank chrome never
5
5
  * dismisses the keyboard on its own.
@@ -11,36 +11,15 @@ import { Application } from "@nativescript/core";
11
11
  * editable text view (otherwise the field would focus-then-blur in the same
12
12
  * tap — recognizers fire on touch-up, after the field's touch-down focus).
13
13
  * Keyboard taps live in a separate UIWindow, so they never reach it.
14
- * `cancelsTouchesInView` stays false so taps still reach buttons.
15
- *
16
- * Android: hides the soft keyboard from the currently focused view when a
17
- * tap lands on the attached container. */
14
+ * `cancelsTouchesInView` stays false so taps still reach buttons. */
18
15
  function attachTapToBlur(view) {
19
16
  const marker = "__xplatTapToBlur";
20
17
  if (!view || view[marker]) return () => {};
21
18
  view[marker] = true;
22
- if (Application.ios) {
23
- iosAttach();
24
- return () => {
25
- view[marker] = false;
26
- iosDetach();
27
- };
28
- }
29
- if (Application.android) {
30
- const handler = (_args) => {
31
- const activity = Application.android.foregroundActivity;
32
- const focused = activity?.currentFocus;
33
- if (!focused) return;
34
- activity.getSystemService(android.content.Context.INPUT_METHOD_SERVICE)?.hideSoftInputFromWindow(focused.getWindowToken(), 0);
35
- };
36
- view.on("tap", handler);
37
- return () => {
38
- view[marker] = false;
39
- view.off("tap", handler);
40
- };
41
- }
19
+ iosAttach();
42
20
  return () => {
43
21
  view[marker] = false;
22
+ iosDetach();
44
23
  };
45
24
  }
46
25
  var iosCount = 0;
@@ -53,25 +32,34 @@ function iosAttach() {
53
32
  const appWin = appWindow();
54
33
  if (!appWin) return;
55
34
  iosWindow = appWin;
56
- const Owner = class extends NSObject {
35
+ let TapToBlurRecognizerTarget = class TapToBlurRecognizerTarget extends NSObject {
36
+ static {
37
+ this.ObjCProtocols = [UIGestureRecognizerDelegate];
38
+ }
57
39
  static {
58
40
  this.ObjCExposedMethods = { tap: {
59
41
  returns: interop.types.void,
60
42
  params: [UITapGestureRecognizer]
61
43
  } };
62
44
  }
63
- tap(recognizer) {
64
- const point = recognizer.locationInView(iosWindow);
65
- let hit = iosWindow.hitTest(point, null);
45
+ gestureRecognizerShouldReceiveTouch(_recognizer, touch) {
46
+ let hit = touch.view;
66
47
  while (hit) {
67
- if (hit instanceof UITextField || hit instanceof UITextView) return;
48
+ const textField = hit.isKindOfClass(UITextField.class());
49
+ const textView = hit.isKindOfClass(UITextView.class());
50
+ if (textField || textView) return false;
68
51
  hit = hit.superview;
69
52
  }
53
+ return true;
54
+ }
55
+ tap(_recognizer) {
70
56
  iosWindow.endEditing(true);
71
57
  }
72
58
  };
73
- iosTarget = Owner.new();
59
+ TapToBlurRecognizerTarget = __decorate([NativeClass], TapToBlurRecognizerTarget);
60
+ iosTarget = TapToBlurRecognizerTarget.new();
74
61
  iosRecognizer = UITapGestureRecognizer.alloc().initWithTargetAction(iosTarget, "tap");
62
+ iosRecognizer.delegate = iosTarget;
75
63
  iosRecognizer.cancelsTouchesInView = false;
76
64
  appWin.addGestureRecognizer(iosRecognizer);
77
65
  }
@@ -0,0 +1,10 @@
1
+ //#region src/text-focus.ts
2
+ /** Dismiss the keyboard and release native editing focus. NativeScript's
3
+ * dismissSoftInput returns void; its return value is not a fallback signal. */
4
+ function blurText(view) {
5
+ if (typeof view.dismissSoftInput === "function") view.dismissSoftInput();
6
+ else view.blur?.();
7
+ view.android?.clearFocus?.();
8
+ }
9
+ //#endregion
10
+ export { blurText };
@@ -1,5 +1,10 @@
1
1
  //#region src/text-write.ts
2
- /** Controlled `text` write for TextInput/TextArea leaves. The driver's
2
+ var writing = /* @__PURE__ */ new WeakSet();
3
+ /** Whether a textChange is the synchronous echo of our controlled write. */
4
+ function isWritingText(view) {
5
+ return writing.has(view);
6
+ }
7
+ /** Controlled `text` write for TextInput/TextArea/SearchInput leaves. The driver's
3
8
  * generic prop path writes view.text verbatim; on Android the EditText
4
9
  * setText resets the cursor to 0 on every controlled write. Park and
5
10
  * restore the selection around the write (clamped to the new length so an
@@ -11,17 +16,19 @@ function writeText(view, value) {
11
16
  const next = value ?? "";
12
17
  if (!view || view.text === next) return;
13
18
  const et = view.android;
14
- if (!et) {
19
+ const start = et?.getSelectionStart?.() ?? -1;
20
+ const end = et?.getSelectionEnd?.() ?? -1;
21
+ const nested = writing.has(view);
22
+ writing.add(view);
23
+ try {
15
24
  view.text = next;
16
- return;
17
- }
18
- const start = et.getSelectionStart?.() ?? -1;
19
- const end = et.getSelectionEnd?.() ?? -1;
20
- view.text = next;
21
- if (start >= 0) {
22
- const len = next.length;
23
- et.setSelection(Math.min(start, len), Math.min(end >= 0 ? end : start, len));
25
+ if (start >= 0) {
26
+ const len = next.length;
27
+ et.setSelection(Math.min(start, len), Math.min(end >= 0 ? end : start, len));
28
+ }
29
+ } finally {
30
+ if (!nested) writing.delete(view);
24
31
  }
25
32
  }
26
33
  //#endregion
27
- export { writeText };
34
+ export { isWritingText, writeText };
@@ -1,5 +1,5 @@
1
- import { applyThemeClasses } from "./theme/theme-scheme.js";
2
1
  import { topRootLayout } from "./root-layout.mobile.js";
2
+ import { applyThemeClasses } from "./theme/theme-scheme.js";
3
3
  import { Popover } from "./Popover.tsrx.js";
4
4
  import { createNativeScriptRoot, defineUniversalComponent, universalChildren, universalComponent, universalIf, universalPlan, universalProps, universalValue } from "@nativescript-community/octane";
5
5
  import { GridLayout, isAndroid, isIOS } from "@nativescript/core";
package/dist/native/ui.js CHANGED
@@ -6,9 +6,12 @@ import { Absolute } from "./Absolute.tsrx.js";
6
6
  import { setTranslate } from "./translate.js";
7
7
  import { Spacer } from "./Spacer.tsrx.js";
8
8
  import { Text } from "./Text.tsrx.js";
9
+ import { Screen } from "./Screen.tsrx.js";
10
+ import { ActivityIndicator } from "./ActivityIndicator.tsrx.js";
11
+ import { ScrollView } from "./ScrollView.tsrx.js";
12
+ import { Markdown, MarkdownScreen } from "./Markdown.tsrx.js";
9
13
  import { RichText, RichTextSpan } from "./RichText.tsrx.js";
10
14
  import { Pressable } from "./Pressable.tsrx.js";
11
- import { ActivityIndicator } from "./ActivityIndicator.tsrx.js";
12
15
  import { Button } from "./Button.tsrx.js";
13
16
  import { Collapsible } from "./Collapsible.tsrx.js";
14
17
  import { Accordion } from "./Accordion.tsrx.js";
@@ -58,14 +61,13 @@ import { Meter } from "./Meter.tsrx.js";
58
61
  import { ProgressGroup } from "./ProgressGroup.tsrx.js";
59
62
  import { Link } from "./Link.tsrx.js";
60
63
  import { getStack, registerStack, stackEntries } from "./stacks.js";
61
- import { defineRoutes, deriveRouteManifest, mergeRouteManifests } from "./route-table.js";
64
+ import { defineRoutes, deriveRouteManifest, manifestToJson, mergeRouteManifests } from "./route-table.js";
62
65
  import { addBackInterceptor, addRoutes, canGoBack, currentModalRoute, currentRoute, hrefFor, layoutsForRoute, popRoute, pushDeepLink, pushRoute, redirect, registerRoutes, registerScreens, routeFor, routeStacks, screenFor, useCanGoBack, useModalRoute, useRoute } from "./route.js";
63
66
  import { NavLink } from "./NavLink.tsrx.js";
64
67
  import { TextArea } from "./TextArea.tsrx.js";
65
68
  import { SearchInput } from "./SearchInput.tsrx.js";
66
69
  import { SegmentedControl } from "./SegmentedControl.tsrx.js";
67
70
  import { ScrollBox } from "./ScrollBox.tsrx.js";
68
- import { ScrollView } from "./ScrollView.tsrx.js";
69
71
  import { VirtualList } from "./VirtualList.tsrx.js";
70
72
  import { WebView } from "./WebView.tsrx.js";
71
73
  import { Hoverable } from "./Hoverable.mobile.tsrx.js";
@@ -74,11 +76,11 @@ import { showToast } from "./toast-anchor.tsrx.js";
74
76
  import { useAnimation } from "./anim.tsrx.js";
75
77
  import { styled } from "./styled.tsrx.js";
76
78
  import { openWindow } from "./windows.js";
77
- import { Screen } from "./Screen.tsrx.js";
78
79
  import { Tabs } from "./Tabs.tsrx.js";
79
80
  import { Switch } from "./Switch.tsrx.js";
80
81
  import { useSafeAreaInsets } from "./safeAreaInsets.tsrx.js";
81
82
  import { SafeArea } from "./SafeArea.tsrx.js";
83
+ import { KeyboardAvoiding } from "./KeyboardAvoiding.mobile.tsrx.js";
82
84
  import { Drawer } from "./Drawer.tsrx.js";
83
85
  import { useMeasure } from "./useMeasure.tsrx.js";
84
86
  import { Slider } from "./Slider.tsrx.js";
@@ -90,6 +92,5 @@ import { useStore } from "./use-store.tsrx.js";
90
92
  import { Sheet } from "./Sheet.tsrx.js";
91
93
  import { closeSheet, openSheet } from "./sheet-service.js";
92
94
  import "./index.shared.js";
93
- import { KeyboardAvoiding } from "./KeyboardAvoiding.mobile.tsrx.js";
94
95
  import "./theme/status-bar-scheme.mobile.js";
95
- export { Absolute, Accordion, ActivityIndicator, Alert, Avatar, AvatarGroup, Badge, Banner, Breadcrumb, Button, Card, Checkbox, CheckboxGroup, Chip, Collapsible, View as Column, Combobox, CommandPalette, ContextMenu, Drawer, DropdownMenu, Empty, FieldGroup, FormField, Grid, Heading, Hoverable, Icon, Image, InputMenu, InputNumber, InputRating, InputTags, Kbd, KeyboardAvoiding, Link, ListItem, Meter, NavLink, NavigationMenu, Overlay, Pagination, PinInput, Popover, Pressable, ProgressGroup, RadioGroup, RichText, RichTextSpan, Row, SafeArea, Screen, ScrollBox, ScrollView, SearchInput, SegmentedControl, Select, SelectMenu, Separator, Sheet, Skeleton, Slider, Spacer, Stack, Stepper, Switch, Table, Tabs, Text, TextArea, TextInput, Timeline, Tooltip, Tree, User, View, VirtualList, WebView, addBackInterceptor, addRoutes, applyThemeClasses, canGoBack, closeSheet, createStore, currentModalRoute, currentRoute, defineRoutes, deriveRouteManifest, getColorScheme, getStack, getThemePreference, getThemeScheme, hrefFor, isNative, layoutsForRoute, mergeRouteManifests, onThemeSchemeChange, openSheet, openWindow, popRoute, pushDeepLink, pushRoute, redirect, registerIcon, registerIcons, registerRoutes, registerScreens, registerStack, routeFor, routeStacks, screenFor, setThemePreference, setTranslate, showToast, stackEntries, styled, themeSchemeClasses, useAnimation, useBackInterceptor, useCanGoBack, useColorScheme, useMeasure, useModalRoute, useRoute, useSafeAreaInsets, useStore, useThemeScheme };
96
+ export { Absolute, Accordion, ActivityIndicator, Alert, Avatar, AvatarGroup, Badge, Banner, Breadcrumb, Button, Card, Checkbox, CheckboxGroup, Chip, Collapsible, View as Column, Combobox, CommandPalette, ContextMenu, Drawer, DropdownMenu, Empty, FieldGroup, FormField, Grid, Heading, Hoverable, Icon, Image, InputMenu, InputNumber, InputRating, InputTags, Kbd, KeyboardAvoiding, Link, ListItem, Markdown, MarkdownScreen, Meter, NavLink, NavigationMenu, Overlay, Pagination, PinInput, Popover, Pressable, ProgressGroup, RadioGroup, RichText, RichTextSpan, Row, SafeArea, Screen, ScrollBox, ScrollView, SearchInput, SegmentedControl, Select, SelectMenu, Separator, Sheet, Skeleton, Slider, Spacer, Stack, Stepper, Switch, Table, Tabs, Text, TextArea, TextInput, Timeline, Tooltip, Tree, User, View, VirtualList, WebView, addBackInterceptor, addRoutes, applyThemeClasses, canGoBack, closeSheet, createStore, currentModalRoute, currentRoute, defineRoutes, deriveRouteManifest, getColorScheme, getStack, getThemePreference, getThemeScheme, hrefFor, isNative, layoutsForRoute, manifestToJson, mergeRouteManifests, onThemeSchemeChange, openSheet, openWindow, popRoute, pushDeepLink, pushRoute, redirect, registerIcon, registerIcons, registerRoutes, registerScreens, registerStack, routeFor, routeStacks, screenFor, setThemePreference, setTranslate, showToast, stackEntries, styled, themeSchemeClasses, useAnimation, useBackInterceptor, useCanGoBack, useColorScheme, useMeasure, useModalRoute, useRoute, useSafeAreaInsets, useStore, useThemeScheme };
@@ -1,4 +1,4 @@
1
- import { hookSlots, useCallback, useEffect, useState } from "@nativescript-community/octane";
1
+ import { hookSlots, useCallback, useEffect, useRef, useState } from "@nativescript-community/octane";
2
2
  //#region src/useMeasure.tsrx
3
3
  var _hs$ = /* @__PURE__ */ hookSlots(4);
4
4
  var _h$0 = /* @__PURE__ */ Symbol(_hs$);
@@ -17,44 +17,43 @@ function readBounds(view) {
17
17
  };
18
18
  }
19
19
  function useMeasure(options = {}) {
20
- const [view, setView] = useState(null, _h$0);
21
- const [bounds, setBounds] = useState(null, _h$1);
20
+ const [bounds, setBounds] = useState(null, _h$0);
21
+ const detach = useRef(null, _h$1);
22
22
  const observe = options.observe ?? true;
23
- const bind = useCallback((next) => {
24
- setView((current) => current === next ? current : next);
25
- }, [], _h$2);
26
- useEffect(() => {
23
+ const bind = useCallback((view) => {
24
+ detach.current?.();
25
+ detach.current = null;
27
26
  if (!view) {
28
27
  setBounds(null);
29
28
  return;
30
29
  }
31
30
  const update = () => {
32
31
  const next = readBounds(view);
33
- setBounds((prev) => prev && next && prev.x === next.x && prev.y === next.y && prev.width === next.width && prev.height === next.height ? prev : next);
32
+ setBounds((prev) => {
33
+ return prev && next && prev.x === next.x && prev.y === next.y && prev.width === next.width && prev.height === next.height ? prev : next;
34
+ });
34
35
  };
35
- const onLoaded = update;
36
- view.on?.("loaded", onLoaded);
36
+ view.on?.("loaded", update);
37
37
  update();
38
+ const scrollParents = [];
38
39
  if (observe) {
39
40
  view.on?.("layoutChanged", update);
40
41
  let parent = view.parent;
41
42
  while (parent) {
42
43
  parent.on?.("scroll", update);
44
+ scrollParents.push(parent);
43
45
  parent = parent.parent;
44
46
  }
45
47
  }
46
- return () => {
47
- view.off?.("loaded", onLoaded);
48
+ detach.current = () => {
49
+ view.off?.("loaded", update);
48
50
  if (observe) {
49
51
  view.off?.("layoutChanged", update);
50
- let parent = view.parent;
51
- while (parent) {
52
- parent.off?.("scroll", update);
53
- parent = parent.parent;
54
- }
52
+ for (const parent of scrollParents) parent.off?.("scroll", update);
55
53
  }
56
54
  };
57
- }, [view, observe], _h$3);
55
+ }, [observe], _h$2);
56
+ useEffect(() => () => detach.current?.(), [], _h$3);
58
57
  return {
59
58
  bind,
60
59
  bounds
@@ -1,6 +1,6 @@
1
- import { SVGView as SVGView$1, srcProperty } from "./index.common.js";
1
+ import { SVGView as SVGView$1, srcProperty } from "./src/index.common.js";
2
2
  import { File, Font, ImageAsset, ImageSource, Utils, knownFolders, path } from "@nativescript/core";
3
- //#region src/vendor/ui-svg/index.android.ts
3
+ //#region src/vendor/ui-svg/src/index.android.ts
4
4
  function getSVG(src) {
5
5
  if (!src) return null;
6
6
  let imagePath;
@@ -1,6 +1,6 @@
1
- import { SVGView as SVGView$1, srcProperty, stretchProperty } from "./index.common.js";
1
+ import { SVGView as SVGView$1, srcProperty, stretchProperty } from "./src/index.common.js";
2
2
  import { File, ImageAsset, Utils, knownFolders, path } from "@nativescript/core";
3
- //#region src/vendor/ui-svg/index.ios.ts
3
+ //#region src/vendor/ui-svg/src/index.ios.ts
4
4
  function getUIImageScaleType(scaleType) {
5
5
  switch (scaleType) {
6
6
  case "aspectFill": return 2;
@@ -1,5 +1,5 @@
1
1
  import { CSSType, Property, View } from "@nativescript/core";
2
- //#region src/vendor/ui-svg/index.common.ts
2
+ //#region src/vendor/ui-svg/src/index.common.ts
3
3
  var srcProperty = new Property({ name: "src" });
4
4
  var stretchProperty = new Property({ name: "stretch" });
5
5
  var SVGView = class extends View {};
@@ -0,0 +1,63 @@
1
+ //#region src/virtual-list-cell-pool.ts
2
+ /** Reuse physical hosts without retaining an off-window logical row subtree. */
3
+ var VirtualListCellPool = class {
4
+ constructor() {
5
+ this.cells = [];
6
+ this.byId = /* @__PURE__ */ new Map();
7
+ this.nextId = 0;
8
+ }
9
+ update(entries) {
10
+ if (entries.length === 0) {
11
+ this.clear();
12
+ return this.cells;
13
+ }
14
+ const wanted = new Set(entries.map((entry) => entry.rowKey));
15
+ let cells = this.cells.map((cell) => cell.entry && !wanted.has(cell.entry.rowKey) ? {
16
+ ...cell,
17
+ entry: null,
18
+ rows: [],
19
+ generation: cell.generation + 1
20
+ } : cell);
21
+ const retained = new Map(cells.filter((cell) => cell.entry).map((cell) => [cell.entry.rowKey, cell.id]));
22
+ for (const entry of entries) {
23
+ const retainedId = retained.get(entry.rowKey);
24
+ let index = retainedId === void 0 ? cells.findIndex((cell) => !cell.entry && cell.typeKey === entry.typeKey) : cells.findIndex((cell) => cell.id === retainedId);
25
+ if (index === -1) {
26
+ index = cells.length;
27
+ cells.push({
28
+ id: this.nextId++,
29
+ typeKey: entry.typeKey,
30
+ generation: 0,
31
+ entry: null,
32
+ rows: []
33
+ });
34
+ }
35
+ const cell = cells[index];
36
+ if (cell.entry !== entry) cells[index] = {
37
+ ...cell,
38
+ entry,
39
+ rows: [entry],
40
+ generation: cell.generation + 1
41
+ };
42
+ }
43
+ let spare = 0;
44
+ cells = cells.filter((cell) => cell.entry || spare++ < 8);
45
+ cells.sort((a, b) => (a.entry?.index ?? Infinity) - (b.entry?.index ?? Infinity) || a.id - b.id);
46
+ this.cells = cells;
47
+ this.byId = new Map(cells.map((cell) => [cell.id, cell]));
48
+ return cells;
49
+ }
50
+ get(id) {
51
+ return this.byId.get(id);
52
+ }
53
+ isCurrent(id, rowKey, generation) {
54
+ const cell = this.byId.get(id);
55
+ return cell?.entry?.rowKey === rowKey && cell.generation === generation;
56
+ }
57
+ clear() {
58
+ this.cells = [];
59
+ this.byId.clear();
60
+ }
61
+ };
62
+ //#endregion
63
+ export { VirtualListCellPool };
@@ -1,5 +1,5 @@
1
- import { Pressable } from "./Pressable.web.tsrx.js";
2
1
  import { ActivityIndicator } from "./ActivityIndicator.web.tsrx.js";
2
+ import { Pressable } from "./Pressable.web.tsrx.js";
3
3
  import { Fragment, bag4, child, clone, componentSlotVoid, createScopedElement, drainFrag, markChildrenBlock, positionalChildren, template } from "octane";
4
4
  import { createElementFromConfig, textHoleUpdate } from "octane/internal/client";
5
5
  //#region src/Button.web.tsrx
@@ -0,0 +1,78 @@
1
+ import { cx } from "./cx.js";
2
+ import { __s, bag8, clone, snapshotSpread, template } from "octane";
3
+ import { bindSignalChild, bindSignalHostPropSources, enableSignalBindings } from "octane/internal/client";
4
+ //#region src/KeyboardAvoiding.web.tsrx
5
+ enableSignalBindings(1, true);
6
+ var _t$0 = /* @__PURE__ */ template("<div></div>");
7
+ var _rm$1 = [
8
+ "s",
9
+ "f",
10
+ "e"
11
+ ];
12
+ var KeyboardAvoiding = /* @__PURE__ */ __s(function KeyboardAvoiding(props, __s, __extra) {
13
+ let _b = __s.slots[0];
14
+ if (_b === void 0) {
15
+ let _m0, _m1, _m2, _m3, _m4, _m5;
16
+ const _root = clone(_t$0);
17
+ _m0 = props.id;
18
+ _m1 = cx("vx-keyboard-avoiding", props.className);
19
+ _m2 = props.style;
20
+ _m3 = snapshotSpread(props.web);
21
+ _m4 = _root;
22
+ _m5 = bindSignalHostPropSources(__s, void 0, _root, [
23
+ [
24
+ false,
25
+ "id",
26
+ _m0
27
+ ],
28
+ [
29
+ false,
30
+ "className",
31
+ _m1
32
+ ],
33
+ [
34
+ false,
35
+ "style",
36
+ _m2
37
+ ],
38
+ [true, _m3]
39
+ ], "b:1d590fbc", true);
40
+ _b = bag8(__s, _root, _m0, _m1, _m2, _m3, _m4, _m5, null, void 0);
41
+ __s.refFields = _rm$1;
42
+ } else {
43
+ {
44
+ const _v = props.id;
45
+ if (_b.a !== _v) _b.a = _v;
46
+ }
47
+ {
48
+ const _v = cx("vx-keyboard-avoiding", props.className);
49
+ if (_b.b !== _v) _b.b = _v;
50
+ }
51
+ {
52
+ const _v = props.style;
53
+ if (_b.c !== _v) _b.c = _v;
54
+ }
55
+ _b.d = snapshotSpread(props.web);
56
+ _b.f = bindSignalHostPropSources(__s, _b.f, _b.e, [
57
+ [
58
+ false,
59
+ "id",
60
+ _b.a
61
+ ],
62
+ [
63
+ false,
64
+ "className",
65
+ _b.b
66
+ ],
67
+ [
68
+ false,
69
+ "style",
70
+ _b.c
71
+ ],
72
+ [true, _b.d]
73
+ ], "b:1d590fbc", true);
74
+ }
75
+ _b.i = bindSignalChild(__s, _b.i, 1, _b.e, props.children, "b:da0dd4e6", null, void 0, void 0, void 0, true);
76
+ });
77
+ //#endregion
78
+ export { KeyboardAvoiding };
@@ -0,0 +1,98 @@
1
+ import { View } from "./View.web.tsrx.js";
2
+ import { Text } from "./Text.web.tsrx.js";
3
+ import { Screen } from "./Screen.web.tsrx.js";
4
+ import { ScrollView } from "./ScrollView.web.tsrx.js";
5
+ import { bag4, child, clone, componentSlotVoid, createScopedElement, createScopedValue, drainFrag, markChildrenBlock, positionalChildren, template } from "octane";
6
+ import { createElementFromConfig, textHoleUpdate } from "octane/internal/client";
7
+ //#region src/Markdown.tsrx
8
+ var _t$0 = /* @__PURE__ */ template("<!>", 0, 1);
9
+ var __childrenBody = {};
10
+ var __childrenBody$ = {};
11
+ var __childrenBody$2 = {};
12
+ var headingClass = [
13
+ "text-2xl font-bold",
14
+ "text-xl font-semibold",
15
+ "text-lg font-semibold"
16
+ ];
17
+ function Inlines(props) {
18
+ const out = [];
19
+ for (const n of props.nodes ?? []) switch (n.t) {
20
+ case "code":
21
+ out.push(createScopedValue(() => createScopedElement(Text, { style: { fontFamily: "ui-monospace" } }, () => n.text, "c:36e0510a")));
22
+ break;
23
+ case "bold":
24
+ out.push(createScopedElement(Text, { className: "font-bold" }, () => createScopedValue(() => createElementFromConfig("c:a63de03b", Inlines, { nodes: n.children })), "c:a21df08c"));
25
+ break;
26
+ case "em":
27
+ out.push(createScopedValue(() => createScopedElement(Text, { style: { fontStyle: "italic" } }, () => createScopedValue(() => createElementFromConfig("c:85bfa585", Inlines, { nodes: n.children })), "c:8c2aeee1")));
28
+ break;
29
+ case "link":
30
+ out.push(createScopedValue(() => createScopedElement(Text, { style: { textDecorationLine: "underline" } }, () => n.text, "c:68791c66")));
31
+ break;
32
+ default: out.push(n.text);
33
+ }
34
+ return out;
35
+ }
36
+ var Markdown = function Markdown(props, __s, __extra) {
37
+ const __block = __s.block;
38
+ function __children$1(__props, __s, __extra) {
39
+ const __block = __s.block;
40
+ let _b = __s.slots[0];
41
+ if (_b === void 0) {
42
+ let _m0, _m1;
43
+ const _root = clone(_t$0);
44
+ _m0 = __block.parentNode;
45
+ _m1 = child(_root);
46
+ drainFrag(_root, __block.parentNode, __block.endMarker);
47
+ _b = bag4(__s, null, _m0, _m1, null, void 0);
48
+ }
49
+ {
50
+ const _v = (props.data?.children ?? []).map((node) => {
51
+ switch (node.t) {
52
+ case "h": return createScopedElement(Text, { className: headingClass[node.depth - 1] ?? "font-semibold" }, () => createScopedValue(() => createElementFromConfig("c:848cdc8b", Inlines, { nodes: node.children })), "c:c64bb68d");
53
+ case "p": return createScopedElement(Text, {}, () => createScopedValue(() => createElementFromConfig("c:ee68c6f0", Inlines, { nodes: node.children })), "c:79fb1caa");
54
+ case "code": return createScopedElement(Text, {
55
+ className: "text-sm",
56
+ style: { fontFamily: "ui-monospace" }
57
+ }, () => node.text, "c:4a6d02c9");
58
+ case "list": return node.items.map((item, i) => createScopedElement(Text, {}, () => positionalChildren([node.ordered ? `${i + 1}. ` : "• ", createScopedValue(() => createElementFromConfig("c:fda35112", Inlines, { nodes: item }))]), "c:6892e48e"));
59
+ case "quote": return createScopedElement(Text, {
60
+ className: "text-muted",
61
+ style: { fontStyle: "italic" }
62
+ }, () => createScopedValue(() => createElementFromConfig("c:d67a588c", Inlines, { nodes: node.children })), "c:2da3002c");
63
+ case "hr": return createElementFromConfig("c:a5e792d6", View, { style: {
64
+ height: 1,
65
+ backgroundColor: "var(--color-border)"
66
+ } });
67
+ default: return null;
68
+ }
69
+ });
70
+ _b.c = textHoleUpdate(__s, 1, _b.a, _v, _b.c, _b.d, _b.b, true, true);
71
+ _b.d = _v;
72
+ }
73
+ }
74
+ componentSlotVoid(__s, 0, __block.parentNode, View, {
75
+ "className": "gap-3",
76
+ "children": markChildrenBlock(__children$1, __childrenBody)
77
+ }, __block.endMarker, void 0, void 0, true, void 0, "c:866fe269");
78
+ };
79
+ var MarkdownScreen = function MarkdownScreen(props, __s, __extra) {
80
+ const __block = __s.block;
81
+ function __children$4(__props, __s, __extra) {
82
+ const __block = __s.block;
83
+ function __children$6(__props, __s, __extra) {
84
+ const __block = __s.block;
85
+ componentSlotVoid(__s, 0, __block.parentNode, Markdown, { "data": props.data }, __block.endMarker, void 0, void 0, void 0, void 0, "c:35a6792a");
86
+ }
87
+ componentSlotVoid(__s, 0, __block.parentNode, ScrollView, {
88
+ "style": { padding: 16 },
89
+ "children": markChildrenBlock(__children$6, __childrenBody$)
90
+ }, __block.endMarker, void 0, void 0, void 0, void 0, "c:12e138f2");
91
+ }
92
+ componentSlotVoid(__s, 0, __block.parentNode, Screen, {
93
+ "className": "vx-app",
94
+ "children": markChildrenBlock(__children$4, __childrenBody$2)
95
+ }, __block.endMarker, void 0, void 0, true, void 0, "c:d76e208c");
96
+ };
97
+ //#endregion
98
+ export { Markdown, MarkdownScreen };