@vicinae/api 0.6.2 → 0.7.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.
Files changed (67) hide show
  1. package/README.md +1 -1
  2. package/bin/run.js +2 -2
  3. package/dist/api/ai.js +11 -10
  4. package/dist/api/alert.d.ts +1 -1
  5. package/dist/api/alert.js +4 -5
  6. package/dist/api/bus.d.ts +27 -27
  7. package/dist/api/bus.js +15 -15
  8. package/dist/api/cache.js +15 -6
  9. package/dist/api/clipboard.d.ts +2 -2
  10. package/dist/api/clipboard.js +14 -15
  11. package/dist/api/color.js +1 -3
  12. package/dist/api/components/action-pannel.js +2 -2
  13. package/dist/api/components/actions.d.ts +3 -3
  14. package/dist/api/components/actions.js +16 -16
  15. package/dist/api/components/detail.d.ts +1 -1
  16. package/dist/api/components/detail.js +1 -1
  17. package/dist/api/components/dropdown.js +3 -3
  18. package/dist/api/components/empty-view.d.ts +2 -2
  19. package/dist/api/components/empty-view.js +1 -1
  20. package/dist/api/components/form.d.ts +2 -2
  21. package/dist/api/components/form.js +4 -12
  22. package/dist/api/components/grid.d.ts +4 -4
  23. package/dist/api/components/grid.js +10 -10
  24. package/dist/api/components/index.d.ts +7 -7
  25. package/dist/api/components/list.d.ts +3 -3
  26. package/dist/api/components/list.js +6 -6
  27. package/dist/api/components/menu-bar.js +1 -1
  28. package/dist/api/components/metadata.d.ts +2 -2
  29. package/dist/api/components/metadata.js +1 -1
  30. package/dist/api/components/tag.d.ts +3 -3
  31. package/dist/api/components/tag.js +4 -3
  32. package/dist/api/context/index.d.ts +1 -1
  33. package/dist/api/context/navigation-context.js +6 -2
  34. package/dist/api/context/navigation-provider.d.ts +1 -1
  35. package/dist/api/context/navigation-provider.js +5 -5
  36. package/dist/api/controls.js +3 -3
  37. package/dist/api/environment.js +0 -2
  38. package/dist/api/hooks/index.d.ts +2 -2
  39. package/dist/api/hooks/use-imperative-form-handle.d.ts +2 -2
  40. package/dist/api/hooks/use-imperative-form-handle.js +3 -3
  41. package/dist/api/hooks.js +4 -2
  42. package/dist/api/image.d.ts +1 -1
  43. package/dist/api/image.js +5 -5
  44. package/dist/api/index.d.ts +19 -19
  45. package/dist/api/keyboard.js +4 -5
  46. package/dist/api/local-storage.js +5 -7
  47. package/dist/api/oauth.d.ts +1 -1
  48. package/dist/api/oauth.js +23 -20
  49. package/dist/api/preference.js +2 -2
  50. package/dist/api/proto/application.js +28 -13
  51. package/dist/api/proto/clipboard.js +70 -37
  52. package/dist/api/proto/common.js +5 -1
  53. package/dist/api/proto/extension.js +104 -49
  54. package/dist/api/proto/google/protobuf/struct.js +25 -8
  55. package/dist/api/proto/ipc.js +99 -52
  56. package/dist/api/proto/manager.js +56 -22
  57. package/dist/api/proto/oauth.js +32 -14
  58. package/dist/api/proto/storage.js +66 -28
  59. package/dist/api/proto/ui.js +233 -124
  60. package/dist/api/toast.js +46 -21
  61. package/dist/api/utils.d.ts +1 -1
  62. package/dist/api/utils.js +16 -12
  63. package/dist/commands/build/index.js +18 -2
  64. package/dist/commands/develop/index.js +18 -3
  65. package/dist/index.d.ts +1 -1
  66. package/dist/schemas/manifest.js +225 -1
  67. package/package.json +1 -1
@@ -4,37 +4,29 @@ 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
6
  const hooks_1 = require("../hooks");
