@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
@@ -1,19 +1,80 @@
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();
1
+ import { cx } from "./ui2.js";
2
+ import { applyEscapeProps } from "./ui3.js";
3
+ import { layoutChildProps } from "./ui5.js";
4
+ import { defineUniversalComponent, universalPlan, universalProps, universalValue } from "@nativescript-community/octane";
5
+ //#region src/RichText.native.tsrx
6
+ var __octaneUniversalPlan0 = universalPlan("nativescript", {
7
+ "kind": "host",
8
+ "type": "label",
9
+ "propsSlot": 0,
10
+ "children": [{
11
+ "kind": "host",
12
+ "type": "formattedstring",
13
+ "children": [{
14
+ "kind": "slot",
15
+ "slot": 1
16
+ }]
17
+ }]
18
+ });
19
+ var __octaneUniversalPlan1 = universalPlan("nativescript", {
20
+ "kind": "host",
21
+ "type": "span",
22
+ "propsSlot": 0
23
+ });
24
+ var RichText = defineUniversalComponent("nativescript", function RichText(props) {
25
+ return universalValue(__octaneUniversalPlan0, [universalProps([
26
+ [
27
+ "set",
28
+ "id",
29
+ props.id
30
+ ],
31
+ [
32
+ "set",
33
+ "ref",
34
+ (el) => applyEscapeProps(el, props)
35
+ ],
36
+ ["spread", layoutChildProps(props)],
37
+ [
38
+ "set",
39
+ "className",
40
+ cx("vx-rich-text", props.className)
41
+ ],
42
+ [
43
+ "set",
44
+ "style",
45
+ props.style
46
+ ],
47
+ [
48
+ "set",
49
+ "whiteSpace",
50
+ "normal"
51
+ ]
52
+ ]), props.children]);
53
+ }, { "module": "@nativescript-community/octane" });
54
+ function runText(props) {
55
+ if (props.text !== void 0) return props.text;
56
+ if (typeof props.children === "string" || typeof props.children === "number") return String(props.children);
57
+ return "";
17
58
  }
59
+ var RichTextSpan = defineUniversalComponent("nativescript", function RichTextSpan(props) {
60
+ return universalValue(__octaneUniversalPlan1, [universalProps([
61
+ [
62
+ "set",
63
+ "text",
64
+ runText(props)
65
+ ],
66
+ [
67
+ "set",
68
+ "className",
69
+ cx(props.className)
70
+ ],
71
+ ["spread", props.style],
72
+ [
73
+ "set",
74
+ "onLinkTap",
75
+ props.onPress
76
+ ]
77
+ ])]);
78
+ }, { "module": "@nativescript-community/octane" });
18
79
  //#endregion
