@aipanel/ui 1.2.9 → 1.2.11
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/AI-panel-widget/composables/use-inspector.mjs +1 -2
- package/es/AI-panel-widget/composables/use-persist-state.mjs +3 -18
- package/es/AI-panel-widget/composables/use-session.mjs +16 -5
- package/es/AI-panel-widget/composables/use-widget.mjs +6 -11
- package/es/AI-panel-widget/src/components/Frame.vue.mjs +2 -1
- package/es/AI-panel-widget/src/components/Header.vue.mjs +13 -20
- package/es/AI-panel-widget/src/components/SessionList-sfc.css +1 -1
- package/es/AI-panel-widget/src/components/SessionList.vue.mjs +95 -16
- package/es/AI-panel-widget/src/index-sfc.css +1 -1
- package/es/AI-panel-widget/src/index.vue.d.ts +1 -1
- package/es/AI-panel-widget/src/index.vue.mjs +11 -9
- package/es/AI-panel-widget/src/types.d.ts +0 -1
- package/es/index.d.ts +1 -1
- package/es/index.mjs +1 -1
- package/lib/AI-panel-widget/composables/use-inspector.cjs +1 -2
- package/lib/AI-panel-widget/composables/use-persist-state.cjs +2 -17
- package/lib/AI-panel-widget/composables/use-session.cjs +16 -5
- package/lib/AI-panel-widget/composables/use-widget.cjs +7 -12
- package/lib/AI-panel-widget/src/components/Frame.vue.cjs +2 -1
- package/lib/AI-panel-widget/src/components/Header.vue.cjs +13 -20
- package/lib/AI-panel-widget/src/components/SessionList-sfc.css +1 -1
- package/lib/AI-panel-widget/src/components/SessionList.vue.cjs +94 -15
- package/lib/AI-panel-widget/src/index-sfc.css +1 -1
- package/lib/AI-panel-widget/src/index.vue.cjs +10 -8
- package/lib/AI-panel-widget/src/index.vue.d.ts +1 -1
- package/lib/AI-panel-widget/src/types.d.ts +0 -1
- package/lib/index.cjs +1 -1
- package/lib/index.d.ts +1 -1
- package/package.json +2 -4
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ref, watch, onMounted, onUnmounted, nextTick } from "vue";
|
|
2
|
-
import { truncate } from "@aipanel/core";
|
|
2
|
+
import { INSPECTOR_CHECK_INTERVAL, truncate } from "@aipanel/core";
|
|
3
3
|
import getCssSelector from "css-selector-generator";
|
|
4
4
|
const IGNORE_SELECTORS = [
|
|
5
5
|
"#vue-inspector-container",
|
|
@@ -196,7 +196,6 @@ function useInspector(options) {
|
|
|
196
196
|
const tooltipVisible = ref(false);
|
|
197
197
|
const tooltipStyle = ref({ top: "0px", left: "0px" });
|
|
198
198
|
const tooltipContent = ref({ description: "", fileInfo: "" });
|
|
199
|
-
const INSPECTOR_CHECK_INTERVAL = 500;
|
|
200
199
|
let inspectorCheckTimer = null;
|
|
201
200
|
let currentPrimary = "#3b82f6";
|
|
202
201
|
let currentPrimaryBg = "rgba(59, 130, 246, 0.1)";
|
|
@@ -1,26 +1,11 @@
|
|
|
1
1
|
import { watch, onMounted } from "vue";
|
|
2
|
-
import {
|
|
3
|
-
const log = createLogger("AIPanelWidget");
|
|
2
|
+
import { storageGet, storageSet } from "@aipanel/core/client";
|
|
4
3
|
const STORAGE_KEY = "aipanel-widget-state";
|
|
5
4
|
function loadState() {
|
|
6
|
-
|
|
7
|
-
try {
|
|
8
|
-
const stored = localStorage.getItem(STORAGE_KEY);
|
|
9
|
-
if (stored) {
|
|
10
|
-
return JSON.parse(stored);
|
|
11
|
-
}
|
|
12
|
-
} catch (e) {
|
|
13
|
-
log.error("Failed to load persisted state:", { error: e });
|
|
14
|
-
}
|
|
15
|
-
return null;
|
|
5
|
+
return storageGet("local", STORAGE_KEY);
|
|
16
6
|
}
|
|
17
7
|
function saveState(state) {
|
|
18
|
-
|
|
19
|
-
try {
|
|
20
|
-
localStorage.setItem(STORAGE_KEY, JSON.stringify(state));
|
|
21
|
-
} catch (e) {
|
|
22
|
-
log.error("Failed to save state:", { error: e });
|
|
23
|
-
}
|
|
8
|
+
storageSet("local", STORAGE_KEY, state);
|
|
24
9
|
}
|
|
25
10
|
function usePersistState(options) {
|
|
26
11
|
const restoreState = () => {
|
|
@@ -1,4 +1,19 @@
|
|
|
1
1
|
import { computed } from "vue";
|
|
2
|
+
function formatRelativeTime(ts) {
|
|
3
|
+
const time = new Date(ts).getTime();
|
|
4
|
+
if (Number.isNaN(time)) return "";
|
|
5
|
+
const diff = Date.now() - time;
|
|
6
|
+
if (diff < 0) return "\u521A\u521A";
|
|
7
|
+
const minute = 6e4;
|
|
8
|
+
const hour = 60 * minute;
|
|
9
|
+
const day = 24 * hour;
|
|
10
|
+
if (diff < minute) return "\u521A\u521A";
|
|
11
|
+
if (diff < hour) return `${Math.floor(diff / minute)} \u5206\u949F\u524D`;
|
|
12
|
+
if (diff < day) return `${Math.floor(diff / hour)} \u5C0F\u65F6\u524D`;
|
|
13
|
+
if (diff < 7 * day) return `${Math.floor(diff / day)} \u5929\u524D`;
|
|
14
|
+
const date = new Date(time);
|
|
15
|
+
return `${date.toLocaleDateString()} ${date.toLocaleTimeString()}`;
|
|
16
|
+
}
|
|
2
17
|
function formatSessionMeta(session) {
|
|
3
18
|
if (session.meta) {
|
|
4
19
|
return session.meta;
|
|
@@ -6,11 +21,7 @@ function formatSessionMeta(session) {
|
|
|
6
21
|
if (!session.updatedAt) {
|
|
7
22
|
return "";
|
|
8
23
|
}
|
|
9
|
-
|
|
10
|
-
if (Number.isNaN(date.getTime())) {
|
|
11
|
-
return "";
|
|
12
|
-
}
|
|
13
|
-
return `${date.toLocaleDateString()} ${date.toLocaleTimeString()}`;
|
|
24
|
+
return formatRelativeTime(session.updatedAt);
|
|
14
25
|
}
|
|
15
26
|
function useSession(options) {
|
|
16
27
|
const sessionItems = computed(
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import { computed, ref, onMounted, onUnmounted } from "vue";
|
|
2
|
-
|
|
2
|
+
import { WIDGET_THEME_MODES } from "@aipanel/core";
|
|
3
|
+
import { getSystemTheme, resolveWidgetTheme } from "@aipanel/core/client";
|
|
4
|
+
const THEME_CYCLE = WIDGET_THEME_MODES;
|
|
3
5
|
function useWidget(options) {
|
|
4
6
|
const systemTheme = ref("light");
|
|
5
|
-
function getSystemTheme() {
|
|
6
|
-
if (typeof window === "undefined") return "light";
|
|
7
|
-
return window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
|
8
|
-
}
|
|
9
7
|
let mediaQuery = null;
|
|
10
8
|
let handleChange = null;
|
|
11
9
|
onMounted(() => {
|
|
@@ -22,12 +20,9 @@ function useWidget(options) {
|
|
|
22
20
|
mediaQuery.removeEventListener("change", handleChange);
|
|
23
21
|
}
|
|
24
22
|
});
|
|
25
|
-
const resolvedTheme = computed(
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
29
|
-
return options.theme.value;
|
|
30
|
-
});
|
|
23
|
+
const resolvedTheme = computed(
|
|
24
|
+
() => resolveWidgetTheme(options.theme.value, systemTheme.value)
|
|
25
|
+
);
|
|
31
26
|
const containerClasses = computed(() => [
|
|
32
27
|
"aipanel-widget",
|
|
33
28
|
`aipanel-theme-${resolvedTheme.value}`
|
|
@@ -2,6 +2,7 @@ import "./Frame-sfc.css";
|
|
|
2
2
|
import { defineComponent as _defineComponent } from "vue";
|
|
3
3
|
import { ref } from "vue";
|
|
4
4
|
import { useAIPanelWidgetContext } from "../context.mjs";
|
|
5
|
+
import { widgetEnvelope } from "@aipanel/core";
|
|
5
6
|
const __vue_sfc__ = /* @__PURE__ */ _defineComponent({
|
|
6
7
|
__name: "Frame",
|
|
7
8
|
setup(__props, { expose: __expose }) {
|
|
@@ -18,7 +19,7 @@ const __vue_sfc__ = /* @__PURE__ */ _defineComponent({
|
|
|
18
19
|
} = useAIPanelWidgetContext();
|
|
19
20
|
function sendMessageToIframe(type, data) {
|
|
20
21
|
if (!iframeRef.value?.contentWindow) return;
|
|
21
|
-
iframeRef.value.contentWindow.postMessage(
|
|
22
|
+
iframeRef.value.contentWindow.postMessage(widgetEnvelope(type, data), "*");
|
|
22
23
|
}
|
|
23
24
|
__expose({
|
|
24
25
|
sendMessageToIframe
|
|
@@ -33,6 +33,14 @@ const __vue_sfc__ = /* @__PURE__ */ _defineComponent({
|
|
|
33
33
|
handleRefresh,
|
|
34
34
|
handleCreateSession
|
|
35
35
|
} = useAIPanelWidgetContext();
|
|
36
|
+
const DISPLAY_MODE_LABELS = {
|
|
37
|
+
bubble: "\u6C14\u6CE1\u6A21\u5F0F",
|
|
38
|
+
split: "\u5206\u5C4F\u6A21\u5F0F",
|
|
39
|
+
auto: "\u81EA\u52A8\u6A21\u5F0F",
|
|
40
|
+
extension: "\u6269\u5C55\u6A21\u5F0F",
|
|
41
|
+
"extension-selector": "\u6269\u5C55\u9009\u62E9\u5668\u6A21\u5F0F"
|
|
42
|
+
};
|
|
43
|
+
const DISPLAY_CYCLE = ["bubble", "split", "auto"];
|
|
36
44
|
const isSplitMode = computed(() => mode.value === "split");
|
|
37
45
|
const themeIconTitle = computed(() => {
|
|
38
46
|
const themeLabels = {
|
|
@@ -51,27 +59,12 @@ const __vue_sfc__ = /* @__PURE__ */ _defineComponent({
|
|
|
51
59
|
return `\u5207\u6362\u4E3B\u9898 - \u5F53\u524D: ${themeLabels[theme.value]}`;
|
|
52
60
|
});
|
|
53
61
|
const displayModeIconTitle = computed(() => {
|
|
54
|
-
|
|
55
|
-
bubble: "\u6C14\u6CE1\u6A21\u5F0F",
|
|
56
|
-
split: "\u5206\u5C4F\u6A21\u5F0F",
|
|
57
|
-
auto: "\u81EA\u52A8\u6A21\u5F0F",
|
|
58
|
-
extension: "\u6269\u5C55\u6A21\u5F0F",
|
|
59
|
-
"extension-selector": "\u6269\u5C55\u9009\u62E9\u5668\u6A21\u5F0F"
|
|
60
|
-
};
|
|
61
|
-
return `\u5C55\u793A\u6A21\u5F0F: ${displayModeLabels[displayMode.value]}`;
|
|
62
|
+
return `\u5C55\u793A\u6A21\u5F0F: ${DISPLAY_MODE_LABELS[displayMode.value]}`;
|
|
62
63
|
});
|
|
63
64
|
const displayModeIconLabel = computed(() => {
|
|
64
|
-
const
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
auto: "\u81EA\u52A8\u6A21\u5F0F",
|
|
68
|
-
extension: "\u6269\u5C55\u6A21\u5F0F",
|
|
69
|
-
"extension-selector": "\u6269\u5C55\u9009\u62E9\u5668\u6A21\u5F0F"
|
|
70
|
-
};
|
|
71
|
-
const modes = ["bubble", "split", "auto"];
|
|
72
|
-
const currentIndex = modes.indexOf(displayMode.value);
|
|
73
|
-
const nextMode = modes[(currentIndex + 1) % modes.length];
|
|
74
|
-
return `\u5207\u6362\u5C55\u793A\u6A21\u5F0F - \u4E0B\u4E00\u4E2A: ${displayModeLabels[nextMode]}`;
|
|
65
|
+
const currentIndex = DISPLAY_CYCLE.indexOf(displayMode.value);
|
|
66
|
+
const nextMode = DISPLAY_CYCLE[(currentIndex + 1) % DISPLAY_CYCLE.length];
|
|
67
|
+
return `\u5207\u6362\u5C55\u793A\u6A21\u5F0F - \u4E0B\u4E00\u4E2A: ${DISPLAY_MODE_LABELS[nextMode]}`;
|
|
75
68
|
});
|
|
76
69
|
const splitPositionIconTitle = computed(() => {
|
|
77
70
|
const positionLabels = {
|
|
@@ -84,7 +77,7 @@ const __vue_sfc__ = /* @__PURE__ */ _defineComponent({
|
|
|
84
77
|
const nextPosition = splitPosition.value === "right" ? "\u5DE6\u4FA7" : "\u53F3\u4FA7";
|
|
85
78
|
return `\u5207\u6362\u5206\u680F\u4F4D\u7F6E - \u4E0B\u4E00\u4E2A: ${nextPosition}`;
|
|
86
79
|
});
|
|
87
|
-
const __returned__ = { title, sessionListTitle, sessionListCollapsed, selectMode, selectEnabled, theme, resolvedTheme, minimized, promptDockVisible, reviewPanelVisible, reviewPanelEnabled, mode, displayMode, splitPosition, handleToggleSessionList, handleToggleSelectMode, handleToggleTheme, handleToggleDisplayMode, handleToggleSplitPosition, handleClose, handleToggleMinimize, handleTogglePromptDock, handleToggleReviewPanel, handleRefresh, handleCreateSession, isSplitMode, themeIconTitle, themeIconLabel, displayModeIconTitle, displayModeIconLabel, splitPositionIconTitle, splitPositionIconLabel };
|
|
80
|
+
const __returned__ = { title, sessionListTitle, sessionListCollapsed, selectMode, selectEnabled, theme, resolvedTheme, minimized, promptDockVisible, reviewPanelVisible, reviewPanelEnabled, mode, displayMode, splitPosition, handleToggleSessionList, handleToggleSelectMode, handleToggleTheme, handleToggleDisplayMode, handleToggleSplitPosition, handleClose, handleToggleMinimize, handleTogglePromptDock, handleToggleReviewPanel, handleRefresh, handleCreateSession, DISPLAY_MODE_LABELS, DISPLAY_CYCLE, isSplitMode, themeIconTitle, themeIconLabel, displayModeIconTitle, displayModeIconLabel, splitPositionIconTitle, splitPositionIconLabel };
|
|
88
81
|
Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
|
|
89
82
|
return __returned__;
|
|
90
83
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.aipanel-session-list{width:240px;background:var(--ap-bg-secondary);border-right:1px solid var(--ap-border-primary);display:flex;flex-direction:column;flex-shrink:0;transition:width .2s ease}.aipanel-session-list.collapsed{width:0;overflow:hidden}.aipanel-session-list.collapsed .aipanel-session-list-header,.aipanel-session-list.collapsed .aipanel-session-list-content{display:none}.aipanel-session-list-header{padding:16px;border-bottom:1px solid var(--ap-border-primary);display:flex;justify-content:space-between;align-items:center;font-weight:600;font-size:14px;color:var(--ap-text-primary)}.aipanel-new-session-btn{width:28px;height:28px;border-radius:6px;border:none;background:var(--ap-primary);color:#fff;font-size:18px;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:all .2s}.aipanel-new-session-btn:hover{background:var(--ap-primary-hover);transform:scale(1.05)}.aipanel-session-list-content{flex:1;overflow-y:auto;padding:8px;position:relative}.aipanel-session-list-loading-overlay{position:absolute;inset:0;background:var(--ap-overlay-bg);display:flex;align-items:center;justify-content:center;z-index:10;border-radius:8px}.aipanel-loading-spinner.small{width:24px;height:24px;border-width:2px}.aipanel-session-item{padding:12px;border-radius:8px;cursor:pointer;transition:transform .2s;margin-bottom:4px;color:var(--ap-text-primary)}.aipanel-session-item:hover{background:var(--ap-bg-tertiary)}.aipanel-session-item.active{background:var(--ap-primary);color:#fff;transition:none}.aipanel-session-title{font-size:14px;font-weight:500;margin-bottom:4px
|
|
1
|
+
.aipanel-session-list{width:240px;background:var(--ap-bg-secondary);border-right:1px solid var(--ap-border-primary);display:flex;flex-direction:column;flex-shrink:0;transition:width .2s ease}.aipanel-session-list.collapsed{width:0;overflow:hidden}.aipanel-session-list.collapsed .aipanel-session-list-header,.aipanel-session-list.collapsed .aipanel-session-list-content{display:none}.aipanel-session-list-header{padding:16px;border-bottom:1px solid var(--ap-border-primary);display:flex;justify-content:space-between;align-items:center;font-weight:600;font-size:14px;color:var(--ap-text-primary)}.aipanel-new-session-btn{width:28px;height:28px;border-radius:6px;border:none;background:var(--ap-primary);color:#fff;font-size:18px;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:all .2s}.aipanel-new-session-btn:hover{background:var(--ap-primary-hover);transform:scale(1.05)}.aipanel-session-list-content{flex:1;overflow-y:auto;padding:8px;position:relative}.aipanel-session-list-loading-overlay{position:absolute;inset:0;background:var(--ap-overlay-bg);display:flex;align-items:center;justify-content:center;z-index:10;border-radius:8px}.aipanel-loading-spinner.small{width:24px;height:24px;border-width:2px}.aipanel-session-item{padding:12px;border-radius:8px;cursor:pointer;transition:transform .2s;margin-bottom:4px;color:var(--ap-text-primary)}.aipanel-session-item:hover{background:var(--ap-bg-tertiary)}.aipanel-session-item.active{background:var(--ap-primary);color:#fff;transition:none}.aipanel-session-title{display:flex;align-items:center;min-width:0;font-size:14px;font-weight:500;margin-bottom:4px}.aipanel-session-title-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}.aipanel-session-meta{font-size:12px;opacity:.6}.aipanel-session-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:4px}.aipanel-session-delete-btn{width:20px;height:20px;border-radius:4px;border:none;background:transparent;color:var(--ap-text-placeholder);font-size:16px;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:all .2s;opacity:0;flex-shrink:0}.aipanel-session-item:hover .aipanel-session-delete-btn{opacity:1}.aipanel-session-delete-btn:hover{background:var(--ap-danger);color:#fff}.aipanel-session-item.active .aipanel-session-delete-btn{color:#ffffffb3}.aipanel-session-item.active .aipanel-session-delete-btn:hover{background:#fff3;color:#fff}.aipanel-session-header-skeleton{padding:16px;border-bottom:1px solid var(--ap-border-primary);display:none;justify-content:space-between;align-items:center}.aipanel-session-header-skeleton.visible{display:flex}.aipanel-skeleton-header-title{height:18px;width:80px;background:var(--ap-skeleton-gradient);background-size:200% 100%;animation:skeleton-loading 1.5s ease-in-out infinite;border-radius:4px}.aipanel-skeleton-header-btn{width:28px;height:28px;background:var(--ap-skeleton-gradient);background-size:200% 100%;animation:skeleton-loading 1.5s ease-in-out infinite;border-radius:6px}.aipanel-session-skeleton{flex:1;overflow-y:auto;padding:8px;display:none}.aipanel-session-skeleton.visible{display:block}.aipanel-skeleton-item{padding:12px;border-radius:8px;margin-bottom:4px;background:var(--ap-skeleton-bg)}.aipanel-skeleton-title{height:16px;background:var(--ap-skeleton-gradient);background-size:200% 100%;animation:skeleton-loading 1.5s ease-in-out infinite;border-radius:4px;margin-bottom:8px;width:70%}.aipanel-skeleton-meta{height:12px;background:var(--ap-skeleton-gradient);background-size:200% 100%;animation:skeleton-loading 1.5s ease-in-out infinite;border-radius:4px;width:50%}.aipanel-session-empty{padding:32px 16px;text-align:center;color:var(--ap-text-placeholder);font-size:13px}.aipanel-session-state{position:relative;flex:0 0 auto;width:10px;height:10px;margin-right:6px}.aipanel-session-state-pending:before,.aipanel-session-state-completed:before{content:"";position:absolute;inset:0;border-radius:50%;background:currentColor;opacity:.1}.aipanel-session-state-pending:after,.aipanel-session-state-completed:after{content:"";position:absolute;inset:20%;border-radius:50%;background:currentColor}.aipanel-session-state-pending{color:var(--ap-state-pending)}.aipanel-session-state-completed{color:var(--ap-state-completed)}.aipanel-session-state-ongoing{color:var(--ap-state-ongoing)}.aipanel-session-ongoing-cell{fill:currentColor;opacity:.15;animation:aipanel-ongoing-chase 1s infinite}@keyframes aipanel-ongoing-chase{0%,12.4%{opacity:1}12.5%,24.9%{opacity:.6}25%,37.4%{opacity:.35}37.5%,to{opacity:.15}}.aipanel-session-item.active .aipanel-session-state-pending{color:var(--ap-state-pending)}.aipanel-session-item.active .aipanel-session-state-completed{color:var(--ap-state-completed)}.aipanel-session-item.active .aipanel-session-state-ongoing{color:#fffffff2}@keyframes skeleton-loading{0%{background-position:200% 0}to{background-position:-200% 0}}
|
|
@@ -31,20 +31,61 @@ const __vue_sfc__ = /* @__PURE__ */ _defineComponent({
|
|
|
31
31
|
if (showSessionListSkeleton.value) return true;
|
|
32
32
|
return false;
|
|
33
33
|
});
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
const ONGOING_CELLS = [
|
|
35
|
+
{ x: 0, y: 0, delay: "-1000ms" },
|
|
36
|
+
{ x: 4, y: 0, delay: "-875ms" },
|
|
37
|
+
{ x: 8, y: 0, delay: "-750ms" },
|
|
38
|
+
{ x: 8, y: 4, delay: "-625ms" },
|
|
39
|
+
{ x: 8, y: 8, delay: "-500ms" },
|
|
40
|
+
{ x: 4, y: 8, delay: "-375ms" },
|
|
41
|
+
{ x: 0, y: 8, delay: "-250ms" },
|
|
42
|
+
{ x: 0, y: 4, delay: "-125ms" }
|
|
43
|
+
];
|
|
44
|
+
const PENDING_LABELS = {
|
|
45
|
+
approval: "\u7B49\u5F85\u5BA1\u6279",
|
|
46
|
+
"plan-review": "\u7B49\u5F85\u8BA1\u5212\u786E\u8BA4",
|
|
47
|
+
question: "\u7B49\u5F85\u56DE\u590D"
|
|
48
|
+
};
|
|
49
|
+
function runningLabel(sessionId) {
|
|
50
|
+
const n = sessionStates?.value?.[sessionId]?.subagentsRunning ?? 0;
|
|
51
|
+
return n > 0 ? "\u5B50\u4EE3\u7406\u8FD0\u884C\u4E2D (" + n + ")" : "\u8FD0\u884C\u4E2D";
|
|
52
|
+
}
|
|
53
|
+
function sessionRowStatus(sessionId) {
|
|
54
|
+
const state = sessionStates?.value?.[sessionId];
|
|
55
|
+
if (!state) return "idle";
|
|
56
|
+
if (state.hasPending) return "pending";
|
|
57
|
+
const subagentsRunning = (state.subagentsRunning ?? 0) > 0;
|
|
58
|
+
if (subagentsRunning) return "running";
|
|
59
|
+
if (state.thinking) return "thinking";
|
|
60
|
+
const running = state.statusType === "running" || state.statusType === "streaming";
|
|
61
|
+
if (running) return "running";
|
|
62
|
+
if (state.completed) return "completed";
|
|
63
|
+
return "idle";
|
|
64
|
+
}
|
|
65
|
+
function pendingLabel(sessionId) {
|
|
66
|
+
const kind = sessionStates?.value?.[sessionId]?.pendingKind;
|
|
67
|
+
return kind && PENDING_LABELS[kind] || "\u7B49\u5F85\u7528\u6237";
|
|
68
|
+
}
|
|
69
|
+
function isSessionActive(sessionId) {
|
|
70
|
+
const status = sessionRowStatus(sessionId);
|
|
71
|
+
return status === "thinking" || status === "running";
|
|
72
|
+
}
|
|
73
|
+
function isSessionPending(sessionId) {
|
|
74
|
+
return sessionRowStatus(sessionId) === "pending";
|
|
75
|
+
}
|
|
76
|
+
function isSessionCompleted(sessionId) {
|
|
77
|
+
return sessionRowStatus(sessionId) === "completed";
|
|
37
78
|
}
|
|
38
79
|
const __returned__ = { collapsed, sessions, loadingSessionList, showSessionListSkeleton, handleCreateSession, handleSelectSession, handleDeleteSession, sessionKey, sessionStates, isAnimating, get animTimer() {
|
|
39
80
|
return animTimer;
|
|
40
81
|
}, set animTimer(v) {
|
|
41
82
|
animTimer = v;
|
|
42
|
-
}, showSkeleton,
|
|
83
|
+
}, showSkeleton, ONGOING_CELLS, PENDING_LABELS, runningLabel, sessionRowStatus, pendingLabel, isSessionActive, isSessionPending, isSessionCompleted };
|
|
43
84
|
Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
|
|
44
85
|
return __returned__;
|
|
45
86
|
}
|
|
46
87
|
});
|
|
47
|
-
import { createCommentVNode as _createCommentVNode, createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, Fragment as _Fragment, renderList as _renderList,
|
|
88
|
+
import { createCommentVNode as _createCommentVNode, createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, Fragment as _Fragment, renderList as _renderList, normalizeStyle as _normalizeStyle, toDisplayString as _toDisplayString, withModifiers as _withModifiers, normalizeClass as _normalizeClass, renderSlot as _renderSlot } from "vue";
|
|
48
89
|
const _hoisted_1 = {
|
|
49
90
|
key: 0,
|
|
50
91
|
class: "aipanel-session-list-header"
|
|
@@ -65,12 +106,17 @@ const _hoisted_4 = {
|
|
|
65
106
|
const _hoisted_5 = ["aria-selected", "onClick"];
|
|
66
107
|
const _hoisted_6 = { class: "aipanel-session-header" };
|
|
67
108
|
const _hoisted_7 = { class: "aipanel-session-title" };
|
|
68
|
-
const _hoisted_8 =
|
|
69
|
-
|
|
70
|
-
|
|
109
|
+
const _hoisted_8 = ["title"];
|
|
110
|
+
const _hoisted_9 = ["title"];
|
|
111
|
+
const _hoisted_10 = ["x", "y"];
|
|
112
|
+
const _hoisted_11 = {
|
|
113
|
+
key: 2,
|
|
114
|
+
class: "aipanel-session-state aipanel-session-state-completed",
|
|
115
|
+
title: "\u5DF2\u5B8C\u6210"
|
|
71
116
|
};
|
|
72
|
-
const
|
|
73
|
-
const
|
|
117
|
+
const _hoisted_12 = { class: "aipanel-session-title-text" };
|
|
118
|
+
const _hoisted_13 = ["aria-label", "onClick"];
|
|
119
|
+
const _hoisted_14 = { class: "aipanel-session-meta" };
|
|
74
120
|
function __vue_render__(_ctx, _cache, $props, $setup, $data, $options) {
|
|
75
121
|
return _openBlock(), _createElementBlock(
|
|
76
122
|
"div",
|
|
@@ -163,16 +209,49 @@ function __vue_render__(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
163
209
|
_renderList($setup.sessions, (item) => {
|
|
164
210
|
return _openBlock(), _createElementBlock("div", {
|
|
165
211
|
key: item[$setup.sessionKey],
|
|
166
|
-
class: _normalizeClass(["aipanel-session-item", { active: item.active, thinking: $setup.
|
|
212
|
+
class: _normalizeClass(["aipanel-session-item", { active: item.active, thinking: $setup.isSessionActive(item.id) }]),
|
|
167
213
|
role: "option",
|
|
168
214
|
"aria-selected": item.active,
|
|
169
215
|
onClick: ($event) => $setup.handleSelectSession(item)
|
|
170
216
|
}, [
|
|
171
217
|
_createElementVNode("div", _hoisted_6, [
|
|
172
218
|
_createElementVNode("div", _hoisted_7, [
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
219
|
+
_createCommentVNode(" \u72B6\u6001\u6307\u793A\uFF1Apending=\u7425\u73C0\u70B9 > \u6D3B\u8DC3(thinking/running/\u5B50\u4EE3\u7406)=\u8F6C\u5708 > completed=\u7EFF\u70B9 > idle "),
|
|
220
|
+
$setup.isSessionPending(item.id) ? (_openBlock(), _createElementBlock("span", {
|
|
221
|
+
key: 0,
|
|
222
|
+
class: "aipanel-session-state aipanel-session-state-pending",
|
|
223
|
+
title: $setup.pendingLabel(item.id)
|
|
224
|
+
}, null, 8, _hoisted_8)) : $setup.isSessionActive(item.id) ? (_openBlock(), _createElementBlock("svg", {
|
|
225
|
+
key: 1,
|
|
226
|
+
class: "aipanel-session-state aipanel-session-state-ongoing",
|
|
227
|
+
title: $setup.runningLabel(item.id),
|
|
228
|
+
viewBox: "0 0 10 10",
|
|
229
|
+
width: "10",
|
|
230
|
+
height: "10",
|
|
231
|
+
"aria-hidden": "true"
|
|
232
|
+
}, [
|
|
233
|
+
(_openBlock(), _createElementBlock(
|
|
234
|
+
_Fragment,
|
|
235
|
+
null,
|
|
236
|
+
_renderList($setup.ONGOING_CELLS, (c) => {
|
|
237
|
+
return _createElementVNode("rect", {
|
|
238
|
+
key: c.x + "-" + c.y,
|
|
239
|
+
x: c.x,
|
|
240
|
+
y: c.y,
|
|
241
|
+
width: "2",
|
|
242
|
+
height: "2",
|
|
243
|
+
style: _normalizeStyle({ animationDelay: c.delay }),
|
|
244
|
+
class: "aipanel-session-ongoing-cell"
|
|
245
|
+
}, null, 12, _hoisted_10);
|
|
246
|
+
}),
|
|
247
|
+
64
|
|
248
|
+
/* STABLE_FRAGMENT */
|
|
249
|
+
))
|
|
250
|
+
], 8, _hoisted_9)) : $setup.isSessionCompleted(item.id) ? (_openBlock(), _createElementBlock("span", _hoisted_11)) : _createCommentVNode("v-if", true),
|
|
251
|
+
_createElementVNode(
|
|
252
|
+
"span",
|
|
253
|
+
_hoisted_12,
|
|
254
|
+
_toDisplayString(item.title),
|
|
176
255
|
1
|
|
177
256
|
/* TEXT */
|
|
178
257
|
)
|
|
@@ -182,11 +261,11 @@ function __vue_render__(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
182
261
|
type: "button",
|
|
183
262
|
"aria-label": `\u5220\u9664\u4F1A\u8BDD: ${item.title}`,
|
|
184
263
|
onClick: _withModifiers(($event) => $setup.handleDeleteSession(item), ["stop"])
|
|
185
|
-
}, " \xD7 ", 8,
|
|
264
|
+
}, " \xD7 ", 8, _hoisted_13)
|
|
186
265
|
]),
|
|
187
266
|
_createElementVNode(
|
|
188
267
|
"div",
|
|
189
|
-
|
|
268
|
+
_hoisted_14,
|
|
190
269
|
_toDisplayString(item.meta),
|
|
191
270
|
1
|
|
192
271
|
/* TEXT */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.aipanel-widget{--ap-bg-main: #ffffff;--ap-bg-secondary: #f8f9fa;--ap-bg-tertiary: #f3f4f6;--ap-overlay-bg: rgba(255, 255, 255, .9);--ap-bg-inverse: #1e1e1e;--ap-text-primary: #282828;--ap-text-secondary: #4b5563;--ap-text-tertiary: #6b7280;--ap-text-placeholder: #9ca3af;--ap-text-inverse: #ffffff;--ap-border-primary: #e5e7eb;--ap-border-secondary: #d1d5db;--ap-primary: #3b82f6;--ap-primary-hover: #2563eb;--ap-primary-bg: rgba(59, 130, 246, .1);--ap-danger: #ef4444;--ap-danger-hover: #dc2626;--ap-danger-active: #b91c1c;--ap-success: #10b981;--ap-overlay: rgba(0, 0, 0, .5);--ap-tooltip-bg: #1e1e1e;--ap-dialog-overlay: rgba(0, 0, 0, .5);--ap-thinking-gradient-1: #10b981;--ap-thinking-gradient-2: #059669;--ap-thinking-glow: rgba(16, 185, 129, .3);--ap-thinking-glow-strong: rgba(16, 185, 129, .6);--ap-skeleton-bg: #e5e7eb;--ap-skeleton-gradient: linear-gradient(90deg, #e5e7eb 25%, #f3f4f6 50%, #e5e7eb 75%);--ap-shadow-sm: 0 2px 4px rgba(0, 0, 0, .1);--ap-shadow-md: 0 4px 12px rgba(0, 0, 0, .15);--ap-shadow-lg: 0 8px 32px rgba(0, 0, 0, .12);--ap-shadow-xl: 0 20px 60px rgba(0, 0, 0, .3);--ap-shadow-primary: 0 2px 4px rgba(59, 130, 246, .2);--ap-shadow-primary-hover: 0 4px 6px rgba(59, 130, 246, .3);--ap-shadow-danger: 0 4px 12px rgba(239, 68, 68, .3);--ap-trigger-bg: #3b82f6;--ap-trigger-bg-hover: #2563eb;--ap-trigger-bg-active: #1d4ed8;--ap-trigger-shadow: 0 2px 8px rgba(59, 130, 246, .3);--ap-trigger-shadow-hover: 0 4px 12px rgba(59, 130, 246, .4);--ap-trigger-shadow-active: 0 4px 12px rgba(59, 130, 246, .5);position:fixed;z-index:999999;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif}.aipanel-widget.aipanel-theme-dark{--ap-bg-main: #1a1a1a;--ap-bg-secondary: #1e1e1e;--ap-bg-tertiary: #282828;--ap-overlay-bg: rgba(26, 26, 26, .9);--ap-bg-inverse: #ffffff;--ap-text-primary: #f3f4f6;--ap-text-secondary: #d1d5db;--ap-text-tertiary: #9ca3af;--ap-text-placeholder: #6b7280;--ap-text-inverse: #282828;--ap-border-primary: #282828;--ap-border-secondary: #4b5563;--ap-primary: #3b82f6;--ap-primary-hover: #2563eb;--ap-primary-bg: rgba(59, 130, 246, .15);--ap-danger: #ef4444;--ap-danger-hover: #dc2626;--ap-danger-active: #b91c1c;--ap-success: #10b981;--ap-overlay: rgba(26, 26, 26, .9);--ap-tooltip-bg: #282828;--ap-dialog-overlay: rgba(0, 0, 0, .7);--ap-thinking-gradient-1: #34d399;--ap-thinking-gradient-2: #10b981;--ap-thinking-glow: rgba(52, 211, 153, .3);--ap-thinking-glow-strong: rgba(52, 211, 153, .6);--ap-skeleton-bg: #151515;--ap-skeleton-gradient: linear-gradient(90deg, #282828 25%, #4b5563 50%, #282828 75%);--ap-shadow-sm: 0 2px 4px rgba(0, 0, 0, .3);--ap-shadow-md: 0 4px 12px rgba(0, 0, 0, .4);--ap-shadow-lg: 0 8px 32px rgba(0, 0, 0, .4);--ap-shadow-xl: 0 20px 60px rgba(0, 0, 0, .6);--ap-shadow-primary: 0 2px 4px rgba(59, 130, 246, .3);--ap-shadow-primary-hover: 0 4px 6px rgba(59, 130, 246, .4);--ap-shadow-danger: 0 4px 12px rgba(239, 68, 68, .4);--ap-trigger-bg: #60a5fa;--ap-trigger-bg-hover: #3b82f6;--ap-trigger-bg-active: #2563eb;--ap-trigger-shadow: 0 2px 8px rgba(96, 165, 250, .4);--ap-trigger-shadow-hover: 0 4px 12px rgba(96, 165, 250, .5);--ap-trigger-shadow-active: 0 4px 12px rgba(96, 165, 250, .6)}.aipanel-chat{position:fixed;bottom:20px;width:700px;height:86vh;max-height:calc(100vh - 40px);background:var(--ap-bg-main);border-radius:16px;box-shadow:var(--ap-shadow-lg);overflow:hidden;opacity:0;visibility:hidden;transform:translate3d(var(---chatAnimationOrigin\.x),var(---chatAnimationOrigin\.y),0) scale(.95);transition:all .3s ease;display:flex;flex-direction:column;z-index:99999}.aipanel-chat.open{opacity:1;visibility:visible;transform:translateZ(0) scale(1)}.aipanel-chat.no-transition,.aipanel-chat.no-transition.open{transition:none!important}.aipanel-chat.minimized{width:320px;height:320px}.aipanel-chat.minimized .aipanel-iframe-container{margin-top:-146px}.aipanel-chat-content{display:flex;flex:1;overflow:hidden}.aipanel-notification{position:absolute;top:20px;left:50%;transform:translate(-50%);padding:12px 24px;background:linear-gradient(135deg,#3b82f6,#2563eb);color:#fff;border-radius:10px;font-size:14px;font-weight:500;box-shadow:0 4px 16px #3b82f666,0 0 0 2px #3b82f633;animation:slideDown .3s ease;z-index:10000000;display:flex;align-items:center;gap:10px}.aipanel-notification:before{content:"\1f4a1";font-size:16px}.aipanel-dialog-overlay{position:fixed;inset:0;background:var(--ap-dialog-overlay);display:flex;align-items:center;justify-content:center;z-index:9999999;animation:fadeIn .2s ease}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}.aipanel-dialog{background:var(--ap-bg-main);border-radius:12px;padding:24px;min-width:320px;max-width:400px;box-shadow:var(--ap-shadow-xl);animation:scaleIn .2s ease}@keyframes scaleIn{0%{transform:scale(.9);opacity:0}to{transform:scale(1);opacity:1}}.aipanel-dialog-content{margin-bottom:20px}.aipanel-dialog-message{font-size:15px;color:var(--ap-text-primary);line-height:1.5}.aipanel-dialog-actions{display:flex;gap:12px;justify-content:flex-end}.aipanel-dialog-btn{padding:10px 20px;border-radius:8px;border:none;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s}.aipanel-dialog-btn.cancel{background:var(--ap-bg-tertiary);color:var(--ap-text-primary)}.aipanel-dialog-btn.cancel:hover{background:var(--ap-text-primary);color:var(--ap-bg-main)}.aipanel-dialog-btn.confirm{background:var(--ap-danger);color:#fff}.aipanel-dialog-btn.confirm:hover{background:var(--ap-danger-hover)}@keyframes slideDown{0%{transform:translate(-50%) translateY(-100%);opacity:0}to{transform:translate(-50%) translateY(0);opacity:1}}.aipanel-page-notification{position:fixed;top:20px;left:50%;transform:translate(-50%);padding:12px 24px;background:linear-gradient(135deg,#3b82f6,#2563eb);color:#fff;border-radius:10px;font-size:14px;font-weight:500;box-shadow:0 4px 16px #3b82f666,0 0 0 2px #3b82f633;animation:slideDown .3s ease;z-index:2147483647;display:flex;align-items:center;gap:10px;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif}.aipanel-page-notification:before{content:"\1f4a1";font-size:16px}.aipanel-element-highlight{position:fixed;pointer-events:none;z-index:999998;border-radius:4px}#vue-inspector-container{display:none!important}.aipanel-element-tooltip{position:fixed;background:var(--ap-tooltip-bg);color:#fff;padding:8px 12px;border-radius:6px;font-size:12px;z-index:9999998;box-shadow:var(--ap-shadow-md);max-width:300px;pointer-events:none;line-height:1}.aipanel-tooltip-tag{font-weight:500;margin-bottom:4px;word-break:break-all}.aipanel-tooltip-file{font-size:11px;color:var(--ap-text-placeholder);word-break:break-all}.aipanel-element-highlight-temp{position:absolute;pointer-events:none;z-index:999998;border-radius:4px;animation:highlight-pulse 2s ease-out forwards}@keyframes highlight-pulse{0%{opacity:1;transform:scale(1)}50%{opacity:.8;transform:scale(1.02)}to{opacity:0;transform:scale(1)}}@media(max-width:768px){.aipanel-chat{width:calc(100vw - 40px);height:calc(100vh - 100px)}}body.has-aipanel-split{transition:padding .3s ease;min-width:auto}body.has-aipanel-split-right{padding-right:var(--aipanel-split-width, 500px)}body.has-aipanel-split-left{padding-left:var(--aipanel-split-width, 500px)}.aipanel-widget.extension-mode{position:relative;width:100%;height:100%;display:flex}.aipanel-widget.extension-mode .aipanel-select-mode-hint,.aipanel-widget.extension-mode .aipanel-dialog-overlay{position:absolute}
|
|
1
|
+
.aipanel-widget{--ap-bg-main: #ffffff;--ap-bg-secondary: #f8f9fa;--ap-bg-tertiary: #f3f4f6;--ap-overlay-bg: rgba(255, 255, 255, .9);--ap-bg-inverse: #1e1e1e;--ap-text-primary: #282828;--ap-text-secondary: #4b5563;--ap-text-tertiary: #6b7280;--ap-text-placeholder: #9ca3af;--ap-text-inverse: #ffffff;--ap-border-primary: #e5e7eb;--ap-border-secondary: #d1d5db;--ap-primary: #3b82f6;--ap-primary-hover: #2563eb;--ap-primary-bg: rgba(59, 130, 246, .1);--ap-danger: #ef4444;--ap-danger-hover: #dc2626;--ap-danger-active: #b91c1c;--ap-success: #10b981;--ap-state-pending: #f59e0b;--ap-state-completed: #22c55e;--ap-state-ongoing: #5686fe;--ap-overlay: rgba(0, 0, 0, .5);--ap-tooltip-bg: #1e1e1e;--ap-dialog-overlay: rgba(0, 0, 0, .5);--ap-thinking-gradient-1: #10b981;--ap-thinking-gradient-2: #059669;--ap-thinking-glow: rgba(16, 185, 129, .3);--ap-thinking-glow-strong: rgba(16, 185, 129, .6);--ap-skeleton-bg: #e5e7eb;--ap-skeleton-gradient: linear-gradient(90deg, #e5e7eb 25%, #f3f4f6 50%, #e5e7eb 75%);--ap-shadow-sm: 0 2px 4px rgba(0, 0, 0, .1);--ap-shadow-md: 0 4px 12px rgba(0, 0, 0, .15);--ap-shadow-lg: 0 8px 32px rgba(0, 0, 0, .12);--ap-shadow-xl: 0 20px 60px rgba(0, 0, 0, .3);--ap-shadow-primary: 0 2px 4px rgba(59, 130, 246, .2);--ap-shadow-primary-hover: 0 4px 6px rgba(59, 130, 246, .3);--ap-shadow-danger: 0 4px 12px rgba(239, 68, 68, .3);--ap-trigger-bg: #3b82f6;--ap-trigger-bg-hover: #2563eb;--ap-trigger-bg-active: #1d4ed8;--ap-trigger-shadow: 0 2px 8px rgba(59, 130, 246, .3);--ap-trigger-shadow-hover: 0 4px 12px rgba(59, 130, 246, .4);--ap-trigger-shadow-active: 0 4px 12px rgba(59, 130, 246, .5);position:fixed;z-index:999999;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif}.aipanel-widget.aipanel-theme-dark{--ap-bg-main: #1a1a1a;--ap-bg-secondary: #1e1e1e;--ap-bg-tertiary: #282828;--ap-overlay-bg: rgba(26, 26, 26, .9);--ap-bg-inverse: #ffffff;--ap-text-primary: #f3f4f6;--ap-text-secondary: #d1d5db;--ap-text-tertiary: #9ca3af;--ap-text-placeholder: #6b7280;--ap-text-inverse: #282828;--ap-border-primary: #282828;--ap-border-secondary: #4b5563;--ap-primary: #3b82f6;--ap-primary-hover: #2563eb;--ap-primary-bg: rgba(59, 130, 246, .15);--ap-danger: #ef4444;--ap-danger-hover: #dc2626;--ap-danger-active: #b91c1c;--ap-success: #10b981;--ap-state-pending: #fbbf24;--ap-state-completed: #22c55e;--ap-state-ongoing: #5686fe;--ap-overlay: rgba(26, 26, 26, .9);--ap-tooltip-bg: #282828;--ap-dialog-overlay: rgba(0, 0, 0, .7);--ap-thinking-gradient-1: #34d399;--ap-thinking-gradient-2: #10b981;--ap-thinking-glow: rgba(52, 211, 153, .3);--ap-thinking-glow-strong: rgba(52, 211, 153, .6);--ap-skeleton-bg: #151515;--ap-skeleton-gradient: linear-gradient(90deg, #282828 25%, #4b5563 50%, #282828 75%);--ap-shadow-sm: 0 2px 4px rgba(0, 0, 0, .3);--ap-shadow-md: 0 4px 12px rgba(0, 0, 0, .4);--ap-shadow-lg: 0 8px 32px rgba(0, 0, 0, .4);--ap-shadow-xl: 0 20px 60px rgba(0, 0, 0, .6);--ap-shadow-primary: 0 2px 4px rgba(59, 130, 246, .3);--ap-shadow-primary-hover: 0 4px 6px rgba(59, 130, 246, .4);--ap-shadow-danger: 0 4px 12px rgba(239, 68, 68, .4);--ap-trigger-bg: #60a5fa;--ap-trigger-bg-hover: #3b82f6;--ap-trigger-bg-active: #2563eb;--ap-trigger-shadow: 0 2px 8px rgba(96, 165, 250, .4);--ap-trigger-shadow-hover: 0 4px 12px rgba(96, 165, 250, .5);--ap-trigger-shadow-active: 0 4px 12px rgba(96, 165, 250, .6)}.aipanel-chat{position:fixed;bottom:20px;width:700px;height:86vh;max-height:calc(100vh - 40px);background:var(--ap-bg-main);border-radius:16px;box-shadow:var(--ap-shadow-lg);overflow:hidden;opacity:0;visibility:hidden;transform:translate3d(var(---chatAnimationOrigin\.x),var(---chatAnimationOrigin\.y),0) scale(.95);transition:all .3s ease;display:flex;flex-direction:column;z-index:99999}.aipanel-chat.open{opacity:1;visibility:visible;transform:translateZ(0) scale(1)}.aipanel-chat.no-transition,.aipanel-chat.no-transition.open{transition:none!important}.aipanel-chat.minimized{width:320px;height:320px}.aipanel-chat.minimized .aipanel-iframe-container{margin-top:-146px}.aipanel-chat-content{display:flex;flex:1;overflow:hidden}.aipanel-notification{position:absolute;top:20px;left:50%;transform:translate(-50%);padding:12px 24px;background:linear-gradient(135deg,#3b82f6,#2563eb);color:#fff;border-radius:10px;font-size:14px;font-weight:500;box-shadow:0 4px 16px #3b82f666,0 0 0 2px #3b82f633;animation:slideDown .3s ease;z-index:10000000;display:flex;align-items:center;gap:10px}.aipanel-notification:before{content:"\1f4a1";font-size:16px}.aipanel-dialog-overlay{position:fixed;inset:0;background:var(--ap-dialog-overlay);display:flex;align-items:center;justify-content:center;z-index:9999999;animation:fadeIn .2s ease}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}.aipanel-dialog{background:var(--ap-bg-main);border-radius:12px;padding:24px;min-width:320px;max-width:400px;box-shadow:var(--ap-shadow-xl);animation:scaleIn .2s ease}@keyframes scaleIn{0%{transform:scale(.9);opacity:0}to{transform:scale(1);opacity:1}}.aipanel-dialog-content{margin-bottom:20px}.aipanel-dialog-message{font-size:15px;color:var(--ap-text-primary);line-height:1.5}.aipanel-dialog-actions{display:flex;gap:12px;justify-content:flex-end}.aipanel-dialog-btn{padding:10px 20px;border-radius:8px;border:none;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s}.aipanel-dialog-btn.cancel{background:var(--ap-bg-tertiary);color:var(--ap-text-primary)}.aipanel-dialog-btn.cancel:hover{background:var(--ap-text-primary);color:var(--ap-bg-main)}.aipanel-dialog-btn.confirm{background:var(--ap-danger);color:#fff}.aipanel-dialog-btn.confirm:hover{background:var(--ap-danger-hover)}@keyframes slideDown{0%{transform:translate(-50%) translateY(-100%);opacity:0}to{transform:translate(-50%) translateY(0);opacity:1}}.aipanel-page-notification{position:fixed;top:20px;left:50%;transform:translate(-50%);padding:12px 24px;background:linear-gradient(135deg,#3b82f6,#2563eb);color:#fff;border-radius:10px;font-size:14px;font-weight:500;box-shadow:0 4px 16px #3b82f666,0 0 0 2px #3b82f633;animation:slideDown .3s ease;z-index:2147483647;display:flex;align-items:center;gap:10px;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif}.aipanel-page-notification:before{content:"\1f4a1";font-size:16px}.aipanel-element-highlight{position:fixed;pointer-events:none;z-index:999998;border-radius:4px}#vue-inspector-container{display:none!important}.aipanel-element-tooltip{position:fixed;background:var(--ap-tooltip-bg);color:#fff;padding:8px 12px;border-radius:6px;font-size:12px;z-index:9999998;box-shadow:var(--ap-shadow-md);max-width:300px;pointer-events:none;line-height:1}.aipanel-tooltip-tag{font-weight:500;margin-bottom:4px;word-break:break-all}.aipanel-tooltip-file{font-size:11px;color:var(--ap-text-placeholder);word-break:break-all}.aipanel-element-highlight-temp{position:absolute;pointer-events:none;z-index:999998;border-radius:4px;animation:highlight-pulse 2s ease-out forwards}@keyframes highlight-pulse{0%{opacity:1;transform:scale(1)}50%{opacity:.8;transform:scale(1.02)}to{opacity:0;transform:scale(1)}}@media(max-width:768px){.aipanel-chat{width:calc(100vw - 40px);height:calc(100vh - 100px)}}body.has-aipanel-split{transition:padding .3s ease;min-width:auto}body.has-aipanel-split-right{padding-right:var(--aipanel-split-width, 500px)}body.has-aipanel-split-left{padding-left:var(--aipanel-split-width, 500px)}.aipanel-widget.extension-mode{position:relative;width:100%;height:100%;display:flex}.aipanel-widget.extension-mode .aipanel-select-mode-hint,.aipanel-widget.extension-mode .aipanel-dialog-overlay{position:absolute}
|
|
@@ -47,8 +47,8 @@ declare const __VLS_base: import("vue").DefineComponent<AIPanelWidgetProps, {
|
|
|
47
47
|
displayMode: import("@aipanel/core").DisplayMode;
|
|
48
48
|
showSessionListSkeleton: boolean;
|
|
49
49
|
sessionKey: string;
|
|
50
|
-
sessions: import("@aipanel/core").AIPanelWidgetSession[];
|
|
51
50
|
thinking: boolean;
|
|
51
|
+
sessions: import("@aipanel/core").AIPanelWidgetSession[];
|
|
52
52
|
showClearAll: boolean;
|
|
53
53
|
open: boolean;
|
|
54
54
|
selectShortcutLabel: string;
|
|
@@ -11,7 +11,7 @@ import { useInspector } from "../composables/use-inspector.mjs";
|
|
|
11
11
|
import { usePersistState } from "../composables/use-persist-state.mjs";
|
|
12
12
|
import { useSplitMode } from "../composables/use-split.mjs";
|
|
13
13
|
import { provideAIPanelWidgetContext } from "./context.mjs";
|
|
14
|
-
import { WIDGET_MSG } from "@aipanel/core";
|
|
14
|
+
import { NOTIFICATION_DURATION, WIDGET_MSG } from "@aipanel/core";
|
|
15
15
|
const __vue_sfc__ = /* @__PURE__ */ _defineComponent({
|
|
16
16
|
...{
|
|
17
17
|
name: "AIPanelWidget"
|
|
@@ -61,7 +61,7 @@ const __vue_sfc__ = /* @__PURE__ */ _defineComponent({
|
|
|
61
61
|
const notificationMode = ref("widget");
|
|
62
62
|
let notificationTimer = null;
|
|
63
63
|
const showNotification = (message, options) => {
|
|
64
|
-
const { duration =
|
|
64
|
+
const { duration = NOTIFICATION_DURATION, mode = "widget" } = options || {};
|
|
65
65
|
notificationMessage.value = message;
|
|
66
66
|
notificationVisible.value = true;
|
|
67
67
|
notificationMode.value = mode;
|
|
@@ -95,9 +95,7 @@ const __vue_sfc__ = /* @__PURE__ */ _defineComponent({
|
|
|
95
95
|
};
|
|
96
96
|
const localSessionListCollapsed = ref(props.sessionListCollapsed);
|
|
97
97
|
const localDisplayMode = ref(props.displayMode);
|
|
98
|
-
const localSplitPosition = ref(
|
|
99
|
-
props.splitMode?.position ?? "right"
|
|
100
|
-
);
|
|
98
|
+
const localSplitPosition = ref(props.splitMode?.position ?? "right");
|
|
101
99
|
const minimized = ref(false);
|
|
102
100
|
const promptDockVisible = ref(true);
|
|
103
101
|
const reviewPanelVisible = ref(false);
|
|
@@ -136,7 +134,8 @@ const __vue_sfc__ = /* @__PURE__ */ _defineComponent({
|
|
|
136
134
|
}
|
|
137
135
|
);
|
|
138
136
|
const handleToggleDisplayMode = () => {
|
|
139
|
-
if (localDisplayMode.value === "extension" || localDisplayMode.value === "extension-selector")
|
|
137
|
+
if (localDisplayMode.value === "extension" || localDisplayMode.value === "extension-selector")
|
|
138
|
+
return;
|
|
140
139
|
const modes = ["bubble", "split", "auto"];
|
|
141
140
|
const currentIndex = modes.indexOf(localDisplayMode.value);
|
|
142
141
|
const nextIndex = (currentIndex + 1) % modes.length;
|
|
@@ -397,7 +396,10 @@ const __vue_sfc__ = /* @__PURE__ */ _defineComponent({
|
|
|
397
396
|
const gap = 24;
|
|
398
397
|
const bubbleSize = 44;
|
|
399
398
|
const screenMargin = 20;
|
|
400
|
-
const effectiveOffset = triggerRef.value?.offset ?? bubbleOffset.value ?? {
|
|
399
|
+
const effectiveOffset = triggerRef.value?.offset ?? bubbleOffset.value ?? {
|
|
400
|
+
x: windowWidth.value - bubbleSize - gap,
|
|
401
|
+
y: windowHeight.value - bubbleSize - gap
|
|
402
|
+
};
|
|
401
403
|
const style = {};
|
|
402
404
|
if (isBubbleOnRightSide.value) {
|
|
403
405
|
let rightPos = windowWidth.value - effectiveOffset.x + gap;
|
|
@@ -746,11 +748,11 @@ function __vue_render__(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
746
748
|
_createElementVNode("button", {
|
|
747
749
|
class: "aipanel-dialog-btn cancel",
|
|
748
750
|
onClick: $setup.handleDialogCancel
|
|
749
|
-
}, "\u53D6\u6D88"),
|
|
751
|
+
}, " \u53D6\u6D88 "),
|
|
750
752
|
_createElementVNode("button", {
|
|
751
753
|
class: "aipanel-dialog-btn confirm",
|
|
752
754
|
onClick: $setup.handleDialogConfirm
|
|
753
|
-
}, "\u786E\u8BA4")
|
|
755
|
+
}, " \u786E\u8BA4 ")
|
|
754
756
|
])
|
|
755
757
|
])
|
|
756
758
|
])) : _createCommentVNode("v-if", true),
|
|
@@ -1,2 +1 @@
|
|
|
1
1
|
export type { AIPanelWidgetTheme, AIPanelWidgetSession, AIPanelSelectedElement, AIPanelRemoveSelectedPayload, AIPanelWidgetSessionItem, AIPanelSelectedElementItem, AIPanelWidgetProps, AIPanelWidgetEmits, AIPanelSessionThinkingState, DisplayMode, SplitModeOptions, } from "@aipanel/core";
|
|
2
|
-
export type AIPanelWidgetThemeLocal = "light" | "dark" | "auto";
|
package/es/index.d.ts
CHANGED
package/es/index.mjs
CHANGED
|
@@ -228,7 +228,6 @@ function useInspector(options) {
|
|
|
228
228
|
const tooltipVisible = (0, import_vue.ref)(false);
|
|
229
229
|
const tooltipStyle = (0, import_vue.ref)({ top: "0px", left: "0px" });
|
|
230
230
|
const tooltipContent = (0, import_vue.ref)({ description: "", fileInfo: "" });
|
|
231
|
-
const INSPECTOR_CHECK_INTERVAL = 500;
|
|
232
231
|
let inspectorCheckTimer = null;
|
|
233
232
|
let currentPrimary = "#3b82f6";
|
|
234
233
|
let currentPrimaryBg = "rgba(59, 130, 246, 0.1)";
|
|
@@ -441,7 +440,7 @@ function useInspector(options) {
|
|
|
441
440
|
inspectorCheckTimer = null;
|
|
442
441
|
}
|
|
443
442
|
}
|
|
444
|
-
}, INSPECTOR_CHECK_INTERVAL);
|
|
443
|
+
}, import_core.INSPECTOR_CHECK_INTERVAL);
|
|
445
444
|
}
|
|
446
445
|
});
|
|
447
446
|
(0, import_vue.onUnmounted)(() => {
|
|
@@ -22,27 +22,12 @@ __export(use_persist_state_exports, {
|
|
|
22
22
|
module.exports = __toCommonJS(use_persist_state_exports);
|
|
23
23
|
var import_vue = require("vue");
|
|
24
24
|
var import_client = require("@aipanel/core/client");
|
|
25
|
-
const log = (0, import_client.createLogger)("AIPanelWidget");
|
|
26
25
|
const STORAGE_KEY = "aipanel-widget-state";
|
|
27
26
|
function loadState() {
|
|
28
|
-
|
|
29
|
-
try {
|
|
30
|
-
const stored = localStorage.getItem(STORAGE_KEY);
|
|
31
|
-
if (stored) {
|
|
32
|
-
return JSON.parse(stored);
|
|
33
|
-
}
|
|
34
|
-
} catch (e) {
|
|
35
|
-
log.error("Failed to load persisted state:", { error: e });
|
|
36
|
-
}
|
|
37
|
-
return null;
|
|
27
|
+
return (0, import_client.storageGet)("local", STORAGE_KEY);
|
|
38
28
|
}
|
|
39
29
|
function saveState(state) {
|
|
40
|
-
|
|
41
|
-
try {
|
|
42
|
-
localStorage.setItem(STORAGE_KEY, JSON.stringify(state));
|
|
43
|
-
} catch (e) {
|
|
44
|
-
log.error("Failed to save state:", { error: e });
|
|
45
|
-
}
|
|
30
|
+
(0, import_client.storageSet)("local", STORAGE_KEY, state);
|
|
46
31
|
}
|
|
47
32
|
function usePersistState(options) {
|
|
48
33
|
const restoreState = () => {
|
|
@@ -21,6 +21,21 @@ __export(use_session_exports, {
|
|
|
21
21
|
});
|
|
22
22
|
module.exports = __toCommonJS(use_session_exports);
|
|
23
23
|
var import_vue = require("vue");
|
|
24
|
+
function formatRelativeTime(ts) {
|
|
25
|
+
const time = new Date(ts).getTime();
|
|
26
|
+
if (Number.isNaN(time)) return "";
|
|
27
|
+
const diff = Date.now() - time;
|
|
28
|
+
if (diff < 0) return "\u521A\u521A";
|
|
29
|
+
const minute = 6e4;
|
|
30
|
+
const hour = 60 * minute;
|
|
31
|
+
const day = 24 * hour;
|
|
32
|
+
if (diff < minute) return "\u521A\u521A";
|
|
33
|
+
if (diff < hour) return `${Math.floor(diff / minute)} \u5206\u949F\u524D`;
|
|
34
|
+
if (diff < day) return `${Math.floor(diff / hour)} \u5C0F\u65F6\u524D`;
|
|
35
|
+
if (diff < 7 * day) return `${Math.floor(diff / day)} \u5929\u524D`;
|
|
36
|
+
const date = new Date(time);
|
|
37
|
+
return `${date.toLocaleDateString()} ${date.toLocaleTimeString()}`;
|
|
38
|
+
}
|
|
24
39
|
function formatSessionMeta(session) {
|
|
25
40
|
if (session.meta) {
|
|
26
41
|
return session.meta;
|
|
@@ -28,11 +43,7 @@ function formatSessionMeta(session) {
|
|
|
28
43
|
if (!session.updatedAt) {
|
|
29
44
|
return "";
|
|
30
45
|
}
|
|
31
|
-
|
|
32
|
-
if (Number.isNaN(date.getTime())) {
|
|
33
|
-
return "";
|
|
34
|
-
}
|
|
35
|
-
return `${date.toLocaleDateString()} ${date.toLocaleTimeString()}`;
|
|
46
|
+
return formatRelativeTime(session.updatedAt);
|
|
36
47
|
}
|
|
37
48
|
function useSession(options) {
|
|
38
49
|
const sessionItems = (0, import_vue.computed)(
|
|
@@ -21,18 +21,16 @@ __export(use_widget_exports, {
|
|
|
21
21
|
});
|
|
22
22
|
module.exports = __toCommonJS(use_widget_exports);
|
|
23
23
|
var import_vue = require("vue");
|
|
24
|
-
|
|
24
|
+
var import_core = require("@aipanel/core");
|
|
25
|
+
var import_client = require("@aipanel/core/client");
|
|
26
|
+
const THEME_CYCLE = import_core.WIDGET_THEME_MODES;
|
|
25
27
|
function useWidget(options) {
|
|
26
28
|
const systemTheme = (0, import_vue.ref)("light");
|
|
27
|
-
function getSystemTheme() {
|
|
28
|
-
if (typeof window === "undefined") return "light";
|
|
29
|
-
return window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
|
30
|
-
}
|
|
31
29
|
let mediaQuery = null;
|
|
32
30
|
let handleChange = null;
|
|
33
31
|
(0, import_vue.onMounted)(() => {
|
|
34
32
|
if (typeof window === "undefined") return;
|
|
35
|
-
systemTheme.value = getSystemTheme();
|
|
33
|
+
systemTheme.value = (0, import_client.getSystemTheme)();
|
|
36
34
|
mediaQuery = window.matchMedia("(prefers-color-scheme: dark)");
|
|
37
35
|
handleChange = (e) => {
|
|
38
36
|
systemTheme.value = e.matches ? "dark" : "light";
|
|
@@ -44,12 +42,9 @@ function useWidget(options) {
|
|
|
44
42
|
mediaQuery.removeEventListener("change", handleChange);
|
|
45
43
|
}
|
|
46
44
|
});
|
|
47
|
-
const resolvedTheme = (0, import_vue.computed)(
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
}
|
|
51
|
-
return options.theme.value;
|
|
52
|
-
});
|
|
45
|
+
const resolvedTheme = (0, import_vue.computed)(
|
|
46
|
+
() => (0, import_client.resolveWidgetTheme)(options.theme.value, systemTheme.value)
|
|
47
|
+
);
|
|
53
48
|
const containerClasses = (0, import_vue.computed)(() => [
|
|
54
49
|
"aipanel-widget",
|
|
55
50
|
`aipanel-theme-${resolvedTheme.value}`
|
|
@@ -24,6 +24,7 @@ var import_Frame_sfc = require("./Frame-sfc.css");
|
|
|
24
24
|
var import_vue = require("vue");
|
|
25
25
|
var import_vue2 = require("vue");
|
|
26
26
|
var import_context = require("../context.cjs");
|
|
27
|
+
var import_core = require("@aipanel/core");
|
|
27
28
|
var import_vue3 = require("vue");
|
|
28
29
|
const __vue_sfc__ = /* @__PURE__ */ (0, import_vue.defineComponent)({
|
|
29
30
|
__name: "Frame",
|
|
@@ -41,7 +42,7 @@ const __vue_sfc__ = /* @__PURE__ */ (0, import_vue.defineComponent)({
|
|
|
41
42
|
} = (0, import_context.useAIPanelWidgetContext)();
|
|
42
43
|
function sendMessageToIframe(type, data) {
|
|
43
44
|
if (!iframeRef.value?.contentWindow) return;
|
|
44
|
-
iframeRef.value.contentWindow.postMessage(
|
|
45
|
+
iframeRef.value.contentWindow.postMessage((0, import_core.widgetEnvelope)(type, data), "*");
|
|
45
46
|
}
|
|
46
47
|
__expose({
|
|
47
48
|
sendMessageToIframe
|
|
@@ -56,6 +56,14 @@ const __vue_sfc__ = /* @__PURE__ */ (0, import_vue.defineComponent)({
|
|
|
56
56
|
handleRefresh,
|
|
57
57
|
handleCreateSession
|
|
58
58
|
} = (0, import_context.useAIPanelWidgetContext)();
|
|
59
|
+
const DISPLAY_MODE_LABELS = {
|
|
60
|
+
bubble: "\u6C14\u6CE1\u6A21\u5F0F",
|
|
61
|
+
split: "\u5206\u5C4F\u6A21\u5F0F",
|
|
62
|
+
auto: "\u81EA\u52A8\u6A21\u5F0F",
|
|
63
|
+
extension: "\u6269\u5C55\u6A21\u5F0F",
|
|
64
|
+
"extension-selector": "\u6269\u5C55\u9009\u62E9\u5668\u6A21\u5F0F"
|
|
65
|
+
};
|
|
66
|
+
const DISPLAY_CYCLE = ["bubble", "split", "auto"];
|
|
59
67
|
const isSplitMode = (0, import_vue2.computed)(() => mode.value === "split");
|
|
60
68
|
const themeIconTitle = (0, import_vue2.computed)(() => {
|
|
61
69
|
const themeLabels = {
|
|
@@ -74,27 +82,12 @@ const __vue_sfc__ = /* @__PURE__ */ (0, import_vue.defineComponent)({
|
|
|
74
82
|
return `\u5207\u6362\u4E3B\u9898 - \u5F53\u524D: ${themeLabels[theme.value]}`;
|
|
75
83
|
});
|
|
76
84
|
const displayModeIconTitle = (0, import_vue2.computed)(() => {
|
|
77
|
-
|
|
78
|
-
bubble: "\u6C14\u6CE1\u6A21\u5F0F",
|
|
79
|
-
split: "\u5206\u5C4F\u6A21\u5F0F",
|
|
80
|
-
auto: "\u81EA\u52A8\u6A21\u5F0F",
|
|
81
|
-
extension: "\u6269\u5C55\u6A21\u5F0F",
|
|
82
|
-
"extension-selector": "\u6269\u5C55\u9009\u62E9\u5668\u6A21\u5F0F"
|
|
83
|
-
};
|
|
84
|
-
return `\u5C55\u793A\u6A21\u5F0F: ${displayModeLabels[displayMode.value]}`;
|
|
85
|
+
return `\u5C55\u793A\u6A21\u5F0F: ${DISPLAY_MODE_LABELS[displayMode.value]}`;
|
|
85
86
|
});
|
|
86
87
|
const displayModeIconLabel = (0, import_vue2.computed)(() => {
|
|
87
|
-
const
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
auto: "\u81EA\u52A8\u6A21\u5F0F",
|
|
91
|
-
extension: "\u6269\u5C55\u6A21\u5F0F",
|
|
92
|
-
"extension-selector": "\u6269\u5C55\u9009\u62E9\u5668\u6A21\u5F0F"
|
|
93
|
-
};
|
|
94
|
-
const modes = ["bubble", "split", "auto"];
|
|
95
|
-
const currentIndex = modes.indexOf(displayMode.value);
|
|
96
|
-
const nextMode = modes[(currentIndex + 1) % modes.length];
|
|
97
|
-
return `\u5207\u6362\u5C55\u793A\u6A21\u5F0F - \u4E0B\u4E00\u4E2A: ${displayModeLabels[nextMode]}`;
|
|
88
|
+
const currentIndex = DISPLAY_CYCLE.indexOf(displayMode.value);
|
|
89
|
+
const nextMode = DISPLAY_CYCLE[(currentIndex + 1) % DISPLAY_CYCLE.length];
|
|
90
|
+
return `\u5207\u6362\u5C55\u793A\u6A21\u5F0F - \u4E0B\u4E00\u4E2A: ${DISPLAY_MODE_LABELS[nextMode]}`;
|
|
98
91
|
});
|
|
99
92
|
const splitPositionIconTitle = (0, import_vue2.computed)(() => {
|
|
100
93
|
const positionLabels = {
|
|
@@ -107,7 +100,7 @@ const __vue_sfc__ = /* @__PURE__ */ (0, import_vue.defineComponent)({
|
|
|
107
100
|
const nextPosition = splitPosition.value === "right" ? "\u5DE6\u4FA7" : "\u53F3\u4FA7";
|
|
108
101
|
return `\u5207\u6362\u5206\u680F\u4F4D\u7F6E - \u4E0B\u4E00\u4E2A: ${nextPosition}`;
|
|
109
102
|
});
|
|
110
|
-
const __returned__ = { title, sessionListTitle, sessionListCollapsed, selectMode, selectEnabled, theme, resolvedTheme, minimized, promptDockVisible, reviewPanelVisible, reviewPanelEnabled, mode, displayMode, splitPosition, handleToggleSessionList, handleToggleSelectMode, handleToggleTheme, handleToggleDisplayMode, handleToggleSplitPosition, handleClose, handleToggleMinimize, handleTogglePromptDock, handleToggleReviewPanel, handleRefresh, handleCreateSession, isSplitMode, themeIconTitle, themeIconLabel, displayModeIconTitle, displayModeIconLabel, splitPositionIconTitle, splitPositionIconLabel };
|
|
103
|
+
const __returned__ = { title, sessionListTitle, sessionListCollapsed, selectMode, selectEnabled, theme, resolvedTheme, minimized, promptDockVisible, reviewPanelVisible, reviewPanelEnabled, mode, displayMode, splitPosition, handleToggleSessionList, handleToggleSelectMode, handleToggleTheme, handleToggleDisplayMode, handleToggleSplitPosition, handleClose, handleToggleMinimize, handleTogglePromptDock, handleToggleReviewPanel, handleRefresh, handleCreateSession, DISPLAY_MODE_LABELS, DISPLAY_CYCLE, isSplitMode, themeIconTitle, themeIconLabel, displayModeIconTitle, displayModeIconLabel, splitPositionIconTitle, splitPositionIconLabel };
|
|
111
104
|
Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
|
|
112
105
|
return __returned__;
|
|
113
106
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.aipanel-session-list{width:240px;background:var(--ap-bg-secondary);border-right:1px solid var(--ap-border-primary);display:flex;flex-direction:column;flex-shrink:0;transition:width .2s ease}.aipanel-session-list.collapsed{width:0;overflow:hidden}.aipanel-session-list.collapsed .aipanel-session-list-header,.aipanel-session-list.collapsed .aipanel-session-list-content{display:none}.aipanel-session-list-header{padding:16px;border-bottom:1px solid var(--ap-border-primary);display:flex;justify-content:space-between;align-items:center;font-weight:600;font-size:14px;color:var(--ap-text-primary)}.aipanel-new-session-btn{width:28px;height:28px;border-radius:6px;border:none;background:var(--ap-primary);color:#fff;font-size:18px;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:all .2s}.aipanel-new-session-btn:hover{background:var(--ap-primary-hover);transform:scale(1.05)}.aipanel-session-list-content{flex:1;overflow-y:auto;padding:8px;position:relative}.aipanel-session-list-loading-overlay{position:absolute;inset:0;background:var(--ap-overlay-bg);display:flex;align-items:center;justify-content:center;z-index:10;border-radius:8px}.aipanel-loading-spinner.small{width:24px;height:24px;border-width:2px}.aipanel-session-item{padding:12px;border-radius:8px;cursor:pointer;transition:transform .2s;margin-bottom:4px;color:var(--ap-text-primary)}.aipanel-session-item:hover{background:var(--ap-bg-tertiary)}.aipanel-session-item.active{background:var(--ap-primary);color:#fff;transition:none}.aipanel-session-title{font-size:14px;font-weight:500;margin-bottom:4px
|
|
1
|
+
.aipanel-session-list{width:240px;background:var(--ap-bg-secondary);border-right:1px solid var(--ap-border-primary);display:flex;flex-direction:column;flex-shrink:0;transition:width .2s ease}.aipanel-session-list.collapsed{width:0;overflow:hidden}.aipanel-session-list.collapsed .aipanel-session-list-header,.aipanel-session-list.collapsed .aipanel-session-list-content{display:none}.aipanel-session-list-header{padding:16px;border-bottom:1px solid var(--ap-border-primary);display:flex;justify-content:space-between;align-items:center;font-weight:600;font-size:14px;color:var(--ap-text-primary)}.aipanel-new-session-btn{width:28px;height:28px;border-radius:6px;border:none;background:var(--ap-primary);color:#fff;font-size:18px;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:all .2s}.aipanel-new-session-btn:hover{background:var(--ap-primary-hover);transform:scale(1.05)}.aipanel-session-list-content{flex:1;overflow-y:auto;padding:8px;position:relative}.aipanel-session-list-loading-overlay{position:absolute;inset:0;background:var(--ap-overlay-bg);display:flex;align-items:center;justify-content:center;z-index:10;border-radius:8px}.aipanel-loading-spinner.small{width:24px;height:24px;border-width:2px}.aipanel-session-item{padding:12px;border-radius:8px;cursor:pointer;transition:transform .2s;margin-bottom:4px;color:var(--ap-text-primary)}.aipanel-session-item:hover{background:var(--ap-bg-tertiary)}.aipanel-session-item.active{background:var(--ap-primary);color:#fff;transition:none}.aipanel-session-title{display:flex;align-items:center;min-width:0;font-size:14px;font-weight:500;margin-bottom:4px}.aipanel-session-title-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}.aipanel-session-meta{font-size:12px;opacity:.6}.aipanel-session-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:4px}.aipanel-session-delete-btn{width:20px;height:20px;border-radius:4px;border:none;background:transparent;color:var(--ap-text-placeholder);font-size:16px;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:all .2s;opacity:0;flex-shrink:0}.aipanel-session-item:hover .aipanel-session-delete-btn{opacity:1}.aipanel-session-delete-btn:hover{background:var(--ap-danger);color:#fff}.aipanel-session-item.active .aipanel-session-delete-btn{color:#ffffffb3}.aipanel-session-item.active .aipanel-session-delete-btn:hover{background:#fff3;color:#fff}.aipanel-session-header-skeleton{padding:16px;border-bottom:1px solid var(--ap-border-primary);display:none;justify-content:space-between;align-items:center}.aipanel-session-header-skeleton.visible{display:flex}.aipanel-skeleton-header-title{height:18px;width:80px;background:var(--ap-skeleton-gradient);background-size:200% 100%;animation:skeleton-loading 1.5s ease-in-out infinite;border-radius:4px}.aipanel-skeleton-header-btn{width:28px;height:28px;background:var(--ap-skeleton-gradient);background-size:200% 100%;animation:skeleton-loading 1.5s ease-in-out infinite;border-radius:6px}.aipanel-session-skeleton{flex:1;overflow-y:auto;padding:8px;display:none}.aipanel-session-skeleton.visible{display:block}.aipanel-skeleton-item{padding:12px;border-radius:8px;margin-bottom:4px;background:var(--ap-skeleton-bg)}.aipanel-skeleton-title{height:16px;background:var(--ap-skeleton-gradient);background-size:200% 100%;animation:skeleton-loading 1.5s ease-in-out infinite;border-radius:4px;margin-bottom:8px;width:70%}.aipanel-skeleton-meta{height:12px;background:var(--ap-skeleton-gradient);background-size:200% 100%;animation:skeleton-loading 1.5s ease-in-out infinite;border-radius:4px;width:50%}.aipanel-session-empty{padding:32px 16px;text-align:center;color:var(--ap-text-placeholder);font-size:13px}.aipanel-session-state{position:relative;flex:0 0 auto;width:10px;height:10px;margin-right:6px}.aipanel-session-state-pending:before,.aipanel-session-state-completed:before{content:"";position:absolute;inset:0;border-radius:50%;background:currentColor;opacity:.1}.aipanel-session-state-pending:after,.aipanel-session-state-completed:after{content:"";position:absolute;inset:20%;border-radius:50%;background:currentColor}.aipanel-session-state-pending{color:var(--ap-state-pending)}.aipanel-session-state-completed{color:var(--ap-state-completed)}.aipanel-session-state-ongoing{color:var(--ap-state-ongoing)}.aipanel-session-ongoing-cell{fill:currentColor;opacity:.15;animation:aipanel-ongoing-chase 1s infinite}@keyframes aipanel-ongoing-chase{0%,12.4%{opacity:1}12.5%,24.9%{opacity:.6}25%,37.4%{opacity:.35}37.5%,to{opacity:.15}}.aipanel-session-item.active .aipanel-session-state-pending{color:var(--ap-state-pending)}.aipanel-session-item.active .aipanel-session-state-completed{color:var(--ap-state-completed)}.aipanel-session-item.active .aipanel-session-state-ongoing{color:#fffffff2}@keyframes skeleton-loading{0%{background-position:200% 0}to{background-position:-200% 0}}
|
|
@@ -54,15 +54,56 @@ const __vue_sfc__ = /* @__PURE__ */ (0, import_vue.defineComponent)({
|
|
|
54
54
|
if (showSessionListSkeleton.value) return true;
|
|
55
55
|
return false;
|
|
56
56
|
});
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
57
|
+
const ONGOING_CELLS = [
|
|
58
|
+
{ x: 0, y: 0, delay: "-1000ms" },
|
|
59
|
+
{ x: 4, y: 0, delay: "-875ms" },
|
|
60
|
+
{ x: 8, y: 0, delay: "-750ms" },
|
|
61
|
+
{ x: 8, y: 4, delay: "-625ms" },
|
|
62
|
+
{ x: 8, y: 8, delay: "-500ms" },
|
|
63
|
+
{ x: 4, y: 8, delay: "-375ms" },
|
|
64
|
+
{ x: 0, y: 8, delay: "-250ms" },
|
|
65
|
+
{ x: 0, y: 4, delay: "-125ms" }
|
|
66
|
+
];
|
|
67
|
+
const PENDING_LABELS = {
|
|
68
|
+
approval: "\u7B49\u5F85\u5BA1\u6279",
|
|
69
|
+
"plan-review": "\u7B49\u5F85\u8BA1\u5212\u786E\u8BA4",
|
|
70
|
+
question: "\u7B49\u5F85\u56DE\u590D"
|
|
71
|
+
};
|
|
72
|
+
function runningLabel(sessionId) {
|
|
73
|
+
const n = sessionStates?.value?.[sessionId]?.subagentsRunning ?? 0;
|
|
74
|
+
return n > 0 ? "\u5B50\u4EE3\u7406\u8FD0\u884C\u4E2D (" + n + ")" : "\u8FD0\u884C\u4E2D";
|
|
75
|
+
}
|
|
76
|
+
function sessionRowStatus(sessionId) {
|
|
77
|
+
const state = sessionStates?.value?.[sessionId];
|
|
78
|
+
if (!state) return "idle";
|
|
79
|
+
if (state.hasPending) return "pending";
|
|
80
|
+
const subagentsRunning = (state.subagentsRunning ?? 0) > 0;
|
|
81
|
+
if (subagentsRunning) return "running";
|
|
82
|
+
if (state.thinking) return "thinking";
|
|
83
|
+
const running = state.statusType === "running" || state.statusType === "streaming";
|
|
84
|
+
if (running) return "running";
|
|
85
|
+
if (state.completed) return "completed";
|
|
86
|
+
return "idle";
|
|
87
|
+
}
|
|
88
|
+
function pendingLabel(sessionId) {
|
|
89
|
+
const kind = sessionStates?.value?.[sessionId]?.pendingKind;
|
|
90
|
+
return kind && PENDING_LABELS[kind] || "\u7B49\u5F85\u7528\u6237";
|
|
91
|
+
}
|
|
92
|
+
function isSessionActive(sessionId) {
|
|
93
|
+
const status = sessionRowStatus(sessionId);
|
|
94
|
+
return status === "thinking" || status === "running";
|
|
95
|
+
}
|
|
96
|
+
function isSessionPending(sessionId) {
|
|
97
|
+
return sessionRowStatus(sessionId) === "pending";
|
|
98
|
+
}
|
|
99
|
+
function isSessionCompleted(sessionId) {
|
|
100
|
+
return sessionRowStatus(sessionId) === "completed";
|
|
60
101
|
}
|
|
61
102
|
const __returned__ = { collapsed, sessions, loadingSessionList, showSessionListSkeleton, handleCreateSession, handleSelectSession, handleDeleteSession, sessionKey, sessionStates, isAnimating, get animTimer() {
|
|
62
103
|
return animTimer;
|
|
63
104
|
}, set animTimer(v) {
|
|
64
105
|
animTimer = v;
|
|
65
|
-
}, showSkeleton,
|
|
106
|
+
}, showSkeleton, ONGOING_CELLS, PENDING_LABELS, runningLabel, sessionRowStatus, pendingLabel, isSessionActive, isSessionPending, isSessionCompleted };
|
|
66
107
|
Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
|
|
67
108
|
return __returned__;
|
|
68
109
|
}
|
|
@@ -87,12 +128,17 @@ const _hoisted_4 = {
|
|
|
87
128
|
const _hoisted_5 = ["aria-selected", "onClick"];
|
|
88
129
|
const _hoisted_6 = { class: "aipanel-session-header" };
|
|
89
130
|
const _hoisted_7 = { class: "aipanel-session-title" };
|
|
90
|
-
const _hoisted_8 =
|
|
91
|
-
|
|
92
|
-
|
|
131
|
+
const _hoisted_8 = ["title"];
|
|
132
|
+
const _hoisted_9 = ["title"];
|
|
133
|
+
const _hoisted_10 = ["x", "y"];
|
|
134
|
+
const _hoisted_11 = {
|
|
135
|
+
key: 2,
|
|
136
|
+
class: "aipanel-session-state aipanel-session-state-completed",
|
|
137
|
+
title: "\u5DF2\u5B8C\u6210"
|
|
93
138
|
};
|
|
94
|
-
const
|
|
95
|
-
const
|
|
139
|
+
const _hoisted_12 = { class: "aipanel-session-title-text" };
|
|
140
|
+
const _hoisted_13 = ["aria-label", "onClick"];
|
|
141
|
+
const _hoisted_14 = { class: "aipanel-session-meta" };
|
|
96
142
|
function __vue_render__(_ctx, _cache, $props, $setup, $data, $options) {
|
|
97
143
|
return (0, import_vue3.openBlock)(), (0, import_vue3.createElementBlock)(
|
|
98
144
|
"div",
|
|
@@ -185,16 +231,49 @@ function __vue_render__(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
185
231
|
(0, import_vue3.renderList)($setup.sessions, (item) => {
|
|
186
232
|
return (0, import_vue3.openBlock)(), (0, import_vue3.createElementBlock)("div", {
|
|
187
233
|
key: item[$setup.sessionKey],
|
|
188
|
-
class: (0, import_vue3.normalizeClass)(["aipanel-session-item", { active: item.active, thinking: $setup.
|
|
234
|
+
class: (0, import_vue3.normalizeClass)(["aipanel-session-item", { active: item.active, thinking: $setup.isSessionActive(item.id) }]),
|
|
189
235
|
role: "option",
|
|
190
236
|
"aria-selected": item.active,
|
|
191
237
|
onClick: ($event) => $setup.handleSelectSession(item)
|
|
192
238
|
}, [
|
|
193
239
|
(0, import_vue3.createElementVNode)("div", _hoisted_6, [
|
|
194
240
|
(0, import_vue3.createElementVNode)("div", _hoisted_7, [
|
|
195
|
-
|
|
196
|
-
(0, import_vue3.
|
|
197
|
-
|
|
241
|
+
(0, import_vue3.createCommentVNode)(" \u72B6\u6001\u6307\u793A\uFF1Apending=\u7425\u73C0\u70B9 > \u6D3B\u8DC3(thinking/running/\u5B50\u4EE3\u7406)=\u8F6C\u5708 > completed=\u7EFF\u70B9 > idle "),
|
|
242
|
+
$setup.isSessionPending(item.id) ? ((0, import_vue3.openBlock)(), (0, import_vue3.createElementBlock)("span", {
|
|
243
|
+
key: 0,
|
|
244
|
+
class: "aipanel-session-state aipanel-session-state-pending",
|
|
245
|
+
title: $setup.pendingLabel(item.id)
|
|
246
|
+
}, null, 8, _hoisted_8)) : $setup.isSessionActive(item.id) ? ((0, import_vue3.openBlock)(), (0, import_vue3.createElementBlock)("svg", {
|
|
247
|
+
key: 1,
|
|
248
|
+
class: "aipanel-session-state aipanel-session-state-ongoing",
|
|
249
|
+
title: $setup.runningLabel(item.id),
|
|
250
|
+
viewBox: "0 0 10 10",
|
|
251
|
+
width: "10",
|
|
252
|
+
height: "10",
|
|
253
|
+
"aria-hidden": "true"
|
|
254
|
+
}, [
|
|
255
|
+
((0, import_vue3.openBlock)(), (0, import_vue3.createElementBlock)(
|
|
256
|
+
import_vue3.Fragment,
|
|
257
|
+
null,
|
|
258
|
+
(0, import_vue3.renderList)($setup.ONGOING_CELLS, (c) => {
|
|
259
|
+
return (0, import_vue3.createElementVNode)("rect", {
|
|
260
|
+
key: c.x + "-" + c.y,
|
|
261
|
+
x: c.x,
|
|
262
|
+
y: c.y,
|
|
263
|
+
width: "2",
|
|
264
|
+
height: "2",
|
|
265
|
+
style: (0, import_vue3.normalizeStyle)({ animationDelay: c.delay }),
|
|
266
|
+
class: "aipanel-session-ongoing-cell"
|
|
267
|
+
}, null, 12, _hoisted_10);
|
|
268
|
+
}),
|
|
269
|
+
64
|
|
270
|
+
/* STABLE_FRAGMENT */
|
|
271
|
+
))
|
|
272
|
+
], 8, _hoisted_9)) : $setup.isSessionCompleted(item.id) ? ((0, import_vue3.openBlock)(), (0, import_vue3.createElementBlock)("span", _hoisted_11)) : (0, import_vue3.createCommentVNode)("v-if", true),
|
|
273
|
+
(0, import_vue3.createElementVNode)(
|
|
274
|
+
"span",
|
|
275
|
+
_hoisted_12,
|
|
276
|
+
(0, import_vue3.toDisplayString)(item.title),
|
|
198
277
|
1
|
|
199
278
|
/* TEXT */
|
|
200
279
|
)
|
|
@@ -204,11 +283,11 @@ function __vue_render__(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
204
283
|
type: "button",
|
|
205
284
|
"aria-label": `\u5220\u9664\u4F1A\u8BDD: ${item.title}`,
|
|
206
285
|
onClick: (0, import_vue3.withModifiers)(($event) => $setup.handleDeleteSession(item), ["stop"])
|
|
207
|
-
}, " \xD7 ", 8,
|
|
286
|
+
}, " \xD7 ", 8, _hoisted_13)
|
|
208
287
|
]),
|
|
209
288
|
(0, import_vue3.createElementVNode)(
|
|
210
289
|
"div",
|
|
211
|
-
|
|
290
|
+
_hoisted_14,
|
|
212
291
|
(0, import_vue3.toDisplayString)(item.meta),
|
|
213
292
|
1
|
|
214
293
|
/* TEXT */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.aipanel-widget{--ap-bg-main: #ffffff;--ap-bg-secondary: #f8f9fa;--ap-bg-tertiary: #f3f4f6;--ap-overlay-bg: rgba(255, 255, 255, .9);--ap-bg-inverse: #1e1e1e;--ap-text-primary: #282828;--ap-text-secondary: #4b5563;--ap-text-tertiary: #6b7280;--ap-text-placeholder: #9ca3af;--ap-text-inverse: #ffffff;--ap-border-primary: #e5e7eb;--ap-border-secondary: #d1d5db;--ap-primary: #3b82f6;--ap-primary-hover: #2563eb;--ap-primary-bg: rgba(59, 130, 246, .1);--ap-danger: #ef4444;--ap-danger-hover: #dc2626;--ap-danger-active: #b91c1c;--ap-success: #10b981;--ap-overlay: rgba(0, 0, 0, .5);--ap-tooltip-bg: #1e1e1e;--ap-dialog-overlay: rgba(0, 0, 0, .5);--ap-thinking-gradient-1: #10b981;--ap-thinking-gradient-2: #059669;--ap-thinking-glow: rgba(16, 185, 129, .3);--ap-thinking-glow-strong: rgba(16, 185, 129, .6);--ap-skeleton-bg: #e5e7eb;--ap-skeleton-gradient: linear-gradient(90deg, #e5e7eb 25%, #f3f4f6 50%, #e5e7eb 75%);--ap-shadow-sm: 0 2px 4px rgba(0, 0, 0, .1);--ap-shadow-md: 0 4px 12px rgba(0, 0, 0, .15);--ap-shadow-lg: 0 8px 32px rgba(0, 0, 0, .12);--ap-shadow-xl: 0 20px 60px rgba(0, 0, 0, .3);--ap-shadow-primary: 0 2px 4px rgba(59, 130, 246, .2);--ap-shadow-primary-hover: 0 4px 6px rgba(59, 130, 246, .3);--ap-shadow-danger: 0 4px 12px rgba(239, 68, 68, .3);--ap-trigger-bg: #3b82f6;--ap-trigger-bg-hover: #2563eb;--ap-trigger-bg-active: #1d4ed8;--ap-trigger-shadow: 0 2px 8px rgba(59, 130, 246, .3);--ap-trigger-shadow-hover: 0 4px 12px rgba(59, 130, 246, .4);--ap-trigger-shadow-active: 0 4px 12px rgba(59, 130, 246, .5);position:fixed;z-index:999999;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif}.aipanel-widget.aipanel-theme-dark{--ap-bg-main: #1a1a1a;--ap-bg-secondary: #1e1e1e;--ap-bg-tertiary: #282828;--ap-overlay-bg: rgba(26, 26, 26, .9);--ap-bg-inverse: #ffffff;--ap-text-primary: #f3f4f6;--ap-text-secondary: #d1d5db;--ap-text-tertiary: #9ca3af;--ap-text-placeholder: #6b7280;--ap-text-inverse: #282828;--ap-border-primary: #282828;--ap-border-secondary: #4b5563;--ap-primary: #3b82f6;--ap-primary-hover: #2563eb;--ap-primary-bg: rgba(59, 130, 246, .15);--ap-danger: #ef4444;--ap-danger-hover: #dc2626;--ap-danger-active: #b91c1c;--ap-success: #10b981;--ap-overlay: rgba(26, 26, 26, .9);--ap-tooltip-bg: #282828;--ap-dialog-overlay: rgba(0, 0, 0, .7);--ap-thinking-gradient-1: #34d399;--ap-thinking-gradient-2: #10b981;--ap-thinking-glow: rgba(52, 211, 153, .3);--ap-thinking-glow-strong: rgba(52, 211, 153, .6);--ap-skeleton-bg: #151515;--ap-skeleton-gradient: linear-gradient(90deg, #282828 25%, #4b5563 50%, #282828 75%);--ap-shadow-sm: 0 2px 4px rgba(0, 0, 0, .3);--ap-shadow-md: 0 4px 12px rgba(0, 0, 0, .4);--ap-shadow-lg: 0 8px 32px rgba(0, 0, 0, .4);--ap-shadow-xl: 0 20px 60px rgba(0, 0, 0, .6);--ap-shadow-primary: 0 2px 4px rgba(59, 130, 246, .3);--ap-shadow-primary-hover: 0 4px 6px rgba(59, 130, 246, .4);--ap-shadow-danger: 0 4px 12px rgba(239, 68, 68, .4);--ap-trigger-bg: #60a5fa;--ap-trigger-bg-hover: #3b82f6;--ap-trigger-bg-active: #2563eb;--ap-trigger-shadow: 0 2px 8px rgba(96, 165, 250, .4);--ap-trigger-shadow-hover: 0 4px 12px rgba(96, 165, 250, .5);--ap-trigger-shadow-active: 0 4px 12px rgba(96, 165, 250, .6)}.aipanel-chat{position:fixed;bottom:20px;width:700px;height:86vh;max-height:calc(100vh - 40px);background:var(--ap-bg-main);border-radius:16px;box-shadow:var(--ap-shadow-lg);overflow:hidden;opacity:0;visibility:hidden;transform:translate3d(var(---chatAnimationOrigin\.x),var(---chatAnimationOrigin\.y),0) scale(.95);transition:all .3s ease;display:flex;flex-direction:column;z-index:99999}.aipanel-chat.open{opacity:1;visibility:visible;transform:translateZ(0) scale(1)}.aipanel-chat.no-transition,.aipanel-chat.no-transition.open{transition:none!important}.aipanel-chat.minimized{width:320px;height:320px}.aipanel-chat.minimized .aipanel-iframe-container{margin-top:-146px}.aipanel-chat-content{display:flex;flex:1;overflow:hidden}.aipanel-notification{position:absolute;top:20px;left:50%;transform:translate(-50%);padding:12px 24px;background:linear-gradient(135deg,#3b82f6,#2563eb);color:#fff;border-radius:10px;font-size:14px;font-weight:500;box-shadow:0 4px 16px #3b82f666,0 0 0 2px #3b82f633;animation:slideDown .3s ease;z-index:10000000;display:flex;align-items:center;gap:10px}.aipanel-notification:before{content:"\1f4a1";font-size:16px}.aipanel-dialog-overlay{position:fixed;inset:0;background:var(--ap-dialog-overlay);display:flex;align-items:center;justify-content:center;z-index:9999999;animation:fadeIn .2s ease}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}.aipanel-dialog{background:var(--ap-bg-main);border-radius:12px;padding:24px;min-width:320px;max-width:400px;box-shadow:var(--ap-shadow-xl);animation:scaleIn .2s ease}@keyframes scaleIn{0%{transform:scale(.9);opacity:0}to{transform:scale(1);opacity:1}}.aipanel-dialog-content{margin-bottom:20px}.aipanel-dialog-message{font-size:15px;color:var(--ap-text-primary);line-height:1.5}.aipanel-dialog-actions{display:flex;gap:12px;justify-content:flex-end}.aipanel-dialog-btn{padding:10px 20px;border-radius:8px;border:none;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s}.aipanel-dialog-btn.cancel{background:var(--ap-bg-tertiary);color:var(--ap-text-primary)}.aipanel-dialog-btn.cancel:hover{background:var(--ap-text-primary);color:var(--ap-bg-main)}.aipanel-dialog-btn.confirm{background:var(--ap-danger);color:#fff}.aipanel-dialog-btn.confirm:hover{background:var(--ap-danger-hover)}@keyframes slideDown{0%{transform:translate(-50%) translateY(-100%);opacity:0}to{transform:translate(-50%) translateY(0);opacity:1}}.aipanel-page-notification{position:fixed;top:20px;left:50%;transform:translate(-50%);padding:12px 24px;background:linear-gradient(135deg,#3b82f6,#2563eb);color:#fff;border-radius:10px;font-size:14px;font-weight:500;box-shadow:0 4px 16px #3b82f666,0 0 0 2px #3b82f633;animation:slideDown .3s ease;z-index:2147483647;display:flex;align-items:center;gap:10px;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif}.aipanel-page-notification:before{content:"\1f4a1";font-size:16px}.aipanel-element-highlight{position:fixed;pointer-events:none;z-index:999998;border-radius:4px}#vue-inspector-container{display:none!important}.aipanel-element-tooltip{position:fixed;background:var(--ap-tooltip-bg);color:#fff;padding:8px 12px;border-radius:6px;font-size:12px;z-index:9999998;box-shadow:var(--ap-shadow-md);max-width:300px;pointer-events:none;line-height:1}.aipanel-tooltip-tag{font-weight:500;margin-bottom:4px;word-break:break-all}.aipanel-tooltip-file{font-size:11px;color:var(--ap-text-placeholder);word-break:break-all}.aipanel-element-highlight-temp{position:absolute;pointer-events:none;z-index:999998;border-radius:4px;animation:highlight-pulse 2s ease-out forwards}@keyframes highlight-pulse{0%{opacity:1;transform:scale(1)}50%{opacity:.8;transform:scale(1.02)}to{opacity:0;transform:scale(1)}}@media(max-width:768px){.aipanel-chat{width:calc(100vw - 40px);height:calc(100vh - 100px)}}body.has-aipanel-split{transition:padding .3s ease;min-width:auto}body.has-aipanel-split-right{padding-right:var(--aipanel-split-width, 500px)}body.has-aipanel-split-left{padding-left:var(--aipanel-split-width, 500px)}.aipanel-widget.extension-mode{position:relative;width:100%;height:100%;display:flex}.aipanel-widget.extension-mode .aipanel-select-mode-hint,.aipanel-widget.extension-mode .aipanel-dialog-overlay{position:absolute}
|
|
1
|
+
.aipanel-widget{--ap-bg-main: #ffffff;--ap-bg-secondary: #f8f9fa;--ap-bg-tertiary: #f3f4f6;--ap-overlay-bg: rgba(255, 255, 255, .9);--ap-bg-inverse: #1e1e1e;--ap-text-primary: #282828;--ap-text-secondary: #4b5563;--ap-text-tertiary: #6b7280;--ap-text-placeholder: #9ca3af;--ap-text-inverse: #ffffff;--ap-border-primary: #e5e7eb;--ap-border-secondary: #d1d5db;--ap-primary: #3b82f6;--ap-primary-hover: #2563eb;--ap-primary-bg: rgba(59, 130, 246, .1);--ap-danger: #ef4444;--ap-danger-hover: #dc2626;--ap-danger-active: #b91c1c;--ap-success: #10b981;--ap-state-pending: #f59e0b;--ap-state-completed: #22c55e;--ap-state-ongoing: #5686fe;--ap-overlay: rgba(0, 0, 0, .5);--ap-tooltip-bg: #1e1e1e;--ap-dialog-overlay: rgba(0, 0, 0, .5);--ap-thinking-gradient-1: #10b981;--ap-thinking-gradient-2: #059669;--ap-thinking-glow: rgba(16, 185, 129, .3);--ap-thinking-glow-strong: rgba(16, 185, 129, .6);--ap-skeleton-bg: #e5e7eb;--ap-skeleton-gradient: linear-gradient(90deg, #e5e7eb 25%, #f3f4f6 50%, #e5e7eb 75%);--ap-shadow-sm: 0 2px 4px rgba(0, 0, 0, .1);--ap-shadow-md: 0 4px 12px rgba(0, 0, 0, .15);--ap-shadow-lg: 0 8px 32px rgba(0, 0, 0, .12);--ap-shadow-xl: 0 20px 60px rgba(0, 0, 0, .3);--ap-shadow-primary: 0 2px 4px rgba(59, 130, 246, .2);--ap-shadow-primary-hover: 0 4px 6px rgba(59, 130, 246, .3);--ap-shadow-danger: 0 4px 12px rgba(239, 68, 68, .3);--ap-trigger-bg: #3b82f6;--ap-trigger-bg-hover: #2563eb;--ap-trigger-bg-active: #1d4ed8;--ap-trigger-shadow: 0 2px 8px rgba(59, 130, 246, .3);--ap-trigger-shadow-hover: 0 4px 12px rgba(59, 130, 246, .4);--ap-trigger-shadow-active: 0 4px 12px rgba(59, 130, 246, .5);position:fixed;z-index:999999;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif}.aipanel-widget.aipanel-theme-dark{--ap-bg-main: #1a1a1a;--ap-bg-secondary: #1e1e1e;--ap-bg-tertiary: #282828;--ap-overlay-bg: rgba(26, 26, 26, .9);--ap-bg-inverse: #ffffff;--ap-text-primary: #f3f4f6;--ap-text-secondary: #d1d5db;--ap-text-tertiary: #9ca3af;--ap-text-placeholder: #6b7280;--ap-text-inverse: #282828;--ap-border-primary: #282828;--ap-border-secondary: #4b5563;--ap-primary: #3b82f6;--ap-primary-hover: #2563eb;--ap-primary-bg: rgba(59, 130, 246, .15);--ap-danger: #ef4444;--ap-danger-hover: #dc2626;--ap-danger-active: #b91c1c;--ap-success: #10b981;--ap-state-pending: #fbbf24;--ap-state-completed: #22c55e;--ap-state-ongoing: #5686fe;--ap-overlay: rgba(26, 26, 26, .9);--ap-tooltip-bg: #282828;--ap-dialog-overlay: rgba(0, 0, 0, .7);--ap-thinking-gradient-1: #34d399;--ap-thinking-gradient-2: #10b981;--ap-thinking-glow: rgba(52, 211, 153, .3);--ap-thinking-glow-strong: rgba(52, 211, 153, .6);--ap-skeleton-bg: #151515;--ap-skeleton-gradient: linear-gradient(90deg, #282828 25%, #4b5563 50%, #282828 75%);--ap-shadow-sm: 0 2px 4px rgba(0, 0, 0, .3);--ap-shadow-md: 0 4px 12px rgba(0, 0, 0, .4);--ap-shadow-lg: 0 8px 32px rgba(0, 0, 0, .4);--ap-shadow-xl: 0 20px 60px rgba(0, 0, 0, .6);--ap-shadow-primary: 0 2px 4px rgba(59, 130, 246, .3);--ap-shadow-primary-hover: 0 4px 6px rgba(59, 130, 246, .4);--ap-shadow-danger: 0 4px 12px rgba(239, 68, 68, .4);--ap-trigger-bg: #60a5fa;--ap-trigger-bg-hover: #3b82f6;--ap-trigger-bg-active: #2563eb;--ap-trigger-shadow: 0 2px 8px rgba(96, 165, 250, .4);--ap-trigger-shadow-hover: 0 4px 12px rgba(96, 165, 250, .5);--ap-trigger-shadow-active: 0 4px 12px rgba(96, 165, 250, .6)}.aipanel-chat{position:fixed;bottom:20px;width:700px;height:86vh;max-height:calc(100vh - 40px);background:var(--ap-bg-main);border-radius:16px;box-shadow:var(--ap-shadow-lg);overflow:hidden;opacity:0;visibility:hidden;transform:translate3d(var(---chatAnimationOrigin\.x),var(---chatAnimationOrigin\.y),0) scale(.95);transition:all .3s ease;display:flex;flex-direction:column;z-index:99999}.aipanel-chat.open{opacity:1;visibility:visible;transform:translateZ(0) scale(1)}.aipanel-chat.no-transition,.aipanel-chat.no-transition.open{transition:none!important}.aipanel-chat.minimized{width:320px;height:320px}.aipanel-chat.minimized .aipanel-iframe-container{margin-top:-146px}.aipanel-chat-content{display:flex;flex:1;overflow:hidden}.aipanel-notification{position:absolute;top:20px;left:50%;transform:translate(-50%);padding:12px 24px;background:linear-gradient(135deg,#3b82f6,#2563eb);color:#fff;border-radius:10px;font-size:14px;font-weight:500;box-shadow:0 4px 16px #3b82f666,0 0 0 2px #3b82f633;animation:slideDown .3s ease;z-index:10000000;display:flex;align-items:center;gap:10px}.aipanel-notification:before{content:"\1f4a1";font-size:16px}.aipanel-dialog-overlay{position:fixed;inset:0;background:var(--ap-dialog-overlay);display:flex;align-items:center;justify-content:center;z-index:9999999;animation:fadeIn .2s ease}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}.aipanel-dialog{background:var(--ap-bg-main);border-radius:12px;padding:24px;min-width:320px;max-width:400px;box-shadow:var(--ap-shadow-xl);animation:scaleIn .2s ease}@keyframes scaleIn{0%{transform:scale(.9);opacity:0}to{transform:scale(1);opacity:1}}.aipanel-dialog-content{margin-bottom:20px}.aipanel-dialog-message{font-size:15px;color:var(--ap-text-primary);line-height:1.5}.aipanel-dialog-actions{display:flex;gap:12px;justify-content:flex-end}.aipanel-dialog-btn{padding:10px 20px;border-radius:8px;border:none;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s}.aipanel-dialog-btn.cancel{background:var(--ap-bg-tertiary);color:var(--ap-text-primary)}.aipanel-dialog-btn.cancel:hover{background:var(--ap-text-primary);color:var(--ap-bg-main)}.aipanel-dialog-btn.confirm{background:var(--ap-danger);color:#fff}.aipanel-dialog-btn.confirm:hover{background:var(--ap-danger-hover)}@keyframes slideDown{0%{transform:translate(-50%) translateY(-100%);opacity:0}to{transform:translate(-50%) translateY(0);opacity:1}}.aipanel-page-notification{position:fixed;top:20px;left:50%;transform:translate(-50%);padding:12px 24px;background:linear-gradient(135deg,#3b82f6,#2563eb);color:#fff;border-radius:10px;font-size:14px;font-weight:500;box-shadow:0 4px 16px #3b82f666,0 0 0 2px #3b82f633;animation:slideDown .3s ease;z-index:2147483647;display:flex;align-items:center;gap:10px;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif}.aipanel-page-notification:before{content:"\1f4a1";font-size:16px}.aipanel-element-highlight{position:fixed;pointer-events:none;z-index:999998;border-radius:4px}#vue-inspector-container{display:none!important}.aipanel-element-tooltip{position:fixed;background:var(--ap-tooltip-bg);color:#fff;padding:8px 12px;border-radius:6px;font-size:12px;z-index:9999998;box-shadow:var(--ap-shadow-md);max-width:300px;pointer-events:none;line-height:1}.aipanel-tooltip-tag{font-weight:500;margin-bottom:4px;word-break:break-all}.aipanel-tooltip-file{font-size:11px;color:var(--ap-text-placeholder);word-break:break-all}.aipanel-element-highlight-temp{position:absolute;pointer-events:none;z-index:999998;border-radius:4px;animation:highlight-pulse 2s ease-out forwards}@keyframes highlight-pulse{0%{opacity:1;transform:scale(1)}50%{opacity:.8;transform:scale(1.02)}to{opacity:0;transform:scale(1)}}@media(max-width:768px){.aipanel-chat{width:calc(100vw - 40px);height:calc(100vh - 100px)}}body.has-aipanel-split{transition:padding .3s ease;min-width:auto}body.has-aipanel-split-right{padding-right:var(--aipanel-split-width, 500px)}body.has-aipanel-split-left{padding-left:var(--aipanel-split-width, 500px)}.aipanel-widget.extension-mode{position:relative;width:100%;height:100%;display:flex}.aipanel-widget.extension-mode .aipanel-select-mode-hint,.aipanel-widget.extension-mode .aipanel-dialog-overlay{position:absolute}
|
|
@@ -94,7 +94,7 @@ const __vue_sfc__ = /* @__PURE__ */ (0, import_vue.defineComponent)({
|
|
|
94
94
|
const notificationMode = (0, import_vue2.ref)("widget");
|
|
95
95
|
let notificationTimer = null;
|
|
96
96
|
const showNotification = (message, options) => {
|
|
97
|
-
const { duration =
|
|
97
|
+
const { duration = import_core.NOTIFICATION_DURATION, mode = "widget" } = options || {};
|
|
98
98
|
notificationMessage.value = message;
|
|
99
99
|
notificationVisible.value = true;
|
|
100
100
|
notificationMode.value = mode;
|
|
@@ -128,9 +128,7 @@ const __vue_sfc__ = /* @__PURE__ */ (0, import_vue.defineComponent)({
|
|
|
128
128
|
};
|
|
129
129
|
const localSessionListCollapsed = (0, import_vue2.ref)(props.sessionListCollapsed);
|
|
130
130
|
const localDisplayMode = (0, import_vue2.ref)(props.displayMode);
|
|
131
|
-
const localSplitPosition = (0, import_vue2.ref)(
|
|
132
|
-
props.splitMode?.position ?? "right"
|
|
133
|
-
);
|
|
131
|
+
const localSplitPosition = (0, import_vue2.ref)(props.splitMode?.position ?? "right");
|
|
134
132
|
const minimized = (0, import_vue2.ref)(false);
|
|
135
133
|
const promptDockVisible = (0, import_vue2.ref)(true);
|
|
136
134
|
const reviewPanelVisible = (0, import_vue2.ref)(false);
|
|
@@ -169,7 +167,8 @@ const __vue_sfc__ = /* @__PURE__ */ (0, import_vue.defineComponent)({
|
|
|
169
167
|
}
|
|
170
168
|
);
|
|
171
169
|
const handleToggleDisplayMode = () => {
|
|
172
|
-
if (localDisplayMode.value === "extension" || localDisplayMode.value === "extension-selector")
|
|
170
|
+
if (localDisplayMode.value === "extension" || localDisplayMode.value === "extension-selector")
|
|
171
|
+
return;
|
|
173
172
|
const modes = ["bubble", "split", "auto"];
|
|
174
173
|
const currentIndex = modes.indexOf(localDisplayMode.value);
|
|
175
174
|
const nextIndex = (currentIndex + 1) % modes.length;
|
|
@@ -430,7 +429,10 @@ const __vue_sfc__ = /* @__PURE__ */ (0, import_vue.defineComponent)({
|
|
|
430
429
|
const gap = 24;
|
|
431
430
|
const bubbleSize = 44;
|
|
432
431
|
const screenMargin = 20;
|
|
433
|
-
const effectiveOffset = triggerRef.value?.offset ?? bubbleOffset.value ?? {
|
|
432
|
+
const effectiveOffset = triggerRef.value?.offset ?? bubbleOffset.value ?? {
|
|
433
|
+
x: windowWidth.value - bubbleSize - gap,
|
|
434
|
+
y: windowHeight.value - bubbleSize - gap
|
|
435
|
+
};
|
|
434
436
|
const style = {};
|
|
435
437
|
if (isBubbleOnRightSide.value) {
|
|
436
438
|
let rightPos = windowWidth.value - effectiveOffset.x + gap;
|
|
@@ -778,11 +780,11 @@ function __vue_render__(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
778
780
|
(0, import_vue3.createElementVNode)("button", {
|
|
779
781
|
class: "aipanel-dialog-btn cancel",
|
|
780
782
|
onClick: $setup.handleDialogCancel
|
|
781
|
-
}, "\u53D6\u6D88"),
|
|
783
|
+
}, " \u53D6\u6D88 "),
|
|
782
784
|
(0, import_vue3.createElementVNode)("button", {
|
|
783
785
|
class: "aipanel-dialog-btn confirm",
|
|
784
786
|
onClick: $setup.handleDialogConfirm
|
|
785
|
-
}, "\u786E\u8BA4")
|
|
787
|
+
}, " \u786E\u8BA4 ")
|
|
786
788
|
])
|
|
787
789
|
])
|
|
788
790
|
])) : (0, import_vue3.createCommentVNode)("v-if", true),
|
|
@@ -47,8 +47,8 @@ declare const __VLS_base: import("vue").DefineComponent<AIPanelWidgetProps, {
|
|
|
47
47
|
displayMode: import("@aipanel/core").DisplayMode;
|
|
48
48
|
showSessionListSkeleton: boolean;
|
|
49
49
|
sessionKey: string;
|
|
50
|
-
sessions: import("@aipanel/core").AIPanelWidgetSession[];
|
|
51
50
|
thinking: boolean;
|
|
51
|
+
sessions: import("@aipanel/core").AIPanelWidgetSession[];
|
|
52
52
|
showClearAll: boolean;
|
|
53
53
|
open: boolean;
|
|
54
54
|
selectShortcutLabel: string;
|
|
@@ -1,2 +1 @@
|
|
|
1
1
|
export type { AIPanelWidgetTheme, AIPanelWidgetSession, AIPanelSelectedElement, AIPanelRemoveSelectedPayload, AIPanelWidgetSessionItem, AIPanelSelectedElementItem, AIPanelWidgetProps, AIPanelWidgetEmits, AIPanelSessionThinkingState, DisplayMode, SplitModeOptions, } from "@aipanel/core";
|
|
2
|
-
export type AIPanelWidgetThemeLocal = "light" | "dark" | "auto";
|
package/lib/index.cjs
CHANGED
|
@@ -26,7 +26,7 @@ module.exports = __toCommonJS(lib_exports);
|
|
|
26
26
|
var import_AI_panel_widget = require("./AI-panel-widget/index.cjs");
|
|
27
27
|
__reExport(lib_exports, require("./AI-panel-widget/index.cjs"), module.exports);
|
|
28
28
|
__reExport(lib_exports, require("./setup.cjs"), module.exports);
|
|
29
|
-
const version = "1.2.
|
|
29
|
+
const version = "1.2.11";
|
|
30
30
|
function install(app, options) {
|
|
31
31
|
const components = [
|
|
32
32
|
import_AI_panel_widget.AIPanelWidget
|
package/lib/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aipanel/ui",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.11",
|
|
4
4
|
"description": "Reusable AIPanel widget components built with Pagoda CLI",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.cjs",
|
|
@@ -31,12 +31,10 @@
|
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"css-selector-generator": "^3.9.2",
|
|
34
|
-
"@aipanel/core": "1.2.
|
|
34
|
+
"@aipanel/core": "1.2.11"
|
|
35
35
|
},
|
|
36
36
|
"scripts": {
|
|
37
37
|
"build": "pagoda-cli build",
|
|
38
|
-
"dev:site": "pagoda-cli site",
|
|
39
|
-
"build:site": "pagoda-cli build-site",
|
|
40
38
|
"test": "vitest run"
|
|
41
39
|
}
|
|
42
40
|
}
|