@octane-xplat/ui 0.2.1 → 0.3.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 (94) hide show
  1. package/dist/native/octane-client-build.json +1 -1
  2. package/dist/native/ui.js +40 -19
  3. package/dist/native/ui10.js +19 -48
  4. package/dist/native/ui11.js +118 -56
  5. package/dist/native/ui12.js +114 -16
  6. package/dist/native/ui13.js +54 -18
  7. package/dist/native/ui14.js +76 -13
  8. package/dist/native/ui15.js +128 -18
  9. package/dist/native/ui16.js +48 -136
  10. package/dist/native/ui17.js +42 -19
  11. package/dist/native/ui18.js +50 -9
  12. package/dist/native/ui19.js +34 -12
  13. package/dist/native/ui2.js +10 -48
  14. package/dist/native/ui20.js +17 -0
  15. package/dist/native/ui21.js +93 -0
  16. package/dist/native/ui22.js +124 -0
  17. package/dist/native/ui23.js +103 -0
  18. package/dist/native/ui24.js +58 -0
  19. package/dist/native/ui25.js +19 -0
  20. package/dist/native/ui26.js +27 -0
  21. package/dist/native/ui27.js +35 -0
  22. package/dist/native/ui28.js +146 -0
  23. package/dist/native/ui29.js +28 -0
  24. package/dist/native/ui3.js +17 -20
  25. package/dist/native/ui30.js +35 -0
  26. package/dist/native/ui31.js +39 -0
  27. package/dist/native/ui32.js +70 -0
  28. package/dist/native/ui33.js +30 -0
  29. package/dist/native/ui34.js +10 -0
  30. package/dist/native/ui35.js +27 -0
  31. package/dist/native/ui36.js +34 -0
  32. package/dist/native/ui37.js +17 -0
  33. package/dist/native/ui38.js +68 -0
  34. package/dist/native/ui39.js +33 -0
  35. package/dist/native/ui4.js +21 -48
  36. package/dist/native/ui40.js +14 -0
  37. package/dist/native/ui41.js +104 -0
  38. package/dist/native/ui42.js +148 -0
  39. package/dist/native/ui43.js +22 -0
  40. package/dist/native/ui44.js +8 -0
  41. package/dist/native/ui5.js +70 -27
  42. package/dist/native/ui6.js +36 -20
  43. package/dist/native/ui7.js +24 -61
  44. package/dist/native/ui8.js +16 -18
  45. package/dist/native/ui9.js +16 -13
  46. package/dist/web/octane-client-build.json +1 -1
  47. package/dist/web/ui.js +40 -19
  48. package/dist/web/ui10.js +187 -31
  49. package/dist/web/ui11.js +419 -53
  50. package/dist/web/ui12.js +83 -15
  51. package/dist/web/ui13.js +107 -19
  52. package/dist/web/ui14.js +98 -18
  53. package/dist/web/ui15.js +83 -47
  54. package/dist/web/ui16.js +100 -93
  55. package/dist/web/ui17.js +36 -22
  56. package/dist/web/ui18.js +29 -15
  57. package/dist/web/ui19.js +9 -7
  58. package/dist/web/ui2.js +15 -103
  59. package/dist/web/ui20.js +114 -0
  60. package/dist/web/ui21.js +82 -0
  61. package/dist/web/ui22.js +68 -0
  62. package/dist/web/ui23.js +57 -0
  63. package/dist/web/ui24.js +16 -0
  64. package/dist/web/ui25.js +22 -0
  65. package/dist/web/ui26.js +39 -0
  66. package/dist/web/ui27.js +127 -0
  67. package/dist/web/ui28.js +112 -0
  68. package/dist/web/ui29.js +108 -0
  69. package/dist/web/ui3.js +19 -27
  70. package/dist/web/ui30.js +43 -0
  71. package/dist/web/ui31.js +42 -0
  72. package/dist/web/ui32.js +77 -0
  73. package/dist/web/ui33.js +43 -0
  74. package/dist/web/ui34.js +67 -0
  75. package/dist/web/ui35.js +9 -0
  76. package/dist/web/ui36.js +45 -0
  77. package/dist/web/ui37.js +47 -0
  78. package/dist/web/ui38.js +17 -0
  79. package/dist/web/ui39.js +100 -0
  80. package/dist/web/ui4.js +145 -17
  81. package/dist/web/ui40.js +41 -0
  82. package/dist/web/ui41.js +17 -0
  83. package/dist/web/ui42.js +9 -0
  84. package/dist/web/ui43.js +22 -0
  85. package/dist/web/ui44.js +8 -0
  86. package/dist/web/ui5.js +54 -52
  87. package/dist/web/ui6.js +43 -16
  88. package/dist/web/ui7.js +29 -46
  89. package/dist/web/ui8.js +29 -18
  90. package/dist/web/ui9.js +24 -16
  91. package/package.json +6 -3
  92. package/src/theme/tokens.css +166 -0
  93. package/types/index.d.ts +108 -1
  94. package/types/props.d.ts +333 -8
