@octane-xplat/context-menu 0.0.1 → 0.10.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2026 Alec Larson
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,123 @@
1
- # @octane-xplat/context-menu
1
+ # `@octane-xplat/context-menu`
2
2
 
3
- Version 0.0.1 is a reservation stub so the automated release can publish this package name. It has no supported API. Use a later release for the implementation.
3
+ An install boundary for platform-specific context menus: a SwiftUI
4
+ `.contextMenu` on iOS, a Material 3 `DropdownMenu` anchored to a hosted
5
+ trigger on Android, an in-page right-click menu on web, and a real
6
+ `NSMenu` on the backing view on macOS.
7
+ Install the package in the app that renders a control. Import
8
+ `SwiftUIContextMenu` from `@octane-xplat/context-menu/ios`,
9
+ `MaterialContextMenu` from `@octane-xplat/context-menu/android`,
10
+ `ContextMenu` from `@octane-xplat/context-menu/web`, or
11
+ `AppKitContextMenu` from `@octane-xplat/context-menu/macos` in the matching
12
+ platform-suffixed file. There is no shared context-menu API at the package
13
+ root.
14
+
15
+ ```tsx
16
+ /** @jsxImportSource @nativescript-community/octane */
17
+ // SwiftUIContextMenuExample.ios.tsx
18
+ import { SwiftUIContextMenu } from '@octane-xplat/context-menu/ios'
19
+ import { Text } from '@octane-xplat/ui'
20
+
21
+ export function Menu() {
22
+ return (
23
+ <SwiftUIContextMenu
24
+ trigger={() => <Text>Trip actions</Text>}
25
+ items={[{ id: 'rename', title: 'Rename' }]}
26
+ onItemSelected={(id) => console.log(id)}
27
+ />
28
+ )
29
+ }
30
+ ```
31
+
32
+ ```tsx
33
+ /** @jsxImportSource @nativescript-community/octane */
34
+ // MaterialContextMenuExample.android.tsx
35
+ import { MaterialContextMenu } from '@octane-xplat/context-menu/android'
36
+ import { Text } from '@octane-xplat/ui'
37
+
38
+ export function Menu() {
39
+ return (
40
+ <MaterialContextMenu
41
+ activation="singlePress"
42
+ trigger={() => <Text>Trip actions</Text>}
43
+ items={[{ id: 'rename', title: 'Rename' }]}
44
+ onItemSelected={(id) => console.log(id)}
45
+ />
46
+ )
47
+ }
48
+ ```
49
+
50
+ ```tsx
51
+ // ContextMenuExample.web.tsx
52
+ import { ContextMenu } from '@octane-xplat/context-menu/web'
53
+ import { Text } from '@octane-xplat/ui'
54
+
55
+ export function Menu() {
56
+ return (
57
+ <ContextMenu
58
+ activation="singlePress"
59
+ trigger={() => <Text>Trip actions</Text>}
60
+ items={[{ id: 'rename', title: 'Rename' }]}
61
+ onItemSelected={(id) => console.log(id)}
62
+ />
63
+ )
64
+ }
65
+ ```
66
+
67
+ ```tsx
68
+ // AppKitContextMenuExample.macos.tsx
69
+ import { AppKitContextMenu } from '@octane-xplat/context-menu/macos'
70
+ import { Text } from '@octane-xplat/ui'
71
+
72
+ export function Menu() {
73
+ return (
74
+ <AppKitContextMenu
75
+ trigger={() => <Text>Trip actions</Text>}
76
+ items={[{ id: 'rename', title: 'Rename' }]}
77
+ onItemSelected={(id) => console.log(id)}
78
+ />
79
+ )
80
+ }
81
+ ```
82
+
83
+ Unlike props-only leaves (picker, date-picker), this leaf exercises subtree
84
+ embedding: `trigger` is a render fn whose octane output mounts into a
85
+ detached root, and the native menu wraps that subtree — SwiftUI resolves it
86
+ through `NativeScriptViewFactory` (the same factory the swift-ui plugin's
87
+ `NativeScriptView` uses), and Android through the leaf's
88
+ `XplatViewRegistry` + `AndroidView`. Menu items cross the bridge as
89
+ serialized data (`{id, title, destructive, disabled, divider}`), reported
90
+ back through `onItemSelected(id)`.
91
+
92
+ ```tsx
93
+ /** @jsxImportSource @nativescript-community/octane */
94
+ // Actions.ios.tsx
95
+ import { SwiftUIContextMenu } from '@octane-xplat/context-menu/ios'
96
+ import { Text } from '@octane-xplat/ui'
97
+
98
+ export function Actions() {
99
+ return (
100
+ <SwiftUIContextMenu
101
+ trigger={() => <Text>Trip actions</Text>}
102
+ preview={() => <Text>Kyoto trip</Text>}
103
+ items={[{ id: 'delete', title: 'Delete', destructive: true, divider: true }]}
104
+ onItemSelected={(id) => console.log(id)}
105
+ />
106
+ )
107
+ }
108
+ ```
109
+
110
+ - iOS: long-press activation (platform native); optional `preview` render fn
111
+ (iOS 16+).
112
+ - Android: `activation` prop — `'longPress'` (default) or `'singlePress'`,
113
+ detected at parent level so interactive children in the trigger keep
114
+ their own taps.
115
+ - Web: right-click (`longPress`) or click (`singlePress`) opens the menu at
116
+ the pointer.
117
+ - macOS: right-click — the NSMenu is the view's `menu`, so AppKit owns
118
+ activation and disabled-item dimming; the trigger renders inline.
119
+
120
+ The native implementations are adapted from `@expo/ui` (MIT,
121
+ `packages/expo-ui` sdk-57): `ios/ContextMenu/ContextMenu.swift` and
122
+ `android/.../ui/menu/DropdownMenu*.kt`. Attribution headers sit on the
123
+ ported files.
@@ -0,0 +1,103 @@
1
+ import { createNativeScriptRoot, defineUniversalComponent, hookSlots, registerElement, universalPlan, universalValue, useEffect, useRef, useState } from "@nativescript-community/octane";
2
+ import { Application, GridLayout } from "@nativescript/core";
3
+ import { ComposeDataDriver, JetpackCompose, registerJetpackCompose } from "@nativescript/jetpack-compose";
4
+ //#region src/MaterialContextMenu.android.tsrx
5
+ var _hs$ = /* @__PURE__ */ hookSlots(6);
6
+ var _h$0 = /* @__PURE__ */ Symbol(_hs$);
7
+ var _h$1 = /* @__PURE__ */ Symbol(_hs$ + 1);
8
+ var _h$2 = /* @__PURE__ */ Symbol(_hs$ + 2);
9
+ var _h$3 = /* @__PURE__ */ Symbol(_hs$ + 3);
10
+ var _h$4 = /* @__PURE__ */ Symbol(_hs$ + 4);
11
+ var _h$5 = /* @__PURE__ */ Symbol(_hs$ + 5);
12
+ var __octaneUniversalPlan0 = universalPlan("nativescript", {
13
+ "kind": "range",
14
+ "children": [{
15
+ "kind": "slot",
16
+ "slot": 0
17
+ }]
18
+ });
19
+ var __octaneUniversalPlan1 = universalPlan("nativescript", {
20
+ "kind": "host",
21
+ "type": "xplatandroidcontextmenu",
22
+ "props": { "composeId": "xplat-material-contextmenu" },
23
+ "bindings": [
24
+ ["id", 0],
25
+ ["className", 1],
26
+ ["style", 2],
27
+ ["accessibilityLabel", 3],
28
+ ["data", 4],
29
+ ["onComposeEvent", 5]
30
+ ]
31
+ });
32
+ registerElement("xplatandroidcontextmenu", JetpackCompose);
33
+ registerJetpackCompose("xplat-material-contextmenu", (owner) => new ComposeDataDriver(new com.octanexplat.contextmenu.XplatContextMenuProvider(), owner));
34
+ var seq = 0;
35
+ var TriggerRoot = defineUniversalComponent("nativescript", function TriggerRoot(props) {
36
+ return universalValue(__octaneUniversalPlan0, [props.render()]);
37
+ }, { "module": "@nativescript-community/octane" });
38
+ var MaterialContextMenu = defineUniversalComponent("nativescript", function MaterialContextMenu(props) {
39
+ const triggerId = useRef("", _h$0);
40
+ if (!triggerId.current) triggerId.current = `ctxmenu${++seq}`;
41
+ const mounted = useRef(null, _h$1);
42
+ const [ready, setReady] = useState(false, _h$2);
43
+ const [expanded, setExpanded] = useState(false, _h$3);
44
+ useEffect(() => {
45
+ const host = new GridLayout();
46
+ const context = Application.android.foregroundActivity ?? Application.android.startActivity;
47
+ const nativeHost = host;
48
+ nativeHost._setupAsRootView(context);
49
+ nativeHost.callLoaded();
50
+ const root = createNativeScriptRoot(host);
51
+ root.render(TriggerRoot, { render: props.trigger });
52
+ com.octanexplat.contextmenu.XplatViewRegistry.register(triggerId.current, host.android);
53
+ mounted.current = {
54
+ host,
55
+ root
56
+ };
57
+ const open = () => setExpanded(true);
58
+ if ((props.activation ?? "longPress") === "singlePress") host.on("tap", open);
59
+ else host.on("longPress", open);
60
+ setReady(true);
61
+ return () => {
62
+ com.octanexplat.contextmenu.XplatViewRegistry.unregister(triggerId.current);
63
+ nativeHost.off();
64
+ root.unmount?.();
65
+ mounted.current = null;
66
+ setReady(false);
67
+ };
68
+ }, [], _h$4);
69
+ useEffect(() => {
70
+ mounted.current?.root?.render(TriggerRoot, { render: props.trigger });
71
+ }, [props.trigger], _h$5);
72
+ const items = props.items ?? [];
73
+ return universalValue(__octaneUniversalPlan1, [
74
+ props.id,
75
+ props.className,
76
+ props.style,
77
+ props.accessibilityLabel,
78
+ {
79
+ triggerId: ready ? triggerId.current : "",
80
+ expanded: expanded ? 1 : 0,
81
+ items: items.map((item) => ({
82
+ id: item.id,
83
+ title: item.title,
84
+ destructive: item.destructive ? 1 : 0,
85
+ disabled: item.disabled ? 1 : 0,
86
+ divider: item.divider ? 1 : 0
87
+ }))
88
+ },
89
+ (event) => {
90
+ if (event.data?.dismissed) {
91
+ setExpanded(false);
92
+ return;
93
+ }
94
+ const item = event.data?.item;
95
+ if (typeof item === "string" && item) {
96
+ setExpanded(false);
97
+ props.onItemSelected?.(item);
98
+ }
99
+ }
100
+ ]);
101
+ }, { "module": "@nativescript-community/octane" });
102
+ //#endregion
103
+ export { MaterialContextMenu };
@@ -0,0 +1,105 @@
1
+ import { createNativeScriptRoot, defineUniversalComponent, hookSlots, registerElement, universalPlan, universalValue, useEffect, useRef, useState } from "@nativescript-community/octane";
2
+ import { SwiftUI, SwiftUIManager, UIDataDriver, registerSwiftUI } from "@nativescript/swift-ui";
3
+ import { GridLayout } from "@nativescript/core";
4
+ //#region src/SwiftUIContextMenu.ios.tsrx
5
+ var _hs$ = /* @__PURE__ */ hookSlots(5);
6
+ var _h$0 = /* @__PURE__ */ Symbol(_hs$);
7
+ var _h$1 = /* @__PURE__ */ Symbol(_hs$ + 1);
8
+ var _h$2 = /* @__PURE__ */ Symbol(_hs$ + 2);
9
+ var _h$3 = /* @__PURE__ */ Symbol(_hs$ + 3);
10
+ var _h$4 = /* @__PURE__ */ Symbol(_hs$ + 4);
11
+ var __octaneUniversalPlan0 = universalPlan("nativescript", {
12
+ "kind": "range",
13
+ "children": [{
14
+ "kind": "slot",
15
+ "slot": 0
16
+ }]
17
+ });
18
+ var __octaneUniversalPlan1 = universalPlan("nativescript", {
19
+ "kind": "host",
20
+ "type": "xplatioscontextmenu",
21
+ "props": { "swiftId": "xplat-swiftui-contextmenu" },
22
+ "bindings": [
23
+ ["id", 0],
24
+ ["className", 1],
25
+ ["style", 2],
26
+ ["accessibilityLabel", 3],
27
+ ["data", 4],
28
+ ["onSwiftUIEvent", 5]
29
+ ]
30
+ });
31
+ registerElement("xplatioscontextmenu", SwiftUI);
32
+ registerSwiftUI("xplat-swiftui-contextmenu", (owner) => new UIDataDriver(new XplatContextMenuProvider(), owner));
33
+ var hosts = /* @__PURE__ */ new Map();
34
+ var roots = /* @__PURE__ */ new Map();
35
+ function mountSubtree(id, render) {
36
+ let host = hosts.get(id);
37
+ if (!host) {
38
+ host = new GridLayout();
39
+ hosts.set(id, host);
40
+ SwiftUIManager.registerNativeScriptViews({ [id]: true }, {
41
+ create: (fullId) => hosts.get(fullId.split("-")[0]),
42
+ destroy: (fullId) => {
43
+ hosts.delete(fullId.split("-")[0]);
44
+ }
45
+ });
46
+ }
47
+ let root = roots.get(id);
48
+ if (!root) {
49
+ root = createNativeScriptRoot(host);
50
+ roots.set(id, root);
51
+ }
52
+ root.render(TriggerRoot, { render });
53
+ }
54
+ function unmountSubtree(id) {
55
+ roots.get(id)?.unmount?.();
56
+ roots.delete(id);
57
+ hosts.delete(id);
58
+ }
59
+ var TriggerRoot = defineUniversalComponent("nativescript", function TriggerRoot(props) {
60
+ return universalValue(__octaneUniversalPlan0, [props.render()]);
61
+ }, { "module": "@nativescript-community/octane" });
62
+ var seq = 0;
63
+ var SwiftUIContextMenu = defineUniversalComponent("nativescript", function SwiftUIContextMenu(props) {
64
+ const triggerId = useRef("", _h$0);
65
+ if (!triggerId.current) triggerId.current = `ctxmenu${++seq}`;
66
+ const [ready, setReady] = useState(false, _h$1);
67
+ useEffect(() => {
68
+ mountSubtree(triggerId.current, props.trigger);
69
+ setReady(true);
70
+ return () => {
71
+ unmountSubtree(triggerId.current);
72
+ setReady(false);
73
+ };
74
+ }, [], _h$2);
75
+ useEffect(() => {
76
+ mountSubtree(triggerId.current, props.trigger);
77
+ }, [props.trigger], _h$3);
78
+ useEffect(() => {
79
+ if (props.preview) mountSubtree(`${triggerId.current}preview`, props.preview);
80
+ }, [props.preview], _h$4);
81
+ const items = props.items ?? [];
82
+ return universalValue(__octaneUniversalPlan1, [
83
+ props.id,
84
+ props.className,
85
+ props.style,
86
+ props.accessibilityLabel,
87
+ {
88
+ triggerId: ready ? triggerId.current : "",
89
+ previewId: ready && props.preview ? `${triggerId.current}preview` : "",
90
+ items: items.map((item) => ({
91
+ id: item.id,
92
+ title: item.title,
93
+ destructive: item.destructive ? 1 : 0,
94
+ disabled: item.disabled ? 1 : 0,
95
+ divider: item.divider ? 1 : 0
96
+ }))
97
+ },
98
+ (event) => {
99
+ const item = event.data?.item;
100
+ if (typeof item === "string" && item) props.onItemSelected?.(item);
101
+ }
102
+ ]);
103
+ }, { "module": "@nativescript-community/octane" });
104
+ //#endregion
105
+ export { SwiftUIContextMenu };
@@ -0,0 +1,2 @@
1
+ import { MaterialContextMenu } from "../MaterialContextMenu.android.tsrx.js";
2
+ export { MaterialContextMenu };
@@ -0,0 +1,2 @@
1
+ import { SwiftUIContextMenu } from "../SwiftUIContextMenu.ios.tsrx.js";
2
+ export { SwiftUIContextMenu };
@@ -0,0 +1,8 @@
1
+ {
2
+ "version": 1,
3
+ "buildId": "aabcc262-dafd-436a-be1f-5d552e134efe",
4
+ "mode": "production",
5
+ "capabilities": {
6
+ "independentHydration": false
7
+ }
8
+ }
@@ -0,0 +1,101 @@
1
+ import { Fragment, __s, bag11, child, clone, createElement, createScopedElement, createScopedValue, delegateEvents, hookSlots, positionalChildren, setAriaAttribute, setEventHandler, setStyle, sibling, template, useState } from "octane";
2
+ import { bindSignalAttribute, bindSignalChild, compilerMemoRegion, enableSignalBindings, hookMemoCreate, hookMemoPublishInvariant, setPlainAttribute } from "octane/internal/client";
3
+ //#region src/ContextMenu.web.tsrx
4
+ enableSignalBindings(1, true);
5
+ delegateEvents(["click", "contextmenu"]);
6
+ var _t$0 = /* @__PURE__ */ template("<span><!><!></span>");
7
+ var _hs$ = /* @__PURE__ */ hookSlots(1);
8
+ var ContextMenu = /* @__PURE__ */ __s(function ContextMenu(props, __s, __extra) {
9
+ const __memoRegion = compilerMemoRegion(__s, _hs$ + 0);
10
+ let __hk = __memoRegion.hooks;
11
+ if (__hk === void 0) __memoRegion.hooks = __hk = hookMemoCreate(1);
12
+ const [menu, setMenu] = useState(null, _hs$ + 0);
13
+ const items = props.items ?? [];
14
+ const openAt = __hk[0] ?? hookMemoPublishInvariant(__hk, 0, (e) => {
15
+ e.preventDefault?.();
16
+ setMenu({
17
+ x: e.clientX ?? 0,
18
+ y: e.clientY ?? 0
19
+ });
20
+ });
21
+ let _b = __s.slots[0];
22
+ if (_b === void 0) {
23
+ let _m1, _m5, _m8;
24
+ const _root = clone(_t$0);
25
+ _m1 = _root;
26
+ setEventHandler(_root, "$$contextmenu", props.activation === "singlePress" ? void 0 : openAt);
27
+ setEventHandler(_root, "$$click", props.activation === "singlePress" ? openAt : void 0);
28
+ const _el0 = child(_root);
29
+ _m5 = _el0;
30
+ _m8 = sibling(_el0, 1);
31
+ _b = bag11(__s, _root, void 0, _m1, void 0, void 0, void 0, _m5, null, void 0, _m8, null, void 0);
32
+ } else {
33
+ setEventHandler(_b.b, "$$contextmenu", props.activation === "singlePress" ? void 0 : openAt);
34
+ setEventHandler(_b.b, "$$click", props.activation === "singlePress" ? openAt : void 0);
35
+ }
36
+ _b.a = bindSignalAttribute(__s, _b.a, _b.b, "id", props.id, "b:d5b82f97", setPlainAttribute);
37
+ _b.c = bindSignalAttribute(__s, _b.c, _b.b, "class", props.className, "b:722f753c", "class");
38
+ {
39
+ const _v = {
40
+ display: "inline-block",
41
+ ...props.style ?? {}
42
+ };
43
+ if (_b.d !== _v) {
44
+ setStyle(_b.b, _v, _b.d);
45
+ _b.d = _v;
46
+ }
47
+ }
48
+ _b.e = bindSignalAttribute(__s, _b.e, _b.b, "aria-label", props.accessibilityLabel, "b:a27ad92a", setAriaAttribute);
49
+ _b.l = bindSignalChild(__s, _b.l, 1, _b.b, props.trigger(), "b:6a5a30ce", _b.f, true, void 0, void 0, void 0);
50
+ _b.m = bindSignalChild(__s, _b.m, 2, _b.b, menu && createScopedElement(Fragment, {}, () => positionalChildren([createScopedValue(() => createElement("span", {
51
+ style: {
52
+ position: "fixed",
53
+ inset: 0,
54
+ zIndex: 999
55
+ },
56
+ onClick: () => setMenu(null),
57
+ onContextMenu: (e) => {
58
+ e.preventDefault?.();
59
+ setMenu(null);
60
+ }
61
+ })), createScopedValue(() => createScopedElement("ul", {
62
+ role: "menu",
63
+ style: {
64
+ position: "fixed",
65
+ left: menu.x,
66
+ top: menu.y,
67
+ zIndex: 1e3,
68
+ margin: 0,
69
+ padding: "4px 0",
70
+ listStyle: "none",
71
+ background: "var(--menu-bg, Canvas)",
72
+ color: "var(--menu-fg, CanvasText)",
73
+ border: "1px solid color-mix(in srgb, CanvasText 20%, transparent)",
74
+ borderRadius: 8,
75
+ boxShadow: "0 6px 24px rgb(0 0 0 / 0.18)",
76
+ minWidth: 160
77
+ }
78
+ }, () => items.map((item) => createScopedElement(Fragment, {}, () => positionalChildren([item.divider && createScopedValue(() => createElement("li", {
79
+ "aria-hidden": "true",
80
+ style: {
81
+ borderTop: "1px solid color-mix(in srgb, CanvasText 15%, transparent)",
82
+ margin: "4px 0"
83
+ }
84
+ })), createScopedValue(() => createScopedElement("li", {
85
+ role: "menuitem",
86
+ "aria-disabled": item.disabled || void 0,
87
+ style: {
88
+ padding: "6px 12px",
89
+ cursor: item.disabled ? "default" : "pointer",
90
+ opacity: item.disabled ? .5 : 1,
91
+ color: item.destructive ? "crimson" : void 0
92
+ },
93
+ onClick: () => {
94
+ if (item.disabled) return;
95
+ setMenu(null);
96
+ props.onItemSelected?.(item.id);
97
+ }
98
+ }, () => item.title))])))))])), "b:fff1b948", _b.i, true, void 0, void 0, void 0);
99
+ });
100
+ //#endregion
101
+ export { ContextMenu };
@@ -0,0 +1,8 @@
1
+ {
2
+ "version": 1,
3
+ "buildId": "a81c317f-21ce-4c84-937e-7a3b39496cf0",
4
+ "mode": "production",
5
+ "capabilities": {
6
+ "independentHydration": false
7
+ }
8
+ }
@@ -0,0 +1,2 @@
1
+ import { ContextMenu } from "../ContextMenu.web.tsrx.js";
2
+ export { ContextMenu };
package/package.json CHANGED
@@ -1,18 +1,74 @@
1
1
  {
2
2
  "name": "@octane-xplat/context-menu",
3
- "version": "0.0.1",
3
+ "version": "0.10.0",
4
4
  "description": "Platform-specific context menu controls for Octane xplat",
5
5
  "repository": {
6
6
  "type": "git",
7
- "url": "https://github.com/octane-xplat/octane-xplat.git",
7
+ "url": "https://github.com/octane-xplat/octane-xplat",
8
8
  "directory": "packages/context-menu"
9
9
  },
10
- "homepage": "https://github.com/octane-xplat/octane-xplat/tree/main/packages/context-menu",
11
- "main": "./index.js",
12
- "types": "./index.d.ts",
13
10
  "files": [
14
- "README.md",
15
- "index.js",
16
- "index.d.ts"
17
- ]
18
- }
11
+ "dist",
12
+ "types",
13
+ "src",
14
+ "platforms"
15
+ ],
16
+ "type": "module",
17
+ "exports": {
18
+ "./ios": {
19
+ "types": "./types/ios/index.d.ts",
20
+ "native": "./dist/native/ios/index.js"
21
+ },
22
+ "./android": {
23
+ "types": "./types/android/index.d.ts",
24
+ "native": "./dist/native/android/index.js"
25
+ },
26
+ "./web": {
27
+ "types": "./types/web/index.d.ts",
28
+ "web": "./dist/web/web/index.js"
29
+ }
30
+ },
31
+ "publishConfig": {
32
+ "access": "public"
33
+ },
34
+ "dependencies": {
35
+ "@nativescript/jetpack-compose": "1.0.0-beta.0",
36
+ "@nativescript/swift-ui": "4.0.2"
37
+ },
38
+ "devDependencies": {
39
+ "@nativescript-community/octane": "0.2.4",
40
+ "@nativescript/core": "9.1.2",
41
+ "@octanejs/vite-plugin": "0.1.60",
42
+ "octane": "0.5.0",
43
+ "tsrx-typegen": "0.2.2",
44
+ "typescript": "5.9.3",
45
+ "vite": "8.3.0"
46
+ },
47
+ "peerDependencies": {
48
+ "@nativescript-community/octane": ">=0.2.1 <1",
49
+ "@nativescript/core": ">=9.1.0 <10",
50
+ "octane": ">=0.1.51 <1"
51
+ },
52
+ "peerDependenciesMeta": {
53
+ "@nativescript-community/octane": {
54
+ "optional": true
55
+ },
56
+ "@nativescript/core": {
57
+ "optional": true
58
+ },
59
+ "octane": {
60
+ "optional": true
61
+ }
62
+ },
63
+ "nativescript": {
64
+ "platforms": {
65
+ "android": "9.1.0",
66
+ "ios": "9.1.0"
67
+ }
68
+ },
69
+ "scripts": {
70
+ "build": "vite build && vite build --mode native && tsc -p tsconfig.types.json",
71
+ "test:packed": "node tests/packed-consumer.mjs",
72
+ "pack:check": "tsrx-typegen --pack-check"
73
+ }
74
+ }
@@ -0,0 +1,15 @@
1
+ apply plugin: 'org.jetbrains.kotlin.plugin.compose'
2
+
3
+ android {
4
+ buildFeatures {
5
+ compose true
6
+ }
7
+ kotlinOptions {
8
+ jvmTarget = '17'
9
+ }
10
+ }
11
+
12
+ dependencies {
13
+ implementation platform('androidx.compose:compose-bom:2024.12.01')
14
+ implementation 'androidx.compose.material3:material3'
15
+ }