@octane-xplat/ui 0.3.0 → 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 (123) 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 -40
  4. package/dist/native/ui10.js +20 -11
  5. package/dist/native/ui11.js +42 -109
  6. package/dist/native/ui12.js +17 -84
  7. package/dist/native/ui13.js +11 -41
  8. package/dist/native/ui14.js +118 -76
  9. package/dist/native/ui15.js +43 -92
  10. package/dist/native/ui16.js +106 -45
  11. package/dist/native/ui17.js +29 -42
  12. package/dist/native/ui18.js +34 -53
  13. package/dist/native/ui19.js +246 -32
  14. package/dist/native/ui20.js +27 -16
  15. package/dist/native/ui21.js +376 -86
  16. package/dist/native/ui22.js +26 -114
  17. package/dist/native/ui23.js +49 -97
  18. package/dist/native/ui24.js +78 -53
  19. package/dist/native/ui25.js +138 -16
  20. package/dist/native/ui26.js +8 -23
  21. package/dist/native/ui27.js +60 -34
  22. package/dist/native/ui28.js +36 -142
  23. package/dist/native/ui29.js +101 -21
  24. package/dist/native/ui30.js +14 -31
  25. package/dist/native/ui31.js +55 -36
  26. package/dist/native/ui32.js +49 -61
  27. package/dist/native/ui33.js +36 -28
  28. package/dist/native/ui34.js +51 -8
  29. package/dist/native/ui35.js +98 -20
  30. package/dist/native/ui36.js +9 -33
  31. package/dist/native/ui37.js +42 -15
  32. package/dist/native/ui38.js +186 -57
  33. package/dist/native/ui39.js +96 -24
  34. package/dist/native/ui4.js +22 -20
  35. package/dist/native/ui40.js +57 -13
  36. package/dist/native/ui41.js +15 -100
  37. package/dist/native/ui42.js +6 -146
  38. package/dist/native/ui43.js +37 -21
  39. package/dist/native/ui44.js +265 -6
  40. package/dist/native/ui45.js +28 -0
  41. package/dist/native/ui46.js +35 -0
  42. package/dist/native/ui47.js +41 -0
  43. package/dist/native/ui48.js +72 -0
  44. package/dist/native/ui49.js +66 -0
  45. package/dist/native/ui5.js +37 -77
  46. package/dist/native/ui50.js +27 -0
  47. package/dist/native/ui51.js +13 -0
  48. package/dist/native/ui52.js +92 -0
  49. package/dist/native/ui53.js +34 -0
  50. package/dist/native/ui54.js +17 -0
  51. package/dist/native/ui55.js +156 -0
  52. package/dist/native/ui56.js +33 -0
  53. package/dist/native/ui57.js +14 -0
  54. package/dist/native/ui58.js +22 -0
  55. package/dist/native/ui59.js +8 -0
  56. package/dist/native/ui6.js +52 -9
  57. package/dist/native/ui60.js +108 -0
  58. package/dist/native/ui61.js +76 -0
  59. package/dist/native/ui7.js +42 -26
  60. package/dist/native/ui8.js +22 -12
  61. package/dist/native/ui9.js +18 -9
  62. package/dist/web/octane-client-build.json +1 -1
  63. package/dist/web/ui.js +51 -40
  64. package/dist/web/ui10.js +33 -186
  65. package/dist/web/ui11.js +28 -409
  66. package/dist/web/ui12.js +21 -68
  67. package/dist/web/ui13.js +201 -97
  68. package/dist/web/ui14.js +85 -95
  69. package/dist/web/ui15.js +368 -25
  70. package/dist/web/ui16.js +13 -101
  71. package/dist/web/ui17.js +246 -42
  72. package/dist/web/ui18.js +237 -28
  73. package/dist/web/ui19.js +36 -10
  74. package/dist/web/ui20.js +73 -102
  75. package/dist/web/ui21.js +102 -73
  76. package/dist/web/ui22.js +95 -55
  77. package/dist/web/ui23.js +94 -55
  78. package/dist/web/ui24.js +31 -15
  79. package/dist/web/ui25.js +105 -19
  80. package/dist/web/ui26.js +29 -23
  81. package/dist/web/ui27.js +12 -123
  82. package/dist/web/ui28.js +9 -110
  83. package/dist/web/ui29.js +52 -102
  84. package/dist/web/ui3.js +29 -18
  85. package/dist/web/ui30.js +32 -41
  86. package/dist/web/ui31.js +120 -39
  87. package/dist/web/ui32.js +41 -74
  88. package/dist/web/ui33.js +148 -32
  89. package/dist/web/ui34.js +54 -51
  90. package/dist/web/ui35.js +55 -7
  91. package/dist/web/ui36.js +18 -41
  92. package/dist/web/ui37.js +6 -46
  93. package/dist/web/ui38.js +37 -16
  94. package/dist/web/ui39.js +135 -81
  95. package/dist/web/ui4.js +46 -152
  96. package/dist/web/ui40.js +39 -37
  97. package/dist/web/ui41.js +41 -16
  98. package/dist/web/ui42.js +74 -7
  99. package/dist/web/ui43.js +40 -20
  100. package/dist/web/ui44.js +60 -6
  101. package/dist/web/ui45.js +9 -0
  102. package/dist/web/ui46.js +45 -0
  103. package/dist/web/ui47.js +13 -0
  104. package/dist/web/ui48.js +63 -0
  105. package/dist/web/ui49.js +47 -0
  106. package/dist/web/ui5.js +131 -27
  107. package/dist/web/ui50.js +17 -0
  108. package/dist/web/ui51.js +149 -0
  109. package/dist/web/ui52.js +42 -0
  110. package/dist/web/ui53.js +17 -0
  111. package/dist/web/ui54.js +9 -0
  112. package/dist/web/ui55.js +22 -0
  113. package/dist/web/ui56.js +8 -0
  114. package/dist/web/ui57.js +44 -0
  115. package/dist/web/ui58.js +46 -0
  116. package/dist/web/ui6.js +81 -45
  117. package/dist/web/ui7.js +43 -21
  118. package/dist/web/ui8.js +27 -21
  119. package/dist/web/ui9.js +29 -18
  120. package/package.json +13 -4
  121. package/src/theme/tokens.css +369 -138
  122. package/types/index.d.ts +102 -58
  123. package/types/props.d.ts +233 -13