@@ -1,19 +1,129 @@
1
- //#region src/stacks.native.ts
2
- /** Named parallel stacks. A shell (Tabs with `stack` on a spec, the app
3
- * entry's root frame) registers its Frame here; `navigate(name, params,
4
- * {into})` resolves the target by name. Native-only concept — on web,
5
- * parallel stacks map to nested routes (one linear URL stack). */
6
- var stacks = /* @__PURE__ */ new Map();
7
- function registerStack(name, frame) {
8
- stacks.set(name, frame);
9
- }
10
- function getStack(name) {
11
- return stacks.get(name);
12
- }
13
- /** All registered stacks in registration order — for hardware-back
14
- * resolution (pop whichever stack is visibly on top). */
15
- function stackEntries() {
16
- return stacks.entries();
17
- }
1
+ import { cx } from "./ui2.js";
2
+ import { defineUniversalComponent, memo, universalComponent, universalIf, universalPlan, universalProps, universalValue } from "@nativescript-community/octane";
3
+ import { isAndroid, isIOS } from "@nativescript/core";
4
+ //#region src/List.native.tsrx
5
+ var __octaneUniversalPlan0 = universalPlan("nativescript", {
6
+ "kind": "host",
7
+ "type": "gridlayout",
8
+ "children": [{
9
+ "kind": "slot",
10
+ "slot": 0
11
+ }]
12
+ });
13
+ var __octaneUniversalPlan1 = universalPlan("nativescript", {
14
+ "kind": "host",
15
+ "type": "listview",
16
+ "propsSlot": 0
17
+ });
18
+ var __octaneUniversalPlan2 = universalPlan("nativescript", {
19
+ "kind": "slot",
20
+ "slot": 0
21
+ });
22
+ var __octaneUniversalPlan3 = universalPlan("nativescript", {
23
+ "kind": "range",
24
+ "children": [{
25
+ "kind": "slot",
26
+ "slot": 0
27
+ }]
28
+ });
29
+ var __octaneUniversalPlan4 = universalPlan("nativescript", {
30
+ "kind": "slot",
31
+ "slot": 0
32
+ });
33
+ var ListInner = defineUniversalComponent("nativescript", function ListInner(props) {
34
+ const platformProps = Object.assign({}, isIOS ? props.ios : {}, isAndroid ? props.android : {});
35
+ return universalValue(__octaneUniversalPlan1, [universalProps([
36
+ [
37
+ "set",
38
+ "id",
39
+ props.id
40
+ ],
41
+ [
42
+ "set",
43
+ "className",
44
+ cx(props.className)
45
+ ],
46
+ [
47
+ "set",
48
+ "style",
49
+ props.style
50
+ ],
51
+ [
52
+ "set",
53
+ "items",
54
+ props.items
55
+ ],
56
+ [
57
+ "set",
58
+ "iosEstimatedRowHeight",
59
+ isIOS ? props.estimatedItemHeight : void 0
60
+ ],
61
+ [
62
+ "set",
63
+ "onLoadMoreItems",
64
+ props.onEndReached
65
+ ],
66
+ [
67
+ "set",
68
+ "renderItem",
69
+ (item, index) => universalValue(__octaneUniversalPlan0, [props.renderItem(item, index)])
70
+ ],
71
+ ["spread", platformProps]
72
+ ])]);
73
+ }, { "module": "@nativescript-community/octane" });
74
+ var MemoListView = memo(ListInner, (a, b) => a.items === b.items && a.className === b.className && a.style === b.style && a.id === b.id && a.estimatedItemHeight === b.estimatedItemHeight && a.onEndReached === b.onEndReached && a.ios === b.ios && a.android === b.android);
75
+ var List = defineUniversalComponent("nativescript", function List(props) {
76
+ return universalValue(__octaneUniversalPlan4, [universalIf(props.items.length > 0, () => {
77
+ return universalValue(__octaneUniversalPlan2, [universalComponent("nativescript", MemoListView, universalProps([
78
+ [
79
+ "set",
80
+ "id",
81
+ props.id
82
+ ],
83
+ [
84
+ "set",
85
+ "items",
86
+ props.items
87
+ ],
88
+ [
89
+ "set",
90
+ "className",
91
+ props.className
92
+ ],
93
+ [
94
+ "set",
95
+ "style",
96
+ props.style
97
+ ],
98
+ [
99
+ "set",
100
+ "renderItem",
101
+ props.renderItem
102
+ ],
103
+ [
104
+ "set",
105
+ "estimatedItemHeight",
106
+ props.estimatedItemHeight
107
+ ],
108
+ [
109
+ "set",
110
+ "onEndReached",
111
+ props.onEndReached
112
+ ],
113
+ [
114
+ "set",
115
+ "ios",
116
+ props.ios
117
+ ],
118
+ [
119
+ "set",
120
+ "android",
121
+ props.android
122
+ ]
123
+ ]))]);
124
+ }, () => {
125
+ return universalValue(__octaneUniversalPlan3, [props.renderEmpty?.()]);
126
+ })]);
127
+ }, { "module": "@nativescript-community/octane" });
18
128
  //#endregion
