@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 +21 -0
- package/README.md +122 -2
- package/dist/native/MaterialContextMenu.android.tsrx.js +103 -0
- package/dist/native/SwiftUIContextMenu.ios.tsrx.js +105 -0
- package/dist/native/android/index.js +2 -0
- package/dist/native/ios/index.js +2 -0
- package/dist/native/octane-client-build.json +8 -0
- package/dist/web/ContextMenu.web.tsrx.js +101 -0
- package/dist/web/octane-client-build.json +8 -0
- package/dist/web/web/index.js +2 -0
- package/package.json +66 -10
- package/platforms/android/include.gradle +15 -0
- package/platforms/android/java/com/octanexplat/contextmenu/XplatContextMenuProvider.kt +158 -0
- package/platforms/ios/src/XplatContextMenuProvider.swift +123 -0
- package/src/AppKitContextMenu.macos.tsrx +33 -0
- package/src/ContextMenu.web.tsrx +84 -0
- package/src/MaterialContextMenu.android.tsrx +125 -0
- package/src/SwiftUIContextMenu.ios.tsrx +127 -0
- package/src/android/index.ts +6 -0
- package/src/android/types.ts +26 -0
- package/src/ios/index.ts +2 -0
- package/src/ios/types.ts +25 -0
- package/src/macos/index.ts +2 -0
- package/src/macos/types.ts +24 -0
- package/src/web/index.ts +2 -0
- package/src/web/types.ts +21 -0
- package/types/android/index.d.ts +22 -0
- package/types/ios/index.d.ts +20 -0
- package/types/macos/index.d.ts +19 -0
- package/types/web/index.d.ts +22 -0
- package/index.d.ts +0 -1
- package/index.js +0 -2
package/src/ios/types.ts
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/** One row of serialized menu content carried over the bridge. */
|
|
2
|
+
export interface SwiftUIContextMenuItem {
|
|
3
|
+
/** Stable id reported to `onItemSelected`. */
|
|
4
|
+
id: string
|
|
5
|
+
title: string
|
|
6
|
+
/** Renders the item with .destructive role. */
|
|
7
|
+
destructive?: boolean
|
|
8
|
+
disabled?: boolean
|
|
9
|
+
/** Render a divider before this item. */
|
|
10
|
+
divider?: boolean
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface SwiftUIContextMenuProps {
|
|
14
|
+
id?: string
|
|
15
|
+
className?: any
|
|
16
|
+
style?: any
|
|
17
|
+
items?: readonly SwiftUIContextMenuItem[]
|
|
18
|
+
/** Render fn producing the activation element — hosted inside the
|
|
19
|
+
* SwiftUI tree via the plugin's NativeScriptView-by-id factory. */
|
|
20
|
+
trigger: () => any
|
|
21
|
+
/** Optional preview shown while the menu opens (iOS 16+). */
|
|
22
|
+
preview?: () => any
|
|
23
|
+
onItemSelected?: (id: string) => void
|
|
24
|
+
accessibilityLabel?: string
|
|
25
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/** One row of serialized menu content carried over the bridge. */
|
|
2
|
+
export interface AppKitContextMenuItem {
|
|
3
|
+
/** Stable id reported to `onItemSelected`. */
|
|
4
|
+
id: string
|
|
5
|
+
title: string
|
|
6
|
+
/** No AppKit destructive role — kept in the contract for parity; the
|
|
7
|
+
* item renders as a normal menu row. */
|
|
8
|
+
destructive?: boolean
|
|
9
|
+
disabled?: boolean
|
|
10
|
+
/** Render a divider before this item. */
|
|
11
|
+
divider?: boolean
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface AppKitContextMenuProps {
|
|
15
|
+
id?: string
|
|
16
|
+
className?: any
|
|
17
|
+
style?: any
|
|
18
|
+
items?: readonly AppKitContextMenuItem[]
|
|
19
|
+
/** Render fn producing the trigger element — rendered inline; the NSMenu
|
|
20
|
+
* attaches to the host's backing NSView. */
|
|
21
|
+
trigger: () => any
|
|
22
|
+
onItemSelected?: (id: string) => void
|
|
23
|
+
accessibilityLabel?: string
|
|
24
|
+
}
|
package/src/web/index.ts
ADDED
package/src/web/types.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export type ContextMenuActivation = 'longPress' | 'singlePress'
|
|
2
|
+
|
|
3
|
+
export interface ContextMenuItem {
|
|
4
|
+
id: string
|
|
5
|
+
title: string
|
|
6
|
+
destructive?: boolean
|
|
7
|
+
disabled?: boolean
|
|
8
|
+
divider?: boolean
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface ContextMenuProps {
|
|
12
|
+
id?: string
|
|
13
|
+
className?: any
|
|
14
|
+
style?: any
|
|
15
|
+
/** 'longPress' maps to right-click (contextmenu); 'singlePress' to click. */
|
|
16
|
+
activation?: ContextMenuActivation
|
|
17
|
+
items?: readonly ContextMenuItem[]
|
|
18
|
+
trigger: () => any
|
|
19
|
+
onItemSelected?: (id: string) => void
|
|
20
|
+
accessibilityLabel?: string
|
|
21
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export type MaterialContextMenuActivation = 'longPress' | 'singlePress'
|
|
2
|
+
|
|
3
|
+
export interface MaterialContextMenuItem {
|
|
4
|
+
id: string
|
|
5
|
+
title: string
|
|
6
|
+
destructive?: boolean
|
|
7
|
+
disabled?: boolean
|
|
8
|
+
divider?: boolean
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface MaterialContextMenuProps {
|
|
12
|
+
id?: string
|
|
13
|
+
className?: any
|
|
14
|
+
style?: any
|
|
15
|
+
activation?: MaterialContextMenuActivation
|
|
16
|
+
items?: readonly MaterialContextMenuItem[]
|
|
17
|
+
trigger: () => any
|
|
18
|
+
onItemSelected?: (id: string) => void
|
|
19
|
+
accessibilityLabel?: string
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export declare function MaterialContextMenu(props: MaterialContextMenuProps): unknown
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export interface SwiftUIContextMenuItem {
|
|
2
|
+
id: string
|
|
3
|
+
title: string
|
|
4
|
+
destructive?: boolean
|
|
5
|
+
disabled?: boolean
|
|
6
|
+
divider?: boolean
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export interface SwiftUIContextMenuProps {
|
|
10
|
+
id?: string
|
|
11
|
+
className?: any
|
|
12
|
+
style?: any
|
|
13
|
+
items?: readonly SwiftUIContextMenuItem[]
|
|
14
|
+
trigger: () => any
|
|
15
|
+
preview?: () => any
|
|
16
|
+
onItemSelected?: (id: string) => void
|
|
17
|
+
accessibilityLabel?: string
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export declare function SwiftUIContextMenu(props: SwiftUIContextMenuProps): unknown
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface AppKitContextMenuItem {
|
|
2
|
+
id: string
|
|
3
|
+
title: string
|
|
4
|
+
destructive?: boolean
|
|
5
|
+
disabled?: boolean
|
|
6
|
+
divider?: boolean
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export interface AppKitContextMenuProps {
|
|
10
|
+
id?: string
|
|
11
|
+
className?: any
|
|
12
|
+
style?: any
|
|
13
|
+
items?: readonly AppKitContextMenuItem[]
|
|
14
|
+
trigger: () => any
|
|
15
|
+
onItemSelected?: (id: string) => void
|
|
16
|
+
accessibilityLabel?: string
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export declare function AppKitContextMenu(props: AppKitContextMenuProps): unknown
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export type ContextMenuActivation = 'longPress' | 'singlePress'
|
|
2
|
+
|
|
3
|
+
export interface ContextMenuItem {
|
|
4
|
+
id: string
|
|
5
|
+
title: string
|
|
6
|
+
destructive?: boolean
|
|
7
|
+
disabled?: boolean
|
|
8
|
+
divider?: boolean
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface ContextMenuProps {
|
|
12
|
+
id?: string
|
|
13
|
+
className?: any
|
|
14
|
+
style?: any
|
|
15
|
+
activation?: ContextMenuActivation
|
|
16
|
+
items?: readonly ContextMenuItem[]
|
|
17
|
+
trigger: () => any
|
|
18
|
+
onItemSelected?: (id: string) => void
|
|
19
|
+
accessibilityLabel?: string
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export declare function ContextMenu(props: ContextMenuProps): unknown
|
package/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {}
|
package/index.js
DELETED