@vicinae/api 0.16.7 → 0.16.9

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.
@@ -1,19 +1,55 @@
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.extensionDataDir = exports.dataDir = void 0;
4
- const path_1 = require("path");
5
- const os_1 = require("os");
36
+ exports.extensionInternalSupportDir = exports.supportDir = exports.extensionDataDir = exports.dataDir = void 0;
37
+ const os = __importStar(require("node:os"));
38
+ const path = __importStar(require("node:path"));
6
39
  const platformDataDir = () => {
7
40
  const platform = process.platform;
8
41
  if (platform === "linux")
9
- return process.env.XDG_DATA_HOME || (0, path_1.join)((0, os_1.homedir)(), ".local", "share");
42
+ return (process.env.XDG_DATA_HOME || path.join(os.homedir(), ".local", "share"));
10
43
  if (platform === "darwin")
11
- return (0, path_1.join)((0, os_1.homedir)(), "Library", "Application Support");
44
+ return path.join(os.homedir(), "Library", "Application Support");
12
45
  if (platform === "win32")
13
- return process.env.APPDATA || (0, path_1.join)((0, os_1.homedir)(), "AppData", "Roaming");
14
- return (0, path_1.join)((0, os_1.homedir)(), ".data");
46
+ return process.env.APPDATA || path.join(os.homedir(), "AppData", "Roaming");
47
+ return path.join(os.homedir(), ".data");
15
48
  };
16
- const dataDir = () => (0, path_1.join)(platformDataDir(), "vicinae");
49
+ const dataDir = () => path.join(platformDataDir(), "vicinae");
17
50
  exports.dataDir = dataDir;
18
- const extensionDataDir = () => (0, path_1.join)((0, exports.dataDir)(), "extensions");
51
+ const extensionDataDir = () => path.join((0, exports.dataDir)(), "extensions");
19
52
  exports.extensionDataDir = extensionDataDir;
53
+ exports.supportDir = path.join((0, exports.dataDir)(), "support");
54
+ const extensionInternalSupportDir = (id) => path.join(exports.supportDir, id, ".vicinae");
55
+ exports.extensionInternalSupportDir = extensionInternalSupportDir;
@@ -0,0 +1,42 @@
1
+ export type Format = (string?: string) => string;
2
+ export declare const reset: Format;
3
+ export declare const bold: Format;
4
+ export declare const dim: Format;
5
+ export declare const italic: Format;
6
+ export declare const underline: Format;
7
+ export declare const overline: Format;
8
+ export declare const inverse: Format;
9
+ export declare const hidden: Format;
10
+ export declare const strikethrough: Format;
11
+ export declare const black: Format;
12
+ export declare const red: Format;
13
+ export declare const green: Format;
14
+ export declare const yellow: Format;
15
+ export declare const blue: Format;
16
+ export declare const magenta: Format;
17
+ export declare const cyan: Format;
18
+ export declare const white: Format;
19
+ export declare const gray: Format;
20
+ export declare const bgBlack: Format;
21
+ export declare const bgRed: Format;
22
+ export declare const bgGreen: Format;
23
+ export declare const bgYellow: Format;
24
+ export declare const bgBlue: Format;
25
+ export declare const bgMagenta: Format;
26
+ export declare const bgCyan: Format;
27
+ export declare const bgWhite: Format;
28
+ export declare const bgGray: Format;
29
+ export declare const redBright: Format;
30
+ export declare const greenBright: Format;
31
+ export declare const yellowBright: Format;
32
+ export declare const blueBright: Format;
33
+ export declare const magentaBright: Format;
34
+ export declare const cyanBright: Format;
35
+ export declare const whiteBright: Format;
36
+ export declare const bgRedBright: Format;
37
+ export declare const bgGreenBright: Format;
38
+ export declare const bgYellowBright: Format;
39
+ export declare const bgBlueBright: Format;
40
+ export declare const bgMagentaBright: Format;
41
+ export declare const bgCyanBright: Format;
42
+ export declare const bgWhiteBright: Format;
@@ -0,0 +1,83 @@
1
+ "use strict";
2
+ // https://github.com/sindresorhus/yoctocolors
3
+ var __importDefault = (this && this.__importDefault) || function (mod) {
4
+ return (mod && mod.__esModule) ? mod : { "default": mod };
5
+ };
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.bgWhiteBright = exports.bgCyanBright = exports.bgMagentaBright = exports.bgBlueBright = exports.bgYellowBright = exports.bgGreenBright = exports.bgRedBright = exports.whiteBright = exports.cyanBright = exports.magentaBright = exports.blueBright = exports.yellowBright = exports.greenBright = exports.redBright = exports.bgGray = exports.bgWhite = exports.bgCyan = exports.bgMagenta = exports.bgBlue = exports.bgYellow = exports.bgGreen = exports.bgRed = exports.bgBlack = exports.gray = exports.white = exports.cyan = exports.magenta = exports.blue = exports.yellow = exports.green = exports.red = exports.black = exports.strikethrough = exports.hidden = exports.inverse = exports.overline = exports.underline = exports.italic = exports.dim = exports.bold = exports.reset = void 0;
8
+ const node_tty_1 = __importDefault(require("node:tty"));
9
+ // eslint-disable-next-line no-warning-comments
10
+ // TODO: Use a better method when it's added to Node.js (https://github.com/nodejs/node/pull/40240)
11
+ // Lots of optionals here to support Deno.
12
+ const hasColors = node_tty_1.default?.WriteStream?.prototype?.hasColors?.() ?? false;
13
+ const format = (open, close) => {
14
+ if (!hasColors) {
15
+ return (input) => input ?? "";
16
+ }
17
+ const openCode = `\u001B[${open}m`;
18
+ const closeCode = `\u001B[${close}m`;
19
+ return (input = "") => {
20
+ let index = input.indexOf(closeCode);
21
+ if (index === -1) {
22
+ // Note: Intentionally not using string interpolation for performance reasons.
23
+ return openCode + input + closeCode;
24
+ }
25
+ // Handle nested colors.
26
+ // We could have done this, but it's too slow (as of Node.js 22).
27
+ // return openCode + string.replaceAll(closeCode, (close === 22 ? closeCode : '') + openCode) + closeCode;
28
+ let result = openCode;
29
+ let lastIndex = 0;
30
+ // SGR 22 resets both bold (1) and dim (2). When we encounter a nested
31
+ // close for styles that use 22, we need to re-open the outer style.
32
+ const reopenOnNestedClose = close === 22;
33
+ const replaceCode = (reopenOnNestedClose ? closeCode : "") + openCode;
34
+ while (index !== -1) {
35
+ result += input.slice(lastIndex, index) + replaceCode;
36
+ lastIndex = index + closeCode.length;
37
+ index = input.indexOf(closeCode, lastIndex);
38
+ }
39
+ result += input.slice(lastIndex) + closeCode;
40
+ return result;
41
+ };
42
+ };
43
+ exports.reset = format(0, 0);
44
+ exports.bold = format(1, 22);
45
+ exports.dim = format(2, 22);
46
+ exports.italic = format(3, 23);
47
+ exports.underline = format(4, 24);
48
+ exports.overline = format(53, 55);
49
+ exports.inverse = format(7, 27);
50
+ exports.hidden = format(8, 28);
51
+ exports.strikethrough = format(9, 29);
52
+ exports.black = format(30, 39);
53
+ exports.red = format(31, 39);
54
+ exports.green = format(32, 39);
55
+ exports.yellow = format(33, 39);
56
+ exports.blue = format(34, 39);
57
+ exports.magenta = format(35, 39);
58
+ exports.cyan = format(36, 39);
59
+ exports.white = format(37, 39);
60
+ exports.gray = format(90, 39);
61
+ exports.bgBlack = format(40, 49);
62
+ exports.bgRed = format(41, 49);
63
+ exports.bgGreen = format(42, 49);
64
+ exports.bgYellow = format(43, 49);
65
+ exports.bgBlue = format(44, 49);
66
+ exports.bgMagenta = format(45, 49);
67
+ exports.bgCyan = format(46, 49);
68
+ exports.bgWhite = format(47, 49);
69
+ exports.bgGray = format(100, 49);
70
+ exports.redBright = format(91, 39);
71
+ exports.greenBright = format(92, 39);
72
+ exports.yellowBright = format(93, 39);
73
+ exports.blueBright = format(94, 39);
74
+ exports.magentaBright = format(95, 39);
75
+ exports.cyanBright = format(96, 39);
76
+ exports.whiteBright = format(97, 39);
77
+ exports.bgRedBright = format(101, 49);
78
+ exports.bgGreenBright = format(102, 49);
79
+ exports.bgYellowBright = format(103, 49);
80
+ exports.bgBlueBright = format(104, 49);
81
+ exports.bgMagentaBright = format(105, 49);
82
+ exports.bgCyanBright = format(106, 49);
83
+ exports.bgWhiteBright = format(107, 49);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vicinae/api",
3
- "version": "0.16.7",
3
+ "version": "0.16.9",
4
4
  "description": "TypeScript SDK to build Vicinae extensions",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1",