7
- ;
8
- ;
9
- const FormRoot = ({ enableDrafts = false, actions, children, isLoading = false, navigationTitle, searchBarAccessory }) => {
7
+ const FormRoot = ({ enableDrafts = false, actions, children, isLoading = false, navigationTitle, searchBarAccessory, }) => {
10
8
  return ((0, jsx_runtime_1.jsxs)("form", { enableDrafts: enableDrafts, isLoading: isLoading, navigationTitle: navigationTitle, children: [searchBarAccessory, children, actions] }));
11
9
  };
12
- ;
13
- ;
14
10
  const TextField = ({ ref, onChange, onBlur, onFocus, ...props }) => {
15
11
  (0, use_imperative_form_handle_1.useImperativeFormHandle)(ref);
16
12
  const blur = (0, hooks_1.useEventListener)(onBlur);
17
13
  const focus = (0, hooks_1.useEventListener)(onFocus);
18
14
  const change = (0, hooks_1.useEventListener)(onChange);
19
- return (0, jsx_runtime_1.jsx)("text-field", { onBlur: blur, onFocus: focus, onChange: change, ...props });
15
+ return ((0, jsx_runtime_1.jsx)("text-field", { onBlur: blur, onFocus: focus, onChange: change, ...props }));
20
16
  };
21
- ;
22
17
  const PasswordField = ({ ...props }) => {
23
18
  return (0, jsx_runtime_1.jsx)("password-field", { ...props });
24
19
  };
25
- ;
26
20
  const DatePicker = ({ ...props }) => {
27
21
  return (0, jsx_runtime_1.jsx)("date-picker-field", { ...props });
28
22
  };
29
- ;
30
23
  const Checkbox = ({ ref, onBlur, onFocus, onChange, ...props }) => {
31
24
  (0, use_imperative_form_handle_1.useImperativeFormHandle)(ref);
32
25
  const blur = (0, hooks_1.useEventListener)(onBlur);
33
26
  const focus = (0, hooks_1.useEventListener)(onFocus);
34
27
  const change = (0, hooks_1.useEventListener)(onChange);
35
- return (0, jsx_runtime_1.jsx)("checkbox-field", { onBlur: blur, onFocus: focus, onChange: change, ...props });
28
+ return ((0, jsx_runtime_1.jsx)("checkbox-field", { onBlur: blur, onFocus: focus, onChange: change, ...props }));
36
29
  };
37
- ;
38
30
  const Dropdown = ({ children, onBlur, onFocus, onChange, ...props }) => {
39
31
  const onSearchTextChange = (0, hooks_1.useEventListener)(props.onSearchTextChange);
40
32
  const blur = (0, hooks_1.useEventListener)(onBlur);
@@ -49,5 +41,5 @@ exports.Form = Object.assign(FormRoot, {
49
41
  DatePicker,
50
42
  Checkbox,
51
43
  Dropdown,
52
- Separator: () => (0, jsx_runtime_1.jsx)("separator", {})
44
+ Separator: () => (0, jsx_runtime_1.jsx)("separator", {}),
53
45
  });
@@ -1,6 +1,6 @@
1
- import React, { ReactNode } from 'react';
2
- import { Image, ImageLike } from '../image';
3
- import { Color, ColorLike } from '../color';
1
+ import React, { ReactNode } from "react";
2
+ import { Image, ImageLike } from "../image";
3
+ import { Color, ColorLike } from "../color";
4
4
  declare enum GridInset {
5
5
  Small = "small",
6
6
  Medium = "medium",
@@ -12,7 +12,7 @@ type SectionConfig = {
12
12
  fit?: GridFit;
13
13
  aspectRatio?: GridAspectRatio;
14
14
  };
15
- type GridAspectRatio = '1' | '3/2' | '2/3' | '4/3' | '3/4' | '16/9' | '9/16';
15
+ type GridAspectRatio = "1" | "3/2" | "2/3" | "4/3" | "3/4" | "16/9" | "9/16";
16
16
  declare enum GridFit {
17
17
  Contain = "contain",
18
18
  Fill = "fill"
@@ -19,14 +19,14 @@ var GridFit;
19
19
  GridFit["Contain"] = "contain";
20
20
  GridFit["Fill"] = "fill";
21
21
  })(GridFit || (GridFit = {}));
22
- ;
23
- const GridRoot = ({ onSearchTextChange, searchBarAccessory, onSelectionChange, children, actions, inset, fit = GridFit.Contain, aspectRatio = '1', ...props }) => {
22
+ const GridRoot = ({ onSearchTextChange, searchBarAccessory, onSelectionChange, children, actions, inset, fit = GridFit.Contain, aspectRatio = "1", ...props }) => {
24
23
  const searchTextChangeHandler = (0, hooks_1.useEventListener)(onSearchTextChange);
25
24
  const selectionChangeHandler = (0, hooks_1.useEventListener)(onSelectionChange);
26
- if (typeof props.enableFiltering === "boolean" && typeof props.filtering === "undefined") {
25
+ if (typeof props.enableFiltering === "boolean" &&
26
+ typeof props.filtering === "undefined") {
27
27
  props.filtering = props.enableFiltering;
28
28
  }
29
- return (0, jsx_runtime_1.jsxs)("grid", { fit: fit, inset: inset, aspectRatio: aspectRatio, onSearchTextChange: searchTextChangeHandler, onSelectionChange: selectionChangeHandler, ...props, children: [searchBarAccessory, children, actions] });
29
+ return ((0, jsx_runtime_1.jsxs)("grid", { fit: fit, inset: inset, aspectRatio: aspectRatio, onSearchTextChange: searchTextChangeHandler, onSelectionChange: selectionChangeHandler, ...props, children: [searchBarAccessory, children, actions] }));
30
30
  };
31
31
  const GridItem = ({ detail, actions, keywords, ...props }) => {
32
32
  const id = (0, react_1.useRef)(props.id ?? (0, crypto_1.randomUUID)());
@@ -37,10 +37,10 @@ const GridItem = ({ detail, actions, keywords, ...props }) => {
37
37
  keywords,
38
38
  };
39
39
  const isColor = (content) => {
40
- return !!content['color'];
40
+ return !!content["color"];
41
41
  };
42
42
  const isDataWithTooltip = (content) => {
43
- return !!content['value'];
43
+ return !!content["value"];
44
44
  };
45
45
  if (isColor(props.content)) {
46
46
  nativeProps.content = { color: props.content.color };
@@ -48,7 +48,7 @@ const GridItem = ({ detail, actions, keywords, ...props }) => {
48
48
  else if (isDataWithTooltip(props.content)) {
49
49
  nativeProps.content = {
50
50
  value: (0, image_1.serializeImageLike)(props.content.value),
51
- tooltip: props.content.tooltip
51
+ tooltip: props.content.tooltip,
52
52
  };
53
53
  }
54
54
  else {
@@ -56,12 +56,12 @@ const GridItem = ({ detail, actions, keywords, ...props }) => {
56
56
  }
57
57
  return ((0, jsx_runtime_1.jsxs)("grid-item", { ...nativeProps, children: [detail, actions] }));
58
58
  };
59
- const GridSection = ({ fit = GridFit.Contain, aspectRatio = '1', inset, ...props }) => {
59
+ const GridSection = ({ fit = GridFit.Contain, aspectRatio = "1", inset, ...props }) => {
60
60
  const nativeProps = {
61
61
  fit,
62
62
  aspectRatio,
63
63
  inset,
64
- ...props
64
+ ...props,
65
65
  };
66
66
  return (0, jsx_runtime_1.jsx)("grid-section", { ...nativeProps });
67
67
  };
@@ -75,6 +75,6 @@ exports.Grid = Object.assign(GridRoot, {
75
75
  Dropdown: dropdown_1.Dropdown,
76
76
  Inset: GridInset,
77
77
  Item: Object.assign(GridItem, {
78
- Accessory: exports.GridAccessory
78
+ Accessory: exports.GridAccessory,
79
79
  }),
80
80
  });
@@ -1,7 +1,7 @@
1
- export * from './list.js';
2
- export * from './grid.js';
3
- export * from './detail.js';
4
- export * from './action-pannel.js';
5
- export * from './actions.js';
6
- export * from './form.js';
7
- export * from './menu-bar.js';
1
+ export * from "./list.js";
2
+ export * from "./grid.js";
3
+ export * from "./detail.js";
4
+ export * from "./action-pannel.js";
5
+ export * from "./actions.js";
6
+ export * from "./form.js";
7
+ export * from "./menu-bar.js";
@@ -1,6 +1,6 @@
1
- import React, { ReactNode } from 'react';
2
- import { Image, ImageLike } from '../image';
3
- import { Color, ColorLike } from '../color';
1
+ import React, { ReactNode } from "react";
2
+ import { Image, ImageLike } from "../image";
3
+ import { Color, ColorLike } from "../color";
4
4
  export declare namespace List {
5
5
  namespace Item {
6
6
  type Props = ListItemProps;
@@ -9,14 +9,14 @@ const metadata_1 = require("./metadata");
9
9
  const empty_view_1 = require("./empty-view");
10
10
  const hooks_1 = require("../hooks");
11
11
  const dropdown_1 = require("./dropdown");
12
- ;
13
12
  const ListRoot = ({ onSearchTextChange, searchBarAccessory, onSelectionChange, children, actions, ...props }) => {
14
13
  const searchTextChangeHandler = (0, hooks_1.useEventListener)(onSearchTextChange);
15
14
  const selectionChangeHandler = (0, hooks_1.useEventListener)(onSelectionChange);
16
- if (typeof props.enableFiltering === "boolean" && typeof props.filtering === "undefined") {
15
+ if (typeof props.enableFiltering === "boolean" &&
16
+ typeof props.filtering === "undefined") {
17
17
  props.filtering = props.enableFiltering;
18
18
  }
19
- return (0, jsx_runtime_1.jsxs)("list", { onSearchTextChange: searchTextChangeHandler, onSelectionChange: selectionChangeHandler, ...props, children: [searchBarAccessory, children, actions] });
19
+ return ((0, jsx_runtime_1.jsxs)("list", { onSearchTextChange: searchTextChangeHandler, onSelectionChange: selectionChangeHandler, ...props, children: [searchBarAccessory, children, actions] }));
20
20
  };
21
21
  const ListItem = ({ detail, actions, ...props }) => {
22
22
  const id = (0, react_1.useRef)(props.id ?? (0, crypto_1.randomUUID)());
@@ -30,7 +30,7 @@ const ListItem = ({ detail, actions, ...props }) => {
30
30
  return ((0, jsx_runtime_1.jsxs)("list-item", { ...nativeProps, children: [detail, actions] }));
31
31
  };
32
32
  const ListItemDetail = ({ metadata, ...props }) => {
33
- return ((0, jsx_runtime_1.jsx)("list-item-detail", { ...props, children: metadata }));
33
+ return (0, jsx_runtime_1.jsx)("list-item-detail", { ...props, children: metadata });
34
34
  };
35
35
  const ListSection = (props) => {
36
36
  const nativeProps = props;
@@ -46,8 +46,8 @@ exports.List = Object.assign(ListRoot, {
46
46
  Dropdown: dropdown_1.Dropdown,
47
47
  Item: Object.assign(ListItem, {
48
48
  Detail: Object.assign(ListItemDetail, {
49
- Metadata: metadata_1.Metadata
49
+ Metadata: metadata_1.Metadata,
50
50
  }),
51
- Accessory: exports.ListAccessory
51
+ Accessory: exports.ListAccessory,
52
52
  }),
53
53
  });
@@ -21,5 +21,5 @@ exports.MenuBarExtra = Object.assign(Root, {
21
21
  Item,
22
22
  Submenu,
23
23
  Section,
24
- Separator
24
+ Separator,
25
25
  });
@@ -1,5 +1,5 @@
1
- import React from 'react';
2
- import { ImageLike } from '../image';
1
+ import React from "react";
2
+ import { ImageLike } from "../image";
3
3
  export type MetadataProps = {
4
4
  children?: React.ReactNode;
5
5
  };
@@ -23,5 +23,5 @@ exports.Metadata = Object.assign(MetadataRoot, {
23
23
  Label: MetadataLabel,
24
24
  Separator: MetadataSeparator,
25
25
  TagList: tag_1.TagList,
26
- Link: MetadataLink
26
+ Link: MetadataLink,
27
27
  });
@@ -1,6 +1,6 @@
1
- import React, { ReactNode } from 'react';
2
- import { ImageLike } from '../image';
3
- import { ColorLike } from '../color';
1
+ import React, { ReactNode } from "react";
2
+ import { ImageLike } from "../image";
3
+ import { ColorLike } from "../color";
4
4
  export type TagListProps = {
5
5
  title: string;
6
6
  children: ReactNode;
@@ -8,14 +8,15 @@ const hooks_1 = require("../hooks");
8
8
  const TagListRoot = ({ title, children }) => {
9
9
  const nativeProps = {
10
10
  title,
11
- children
11
+ children,
12
12
  };
13
13
  return (0, jsx_runtime_1.jsx)("tag-list", { ...nativeProps });
14
14
  };
15
15
  const TagItem = ({ color, icon, text, onAction }) => {
16
16
  const onActionHandler = (0, hooks_1.useEventListener)(onAction);
17
17
  const nativeProps = {
18
- text, onAction: onActionHandler
18
+ text,
19
+ onAction: onActionHandler,
19
20
  };
20
21
  if (color)
21
22
  nativeProps.color = (0, color_1.serializeColorLike)(color);
@@ -24,5 +25,5 @@ const TagItem = ({ color, icon, text, onAction }) => {
24
25
  return (0, jsx_runtime_1.jsx)("tag-item", { ...nativeProps });
25
26
  };
26
27
  exports.TagList = Object.assign(TagListRoot, {
27
- Item: TagItem
28
+ Item: TagItem,
28
29
  });
@@ -1 +1 @@
1
- export * from './navigation-provider';
1
+ export * from "./navigation-provider";
@@ -2,7 +2,11 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const react_1 = require("react");
4
4
  const ctx = (0, react_1.createContext)({
5
- pop: () => { throw new Error('not implemented'); },
6
- push: () => { throw new Error('not implemented'); },
5
+ pop: () => {
6
+ throw new Error("not implemented");
7
+ },
8
+ push: () => {
9
+ throw new Error("not implemented");
10
+ },
7
11
  });
8
12
  exports.default = ctx;
@@ -1,4 +1,4 @@
1
- import React, { ReactNode } from 'react';
1
+ import React, { ReactNode } from "react";
2
2
  export declare const NavigationProvider: React.FC<{
3
3
  root: ReactNode;
4
4
  }>;
@@ -14,12 +14,12 @@ const View = ({ children }) => {
14
14
  const NavigationProvider = ({ root }) => {
15
15
  const [navStack, setNavStack] = (0, react_1.useState)([root]);
16
16
  const pop = () => {
17
- bus_1.bus.turboRequest('ui.popView', {}).then(() => {
17
+ bus_1.bus.turboRequest("ui.popView", {}).then(() => {
18
18
  setNavStack((cur) => cur.slice(0, -1));
19
19
  });
20
20
  };
21
21
  const push = (node) => {
22
- bus_1.bus.turboRequest('ui.pushView', {}).then(() => {
22
+ bus_1.bus.turboRequest("ui.pushView", {}).then(() => {
23
23
  setNavStack((cur) => [...cur, node]);
24
24
  });
25
25
  };
@@ -27,14 +27,14 @@ const NavigationProvider = ({ root }) => {
27
27
  //console.log('changed nav stack size', navStack.length);
28
28
  }, [navStack]);
29
29
  (0, react_1.useEffect)(() => {
30
- const listener = bus_1.bus.subscribe('pop-view', () => {
30
+ const listener = bus_1.bus.subscribe("pop-view", () => {
31
31
  setNavStack((cur) => cur.slice(0, -1));
32
32
  });
33
33
  return () => listener.unsubscribe();
34
34
  }, []);
35
35
  return ((0, jsx_runtime_1.jsx)(navigation_context_1.default.Provider, { value: {
36
36
  push,
37
- pop
38
- }, children: navStack.map((el, idx) => (0, jsx_runtime_1.jsx)(View, { children: el }, idx)) }));
37
+ pop,
38
+ }, children: navStack.map((el, idx) => ((0, jsx_runtime_1.jsx)(View, { children: el }, idx))) }));
39
39
  };
40
40
  exports.NavigationProvider = NavigationProvider;
@@ -3,15 +3,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getSelectedText = exports.clearSearchBar = exports.closeMainWindow = void 0;
4
4
  const bus_1 = require("./bus");
5
5
  const closeMainWindow = async () => {
6
- await bus_1.bus.turboRequest('ui.closeMainWindow', {});
6
+ await bus_1.bus.turboRequest("ui.closeMainWindow", {});
7
7
  };
8
8
  exports.closeMainWindow = closeMainWindow;
9
9
  const clearSearchBar = async () => {
10
- await bus_1.bus.turboRequest('ui.setSearchText', { text: '' });
10
+ await bus_1.bus.turboRequest("ui.setSearchText", { text: "" });
11
11
  };
12
12
  exports.clearSearchBar = clearSearchBar;
13
13
  const getSelectedText = async () => {
14
- const response = await bus_1.bus.turboRequest('ui.getSelectedText', {});
14
+ const response = await bus_1.bus.turboRequest("ui.getSelectedText", {});
15
15
  if (!response.ok) {
16
16
  throw new Error(`Failed to get selected text`);
17
17
  }
@@ -1,8 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.environment = exports.LaunchType = void 0;
4
- ;
5
- ;
6
4
  var LaunchType;
7
5
  (function (LaunchType) {
8
6
  /**
@@ -1,2 +1,2 @@
1
- export * from './use-applications';
2
- export * from './use-navigation';
1
+ export * from "./use-applications";
2
+ export * from "./use-navigation";
@@ -1,3 +1,3 @@
1
- import { FormItemRef } from '../components/form';
2
- import { Ref } from 'react';
1
+ import { FormItemRef } from "../components/form";
2
+ import { Ref } from "react";
3
3
  export declare const useImperativeFormHandle: (ref?: Ref<FormItemRef>) => [string];
@@ -10,14 +10,14 @@ const useImperativeFormHandle = (ref) => {
10
10
  return {
11
11
  focus: () => {
12
12
  bus_1.bus.emit(handleId.current, {
13
- type: 'focus'
13
+ type: "focus",
14
14
  });
15
15
  },
16
16
  reset: () => {
17
17
  bus_1.bus.emit(handleId.current, {
18
- type: 'reset'
18
+ type: "reset",
19
19
  });
20
- }
20
+ },
21
21
  };
22
22
  }, []);
23
23
  return [handleId.current];
package/dist/api/hooks.js CHANGED
@@ -7,13 +7,15 @@ const handlerIdFactory = {
7
7
  nextHandlerId: 0,
8
8
  next() {
9
9
  return this.nextHandlerId++;
10
- }
10
+ },
11
11
  };
12
12
  const useEventListener = (fn) => {
13
13
  const id = (0, react_1.useRef)(`handler:${handlerIdFactory.next()}`);
14
14
  const callback = (0, react_1.useRef)();
15
15
  (0, react_1.useEffect)(() => {
16
- const { unsubscribe } = bus_1.bus.subscribe(id.current, (...args) => { callback.current?.(...args); });
16
+ const { unsubscribe } = bus_1.bus.subscribe(id.current, (...args) => {
17
+ callback.current?.(...args);
18
+ });
17
19
  return unsubscribe;
18
20
  }, []);
19
21
  (0, react_1.useEffect)(() => {
@@ -1,5 +1,5 @@
1
1
  import { Color } from "./color";
2
- import * as ui from './proto/ui';
2
+ import * as ui from "./proto/ui";
3
3
  export type SerializedImageLike = Image | {
4
4
  fileIcon: string;
5
5
  } | {
package/dist/api/image.js CHANGED
@@ -42,9 +42,7 @@ var Image;
42
42
  Mask["Circle"] = "circle";
43
43
  Mask["RoundedRectangle"] = "roundedRectangle";
44
44
  })(Mask = Image.Mask || (Image.Mask = {}));
45
- ;
46
45
  })(Image || (exports.Image = Image = {}));
47
- ;
48
46
  const maskMap = {
49
47
  [Image.Mask.Circle]: ui.ImageMask.Circle,
50
48
  [Image.Mask.RoundedRectangle]: ui.ImageMask.RoundedRectangle,
@@ -61,13 +59,15 @@ const serializeImageLike = (image) => {
61
59
  exports.serializeImageLike = serializeImageLike;
62
60
  const serializeProtoImage = (image) => {
63
61
  const serializeSource = (payload) => {
64
- if (typeof payload === 'object') {
62
+ if (typeof payload === "object") {
65
63
  const tmp = payload;
66
- return { themed: { light: tmp.light.toString(), dark: tmp.dark.toString() } };
64
+ return {
65
+ themed: { light: tmp.light.toString(), dark: tmp.dark.toString() },
66
+ };
67
67
  }
68
68
  return { raw: payload.toString() };
69
69
  };
70
- if (image instanceof URL || typeof image === 'string') {
70
+ if (image instanceof URL || typeof image === "string") {
71
71
  return { source: { raw: image.toString() } };
72
72
  }
73
73
  const proto = ui.Image.create();
@@ -1,19 +1,19 @@
1
- export * from './components/index.js';
2
- export * from './hooks/index.js';
3
- export * from './context/index.js';
4
- export * from './bus.js';
5
- export * from './color.js';
6
- export * from './keyboard.js';
7
- export * from './image.js';
8
- export * from './icon.js';
9
- export * from './environment.js';
10
- export * from './controls.js';
11
- export * from './cache';
12
- export * from './toast';
13
- export * from './clipboard.js';
14
- export * from './utils';
15
- export * from './local-storage.js';
16
- export * from './oauth.js';
17
- export * from './ai.js';
18
- export * from './alert.js';
19
- export * from './preference.js';
1
+ export * from "./components/index.js";
2
+ export * from "./hooks/index.js";
3
+ export * from "./context/index.js";
4
+ export * from "./bus.js";
5
+ export * from "./color.js";
6
+ export * from "./keyboard.js";
7
+ export * from "./image.js";
8
+ export * from "./icon.js";
9
+ export * from "./environment.js";
10
+ export * from "./controls.js";
11
+ export * from "./cache";
12
+ export * from "./toast";
13
+ export * from "./clipboard.js";
14
+ export * from "./utils";
15
+ export * from "./local-storage.js";
16
+ export * from "./oauth.js";
17
+ export * from "./ai.js";
18
+ export * from "./alert.js";
19
+ export * from "./preference.js";
@@ -1,12 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Keyboard = void 0;
4
- ;
5
4
  exports.Keyboard = {
6
5
  Shortcut: {
7
6
  Common: {
8
- Copy: { modifiers: ['cmd', 'shift'], key: 'c' },
9
- CopyName: { modifiers: ['cmd', 'shift'], key: '.' }
10
- }
11
- }
7
+ Copy: { modifiers: ["cmd", "shift"], key: "c" },
8
+ CopyName: { modifiers: ["cmd", "shift"], key: "." },
9
+ },
10
+ },
12
11
  };
@@ -2,30 +2,28 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.LocalStorage = void 0;
4
4
  const bus_1 = require("./bus");
5
- ;
6
5
  class LocalStorage {
7
6
  static async getItem(key) {
8
- const res = await bus_1.bus.turboRequest('storage.get', { key });
7
+ const res = await bus_1.bus.turboRequest("storage.get", { key });
9
8
  if (!res.ok) {
10
9
  return undefined;
11
10
  }
12
- ;
13
11
  return res.value.value;
14
12
  }
15
13
  static async setItem(key, value) {
16
- await bus_1.bus.turboRequest('storage.set', { key, value });
14
+ await bus_1.bus.turboRequest("storage.set", { key, value });
17
15
  }
18
16
  static async removeItem(key) {
19
- await bus_1.bus.turboRequest('storage.remove', { key });
17
+ await bus_1.bus.turboRequest("storage.remove", { key });
20
18
  }
21
19
  static async allItems() {
22
- const res = await bus_1.bus.turboRequest('storage.list', {});
20
+ const res = await bus_1.bus.turboRequest("storage.list", {});
23
21
  if (!res.ok)
24
22
  return {};
25
23
  return res.value.values;
26
24
  }
27
25
  static async clear() {
28
- await bus_1.bus.turboRequest('storage.clear', {});
26
+ await bus_1.bus.turboRequest("storage.clear", {});
29
27
  }
30
28
  }
31
29
  exports.LocalStorage = LocalStorage;
@@ -1,4 +1,4 @@
1
- import { Image } from './image';
1
+ import { Image } from "./image";
2
2
  declare enum OauthRedirectMethod {
3
3
  /**
4
4
  * Use this type for a redirect back to the Raycast website, which will then open the extension.