@vite-plugin-opencode-assistant/components 1.0.93 → 1.1.1
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/es/index.d.ts +1 -1
- package/es/index.mjs +1 -1
- package/es/open-code-widget/composables/use-persist-state.mjs +4 -2
- package/lib/@vite-plugin-opencode-assistant/components.cjs.js +4 -3
- package/lib/@vite-plugin-opencode-assistant/components.es.js +5 -4
- package/lib/index.cjs +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/open-code-widget/composables/use-persist-state.cjs +4 -2
- package/lib/web-types.json +1 -1
- package/package.json +2 -2
package/es/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import OpenCodeWidget from './open-code-widget';
|
|
2
2
|
import type { App } from 'vue';
|
|
3
|
-
declare const version = "1.
|
|
3
|
+
declare const version = "1.1.1";
|
|
4
4
|
declare function install(app: App<any>, options?: any): void;
|
|
5
5
|
export { install, version, OpenCodeWidget };
|
|
6
6
|
export default install;
|
package/es/index.mjs
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { watch, onMounted } from "vue";
|
|
2
|
+
import { createLogger } from "@vite-plugin-opencode-assistant/shared";
|
|
3
|
+
const log = createLogger("OpenCodeWidget");
|
|
2
4
|
const STORAGE_KEY = "opencode-widget-state";
|
|
3
5
|
function loadState() {
|
|
4
6
|
if (typeof window === "undefined") return null;
|
|
@@ -8,7 +10,7 @@ function loadState() {
|
|
|
8
10
|
return JSON.parse(stored);
|
|
9
11
|
}
|
|
10
12
|
} catch (e) {
|
|
11
|
-
|
|
13
|
+
log.error("Failed to load persisted state:", { error: e });
|
|
12
14
|
}
|
|
13
15
|
return null;
|
|
14
16
|
}
|
|
@@ -17,7 +19,7 @@ function saveState(state) {
|
|
|
17
19
|
try {
|
|
18
20
|
localStorage.setItem(STORAGE_KEY, JSON.stringify(state));
|
|
19
21
|
} catch (e) {
|
|
20
|
-
|
|
22
|
+
log.error("Failed to save state:", { error: e });
|
|
21
23
|
}
|
|
22
24
|
}
|
|
23
25
|
function usePersistState(options) {
|
|
@@ -2309,6 +2309,7 @@ function useInspector(options) {
|
|
|
2309
2309
|
}
|
|
2310
2310
|
//#endregion
|
|
2311
2311
|
//#region es/open-code-widget/composables/use-persist-state.mjs
|
|
2312
|
+
var log = (0, _vite_plugin_opencode_assistant_shared.createLogger)("OpenCodeWidget");
|
|
2312
2313
|
var STORAGE_KEY = "opencode-widget-state";
|
|
2313
2314
|
function loadState() {
|
|
2314
2315
|
if (typeof window === "undefined") return null;
|
|
@@ -2316,7 +2317,7 @@ function loadState() {
|
|
|
2316
2317
|
const stored = localStorage.getItem(STORAGE_KEY);
|
|
2317
2318
|
if (stored) return JSON.parse(stored);
|
|
2318
2319
|
} catch (e) {
|
|
2319
|
-
|
|
2320
|
+
log.error("Failed to load persisted state:", { error: e });
|
|
2320
2321
|
}
|
|
2321
2322
|
return null;
|
|
2322
2323
|
}
|
|
@@ -2325,7 +2326,7 @@ function saveState(state) {
|
|
|
2325
2326
|
try {
|
|
2326
2327
|
localStorage.setItem(STORAGE_KEY, JSON.stringify(state));
|
|
2327
2328
|
} catch (e) {
|
|
2328
|
-
|
|
2329
|
+
log.error("Failed to save state:", { error: e });
|
|
2329
2330
|
}
|
|
2330
2331
|
}
|
|
2331
2332
|
function usePersistState(options) {
|
|
@@ -3339,7 +3340,7 @@ __vue_sfc__.render = __vue_render__;
|
|
|
3339
3340
|
var open_code_widget_default = __vue_sfc__;
|
|
3340
3341
|
//#endregion
|
|
3341
3342
|
//#region es/index.mjs
|
|
3342
|
-
var version = "1.
|
|
3343
|
+
var version = "1.1.1";
|
|
3343
3344
|
function install(app, options) {
|
|
3344
3345
|
[open_code_widget_default].forEach((item) => {
|
|
3345
3346
|
if (item.install) app.use(item, options);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Fragment, Teleport, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, createStaticVNode, createTextVNode, createVNode, defineComponent, inject, nextTick, normalizeClass, normalizeStyle, onMounted, onUnmounted, openBlock, provide, ref, renderList, renderSlot, toDisplayString, toRef, useCssVars, useSlots, vShow, watch, withCtx, withDirectives, withModifiers } from "vue";
|
|
2
|
-
import { WIDGET_MSG, truncate } from "@vite-plugin-opencode-assistant/shared";
|
|
2
|
+
import { WIDGET_MSG, createLogger, truncate } from "@vite-plugin-opencode-assistant/shared";
|
|
3
3
|
import getCssSelector from "css-selector-generator";
|
|
4
4
|
//#region es/open-code-widget/src/context.mjs
|
|
5
5
|
var CONTEXT_KEY = /* @__PURE__ */ Symbol("OpenCodeWidgetContext");
|
|
@@ -2282,6 +2282,7 @@ function useInspector(options) {
|
|
|
2282
2282
|
}
|
|
2283
2283
|
//#endregion
|
|
2284
2284
|
//#region es/open-code-widget/composables/use-persist-state.mjs
|
|
2285
|
+
var log = createLogger("OpenCodeWidget");
|
|
2285
2286
|
var STORAGE_KEY = "opencode-widget-state";
|
|
2286
2287
|
function loadState() {
|
|
2287
2288
|
if (typeof window === "undefined") return null;
|
|
@@ -2289,7 +2290,7 @@ function loadState() {
|
|
|
2289
2290
|
const stored = localStorage.getItem(STORAGE_KEY);
|
|
2290
2291
|
if (stored) return JSON.parse(stored);
|
|
2291
2292
|
} catch (e) {
|
|
2292
|
-
|
|
2293
|
+
log.error("Failed to load persisted state:", { error: e });
|
|
2293
2294
|
}
|
|
2294
2295
|
return null;
|
|
2295
2296
|
}
|
|
@@ -2298,7 +2299,7 @@ function saveState(state) {
|
|
|
2298
2299
|
try {
|
|
2299
2300
|
localStorage.setItem(STORAGE_KEY, JSON.stringify(state));
|
|
2300
2301
|
} catch (e) {
|
|
2301
|
-
|
|
2302
|
+
log.error("Failed to save state:", { error: e });
|
|
2302
2303
|
}
|
|
2303
2304
|
}
|
|
2304
2305
|
function usePersistState(options) {
|
|
@@ -3312,7 +3313,7 @@ __vue_sfc__.render = __vue_render__;
|
|
|
3312
3313
|
var open_code_widget_default = __vue_sfc__;
|
|
3313
3314
|
//#endregion
|
|
3314
3315
|
//#region es/index.mjs
|
|
3315
|
-
var version = "1.
|
|
3316
|
+
var version = "1.1.1";
|
|
3316
3317
|
function install(app, options) {
|
|
3317
3318
|
[open_code_widget_default].forEach((item) => {
|
|
3318
3319
|
if (item.install) app.use(item, options);
|
package/lib/index.cjs
CHANGED
|
@@ -34,7 +34,7 @@ __export(lib_exports, {
|
|
|
34
34
|
});
|
|
35
35
|
module.exports = __toCommonJS(lib_exports);
|
|
36
36
|
var import_open_code_widget = __toESM(require("./open-code-widget/index.cjs"));
|
|
37
|
-
const version = "1.
|
|
37
|
+
const version = "1.1.1";
|
|
38
38
|
function install(app, options) {
|
|
39
39
|
const components = [
|
|
40
40
|
import_open_code_widget.default
|
package/lib/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import OpenCodeWidget from './open-code-widget';
|
|
2
2
|
import type { App } from 'vue';
|
|
3
|
-
declare const version = "1.
|
|
3
|
+
declare const version = "1.1.1";
|
|
4
4
|
declare function install(app: App<any>, options?: any): void;
|
|
5
5
|
export { install, version, OpenCodeWidget };
|
|
6
6
|
export default install;
|
|
@@ -21,6 +21,8 @@ __export(use_persist_state_exports, {
|
|
|
21
21
|
});
|
|
22
22
|
module.exports = __toCommonJS(use_persist_state_exports);
|
|
23
23
|
var import_vue = require("vue");
|
|
24
|
+
var import_shared = require("@vite-plugin-opencode-assistant/shared");
|
|
25
|
+
const log = (0, import_shared.createLogger)("OpenCodeWidget");
|
|
24
26
|
const STORAGE_KEY = "opencode-widget-state";
|
|
25
27
|
function loadState() {
|
|
26
28
|
if (typeof window === "undefined") return null;
|
|
@@ -30,7 +32,7 @@ function loadState() {
|
|
|
30
32
|
return JSON.parse(stored);
|
|
31
33
|
}
|
|
32
34
|
} catch (e) {
|
|
33
|
-
|
|
35
|
+
log.error("Failed to load persisted state:", { error: e });
|
|
34
36
|
}
|
|
35
37
|
return null;
|
|
36
38
|
}
|
|
@@ -39,7 +41,7 @@ function saveState(state) {
|
|
|
39
41
|
try {
|
|
40
42
|
localStorage.setItem(STORAGE_KEY, JSON.stringify(state));
|
|
41
43
|
} catch (e) {
|
|
42
|
-
|
|
44
|
+
log.error("Failed to save state:", { error: e });
|
|
43
45
|
}
|
|
44
46
|
}
|
|
45
47
|
function usePersistState(options) {
|
package/lib/web-types.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"$schema":"https://raw.githubusercontent.com/JetBrains/web-types/master/schema/web-types.json","framework":"vue","name":"@vite-plugin-opencode-assistant/components","version":"1.
|
|
1
|
+
{"$schema":"https://raw.githubusercontent.com/JetBrains/web-types/master/schema/web-types.json","framework":"vue","name":"@vite-plugin-opencode-assistant/components","version":"1.1.1","contributions":{"html":{"tags":[{"name":"open-code","attributes":[{"name":"","default":"`'bottom-right'`","description":"挂件显示的位置","value":{"type":"`'bottom-right' | 'bottom-left' | 'top-right' | 'top-left'`","kind":"expression"}},{"name":"","default":"`false`","description":"挂件是否打开","value":{"type":"`boolean`","kind":"expression"}},{"name":"","default":"`'auto'`","description":"主题模式","value":{"type":"`'light' | 'dark' | 'auto'`","kind":"expression"}},{"name":"","default":"`'AI 助手'`","description":"助手头部显示的标题","value":{"type":"`string`","kind":"expression"}},{"name":"","default":"`'Ctrl+K'`","description":"快捷键提示文本","value":{"type":"`string`","kind":"expression"}},{"name":"","default":"`'按 ESC 或 Ctrl+P 退出'`","description":"选择模式快捷键提示文本","value":{"type":"`string`","kind":"expression"}},{"name":"","default":"`false`","description":"是否进入选择页面元素模式","value":{"type":"`boolean`","kind":"expression"}},{"name":"","default":"`true`","description":"会话列表是否折叠","value":{"type":"`boolean`","kind":"expression"}},{"name":"","default":"`'id'`","description":"会话列表项的唯一键字段","value":{"type":"`string`","kind":"expression"}},{"name":"","default":"`false`","description":"iframe 是否显示加载状态","value":{"type":"`boolean`","kind":"expression"}},{"name":"","default":"`undefined`","description":"会话列表是否加载中","value":{"type":"`boolean`","kind":"expression"}},{"name":"","default":"`false`","description":"是否显示会话列表骨架屏","value":{"type":"`boolean`","kind":"expression"}},{"name":"","default":"`false`","description":"是否显示空状态","value":{"type":"`boolean`","kind":"expression"}},{"name":"","default":"`false`","description":"是否显示错误状态","value":{"type":"`boolean`","kind":"expression"}},{"name":"","default":"`'当前项目暂无会话'`","description":"空状态显示的文本","value":{"type":"`string`","kind":"expression"}},{"name":"","default":"`'立即创建'`","description":"空状态操作按钮文本","value":{"type":"`string`","kind":"expression"}},{"name":"","default":"`''`","description":"Web UI 的 URL 来源","value":{"type":"`string`","kind":"expression"}},{"name":"","default":"`[]`","description":"会话列表数据","value":{"type":"`OpenCodeWidgetSession[]`","kind":"expression"}},{"name":"","default":"`null`","description":"当前选中的会话 ID","value":{"type":"`string | null`","kind":"expression"}},{"name":"","default":"`[]`","description":"已选中的元素列表","value":{"type":"`OpenCodeSelectedElement[]`","kind":"expression"}},{"name":"","default":"`true`","description":"是否显示\"一键清空\"按钮","value":{"type":"`boolean`","kind":"expression"}},{"name":"","default":"`true`","description":"是否启用选择模式","value":{"type":"`boolean`","kind":"expression"}},{"name":"","default":"`false`","description":"是否显示思考状态(加载中)","value":{"type":"`boolean`","kind":"expression"}}],"events":[{"name":"`update:open`","description":"当挂件打开或关闭时触发","arguments":[{"name":"open","type":"en"},{"name":"boolean"}]},{"name":"`update:selectMode`","description":"当选择模式切换时触发","arguments":[{"name":"mode","type":"de"},{"name":"boolean"}]},{"name":"`update:sessionListCollapsed`","description":"当会话列表折叠状态改变时触发","arguments":[{"name":"collapsed","type":"ed"},{"name":"boolean"}]},{"name":"`update:currentSessionId`","description":"当选中的会话 ID 改变时触发","arguments":[{"name":"sessionId","type":"Id"},{"name":"string | null"}]},{"name":"`update:selectedElements`","description":"当已选中的元素列表改变时触发","arguments":[{"name":"elements","type":"ts"},{"name":"OpenCodeSelectedElement[]"}]},{"name":"`update:theme`","description":"当主题模式改变时触发","arguments":[{"name":"theme","type":"me"},{"name":"'light' | 'dark' | 'auto'"}]},{"name":"`update:thinking`","description":"当思考状态改变时触发","arguments":[{"name":"thinking","type":"ng"},{"name":"boolean"}]},{"name":"","description":"点击触发挂件开关","arguments":[{"name":"open","type":"en"},{"name":"boolean"}]},{"name":"","description":"点击关闭按钮时触发","arguments":[]},{"name":"`toggle-session-list`","description":"点击会话列表切换按钮时触发","arguments":[{"name":"collapsed","type":"ed"},{"name":"boolean"}]},{"name":"`toggle-select-mode`","description":"点击选择模式切换按钮时触发","arguments":[{"name":"mode","type":"de"},{"name":"boolean"}]},{"name":"`toggle-theme`","description":"点击主题切换按钮时触发","arguments":[{"name":"theme","type":"me"},{"name":"'light' | 'dark' | 'auto'"}]},{"name":"`create-session`","description":"点击创建新会话时触发","arguments":[]},{"name":"`select-session`","description":"选中某个历史会话时触发","arguments":[{"name":"session","type":"on"},{"name":"OpenCodeWidgetSession"}]},{"name":"`delete-session`","description":"删除某个历史会话时触发","arguments":[{"name":"session","type":"on"},{"name":"OpenCodeWidgetSession"}]},{"name":"`click-selected-node`","description":"点击已选中的气泡或节点卡片时触发","arguments":[{"name":"element","type":"nt"},{"name":"OpenCodeSelectedElement"}]},{"name":"`remove-selected-node`","description":"删除已选中的元素时触发","arguments":[{"name":"payload","type":"ad"},{"name":"OpenCodeRemoveSelectedPayload"}]},{"name":"`clear-selected-nodes`","description":"清空所有选中元素时触发","arguments":[]},{"name":"`empty-action`","description":"点击空状态操作按钮时触发","arguments":[]},{"name":"`frame-loaded`","description":"iframe 加载完成时触发","arguments":[]},{"name":"`thinking-change`","description":"思考状态改变时触发(用于显示加载动画)","arguments":[{"name":"thinking","type":"ng"},{"name":"boolean"}]}],"slots":[{"name":"`button-icon`","description":"自定义触发按钮图标"},{"name":"`session-toggle-icon`","description":"自定义会话列表切换图标"},{"name":"`select-icon`","description":"自定义选择模式切换图标"},{"name":"`close-icon`","description":"自定义关闭按钮图标"},{"name":"`theme-icon`","description":"自定义主题切换图标"},{"name":"`sessions-empty`","description":"自定义会话列表空状态"},{"name":"`empty-state`","description":"自定义 iframe 空状态"},{"name":"","description":"自定义 iframe 加载状态"},{"name":"","description":"自定义错误状态"},{"name":"","description":"自定义 iframe 内容"}]}],"attributes":[]}},"js-types-syntax":"typescript"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vite-plugin-opencode-assistant/components",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "Reusable OpenCode widget components built with Pagoda CLI",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.cjs",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"css-selector-generator": "^3.9.2",
|
|
34
|
-
"@vite-plugin-opencode-assistant/shared": "1.
|
|
34
|
+
"@vite-plugin-opencode-assistant/shared": "1.1.1"
|
|
35
35
|
},
|
|
36
36
|
"scripts": {
|
|
37
37
|
"build": "pagoda-cli build",
|