@@ -34,7 +34,6 @@
34
34
  "@oclif/plugin-plugins": "^5",
35
35
  "@types/node": ">=18",
36
36
  "@types/react": "19.0.10",
37
- "chalk": "^5.6.0",
38
37
  "chokidar": "^4.0.3",
39
38
  "esbuild": "^0.25.2",
40
39
  "react": "19.0.0",
package/types/jsx.d.ts CHANGED
@@ -45,11 +45,11 @@ declare module "react" {
45
45
  id?: string;
46
46
  subtitle?: string;
47
47
  icon?:
48
- | SerializedImageLike
49
- | {
50
- value?: SerializedImageLike | null;
51
- tooltip: string;
52
- };
48
+ | SerializedImageLike
49
+ | {
50
+ value?: SerializedImageLike | null;
51
+ tooltip: string;
52
+ };
53
53
  keywords?: string[];
54
54
  accessories?: List.Item.SerializedAccessory[];
55
55
  children?: React.ReactNode;
@@ -119,17 +119,25 @@ declare module "react" {
119
119
  "action-panel": {
120
120
  title?: string;
121
121
  children?: React.ReactNode;
122
+ stableId?: string;
122
123
  };
123
124
  "action-panel-submenu": {
124
125
  title: string;
125
126
  icon?: SerializedImageLike;
127
+ shortcut?: Keyboard.Shortcut | Keyboard.Shortcut.Common;
128
+ autoFocus?: boolean;
129
+ filtering?: boolean | { keepSectionOrder: boolean };
130
+ isLoading?: boolean;
131
+ throttle?: boolean;
126
132
  onOpen?: () => void;
127
133
  onSearchTextChange?: (text: string) => void;
128
134
  children?: React.ReactNode;
135
+ stableId?: string;
129
136
  };
130
137
  "action-panel-section": {
131
138
  title?: string;
132
139
  children?: React.ReactNode;
140
+ stableId?: string;
133
141
  };
134
142
  action: {
135
143
  title: string;
@@ -140,6 +148,7 @@ declare module "react" {
140
148
  autoFocus?: boolean;
141
149
  type?: string;
142
150
  quicklink?: Quicklink;
151
+ stableId?: string;
143
152
  };
144
153
  "tag-list": {
145
154
  title?: string;