@floegence/floe-webapp-core 0.86.55 → 0.86.58
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/dist/chat.css +12 -8
- package/dist/components/chat/blocks/HtmlPreviewCanvas.d.ts +1 -1
- package/dist/components/chat/blocks/HtmlPreviewCanvas.js +75 -72
- package/dist/components/chat/blocks/MarkdownMedia.js +1 -1
- package/dist/components/chat/blocks/SvgBlock.js +1 -1
- package/dist/components/ui/FloatingWindow.js +297 -252
- package/dist/components/ui/floatingWindowGeometry.d.ts +1 -0
- package/dist/components/ui/floatingWindowGeometry.js +87 -71
- package/dist/node_modules/.pnpm/dompurify@3.4.17/node_modules/dompurify/dist/purify.es.js +1520 -0
- package/dist/pptx.js +1 -1
- package/dist/styles.css +1 -1
- package/package.json +2 -2
- package/dist/node_modules/.pnpm/dompurify@3.4.16/node_modules/dompurify/dist/purify.es.js +0 -1480
|
@@ -30,6 +30,7 @@ interface ResolveFloatingWindowRectOptions {
|
|
|
30
30
|
pointer: PointerPosition;
|
|
31
31
|
dragStartPos: PointerPosition;
|
|
32
32
|
dragStartRect: FloatingWindowRect;
|
|
33
|
+
dragTitlebarHeight?: number;
|
|
33
34
|
resizeStartPos: PointerPosition;
|
|
34
35
|
resizeStartRect: FloatingWindowRect;
|
|
35
36
|
resizeHandle: FloatingWindowResizeHandle;
|
|
@@ -1,97 +1,113 @@
|
|
|
1
|
-
function
|
|
2
|
-
return Math.max(
|
|
1
|
+
function r(t, n, s) {
|
|
2
|
+
return Math.max(n, Math.min(s, t));
|
|
3
3
|
}
|
|
4
|
-
function
|
|
5
|
-
const
|
|
6
|
-
return
|
|
4
|
+
function Y(t, n, s, m, e) {
|
|
5
|
+
const x = r(t, n, s), i = t - x, c = Math.max(0, i < 0 ? m : e);
|
|
6
|
+
return x + (c === 0 ? 0 : i * c / (c + Math.abs(i)));
|
|
7
7
|
}
|
|
8
|
-
function
|
|
9
|
-
const
|
|
10
|
-
return
|
|
8
|
+
function f(t, n, s) {
|
|
9
|
+
const m = Math.max(0, s), e = Math.min(t, m), x = Math.max(e, Math.min(n, m));
|
|
10
|
+
return { min: e, max: x };
|
|
11
11
|
}
|
|
12
|
-
function
|
|
13
|
-
const
|
|
12
|
+
function R(t) {
|
|
13
|
+
const n = Number(t);
|
|
14
|
+
return Number.isFinite(n) && n > 0 ? n : 0;
|
|
15
|
+
}
|
|
16
|
+
function I(t, n = {}) {
|
|
17
|
+
const s = Math.max(0, t.width), m = Math.max(0, t.height), e = Math.min(R(n.left), s), x = Math.min(R(n.top), m), i = Math.min(R(n.right), Math.max(0, s - e)), c = Math.min(R(n.bottom), Math.max(0, m - x));
|
|
14
18
|
return {
|
|
15
|
-
x: (
|
|
16
|
-
y: (
|
|
17
|
-
width: Math.max(0,
|
|
18
|
-
height: Math.max(0,
|
|
19
|
+
x: (t.x ?? 0) + e,
|
|
20
|
+
y: (t.y ?? 0) + x,
|
|
21
|
+
width: Math.max(0, s - e - i),
|
|
22
|
+
height: Math.max(0, m - x - c)
|
|
19
23
|
};
|
|
20
24
|
}
|
|
21
|
-
function
|
|
22
|
-
return
|
|
25
|
+
function V(t) {
|
|
26
|
+
return t.x + t.width;
|
|
23
27
|
}
|
|
24
|
-
function
|
|
25
|
-
return
|
|
28
|
+
function N(t) {
|
|
29
|
+
return t.y + t.height;
|
|
26
30
|
}
|
|
27
|
-
function
|
|
31
|
+
function T(t) {
|
|
28
32
|
const {
|
|
29
|
-
mode:
|
|
30
|
-
pointer:
|
|
31
|
-
dragStartPos:
|
|
32
|
-
dragStartRect:
|
|
33
|
-
resizeStartPos:
|
|
34
|
-
resizeStartRect:
|
|
35
|
-
resizeHandle:
|
|
36
|
-
minSize:
|
|
37
|
-
maxSize:
|
|
38
|
-
viewport:
|
|
39
|
-
viewportInsets:
|
|
40
|
-
mobile:
|
|
41
|
-
mobilePadding:
|
|
42
|
-
} =
|
|
43
|
-
if (
|
|
44
|
-
const
|
|
33
|
+
mode: n,
|
|
34
|
+
pointer: s,
|
|
35
|
+
dragStartPos: m,
|
|
36
|
+
dragStartRect: e,
|
|
37
|
+
resizeStartPos: x,
|
|
38
|
+
resizeStartRect: i,
|
|
39
|
+
resizeHandle: c,
|
|
40
|
+
minSize: w,
|
|
41
|
+
maxSize: h,
|
|
42
|
+
viewport: S,
|
|
43
|
+
viewportInsets: W,
|
|
44
|
+
mobile: b,
|
|
45
|
+
mobilePadding: p
|
|
46
|
+
} = t, a = I(S, W), d = V(a), g = N(a), u = s.x - (n === "drag" ? m.x : x.x), B = s.y - (n === "drag" ? m.y : x.y);
|
|
47
|
+
if (n === "drag") {
|
|
48
|
+
const o = Math.max(a.x, d - e.width), M = Math.max(a.y, g - e.height), l = Math.min(160, e.width, a.width), y = Math.min(t.dragTitlebarHeight ?? 32, e.height), P = Math.min(24, y, a.height), X = Math.min(160, e.width - l);
|
|
45
49
|
return {
|
|
46
|
-
...
|
|
47
|
-
x:
|
|
48
|
-
|
|
50
|
+
...e,
|
|
51
|
+
x: b ? r(a.x + p, a.x, o) : Y(
|
|
52
|
+
e.x + u,
|
|
53
|
+
a.x,
|
|
54
|
+
o,
|
|
55
|
+
X,
|
|
56
|
+
Math.min(X, d - l - o)
|
|
57
|
+
),
|
|
58
|
+
y: Y(
|
|
59
|
+
e.y + B,
|
|
60
|
+
a.y,
|
|
61
|
+
M,
|
|
62
|
+
y - P,
|
|
63
|
+
Math.min(160, g - P - M)
|
|
64
|
+
)
|
|
49
65
|
};
|
|
50
66
|
}
|
|
51
|
-
let
|
|
52
|
-
if (!
|
|
53
|
-
const
|
|
54
|
-
|
|
67
|
+
let v = i.width, z = i.height, H = i.x, F = i.y;
|
|
68
|
+
if (!b && c.includes("e")) {
|
|
69
|
+
const o = f(w.width, h.width, d - i.x);
|
|
70
|
+
v = r(i.width + u, o.min, o.max);
|
|
55
71
|
}
|
|
56
|
-
if (!
|
|
57
|
-
const
|
|
58
|
-
|
|
72
|
+
if (!b && c.includes("w")) {
|
|
73
|
+
const o = i.x + i.width, M = f(w.width, h.width, o - a.x), l = o - M.max, y = Math.max(l, o - M.min);
|
|
74
|
+
H = r(i.x + u, l, y), v = Math.max(0, o - H);
|
|
59
75
|
}
|
|
60
|
-
if (
|
|
61
|
-
const
|
|
62
|
-
z =
|
|
76
|
+
if (c.includes("s")) {
|
|
77
|
+
const o = f(w.height, h.height, g - i.y);
|
|
78
|
+
z = r(i.height + B, o.min, o.max);
|
|
63
79
|
}
|
|
64
|
-
if (
|
|
65
|
-
const
|
|
66
|
-
F =
|
|
80
|
+
if (c.includes("n")) {
|
|
81
|
+
const o = i.y + i.height, M = f(w.height, h.height, o - a.y), l = o - M.max, y = Math.max(l, o - M.min);
|
|
82
|
+
F = r(i.y + B, l, y), z = Math.max(0, o - F);
|
|
67
83
|
}
|
|
68
84
|
return {
|
|
69
|
-
x:
|
|
70
|
-
y:
|
|
71
|
-
width:
|
|
85
|
+
x: r(H, a.x, Math.max(a.x, d - v)),
|
|
86
|
+
y: r(F, a.y, Math.max(a.y, g - z)),
|
|
87
|
+
width: v,
|
|
72
88
|
height: z
|
|
73
89
|
};
|
|
74
90
|
}
|
|
75
|
-
function
|
|
91
|
+
function A(t) {
|
|
76
92
|
const {
|
|
77
|
-
rect:
|
|
78
|
-
minSize:
|
|
79
|
-
maxSize:
|
|
80
|
-
viewport:
|
|
81
|
-
viewportInsets:
|
|
82
|
-
mobile:
|
|
83
|
-
mobilePadding:
|
|
84
|
-
center:
|
|
85
|
-
} =
|
|
93
|
+
rect: n,
|
|
94
|
+
minSize: s,
|
|
95
|
+
maxSize: m,
|
|
96
|
+
viewport: e,
|
|
97
|
+
viewportInsets: x,
|
|
98
|
+
mobile: i,
|
|
99
|
+
mobilePadding: c,
|
|
100
|
+
center: w = !1
|
|
101
|
+
} = t, h = I(e, x), S = V(h), W = N(h), b = i ? Math.max(0, h.width - c * 2) : h.width, p = f(s.width, m.width, b), a = f(s.height, m.height, h.height), d = i ? p.max : r(n.width, p.min, p.max), g = r(n.height, a.min, a.max), u = Math.max(h.x, S - d), B = Math.max(h.y, W - g);
|
|
86
102
|
return {
|
|
87
|
-
x:
|
|
88
|
-
y:
|
|
89
|
-
width:
|
|
90
|
-
height:
|
|
103
|
+
x: i ? r(h.x + c, h.x, u) : w ? Math.max(h.x, Math.round(h.x + (h.width - d) / 2)) : r(n.x, h.x, u),
|
|
104
|
+
y: w ? Math.max(h.y, Math.round(h.y + (h.height - g) / 2)) : r(n.y, h.y, B),
|
|
105
|
+
width: d,
|
|
106
|
+
height: g
|
|
91
107
|
};
|
|
92
108
|
}
|
|
93
109
|
export {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
110
|
+
A as normalizeFloatingWindowRect,
|
|
111
|
+
T as resolveFloatingWindowRect,
|
|
112
|
+
I as resolveFloatingWindowViewport
|
|
97
113
|
};
|