@raycast/api 1.26.3 → 1.27.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/bin/arm64/ray CHANGED
Binary file
package/bin/x86/ray CHANGED
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@raycast/api",
3
- "version": "1.26.3",
3
+ "version": "1.27.0",
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",
package/types/index.d.ts CHANGED
@@ -907,12 +907,12 @@ export interface FormValues {
907
907
  */
908
908
  export interface FormProps extends ActionsInterface, NavigationChildInterface {
909
909
  /**
910
- * The {@link FormItemElement} elements of the form.
910
+ * The Form.Item elements of the form.
911
911
  */
912
912
  children?: ReactElement<FormItemProps<FormValue>> | Array<ReactElement<FormItemProps<FormValue>>> | null;
913
913
  }
914
914
  /**
915
- * Shows a list of form items such as {@link FormViewTextField}, {@link FormViewCheckbox} or {@link FormViewDropdown}.
915
+ * Shows a list of form items such as {@link Form.TextField}, {@link Form.Checkbox} or {@link Form.Dropdown}.
916
916
  *
917
917
  * @category User Interface
918
918
  * @subcategory Form
@@ -937,7 +937,7 @@ export namespace Form {
937
937
  var TagPickerItem: typeof FormTagPickerItem;
938
938
  }
939
939
  /**
940
- * Props of the {@link Form.Item} React component.
940
+ * Props of the Form.Item React component.
941
941
  *
942
942
  * @category User Interface
943
943
  * @subcategory Form
@@ -995,7 +995,13 @@ export interface FormTextFieldProps extends FormItemProps<string> {
995
995
  *
996
996
  * export default function Command() {
997
997
  * return (
998
- * <Form onSubmit={(values) => console.log(values)}>
998
+ * <Form
999
+ * actions={
1000
+ * <ActionPanel>
1001
+ * <SubmitFormAction title="Submit Name" onSubmit={(values) => console.log(values)} />
1002
+ * </ActionPanel>
1003
+ * }
1004
+ * >
999
1005
  * <Form.TextField id="name" defaultValue="Steve" />
1000
1006
  * </Form>
1001
1007
  * );
@@ -1010,11 +1016,17 @@ export interface FormTextFieldProps extends FormItemProps<string> {
1010
1016
  *
1011
1017
  *
1012
1018
  * export default function Command() {
1013
- * const [text, setText] = useState<string>();
1019
+ * const [name, setName] = useState<string>();
1014
1020
  *
1015
1021
  * return (
1016
- * <Form onSubmit={(values) => console.log(values)}>
1017
- * <Form.TextField id="textfield" value={text} onChange={setText} />
1022
+ * <Form
1023
+ * actions={
1024
+ * <ActionPanel>
1025
+ * <SubmitFormAction title="Submit Name" onSubmit={(values) => console.log(values)} />
1026
+ * </ActionPanel>
1027
+ * }
1028
+ * >
1029
+ * <Form.TextField id="name" value={name} onChange={setName} />
1018
1030
  * </Form>
1019
1031
  * );
1020
1032
  * }
@@ -1063,7 +1075,13 @@ export interface FormTextAreaProps extends FormItemProps<string> {
1063
1075
  *
1064
1076
  * export default function Command() {
1065
1077
  * return (
1066
- * <Form onSubmit={(values) => console.log(values)}>
1078
+ * <Form
1079
+ * actions={
1080
+ * <ActionPanel>
1081
+ * <SubmitFormAction title="Submit Description" onSubmit={(values) => console.log(values)} />
1082
+ * </ActionPanel>
1083
+ * }
1084
+ * >
1067
1085
  * <Form.TextArea id="description" defaultValue={DESCRIPTION} />
1068
1086
  * </Form>
1069
1087
  * );
@@ -1078,11 +1096,17 @@ export interface FormTextAreaProps extends FormItemProps<string> {
1078
1096
  *
1079
1097
  *
1080
1098
  * export default function Command() {
1081
- * const [text, setText] = useState<string>();
1099
+ * const [description, setDescription] = useState<string>();
1082
1100
  *
1083
1101
  * return (
1084
- * <Form onSubmit={(values) => console.log(values)}>
1085
- * <Form.TextArea id="textarea" value={text} onChange={setText} />
1102
+ * <Form
1103
+ * actions={
1104
+ * <ActionPanel>
1105
+ * <SubmitFormAction title="Submit Description" onSubmit={(values) => console.log(values)} />
1106
+ * </ActionPanel>
1107
+ * }
1108
+ * >
1109
+ * <Form.TextArea id="description" value={description} onChange={setDescription} />
1086
1110
  * </Form>
1087
1111
  * );
1088
1112
  * }
@@ -1127,8 +1151,14 @@ export interface FormCheckboxProps extends FormItemProps<boolean> {
1127
1151
  *
1128
1152
  * export default function Command() {
1129
1153
  * return (
1130
- * <Form onSubmit={(values) => console.log(values)}>
1131
- * <Form.Checkbox id="checkbox" label="Are you happy?" defaultValue={true} />
1154
+ * <Form
1155
+ * actions={
1156
+ * <ActionPanel>
1157
+ * <SubmitFormAction title="Submit Answer" onSubmit={(values) => console.log(values)} />
1158
+ * </ActionPanel>
1159
+ * }
1160
+ * >
1161
+ * <Form.Checkbox id="answer" label="Are you happy?" defaultValue={true} />
1132
1162
  * </Form>
1133
1163
  * );
1134
1164
  * }
@@ -1145,8 +1175,14 @@ export interface FormCheckboxProps extends FormItemProps<boolean> {
1145
1175
  * const [checked, setChecked] = useState(true);
1146
1176
  *
1147
1177
  * return (
1148
- * <Form onSubmit={(values) => console.log(values)}>
1149
- * <Form.Checkbox id="checkbox" label="Do you like orange juice?" value={checked} onChange={setChecked} />
1178
+ * <Form
1179
+ * actions={
1180
+ * <ActionPanel>
1181
+ * <SubmitFormAction title="Submit Answer" onSubmit={(values) => console.log(values)} />
1182
+ * </ActionPanel>
1183
+ * }
1184
+ * >
1185
+ * <Form.Checkbox id="answer" label="Do you like orange juice?" value={checked} onChange={setChecked} />
1150
1186
  * </Form>
1151
1187
  * );
1152
1188
  * }
@@ -1187,7 +1223,13 @@ export interface FormDatePickerProps extends FormItemProps<Date> {
1187
1223
  *
1188
1224
  * export default function Command() {
1189
1225
  * return (
1190
- * <Form onSubmit={(values) => console.log(values)}>
1226
+ * <Form
1227
+ * actions={
1228
+ * <ActionPanel>
1229
+ * <SubmitFormAction title="Submit Form" onSubmit={(values) => console.log(values)} />
1230
+ * </ActionPanel>
1231
+ * }
1232
+ * >
1191
1233
  * <Form.DatePicker id="dateOfBirth" title="Date of Birth" defaultValue={new Date(1955, 1, 24)} />
1192
1234
  * </Form>
1193
1235
  * );
@@ -1205,7 +1247,13 @@ export interface FormDatePickerProps extends FormItemProps<Date> {
1205
1247
  * const [date, setDate] = useState<Date>();
1206
1248
  *
1207
1249
  * return (
1208
- * <Form onSubmit={(values) => console.log(values)}>
1250
+ * <Form
1251
+ * actions={
1252
+ * <ActionPanel>
1253
+ * <SubmitFormAction title="Submit Form" onSubmit={(values) => console.log(values)} />
1254
+ * </ActionPanel>
1255
+ * }
1256
+ * >
1209
1257
  * <Form.DatePicker id="launchDate" title="Launch Date" value={date} onChange={setDate} />
1210
1258
  * </Form>
1211
1259
  * );
@@ -1245,7 +1293,13 @@ export interface FormSeparatorProps {
1245
1293
  *
1246
1294
  * export default function Command() {
1247
1295
  * return (
1248
- * <Form onSubmit={(values) => console.log(values)}>
1296
+ * <Form
1297
+ * actions={
1298
+ * <ActionPanel>
1299
+ * <SubmitFormAction title="Submit Form" onSubmit={(values) => console.log(values)} />
1300
+ * </ActionPanel>
1301
+ * }
1302
+ * >
1249
1303
  * <Form.TextField id="textfield" />
1250
1304
  * <Form.Separator />
1251
1305
  * <Form.TextArea id="textarea" />
@@ -1284,7 +1338,13 @@ export interface FormDropdownProps extends FormItemProps<string> {
1284
1338
  *
1285
1339
  * export default function Command() {
1286
1340
  * return (
1287
- * <Form onSubmit={(values) => console.log(values)}>
1341
+ * <Form
1342
+ * actions={
1343
+ * <ActionPanel>
1344
+ * <SubmitFormAction title="Submit Favorite" onSubmit={(values) => console.log(values)} />
1345
+ * </ActionPanel>
1346
+ * }
1347
+ * >
1288
1348
  * <Form.Dropdown id="emoji" title="Favorite Emoji" defaultValue="lol">
1289
1349
  * <Form.Dropdown.Item value="poop" title="Pile of poop" icon="💩" />
1290
1350
  * <Form.Dropdown.Item value="rocket" title="Rocket" icon="🚀" />
@@ -1306,7 +1366,13 @@ export interface FormDropdownProps extends FormItemProps<string> {
1306
1366
  * const [programmingLanguage, setProgrammingLanguage] = useState<string>("typescript");
1307
1367
  *
1308
1368
  * return (
1309
- * <Form onSubmit={(values) => console.log(values)}>
1369
+ * <Form
1370
+ * actions={
1371
+ * <ActionPanel>
1372
+ * <SubmitFormAction title="Submit Favorite" onSubmit={(values) => console.log(values)} />
1373
+ * </ActionPanel>
1374
+ * }
1375
+ * >
1310
1376
  * <Form.Dropdown
1311
1377
  * id="dropdown"
1312
1378
  * title="Favorite Language"
@@ -1371,7 +1437,13 @@ export interface FormDropdownSectionProps {
1371
1437
  *
1372
1438
  * export default function Command() {
1373
1439
  * return (
1374
- * <Form onSubmit={(values) => console.log(values)}>
1440
+ * <Form
1441
+ * actions={
1442
+ * <ActionPanel>
1443
+ * <SubmitFormAction title="Submit Favorite" onSubmit={(values) => console.log(values)} />
1444
+ * </ActionPanel>
1445
+ * }
1446
+ * >
1375
1447
  * <Form.Dropdown id="food" title="Favorite Food">
1376
1448
  * <Form.Dropdown.Section title="Fruits">
1377
1449
  * <Form.Dropdown.Item value="apple" title="Apple" icon="🍎" />
@@ -1428,7 +1500,13 @@ export interface FormDropdownItemProps {
1428
1500
  *
1429
1501
  * export default function Command() {
1430
1502
  * return (
1431
- * <Form onSubmit={(values) => console.log(values)}>
1503
+ * <Form
1504
+ * actions={
1505
+ * <ActionPanel>
1506
+ * <SubmitFormAction title="Submit Icon" onSubmit={(values) => console.log(values)} />
1507
+ * </ActionPanel>
1508
+ * }
1509
+ * >
1432
1510
  * <Form.Dropdown id="icon" title="Icon">
1433
1511
  * <Form.Dropdown.Item value="circle" title="Cirlce" icon={Icon.Circle} />
1434
1512
  * </Form.Dropdown>
@@ -1489,7 +1567,13 @@ export interface FormTagPickerProps extends FormItemProps<string[]> {
1489
1567
  *
1490
1568
  * export default function Command() {
1491
1569
  * return (
1492
- * <Form onSubmit={(values) => console.log(values)}>
1570
+ * <Form
1571
+ * actions={
1572
+ * <ActionPanel>
1573
+ * <SubmitFormAction title="Submit Favorite" onSubmit={(values) => console.log(values)} />
1574
+ * </ActionPanel>
1575
+ * }
1576
+ * >
1493
1577
  * <Form.TagPicker id="sports" title="Favorite Sports" defaultValue={["football"]}>
1494
1578
  * <Form.TagPicker.Item value="basketball" title="Basketball" icon="🏀" />
1495
1579
  * <Form.TagPicker.Item value="football" title="Football" icon="⚽️" />
@@ -1511,7 +1595,13 @@ export interface FormTagPickerProps extends FormItemProps<string[]> {
1511
1595
  * const [countries, setCountries] = useState<string[]>(["ger", "ned", "pol"]);
1512
1596
  *
1513
1597
  * return (
1514
- * <Form onSubmit={(values) => console.log(values)}>
1598
+ * <Form
1599
+ * actions={
1600
+ * <ActionPanel>
1601
+ * <SubmitFormAction title="Submit Countries" onSubmit={(values) => console.log(values)} />
1602
+ * </ActionPanel>
1603
+ * }
1604
+ * >
1515
1605
  * <Form.TagPicker id="countries" title="Visited Countries" value={countries} onChange={setCountries}>
1516
1606
  * <Form.TagPicker.Item value="ger" title="Germany" icon="🇩🇪" />
1517
1607
  * <Form.TagPicker.Item value="ind" title="India" icon="🇮🇳" />
@@ -1573,9 +1663,17 @@ export interface FormTagPickerItemProps {
1573
1663
  *
1574
1664
  * export default function Command() {
1575
1665
  * return (
1576
- * <Form onSubmit={(values) => console.log(values)}>
1666
+ * <Form
1667
+ * actions={
1668
+ * <ActionPanel>
1669
+ * <SubmitFormAction title="Submit Color" onSubmit={(values) => console.log(values)} />
1670
+ * </ActionPanel>
1671
+ * }
1672
+ * >
1577
1673
  * <Form.TagPicker id="color" title="Color">
1578
- * <Form.TagPicker.Item value="ger" title="Germany" icon={{ source: Icon.Circle, tintColor: Color.Red }} />
1674
+ * <Form.TagPicker.Item value="red" title="Red" icon={{ source: Icon.Circle, tintColor: Color.Red }} />
1675
+ * <Form.TagPicker.Item value="green" title="Green" icon={{ source: Icon.Circle, tintColor: Color.Green }} />
1676
+ * <Form.TagPicker.Item value="blue" title="Blue" icon={{ source: Icon.Circle, tintColor: Color.Blue }} />
1579
1677
  * </Form.TagPicker>
1580
1678
  * </Form>
1581
1679
  * );
@@ -2970,12 +3068,13 @@ export function confirmAlert(options: AlertOptions): Promise<boolean>;
2970
3068
  * primaryAction: {
2971
3069
  * title: 'Do something',
2972
3070
  * onAction: () => {
3071
+ * // while you can register a handler for an action, it's more elegant
3072
+ * // to use the `if (await confirmAlert(...)) { ... }` pattern
2973
3073
  * console.log("The alert action has been triggered")
2974
3074
  * }
2975
3075
  * }
2976
3076
  * };
2977
- * const alert = new Alert(options);
2978
- * await alert.show();
3077
+ * await confirmAlert(options);
2979
3078
  * };
2980
3079
  * ```
2981
3080
  *