asyar-sdk 1.5.0 → 1.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.
- package/README.md +75 -1
- package/dist/ExtensionContext.d.ts +3 -0
- package/dist/ExtensionContext.d.ts.map +1 -1
- package/dist/ExtensionContext.js +47 -0
- package/dist/ExtensionContext.js.map +1 -1
- package/dist/icons/AsyarIconElement.d.ts +14 -0
- package/dist/icons/AsyarIconElement.d.ts.map +1 -0
- package/dist/icons/AsyarIconElement.js +38 -0
- package/dist/icons/AsyarIconElement.js.map +1 -0
- package/dist/icons/AsyarIconElement.test.d.ts +2 -0
- package/dist/icons/AsyarIconElement.test.d.ts.map +1 -0
- package/dist/icons/AsyarIconElement.test.js +34 -0
- package/dist/icons/AsyarIconElement.test.js.map +1 -0
- package/dist/icons/ExtensionContext.theme.test.d.ts +2 -0
- package/dist/icons/ExtensionContext.theme.test.d.ts.map +1 -0
- package/dist/icons/ExtensionContext.theme.test.js +97 -0
- package/dist/icons/ExtensionContext.theme.test.js.map +1 -0
- package/dist/icons/IconRenderer.d.ts +14 -0
- package/dist/icons/IconRenderer.d.ts.map +1 -0
- package/dist/icons/IconRenderer.js +32 -0
- package/dist/icons/IconRenderer.js.map +1 -0
- package/dist/icons/IconRenderer.test.d.ts +2 -0
- package/dist/icons/IconRenderer.test.d.ts.map +1 -0
- package/dist/icons/IconRenderer.test.js +88 -0
- package/dist/icons/IconRenderer.test.js.map +1 -0
- package/dist/icons/iconData.d.ts +3 -0
- package/dist/icons/iconData.d.ts.map +1 -0
- package/dist/icons/iconData.js +154 -0
- package/dist/icons/iconData.js.map +1 -0
- package/dist/icons/index.d.ts +5 -0
- package/dist/icons/index.d.ts.map +1 -0
- package/dist/icons/index.js +15 -0
- package/dist/icons/index.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/types/ActionType.d.ts +2 -0
- package/dist/types/ActionType.d.ts.map +1 -1
- package/dist/types/ActionType.js.map +1 -1
- package/package.json +15 -4
- package/src/styles/tokens.css +101 -0
package/README.md
CHANGED
|
@@ -143,7 +143,35 @@ export default new MyExtension();
|
|
|
143
143
|
|
|
144
144
|
### Extension Icons
|
|
145
145
|
|
|
146
|
-
Add an `icon` field to your manifest to show a branded icon next to your commands in the launcher search results.
|
|
146
|
+
Add an `icon` field to your manifest to show a branded icon next to your commands in the launcher search results.
|
|
147
|
+
|
|
148
|
+
#### Supported icon formats
|
|
149
|
+
|
|
150
|
+
| Format | Example | Where rendered |
|
|
151
|
+
|--------|---------|----------------|
|
|
152
|
+
| Built-in icon | `"icon:calculator"` | Manifests, commands, search results, actions — rendered by the host |
|
|
153
|
+
| Emoji | `"👋"` | Manifests, commands, search results, actions — rendered by the host |
|
|
154
|
+
| Web URL | `"https://example.com/icon.png"` | Commands and search results — rendered by the host |
|
|
155
|
+
| Local path | `"assets/icon.png"` | Commands and search results — rendered by the host |
|
|
156
|
+
|
|
157
|
+
#### Rendering built-in icons in extension iframes
|
|
158
|
+
|
|
159
|
+
Use the `<asyar-icon>` custom element to render built-in icons inside your extension views. Icons are rendered as SVGs with `viewBox="0 0 24 24"`, `fill="none"`, and `stroke="currentColor"`.
|
|
160
|
+
|
|
161
|
+
```html
|
|
162
|
+
<!-- Register the element (usually in your main.ts) -->
|
|
163
|
+
<!-- import { registerIconElement } from 'asyar-sdk'; -->
|
|
164
|
+
<!-- registerIconElement(); -->
|
|
165
|
+
|
|
166
|
+
<!-- Use in your HTML/Svelte/React templates -->
|
|
167
|
+
<asyar-icon name="calculator" size="20" stroke="2"></asyar-icon>
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
| Attribute | Default | Description |
|
|
171
|
+
|-----------|---------|-------------|
|
|
172
|
+
| `name` | (required) | The name of the built-in icon (e.g., `calculator`, `settings`) |
|
|
173
|
+
| `size` | `24` | The width and height of the SVG in pixels |
|
|
174
|
+
| `stroke` | `1.5` | The `stroke-width` of the icon paths |
|
|
147
175
|
|
|
148
176
|
**Extension-level icon** (applies to all commands as default):
|
|
149
177
|
```json
|
|
@@ -164,6 +192,52 @@ Add an `icon` field to your manifest to show a branded icon next to your command
|
|
|
164
192
|
}
|
|
165
193
|
```
|
|
166
194
|
|
|
195
|
+
### Design Tokens & Theming
|
|
196
|
+
|
|
197
|
+
The Asyar host automatically injects two things into every extension iframe:
|
|
198
|
+
|
|
199
|
+
- **Design tokens** — the full set of CSS custom properties (`var(--token-name)`)
|
|
200
|
+
- **Fonts** — Satoshi and JetBrains Mono are delivered as base64 data URIs so `var(--font-ui)` and `var(--font-mono)` render the real typefaces, not system fallbacks
|
|
201
|
+
|
|
202
|
+
No setup needed — just use the variables in your CSS.
|
|
203
|
+
|
|
204
|
+
**Theme changes are live.** When the user switches between light and dark mode, the host re-injects updated token values. Your extension's UI updates without a reload. Fonts are sent once on load and cached.
|
|
205
|
+
|
|
206
|
+
```css
|
|
207
|
+
.card {
|
|
208
|
+
background: var(--bg-secondary);
|
|
209
|
+
color: var(--text-primary);
|
|
210
|
+
border: 1px solid var(--separator);
|
|
211
|
+
border-radius: var(--radius-md);
|
|
212
|
+
padding: var(--space-6);
|
|
213
|
+
}
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
During development, import the static fallback file for IDE autocomplete and neutral defaults:
|
|
217
|
+
|
|
218
|
+
```javascript
|
|
219
|
+
// vite.config or main.ts
|
|
220
|
+
import 'asyar-sdk/tokens.css';
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
Available token categories
|
|
224
|
+
|
|
225
|
+
| Category | Variables |
|
|
226
|
+
|---|---|
|
|
227
|
+
| Backgrounds | --bg-primary, --bg-secondary, --bg-tertiary, --bg-hover, --bg-selected, --bg-popup |
|
|
228
|
+
| Text | --text-primary, --text-secondary, --text-tertiary |
|
|
229
|
+
| Borders | --border-color, --separator |
|
|
230
|
+
| Accent | --accent-primary, --accent-success, --accent-warning, --accent-danger |
|
|
231
|
+
| Brand | --asyar-brand, --asyar-brand-hover, --asyar-brand-muted, --asyar-brand-subtle |
|
|
232
|
+
| Shadows | --shadow-xs → --shadow-xl, --shadow-popup, --shadow-focus |
|
|
233
|
+
| Radius | --radius-xs → --radius-full |
|
|
234
|
+
| Spacing | --space-1 (4px) → --space-11 (48px) |
|
|
235
|
+
| Font sizes | --font-size-2xs (10px) → --font-size-display (2.25rem) |
|
|
236
|
+
| Font families | --font-ui (Satoshi), --font-mono (JetBrains Mono) |
|
|
237
|
+
| Transitions | --transition-fast, --transition-normal, --transition-smooth, --transition-slow |
|
|
238
|
+
|
|
239
|
+
See tokens.css for the full list with fallback values.
|
|
240
|
+
|
|
167
241
|
### Platform Compatibility
|
|
168
242
|
|
|
169
243
|
Add a `platforms` field to your manifest to restrict your extension to specific operating systems. Extensions that don't support the current OS are hidden in the store and blocked from loading by the host.
|
|
@@ -16,6 +16,7 @@ export declare class ExtensionContext {
|
|
|
16
16
|
};
|
|
17
17
|
constructor();
|
|
18
18
|
private setupFocusTracking;
|
|
19
|
+
private setupThemeInjection;
|
|
19
20
|
getService<T>(serviceType: string): T;
|
|
20
21
|
setExtensionId(id: string): void;
|
|
21
22
|
registerAction(action: ExtensionAction): void;
|
|
@@ -23,4 +24,6 @@ export declare class ExtensionContext {
|
|
|
23
24
|
registerCommand(commandId: string, handler: CommandHandler): void;
|
|
24
25
|
unregisterCommand(commandId: string): void;
|
|
25
26
|
}
|
|
27
|
+
export declare function injectThemeVariables(vars: Record<string, string>): void;
|
|
28
|
+
export declare function injectFontFaceCSS(css: string): void;
|
|
26
29
|
//# sourceMappingURL=ExtensionContext.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExtensionContext.d.ts","sourceRoot":"","sources":["../src/ExtensionContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,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AGD,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAQnD"}
|
package/dist/ExtensionContext.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ExtensionContext = void 0;
|
|
4
|
+
exports.injectThemeVariables = injectThemeVariables;
|
|
5
|
+
exports.injectFontFaceCSS = injectFontFaceCSS;
|
|
4
6
|
const services_1 = require("./services");
|
|
5
7
|
// Define the context that will be passed to extensions
|
|
6
8
|
class ExtensionContext {
|
|
@@ -19,6 +21,7 @@ class ExtensionContext {
|
|
|
19
21
|
StatusBarService: new services_1.StatusBarServiceProxy(),
|
|
20
22
|
};
|
|
21
23
|
this.setupFocusTracking();
|
|
24
|
+
this.setupThemeInjection();
|
|
22
25
|
}
|
|
23
26
|
setupFocusTracking() {
|
|
24
27
|
if (typeof window === 'undefined' || typeof document === 'undefined')
|
|
@@ -65,6 +68,27 @@ class ExtensionContext {
|
|
|
65
68
|
}, 0);
|
|
66
69
|
});
|
|
67
70
|
}
|
|
71
|
+
setupThemeInjection() {
|
|
72
|
+
if (typeof window === 'undefined' || typeof document === 'undefined')
|
|
73
|
+
return;
|
|
74
|
+
window.addEventListener('message', (event) => {
|
|
75
|
+
var _a, _b;
|
|
76
|
+
if (((_a = event.data) === null || _a === void 0 ? void 0 : _a.type) === 'asyar:theme:variables') {
|
|
77
|
+
const vars = event.data.payload;
|
|
78
|
+
if (!vars || typeof vars !== 'object')
|
|
79
|
+
return;
|
|
80
|
+
injectThemeVariables(vars);
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
if (((_b = event.data) === null || _b === void 0 ? void 0 : _b.type) === 'asyar:theme:fonts') {
|
|
84
|
+
const css = event.data.payload;
|
|
85
|
+
if (!css || typeof css !== 'string')
|
|
86
|
+
return;
|
|
87
|
+
injectFontFaceCSS(css);
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
}
|
|
68
92
|
// Method to get a service by its interface name
|
|
69
93
|
getService(serviceType) {
|
|
70
94
|
const service = this.proxies[serviceType];
|
|
@@ -123,6 +147,29 @@ class ExtensionContext {
|
|
|
123
147
|
}
|
|
124
148
|
}
|
|
125
149
|
exports.ExtensionContext = ExtensionContext;
|
|
150
|
+
// Helper function to inject theme variables into the document
|
|
151
|
+
function injectThemeVariables(vars) {
|
|
152
|
+
let style = document.getElementById('asyar-theme-vars');
|
|
153
|
+
if (!style) {
|
|
154
|
+
style = document.createElement('style');
|
|
155
|
+
style.id = 'asyar-theme-vars';
|
|
156
|
+
document.head.appendChild(style);
|
|
157
|
+
}
|
|
158
|
+
const declarations = Object.entries(vars)
|
|
159
|
+
.map(([name, value]) => ` ${name}: ${value};`)
|
|
160
|
+
.join('\n');
|
|
161
|
+
style.textContent = `:root {\n${declarations}\n}`;
|
|
162
|
+
}
|
|
163
|
+
// Helper function to inject font face CSS into the document
|
|
164
|
+
function injectFontFaceCSS(css) {
|
|
165
|
+
let style = document.getElementById('asyar-theme-fonts');
|
|
166
|
+
if (!style) {
|
|
167
|
+
style = document.createElement('style');
|
|
168
|
+
style.id = 'asyar-theme-fonts';
|
|
169
|
+
document.head.appendChild(style);
|
|
170
|
+
}
|
|
171
|
+
style.textContent = css;
|
|
172
|
+
}
|
|
126
173
|
// Import at the end to avoid circular dependencies
|
|
127
174
|
const ExtensionBridge_1 = require("./ExtensionBridge");
|
|
128
175
|
//# sourceMappingURL=ExtensionContext.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExtensionContext.js","sourceRoot":"","sources":["../src/ExtensionContext.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"ExtensionContext.js","sourceRoot":"","sources":["../src/ExtensionContext.ts"],"names":[],"mappings":";;;AA0KA,oDAWC;AAGD,8CAQC;AA9LD,yCAUoB;AAEpB,uDAAuD;AACvD,MAAa,gBAAgB;IAgB3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AAG,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;QACxC,KAAK,CAAC,EAAE,GAAG,mBAAmB,CAAC;QAC/B,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;IACnC,CAAC;IACD,KAAK,CAAC,WAAW,GAAG,GAAG,CAAC;AAC1B,CAAC;AAED,mDAAmD;AACnD,uDAAoD"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
declare const HTMLElementClass: {
|
|
2
|
+
new (): HTMLElement;
|
|
3
|
+
prototype: HTMLElement;
|
|
4
|
+
};
|
|
5
|
+
export declare class AsyarIconElement extends HTMLElementClass {
|
|
6
|
+
static observedAttributes: string[];
|
|
7
|
+
connectedCallback(): void;
|
|
8
|
+
attributeChangedCallback(): void;
|
|
9
|
+
private render;
|
|
10
|
+
}
|
|
11
|
+
/** Register the <asyar-icon> custom element. Safe to call multiple times. */
|
|
12
|
+
export declare function registerIconElement(tagName?: string): void;
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=AsyarIconElement.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AsyarIconElement.d.ts","sourceRoot":"","sources":["../../src/icons/AsyarIconElement.ts"],"names":[],"mappings":"AAEA,QAAA,MAAM,gBAAgB;;;CAA+F,CAAC;AAEtH,qBAAa,gBAAiB,SAAQ,gBAAgB;IACpD,MAAM,CAAC,kBAAkB,WAAoC;IAE7D,iBAAiB;IASjB,wBAAwB;IAIxB,OAAO,CAAC,MAAM;CASf;AAED,6EAA6E;AAC7E,wBAAgB,mBAAmB,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAK1D"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AsyarIconElement = void 0;
|
|
4
|
+
exports.registerIconElement = registerIconElement;
|
|
5
|
+
const IconRenderer_1 = require("./IconRenderer");
|
|
6
|
+
const HTMLElementClass = typeof HTMLElement !== 'undefined' ? HTMLElement : class {
|
|
7
|
+
};
|
|
8
|
+
class AsyarIconElement extends HTMLElementClass {
|
|
9
|
+
connectedCallback() {
|
|
10
|
+
if (this.style) {
|
|
11
|
+
this.style.display = 'inline-flex';
|
|
12
|
+
this.style.alignItems = 'center';
|
|
13
|
+
this.style.justifyContent = 'center';
|
|
14
|
+
}
|
|
15
|
+
this.render();
|
|
16
|
+
}
|
|
17
|
+
attributeChangedCallback() {
|
|
18
|
+
this.render();
|
|
19
|
+
}
|
|
20
|
+
render() {
|
|
21
|
+
const name = this.getAttribute('name') || '';
|
|
22
|
+
const sizeAttr = this.getAttribute('size');
|
|
23
|
+
const size = sizeAttr ? parseInt(sizeAttr, 10) : 20;
|
|
24
|
+
const strokeWidthAttr = this.getAttribute('stroke-width');
|
|
25
|
+
const strokeWidth = strokeWidthAttr ? parseFloat(strokeWidthAttr) : 1.5;
|
|
26
|
+
this.innerHTML = (0, IconRenderer_1.renderIcon)(name, { size, strokeWidth });
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
exports.AsyarIconElement = AsyarIconElement;
|
|
30
|
+
AsyarIconElement.observedAttributes = ['name', 'size', 'stroke-width'];
|
|
31
|
+
/** Register the <asyar-icon> custom element. Safe to call multiple times. */
|
|
32
|
+
function registerIconElement(tagName) {
|
|
33
|
+
const tag = tagName || 'asyar-icon';
|
|
34
|
+
if (typeof customElements !== 'undefined' && !customElements.get(tag)) {
|
|
35
|
+
customElements.define(tag, AsyarIconElement);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=AsyarIconElement.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AsyarIconElement.js","sourceRoot":"","sources":["../../src/icons/AsyarIconElement.ts"],"names":[],"mappings":";;;AAgCA,kDAKC;AArCD,iDAA4C;AAE5C,MAAM,gBAAgB,GAAG,OAAO,WAAW,KA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IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;QACtE,cAAc,CAAC,MAAM,CAAC,GAAG,EAAE,gBAAgB,CAAC,CAAC;IAC/C,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AsyarIconElement.test.d.ts","sourceRoot":"","sources":["../../src/icons/AsyarIconElement.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const vitest_1 = require("vitest");
|
|
4
|
+
const AsyarIconElement_1 = require("./AsyarIconElement");
|
|
5
|
+
(0, vitest_1.describe)('AsyarIconElement', () => {
|
|
6
|
+
(0, vitest_1.beforeEach)(() => {
|
|
7
|
+
// Usually registerIconElement() is safe to call multiple times as it checks if it's already defined
|
|
8
|
+
(0, AsyarIconElement_1.registerIconElement)('asyar-icon-test');
|
|
9
|
+
});
|
|
10
|
+
(0, vitest_1.it)('renders SVG internally when name is set', () => {
|
|
11
|
+
const el = document.createElement('asyar-icon-test');
|
|
12
|
+
el.setAttribute('name', 'calculator');
|
|
13
|
+
document.body.appendChild(el);
|
|
14
|
+
(0, vitest_1.expect)(el.innerHTML).toContain('<svg');
|
|
15
|
+
(0, vitest_1.expect)(el.innerHTML).toContain('width="20"');
|
|
16
|
+
(0, vitest_1.expect)(el.style.display).toBe('inline-flex');
|
|
17
|
+
});
|
|
18
|
+
(0, vitest_1.it)('updates when attributes change', () => {
|
|
19
|
+
const el = document.createElement('asyar-icon-test');
|
|
20
|
+
el.setAttribute('name', 'calculator');
|
|
21
|
+
el.setAttribute('size', '16');
|
|
22
|
+
document.body.appendChild(el);
|
|
23
|
+
(0, vitest_1.expect)(el.innerHTML).toContain('width="16"');
|
|
24
|
+
el.setAttribute('size', '32');
|
|
25
|
+
(0, vitest_1.expect)(el.innerHTML).toContain('width="32"');
|
|
26
|
+
});
|
|
27
|
+
(0, vitest_1.it)('applies default size if missing', () => {
|
|
28
|
+
const el = document.createElement('asyar-icon-test');
|
|
29
|
+
el.setAttribute('name', 'calculator');
|
|
30
|
+
document.body.appendChild(el);
|
|
31
|
+
(0, vitest_1.expect)(el.innerHTML).toContain('width="20"');
|
|
32
|
+
});
|
|
33
|
+
});
|
|
34
|
+
//# sourceMappingURL=AsyarIconElement.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AsyarIconElement.test.js","sourceRoot":"","sources":["../../src/icons/AsyarIconElement.test.ts"],"names":[],"mappings":";;AAAA,mCAA0D;AAC1D,yDAA2E;AAE3E,IAAA,iBAAQ,EAAC,kBAAkB,EAAE,GAAG,EAAE;IAChC,IAAA,mBAAU,EAAC,GAAG,EAAE;QACd,oGAAoG;QACpG,IAAA,sCAAmB,EAAC,iBAAiB,CAAC,CAAC;IACzC,CAAC,CAAC,CAAC;IAEH,IAAA,WAAE,EAAC,yCAAyC,EAAE,GAAG,EAAE;QACjD,MAAM,EAAE,GAAG,QAAQ,CAAC,aAAa,CAAC,iBAAiB,CAAqB,CAAC;QACzE,EAAE,CAAC,YAAY,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;QACtC,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;QAE9B,IAAA,eAAM,EAAC,EAAE,CAAC,SAAS,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;QACvC,IAAA,eAAM,EAAC,EAAE,CAAC,SAAS,CAAC,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC;QAC7C,IAAA,eAAM,EAAC,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;IAC/C,CAAC,CAAC,CAAC;IAEH,IAAA,WAAE,EAAC,gCAAgC,EAAE,GAAG,EAAE;QACxC,MAAM,EAAE,GAAG,QAAQ,CAAC,aAAa,CAAC,iBAAiB,CAAqB,CAAC;QACzE,EAAE,CAAC,YAAY,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;QACtC,EAAE,CAAC,YAAY,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;QAC9B,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;QAE9B,IAAA,eAAM,EAAC,EAAE,CAAC,SAAS,CAAC,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC;QAE7C,EAAE,CAAC,YAAY,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;QAC9B,IAAA,eAAM,EAAC,EAAE,CAAC,SAAS,CAAC,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC;IAC/C,CAAC,CAAC,CAAC;IAEH,IAAA,WAAE,EAAC,iCAAiC,EAAE,GAAG,EAAE;QACzC,MAAM,EAAE,GAAG,QAAQ,CAAC,aAAa,CAAC,iBAAiB,CAAqB,CAAC;QACzE,EAAE,CAAC,YAAY,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;QACtC,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;QAE9B,IAAA,eAAM,EAAC,EAAE,CAAC,SAAS,CAAC,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC;IAC/C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExtensionContext.theme.test.d.ts","sourceRoot":"","sources":["../../src/icons/ExtensionContext.theme.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const vitest_1 = require("vitest");
|
|
4
|
+
const ExtensionContext_1 = require("../ExtensionContext");
|
|
5
|
+
(0, vitest_1.describe)('ExtensionContext Theme Injection', () => {
|
|
6
|
+
(0, vitest_1.beforeEach)(() => {
|
|
7
|
+
document.head.innerHTML = '';
|
|
8
|
+
document.body.innerHTML = '';
|
|
9
|
+
vitest_1.vi.restoreAllMocks();
|
|
10
|
+
});
|
|
11
|
+
(0, vitest_1.it)('injectThemeVariables creates a <style id="asyar-theme-vars"> in document.head', () => {
|
|
12
|
+
(0, ExtensionContext_1.injectThemeVariables)({ '--bg-primary': 'red' });
|
|
13
|
+
const style = document.getElementById('asyar-theme-vars');
|
|
14
|
+
(0, vitest_1.expect)(style).toBeTruthy();
|
|
15
|
+
(0, vitest_1.expect)(style.parentElement).toBe(document.head);
|
|
16
|
+
(0, vitest_1.expect)(style.textContent).toContain('--bg-primary: red;');
|
|
17
|
+
});
|
|
18
|
+
(0, vitest_1.it)('injectThemeVariables populates it with :root declarations', () => {
|
|
19
|
+
(0, ExtensionContext_1.injectThemeVariables)({
|
|
20
|
+
'--bg-primary': 'red',
|
|
21
|
+
'--text-primary': 'white'
|
|
22
|
+
});
|
|
23
|
+
const style = document.getElementById('asyar-theme-vars');
|
|
24
|
+
(0, vitest_1.expect)(style.textContent).toContain(':root {');
|
|
25
|
+
(0, vitest_1.expect)(style.textContent).toContain('--bg-primary: red;');
|
|
26
|
+
(0, vitest_1.expect)(style.textContent).toContain('--text-primary: white;');
|
|
27
|
+
});
|
|
28
|
+
(0, vitest_1.it)('calling injectThemeVariables twice updates the existing style element', () => {
|
|
29
|
+
(0, ExtensionContext_1.injectThemeVariables)({ '--bg-primary': 'red' });
|
|
30
|
+
const initialStyle = document.getElementById('asyar-theme-vars');
|
|
31
|
+
(0, ExtensionContext_1.injectThemeVariables)({ '--bg-primary': 'blue' });
|
|
32
|
+
const updatedStyle = document.getElementById('asyar-theme-vars');
|
|
33
|
+
(0, vitest_1.expect)(initialStyle).toBe(updatedStyle);
|
|
34
|
+
(0, vitest_1.expect)(updatedStyle === null || updatedStyle === void 0 ? void 0 : updatedStyle.textContent).toContain('--bg-primary: blue;');
|
|
35
|
+
});
|
|
36
|
+
(0, vitest_1.it)('injectThemeVariables with empty object produces an empty :root {} block', () => {
|
|
37
|
+
(0, ExtensionContext_1.injectThemeVariables)({});
|
|
38
|
+
const style = document.getElementById('asyar-theme-vars');
|
|
39
|
+
(0, vitest_1.expect)(style === null || style === void 0 ? void 0 : style.textContent).toContain(':root {\n\n}');
|
|
40
|
+
});
|
|
41
|
+
(0, vitest_1.it)('receiving asyar:theme:variables message triggers injection', () => {
|
|
42
|
+
// Instantiate ExtensionContext to set up the listener
|
|
43
|
+
new ExtensionContext_1.ExtensionContext();
|
|
44
|
+
const themeVars = { '--bg-primary': 'green' };
|
|
45
|
+
const event = new MessageEvent('message', {
|
|
46
|
+
data: {
|
|
47
|
+
type: 'asyar:theme:variables',
|
|
48
|
+
payload: themeVars
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
window.dispatchEvent(event);
|
|
52
|
+
const style = document.getElementById('asyar-theme-vars');
|
|
53
|
+
(0, vitest_1.expect)(style === null || style === void 0 ? void 0 : style.textContent).toContain('--bg-primary: green;');
|
|
54
|
+
});
|
|
55
|
+
(0, vitest_1.it)('injectFontFaceCSS creates a <style id="asyar-theme-fonts"> in document.head', () => {
|
|
56
|
+
const mockCSS = '@font-face { font-family: "Satoshi"; }';
|
|
57
|
+
(0, ExtensionContext_1.injectFontFaceCSS)(mockCSS);
|
|
58
|
+
const style = document.getElementById('asyar-theme-fonts');
|
|
59
|
+
(0, vitest_1.expect)(style).toBeTruthy();
|
|
60
|
+
(0, vitest_1.expect)(style.parentElement).toBe(document.head);
|
|
61
|
+
(0, vitest_1.expect)(style.textContent).toBe(mockCSS);
|
|
62
|
+
});
|
|
63
|
+
(0, vitest_1.it)('calling injectFontFaceCSS twice updates the existing style element', () => {
|
|
64
|
+
(0, ExtensionContext_1.injectFontFaceCSS)('body { font-family: Satoshi; }');
|
|
65
|
+
const initialStyle = document.getElementById('asyar-theme-fonts');
|
|
66
|
+
(0, ExtensionContext_1.injectFontFaceCSS)('body { font-family: JetBrains; }');
|
|
67
|
+
const updatedStyle = document.getElementById('asyar-theme-fonts');
|
|
68
|
+
(0, vitest_1.expect)(initialStyle).toBe(updatedStyle);
|
|
69
|
+
(0, vitest_1.expect)(updatedStyle === null || updatedStyle === void 0 ? void 0 : updatedStyle.textContent).toBe('body { font-family: JetBrains; }');
|
|
70
|
+
});
|
|
71
|
+
(0, vitest_1.it)('receiving asyar:theme:fonts message triggers injection', () => {
|
|
72
|
+
new ExtensionContext_1.ExtensionContext();
|
|
73
|
+
const mockCSS = '/* merged font faces */';
|
|
74
|
+
const event = new MessageEvent('message', {
|
|
75
|
+
data: {
|
|
76
|
+
type: 'asyar:theme:fonts',
|
|
77
|
+
payload: mockCSS
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
window.dispatchEvent(event);
|
|
81
|
+
const style = document.getElementById('asyar-theme-fonts');
|
|
82
|
+
(0, vitest_1.expect)(style === null || style === void 0 ? void 0 : style.textContent).toBe(mockCSS);
|
|
83
|
+
});
|
|
84
|
+
(0, vitest_1.it)('ignores asyar:theme:fonts with non-string payload', () => {
|
|
85
|
+
new ExtensionContext_1.ExtensionContext();
|
|
86
|
+
const event = new MessageEvent('message', {
|
|
87
|
+
data: {
|
|
88
|
+
type: 'asyar:theme:fonts',
|
|
89
|
+
payload: { invalid: 'type' }
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
window.dispatchEvent(event);
|
|
93
|
+
const style = document.getElementById('asyar-theme-fonts');
|
|
94
|
+
(0, vitest_1.expect)(style).toBeNull();
|
|
95
|
+
});
|
|
96
|
+
});
|
|
97
|
+
//# sourceMappingURL=ExtensionContext.theme.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExtensionContext.theme.test.js","sourceRoot":"","sources":["../../src/icons/ExtensionContext.theme.test.ts"],"names":[],"mappings":";;AAAA,mCAA8D;AAC9D,0DAAgG;AAEhG,IAAA,iBAAQ,EAAC,kCAAkC,EAAE,GAAG,EAAE;IAChD,IAAA,mBAAU,EAAC,GAAG,EAAE;QACd,QAAQ,CAA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;gBACJ,IAAI,EAAE,mBAAmB;gBACzB,OAAO,EAAE,OAAO;aACjB;SACF,CAAC,CAAC;QAEH,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QAE5B,MAAM,KAAK,GAAG,QAAQ,CAAC,cAAc,CAAC,mBAAmB,CAAC,CAAC;QAC3D,IAAA,eAAM,EAAC,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,WAAW,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC3C,CAAC,CAAC,CAAC;IAEH,IAAA,WAAE,EAAC,mDAAmD,EAAE,GAAG,EAAE;QAC3D,IAAI,mCAAgB,EAAE,CAAC;QAEvB,MAAM,KAAK,GAAG,IAAI,YAAY,CAAC,SAAS,EAAE;YACxC,IAAI,EAAE;gBACJ,IAAI,EAAE,mBAAmB;gBACzB,OAAO,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE;aAC7B;SACF,CAAC,CAAC;QAEH,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QAE5B,MAAM,KAAK,GAAG,QAAQ,CAAC,cAAc,CAAC,mBAAmB,CAAC,CAAC;QAC3D,IAAA,eAAM,EAAC,KAAK,CAAC,CAAC,QAAQ,EAAE,CAAC;IAC3B,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface IconOptions {
|
|
2
|
+
size?: number;
|
|
3
|
+
strokeWidth?: number;
|
|
4
|
+
class?: string;
|
|
5
|
+
}
|
|
6
|
+
/** Returns a complete SVG markup string for the given icon name, or empty string if not found. */
|
|
7
|
+
export declare function renderIcon(name: string, options?: IconOptions): string;
|
|
8
|
+
/** Returns a list of all available icon names. */
|
|
9
|
+
export declare function listIcons(): readonly string[];
|
|
10
|
+
/** Returns true if the given name exists in the built-in icon set. */
|
|
11
|
+
export declare function hasIcon(name: string): boolean;
|
|
12
|
+
/** Returns the raw SVG inner content for the given icon, or undefined. */
|
|
13
|
+
export declare function getIconData(name: string): string | undefined;
|
|
14
|
+
//# sourceMappingURL=IconRenderer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IconRenderer.d.ts","sourceRoot":"","sources":["../../src/icons/IconRenderer.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,WAAW;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,kGAAkG;AAClG,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG,MAAM,CAWtE;AAED,kDAAkD;AAClD,wBAAgB,SAAS,IAAI,SAAS,MAAM,EAAE,CAE7C;AAED,sEAAsE;AACtE,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAE7C;AAED,0EAA0E;AAC1E,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAE5D"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.renderIcon = renderIcon;
|
|
4
|
+
exports.listIcons = listIcons;
|
|
5
|
+
exports.hasIcon = hasIcon;
|
|
6
|
+
exports.getIconData = getIconData;
|
|
7
|
+
const iconData_1 = require("./iconData");
|
|
8
|
+
/** Returns a complete SVG markup string for the given icon name, or empty string if not found. */
|
|
9
|
+
function renderIcon(name, options) {
|
|
10
|
+
var _a, _b;
|
|
11
|
+
const iconData = iconData_1.ICON_DATA[name];
|
|
12
|
+
if (!iconData) {
|
|
13
|
+
return '';
|
|
14
|
+
}
|
|
15
|
+
const size = (_a = options === null || options === void 0 ? void 0 : options.size) !== null && _a !== void 0 ? _a : 20;
|
|
16
|
+
const strokeWidth = (_b = options === null || options === void 0 ? void 0 : options.strokeWidth) !== null && _b !== void 0 ? _b : 1.5;
|
|
17
|
+
const className = (options === null || options === void 0 ? void 0 : options.class) ? ` class="${options.class}"` : '';
|
|
18
|
+
return `<svg xmlns="http://www.w3.org/2000/svg" width="${size}" height="${size}" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="${strokeWidth}" stroke-linecap="round" stroke-linejoin="round"${className}>${iconData.trim()}</svg>`;
|
|
19
|
+
}
|
|
20
|
+
/** Returns a list of all available icon names. */
|
|
21
|
+
function listIcons() {
|
|
22
|
+
return iconData_1.ICON_NAMES;
|
|
23
|
+
}
|
|
24
|
+
/** Returns true if the given name exists in the built-in icon set. */
|
|
25
|
+
function hasIcon(name) {
|
|
26
|
+
return name in iconData_1.ICON_DATA;
|
|
27
|
+
}
|
|
28
|
+
/** Returns the raw SVG inner content for the given icon, or undefined. */
|
|
29
|
+
function getIconData(name) {
|
|
30
|
+
return iconData_1.ICON_DATA[name];
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=IconRenderer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IconRenderer.js","sourceRoot":"","sources":["../../src/icons/IconRenderer.ts"],"names":[],"mappings":";;AASA,gCAWC;AAGD,8BAEC;AAGD,0BAEC;AAGD,kCAEC;AAnCD,yCAAmD;AAQnD,kGAAkG;AAClG,SAAgB,UAAU,CAAC,IAAY,EAAE,OAAqB;;IAC5D,MAAM,QAAQ,GAAG,oBAAS,CAAC,IAAI,CAAC,CAAC;IACjC,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,MAAM,IAAI,GAAG,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,mCAAI,EAAE,CAAC;IACjC,MAAM,WAAW,GAAG,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,WAAW,mCAAI,GAAG,CAAC;IAChD,MAAM,SAAS,GAAG,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,KAAK,EAAC,CAAC,CAAC,WAAW,OAAO,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;IAEpE,OAAO,kDAAkD,IAAI,aAAa,IAAI,yEAAyE,WAAW,mDAAmD,SAAS,IAAI,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;AAC5P,CAAC;AAED,kDAAkD;AAClD,SAAgB,SAAS;IACvB,OAAO,qBAAU,CAAC;AACpB,CAAC;AAED,sEAAsE;AACtE,SAAgB,OAAO,CAAC,IAAY;IAClC,OAAO,IAAI,IAAI,oBAAS,CAAC;AAC3B,CAAC;AAED,0EAA0E;AAC1E,SAAgB,WAAW,CAAC,IAAY;IACtC,OAAO,oBAAS,CAAC,IAAI,CAAC,CAAC;AACzB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IconRenderer.test.d.ts","sourceRoot":"","sources":["../../src/icons/IconRenderer.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const vitest_1 = require("vitest");
|
|
4
|
+
const IconRenderer_1 = require("./IconRenderer");
|
|
5
|
+
const iconData_1 = require("./iconData");
|
|
6
|
+
(0, vitest_1.describe)('IconRenderer', () => {
|
|
7
|
+
(0, vitest_1.describe)('renderIcon', () => {
|
|
8
|
+
(0, vitest_1.it)('returns SVG string for valid icon name', () => {
|
|
9
|
+
const svg = (0, IconRenderer_1.renderIcon)('calculator');
|
|
10
|
+
(0, vitest_1.expect)(svg).toContain('<svg');
|
|
11
|
+
(0, vitest_1.expect)(svg).toContain('viewBox="0 0 24 24"');
|
|
12
|
+
(0, vitest_1.expect)(svg).toContain('stroke="currentColor"');
|
|
13
|
+
(0, vitest_1.expect)(svg).toContain('</svg>');
|
|
14
|
+
});
|
|
15
|
+
(0, vitest_1.it)('returns empty string for unknown icon name', () => {
|
|
16
|
+
(0, vitest_1.expect)((0, IconRenderer_1.renderIcon)('nonexistent-icon')).toBe('');
|
|
17
|
+
});
|
|
18
|
+
(0, vitest_1.it)('applies custom size', () => {
|
|
19
|
+
const svg = (0, IconRenderer_1.renderIcon)('calculator', { size: 16 });
|
|
20
|
+
(0, vitest_1.expect)(svg).toContain('width="16"');
|
|
21
|
+
(0, vitest_1.expect)(svg).toContain('height="16"');
|
|
22
|
+
});
|
|
23
|
+
(0, vitest_1.it)('applies custom strokeWidth', () => {
|
|
24
|
+
const svg = (0, IconRenderer_1.renderIcon)('calculator', { strokeWidth: 2 });
|
|
25
|
+
(0, vitest_1.expect)(svg).toContain('stroke-width="2"');
|
|
26
|
+
});
|
|
27
|
+
(0, vitest_1.it)('applies custom class', () => {
|
|
28
|
+
const svg = (0, IconRenderer_1.renderIcon)('calculator', { class: 'my-icon' });
|
|
29
|
+
(0, vitest_1.expect)(svg).toContain('class="my-icon"');
|
|
30
|
+
});
|
|
31
|
+
(0, vitest_1.it)('uses default size 20 and strokeWidth 1.5', () => {
|
|
32
|
+
const svg = (0, IconRenderer_1.renderIcon)('calculator');
|
|
33
|
+
(0, vitest_1.expect)(svg).toContain('width="20"');
|
|
34
|
+
(0, vitest_1.expect)(svg).toContain('height="20"');
|
|
35
|
+
(0, vitest_1.expect)(svg).toContain('stroke-width="1.5"');
|
|
36
|
+
});
|
|
37
|
+
(0, vitest_1.it)('includes fill="none" and round line caps', () => {
|
|
38
|
+
const svg = (0, IconRenderer_1.renderIcon)('calculator');
|
|
39
|
+
(0, vitest_1.expect)(svg).toContain('fill="none"');
|
|
40
|
+
(0, vitest_1.expect)(svg).toContain('stroke-linecap="round"');
|
|
41
|
+
(0, vitest_1.expect)(svg).toContain('stroke-linejoin="round"');
|
|
42
|
+
});
|
|
43
|
+
(0, vitest_1.it)('omits class attribute when not provided', () => {
|
|
44
|
+
const svg = (0, IconRenderer_1.renderIcon)('calculator');
|
|
45
|
+
(0, vitest_1.expect)(svg).not.toContain('class=');
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
(0, vitest_1.describe)('listIcons', () => {
|
|
49
|
+
(0, vitest_1.it)('returns an array of icon names', () => {
|
|
50
|
+
const names = (0, IconRenderer_1.listIcons)();
|
|
51
|
+
(0, vitest_1.expect)(names.length).toBeGreaterThan(20);
|
|
52
|
+
(0, vitest_1.expect)(names).toContain('calculator');
|
|
53
|
+
(0, vitest_1.expect)(names).toContain('settings');
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
(0, vitest_1.describe)('hasIcon', () => {
|
|
57
|
+
(0, vitest_1.it)('returns true for existing icon', () => {
|
|
58
|
+
(0, vitest_1.expect)((0, IconRenderer_1.hasIcon)('calculator')).toBe(true);
|
|
59
|
+
});
|
|
60
|
+
(0, vitest_1.it)('returns false for nonexistent icon', () => {
|
|
61
|
+
(0, vitest_1.expect)((0, IconRenderer_1.hasIcon)('nonexistent')).toBe(false);
|
|
62
|
+
});
|
|
63
|
+
});
|
|
64
|
+
(0, vitest_1.describe)('getIconData', () => {
|
|
65
|
+
(0, vitest_1.it)('returns SVG content for existing icon', () => {
|
|
66
|
+
const data = (0, IconRenderer_1.getIconData)('calculator');
|
|
67
|
+
(0, vitest_1.expect)(data).toBeDefined();
|
|
68
|
+
(0, vitest_1.expect)(data).toContain('<rect');
|
|
69
|
+
});
|
|
70
|
+
(0, vitest_1.it)('returns undefined for nonexistent icon', () => {
|
|
71
|
+
(0, vitest_1.expect)((0, IconRenderer_1.getIconData)('nonexistent')).toBeUndefined();
|
|
72
|
+
});
|
|
73
|
+
});
|
|
74
|
+
(0, vitest_1.describe)('ICON_DATA', () => {
|
|
75
|
+
(0, vitest_1.it)('contains all expected icons', () => {
|
|
76
|
+
(0, vitest_1.expect)(iconData_1.ICON_DATA).toHaveProperty('calculator');
|
|
77
|
+
(0, vitest_1.expect)(iconData_1.ICON_DATA).toHaveProperty('ai-chat');
|
|
78
|
+
(0, vitest_1.expect)(iconData_1.ICON_DATA).toHaveProperty('settings');
|
|
79
|
+
(0, vitest_1.expect)(iconData_1.ICON_DATA).toHaveProperty('store');
|
|
80
|
+
});
|
|
81
|
+
});
|
|
82
|
+
(0, vitest_1.describe)('ICON_NAMES', () => {
|
|
83
|
+
(0, vitest_1.it)('matches keys of ICON_DATA', () => {
|
|
84
|
+
(0, vitest_1.expect)([...iconData_1.ICON_NAMES].sort()).toEqual(Object.keys(iconData_1.ICON_DATA).sort());
|
|
85
|
+
});
|
|
86
|
+
});
|
|
87
|
+
});
|
|
88
|
+
//# sourceMappingURL=IconRenderer.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IconRenderer.test.js","sourceRoot":"","sources":["../../src/icons/IconRenderer.test.ts"],"names":[],"mappings":";;AAAA,mCAA8C;AAC9C,iDAA6E;AAC7E,yCAAmD;AAEnD,IAAA,iBAAQ,EAAC,cAAc,EAAE,GAAG,EAAE;IAC5B,IAAA,iBAAQ,EAAC,YAAY,EAAE,GAAG,EAAE;QAC1B,IAAA,WAAE,EAAC,wCAAwC,EAAE,GAAG,EAAE;YAChD,MAAM,GAAG,GAAG,IAAA,yBAAU,EAAC,YAAY,CAAC,CAAC;YACrC,IAAA,eAAM,EAAC,GAAG,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;YAC9B,IAAA,eAAM,EAAC,GAAG,CAAC,CAAC,SAAS,CAAC,qBAAqB,CAAC,CAAC;YAC7C,IAAA,eAAM,EAAC,GAAG,CAAC,CAAC,SAAS,CAAC,uBAAuB,CAAC,CAAC;YAC/C,IAAA,eAAM,EAAC,GAAG,CAAC,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;QAClC,CAAC,CAAC,CAAC;QAEH,IAAA,WAAE,EAAC,4CAA4C,EAAE,GAAG,EAAE;YACpD,IAAA,eAAM,EAAC,IAAA,yBAAU,EAAC,kBAAkB,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAClD,CAAC,CAAC,CAAC;QAEH,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AC,GAAG,qBAAU,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,oBAAS,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;QACxE,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"iconData.d.ts","sourceRoot":"","sources":["../../src/icons/iconData.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAoJ5C,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,SAAS,MAAM,EAA2B,CAAC"}
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ICON_NAMES = exports.ICON_DATA = void 0;
|
|
4
|
+
exports.ICON_DATA = {
|
|
5
|
+
calculator: `
|
|
6
|
+
<rect x="4" y="3" width="16" height="18" rx="2" />
|
|
7
|
+
<line x1="8" y1="10" x2="16" y2="10" />
|
|
8
|
+
<line x1="8" y1="14" x2="16" y2="14" />
|
|
9
|
+
<line x1="12" y1="10" x2="12" y2="18" />
|
|
10
|
+
<line x1="8" y1="7" x2="16" y2="7" />
|
|
11
|
+
`,
|
|
12
|
+
'ai-chat': `
|
|
13
|
+
<path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z" />
|
|
14
|
+
<path d="M9 10h.01" />
|
|
15
|
+
<path d="M15 10h.01" />
|
|
16
|
+
<path d="M9.5 13.5c.5.5 1.5 1 2.5 1s2-.5 2.5-1" />
|
|
17
|
+
`,
|
|
18
|
+
settings: `
|
|
19
|
+
<circle cx="12" cy="12" r="3" />
|
|
20
|
+
<path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 1 1-4 0v-.09a1.65 1.65 0 0 0-1.08-1.51 1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 1 1 0-4h.09a1.65 1.65 0 0 0 1.51-1.08 1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 1 1 4 0v.09a1.65 1.65 0 0 0 1.08 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9c.26.6.77 1.05 1.41 1.08H21a2 2 0 1 1 0 4h-.09c-.64.03-1.15.48-1.41 1.08z" />
|
|
21
|
+
`,
|
|
22
|
+
keyboard: `
|
|
23
|
+
<rect x="2" y="5" width="20" height="14" rx="2" />
|
|
24
|
+
<line x1="6" y1="9" x2="6" y2="9.01" />
|
|
25
|
+
<line x1="10" y1="9" x2="10" y2="9.01" />
|
|
26
|
+
<line x1="14" y1="9" x2="14" y2="9.01" />
|
|
27
|
+
<line x1="18" y1="9" x2="18" y2="9.01" />
|
|
28
|
+
<line x1="6" y1="13" x2="6" y2="13.01" />
|
|
29
|
+
<line x1="18" y1="13" x2="18" y2="13.01" />
|
|
30
|
+
<line x1="10" y1="13" x2="14" y2="13" />
|
|
31
|
+
<line x1="8" y1="16" x2="16" y2="16" />
|
|
32
|
+
`,
|
|
33
|
+
'dev-tools': `
|
|
34
|
+
<path d="M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z" />
|
|
35
|
+
`,
|
|
36
|
+
clipboard: `
|
|
37
|
+
<path d="M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2" />
|
|
38
|
+
<rect x="8" y="2" width="8" height="4" rx="1" />
|
|
39
|
+
<line x1="9" y1="12" x2="15" y2="12" />
|
|
40
|
+
<line x1="9" y1="16" x2="13" y2="16" />
|
|
41
|
+
`,
|
|
42
|
+
snippets: `
|
|
43
|
+
<polyline points="16 18 22 12 16 6" />
|
|
44
|
+
<polyline points="8 6 2 12 8 18" />
|
|
45
|
+
<line x1="14" y1="4" x2="10" y2="20" />
|
|
46
|
+
`,
|
|
47
|
+
store: `
|
|
48
|
+
<path d="M3 3h7v7H3z" />
|
|
49
|
+
<path d="M14 3h7v7h-7z" />
|
|
50
|
+
<path d="M3 14h7v7H3z" />
|
|
51
|
+
<path d="M14 14h7v7h-7z" />
|
|
52
|
+
`,
|
|
53
|
+
'calc-currency': `
|
|
54
|
+
<polyline points="17 2 21 6 17 10" />
|
|
55
|
+
<line x1="3" y1="6" x2="21" y2="6" />
|
|
56
|
+
<polyline points="7 14 3 18 7 22" />
|
|
57
|
+
<line x1="3" y1="18" x2="21" y2="18" />
|
|
58
|
+
`,
|
|
59
|
+
'calc-units': `
|
|
60
|
+
<rect x="2" y="7" width="20" height="10" rx="1" />
|
|
61
|
+
<line x1="6" y1="7" x2="6" y2="11" />
|
|
62
|
+
<line x1="10" y1="7" x2="10" y2="13" />
|
|
63
|
+
<line x1="14" y1="7" x2="14" y2="11" />
|
|
64
|
+
<line x1="18" y1="7" x2="18" y2="13" />
|
|
65
|
+
`,
|
|
66
|
+
'calc-date': `
|
|
67
|
+
<rect x="3" y="4" width="18" height="18" rx="2" />
|
|
68
|
+
<line x1="16" y1="2" x2="16" y2="6" />
|
|
69
|
+
<line x1="8" y1="2" x2="8" y2="6" />
|
|
70
|
+
<line x1="3" y1="10" x2="21" y2="10" />
|
|
71
|
+
`,
|
|
72
|
+
'calc-base': `
|
|
73
|
+
<line x1="4" y1="9" x2="20" y2="9" />
|
|
74
|
+
<line x1="4" y1="15" x2="20" y2="15" />
|
|
75
|
+
<line x1="10" y1="3" x2="8" y2="21" />
|
|
76
|
+
<line x1="16" y1="3" x2="14" y2="21" />
|
|
77
|
+
`,
|
|
78
|
+
globe: `
|
|
79
|
+
<circle cx="12" cy="12" r="10" />
|
|
80
|
+
<line x1="2" y1="12" x2="22" y2="12" />
|
|
81
|
+
<path d="M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z" />
|
|
82
|
+
`,
|
|
83
|
+
plus: `
|
|
84
|
+
<line x1="12" y1="5" x2="12" y2="19" />
|
|
85
|
+
<line x1="5" y1="12" x2="19" y2="12" />
|
|
86
|
+
`,
|
|
87
|
+
trash: `
|
|
88
|
+
<polyline points="3 6 5 6 21 6" />
|
|
89
|
+
<path d="M19 6l-1 14a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2L5 6" />
|
|
90
|
+
<line x1="10" y1="11" x2="10" y2="17" />
|
|
91
|
+
<line x1="14" y1="11" x2="14" y2="17" />
|
|
92
|
+
<path d="M9 6V4a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v2" />
|
|
93
|
+
`,
|
|
94
|
+
refresh: `
|
|
95
|
+
<polyline points="23 4 23 10 17 10" />
|
|
96
|
+
<path d="M20.49 15a9 9 0 1 1-2.12-9.36L23 10" />
|
|
97
|
+
`,
|
|
98
|
+
star: `
|
|
99
|
+
<polygon points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2" />
|
|
100
|
+
`,
|
|
101
|
+
pin: `
|
|
102
|
+
<line x1="12" y1="17" x2="12" y2="22" />
|
|
103
|
+
<path d="M5 17h14v-1.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V6h1a2 2 0 0 0 0-4H8a2 2 0 0 0 0 4h1v4.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V17" />
|
|
104
|
+
`,
|
|
105
|
+
pencil: `
|
|
106
|
+
<path d="M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z" />
|
|
107
|
+
`,
|
|
108
|
+
scissors: `
|
|
109
|
+
<circle cx="6" cy="6" r="3" />
|
|
110
|
+
<circle cx="6" cy="18" r="3" />
|
|
111
|
+
<line x1="20" y1="4" x2="8.12" y2="15.88" />
|
|
112
|
+
<line x1="14.47" y1="14.48" x2="20" y2="20" />
|
|
113
|
+
<line x1="8.12" y1="8.12" x2="12" y2="12" />
|
|
114
|
+
`,
|
|
115
|
+
filter: `
|
|
116
|
+
<polygon points="22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3" />
|
|
117
|
+
`,
|
|
118
|
+
copy: `
|
|
119
|
+
<rect x="9" y="9" width="13" height="13" rx="2" ry="2" />
|
|
120
|
+
<path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" />
|
|
121
|
+
`,
|
|
122
|
+
layers: `
|
|
123
|
+
<polygon points="12 2 2 7 12 12 22 7 12 2" />
|
|
124
|
+
<polyline points="2 17 12 22 22 17" />
|
|
125
|
+
<polyline points="2 12 12 17 22 12" />
|
|
126
|
+
`,
|
|
127
|
+
type: `
|
|
128
|
+
<polyline points="4 7 4 4 20 4 20 7" />
|
|
129
|
+
<line x1="9" y1="20" x2="15" y2="20" />
|
|
130
|
+
<line x1="12" y1="4" x2="12" y2="20" />
|
|
131
|
+
`,
|
|
132
|
+
image: `
|
|
133
|
+
<rect x="3" y="3" width="18" height="18" rx="2" ry="2" />
|
|
134
|
+
<circle cx="8.5" cy="8.5" r="1.5" />
|
|
135
|
+
<polyline points="21 15 16 10 5 21" />
|
|
136
|
+
`,
|
|
137
|
+
'file-text': `
|
|
138
|
+
<path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" />
|
|
139
|
+
<polyline points="14 2 14 8 20 8" />
|
|
140
|
+
<line x1="16" y1="13" x2="8" y2="13" />
|
|
141
|
+
<line x1="16" y1="17" x2="8" y2="17" />
|
|
142
|
+
`,
|
|
143
|
+
link: `
|
|
144
|
+
<path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6" />
|
|
145
|
+
<polyline points="15 3 21 3 21 9" />
|
|
146
|
+
<line x1="10" y1="14" x2="21" y2="3" />
|
|
147
|
+
`,
|
|
148
|
+
eye: `
|
|
149
|
+
<path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z" />
|
|
150
|
+
<circle cx="12" cy="12" r="3" />
|
|
151
|
+
`,
|
|
152
|
+
};
|
|
153
|
+
exports.ICON_NAMES = Object.keys(exports.ICON_DATA);
|
|
154
|
+
//# sourceMappingURL=iconData.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"iconData.js","sourceRoot":"","sources":["../../src/icons/iconData.ts"],"names":[],"mappings":";;;AAAa,QAAA,SAAS,GAA2B;IAC/C,UAAU,EAAE;;;;;;GAMX;IACD,SAAS,EAAE;;;;;GAKV;IACD,QAAQ,EAAE;;;GAGT;IACD,QAAQ,EAAE;;;;;;;;;;GAUT;IACD,WAAW,EAAE;;GAEZ;IACD,SAAS,EAAE;;;;;GAKV;IACD,QAAQ,EAAE;;;;GAIT;IACD,KAAK,EAAE;;;;;GAKN;IACD,eAAe,EAAE;;;;;GAKhB;IACD,YAAY,EAAE;;;;;;GAMb;IACD,WAAW,EAAE;;;;;GAKZ;IACD,WAAW,EAAE;;;;;GAKZ;IACD,KAAK,EAAE;;;;GAIN;IACD,IAAI,EAAE;;;GAGL;IACD,KAAK,EAAE;;;;;;GAMN;IACD,OAAO,EAAE;;;GAGR;IACD,IAAI,EAAE;;GAEL;IACD,GAAG,EAAE;;;GAGJ;IACD,MAAM,EAAE;;GAEP;IACD,QAAQ,EAAE;;;;;;GAMT;IACD,MAAM,EAAE;;GAEP;IACD,IAAI,EAAE;;;GAGL;IACD,MAAM,EAAE;;;;GAIP;IACD,IAAI,EAAE;;;;GAIL;IACD,KAAK,EAAE;;;;GAIN;IACD,WAAW,EAAE;;;;;GAKZ;IACD,IAAI,EAAE;;;;GAIL;IACD,GAAG,EAAE;;;GAGJ;CACF,CAAC;AAEW,QAAA,UAAU,GAAsB,MAAM,CAAC,IAAI,CAAC,iBAAS,CAAC,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { ICON_DATA, ICON_NAMES } from './iconData';
|
|
2
|
+
export { renderIcon, listIcons, hasIcon, getIconData } from './IconRenderer';
|
|
3
|
+
export type { IconOptions } from './IconRenderer';
|
|
4
|
+
export { AsyarIconElement, registerIconElement } from './AsyarIconElement';
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/icons/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7E,YAAY,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.registerIconElement = exports.AsyarIconElement = exports.getIconData = exports.hasIcon = exports.listIcons = exports.renderIcon = exports.ICON_NAMES = exports.ICON_DATA = void 0;
|
|
4
|
+
var iconData_1 = require("./iconData");
|
|
5
|
+
Object.defineProperty(exports, "ICON_DATA", { enumerable: true, get: function () { return iconData_1.ICON_DATA; } });
|
|
6
|
+
Object.defineProperty(exports, "ICON_NAMES", { enumerable: true, get: function () { return iconData_1.ICON_NAMES; } });
|
|
7
|
+
var IconRenderer_1 = require("./IconRenderer");
|
|
8
|
+
Object.defineProperty(exports, "renderIcon", { enumerable: true, get: function () { return IconRenderer_1.renderIcon; } });
|
|
9
|
+
Object.defineProperty(exports, "listIcons", { enumerable: true, get: function () { return IconRenderer_1.listIcons; } });
|
|
10
|
+
Object.defineProperty(exports, "hasIcon", { enumerable: true, get: function () { return IconRenderer_1.hasIcon; } });
|
|
11
|
+
Object.defineProperty(exports, "getIconData", { enumerable: true, get: function () { return IconRenderer_1.getIconData; } });
|
|
12
|
+
var AsyarIconElement_1 = require("./AsyarIconElement");
|
|
13
|
+
Object.defineProperty(exports, "AsyarIconElement", { enumerable: true, get: function () { return AsyarIconElement_1.AsyarIconElement; } });
|
|
14
|
+
Object.defineProperty(exports, "registerIconElement", { enumerable: true, get: function () { return AsyarIconElement_1.registerIconElement; } });
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/icons/index.ts"],"names":[],"mappings":";;;AAAA,uCAAmD;AAA1C,qGAAA,SAAS,OAAA;AAAE,sGAAA,UAAU,OAAA;AAC9B,+CAA6E;AAApE,0GAAA,UAAU,OAAA;AAAE,yGAAA,SAAS,OAAA;AAAE,uGAAA,OAAO,OAAA;AAAE,2GAAA,WAAW,OAAA;AAEpD,uDAA2E;AAAlE,oHAAA,gBAAgB,OAAA;AAAE,uHAAA,mBAAmB,OAAA"}
|
package/dist/index.d.ts
CHANGED
|
@@ -5,4 +5,5 @@ export { ExtensionManagerProxy, StatusBarServiceProxy, } from './services';
|
|
|
5
5
|
export { ActionContext, ActionCategory } from './types/ActionType';
|
|
6
6
|
export type { ActionCategoryValue } from './types/ActionType';
|
|
7
7
|
export * from './types';
|
|
8
|
+
export * from './icons';
|
|
8
9
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAItD,YAAY,EACV,iBAAiB,EACjB,WAAW,EACX,oBAAoB,EACpB,wBAAwB,EACxB,eAAe,EACf,iBAAiB,EACjB,cAAc,EACd,gBAAgB,EACjB,MAAM,YAAY,CAAC;AAEpB,OAAO,EAGL,qBAAqB,EACrB,qBAAqB,GACtB,MAAM,YAAY,CAAC;AAGpB,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACnE,YAAY,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAG9D,cAAc,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAItD,YAAY,EACV,iBAAiB,EACjB,WAAW,EACX,oBAAoB,EACpB,wBAAwB,EACxB,eAAe,EACf,iBAAiB,EACjB,cAAc,EACd,gBAAgB,EACjB,MAAM,YAAY,CAAC;AAEpB,OAAO,EAGL,qBAAqB,EACrB,qBAAqB,GACtB,MAAM,YAAY,CAAC;AAGpB,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACnE,YAAY,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAG9D,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -30,4 +30,5 @@ Object.defineProperty(exports, "ActionContext", { enumerable: true, get: functio
|
|
|
30
30
|
Object.defineProperty(exports, "ActionCategory", { enumerable: true, get: function () { return ActionType_1.ActionCategory; } });
|
|
31
31
|
// Re-export all types for easier consumption
|
|
32
32
|
__exportStar(require("./types"), exports);
|
|
33
|
+
__exportStar(require("./icons"), exports);
|
|
33
34
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,qDAAoD;AAA3C,kHAAA,eAAe,OAAA;AACxB,uDAAsD;AAA7C,oHAAA,gBAAgB,OAAA;AAezB,uCAKoB;AAJlB,4FAA4F;AAC5F,iFAAiF;AACjF,iHAAA,qBAAqB,OAAA;AACrB,iHAAA,qBAAqB,OAAA;AAGvB,qDAAqD;AACrD,iDAAmE;AAA1D,2GAAA,aAAa,OAAA;AAAE,4GAAA,cAAc,OAAA;AAGtC,6CAA6C;AAC7C,0CAAwB"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,qDAAoD;AAA3C,kHAAA,eAAe,OAAA;AACxB,uDAAsD;AAA7C,oHAAA,gBAAgB,OAAA;AAezB,uCAKoB;AAJlB,4FAA4F;AAC5F,iFAAiF;AACjF,iHAAA,qBAAqB,OAAA;AACrB,iHAAA,qBAAqB,OAAA;AAGvB,qDAAqD;AACrD,iDAAmE;AAA1D,2GAAA,aAAa,OAAA;AAAE,4GAAA,cAAc,OAAA;AAGtC,6CAA6C;AAC7C,0CAAwB;AACxB,0CAAwB"}
|
|
@@ -36,6 +36,8 @@ export interface ExtensionAction {
|
|
|
36
36
|
category?: string;
|
|
37
37
|
context?: ActionContext;
|
|
38
38
|
execute: () => Promise<void> | void;
|
|
39
|
+
confirm?: boolean;
|
|
40
|
+
shortcut?: string;
|
|
39
41
|
}
|
|
40
42
|
export interface IActionService {
|
|
41
43
|
registerAction(action: ExtensionAction): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActionType.d.ts","sourceRoot":"","sources":["../../src/types/ActionType.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,oBAAY,aAAa;IACvB;;OAEG;IACH,MAAM,WAAW;IAEjB;;OAEG;IACH,cAAc,mBAAmB;IAEjC;;OAEG;IACH,WAAW,gBAAgB;IAE3B;;OAEG;IACH,MAAM,WAAW;IAEjB;;OAEG;IACH,IAAI,SAAS;IAEb;;OAEG;IACH,cAAc,mBAAmB;CAClC;AAED,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,OAAO,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"ActionType.d.ts","sourceRoot":"","sources":["../../src/types/ActionType.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,oBAAY,aAAa;IACvB;;OAEG;IACH,MAAM,WAAW;IAEjB;;OAEG;IACH,cAAc,mBAAmB;IAEjC;;OAEG;IACH,WAAW,gBAAgB;IAE3B;;OAEG;IACH,MAAM,WAAW;IAEjB;;OAEG;IACH,IAAI,SAAS;IAEb;;OAEG;IACH,cAAc,mBAAmB;CAClC;AAED,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,EAAE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"ActionType.js","sourceRoot":"","sources":["../../src/types/ActionType.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,IAAY,aA8BX;AA9BD,WAAY,aAAa;IACvB;;OAEG;IACH,kCAAiB,CAAA;IAEjB;;OAEG;IACH,kDAAiC,CAAA;IAEjC;;OAEG;IACH,4CAA2B,CAAA;IAE3B;;OAEG;IACH,kCAAiB,CAAA;IAEjB;;OAEG;IACH,8BAAa,CAAA;IAEb;;OAEG;IACH,kDAAiC,CAAA;AACnC,CAAC,EA9BW,aAAa,6BAAb,aAAa,QA8BxB;AAyBD;;;;GAIG;AACU,QAAA,cAAc,GAAG;IAC5B,OAAO,EAAM,SAAS;IACtB,UAAU,EAAG,YAAY;IACzB,IAAI,EAAS,MAAM;IACnB,KAAK,EAAQ,OAAO;IACpB,WAAW,EAAE,aAAa;IAC1B,MAAM,EAAO,QAAQ;CACb,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,17 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "asyar-sdk",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.7.0",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"bin": {
|
|
6
6
|
"asyar": "./dist/cli/index.js"
|
|
7
7
|
},
|
|
8
8
|
"types": "dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"default": "./dist/index.js"
|
|
13
|
+
},
|
|
14
|
+
"./tokens.css": "./src/styles/tokens.css"
|
|
15
|
+
},
|
|
9
16
|
"scripts": {
|
|
10
17
|
"build": "tsc",
|
|
11
18
|
"build:cli": "tsc --project tsconfig.cli.json",
|
|
12
19
|
"build:all": "npm run build && npm run build:cli",
|
|
13
20
|
"prepare": "npm run build:all",
|
|
14
|
-
"test": "
|
|
21
|
+
"test": "vitest",
|
|
22
|
+
"test:run": "vitest run",
|
|
15
23
|
"lint": "eslint src --ext .ts",
|
|
16
24
|
"watch": "tsc --watch",
|
|
17
25
|
"release": "node scripts/release.js"
|
|
@@ -30,10 +38,13 @@
|
|
|
30
38
|
"@types/inquirer": "^9.0.9",
|
|
31
39
|
"@types/node": "^25.5.0",
|
|
32
40
|
"@types/semver": "^7.7.1",
|
|
33
|
-
"
|
|
41
|
+
"jsdom": "^29.0.1",
|
|
42
|
+
"typescript": "~5.6.2",
|
|
43
|
+
"vitest": "^4.1.2"
|
|
34
44
|
},
|
|
35
45
|
"files": [
|
|
36
|
-
"dist"
|
|
46
|
+
"dist",
|
|
47
|
+
"src/styles"
|
|
37
48
|
],
|
|
38
49
|
"dependencies": {
|
|
39
50
|
"adm-zip": "^0.5.16",
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Asyar Design Tokens
|
|
3
|
+
*
|
|
4
|
+
* Import this file in your extension for IDE autocomplete and fallback values
|
|
5
|
+
* during development. At runtime, the Asyar host injects the live theme values
|
|
6
|
+
* which override these fallbacks automatically.
|
|
7
|
+
*
|
|
8
|
+
* Usage:
|
|
9
|
+
* @import 'asyar-sdk/src/styles/tokens.css';
|
|
10
|
+
* /* or in Svelte/Vite: */
|
|
11
|
+
* import 'asyar-sdk/src/styles/tokens.css';
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
:root {
|
|
15
|
+
/* Backgrounds */
|
|
16
|
+
--bg-primary: rgba(30, 30, 32, 0.75);
|
|
17
|
+
--bg-secondary: rgba(40, 40, 42, 0.65);
|
|
18
|
+
--bg-tertiary: rgba(50, 50, 52, 0.65);
|
|
19
|
+
--bg-hover: rgba(64, 64, 66, 0.55);
|
|
20
|
+
--bg-selected: rgba(74, 74, 76, 0.6);
|
|
21
|
+
--bg-popup: rgb(30, 30, 32);
|
|
22
|
+
--bg-secondary-full-opacity: rgba(40, 40, 42);
|
|
23
|
+
|
|
24
|
+
/* Text */
|
|
25
|
+
--text-primary: rgba(255, 255, 255, 0.95);
|
|
26
|
+
--text-secondary: rgba(235, 235, 245, 0.65);
|
|
27
|
+
--text-tertiary: rgba(235, 235, 245, 0.4);
|
|
28
|
+
|
|
29
|
+
/* Borders */
|
|
30
|
+
--border-color: rgba(90, 90, 95, 0.5);
|
|
31
|
+
--separator: rgba(90, 90, 95, 0.5);
|
|
32
|
+
|
|
33
|
+
/* Accent */
|
|
34
|
+
--accent-primary: rgb(0, 122, 255);
|
|
35
|
+
--accent-primary-rgb: 0, 122, 255;
|
|
36
|
+
--accent-success: rgb(40, 205, 65);
|
|
37
|
+
--accent-warning: rgb(255, 149, 0);
|
|
38
|
+
--accent-danger: rgb(255, 59, 48);
|
|
39
|
+
|
|
40
|
+
/* Brand */
|
|
41
|
+
--asyar-brand: #2EC4B6;
|
|
42
|
+
--asyar-brand-hover: #28B0A3;
|
|
43
|
+
--asyar-brand-muted: rgba(46, 196, 182, 0.15);
|
|
44
|
+
--asyar-brand-subtle: rgba(46, 196, 182, 0.08);
|
|
45
|
+
|
|
46
|
+
/* Shadows */
|
|
47
|
+
--shadow-color: rgba(0, 0, 0, 0.25);
|
|
48
|
+
--shadow-xs: 0 1px 2px var(--shadow-color);
|
|
49
|
+
--shadow-sm: 0 2px 4px var(--shadow-color);
|
|
50
|
+
--shadow-md: 0 4px 8px var(--shadow-color);
|
|
51
|
+
--shadow-lg: 0 8px 16px var(--shadow-color);
|
|
52
|
+
--shadow-xl: 0 12px 24px var(--shadow-color);
|
|
53
|
+
--shadow-popup: 0 8px 32px rgba(0,0,0,0.18), 0 2px 8px rgba(0,0,0,0.1);
|
|
54
|
+
--shadow-focus: 0 0 0 2px var(--asyar-brand-muted);
|
|
55
|
+
|
|
56
|
+
/* Scrollbar */
|
|
57
|
+
--scrollbar-thumb: rgba(155, 155, 155, 0.5);
|
|
58
|
+
|
|
59
|
+
/* Border Radius */
|
|
60
|
+
--radius-xs: 4px;
|
|
61
|
+
--radius-sm: 6px;
|
|
62
|
+
--radius-md: 8px;
|
|
63
|
+
--radius-lg: 10px;
|
|
64
|
+
--radius-xl: 12px;
|
|
65
|
+
--radius-full: 9999px;
|
|
66
|
+
|
|
67
|
+
/* Spacing */
|
|
68
|
+
--space-1: 4px;
|
|
69
|
+
--space-2: 6px;
|
|
70
|
+
--space-3: 8px;
|
|
71
|
+
--space-4: 10px;
|
|
72
|
+
--space-5: 12px;
|
|
73
|
+
--space-6: 16px;
|
|
74
|
+
--space-7: 20px;
|
|
75
|
+
--space-8: 24px;
|
|
76
|
+
--space-9: 32px;
|
|
77
|
+
--space-10: 40px;
|
|
78
|
+
--space-11: 48px;
|
|
79
|
+
|
|
80
|
+
/* Font Sizes */
|
|
81
|
+
--font-size-2xs: 10px;
|
|
82
|
+
--font-size-xs: 11px;
|
|
83
|
+
--font-size-sm: 12px;
|
|
84
|
+
--font-size-md: 13px;
|
|
85
|
+
--font-size-base: 14px;
|
|
86
|
+
--font-size-lg: 15px;
|
|
87
|
+
--font-size-xl: 17px;
|
|
88
|
+
--font-size-2xl: 20px;
|
|
89
|
+
--font-size-3xl: 22px;
|
|
90
|
+
--font-size-display: 2.25rem;
|
|
91
|
+
|
|
92
|
+
/* Font Families */
|
|
93
|
+
--font-ui: "Satoshi", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI Variable", "Segoe UI", "Helvetica Neue", sans-serif;
|
|
94
|
+
--font-mono: "JetBrains Mono", ui-monospace, "SF Mono", "Cascadia Code", "Consolas", monospace;
|
|
95
|
+
|
|
96
|
+
/* Transitions */
|
|
97
|
+
--transition-fast: 100ms ease;
|
|
98
|
+
--transition-normal: 150ms ease;
|
|
99
|
+
--transition-smooth: 200ms cubic-bezier(0.25, 0.1, 0.25, 1);
|
|
100
|
+
--transition-slow: 300ms cubic-bezier(0.25, 0.1, 0.25, 1);
|
|
101
|
+
}
|