vite-plugin-aipanel 1.2.4 → 1.2.6
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/endpoints/context.mjs +6 -1
- package/lib/client.js +2014 -2015
- package/lib/endpoints/context.cjs +6 -1
- package/package.json +5 -5
|
@@ -22,6 +22,7 @@ __export(context_exports, {
|
|
|
22
22
|
module.exports = __toCommonJS(context_exports);
|
|
23
23
|
var import_core = require("@aipanel/core");
|
|
24
24
|
var import_node = require("@aipanel/core/node");
|
|
25
|
+
var import_core2 = require("@aipanel/core");
|
|
25
26
|
const log = (0, import_node.createLogger)("Endpoints:Context");
|
|
26
27
|
function setupContextEndpoint(server, ctx) {
|
|
27
28
|
server.middlewares.use(import_core.CONTEXT_API_PATH, async (req, res) => {
|
|
@@ -78,13 +79,17 @@ function setupContextEndpoint(server, ctx) {
|
|
|
78
79
|
const data = JSON.parse(body);
|
|
79
80
|
const tabId = data.tabId != null ? String(data.tabId) : "default";
|
|
80
81
|
const existing = ctx.getPageContext();
|
|
82
|
+
const selectedElements = data.selectedElements || [];
|
|
83
|
+
selectedElements.forEach((el) => {
|
|
84
|
+
if (el && typeof el === "object") (0, import_core2.ensureNodeId)(el);
|
|
85
|
+
});
|
|
81
86
|
const newCtx = {
|
|
82
87
|
url: data.url || "",
|
|
83
88
|
title: data.title || "",
|
|
84
89
|
sessionId: data.sessionId,
|
|
85
90
|
tabId: data.tabId ?? existing.tabId,
|
|
86
91
|
tabIndex: data.tabIndex ?? existing.tabIndex,
|
|
87
|
-
selectedElements
|
|
92
|
+
selectedElements
|
|
88
93
|
};
|
|
89
94
|
ctx.setPageContext(tabId, newCtx);
|
|
90
95
|
if (data.active) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vite-plugin-aipanel",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.6",
|
|
4
4
|
"description": "Embed OpenCode Web UI in your Vite dev server for real-time code modification and preview",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.cjs",
|
|
@@ -41,12 +41,12 @@
|
|
|
41
41
|
"execa": "^9.6.1",
|
|
42
42
|
"typescript-language-server": "^5.3.0",
|
|
43
43
|
"unplugin-vue-inspector": "^3.0.0",
|
|
44
|
-
"@aipanel/
|
|
45
|
-
"@aipanel/
|
|
44
|
+
"@aipanel/core": "1.2.6",
|
|
45
|
+
"@aipanel/provider-opencode": "1.2.6"
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|
|
48
48
|
"vite": ">=5.0.0",
|
|
49
|
-
"@aipanel/provider-deepseek": "1.2.
|
|
49
|
+
"@aipanel/provider-deepseek": "1.2.6"
|
|
50
50
|
},
|
|
51
51
|
"peerDependenciesMeta": {
|
|
52
52
|
"@aipanel/provider-deepseek": {
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
57
|
"sharp": "^0.34.5",
|
|
58
|
-
"@aipanel/client": "1.2.
|
|
58
|
+
"@aipanel/client": "1.2.6"
|
|
59
59
|
},
|
|
60
60
|
"scripts": {
|
|
61
61
|
"build": "pagoda-cli build && vite build -c vite.client.config.ts",
|