@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.
- package/README.md +4 -3
- package/dist/native/Button.tsrx.js +1 -1
- package/dist/native/CommandPalette.tsrx.js +7 -1
- package/dist/native/Grid.tsrx.js +31 -2
- package/dist/native/KeyboardAvoiding.mobile.tsrx.js +2 -2
- package/dist/native/Markdown.tsrx.js +233 -0
- package/dist/native/Overlay.tsrx.js +15 -26
- package/dist/native/Pagination.tsrx.js +15 -12
- package/dist/native/PinInput.tsrx.js +25 -7
- package/dist/native/Popover.tsrx.js +33 -23
- package/dist/native/Pressable.tsrx.js +4 -1
- package/dist/native/Screen.tsrx.js +1 -1
- package/dist/native/SearchInput.tsrx.js +6 -3
- package/dist/native/Sheet.tsrx.js +23 -38
- package/dist/native/Slider.tsrx.js +23 -14
- package/dist/native/Text.tsrx.js +16 -0
- package/dist/native/TextArea.tsrx.js +6 -3
- package/dist/native/TextInput.tsrx.js +6 -3
- package/dist/native/VirtualList.tsrx.js +305 -121
- package/dist/native/WebView.tsrx.js +17 -2
- package/dist/native/_virtual/_@oxc-project_runtime@0.150.0/helpers/esm/decorate.js +9 -0
- package/dist/native/escape-props.js +2 -0
- package/dist/native/grid-auto-placement.js +83 -0
- package/dist/native/grid-placement.js +20 -0
- package/dist/native/index.shared.js +7 -5
- package/dist/native/keyboard-inset.mobile.js +5 -5
- package/dist/native/navigation-request.js +26 -0
- package/dist/native/octane-client-build.json +1 -1
- package/dist/native/overlay-lifetime.mobile.js +65 -0
- package/dist/native/pan.tsrx.js +16 -2
- package/dist/native/route-table.js +90 -10
- package/dist/native/route.js +26 -16
- package/dist/native/shared.js +7 -5
- package/dist/native/sheet-service.js +2 -2
- package/dist/native/svg.mobile.js +1 -1
- package/dist/native/{tap-to-blur.mobile.js → tap-to-blur.ios.js} +20 -32
- package/dist/native/text-focus.js +10 -0
- package/dist/native/text-write.js +18 -11
- package/dist/native/toast-anchor.tsrx.js +1 -1
- package/dist/native/ui.js +7 -6
- package/dist/native/useMeasure.tsrx.js +17 -18
- package/dist/native/vendor/ui-svg/index.android.js +2 -2
- package/dist/native/vendor/ui-svg/index.ios.js +2 -2
- package/dist/native/vendor/ui-svg/{index.common.js → src/index.common.js} +1 -1
- package/dist/native/virtual-list-cell-pool.js +63 -0
- package/dist/web/Button.web.tsrx.js +1 -1
- package/dist/web/KeyboardAvoiding.web.tsrx.js +78 -0
- package/dist/web/Markdown.tsrx.js +98 -0
- package/dist/web/Overlay.web.tsrx.js +81 -32
- package/dist/web/PinInput.web.tsrx.js +24 -10
- package/dist/web/Pressable.web.tsrx.js +169 -53
- package/dist/web/SearchInput.web.tsrx.js +2 -2
- package/dist/web/Sheet.web.tsrx.js +20 -7
- package/dist/web/TextArea.web.tsrx.js +22 -17
- package/dist/web/TextInput.web.tsrx.js +2 -2
- package/dist/web/VirtualList.web.tsrx.js +220 -109
- package/dist/web/WebView.web.tsrx.js +3 -3
- package/dist/web/{index.shared.js → index.shared.web.js} +7 -5
- package/dist/web/modal-focus.web.js +95 -0
- package/dist/web/navigation-request.js +26 -0
- package/dist/web/octane-client-build.json +1 -1
- package/dist/web/pan.web.tsrx.js +27 -10
- package/dist/web/route-table.js +90 -10
- package/dist/web/route.web.js +88 -22
- package/dist/web/sheet-service.web.js +8 -0
- package/dist/web/theme/colorScheme.web.js +31 -4
- package/dist/web/ui.js +8 -6
- package/dist/web/virtual-list-cell-pool.js +63 -0
- package/package.json +21 -19
- package/platforms/android/native-api-usage.json +7 -7
- package/src/CommandPalette.tsrx +8 -1
- package/src/Grid.tsrx +32 -1
- package/src/Icon.macos.tsrx +1 -0
- package/src/KeyboardAvoiding.macos.tsrx +7 -1
- package/src/KeyboardAvoiding.mobile.tsrx +2 -2
- package/src/KeyboardAvoiding.tsrx +15 -0
- package/src/KeyboardAvoiding.web.tsrx +15 -0
- package/src/Markdown.tsrx +121 -0
- package/src/Meter.tsrx +1 -0
- package/src/Overlay.tsrx +15 -30
- package/src/Overlay.web.tsrx +12 -3
- package/src/Pagination.tsrx +6 -4
- package/src/PinInput.macos.tsrx +20 -6
- package/src/PinInput.mobile.test.ts +107 -0
- package/src/PinInput.tsrx +20 -6
- package/src/PinInput.web.test.tsrx +42 -0
- package/src/PinInput.web.tsrx +20 -6
- package/src/Popover.tsrx +36 -22
- package/src/Pressable.tsrx +1 -1
- package/src/Pressable.web.test.tsrx +36 -0
- package/src/Pressable.web.tsrx +37 -6
- package/src/RouteHost.macos.tsrx +1 -0
- package/src/Screen.tsrx +1 -1
- package/src/SearchInput.tsrx +4 -3
- package/src/SearchInput.web.tsrx +1 -1
- package/src/Sheet.tsrx +21 -42
- package/src/Sheet.web.tsrx +9 -1
- package/src/Slider.tsrx +13 -11
- package/src/Text.tsrx +36 -0
- package/src/TextArea.tsrx +6 -5
- package/src/TextArea.web.test.tsrx +39 -0
- package/src/TextArea.web.tsrx +7 -5
- package/src/TextInput.tsrx +6 -6
- package/src/TextInput.web.tsrx +1 -1
- package/src/VirtualList.macos.tsrx +93 -6
- package/src/VirtualList.mobile.test.tsrx +232 -0
- package/src/VirtualList.tsrx +285 -81
- package/src/VirtualList.web.tsrx +131 -25
- package/src/WebView.tsrx +20 -10
- package/src/WebView.web.tsrx +3 -0
- package/src/android/BottomNavigationView.android.tsrx +1 -0
- package/src/android/MaterialDialog.android.tsrx +1 -0
- package/src/anim.macos.tsrx +1 -0
- package/src/apply-native-modifiers.native.ts +4 -1
- package/src/child-array.ts +12 -7
- package/src/colorScheme.macos.ts +1 -0
- package/src/controls.macos.tsrx +4 -1
- package/src/data-driver.mobile.test.ts +120 -0
- package/src/data-lifecycle.mobile.test.ts +251 -0
- package/src/escape-props.ts +13 -1
- package/src/grid-auto-placement.ts +163 -0
- package/src/grid-placement.ts +29 -0
- package/src/hosted-unsupported.macos.tsrx +1 -0
- package/src/index.macos.ts +23 -3
- package/src/index.mobile.ts +0 -1
- package/src/index.shared.ts +22 -1
- package/src/index.shared.web.ts +291 -0
- package/src/index.web.ts +1 -1
- package/src/input-readiness.web.test.tsrx +82 -0
- package/src/ios/UITabBar.ios.tsrx +1 -0
- package/src/keyboard-inset.mobile.test.ts +62 -0
- package/src/keyboard-inset.mobile.ts +63 -43
- package/src/layout-shells.macos.tsrx +1 -5
- package/src/macos-extras.macos.tsrx +2 -0
- package/src/modal-focus.web.test.tsrx +63 -0
- package/src/modal-focus.web.ts +162 -0
- package/src/navigation-request.ts +37 -0
- package/src/overlay-lifecycle.mobile.test.ts +316 -0
- package/src/overlay-lifetime.mobile.ts +107 -0
- package/src/pan.mobile.test.tsrx +116 -0
- package/src/pan.tsrx +20 -2
- package/src/pan.web.tsrx +35 -7
- package/src/platformProps.ts +1 -0
- package/src/popover.mobile.test.ts +9 -1
- package/src/pressable-accessibility.mobile.test.ts +30 -0
- package/src/props.ts +163 -3
- package/src/refresh.ts +6 -1
- package/src/refresh.web.test.ts +77 -77
- package/src/route-android.test.ts +162 -0
- package/src/route-history.web.test.ts +80 -0
- package/src/route-navigation.web.test.ts +173 -0
- package/src/route-table.test.ts +188 -9
- package/src/route-table.ts +138 -10
- package/src/route.macos.ts +56 -13
- package/src/route.ts +54 -24
- package/src/route.web.ts +141 -24
- package/src/sheet-detents.ts +5 -3
- package/src/sheet-service.macos.ts +5 -1
- package/src/sheet-service.ts +1 -1
- package/src/sheet-service.web.ts +8 -0
- package/src/sheet-snap.test.ts +23 -23
- package/src/sheet-snap.ts +6 -1
- package/src/svg.mobile.ts +9 -3
- package/src/tap-to-blur.ios.ts +106 -0
- package/src/tap-to-blur.mobile.ts +21 -95
- package/src/text-focus.ts +12 -0
- package/src/text-input.mobile.test.ts +89 -0
- package/src/text-write.ts +21 -11
- package/src/theme/colorScheme.linux.ts +2 -4
- package/src/theme/colorScheme.web.ts +51 -4
- package/src/theme/theme-scheme.macos.ts +8 -2
- package/src/theme/tokens.css +1740 -1718
- package/src/translate.macos.ts +4 -1
- package/src/useMeasure.tsrx +20 -21
- package/src/virtual-list-cell-pool.test.ts +53 -0
- package/src/virtual-list-cell-pool.ts +81 -0
- package/src/virtual-list-layout.test.ts +11 -8
- package/src/virtual-list-layout.ts +4 -8
- package/src/windows.linux.ts +7 -2
- package/src/windows.macos.ts +1 -0
- package/types/generated/.tsrx-typegen-manifest.json +16 -3
- package/types/generated/Grid.d.ts +0 -1
- package/types/generated/KeyboardAvoiding.d.ts +3 -0
- package/types/generated/KeyboardAvoiding.web.d.ts +2 -0
- package/types/generated/Markdown.d.ts +59 -0
- package/types/generated/TextArea.d.ts +2 -2
- package/types/generated/TextArea.web.d.ts +1 -1
- package/types/generated/TextInput.d.ts +2 -3
- package/types/generated/VirtualList.d.ts +3 -3
- package/types/generated/escape-props.d.ts +4 -0
- package/types/generated/grid-auto-placement.d.ts +13 -0
- package/types/generated/grid-placement.d.ts +5 -0
- package/types/generated/index.mobile.d.ts +0 -1
- package/types/generated/index.shared.d.ts +6 -3
- package/types/generated/index.shared.web.d.ts +114 -0
- package/types/generated/index.web.d.ts +1 -1
- package/types/generated/modal-focus.web.d.ts +3 -0
- package/types/generated/navigation-request.d.ts +10 -0
- package/types/generated/overlay-lifetime.mobile.d.ts +10 -0
- package/types/generated/props.d.ts +111 -3
- package/types/generated/route-table.d.ts +14 -3
- package/types/generated/svg.mobile.d.ts +2 -2
- package/types/generated/tap-to-blur.ios.d.ts +13 -0
- package/types/generated/tap-to-blur.mobile.d.ts +1 -15
- package/types/generated/text-focus.d.ts +3 -0
- package/types/generated/text-write.d.ts +3 -1
- package/types/generated/theme/colorScheme.web.d.ts +5 -0
- package/types/generated/virtual-list-cell-pool.d.ts +18 -0
- package/types/index.macos.d.ts +15 -3
- /package/src/vendor/ui-svg/{index.android.ts → src/index.android.ts} +0 -0
- /package/src/vendor/ui-svg/{index.common.ts → src/index.common.ts} +0 -0
- /package/src/vendor/ui-svg/{index.ios.ts → src/index.ios.ts} +0 -0
- /package/src/vendor/ui-svg/{index.ts → src/index.ts} +0 -0
- /package/src/vendor/ui-svg/{typings → src/typings}/SVGKit.d.ts +0 -0
- /package/src/vendor/ui-svg/{typings → src/typings}/android.d.ts +0 -0
- /package/src/vendor/ui-svg/{typings → src/typings}/ios.d.ts +0 -0
- /package/types/generated/vendor/ui-svg/{index.common.d.ts → src/index.common.d.ts} +0 -0
- /package/types/generated/vendor/ui-svg/{index.d.ts → src/index.d.ts} +0 -0
- /package/types/generated/vendor/ui-svg/{index.ios.d.ts → src/index.ios.d.ts} +0 -0
package/dist/native/shared.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,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.
|
|
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 "./
|
|
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
|
|
2
|
-
//#region src/tap-to-blur.
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
64
|
-
|
|
65
|
-
let hit = iosWindow.hitTest(point, null);
|
|
45
|
+
gestureRecognizerShouldReceiveTouch(_recognizer, touch) {
|
|
46
|
+
let hit = touch.view;
|
|
66
47
|
while (hit) {
|
|
67
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
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 [
|
|
21
|
-
const
|
|
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((
|
|
24
|
-
|
|
25
|
-
|
|
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) =>
|
|
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
|
-
|
|
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
|
-
|
|
47
|
-
view.off?.("loaded",
|
|
48
|
+
detach.current = () => {
|
|
49
|
+
view.off?.("loaded", update);
|
|
48
50
|
if (observe) {
|
|
49
51
|
view.off?.("layoutChanged", update);
|
|
50
|
-
|
|
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
|
-
}, [
|
|
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 };
|