Skip to content

Commit

Permalink
chore: v7 (#354)
Browse files Browse the repository at this point in the history
* chore(redirects): remove next redirect

* chore(): v6 versioned docs and sidebar

* chore(config): update version numbers
  • Loading branch information
jaredcbaum authored Oct 16, 2024
1 parent 828e02f commit 6fd0ba1
Show file tree
Hide file tree
Showing 156 changed files with 21,525 additions and 4 deletions.
5 changes: 3 additions & 2 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -283,10 +283,11 @@ module.exports = {
},
breadcrumbs: false,
exclude: ['README.md'],
lastVersion: 'current',
lastVersion: 'v6',
versions: {
current: {
label: 'v6',
label: 'v7',
banner: 'unreleased'
},
},
},
Expand Down
3 changes: 1 addition & 2 deletions vercel.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
"redirects": [
{ "source": "/", "destination": "/docs" },
{ "source": "/docs/apis/storage", "destination": "/docs/apis/preferences" },
{ "source": "/docs/cli/commands/list", "destination": "/docs/cli/commands/ls" },
{ "source": "/docs/next/:match*", "destination": "/docs/:match*" }
{ "source": "/docs/cli/commands/list", "destination": "/docs/cli/commands/ls" }
],
"rewrites": [
{ "source": "/docs", "destination": "/" },
Expand Down
17 changes: 17 additions & 0 deletions versioned_docs/version-v6/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Docs folder

The `/docs` folder houses all markdown files. The page structure loosely maps to the routing on the site since paths can be changed in the frontmatter.

## Versioning

This folder can also contain components, assets, and whatever else is meant to be versioned when the docusaurus versioning script is run. For example, if there is a page component that is only relevant to the `layout` section in the current version of Ionic, it could be added to a `_components/` folder in `docs/layout/`. When the versioning script is run, the component will be copied to `versioned_docs/verion-{X}/layout/_components/` and there will now be a separate component in `docs/layout/_components/` that can be deleted or updated to the latest version. The same concept applies to images and other files.

If components are meant to be shared across versions, they can be put in `src/components/`. If images and other served files are meant to be shared across versions they can be put in `static/`.

## Auto Generated Files

All markdown files in these directories are generated from [scripts](/scripts):

- `docs/api/`
- `docs/cli/commands/`
- `docs/native/`
129 changes: 129 additions & 0 deletions versioned_docs/version-v6/apis/action-sheet.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
---
title: Action Sheet Capacitor Plugin API
description: The Action Sheet API provides access to native Action Sheets, which come up from the bottom of the screen and display actions a user can take.
custom_edit_url: https://github.com/ionic-team/capacitor-plugins/blob/main/action-sheet/README.md
editApiUrl: https://github.com/ionic-team/capacitor-plugins/blob/main/action-sheet/src/definitions.ts
sidebar_label: Action Sheet
---

# @capacitor/action-sheet

The Action Sheet API provides access to native Action Sheets, which come up from the bottom of the screen and display actions a user can take.

## Install

```bash
npm install @capacitor/action-sheet
npx cap sync
```

### Variables

This plugin will use the following project variables (defined in your app's `variables.gradle` file):

- `androidxMaterialVersion`: version of `com.google.android.material:material` (default: `1.10.0`)

## PWA Notes

[PWA Elements](https://capacitorjs.com/docs/web/pwa-elements) are required for Action Sheet plugin to work.

## Example

```typescript
import { ActionSheet, ActionSheetButtonStyle } from '@capacitor/action-sheet';

const showActions = async () => {
const result = await ActionSheet.showActions({
title: 'Photo Options',
message: 'Select an option to perform',
options: [
{
title: 'Upload',
},
{
title: 'Share',
},
{
title: 'Remove',
style: ActionSheetButtonStyle.Destructive,
},
],
});

console.log('Action Sheet result:', result);
};
```

## API

<docgen-index>

* [`showActions(...)`](#showactions)
* [Interfaces](#interfaces)
* [Enums](#enums)

</docgen-index>

<docgen-api>
<!--Update the source file JSDoc comments and rerun docgen to update the docs below-->

### showActions(...)

```typescript
showActions(options: ShowActionsOptions) => Promise<ShowActionsResult>
```

Show an Action Sheet style modal with various options for the user
to select.

| Param | Type |
| ------------- | ----------------------------------------------------------------- |
| **`options`** | <code><a href="#showactionsoptions">ShowActionsOptions</a></code> |

**Returns:** <code>Promise&lt;<a href="#showactionsresult">ShowActionsResult</a>&gt;</code>

**Since:** 1.0.0

--------------------


### Interfaces


#### ShowActionsResult

| Prop | Type | Description | Since |
| ----------- | ------------------- | -------------------------------------------- | ----- |
| **`index`** | <code>number</code> | The index of the clicked option (Zero-based) | 1.0.0 |


#### ShowActionsOptions

| Prop | Type | Description | Since |
| ------------- | -------------------------------- | ------------------------------------------------------------------------ | ----- |
| **`title`** | <code>string</code> | The title of the Action Sheet. | 1.0.0 |
| **`message`** | <code>string</code> | A message to show under the title. This option is only supported on iOS. | 1.0.0 |
| **`options`** | <code>ActionSheetButton[]</code> | Options the user can choose from. | 1.0.0 |


#### ActionSheetButton

| Prop | Type | Description | Since |
| ----------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ----- |
| **`title`** | <code>string</code> | The title of the option | 1.0.0 |
| **`style`** | <code><a href="#actionsheetbuttonstyle">ActionSheetButtonStyle</a></code> | The style of the option This option is only supported on iOS. | 1.0.0 |
| **`icon`** | <code>string</code> | Icon for the option (ionicon naming convention) This option is only supported on Web. | 1.0.0 |


### Enums


#### ActionSheetButtonStyle

| Members | Value | Description | Since |
| ----------------- | -------------------------- | ----------------------------------------------------------------------------------------------------------- | ----- |
| **`Default`** | <code>'DEFAULT'</code> | Default style of the option. | 1.0.0 |
| **`Destructive`** | <code>'DESTRUCTIVE'</code> | Style to use on destructive options. | 1.0.0 |
| **`Cancel`** | <code>'CANCEL'</code> | Style to use on the option that cancels the Action Sheet. If used, should be on the latest availabe option. | 1.0.0 |

</docgen-api>
141 changes: 141 additions & 0 deletions versioned_docs/version-v6/apis/app-launcher.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
---
title: App Launcher Capacitor Plugin API
description: The AppLauncher API allows to open other apps
custom_edit_url: https://github.com/ionic-team/capacitor-plugins/blob/main/app-launcher/README.md
editApiUrl: https://github.com/ionic-team/capacitor-plugins/blob/main/app-launcher/src/definitions.ts
sidebar_label: App Launcher
---

# @capacitor/app-launcher

The AppLauncher API allows your app to check if an app can be opened and open it.

On iOS you can only open apps if you know their url scheme.

On Android you can open apps if you know their url scheme or use their public package name.

**Note:** On [Android 11](https://developer.android.com/about/versions/11/privacy/package-visibility) and newer you have to add the app package names you want to query in the `AndroidManifest.xml` inside the `queries` tag.

Example:
```xml
<queries>
<package android:name="com.getcapacitor.myapp" />
</queries>
```

## Install

```bash
npm install @capacitor/app-launcher
npx cap sync
```

## Example

```typescript
import { AppLauncher } from '@capacitor/app-launcher';

const checkCanOpenUrl = async () => {
const { value } = await AppLauncher.canOpenUrl({ url: 'com.getcapacitor.myapp' });

console.log('Can open url: ', value);
};

const openPortfolioPage = async () => {
await AppLauncher.openUrl({ url: 'com.getcapacitor.myapp://page?id=portfolio' });
};
```

## API

<docgen-index>

* [`canOpenUrl(...)`](#canopenurl)
* [`openUrl(...)`](#openurl)
* [Interfaces](#interfaces)

</docgen-index>

<docgen-api>
<!--Update the source file JSDoc comments and rerun docgen to update the docs below-->

### canOpenUrl(...)

```typescript
canOpenUrl(options: CanOpenURLOptions) => Promise<CanOpenURLResult>
```

Check if an app can be opened with the given URL.

On iOS you must declare the URL schemes you pass to this method by adding
the `LSApplicationQueriesSchemes` key to your app's `Info.plist` file.
Learn more about configuring
[`Info.plist`](https://capacitorjs.com/docs/ios/configuration#configuring-infoplist).

This method always returns false for undeclared schemes, whether or not an
appropriate app is installed. To learn more about the key, see
[LSApplicationQueriesSchemes](https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/LaunchServicesKeys.html#//apple_ref/doc/plist/info/LSApplicationQueriesSchemes).

| Param | Type |
| ------------- | --------------------------------------------------------------- |
| **`options`** | <code><a href="#canopenurloptions">CanOpenURLOptions</a></code> |

**Returns:** <code>Promise&lt;<a href="#canopenurlresult">CanOpenURLResult</a>&gt;</code>

**Since:** 1.0.0

--------------------


### openUrl(...)

```typescript
openUrl(options: OpenURLOptions) => Promise<OpenURLResult>
```

Open an app with the given URL.
On iOS the URL should be a known URLScheme.
On Android the URL can be a known URLScheme or an app package name.

| Param | Type |
| ------------- | --------------------------------------------------------- |
| **`options`** | <code><a href="#openurloptions">OpenURLOptions</a></code> |

**Returns:** <code>Promise&lt;<a href="#openurlresult">OpenURLResult</a>&gt;</code>

**Since:** 1.0.0

--------------------


### Interfaces


#### CanOpenURLResult

| Prop | Type |
| ----------- | -------------------- |
| **`value`** | <code>boolean</code> |


#### CanOpenURLOptions

| Prop | Type |
| --------- | ------------------- |
| **`url`** | <code>string</code> |


#### OpenURLResult

| Prop | Type |
| --------------- | -------------------- |
| **`completed`** | <code>boolean</code> |


#### OpenURLOptions

| Prop | Type |
| --------- | ------------------- |
| **`url`** | <code>string</code> |

</docgen-api>
Loading

0 comments on commit 6fd0ba1

Please sign in to comment.