@vicinae/api 0.3.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 (113) hide show
  1. package/README.md +37 -0
  2. package/bin/run.js +9 -0
  3. package/dist/api/ai.d.ts +110 -0
  4. package/dist/api/ai.js +120 -0
  5. package/dist/api/alert.d.ts +22 -0
  6. package/dist/api/alert.js +61 -0
  7. package/dist/api/bus.d.ts +95 -0
  8. package/dist/api/bus.js +211 -0
  9. package/dist/api/cache.d.ts +117 -0
  10. package/dist/api/cache.js +52 -0
  11. package/dist/api/clipboard.d.ts +34 -0
  12. package/dist/api/clipboard.js +52 -0
  13. package/dist/api/color.d.ts +24 -0
  14. package/dist/api/color.js +24 -0
  15. package/dist/api/components/action-pannel.d.ts +23 -0
  16. package/dist/api/components/action-pannel.js +30 -0
  17. package/dist/api/components/actions.d.ts +52 -0
  18. package/dist/api/components/actions.js +81 -0
  19. package/dist/api/components/detail.d.ts +21 -0
  20. package/dist/api/components/detail.js +12 -0
  21. package/dist/api/components/dropdown.d.ts +36 -0
  22. package/dist/api/components/dropdown.js +21 -0
  23. package/dist/api/components/empty-view.d.ts +9 -0
  24. package/dist/api/components/empty-view.js +12 -0
  25. package/dist/api/components/form.d.ts +81 -0
  26. package/dist/api/components/form.js +53 -0
  27. package/dist/api/components/grid.d.ts +117 -0
  28. package/dist/api/components/grid.js +80 -0
  29. package/dist/api/components/index.d.ts +7 -0
  30. package/dist/api/components/index.js +23 -0
  31. package/dist/api/components/list.d.ts +109 -0
  32. package/dist/api/components/list.js +53 -0
  33. package/dist/api/components/menu-bar.d.ts +26 -0
  34. package/dist/api/components/menu-bar.js +25 -0
  35. package/dist/api/components/metadata.d.ts +23 -0
  36. package/dist/api/components/metadata.js +27 -0
  37. package/dist/api/components/tag.d.ts +16 -0
  38. package/dist/api/components/tag.js +28 -0
  39. package/dist/api/context/index.d.ts +1 -0
  40. package/dist/api/context/index.js +17 -0
  41. package/dist/api/context/navigation-context.d.ts +7 -0
  42. package/dist/api/context/navigation-context.js +8 -0
  43. package/dist/api/context/navigation-provider.d.ts +4 -0
  44. package/dist/api/context/navigation-provider.js +40 -0
  45. package/dist/api/controls.d.ts +3 -0
  46. package/dist/api/controls.js +20 -0
  47. package/dist/api/environment.d.ts +118 -0
  48. package/dist/api/environment.js +17 -0
  49. package/dist/api/hooks/index.d.ts +2 -0
  50. package/dist/api/hooks/index.js +18 -0
  51. package/dist/api/hooks/use-applications.d.ts +2 -0
  52. package/dist/api/hooks/use-applications.js +19 -0
  53. package/dist/api/hooks/use-imperative-form-handle.d.ts +3 -0
  54. package/dist/api/hooks/use-imperative-form-handle.js +25 -0
  55. package/dist/api/hooks/use-navigation.d.ts +4 -0
  56. package/dist/api/hooks/use-navigation.js +13 -0
  57. package/dist/api/hooks.d.ts +1 -0
  58. package/dist/api/hooks.js +24 -0
  59. package/dist/api/icon.d.ts +444 -0
  60. package/dist/api/icon.js +448 -0
  61. package/dist/api/image.d.ts +35 -0
  62. package/dist/api/image.js +84 -0
  63. package/dist/api/index.d.ts +19 -0
  64. package/dist/api/index.js +35 -0
  65. package/dist/api/keyboard.d.ts +16 -0
  66. package/dist/api/keyboard.js +12 -0
  67. package/dist/api/lib/result.d.ts +9 -0
  68. package/dist/api/lib/result.js +11 -0
  69. package/dist/api/local-storage.d.ts +13 -0
  70. package/dist/api/local-storage.js +31 -0
  71. package/dist/api/oauth.d.ts +319 -0
  72. package/dist/api/oauth.js +166 -0
  73. package/dist/api/preference.d.ts +5 -0
  74. package/dist/api/preference.js +18 -0
  75. package/dist/api/proto/application.d.ts +48 -0
  76. package/dist/api/proto/application.js +378 -0
  77. package/dist/api/proto/clipboard.d.ts +65 -0
  78. package/dist/api/proto/clipboard.js +614 -0
  79. package/dist/api/proto/common.d.ts +28 -0
  80. package/dist/api/proto/common.js +102 -0
  81. package/dist/api/proto/extension.d.ts +68 -0
  82. package/dist/api/proto/extension.js +604 -0
  83. package/dist/api/proto/google/protobuf/struct.d.ts +107 -0
  84. package/dist/api/proto/google/protobuf/struct.js +456 -0
  85. package/dist/api/proto/ipc.d.ts +64 -0
  86. package/dist/api/proto/ipc.js +604 -0
  87. package/dist/api/proto/manager.d.ts +82 -0
  88. package/dist/api/proto/manager.js +689 -0
  89. package/dist/api/proto/oauth.d.ts +55 -0
  90. package/dist/api/proto/oauth.js +379 -0
  91. package/dist/api/proto/storage.d.ts +80 -0
  92. package/dist/api/proto/storage.js +804 -0
  93. package/dist/api/proto/ui.d.ts +186 -0
  94. package/dist/api/proto/ui.js +1993 -0
  95. package/dist/api/toast.d.ts +168 -0
  96. package/dist/api/toast.js +152 -0
  97. package/dist/api/utils.d.ts +15 -0
  98. package/dist/api/utils.js +64 -0
  99. package/dist/commands/build/index.d.ts +11 -0
  100. package/dist/commands/build/index.js +123 -0
  101. package/dist/commands/develop/index.d.ts +10 -0
  102. package/dist/commands/develop/index.js +193 -0
  103. package/dist/index.d.ts +1 -0
  104. package/dist/index.js +17 -0
  105. package/dist/schemas/manifest.d.ts +75 -0
  106. package/dist/schemas/manifest.js +4 -0
  107. package/dist/utils/logger.d.ts +13 -0
  108. package/dist/utils/logger.js +38 -0
  109. package/dist/utils/utils.d.ts +2 -0
  110. package/dist/utils/utils.js +19 -0
  111. package/dist/utils/vicinae.d.ts +12 -0
  112. package/dist/utils/vicinae.js +33 -0
  113. package/package.json +73 -0
