@vite-plugin-opencode-assistant/components 1.0.11 → 1.0.12
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.js +1 -1
- package/es/open-code-widget/composables/use-widget.d.ts +4 -0
- package/es/open-code-widget/composables/use-widget.js +40 -3
- package/es/open-code-widget/src/components/Frame.vue.js +52 -2
- package/es/open-code-widget/src/components/Header-sfc.css +1 -1
- package/es/open-code-widget/src/components/Header.vue.d.ts +4 -2
- package/es/open-code-widget/src/components/Header.vue.js +87 -13
- package/es/open-code-widget/src/components/SelectHint-sfc.css +1 -1
- package/es/open-code-widget/src/components/SessionList-sfc.css +1 -1
- package/es/open-code-widget/src/context.d.ts +2 -0
- package/es/open-code-widget/src/index-sfc.css +1 -1
- package/es/open-code-widget/src/index.vue.d.ts +5 -1
- package/es/open-code-widget/src/index.vue.js +12 -4
- package/es/open-code-widget/src/types.d.ts +2 -0
- package/lib/@vite-plugin-opencode-assistant/components.cjs.js +207 -53
- package/lib/@vite-plugin-opencode-assistant/components.es.js +208 -54
- package/lib/components.css +4 -4
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/open-code-widget/composables/use-widget.d.ts +4 -0
- package/lib/open-code-widget/composables/use-widget.js +39 -2
- package/lib/open-code-widget/src/components/Frame.vue.js +69 -21
- package/lib/open-code-widget/src/components/Header-sfc.css +1 -1
- package/lib/open-code-widget/src/components/Header.vue.d.ts +4 -2
- package/lib/open-code-widget/src/components/Header.vue.js +102 -28
- package/lib/open-code-widget/src/components/SelectHint-sfc.css +1 -1
- package/lib/open-code-widget/src/components/SessionList-sfc.css +1 -1
- package/lib/open-code-widget/src/context.d.ts +2 -0
- package/lib/open-code-widget/src/index-sfc.css +1 -1
- package/lib/open-code-widget/src/index.vue.d.ts +5 -1
- package/lib/open-code-widget/src/index.vue.js +12 -4
- package/lib/open-code-widget/src/types.d.ts +2 -0
- package/lib/web-types.json +1 -1
- package/package.json +1 -1
|
@@ -15,18 +15,68 @@ function useOpenCodeWidgetContext() {
|
|
|
15
15
|
}
|
|
16
16
|
//#endregion
|
|
17
17
|
//#region es/open-code-widget/src/components/Frame.vue.js
|
|
18
|
+
var __defProp$1 = Object.defineProperty;
|
|
19
|
+
var __getOwnPropSymbols$1 = Object.getOwnPropertySymbols;
|
|
20
|
+
var __hasOwnProp$1 = Object.prototype.hasOwnProperty;
|
|
21
|
+
var __propIsEnum$1 = Object.prototype.propertyIsEnumerable;
|
|
22
|
+
var __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$1(obj, key, {
|
|
23
|
+
enumerable: true,
|
|
24
|
+
configurable: true,
|
|
25
|
+
writable: true,
|
|
26
|
+
value
|
|
27
|
+
}) : obj[key] = value;
|
|
28
|
+
var __spreadValues$1 = (a, b) => {
|
|
29
|
+
for (var prop in b || (b = {})) if (__hasOwnProp$1.call(b, prop)) __defNormalProp$1(a, prop, b[prop]);
|
|
30
|
+
if (__getOwnPropSymbols$1) {
|
|
31
|
+
for (var prop of __getOwnPropSymbols$1(b)) if (__propIsEnum$1.call(b, prop)) __defNormalProp$1(a, prop, b[prop]);
|
|
32
|
+
}
|
|
33
|
+
return a;
|
|
34
|
+
};
|
|
18
35
|
var __vue_sfc__$7 = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
19
36
|
__name: "Frame",
|
|
20
37
|
setup(__props, { expose: __expose }) {
|
|
21
38
|
__expose();
|
|
22
|
-
const
|
|
39
|
+
const iframeRef = (0, vue.ref)(null);
|
|
40
|
+
const { loading, showEmptyState, iframeSource: iframeSrc, emptyStateText, emptyStateActionText, handleEmptyAction, theme, resolvedTheme } = useOpenCodeWidgetContext();
|
|
41
|
+
const iframeReady = (0, vue.ref)(false);
|
|
42
|
+
function sendMessageToIframe(type, data) {
|
|
43
|
+
var _a;
|
|
44
|
+
if (!((_a = iframeRef.value) == null ? void 0 : _a.contentWindow)) return;
|
|
45
|
+
iframeRef.value.contentWindow.postMessage(__spreadValues$1({ type }, data), "*");
|
|
46
|
+
}
|
|
47
|
+
function syncIframeTheme() {
|
|
48
|
+
sendMessageToIframe("OPENCODE_SET_THEME", { theme: resolvedTheme.value });
|
|
49
|
+
}
|
|
50
|
+
function handleIframeMessage(event) {
|
|
51
|
+
var _a;
|
|
52
|
+
if (((_a = event.data) == null ? void 0 : _a.type) === "OPENCODE_READY") syncIframeTheme();
|
|
53
|
+
}
|
|
54
|
+
(0, vue.watch)([theme, resolvedTheme], () => {
|
|
55
|
+
syncIframeTheme();
|
|
56
|
+
});
|
|
57
|
+
(0, vue.onMounted)(() => {
|
|
58
|
+
if (iframeRef.value) iframeRef.value.addEventListener("load", () => {
|
|
59
|
+
iframeReady.value = true;
|
|
60
|
+
});
|
|
61
|
+
window.addEventListener("message", handleIframeMessage);
|
|
62
|
+
});
|
|
63
|
+
(0, vue.onUnmounted)(() => {
|
|
64
|
+
window.removeEventListener("message", handleIframeMessage);
|
|
65
|
+
});
|
|
23
66
|
const __returned__ = {
|
|
67
|
+
iframeRef,
|
|
24
68
|
loading,
|
|
25
69
|
showEmptyState,
|
|
26
70
|
iframeSrc,
|
|
27
71
|
emptyStateText,
|
|
28
72
|
emptyStateActionText,
|
|
29
|
-
handleEmptyAction
|
|
73
|
+
handleEmptyAction,
|
|
74
|
+
theme,
|
|
75
|
+
resolvedTheme,
|
|
76
|
+
iframeReady,
|
|
77
|
+
sendMessageToIframe,
|
|
78
|
+
syncIframeTheme,
|
|
79
|
+
handleIframeMessage
|
|
30
80
|
};
|
|
31
81
|
Object.defineProperty(__returned__, "__isScriptSetup", {
|
|
32
82
|
enumerable: false,
|
|
@@ -63,6 +113,7 @@ function __vue_render__$7(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
63
113
|
])], 2),
|
|
64
114
|
(0, vue.createElementVNode)("div", { class: (0, vue.normalizeClass)(["opencode-loading-overlay", { visible: $setup.loading }]) }, [(0, vue.renderSlot)(_ctx.$slots, "loading", {}, () => [_cache[2] || (_cache[2] = (0, vue.createElementVNode)("div", { class: "opencode-loading-spinner" }, null, -1)), _cache[3] || (_cache[3] = (0, vue.createElementVNode)("div", { class: "opencode-loading-text" }, "加载中...", -1))])], 2),
|
|
65
115
|
(0, vue.renderSlot)(_ctx.$slots, "content", {}, () => [(0, vue.createElementVNode)("iframe", {
|
|
116
|
+
ref: "iframeRef",
|
|
66
117
|
class: "opencode-iframe",
|
|
67
118
|
src: $setup.iframeSrc,
|
|
68
119
|
allow: "clipboard-write; clipboard-read",
|
|
@@ -78,16 +129,33 @@ var __vue_sfc__$6 = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
78
129
|
__name: "Header",
|
|
79
130
|
setup(__props, { expose: __expose }) {
|
|
80
131
|
__expose();
|
|
81
|
-
const { title, sessionListTitle, sessionListCollapsed, selectMode, selectEnabled, handleToggleSessionList, handleToggleSelectMode, handleClose } = useOpenCodeWidgetContext();
|
|
132
|
+
const { title, sessionListTitle, sessionListCollapsed, selectMode, selectEnabled, theme, resolvedTheme, handleToggleSessionList, handleToggleSelectMode, handleToggleTheme, handleClose } = useOpenCodeWidgetContext();
|
|
82
133
|
const __returned__ = {
|
|
83
134
|
title,
|
|
84
135
|
sessionListTitle,
|
|
85
136
|
sessionListCollapsed,
|
|
86
137
|
selectMode,
|
|
87
138
|
selectEnabled,
|
|
139
|
+
theme,
|
|
140
|
+
resolvedTheme,
|
|
88
141
|
handleToggleSessionList,
|
|
89
142
|
handleToggleSelectMode,
|
|
90
|
-
|
|
143
|
+
handleToggleTheme,
|
|
144
|
+
handleClose,
|
|
145
|
+
themeIconTitle: (0, vue.computed)(() => {
|
|
146
|
+
return `\u4E3B\u9898: ${{
|
|
147
|
+
auto: "自动",
|
|
148
|
+
light: "亮色",
|
|
149
|
+
dark: "暗色"
|
|
150
|
+
}[theme.value]} (${resolvedTheme.value})`;
|
|
151
|
+
}),
|
|
152
|
+
themeIconLabel: (0, vue.computed)(() => {
|
|
153
|
+
return `\u5207\u6362\u4E3B\u9898 - \u5F53\u524D: ${{
|
|
154
|
+
auto: "自动跟随系统",
|
|
155
|
+
light: "亮色主题",
|
|
156
|
+
dark: "暗色主题"
|
|
157
|
+
}[theme.value]}`;
|
|
158
|
+
})
|
|
91
159
|
};
|
|
92
160
|
Object.defineProperty(__returned__, "__isScriptSetup", {
|
|
93
161
|
enumerable: false,
|
|
@@ -104,56 +172,97 @@ var _hoisted_3$4 = [
|
|
|
104
172
|
"aria-expanded"
|
|
105
173
|
];
|
|
106
174
|
var _hoisted_4$4 = ["aria-pressed", "disabled"];
|
|
107
|
-
var _hoisted_5$4 =
|
|
108
|
-
var _hoisted_6$3 = {
|
|
175
|
+
var _hoisted_5$4 = ["title", "aria-label"];
|
|
176
|
+
var _hoisted_6$3 = {
|
|
177
|
+
key: 0,
|
|
178
|
+
viewBox: "0 0 24 24",
|
|
179
|
+
width: "16",
|
|
180
|
+
height: "16",
|
|
181
|
+
fill: "none",
|
|
182
|
+
stroke: "currentColor",
|
|
183
|
+
"stroke-width": "2",
|
|
184
|
+
"aria-hidden": "true"
|
|
185
|
+
};
|
|
186
|
+
var _hoisted_7$2 = {
|
|
187
|
+
key: 1,
|
|
188
|
+
viewBox: "0 0 24 24",
|
|
189
|
+
width: "16",
|
|
190
|
+
height: "16",
|
|
191
|
+
fill: "none",
|
|
192
|
+
stroke: "currentColor",
|
|
193
|
+
"stroke-width": "2",
|
|
194
|
+
"aria-hidden": "true"
|
|
195
|
+
};
|
|
196
|
+
var _hoisted_8$2 = {
|
|
197
|
+
key: 2,
|
|
198
|
+
viewBox: "0 0 24 24",
|
|
199
|
+
width: "16",
|
|
200
|
+
height: "16",
|
|
201
|
+
fill: "none",
|
|
202
|
+
stroke: "currentColor",
|
|
203
|
+
"stroke-width": "2",
|
|
204
|
+
"aria-hidden": "true"
|
|
205
|
+
};
|
|
206
|
+
var _hoisted_9$1 = { class: "opencode-chat-header-title" };
|
|
207
|
+
var _hoisted_10 = { class: "opencode-chat-header-actions" };
|
|
109
208
|
function __vue_render__$6(_ctx, _cache, $props, $setup, $data, $options) {
|
|
110
209
|
return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_1$6, [
|
|
111
|
-
(0, vue.createElementVNode)("div", _hoisted_2$4, [
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
210
|
+
(0, vue.createElementVNode)("div", _hoisted_2$4, [
|
|
211
|
+
(0, vue.createElementVNode)("button", {
|
|
212
|
+
class: (0, vue.normalizeClass)(["opencode-header-btn session-toggle", { active: !$setup.sessionListCollapsed }]),
|
|
213
|
+
type: "button",
|
|
214
|
+
title: $setup.sessionListTitle,
|
|
215
|
+
"aria-label": $setup.sessionListTitle,
|
|
216
|
+
"aria-expanded": !$setup.sessionListCollapsed,
|
|
217
|
+
onClick: _cache[0] || (_cache[0] = (...args) => $setup.handleToggleSessionList && $setup.handleToggleSessionList(...args))
|
|
218
|
+
}, [(0, vue.renderSlot)(_ctx.$slots, "session-toggle-icon", {}, () => [_cache[4] || (_cache[4] = (0, vue.createElementVNode)("svg", {
|
|
219
|
+
viewBox: "0 0 24 24",
|
|
220
|
+
width: "16",
|
|
221
|
+
height: "16",
|
|
222
|
+
fill: "none",
|
|
223
|
+
stroke: "currentColor",
|
|
224
|
+
"stroke-width": "2",
|
|
225
|
+
"aria-hidden": "true"
|
|
226
|
+
}, [(0, vue.createElementVNode)("path", {
|
|
227
|
+
d: "M4 6h16M4 12h16M4 18h16",
|
|
228
|
+
"stroke-linecap": "round"
|
|
229
|
+
})], -1))])], 10, _hoisted_3$4),
|
|
230
|
+
(0, vue.createElementVNode)("button", {
|
|
231
|
+
class: (0, vue.normalizeClass)(["opencode-header-btn select-btn", { active: $setup.selectMode }]),
|
|
232
|
+
type: "button",
|
|
233
|
+
title: "选择页面元素 (Ctrl+P)",
|
|
234
|
+
"aria-label": "选择页面元素",
|
|
235
|
+
"aria-pressed": $setup.selectMode,
|
|
236
|
+
disabled: !$setup.selectEnabled,
|
|
237
|
+
onClick: _cache[1] || (_cache[1] = (...args) => $setup.handleToggleSelectMode && $setup.handleToggleSelectMode(...args))
|
|
238
|
+
}, [(0, vue.renderSlot)(_ctx.$slots, "select-icon", {}, () => [_cache[5] || (_cache[5] = (0, vue.createElementVNode)("svg", {
|
|
239
|
+
viewBox: "0 0 1024 1024",
|
|
240
|
+
width: "16",
|
|
241
|
+
height: "16",
|
|
242
|
+
"aria-hidden": "true"
|
|
243
|
+
}, [(0, vue.createElementVNode)("path", {
|
|
244
|
+
fill: "currentColor",
|
|
245
|
+
d: "M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896"
|
|
246
|
+
}), (0, vue.createElementVNode)("path", {
|
|
247
|
+
fill: "currentColor",
|
|
248
|
+
d: "M512 96a32 32 0 0 1 32 32v192a32 32 0 0 1-64 0V128a32 32 0 0 1 32-32m0 576a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V704a32 32 0 0 1 32-32M96 512a32 32 0 0 1 32-32h192a32 32 0 0 1 0 64H128a32 32 0 0 1-32-32m576 0a32 32 0 0 1 32-32h192a32 32 0 1 1 0 64H704a32 32 0 0 1-32-32"
|
|
249
|
+
})], -1))])], 10, _hoisted_4$4),
|
|
250
|
+
(0, vue.createElementVNode)("button", {
|
|
251
|
+
class: "opencode-header-btn theme-btn",
|
|
252
|
+
type: "button",
|
|
253
|
+
title: $setup.themeIconTitle,
|
|
254
|
+
"aria-label": $setup.themeIconLabel,
|
|
255
|
+
onClick: _cache[2] || (_cache[2] = (...args) => $setup.handleToggleTheme && $setup.handleToggleTheme(...args))
|
|
256
|
+
}, [(0, vue.renderSlot)(_ctx.$slots, "theme-icon", {}, () => [$setup.theme === "light" ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("svg", _hoisted_6$3, [..._cache[6] || (_cache[6] = [(0, vue.createStaticVNode)("<circle cx=\"12\" cy=\"12\" r=\"5\"></circle><line x1=\"12\" y1=\"1\" x2=\"12\" y2=\"3\"></line><line x1=\"12\" y1=\"21\" x2=\"12\" y2=\"23\"></line><line x1=\"4.22\" y1=\"4.22\" x2=\"5.64\" y2=\"5.64\"></line><line x1=\"18.36\" y1=\"18.36\" x2=\"19.78\" y2=\"19.78\"></line><line x1=\"1\" y1=\"12\" x2=\"3\" y2=\"12\"></line><line x1=\"21\" y1=\"12\" x2=\"23\" y2=\"12\"></line><line x1=\"4.22\" y1=\"19.78\" x2=\"5.64\" y2=\"18.36\"></line><line x1=\"18.36\" y1=\"5.64\" x2=\"19.78\" y2=\"4.22\"></line>", 9)])])) : $setup.theme === "dark" ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("svg", _hoisted_7$2, [..._cache[7] || (_cache[7] = [(0, vue.createElementVNode)("path", { d: "M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z" }, null, -1)])])) : ((0, vue.openBlock)(), (0, vue.createElementBlock)("svg", _hoisted_8$2, [..._cache[8] || (_cache[8] = [(0, vue.createStaticVNode)("<rect x=\"2\" y=\"3\" width=\"20\" height=\"14\" rx=\"2\" ry=\"2\"></rect><line x1=\"8\" y1=\"21\" x2=\"16\" y2=\"21\"></line><line x1=\"12\" y1=\"17\" x2=\"12\" y2=\"21\"></line><circle cx=\"12\" cy=\"10\" r=\"3\"></circle><path d=\"M7 7l2 2M17 7l-2 2M7 13l2-2M17 13l-2-2\"></path>", 5)])]))])], 8, _hoisted_5$4)
|
|
257
|
+
]),
|
|
258
|
+
(0, vue.createElementVNode)("span", _hoisted_9$1, (0, vue.toDisplayString)($setup.title), 1),
|
|
259
|
+
(0, vue.createElementVNode)("div", _hoisted_10, [(0, vue.createElementVNode)("button", {
|
|
151
260
|
class: "opencode-header-btn close",
|
|
152
261
|
type: "button",
|
|
153
262
|
title: "关闭",
|
|
154
263
|
"aria-label": "关闭面板",
|
|
155
|
-
onClick: _cache[
|
|
156
|
-
}, [(0, vue.renderSlot)(_ctx.$slots, "close-icon", {}, () => [_cache[
|
|
264
|
+
onClick: _cache[3] || (_cache[3] = (...args) => $setup.handleClose && $setup.handleClose(...args))
|
|
265
|
+
}, [(0, vue.renderSlot)(_ctx.$slots, "close-icon", {}, () => [_cache[9] || (_cache[9] = (0, vue.createElementVNode)("svg", {
|
|
157
266
|
viewBox: "0 0 24 24",
|
|
158
267
|
width: "14",
|
|
159
268
|
height: "14",
|
|
@@ -654,11 +763,39 @@ function useSession(options) {
|
|
|
654
763
|
}
|
|
655
764
|
//#endregion
|
|
656
765
|
//#region es/open-code-widget/composables/use-widget.js
|
|
766
|
+
var THEME_CYCLE = [
|
|
767
|
+
"auto",
|
|
768
|
+
"light",
|
|
769
|
+
"dark"
|
|
770
|
+
];
|
|
657
771
|
function useWidget(options) {
|
|
772
|
+
const systemTheme = (0, vue.ref)("light");
|
|
773
|
+
function getSystemTheme() {
|
|
774
|
+
if (typeof window === "undefined") return "light";
|
|
775
|
+
return window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
|
776
|
+
}
|
|
777
|
+
let mediaQuery = null;
|
|
778
|
+
let handleChange = null;
|
|
779
|
+
(0, vue.onMounted)(() => {
|
|
780
|
+
if (typeof window === "undefined") return;
|
|
781
|
+
systemTheme.value = getSystemTheme();
|
|
782
|
+
mediaQuery = window.matchMedia("(prefers-color-scheme: dark)");
|
|
783
|
+
handleChange = (e) => {
|
|
784
|
+
systemTheme.value = e.matches ? "dark" : "light";
|
|
785
|
+
};
|
|
786
|
+
mediaQuery.addEventListener("change", handleChange);
|
|
787
|
+
});
|
|
788
|
+
(0, vue.onUnmounted)(() => {
|
|
789
|
+
if (mediaQuery && handleChange) mediaQuery.removeEventListener("change", handleChange);
|
|
790
|
+
});
|
|
791
|
+
const resolvedTheme = (0, vue.computed)(() => {
|
|
792
|
+
if (options.theme.value === "auto") return systemTheme.value;
|
|
793
|
+
return options.theme.value;
|
|
794
|
+
});
|
|
658
795
|
const containerClasses = (0, vue.computed)(() => [
|
|
659
796
|
"opencode-widget",
|
|
660
797
|
options.position.value,
|
|
661
|
-
`opencode-theme-${
|
|
798
|
+
`opencode-theme-${resolvedTheme.value}`
|
|
662
799
|
]);
|
|
663
800
|
const buttonActive = (0, vue.computed)(() => !!(options.open.value || options.selectMode.value));
|
|
664
801
|
const iframeSource = (0, vue.computed)(() => options.iframeSrc.value || "about:blank");
|
|
@@ -681,15 +818,22 @@ function useWidget(options) {
|
|
|
681
818
|
function handleEmptyAction() {
|
|
682
819
|
options.onEmptyAction();
|
|
683
820
|
}
|
|
821
|
+
function handleToggleTheme() {
|
|
822
|
+
var _a;
|
|
823
|
+
const nextTheme = THEME_CYCLE[(THEME_CYCLE.indexOf(options.theme.value) + 1) % THEME_CYCLE.length];
|
|
824
|
+
(_a = options.onToggleTheme) == null || _a.call(options, nextTheme);
|
|
825
|
+
}
|
|
684
826
|
return {
|
|
685
827
|
buttonActive,
|
|
686
828
|
containerClasses,
|
|
687
829
|
iframeSource,
|
|
688
830
|
sessionListTitle,
|
|
831
|
+
resolvedTheme,
|
|
689
832
|
handleClose,
|
|
690
833
|
handleEmptyAction,
|
|
691
834
|
handleToggle,
|
|
692
|
-
handleToggleSessionList
|
|
835
|
+
handleToggleSessionList,
|
|
836
|
+
handleToggleTheme
|
|
693
837
|
};
|
|
694
838
|
}
|
|
695
839
|
//#endregion
|
|
@@ -903,7 +1047,7 @@ var __vue_sfc__ = /* @__PURE__ */ (0, vue.defineComponent)(__spreadProps(__sprea
|
|
|
903
1047
|
theme: {
|
|
904
1048
|
type: String,
|
|
905
1049
|
required: false,
|
|
906
|
-
default: "
|
|
1050
|
+
default: "auto"
|
|
907
1051
|
},
|
|
908
1052
|
title: {
|
|
909
1053
|
type: String,
|
|
@@ -996,10 +1140,12 @@ var __vue_sfc__ = /* @__PURE__ */ (0, vue.defineComponent)(__spreadProps(__sprea
|
|
|
996
1140
|
"update:sessionListCollapsed",
|
|
997
1141
|
"update:currentSessionId",
|
|
998
1142
|
"update:selectedElements",
|
|
1143
|
+
"update:theme",
|
|
999
1144
|
"toggle",
|
|
1000
1145
|
"close",
|
|
1001
1146
|
"toggle-session-list",
|
|
1002
1147
|
"toggle-select-mode",
|
|
1148
|
+
"toggle-theme",
|
|
1003
1149
|
"create-session",
|
|
1004
1150
|
"select-session",
|
|
1005
1151
|
"delete-session",
|
|
@@ -1049,7 +1195,7 @@ var __vue_sfc__ = /* @__PURE__ */ (0, vue.defineComponent)(__spreadProps(__sprea
|
|
|
1049
1195
|
(0, vue.watch)(() => props.sessionListCollapsed, (val) => {
|
|
1050
1196
|
localSessionListCollapsed.value = val;
|
|
1051
1197
|
});
|
|
1052
|
-
const { buttonActive, containerClasses, iframeSource, sessionListTitle, handleClose, handleEmptyAction, handleToggle, handleToggleSessionList } = useWidget({
|
|
1198
|
+
const { buttonActive, containerClasses, iframeSource, sessionListTitle, resolvedTheme, handleClose, handleEmptyAction, handleToggle, handleToggleSessionList, handleToggleTheme } = useWidget({
|
|
1053
1199
|
position: (0, vue.toRef)(props, "position"),
|
|
1054
1200
|
theme: (0, vue.toRef)(props, "theme"),
|
|
1055
1201
|
open: (0, vue.toRef)(props, "open"),
|
|
@@ -1075,6 +1221,10 @@ var __vue_sfc__ = /* @__PURE__ */ (0, vue.defineComponent)(__spreadProps(__sprea
|
|
|
1075
1221
|
},
|
|
1076
1222
|
onEmptyAction: () => {
|
|
1077
1223
|
emit("empty-action");
|
|
1224
|
+
},
|
|
1225
|
+
onToggleTheme: (newTheme) => {
|
|
1226
|
+
emit("update:theme", newTheme);
|
|
1227
|
+
emit("toggle-theme", newTheme);
|
|
1078
1228
|
}
|
|
1079
1229
|
});
|
|
1080
1230
|
const { sessionItems, handleCreateSession, handleDeleteSession, handleSelectSession } = useSession({
|
|
@@ -1119,6 +1269,7 @@ var __vue_sfc__ = /* @__PURE__ */ (0, vue.defineComponent)(__spreadProps(__sprea
|
|
|
1119
1269
|
});
|
|
1120
1270
|
provideOpenCodeWidgetContext({
|
|
1121
1271
|
theme: (0, vue.toRef)(props, "theme"),
|
|
1272
|
+
resolvedTheme,
|
|
1122
1273
|
title: (0, vue.toRef)(props, "title"),
|
|
1123
1274
|
hotkeyLabel: (0, vue.toRef)(props, "hotkeyLabel"),
|
|
1124
1275
|
selectShortcutLabel: (0, vue.toRef)(props, "selectShortcutLabel"),
|
|
@@ -1143,6 +1294,7 @@ var __vue_sfc__ = /* @__PURE__ */ (0, vue.defineComponent)(__spreadProps(__sprea
|
|
|
1143
1294
|
handleToggle,
|
|
1144
1295
|
handleClose,
|
|
1145
1296
|
handleToggleSessionList,
|
|
1297
|
+
handleToggleTheme,
|
|
1146
1298
|
handleEmptyAction,
|
|
1147
1299
|
handleCreateSession,
|
|
1148
1300
|
handleSelectSession,
|
|
@@ -1181,10 +1333,12 @@ var __vue_sfc__ = /* @__PURE__ */ (0, vue.defineComponent)(__spreadProps(__sprea
|
|
|
1181
1333
|
containerClasses,
|
|
1182
1334
|
iframeSource,
|
|
1183
1335
|
sessionListTitle,
|
|
1336
|
+
resolvedTheme,
|
|
1184
1337
|
handleClose,
|
|
1185
1338
|
handleEmptyAction,
|
|
1186
1339
|
handleToggle,
|
|
1187
1340
|
handleToggleSessionList,
|
|
1341
|
+
handleToggleTheme,
|
|
1188
1342
|
sessionItems,
|
|
1189
1343
|
handleCreateSession,
|
|
1190
1344
|
handleDeleteSession,
|
|
@@ -1315,7 +1469,7 @@ __vue_sfc__.render = __vue_render__;
|
|
|
1315
1469
|
var open_code_widget_default = __vue_sfc__;
|
|
1316
1470
|
//#endregion
|
|
1317
1471
|
//#region es/index.js
|
|
1318
|
-
var version = "1.0.
|
|
1472
|
+
var version = "1.0.12";
|
|
1319
1473
|
function install(app, options) {
|
|
1320
1474
|
[open_code_widget_default].forEach((item) => {
|
|
1321
1475
|
if (item.install) app.use(item, options);
|