Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@cactuslab/native-navigation
Advanced tools
Native navigation for Capacitor apps.
This package provides a Capacitor plugin for controlling native navigation UI from a React DOM app.
Please see the root of this repository for a discussion of how to use this plugin.
npm install @cactuslab/native-navigation
npx cap sync
present(...)
dismiss(...)
push(...)
pop(...)
update(...)
reset(...)
get(...)
message(...)
present(options: PresentOptions) => Promise<PresentResult>
Present a new native UI.
Param | Type |
---|---|
options | PresentOptions |
Returns: Promise<PresentResult>
dismiss(options?: DismissOptions | undefined) => Promise<DismissResult>
Dismiss a native UI.
Param | Type |
---|---|
options | DismissOptions |
Returns: Promise<DismissResult>
push(options: PushOptions) => Promise<PushResult>
Push a new component onto a stack, or replace an existing component.
Param | Type |
---|---|
options | PushOptions |
Returns: Promise<PushResult>
pop(options: PopOptions) => Promise<PopResult>
Pop the top component off a stack
Param | Type |
---|---|
options | PopOptions |
Returns: Promise<PopResult>
update(options: UpdateOptions) => Promise<void>
Set the options for an existing component
Param | Type |
---|---|
options | UpdateOptions |
reset(options?: ResetOptions | undefined) => Promise<void>
Remove all of the native UI and reset back to the root Capacitor webview.
Param | Type |
---|---|
options | ResetOptions |
get(options?: GetOptions | undefined) => Promise<GetResult>
Get the spec and context of a component
Param | Type |
---|---|
options | GetOptions |
Returns: Promise<GetResult>
message<D>(options: MessageOptions<D>) => Promise<void>
Send a message to a component.
Param | Type |
---|---|
options | MessageOptions<D> |
Prop | Type |
---|---|
id | ComponentId |
Prop | Type | Description |
---|---|---|
component | AnyComponentSpec | The component to present. |
style | PresentationStyle | The presentation style. Defaults to 'fullScreen' |
cancellable | boolean | Whether to allow the user to use system gestures or the back button to unwind the presentation. Useful to prevent the accidental dismissal of a form. Defaults to true |
animated | boolean | Whether to animate the presenting. Defaults to true |
Prop | Type |
---|---|
type | 'stack' |
components | ViewSpec[] |
bar | BarSpec |
title | string |
Prop | Type | Description |
---|---|---|
type | 'view' | |
path | string | The path representing the view. |
state | ViewState | |
title | string | |
stackItem | StackItemSpec | Options for when the component is used in a stack |
Prop | Type | Description |
---|---|---|
backItem | StackBarButtonItem | |
leftItems | StackBarButtonItem[] | |
rightItems | StackBarButtonItem[] | |
backEnabled | boolean | Enables the system gestures and buttons for managing the back action. Useful for preventing the user from exiting a window that is running an important operation. Does not prevent the user from backgrounding the application. Default behaviour is to use the host Stack configuration which behaves as backEnabled is true |
bar | BarSpec | Customise the bar on top of the default options provided by the stack |
Prop | Type |
---|---|
id | ButtonId |
title | string |
image | ImageSpec |
Prop | Type | Description |
---|---|---|
uri | string | The uri for the image. |
scale | number | The scale to use for the image, e.g. 2 for a 2x scale image. If not provided the scale will be determined automatically from the filename, or it will default to 1. |
Prop | Type |
---|---|
background | FillSpec |
title | LabelSpec |
buttons | LabelSpec |
visible | boolean |
Prop | Type |
---|---|
color | string |
Prop | Type |
---|---|
color | string |
font | FontSpec |
Prop | Type |
---|---|
name | string |
size | number |
Prop | Type |
---|---|
type | 'tabs' |
tabs | TabSpec[] |
title | string |
Prop | Type | Description |
---|---|---|
id | ComponentId | The id to use for the tab, or undefined to automatically generate an id. |
title | string | |
image | ImageSpec | |
badgeValue | string | |
component | ViewSpec | StackSpec |
Prop | Type |
---|---|
id | ComponentId |
Prop | Type |
---|---|
id | ComponentId |
animated | boolean |
Prop | Type | Description |
---|---|---|
id | ComponentId | The id of the component that was pushed. |
stack | ComponentId | The stack that was pushed to, if it was pushed to a stack. |
Prop | Type | Description |
---|---|---|
component | ViewSpec | The options for the view to push onto the stack. |
target | ComponentId | The target component to push to, usually a stack, or undefined to push to the current stack or component. |
animated | boolean | Whether to animate the push. Defaults to true |
mode | PushMode | The mode to use for the push. Defaults to 'push' . push: Push the component onto the stack. replace: Replace the current top-most component in the stack. root: Reset the stack back to just the new component. |
popCount | number | How many items to pop first |
Prop | Type | Description |
---|---|---|
stack | ComponentId | |
count | number | The number of components that were popped |
id | ComponentId | The id of the component that was popped, if any. If multiple components are popped, the id will be of the last component popped. |
Prop | Type | Description |
---|---|---|
stack | ComponentId | The stack to pop from, or undefined to pop from the current stack. |
count | number | How many items to pop |
animated | boolean | Whether to animate the pop. Defaults to true |
Prop | Type | Description |
---|---|---|
id | ComponentId | |
animated | boolean | Whether to animate the changes. Defaults to false |
update | StackUpdate | TabsUpdate | TabUpdate | ViewUpdate |
Options for stack components
Prop | Type |
---|---|
components | ViewSpec[] |
bar | BarUpdate |
Prop | Type |
---|---|
background | FillUpdate | null |
title | LabelUpdate | null |
buttons | LabelUpdate | null |
visible | boolean | null |
Prop | Type |
---|---|
color | string | null |
Prop | Type |
---|---|
color | string | null |
font | FontUpdate | null |
Prop | Type |
---|---|
name | string | null |
size | number | null |
Options for tabs components
Prop | Type |
---|---|
tabs | TabSpec[] |
Prop | Type |
---|---|
title | string | null |
image | ImageSpec | null |
badgeValue | string | null |
component | ViewSpec | StackSpec |
Options for view components
Prop | Type | Description |
---|---|---|
stackItem | StackItemUpdate | Options for when the component is used in a stack |
Prop | Type | Description |
---|---|---|
backItem | StackBarButtonItem | null | |
leftItems | StackBarButtonItem[] | null | |
rightItems | StackBarButtonItem[] | null | |
backEnabled | boolean | null | Enables the system gestures and buttons for managing the back action. Useful for preventing the user from exiting a window that is running an important operation. Does not prevent the user from backgrounding the application. Default behaviour is to use the host Stack configuration which behaves as backEnabled is true |
bar | BarUpdate | null | Customise the bar on top of the default options provided by the stack |
Prop | Type | Description |
---|---|---|
animated | boolean | Whether to animate resetting the navigation back to Capacitor Defaults to false |
Prop | Type | Description |
---|---|---|
component | AnyComponentSpec | The component, if any. |
stack | StackSpec | The stack containing the component, if any. |
tabs | TabsSpec | The tabs containing the component, if any. |
Prop | Type | Description |
---|---|---|
id | ComponentId | The component id to get, or undefined to get the top-most component. |
Prop | Type | Description |
---|---|---|
target | ComponentId | The target component of the message, or undefined to send to the top-most component. |
type | string | The message type. |
value | D | A message value. Must be JSON stringifiable. |
string
StackSpec | TabsSpec | ViewSpec
Record<string, string | number | boolean | null>
Construct a type with a set of properties K of type T
{
[P in K]: T;
}
string
ImageObject | string
'fullScreen' | 'pageSheet' | 'formSheet' | 'dialog'
push: Push the component onto the stack. replace: Replace the current top-most component in the stack. root: Reset the stack back to just the new component.
'push' | 'replace' | 'root'
FAQs
Native navigation for Capacitor apps
The npm package @cactuslab/native-navigation receives a total of 1 weekly downloads. As such, @cactuslab/native-navigation popularity was classified as not popular.
We found that @cactuslab/native-navigation demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.