@octane-xplat/context-menu 0.12.0 → 0.14.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/README.md CHANGED
@@ -1,16 +1,16 @@
1
1
  # `@octane-xplat/context-menu`
2
2
 
3
- An install boundary for platform-specific context menus: a SwiftUI
3
+ Platform-specific context menus for Octane xplat apps: a SwiftUI
4
4
  `.contextMenu` on iOS, a Material 3 `DropdownMenu` anchored to a hosted
5
5
  trigger on Android, an in-page right-click menu on web, and a real
6
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.
7
+
8
+ There is no shared context-menu component. Install the package in the app
9
+ that renders a control, then import `SwiftUIContextMenu` from
10
+ `@octane-xplat/context-menu/ios`, `MaterialContextMenu` from
11
+ `@octane-xplat/context-menu/android`, `ContextMenu` from
12
+ `@octane-xplat/context-menu/web`, or `AppKitContextMenu` from
13
+ `@octane-xplat/context-menu/macos` in the matching platform-suffixed file.
14
14
 
15
15
  ```tsx
16
16
  /** @jsxImportSource @nativescript-community/octane */
@@ -80,14 +80,9 @@ export function Menu() {
80
80
  }
81
81
  ```
82
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)`.
83
+ Menu items are plain data (`{id, title, destructive, disabled, divider}`),
84
+ reported back through `onItemSelected(id)`. The iOS entry also accepts an
85
+ optional `preview` render function (iOS 16+):
91
86
 
92
87
  ```tsx
93
88
  /** @jsxImportSource @nativescript-community/octane */
@@ -117,6 +112,15 @@ export function Actions() {
117
112
  - macOS: right-click — the NSMenu is the view's `menu`, so AppKit owns
118
113
  activation and disabled-item dimming; the trigger renders inline.
119
114
 
115
+ ## How the native menus work
116
+
117
+ Unlike props-only leaves (picker, date-picker), this leaf exercises subtree
118
+ embedding: `trigger` is a render fn whose octane output mounts into a
119
+ detached root, and the native menu wraps that subtree — SwiftUI resolves it
120
+ through `NativeScriptViewFactory` (the same factory the swift-ui plugin's
121
+ `NativeScriptView` uses), and Android through the leaf's
122
+ `XplatViewRegistry` + `AndroidView`.
123
+
120
124
  The native implementations are adapted from `@expo/ui` (MIT,
121
125
  `packages/expo-ui` sdk-57): `ios/ContextMenu/ContextMenu.swift` and
122
126
  `android/.../ui/menu/DropdownMenu*.kt`. Attribution headers sit on the
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 1,
3
- "buildId": "d13cc8af-0c44-4659-a3bd-641220741dc7",
3
+ "buildId": "dc23e660-8325-4916-bab2-b32789bfd2dc",
4
4
  "mode": "production",
5
5
  "capabilities": {
6
6
  "independentHydration": false
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 1,
3
- "buildId": "9502ea5b-1fb9-47a8-ac95-6fd30909da83",
3
+ "buildId": "ff7e0eb0-e1ff-4ede-b798-2d9ec70fb4f9",
4
4
  "mode": "production",
5
5
  "capabilities": {
6
6
  "independentHydration": false
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@octane-xplat/context-menu",
3
- "version": "0.12.0",
3
+ "version": "0.14.0",
4
4
  "description": "Platform-specific context menu controls for Octane xplat",
5
5
  "repository": {
6
6
  "type": "git",