@aipanel/ui 1.2.9 → 1.2.10
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-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/index.vue.mjs +2 -2
- 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-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/index.vue.cjs +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,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
|
}
|
|
@@ -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;
|
|
@@ -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,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
|
}
|
|
@@ -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;
|
|
@@ -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.10";
|
|
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.10",
|
|
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.10"
|
|
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
|
}
|