diff --git a/docs/.config.json b/docs/.config.json index 271a7b7402d..84c46d128c6 100644 --- a/docs/.config.json +++ b/docs/.config.json @@ -1,3 +1,3 @@ { - "version": "1.46.1" + "version": "1.47.0" } diff --git a/docs/.gitbook/assets/deeplink-confirmation.png b/docs/.gitbook/assets/deeplink-confirmation.png new file mode 100644 index 00000000000..f11ac8e0c5f Binary files /dev/null and b/docs/.gitbook/assets/deeplink-confirmation.png differ diff --git a/docs/SUMMARY.md b/docs/SUMMARY.md index ce308cc672b..c67b609535d 100644 --- a/docs/SUMMARY.md +++ b/docs/SUMMARY.md @@ -41,6 +41,7 @@ - [Lifecycle](information/lifecycle/README.md) - [Arguments](information/lifecycle/arguments.md) - [Background Refresh](information/lifecycle/background-refresh.md) + - [Deeplinks](information/lifecycle/deeplinks.md) - [Manifest](information/manifest.md) - [Security](information/security.md) - [Terminology](information/terminology.md) diff --git a/docs/api-reference/clipboard.md b/docs/api-reference/clipboard.md index d9a079932dc..50fb6ba2564 100644 --- a/docs/api-reference/clipboard.md +++ b/docs/api-reference/clipboard.md @@ -101,6 +101,33 @@ export default async function Command() { A Promise that resolves when the clipboard is cleared. +### Clipboard.read + +Reads the clipboard content as plain text, file name, or HTML. + +#### Signature + +```typescript +async function read(): Promise; +``` + +#### Example + +```typescript +import { Clipboard } from "@raycast/api"; + +export default async () => { + const { text, file, html } = await Clipboard.read(); + console.log(text); + console.log(file); + console.log(html); +}; +``` + +#### Return + +A promise that resolves when the clipboard content was read as plain text, file name, or HTML. + ### Clipboard.readText Reads the clipboard as plain text. @@ -130,7 +157,7 @@ A promise that resolves when the clipboard content was read as plain text. ### Clipboard.Content -Type of Content that is copied and pasted to and from the Clipboard +Type of content that is copied and pasted to and from the Clipboard ```typescript type Content = @@ -141,3 +168,20 @@ type Content = file: PathLike; }; ``` + +### Clipboard.ReadContent + +Type of content that is read from the Clipboard + +```typescript +type Content = + | { + text: string; + } + | { + file?: string; + } + | { + html?: string; + }; +``` diff --git a/docs/changelog.md b/docs/changelog.md index 20237365562..c1877037fe1 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -1,5 +1,22 @@ # Changelog +## 1.47.0 - 2023-02-01 + +### ✨ New + +- **Clipboard**: Add a new `Clipboard.read()` method that reads the clipboard content as plain text, file path, or HTML. + +### 💎 Improvements + +- **List Accessories**: Tags can now use any color (we made some improvements to ensure that any color would have enough contrast to be readable) + +### 🐞 Fixes + +- Fixed a bug where reloading menu bar commands in development mode would not respect certain manifest property updates (e.g. interval). +- Fixed a bug that caused `Metadata.Link`'s `title` to be cut off unnecessarily when using the large text size. +- Fixed a bug where `clearSearchBar` wouldn’t clear the search bar when rendering a Grid. +- Fixed a bug where `ray lint` would fail if there were a .DS_Store file in the `src` folder. + ## 1.46.0 - 2023-01-18 ⚠️️ **Global Fetch Deprecation**: We've removed the experimental support for global fetch in Node 18. The reason is that the feature is not stable yet (hence the warning on it being "experimental" in the dev console) and is not compatible with our new proxy feature in Raycast. We've scanned the public repository for extensions that make use of global fetch and replaced it with the _cross-fetch_ dependency via separate PRs. If we missed an extension, let us know - in most cases, it should be a straightforward replacement. diff --git a/docs/information/lifecycle/README.md b/docs/information/lifecycle/README.md index 806d03f5978..611a433cbba 100644 --- a/docs/information/lifecycle/README.md +++ b/docs/information/lifecycle/README.md @@ -42,6 +42,7 @@ There are different ways to launch a command: - The command was launched in the [background](./background-refresh.md). - A [Form's Draft](../../api-reference/user-interface/form.md#drafts) was saved and the user executes it. - A user registers the command as a [fallback command](https://manual.raycast.com/fallback-commands) and executes it when there are no results in the root search. +- A user clicks a [Deeplink](./deeplinks.md) Depending on how the command was launched, different arguments will be passed to the exported default function. diff --git a/docs/information/lifecycle/deeplinks.md b/docs/information/lifecycle/deeplinks.md new file mode 100644 index 00000000000..5cde0487bd3 --- /dev/null +++ b/docs/information/lifecycle/deeplinks.md @@ -0,0 +1,31 @@ +# Deeplinks + +Deeplinks are Raycast-specific URLs which you can use to launch any command, as long as it's installed an enabled in Raycast. + +They adhere the following format: + +``` +raycast://extensions/// +``` + +| Name | Description | Type | +| :-------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | +| author-or-owner | For store extensions, it's the value of the `owner` or the `author` field in the extension's [manifest](../manifest.md). For built-in extensions (such as `Calendar`), this is always `raycast`. | `string` | +| extension-name | For store extensions, it's the value of the extensions `name` field in the extension's [manifest](../manifest.md). For built-in extensions (such as `Calendar`), this is the "slugified" extension name; in this case `calendar`. | `string` | +| command-name | For store extensions, it's the value of the command's `name` field in the extension's [manifest](../manifest.md). For built-in commands (such as `My Schedule`), this is the "slugified" command name; in this case `my-schedule`. | `string` | + +To make fetching a command's Deeplink easier, each command in the Raycast root now has a `Copy Deeplink` action. + +{% hint style="info" %} +Whenever a command is launched using a Deeplink, Raycast will ask you to confirm that you want to run the command. This is to ensure that you are aware of the command you are running. +{% endhint %} + +![](../../.gitbook/assets/deeplink-confirmation.png) + +## Query Parameters + +| Name | Description | Type | +| :--------- | ---------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------- | +| launchType | Runs the command in the background, skipping bringing Raycast to the front. | Either `userInitiated` or `background` | +| arguments | If the command acepts [arguments](./arguments.md), they can be passed using this query parameter. | URL-encoded JSON object. | +| context | If the command make use of [LaunchContext](../../api-reference/utilities.md#launchcontext), it can be passed using this query parameter. | URL-encoded JSON object. |