@@ -1,22 +1,24 @@
1
- //#region src/layout-child.native.ts
2
- /** NativeScript reads these attributes from each child view during parent
3
- * layout. Values are forwarded with NativeScript's own property names. */
4
- function layoutChildProps(props) {
5
- const result = {};
6
- for (const key of [
7
- "row",
8
- "col",
9
- "rowSpan",
10
- "colSpan",
11
- "dock",
12
- "left",
13
- "top",
14
- "flexGrow",
15
- "flexShrink",
16
- "alignSelf",
17
- "order"
18
- ]) if (props[key] !== void 0) result[key] = props[key];
19
- return result;
1
+ //#region src/glass.ts
2
+ /** Normalize the `glass` surface prop into the config object handed to
3
+ * `iosGlassEffect` on native. Always returns an object — the upstream
4
+ * string shorthand silently drops `interactive` on the layout's update
5
+ * path, and an empty config defaults the variant to 'regular' here rather
6
+ * than upstream's own fallback. `false`/'none'/'identity' → no glass. */
7
+ function glassConfigOf(glass) {
8
+ if (!glass || glass === "none" || glass === "identity") return;
9
+ const c = typeof glass === "string" ? { variant: glass } : glass === true ? {} : glass;
10
+ if (c.variant === "none" || c.variant === "identity") return;
11
+ return {
12
+ variant: "regular",
13
+ ...c
14
+ };
15
+ }
16
+ /** `vx-glass` classes shared by web (real styling) and native (hook for
17
+ * app-supplied fallback CSS on non-glass OSes). */
18
+ function glassClassOf(glass) {
19
+ const c = glassConfigOf(glass);
20
+ if (!c) return;
21
+ return c.variant === "clear" ? "vx-glass vx-glass--clear" : "vx-glass";
20
22
  }
21
23
  //#endregion
22
- export { layoutChildProps };
24
+ export { glassClassOf, glassConfigOf };
@@ -1,14 +1,58 @@
1
- import { cx } from "./ui2.js";
2
- import { defineUniversalComponent, universalPlan, universalValue } from "@nativescript-community/octane";
3
- //#region src/PlatformBadge.native.tsrx
4
- var __octaneUniversalPlan0 = universalPlan("nativescript", {
5
- "kind": "host",
6
- "type": "label",
7
- "props": { "text": "ios|android" },
8
- "bindings": [["className", 0]]
9
- });
10
- var PlatformBadge = defineUniversalComponent("nativescript", function PlatformBadge(props) {
11
- return universalValue(__octaneUniversalPlan0, [cx(props.className)]);
12
- }, { "module": "@nativescript-community/octane" });
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
+ }
13
57
  //#endregion
