@raycast/api 1.38.2 → 1.39.1

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/api.d.ts CHANGED
@@ -2109,6 +2109,10 @@ export declare interface Environment {
2109
2109
  * The name of the launched command, as specified in package.json
2110
2110
  */
2111
2111
  commandName: string;
2112
+ /**
2113
+ * The mode of the launched command, as specified in package.json
2114
+ */
2115
+ commandMode: "no-view" | "view" | "menu-bar";
2112
2116
  /**
2113
2117
  * The absolute path to the assets directory of the extension.
2114
2118
  *
@@ -2144,6 +2148,7 @@ export declare interface Environment {
2144
2148
  * console.log(`Raycast version: ${environment.raycastVersion}`);
2145
2149
  * console.log(`Extension name: ${environment.extensionName}`);
2146
2150
  * console.log(`Command name: ${environment.commandName}`);
2151
+ * console.log(`Command mode: ${environment.commandMode}`);
2147
2152
  * console.log(`Assets path: ${environment.assetsPath}`);
2148
2153
  * console.log(`Support path: ${environment.supportPath}`);
2149
2154
  * console.log(`Is development mode: ${environment.isDevelopment}`);
@@ -2196,6 +2201,7 @@ export declare namespace Form {
2196
2201
  export type Value = FormValue_2;
2197
2202
  export type Values = FormValues_2;
2198
2203
  export type Props = FormProps_2;
2204
+ export type ItemReference = FormItemRef;
2199
2205
  /**
2200
2206
  * An interface describing event in callbacks {@link Form.Item.Props.onFocus} and {@link Form.Item.Props.onBlur}
2201
2207
  */
@@ -3912,7 +3918,7 @@ declare interface GridMembers {
3912
3918
  * export default function Command() {
3913
3919
  * return (
3914
3920
  * <Grid>
3915
- * <Grid.Item icon={Icon.Star} title="Augustiner Helles" subtitle="0,5 Liter" />
3921
+ * <Grid.Item content={Icon.Star} title="Augustiner Helles" subtitle="0,5 Liter" />
3916
3922
  * </Grid>
3917
3923
  * );
3918
3924
  * }
@@ -4121,6 +4127,7 @@ export declare enum Icon {
4121
4127
  BellDisabled = "bell-disabled-16",
4122
4128
  Bike = "bike-16",
4123
4129
  Binoculars = "binoculars-16",
4130
+ Bird = "bird-16",
4124
4131
  BlankDocument = "blank-document-16",
4125
4132
  Bluetooth = "bluetooth-16",
4126
4133
  Boat = "boat-16",
@@ -4494,7 +4501,9 @@ export declare enum Icon {
4494
4501
  /** @deprecated Use {@link Icon.SpeakerOff} instead. */
4495
4502
  SpeakerSlash = "speaker-off-16",
4496
4503
  /** @deprecated Use {@link Icon.BlankDocument} instead. */
4497
- TextDocument = "blank-document-16"
4504
+ TextDocument = "blank-document-16",
4505
+ /** @deprecated Use {@link Icon.XMarkCircle} instead. */
4506
+ XmarkCircle = "x-mark-circle-16"
4498
4507
  }
4499
4508
 
4500
4509
  /**
@@ -5009,6 +5018,11 @@ export declare enum LaunchType {
5009
5018
  */
5010
5019
  declare const Link: FunctionComponent<LinkProps>;
5011
5020
 
5021
+ /**
5022
+ * See {@link List.Item.Detail.Metadata.Link}
5023
+ */
5024
+ declare const Link_2: FunctionComponent<LinkProps_2>;
5025
+
5012
5026
  declare interface LinkProps {
5013
5027
  /**
5014
5028
  * The title shown above the item.
@@ -5024,6 +5038,21 @@ declare interface LinkProps {
5024
5038
  text: string;
5025
5039
  }
5026
5040
 
5041
+ declare interface LinkProps_2 {
5042
+ /**
5043
+ * The title shown above the item.
5044
+ */
5045
+ title: string;
5046
+ /**
5047
+ * The target of the link.
5048
+ */
5049
+ target: string;
5050
+ /**
5051
+ * The text value of the item.
5052
+ */
5053
+ text: string;
5054
+ }
5055
+
5027
5056
  /**
5028
5057
  * Displays {@link List.Section} or {@link List.Item}, optionally {@link List.Dropdown}.
5029
5058
  *
@@ -5590,6 +5619,10 @@ declare interface MetadataMembers_2 {
5590
5619
  * ```
5591
5620
  */
5592
5621
  Label: typeof Label_2;
5622
+ /**
5623
+ * An item to display a link.
5624
+ */
5625
+ Link: typeof Link_2;
5593
5626
  /**
5594
5627
  * A metadata item that shows a separator line. Use it for grouping and visually separating metadata items.
5595
5628
  *
@@ -5620,6 +5653,10 @@ declare interface MetadataMembers_2 {
5620
5653
  * ```
5621
5654
  */
5622
5655
  Separator: typeof Separator_3;
5656
+ /**
5657
+ * A list of {@link List.Item.Detail.Metadata.TagList.Item} displayed in a row.
5658
+ */
5659
+ TagList: typeof TagList_2;
5623
5660
  }
5624
5661
 
5625
5662
  declare interface MetadataProps {
@@ -6795,8 +6832,12 @@ declare interface SubmitFormProps<T extends Form.Values> {
6795
6832
  * Callback that is triggered when the submit was submitted.
6796
6833
  * Use the handler to perform custom validation logic and call other Raycast API methods.
6797
6834
  * The handler receives a the values object containing the user input.
6835
+ *
6836
+ * @returns You can optionally return `false` to indicate that the submit action failed. Raycast will show some subtle feedback to the user that something went wrong. Pair it with the Form inputs' `validation` for a top-notch user experience.
6837
+ *
6838
+ * _If a user has the Accessibility setting 'Reduce Motion' enabled, Raycast won't show the feedback._
6798
6839
  */
6799
- onSubmit?: (input: T) => void;
6840
+ onSubmit?: (input: T) => void | boolean | Promise<void | boolean>;
6800
6841
  }
6801
6842
 
6802
6843
  /**
@@ -6804,11 +6845,21 @@ declare interface SubmitFormProps<T extends Form.Values> {
6804
6845
  */
6805
6846
  declare const TagList: FunctionComponent<TagListProps> & TagListMembers;
6806
6847
 
6848
+ /**
6849
+ * See {@link List.Item.Detail.Metadata.TagList}
6850
+ */
6851
+ declare const TagList_2: FunctionComponent<TagListProps_2> & TagListMembers_2;
6852
+
6807
6853
  /**
6808
6854
  * See {@link Detail.Metadata.TagList.Item}
6809
6855
  */
6810
6856
  declare const TagListItem: FunctionComponent<TagListItemProps>;
6811
6857
 
6858
+ /**
6859
+ * See {@link Detail.Metadata.TagList.Item}
6860
+ */
6861
+ declare const TagListItem_2: FunctionComponent<TagListItemProps_2>;
6862
+
6812
6863
  declare interface TagListItemProps {
6813
6864
  /**
6814
6865
  * An optional icon in front of the text of the tag.
@@ -6824,6 +6875,21 @@ declare interface TagListItemProps {
6824
6875
  color?: Color.ColorLike | undefined | null;
6825
6876
  }
6826
6877
 
6878
+ declare interface TagListItemProps_2 {
6879
+ /**
6880
+ * An optional icon in front of the text of the tag.
6881
+ */
6882
+ icon?: Image.ImageLike | undefined | null;
6883
+ /**
6884
+ * The text of the tag.
6885
+ */
6886
+ text: string;
6887
+ /**
6888
+ * Changes the text color to the provided color and sets a transparent background with the same color.
6889
+ */
6890
+ color?: Color.ColorLike | undefined | null;
6891
+ }
6892
+
6827
6893
  declare interface TagListMembers {
6828
6894
  /**
6829
6895
  * A Tag in a {@link Detail.Metadata.TagList}.
@@ -6831,6 +6897,13 @@ declare interface TagListMembers {
6831
6897
  Item: typeof TagListItem;
6832
6898
  }
6833
6899
 
6900
+ declare interface TagListMembers_2 {
6901
+ /**
6902
+ * A Tag in a {@link List.Item.Detail.Metadata.TagList}.
6903
+ */
6904
+ Item: typeof TagListItem_2;
6905
+ }
6906
+
6834
6907
  declare interface TagListProps {
6835
6908
  /**
6836
6909
  * The title shown above the item.
@@ -6842,6 +6915,17 @@ declare interface TagListProps {
6842
6915
  children: ReactNode;
6843
6916
  }
6844
6917
 
6918
+ declare interface TagListProps_2 {
6919
+ /**
6920
+ * The title shown above the item.
6921
+ */
6922
+ title: string;
6923
+ /**
6924
+ * The tags contained in the TagList.
6925
+ */
6926
+ children: ReactNode;
6927
+ }
6928
+
6845
6929
  /**
6846
6930
  * See {@link Form.TagPicker}
6847
6931
  */
package/bin/ray CHANGED
@@ -1,18 +1,65 @@
1
- #!/usr/bin/env bash
1
+ #!/bin/bash
2
2
 
3
- DIR=$(dirname "${BASH_SOURCE[0]}")
4
- SYMLINK=$(readlink "${BASH_SOURCE[0]}")
5
- RESOLVED_DIR="$( cd -P "$( dirname "$DIR/$SYMLINK" )" >/dev/null 2>&1 && pwd )"
3
+ # Determine the path for dist folder
4
+ # Using 'readlink -f' is not an option as '-f' it's not available on older macOS versions
5
+ source=${BASH_SOURCE:-$0}
6
+ # resolve $source until the file is no longer a symlink
7
+ while [ -L "$source" ]; do
8
+ dir=$( cd -P "$( dirname "$source" )" >/dev/null 2>&1 && pwd )
9
+ source=$(readlink "$source")
10
+ # if $source was a relative symlink, we need to resolve it relative to the path where the symlink file was located
11
+ [[ $source != /* ]] && source=$dir/$source
12
+ done
13
+ bin_dir=$( cd -P "$( dirname "$source" )" >/dev/null 2>&1 && pwd )
14
+ dist_dir=$(dirname $bin_dir)
6
15
 
7
- if [ -z "$RESOLVED_DIR" ]; then
8
- echo "Unable to determine CLI path from symlink: ${BASH_SOURCE[0]}"
16
+ if [ -z "$bin_dir" ]; then
17
+ echo "Unable to determine CLI path for source: ${BASH_SOURCE:-$0}"
9
18
  exit 1
10
19
  fi
11
20
 
12
- ARCH_NAME="$(uname -m)"
13
- ARCH_DIR="x86"
14
- if [ "${ARCH_NAME}" = "arm64" ]; then
15
- ARCH_DIR="arm64"
21
+ # Read API version from package.json from current NPM, which will define the CLI version
22
+ api_version=$(sed -n 's|.*"version": "\([^"]*\)".*|\1|p' < "$dist_dir/package.json")
23
+ if [ -z "$api_version" ]; then
24
+ echo "Fail parsing version"
25
+ exit 1
16
26
  fi
17
27
 
18
- "${RESOLVED_DIR}/${ARCH_DIR}/ray" "$@"
28
+ # CLI installation subroutine, using custom version and path for the CLI
29
+ function install_cli {
30
+ if ! curl -f -sL https://raycast.com/get-cli/ | VERSION="$api_version" INSTALL_PATH="$ray_path" bash; then
31
+ exit 1
32
+ fi
33
+ }
34
+
35
+ # Define the architecture directory in /dist folder to pick the right CLI version
36
+ os="$(uname)"
37
+ architecture="$(uname -m)"
38
+ architecture_dir="x86"
39
+ if [[ "${os}" = "Darwin" && "${architecture}" = "arm64" ]]; then
40
+ architecture_dir="arm64"
41
+ elif [ "${os}" = "Linux" ]; then
42
+ architecture_dir="linux"
43
+ fi
44
+
45
+ # Define the path for CLI for current architecture
46
+ ray_path=$bin_dir/$architecture_dir/ray
47
+
48
+ # If there is no CLI for current architecture, download it
49
+ if [ ! -f "$ray_path" ]; then
50
+ install_cli;
51
+ else
52
+ # If version of the CLI for current architecture is outdated, re-download the CLI
53
+ ray_version=$($ray_path version)
54
+ if [ "$ray_version" != "$api_version" ]; then
55
+ install_cli;
56
+ fi
57
+ fi
58
+
59
+ # For npm-post-install script, we don't execute the CLI
60
+ if [ "$1" == "npm-post-install" ]; then
61
+ exit 0
62
+ fi
63
+
64
+ # Execute the CLI passing all parameters to it
65
+ $ray_path "$@"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@raycast/api",
3
- "version": "1.38.2",
3
+ "version": "1.39.1",
4
4
  "description": "Build extensions for Raycast with React and Node.js.",
5
5
  "author": "Raycast Technologies Ltd.",
6
6
  "homepage": "https://developers.raycast.com",
@@ -12,7 +12,10 @@
12
12
  "react": "18.1.0",
13
13
  "react-reconciler": "0.28.0"
14
14
  },
15
+ "scripts": {
16
+ "postinstall": "bin/ray npm-post-install"
17
+ },
15
18
  "bin": {
16
- "ray": "./bin/ray"
19
+ "ray": "bin/ray"
17
20
  }
18
21
  }
package/types/index.d.ts CHANGED
@@ -2109,6 +2109,10 @@ export declare interface Environment {
2109
2109
  * The name of the launched command, as specified in package.json
2110
2110
  */
2111
2111
  commandName: string;
2112
+ /**
2113
+ * The mode of the launched command, as specified in package.json
2114
+ */
2115
+ commandMode: "no-view" | "view" | "menu-bar";
2112
2116
  /**
2113
2117
  * The absolute path to the assets directory of the extension.
2114
2118
  *
@@ -2144,6 +2148,7 @@ export declare interface Environment {
2144
2148
  * console.log(`Raycast version: ${environment.raycastVersion}`);
2145
2149
  * console.log(`Extension name: ${environment.extensionName}`);
2146
2150
  * console.log(`Command name: ${environment.commandName}`);
2151
+ * console.log(`Command mode: ${environment.commandMode}`);
2147
2152
  * console.log(`Assets path: ${environment.assetsPath}`);
2148
2153
  * console.log(`Support path: ${environment.supportPath}`);
2149
2154
  * console.log(`Is development mode: ${environment.isDevelopment}`);
@@ -2196,6 +2201,7 @@ export declare namespace Form {
2196
2201
  export type Value = FormValue_2;
2197
2202
  export type Values = FormValues_2;
2198
2203
  export type Props = FormProps_2;
2204
+ export type ItemReference = FormItemRef;
2199
2205
  /**
2200
2206
  * An interface describing event in callbacks {@link Form.Item.Props.onFocus} and {@link Form.Item.Props.onBlur}
2201
2207
  */
@@ -3912,7 +3918,7 @@ declare interface GridMembers {
3912
3918
  * export default function Command() {
3913
3919
  * return (
3914
3920
  * <Grid>
3915
- * <Grid.Item icon={Icon.Star} title="Augustiner Helles" subtitle="0,5 Liter" />
3921
+ * <Grid.Item content={Icon.Star} title="Augustiner Helles" subtitle="0,5 Liter" />
3916
3922
  * </Grid>
3917
3923
  * );
3918
3924
  * }
@@ -4121,6 +4127,7 @@ export declare enum Icon {
4121
4127
  BellDisabled = "bell-disabled-16",
4122
4128
  Bike = "bike-16",
4123
4129
  Binoculars = "binoculars-16",
4130
+ Bird = "bird-16",
4124
4131
  BlankDocument = "blank-document-16",
4125
4132
  Bluetooth = "bluetooth-16",
4126
4133
  Boat = "boat-16",
@@ -4494,7 +4501,9 @@ export declare enum Icon {
4494
4501
  /** @deprecated Use {@link Icon.SpeakerOff} instead. */
4495
4502
  SpeakerSlash = "speaker-off-16",
4496
4503
  /** @deprecated Use {@link Icon.BlankDocument} instead. */
4497
- TextDocument = "blank-document-16"
4504
+ TextDocument = "blank-document-16",
4505
+ /** @deprecated Use {@link Icon.XMarkCircle} instead. */
4506
+ XmarkCircle = "x-mark-circle-16"
4498
4507
  }
4499
4508
 
4500
4509
  /**
@@ -5009,6 +5018,11 @@ export declare enum LaunchType {
5009
5018
  */
5010
5019
  declare const Link: FunctionComponent<LinkProps>;
5011
5020
 
5021
+ /**
5022
+ * See {@link List.Item.Detail.Metadata.Link}
5023
+ */
5024
+ declare const Link_2: FunctionComponent<LinkProps_2>;
5025
+
5012
5026
  declare interface LinkProps {
5013
5027
  /**
5014
5028
  * The title shown above the item.
@@ -5024,6 +5038,21 @@ declare interface LinkProps {
5024
5038
  text: string;
5025
5039
  }
5026
5040
 
5041
+ declare interface LinkProps_2 {
5042
+ /**
5043
+ * The title shown above the item.
5044
+ */
5045
+ title: string;
5046
+ /**
5047
+ * The target of the link.
5048
+ */
5049
+ target: string;
5050
+ /**
5051
+ * The text value of the item.
5052
+ */
5053
+ text: string;
5054
+ }
5055
+
5027
5056
  /**
5028
5057
  * Displays {@link List.Section} or {@link List.Item}, optionally {@link List.Dropdown}.
5029
5058
  *
@@ -5590,6 +5619,10 @@ declare interface MetadataMembers_2 {
5590
5619
  * ```
5591
5620
  */
5592
5621
  Label: typeof Label_2;
5622
+ /**
5623
+ * An item to display a link.
5624
+ */
5625
+ Link: typeof Link_2;
5593
5626
  /**
5594
5627
  * A metadata item that shows a separator line. Use it for grouping and visually separating metadata items.
5595
5628
  *
@@ -5620,6 +5653,10 @@ declare interface MetadataMembers_2 {
5620
5653
  * ```
5621
5654
  */
5622
5655
  Separator: typeof Separator_3;
5656
+ /**
5657
+ * A list of {@link List.Item.Detail.Metadata.TagList.Item} displayed in a row.
5658
+ */
5659
+ TagList: typeof TagList_2;
5623
5660
  }
5624
5661
 
5625
5662
  declare interface MetadataProps {
@@ -6795,8 +6832,12 @@ declare interface SubmitFormProps<T extends Form.Values> {
6795
6832
  * Callback that is triggered when the submit was submitted.
6796
6833
  * Use the handler to perform custom validation logic and call other Raycast API methods.
6797
6834
  * The handler receives a the values object containing the user input.
6835
+ *
6836
+ * @returns You can optionally return `false` to indicate that the submit action failed. Raycast will show some subtle feedback to the user that something went wrong. Pair it with the Form inputs' `validation` for a top-notch user experience.
6837
+ *
6838
+ * _If a user has the Accessibility setting 'Reduce Motion' enabled, Raycast won't show the feedback._
6798
6839
  */
6799
- onSubmit?: (input: T) => void;
6840
+ onSubmit?: (input: T) => void | boolean | Promise<void | boolean>;
6800
6841
  }
6801
6842
 
6802
6843
  /**
@@ -6804,11 +6845,21 @@ declare interface SubmitFormProps<T extends Form.Values> {
6804
6845
  */
6805
6846
  declare const TagList: FunctionComponent<TagListProps> & TagListMembers;
6806
6847
 
6848
+ /**
6849
+ * See {@link List.Item.Detail.Metadata.TagList}
6850
+ */
6851
+ declare const TagList_2: FunctionComponent<TagListProps_2> & TagListMembers_2;
6852
+
6807
6853
  /**
6808
6854
  * See {@link Detail.Metadata.TagList.Item}
6809
6855
  */
6810
6856
  declare const TagListItem: FunctionComponent<TagListItemProps>;
6811
6857
 
6858
+ /**
6859
+ * See {@link Detail.Metadata.TagList.Item}
6860
+ */
6861
+ declare const TagListItem_2: FunctionComponent<TagListItemProps_2>;
6862
+
6812
6863
  declare interface TagListItemProps {
6813
6864
  /**
6814
6865
  * An optional icon in front of the text of the tag.
@@ -6824,6 +6875,21 @@ declare interface TagListItemProps {
6824
6875
  color?: Color.ColorLike | undefined | null;
6825
6876
  }
6826
6877
 
6878
+ declare interface TagListItemProps_2 {
6879
+ /**
6880
+ * An optional icon in front of the text of the tag.
6881
+ */
6882
+ icon?: Image.ImageLike | undefined | null;
6883
+ /**
6884
+ * The text of the tag.
6885
+ */
6886
+ text: string;
6887
+ /**
6888
+ * Changes the text color to the provided color and sets a transparent background with the same color.
6889
+ */
6890
+ color?: Color.ColorLike | undefined | null;
6891
+ }
6892
+
6827
6893
  declare interface TagListMembers {
6828
6894
  /**
6829
6895
  * A Tag in a {@link Detail.Metadata.TagList}.
@@ -6831,6 +6897,13 @@ declare interface TagListMembers {
6831
6897
  Item: typeof TagListItem;
6832
6898
  }
6833
6899
 
6900
+ declare interface TagListMembers_2 {
6901
+ /**
6902
+ * A Tag in a {@link List.Item.Detail.Metadata.TagList}.
6903
+ */
6904
+ Item: typeof TagListItem_2;
6905
+ }
6906
+
6834
6907
  declare interface TagListProps {
6835
6908
  /**
6836
6909
  * The title shown above the item.
@@ -6842,6 +6915,17 @@ declare interface TagListProps {
6842
6915
  children: ReactNode;
6843
6916
  }
6844
6917
 
6918
+ declare interface TagListProps_2 {
6919
+ /**
6920
+ * The title shown above the item.
6921
+ */
6922
+ title: string;
6923
+ /**
6924
+ * The tags contained in the TagList.
6925
+ */
6926
+ children: ReactNode;
6927
+ }
6928
+
6845
6929
  /**
6846
6930
  * See {@link Form.TagPicker}
6847
6931
  */
package/bin/arm64/ray DELETED
Binary file
package/bin/x86/ray DELETED
Binary file