@vicinae/api 0.20.8 → 0.20.10
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/alert.d.ts +1 -1
- package/dist/api/alert.js +9 -14
- package/dist/api/client.d.ts +7 -0
- package/dist/api/client.js +11 -0
- package/dist/api/clipboard.d.ts +4 -8
- package/dist/api/clipboard.js +13 -18
- package/dist/api/color.d.ts +4 -10
- package/dist/api/color.js +8 -47
- package/dist/api/command.js +4 -6
- package/dist/api/controls.js +9 -56
- package/dist/api/environment.d.ts +0 -11
- package/dist/api/environment.js +2 -1
- package/dist/api/file-search.d.ts +3 -4
- package/dist/api/file-search.js +6 -4
- package/dist/api/globals.d.ts +9 -0
- package/dist/api/globals.js +5 -0
- package/dist/api/hooks/use-imperative-form-handle.d.ts +1 -1
- package/dist/api/hooks/use-imperative-form-handle.js +6 -3
- package/dist/api/hooks/use-navigation.d.ts +2 -2
- package/dist/api/hooks/use-navigation.js +2 -5
- package/dist/api/image.d.ts +4 -4
- package/dist/api/image.js +12 -51
- package/dist/api/index.d.ts +0 -2
- package/dist/api/index.js +0 -2
- package/dist/api/local-storage.js +7 -14
- package/dist/api/oauth.d.ts +1 -1
- package/dist/api/oauth.js +7 -15
- package/dist/api/preference.d.ts +2 -4
- package/dist/api/preference.js +10 -6
- package/dist/api/proto/api.d.ts +240 -0
- package/dist/api/proto/api.js +271 -0
- package/dist/api/toast.js +7 -77
- package/dist/api/utils.d.ts +6 -2
- package/dist/api/utils.js +9 -26
- package/dist/api/window-management.d.ts +3 -5
- package/dist/api/window-management.js +14 -27
- package/dist/schemas/manifest.d.ts +3 -3
- package/package.json +1 -4
- package/dist/api/bus.d.ts +0 -125
- package/dist/api/bus.js +0 -201
- package/dist/api/context/index.d.ts +0 -1
- package/dist/api/context/index.js +0 -17
- package/dist/api/context/navigation-context.d.ts +0 -7
- package/dist/api/context/navigation-context.js +0 -12
- package/dist/api/context/navigation-provider.d.ts +0 -7
- package/dist/api/context/navigation-provider.js +0 -58
- package/dist/api/hooks.d.ts +0 -1
- package/dist/api/hooks.js +0 -30
- package/dist/api/proto/application.d.ts +0 -79
- package/dist/api/proto/application.js +0 -826
- package/dist/api/proto/clipboard.d.ts +0 -88
- package/dist/api/proto/clipboard.js +0 -929
- package/dist/api/proto/command.d.ts +0 -35
- package/dist/api/proto/command.js +0 -182
- package/dist/api/proto/common.d.ts +0 -28
- package/dist/api/proto/common.js +0 -102
- package/dist/api/proto/extension.d.ts +0 -106
- package/dist/api/proto/extension.js +0 -1122
- package/dist/api/proto/file-search.d.ts +0 -42
- package/dist/api/proto/file-search.js +0 -290
- package/dist/api/proto/google/protobuf/struct.d.ts +0 -107
- package/dist/api/proto/google/protobuf/struct.js +0 -456
- package/dist/api/proto/ipc.d.ts +0 -64
- package/dist/api/proto/ipc.js +0 -604
- package/dist/api/proto/manager.d.ts +0 -87
- package/dist/api/proto/manager.js +0 -776
- package/dist/api/proto/oauth.d.ts +0 -97
- package/dist/api/proto/oauth.js +0 -994
- package/dist/api/proto/storage.d.ts +0 -80
- package/dist/api/proto/storage.js +0 -804
- package/dist/api/proto/ui.d.ts +0 -208
- package/dist/api/proto/ui.js +0 -2316
- package/dist/api/proto/wlr-clipboard.d.ts +0 -30
- package/dist/api/proto/wlr-clipboard.js +0 -158
- package/dist/api/proto/wm.d.ts +0 -142
- package/dist/api/proto/wm.js +0 -1714
package/dist/api/alert.d.ts
CHANGED
package/dist/api/alert.js
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.confirmAlert = exports.Alert = void 0;
|
|
4
|
-
const
|
|
5
|
-
const image_1 = require("./image");
|
|
6
|
-
const ui_1 = require("./proto/ui");
|
|
4
|
+
const client_1 = require("./client");
|
|
7
5
|
/**
|
|
8
6
|
* @category Alert
|
|
9
7
|
*/
|
|
@@ -17,9 +15,9 @@ var Alert;
|
|
|
17
15
|
})(ActionStyle = Alert.ActionStyle || (Alert.ActionStyle = {}));
|
|
18
16
|
})(Alert || (exports.Alert = Alert = {}));
|
|
19
17
|
const styleMap = {
|
|
20
|
-
[Alert.ActionStyle.Default]:
|
|
21
|
-
[Alert.ActionStyle.Destructive]:
|
|
22
|
-
[Alert.ActionStyle.Cancel]:
|
|
18
|
+
[Alert.ActionStyle.Default]: "Default",
|
|
19
|
+
[Alert.ActionStyle.Destructive]: "Destructive",
|
|
20
|
+
[Alert.ActionStyle.Cancel]: "Cancel",
|
|
23
21
|
};
|
|
24
22
|
/**
|
|
25
23
|
* Display a confirmation dialog with a cancel and confirm options.
|
|
@@ -41,10 +39,10 @@ const styleMap = {
|
|
|
41
39
|
*/
|
|
42
40
|
const confirmAlert = async (options) => {
|
|
43
41
|
return new Promise((resolve) => {
|
|
44
|
-
|
|
42
|
+
(0, client_1.getClient)().UI.confirmAlert({
|
|
45
43
|
title: options.title,
|
|
46
44
|
description: options.message ?? "Are you sure?",
|
|
47
|
-
icon: options.icon &&
|
|
45
|
+
//icon: options.icon && serializeProtoImage(options.icon),
|
|
48
46
|
rememberUserChoice: false,
|
|
49
47
|
primaryAction: {
|
|
50
48
|
title: options.primaryAction?.title ?? "Confirm",
|
|
@@ -54,17 +52,14 @@ const confirmAlert = async (options) => {
|
|
|
54
52
|
title: options.dismissAction?.title ?? "Cancel",
|
|
55
53
|
style: styleMap[options.dismissAction?.style ?? Alert.ActionStyle.Cancel],
|
|
56
54
|
},
|
|
57
|
-
})
|
|
58
|
-
|
|
59
|
-
if (!res.ok)
|
|
60
|
-
return false;
|
|
61
|
-
if (res.value.confirmed) {
|
|
55
|
+
}).then((confirmed) => {
|
|
56
|
+
if (confirmed) {
|
|
62
57
|
options.primaryAction?.onAction?.();
|
|
63
58
|
}
|
|
64
59
|
else {
|
|
65
60
|
options.dismissAction?.onAction?.();
|
|
66
61
|
}
|
|
67
|
-
resolve(
|
|
62
|
+
resolve(confirmed);
|
|
68
63
|
});
|
|
69
64
|
});
|
|
70
65
|
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Client } from "./proto/api";
|
|
2
|
+
/**
|
|
3
|
+
* Client used to access vicinae capabilities from the extension runtime.
|
|
4
|
+
* Always use this function instead of caching the client at module load time,
|
|
5
|
+
* as the client is only initialized after the extension command is activated.
|
|
6
|
+
*/
|
|
7
|
+
export declare const getClient: () => Client;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getClient = void 0;
|
|
4
|
+
const globals_1 = require("./globals");
|
|
5
|
+
/**
|
|
6
|
+
* Client used to access vicinae capabilities from the extension runtime.
|
|
7
|
+
* Always use this function instead of caching the client at module load time,
|
|
8
|
+
* as the client is only initialized after the extension command is activated.
|
|
9
|
+
*/
|
|
10
|
+
const getClient = () => (0, globals_1.getGlobal)().client;
|
|
11
|
+
exports.getClient = getClient;
|
package/dist/api/clipboard.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PathLike } from "fs";
|
|
1
|
+
import type { PathLike } from "node:fs";
|
|
2
2
|
/**
|
|
3
3
|
* Access system clipboard and clipboard history features.
|
|
4
4
|
*
|
|
@@ -14,7 +14,7 @@ export declare namespace Clipboard {
|
|
|
14
14
|
text?: string;
|
|
15
15
|
};
|
|
16
16
|
type ReadContent = {
|
|
17
|
-
text
|
|
17
|
+
text?: string;
|
|
18
18
|
file?: string;
|
|
19
19
|
html?: string;
|
|
20
20
|
};
|
|
@@ -42,9 +42,7 @@ export declare namespace Clipboard {
|
|
|
42
42
|
* const { text, html, file } = await Clipboard.read();
|
|
43
43
|
* ```
|
|
44
44
|
*/
|
|
45
|
-
function read(
|
|
46
|
-
offset?: number;
|
|
47
|
-
}): Promise<Clipboard.ReadContent>;
|
|
45
|
+
function read(): Promise<Clipboard.ReadContent>;
|
|
48
46
|
/**
|
|
49
47
|
* Read the text representation of the current clipboard data. If the data is not text at all, this
|
|
50
48
|
* returns an empty string.
|
|
@@ -55,9 +53,7 @@ export declare namespace Clipboard {
|
|
|
55
53
|
* const text = await Clipboard.readText();
|
|
56
54
|
* ```
|
|
57
55
|
*/
|
|
58
|
-
function readText(
|
|
59
|
-
offset?: number;
|
|
60
|
-
}): Promise<string>;
|
|
56
|
+
function readText(): Promise<string>;
|
|
61
57
|
/**
|
|
62
58
|
* Clear the current clipboard content.
|
|
63
59
|
*/
|
package/dist/api/clipboard.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Clipboard = void 0;
|
|
4
|
-
const
|
|
5
|
-
const clipboard_1 = require("./proto/clipboard");
|
|
4
|
+
const client_1 = require("./client");
|
|
6
5
|
/**
|
|
7
6
|
* Access system clipboard and clipboard history features.
|
|
8
7
|
*
|
|
@@ -11,16 +10,17 @@ const clipboard_1 = require("./proto/clipboard");
|
|
|
11
10
|
var Clipboard;
|
|
12
11
|
(function (Clipboard) {
|
|
13
12
|
function mapContent(content) {
|
|
14
|
-
let ct =
|
|
13
|
+
let ct = {};
|
|
15
14
|
if (typeof content !== "object") {
|
|
16
15
|
ct.text = `${content}`;
|
|
17
16
|
}
|
|
18
17
|
else {
|
|
19
18
|
if (content["file"]) {
|
|
20
|
-
ct.path =
|
|
19
|
+
ct.path = content["file"];
|
|
21
20
|
}
|
|
22
21
|
else if (content["html"]) {
|
|
23
|
-
ct.html =
|
|
22
|
+
ct.html = content["html"];
|
|
23
|
+
ct.text = content["text"];
|
|
24
24
|
}
|
|
25
25
|
else {
|
|
26
26
|
ct.text = content["text"];
|
|
@@ -34,9 +34,8 @@ var Clipboard;
|
|
|
34
34
|
* does not get indexed by the Vicinae clipboard manager.
|
|
35
35
|
*/
|
|
36
36
|
async function copy(text, options = {}) {
|
|
37
|
-
await
|
|
38
|
-
|
|
39
|
-
options: { concealed: options.concealed ?? false },
|
|
37
|
+
await (0, client_1.getClient)().Clipboard.copy(mapContent(text), {
|
|
38
|
+
concealed: options.concealed ?? false,
|
|
40
39
|
});
|
|
41
40
|
}
|
|
42
41
|
Clipboard.copy = copy;
|
|
@@ -47,9 +46,7 @@ var Clipboard;
|
|
|
47
46
|
* clipboard copy.
|
|
48
47
|
*/
|
|
49
48
|
async function paste(text) {
|
|
50
|
-
await
|
|
51
|
-
content: mapContent(text),
|
|
52
|
-
});
|
|
49
|
+
await (0, client_1.getClient)().Clipboard.paste(mapContent(text));
|
|
53
50
|
}
|
|
54
51
|
Clipboard.paste = paste;
|
|
55
52
|
/**
|
|
@@ -60,9 +57,8 @@ var Clipboard;
|
|
|
60
57
|
* const { text, html, file } = await Clipboard.read();
|
|
61
58
|
* ```
|
|
62
59
|
*/
|
|
63
|
-
async function read(
|
|
64
|
-
|
|
65
|
-
return res.unwrap().content;
|
|
60
|
+
async function read() {
|
|
61
|
+
return (0, client_1.getClient)().Clipboard.readContent();
|
|
66
62
|
}
|
|
67
63
|
Clipboard.read = read;
|
|
68
64
|
/**
|
|
@@ -75,16 +71,15 @@ var Clipboard;
|
|
|
75
71
|
* const text = await Clipboard.readText();
|
|
76
72
|
* ```
|
|
77
73
|
*/
|
|
78
|
-
async function readText(
|
|
79
|
-
|
|
80
|
-
return text;
|
|
74
|
+
async function readText() {
|
|
75
|
+
return read().then((r) => r.text ?? "");
|
|
81
76
|
}
|
|
82
77
|
Clipboard.readText = readText;
|
|
83
78
|
/**
|
|
84
79
|
* Clear the current clipboard content.
|
|
85
80
|
*/
|
|
86
81
|
async function clear() {
|
|
87
|
-
await
|
|
82
|
+
await (0, client_1.getClient)().Clipboard.clear();
|
|
88
83
|
}
|
|
89
84
|
Clipboard.clear = clear;
|
|
90
85
|
})(Clipboard || (exports.Clipboard = Clipboard = {}));
|
package/dist/api/color.d.ts
CHANGED
|
@@ -1,14 +1,9 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
type DynamicColor = {
|
|
3
|
-
dark: string;
|
|
4
|
-
light: string;
|
|
5
|
-
adjustContrast?: boolean;
|
|
6
|
-
};
|
|
1
|
+
import type * as api from "./proto/api";
|
|
7
2
|
/**
|
|
8
3
|
* @category Colors
|
|
9
4
|
*/
|
|
10
5
|
export declare namespace Color {
|
|
11
|
-
type Dynamic = DynamicColor;
|
|
6
|
+
type Dynamic = api.DynamicColor;
|
|
12
7
|
type Raw = string;
|
|
13
8
|
}
|
|
14
9
|
/**
|
|
@@ -29,6 +24,5 @@ export declare enum Color {
|
|
|
29
24
|
* @category Colors
|
|
30
25
|
*/
|
|
31
26
|
export type ColorLike = Color.Dynamic | Color.Raw | Color;
|
|
32
|
-
export type SerializedColorLike =
|
|
33
|
-
export declare const serializeColorLike: (color: ColorLike) =>
|
|
34
|
-
export {};
|
|
27
|
+
export type SerializedColorLike = api.ColorLike;
|
|
28
|
+
export declare const serializeColorLike: (color: ColorLike) => api.ColorLike;
|
package/dist/api/color.js
CHANGED
|
@@ -1,40 +1,6 @@
|
|
|
1
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
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
3
|
exports.serializeColorLike = exports.Color = void 0;
|
|
37
|
-
const ui = __importStar(require("./proto/ui"));
|
|
38
4
|
/**
|
|
39
5
|
* @category Colors
|
|
40
6
|
*/
|
|
@@ -51,20 +17,15 @@ var Color;
|
|
|
51
17
|
Color["SecondaryText"] = "secondary-text";
|
|
52
18
|
})(Color || (exports.Color = Color = {}));
|
|
53
19
|
const serializeColorLike = (color) => {
|
|
54
|
-
const colorLike = ui.ColorLike.create();
|
|
55
20
|
if (typeof color === "string") {
|
|
56
|
-
|
|
21
|
+
return { raw: color };
|
|
57
22
|
}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
}
|
|
66
|
-
colorLike.dynamic = dynamicColor;
|
|
67
|
-
}
|
|
68
|
-
return colorLike;
|
|
23
|
+
return {
|
|
24
|
+
dynamic: {
|
|
25
|
+
light: color.light,
|
|
26
|
+
dark: color.dark,
|
|
27
|
+
adjustContrast: color.adjustContrast,
|
|
28
|
+
},
|
|
29
|
+
};
|
|
69
30
|
};
|
|
70
31
|
exports.serializeColorLike = serializeColorLike;
|
package/dist/api/command.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.updateCommandMetadata = updateCommandMetadata;
|
|
4
|
-
const
|
|
4
|
+
const client_1 = require("./client");
|
|
5
5
|
/**
|
|
6
6
|
* Update the values of properties declared in the manifest of the current command.
|
|
7
7
|
* Currently only `subtitle` is supported. Pass `null` to clear the custom subtitle.
|
|
@@ -9,9 +9,7 @@ const bus_1 = require("./bus");
|
|
|
9
9
|
* Raycast API: https://developers.raycast.com/api-reference/command#updatecommandmetadata
|
|
10
10
|
*/
|
|
11
11
|
async function updateCommandMetadata(metadata) {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
await bus_1.bus.request("command.updateCommandMetadata", payload);
|
|
12
|
+
await (0, client_1.getClient)().Command.updateCommandMetadata({
|
|
13
|
+
subtitle: metadata.subtitle ?? undefined,
|
|
14
|
+
});
|
|
17
15
|
}
|
package/dist/api/controls.js
CHANGED
|
@@ -1,41 +1,7 @@
|
|
|
1
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
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
3
|
exports.popToRoot = exports.getSelectedText = exports.clearSearchBar = exports.closeMainWindow = exports.showHUD = exports.PopToRootType = void 0;
|
|
37
|
-
const
|
|
38
|
-
const ui = __importStar(require("./proto/ui"));
|
|
4
|
+
const client_1 = require("./client");
|
|
39
5
|
/**
|
|
40
6
|
* @category Launcher Window
|
|
41
7
|
*/
|
|
@@ -56,9 +22,9 @@ var PopToRootType;
|
|
|
56
22
|
PopToRootType["Suspended"] = "suspended";
|
|
57
23
|
})(PopToRootType || (exports.PopToRootType = PopToRootType = {}));
|
|
58
24
|
const popToRootProtoMap = {
|
|
59
|
-
[PopToRootType.Default]:
|
|
60
|
-
[PopToRootType.Immediate]:
|
|
61
|
-
[PopToRootType.Suspended]:
|
|
25
|
+
[PopToRootType.Default]: "Default",
|
|
26
|
+
[PopToRootType.Immediate]: "Immediate",
|
|
27
|
+
[PopToRootType.Suspended]: "Suspended",
|
|
62
28
|
};
|
|
63
29
|
/**
|
|
64
30
|
* Close the window and show a small HUD where the window was previously opened.
|
|
@@ -71,11 +37,7 @@ const popToRootProtoMap = {
|
|
|
71
37
|
* @category Launcher Window
|
|
72
38
|
*/
|
|
73
39
|
const showHUD = async (title, options) => {
|
|
74
|
-
|
|
75
|
-
text: title,
|
|
76
|
-
clearRootSearch: options?.clearRootSearch ?? false,
|
|
77
|
-
popToRoot: popToRootProtoMap[options?.popToRootType ?? PopToRootType.Default],
|
|
78
|
-
});
|
|
40
|
+
(0, client_1.getClient)().UI.showHud(title, options?.clearRootSearch ?? false, popToRootProtoMap[options?.popToRootType ?? PopToRootType.Default]);
|
|
79
41
|
};
|
|
80
42
|
exports.showHUD = showHUD;
|
|
81
43
|
/**
|
|
@@ -86,17 +48,14 @@ exports.showHUD = showHUD;
|
|
|
86
48
|
*/
|
|
87
49
|
const closeMainWindow = async (options = {}) => {
|
|
88
50
|
const { clearRootSearch = false, popToRootType = PopToRootType.Default } = options;
|
|
89
|
-
await
|
|
90
|
-
clearRootSearch,
|
|
91
|
-
popToRoot: popToRootProtoMap[popToRootType],
|
|
92
|
-
});
|
|
51
|
+
await (0, client_1.getClient)().UI.closeMainWindow(clearRootSearch, popToRootProtoMap[popToRootType]);
|
|
93
52
|
};
|
|
94
53
|
exports.closeMainWindow = closeMainWindow;
|
|
95
54
|
/**
|
|
96
55
|
* @category Launcher Window
|
|
97
56
|
*/
|
|
98
57
|
const clearSearchBar = async () => {
|
|
99
|
-
await
|
|
58
|
+
await (0, client_1.getClient)().UI.setSearchText("");
|
|
100
59
|
};
|
|
101
60
|
exports.clearSearchBar = clearSearchBar;
|
|
102
61
|
/**
|
|
@@ -107,11 +66,7 @@ exports.clearSearchBar = clearSearchBar;
|
|
|
107
66
|
* @category Launcher Window
|
|
108
67
|
*/
|
|
109
68
|
const getSelectedText = async () => {
|
|
110
|
-
|
|
111
|
-
if (!response.ok) {
|
|
112
|
-
throw new Error(`Failed to get selected text`);
|
|
113
|
-
}
|
|
114
|
-
return response.value.text;
|
|
69
|
+
return (0, client_1.getClient)().UI.getSelectedText();
|
|
115
70
|
};
|
|
116
71
|
exports.getSelectedText = getSelectedText;
|
|
117
72
|
/**
|
|
@@ -120,8 +75,6 @@ exports.getSelectedText = getSelectedText;
|
|
|
120
75
|
* @category Launcher Window
|
|
121
76
|
*/
|
|
122
77
|
const popToRoot = async (options) => {
|
|
123
|
-
await
|
|
124
|
-
clearSearchBar: options?.clearSearchBar ?? false,
|
|
125
|
-
});
|
|
78
|
+
await (0, client_1.getClient)().UI.popToRoot(options?.clearSearchBar ?? false);
|
|
126
79
|
};
|
|
127
80
|
exports.popToRoot = popToRoot;
|
|
@@ -131,15 +131,4 @@ export interface Environment {
|
|
|
131
131
|
*/
|
|
132
132
|
isRaycast: boolean;
|
|
133
133
|
}
|
|
134
|
-
/**
|
|
135
|
-
* General information about the running extension command, the vicinae version, the capabilities of
|
|
136
|
-
* the system we are running on, etc...
|
|
137
|
-
*
|
|
138
|
-
* @example
|
|
139
|
-
* ```typescript
|
|
140
|
-
* import { environment } from '@vicinae/api';
|
|
141
|
-
*
|
|
142
|
-
* console.log({ environment });
|
|
143
|
-
* ```
|
|
144
|
-
*/
|
|
145
134
|
export declare const environment: Environment;
|
package/dist/api/environment.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import type * as api from "./proto/api";
|
|
2
2
|
/**
|
|
3
3
|
* Access Vicinae's built-in file search functionality.
|
|
4
4
|
*
|
|
@@ -22,8 +22,7 @@ export declare namespace FileSearch {
|
|
|
22
22
|
/**
|
|
23
23
|
* For now we provide no options, but in the future we will implement mime type and file type filtering.
|
|
24
24
|
* */
|
|
25
|
-
type
|
|
26
|
-
type FileInfo = ProtoFileInfo;
|
|
25
|
+
type FileInfo = api.FileInfo;
|
|
27
26
|
/**
|
|
28
27
|
* Search for files matching the provided query string.
|
|
29
28
|
*
|
|
@@ -42,5 +41,5 @@ export declare namespace FileSearch {
|
|
|
42
41
|
* const files = await fileSearch.search('invoice');
|
|
43
42
|
* ```
|
|
44
43
|
*/
|
|
45
|
-
function search(query: string
|
|
44
|
+
function search(query: string): Promise<FileSearch.FileInfo[]>;
|
|
46
45
|
}
|
package/dist/api/file-search.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.FileSearch = void 0;
|
|
4
|
-
const
|
|
4
|
+
const client_1 = require("./client");
|
|
5
5
|
/**
|
|
6
6
|
* Access Vicinae's built-in file search functionality.
|
|
7
7
|
*
|
|
@@ -23,6 +23,9 @@ const bus_1 = require("./bus");
|
|
|
23
23
|
*/
|
|
24
24
|
var FileSearch;
|
|
25
25
|
(function (FileSearch) {
|
|
26
|
+
/**
|
|
27
|
+
* For now we provide no options, but in the future we will implement mime type and file type filtering.
|
|
28
|
+
* */
|
|
26
29
|
/**
|
|
27
30
|
* Search for files matching the provided query string.
|
|
28
31
|
*
|
|
@@ -41,9 +44,8 @@ var FileSearch;
|
|
|
41
44
|
* const files = await fileSearch.search('invoice');
|
|
42
45
|
* ```
|
|
43
46
|
*/
|
|
44
|
-
async function search(query
|
|
45
|
-
|
|
46
|
-
return res.unwrap().files;
|
|
47
|
+
async function search(query) {
|
|
48
|
+
return (0, client_1.getClient)().FileSearch.search(query);
|
|
47
49
|
}
|
|
48
50
|
FileSearch.search = search;
|
|
49
51
|
})(FileSearch || (exports.FileSearch = FileSearch = {}));
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type React from "react";
|
|
2
|
+
import type { Environment } from "./environment";
|
|
3
|
+
export interface VicinaGlobal {
|
|
4
|
+
client: any;
|
|
5
|
+
environ: Environment;
|
|
6
|
+
preferences: any;
|
|
7
|
+
navigationContext: React.Context<any>;
|
|
8
|
+
}
|
|
9
|
+
export declare const getGlobal: () => VicinaGlobal;
|
|
@@ -2,21 +2,24 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.useImperativeFormHandle = void 0;
|
|
4
4
|
const react_1 = require("react");
|
|
5
|
-
const bus_1 = require("../bus");
|
|
6
5
|
const node_crypto_1 = require("node:crypto");
|
|
7
6
|
const useImperativeFormHandle = (ref) => {
|
|
8
7
|
const handleId = (0, react_1.useRef)((0, node_crypto_1.randomUUID)());
|
|
9
8
|
(0, react_1.useImperativeHandle)(ref, () => {
|
|
10
9
|
return {
|
|
11
10
|
focus: () => {
|
|
12
|
-
|
|
11
|
+
/*
|
|
12
|
+
bus.emit(handleId.current, {
|
|
13
13
|
type: "focus",
|
|
14
14
|
});
|
|
15
|
+
*/
|
|
15
16
|
},
|
|
16
17
|
reset: () => {
|
|
17
|
-
|
|
18
|
+
/*
|
|
19
|
+
bus.emit(handleId.current, {
|
|
18
20
|
type: "reset",
|
|
19
21
|
});
|
|
22
|
+
*/
|
|
20
23
|
},
|
|
21
24
|
};
|
|
22
25
|
}, []);
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.useNavigation = void 0;
|
|
7
4
|
const react_1 = require("react");
|
|
8
|
-
const
|
|
5
|
+
const globals_1 = require("../globals");
|
|
9
6
|
/**
|
|
10
7
|
* A React hook that lets you access methods to push and pop views
|
|
11
8
|
* on the navigation stack.
|
|
@@ -13,7 +10,7 @@ const navigation_context_1 = __importDefault(require("../context/navigation-cont
|
|
|
13
10
|
* @category Navigation
|
|
14
11
|
*/
|
|
15
12
|
const useNavigation = () => {
|
|
16
|
-
const { push, pop } = (0, react_1.useContext)(
|
|
13
|
+
const { push, pop } = (0, react_1.useContext)((0, globals_1.getGlobal)().navigationContext);
|
|
17
14
|
return { push, pop };
|
|
18
15
|
};
|
|
19
16
|
exports.useNavigation = useNavigation;
|
package/dist/api/image.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type ColorLike } from "./color";
|
|
2
|
-
import
|
|
3
|
-
import * as
|
|
2
|
+
import { Icon } from "./icon";
|
|
3
|
+
import type * as api from "./proto/api";
|
|
4
4
|
/**
|
|
5
5
|
* Representation of an image, renderable everywhere Vicine expects them.
|
|
6
6
|
* @category Image
|
|
@@ -15,7 +15,7 @@ export type Image = {
|
|
|
15
15
|
* @category Image
|
|
16
16
|
*/
|
|
17
17
|
export type ImageLike = Image.ImageLike;
|
|
18
|
-
export type SerializedImageLike = URL | Image.Asset | Icon |
|
|
18
|
+
export type SerializedImageLike = URL | Image.Asset | Icon | api.Image | Image.ThemedImage;
|
|
19
19
|
/**
|
|
20
20
|
* @category Image
|
|
21
21
|
*/
|
|
@@ -37,4 +37,4 @@ export declare namespace Image {
|
|
|
37
37
|
RoundedRectangle = "roundedRectangle"
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
|
-
export declare const serializeProtoImage: (image: ImageLike) =>
|
|
40
|
+
export declare const serializeProtoImage: (image: ImageLike) => api.Image;
|