14
- export { PlatformBadge };
58
+ export { useAnimation };
@@ -1,104 +1,19 @@
1
- //#region src/route-table.ts
2
- var EXT = /\.(tsrx|tsx|ts|mts|cts|js|mjs|cjs|jsx)$/;
3
- var SUFFIX = /\.(web|native|ios|android)$/;
4
- var PARAM = /^\[(.+)\]$/;
5
- /** Component pick rule for route/layout modules: default export, then a
6
- * `screen` named export, then a single function export. Route files use
7
- * named exports (decision #13) — a lone component is unambiguous. */
8
- function pick(mod, file) {
9
- if (typeof mod?.default === "function") return mod.default;
10
- if (typeof mod?.screen === "function") return mod.screen;
11
- const fns = Object.keys(mod ?? {}).filter((k) => typeof mod[k] === "function");
12
- if (fns.length === 1) return mod[fns[0]];
13
- console.warn("[octane-xplat] route file " + file + (fns.length ? ` has ${fns.length} component-shaped exports (${fns.join(", ")}) — add a default or 'screen' export` : " has no component export") + " — skipped");
14
- }
15
- function deriveRouteManifest(files, prefer, dir = "app") {
16
- const prefix = dir.replace(/^\.?\/?/, "").replace(/\/+$/, "") + "/";
17
- const seen = /* @__PURE__ */ new Map();
18
- const layoutRank = /* @__PURE__ */ new Map();
19
- const layouts = {};
20
- const warned = /* @__PURE__ */ new Set();
21
- for (const key of Object.keys(files).sort()) {
22
- let rel = key.replace(/^\.?\//, "");
23
- if (rel.startsWith(prefix)) rel = rel.slice(prefix.length);
24
- rel = rel.replace(EXT, "");
25
- const parts = rel.split("/");
26
- let base = parts[parts.length - 1];
27
- const sm = SUFFIX.exec(base);
28
- const suffix = sm?.[1];
29
- if (sm) base = base.slice(0, base.length - sm[0].length);
30
- if (suffix && !prefer.includes(suffix)) continue;
31
- const rank = suffix ? prefer.indexOf(suffix) : prefer.length;
32
- if (base === "_layout") {
33
- const d = parts.slice(0, -1).join("/");
34
- const prev = layoutRank.get(d);
35
- if (prev !== void 0 && prev <= rank) continue;
36
- const component = pick(files[key], key);
37
- if (component) {
38
- layouts[d] = component;
39
- layoutRank.set(d, rank);
40
- }
41
- continue;
42
- }
43
- const segs = parts.slice(0, -1).concat(base);
44
- if (segs[segs.length - 1] === "index") segs.pop();
45
- const segments = segs.map((s) => {
46
- const p = PARAM.exec(s);
47
- return p ? ":" + p[1] : s;
48
- });
49
- const name = segments.join("/") || "index";
50
- const meta = {
51
- name,
52
- segments,
53
- params: segments.filter((s) => s.startsWith(":")).map((s) => s.slice(1)),
54
- file: key
55
- };
56
- const prev = seen.get(name);
57
- if (prev && prev.rank <= rank) {
58
- if (prev.rank === rank && !warned.has(name)) {
59
- warned.add(name);
60
- console.warn(`[octane-xplat] route '${name}' is defined by both ${prev.meta.file} and ${key} — keeping ${prev.meta.file}`);
61
- }
62
- continue;
1
+ import "@nativescript-community/octane";
2
+ import { defineUniversalComponent as defineUniversalComponent$1, universalComponent as universalComponent$1 } from "octane/universal/native";
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];
63
11
  }
64
- const component = pick(files[key], key);
65
- if (component) seen.set(name, {
66
- rank,
67
- meta,
68
- component
69
- });
12
+ if (props.className) cls.push(props.className);
13
+ rest.className = cls;
14
+ return universalComponent$1("nativescript", Base, rest);
70
15
  }
71
- const screens = {};
72
- const routes = [];
73
- for (const { meta, component } of seen.values()) {
74
- screens[meta.name] = component;
75
- routes.push(meta);
76
- }
77
- routes.sort((a, b) => b.segments.reduce((n, s) => n + (s.startsWith(":") ? 1 : 2), 0) - a.segments.reduce((n, s) => n + (s.startsWith(":") ? 1 : 2), 0) || a.name.localeCompare(b.name));
78
- return {
79
- screens,
80
- routes,
81
- layouts
82
- };
83
- }
84
- /** Serialize a Route to a URL path (no origin): manifest routes substitute
85
- * `:param` segments from params (leftover params → query string);
86
- * non-manifest names keep the legacy `/<stack>/<name>?params` shape. */
87
- function buildRoutePath(routes, r) {
88
- const meta = routes.find((m) => m.name === r.name);
89
- let segs;
90
- let rest = r.params;
91
- if (meta) {
92
- segs = meta.segments.map((s) => {
93
- if (!s.startsWith(":")) return s;
94
- const v = r.params[s.slice(1)];
95
- if (v === void 0) console.warn(`[octane-xplat] route '${r.name}' pushed without path param ${s}`);
96
- return encodeURIComponent(String(v ?? ""));
97
- });
98
- rest = Object.fromEntries(Object.entries(r.params).filter(([k]) => !meta.params.includes(k)));
99
- } else segs = [r.name];
100
- const q = Object.entries(rest).map(([k, v]) => encodeURIComponent(k) + "=" + encodeURIComponent(String(v))).join("&");
101
- return (((r.stack === "root" ? "" : "/" + r.stack) + "/" + segs.join("/")).replace(/\/+$/, "") || "/") + (q ? "?" + q : "");
16
+ return defineUniversalComponent$1("nativescript", Styled);
102
17
  }
