@vicinae/api 0.12.2 → 0.13.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/dist/api/components/form.js +3 -1
- package/dist/api/components/grid.d.ts +7 -5
- package/dist/api/components/grid.js +17 -3
- package/dist/api/controls.d.ts +43 -1
- package/dist/api/controls.js +90 -3
- package/dist/api/proto/manager.d.ts +2 -1
- package/dist/api/proto/manager.js +24 -8
- package/dist/api/proto/ui.d.ts +2 -0
- package/dist/api/proto/ui.js +37 -6
- package/dist/api/toast.d.ts +0 -9
- package/dist/api/toast.js +1 -20
- package/package.json +6 -5
- package/types/jsx.d.ts +2 -2
|
@@ -14,7 +14,9 @@ const wrapFormItemProps = (props) => {
|
|
|
14
14
|
};
|
|
15
15
|
};
|
|
16
16
|
const FormRoot = ({ enableDrafts = false, actions, children, isLoading = false, navigationTitle, searchBarAccessory, }) => {
|
|
17
|
-
return ((0, jsx_runtime_1.jsxs)("form", {
|
|
17
|
+
return ((0, jsx_runtime_1.jsxs)("form", {
|
|
18
|
+
//@ts-ignore
|
|
19
|
+
enableDrafts: enableDrafts, isLoading: isLoading, navigationTitle: navigationTitle, children: [searchBarAccessory, children, actions] }));
|
|
18
20
|
};
|
|
19
21
|
const TextField = ({ ref, ...props }) => {
|
|
20
22
|
(0, use_imperative_form_handle_1.useImperativeFormHandle)(ref);
|
|
@@ -10,9 +10,8 @@ type SectionConfig = {
|
|
|
10
10
|
inset?: GridInset;
|
|
11
11
|
columns?: number;
|
|
12
12
|
fit?: GridFit;
|
|
13
|
-
aspectRatio?:
|
|
13
|
+
aspectRatio?: Grid.AspectRatio;
|
|
14
14
|
};
|
|
15
|
-
type GridAspectRatio = "1" | "3/2" | "2/3" | "4/3" | "3/4" | "16/9" | "9/16";
|
|
16
15
|
declare enum GridFit {
|
|
17
16
|
Contain = "contain",
|
|
18
17
|
Fill = "fill"
|
|
@@ -21,11 +20,12 @@ export declare namespace Grid {
|
|
|
21
20
|
namespace Section {
|
|
22
21
|
type Props = GridSectionProps;
|
|
23
22
|
}
|
|
23
|
+
type Fit = GridFit;
|
|
24
24
|
type Props = GridProps;
|
|
25
25
|
type Inset = GridInset;
|
|
26
|
-
type AspectRatio =
|
|
26
|
+
type AspectRatio = "1" | "3/2" | "2/3" | "4/3" | "3/4" | "16/9" | "9/16" | '21/9' | '9/21' | '32/9' | '9/32';
|
|
27
27
|
namespace Item {
|
|
28
|
-
type Props = {
|
|
28
|
+
export type Props = {
|
|
29
29
|
title?: string;
|
|
30
30
|
detail?: React.ReactNode;
|
|
31
31
|
keywords?: string[];
|
|
@@ -49,7 +49,7 @@ export declare namespace Grid {
|
|
|
49
49
|
color: Color;
|
|
50
50
|
value: string | Date | undefined | null;
|
|
51
51
|
};
|
|
52
|
-
type Accessory = ({
|
|
52
|
+
export type Accessory = ({
|
|
53
53
|
tag?: Tag;
|
|
54
54
|
} | {
|
|
55
55
|
text?: Text;
|
|
@@ -57,6 +57,7 @@ export declare namespace Grid {
|
|
|
57
57
|
icon?: Image.ImageLike;
|
|
58
58
|
tooltip?: string | null;
|
|
59
59
|
};
|
|
60
|
+
export {};
|
|
60
61
|
}
|
|
61
62
|
}
|
|
62
63
|
type GridProps = SectionConfig & {
|
|
@@ -109,6 +110,7 @@ export declare const Grid: React.FC<GridProps> & {
|
|
|
109
110
|
children?: ReactNode;
|
|
110
111
|
}>;
|
|
111
112
|
};
|
|
113
|
+
Fit: typeof GridFit;
|
|
112
114
|
Inset: typeof GridInset;
|
|
113
115
|
Item: React.FC<Grid.Item.Props> & {
|
|
114
116
|
Accessory: React.FC<Grid.Item.Accessory>;
|
|
@@ -13,6 +13,19 @@ var GridInset;
|
|
|
13
13
|
GridInset["Medium"] = "medium";
|
|
14
14
|
GridInset["Large"] = "large";
|
|
15
15
|
})(GridInset || (GridInset = {}));
|
|
16
|
+
const aspectRatioMap = {
|
|
17
|
+
'1': 1,
|
|
18
|
+
'3/2': 3 / 2,
|
|
19
|
+
'2/3': 2 / 3,
|
|
20
|
+
'4/3': 4 / 3,
|
|
21
|
+
'3/4': 3 / 4,
|
|
22
|
+
'16/9': 16 / 9,
|
|
23
|
+
'9/16': 9 / 16,
|
|
24
|
+
'21/9': 21 / 9,
|
|
25
|
+
'9/21': 9 / 21,
|
|
26
|
+
'32/9': 32 / 9,
|
|
27
|
+
'9/32': 9 / 32
|
|
28
|
+
};
|
|
16
29
|
var GridFit;
|
|
17
30
|
(function (GridFit) {
|
|
18
31
|
GridFit["Contain"] = "contain";
|
|
@@ -23,7 +36,7 @@ const GridRoot = ({ searchBarAccessory, children, actions, inset, fit = GridFit.
|
|
|
23
36
|
typeof props.filtering === "undefined") {
|
|
24
37
|
props.filtering = props.enableFiltering;
|
|
25
38
|
}
|
|
26
|
-
return ((0, jsx_runtime_1.jsxs)("grid", { fit: fit, inset: inset, aspectRatio: aspectRatio, ...props, children: [searchBarAccessory, children, actions] }));
|
|
39
|
+
return ((0, jsx_runtime_1.jsxs)("grid", { fit: fit, inset: inset, aspectRatio: aspectRatioMap[aspectRatio], ...props, children: [searchBarAccessory, children, actions] }));
|
|
27
40
|
};
|
|
28
41
|
const GridItem = ({ detail, actions, keywords, ...props }) => {
|
|
29
42
|
const id = (0, react_1.useRef)(props.id ?? (0, crypto_1.randomUUID)());
|
|
@@ -53,10 +66,10 @@ const GridItem = ({ detail, actions, keywords, ...props }) => {
|
|
|
53
66
|
}
|
|
54
67
|
return ((0, jsx_runtime_1.jsxs)("grid-item", { ...nativeProps, children: [detail, actions] }));
|
|
55
68
|
};
|
|
56
|
-
const GridSection = ({ fit
|
|
69
|
+
const GridSection = ({ fit, aspectRatio, inset, ...props }) => {
|
|
57
70
|
const nativeProps = {
|
|
58
71
|
fit,
|
|
59
|
-
aspectRatio,
|
|
72
|
+
aspectRatio: aspectRatio ? aspectRatioMap[aspectRatio] : aspectRatio,
|
|
60
73
|
inset,
|
|
61
74
|
...props,
|
|
62
75
|
};
|
|
@@ -70,6 +83,7 @@ exports.Grid = Object.assign(GridRoot, {
|
|
|
70
83
|
Section: GridSection,
|
|
71
84
|
EmptyView: empty_view_1.EmptyView,
|
|
72
85
|
Dropdown: dropdown_1.Dropdown,
|
|
86
|
+
Fit: GridFit,
|
|
73
87
|
Inset: GridInset,
|
|
74
88
|
Item: Object.assign(GridItem, {
|
|
75
89
|
Accessory: exports.GridAccessory,
|
package/dist/api/controls.d.ts
CHANGED
|
@@ -1,6 +1,48 @@
|
|
|
1
|
-
export declare
|
|
1
|
+
export declare enum PopToRootType {
|
|
2
|
+
/**
|
|
3
|
+
* Translates to Immediate or Suspended depending on the
|
|
4
|
+
* user configuration.
|
|
5
|
+
*/
|
|
6
|
+
Default = "default",
|
|
7
|
+
/**
|
|
8
|
+
* Immediately pop to root
|
|
9
|
+
*/
|
|
10
|
+
Immediate = "immediate",
|
|
11
|
+
/**
|
|
12
|
+
* Do not pop to root, preserve the navigation state as it is
|
|
13
|
+
*/
|
|
14
|
+
Suspended = "suspended"
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Close the window and show a small HUD where the window was previously opened.
|
|
18
|
+
* Note that the HUD may not be shown in some environments.
|
|
19
|
+
* Similarly to `closeWindow`, it is possible to override the pop to root behavior directly
|
|
20
|
+
* by passing options to this function.
|
|
21
|
+
*
|
|
22
|
+
* @see closeWindow
|
|
23
|
+
*/
|
|
24
|
+
export declare const showHUD: (title: string, options?: {
|
|
25
|
+
clearRootSearch?: boolean;
|
|
26
|
+
popToRootType?: PopToRootType;
|
|
27
|
+
}) => Promise<void>;
|
|
28
|
+
/**
|
|
29
|
+
* Close the vicinae launcher window immediately.
|
|
30
|
+
* It is possible to override the `popToRoot` behavior defined in the settings using the options object.
|
|
31
|
+
*/
|
|
32
|
+
export declare const closeMainWindow: (options?: {
|
|
33
|
+
clearRootSearch?: boolean;
|
|
34
|
+
popToRootType?: PopToRootType;
|
|
35
|
+
}) => Promise<void>;
|
|
2
36
|
export declare const clearSearchBar: () => Promise<void>;
|
|
37
|
+
/**
|
|
38
|
+
* Get the text that is currently selected by the user.
|
|
39
|
+
* How this is implemented depends on the environment but all it does is usually
|
|
40
|
+
* read the clipboard's primary selection buffer.
|
|
41
|
+
*/
|
|
3
42
|
export declare const getSelectedText: () => Promise<string>;
|
|
43
|
+
/**
|
|
44
|
+
* Pop to the root of the navigation stack, optionally clearing the search bar.
|
|
45
|
+
*/
|
|
4
46
|
export declare const popToRoot: (options?: {
|
|
5
47
|
clearSearchBar?: boolean;
|
|
6
48
|
}) => Promise<void>;
|
package/dist/api/controls.js
CHANGED
|
@@ -1,15 +1,99 @@
|
|
|
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
|
+
})();
|
|
2
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.popToRoot = exports.getSelectedText = exports.clearSearchBar = exports.closeMainWindow = void 0;
|
|
36
|
+
exports.popToRoot = exports.getSelectedText = exports.clearSearchBar = exports.closeMainWindow = exports.showHUD = exports.PopToRootType = void 0;
|
|
4
37
|
const bus_1 = require("./bus");
|
|
5
|
-
const
|
|
6
|
-
|
|
38
|
+
const ui = __importStar(require("./proto/ui"));
|
|
39
|
+
var PopToRootType;
|
|
40
|
+
(function (PopToRootType) {
|
|
41
|
+
/**
|
|
42
|
+
* Translates to Immediate or Suspended depending on the
|
|
43
|
+
* user configuration.
|
|
44
|
+
*/
|
|
45
|
+
PopToRootType["Default"] = "default";
|
|
46
|
+
/**
|
|
47
|
+
* Immediately pop to root
|
|
48
|
+
*/
|
|
49
|
+
PopToRootType["Immediate"] = "immediate";
|
|
50
|
+
/**
|
|
51
|
+
* Do not pop to root, preserve the navigation state as it is
|
|
52
|
+
*/
|
|
53
|
+
PopToRootType["Suspended"] = "suspended";
|
|
54
|
+
})(PopToRootType || (exports.PopToRootType = PopToRootType = {}));
|
|
55
|
+
const popToRootProtoMap = {
|
|
56
|
+
[PopToRootType.Default]: ui.PopToRootType.PopToRootDefault,
|
|
57
|
+
[PopToRootType.Immediate]: ui.PopToRootType.PopToRootImmediate,
|
|
58
|
+
[PopToRootType.Suspended]: ui.PopToRootType.PopToRootSuspended,
|
|
59
|
+
};
|
|
60
|
+
/**
|
|
61
|
+
* Close the window and show a small HUD where the window was previously opened.
|
|
62
|
+
* Note that the HUD may not be shown in some environments.
|
|
63
|
+
* Similarly to `closeWindow`, it is possible to override the pop to root behavior directly
|
|
64
|
+
* by passing options to this function.
|
|
65
|
+
*
|
|
66
|
+
* @see closeWindow
|
|
67
|
+
*/
|
|
68
|
+
const showHUD = async (title, options) => {
|
|
69
|
+
bus_1.bus.turboRequest('ui.showHud', {
|
|
70
|
+
text: title,
|
|
71
|
+
clearRootSearch: options?.clearRootSearch ?? false,
|
|
72
|
+
popToRoot: popToRootProtoMap[options?.popToRootType ?? PopToRootType.Default]
|
|
73
|
+
});
|
|
74
|
+
};
|
|
75
|
+
exports.showHUD = showHUD;
|
|
76
|
+
/**
|
|
77
|
+
* Close the vicinae launcher window immediately.
|
|
78
|
+
* It is possible to override the `popToRoot` behavior defined in the settings using the options object.
|
|
79
|
+
*/
|
|
80
|
+
const closeMainWindow = async (options = {}) => {
|
|
81
|
+
const { clearRootSearch = false, popToRootType = PopToRootType.Default } = options;
|
|
82
|
+
await bus_1.bus.turboRequest("ui.closeMainWindow", {
|
|
83
|
+
clearRootSearch,
|
|
84
|
+
popToRoot: popToRootProtoMap[popToRootType]
|
|
85
|
+
});
|
|
7
86
|
};
|
|
8
87
|
exports.closeMainWindow = closeMainWindow;
|
|
9
88
|
const clearSearchBar = async () => {
|
|
10
89
|
await bus_1.bus.turboRequest("ui.setSearchText", { text: "" });
|
|
11
90
|
};
|
|
12
91
|
exports.clearSearchBar = clearSearchBar;
|
|
92
|
+
/**
|
|
93
|
+
* Get the text that is currently selected by the user.
|
|
94
|
+
* How this is implemented depends on the environment but all it does is usually
|
|
95
|
+
* read the clipboard's primary selection buffer.
|
|
96
|
+
*/
|
|
13
97
|
const getSelectedText = async () => {
|
|
14
98
|
const response = await bus_1.bus.turboRequest("ui.getSelectedText", {});
|
|
15
99
|
if (!response.ok) {
|
|
@@ -18,6 +102,9 @@ const getSelectedText = async () => {
|
|
|
18
102
|
return response.value.text;
|
|
19
103
|
};
|
|
20
104
|
exports.getSelectedText = getSelectedText;
|
|
105
|
+
/**
|
|
106
|
+
* Pop to the root of the navigation stack, optionally clearing the search bar.
|
|
107
|
+
*/
|
|
21
108
|
const popToRoot = async (options) => {
|
|
22
109
|
await bus_1.bus.turboRequest('ui.popToRoot', { clearSearchBar: options?.clearSearchBar ?? false });
|
|
23
110
|
};
|
|
@@ -29,7 +29,7 @@ export interface ResponseData {
|
|
|
29
29
|
export interface ManagerLoadCommand {
|
|
30
30
|
mode: CommandMode;
|
|
31
31
|
env: CommandEnv;
|
|
32
|
-
|
|
32
|
+
vicinaePath: string;
|
|
33
33
|
/** javascript source file to execute */
|
|
34
34
|
entrypoint: string;
|
|
35
35
|
preferenceValues: {
|
|
@@ -40,6 +40,7 @@ export interface ManagerLoadCommand {
|
|
|
40
40
|
};
|
|
41
41
|
isRaycast: boolean;
|
|
42
42
|
commandName: string;
|
|
43
|
+
extensionId: string;
|
|
43
44
|
}
|
|
44
45
|
export interface ManagerLoadCommand_PreferenceValuesEntry {
|
|
45
46
|
key: string;
|
|
@@ -277,12 +277,13 @@ function createBaseManagerLoadCommand() {
|
|
|
277
277
|
return {
|
|
278
278
|
mode: 0,
|
|
279
279
|
env: 0,
|
|
280
|
-
|
|
280
|
+
vicinaePath: "",
|
|
281
281
|
entrypoint: "",
|
|
282
282
|
preferenceValues: {},
|
|
283
283
|
argumentValues: {},
|
|
284
284
|
isRaycast: false,
|
|
285
285
|
commandName: "",
|
|
286
|
+
extensionId: "",
|
|
286
287
|
};
|
|
287
288
|
}
|
|
288
289
|
exports.ManagerLoadCommand = {
|
|
@@ -293,8 +294,8 @@ exports.ManagerLoadCommand = {
|
|
|
293
294
|
if (message.env !== 0) {
|
|
294
295
|
writer.uint32(16).int32(message.env);
|
|
295
296
|
}
|
|
296
|
-
if (message.
|
|
297
|
-
writer.uint32(26).string(message.
|
|
297
|
+
if (message.vicinaePath !== "") {
|
|
298
|
+
writer.uint32(26).string(message.vicinaePath);
|
|
298
299
|
}
|
|
299
300
|
if (message.entrypoint !== "") {
|
|
300
301
|
writer.uint32(34).string(message.entrypoint);
|
|
@@ -315,6 +316,9 @@ exports.ManagerLoadCommand = {
|
|
|
315
316
|
if (message.commandName !== "") {
|
|
316
317
|
writer.uint32(66).string(message.commandName);
|
|
317
318
|
}
|
|
319
|
+
if (message.extensionId !== "") {
|
|
320
|
+
writer.uint32(74).string(message.extensionId);
|
|
321
|
+
}
|
|
318
322
|
return writer;
|
|
319
323
|
},
|
|
320
324
|
decode(input, length) {
|
|
@@ -342,7 +346,7 @@ exports.ManagerLoadCommand = {
|
|
|
342
346
|
if (tag !== 26) {
|
|
343
347
|
break;
|
|
344
348
|
}
|
|
345
|
-
message.
|
|
349
|
+
message.vicinaePath = reader.string();
|
|
346
350
|
continue;
|
|
347
351
|
}
|
|
348
352
|
case 4: {
|
|
@@ -386,6 +390,13 @@ exports.ManagerLoadCommand = {
|
|
|
386
390
|
message.commandName = reader.string();
|
|
387
391
|
continue;
|
|
388
392
|
}
|
|
393
|
+
case 9: {
|
|
394
|
+
if (tag !== 74) {
|
|
395
|
+
break;
|
|
396
|
+
}
|
|
397
|
+
message.extensionId = reader.string();
|
|
398
|
+
continue;
|
|
399
|
+
}
|
|
389
400
|
}
|
|
390
401
|
if ((tag & 7) === 4 || tag === 0) {
|
|
391
402
|
break;
|
|
@@ -398,7 +409,7 @@ exports.ManagerLoadCommand = {
|
|
|
398
409
|
return {
|
|
399
410
|
mode: isSet(object.mode) ? commandModeFromJSON(object.mode) : 0,
|
|
400
411
|
env: isSet(object.env) ? commandEnvFromJSON(object.env) : 0,
|
|
401
|
-
|
|
412
|
+
vicinaePath: isSet(object.vicinaePath) ? globalThis.String(object.vicinaePath) : "",
|
|
402
413
|
entrypoint: isSet(object.entrypoint) ? globalThis.String(object.entrypoint) : "",
|
|
403
414
|
preferenceValues: isObject(object.preferenceValues)
|
|
404
415
|
? Object.entries(object.preferenceValues).reduce((acc, [key, value]) => {
|
|
@@ -414,6 +425,7 @@ exports.ManagerLoadCommand = {
|
|
|
414
425
|
: {},
|
|
415
426
|
isRaycast: isSet(object.isRaycast) ? globalThis.Boolean(object.isRaycast) : false,
|
|
416
427
|
commandName: isSet(object.commandName) ? globalThis.String(object.commandName) : "",
|
|
428
|
+
extensionId: isSet(object.extensionId) ? globalThis.String(object.extensionId) : "",
|
|
417
429
|
};
|
|
418
430
|
},
|
|
419
431
|
toJSON(message) {
|
|
@@ -424,8 +436,8 @@ exports.ManagerLoadCommand = {
|
|
|
424
436
|
if (message.env !== 0) {
|
|
425
437
|
obj.env = commandEnvToJSON(message.env);
|
|
426
438
|
}
|
|
427
|
-
if (message.
|
|
428
|
-
obj.
|
|
439
|
+
if (message.vicinaePath !== "") {
|
|
440
|
+
obj.vicinaePath = message.vicinaePath;
|
|
429
441
|
}
|
|
430
442
|
if (message.entrypoint !== "") {
|
|
431
443
|
obj.entrypoint = message.entrypoint;
|
|
@@ -454,6 +466,9 @@ exports.ManagerLoadCommand = {
|
|
|
454
466
|
if (message.commandName !== "") {
|
|
455
467
|
obj.commandName = message.commandName;
|
|
456
468
|
}
|
|
469
|
+
if (message.extensionId !== "") {
|
|
470
|
+
obj.extensionId = message.extensionId;
|
|
471
|
+
}
|
|
457
472
|
return obj;
|
|
458
473
|
},
|
|
459
474
|
create(base) {
|
|
@@ -463,7 +478,7 @@ exports.ManagerLoadCommand = {
|
|
|
463
478
|
const message = createBaseManagerLoadCommand();
|
|
464
479
|
message.mode = object.mode ?? 0;
|
|
465
480
|
message.env = object.env ?? 0;
|
|
466
|
-
message.
|
|
481
|
+
message.vicinaePath = object.vicinaePath ?? "";
|
|
467
482
|
message.entrypoint = object.entrypoint ?? "";
|
|
468
483
|
message.preferenceValues = Object.entries(object.preferenceValues ?? {}).reduce((acc, [key, value]) => {
|
|
469
484
|
if (value !== undefined) {
|
|
@@ -479,6 +494,7 @@ exports.ManagerLoadCommand = {
|
|
|
479
494
|
}, {});
|
|
480
495
|
message.isRaycast = object.isRaycast ?? false;
|
|
481
496
|
message.commandName = object.commandName ?? "";
|
|
497
|
+
message.extensionId = object.extensionId ?? "";
|
|
482
498
|
return message;
|
|
483
499
|
},
|
|
484
500
|
};
|
package/dist/api/proto/ui.d.ts
CHANGED
package/dist/api/proto/ui.js
CHANGED
|
@@ -456,10 +456,16 @@ exports.PopViewRequest = {
|
|
|
456
456
|
},
|
|
457
457
|
};
|
|
458
458
|
function createBaseCloseMainWindowRequest() {
|
|
459
|
-
return {};
|
|
459
|
+
return { clearRootSearch: false, popToRoot: 0 };
|
|
460
460
|
}
|
|
461
461
|
exports.CloseMainWindowRequest = {
|
|
462
|
-
encode(
|
|
462
|
+
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
463
|
+
if (message.clearRootSearch !== false) {
|
|
464
|
+
writer.uint32(8).bool(message.clearRootSearch);
|
|
465
|
+
}
|
|
466
|
+
if (message.popToRoot !== 0) {
|
|
467
|
+
writer.uint32(16).int32(message.popToRoot);
|
|
468
|
+
}
|
|
463
469
|
return writer;
|
|
464
470
|
},
|
|
465
471
|
decode(input, length) {
|
|
@@ -469,6 +475,20 @@ exports.CloseMainWindowRequest = {
|
|
|
469
475
|
while (reader.pos < end) {
|
|
470
476
|
const tag = reader.uint32();
|
|
471
477
|
switch (tag >>> 3) {
|
|
478
|
+
case 1: {
|
|
479
|
+
if (tag !== 8) {
|
|
480
|
+
break;
|
|
481
|
+
}
|
|
482
|
+
message.clearRootSearch = reader.bool();
|
|
483
|
+
continue;
|
|
484
|
+
}
|
|
485
|
+
case 2: {
|
|
486
|
+
if (tag !== 16) {
|
|
487
|
+
break;
|
|
488
|
+
}
|
|
489
|
+
message.popToRoot = reader.int32();
|
|
490
|
+
continue;
|
|
491
|
+
}
|
|
472
492
|
}
|
|
473
493
|
if ((tag & 7) === 4 || tag === 0) {
|
|
474
494
|
break;
|
|
@@ -477,18 +497,29 @@ exports.CloseMainWindowRequest = {
|
|
|
477
497
|
}
|
|
478
498
|
return message;
|
|
479
499
|
},
|
|
480
|
-
fromJSON(
|
|
481
|
-
return {
|
|
500
|
+
fromJSON(object) {
|
|
501
|
+
return {
|
|
502
|
+
clearRootSearch: isSet(object.clearRootSearch) ? globalThis.Boolean(object.clearRootSearch) : false,
|
|
503
|
+
popToRoot: isSet(object.popToRoot) ? popToRootTypeFromJSON(object.popToRoot) : 0,
|
|
504
|
+
};
|
|
482
505
|
},
|
|
483
|
-
toJSON(
|
|
506
|
+
toJSON(message) {
|
|
484
507
|
const obj = {};
|
|
508
|
+
if (message.clearRootSearch !== false) {
|
|
509
|
+
obj.clearRootSearch = message.clearRootSearch;
|
|
510
|
+
}
|
|
511
|
+
if (message.popToRoot !== 0) {
|
|
512
|
+
obj.popToRoot = popToRootTypeToJSON(message.popToRoot);
|
|
513
|
+
}
|
|
485
514
|
return obj;
|
|
486
515
|
},
|
|
487
516
|
create(base) {
|
|
488
517
|
return exports.CloseMainWindowRequest.fromPartial(base ?? {});
|
|
489
518
|
},
|
|
490
|
-
fromPartial(
|
|
519
|
+
fromPartial(object) {
|
|
491
520
|
const message = createBaseCloseMainWindowRequest();
|
|
521
|
+
message.clearRootSearch = object.clearRootSearch ?? false;
|
|
522
|
+
message.popToRoot = object.popToRoot ?? 0;
|
|
492
523
|
return message;
|
|
493
524
|
},
|
|
494
525
|
};
|
package/dist/api/toast.d.ts
CHANGED
|
@@ -157,12 +157,3 @@ export declare interface ToastOptions extends Toast.Options {
|
|
|
157
157
|
*/
|
|
158
158
|
export declare const ToastStyle: typeof Toast.Style;
|
|
159
159
|
export declare const showToast: (init: Toast.Style | Toast.Options, title?: string, message?: string) => Promise<Toast>;
|
|
160
|
-
export declare enum PopToRootType {
|
|
161
|
-
Default = "default",
|
|
162
|
-
Immediate = "immediate",
|
|
163
|
-
Suspended = "suspended"
|
|
164
|
-
}
|
|
165
|
-
export declare const showHUD: (title: string, options?: {
|
|
166
|
-
clearRootSearch?: boolean;
|
|
167
|
-
popToRootType?: PopToRootType;
|
|
168
|
-
}) => Promise<void>;
|
package/dist/api/toast.js
CHANGED
|
@@ -33,7 +33,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.
|
|
36
|
+
exports.showToast = exports.Toast = void 0;
|
|
37
37
|
const crypto_1 = require("crypto");
|
|
38
38
|
const bus_1 = require("./bus");
|
|
39
39
|
const ui = __importStar(require("./proto/ui"));
|
|
@@ -200,22 +200,3 @@ const showToast = async (init, title = "", message) => {
|
|
|
200
200
|
return toast;
|
|
201
201
|
};
|
|
202
202
|
exports.showToast = showToast;
|
|
203
|
-
var PopToRootType;
|
|
204
|
-
(function (PopToRootType) {
|
|
205
|
-
PopToRootType["Default"] = "default";
|
|
206
|
-
PopToRootType["Immediate"] = "immediate";
|
|
207
|
-
PopToRootType["Suspended"] = "suspended";
|
|
208
|
-
})(PopToRootType || (exports.PopToRootType = PopToRootType = {}));
|
|
209
|
-
const popToRootProtoMap = {
|
|
210
|
-
[PopToRootType.Default]: ui.PopToRootType.PopToRootDefault,
|
|
211
|
-
[PopToRootType.Immediate]: ui.PopToRootType.PopToRootImmediate,
|
|
212
|
-
[PopToRootType.Suspended]: ui.PopToRootType.PopToRootSuspended,
|
|
213
|
-
};
|
|
214
|
-
const showHUD = async (title, options) => {
|
|
215
|
-
bus_1.bus.turboRequest('ui.showHud', {
|
|
216
|
-
text: title,
|
|
217
|
-
clearRootSearch: options?.clearRootSearch ?? false,
|
|
218
|
-
popToRoot: popToRootProtoMap[options?.popToRootType ?? PopToRootType.Default]
|
|
219
|
-
});
|
|
220
|
-
};
|
|
221
|
-
exports.showHUD = showHUD;
|
package/package.json
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vicinae/api",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.1",
|
|
4
4
|
"description": "TypeScript SDK to build Vicinae extensions",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
7
7
|
"build": "tsc --outDir dist",
|
|
8
|
+
"protogen": "mkdir ./src/api/proto && protoc --plugin=./node_modules/.bin/protoc-gen-ts_proto -I../proto ../proto/*.proto --ts_proto_out ./src/api/proto",
|
|
8
9
|
"pack": "npm run build && npm pack",
|
|
9
10
|
"docgen-html": "typedoc src/api/index.ts",
|
|
10
|
-
"docgen-md": "typedoc src/api/index.ts --readme none --plugin typedoc-plugin-markdown --out ./docs"
|
|
11
|
+
"docgen-md": "typedoc src/api/index.ts --disableSources --readme none --plugin typedoc-plugin-markdown --out ./docs"
|
|
11
12
|
},
|
|
12
13
|
"bin": {
|
|
13
14
|
"vici": "./bin/run.js"
|
|
@@ -32,16 +33,16 @@
|
|
|
32
33
|
"@oclif/plugin-help": "^6",
|
|
33
34
|
"@oclif/plugin-plugins": "^5",
|
|
34
35
|
"@types/node": ">=18",
|
|
35
|
-
"@types/react": "
|
|
36
|
+
"@types/react": "19.0.10",
|
|
36
37
|
"chalk": "^5.6.0",
|
|
37
38
|
"chokidar": "^4.0.3",
|
|
38
39
|
"esbuild": "^0.25.2",
|
|
39
|
-
"react": "
|
|
40
|
+
"react": "19.0.0",
|
|
40
41
|
"zod": "^4.0.17"
|
|
41
42
|
},
|
|
42
43
|
"peerDependencies": {
|
|
43
44
|
"@types/node": ">=18",
|
|
44
|
-
"@types/react": "
|
|
45
|
+
"@types/react": "19.0.10"
|
|
45
46
|
},
|
|
46
47
|
"devDependencies": {
|
|
47
48
|
"@bufbuild/protobuf": "^2.7.0",
|
package/types/jsx.d.ts
CHANGED