@vite-plugin-opencode-assistant/components 1.0.33 → 1.0.35
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-inspector.js +144 -239
- package/es/open-code-widget/src/components/Trigger-sfc.css +1 -1
- package/lib/@vite-plugin-opencode-assistant/components.cjs.js +127 -216
- package/lib/@vite-plugin-opencode-assistant/components.es.js +127 -216
- package/lib/components.css +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/open-code-widget/composables/use-inspector.js +144 -239
- package/lib/open-code-widget/src/components/Trigger-sfc.css +1 -1
- package/lib/web-types.json +1 -1
- package/package.json +2 -2
|
@@ -1198,21 +1198,17 @@ function useWidget(options) {
|
|
|
1198
1198
|
}
|
|
1199
1199
|
//#endregion
|
|
1200
1200
|
//#region es/open-code-widget/composables/use-inspector.js
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
fn(...args);
|
|
1213
|
-
});
|
|
1214
|
-
});
|
|
1215
|
-
}
|
|
1201
|
+
var IGNORE_SELECTORS = [
|
|
1202
|
+
"#vue-inspector-container",
|
|
1203
|
+
".opencode-widget",
|
|
1204
|
+
".opencode-element-highlight",
|
|
1205
|
+
".opencode-element-tooltip",
|
|
1206
|
+
".opencode-select-mode-hint",
|
|
1207
|
+
".floating-bubble"
|
|
1208
|
+
];
|
|
1209
|
+
var IGNORE_ATTRIBUTE = "data-v-inspector-ignore";
|
|
1210
|
+
var KEY_PROPS_DATA = "__v_inspector";
|
|
1211
|
+
var KEY_DATA = "data-v-inspector";
|
|
1216
1212
|
function getDirectText(element) {
|
|
1217
1213
|
let text = "";
|
|
1218
1214
|
for (let i = 0; i < element.childNodes.length; i++) {
|
|
@@ -1244,67 +1240,26 @@ function isStateClass(className) {
|
|
|
1244
1240
|
if (/^(?:router-link|nuxt-link)/.test(className)) return true;
|
|
1245
1241
|
return false;
|
|
1246
1242
|
}
|
|
1247
|
-
function filterStateClasses(classes) {
|
|
1248
|
-
return classes.filter((cls) => !isStateClass(cls));
|
|
1249
|
-
}
|
|
1250
1243
|
function getElementDescription(element) {
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
});
|
|
1271
|
-
} catch (e) {
|
|
1272
|
-
const parts = [element.tagName.toLowerCase()];
|
|
1273
|
-
const id = element.id;
|
|
1274
|
-
if (id && !isDynamicId(id)) parts.push(`#${id}`);
|
|
1275
|
-
const className = element.className;
|
|
1276
|
-
if (typeof className === "string") {
|
|
1277
|
-
const classes = filterStateClasses(className.trim().split(/\s+/).filter(Boolean)).slice(0, 2);
|
|
1278
|
-
if (classes.length > 0) parts.push(`.${classes.join(".")}`);
|
|
1279
|
-
} else {
|
|
1280
|
-
const svgClass = className.baseVal;
|
|
1281
|
-
if (svgClass) {
|
|
1282
|
-
const classes = filterStateClasses(svgClass.trim().split(/\s+/).filter(Boolean)).slice(0, 2);
|
|
1283
|
-
if (classes.length > 0) parts.push(`.${classes.join(".")}`);
|
|
1284
|
-
}
|
|
1285
|
-
}
|
|
1286
|
-
const name = element.getAttribute("name");
|
|
1287
|
-
if (name) parts.push(`[name="${name}"]`);
|
|
1288
|
-
const placeholder = element.getAttribute("placeholder");
|
|
1289
|
-
if (placeholder) parts.push(`[placeholder="${placeholder.substring(0, 20)}"]`);
|
|
1290
|
-
if (element.getAttribute("src")) parts.push(`[src]`);
|
|
1291
|
-
const href = element.getAttribute("href");
|
|
1292
|
-
if (href && href !== "#") parts.push(`[href]`);
|
|
1293
|
-
return parts.join("");
|
|
1294
|
-
}
|
|
1295
|
-
}
|
|
1296
|
-
function getFileInfoFromAttributes(element) {
|
|
1297
|
-
const file = element.getAttribute("data-v-inspector-file");
|
|
1298
|
-
if (file) {
|
|
1299
|
-
const line = element.getAttribute("data-v-inspector-line");
|
|
1300
|
-
const column = element.getAttribute("data-v-inspector-column");
|
|
1301
|
-
return {
|
|
1302
|
-
file,
|
|
1303
|
-
line: line ? parseInt(line, 10) : null,
|
|
1304
|
-
column: column ? parseInt(column, 10) : null
|
|
1305
|
-
};
|
|
1306
|
-
}
|
|
1307
|
-
return null;
|
|
1244
|
+
return getCssSelector(element, {
|
|
1245
|
+
selectors: [
|
|
1246
|
+
"id",
|
|
1247
|
+
"class",
|
|
1248
|
+
"tag",
|
|
1249
|
+
"nthchild"
|
|
1250
|
+
],
|
|
1251
|
+
combineWithinSelector: true,
|
|
1252
|
+
combineBetweenSelectors: true,
|
|
1253
|
+
maxCombinations: 100,
|
|
1254
|
+
maxCandidates: 100,
|
|
1255
|
+
blacklist: [(selectorValue) => {
|
|
1256
|
+
const idMatch = selectorValue.match(/^#(.+)$/);
|
|
1257
|
+
if (idMatch) return isDynamicId(idMatch[1]);
|
|
1258
|
+
const classMatch = selectorValue.match(/^\.([a-zA-Z_-][\w-]*)$/);
|
|
1259
|
+
if (classMatch) return isStateClass(classMatch[1]);
|
|
1260
|
+
return false;
|
|
1261
|
+
}]
|
|
1262
|
+
});
|
|
1308
1263
|
}
|
|
1309
1264
|
function getFileInfoFromVueInstance(element) {
|
|
1310
1265
|
var _a, _b, _c, _d;
|
|
@@ -1336,51 +1291,68 @@ function getFileInfoFromVueInstance(element) {
|
|
|
1336
1291
|
}
|
|
1337
1292
|
return null;
|
|
1338
1293
|
}
|
|
1339
|
-
function
|
|
1294
|
+
function shouldIgnoreElement(el) {
|
|
1295
|
+
if (el.hasAttribute(IGNORE_ATTRIBUTE)) return true;
|
|
1296
|
+
for (const selector of IGNORE_SELECTORS) if (el.closest(selector)) return true;
|
|
1297
|
+
return false;
|
|
1298
|
+
}
|
|
1299
|
+
function getDataFromElement(el) {
|
|
1340
1300
|
var _a, _b;
|
|
1301
|
+
const vnodeData = (_b = (_a = el.__vnode) == null ? void 0 : _a.props) == null ? void 0 : _b[KEY_PROPS_DATA];
|
|
1302
|
+
if (vnodeData) return vnodeData;
|
|
1303
|
+
const attr = el.getAttribute(KEY_DATA);
|
|
1304
|
+
return attr != null ? attr : void 0;
|
|
1305
|
+
}
|
|
1306
|
+
function findInspectorFileInfo(element) {
|
|
1341
1307
|
let current = element;
|
|
1342
|
-
let fallbackFileInfo = null;
|
|
1343
1308
|
while (current) {
|
|
1344
|
-
const
|
|
1345
|
-
if (
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
currentTarget: current
|
|
1352
|
-
};
|
|
1353
|
-
const { params } = inspector.getTargetNode(fakeEvent);
|
|
1354
|
-
if (params && params.file) {
|
|
1355
|
-
const info = {
|
|
1356
|
-
file: params.file,
|
|
1357
|
-
line: (_a = params.line) != null ? _a : null,
|
|
1358
|
-
column: (_b = params.column) != null ? _b : null
|
|
1309
|
+
const data = getDataFromElement(current);
|
|
1310
|
+
if (data) {
|
|
1311
|
+
const match = data.match(/(.+):([\d]+):([\d]+)$/);
|
|
1312
|
+
if (match) return {
|
|
1313
|
+
file: match[1],
|
|
1314
|
+
line: parseInt(match[2], 10),
|
|
1315
|
+
column: parseInt(match[3], 10)
|
|
1359
1316
|
};
|
|
1360
|
-
if (info.line !== null) return info;
|
|
1361
|
-
if (!fallbackFileInfo) fallbackFileInfo = info;
|
|
1362
1317
|
}
|
|
1363
|
-
const vueInfo = getFileInfoFromVueInstance(current);
|
|
1364
|
-
if (vueInfo && !fallbackFileInfo) fallbackFileInfo = vueInfo;
|
|
1365
1318
|
current = current.parentElement;
|
|
1366
1319
|
}
|
|
1367
|
-
return
|
|
1320
|
+
return null;
|
|
1321
|
+
}
|
|
1322
|
+
function mergeFileInfo(inspectorFileInfo, vueFileInfo) {
|
|
1323
|
+
if (!(inspectorFileInfo == null ? void 0 : inspectorFileInfo.file) && !(vueFileInfo == null ? void 0 : vueFileInfo.file)) return {
|
|
1368
1324
|
file: null,
|
|
1369
1325
|
line: null,
|
|
1370
1326
|
column: null
|
|
1371
1327
|
};
|
|
1328
|
+
const isNodeModules = (path) => path.includes("node_modules");
|
|
1329
|
+
if ((inspectorFileInfo == null ? void 0 : inspectorFileInfo.file) && (vueFileInfo == null ? void 0 : vueFileInfo.file)) if (!isNodeModules(inspectorFileInfo.file)) return inspectorFileInfo;
|
|
1330
|
+
else if (!isNodeModules(vueFileInfo.file)) return vueFileInfo;
|
|
1331
|
+
else return inspectorFileInfo;
|
|
1332
|
+
else if (inspectorFileInfo == null ? void 0 : inspectorFileInfo.file) return inspectorFileInfo;
|
|
1333
|
+
else return vueFileInfo;
|
|
1372
1334
|
}
|
|
1373
|
-
function
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1335
|
+
function getTargetElement(e) {
|
|
1336
|
+
if (!e.target || !(e.target instanceof Element)) return null;
|
|
1337
|
+
const el = e.target;
|
|
1338
|
+
if (shouldIgnoreElement(el)) return null;
|
|
1339
|
+
return el;
|
|
1340
|
+
}
|
|
1341
|
+
function getFileInfo(e, element) {
|
|
1342
|
+
var _a, _b;
|
|
1343
|
+
const inspector = window.__VUE_INSPECTOR__;
|
|
1344
|
+
let inspectorFileInfo = null;
|
|
1345
|
+
if (inspector) {
|
|
1346
|
+
const { targetNode, params } = inspector.getTargetNode(e);
|
|
1347
|
+
if (targetNode && params && params.file) inspectorFileInfo = {
|
|
1348
|
+
file: params.file,
|
|
1349
|
+
line: (_a = params.line) != null ? _a : null,
|
|
1350
|
+
column: (_b = params.column) != null ? _b : null
|
|
1351
|
+
};
|
|
1382
1352
|
}
|
|
1383
|
-
|
|
1353
|
+
if (element && !inspectorFileInfo) inspectorFileInfo = findInspectorFileInfo(element);
|
|
1354
|
+
const vueFileInfo = element ? getFileInfoFromVueInstance(element) : null;
|
|
1355
|
+
return mergeFileInfo(inspectorFileInfo, vueFileInfo);
|
|
1384
1356
|
}
|
|
1385
1357
|
function useInspector(options) {
|
|
1386
1358
|
const highlightVisible = ref(false);
|
|
@@ -1401,79 +1373,48 @@ function useInspector(options) {
|
|
|
1401
1373
|
});
|
|
1402
1374
|
const INSPECTOR_CHECK_INTERVAL = 500;
|
|
1403
1375
|
let inspectorCheckTimer = null;
|
|
1404
|
-
let currentHighlightElement = null;
|
|
1405
|
-
let currentFileInfo = {
|
|
1406
|
-
file: null,
|
|
1407
|
-
line: null,
|
|
1408
|
-
column: null
|
|
1409
|
-
};
|
|
1410
1376
|
let currentPrimary = "#3b82f6";
|
|
1411
1377
|
let currentPrimaryBg = "rgba(59, 130, 246, 0.1)";
|
|
1412
|
-
|
|
1413
|
-
|
|
1378
|
+
function setPointerEventsNone(elements) {
|
|
1379
|
+
elements.forEach((el) => {
|
|
1380
|
+
if (el) el.style.pointerEvents = "none";
|
|
1381
|
+
});
|
|
1382
|
+
}
|
|
1383
|
+
function setPointerEventsAuto(elements) {
|
|
1384
|
+
elements.forEach((el) => {
|
|
1385
|
+
if (el) el.style.pointerEvents = "";
|
|
1386
|
+
});
|
|
1387
|
+
}
|
|
1414
1388
|
function handleMouseMoveCore(e) {
|
|
1415
|
-
var _a, _b;
|
|
1416
1389
|
if (!options.selectMode.value) return;
|
|
1417
|
-
const
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
column: null
|
|
1428
|
-
};
|
|
1429
|
-
try {
|
|
1430
|
-
if (inspector) {
|
|
1431
|
-
const result = inspector.getTargetNode(e);
|
|
1432
|
-
targetNode = result.targetNode;
|
|
1433
|
-
const params = result.params;
|
|
1434
|
-
if (targetNode) {
|
|
1435
|
-
elementToHighlight = getPreciseElementAtPoint(e.clientX, e.clientY, targetNode) || targetNode;
|
|
1436
|
-
if (params && params.file) fileInfo = {
|
|
1437
|
-
file: params.file,
|
|
1438
|
-
line: (_a = params.line) != null ? _a : null,
|
|
1439
|
-
column: (_b = params.column) != null ? _b : null
|
|
1440
|
-
};
|
|
1441
|
-
else fileInfo = findFileInfo(targetNode, inspector);
|
|
1442
|
-
}
|
|
1443
|
-
}
|
|
1444
|
-
if (!elementToHighlight) elementToHighlight = getPreciseElementAtPoint(e.clientX, e.clientY, null);
|
|
1445
|
-
if (elementToHighlight && !fileInfo.file) fileInfo = getFileInfoFromVueInstance(elementToHighlight) || fileInfo;
|
|
1446
|
-
} finally {
|
|
1447
|
-
if (highlight) highlight.style.pointerEvents = "";
|
|
1448
|
-
if (tooltip) tooltip.style.pointerEvents = "";
|
|
1449
|
-
}
|
|
1390
|
+
const uiElements = [
|
|
1391
|
+
document.querySelector(".opencode-element-highlight"),
|
|
1392
|
+
document.querySelector(".opencode-element-tooltip"),
|
|
1393
|
+
document.querySelector(".opencode-select-mode-hint"),
|
|
1394
|
+
document.querySelector(".floating-bubble")
|
|
1395
|
+
];
|
|
1396
|
+
setPointerEventsNone(uiElements);
|
|
1397
|
+
const elementToHighlight = getTargetElement(e);
|
|
1398
|
+
const fileInfo = getFileInfo(e, elementToHighlight);
|
|
1399
|
+
setPointerEventsAuto(uiElements);
|
|
1450
1400
|
if (elementToHighlight) {
|
|
1451
|
-
const
|
|
1452
|
-
if (
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
if (widget) {
|
|
1457
|
-
const style = getComputedStyle(widget);
|
|
1458
|
-
currentPrimary = style.getPropertyValue("--oc-primary").trim() || currentPrimary;
|
|
1459
|
-
currentPrimaryBg = style.getPropertyValue("--oc-primary-bg").trim() || currentPrimaryBg;
|
|
1460
|
-
}
|
|
1461
|
-
currentDescription = getElementDescription(elementToHighlight);
|
|
1462
|
-
} else if (!currentFileInfo.file && fileInfo.file) currentFileInfo = fileInfo;
|
|
1463
|
-
const fileName = currentFileInfo.file ? currentFileInfo.file.split("/").pop() : "";
|
|
1464
|
-
let lineInfo = "";
|
|
1465
|
-
if (currentFileInfo.line) {
|
|
1466
|
-
lineInfo = `:${currentFileInfo.line}`;
|
|
1467
|
-
if (currentFileInfo.column) lineInfo += `:${currentFileInfo.column}`;
|
|
1401
|
+
const widget = document.querySelector(".opencode-widget");
|
|
1402
|
+
if (widget) {
|
|
1403
|
+
const style = getComputedStyle(widget);
|
|
1404
|
+
currentPrimary = style.getPropertyValue("--oc-primary").trim() || currentPrimary;
|
|
1405
|
+
currentPrimaryBg = style.getPropertyValue("--oc-primary-bg").trim() || currentPrimaryBg;
|
|
1468
1406
|
}
|
|
1469
|
-
const
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
};
|
|
1407
|
+
const description = getElementDescription(elementToHighlight);
|
|
1408
|
+
const fileName = fileInfo.file ? fileInfo.file.split("/").pop() : "";
|
|
1409
|
+
let lineInfo = "";
|
|
1410
|
+
if (fileInfo.line) {
|
|
1411
|
+
lineInfo = `:${fileInfo.line}`;
|
|
1412
|
+
if (fileInfo.column) lineInfo += `:${fileInfo.column}`;
|
|
1476
1413
|
}
|
|
1414
|
+
tooltipContent.value = {
|
|
1415
|
+
description,
|
|
1416
|
+
fileInfo: fileName ? `${fileName}${lineInfo}` : ""
|
|
1417
|
+
};
|
|
1477
1418
|
const rect = elementToHighlight.getBoundingClientRect();
|
|
1478
1419
|
const newTop = `${rect.top}px`;
|
|
1479
1420
|
const newLeft = `${rect.left}px`;
|
|
@@ -1489,59 +1430,37 @@ function useInspector(options) {
|
|
|
1489
1430
|
};
|
|
1490
1431
|
const tooltipHeight = 50;
|
|
1491
1432
|
const tooltipWidth = 200;
|
|
1433
|
+
const margin = 10;
|
|
1492
1434
|
let tooltipTop = rect.top - tooltipHeight - 8;
|
|
1493
1435
|
let tooltipLeft = rect.left;
|
|
1494
|
-
if (tooltipTop <
|
|
1495
|
-
if (
|
|
1436
|
+
if (tooltipTop < margin) tooltipTop = rect.bottom + 8;
|
|
1437
|
+
if (tooltipTop + tooltipHeight > window.innerHeight - margin) tooltipTop = Math.max(margin, rect.top - tooltipHeight - 8);
|
|
1438
|
+
if (tooltipLeft < margin) tooltipLeft = margin;
|
|
1439
|
+
if (tooltipLeft + tooltipWidth > window.innerWidth - margin) tooltipLeft = window.innerWidth - tooltipWidth - margin;
|
|
1496
1440
|
const newTooltipTop = `${tooltipTop}px`;
|
|
1497
1441
|
const newTooltipLeft = `${tooltipLeft}px`;
|
|
1498
1442
|
if (tooltipStyle.value.top !== newTooltipTop || tooltipStyle.value.left !== newTooltipLeft) tooltipStyle.value = {
|
|
1499
1443
|
top: newTooltipTop,
|
|
1500
1444
|
left: newTooltipLeft
|
|
1501
1445
|
};
|
|
1502
|
-
|
|
1503
|
-
|
|
1446
|
+
highlightVisible.value = true;
|
|
1447
|
+
tooltipVisible.value = true;
|
|
1504
1448
|
} else {
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
currentFileInfoText = "";
|
|
1508
|
-
currentFileInfo = {
|
|
1509
|
-
file: null,
|
|
1510
|
-
line: null,
|
|
1511
|
-
column: null
|
|
1512
|
-
};
|
|
1513
|
-
if (highlightVisible.value) highlightVisible.value = false;
|
|
1514
|
-
if (tooltipVisible.value) tooltipVisible.value = false;
|
|
1449
|
+
highlightVisible.value = false;
|
|
1450
|
+
tooltipVisible.value = false;
|
|
1515
1451
|
}
|
|
1516
1452
|
}
|
|
1517
|
-
const handleMouseMove =
|
|
1453
|
+
const handleMouseMove = handleMouseMoveCore;
|
|
1518
1454
|
function setupInspectorHook() {
|
|
1519
1455
|
const inspector = window.__VUE_INSPECTOR__;
|
|
1520
1456
|
if (!inspector || inspector.__opencode_hooked) return;
|
|
1521
1457
|
const originalHandleClick = inspector.handleClick.bind(inspector);
|
|
1522
1458
|
inspector.handleClick = function(e) {
|
|
1523
|
-
var _a, _b;
|
|
1524
1459
|
if (options.selectMode.value) {
|
|
1525
1460
|
e.preventDefault();
|
|
1526
1461
|
e.stopPropagation();
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
file: null,
|
|
1530
|
-
line: null,
|
|
1531
|
-
column: null
|
|
1532
|
-
};
|
|
1533
|
-
const { targetNode, params } = inspector.getTargetNode(e);
|
|
1534
|
-
if (targetNode) {
|
|
1535
|
-
elementToSelect = getPreciseElementAtPoint(e.clientX, e.clientY, targetNode) || targetNode;
|
|
1536
|
-
if (params && params.file) fileInfo = {
|
|
1537
|
-
file: params.file,
|
|
1538
|
-
line: (_a = params.line) != null ? _a : null,
|
|
1539
|
-
column: (_b = params.column) != null ? _b : null
|
|
1540
|
-
};
|
|
1541
|
-
else if (elementToSelect) fileInfo = findFileInfo(elementToSelect, inspector);
|
|
1542
|
-
}
|
|
1543
|
-
if (!elementToSelect) elementToSelect = getPreciseElementAtPoint(e.clientX, e.clientY, null);
|
|
1544
|
-
if (elementToSelect && !fileInfo.file) fileInfo = getFileInfoFromVueInstance(elementToSelect) || fileInfo;
|
|
1462
|
+
const elementToSelect = getTargetElement(e);
|
|
1463
|
+
const fileInfo = getFileInfo(e, elementToSelect);
|
|
1545
1464
|
if (elementToSelect) {
|
|
1546
1465
|
const innerText = getDirectText(elementToSelect);
|
|
1547
1466
|
const description = getElementDescription(elementToSelect);
|
|
@@ -1577,14 +1496,6 @@ function useInspector(options) {
|
|
|
1577
1496
|
if (inspector) inspector.disable();
|
|
1578
1497
|
document.removeEventListener("mousemove", handleMouseMove);
|
|
1579
1498
|
document.removeEventListener("keydown", handleKeydown, true);
|
|
1580
|
-
currentHighlightElement = null;
|
|
1581
|
-
currentDescription = "";
|
|
1582
|
-
currentFileInfoText = "";
|
|
1583
|
-
currentFileInfo = {
|
|
1584
|
-
file: null,
|
|
1585
|
-
line: null,
|
|
1586
|
-
column: null
|
|
1587
|
-
};
|
|
1588
1499
|
highlightVisible.value = false;
|
|
1589
1500
|
tooltipVisible.value = false;
|
|
1590
1501
|
}
|
|
@@ -2390,7 +2301,7 @@ __vue_sfc__.render = __vue_render__;
|
|
|
2390
2301
|
var open_code_widget_default = __vue_sfc__;
|
|
2391
2302
|
//#endregion
|
|
2392
2303
|
//#region es/index.js
|
|
2393
|
-
var version = "1.0.
|
|
2304
|
+
var version = "1.0.35";
|
|
2394
2305
|
function install(app, options) {
|
|
2395
2306
|
[open_code_widget_default].forEach((item) => {
|
|
2396
2307
|
if (item.install) app.use(item, options);
|
package/lib/components.css
CHANGED
|
@@ -4,6 +4,6 @@
|
|
|
4
4
|
.opencode-select-mode-hint{position:fixed;top:20px;left:50%;transform:translate(-50%);padding:10px;background:linear-gradient(135deg,#ef4444,#dc2626);color:#fff;border-radius:12px;font-size:14px;font-weight:500;box-shadow:0 6px 20px rgba(239,68,68,.5),0 0 0 3px rgba(239,68,68,.3);z-index:9999999;display:none;align-items:center;gap:12px;border:1px solid rgba(255,255,255,.3)}.opencode-select-mode-hint.visible{display:flex;animation:slideDown .3s ease,pulseHint 2s ease-in-out infinite}.opencode-hint-shortcut{padding:4px 10px;background:rgba(255,255,255,.25);border-radius:6px;font-size:13px;font-weight:600;border:1px solid rgba(255,255,255,.4)}@keyframes pulseHint{0%,to{box-shadow:0 6px 20px rgba(239,68,68,.5),0 0 0 3px rgba(239,68,68,.3)}50%{box-shadow:0 6px 20px rgba(239,68,68,.6),0 0 0 6px rgba(239,68,68,.4)}}
|
|
5
5
|
.opencode-right-toolbar{width:140px;background:var(--oc-bg-secondary);border-left:1px solid var(--oc-border-primary);display:flex;flex-direction:column;flex-shrink:0;transition:width .2s ease;overflow:hidden}.opencode-right-toolbar.collapsed{width:0;overflow:hidden}.opencode-right-toolbar.collapsed .opencode-selected-nodes-header,.opencode-right-toolbar.collapsed .opencode-selected-nodes,.opencode-right-toolbar.collapsed .opencode-clear-all-btn{display:none}.opencode-selected-nodes-header{padding:12px 8px 8px;border-bottom:1px solid var(--oc-border-primary)}.opencode-selected-nodes-title{font-size:14px;font-weight:600;color:var(--oc-text-primary);margin-bottom:4px}.opencode-selected-nodes-desc{font-size:11px;color:var(--oc-text-placeholder);line-height:1.4}.opencode-selected-nodes{flex:1;display:flex;flex-direction:column;padding:8px;gap:6px;overflow-y:auto;overflow-x:hidden}.opencode-selected-nodes:empty:before{content:"\6682\65e0\9009\4e2d\5143\7d20";color:var(--oc-text-placeholder);font-size:12px;text-align:center;padding:20px 10px}.opencode-selected-node{display:flex;align-items:center;gap:8px;padding:8px 10px;background:var(--oc-bg-main);border:1px solid var(--oc-border-primary);border-radius:6px;font-size:12px;transition:all .2s}.opencode-selected-node:hover{border-color:var(--oc-primary);box-shadow:var(--oc-shadow-primary)}.opencode-node-content{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}.opencode-node-text{color:var(--oc-text-primary);font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.opencode-node-file{color:var(--oc-text-placeholder);font-size:11px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.opencode-node-remove{width:18px;height:18px;border-radius:4px;border:none;background:transparent;color:var(--oc-text-placeholder);cursor:pointer;display:flex;align-items:center;justify-content:center;font-size:14px;transition:all .2s;flex-shrink:0}.opencode-node-remove:hover{background:var(--oc-danger);color:#fff}.opencode-clear-all-btn{width:calc(100% - 16px);margin:8px;padding:8px 12px;border-radius:6px;border:none;background:var(--oc-danger);color:#fff;font-size:12px;font-weight:500;cursor:pointer;display:flex;align-items:center;justify-content:center;gap:4px;transition:all .2s}.opencode-clear-all-btn:hover{background:var(--oc-danger-hover);transform:scale(1.02)}
|
|
6
6
|
.opencode-session-list{width:240px;background:var(--oc-bg-secondary);border-right:1px solid var(--oc-border-primary);display:flex;flex-direction:column;flex-shrink:0;transition:width .2s ease}.opencode-session-list.collapsed{width:0;overflow:hidden}.opencode-session-list.collapsed .opencode-session-list-header,.opencode-session-list.collapsed .opencode-session-list-content{display:none}.opencode-session-list-header{padding:16px;border-bottom:1px solid var(--oc-border-primary);display:flex;justify-content:space-between;align-items:center;font-weight:600;font-size:14px;color:var(--oc-text-primary)}.opencode-new-session-btn{width:28px;height:28px;border-radius:6px;border:none;background:var(--oc-primary);color:#fff;font-size:18px;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:all .2s}.opencode-new-session-btn:hover{background:var(--oc-primary-hover);transform:scale(1.05)}.opencode-session-list-content{flex:1;overflow-y:auto;padding:8px;position:relative}.opencode-session-list-loading-overlay{position:absolute;top:0;left:0;right:0;bottom:0;background:var(--oc-overlay-bg);display:flex;align-items:center;justify-content:center;z-index:10;border-radius:8px}.opencode-loading-spinner.small{width:24px;height:24px;border-width:2px}.opencode-session-item{padding:12px;border-radius:8px;cursor:pointer;transition:transform .2s;margin-bottom:4px;color:var(--oc-text-primary)}.opencode-session-item:hover{background:var(--oc-bg-tertiary)}.opencode-session-item.active{background:var(--oc-primary);color:#fff;transition:none}.opencode-session-title{font-size:14px;font-weight:500;margin-bottom:4px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.opencode-session-meta{font-size:12px;opacity:.6}.opencode-session-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:4px}.opencode-session-delete-btn{width:20px;height:20px;border-radius:4px;border:none;background:transparent;color:var(--oc-text-placeholder);font-size:16px;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:all .2s;opacity:0;flex-shrink:0}.opencode-session-item:hover .opencode-session-delete-btn{opacity:1}.opencode-session-delete-btn:hover{background:var(--oc-danger);color:#fff}.opencode-session-item.active .opencode-session-delete-btn{color:rgba(255,255,255,.7)}.opencode-session-item.active .opencode-session-delete-btn:hover{background:rgba(255,255,255,.2);color:#fff}.opencode-session-header-skeleton{padding:16px;border-bottom:1px solid var(--oc-border-primary);display:none;justify-content:space-between;align-items:center}.opencode-session-header-skeleton.visible{display:flex}.opencode-skeleton-header-title{height:18px;width:80px;background:var(--oc-skeleton-gradient);background-size:200% 100%;animation:skeleton-loading 1.5s ease-in-out infinite;border-radius:4px}.opencode-skeleton-header-btn{width:28px;height:28px;background:var(--oc-skeleton-gradient);background-size:200% 100%;animation:skeleton-loading 1.5s ease-in-out infinite;border-radius:6px}.opencode-session-skeleton{flex:1;overflow-y:auto;padding:8px;display:none}.opencode-session-skeleton.visible{display:block}.opencode-skeleton-item{padding:12px;border-radius:8px;margin-bottom:4px;background:var(--oc-skeleton-bg)}.opencode-skeleton-title{height:16px;background:var(--oc-skeleton-gradient);background-size:200% 100%;animation:skeleton-loading 1.5s ease-in-out infinite;border-radius:4px;margin-bottom:8px;width:70%}.opencode-skeleton-meta{height:12px;background:var(--oc-skeleton-gradient);background-size:200% 100%;animation:skeleton-loading 1.5s ease-in-out infinite;border-radius:4px;width:50%}.opencode-session-empty{padding:32px 16px;text-align:center;color:var(--oc-text-placeholder);font-size:13px}.opencode-thinking-loading{display:inline-block;width:12px;height:12px;margin-right:6px;border:2px solid var(--oc-border-secondary);border-top-color:var(--oc-text-secondary);border-radius:50%;animation:thinking-spin .8s linear infinite;vertical-align:middle}.opencode-session-item.active .opencode-thinking-loading{border-color:rgba(255,255,255,.3);border-top-color:rgba(255,255,255,.9)}@keyframes thinking-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@keyframes skeleton-loading{0%{background-position:200% 0}to{background-position:-200% 0}}
|
|
7
|
-
.opencode-button{width:42px;height:42px;border-radius:50%;background:#fff;border:none;cursor:pointer;box-shadow:0 4px 12px rgba(102,126,234,.4);transition:all .3s ease;display:flex;align-items:center;justify-content:center;padding:0;position:relative}.opencode-button svg{transform:rotate(180deg) scale(1.1);transition:transform .3s ease;width:100%;height:100%;display:block}.opencode-button:hover svg{transform:rotate(180deg) scale(1.1)}.opencode-button:hover{transform:scale(1.1);box-shadow:0 6px 16px rgba(102,126,234,.5)}.opencode-button.thinking{background:linear-gradient(135deg,#667eea,#764ba2);animation:thinking-glow
|
|
7
|
+
.opencode-button{width:42px;height:42px;border-radius:50%;background:#fff;border:none;cursor:pointer;box-shadow:0 4px 12px rgba(102,126,234,.4);transition:all .3s ease;display:flex;align-items:center;justify-content:center;padding:0;position:relative}.opencode-button svg{transform:rotate(180deg) scale(1.1);transition:transform .3s ease;width:100%;height:100%;display:block}.opencode-button:hover svg{transform:rotate(180deg) scale(1.1)}.opencode-button:hover{transform:scale(1.1);box-shadow:0 6px 16px rgba(102,126,234,.5)}.opencode-button.thinking{background:linear-gradient(135deg,#667eea,#764ba2);animation:thinking-glow 2s ease-in-out infinite,thinking-pulse 2s ease-in-out infinite;box-shadow:0 0 20px rgba(102,126,234,.6),0 0 40px rgba(118,75,162,.4),0 0 60px rgba(102,126,234,.2)}.opencode-button.thinking svg path{fill:#fff}.opencode-button.thinking:before{content:"";position:absolute;top:-2px;right:-2px;bottom:-2px;left:-2px;border-radius:50%;background:linear-gradient(135deg,#8b9cf5,#9d6bc7);z-index:-1}.opencode-button.thinking:after{content:"";position:absolute;top:-3px;right:-3px;bottom:-3px;left:-3px;border-radius:50%;background:conic-gradient(from 180deg,transparent,rgba(102,126,234,.3),transparent,rgba(118,75,162,.3),transparent);z-index:-2;animation:thinking-rotate 2s linear infinite reverse;filter:blur(8px)}@keyframes thinking-glow{0%,to{box-shadow:0 0 20px rgba(102,126,234,.6),0 0 40px rgba(118,75,162,.4),0 0 60px rgba(102,126,234,.2)}50%{box-shadow:0 0 30px rgba(102,126,234,.8),0 0 60px rgba(118,75,162,.6),0 0 90px rgba(102,126,234,.3)}}@keyframes thinking-rotate{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@keyframes thinking-pulse{0%,to{transform:scale(1)}50%{transform:scale(.92)}}.opencode-button.opencode-theme-dark{background:linear-gradient(135deg,#667eea,#764ba2);box-shadow:0 4px 12px rgba(102,126,234,.3)}.opencode-button.opencode-theme-dark:before{content:"";position:absolute;top:-2px;right:-2px;bottom:-2px;left:-2px;border-radius:50%;background:linear-gradient(135deg,#8b9cf5,#9d6bc7);z-index:-1}.opencode-button.opencode-theme-dark:hover{box-shadow:0 6px 16px rgba(102,126,234,.4)}.opencode-button.opencode-theme-dark svg path{fill:#fff}
|
|
8
8
|
.floating-bubble{position:fixed;top:0;left:0;z-index:999999;cursor:grab;-webkit-user-select:none;-moz-user-select:none;user-select:none;touch-action:none;will-change:transform}.floating-bubble:active{cursor:grabbing}body.floating-bubble-dragging *{pointer-events:none!important}body.floating-bubble-dragging .floating-bubble,body.floating-bubble-dragging .floating-bubble *{pointer-events:auto!important}
|
|
9
9
|
/*$vite$:1*/
|
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.0.
|
|
3
|
+
declare const version = "1.0.35";
|
|
4
4
|
declare function install(app: App<any>, options?: any): void;
|
|
5
5
|
export { install, version, OpenCodeWidget };
|
|
6
6
|
export default install;
|
package/lib/index.js
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"));
|
|
37
|
-
const version = "1.0.
|
|
37
|
+
const version = "1.0.35";
|
|
38
38
|
function install(app, options) {
|
|
39
39
|
const components = [
|
|
40
40
|
import_open_code_widget.default
|