@vicinae/api 0.10.0 → 0.12.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/dist/api/local-storage.js +1 -1
- package/dist/api/raycast/components/action-panel.d.ts +18 -0
- package/dist/api/raycast/components/action-panel.js +41 -0
- package/dist/api/raycast/index.d.ts +4 -2
- package/dist/api/raycast/index.js +12 -2
- package/dist/api/raycast/local-storage.d.ts +9 -0
- package/dist/api/raycast/local-storage.js +13 -0
- package/dist/api/raycast/utils.d.ts +2 -0
- package/dist/api/raycast/utils.js +6 -0
- package/package.json +1 -1
|
@@ -5,7 +5,7 @@ const bus_1 = require("./bus");
|
|
|
5
5
|
class LocalStorage {
|
|
6
6
|
static async getItem(key) {
|
|
7
7
|
const res = await bus_1.bus.turboRequest("storage.get", { key });
|
|
8
|
-
if (!res.ok) {
|
|
8
|
+
if (!res.ok || res.value.value === null) {
|
|
9
9
|
return undefined;
|
|
10
10
|
}
|
|
11
11
|
return res.value.value;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as vicinae from '../../';
|
|
2
|
+
export declare const ActionPanel: import("react").FC<vicinae.ActionPanelProps> & {
|
|
3
|
+
Section: import("react").FC<import("react").PropsWithChildren<vicinae.ActionPanelSectionProps>>;
|
|
4
|
+
Submenu: import("react").FC<vicinae.ActionPanelSubmenuProps>;
|
|
5
|
+
} & {
|
|
6
|
+
Item: import("react").FC<vicinae.ActionProps> & {
|
|
7
|
+
CopyToClipboard: import("react").FC<vicinae.CopyToClipboardProps>;
|
|
8
|
+
Push: import("react").FC<vicinae.ActionPushProps>;
|
|
9
|
+
Open: import("react").FC<vicinae.ActionOpenProps>;
|
|
10
|
+
Paste: import("react").FC<vicinae.ActionPasteProps>;
|
|
11
|
+
SubmitForm: import("react").FC<vicinae.ActionSubmitFormProps>;
|
|
12
|
+
OpenInBrowser: import("react").FC<vicinae.ActionOpenInBrowserProps>;
|
|
13
|
+
Style: {
|
|
14
|
+
Regular: "regular";
|
|
15
|
+
Destructive: "destructive";
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.ActionPanel = void 0;
|
|
37
|
+
const vicinae = __importStar(require("../../"));
|
|
38
|
+
// older versions of the Raycast API had ActionPanel.Item
|
|
39
|
+
exports.ActionPanel = Object.assign(vicinae.ActionPanel, {
|
|
40
|
+
Item: vicinae.Action
|
|
41
|
+
});
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
* dealing with a Raycast extension, e.g an extension that makes use of
|
|
4
4
|
* `@raycast/api` package instead of `@vicinae/api`.
|
|
5
5
|
*/
|
|
6
|
-
export * from "../components/index.js";
|
|
7
6
|
export * from "../hooks/index.js";
|
|
8
7
|
export * from "../context/index.js";
|
|
9
8
|
export * from "../bus.js";
|
|
@@ -16,9 +15,12 @@ export * from "../controls.js";
|
|
|
16
15
|
export * from "../cache";
|
|
17
16
|
export * from "../toast";
|
|
18
17
|
export * from "../clipboard.js";
|
|
19
|
-
export * from "../local-storage.js";
|
|
20
18
|
export * from "../oauth.js";
|
|
21
19
|
export * from "../alert.js";
|
|
22
20
|
export * from "../preference.js";
|
|
23
21
|
export * from "./system.js";
|
|
22
|
+
export * from "./local-storage.js";
|
|
24
23
|
export * from './window-management.js';
|
|
24
|
+
export { randomId } from './utils.js';
|
|
25
|
+
export { List, Grid, Form, Detail, Action } from '../components';
|
|
26
|
+
export { ActionPanel } from "./components/action-panel.js";
|
|
@@ -19,7 +19,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
19
19
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
20
20
|
};
|
|
21
21
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
-
|
|
22
|
+
exports.ActionPanel = exports.Action = exports.Detail = exports.Form = exports.Grid = exports.List = exports.randomId = void 0;
|
|
23
23
|
__exportStar(require("../hooks/index.js"), exports);
|
|
24
24
|
__exportStar(require("../context/index.js"), exports);
|
|
25
25
|
__exportStar(require("../bus.js"), exports);
|
|
@@ -32,9 +32,19 @@ __exportStar(require("../controls.js"), exports);
|
|
|
32
32
|
__exportStar(require("../cache"), exports);
|
|
33
33
|
__exportStar(require("../toast"), exports);
|
|
34
34
|
__exportStar(require("../clipboard.js"), exports);
|
|
35
|
-
__exportStar(require("../local-storage.js"), exports);
|
|
36
35
|
__exportStar(require("../oauth.js"), exports);
|
|
37
36
|
__exportStar(require("../alert.js"), exports);
|
|
38
37
|
__exportStar(require("../preference.js"), exports);
|
|
39
38
|
__exportStar(require("./system.js"), exports);
|
|
39
|
+
__exportStar(require("./local-storage.js"), exports);
|
|
40
40
|
__exportStar(require("./window-management.js"), exports);
|
|
41
|
+
var utils_js_1 = require("./utils.js");
|
|
42
|
+
Object.defineProperty(exports, "randomId", { enumerable: true, get: function () { return utils_js_1.randomId; } });
|
|
43
|
+
var components_1 = require("../components");
|
|
44
|
+
Object.defineProperty(exports, "List", { enumerable: true, get: function () { return components_1.List; } });
|
|
45
|
+
Object.defineProperty(exports, "Grid", { enumerable: true, get: function () { return components_1.Grid; } });
|
|
46
|
+
Object.defineProperty(exports, "Form", { enumerable: true, get: function () { return components_1.Form; } });
|
|
47
|
+
Object.defineProperty(exports, "Detail", { enumerable: true, get: function () { return components_1.Detail; } });
|
|
48
|
+
Object.defineProperty(exports, "Action", { enumerable: true, get: function () { return components_1.Action; } });
|
|
49
|
+
var action_panel_js_1 = require("./components/action-panel.js");
|
|
50
|
+
Object.defineProperty(exports, "ActionPanel", { enumerable: true, get: function () { return action_panel_js_1.ActionPanel; } });
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { LocalStorage } from '../local-storage';
|
|
2
|
+
export declare const allLocalStorageItems: typeof LocalStorage.allItems;
|
|
3
|
+
export declare const getLocalStorageItem: typeof LocalStorage.getItem;
|
|
4
|
+
export declare const setLocalStorageItem: typeof LocalStorage.setItem;
|
|
5
|
+
export declare const removeLocalStorageItem: typeof LocalStorage.removeItem;
|
|
6
|
+
export declare const clearLocalStorage: typeof LocalStorage.clear;
|
|
7
|
+
export type LocalStorageValues = LocalStorage.Values;
|
|
8
|
+
export type LocalStorageValue = LocalStorage.Value;
|
|
9
|
+
export { LocalStorage } from '../local-storage';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LocalStorage = exports.clearLocalStorage = exports.removeLocalStorageItem = exports.setLocalStorageItem = exports.getLocalStorageItem = exports.allLocalStorageItems = void 0;
|
|
4
|
+
const local_storage_1 = require("../local-storage");
|
|
5
|
+
// We support deprecated local storage methods:
|
|
6
|
+
// https://developers.raycast.com/misc/migration/v1.28.0#storage
|
|
7
|
+
exports.allLocalStorageItems = local_storage_1.LocalStorage.allItems;
|
|
8
|
+
exports.getLocalStorageItem = local_storage_1.LocalStorage.getItem;
|
|
9
|
+
exports.setLocalStorageItem = local_storage_1.LocalStorage.setItem;
|
|
10
|
+
exports.removeLocalStorageItem = local_storage_1.LocalStorage.removeItem;
|
|
11
|
+
exports.clearLocalStorage = local_storage_1.LocalStorage.clear;
|
|
12
|
+
var local_storage_2 = require("../local-storage");
|
|
13
|
+
Object.defineProperty(exports, "LocalStorage", { enumerable: true, get: function () { return local_storage_2.LocalStorage; } });
|