@octane-xplat/ui 0.2.1 → 0.4.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 (126) hide show
  1. package/README.md +46 -0
  2. package/dist/native/octane-client-build.json +1 -1
  3. package/dist/native/ui.js +52 -19
  4. package/dist/native/ui10.js +25 -45
  5. package/dist/native/ui11.js +52 -57
  6. package/dist/native/ui12.js +47 -16
  7. package/dist/native/ui13.js +24 -18
  8. package/dist/native/ui14.js +117 -12
  9. package/dist/native/ui15.js +78 -17
  10. package/dist/native/ui16.js +88 -115
  11. package/dist/native/ui17.js +29 -19
  12. package/dist/native/ui18.js +34 -12
  13. package/dist/native/ui19.js +244 -8
  14. package/dist/native/ui2.js +10 -48
  15. package/dist/native/ui20.js +28 -0
  16. package/dist/native/ui21.js +383 -0
  17. package/dist/native/ui22.js +36 -0
  18. package/dist/native/ui23.js +55 -0
  19. package/dist/native/ui24.js +83 -0
  20. package/dist/native/ui25.js +141 -0
  21. package/dist/native/ui26.js +12 -0
  22. package/dist/native/ui27.js +61 -0
  23. package/dist/native/ui28.js +40 -0
  24. package/dist/native/ui29.js +108 -0
  25. package/dist/native/ui3.js +17 -20
  26. package/dist/native/ui30.js +18 -0
  27. package/dist/native/ui31.js +58 -0
  28. package/dist/native/ui32.js +58 -0
  29. package/dist/native/ui33.js +38 -0
  30. package/dist/native/ui34.js +53 -0
  31. package/dist/native/ui35.js +105 -0
  32. package/dist/native/ui36.js +10 -0
  33. package/dist/native/ui37.js +44 -0
  34. package/dist/native/ui38.js +197 -0
  35. package/dist/native/ui39.js +105 -0
  36. package/dist/native/ui4.js +23 -48
  37. package/dist/native/ui40.js +58 -0
  38. package/dist/native/ui41.js +19 -0
  39. package/dist/native/ui42.js +8 -0
  40. package/dist/native/ui43.js +38 -0
  41. package/dist/native/ui44.js +267 -0
  42. package/dist/native/ui45.js +28 -0
  43. package/dist/native/ui46.js +35 -0
  44. package/dist/native/ui47.js +41 -0
  45. package/dist/native/ui48.js +72 -0
  46. package/dist/native/ui49.js +66 -0
  47. package/dist/native/ui5.js +37 -34
  48. package/dist/native/ui50.js +27 -0
  49. package/dist/native/ui51.js +13 -0
  50. package/dist/native/ui52.js +92 -0
  51. package/dist/native/ui53.js +34 -0
  52. package/dist/native/ui54.js +17 -0
  53. package/dist/native/ui55.js +156 -0
  54. package/dist/native/ui56.js +33 -0
  55. package/dist/native/ui57.js +14 -0
  56. package/dist/native/ui58.js +22 -0
  57. package/dist/native/ui59.js +8 -0
  58. package/dist/native/ui6.js +79 -20
  59. package/dist/native/ui60.js +108 -0
  60. package/dist/native/ui61.js +76 -0
  61. package/dist/native/ui7.js +44 -65
  62. package/dist/native/ui8.js +25 -17
  63. package/dist/native/ui9.js +24 -12
  64. package/dist/web/octane-client-build.json +1 -1
  65. package/dist/web/ui.js +51 -19
  66. package/dist/web/ui10.js +33 -30
  67. package/dist/web/ui11.js +40 -55
  68. package/dist/web/ui12.js +36 -15
  69. package/dist/web/ui13.js +212 -20
  70. package/dist/web/ui14.js +84 -14
  71. package/dist/web/ui15.js +425 -46
  72. package/dist/web/ui16.js +12 -93
  73. package/dist/web/ui17.js +246 -28
  74. package/dist/web/ui18.js +238 -15
  75. package/dist/web/ui19.js +36 -8
  76. package/dist/web/ui2.js +15 -103
  77. package/dist/web/ui20.js +85 -0
  78. package/dist/web/ui21.js +111 -0
  79. package/dist/web/ui22.js +108 -0
  80. package/dist/web/ui23.js +96 -0
  81. package/dist/web/ui24.js +32 -0
  82. package/dist/web/ui25.js +108 -0
  83. package/dist/web/ui26.js +45 -0
  84. package/dist/web/ui27.js +16 -0
  85. package/dist/web/ui28.js +11 -0
  86. package/dist/web/ui29.js +58 -0
  87. package/dist/web/ui3.js +30 -27
  88. package/dist/web/ui30.js +34 -0
  89. package/dist/web/ui31.js +123 -0
  90. package/dist/web/ui32.js +44 -0
  91. package/dist/web/ui33.js +159 -0
  92. package/dist/web/ui34.js +70 -0
  93. package/dist/web/ui35.js +57 -0
  94. package/dist/web/ui36.js +22 -0
  95. package/dist/web/ui37.js +7 -0
  96. package/dist/web/ui38.js +38 -0
  97. package/dist/web/ui39.js +154 -0
  98. package/dist/web/ui4.js +46 -24
  99. package/dist/web/ui40.js +43 -0
  100. package/dist/web/ui41.js +42 -0
  101. package/dist/web/ui42.js +76 -0
  102. package/dist/web/ui43.js +42 -0
  103. package/dist/web/ui44.js +62 -0
  104. package/dist/web/ui45.js +9 -0
  105. package/dist/web/ui46.js +45 -0
  106. package/dist/web/ui47.js +13 -0
  107. package/dist/web/ui48.js +63 -0
  108. package/dist/web/ui49.js +47 -0
  109. package/dist/web/ui5.js +158 -52
  110. package/dist/web/ui50.js +17 -0
  111. package/dist/web/ui51.js +149 -0
  112. package/dist/web/ui52.js +42 -0
  113. package/dist/web/ui53.js +17 -0
  114. package/dist/web/ui54.js +9 -0
  115. package/dist/web/ui55.js +22 -0
  116. package/dist/web/ui56.js +8 -0
  117. package/dist/web/ui57.js +44 -0
  118. package/dist/web/ui58.js +46 -0
  119. package/dist/web/ui6.js +85 -22
  120. package/dist/web/ui7.js +46 -41
  121. package/dist/web/ui8.js +28 -11
  122. package/dist/web/ui9.js +32 -13
  123. package/package.json +18 -6
  124. package/src/theme/tokens.css +444 -47
  125. package/types/index.d.ts +180 -29
  126. package/types/props.d.ts +553 -8
