@vicinae/api 0.14.0 → 0.14.2

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.
@@ -7,7 +7,12 @@ import { Form } from "./form";
7
7
  export type BaseActionProps = {
8
8
  title: string;
9
9
  icon?: ImageLike;
10
- shortcut?: Keyboard.Shortcut;
10
+ /**
11
+ * The shortcut to bind this action to.
12
+ * It is highly recommended to use named shortcuts such as
13
+ * Keyboard.Shortcut.Common.Copy as they will respect user preferences.
14
+ */
15
+ shortcut?: Keyboard.Shortcut | Keyboard.Shortcut.Common;
11
16
  autoFocus?: boolean;
12
17
  style?: "regular" | "destructive";
13
18
  };
@@ -21,10 +21,12 @@ const TextField = ({ ref, ...props }) => {
21
21
  (0, use_imperative_form_handle_1.useImperativeFormHandle)(ref);
22
22
  return ((0, jsx_runtime_1.jsx)("text-field", { ...wrapFormItemProps(props) }));
23
23
  };
24
- const PasswordField = ({ ...props }) => {
24
+ const PasswordField = ({ ref, ...props }) => {
25
+ (0, use_imperative_form_handle_1.useImperativeFormHandle)(ref);
25
26
  return (0, jsx_runtime_1.jsx)("password-field", { ...props });
26
27
  };
27
- const DatePicker = ({ ...props }) => {
28
+ const DatePicker = ({ ref, ...props }) => {
29
+ (0, use_imperative_form_handle_1.useImperativeFormHandle)(ref);
28
30
  return (0, jsx_runtime_1.jsx)("date-picker-field", { ...props });
29
31
  };
30
32
  const Checkbox = ({ ref, ...props }) => {
@@ -33,8 +35,9 @@ const Checkbox = ({ ref, ...props }) => {
33
35
  };
34
36
  //FIXME: we probably need to reuse the existing dropdown in
35
37
  // a smarter way.
36
- const DropdownRoot = ({ children, ...props }) => {
38
+ const DropdownRoot = ({ ref, children, ...props }) => {
37
39
  // FIXME: testing stuff, we need to generalize this to all form items
40
+ (0, use_imperative_form_handle_1.useImperativeFormHandle)(ref);
38
41
  return ((0, jsx_runtime_1.jsx)("dropdown-field", { ...wrapFormItemProps(props), children: children }));
39
42
  };
40
43
  const Dropdown = Object.assign(DropdownRoot, {
@@ -50,10 +53,12 @@ const TagPickerItem = ({ icon, ...props }) => {
50
53
  const TagPicker = Object.assign(TagPickerRoot, {
51
54
  Item: TagPickerItem
52
55
  });
53
- const TextArea = (props) => {
56
+ const TextArea = ({ ref, ...props }) => {
57
+ (0, use_imperative_form_handle_1.useImperativeFormHandle)(ref);
54
58
  return ((0, jsx_runtime_1.jsx)("text-area-field", { ...wrapFormItemProps(props) }));
55
59
  };
56
- const FilePicker = (props) => {
60
+ const FilePicker = ({ ref, ...props }) => {
61
+ (0, use_imperative_form_handle_1.useImperativeFormHandle)(ref);
57
62
  return ((0, jsx_runtime_1.jsx)("file-picker-field", { ...wrapFormItemProps(props) }));
58
63
  };
59
64
  const Description = (props) => {
@@ -1,16 +1,29 @@
1
1
  export type KeyEquivalent = "a" | "b" | "c" | "d" | "e" | "f" | "g" | "h" | "i" | "j" | "k" | "l" | "m" | "n" | "o" | "p" | "q" | "r" | "s" | "t" | "u" | "v" | "w" | "x" | "y" | "z" | "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "." | "," | ";" | "=" | "+" | "-" | "[" | "]" | "{" | "}" | "«" | "»" | "(" | ")" | "/" | "\\" | "'" | "`" | "§" | "^" | "@" | "$" | "return" | "delete" | "deleteForward" | "tab" | "arrowUp" | "arrowDown" | "arrowLeft" | "arrowRight" | "pageUp" | "pageDown" | "home" | "end" | "space" | "escape" | "enter" | "backspace";
2
+ export type KeyModifier = "cmd" | "ctrl" | "opt" | "shift";
2
3
  export declare namespace Keyboard {
4
+ namespace Shortcut {
5
+ type Common = 'copy' | 'copy-deeplink' | 'copy-name' | 'copy-path' | 'save' | 'duplicate' | 'edit' | 'move-down' | 'move-up' | 'new' | 'open' | 'open-with' | 'pin' | 'refresh' | 'remove' | 'remove-all';
6
+ const Common: {
7
+ Copy: string;
8
+ CopyDeeplink: string;
9
+ CopyName: string;
10
+ CopyPath: string;
11
+ Save: string;
12
+ Duplicate: string;
13
+ Edit: string;
14
+ MoveDown: string;
15
+ MoveUp: string;
16
+ New: string;
17
+ Open: string;
18
+ OpenWith: string;
19
+ Pin: string;
20
+ Refresh: string;
21
+ Remove: string;
22
+ RemoveAll: string;
23
+ };
24
+ }
3
25
  type Shortcut = {
4
26
  key: KeyEquivalent;
5
27
  modifiers: KeyModifier[];
6
28
  };
7
29
  }
8
- export type KeyModifier = "cmd" | "ctrl" | "opt" | "shift";
9
- export declare const Keyboard: {
10
- Shortcut: {
11
- Common: {
12
- Copy: Keyboard.Shortcut;
13
- CopyName: Keyboard.Shortcut;
14
- };
15
- };
16
- };
@@ -1,11 +1,29 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Keyboard = void 0;
4
- exports.Keyboard = {
5
- Shortcut: {
6
- Common: {
7
- Copy: { modifiers: ["cmd", "shift"], key: "c" },
8
- CopyName: { modifiers: ["cmd", "shift"], key: "." },
9
- },
10
- },
11
- };
4
+ var Keyboard;
5
+ (function (Keyboard) {
6
+ let Shortcut;
7
+ (function (Shortcut) {
8
+ Shortcut.Common = {
9
+ Copy: "copy",
10
+ CopyDeeplink: 'copy',
11
+ CopyName: 'copy',
12
+ CopyPath: 'copy',
13
+ Save: 'save',
14
+ Duplicate: 'duplicate',
15
+ Edit: 'edit',
16
+ MoveDown: 'move-down',
17
+ MoveUp: 'move-up',
18
+ New: 'new',
19
+ Open: 'open',
20
+ OpenWith: 'open-with',
21
+ Pin: 'pin',
22
+ Refresh: 'refresh',
23
+ Remove: 'remove',
24
+ RemoveAll: 'remove-all',
25
+ };
26
+ })(Shortcut = Keyboard.Shortcut || (Keyboard.Shortcut = {}));
27
+ ;
28
+ })(Keyboard || (exports.Keyboard = Keyboard = {}));
29
+ ;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vicinae/api",
3
- "version": "0.14.0",
3
+ "version": "0.14.2",
4
4
  "description": "TypeScript SDK to build Vicinae extensions",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1",