19
- export { getStack, registerStack, stackEntries };
80
+ export { RichText, RichTextSpan };
@@ -1,143 +1,116 @@
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, nativeAccessibilityState } from "./ui3.js";
3
+ import { glassClassOf, glassConfigOf } from "./ui4.js";
4
+ import { layoutChildProps } from "./ui5.js";
5
+ import { defineUniversalComponent, universalPlan, universalProps, universalValue } from "@nativescript-community/octane";
6
+ //#region src/Pressable.native.tsrx
5
7
  var __octaneUniversalPlan0 = universalPlan("nativescript", {
6
- "kind": "range",
8
+ "kind": "host",
9
+ "type": "flexboxlayout",
10
+ "propsSlot": 0,
7
11
  "children": [{
8
12
  "kind": "slot",
9
- "slot": 0
13
+ "slot": 1
10
14
  }]
11
15
  });
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
85
- ]);
86
- }, { "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([
16
+ var Pressable = defineUniversalComponent("nativescript", function Pressable(props) {
17
+ return universalValue(__octaneUniversalPlan0, [universalProps([
18
+ [
19
+ "set",
20
+ "ref",
21
+ (v) => applyEscapeProps(v, props)
22
+ ],
100
23
  [
101
24
  "set",
102
25
  "id",
103
26
  props.id
104
27
  ],
28
+ ["spread", layoutChildProps(props)],
105
29
  [
106
30
  "set",
107
31
  "className",
108
- props.className
32
+ cx("vx-pressable", glassClassOf(props.glass), props.className)
33
+ ],
34
+ [
35
+ "set",
36
+ "iosGlassEffect",
37
+ glassConfigOf(props.glass)
109
38
  ],
110
39
  [
111
40
  "set",
112
41
  "style",
113
- props.style
42
+ {
43
+ ...props.style,
44
+ ...props.hitSlop ? {
45
+ margin: -props.hitSlop,
46
+ padding: props.hitSlop
47
+ } : {}
48
+ }
49
+ ],
50
+ [
51
+ "set",
52
+ "accessible",
53
+ props.accessible
54
+ ],
55
+ [
56
+ "set",
57
+ "accessibilityLabel",
58
+ props.accessibilityLabel
59
+ ],
60
+ [
61
+ "set",
62
+ "accessibilityRole",
63
+ props.accessibilityRole
64
+ ],
65
+ [
66
+ "set",
67
+ "accessibilityHint",
68
+ props.accessibilityHint
69
+ ],
70
+ [
71
+ "set",
72
+ "accessibilityValue",
73
+ props.accessibilityValue
74
+ ],
75
+ [
76
+ "set",
77
+ "accessibilityState",
78
+ nativeAccessibilityState(props.accessibilityState)
114
79
  ],
115
80
  [
116
81
  "set",
117
- "tabs",
118
- props.tabs
82
+ "accessibilityLiveRegion",
83
+ props.accessibilityLiveRegion
119
84
  ],
120
85
  [
121
86
  "set",
122
- "selectedIndex",
123
- props.selectedIndex
87
+ "ignoreTouchAnimation",
88
+ props.ignoreTouchAnimation
124
89
  ],
125
90
  [
126
91
  "set",
127
- "onSelectedIndexChanged",
128
- props.onSelectedIndexChanged
92
+ "onTap",
93
+ props.disabled ? void 0 : props.onPress
94
+ ],
95
+ [
96
+ "set",
97
+ "onLongPress",
98
+ props.disabled ? void 0 : props.onLongPress
99
+ ],
100
+ [
101
+ "set",
102
+ "onDoubleTap",
103
+ props.disabled ? void 0 : props.onDoublePress
104
+ ],
105
+ [
106
+ "set",
107
+ "onTouch",
108
+ props.disabled ? void 0 : (e) => {
109
+ if (e.action === "down") props.onPressIn?.();
110
+ else if (e.action === "up" || e.action === "cancel") props.onPressOut?.();
111
+ }
129
112
  ]
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" });
113
+ ]), props.children]);
114
+ }, { "module": "@nativescript-community/octane" });
142
115
  //#endregion
143
- export { Tabs };
116
+ export { Pressable };
@@ -1,24 +1,34 @@
1
- import { defineUniversalComponent, universalPlan, universalValue } from "@nativescript-community/octane";
2
- //#region src/Switch.native.tsrx
1
+ import { Pressable } from "./ui16.js";
2
+ import { defineUniversalComponent, universalChildren, universalComponent, universalPlan, universalProps, universalValue } from "@nativescript-community/octane";
3
+ import { Utils } from "@nativescript/core";
4
+ //#region src/Link.native.tsrx
3
5
  var __octaneUniversalPlan0 = universalPlan("nativescript", {
4
6
  "kind": "host",
5
- "type": "switch",
6
- "bindings": [
7
- ["id", 0],
8
- ["className", 1],
9
- ["style", 2],
10
- ["checked", 3],
11
- ["onCheckedChange", 4]
12
- ]
7
+ "type": "flexboxlayout",
8
+ "props": { "flexDirection": "row" },
9
+ "children": [{
10
+ "kind": "slot",
11
+ "slot": 0
12
+ }]
13
13
  });
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
- ]);
14
+ var __octaneUniversalPlan1 = universalPlan("nativescript", {
15
+ "kind": "slot",
16
+ "slot": 0
17
+ });
18
+ var Link = defineUniversalComponent("nativescript", function Link(props) {
19
+ return universalValue(__octaneUniversalPlan1, [universalComponent("nativescript", Pressable, universalProps([[
20
+ "set",
21
+ "className",
22
+ props.className
23
+ ], [
24
+ "set",
25
+ "onPress",
26
+ () => {
27
+ Utils.openUrl(props.href);
28
+ }
29
+ ]], universalChildren("nativescript", () => {
30
+ return universalValue(__octaneUniversalPlan0, [props.children]);
31
+ })))]);
22
32
  }, { "module": "@nativescript-community/octane" });
23
33
  //#endregion
24
- export { Switch };
34
+ export { Link };
@@ -1,13 +1,35 @@
1
- import { defineUniversalComponent, universalPlan, universalValue } from "@nativescript-community/octane";
2
- //#region src/PlatformBadge.native.tsrx
3
- var __octaneUniversalPlan0 = universalPlan("nativescript", {
4
- "kind": "host",
5
- "type": "label",
6
- "props": { "text": "ios|android" },
7
- "bindings": [["className", 0]]
8
- });
9
- var PlatformBadge = defineUniversalComponent("nativescript", function PlatformBadge(props) {
10
- return universalValue(__octaneUniversalPlan0, [props.className]);
11
- }, { "module": "@nativescript-community/octane" });
1
+ import { Application, Frame } from "@nativescript/core";
2
+ //#region src/stacks.native.ts
3
+ /** Named parallel stacks. A shell (Tabs with `stack` on a spec, the app
4
+ * entry's root frame) registers its Frame here; `pushRoute` resolves the
5
+ * target by name. Native-only concept — on web, parallel stacks map to
6
+ * nested routes (one linear URL stack). 'root' needs no registration:
7
+ * unregistered, it resolves to the app's root view when that's a
8
+ * Frame — the standard `Application.run({ create: () => frame })` boot
9
+ * shape. An explicit registerStack('root', frame) overrides it. */
10
+ var stacks = /* @__PURE__ */ new Map();
11
+ var regListeners = /* @__PURE__ */ new Set();
12
+ function registerStack(name, frame) {
13
+ stacks.set(name, frame);
14
+ regListeners.forEach((l) => l(name, frame));
15
+ }
16
+ function getStack(name) {
17
+ const registered = stacks.get(name);
18
+ if (registered) return registered;
19
+ if (name === "root") {
20
+ const rv = Application.getRootView?.();
21
+ if (rv instanceof Frame) return rv;
22
+ }
23
+ }
24
+ /** All registered stacks in registration order — for hardware-back
25
+ * resolution (pop whichever stack is visibly on top). */
26
+ function stackEntries() {
27
+ return stacks.entries();
28
+ }
29
+ /** Internal: route.native attaches frame listeners as stacks appear —
30
+ * named frames can register after a useRoute subscription ran. */
31
+ function onStackRegistered(cb) {
32
+ regListeners.add(cb);
33
+ }
12
34
  //#endregion
13
- export { PlatformBadge };
35
+ export { getStack, onStackRegistered, registerStack, stackEntries };