@aipanel/ui 1.2.0-beta.0

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.
Files changed (153) hide show
  1. package/es/AI-panel-widget/composables/use-inspector.d.ts +52 -0
  2. package/es/AI-panel-widget/composables/use-inspector.mjs +437 -0
  3. package/es/AI-panel-widget/composables/use-persist-state.d.ts +32 -0
  4. package/es/AI-panel-widget/composables/use-persist-state.mjs +83 -0
  5. package/es/AI-panel-widget/composables/use-selection.d.ts +19 -0
  6. package/es/AI-panel-widget/composables/use-selection.mjs +112 -0
  7. package/es/AI-panel-widget/composables/use-session.d.ts +16 -0
  8. package/es/AI-panel-widget/composables/use-session.mjs +47 -0
  9. package/es/AI-panel-widget/composables/use-split.d.ts +30 -0
  10. package/es/AI-panel-widget/composables/use-split.mjs +133 -0
  11. package/es/AI-panel-widget/composables/use-widget.d.ts +27 -0
  12. package/es/AI-panel-widget/composables/use-widget.mjs +78 -0
  13. package/es/AI-panel-widget/index.d.ts +5 -0
  14. package/es/AI-panel-widget/index.mjs +9 -0
  15. package/es/AI-panel-widget/src/assets/logo.svg +13 -0
  16. package/es/AI-panel-widget/src/components/AIPanelLogo-sfc.css +1 -0
  17. package/es/AI-panel-widget/src/components/AIPanelLogo.vue.d.ts +8 -0
  18. package/es/AI-panel-widget/src/components/AIPanelLogo.vue.mjs +40 -0
  19. package/es/AI-panel-widget/src/components/ChatPanel-sfc.css +1 -0
  20. package/es/AI-panel-widget/src/components/ChatPanel.vue.d.ts +179 -0
  21. package/es/AI-panel-widget/src/components/ChatPanel.vue.mjs +308 -0
  22. package/es/AI-panel-widget/src/components/FloatingBubble/FloatingBubble-sfc.css +1 -0
  23. package/es/AI-panel-widget/src/components/FloatingBubble/FloatingBubble.vue.d.ts +44 -0
  24. package/es/AI-panel-widget/src/components/FloatingBubble/FloatingBubble.vue.mjs +311 -0
  25. package/es/AI-panel-widget/src/components/FloatingBubble/index.d.ts +3 -0
  26. package/es/AI-panel-widget/src/components/FloatingBubble/index.mjs +5 -0
  27. package/es/AI-panel-widget/src/components/FloatingBubble/types.d.ts +24 -0
  28. package/es/AI-panel-widget/src/components/FloatingBubble/types.mjs +0 -0
  29. package/es/AI-panel-widget/src/components/Frame-sfc.css +1 -0
  30. package/es/AI-panel-widget/src/components/Frame.vue.d.ts +22 -0
  31. package/es/AI-panel-widget/src/components/Frame.vue.mjs +143 -0
  32. package/es/AI-panel-widget/src/components/Header-sfc.css +1 -0
  33. package/es/AI-panel-widget/src/components/Header.vue.d.ts +27 -0
  34. package/es/AI-panel-widget/src/components/Header.vue.mjs +683 -0
  35. package/es/AI-panel-widget/src/components/ResizeHandle-sfc.css +1 -0
  36. package/es/AI-panel-widget/src/components/ResizeHandle.vue.d.ts +22 -0
  37. package/es/AI-panel-widget/src/components/ResizeHandle.vue.mjs +79 -0
  38. package/es/AI-panel-widget/src/components/SelectHint-sfc.css +1 -0
  39. package/es/AI-panel-widget/src/components/SelectHint.vue.d.ts +3 -0
  40. package/es/AI-panel-widget/src/components/SelectHint.vue.mjs +40 -0
  41. package/es/AI-panel-widget/src/components/SelectedBubbles-sfc.css +1 -0
  42. package/es/AI-panel-widget/src/components/SelectedBubbles.vue.d.ts +3 -0
  43. package/es/AI-panel-widget/src/components/SelectedBubbles.vue.mjs +84 -0
  44. package/es/AI-panel-widget/src/components/SelectedNodes-sfc.css +1 -0
  45. package/es/AI-panel-widget/src/components/SelectedNodes.vue.d.ts +3 -0
  46. package/es/AI-panel-widget/src/components/SelectedNodes.vue.mjs +103 -0
  47. package/es/AI-panel-widget/src/components/SessionList-sfc.css +1 -0
  48. package/es/AI-panel-widget/src/components/SessionList.vue.d.ts +13 -0
  49. package/es/AI-panel-widget/src/components/SessionList.vue.mjs +222 -0
  50. package/es/AI-panel-widget/src/components/SplitTrigger-sfc.css +1 -0
  51. package/es/AI-panel-widget/src/components/SplitTrigger.vue.d.ts +18 -0
  52. package/es/AI-panel-widget/src/components/SplitTrigger.vue.mjs +112 -0
  53. package/es/AI-panel-widget/src/components/Trigger-sfc.css +1 -0
  54. package/es/AI-panel-widget/src/components/Trigger.vue.d.ts +28 -0
  55. package/es/AI-panel-widget/src/components/Trigger.vue.mjs +74 -0
  56. package/es/AI-panel-widget/src/context.d.ts +67 -0
  57. package/es/AI-panel-widget/src/context.mjs +16 -0
  58. package/es/AI-panel-widget/src/index-sfc.css +1 -0
  59. package/es/AI-panel-widget/src/index.vue.d.ts +69 -0
  60. package/es/AI-panel-widget/src/index.vue.mjs +782 -0
  61. package/es/AI-panel-widget/src/types.d.ts +2 -0
  62. package/es/AI-panel-widget/src/types.mjs +0 -0
  63. package/es/AI-panel-widget/style/index-pure.d.ts +0 -0
  64. package/es/AI-panel-widget/style/index-pure.mjs +0 -0
  65. package/es/AI-panel-widget/style/index.d.ts +0 -0
  66. package/es/AI-panel-widget/style/index.mjs +0 -0
  67. package/es/AI-panel-widget/style/less-pure.d.ts +0 -0
  68. package/es/AI-panel-widget/style/less-pure.mjs +0 -0
  69. package/es/AI-panel-widget/style/less.d.ts +0 -0
  70. package/es/AI-panel-widget/style/less.mjs +0 -0
  71. package/es/env.d.ts +15 -0
  72. package/es/index.d.ts +7 -0
  73. package/es/index.mjs +22 -0
  74. package/es/setup.d.ts +1 -0
  75. package/es/setup.mjs +4 -0
  76. package/lib/AI-panel-widget/composables/use-inspector.cjs +466 -0
  77. package/lib/AI-panel-widget/composables/use-inspector.d.ts +52 -0
  78. package/lib/AI-panel-widget/composables/use-persist-state.cjs +102 -0
  79. package/lib/AI-panel-widget/composables/use-persist-state.d.ts +32 -0
  80. package/lib/AI-panel-widget/composables/use-selection.cjs +131 -0
  81. package/lib/AI-panel-widget/composables/use-selection.d.ts +19 -0
  82. package/lib/AI-panel-widget/composables/use-session.cjs +66 -0
  83. package/lib/AI-panel-widget/composables/use-session.d.ts +16 -0
  84. package/lib/AI-panel-widget/composables/use-split.cjs +152 -0
  85. package/lib/AI-panel-widget/composables/use-split.d.ts +30 -0
  86. package/lib/AI-panel-widget/composables/use-widget.cjs +97 -0
  87. package/lib/AI-panel-widget/composables/use-widget.d.ts +27 -0
  88. package/lib/AI-panel-widget/index.cjs +39 -0
  89. package/lib/AI-panel-widget/index.d.ts +5 -0
  90. package/lib/AI-panel-widget/src/assets/logo.svg +13 -0
  91. package/lib/AI-panel-widget/src/components/AIPanelLogo-sfc.css +1 -0
  92. package/lib/AI-panel-widget/src/components/AIPanelLogo.vue.cjs +69 -0
  93. package/lib/AI-panel-widget/src/components/AIPanelLogo.vue.d.ts +8 -0
  94. package/lib/AI-panel-widget/src/components/ChatPanel-sfc.css +1 -0
  95. package/lib/AI-panel-widget/src/components/ChatPanel.vue.cjs +337 -0
  96. package/lib/AI-panel-widget/src/components/ChatPanel.vue.d.ts +179 -0
  97. package/lib/AI-panel-widget/src/components/FloatingBubble/FloatingBubble-sfc.css +1 -0
  98. package/lib/AI-panel-widget/src/components/FloatingBubble/FloatingBubble.vue.cjs +330 -0
  99. package/lib/AI-panel-widget/src/components/FloatingBubble/FloatingBubble.vue.d.ts +44 -0
  100. package/lib/AI-panel-widget/src/components/FloatingBubble/index.cjs +35 -0
  101. package/lib/AI-panel-widget/src/components/FloatingBubble/index.d.ts +3 -0
  102. package/lib/AI-panel-widget/src/components/FloatingBubble/types.cjs +15 -0
  103. package/lib/AI-panel-widget/src/components/FloatingBubble/types.d.ts +24 -0
  104. package/lib/AI-panel-widget/src/components/Frame-sfc.css +1 -0
  105. package/lib/AI-panel-widget/src/components/Frame.vue.cjs +162 -0
  106. package/lib/AI-panel-widget/src/components/Frame.vue.d.ts +22 -0
  107. package/lib/AI-panel-widget/src/components/Header-sfc.css +1 -0
  108. package/lib/AI-panel-widget/src/components/Header.vue.cjs +702 -0
  109. package/lib/AI-panel-widget/src/components/Header.vue.d.ts +27 -0
  110. package/lib/AI-panel-widget/src/components/ResizeHandle-sfc.css +1 -0
  111. package/lib/AI-panel-widget/src/components/ResizeHandle.vue.cjs +98 -0
  112. package/lib/AI-panel-widget/src/components/ResizeHandle.vue.d.ts +22 -0
  113. package/lib/AI-panel-widget/src/components/SelectHint-sfc.css +1 -0
  114. package/lib/AI-panel-widget/src/components/SelectHint.vue.cjs +59 -0
  115. package/lib/AI-panel-widget/src/components/SelectHint.vue.d.ts +3 -0
  116. package/lib/AI-panel-widget/src/components/SelectedBubbles-sfc.css +1 -0
  117. package/lib/AI-panel-widget/src/components/SelectedBubbles.vue.cjs +103 -0
  118. package/lib/AI-panel-widget/src/components/SelectedBubbles.vue.d.ts +3 -0
  119. package/lib/AI-panel-widget/src/components/SelectedNodes-sfc.css +1 -0
  120. package/lib/AI-panel-widget/src/components/SelectedNodes.vue.cjs +122 -0
  121. package/lib/AI-panel-widget/src/components/SelectedNodes.vue.d.ts +3 -0
  122. package/lib/AI-panel-widget/src/components/SessionList-sfc.css +1 -0
  123. package/lib/AI-panel-widget/src/components/SessionList.vue.cjs +241 -0
  124. package/lib/AI-panel-widget/src/components/SessionList.vue.d.ts +13 -0
  125. package/lib/AI-panel-widget/src/components/SplitTrigger-sfc.css +1 -0
  126. package/lib/AI-panel-widget/src/components/SplitTrigger.vue.cjs +131 -0
  127. package/lib/AI-panel-widget/src/components/SplitTrigger.vue.d.ts +18 -0
  128. package/lib/AI-panel-widget/src/components/Trigger-sfc.css +1 -0
  129. package/lib/AI-panel-widget/src/components/Trigger.vue.cjs +103 -0
  130. package/lib/AI-panel-widget/src/components/Trigger.vue.d.ts +28 -0
  131. package/lib/AI-panel-widget/src/context.cjs +35 -0
  132. package/lib/AI-panel-widget/src/context.d.ts +67 -0
  133. package/lib/AI-panel-widget/src/index-sfc.css +1 -0
  134. package/lib/AI-panel-widget/src/index.vue.cjs +811 -0
  135. package/lib/AI-panel-widget/src/index.vue.d.ts +69 -0
  136. package/lib/AI-panel-widget/src/types.cjs +15 -0
  137. package/lib/AI-panel-widget/src/types.d.ts +2 -0
  138. package/lib/AI-panel-widget/style/index-pure.cjs +0 -0
  139. package/lib/AI-panel-widget/style/index-pure.d.ts +0 -0
  140. package/lib/AI-panel-widget/style/index.cjs +0 -0
  141. package/lib/AI-panel-widget/style/index.d.ts +0 -0
  142. package/lib/AI-panel-widget/style/less-pure.cjs +0 -0
  143. package/lib/AI-panel-widget/style/less-pure.d.ts +0 -0
  144. package/lib/AI-panel-widget/style/less.cjs +0 -0
  145. package/lib/AI-panel-widget/style/less.d.ts +0 -0
  146. package/lib/env.d.ts +15 -0
  147. package/lib/index.cjs +42 -0
  148. package/lib/index.css +0 -0
  149. package/lib/index.d.ts +7 -0
  150. package/lib/index.less +0 -0
  151. package/lib/setup.cjs +23 -0
  152. package/lib/setup.d.ts +1 -0
  153. package/package.json +42 -0