19
- export { getStack, registerStack, stackEntries };
129
+ export { List };
@@ -1,143 +1,55 @@
1
- import { registerStack } from "./ui15.js";
2
- import { createNativeScriptRoot, defineUniversalComponent, markWarm, memo, universalComponent, universalPlan, universalProps, universalValue, useBatch, warmChild } from "@nativescript-community/octane";
3
- import { ContentView, Frame, Page, TabViewItem } from "@nativescript/core";
4
- //#region src/Tabs.native.tsrx
1
+ import { cx } from "./ui2.js";
2
+ import { applyEscapeProps } from "./ui3.js";
3
+ import { layoutChildProps } from "./ui4.js";
4
+ import { defineUniversalComponent, universalPlan, universalProps, universalValue } from "@nativescript-community/octane";
5
+ //#region src/ScrollView.native.tsrx
5
6
  var __octaneUniversalPlan0 = universalPlan("nativescript", {
6
- "kind": "range",
7
+ "kind": "host",
8
+ "type": "scrollview",
9
+ "propsSlot": 0,
7
10
  "children": [{
8
- "kind": "slot",
9
- "slot": 0
11
+ "kind": "host",
12
+ "type": "flexboxlayout",
13
+ "bindings": [["flexDirection", 1]],
14
+ "children": [{
15
+ "kind": "slot",
16
+ "slot": 2
17
+ }]
10
18
  }]
11
19
  });