package/README.md ADDED
@@ -0,0 +1,46 @@
1
+ # @octane-xplat/ui
2
+
3
+ > Cross-platform primitives for Octane xplat — one element vocabulary that
4
+ > renders to the DOM on web and NativeScript views on iOS/Android.
5
+ >
6
+ > Status: `0.x` — the API surface is still moving. iOS/Android targets need
7
+ > the NativeScript toolchain (Xcode/JDK + `ns`).
8
+
9
+ ```sh
10
+ pnpm add @octane-xplat/ui octane
11
+ ```
12
+
13
+ `octane` is a required peer; the `@nativescript/*` peers are optional and
14
+ only needed for native targets.
15
+
16
+ ```tsx
17
+ import { Row, Text, Pressable } from '@octane-xplat/ui'
18
+
19
+ ;<Row className="items-center gap-2">
20
+ <Text>Hello</Text>
21
+ <Pressable onPress={save}>
22
+ <Text>Save</Text>
23
+ </Pressable>
24
+ </Row>
25
+ ```
26
+
27
+ The package also ships `styled()`, layout stacks, routing (`Link`, `NavLink`,
28
+ route tables), overlay/toast/modal services, and the theme stylesheet:
29
+
30
+ ```ts
31
+ import '@octane-xplat/ui/theme/tokens.css'
32
+ ```
33
+
34
+ Docs:
35
+
36
+ - [Building screens](https://octane-xplat.goddardai.org/primitives) — the element vocabulary
37
+ - [Styling screens](https://octane-xplat.goddardai.org/styling) — classes, tokens, runtime styles
38
+ - [Moving between screens](https://octane-xplat.goddardai.org/navigation) — routes and links
39
+
40
+ Rules for consumers:
41
+
42
+ - Static styles = `className`; dynamic styles = `style` objects.
43
+ - One element vocabulary per file — platform divergence happens at file
44
+ boundaries (`*.web`/`.native`/`.ios`/`.android`), not inside JSX.
45
+ - No DOM globals in shared code; use `@octane-xplat/platform` for device
46
+ capabilities.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 1,
3
- "buildId": "8686a45b-77f9-4ed0-bf1f-8a6087a94a55",
3
+ "buildId": "945217e4-b47f-4701-903e-c65b8de4bec5",
4
4
  "mode": "production",
5
5
  "capabilities": {
6
6
  "independentHydration": false
package/dist/native/ui.js CHANGED
@@ -1,19 +1,52 @@
1
- import { View } from "./ui2.js";
2
- import { Row } from "./ui3.js";
3
- import { Text } from "./ui4.js";
4
- import { Pressable } from "./ui5.js";
5
- import { TextInput } from "./ui6.js";
6
- import { List } from "./ui7.js";
7
- import { ScrollView } from "./ui8.js";
8
- import { Image } from "./ui9.js";
9
- import { Modal } from "./ui10.js";
10
- import { useAnimation } from "./ui11.js";
11
- import { getColorScheme, useColorScheme } from "./ui12.js";
12
- import { styled } from "./ui13.js";
13
- import { Screen } from "./ui14.js";
14
- import { getStack, registerStack, stackEntries } from "./ui15.js";
15
- import { Tabs } from "./ui16.js";
16
- import { Switch } from "./ui17.js";
17
- import { PlatformBadge } from "./ui18.js";
18
- import { currentRoute, pushRoute, routeFor, useRoute } from "./ui19.js";
19
- export { View as Column, Image, List, Modal, PlatformBadge, Pressable, Row, Screen, ScrollView, Switch, Tabs, Text, TextInput, View, currentRoute, getColorScheme, getStack, pushRoute, registerStack, routeFor, stackEntries, styled, useAnimation, useColorScheme, useRoute };
1
+ import { View } from "./ui6.js";
2
+ import { Row } from "./ui7.js";
3
+ import { Grid } from "./ui8.js";
4
+ import { Stack } from "./ui9.js";
5
+ import { Absolute } from "./ui10.js";
6
+ import { LiquidGlass } from "./ui11.js";
7
+ import { LiquidGlassContainer } from "./ui12.js";
8
+ import { Spacer } from "./ui13.js";
9
+ import { Text } from "./ui14.js";
10
+ import { RichText, RichTextSpan } from "./ui15.js";
11
+ import { Pressable } from "./ui16.js";
12
+ import { Link } from "./ui17.js";
13
+ import { getStack, registerStack, stackEntries } from "./ui18.js";
14
+ import { deriveRouteManifest } from "./ui19.js";
15
+ import { canGoBack, currentModalRoute, currentRoute, hrefFor, layoutsForRoute, popRoute, pushDeepLink, pushRoute, redirect, registerRoutes, registerScreens, routeFor, routeStacks, screenFor, useCanGoBack, useModalRoute, useRoute } from "./ui21.js";
16
+ import { NavLink } from "./ui22.js";
17
+ import { TextInput } from "./ui23.js";
18
+ import { TextArea } from "./ui24.js";
19
+ import { List } from "./ui25.js";
20
+ import { ScrollBox } from "./ui26.js";
21
+ import { ScrollView } from "./ui27.js";
22
+ import { Image } from "./ui29.js";
23
+ import { getColorScheme, useColorScheme } from "./ui30.js";
24
+ import { applyThemeClasses, getThemePreference, getThemeScheme, onThemeSchemeChange, setThemePreference, themeSchemeClasses, useThemeScheme } from "./ui31.js";
25
+ import { Modal } from "./ui32.js";
26
+ import { openModal } from "./ui33.js";
27
+ import { findInRootLayouts, rootLayoutFor, topRootLayout } from "./ui34.js";
28
+ import { Overlay } from "./ui35.js";
29
+ import { Popover } from "./ui38.js";
30
+ import { showToast } from "./ui39.js";
31
+ import { useAnimation } from "./ui40.js";
32
+ import { styled } from "./ui41.js";
33
+ import { openWindow } from "./ui42.js";
34
+ import { Screen } from "./ui43.js";
35
+ import { Tabs } from "./ui44.js";
36
+ import { Switch } from "./ui45.js";
37
+ import { useSafeAreaInsets } from "./ui46.js";
38
+ import { SafeArea } from "./ui47.js";
39
+ import { KeyboardAvoiding } from "./ui48.js";
40
+ import { Drawer } from "./ui49.js";
41
+ import { ActivityIndicator } from "./ui50.js";
42
+ import { Meter } from "./ui52.js";
43
+ import { Slider } from "./ui53.js";
44
+ import { registerIcon, registerIcons } from "./ui54.js";
45
+ import { Icon } from "./ui55.js";
46
+ import { Heading } from "./ui56.js";
47
+ import { PlatformBadge } from "./ui57.js";
48
+ import { createStore } from "./ui58.js";
49
+ import { useStore } from "./ui59.js";
50
+ import { Sheet } from "./ui60.js";
51
+ import { closeSheet, openSheet, sheetHost } from "./ui61.js";
52
+ export { Absolute, ActivityIndicator, View as Column, Drawer, Grid, Heading, Icon, Image, KeyboardAvoiding, Link, LiquidGlass, LiquidGlassContainer, List, Meter, Modal, NavLink, Overlay, PlatformBadge, Popover, Pressable, RichText, RichTextSpan, Row, SafeArea, Screen, ScrollBox, ScrollView, Sheet, Slider, Spacer, Stack, Switch, Tabs, Text, TextArea, TextInput, View, applyThemeClasses, canGoBack, closeSheet, createStore, currentModalRoute, currentRoute, deriveRouteManifest, findInRootLayouts, getColorScheme, getStack, getThemePreference, getThemeScheme, hrefFor, layoutsForRoute, onThemeSchemeChange, openModal, openSheet, openWindow, popRoute, pushDeepLink, pushRoute, redirect, registerIcon, registerIcons, registerRoutes, registerScreens, registerStack, rootLayoutFor, routeFor, routeStacks, screenFor, setThemePreference, sheetHost, showToast, stackEntries, styled, themeSchemeClasses, topRootLayout, useAnimation, useCanGoBack, useColorScheme, useModalRoute, useRoute, useSafeAreaInsets, useStore, useThemeScheme };
@@ -1,52 +1,32 @@
1
- import { createNativeScriptRoot, defineUniversalComponent, hookSlots, universalPlan, universalValue, useEffect, useRef } from "@nativescript-community/octane";
2
- import { ContentView, Frame } from "@nativescript/core";
3
- //#region src/Modal.native.tsrx
4
- var _hs$ = /* @__PURE__ */ hookSlots(2);
5
- var _h$0 = /* @__PURE__ */ Symbol(_hs$);
6
- var _h$1 = /* @__PURE__ */ Symbol(_hs$ + 1);
1
+ import { cx } from "./ui2.js";
2
+ import { applyEscapeProps } from "./ui3.js";
3
+ import { glassClassOf, glassConfigOf } from "./ui4.js";
4
+ import { defineUniversalComponent, universalPlan, universalValue } from "@nativescript-community/octane";
5
+ //#region src/Absolute.native.tsrx
7
6
  var __octaneUniversalPlan0 = universalPlan("nativescript", {
8
- "kind": "range",
7
+ "kind": "host",
8
+ "type": "absolutelayout",
9
+ "bindings": [
10
+ ["id", 0],
11
+ ["ref", 1],
12
+ ["iosGlassEffect", 2],
13
+ ["className", 3],
14
+ ["style", 4]
15
+ ],
9
16
  "children": [{
10
17
  "kind": "slot",
11
- "slot": 0
18
+ "slot": 5
12
19
  }]
13
20
  });
14
- var __octaneUniversalPlan1 = universalPlan("nativescript", {
15
- "kind": "range",
16
- "children": []
17
- });
18
- var Panel = defineUniversalComponent("nativescript", function Panel(props) {
19
- return universalValue(__octaneUniversalPlan0, [props.children]);
20
- }, { "module": "@nativescript-community/octane" });
21
- var Modal = defineUniversalComponent("nativescript", function Modal(props) {
22
- const shown = useRef(null, _h$0);
23
- useEffect(() => {
24
- if (props.open && !shown.current) {
25
- const presenter = Frame.topmost()?.currentPage ?? Frame.topmost();
26
- if (!presenter) return;
27
- const host = new ContentView();
28
- const root = createNativeScriptRoot(host);
29
- shown.current = {
30
- host,
31
- root
32
- };
33
- root.render(Panel, { children: props.children });
34
- presenter.showModal(host, {
35
- context: {},
36
- closeCallback: () => {
37
- shown.current = null;
38
- props.onClose?.();
39
- },
40
- fullscreen: props.fullscreen ?? true,
41
- animated: true
42
- });
43
- } else if (!props.open && shown.current) {
44
- const { host } = shown.current;
45
- shown.current = null;
46
- host.closeModal();
47
- }
48
- }, [props.open], _h$1);
49
- return universalValue(__octaneUniversalPlan1, []);
21
+ var Absolute = defineUniversalComponent("nativescript", function Absolute(props) {
22
+ return universalValue(__octaneUniversalPlan0, [
23
+ props.id,
24
+ (view) => applyEscapeProps(view, props),
25
+ glassConfigOf(props.glass),
26
+ cx("vx-absolute", glassClassOf(props.glass), props.className),
27
+ props.style,
28
+ props.children
29
+ ]);
50
30
  }, { "module": "@nativescript-community/octane" });
51
31
  //#endregion
52
- export { Modal };
32
+ export { Absolute };
@@ -1,58 +1,53 @@
1
- import { hookSlots, useRef } from "@nativescript-community/octane";
2
- import { cancelAnimationFrame, requestAnimationFrame } from "@nativescript/core/animation-frame";
3
- //#region src/anim.native.tsrx
4
- var _h$0 = /* @__PURE__ */ Symbol(/* @__PURE__ */ hookSlots(1));
5
- function createAnimated(initial, prop) {
6
- let view = null;
7
- let current = initial;
8
- let raf = 0;
9
- const apply = (v) => {
10
- current = v;
11
- if (view) view[prop] = v;
12
- };
13
- const run = (step) => {
14
- cancelAnimationFrame(raf);
15
- const start = Date.now();
16
- const tick = () => {
17
- const v = step(Date.now() - start);
18
- if (v === null) return;
19
- apply(v);
20
- raf = requestAnimationFrame(tick);
21
- };
22
- raf = requestAnimationFrame(tick);
23
- };
24
- return {
25
- get value() {
26
- return current;
27
- },
28
- bind(v) {
29
- view = v;
30
- if (view) view[prop] = current;
31
- },
32
- to(target, opts) {
33
- const dur = opts?.duration ?? 300;
34
- const from = current;
35
- run((t) => t >= dur ? (apply(target), null) : from + (target - from) * (t / dur));
36
- },
37
- spring(target, opts) {
38
- const damping = opts?.damping ?? 14, stiffness = opts?.stiffness ?? 120;
39
- let v = 0, x = current;
40
- run(() => {
41
- const dt = 1 / 60;
42
- v += (-stiffness * (x - target) - damping * v) * dt;
43
- x += v * dt;
44
- return Math.abs(v) < .5 && Math.abs(x - target) < .5 ? (apply(target), null) : x;
45
- });
46
- },
47
- stop() {
48
- cancelAnimationFrame(raf);
49
- }
50
- };
51
- }
52
- function useAnimation(initial = 0, prop = "translateX") {
53
- const c = useRef(null, _h$0);
54
- if (!c.current) c.current = createAnimated(initial, prop);
55
- return c.current;
56
- }
1
+ import { cx } from "./ui2.js";
2
+ import { applyEscapeProps } from "./ui3.js";
3
+ import { layoutChildProps } from "./ui5.js";
4
+ import { defineUniversalComponent, registerElement, universalPlan, universalProps, universalValue } from "@nativescript-community/octane";
5
+ import { LiquidGlass } from "@nativescript/core";
6
+ //#region src/LiquidGlass.native.tsrx
7
+ var __octaneUniversalPlan0 = universalPlan("nativescript", {
8
+ "kind": "host",
9
+ "type": "liquidglass",
10
+ "propsSlot": 0,
11
+ "children": [{
12
+ "kind": "slot",
13
+ "slot": 1
14
+ }]
15
+ });
16
+ registerElement("liquidglass", LiquidGlass);
17
+ var LiquidGlass$1 = defineUniversalComponent("nativescript", function LiquidGlass(props) {
18
+ return universalValue(__octaneUniversalPlan0, [universalProps([
19
+ [
20
+ "set",
21
+ "id",
22
+ props.id
23
+ ],
24
+ [
25
+ "set",
26
+ "ref",
27
+ (v) => applyEscapeProps(v, props)
28
+ ],
29
+ ["spread", layoutChildProps(props)],
30
+ [
31
+ "set",
32
+ "iosGlassEffect",
33
+ {
34
+ variant: props.variant ?? "regular",
35
+ interactive: props.interactive ?? true,
36
+ tint: props.tint,
37
+ animateChangeDuration: props.animateChangeDuration
38
+ }
39
+ ],
40
+ [
41
+ "set",
42
+ "className",
43
+ cx("vx-glass", props.variant === "clear" ? "vx-glass--clear" : void 0, props.className)
44
+ ],
45
+ [
46
+ "set",
47
+ "style",
48
+ props.style
49
+ ]
50
+ ]), props.children]);
51
+ }, { "module": "@nativescript-community/octane" });
57
52
  //#endregion
58
- export { useAnimation };
53
+ export { LiquidGlass$1 as LiquidGlass };
@@ -1,17 +1,48 @@
1
- import { hookSlots, useSyncExternalStore } from "@nativescript-community/octane";
2
- import { Application } from "@nativescript/core";
3
- //#region src/theme/colorScheme.native.tsrx
4
- var _h$0 = /* @__PURE__ */ Symbol(/* @__PURE__ */ hookSlots(1));
5
- function getColorScheme() {
6
- return Application.primaryWindow?.systemAppearance?.() ?? Application.systemAppearance?.() ?? "light";
7
- }
8
- function subscribe(cb) {
9
- const h = () => cb();
10
- Application.on("systemAppearanceChanged", h);
11
- return () => Application.off("systemAppearanceChanged", h);
12
- }
13
- function useColorScheme() {
14
- return useSyncExternalStore(subscribe, getColorScheme, _h$0);
15
- }
1
+ import { cx } from "./ui2.js";
2
+ import { applyEscapeProps } from "./ui3.js";
3
+ import { layoutChildProps } from "./ui5.js";
4
+ import { defineUniversalComponent, registerElement, universalPlan, universalProps, universalValue } from "@nativescript-community/octane";
5
+ import { LiquidGlassContainer } from "@nativescript/core";
6
+ //#region src/LiquidGlassContainer.native.tsrx
7
+ var __octaneUniversalPlan0 = universalPlan("nativescript", {
8
+ "kind": "host",
9
+ "type": "liquidglasscontainer",
10
+ "propsSlot": 0,
11
+ "children": [{
12
+ "kind": "slot",
13
+ "slot": 1
14
+ }]
15
+ });
16
+ registerElement("liquidglasscontainer", LiquidGlassContainer);
17
+ var LiquidGlassContainer$1 = defineUniversalComponent("nativescript", function LiquidGlassContainer(props) {
18
+ return universalValue(__octaneUniversalPlan0, [universalProps([
19
+ [
20
+ "set",
21
+ "id",
22
+ props.id
23
+ ],
24
+ [
25
+ "set",
26
+ "ref",
27
+ (v) => applyEscapeProps(v, props)
28
+ ],
29
+ ["spread", layoutChildProps(props)],
30
+ [
31
+ "set",
32
+ "iosGlassEffect",
33
+ { spacing: props.spacing ?? 8 }
34
+ ],
35
+ [
36
+ "set",
37
+ "className",
38
+ cx("vx-glass-container", props.className)
39
+ ],
40
+ [
41
+ "set",
42
+ "style",
43
+ props.style
44
+ ]
45
+ ]), props.children]);
46
+ }, { "module": "@nativescript-community/octane" });
16
47
  //#endregion
17
- export { getColorScheme, useColorScheme };
48
+ export { LiquidGlassContainer$1 as LiquidGlassContainer };
@@ -1,19 +1,25 @@
1
- import "@nativescript-community/octane";
2
- import { defineUniversalComponent as defineUniversalComponent$1, universalComponent as universalComponent$1 } from "octane/universal";
3
- //#region src/styled.native.tsrx
4
- function styled(Base, def) {
5
- function Styled(props) {
6
- const cls = [def.base];
7
- const rest = { ...props };
8
- for (const k of Object.keys(def.variants ?? {})) {
9
- if (props[k]) cls.push(def.variants[k]);
10
- delete rest[k];
11
- }
12
- if (props.className) cls.push(props.className);
13
- rest.className = cls;
14
- return universalComponent$1("nativescript", Base, rest);
15
- }
16
- return defineUniversalComponent$1("nativescript", Styled);
17
- }
1
+ import { cx } from "./ui2.js";
2
+ import { applyEscapeProps } from "./ui3.js";
3
+ import { defineUniversalComponent, universalPlan, universalValue } from "@nativescript-community/octane";
4
+ //#region src/Spacer.native.tsrx
5
+ var __octaneUniversalPlan0 = universalPlan("nativescript", {
6
+ "kind": "host",
7
+ "type": "stacklayout",
8
+ "props": { "flexGrow": 1 },
9
+ "bindings": [
10
+ ["id", 0],
11
+ ["ref", 1],
12
+ ["className", 2],
13
+ ["style", 3]
14
+ ]
15
+ });
16
+ var Spacer = defineUniversalComponent("nativescript", function Spacer(props) {
17
+ return universalValue(__octaneUniversalPlan0, [
18
+ props.id,
19
+ (view) => applyEscapeProps(view, props),
20
+ cx("vx-spacer", props.className),
21
+ props.style
22
+ ]);
23
+ }, { "module": "@nativescript-community/octane" });
18
24
  //#endregion
19
- export { styled };
25
+ export { Spacer };
@@ -1,20 +1,125 @@
1
- import { defineUniversalComponent, universalPlan, universalValue } from "@nativescript-community/octane";
2
- //#region src/Screen.native.tsrx
1
+ import { cx } from "./ui2.js";
2
+ import { applyEscapeProps, nativeAccessibilityState } from "./ui3.js";
3
+ import { layoutChildProps } from "./ui5.js";
4
+ import { createContext, defineUniversalComponent, universalComponent, universalIf, universalPlan, universalProps, universalValue, useContext } from "@nativescript-community/octane";
5
+ //#region src/Text.native.tsrx
3
6
  var __octaneUniversalPlan0 = universalPlan("nativescript", {
4
7
  "kind": "host",
5
- "type": "rootlayout",
6
- "bindings": [["className", 0], ["style", 1]],
8
+ "type": "span",
9
+ "propsSlot": 0,
7
10
  "children": [{
8
11
  "kind": "slot",
9
- "slot": 2
12
+ "slot": 1
10
13
  }]
11
14
  });
12
- var Screen = defineUniversalComponent("nativescript", function Screen(props) {
13
- return universalValue(__octaneUniversalPlan0, [
14
- props.className,
15
- props.style,
16
- props.children
17
- ]);
15
+ var __octaneUniversalPlan1 = universalPlan("nativescript", {
16
+ "kind": "host",
17
+ "type": "label",
18
+ "propsSlot": 0,
19
+ "children": [{
20
+ "kind": "slot",
21
+ "slot": 1
22
+ }]
23
+ });
24
+ var __octaneUniversalPlan2 = universalPlan("nativescript", {
25
+ "kind": "slot",
26
+ "slot": 0
27
+ });
28
+ var InText = createContext(false);
29
+ var TextScope = defineUniversalComponent("nativescript", function TextScope(props) {
30
+ return InText({
31
+ value: true,
32
+ children: props.children
33
+ });
34
+ }, { "module": "@nativescript-community/octane" });
35
+ var Text = defineUniversalComponent("nativescript", function Text(props) {
36
+ const inText = useContext(InText);
37
+ const textStyle = {
38
+ ...props.style,
39
+ ...props.ellipsize ? {
40
+ whiteSpace: "nowrap",
41
+ textOverflow: "ellipsis"
42
+ } : {}
43
+ };
44
+ return universalValue(__octaneUniversalPlan2, [universalIf(inText, () => {
45
+ return universalValue(__octaneUniversalPlan0, [universalProps([
46
+ [
47
+ "set",
48
+ "ref",
49
+ (v) => applyEscapeProps(v, props)
50
+ ],
51
+ [
52
+ "set",
53
+ "className",
54
+ cx(props.className)
55
+ ],
56
+ [
57
+ "set",
58
+ "style",
59
+ textStyle
60
+ ],
61
+ ["spread", layoutChildProps(props)]
62
+ ]), props.children]);
63
+ }, () => {
64
+ return universalValue(__octaneUniversalPlan1, [universalProps([
65
+ [
66
+ "set",
67
+ "id",
68
+ props.id
69
+ ],
70
+ [
71
+ "set",
72
+ "ref",
73
+ (v) => applyEscapeProps(v, props)
74
+ ],
75
+ ["spread", layoutChildProps(props)],
76
+ [
77
+ "set",
78
+ "className",
79
+ cx(props.className)
80
+ ],
81
+ [
82
+ "set",
83
+ "style",
84
+ textStyle
85
+ ],
86
+ [
87
+ "set",
88
+ "maxLines",
89
+ props.numberOfLines ?? 0
90
+ ],
91
+ [
92
+ "set",
93
+ "whiteSpace",
94
+ props.ellipsize ? "nowrap" : "normal"
95
+ ],
96
+ [
97
+ "set",
98
+ "textOverflow",
99
+ props.ellipsize ? "ellipsis" : void 0
100
+ ],
101
+ [
102
+ "set",
103
+ "accessibilityHint",
104
+ props.accessibilityHint
105
+ ],
106
+ [
107
+ "set",
108
+ "accessibilityValue",
109
+ props.accessibilityValue
110
+ ],
111
+ [
112
+ "set",
113
+ "accessibilityState",
114
+ nativeAccessibilityState(props.accessibilityState)
115
+ ],
116
+ [
117
+ "set",
118
+ "accessibilityLiveRegion",
119
+ props.accessibilityLiveRegion
120
+ ]
121
+ ]), universalComponent("nativescript", TextScope, universalProps([], props.children))]);
122
+ })]);
18
123
  }, { "module": "@nativescript-community/octane" });
19
124
  //#endregion
20
- export { Screen };
125
+ export { Text };