103
18
  //#endregion
104
- export { buildRoutePath, deriveRouteManifest };
19
+ export { styled };
@@ -1,148 +1,8 @@
1
- import { getStack, onStackRegistered, stackEntries } from "./ui27.js";
2
- import { buildRoutePath } from "./ui41.js";
3
- import { createNativeScriptRoot } from "@nativescript-community/octane";
4
- import { Application, GridLayout, Page } from "@nativescript/core";
5
- import { hookSlots as hookSlots$1, useSyncExternalStore as useSyncExternalStore$1 } from "octane";
6
- //#region src/route.native.ts
7
- /** Native twin of route.web — same Route contract over Frame/Page stacks.
8
- * `pushRoute` resolves a stack ('root' = the app's root Frame — an
9
- * explicit registerStack('root') or, by default, the Frame returned by
10
- * Application.getRootView(); named stacks come from TabSpec.stack panes
11
- * or registerStack) and pushes a Page hosting the registered screen —
12
- * each pushed Page is its own Octane root (decision #9: pages never
13
- * share context with their presenter). Params land as props; named-stack
14
- * pushes get `_stack` injected so the screen can popRoute its own stack.
15
- *
16
- * Registration contract (the footgun this module exists to defuse):
17
- * - `registerScreens(table)` once — pushRoute resolves `name` through it.
18
- * - 'root' needs nothing when the app boots a Frame as its root view
19
- * (the standard shape); non-Frame roots can't host pushes at all.
20
- * - named stacks register via `TabSpec.stack` or `registerStack`.
21
- * Every drop path warns loudly — silent no-ops are how apps ship a
22
- * default route on native while working fine on web. */
23
- var screens = {};
24
- var routes = [];
25
- /** Register the app's name → screen table (call once, from the shared
26
- * routes module). Native `pushRoute` resolves `route.name` through it;
27
- * on web the table feeds `screenFor` for outlets without a
28
- * `resolveScreen` prop. `manifest` (from deriveRouteManifest) is stored
29
- * for parity — the web leaf matches URLs through it; native navigation
30
- * is name+params and only needs the table. */
31
- function registerScreens(table, manifest) {
32
- screens = table;
33
- routes = manifest ?? [];
1
+ import { Application } from "@nativescript/core";
2
+ //#region src/windows.native.ts
3
+ /** Open another NativeScript window and pass app-owned data to its resolver. */
4
+ function openWindow(options = {}) {
5
+ Application.openWindow(options);
34
6
  }
35
- /** One-call registration for route-dir apps — screens + URL patterns +
36
- * layouts all come from deriveRouteManifest. */
37
- function registerRoutes(manifest) {
38
- registerScreens(manifest.screens, manifest.routes);
39
- }
40
- function screenFor(name) {
41
- return screens[name];
42
- }
43
- var tracked = /* @__PURE__ */ new WeakSet();
44
- var listeners = /* @__PURE__ */ new Set();
45
- var pageRoutes = /* @__PURE__ */ new WeakMap();
46
- var warned = /* @__PURE__ */ new Set();
47
- function emit() {
48
- listeners.forEach((l) => l());
49
- }
50
- function warnOnce(key, msg) {
51
- if (warned.has(key)) return;
52
- warned.add(key);
53
- console.warn("[octane-xplat] " + msg);
54
- }
55
- /** Attach the route-store emission hook once per frame. `navigatedTo`
56
- * fires on push AND on pop (the revealed page re-fires it), so one
57
- * listener keeps every useRoute snapshot honest. */
58
- function trackFrame(frame) {
59
- if (tracked.has(frame)) return;
60
- tracked.add(frame);
61
- frame.on("navigatedTo", emit);
62
- }
63
- function resolveStack(stack) {
64
- const frame = getStack(stack);
65
- if (frame) trackFrame(frame);
66
- return frame;
67
- }
68
- onStackRegistered((_name, frame) => {
69
- trackFrame(frame);
70
- emit();
71
- });
72
- function pushRoute(r) {
73
- const frame = resolveStack(r.stack);
74
- if (!frame) {
75
- warnOnce("stack:" + r.stack, r.stack === "root" ? `pushRoute('${r.name}') dropped — no root Frame. Boot with a Frame as the app root (Application.run create() returning new Frame) or call registerStack('root', frame).` : `pushRoute('${r.name}') dropped — no stack '${r.stack}' is registered. Named stacks come from TabSpec.stack on <Tabs> or registerStack('${r.stack}', frame).`);
76
- return;
77
- }
78
- const C = screenFor(r.name);
79
- if (!C) {
80
- warnOnce("screen:" + r.name, `pushRoute('${r.name}') dropped — '${r.name}' isn't in the screen table. Call registerScreens({ ${r.name}: ... }) at boot.`);
81
- return;
82
- }
83
- if (Application.android && r.stack !== "root") warnOnce("android:" + r.stack, `pushRoute into named stack '${r.stack}' on Android — upstream #11444: the page mounts but currentPage/backStack/goBack never land (pages accumulate). Named-stack pushes are iOS-only until fixed.`);
84
- if (!frame.isLoaded) frame.callLoaded?.();
85
- const props = r.stack === "root" ? r.params : {
86
- ...r.params,
87
- _stack: r.stack
88
- };
89
- try {
90
- frame.navigate({ create: () => {
91
- const page = new Page();
92
- page.id = r.name + "-page";
93
- page.actionBarHidden = true;
94
- pageRoutes.set(page, r);
95
- const host = new GridLayout();
96
- page.content = host;
97
- createNativeScriptRoot(host).render(C, props);
98
- return page;
99
- } });
100
- } catch (e) {
101
- console.warn("[octane-xplat] pushRoute(" + r.name + ") threw: " + e?.message);
102
- }
103
- }
104
- /** Pop the top page of a stack ('root' default). Quiet no-op at the base
105
- * page — matching web, where back at the app root is a no-op; loud only
106
- * when the stack itself doesn't exist. */
107
- function popRoute(stack = "root") {
108
- const frame = resolveStack(stack);
109
- if (!frame) {
110
- warnOnce("pop:" + stack, `popRoute('${stack}') dropped — no such stack is registered.`);
111
- return;
112
- }
113
- frame.goBack();
114
- }
115
- /** Route stamped on a stack's current page, or null at its base page. */
116
- function routeFor(stack) {
117
- const page = resolveStack(stack)?.currentPage;
118
- return (page && pageRoutes.get(page)) ?? null;
119
- }
120
- /** The top route across stacks — root's current route wins (a root push
121
- * covers the shell); otherwise the most recently registered named stack
122
- * showing a pushed page. Native has no boot URL, so this is an
123
- * approximation of web's "current URL route", not a deep link. */
124
- function currentRoute() {
125
- const root = routeFor("root");
126
- if (root) return root;
127
- const named = [...stackEntries()].reverse();
128
- for (const [name] of named) {
129
- const r = routeFor(name);
130
- if (r) return r;
131
- }
132
- return null;
133
- }
134
- /** Path-string parity for the web leaf's hrefFor — a canonical
135
- * /<stack>/<path> rendering of the route (deep-linking consumes it
136
- * there). Native navigation itself is name+params, not URLs. */
137
- function hrefFor(r) {
138
- return buildRoutePath(routes, r);
139
- }
140
- function useRoute(stack) {
141
- return useSyncExternalStore$1((cb) => {
142
- listeners.add(cb);
143
- return () => listeners.delete(cb);
144
- }, () => routeFor(stack), _h$0);
145
- }
146
- var _h$0 = /* @__PURE__ */ Symbol(/* @__PURE__ */ hookSlots$1(1));
147
7
  //#endregion
148
- export { currentRoute, hrefFor, popRoute, pushRoute, registerRoutes, registerScreens, routeFor, screenFor, useRoute };
8
+ export { openWindow };
@@ -1,22 +1,38 @@
1
- //#region src/store.ts
2
- function createStore(initial) {
3
- let value = initial;
4
- const listeners = /* @__PURE__ */ new Set();
5
- return {
6
- get: () => value,
7
- set(next) {
8
- const v = typeof next === "function" ? next(value) : next;
9
- if (Object.is(v, value)) return;
10
- value = v;
11
- for (const l of [...listeners]) l();
12
- },
13
- subscribe(notify) {
14
- listeners.add(notify);
15
- return () => {
16
- listeners.delete(notify);
17
- };
18
- }
19
- };
20
- }
1
+ import { cx } from "./ui2.js";
2
+ import { applyEscapeProps } from "./ui3.js";
3
+ import { registerRootLayout, unregisterRootLayout } from "./ui34.js";
4
+ import { defineUniversalComponent, universalPlan, universalValue } from "@nativescript-community/octane";
5
+ //#region src/Screen.native.tsrx
6
+ var __octaneUniversalPlan0 = universalPlan("nativescript", {
7
+ "kind": "host",
8
+ "type": "rootlayout",
9
+ "bindings": [
10
+ ["id", 0],
11
+ ["ref", 1],
12
+ ["onLoaded", 2],
13
+ ["onUnloaded", 3]
14
+ ],
15
+ "children": [{
16
+ "kind": "host",
17
+ "type": "flexboxlayout",
18
+ "props": { "flexDirection": "column" },
19
+ "bindings": [["className", 4], ["style", 5]],
20
+ "children": [{
21
+ "kind": "slot",
22
+ "slot": 6
23
+ }]
24
+ }]
25
+ });
26
+ var Screen = defineUniversalComponent("nativescript", function Screen(props) {
27
+ return universalValue(__octaneUniversalPlan0, [
28
+ props.id,
29
+ (v) => applyEscapeProps(v, props),
30
+ (e) => registerRootLayout(e.object),
31
+ (e) => unregisterRootLayout(e.object),
32
+ cx(props.className),
33
+ props.style,
34
+ props.children
35
+ ]);
36
+ }, { "module": "@nativescript-community/octane" });
21
37
  //#endregion
22
- export { createStore };
38
+ export { Screen };