12
- var __octaneUniversalPlan1 = universalPlan("nativescript", {
13
- "kind": "host",
14
- "type": "tabview",
15
- "bindings": [
16
- ["id", 0],
17
- ["className", 1],
18
- ["style", 2],
19
- ["items", 3],
20
- ["selectedIndex", 4],
21
- ["onSelectedIndexChanged", 5],
22
- ["onLoaded", 6]
23
- ]
24
- });
25
- var __octaneUniversalPlan2 = universalPlan("nativescript", {
26
- "kind": "slot",
27
- "slot": 0
28
- });
29
- var TabPane = defineUniversalComponent("nativescript", function TabPane(props) {
30
- return universalValue(__octaneUniversalPlan0, [props.render()]);
31
- }, { "module": "@nativescript-community/octane" });
32
- var paneRoots = /* @__PURE__ */ new WeakMap();
33
- var tabsByView = /* @__PURE__ */ new WeakMap();
34
- var itemsCache = /* @__PURE__ */ new WeakMap();
35
- function itemsFor(tabs) {
36
- let items = itemsCache.get(tabs);
37
- if (items !== void 0) return items;
38
- items = tabs.map((t) => {
39
- const item = new TabViewItem();
40
- item.title = t.title;
41
- if (t.stack) {
42
- const frame = new Frame();
43
- frame.once("loaded", () => {
44
- frame.navigate({ create: () => {
45
- const page = new Page();
46
- page.actionBarHidden = true;
47
- createNativeScriptRoot(page).render(TabPane, { render: t.render });
48
- return page;
49
- } });
50
- });
51
- registerStack(t.stack, frame);
52
- item.view = frame;
53
- return item;
54
- }
55
- const cv = new ContentView();
56
- tabsByView.set(cv, t.render);
57
- item.view = cv;
58
- return item;
59
- });
60
- itemsCache.set(tabs, items);
61
- return items;
62
- }
63
- function mountPanes(e) {
64
- const tv = e.object;
65
- for (const item of tv.items) {
66
- const cv = item.view;
67
- if (!(cv instanceof ContentView) || paneRoots.has(cv)) continue;
68
- const render = tabsByView.get(cv);
69
- if (!render) continue;
70
- const root = createNativeScriptRoot(cv);
71
- paneRoots.set(cv, root);
72
- root.render(TabPane, { render });
73
- }
74
- console.log("[probe] tabs mounted panes=" + tv.items.length);
75
- }
76
- var TabsInner = defineUniversalComponent("nativescript", function TabsInner(props) {
77
- return universalValue(__octaneUniversalPlan1, [
78
- props.id,
79
- props.className,
80
- props.style,
81
- itemsFor(props.tabs),
82
- props.selectedIndex,
83
- (e) => props.onSelectedIndexChanged?.(e.value),
84
- mountPanes
20
+ var ScrollView = defineUniversalComponent("nativescript", function ScrollView(props) {
21
+ return universalValue(__octaneUniversalPlan0, [
22
+ universalProps([
23
+ [
24
+ "set",
25
+ "ref",
26
+ (v) => applyEscapeProps(v, props)
27
+ ],
28
+ [
29
+ "set",
30
+ "id",
31
+ props.id
32
+ ],
33
+ ["spread", layoutChildProps(props)],
34
+ [
35
+ "set",
36
+ "className",
37
+ cx(props.className)
38
+ ],
39
+ [
40
+ "set",
41
+ "style",
42
+ props.style
43
+ ],
44
+ [
45
+ "set",
46
+ "orientation",
47
+ props.horizontal ? "horizontal" : "vertical"
48
+ ]
49
+ ]),
50
+ props.horizontal ? "row" : "column",
51
+ props.children
85
52
  ]);
86
53
  }, { "module": "@nativescript-community/octane" });
87
- var MemoTabs = memo(TabsInner, (a, b) => a.tabs === b.tabs && a.selectedIndex === b.selectedIndex);
88
- var Tabs = defineUniversalComponent("nativescript", markWarm(function Tabs(props) {
89
- useBatch([], () => {
90
- warmChild(MemoTabs, {
91
- id: props.id,
92
- className: props.className,
93
- style: props.style,
94
- tabs: props.tabs,
95
- selectedIndex: props.selectedIndex,
96
- onSelectedIndexChanged: props.onSelectedIndexChanged
97
- });
98
- });
99
- return universalValue(__octaneUniversalPlan2, [universalComponent("nativescript", MemoTabs, universalProps([
100
- [
101
- "set",
102
- "id",
103
- props.id
104
- ],
105
- [
106
- "set",
107
- "className",
108
- props.className
109
- ],
110
- [
111
- "set",
112
- "style",
113
- props.style
114
- ],
115
- [
116
- "set",
117
- "tabs",
118
- props.tabs
119
- ],
120
- [
121
- "set",
122
- "selectedIndex",
123
- props.selectedIndex
124
- ],
125
- [
126
- "set",
127
- "onSelectedIndexChanged",
128
- props.onSelectedIndexChanged
129
- ]
130
- ]))]);
131
- }, (__wp) => {
132
- const props = __wp;
133
- warmChild(MemoTabs, {
134
- id: props.id,
135
- className: props.className,
136
- style: props.style,
137
- tabs: props.tabs,
138
- selectedIndex: props.selectedIndex,
139
- onSelectedIndexChanged: props.onSelectedIndexChanged
140
- });
141
- }), { "module": "@nativescript-community/octane" });
142
54
  //#endregion
143
- export { Tabs };
55
+ export { ScrollView };
@@ -1,24 +1,47 @@
1
- import { defineUniversalComponent, universalPlan, universalValue } from "@nativescript-community/octane";
2
- //#region src/Switch.native.tsrx
1
+ import { cx } from "./ui2.js";
2
+ import { applyEscapeProps } from "./ui3.js";
3
+ import { layoutChildProps } from "./ui4.js";
4
+ import { defineUniversalComponent, universalPlan, universalProps, universalValue } from "@nativescript-community/octane";
5
+ //#region src/Image.native.tsrx
3
6
  var __octaneUniversalPlan0 = universalPlan("nativescript", {
4
7
  "kind": "host",
5
- "type": "switch",
6
- "bindings": [
7
- ["id", 0],
8
- ["className", 1],
9
- ["style", 2],
10
- ["checked", 3],
11
- ["onCheckedChange", 4]
12
- ]
8
+ "type": "image",
9
+ "propsSlot": 0
13
10
  });
14
- var Switch = defineUniversalComponent("nativescript", function Switch(props) {
15
- return universalValue(__octaneUniversalPlan0, [
16
- props.id,
17
- props.className,
18
- props.style,
19
- props.checked,
20
- (e) => props.onCheckedChange?.(e.value)
21
- ]);
11
+ var Image = defineUniversalComponent("nativescript", function Image(props) {
12
+ return universalValue(__octaneUniversalPlan0, [universalProps([
13
+ [
14
+ "set",
15
+ "ref",
16
+ (v) => applyEscapeProps(v, props)
17
+ ],
18
+ [
19
+ "set",
20
+ "id",
21
+ props.id
22
+ ],
23
+ ["spread", layoutChildProps(props)],
24
+ [
25
+ "set",
26
+ "className",
27
+ cx(props.className)
28
+ ],
29
+ [
30
+ "set",
31
+ "style",
32
+ props.style
33
+ ],
34
+ [
35
+ "set",
36
+ "src",
37
+ props.src
38
+ ],
39
+ [
40
+ "set",
41
+ "accessibilityLabel",
42
+ props.alt
43
+ ]
44
+ ])]);
22
45
  }, { "module": "@nativescript-community/octane" });
23
46
  //#endregion
24
- export { Switch };
47
+ export { Image };
@@ -1,13 +1,54 @@
1
- import { defineUniversalComponent, universalPlan, universalValue } from "@nativescript-community/octane";
2
- //#region src/PlatformBadge.native.tsrx
1
+ import { createNativeScriptRoot, defineUniversalComponent, hookSlots, universalPlan, universalValue, useEffect, useRef } from "@nativescript-community/octane";
2
+ import { Frame, GridLayout } 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);
3
7
  var __octaneUniversalPlan0 = universalPlan("nativescript", {
4
- "kind": "host",
5
- "type": "label",
6
- "props": { "text": "ios|android" },
7
- "bindings": [["className", 0]]
8
+ "kind": "range",
9
+ "children": [{
10
+ "kind": "slot",
11
+ "slot": 0
12
+ }]
8
13
  });
9
- var PlatformBadge = defineUniversalComponent("nativescript", function PlatformBadge(props) {
10
- return universalValue(__octaneUniversalPlan0, [props.className]);
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 GridLayout();
28
+ const root = createNativeScriptRoot(host);
29
+ shown.current = {
30
+ host,
31
+ root
32
+ };
33
+ if (props.component) root.render(props.component, props.params ?? {});
34
+ else root.render(Panel, { children: props.children });
35
+ const fullscreen = props.presentation ? props.presentation === "fullscreen" : props.fullscreen ?? true;
36
+ presenter.showModal(host, {
37
+ context: {},
38
+ closeCallback: (result) => {
39
+ shown.current = null;
40
+ props.onClose?.(result);
41
+ },
42
+ fullscreen,
43
+ animated: true
44
+ });
45
+ } else if (!props.open && shown.current) {
46
+ const { host } = shown.current;
47
+ shown.current = null;
48
+ host.closeModal();
49
+ }
50
+ }, [props.open], _h$1);
51
+ return universalValue(__octaneUniversalPlan1, []);
11
52
  }, { "module": "@nativescript-community/octane" });
12
53
  //#endregion
13
- export { PlatformBadge };
54
+ export { Modal };
@@ -1,13 +1,35 @@
1
- //#region src/route.native.ts
2
- function routeFor(_stack) {
3
- return null;
4
- }
5
- function currentRoute() {
6
- return null;
7
- }
8
- function useRoute(_stack) {
9
- return null;
10
- }
11
- function pushRoute(_r) {}
1
+ import { createNativeScriptRoot } from "@nativescript-community/octane";
2
+ import { Frame, GridLayout } from "@nativescript/core";
3
+ //#region src/modal-service.native.ts
4
+ /** Open a component in its own NativeScript modal root and resolve on close. */
5
+ var openModal = (Component, params, options = {}) => new Promise((resolve, reject) => {
6
+ const presenter = Frame.topmost()?.currentPage ?? Frame.topmost();
7
+ if (!presenter) {
8
+ reject(/* @__PURE__ */ new Error("Cannot open modal before a NativeScript page is active"));
9
+ return;
10
+ }
11
+ const host = new GridLayout();
12
+ const root = createNativeScriptRoot(host);
13
+ let finished = false;
14
+ const finish = (result) => {
15
+ if (finished) return;
16
+ finished = true;
17
+ root.unmount?.();
18
+ host.removeChildren?.();
19
+ resolve(result);
20
+ };
21
+ const close = (result) => host.closeModal(result);
22
+ root.render(Component, {
23
+ params,
24
+ close
25
+ });
26
+ const fullscreen = options.presentation ? options.presentation === "fullscreen" : options.fullscreen ?? true;
27
+ presenter.showModal(host, {
28
+ context: {},
29
+ closeCallback: finish,
30
+ fullscreen,
31
+ animated: options.animated ?? true
32
+ });
33
+ });
12
34
  //#endregion
13
- export { currentRoute, pushRoute, routeFor, useRoute };
35
+ export { openModal };
@@ -1,49 +1,11 @@
1
- import { defineUniversalComponent, hookSlots, universalPlan, universalValue, useCallback } from "@nativescript-community/octane";
2
- //#region src/View.native.tsrx
3
- var _h$0 = /* @__PURE__ */ Symbol(/* @__PURE__ */ hookSlots(1));
4
- var __octaneUniversalPlan0 = universalPlan("nativescript", {
5
- "kind": "host",
6
- "type": "flexboxlayout",
7
- "props": { "flexDirection": "column" },
8
- "bindings": [
9
- ["id", 0],
10
- ["ref", 1],
11
- ["className", 2],
12
- ["style", 3],
13
- ["onPan", 4],
14
- ["onSwipe", 5]
15
- ],
16
- "children": [{
17
- "kind": "slot",
18
- "slot": 6
19
- }]
20
- });
21
- var PAN_STATE = [
22
- "cancelled",
23
- "began",
24
- "moved",
25
- "ended"
26
- ];
27
- var View = defineUniversalComponent("nativescript", function View(props) {
28
- const onPan = useCallback((e) => props.onPan?.({
29
- x: e.deltaX,
30
- y: e.deltaY,
31
- dx: e.deltaX,
32
- dy: e.deltaY,
33
- vx: 0,
34
- vy: 0,
35
- state: PAN_STATE[e.state] ?? "moved",
36
- target: e.view ?? e.object
37
- }), [props.onPan], _h$0);
38
- return universalValue(__octaneUniversalPlan0, [
39
- props.id,
40
- props.bind,
41
- props.className,
42
- props.style,
43
- props.onPan ? onPan : void 0,
44
- props.onSwipe,
45
- props.children
46
- ]);
47
- }, { "module": "@nativescript-community/octane" });
1
+ //#region src/cx.ts
2
+ /** NS `className` splits on ' ' only, and the universal driver applies the
3
+ * prop via `String(value)` — an array would arrive comma-joined and match
4
+ * no class at all. Native leaves normalize through cx() before handing
5
+ * className to an intrinsic. (The DOM renderer already flattens arrays,
6
+ * so web leaves don't need this.) */
7
+ function cx(...parts) {
8
+ return parts.flat(Infinity).filter(Boolean).join(" ");
9
+ }
48
10
  //#endregion
49
- export { View };
11
+ export { cx };
@@ -0,0 +1,17 @@
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
+ }
16
+ //#endregion
17
+ export { getColorScheme, useColorScheme };