@vicinae/api 0.13.3 → 0.14.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/bus.d.ts +2 -0
- package/dist/api/clipboard.d.ts +34 -4
- package/dist/api/clipboard.js +38 -4
- package/dist/api/components/action-pannel.js +2 -6
- package/dist/api/components/actions.js +3 -13
- package/dist/api/components/dropdown.js +1 -2
- package/dist/api/components/empty-view.js +2 -6
- package/dist/api/components/form.js +1 -2
- package/dist/api/components/grid.d.ts +36 -40
- package/dist/api/components/grid.js +4 -35
- package/dist/api/components/list.d.ts +48 -47
- package/dist/api/components/list.js +3 -17
- package/dist/api/components/metadata.js +1 -5
- package/dist/api/components/tag.js +1 -5
- package/dist/api/controls.js +1 -0
- package/dist/api/image.d.ts +0 -7
- package/dist/api/image.js +1 -11
- package/dist/api/proto/clipboard.d.ts +23 -0
- package/dist/api/proto/clipboard.js +318 -3
- package/dist/api/proto/daemon.d.ts +23 -0
- package/dist/api/proto/daemon.js +332 -7
- package/package.json +2 -2
- package/types/jsx.d.ts +13 -11
- package/dist/api/raycast/components/action-panel.d.ts +0 -18
- package/dist/api/raycast/components/action-panel.js +0 -41
- package/dist/api/raycast/index.d.ts +0 -26
- package/dist/api/raycast/index.js +0 -50
- package/dist/api/raycast/local-storage.d.ts +0 -9
- package/dist/api/raycast/local-storage.js +0 -13
- package/dist/api/raycast/system.d.ts +0 -20
- package/dist/api/raycast/system.js +0 -73
- package/dist/api/raycast/utils.d.ts +0 -2
- package/dist/api/raycast/utils.js +0 -6
- package/dist/api/raycast/window-management.d.ts +0 -42
- package/dist/api/raycast/window-management.js +0 -82
package/dist/api/bus.d.ts
CHANGED
|
@@ -65,6 +65,8 @@ type EndpointMapping = {
|
|
|
65
65
|
"oauth.authorize": "oauth.authorize";
|
|
66
66
|
"clipboard.copy": "clipboard.copy";
|
|
67
67
|
"clipboard.paste": "clipboard.paste";
|
|
68
|
+
"clipboard.readContent": "clipboard.readContent";
|
|
69
|
+
"clipboard.clear": "clipboard.clear";
|
|
68
70
|
};
|
|
69
71
|
type RequestEndpoint = keyof EndpointMapping;
|
|
70
72
|
type ResponseEndpoint = EndpointMapping[RequestEndpoint];
|
package/dist/api/clipboard.d.ts
CHANGED
|
@@ -10,21 +10,51 @@ export declare namespace Clipboard {
|
|
|
10
10
|
};
|
|
11
11
|
type ReadContent = {
|
|
12
12
|
text: string;
|
|
13
|
-
} | {
|
|
14
13
|
file?: string;
|
|
15
|
-
} | {
|
|
16
14
|
html?: string;
|
|
17
15
|
};
|
|
18
16
|
type CopyOptions = {
|
|
19
17
|
concealed?: boolean;
|
|
20
18
|
};
|
|
19
|
+
/**
|
|
20
|
+
* Copy the provided content in the clipboard.
|
|
21
|
+
* The `concealed` option can be passed so that the created clipboard selection
|
|
22
|
+
* does not get indexed by the Vicinae clipboard manager.
|
|
23
|
+
*/
|
|
21
24
|
function copy(text: string | number | Clipboard.Content, options?: Clipboard.CopyOptions): Promise<void>;
|
|
25
|
+
/**
|
|
26
|
+
* Paste the provided clipboard content to the active window.
|
|
27
|
+
* If the environment does not support either getting the active window
|
|
28
|
+
* or pasting content to it directly, this will fallback to a regular
|
|
29
|
+
* clipboard copy.
|
|
30
|
+
*/
|
|
22
31
|
function paste(text: string | Clipboard.Content): Promise<void>;
|
|
32
|
+
/**
|
|
33
|
+
* Read the current content of the clipboard, which can contain text, html and a file path.
|
|
34
|
+
* Note: the offset option is not yet implemented
|
|
35
|
+
*
|
|
36
|
+
* ```ts
|
|
37
|
+
* const { text, html, file } = await Clipboard.read();
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
23
40
|
function read(options?: {
|
|
24
41
|
offset?: number;
|
|
25
42
|
}): Promise<Clipboard.ReadContent>;
|
|
43
|
+
/**
|
|
44
|
+
* Read the text representation of the current clipboard data. If the data is not text at all, this
|
|
45
|
+
* returns an empty string.
|
|
46
|
+
* If you want to read optional html or file path, consider @see {Clipboard.read}
|
|
47
|
+
* Note: the offset option is not yet implemented.
|
|
48
|
+
*
|
|
49
|
+
* ```ts
|
|
50
|
+
* const text = await Clipboard.readText();
|
|
51
|
+
* ```
|
|
52
|
+
*/
|
|
26
53
|
function readText(options?: {
|
|
27
54
|
offset?: number;
|
|
28
|
-
}): Promise<string
|
|
29
|
-
|
|
55
|
+
}): Promise<string>;
|
|
56
|
+
/**
|
|
57
|
+
* Clear the current clipboard content.
|
|
58
|
+
*/
|
|
59
|
+
function clear(): Promise<void>;
|
|
30
60
|
}
|
package/dist/api/clipboard.js
CHANGED
|
@@ -23,6 +23,11 @@ var Clipboard;
|
|
|
23
23
|
}
|
|
24
24
|
return ct;
|
|
25
25
|
}
|
|
26
|
+
/**
|
|
27
|
+
* Copy the provided content in the clipboard.
|
|
28
|
+
* The `concealed` option can be passed so that the created clipboard selection
|
|
29
|
+
* does not get indexed by the Vicinae clipboard manager.
|
|
30
|
+
*/
|
|
26
31
|
async function copy(text, options = {}) {
|
|
27
32
|
await bus_1.bus.turboRequest("clipboard.copy", {
|
|
28
33
|
content: mapContent(text),
|
|
@@ -30,22 +35,51 @@ var Clipboard;
|
|
|
30
35
|
});
|
|
31
36
|
}
|
|
32
37
|
Clipboard.copy = copy;
|
|
38
|
+
/**
|
|
39
|
+
* Paste the provided clipboard content to the active window.
|
|
40
|
+
* If the environment does not support either getting the active window
|
|
41
|
+
* or pasting content to it directly, this will fallback to a regular
|
|
42
|
+
* clipboard copy.
|
|
43
|
+
*/
|
|
33
44
|
async function paste(text) {
|
|
34
45
|
await bus_1.bus.turboRequest("clipboard.paste", {
|
|
35
46
|
content: mapContent(text),
|
|
36
47
|
});
|
|
37
48
|
}
|
|
38
49
|
Clipboard.paste = paste;
|
|
50
|
+
/**
|
|
51
|
+
* Read the current content of the clipboard, which can contain text, html and a file path.
|
|
52
|
+
* Note: the offset option is not yet implemented
|
|
53
|
+
*
|
|
54
|
+
* ```ts
|
|
55
|
+
* const { text, html, file } = await Clipboard.read();
|
|
56
|
+
* ```
|
|
57
|
+
*/
|
|
39
58
|
async function read(options) {
|
|
40
|
-
|
|
59
|
+
const res = await bus_1.bus.turboRequest('clipboard.readContent', {});
|
|
60
|
+
return res.unwrap().content;
|
|
41
61
|
}
|
|
42
62
|
Clipboard.read = read;
|
|
63
|
+
/**
|
|
64
|
+
* Read the text representation of the current clipboard data. If the data is not text at all, this
|
|
65
|
+
* returns an empty string.
|
|
66
|
+
* If you want to read optional html or file path, consider @see {Clipboard.read}
|
|
67
|
+
* Note: the offset option is not yet implemented.
|
|
68
|
+
*
|
|
69
|
+
* ```ts
|
|
70
|
+
* const text = await Clipboard.readText();
|
|
71
|
+
* ```
|
|
72
|
+
*/
|
|
43
73
|
async function readText(options) {
|
|
44
|
-
|
|
74
|
+
const { text } = await read(options);
|
|
75
|
+
return text;
|
|
45
76
|
}
|
|
46
77
|
Clipboard.readText = readText;
|
|
47
|
-
|
|
48
|
-
|
|
78
|
+
/**
|
|
79
|
+
* Clear the current clipboard content.
|
|
80
|
+
*/
|
|
81
|
+
async function clear() {
|
|
82
|
+
await bus_1.bus.turboRequest('clipboard.clear', {});
|
|
49
83
|
}
|
|
50
84
|
Clipboard.clear = clear;
|
|
51
85
|
})(Clipboard || (exports.Clipboard = Clipboard = {}));
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ActionPanel = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const image_1 = require("../image");
|
|
6
5
|
const ActionPanelRoot = (props) => {
|
|
7
6
|
const nativeProps = props;
|
|
8
7
|
return (0, jsx_runtime_1.jsx)("action-panel", { ...nativeProps });
|
|
@@ -13,11 +12,8 @@ const ActionPanelSection = (props) => {
|
|
|
13
12
|
};
|
|
14
13
|
return ((0, jsx_runtime_1.jsx)("action-panel-section", { ...nativeProps, children: props.children }));
|
|
15
14
|
};
|
|
16
|
-
const ActionPannelSubmenu = ({
|
|
17
|
-
|
|
18
|
-
if (icon)
|
|
19
|
-
nativeProps.icon = (0, image_1.serializeImageLike)(icon);
|
|
20
|
-
return ((0, jsx_runtime_1.jsx)("action-panel-submenu", { ...nativeProps, children: children }));
|
|
15
|
+
const ActionPannelSubmenu = ({ children, ...props }) => {
|
|
16
|
+
return ((0, jsx_runtime_1.jsx)("action-panel-submenu", { ...props, children: children }));
|
|
21
17
|
};
|
|
22
18
|
exports.ActionPanel = Object.assign(ActionPanelRoot, {
|
|
23
19
|
Section: ActionPanelSection,
|
|
@@ -4,18 +4,11 @@ exports.Action = void 0;
|
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const index_1 = require("../hooks/index");
|
|
6
6
|
const clipboard_1 = require("../clipboard");
|
|
7
|
-
const image_1 = require("../image");
|
|
8
7
|
const utils_1 = require("../utils");
|
|
9
8
|
const icon_1 = require("../icon");
|
|
10
9
|
const controls_1 = require("../controls");
|
|
11
|
-
const ActionRoot = (
|
|
12
|
-
|
|
13
|
-
...props,
|
|
14
|
-
};
|
|
15
|
-
if (icon) {
|
|
16
|
-
nativeProps.icon = (0, image_1.serializeImageLike)(icon);
|
|
17
|
-
}
|
|
18
|
-
return (0, jsx_runtime_1.jsx)("action", { ...nativeProps });
|
|
10
|
+
const ActionRoot = (props) => {
|
|
11
|
+
return (0, jsx_runtime_1.jsx)("action", { ...props });
|
|
19
12
|
};
|
|
20
13
|
const CopyToClipboard = ({ title = "Copy to clipboard", icon = icon_1.Icon.CopyClipboard, content, concealed = false, onCopy, ...props }) => {
|
|
21
14
|
return ((0, jsx_runtime_1.jsx)(ActionRoot, { title: title, ...props, icon: icon_1.Icon.CopyClipboard, onAction: async () => {
|
|
@@ -48,15 +41,12 @@ const Push = ({ target, ...props }) => {
|
|
|
48
41
|
push(target);
|
|
49
42
|
} }));
|
|
50
43
|
};
|
|
51
|
-
const SubmitForm = ({
|
|
44
|
+
const SubmitForm = ({ title = "Submit", ...props }) => {
|
|
52
45
|
const nativeProps = {
|
|
53
46
|
...props,
|
|
54
47
|
title,
|
|
55
48
|
onAction: () => { }
|
|
56
49
|
};
|
|
57
|
-
if (icon) {
|
|
58
|
-
nativeProps.icon = (0, image_1.serializeImageLike)(icon);
|
|
59
|
-
}
|
|
60
50
|
return (0, jsx_runtime_1.jsx)("action", { ...nativeProps });
|
|
61
51
|
};
|
|
62
52
|
exports.Action = Object.assign(ActionRoot, {
|
|
@@ -2,12 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Dropdown = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const image_1 = require("../image");
|
|
6
5
|
const DropdownRoot = ({ children, ...props }) => {
|
|
7
6
|
return ((0, jsx_runtime_1.jsx)("dropdown", { ...props, children: children }));
|
|
8
7
|
};
|
|
9
8
|
const Item = ({ title, value, icon }) => {
|
|
10
|
-
return ((0, jsx_runtime_1.jsx)("dropdown-item", { title: title, value: value, icon: icon
|
|
9
|
+
return ((0, jsx_runtime_1.jsx)("dropdown-item", { title: title, value: value, icon: icon }));
|
|
11
10
|
};
|
|
12
11
|
const Section = ({ title, children }) => {
|
|
13
12
|
return (0, jsx_runtime_1.jsx)("dropdown-section", { title: title, children: children });
|
|
@@ -2,11 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.EmptyView = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
const nativeProps = props;
|
|
8
|
-
if (icon)
|
|
9
|
-
nativeProps.icon = (0, image_1.serializeImageLike)(icon);
|
|
10
|
-
return (0, jsx_runtime_1.jsx)("empty-view", { ...nativeProps, children: actions });
|
|
5
|
+
const EmptyView = ({ actions, ...props }) => {
|
|
6
|
+
return (0, jsx_runtime_1.jsx)("empty-view", { ...props, children: actions });
|
|
11
7
|
};
|
|
12
8
|
exports.EmptyView = EmptyView;
|
|
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.Form = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const use_imperative_form_handle_1 = require("../hooks/use-imperative-form-handle");
|
|
6
|
-
const image_1 = require("../image");
|
|
7
6
|
const dropdown_1 = require("./dropdown");
|
|
8
7
|
const wrapFormItemProps = (props) => {
|
|
9
8
|
// TODO: pass the current value in the event
|
|
@@ -46,7 +45,7 @@ const TagPickerRoot = ({ children, ...props }) => {
|
|
|
46
45
|
return ((0, jsx_runtime_1.jsx)("tag-picker-field", { ...wrapFormItemProps(props), children: children }));
|
|
47
46
|
};
|
|
48
47
|
const TagPickerItem = ({ icon, ...props }) => {
|
|
49
|
-
return (0, jsx_runtime_1.jsx)("tag-picker-item", { ...props, icon: icon
|
|
48
|
+
return (0, jsx_runtime_1.jsx)("tag-picker-item", { ...props, icon: icon });
|
|
50
49
|
};
|
|
51
50
|
const TagPicker = Object.assign(TagPickerRoot, {
|
|
52
51
|
Item: TagPickerItem
|
|
@@ -6,25 +6,44 @@ declare enum GridInset {
|
|
|
6
6
|
Medium = "medium",
|
|
7
7
|
Large = "large"
|
|
8
8
|
}
|
|
9
|
-
type SectionConfig = {
|
|
10
|
-
inset?: GridInset;
|
|
11
|
-
columns?: number;
|
|
12
|
-
fit?: GridFit;
|
|
13
|
-
aspectRatio?: Grid.AspectRatio;
|
|
14
|
-
};
|
|
15
9
|
declare enum GridFit {
|
|
16
10
|
Contain = "contain",
|
|
17
11
|
Fill = "fill"
|
|
18
12
|
}
|
|
19
13
|
export declare namespace Grid {
|
|
20
|
-
|
|
21
|
-
|
|
14
|
+
type BaseSection = {
|
|
15
|
+
inset?: GridInset;
|
|
16
|
+
columns?: number;
|
|
17
|
+
fit?: GridFit;
|
|
18
|
+
aspectRatio?: Grid.AspectRatio;
|
|
19
|
+
};
|
|
20
|
+
export type Props = BaseSection & {
|
|
21
|
+
actions?: React.ReactNode;
|
|
22
|
+
children?: React.ReactNode;
|
|
23
|
+
filtering?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* @deprecated use filtering
|
|
26
|
+
*/
|
|
27
|
+
enableFiltering?: boolean;
|
|
28
|
+
isLoading?: boolean;
|
|
29
|
+
searchText?: string;
|
|
30
|
+
searchBarPlaceholder?: string;
|
|
31
|
+
navigationTitle?: string;
|
|
32
|
+
searchBarAccessory?: ReactNode;
|
|
33
|
+
onSearchTextChange?: (text: string) => void;
|
|
34
|
+
onSelectionChange?: (id: string) => void;
|
|
35
|
+
};
|
|
36
|
+
export namespace Section {
|
|
37
|
+
type Props = BaseSection & {
|
|
38
|
+
title?: string;
|
|
39
|
+
subtitle?: string;
|
|
40
|
+
children?: ReactNode;
|
|
41
|
+
};
|
|
22
42
|
}
|
|
23
|
-
type Fit = GridFit;
|
|
24
|
-
type
|
|
25
|
-
type
|
|
26
|
-
|
|
27
|
-
namespace Item {
|
|
43
|
+
export type Fit = GridFit;
|
|
44
|
+
export type Inset = GridInset;
|
|
45
|
+
export type AspectRatio = "1" | "3/2" | "2/3" | "4/3" | "3/4" | "16/9" | "9/16" | '21/9' | '9/21' | '32/9' | '9/32';
|
|
46
|
+
export namespace Item {
|
|
28
47
|
export type Props = {
|
|
29
48
|
title?: string;
|
|
30
49
|
detail?: React.ReactNode;
|
|
@@ -59,31 +78,10 @@ export declare namespace Grid {
|
|
|
59
78
|
};
|
|
60
79
|
export {};
|
|
61
80
|
}
|
|
81
|
+
export {};
|
|
62
82
|
}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
children?: React.ReactNode;
|
|
66
|
-
filtering?: boolean;
|
|
67
|
-
/**
|
|
68
|
-
* @deprecated use filtering
|
|
69
|
-
*/
|
|
70
|
-
enableFiltering?: boolean;
|
|
71
|
-
isLoading?: boolean;
|
|
72
|
-
searchText?: string;
|
|
73
|
-
searchBarPlaceholder?: string;
|
|
74
|
-
navigationTitle?: string;
|
|
75
|
-
searchBarAccessory?: ReactNode;
|
|
76
|
-
onSearchTextChange?: (text: string) => void;
|
|
77
|
-
onSelectionChange?: (id: string) => void;
|
|
78
|
-
};
|
|
79
|
-
type GridSectionProps = SectionConfig & {
|
|
80
|
-
title?: string;
|
|
81
|
-
subtitle?: string;
|
|
82
|
-
children?: ReactNode;
|
|
83
|
-
};
|
|
84
|
-
export declare const GridAccessory: React.FC<Grid.Item.Accessory>;
|
|
85
|
-
export declare const Grid: React.FC<GridProps> & {
|
|
86
|
-
Section: React.FC<GridSectionProps>;
|
|
83
|
+
export declare const Grid: React.FC<Grid.Props> & {
|
|
84
|
+
Section: React.FC<Grid.Section.Props>;
|
|
87
85
|
EmptyView: React.FC<import("./empty-view").EmptyViewProps>;
|
|
88
86
|
Dropdown: React.FC<{
|
|
89
87
|
tooltip?: string;
|
|
@@ -112,8 +110,6 @@ export declare const Grid: React.FC<GridProps> & {
|
|
|
112
110
|
};
|
|
113
111
|
Fit: typeof GridFit;
|
|
114
112
|
Inset: typeof GridInset;
|
|
115
|
-
Item: React.FC<Grid.Item.Props
|
|
116
|
-
Accessory: React.FC<Grid.Item.Accessory>;
|
|
117
|
-
};
|
|
113
|
+
Item: React.FC<Grid.Item.Props>;
|
|
118
114
|
};
|
|
119
115
|
export {};
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Grid =
|
|
3
|
+
exports.Grid = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
|
-
const image_1 = require("../image");
|
|
7
6
|
const crypto_1 = require("crypto");
|
|
8
7
|
const empty_view_1 = require("./empty-view");
|
|
9
8
|
const dropdown_1 = require("./dropdown");
|
|
@@ -38,33 +37,9 @@ const GridRoot = ({ searchBarAccessory, children, actions, inset, fit = GridFit.
|
|
|
38
37
|
}
|
|
39
38
|
return ((0, jsx_runtime_1.jsxs)("grid", { fit: fit, inset: inset, aspectRatio: aspectRatioMap[aspectRatio], ...props, children: [searchBarAccessory, children, actions] }));
|
|
40
39
|
};
|
|
41
|
-
const GridItem = ({ detail, actions,
|
|
40
|
+
const GridItem = ({ detail, actions, ...props }) => {
|
|
42
41
|
const id = (0, react_1.useRef)(props.id ?? (0, crypto_1.randomUUID)());
|
|
43
|
-
|
|
44
|
-
title: props.title,
|
|
45
|
-
subtitle: props.subtitle,
|
|
46
|
-
id: id.current,
|
|
47
|
-
keywords,
|
|
48
|
-
};
|
|
49
|
-
const isColor = (content) => {
|
|
50
|
-
return !!content["color"];
|
|
51
|
-
};
|
|
52
|
-
const isDataWithTooltip = (content) => {
|
|
53
|
-
return !!content["value"];
|
|
54
|
-
};
|
|
55
|
-
if (isColor(props.content)) {
|
|
56
|
-
nativeProps.content = { color: props.content.color };
|
|
57
|
-
}
|
|
58
|
-
else if (isDataWithTooltip(props.content)) {
|
|
59
|
-
nativeProps.content = {
|
|
60
|
-
value: (0, image_1.serializeImageLike)(props.content.value),
|
|
61
|
-
tooltip: props.content.tooltip,
|
|
62
|
-
};
|
|
63
|
-
}
|
|
64
|
-
else {
|
|
65
|
-
nativeProps.content = (0, image_1.serializeImageLike)(props.content);
|
|
66
|
-
}
|
|
67
|
-
return ((0, jsx_runtime_1.jsxs)("grid-item", { ...nativeProps, children: [detail, actions] }));
|
|
42
|
+
return ((0, jsx_runtime_1.jsxs)("grid-item", { ...props, id: id.current, children: [detail, actions] }));
|
|
68
43
|
};
|
|
69
44
|
const GridSection = ({ fit, aspectRatio, inset, ...props }) => {
|
|
70
45
|
const nativeProps = {
|
|
@@ -75,17 +50,11 @@ const GridSection = ({ fit, aspectRatio, inset, ...props }) => {
|
|
|
75
50
|
};
|
|
76
51
|
return (0, jsx_runtime_1.jsx)("grid-section", { ...nativeProps });
|
|
77
52
|
};
|
|
78
|
-
const GridAccessory = (props) => {
|
|
79
|
-
return (0, jsx_runtime_1.jsx)("list-accessory", {});
|
|
80
|
-
};
|
|
81
|
-
exports.GridAccessory = GridAccessory;
|
|
82
53
|
exports.Grid = Object.assign(GridRoot, {
|
|
83
54
|
Section: GridSection,
|
|
84
55
|
EmptyView: empty_view_1.EmptyView,
|
|
85
56
|
Dropdown: dropdown_1.Dropdown,
|
|
86
57
|
Fit: GridFit,
|
|
87
58
|
Inset: GridInset,
|
|
88
|
-
Item: Object.assign(GridItem, {
|
|
89
|
-
Accessory: exports.GridAccessory,
|
|
90
|
-
}),
|
|
59
|
+
Item: Object.assign(GridItem, {}),
|
|
91
60
|
});
|
|
@@ -2,13 +2,54 @@ import React, { ReactNode } from "react";
|
|
|
2
2
|
import { Image, ImageLike } from "../image";
|
|
3
3
|
import { Color, ColorLike } from "../color";
|
|
4
4
|
export declare namespace List {
|
|
5
|
+
type Props = {
|
|
6
|
+
actions?: React.ReactNode;
|
|
7
|
+
children?: React.ReactNode;
|
|
8
|
+
filtering?: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* @deprecated use filtering
|
|
11
|
+
*/
|
|
12
|
+
enableFiltering?: boolean;
|
|
13
|
+
isLoading?: boolean;
|
|
14
|
+
isShowingDetail?: boolean;
|
|
15
|
+
searchText?: string;
|
|
16
|
+
searchBarPlaceholder?: string;
|
|
17
|
+
navigationTitle?: string;
|
|
18
|
+
searchBarAccessory?: ReactNode;
|
|
19
|
+
onSearchTextChange?: (text: string) => void;
|
|
20
|
+
onSelectionChange?: (id: string) => void;
|
|
21
|
+
};
|
|
22
|
+
namespace Section {
|
|
23
|
+
type Props = {
|
|
24
|
+
title?: string;
|
|
25
|
+
subtitle?: string;
|
|
26
|
+
children?: ReactNode;
|
|
27
|
+
};
|
|
28
|
+
}
|
|
5
29
|
namespace Item {
|
|
6
|
-
type Props =
|
|
7
|
-
|
|
30
|
+
type Props = {
|
|
31
|
+
title: string;
|
|
32
|
+
keywords?: string[];
|
|
33
|
+
detail?: React.ReactNode;
|
|
34
|
+
icon?: ImageLike;
|
|
35
|
+
id?: string;
|
|
36
|
+
subtitle?: string;
|
|
37
|
+
actions?: ReactNode;
|
|
38
|
+
accessories?: List.Item.Accessory[];
|
|
39
|
+
};
|
|
40
|
+
namespace Detail {
|
|
41
|
+
type Props = {
|
|
42
|
+
isLoading?: boolean;
|
|
43
|
+
markdown?: string;
|
|
44
|
+
metadata?: React.ReactNode;
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
type AccessoryBase = string | Date | undefined | null;
|
|
48
|
+
type Tag = AccessoryBase | {
|
|
8
49
|
color: ColorLike;
|
|
9
50
|
value: string | Date | undefined | null;
|
|
10
51
|
};
|
|
11
|
-
type Text =
|
|
52
|
+
type Text = AccessoryBase | {
|
|
12
53
|
color: Color;
|
|
13
54
|
value: string | Date | undefined | null;
|
|
14
55
|
};
|
|
@@ -22,46 +63,8 @@ export declare namespace List {
|
|
|
22
63
|
};
|
|
23
64
|
}
|
|
24
65
|
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
children?: React.ReactNode;
|
|
28
|
-
filtering?: boolean;
|
|
29
|
-
/**
|
|
30
|
-
* @deprecated use filtering
|
|
31
|
-
*/
|
|
32
|
-
enableFiltering?: boolean;
|
|
33
|
-
isLoading?: boolean;
|
|
34
|
-
isShowingDetail?: boolean;
|
|
35
|
-
searchText?: string;
|
|
36
|
-
searchBarPlaceholder?: string;
|
|
37
|
-
navigationTitle?: string;
|
|
38
|
-
searchBarAccessory?: ReactNode;
|
|
39
|
-
onSearchTextChange?: (text: string) => void;
|
|
40
|
-
onSelectionChange?: (id: string) => void;
|
|
41
|
-
};
|
|
42
|
-
export type ListItemProps = {
|
|
43
|
-
title: string;
|
|
44
|
-
keywords?: string[];
|
|
45
|
-
detail?: React.ReactNode;
|
|
46
|
-
icon?: ImageLike;
|
|
47
|
-
id?: string;
|
|
48
|
-
subtitle?: string;
|
|
49
|
-
actions?: ReactNode;
|
|
50
|
-
accessories?: List.Item.Accessory[];
|
|
51
|
-
};
|
|
52
|
-
export type ListItemDetailProps = {
|
|
53
|
-
isLoading?: boolean;
|
|
54
|
-
markdown?: string;
|
|
55
|
-
metadata?: React.ReactNode;
|
|
56
|
-
};
|
|
57
|
-
type ListSectionProps = {
|
|
58
|
-
title?: string;
|
|
59
|
-
subtitle?: string;
|
|
60
|
-
children?: ReactNode;
|
|
61
|
-
};
|
|
62
|
-
export declare const ListAccessory: React.FC<List.Item.Accessory>;
|
|
63
|
-
export declare const List: React.FC<ListProps> & {
|
|
64
|
-
Section: React.FC<ListSectionProps>;
|
|
66
|
+
export declare const List: React.FC<List.Props> & {
|
|
67
|
+
Section: React.FC<List.Section.Props>;
|
|
65
68
|
EmptyView: React.FC<import("./empty-view").EmptyViewProps>;
|
|
66
69
|
Dropdown: React.FC<{
|
|
67
70
|
tooltip?: string;
|
|
@@ -88,8 +91,8 @@ export declare const List: React.FC<ListProps> & {
|
|
|
88
91
|
children?: ReactNode;
|
|
89
92
|
}>;
|
|
90
93
|
};
|
|
91
|
-
Item: React.FC<
|
|
92
|
-
Detail: React.FC<
|
|
94
|
+
Item: React.FC<List.Item.Props> & {
|
|
95
|
+
Detail: React.FC<List.Item.Detail.Props> & {
|
|
93
96
|
Metadata: React.FC<import("./metadata").MetadataProps> & {
|
|
94
97
|
Label: React.FC<import("./metadata").ListItemDetailMetadataLabelProps>;
|
|
95
98
|
Separator: React.FC<{}>;
|
|
@@ -103,7 +106,5 @@ export declare const List: React.FC<ListProps> & {
|
|
|
103
106
|
}>;
|
|
104
107
|
};
|
|
105
108
|
};
|
|
106
|
-
Accessory: React.FC<List.Item.Accessory>;
|
|
107
109
|
};
|
|
108
110
|
};
|
|
109
|
-
export {};
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.List =
|
|
3
|
+
exports.List = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
|
-
const image_1 = require("../image");
|
|
7
6
|
const crypto_1 = require("crypto");
|
|
8
7
|
const metadata_1 = require("./metadata");
|
|
9
8
|
const empty_view_1 = require("./empty-view");
|
|
@@ -17,26 +16,14 @@ const ListRoot = ({ searchBarAccessory, children, actions, ...props }) => {
|
|
|
17
16
|
};
|
|
18
17
|
const ListItem = ({ detail, actions, ...props }) => {
|
|
19
18
|
const id = (0, react_1.useRef)(props.id ?? (0, crypto_1.randomUUID)());
|
|
20
|
-
|
|
21
|
-
title: props.title,
|
|
22
|
-
subtitle: props.subtitle,
|
|
23
|
-
id: id.current,
|
|
24
|
-
};
|
|
25
|
-
if (props.icon)
|
|
26
|
-
nativeProps.icon = (0, image_1.serializeImageLike)(props.icon);
|
|
27
|
-
return ((0, jsx_runtime_1.jsxs)("list-item", { ...nativeProps, children: [detail, actions] }));
|
|
19
|
+
return ((0, jsx_runtime_1.jsxs)("list-item", { ...props, id: id.current, children: [detail, actions] }));
|
|
28
20
|
};
|
|
29
21
|
const ListItemDetail = ({ metadata, ...props }) => {
|
|
30
22
|
return (0, jsx_runtime_1.jsx)("list-item-detail", { ...props, children: metadata });
|
|
31
23
|
};
|
|
32
24
|
const ListSection = (props) => {
|
|
33
|
-
|
|
34
|
-
return (0, jsx_runtime_1.jsx)("list-section", { ...nativeProps });
|
|
25
|
+
return (0, jsx_runtime_1.jsx)("list-section", { ...props });
|
|
35
26
|
};
|
|
36
|
-
const ListAccessory = (props) => {
|
|
37
|
-
return (0, jsx_runtime_1.jsx)("list-accessory", {});
|
|
38
|
-
};
|
|
39
|
-
exports.ListAccessory = ListAccessory;
|
|
40
27
|
exports.List = Object.assign(ListRoot, {
|
|
41
28
|
Section: ListSection,
|
|
42
29
|
EmptyView: empty_view_1.EmptyView,
|
|
@@ -45,6 +32,5 @@ exports.List = Object.assign(ListRoot, {
|
|
|
45
32
|
Detail: Object.assign(ListItemDetail, {
|
|
46
33
|
Metadata: metadata_1.Metadata,
|
|
47
34
|
}),
|
|
48
|
-
Accessory: exports.ListAccessory,
|
|
49
35
|
}),
|
|
50
36
|
});
|
|
@@ -2,15 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Metadata = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const image_1 = require("../image");
|
|
6
5
|
const tag_1 = require("./tag");
|
|
7
6
|
const MetadataRoot = (props) => {
|
|
8
7
|
return (0, jsx_runtime_1.jsx)("metadata", { ...props });
|
|
9
8
|
};
|
|
10
|
-
const MetadataLabel = (
|
|
11
|
-
const nativeProps = props;
|
|
12
|
-
if (icon)
|
|
13
|
-
nativeProps.icon = (0, image_1.serializeImageLike)(icon);
|
|
9
|
+
const MetadataLabel = (props) => {
|
|
14
10
|
return (0, jsx_runtime_1.jsx)("metadata-label", { ...props });
|
|
15
11
|
};
|
|
16
12
|
const MetadataSeparator = () => {
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.TagList = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const image_1 = require("../image");
|
|
6
5
|
const color_1 = require("../color");
|
|
7
6
|
const TagListRoot = ({ title, children }) => {
|
|
8
7
|
const nativeProps = {
|
|
@@ -11,15 +10,12 @@ const TagListRoot = ({ title, children }) => {
|
|
|
11
10
|
};
|
|
12
11
|
return (0, jsx_runtime_1.jsx)("tag-list", { ...nativeProps });
|
|
13
12
|
};
|
|
14
|
-
const TagItem = ({ color,
|
|
13
|
+
const TagItem = ({ color, ...props }) => {
|
|
15
14
|
const nativeProps = {
|
|
16
15
|
...props,
|
|
17
|
-
text,
|
|
18
16
|
};
|
|
19
17
|
if (color)
|
|
20
18
|
nativeProps.color = (0, color_1.serializeColorLike)(color);
|
|
21
|
-
if (icon)
|
|
22
|
-
nativeProps.icon = (0, image_1.serializeImageLike)(icon);
|
|
23
19
|
return (0, jsx_runtime_1.jsx)("tag-item", { ...nativeProps });
|
|
24
20
|
};
|
|
25
21
|
exports.TagList = Object.assign(TagListRoot, {
|
package/dist/api/controls.js
CHANGED
|
@@ -36,6 +36,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
36
36
|
exports.popToRoot = exports.getSelectedText = exports.clearSearchBar = exports.closeMainWindow = exports.showHUD = exports.PopToRootType = void 0;
|
|
37
37
|
const bus_1 = require("./bus");
|
|
38
38
|
const ui = __importStar(require("./proto/ui"));
|
|
39
|
+
//e
|
|
39
40
|
var PopToRootType;
|
|
40
41
|
(function (PopToRootType) {
|
|
41
42
|
/**
|
package/dist/api/image.d.ts
CHANGED
|
@@ -1,11 +1,5 @@
|
|
|
1
1
|
import { Color } from "./color";
|
|
2
2
|
import * as ui from "./proto/ui";
|
|
3
|
-
export type SerializedImageLike = Image | {
|
|
4
|
-
fileIcon: string;
|
|
5
|
-
} | {
|
|
6
|
-
light: URL | Image.Asset;
|
|
7
|
-
dark: URL | Image.Asset;
|
|
8
|
-
};
|
|
9
3
|
export type Image = {
|
|
10
4
|
source: Image.Source;
|
|
11
5
|
fallback?: Image.Fallback;
|
|
@@ -31,5 +25,4 @@ export declare namespace Image {
|
|
|
31
25
|
RoundedRectangle = "roundedRectangle"
|
|
32
26
|
}
|
|
33
27
|
}
|
|
34
|
-
export declare const serializeImageLike: (image: Image.ImageLike) => SerializedImageLike;
|
|
35
28
|
export declare const serializeProtoImage: (image: ImageLike) => ui.Image;
|