impact-nova 3.0.0-alpha.10 → 3.0.0-alpha.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/dist/components/flows/iris-chat/IrisChatHeaderWindowSizeButton.js +45 -36
- package/dist/components/flows/iris-chat/IrisChatSnapTile.d.ts +8 -0
- package/dist/components/flows/iris-chat/IrisChatSnapTile.js +30 -0
- package/dist/components/flows/iris-chat/IrisChatWindowSnapMenu.js +67 -53
- package/dist/components/flows/iris-chat/iris-chat-frame.d.ts +2 -1
- package/dist/components/flows/iris-chat/iris-chat-frame.js +40 -31
- package/dist/components/flows/iris-chat/iris-chat-snap-presets.d.ts +4 -1
- package/dist/components/flows/iris-chat/iris-chat-snap-presets.js +49 -29
- package/dist/components/flows/iris-chat/iris-chat-thread.js +95 -96
- package/dist/components/flows/iris-chat/iris-chat-window-chrome.d.ts +3 -0
- package/dist/components/flows/iris-chat/iris-chat-window-chrome.js +5 -2
- package/dist/components/flows/iris-chat/use-iris-chat-root.js +83 -88
- package/dist/i18n/defaultMessages.d.ts +5 -0
- package/dist/i18n/defaultMessages.js +7 -2
- package/dist/i18n/locales/de.js +5 -0
- package/dist/i18n/locales/es.js +5 -0
- package/dist/i18n/locales/hi.js +5 -0
- package/dist/i18n/locales/kn.js +5 -0
- package/dist/impact-nova.css +1 -1
- package/dist/llms/rules/installation.js +1 -1
- package/dist/llms/rules/requirements.js +1 -1
- package/package.json +1 -1
|
@@ -1,40 +1,49 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import * as
|
|
3
|
-
import { HoverCard as
|
|
4
|
-
import { ButtonIconTooltip as
|
|
5
|
-
import { Button as
|
|
6
|
-
import { useImpactNovaI18n as
|
|
7
|
-
import { createComponent as
|
|
8
|
-
import { cn as
|
|
9
|
-
import { IrisChatWindowSnapMenu as
|
|
1
|
+
import { jsxs as C, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import * as f from "react";
|
|
3
|
+
import { HoverCard as h, HoverCardTrigger as I, HoverCardContent as u } from "../../feedback/hover-card/hover-card.js";
|
|
4
|
+
import { ButtonIconTooltip as S } from "../../feedback/tooltip/button-icon-tooltip.js";
|
|
5
|
+
import { Button as _ } from "../../primitives/button/button.js";
|
|
6
|
+
import { useImpactNovaI18n as N } from "../../../i18n/use-impact-nova-i18n.js";
|
|
7
|
+
import { createComponent as z } from "../../../lib/primitives/create-component.js";
|
|
8
|
+
import { cn as g } from "../../../lib/utils.js";
|
|
9
|
+
import { IrisChatWindowSnapMenu as w } from "./IrisChatWindowSnapMenu.js";
|
|
10
10
|
import { useIrisChat as H } from "./iris-chat-context.js";
|
|
11
|
-
import { IrisChatMinimizeIcon as
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
const
|
|
15
|
-
const { t
|
|
16
|
-
return /* @__PURE__ */
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
"
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
11
|
+
import { IrisChatMinimizeIcon as b } from "./iris-chat-icons.js";
|
|
12
|
+
import { readIrisChatFrameIsCompact as A } from "./iris-chat-snap-presets.js";
|
|
13
|
+
import { IRIS_CHAT_SNAP_MENU_CLOSE_DELAY_MS as E, IRIS_CHAT_SNAP_MENU_OPEN_DELAY_MS as M } from "./iris-chat-window-chrome.js";
|
|
14
|
+
const U = z("IrisChatHeaderWindowSizeButton", ({ label: a, onClick: s, className: m, ...c }, l) => {
|
|
15
|
+
const { t } = N(), o = H(), [p, r] = f.useState(!1), n = A(o.frame, o.placement), i = a ?? t(n ? "irisChat.larger" : "irisChat.smaller");
|
|
16
|
+
return /* @__PURE__ */ C(
|
|
17
|
+
h,
|
|
18
|
+
{
|
|
19
|
+
open: p,
|
|
20
|
+
onOpenChange: r,
|
|
21
|
+
openDelay: M,
|
|
22
|
+
closeDelay: E,
|
|
23
|
+
children: [
|
|
24
|
+
/* @__PURE__ */ e(I, { asChild: !0, children: /* @__PURE__ */ e("span", { className: g("inline-flex", m), children: /* @__PURE__ */ e(S, { label: i, children: /* @__PURE__ */ e(
|
|
25
|
+
_,
|
|
26
|
+
{
|
|
27
|
+
ref: l,
|
|
28
|
+
type: "button",
|
|
29
|
+
variant: "secondary",
|
|
30
|
+
size: "icon",
|
|
31
|
+
"aria-label": i,
|
|
32
|
+
"aria-pressed": n,
|
|
33
|
+
"data-component": "iris-chat-window-size-button",
|
|
34
|
+
className: "rounded-full text-content",
|
|
35
|
+
onClick: (d) => {
|
|
36
|
+
o.toggleWindowSize(), s?.(d);
|
|
37
|
+
},
|
|
38
|
+
...c,
|
|
39
|
+
children: /* @__PURE__ */ e(b, { size: 16 })
|
|
40
|
+
}
|
|
41
|
+
) }) }) }),
|
|
42
|
+
/* @__PURE__ */ e(u, { side: "bottom", align: "end", className: "w-[15rem] p-3", children: /* @__PURE__ */ e(w, { onPresetSelected: () => r(!1) }) })
|
|
43
|
+
]
|
|
44
|
+
}
|
|
45
|
+
);
|
|
37
46
|
});
|
|
38
47
|
export {
|
|
39
|
-
|
|
48
|
+
U as IrisChatHeaderWindowSizeButton
|
|
40
49
|
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
import { IrisChatSnapPreset } from './iris-chat-snap-presets';
|
|
3
|
+
export declare function IrisChatSnapTile(props: {
|
|
4
|
+
label: string;
|
|
5
|
+
preset: IrisChatSnapPreset;
|
|
6
|
+
onSelect: (preset: IrisChatSnapPreset) => void;
|
|
7
|
+
previewClassName: string;
|
|
8
|
+
}): ReactElement;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { jsxs as a, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { cn as n } from "../../../lib/utils.js";
|
|
3
|
+
function l(e) {
|
|
4
|
+
return /* @__PURE__ */ a(
|
|
5
|
+
"button",
|
|
6
|
+
{
|
|
7
|
+
type: "button",
|
|
8
|
+
"data-testid": `iris-chat-snap-${e.preset}`,
|
|
9
|
+
"aria-label": e.label,
|
|
10
|
+
className: "flex flex-col items-center gap-1 rounded-lg p-1.5 text-content-secondary hover:bg-surface-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
11
|
+
onClick: () => e.onSelect(e.preset),
|
|
12
|
+
children: [
|
|
13
|
+
/* @__PURE__ */ r(
|
|
14
|
+
"span",
|
|
15
|
+
{
|
|
16
|
+
"aria-hidden": !0,
|
|
17
|
+
className: n(
|
|
18
|
+
"box-border h-7 w-9 rounded border border-border bg-surface-elevated",
|
|
19
|
+
e.previewClassName
|
|
20
|
+
)
|
|
21
|
+
}
|
|
22
|
+
),
|
|
23
|
+
/* @__PURE__ */ r("span", { className: "sr-only", children: e.label })
|
|
24
|
+
]
|
|
25
|
+
}
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
export {
|
|
29
|
+
l as IrisChatSnapTile
|
|
30
|
+
};
|
|
@@ -1,85 +1,99 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useImpactNovaI18n as
|
|
3
|
-
import {
|
|
4
|
-
import { useIrisChat as
|
|
5
|
-
function
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
type: "button",
|
|
10
|
-
"data-testid": `iris-chat-snap-${e.preset}`,
|
|
11
|
-
"aria-label": e.label,
|
|
12
|
-
className: "flex flex-col items-center gap-1 rounded-lg p-1.5 text-content-secondary hover:bg-surface-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
13
|
-
onClick: () => e.onSelect(e.preset),
|
|
14
|
-
children: [
|
|
15
|
-
/* @__PURE__ */ t(
|
|
16
|
-
"span",
|
|
17
|
-
{
|
|
18
|
-
"aria-hidden": !0,
|
|
19
|
-
className: c(
|
|
20
|
-
"box-border h-7 w-9 rounded border border-border bg-surface-elevated",
|
|
21
|
-
e.previewClassName
|
|
22
|
-
)
|
|
23
|
-
}
|
|
24
|
-
),
|
|
25
|
-
/* @__PURE__ */ t("span", { className: "sr-only", children: e.label })
|
|
26
|
-
]
|
|
27
|
-
}
|
|
28
|
-
);
|
|
29
|
-
}
|
|
30
|
-
function u(e) {
|
|
31
|
-
const { t: a } = o(), n = d();
|
|
32
|
-
function r(l) {
|
|
33
|
-
n.applySnapPreset(l), e.onPresetSelected?.();
|
|
1
|
+
import { jsxs as i, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { useImpactNovaI18n as n } from "../../../i18n/use-impact-nova-i18n.js";
|
|
3
|
+
import { IrisChatSnapTile as r } from "./IrisChatSnapTile.js";
|
|
4
|
+
import { useIrisChat as p } from "./iris-chat-context.js";
|
|
5
|
+
function b(s) {
|
|
6
|
+
const { t: e } = n(), o = p();
|
|
7
|
+
function a(l) {
|
|
8
|
+
o.applySnapPreset(l), s.onPresetSelected?.();
|
|
34
9
|
}
|
|
35
|
-
return /* @__PURE__ */
|
|
36
|
-
/* @__PURE__ */ t("p", { className: "text-xs font-semibold text-content-caption", children:
|
|
37
|
-
/* @__PURE__ */
|
|
10
|
+
return /* @__PURE__ */ i("div", { "data-component": "iris-chat-window-snap-menu", className: "flex flex-col gap-2", children: [
|
|
11
|
+
/* @__PURE__ */ t("p", { className: "text-xs font-semibold text-content-caption", children: e("irisChat.snapMoveResize") }),
|
|
12
|
+
/* @__PURE__ */ i("div", { className: "grid grid-cols-4 gap-1", children: [
|
|
38
13
|
/* @__PURE__ */ t(
|
|
39
|
-
|
|
14
|
+
r,
|
|
40
15
|
{
|
|
41
|
-
label:
|
|
16
|
+
label: e("irisChat.snapLeftHalf"),
|
|
42
17
|
preset: "leftHalf",
|
|
43
|
-
onSelect:
|
|
18
|
+
onSelect: a,
|
|
44
19
|
previewClassName: "bg-[linear-gradient(to_right,var(--color-primary-soft)_50%,transparent_50%)]"
|
|
45
20
|
}
|
|
46
21
|
),
|
|
47
22
|
/* @__PURE__ */ t(
|
|
48
|
-
|
|
23
|
+
r,
|
|
49
24
|
{
|
|
50
|
-
label:
|
|
25
|
+
label: e("irisChat.snapRightHalf"),
|
|
51
26
|
preset: "rightHalf",
|
|
52
|
-
onSelect:
|
|
27
|
+
onSelect: a,
|
|
53
28
|
previewClassName: "bg-[linear-gradient(to_left,var(--color-primary-soft)_50%,transparent_50%)]"
|
|
54
29
|
}
|
|
55
30
|
),
|
|
56
31
|
/* @__PURE__ */ t(
|
|
57
|
-
|
|
32
|
+
r,
|
|
58
33
|
{
|
|
59
|
-
label:
|
|
34
|
+
label: e("irisChat.snapTopHalf"),
|
|
60
35
|
preset: "topHalf",
|
|
61
|
-
onSelect:
|
|
36
|
+
onSelect: a,
|
|
62
37
|
previewClassName: "bg-[linear-gradient(to_bottom,var(--color-primary-soft)_50%,transparent_50%)]"
|
|
63
38
|
}
|
|
64
39
|
),
|
|
65
40
|
/* @__PURE__ */ t(
|
|
66
|
-
|
|
41
|
+
r,
|
|
67
42
|
{
|
|
68
|
-
label:
|
|
43
|
+
label: e("irisChat.snapBottomHalf"),
|
|
69
44
|
preset: "bottomHalf",
|
|
70
|
-
onSelect:
|
|
45
|
+
onSelect: a,
|
|
71
46
|
previewClassName: "bg-[linear-gradient(to_top,var(--color-primary-soft)_50%,transparent_50%)]"
|
|
72
47
|
}
|
|
73
48
|
)
|
|
74
49
|
] }),
|
|
75
|
-
/* @__PURE__ */
|
|
50
|
+
/* @__PURE__ */ t("p", { className: "text-xs font-semibold text-content-caption", children: e("irisChat.snapDock") }),
|
|
51
|
+
/* @__PURE__ */ i("div", { className: "grid grid-cols-4 gap-1", children: [
|
|
52
|
+
/* @__PURE__ */ t(
|
|
53
|
+
r,
|
|
54
|
+
{
|
|
55
|
+
label: e("irisChat.snapBottomLeft"),
|
|
56
|
+
preset: "bottomLeft",
|
|
57
|
+
onSelect: a,
|
|
58
|
+
previewClassName: "bg-[radial-gradient(at_0%_100%,var(--color-primary-soft)_55%,transparent_56%)]"
|
|
59
|
+
}
|
|
60
|
+
),
|
|
61
|
+
/* @__PURE__ */ t(
|
|
62
|
+
r,
|
|
63
|
+
{
|
|
64
|
+
label: e("irisChat.snapBottomRight"),
|
|
65
|
+
preset: "bottomRight",
|
|
66
|
+
onSelect: a,
|
|
67
|
+
previewClassName: "bg-[radial-gradient(at_100%_100%,var(--color-primary-soft)_55%,transparent_56%)]"
|
|
68
|
+
}
|
|
69
|
+
),
|
|
70
|
+
/* @__PURE__ */ t(
|
|
71
|
+
r,
|
|
72
|
+
{
|
|
73
|
+
label: e("irisChat.snapTopLeft"),
|
|
74
|
+
preset: "topLeft",
|
|
75
|
+
onSelect: a,
|
|
76
|
+
previewClassName: "bg-[radial-gradient(at_0%_0%,var(--color-primary-soft)_55%,transparent_56%)]"
|
|
77
|
+
}
|
|
78
|
+
),
|
|
79
|
+
/* @__PURE__ */ t(
|
|
80
|
+
r,
|
|
81
|
+
{
|
|
82
|
+
label: e("irisChat.snapTopRight"),
|
|
83
|
+
preset: "topRight",
|
|
84
|
+
onSelect: a,
|
|
85
|
+
previewClassName: "bg-[radial-gradient(at_100%_0%,var(--color-primary-soft)_55%,transparent_56%)]"
|
|
86
|
+
}
|
|
87
|
+
)
|
|
88
|
+
] }),
|
|
89
|
+
/* @__PURE__ */ i(
|
|
76
90
|
"button",
|
|
77
91
|
{
|
|
78
92
|
type: "button",
|
|
79
93
|
"data-testid": "iris-chat-snap-fill",
|
|
80
|
-
"aria-label":
|
|
94
|
+
"aria-label": e("irisChat.snapFill"),
|
|
81
95
|
className: "flex items-center gap-2 rounded-lg border border-border bg-surface-muted px-2 py-1.5 text-left text-xs font-medium text-content hover:bg-surface-subtle focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
82
|
-
onClick: () =>
|
|
96
|
+
onClick: () => a("fill"),
|
|
83
97
|
children: [
|
|
84
98
|
/* @__PURE__ */ t(
|
|
85
99
|
"span",
|
|
@@ -88,12 +102,12 @@ function u(e) {
|
|
|
88
102
|
className: "h-5 w-7 rounded border border-border bg-primary-soft"
|
|
89
103
|
}
|
|
90
104
|
),
|
|
91
|
-
|
|
105
|
+
e("irisChat.snapFill")
|
|
92
106
|
]
|
|
93
107
|
}
|
|
94
108
|
)
|
|
95
109
|
] });
|
|
96
110
|
}
|
|
97
111
|
export {
|
|
98
|
-
|
|
112
|
+
b as IrisChatWindowSnapMenu
|
|
99
113
|
};
|
|
@@ -24,7 +24,8 @@ export declare function readIrisChatMaxFrameSize(viewport: IrisChatViewport): {
|
|
|
24
24
|
height: number;
|
|
25
25
|
};
|
|
26
26
|
export declare function createDefaultIrisChatFrame(viewport?: IrisChatViewport): IrisChatFrame;
|
|
27
|
-
export declare function
|
|
27
|
+
export declare function readIrisChatFrameWithSizeAnchoredAtBottomRight(frame: IrisChatFrame, targetWidth: number, targetHeight: number, viewport?: IrisChatViewport): IrisChatFrame;
|
|
28
|
+
export declare function createCompactIrisChatFrame(frame: IrisChatFrame, viewport?: IrisChatViewport): IrisChatFrame;
|
|
28
29
|
export declare function clampIrisChatFrame(frame: IrisChatFrame, viewport: IrisChatViewport): IrisChatFrame;
|
|
29
30
|
export declare function moveIrisChatFrame(frame: IrisChatFrame, deltaX: number, deltaY: number, viewport: IrisChatViewport): IrisChatFrame;
|
|
30
31
|
export declare function resizeIrisChatFrame(frame: IrisChatFrame, edge: IrisChatResizeEdge, deltaX: number, deltaY: number, viewport: IrisChatViewport): IrisChatFrame;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
const
|
|
2
|
-
function
|
|
1
|
+
const C = 16, s = 280, a = 360, P = 420, S = 640, r = 360, F = 480, D = 80;
|
|
2
|
+
function M() {
|
|
3
3
|
return typeof window > "u" ? { width: 1280, height: 800 } : { width: window.innerWidth, height: window.innerHeight };
|
|
4
4
|
}
|
|
5
|
-
function
|
|
5
|
+
function T(_) {
|
|
6
6
|
const t = Math.max(
|
|
7
7
|
280,
|
|
8
8
|
_.width - 32
|
|
@@ -12,8 +12,8 @@ function R(_) {
|
|
|
12
12
|
);
|
|
13
13
|
return { width: t, height: I };
|
|
14
14
|
}
|
|
15
|
-
function
|
|
16
|
-
const { width: t, height: I } =
|
|
15
|
+
function X(_ = M()) {
|
|
16
|
+
const { width: t, height: I } = T(_), h = Math.min(420, t), i = Math.min(640, I);
|
|
17
17
|
return {
|
|
18
18
|
x: _.width - h - 16,
|
|
19
19
|
y: _.height - i - 16,
|
|
@@ -21,24 +21,32 @@ function D(_ = e()) {
|
|
|
21
21
|
height: i
|
|
22
22
|
};
|
|
23
23
|
}
|
|
24
|
-
function
|
|
25
|
-
const
|
|
26
|
-
return
|
|
24
|
+
function e(_, t, I, h = M()) {
|
|
25
|
+
const i = T(h), n = Math.min(Math.max(t, 280), i.width), A = Math.min(Math.max(I, 360), i.height), H = _.x + _.width, R = _.y + _.height;
|
|
26
|
+
return o(
|
|
27
27
|
{
|
|
28
|
-
x:
|
|
29
|
-
y:
|
|
30
|
-
width:
|
|
31
|
-
height:
|
|
28
|
+
x: H - n,
|
|
29
|
+
y: R - A,
|
|
30
|
+
width: n,
|
|
31
|
+
height: A
|
|
32
32
|
},
|
|
33
|
+
h
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
function m(_, t = M()) {
|
|
37
|
+
return e(
|
|
38
|
+
_,
|
|
39
|
+
360,
|
|
40
|
+
480,
|
|
33
41
|
t
|
|
34
42
|
);
|
|
35
43
|
}
|
|
36
|
-
function
|
|
37
|
-
const I =
|
|
38
|
-
return { x: E, y:
|
|
44
|
+
function o(_, t) {
|
|
45
|
+
const I = T(t), h = Math.min(Math.max(_.width, 280), I.width), i = Math.min(Math.max(_.height, 360), I.height), n = t.width - 80, A = t.height - 80, H = 16 - h + 80, R = 16, E = Math.min(Math.max(_.x, H), n), c = Math.min(Math.max(_.y, R), A);
|
|
46
|
+
return { x: E, y: c, width: h, height: i };
|
|
39
47
|
}
|
|
40
48
|
function d(_, t, I, h) {
|
|
41
|
-
return
|
|
49
|
+
return o(
|
|
42
50
|
{
|
|
43
51
|
..._,
|
|
44
52
|
x: _.x + t,
|
|
@@ -47,11 +55,11 @@ function d(_, t, I, h) {
|
|
|
47
55
|
h
|
|
48
56
|
);
|
|
49
57
|
}
|
|
50
|
-
function
|
|
51
|
-
let { x: n, y:
|
|
52
|
-
return t.includes("east") && (
|
|
58
|
+
function u(_, t, I, h, i) {
|
|
59
|
+
let { x: n, y: A, width: H, height: R } = _;
|
|
60
|
+
return t.includes("east") && (H += I), t.includes("west") && (n += I, H -= I), t.includes("south") && (R += h), t.includes("north") && (A += h, R -= h), o({ x: n, y: A, width: H, height: R }, i);
|
|
53
61
|
}
|
|
54
|
-
function
|
|
62
|
+
function x(_) {
|
|
55
63
|
return {
|
|
56
64
|
left: _.x,
|
|
57
65
|
top: _.y,
|
|
@@ -62,18 +70,19 @@ function u(_) {
|
|
|
62
70
|
export {
|
|
63
71
|
F as IRIS_CHAT_FRAME_COMPACT_HEIGHT_PX,
|
|
64
72
|
r as IRIS_CHAT_FRAME_COMPACT_WIDTH_PX,
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
73
|
+
S as IRIS_CHAT_FRAME_DEFAULT_HEIGHT_PX,
|
|
74
|
+
P as IRIS_CHAT_FRAME_DEFAULT_WIDTH_PX,
|
|
75
|
+
a as IRIS_CHAT_FRAME_MIN_HEIGHT_PX,
|
|
68
76
|
s as IRIS_CHAT_FRAME_MIN_WIDTH_PX,
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
77
|
+
C as IRIS_CHAT_FRAME_PADDING_PX,
|
|
78
|
+
D as IRIS_CHAT_HEADER_MIN_VISIBLE_PX,
|
|
79
|
+
o as clampIrisChatFrame,
|
|
72
80
|
m as createCompactIrisChatFrame,
|
|
73
|
-
|
|
81
|
+
X as createDefaultIrisChatFrame,
|
|
74
82
|
d as moveIrisChatFrame,
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
83
|
+
x as readIrisChatFrameStyle,
|
|
84
|
+
e as readIrisChatFrameWithSizeAnchoredAtBottomRight,
|
|
85
|
+
T as readIrisChatMaxFrameSize,
|
|
86
|
+
M as readIrisChatViewport,
|
|
87
|
+
u as resizeIrisChatFrame
|
|
79
88
|
};
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { IrisChatFrame, IrisChatViewport } from './iris-chat-frame';
|
|
2
|
-
|
|
2
|
+
import { IrisChatPlacement } from './iris-chat.types';
|
|
3
|
+
export type IrisChatSnapPreset = "leftHalf" | "rightHalf" | "topHalf" | "bottomHalf" | "fill" | "bottomRight" | "bottomLeft" | "topRight" | "topLeft";
|
|
4
|
+
export type IrisChatDockCorner = "bottomRight" | "bottomLeft" | "topRight" | "topLeft";
|
|
3
5
|
export declare function createIrisChatSnapFrame(preset: IrisChatSnapPreset, viewport?: IrisChatViewport): IrisChatFrame;
|
|
4
6
|
export declare function readIrisChatFrameIsLarge(frame: IrisChatFrame, viewport: IrisChatViewport, largeThresholdRatio?: number): boolean;
|
|
7
|
+
export declare function readIrisChatFrameIsCompact(frame: IrisChatFrame, placement: IrisChatPlacement): boolean;
|
|
@@ -1,63 +1,83 @@
|
|
|
1
|
-
import { readIrisChatMaxFrameSize as s, clampIrisChatFrame as
|
|
2
|
-
function
|
|
3
|
-
const t =
|
|
4
|
-
let
|
|
5
|
-
switch (
|
|
1
|
+
import { IRIS_CHAT_FRAME_COMPACT_WIDTH_PX as g, IRIS_CHAT_FRAME_COMPACT_HEIGHT_PX as I, readIrisChatMaxFrameSize as s, clampIrisChatFrame as _, IRIS_CHAT_FRAME_PADDING_PX as d, IRIS_CHAT_FRAME_DEFAULT_WIDTH_PX as m, IRIS_CHAT_FRAME_DEFAULT_HEIGHT_PX as f } from "./iris-chat-frame.js";
|
|
2
|
+
function H(i, h) {
|
|
3
|
+
const t = d, o = s(h), e = Math.min(m, o.width), a = Math.min(f, o.height);
|
|
4
|
+
let r = t, c = t;
|
|
5
|
+
switch (i) {
|
|
6
|
+
case "bottomRight":
|
|
7
|
+
r = h.width - e - t, c = h.height - a - t;
|
|
8
|
+
break;
|
|
9
|
+
case "bottomLeft":
|
|
10
|
+
c = h.height - a - t;
|
|
11
|
+
break;
|
|
12
|
+
case "topRight":
|
|
13
|
+
r = h.width - e - t;
|
|
14
|
+
break;
|
|
15
|
+
}
|
|
16
|
+
return _({ x: r, y: c, width: e, height: a }, h);
|
|
17
|
+
}
|
|
18
|
+
function A(i, h = { width: 1280, height: 800 }) {
|
|
19
|
+
const t = d, o = s(h), e = o.width, a = o.height, r = Math.floor(e / 2), c = Math.floor(a / 2);
|
|
20
|
+
let n;
|
|
21
|
+
switch (i) {
|
|
6
22
|
case "leftHalf":
|
|
7
|
-
|
|
23
|
+
n = {
|
|
8
24
|
x: t,
|
|
9
25
|
y: t,
|
|
10
|
-
width:
|
|
11
|
-
height:
|
|
26
|
+
width: r,
|
|
27
|
+
height: a
|
|
12
28
|
};
|
|
13
29
|
break;
|
|
14
30
|
case "rightHalf":
|
|
15
|
-
|
|
16
|
-
x: t +
|
|
31
|
+
n = {
|
|
32
|
+
x: t + r,
|
|
17
33
|
y: t,
|
|
18
|
-
width:
|
|
19
|
-
height:
|
|
34
|
+
width: e - r,
|
|
35
|
+
height: a
|
|
20
36
|
};
|
|
21
37
|
break;
|
|
22
38
|
case "topHalf":
|
|
23
|
-
|
|
39
|
+
n = {
|
|
24
40
|
x: t,
|
|
25
41
|
y: t,
|
|
26
|
-
width:
|
|
42
|
+
width: e,
|
|
27
43
|
height: c
|
|
28
44
|
};
|
|
29
45
|
break;
|
|
30
46
|
case "bottomHalf":
|
|
31
|
-
|
|
47
|
+
n = {
|
|
32
48
|
x: t,
|
|
33
49
|
y: t + c,
|
|
34
|
-
width:
|
|
35
|
-
height:
|
|
50
|
+
width: e,
|
|
51
|
+
height: a - c
|
|
36
52
|
};
|
|
37
53
|
break;
|
|
38
54
|
case "fill":
|
|
39
|
-
|
|
55
|
+
n = {
|
|
40
56
|
x: t,
|
|
41
57
|
y: t,
|
|
42
|
-
width:
|
|
43
|
-
height:
|
|
58
|
+
width: e,
|
|
59
|
+
height: a
|
|
44
60
|
};
|
|
45
61
|
break;
|
|
62
|
+
case "bottomRight":
|
|
63
|
+
case "bottomLeft":
|
|
64
|
+
case "topRight":
|
|
65
|
+
case "topLeft":
|
|
66
|
+
return H(i, h);
|
|
46
67
|
default:
|
|
47
|
-
|
|
68
|
+
n = {
|
|
48
69
|
x: t,
|
|
49
70
|
y: t,
|
|
50
|
-
width:
|
|
51
|
-
height:
|
|
71
|
+
width: e,
|
|
72
|
+
height: a
|
|
52
73
|
};
|
|
53
74
|
}
|
|
54
|
-
return
|
|
75
|
+
return _(n, h);
|
|
55
76
|
}
|
|
56
|
-
function
|
|
57
|
-
|
|
58
|
-
return h >= t && i >= t;
|
|
77
|
+
function C(i, h) {
|
|
78
|
+
return h === "minimized" ? !0 : i.width <= g && i.height <= I;
|
|
59
79
|
}
|
|
60
80
|
export {
|
|
61
|
-
|
|
62
|
-
|
|
81
|
+
A as createIrisChatSnapFrame,
|
|
82
|
+
C as readIrisChatFrameIsCompact
|
|
63
83
|
};
|