@@ -0,0 +1 @@
1
+ .floating-bubble{position:fixed;top:0;left:0;z-index:999999;cursor:grab;-webkit-user-select:none;-moz-user-select:none;user-select:none;touch-action:none;will-change:transform}.floating-bubble:active{cursor:grabbing}body.floating-bubble-dragging *{pointer-events:none!important}body.floating-bubble-dragging .floating-bubble,body.floating-bubble-dragging .floating-bubble *{pointer-events:auto!important}
@@ -0,0 +1,330 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+ var FloatingBubble_vue_exports = {};
19
+ __export(FloatingBubble_vue_exports, {
20
+ default: () => FloatingBubble_vue_default
21
+ });
22
+ module.exports = __toCommonJS(FloatingBubble_vue_exports);
23
+ var import_FloatingBubble_sfc = require("./FloatingBubble-sfc.css");
24
+ var import_vue = require("vue");
25
+ var import_vue2 = require("vue");
26
+ var import_vue3 = require("vue");
27
+ const __vue_sfc__ = /* @__PURE__ */ (0, import_vue.defineComponent)({
28
+ ...{
29
+ name: "FloatingBubble"
30
+ },
31
+ __name: "FloatingBubble",
32
+ props: {
33
+ offset: { type: Object, required: false, default: void 0 },
34
+ axis: { type: String, required: false, default: "xy" },
35
+ magnetic: { type: String, required: false, default: void 0 },
36
+ gap: { type: [Number, Object], required: false, default: 24 },
37
+ teleport: { type: null, required: false, default: "body" }
38
+ },
39
+ emits: ["update:offset", "click", "offset-change", "drag-start", "drag-end"],
40
+ setup(__props, { expose: __expose, emit: __emit }) {
41
+ const props = __props;
42
+ const emit = __emit;
43
+ const rootRef = (0, import_vue2.ref)(null);
44
+ const state = (0, import_vue2.ref)({
45
+ x: 0,
46
+ y: 0,
47
+ width: 0,
48
+ height: 0
49
+ });
50
+ const isObject = (val) => val !== null && typeof val === "object";
51
+ const gapX = (0, import_vue2.computed)(
52
+ () => isObject(props.gap) ? props.gap.x : props.gap
53
+ );
54
+ const gapY = (0, import_vue2.computed)(
55
+ () => isObject(props.gap) ? props.gap.y : props.gap
56
+ );
57
+ const windowWidth = (0, import_vue2.ref)(typeof window !== "undefined" ? window.innerWidth : 0);
58
+ const windowHeight = (0, import_vue2.ref)(typeof window !== "undefined" ? window.innerHeight : 0);
59
+ const boundary = (0, import_vue2.computed)(() => ({
60
+ top: gapY.value,
61
+ right: windowWidth.value - state.value.width - gapX.value,
62
+ bottom: windowHeight.value - state.value.height - gapY.value,
63
+ left: gapX.value
64
+ }));
65
+ const closest = (arr, target) => {
66
+ return arr.reduce(
67
+ (pre, cur) => Math.abs(pre - target) < Math.abs(cur - target) ? pre : cur
68
+ );
69
+ };
70
+ const applyMagnetic = () => {
71
+ if (props.magnetic === "x") {
72
+ if (magneticSide.value === "left") {
73
+ state.value.x = boundary.value.left;
74
+ } else if (magneticSide.value === "right") {
75
+ state.value.x = boundary.value.right;
76
+ } else {
77
+ const nextX = closest(
78
+ [boundary.value.left, boundary.value.right],
79
+ state.value.x
80
+ );
81
+ state.value.x = nextX;
82
+ magneticSide.value = nextX === boundary.value.left ? "left" : "right";
83
+ }
84
+ }
85
+ if (props.magnetic === "y") {
86
+ const nextY = closest(
87
+ [boundary.value.top, boundary.value.bottom],
88
+ state.value.y
89
+ );
90
+ state.value.y = nextY;
91
+ }
92
+ };
93
+ const dragging = (0, import_vue2.ref)(false);
94
+ const initialized = (0, import_vue2.ref)(false);
95
+ const magneticSide = (0, import_vue2.ref)(null);
96
+ const rootStyle = (0, import_vue2.computed)(() => {
97
+ const style = {};
98
+ const x = `${state.value.x}px`;
99
+ const y = `${state.value.y}px`;
100
+ style.transform = `translate3d(${x}, ${y}, 0)`;
101
+ if (dragging.value || !initialized.value) {
102
+ style.transition = "none";
103
+ } else {
104
+ style.transition = "transform 0.3s ease";
105
+ }
106
+ return style;
107
+ });
108
+ const updateState = () => {
109
+ if (!rootRef.value || typeof window === "undefined") return;
110
+ const rect = rootRef.value.getBoundingClientRect();
111
+ const { offset } = props;
112
+ let x = offset ? offset.x : windowWidth.value - rect.width - gapX.value;
113
+ let y = offset ? offset.y : windowHeight.value - rect.height - gapY.value;
114
+ const maxX = windowWidth.value - rect.width - gapX.value;
115
+ const maxY = windowHeight.value - rect.height - gapY.value;
116
+ if (x < gapX.value) x = gapX.value;
117
+ if (x > maxX) x = maxX;
118
+ if (y < gapY.value) y = gapY.value;
119
+ if (y > maxY) y = maxY;
120
+ const oldX = state.value.x;
121
+ const oldY = state.value.y;
122
+ state.value = {
123
+ x,
124
+ y,
125
+ width: rect.width,
126
+ height: rect.height
127
+ };
128
+ if (!dragging.value) {
129
+ if (props.magnetic === "x" && magneticSide.value) {
130
+ if (magneticSide.value === "left") {
131
+ state.value.x = boundary.value.left;
132
+ } else {
133
+ state.value.x = boundary.value.right;
134
+ }
135
+ } else {
136
+ applyMagnetic();
137
+ }
138
+ if (state.value.x !== oldX || state.value.y !== oldY) {
139
+ const offset2 = { x: state.value.x, y: state.value.y };
140
+ emit("update:offset", offset2);
141
+ emit("offset-change", offset2);
142
+ }
143
+ }
144
+ };
145
+ const touch = {
146
+ startX: (0, import_vue2.ref)(0),
147
+ startY: (0, import_vue2.ref)(0),
148
+ deltaX: (0, import_vue2.ref)(0),
149
+ deltaY: (0, import_vue2.ref)(0),
150
+ offsetX: (0, import_vue2.ref)(0),
151
+ offsetY: (0, import_vue2.ref)(0),
152
+ isTap: (0, import_vue2.ref)(true),
153
+ start(e) {
154
+ this.startX.value = "touches" in e ? e.touches[0].clientX : e.clientX;
155
+ this.startY.value = "touches" in e ? e.touches[0].clientY : e.clientY;
156
+ this.deltaX.value = 0;
157
+ this.deltaY.value = 0;
158
+ this.offsetX.value = 0;
159
+ this.offsetY.value = 0;
160
+ this.isTap.value = true;
161
+ },
162
+ move(e) {
163
+ const clientX = "touches" in e ? e.touches[0].clientX : e.clientX;
164
+ const clientY = "touches" in e ? e.touches[0].clientY : e.clientY;
165
+ this.deltaX.value = clientX - this.startX.value;
166
+ this.deltaY.value = clientY - this.startY.value;
167
+ this.offsetX.value = Math.abs(this.deltaX.value);
168
+ this.offsetY.value = Math.abs(this.deltaY.value);
169
+ const TAP_OFFSET = 5;
170
+ if (this.isTap.value && (this.offsetX.value > TAP_OFFSET || this.offsetY.value > TAP_OFFSET)) {
171
+ this.isTap.value = false;
172
+ }
173
+ }
174
+ };
175
+ let prevX = 0;
176
+ let prevY = 0;
177
+ const onTouchStart = (e) => {
178
+ touch.start(e);
179
+ dragging.value = true;
180
+ prevX = state.value.x;
181
+ prevY = state.value.y;
182
+ document.body.classList.add("floating-bubble-dragging");
183
+ if (!("touches" in e)) {
184
+ window.addEventListener("mousemove", onTouchMove, { passive: false });
185
+ window.addEventListener("mouseup", onTouchEnd);
186
+ }
187
+ };
188
+ const onTouchMove = (e) => {
189
+ if (e.cancelable) {
190
+ e.preventDefault();
191
+ }
192
+ const wasTap = touch.isTap.value;
193
+ touch.move(e);
194
+ if (wasTap && !touch.isTap.value) {
195
+ emit("drag-start");
196
+ }
197
+ if (props.axis === "lock") return;
198
+ if (!touch.isTap.value) {
199
+ if (props.axis === "x" || props.axis === "xy") {
200
+ let nextX = prevX + touch.deltaX.value;
201
+ if (nextX < boundary.value.left) nextX = boundary.value.left;
202
+ if (nextX > boundary.value.right) nextX = boundary.value.right;
203
+ state.value.x = nextX;
204
+ }
205
+ if (props.axis === "y" || props.axis === "xy") {
206
+ let nextY = prevY + touch.deltaY.value;
207
+ if (nextY < boundary.value.top) nextY = boundary.value.top;
208
+ if (nextY > boundary.value.bottom) nextY = boundary.value.bottom;
209
+ state.value.y = nextY;
210
+ }
211
+ const offset = { x: state.value.x, y: state.value.y };
212
+ emit("update:offset", offset);
213
+ }
214
+ };
215
+ const onTouchEnd = (e) => {
216
+ dragging.value = false;
217
+ document.body.classList.remove("floating-bubble-dragging");
218
+ if (e && !("touches" in e) && e.type === "mouseup") {
219
+ window.removeEventListener("mousemove", onTouchMove);
220
+ window.removeEventListener("mouseup", onTouchEnd);
221
+ }
222
+ requestAnimationFrame(() => {
223
+ if (props.magnetic === "x" && !touch.isTap.value) {
224
+ const centerX = state.value.x + state.value.width / 2;
225
+ const windowCenterX = windowWidth.value / 2;
226
+ magneticSide.value = centerX < windowCenterX ? "left" : "right";
227
+ }
228
+ applyMagnetic();
229
+ if (!touch.isTap.value) {
230
+ emit("drag-end");
231
+ const offset = { x: state.value.x, y: state.value.y };
232
+ emit("update:offset", offset);
233
+ if (prevX !== offset.x || prevY !== offset.y) {
234
+ emit("offset-change", offset);
235
+ }
236
+ }
237
+ });
238
+ };
239
+ const onClick = (e) => {
240
+ if (touch.isTap.value) {
241
+ emit("click", e);
242
+ } else {
243
+ e.stopPropagation();
244
+ }
245
+ };
246
+ const handleResize = () => {
247
+ if (typeof window !== "undefined") {
248
+ windowWidth.value = window.innerWidth;
249
+ windowHeight.value = window.innerHeight;
250
+ }
251
+ };
252
+ (0, import_vue2.onMounted)(() => {
253
+ updateState();
254
+ requestAnimationFrame(() => {
255
+ initialized.value = true;
256
+ });
257
+ if (typeof window !== "undefined") {
258
+ window.addEventListener("resize", handleResize);
259
+ }
260
+ if (rootRef.value) {
261
+ rootRef.value.addEventListener("touchmove", onTouchMove, {
262
+ passive: false
263
+ });
264
+ }
265
+ });
266
+ (0, import_vue2.onUnmounted)(() => {
267
+ document.body.classList.remove("floating-bubble-dragging");
268
+ if (typeof window !== "undefined") {
269
+ window.removeEventListener("resize", handleResize);
270
+ window.removeEventListener("mousemove", onTouchMove);
271
+ window.removeEventListener("mouseup", onTouchEnd);
272
+ }
273
+ if (rootRef.value) {
274
+ rootRef.value.removeEventListener("touchmove", onTouchMove);
275
+ }
276
+ });
277
+ (0, import_vue2.watch)(
278
+ [windowWidth, windowHeight, gapX, gapY],
279
+ updateState
280
+ );
281
+ (0, import_vue2.watch)(
282
+ () => props.offset,
283
+ (newOffset) => {
284
+ if (newOffset) {
285
+ magneticSide.value = null;
286
+ }
287
+ updateState();
288
+ },
289
+ { deep: true }
290
+ );
291
+ __expose({
292
+ offset: (0, import_vue2.computed)(() => ({ x: state.value.x, y: state.value.y }))
293
+ });
294
+ const __returned__ = { props, emit, rootRef, state, isObject, gapX, gapY, windowWidth, windowHeight, boundary, closest, applyMagnetic, dragging, initialized, magneticSide, rootStyle, updateState, touch, get prevX() {
295
+ return prevX;
296
+ }, set prevX(v) {
297
+ prevX = v;
298
+ }, get prevY() {
299
+ return prevY;
300
+ }, set prevY(v) {
301
+ prevY = v;
302
+ }, onTouchStart, onTouchMove, onTouchEnd, onClick, handleResize };
303
+ Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
304
+ return __returned__;
305
+ }
306
+ });
307
+ function __vue_render__(_ctx, _cache, $props, $setup, $data, $options) {
308
+ return (0, import_vue3.openBlock)(), (0, import_vue3.createBlock)(import_vue3.Teleport, { to: $props.teleport }, [
309
+ (0, import_vue3.createElementVNode)(
310
+ "div",
311
+ {
312
+ ref: "rootRef",
313
+ class: "floating-bubble",
314
+ style: (0, import_vue3.normalizeStyle)($setup.rootStyle),
315
+ onTouchstartPassive: $setup.onTouchStart,
316
+ onTouchend: $setup.onTouchEnd,
317
+ onTouchcancel: $setup.onTouchEnd,
318
+ onMousedown: $setup.onTouchStart,
319
+ onClickCapture: $setup.onClick
320
+ },
321
+ [
322
+ (0, import_vue3.renderSlot)(_ctx.$slots, "default")
323
+ ],
324
+ 36
325
+ /* STYLE, NEED_HYDRATION */
326
+ )
327
+ ], 8, ["to"]);
328
+ }
329
+ __vue_sfc__.render = __vue_render__;
330
+ var FloatingBubble_vue_default = __vue_sfc__;
@@ -0,0 +1,44 @@
1
+ import type { FloatingBubbleAxis, FloatingBubbleMagnetic, FloatingBubbleOffset, FloatingBubbleGap } from "./types";
2
+ type __VLS_Props = {
3
+ offset?: FloatingBubbleOffset;
4
+ axis?: FloatingBubbleAxis;
5
+ magnetic?: FloatingBubbleMagnetic;
6
+ gap?: number | FloatingBubbleGap;
7
+ teleport?: string | Element;
8
+ };
9
+ declare var __VLS_7: {};
10
+ type __VLS_Slots = {} & {
11
+ default?: (props: typeof __VLS_7) => any;
12
+ };
13
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {
14
+ offset: import("vue").ComputedRef<{
15
+ x: number;
16
+ y: number;
17
+ }>;
18
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
19
+ "update:offset": (value: FloatingBubbleOffset) => any;
20
+ click: (event: MouseEvent) => any;
21
+ "offset-change": (offset: FloatingBubbleOffset) => any;
22
+ "drag-start": () => any;
23
+ "drag-end": () => any;
24
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
25
+ "onUpdate:offset"?: ((value: FloatingBubbleOffset) => any) | undefined;
26
+ onClick?: ((event: MouseEvent) => any) | undefined;
27
+ "onOffset-change"?: ((offset: FloatingBubbleOffset) => any) | undefined;
28
+ "onDrag-start"?: (() => any) | undefined;
29
+ "onDrag-end"?: (() => any) | undefined;
30
+ }>, {
31
+ offset: FloatingBubbleOffset;
32
+ axis: FloatingBubbleAxis;
33
+ magnetic: FloatingBubbleMagnetic;
34
+ gap: number | FloatingBubbleGap;
35
+ teleport: string | Element;
36
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
37
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
38
+ declare const _default: typeof __VLS_export;
39
+ export default _default;
40
+ type __VLS_WithSlots<T, S> = T & {
41
+ new (): {
42
+ $slots: S;
43
+ };
44
+ };
@@ -0,0 +1,35 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var FloatingBubble_exports = {};
30
+ __export(FloatingBubble_exports, {
31
+ FloatingBubble: () => import_FloatingBubble_vue.default
32
+ });
33
+ module.exports = __toCommonJS(FloatingBubble_exports);
34
+ var import_FloatingBubble_vue = __toESM(require("./FloatingBubble.vue.cjs"));
35
+ __reExport(FloatingBubble_exports, require("./types.cjs"), module.exports);
@@ -0,0 +1,3 @@
1
+ import FloatingBubble from "./FloatingBubble.vue";
2
+ export { FloatingBubble };
3
+ export * from "./types";
@@ -0,0 +1,15 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __copyProps = (to, from, except, desc) => {
6
+ if (from && typeof from === "object" || typeof from === "function") {
7
+ for (let key of __getOwnPropNames(from))
8
+ if (!__hasOwnProp.call(to, key) && key !== except)
9
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
10
+ }
11
+ return to;
12
+ };
13
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
14
+ var types_exports = {};
15
+ module.exports = __toCommonJS(types_exports);
@@ -0,0 +1,24 @@
1
+ export type FloatingBubbleAxis = "x" | "y" | "xy" | "lock";
2
+ export type FloatingBubbleMagnetic = "x" | "y";
3
+ export interface FloatingBubbleOffset {
4
+ x: number;
5
+ y: number;
6
+ }
7
+ export interface FloatingBubbleGap {
8
+ x: number;
9
+ y: number;
10
+ }
11
+ export interface FloatingBubbleProps {
12
+ offset?: FloatingBubbleOffset;
13
+ axis?: FloatingBubbleAxis;
14
+ magnetic?: FloatingBubbleMagnetic;
15
+ gap?: number | FloatingBubbleGap;
16
+ teleport?: string | Element;
17
+ }
18
+ export type FloatingBubbleEmits = {
19
+ (e: "update:offset", value: FloatingBubbleOffset): void;
20
+ (e: "click", event: MouseEvent): void;
21
+ (e: "offset-change", offset: FloatingBubbleOffset): void;
22
+ (e: "drag-start"): void;
23
+ (e: "drag-end"): void;
24
+ };
@@ -0,0 +1 @@
1
+ .aipanel-iframe-container{flex:1;position:relative;overflow:hidden;display:flex;flex-direction:column}.aipanel-loading-overlay{position:absolute;inset:0;background:var(--ap-overlay-bg);flex-direction:column;align-items:center;justify-content:center;z-index:10;display:flex;opacity:0;visibility:hidden}.aipanel-loading-overlay.visible{opacity:1;visibility:visible}.aipanel-loading-spinner{width:40px;height:40px;border:3px solid var(--ap-border-primary);border-top-color:var(--ap-primary);border-radius:50%;animation:spin .8s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}.aipanel-loading-text{margin-top:12px;font-size:14px;color:var(--ap-text-placeholder)}.aipanel-error-overlay{position:absolute;inset:0;z-index:15;display:flex;opacity:0;visibility:hidden;transition:opacity .2s ease,visibility .2s ease}.aipanel-error-overlay.visible{opacity:1;visibility:visible}.aipanel-empty-state-overlay{position:absolute;inset:0;background:var(--ap-bg-secondary);flex-direction:column;align-items:center;justify-content:center;z-index:5;display:flex;opacity:0;visibility:hidden;transition:opacity .2s ease,visibility .2s ease}.aipanel-empty-state-overlay.visible{opacity:1;visibility:visible}.aipanel-empty-state-icon{color:var(--ap-text-placeholder);margin-bottom:16px}.aipanel-empty-state-text{color:var(--ap-text-primary);font-size:16px;font-weight:500;margin-bottom:24px}.aipanel-empty-state-btn{padding:10px 24px;border-radius:8px;border:none;background:var(--ap-primary);color:#fff;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s;box-shadow:var(--ap-shadow-primary)}.aipanel-empty-state-btn:hover{background:var(--ap-primary-hover);transform:translateY(-1px);box-shadow:var(--ap-shadow-primary-hover)}.aipanel-empty-state-btn:active{transform:translateY(0)}.aipanel-iframe{width:100%;height:100%;border:none;opacity:0;transition:none}.aipanel-iframe.loaded{opacity:1;transition:opacity .3s ease}
@@ -0,0 +1,162 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+ var Frame_vue_exports = {};
19
+ __export(Frame_vue_exports, {
20
+ default: () => Frame_vue_default
21
+ });
22
+ module.exports = __toCommonJS(Frame_vue_exports);
23
+ var import_Frame_sfc = require("./Frame-sfc.css");
24
+ var import_vue = require("vue");
25
+ var import_vue2 = require("vue");
26
+ var import_context = require("../context.cjs");
27
+ var import_vue3 = require("vue");
28
+ const __vue_sfc__ = /* @__PURE__ */ (0, import_vue.defineComponent)({
29
+ __name: "Frame",
30
+ setup(__props, { expose: __expose }) {
31
+ const iframeRef = (0, import_vue2.ref)(null);
32
+ const {
33
+ frameLoading,
34
+ showEmptyState,
35
+ showError,
36
+ iframeSource: iframeSrc,
37
+ emptyStateText,
38
+ emptyStateActionText,
39
+ handleEmptyAction,
40
+ handleFrameLoaded
41
+ } = (0, import_context.useAIPanelWidgetContext)();
42
+ function sendMessageToIframe(type, data) {
43
+ if (!iframeRef.value?.contentWindow) return;
44
+ iframeRef.value.contentWindow.postMessage({ type, ...data }, "*");
45
+ }
46
+ __expose({
47
+ sendMessageToIframe
48
+ });
49
+ const __returned__ = { iframeRef, frameLoading, showEmptyState, showError, iframeSrc, emptyStateText, emptyStateActionText, handleEmptyAction, handleFrameLoaded, sendMessageToIframe };
50
+ Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
51
+ return __returned__;
52
+ }
53
+ });
54
+ const _hoisted_1 = { class: "aipanel-iframe-container" };
55
+ const _hoisted_2 = { class: "aipanel-empty-state-text" };
56
+ const _hoisted_3 = ["src"];
57
+ function __vue_render__(_ctx, _cache, $props, $setup, $data, $options) {
58
+ return (0, import_vue3.openBlock)(), (0, import_vue3.createElementBlock)("div", _hoisted_1, [
59
+ (0, import_vue3.createElementVNode)(
60
+ "div",
61
+ {
62
+ class: (0, import_vue3.normalizeClass)(["aipanel-empty-state-overlay", { visible: $setup.showEmptyState }])
63
+ },
64
+ [
65
+ (0, import_vue3.renderSlot)(_ctx.$slots, "empty-state", {}, () => [
66
+ _cache[2] || (_cache[2] = (0, import_vue3.createElementVNode)(
67
+ "div",
68
+ { class: "aipanel-empty-state-icon" },
69
+ [
70
+ (0, import_vue3.createElementVNode)("svg", {
71
+ viewBox: "0 0 24 24",
72
+ width: "48",
73
+ height: "48",
74
+ fill: "none",
75
+ stroke: "currentColor",
76
+ "stroke-width": "1.5",
77
+ "aria-hidden": "true"
78
+ }, [
79
+ (0, import_vue3.createElementVNode)("path", {
80
+ "stroke-linecap": "round",
81
+ "stroke-linejoin": "round",
82
+ d: "M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 0 1-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"
83
+ })
84
+ ])
85
+ ],
86
+ -1
87
+ /* CACHED */
88
+ )),
89
+ (0, import_vue3.createElementVNode)(
90
+ "div",
91
+ _hoisted_2,
92
+ (0, import_vue3.toDisplayString)($setup.emptyStateText),
93
+ 1
94
+ /* TEXT */
95
+ ),
96
+ (0, import_vue3.createElementVNode)(
97
+ "button",
98
+ {
99
+ class: "aipanel-empty-state-btn",
100
+ type: "button",
101
+ onClick: _cache[0] || (_cache[0] = (...args) => $setup.handleEmptyAction && $setup.handleEmptyAction(...args))
102
+ },
103
+ (0, import_vue3.toDisplayString)($setup.emptyStateActionText),
104
+ 1
105
+ /* TEXT */
106
+ )
107
+ ])
108
+ ],
109
+ 2
110
+ /* CLASS */
111
+ ),
112
+ (0, import_vue3.createElementVNode)(
113
+ "div",
114
+ {
115
+ class: (0, import_vue3.normalizeClass)(["aipanel-loading-overlay", { visible: $setup.frameLoading }])
116
+ },
117
+ [
118
+ (0, import_vue3.renderSlot)(_ctx.$slots, "loading", {}, () => [
119
+ _cache[3] || (_cache[3] = (0, import_vue3.createElementVNode)(
120
+ "div",
121
+ { class: "aipanel-loading-spinner" },
122
+ null,
123
+ -1
124
+ /* CACHED */
125
+ )),
126
+ _cache[4] || (_cache[4] = (0, import_vue3.createElementVNode)(
127
+ "div",
128
+ { class: "aipanel-loading-text" },
129
+ "\u52A0\u8F7D\u4E2D...",
130
+ -1
131
+ /* CACHED */
132
+ ))
133
+ ])
134
+ ],
135
+ 2
136
+ /* CLASS */
137
+ ),
138
+ (0, import_vue3.createElementVNode)(
139
+ "div",
140
+ {
141
+ class: (0, import_vue3.normalizeClass)(["aipanel-error-overlay", { visible: $setup.showError }])
142
+ },
143
+ [
144
+ (0, import_vue3.renderSlot)(_ctx.$slots, "error")
145
+ ],
146
+ 2
147
+ /* CLASS */
148
+ ),
149
+ (0, import_vue3.renderSlot)(_ctx.$slots, "content", {}, () => [
150
+ (0, import_vue3.createElementVNode)("iframe", {
151
+ ref: "iframeRef",
152
+ class: (0, import_vue3.normalizeClass)(["aipanel-iframe", { loaded: !$setup.frameLoading }]),
153
+ src: $setup.iframeSrc,
154
+ allow: "clipboard-write; clipboard-read",
155
+ referrerpolicy: "origin",
156
+ onLoad: _cache[1] || (_cache[1] = (...args) => $setup.handleFrameLoaded && $setup.handleFrameLoaded(...args))
157
+ }, null, 42, _hoisted_3)
158
+ ])
159
+ ]);
160
+ }
161
+ __vue_sfc__.render = __vue_render__;
162
+ var Frame_vue_default = __vue_sfc__;
@@ -0,0 +1,22 @@
1
+ declare function sendMessageToIframe(type: string, data?: Record<string, unknown>): void;
2
+ declare var __VLS_1: {}, __VLS_3: {}, __VLS_5: {}, __VLS_7: {};
3
+ type __VLS_Slots = {} & {
4
+ 'empty-state'?: (props: typeof __VLS_1) => any;
5
+ } & {
6
+ loading?: (props: typeof __VLS_3) => any;
7
+ } & {
8
+ error?: (props: typeof __VLS_5) => any;
9
+ } & {
10
+ content?: (props: typeof __VLS_7) => any;
11
+ };
12
+ declare const __VLS_base: import("vue").DefineComponent<{}, {
13
+ sendMessageToIframe: typeof sendMessageToIframe;
14
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
15
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
16
+ declare const _default: typeof __VLS_export;
17
+ export default _default;
18
+ type __VLS_WithSlots<T, S> = T & {
19
+ new (): {
20
+ $slots: S;
21
+ };
22
+ };
@@ -0,0 +1 @@
1
+ .aipanel-chat-header{position:relative;flex-shrink:0;display:flex;align-items:center;justify-content:space-between;padding:0 12px;height:40px;background:var(--ap-bg-secondary);border-bottom:1px solid var(--ap-border-primary);z-index:5}.aipanel-chat-header-left{display:flex;align-items:center;gap:4px}.aipanel-chat-header-title{font-size:14px;font-weight:600;color:var(--ap-text-primary);position:absolute;left:50%;transform:translate(-50%)}.aipanel-chat-header-actions{display:flex;gap:4px}.aipanel-header-btn{width:28px;height:28px;border-radius:6px;border:none;background:transparent;color:var(--ap-text-placeholder);cursor:pointer;display:flex;align-items:center;justify-content:center;transition:all .2s}.aipanel-header-btn:hover{background:var(--ap-bg-tertiary);color:var(--ap-text-primary)}.aipanel-header-btn.close:hover{background:var(--ap-danger);color:#fff}.aipanel-header-btn.select-btn.active,.aipanel-header-btn.session-toggle.active,.aipanel-header-btn.review-panel.active{background:var(--ap-primary);color:#fff}