@@ -0,0 +1,81 @@
1
+ import { ReactNode, Ref } from 'react';
2
+ type FormProps = {
3
+ actions?: React.ReactNode;
4
+ children?: React.ReactNode;
5
+ enableDrafts?: boolean;
6
+ isLoading?: boolean;
7
+ navigationTitle?: string;
8
+ searchBarAccessory?: React.ReactNode;
9
+ };
10
+ export type FormItemRef = {
11
+ focus: () => void;
12
+ reset: () => void;
13
+ };
14
+ interface FormItemProps<T extends Form.Value> {
15
+ id: string;
16
+ title?: string;
17
+ info?: string;
18
+ error?: string;
19
+ storeValue?: boolean;
20
+ autoFocus?: boolean;
21
+ value?: T;
22
+ defaultValue?: T;
23
+ onChange?: (newValue: T) => void;
24
+ onBlur?: (event: FormEvent<T>) => void;
25
+ onFocus?: (event: FormEvent<T>) => void;
26
+ }
27
+ interface FormEvent<T extends Form.Value> {
28
+ target: {
29
+ id: string;
30
+ value?: T;
31
+ };
32
+ type: FormEventType;
33
+ }
34
+ type FormEventType = 'focus' | 'blur';
35
+ export declare namespace Form {
36
+ type Props = FormProps;
37
+ type TextField = FormItemRef;
38
+ type PasswordField = FormItemRef;
39
+ type TextArea = FormItemRef;
40
+ type Checkbox = FormItemRef;
41
+ type DatePicker = FormItemRef;
42
+ type Dropdown = FormItemRef;
43
+ type TagPicker = FormItemRef;
44
+ type FilePicker = FormItemRef;
45
+ type ItemReference = FormItemRef;
46
+ type ItemProps<T extends Value> = FormItemProps<T>;
47
+ type Value = string | number | boolean | string[] | number[] | Date | null;
48
+ type Values = {
49
+ [itemId: string]: Value;
50
+ };
51
+ }
52
+ interface WithFormRef<T> {
53
+ ref?: Ref<T>;
54
+ }
55
+ interface TextFieldProps extends FormItemProps<string>, WithFormRef<Form.TextField> {
56
+ }
57
+ interface PasswordFieldProps extends FormItemProps<string>, WithFormRef<Form.PasswordField> {
58
+ }
59
+ interface DatePickerProps extends FormItemProps<Date | null>, WithFormRef<Form.DatePicker> {
60
+ }
61
+ interface CheckboxProps extends FormItemProps<boolean>, WithFormRef<Form.Checkbox> {
62
+ label?: string;
63
+ }
64
+ interface DropdownProps extends FormItemProps<string>, WithFormRef<Form.Dropdown> {
65
+ tooltip?: string;
66
+ children?: ReactNode;
67
+ filtering?: boolean;
68
+ isLoading?: boolean;
69
+ placeholder?: string;
70
+ throttle?: boolean;
71
+ onSearchTextChange?: (text: string) => void;
72
+ }
73
+ export declare const Form: import("react").FC<FormProps> & {
74
+ TextField: import("react").FC<TextFieldProps>;
75
+ PasswordField: import("react").FC<PasswordFieldProps>;
76
+ DatePicker: import("react").FC<DatePickerProps>;
77
+ Checkbox: import("react").FC<CheckboxProps>;
78
+ Dropdown: import("react").FC<DropdownProps>;
79
+ Separator: () => import("react/jsx-runtime").JSX.Element;
80
+ };
81
+ export {};
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Form = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const use_imperative_form_handle_1 = require("../hooks/use-imperative-form-handle");
6
+ const hooks_1 = require("../hooks");
7
+ ;
8
+ ;
9
+ const FormRoot = ({ enableDrafts = false, actions, children, isLoading = false, navigationTitle, searchBarAccessory }) => {
10
+ return ((0, jsx_runtime_1.jsxs)("form", { enableDrafts: enableDrafts, isLoading: isLoading, navigationTitle: navigationTitle, children: [searchBarAccessory, children, actions] }));
11
+ };
12
+ ;
13
+ ;
14
+ const TextField = ({ ref, onChange, onBlur, onFocus, ...props }) => {
15
+ (0, use_imperative_form_handle_1.useImperativeFormHandle)(ref);
16
+ const blur = (0, hooks_1.useEventListener)(onBlur);
17
+ const focus = (0, hooks_1.useEventListener)(onFocus);
18
+ const change = (0, hooks_1.useEventListener)(onChange);
19
+ return (0, jsx_runtime_1.jsx)("text-field", { onBlur: blur, onFocus: focus, onChange: change, ...props });
20
+ };
21
+ ;
22
+ const PasswordField = ({ ...props }) => {
23
+ return (0, jsx_runtime_1.jsx)("password-field", { ...props });
24
+ };
25
+ ;
26
+ const DatePicker = ({ ...props }) => {
27
+ return (0, jsx_runtime_1.jsx)("date-picker-field", { ...props });
28
+ };
29
+ ;
30
+ const Checkbox = ({ ref, onBlur, onFocus, onChange, ...props }) => {
31
+ (0, use_imperative_form_handle_1.useImperativeFormHandle)(ref);
32
+ const blur = (0, hooks_1.useEventListener)(onBlur);
33
+ const focus = (0, hooks_1.useEventListener)(onFocus);
34
+ const change = (0, hooks_1.useEventListener)(onChange);
35
+ return (0, jsx_runtime_1.jsx)("checkbox-field", { onBlur: blur, onFocus: focus, onChange: change, ...props });
36
+ };
37
+ ;
38
+ const Dropdown = ({ children, onBlur, onFocus, onChange, ...props }) => {
39
+ const onSearchTextChange = (0, hooks_1.useEventListener)(props.onSearchTextChange);
40
+ const blur = (0, hooks_1.useEventListener)(onBlur);
41
+ const focus = (0, hooks_1.useEventListener)(onFocus);
42
+ const change = (0, hooks_1.useEventListener)(onChange);
43
+ const rest = { ...props, onSearchTextChange };
44
+ return ((0, jsx_runtime_1.jsx)("dropdown-field", { onBlur: blur, onFocus: focus, onChange: change, ...rest, children: children }));
45
+ };
46
+ exports.Form = Object.assign(FormRoot, {
47
+ TextField,
48
+ PasswordField,
49
+ DatePicker,
50
+ Checkbox,
51
+ Dropdown,
52
+ Separator: () => (0, jsx_runtime_1.jsx)("separator", {})
53
+ });
@@ -0,0 +1,117 @@
1
+ import React, { ReactNode } from 'react';
2
+ import { Image, ImageLike } from '../image';
3
+ import { Color, ColorLike } from '../color';
4
+ declare enum GridInset {
5
+ Small = "small",
6
+ Medium = "medium",
7
+ Large = "large"
8
+ }
9
+ type SectionConfig = {
10
+ inset?: GridInset;
11
+ columns?: number;
12
+ fit?: GridFit;
13
+ aspectRatio?: GridAspectRatio;
14
+ };
15
+ type GridAspectRatio = '1' | '3/2' | '2/3' | '4/3' | '3/4' | '16/9' | '9/16';
16
+ declare enum GridFit {
17
+ Contain = "contain",
18
+ Fill = "fill"
19
+ }
20
+ export declare namespace Grid {
21
+ namespace Section {
22
+ type Props = GridSectionProps;
23
+ }
24
+ type Props = GridProps;
25
+ type Inset = GridInset;
26
+ type AspectRatio = GridAspectRatio;
27
+ namespace Item {
28
+ type Props = {
29
+ title?: string;
30
+ detail?: React.ReactNode;
31
+ keywords?: string[];
32
+ icon?: ImageLike;
33
+ content: Image.ImageLike | {
34
+ color: ColorLike;
35
+ } | {
36
+ value: Image.ImageLike;
37
+ tooltip?: string;
38
+ };
39
+ id?: string;
40
+ subtitle?: string;
41
+ actions?: ReactNode;
42
+ accessories?: Grid.Item.Accessory[];
43
+ };
44
+ type Tag = string | Date | undefined | null | {
45
+ color: ColorLike;
46
+ value: string | Date | undefined | null;
47
+ };
48
+ type Text = string | Date | undefined | null | {
49
+ color: Color;
50
+ value: string | Date | undefined | null;
51
+ };
52
+ type Accessory = ({
53
+ tag?: Tag;
54
+ } | {
55
+ text?: Text;
56
+ }) & {
57
+ icon?: Image.ImageLike;
58
+ tooltip?: string | null;
59
+ };
60
+ }
61
+ }
62
+ type GridProps = SectionConfig & {
63
+ actions?: React.ReactNode;
64
+ children?: React.ReactNode;
65
+ filtering?: boolean;
66
+ /**
67
+ * @deprecated use filtering
68
+ */
69
+ enableFiltering?: boolean;
70
+ isLoading?: boolean;
71
+ searchText?: string;
72
+ searchBarPlaceholder?: string;
73
+ navigationTitle?: string;
74
+ searchBarAccessory?: ReactNode;
75
+ onSearchTextChange?: (text: string) => void;
76
+ onSelectionChange?: (id: string) => void;
77
+ };
78
+ type GridSectionProps = SectionConfig & {
79
+ title?: string;
80
+ subtitle?: string;
81
+ children?: ReactNode;
82
+ };
83
+ export declare const GridAccessory: React.FC<Grid.Item.Accessory>;
84
+ export declare const Grid: React.FC<GridProps> & {
85
+ Section: React.FC<GridSectionProps>;
86
+ EmptyView: React.FC<import("./empty-view").EmptyViewProps>;
87
+ Dropdown: React.FC<{
88
+ tooltip?: string;
89
+ children?: ReactNode;
90
+ defaultValue?: string;
91
+ filtering?: boolean;
92
+ id?: string;
93
+ isLoading?: boolean;
94
+ placeholder?: string;
95
+ storeValue?: boolean;
96
+ throttle?: boolean;
97
+ value?: string;
98
+ onChange?: (newValue: string) => void;
99
+ onSearchTextChange?: (text: string) => void;
100
+ }> & {
101
+ Item: React.FC<{
102
+ title: string;
103
+ value: string;
104
+ icon?: Image.ImageLike;
105
+ keywords?: string[];
106
+ }>;
107
+ Section: React.FC<{
108
+ title?: string;
109
+ children?: ReactNode;
110
+ }>;
111
+ };
112
+ Inset: typeof GridInset;
113
+ Item: React.FC<Grid.Item.Props> & {
114
+ Accessory: React.FC<Grid.Item.Accessory>;
115
+ };
116
+ };
117
+ export {};
@@ -0,0 +1,80 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Grid = exports.GridAccessory = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_1 = require("react");
6
+ const image_1 = require("../image");
7
+ const crypto_1 = require("crypto");
8
+ const empty_view_1 = require("./empty-view");
9
+ const hooks_1 = require("../hooks");
10
+ const dropdown_1 = require("./dropdown");
11
+ var GridInset;
12
+ (function (GridInset) {
13
+ GridInset["Small"] = "small";
14
+ GridInset["Medium"] = "medium";
15
+ GridInset["Large"] = "large";
16
+ })(GridInset || (GridInset = {}));
17
+ var GridFit;
18
+ (function (GridFit) {
19
+ GridFit["Contain"] = "contain";
20
+ GridFit["Fill"] = "fill";
21
+ })(GridFit || (GridFit = {}));
22
+ ;
23
+ const GridRoot = ({ onSearchTextChange, searchBarAccessory, onSelectionChange, children, actions, inset, fit = GridFit.Contain, aspectRatio = '1', ...props }) => {
24
+ const searchTextChangeHandler = (0, hooks_1.useEventListener)(onSearchTextChange);
25
+ const selectionChangeHandler = (0, hooks_1.useEventListener)(onSelectionChange);
26
+ if (typeof props.enableFiltering === "boolean" && typeof props.filtering === "undefined") {
27
+ props.filtering = props.enableFiltering;
28
+ }
29
+ return (0, jsx_runtime_1.jsxs)("grid", { fit: fit, inset: inset, aspectRatio: aspectRatio, onSearchTextChange: searchTextChangeHandler, onSelectionChange: selectionChangeHandler, ...props, children: [searchBarAccessory, children, actions] });
30
+ };
31
+ const GridItem = ({ detail, actions, keywords, ...props }) => {
32
+ const id = (0, react_1.useRef)(props.id ?? (0, crypto_1.randomUUID)());
33
+ const nativeProps = {
34
+ title: props.title,
35
+ subtitle: props.subtitle,
36
+ id: id.current,
37
+ keywords,
38
+ };
39
+ const isColor = (content) => {
40
+ return !!content['color'];
41
+ };
42
+ const isDataWithTooltip = (content) => {
43
+ return !!content['value'];
44
+ };
45
+ if (isColor(props.content)) {
46
+ nativeProps.content = { color: props.content.color };
47
+ }
48
+ else if (isDataWithTooltip(props.content)) {
49
+ nativeProps.content = {
50
+ value: (0, image_1.serializeImageLike)(props.content.value),
51
+ tooltip: props.content.tooltip
52
+ };
53
+ }
54
+ else {
55
+ nativeProps.content = (0, image_1.serializeImageLike)(props.content);
56
+ }
57
+ return ((0, jsx_runtime_1.jsxs)("grid-item", { ...nativeProps, children: [detail, actions] }));
58
+ };
59
+ const GridSection = ({ fit = GridFit.Contain, aspectRatio = '1', inset, ...props }) => {
60
+ const nativeProps = {
61
+ fit,
62
+ aspectRatio,
63
+ inset,
64
+ ...props
65
+ };
66
+ return (0, jsx_runtime_1.jsx)("grid-section", { ...nativeProps });
67
+ };
68
+ const GridAccessory = (props) => {
69
+ return (0, jsx_runtime_1.jsx)("list-accessory", {});
70
+ };
71
+ exports.GridAccessory = GridAccessory;
72
+ exports.Grid = Object.assign(GridRoot, {
73
+ Section: GridSection,
74
+ EmptyView: empty_view_1.EmptyView,
75
+ Dropdown: dropdown_1.Dropdown,
76
+ Inset: GridInset,
77
+ Item: Object.assign(GridItem, {
78
+ Accessory: exports.GridAccessory
79
+ }),
80
+ });
@@ -0,0 +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';
@@ -0,0 +1,23 @@
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./list.js"), exports);
18
+ __exportStar(require("./grid.js"), exports);
19
+ __exportStar(require("./detail.js"), exports);
20
+ __exportStar(require("./action-pannel.js"), exports);
21
+ __exportStar(require("./actions.js"), exports);
22
+ __exportStar(require("./form.js"), exports);
23
+ __exportStar(require("./menu-bar.js"), exports);
@@ -0,0 +1,109 @@
1
+ import React, { ReactNode } from 'react';
2
+ import { Image, ImageLike } from '../image';
3
+ import { Color, ColorLike } from '../color';
4
+ export declare namespace List {
5
+ namespace Item {
6
+ type Props = ListItemProps;
7
+ type Tag = string | Date | undefined | null | {
8
+ color: ColorLike;
9
+ value: string | Date | undefined | null;
10
+ };
11
+ type Text = string | Date | undefined | null | {
12
+ color: Color;
13
+ value: string | Date | undefined | null;
14
+ };
15
+ type Accessory = ({
16
+ tag?: Tag;
17
+ } | {
18
+ text?: Text;
19
+ }) & {
20
+ icon?: Image.ImageLike;
21
+ tooltip?: string | null;
22
+ };
23
+ }
24
+ }
25
+ type ListProps = {
26
+ actions?: React.ReactNode;
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>;
65
+ EmptyView: React.FC<import("./empty-view").EmptyViewProps>;
66
+ Dropdown: React.FC<{
67
+ tooltip?: string;
68
+ children?: ReactNode;
69
+ defaultValue?: string;
70
+ filtering?: boolean;
71
+ id?: string;
72
+ isLoading?: boolean;
73
+ placeholder?: string;
74
+ storeValue?: boolean;
75
+ throttle?: boolean;
76
+ value?: string;
77
+ onChange?: (newValue: string) => void;
78
+ onSearchTextChange?: (text: string) => void;
79
+ }> & {
80
+ Item: React.FC<{
81
+ title: string;
82
+ value: string;
83
+ icon?: Image.ImageLike;
84
+ keywords?: string[];
85
+ }>;
86
+ Section: React.FC<{
87
+ title?: string;
88
+ children?: ReactNode;
89
+ }>;
90
+ };
91
+ Item: React.FC<ListItemProps> & {
92
+ Detail: React.FC<ListItemDetailProps> & {
93
+ Metadata: React.FC<import("./metadata").MetadataProps> & {
94
+ Label: React.FC<import("./metadata").ListItemDetailMetadataLabelProps>;
95
+ Separator: React.FC<{}>;
96
+ TagList: React.FC<import("./tag").TagListProps> & {
97
+ Item: React.FC<import("./tag").TagItemProps>;
98
+ };
99
+ Link: React.FC<{
100
+ title: string;
101
+ target: string;
102
+ text: string;
103
+ }>;
104
+ };
105
+ };
106
+ Accessory: React.FC<List.Item.Accessory>;
107
+ };
108
+ };
109
+ export {};
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.List = exports.ListAccessory = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_1 = require("react");
6
+ const image_1 = require("../image");
7
+ const crypto_1 = require("crypto");
8
+ const metadata_1 = require("./metadata");
9
+ const empty_view_1 = require("./empty-view");
10
+ const hooks_1 = require("../hooks");
11
+ const dropdown_1 = require("./dropdown");
12
+ ;
13
+ const ListRoot = ({ onSearchTextChange, searchBarAccessory, onSelectionChange, children, actions, ...props }) => {
14
+ const searchTextChangeHandler = (0, hooks_1.useEventListener)(onSearchTextChange);
15
+ const selectionChangeHandler = (0, hooks_1.useEventListener)(onSelectionChange);
16
+ if (typeof props.enableFiltering === "boolean" && typeof props.filtering === "undefined") {
17
+ props.filtering = props.enableFiltering;
18
+ }
19
+ return (0, jsx_runtime_1.jsxs)("list", { onSearchTextChange: searchTextChangeHandler, onSelectionChange: selectionChangeHandler, ...props, children: [searchBarAccessory, children, actions] });
20
+ };
21
+ const ListItem = ({ detail, actions, ...props }) => {
22
+ const id = (0, react_1.useRef)(props.id ?? (0, crypto_1.randomUUID)());
23
+ const nativeProps = {
24
+ title: props.title,
25
+ subtitle: props.subtitle,
26
+ id: id.current,
27
+ };
28
+ if (props.icon)
29
+ nativeProps.icon = (0, image_1.serializeImageLike)(props.icon);
30
+ return ((0, jsx_runtime_1.jsxs)("list-item", { ...nativeProps, children: [detail, actions] }));
31
+ };
32
+ const ListItemDetail = ({ metadata, ...props }) => {
33
+ return ((0, jsx_runtime_1.jsx)("list-item-detail", { ...props, children: metadata }));
34
+ };
35
+ const ListSection = (props) => {
36
+ const nativeProps = props;
37
+ return (0, jsx_runtime_1.jsx)("list-section", { ...nativeProps });
38
+ };
39
+ const ListAccessory = (props) => {
40
+ return (0, jsx_runtime_1.jsx)("list-accessory", {});
41
+ };
42
+ exports.ListAccessory = ListAccessory;
43
+ exports.List = Object.assign(ListRoot, {
44
+ Section: ListSection,
45
+ EmptyView: empty_view_1.EmptyView,
46
+ Dropdown: dropdown_1.Dropdown,
47
+ Item: Object.assign(ListItem, {
48
+ Detail: Object.assign(ListItemDetail, {
49
+ Metadata: metadata_1.Metadata
50
+ }),
51
+ Accessory: exports.ListAccessory
52
+ }),
53
+ });
@@ -0,0 +1,26 @@
1
+ import { ReactNode } from "react";
2
+ import { Image } from "../image";
3
+ import { Keyboard } from "../keyboard";
4
+ type MenuBarExtraProps = {
5
+ icon?: Image.ImageLike;
6
+ isLoading?: boolean;
7
+ title?: string;
8
+ tooltip?: string;
9
+ children?: ReactNode;
10
+ };
11
+ type MenuBarExtraItemProps = {
12
+ title: string;
13
+ alternate?: any;
14
+ icon?: Image.ImageLike;
15
+ shortcut?: Keyboard.Shortcut;
16
+ subtitle?: string;
17
+ tooltip?: string;
18
+ onAction?: (event: any) => void;
19
+ };
20
+ export declare const MenuBarExtra: import("react").FC<MenuBarExtraProps> & {
21
+ Item: import("react").FC<MenuBarExtraItemProps>;
22
+ Submenu: import("react").FC<any>;
23
+ Section: import("react").FC<any>;
24
+ Separator: import("react").FC<any>;
25
+ };
26
+ export {};
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MenuBarExtra = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const Root = () => {
6
+ return (0, jsx_runtime_1.jsx)("menu-bar", {});
7
+ };
8
+ const Item = () => {
9
+ return (0, jsx_runtime_1.jsx)("menu-bar-item", {});
10
+ };
11
+ const Submenu = () => {
12
+ return (0, jsx_runtime_1.jsx)("menu-bar-submenu", {});
13
+ };
14
+ const Section = () => {
15
+ return (0, jsx_runtime_1.jsx)("menu-bar-section", {});
16
+ };
17
+ const Separator = () => {
18
+ return (0, jsx_runtime_1.jsx)("separator", {});
19
+ };
20
+ exports.MenuBarExtra = Object.assign(Root, {
21
+ Item,
22
+ Submenu,
23
+ Section,
24
+ Separator
25
+ });
@@ -0,0 +1,23 @@
1
+ import React from 'react';
2
+ import { ImageLike } from '../image';
3
+ export type MetadataProps = {
4
+ children?: React.ReactNode;
5
+ };
6
+ export type ListItemDetailMetadataLabelProps = {
7
+ title: string;
8
+ text: string;
9
+ icon?: ImageLike;
10
+ };
11
+ export type ListItemDetailMetadataSeparator = {};
12
+ export declare const Metadata: React.FC<MetadataProps> & {
13
+ Label: React.FC<ListItemDetailMetadataLabelProps>;
14
+ Separator: React.FC<{}>;
15
+ TagList: React.FC<import("./tag").TagListProps> & {
16
+ Item: React.FC<import("./tag").TagItemProps>;
17
+ };
18
+ Link: React.FC<{
19
+ title: string;
20
+ target: string;
21
+ text: string;
22
+ }>;
23
+ };
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Metadata = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const image_1 = require("../image");
6
+ const tag_1 = require("./tag");
7
+ const MetadataRoot = (props) => {
8
+ return (0, jsx_runtime_1.jsx)("metadata", { ...props });
9
+ };
10
+ const MetadataLabel = ({ icon, ...props }) => {
11
+ const nativeProps = props;
12
+ if (icon)
13
+ nativeProps.icon = (0, image_1.serializeImageLike)(icon);
14
+ return (0, jsx_runtime_1.jsx)("metadata-label", { ...props });
15
+ };
16
+ const MetadataSeparator = () => {
17
+ return (0, jsx_runtime_1.jsx)("metadata-separator", {});
18
+ };
19
+ const MetadataLink = ({ title, target, text }) => {
20
+ return (0, jsx_runtime_1.jsx)("metadata-link", { title: title, target: target, text: text });
21
+ };
22
+ exports.Metadata = Object.assign(MetadataRoot, {
23
+ Label: MetadataLabel,
24
+ Separator: MetadataSeparator,
25
+ TagList: tag_1.TagList,
26
+ Link: MetadataLink
27
+ });
@@ -0,0 +1,16 @@
1
+ import React, { ReactNode } from 'react';
2
+ import { ImageLike } from '../image';
3
+ import { ColorLike } from '../color';
4
+ export type TagListProps = {
5
+ title: string;
6
+ children: ReactNode;
7
+ };
8
+ export type TagItemProps = {
9
+ color?: ColorLike;
10
+ icon?: ImageLike;
11
+ text?: string;
12
+ onAction?: () => void;
13
+ };
14
+ export declare const TagList: React.FC<TagListProps> & {
15
+ Item: React.FC<TagItemProps>;
16
+ };
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TagList = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const image_1 = require("../image");
6
+ const color_1 = require("../color");
7
+ const hooks_1 = require("../hooks");
8
+ const TagListRoot = ({ title, children }) => {
9
+ const nativeProps = {
10
+ title,
11
+ children
12
+ };
13
+ return (0, jsx_runtime_1.jsx)("tag-list", { ...nativeProps });
14
+ };
15
+ const TagItem = ({ color, icon, text, onAction }) => {
16
+ const onActionHandler = (0, hooks_1.useEventListener)(onAction);
17
+ const nativeProps = {
18
+ text, onAction: onActionHandler
19
+ };
20
+ if (color)
21
+ nativeProps.color = (0, color_1.serializeColorLike)(color);
22
+ if (icon)
23
+ nativeProps.icon = (0, image_1.serializeImageLike)(icon);
24
+ return (0, jsx_runtime_1.jsx)("tag-item", { ...nativeProps });
25
+ };
26
+ exports.TagList = Object.assign(TagListRoot, {
27
+ Item: TagItem
28
+ });
@@ -0,0 +1 @@
1
+ export * from './navigation-provider';